Module Name:    src
Committed By:   matt
Date:           Thu Sep 10 01:51:32 UTC 2009

Modified Files:
        src/sys/arch/sgimips/conf [matt-nb5-mips64]: GENERIC32_IP3x
        src/sys/arch/sgimips/dev [matt-nb5-mips64]: int.c
        src/sys/arch/sgimips/hpc [matt-nb5-mips64]: hpcdma.c if_sq.c wdsc.c
        src/sys/arch/sgimips/include [matt-nb5-mips64]: loadfile_machdep.h
        src/sys/arch/sgimips/mace [matt-nb5-mips64]: if_mec.c mace.c
        src/sys/arch/sgimips/sgimips [matt-nb5-mips64]: bus.c machdep.c
        src/sys/arch/sgimips/stand [matt-nb5-mips64]: Makefile.booters
        src/sys/arch/sgimips/stand/boot [matt-nb5-mips64]: Makefile
Added Files:
        src/sys/arch/sgimips/conf [matt-nb5-mips64]: GENERIC64_IP2x
            GENERIC64_IP3x INSTALL64_IP2x INSTALL64_IP3x std.sgimips64

Log Message:
Add preliminary LP64 support for sgimips


To generate a diff of this commit:
cvs rdiff -u -r1.76.4.1 -r1.76.4.1.4.1 \
    src/sys/arch/sgimips/conf/GENERIC32_IP3x
cvs rdiff -u -r0 -r1.1.2.1 src/sys/arch/sgimips/conf/GENERIC64_IP2x \
    src/sys/arch/sgimips/conf/GENERIC64_IP3x \
    src/sys/arch/sgimips/conf/INSTALL64_IP2x \
    src/sys/arch/sgimips/conf/INSTALL64_IP3x \
    src/sys/arch/sgimips/conf/std.sgimips64
cvs rdiff -u -r1.19 -r1.19.12.1 src/sys/arch/sgimips/dev/int.c
cvs rdiff -u -r1.16 -r1.16.16.1 src/sys/arch/sgimips/hpc/hpcdma.c
cvs rdiff -u -r1.33 -r1.33.62.1 src/sys/arch/sgimips/hpc/if_sq.c
cvs rdiff -u -r1.25 -r1.25.14.1 src/sys/arch/sgimips/hpc/wdsc.c
cvs rdiff -u -r1.6 -r1.6.18.1 src/sys/arch/sgimips/include/loadfile_machdep.h
cvs rdiff -u -r1.33 -r1.33.12.1 src/sys/arch/sgimips/mace/if_mec.c
cvs rdiff -u -r1.15 -r1.15.12.1 src/sys/arch/sgimips/mace/mace.c
cvs rdiff -u -r1.55 -r1.55.16.1 src/sys/arch/sgimips/sgimips/bus.c
cvs rdiff -u -r1.121.8.1 -r1.121.8.2 src/sys/arch/sgimips/sgimips/machdep.c
cvs rdiff -u -r1.15 -r1.15.22.1 src/sys/arch/sgimips/stand/Makefile.booters
cvs rdiff -u -r1.13 -r1.13.22.1 src/sys/arch/sgimips/stand/boot/Makefile

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/sgimips/conf/GENERIC32_IP3x
diff -u src/sys/arch/sgimips/conf/GENERIC32_IP3x:1.76.4.1 src/sys/arch/sgimips/conf/GENERIC32_IP3x:1.76.4.1.4.1
--- src/sys/arch/sgimips/conf/GENERIC32_IP3x:1.76.4.1	Sat Dec 27 03:50:52 2008
+++ src/sys/arch/sgimips/conf/GENERIC32_IP3x	Thu Sep 10 01:51:31 2009
@@ -1,4 +1,4 @@
-#	$NetBSD: GENERIC32_IP3x,v 1.76.4.1 2008/12/27 03:50:52 snj Exp $
+#	$NetBSD: GENERIC32_IP3x,v 1.76.4.1.4.1 2009/09/10 01:51:31 matt Exp $
 #
 # GENERIC32_IP3x machine description file
 # 
@@ -28,7 +28,7 @@
 
 options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
