Revision 2be0071f target-ppc/cpu.h

b/target-ppc/cpu.h
924 924

  
925 925
/*****************************************************************************/
926 926
/* Exceptions */
927
enum {
928
    EXCP_NONE          = -1,
929
    /* PowerPC hardware exceptions : exception vector / 0x100 */
930
    EXCP_RESET         = 0x01, /* System reset                     */
931
    EXCP_MACHINE_CHECK = 0x02, /* Machine check exception          */
932
    EXCP_DSI           = 0x03, /* Impossible memory access         */
933
    EXCP_ISI           = 0x04, /* Impossible instruction fetch     */
934
    EXCP_EXTERNAL      = 0x05, /* External interruption            */
935
    EXCP_ALIGN         = 0x06, /* Alignment exception              */
936
    EXCP_PROGRAM       = 0x07, /* Program exception                */
937
    EXCP_NO_FP         = 0x08, /* No floating point                */
938
    EXCP_DECR          = 0x09, /* Decrementer exception            */
939
    EXCP_RESA          = 0x0A, /* Implementation specific          */
940
    EXCP_RESB          = 0x0B, /* Implementation specific          */
941
    EXCP_SYSCALL       = 0x0C, /* System call                      */
942
    EXCP_TRACE         = 0x0D, /* Trace exception (optional)       */
943
    EXCP_FP_ASSIST     = 0x0E, /* Floating-point assist (optional) */
944
    /* MPC740/745/750 & IBM 750 */
945
    EXCP_PERF          = 0x0F,  /* Performance monitor              */
946
    EXCP_IABR          = 0x13,  /* Instruction address breakpoint   */
947
    EXCP_SMI           = 0x14,  /* System management interrupt      */
948
    EXCP_THRM          = 0x15,  /* Thermal management interrupt     */
949
    /* MPC755 */
950
    EXCP_TLBMISS       = 0x10,  /* Instruction TLB miss             */
951
    EXCP_TLBMISS_DL    = 0x11,  /* Data TLB miss for load           */
952
    EXCP_TLBMISS_DS    = 0x12,  /* Data TLB miss for store          */
953
    EXCP_PPC_MAX       = 0x16,
954
    /* Qemu exception */
955
    EXCP_OFCALL        = 0x20,  /* Call open-firmware emulator      */
956
    EXCP_RTASCALL      = 0x21,  /* Call RTAS emulator               */
957
    /* Special cases where we want to stop translation */
958
    EXCP_MTMSR         = 0x104, /* mtmsr instruction:               */
927
#define EXCP_NONE          -1
928
/* PowerPC hardware exceptions : exception vectors defined in PowerPC book 3 */
929
#define EXCP_RESET         0x0100 /* System reset                            */
930
#define EXCP_MACHINE_CHECK 0x0200 /* Machine check exception                 */
931
#define EXCP_DSI           0x0300 /* Data storage exception                  */
932
#define EXCP_DSEG          0x0380 /* Data segment exception                  */
933
#define EXCP_ISI           0x0400 /* Instruction storage exception           */
934
#define EXCP_ISEG          0x0480 /* Instruction segment exception           */
935
#define EXCP_EXTERNAL      0x0500 /* External interruption                   */
936
#define EXCP_ALIGN         0x0600 /* Alignment exception                     */
937
#define EXCP_PROGRAM       0x0700 /* Program exception                       */
938
#define EXCP_NO_FP         0x0800 /* Floating point unavailable exception    */
939
#define EXCP_DECR          0x0900 /* Decrementer exception                   */
940
#define EXCP_HDECR         0x0980 /* Hypervisor decrementer exception        */
941
#define EXCP_SYSCALL       0x0C00 /* System call                             */
942
#define EXCP_TRACE         0x0D00 /* Trace exception                         */
943
#define EXCP_PERF          0x0F00 /* Performance monitor exception           */
944
/* Exceptions defined in PowerPC 32 bits programming environment manual      */
945
#define EXCP_FP_ASSIST     0x0E00 /* Floating-point assist                   */
946
/* Implementation specific exceptions                                        */
947
/* 40x exceptions                                                            */
948
#define EXCP_40x_PIT       0x1000 /* Programmable interval timer interrupt   */
949
#define EXCP_40x_FIT       0x1010 /* Fixed interval timer interrupt          */
950
#define EXCP_40x_WATCHDOG  0x1020 /* Watchdog timer exception                */
951
#define EXCP_40x_DTLBMISS  0x1100 /* Data TLB miss exception                 */
952
#define EXCP_40x_ITLBMISS  0x1200 /* Instruction TLB miss exception          */
953
#define EXCP_40x_DEBUG     0x2000 /* Debug exception                         */
954
/* 405 specific exceptions                                                   */
955
#define EXCP_405_APU       0x0F20 /* APU unavailable exception               */
956
/* TLB assist exceptions (602/603)                                           */
957
#define EXCP_I_TLBMISS     0x1000 /* Instruction TLB miss                    */
958
#define EXCP_DL_TLBMISS    0x1100 /* Data load TLB miss                      */
959
#define EXCP_DS_TLBMISS    0x1200 /* Data store TLB miss                     */
960
/* Breakpoint exceptions (602/603/604/620/740/745/750/755...)                */
961
#define EXCP_IABR          0x1300 /* Instruction address breakpoint          */
962
#define EXCP_SMI           0x1400 /* System management interrupt             */
963
/* Altivec related exceptions                                                */
964
#define EXCP_VPU           0x0F20 /* VPU unavailable exception               */
965
/* 601 specific exceptions                                                   */
966
#define EXCP_601_IO        0x0600 /* IO error exception                      */
967
#define EXCP_601_RUNM      0x2000 /* Run mode exception                      */
968
/* 602 specific exceptions                                                   */
969
#define EXCP_602_WATCHDOG  0x1500 /* Watchdog exception                      */
970
#define EXCP_602_EMUL      0x1600 /* Emulation trap exception                */
971
/* G2 specific exceptions                                                    */
972
#define EXCP_G2_CRIT       0x0A00 /* Critical interrupt                      */
973
/* MPC740/745/750 & IBM 750 specific exceptions                              */
974
#define EXCP_THRM          0x1700 /* Thermal management interrupt            */
975
/* 74xx specific exceptions                                                  */
976
#define EXCP_74xx_VPUA     0x1600 /* VPU assist exception                    */
977
/* 970FX specific exceptions                                                 */
978
#define EXCP_970_SOFTP     0x1500 /* Soft patch exception                    */
979
#define EXCP_970_MAINT     0x1600 /* Maintenance exception                   */
980
#define EXCP_970_THRM      0x1800 /* Thermal exception                       */
981
#define EXCP_970_VPUA      0x1700 /* VPU assist exception                    */
982
/* End of exception vectors area                                             */
983
#define EXCP_PPC_MAX       0x4000
984
/* Qemu exceptions: special cases we want to stop translation                */
985
#define EXCP_MTMSR         0x11000 /* mtmsr instruction:                     */
959 986
                                /* may change privilege level       */
960
    EXCP_BRANCH        = 0x108, /* branch instruction               */
961
    EXCP_RFI           = 0x10C, /* return from interrupt            */
962
    EXCP_SYSCALL_USER  = 0x110, /* System call in user mode only    */
963
};
987
#define EXCP_BRANCH        0x11001 /* branch instruction                     */
988
#define EXCP_SYSCALL_USER  0x12000 /* System call in user mode only          */
989
#define EXCP_INTERRUPT_CRITICAL 0x13000 /* critical IRQ                      */
990

  
964 991
/* Error codes */
965 992
enum {
966
    /* Exception subtypes for EXCP_DSI                              */
967
    EXCP_DSI_TRANSLATE = 0x01,  /* Data address can't be translated */
968
    EXCP_DSI_NOTSUP    = 0x02,  /* Access type not supported        */
969
    EXCP_DSI_PROT      = 0x03,  /* Memory protection violation      */
970
    EXCP_DSI_EXTERNAL  = 0x04,  /* External access disabled         */
971
    EXCP_DSI_DABR      = 0x05,  /* Data address breakpoint          */
972
    /* flags for EXCP_DSI */
973
    EXCP_DSI_DIRECT    = 0x10,
974
    EXCP_DSI_STORE     = 0x20,
975
    EXCP_DSI_ECXW      = 0x40,
976
    /* Exception subtypes for EXCP_ISI                              */
977
    EXCP_ISI_TRANSLATE = 0x01,  /* Code address can't be translated */
978
    EXCP_ISI_NOEXEC    = 0x02,  /* Try to fetch from a data segment */
979
    EXCP_ISI_GUARD     = 0x03,  /* Fetch from guarded memory        */
980
    EXCP_ISI_PROT      = 0x04,  /* Memory protection violation      */
981
    EXCP_ISI_DIRECT    = 0x05,  /* Trying to fetch from             *
982
				 * a direct store segment           */
983 993
    /* Exception subtypes for EXCP_ALIGN                            */
984 994
    EXCP_ALIGN_FP      = 0x01,  /* FP alignment exception           */
985 995
    EXCP_ALIGN_LST     = 0x02,  /* Unaligned mult/extern load/store */

Also available in: Unified diff