diff options
author | wollman <wollman@FreeBSD.org> | 1993-12-19 00:55:01 +0000 |
---|---|---|
committer | wollman <wollman@FreeBSD.org> | 1993-12-19 00:55:01 +0000 |
commit | 71b67e5a560e27117fd4ff9fe76b1e67f1423f1e (patch) | |
tree | 62dff2aa17f4c31d27a9595b764f9cbc9810eb80 /sys/amd64 | |
parent | c7341bb860bd0d1789ca0b8bfce96c383fd7dbbc (diff) | |
download | FreeBSD-src-71b67e5a560e27117fd4ff9fe76b1e67f1423f1e.zip FreeBSD-src-71b67e5a560e27117fd4ff9fe76b1e67f1423f1e.tar.gz |
Make everything compile with -Wtraditional. Make it easier to distribute
a binary link-kit. Make all non-optional options (pagers, procfs) standard,
and update LINT to reflect new symtab requirements.
NB: -Wtraditional will henceforth be forgotten. This editing pass was
primarily intended to detect any constructions where the old code might
have been relying on traditional C semantics or syntax. These were all
fixed, and the result of fixing some of them means that -Wall is now a
realistic possibility within a few weeks.
Diffstat (limited to 'sys/amd64')
-rw-r--r-- | sys/amd64/amd64/autoconf.c | 3 | ||||
-rw-r--r-- | sys/amd64/amd64/db_disasm.c | 5 | ||||
-rw-r--r-- | sys/amd64/amd64/db_interface.c | 5 | ||||
-rw-r--r-- | sys/amd64/amd64/db_trace.c | 5 | ||||
-rw-r--r-- | sys/amd64/amd64/machdep.c | 32 | ||||
-rw-r--r-- | sys/amd64/amd64/mem.c | 9 | ||||
-rw-r--r-- | sys/amd64/amd64/pmap.c | 7 | ||||
-rw-r--r-- | sys/amd64/amd64/trap.c | 23 | ||||
-rw-r--r-- | sys/amd64/amd64/tsc.c | 4 | ||||
-rw-r--r-- | sys/amd64/amd64/vm_machdep.c | 10 | ||||
-rw-r--r-- | sys/amd64/include/cpufunc.h | 53 | ||||
-rw-r--r-- | sys/amd64/include/frame.h | 4 | ||||
-rw-r--r-- | sys/amd64/include/pmap.h | 28 | ||||
-rw-r--r-- | sys/amd64/include/vmparam.h | 32 | ||||
-rw-r--r-- | sys/amd64/isa/clock.c | 4 | ||||
-rw-r--r-- | sys/amd64/isa/isa.c | 11 |
16 files changed, 155 insertions, 80 deletions
diff --git a/sys/amd64/amd64/autoconf.c b/sys/amd64/amd64/autoconf.c index 372dd26..917137c 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.4 1993/10/16 14:14:48 rgrimes Exp $ + * $Id: autoconf.c,v 1.5 1993/11/25 01:30:46 wollman Exp $ */ /* @@ -52,6 +52,7 @@ #include "conf.h" #include "dmap.h" #include "reboot.h" +#include "kernel.h" #include "machine/pte.h" diff --git a/sys/amd64/amd64/db_disasm.c b/sys/amd64/amd64/db_disasm.c index 4793e40..98e251b 100644 --- a/sys/amd64/amd64/db_disasm.c +++ b/sys/amd64/amd64/db_disasm.c @@ -23,15 +23,16 @@ * any improvements or extensions that they make and grant Carnegie the * rights to redistribute these changes. * - * $Id: db_disasm.c,v 1.3 1993/10/16 14:14:52 rgrimes Exp $ + * $Id: db_disasm.c,v 1.4 1993/11/25 01:30:51 wollman Exp $ */ /* * Instruction disassembler. */ #include "param.h" +#include "systm.h" #include "proc.h" -#include <machine/db_machdep.h> +#include "ddb/ddb.h" #include <ddb/db_access.h> #include <ddb/db_sym.h> diff --git a/sys/amd64/amd64/db_interface.c b/sys/amd64/amd64/db_interface.c index 9f504d4..e7e0ced 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.3 1993/11/07 17:41:34 wollman Exp $ + * $Id: db_interface.c,v 1.4 1993/11/25 01:30:52 wollman Exp $ */ /* @@ -31,6 +31,7 @@ */ #include "param.h" #include "systm.h" +#include "kernel.h" #include "proc.h" #include "ddb/ddb.h" @@ -235,7 +236,7 @@ db_write_bytes(addr, size, data) void Debugger (msg) - char *msg; + const char *msg; { asm ("int $3"); } diff --git a/sys/amd64/amd64/db_trace.c b/sys/amd64/amd64/db_trace.c index ffed283..9e300cf 100644 --- a/sys/amd64/amd64/db_trace.c +++ b/sys/amd64/amd64/db_trace.c @@ -23,12 +23,13 @@ * any improvements or extensions that they make and grant Carnegie the * rights to redistribute these changes. * - * $Id$ + * $Id: db_trace.c,v 1.2 1993/10/16 14:14:56 rgrimes Exp $ */ #include "param.h" +#include "systm.h" #include "proc.h" -#include <machine/db_machdep.h> +#include "ddb/ddb.h" #include <ddb/db_access.h> #include <ddb/db_sym.h> diff --git a/sys/amd64/amd64/machdep.c b/sys/amd64/amd64/machdep.c index 7e588e4..4fecac1 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.20 1993/12/03 05:07:43 alm Exp $ + * $Id: machdep.c,v 1.21 1993/12/12 12:22:56 davidg Exp $ */ #include "npx.h" @@ -85,6 +85,7 @@ static unsigned int avail_remaining; #include "machine/psl.h" #include "machine/specialreg.h" #include "machine/sysarch.h" +#include "machine/cons.h" #include "i386/isa/isa.h" #include "i386/isa/rtc.h" @@ -156,10 +157,11 @@ cpu_startup() /* avail_end was pre-decremented in pmap_bootstrap to compensate */ for (i = 0; i < btoc(sizeof (struct msgbuf)); i++) #ifndef MACHINE_NONCONTIG - pmap_enter(pmap_kernel(), msgbufp, avail_end + i * NBPG, + pmap_enter(pmap_kernel(), (vm_offset_t)msgbufp, + avail_end + i * NBPG, VM_PROT_ALL, TRUE); #else - pmap_enter(pmap_kernel(), (caddr_t)msgbufp + i * NBPG, + pmap_enter(pmap_kernel(), (vm_offset_t)msgbufp + i * NBPG, avail_end + i * NBPG, VM_PROT_ALL, TRUE); #endif msgbufmapped = 1; @@ -664,7 +666,7 @@ die: /*NOTREACHED*/ } -unsigned dumpmag = 0x8fca0101; /* magic number for savecore */ +unsigned long dumpmag = 0x8fca0101UL; /* magic number for savecore */ int dumpsize = 0; /* also for savecore */ /* * Doadump comes here after turning off memory management and @@ -929,7 +931,7 @@ struct soft_segment_descriptor ldt_segs[] = { void setidt(idx, func, typ, dpl) int idx; - caddr_t func; + void (*func)(); int typ; int dpl; { @@ -946,7 +948,10 @@ setidt(idx, func, typ, dpl) } #define IDTVEC(name) __CONCAT(X, name) -extern IDTVEC(div), IDTVEC(dbg), IDTVEC(nmi), IDTVEC(bpt), IDTVEC(ofl), +typedef void idtvec_t(); + +extern idtvec_t + IDTVEC(div), IDTVEC(dbg), IDTVEC(nmi), IDTVEC(bpt), IDTVEC(ofl), IDTVEC(bnd), IDTVEC(ill), IDTVEC(dna), IDTVEC(dble), IDTVEC(fpusegm), IDTVEC(tss), IDTVEC(missing), IDTVEC(stk), IDTVEC(prot), IDTVEC(page), IDTVEC(rsvd), IDTVEC(fpu), IDTVEC(rsvd0), @@ -955,7 +960,6 @@ extern IDTVEC(div), IDTVEC(dbg), IDTVEC(nmi), IDTVEC(bpt), IDTVEC(ofl), IDTVEC(rsvd9), IDTVEC(rsvd10), IDTVEC(rsvd11), IDTVEC(rsvd12), IDTVEC(rsvd13), IDTVEC(rsvd14), IDTVEC(rsvd14), IDTVEC(syscall); -int lcr0(), lcr3(), rcr0(), rcr2(); int _gsel_tss; void @@ -986,7 +990,7 @@ init386(first) * the address space */ gdt_segs[GCODE_SEL].ssd_limit = i386_btop(i386_round_page(&etext)) - 1; - gdt_segs[GDATA_SEL].ssd_limit = 0xffffffff; /* XXX constant? */ + gdt_segs[GDATA_SEL].ssd_limit = 0xffffffffUL; /* XXX constant? */ for (x=0; x < NGDT; x++) ssdtosd(gdt_segs+x, gdt+x); /* make ldt memory segments */ /* @@ -1065,7 +1069,7 @@ init386(first) #if NDDB > 0 kdb_init(); if (boothowto & RB_KDB) - Debugger(); + Debugger("Boot flags requested debugger"); #endif /* Use BIOS values stored in RTC CMOS RAM, since probing @@ -1485,4 +1489,14 @@ copystr(fromaddr, toaddr, maxlength, lencopied) u_int *lencopied, maxlength; if(lencopied) *lencopied = tally; return(ENAMETOOLONG); } + #endif + +#include "ddb.h" +#if NDDB <= 0 +void +Debugger(const char *msg) +{ + printf("Debugger(\"%s\") called.", msg); +} +#endif /* no DDB */ diff --git a/sys/amd64/amd64/mem.c b/sys/amd64/amd64/mem.c index 1113eb2..b9a912a 100644 --- a/sys/amd64/amd64/mem.c +++ b/sys/amd64/amd64/mem.c @@ -38,7 +38,7 @@ * * from: Utah $Hdr: mem.c 1.13 89/10/08$ * from: @(#)mem.c 7.2 (Berkeley) 5/9/91 - * $Id: mem.c,v 1.4 1993/11/22 09:46:45 davidg Exp $ + * $Id: mem.c,v 1.5 1993/11/25 01:30:59 wollman Exp $ */ /* @@ -59,8 +59,8 @@ #include "vm/vm_param.h" #include "vm/lock.h" #include "vm/vm_statistics.h" -#include "vm/pmap.h" #include "vm/vm_prot.h" +#include "vm/pmap.h" extern char *vmmap; /* poor name! */ /*ARGSUSED*/ @@ -128,7 +128,7 @@ mmrw(dev, uio, flags) /* minor device 0 is physical memory */ case 0: v = uio->uio_offset; - pmap_enter(pmap_kernel(), vmmap, v, + pmap_enter(pmap_kernel(), (vm_offset_t)vmmap, v, uio->uio_rw == UIO_READ ? VM_PROT_READ : VM_PROT_WRITE, TRUE); o = (int)uio->uio_offset & PGOFSET; @@ -136,7 +136,8 @@ mmrw(dev, uio, flags) c = MIN(c, (u_int)(NBPG - o)); c = MIN(c, (u_int)iov->iov_len); error = uiomove((caddr_t)&vmmap[o], (int)c, uio); - pmap_remove(pmap_kernel(), vmmap, &vmmap[NBPG]); + pmap_remove(pmap_kernel(), (vm_offset_t)vmmap, + (vm_offset_t)&vmmap[NBPG]); continue; /* minor device 1 is kernel memory */ diff --git a/sys/amd64/amd64/pmap.c b/sys/amd64/amd64/pmap.c index 845c75b..1223f60 100644 --- a/sys/amd64/amd64/pmap.c +++ b/sys/amd64/amd64/pmap.c @@ -35,7 +35,7 @@ * SUCH DAMAGE. * * from: @(#)pmap.c 7.7 (Berkeley) 5/12/91 - * $Id: pmap.c,v 1.9 1993/11/25 01:31:00 wollman Exp $ + * $Id: pmap.c,v 1.10 1993/12/13 07:02:27 davidg Exp $ */ /* @@ -80,6 +80,7 @@ #include "param.h" #include "systm.h" +#include "kernel.h" #include "proc.h" #include "malloc.h" #include "user.h" @@ -92,7 +93,6 @@ #include "i386/isa/isa.h" static void i386_protection_init(void); -static void pmap_changebit(vm_offset_t, int, boolean_t); /* * Allocate various and sundry SYSMAPs used in the days of old VM @@ -459,7 +459,8 @@ pmap_pinit(pmap) /* install self-referential address mapping entry */ *(int *)(pmap->pm_pdir+PTDPTDI) = - (int)pmap_extract(kernel_pmap, pmap->pm_pdir) | PG_V | PG_KW; + (int)pmap_extract(kernel_pmap, (vm_offset_t)pmap->pm_pdir) + | PG_V | PG_KW; pmap->pm_count = 1; simple_lock_init(&pmap->pm_lock); diff --git a/sys/amd64/amd64/trap.c b/sys/amd64/amd64/trap.c index 0aa2296..41370cc 100644 --- a/sys/amd64/amd64/trap.c +++ b/sys/amd64/amd64/trap.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * from: @(#)trap.c 7.4 (Berkeley) 5/13/91 - * $Id: trap.c,v 1.10 1993/12/03 05:07:45 alm Exp $ + * $Id: trap.c,v 1.11 1993/12/12 12:22:57 davidg Exp $ */ /* @@ -59,6 +59,7 @@ #include "vm/vm_param.h" #include "vm/pmap.h" #include "vm/vm_map.h" +#include "vm/vm_user.h" #include "sys/vmmeter.h" #include "machine/trap.h" @@ -70,7 +71,7 @@ * we omit the size from the mov instruction to avoid nonfatal bugs in gas. */ #define read_gs() ({ u_short gs; __asm("mov %%gs,%0" : "=r" (gs)); gs; }) -#define write_gs(gs) __asm("mov %0,%%gs" : : "r" ((u_short) gs)) +#define write_gs(newgs) __asm("mov %0,%%gs" : : "r" ((u_short) newgs)) #else /* not __GNUC__ */ @@ -81,7 +82,6 @@ void write_gs __P((/* promoted u_short */ int gs)); struct sysent sysent[]; int nsysent; -unsigned rcr2(); extern short cpl; #define MAX_TRAP_MSG 27 @@ -353,7 +353,8 @@ copyfault: v = vm->vm_maxsaddr; grow_amount = MAXSSIZ - (vm->vm_ssize << PGSHIFT); } - if (vm_allocate(&vm->vm_map, &v, grow_amount, FALSE) != + if (vm_allocate(&vm->vm_map, (vm_offset_t *)&v, + grow_amount, FALSE) != KERN_SUCCESS) { goto nogo; } @@ -363,10 +364,11 @@ copyfault: /* check if page table is mapped, if not, fault it first */ if (!pde_v(va)) { v = (char *)trunc_page(vtopte(va)); - rv = vm_fault(map, v, ftype, FALSE); + rv = vm_fault(map, (vm_offset_t)v, ftype, FALSE); if (rv != KERN_SUCCESS) goto nogo; /* check if page table fault, increment wiring */ - vm_map_pageable(map, v, round_page(v+1), FALSE); + vm_map_pageable(map, (vm_offset_t)v, + round_page(v+1), FALSE); } else v=0; rv = vm_fault(map, va, ftype, FALSE); if (rv == KERN_SUCCESS) { @@ -543,8 +545,9 @@ int trapwrite(addr) v = vm->vm_maxsaddr; grow_amount = MAXSSIZ - (vm->vm_ssize << PGSHIFT); } - if (vm_allocate(&vm->vm_map, &v, grow_amount, FALSE) != - KERN_SUCCESS) { + if (vm_allocate(&vm->vm_map, (vm_offset_t *)&v, + grow_amount, FALSE) + != KERN_SUCCESS) { return(1); } } @@ -613,13 +616,13 @@ syscall(frame) frame.sf_eflags |= PSL_C; /* carry bit */ #ifdef KTRACE if (KTRPOINT(p, KTR_SYSCALL)) - ktrsyscall(p->p_tracep, code, callp->sy_narg, &args); + ktrsyscall(p->p_tracep, code, callp->sy_narg, args); #endif goto done; } #ifdef KTRACE if (KTRPOINT(p, KTR_SYSCALL)) - ktrsyscall(p->p_tracep, code, callp->sy_narg, &args); + ktrsyscall(p->p_tracep, code, callp->sy_narg, args); #endif rval[0] = 0; rval[1] = frame.sf_edx; diff --git a/sys/amd64/amd64/tsc.c b/sys/amd64/amd64/tsc.c index 836bff0..cc26d18 100644 --- a/sys/amd64/amd64/tsc.c +++ b/sys/amd64/amd64/tsc.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * from: @(#)clock.c 7.2 (Berkeley) 5/12/91 - * $Id: clock.c,v 1.3 1993/11/04 01:56:31 ache Exp $ + * $Id: clock.c,v 1.4 1993/11/25 01:31:29 wollman Exp $ */ /* @@ -233,7 +233,7 @@ resettodr() * Wire clock interrupt in. */ #define V(s) __CONCAT(V, s) -extern V(clk)(); +extern void V(clk)(); void enablertclock() diff --git a/sys/amd64/amd64/vm_machdep.c b/sys/amd64/amd64/vm_machdep.c index 773cf21..4bfaddf 100644 --- a/sys/amd64/amd64/vm_machdep.c +++ b/sys/amd64/amd64/vm_machdep.c @@ -37,7 +37,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.6 1993/10/15 10:34:29 rgrimes Exp $ + * $Id: vm_machdep.c,v 1.7 1993/11/25 01:31:02 wollman Exp $ */ #include "npx.h" @@ -95,7 +95,7 @@ cpu_fork(p1, p2) addr = trunc_page((u_int)vtopte(kstack)); vm_map_pageable(&p2->p_vmspace->vm_map, addr, addr+NBPG, FALSE); for (i=0; i < UPAGES; i++) - pmap_enter(&p2->p_vmspace->vm_pmap, kstack+i*NBPG, + pmap_enter(&p2->p_vmspace->vm_pmap, (vm_offset_t)kstack+i*NBPG, pmap_extract(kernel_pmap, ((int)p2->p_addr)+i*NBPG), /* * The user area has to be mapped writable because @@ -236,16 +236,16 @@ pagemove(from, to, size) /* * Convert kernel VA to physical address */ -int +u_long kvtop(addr) - register caddr_t addr; + register void *addr; { vm_offset_t va; va = pmap_extract(kernel_pmap, (vm_offset_t)addr); if (va == 0) panic("kvtop: zero page frame"); - return((int)va); + return((u_long)va); } #ifdef notdef diff --git a/sys/amd64/include/cpufunc.h b/sys/amd64/include/cpufunc.h index adaa70c..2c2b307 100644 --- a/sys/amd64/include/cpufunc.h +++ b/sys/amd64/include/cpufunc.h @@ -2,7 +2,7 @@ * Functions to provide access to special i386 instructions. * XXX - bezillions more are defined in locore.s but are not declared anywhere. * - * $Id: cpufunc.h,v 1.4 1993/11/07 17:42:47 wollman Exp $ + * $Id: cpufunc.h,v 1.5 1993/11/25 01:31:07 wollman Exp $ */ #ifndef _MACHINE_CPUFUNC_H_ @@ -177,7 +177,34 @@ strlen(s1) return (len); } +struct quehead { + struct quehead *qh_link; + struct quehead *qh_rlink; +}; + +static inline void +insque(void *a, void *b) +{ + register struct quehead *element = a, *head = b; + element->qh_link = head->qh_link; + head->qh_link = (struct quehead *)element; + element->qh_rlink = (struct quehead *)head; + ((struct quehead *)(element->qh_link))->qh_rlink + = (struct quehead *)element; +} + +static inline void +remque(void *a) +{ + register struct quehead *element = a; + ((struct quehead *)(element->qh_link))->qh_rlink = element->qh_rlink; + ((struct quehead *)(element->qh_rlink))->qh_link = element->qh_link; + element->qh_rlink = 0; +} + #else /* not __GNUC__ */ +extern void insque __P((void *, void *)); +extern void remque __P((void *)); int bdb __P((void)); void disable_intr __P((void)); @@ -187,17 +214,19 @@ void outb __P((u_int port, u_int data)); /* XXX - incompat */ #endif /* __GNUC__ */ -#define really_u_int int /* XXX */ -#define really_void int /* XXX */ - void load_cr0 __P((u_int cr0)); -really_u_int rcr0 __P((void)); - -#ifdef notyet -really_void setidt __P((int idx, /*XXX*/caddr_t func, int typ, int dpl)); -#endif - -#undef really_u_int -#undef really_void +u_int rcr0 __P((void)); +void load_cr3(u_long); +u_long rcr3(void); +u_long rcr2(void); + +void setidt __P((int, void (*)(), int, int)); +extern u_long kvtop(void *); +extern void tlbflush(void); +extern void outw(int /*u_short*/, int /*u_short*/); /* XXX inline!*/ +extern void outsb(int /*u_short*/, caddr_t, size_t); +extern void outsw(int /*u_short*/, caddr_t, size_t); +extern void insw(int /*u_short*/, caddr_t, size_t); +extern void fillw(int /*u_short*/, caddr_t, size_t); #endif /* _MACHINE_CPUFUNC_H_ */ diff --git a/sys/amd64/include/frame.h b/sys/amd64/include/frame.h index a7455b6..c61d179 100644 --- a/sys/amd64/include/frame.h +++ b/sys/amd64/include/frame.h @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * from: @(#)frame.h 5.2 (Berkeley) 1/18/91 - * $Id: frame.h,v 1.4 1993/11/17 23:25:03 wollman Exp $ + * $Id: frame.h,v 1.5 1993/12/03 05:10:00 alm Exp $ */ #ifndef _MACHINE_FRAME_H_ @@ -72,6 +72,8 @@ struct trapframe { int tf_ss; }; +extern int kdb_trap(int, int, struct trapframe *); + /* Interrupt stack frame */ struct intrframe { diff --git a/sys/amd64/include/pmap.h b/sys/amd64/include/pmap.h index 9feb23c..f71c276 100644 --- a/sys/amd64/include/pmap.h +++ b/sys/amd64/include/pmap.h @@ -42,7 +42,7 @@ * * from: hp300: @(#)pmap.h 7.2 (Berkeley) 12/16/90 * from: @(#)pmap.h 7.4 (Berkeley) 5/12/91 - * $Id: pmap.h,v 1.5 1993/11/07 17:43:02 wollman Exp $ + * $Id: pmap.h,v 1.6 1993/11/13 02:25:16 davidg Exp $ */ #ifndef _PMAP_MACHINE_ @@ -65,8 +65,8 @@ unsigned int pd_pfnum:20; /* physical page frame number of pte's*/ }; -#define PD_MASK 0xffc00000 /* page directory address bits */ -#define PT_MASK 0x003ff000 /* page table address bits */ +#define PD_MASK 0xffc00000UL /* page directory address bits */ +#define PT_MASK 0x003ff000UL /* page table address bits */ #define PD_SHIFT 22 /* page directory address shift */ #define PG_SHIFT 12 /* page table address shift */ @@ -94,7 +94,7 @@ unsigned int #define PG_N 0x00000800 /* Non-cacheable */ #define PG_M 0x00000040 #define PG_U 0x00000020 -#define PG_FRAME 0xfffff000 +#define PG_FRAME 0xfffff000UL #define PG_NOACC 0 #define PG_KR 0x00000000 @@ -199,7 +199,7 @@ extern pmap_t kernel_pmap; #define PMAP_ACTIVATE(pmapp, pcbp) \ if ((pmapp) != NULL /*&& (pmapp)->pm_pdchanged */) { \ (pcbp)->pcb_cr3 = \ - pmap_extract(kernel_pmap, (pmapp)->pm_pdir); \ + pmap_extract(kernel_pmap, (vm_offset_t)(pmapp)->pm_pdir); \ if ((pmapp) == &curproc->p_vmspace->vm_pmap) \ load_cr3((pcbp)->pcb_cr3); \ (pmapp)->pm_pdchanged = FALSE; \ @@ -232,6 +232,24 @@ pv_entry_t pv_table; /* array of entries, one per page */ #define pmap_resident_count(pmap) ((pmap)->pm_stats.resident_count) +extern pmap_t pmap_create(vm_size_t); +extern void pmap_pinit(struct pmap *); +extern void pmap_destroy(pmap_t); +extern void pmap_release(struct pmap *); +extern void pmap_reference(pmap_t); +extern void pmap_remove(struct pmap *, vm_offset_t, vm_offset_t); +extern void pmap_protect(struct pmap *, vm_offset_t, vm_offset_t, vm_prot_t); +extern void pmap_enter(pmap_t, vm_offset_t, vm_offset_t, vm_prot_t, boolean_t); +extern void pmap_change_wiring(pmap_t, vm_offset_t, boolean_t); +extern struct pte *pmap_pte(pmap_t, vm_offset_t); +extern vm_offset_t pmap_extract(pmap_t, vm_offset_t); +extern void pmap_copy(pmap_t, pmap_t, vm_offset_t, vm_size_t, vm_offset_t); +extern void pmap_collect(pmap_t); +struct pcb; extern void pmap_activate(pmap_t, struct pcb *); +extern pmap_t pmap_kernel(void); +extern void pmap_pageable(pmap_t, vm_offset_t, vm_offset_t, boolean_t); + + #endif /* KERNEL */ #endif /* _PMAP_MACHINE_ */ diff --git a/sys/amd64/include/vmparam.h b/sys/amd64/include/vmparam.h index a43615d..b7a3561 100644 --- a/sys/amd64/include/vmparam.h +++ b/sys/amd64/include/vmparam.h @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * from: @(#)vmparam.h 5.9 (Berkeley) 5/12/91 - * $Id: vmparam.h,v 1.7 1993/10/15 10:07:45 rgrimes Exp $ + * $Id: vmparam.h,v 1.8 1993/11/07 17:43:17 wollman Exp $ */ @@ -56,27 +56,27 @@ * Immediately after the user structure is the page table map, and then * kernal address space. */ -#define USRTEXT 0 -#define USRSTACK 0xFDBFE000 +#define USRTEXT 0UL +#define USRSTACK 0xFDBFE000UL #define BTOPUSRSTACK (0xFDC00-(UPAGES)) /* btop(USRSTACK) */ -#define LOWPAGES 0 +#define LOWPAGES 0UL #define HIGHPAGES UPAGES /* * Virtual memory related constants, all in bytes */ -#define MAXTSIZ (6*1024*1024) /* max text size */ +#define MAXTSIZ (6UL*1024*1024) /* max text size */ #ifndef DFLDSIZ -#define DFLDSIZ (16*1024*1024) /* initial data size limit */ +#define DFLDSIZ (16UL*1024*1024) /* initial data size limit */ #endif #ifndef MAXDSIZ -#define MAXDSIZ (32*1024*1024) /* max data size */ +#define MAXDSIZ (32UL*1024*1024) /* max data size */ #endif #ifndef DFLSSIZ -#define DFLSSIZ (512*1024) /* initial stack size limit */ +#define DFLSSIZ (512UL*1024) /* initial stack size limit */ #endif #ifndef MAXSSIZ -#define MAXSSIZ (8*1024*1024) /* max stack size */ +#define MAXSSIZ (8UL*1024*1024) /* max stack size */ #endif /* @@ -211,15 +211,15 @@ /* user/kernel map constants */ #define VM_MIN_ADDRESS ((vm_offset_t)0) -#define VM_MAXUSER_ADDRESS ((vm_offset_t)0xFDBFE000) -#define UPT_MIN_ADDRESS ((vm_offset_t)0xFDC00000) -#define UPT_MAX_ADDRESS ((vm_offset_t)0xFDFF7000) +#define VM_MAXUSER_ADDRESS ((vm_offset_t)0xFDBFE000UL) +#define UPT_MIN_ADDRESS ((vm_offset_t)0xFDC00000UL) +#define UPT_MAX_ADDRESS ((vm_offset_t)0xFDFF7000UL) #define VM_MAX_ADDRESS UPT_MAX_ADDRESS -#define VM_MIN_KERNEL_ADDRESS ((vm_offset_t)0xFDFF7000) +#define VM_MIN_KERNEL_ADDRESS ((vm_offset_t)0xFDFF7000UL) #define UPDT VM_MIN_KERNEL_ADDRESS -#define KPT_MIN_ADDRESS ((vm_offset_t)0xFDFF8000) -#define KPT_MAX_ADDRESS ((vm_offset_t)0xFDFFF000) -#define VM_MAX_KERNEL_ADDRESS ((vm_offset_t)0xFF7FF000) +#define KPT_MIN_ADDRESS ((vm_offset_t)0xFDFF8000UL) +#define KPT_MAX_ADDRESS ((vm_offset_t)0xFDFFF000UL) +#define VM_MAX_KERNEL_ADDRESS ((vm_offset_t)0xFF7FF000UL) /* virtual sizes (bytes) for various kernel submaps */ #define VM_MBUF_SIZE (NMBCLUSTERS*MCLBYTES) diff --git a/sys/amd64/isa/clock.c b/sys/amd64/isa/clock.c index 836bff0..cc26d18 100644 --- a/sys/amd64/isa/clock.c +++ b/sys/amd64/isa/clock.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * from: @(#)clock.c 7.2 (Berkeley) 5/12/91 - * $Id: clock.c,v 1.3 1993/11/04 01:56:31 ache Exp $ + * $Id: clock.c,v 1.4 1993/11/25 01:31:29 wollman Exp $ */ /* @@ -233,7 +233,7 @@ resettodr() * Wire clock interrupt in. */ #define V(s) __CONCAT(V, s) -extern V(clk)(); +extern void V(clk)(); void enablertclock() diff --git a/sys/amd64/isa/isa.c b/sys/amd64/isa/isa.c index b40ce6e..c689200 100644 --- a/sys/amd64/isa/isa.c +++ b/sys/amd64/isa/isa.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * from: @(#)isa.c 7.2 (Berkeley) 5/13/91 - * $Id: isa.c,v 1.9 1993/11/17 00:21:03 ache Exp $ + * $Id: isa.c,v 1.10 1993/11/25 01:31:39 wollman Exp $ */ /* @@ -322,19 +322,22 @@ config_isadev(isdp, mp) #define IDTVEC(name) __CONCAT(X,name) /* default interrupt vector table entries */ -extern IDTVEC(intr0), IDTVEC(intr1), IDTVEC(intr2), IDTVEC(intr3), +typedef void inthand_t(); +typedef void (*inthand_func_t)(); +extern inthand_t + IDTVEC(intr0), IDTVEC(intr1), IDTVEC(intr2), IDTVEC(intr3), IDTVEC(intr4), IDTVEC(intr5), IDTVEC(intr6), IDTVEC(intr7), IDTVEC(intr8), IDTVEC(intr9), IDTVEC(intr10), IDTVEC(intr11), IDTVEC(intr12), IDTVEC(intr13), IDTVEC(intr14), IDTVEC(intr15); -static *defvec[16] = { +static inthand_func_t defvec[16] = { &IDTVEC(intr0), &IDTVEC(intr1), &IDTVEC(intr2), &IDTVEC(intr3), &IDTVEC(intr4), &IDTVEC(intr5), &IDTVEC(intr6), &IDTVEC(intr7), &IDTVEC(intr8), &IDTVEC(intr9), &IDTVEC(intr10), &IDTVEC(intr11), &IDTVEC(intr12), &IDTVEC(intr13), &IDTVEC(intr14), &IDTVEC(intr15) }; /* out of range default interrupt vector gate entry */ -extern IDTVEC(intrdefault); +extern inthand_t IDTVEC(intrdefault); /* * Fill in default interrupt table (in case of spuruious interrupt |