L4Re - L4 Runtime Environment
__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 
19 L4_INLINE l4_addr_t l4_vcpu_e_ptr(void const *vcpu, unsigned id) L4_NOTHROW;
20 L4_INLINE l4_addr_t l4_vcpu_e_ptr(void const *vcpu, unsigned id) L4_NOTHROW
21 { return (l4_addr_t)vcpu + 0x400 + (id & 0xfff); }
22 
23 enum L4_vcpu_e_consts
24 {
25  L4_VCPU_E_NUM_LR = 4,
26 };
27 
35 L4_INLINE l4_uint32_t
36 l4_vcpu_e_read_32(void const *vcpu, unsigned id) L4_NOTHROW;
37 
38 L4_INLINE l4_uint32_t
39 l4_vcpu_e_read_32(void const *vcpu, unsigned id) L4_NOTHROW
40 { return *(l4_uint32_t const *)l4_vcpu_e_ptr(vcpu, id); }
41 
49 L4_INLINE void
50 l4_vcpu_e_write_32(void *vcpu, unsigned id, l4_uint32_t val) L4_NOTHROW;
51 
52 L4_INLINE void
53 l4_vcpu_e_write_32(void *vcpu, unsigned id, l4_uint32_t val) L4_NOTHROW
54 { *((l4_uint32_t *)l4_vcpu_e_ptr(vcpu, + id)) = val; }
55 
63 L4_INLINE l4_uint64_t
64 l4_vcpu_e_read_64(void const *vcpu, unsigned id) L4_NOTHROW;
65 
66 L4_INLINE l4_uint64_t
67 l4_vcpu_e_read_64(void const *vcpu, unsigned id) L4_NOTHROW
68 { return *(l4_uint64_t const *)l4_vcpu_e_ptr(vcpu, id); }
69 
77 L4_INLINE void
78 l4_vcpu_e_write_64(void *vcpu, unsigned id, l4_uint64_t val) L4_NOTHROW;
79 
80 L4_INLINE void
81 l4_vcpu_e_write_64(void *vcpu, unsigned id, l4_uint64_t val) L4_NOTHROW
82 { *((l4_uint64_t *)l4_vcpu_e_ptr(vcpu, id)) = val; }
83 
91 L4_INLINE l4_umword_t
92 l4_vcpu_e_read(void const *vcpu, unsigned id) L4_NOTHROW;
93 
94 L4_INLINE l4_umword_t
95 l4_vcpu_e_read(void const *vcpu, unsigned id) L4_NOTHROW
96 { return *(l4_umword_t const *)l4_vcpu_e_ptr(vcpu, id); }
97 
105 L4_INLINE void
106 l4_vcpu_e_write(void *vcpu, unsigned id, l4_umword_t val) L4_NOTHROW;
107 
108 L4_INLINE void
109 l4_vcpu_e_write(void *vcpu, unsigned id, l4_umword_t val) L4_NOTHROW
110 { *((l4_umword_t *)l4_vcpu_e_ptr(vcpu, id)) = val; }
unsigned long l4_umword_t
Unsigned machine word.
Definition: l4int.h:52
unsigned long long l4_uint64_t
Unsigned 64bit value.
Definition: l4int.h:42
unsigned long l4_addr_t
Address type.
Definition: l4int.h:45
unsigned int l4_uint32_t
Unsigned 32bit value.
Definition: l4int.h:40
#define L4_NOTHROW
Mark a function declaration and definition as never throwing an exception.
Definition: compiler.h:185