process.cc (12448:b299e560f1d8) process.cc (13028:9a09c342891e)
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

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

234
235 //Write out the sentry void *
236 uint32_t sentry_NULL = 0;
237 initVirtMem.writeBlob(sentry_base,
238 (uint8_t*)&sentry_NULL, sentry_size);
239
240 //Fix up the aux vectors which point to other data
241 for (int i = auxv.size() - 1; i >= 0; i--) {
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

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

234
235 //Write out the sentry void *
236 uint32_t sentry_NULL = 0;
237 initVirtMem.writeBlob(sentry_base,
238 (uint8_t*)&sentry_NULL, sentry_size);
239
240 //Fix up the aux vectors which point to other data
241 for (int i = auxv.size() - 1; i >= 0; i--) {
242 if (auxv[i].a_type == M5_AT_PLATFORM) {
243 auxv[i].a_val = platform_base;
242 if (auxv[i].getHostAuxType() == M5_AT_PLATFORM) {
243 auxv[i].setAuxVal(platform_base);
244 initVirtMem.writeString(platform_base, platform.c_str());
244 initVirtMem.writeString(platform_base, platform.c_str());
245 } else if (auxv[i].a_type == M5_AT_EXECFN) {
246 auxv[i].a_val = aux_data_base;
245 } else if (auxv[i].getHostAuxType() == M5_AT_EXECFN) {
246 auxv[i].setAuxVal(aux_data_base);
247 initVirtMem.writeString(aux_data_base, filename.c_str());
248 }
249 }
250
251 //Copy the aux stuff
252 for (int x = 0; x < auxv.size(); x++)
253 {
254 initVirtMem.writeBlob(auxv_array_base + x * 2 * intSize,
247 initVirtMem.writeString(aux_data_base, filename.c_str());
248 }
249 }
250
251 //Copy the aux stuff
252 for (int x = 0; x < auxv.size(); x++)
253 {
254 initVirtMem.writeBlob(auxv_array_base + x * 2 * intSize,
255 (uint8_t*)&(auxv[x].a_type), intSize);
255 (uint8_t*)&(auxv[x].getAuxType()), intSize);
256 initVirtMem.writeBlob(auxv_array_base + (x * 2 + 1) * intSize,
256 initVirtMem.writeBlob(auxv_array_base + (x * 2 + 1) * intSize,
257 (uint8_t*)&(auxv[x].a_val), intSize);
257 (uint8_t*)&(auxv[x].getAuxVal()), intSize);
258 }
259 //Write out the terminating zeroed auxilliary vector
260 const uint64_t zero = 0;
261 initVirtMem.writeBlob(auxv_array_base + 2 * intSize * auxv.size(),
262 (uint8_t*)&zero, 2 * intSize);
263
264 copyStringArray(envp, envp_array_base, env_data_base, initVirtMem);
265 copyStringArray(argv, argv_array_base, arg_data_base, initVirtMem);

--- 40 unchanged lines hidden ---
258 }
259 //Write out the terminating zeroed auxilliary vector
260 const uint64_t zero = 0;
261 initVirtMem.writeBlob(auxv_array_base + 2 * intSize * auxv.size(),
262 (uint8_t*)&zero, 2 * intSize);
263
264 copyStringArray(envp, envp_array_base, env_data_base, initVirtMem);
265 copyStringArray(argv, argv_array_base, arg_data_base, initVirtMem);

--- 40 unchanged lines hidden ---