source: rtems/c/src/lib/libbsp/powerpc/psim/vectors/vectors.S @ 08311cc3

4.104.114.84.95
Last change on this file since 08311cc3 was 08311cc3, checked in by Joel Sherrill <joel.sherrill@…>, on 11/17/99 at 17:51:34

Updated copyright notice.

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