process.cc (10318:98771a936b61) process.cc (11389:1e55f16160cb)
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
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
206 // load object file into target memory
207 objFile->loadSections(initVirtMem);
208
209 enum hardwareCaps
210 {
211 M5_HWCAP_SPARC_FLUSH = 1,
212 M5_HWCAP_SPARC_STBAR = 2,
213 M5_HWCAP_SPARC_SWAP = 4,

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

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()));
246 // This is the number of program headers from the original elf file.
247 auxv.push_back(auxv_t(M5_AT_PHNUM, elfObject->programHeaderCount()));
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()));
248 // This is the address of the elf "interpreter", It should be set
249 // to 0 for regular executables. It should be something else
250 // (not sure what) for dynamic libraries.
251 auxv.push_back(auxv_t(M5_AT_BASE, 0));
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()));
252 // This is hardwired to 0 in the elf loading code in the kernel
253 auxv.push_back(auxv_t(M5_AT_FLAGS, 0));
254 // The entry point to the program
255 auxv.push_back(auxv_t(M5_AT_ENTRY, objFile->entryPoint()));
256 // Different user and group IDs
257 auxv.push_back(auxv_t(M5_AT_UID, uid()));
258 auxv.push_back(auxv_t(M5_AT_EUID, euid()));
259 auxv.push_back(auxv_t(M5_AT_GID, gid()));

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

397 // tc->setIntReg(ArgumentReg[0], argc);
398 // tc->setIntReg(ArgumentReg[1], argv_array_base);
399 tc->setIntReg(StackPointerReg, stack_min - StackBias);
400
401 // %g1 is a pointer to a function that should be run at exit. Since we
402 // don't have anything like that, it should be set to 0.
403 tc->setIntReg(1, 0);
404
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
405 tc->pcState(objFile->entryPoint());
408 tc->pcState(getStartPC());
406
407 // Align the "stack_min" to a page boundary.
408 stack_min = roundDown(stack_min, pageSize);
409
410// num_processes++;
411}
412
413void

--- 145 unchanged lines hidden ---
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 ---