L4Re Operating System Framework
Interface and Usage Documentation
Loading...
Searching...
No Matches
asm_access.h
1/* SPDX-License-Identifier: GPL-2.0-only or License-Ref-kk-custom */
2/*
3 * Copyright (C) 2021 Kernkonzept GmbH.
4 * Author(s): Jakub Jermar <jakub.jermar@kernkonzept.com>
5 */
6
7#pragma once
8
9#include <l4/sys/l4int.h>
10#include <x86/l4/drivers/asm_access.h>
11
12namespace Asm_access {
13
14inline
16read(l4_uint64_t const *mem)
17{
18 l4_uint64_t val;
19
20 asm volatile ("movq %[mem], %[val]" : [val] "=r" (val) : [mem] "m" (*mem));
21
22 return val;
23}
24
25inline
26void
27write(l4_uint64_t val, l4_uint64_t *mem)
28{
29 asm volatile ("movq %[val], %[mem]" : [mem] "=m" (*mem) : [val] "r" (val));
30}
31
32}
unsigned long long l4_uint64_t
Unsigned 64bit value.
Definition l4int.h:42