1/* 2 * Copyright (c) 2007 The Hewlett-Packard Development Company 3 * All rights reserved. 4 * 5 * The license below extends only to copyright in the software and shall 6 * not be construed as granting a license to any other intellectual 7 * property including but not limited to intellectual property relating 8 * to a hardware implementation of the functionality of the software --- 72 unchanged lines hidden (view full) --- 81static const int NumArgumentRegs32 = sizeof(ArgumentReg) / sizeof(const int); 82 83X86LiveProcess::X86LiveProcess(LiveProcessParams * params, ObjectFile *objFile, 84 SyscallDesc *_syscallDescs, int _numSyscallDescs) : 85 LiveProcess(params, objFile), syscallDescs(_syscallDescs), 86 numSyscallDescs(_numSyscallDescs) 87{ 88 brk_point = objFile->dataBase() + objFile->dataSize() + objFile->bssSize(); |
89 brk_point = roundUp(brk_point, PageBytes); |
90} 91 92X86_64LiveProcess::X86_64LiveProcess(LiveProcessParams *params, 93 ObjectFile *objFile, SyscallDesc *_syscallDescs, 94 int _numSyscallDescs) : 95 X86LiveProcess(params, objFile, _syscallDescs, _numSyscallDescs) 96{ 97 98 vsyscallPage.base = 0xffffffffff600000ULL; |
99 vsyscallPage.size = PageBytes; |
100 vsyscallPage.vtimeOffset = 0x400; 101 vsyscallPage.vgettimeofdayOffset = 0x0; 102 103 // Set up stack. On X86_64 Linux, stack goes from the top of memory 104 // downward, less the hole for the kernel address space plus one page 105 // for undertermined purposes. 106 stack_base = (Addr)0x7FFFFFFFF000ULL; 107 --- 20 unchanged lines hidden (view full) --- 128 129 130I386LiveProcess::I386LiveProcess(LiveProcessParams *params, 131 ObjectFile *objFile, SyscallDesc *_syscallDescs, 132 int _numSyscallDescs) : 133 X86LiveProcess(params, objFile, _syscallDescs, _numSyscallDescs) 134{ 135 _gdtStart = ULL(0xffffd000); |
136 _gdtSize = PageBytes; |
137 138 vsyscallPage.base = 0xffffe000ULL; |
139 vsyscallPage.size = PageBytes; |
140 vsyscallPage.vsyscallOffset = 0x400; 141 vsyscallPage.vsysexitOffset = 0x410; 142 143 stack_base = _gdtStart; 144 145 // Set pointer for next thread stack. Reserve 8M for main stack. 146 next_thread_stack_base = stack_base - (8 * 1024 * 1024); 147 --- 10 unchanged lines hidden (view full) --- 158 return &syscallDescs[callnum]; 159} 160 161void 162X86_64LiveProcess::initState() 163{ 164 X86LiveProcess::initState(); 165 |
166 argsInit(sizeof(uint64_t), PageBytes); |
167 168 // Set up the vsyscall page for this process. 169 allocateMem(vsyscallPage.base, vsyscallPage.size); 170 uint8_t vtimeBlob[] = { 171 0x48,0xc7,0xc0,0xc9,0x00,0x00,0x00, // mov $0xc9,%rax 172 0x0f,0x05, // syscall 173 0xc3 // retq 174 }; --- 78 unchanged lines hidden (view full) --- 253 } 254} 255 256void 257I386LiveProcess::initState() 258{ 259 X86LiveProcess::initState(); 260 |
261 argsInit(sizeof(uint32_t), PageBytes); |
262 263 /* 264 * Set up a GDT for this process. The whole GDT wouldn't really be for 265 * this process, but the only parts we care about are. 266 */ 267 allocateMem(_gdtStart, _gdtSize); 268 uint64_t zero = 0; 269 assert(_gdtSize % sizeof(zero) == 0); --- 199 unchanged lines hidden (view full) --- 469// X86_AutomaticClockControl | 470// X86_IA64Processor | 471 0; 472 473 //Bits which describe the system hardware capabilities 474 //XXX Figure out what these should be 475 auxv.push_back(auxv_t(M5_AT_HWCAP, features)); 476 //The system page size |
477 auxv.push_back(auxv_t(M5_AT_PAGESZ, X86ISA::PageBytes)); |
478 //Frequency at which times() increments 479 //Defined to be 100 in the kernel source. 480 auxv.push_back(auxv_t(M5_AT_CLKTCK, 100)); 481 // For statically linked executables, this is the virtual address of the 482 // program header tables if they appear in the executable image 483 auxv.push_back(auxv_t(M5_AT_PHDR, elfObject->programHeaderTable())); 484 // This is the size of a program header entry from the elf file. 485 auxv.push_back(auxv_t(M5_AT_PHENT, elfObject->programHeaderSize())); --- 238 unchanged lines hidden --- |