1 |
786 |
skrzyp |
/*==========================================================================
|
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, 2004 Free Software Foundation, 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
|
16 |
|
|
// version.
|
17 |
|
|
//
|
18 |
|
|
// eCos is distributed in the hope that it will be useful, but WITHOUT
|
19 |
|
|
// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
20 |
|
|
// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
21 |
|
|
// for more details.
|
22 |
|
|
//
|
23 |
|
|
// You should have received a copy of the GNU General Public License
|
24 |
|
|
// along with eCos; if not, write to the Free Software Foundation, Inc.,
|
25 |
|
|
// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
26 |
|
|
//
|
27 |
|
|
// As a special exception, if other files instantiate templates or use
|
28 |
|
|
// macros or inline functions from this file, or you compile this file
|
29 |
|
|
// and link it with other works to produce a work based on this file,
|
30 |
|
|
// this file does not by itself cause the resulting work to be covered by
|
31 |
|
|
// the GNU General Public License. However the source code for this file
|
32 |
|
|
// must still be made available in accordance with section (3) of the GNU
|
33 |
|
|
// General Public License v2.
|
34 |
|
|
//
|
35 |
|
|
// This exception does not invalidate any other reasons why a work based
|
36 |
|
|
// on this file might be covered by the GNU General Public License.
|
37 |
|
|
// -------------------------------------------
|
38 |
|
|
// ####ECOSGPLCOPYRIGHTEND####
|
39 |
|
|
//==========================================================================
|
40 |
|
|
//#####DESCRIPTIONBEGIN####
|
41 |
|
|
//
|
42 |
|
|
// Author(s): gthomas
|
43 |
|
|
// Contributors: gthomas
|
44 |
|
|
// Date: 2001-09-07
|
45 |
|
|
// Purpose: FUJISTU architecture dependent definition generator
|
46 |
|
|
// Description: This file contains code that can be compiled by the target
|
47 |
|
|
// compiler and used to generate machine specific definitions
|
48 |
|
|
// suitable for use in assembly code.
|
49 |
|
|
//
|
50 |
|
|
//####DESCRIPTIONEND####
|
51 |
|
|
//
|
52 |
|
|
//========================================================================*/
|
53 |
|
|
|
54 |
|
|
#include <pkgconf/hal.h>
|
55 |
|
|
|
56 |
|
|
#include <cyg/hal/hal_arch.h> // HAL header
|
57 |
|
|
#include <cyg/hal/hal_intr.h> // HAL header
|
58 |
|
|
#ifdef CYGPKG_KERNEL
|
59 |
|
|
# include <pkgconf/kernel.h>
|
60 |
|
|
# include <cyg/kernel/instrmnt.h>
|
61 |
|
|
#endif
|
62 |
|
|
#include <cyg/hal/hal_if.h>
|
63 |
|
|
|
64 |
|
|
/*
|
65 |
|
|
* This program is used to generate definitions needed by
|
66 |
|
|
* assembly language modules.
|
67 |
|
|
*
|
68 |
|
|
* This technique was first used in the OSF Mach kernel code:
|
69 |
|
|
* generate asm statements containing #defines,
|
70 |
|
|
* compile this file to assembler, and then extract the
|
71 |
|
|
* #defines from the assembly-language output.
|
72 |
|
|
*/
|
73 |
|
|
|
74 |
|
|
#define DEFINE(sym, val) \
|
75 |
|
|
asm volatile("\n.equ\t" #sym " %0" : : "i" (val))
|
76 |
|
|
|
77 |
|
|
int
|
78 |
|
|
main(void)
|
79 |
|
|
{
|
80 |
|
|
#ifdef CYGPKG_KERNEL
|
81 |
|
|
DEFINE(RAISE_INTR, CYG_INSTRUMENT_CLASS_INTR|CYG_INSTRUMENT_EVENT_INTR_RAISE);
|
82 |
|
|
#endif
|
83 |
|
|
#if defined(CYGSEM_HAL_VIRTUAL_VECTOR_SUPPORT)
|
84 |
|
|
DEFINE(CYGNUM_CALL_IF_TABLE_SIZE, CYGNUM_CALL_IF_TABLE_SIZE);
|
85 |
|
|
#endif
|
86 |
|
|
DEFINE(CYGNUM_HAL_INTERRUPT_NONE, CYGNUM_HAL_INTERRUPT_NONE);
|
87 |
|
|
DEFINE(CYGNUM_HAL_COMMON_INTERRUPTS_STACK_SIZE, CYGNUM_HAL_COMMON_INTERRUPTS_STACK_SIZE);
|
88 |
|
|
DEFINE(CYGNUM_HAL_ISR_COUNT, CYGNUM_HAL_ISR_COUNT);
|
89 |
|
|
DEFINE(CYGNUM_HAL_VECTOR_SYSCALL, CYGNUM_HAL_VECTOR_SYSCALL);
|
90 |
|
|
DEFINE(CYGNUM_HAL_VECTOR_BREAKPOINT, CYGNUM_HAL_VECTOR_BREAKPOINT);
|
91 |
|
|
DEFINE(CYGNUM_HAL_VECTOR_EXTERNAL_INTERRUPT_LEVEL_1, CYGNUM_HAL_VECTOR_EXTERNAL_INTERRUPT_LEVEL_1);
|
92 |
|
|
DEFINE(CYGNUM_HAL_VECTOR_EXTERNAL_INTERRUPT_LEVEL_15, CYGNUM_HAL_VECTOR_EXTERNAL_INTERRUPT_LEVEL_15);
|
93 |
|
|
|
94 |
|
|
// Register state
|
95 |
|
|
DEFINE(_TS_GPR0, offsetof(HAL_SavedRegisters, gpr[0]));
|
96 |
|
|
DEFINE(_TS_GPR1, offsetof(HAL_SavedRegisters, gpr[1]));
|
97 |
|
|
DEFINE(_TS_SP, offsetof(HAL_SavedRegisters, gpr[1]));
|
98 |
|
|
DEFINE(_TS_GPR2, offsetof(HAL_SavedRegisters, gpr[2]));
|
99 |
|
|
DEFINE(_TS_GPR3, offsetof(HAL_SavedRegisters, gpr[3]));
|
100 |
|
|
DEFINE(_TS_GPR4, offsetof(HAL_SavedRegisters, gpr[4]));
|
101 |
|
|
DEFINE(_TS_GPR5, offsetof(HAL_SavedRegisters, gpr[5]));
|
102 |
|
|
DEFINE(_TS_GPR6, offsetof(HAL_SavedRegisters, gpr[6]));
|
103 |
|
|
DEFINE(_TS_GPR7, offsetof(HAL_SavedRegisters, gpr[7]));
|
104 |
|
|
DEFINE(_TS_GPR8, offsetof(HAL_SavedRegisters, gpr[8]));
|
105 |
|
|
DEFINE(_TS_GPR9, offsetof(HAL_SavedRegisters, gpr[9]));
|
106 |
|
|
DEFINE(_TS_GPR10, offsetof(HAL_SavedRegisters, gpr[10]));
|
107 |
|
|
DEFINE(_TS_GPR11, offsetof(HAL_SavedRegisters, gpr[11]));
|
108 |
|
|
DEFINE(_TS_GPR12, offsetof(HAL_SavedRegisters, gpr[12]));
|
109 |
|
|
DEFINE(_TS_GPR13, offsetof(HAL_SavedRegisters, gpr[13]));
|
110 |
|
|
DEFINE(_TS_GPR14, offsetof(HAL_SavedRegisters, gpr[14]));
|
111 |
|
|
DEFINE(_TS_GPR15, offsetof(HAL_SavedRegisters, gpr[15]));
|
112 |
|
|
DEFINE(_TS_GPR16, offsetof(HAL_SavedRegisters, gpr[16]));
|
113 |
|
|
DEFINE(_TS_GPR17, offsetof(HAL_SavedRegisters, gpr[17]));
|
114 |
|
|
DEFINE(_TS_GPR18, offsetof(HAL_SavedRegisters, gpr[18]));
|
115 |
|
|
DEFINE(_TS_GPR19, offsetof(HAL_SavedRegisters, gpr[19]));
|
116 |
|
|
DEFINE(_TS_GPR20, offsetof(HAL_SavedRegisters, gpr[20]));
|
117 |
|
|
DEFINE(_TS_GPR21, offsetof(HAL_SavedRegisters, gpr[21]));
|
118 |
|
|
DEFINE(_TS_GPR22, offsetof(HAL_SavedRegisters, gpr[22]));
|
119 |
|
|
DEFINE(_TS_GPR23, offsetof(HAL_SavedRegisters, gpr[23]));
|
120 |
|
|
DEFINE(_TS_GPR24, offsetof(HAL_SavedRegisters, gpr[24]));
|
121 |
|
|
DEFINE(_TS_GPR25, offsetof(HAL_SavedRegisters, gpr[25]));
|
122 |
|
|
DEFINE(_TS_GPR26, offsetof(HAL_SavedRegisters, gpr[26]));
|
123 |
|
|
DEFINE(_TS_GPR27, offsetof(HAL_SavedRegisters, gpr[27]));
|
124 |
|
|
DEFINE(_TS_GPR28, offsetof(HAL_SavedRegisters, gpr[28]));
|
125 |
|
|
DEFINE(_TS_GPR29, offsetof(HAL_SavedRegisters, gpr[29]));
|
126 |
|
|
DEFINE(_TS_GPR30, offsetof(HAL_SavedRegisters, gpr[30]));
|
127 |
|
|
DEFINE(_TS_GPR31, offsetof(HAL_SavedRegisters, gpr[31]));
|
128 |
|
|
#if _NGPR != 32
|
129 |
|
|
DEFINE(_TS_GPR32, offsetof(HAL_SavedRegisters, gpr[32]));
|
130 |
|
|
DEFINE(_TS_GPR33, offsetof(HAL_SavedRegisters, gpr[33]));
|
131 |
|
|
DEFINE(_TS_GPR34, offsetof(HAL_SavedRegisters, gpr[34]));
|
132 |
|
|
DEFINE(_TS_GPR35, offsetof(HAL_SavedRegisters, gpr[35]));
|
133 |
|
|
DEFINE(_TS_GPR36, offsetof(HAL_SavedRegisters, gpr[36]));
|
134 |
|
|
DEFINE(_TS_GPR37, offsetof(HAL_SavedRegisters, gpr[37]));
|
135 |
|
|
DEFINE(_TS_GPR38, offsetof(HAL_SavedRegisters, gpr[38]));
|
136 |
|
|
DEFINE(_TS_GPR39, offsetof(HAL_SavedRegisters, gpr[39]));
|
137 |
|
|
DEFINE(_TS_GPR40, offsetof(HAL_SavedRegisters, gpr[40]));
|
138 |
|
|
DEFINE(_TS_GPR41, offsetof(HAL_SavedRegisters, gpr[41]));
|
139 |
|
|
DEFINE(_TS_GPR42, offsetof(HAL_SavedRegisters, gpr[42]));
|
140 |
|
|
DEFINE(_TS_GPR43, offsetof(HAL_SavedRegisters, gpr[43]));
|
141 |
|
|
DEFINE(_TS_GPR44, offsetof(HAL_SavedRegisters, gpr[44]));
|
142 |
|
|
DEFINE(_TS_GPR45, offsetof(HAL_SavedRegisters, gpr[45]));
|
143 |
|
|
DEFINE(_TS_GPR46, offsetof(HAL_SavedRegisters, gpr[46]));
|
144 |
|
|
DEFINE(_TS_GPR47, offsetof(HAL_SavedRegisters, gpr[47]));
|
145 |
|
|
DEFINE(_TS_GPR48, offsetof(HAL_SavedRegisters, gpr[48]));
|
146 |
|
|
DEFINE(_TS_GPR49, offsetof(HAL_SavedRegisters, gpr[49]));
|
147 |
|
|
DEFINE(_TS_GPR50, offsetof(HAL_SavedRegisters, gpr[50]));
|
148 |
|
|
DEFINE(_TS_GPR51, offsetof(HAL_SavedRegisters, gpr[51]));
|
149 |
|
|
DEFINE(_TS_GPR52, offsetof(HAL_SavedRegisters, gpr[52]));
|
150 |
|
|
DEFINE(_TS_GPR53, offsetof(HAL_SavedRegisters, gpr[53]));
|
151 |
|
|
DEFINE(_TS_GPR54, offsetof(HAL_SavedRegisters, gpr[54]));
|
152 |
|
|
DEFINE(_TS_GPR55, offsetof(HAL_SavedRegisters, gpr[55]));
|
153 |
|
|
DEFINE(_TS_GPR56, offsetof(HAL_SavedRegisters, gpr[56]));
|
154 |
|
|
DEFINE(_TS_GPR57, offsetof(HAL_SavedRegisters, gpr[57]));
|
155 |
|
|
DEFINE(_TS_GPR58, offsetof(HAL_SavedRegisters, gpr[58]));
|
156 |
|
|
DEFINE(_TS_GPR59, offsetof(HAL_SavedRegisters, gpr[59]));
|
157 |
|
|
DEFINE(_TS_GPR60, offsetof(HAL_SavedRegisters, gpr[60]));
|
158 |
|
|
DEFINE(_TS_GPR61, offsetof(HAL_SavedRegisters, gpr[61]));
|
159 |
|
|
DEFINE(_TS_GPR62, offsetof(HAL_SavedRegisters, gpr[62]));
|
160 |
|
|
DEFINE(_TS_GPR63, offsetof(HAL_SavedRegisters, gpr[63]));
|
161 |
|
|
#endif
|
162 |
|
|
DEFINE(_TS_PC, offsetof(HAL_SavedRegisters, pc));
|
163 |
|
|
DEFINE(_TS_PSR, offsetof(HAL_SavedRegisters, psr));
|
164 |
|
|
DEFINE(_TS_LR, offsetof(HAL_SavedRegisters, lr));
|
165 |
|
|
DEFINE(_TS_CCR, offsetof(HAL_SavedRegisters, ccr));
|
166 |
|
|
DEFINE(_TS_LCR, offsetof(HAL_SavedRegisters, lcr));
|
167 |
|
|
DEFINE(_TS_CCCR, offsetof(HAL_SavedRegisters, cccr));
|
168 |
|
|
DEFINE(_TS_LR, offsetof(HAL_SavedRegisters, lr));
|
169 |
|
|
DEFINE(_TS_VECTOR, offsetof(HAL_SavedRegisters, vector));
|
170 |
|
|
#define _roundup(n,s) ((((n)+(s-1))/s)*s)
|
171 |
|
|
DEFINE(_TS_size, _roundup(sizeof(HAL_SavedRegisters),8));
|
172 |
|
|
|
173 |
|
|
DEFINE(_NGPR, _NGPR);
|
174 |
|
|
DEFINE(_NFPR, _NFPR);
|
175 |
|
|
|
176 |
|
|
DEFINE(_PSR_ET, _PSR_ET);
|
177 |
|
|
DEFINE(_PSR_S, _PSR_S);
|
178 |
|
|
DEFINE(_PSR_PS, _PSR_PS);
|
179 |
|
|
DEFINE(_PSR_CM, _PSR_CM);
|
180 |
|
|
DEFINE(_PSR_PIVL_MASK, _PSR_PIVL_MASK);
|
181 |
|
|
DEFINE(_PSR_PIVL_SHIFT, _PSR_PIVL_SHIFT);
|
182 |
|
|
|
183 |
|
|
DEFINE(_HSR0_ICE, _HSR0_ICE);
|
184 |
|
|
DEFINE(_HSR0_DCE, _HSR0_DCE);
|
185 |
|
|
DEFINE(_HSR0_IMMU, _HSR0_IMMU);
|
186 |
|
|
DEFINE(_HSR0_DMMU, _HSR0_DMMU);
|
187 |
|
|
|
188 |
|
|
return 0;
|
189 |
|
|
}
|
190 |
|
|
|
191 |
|
|
|
192 |
|
|
/*------------------------------------------------------------------------*/
|
193 |
|
|
// EOF hal_mk_defs.c
|