Deleted Added
sdiff udiff text old ( 8706:b1838faf3bcc ) new ( 8767:e575781f71b8 )
full compact
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"
36#include "mem/fs_translating_port_proxy.hh"
37#endif
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{
51#if FULL_SYSTEM
52 const int NumArgumentRegs = 6;
53 if (number < NumArgumentRegs) {
54 return tc->readIntReg(8 + number);
55 } 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 }
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 ---