GetArgument: Rework getArgument so that X86_FS compiles again.
When no size is specified for an argument, push the decision about what size to use into the ISA by passing a size of -1.
This commit is contained in:
parent
b197a542b4
commit
ab9f062166
|
@ -40,7 +40,7 @@
|
|||
namespace AlphaISA {
|
||||
|
||||
uint64_t
|
||||
getArgument(ThreadContext *tc, int &number, uint8_t size, bool fp)
|
||||
getArgument(ThreadContext *tc, int &number, uint16_t size, bool fp)
|
||||
{
|
||||
#if FULL_SYSTEM
|
||||
const int NumArgumentRegs = 6;
|
||||
|
|
|
@ -41,7 +41,7 @@
|
|||
|
||||
namespace AlphaISA {
|
||||
|
||||
uint64_t getArgument(ThreadContext *tc, int &number, uint8_t size, bool fp);
|
||||
uint64_t getArgument(ThreadContext *tc, int &number, uint16_t size, bool fp);
|
||||
|
||||
inline bool
|
||||
inUserMode(ThreadContext *tc)
|
||||
|
|
|
@ -39,6 +39,7 @@
|
|||
|
||||
|
||||
#include "arch/arm/faults.hh"
|
||||
#include "arch/arm/isa_traits.hh"
|
||||
#include "arch/arm/utility.hh"
|
||||
#include "cpu/thread_context.hh"
|
||||
|
||||
|
@ -61,8 +62,12 @@ initCPU(ThreadContext *tc, int cpuId)
|
|||
reset->invoke(tc);
|
||||
}
|
||||
|
||||
uint64_t getArgument(ThreadContext *tc, int &number, uint8_t size, bool fp) {
|
||||
uint64_t
|
||||
getArgument(ThreadContext *tc, int &number, uint16_t size, bool fp)
|
||||
{
|
||||
#if FULL_SYSTEM
|
||||
if (size == (uint16_t)(-1))
|
||||
size = ArmISA::MachineBytes;
|
||||
if (fp)
|
||||
panic("getArgument(): Floating point arguments not implemented\n");
|
||||
|
||||
|
|
|
@ -156,7 +156,7 @@ namespace ArmISA {
|
|||
return !cpacr.asedis && vfpEnabled(cpacr, cpsr, fpexc);
|
||||
}
|
||||
|
||||
uint64_t getArgument(ThreadContext *tc, int &number, uint8_t size, bool fp);
|
||||
uint64_t getArgument(ThreadContext *tc, int &number, uint16_t size, bool fp);
|
||||
|
||||
Fault setCp15Register(uint32_t &Rd, int CRn, int opc1, int CRm, int opc2);
|
||||
Fault readCp15Register(uint32_t &Rd, int CRn, int opc1, int CRm, int opc2);
|
||||
|
|
|
@ -52,7 +52,7 @@ using namespace std;
|
|||
namespace MipsISA {
|
||||
|
||||
uint64_t
|
||||
getArgument(ThreadContext *tc, int &number, uint8_t size, bool fp)
|
||||
getArgument(ThreadContext *tc, int &number, uint16_t size, bool fp)
|
||||
{
|
||||
#if FULL_SYSTEM
|
||||
if (number < 4) {
|
||||
|
|
|
@ -45,7 +45,7 @@ class ThreadContext;
|
|||
|
||||
namespace MipsISA {
|
||||
|
||||
uint64_t getArgument(ThreadContext *tc, int &number, uint8_t size, bool fp);
|
||||
uint64_t getArgument(ThreadContext *tc, int &number, uint16_t size, bool fp);
|
||||
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
|
|
|
@ -45,7 +45,9 @@ namespace SparcISA {
|
|||
//the sixth are passed on the stack past the 16 word window save area,
|
||||
//space for the struct/union return pointer, and space reserved for the
|
||||
//first 6 arguments which the caller may use but doesn't have to.
|
||||
uint64_t getArgument(ThreadContext *tc, int &number, uint8_t size, bool fp) {
|
||||
uint64_t
|
||||
getArgument(ThreadContext *tc, int &number, uint16_t size, bool fp)
|
||||
{
|
||||
#if FULL_SYSTEM
|
||||
const int NumArgumentRegs = 6;
|
||||
if (number < NumArgumentRegs) {
|
||||
|
|
|
@ -41,7 +41,8 @@
|
|||
|
||||
namespace SparcISA
|
||||
{
|
||||
uint64_t getArgument(ThreadContext *tc, int &number, uint8_t size, bool fp);
|
||||
uint64_t
|
||||
getArgument(ThreadContext *tc, int &number, uint16_t size, bool fp);
|
||||
|
||||
static inline bool
|
||||
inUserMode(ThreadContext *tc)
|
||||
|
|
|
@ -52,7 +52,9 @@
|
|||
|
||||
namespace X86ISA {
|
||||
|
||||
uint64_t getArgument(ThreadContext *tc, int &number, uint8_t size, bool fp) {
|
||||
uint64_t
|
||||
getArgument(ThreadContext *tc, int &number, uint16_t size, bool fp)
|
||||
{
|
||||
#if FULL_SYSTEM
|
||||
panic("getArgument() not implemented for x86!\n");
|
||||
#else
|
||||
|
|
|
@ -52,7 +52,8 @@ class ThreadContext;
|
|||
|
||||
namespace X86ISA
|
||||
{
|
||||
uint64_t getArgument(ThreadContext *tc, int &number, uint8_t size, bool fp);
|
||||
uint64_t
|
||||
getArgument(ThreadContext *tc, int &number, uint16_t size, bool fp);
|
||||
|
||||
static inline bool
|
||||
inUserMode(ThreadContext *tc)
|
||||
|
|
|
@ -50,7 +50,7 @@ Arguments::Data::alloc(size_t size)
|
|||
}
|
||||
|
||||
uint64_t
|
||||
Arguments::getArg(uint8_t size, bool fp)
|
||||
Arguments::getArg(uint16_t size, bool fp)
|
||||
{
|
||||
return TheISA::getArgument(tc, number, size, fp);
|
||||
}
|
||||
|
|
|
@ -45,7 +45,7 @@ class Arguments
|
|||
protected:
|
||||
ThreadContext *tc;
|
||||
int number;
|
||||
uint64_t getArg(uint8_t size, bool fp = false);
|
||||
uint64_t getArg(uint16_t size = (uint16_t)(-1), bool fp = false);
|
||||
|
||||
protected:
|
||||
class Data : public RefCounted
|
||||
|
@ -82,7 +82,7 @@ class Arguments
|
|||
|
||||
// for checking if an argument is NULL
|
||||
bool operator!() {
|
||||
return getArg(TheISA::MachineBytes) == 0;
|
||||
return getArg() == 0;
|
||||
}
|
||||
|
||||
Arguments &operator++() {
|
||||
|
@ -143,7 +143,7 @@ class Arguments
|
|||
|
||||
operator char *() {
|
||||
char *buf = data->alloc(2048);
|
||||
CopyStringOut(tc, buf, getArg(TheISA::MachineBytes), 2048);
|
||||
CopyStringOut(tc, buf, getArg(), 2048);
|
||||
return buf;
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue