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, &sentry_NULL, sentry_size); |
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 |
263 initVirtMem.writeBlob(argc_base, &guestArgc, intSize); |
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 --- |