Deleted Added
sdiff udiff text old ( 13894:8603648c1679 ) new ( 14010:0e1e887507c0 )
full compact
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,
368 (uint8_t*)&sentry_NULL, sentry_size);
369
370 // Write the file name
371 initVirtMem.writeString(file_name_base, filename.c_str());
372
373 // Copy the aux stuff
374 Addr auxv_array_end = auxv_array_base;
375 for (const auto &aux: auxv) {
376 initVirtMem.write(auxv_array_end, aux, GuestByteOrder);
377 auxv_array_end += sizeof(aux);
378 }
379
380 // Write out the terminating zeroed auxilliary vector
381 const AuxVector<IntType> zero(0, 0);
382 initVirtMem.write(auxv_array_end, zero);
383 auxv_array_end += sizeof(zero);
384
385 copyStringArray(envp, envp_array_base, env_data_base, initVirtMem);
386 copyStringArray(argv, argv_array_base, arg_data_base, initVirtMem);
387
388 initVirtMem.writeBlob(argc_base, (uint8_t*)&guestArgc, intSize);
389
390 // Set up space for the trap handlers into the processes address space.
391 // Since the stack grows down and there is reserved address space abov
392 // it, we can put stuff above it and stay out of the way.
393 fillStart = memState->getStackBase();
394 spillStart = fillStart + sizeof(MachInst) * numFillInsts;
395
396 ThreadContext *tc = system->getThreadContext(contextIds[0]);

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

412
413void
414Sparc64Process::argsInit(int intSize, int pageSize)
415{
416 SparcProcess::argsInit<uint64_t>(pageSize);
417
418 // Stuff the trap handlers into the process address space
419 initVirtMem.writeBlob(fillStart,
420 (uint8_t*)fillHandler64, sizeof(MachInst) * numFillInsts);
421 initVirtMem.writeBlob(spillStart,
422 (uint8_t*)spillHandler64, sizeof(MachInst) * numSpillInsts);
423}
424
425void
426Sparc32Process::argsInit(int intSize, int pageSize)
427{
428 SparcProcess::argsInit<uint32_t>(pageSize);
429
430 // Stuff the trap handlers into the process address space
431 initVirtMem.writeBlob(fillStart,
432 (uint8_t*)fillHandler32, sizeof(MachInst) * numFillInsts);
433 initVirtMem.writeBlob(spillStart,
434 (uint8_t*)spillHandler32, sizeof(MachInst) * numSpillInsts);
435}
436
437void Sparc32Process::flushWindows(ThreadContext *tc)
438{
439 RegVal Cansave = tc->readIntReg(NumIntArchRegs + 3);
440 RegVal Canrestore = tc->readIntReg(NumIntArchRegs + 4);
441 RegVal Otherwin = tc->readIntReg(NumIntArchRegs + 6);
442 RegVal CWP = tc->readMiscReg(MISCREG_CWP);

--- 116 unchanged lines hidden ---