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/] [v85x/] [arch/] [v2_0/] [src/] [vectors.S] - Blame information for rev 277

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 27 unneback
// #========================================================================
2
// #
3
// #    vectors.S
4
// #
5
// #    NEC/V85x exception/interrupt vectors
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, jlarmour
44
// # Contributors:  gthomas, jlarmour
45
// # Date:          2001-03-21
46
// # Purpose:       NEC/V85x exception vectors
47
// # Description:   This file defines the code placed into the exception
48
// #                vectors. It also contains the first level default VSRs
49
// #                that save and restore state for both exceptions and
50
// #                interrupts.
51
// #
52
// #####DESCRIPTIONEND####
53
// #
54
// #========================================================================
55
 
56
#include 
57
#include 
58
#include 
59
#ifdef CYGPKG_KERNEL
60
#include 
61
#else
62
# undef CYGFUN_HAL_COMMON_KERNEL_SUPPORT
63
# undef CYGIMP_HAL_COMMON_INTERRUPTS_USE_INTERRUPT_STACK
64
#endif
65
#include 
66
#include CYGHWR_MEMORY_LAYOUT_H
67
 
68
#include 
69
 
70
// Two different macros in case we ever decide to differentiate
71
// between exceptions and interrupts.
72
        .macro  EXCEPTION
73
        .org    reset_vector+(0x0010*VECTOR)
74
        addi    -CYGARC_EXCEPTION_FRAME_SIZE,sp,sp
75
        st.w    r8,CYGARC_REG_R8[sp]
76
        movea   VECTOR,r0,r8
77
        jr      exception
78
        .set    VECTOR, VECTOR+1
79
        .endm
80
 
81
        .macro  INTERRUPT
82
        .org    reset_vector+(0x0010*VECTOR)
83
        addi    -CYGARC_EXCEPTION_FRAME_SIZE,sp,sp
84
        st.w    r8,CYGARC_REG_R8[sp]
85
        movea   VECTOR,r0,r8
86
        jr      exception
87
        .set    VECTOR, VECTOR+1
88
        .endm
89
 
90
#if defined(CYG_HAL_STARTUP_ROM) || defined(CYG_HAL_STARTUP_ROMRAM)
91
        .section ".vectors","ax"
92
        .globl  reset_vector
93
reset_vector:
94
 
95
//
96
// These are the hardware exception vectors.
97
//
98
__ROM_vsr:
99
        // start of ROM
100
        mov     r0,sp  // needed for platforms that have NMI 2 insns after reset
101
        // This jump works even for ROMRAM because it is PC relative
102
        jr      start
103
 
104
        .set    VECTOR, 1
105
        .rept   CYGNUM_HAL_EXCEPTION_COUNT-1
106
        EXCEPTION
107
        .endr
108
        .set    VECTOR, CYGNUM_HAL_ISR_MIN
109
        .rept   CYGNUM_HAL_ISR_COUNT
110
        INTERRUPT
111
        .endr
112
#endif
113
 
114
        .text
115
        .globl  start
116
start:
117
#if defined(CYG_HAL_STARTUP_ROM) || defined(CYG_HAL_STARTUP_ROMRAM)
118
        // Before anything else, *carefully* check if this was actually an NMI
119
        // The assumption is that the stack pointer can only be 0 on reset
120
        // as set above at __ROM_vsr
121
        cmp     r0,sp
122
        be      1f
123
        addi    -CYGARC_EXCEPTION_FRAME_SIZE,sp,sp
124
        movea   1,r0,r8
125
        jr      exception
126
1:
127
#endif
128
 
129
        // Perform hardware initialization
130
        PLATFORM_SETUP1
131
 
132
        // Copy everything to the proper VMA base and jump to it.
133
#if defined(CYG_HAL_STARTUP_ROMRAM)
134
        lea     CYGMEM_REGION_rom,r6
135
        lea     CYGMEM_REGION_ram,r7
136
        lea     ___rom_data_end,r8 // Assume end of .data == end of ROM
