utility.cc (6329:5d8b91875859) utility.cc (6379:75d4aaf7dd54)
1/*
2 * Copyright (c) 2007 MIPS Technologies, Inc.
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;

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

33#include "config/full_system.hh"
34#include "cpu/thread_context.hh"
35#include "cpu/static_inst.hh"
36#include "sim/serialize.hh"
37#include "base/bitfield.hh"
38#include "base/misc.hh"
39
40#if FULL_SYSTEM
1/*
2 * Copyright (c) 2007 MIPS Technologies, Inc.
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;

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

33#include "config/full_system.hh"
34#include "cpu/thread_context.hh"
35#include "cpu/static_inst.hh"
36#include "sim/serialize.hh"
37#include "base/bitfield.hh"
38#include "base/misc.hh"
39
40#if FULL_SYSTEM
41#include "arch/mips/registers.hh"
41#include "arch/mips/vtophys.hh"
42#include "mem/vport.hh"
43#endif
44
45
46using namespace MipsISA;
47using namespace std;
48
49namespace MipsISA {
50
51uint64_t
52getArgument(ThreadContext *tc, int number, bool fp)
53{
54#if FULL_SYSTEM
42#include "arch/mips/vtophys.hh"
43#include "mem/vport.hh"
44#endif
45
46
47using namespace MipsISA;
48using namespace std;
49
50namespace MipsISA {
51
52uint64_t
53getArgument(ThreadContext *tc, int number, bool fp)
54{
55#if FULL_SYSTEM
55 if (number < NumArgumentRegs) {
56 if (number < 4) {
56 if (fp)
57 if (fp)
57 return tc->readFloatRegBits(ArgumentReg[number]);
58 return tc->readFloatRegBits(FirstArgumentReg + number);
58 else
59 else
59 return tc->readIntReg(ArgumentReg[number]);
60 return tc->readIntReg(FirstArgumentReg + number);
60 } else {
61 Addr sp = tc->readIntReg(StackPointerReg);
62 VirtualPort *vp = tc->getVirtPort();
63 uint64_t arg = vp->read<uint64_t>(sp +
61 } else {
62 Addr sp = tc->readIntReg(StackPointerReg);
63 VirtualPort *vp = tc->getVirtPort();
64 uint64_t arg = vp->read<uint64_t>(sp +
64 (number-NumArgumentRegs) * sizeof(uint64_t));
65 (number - 4) * sizeof(uint64_t));
65 return arg;
66 }
67#else
68 panic("getArgument() is Full system only\n");
69 M5_DUMMY_RETURN
70#endif
71}
72

--- 193 unchanged lines hidden ---
66 return arg;
67 }
68#else
69 panic("getArgument() is Full system only\n");
70 M5_DUMMY_RETURN
71#endif
72}
73

--- 193 unchanged lines hidden ---