Module Name: src
Committed By: matt
Date: Fri Aug 21 17:52:16 UTC 2009
Modified Files:
src/sys/arch/evbmips/include [matt-nb5-mips64]: elf_machdep.h param.h
yamon.h
src/sys/arch/evbmips/malta [matt-nb5-mips64]: machdep.c
Added Files:
src/sys/arch/evbmips/conf [matt-nb5-mips64]: MALTA32 MALTA64
Log Message:
Make MALTA LP64 capable.
To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1.2.1 src/sys/arch/evbmips/conf/MALTA32 \
src/sys/arch/evbmips/conf/MALTA64
cvs rdiff -u -r1.2 -r1.2.74.1 src/sys/arch/evbmips/include/elf_machdep.h
cvs rdiff -u -r1.5 -r1.5.96.1 src/sys/arch/evbmips/include/param.h
cvs rdiff -u -r1.6 -r1.6.80.1 src/sys/arch/evbmips/include/yamon.h
cvs rdiff -u -r1.28 -r1.28.10.1 src/sys/arch/evbmips/malta/machdep.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/evbmips/include/elf_machdep.h
diff -u src/sys/arch/evbmips/include/elf_machdep.h:1.2 src/sys/arch/evbmips/include/elf_machdep.h:1.2.74.1
--- src/sys/arch/evbmips/include/elf_machdep.h:1.2 Sat Nov 25 07:32:53 2006
+++ src/sys/arch/evbmips/include/elf_machdep.h Fri Aug 21 17:52:16 2009
@@ -1,11 +1,13 @@
-/* $NetBSD: elf_machdep.h,v 1.2 2006/11/25 07:32:53 riz Exp $ */
+/* $NetBSD: elf_machdep.h,v 1.2.74.1 2009/08/21 17:52:16 matt Exp $ */
#include <mips/elf_machdep.h>
#if defined(__MIPSEB__)
#define ELF32_MACHDEP_ENDIANNESS ELFDATA2MSB
+#define ELF64_MACHDEP_ENDIANNESS ELFDATA2MSB
#elif defined(__MIPSEL__)
#define ELF32_MACHDEP_ENDIANNESS ELFDATA2LSB
+#define ELF64_MACHDEP_ENDIANNESS ELFDATA2LSB
#elif !defined(HAVE_NBTOOL_CONFIG_H)
#error neither __MIPSEL__ nor __MIPSEB__ are defined.
#endif
Index: src/sys/arch/evbmips/include/param.h
diff -u src/sys/arch/evbmips/include/param.h:1.5 src/sys/arch/evbmips/include/param.h:1.5.96.1
--- src/sys/arch/evbmips/include/param.h:1.5 Sun Dec 11 12:17:11 2005
+++ src/sys/arch/evbmips/include/param.h Fri Aug 21 17:52:16 2009
@@ -1,4 +1,4 @@
-/* $NetBSD: param.h,v 1.5 2005/12/11 12:17:11 christos Exp $ */
+/* $NetBSD: param.h,v 1.5.96.1 2009/08/21 17:52:16 matt Exp $ */
/*
* Copyright (c) 1992, 1993
@@ -82,11 +82,21 @@
*/
#if defined(__MIPSEB__)
-#define _MACHINE_ARCH mipseb
-#define MACHINE_ARCH "mipseb"
+# if defined(__mips_n32) || defined(__mips_n64)
+# define _MACHINE_ARCH mips64eb
+# define MACHINE_ARCH "mips64eb"
+# else
+# define _MACHINE_ARCH mipseb
+# define MACHINE_ARCH "mipseb"
+# endif
#elif defined(__MIPSEL__)
-#define _MACHINE_ARCH mipsel
-#define MACHINE_ARCH "mipsel"
+# if defined(__mips_n32) || defined(__mips_n64)
+# define _MACHINE_ARCH mips64el
+# define MACHINE_ARCH "mips64el"
+# else
+# define _MACHINE_ARCH mipsel
+# define MACHINE_ARCH "mipsel"
+#endif
#else
#error neither __MIPSEL__ nor __MIPSEB__ are defined.
#endif
@@ -100,33 +110,6 @@
#define BLKDEV_IOSIZE 2048
#define MAXPHYS (64 * 1024) /* max raw I/O transfer size */
-/*
- * Constants related to network buffer management.
- * MCLBYTES must be no larger than NBPG (the software page size), and,
- * on machines that exchange pages of input or output buffers with mbuf
- * clusters (MAPPED_MBUFS), MCLBYTES must also be an integral multiple
- * of the hardware page size.
- */
-#define MSIZE 256 /* size of an mbuf */
-
-#ifndef MCLSHIFT
-# define MCLSHIFT 11 /* convert bytes to m_buf clusters */
-#endif /* MCLSHIFT */
-
-#define MCLBYTES (1 << MCLSHIFT) /* size of a m_buf cluster */
-
-#ifndef NMBCLUSTERS
-#if defined(_KERNEL_OPT)
-#include "opt_gateway.h"
-#endif
-
-#ifdef GATEWAY
-#define NMBCLUSTERS 2048 /* map size, max cluster allocation */
-#else
-#define NMBCLUSTERS 1024 /* map size, max cluster allocation */
-#endif
-#endif
-
#ifdef _KERNEL
#ifndef _LOCORE
Index: src/sys/arch/evbmips/include/yamon.h
diff -u src/sys/arch/evbmips/include/yamon.h:1.6 src/sys/arch/evbmips/include/yamon.h:1.6.80.1
--- src/sys/arch/evbmips/include/yamon.h:1.6 Thu Jul 13 21:06:18 2006
+++ src/sys/arch/evbmips/include/yamon.h Fri Aug 21 17:52:16 2009
@@ -1,4 +1,4 @@
-/* $NetBSD: yamon.h,v 1.6 2006/07/13 21:06:18 gdamore Exp $ */
+/* $NetBSD: yamon.h,v 1.6.80.1 2009/08/21 17:52:16 matt Exp $ */
/*
* Copyright 2002 Wasabi Systems, Inc.
@@ -55,7 +55,7 @@
#define YAMON_GETCHAR_OFS (YAMON_FUNCTION_BASE + 0x50)
#define YAMON_SYSCON_READ_OFS (YAMON_FUNCTION_BASE + 0x54)
-#define YAMON_FUNC(ofs) (*(uint32_t *)(MIPS_PHYS_TO_KSEG0(ofs)))
+#define YAMON_FUNC(ofs) ((intptr_t)*(int32_t *)(MIPS_PHYS_TO_KSEG0(ofs)))
typedef void (*t_yamon_print_count)(uint32_t port, char *s, uint32_t count);
#define YAMON_PRINT_COUNT(s, count) \
Index: src/sys/arch/evbmips/malta/machdep.c
diff -u src/sys/arch/evbmips/malta/machdep.c:1.28 src/sys/arch/evbmips/malta/machdep.c:1.28.10.1
--- src/sys/arch/evbmips/malta/machdep.c:1.28 Wed Jul 2 17:28:55 2008
+++ src/sys/arch/evbmips/malta/machdep.c Fri Aug 21 17:52:16 2009
@@ -1,4 +1,4 @@
-/* $NetBSD: machdep.c,v 1.28 2008/07/02 17:28:55 ad Exp $ */
+/* $NetBSD: machdep.c,v 1.28.10.1 2009/08/21 17:52:16 matt Exp $ */
/*
* Copyright 2001, 2002 Wasabi Systems, Inc.
@@ -112,7 +112,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.28 2008/07/02 17:28:55 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.28.10.1 2009/08/21 17:52:16 matt Exp $");
#include "opt_ddb.h"
#include "opt_execfmt.h"
@@ -201,12 +201,13 @@
bus_space_handle_t sh;
void *kernend, *v;
u_long first, last;
- char *cp;
- int freqok, i, howto;
+ int freqok;
uint8_t *brkres = (uint8_t *)MIPS_PHYS_TO_KSEG1(MALTA_BRKRES);
extern char edata[], end[];
+ CTASSERT((intptr_t)MIPS_PHYS_TO_KSEG1(MALTA_BRKRES) < 0);
+
*brkres = 0; /* Disable BREAK==reset on console */
/* Get the propaganda in early! */
@@ -286,8 +287,10 @@
* Look at arguments passed to us and compute boothowto.
*/
boothowto = RB_AUTOBOOT;
- for (i = 1; i < argc; i++) {
- for (cp = argv[i]; *cp; cp++) {
+#ifndef _LP64
+ for (int i = 1; i < argc; i++) {
+ for (char *cp = argv[i]; *cp; cp++) {
+ int howto;
/* Ignore superfluous '-', if there is one */
if (*cp == '-')
continue;
@@ -300,6 +303,7 @@
boothowto |= howto;
}
}
+#endif
/*
* Load the rest of the available pages into the VM system.
Added files:
Index: src/sys/arch/evbmips/conf/MALTA32
diff -u /dev/null src/sys/arch/evbmips/conf/MALTA32:1.1.2.1
--- /dev/null Fri Aug 21 17:52:16 2009
+++ src/sys/arch/evbmips/conf/MALTA32 Fri Aug 21 17:52:16 2009
@@ -0,0 +1,9 @@
+# $NetBSD: MALTA32,v 1.1.2.1 2009/08/21 17:52:16 matt Exp $
+#
+include "arch/evbmips/conf/MALTA"
+
+makeoptions LP64="no"
+
+no options MIPS32
+#options EXEC_ELF64
+
Index: src/sys/arch/evbmips/conf/MALTA64
diff -u /dev/null src/sys/arch/evbmips/conf/MALTA64:1.1.2.1
--- /dev/null Fri Aug 21 17:52:16 2009
+++ src/sys/arch/evbmips/conf/MALTA64 Fri Aug 21 17:52:16 2009
@@ -0,0 +1,9 @@
+# $NetBSD: MALTA64,v 1.1.2.1 2009/08/21 17:52:16 matt Exp $
+#
+include "arch/evbmips/conf/MALTA"
+
+makeoptions LP64="yes"
+
+no options MIPS32
+options EXEC_ELF64
+