process.cc (13894:8603648c1679) process.cc (14010:0e1e887507c0)
1/*
2 * Copyright (c) 2010, 2012, 2017-2018 ARM Limited
3 * All rights reserved
4 *
5 * The license below extends only to copyright in the software and shall
6 * not be construed as granting a license to any other intellectual
7 * property including but not limited to intellectual property relating
8 * to a hardware implementation of the functionality of the software

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

410 // write contents to stack
411
412 // figure out argc
413 IntType argc = argv.size();
414 IntType guestArgc = ArmISA::htog(argc);
415
416 //Write out the sentry void *
417 IntType sentry_NULL = 0;
1/*
2 * Copyright (c) 2010, 2012, 2017-2018 ARM Limited
3 * All rights reserved
4 *
5 * The license below extends only to copyright in the software and shall
6 * not be construed as granting a license to any other intellectual
7 * property including but not limited to intellectual property relating
8 * to a hardware implementation of the functionality of the software

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

410 // write contents to stack
411
412 // figure out argc
413 IntType argc = argv.size();
414 IntType guestArgc = ArmISA::htog(argc);
415
416 //Write out the sentry void *
417 IntType sentry_NULL = 0;
418 initVirtMem.writeBlob(sentry_base,
419 (uint8_t*)&sentry_NULL, sentry_size);
418 initVirtMem.writeBlob(sentry_base, &sentry_NULL, sentry_size);
420
421 //Fix up the aux vectors which point to other data
422 for (int i = auxv.size() - 1; i >= 0; i--) {
423 if (auxv[i].type == M5_AT_PLATFORM) {
424 auxv[i].val = platform_base;
425 initVirtMem.writeString(platform_base, platform.c_str());
426 } else if (auxv[i].type == M5_AT_EXECFN) {
427 auxv[i].val = aux_data_base;

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

441 //Write out the terminating zeroed auxillary vector
442 const AuxVector<IntType> zero(0, 0);
443 initVirtMem.write(auxv_array_end, zero);
444 auxv_array_end += sizeof(zero);
445
446 copyStringArray(envp, envp_array_base, env_data_base, initVirtMem);
447 copyStringArray(argv, argv_array_base, arg_data_base, initVirtMem);
448
419
420 //Fix up the aux vectors which point to other data
421 for (int i = auxv.size() - 1; i >= 0; i--) {
422 if (auxv[i].type == M5_AT_PLATFORM) {
423 auxv[i].val = platform_base;
424 initVirtMem.writeString(platform_base, platform.c_str());
425 } else if (auxv[i].type == M5_AT_EXECFN) {
426 auxv[i].val = aux_data_base;

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

440 //Write out the terminating zeroed auxillary vector
441 const AuxVector<IntType> zero(0, 0);
442 initVirtMem.write(auxv_array_end, zero);
443 auxv_array_end += sizeof(zero);
444
445 copyStringArray(envp, envp_array_base, env_data_base, initVirtMem);
446 copyStringArray(argv, argv_array_base, arg_data_base, initVirtMem);
447
449 initVirtMem.writeBlob(argc_base, (uint8_t*)&guestArgc, intSize);
448 initVirtMem.writeBlob(argc_base, &guestArgc, intSize);
450
451 ThreadContext *tc = system->getThreadContext(contextIds[0]);
452 //Set the stack pointer register
453 tc->setIntReg(spIndex, memState->getStackMin());
454 //A pointer to a function to run when the program exits. We'll set this
455 //to zero explicitly to make sure this isn't used.
456 tc->setIntReg(ArgumentReg0, 0);
457 //Set argument regs 1 and 2 to argv[0] and envp[0] respectively

--- 112 unchanged lines hidden ---
449
450 ThreadContext *tc = system->getThreadContext(contextIds[0]);
451 //Set the stack pointer register
452 tc->setIntReg(spIndex, memState->getStackMin());
453 //A pointer to a function to run when the program exits. We'll set this
454 //to zero explicitly to make sure this isn't used.
455 tc->setIntReg(ArgumentReg0, 0);
456 //Set argument regs 1 and 2 to argv[0] and envp[0] respectively

--- 112 unchanged lines hidden ---