CVS commit: src/sys/arch/ews4800mips/stand/common
Module Name:src Committed By: dholland Date: Mon May 30 02:30:20 UTC 2016 Modified Files: src/sys/arch/ews4800mips/stand/common: cmd.c Log Message: PR 51182 David Binderman: fix redundant conditional To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/sys/arch/ews4800mips/stand/common/cmd.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/ews4800mips/stand/common/cmd.c diff -u src/sys/arch/ews4800mips/stand/common/cmd.c:1.2 src/sys/arch/ews4800mips/stand/common/cmd.c:1.3 --- src/sys/arch/ews4800mips/stand/common/cmd.c:1.2 Mon Apr 28 20:23:18 2008 +++ src/sys/arch/ews4800mips/stand/common/cmd.c Mon May 30 02:30:20 2016 @@ -1,4 +1,4 @@ -/* $NetBSD: cmd.c,v 1.2 2008/04/28 20:23:18 martin Exp $ */ +/* $NetBSD: cmd.c,v 1.3 2016/05/30 02:30:20 dholland Exp $ */ /*- * Copyright (c) 2004 The NetBSD Foundation, Inc. @@ -99,7 +99,7 @@ cmd_exec(const char *buf) if (*p == ' ') { *p = 0; sep = 1; - } else if (sep && (*p != ' ' || *p == '\0')) { + } else if (sep) { sep = 0; argp[argc++] = p; }
CVS commit: src/sys/arch/ews4800mips/stand/common
Module Name:src Committed By: tsutsui Date: Sun Jun 7 03:00:54 UTC 2020 Modified Files: src/sys/arch/ews4800mips/stand/common: bootxx.c Log Message: Fix "illegal exceptoin" error on loading a secondary boot. Recent gcc/binutils create more than two problem header sections so the primary bootxx should handle them accordingly. See my port-mips@ port for more details: https://mail-index.netbsd.org/port-mips/2020/06/06/msg000948.html Should be pulled up to netbsd-9. To generate a diff of this commit: cvs rdiff -u -r1.5 -r1.6 src/sys/arch/ews4800mips/stand/common/bootxx.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/ews4800mips/stand/common/bootxx.c diff -u src/sys/arch/ews4800mips/stand/common/bootxx.c:1.5 src/sys/arch/ews4800mips/stand/common/bootxx.c:1.6 --- src/sys/arch/ews4800mips/stand/common/bootxx.c:1.5 Wed Feb 4 15:22:13 2009 +++ src/sys/arch/ews4800mips/stand/common/bootxx.c Sun Jun 7 03:00:53 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: bootxx.c,v 1.5 2009/02/04 15:22:13 tsutsui Exp $ */ +/* $NetBSD: bootxx.c,v 1.6 2020/06/07 03:00:53 tsutsui Exp $ */ /*- * Copyright (c) 2004, 2005 The NetBSD Foundation, Inc. @@ -46,6 +46,10 @@ #include "common.h" +#define IS_TEXT(p) (p.p_flags & PF_X) +#define IS_DATA(p) ((p.p_flags & PF_X) == 0) +#define IS_BSS(p) (p.p_filesz < p.p_memsz) + #define FILHSZ (sizeof(struct ecoff_filehdr)) #define SCNHSZ (sizeof(struct ecoff_scnhdr)) #define N_TXTOFF(f, a) \ @@ -186,6 +190,7 @@ load_elf(uint8_t *buf, uint32_t *entry) { Elf32_Ehdr *e = (void *)buf; Elf32_Phdr *p; + int i; if (e->e_ident[EI_MAG2] != 'L' || e->e_ident[EI_MAG3] != 'F' || e->e_ident[EI_CLASS] != ELFCLASS32 || @@ -197,16 +202,35 @@ load_elf(uint8_t *buf, uint32_t *entry) BASSERT(e->e_phentsize == sizeof(Elf32_Phdr)); p = (void *)(buf + e->e_phoff); #ifdef _STANDALONE - memcpy((void *)p->p_vaddr, buf + p->p_offset, p->p_filesz); - p++; - memcpy((void *)p->p_vaddr, buf + p->p_offset, p->p_filesz); + for (i = 0; i < e->e_phnum; i++) { + if (p[i].p_type != PT_LOAD || + (p[i].p_flags & (PF_W|PF_R|PF_X)) == 0) + continue; + if (IS_TEXT(p[i]) || IS_DATA(p[i])) { + memcpy((void *)p[i].p_vaddr, + buf + p[i].p_offset, p[i].p_filesz); + } + if (IS_BSS(p[i])) { + memset((void *)(p[i].p_vaddr + p[i].p_filesz), 0, + p[i].p_memsz - p[i].p_filesz); + } + } #else DPRINTF("ELF entry point 0x%08x\n", e->e_entry); - DPRINTF("[text] 0x%08x 0x%x %dbyte.\n", p->p_vaddr, p->p_offset, - p->p_filesz); - p++; - DPRINTF("[data] 0x%08x 0x%x %dbyte.\n", p->p_vaddr, p->p_offset, - p->p_filesz); + for (i = 0; i < e->e_phnum; i++) { + if (p[i].p_type != PT_LOAD || + (p[i].p_flags & (PF_W|PF_R|PF_X)) == 0) + continue; + if (IS_TEXT(p[i]) || IS_DATA(p[i])) { + DPRINTF("[text/data] 0x%08x 0x%x %dbyte.\n", + p[i].p_vaddr, p[i].p_offset, p[i].p_filesz); + } + if (IS_BSS(p[i])) { + DPRINTF("[bss] 0x%08x %dbyte.\n", + p[i].p_vaddr + p[i].p_filesz, + p[i].p_memsz - p[i].p_filesz); + } + } #endif *entry = e->e_entry;
CVS commit: src/sys/arch/ews4800mips/stand/common
Module Name:src Committed By: christos Date: Tue Jan 8 17:14:14 UTC 2019 Modified Files: src/sys/arch/ews4800mips/stand/common: bfs_subr.c Log Message: Include for DEV_BSIZE/DEV_BSHIFT To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/sys/arch/ews4800mips/stand/common/bfs_subr.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/ews4800mips/stand/common/bfs_subr.c diff -u src/sys/arch/ews4800mips/stand/common/bfs_subr.c:1.3 src/sys/arch/ews4800mips/stand/common/bfs_subr.c:1.4 --- src/sys/arch/ews4800mips/stand/common/bfs_subr.c:1.3 Mon Apr 28 16:23:18 2008 +++ src/sys/arch/ews4800mips/stand/common/bfs_subr.c Tue Jan 8 12:14:14 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: bfs_subr.c,v 1.3 2008/04/28 20:23:18 martin Exp $ */ +/* $NetBSD: bfs_subr.c,v 1.4 2019/01/08 17:14:14 christos Exp $ */ /*- * Copyright (c) 2004 The NetBSD Foundation, Inc. @@ -31,13 +31,14 @@ #include -__KERNEL_RCSID(0, "$NetBSD: bfs_subr.c,v 1.3 2008/04/28 20:23:18 martin Exp $"); +__KERNEL_RCSID(0, "$NetBSD: bfs_subr.c,v 1.4 2019/01/08 17:14:14 christos Exp $"); #ifdef _STANDALONE #include #include #include "local.h" #endif +#include #include #include #include
CVS commit: src/sys/arch/ews4800mips/stand/common
Module Name:src Committed By: christos Date: Tue Jan 8 19:14:51 UTC 2019 Modified Files: src/sys/arch/ews4800mips/stand/common: bfs_subr.c Log Message: no need for To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 src/sys/arch/ews4800mips/stand/common/bfs_subr.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/ews4800mips/stand/common/bfs_subr.c diff -u src/sys/arch/ews4800mips/stand/common/bfs_subr.c:1.4 src/sys/arch/ews4800mips/stand/common/bfs_subr.c:1.5 --- src/sys/arch/ews4800mips/stand/common/bfs_subr.c:1.4 Tue Jan 8 12:14:14 2019 +++ src/sys/arch/ews4800mips/stand/common/bfs_subr.c Tue Jan 8 14:14:51 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: bfs_subr.c,v 1.4 2019/01/08 17:14:14 christos Exp $ */ +/* $NetBSD: bfs_subr.c,v 1.5 2019/01/08 19:14:51 christos Exp $ */ /*- * Copyright (c) 2004 The NetBSD Foundation, Inc. @@ -31,7 +31,7 @@ #include -__KERNEL_RCSID(0, "$NetBSD: bfs_subr.c,v 1.4 2019/01/08 17:14:14 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: bfs_subr.c,v 1.5 2019/01/08 19:14:51 christos Exp $"); #ifdef _STANDALONE #include #include @@ -42,7 +42,6 @@ __KERNEL_RCSID(0, "$NetBSD: bfs_subr.c,v #include #include #include -#include #include #include
CVS commit: src/sys/arch/ews4800mips/stand/common
Module Name:src Committed By: christos Date: Wed Jan 9 03:28:31 UTC 2019 Modified Files: src/sys/arch/ews4800mips/stand/common: bootfs.c disk.c mem.c prompt.c ustarfs.c Log Message: use instead of for everything. To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 src/sys/arch/ews4800mips/stand/common/bootfs.c \ src/sys/arch/ews4800mips/stand/common/prompt.c cvs rdiff -u -r1.8 -r1.9 src/sys/arch/ews4800mips/stand/common/disk.c \ src/sys/arch/ews4800mips/stand/common/ustarfs.c cvs rdiff -u -r1.5 -r1.6 src/sys/arch/ews4800mips/stand/common/mem.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/ews4800mips/stand/common/bootfs.c diff -u src/sys/arch/ews4800mips/stand/common/bootfs.c:1.4 src/sys/arch/ews4800mips/stand/common/bootfs.c:1.5 --- src/sys/arch/ews4800mips/stand/common/bootfs.c:1.4 Mon Apr 28 16:23:18 2008 +++ src/sys/arch/ews4800mips/stand/common/bootfs.c Tue Jan 8 22:28:31 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: bootfs.c,v 1.4 2008/04/28 20:23:18 martin Exp $ */ +/* $NetBSD: bootfs.c,v 1.5 2019/01/09 03:28:31 christos Exp $ */ /*- * Copyright (c) 2004 The NetBSD Foundation, Inc. @@ -32,7 +32,7 @@ #include #include -#include +#include #include #include Index: src/sys/arch/ews4800mips/stand/common/prompt.c diff -u src/sys/arch/ews4800mips/stand/common/prompt.c:1.4 src/sys/arch/ews4800mips/stand/common/prompt.c:1.5 --- src/sys/arch/ews4800mips/stand/common/prompt.c:1.4 Mon Apr 28 16:23:19 2008 +++ src/sys/arch/ews4800mips/stand/common/prompt.c Tue Jan 8 22:28:31 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: prompt.c,v 1.4 2008/04/28 20:23:19 martin Exp $ */ +/* $NetBSD: prompt.c,v 1.5 2019/01/09 03:28:31 christos Exp $ */ /*- * Copyright (c) 2004 The NetBSD Foundation, Inc. @@ -32,7 +32,7 @@ #include #include -#include +#include #include #include "cmd.h" Index: src/sys/arch/ews4800mips/stand/common/disk.c diff -u src/sys/arch/ews4800mips/stand/common/disk.c:1.8 src/sys/arch/ews4800mips/stand/common/disk.c:1.9 --- src/sys/arch/ews4800mips/stand/common/disk.c:1.8 Wed Mar 26 13:56:18 2014 +++ src/sys/arch/ews4800mips/stand/common/disk.c Tue Jan 8 22:28:31 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: disk.c,v 1.8 2014/03/26 17:56:18 christos Exp $ */ +/* $NetBSD: disk.c,v 1.9 2019/01/09 03:28:31 christos Exp $ */ /*- * Copyright (c) 2004, 2005 The NetBSD Foundation, Inc. @@ -32,7 +32,7 @@ #include #include -#include +#include #include #include Index: src/sys/arch/ews4800mips/stand/common/ustarfs.c diff -u src/sys/arch/ews4800mips/stand/common/ustarfs.c:1.8 src/sys/arch/ews4800mips/stand/common/ustarfs.c:1.9 --- src/sys/arch/ews4800mips/stand/common/ustarfs.c:1.8 Wed Feb 4 10:22:13 2009 +++ src/sys/arch/ews4800mips/stand/common/ustarfs.c Tue Jan 8 22:28:31 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: ustarfs.c,v 1.8 2009/02/04 15:22:13 tsutsui Exp $ */ +/* $NetBSD: ustarfs.c,v 1.9 2019/01/09 03:28:31 christos Exp $ */ /*- * Copyright (c) 2004 The NetBSD Foundation, Inc. @@ -32,7 +32,7 @@ #include #include -#include +#include #include #include Index: src/sys/arch/ews4800mips/stand/common/mem.c diff -u src/sys/arch/ews4800mips/stand/common/mem.c:1.5 src/sys/arch/ews4800mips/stand/common/mem.c:1.6 --- src/sys/arch/ews4800mips/stand/common/mem.c:1.5 Mon Apr 28 16:23:19 2008 +++ src/sys/arch/ews4800mips/stand/common/mem.c Tue Jan 8 22:28:31 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: mem.c,v 1.5 2008/04/28 20:23:19 martin Exp $ */ +/* $NetBSD: mem.c,v 1.6 2019/01/09 03:28:31 christos Exp $ */ /*- * Copyright (c) 2004 The NetBSD Foundation, Inc. @@ -33,7 +33,7 @@ #include #include -#include +#include #include #include "local.h"
CVS commit: src/sys/arch/ews4800mips/stand/common
Module Name:src Committed By: tsutsui Date: Sun Jan 13 14:24:24 UTC 2013 Modified Files: src/sys/arch/ews4800mips/stand/common: lance.c Log Message: Fix tyop. (How these ones slipped in!?) To generate a diff of this commit: cvs rdiff -u -r1.5 -r1.6 src/sys/arch/ews4800mips/stand/common/lance.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/ews4800mips/stand/common/lance.c diff -u src/sys/arch/ews4800mips/stand/common/lance.c:1.5 src/sys/arch/ews4800mips/stand/common/lance.c:1.6 --- src/sys/arch/ews4800mips/stand/common/lance.c:1.5 Mon Apr 28 20:23:18 2008 +++ src/sys/arch/ews4800mips/stand/common/lance.c Sun Jan 13 14:24:24 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: lance.c,v 1.5 2008/04/28 20:23:18 martin Exp $ */ +/* $NetBSD: lance.c,v 1.6 2013/01/13 14:24:24 tsutsui Exp $ */ /*- * Copyright (c) 2004 The NetBSD Foundation, Inc. @@ -64,7 +64,7 @@ bool lance_put(void *, size_t); void lance_setup(void); bool lance_set_initblock(struct leinit *); -bool lacne_do_initialize(void); +bool lance_do_initialize(void); bool lance_test(void); bool lance_internal_loopback_test(bool); @@ -83,7 +83,7 @@ lance_init(void) if (!lance_set_initblock(&lance_mem.leinit)) return false; - if (!lacne_do_initialize()) + if (!lance_do_initialize()) return false; *LANCE_RDP = LE_C0_STRT; @@ -280,7 +280,7 @@ lance_set_initblock(struct leinit *leini } bool -lacne_do_initialize(void) +lance_do_initialize(void) { /* Initialze LANCE */ @@ -380,7 +380,7 @@ lance_internal_loopback_test(bool crc) if (!lance_set_initblock(&lance_mem.leinit)) return false; - if (!lacne_do_initialize()) + if (!lance_do_initialize()) return false; /* Transmit Start */
CVS commit: src/sys/arch/ews4800mips/stand/common
Module Name:src Committed By: christos Date: Fri Nov 21 00:53:19 UTC 2014 Modified Files: src/sys/arch/ews4800mips/stand/common: ether_if.c Log Message: need clock_subr.h for bcdtobin() To generate a diff of this commit: cvs rdiff -u -r1.5 -r1.6 src/sys/arch/ews4800mips/stand/common/ether_if.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/ews4800mips/stand/common/ether_if.c diff -u src/sys/arch/ews4800mips/stand/common/ether_if.c:1.5 src/sys/arch/ews4800mips/stand/common/ether_if.c:1.6 --- src/sys/arch/ews4800mips/stand/common/ether_if.c:1.5 Mon Jan 12 06:32:43 2009 +++ src/sys/arch/ews4800mips/stand/common/ether_if.c Thu Nov 20 19:53:19 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: ether_if.c,v 1.5 2009/01/12 11:32:43 tsutsui Exp $ */ +/* $NetBSD: ether_if.c,v 1.6 2014/11/21 00:53:19 christos Exp $ */ /*- * Copyright (c) 2004 The NetBSD Foundation, Inc. @@ -42,6 +42,8 @@ #include #include +#include + #include #define _SBD_TR2A_PRIVATE #include /* getsecs. */
CVS commit: src/sys/arch/ews4800mips/stand/common
Module Name:src Committed By: christos Date: Wed Jan 22 16:27:01 UTC 2014 Modified Files: src/sys/arch/ews4800mips/stand/common: fileread_bfs.c Log Message: remove unused var To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/sys/arch/ews4800mips/stand/common/fileread_bfs.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/ews4800mips/stand/common/fileread_bfs.c diff -u src/sys/arch/ews4800mips/stand/common/fileread_bfs.c:1.2 src/sys/arch/ews4800mips/stand/common/fileread_bfs.c:1.3 --- src/sys/arch/ews4800mips/stand/common/fileread_bfs.c:1.2 Mon Apr 28 16:23:18 2008 +++ src/sys/arch/ews4800mips/stand/common/fileread_bfs.c Wed Jan 22 11:27:01 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: fileread_bfs.c,v 1.2 2008/04/28 20:23:18 martin Exp $ */ +/* $NetBSD: fileread_bfs.c,v 1.3 2014/01/22 16:27:01 christos Exp $ */ /*- * Copyright (c) 2004, 2005 The NetBSD Foundation, Inc. @@ -49,11 +49,10 @@ fileread(const char *fname, size_t *size struct ux_partition *partition = vtoc->partition; struct bfs_inode *inode = (void *)SDBOOT_INODEADDR; struct bfs_dirent *dirent = (void *)SDBOOT_DIRENTADDR; - int i, n, err, block_size, bfs_sector; + int i, n, err, bfs_sector; if (pdinfo->magic != PDINFO_MAGIC) return BERR_PDINFO; - block_size = pdinfo->geometory.bytes_per_sector; #if 0 {