[Renderscript] Add stack argument reading code for Mipsel 2

This commit implements the reading of stack spilled function arguments for little endian MIPS targets.

Committed on behalf of: Dean De Leo <dean@codeplay.com>

llvm-svn: 263131
This commit is contained in:
Aidan Dodds
2016-03-10 17:37:02 +00:00
parent 17e07c0ab4
commit 6dd4b57987

View File

@@ -364,8 +364,15 @@ GetArgsMipsel(GetArgsCtx &ctx, ArgItem *arg_list, size_t num_args)
// arguments passed on the stack
else
{
if (log)
log->Printf("%s - reading arguments spilled to stack not implemented.", __FUNCTION__);
const size_t arg_size = sizeof(uint32_t);
uint64_t sp = ctx.reg_ctx->GetSP();
uint32_t offset = i * arg_size;
arg.value = 0;
Error error;
size_t bytes_read = ctx.process->ReadMemory(sp + offset, &arg.value, arg_size, error);
success = (error.Success() && bytes_read == arg_size);
if (!success && log)
log->Printf ("RenderScriptRuntime::GetArgSimple - error reading Mips stack: %s.", error.AsCString());
}
// fail if we couldn't read this argument
if (!success)