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

Subversion Repositories or1k

[/] [or1k/] [tags/] [nog_patch_50/] [or1ksim/] [cpu/] [or1k/] [except.c] - Diff between revs 33 and 43

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

Rev 33 Rev 43
Line 31... Line 31...
extern unsigned long pctemp;
extern unsigned long pctemp;
 
 
/* Handle OR1K exceptions. */
/* Handle OR1K exceptions. */
void except_handle(int except, unsigned long ea)
void except_handle(int except, unsigned long ea)
{
{
 
        unsigned long pc_saved;
#if ONLY_VIRTUAL_MACHINE
#if ONLY_VIRTUAL_MACHINE
        printf("WARNING: Exception 0x%x (%s): ", except, EXCEPT_NAME(except));
        printf("WARNING: Exception 0x%x (%s): ", except, EXCEPT_NAME(except));
        printf("Insn ADDR: 0x%x  Eff ADDR: 0x%x\n",  iqueue[0].insn_addr, ea);
        printf("Insn ADDR: 0x%x  Eff ADDR: 0x%x\n",  iqueue[0].insn_addr, ea);
        printf("No exception processing while ONLY_VIRTUAL_MACHINE is defined.\n");
        printf("No exception processing while ONLY_VIRTUAL_MACHINE is defined.\n");
#else
#else
Line 45... Line 46...
                return;
                return;
        }
        }
 
 
        printf("Exception 0x%x (%s): ", except, EXCEPT_NAME(except));
        printf("Exception 0x%x (%s): ", except, EXCEPT_NAME(except));
        printf("Insn ADDR: 0x%x  Eff ADDR: 0x%x\n",  iqueue[0].insn_addr, ea);
        printf("Insn ADDR: 0x%x  Eff ADDR: 0x%x\n",  iqueue[0].insn_addr, ea);
 
 
 
        pc_saved = (iqueue[0].insn_addr & ~0x1) | (mfspr(SPR_SR) & SPR_SR_SUPV);
        mtspr(SPR_EPCR_BASE, iqueue[0].insn_addr);
        mtspr(SPR_EPCR_BASE, iqueue[0].insn_addr);
        mtspr(SPR_EEAR_BASE, ea);
        mtspr(SPR_EEAR_BASE, ea);
        mtspr(SPR_SR, mfspr(SPR_SR) | SPR_SR_SUPV);     /* SUPV mode */
        mtspr(SPR_SR, mfspr(SPR_SR) | SPR_SR_SUPV);     /* SUPV mode */
        mtspr(SPR_SR, mfspr(SPR_SR) & ~SPR_SR_EIR);     /* Disable ints. */
        mtspr(SPR_SR, mfspr(SPR_SR) & ~SPR_SR_EIR);     /* Disable ints. */
        pc = (unsigned long)except;
        pc = (unsigned long)except;

powered by: WebSVN 2.1.0

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