process.cc (10223:34f48d0dac97) | process.cc (10318:98771a936b61) |
---|---|
1/* 2 * Copyright (c) 2003-2004 The Regents of The University of Michigan 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions are 7 * met: redistributions of source code must retain the above copyright 8 * notice, this list of conditions and the following disclaimer; --- 43 unchanged lines hidden (view full) --- 52 53SparcLiveProcess::SparcLiveProcess(LiveProcessParams * params, 54 ObjectFile *objFile, Addr _StackBias) 55 : LiveProcess(params, objFile), StackBias(_StackBias) 56{ 57 58 // XXX all the below need to be updated for SPARC - Ali 59 brk_point = objFile->dataBase() + objFile->dataSize() + objFile->bssSize(); | 1/* 2 * Copyright (c) 2003-2004 The Regents of The University of Michigan 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions are 7 * met: redistributions of source code must retain the above copyright 8 * notice, this list of conditions and the following disclaimer; --- 43 unchanged lines hidden (view full) --- 52 53SparcLiveProcess::SparcLiveProcess(LiveProcessParams * params, 54 ObjectFile *objFile, Addr _StackBias) 55 : LiveProcess(params, objFile), StackBias(_StackBias) 56{ 57 58 // XXX all the below need to be updated for SPARC - Ali 59 brk_point = objFile->dataBase() + objFile->dataSize() + objFile->bssSize(); |
60 brk_point = roundUp(brk_point, VMPageSize); | 60 brk_point = roundUp(brk_point, PageBytes); |
61 62 // Set pointer for next thread stack. Reserve 8M for main stack. 63 next_thread_stack_base = stack_base - (8 * 1024 * 1024); 64 65 // Initialize these to 0s 66 fillStart = 0; 67 spillStart = 0; 68} --- 92 unchanged lines hidden (view full) --- 161 162 ThreadContext *tc = system->getThreadContext(contextIds[0]); 163 // The process runs in user mode with 32 bit addresses 164 PSTATE pstate = 0; 165 pstate.ie = 1; 166 pstate.am = 1; 167 tc->setMiscReg(MISCREG_PSTATE, pstate); 168 | 61 62 // Set pointer for next thread stack. Reserve 8M for main stack. 63 next_thread_stack_base = stack_base - (8 * 1024 * 1024); 64 65 // Initialize these to 0s 66 fillStart = 0; 67 spillStart = 0; 68} --- 92 unchanged lines hidden (view full) --- 161 162 ThreadContext *tc = system->getThreadContext(contextIds[0]); 163 // The process runs in user mode with 32 bit addresses 164 PSTATE pstate = 0; 165 pstate.ie = 1; 166 pstate.am = 1; 167 tc->setMiscReg(MISCREG_PSTATE, pstate); 168 |
169 argsInit(32 / 8, VMPageSize); | 169 argsInit(32 / 8, PageBytes); |
170} 171 172void 173Sparc64LiveProcess::initState() 174{ 175 SparcLiveProcess::initState(); 176 177 ThreadContext *tc = system->getThreadContext(contextIds[0]); 178 // The process runs in user mode 179 PSTATE pstate = 0; 180 pstate.ie = 1; 181 tc->setMiscReg(MISCREG_PSTATE, pstate); 182 | 170} 171 172void 173Sparc64LiveProcess::initState() 174{ 175 SparcLiveProcess::initState(); 176 177 ThreadContext *tc = system->getThreadContext(contextIds[0]); 178 // The process runs in user mode 179 PSTATE pstate = 0; 180 pstate.ie = 1; 181 tc->setMiscReg(MISCREG_PSTATE, pstate); 182 |
183 argsInit(sizeof(IntReg), VMPageSize); | 183 argsInit(sizeof(IntReg), PageBytes); |
184} 185 186template<class IntType> 187void 188SparcLiveProcess::argsInit(int pageSize) 189{ 190 int intSize = sizeof(IntType); 191 --- 37 unchanged lines hidden (view full) --- 229 230 // Setup the auxilliary vectors. These will already have endian conversion. 231 // Auxilliary vectors are loaded only for elf formatted executables. 232 ElfObject * elfObject = dynamic_cast<ElfObject *>(objFile); 233 if (elfObject) { 234 // Bits which describe the system hardware capabilities 235 auxv.push_back(auxv_t(M5_AT_HWCAP, hwcap)); 236 // The system page size | 184} 185 186template<class IntType> 187void 188SparcLiveProcess::argsInit(int pageSize) 189{ 190 int intSize = sizeof(IntType); 191 --- 37 unchanged lines hidden (view full) --- 229 230 // Setup the auxilliary vectors. These will already have endian conversion. 231 // Auxilliary vectors are loaded only for elf formatted executables. 232 ElfObject * elfObject = dynamic_cast<ElfObject *>(objFile); 233 if (elfObject) { 234 // Bits which describe the system hardware capabilities 235 auxv.push_back(auxv_t(M5_AT_HWCAP, hwcap)); 236 // The system page size |
237 auxv.push_back(auxv_t(M5_AT_PAGESZ, SparcISA::VMPageSize)); | 237 auxv.push_back(auxv_t(M5_AT_PAGESZ, SparcISA::PageBytes)); |
238 // Defined to be 100 in the kernel source. 239 // Frequency at which times() increments 240 auxv.push_back(auxv_t(M5_AT_CLKTCK, 100)); 241 // For statically linked executables, this is the virtual address of the 242 // program header tables if they appear in the executable image 243 auxv.push_back(auxv_t(M5_AT_PHDR, elfObject->programHeaderTable())); 244 // This is the size of a program header entry from the elf file. 245 auxv.push_back(auxv_t(M5_AT_PHENT, elfObject->programHeaderSize())); --- 313 unchanged lines hidden --- | 238 // Defined to be 100 in the kernel source. 239 // Frequency at which times() increments 240 auxv.push_back(auxv_t(M5_AT_CLKTCK, 100)); 241 // For statically linked executables, this is the virtual address of the 242 // program header tables if they appear in the executable image 243 auxv.push_back(auxv_t(M5_AT_PHDR, elfObject->programHeaderTable())); 244 // This is the size of a program header entry from the elf file. 245 auxv.push_back(auxv_t(M5_AT_PHENT, elfObject->programHeaderSize())); --- 313 unchanged lines hidden --- |