1 |
27 |
unneback |
//==========================================================================
|
2 |
|
|
//
|
3 |
|
|
// hal_mk_defs.c
|
4 |
|
|
//
|
5 |
|
|
// HAL (architecture) "make defs" program
|
6 |
|
|
//
|
7 |
|
|
//==========================================================================
|
8 |
|
|
//####ECOSGPLCOPYRIGHTBEGIN####
|
9 |
|
|
// -------------------------------------------
|
10 |
|
|
// This file is part of eCos, the Embedded Configurable Operating System.
|
11 |
|
|
// Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc.
|
12 |
|
|
//
|
13 |
|
|
// eCos is free software; you can redistribute it and/or modify it under
|
14 |
|
|
// the terms of the GNU General Public License as published by the Free
|
15 |
|
|
// Software Foundation; either version 2 or (at your option) any later version.
|
16 |
|
|
//
|
17 |
|
|
// eCos is distributed in the hope that it will be useful, but WITHOUT ANY
|
18 |
|
|
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
19 |
|
|
// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
20 |
|
|
// for more details.
|
21 |
|
|
//
|
22 |
|
|
// You should have received a copy of the GNU General Public License along
|
23 |
|
|
// with eCos; if not, write to the Free Software Foundation, Inc.,
|
24 |
|
|
// 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
|
25 |
|
|
//
|
26 |
|
|
// As a special exception, if other files instantiate templates or use macros
|
27 |
|
|
// or inline functions from this file, or you compile this file and link it
|
28 |
|
|
// with other works to produce a work based on this file, this file does not
|
29 |
|
|
// by itself cause the resulting work to be covered by the GNU General Public
|
30 |
|
|
// License. However the source code for this file must still be made available
|
31 |
|
|
// in accordance with section (3) of the GNU General Public License.
|
32 |
|
|
//
|
33 |
|
|
// This exception does not invalidate any other reasons why a work based on
|
34 |
|
|
// this file might be covered by the GNU General Public License.
|
35 |
|
|
//
|
36 |
|
|
// Alternative licenses for eCos may be arranged by contacting Red Hat, Inc.
|
37 |
|
|
// at http://sources.redhat.com/ecos/ecos-license/
|
38 |
|
|
// -------------------------------------------
|
39 |
|
|
//####ECOSGPLCOPYRIGHTEND####
|
40 |
|
|
//==========================================================================
|
41 |
|
|
//#####DESCRIPTIONBEGIN####
|
42 |
|
|
//
|
43 |
|
|
// Author(s): gthomas
|
44 |
|
|
// Contributors: gthomas, jskov, jlarmour
|
45 |
|
|
// Date: 2000-02-21
|
46 |
|
|
// Purpose: V850 architecture dependent definition generator
|
47 |
|
|
// Description: This file contains code that can be compiled by the target
|
48 |
|
|
// compiler and used to generate machine specific definitions
|
49 |
|
|
// suitable for use in assembly code.
|
50 |
|
|
//
|
51 |
|
|
//####DESCRIPTIONEND####
|
52 |
|
|
//
|
53 |
|
|
//==========================================================================
|
54 |
|
|
|
55 |
|
|
#include <pkgconf/hal.h>
|
56 |
|
|
|
57 |
|
|
#include <cyg/hal/hal_arch.h> // HAL header
|
58 |
|
|
#include <cyg/hal/hal_intr.h> // HAL header
|
59 |
|
|
#ifdef CYGPKG_KERNEL
|
60 |
|
|
# include <pkgconf/kernel.h>
|
61 |
|
|
# include <cyg/kernel/instrmnt.h>
|
62 |
|
|
#endif
|
63 |
|
|
#include <cyg/hal/hal_if.h>
|
64 |
|
|
|
65 |
|
|
/*
|
66 |
|
|
* This program is used to generate definitions needed by
|
67 |
|
|
* assembly language modules.
|
68 |
|
|
*
|
69 |
|
|
* This technique was first used in the OSF Mach kernel code:
|
70 |
|
|
* generate asm statements containing #defines,
|
71 |
|
|
* compile this file to assembler, and then extract the
|
72 |
|
|
* #defines from the assembly-language output.
|
73 |
|
|
*/
|
74 |
|
|
|
75 |
|
|
#define DEFINE(sym, val) \
|
76 |
|
|
asm volatile("\n\t.equ\t" #sym ",%0" : : "i" (val))
|
77 |
|
|
|
78 |
|
|
int
|
79 |
|
|
main(void)
|
80 |
|
|
{
|
81 |
|
|
// setjmp/longjmp buffer
|
82 |
|
|
DEFINE(CYGARC_JMPBUF_SP, offsetof(hal_jmp_buf_t, sp));
|
83 |
|
|
DEFINE(CYGARC_JMPBUF_GP, offsetof(hal_jmp_buf_t, gp));
|
84 |
|
|
DEFINE(CYGARC_JMPBUF_TP, offsetof(hal_jmp_buf_t, tp));
|
85 |
|
|
DEFINE(CYGARC_JMPBUF_R1, offsetof(hal_jmp_buf_t, r1));
|
86 |
|
|
DEFINE(CYGARC_JMPBUF_R2, offsetof(hal_jmp_buf_t, r2));
|
87 |
|
|
DEFINE(CYGARC_JMPBUF_R4, offsetof(hal_jmp_buf_t, r4));
|
88 |
|
|
DEFINE(CYGARC_JMPBUF_R5, offsetof(hal_jmp_buf_t, r5));
|
89 |
|
|
DEFINE(CYGARC_JMPBUF_R20, offsetof(hal_jmp_buf_t, r20));
|
90 |
|
|
DEFINE(CYGARC_JMPBUF_R21, offsetof(hal_jmp_buf_t, r21));
|
91 |
|
|
DEFINE(CYGARC_JMPBUF_R22, offsetof(hal_jmp_buf_t, r22));
|
92 |
|
|
DEFINE(CYGARC_JMPBUF_R23, offsetof(hal_jmp_buf_t, r23));
|
93 |
|
|
DEFINE(CYGARC_JMPBUF_R24, offsetof(hal_jmp_buf_t, r24));
|
94 |
|
|
DEFINE(CYGARC_JMPBUF_R25, offsetof(hal_jmp_buf_t, r25));
|
95 |
|
|
DEFINE(CYGARC_JMPBUF_R26, offsetof(hal_jmp_buf_t, r26));
|
96 |
|
|
DEFINE(CYGARC_JMPBUF_R27, offsetof(hal_jmp_buf_t, r27));
|
97 |
|
|
DEFINE(CYGARC_JMPBUF_R28, offsetof(hal_jmp_buf_t, r28));
|
98 |
|
|
DEFINE(CYGARC_JMPBUF_FP, offsetof(hal_jmp_buf_t, fp));
|
99 |
|
|
DEFINE(CYGARC_JMPBUF_EP, offsetof(hal_jmp_buf_t, ep));
|
100 |
|
|
DEFINE(CYGARC_JMPBUF_LP, offsetof(hal_jmp_buf_t, lp));
|
101 |
|
|
|
102 |
|
|
DEFINE(CYGARC_JMPBUF_SIZE, sizeof(hal_jmp_buf_t));
|
103 |
|
|
|
104 |
|
|
// Exception/interrupt/context save buffer
|
105 |
|
|
DEFINE(CYGARC_REG_R1, offsetof(HAL_SavedRegisters, d[1]));
|
106 |
|
|
DEFINE(CYGARC_REG_R2, offsetof(HAL_SavedRegisters, d[2]));
|
107 |
|
|
DEFINE(CYGARC_REG_R3, offsetof(HAL_SavedRegisters, d[3]));
|
108 |
|
|
DEFINE(CYGARC_REG_SP, offsetof(HAL_SavedRegisters, d[3]));
|
109 |
|
|
DEFINE(CYGARC_REG_R4, offsetof(HAL_SavedRegisters, d[4]));
|
110 |
|
|
DEFINE(CYGARC_REG_R5, offsetof(HAL_SavedRegisters, d[5]));
|
111 |
|
|
DEFINE(CYGARC_REG_R6, offsetof(HAL_SavedRegisters, d[6]));
|
112 |
|
|
DEFINE(CYGARC_REG_R7, offsetof(HAL_SavedRegisters, d[7]));
|
113 |
|
|
DEFINE(CYGARC_REG_R8, offsetof(HAL_SavedRegisters, d[8]));
|
114 |
|
|
DEFINE(CYGARC_REG_R9, offsetof(HAL_SavedRegisters, d[9]));
|
115 |
|
|
DEFINE(CYGARC_REG_R10, offsetof(HAL_SavedRegisters, d[10]));
|
116 |
|
|
DEFINE(CYGARC_REG_R11, offsetof(HAL_SavedRegisters, d[11]));
|
117 |
|
|
DEFINE(CYGARC_REG_R12, offsetof(HAL_SavedRegisters, d[12]));
|
118 |
|
|
DEFINE(CYGARC_REG_R13, offsetof(HAL_SavedRegisters, d[13]));
|
119 |
|
|
DEFINE(CYGARC_REG_R14, offsetof(HAL_SavedRegisters, d[14]));
|
120 |
|
|
DEFINE(CYGARC_REG_R15, offsetof(HAL_SavedRegisters, d[15]));
|
121 |
|
|
DEFINE(CYGARC_REG_R16, offsetof(HAL_SavedRegisters, d[16]));
|
122 |
|
|
DEFINE(CYGARC_REG_R17, offsetof(HAL_SavedRegisters, d[17]));
|
123 |
|
|
DEFINE(CYGARC_REG_R18, offsetof(HAL_SavedRegisters, d[18]));
|
124 |
|
|
DEFINE(CYGARC_REG_R19, offsetof(HAL_SavedRegisters, d[19]));
|
125 |
|
|
DEFINE(CYGARC_REG_R20, offsetof(HAL_SavedRegisters, d[20]));
|
126 |
|
|
DEFINE(CYGARC_REG_R21, offsetof(HAL_SavedRegisters, d[21]));
|
127 |
|
|
DEFINE(CYGARC_REG_R22, offsetof(HAL_SavedRegisters, d[22]));
|
128 |
|
|
DEFINE(CYGARC_REG_R23, offsetof(HAL_SavedRegisters, d[23]));
|
129 |
|
|
DEFINE(CYGARC_REG_R24, offsetof(HAL_SavedRegisters, d[24]));
|
130 |
|
|
DEFINE(CYGARC_REG_R25, offsetof(HAL_SavedRegisters, d[25]));
|
131 |
|
|
DEFINE(CYGARC_REG_R26, offsetof(HAL_SavedRegisters, d[26]));
|
132 |
|
|
DEFINE(CYGARC_REG_R27, offsetof(HAL_SavedRegisters, d[27]));
|
133 |
|
|
DEFINE(CYGARC_REG_R28, offsetof(HAL_SavedRegisters, d[28]));
|
134 |
|
|
DEFINE(CYGARC_REG_R29, offsetof(HAL_SavedRegisters, d[29]));
|
135 |
|
|
DEFINE(CYGARC_REG_R30, offsetof(HAL_SavedRegisters, d[30]));
|
136 |
|
|
DEFINE(CYGARC_REG_R31, offsetof(HAL_SavedRegisters, d[31]));
|
137 |
|
|
DEFINE(CYGARC_REG_EP, offsetof(HAL_SavedRegisters, d[30]));
|
138 |
|
|
DEFINE(CYGARC_REG_LP, offsetof(HAL_SavedRegisters, d[31]));
|
139 |
|
|
DEFINE(CYGARC_REG_PSW, offsetof(HAL_SavedRegisters, psw));
|
140 |
|
|
DEFINE(CYGARC_REG_PC, offsetof(HAL_SavedRegisters, pc));
|
141 |
|
|
|
142 |
|
|
// Below only saved on exceptions/interrupts
|
143 |
|
|
DEFINE(CYGARC_REG_CAUSE, offsetof(HAL_SavedRegisters, cause));
|
144 |
|
|
DEFINE(CYGARC_REG_VECTOR, offsetof(HAL_SavedRegisters, vector));
|
145 |
|
|
|
146 |
|
|
DEFINE(CYGARC_EXCEPTION_FRAME_SIZE, sizeof(HAL_SavedRegisters));
|
147 |
|
|
|
148 |
|
|
// Some other exception related definitions
|
149 |
|
|
DEFINE(CYGNUM_HAL_ISR_MIN, CYGNUM_HAL_ISR_MIN);
|
150 |
|
|
DEFINE(CYGNUM_HAL_ISR_COUNT, CYGNUM_HAL_ISR_COUNT);
|
151 |
|
|
DEFINE(CYGNUM_HAL_VSR_MAX, CYGNUM_HAL_VSR_MAX);
|
152 |
|
|
DEFINE(CYGNUM_HAL_VSR_COUNT, CYGNUM_HAL_VSR_COUNT);
|
153 |
|
|
DEFINE(CYGNUM_HAL_EXCEPTION_COUNT, CYGNUM_HAL_EXCEPTION_COUNT);
|
154 |
|
|
DEFINE(CYGNUM_HAL_VECTOR_INTWDT, CYGNUM_HAL_VECTOR_INTWDT);
|
155 |
|
|
DEFINE(CYGNUM_HAL_VECTOR_TRAP00, CYGNUM_HAL_VECTOR_TRAP00);
|
156 |
|
|
DEFINE(CYGNUM_HAL_VECTOR_TRAP10, CYGNUM_HAL_VECTOR_TRAP10);
|
157 |
|
|
DEFINE(CYGNUM_HAL_VECTOR_ILGOP, CYGNUM_HAL_VECTOR_ILGOP);
|
158 |
|
|
|
159 |
|
|
DEFINE(CYGARC_PSW_ID, CYGARC_PSW_ID);
|
160 |
|
|
DEFINE(CYGARC_PSW_EP, CYGARC_PSW_EP);
|
161 |
|
|
DEFINE(CYGARC_PSW_NP, CYGARC_PSW_NP);
|
162 |
|
|
|
163 |
|
|
#ifdef CYGPKG_KERNEL
|
164 |
|
|
DEFINE(RAISE_INTR, CYG_INSTRUMENT_CLASS_INTR|CYG_INSTRUMENT_EVENT_INTR_RAISE);
|
165 |
|
|
#endif
|
166 |
|
|
|
167 |
|
|
#if defined(CYGSEM_HAL_VIRTUAL_VECTOR_SUPPORT)
|
168 |
|
|
DEFINE(CYGNUM_CALL_IF_TABLE_SIZE, CYGNUM_CALL_IF_TABLE_SIZE);
|
169 |
|
|
#endif
|
170 |
|
|
|
171 |
|
|
// Variant definitions - want these to be included instead.
|
172 |
|
|
|
173 |
|
|
return 0;
|
174 |
|
|
}
|
175 |
|
|
|
176 |
|
|
//--------------------------------------------------------------------------
|
177 |
|
|
// EOF hal_mk_defs.c
|