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

Subversion Repositories minsoc

[/] [minsoc/] [trunk/] [sw/] [support/] [except.S] - Diff between revs 36 and 47

Go to most recent revision | Show entire file | Details | Blame | View Log

Rev 36 Rev 47
Line 13... Line 13...
*/
*/
.org 0x000
.org 0x000
 
 
_except_200:
_except_200:
        l.nop
        l.nop
    l.addi  r1,r1,-116                  //free 29 words of stack (stack is r1)
    l.addi  r1,r1,-244            //free 29 words (29 x 4 = 112) + 4 because stack points to contained data (stack is r1)
 
                    //plus 128 bytes not to mess with the previous frame pointer (32 register x 4 bytes = 128 bytes ) (required by C++ multiple threading)
    l.sw    0x18(r1),r9                 //save register r9(return addr) to stack
    l.sw    0x18(r1),r9                 //save register r9(return addr) to stack
    l.jal   store_regs                  //save registers r3-r31 (except r9) to stack (r9 is changed here)
    l.jal   store_regs                  //save registers r3-r31 (except r9) to stack (r9 is changed here)
    l.nop
    l.nop
 
 
    l.movhi r9,hi(end_except)           //set return addr to end_except instruction
    l.movhi r9,hi(end_except)           //set return addr to end_except instruction
    l.ori   r9,r9,lo(end_except)        //set return addr to end_except instruction
    l.ori   r9,r9,lo(end_except)        //set return addr to end_except instruction
        l.j     _buserr_except
    l.j    buserr_except
        l.nop
        l.nop
 
 
.org 0x100
.org 0x100
 
 
_except_300:
_except_300:
        l.nop
        l.nop
    l.addi  r1,r1,-116                  //free 29 words of stack (stack is r1)
    l.addi  r1,r1,-244            //free 29 words (29 x 4 = 112) + 4 because stack points to contained data (stack is r1)
 
                                        //plus 128 bytes not to mess with the previous frame pointer (32 register x 4 bytes = 128 bytes ) (required by C++ multiple threading)
    l.sw    0x18(r1),r9                 //save register r9(return addr) to stack
    l.sw    0x18(r1),r9                 //save register r9(return addr) to stack
    l.jal   store_regs                  //save registers r3-r31 (except r9) to stack (r9 is changed here)
    l.jal   store_regs                  //save registers r3-r31 (except r9) to stack (r9 is changed here)
    l.nop
    l.nop
 
 
    l.movhi r9,hi(end_except)           //set return addr to end_except instruction
    l.movhi r9,hi(end_except)           //set return addr to end_except instruction
    l.ori   r9,r9,lo(end_except)        //set return addr to end_except instruction
    l.ori   r9,r9,lo(end_except)        //set return addr to end_except instruction
        l.j     _dpf_except
    l.j    dpf_except
        l.nop
        l.nop
 
 
.org 0x200
.org 0x200
 
 
_except_400:
_except_400:
        l.nop
        l.nop
    l.addi  r1,r1,-116                  //free 29 words of stack (stack is r1)
    l.addi  r1,r1,-244            //free 29 words (29 x 4 = 112) + 4 because stack points to contained data (stack is r1)
 
                                        //plus 128 bytes not to mess with the previous frame pointer (32 register x 4 bytes = 128 bytes ) (required by C++ multiple threading)
    l.sw    0x18(r1),r9                 //save register r9(return addr) to stack
    l.sw    0x18(r1),r9                 //save register r9(return addr) to stack
    l.jal   store_regs                  //save registers r3-r31 (except r9) to stack (r9 is changed here)
    l.jal   store_regs                  //save registers r3-r31 (except r9) to stack (r9 is changed here)
    l.nop
    l.nop
 
 
    l.movhi r9,hi(end_except)           //set return addr to end_except instruction
    l.movhi r9,hi(end_except)           //set return addr to end_except instruction
    l.ori   r9,r9,lo(end_except)        //set return addr to end_except instruction
    l.ori   r9,r9,lo(end_except)        //set return addr to end_except instruction
        l.j     _ipf_except
    l.j    ipf_except
        l.nop
        l.nop
 
 
