PS2SDK
PS2 Homebrew Libraries
Loading...
Searching...
No Matches
excepman.h
Go to the documentation of this file.
1/*
2# _____ ___ ____ ___ ____
3# ____| | ____| | | |____|
4# | ___| |____ ___| ____| | \ PS2DEV Open Source Project.
5#-----------------------------------------------------------------------
6# Copyright 2001-2004, ps2dev - http://www.ps2dev.org
7# Licenced under Academic Free License version 2.0
8# Review ps2sdk README & LICENSE files for further details.
9*/
10
16#ifndef __EXCEPMAN_H__
17#define __EXCEPMAN_H__
18
19#include <types.h>
20#include <irx.h>
21
22#ifdef __cplusplus
23extern "C" {
24#endif
25
26/* From any r3000's cop0 documentation */
28#define IOP_EXCEPTION_INT 0
30#define IOP_EXCEPTION_MOD 1
32#define IOP_EXCEPTION_TLBL 2
34#define IOP_EXCEPTION_TLBS 3
36#define IOP_EXCEPTION_ADEL 4
38#define IOP_EXCEPTION_ADES 5
40#define IOP_EXCEPTION_IBE 6
42#define IOP_EXCEPTION_DBE 7
44#define IOP_EXCEPTION_SYS 8
46#define IOP_EXCEPTION_BP 9
48#define IOP_EXCEPTION_RI 10
50#define IOP_EXCEPTION_CPU 11
52#define IOP_EXCEPTION_OVF 12
54#define IOP_EXCEPTION_R13 13
56#define IOP_EXCEPTION_R14 14
58#define IOP_EXCEPTION_HDB 15
59
61{
62 struct _exception_handler_struct_t* next;
63 int info;
64 u32 funccode[];
66
68
69void* GetExHandlersTable();
70
72int RegisterExceptionHandler(int exception, exception_handler_t handler);
73int RegisterPriorityExceptionHandler(int exception, int priority, exception_handler_t handler);
74int RegisterDefaultExceptionHandler(exception_handler_t handler);
75int ReleaseExceptionHandler(int exception, exception_handler_t handler);
76int ReleaseDefaultExceptionHandler(exception_handler_t handler);
77
78#define excepman_IMPORTS_start DECLARE_IMPORT_TABLE(excepman, 1, 2)
79#define excepman_IMPORTS_end END_IMPORT_TABLE
80
81#define I_GetExHandlersTable DECLARE_IMPORT(3, GetExHandlersTable)
82#define I_RegisterExceptionHandler DECLARE_IMPORT(4, RegisterExceptionHandler)
83#define I_RegisterPriorityExceptionHandler DECLARE_IMPORT(5, RegisterPriorityExceptionHandler)
84#define I_RegisterDefaultExceptionHandler DECLARE_IMPORT(6, RegisterDefaultExceptionHandler)
85#define I_ReleaseExceptionHandler DECLARE_IMPORT(7, ReleaseExceptionHandler)
86#define I_ReleaseDefaultExceptionHandler DECLARE_IMPORT(8, ReleaseDefaultExceptionHandler)
87
88#ifdef __cplusplus
89}
90#endif
91
92#endif /* __EXCEPMAN_H__ */
int RegisterExceptionHandler(int exception, exception_handler_t handler)
Definition excepman.c:70