[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 21/68] kern: new header file exception.h
From: |
Marin Ramesa |
Subject: |
[PATCH 21/68] kern: new header file exception.h |
Date: |
Fri, 29 Nov 2013 22:53:46 +0100 |
* Makefrag.am: Include kern/exception.h.
* i386/i386/trap.c: Include kern/exception.h.
(exception, thread_exception_return): Remove forward declarations.
* kern/exception.c: Include kern/exception.h.
(exception, exception_try_task, exception_no_server, exception_raise,
exception_parse_reply, exception_raise_continue, exception_raise_continue_slow,
exception_raise_continue_fast): Remove forward declarations.
* kern/exception.h: New file.
Add copyright.
[_KERN_EXCEPTION_H_]: Add ifndef.
(exception, exception_try_task, exception_no_server, exception_raise,
exception_parse_reply, exception_raise_continue, exception_raise_continue_slow,
exception_raise_continue_fast): Add prototypes.
---
Makefrag.am | 1 +
i386/i386/trap.c | 4 +---
kern/exception.c | 13 +-----------
kern/exception.h | 63 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
4 files changed, 66 insertions(+), 15 deletions(-)
create mode 100644 kern/exception.h
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..8700ee8
--- /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_ */
--
1.8.1.4
- [PATCH 14/68] device/device_init.c: remove forward declarations, (continued)
- [PATCH 14/68] device/device_init.c: remove forward declarations, Marin Ramesa, 2013/11/29
- [PATCH 15/68] i386/i386/db_trace.c: remove forward declaration, Marin Ramesa, 2013/11/29
- [PATCH 16/68] i386/i386/fpu.c, trap.c: remove forward declarations, Marin Ramesa, 2013/11/29
- [PATCH 17/68] i386/i386/fpu.c: remove (#if 1), Marin Ramesa, 2013/11/29
- [PATCH 18/68] i386/i386/io_perm.c: remove forward declaration, Marin Ramesa, 2013/11/29
- [PATCH 19/68] i386/i386/ldt.c: remove useless forward declaration without definition, Marin Ramesa, 2013/11/29
[PATCH 21/68] kern: new header file exception.h,
Marin Ramesa <=
[PATCH 20/68] i386/i386/pcb.c: remove forward declarations, Marin Ramesa, 2013/11/29
[PATCH 22/68] kern/exception.c: remove forward declarations, Marin Ramesa, 2013/11/29
[PATCH 23/68] i386/i386at/autoconf.c, com.c, lpr.c: remove forward declarations, Marin Ramesa, 2013/11/29
[PATCH 25/68] i386/i386at/kd.c: remove forward declarations, Marin Ramesa, 2013/11/29
[PATCH 24/68] i386/i386at/conf.c: remove forward declarations, Marin Ramesa, 2013/11/29
[PATCH 26/68] i386/i386at/kd_event.c: remove forward declarations, Marin Ramesa, 2013/11/29
[PATCH 27/68] i386/i386at/kd_mouse.c: remove forward declarations, Marin Ramesa, 2013/11/29
[PATCH 28/68] i386/i386at: remove forward declarations, Marin Ramesa, 2013/11/29
[PATCH 29/68] i386/i386at/pic_isa.c: remove forward declaration, Marin Ramesa, 2013/11/29
[PATCH 30/68] i386/intel/pmap.c: remove forward declarations, Marin Ramesa, 2013/11/29