137
1:      ld.w    0[r6],r1
138
        st.w    r1,0[r7]
139
        addi    4,r6,r6
140
        addi    4,r7,r7
141
        cmp     r6,r8
142
        bne     1b
143
 
144
        // now jump to RAM
145
        lea     ___romram_jump_vector,r1
146
        jmp     [r1]
147
 
148
___romram_jump_vector:
149
 
150
#elif defined( CYG_HAL_STARTUP_ROM )
151
        // Relocate [copy] data from ROM to RAM
152
        lea     ___rom_data_start,r6
153
        lea     ___ram_data_start,r7
154
        lea     ___ram_data_end,r8
155
1:      ld.w    0[r6],r1
156
        st.w    r1,0[r7]
157
        addi    4,r6,r6
158
        addi    4,r7,r7
159
        cmp     r7,r8
160
        bne     1b
161
 
162
        // Initialize RAM vectors
163
        lea     ___ram_vectors_loadaddr,r6
164
        lea     ___ram_vectors_start,r7
165
        lea     ___ram_vectors_end,r8
166
1:      ld.w    0[r6],r1
167
        st.w    r1,0[r7]
168
        addi    4,r6,r6
169
        addi    4,r7,r7
170
        cmp     r7,r8
171
        bne     1b
172
#endif
173
 
174
        // Initialize stack
175
        lea     __startup_stack-16,r1
176
        mov     r1,sp
177
 
178
        // Clear BSS
179
        lea     ___bss_start,r6
180
        lea     ___bss_end,r7
181
1:      st.w    r0,0[r6]
182
        addi    4,r6,r6
183
        cmp     r6,r7
184
        bne     1b
185
 
186
#if defined(CYG_HAL_STARTUP_RAM)
187
// Set up VSR pointers into this application/image
188
        lea     _hal_vsr_table+(CYGNUM_HAL_ISR_MIN*4),r6
189
        movea   CYGNUM_HAL_ISR_COUNT,r0,r7
190
        lea     do_interrupt,r8
191
10:     st.w    r8,0[r6]
192
        addi    4,r6,r6
193
        addi    -1,r7,r7
194
        bne     10b
195
#endif
196
 
197
        // Initialize hardware
198
        jarl    _cyg_hal_hardware_init,r31
199
 
200
#ifdef CYGDBG_HAL_DEBUG_GDB_INCLUDE_STUBS
201
# ifdef CYG_HAL_STARTUP_RAM
202
// Need to handle exceptions as well
203
        lea     _hal_vsr_table,r6
204
        movea   CYGNUM_HAL_EXCEPTION_COUNT,r0,r7
205
        lea     do_exception,r8
206
10:     st.w    r8,0[r6]
207
        addi    4,r6,r6
208
        addi    -1,r7,r7
209
        bne     10b
210
# endif
211
        jarl    _initialize_stub,r31
212
#else // CYGDBG_HAL_DEBUG_GDB_INCLUDE_STUBS
213
// All programs need to provide for NMI handlers
214
        lea     _hal_vsr_table+4,r6
215
        lea     do_exception,r8
216
        st.w    r8,0[r6]    // NMI pin
217
#endif // CYGDBG_HAL_DEBUG_GDB_INCLUDE_STUBS
218
 
219
#if defined(CYG_HAL_STARTUP_ROM) || defined(CYG_HAL_STARTUP_ROMRAM)
220
        // we can process NMIs now
221
        lea     __allow_nmi,r1
222
        addi    1,r0,r2
223
        st.w    r2,0[r1]
224
#endif
225
 
226
#if defined(CYGDBG_HAL_DEBUG_GDB_CTRLC_SUPPORT) \
227
    || defined(CYGDBG_HAL_DEBUG_GDB_BREAK_SUPPORT)
228
        .extern hal_ctrlc_isr_init
229
        jarl    _hal_ctrlc_isr_init,r31
230
#endif
231
 
232
        // Run through static constructors
