L4Re Operating System Framework
Interface and Usage Documentation
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
utcb.h
Go to the documentation of this file.
1
6/*
7 * (c) 2008-2009 Adam Lackorzynski <adam@os.inf.tu-dresden.de>,
8 * Alexander Warg <warg@os.inf.tu-dresden.de>
9 * economic rights: Technische Universität Dresden (Germany)
10 *
11 * License: see LICENSE.spdx (in this directory or the directories above)
12 */
13/*****************************************************************************/
14#ifndef __L4_SYS__INCLUDE__ARCH_AMD64__UTCB_H__
15#define __L4_SYS__INCLUDE__ARCH_AMD64__UTCB_H__
16
17#include <l4/sys/types.h>
18
29{
30 L4_UTCB_EXCEPTION_REGS_SIZE = 26,
31 L4_UTCB_GENERIC_DATA_SIZE = 63,
32 L4_UTCB_GENERIC_BUFFERS_SIZE = 58,
33
34 L4_UTCB_MSG_REGS_OFFSET = 0,
35 L4_UTCB_BUF_REGS_OFFSET = 64 * sizeof(l4_umword_t),
36 L4_UTCB_THREAD_REGS_OFFSET = 123 * sizeof(l4_umword_t),
37
38 L4_UTCB_INHERIT_FPU = 1UL << 24,
39 L4_UTCB_OFFSET = 1024,
40};
41
46typedef struct l4_exc_regs_t
47{
72 l4_umword_t fs_base;
73 l4_umword_t gs_base;
74 l4_uint16_t ds, es, fs, gs;
76
77
78#include_next <l4/sys/utcb.h>
79
80/*
81 * ==================================================================
82 * Implementations.
83 */
84
85L4_INLINE l4_utcb_t *l4_utcb_direct(void) L4_NOTHROW
86{
87 l4_utcb_t *res;
88 __asm__ ( "mov %%gs:0, %0 \n" : "=r"(res));
89 return res;
90}
91
93{
94 return u->ip;
95}
96
98{
99 u->ip = pc;
100}
101
103{
104 return u->trapno;
105}
106
108{
109 return u->trapno == 14;
110}
111
113{
114 return (u->pfa & ~7UL) | (u->err & 2);
115}
116
121
122#endif /* ! __L4_SYS__INCLUDE__ARCH_AMD64__UTCB_H__ */
unsigned long l4_umword_t
Unsigned machine word.
Definition l4int.h:40
unsigned long l4_addr_t
Address type.
Definition l4int.h:34
unsigned short int l4_uint16_t
Unsigned 16bit value.
Definition l4int.h:27
L4_utcb_consts_amd64
UTCB constants for AMD64.
Definition utcb.h:29
struct l4_exc_regs_t l4_exc_regs_t
UTCB structure for exceptions.
struct l4_utcb_t l4_utcb_t
Opaque type for the UTCB.
Definition utcb.h:56
l4_addr_t l4_utcb_exc_pfa(l4_exc_regs_t const *u) L4_NOTHROW
Function to get the L4 style page fault address out of an exception.
Definition utcb.h:112
int l4_utcb_exc_is_ex_regs_exception(l4_exc_regs_t const *u) L4_NOTHROW
Check whether an exception IPC was triggered via l4_thread_ex_regs().
Definition utcb.h:117
int l4_utcb_exc_is_pf(l4_exc_regs_t const *u) L4_NOTHROW
Check whether an exception IPC is a page fault.
Definition utcb.h:107
l4_umword_t l4_utcb_exc_pc(l4_exc_regs_t const *u) L4_NOTHROW
Access function to get the program counter of the exception state.
Definition utcb.h:92
l4_umword_t l4_utcb_exc_typeval(l4_exc_regs_t const *u) L4_NOTHROW
Get the value out of an exception UTCB that describes the type of exception.
Definition utcb.h:102
void l4_utcb_exc_pc_set(l4_exc_regs_t *u, l4_addr_t pc) L4_NOTHROW
Set the program counter register in the exception state.
Definition utcb.h:97
#define L4_NOTHROW
Mark a function declaration and definition as never throwing an exception.
Definition compiler.h:159
#define L4_INLINE
L4 Inline function attribute.
Definition compiler.h:51
Common L4 ABI Data Types.
UTCB structure for exceptions.
Definition utcb.h:28
l4_umword_t trapno
trap number
Definition utcb.h:65
l4_umword_t rax
rax
Definition utcb.h:63
l4_umword_t sp
stack pointer
Definition utcb.h:33
l4_umword_t ss
stack segment register
Definition utcb.h:71
l4_umword_t r14
r14
Definition utcb.h:49
l4_umword_t rdx
rdx
Definition utcb.h:61
l4_umword_t pfa
page fault address
Definition utcb.h:29
l4_umword_t rcx
rcx
Definition utcb.h:62
l4_umword_t r9
r9
Definition utcb.h:54
l4_umword_t ip
instruction pointer
Definition utcb.h:36
l4_umword_t flags
rflags
Definition utcb.h:37
l4_umword_t dummy1
dummy
Definition utcb.h:68
l4_umword_t r11
r11
Definition utcb.h:52
l4_umword_t r12
r12
Definition utcb.h:51
l4_umword_t r8
r8
Definition utcb.h:55
l4_umword_t r10
r10
Definition utcb.h:53
l4_umword_t r15
r15
Definition utcb.h:48
l4_umword_t rsi
rsi
Definition utcb.h:57
l4_umword_t rbp
rbp
Definition utcb.h:58
l4_umword_t err
error code
Definition utcb.h:30
l4_umword_t rbx
rbx
Definition utcb.h:60
l4_umword_t rdi
rdi
Definition utcb.h:56
l4_umword_t r13
r13
Definition utcb.h:50