85f810978a11d513198b169ff6f7a49efb7f04ff
[barrelfish] / include / arch / x86_64 / barrelfish_kpi / registers_arch.h
1 /**
2  * \file
3  * \brief Arch independent accessor functions for use in generic code
4  * Generic include for kernel
5  */
6
7 /*
8  * Copyright (c) 2010, ETH Zurich.
9  * All rights reserved.
10  *
11  * This file is distributed under the terms in the attached LICENSE file.
12  * If you do not find this file, copies can be found by writing to:
13  * ETH Zurich D-INFK, Haldeneggsteig 4, CH-8092 Zurich. Attn: Systems Group.
14  */
15
16 #ifndef ARCH_X86_64_BARRELFISH_KPI_REGISTERS_H
17 #define ARCH_X86_64_BARRELFISH_KPI_REGISTERS_H
18
19 #include <barrelfish_kpi/types.h> // for lvaddr_t
20 #include <target/x86_64/barrelfish_kpi/registers_target.h>
21
22 ///< Opaque handle for the register state
23 typedef struct registers_x86_64 arch_registers_state_t;
24
25 ///< Opaque handle for the FPU register state
26 typedef struct registers_fpu_x86_64 arch_registers_fpu_state_t;
27
28 static inline void
29 registers_set_entry(arch_registers_state_t *regs, lvaddr_t entry)
30 {
31     registers_x86_64_set_entry(regs, entry);
32 }
33
34 static inline void
35 registers_set_param(arch_registers_state_t *regs, uint64_t param)
36 {
37     registers_x86_64_set_param(regs, param);
38 }
39
40 static inline void
41 registers_get_param(arch_registers_state_t *regs, uint64_t *param)
42 {
43     registers_x86_64_get_param(regs, param);
44 }
45
46 static inline uint64_t
47 registers_get_ip(arch_registers_state_t *regs)
48 {
49     return registers_x86_64_get_ip(regs);
50 }
51
52 static inline uint64_t
53 registers_get_sp(arch_registers_state_t *regs)
54 {
55     return registers_x86_64_get_sp(regs);
56 }
57
58 #endif // ARCH_X86_64_BARRELFISH_KPI_REGISTERS_H