Prototype and gcc -Wall cleanups

This commit is contained in:
christos 1996-05-03 19:41:56 +00:00
parent ffdbd55cb2
commit 5503f7b749
24 changed files with 282 additions and 168 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: autoconf.c,v 1.19 1996/03/29 01:15:04 mycroft Exp $ */
/* $NetBSD: autoconf.c,v 1.20 1996/05/03 19:41:56 christos Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
@ -57,10 +57,10 @@
#include <sys/device.h>
#include <machine/pte.h>
#include <machine/cpu.h>
void setroot __P((void));
void swapconf __P((void));
void dumpconf __P((void));
void swapconf __P((void));
void setroot __P((void));
/*
* The following several variables are related to
@ -131,11 +131,11 @@ swapconf()
u_long bootdev = 0; /* should be dev_t, but not until 32 bits */
static char devname[][2] = {
'w','d', /* 0 = wd */
's','w', /* 1 = sw */
'f','d', /* 2 = fd */
'w','t', /* 3 = wt */
's','d', /* 4 = sd -- new SCSI system */
{ 'w','d' }, /* 0 = wd */
{ 's','w' }, /* 1 = sw */
{ 'f','d' }, /* 2 = fd */
{ 'w','t' }, /* 3 = wt */
{ 's','d' }, /* 4 = sd -- new SCSI system */
};
/*
@ -147,10 +147,15 @@ void
setroot()
{
int majdev, mindev, unit, part, adaptor;
dev_t temp, orootdev;
dev_t orootdev;
#ifdef DOSWAP
dev_t temp = 0;
#endif
struct swdevt *swp;
/*printf("howto %x bootdev %x ", boothowto, bootdev);*/
#if 0
printf("howto %x bootdev %x ", boothowto, bootdev);
#endif
if (boothowto & RB_DFLTROOT ||
(bootdev & B_MAGICMASK) != (u_long)B_DEVMAGIC)
return;

View File