.org 0x300
.org 0x300
 
 
_except_500:
_except_500:
        l.nop
        l.nop
    l.addi  r1,r1,-116                  //free 29 words of stack (stack is r1)
    l.addi  r1,r1,-244            //free 29 words (29 x 4 = 112) + 4 because stack points to contained data (stack is r1)
 
                                        //plus 128 bytes not to mess with the previous frame pointer (32 register x 4 bytes = 128 bytes ) (required by C++ multiple threading)
    l.sw    0x18(r1),r9                 //save register r9(return addr) to stack
    l.sw    0x18(r1),r9                 //save register r9(return addr) to stack
    l.jal   store_regs                  //save registers r3-r31 (except r9) to stack (r9 is changed here)
    l.jal   store_regs                  //save registers r3-r31 (except r9) to stack (r9 is changed here)
    l.nop
    l.nop
 
 
    l.movhi r9,hi(end_except)           //set return addr to end_except instruction
    l.movhi r9,hi(end_except)           //set return addr to end_except instruction
    l.ori   r9,r9,lo(end_except)        //set return addr to end_except instruction
    l.ori   r9,r9,lo(end_except)        //set return addr to end_except instruction
        l.j     _tick_except
    l.j    tick_except
        l.nop
        l.nop
 
 
.org 0x400
.org 0x400
 
 
_except_600:
_except_600:
        l.nop
        l.nop
    l.addi  r1,r1,-116                  //free 29 words of stack (stack is r1)
    l.addi  r1,r1,-244            //free 29 words (29 x 4 = 112) + 4 because stack points to contained data (stack is r1)
 
                                        //plus 128 bytes not to mess with the previous frame pointer (32 register x 4 bytes = 128 bytes ) (required by C++ multiple threading)
    l.sw    0x18(r1),r9                 //save register r9(return addr) to stack
    l.sw    0x18(r1),r9                 //save register r9(return addr) to stack
    l.jal   store_regs                  //save registers r3-r31 (except r9) to stack (r9 is changed here)
    l.jal   store_regs                  //save registers r3-r31 (except r9) to stack (r9 is changed here)
    l.nop
    l.nop
 
 
    l.movhi r9,hi(end_except)           //set return addr to end_except instruction
    l.movhi r9,hi(end_except)           //set return addr to end_except instruction
    l.ori   r9,r9,lo(end_except)        //set return addr to end_except instruction
    l.ori   r9,r9,lo(end_except)        //set return addr to end_except instruction
        l.j     _align_except
    l.j    align_except
        l.nop
        l.nop
 
 
.org 0x500
.org 0x500
 
 
_except_700:
_except_700:
        l.nop
        l.nop
    l.addi  r1,r1,-116                  //free 29 words of stack (stack is r1)
    l.addi  r1,r1,-244            //free 29 words (29 x 4 = 112) + 4 because stack points to contained data (stack is r1)
 
                                        //plus 128 bytes not to mess with the previous frame pointer (32 register x 4 bytes = 128 bytes ) (required by C++ multiple threading)
    l.sw    0x18(r1),r9                 //save register r9(return addr) to stack
    l.sw    0x18(r1),r9                 //save register r9(return addr) to stack
    l.jal   store_regs                  //save registers r3-r31 (except r9) to stack (r9 is changed here)
    l.jal   store_regs                  //save registers r3-r31 (except r9) to stack (r9 is changed here)
    l.nop
    l.nop
 
 
    l.movhi r9,hi(end_except)           //set return addr to end_except instruction
    l.movhi r9,hi(end_except)           //set return addr to end_except instruction
    l.ori   r9,r9,lo(end_except)        //set return addr to end_except instruction
    l.ori   r9,r9,lo(end_except)        //set return addr to end_except instruction
        l.j     _illegal_except
    l.j    illegal_except
        l.nop
        l.nop
 
 
