1/* 2 * Copyright (c) 2009-2010 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 --- 49 unchanged lines hidden (view full) --- 58 59 static Fault reset = new Reset; 60 reset->invoke(tc); 61} 62 63uint64_t 64getArgument(ThreadContext *tc, int &number, uint16_t size, bool fp) 65{ |
66 if (!FullSystem) { 67 panic("getArgument() only implemented for full system mode.\n"); 68 M5_DUMMY_RETURN 69 } |
70 |
71 if (size == (uint16_t)(-1)) 72 size = ArmISA::MachineBytes; 73 if (fp) 74 panic("getArgument(): Floating point arguments not implemented\n"); 75 76 if (number < NumArgumentRegs) { 77 // If the argument is 64 bits, it must be in an even regiser 78 // number. Increment the number here if it isn't even. 79 if (size == sizeof(uint64_t)) { 80 if ((number % 2) != 0) |
81 number++; |
82 // Read the two halves of the data. Number is inc here to 83 // get the second half of the 64 bit reg. 84 uint64_t tmp; 85 tmp = tc->readIntReg(number++); 86 tmp |= tc->readIntReg(number) << 32; 87 return tmp; 88 } else { 89 return tc->readIntReg(number); |
90 } 91 } else { |
92 Addr sp = tc->readIntReg(StackPointerReg); 93 FSTranslatingPortProxy* vp = tc->getVirtProxy(); 94 uint64_t arg; 95 if (size == sizeof(uint64_t)) { 96 // If the argument is even it must be aligned 97 if ((number % 2) != 0) 98 number++; 99 arg = vp->read<uint64_t>(sp + 100 (number-NumArgumentRegs) * sizeof(uint32_t)); 101 // since two 32 bit args == 1 64 bit arg, increment number 102 number++; 103 } else { 104 arg = vp->read<uint32_t>(sp + 105 (number-NumArgumentRegs) * sizeof(uint32_t)); 106 } 107 return arg; |
108 } 109} 110 111void 112skipFunction(ThreadContext *tc) 113{ 114 TheISA::PCState newPC = tc->pcState(); 115 newPC.set(tc->readIntReg(ReturnAddressReg) & ~ULL(1)); --- 52 unchanged lines hidden --- |