utility.cc (8706:b1838faf3bcc) utility.cc (8767:e575781f71b8)
1/*
2 * Copyright (c) 2003-2005 The Regents of The University of Michigan
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;

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

26 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 *
28 * Authors: Gabe Black
29 * Ali Saidi
30 */
31
32#include "arch/sparc/faults.hh"
33#include "arch/sparc/utility.hh"
1/*
2 * Copyright (c) 2003-2005 The Regents of The University of Michigan
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;

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

26 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 *
28 * Authors: Gabe Black
29 * Ali Saidi
30 */
31
32#include "arch/sparc/faults.hh"
33#include "arch/sparc/utility.hh"
34#if FULL_SYSTEM
35#include "arch/sparc/vtophys.hh"
34#include "arch/sparc/vtophys.hh"
36#include "mem/fs_translating_port_proxy.hh"
37#endif
35#include "mem/vport.hh"
38
39namespace SparcISA {
40
41
42// The caller uses %o0-%05 for the first 6 arguments even if their floating
43// point. Double precision floating point values take two registers/args.
44// Quads, structs, and unions are passed as pointers. All arguments beyond
45// the sixth are passed on the stack past the 16 word window save area,
46// space for the struct/union return pointer, and space reserved for the
47// first 6 arguments which the caller may use but doesn't have to.
48uint64_t
49getArgument(ThreadContext *tc, int &number, uint16_t size, bool fp)
50{
36
37namespace SparcISA {
38
39
40// The caller uses %o0-%05 for the first 6 arguments even if their floating
41// point. Double precision floating point values take two registers/args.
42// Quads, structs, and unions are passed as pointers. All arguments beyond
43// the sixth are passed on the stack past the 16 word window save area,
44// space for the struct/union return pointer, and space reserved for the
45// first 6 arguments which the caller may use but doesn't have to.
46uint64_t
47getArgument(ThreadContext *tc, int &number, uint16_t size, bool fp)
48{
51#if FULL_SYSTEM
52 const int NumArgumentRegs = 6;
53 if (number < NumArgumentRegs) {
54 return tc->readIntReg(8 + number);
49 if (FullSystem) {
50 const int NumArgumentRegs = 6;
51 if (number < NumArgumentRegs) {
52 return tc->readIntReg(8 + number);
53 } else {
54 Addr sp = tc->readIntReg(StackPointerReg);
55 VirtualPort *vp = tc->getVirtPort();
56 uint64_t arg = vp->read<uint64_t>(sp + 92 +
57 (number-NumArgumentRegs) * sizeof(uint64_t));
58 return arg;
59 }
55 } else {
60 } else {
56 Addr sp = tc->readIntReg(StackPointerReg);
57 FSTranslatingPortProxy* vp = tc->getVirtProxy();
58 uint64_t arg = vp->read<uint64_t>(sp + 92 +
59 (number-NumArgumentRegs) * sizeof(uint64_t));
60 return arg;
61 panic("getArgument() only implemented for full system\n");
62 M5_DUMMY_RETURN
61 }
63 }
62#else
63 panic("getArgument() only implemented for FULL_SYSTEM\n");
64 M5_DUMMY_RETURN
65#endif
66}
67
68void
69copyMiscRegs(ThreadContext *src, ThreadContext *dest)
70{
71
72 uint8_t tl = src->readMiscRegNoEffect(MISCREG_TL);
73

--- 190 unchanged lines hidden ---
64}
65
66void
67copyMiscRegs(ThreadContext *src, ThreadContext *dest)
68{
69
70 uint8_t tl = src->readMiscRegNoEffect(MISCREG_TL);
71

--- 190 unchanged lines hidden ---