L4Re Operating System Framework
Interface and Usage Documentation
Loading...
Searching...
No Matches
asm_access.h
1
/*
2
* Copyright (C) 2021, 2024 Kernkonzept GmbH.
3
* Author(s): Jakub Jermar <jakub.jermar@kernkonzept.com>
4
*
5
* License: see LICENSE.spdx (in this directory or the directories above)
6
*/
7
8
#pragma once
9
10
#include <l4/sys/l4int.h>
11
12
namespace
Asm_access {
13
14
inline
15
l4_uint8_t
16
read
(
l4_uint8_t
const
*mem)
17
{
18
l4_uint8_t
val;
19
20
asm
volatile
(
"ldrb %w[val], %[mem]"
: [val]
"=r"
(val) : [mem]
"m"
(*mem));
21
22
return
val;
23
}
24
25
inline
26
l4_uint16_t
27
read
(
l4_uint16_t
const
*mem)
28
{
29
l4_uint16_t
val;
30
31
asm
volatile
(
"ldrh %w[val], %[mem]"
: [val]
"=r"
(val) : [mem]
"m"
(*mem));
32
33
return
val;
34
}
35
36
inline
37
l4_uint32_t
38
read
(
l4_uint32_t
const
*mem)
39
{
40
l4_uint32_t
val;
41
42
asm
volatile
(
"ldr %w[val], %[mem]"
: [val]
"=r"
(val) : [mem]
"m"
(*mem));
43
44
return
val;
45
}
46
47
inline
48
l4_uint64_t
49
read
(
l4_uint64_t
const
*mem)
50
{
51
l4_uint64_t
val;
52
53
asm
volatile
(
"ldr %[val], %[mem]"
: [val]
"=r"
(val) : [mem]
"m"
(*mem));
54
55
return
val;
56
}
57
58
inline
59
void
60
write(
l4_uint8_t
val,
l4_uint8_t
*mem)
61
{
62
asm
volatile
(
"strb %w[val], %[mem]"
:[mem]
"=m"
(*mem) : [val]
"r"
(val));
63
}
64
65
inline
66
void
67
write(
l4_uint16_t
val,
l4_uint16_t
*mem)
68
{
69
asm
volatile
(
"strh %w[val], %[mem]"
: [mem]
"=m"
(*mem) : [val]
"r"
(val));
70
}
71
72
inline
73
void
74
write(
l4_uint32_t
val,
l4_uint32_t
*mem)
75
{
76
asm
volatile
(
"str %w[val], %[mem]"
: [mem]
"=m"
(*mem) : [val]
"r"
(val));
77
}
78
79
inline
80
void
81
write(
l4_uint64_t
val,
l4_uint64_t
*mem)
82
{
83
asm
volatile
(
"str %[val], %[mem]"
: [mem]
"=m"
(*mem) : [val]
"r"
(val));
84
}
85
86
}
l4_uint8_t
unsigned char l4_uint8_t
Unsigned 8bit value.
Definition
l4int.h:25
l4_uint32_t
unsigned int l4_uint32_t
Unsigned 32bit value.
Definition
l4int.h:29
l4_uint16_t
unsigned short int l4_uint16_t
Unsigned 16bit value.
Definition
l4int.h:27
l4_uint64_t
unsigned long long l4_uint64_t
Unsigned 64bit value.
Definition
l4int.h:31
L4::Ipc::read
T read(Istream &s)
Read a value out of a stream.
Definition
ipc_stream:1289
pkg
drivers-frst
include
ARCH-arm64
asm_access.h
Generated on Mon Mar 3 2025 23:08:49 for L4Re Operating System Framework by
1.9.8