The Pedigree Project  0.1
hosted/state.cc
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 #include "pedigree/kernel/processor/state.h"
21 
22 const char *HostedInterruptStateRegisterName[3] = {
23  "state",
24  "extra",
25  "meta",
26 };
27 
29 {
30 }
31 
33 {
34 }
35 
37 {
38  return 3;
39 }
40 processor_register_t HostedInterruptState::getRegister(size_t index) const
41 {
42  if (index == 0)
43  return state;
44  if (index == 1)
45  return extra;
46  if (index == 2)
47  return meta;
48  return 0;
49 }
50 const char *HostedInterruptState::getRegisterName(size_t index) const
51 {
52  return HostedInterruptStateRegisterName[index];
53 }
54 
56 {
57  return 0;
58 }
59 
60 processor_register_t HostedSyscallState::getRegister(size_t index) const
61 {
62  return 0;
63 }
64 
65 const char *HostedSyscallState::getRegisterName(size_t index) const
66 {
67  return "<no registers>";
68 }
69 
72 {
73  return 0;
74 }
processor_register_t getRegister(size_t index) const
Definition: hosted/state.cc:60
size_t getRegisterCount() const
Definition: hosted/state.cc:36
const char * getRegisterName(size_t index) const
Definition: hosted/state.cc:65
size_t getRegisterCount() const
Definition: hosted/state.cc:55
processor_register_t getRegister(size_t index) const
Definition: hosted/state.cc:40
const char * getRegisterName(size_t index) const
Definition: hosted/state.cc:50
static HostedInterruptState * construct(class HostedProcessorState &state, bool userMode)
Definition: hosted/state.cc:71