From e3d385664cbc435ceb49334c27255356e826313a Mon Sep 17 00:00:00 2001 From: deraadt Date: Mon, 16 Jan 2023 07:29:32 +0000 Subject: [PATCH] roughly cleanup terrible pre-ansi practices ok miod --- sys/arch/alpha/stand/OSFpal.c | 4 +++- sys/arch/alpha/stand/boot/boot.c | 6 +++++- sys/arch/alpha/stand/boot/devopen.c | 3 ++- sys/arch/alpha/stand/boot/disk.c | 4 ++-- sys/arch/alpha/stand/bootxx.c | 14 ++++++++++---- sys/arch/alpha/stand/netboot/dev_net.c | 5 ++++- sys/arch/alpha/stand/netboot/getsecs.c | 5 ++++- sys/arch/alpha/stand/netboot/if_prom.c | 6 ++++-- sys/arch/alpha/stand/prom.c | 11 ++++++----- sys/arch/alpha/stand/puts.c | 4 +++- 10 files changed, 43 insertions(+), 19 deletions(-) diff --git a/sys/arch/alpha/stand/OSFpal.c b/sys/arch/alpha/stand/OSFpal.c index 4980c3f57ea..c343c533d78 100644 --- a/sys/arch/alpha/stand/OSFpal.c +++ b/sys/arch/alpha/stand/OSFpal.c @@ -1,4 +1,4 @@ -/* $OpenBSD: OSFpal.c,v 1.8 2013/12/22 18:31:29 miod Exp $ */ +/* $OpenBSD: OSFpal.c,v 1.9 2023/01/16 07:29:32 deraadt Exp $ */ /* $NetBSD: OSFpal.c,v 1.8 2001/07/22 15:17:30 wiz Exp $ */ /* @@ -37,6 +37,8 @@ paddr_t ptbr_save; +void switch_palcode(void); + void OSFpal() { diff --git a/sys/arch/alpha/stand/boot/boot.c b/sys/arch/alpha/stand/boot/boot.c index 6aae43d7b84..429a8a56764 100644 --- a/sys/arch/alpha/stand/boot/boot.c +++ b/sys/arch/alpha/stand/boot/boot.c @@ -1,4 +1,4 @@ -/* $OpenBSD: boot.c,v 1.29 2021/01/29 16:22:34 deraadt Exp $ */ +/* $OpenBSD: boot.c,v 1.30 2023/01/16 07:29:34 deraadt Exp $ */ /* $NetBSD: boot.c,v 1.10 1997/01/18 01:58:33 cgd Exp $ */ /* @@ -97,6 +97,10 @@ done: return (error); } +void init_prom_calls(void); +void OSFpal(void); +void halt(void); + int main() { diff --git a/sys/arch/alpha/stand/boot/devopen.c b/sys/arch/alpha/stand/boot/devopen.c index 9c1871c6ecc..b573179ce4f 100644 --- a/sys/arch/alpha/stand/boot/devopen.c +++ b/sys/arch/alpha/stand/boot/devopen.c @@ -1,4 +1,4 @@ -/* $OpenBSD: devopen.c,v 1.8 2003/06/02 23:27:44 millert Exp $ */ +/* $OpenBSD: devopen.c,v 1.9 2023/01/16 07:29:35 deraadt Exp $ */ /* $NetBSD: devopen.c,v 1.1 1995/11/23 02:39:37 cgd Exp $ */ /*- @@ -41,6 +41,7 @@ * Decode the string 'fname', open the device and return the remaining * file name if any. */ +int devopen(f, fname, file) struct open_file *f; const char *fname; diff --git a/sys/arch/alpha/stand/boot/disk.c b/sys/arch/alpha/stand/boot/disk.c index a2a1c1c4dd4..ed224259ea8 100644 --- a/sys/arch/alpha/stand/boot/disk.c +++ b/sys/arch/alpha/stand/boot/disk.c @@ -1,4 +1,4 @@ -/* $OpenBSD: disk.c,v 1.19 2020/12/09 18:10:17 krw Exp $ */ +/* $OpenBSD: disk.c,v 1.20 2023/01/16 07:29:35 deraadt Exp $ */ /* $NetBSD: disk.c,v 1.6 1997/04/06 08:40:33 cgd Exp $ */ /* @@ -109,7 +109,7 @@ diskopen(struct open_file *f, int ctlr, int unit, int part) ret.bits = prom_getenv(PROM_E_BOOTED_DEV, devname, sizeof(devname)); devlen = ret.u.retval; - ret.bits = prom_open(devname, devlen); + ret.bits = prom_open((u_int64_t)devname, devlen); if (ret.u.status == 2) return (ENXIO); if (ret.u.status == 3) diff --git a/sys/arch/alpha/stand/bootxx.c b/sys/arch/alpha/stand/bootxx.c index 19396e3e7b8..1597147dc37 100644 --- a/sys/arch/alpha/stand/bootxx.c +++ b/sys/arch/alpha/stand/bootxx.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bootxx.c,v 1.10 2004/07/05 19:59:17 deraadt Exp $ */ +/* $OpenBSD: bootxx.c,v 1.11 2023/01/16 07:29:32 deraadt Exp $ */ /* $NetBSD: bootxx.c,v 1.4 1997/01/18 00:28:59 cgd Exp $ */ /* @@ -34,7 +34,7 @@ #include "bbinfo.h" -extern _end, start; +extern long _end, start; struct bbinfoloc desc = { 0xbabefacedeadbeef, @@ -60,7 +60,7 @@ open_dev(fd) ret.bits = prom_getenv(PROM_E_BOOTED_DEV, devname, sizeof(devname)); devlen = ret.u.retval; - ret.bits = prom_open(devname, devlen); + ret.bits = prom_open((u_int64_t)devname, devlen); if (ret.u.status) return 0; @@ -69,6 +69,8 @@ open_dev(fd) return 1; } +void puts(char *); + int load_file(bbinfop, loadaddr) struct bbinfo *bbinfop; @@ -128,6 +130,8 @@ puts("\b"); return (rv); } +void init_prom_calls(void); + int main() { @@ -144,7 +148,7 @@ main() loadaddr = (char *)SECONDARY_LOAD_ADDRESS; if (!load_file(bbinfop, loadaddr)) { puts("\nLOAD FAILED!\n\n"); - return; + return 1; } #if 0 @@ -153,4 +157,6 @@ main() entry = (void (*)())loadaddr; (*entry)(); puts("SECONDARY BOOT BLOCK RETURNED!\n"); + return 1; } + diff --git a/sys/arch/alpha/stand/netboot/dev_net.c b/sys/arch/alpha/stand/netboot/dev_net.c index d7c23e252fb..5967e970aed 100644 --- a/sys/arch/alpha/stand/netboot/dev_net.c +++ b/sys/arch/alpha/stand/netboot/dev_net.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dev_net.c,v 1.6 2023/01/04 09:24:14 jsg Exp $ */ +/* $OpenBSD: dev_net.c,v 1.7 2023/01/16 07:29:35 deraadt Exp $ */ /* $NetBSD: dev_net.c,v 1.4 1997/04/06 08:41:24 cgd Exp $ */ /* @@ -75,6 +75,9 @@ u_char bcea[6] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }; static int netdev_sock = -1; static int netdev_opens; +int net_getparams(int); +int nfs_mount(int, struct in_addr, char *); + /* * Called by devopen after it sets f->f_dev to our devsw entry. * This opens the low-level device and sets f->f_devdata. diff --git a/sys/arch/alpha/stand/netboot/getsecs.c b/sys/arch/alpha/stand/netboot/getsecs.c index 8d7cabd396c..159eb33d14b 100644 --- a/sys/arch/alpha/stand/netboot/getsecs.c +++ b/sys/arch/alpha/stand/netboot/getsecs.c @@ -1,9 +1,12 @@ -/* $OpenBSD: getsecs.c,v 1.3 2011/06/05 21:49:36 miod Exp $ */ +/* $OpenBSD: getsecs.c,v 1.4 2023/01/16 07:29:35 deraadt Exp $ */ #include #include "include/rpb.h" #include "include/prom.h" + +long alpha_rpcc(void); + int getsecs() { diff --git a/sys/arch/alpha/stand/netboot/if_prom.c b/sys/arch/alpha/stand/netboot/if_prom.c index d4f11dc437d..56253212e91 100644 --- a/sys/arch/alpha/stand/netboot/if_prom.c +++ b/sys/arch/alpha/stand/netboot/if_prom.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_prom.c,v 1.8 2017/09/08 05:36:51 deraadt Exp $ */ +/* $OpenBSD: if_prom.c,v 1.9 2023/01/16 07:29:35 deraadt Exp $ */ /* $NetBSD: if_prom.c,v 1.9 1997/04/06 08:41:26 cgd Exp $ */ /* @@ -137,6 +137,8 @@ prom_get(struct iodesc *desc, void *pkt, size_t len, time_t timeout) } extern char *strchr(); +void halt(void); +const char *ether_sprintf(const u_char *); void prom_init(struct iodesc *desc, void *machdep_hint) @@ -209,7 +211,7 @@ prom_init(struct iodesc *desc, void *machdep_hint) gotit: printf("boot: ethernet address: %s\n", ether_sprintf(desc->myea)); - ret.bits = prom_open(devname, devlen + 1); + ret.bits = prom_open((u_int64_t)devname, devlen + 1); if (ret.u.status) { printf("prom_init: open failed: %d\n", ret.u.status); goto reallypunt; diff --git a/sys/arch/alpha/stand/prom.c b/sys/arch/alpha/stand/prom.c index f27bedc449a..97afe076bda 100644 --- a/sys/arch/alpha/stand/prom.c +++ b/sys/arch/alpha/stand/prom.c @@ -1,4 +1,4 @@ -/* $OpenBSD: prom.c,v 1.8 2010/05/14 21:08:28 naddy Exp $ */ +/* $OpenBSD: prom.c,v 1.9 2023/01/16 07:29:32 deraadt Exp $ */ /* $NetBSD: prom.c,v 1.2 1996/11/25 16:18:16 cgd Exp $ */ /* @@ -61,7 +61,7 @@ getchar() prom_return_t ret; for (;;) { - ret.bits = prom_dispatch(PROM_R_GETC, console); + ret.bits = prom_dispatch(PROM_R_GETC, console, 0, 0, 0); if (ret.u.status == 0 || ret.u.status == 1) return (ret.u.retval); } @@ -78,13 +78,14 @@ putchar(c) cbuf = '\r'; do { ret.bits = prom_dispatch(PROM_R_PUTS, console, - &cbuf, 1); + (u_int64_t)&cbuf, 1, 0); } while ((ret.u.retval & 1) == 0); cbuf = '\n'; } else cbuf = c; do { - ret.bits = prom_dispatch(PROM_R_PUTS, console, &cbuf, 1); + ret.bits = prom_dispatch(PROM_R_PUTS, console, + (u_int64_t)&cbuf, 1, 0); } while ((ret.u.retval & 1) == 0); } @@ -102,7 +103,7 @@ prom_getenv(id, buf, len) static char abuf[128] __attribute__ ((aligned (8))); prom_return_t ret; - ret.bits = prom_dispatch(PROM_R_GETENV, id, abuf, 128); + ret.bits = prom_dispatch(PROM_R_GETENV, id, (u_int64_t)abuf, 128, 0); if (ret.u.status & 0x4) ret.u.retval = 0; len--; diff --git a/sys/arch/alpha/stand/puts.c b/sys/arch/alpha/stand/puts.c index 06c0b066e38..d1a70f7824b 100644 --- a/sys/arch/alpha/stand/puts.c +++ b/sys/arch/alpha/stand/puts.c @@ -1,6 +1,8 @@ -/* $OpenBSD: puts.c,v 1.3 1996/10/30 22:40:35 niklas Exp $ */ +/* $OpenBSD: puts.c,v 1.4 2023/01/16 07:29:32 deraadt Exp $ */ +void putchar(char); + void puts(s) char *s; -- 2.20.1