CVS commit: src/sys/arch/pmax/stand/common
Module Name:src Committed By: dholland Date: Sat Jun 11 19:11:20 UTC 2016 Modified Files: src/sys/arch/pmax/stand/common: callvec.c Log Message: Update to match change to dec_prom.h. To generate a diff of this commit: cvs rdiff -u -r1.18 -r1.19 src/sys/arch/pmax/stand/common/callvec.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/pmax/stand/common/callvec.c diff -u src/sys/arch/pmax/stand/common/callvec.c:1.18 src/sys/arch/pmax/stand/common/callvec.c:1.19 --- src/sys/arch/pmax/stand/common/callvec.c:1.18 Mon Dec 14 00:46:11 2009 +++ src/sys/arch/pmax/stand/common/callvec.c Sat Jun 11 19:11:20 2016 @@ -1,4 +1,4 @@ -/* $NetBSD: callvec.c,v 1.18 2009/12/14 00:46:11 matt Exp $ */ +/* $NetBSD: callvec.c,v 1.19 2016/06/11 19:11:20 dholland Exp $ */ /*- * Copyright (c) 1992, 1993 @@ -45,7 +45,7 @@ struct callback callvec = { ._strcpy = (void *)DEC_PROM_STRCPY, ._strlen = (void *)DEC_PROM_STRLEN, ._getchar = (void *)DEC_PROM_GETCHAR, - ._gets = (void *)DEC_PROM_GETS, + ._unsafe_gets = (void *)DEC_PROM_GETS, ._puts = (void *)DEC_PROM_PUTS, ._printf = (void *)DEC_PROM_PRINTF, ._setenv = (void *)DEC_PROM_SETENV2,
CVS commit: src/sys/arch/pmax/stand/common
Module Name:src Committed By: tsutsui Date: Sat Mar 26 15:49:27 UTC 2011 Modified Files: src/sys/arch/pmax/stand/common: bootinit.S bootread.S clear_cache.S getchar.S printf.S start.S Log Message: Use .set reorder to entrust compiler hazards and BDslots to avoid future botch since there is no critical instructions in these sources. Tested on 3MIN. To generate a diff of this commit: cvs rdiff -u -r1.7 -r1.8 src/sys/arch/pmax/stand/common/bootinit.S \ src/sys/arch/pmax/stand/common/bootread.S cvs rdiff -u -r1.8 -r1.9 src/sys/arch/pmax/stand/common/clear_cache.S \ src/sys/arch/pmax/stand/common/printf.S cvs rdiff -u -r1.4 -r1.5 src/sys/arch/pmax/stand/common/getchar.S cvs rdiff -u -r1.22 -r1.23 src/sys/arch/pmax/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/pmax/stand/common/bootinit.S diff -u src/sys/arch/pmax/stand/common/bootinit.S:1.7 src/sys/arch/pmax/stand/common/bootinit.S:1.8 --- src/sys/arch/pmax/stand/common/bootinit.S:1.7 Mon Jan 10 16:43:29 2011 +++ src/sys/arch/pmax/stand/common/bootinit.S Sat Mar 26 15:49:26 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: bootinit.S,v 1.7 2011/01/10 16:43:29 tsutsui Exp $ */ +/* $NetBSD: bootinit.S,v 1.8 2011/03/26 15:49:26 tsutsui Exp $ */ /*- * Copyright (c) 1999 The NetBSD Foundation, Inc. @@ -33,12 +33,9 @@ #include #include - .set noreorder + .set reorder # make as(1) handle hazard and BDslot LEAF(bootinit) lw v0, _C_LABEL(callv) # get pointer to call back vectors - nop lw v0, 0x54(v0) # offset for callv->_bootinit - nop j v0 # call PROM bootinit - nop END(bootinit) Index: src/sys/arch/pmax/stand/common/bootread.S diff -u src/sys/arch/pmax/stand/common/bootread.S:1.7 src/sys/arch/pmax/stand/common/bootread.S:1.8 --- src/sys/arch/pmax/stand/common/bootread.S:1.7 Mon Jan 10 16:43:29 2011 +++ src/sys/arch/pmax/stand/common/bootread.S Sat Mar 26 15:49:26 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: bootread.S,v 1.7 2011/01/10 16:43:29 tsutsui Exp $ */ +/* $NetBSD: bootread.S,v 1.8 2011/03/26 15:49:26 tsutsui Exp $ */ /*- * Copyright (c) 1999 The NetBSD Foundation, Inc. @@ -33,12 +33,9 @@ #include #include - .set noreorder + .set reorder # make as(1) handle hazard and BDslot LEAF(bootread) lw v0, _C_LABEL(callv) # get pointer to call back vectors - nop lw v0, 0x58(v0) # offset for callv->_bootread - nop j v0 # call PROM bootread - nop END(bootread) Index: src/sys/arch/pmax/stand/common/clear_cache.S diff -u src/sys/arch/pmax/stand/common/clear_cache.S:1.8 src/sys/arch/pmax/stand/common/clear_cache.S:1.9 --- src/sys/arch/pmax/stand/common/clear_cache.S:1.8 Mon Jan 10 16:43:29 2011 +++ src/sys/arch/pmax/stand/common/clear_cache.S Sat Mar 26 15:49:26 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: clear_cache.S,v 1.8 2011/01/10 16:43:29 tsutsui Exp $ */ +/* $NetBSD: clear_cache.S,v 1.9 2011/03/26 15:49:26 tsutsui Exp $ */ /*- * Copyright (c) 1999 The NetBSD Foundation, Inc. @@ -33,12 +33,9 @@ #include #include - .set noreorder + .set reorder # make as(1) handle hazard and BDslot LEAF(clear_cache) lw v0, _C_LABEL(callv) # get pointer to call back vectors - nop lw v0, 0x7c(v0) # offset for callv->_clear_cache - nop j v0 # call PROM clear_cache - nop END(clear_cache) Index: src/sys/arch/pmax/stand/common/printf.S diff -u src/sys/arch/pmax/stand/common/printf.S:1.8 src/sys/arch/pmax/stand/common/printf.S:1.9 --- src/sys/arch/pmax/stand/common/printf.S:1.8 Mon Jan 10 16:43:29 2011 +++ src/sys/arch/pmax/stand/common/printf.S Sat Mar 26 15:49:26 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: printf.S,v 1.8 2011/01/10 16:43:29 tsutsui Exp $ */ +/* $NetBSD: printf.S,v 1.9 2011/03/26 15:49:26 tsutsui Exp $ */ /*- * Copyright (c) 1999 The NetBSD Foundation, Inc. @@ -33,12 +33,10 @@ #include #include - .set noreorder + .set reorder # make as(1) handle hazard and BDslot LEAF(printf) lw v0, _C_LABEL(callv) # get pointer to call back vectors - nop lw t9, 0x30(v0) # offset for callv->_printf - nop #ifdef __mips_n32 /* * If someone calls printf with more than 4 args on n32, @@ -52,12 +50,10 @@ sw a7, 28(sp) sw ra, 44(sp) jalr t9 # call PROM printf - nop lw ra, 44(sp) + addu sp, sp, 48 j ra - addu sp, sp, 48 #else j t9 # call PROM printf - nop #endif END(printf) Index: src/sys/arch/pmax/stand/common/getchar.S diff -u src/sys/arch/pmax/stand/common/getchar.S:1.4 src/sys/arch/pmax/stand/common/getchar.S:1.5 --- src/sys/arch/pmax/stand/common/getchar.S:1.4 Mon Jan 10 16:43:29 2011 +++ src/sys/arch/pmax/stand/common/getchar.S Sat Mar 26 15:49:26 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: getchar.S,v 1.4 2011/01/10 16:43:29 tsutsui Exp $ */ +/* $NetBSD: getchar.S,v 1.5 2011/03/26 15:49:26 tsutsui Exp $ */ /*- * Copyright (c) 1999 The NetBSD Foundation, Inc. @@ -33,12 +33,9 @@ #include #include - .set noreorder + .set reorder # make as(1) handle hazard and
CVS commit: src/sys/arch/pmax/stand/common
Module Name:src Committed By: tsutsui Date: Wed Jan 12 15:32:43 UTC 2011 Modified Files: src/sys/arch/pmax/stand/common: if_prom.c Log Message: Pull a fix from src/sys/net/if_ethersubr.c rev. 1.185: Fix off by one. To generate a diff of this commit: cvs rdiff -u -r1.10 -r1.11 src/sys/arch/pmax/stand/common/if_prom.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/pmax/stand/common/if_prom.c diff -u src/sys/arch/pmax/stand/common/if_prom.c:1.10 src/sys/arch/pmax/stand/common/if_prom.c:1.11 --- src/sys/arch/pmax/stand/common/if_prom.c:1.10 Mon Jan 10 17:01:17 2011 +++ src/sys/arch/pmax/stand/common/if_prom.c Wed Jan 12 15:32:43 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: if_prom.c,v 1.10 2011/01/10 17:01:17 tsutsui Exp $ */ +/* $NetBSD: if_prom.c,v 1.11 2011/01/12 15:32:43 tsutsui Exp $ */ /* Copyright (c) 1999 The NetBSD Foundation, Inc. * All rights reserved. @@ -150,7 +150,7 @@ printf("enet=%s\n", enet); #endif -#define atox(c) (((c) < '9') ? ((c) - '0') : ((toupper(c) - 'A') + 10)) +#define atox(c) (((c) <= '9') ? ((c) - '0') : ((toupper(c) - 'A') + 10)) cp = (uint8_t *)enet; dest = desc->myea;
CVS commit: src/sys/arch/pmax/stand/common
Module Name:src Committed By: tsutsui Date: Tue Jan 11 16:19:38 UTC 2011 Modified Files: src/sys/arch/pmax/stand/common: bootinfo.c Log Message: ANSIfy. To generate a diff of this commit: cvs rdiff -u -r1.8 -r1.9 src/sys/arch/pmax/stand/common/bootinfo.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/pmax/stand/common/bootinfo.c diff -u src/sys/arch/pmax/stand/common/bootinfo.c:1.8 src/sys/arch/pmax/stand/common/bootinfo.c:1.9 --- src/sys/arch/pmax/stand/common/bootinfo.c:1.8 Mon Apr 28 20:23:31 2008 +++ src/sys/arch/pmax/stand/common/bootinfo.c Tue Jan 11 16:19:38 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: bootinfo.c,v 1.8 2008/04/28 20:23:31 martin Exp $ */ +/* $NetBSD: bootinfo.c,v 1.9 2011/01/11 16:19:38 tsutsui Exp $ */ /*- * Copyright (c) 1999 The NetBSD Foundation, Inc. @@ -39,8 +39,7 @@ static char *bi_next; static int bi_size; -void bi_init(addr) - paddr_t addr; +void bi_init(paddr_t addr) { struct btinfo_common *bi; struct btinfo_magic bi_magic; @@ -55,9 +54,7 @@ bi_add(&bi_magic, BTINFO_MAGIC, sizeof(bi_magic)); } -void bi_add(new, type, size) - void *new; - int type, size; +void bi_add(void *new, int type, int size) { struct btinfo_common *bi;
CVS commit: src/sys/arch/pmax/stand/common
Module Name:src Committed By: tsutsui Date: Mon Jan 10 17:01:17 UTC 2011 Modified Files: src/sys/arch/pmax/stand/common: common.h if_prom.c start.S Log Message: - start.S add a hazard nop so that prom_restart() works properly on MIPS1 (it seems broken since initial revision and had been restarted by fault?) - common.h export prom_restart() - if_prom.c use prom_restart() instead of a direct PROM call (that should be equivalent) To generate a diff of this commit: cvs rdiff -u -r1.9 -r1.10 src/sys/arch/pmax/stand/common/common.h \ src/sys/arch/pmax/stand/common/if_prom.c cvs rdiff -u -r1.21 -r1.22 src/sys/arch/pmax/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/pmax/stand/common/common.h diff -u src/sys/arch/pmax/stand/common/common.h:1.9 src/sys/arch/pmax/stand/common/common.h:1.10 --- src/sys/arch/pmax/stand/common/common.h:1.9 Sat Mar 14 14:46:04 2009 +++ src/sys/arch/pmax/stand/common/common.h Mon Jan 10 17:01:17 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: common.h,v 1.9 2009/03/14 14:46:04 dsl Exp $ */ +/* $NetBSD: common.h,v 1.10 2011/01/10 17:01:17 tsutsui Exp $ */ /*- * Copyright (c) 1999 The NetBSD Foundation, Inc. @@ -45,6 +45,7 @@ int prom_lseek(int, int, int); int prom_open(const char *, int); int prom_read(int, void *, int); +void __dead prom_restart(void); int prom_write(int, void *, int); Index: src/sys/arch/pmax/stand/common/if_prom.c diff -u src/sys/arch/pmax/stand/common/if_prom.c:1.9 src/sys/arch/pmax/stand/common/if_prom.c:1.10 --- src/sys/arch/pmax/stand/common/if_prom.c:1.9 Sun Jan 9 16:55:13 2011 +++ src/sys/arch/pmax/stand/common/if_prom.c Mon Jan 10 17:01:17 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: if_prom.c,v 1.9 2011/01/09 16:55:13 tsutsui Exp $ */ +/* $NetBSD: if_prom.c,v 1.10 2011/01/10 17:01:17 tsutsui Exp $ */ /* Copyright (c) 1999 The NetBSD Foundation, Inc. * All rights reserved. @@ -141,7 +141,7 @@ if (enet == NULL) { printf("No `enet' environment variable found.\n" "Set MAC address to `enet' manually by setenv command.\n"); - (*callv->_halt)((int *)0, 0); /* XXX */ + prom_restart(); /* NOTREACHED */ } Index: src/sys/arch/pmax/stand/common/start.S diff -u src/sys/arch/pmax/stand/common/start.S:1.21 src/sys/arch/pmax/stand/common/start.S:1.22 --- src/sys/arch/pmax/stand/common/start.S:1.21 Mon Jan 10 15:25:44 2011 +++ src/sys/arch/pmax/stand/common/start.S Mon Jan 10 17:01:17 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: start.S,v 1.21 2011/01/10 15:25:44 tsutsui Exp $ */ +/* $NetBSD: start.S,v 1.22 2011/01/10 17:01:17 tsutsui Exp $ */ /*- * Copyright (c) 1999 The NetBSD Foundation, Inc. @@ -116,6 +116,7 @@ LEAF(prom_restart) XLEAF(_rtt) lw v0, _C_LABEL (callv) + nop lw v0, 0x9C(v0) /* halt */ move a0, zero /* Don't print anything. */ j v0
CVS commit: src/sys/arch/pmax/stand/common
Module Name:src Committed By: tsutsui Date: Mon Jan 10 16:43:30 UTC 2011 Modified Files: src/sys/arch/pmax/stand/common: bootinit.S bootread.S clear_cache.S getchar.S printf.S Log Message: Add hazard nops required by MIPS1 in noreorder case. (Umm, is it easier to remove noreorder and all BDslot insns?) To generate a diff of this commit: cvs rdiff -u -r1.6 -r1.7 src/sys/arch/pmax/stand/common/bootinit.S \ src/sys/arch/pmax/stand/common/bootread.S cvs rdiff -u -r1.7 -r1.8 src/sys/arch/pmax/stand/common/clear_cache.S \ src/sys/arch/pmax/stand/common/printf.S cvs rdiff -u -r1.3 -r1.4 src/sys/arch/pmax/stand/common/getchar.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/pmax/stand/common/bootinit.S diff -u src/sys/arch/pmax/stand/common/bootinit.S:1.6 src/sys/arch/pmax/stand/common/bootinit.S:1.7 --- src/sys/arch/pmax/stand/common/bootinit.S:1.6 Mon Jan 10 15:25:15 2011 +++ src/sys/arch/pmax/stand/common/bootinit.S Mon Jan 10 16:43:29 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: bootinit.S,v 1.6 2011/01/10 15:25:15 tsutsui Exp $ */ +/* $NetBSD: bootinit.S,v 1.7 2011/01/10 16:43:29 tsutsui Exp $ */ /*- * Copyright (c) 1999 The NetBSD Foundation, Inc. @@ -36,6 +36,7 @@ .set noreorder LEAF(bootinit) lw v0, _C_LABEL(callv) # get pointer to call back vectors + nop lw v0, 0x54(v0) # offset for callv->_bootinit nop j v0 # call PROM bootinit Index: src/sys/arch/pmax/stand/common/bootread.S diff -u src/sys/arch/pmax/stand/common/bootread.S:1.6 src/sys/arch/pmax/stand/common/bootread.S:1.7 --- src/sys/arch/pmax/stand/common/bootread.S:1.6 Mon Jan 10 15:25:15 2011 +++ src/sys/arch/pmax/stand/common/bootread.S Mon Jan 10 16:43:29 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: bootread.S,v 1.6 2011/01/10 15:25:15 tsutsui Exp $ */ +/* $NetBSD: bootread.S,v 1.7 2011/01/10 16:43:29 tsutsui Exp $ */ /*- * Copyright (c) 1999 The NetBSD Foundation, Inc. @@ -36,6 +36,7 @@ .set noreorder LEAF(bootread) lw v0, _C_LABEL(callv) # get pointer to call back vectors + nop lw v0, 0x58(v0) # offset for callv->_bootread nop j v0 # call PROM bootread Index: src/sys/arch/pmax/stand/common/clear_cache.S diff -u src/sys/arch/pmax/stand/common/clear_cache.S:1.7 src/sys/arch/pmax/stand/common/clear_cache.S:1.8 --- src/sys/arch/pmax/stand/common/clear_cache.S:1.7 Mon Jan 10 15:25:15 2011 +++ src/sys/arch/pmax/stand/common/clear_cache.S Mon Jan 10 16:43:29 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: clear_cache.S,v 1.7 2011/01/10 15:25:15 tsutsui Exp $ */ +/* $NetBSD: clear_cache.S,v 1.8 2011/01/10 16:43:29 tsutsui Exp $ */ /*- * Copyright (c) 1999 The NetBSD Foundation, Inc. @@ -36,6 +36,7 @@ .set noreorder LEAF(clear_cache) lw v0, _C_LABEL(callv) # get pointer to call back vectors + nop lw v0, 0x7c(v0) # offset for callv->_clear_cache nop j v0 # call PROM clear_cache Index: src/sys/arch/pmax/stand/common/printf.S diff -u src/sys/arch/pmax/stand/common/printf.S:1.7 src/sys/arch/pmax/stand/common/printf.S:1.8 --- src/sys/arch/pmax/stand/common/printf.S:1.7 Mon Jan 10 15:25:15 2011 +++ src/sys/arch/pmax/stand/common/printf.S Mon Jan 10 16:43:29 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: printf.S,v 1.7 2011/01/10 15:25:15 tsutsui Exp $ */ +/* $NetBSD: printf.S,v 1.8 2011/01/10 16:43:29 tsutsui Exp $ */ /*- * Copyright (c) 1999 The NetBSD Foundation, Inc. @@ -36,6 +36,7 @@ .set noreorder LEAF(printf) lw v0, _C_LABEL(callv) # get pointer to call back vectors + nop lw t9, 0x30(v0) # offset for callv->_printf nop #ifdef __mips_n32 Index: src/sys/arch/pmax/stand/common/getchar.S diff -u src/sys/arch/pmax/stand/common/getchar.S:1.3 src/sys/arch/pmax/stand/common/getchar.S:1.4 --- src/sys/arch/pmax/stand/common/getchar.S:1.3 Mon Jan 10 15:25:15 2011 +++ src/sys/arch/pmax/stand/common/getchar.S Mon Jan 10 16:43:29 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: getchar.S,v 1.3 2011/01/10 15:25:15 tsutsui Exp $ */ +/* $NetBSD: getchar.S,v 1.4 2011/01/10 16:43:29 tsutsui Exp $ */ /*- * Copyright (c) 1999 The NetBSD Foundation, Inc. @@ -36,6 +36,7 @@ .set noreorder LEAF(getchar) lw v0, _C_LABEL(callv) # get pointer to call back vectors + nop lw v0, 0x24(v0) # offset for callv->_getchar nop j v0 # call PROM getchar
CVS commit: src/sys/arch/pmax/stand/common
Module Name:src Committed By: tsutsui Date: Mon Jan 10 15:25:44 UTC 2011 Modified Files: src/sys/arch/pmax/stand/common: start.S startprog.S Log Message: Indent instructions in BDslots. To generate a diff of this commit: cvs rdiff -u -r1.20 -r1.21 src/sys/arch/pmax/stand/common/start.S cvs rdiff -u -r1.7 -r1.8 src/sys/arch/pmax/stand/common/startprog.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/pmax/stand/common/start.S diff -u src/sys/arch/pmax/stand/common/start.S:1.20 src/sys/arch/pmax/stand/common/start.S:1.21 --- src/sys/arch/pmax/stand/common/start.S:1.20 Mon Apr 28 20:23:31 2008 +++ src/sys/arch/pmax/stand/common/start.S Mon Jan 10 15:25:44 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: start.S,v 1.20 2008/04/28 20:23:31 martin Exp $ */ +/* $NetBSD: start.S,v 1.21 2011/01/10 15:25:44 tsutsui Exp $ */ /*- * Copyright (c) 1999 The NetBSD Foundation, Inc. @@ -98,20 +98,20 @@ move s0, a0# save argc move s1, a1# save argv beq a2, DEC_REX_MAGIC, 1f # jump if boot from DS5000 - move s3, a3# BDslot: save call vector + move s3, a3# BDslot: save call vector la s3, _C_LABEL(callvec) # init call vector 1: la a0, _C_LABEL (edata) # clear BSS move a1, zero la a2, _C_LABEL (end) jal _C_LABEL(memset) # memset(edata, 0, end - edata) - subu a2, a2, a0 + subu a2, a2, a0 sw s3, _C_LABEL(callv) # save call vector move a0, s0# restore argc jal _C_LABEL(main) # main(argc, argv) - move a1, s1# restore argv + move a1, s1# restore argv j _C_LABEL(prom_restart) # restart... - nop + nop LEAF(prom_restart) XLEAF(_rtt) @@ -119,37 +119,37 @@ lw v0, 0x9C(v0) /* halt */ move a0, zero /* Don't print anything. */ j v0 - move a1, zero + move a1, zero END(prom_restart) LEAF(prom_open) li v0, DEC_PROM_OPEN j v0 - nop + nop END(prom_open) #ifndef LIBSA_NO_DEV_CLOSE LEAF(prom_close) li v0, DEC_PROM_CLOSE j v0 - nop + nop END(prom_close) #endif LEAF(prom_lseek) li v0, DEC_PROM_LSEEK j v0 - nop + nop END(prom_lseek) LEAF(prom_read) li v0, DEC_PROM_READ j v0 - nop + nop END(prom_read) LEAF(prom_write) li v0, DEC_PROM_WRITE j v0 - nop + nop END(prom_write) Index: src/sys/arch/pmax/stand/common/startprog.S diff -u src/sys/arch/pmax/stand/common/startprog.S:1.7 src/sys/arch/pmax/stand/common/startprog.S:1.8 --- src/sys/arch/pmax/stand/common/startprog.S:1.7 Fri Jan 7 14:50:27 2011 +++ src/sys/arch/pmax/stand/common/startprog.S Mon Jan 10 15:25:44 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: startprog.S,v 1.7 2011/01/07 14:50:27 tsutsui Exp $ */ +/* $NetBSD: startprog.S,v 1.8 2011/01/10 15:25:44 tsutsui Exp $ */ /*- * Copyright (c) 1999 The NetBSD Foundation, Inc. @@ -64,9 +64,9 @@ sw $8,16(sp) # save on stack for O32 sw $9,20(sp) # save on stack for O32 jal ra,t9 - nop# BDslot + nop# BDslot lw ra,CALLFRAME_RA(sp) # should not get back here! j ra - addu sp,sp,CALLFRAME_SIZ + addu sp,sp,CALLFRAME_SIZ END(startprog)
CVS commit: src/sys/arch/pmax/stand/common
Module Name:src Committed By: tsutsui Date: Mon Jan 10 15:25:15 UTC 2011 Modified Files: src/sys/arch/pmax/stand/common: bootinit.S bootread.S clear_cache.S getchar.S printf.S Log Message: - specify .set noreorder to fill BDslots properly - indent instructions in BDslots To generate a diff of this commit: cvs rdiff -u -r1.5 -r1.6 src/sys/arch/pmax/stand/common/bootinit.S \ src/sys/arch/pmax/stand/common/bootread.S cvs rdiff -u -r1.6 -r1.7 src/sys/arch/pmax/stand/common/clear_cache.S \ src/sys/arch/pmax/stand/common/printf.S cvs rdiff -u -r1.2 -r1.3 src/sys/arch/pmax/stand/common/getchar.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/pmax/stand/common/bootinit.S diff -u src/sys/arch/pmax/stand/common/bootinit.S:1.5 src/sys/arch/pmax/stand/common/bootinit.S:1.6 --- src/sys/arch/pmax/stand/common/bootinit.S:1.5 Mon Apr 28 20:23:31 2008 +++ src/sys/arch/pmax/stand/common/bootinit.S Mon Jan 10 15:25:15 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: bootinit.S,v 1.5 2008/04/28 20:23:31 martin Exp $ */ +/* $NetBSD: bootinit.S,v 1.6 2011/01/10 15:25:15 tsutsui Exp $ */ /*- * Copyright (c) 1999 The NetBSD Foundation, Inc. @@ -33,10 +33,11 @@ #include #include + .set noreorder LEAF(bootinit) lw v0, _C_LABEL(callv) # get pointer to call back vectors lw v0, 0x54(v0) # offset for callv->_bootinit nop j v0 # call PROM bootinit - nop + nop END(bootinit) Index: src/sys/arch/pmax/stand/common/bootread.S diff -u src/sys/arch/pmax/stand/common/bootread.S:1.5 src/sys/arch/pmax/stand/common/bootread.S:1.6 --- src/sys/arch/pmax/stand/common/bootread.S:1.5 Mon Apr 28 20:23:31 2008 +++ src/sys/arch/pmax/stand/common/bootread.S Mon Jan 10 15:25:15 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: bootread.S,v 1.5 2008/04/28 20:23:31 martin Exp $ */ +/* $NetBSD: bootread.S,v 1.6 2011/01/10 15:25:15 tsutsui Exp $ */ /*- * Copyright (c) 1999 The NetBSD Foundation, Inc. @@ -33,10 +33,11 @@ #include #include + .set noreorder LEAF(bootread) lw v0, _C_LABEL(callv) # get pointer to call back vectors lw v0, 0x58(v0) # offset for callv->_bootread nop j v0 # call PROM bootread - nop + nop END(bootread) Index: src/sys/arch/pmax/stand/common/clear_cache.S diff -u src/sys/arch/pmax/stand/common/clear_cache.S:1.6 src/sys/arch/pmax/stand/common/clear_cache.S:1.7 --- src/sys/arch/pmax/stand/common/clear_cache.S:1.6 Mon Apr 28 20:23:31 2008 +++ src/sys/arch/pmax/stand/common/clear_cache.S Mon Jan 10 15:25:15 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: clear_cache.S,v 1.6 2008/04/28 20:23:31 martin Exp $ */ +/* $NetBSD: clear_cache.S,v 1.7 2011/01/10 15:25:15 tsutsui Exp $ */ /*- * Copyright (c) 1999 The NetBSD Foundation, Inc. @@ -33,10 +33,11 @@ #include #include + .set noreorder LEAF(clear_cache) lw v0, _C_LABEL(callv) # get pointer to call back vectors lw v0, 0x7c(v0) # offset for callv->_clear_cache nop j v0 # call PROM clear_cache - nop + nop END(clear_cache) Index: src/sys/arch/pmax/stand/common/printf.S diff -u src/sys/arch/pmax/stand/common/printf.S:1.6 src/sys/arch/pmax/stand/common/printf.S:1.7 --- src/sys/arch/pmax/stand/common/printf.S:1.6 Mon Dec 14 00:46:11 2009 +++ src/sys/arch/pmax/stand/common/printf.S Mon Jan 10 15:25:15 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: printf.S,v 1.6 2009/12/14 00:46:11 matt Exp $ */ +/* $NetBSD: printf.S,v 1.7 2011/01/10 15:25:15 tsutsui Exp $ */ /*- * Copyright (c) 1999 The NetBSD Foundation, Inc. @@ -33,6 +33,7 @@ #include #include + .set noreorder LEAF(printf) lw v0, _C_LABEL(callv) # get pointer to call back vectors lw t9, 0x30(v0) # offset for callv->_printf @@ -56,6 +57,6 @@ addu sp, sp, 48 #else j t9 # call PROM printf - nop + nop #endif END(printf) Index: src/sys/arch/pmax/stand/common/getchar.S diff -u src/sys/arch/pmax/stand/common/getchar.S:1.2 src/sys/arch/pmax/stand/common/getchar.S:1.3 --- src/sys/arch/pmax/stand/common/getchar.S:1.2 Mon Apr 28 20:23:31 2008 +++ src/sys/arch/pmax/stand/common/getchar.S Mon Jan 10 15:25:15 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: getchar.S,v 1.2 2008/04/28 20:23:31 martin Exp $ */ +/* $NetBSD: getchar.S,v 1.3 2011/01/10 15:25:15 tsutsui Exp $ */ /*- * Copyright (c) 1999 The NetBSD Foundation, Inc. @@ -33,10 +33,11 @@ #include #include + .set noreorder LEAF(getchar) lw v0, _C_LABEL(callv) # get pointer to call back vectors lw v0, 0x24(v0) # offset for callv->_getchar nop j v0 # call PROM getchar - nop + nop END(getchar)
CVS commit: src/sys/arch/pmax/stand/common
Module Name:src Committed By: tsutsui Date: Sun Jan 9 16:55:13 UTC 2011 Modified Files: src/sys/arch/pmax/stand/common: if_prom.c Log Message: Misc cleanup: - use DPRINTF() style debug printf - KNF and ANSIfy - fix space/TAB botch - remove extra newlines To generate a diff of this commit: cvs rdiff -u -r1.8 -r1.9 src/sys/arch/pmax/stand/common/if_prom.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/pmax/stand/common/if_prom.c diff -u src/sys/arch/pmax/stand/common/if_prom.c:1.8 src/sys/arch/pmax/stand/common/if_prom.c:1.9 --- src/sys/arch/pmax/stand/common/if_prom.c:1.8 Sun Jan 9 16:28:40 2011 +++ src/sys/arch/pmax/stand/common/if_prom.c Sun Jan 9 16:55:13 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: if_prom.c,v 1.8 2011/01/09 16:28:40 tsutsui Exp $ */ +/* $NetBSD: if_prom.c,v 1.9 2011/01/09 16:55:13 tsutsui Exp $ */ /* Copyright (c) 1999 The NetBSD Foundation, Inc. * All rights reserved. @@ -46,6 +46,12 @@ #include #ifdef NET_DEBUG +#define DPRINTF(x) printf(x) +#else +#define DPRINTF(x) +#endif + +#ifdef NET_DEBUG void dump_packet_info(void *, int); #endif @@ -100,10 +106,8 @@ prom_match(struct netif *nif, void *machdep_hint) { -#ifdef NET_DEBUG - printf("prom_match: called\n"); -#endif - return (1); + DPRINTF(("prom_match: called\n")); + return 1; } @@ -111,9 +115,7 @@ prom_probe(struct netif *nif, void *machdep_hint) { -#ifdef NET_DEBUG - printf("prom_probe: called\n"); -#endif + DPRINTF(("prom_probe: called\n")); return 0; } @@ -121,22 +123,19 @@ void prom_init(struct iodesc *desc, void *machdep_hint) { - char *device = - ((struct netif *)desc->io_netif)->nif_driver->netif_bname; - char *enet; + struct netif *nif; + char *device, *enet; uint8_t *cp, *dest; int i; -#ifdef NET_DEBUG - printf("prom_init: called\n"); -#endif + DPRINTF(("prom_init: called\n")); try_bootp = 1; /* * Get our hardware address (this prom call is one of the rare ones - * which is the same for new and old proms) - */ + * which is the same for new and old proms) + */ enet = (*callv->_getenv)("enet"); if (enet == NULL) { @@ -170,6 +169,8 @@ desc->xid = 0x66d3; + nif = desc->io_netif; + device = nif->nif_driver->netif_bname; if (callv == &callvec) sc_fd = prom_open(device, 0); else @@ -185,9 +186,7 @@ { int s; -#ifdef NET_DEBUG - printf("prom_put: called\n"); -#endif + DPRINTF(("prom_put: called\n")); #ifdef NET_DEBUG if (debug) @@ -201,7 +200,7 @@ (*callv->_wbflush)(); /* didn't really make a difference */ } if (s < 0) - return (EIO); + return EIO; return s; } @@ -212,9 +211,7 @@ int s; satime_t t; -#ifdef NET_DEBUG - printf("prom_get: called\n"); -#endif + DPRINTF(("prom_get: called\n")); t = getsecs(); s = 0; @@ -231,7 +228,6 @@ #endif return s; - } @@ -239,9 +235,7 @@ prom_end(struct netif *nif) { -#ifdef NET_DEBUG - printf("prom_end: called\n"); -#endif + DPRINTF(("prom_end: called\n")); if (callv == &callvec) prom_close(sc_fd); @@ -249,9 +243,8 @@ #ifdef FILL_ARPCACHE -void fill_arpcache (pkt, len) - void *pkt; - int len; +void +fill_arpcache(void *pkt, int len) { int i; struct arp_list *al; @@ -272,21 +265,19 @@ return; } } - if (arp_num > 7) - arp_num = 1;/* recycle */ + if (arp_num > 7) + arp_num = 1; /* recycle */ al->addr.s_addr = ih->ip_src.s_addr; - for (i=0; i<6; i++) + for (i = 0; i < 6; i++) al->ea[i] = eh->ether_shost[i]; ++arp_num; } - } #endif #ifdef NET_DEBUG -void dump_packet_info(pkt, len) - void *pkt; - int len; +void +dump_packet_info(void *pkt, int len) { struct ether_header *eh = (struct ether_header *)pkt; struct ip *ih = (struct ip *)(eh + 1); @@ -299,8 +290,6 @@ printf("ip packet version %d\n", ih->ip_v); printf("source ip: 0x%x\n", ih->ip_src.s_addr); printf("dest ip: 0x%x\n", ih->ip_dst.s_addr); - } - } #endif
CVS commit: src/sys/arch/pmax/stand/common
Module Name:src Committed By: tsutsui Date: Sun Jan 9 16:28:40 UTC 2011 Modified Files: src/sys/arch/pmax/stand/common: if_prom.c Log Message: Check if `enet' environment variable is available before reference to get MAC address, and exit with appropriate warning messages if it isn't. My 3MIN doesn't set the variable by default and netboot fails silently. Also tidy up code that converts strings to enaddr. To generate a diff of this commit: cvs rdiff -u -r1.7 -r1.8 src/sys/arch/pmax/stand/common/if_prom.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/pmax/stand/common/if_prom.c diff -u src/sys/arch/pmax/stand/common/if_prom.c:1.7 src/sys/arch/pmax/stand/common/if_prom.c:1.8 --- src/sys/arch/pmax/stand/common/if_prom.c:1.7 Sat Mar 14 15:36:12 2009 +++ src/sys/arch/pmax/stand/common/if_prom.c Sun Jan 9 16:28:40 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: if_prom.c,v 1.7 2009/03/14 15:36:12 dsl Exp $ */ +/* $NetBSD: if_prom.c,v 1.8 2011/01/09 16:28:40 tsutsui Exp $ */ /* Copyright (c) 1999 The NetBSD Foundation, Inc. * All rights reserved. @@ -123,8 +123,9 @@ { char *device = ((struct netif *)desc->io_netif)->nif_driver->netif_bname; - char *c, *enet; - int i, j, num; + char *enet; + uint8_t *cp, *dest; + int i; #ifdef NET_DEBUG printf("prom_init: called\n"); @@ -138,23 +139,33 @@ */ enet = (*callv->_getenv)("enet"); + if (enet == NULL) { + printf("No `enet' environment variable found.\n" + "Set MAC address to `enet' manually by setenv command.\n"); + (*callv->_halt)((int *)0, 0); /* XXX */ + /* NOTREACHED */ + } + #ifdef NET_DEBUG if (debug) printf("enet=%s\n", enet); #endif - i=0; - c = enet; - for (i=0; i<6; i++) { - j = *c - '0'; - num = (j<10?j:j-39); - num <<= 4; - c++; - j = *c - '0'; - num += (j<10?j:j-39); - desc->myea[i] = num; - c++; - c++; /* skip '-' */ +#define atox(c) (((c) < '9') ? ((c) - '0') : ((toupper(c) - 'A') + 10)) + + cp = (uint8_t *)enet; + dest = desc->myea; + for (i = 0; i < 6; i++) { + if (isxdigit(*cp)) { + *dest = atox(*cp); + cp++; + if (isxdigit(*cp)) { +*dest = (*dest << 4) | atox(*cp); +cp++; + } + } + dest++; + cp++; /* skip '-' or ':' etc. */ } desc->xid = 0x66d3;
CVS commit: src/sys/arch/pmax/stand/common
Module Name:src Committed By: tsutsui Date: Fri Jan 7 14:50:27 UTC 2011 Modified Files: src/sys/arch/pmax/stand/common: startprog.S Log Message: Put .set noreorder so that BDslots are properly filled. To generate a diff of this commit: cvs rdiff -u -r1.6 -r1.7 src/sys/arch/pmax/stand/common/startprog.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/pmax/stand/common/startprog.S diff -u src/sys/arch/pmax/stand/common/startprog.S:1.6 src/sys/arch/pmax/stand/common/startprog.S:1.7 --- src/sys/arch/pmax/stand/common/startprog.S:1.6 Thu Nov 25 14:05:27 2010 +++ src/sys/arch/pmax/stand/common/startprog.S Fri Jan 7 14:50:27 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: startprog.S,v 1.6 2010/11/25 14:05:27 tsutsui Exp $ */ +/* $NetBSD: startprog.S,v 1.7 2011/01/07 14:50:27 tsutsui Exp $ */ /*- * Copyright (c) 1999 The NetBSD Foundation, Inc. @@ -38,6 +38,7 @@ #include + .set noreorder LEAF(startprog) subusp,sp,CALLFRAME_SIZ addu t2,a1,-CALLFRAME_SIZ # new stack value
CVS commit: src/sys/arch/pmax/stand/common
Module Name:src Committed By: tsutsui Date: Thu Nov 25 14:05:28 UTC 2010 Modified Files: src/sys/arch/pmax/stand/common: startprog.S Log Message: Fix botch on mips64 merge: - use correct offsets to pass args to loaded kernel in __mips_o32 case Now NetBSD/pmax kernel properly boots, but init(8) still doesn't start on GXemul emulating R3000 3MAX. To generate a diff of this commit: cvs rdiff -u -r1.5 -r1.6 src/sys/arch/pmax/stand/common/startprog.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/pmax/stand/common/startprog.S diff -u src/sys/arch/pmax/stand/common/startprog.S:1.5 src/sys/arch/pmax/stand/common/startprog.S:1.6 --- src/sys/arch/pmax/stand/common/startprog.S:1.5 Mon Dec 14 00:46:11 2009 +++ src/sys/arch/pmax/stand/common/startprog.S Thu Nov 25 14:05:27 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: startprog.S,v 1.5 2009/12/14 00:46:11 matt Exp $ */ +/* $NetBSD: startprog.S,v 1.6 2010/11/25 14:05:27 tsutsui Exp $ */ /*- * Copyright (c) 1999 The NetBSD Foundation, Inc. @@ -46,10 +46,10 @@ move a1,a3 #ifdef __mips_o32 - lw a2,48(sp) # load everything from old stack we need - lw a3,52(sp) - lw $8,56(sp) # use a4/t0 in case N32/N64 kernel - lw $9,60(sp) # use a5/t1 in case N32/N64 kernel + lw a2,CALLFRAME_SIZ+16(sp) # load everything from old stack we need + lw a3,CALLFRAME_SIZ+20(sp) + lw $8,CALLFRAME_SIZ+24(sp) # use a4/t0 in case N32/N64 kernel + lw $9,CALLFRAME_SIZ+28(sp) # use a5/t1 in case N32/N64 kernel #else move a2,a4 move a3,a5