The Pedigree Project  0.1
mips64/state.h
1 /*
2  * Copyright (c) 2008-2014, Pedigree Developers
3  *
4  * Please see the CONTRIB file in the root of the source tree for a full
5  * list of contributors.
6  *
7  * Permission to use, copy, modify, and distribute this software for any
8  * purpose with or without fee is hereby granted, provided that the above
9  * copyright notice and this permission notice appear in all copies.
10  *
11  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
12  * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
13  * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
14  * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
15  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
16  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
17  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
18  */
19 
20 #ifndef KERNEL_PROCESSOR_MIPS64_STATE_H
21 #define KERNEL_PROCESSOR_MIPS64_STATE_H
22 
23 #include "pedigree/kernel/compiler.h"
24 #include "pedigree/kernel/processor/types.h"
25 
31 {
32  public:
33  //
34  // General Interface (both InterruptState and SyscallState)
35  //
38  inline uintptr_t getStackPointer() const;
41  inline void setStackPointer(uintptr_t stackPointer);
45  inline uintptr_t getInstructionPointer() const;
48  inline void setInstructionPointer(uintptr_t instructionPointer);
51  inline uintptr_t getBasePointer() const;
54  inline void setBasePointer(uintptr_t basePointer);
57  size_t getRegisterCount() const;
61  processor_register_t getRegister(size_t index) const;
65  const char *getRegisterName(size_t index) const;
69  inline size_t getRegisterSize(size_t index) const;
70 
71  //
72  // InterruptState Interface
73  //
76  inline bool kernelMode() const;
79  inline size_t getInterruptNumber() const;
80 
81  private:
94 } PACKED;
95 
97 {
98  public:
99  //
100  // General Interface (both InterruptState and SyscallState)
101  //
104  inline uintptr_t getStackPointer() const;
107  inline void setStackPointer(uintptr_t stackPointer);
111  inline uintptr_t getInstructionPointer() const;
114  inline void setInstructionPointer(uintptr_t instructionPointer);
117  inline uintptr_t getBasePointer() const;
120  inline void setBasePointer(uintptr_t basePointer);
123  size_t getRegisterCount() const;
127  processor_register_t getRegister(size_t index) const;
131  const char *getRegisterName(size_t index) const;
135  inline size_t getRegisterSize(size_t index) const;
136 
137  //
138  // SyscallState Interface
139  //
142  inline size_t getSyscallService() const;
145  inline size_t getSyscallNumber() const;
146 
147  private:
148 } PACKED;
149 
152 //
153 // Part of the Implementation
154 //
156 {
157  return 0;
158 }
159 void MIPS64InterruptState::setStackPointer(uintptr_t stackPointer)
160 {
161 }
163 {
164  return 0;
165 }
166 void MIPS64InterruptState::setInstructionPointer(uintptr_t instructionPointer)
167 {
168 }
170 {
171  return 0;
172 }
173 void MIPS64InterruptState::setBasePointer(uintptr_t basePointer)
174 {
175 }
176 size_t MIPS64InterruptState::getRegisterSize(size_t index) const
177 {
178  return 4;
179 }
180 
182 {
183  return false;
184 }
186 {
187  return 0;
188 }
189 
191 {
192  return 0;
193 }
194 void MIPS64SyscallState::setStackPointer(uintptr_t stackPointer)
195 {
196 }
198 {
199  return 0;
200 }
201 void MIPS64SyscallState::setInstructionPointer(uintptr_t instructionPointer)
202 {
203 }
205 {
206  return 0;
207 }
208 void MIPS64SyscallState::setBasePointer(uintptr_t basePointer)
209 {
210 }
211 size_t MIPS64SyscallState::getRegisterSize(size_t index) const
212 {
213  return 4;
214 }
215 
217 {
218  return 0;
219 }
221 {
222  return 0;
223 }
224 
225 #endif
uintptr_t getStackPointer() const
Definition: mips64/state.h:155
void setStackPointer(uintptr_t stackPointer)
Definition: mips64/state.h:159
void setInstructionPointer(uintptr_t instructionPointer)
Definition: mips64/state.h:201
const char * getRegisterName(size_t index) const
bool kernelMode() const
Definition: mips64/state.h:181
uintptr_t getStackPointer() const
Definition: mips64/state.h:190
size_t getInterruptNumber() const
Definition: mips64/state.h:185
size_t getRegisterSize(size_t index) const
Definition: mips64/state.h:211
size_t getSyscallService() const
Definition: mips64/state.h:216
size_t getSyscallNumber() const
Definition: mips64/state.h:220
uintptr_t getInstructionPointer() const
Definition: mips64/state.h:162
size_t getRegisterSize(size_t index) const
Definition: mips64/state.h:176
processor_register_t getRegister(size_t index) const
void setStackPointer(uintptr_t stackPointer)
Definition: mips64/state.h:194
void setBasePointer(uintptr_t basePointer)
Definition: mips64/state.h:173
void setBasePointer(uintptr_t basePointer)
Definition: mips64/state.h:208
uintptr_t getBasePointer() const
Definition: mips64/state.h:204
uintptr_t getInstructionPointer() const
Definition: mips64/state.h:197
MIPS64InterruptState & operator=(const MIPS64InterruptState &)
size_t getRegisterCount() const
uintptr_t getBasePointer() const
Definition: mips64/state.h:169
void setInstructionPointer(uintptr_t instructionPointer)
Definition: mips64/state.h:166