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; --- 350 unchanged lines hidden (view full) --- 359 // write contents to stack 360 361 // figure out argc 362 IntType argc = argv.size(); 363 IntType guestArgc = SparcISA::htog(argc); 364 365 // Write out the sentry void * 366 uint64_t sentry_NULL = 0; |
367 initVirtMem.writeBlob(sentry_base, &sentry_NULL, sentry_size); |
368 369 // Write the file name 370 initVirtMem.writeString(file_name_base, filename.c_str()); 371 372 // Copy the aux stuff 373 Addr auxv_array_end = auxv_array_base; 374 for (const auto &aux: auxv) { 375 initVirtMem.write(auxv_array_end, aux, GuestByteOrder); 376 auxv_array_end += sizeof(aux); 377 } 378 379 // Write out the terminating zeroed auxilliary vector 380 const AuxVector<IntType> zero(0, 0); 381 initVirtMem.write(auxv_array_end, zero); 382 auxv_array_end += sizeof(zero); 383 384 copyStringArray(envp, envp_array_base, env_data_base, initVirtMem); 385 copyStringArray(argv, argv_array_base, arg_data_base, initVirtMem); 386 |
387 initVirtMem.writeBlob(argc_base, &guestArgc, intSize); |
388 389 // Set up space for the trap handlers into the processes address space. 390 // Since the stack grows down and there is reserved address space abov 391 // it, we can put stuff above it and stay out of the way. 392 fillStart = memState->getStackBase(); 393 spillStart = fillStart + sizeof(MachInst) * numFillInsts; 394 395 ThreadContext *tc = system->getThreadContext(contextIds[0]); --- 15 unchanged lines hidden (view full) --- 411 412void 413Sparc64Process::argsInit(int intSize, int pageSize) 414{ 415 SparcProcess::argsInit<uint64_t>(pageSize); 416 417 // Stuff the trap handlers into the process address space 418 initVirtMem.writeBlob(fillStart, |
419 fillHandler64, sizeof(MachInst) * numFillInsts); |
420 initVirtMem.writeBlob(spillStart, |
421 spillHandler64, sizeof(MachInst) * numSpillInsts); |
422} 423 424void 425Sparc32Process::argsInit(int intSize, int pageSize) 426{ 427 SparcProcess::argsInit<uint32_t>(pageSize); 428 429 // Stuff the trap handlers into the process address space 430 initVirtMem.writeBlob(fillStart, |
431 fillHandler32, sizeof(MachInst) * numFillInsts); |
432 initVirtMem.writeBlob(spillStart, |
433 spillHandler32, sizeof(MachInst) * numSpillInsts); |
434} 435 436void Sparc32Process::flushWindows(ThreadContext *tc) 437{ 438 RegVal Cansave = tc->readIntReg(NumIntArchRegs + 3); 439 RegVal Canrestore = tc->readIntReg(NumIntArchRegs + 4); 440 RegVal Otherwin = tc->readIntReg(NumIntArchRegs + 6); 441 RegVal CWP = tc->readMiscReg(MISCREG_CWP); --- 116 unchanged lines hidden --- |