Index: trunk/src/emx/include/386/_inttypes.h
===================================================================
--- trunk/src/emx/include/386/_inttypes.h	(revision 341)
+++ trunk/src/emx/include/386/_inttypes.h	(revision 342)
@@ -36,4 +36,6 @@
  *	From: $NetBSD: int_fmtio.h,v 1.2 2001/04/26 16:25:21 kleink Exp $
  * $FreeBSD: src/sys/i386/include/_inttypes.h,v 1.2 2002/06/30 05:48:02 mike Exp $
+ *
+ * @@level      FreeBSD 5.1
  */
 
Index: trunk/src/emx/include/386/_stdint.h
===================================================================
--- trunk/src/emx/include/386/_stdint.h	(revision 341)
+++ trunk/src/emx/include/386/_stdint.h	(revision 342)
@@ -36,4 +36,6 @@
  *
  * $FreeBSD: src/sys/i386/include/_stdint.h,v 1.1 2002/07/29 17:41:07 mike Exp $
+ *
+ * @@level      FreeBSD 5.1
  */
 
Index: trunk/src/emx/include/386/_types.h
===================================================================
--- trunk/src/emx/include/386/_types.h	(revision 341)
+++ trunk/src/emx/include/386/_types.h	(revision 342)
@@ -34,5 +34,8 @@
  *	From: @(#)ansi.h	8.2 (Berkeley) 1/4/94
  *	From: @(#)types.h	8.3 (Berkeley) 1/5/94
- * $FreeBSD: src/sys/i386/include/_types.h,v 1.4 2002/10/01 14:07:18 phk Exp $
+ * $FreeBSD: src/sys/i386/include/_types.h,v 1.7 2003/03/30 05:24:52 jake Exp $
+ *
+ * @@level      FreeBSD 5.1
+ * @@changed    bird: EMX definitions for size_t, clock_t and time_t.
  */
 
@@ -68,6 +71,12 @@
  * Standard type definitions.
  */
+#if 1 /* bird: emx */
+typedef	long int 	__clock_t;		/* clock()... */
+#else
 typedef	unsigned long	__clock_t;		/* clock()... */
+#endif
 typedef	__int32_t	__critical_t;
+typedef	double		__double_t;
+typedef	double		__float_t;
 typedef	__int32_t	__intfptr_t;
 typedef	__int64_t	__intmax_t;
@@ -84,7 +93,15 @@
 typedef	__int32_t	__register_t;
 typedef	__int32_t	__segsz_t;		/* segment size (in pages) */
+#if 1 /* bird: emx */
+typedef	unsigned long	__size_t;		/* sizeof() */
+#else
 typedef	__uint32_t	__size_t;		/* sizeof() */
+#endif
 typedef	__int32_t	__ssize_t;		/* byte count or error */
+#if 1 /* bird: emx */
+typedef	unsigned long	__time_t;		/* time()... */
+#else
 typedef	__int32_t	__time_t;		/* time()... */
+#endif
 typedef	__uint32_t	__uintfptr_t;
 typedef	__uint64_t	__uintmax_t;
@@ -101,4 +118,9 @@
 typedef	__uint32_t	__vm_offset_t;
 typedef	__int64_t	__vm_ooffset_t;
+#ifdef PAE
+typedef	__uint64_t	__vm_paddr_t;
+#else
+typedef	__uint32_t	__vm_paddr_t;
+#endif
 typedef	__uint64_t	__vm_pindex_t;
 typedef	__uint32_t	__vm_size_t;
Index: trunk/src/emx/include/386/ansi.h
===================================================================
--- trunk/src/emx/include/386/ansi.h	(revision 341)
+++ trunk/src/emx/include/386/ansi.h	(revision 342)
@@ -34,4 +34,7 @@
  *	@(#)ansi.h	8.2 (Berkeley) 1/4/94
  * $FreeBSD: src/sys/i386/include/ansi.h,v 1.18.2.4 2001/06/03 17:15:54 obrien Exp $
+ *
+ * @@level      FreeBSD 4.8
+ * @@remark     Toolkit legacy only.
  */
 
@@ -107,4 +110,6 @@
 #define	_BSD_CLOCKS_PER_SEC_	128
 
+#if 0 /* bird: emx - doesn't really need much in here, but this part is harmful. */
+
 /*
  * We define this here since both <stddef.h> and <sys/types.h> needs it.
@@ -152,3 +157,5 @@
 } __mbstate_t;
 
+#endif /* bird: emx */
+
 #endif /* !_MACHINE_ANSI_H_ */
Index: trunk/src/emx/include/386/builtin.h
===================================================================
--- trunk/src/emx/include/386/builtin.h	(revision 341)
+++ trunk/src/emx/include/386/builtin.h	(revision 342)
@@ -1,3 +1,6 @@
 /* 386/builtin.h (emx+gcc) */
+/*
+ * @@level      EMX 0.9d-fix04
+ */
 
 #ifndef _I386_BUILTIN_H
Index: trunk/src/emx/include/386/endian.h
===================================================================
--- trunk/src/emx/include/386/endian.h	(revision 341)
+++ trunk/src/emx/include/386/endian.h	(revision 342)
@@ -31,8 +31,9 @@
  * SUCH DAMAGE.
  *
- *	from: @(#)endian.h	7.8 (Berkeley) 4/3/91
+ *	@(#)endian.h	7.8 (Berkeley) 4/3/91
  * $FreeBSD: src/sys/i386/include/endian.h,v 1.35 2002/09/23 04:32:16 mike Exp $
  *
- * bird: this is a bit mixed up. with 1.18 too.
+ * @@level      FreeBSD 5.1
+ * @@changed    bird: Mixed in older stuff for toolkit compatibility. Not sure how successfull that is.
  */
 
@@ -40,4 +41,6 @@
 #define _MACHINE_ENDIAN_H_
 
+#include <sys/cdefs.h>
+#include <sys/_types.h>
 
 /*
@@ -55,5 +58,5 @@
 #define	_PDP_ENDIAN	3412	/* LSB first in word, MSW first in long */
 
-#define	_BYTE_ORDER	LITTLE_ENDIAN
+#define	_BYTE_ORDER	_LITTLE_ENDIAN
 
 /*
@@ -67,7 +70,4 @@
 #define	BYTE_ORDER	_BYTE_ORDER
 #endif
-
-#include <sys/cdefs.h>
-
 
 #ifdef __GNUC__
@@ -138,5 +138,6 @@
 
 
-/* For toolkit compatibility we must do this stuff here.
+/* bird:
+ * For toolkit compatibility we must do this stuff here.
  * Not sure how correct this is now. And mixing 4 versions
  * of (Free)BSD doesn't help....
Index: trunk/src/emx/include/386/param.h
===================================================================
--- trunk/src/emx/include/386/param.h	(revision 341)
+++ trunk/src/emx/include/386/param.h	(revision 342)
@@ -1,4 +1,3 @@
-/*- modified for gcc by bird 2003 (don't really need much of this btw.)
- *
+/*-
  * Copyright (c) 1990 The Regents of the University of California.
  * All rights reserved.
@@ -36,5 +35,7 @@
  *
  *	from: @(#)param.h	5.8 (Berkeley) 6/28/91
- * $FreeBSD: src/sys/i386/include/param.h,v 1.54.2.8 2002/08/31 21:15:55 dillon Exp $
+ * $FreeBSD: src/sys/i386/include/param.h,v 1.68 2003/03/30 05:24:52 jake Exp $
+ *
+ * @@level      FreeBSD 5.1
  */
 
@@ -75,11 +76,4 @@
 #define MID_MACHINE	MID_I386
 
-/*
- * OBJFORMAT_NAMES is a comma-separated list of the object formats
- * that are supported on the architecture.
- */
-#define OBJFORMAT_NAMES		"aout", "omf"
-#define OBJFORMAT_DEFAULT	"aout"
-
 #ifdef SMP
 #define MAXCPU		16
@@ -96,25 +90,30 @@
 #define NPTEPG		(PAGE_SIZE/(sizeof (pt_entry_t)))
 
+#ifdef PAE
+#define NPGPTD		4
+#define PDRSHIFT	21		/* LOG2(NBPDR) */
+#else
+#define NPGPTD		1
+#define PDRSHIFT	22		/* LOG2(NBPDR) */
+#endif
+
+#define NBPTD		(NPGPTD<<PAGE_SHIFT)
+#define NPDEPTD		(NBPTD/(sizeof (pd_entry_t)))
 #define NPDEPG		(PAGE_SIZE/(sizeof (pd_entry_t)))
-#define PDRSHIFT	22		/* LOG2(NBPDR) */
 #define NBPDR		(1<<PDRSHIFT)	/* bytes/page dir */
 #define PDRMASK		(NBPDR-1)
 
-#define DEV_BSHIFT	9		/* log2(DEV_BSIZE) */
-#define DEV_BSIZE	(1<<DEV_BSHIFT)
+#define IOPAGES	2		/* pages of i/o permission bitmap */
 
-#ifndef BLKDEV_IOSIZE
-#define BLKDEV_IOSIZE	PAGE_SIZE	/* default block device I/O size */
+#ifndef KSTACK_PAGES
+#define KSTACK_PAGES 2		/* Includes pcb! */
 #endif
-#define DFLTPHYS	(64 * 1024)	/* default max raw I/O transfer size */
-#define MAXPHYS		(128 * 1024)	/* max raw I/O transfer size */
-#define MAXDUMPPGS	(DFLTPHYS/PAGE_SIZE)
+#define UAREA_PAGES 1		/* holds struct user WITHOUT PCB (see def.) */
 
-#define IOPAGES	2		/* pages of i/o permission bitmap */
-#define UPAGES	3		/* pages of u-area */
+#define KSTACK_GUARD		/* compile in the kstack guard page */
 
 /*
  * Ceiling on amount of swblock kva space, can be changed via
- * kern.maxswzone /boot/loader.conf variable.
+ * the kern.maxswzone /boot/loader.conf variable.
  */
 #ifndef VM_SWZONE_SIZE_MAX
@@ -125,51 +124,9 @@
  * Ceiling on size of buffer cache (really only effects write queueing,
  * the VM page cache is not effected), can be changed via
- * kern.maxbcache /boot/loader.conf variable.
+ * the kern.maxbcache /boot/loader.conf variable.
  */
 #ifndef VM_BCACHE_SIZE_MAX
 #define VM_BCACHE_SIZE_MAX	(200 * 1024 * 1024)
 #endif
-
-
-/*
- * Constants related to network buffer management.
- * MCLBYTES must be no larger than CLBYTES (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.
- */
-#ifndef	MSIZE
-#define MSIZE		256		/* size of an mbuf */
-#endif	/* MSIZE */
-
-#ifndef	MCLSHIFT
-#define MCLSHIFT	11		/* convert bytes to m_buf clusters */
-#endif	/* MCLSHIFT */
-#define MCLBYTES	(1 << MCLSHIFT)	/* size of an m_buf cluster */
-#define MCLOFSET	(MCLBYTES - 1)	/* offset within an m_buf cluster */
-
-/*
- * Some macros for units conversion
- */
-
-/* clicks to bytes */
-#define ctob(x)	((x)<<PAGE_SHIFT)
-
-/* bytes to clicks */
-#define btoc(x)	(((unsigned)(x)+PAGE_MASK)>>PAGE_SHIFT)
-
-/*
- * btodb() is messy and perhaps slow because `bytes' may be an off_t.  We
- * want to shift an unsigned type to avoid sign extension and we don't
- * want to widen `bytes' unnecessarily.  Assume that the result fits in
- * a daddr_t.
- */
-#define btodb(bytes)	 		/* calculates (bytes / DEV_BSIZE) */ \
-	(sizeof (bytes) > sizeof(long) \
-	 ? (daddr_t)((unsigned long long)(bytes) >> DEV_BSHIFT) \
-	 : (daddr_t)((unsigned long)(bytes) >> DEV_BSHIFT))
-
-#define dbtob(db)			/* calculates (db * DEV_BSIZE) */ \
-	((off_t)(db) << DEV_BSHIFT)
 
 /*
@@ -178,50 +135,15 @@
 #define trunc_page(x)		((x) & ~PAGE_MASK)
 #define round_page(x)		(((x) + PAGE_MASK) & ~PAGE_MASK)
-#define trunc_4mpage(x)		((unsigned)(x) & ~PDRMASK)
-#define round_4mpage(x)		((((unsigned)(x)) + PDRMASK) & ~PDRMASK)
+#define trunc_4mpage(x)		((x) & ~PDRMASK)
+#define round_4mpage(x)		((((x)) + PDRMASK) & ~PDRMASK)
 
-#define atop(x)			((unsigned)(x) >> PAGE_SHIFT)
-#define ptoa(x)			((unsigned)(x) << PAGE_SHIFT)
+#define atop(x)			((x) >> PAGE_SHIFT)
+#define ptoa(x)			((x) << PAGE_SHIFT)
 
-#define i386_btop(x)		((unsigned)(x) >> PAGE_SHIFT)
-#define i386_ptob(x)		((unsigned)(x) << PAGE_SHIFT)
+#define i386_btop(x)		((x) >> PAGE_SHIFT)
+#define i386_ptob(x)		((x) << PAGE_SHIFT)
 
 #define	pgtok(x)		((x) * (PAGE_SIZE / 1024))
 
-#ifdef _KERNEL
-
-/*
- * We put here the definition of two debugging macros/function which
- * are very convenient to have available.
- * The macro is called TSTMP() and is used to timestamp events in the
- * kernel using the TSC register, and export them to userland through
- * the sysctl variable debug.timestamp, which is a circular buffer
- * holding pairs of u_int32_t variables <timestamp, argument> .
- * They can be retrieved with something like
- *
- *	sysctl -b debug.timestamp | hexdump -e '"%15u %15u\n"'
- *
- * The function _TSTMP() is defined in i386/isa/clock.c. It does not
- * try to grab any locks or block interrupts or identify which CPU it
- * is running on. You are supposed to know what to do if you use it.
- *
- * The macros must be enabled with "options KERN_TIMESTAMP" in the kernel
- * config file, otherwise they default to an empty block.
- */
-
-#ifdef KERN_TIMESTAMP
-extern void _TSTMP(u_int32_t argument);
-#define TSTMP(class, unit, event, par)	_TSTMP(	\
-	(((class) &   0x0f) << 28 ) |		\
-	(((unit)  &   0x0f) << 24 ) |		\
-	(((event) &   0xff) << 16 ) |		\
-	(((par)   & 0xffff)       )   )
-
-#else /* !KERN_TIMESTAMP */
-#define        _TSTMP(x)                       {}
-#define        TSTMP(class, unit, event, par)  _TSTMP(0)
-#endif /* !KERN_TIMESTAMP */
-#endif /* _KERNEL */
-
 #endif /* !_MACHINE_PARAM_H_ */
 #endif /* !_NO_NAMESPACE_POLLUTION */
Index: trunk/src/emx/include/386/reg.h
===================================================================
--- trunk/src/emx/include/386/reg.h	(revision 341)
+++ trunk/src/emx/include/386/reg.h	(revision 342)
@@ -1,3 +1,6 @@
 /* 386/reg.h (emx+gcc) */
+/*
+ * @@level      EMX 0.9d-fix04
+ */
 
 #ifndef _I386_REG_H
Index: trunk/src/emx/include/386/types.h
===================================================================
--- trunk/src/emx/include/386/types.h	(revision 341)
+++ trunk/src/emx/include/386/types.h	(revision 342)
@@ -33,4 +33,7 @@
  *	@(#)types.h	8.3 (Berkeley) 1/5/94
  * $FreeBSD: src/sys/i386/include/types.h,v 1.19.2.1 2001/03/21 10:50:58 peter Exp $
+ *
+ * @@level      FreeBSD 4.8
+ * @@remark     Dead in FreeBSD 5.0 - should be removed.
  */
 