.org 0x600
.org 0x600
 
 
_except_800:
_except_800:
        l.nop
        l.nop
    l.addi  r1,r1,-116                  //free 29 words of stack (stack is r1)
    l.addi  r1,r1,-244            //free 29 words (29 x 4 = 112) + 4 because stack points to contained data (stack is r1)
 
                                        //plus 128 bytes not to mess with the previous frame pointer (32 register x 4 bytes = 128 bytes ) (required by C++ multiple threading)
    l.sw    0x18(r1),r9                 //save register r9(return addr) to stack
    l.sw    0x18(r1),r9                 //save register r9(return addr) to stack
    l.jal   store_regs                  //save registers r3-r31 (except r9) to stack (r9 is changed here)
    l.jal   store_regs                  //save registers r3-r31 (except r9) to stack (r9 is changed here)
    l.nop
    l.nop
 
 
    l.movhi r9,hi(end_except)           //set return addr to end_except instruction
    l.movhi r9,hi(end_except)           //set return addr to end_except instruction
    l.ori   r9,r9,lo(end_except)        //set return addr to end_except instruction
    l.ori   r9,r9,lo(end_except)        //set return addr to end_except instruction
    l.j _ext_except                         //jmp to C interrupt handler (returns later to end_except)
    l.j ext_except                //jmp to C interrupt handler (returns later to end_except)
    l.nop
    l.nop
 
 
 
 
.org 0x700
.org 0x700
 
 
_except_900:
_except_900:
        l.nop
        l.nop
    l.addi  r1,r1,-116                  //free 29 words of stack (stack is r1)
    l.addi  r1,r1,-244            //free 29 words (29 x 4 = 112) + 4 because stack points to contained data (stack is r1)
 
                                        //plus 128 bytes not to mess with the previous frame pointer (32 register x 4 bytes = 128 bytes ) (required by C++ multiple threading)
    l.sw    0x18(r1),r9                 //save register r9(return addr) to stack
    l.sw    0x18(r1),r9                 //save register r9(return addr) to stack
    l.jal   store_regs                  //save registers r3-r31 (except r9) to stack (r9 is changed here)
    l.jal   store_regs                  //save registers r3-r31 (except r9) to stack (r9 is changed here)
    l.nop
    l.nop
 
 
    l.movhi r9,hi(end_except)           //set return addr to end_except instruction
    l.movhi r9,hi(end_except)           //set return addr to end_except instruction
    l.ori   r9,r9,lo(end_except)        //set return addr to end_except instruction
    l.ori   r9,r9,lo(end_except)        //set return addr to end_except instruction
        l.j     _dtlbmiss_except
    l.j    dtlbmiss_except
        l.nop
        l.nop
 
 
.org 0x800
.org 0x800
 
 
_except_a00:
_except_a00:
        l.nop
        l.nop
    l.addi  r1,r1,-116                  //free 29 words of stack (stack is r1)
    l.addi  r1,r1,-244            //free 29 words (29 x 4 = 112) + 4 because stack points to contained data (stack is r1)
 
                                        //plus 128 bytes not to mess with the previous frame pointer (32 register x 4 bytes = 128 bytes ) (required by C++ multiple threading)
    l.sw    0x18(r1),r9                 //save register r9(return addr) to stack
    l.sw    0x18(r1),r9                 //save register r9(return addr) to stack
    l.jal   store_regs                  //save registers r3-r31 (except r9) to stack (r9 is changed here)
    l.jal   store_regs                  //save registers r3-r31 (except r9) to stack (r9 is changed here)
    l.nop
    l.nop
 
 
    l.movhi r9,hi(end_except)           //set return addr to end_except instruction
    l.movhi r9,hi(end_except)           //set return addr to end_except instruction
    l.ori   r9,r9,lo(end_except)        //set return addr to end_except instruction
    l.ori   r9,r9,lo(end_except)        //set return addr to end_except instruction
        l.j     _itlbmiss_except
    l.j    itlbmiss_except
        l.nop
        l.nop
 
 
