diff options
author | phk <phk@FreeBSD.org> | 1995-12-10 13:36:34 +0000 |
---|---|---|
committer | phk <phk@FreeBSD.org> | 1995-12-10 13:36:34 +0000 |
commit | a17ab54434d8929c8f77e0a47e34d7cc4c4a9b39 (patch) | |
tree | 30d1c1ccea5c33f75ffff130af2df8a37c20c7eb | |
parent | 924d3d88e6ab061898ba05701a1123ae3320d01c (diff) | |
download | FreeBSD-src-a17ab54434d8929c8f77e0a47e34d7cc4c4a9b39.zip FreeBSD-src-a17ab54434d8929c8f77e0a47e34d7cc4c4a9b39.tar.gz |
Staticize and cleanup.
remove a TON of #includes from machdep.
-rw-r--r-- | sys/amd64/amd64/autoconf.c | 5 | ||||
-rw-r--r-- | sys/amd64/amd64/cpu_switch.S | 4 | ||||
-rw-r--r-- | sys/amd64/amd64/db_interface.c | 10 | ||||
-rw-r--r-- | sys/amd64/amd64/machdep.c | 108 | ||||
-rw-r--r-- | sys/amd64/amd64/pmap.c | 90 | ||||
-rw-r--r-- | sys/amd64/amd64/swtch.s | 4 | ||||
-rw-r--r-- | sys/amd64/amd64/sys_machdep.c | 12 | ||||
-rw-r--r-- | sys/amd64/amd64/vm_machdep.c | 45 | ||||
-rw-r--r-- | sys/i386/i386/autoconf.c | 5 | ||||
-rw-r--r-- | sys/i386/i386/db_interface.c | 10 | ||||
-rw-r--r-- | sys/i386/i386/machdep.c | 108 | ||||
-rw-r--r-- | sys/i386/i386/pmap.c | 90 | ||||
-rw-r--r-- | sys/i386/i386/procfs_machdep.c | 10 | ||||
-rw-r--r-- | sys/i386/i386/swtch.s | 4 | ||||
-rw-r--r-- | sys/i386/i386/sys_machdep.c | 12 | ||||
-rw-r--r-- | sys/i386/i386/userconfig.c | 8 | ||||
-rw-r--r-- | sys/i386/i386/vm_machdep.c | 45 |
17 files changed, 182 insertions, 388 deletions
diff --git a/sys/amd64/amd64/autoconf.c b/sys/amd64/amd64/autoconf.c index f9d3a29..9506751 100644 --- a/sys/amd64/amd64/autoconf.c +++ b/sys/amd64/amd64/autoconf.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * from: @(#)autoconf.c 7.1 (Berkeley) 5/9/91 - * $Id: autoconf.c,v 1.45 1995/12/06 09:04:44 peter Exp $ + * $Id: autoconf.c,v 1.46 1995/12/07 20:31:02 peter Exp $ */ /* @@ -88,6 +88,7 @@ static void configure __P((void *)); SYSINIT(configure, SI_SUB_CONFIGURE, SI_ORDER_FIRST, configure, NULL) +static int setdumpdev __P((dev_t dev)); static void setroot __P((void)); #ifdef MFS_ROOT @@ -260,7 +261,7 @@ configure(dummy) cold = 0; } -int +static int setdumpdev(dev) dev_t dev; { diff --git a/sys/amd64/amd64/cpu_switch.S b/sys/amd64/amd64/cpu_switch.S index 72dc2ad..ca0ed69 100644 --- a/sys/amd64/amd64/cpu_switch.S +++ b/sys/amd64/amd64/cpu_switch.S @@ -33,7 +33,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: swtch.s,v 1.21 1995/09/03 20:39:19 dyson Exp $ + * $Id: swtch.s,v 1.22 1995/12/09 20:40:41 phk Exp $ */ #include "npx.h" /* for NNPX */ @@ -66,8 +66,6 @@ _whichrtqs: .long 0 /* which realtime run queues have data */ _whichidqs: .long 0 /* which idletime run queues have data */ .globl _qs,_cnt,_panic - .comm _noproc,4 - .comm _runrun,4 .globl _want_resched _want_resched: .long 0 /* we need to re-run the scheduler */ diff --git a/sys/amd64/amd64/db_interface.c b/sys/amd64/amd64/db_interface.c index 7536c1c..dd42079 100644 --- a/sys/amd64/amd64/db_interface.c +++ b/sys/amd64/amd64/db_interface.c @@ -23,7 +23,7 @@ * any improvements or extensions that they make and grant Carnegie the * rights to redistribute these changes. * - * $Id: db_interface.c,v 1.15 1995/11/18 06:49:35 bde Exp $ + * $Id: db_interface.c,v 1.16 1995/12/07 12:45:29 davidg Exp $ */ /* @@ -47,10 +47,12 @@ #include <ddb/ddb.h> #include <setjmp.h> -int db_active = 0; +static int db_active = 0; db_regs_t ddb_regs; +static void kdbprinttrap __P((int type, int code)); + #if 0 /* * Received keyboard interrupt sequence. @@ -92,7 +94,7 @@ kdb_trap(type, code, regs) * %eip. */ if (cons_unavail) { - if (type = T_TRCTRAP) { + if (type == T_TRCTRAP) { regs->tf_eflags &= ~PSL_T; return (1); } @@ -165,7 +167,7 @@ kdb_trap(type, code, regs) /* * Print trap reason. */ -void +static void kdbprinttrap(type, code) int type, code; { diff --git a/sys/amd64/amd64/machdep.c b/sys/amd64/amd64/machdep.c index 06d236f..0c1c785 100644 --- a/sys/amd64/amd64/machdep.c +++ b/sys/amd64/amd64/machdep.c @@ -35,7 +35,7 @@ * SUCH DAMAGE. * * from: @(#)machdep.c 7.4 (Berkeley) 6/3/91 - * $Id: machdep.c,v 1.155 1995/12/07 12:45:32 davidg Exp $ + * $Id: machdep.c,v 1.156 1995/12/09 20:39:47 phk Exp $ */ #include "npx.h" @@ -94,30 +94,6 @@ #include <net/netisr.h> -/* XXX correctly declaring all the netisr's is painful. */ -#include <net/if.h> -#include <net/route.h> - -#include <netinet/in.h> -#include <netinet/in_systm.h> -#include <netinet/ip.h> -#include <netinet/if_ether.h> -#include <netinet/ip_var.h> - -#include <netns/ns.h> -#include <netns/ns_if.h> - -#include <netiso/iso.h> -#include <netiso/iso_var.h> - -#include <netccitt/dll.h> -#include <netccitt/x25.h> -#include <netccitt/pk.h> -#include <sys/socketvar.h> -#include <netccitt/pk_var.h> - -#include "ether.h" - #include <machine/cpu.h> #include <machine/npx.h> #include <machine/reg.h> @@ -135,12 +111,9 @@ #include <i386/isa/rtc.h> #include <machine/random.h> -extern void diediedie __P((void)); extern void init386 __P((int first)); extern int ptrace_set_pc __P((struct proc *p, unsigned int addr)); extern int ptrace_single_step __P((struct proc *p)); -extern int ptrace_getregs __P((struct proc *p, unsigned int *addr)); -extern int ptrace_setregs __P((struct proc *p, unsigned int *addr)); extern int ptrace_write_u __P((struct proc *p, vm_offset_t off, int data)); static void cpu_startup __P((void *)); @@ -151,7 +124,7 @@ static void identifycpu(void); char machine[] = "i386"; SYSCTL_STRING(_hw, HW_MACHINE, machine, CTLFLAG_RD, machine, 0, ""); -char cpu_model[128]; +static char cpu_model[128]; SYSCTL_STRING(_hw, HW_MODEL, model, CTLFLAG_RD, cpu_model, 0, ""); struct kern_devconf kdc_cpu0 = { @@ -207,10 +180,10 @@ sysctl_hw_usermem SYSCTL_HANDLER_ARGS SYSCTL_PROC(_hw, HW_USERMEM, usermem, CTLTYPE_INT|CTLFLAG_RD, 0, 0, sysctl_hw_usermem, "I", ""); -int boothowto = 0, bootverbose = 0, Maxmem = 0, badpages = 0; +int boothowto = 0, bootverbose = 0, Maxmem = 0; +static int badpages = 0; long dumplo; extern int bootdev; -int biosmem; vm_offset_t phys_avail[10]; @@ -219,12 +192,12 @@ vm_offset_t phys_avail[10]; int cpu_class; -void dumpsys __P((void)); -void setup_netisrs __P((struct linker_set *)); /* XXX declare elsewhere */ +static void dumpsys __P((void)); +static void setup_netisrs __P((struct linker_set *)); /* XXX declare elsewhere */ -vm_offset_t buffer_sva, buffer_eva; +static vm_offset_t buffer_sva, buffer_eva; vm_offset_t clean_sva, clean_eva; -vm_offset_t pager_sva, pager_eva; +static vm_offset_t pager_sva, pager_eva; extern struct linker_set netisr_set; #define offsetof(type, member) ((size_t)(&((type *)0)->member)) @@ -484,7 +457,7 @@ register_netisr(num, handler) return (0); } -void +static void setup_netisrs(ls) struct linker_set *ls; { @@ -497,7 +470,7 @@ setup_netisrs(ls) } } -struct cpu_nameclass i386_cpus[] = { +static struct cpu_nameclass i386_cpus[] = { { "Intel 80286", CPUCLASS_286 }, /* CPU_286 */ { "i386SX", CPUCLASS_386 }, /* CPU_386SX */ { "i386DX", CPUCLASS_386 }, /* CPU_386 */ @@ -872,17 +845,8 @@ sigreturn(p, uap, retval) return(EJUSTRETURN); } -/* - * a simple function to make the system panic (and dump a vmcore) - * in a predictable fashion - */ -void diediedie() -{ - panic("because you said to!"); -} - -int waittime = -1; -struct pcb dumppcb; +static int waittime = -1; +static struct pcb dumppcb; __dead void boot(howto) @@ -978,17 +942,25 @@ die: /* NOTREACHED */ } -unsigned long dumpmag = 0x8fca0101UL; /* magic number for savecore */ -int dumpsize = 0; /* also for savecore */ +/* + * Magic number for savecore + * + * exported (symorder) and used at least by savecore(8) + * + */ +u_long dumpmag = 0x8fca0101UL; + +static int dumpsize = 0; /* also for savecore */ -int dodump = 1; +static int dodump = 1; +SYSCTL_INT(_machdep, OID_AUTO, do_dump, CTLFLAG_RW, &dodump, 0, ""); /* * Doadump comes here after turning off memory management and * getting on the dump stack, either when called above, or by * the auto-restart code. */ -void +static void dumpsys() { @@ -1090,7 +1062,7 @@ union descriptor gdt[NGDT]; /* global descriptor table */ struct gate_descriptor idt[NIDT]; /* interrupt descriptor table */ union descriptor ldt[NLDT]; /* local descriptor table */ -struct i386tss tss, panic_tss; +static struct i386tss tss, panic_tss; extern struct user *proc0paddr; @@ -1197,7 +1169,7 @@ struct soft_segment_descriptor gdt_segs[] = { 1 /* limit granularity (byte/page units)*/ }, }; -struct soft_segment_descriptor ldt_segs[] = { +static struct soft_segment_descriptor ldt_segs[] = { /* Null Descriptor - overwritten by call gate */ { 0x0, /* segment base address */ 0x0, /* length - all address space */ @@ -1651,34 +1623,6 @@ ptrace_single_step(p) return (0); } -int -ptrace_getregs(p, addr) - struct proc *p; - unsigned int *addr; -{ - int error; - struct reg regs; - - error = fill_regs(p, ®s); - if (error) - return (error); - return (copyout(®s, addr, sizeof regs)); -} - -int -ptrace_setregs(p, addr) - struct proc *p; - unsigned int *addr; -{ - int error; - struct reg regs; - - error = copyin(addr, ®s, sizeof regs); - if (error) - return (error); - return (set_regs(p, ®s)); -} - int ptrace_write_u(p, off, data) struct proc *p; vm_offset_t off; diff --git a/sys/amd64/amd64/pmap.c b/sys/amd64/amd64/pmap.c index e89ef2d..3757f65 100644 --- a/sys/amd64/amd64/pmap.c +++ b/sys/amd64/amd64/pmap.c @@ -39,7 +39,7 @@ * SUCH DAMAGE. * * from: @(#)pmap.c 7.7 (Berkeley) 5/12/91 - * $Id: pmap.c,v 1.66 1995/12/03 18:35:28 bde Exp $ + * $Id: pmap.c,v 1.67 1995/12/07 12:45:36 davidg Exp $ */ /* @@ -108,13 +108,12 @@ #include <i386/isa/isa.h> -extern void init_pv_entries __P((int)); -extern void pmap_copy_on_write __P((vm_offset_t pa)); +static void init_pv_entries __P((int)); extern void pmap_object_init_pt __P((pmap_t pmap, vm_offset_t addr, vm_object_t object, vm_offset_t offset, vm_offset_t size)); -extern void pmap_remove_all __P((vm_offset_t pa)); -extern void pmap_remove_entry __P((struct pmap *pmap, pv_entry_t pv, +static void pmap_remove_all __P((vm_offset_t pa)); +static void pmap_remove_entry __P((struct pmap *pmap, pv_entry_t pv, vm_offset_t va)); /* @@ -139,20 +138,19 @@ extern void pmap_remove_entry __P((struct pmap *pmap, pv_entry_t pv, * convert to a vax protection code. */ #define pte_prot(m, p) (protection_codes[p]) -int protection_codes[8]; +static int protection_codes[8]; -struct pmap kernel_pmap_store; +static struct pmap kernel_pmap_store; pmap_t kernel_pmap; vm_offset_t avail_start; /* PA of first available physical page */ vm_offset_t avail_end; /* PA of last available physical page */ -vm_size_t mem_size; /* memory size in bytes */ vm_offset_t virtual_avail; /* VA of first avail page (after kernel bss) */ vm_offset_t virtual_end; /* VA of last avail page (end of kernel AS) */ -boolean_t pmap_initialized = FALSE; /* Has pmap_init completed? */ -vm_offset_t vm_first_phys, vm_last_phys; +static boolean_t pmap_initialized = FALSE; /* Has pmap_init completed? */ +static vm_offset_t vm_first_phys; -int nkpt; +static int nkpt; extern vm_offset_t clean_sva, clean_eva; extern int cpu_class; @@ -160,10 +158,12 @@ extern int cpu_class; /* * All those kernel PT submaps that BSD is so fond of */ -pt_entry_t *CMAP1, *CMAP2, *ptmmap; -pv_entry_t pv_table; -caddr_t CADDR1, CADDR2, ptvmmap; -pt_entry_t *msgbufmap; +pt_entry_t *CMAP1; +static pt_entry_t *CMAP2, *ptmmap; +static pv_entry_t pv_table; +caddr_t CADDR1, ptvmmap; +static caddr_t CADDR2; +static pt_entry_t *msgbufmap; struct msgbuf *msgbufp; static void free_pv_entry __P((pv_entry_t pv)); @@ -269,7 +269,7 @@ pmap_is_managed(pa) /* * find the vm_page_t of a pte (only) given va of pte and pmap */ -__inline vm_page_t +static __inline vm_page_t pmap_pte_vm_page(pmap, pt) pmap_t pmap; vm_offset_t pt; @@ -479,38 +479,6 @@ pmap_map(virt, start, end, prot) } /* - * Create and return a physical map. - * - * If the size specified for the map - * is zero, the map is an actual physical - * map, and may be referenced by the - * hardware. - * - * If the size specified is non-zero, - * the map will be used in software only, and - * is bounded by that size. - * - */ - -pmap_t -pmap_create(size) - vm_size_t size; -{ - register pmap_t pmap; - - /* - * Software use map does not need a pmap - */ - if (size) - return (NULL); - - pmap = (pmap_t) malloc(sizeof *pmap, M_VMPMAP, M_WAITOK); - bzero(pmap, sizeof(*pmap)); - pmap_pinit(pmap); - return (pmap); -} - -/* * Initialize a preallocated and zeroed pmap structure, * such as one in a vmspace structure. */ @@ -538,7 +506,7 @@ pmap_pinit(pmap) * grow the number of kernel page table entries, if needed */ -vm_page_t nkpg; +static vm_page_t nkpg; vm_offset_t kernel_vm_end; void @@ -637,10 +605,10 @@ pmap_reference(pmap) /* * Data for the pv entry allocation mechanism */ -int pv_freelistcnt; -pv_entry_t pv_freelist; -vm_offset_t pvva; -int npvvapg; +static int pv_freelistcnt; +static pv_entry_t pv_freelist; +static vm_offset_t pvva; +static int npvvapg; /* * free the pv_entry back to the free list @@ -789,7 +757,7 @@ get_pt_entry(pmap) * to the header. Otherwise we must search the list for * the entry. In either case we free the now unused entry. */ -void +static void pmap_remove_entry(pmap, pv, va) struct pmap *pmap; pv_entry_t pv; @@ -976,7 +944,7 @@ pmap_remove(pmap, sva, eva) * inefficient because they iteratively called * pmap_remove (slow...) */ -void +static void pmap_remove_all(pa) vm_offset_t pa; { @@ -1859,18 +1827,6 @@ pmap_clear_reference(vm_offset_t pa) } /* - * Routine: pmap_copy_on_write - * Function: - * Remove write privileges from all - * physical maps for this physical page. - */ -void -pmap_copy_on_write(vm_offset_t pa) -{ - pmap_changebit((pa), PG_RW, FALSE); -} - -/* * Miscellaneous support routines follow */ diff --git a/sys/amd64/amd64/swtch.s b/sys/amd64/amd64/swtch.s index 72dc2ad..ca0ed69 100644 --- a/sys/amd64/amd64/swtch.s +++ b/sys/amd64/amd64/swtch.s @@ -33,7 +33,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: swtch.s,v 1.21 1995/09/03 20:39:19 dyson Exp $ + * $Id: swtch.s,v 1.22 1995/12/09 20:40:41 phk Exp $ */ #include "npx.h" /* for NNPX */ @@ -66,8 +66,6 @@ _whichrtqs: .long 0 /* which realtime run queues have data */ _whichidqs: .long 0 /* which idletime run queues have data */ .globl _qs,_cnt,_panic - .comm _noproc,4 - .comm _runrun,4 .globl _want_resched _want_resched: .long 0 /* we need to re-run the scheduler */ diff --git a/sys/amd64/amd64/sys_machdep.c b/sys/amd64/amd64/sys_machdep.c index 686d33d..beb6df8 100644 --- a/sys/amd64/amd64/sys_machdep.c +++ b/sys/amd64/amd64/sys_machdep.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * from: @(#)sys_machdep.c 5.5 (Berkeley) 1/19/91 - * $Id: sys_machdep.c,v 1.11 1995/11/12 07:10:47 bde Exp $ + * $Id: sys_machdep.c,v 1.12 1995/12/07 12:45:38 davidg Exp $ * */ @@ -56,8 +56,8 @@ #include <vm/vm_kern.h> /* for kernel_map */ void set_user_ldt __P((struct pcb *pcb)); -int i386_get_ldt __P((struct proc *, char *, int *)); -int i386_set_ldt __P((struct proc *, char *, int *)); +static int i386_get_ldt __P((struct proc *, char *, int *)); +static int i386_set_ldt __P((struct proc *, char *, int *)); #ifndef _SYS_SYSPROTO_H_ struct sysarch_args { @@ -108,7 +108,7 @@ struct i386_get_ldt_args { int num; }; -int +static int i386_get_ldt(p, args, retval) struct proc *p; char *args; @@ -162,7 +162,7 @@ struct i386_set_ldt_args { int num; }; -int +static int i386_set_ldt(p, args, retval) struct proc *p; char *args; @@ -256,7 +256,7 @@ i386_set_ldt(p, args, retval) /* Fill in range */ for (i = 0, n = uap->start; i < uap->num && !error; i++, n++) { - union descriptor desc, *dp; + union descriptor *dp; dp = &uap->desc[i]; lp = &((union descriptor *)(pcb->pcb_ldt))[n]; #ifdef DEBUG diff --git a/sys/amd64/amd64/vm_machdep.c b/sys/amd64/amd64/vm_machdep.c index 9779f11..77671ad 100644 --- a/sys/amd64/amd64/vm_machdep.c +++ b/sys/amd64/amd64/vm_machdep.c @@ -38,7 +38,7 @@ * * from: @(#)vm_machdep.c 7.3 (Berkeley) 5/13/91 * Utah $Hdr: vm_machdep.c 1.16.1.1 89/06/23$ - * $Id: vm_machdep.c,v 1.45 1995/11/20 12:10:09 phk Exp $ + * $Id: vm_machdep.c,v 1.46 1995/12/07 12:45:40 davidg Exp $ */ #include "npx.h" @@ -68,36 +68,37 @@ #include <i386/isa/isa.h> extern void pagemove __P((caddr_t from, caddr_t to, int size)); -extern void setredzone __P((u_short *pte, caddr_t vaddr)); -extern void vm_fault_quick __P((caddr_t v, int prot)); +static void setredzone __P((u_short *pte, caddr_t vaddr)); +static void vm_fault_quick __P((caddr_t v, int prot)); #ifdef BOUNCE_BUFFERS -extern vm_offset_t +static vm_offset_t vm_bounce_kva __P((int size, int waitok)); -extern void vm_bounce_kva_free __P((vm_offset_t addr, vm_offset_t size, +static void vm_bounce_kva_free __P((vm_offset_t addr, vm_offset_t size, int now)); -extern vm_offset_t +static vm_offset_t vm_bounce_page_find __P((int count)); -extern void vm_bounce_page_free __P((vm_offset_t pa, int count)); +static void vm_bounce_page_free __P((vm_offset_t pa, int count)); -volatile int kvasfreecnt; +static static volatile int kvasfreecnt; caddr_t bouncememory; -int bouncepages, bpwait; -vm_offset_t *bouncepa; -int bmwait, bmfreeing; +int bouncepages; +static int bpwait; +static vm_offset_t *bouncepa; +static int bmwait, bmfreeing; #define BITS_IN_UNSIGNED (8*sizeof(unsigned)) -int bounceallocarraysize; -unsigned *bounceallocarray; -int bouncefree; +static int bounceallocarraysize; +static unsigned *bounceallocarray; +static int bouncefree; #define SIXTEENMEG (4096*4096) #define MAXBKVA 1024 int maxbkva = MAXBKVA*NBPG; /* special list that can be used at interrupt time for eventual kva free */ -struct kvasfree { +static struct kvasfree { vm_offset_t addr; vm_offset_t size; } kvaf[MAXBKVA]; @@ -106,7 +107,7 @@ struct kvasfree { * get bounce buffer pages (count physically contiguous) * (only 1 inplemented now) */ -vm_offset_t +static vm_offset_t vm_bounce_page_find(count) int count; { @@ -134,7 +135,7 @@ retry: goto retry; } -void +static void vm_bounce_kva_free(addr, size, now) vm_offset_t addr; vm_offset_t size; @@ -164,7 +165,7 @@ vm_bounce_kva_free(addr, size, now) /* * free count bounce buffer pages */ -void +static void vm_bounce_page_free(pa, count) vm_offset_t pa; int count; @@ -199,7 +200,7 @@ vm_bounce_page_free(pa, count) /* * allocate count bounce buffer kva pages */ -vm_offset_t +static vm_offset_t vm_bounce_kva(size, waitok) int size; int waitok; @@ -539,7 +540,7 @@ vm_bounce_init() /* * quick version of vm_fault */ -void +static void vm_fault_quick(v, prot) caddr_t v; int prot; @@ -641,7 +642,7 @@ cpu_coredump(p, vp, cred) /* * Set a red zone in the kernel stack after the u. area. */ -void +static void setredzone(pte, vaddr) u_short *pte; caddr_t vaddr; @@ -662,7 +663,7 @@ setredzone(pte, vaddr) * and size must be a multiple of CLSIZE. */ -void +static void pagemove(from, to, size) register caddr_t from, to; int size; diff --git a/sys/i386/i386/autoconf.c b/sys/i386/i386/autoconf.c index f9d3a29..9506751 100644 --- a/sys/i386/i386/autoconf.c +++ b/sys/i386/i386/autoconf.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * from: @(#)autoconf.c 7.1 (Berkeley) 5/9/91 - * $Id: autoconf.c,v 1.45 1995/12/06 09:04:44 peter Exp $ + * $Id: autoconf.c,v 1.46 1995/12/07 20:31:02 peter Exp $ */ /* @@ -88,6 +88,7 @@ static void configure __P((void *)); SYSINIT(configure, SI_SUB_CONFIGURE, SI_ORDER_FIRST, configure, NULL) +static int setdumpdev __P((dev_t dev)); static void setroot __P((void)); #ifdef MFS_ROOT @@ -260,7 +261,7 @@ configure(dummy) cold = 0; } -int +static int setdumpdev(dev) dev_t dev; { diff --git a/sys/i386/i386/db_interface.c b/sys/i386/i386/db_interface.c index 7536c1c..dd42079 100644 --- a/sys/i386/i386/db_interface.c +++ b/sys/i386/i386/db_interface.c @@ -23,7 +23,7 @@ * any improvements or extensions that they make and grant Carnegie the * rights to redistribute these changes. * - * $Id: db_interface.c,v 1.15 1995/11/18 06:49:35 bde Exp $ + * $Id: db_interface.c,v 1.16 1995/12/07 12:45:29 davidg Exp $ */ /* @@ -47,10 +47,12 @@ #include <ddb/ddb.h> #include <setjmp.h> -int db_active = 0; +static int db_active = 0; db_regs_t ddb_regs; +static void kdbprinttrap __P((int type, int code)); + #if 0 /* * Received keyboard interrupt sequence. @@ -92,7 +94,7 @@ kdb_trap(type, code, regs) * %eip. */ if (cons_unavail) { - if (type = T_TRCTRAP) { + if (type == T_TRCTRAP) { regs->tf_eflags &= ~PSL_T; return (1); } @@ -165,7 +167,7 @@ kdb_trap(type, code, regs) /* * Print trap reason. */ -void +static void kdbprinttrap(type, code) int type, code; { diff --git a/sys/i386/i386/machdep.c b/sys/i386/i386/machdep.c index 06d236f..0c1c785 100644 --- a/sys/i386/i386/machdep.c +++ b/sys/i386/i386/machdep.c @@ -35,7 +35,7 @@ * SUCH DAMAGE. * * from: @(#)machdep.c 7.4 (Berkeley) 6/3/91 - * $Id: machdep.c,v 1.155 1995/12/07 12:45:32 davidg Exp $ + * $Id: machdep.c,v 1.156 1995/12/09 20:39:47 phk Exp $ */ #include "npx.h" @@ -94,30 +94,6 @@ #include <net/netisr.h> -/* XXX correctly declaring all the netisr's is painful. */ -#include <net/if.h> -#include <net/route.h> - -#include <netinet/in.h> -#include <netinet/in_systm.h> -#include <netinet/ip.h> -#include <netinet/if_ether.h> -#include <netinet/ip_var.h> - -#include <netns/ns.h> -#include <netns/ns_if.h> - -#include <netiso/iso.h> -#include <netiso/iso_var.h> - -#include <netccitt/dll.h> -#include <netccitt/x25.h> -#include <netccitt/pk.h> -#include <sys/socketvar.h> -#include <netccitt/pk_var.h> - -#include "ether.h" - #include <machine/cpu.h> #include <machine/npx.h> #include <machine/reg.h> @@ -135,12 +111,9 @@ #include <i386/isa/rtc.h> #include <machine/random.h> -extern void diediedie __P((void)); extern void init386 __P((int first)); extern int ptrace_set_pc __P((struct proc *p, unsigned int addr)); extern int ptrace_single_step __P((struct proc *p)); -extern int ptrace_getregs __P((struct proc *p, unsigned int *addr)); -extern int ptrace_setregs __P((struct proc *p, unsigned int *addr)); extern int ptrace_write_u __P((struct proc *p, vm_offset_t off, int data)); static void cpu_startup __P((void *)); @@ -151,7 +124,7 @@ static void identifycpu(void); char machine[] = "i386"; SYSCTL_STRING(_hw, HW_MACHINE, machine, CTLFLAG_RD, machine, 0, ""); -char cpu_model[128]; +static char cpu_model[128]; SYSCTL_STRING(_hw, HW_MODEL, model, CTLFLAG_RD, cpu_model, 0, ""); struct kern_devconf kdc_cpu0 = { @@ -207,10 +180,10 @@ sysctl_hw_usermem SYSCTL_HANDLER_ARGS SYSCTL_PROC(_hw, HW_USERMEM, usermem, CTLTYPE_INT|CTLFLAG_RD, 0, 0, sysctl_hw_usermem, "I", ""); -int boothowto = 0, bootverbose = 0, Maxmem = 0, badpages = 0; +int boothowto = 0, bootverbose = 0, Maxmem = 0; +static int badpages = 0; long dumplo; extern int bootdev; -int biosmem; vm_offset_t phys_avail[10]; @@ -219,12 +192,12 @@ vm_offset_t phys_avail[10]; int cpu_class; -void dumpsys __P((void)); -void setup_netisrs __P((struct linker_set *)); /* XXX declare elsewhere */ +static void dumpsys __P((void)); +static void setup_netisrs __P((struct linker_set *)); /* XXX declare elsewhere */ -vm_offset_t buffer_sva, buffer_eva; +static vm_offset_t buffer_sva, buffer_eva; vm_offset_t clean_sva, clean_eva; -vm_offset_t pager_sva, pager_eva; +static vm_offset_t pager_sva, pager_eva; extern struct linker_set netisr_set; #define offsetof(type, member) ((size_t)(&((type *)0)->member)) @@ -484,7 +457,7 @@ register_netisr(num, handler) return (0); } -void +static void setup_netisrs(ls) struct linker_set *ls; { @@ -497,7 +470,7 @@ setup_netisrs(ls) } } -struct cpu_nameclass i386_cpus[] = { +static struct cpu_nameclass i386_cpus[] = { { "Intel 80286", CPUCLASS_286 }, /* CPU_286 */ { "i386SX", CPUCLASS_386 }, /* CPU_386SX */ { "i386DX", CPUCLASS_386 }, /* CPU_386 */ @@ -872,17 +845,8 @@ sigreturn(p, uap, retval) return(EJUSTRETURN); } -/* - * a simple function to make the system panic (and dump a vmcore) - * in a predictable fashion - */ -void diediedie() -{ - panic("because you said to!"); -} - -int waittime = -1; -struct pcb dumppcb; +static int waittime = -1; +static struct pcb dumppcb; __dead void boot(howto) @@ -978,17 +942,25 @@ die: /* NOTREACHED */ } -unsigned long dumpmag = 0x8fca0101UL; /* magic number for savecore */ -int dumpsize = 0; /* also for savecore */ +/* + * Magic number for savecore + * + * exported (symorder) and used at least by savecore(8) + * + */ +u_long dumpmag = 0x8fca0101UL; + +static int dumpsize = 0; /* also for savecore */ -int dodump = 1; +static int dodump = 1; +SYSCTL_INT(_machdep, OID_AUTO, do_dump, CTLFLAG_RW, &dodump, 0, ""); /* * Doadump comes here after turning off memory management and * getting on the dump stack, either when called above, or by * the auto-restart code. */ -void +static void dumpsys() { @@ -1090,7 +1062,7 @@ union descriptor gdt[NGDT]; /* global descriptor table */ struct gate_descriptor idt[NIDT]; /* interrupt descriptor table */ union descriptor ldt[NLDT]; /* local descriptor table */ -struct i386tss tss, panic_tss; +static struct i386tss tss, panic_tss; extern struct user *proc0paddr; @@ -1197,7 +1169,7 @@ struct soft_segment_descriptor gdt_segs[] = { 1 /* limit granularity (byte/page units)*/ }, }; -struct soft_segment_descriptor ldt_segs[] = { +static struct soft_segment_descriptor ldt_segs[] = { /* Null Descriptor - overwritten by call gate */ { 0x0, /* segment base address */ 0x0, /* length - all address space */ @@ -1651,34 +1623,6 @@ ptrace_single_step(p) return (0); } -int -ptrace_getregs(p, addr) - struct proc *p; - unsigned int *addr; -{ - int error; - struct reg regs; - - error = fill_regs(p, ®s); - if (error) - return (error); - return (copyout(®s, addr, sizeof regs)); -} - -int -ptrace_setregs(p, addr) - struct proc *p; - unsigned int *addr; -{ - int error; - struct reg regs; - - error = copyin(addr, ®s, sizeof regs); - if (error) - return (error); - return (set_regs(p, ®s)); -} - int ptrace_write_u(p, off, data) struct proc *p; vm_offset_t off; diff --git a/sys/i386/i386/pmap.c b/sys/i386/i386/pmap.c index e89ef2d..3757f65 100644 --- a/sys/i386/i386/pmap.c +++ b/sys/i386/i386/pmap.c @@ -39,7 +39,7 @@ * SUCH DAMAGE. * * from: @(#)pmap.c 7.7 (Berkeley) 5/12/91 - * $Id: pmap.c,v 1.66 1995/12/03 18:35:28 bde Exp $ + * $Id: pmap.c,v 1.67 1995/12/07 12:45:36 davidg Exp $ */ /* @@ -108,13 +108,12 @@ #include <i386/isa/isa.h> -extern void init_pv_entries __P((int)); -extern void pmap_copy_on_write __P((vm_offset_t pa)); +static void init_pv_entries __P((int)); extern void pmap_object_init_pt __P((pmap_t pmap, vm_offset_t addr, vm_object_t object, vm_offset_t offset, vm_offset_t size)); -extern void pmap_remove_all __P((vm_offset_t pa)); -extern void pmap_remove_entry __P((struct pmap *pmap, pv_entry_t pv, +static void pmap_remove_all __P((vm_offset_t pa)); +static void pmap_remove_entry __P((struct pmap *pmap, pv_entry_t pv, vm_offset_t va)); /* @@ -139,20 +138,19 @@ extern void pmap_remove_entry __P((struct pmap *pmap, pv_entry_t pv, * convert to a vax protection code. */ #define pte_prot(m, p) (protection_codes[p]) -int protection_codes[8]; +static int protection_codes[8]; -struct pmap kernel_pmap_store; +static struct pmap kernel_pmap_store; pmap_t kernel_pmap; vm_offset_t avail_start; /* PA of first available physical page */ vm_offset_t avail_end; /* PA of last available physical page */ -vm_size_t mem_size; /* memory size in bytes */ vm_offset_t virtual_avail; /* VA of first avail page (after kernel bss) */ vm_offset_t virtual_end; /* VA of last avail page (end of kernel AS) */ -boolean_t pmap_initialized = FALSE; /* Has pmap_init completed? */ -vm_offset_t vm_first_phys, vm_last_phys; +static boolean_t pmap_initialized = FALSE; /* Has pmap_init completed? */ +static vm_offset_t vm_first_phys; -int nkpt; +static int nkpt; extern vm_offset_t clean_sva, clean_eva; extern int cpu_class; @@ -160,10 +158,12 @@ extern int cpu_class; /* * All those kernel PT submaps that BSD is so fond of */ -pt_entry_t *CMAP1, *CMAP2, *ptmmap; -pv_entry_t pv_table; -caddr_t CADDR1, CADDR2, ptvmmap; -pt_entry_t *msgbufmap; +pt_entry_t *CMAP1; +static pt_entry_t *CMAP2, *ptmmap; +static pv_entry_t pv_table; +caddr_t CADDR1, ptvmmap; +static caddr_t CADDR2; +static pt_entry_t *msgbufmap; struct msgbuf *msgbufp; static void free_pv_entry __P((pv_entry_t pv)); @@ -269,7 +269,7 @@ pmap_is_managed(pa) /* * find the vm_page_t of a pte (only) given va of pte and pmap */ -__inline vm_page_t +static __inline vm_page_t pmap_pte_vm_page(pmap, pt) pmap_t pmap; vm_offset_t pt; @@ -479,38 +479,6 @@ pmap_map(virt, start, end, prot) } /* - * Create and return a physical map. - * - * If the size specified for the map - * is zero, the map is an actual physical - * map, and may be referenced by the - * hardware. - * - * If the size specified is non-zero, - * the map will be used in software only, and - * is bounded by that size. - * - */ - -pmap_t -pmap_create(size) - vm_size_t size; -{ - register pmap_t pmap; - - /* - * Software use map does not need a pmap - */ - if (size) - return (NULL); - - pmap = (pmap_t) malloc(sizeof *pmap, M_VMPMAP, M_WAITOK); - bzero(pmap, sizeof(*pmap)); - pmap_pinit(pmap); - return (pmap); -} - -/* * Initialize a preallocated and zeroed pmap structure, * such as one in a vmspace structure. */ @@ -538,7 +506,7 @@ pmap_pinit(pmap) * grow the number of kernel page table entries, if needed */ -vm_page_t nkpg; +static vm_page_t nkpg; vm_offset_t kernel_vm_end; void @@ -637,10 +605,10 @@ pmap_reference(pmap) /* * Data for the pv entry allocation mechanism */ -int pv_freelistcnt; -pv_entry_t pv_freelist; -vm_offset_t pvva; -int npvvapg; +static int pv_freelistcnt; +static pv_entry_t pv_freelist; +static vm_offset_t pvva; +static int npvvapg; /* * free the pv_entry back to the free list @@ -789,7 +757,7 @@ get_pt_entry(pmap) * to the header. Otherwise we must search the list for * the entry. In either case we free the now unused entry. */ -void +static void pmap_remove_entry(pmap, pv, va) struct pmap *pmap; pv_entry_t pv; @@ -976,7 +944,7 @@ pmap_remove(pmap, sva, eva) * inefficient because they iteratively called * pmap_remove (slow...) */ -void +static void pmap_remove_all(pa) vm_offset_t pa; { @@ -1859,18 +1827,6 @@ pmap_clear_reference(vm_offset_t pa) } /* - * Routine: pmap_copy_on_write - * Function: - * Remove write privileges from all - * physical maps for this physical page. - */ -void -pmap_copy_on_write(vm_offset_t pa) -{ - pmap_changebit((pa), PG_RW, FALSE); -} - -/* * Miscellaneous support routines follow */ diff --git a/sys/i386/i386/procfs_machdep.c b/sys/i386/i386/procfs_machdep.c index 1c88a55..1fb9c82 100644 --- a/sys/i386/i386/procfs_machdep.c +++ b/sys/i386/i386/procfs_machdep.c @@ -37,7 +37,7 @@ * @(#)procfs_machdep.c 8.3 (Berkeley) 1/27/94 * * From: - * $Id: procfs_machdep.c,v 1.4 1995/03/16 18:11:29 bde Exp $ + * $Id: procfs_machdep.c,v 1.5 1995/12/07 12:45:37 davidg Exp $ */ /* @@ -62,8 +62,6 @@ * procfs_sstep(proc) * Arrange for the process to trap after executing a single instruction. * - * procfs_fix_sstep(proc) - * Cleanup process state after executing a single-step instruction. */ #include <sys/param.h> @@ -143,9 +141,3 @@ procfs_sstep(p) return (EIO); return (ptrace_single_step(p)); } - -void -procfs_fix_sstep(p) - struct proc *p; -{ -} diff --git a/sys/i386/i386/swtch.s b/sys/i386/i386/swtch.s index 72dc2ad..ca0ed69 100644 --- a/sys/i386/i386/swtch.s +++ b/sys/i386/i386/swtch.s @@ -33,7 +33,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: swtch.s,v 1.21 1995/09/03 20:39:19 dyson Exp $ + * $Id: swtch.s,v 1.22 1995/12/09 20:40:41 phk Exp $ */ #include "npx.h" /* for NNPX */ @@ -66,8 +66,6 @@ _whichrtqs: .long 0 /* which realtime run queues have data */ _whichidqs: .long 0 /* which idletime run queues have data */ .globl _qs,_cnt,_panic - .comm _noproc,4 - .comm _runrun,4 .globl _want_resched _want_resched: .long 0 /* we need to re-run the scheduler */ diff --git a/sys/i386/i386/sys_machdep.c b/sys/i386/i386/sys_machdep.c index 686d33d..beb6df8 100644 --- a/sys/i386/i386/sys_machdep.c +++ b/sys/i386/i386/sys_machdep.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * from: @(#)sys_machdep.c 5.5 (Berkeley) 1/19/91 - * $Id: sys_machdep.c,v 1.11 1995/11/12 07:10:47 bde Exp $ + * $Id: sys_machdep.c,v 1.12 1995/12/07 12:45:38 davidg Exp $ * */ @@ -56,8 +56,8 @@ #include <vm/vm_kern.h> /* for kernel_map */ void set_user_ldt __P((struct pcb *pcb)); -int i386_get_ldt __P((struct proc *, char *, int *)); -int i386_set_ldt __P((struct proc *, char *, int *)); +static int i386_get_ldt __P((struct proc *, char *, int *)); +static int i386_set_ldt __P((struct proc *, char *, int *)); #ifndef _SYS_SYSPROTO_H_ struct sysarch_args { @@ -108,7 +108,7 @@ struct i386_get_ldt_args { int num; }; -int +static int i386_get_ldt(p, args, retval) struct proc *p; char *args; @@ -162,7 +162,7 @@ struct i386_set_ldt_args { int num; }; -int +static int i386_set_ldt(p, args, retval) struct proc *p; char *args; @@ -256,7 +256,7 @@ i386_set_ldt(p, args, retval) /* Fill in range */ for (i = 0, n = uap->start; i < uap->num && !error; i++, n++) { - union descriptor desc, *dp; + union descriptor *dp; dp = &uap->desc[i]; lp = &((union descriptor *)(pcb->pcb_ldt))[n]; #ifdef DEBUG diff --git a/sys/i386/i386/userconfig.c b/sys/i386/i386/userconfig.c index 7917373..47f79f0 100644 --- a/sys/i386/i386/userconfig.c +++ b/sys/i386/i386/userconfig.c @@ -46,7 +46,7 @@ ** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF ** THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ** - ** $Id: userconfig.c,v 1.37 1995/11/20 12:10:06 phk Exp $ + ** $Id: userconfig.c,v 1.38 1995/12/03 18:46:49 bde Exp $ **/ /** @@ -2143,7 +2143,7 @@ visuserconfig(void) * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: userconfig.c,v 1.37 1995/11/20 12:10:06 phk Exp $ + * $Id: userconfig.c,v 1.38 1995/12/03 18:46:49 bde Exp $ */ @@ -2183,7 +2183,7 @@ static struct isa_device *search_devtable(struct isa_device *, char *, int); static void cngets(char *, int); static Cmd *parse_cmd(char *); static int parse_args(char *, CmdParm *); -unsigned long strtoul(const char *, char **, int); +static unsigned long strtoul(const char *, char **, int); static int save_dev(struct isa_device *); static int list_devices(CmdParm *); @@ -2603,7 +2603,7 @@ static int errno; * Ignores `locale' stuff. Assumes that the upper and lower case * alphabets and digits are each contiguous. */ -unsigned long +static unsigned long strtoul(nptr, endptr, base) const char *nptr; char **endptr; diff --git a/sys/i386/i386/vm_machdep.c b/sys/i386/i386/vm_machdep.c index 9779f11..77671ad 100644 --- a/sys/i386/i386/vm_machdep.c +++ b/sys/i386/i386/vm_machdep.c @@ -38,7 +38,7 @@ * * from: @(#)vm_machdep.c 7.3 (Berkeley) 5/13/91 * Utah $Hdr: vm_machdep.c 1.16.1.1 89/06/23$ - * $Id: vm_machdep.c,v 1.45 1995/11/20 12:10:09 phk Exp $ + * $Id: vm_machdep.c,v 1.46 1995/12/07 12:45:40 davidg Exp $ */ #include "npx.h" @@ -68,36 +68,37 @@ #include <i386/isa/isa.h> extern void pagemove __P((caddr_t from, caddr_t to, int size)); -extern void setredzone __P((u_short *pte, caddr_t vaddr)); -extern void vm_fault_quick __P((caddr_t v, int prot)); +static void setredzone __P((u_short *pte, caddr_t vaddr)); +static void vm_fault_quick __P((caddr_t v, int prot)); #ifdef BOUNCE_BUFFERS -extern vm_offset_t +static vm_offset_t vm_bounce_kva __P((int size, int waitok)); -extern void vm_bounce_kva_free __P((vm_offset_t addr, vm_offset_t size, +static void vm_bounce_kva_free __P((vm_offset_t addr, vm_offset_t size, int now)); -extern vm_offset_t +static vm_offset_t vm_bounce_page_find __P((int count)); -extern void vm_bounce_page_free __P((vm_offset_t pa, int count)); +static void vm_bounce_page_free __P((vm_offset_t pa, int count)); -volatile int kvasfreecnt; +static static volatile int kvasfreecnt; caddr_t bouncememory; -int bouncepages, bpwait; -vm_offset_t *bouncepa; -int bmwait, bmfreeing; +int bouncepages; +static int bpwait; +static vm_offset_t *bouncepa; +static int bmwait, bmfreeing; #define BITS_IN_UNSIGNED (8*sizeof(unsigned)) -int bounceallocarraysize; -unsigned *bounceallocarray; -int bouncefree; +static int bounceallocarraysize; +static unsigned *bounceallocarray; +static int bouncefree; #define SIXTEENMEG (4096*4096) #define MAXBKVA 1024 int maxbkva = MAXBKVA*NBPG; /* special list that can be used at interrupt time for eventual kva free */ -struct kvasfree { +static struct kvasfree { vm_offset_t addr; vm_offset_t size; } kvaf[MAXBKVA]; @@ -106,7 +107,7 @@ struct kvasfree { * get bounce buffer pages (count physically contiguous) * (only 1 inplemented now) */ -vm_offset_t +static vm_offset_t vm_bounce_page_find(count) int count; { @@ -134,7 +135,7 @@ retry: goto retry; } -void +static void vm_bounce_kva_free(addr, size, now) vm_offset_t addr; vm_offset_t size; @@ -164,7 +165,7 @@ vm_bounce_kva_free(addr, size, now) /* * free count bounce buffer pages */ -void +static void vm_bounce_page_free(pa, count) vm_offset_t pa; int count; @@ -199,7 +200,7 @@ vm_bounce_page_free(pa, count) /* * allocate count bounce buffer kva pages */ -vm_offset_t +static vm_offset_t vm_bounce_kva(size, waitok) int size; int waitok; @@ -539,7 +540,7 @@ vm_bounce_init() /* * quick version of vm_fault */ -void +static void vm_fault_quick(v, prot) caddr_t v; int prot; @@ -641,7 +642,7 @@ cpu_coredump(p, vp, cred) /* * Set a red zone in the kernel stack after the u. area. */ -void +static void setredzone(pte, vaddr) u_short *pte; caddr_t vaddr; @@ -662,7 +663,7 @@ setredzone(pte, vaddr) * and size must be a multiple of CLSIZE. */ -void +static void pagemove(from, to, size) register caddr_t from, to; int size; |