utility.cc (8799:dac1e33e07b0) utility.cc (8806:669e93d79ed9)
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{
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 if (size == (uint16_t)(-1))
68 size = ArmISA::MachineBytes;
69 if (fp)
70 panic("getArgument(): Floating point arguments not implemented\n");
66 if (!FullSystem) {
67 panic("getArgument() only implemented for full system mode.\n");
68 M5_DUMMY_RETURN
69 }
71
70
72 if (number < NumArgumentRegs) {
73 // If the argument is 64 bits, it must be in an even regiser
74 // number. Increment the number here if it isn't even.
75 if (size == sizeof(uint64_t)) {
76 if ((number % 2) != 0)
77 number++;
78 // Read the two halves of the data. Number is inc here to
79 // get the second half of the 64 bit reg.
80 uint64_t tmp;
81 tmp = tc->readIntReg(number++);
82 tmp |= tc->readIntReg(number) << 32;
83 return tmp;
84 } else {
85 return tc->readIntReg(number);
86 }
87 } else {
88 Addr sp = tc->readIntReg(StackPointerReg);
89 FSTranslatingPortProxy* vp = tc->getVirtProxy();
90 uint64_t arg;
91 if (size == sizeof(uint64_t)) {
92 // If the argument is even it must be aligned
93 if ((number % 2) != 0)
94 number++;
95 arg = vp->read<uint64_t>(sp +
96 (number-NumArgumentRegs) * sizeof(uint32_t));
97 // since two 32 bit args == 1 64 bit arg, increment number
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)
98 number++;
81 number++;
99 } else {
100 arg = vp->read<uint32_t>(sp +
101 (number-NumArgumentRegs) * sizeof(uint32_t));
102 }
103 return arg;
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);
104 }
105 } else {
90 }
91 } else {
106 panic("getArgument() only implemented for full system mode.\n");
107 M5_DUMMY_RETURN
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 ---
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 ---