process.cc (13894:8603648c1679) | process.cc (14010:0e1e887507c0) |
---|---|
1/* 2 * Copyright (c) 2007-2008 The Florida State University 3 * Copyright (c) 2009 The University of Edinburgh 4 * All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions are 8 * met: redistributions of source code must retain the above copyright --- 219 unchanged lines hidden (view full) --- 228 // write contents to stack 229 230 // figure out argc 231 uint32_t argc = argv.size(); 232 uint32_t guestArgc = PowerISA::htog(argc); 233 234 //Write out the sentry void * 235 uint32_t sentry_NULL = 0; | 1/* 2 * Copyright (c) 2007-2008 The Florida State University 3 * Copyright (c) 2009 The University of Edinburgh 4 * All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions are 8 * met: redistributions of source code must retain the above copyright --- 219 unchanged lines hidden (view full) --- 228 // write contents to stack 229 230 // figure out argc 231 uint32_t argc = argv.size(); 232 uint32_t guestArgc = PowerISA::htog(argc); 233 234 //Write out the sentry void * 235 uint32_t sentry_NULL = 0; |
236 initVirtMem.writeBlob(sentry_base, 237 (uint8_t*)&sentry_NULL, sentry_size); | 236 initVirtMem.writeBlob(sentry_base, &sentry_NULL, sentry_size); |
238 239 //Fix up the aux vectors which point to other data 240 for (int i = auxv.size() - 1; i >= 0; i--) { 241 if (auxv[i].type == M5_AT_PLATFORM) { 242 auxv[i].val = platform_base; 243 initVirtMem.writeString(platform_base, platform.c_str()); 244 } else if (auxv[i].type == M5_AT_EXECFN) { 245 auxv[i].val = aux_data_base; --- 10 unchanged lines hidden (view full) --- 256 //Write out the terminating zeroed auxilliary vector 257 const AuxVector<uint64_t> zero(0, 0); 258 initVirtMem.write(auxv_array_end, zero); 259 auxv_array_end += sizeof(zero); 260 261 copyStringArray(envp, envp_array_base, env_data_base, initVirtMem); 262 copyStringArray(argv, argv_array_base, arg_data_base, initVirtMem); 263 | 237 238 //Fix up the aux vectors which point to other data 239 for (int i = auxv.size() - 1; i >= 0; i--) { 240 if (auxv[i].type == M5_AT_PLATFORM) { 241 auxv[i].val = platform_base; 242 initVirtMem.writeString(platform_base, platform.c_str()); 243 } else if (auxv[i].type == M5_AT_EXECFN) { 244 auxv[i].val = aux_data_base; --- 10 unchanged lines hidden (view full) --- 255 //Write out the terminating zeroed auxilliary vector 256 const AuxVector<uint64_t> zero(0, 0); 257 initVirtMem.write(auxv_array_end, zero); 258 auxv_array_end += sizeof(zero); 259 260 copyStringArray(envp, envp_array_base, env_data_base, initVirtMem); 261 copyStringArray(argv, argv_array_base, arg_data_base, initVirtMem); 262 |
264 initVirtMem.writeBlob(argc_base, (uint8_t*)&guestArgc, intSize); | 263 initVirtMem.writeBlob(argc_base, &guestArgc, intSize); |
265 266 ThreadContext *tc = system->getThreadContext(contextIds[0]); 267 268 //Set the stack pointer register 269 tc->setIntReg(StackPointerReg, stack_min); 270 271 tc->pcState(getStartPC()); 272 --- 30 unchanged lines hidden --- | 264 265 ThreadContext *tc = system->getThreadContext(contextIds[0]); 266 267 //Set the stack pointer register 268 tc->setIntReg(StackPointerReg, stack_min); 269 270 tc->pcState(getStartPC()); 271 --- 30 unchanged lines hidden --- |