.org 0x900
.org 0x900
 
 
_except_b00:
_except_b00:
        l.nop
        l.nop
    l.addi  r1,r1,-116                  //free 29 words of stack (stack is r1)
    l.addi  r1,r1,-244            //free 29 words (29 x 4 = 112) + 4 because stack points to contained data (stack is r1)
 
                                        //plus 128 bytes not to mess with the previous frame pointer (32 register x 4 bytes = 128 bytes ) (required by C++ multiple threading)
    l.sw    0x18(r1),r9                 //save register r9(return addr) to stack
    l.sw    0x18(r1),r9                 //save register r9(return addr) to stack
    l.jal   store_regs                  //save registers r3-r31 (except r9) to stack (r9 is changed here)
    l.jal   store_regs                  //save registers r3-r31 (except r9) to stack (r9 is changed here)
    l.nop
    l.nop
 
 
    l.movhi r9,hi(end_except)           //set return addr to end_except instruction
    l.movhi r9,hi(end_except)           //set return addr to end_except instruction
    l.ori   r9,r9,lo(end_except)        //set return addr to end_except instruction
    l.ori   r9,r9,lo(end_except)        //set return addr to end_except instruction
        l.j     _range_except
    l.j    range_except
        l.nop
        l.nop
 
 
.org 0xa00
.org 0xa00
 
 
_except_c00:
_except_c00:
        l.nop
        l.nop
    l.addi  r1,r1,-116                  //free 29 words of stack (stack is r1)
    l.addi  r1,r1,-244            //free 29 words (29 x 4 = 112) + 4 because stack points to contained data (stack is r1)
 
                                        //plus 128 bytes not to mess with the previous frame pointer (32 register x 4 bytes = 128 bytes ) (required by C++ multiple threading)
    l.sw    0x18(r1),r9                 //save register r9(return addr) to stack
    l.sw    0x18(r1),r9                 //save register r9(return addr) to stack
    l.jal   store_regs                  //save registers r3-r31 (except r9) to stack (r9 is changed here)
    l.jal   store_regs                  //save registers r3-r31 (except r9) to stack (r9 is changed here)
    l.nop
    l.nop
 
 
    l.movhi r9,hi(end_except)           //set return addr to end_except instruction
    l.movhi r9,hi(end_except)           //set return addr to end_except instruction
    l.ori   r9,r9,lo(end_except)        //set return addr to end_except instruction
    l.ori   r9,r9,lo(end_except)        //set return addr to end_except instruction
        l.j     _syscall_except
    l.j    syscall_except
        l.nop
        l.nop
 
 
.org 0xb00
.org 0xb00
 
 
_except_d00:
_except_d00:
        l.nop
        l.nop
    l.addi  r1,r1,-116                  //free 29 words of stack (stack is r1)
    l.addi  r1,r1,-244            //free 29 words (29 x 4 = 112) + 4 because stack points to contained data (stack is r1)
 
                                        //plus 128 bytes not to mess with the previous frame pointer (32 register x 4 bytes = 128 bytes ) (required by C++ multiple threading)
    l.sw    0x18(r1),r9                 //save register r9(return addr) to stack
    l.sw    0x18(r1),r9                 //save register r9(return addr) to stack
    l.jal   store_regs                  //save registers r3-r31 (except r9) to stack (r9 is changed here)
    l.jal   store_regs                  //save registers r3-r31 (except r9) to stack (r9 is changed here)
    l.nop
    l.nop
 
 
    l.movhi r9,hi(end_except)           //set return addr to end_except instruction
    l.movhi r9,hi(end_except)           //set return addr to end_except instruction
    l.ori   r9,r9,lo(end_except)        //set return addr to end_except instruction
    l.ori   r9,r9,lo(end_except)        //set return addr to end_except instruction
        l.j     _res1_except
    l.j    res1_except
        l.nop
        l.nop
 
 
