summaryrefslogtreecommitdiff
path: root/StdLib/Include/Ia32
diff options
context:
space:
mode:
Diffstat (limited to 'StdLib/Include/Ia32')
-rw-r--r--StdLib/Include/Ia32/machine/_math.h18
-rw-r--r--StdLib/Include/Ia32/machine/ansi.h94
-rw-r--r--StdLib/Include/Ia32/machine/asm.h208
-rw-r--r--StdLib/Include/Ia32/machine/bswap.h13
-rw-r--r--StdLib/Include/Ia32/machine/byte_swap.h79
-rw-r--r--StdLib/Include/Ia32/machine/endian.h3
-rw-r--r--StdLib/Include/Ia32/machine/endian_machdep.h3
-rw-r--r--StdLib/Include/Ia32/machine/float.h3
-rw-r--r--StdLib/Include/Ia32/machine/ieee.h3
-rw-r--r--StdLib/Include/Ia32/machine/int_const.h63
-rw-r--r--StdLib/Include/Ia32/machine/int_limits.h141
-rw-r--r--StdLib/Include/Ia32/machine/int_mwgwtypes.h82
-rw-r--r--StdLib/Include/Ia32/machine/int_types.h61
-rw-r--r--StdLib/Include/Ia32/machine/limits.h3
-rw-r--r--StdLib/Include/Ia32/machine/math.h3
-rw-r--r--StdLib/Include/Ia32/machine/param.h174
-rw-r--r--StdLib/Include/Ia32/machine/signal.h22
-rw-r--r--StdLib/Include/Ia32/machine/types.h81
18 files changed, 1054 insertions, 0 deletions
diff --git a/StdLib/Include/Ia32/machine/_math.h b/StdLib/Include/Ia32/machine/_math.h
new file mode 100644
index 0000000000..67cf98c30d
--- /dev/null
+++ b/StdLib/Include/Ia32/machine/_math.h
@@ -0,0 +1,18 @@
+/**
+
+Copyright (c) 2010, Intel Corporation. All rights reserved.<BR>
+This program and the accompanying materials are licensed and made available under
+the terms and conditions of the BSD License that accompanies this distribution.
+The full text of the license may be found at
+http://opensource.org/licenses/bsd-license.php.
+
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+#ifndef _MACHINE_MATH_H
+#define _MACHINE_MATH_H
+
+//#define __HUGE_VAL ???????????.?????????????
+
+#endif /* _MACHINE_MATH_H */
diff --git a/StdLib/Include/Ia32/machine/ansi.h b/StdLib/Include/Ia32/machine/ansi.h
new file mode 100644
index 0000000000..5872eb3694
--- /dev/null
+++ b/StdLib/Include/Ia32/machine/ansi.h
@@ -0,0 +1,94 @@
+/* $NetBSD: ansi.h,v 1.19 2006/10/04 13:52:00 tnozaki Exp $ */
+
+/*-
+ * Copyright (c) 1990, 1993
+ * The Regents of the University of California. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * @(#)ansi.h 8.2 (Berkeley) 1/4/94
+ */
+
+#ifndef _ANSI_H_
+#define _ANSI_H_
+
+#include <sys/EfiCdefs.h>
+
+#include <machine/int_types.h>
+
+/*
+ * Types which are fundamental to the implementation and may appear in
+ * more than one standard header are defined here. Standard headers
+ * then use:
+ * #ifdef _BSD_SIZE_T_
+ * typedef _BSD_SIZE_T_ size_t;
+ * #undef _BSD_SIZE_T_
+ * #endif
+ */
+#define _BSD_CLOCK_T_ _EFI_CLOCK_T /* clock() */
+#define _BSD_PTRDIFF_T_ _EFI_PTRDIFF_T_ /* ptr1 - ptr2 */
+#define _BSD_SIZE_T_ _EFI_SIZE_T_ /* sizeof() */
+#define _BSD_SSIZE_T_ INTN /* byte count or error */
+#define _BSD_TIME_T_ _EFI_TIME_T /* time() */
+#define _BSD_VA_LIST_ VA_LIST
+#define _BSD_CLOCKID_T_ INT64 /* clockid_t */
+#define _BSD_TIMER_T_ INT64 /* timer_t */
+#define _BSD_SUSECONDS_T_ INT64 /* suseconds_t */
+#define _BSD_USECONDS_T_ UINT64 /* useconds_t */
+
+/*
+ * NOTE: rune_t is not covered by ANSI nor other standards, and should not
+ * be instantiated outside of lib/libc/locale. use wchar_t.
+ *
+ * Runes (wchar_t) is declared to be an ``int'' instead of the more natural
+ * ``unsigned long'' or ``long''. Two things are happening here. It is not
+ * unsigned so that EOF (-1) can be naturally assigned to it and used. Also,
+ * it looks like 10646 will be a 31 bit standard. This means that if your
+ * ints cannot hold 32 bits, you will be in trouble. The reason an int was
+ * chosen over a long is that the is*() and to*() routines take ints (says
+ * ANSI C), but they use _RUNE_T_ instead of int. By changing it here, you
+ * lose a bit of ANSI conformance, but your programs will still work.
+ *
+ * Note that _WCHAR_T_ and _RUNE_T_ must be of the same type. When wchar_t
+ * and rune_t are typedef'd, _WCHAR_T_ will be undef'd, but _RUNE_T remains
+ * defined for ctype.h.
+ */
+#define _BSD_WCHAR_T_ _EFI_WCHAR_T /* wchar_t */
+#define _BSD_WINT_T_ _EFI_WINT_T /* wint_t */
+#define _BSD_RUNE_T_ _EFI_WCHAR_T /* rune_t */
+#define _BSD_WCTRANS_T_ void * /* wctrans_t */
+#define _BSD_WCTYPE_T_ unsigned int /* wctype_t */
+
+/*
+ * mbstate_t is an opaque object to keep conversion state, during multibyte
+ * stream conversions. The content must not be referenced by user programs.
+ */
+typedef union {
+ __int64_t __mbstateL; /* for alignment */
+ char __mbstate8[128];
+} __mbstate_t;
+#define _BSD_MBSTATE_T_ __mbstate_t /* mbstate_t */
+
+#endif /* _ANSI_H_ */
diff --git a/StdLib/Include/Ia32/machine/asm.h b/StdLib/Include/Ia32/machine/asm.h
new file mode 100644
index 0000000000..3d8f11f16c
--- /dev/null
+++ b/StdLib/Include/Ia32/machine/asm.h
@@ -0,0 +1,208 @@
+/* $NetBSD: asm.h,v 1.30 2006/01/20 22:02:40 christos Exp $ */
+
+/*-
+ * Copyright (c) 1990 The Regents of the University of California.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to Berkeley by
+ * William Jolitz.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * @(#)asm.h 5.5 (Berkeley) 5/7/91
+ */
+
+#ifndef _I386_ASM_H_
+#define _I386_ASM_H_
+
+#ifdef _KERNEL_OPT
+#include "opt_multiprocessor.h"
+#endif
+
+#ifdef PIC
+#define PIC_PROLOGUE \
+ pushl %ebx; \
+ call 1f; \
+1: \
+ popl %ebx; \
+ addl $_GLOBAL_OFFSET_TABLE_+[.-1b], %ebx
+#define PIC_EPILOGUE \
+ popl %ebx
+#define PIC_PLT(x) x@PLT
+#define PIC_GOT(x) x@GOT(%ebx)
+#define PIC_GOTOFF(x) x@GOTOFF(%ebx)
+#else
+#define PIC_PROLOGUE
+#define PIC_EPILOGUE
+#define PIC_PLT(x) x
+#define PIC_GOT(x) x
+#define PIC_GOTOFF(x) x
+#endif
+
+#ifdef __ELF__
+# define _C_LABEL(x) x
+#else
+# ifdef __STDC__
+# define _C_LABEL(x) _ ## x
+# else
+# define _C_LABEL(x) _/**/x
+# endif
+#endif
+#define _ASM_LABEL(x) x
+
+#define CVAROFF(x, y) _C_LABEL(x) + y
+
+#ifdef __STDC__
+# define __CONCAT(x,y) x ## y
+# define __STRING(x) #x
+#else
+# define __CONCAT(x,y) x/**/y
+# define __STRING(x) "x"
+#endif
+
+/* let kernels and others override entrypoint alignment */
+#if !defined(_ALIGN_TEXT) && !defined(_KERNEL)
+# ifdef __ELF__
+# define _ALIGN_TEXT .align 4
+# else
+# define _ALIGN_TEXT .align 2
+# endif
+#endif
+
+#define _ENTRY(x) \
+ .text; _ALIGN_TEXT; .globl x; .type x,@function; x:
+
+#ifdef _KERNEL
+
+#if defined(MULTIPROCESSOR)
+#define CPUVAR(off) %fs:__CONCAT(CPU_INFO_,off)
+#else
+#define CPUVAR(off) _C_LABEL(cpu_info_primary)+__CONCAT(CPU_INFO_,off)
+#endif /* MULTIPROCESSOR */
+
+/* XXX Can't use __CONCAT() here, as it would be evaluated incorrectly. */
+#ifdef __ELF__
+#ifdef __STDC__
+#define IDTVEC(name) \
+ ALIGN_TEXT; .globl X ## name; .type X ## name,@function; X ## name:
+#else
+#define IDTVEC(name) \
+ ALIGN_TEXT; .globl X/**/name; .type X/**/name,@function; X/**/name:
+#endif /* __STDC__ */
+#else
+#ifdef __STDC__
+#define IDTVEC(name) \
+ ALIGN_TEXT; .globl _X ## name; .type _X ## name,@function; _X ## name:
+#else
+#define IDTVEC(name) \
+ ALIGN_TEXT; .globl _X/**/name; .type _X/**/name,@function; _X/**/name:
+#endif /* __STDC__ */
+#endif /* __ELF__ */
+
+#ifdef __ELF__
+#define ALIGN_DATA .align 4
+#define ALIGN_TEXT .align 4,0x90 /* 4-byte boundaries, NOP-filled */
+#define SUPERALIGN_TEXT .align 16,0x90 /* 16-byte boundaries better for 486 */
+#else
+#define ALIGN_DATA .align 2
+#define ALIGN_TEXT .align 2,0x90 /* 4-byte boundaries, NOP-filled */
+#define SUPERALIGN_TEXT .align 4,0x90 /* 16-byte boundaries better for 486 */
+#endif /* __ELF__ */
+
+#define _ALIGN_TEXT ALIGN_TEXT
+
+#ifdef GPROF
+#ifdef __ELF__
+#define MCOUNT_ASM call _C_LABEL(__mcount)
+#else /* __ELF__ */
+#define MCOUNT_ASM call _C_LABEL(mcount)
+#endif /* __ELF__ */
+#else /* GPROF */
+#define MCOUNT_ASM /* nothing */
+#endif /* GPROF */
+
+#endif /* _KERNEL */
+
+
+
+#ifdef GPROF
+# ifdef __ELF__
+# define _PROF_PROLOGUE \
+ pushl %ebp; movl %esp,%ebp; call PIC_PLT(__mcount); popl %ebp
+# else
+# define _PROF_PROLOGUE \
+ pushl %ebp; movl %esp,%ebp; call PIC_PLT(mcount); popl %ebp
+# endif
+#else
+# define _PROF_PROLOGUE
+#endif
+
+#define ENTRY(y) _ENTRY(_C_LABEL(y)); _PROF_PROLOGUE
+#define NENTRY(y) _ENTRY(_C_LABEL(y))
+#define ASENTRY(y) _ENTRY(_ASM_LABEL(y)); _PROF_PROLOGUE
+
+#define ASMSTR .asciz
+
+#ifdef __ELF__
+#define RCSID(x) .section ".ident"; .asciz x
+#else
+#define RCSID(x) .text; .asciz x
+#endif
+
+#ifdef NO_KERNEL_RCSIDS
+#define __KERNEL_RCSID(_n, _s) /* nothing */
+#else
+#define __KERNEL_RCSID(_n, _s) RCSID(_s)
+#endif
+
+#ifdef __ELF__
+#define WEAK_ALIAS(alias,sym) \
+ .weak alias; \
+ alias = sym
+#endif
+/*
+ * STRONG_ALIAS: create a strong alias.
+ */
+#define STRONG_ALIAS(alias,sym) \
+ .globl alias; \
+ alias = sym
+
+#ifdef __STDC__
+#define WARN_REFERENCES(sym,msg) \
+ .stabs msg ## ,30,0,0,0 ; \
+ .stabs __STRING(_C_LABEL(sym)) ## ,1,0,0,0
+#elif defined(__ELF__)
+#define WARN_REFERENCES(sym,msg) \
+ .stabs msg,30,0,0,0 ; \
+ .stabs __STRING(sym),1,0,0,0
+#else
+#define WARN_REFERENCES(sym,msg) \
+ .stabs msg,30,0,0,0 ; \
+ .stabs __STRING(_/**/sym),1,0,0,0
+#endif /* __STDC__ */
+
+
+
+#endif /* !_I386_ASM_H_ */
diff --git a/StdLib/Include/Ia32/machine/bswap.h b/StdLib/Include/Ia32/machine/bswap.h
new file mode 100644
index 0000000000..7016f7ca29
--- /dev/null
+++ b/StdLib/Include/Ia32/machine/bswap.h
@@ -0,0 +1,13 @@
+/* $NetBSD: bswap.h,v 1.3 2006/01/31 07:49:18 dsl Exp $ */
+
+/* Written by Manuel Bouyer. Public domain */
+
+#ifndef _MACHINE_BSWAP_H_
+#define _MACHINE_BSWAP_H_
+
+#include <machine/byte_swap.h>
+
+#define __BSWAP_RENAME
+#include <sys/bswap.h>
+
+#endif /* !_MACHINE_BSWAP_H_ */
diff --git a/StdLib/Include/Ia32/machine/byte_swap.h b/StdLib/Include/Ia32/machine/byte_swap.h
new file mode 100644
index 0000000000..db16c97b2e
--- /dev/null
+++ b/StdLib/Include/Ia32/machine/byte_swap.h
@@ -0,0 +1,79 @@
+/* $NetBSD: byte_swap.h,v 1.10 2006/01/30 22:46:36 dsl Exp $ */
+
+/*-
+ * Copyright (c) 1998 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Charles M. Hannum.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by the NetBSD
+ * Foundation, Inc. and its contributors.
+ * 4. Neither the name of The NetBSD Foundation nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef _I386_BYTE_SWAP_H_
+#define _I386_BYTE_SWAP_H_
+
+#include <sys/types.h>
+
+#if defined(_KERNEL_OPT)
+#include "opt_cputype.h"
+#endif
+
+#ifdef __GNUC__
+#include <sys/types.h>
+__BEGIN_DECLS
+
+#define __BYTE_SWAP_U32_VARIABLE __byte_swap_u32_variable
+static __inline uint32_t __byte_swap_u32_variable(uint32_t);
+static __inline uint32_t
+__byte_swap_u32_variable(uint32_t x)
+{
+ __asm volatile (
+#if defined(_KERNEL) && !defined(_LKM) && !defined(I386_CPU)
+ "bswap %1"
+#else
+ "rorw $8, %w1\n\trorl $16, %1\n\trorw $8, %w1"
+#endif
+ : "=r" (x) : "0" (x));
+ return (x);
+}
+
+#define __BYTE_SWAP_U16_VARIABLE __byte_swap_u16_variable
+static __inline uint16_t __byte_swap_u16_variable(uint16_t);
+static __inline uint16_t
+__byte_swap_u16_variable(uint16_t x)
+{
+ __asm volatile ("rorw $8, %w1" : "=r" (x) : "0" (x));
+ return (x);
+}
+
+__END_DECLS
+#endif
+
+#endif /* !_I386_BYTE_SWAP_H_ */
diff --git a/StdLib/Include/Ia32/machine/endian.h b/StdLib/Include/Ia32/machine/endian.h
new file mode 100644
index 0000000000..8c2cfd12a1
--- /dev/null
+++ b/StdLib/Include/Ia32/machine/endian.h
@@ -0,0 +1,3 @@
+/* $NetBSD: endian.h,v 1.29 2000/03/17 00:09:20 mycroft Exp $ */
+
+#include <sys/endian.h>
diff --git a/StdLib/Include/Ia32/machine/endian_machdep.h b/StdLib/Include/Ia32/machine/endian_machdep.h
new file mode 100644
index 0000000000..83947a5fe6
--- /dev/null
+++ b/StdLib/Include/Ia32/machine/endian_machdep.h
@@ -0,0 +1,3 @@
+/* $NetBSD: endian_machdep.h,v 1.3 2006/01/30 21:52:38 dsl Exp $ */
+
+#define _BYTE_ORDER _LITTLE_ENDIAN
diff --git a/StdLib/Include/Ia32/machine/float.h b/StdLib/Include/Ia32/machine/float.h
new file mode 100644
index 0000000000..c7dc6203f8
--- /dev/null
+++ b/StdLib/Include/Ia32/machine/float.h
@@ -0,0 +1,3 @@
+/* $NetBSD: float.h,v 1.12 2003/02/26 21:29:00 fvdl Exp $ */
+
+#include <x86/float.h>
diff --git a/StdLib/Include/Ia32/machine/ieee.h b/StdLib/Include/Ia32/machine/ieee.h
new file mode 100644
index 0000000000..17a1d48d3a
--- /dev/null
+++ b/StdLib/Include/Ia32/machine/ieee.h
@@ -0,0 +1,3 @@
+/* $NetBSD: ieee.h,v 1.2 2003/02/26 21:29:01 fvdl Exp $ */
+
+#include <x86/ieee.h>
diff --git a/StdLib/Include/Ia32/machine/int_const.h b/StdLib/Include/Ia32/machine/int_const.h
new file mode 100644
index 0000000000..c3a59d7237
--- /dev/null
+++ b/StdLib/Include/Ia32/machine/int_const.h
@@ -0,0 +1,63 @@
+/* $NetBSD: int_const.h,v 1.1 2001/04/14 22:38:38 kleink Exp $ */
+
+/*-
+ * Copyright (c) 2001 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Klaus Klein.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by the NetBSD
+ * Foundation, Inc. and its contributors.
+ * 4. Neither the name of The NetBSD Foundation nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef _I386_INT_CONST_H_
+#define _I386_INT_CONST_H_
+
+/*
+ * 7.18.4 Macros for integer constants
+ */
+
+/* 7.18.4.1 Macros for minimum-width integer constants */
+
+#define INT8_C(c) c
+#define INT16_C(c) c
+#define INT32_C(c) c
+#define INT64_C(c) c ## LL
+
+#define UINT8_C(c) c ## U
+#define UINT16_C(c) c ## U
+#define UINT32_C(c) c ## U
+#define UINT64_C(c) c ## ULL
+
+/* 7.18.4.2 Macros for greatest-width integer constants */
+
+#define INTMAX_C(c) c ## LL
+#define UINTMAX_C(c) c ## ULL
+
+#endif /* !_I386_INT_CONST_H_ */
diff --git a/StdLib/Include/Ia32/machine/int_limits.h b/StdLib/Include/Ia32/machine/int_limits.h
new file mode 100644
index 0000000000..b0aa9d5d7c
--- /dev/null
+++ b/StdLib/Include/Ia32/machine/int_limits.h
@@ -0,0 +1,141 @@
+/** @file
+ 7.18.2 Limits of specified-width integer types.
+
+ Copyright (c) 2010 - 2011, Intel Corporation. All rights reserved.<BR>
+ This program and the accompanying materials are licensed and made available under
+ the terms and conditions of the BSD License that accompanies this distribution.
+ The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+ * Copyright (c) 2001 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Klaus Klein.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by the NetBSD
+ * Foundation, Inc. and its contributors.
+ * 4. Neither the name of The NetBSD Foundation nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+
+ NetBSD: int_limits.h,v 1.5 2004/05/22 14:16:59 kleink Exp
+**/
+#ifndef _I386_INT_LIMITS_H_
+#define _I386_INT_LIMITS_H_
+
+/* 7.18.2.1 Limits of exact-width integer types */
+
+/* minimum values of exact-width signed integer types */
+#define INT8_MIN ((-0x7f)-1) /* int8_t */
+#define INT16_MIN ((-0x7fff)-1) /* int16_t */
+#define INT32_MIN ((-0x7fffffff)-1) /* int32_t */
+#define INT64_MIN ((-0x7fffffffffffffffLL)-1) /* int64_t */
+
+/* maximum values of exact-width signed integer types */
+#define INT8_MAX 0x7f /* int8_t */
+#define INT16_MAX 0x7fff /* int16_t */
+#define INT32_MAX 0x7fffffff /* int32_t */
+#define INT64_MAX 0x7fffffffffffffffLL /* int64_t */
+
+/* maximum values of exact-width unsigned integer types */
+#define UINT8_MAX 0xffU /* uint8_t */
+#define UINT16_MAX 0xffffU /* uint16_t */
+#define UINT32_MAX 0xffffffffU /* uint32_t */
+#define UINT64_MAX 0xffffffffffffffffULL /* uint64_t */
+
+/* 7.18.2.2 Limits of minimum-width integer types */
+
+/* minimum values of minimum-width signed integer types */
+#define INT_LEAST8_MIN ((-0x7f)-1) /* int_least8_t */
+#define INT_LEAST16_MIN ((-0x7fff)-1) /* int_least16_t */
+#define INT_LEAST32_MIN ((-0x7fffffff)-1) /* int_least32_t */
+#define INT_LEAST64_MIN ((-0x7fffffffffffffffLL)-1) /* int_least64_t */
+
+/* maximum values of minimum-width signed integer types */
+#define INT_LEAST8_MAX 0x7f /* int_least8_t */
+#define INT_LEAST16_MAX 0x7fff /* int_least16_t */
+#define INT_LEAST32_MAX 0x7fffffff /* int_least32_t */
+#define INT_LEAST64_MAX 0x7fffffffffffffffLL /* int_least64_t */
+
+/* maximum values of minimum-width unsigned integer types */
+#define UINT_LEAST8_MAX 0xffU /* uint_least8_t */
+#define UINT_LEAST16_MAX 0xffffU /* uint_least16_t */
+#define UINT_LEAST32_MAX 0xffffffffU /* uint_least32_t */
+#define UINT_LEAST64_MAX 0xffffffffffffffffULL /* uint_least64_t */
+
+/* 7.18.2.3 Limits of fastest minimum-width integer types */
+
+/* minimum values of fastest minimum-width signed integer types */
+#define INT_FAST8_MIN ((-0x7f)-1) /* int_fast8_t */
+#define INT_FAST16_MIN ((-0x7fffffff)-1) /* int_fast16_t */
+#define INT_FAST32_MIN ((-0x7fffffff)-1) /* int_fast32_t */
+#define INT_FAST64_MIN ((-0x7fffffffffffffffLL-1) /* int_fast64_t */
+
+/* maximum values of fastest minimum-width signed integer types */
+#define INT_FAST8_MAX 0x7f /* int_fast8_t */
+#define INT_FAST16_MAX 0x7fffffff /* int_fast16_t */
+#define INT_FAST32_MAX 0x7fffffff /* int_fast32_t */
+#define INT_FAST64_MAX 0x7fffffffffffffffLL /* int_fast64_t */
+
+/* maximum values of fastest minimum-width unsigned integer types */
+#define UINT_FAST8_MAX 0xffU /* uint_fast8_t */
+#define UINT_FAST16_MAX 0xffffffffU /* uint_fast16_t */
+#define UINT_FAST32_MAX 0xffffffffU /* uint_fast32_t */
+#define UINT_FAST64_MAX 0xffffffffffffffffULL /* uint_fast64_t */
+
+/* 7.18.2.4 Limits of integer types capable of holding object pointers */
+
+#define INTPTR_MIN ((-0x7fffffff)-1) /* intptr_t */
+#define INTPTR_MAX 0x7fffffff /* intptr_t */
+#define UINTPTR_MAX 0xffffffffU /* uintptr_t */
+
+/* 7.18.2.5 Limits of greatest-width integer types */
+
+#define INTMAX_MIN ((-0x7fffffffffffffffLL)-1) /* intmax_t */
+#define INTMAX_MAX 0x7fffffffffffffffLL /* intmax_t */
+#define UINTMAX_MAX 0xffffffffffffffffULL /* uintmax_t */
+
+
+/*
+ * 7.18.3 Limits of other integer types
+ */
+
+/* limits of ptrdiff_t */
+#define PTRDIFF_MIN ((-0x7fffffff)-1) /* ptrdiff_t */
+#define PTRDIFF_MAX 0x7fffffff /* ptrdiff_t */
+
+/* limits of sig_atomic_t */
+#define SIG_ATOMIC_MIN ((-0x7fffffff)-1) /* sig_atomic_t */
+#define SIG_ATOMIC_MAX 0x7fffffff /* sig_atomic_t */
+
+/* limit of size_t */
+#define SIZE_MAX 0xffffffffU /* size_t */
+#define SIZE_T_MAX SIZE_MAX
+
+#endif /* !_I386_INT_LIMITS_H_ */
diff --git a/StdLib/Include/Ia32/machine/int_mwgwtypes.h b/StdLib/Include/Ia32/machine/int_mwgwtypes.h
new file mode 100644
index 0000000000..5e28108f8e
--- /dev/null
+++ b/StdLib/Include/Ia32/machine/int_mwgwtypes.h
@@ -0,0 +1,82 @@
+/** @file
+ Minimum and Greatest Width Integer types.
+
+ Copyright (c) 2010, Intel Corporation. All rights reserved.<BR>
+ This program and the accompanying materials are licensed and made available under
+ the terms and conditions of the BSD License that accompanies this distribution.
+ The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php.
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+ Portions Copyright (c) 2001 The NetBSD Foundation, Inc.
+ All rights reserved.
+
+ This code is derived from software contributed to The NetBSD Foundation
+ by Klaus Klein.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions
+ are met:
+ 1. Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ 2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+ 3. All advertising materials mentioning features or use of this software
+ must display the following acknowledgement:
+ This product includes software developed by the NetBSD
+ Foundation, Inc. and its contributors.
+ 4. Neither the name of The NetBSD Foundation nor the names of its
+ contributors may be used to endorse or promote products derived
+ from this software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+
+ NetBSD: int_mwgwtypes.h,v 1.5 2005/12/24 20:06:47 perry Exp
+**/
+#ifndef _AMD64_INT_MWGWTYPES_H_
+#define _AMD64_INT_MWGWTYPES_H_
+
+/*
+ * 7.18.1 Integer types
+ */
+
+/* 7.18.1.2 Minimum-width integer types */
+
+typedef CHAR8 int_least8_t;
+typedef UINT8 uint_least8_t;
+typedef INT16 int_least16_t;
+typedef UINT16 uint_least16_t;
+typedef INT32 int_least32_t;
+typedef UINT32 uint_least32_t;
+typedef INT64 int_least64_t;
+typedef UINT64 uint_least64_t;
+
+/* 7.18.1.3 Fastest minimum-width integer types */
+typedef INT32 int_fast8_t;
+typedef UINT32 uint_fast8_t;
+typedef INT32 int_fast16_t;
+typedef UINT32 uint_fast16_t;
+typedef INT32 int_fast32_t;
+typedef UINT32 uint_fast32_t;
+typedef INT64 int_fast64_t;
+typedef UINT64 uint_fast64_t;
+
+/* 7.18.1.5 Greatest-width integer types */
+
+typedef INT64 intmax_t;
+typedef UINT64 uintmax_t;
+
+#endif /* !_AMD64_INT_MWGWTYPES_H_ */
diff --git a/StdLib/Include/Ia32/machine/int_types.h b/StdLib/Include/Ia32/machine/int_types.h
new file mode 100644
index 0000000000..d04d8c0e4c
--- /dev/null
+++ b/StdLib/Include/Ia32/machine/int_types.h
@@ -0,0 +1,61 @@
+/* $NetBSD: int_types.h,v 1.10 2005/12/24 20:07:10 perry Exp $ */
+
+/*-
+ * Copyright (c) 1990 The Regents of the University of California.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * from: @(#)types.h 7.5 (Berkeley) 3/9/91
+ */
+
+#ifndef _I386_INT_TYPES_H_
+#define _I386_INT_TYPES_H_
+
+#include <sys/EfiCdefs.h>
+
+/*
+ * 7.18.1 Integer types
+ */
+
+/* 7.18.1.1 Exact-width integer types */
+
+typedef INT8 __int8_t;
+typedef UINT8 __uint8_t;
+typedef INT16 __int16_t;
+typedef UINT16 __uint16_t;
+typedef INT32 __int32_t;
+typedef UINT32 __uint32_t;
+typedef INT64 __int64_t;
+typedef UINT64 __uint64_t;
+
+#define __BIT_TYPES_DEFINED__
+
+/* 7.18.1.4 Integer types capable of holding object pointers */
+
+typedef INTN __intptr_t;
+typedef UINTN __uintptr_t;
+
+#endif /* !_I386_INT_TYPES_H_ */
diff --git a/StdLib/Include/Ia32/machine/limits.h b/StdLib/Include/Ia32/machine/limits.h
new file mode 100644
index 0000000000..62fbe40b42
--- /dev/null
+++ b/StdLib/Include/Ia32/machine/limits.h
@@ -0,0 +1,3 @@
+#include <x86/limits.h>
+
+#define __POINTER_BIT 32
diff --git a/StdLib/Include/Ia32/machine/math.h b/StdLib/Include/Ia32/machine/math.h
new file mode 100644
index 0000000000..a53422933c
--- /dev/null
+++ b/StdLib/Include/Ia32/machine/math.h
@@ -0,0 +1,3 @@
+/* $NetBSD: math.h,v 1.3 2005/12/11 12:16:25 christos Exp $ */
+
+#include <x86/math.h>
diff --git a/StdLib/Include/Ia32/machine/param.h b/StdLib/Include/Ia32/machine/param.h
new file mode 100644
index 0000000000..72da83f488
--- /dev/null
+++ b/StdLib/Include/Ia32/machine/param.h
@@ -0,0 +1,174 @@
+/* $NetBSD: param.h,v 1.61 2006/08/28 13:43:35 yamt Exp $ */
+
+/*-
+ * Copyright (c) 1990 The Regents of the University of California.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to Berkeley by
+ * William Jolitz.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * @(#)param.h 5.8 (Berkeley) 6/28/91
+ */
+
+#ifndef _I386_PARAM_H_
+#define _I386_PARAM_H_
+
+/*
+ * Machine dependent constants for Intel 386.
+ */
+
+#ifdef _KERNEL
+#ifdef _LOCORE
+#include <machine/psl.h>
+#else
+#include <machine/cpu.h>
+#endif
+#endif
+
+#define _MACHINE i386
+#define MACHINE "i386"
+#define _MACHINE_ARCH i386
+#define MACHINE_ARCH "i386"
+#define MID_MACHINE MID_I386
+
+/*
+ * Round p (pointer or byte index) up to a correctly-aligned value
+ * for all data types (int, long, ...). The result is u_int and
+ * must be cast to any desired pointer type.
+ *
+ * ALIGNED_POINTER is a boolean macro that checks whether an address
+ * is valid to fetch data elements of type t from on this architecture.
+ * This does not reflect the optimal alignment, just the possibility
+ * (within reasonable limits).
+ *
+ */
+#define ALIGNBYTES (sizeof(int) - 1)
+#define ALIGN(p) (((u_int)(u_long)(p) + ALIGNBYTES) &~ \
+ ALIGNBYTES)
+#define ALIGNED_POINTER(p,t) 1
+
+#define PGSHIFT 12 /* LOG2(NBPG) */
+#define NBPG (1 << PGSHIFT) /* bytes/page */
+#define PGOFSET (NBPG-1) /* byte offset into page */
+#define NPTEPG (NBPG/(sizeof (pt_entry_t)))
+
+#if defined(_KERNEL_OPT)
+#include "opt_kernbase.h"
+#endif /* defined(_KERNEL_OPT) */
+
+#ifdef KERNBASE_LOCORE
+#error "You should only re-define KERNBASE"
+#endif
+
+#ifndef KERNBASE
+#define KERNBASE 0xc0000000UL /* start of kernel virtual space */
+#endif
+
+#define KERNTEXTOFF (KERNBASE + 0x100000) /* start of kernel text */
+#define BTOPKERNBASE (KERNBASE >> PGSHIFT)
+
+#define DEV_BSHIFT 9 /* log2(DEV_BSIZE) */
+#define DEV_BSIZE (1 << DEV_BSHIFT)
+#define BLKDEV_IOSIZE 2048
+#ifndef MAXPHYS
+#define MAXPHYS (64 * 1024) /* max raw I/O transfer size */
+#endif
+
+#define SSIZE 1 /* initial stack size/NBPG */
+#define SINCR 1 /* increment of stack/NBPG */
+
+#ifdef _KERNEL_OPT
+#include "opt_noredzone.h"
+#endif
+#ifndef UPAGES
+#ifdef NOREDZONE
+#define UPAGES 2 /* pages of u-area */
+#else
+#define UPAGES 3
+#endif /*NOREDZONE */
+#endif /* !defined(UPAGES) */
+#define USPACE (UPAGES * NBPG) /* total size of u-area */
+
+#ifndef MSGBUFSIZE
+#define MSGBUFSIZE 4*NBPG /* default message buffer size */
+#endif
+
+/*
+ * 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 */
+ /* 2K cluster can hold Ether frame */
+#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
+
+#ifndef NFS_RSIZE
+#define NFS_RSIZE 32768
+#endif
+#ifndef NFS_WSIZE
+#define NFS_WSIZE 32768
+#endif
+
+/*
+ * Minimum and maximum sizes of the kernel malloc arena in PAGE_SIZE-sized
+ * logical pages.
+ */
+#define NKMEMPAGES_MIN_DEFAULT ((8 * 1024 * 1024) >> PAGE_SHIFT)
+#define NKMEMPAGES_MAX_DEFAULT ((128 * 1024 * 1024) >> PAGE_SHIFT)
+
+/*
+ * Mach derived conversion macros
+ */
+#define x86_round_pdr(x) ((((unsigned)(x)) + PDOFSET) & ~PDOFSET)
+#define x86_trunc_pdr(x) ((unsigned)(x) & ~PDOFSET)
+#define x86_btod(x) ((unsigned)(x) >> PDSHIFT)
+#define x86_dtob(x) ((unsigned)(x) << PDSHIFT)
+#define x86_round_page(x) ((((unsigned)(x)) + PGOFSET) & ~PGOFSET)
+#define x86_trunc_page(x) ((unsigned)(x) & ~PGOFSET)
+#define x86_btop(x) ((unsigned)(x) >> PGSHIFT)
+#define x86_ptob(x) ((unsigned)(x) << PGSHIFT)
+
+#endif /* _I386_PARAM_H_ */
diff --git a/StdLib/Include/Ia32/machine/signal.h b/StdLib/Include/Ia32/machine/signal.h
new file mode 100644
index 0000000000..6628eb9e94
--- /dev/null
+++ b/StdLib/Include/Ia32/machine/signal.h
@@ -0,0 +1,22 @@
+/**
+Copyright (c) 2010, Intel Corporation. All rights reserved.<BR>
+This program and the accompanying materials are licensed and made available under
+the terms and conditions of the BSD License that accompanies this distribution.
+The full text of the license may be found at
+http://opensource.org/licenses/bsd-license.php.
+
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+#ifndef _MACHINE_SIGNAL_H
+#define _MACHINE_SIGNAL_H
+#include <sys/EfiCdefs.h>
+
+/** The type sig_atomic_t is the (possibly volatile-qualified) integer type of
+ an object that can be accessed as an atomic entity, even in the presence
+ of asynchronous interrupts.
+**/
+typedef INTN sig_atomic_t;
+
+#endif /* _MACHINE_SIGNAL_H */
diff --git a/StdLib/Include/Ia32/machine/types.h b/StdLib/Include/Ia32/machine/types.h
new file mode 100644
index 0000000000..f985991ec8
--- /dev/null
+++ b/StdLib/Include/Ia32/machine/types.h
@@ -0,0 +1,81 @@
+/** @file
+ Machine dependent type definitions.
+
+ Copyright (c) 2010, Intel Corporation. All rights reserved.<BR>
+ This program and the accompanying materials are licensed and made available
+ under the terms and conditions of the BSD License that accompanies this
+ distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php.
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+ Copyright (c) 1990 The Regents of the University of California.
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions
+ are met:
+ 1. Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ 2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+ 3. Neither the name of the University nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ SUCH DAMAGE.
+
+ types.h 7.5 (Berkeley) 3/9/91
+ NetBSD: types.h,v 1.49 2006/09/03 13:51:23 bjh21 Exp
+**/
+#ifndef _MACHTYPES_H_
+#define _MACHTYPES_H_
+
+#include <sys/EfiCdefs.h>
+#include <sys/featuretest.h>
+#include <machine/int_types.h>
+
+/* Handle the long and unsigned long data types which EFI doesn't directly support. */
+//typedef INTN LONGN;
+//typedef UINTN ULONGN;
+
+typedef PHYSICAL_ADDRESS paddr_t;
+typedef UINT64 psize_t;
+typedef PHYSICAL_ADDRESS vaddr_t;
+typedef UINT64 vsize_t;
+
+typedef INT32 pmc_evid_t;
+typedef UINT64 pmc_ctr_t;
+typedef INT32 register_t;
+
+typedef volatile INT32 __cpu_simple_lock_t;
+
+#define __SIMPLELOCK_LOCKED 1
+#define __SIMPLELOCK_UNLOCKED 0
+
+/* The x86 does not have strict alignment requirements. */
+#define __NO_STRICT_ALIGNMENT
+
+#define __HAVE_DEVICE_REGISTER
+#define __HAVE_CPU_COUNTER
+#define __HAVE_SYSCALL_INTERN
+#define __HAVE_MINIMAL_EMUL
+#define __HAVE_OLD_DISKLABEL
+#define __HAVE_GENERIC_SOFT_INTERRUPTS
+#define __HAVE_CPU_MAXPROC
+#define __HAVE_TIMECOUNTER
+#define __HAVE_GENERIC_TODR
+
+#endif /* _MACHTYPES_H_ */