source: rtems/c/src/lib/libbsp/powerpc/psim/vectors/vectors.s @ b6394ae

4.104.114.84.95
Last change on this file since b6394ae was b6394ae, checked in by Joel Sherrill <joel.sherrill@…>, on 04/15/98 at 15:13:01

Transitioned to shared bsp_libc_init() and cleaned up comments.

  • Property mode set to 100644
File size: 3.0 KB
Line 
1/*  vectors.s   1.1 - 95/12/04
2 *
3 *  This file contains the assembly code for the PowerPC
4 *  interrupt vectors for RTEMS.
5 *
6 *  COPYRIGHT (c) 1989-1998.
7 *  On-Line Applications Research Corporation (OAR).
8 *  Copyright assigned to U.S. Government, 1994.
9 *
10 *  The license and distribution terms for this file may be
11 *  found in found in the file LICENSE in this distribution or at
12 *  http://www.OARcorp.com/rtems/license.html.
13 *
14 *  $Id$
15 */
16
17/*
18 *  The issue with this file is getting it loaded at the right place.
19 *  The first vector MUST be at address 0x????0100.
20 *  How this is achieved is dependant on the tool chain.
21 *
22 *  However the basic mechanism for ELF assemblers is to create a
23 *  section called ".vectors", which will be loaded to an address
24 *  between 0x????0000 and 0x????0100 (inclusive) via a link script.
25 *
26 *  The basic mechanism for XCOFF assemblers is to place it in the
27 *  normal text section, and arrange for this file to be located
28 *  at an appropriate position on the linker command line.
29 *
30 *  The variable 'PPC_VECTOR_FILE_BASE' must be defined to be the
31 *  offset from 0x????0000 to the first location in the file.  This
32 *  will usually be 0x0000 or 0x0100.
33 */
34
35#include "asm.h"
36
37#ifndef PPC_VECTOR_FILE_BASE
38#error "PPC_VECTOR_FILE_BASE is not defined."
39#endif
40
41        /* Where this file will be loaded */
42        .set    file_base, PPC_VECTOR_FILE_BASE
43
44        /* Offset to store reg 0 */
45
46        .set    IP_LINK, 0
47#if (PPC_ABI == PPC_ABI_POWEROPEN || PPC_ABI == PPC_ABI_GCC27)
48        .set    IP_0, (IP_LINK + 56)
49#else
50        .set    IP_0, (IP_LINK + 8)
51#endif
52        .set    IP_2, (IP_0 + 4)
53
54        .set    IP_3, (IP_2 + 4)
55        .set    IP_4, (IP_3 + 4)
56        .set    IP_5, (IP_4 + 4)
57        .set    IP_6, (IP_5 + 4)
58       
59        .set    IP_7, (IP_6 + 4)
60        .set    IP_8, (IP_7 + 4)
61        .set    IP_9, (IP_8 + 4)
62        .set    IP_10, (IP_9 + 4)
63       
64        .set    IP_11, (IP_10 + 4)
65        .set    IP_12, (IP_11 + 4)
66        .set    IP_13, (IP_12 + 4)
67        .set    IP_28, (IP_13 + 4)
68       
69        .set    IP_29, (IP_28 + 4)
70        .set    IP_30, (IP_29 + 4)
71        .set    IP_31, (IP_30 + 4)
72        .set    IP_CR, (IP_31 + 4)
73       
74        .set    IP_CTR, (IP_CR + 4)
75        .set    IP_XER, (IP_CTR + 4)
76        .set    IP_LR, (IP_XER + 4)
77        .set    IP_PC, (IP_LR + 4)
78       
79        .set    IP_MSR, (IP_PC + 4)
80       
81        .set    IP_END, (IP_MSR + 16)
82
83        /* Vector offsets                        */
84        .set    begin_vector,0xFFF00000
85        .set    crit_vector,0xFFF00100
86        .set    mach_vector,0xFFF00200
87        .set    prot_vector,0xFFF00300
88        .set    ext_vector,0xFFF00500
89        .set    align_vector,0xFFF00600
90        .set    prog_vector,0xFFF00700
91        .set    dec_vector,0xFFF00900
92        .set    sys_vector,0xFFF00C00
93        .set    pit_vector,0xFFF01000
94        .set    fit_vector,0xFFF01010
95        .set    wadt_vector,0xFFF01020
96        .set    debug_vector,0xFFF02000
97
98/* Go to the right section */
99#if PPC_ASM == PPC_ASM_ELF
100        .section .vectors,"awx",@progbits
101#elif PPC_ASM == PPC_ASM_XCOFF
102        .csect  .text[PR]
103#endif
104
105        PUBLIC_VAR (__vectors)
106SYM (__vectors):
107       
108/* Decrementer interrupt */
109        .org    dec_vector - file_base
110#if (PPC_ABI == PPC_ABI_POWEROPEN || PPC_ABI == PPC_ABI_GCC27)
111#if (PPC_HAS_FPU)
112        stwu    r1, -(20*4 + 18*8 + IP_END)(r1)
113#else
114        stwu    r1, -(20*4 + IP_END)(r1)
115#endif
116#else
117        stwu    r1, -(IP_END)(r1)
118#endif
119        stw     r0, IP_0(r1)
120
121        li      r0, PPC_IRQ_DECREMENTER
122        b       PROC (_ISR_Handler)
123
Note: See TracBrowser for help on using the repository browser.