233
        jarl    _cyg_hal_invoke_constructors,r31
234
 
235
        // Ready to start the eCos kernel
236
        jarl    _cyg_start,r31
237
 
238
        // If we get here, something is _very_ wrong
239
_start_hang:
240
        br      _start_hang
241
 
242
#if defined(CYG_HAL_STARTUP_ROM) || defined(CYG_HAL_STARTUP_ROMRAM)
243
        // Handle exception
244
exception:
245
        // save exception context
246
        st.w    ep,CYGARC_REG_EP[sp]
247
        mov     sp,ep
248
        sst.w   r8,CYGARC_REG_VECTOR[ep]
249
        sst.w   r1,CYGARC_REG_R1[ep]
250
        addi    CYGARC_EXCEPTION_FRAME_SIZE,ep,r1
251
        sst.w   r2,CYGARC_REG_R2[ep]
252
        sst.w   r1,CYGARC_REG_SP[ep]
253
        sst.w   r4,CYGARC_REG_R4[ep]
254
        sst.w   r5,CYGARC_REG_R5[ep]
255
        sst.w   r6,CYGARC_REG_R6[ep]
256
        sst.w   r7,CYGARC_REG_R7[ep]
257
//        sst.w   r8,CYGARC_REG_R8[ep]
258
        sst.w   r9,CYGARC_REG_R9[ep]
259
        sst.w   r10,CYGARC_REG_R10[ep]
260
        sst.w   r11,CYGARC_REG_R11[ep]
261
        sst.w   r12,CYGARC_REG_R12[ep]
262
        sst.w   r13,CYGARC_REG_R13[ep]
263
        sst.w   r14,CYGARC_REG_R14[ep]
264
        sst.w   r15,CYGARC_REG_R15[ep]
265
        sst.w   r16,CYGARC_REG_R16[ep]
266
        sst.w   r17,CYGARC_REG_R17[ep]
267
        sst.w   r18,CYGARC_REG_R18[ep]
268
        sst.w   r19,CYGARC_REG_R19[ep]
269
#ifndef CYGDBG_HAL_COMMON_INTERRUPTS_SAVE_MINIMUM_CONTEXT
270
        sst.w   r20,CYGARC_REG_R20[ep]
271
        sst.w   r21,CYGARC_REG_R21[ep]
272
        sst.w   r22,CYGARC_REG_R22[ep]
273
        sst.w   r23,CYGARC_REG_R23[ep]
274
        sst.w   r24,CYGARC_REG_R24[ep]
275
        sst.w   r25,CYGARC_REG_R25[ep]
276
        sst.w   r26,CYGARC_REG_R26[ep]
277
        sst.w   r27,CYGARC_REG_R27[ep]
278
        sst.w   r28,CYGARC_REG_R28[ep]
279
#endif
280
        sst.w   r29,CYGARC_REG_R29[ep] // NB frame pointer
281
        sst.w   lp,CYGARC_REG_LP[ep]
282
        cmp     CYGNUM_HAL_VECTOR_TRAP00,r8  // NMI?
283
        bge     05f
284
        stsr    FEPC,r6                 // saved state differs
285
        stsr    FEPSW,r7
286
        lea     __allow_nmi,r1          // is the system ready for NMIs?
287
        tst1    0, 0[r1]
288
        bne     10f
289
        // if not processing NMIs, allow restore
290
        sst.w   r6,CYGARC_REG_PC[ep]
291
        sst.w   r7,CYGARC_REG_PSW[ep]
292
        // Reenable exception processing
293
        stsr    PSW,r6
294
        andi    ~(CYGARC_PSW_EP|CYGARC_PSW_NP),r6,r6
295
        ldsr    r6,PSW
296
        lea     return_from_exception_or_interrupt,r1
297
        jmp     [r1]
298
 
299
05:     stsr    EIPC,r6
300
        stsr    EIPSW,r7
301
        cmp     CYGNUM_HAL_VECTOR_ILGOP,r8 // Illegal opcode?
