L4Re Operating System Framework
Interface and Usage Documentation
Loading...
Searching...
No Matches
__vcpu-arm.h
1/*
2 * (c) 2017 Alexander Warg <alexander.warg@kernkonzept.com>
3 *
4 * This file is part of L4Re and distributed under the terms of the
5 * GNU General Public License 2.
6 * Please see the COPYING-GPL-2 file for details.
7 *
8 * As a special exception, you may use this file as part of a free software
9 * library without restriction. Specifically, if other files instantiate
10 * templates or use macros or inline functions from this file, or you compile
11 * this file and link it with other files to produce an executable, this
12 * file does not by itself cause the resulting executable to be covered by
13 * the GNU General Public License. This exception does not however
14 * invalidate any other reasons why the executable file might be covered by
15 * the GNU General Public License.
16 */
17#pragma once
18
19typedef struct l4_arm_vcpu_e_info_t
20{
21 l4_uint8_t version; // must be 0
22 l4_uint8_t gic_version;
23 l4_uint8_t _rsvd0[2];
24 l4_uint32_t features;
25 l4_uint32_t _rsvd1[14];
26 l4_umword_t user[8];
27} l4_arm_vcpu_e_info_t;
28
29L4_INLINE void *l4_vcpu_e_ptr(void const *vcpu, unsigned id) L4_NOTHROW;
30
31enum L4_vcpu_e_consts
32{
33 L4_VCPU_E_NUM_LR = 4,
34};
35
36L4_INLINE l4_arm_vcpu_e_info_t const *
37l4_vcpu_e_info(void const *vcpu) L4_NOTHROW;
38
40l4_vcpu_e_info_user(void *vcpu) L4_NOTHROW;
41
43l4_vcpu_e_info_user(void *vcpu) L4_NOTHROW
44{
45 return ((l4_arm_vcpu_e_info_t *)l4_vcpu_e_info(vcpu))->user;
46}
47
48
57l4_vcpu_e_read_32(void const *vcpu, unsigned id) L4_NOTHROW;
58
60l4_vcpu_e_read_32(void const *vcpu, unsigned id) L4_NOTHROW
61{ return *(l4_uint32_t const *)l4_vcpu_e_ptr(vcpu, id); }
62
70L4_INLINE void
71l4_vcpu_e_write_32(void *vcpu, unsigned id, l4_uint32_t val) L4_NOTHROW;
72
73L4_INLINE void
74l4_vcpu_e_write_32(void *vcpu, unsigned id, l4_uint32_t val) L4_NOTHROW
75{ *((l4_uint32_t *)l4_vcpu_e_ptr(vcpu, + id)) = val; }
76
85l4_vcpu_e_read_64(void const *vcpu, unsigned id) L4_NOTHROW;
86
88l4_vcpu_e_read_64(void const *vcpu, unsigned id) L4_NOTHROW
89{ return *(l4_uint64_t const *)l4_vcpu_e_ptr(vcpu, id); }
90
98L4_INLINE void
99l4_vcpu_e_write_64(void *vcpu, unsigned id, l4_uint64_t val) L4_NOTHROW;
100
101L4_INLINE void
102l4_vcpu_e_write_64(void *vcpu, unsigned id, l4_uint64_t val) L4_NOTHROW
103{ *((l4_uint64_t *)l4_vcpu_e_ptr(vcpu, id)) = val; }
104
113l4_vcpu_e_read(void const *vcpu, unsigned id) L4_NOTHROW;
114
116l4_vcpu_e_read(void const *vcpu, unsigned id) L4_NOTHROW
117{ return *(l4_umword_t const *)l4_vcpu_e_ptr(vcpu, id); }
118
126L4_INLINE void
127l4_vcpu_e_write(void *vcpu, unsigned id, l4_umword_t val) L4_NOTHROW;
128
129L4_INLINE void
130l4_vcpu_e_write(void *vcpu, unsigned id, l4_umword_t val) L4_NOTHROW
131{ *((l4_umword_t *)l4_vcpu_e_ptr(vcpu, id)) = val; }
unsigned long l4_umword_t
Unsigned machine word.
Definition l4int.h:51
unsigned char l4_uint8_t
Unsigned 8bit value.
Definition l4int.h:36
unsigned int l4_uint32_t
Unsigned 32bit value.
Definition l4int.h:40
unsigned long long l4_uint64_t
Unsigned 64bit value.
Definition l4int.h:42
#define L4_NOTHROW
Mark a function declaration and definition as never throwing an exception.
Definition compiler.h:188
#define L4_INLINE
L4 Inline function attribute.
Definition compiler.h:62