@ -1,4 +1,4 @@
/* $NetBSD: db_disasm.c,v 1.10 1996/02/02 18:05:58 mycroft Exp $ */
/* $NetBSD: db_disasm.c,v 1.11 1996/05/03 19:41:58 christos Exp $ */
/*
* Mach Operating System
@ -37,6 +37,8 @@
#include <ddb/db_access.h>
#include <ddb/db_sym.h>
#include <ddb/db_output.h>
#include <ddb/db_interface.h>
/*
* Size attributes
@ -807,9 +809,9 @@ char * db_index_reg_16[8] = {
};
char * db_reg[3][8] = {
"%al", "%cl", "%dl", "%bl", "%ah", "%ch", "%dh", "%bh",
"%ax", "%cx", "%dx", "%bx", "%sp", "%bp", "%si", "%di",
"%eax", "%ecx", "%edx", "%ebx", "%esp", "%ebp", "%esi", "%edi"
{ "%al", "%cl", "%dl", "%bl", "%ah", "%ch", "%dh", "%bh" },
{ "%ax", "%cx", "%dx", "%bx", "%sp", "%bp", "%si", "%di" },
{ "%eax", "%ecx", "%edx", "%ebx", "%esp", "%ebp", "%esi", "%edi" }
};
char * db_seg_reg[8] = {
@ -835,6 +837,11 @@ int db_lengths[] = {
(loc) += (size); \
} while (0)
db_addr_t db_read_address __P((db_addr_t, int, int, struct i_addr *));
void db_print_address __P((char *, int, struct i_addr *));
db_addr_t db_disasm_esc __P((db_addr_t, int, int, int, char *));
/*
* Read address at location and return updated location.
*/
@ -845,7 +852,7 @@ db_read_address(loc, short_addr, regmodrm, addrp)
int regmodrm;
struct i_addr *addrp; /* out */
{
int mod, rm, sib, index, ss, disp;
int mod, rm, sib, index, disp;
mod = f_mod(regmodrm);
rm = f_rm(regmodrm);
@ -1045,7 +1052,7 @@ db_disasm(loc, altfmt)
char * i_name;
int i_size;
int i_mode;
int regmodrm;
int regmodrm = 0;
boolean_t first;
int displ;
int prefix;

View File

@ -1,4 +1,4 @@
/* $NetBSD: db_interface.c,v 1.21 1996/03/30 07:57:16 mycroft Exp $ */
/* $NetBSD: db_interface.c,v 1.22 1996/05/03 19:42:00 christos Exp $ */
/*
* Mach Operating System
@ -34,18 +34,29 @@
#include <sys/param.h>
#include <sys/proc.h>
#include <sys/reboot.h>
#include <sys/systm.h> /* just for boothowto --eichin */
#include <sys/systm.h>
#include <vm/vm.h>
#include <dev/cons.h>
#include <machine/db_machdep.h>
#include <ddb/db_sym.h>
#include <ddb/db_command.h>
#include <ddb/db_extern.h>
#include <ddb/db_access.h>
#include <ddb/db_output.h>
extern label_t *db_recover;
extern char *trap_type[];
extern int trap_types;
int db_active = 0;
void kdbprinttrap __P((int, int));
/*
* Print trap reason.
*/
@ -67,7 +78,7 @@ kdbprinttrap(type, code)
int
kdb_trap(type, code, regs)
int type, code;
register db_regs_t *regs;
db_regs_t *regs;
{
int s;
@ -135,13 +146,13 @@ kdb_trap(type, code, regs)
void
db_read_bytes(addr, size, data)
vm_offset_t addr;
register int size;
register size_t size;
register char *data;
{
register char *src;
src = (char *)addr;
while (--size >= 0)
while (size-- > 0)
*data++ = *src++;
}
@ -153,7 +164,7 @@ pt_entry_t *pmap_pte __P((pmap_t, vm_offset_t));
void
db_write_bytes(addr, size, data)
vm_offset_t addr;
register int size;
register size_t size;
register char *data;
{
register char *dst;
@ -183,7 +194,7 @@ db_write_bytes(addr, size, data)
dst = (char *)addr;
while (--size >= 0)
while (size-- > 0)
*dst++ = *data++;
if (ptep0) {

View File

@ -1,4 +1,4 @@
/* $NetBSD: db_trace.c,v 1.17 1995/10/11 04:19:35 mycroft Exp $ */
/* $NetBSD: db_trace.c,v 1.18 1996/05/03 19:42:01 christos Exp $ */
/*
* Mach Operating System
@ -27,32 +27,35 @@
*/
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/proc.h>
#include <machine/db_machdep.h>
#include <ddb/db_access.h>
#include <ddb/db_sym.h>
#include <ddb/db_access.h>
#include <ddb/db_variables.h>
#include <ddb/db_output.h>
#include <ddb/db_interface.h>
/*
* Machine register set.
*/
struct db_variable db_regs[] = {
"es", &ddb_regs.tf_es, FCN_NULL,
"ds", &ddb_regs.tf_ds, FCN_NULL,
"edi", &ddb_regs.tf_edi, FCN_NULL,
"esi", &ddb_regs.tf_esi, FCN_NULL,
"ebp", &ddb_regs.tf_ebp, FCN_NULL,
"ebx", &ddb_regs.tf_ebx, FCN_NULL,
"edx", &ddb_regs.tf_edx, FCN_NULL,
"ecx", &ddb_regs.tf_ecx, FCN_NULL,
"eax", &ddb_regs.tf_eax, FCN_NULL,
"eip", &ddb_regs.tf_eip, FCN_NULL,
"cs", &ddb_regs.tf_cs, FCN_NULL,
"eflags", &ddb_regs.tf_eflags, FCN_NULL,
"esp", &ddb_regs.tf_esp, FCN_NULL,
"ss", &ddb_regs.tf_ss, FCN_NULL,
{ "es", &ddb_regs.tf_es, FCN_NULL },
{ "ds", &ddb_regs.tf_ds, FCN_NULL },
{ "edi", &ddb_regs.tf_edi, FCN_NULL },
{ "esi", &ddb_regs.tf_esi, FCN_NULL },
{ "ebp", &ddb_regs.tf_ebp, FCN_NULL },
{ "ebx", &ddb_regs.tf_ebx, FCN_NULL },
{ "edx", &ddb_regs.tf_edx, FCN_NULL },
{ "ecx", &ddb_regs.tf_ecx, FCN_NULL },
{ "eax", &ddb_regs.tf_eax, FCN_NULL },
{ "eip", &ddb_regs.tf_eip, FCN_NULL },
{ "cs", &ddb_regs.tf_cs, FCN_NULL },
{ "eflags", &ddb_regs.tf_eflags, FCN_NULL },
{ "esp", &ddb_regs.tf_esp, FCN_NULL },
{ "ss", &ddb_regs.tf_ss, FCN_NULL },
};
struct db_variable *db_eregs = db_regs + sizeof(db_regs)/sizeof(db_regs[0]);
@ -77,6 +80,10 @@ db_addr_t db_syscall_symbol_value = 0;
db_addr_t db_kdintr_symbol_value = 0;
boolean_t db_trace_symbols_found = FALSE;
void db_find_trace_symbols __P((void));
int db_numargs __P((struct i386_frame *));
void db_nextframe __P((struct i386_frame **, db_addr_t *, int *, int));
void
db_find_trace_symbols()
{
@ -177,7 +184,7 @@ db_stack_trace_cmd(addr, have_addr, count, modif)
struct i386_frame *frame, *lastframe;
int *argp;
db_addr_t callpc;
int is_trap;
int is_trap = 0;
boolean_t kernel_only = TRUE;
boolean_t trace_thread = FALSE;
@ -205,7 +212,7 @@ db_stack_trace_cmd(addr, have_addr, count, modif)
frame = (struct i386_frame *)ddb_regs.tf_ebp;
callpc = (db_addr_t)ddb_regs.tf_eip;
} else if (trace_thread) {
printf ("db_trace.c: can't trace thread\n");
db_printf ("db_trace.c: can't trace thread\n");
} else {
frame = (struct i386_frame *)addr;
callpc = (db_addr_t)
@ -307,7 +314,7 @@ db_stack_trace_cmd(addr, have_addr, count, modif)
if (INKERNEL((int)frame)) {
/* staying in kernel */
if (frame <= lastframe) {
db_printf("Bad frame pointer: 0x%x\n", frame);
db_printf("Bad frame pointer: %p\n", frame);
break;
}
} else if (INKERNEL((int)lastframe)) {
@ -317,7 +324,7 @@ db_stack_trace_cmd(addr, have_addr, count, modif)
} else {
/* in user */
if (frame <= lastframe) {
db_printf("Bad user frame pointer: 0x%x\n",
db_printf("Bad user frame pointer: %p\n",
frame);
break;
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: disksubr.c,v 1.20 1996/04/03 08:18:27 mycroft Exp $ */
/* $NetBSD: disksubr.c,v 1.21 1996/05/03 19:42:03 christos Exp $ */
/*
* Copyright (c) 1982, 1986, 1988 Regents of the University of California.
@ -64,7 +64,7 @@ int fat_types[] = { DOSPTYP_FAT12, DOSPTYP_FAT16S,
char *
readdisklabel(dev, strat, lp, osdep)
dev_t dev;
void (*strat)();
void (*strat) __P((struct buf *));
register struct disklabel *lp;
struct cpu_disklabel *osdep;
{
@ -228,7 +228,6 @@ setdisklabel(olp, nlp, openmask, osdep)
u_long openmask;
struct cpu_disklabel *osdep;
{
struct dos_partition *dp = osdep->dosparts;
register i;
register struct partition *opp, *npp;
@ -282,7 +281,7 @@ setdisklabel(olp, nlp, openmask, osdep)
int
writedisklabel(dev, strat, lp, osdep)
dev_t dev;
void (*strat)();
void (*strat) __P((struct buf *));
register struct disklabel *lp;
struct cpu_disklabel *osdep;
{
@ -340,7 +339,7 @@ writedisklabel(dev, strat, lp, osdep)
(*strat)(bp);
/* if successful, locate disk label within block and validate */
if (error = biowait(bp))
if ((error = biowait(bp)) != 0)
goto done;
for (dlp = (struct disklabel *)bp->b_data;
dlp <= (struct disklabel *)(bp->b_data + lp->d_secsize - sizeof(*dlp));

View File

@ -1,4 +1,4 @@
/* $NetBSD: freebsd_machdep.c,v 1.9 1996/04/18 08:36:20 mycroft Exp $ */
/* $NetBSD: freebsd_machdep.c,v 1.10 1996/05/03 19:42:05 christos Exp $ */
/*-
* Copyright (c) 1993, 1994, 1995, 1996 Charles M. Hannum. All rights reserved.
@ -374,7 +374,7 @@ freebsd_ptrace_getregs(fregs, addr, datap)
return 0;
}
#ifdef DIAGNOSTIC
printf("freebsd_ptrace_getregs: *(0x%08x)\n", offset);
printf("freebsd_ptrace_getregs: *(0x%08lx)\n", offset);
#endif
return EFAULT;
}
@ -401,7 +401,7 @@ freebsd_ptrace_setregs(fregs, addr, data)
return 0;
}
#ifdef DIAGNOSTIC
printf("freebsd_ptrace_setregs: *(0x%08x) = 0x%08x\n", offset, data);
printf("freebsd_ptrace_setregs: *(0x%08lx) = 0x%08x\n", offset, data);
#endif
return EFAULT;
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: gdt.c,v 1.7 1996/02/27 22:45:01 jtc Exp $ */
/* $NetBSD: gdt.c,v 1.8 1996/05/03 19:42:06 christos Exp $ */
/*-
* Copyright (c) 1996 The NetBSD Foundation, Inc.
@ -59,6 +59,15 @@ int gdt_flags;
#define GDT_LOCKED 0x1
#define GDT_WANTED 0x2
static __inline void gdt_lock __P((void));
static __inline void gdt_unlock __P((void));
void gdt_compact __P((void));
void gdt_init __P((void));
void gdt_grow __P((void));
void gdt_shrink __P((void));
int gdt_get_slot __P((void));
void gdt_put_slot __P((int));
/*
* Lock and unlock the GDT, to avoid races in case gdt_{ge,pu}t_slot() sleep
* waiting for memory.
@ -68,7 +77,7 @@ int gdt_flags;
* some time after the GDT is unlocked, so gdt_compact() could attempt to
* reclaim it.
*/
static inline void
static __inline void
gdt_lock()
{
@ -79,7 +88,7 @@ gdt_lock()
gdt_flags |= GDT_LOCKED;
}
static inline void
static __inline void
gdt_unlock()
{

View File

@ -1,4 +1,4 @@
/* $NetBSD: genassym.c,v 1.48 1996/03/28 23:44:04 mycroft Exp $ */
/* $NetBSD: genassym.c,v 1.49 1996/05/03 19:42:07 christos Exp $ */
/*-
* Copyright (c) 1995 Charles M. Hannum. All rights reserved.
@ -71,6 +71,8 @@
#include <stdio.h>
#include <stddef.h>
int main __P((void));
int
main()
{

View File

@ -1,4 +1,4 @@
/* $NetBSD: in_cksum.c,v 1.8 1995/05/01 01:24:04 mycroft Exp $ */
/* $NetBSD: in_cksum.c,v 1.9 1996/05/03 19:42:09 christos Exp $ */
/*-
* Copyright (c) 1994, 1995 Charles M. Hannum. All rights reserved.
@ -38,7 +38,9 @@
*/
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/mbuf.h>
#include <netinet/in.h>
/*
* Checksum routine for Internet Protocol family headers.

View File

@ -1,4 +1,4 @@
/* $NetBSD: linux_machdep.c,v 1.28 1996/04/18 08:36:22 mycroft Exp $ */
/* $NetBSD: linux_machdep.c,v 1.29 1996/05/03 19:42:11 christos Exp $ */
/*
* Copyright (c) 1995 Frank van der Linden
@ -57,6 +57,7 @@
#include <compat/linux/linux_signal.h>
#include <compat/linux/linux_syscallargs.h>
#include <compat/linux/linux_util.h>
#include <compat/linux/linux_ioctl.h>
#include <machine/cpu.h>
#include <machine/cpufunc.h>
@ -76,6 +77,14 @@
#include <arch/i386/isa/pcvt/pcvt_ioctl.h>
#endif
#ifdef USER_LDT
#include <machine/cpu.h>
int linux_read_ldt __P((struct proc *, struct linux_sys_modify_ldt_args *,
register_t *));
int linux_write_ldt __P((struct proc *, struct linux_sys_modify_ldt_args *,
register_t *));
#endif
/*
* Deal with some i386-specific things in the Linux emulation code.
* This means just signals for now, will include stuff like
@ -284,10 +293,10 @@ linux_read_ldt(p, uap, retval)
parms = stackgap_alloc(&sg, sizeof(gl));
if (error = copyout(&gl, parms, sizeof(gl)))
if ((error = copyout(&gl, parms, sizeof(gl))) != 0)
return (error);
if (error = i386_get_ldt(p, parms, retval))
if ((error = i386_get_ldt(p, parms, retval)) != 0)
return (error);
*retval *= sizeof(union descriptor);
@ -324,7 +333,7 @@ linux_write_ldt(p, uap, retval)
if (SCARG(uap, bytecount) != sizeof(ldt_info))
return (EINVAL);
if (error = copyin(SCARG(uap, ptr), &ldt_info, sizeof(ldt_info)))
if ((error = copyin(SCARG(uap, ptr), &ldt_info, sizeof(ldt_info))) != 0)
return error;
if (ldt_info.contents == 3)
return (EINVAL);
@ -353,12 +362,12 @@ linux_write_ldt(p, uap, retval)
parms = stackgap_alloc(&sg, sizeof(sl));
if (error = copyout(&sd, sl.desc, sizeof(sd)))
if ((error = copyout(&sd, sl.desc, sizeof(sd))) != 0)
return (error);
if (error = copyout(&sl, parms, sizeof(sl)))
if ((error = copyout(&sl, parms, sizeof(sl))) != 0)
return (error);
if (error = i386_set_ldt(p, parms, retval))
if ((error = i386_set_ldt(p, parms, retval)) != 0)
return (error);
*retval = 0;
@ -423,15 +432,12 @@ linux_machdepioctl(p, v, retval)
syscallarg(u_long) com;
syscallarg(caddr_t) data;
} */ *uap = v;
struct sys_ioctl_args bia, tmparg;
struct sys_ioctl_args bia;
u_long com;
#if NVT > 0
int error, mode;
int error;
struct vt_mode lvt;
caddr_t bvtp, sg;
u_int fd;
struct file *fp;
struct filedesc *fdp;
#endif
SCARG(&bia, fd) = SCARG(uap, fd);
@ -506,7 +512,7 @@ linux_machdepioctl(p, v, retval)
break;
#endif
default:
printf("linux_machdepioctl: invalid ioctl %08x\n", com);
printf("linux_machdepioctl: invalid ioctl %08lx\n", com);
return EINVAL;
}
SCARG(&bia, com) = com;
@ -524,9 +530,11 @@ linux_sys_iopl(p, v, retval)
void *v;
register_t *retval;
{
#if 0
struct linux_sys_iopl_args /* {
syscallarg(int) level;
} */ *uap = v;
#endif
struct trapframe *fp = p->p_md.md_regs;
if (suser(p->p_ucred, &p->p_acflag) != 0)

View File

@ -1,4 +1,4 @@
/* $NetBSD: machdep.c,v 1.199 1996/04/18 09:58:13 mycroft Exp $ */
/* $NetBSD: machdep.c,v 1.200 1996/05/03 19:42:15 christos Exp $ */
/*-
* Copyright (c) 1993, 1994, 1995, 1996 Charles M. Hannum. All rights reserved.
@ -77,6 +77,8 @@
#include <vm/vm_kern.h>
#include <vm/vm_page.h>
#include <sys/sysctl.h>
#include <machine/cpu.h>
#include <machine/cpufunc.h>
#include <machine/gdt.h>
@ -92,6 +94,13 @@
#include <i386/isa/isa_machdep.h>
#include <i386/isa/nvram.h>
#ifdef DDB
#include <machine/db_machdep.h>
#include <ddb/db_access.h>
#include <ddb/db_sym.h>
#include <ddb/db_extern.h>
#endif
#ifdef VM86
#include <machine/vm86.h>
#endif
@ -135,10 +144,14 @@ extern vm_offset_t avail_start, avail_end;
static vm_offset_t hole_start, hole_end;
static vm_offset_t avail_next;
void identifycpu __P((void));
caddr_t allocsys __P((caddr_t));
void dumpsys __P((void));
void cpu_reset __P((void));
caddr_t allocsys __P((caddr_t));
void dumpsys __P((void));
void identifycpu __P((void));
void init386 __P((vm_offset_t));
void consinit __P((void));
#ifdef COMPAT_NOMID
static int exec_nomid __P((struct proc *, struct exec_package *));
#endif
/*
* Machine-dependent startup code
@ -243,7 +256,7 @@ cpu_startup()
for (i = 1; i < ncallout; i++)
callout[i-1].c_next = &callout[i];
printf("avail mem = %d\n", ptoa(cnt.v_free_count));
printf("avail mem = %ld\n", ptoa(cnt.v_free_count));
printf("using %d buffers containing %d bytes of memory\n",
nbuf, bufpages * CLBYTES);
@ -362,7 +375,6 @@ struct cpu_nameclass i386_cpus[] = {
void
identifycpu()
{
int len;
extern char cpu_vendor[];
printf("CPU: ");
@ -484,6 +496,8 @@ cpu_sysctl(name, namelen, oldp, oldlenp, newp, newlen, p)
}
#ifdef COMPAT_IBCS2
void ibcs2_sendsig __P((sig_t, int, int, u_long));
void
ibcs2_sendsig(catcher, sig, mask, code)
sig_t catcher;
@ -799,8 +813,7 @@ dumpsys()
int maddr, psize;
daddr_t blkno;
int (*dump) __P((dev_t, daddr_t, caddr_t, size_t));
int error = 0;
int c;
int error;
/* Save registers. */
savectx(&dumppcb);
@ -817,7 +830,7 @@ dumpsys()
dumpconf();
if (dumplo < 0)
return;
printf("\ndumping to dev %x, offset %d\n", dumpdev, dumplo);
printf("\ndumping to dev %x, offset %ld\n", dumpdev, dumplo);
psize = (*bdevsw[major(dumpdev)].d_psize)(dumpdev);
printf("dump ");
@ -835,6 +848,7 @@ dumpsys()
maddr = 0;
blkno = dumplo;
dump = bdevsw[major(dumpdev)].d_dump;
error = 0;
for (i = 0; i < bytes; i += n) {
/*
* Avoid dumping the ISA memory hole, and areas that
@ -1044,9 +1058,7 @@ init386(first_avail)
int x;
unsigned biosbasemem, biosextmem;
struct region_descriptor region;
extern char etext[], sigcode[], esigcode[];
extern void consinit __P((void));
extern void lgdt();
proc0.p_addr = proc0paddr;
@ -1291,7 +1303,6 @@ cpu_exec_aout_prep_oldzmagic(p, epp)
struct exec_package *epp;
{
struct exec *execp = epp->ep_hdr;
struct exec_vmcmd *ccmdp;
epp->ep_taddr = 0;
epp->ep_tsize = execp->a_text;

View File

@ -1,4 +1,4 @@
/* $NetBSD: math_emulate.c,v 1.16 1996/02/02 18:06:01 mycroft Exp $ */
/* $NetBSD: math_emulate.c,v 1.17 1996/05/03 19:42:17 christos Exp $ */
/*
* expediant "port" of linux 8087 emulator to 386BSD, with apologies -wfj
@ -68,7 +68,9 @@ static temp_real_unaligned * __st(int i);
I387.twd = 0x0000; \
} while (0)
math_emulate(struct trapframe *info)
int
math_emulate(info)
struct trapframe *info;
{
u_short code;
temp_real tmp;
@ -652,7 +654,7 @@ void get_short_int(temp_real * tmp,
addr = ea(info,code);
ti.a = (signed short) fusword((u_short *) addr);
ti.b = 0;
if (ti.sign = (ti.a < 0))
if ((ti.sign = (ti.a < 0)) != 0)
ti.a = - ti.a;
int_to_real(&ti,tmp);
}
@ -666,7 +668,7 @@ void get_long_int(temp_real * tmp,
addr = ea(info,code);
ti.a = fuword((u_long *) addr);
ti.b = 0;
if (ti.sign = (ti.a < 0))
if ((ti.sign = (ti.a < 0)) != 0)
ti.a = - ti.a;
int_to_real(&ti,tmp);
}
@ -680,7 +682,7 @@ void get_longlong_int(temp_real * tmp,
addr = ea(info,code);
ti.a = fuword((u_long *) addr);
ti.b = fuword((u_long *) addr + 1);
if (ti.sign = (ti.b < 0))
if ((ti.sign = (ti.b < 0)) != 0)
__asm__("notl %0 ; notl %1\n\t"
"addl $1,%0 ; adcl $0,%1"
:"=r" (ti.a),"=r" (ti.b)

View File

@ -1,4 +1,4 @@
/* $NetBSD: mem.c,v 1.30 1995/10/11 04:19:46 mycroft Exp $ */
/* $NetBSD: mem.c,v 1.31 1996/05/03 19:42:19 christos Exp $ */
/*
* Copyright (c) 1988 University of Utah.
@ -45,7 +45,6 @@
*/
#include <sys/param.h>
#include <sys/conf.h>
#include <sys/buf.h>
#include <sys/systm.h>
#include <sys/uio.h>
@ -54,6 +53,7 @@
#include <sys/fcntl.h>
#include <machine/cpu.h>
#include <machine/conf.h>
#include <vm/vm.h>
@ -62,9 +62,10 @@ caddr_t zeropage;
/*ARGSUSED*/
int
mmopen(dev, flag, mode)
mmopen(dev, flag, mode, p)
dev_t dev;
int flag, mode;
struct proc *p;
{
switch (minor(dev)) {
@ -87,9 +88,10 @@ mmopen(dev, flag, mode)
/*ARGSUSED*/
int
mmclose(dev, flag, mode)
mmclose(dev, flag, mode, p)
dev_t dev;
int flag, mode;
struct proc *p;
{
return (0);
@ -185,7 +187,6 @@ mmrw(dev, uio, flags)
uio->uio_resid -= c;
}
if (minor(dev) == 0) {
unlock:
if (physlock > 1)
wakeup((caddr_t)&physlock);
physlock = 0;

View File

@ -1,4 +1,4 @@
/* $NetBSD: ns_cksum.c,v 1.4 1996/02/02 18:06:03 mycroft Exp $ */
/* $NetBSD: ns_cksum.c,v 1.5 1996/05/03 19:42:20 christos Exp $ */
/*
* Copyright (c) 1982, 1988 Regents of the University of California.
@ -37,6 +37,7 @@
#include <sys/param.h>
#include <sys/mbuf.h>
#include <netns/ns_var.h>
/*
* Checksum routine for Network Systems Protocol Packets (Big-Endian).

View File

@ -1,4 +1,4 @@
/* $NetBSD: pmap.c,v 1.35 1996/04/03 08:21:05 mycroft Exp $ */
/* $NetBSD: pmap.c,v 1.36 1996/05/03 19:42:22 christos Exp $ */
/*
* Copyright (c) 1993, 1994, 1995 Charles M. Hannum. All rights reserved.
@ -79,6 +79,7 @@
*/
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/proc.h>
#include <sys/malloc.h>
#include <sys/user.h>
@ -178,7 +179,14 @@ TAILQ_HEAD(pv_page_list, pv_page) pv_page_freelist;
int pv_nfree;
pt_entry_t *pmap_pte __P((pmap_t, vm_offset_t));
struct pv_entry * pmap_alloc_pv __P((void));
void pmap_free_pv __P((struct pv_entry *));
void i386_protection_init __P((void));
void pmap_collect_pv __P((void));
__inline void pmap_remove_pv __P((pmap_t, vm_offset_t, u_int));
__inline void pmap_enter_pv __P((pmap_t, vm_offset_t, u_int));
void pmap_deactivate __P((pmap_t, struct pcb *));
void pmap_remove_all __P((vm_offset_t));
#if BSDVM_COMPAT
#include <sys/msgbuf.h>
@ -211,9 +219,6 @@ pmap_bootstrap(virtual_start)
vm_offset_t va;
pt_entry_t *pte;
#endif
extern int physmem;
extern vm_offset_t reserve_dumppages(vm_offset_t);
/* XXX: allow for msgbuf */
avail_end -= i386_round_page(sizeof(struct msgbuf));
@ -301,9 +306,8 @@ pmap_virtual_space(startp, endp)
void
pmap_init()
{
vm_offset_t addr, addr2;
vm_offset_t addr;
vm_size_t s;
int rv;
if (PAGE_SIZE != NBPG)
panic("pmap_init: CLSIZE != 1");
@ -368,7 +372,6 @@ pmap_free_pv(pv)
struct pv_entry *pv;
{
register struct pv_page *pvp;
register int i;
pvp = (struct pv_page *) trunc_page(pv);
switch (++pvp->pvp_pgi.pgi_nfree) {
@ -828,7 +831,9 @@ reduce wiring count on page table pages as references drop
*pte = 0;
#ifndef __GNUC__
next:
#endif
sva += NBPG;
pte++;
}
@ -1006,7 +1011,9 @@ pmap_protect(pmap, sva, eva, prot)
i386prot |= PG_u | PG_RW;
pmap_pte_set_prot(pte, i386prot);
#ifndef __GNUC__
next:
#endif
sva += NBPG;
pte++;
}
@ -1079,7 +1086,8 @@ pmap_enter(pmap, va, pa, prot, wired)
/*
* Check for wiring change and adjust statistics.
*/
if (wired && !pmap_pte_w(pte) || !wired && pmap_pte_w(pte)) {
if ((wired && !pmap_pte_w(pte)) ||
(!wired && pmap_pte_w(pte))) {
/*
* We don't worry about wiring PT pages as they remain
* resident as long as there are valid mappings in them.
@ -1245,7 +1253,7 @@ pmap_change_wiring(pmap, va, wired)
}
#endif
if (wired && !pmap_pte_w(pte) || !wired && pmap_pte_w(pte)) {
if ((wired && !pmap_pte_w(pte)) || (!wired && pmap_pte_w(pte))) {
if (wired)
pmap->pm_stats.wired_count++;
else
@ -1361,12 +1369,6 @@ void
pmap_collect(pmap)
pmap_t pmap;
{
register vm_offset_t pa;
register struct pv_entry *pv;
register pt_entry_t *pte;
vm_offset_t kpa;
int s;
#ifdef DEBUG
printf("pmap_collect(%x) ", pmap);
#endif

View File

@ -1,4 +1,4 @@
/* $NetBSD: process_machdep.c,v 1.21 1996/04/11 07:47:48 mycroft Exp $ */
/* $NetBSD: process_machdep.c,v 1.22 1996/05/03 19:42:25 christos Exp $ */
/*
* Copyright (c) 1995, 1996 Charles M. Hannum. All rights reserved.
@ -80,7 +80,10 @@
#include <machine/vm86.h>
#endif
static inline struct trapframe *
static __inline struct trapframe *process_frame __P((struct proc *));
static __inline struct save87 *process_fpframe __P((struct proc *));
static __inline struct trapframe *
process_frame(p)
struct proc *p;
{
@ -88,7 +91,7 @@ process_frame(p)
return (p->p_md.md_regs);
}
static inline struct save87 *
static __inline struct save87 *
process_fpframe(p)
struct proc *p;
{

View File

@ -1,4 +1,4 @@
/* $NetBSD: svr4_machdep.c,v 1.23 1996/04/18 08:36:31 mycroft Exp $ */
/* $NetBSD: svr4_machdep.c,v 1.24 1996/05/03 19:42:26 christos Exp $ */
/*
* Copyright (c) 1994 Christos Zoulas
@ -137,7 +137,6 @@ svr4_setcontext(p, uc)
struct proc *p;
struct svr4_ucontext *uc;
{
struct sigcontext *scp, context;
struct sigacts *psp = p->p_sigacts;
register struct trapframe *tf;
svr4_greg_t *r = uc->uc_mcontext.greg;
@ -297,7 +296,7 @@ svr4_getsiginfo(si, sig, code, addr)
si->si_code = 0;
si->si_trap = 0;
#ifdef DIAGNOSTIC
printf("sig %d code %d\n", sig, code);
printf("sig %d code %ld\n", sig, code);
panic("svr4_getsiginfo");
#endif
break;
@ -359,8 +358,10 @@ svr4_sendsig(catcher, sig, mask, code)
frame.sf_sip = &fp->sf_si;
frame.sf_ucp = &fp->sf_uc;
frame.sf_handler = catcher;
printf("sig = %d, sip %x, ucp = %x, handler = %x\n",
#ifdef DEBUG_SVR4
printf("sig = %d, sip %p, ucp = %p, handler = %p\n",
frame.sf_signum, frame.sf_sip, frame.sf_ucp, frame.sf_handler);
#endif
if (copyout(&frame, fp, sizeof(frame)) != 0) {
/*
@ -470,7 +471,7 @@ svr4_sys_sysarch(p, v, retval)
#endif
default:
printf("svr4_sysarch(%d), a1 %x\n", SCARG(uap, op),
printf("svr4_sysarch(%d), a1 %p\n", SCARG(uap, op),
SCARG(uap, a1));
return 0;
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: swapgeneric.c,v 1.11 1996/04/03 09:15:26 mycroft Exp $ */
/* $NetBSD: swapgeneric.c,v 1.12 1996/05/03 19:42:28 christos Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
@ -46,7 +46,10 @@
#include <sys/device.h>
#include <sys/disklabel.h>
#include <dev/cons.h>
#include <machine/pte.h>
#include <machine/cpu.h>
#include "wdc.h"
#include "fdc.h"
@ -107,8 +110,8 @@ struct genericconf {
{ 0 }
};
extern int ffs_mountroot();
int (*mountroot)() = ffs_mountroot;
extern int ffs_mountroot __P((void *));
int (*mountroot) __P((void *)) = ffs_mountroot;
void gets __P((char *));

View File

@ -1,4 +1,4 @@
/* $NetBSD: sys_machdep.c,v 1.27 1996/01/08 13:51:36 mycroft Exp $ */
/* $NetBSD: sys_machdep.c,v 1.28 1996/05/03 19:42:29 christos Exp $ */
/*-
* Copyright (c) 1995 Charles M. Hannum. All rights reserved.
@ -72,9 +72,18 @@
extern vm_map_t kernel_map;
#ifdef USER_LDT
int i386_get_ldt __P((struct proc *, char *, register_t *));
int i386_set_ldt __P((struct proc *, char *, register_t *));
#endif
int i386_iopl __P((struct proc *, char *, register_t *));
int i386_get_ioperm __P((struct proc *, char *, register_t *));
int i386_set_ioperm __P((struct proc *, char *, register_t *));
#ifdef TRACE
int nvualarm;
int
sys_vtrace(p, v, retval)
struct proc *p;
void *v;
@ -160,7 +169,7 @@ i386_get_ldt(p, args, retval)
union descriptor *lp;
struct i386_get_ldt_args ua;
if (error = copyin(args, &ua, sizeof(ua)))
if ((error = copyin(args, &ua, sizeof(ua))) != 0)
return (error);
#ifdef DEBUG
@ -185,7 +194,8 @@ i386_get_ldt(p, args, retval)
lp += ua.start;
num = min(ua.num, nldt - ua.start);
if (error = copyout(lp, ua.desc, num * sizeof(union descriptor)))
error = copyout(lp, ua.desc, num * sizeof(union descriptor));
if (error)
return (error);
*retval = num;
@ -205,7 +215,7 @@ i386_set_ldt(p, args, retval)
struct i386_set_ldt_args ua;
union descriptor desc;
if (error = copyin(args, &ua, sizeof(ua)))
if ((error = copyin(args, &ua, sizeof(ua))) != 0)
return (error);
#ifdef DEBUG
@ -258,10 +268,11 @@ i386_set_ldt(p, args, retval)
savectx(curpcb);
fsslot = IDXSEL(pcb->pcb_fs);
gsslot = IDXSEL(pcb->pcb_gs);
error = 0;
/* Check descriptors for access violations. */
for (i = 0, n = ua.start; i < ua.num; i++, n++) {
if (error = copyin(&ua.desc[i], &desc, sizeof(desc)))
if ((error = copyin(&ua.desc[i], &desc, sizeof(desc))) != 0)
return (error);
switch (desc.sd.sd_type) {
@ -315,7 +326,7 @@ i386_set_ldt(p, args, retval)
/* Now actually replace the descriptors. */
for (i = 0, n = ua.start; i < ua.num; i++, n++) {
if (error = copyin(&ua.desc[i], &desc, sizeof(desc)))
if ((error = copyin(&ua.desc[i], &desc, sizeof(desc))) != 0)
goto out;
pcb->pcb_ldt[n] = desc;
@ -339,10 +350,10 @@ i386_iopl(p, args, retval)
struct trapframe *tf = p->p_md.md_regs;
struct i386_iopl_args ua;
if (error = suser(p->p_ucred, &p->p_acflag))
if ((error = suser(p->p_ucred, &p->p_acflag)) != 0)
return error;
if (error = copyin(args, &ua, sizeof(ua)))
if ((error = copyin(args, &ua, sizeof(ua))) != 0)
return error;
if (ua.iopl)
@ -363,7 +374,7 @@ i386_get_ioperm(p, args, retval)
struct pcb *pcb = &p->p_addr->u_pcb;
struct i386_get_ioperm_args ua;
if (error = copyin(args, &ua, sizeof(ua)))
if ((error = copyin(args, &ua, sizeof(ua))) != 0)
return (error);
return copyout(pcb->pcb_iomap, ua.iomap, sizeof(pcb->pcb_iomap));
@ -379,10 +390,10 @@ i386_set_ioperm(p, args, retval)
struct pcb *pcb = &p->p_addr->u_pcb;
struct i386_set_ioperm_args ua;
if (error = suser(p->p_ucred, &p->p_acflag))
if ((error = suser(p->p_ucred, &p->p_acflag)) != 0)
return error;
if (error = copyin(args, &ua, sizeof(ua)))
if ((error = copyin(args, &ua, sizeof(ua))) != 0)
return (error);
return copyin(ua.iomap, pcb->pcb_iomap, sizeof(pcb->pcb_iomap));

View File

@ -1,4 +1,4 @@
/* $NetBSD: trap.c,v 1.93 1996/04/15 00:20:32 mycroft Exp $ */
/* $NetBSD: trap.c,v 1.94 1996/05/03 19:42:31 christos Exp $ */
#undef DEBUG
#define DEBUG
@ -66,6 +66,9 @@
#include <machine/psl.h>
#include <machine/reg.h>
#include <machine/trap.h>
#ifdef DDB
#include <machine/db_machdep.h>
#endif
#ifdef COMPAT_IBCS2
#include <compat/ibcs2/ibcs2_errno.h>
@ -83,11 +86,16 @@ extern struct emul emul_freebsd;
#include "npx.h"
static __inline void userret __P((struct proc *, int, u_quad_t));
void trap __P((struct trapframe));
int trapwrite __P((unsigned));
void syscall __P((struct trapframe));
/*
* Define the code needed before returning to user mode, for
* trap and syscall.
*/
static inline void
static __inline void
userret(p, pc, oticks)
register struct proc *p;
int pc;
@ -172,7 +180,7 @@ trap(frame)
register struct proc *p = curproc;
int type = frame.tf_trapno;
u_quad_t sticks;
struct pcb *pcb;
struct pcb *pcb = NULL;
extern char fusubail[],
resume_iret[], resume_pop_ds[], resume_pop_es[];
struct trapframe *vframe;
@ -185,7 +193,7 @@ trap(frame)
printf("trap %d code %x eip %x cs %x eflags %x cr2 %x cpl %x\n",
frame.tf_trapno, frame.tf_err, frame.tf_eip, frame.tf_cs,
frame.tf_eflags, rcr2(), cpl);
printf("curproc %x\n", curproc);
printf("curproc %p\n", curproc);
}
#endif
@ -362,7 +370,7 @@ trap(frame)
#ifdef DIAGNOSTIC
if (map == kernel_map && va == 0) {
printf("trap: bad kernel access at %x\n", va);
printf("trap: bad kernel access at %lx\n", va);
goto we_re_toast;
}
#endif
@ -408,7 +416,7 @@ trap(frame)
if (type == T_PAGEFLT) {
if (pcb->pcb_onfault != 0)
goto copyfault;
printf("vm_fault(%x, %x, %x, 0) -> %x\n",
printf("vm_fault(%p, %lx, %x, 0) -> %x\n",
map, va, ftype, rv);
goto we_re_toast;
}
@ -429,7 +437,9 @@ trap(frame)
case T_BPTFLT|T_USER: /* bpt instruction fault */
case T_TRCTRAP|T_USER: /* trace trap */
#ifdef MATH_EMULATE
trace:
#endif
trapsignal(p, SIGTRAP, type &~ T_USER);
break;
@ -513,7 +523,6 @@ syscall(frame)
cnt.v_syscall++;
if (!USERMODE(frame.tf_cs, frame.tf_eflags))
panic("syscall");
p = curproc;
sticks = p->p_sticks;
p->p_md.md_regs = &frame;
opc = frame.tf_eip;

View File

@ -1,4 +1,4 @@
/* $NetBSD: vm86.c,v 1.14 1996/04/30 10:35:25 mycroft Exp $ */
/* $NetBSD: vm86.c,v 1.15 1996/05/03 19:42:33 christos Exp $ */
/*-
* Copyright (c) 1996 The NetBSD Foundation, Inc.
@ -72,6 +72,7 @@
#include <machine/vm86.h>
static void fast_intxx __P((struct proc *, int));
static __inline int is_bitset __P((int, caddr_t));
#define CS(tf) (*(u_short *)&tf->tf_cs)
#define IP(tf) (*(u_short *)&tf->tf_eip)
@ -141,7 +142,7 @@ __asm__ __volatile__( \
__res; })
static __inline__ int
static __inline int
is_bitset(nr, bitmap)
int nr;
caddr_t bitmap;

View File

@ -1,4 +1,4 @@
/* $NetBSD: vm_machdep.c,v 1.60 1996/04/25 01:15:41 christos Exp $ */
/* $NetBSD: vm_machdep.c,v 1.61 1996/05/03 19:42:35 christos Exp $ */
/*-
* Copyright (c) 1995 Charles M. Hannum. All rights reserved.
@ -54,6 +54,7 @@
#include <sys/user.h>
#include <sys/core.h>
#include <sys/exec.h>
#include <sys/ptrace.h>
#include <vm/vm.h>
#include <vm/vm_kern.h>
@ -68,6 +69,8 @@
extern struct proc *npxproc;
#endif
void setredzone __P((u_short *, caddr_t));
/*
* Finish a fork operation, with process p2 nearly set up.
* Copy and update the kernel stack and pcb, making the child
@ -84,7 +87,6 @@ cpu_fork(p1, p2)
register struct pcb *pcb = &p2->p_addr->u_pcb;
register struct trapframe *tf;
register struct switchframe *sf;
extern void proc_trampoline(), child_return();
#if NNPX > 0
/*
@ -262,6 +264,7 @@ cpu_coredump(p, vp, cred, chdr)
/*
* Set a red zone in the kernel stack after the u. area.
*/
void
setredzone(pte, vaddr)
u_short *pte;
caddr_t vaddr;

View File

@ -1,4 +1,4 @@
/* $NetBSD: linux_machdep.c,v 1.28 1996/04/18 08:36:22 mycroft Exp $ */
/* $NetBSD: linux_machdep.c,v 1.29 1996/05/03 19:42:11 christos Exp $ */
/*
* Copyright (c) 1995 Frank van der Linden
@ -57,6 +57,7 @@
#include <compat/linux/linux_signal.h>
#include <compat/linux/linux_syscallargs.h>
#include <compat/linux/linux_util.h>
#include <compat/linux/linux_ioctl.h>
#include <machine/cpu.h>
#include <machine/cpufunc.h>
@ -76,6 +77,14 @@
#include <arch/i386/isa/pcvt/pcvt_ioctl.h>
#endif
#ifdef USER_LDT
#include <machine/cpu.h>
int linux_read_ldt __P((struct proc *, struct linux_sys_modify_ldt_args *,
register_t *));
int linux_write_ldt __P((struct proc *, struct linux_sys_modify_ldt_args *,
register_t *));
#endif
/*
* Deal with some i386-specific things in the Linux emulation code.
* This means just signals for now, will include stuff like
@ -284,10 +293,10 @@ linux_read_ldt(p, uap, retval)
parms = stackgap_alloc(&sg, sizeof(gl));
if (error = copyout(&gl, parms, sizeof(gl)))
if ((error = copyout(&gl, parms, sizeof(gl))) != 0)
return (error);
if (error = i386_get_ldt(p, parms, retval))
if ((error = i386_get_ldt(p, parms, retval)) != 0)
return (error);
*retval *= sizeof(union descriptor);
@ -324,7 +333,7 @@ linux_write_ldt(p, uap, retval)
if (SCARG(uap, bytecount) != sizeof(ldt_info))
return (EINVAL);
if (error = copyin(SCARG(uap, ptr), &ldt_info, sizeof(ldt_info)))
if ((error = copyin(SCARG(uap, ptr), &ldt_info, sizeof(ldt_info))) != 0)
return error;
if (ldt_info.contents == 3)
return (EINVAL);
@ -353,12 +362,12 @@ linux_write_ldt(p, uap, retval)
parms = stackgap_alloc(&sg, sizeof(sl));
if (error = copyout(&sd, sl.desc, sizeof(sd)))
if ((error = copyout(&sd, sl.desc, sizeof(sd))) != 0)
return (error);
if (error = copyout(&sl, parms, sizeof(sl)))
if ((error = copyout(&sl, parms, sizeof(sl))) != 0)
return (error);
if (error = i386_set_ldt(p, parms, retval))
if ((error = i386_set_ldt(p, parms, retval)) != 0)
return (error);
*retval = 0;
@ -423,15 +432,12 @@ linux_machdepioctl(p, v, retval)
syscallarg(u_long) com;
syscallarg(caddr_t) data;
} */ *uap = v;
struct sys_ioctl_args bia, tmparg;
struct sys_ioctl_args bia;
u_long com;
#if NVT > 0
int error, mode;
int error;
struct vt_mode lvt;
caddr_t bvtp, sg;
u_int fd;
struct file *fp;
struct filedesc *fdp;
#endif
SCARG(&bia, fd) = SCARG(uap, fd);
@ -506,7 +512,7 @@ linux_machdepioctl(p, v, retval)
break;
#endif
default:
printf("linux_machdepioctl: invalid ioctl %08x\n", com);
printf("linux_machdepioctl: invalid ioctl %08lx\n", com);
return EINVAL;
}
SCARG(&bia, com) = com;
@ -524,9 +530,11 @@ linux_sys_iopl(p, v, retval)
void *v;
register_t *retval;
{
#if 0
struct linux_sys_iopl_args /* {
syscallarg(int) level;
} */ *uap = v;
#endif
struct trapframe *fp = p->p_md.md_regs;
if (suser(p->p_ucred, &p->p_acflag) != 0)

View File

@ -1,4 +1,4 @@
/* $NetBSD: linux_machdep.c,v 1.28 1996/04/18 08:36:22 mycroft Exp $ */
/* $NetBSD: linux_machdep.c,v 1.29 1996/05/03 19:42:11 christos Exp $ */
/*
* Copyright (c) 1995 Frank van der Linden
@ -57,6 +57,7 @@
#include <compat/linux/linux_signal.h>
#include <compat/linux/linux_syscallargs.h>
#include <compat/linux/linux_util.h>
#include <compat/linux/linux_ioctl.h>
#include <machine/cpu.h>
#include <machine/cpufunc.h>
@ -76,6 +77,14 @@
#include <arch/i386/isa/pcvt/pcvt_ioctl.h>
#endif
#ifdef USER_LDT
#include <machine/cpu.h>
int linux_read_ldt __P((struct proc *, struct linux_sys_modify_ldt_args *,
register_t *));
int linux_write_ldt __P((struct proc *, struct linux_sys_modify_ldt_args *,
register_t *));
#endif
/*
* Deal with some i386-specific things in the Linux emulation code.
* This means just signals for now, will include stuff like
@ -284,10 +293,10 @@ linux_read_ldt(p, uap, retval)
parms = stackgap_alloc(&sg, sizeof(gl));
if (error = copyout(&gl, parms, sizeof(gl)))
if ((error = copyout(&gl, parms, sizeof(gl))) != 0)
return (error);
if (error = i386_get_ldt(p, parms, retval))
if ((error = i386_get_ldt(p, parms, retval)) != 0)
return (error);
*retval *= sizeof(union descriptor);
@ -324,7 +333,7 @@ linux_write_ldt(p, uap, retval)
if (SCARG(uap, bytecount) != sizeof(ldt_info))
return (EINVAL);
if (error = copyin(SCARG(uap, ptr), &ldt_info, sizeof(ldt_info)))
if ((error = copyin(SCARG(uap, ptr), &ldt_info, sizeof(ldt_info))) != 0)
return error;
if (ldt_info.contents == 3)
return (EINVAL);
@ -353,12 +362,12 @@ linux_write_ldt(p, uap, retval)
parms = stackgap_alloc(&sg, sizeof(sl));
if (error = copyout(&sd, sl.desc, sizeof(sd)))
if ((error = copyout(&sd, sl.desc, sizeof(sd))) != 0)
return (error);
if (error = copyout(&sl, parms, sizeof(sl)))
if ((error = copyout(&sl, parms, sizeof(sl))) != 0)
return (error);
if (error = i386_set_ldt(p, parms, retval))
if ((error = i386_set_ldt(p, parms, retval)) != 0)
return (error);
*retval = 0;
@ -423,15 +432,12 @@ linux_machdepioctl(p, v, retval)
syscallarg(u_long) com;
syscallarg(caddr_t) data;
} */ *uap = v;
struct sys_ioctl_args bia, tmparg;
struct sys_ioctl_args bia;
u_long com;
#if NVT > 0
int error, mode;
int error;
struct vt_mode lvt;
caddr_t bvtp, sg;
u_int fd;
struct file *fp;
struct filedesc *fdp;
#endif
SCARG(&bia, fd) = SCARG(uap, fd);
@ -506,7 +512,7 @@ linux_machdepioctl(p, v, retval)
break;
#endif
default:
printf("linux_machdepioctl: invalid ioctl %08x\n", com);
printf("linux_machdepioctl: invalid ioctl %08lx\n", com);
return EINVAL;
}
SCARG(&bia, com) = com;
@ -524,9 +530,11 @@ linux_sys_iopl(p, v, retval)
void *v;
register_t *retval;
{
#if 0
struct linux_sys_iopl_args /* {
syscallarg(int) level;
} */ *uap = v;
#endif
struct trapframe *fp = p->p_md.md_regs;
if (suser(p->p_ucred, &p->p_acflag) != 0)