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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [orpsocv2/] [sw/] [drivers/] [or1200/] [crt0.S] - Diff between revs 425 and 470

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

Rev 425 Rev 470
Line 1... Line 1...
#include "spr-defs.h"
#include "spr-defs.h"
#include "board.h"
#include "board.h"
 
 
/* ======================================================= [ macros ] === */
/* ======================================================= [ macros ] === */
 
 
 
#define REDZONE 128
 
#define EXCEPTION_STACK_SIZE (128 + REDZONE)
 
 
#define CLEAR_GPR(gpr) \
#define CLEAR_GPR(gpr) \
        l.or    gpr, r0, r0
        l.or    gpr, r0, r0
 
 
#define ENTRY(symbol)    \
#define ENTRY(symbol)    \
Line 15... Line 17...
        .global symbol ;               \
        .global symbol ;               \
        l.movhi gpr, hi(symbol) ;      \
        l.movhi gpr, hi(symbol) ;      \
        l.ori   gpr, gpr, lo(symbol)
        l.ori   gpr, gpr, lo(symbol)
 
 
        // Really goes to configurable interrupt handler
        // Really goes to configurable interrupt handler
#define UNHANDLED_EXCEPTION            \
#define EXCEPTION_HANDLER            \
        l.addi  r1, r1, -256;          \
        l.addi  r1, r1, -EXCEPTION_STACK_SIZE;          \
        l.sw    4(r1), r3;             \
        l.sw    4(r1), r3;             \
        l.sw    8(r1), r4;             \
        l.sw    8(r1), r4;             \
        l.mfspr r3,r0,SPR_NPC;          \
        l.mfspr r3,r0,SPR_NPC;          \
        l.mfspr r4,r0,SPR_EPCR_BASE;   \
        l.mfspr r4,r0,SPR_EPCR_BASE;   \
        l.j default_exception_handler; \
        l.j default_exception_handler; \
        l.nop
        l.nop
 
 
 
 
 
 
 
 
 
 
/* =================================================== [ exceptions ] === */
/* =================================================== [ exceptions ] === */
        .section .vectors, "ax"
        .section .vectors, "ax"
 
 
 
 
/* ---[ 0x100: RESET exception ]----------------------------------------- */
/* ---[ 0x100: RESET exception ]----------------------------------------- */
Line 52... Line 50...
        l.jr    r4
        l.jr    r4
        l.nop
        l.nop
 
 
/* ---[ 0x200: BUS exception ]------------------------------------------- */
/* ---[ 0x200: BUS exception ]------------------------------------------- */
        .org 0x200
        .org 0x200
        UNHANDLED_EXCEPTION
        EXCEPTION_HANDLER
 
 
/* ---[ 0x300: Data Page Fault exception ]------------------------------- */
/* ---[ 0x300: Data Page Fault exception ]------------------------------- */
        .org 0x300
        .org 0x300
        UNHANDLED_EXCEPTION
        EXCEPTION_HANDLER
 
 
/* ---[ 0x400: Insn Page Fault exception ]------------------------------- */
/* ---[ 0x400: Insn Page Fault exception ]------------------------------- */
        .org 0x400
        .org 0x400
        UNHANDLED_EXCEPTION
        EXCEPTION_HANDLER
 
 
 
 
/* ---[ 0x500: Timer exception ]----------------------------------------- */
/* ---[ 0x500: Timer exception ]----------------------------------------- */
        .org 0x500
        .org 0x500
#define TIMER_RELOAD_VALUE (SPR_TTMR_IE | SPR_TTMR_RT | ((IN_CLK/TICKS_PER_SEC) & SPR_TTMR_PERIOD))
#define TIMER_RELOAD_VALUE (SPR_TTMR_IE | SPR_TTMR_RT | ((IN_CLK/TICKS_PER_SEC) & SPR_TTMR_PERIOD))
        //UNHANDLED_EXCEPTION
        //EXCEPTION_HANDLER
        /* Simply load timer_ticks variable and increment */
        /* Simply load timer_ticks variable and increment */
        .extern timer_ticks
        .extern timer_ticks
        l.addi  r1, r1, -136
        l.addi  r1, r1, -136
        l.sw    0(r1), r25
        l.sw    0(r1), r25
        l.sw    4(r1), r26
        l.sw    4(r1), r26
Line 87... Line 85...
        l.addi  r1, r1, 136
        l.addi  r1, r1, 136
        l.rfe
        l.rfe
 
 
/* ---[ 0x600: Aligment exception ]-------------------------------------- */
/* ---[ 0x600: Aligment exception ]-------------------------------------- */
        .org 0x600
        .org 0x600
        UNHANDLED_EXCEPTION
        EXCEPTION_HANDLER
 
 
/* ---[ 0x700: Illegal insn exception ]---------------------------------- */
/* ---[ 0x700: Illegal insn exception ]---------------------------------- */
        .org 0x700
        .org 0x700
        UNHANDLED_EXCEPTION
        EXCEPTION_HANDLER
 
 
/* ---[ 0x800: External interrupt exception ]---------------------------- */
/* ---[ 0x800: External interrupt exception ]---------------------------- */
        .org 0x800
        .org 0x800
        UNHANDLED_EXCEPTION
        EXCEPTION_HANDLER
 
 
