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
27extern "C" {
28#endif
29
30#if !defined(__ASSEMBLER__)
31
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 */
Stores the registers and PC for a context switch.
uint32_t s9
s9 register
uint32_t s6
s6 register
uint32_t t6
t6 register
uint32_t a2
a2 register
uint32_t s5
s5 register
uint32_t s1
s1 register
uint32_t s11
s11 register
uint32_t s2
s2 register
uint32_t t5
t5 register
uint32_t a0
a0 register
uint32_t a3
a3 register
uint32_t s3
s3 register
uint32_t s7
s7 register
uint32_t t0
t0 register
uint32_t pc
program counter
uint32_t t4
t4 register
uint32_t t2
t2 register
uint32_t ra
ra register
uint32_t a6
a6 register
uint32_t s0
s0 register
uint32_t a5
a5 register
uint32_t a4
a4 register
uint32_t a7
a7 register
uint32_t s10
s10 register
uint32_t t3
t3 register
uint32_t pad[3]
padding to maintain 16 byte alignment
uint32_t s8
s8 register
uint32_t s4
s4 register
uint32_t a1
a1 register
uint32_t t1
t1 register