OpenCores
URL https://opencores.org/ocsvn/zap/zap/trunk

Subversion Repositories zap

[/] [zap/] [trunk/] [src/] [ts/] [uart/] [uart.s] - Blame information for rev 43

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 43 Revanth
.set USER_STACK_POINTER, 0x00002000
2
.set IRQ_STACK_POINTER,  0x00003000
3
.set VIC_BASE_ADDRESS,   0xFFFFFFA0
4
 
5
.text
6
.global _Reset
7
_Reset:
8
 
9
_Reset   : b there
10
_Undef   : b _Undef
11
_Swi     : b _Swi
12
_Pabt    : b _Pabt
13
_Dabt    : b _Dabt
14
reserved : b reserved
15
irq      : b IRQ
16
fiq      : b fiq
17
 
18
/*
19
 * This handler simply revectors IRQs to
20
 * a dedicated irq_handler function.
21
 */
22
IRQ:
23
sub r14, r14, #4
24
stmfd sp!, {r0-r12, r14}
25
bl irq_handler
26
ldmfd sp!, {r0-r12, pc}^
27
 
28
there:
29
/*
30
 * Switch to IRQ mode.
31
 * Set up stack pointer.
32
 */
33
mrs r2, cpsr
34
bic r2, r2, #31
35
orr r2, r2, #18
36
msr cpsr_c, r2
37
ldr sp, =IRQ_STACK_POINTER
38
 
39
/*
40
 * Switch to user mode with interrupts enabled.
41
 * Set up stack pointer.
42
 */
43
mrs r2, cpsr
44
bic r1, r1, #31
45
orr r1, r1, #16
46
bic r1, r1, #0xC0
47
msr cpsr_c, r1
48
 
49
/*
50
 * Unmask all interrupts in the VIC.
51
 */
52
ldr r0, =VIC_BASE_ADDRESS // VIC base address.
53
add r0, r0, #4            // Move to INT_MASK
54
mov r1, #0                // Prepare mask value
55
str r1, [r0]              // Unmask all interrupt sources.
56
 
57
/*
58
 * Then call the main function. The main function
59
 * will initiallize UART0 in TX and RX.
60
 */
61
ldr sp, =USER_STACK_POINTER
62
bl main
63
here: b here
64
 

powered by: WebSVN 2.1.0

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