.org 0xc00
.org 0xc00
 
 
_except_e00:
_except_e00:
        l.nop
        l.nop
    l.addi  r1,r1,-116                  //free 29 words of stack (stack is r1)
    l.addi  r1,r1,-244            //free 29 words (29 x 4 = 112) + 4 because stack points to contained data (stack is r1)
 
                                        //plus 128 bytes not to mess with the previous frame pointer (32 register x 4 bytes = 128 bytes ) (required by C++ multiple threading)
    l.sw    0x18(r1),r9                 //save register r9(return addr) to stack
    l.sw    0x18(r1),r9                 //save register r9(return addr) to stack
    l.jal   store_regs                  //save registers r3-r31 (except r9) to stack (r9 is changed here)
    l.jal   store_regs                  //save registers r3-r31 (except r9) to stack (r9 is changed here)
    l.nop
    l.nop
 
 
    l.movhi r9,hi(end_except)           //set return addr to end_except instruction
    l.movhi r9,hi(end_except)           //set return addr to end_except instruction
    l.ori   r9,r9,lo(end_except)        //set return addr to end_except instruction
    l.ori   r9,r9,lo(end_except)        //set return addr to end_except instruction
        l.j     _trap_except
    l.j    trap_except
        l.nop
        l.nop
 
 
.org 0xd00
.org 0xd00
 
 
_except_f00:
_except_f00:
        l.nop
        l.nop
    l.addi  r1,r1,-116                  //free 29 words of stack (stack is r1)
    l.addi  r1,r1,-244            //free 29 words (29 x 4 = 112) + 4 because stack points to contained data (stack is r1)
 
                                        //plus 128 bytes not to mess with the previous frame pointer (32 register x 4 bytes = 128 bytes ) (required by C++ multiple threading)
    l.sw    0x18(r1),r9                 //save register r9(return addr) to stack
    l.sw    0x18(r1),r9                 //save register r9(return addr) to stack
    l.jal   store_regs                  //save registers r3-r31 (except r9) to stack (r9 is changed here)
    l.jal   store_regs                  //save registers r3-r31 (except r9) to stack (r9 is changed here)
    l.nop
    l.nop
 
 
    l.movhi r9,hi(end_except)           //set return addr to end_except instruction
    l.movhi r9,hi(end_except)           //set return addr to end_except instruction
    l.ori   r9,r9,lo(end_except)        //set return addr to end_except instruction
    l.ori   r9,r9,lo(end_except)        //set return addr to end_except instruction
        l.j     _res2_except
    l.j    res2_except
        l.nop
        l.nop
 
 
store_regs:             //save registers r3-r31 (except r9) to stack
store_regs:             //save registers r3-r31 (except r9) to stack
        l.sw    0x00(r1),r3
        l.sw    0x00(r1),r3
        l.sw    0x04(r1),r4
        l.sw    0x04(r1),r4
Line 268... Line 282...
        l.lwz   r27,0x60(r1)
        l.lwz   r27,0x60(r1)
        l.lwz   r28,0x64(r1)
        l.lwz   r28,0x64(r1)
        l.lwz   r29,0x68(r1)
        l.lwz   r29,0x68(r1)
        l.lwz   r30,0x6c(r1)
        l.lwz   r30,0x6c(r1)
        l.lwz   r31,0x70(r1)
        l.lwz   r31,0x70(r1)
        l.addi  r1,r1,116                               //free stack places
    l.addi  r1,r1,244                //free stack places
        l.rfe                                                   //recover SR register and prior PC (jumps back to program)
        l.rfe                                                   //recover SR register and prior PC (jumps back to program)
        l.nop
        l.nop
 
 

powered by: WebSVN 2.1.0

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