summaryrefslogtreecommitdiff
path: root/src/gpu-compute/shader.cc
diff options
context:
space:
mode:
authorBrandon Potter <brandon.potter@amd.com>2017-02-27 14:10:15 -0500
committerBrandon Potter <brandon.potter@amd.com>2017-02-27 14:10:15 -0500
commit2367198921765848a4f5b3d020a7cc5776209f80 (patch)
tree00cff9357d9e5f2bec277cf937e8a73944ce1c98 /src/gpu-compute/shader.cc
parent073cb266079edddec64ea8cd5169dd2cbef8f812 (diff)
downloadgem5-2367198921765848a4f5b3d020a7cc5776209f80.tar.xz
syscall_emul: [PATCH 15/22] add clone/execve for threading and multiprocess simulations
Modifies the clone system call and adds execve system call. Requires allowing processes to steal thread contexts from other processes in the same system object and the ability to detach pieces of process state (such as MemState) to allow dynamic sharing.
Diffstat (limited to 'src/gpu-compute/shader.cc')
-rw-r--r--src/gpu-compute/shader.cc11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/gpu-compute/shader.cc b/src/gpu-compute/shader.cc
index e47edce2c..6deaaab94 100644
--- a/src/gpu-compute/shader.cc
+++ b/src/gpu-compute/shader.cc
@@ -79,18 +79,19 @@ Shader::mmap(int length)
length = roundUp(length, TheISA::PageBytes);
Process *proc = gpuTc->getProcessPtr();
+ auto mem_state = proc->memState;
if (proc->mmapGrowsDown()) {
DPRINTF(HSAIL, "GROWS DOWN");
- start = proc->mmap_end - length;
- proc->mmap_end = start;
+ start = mem_state->mmapEnd - length;
+ mem_state->mmapEnd = start;
} else {
DPRINTF(HSAIL, "GROWS UP");
- start = proc->mmap_end;
- proc->mmap_end += length;
+ start = mem_state->mmapEnd;
+ mem_state->mmapEnd += length;
// assertion to make sure we don't overwrite the stack (it grows down)
- assert(proc->mmap_end < proc->stack_base - proc->max_stack_size);
+ assert(mem_state->stackBase - proc->maxStackSize > mem_state->mmapEnd);
}
DPRINTF(HSAIL,"Shader::mmap start= %#x, %#x\n", start, length);