-#ident		"GENERIC32_IP3x-$Revision: 1.76.4.1 $"
+#ident		"GENERIC32_IP3x-$Revision: 1.76.4.1.4.1 $"
 
 maxusers	32
 
@@ -36,7 +36,7 @@
 options 	MIPS3		# MIPS3 support
 options 	ENABLE_MIPS4_CACHE_R10K # enable R10000 cache ops
 #options 	BLINK		# blinkenlitzen
-makeoptions	CPUFLAGS="-march=mips3 -mabi=32 -mtune=vr5000"
+makeoptions	CPUFLAGS="-march=mips3 -mtune=vr5000"
 
 # Standard system options
 #options 	INSECURE	# disable kernel security levels

Index: src/sys/arch/sgimips/dev/int.c
diff -u src/sys/arch/sgimips/dev/int.c:1.19 src/sys/arch/sgimips/dev/int.c:1.19.12.1
--- src/sys/arch/sgimips/dev/int.c:1.19	Sat Aug 23 17:25:54 2008
+++ src/sys/arch/sgimips/dev/int.c	Thu Sep 10 01:51:31 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: int.c,v 1.19 2008/08/23 17:25:54 tsutsui Exp $	*/
+/*	$NetBSD: int.c,v 1.19.12.1 2009/09/10 01:51:31 matt Exp $	*/
 
 /*
  * Copyright (c) 2004 Christopher SEKIYA
@@ -32,7 +32,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: int.c,v 1.19 2008/08/23 17:25:54 tsutsui Exp $");
+__KERNEL_RCSID(0, "$NetBSD: int.c,v 1.19.12.1 2009/09/10 01:51:31 matt Exp $");
 
 #include "opt_cputype.h"
 
@@ -207,7 +207,7 @@
 	int intnum;
 	uint32_t mstat;
 	uint32_t mmask;
-	int which = (int)arg;
+	int which = (intptr_t)arg;
 	struct sgimips_intrhand *ih;
 
 	ret = 0;

Index: src/sys/arch/sgimips/hpc/hpcdma.c
diff -u src/sys/arch/sgimips/hpc/hpcdma.c:1.16 src/sys/arch/sgimips/hpc/hpcdma.c:1.16.16.1
--- src/sys/arch/sgimips/hpc/hpcdma.c:1.16	Sat May 10 15:31:05 2008
+++ src/sys/arch/sgimips/hpc/hpcdma.c	Thu Sep 10 01:51:32 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: hpcdma.c,v 1.16 2008/05/10 15:31:05 martin Exp $	*/
+/*	$NetBSD: hpcdma.c,v 1.16.16.1 2009/09/10 01:51:32 matt Exp $	*/
 
 /*
  * Copyright (c) 2001 Wayne Knowles
@@ -44,7 +44,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: hpcdma.c,v 1.16 2008/05/10 15:31:05 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: hpcdma.c,v 1.16.16.1 2009/09/10 01:51:32 matt Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -139,13 +139,13 @@
 		if (sc->hpc->revision == 3) {
 			hva->hpc3_hdd_bufptr = segp->ds_addr;
 			hva->hpc3_hdd_ctl    = segp->ds_len;
-			hva->hdd_descptr = (u_int32_t) ++hpa;
+			hva->hdd_descptr = (uintptr_t) ++hpa;
 		} else /* HPC 1/1.5 */ {
 			/* there doesn't seem to be any good way of doing this
 		   	   via an abstraction layer */
 			hva->hpc1_hdd_bufptr = segp->ds_addr;
 			hva->hpc1_hdd_ctl    = segp->ds_len;
-			hva->hdd_descptr = (u_int32_t) ++hpa;
+			hva->hdd_descptr = (uintptr_t) ++hpa;
 		}
 		++hva; ++segp;
 	}
@@ -172,7 +172,7 @@
 
 	/* Load DMA Descriptor list */
 	bus_space_write_4(sc->sc_bst, sc->sc_bsh, sc->hpc->scsi0_ndbp,
-			    (u_int32_t)sc->sc_desc_pa);
+			    (uintptr_t)sc->sc_desc_pa);
 }
 
 void

