except.c

来自「WinCE 3.0 BSP, 包含Inter SA1110, Intel_815」· C语言 代码 · 共 259 行

C
259
字号
/*++
Copyright (c) 1997  Microsoft Corporation

Module Name:

    except.cxx

Abstract:

    This program contains the exception handling function

Author:

    Jun Liu 29-Aug-1991

Revision History:

    John Cooper (johncoop) 97-Oct-24: Port to LC2 platform


--*/

#include <windows.h>
#include <halether.h>
#include "romdef.h"

#ifdef BOOT_MONITOR
void FwMonitor(PULONG, LONG);
#endif
void SaveRegisterInstance(PULONG);
void AddEPC();
void EnableExtInt();

/*
**  Unhandled exception
*/
void __cdecl UnHandledException(DWORD* table)
{

   EdbgOutputDebugString( " exception detected.\n\r" );
   SaveRegisterInstance( table );
#ifdef BOOT_MONITOR
   FwMonitor( table, COMMON_EXCEPTION );
#endif

}

/*
**  TLB exception
*/
void __cdecl TLBExceptionHandler(DWORD* table)
{
   EdbgOutputDebugString("\n\rTLB miss");
   UnHandledException(table);
}

/*
**  XTLB exception
*/
void __cdecl XTLBExceptionHandler(DWORD* table)
{
   EdbgOutputDebugString("\n\rXTLB miss");
   UnHandledException(table);
}

/*
**  Cache Error exception
*/
void __cdecl CacheErrorExceptionHandler(DWORD* table)
{
   EdbgOutputDebugString("\n\rXTLB miss");
   UnHandledException(table);
}

/*
**  TLB modification exception
*/
void __cdecl TLBModificationException(DWORD* table)
{
   EdbgOutputDebugString("\n\rTLB modification");
   UnHandledException(table);
}


/*
**  TLB refill (load) exception
*/
void __cdecl TLBRefillLoadException(DWORD* table)
{
   EdbgOutputDebugString("\n\rTLB refill (Load)");
   UnHandledException(table);
}


/*
**  TLB refill (store) exception
*/
void __cdecl TLBRefillStoreException(DWORD* table)
{
   EdbgOutputDebugString("\n\rTLB refill (store)");
   UnHandledException(table);
}


/*
**  Address error (load) exception
*/
void __cdecl AddressErrorLoadException(DWORD* table)
{
   EdbgOutputDebugString("\n\rAddress error (load)");
   UnHandledException(table);
}


/*
**  Address error (store) exception
*/
void __cdecl AddressErrorStoreException(DWORD* table)
{
    EdbgOutputDebugString("\n\rAddress error (store)");
    UnHandledException(table);
}


/*
**  Bus error (load) exception
*/
void __cdecl BusErrorLoadException(DWORD* table)
{
   EdbgOutputDebugString("\n\rBus error (load)");
   UnHandledException(table);
}


/*
**  Bus error (store) exception
*/
void __cdecl BusErrorStoreException(DWORD* table)
{
    EdbgOutputDebugString("\n\rBus error (store)");
    UnHandledException(table);
}


/*
**  System call exception
*/
INT __cdecl SysCallException(DWORD* table,DWORD function,DWORD param1,DWORD param2)
{

#if 0
    AddEPC();

    switch (function) {

        case SYSTEM_CALL_ADD_IRQ:
            if ( param1 < N_INTERRUPTS ) {
                //EnableInterrupt((BYTE)(param1), (void*)(param2));
                //EnableExtInt();
            return 1;
            }
            break;

        case SYSTEM_CALL_DEL_IRQ:
            if ( param1 < N_INTERRUPTS ) {
                //DisableInterrupt((BYTE)(param1));
                return 1;
            }
            break;

    }
#endif
	EdbgOutputDebugString("\n\rSysCall Exception");
	UnHandledException(table);

    return 0;

}


/*
**  Break point exception
*/
void __cdecl BreakPointException(DWORD* table)
{
   EdbgOutputDebugString("\n\rBreak point");
   UnHandledException(table);
}


/*
**  Reserved instruction exception
*/
void __cdecl ReservedInstructionException(DWORD* table)
{
   EdbgOutputDebugString("\n\rReserved instruction");
   UnHandledException(table);
}


/*
**  Coprocessor unusable exception
*/
void __cdecl CoprocessorUnusableException(DWORD* table)
{
   EdbgOutputDebugString("\n\rCoprocessor unusable");
   UnHandledException(table);
}


/*
**  Arithmetic overflow exception
*/
void __cdecl ArithmeticOverflowException(DWORD* table)
{
   EdbgOutputDebugString("\n\rArithmetic overflow");
   UnHandledException(table);
}


/*
**  Trap exception
*/
void __cdecl TrapException(DWORD* table)
{
   EdbgOutputDebugString("\n\rTrap");
   UnHandledException(table);
}


/*
**  Reserved exception
*/
void __cdecl ReservedException(DWORD* table)
{
   EdbgOutputDebugString("\n\rReserved");
   UnHandledException(table);
}


/*
**  Floating point exception
*/
void __cdecl FloatingPointException(DWORD* table)
{
   EdbgOutputDebugString("\n\rFloating point");
   UnHandledException(table);
}


/*
**  Watch exception
*/
void __cdecl WatchException(DWORD* table)
{
   EdbgOutputDebugString("\n\rWatch");
   UnHandledException(table);
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?