From bdd9501d71dfb3df5826f74c73a152031f5c2460 Mon Sep 17 00:00:00 2001 From: Thomas Schwinge Date: Tue, 6 Sep 2011 10:30:00 +0200 Subject: 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. --- i386/i386/locore.h | 34 +++++++++++++++++++++++++--------- i386/i386/trap.c | 21 ++------------------- 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 -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++) { -- cgit v1.2.3 From 8c06145f67e2067e49d10f9d4f8d16b383d3d5da Mon Sep 17 00:00:00 2001 From: Thomas Schwinge Date: Tue, 6 Sep 2011 10:34:11 +0200 Subject: * i386/i386/pcb.h (stack_attach): Parameterize the continuation parameter's parameter list. * i386/i386/pcb.c (stack_attach): Likewise. --- i386/i386/pcb.c | 2 +- i386/i386/pcb.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/i386/i386/pcb.c b/i386/i386/pcb.c index 7f2b3c8..fffa92a 100644 --- a/i386/i386/pcb.c +++ b/i386/i386/pcb.c @@ -78,7 +78,7 @@ vm_offset_t kernel_stack[NCPUS]; /* top of active_stack */ void stack_attach(thread, stack, continuation) register thread_t thread; register vm_offset_t stack; - void (*continuation)(); + void (*continuation)(thread_t); { counter(if (++c_stacks_current > c_stacks_max) c_stacks_max = c_stacks_current); diff --git a/i386/i386/pcb.h b/i386/i386/pcb.h index f8671a2..21bdfd9 100644 --- a/i386/i386/pcb.h +++ b/i386/i386/pcb.h @@ -64,7 +64,7 @@ extern void load_context (thread_t new); extern void stack_attach ( thread_t thread, vm_offset_t stack, - void (*continuation)()); + void (*continuation)(thread_t)); extern vm_offset_t stack_detach (thread_t thread); -- cgit v1.2.3 From 3f5fd3de61dbca8c4b081acc6ffc36ab59486a2c Mon Sep 17 00:00:00 2001 From: Thomas Schwinge Date: Tue, 6 Sep 2011 13:12:50 +0200 Subject: * .gitignore: Tighten some rules, and distribute others to... * doc/.gitignore: ... here; * i386/i386/.gitignore: ... here; * tests/.gitignore: ..., and here. --- .gitignore | 59 ++++++++++++++++++++++++++-------------------------- doc/.gitignore | 4 ++++ i386/i386/.gitignore | 1 + tests/.gitignore | 1 + 4 files changed, 36 insertions(+), 29 deletions(-) create mode 100644 doc/.gitignore create mode 100644 i386/i386/.gitignore create mode 100644 tests/.gitignore diff --git a/.gitignore b/.gitignore index fe5d53a..4488bc2 100644 --- a/.gitignore +++ b/.gitignore @@ -1,38 +1,39 @@ -.deps +*~ + +.deps/ .dirstamp -.Tpo *.o *.a -*.defs.* +/gnumach +/gnumach-undef +/gnumach-undef-bad +/gnumach.msgids + +# Makerules.am +*.gz +*.stripped + +# Makerules.mig.am *.user.* *.server.* -*.info -*.info-* + autom4te.cache/ build-aux/ -mach/ -INSTALL -Makefile -Makefile.in -aclocal.m4 -config.h* -config.log -config.status -config.status.orig -configure -gnumach -gnumach-undef -gnumach-undef-bad -gnumach.msgids -stamp-h1 -stamp-vti -version.c -version.texi - -i386/i386/i386asm.h -tests/test-mbchk +/INSTALL +/Makefile +/Makefile.in +/aclocal.m4 +/config.h +/config.h.in +/config.log +/config.status +/config.status.orig +/configure +/stamp-h1 +/version.c # Ignore arch symlinks -machine -linux/src/include/asm -linux/dev/include/asm +/machine +/mach/machine +/linux/src/include/asm +/linux/dev/include/asm diff --git a/doc/.gitignore b/doc/.gitignore new file mode 100644 index 0000000..829355b --- /dev/null +++ b/doc/.gitignore @@ -0,0 +1,4 @@ +/*.info +/*.info-* +/stamp-vti +/version.texi diff --git a/i386/i386/.gitignore b/i386/i386/.gitignore new file mode 100644 index 0000000..4520a2a --- /dev/null +++ b/i386/i386/.gitignore @@ -0,0 +1 @@ +/i386asm.h diff --git a/tests/.gitignore b/tests/.gitignore new file mode 100644 index 0000000..6e86af1 --- /dev/null +++ b/tests/.gitignore @@ -0,0 +1 @@ +/test-mbchk -- cgit v1.2.3