diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2003-08-11 06:23:10 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2003-08-11 06:23:10 +0000 |
commit | 16824dd3bbb4d43b141d300c76afbdd0c30fa7b9 (patch) | |
tree | 08f2b84878ea46e749b47e3b2953507245ad5384 /sys/arch/i386/stand | |
parent | 678b21869f24e6ddc3a341fad1a87c353c5464ca (diff) |
ansification and knf and protos
Diffstat (limited to 'sys/arch/i386/stand')
-rw-r--r-- | sys/arch/i386/stand/libsa/apmprobe.c | 11 | ||||
-rw-r--r-- | sys/arch/i386/stand/libsa/bioscons.c | 33 | ||||
-rw-r--r-- | sys/arch/i386/stand/libsa/biosdev.c | 56 | ||||
-rw-r--r-- | sys/arch/i386/stand/libsa/biosprobe.c | 13 | ||||
-rw-r--r-- | sys/arch/i386/stand/libsa/cmd_i386.c | 10 | ||||
-rw-r--r-- | sys/arch/i386/stand/libsa/debug.c | 20 | ||||
-rw-r--r-- | sys/arch/i386/stand/libsa/dev_i386.c | 22 | ||||
-rw-r--r-- | sys/arch/i386/stand/libsa/diskprobe.c | 19 | ||||
-rw-r--r-- | sys/arch/i386/stand/libsa/gateA20.c | 5 | ||||
-rw-r--r-- | sys/arch/i386/stand/libsa/machdep.c | 4 | ||||
-rw-r--r-- | sys/arch/i386/stand/libsa/memprobe.c | 35 | ||||
-rw-r--r-- | sys/arch/i386/stand/libsa/pciprobe.c | 4 | ||||
-rw-r--r-- | sys/arch/i386/stand/libsa/smpprobe.c | 15 | ||||
-rw-r--r-- | sys/arch/i386/stand/libsa/time.c | 24 |
14 files changed, 101 insertions, 170 deletions
diff --git a/sys/arch/i386/stand/libsa/apmprobe.c b/sys/arch/i386/stand/libsa/apmprobe.c index 2ea14448b32..4278f2baadb 100644 --- a/sys/arch/i386/stand/libsa/apmprobe.c +++ b/sys/arch/i386/stand/libsa/apmprobe.c @@ -1,4 +1,4 @@ -/* $OpenBSD: apmprobe.c,v 1.10 2003/06/03 20:22:11 mickey Exp $ */ +/* $OpenBSD: apmprobe.c,v 1.11 2003/08/11 06:23:09 deraadt Exp $ */ /* * Copyright (c) 1997-2000 Michael Shalayeff @@ -64,7 +64,7 @@ extern int debug; static __inline u_int -apm_check() +apm_check(void) { register u_int detail; register u_int8_t f; @@ -88,7 +88,7 @@ apm_check() } static __inline int -apm_disconnect() +apm_disconnect(void) { register u_int16_t rv; __asm __volatile(DOINT(0x15) "\n\t" @@ -100,8 +100,7 @@ apm_disconnect() } static __inline int -apm_connect(ai) - bios_apminfo_t *ai; +apm_connect(bios_apminfo_t *ai) { register u_int16_t f; __asm __volatile (DOINT(0x15) "\n\t" @@ -156,7 +155,7 @@ apm_connect(ai) static bios_apminfo_t ai; void -apmprobe() +apmprobe(void) { if ((ai.apm_detail = apm_check())) { diff --git a/sys/arch/i386/stand/libsa/bioscons.c b/sys/arch/i386/stand/libsa/bioscons.c index 934d91f9669..a65eab41b77 100644 --- a/sys/arch/i386/stand/libsa/bioscons.c +++ b/sys/arch/i386/stand/libsa/bioscons.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bioscons.c,v 1.23 2003/07/07 07:42:51 weingart Exp $ */ +/* $OpenBSD: bioscons.c,v 1.24 2003/08/11 06:23:09 deraadt Exp $ */ /* * Copyright (c) 1997-1999 Michael Shalayeff @@ -37,6 +37,7 @@ #include <dev/cons.h> #include <lib/libsa/stand.h> #include "debug.h" +#include "biosdev.h" /* XXX cannot trust NVRAM on this. Maybe later we make a real probe. */ #if 0 @@ -46,8 +47,7 @@ #endif void -pc_probe(cn) - struct consdev *cn; +pc_probe(struct consdev *cn) { cn->cn_pri = CN_INTERNAL; cn->cn_dev = makedev(12, 0); @@ -65,14 +65,12 @@ pc_probe(cn) } void -pc_init(cn) - struct consdev *cn; +pc_init(struct consdev *cn) { } int -pc_getc(dev) - dev_t dev; +pc_getc(dev_t dev) { register int rv; @@ -88,9 +86,7 @@ pc_getc(dev) } void -pc_putc(dev, c) - dev_t dev; - int c; +pc_putc(dev_t dev, int c) { __asm __volatile(DOINT(0x10) : : "a" (c | 0xe00), "b" (1) : "%ecx", "%edx", "cc" ); @@ -99,8 +95,7 @@ pc_putc(dev, c) const int comports[4] = { 0x3f8, 0x2f8, 0x3e8, 0x2e8 }; void -com_probe(cn) - struct consdev *cn; +com_probe(struct consdev *cn) { register int i, n; @@ -118,8 +113,7 @@ com_probe(cn) } void -com_init(cn) - struct consdev *cn; +com_init(struct consdev *cn) { register int unit = minor(cn->cn_dev); @@ -129,8 +123,7 @@ com_init(cn) } int -com_getc(dev) - dev_t dev; +com_getc(dev_t dev) { register int rv; @@ -151,9 +144,7 @@ com_getc(dev) /* call with sp == 0 to query the current speed */ int com_speed = 9600; /* default speed is 9600 baud */ int -comspeed(dev, sp) - dev_t dev; - int sp; +comspeed(dev_t dev, int sp) { int i, newsp; int err; @@ -206,9 +197,7 @@ comspeed(dev, sp) } void -com_putc(dev, c) - dev_t dev; - int c; +com_putc(dev_t dev, int c) { register int rv; diff --git a/sys/arch/i386/stand/libsa/biosdev.c b/sys/arch/i386/stand/libsa/biosdev.c index 76670c34eea..f90c03379ca 100644 --- a/sys/arch/i386/stand/libsa/biosdev.c +++ b/sys/arch/i386/stand/libsa/biosdev.c @@ -1,4 +1,4 @@ -/* $OpenBSD: biosdev.c,v 1.59 2003/06/27 05:13:19 weingart Exp $ */ +/* $OpenBSD: biosdev.c,v 1.60 2003/08/11 06:23:09 deraadt Exp $ */ /* * Copyright (c) 1996 Michael Shalayeff @@ -70,8 +70,7 @@ struct EDD_CB { * reset disk system */ static int -biosdreset(dev) - int dev; +biosdreset(int dev) { int rv; __asm __volatile (DOINT(0x13) "; setc %b0" : "=a" (rv) @@ -85,9 +84,7 @@ biosdreset(dev) * Return 1 if not ok. */ int -bios_getdiskinfo(dev, pdi) - int dev; - bios_diskinfo_t *pdi; +bios_getdiskinfo(int dev, bios_diskinfo_t *pdi) { u_int rv; @@ -161,12 +158,10 @@ bios_getdiskinfo(dev, pdi) * Read/Write a block from given place using the BIOS. */ static __inline int -CHS_rw(rw, dev, cyl, head, sect, nsect, buf) - int rw, dev, cyl, head; - int sect, nsect; - void * buf; +CHS_rw(int rw, int dev, int cyl, int head, int sect, int nsect, void *buf) { int rv; + BIOS_regs.biosr_es = (u_int32_t)buf >> 4; __asm __volatile ("movb %b7, %h1\n\t" "movb %b6, %%dh\n\t" @@ -188,11 +183,7 @@ CHS_rw(rw, dev, cyl, head, sect, nsect, buf) } static __inline int -EDD_rw(rw, dev, daddr, nblk, buf) - int rw, dev; - u_int64_t daddr; - u_int32_t nblk; - void *buf; +EDD_rw(int rw, int dev, u_int64_t daddr, u_int32_t nblk, void *buf) { int rv; volatile static struct EDD_CB cb; @@ -224,12 +215,7 @@ EDD_rw(rw, dev, daddr, nblk, buf) * Read given sector, handling retry/errors/etc. */ int -biosd_io(rw, bd, off, nsect, buf) - int rw; - bios_diskinfo_t *bd; - daddr_t off; - int nsect; - void* buf; +biosd_io(int rw, bios_diskinfo_t *bd, daddr_t off, int nsect, void *buf) { int dev = bd->bios_number; int j, error; @@ -310,9 +296,7 @@ biosd_io(rw, bd, off, nsect, buf) * Try to read the bsd label on the given BIOS device */ const char * -bios_getdisklabel(bd, label) - bios_diskinfo_t *bd; - struct disklabel *label; +bios_getdisklabel(bios_diskinfo_t *bd, struct disklabel *label) { daddr_t off = LABELSECTOR; char *buf; @@ -514,8 +498,7 @@ const u_char bidos_errs[] = "\x00" "\0"; static const char * -biosdisk_err(error) - u_int error; +biosdisk_err(u_int error) { register const u_char *p = bidos_errs; @@ -543,9 +526,9 @@ const struct biosdisk_errors { { 0x32, ENXIO }, { 0x00, EIO } }; + static int -biosdisk_errno(error) - u_int error; +biosdisk_errno(u_int error) { register const struct biosdisk_errors *p; @@ -558,13 +541,8 @@ biosdisk_errno(error) } int -biosstrategy(devdata, rw, blk, size, buf, rsize) - void *devdata; - int rw; - daddr_t blk; - size_t size; - void *buf; - size_t *rsize; +biosstrategy(void *devdata, int rw, daddr_t blk, size_t size, void *buf, + size_t *rsize) { struct diskinfo *dip = (struct diskinfo *)devdata; bios_diskinfo_t *bd = &dip->bios_info; @@ -594,18 +572,14 @@ biosstrategy(devdata, rw, blk, size, buf, rsize) } int -biosclose(f) - struct open_file *f; +biosclose(struct open_file *f) { f->f_devdata = NULL; return 0; } int -biosioctl(f, cmd, data) - struct open_file *f; - u_long cmd; - void *data; +biosioctl(struct open_file *f, u_long cmd, void *data) { return 0; } diff --git a/sys/arch/i386/stand/libsa/biosprobe.c b/sys/arch/i386/stand/libsa/biosprobe.c index 4b0a67e1e91..dba47471e4b 100644 --- a/sys/arch/i386/stand/libsa/biosprobe.c +++ b/sys/arch/i386/stand/libsa/biosprobe.c @@ -1,4 +1,4 @@ -/* $OpenBSD: biosprobe.c,v 1.2 2003/06/04 17:04:05 deraadt Exp $ */ +/* $OpenBSD: biosprobe.c,v 1.3 2003/08/11 06:23:09 deraadt Exp $ */ /* * Copyright (c) 2002 Tobias Weingartner @@ -25,16 +25,19 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include <sys/types.h> +#include <sys/param.h> #include <machine/biosvar.h> #include <machine/pio.h> #include <dev/cons.h> -#include <lib/libsa/stand.h> +#include <sys/disklabel.h> +#include "disk.h" #include "debug.h" +#include "libsa.h" +#include "biosdev.h" void * -getSYSCONFaddr() +getSYSCONFaddr(void) { u_int32_t status; u_int8_t *vers; @@ -55,7 +58,7 @@ getSYSCONFaddr() } void * -getEBDAaddr() +getEBDAaddr(void) { u_int32_t status; u_int8_t *info; diff --git a/sys/arch/i386/stand/libsa/cmd_i386.c b/sys/arch/i386/stand/libsa/cmd_i386.c index 798157cc235..66da87e50ae 100644 --- a/sys/arch/i386/stand/libsa/cmd_i386.c +++ b/sys/arch/i386/stand/libsa/cmd_i386.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cmd_i386.c,v 1.26 2003/06/03 20:22:11 mickey Exp $ */ +/* $OpenBSD: cmd_i386.c,v 1.27 2003/08/11 06:23:09 deraadt Exp $ */ /* * Copyright (c) 1997-1999 Michael Shalayeff @@ -60,7 +60,7 @@ const struct cmd_table cmd_machine[] = { }; int -Xdiskinfo() +Xdiskinfo(void) { #ifndef _TEST dump_diskinfo(); @@ -70,7 +70,7 @@ Xdiskinfo() #ifdef DEBUG int -Xregs() +Xregs(void) { DUMP_REGS; return 0; @@ -78,7 +78,7 @@ Xregs() #endif int -Xboot() +Xboot(void) { #ifndef _TEST int dev, part, st; @@ -140,7 +140,7 @@ bad: } int -Xmemory() +Xmemory(void) { if (cmd.argc >= 2) { int i; diff --git a/sys/arch/i386/stand/libsa/debug.c b/sys/arch/i386/stand/libsa/debug.c index eddbd4fcc4a..42577a44a8c 100644 --- a/sys/arch/i386/stand/libsa/debug.c +++ b/sys/arch/i386/stand/libsa/debug.c @@ -1,4 +1,4 @@ -/* $OpenBSD: debug.c,v 1.10 2003/06/03 20:22:11 mickey Exp $ */ +/* $OpenBSD: debug.c,v 1.11 2003/08/11 06:23:09 deraadt Exp $ */ /* * Copyright (c) 1997 Michael Shalayeff @@ -48,15 +48,14 @@ void d_putc(dev_t, int); #endif int -debug_init() +debug_init(void) { return 0; } void -dump_regs(trapno, arg) - u_int trapno, arg; +dump_regs(u_int trapno, u_int arg) { register int i; /* make it local, so it won't rely on .data/.bss corruption */ @@ -70,12 +69,12 @@ dump_regs(trapno, arg) /* Trap info */ printf("\ftrap: %u(%x): %s\ncn_tab=%p\n", - trapno, arg, trap_names[trapno], save_cons); + trapno, arg, trap_names[trapno], save_cons); /* Register dump */ for(i = 1; i <= nreg; i++) printf("%s\t%x%c", reg_names[i-1], *reg_values[i-1], - ((i%4)? ' ': '\n')); + ((i%4)? ' ': '\n')); dump_mem("Code dump", (void *)*reg_values[8], 8); /* %ebx (void *)((*reg_values[3] + 15) & ~0x0F) */ @@ -87,10 +86,7 @@ dump_regs(trapno, arg) } void -dump_mem(l, p, n) - char *l; - void *p; - size_t n; +dump_mem(char *l, void *p, size_t n) { register int i; printf("%s [%p]:%s", l, p, (n > 6? "\n":" ")); @@ -104,9 +100,7 @@ dump_mem(l, p, n) u_int d_pos; void -d_putc(d, c) - dev_t d; - int c; +d_putc(dev_t d, int c) { switch (c) { case '\n': d_pos += 80; break; diff --git a/sys/arch/i386/stand/libsa/dev_i386.c b/sys/arch/i386/stand/libsa/dev_i386.c index baca1291a9d..30b1cc6fa6d 100644 --- a/sys/arch/i386/stand/libsa/dev_i386.c +++ b/sys/arch/i386/stand/libsa/dev_i386.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dev_i386.c,v 1.26 2003/06/03 20:22:11 mickey Exp $ */ +/* $OpenBSD: dev_i386.c,v 1.27 2003/08/11 06:23:09 deraadt Exp $ */ /* * Copyright (c) 1996-1999 Michael Shalayeff @@ -87,9 +87,7 @@ devopen(struct open_file *f, const char *fname, char **file) } void -devboot(bootdev, p) - dev_t bootdev; - char *p; +devboot(dev_t bootdev, char *p) { #ifdef _TEST *p++ = '/'; @@ -112,8 +110,7 @@ devboot(bootdev, p) int pch_pos = 0; void -putchar(c) - int c; +putchar(int c) { switch(c) { case '\177': /* DEL erases */ @@ -142,7 +139,7 @@ putchar(c) } int -getchar() +getchar(void) { register int c = cngetc(); @@ -158,9 +155,9 @@ getchar() } char ttyname_buf[8]; + char * -ttyname(fd) - int fd; +ttyname(int fd) { snprintf(ttyname_buf, sizeof ttyname_buf, "%s%d", cdevs[major(cn_tab->cn_dev)], @@ -169,8 +166,7 @@ ttyname(fd) } dev_t -ttydev(name) - char *name; +ttydev(char *name) { int i, unit = -1; char *no = name + strlen(name) - 1; @@ -186,9 +182,7 @@ ttydev(name) } int -cnspeed(dev, sp) - dev_t dev; - int sp; +cnspeed(dev_t dev, int sp) { if (major(dev) == 8) /* comN */ return comspeed(dev, sp); diff --git a/sys/arch/i386/stand/libsa/diskprobe.c b/sys/arch/i386/stand/libsa/diskprobe.c index 838269901e7..82f33add173 100644 --- a/sys/arch/i386/stand/libsa/diskprobe.c +++ b/sys/arch/i386/stand/libsa/diskprobe.c @@ -1,4 +1,4 @@ -/* $OpenBSD: diskprobe.c,v 1.20 2003/06/04 17:04:05 deraadt Exp $ */ +/* $OpenBSD: diskprobe.c,v 1.21 2003/08/11 06:23:09 deraadt Exp $ */ /* * Copyright (c) 1997 Tobias Weingartner @@ -56,7 +56,7 @@ extern int debug; /* Probe for all BIOS floppies */ static void -floppyprobe() +floppyprobe(void) { struct diskinfo *dip; int i; @@ -92,7 +92,7 @@ floppyprobe() /* Probe for all BIOS hard disks */ static void -hardprobe() +hardprobe(void) { struct diskinfo *dip; int i; @@ -156,7 +156,7 @@ hardprobe() /* Probe for all BIOS supported disks */ u_int32_t bios_cksumlen; void -diskprobe() +diskprobe(void) { struct diskinfo *dip; int i; @@ -201,8 +201,7 @@ diskprobe() /* Find info on given BIOS disk */ struct diskinfo * -dklookup(dev) - int dev; +dklookup(int dev) { struct diskinfo *dip; @@ -214,7 +213,7 @@ dklookup(dev) } void -dump_diskinfo() +dump_diskinfo(void) { struct diskinfo *dip; @@ -238,8 +237,7 @@ dump_diskinfo() * XXX - Use dklookup() instead. */ bios_diskinfo_t * -bios_dklookup(dev) - register int dev; +bios_dklookup(int dev) { struct diskinfo *dip; @@ -257,8 +255,7 @@ bios_dklookup(dev) * as it is quick, small, and available. */ int -disksum(blk) - int blk; +disksum(int blk) { struct diskinfo *dip, *dip2; int st, reprobe = 0; diff --git a/sys/arch/i386/stand/libsa/gateA20.c b/sys/arch/i386/stand/libsa/gateA20.c index c6277445f91..38b592bb4df 100644 --- a/sys/arch/i386/stand/libsa/gateA20.c +++ b/sys/arch/i386/stand/libsa/gateA20.c @@ -1,4 +1,4 @@ -/* $OpenBSD: gateA20.c,v 1.8 2001/08/18 15:34:17 mickey Exp $ */ +/* $OpenBSD: gateA20.c,v 1.9 2003/08/11 06:23:09 deraadt Exp $ */ /* * Ported to boot 386BSD by Julian Elischer (julian@tfs.com) Sept 1992 @@ -46,8 +46,7 @@ * Gate A20 for high memory */ void -gateA20(on) - int on; +gateA20(int on) { if (ps2model == 0xf82 || (inb(IO_KBD + KBSTATP) == 0xff && inb(IO_KBD + KBDATAP) == 0xff)) { diff --git a/sys/arch/i386/stand/libsa/machdep.c b/sys/arch/i386/stand/libsa/machdep.c index 5b409ee96b6..d74c043a68a 100644 --- a/sys/arch/i386/stand/libsa/machdep.c +++ b/sys/arch/i386/stand/libsa/machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: machdep.c,v 1.33 2003/06/03 20:22:12 mickey Exp $ */ +/* $OpenBSD: machdep.c,v 1.34 2003/08/11 06:23:09 deraadt Exp $ */ /* * Copyright (c) 1997-1999 Michael Shalayeff @@ -44,7 +44,7 @@ extern int debug; int ps2model; void -machdep() +machdep(void) { /* here */ CKPT('0'); printf("probing:"); diff --git a/sys/arch/i386/stand/libsa/memprobe.c b/sys/arch/i386/stand/libsa/memprobe.c index a4086e30dfb..6aca0b85b6a 100644 --- a/sys/arch/i386/stand/libsa/memprobe.c +++ b/sys/arch/i386/stand/libsa/memprobe.c @@ -1,4 +1,4 @@ -/* $OpenBSD: memprobe.c,v 1.38 2003/06/03 20:22:12 mickey Exp $ */ +/* $OpenBSD: memprobe.c,v 1.39 2003/08/11 06:23:09 deraadt Exp $ */ /* * Copyright (c) 1997-1999 Michael Shalayeff @@ -65,8 +65,7 @@ checkA20(void) * This is the "prefered" method. */ static __inline bios_memmap_t * -bios_E820(mp) - register bios_memmap_t *mp; +bios_E820(bios_memmap_t *mp) { void *info; int rc, off = 0, sig, gotcha = 0; @@ -107,8 +106,7 @@ bios_E820(mp) * like this call. */ static __inline bios_memmap_t * -bios_E801(mp) - register bios_memmap_t *mp; +bios_E801(bios_memmap_t *mp) { int rc, m1, m2, m3, m4; u_int8_t *info; @@ -160,8 +158,7 @@ bios_E801(mp) * Machines with this are restricted to 64MB. */ static __inline bios_memmap_t * -bios_8800(mp) - register bios_memmap_t *mp; +bios_8800(bios_memmap_t *mp) { int rc, mem; @@ -186,8 +183,7 @@ bios_8800(mp) * Only used if int 15, AX=E820 does not work. */ static __inline bios_memmap_t * -bios_int12(mp) - register bios_memmap_t *mp; +bios_int12(bios_memmap_t *mp) { int mem; #ifdef DEBUG @@ -223,8 +219,7 @@ const u_int addrprobe_pat[] = { 0x55555555, 0xCCCCCCCC }; static int -addrprobe(kloc) - u_int kloc; +addrprobe(u_int kloc) { __volatile u_int *loc; register u_int i, ret = 0; @@ -270,8 +265,7 @@ addrprobe(kloc) * XXX - Could be destructive, as it does write. */ static __inline bios_memmap_t * -badprobe(mp) - register bios_memmap_t *mp; +badprobe(bios_memmap_t *mp) { u_int64_t ram; #ifdef DEBUG @@ -296,7 +290,7 @@ badprobe(mp) bios_memmap_t bios_memmap[32]; /* This is easier */ #ifndef _TEST void -memprobe() +memprobe(void) { bios_memmap_t *pm = bios_memmap, *im; @@ -365,8 +359,7 @@ memprobe() #endif void -dump_biosmem(tm) - bios_memmap_t *tm; +dump_biosmem(bios_memmap_t *tm) { register bios_memmap_t *p; register u_int total = 0; @@ -393,8 +386,7 @@ dump_biosmem(tm) } int -mem_delete(sa, ea) - long sa, ea; +mem_delete(long sa, long ea) { register bios_memmap_t *p; @@ -431,8 +423,7 @@ mem_delete(sa, ea) } int -mem_add(sa, ea) - long sa, ea; +mem_add(long sa, long ea) { register bios_memmap_t *p; @@ -474,12 +465,12 @@ mem_add(sa, ea) } void -mem_pass() +mem_pass(void) { bios_memmap_t *p; for (p = bios_memmap; p->type != BIOS_MAP_END; p++) ; addbootarg(BOOTARG_MEMMAP, (p - bios_memmap + 1) * sizeof *bios_memmap, - bios_memmap); + bios_memmap); } diff --git a/sys/arch/i386/stand/libsa/pciprobe.c b/sys/arch/i386/stand/libsa/pciprobe.c index 362c176cfc3..bbf9dd15b60 100644 --- a/sys/arch/i386/stand/libsa/pciprobe.c +++ b/sys/arch/i386/stand/libsa/pciprobe.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pciprobe.c,v 1.6 2003/06/04 17:04:05 deraadt Exp $ */ +/* $OpenBSD: pciprobe.c,v 1.7 2003/08/11 06:23:09 deraadt Exp $ */ /* * Copyright (c) 1997 Tobias Weingartner @@ -35,7 +35,7 @@ #define PCI_SIG 0x20494350 /* PCI Signature */ void -pciprobe() +pciprobe(void) { bios_pciinfo_t bpi; u_int32_t hw_chars, rev, rc, sig; diff --git a/sys/arch/i386/stand/libsa/smpprobe.c b/sys/arch/i386/stand/libsa/smpprobe.c index dc968aba759..8b7f059cea1 100644 --- a/sys/arch/i386/stand/libsa/smpprobe.c +++ b/sys/arch/i386/stand/libsa/smpprobe.c @@ -1,4 +1,4 @@ -/* $OpenBSD: smpprobe.c,v 1.4 2003/06/04 17:04:05 deraadt Exp $ */ +/* $OpenBSD: smpprobe.c,v 1.5 2003/08/11 06:23:09 deraadt Exp $ */ /* * Copyright (c) 1997 Tobias Weingartner @@ -48,9 +48,7 @@ typedef struct _mp_float { static __inline int -mp_checksum(ptr, len) - u_int8_t *ptr; - int len; +mp_checksum(u_int8_t *ptr, int len) { register int i, sum = 0; @@ -66,9 +64,7 @@ mp_checksum(ptr, len) static mp_float_t * -mp_probefloat(ptr, len) - u_int8_t *ptr; - int len; +mp_probefloat(u_int8_t *ptr, int len) { mp_float_t *mpp = NULL; int i; @@ -79,6 +75,7 @@ mp_probefloat(ptr, len) #endif for(i = 0; i < 1024; i++){ mp_float_t *tmp = (mp_float_t*)(ptr + i); + if(tmp->signature == MP_FLOAT_SIG){ printf("Found possible MP signature at: %p\n", ptr); @@ -86,7 +83,7 @@ mp_probefloat(ptr, len) break; } if((tmp->signature == MP_FLOAT_SIG) && - mp_checksum(tmp, tmp->length*16)){ + mp_checksum((u_int8_t *)tmp, tmp->length*16)){ #ifdef DEBUG if (debug) printf("Found valid MP signature at: %p\n", ptr); @@ -101,7 +98,7 @@ mp_probefloat(ptr, len) void -smpprobe() +smpprobe(void) { mp_float_t *mp = NULL; diff --git a/sys/arch/i386/stand/libsa/time.c b/sys/arch/i386/stand/libsa/time.c index b5a90a03537..b097a08a96e 100644 --- a/sys/arch/i386/stand/libsa/time.c +++ b/sys/arch/i386/stand/libsa/time.c @@ -1,4 +1,4 @@ -/* $OpenBSD: time.c,v 1.13 2003/06/03 20:22:12 mickey Exp $ */ +/* $OpenBSD: time.c,v 1.14 2003/08/11 06:23:09 deraadt Exp $ */ /* * Copyright (c) 1997 Michael Shalayeff @@ -40,8 +40,7 @@ * Convert from bcd (packed) to int */ static __inline u_int8_t -bcdtoint(c) - register u_int8_t c; +bcdtoint(u_int8_t c) { return ((c & 0xf0) / 8) * 5 + (c & 0x0f); @@ -54,10 +53,10 @@ const u_short monthcount[] = { 0, 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365 }; + static __inline time_t -compute(year, month, day, hour, min, sec) - int year; - u_int8_t month, day, hour, min, sec; +compute(int year, u_int8_t month, u_int8_t day, u_int8_t hour, + u_int8_t min, u_int8_t sec) { /* Number of days per month */ register time_t tt; @@ -77,9 +76,7 @@ compute(year, month, day, hour, min, sec) } static int -bios_time_date(f, b) - int f; - register u_int8_t *b; +bios_time_date(int f, u_int8_t *b) { __asm __volatile(DOINT(0x1a) "\n\t" "setc %b0\n\t" @@ -101,15 +98,13 @@ bios_time_date(f, b) } static __inline int -biosdate(b) - register u_int8_t *b; +biosdate(u_int8_t *b) { return bios_time_date(4 << 8, b); } static __inline int -biostime(b) - register u_int8_t *b; +biostime(u_int8_t *b) { return bios_time_date(2 << 8, b); } @@ -140,8 +135,7 @@ getsecs(void) } u_int -sleep(i) - u_int i; +sleep(u_int i) { register time_t t; |