/* ---[ 0x900: DTLB miss exception ]------------------------------------- */
/* ---[ 0x900: DTLB miss exception ]------------------------------------- */
        .org 0x900
        .org 0x900
        UNHANDLED_EXCEPTION
        EXCEPTION_HANDLER
 
 
/* ---[ 0xa00: ITLB miss exception ]------------------------------------- */
/* ---[ 0xa00: ITLB miss exception ]------------------------------------- */
        .org 0xa00
        .org 0xa00
        UNHANDLED_EXCEPTION
        EXCEPTION_HANDLER
 
 
 
 
/* ---[ 0xb00: Range exception ]----------------------------------------- */
/* ---[ 0xb00: Range exception ]----------------------------------------- */
        .org 0xb00
        .org 0xb00
        UNHANDLED_EXCEPTION
        EXCEPTION_HANDLER
 
 
 
 
/* ---[ 0xc00: Syscall exception ]--------------------------------------- */
/* ---[ 0xc00: Syscall exception ]--------------------------------------- */
        .org 0xc00
        .org 0xc00
        UNHANDLED_EXCEPTION
        EXCEPTION_HANDLER
 
 
 
 
/* ---[ 0xd00: Trap exception ]------------------------------------------ */
/* ---[ 0xd00: FPU exception ]------------------------------------------- */
        .org 0xd00
        .org 0xd00
        UNHANDLED_EXCEPTION
        EXCEPTION_HANDLER
 
 
 
 
/* ---[ 0xe00: Trap exception ]------------------------------------------ */
/* ---[ 0xe00: Trap exception ]------------------------------------------ */
        .org 0xe00
        .org 0xe00
        UNHANDLED_EXCEPTION
        EXCEPTION_HANDLER
 
 
 
 
/* ---[ 0xf00: Reserved exceptions ]------------------------------------- */
/* ---[ 0xf00 - 0x1400: Reserved exceptions ]---------------------------- */
        .org 0xf00
 
        UNHANDLED_EXCEPTION
 
/*
/*
 
        .org 0xf00
 
        EXCEPTION_HANDLER
 
 
        .org 0x1000
        .org 0x1000
        UNHANDLED_EXCEPTION
        EXCEPTION_HANDLER
 
 
        .org 0x1100
        .org 0x1100
        UNHANDLED_EXCEPTION
        EXCEPTION_HANDLER
 
 
        .org 0x1200
        .org 0x1200
        UNHANDLED_EXCEPTION
        EXCEPTION_HANDLER
 
 
        .org 0x1300
        .org 0x1300
        UNHANDLED_EXCEPTION
        EXCEPTION_HANDLER
 
 
        .org 0x1400
        .org 0x1400
        UNHANDLED_EXCEPTION
        EXCEPTION_HANDLER
 
 
 
*/
 
/* ---[ 0x1500 - 0x1800: Implementation-specific exceptions ]------------ */
 
/*
        .org 0x1500
        .org 0x1500
        UNHANDLED_EXCEPTION
        EXCEPTION_HANDLER
 
 
        .org 0x1600
        .org 0x1600
        UNHANDLED_EXCEPTION
        EXCEPTION_HANDLER
 
 
        .org 0x1700
        .org 0x1700
        UNHANDLED_EXCEPTION
        EXCEPTION_HANDLER
 
 
        .org 0x1800
        .org 0x1800
        UNHANDLED_EXCEPTION
        EXCEPTION_HANDLER
 
*/
 
/* ---[ 0x1500 - 0x1F00: Custom exceptions ]----------------------------- */
 
/*
        .org 0x1900
        .org 0x1900
        UNHANDLED_EXCEPTION
        EXCEPTION_HANDLER
 
 
        .org 0x1a00
        .org 0x1a00
        UNHANDLED_EXCEPTION
        EXCEPTION_HANDLER
 
 
        .org 0x1b00
        .org 0x1b00
        UNHANDLED_EXCEPTION
        EXCEPTION_HANDLER
 
 
        .org 0x1c00
        .org 0x1c00
        UNHANDLED_EXCEPTION
        EXCEPTION_HANDLER
 
 
        .org 0x1d00
        .org 0x1d00
        UNHANDLED_EXCEPTION
        EXCEPTION_HANDLER
 
 
        .org 0x1e00
        .org 0x1e00
        UNHANDLED_EXCEPTION
        EXCEPTION_HANDLER
 
 
        .org 0x1f00
        .org 0x1f00
        UNHANDLED_EXCEPTION
        EXCEPTION_HANDLER
*/
*/
 
 
/* ========================================================= [ entry ] === */
/* ========================================================= [ entry ] === */
        .section .text
        .section .text
 
 
Line 389... Line 388...
        l.lwz    r29, 0x6c(r1)
        l.lwz    r29, 0x6c(r1)
        l.lwz    r30, 0x70(r1)
        l.lwz    r30, 0x70(r1)
        l.lwz    r31, 0x74(r1)
        l.lwz    r31, 0x74(r1)
        l.lwz    r32, 0x78(r1)
        l.lwz    r32, 0x78(r1)
 
 
        l.addi  r1, r1, 256
        l.addi  r1, r1, EXCEPTION_STACK_SIZE
 
 
        l.rfe
        l.rfe
        l.nop
        l.nop
 
 

powered by: WebSVN 2.1.0

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