OpenCores
URL https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [trunk/] [rtos/] [ecos-2.0/] [packages/] [hal/] [frv/] [arch/] [v2_0/] [src/] [hal_mk_defs.c] - Blame information for rev 174

Details | Compare with Previous | View Log

Line No. Rev Author Line
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
45
// Date:         2001-09-07
46
// Purpose:      FUJISTU 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.equ\t" #sym " %0" : : "i" (val))
77
 
78
int
79
main(void)
80
{
81
#ifdef CYGPKG_KERNEL
82
    DEFINE(RAISE_INTR, CYG_INSTRUMENT_CLASS_INTR|CYG_INSTRUMENT_EVENT_INTR_RAISE);
83
#endif
84
#if defined(CYGSEM_HAL_VIRTUAL_VECTOR_SUPPORT)
85
    DEFINE(CYGNUM_CALL_IF_TABLE_SIZE, CYGNUM_CALL_IF_TABLE_SIZE);
86
#endif
87
    DEFINE(CYGNUM_HAL_INTERRUPT_NONE, CYGNUM_HAL_INTERRUPT_NONE);
88
    DEFINE(CYGNUM_HAL_COMMON_INTERRUPTS_STACK_SIZE, CYGNUM_HAL_COMMON_INTERRUPTS_STACK_SIZE);
89
    DEFINE(CYGNUM_HAL_ISR_COUNT, CYGNUM_HAL_ISR_COUNT);
90
    DEFINE(CYGNUM_HAL_VECTOR_SYSCALL, CYGNUM_HAL_VECTOR_SYSCALL);
91
    DEFINE(CYGNUM_HAL_VECTOR_BREAKPOINT, CYGNUM_HAL_VECTOR_BREAKPOINT);
92
    DEFINE(CYGNUM_HAL_VECTOR_EXTERNAL_INTERRUPT_LEVEL_1, CYGNUM_HAL_VECTOR_EXTERNAL_INTERRUPT_LEVEL_1);
93
    DEFINE(CYGNUM_HAL_VECTOR_EXTERNAL_INTERRUPT_LEVEL_15, CYGNUM_HAL_VECTOR_EXTERNAL_INTERRUPT_LEVEL_15);
94
 
95
    // Register state
96
    DEFINE(_TS_GPR0, offsetof(HAL_SavedRegisters, gpr[0]));
97
    DEFINE(_TS_GPR1, offsetof(HAL_SavedRegisters, gpr[1]));
98
    DEFINE(_TS_SP, offsetof(HAL_SavedRegisters, gpr[1]));
99
    DEFINE(_TS_GPR2, offsetof(HAL_SavedRegisters, gpr[2]));
100
    DEFINE(_TS_GPR3, offsetof(HAL_SavedRegisters, gpr[3]));
101
    DEFINE(_TS_GPR4, offsetof(HAL_SavedRegisters, gpr[4]));
102
    DEFINE(_TS_GPR5, offsetof(HAL_SavedRegisters, gpr[5]));
103
    DEFINE(_TS_GPR6, offsetof(HAL_SavedRegisters, gpr[6]));
104
    DEFINE(_TS_GPR7, offsetof(HAL_SavedRegisters, gpr[7]));
105
    DEFINE(_TS_GPR8, offsetof(HAL_SavedRegisters, gpr[8]));
106
    DEFINE(_TS_GPR9, offsetof(HAL_SavedRegisters, gpr[9]));
107
    DEFINE(_TS_GPR10, offsetof(HAL_SavedRegisters, gpr[10]));
108
    DEFINE(_TS_GPR11, offsetof(HAL_SavedRegisters, gpr[11]));
109
    DEFINE(_TS_GPR12, offsetof(HAL_SavedRegisters, gpr[12]));
110
    DEFINE(_TS_GPR13, offsetof(HAL_SavedRegisters, gpr[13]));
111
    DEFINE(_TS_GPR14, offsetof(HAL_SavedRegisters, gpr[14]));
112
    DEFINE(_TS_GPR15, offsetof(HAL_SavedRegisters, gpr[15]));
113
    DEFINE(_TS_GPR16, offsetof(HAL_SavedRegisters, gpr[16]));
114
    DEFINE(_TS_GPR17, offsetof(HAL_SavedRegisters, gpr[17]));
115
    DEFINE(_TS_GPR18, offsetof(HAL_SavedRegisters, gpr[18]));
116
    DEFINE(_TS_GPR19, offsetof(HAL_SavedRegisters, gpr[19]));
117
    DEFINE(_TS_GPR20, offsetof(HAL_SavedRegisters, gpr[20]));
118
    DEFINE(_TS_GPR21, offsetof(HAL_SavedRegisters, gpr[21]));
119
    DEFINE(_TS_GPR22, offsetof(HAL_SavedRegisters, gpr[22]));
120
    DEFINE(_TS_GPR23, offsetof(HAL_SavedRegisters, gpr[23]));
121
    DEFINE(_TS_GPR24, offsetof(HAL_SavedRegisters, gpr[24]));
122
    DEFINE(_TS_GPR25, offsetof(HAL_SavedRegisters, gpr[25]));
123
    DEFINE(_TS_GPR26, offsetof(HAL_SavedRegisters, gpr[26]));
124
    DEFINE(_TS_GPR27, offsetof(HAL_SavedRegisters, gpr[27]));
125
    DEFINE(_TS_GPR28, offsetof(HAL_SavedRegisters, gpr[28]));
126
    DEFINE(_TS_GPR29, offsetof(HAL_SavedRegisters, gpr[29]));
127
    DEFINE(_TS_GPR30, offsetof(HAL_SavedRegisters, gpr[30]));
128
    DEFINE(_TS_GPR31, offsetof(HAL_SavedRegisters, gpr[31]));
129
#if _NGPR != 32
130
    DEFINE(_TS_GPR32, offsetof(HAL_SavedRegisters, gpr[32]));
131
    DEFINE(_TS_GPR33, offsetof(HAL_SavedRegisters, gpr[33]));
132
    DEFINE(_TS_GPR34, offsetof(HAL_SavedRegisters, gpr[34]));
133
    DEFINE(_TS_GPR35, offsetof(HAL_SavedRegisters, gpr[35]));
134
    DEFINE(_TS_GPR36, offsetof(HAL_SavedRegisters, gpr[36]));
135
    DEFINE(_TS_GPR37, offsetof(HAL_SavedRegisters, gpr[37]));
136
    DEFINE(_TS_GPR38, offsetof(HAL_SavedRegisters, gpr[38]));
137
    DEFINE(_TS_GPR39, offsetof(HAL_SavedRegisters, gpr[39]));
138
    DEFINE(_TS_GPR40, offsetof(HAL_SavedRegisters, gpr[40]));
139
    DEFINE(_TS_GPR41, offsetof(HAL_SavedRegisters, gpr[41]));
140
    DEFINE(_TS_GPR42, offsetof(HAL_SavedRegisters, gpr[42]));
141
    DEFINE(_TS_GPR43, offsetof(HAL_SavedRegisters, gpr[43]));
142
    DEFINE(_TS_GPR44, offsetof(HAL_SavedRegisters, gpr[44]));
143
    DEFINE(_TS_GPR45, offsetof(HAL_SavedRegisters, gpr[45]));
144
    DEFINE(_TS_GPR46, offsetof(HAL_SavedRegisters, gpr[46]));
145
    DEFINE(_TS_GPR47, offsetof(HAL_SavedRegisters, gpr[47]));
146
    DEFINE(_TS_GPR48, offsetof(HAL_SavedRegisters, gpr[48]));
147
    DEFINE(_TS_GPR49, offsetof(HAL_SavedRegisters, gpr[49]));
148
    DEFINE(_TS_GPR50, offsetof(HAL_SavedRegisters, gpr[50]));
149
    DEFINE(_TS_GPR51, offsetof(HAL_SavedRegisters, gpr[51]));
150
    DEFINE(_TS_GPR52, offsetof(HAL_SavedRegisters, gpr[52]));
151
    DEFINE(_TS_GPR53, offsetof(HAL_SavedRegisters, gpr[53]));
152
    DEFINE(_TS_GPR54, offsetof(HAL_SavedRegisters, gpr[54]));
153
    DEFINE(_TS_GPR55, offsetof(HAL_SavedRegisters, gpr[55]));
154
    DEFINE(_TS_GPR56, offsetof(HAL_SavedRegisters, gpr[56]));
155
    DEFINE(_TS_GPR57, offsetof(HAL_SavedRegisters, gpr[57]));
156
    DEFINE(_TS_GPR58, offsetof(HAL_SavedRegisters, gpr[58]));
157
    DEFINE(_TS_GPR59, offsetof(HAL_SavedRegisters, gpr[59]));
158
    DEFINE(_TS_GPR60, offsetof(HAL_SavedRegisters, gpr[60]));
159
    DEFINE(_TS_GPR61, offsetof(HAL_SavedRegisters, gpr[61]));
160
    DEFINE(_TS_GPR62, offsetof(HAL_SavedRegisters, gpr[62]));
161
    DEFINE(_TS_GPR63, offsetof(HAL_SavedRegisters, gpr[63]));
162
#endif
163
    DEFINE(_TS_PC,   offsetof(HAL_SavedRegisters, pc));
164
    DEFINE(_TS_PSR,  offsetof(HAL_SavedRegisters, psr));
165
    DEFINE(_TS_LR,   offsetof(HAL_SavedRegisters, lr));
166
    DEFINE(_TS_CCR,  offsetof(HAL_SavedRegisters, ccr));
167
    DEFINE(_TS_LCR,  offsetof(HAL_SavedRegisters, lcr));
168
    DEFINE(_TS_CCCR, offsetof(HAL_SavedRegisters, cccr));
169
    DEFINE(_TS_LR,   offsetof(HAL_SavedRegisters, lr));
170
    DEFINE(_TS_VECTOR, offsetof(HAL_SavedRegisters, vector));
171
#define _roundup(n,s) ((((n)+(s-1))/s)*s)
172
    DEFINE(_TS_size, _roundup(sizeof(HAL_SavedRegisters),8));
173
 
174
    DEFINE(_NGPR, _NGPR);
175
    DEFINE(_NFPR, _NFPR);
176
 
177
    DEFINE(_PSR_ET, _PSR_ET);
178
    DEFINE(_PSR_S, _PSR_S);
179
    DEFINE(_PSR_PS, _PSR_PS);
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

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.