1 #ifndef POWERUP_PPCLIB_PPC_H 2 #define POWERUP_PPCLIB_PPC_H 3 4 #include <utility/tagitem.h> 5 6 /* PPCGetInfo() Tags */ 7 8 #define PPCINFOTAG_Dummy (TAG_USER + 0x1f000) 9 10 /* Version of the CPU 11 * (Get) 12 */ 13 #define PPCINFOTAG_CPU (PPCINFOTAG_Dummy + 0x1) 14 15 /* CPU Count 16 * (Get) 17 */ 18 #define PPCINFOTAG_CPUCOUNT (PPCINFOTAG_Dummy + 0x2) 19 20 /* Clock of the CPU 21 * (Get) 22 */ 23 #define PPCINFOTAG_CPUCLOCK (PPCINFOTAG_Dummy + 0x3) 24 25 /* Revision of the CPU 26 * (Get) 27 */ 28 #define PPCINFOTAG_CPUREV (PPCINFOTAG_Dummy + 0x4) 29 30 /* Default ExceptionHook 31 * If you want to install an ExceptionHook 32 * to catch all exceptions by a debugger for example 33 * (Get/Set) 34 */ 35 #define PPCINFOTAG_EXCEPTIONHOOK (PPCINFOTAG_Dummy + 0x5) 36 37 /* Add PPCCreateTask Hook (V45) 38 * If you want to be notified when a new PPC Task 39 * is created. Usable for a debugger or a Task Viewer. 40 * 41 * BOOL CallHookPkt(YourHookHook, TaskObject, TaskHookMsg); 42 * 43 * If you want to install a new TrapHandler you can do it 44 * now in your Hook function. Or tell the Task to stop at the 45 * first instruction. 46 * The PPC Task is initiated after all Hook functions complete. 47 * The result defines if potential hooks should not be called. 48 * If you return TRUE no other hooks are called. 49 * (Set) 50 */ 51 #define PPCINFOTAG_TASKHOOK (PPCINFOTAG_Dummy + 0x6) 52 53 /* Remove a TaskHook (V45) 54 * (Set) 55 */ 56 #define PPCINFOTAG_REMTASKHOOK (PPCINFOTAG_Dummy + 0x7) 57 58 /* PLL Devider of the CPU (V45) 59 * (Get) 60 */ 61 #define PPCINFOTAG_CPUPLL (PPCINFOTAG_Dummy + 0x8) 62 63 64 /* BusClock of the CPU (V47) 65 * (Get) 66 */ 67 #define PPCINFOTAG_CPUBUSCLOCK (PPCINFOTAG_Dummy + 0x9) 68 69 70 struct TaskHookMsg_Create 71 { 72 ULONG MethodID; 73 ULONG Version; 74 void *ElfObject; 75 struct TagItem *Tags; 76 }; 77 78 struct TaskHookMsg_Delete 79 { 80 ULONG MethodID; 81 ULONG Version; 82 }; 83 84 struct TaskHookMsg_Get 85 { 86 ULONG MethodID; 87 ULONG Version; 88 struct TagItem *Tags; 89 }; 90 91 struct TaskHookMsg_Set 92 { 93 ULONG MethodID; 94 ULONG Version; 95 struct TagItem *Tags; 96 }; 97 98 #define PPCTASKHOOKMETHOD_CREATE 0 99 #define PPCTASKHOOKMETHOD_DELETE 1 100 #define PPCTASKHOOKMETHOD_GET 2 101 #define PPCTASKHOOKMETHOD_SET 3 102 103 104 /* Current known PowerPC CPU versions */ 105 #define CPU_603 3 106 #define CPU_604 4 107 #define CPU_602 5 108 #define CPU_603e 6 109 #define CPU_603p 7 110 #define CPU_604e 9 111 112 #endif