Deleted Added
sdiff udiff text old ( 11308:7d8836fd043d ) new ( 11386:94c09b607a84 )
full compact
1/*
2 * Copyright (c) 2011-2015 Advanced Micro Devices, Inc.
3 * All rights reserved.
4 *
5 * For use for simulation and test purposes only
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions are met:

--- 64 unchanged lines hidden (view full) ---

73Shader::mmap(int length)
74{
75
76 Addr start;
77
78 // round up length to the next page
79 length = roundUp(length, TheISA::PageBytes);
80
81 if (X86Linux64::mmapGrowsDown()) {
82 DPRINTF(HSAIL, "GROWS DOWN");
83 start = gpuTc->getProcessPtr()->mmap_end -length;
84 gpuTc->getProcessPtr()->mmap_end = start;
85 } else {
86 DPRINTF(HSAIL, "GROWS UP");
87 start = gpuTc->getProcessPtr()->mmap_end;
88 gpuTc->getProcessPtr()->mmap_end += length;
89
90 // assertion to make sure we don't overwrite the stack (it grows down)
91 assert(gpuTc->getProcessPtr()->mmap_end <
92 gpuTc->getProcessPtr()->stack_base -
93 gpuTc->getProcessPtr()->max_stack_size);
94
95 }
96
97 DPRINTF(HSAIL,"Shader::mmap start= %#x, %#x\n", start, length);
98
99 gpuTc->getProcessPtr()->allocateMem(start,length);
100
101 return start;
102}
103
104void
105Shader::init()
106{
107 // grab the threadContext of the thread running on the CPU

--- 305 unchanged lines hidden ---