1 | /* |
---|
2 | * This file contains the single entry point code for |
---|
3 | * the SH implementation of RTEMS. |
---|
4 | * |
---|
5 | * NOTE: This is supposed to be a .S or .s file NOT a C file. |
---|
6 | * |
---|
7 | * NOTE: UNTESTED, very likely this does not not work. |
---|
8 | * |
---|
9 | * Author: Ralf Corsepius (corsepiu@faw.uni-ulm.de) |
---|
10 | * |
---|
11 | * COPYRIGHT (c) 1997-1998, FAW Ulm, Germany |
---|
12 | * |
---|
13 | * This program is distributed in the hope that it will be useful, |
---|
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
---|
16 | * |
---|
17 | * |
---|
18 | * COPYRIGHT (c) 1998. |
---|
19 | * On-Line Applications Research Corporation (OAR). |
---|
20 | * Copyright assigned to U.S. Government, 1994. |
---|
21 | * |
---|
22 | * The license and distribution terms for this file may be |
---|
23 | * found in the file LICENSE in this distribution or at |
---|
24 | * http://www.OARcorp.com/rtems/license.html. |
---|
25 | * |
---|
26 | * $Id$ |
---|
27 | */ |
---|
28 | |
---|
29 | /* |
---|
30 | * This is supposed to be an assembly file. This means that system.h |
---|
31 | * and cpu.h should not be included in a "real" rtems file. |
---|
32 | */ |
---|
33 | |
---|
34 | /* #include <rtems/system.h> */ |
---|
35 | /* #include <rtems/score/cpu.h> */ |
---|
36 | /* #include "asm.h" */ |
---|
37 | |
---|
38 | /* |
---|
39 | * This should work but due to a bug in rtems building scheme it doesn't work |
---|
40 | */ |
---|
41 | |
---|
42 | /* #include <rtems/directives.h> */ |
---|
43 | |
---|
44 | extern void* _Entry_points[] ; |
---|
45 | |
---|
46 | /* |
---|
47 | * RTEMS |
---|
48 | * |
---|
49 | * This routine jumps to the directive indicated in the |
---|
50 | * CPU defined register. This routine is used when RTEMS is |
---|
51 | * linked by itself and placed in ROM. This routine is the |
---|
52 | * first address in the ROM space for RTEMS. The user "calls" |
---|
53 | * this address with the directive arguments in the normal place. |
---|
54 | * This routine then jumps indirectly to the correct directive |
---|
55 | * preserving the arguments. The directive should not realize |
---|
56 | * it has been "wrapped" in this way. The table "_Entry_points" |
---|
57 | * is used to look up the directive. |
---|
58 | */ |
---|
59 | |
---|
60 | void __RTEMS() |
---|
61 | { |
---|
62 | asm volatile ( |
---|
63 | ".global _RTEMS |
---|
64 | _RTEMS:" ); |
---|
65 | |
---|
66 | asm volatile ( |
---|
67 | "jmp %0 |
---|
68 | rts |
---|
69 | nop" |
---|
70 | :: "m" (_Entry_points) ); |
---|
71 | } |
---|