Index: src/sys/arch/sgimips/hpc/if_sq.c
diff -u src/sys/arch/sgimips/hpc/if_sq.c:1.33 src/sys/arch/sgimips/hpc/if_sq.c:1.33.62.1
--- src/sys/arch/sgimips/hpc/if_sq.c:1.33	Sun Mar  4 06:00:39 2007
+++ src/sys/arch/sgimips/hpc/if_sq.c	Thu Sep 10 01:51:32 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_sq.c,v 1.33 2007/03/04 06:00:39 christos Exp $	*/
+/*	$NetBSD: if_sq.c,v 1.33.62.1 2009/09/10 01:51:32 matt Exp $	*/
 
 /*
  * Copyright (c) 2001 Rafal K. Boni
@@ -33,7 +33,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_sq.c,v 1.33 2007/03/04 06:00:39 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_sq.c,v 1.33.62.1 2009/09/10 01:51:32 matt Exp $");
 
 #include "bpfilter.h"
 
@@ -118,7 +118,7 @@
 static void	sq_txring_hpc3(struct sq_softc *);
 static void	sq_reset(struct sq_softc *);
 static int 	sq_add_rxbuf(struct sq_softc *, int);
-static void 	sq_dump_buffer(u_int32_t addr, u_int32_t len);
+static void 	sq_dump_buffer(paddr_t addr, psize_t len);
 static void	sq_trace_dump(struct sq_softc *);
 
 static void	enaddr_aton(const char*, u_int8_t*);
@@ -151,7 +151,7 @@
 	struct hpc_attach_args *ha = aux;
 
 	if (strcmp(ha->ha_name, cf->cf_name) == 0) {
-		uint32_t reset, txstat;
+		vaddr_t reset, txstat;
 
 		reset = MIPS_PHYS_TO_KSEG1(ha->ha_sh +
 		    ha->ha_dmaoff + ha->hpc_regs->enetr_reset);
@@ -1323,7 +1323,7 @@
 }
 
 void
-sq_dump_buffer(u_int32_t addr, u_int32_t len)
+sq_dump_buffer(paddr_t addr, psize_t len)
 {
 	u_int i;
 	u_char* physaddr = (char*) MIPS_PHYS_TO_KSEG1((void *)addr);

Index: src/sys/arch/sgimips/hpc/wdsc.c
diff -u src/sys/arch/sgimips/hpc/wdsc.c:1.25 src/sys/arch/sgimips/hpc/wdsc.c:1.25.14.1
--- src/sys/arch/sgimips/hpc/wdsc.c:1.25	Sat May 10 15:31:05 2008
+++ src/sys/arch/sgimips/hpc/wdsc.c	Thu Sep 10 01:51:32 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: wdsc.c,v 1.25 2008/05/10 15:31:05 martin Exp $	*/
+/*	$NetBSD: wdsc.c,v 1.25.14.1 2009/09/10 01:51:32 matt Exp $	*/
 
 /*
  * Copyright (c) 2001 Wayne Knowles
@@ -37,7 +37,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: wdsc.c,v 1.25 2008/05/10 15:31:05 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: wdsc.c,v 1.25.14.1 2009/09/10 01:51:32 matt Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -100,7 +100,7 @@
 	struct hpc_attach_args *haa = auxp;
 
 	if (strcmp(haa->ha_name, cf->cf_name) == 0) {
-		uint32_t reset, asr, reg;
+		vaddr_t reset, asr, reg;
 
 		reset = MIPS_PHYS_TO_KSEG1(haa->ha_sh + haa->ha_dmaoff +
 		    haa->hpc_regs->scsi0_ctl);

Index: src/sys/arch/sgimips/include/loadfile_machdep.h
diff -u src/sys/arch/sgimips/include/loadfile_machdep.h:1.6 src/sys/arch/sgimips/include/loadfile_machdep.h:1.6.18.1
--- src/sys/arch/sgimips/include/loadfile_machdep.h:1.6	Mon Apr 28 20:23:34 2008
+++ src/sys/arch/sgimips/include/loadfile_machdep.h	Thu Sep 10 01:51:32 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: loadfile_machdep.h,v 1.6 2008/04/28 20:23:34 martin Exp $	 */
+/*	$NetBSD: loadfile_machdep.h,v 1.6.18.1 2009/09/10 01:51:32 matt Exp $	 */
 
 /*-
  * Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -35,6 +35,7 @@
 #define BOOT_AOUT
 #define BOOT_ECOFF
 #define BOOT_ELF32
+#define BOOT_ELF64
 
 #define LOAD_KERNEL	(LOAD_ALL & ~LOAD_TEXTA)
 #define COUNT_KERNEL	(COUNT_ALL & ~COUNT_TEXTA)

Index: src/sys/arch/sgimips/mace/if_mec.c
diff -u src/sys/arch/sgimips/mace/if_mec.c:1.33 src/sys/arch/sgimips/mace/if_mec.c:1.33.12.1
--- src/sys/arch/sgimips/mace/if_mec.c:1.33	Sat Aug 23 18:44:51 2008
+++ src/sys/arch/sgimips/mace/if_mec.c	Thu Sep 10 01:51:32 2009
@@ -1,4 +1,4 @@
-/* $NetBSD: if_mec.c,v 1.33 2008/08/23 18:44:51 tsutsui Exp $ */
+/* $NetBSD: if_mec.c,v 1.33.12.1 2009/09/10 01:51:32 matt Exp $ */
 
 /*-
  * Copyright (c) 2004, 2008 Izumi Tsutsui.  All rights reserved.
@@ -61,7 +61,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_mec.c,v 1.33 2008/08/23 18:44:51 tsutsui Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_mec.c,v 1.33.12.1 2009/09/10 01:51:32 matt Exp $");
 
 #include "opt_ddb.h"
 #include "bpfilter.h"
@@ -1704,7 +1704,7 @@
 		     MEC_RXSTAT_INVALID   |
 		     MEC_RXSTAT_CRCERROR  |
 		     MEC_RXSTAT_VIOLATION)) {
-			printf("%s: mec_rxintr: status = 0x%016llx\n",
+			printf("%s: mec_rxintr: status = 0x%016"PRIx64"\n",
 			    device_xname(sc->sc_dev), rxstat);
 			goto dropit;
 		}
@@ -1815,7 +1815,7 @@
 		ifp->if_collisions += col;
 
 		if ((txstat & MEC_TXSTAT_SUCCESS) == 0) {
-			printf("%s: TX error: txstat = 0x%016llx\n",
+			printf("%s: TX error: txstat = 0x%016"PRIx64"\n",
 			    device_xname(sc->sc_dev), txstat);
 			ifp->if_oerrors++;
 		} else

Index: src/sys/arch/sgimips/mace/mace.c
diff -u src/sys/arch/sgimips/mace/mace.c:1.15 src/sys/arch/sgimips/mace/mace.c:1.15.12.1
--- src/sys/arch/sgimips/mace/mace.c:1.15	Sat Aug 23 17:43:36 2008
+++ src/sys/arch/sgimips/mace/mace.c	Thu Sep 10 01:51:32 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: mace.c,v 1.15 2008/08/23 17:43:36 tsutsui Exp $	*/
+/*	$NetBSD: mace.c,v 1.15.12.1 2009/09/10 01:51:32 matt Exp $	*/
 
 /*
  * Copyright (c) 2003 Christopher Sekiya
@@ -45,7 +45,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: mace.c,v 1.15 2008/08/23 17:43:36 tsutsui Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mace.c,v 1.15.12.1 2009/09/10 01:51:32 matt Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -146,9 +146,9 @@
 
 	aprint_normal("\n");
 
-	aprint_debug("%s: isa sts %llx\n", self->dv_xname,
+	aprint_debug("%s: isa sts %#"PRIx64"\n", self->dv_xname,
 	    bus_space_read_8(sc->iot, sc->ioh, MACE_ISA_INT_STATUS));
-	aprint_debug("%s: isa msk %llx\n", self->dv_xname,
+	aprint_debug("%s: isa msk %#"PRIx64"\n", self->dv_xname,
 	    bus_space_read_8(sc->iot, sc->ioh, MACE_ISA_INT_MASK));
 
 	/*

Index: src/sys/arch/sgimips/sgimips/bus.c
diff -u src/sys/arch/sgimips/sgimips/bus.c:1.55 src/sys/arch/sgimips/sgimips/bus.c:1.55.16.1
--- src/sys/arch/sgimips/sgimips/bus.c:1.55	Wed Jun  4 12:41:41 2008
+++ src/sys/arch/sgimips/sgimips/bus.c	Thu Sep 10 01:51:32 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: bus.c,v 1.55 2008/06/04 12:41:41 ad Exp $	*/
+/*	$NetBSD: bus.c,v 1.55.16.1 2009/09/10 01:51:32 matt Exp $	*/
 
 /*
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: bus.c,v 1.55 2008/06/04 12:41:41 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bus.c,v 1.55.16.1 2009/09/10 01:51:32 matt Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -1087,6 +1087,16 @@
 
 	high = avail_end - PAGE_SIZE;
 
+#if defined(_MIPS_PADDR_T_64BIT) || defined(_LP64)
+	/*
+	 * Limit dma to low 4GB if HPC
+	 */
+	if (t == (bus_dma_tag_t) SGIMIPS_BUS_SPACE_HPC) {
+		if ((uint32_t) high != (uint64_t) high)
+			high = trunc_page(0xffffffff);
+	}
+#endif
+
 	/*
 	 * Allocate pages from the VM system.
 	 */