302
        bne     10f
303
        addi    -4,r6,r6                // yes, adjust PC
304
10:     sst.w   r6,CYGARC_REG_PC[ep]
305
        sst.w   r7,CYGARC_REG_PSW[ep]
306
        stsr    ECR,r6
307
        sst.w   r6,CYGARC_REG_CAUSE[ep]
308
        // Reenable exception processing
309
        stsr    PSW,r6
310
        andi    ~(CYGARC_PSW_EP|CYGARC_PSW_NP),r6,r6
311
        ldsr    r6,PSW
312
        shl     2,r8
313
        lea     _hal_vsr_table,r1
314
        add     r1,r8
315
        ld.w    0[r8],r1
316
        jmp     [r1]
317
#endif
318
 
319
do_exception:
320
        // pass in saved registers
321
        mov     sp,r6
322
 
323
        // leave space for the parameter flush back area (as per calling
324
        // conventions)
325
        addi    -16,sp,sp
326
 
327
        jarl    _exception_handler,r31
328
 
329
return_from_exception_or_interrupt:
330
        // save sp, but remove space for the parameter flush back area
331
        // (as per calling conventions) at the same time
332
        addi    16,sp,ep
333
 
334
        sld.w   CYGARC_REG_PSW[ep],r7
335
        sld.w   CYGARC_REG_R1[ep],r1
336
        sld.w   CYGARC_REG_PC[ep],r6
337
        sld.w   CYGARC_REG_R2[ep],r2
338
        // disable interrupts while restoring context
339
        ld.w    CYGARC_REG_VECTOR[ep],r4
340
        stsr    PSW,r8
341
        cmp     CYGNUM_HAL_VECTOR_TRAP00,r4
342
        bge     10f
343
        ori     CYGARC_PSW_NP,r8,r8     // returning from NMI
344
        ori     CYGARC_PSW_ID,r8,r8     // disable interrupt
345
        ldsr    r8,PSW
346
        ldsr    r7,FEPSW
347
        ldsr    r6,FEPC
348
        br      30f
349
10:     cmp     CYGNUM_HAL_ISR_MIN,r4   // exception or interrupt
350
        bge     20f
351
        ori     CYGARC_PSW_EP,r8,r8     // returning from exception
352
20:     ori     CYGARC_PSW_ID,r8,r8     // disable interrupt
353
        ldsr    r8,PSW
354
        ldsr    r7,EIPSW                // Avoid pipeline bubbles
355
        ldsr    r6,EIPC
356
30:     sld.w   CYGARC_REG_R4[ep],r4
357
        sld.w   CYGARC_REG_R5[ep],r5
358
        sld.w   CYGARC_REG_R6[ep],r6
359
        sld.w   CYGARC_REG_R7[ep],r7
360
        sld.w   CYGARC_REG_R8[ep],r8
361
        sld.w   CYGARC_REG_R9[ep],r9
362
        sld.w   CYGARC_REG_R10[ep],r10
363
        sld.w   CYGARC_REG_R11[ep],r11
364
        sld.w   CYGARC_REG_R12[ep],r12
365
        sld.w   CYGARC_REG_R13[ep],r13
366
        sld.w   CYGARC_REG_R14[ep],r14
367
        sld.w   CYGARC_REG_R15[ep],r15
368
        sld.w   CYGARC_REG_R16[ep],r16
369
        sld.w   CYGARC_REG_R17[ep],r17
370
        sld.w   CYGARC_REG_R18[ep],r18
371
        sld.w   CYGARC_REG_R19[ep],r19
372
#ifndef CYGDBG_HAL_COMMON_INTERRUPTS_SAVE_MINIMUM_CONTEXT
373
        sld.w   CYGARC_REG_R20[ep],r20
374
        sld.w   CYGARC_REG_R21[ep],r21
375
        sld.w   CYGARC_REG_R22[ep],r22
376
        sld.w   CYGARC_REG_R23[ep],r23
377
        sld.w   CYGARC_REG_R24[ep],r24
