Deleted Added
sdiff udiff text old ( 11800:54436a1784dc ) new ( 11851:824055fe6b30 )
full compact
1/*
2 * Copyright (c) 2003-2004 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;

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

35#include <string>
36#include <vector>
37
38#include "mem/page_table.hh"
39#include "sim/byteswap.hh"
40#include "sim/process.hh"
41
42class ObjectFile;
43class System;
44
45class SparcLiveProcess : public LiveProcess
46{
47 protected:
48
49 const Addr StackBias;
50
51 // The locations of the fill and spill handlers
52 Addr fillStart, spillStart;
53
54 SparcLiveProcess(LiveProcessParams * params,
55 ObjectFile *objFile, Addr _StackBias);
56
57 void initState();
58
59 template<class IntType>
60 void argsInit(int pageSize);
61
62 public:
63
64 // Handles traps which request services from the operating system
65 virtual void handleTrap(int trapNum, ThreadContext *tc);
66
67 Addr readFillStart() { return fillStart; }
68 Addr readSpillStart() { return spillStart; }
69
70 virtual void flushWindows(ThreadContext *tc) = 0;
71 void setSyscallReturn(ThreadContext *tc, SyscallReturn return_value);
72};
73
74class Sparc32LiveProcess : public SparcLiveProcess
75{
76 protected:
77
78 Sparc32LiveProcess(LiveProcessParams * params, ObjectFile *objFile) :
79 SparcLiveProcess(params, objFile, 0)
80 {
81 // Set up stack. On SPARC Linux, stack goes from the top of memory
82 // downward, less the hole for the kernel address space.
83 stack_base = (Addr)0xf0000000ULL;
84
85 // Set up region for mmaps.
86 mmap_end = 0x70000000;
87 }
88
89 void initState();
90
91 public:
92
93 void argsInit(int intSize, int pageSize);
94
95 void flushWindows(ThreadContext *tc);
96
97 SparcISA::IntReg getSyscallArg(ThreadContext *tc, int &i);
98 /// Explicitly import the otherwise hidden getSyscallArg
99 using LiveProcess::getSyscallArg;
100
101 void setSyscallArg(ThreadContext *tc, int i, SparcISA::IntReg val);
102};
103
104class Sparc64LiveProcess : public SparcLiveProcess
105{
106 protected:
107
108 Sparc64LiveProcess(LiveProcessParams * params, ObjectFile *objFile) :
109 SparcLiveProcess(params, objFile, 2047)
110 {
111 // Set up stack. On SPARC Linux, stack goes from the top of memory
112 // downward, less the hole for the kernel address space.
113 stack_base = (Addr)0x80000000000ULL;
114
115 // Set up region for mmaps.
116 mmap_end = 0xfffff80000000000ULL;
117 }
118
119 void initState();
120
121 public:
122
123 void argsInit(int intSize, int pageSize);
124
125 void flushWindows(ThreadContext *tc);
126
127 SparcISA::IntReg getSyscallArg(ThreadContext *tc, int &i);
128 /// Explicitly import the otherwise hidden getSyscallArg
129 using LiveProcess::getSyscallArg;
130
131 void setSyscallArg(ThreadContext *tc, int i, SparcISA::IntReg val);
132};
133
134/* No architectural page table defined for this ISA */
135typedef NoArchPageTable ArchPageTable;
136
137#endif // __SPARC_PROCESS_HH__