summaryrefslogtreecommitdiff
path: root/i386
diff options
context:
space:
mode:
authorThomas Schwinge <thomas@schwinge.name>2011-09-06 10:30:00 +0200
committerThomas Schwinge <thomas@schwinge.name>2011-09-06 10:30:00 +0200
commitbdd9501d71dfb3df5826f74c73a152031f5c2460 (patch)
tree5c2d5ff40a5c5f9b5b84034e878024bd86a72f82 /i386
parent810152088a978ecbc1dda2a345bf236c32c941c7 (diff)
Move i386/i386/locore.S declarations.
* i386/i386/trap.c (recover_table, recover_table_end, retry_table) (retry_table_end): Move declarations to... * i386/i386/locore.h: ... here.
Diffstat (limited to 'i386')
-rw-r--r--i386/i386/locore.h34
-rw-r--r--i386/i386/trap.c21
2 files changed, 27 insertions, 28 deletions
diff --git a/i386/i386/locore.h b/i386/i386/locore.h
index b649726..bfd1317 100644
--- a/i386/i386/locore.h
+++ b/i386/i386/locore.h
@@ -1,6 +1,5 @@
/*
- * Header file for printf type functions.
- * Copyright (C) 2006 Free Software Foundation.
+ * Copyright (C) 2006, 2011 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
@@ -24,18 +23,37 @@
#include <kern/sched_prim.h>
-extern int copyin (const void *userbuf, void *kernelbuf, size_t cn);
+/*
+ * Fault recovery in copyin/copyout routines.
+ */
+struct recovery {
+ int fault_addr;
+ int recover_addr;
+};
-extern int copyinmsg (const void *userbuf, void *kernelbuf, size_t cn);
+extern struct recovery recover_table[];
+extern struct recovery recover_table_end[];
-extern int copyout (const void *kernelbuf, void *userbuf, size_t cn);
+/*
+ * Recovery from Successful fault in copyout does not
+ * return directly - it retries the pte check, since
+ * the 386 ignores write protection in kernel mode.
+ */
+extern struct recovery retry_table[];
+extern struct recovery retry_table_end[];
+
+
+extern int call_continuation (continuation_t continuation);
+extern int discover_x86_cpu_type (void);
+
+extern int copyin (const void *userbuf, void *kernelbuf, size_t cn);
+extern int copyinmsg (const void *userbuf, void *kernelbuf, size_t cn);
+extern int copyout (const void *kernelbuf, void *userbuf, size_t cn);
extern int copyoutmsg (const void *kernelbuf, void *userbuf, size_t cn);
extern int inst_fetch (int eip, int cs);
-extern int call_continuation (continuation_t continuation);
-
extern void cpu_shutdown (void);
extern unsigned int cpu_features[1];
@@ -72,7 +90,5 @@ extern unsigned int cpu_features[1];
#define CPU_HAS_FEATURE(feature) (cpu_features[(feature) / 32] & (1 << ((feature) % 32)))
-extern int discover_x86_cpu_type (void);
-
#endif /* _MACHINE__LOCORE_H_ */
diff --git a/i386/i386/trap.c b/i386/i386/trap.c
index 90d4c31..01c83f5 100644
--- a/i386/i386/trap.c
+++ b/i386/i386/trap.c
@@ -123,25 +123,6 @@ user_page_fault_continue(kr)
/*NOTREACHED*/
}
-/*
- * Fault recovery in copyin/copyout routines.
- */
-struct recovery {
- int fault_addr;
- int recover_addr;
-};
-
-extern struct recovery recover_table[];
-extern struct recovery recover_table_end[];
-
-/*
- * Recovery from Successful fault in copyout does not
- * return directly - it retries the pte check, since
- * the 386 ignores write protection in kernel mode.
- */
-extern struct recovery retry_table[];
-extern struct recovery retry_table_end[];
-
static char *trap_type[] = {
"Divide error",
@@ -296,6 +277,7 @@ dump_ss(regs);
*/
register struct recovery *rp;
+ /* Linear searching; but the list is small enough. */
for (rp = retry_table; rp < retry_table_end; rp++) {
if (regs->eip == rp->fault_addr) {
regs->eip = rp->recover_addr;
@@ -312,6 +294,7 @@ dump_ss(regs);
{
register struct recovery *rp;
+ /* Linear searching; but the list is small enough. */
for (rp = recover_table;
rp < recover_table_end;
rp++) {