Toggle navigation
Documentation
The friendly Operating System for the Internet of Things
Loading...
Searching...
No Matches
context_frame.h
Go to the documentation of this file.
1
/*
2
* Copyright (C) 2017, 2019 JP Bonn, Ken Rabold
3
*
4
* This file is subject to the terms and conditions of the GNU Lesser
5
* General Public License v2.1. See the file LICENSE in the top level
6
* directory for more details.
7
*/
8
19
#ifndef CONTEXT_FRAME_H
20
#define CONTEXT_FRAME_H
21
22
#if !defined(__ASSEMBLER__)
23
#include <stdint.h>
24
#endif
/* __ASSEMBLER__ */
25
26
#ifdef __cplusplus
27
extern
"C"
{
28
#endif
29
30
#if !defined(__ASSEMBLER__)
31
40
struct
context_switch_frame
{
41
/* Callee saved registers */
42
uint32_t
s0
;
43
uint32_t
s1
;
44
uint32_t
s2
;
45
uint32_t
s3
;
46
uint32_t
s4
;
47
uint32_t
s5
;
48
uint32_t
s6
;
49
uint32_t
s7
;
50
uint32_t
s8
;
51
uint32_t
s9
;
52
uint32_t
s10
;
53
uint32_t
s11
;
54
/* Caller saved registers */
55
uint32_t
ra
;
56
uint32_t
t0
;
57
uint32_t
t1
;
58
uint32_t
t2
;
59
uint32_t
t3
;
60
uint32_t
t4
;
61
uint32_t
t5
;
62
uint32_t
t6
;
63
uint32_t
a0
;
64
uint32_t
a1
;
65
uint32_t
a2
;
66
uint32_t
a3
;
67
uint32_t
a4
;
68
uint32_t
a5
;
69
uint32_t
a6
;
70
uint32_t
a7
;
71
/* Saved PC for return from ISR */
72
uint32_t
pc
;
73
uint32_t
pad
[3];
74
};
75
76
#endif
/* __ASSEMBLER__ */
77
82
/* These values are checked for correctness in context_frame.c */
83
#define s0_OFFSET 0
84
#define s1_OFFSET 4
85
#define s2_OFFSET 8
86
#define s3_OFFSET 12
87
#define s4_OFFSET 16
88
#define s5_OFFSET 20
89
#define s6_OFFSET 24
90
#define s7_OFFSET 28
91
#define s8_OFFSET 32
92
#define s9_OFFSET 36
93
#define s10_OFFSET 40
94
#define s11_OFFSET 44
95
#define ra_OFFSET 48
96
#define t0_OFFSET 52
97
#define t1_OFFSET 56
98
#define t2_OFFSET 60
99
#define t3_OFFSET 64
100
#define t4_OFFSET 68
101
#define t5_OFFSET 72
102
#define t6_OFFSET 76
103
#define a0_OFFSET 80
104
#define a1_OFFSET 84
105
#define a2_OFFSET 88
106
#define a3_OFFSET 92
107
#define a4_OFFSET 96
108
#define a5_OFFSET 100
109
#define a6_OFFSET 104
110
#define a7_OFFSET 108
111
#define pc_OFFSET 112
112
#define pad_OFFSET 116
118
#define CONTEXT_FRAME_SIZE (pad_OFFSET + 12)
119
123
#define SP_OFFSET_IN_THREAD 0
124
125
#ifdef __cplusplus
126
}
127
#endif
128
129
#endif
/* CONTEXT_FRAME_H */
context_switch_frame
Stores the registers and PC for a context switch.
Definition
context_frame.h:40
context_switch_frame::s9
uint32_t s9
s9 register
Definition
context_frame.h:51
context_switch_frame::s6
uint32_t s6
s6 register
Definition
context_frame.h:48
context_switch_frame::t6
uint32_t t6
t6 register
Definition
context_frame.h:62
context_switch_frame::a2
uint32_t a2
a2 register
Definition
context_frame.h:65
context_switch_frame::s5
uint32_t s5
s5 register
Definition
context_frame.h:47
context_switch_frame::s1
uint32_t s1
s1 register
Definition
context_frame.h:43
context_switch_frame::s11
uint32_t s11
s11 register
Definition
context_frame.h:53
context_switch_frame::s2
uint32_t s2
s2 register
Definition
context_frame.h:44
context_switch_frame::t5
uint32_t t5
t5 register
Definition
context_frame.h:61
context_switch_frame::a0
uint32_t a0
a0 register
Definition
context_frame.h:63
context_switch_frame::a3
uint32_t a3
a3 register
Definition
context_frame.h:66
context_switch_frame::s3
uint32_t s3
s3 register
Definition
context_frame.h:45
context_switch_frame::s7
uint32_t s7
s7 register
Definition
context_frame.h:49
context_switch_frame::t0
uint32_t t0
t0 register
Definition
context_frame.h:56
context_switch_frame::pc
uint32_t pc
program counter
Definition
context_frame.h:72
context_switch_frame::t4
uint32_t t4
t4 register
Definition
context_frame.h:60
context_switch_frame::t2
uint32_t t2
t2 register
Definition
context_frame.h:58
context_switch_frame::ra
uint32_t ra
ra register
Definition
context_frame.h:55
context_switch_frame::a6
uint32_t a6
a6 register
Definition
context_frame.h:69
context_switch_frame::s0
uint32_t s0
s0 register
Definition
context_frame.h:42
context_switch_frame::a5
uint32_t a5
a5 register
Definition
context_frame.h:68
context_switch_frame::a4
uint32_t a4
a4 register
Definition
context_frame.h:67
context_switch_frame::a7
uint32_t a7
a7 register
Definition
context_frame.h:70
context_switch_frame::s10
uint32_t s10
s10 register
Definition
context_frame.h:52
context_switch_frame::t3
uint32_t t3
t3 register
Definition
context_frame.h:59
context_switch_frame::pad
uint32_t pad[3]
padding to maintain 16 byte alignment
Definition
context_frame.h:73
context_switch_frame::s8
uint32_t s8
s8 register
Definition
context_frame.h:50
context_switch_frame::s4
uint32_t s4
s4 register
Definition
context_frame.h:46
context_switch_frame::a1
uint32_t a1
a1 register
Definition
context_frame.h:64
context_switch_frame::t1
uint32_t t1
t1 register
Definition
context_frame.h:57
Generated on Wed Nov 13 2024 22:58:54 by
1.9.8