Index: src/sys/arch/sgimips/sgimips/machdep.c
diff -u src/sys/arch/sgimips/sgimips/machdep.c:1.121.8.1 src/sys/arch/sgimips/sgimips/machdep.c:1.121.8.2
--- src/sys/arch/sgimips/sgimips/machdep.c:1.121.8.1	Mon Sep  7 23:46:46 2009
+++ src/sys/arch/sgimips/sgimips/machdep.c	Thu Sep 10 01:51:32 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: machdep.c,v 1.121.8.1 2009/09/07 23:46:46 matt Exp $	*/
+/*	$NetBSD: machdep.c,v 1.121.8.2 2009/09/10 01:51:32 matt Exp $	*/
 
 /*
  * Copyright (c) 2000 Soren S. Jorvang
@@ -34,7 +34,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.121.8.1 2009/09/07 23:46:46 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.121.8.2 2009/09/10 01:51:32 matt Exp $");
 
 #include "opt_ddb.h"
 #include "opt_kgdb.h"
@@ -177,7 +177,7 @@
 extern void mips3_clock_intr(u_int32_t, u_int32_t, u_int32_t, u_int32_t);
 #endif
 
-void	mach_init(int, char **, u_int, void *);
+void	mach_init(int, char **, uintptr_t, void *);
 
 void	sgimips_count_cpus(struct arcbios_component *,
 	    struct arcbios_treewalk_context *);
@@ -232,18 +232,14 @@
 static uint8_t bi_buf[BOOTINFO_SIZE];	/* buffer to store bootinfo data */
 static const char *bootinfo_msg = NULL;
 
-#if defined(_LP64)
-#define ARCS_VECTOR 0xa800000000001000
-#else
-#define ARCS_VECTOR (MIPS_PHYS_TO_KSEG0(0x00001000))
-#endif
+#define ARCS_VECTOR MIPS_PHYS_TO_KSEG0(0x00001000)
 
 /*
  * Do all the stuff that locore normally does before calling main().
  * Process arguments passed to us by the ARCS firmware.
  */
 void
-mach_init(int argc, char *argv[], u_int magic, void *bip)
+mach_init(int argc, char *argv[], uintptr_t magic, void *bip)
 {
 	paddr_t first, last;
 	int firstpfn, lastpfn;
@@ -701,7 +697,7 @@
 #endif
 	proc0paddr->u_pcb.pcb_context.val[_L_SR] =
 #ifdef _LP64
-	    MIPS_SR_KZ |
+	    MIPS_SR_KX |
 #endif
 	    MIPS_INT_MASK | MIPS_SR_INT_IE; /* SR */
 }

Index: src/sys/arch/sgimips/stand/Makefile.booters
diff -u src/sys/arch/sgimips/stand/Makefile.booters:1.15 src/sys/arch/sgimips/stand/Makefile.booters:1.15.22.1
--- src/sys/arch/sgimips/stand/Makefile.booters:1.15	Fri Mar 28 16:41:37 2008
+++ src/sys/arch/sgimips/stand/Makefile.booters	Thu Sep 10 01:51:32 2009
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile.booters,v 1.15 2008/03/28 16:41:37 tsutsui Exp $
+# $NetBSD: Makefile.booters,v 1.15.22.1 2009/09/10 01:51:32 matt Exp $
 
 .include <bsd.sys.mk>		# for HOST_SH
 