378
        sld.w   CYGARC_REG_R25[ep],r25
379
        sld.w   CYGARC_REG_R26[ep],r26
380
        sld.w   CYGARC_REG_R27[ep],r27
381
        sld.w   CYGARC_REG_R28[ep],r28
382
#endif
383
        sld.w   CYGARC_REG_R29[ep],r29 // NB frame pointer
384
        sld.w   CYGARC_REG_LP[ep],lp
385
        sld.w   CYGARC_REG_SP[ep],sp
386
        sld.w   CYGARC_REG_EP[ep],ep
387
        reti
388
 
389
        // Handle interrupt - these are typically vectored into user code
390
do_interrupt:
391
        mov     sp,ep                   // save pointer to regs frame
392
        // leave space for the parameter flush back area (as per calling
393
        // conventions)
394
        addi    -16,sp,sp
395
 
396
#ifdef CYGIMP_HAL_COMMON_INTERRUPTS_USE_INTERRUPT_STACK
397
        // Switch to interrupt stack
398
        lea     irq_level,r6            // current number of nested interrupts
399
        ld.w    0[r6],r7
400
        addi    1,r7,r8
401
        st.w    r8,0[r6]
402
        cmp     0,r7                    // if was zero, switch stacks
403
        bne     10f
404
        mov     sp,r1                   // save old stack pointer
405
        lea     __interrupt_stack-20,r2
406
        mov     r2,sp
407
        st.w    r1,16[sp]
408
10:
409
#endif // CYGIMP_HAL_COMMON_INTERRUPTS_USE_INTERRUPT_STACK
410
 
411
        // The entire CPU state is now stashed on the stack,
412
        // increment the scheduler lock and handle the interrupt
413
 
414
#ifdef CYGFUN_HAL_COMMON_KERNEL_SUPPORT
415
        .extern _cyg_scheduler_sched_lock
416
        lea     _cyg_scheduler_sched_lock,r7
417
        ld.w    0[r7],r8
418
        addi    1,r8,r8
419
        st.w    r8,0[r7]
420
#endif
421
 
422
#if defined(CYGPKG_KERNEL_INSTRUMENT) && \
423
    defined(CYGDBG_KERNEL_INSTRUMENT_INTR)
424
        lea     RAISE_INTR,r6                   // arg0 = type = INTR,RAISE
425
        ld.w    CYGARC_REG_VECTOR[ep],r7        // args = vector
426
        mov     r0,r8                           // arg2 = 0
427
        jarl    _cyg_instrument,r31
428
#endif
429
 
430
#if defined(CYGDBG_HAL_DEBUG_GDB_CTRLC_SUPPORT) \
431
    || defined(CYGDBG_HAL_DEBUG_GDB_BREAK_SUPPORT)
432
        // If we are supporting Ctrl-C interrupts from GDB, we must squirrel
433
        // away a pointer to the save interrupt state here so that we can
434
        // plant a breakpoint at some later time.
435
 
436
        .extern _hal_saved_interrupt_state
437
        lea     _hal_saved_interrupt_state,r8
438
        st.w    ep,0[r8]
439
#endif
440
 
441
#ifdef CYGIMP_KERNEL_INTERRUPTS_CHAIN
442
        mov     r0,r8                           // vector # (overloaded by kernel)
443
#else
444
        ld.w    CYGARC_REG_VECTOR[ep],r6        // vector #
445
        addi    -CYGNUM_HAL_ISR_MIN,r6,r8
446
        shl     2,r8
447
#endif
448
        lea     _hal_interrupt_objects,r1
449
        add     r8,r1
450
        ld.w    0[r1],r29                       // save object handle
451
        lea     _hal_interrupt_data,r1
452
        add     r8,r1
453
        ld.w    0[r1],r7                        // handler data
454
        lea     _hal_interrupt_handlers,r1
455
        add     r8,r1
456
        mov     ep,r8                           // pointer to saved registers
457
        ld.w    0[r1],r1                        // handler routine
