diff options
-rw-r--r-- | Makefrag.am | 1 | ||||
-rw-r--r-- | i386/i386/trap.c | 4 | ||||
-rw-r--r-- | kern/exception.c | 13 | ||||
-rw-r--r-- | kern/exception.h | 63 |
4 files changed, 66 insertions, 15 deletions
diff --git a/Makefrag.am b/Makefrag.am index 9348147..2e08df1 100644 --- a/Makefrag.am +++ b/Makefrag.am @@ -143,6 +143,7 @@ libkernel_a_SOURCES += \ kern/eventcount.c \ kern/eventcount.h \ kern/exception.c \ + kern/exception.h \ kern/host.c \ kern/host.h \ kern/ipc_host.c \ diff --git a/i386/i386/trap.c b/i386/i386/trap.c index 5571a1f..e104e12 100644 --- a/i386/i386/trap.c +++ b/i386/i386/trap.c @@ -55,6 +55,7 @@ #include <kern/task.h> #include <kern/sched.h> #include <kern/sched_prim.h> +#include <kern/exception.h> #if MACH_KDB #include <ddb/db_run.h> @@ -63,9 +64,6 @@ #include "debug.h" -extern void exception() __attribute__ ((noreturn)); -extern void thread_exception_return() __attribute__ ((noreturn)); - #if MACH_KDB boolean_t debug_all_traps_with_kdb = FALSE; extern struct db_watchpoint *db_watchpoint_list; diff --git a/kern/exception.c b/kern/exception.c index 112511e..d73b196 100644 --- a/kern/exception.c +++ b/kern/exception.c @@ -47,20 +47,9 @@ #include <kern/processor.h> #include <kern/sched.h> #include <kern/sched_prim.h> +#include <kern/exception.h> #include <mach/machine/vm_types.h> - - -extern void exception() __attribute__ ((noreturn)); -extern void exception_try_task() __attribute__ ((noreturn)); -extern void exception_no_server() __attribute__ ((noreturn)); - -extern void exception_raise() __attribute__ ((noreturn)); -extern kern_return_t exception_parse_reply(); -extern void exception_raise_continue() __attribute__ ((noreturn)); -extern void exception_raise_continue_slow() __attribute__ ((noreturn)); -extern void exception_raise_continue_fast() __attribute__ ((noreturn)); - #if MACH_KDB extern void thread_kdb_return(); extern void db_printf(); diff --git a/kern/exception.h b/kern/exception.h new file mode 100644 index 0000000..8d4d79b --- /dev/null +++ b/kern/exception.h @@ -0,0 +1,63 @@ +/* + * Copyright (c) 2013 Free Software Foundation. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +#ifndef _KERN_EXCEPTION_H_ +#define _KERN_EXCEPTION_H_ + +extern void +exception( + integer_t _exception, + integer_t code, + integer_t subcode) __attribute__ ((noreturn)); + +extern void +exception_try_task( + integer_t _exception, + integer_t code, + integer_t subcode) __attribute__ ((noreturn)); + +extern void +exception_no_server(void) __attribute__ ((noreturn)); + +extern void +exception_raise( + ipc_port_t dest_port, + ipc_port_t thread_port, + ipc_port_t task_port, + integer_t _exception, + integer_t code, + integer_t subcode) __attribute__ ((noreturn)); + +extern kern_return_t +exception_parse_reply(ipc_kmsg_t kmsg); + +extern void +exception_raise_continue(void) __attribute__ ((noreturn)); + +extern void +exception_raise_continue_slow( + mach_msg_return_t mr, + ipc_kmsg_t kmsg, + mach_port_seqno_t seqno) __attribute__ ((noreturn)); + +extern void +exception_raise_continue_fast( + ipc_port_t reply_port, + ipc_kmsg_t kmsg) __attribute__ ((noreturn)); + +#endif /* _KERN_EXCEPTION_H_ */ |