Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/usermode build fixes for netbsd-5 and i386
details: https://anonhg.NetBSD.org/src/rev/0f8edab47b15
branches: trunk
changeset: 768610:0f8edab47b15
user: jmcneill <jmcneill%NetBSD.org@localhost>
date: Mon Aug 22 21:45:38 2011 +0000
description:
build fixes for netbsd-5 and i386
diffstat:
sys/arch/usermode/conf/Makefile.usermode | 6 ++--
sys/arch/usermode/include/ansi.h | 27 +++++++++++++++++++-
sys/arch/usermode/include/vmparam.h | 41 +++++++++++++++++++++++--------
sys/arch/usermode/usermode/pmap.c | 8 +++---
sys/arch/usermode/usermode/thunk.c | 11 ++++++--
5 files changed, 70 insertions(+), 23 deletions(-)
diffs (200 lines):
diff -r 5e3909959130 -r 0f8edab47b15 sys/arch/usermode/conf/Makefile.usermode
--- a/sys/arch/usermode/conf/Makefile.usermode Mon Aug 22 20:48:38 2011 +0000
+++ b/sys/arch/usermode/conf/Makefile.usermode Mon Aug 22 21:45:38 2011 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile.usermode,v 1.12 2011/08/22 15:27:32 reinoud Exp $
+# $NetBSD: Makefile.usermode,v 1.13 2011/08/22 21:45:38 jmcneill Exp $
MACHINE_ARCH= usermode
USETOOLS?= no
@@ -20,7 +20,7 @@
CPPFLAGS+= -Dusermode
CPPFLAGS.init_main.c+= -Dmain=kernmain
-CPPFLAGS.thunk.c+= -U_KERNEL -I/usr/include
+CPPFLAGS.thunk.c+= -U_KERNEL -I/usr/include
##
## (3) libkern and compat
@@ -55,7 +55,7 @@
.endif
thunk.o: ${USERMODE}/usermode/thunk.c
- ${CC} ${COPTS} -I${.CURDIR} -c -o $@ ${USERMODE}/usermode/thunk.c
+ ${CC} ${CPPFLAGS.thunk.c} -c -o $@ ${USERMODE}/usermode/thunk.c
##
## (7) misc settings
diff -r 5e3909959130 -r 0f8edab47b15 sys/arch/usermode/include/ansi.h
--- a/sys/arch/usermode/include/ansi.h Mon Aug 22 20:48:38 2011 +0000
+++ b/sys/arch/usermode/include/ansi.h Mon Aug 22 21:45:38 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ansi.h,v 1.2 2009/10/21 16:06:59 snj Exp $ */
+/* $NetBSD: ansi.h,v 1.3 2011/08/22 21:45:38 jmcneill Exp $ */
/*-
* Copyright (c) 2007 Jared D. McNeill <jmcneill%invisible.ca@localhost>
@@ -29,6 +29,29 @@
#ifndef _ARCH_USERMODE_INCLUDE_ANSI_H
#define _ARCH_USERMODE_INCLUDE_ANSI_H
-#include </usr/include/machine/ansi.h>
+#include <sys/cdefs.h>
+#include <machine/int_types.h>
+
+#define _BSD_TIME_T_ __int64_t
+#define _BSD_CLOCKID_T_ int
+#define _BSD_TIMER_T_ int
+#define _BSD_SUSECONDS_T_ int
+#define _BSD_USECONDS_T_ unsigned int
+#define _BSD_WCHAR_T_ int
+#define _BSD_WINT_T_ int
+
+#if defined(__i386__)
+#define _BSD_CLOCK_T_ unsigned long
+#define _BSD_PTRDIFF_T_ int
+#define _BSD_SIZE_T_ unsigned int
+#define _BSD_SSIZE_T_ int
+#elif defined(__x86_64__)
+#define _BSD_CLOCK_T_ unsigned int
+#define _BSD_PTRDIFF_T_ long
+#define _BSD_SIZE_T_ unsigned long
+#define _BSD_SSIZE_T_ long
+#else
+#error "platform not supported"
+#endif
#endif /* !_ARCH_USERMODE_INCLUDE_ANSI_H */
diff -r 5e3909959130 -r 0f8edab47b15 sys/arch/usermode/include/vmparam.h
--- a/sys/arch/usermode/include/vmparam.h Mon Aug 22 20:48:38 2011 +0000
+++ b/sys/arch/usermode/include/vmparam.h Mon Aug 22 21:45:38 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: vmparam.h,v 1.4 2011/08/22 15:36:23 reinoud Exp $ */
+/* $NetBSD: vmparam.h,v 1.5 2011/08/22 21:45:38 jmcneill Exp $ */
/*-
* Copyright (c) 2007 Jared D. McNeill <jmcneill%invisible.ca@localhost>
@@ -29,7 +29,6 @@
#ifndef _ARCH_USERMODE_INCLUDE_VMPARAM_H
#define _ARCH_USERMODE_INCLUDE_VMPARAM_H
-#include </usr/include/machine/vmparam.h>
#include <machine/pmap.h>
#include "opt_memsize.h"
@@ -38,19 +37,39 @@
extern paddr_t kmem_ext_start, kmem_ext_end;
extern paddr_t kmem_user_start, kmem_user_end;
-#undef VM_MIN_KERNEL_ADDRESS
#define VM_MIN_KERNEL_ADDRESS kmem_k_start
-
-#undef VM_MAX_KERNEL_ADDRESS
#define VM_MAX_KERNEL_ADDRESS kmem_ext_end
-
-#undef VM_MIN_ADDRESS
#define VM_MIN_ADDRESS kmem_k_start
-
-#undef VM_MAX_ADDRESS
#define VM_MAX_ADDRESS kmem_user_end
-
-#undef VM_MAXUSER_ADDRESS
#define VM_MAXUSER_ADDRESS kmem_user_end
+#define VM_PHYSSEG_STRAT VM_PSTRAT_BIGFIRST
+#define VM_PHYSSEG_MAX 1
+#define VM_NFREELIST 1
+#define VM_FREELIST_DEFAULT 0
+
+#define USRSTACK VM_MAXUSER_ADDRESS
+
+#if defined(__i386__)
+#define PAGE_SHIFT 12
+#define PAGE_SIZE (1 << PAGE_SHIFT)
+#define PAGE_MASK (PAGE_SIZE - 1)
+#define MAXSSIZ (64 * 1024 * 1024)
+#define MAXTSIZ (64 * 1024 * 1024)
+#define MAXDSIZ (3U * 1024 * 1024 * 1024)
+#define DFLSSIZ (2 * 1024 * 1024)
+#define DFLDSIZ (256 * 1024 * 1024)
+#elif defined(__x86_64__)
+#define PAGE_SHIFT 12
+#define PAGE_SIZE (1 << PAGE_SHIFT)
+#define PAGE_MASK (PAGE_SIZE - 1)
+#define MAXSSIZ (128 * 1024 * 1024)
+#define MAXTSIZ (64 * 1024 * 1024)
+#define MAXDSIZ (8L * 1024 * 1024 * 1024)
+#define DFLSSIZ (4 * 1024 * 1024)
+#define DFLDSIZ (256 * 1024 * 1024)
+#else
+#error "platform not supported"
+#endif
+
#endif /* !_ARCH_USERMODE_INCLUDE_VMPARAM_H */
diff -r 5e3909959130 -r 0f8edab47b15 sys/arch/usermode/usermode/pmap.c
--- a/sys/arch/usermode/usermode/pmap.c Mon Aug 22 20:48:38 2011 +0000
+++ b/sys/arch/usermode/usermode/pmap.c Mon Aug 22 21:45:38 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: pmap.c,v 1.10 2011/08/22 16:22:16 reinoud Exp $ */
+/* $NetBSD: pmap.c,v 1.11 2011/08/22 21:45:38 jmcneill Exp $ */
/*-
* Copyright (c) 2011 Reinoud Zandijk <reinoud%NetBSD.org@localhost>
@@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.10 2011/08/22 16:22:16 reinoud Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.11 2011/08/22 21:45:38 jmcneill Exp $");
#include "opt_uvmhist.h"
#include "opt_memsize.h"
@@ -272,9 +272,9 @@
aprint_debug("leaving pmap_bootstrap:\n");
aprint_debug("\t%"PRIu64" MB of physical pages left\n",
- (free_end - (free_start + fpos))/1024/1024);
+ (uint64_t)(free_end - (free_start + fpos))/1024/1024);
aprint_debug("\t%"PRIu64" MB of kmem left\n",
- (kmem_ext_end - kmem_ext_cur_end)/1024/1024);
+ (uint64_t)(kmem_ext_end - kmem_ext_cur_end)/1024/1024);
}
void
diff -r 5e3909959130 -r 0f8edab47b15 sys/arch/usermode/usermode/thunk.c
--- a/sys/arch/usermode/usermode/thunk.c Mon Aug 22 20:48:38 2011 +0000
+++ b/sys/arch/usermode/usermode/thunk.c Mon Aug 22 21:45:38 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: thunk.c,v 1.9 2011/08/22 15:30:16 reinoud Exp $ */
+/* $NetBSD: thunk.c,v 1.10 2011/08/22 21:45:38 jmcneill Exp $ */
/*-
* Copyright (c) 2011 Jared D. McNeill <jmcneill%invisible.ca@localhost>
@@ -27,13 +27,16 @@
*/
#include <sys/cdefs.h>
-__RCSID("$NetBSD: thunk.c,v 1.9 2011/08/22 15:30:16 reinoud Exp $");
+__RCSID("$NetBSD: thunk.c,v 1.10 2011/08/22 21:45:38 jmcneill Exp $");
-#include <machine/thunk.h>
+#include <sys/types.h>
+#include <sys/ansi.h>
+#include <aio.h>
#include <assert.h>
#include <fcntl.h>
#include <stdarg.h>
+#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <signal.h>
@@ -41,6 +44,8 @@
#include <ucontext.h>
#include <unistd.h>
+#include "../include/thunk.h"
+
int
thunk_setitimer(int which, const struct itimerval *value,
struct itimerval *ovalue)
Home |
Main Index |
Thread Index |
Old Index