source: mainline/uspace/lib/c/arch/ia64/include/libarch/fibril_context.h@ 6ff23ff

lfn serial ticket/834-toolchain-update topic/msim-upgrade topic/simplify-dev-export
Last change on this file since 6ff23ff was 7c3fb9b, checked in by Jiri Svoboda <jiri@…>, 8 years ago

Fix block comment formatting (ccheck).

  • Property mode set to 100644
File size: 4.3 KB
Line 
1/*
2 * Copyright (c) 2014 Jakub Jermar
3 * All rights preserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 *
9 * - Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer.
11 * - Redistributions in binary form must reproduce the above copyright
12 * notice, this list of conditions and the following disclaimer in the
13 * documentation and/or other materials provided with the distribution.
14 * - The name of the author may not be used to endorse or promote products
15 * derived from this software without specific prior written permission.
16 *
17 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
18 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
19 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
20 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
21 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
22 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 */
28
29#ifndef LIBC_ARCH_FIBRIL_CONTEXT_H_
30#define LIBC_ARCH_FIBRIL_CONTEXT_H_
31
32#define CONTEXT_OFFSET_AR_PFS 0x000
33#define CONTEXT_OFFSET_AR_UNAT_CALLER 0x008
34#define CONTEXT_OFFSET_AR_UNAT_CALLEE 0x010
35#define CONTEXT_OFFSET_AR_RSC 0x018
36#define CONTEXT_OFFSET_BSP 0x020
37#define CONTEXT_OFFSET_AR_RNAT 0x028
38#define CONTEXT_OFFSET_AR_LC 0x030
39#define CONTEXT_OFFSET_R1 0x038
40#define CONTEXT_OFFSET_R4 0x040
41#define CONTEXT_OFFSET_R5 0x048
42#define CONTEXT_OFFSET_R6 0x050
43#define CONTEXT_OFFSET_R7 0x058
44#define CONTEXT_OFFSET_SP 0x060
45#define CONTEXT_OFFSET_TP 0x068
46#define CONTEXT_OFFSET_PC 0x070
47#define CONTEXT_OFFSET_B1 0x078
48#define CONTEXT_OFFSET_B2 0x080
49#define CONTEXT_OFFSET_B3 0x088
50#define CONTEXT_OFFSET_B4 0x090
51#define CONTEXT_OFFSET_B5 0x098
52#define CONTEXT_OFFSET_PR 0x0a0
53#define CONTEXT_OFFSET_F2 0x0b0
54#define CONTEXT_OFFSET_F3 0x0c0
55#define CONTEXT_OFFSET_F4 0x0d0
56#define CONTEXT_OFFSET_F5 0x0e0
57#define CONTEXT_OFFSET_F16 0x0f0
58#define CONTEXT_OFFSET_F17 0x100
59#define CONTEXT_OFFSET_F18 0x110
60#define CONTEXT_OFFSET_F19 0x120
61#define CONTEXT_OFFSET_F20 0x130
62#define CONTEXT_OFFSET_F21 0x140
63#define CONTEXT_OFFSET_F22 0x150
64#define CONTEXT_OFFSET_F23 0x160
65#define CONTEXT_OFFSET_F24 0x170
66#define CONTEXT_OFFSET_F25 0x180
67#define CONTEXT_OFFSET_F26 0x190
68#define CONTEXT_OFFSET_F27 0x1a0
69#define CONTEXT_OFFSET_F28 0x1b0
70#define CONTEXT_OFFSET_F29 0x1c0
71#define CONTEXT_OFFSET_F30 0x1d0
72#define CONTEXT_OFFSET_F31 0x1e0
73#define CONTEXT_SIZE 0x1f0
74
75#ifndef __ASSEMBLER__
76
77#include <stdint.h>
78
79// Only save registers that must be preserved across function calls.
80typedef struct context {
81 // Application registers.
82 uint64_t ar_pfs;
83 uint64_t ar_unat_caller;
84 uint64_t ar_unat_callee;
85 uint64_t ar_rsc;
86 // ar_bsp
87 uint64_t bsp;
88 uint64_t ar_rnat;
89 uint64_t ar_lc;
90
91 // General registers.
92 uint64_t r1;
93 uint64_t r4;
94 uint64_t r5;
95 uint64_t r6;
96 uint64_t r7;
97 // r12
98 uint64_t sp;
99 // r13
100 uint64_t tp;
101
102 // Branch registers.
103 // b0
104 uint64_t pc;
105 uint64_t b1;
106 uint64_t b2;
107 uint64_t b3;
108 uint64_t b4;
109 uint64_t b5;
110
111 // Predicate registers.
112 uint64_t pr;
113 uint128_t f2;
114 uint128_t f3;
115 uint128_t f4;
116 uint128_t f5;
117 uint128_t f16;
118 uint128_t f17;
119 uint128_t f18;
120 uint128_t f19;
121 uint128_t f20;
122 uint128_t f21;
123 uint128_t f22;
124 uint128_t f23;
125 uint128_t f24;
126 uint128_t f25;
127 uint128_t f26;
128 uint128_t f27;
129 uint128_t f28;
130 uint128_t f29;
131 uint128_t f30;
132 uint128_t f31;
133} context_t;
134
135#endif /* __ASSEMBLER__ */
136#endif
137
Note: See TracBrowser for help on using the repository browser.