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 {
|
namespace AlphaISA {
|
||||||
|
|
||||||
uint64_t
|
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 FULL_SYSTEM
|
||||||
const int NumArgumentRegs = 6;
|
const int NumArgumentRegs = 6;
|
||||||
|
|
|
@ -41,7 +41,7 @@
|
||||||
|
|
||||||
namespace AlphaISA {
|
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
|
inline bool
|
||||||
inUserMode(ThreadContext *tc)
|
inUserMode(ThreadContext *tc)
|
||||||
|
|
|
@ -39,6 +39,7 @@
|
||||||
|
|
||||||
|
|
||||||
#include "arch/arm/faults.hh"
|
#include "arch/arm/faults.hh"
|
||||||
|
#include "arch/arm/isa_traits.hh"
|
||||||
#include "arch/arm/utility.hh"
|
#include "arch/arm/utility.hh"
|
||||||
#include "cpu/thread_context.hh"
|
#include "cpu/thread_context.hh"
|
||||||
|
|
||||||
|
@ -61,8 +62,12 @@ initCPU(ThreadContext *tc, int cpuId)
|
||||||
reset->invoke(tc);
|
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 FULL_SYSTEM
|
||||||
|
if (size == (uint16_t)(-1))
|
||||||
|
size = ArmISA::MachineBytes;
|
||||||
if (fp)
|
if (fp)
|
||||||
panic("getArgument(): Floating point arguments not implemented\n");
|
panic("getArgument(): Floating point arguments not implemented\n");
|
||||||
|
|
||||||
|
|
|
@ -156,7 +156,7 @@ namespace ArmISA {
|
||||||
return !cpacr.asedis && vfpEnabled(cpacr, cpsr, fpexc);
|
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 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);
|
Fault readCp15Register(uint32_t &Rd, int CRn, int opc1, int CRm, int opc2);
|
||||||
|
|
|
@ -52,7 +52,7 @@ using namespace std;
|
||||||
namespace MipsISA {
|
namespace MipsISA {
|
||||||
|
|
||||||
uint64_t
|
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 FULL_SYSTEM
|
||||||
if (number < 4) {
|
if (number < 4) {
|
||||||
|
|
|
@ -45,7 +45,7 @@ class ThreadContext;
|
||||||
|
|
||||||
namespace MipsISA {
|
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,
|
//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
|
//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.
|
//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
|
#if FULL_SYSTEM
|
||||||
const int NumArgumentRegs = 6;
|
const int NumArgumentRegs = 6;
|
||||||
if (number < NumArgumentRegs) {
|
if (number < NumArgumentRegs) {
|
||||||
|
|
|
@ -41,7 +41,8 @@
|
||||||
|
|
||||||
namespace SparcISA
|
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
|
static inline bool
|
||||||
inUserMode(ThreadContext *tc)
|
inUserMode(ThreadContext *tc)
|
||||||
|
|
|
@ -52,7 +52,9 @@
|
||||||
|
|
||||||
namespace X86ISA {
|
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
|
#if FULL_SYSTEM
|
||||||
panic("getArgument() not implemented for x86!\n");
|
panic("getArgument() not implemented for x86!\n");
|
||||||
#else
|
#else
|
||||||
|
|
|
@ -52,7 +52,8 @@ class ThreadContext;
|
||||||
|
|
||||||
namespace X86ISA
|
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
|
static inline bool
|
||||||
inUserMode(ThreadContext *tc)
|
inUserMode(ThreadContext *tc)
|
||||||
|
|
|
@ -50,7 +50,7 @@ Arguments::Data::alloc(size_t size)
|
||||||
}
|
}
|
||||||
|
|
||||||
uint64_t
|
uint64_t
|
||||||
Arguments::getArg(uint8_t size, bool fp)
|
Arguments::getArg(uint16_t size, bool fp)
|
||||||
{
|
{
|
||||||
return TheISA::getArgument(tc, number, size, fp);
|
return TheISA::getArgument(tc, number, size, fp);
|
||||||
}
|
}
|
||||||
|
|
|
@ -45,7 +45,7 @@ class Arguments
|
||||||
protected:
|
protected:
|
||||||
ThreadContext *tc;
|
ThreadContext *tc;
|
||||||
int number;
|
int number;
|
||||||
uint64_t getArg(uint8_t size, bool fp = false);
|
uint64_t getArg(uint16_t size = (uint16_t)(-1), bool fp = false);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
class Data : public RefCounted
|
class Data : public RefCounted
|
||||||
|
@ -82,7 +82,7 @@ class Arguments
|
||||||
|
|
||||||
// for checking if an argument is NULL
|
// for checking if an argument is NULL
|
||||||
bool operator!() {
|
bool operator!() {
|
||||||
return getArg(TheISA::MachineBytes) == 0;
|
return getArg() == 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
Arguments &operator++() {
|
Arguments &operator++() {
|
||||||
|
@ -143,7 +143,7 @@ class Arguments
|
||||||
|
|
||||||
operator char *() {
|
operator char *() {
|
||||||
char *buf = data->alloc(2048);
|
char *buf = data->alloc(2048);
|
||||||
CopyStringOut(tc, buf, getArg(TheISA::MachineBytes), 2048);
|
CopyStringOut(tc, buf, getArg(), 2048);
|
||||||
return buf;
|
return buf;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue