comparison packages/hal/arm/arch/current/src/hal_mk_defs.c @ 2:443894e2e912 ecos-v1_2_1-release

Block commit of eCos version 1.2.1
author jlarmour
date Tue, 11 May 1999 12:24:34 +0000
parents
children 1d7f19c9e4d1
comparison
equal deleted inserted replaced
1:72f549f0d891 2:443894e2e912
1 /*==========================================================================
2 //
3 // hal_mk_defs.c
4 //
5 // HAL (architecture) "make defs" program
6 //
7 //==========================================================================
8 //####COPYRIGHTBEGIN####
9 //
10 // -------------------------------------------
11 // The contents of this file are subject to the Cygnus eCos Public License
12 // Version 1.0 (the "License"); you may not use this file except in
13 // compliance with the License. You may obtain a copy of the License at
14 // http://sourceware.cygnus.com/ecos
15 //
16 // Software distributed under the License is distributed on an "AS IS"
17 // basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
18 // License for the specific language governing rights and limitations under
19 // the License.
20 //
21 // The Original Code is eCos - Embedded Cygnus Operating System, released
22 // September 30, 1998.
23 //
24 // The Initial Developer of the Original Code is Cygnus. Portions created
25 // by Cygnus are Copyright (C) 1998,1999 Cygnus Solutions. All Rights Reserved.
26 // -------------------------------------------
27 //
28 //####COPYRIGHTEND####
29 //==========================================================================
30 //#####DESCRIPTIONBEGIN####
31 //
32 // Author(s): gthomas
33 // Contributors: gthomas
34 // Date: 1999-02-20
35 // Purpose: ARM architecture dependent definition generator
36 // Description: This file contains code that can be compiled by the target
37 // compiler and used to generate machine specific definitions
38 // suitable for use in assembly code.
39 //
40 //####DESCRIPTIONEND####
41 //
42 //========================================================================*/
43
44 #include <pkgconf/hal.h>
45
46 #include <cyg/hal/hal_arch.h> // HAL header
47 #include <cyg/hal/hal_intr.h> // HAL header
48 #ifdef CYGPKG_KERNEL
49 # include <pkgconf/kernel.h>
50 # include <cyg/kernel/instrmnt.h>
51 #endif
52
53 /*
54 * This program is used to generate definitions needed by
55 * assembly language modules.
56 *
57 * This technique was first used in the OSF Mach kernel code:
58 * generate asm statements containing #defines,
59 * compile this file to assembler, and then extract the
60 * #defines from the assembly-language output.
61 */
62
63 #define DEFINE(sym, val) \
64 asm volatile("\n\t.equ\t" #sym ",%0" : : "i" (val))
65
66 int
67 main(void)
68 {
69 DEFINE(armreg_r0, offsetof(HAL_SavedRegisters, d[HAL_THREAD_CONTEXT_R0]));
70 DEFINE(armreg_r4, offsetof(HAL_SavedRegisters, d[HAL_THREAD_CONTEXT_R4]));
71 DEFINE(armreg_sp, offsetof(HAL_SavedRegisters, sp));
72 DEFINE(armreg_fp, offsetof(HAL_SavedRegisters, fp));
73 DEFINE(armreg_ip, offsetof(HAL_SavedRegisters, ip));
74 DEFINE(armreg_lr, offsetof(HAL_SavedRegisters, lr));
75 DEFINE(armreg_pc, offsetof(HAL_SavedRegisters, pc));
76 DEFINE(armreg_cpsr, offsetof(HAL_SavedRegisters, cpsr));
77 DEFINE(armreg_vector, offsetof(HAL_SavedRegisters, vector));
78 DEFINE(ARMREG_SIZE, sizeof(HAL_SavedRegisters));
79 DEFINE(CYGNUM_HAL_ISR_COUNT, CYGNUM_HAL_ISR_COUNT);
80 DEFINE(CYGNUM_HAL_VSR_COUNT, CYGNUM_HAL_VSR_COUNT);
81 DEFINE(CYGNUM_HAL_EXCEPTION_ILLEGAL_INSTRUCTION,
82 CYGNUM_HAL_EXCEPTION_ILLEGAL_INSTRUCTION);
83 DEFINE(CYGNUM_HAL_EXCEPTION_INTERRUPT, CYGNUM_HAL_EXCEPTION_INTERRUPT);
84 DEFINE(CYGNUM_HAL_EXCEPTION_CODE_ACCESS,
85 CYGNUM_HAL_EXCEPTION_CODE_ACCESS);
86 DEFINE(CYGNUM_HAL_EXCEPTION_DATA_ACCESS,
87 CYGNUM_HAL_EXCEPTION_DATA_ACCESS);
88 DEFINE(CYGNUM_HAL_VECTOR_IRQ, CYGNUM_HAL_VECTOR_IRQ);
89 DEFINE(CYGNUM_HAL_EXCEPTION_FIQ, CYGNUM_HAL_EXCEPTION_FIQ);
90 #ifdef CYGPKG_KERNEL
91 DEFINE(RAISE_INTR, CYG_INSTRUMENT_CLASS_INTR|CYG_INSTRUMENT_EVENT_INTR_RAISE);
92 #endif
93 DEFINE(CPSR_IRQ_DISABLE, CPSR_IRQ_DISABLE);
94 DEFINE(CPSR_FIQ_DISABLE, CPSR_FIQ_DISABLE);
95 DEFINE(CPSR_UNDEF_MODE, CPSR_UNDEF_MODE);
96 DEFINE(CPSR_SUPERVISOR_MODE, CPSR_SUPERVISOR_MODE);
97 DEFINE(CPSR_IRQ_MODE, CPSR_IRQ_MODE);
98 DEFINE(CPSR_MODE_BITS, CPSR_MODE_BITS);
99 DEFINE(CPSR_INITIAL, CPSR_INITIAL);
100 DEFINE(CPSR_THREAD_INITIAL, CPSR_THREAD_INITIAL);
101 }
102
103
104 /*------------------------------------------------------------------------*/
105 // EOF hal_mk_defs.c