@@ -20,9 +20,13 @@
 CPPFLAGS+=	-nostdinc -D_STANDALONE -DNO_ABICALLS -I${.OBJDIR} -I${S}
 # compiler flags for smallest code size
 CFLAGS=		-ffreestanding -Os -Wall -Werror -mno-abicalls -msoft-float -G 1024
-CFLAGS+=	-Wall -Werror
-CFLAGS+=	-Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith
-CFLAGS+=	-Wno-pointer-sign
+.if ${MACHINE_ARCH} == "mips64eb"
+CPUFLAGS+=	-mabi=n32
+LDFLAGS+=	-mabi=n32
+.endif
+CWARNFLAGS+=	-Wall -Werror
+CWARNFLAGS+=	-Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith
+CWARNFLAGS+=	-Wno-pointer-sign
 LDBUG=		-T $S/arch/mips/conf/stand.ldscript
 NETBSD_VERS!=	${HOST_SH} ${.CURDIR}/../../../../conf/osrelease.sh
 CPPFLAGS+=	-DNETBSD_VERS='"${NETBSD_VERS}"'

Index: src/sys/arch/sgimips/stand/boot/Makefile
diff -u src/sys/arch/sgimips/stand/boot/Makefile:1.13 src/sys/arch/sgimips/stand/boot/Makefile:1.13.22.1
--- src/sys/arch/sgimips/stand/boot/Makefile:1.13	Sat Feb 23 05:42:51 2008
+++ src/sys/arch/sgimips/stand/boot/Makefile	Thu Sep 10 01:51:32 2009
@@ -1,6 +1,5 @@
-#	$NetBSD: Makefile,v 1.13 2008/02/23 05:42:51 tsutsui Exp $
+#	$NetBSD: Makefile,v 1.13.22.1 2009/09/10 01:51:32 matt Exp $
 
-PROG=	aoutboot
 
 # Don't strip the ECOFF'ed version on install -- strip gets confused by that,
 # and it's already stripped since it's a copy of the stripped ELF one.
@@ -10,27 +9,33 @@
 SRCS=	start.S boot.c bootinfo.c conf.c devopen.c putchar.c getchar.c \
 	getopt.c disk.c
 
+PROG=	aoutboot
 ${PROG}: ip2xboot ip3xboot
+.if ${MACHINE_ARCH} == "mipseb"
 	${OBJCOPY} --impure -O ecoff-bigmips \
-		-R .pdr -R .mdebug.abi32 -R .comment -R .ident \
-		ip2xboot aoutboot
+		-R .pdr -R .mdebug.nabi32 R .mdebug.abi32 \
+		-R .comment -R .ident \
+		ip2xboot ${.TARGET}
+.else
+	touch ${.TARGET}
+.endif
 
 # XXX Temporary hack to install the ELF version, too.
 FILES+=		ip2xboot ip3xboot
 CLEANFILES+=	ip2xboot ip2xboot.elf ip3xboot ip3xboot.elf
 
-CLEANFILES+=	boot.map
+CLEANFILES+=	ip2xboot.map ip3xboot.map
 
 .include "../Makefile.booters"
 
 ip3xboot: ${OBJS} ${LIBS}
-	${LD} -Map boot.map -N -x -Ttext ${LOAD_ADDRESS_IP32} ${LDBUG} \
+	${LD} -Map ${.TARGET}.map -N -x -Ttext ${LOAD_ADDRESS_IP32} ${LDBUG} \
 	    -e start -o ${.TARGET}.elf ${OBJS} ${LIBS}
 	@${STRIP} -s ${.TARGET}.elf -o ${.TARGET}
 	@${SIZE} ${.TARGET}
 
 ip2xboot: ${OBJS} ${LIBS}
