utility.cc (8799:dac1e33e07b0) utility.cc (8806:669e93d79ed9)
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;

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

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{
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;

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

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{
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 FSTranslatingPortProxy* vp = tc->getVirtProxy();
56 uint64_t arg = vp->read<uint64_t>(sp + 92 +
57 (number-NumArgumentRegs) * sizeof(uint64_t));
58 return arg;
59 }
60 } else {
49 if (!FullSystem) {
61 panic("getArgument() only implemented for full system\n");
62 M5_DUMMY_RETURN
63 }
50 panic("getArgument() only implemented for full system\n");
51 M5_DUMMY_RETURN
52 }
53
54 const int NumArgumentRegs = 6;
55 if (number < NumArgumentRegs) {
56 return tc->readIntReg(8 + number);
57 } else {
58 Addr sp = tc->readIntReg(StackPointerReg);
59 FSTranslatingPortProxy* vp = tc->getVirtProxy();
60 uint64_t arg = vp->read<uint64_t>(sp + 92 +
61 (number-NumArgumentRegs) * sizeof(uint64_t));
62 return arg;
63 }
64}
65
66void
67copyMiscRegs(ThreadContext *src, ThreadContext *dest)
68{
69
70 uint8_t tl = src->readMiscRegNoEffect(MISCREG_TL);
71

--- 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 ---