458
#ifdef CYGIMP_KERNEL_INTERRUPTS_CHAIN
459
        ld.w    CYGARC_REG_VECTOR[ep],r6        // vector #
460
#endif
461
        jarl    call_via_r1,r31
462
 
463
#ifdef CYGIMP_HAL_COMMON_INTERRUPTS_USE_INTERRUPT_STACK
464
        // If we are returning from the last nested interrupt, move back
465
        // to the thread stack. interrupt_end() must be called on the
466
        // thread stack since it potentially causes a context switch.
467
        lea     irq_level,r6
468
        ld.w    0[r6],r7
469
        addi    -1,r7,r8
470
        st.w    r8,0[r6]
471
        cmp     0,r8
472
        bne     10f
473
        ld.w    16[sp],sp       // Restore non-interrupt stack at last interrupt
474
                                // this is offset 16 because of parameter
475
                                // flush back area
476
10:
477
#endif // CYGIMP_HAL_COMMON_INTERRUPTS_USE_INTERRUPT_STACK
478
 
479
#ifdef CYGFUN_HAL_COMMON_KERNEL_SUPPORT
480
        // The return value from the handler (in r10) will indicate whether a
481
        // DSR is to be posted. Pass this together with a pointer to the
482
        // interrupt object we have just used to the interrupt tidy up routine.
483
 
484
        mov     r10,r6                          // interrupt handler return code
485
        mov     r29,r7                          // object handle
486
        mov     ep,r8                           // register frame
487
        jarl    _interrupt_end,r31              // post any bottom layer handle
488
 
489
#endif
490
        br      return_from_exception_or_interrupt
491
 
492
#ifdef CYGIMP_HAL_COMMON_INTERRUPTS_USE_INTERRUPT_STACK
493
        .globl  _hal_interrupt_stack_call_pending_DSRs
494
_hal_interrupt_stack_call_pending_DSRs:
495
        stsr    PSW,r9
496
        di                              // disable interrupts while changing stack
497
        // Switch to interrupt stack
498
        lea     irq_level,r6            // current number of nested interrupts
499
        mov     1,r7                    // note: this can never be non-zero at this point
500
        st.w    r7,0[r6]
501
        mov     sp,r1                   // save old stack pointer
502
        lea     __interrupt_stack-32,r8 // 32 for 16-byte parameter flush back
503
                                        // plus 12 bytes for following reg saves
504
                                        // plus 4 bytes to preserve alignment
505
        mov     r8,sp
506
        st.w    r1,16[sp]
507
        st.w    r9,20[sp]
508
        st.w    lp,24[sp]
509
        ei
510
        jarl    _cyg_interrupt_call_pending_DSRs,lp
511
        di
512
        ld.w    24[sp],lp                // restore state
513
        ld.w    20[sp],r6
514
        ld.w    16[sp],sp
515
        lea     irq_level,r7
516
        st.w    r0,0[r7]
517
        ldsr    r6,PSW
518
        jmp     [lp]
519
#endif // CYGIMP_HAL_COMMON_INTERRUPTS_USE_INTERRUPT_STACK
520
 
521
//
522
// Indirect subroutine call, via R1
523
 
524
call_via_r1:
525
        jmp     [r1]
526
 
527
//
528
// Reset the board
529
//
530
        .globl  _hal_reset_board
531
_hal_reset_board:
532
        di                      // Turn off interrupts
533
        // Don't process NMIs
534
        lea     __allow_nmi,r1
535
        st.w    r0,0[r1]
536
        jmp     [r0]            // Restart machine
537
 
538
#if !defined(CYGSEM_HAL_NEC_INLINE_INTERRUPT_FUNCTIONS)
539
        .globl  _hal_disable_interrupts
540
_hal_disable_interrupts:
541
        stsr    PSW,r10
542
        di
543
        jmp     [lp]
544
 
545
        .globl  _hal_enable_interrupts
546
_hal_enable_interrupts:
547
        stsr    PSW,r6
