CVS commit: src/sys/arch/emips/stand/common
Module Name:src Committed By: christos Date: Wed Mar 7 14:59:14 UTC 2018 Modified Files: src/sys/arch/emips/stand/common: ace.c Log Message: cleanup debugging code so that it compiles again. To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/sys/arch/emips/stand/common/ace.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/emips/stand/common/ace.c diff -u src/sys/arch/emips/stand/common/ace.c:1.3 src/sys/arch/emips/stand/common/ace.c:1.4 --- src/sys/arch/emips/stand/common/ace.c:1.3 Wed Feb 5 14:07:16 2014 +++ src/sys/arch/emips/stand/common/ace.c Wed Mar 7 09:59:14 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: ace.c,v 1.3 2014/02/05 19:07:16 christos Exp $ */ +/* $NetBSD: ace.c,v 1.4 2018/03/07 14:59:14 christos Exp $ */ /*- * Copyright (c) 2010 The NetBSD Foundation, Inc. @@ -88,7 +88,12 @@ */ #if defined(DEBUG) int acedebug = 2; -#define DBGME(lev,x) if (lev >= acedebug) x +#define DBGME(lev,x) \ + do \ + if (lev >= acedebug) { \ + x; \ + } \ + while (/*CONSTCOND*/0) #else #define DBGME(lev,x) #endif @@ -537,9 +542,9 @@ static int SysAce_read(struct _Sac * Int Data32 = Interface->DATABUFREG[0]; Data32 = le32toh(Data32); -DBGME(0,printf(" %x", Data32)); -if (0 == (0xf & (i+4) )) DBGME(0,printf("\n")); -memcpy(Buffer+i,,4); + DBGME(0,printf(" %x", Data32)); + if (0 == (0xf & (i+4))) DBGME(0,printf("\n")); +memcpy(Buffer+i, , 4); } else {
CVS commit: src/sys/arch/emips/stand/common
Module Name:src Committed By: christos Date: Tue Mar 6 22:13:14 UTC 2018 Modified Files: src/sys/arch/emips/stand/common: devopen.c Log Message: fix build, KNF, simplify. To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/sys/arch/emips/stand/common/devopen.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/emips/stand/common/devopen.c diff -u src/sys/arch/emips/stand/common/devopen.c:1.1 src/sys/arch/emips/stand/common/devopen.c:1.2 --- src/sys/arch/emips/stand/common/devopen.c:1.1 Tue Jan 25 20:18:54 2011 +++ src/sys/arch/emips/stand/common/devopen.c Tue Mar 6 17:13:14 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: devopen.c,v 1.1 2011/01/26 01:18:54 pooka Exp $ */ +/* $NetBSD: devopen.c,v 1.2 2018/03/06 22:13:14 christos Exp $ */ /*- * Copyright (c) 1992, 1993 @@ -59,54 +59,53 @@ devopen(struct open_file *f, cp = fname; ncp = device_name; -/* Require the form CTRL/DEVNAME(UNIT,PART)/FILENAME e.g. '0/ace(0,0)/netbsd' '0/tftp(0,0)/netbsd' - */ - -/* get controller number */ -if ((c = *cp) >= '0' && c <= '9') { -ctlr = c - '0'; -c = *++cp; -} else -return (ENXIO); - -if (c != '/') -return (ENXIO); -c = *++cp; - -/* get device name */ -while ((c = *cp) != '\0') { -if ((c == '(') || (c == '/')) { -cp++; -break; -} -if (ncp < device_name + sizeof(device_name) - 1) -*ncp++ = c; -cp++; -} -if (ncp == device_name) -return (ENXIO); - -/* get device number */ -if ((c = *cp) >= '0' && c <= '9') { -unit = c - '0'; -c = *++cp; -} else -return (ENXIO); - -if (c == ',') { -/* get partition number */ -if ((c = *++cp) >= '0' && c <= '9') { -part = c - '0'; -c = *++cp; -} else -return (ENXIO); -} else -return (ENXIO); - -if (c == ')') -cp++; -else -return (ENXIO); + /* + * Require the form CTRL/DEVNAME(UNIT,PART)/FILENAME + * e.g. '0/ace(0,0)/netbsd' '0/tftp(0,0)/netbsd' + */ + + /* get controller number */ + c = *cp++; + if (c < '0' || c > '9') + return ENXIO; + ctlr = c - '0'; + + c = *cp++; + if (c != '/') + return ENXIO; + + /* get device name */ + while ((c = *cp) != '\0') { + if ((c == '(') || (c == '/')) { + cp++; + break; + } + if (ncp < device_name + sizeof(device_name) - 1) + *ncp++ = c; + cp++; + } + if (ncp == device_name) + return ENXIO; + + /* get device number */ + c = *cp++; + if (c < '0' || c > '9') + return ENXIO; + unit = c - '0'; + + c = *cp++; + if (c != ',') + return (ENXIO); + + /* get partition number */ + c = *cp++; + if (c < '0' || c > '9') + return ENXIO; + part = c - '0'; + + c = *cp++; + if (c != ')') + return ENXIO; *ncp = '\0'; @@ -121,7 +120,7 @@ devopen(struct open_file *f, if (dp->dv_name) printf(" %s", dp->dv_name); printf("\n"); - return (ENXIO); + return ENXIO; fnd: #ifdef BOOTNET @@ -132,12 +131,12 @@ fnd: rc = (dp->dv_open)(f, ctlr, unit, part, cp); #endif /* !LIBSA_SINGLE_DEVICE */ if (rc) - return (rc); + return rc; #ifndef LIBSA_SINGLE_DEVICE f->f_dev = dp; #endif if (file && *cp != '\0') *file = (char *)cp; /* XXX */ - return (0); + return 0; }
CVS commit: src/sys/arch/emips/stand/common
Module Name:src Committed By: dholland Date: Sat Mar 12 02:13:35 UTC 2016 Modified Files: src/sys/arch/emips/stand/common: prom_iface.c Log Message: Refine previous so the output is all hex again. followup to PR 50942 To generate a diff of this commit: cvs rdiff -u -r1.5 -r1.6 src/sys/arch/emips/stand/common/prom_iface.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/emips/stand/common/prom_iface.c diff -u src/sys/arch/emips/stand/common/prom_iface.c:1.5 src/sys/arch/emips/stand/common/prom_iface.c:1.6 --- src/sys/arch/emips/stand/common/prom_iface.c:1.5 Fri Mar 11 18:27:37 2016 +++ src/sys/arch/emips/stand/common/prom_iface.c Sat Mar 12 02:13:35 2016 @@ -287,7 +287,7 @@ int init_memory(void) base += Ours->Control & RAMST_SIZE; if (addr != base) { -printf("remapping %x+%zu to %x\n", addr, size, base); +printf("remapping %x+%zx to %x\n", addr, size, base); Ram->BaseAddressAndTag = base; } base += size;
CVS commit: src/sys/arch/emips/stand/common
Module Name:src Committed By: christos Date: Fri Mar 11 18:27:37 UTC 2016 Modified Files: src/sys/arch/emips/stand/common: prom_iface.c Log Message: PR/50942: David Binderman: fix printf format To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 src/sys/arch/emips/stand/common/prom_iface.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/emips/stand/common/prom_iface.c diff -u src/sys/arch/emips/stand/common/prom_iface.c:1.4 src/sys/arch/emips/stand/common/prom_iface.c:1.5 --- src/sys/arch/emips/stand/common/prom_iface.c:1.4 Mon Feb 24 17:34:08 2014 +++ src/sys/arch/emips/stand/common/prom_iface.c Fri Mar 11 13:27:37 2016 @@ -287,7 +287,7 @@ int init_memory(void) base += Ours->Control & RAMST_SIZE; if (addr != base) { -printf("remapping %x+%x to %x\n", addr, size, base); +printf("remapping %x+%zu to %x\n", addr, size, base); Ram->BaseAddressAndTag = base; } base += size;
CVS commit: src/sys/arch/emips/stand/common
Module Name:src Committed By: dholland Date: Sun Feb 14 18:05:31 UTC 2016 Modified Files: src/sys/arch/emips/stand/common: printf.c Log Message: Fix wrong indent. To generate a diff of this commit: cvs rdiff -u -r1.6 -r1.7 src/sys/arch/emips/stand/common/printf.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/emips/stand/common/printf.c diff -u src/sys/arch/emips/stand/common/printf.c:1.6 src/sys/arch/emips/stand/common/printf.c:1.7 --- src/sys/arch/emips/stand/common/printf.c:1.6 Sun Feb 14 18:04:47 2016 +++ src/sys/arch/emips/stand/common/printf.c Sun Feb 14 18:05:31 2016 @@ -1,4 +1,4 @@ -/* $NetBSD: printf.c,v 1.6 2016/02/14 18:04:47 dholland Exp $ */ +/* $NetBSD: printf.c,v 1.7 2016/02/14 18:05:31 dholland Exp $ */ /*- * Copyright (c) 1998 Robert Nordier * All rights reserved. @@ -73,9 +73,9 @@ printf(const char *fmt,...) *s++ = hex[u & 0xfu]; while (u >>= 4); goto dumpbuf; -case 0: - va_end(ap); -return; + case 0: +va_end(ap); +return; } } xputchar(c);
CVS commit: src/sys/arch/emips/stand/common
Module Name:src Committed By: dholland Date: Sun Feb 14 18:04:47 UTC 2016 Modified Files: src/sys/arch/emips/stand/common: printf.c Log Message: Add missing va_end(). PR 50794 from David Binderman. To generate a diff of this commit: cvs rdiff -u -r1.5 -r1.6 src/sys/arch/emips/stand/common/printf.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/emips/stand/common/printf.c diff -u src/sys/arch/emips/stand/common/printf.c:1.5 src/sys/arch/emips/stand/common/printf.c:1.6 --- src/sys/arch/emips/stand/common/printf.c:1.5 Mon Feb 24 07:41:15 2014 +++ src/sys/arch/emips/stand/common/printf.c Sun Feb 14 18:04:47 2016 @@ -1,4 +1,4 @@ -/* $NetBSD: printf.c,v 1.5 2014/02/24 07:41:15 martin Exp $ */ +/* $NetBSD: printf.c,v 1.6 2016/02/14 18:04:47 dholland Exp $ */ /*- * Copyright (c) 1998 Robert Nordier * All rights reserved. @@ -74,6 +74,7 @@ printf(const char *fmt,...) while (u >>= 4); goto dumpbuf; case 0: + va_end(ap); return; } }
CVS commit: src/sys/arch/emips/stand/common
Module Name:src Committed By: christos Date: Sun Dec 13 18:24:50 UTC 2015 Modified Files: src/sys/arch/emips/stand/common: boot.c Log Message: PR/50537: David Binderman: fix bad sizeof To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/sys/arch/emips/stand/common/boot.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/emips/stand/common/boot.c diff -u src/sys/arch/emips/stand/common/boot.c:1.3 src/sys/arch/emips/stand/common/boot.c:1.4 --- src/sys/arch/emips/stand/common/boot.c:1.3 Wed Mar 26 12:10:20 2014 +++ src/sys/arch/emips/stand/common/boot.c Sun Dec 13 13:24:50 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: boot.c,v 1.3 2014/03/26 16:10:20 christos Exp $ */ +/* $NetBSD: boot.c,v 1.4 2015/12/13 18:24:50 christos Exp $ */ /*- * Copyright (c) 2010 The NetBSD Foundation, Inc. @@ -64,10 +64,10 @@ static int devcanon(char *); #define OPT_MAX PATH_MAX /* way overkill */ -static int loadit(char *name, u_long marks[MARK_MAX]) +static int loadit(char *name, u_long *marks) { printf("Loading: %s\n", name); - memset(marks, 0, sizeof marks); + memset(marks, 0, sizeof(*marks) * MARK_MAX); return (loadfile(name, marks, LOAD_ALL)); }
CVS commit: src/sys/arch/emips/stand/common
Module Name:src Committed By: christos Date: Wed Mar 26 16:10:20 UTC 2014 Modified Files: src/sys/arch/emips/stand/common: boot.c Log Message: fix sprintf To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/sys/arch/emips/stand/common/boot.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/emips/stand/common/boot.c diff -u src/sys/arch/emips/stand/common/boot.c:1.2 src/sys/arch/emips/stand/common/boot.c:1.3 --- src/sys/arch/emips/stand/common/boot.c:1.2 Mon Feb 24 02:46:33 2014 +++ src/sys/arch/emips/stand/common/boot.c Wed Mar 26 12:10:20 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: boot.c,v 1.2 2014/02/24 07:46:33 martin Exp $ */ +/* $NetBSD: boot.c,v 1.3 2014/03/26 16:10:20 christos Exp $ */ /*- * Copyright (c) 2010 The NetBSD Foundation, Inc. @@ -320,7 +320,7 @@ devcanon(char *fname) /* Copy kernel name before we overwrite, then do it */ strcpy(file_name, (*cp) ? cp : kernelnames[0]); - sprintf(fname,%c/%s(%c,%c)/%s, + snprintf(fname, PATH_MAX, %c/%s(%c,%c)/%s, ctlr + '0', device_name, unit + '0', part + '0', file_name); //printf(devcanon - %s\n,fname);
CVS commit: src/sys/arch/emips/stand/common
Module Name:src Committed By: martin Date: Mon Feb 24 08:00:52 UTC 2014 Modified Files: src/sys/arch/emips/stand/common: enic.c Log Message: Add missing prototypes/includes and remove unused variables To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/sys/arch/emips/stand/common/enic.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/emips/stand/common/enic.c diff -u src/sys/arch/emips/stand/common/enic.c:1.1 src/sys/arch/emips/stand/common/enic.c:1.2 --- src/sys/arch/emips/stand/common/enic.c:1.1 Wed Jan 26 01:18:54 2011 +++ src/sys/arch/emips/stand/common/enic.c Mon Feb 24 08:00:52 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: enic.c,v 1.1 2011/01/26 01:18:54 pooka Exp $ */ +/* $NetBSD: enic.c,v 1.2 2014/02/24 08:00:52 martin Exp $ */ /*- * Copyright (c) 2010 The NetBSD Foundation, Inc. @@ -66,6 +66,8 @@ #include lib/libsa/netif.h #include lib/libkern/libkern.h +#include start.h + #include machine/emipsreg.h #define the_enic ((struct _Enic *)ETHERNET_DEFAULT_ADDRESS) @@ -76,6 +78,8 @@ static void enicinit (struct iodesc *, v static int enicget (struct iodesc *, void *, size_t, saseconds_t); static int enicput (struct iodesc *, void *, size_t); static void enicend (struct netif *); +int enic_getpkt(struct _Enic *regs, void *buf, int bytes, int timeo); +int enic_present(int unit); #ifdef NET_DEBUG static void dump_packet(void *, int); @@ -154,7 +158,7 @@ int enic_getpkt(struct _Enic *regs, void ;/* nothing */ } else if (fl != ES_F_CMD) { -printf(enic: invalid saf=x%x (lo=%x)\n, saf, lo); +printf(enic: invalid saf=x%x (lo=%x, hi=%x)\n, saf, lo, hi); } }
CVS commit: src/sys/arch/emips/stand/common
Module Name:src Committed By: christos Date: Mon Feb 24 22:31:56 UTC 2014 Modified Files: src/sys/arch/emips/stand/common: clock.c common.h enic.c prom_iface.c putchar.c Log Message: make this compile To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/sys/arch/emips/stand/common/clock.c cvs rdiff -u -r1.2 -r1.3 src/sys/arch/emips/stand/common/common.h \ src/sys/arch/emips/stand/common/enic.c \ src/sys/arch/emips/stand/common/prom_iface.c \ src/sys/arch/emips/stand/common/putchar.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/emips/stand/common/clock.c diff -u src/sys/arch/emips/stand/common/clock.c:1.1 src/sys/arch/emips/stand/common/clock.c:1.2 --- src/sys/arch/emips/stand/common/clock.c:1.1 Tue Jan 25 20:18:54 2011 +++ src/sys/arch/emips/stand/common/clock.c Mon Feb 24 17:31:56 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: clock.c,v 1.1 2011/01/26 01:18:54 pooka Exp $ */ +/* $NetBSD: clock.c,v 1.2 2014/02/24 22:31:56 christos Exp $ */ /*- * Copyright (c) 2010 The NetBSD Foundation, Inc. @@ -33,11 +33,12 @@ #include sys/types.h #include machine/emipsreg.h +#include lib/libsa/net.h #include stand/common/common.h -long -getsecs() +satime_t +getsecs(void) { struct _Tc *Tc = (struct _Tc *)TIMER_DEFAULT_ADDRESS; uint64_t now; Index: src/sys/arch/emips/stand/common/common.h diff -u src/sys/arch/emips/stand/common/common.h:1.2 src/sys/arch/emips/stand/common/common.h:1.3 --- src/sys/arch/emips/stand/common/common.h:1.2 Thu Feb 6 13:43:41 2014 +++ src/sys/arch/emips/stand/common/common.h Mon Feb 24 17:31:56 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: common.h,v 1.2 2014/02/06 18:43:41 christos Exp $ */ +/* $NetBSD: common.h,v 1.3 2014/02/24 22:31:56 christos Exp $ */ /*- * Copyright (c) 1999 The NetBSD Foundation, Inc. @@ -43,9 +43,6 @@ extern int debug; /* only used for netwo /* startprog.S */ extern void startprog (int, int, int, char **, int, const void *, int, int); -/* clock.c */ -extern long getsecs (void); - /* init_board.c */ #define BOARD_HAS_DISK0 0x01 #define BOARD_HAS_DISK1 0x02 @@ -69,5 +66,8 @@ extern int enic_present(int); /* print.c */ extern void xputchar(int); +/* putchar.c */ +extern void putchar(int); + /* vers.c (generated by newvers.sh) */ extern const char bootprog_rev[]; Index: src/sys/arch/emips/stand/common/enic.c diff -u src/sys/arch/emips/stand/common/enic.c:1.2 src/sys/arch/emips/stand/common/enic.c:1.3 --- src/sys/arch/emips/stand/common/enic.c:1.2 Mon Feb 24 03:00:52 2014 +++ src/sys/arch/emips/stand/common/enic.c Mon Feb 24 17:31:56 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: enic.c,v 1.2 2014/02/24 08:00:52 martin Exp $ */ +/* $NetBSD: enic.c,v 1.3 2014/02/24 22:31:56 christos Exp $ */ /*- * Copyright (c) 2010 The NetBSD Foundation, Inc. @@ -69,6 +69,10 @@ #include start.h #include machine/emipsreg.h + +#include start.h +#include common.h + #define the_enic ((struct _Enic *)ETHERNET_DEFAULT_ADDRESS) /* forward declarations */ @@ -100,7 +104,8 @@ static void dump_packet(void *, int); /* Send a packet */ -static int enic_putpkt(struct _Enic *regs, void *buf, int bytes) +static int +enic_putpkt(struct _Enic *regs, void *buf, int bytes) { paddr_t phys = kvtophys(buf); @@ -113,7 +118,8 @@ static int enic_putpkt(struct _Enic *reg /* Get a packet */ -int enic_getpkt(struct _Enic *regs, void *buf, int bytes, int timeo) +static int +enic_getpkt(struct _Enic *regs, void *buf, int bytes, int timeo) { paddr_t phys; unsigned int isr, saf, hi, lo, fl; @@ -143,8 +149,9 @@ int enic_getpkt(struct _Enic *regs, void /* beware, order matters */ saf = regs-SizeAndFlags; -hi = regs-BufferAddressHi32; /* BUGBUG 64bit */ -lo = regs-BufferAddressLo32; /* this pops the fifo */ +hi = regs-BufferAddressHi32; /* BUGBUG 64bit */ +lo = regs-BufferAddressLo32; /* this pops the fifo */ + __USE(hi); fl = saf (ES_F_MASK ~ ES_F_DONE); @@ -182,7 +189,7 @@ static int enic_getmac(struct _Enic *reg regs-Control = EC_RESET; Delay(1); - regs-Control = regs-Control (~EC_RXDIS); +regs-Control = regs-Control (~EC_RXDIS); buffer[0] = ENIC_CMD_GET_ADDRESS; @@ -208,10 +215,11 @@ static int enic_getmac(struct _Enic *reg /* Exported interface */ -int enic_present(int unit) +int +enic_present(int unit) { - if ((unit != 0) || (the_enic-Tag != PMTTAG_ETHERNET)) -return 0; +if ((unit != 0) || (the_enic-Tag != PMTTAG_ETHERNET)) + return 0; return 1; } Index: src/sys/arch/emips/stand/common/prom_iface.c diff -u src/sys/arch/emips/stand/common/prom_iface.c:1.2 src/sys/arch/emips/stand/common/prom_iface.c:1.3 --- src/sys/arch/emips/stand/common/prom_iface.c:1.2 Mon Feb 24 02:50:22 2014 +++ src/sys/arch/emips/stand/common/prom_iface.c Mon Feb 24 17:31:56
CVS commit: src/sys/arch/emips/stand/common
Module Name:src Committed By: christos Date: Mon Feb 24 22:34:08 UTC 2014 Modified Files: src/sys/arch/emips/stand/common: enic.c prom_iface.c Log Message: make more things static, remove dup decls To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/sys/arch/emips/stand/common/enic.c \ src/sys/arch/emips/stand/common/prom_iface.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/emips/stand/common/enic.c diff -u src/sys/arch/emips/stand/common/enic.c:1.3 src/sys/arch/emips/stand/common/enic.c:1.4 --- src/sys/arch/emips/stand/common/enic.c:1.3 Mon Feb 24 17:31:56 2014 +++ src/sys/arch/emips/stand/common/enic.c Mon Feb 24 17:34:08 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: enic.c,v 1.3 2014/02/24 22:31:56 christos Exp $ */ +/* $NetBSD: enic.c,v 1.4 2014/02/24 22:34:08 christos Exp $ */ /*- * Copyright (c) 2010 The NetBSD Foundation, Inc. @@ -66,7 +66,6 @@ #include lib/libsa/netif.h #include lib/libkern/libkern.h -#include start.h #include machine/emipsreg.h @@ -82,8 +81,6 @@ static void enicinit (struct iodesc *, v static int enicget (struct iodesc *, void *, size_t, saseconds_t); static int enicput (struct iodesc *, void *, size_t); static void enicend (struct netif *); -int enic_getpkt(struct _Enic *regs, void *buf, int bytes, int timeo); -int enic_present(int unit); #ifdef NET_DEBUG static void dump_packet(void *, int); Index: src/sys/arch/emips/stand/common/prom_iface.c diff -u src/sys/arch/emips/stand/common/prom_iface.c:1.3 src/sys/arch/emips/stand/common/prom_iface.c:1.4 --- src/sys/arch/emips/stand/common/prom_iface.c:1.3 Mon Feb 24 17:31:56 2014 +++ src/sys/arch/emips/stand/common/prom_iface.c Mon Feb 24 17:34:08 2014 @@ -58,9 +58,6 @@ void epmc_halt(void); void save_locore(void); void restore_locore(void); -void *nope(void); -void real_halt(void*); -void halt(int *unused, int howto); static void *nope(void) {return NULL;} int getchar(void){return GetChar();}
CVS commit: src/sys/arch/emips/stand/common
Module Name:src Committed By: martin Date: Mon Feb 24 07:41:15 UTC 2014 Modified Files: src/sys/arch/emips/stand/common: printf.c putchar.c Log Message: Fix missing prototypes/includes. To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 src/sys/arch/emips/stand/common/printf.c cvs rdiff -u -r1.1 -r1.2 src/sys/arch/emips/stand/common/putchar.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/emips/stand/common/printf.c diff -u src/sys/arch/emips/stand/common/printf.c:1.4 src/sys/arch/emips/stand/common/printf.c:1.5 --- src/sys/arch/emips/stand/common/printf.c:1.4 Sun Feb 23 07:49:04 2014 +++ src/sys/arch/emips/stand/common/printf.c Mon Feb 24 07:41:15 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: printf.c,v 1.4 2014/02/23 07:49:04 martin Exp $ */ +/* $NetBSD: printf.c,v 1.5 2014/02/24 07:41:15 martin Exp $ */ /*- * Copyright (c) 1998 Robert Nordier * All rights reserved. @@ -19,8 +19,7 @@ */ #include lib/libsa/stand.h - -void xputchar(int); +#include common.h void xputchar(int ch) Index: src/sys/arch/emips/stand/common/putchar.c diff -u src/sys/arch/emips/stand/common/putchar.c:1.1 src/sys/arch/emips/stand/common/putchar.c:1.2 --- src/sys/arch/emips/stand/common/putchar.c:1.1 Wed Jan 26 01:18:54 2011 +++ src/sys/arch/emips/stand/common/putchar.c Mon Feb 24 07:41:15 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: putchar.c,v 1.1 2011/01/26 01:18:54 pooka Exp $ */ +/* $NetBSD: putchar.c,v 1.2 2014/02/24 07:41:15 martin Exp $ */ /*- * Copyright (c) 2010 The NetBSD Foundation, Inc. @@ -31,6 +31,10 @@ */ #include sys/types.h +#include start.h +#include common.h + +void putchar(int); /* Write a character to the USART */
CVS commit: src/sys/arch/emips/stand/common
Module Name:src Committed By: martin Date: Mon Feb 24 07:46:33 UTC 2014 Modified Files: src/sys/arch/emips/stand/common: boot.c Log Message: Remove unused variables To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/sys/arch/emips/stand/common/boot.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/emips/stand/common/boot.c diff -u src/sys/arch/emips/stand/common/boot.c:1.1 src/sys/arch/emips/stand/common/boot.c:1.2 --- src/sys/arch/emips/stand/common/boot.c:1.1 Wed Jan 26 01:18:54 2011 +++ src/sys/arch/emips/stand/common/boot.c Mon Feb 24 07:46:33 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: boot.c,v 1.1 2011/01/26 01:18:54 pooka Exp $ */ +/* $NetBSD: boot.c,v 1.2 2014/02/24 07:46:33 martin Exp $ */ /*- * Copyright (c) 2010 The NetBSD Foundation, Inc. @@ -53,7 +53,7 @@ char *kernelnames[] = { netbsd.old, onetbsd, gennetbsd, -nfsnetbsd, + nfsnetbsd, NULL }; @@ -66,9 +66,9 @@ static int devcanon(char *); static int loadit(char *name, u_long marks[MARK_MAX]) { -printf(Loading: %s\n, name); -memset(marks, 0, sizeof marks); -return (loadfile(name, marks, LOAD_ALL)); + printf(Loading: %s\n, name); + memset(marks, 0, sizeof marks); + return (loadfile(name, marks, LOAD_ALL)); } /* @@ -78,31 +78,30 @@ static int loadit(char *name, u_long mar void main(char *stack_top) { - int argc; -int autoboot = 1, win; + int autoboot = 1, win; char *name, **namep, *dev, *kernel; - char bootname[PATH_MAX], bootpath[PATH_MAX], options[OPT_MAX]; + char bootpath[PATH_MAX], options[OPT_MAX]; uint32_t entry; u_long marks[MARK_MAX]; struct btinfo_symtab bi_syms; struct btinfo_bootpath bi_bpath; -/* Init all peripherals, esp USART for printf and memory */ -init_board(); + /* Init all peripherals, esp USART for printf and memory */ + init_board(); -/* On account of compression, we need a fairly large heap. - * To keep things simple, take one meg just below the 16 meg mark. - * That allows for a large kernel, and a 16MB configuration still works. - */ -setheap((void *)(0x8100-(1024*1024)), (void *)0x8100); - -/* On the BEE3 and the Giano simulator, we need a sec between the serial-line download complete - * and switching the serial line to PuTTY as console. Get a char to pause. - * This delay is also the practice on PCs so. - */ -Delay(20); -printf(Hit any char to boot..); -argc = GetChar(); + /* On account of compression, we need a fairly large heap. + * To keep things simple, take one meg just below the 16 meg mark. + * That allows for a large kernel, and a 16MB configuration still works. + */ + setheap((void *)(0x8100-(1024*1024)), (void *)0x8100); + + /* On the BEE3 and the Giano simulator, we need a sec between the serial-line download complete + * and switching the serial line to PuTTY as console. Get a char to pause. + * This delay is also the practice on PCs so. + */ + Delay(20); + printf(Hit any char to boot..); + (void)GetChar(); /* print a banner */ printf(\n); @@ -112,25 +111,25 @@ main(char *stack_top) /* initialise bootinfo structure early */ bi_init(BOOTINFO_ADDR); -/* Default is to auto-boot from the first disk */ -dev = 0/ace(0,0)/; + /* Default is to auto-boot from the first disk */ + dev = 0/ace(0,0)/; kernel = kernelnames[0]; -options[0] = 0; + options[0] = 0; -win = 0; -for (;!win;) { -strcpy(bootpath, dev); -strcat(bootpath, kernel); -name = getboot(bootpath,options); - -if (name != NULL) { -win = (loadit(name, marks) == 0); -} else if (autoboot) -break; -autoboot = 0; -} + win = 0; + for (;!win;) { + strcpy(bootpath, dev); + strcat(bootpath, kernel); + name = getboot(bootpath,options); + + if (name != NULL) { + win = (loadit(name, marks) == 0); + } else if (autoboot) + break; + autoboot = 0; + } -if (!win) { + if (!win) { for (namep = kernelnames, win = 0; *namep != NULL !win; namep++) { kernel = *namep; @@ -155,7 +154,7 @@ main(char *stack_top) bi_add(bi_syms, BTINFO_SYMTAB, sizeof(bi_syms)); printf(Starting at 0x%x\n\n, entry); -call_kernel(entry, name, options, BOOTINFO_MAGIC, bootinfo); + call_kernel(entry, name, options, BOOTINFO_MAGIC, bootinfo); (void)printf(KERNEL RETURNED!\n); fail: @@ -165,90 +164,90 @@ fail: static inline int parse(char *cmd, char *kname, char *optarg) { -char *arg = cmd; -char *ep, *p; -int c, i; - -while ((c = *arg++)) { -/* skip leading blanks */ -if (c == ' ' || c == '\t' || c == '\n') -continue; -/* find separator, or eol */ -for (p = arg; *p *p != '\n' *p != ' ' *p != '\t'; p++); -ep = p; -/* trim if separator */ -if (*p) -
CVS commit: src/sys/arch/emips/stand/common
Module Name:src Committed By: martin Date: Sun Feb 23 07:49:04 UTC 2014 Modified Files: src/sys/arch/emips/stand/common: printf.c Log Message: Provide a prototype for xputchar To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/sys/arch/emips/stand/common/printf.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/emips/stand/common/printf.c diff -u src/sys/arch/emips/stand/common/printf.c:1.3 src/sys/arch/emips/stand/common/printf.c:1.4 --- src/sys/arch/emips/stand/common/printf.c:1.3 Thu Jul 21 11:04:24 2011 +++ src/sys/arch/emips/stand/common/printf.c Sun Feb 23 07:49:04 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: printf.c,v 1.3 2011/07/21 11:04:24 joerg Exp $ */ +/* $NetBSD: printf.c,v 1.4 2014/02/23 07:49:04 martin Exp $ */ /*- * Copyright (c) 1998 Robert Nordier * All rights reserved. @@ -20,6 +20,8 @@ #include lib/libsa/stand.h +void xputchar(int); + void xputchar(int ch) {
CVS commit: src/sys/arch/emips/stand/common
Module Name:src Committed By: christos Date: Thu Feb 6 18:43:41 UTC 2014 Modified Files: src/sys/arch/emips/stand/common: common.h Log Message: add missing prototype; remove names from args To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/sys/arch/emips/stand/common/common.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/emips/stand/common/common.h diff -u src/sys/arch/emips/stand/common/common.h:1.1 src/sys/arch/emips/stand/common/common.h:1.2 --- src/sys/arch/emips/stand/common/common.h:1.1 Tue Jan 25 20:18:54 2011 +++ src/sys/arch/emips/stand/common/common.h Thu Feb 6 13:43:41 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: common.h,v 1.1 2011/01/26 01:18:54 pooka Exp $ */ +/* $NetBSD: common.h,v 1.2 2014/02/06 18:43:41 christos Exp $ */ /*- * Copyright (c) 1999 The NetBSD Foundation, Inc. @@ -58,15 +58,16 @@ extern int getsysid(void); /* prom_iface.c */ extern int init_usart(void); extern int init_memory(void); -extern void call_kernel(uint32_t addr, char *kname, char *kargs, u_int bim, char *bip); +extern void call_kernel(uint32_t, char *, char *, u_int, char *); /* ace.c */ -extern int aceprobe(int unit); +extern int aceprobe(int); /* enic.c */ -extern int enic_present(int unit); +extern int enic_present(int); -/* - * vers.c (generated by newvers.sh) - */ +/* print.c */ +extern void xputchar(int); + +/* vers.c (generated by newvers.sh) */ extern const char bootprog_rev[];
CVS commit: src/sys/arch/emips/stand/common
Module Name:src Committed By: matt Date: Thu Feb 6 19:20:12 UTC 2014 Modified Files: src/sys/arch/emips/stand/common: start.S Log Message: If we just want _end, load it directly and skip the gp To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/sys/arch/emips/stand/common/start.S Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/emips/stand/common/start.S diff -u src/sys/arch/emips/stand/common/start.S:1.2 src/sys/arch/emips/stand/common/start.S:1.3 --- src/sys/arch/emips/stand/common/start.S:1.2 Thu Mar 10 18:18:00 2011 +++ src/sys/arch/emips/stand/common/start.S Thu Feb 6 19:20:11 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: start.S,v 1.2 2011/03/10 18:18:00 pooka Exp $ */ +/* $NetBSD: start.S,v 1.3 2014/02/06 19:20:11 matt Exp $ */ /*- * Copyright (c) 2010 The NetBSD Foundation, Inc. @@ -522,10 +522,8 @@ END(PutChar) LEAF(switch_stack_and_call) /* Get a stack and jump. It would be a very bad idea to return but.. */ -#ifdef __GP_SUPPORT__ -la gp, _C_LABEL (_gp) -#endif -lasp,_end +lui sp,%hi(_end) +addiu sp,%lo(_end) jra1 addiu sp,sp,(2*1024) /* BUGBUG arbitrary */
CVS commit: src/sys/arch/emips/stand/common
Module Name:src Committed By: christos Date: Wed Feb 5 19:07:16 UTC 2014 Modified Files: src/sys/arch/emips/stand/common: ace.c Log Message: make this compile. To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/sys/arch/emips/stand/common/ace.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/emips/stand/common/ace.c diff -u src/sys/arch/emips/stand/common/ace.c:1.2 src/sys/arch/emips/stand/common/ace.c:1.3 --- src/sys/arch/emips/stand/common/ace.c:1.2 Sun Jul 17 16:54:39 2011 +++ src/sys/arch/emips/stand/common/ace.c Wed Feb 5 14:07:16 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: ace.c,v 1.2 2011/07/17 20:54:39 joerg Exp $ */ +/* $NetBSD: ace.c,v 1.3 2014/02/05 19:07:16 christos Exp $ */ /*- * Copyright (c) 2010 The NetBSD Foundation, Inc. @@ -65,6 +65,7 @@ #include common.h #include ace.h +#include start.h #define NSAC 2 #define SAC0 ((struct _Sac *)IDE_DEFAULT_ADDRESS) @@ -618,7 +619,7 @@ aceopen(struct open_file *f, ...) int i; char *msg; char buf[DEV_BSIZE]; - int cnt; + size_t cnt; va_list ap; va_start(ap, f);
CVS commit: src/sys/arch/emips/stand/common
Module Name:src Committed By: pooka Date: Thu Mar 10 18:18:01 UTC 2011 Modified Files: src/sys/arch/emips/stand/common: start.S Log Message: Use NESTED_NOPROFILE instead of VECTOR, since VECTOR grew a .org directive for some reason. from sandrof (i didn't test booting, will wait for autobuild to do the work for me) To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/sys/arch/emips/stand/common/start.S Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/emips/stand/common/start.S diff -u src/sys/arch/emips/stand/common/start.S:1.1 src/sys/arch/emips/stand/common/start.S:1.2 --- src/sys/arch/emips/stand/common/start.S:1.1 Wed Jan 26 01:18:54 2011 +++ src/sys/arch/emips/stand/common/start.S Thu Mar 10 18:18:00 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: start.S,v 1.1 2011/01/26 01:18:54 pooka Exp $ */ +/* $NetBSD: start.S,v 1.2 2011/03/10 18:18:00 pooka Exp $ */ /*- * Copyright (c) 2010 The NetBSD Foundation, Inc. @@ -99,8 +99,7 @@ * But to test interrupts should be enough */ .org 0x0080 -VECTOR(ExceptionHandler,0) - .frame sp,SIZEOF_CXTINFO,$31 +NESTED_NOPROFILE(ExceptionHandler,SIZEOF_CXTINFO,$31) la k1, UserInterruptHandler lw k1,0(k1) bnek1,zero,Dispatch @@ -216,7 +215,7 @@ rfe .set at -VECTOR_END(ExceptionHandler) +END(ExceptionHandler) .org 0x0200 EXPORT(real_start)