summaryrefslogtreecommitdiff
path: root/sys/arch/macppc/stand
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@cvs.openbsd.org>2019-09-02 23:40:30 +0000
committerMark Kettenis <kettenis@cvs.openbsd.org>2019-09-02 23:40:30 +0000
commit7f03c12881e0279816c0ae55fee04cd111ea077c (patch)
tree118e2a8b38bcea756d68bab755f6864741831bf8 /sys/arch/macppc/stand
parent4a7676e5ac20d82f755b8e24f2717e3487829d15 (diff)
Various fixes to make clang happy.
ok deraadt@
Diffstat (limited to 'sys/arch/macppc/stand')
-rw-r--r--sys/arch/macppc/stand/Locore.c13
-rw-r--r--sys/arch/macppc/stand/alloc.c4
-rw-r--r--sys/arch/macppc/stand/boot.mac/fixcoff.c7
-rw-r--r--sys/arch/macppc/stand/libsa.h8
-rw-r--r--sys/arch/macppc/stand/main.c13
-rw-r--r--sys/arch/macppc/stand/net.c10
-rw-r--r--sys/arch/macppc/stand/ofdev.c5
-rw-r--r--sys/arch/macppc/stand/ofdev.h5
-rw-r--r--sys/arch/macppc/stand/openfirm.h4
9 files changed, 46 insertions, 23 deletions
diff --git a/sys/arch/macppc/stand/Locore.c b/sys/arch/macppc/stand/Locore.c
index 351183ad7ef..2b3497a3117 100644
--- a/sys/arch/macppc/stand/Locore.c
+++ b/sys/arch/macppc/stand/Locore.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: Locore.c,v 1.16 2014/07/12 21:54:58 jasper Exp $ */
+/* $OpenBSD: Locore.c,v 1.17 2019/09/02 23:40:29 kettenis Exp $ */
/* $NetBSD: Locore.c,v 1.1 1997/04/16 20:29:11 thorpej Exp $ */
/*
@@ -41,8 +41,14 @@
#include "machine/cpu.h"
*/
+int main(void);
+void syncicache(void *, int);
+
#define ENABLE_DECREMENTER_WORKAROUND
-void patch_dec_intr();
+void bat_init(void);
+void patch_dec_intr(void);
+
+__dead void exit(void);
static int (*openfirmware)(void *);
@@ -104,14 +110,13 @@ _start(void *vpd, int res, int (*openfirm)(void *), char *arg, int argl)
patch_dec_intr();
#endif
setup();
- main(arg, argl);
+ main();
exit();
}
#ifdef ENABLE_DECREMENTER_WORKAROUND
void handle_decr_intr();
__asm ( " .globl handle_decr_intr\n"
- " .type handle_decr_intr@function\n"
"handle_decr_intr:\n"
" rfi\n");
diff --git a/sys/arch/macppc/stand/alloc.c b/sys/arch/macppc/stand/alloc.c
index f8d883a75d5..62afba2976a 100644
--- a/sys/arch/macppc/stand/alloc.c
+++ b/sys/arch/macppc/stand/alloc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: alloc.c,v 1.10 2016/03/14 23:08:05 krw Exp $ */
+/* $OpenBSD: alloc.c,v 1.11 2019/09/02 23:40:29 kettenis Exp $ */
/* $NetBSD: alloc.c,v 1.1 1997/04/16 20:29:16 thorpej Exp $ */
/*
@@ -195,7 +195,7 @@ free(void *ptr, unsigned size)
}
void
-freeall()
+freeall(void)
{
#ifdef __notyet__ /* Firmware bug ?! */
struct ml *m;
diff --git a/sys/arch/macppc/stand/boot.mac/fixcoff.c b/sys/arch/macppc/stand/boot.mac/fixcoff.c
index 8852d921b2d..ba5495c7f6f 100644
--- a/sys/arch/macppc/stand/boot.mac/fixcoff.c
+++ b/sys/arch/macppc/stand/boot.mac/fixcoff.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: fixcoff.c,v 1.2 2013/07/16 08:03:18 mpi Exp $ */
+/* $OpenBSD: fixcoff.c,v 1.3 2019/09/02 23:40:29 kettenis Exp $ */
/* $NetBSD: fixcoff.c,v 1.10 2006/04/07 02:34:55 gdamore Exp $ */
/*
@@ -42,10 +42,12 @@
* Partially inspired by hack-coff, written by Paul Mackerras.
*/
+#include <err.h>
+#include <fcntl.h>
#include <stdio.h>
#include <stdlib.h>
+#include <string.h>
#include <unistd.h>
-#include <fcntl.h>
#include <sys/endian.h>
@@ -120,6 +122,7 @@ help(char *prog)
exit(0);
}
+int
main(int argc, char *argv[])
{
int fd, i, n, ch;
diff --git a/sys/arch/macppc/stand/libsa.h b/sys/arch/macppc/stand/libsa.h
index 749785978ad..a1a4f871fd2 100644
--- a/sys/arch/macppc/stand/libsa.h
+++ b/sys/arch/macppc/stand/libsa.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: libsa.h,v 1.1 2007/06/13 02:17:32 drahn Exp $ */
+/* $OpenBSD: libsa.h,v 1.2 2019/09/02 23:40:29 kettenis Exp $ */
/*
* Copyright (c) 2006 Mark Kettenis
@@ -19,3 +19,9 @@
#include <lib/libsa/stand.h>
#define DEFAULT_KERNEL_ADDRESS 0
+
+void freeall(void);
+
+void machdep(void);
+void devboot(dev_t, char *);
+void run_loadfile(uint64_t *marks, int howto);
diff --git a/sys/arch/macppc/stand/main.c b/sys/arch/macppc/stand/main.c
index aa047eca6fd..66551f81d5e 100644
--- a/sys/arch/macppc/stand/main.c
+++ b/sys/arch/macppc/stand/main.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: main.c,v 1.9 2019/04/10 04:17:36 deraadt Exp $ */
+/* $OpenBSD: main.c,v 1.10 2019/09/02 23:40:29 kettenis Exp $ */
/* $NetBSD: boot.c,v 1.1 1997/04/16 20:29:17 thorpej Exp $ */
/*
@@ -52,21 +52,20 @@
#include <sys/disklabel.h>
#include <lib/libkern/libkern.h>
-#include <lib/libsa/stand.h>
#include <lib/libsa/loadfile.h>
#include <stand/boot/cmd.h>
-
#include <machine/cpu.h>
#include <macppc/stand/ofdev.h>
#include <macppc/stand/openfirm.h>
+#include "libsa.h"
+
char bootdev[128];
int boothowto;
int debug;
-
void
get_alt_bootdev(char *, size_t, char *, size_t);
@@ -126,8 +125,9 @@ chain(void (*entry)(), char *args, void *ssym, void *esym)
char bootline[512];
extern char *kernelfile;
+
int
-main()
+main(void)
{
int chosen;
@@ -176,7 +176,7 @@ devboot(dev_t dev, char *p)
strlcpy(p, bootdev, BOOTDEVLEN);
}
-int
+void
run_loadfile(uint64_t *marks, int howto)
{
char bootline[512]; /* Should check size? */
@@ -213,7 +213,6 @@ run_loadfile(uint64_t *marks, int howto)
chain((void *)entry, bootline, ssym, esym);
_rtt();
- return 0;
}
int
diff --git a/sys/arch/macppc/stand/net.c b/sys/arch/macppc/stand/net.c
index 75287945b63..5222698595e 100644
--- a/sys/arch/macppc/stand/net.c
+++ b/sys/arch/macppc/stand/net.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: net.c,v 1.5 2014/08/21 14:24:08 mpi Exp $ */
+/* $OpenBSD: net.c,v 1.6 2019/09/02 23:40:29 kettenis Exp $ */
/* $NetBSD: net.c,v 1.1 1997/04/16 20:29:18 thorpej Exp $ */
/*
@@ -60,6 +60,12 @@
#include <lib/libsa/stand.h>
#include <lib/libsa/net.h>
#include <lib/libsa/netif.h>
+#include <lib/libsa/bootp.h>
+#include <lib/libsa/nfs.h>
+
+#include "ofdev.h"
+
+int net_mountroot(void);
char rootpath[FNAME_SIZE];
@@ -96,7 +102,7 @@ bad:
return error;
}
-int
+void
net_close(struct of_dev *op)
{
/*
diff --git a/sys/arch/macppc/stand/ofdev.c b/sys/arch/macppc/stand/ofdev.c
index 567006a0b0b..70d9e12604d 100644
--- a/sys/arch/macppc/stand/ofdev.c
+++ b/sys/arch/macppc/stand/ofdev.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ofdev.c,v 1.22 2015/03/23 20:18:52 miod Exp $ */
+/* $OpenBSD: ofdev.c,v 1.23 2019/09/02 23:40:29 kettenis Exp $ */
/* $NetBSD: ofdev.c,v 1.1 1997/04/16 20:29:20 thorpej Exp $ */
/*
@@ -46,6 +46,7 @@
#include <hfs.h>
#include <macppc/stand/ofdev.h>
+#include <macppc/stand/openfirm.h>
extern char bootdev[];
@@ -371,7 +372,7 @@ devopen(struct open_file *of, const char *name, char **file)
of->f_devdata = ofdev;
bcopy(&file_system_nfs, file_system, sizeof file_system[0]);
nfsys = 1;
- if (error = net_open(ofdev))
+ if ((error = net_open(ofdev)))
goto bad;
return 0;
}
diff --git a/sys/arch/macppc/stand/ofdev.h b/sys/arch/macppc/stand/ofdev.h
index 56f0509f6a6..f0604093a09 100644
--- a/sys/arch/macppc/stand/ofdev.h
+++ b/sys/arch/macppc/stand/ofdev.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: ofdev.h,v 1.1 2001/09/01 15:39:02 drahn Exp $ */
+/* $OpenBSD: ofdev.h,v 1.2 2019/09/02 23:40:29 kettenis Exp $ */
/* $NetBSD: ofdev.h,v 1.1 1997/04/16 20:29:22 thorpej Exp $ */
/*
@@ -50,4 +50,7 @@ struct of_dev {
extern char opened_name[];
+int net_open(struct of_dev *);
+void net_close(struct of_dev *);
+
#endif
diff --git a/sys/arch/macppc/stand/openfirm.h b/sys/arch/macppc/stand/openfirm.h
index bef8005210d..0bc7bccda4f 100644
--- a/sys/arch/macppc/stand/openfirm.h
+++ b/sys/arch/macppc/stand/openfirm.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: openfirm.h,v 1.4 2012/12/05 23:20:13 deraadt Exp $ */
+/* $OpenBSD: openfirm.h,v 1.5 2019/09/02 23:40:29 kettenis Exp $ */
/* $NetBSD: openfirm.h,v 1.1 1997/04/16 20:29:23 thorpej Exp $ */
/*
@@ -52,4 +52,4 @@ void *OF_claim(void *virt, u_int size, u_int align);
void OF_release(void *virt, u_int size);
int OF_milliseconds(void);
void OF_chain(void *addr, u_int size, void (*entry)(), void *parm, u_int parmlen);
-
+int OF_call_method(char *method, int ihandle, int nargs, int nreturns, ...);