548
        ei
549
        jmp     [lp]
550
 
551
        .globl  _hal_restore_interrupts
552
_hal_restore_interrupts:
553
        ldsr    r6,PSW
554
        jmp     [lp]
555
#endif
556
 
557
// -------------------------------------------------------------------------
558
        .section ".ram_vectors","awx",@progbits
559
 
560
#if defined(CYG_HAL_STARTUP_ROM)
561
// Trap jump table - used by builtin ROM
562
__vsr_table:
563
        .rept   CYGNUM_HAL_VSR_COUNT
564
        .word   0x00000794,0,0,0   // jr 0x0100xx0, nop, nop, nop
565
        .endr
566
__vsr_table_end:
567
#endif
568
 
569
#if defined(CYG_HAL_STARTUP_ROM) || defined(CYG_HAL_STARTUP_ROMRAM)
570
_hal_vsr_table:
571
        .rept   CYGNUM_HAL_EXCEPTION_COUNT
572
        .word   do_exception
573
        .endr
574
        .rept   CYGNUM_HAL_ISR_COUNT
575
        .word   do_interrupt
576
        .endr
577
 
578
// Flag to indicate whether NMIs are allowed
579
// Without this, if we do a soft reset (using hal_plf_reset_board above)
580
// we may process NMIs like the watchdog timeout before the system can
581
// accept them
582
__allow_nmi:
583
        .word 0
584
 
585
        .balign 64
586
_hal_virtual_vector_table:
587
        .rept   CYGNUM_CALL_IF_TABLE_SIZE
588
        .word   0
589
        .endr
590
 
591
#if CYGINT_HAL_V85X_ICE_DEBUG
592
        .globl  _hal_v85x_ice_syscall_info
593
_hal_v85x_ice_syscall_info:
594
         .rept  48
595
         .long  0
596
         .endr
597
#endif // if CYGINT_HAL_V85X_ICE_DEBUG
598
#endif // if defined(CYG_HAL_STARTUP_ROM) || defined(CYG_HAL_STARTUP_ROMRAM)
599
 
600
        .data
601
// Initial stack
602
        .rept   1024
603
        .byte   0
604
        .endr
605
__startup_stack:
606
 
607
#ifndef CYGNUM_HAL_COMMON_INTERRUPTS_STACK_SIZE
608
#define CYGNUM_HAL_COMMON_INTERRUPTS_STACK_SIZE 4096
609
#endif
610
#ifdef CYGIMP_HAL_COMMON_INTERRUPTS_USE_INTERRUPT_STACK
611
        .balign 16
612
        .global _cyg_interrupt_stack_base
613
_cyg_interrupt_stack_base:
614
__interrupt_stack_base:
615
        .rept CYGNUM_HAL_COMMON_INTERRUPTS_STACK_SIZE
616
        .byte 0
617
        .endr
618
        .balign 16
619
        .global _cyg_interrupt_stack
620
_cyg_interrupt_stack:
621
__interrupt_stack:
622
irq_level:
623
        .long   0
624
#endif
625
 
626
 
627
// Interrupt vector tables.
628
// These tables contain the isr, data and object pointers used to deliver
629
// interrupts to user code.
630
 
631
        .extern _hal_default_isr
632
 
633
        .globl  _hal_interrupt_handlers
634
_hal_interrupt_handlers:
635
        .rept   CYGNUM_HAL_ISR_COUNT
636
        .long   _hal_default_isr
637
        .endr
638
 
639
        .globl  _hal_interrupt_data
640
_hal_interrupt_data:
641
        .rept   CYGNUM_HAL_ISR_COUNT
642
        .long   0
643
        .endr
644
 
645
        .globl  _hal_interrupt_objects
646
_hal_interrupt_objects:
647
        .rept   CYGNUM_HAL_ISR_COUNT
648
        .long   0
649
        .endr
650
 
651
// -------------------------------------------------------------------------
652
// EOF vectors.S

powered by: WebSVN 2.1.0

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