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; --- 189 unchanged lines hidden (view full) --- 198 filename = ""; 199 else 200 filename = argv[0]; 201 202 // Even for a 32 bit process, the ABI says we still need to 203 // maintain double word alignment of the stack pointer. 204 uint64_t align = 16; 205 |
206 // Patch the ld_bias for dynamic executables. 207 updateBias(); 208 |
209 // load object file into target memory 210 objFile->loadSections(initVirtMem); 211 212 enum hardwareCaps 213 { 214 M5_HWCAP_SPARC_FLUSH = 1, 215 M5_HWCAP_SPARC_STBAR = 2, 216 M5_HWCAP_SPARC_SWAP = 4, --- 26 unchanged lines hidden (view full) --- 243 auxv.push_back(auxv_t(M5_AT_CLKTCK, 100)); 244 // For statically linked executables, this is the virtual address of the 245 // program header tables if they appear in the executable image 246 auxv.push_back(auxv_t(M5_AT_PHDR, elfObject->programHeaderTable())); 247 // This is the size of a program header entry from the elf file. 248 auxv.push_back(auxv_t(M5_AT_PHENT, elfObject->programHeaderSize())); 249 // This is the number of program headers from the original elf file. 250 auxv.push_back(auxv_t(M5_AT_PHNUM, elfObject->programHeaderCount())); |
251 // This is the base address of the ELF interpreter; it should be 252 // zero for static executables or contain the base address for 253 // dynamic executables. 254 auxv.push_back(auxv_t(M5_AT_BASE, getBias())); |
255 // This is hardwired to 0 in the elf loading code in the kernel 256 auxv.push_back(auxv_t(M5_AT_FLAGS, 0)); 257 // The entry point to the program 258 auxv.push_back(auxv_t(M5_AT_ENTRY, objFile->entryPoint())); 259 // Different user and group IDs 260 auxv.push_back(auxv_t(M5_AT_UID, uid())); 261 auxv.push_back(auxv_t(M5_AT_EUID, euid())); 262 auxv.push_back(auxv_t(M5_AT_GID, gid())); --- 137 unchanged lines hidden (view full) --- 400 // tc->setIntReg(ArgumentReg[0], argc); 401 // tc->setIntReg(ArgumentReg[1], argv_array_base); 402 tc->setIntReg(StackPointerReg, stack_min - StackBias); 403 404 // %g1 is a pointer to a function that should be run at exit. Since we 405 // don't have anything like that, it should be set to 0. 406 tc->setIntReg(1, 0); 407 |
408 tc->pcState(getStartPC()); |
409 410 // Align the "stack_min" to a page boundary. 411 stack_min = roundDown(stack_min, pageSize); 412 413// num_processes++; 414} 415 416void --- 145 unchanged lines hidden --- |