-	${LD} -Map boot.map -N -x -Ttext ${LOAD_ADDRESS} ${LDBUG} \
+	${LD} -Map ${.TARGET}.map -N -x -Ttext ${LOAD_ADDRESS} ${LDBUG} \
 	    -e start -o ${.TARGET}.elf ${OBJS} ${LIBS}
 	@${STRIP} -s ${.TARGET}.elf -o ${.TARGET}
 	@${SIZE} ${.TARGET}

Added files:

Index: src/sys/arch/sgimips/conf/GENERIC64_IP2x
diff -u /dev/null src/sys/arch/sgimips/conf/GENERIC64_IP2x:1.1.2.1
--- /dev/null	Thu Sep 10 01:51:33 2009
+++ src/sys/arch/sgimips/conf/GENERIC64_IP2x	Thu Sep 10 01:51:31 2009
@@ -0,0 +1,51 @@
+#	$NetBSD: GENERIC64_IP2x,v 1.1.2.1 2009/09/10 01:51:31 matt Exp $
+#
+# GENERIC32_IP2x machine description file
+# 
+# This machine description file is used to generate the default NetBSD
+# kernel.  The generic kernel does not include all options, subsystems
+# and device drivers, but should be useful for most applications.
+#
+# The machine description file can be customised for your specific
+# machine to reduce the kernel size and improve its performance.
+#
+# For further information on compiling NetBSD kernels, see the config(8)
+# man page.
+#
+# For further information on hardware support for this architecture, see
+# the intro(4) man page.  For further information about kernel options
+# for this architecture, see the options(4) man page.  For an explanation
+# of each device driver in this file see the section 4 man page for the
+# device.
+#
+#
+# Currently this config file supports Indigo R4k, Indigo2 and Indy
+# (IP20, IP22 and IP24, respectively).
+#
+
+include		"arch/sgimips/conf/GENERIC32_IP2x"
+include		"arch/sgimips/conf/std.sgimips64"
+
+no makeoptions	TEXTADDR			# entry point
+makeoptions	TEXTADDR=0xffffffff88069000	# entry point
+
+#ident		"GENERIC64-IP2x-$Revision: 1.1.2.1 $"
+
+no makeoptions	WANT_ECOFF
+makeoptions	WANT_ECOFF="no"		# Create an ECOFF kernel in addition
+					# to an ELF kernel -- required for
+					# netbooting Indigo (IP20) and some
+					# Indigo2 (IP22) machines
+
+# Compatibility options
+#options 	COMPAT_15	# NetBSD 1.5
+#options 	COMPAT_16	# NetBSD 1.6
+#options 	COMPAT_20	# NetBSD 2.0
+#options 	COMPAT_30	# NetBSD 3.0
+#options 	COMPAT_40	# NetBSD 4.0 compatibility.
+#options 	TCP_COMPAT_42	# 4.2BSD TCP/IP bug compat. Not recommended.
+
+#options 	COMPAT_IRIX	# binary compatibility with IRIX
+#options 	COMPAT_LINUX	# binary compatibility with Linux
+#options 	COMPAT_ULTRIX	# binary compatibility with Ultrix 
+#options 	COMPAT_BSDPTY	# /dev/[pt]ty?? ptys.
Index: src/sys/arch/sgimips/conf/GENERIC64_IP3x
diff -u /dev/null src/sys/arch/sgimips/conf/GENERIC64_IP3x:1.1.2.1
--- /dev/null	Thu Sep 10 01:51:33 2009
+++ src/sys/arch/sgimips/conf/GENERIC64_IP3x	Thu Sep 10 01:51:31 2009
@@ -0,0 +1,44 @@
+#	$NetBSD: GENERIC64_IP3x,v 1.1.2.1 2009/09/10 01:51:31 matt Exp $
+#
+# GENERIC32_IP3x machine description file
+# 
+# This machine description file is used to generate the default NetBSD
+# kernel.  The generic kernel does not include all options, subsystems
+# and device drivers, but should be useful for most applications.
+#
+# The machine description file can be customised for your specific
+# machine to reduce the kernel size and improve its performance.
+#
+# For further information on compiling NetBSD kernels, see the config(8)
+# man page.
+#
+# For further information on hardware support for this architecture, see
+# the intro(4) man page.  For further information about kernel options
+# for this architecture, see the options(4) man page.  For an explanation
+# of each device driver in this file see the section 4 man page for the
+# device.
+#
+#
+# Currently this config file supports O2 (IP32).
+#
+
+include 	"arch/sgimips/conf/GENERIC32_IP3x"
+include 	"arch/sgimips/conf/std.sgimips64"
+
+no makeoptions	TEXTADDR
+makeoptions	TEXTADDR="0xffffffff80069000"	# entry point
+
+#ident		"GENERIC64_IP3x-$Revision: 1.1.2.1 $"
+
+# Compatibility options
+#options 	COMPAT_15	# NetBSD 1.5
+#options 	COMPAT_16	# NetBSD 1.6
+#options 	COMPAT_20	# NetBSD 2.0
+#options 	COMPAT_30	# NetBSD 3.0
+#options 	COMPAT_40	# NetBSD 4.0 compatibility.
+#options 	TCP_COMPAT_42	# 4.2BSD TCP/IP bug compat. Not recommended.
+
+#options 	COMPAT_IRIX	# binary compatibility with IRIX
+#options 	COMPAT_LINUX	# binary compatibility with Linux
+#options 	COMPAT_ULTRIX	# binary compatibility with Ultrix 
+#options 	COMPAT_BSDPTY	# /dev/[pt]ty?? ptys.
Index: src/sys/arch/sgimips/conf/INSTALL64_IP2x
diff -u /dev/null src/sys/arch/sgimips/conf/INSTALL64_IP2x:1.1.2.1
--- /dev/null	Thu Sep 10 01:51:33 2009
+++ src/sys/arch/sgimips/conf/INSTALL64_IP2x	Thu Sep 10 01:51:31 2009
@@ -0,0 +1,14 @@
+#
+# sgimips install kernel with ramdisk added.
+#
+
+# Pull in standard `install' config
+include 	"arch/sgimips/conf/GENERIC64_IP2x"
+
+makeoptions	COPTS="-Os"
+
+# Enable the hooks used for initializing the root memory-disk.
+options         MEMORY_DISK_HOOKS
+options         MEMORY_DISK_IS_ROOT     # force root on memory disk
+options         MEMORY_DISK_SERVER=0    # no userspace memory disk support
+options		MEMORY_DISK_ROOT_SIZE=6144# size of memory disk, in blocks (3MB)
Index: src/sys/arch/sgimips/conf/INSTALL64_IP3x
diff -u /dev/null src/sys/arch/sgimips/conf/INSTALL64_IP3x:1.1.2.1
--- /dev/null	Thu Sep 10 01:51:33 2009
+++ src/sys/arch/sgimips/conf/INSTALL64_IP3x	Thu Sep 10 01:51:31 2009
@@ -0,0 +1,14 @@
+#
+# sgimips install kernel with ramdisk added.
+#
+
+# Pull in standard `install' config
+include 	"arch/sgimips/conf/GENERIC64_IP3x"
+
+makeoptions	COPTS="-Os"
+
+# Enable the hooks used for initializing the root memory-disk.
+options         MEMORY_DISK_HOOKS
+options         MEMORY_DISK_IS_ROOT     # force root on memory disk
+options         MEMORY_DISK_SERVER=0    # no userspace memory disk support
+options		MEMORY_DISK_ROOT_SIZE=8192# size of memory disk, in blocks (4MB)
Index: src/sys/arch/sgimips/conf/std.sgimips64
diff -u /dev/null src/sys/arch/sgimips/conf/std.sgimips64:1.1.2.1
--- /dev/null	Thu Sep 10 01:51:33 2009
+++ src/sys/arch/sgimips/conf/std.sgimips64	Thu Sep 10 01:51:31 2009
@@ -0,0 +1,8 @@
+#	$NetBSD: std.sgimips64,v 1.1.2.1 2009/09/10 01:51:31 matt Exp $
+
+no makeoptions	MACHINE_ARCH
+makeoptions	MACHINE_ARCH="mips64eb"
+makeoptions	LP64="yes"
+
+no options	EXEC_ELF32
+options 	EXEC_ELF64	# exec ELF64 binaries

Reply via email to