diff options
author | Joel Sing <jsing@cvs.openbsd.org> | 2012-10-30 14:06:30 +0000 |
---|---|---|
committer | Joel Sing <jsing@cvs.openbsd.org> | 2012-10-30 14:06:30 +0000 |
commit | 73b501f9e7b72dd509a9b8d60ced65be3db8742b (patch) | |
tree | e40fc6ac31e5a0ca4a03181deaebbbe70ae1cdcd /sys/arch/i386/stand | |
parent | 2f004055b83f45bdf36995e319dea3b4435d14d0 (diff) |
Apply a bunch of style(9) and whitespace fixes to i386/amd64 libsa, making
the code actually diffable. No binary change.
Diffstat (limited to 'sys/arch/i386/stand')
-rw-r--r-- | sys/arch/i386/stand/libsa/bioscons.c | 4 | ||||
-rw-r--r-- | sys/arch/i386/stand/libsa/cmd_i386.c | 6 | ||||
-rw-r--r-- | sys/arch/i386/stand/libsa/dev_i386.c | 10 | ||||
-rw-r--r-- | sys/arch/i386/stand/libsa/exec_i386.c | 9 | ||||
-rw-r--r-- | sys/arch/i386/stand/libsa/memprobe.c | 31 | ||||
-rw-r--r-- | sys/arch/i386/stand/libsa/pxeboot.h | 2 | ||||
-rw-r--r-- | sys/arch/i386/stand/libsa/time.c | 12 |
7 files changed, 41 insertions, 33 deletions
diff --git a/sys/arch/i386/stand/libsa/bioscons.c b/sys/arch/i386/stand/libsa/bioscons.c index b785cf7d4e8..ff057733b6c 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.33 2012/06/10 21:03:35 kettenis Exp $ */ +/* $OpenBSD: bioscons.c,v 1.34 2012/10/30 14:06:29 jsing Exp $ */ /* * Copyright (c) 1997-1999 Michael Shalayeff @@ -228,6 +228,6 @@ com_putc(dev_t dev, int c) while ((inb(port + com_lsr) & LSR_TXRDY) == 0) ; - + outb(port + com_data, c); } diff --git a/sys/arch/i386/stand/libsa/cmd_i386.c b/sys/arch/i386/stand/libsa/cmd_i386.c index 4a2f6f938d0..c0a22fd47c6 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.31 2012/06/03 13:17:47 kettenis Exp $ */ +/* $OpenBSD: cmd_i386.c,v 1.32 2012/10/30 14:06:29 jsing Exp $ */ /* * Copyright (c) 1997-1999 Michael Shalayeff @@ -158,7 +158,7 @@ Xmemory(void) size = strtoll(p + 1, &p, 0); /* Size the size */ - switch(*p) { + switch (*p) { case 'G': size *= 1024; case 'M': @@ -169,7 +169,7 @@ Xmemory(void) } /* Handle (possibly non-existant) address part */ - switch(*p) { + switch (*p) { case '@': addr = strtoll(p + 1, NULL, 0); break; diff --git a/sys/arch/i386/stand/libsa/dev_i386.c b/sys/arch/i386/stand/libsa/dev_i386.c index 5ff1e162a5b..e855b579bbf 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.35 2011/06/26 23:19:11 tedu Exp $ */ +/* $OpenBSD: dev_i386.c,v 1.36 2012/10/30 14:06:29 jsing Exp $ */ /* * Copyright (c) 1996-1999 Michael Shalayeff @@ -128,9 +128,9 @@ putchar(int c) pch_pos--; break; case '\t': - do + do { cnputc(' '); - while (++pch_pos % 8); + } while (++pch_pos % 8); break; case '\n': case '\r': @@ -183,7 +183,7 @@ ttydev(char *name) return NODEV; for (i = 0; i < ncdevs; i++) if (strncmp(name, cdevs[i], no - name + 1) == 0) - return (makedev(i, unit)); + return makedev(i, unit); return NODEV; } @@ -191,7 +191,7 @@ int cnspeed(dev_t dev, int sp) { if (major(dev) == 8) /* comN */ - return (comspeed(dev, sp)); + return comspeed(dev, sp); /* pc0 and anything else */ return 9600; diff --git a/sys/arch/i386/stand/libsa/exec_i386.c b/sys/arch/i386/stand/libsa/exec_i386.c index d88b2df1d01..d587e4be4a1 100644 --- a/sys/arch/i386/stand/libsa/exec_i386.c +++ b/sys/arch/i386/stand/libsa/exec_i386.c @@ -1,4 +1,4 @@ -/* $OpenBSD: exec_i386.c,v 1.36 2012/06/03 13:17:47 kettenis Exp $ */ +/* $OpenBSD: exec_i386.c,v 1.37 2012/10/30 14:06:29 jsing Exp $ */ /* * Copyright (c) 1997-1998 Michael Shalayeff @@ -84,10 +84,11 @@ run_loadfile(u_long *marks, int howto) entry = marks[MARK_ENTRY] & 0x0fffffff; - printf("entry point at 0x%x\n", (int) entry); + printf("entry point at 0x%x\n", (int)entry); + /* stack and the gung is ok at this point, so, no need for asm setup */ - (*(startfuncp)entry)(howto, bootdev, BOOTARG_APIVER, - marks[MARK_END], extmem, cnvmem, ac, (int)av); + (*(startfuncp)entry)(howto, bootdev, BOOTARG_APIVER, marks[MARK_END], + extmem, cnvmem, ac, (int)av); /* not reached */ #endif } diff --git a/sys/arch/i386/stand/libsa/memprobe.c b/sys/arch/i386/stand/libsa/memprobe.c index aece9b001fb..74c43c4d169 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.50 2010/12/06 22:51:46 jasper Exp $ */ +/* $OpenBSD: memprobe.c,v 1.51 2012/10/30 14:06:29 jsing Exp $ */ /* * Copyright (c) 1997-1999 Michael Shalayeff @@ -37,7 +37,8 @@ u_int cnvmem, extmem; /* XXX - compatibility */ -/* Check gateA20 +/* + * Check gateA20 * * A sanity check. */ @@ -60,7 +61,8 @@ checkA20(void) return st; } -/* BIOS int 15, AX=E820 +/* + * BIOS int 15, AX=E820 * * This is the "preferred" method. */ @@ -71,11 +73,10 @@ bios_E820(bios_memmap_t *mp) do { BIOS_regs.biosr_es = ((u_int)(mp) >> 4); - __asm __volatile(DOINT(0x15) "; setc %b1" : "=a" (sig), "=d" (rc), "=b" (off) : "0" (0xE820), "1" (0x534d4150), "b" (off), - "c" (sizeof(*mp)), "D" (((u_int)mp) & 0xF) + "c" (sizeof(*mp)), "D" (((u_int)mp) & 0xf) : "cc", "memory"); off = BIOS_regs.biosr_bx; @@ -96,7 +97,8 @@ bios_E820(bios_memmap_t *mp) } #if 0 -/* BIOS int 15, AX=E801 +/* + * BIOS int 15, AX=E801 * * Only used if int 15, AX=E820 does not work. * This should work for more than 64MB on most @@ -153,7 +155,8 @@ bios_E801(bios_memmap_t *mp) } #endif -/* BIOS int 15, AX=8800 +/* + * BIOS int 15, AX=8800 * * Only used if int 15, AX=E801 does not work. * Machines with this are restricted to 64MB. @@ -179,7 +182,8 @@ bios_8800(bios_memmap_t *mp) return ++mp; } -/* BIOS int 0x12 Get Conventional Memory +/* + * BIOS int 0x12 Get Conventional Memory * * Only used if int 15, AX=E820 does not work. */ @@ -201,7 +205,8 @@ bios_int12(bios_memmap_t *mp) } -/* addrprobe(kloc): Probe memory at address kloc * 1024. +/* + * addrprobe(kloc): Probe memory at address kloc * 1024. * * This is a hack, but it seems to work ok. Maybe this is * the *real* way that you are supposed to do probing??? @@ -256,7 +261,8 @@ addrprobe(u_int kloc) return ret; } -/* Probe for all extended memory. +/* + * Probe for all extended memory. * * This is only used as a last resort. If we resort to this * routine, we are getting pretty desperate. Hopefully nobody @@ -272,7 +278,8 @@ badprobe(bios_memmap_t *mp) #ifdef DEBUG printf("scan "); #endif - /* probe extended memory + /* + * probe extended memory * * There is no need to do this in assembly language. This is * much easier to debug in C anyways. @@ -330,7 +337,7 @@ memprobe(void) extmem = cnvmem = 0; for (im = bios_memmap; im->type != BIOS_MAP_END; im++) { /* Count only "good" memory chunks 12K and up in size */ - if ((im->type == BIOS_MAP_FREE) && (im->size >= 12*1024)) { + if ((im->type == BIOS_MAP_FREE) && (im->size >= 12 * 1024)) { if (im->size > 1024 * 1024) printf("%uM ", (u_int)(im->size / (1024 * 1024))); diff --git a/sys/arch/i386/stand/libsa/pxeboot.h b/sys/arch/i386/stand/libsa/pxeboot.h index e2a6a28f05c..a4d3dfe925a 100644 --- a/sys/arch/i386/stand/libsa/pxeboot.h +++ b/sys/arch/i386/stand/libsa/pxeboot.h @@ -1,4 +1,4 @@ -/* $OpenBSD: pxeboot.h,v 1.1 2004/03/19 13:48:18 tom Exp $ */ +/* $OpenBSD: pxeboot.h,v 1.2 2012/10/30 14:06:29 jsing Exp $ */ /* $NetBSD$ */ /* diff --git a/sys/arch/i386/stand/libsa/time.c b/sys/arch/i386/stand/libsa/time.c index eca29d3c6ac..581e2f8b87e 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.16 2004/08/17 15:11:31 tom Exp $ */ +/* $OpenBSD: time.c,v 1.17 2012/10/30 14:06:29 jsing Exp $ */ /* * Copyright (c) 1997 Michael Shalayeff @@ -42,7 +42,6 @@ static __inline u_int8_t bcdtoint(u_int8_t c) { - return ((c & 0xf0) / 8) * 5 + (c & 0x0f); } @@ -85,6 +84,7 @@ bios_time_date(int f, u_int8_t *b) "movb %%dl, 3(%2)\n\t" : "=a" (f) : "0" (f), "p" (b) : "%ecx", "%edx", "cc"); + if (f & 0xff) return -1; else { @@ -124,9 +124,8 @@ getsecs(void) dst = timebuf[3]; #endif /* Convert to seconds since Epoch */ - return (compute(datebuf[0] * 100 + datebuf[1], - datebuf[2], datebuf[3], - timebuf[0], timebuf[1], timebuf[2])); + return compute(datebuf[0] * 100 + datebuf[1], datebuf[2], + datebuf[3], timebuf[0], timebuf[1], timebuf[2]); } else errno = EIO; @@ -142,7 +141,8 @@ sleep(u_int i) * Loop for the requested number of seconds, polling BIOS, * so that it may handle interrupts. */ - for (t = getsecs() + i; getsecs() < t; cnischar()); + for (t = getsecs() + i; getsecs() < t; cnischar()) + ; return 0; } |