diff options
Diffstat (limited to 'StdLib/Include/sys')
42 files changed, 0 insertions, 7033 deletions
diff --git a/StdLib/Include/sys/EfiCdefs.h b/StdLib/Include/sys/EfiCdefs.h deleted file mode 100644 index 2fa7ba6ae5..0000000000 --- a/StdLib/Include/sys/EfiCdefs.h +++ /dev/null @@ -1,376 +0,0 @@ -/** @file
- Common declarations and definitions for Standard C Library headers.
-
- This header consolidates definitions and declarations for compiler specific
- features in one place in order to assist in making the remainder of the
- library as compiler independent as possible.
-
- Certain macro and type definitions are required to be provided by several
- different headers. In order to avoid having multiple definitions, and the
- attendant risk of having the definitions get out of sync, they are defined in
- this header.
-
- Note that MdePkg/Include/Base.h is automatically included and will bring
- processor architecture specific definitions along with it.
-
- Throughout the library, the following macros are used instead of keywords so
- that the library can be easily tuned for different compilers.
- __inline Defined to the appropriate keyword or not defined.
- __func__ Defined to __FUNC__, __FUNCTION__, or NULL as appropriate.
- __restrict Defined to nothing for VC++ or to restrict for GCC and C99 compliant compilers.
-
- This file and its contents are inspired by the <sys/cdefs.h> files in Berkeley
- Unix. They have been re-implemented to be specific to the EFI environment.
-
- Copyright (c) 2010 - 2014, 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.
-
- Portions Copyright (c) 1991, 1993
- The Regents of the University of California. All rights reserved.
-
- Portions of this code are derived from software contributed to Berkeley by
- Berkeley Software Design, Inc.
- 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.
-**/
-#ifndef _EFI_CDEFS_H
-#define _EFI_CDEFS_H
-
-/*
-* Macro to test if we're using a GNU C compiler of a specific vintage
-* or later, for e.g. features that appeared in a particular version
-* of GNU C. Usage:
-*
-* #if __GNUC_PREREQ__(major, minor)
-* ...cool feature...
-* #else
-* ...delete feature...
-* #endif
-*/
-#ifdef __GNUC__
-#define __GNUC_PREREQ__(x, y) \
-((__GNUC__ == (x) && __GNUC_MINOR__ >= (y)) || \
- (__GNUC__ > (x)))
-
-#define DONT_USE_STRONG_WEAK_ALIAS 1
-
-#else
-#define __GNUC_PREREQ__(x, y) 0
-#endif
-
-#include <sys/featuretest.h>
-//#include <machine/_EfiCdefs.h>
-#ifdef __PE32__
-#include <sys/_EfiCdefs_PE32.h>
-#else
-#include <sys/cdefs_aout.h>
-#endif
-
-/* NULL is defined by the automatic inclusion of Base.h by the build tools. */
-
-#ifdef __GNUC__
- #define _EFI_SIZE_T_ __SIZE_TYPE__ /* sizeof() */
- #define _EFI_WCHAR_T __WCHAR_TYPE__
- #define _EFI_WINT_T __WINT_TYPE__
- //#define _EFI_WINT_MIN (0)
- //#define _EFI_WINT_MAX (0xFFFF)
- #define _EFI_PTRDIFF_T_ __PTRDIFF_TYPE__ /* ptr1 - ptr2 --- Must be same size as size_t */
-
-#else
-#define _EFI_SIZE_T_ UINTN /* sizeof() */
-#define _EFI_WCHAR_T UINT16
-#define _EFI_WINT_T INT32
- //#define _EFI_WINT_MIN (-2147483647) /* wint_t */
- //#define _EFI_WINT_MAX ( 2147483647) /* wint_t */
- #define _EFI_PTRDIFF_T_ INTN /* ptr1 - ptr2 --- Must be same size as size_t */
-#endif /* __GNUC__ */
-
-#define _EFI_CLOCK_T UINT64
-#define _EFI_TIME_T INT32
-
-#if defined(__cplusplus)
-#define __BEGIN_DECLS extern "C" {
-#define __END_DECLS }
-#define __static_cast(x,y) static_cast<x>(y)
-#else
-#define __BEGIN_DECLS
-#define __END_DECLS
-#define __static_cast(x,y) (x)y
-#endif
-
- /*
- * The __CONCAT macro is used to concatenate parts of symbol names, e.g.
- * with "#define OLD(foo) __CONCAT(old,foo)", OLD(foo) produces oldfoo.
- * The __CONCAT macro is a bit tricky -- make sure you don't put spaces
- * in between its arguments. __CONCAT can also concatenate double-quoted
- * strings produced by the __STRING macro, but this only works with ANSI C.
- */
-
-#define ___STRING(x) __STRING(x)
-#define ___CONCAT(x,y) __CONCAT(x,y)
-#define __CONCAT(x,y) x ## y
-#define __STRING(x) #x
-
-#define __const CONST
-#define __signed signed
-#define __volatile volatile
-
-#if __STDC__ || defined(__cplusplus)
- #if defined(__cplusplus)
- #define __inline inline /* convert to C++ keyword */
- #else
- #if defined(_MSC_VER) || (!defined(__GNUC__) && !defined(__lint__))
- #define __inline /* delete C99 keyword */
- #endif /* !__GNUC__ && !__lint__ */
- #endif /* !__cplusplus */
-#endif /* !(__STDC__ || __cplusplus) */
-
-/* Used in NetBSD for internal auditing of the source tree. */
-#define __aconst
-
- /*
- * The following macro is used to remove const cast-away warnings
- * from gcc -Wcast-qual; it should be used with caution because it
- * can hide valid errors; in particular most valid uses are in
- * situations where the API requires it, not to cast away string
- * constants. We don't use *intptr_t on purpose here and we are
- * explicit about unsigned long so that we don't have additional
- * dependencies.
- */
-#define __UNCONST(a) ((void *)(a))
-//#define __UNCONST(a) ((void *)(PHYSICAL_ADDRESS)(const void *)(a))
-
- /*
- * The following macro is used to remove the volatile cast-away warnings
- * from gcc -Wcast-qual; as above it should be used with caution
- * because it can hide valid errors or warnings. Valid uses include
- * making it possible to pass a volatile pointer to memset().
- * For the same reasons as above, we use unsigned long and not intptr_t.
- */
-#define __UNVOLATILE(a) ((void *)(PHYSICAL_ADDRESS)(volatile void *)(a))
-
- /*
- * GCC2 provides __extension__ to suppress warnings for various GNU C
- * language extensions under "-ansi -pedantic".
- */
-#if !__GNUC_PREREQ__(2, 0)
-#define __extension__ /* delete __extension__ if non-gcc or gcc1 */
-#endif
-
- /*
- * GCC1 and some versions of GCC2 declare dead (non-returning) and
- * pure (no side effects) functions using "volatile" and "const";
- * unfortunately, these then cause warnings under "-ansi -pedantic".
- * GCC2 uses a new, peculiar __attribute__((attrs)) style. All of
- * these work for GNU C++ (modulo a slight glitch in the C++ grammar
- * in the distribution version of 2.5.5).
- */
-#if !__GNUC_PREREQ__(2, 5)
-#define __attribute__(x) /* delete __attribute__ if non-gcc or gcc1 */
-#if defined(__GNUC__) && !defined(__STRICT_ANSI__)
-#define __dead __volatile
-#define __pure __const
-#endif
-#endif
-
- /* Delete pseudo-keywords wherever they are not available or needed. */
-#ifndef __dead
-#define __dead
-#define __pure
-#endif
-
-#if __GNUC_PREREQ__(2, 7)
-#define __unused __attribute__((__unused__))
-#define __noreturn __attribute__((__noreturn__))
-#else
-#define __unused /* delete */
-#define __noreturn /* delete */
-#endif
-
-#if __GNUC_PREREQ__(3, 1)
-#define __used __attribute__((__used__))
-#else
-#define __used __unused
-#endif
-
-#if __GNUC_PREREQ__(2, 7)
-#define __packed __attribute__((__packed__))
-#define __aligned(x) __attribute__((__aligned__(x)))
-#define __section(x) __attribute__((__section__(x)))
-#elif defined(__lint__)
-#define __packed /* delete */
-#define __aligned(x) /* delete */
-#define __section(x) /* delete */
-#else
-#define __packed error: no __packed for this compiler
-#define __aligned(x) error: no __aligned for this compiler
-#define __section(x) error: no __section for this compiler
-#endif
-
-/*
-* C99 defines the restrict type qualifier keyword, which was made available
-* in GCC 2.92.
-*/
-#if __STDC_VERSION__ >= 199901L
- #define __restrict restrict
-#else
- #if defined(_MSC_VER) || !__GNUC_PREREQ__(2, 92)
- #define __restrict /* delete __restrict when not supported */
- #endif
-#endif
-
-/*
-* C99 defines __func__ predefined identifier, which was made available
-* in GCC 2.95.
-*/
-#if !(__STDC_VERSION__ >= 199901L)
- #if defined(_MSC_VER)
- #define __func__ __FUNCTION__ /* Use the MS-specific predefined macro */
- #elif __GNUC_PREREQ__(2, 6)
- #define __func__ __PRETTY_FUNCTION__
- #elif __GNUC_PREREQ__(2, 4)
- #define __func__ __FUNCTION__
- #else
- #define __func__ ""
- #endif
-#endif /* !(__STDC_VERSION__ >= 199901L) */
-
-#define __RENAME(x)
-
- /*
- * A barrier to stop the optimizer from moving code or assume live
- * register values. This is gcc specific, the version is more or less
- * arbitrary, might work with older compilers.
- */
-#if __GNUC_PREREQ__(2, 95)
-#define __insn_barrier() __asm __volatile("":::"memory")
-#else
-#define __insn_barrier() /* */
-#endif
-
- /*
- * GNU C version 2.96 adds explicit branch prediction so that
- * the CPU back-end can hint the processor and also so that
- * code blocks can be reordered such that the predicted path
- * sees a more linear flow, thus improving cache behavior, etc.
- *
- * The following two macros provide us with a way to use this
- * compiler feature. Use __predict_true() if you expect the expression
- * to evaluate to true, and __predict_false() if you expect the
- * expression to evaluate to false.
- *
- * A few notes about usage:
- *
- * * Generally, __predict_false() error condition checks (unless
- * you have some _strong_ reason to do otherwise, in which case
- * document it), and/or __predict_true() `no-error' condition
- * checks, assuming you want to optimize for the no-error case.
- *
- * * Other than that, if you don't know the likelihood of a test
- * succeeding from empirical or other `hard' evidence, don't
- * make predictions.
- *
- * * These are meant to be used in places that are run `a lot'.
- * It is wasteful to make predictions in code that is run
- * seldomly (e.g. at subsystem initialization time) as the
- * basic block reordering that this affects can often generate
- * larger code.
- */
-#if __GNUC_PREREQ__(2, 96)
-#define __predict_true(exp) __builtin_expect((exp) != 0, 1)
-#define __predict_false(exp) __builtin_expect((exp) != 0, 0)
-#else
-#define __predict_true(exp) (exp)
-#define __predict_false(exp) (exp)
-#endif
-
-/* find least significant bit that is set */
-#define __LOWEST_SET_BIT(__mask) ((((__mask) - 1) & (__mask)) ^ (__mask))
-
-#define __SHIFTOUT(__x, __mask) (((__x) & (__mask)) / __LOWEST_SET_BIT(__mask))
-#define __SHIFTIN(__x, __mask) ((__x) * __LOWEST_SET_BIT(__mask))
-#define __SHIFTOUT_MASK(__mask) __SHIFTOUT((__mask), (__mask))
-
-#if defined(_MSC_VER) /* Handle Microsoft VC++ compiler specifics. */
-
- /* VC++, by default, defines wchar_t as an intrinsic type, equivalent to
- unsigned short. This conflicts which Standard C Library
- implementations which try to define wchar_t.
- Make sure that this behavior has been turned off by using
- /Zc:wchar_t- on the command line.
- */
- #ifdef _NATIVE_WCHAR_T_DEFINED
- #error You must specify /Zc:wchar_t- to the compiler to turn off intrinsic wchar_t.
- #endif
-
- /* Get rid of pre-defined macros that are misleading in this environment. */
- #undef _WIN32
- #undef _WIN64
-
- // Keep compiler quiet about casting from smaller to larger types
- #pragma warning ( disable : 4306 )
-
- #define __STDC__ 1
- #define __STDC_VERSION__ 199409L
- #define __STDC_HOSTED__ 1
-
-#endif /* defined(_MSC_VER) */
-extern int _fltused; // VC++ requires this if you use floating point. KEEP for all compilers.
-
-#define _Bool BOOLEAN
-#define _DIAGASSERT(e)
-
-// Types used to replace long so that it will have constant length regardless of compiler.
-typedef INT32 LONG32;
-typedef UINT32 ULONG32;
-typedef INT64 LONG64;
-typedef UINT64 ULONG64;
-
-typedef INTN EFI_LONG_T;
-typedef UINTN EFI_ULONG_T;
-
-/* These types reflect the compiler's size for long */
-#if defined(__GNUC__)
- #if __GNUC_PREREQ__(4,4)
- /* GCC 4.4 or later */
- typedef INTN LONGN;
- typedef UINTN ULONGN;
- #else
- /* minGW gcc variant */
- typedef INT32 LONGN;
- typedef UINT32 ULONGN;
- #endif /* __GNUC_PREREQ__(4,4) */
-#else /* NOT GCC */
- /* Microsoft or Intel compilers */
- typedef INT32 LONGN;
- typedef UINT32 ULONGN;
-#endif /* defined(__GNUC__) */
-
-#endif /* _EFI_CDEFS_H */
diff --git a/StdLib/Include/sys/EfiSysCall.h b/StdLib/Include/sys/EfiSysCall.h deleted file mode 100644 index 6f4742875e..0000000000 --- a/StdLib/Include/sys/EfiSysCall.h +++ /dev/null @@ -1,350 +0,0 @@ -/** @file
- Function declarations for UEFI "system calls".
-
- The following macros are defined in this file:<BR>
-@verbatim
- STDIN_FILENO 0 standard input file descriptor
- STDOUT_FILENO 1 standard output file descriptor
- STDERR_FILENO 2 standard error file descriptor
- SEEK_SET 0 set file offset to offset
- SEEK_CUR 1 set file offset to current plus offset
- SEEK_END 2 set file offset to EOF plus offset
- VALID_OPEN 1
- VALID_CLOSED 0
- VALID_DONT_CARE -1
-@endverbatim
-
- The following types are defined in this file:<BR>
-@verbatim
- struct stat; Structure declared in <sys/stat.h>
-@endverbatim
-
- The following functions are declared in this file:<BR>
-@verbatim
- ############### System Calls used in stdio.
- int close (int fd);
- ssize_t read (int fd, void *buf, size_t n);
- ssize_t write (int fd, const void *buf, size_t n);
- int unlink (const char *name);
- int dup2 (int, int);
- int rmdir (const char *);
- int isatty (int);
-
- ############### System Calls which are also declared in sys/fcntl.h.
- int open (const char *name, int oflags, int mode);
- int creat (const char *, mode_t);
- int fcntl (int, int, ...);
-
- ############### System Calls which are also declared in stat.h.
- int mkdir (const char *, mode_t);
- int fstat (int, struct stat *);
- int lstat (const char *, struct stat *);
- int stat (const char *, void *);
- int chmod (const char *, mode_t);
-
- ############### System Calls which are also declared in sys/types.h.
- off_t lseek (int, off_t, int);
- int truncate (const char *, off_t);
- int ftruncate (int, off_t); // IEEE Std 1003.1b-93
-
- ############### EFI-specific Functions.
- int DeleteOnClose (int fd); Mark an open file to be deleted when closed.
- int FindFreeFD (int MinFd);
- BOOLEAN ValidateFD (int fd, int IsOpen);
-@endverbatim
-
- Copyright (c) 2010 - 2012, 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.
-**/
-#ifndef _EFI_SYS_CALL_H
-#define _EFI_SYS_CALL_H
-
-#include <sys/EfiCdefs.h>
-#include <sys/types.h>
-
-struct stat; /* Structure declared in <sys/stat.h> */
-
-#define STDIN_FILENO 0 /**< standard input file descriptor */
-#define STDOUT_FILENO 1 /**< standard output file descriptor */
-#define STDERR_FILENO 2 /**< standard error file descriptor */
-
-/* whence values for lseek(2)
- Always ensure that these are consistent with <stdio.h> and <unistd.h>!
-*/
-#ifndef SEEK_SET
- #define SEEK_SET 0 /**< set file offset to offset */
-#endif
-#ifndef SEEK_CUR
- #define SEEK_CUR 1 /**< set file offset to current plus offset */
-#endif
-#ifndef SEEK_END
- #define SEEK_END 2 /**< set file offset to EOF plus offset */
-#endif
-
-// Parameters for the ValidateFD function.
-#define VALID_OPEN 1
-#define VALID_CLOSED 0
-#define VALID_DONT_CARE -1
-
-__BEGIN_DECLS
-/* EFI versions of BSD system calls used in stdio */
-
- /** Close a file or device.
-
- @param[in] fd File Descriptor for the file or device to close.
-
- @retval 0 Successful completion.
- @retval -1 An error occurred, identified by errno.
- - EBADF fd is not a valid File Descriptor.
- - EINTR The function was interrupted by a signal.
- - EIO An I/O error occurred.
- **/
- int close (int fd);
-
- /** Read from a file or device.
-
- @param[in] fd File Descriptor for the file or device to read.
- @param[in] buf Buffer to read data into.
- @param[in] N Maximum number of bytes to read.
-
- @return On successful completion, read returns a non-negative integer
- indicating the number of bytes actually read. Otherwise, it
- returns -1 and sets errno as follows:
- - EAGAIN
- - EWOULDBLOCK
- - EBADF
- - EBADMSG
- - EINTR
- - EINVAL
- - EIO
- - EISDIR
- - EOVERFLOW
- - ECONNRESET
- - ENOTCONN
- - ETIMEDOUT
- - ENOBUFS
- - ENOMEM
- - ENXIO
- **/
- ssize_t read (int fd, void *buf, size_t n);
-
- /** Write to a file or device.
-
- @param[in] fd File Descriptor for the file or device to write.
- @param[in] buf Buffer to write data from.
- @param[in] N Maximum number of bytes to write.
-
- @return On successful completion, write returns a non-negative integer
- indicating the number of bytes actually written. Otherwise, it
- returns -1 and sets errno as follows:
- - EAGAIN
- - EWOULDBLOCK
- - EBADF
- - EFBIG
- - EINTR
- - EINVAL
- - EIO
- - ENOSPC
- - EPIPE
- - ERANGE
- - ECONNRESET
- - ENOBUFS
- - ENXIO
- - ENETDOWN
- - ENETUNREACH
- **/
- ssize_t write (int fd, const void *buf, size_t n);
-
- /** Unlink (delete) a file.
-
- @param[in] name The name of the file to be deleted.
-
- @retval 0 Successful completion.
- @retval -1 Unable to perform operation, errno contains further
- information. The file name is unchanged.
- **/
- int unlink (const char *name);
-
- /** Make file descriptor Fd2 a duplicate of file descriptor Fd1.
-
- @param[in] Fd1 File descriptor to be duplicated
- @param[in] Fd2 File descriptor to become a duplicate of Fd1.
-
- @retval 0 Successful completion.
- @retval -1 Unable to perform operation, errno contains further
- information.
- **/
- int dup2 (int Fd1, int Fd2);
-
- /** Remove a directory.
-
- @param[in] Path Path to the directory to be deleted.
-
- @retval 0 Successful completion.
- @retval -1 Unable to perform operation, errno contains further
- information. The named directory remains unchanged.
- **/
- int rmdir (const char *Path);
-
- /** Determine if fd refers to an interactive terminal device.
-
- @param[in] fd The file descriptor to be tested.
-
- @retval 0 The file descriptor, fd, is not for a terminal. errno is set
- indicating the cause for failure.
- - EBADF fd is not a valid open file descriptor.
- - ENOTTY fd does not refer to a terminal.
- @retval 1 The file descriptor, fd, is for a terminal.
- **/
- int isatty (int fd);
-
-/* These system calls are also declared in sys/fcntl.h */
-#ifndef __FCNTL_SYSCALLS_DECLARED
- #define __FCNTL_SYSCALLS_DECLARED
-
- /** Open or create a file named by name.
-
- The file name may be one of:
- - An absolute path beginning with '/'.
- - A relative path beginning with "." or ".." or a directory name
- - A file name
- - A mapped path which begins with a name followed by a colon, ':'.
-
- Mapped paths are use to refer to specific mass storage volumes or devices.
- In a Shell-hosted environment, the map command will list valid map names
- for both file system and block devices. Mapped paths can also refer to
- devices such as the UEFI console. Supported UEFI console mapped paths are:
- - stdin: Standard Input (from the System Table)
- - stdout: Standard Output (from the System Table)
- - stderr: Standard Error Output (from the System Table)
-
- @param[in] name Name of file to open.
- @param[in] oflags Flags as defined in fcntl.h.
- @param[in] mode Access mode to use if creating the file.
-
- @return Returns -1 on failure, otherwise the file descriptor for the open file.
- **/
- int open (const char *name, int oflags, int mode);
-
- /** Create a new file or rewrite an existing one.
-
- The creat() function behaves as if it is implemented as follows:
-
- int creat(const char *path, mode_t mode)
- {
- return open(path, O_WRONLY|O_CREAT|O_TRUNC, mode);
- }
-
- @param[in] Path The name of the file to create.
- @param[in] Mode Access mode (permissions) for the new file.
-
- @return Returns -1 on failure, otherwise the file descriptor for the open file.
- **/
- int creat (const char *Path, mode_t Mode);
-
- /** File control
-
- This function performs the operations described below and defined in <fcntl.h>.
-
- - F_DUPFD: Return the lowest numbered file descriptor available that is >= the third argument.
- The new file descriptor refers to the same open file as Fd.
-
- - F_SETFD: Set the file descriptor flags to the value specified by the third argument.
- - F_GETFD: Get the file descriptor flags associated with Fd.
- - F_SETFL: Set the file status flags based upon the value of the third argument.
- - F_GETFL: Get the file status flags and access modes for file Fd.
-
- @param[in] Fd File descriptor associated with the file to be controlled.
- @param[in] Cmd Command to execute.
- @param[in] ... Additional arguments, as needed by Cmd.
-
- @return A -1 is returned to indicate failure, otherwise the value
- returned is positive and depends upon Cmd as follows:
- - F_DUPFD: A new file descriptor.
- - F_SETFD: files previous file descriptor flags.
- - F_GETFD: The files file descriptor flags.
- - F_SETFL: The old status flags and access mode of the file.
- - F_GETFL: The status flags and access mode of the file.
- **/
- int fcntl (int Fd, int Cmd, ...);
-#endif // __FCNTL_SYSCALLS_DECLARED
-
-/* These system calls are also declared in stat.h */
-#ifndef __STAT_SYSCALLS_DECLARED
- #define __STAT_SYSCALLS_DECLARED
-
- int mkdir (const char *, mode_t);
- int fstat (int, struct stat *);
- int lstat (const char *, struct stat *);
- int stat (const char *, struct stat *);
- int chmod (const char *, mode_t);
- mode_t umask (mode_t cmask);
-
-#endif // __STAT_SYSCALLS_DECLARED
-
-// These are also declared in sys/types.h
-#ifndef __OFF_T_SYSCALLS_DECLARED
- #define __OFF_T_SYSCALLS_DECLARED
- off_t lseek (int, off_t, int);
- int truncate (const char *, off_t);
- int ftruncate (int, off_t); // IEEE Std 1003.1b-93
-#endif /* __OFF_T_SYSCALLS_DECLARED */
-
-/* EFI-specific Functions. */
-
- /** Mark an open file to be deleted when it is closed.
-
- @param[in] fd File descriptor for the open file.
-
- @retval 0 The flag was set successfully.
- @retval -1 An invalid fd was specified.
- **/
- int DeleteOnClose(int fd);
-
- /** Find and reserve a free File Descriptor.
-
- Returns the first free File Descriptor greater than or equal to the,
- already validated, fd specified by Minfd.
-
- @return Returns -1 if there are no free FDs. Otherwise returns the
- found fd.
- */
- int FindFreeFD (int MinFd);
-
- /** Validate that fd refers to a valid file descriptor.
- IsOpen is interpreted as follows:
- - Positive fd must be OPEN
- - Zero fd must be CLOSED
- - Negative fd may be OPEN or CLOSED
-
- @retval TRUE fd is VALID
- @retval FALSE fd is INVALID
- */
- BOOLEAN ValidateFD (int fd, int IsOpen);
-
-
-/* These system calls don't YET have EFI implementations. */
- int reboot (int, char *);
-__END_DECLS
-
-/* The console output stream, stdout, supports cursor positioning via the
- lseek() function call. The following entities facilitate packing the
- X and Y coordinates into the offset parameter of the lseek call.
-*/
-typedef struct {
- UINT32 Column;
- UINT32 Row;
-} CURSOR_XY;
-
-typedef union {
- UINT64 Offset;
- CURSOR_XY XYpos;
-} XY_OFFSET;
-
-#endif /* _EFI_SYS_CALL_H */
diff --git a/StdLib/Include/sys/_ctype.h b/StdLib/Include/sys/_ctype.h deleted file mode 100644 index cb06ec09dd..0000000000 --- a/StdLib/Include/sys/_ctype.h +++ /dev/null @@ -1,68 +0,0 @@ -/** @file
- Implementation specific support for Single-byte character classification and
- case conversion macros and function declarations.
-
- This file is intended to only be included by <ctype.h>.
-
- 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.
-**/
-#ifndef _CTYPE_H
-#error This file, <sys/_ctype.h>, may only be included by <ctype.h>.
-#endif
-
-__BEGIN_DECLS
-extern const UINT16 *_cClass; ///< Locale independent pointer to Character Classification Table.
-extern const UINT8 *_uConvT; ///< Locale independent pointer to Lowercase to Uppercase Conversion Table.
-extern const UINT8 *_lConvT; ///< Locale independent pointer to Uppercase to Lowercase Conversion Table.
-
-extern int __isCClass( int _c, unsigned int mask); ///< Internal character classification function.
-__END_DECLS
-
-
-/** @{
-Character Class bit masks.
-**/
-#define _CC 0x0001U ///< Control Characters
-#define _CW 0x0002U ///< White Space
-#define _CP 0x0004U ///< Punctuation
-#define _CD 0x0008U ///< Digits [0-9]
-#define _CU 0x0010U ///< Uppercase Letter [A-Z]
-#define _CL 0x0020U ///< Lowercase Letter [a-z]
-#define _CX 0x0040U ///< Hexadecimal Digits [A-Fa-f]
-#define _C0 0x0080U ///< Path Separator Characters, '/' and '\\'
-#define _CS 0x0100U ///< Space Characters, ' ' in C locale
-#define _CG 0x0200U ///< Graphic Characters
-#define _CB 0x0400U ///< Blank Characters, ' ' and '\t' in C locale
-#define _C4 0x0800U
-#define _XA 0x1000U ///< eXtra Alpha characters not in _CU or _CL
-#define _C6 0x2000U
-#define _C7 0x4000U
-#define _C8 0x8000U
-/// @}
-
-#ifndef NO_CTYPE_MACROS
- #define __isCClass( _c, mask) (((_c) < 0 || (_c) > 127) ? 0 : (_cClass[(_c)] & (mask)))
- #define __toLower( _c) ((__isCClass( ((int)_c), (_CU))) ? _lConvT[(_c)] : (_c))
- #define __toUpper( _c) ((__isCClass( ((int)_c), (_CL))) ? _uConvT[(_c)] : (_c))
-#endif /* NO_CTYPE_MACROS */
-
-/* Macros used by implementation functions */
-#define __isHexLetter(_c) (__isCClass( (int)c, (_CX)))
-
-#ifdef _CTYPE_PRIVATE
- #define _CTYPE_NUM_CHARS (256)
-
- #define _CTYPE_ID "BSDCTYPE"
- #define _CTYPE_REV 2
-
- extern const UINT16 _C_CharClassTable[];
- extern const UINT8 _C_ToUpperTable[];
- extern const UINT8 _C_ToLowerTable[];
-#endif
diff --git a/StdLib/Include/sys/_posix.h b/StdLib/Include/sys/_posix.h deleted file mode 100644 index 706cf7edb4..0000000000 --- a/StdLib/Include/sys/_posix.h +++ /dev/null @@ -1,97 +0,0 @@ -#ifndef _SYS__POSIX_H_
-#define _SYS__POSIX_H_
-
-/*-
- * Copyright (c) 1998 HD Associates, Inc.
- * All rights reserved.
- * contact: dufault@hda.com
- *
- * 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.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR 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.
- *
- * $Id: _posix.h,v 1.1.1.1 2006/05/30 06:13:04 hhzhou Exp $
- */
-
-/*
- * This is a stand alone header file to set up for feature specification
- * defined to take place before the inclusion of any standard header.
- * It should only handle pre-processor defines.
- *
- * See section B.2.7 of 1003.1b-1993
- *
- */
-
-#ifdef KERNEL
-
-#if !defined(ACTUALLY_LKM_NOT_KERNEL) && !defined(KLD_MODULE)
-#include "opt_posix.h"
-#endif
-
-/* Only kern_mib.c uses _POSIX_VERSION. Introduce a kernel
- * one to avoid other pieces of the kernel getting dependant
- * on that.
- * XXX Complain if you think this dumb.
- */
-
-/* Make P1003 structures visible for the kernel if
- * the P1003_1B option is in effect.
- */
-#ifdef P1003_1B
-#define _P1003_1B_VISIBLE
-#ifndef _KPOSIX_VERSION
-#define _KPOSIX_VERSION 199309L
-#endif
-#endif
-
-#ifndef _KPOSIX_VERSION
-#define _KPOSIX_VERSION 199009L
-#endif
-
-#define _P1003_1B_VISIBLE_HISTORICALLY
-
-#else
-
-/* Default to existing user space version.
- */
-#ifndef _POSIX_VERSION
-#define _POSIX_VERSION 199009L
-#endif
-
-/* Test for visibility of P1003.1B features:
- * If _POSIX_SOURCE and POSIX_C_SOURCE are completely undefined
- * they show up.
- *
- * If they specify a version including P1003.1B then they show up.
- *
- * (Two macros are added to permit hiding new extensions while
- * keeping historic BSD features - that is not done now)
- *
- */
-
-#if (!defined(_POSIX_SOURCE) && !defined(_POSIX_C_SOURCE)) || \
- (_POSIX_VERSION >= 199309L && defined(_POSIX_C_SOURCE) && \
- _POSIX_C_SOURCE >= 199309L)
-#define _P1003_1B_VISIBLE
-#define _P1003_1B_VISIBLE_HISTORICALLY
-#endif
-
-#endif /* not KERNEL */
-#endif /* _SYS__POSIX_H_ */
diff --git a/StdLib/Include/sys/ansi.h b/StdLib/Include/sys/ansi.h deleted file mode 100644 index f8489fa2e5..0000000000 --- a/StdLib/Include/sys/ansi.h +++ /dev/null @@ -1,63 +0,0 @@ -/** @file
- ANSI type definitions.
-
- 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) 1990, 1993
- The Regents of the University of California. All rights reserved.
-
- This code is derived from software contributed to The NetBSD Foundation
- by Jun-ichiro itojun Hagino and by Klaus Klein.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions
- are met:
- - Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
- - 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.
- - 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 COPYRIGHT HOLDERS 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 COPYRIGHT HOLDERS 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: ansi.h,v 1.11 2005/12/11 12:25:20 christos Exp
-**/
-#ifndef _SYS_ANSI_H_
-#define _SYS_ANSI_H_
-
-#include <machine/int_types.h>
-
-typedef INT8 * __caddr_t; ///< core address
-typedef __uint32_t __gid_t; ///< group id
-typedef __uint32_t __in_addr_t; ///< IP(v4) address
-typedef __uint16_t __in_port_t; ///< "Internet" port number
-typedef __uint32_t __mode_t; ///< file permissions
-typedef __int64_t __off_t; ///< file offset
-typedef __int32_t __pid_t; ///< process id
-typedef __uint8_t __sa_family_t; ///< socket address family
-typedef UINT32 __socklen_t; ///< socket-related datum length
-typedef __uint32_t __uid_t; ///< user id
-typedef __uint64_t __fsblkcnt_t; ///< fs block count (statvfs)
-typedef __uint64_t __fsfilcnt_t; ///< fs file count
-
-#endif /* !_SYS_ANSI_H_ */
diff --git a/StdLib/Include/sys/bswap.h b/StdLib/Include/sys/bswap.h deleted file mode 100644 index a9284eb81d..0000000000 --- a/StdLib/Include/sys/bswap.h +++ /dev/null @@ -1,77 +0,0 @@ -/* $NetBSD: bswap.h,v 1.12 2006/05/22 16:28:27 drochner Exp $ */
-
-/* Written by Manuel Bouyer. Public domain */
-
-#ifndef _SYS_BSWAP_H_
-#define _SYS_BSWAP_H_
-
-#ifndef _LOCORE
-#include <sys/EfiCdefs.h>
-#include <sys/types.h>
-
-#include <machine/bswap.h>
-
-__BEGIN_DECLS
-/* Always declare the functions in case their address is taken (etc) */
-#if !defined(__BSWAP_RENAME)
-uint16_t bswap16(uint16_t) __attribute__((__const__));
-uint32_t bswap32(uint32_t) __attribute__((__const__));
-#else
-uint16_t bswap16(uint16_t) __RENAME(__bswap16) __attribute__((__const__));
-uint32_t bswap32(uint32_t) __RENAME(__bswap32) __attribute__((__const__));
-#endif
-uint64_t bswap64(uint64_t) __attribute__((__const__));
-__END_DECLS
-
-#if defined(__GNUC__) && defined(__OPTIMIZE__)
-
-/* machine/byte_swap.h might have defined inline versions */
-#ifndef __BYTE_SWAP_U64_VARIABLE
-#define __BYTE_SWAP_U64_VARIABLE bswap64
-#endif
-
-#ifndef __BYTE_SWAP_U32_VARIABLE
-#define __BYTE_SWAP_U32_VARIABLE bswap32
-#endif
-
-#ifndef __BYTE_SWAP_U16_VARIABLE
-#define __BYTE_SWAP_U16_VARIABLE bswap16
-#endif
-
-#define __byte_swap_u64_constant(x) \
- ((uint64_t) \
- ((((x) & 0xff00000000000000ull) >> 56) | \
- (((x) & 0x00ff000000000000ull) >> 40) | \
- (((x) & 0x0000ff0000000000ull) >> 24) | \
- (((x) & 0x000000ff00000000ull) >> 8) | \
- (((x) & 0x00000000ff000000ull) << 8) | \
- (((x) & 0x0000000000ff0000ull) << 24) | \
- (((x) & 0x000000000000ff00ull) << 40) | \
- (((x) & 0x00000000000000ffull) << 56)))
-
-#define __byte_swap_u32_constant(x) \
- ((((x) & 0xff000000) >> 24) | \
- (((x) & 0x00ff0000) >> 8) | \
- (((x) & 0x0000ff00) << 8) | \
- (((x) & 0x000000ff) << 24))
-
-#define __byte_swap_u16_constant(x) \
- ((((x) & 0xff00) >> 8) | \
- (((x) & 0x00ff) << 8))
-
-#define bswap64(x) \
- (__builtin_constant_p((x)) ? \
- __byte_swap_u64_constant(x) : __BYTE_SWAP_U64_VARIABLE(x))
-
-#define bswap32(x) \
- (__builtin_constant_p((x)) ? \
- __byte_swap_u32_constant(x) : __BYTE_SWAP_U32_VARIABLE(x))
-
-#define bswap16(x) \
- (__builtin_constant_p((x)) ? \
- __byte_swap_u16_constant(x) : __BYTE_SWAP_U16_VARIABLE(x))
-
-#endif /* __GNUC__ && __OPTIMIZE__ */
-#endif /* !_LOCORE */
-
-#endif /* !_SYS_BSWAP_H_ */
diff --git a/StdLib/Include/sys/callout.h b/StdLib/Include/sys/callout.h deleted file mode 100644 index b3768199fa..0000000000 --- a/StdLib/Include/sys/callout.h +++ /dev/null @@ -1,131 +0,0 @@ -/* $NetBSD: callout.h,v 1.22 2005/12/11 12:25:20 christos Exp $ */
-
-/*-
- * Copyright (c) 2000, 2003 The NetBSD Foundation, Inc.
- * All rights reserved.
- *
- * This code is derived from software contributed to The NetBSD Foundation
- * by Jason R. Thorpe of the Numerical Aerospace Simulation Facility,
- * NASA Ames Research Center.
- *
- * 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.
- */
-
-/*
- * Copyright (c) 2000-2001 Artur Grabowski <art@openbsd.org>
- * 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. The name of the author may not be used to endorse or promote products
- * derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED ``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 AUTHOR 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 _SYS_CALLOUT_H_
-#define _SYS_CALLOUT_H_
-
-/*
- * The following funkyness is to appease gcc3's strict aliasing.
- */
-struct callout;
-struct callout_circq {
- /* next element */
- union {
- struct callout *elem;
- struct callout_circq *list;
- } cq_next;
- /* previous element */
- union {
- struct callout *elem;
- struct callout_circq *list;
- } cq_prev;
-};
-#define cq_next_e cq_next.elem
-#define cq_prev_e cq_prev.elem
-#define cq_next_l cq_next.list
-#define cq_prev_l cq_prev.list
-
-struct callout {
- struct callout_circq c_list; /* linkage on queue */
- void (*c_func)(void *); /* function to call */
- void *c_arg; /* function argument */
- int c_time; /* when callout fires */
- int c_flags; /* state of this entry */
-};
-
-#define CALLOUT_PENDING 0x0002 /* callout is on the queue */
-#define CALLOUT_FIRED 0x0004 /* callout has fired */
-#define CALLOUT_INVOKING 0x0008 /* callout function is being invoked */
-
-#define CALLOUT_INITIALIZER_SETFUNC(func, arg) \
- { {{NULL}, {NULL}}, func, arg, 0, 0 }
-
-#define CALLOUT_INITIALIZER CALLOUT_INITIALIZER_SETFUNC(NULL, NULL)
-
-#ifdef _KERNEL
-void callout_startup(void);
-void callout_init(struct callout *);
-void callout_setfunc(struct callout *, void (*)(void *), void *);
-void callout_reset(struct callout *, int, void (*)(void *), void *);
-void callout_schedule(struct callout *, int);
-void callout_stop(struct callout *);
-int callout_hardclock(void);
-
-#define callout_setfunc(c, f, a) \
-do { \
- (c)->c_func = (f); \
- (c)->c_arg = (a); \
-} while (/*CONSTCOND*/0)
-
-#define callout_pending(c) ((c)->c_flags & CALLOUT_PENDING)
-#define callout_expired(c) ((c)->c_flags & CALLOUT_FIRED)
-#define callout_active(c) ((c)->c_flags & (CALLOUT_PENDING|CALLOUT_FIRED))
-#define callout_invoking(c) ((c)->c_flags & CALLOUT_INVOKING)
-#define callout_ack(c) ((c)->c_flags &= ~CALLOUT_INVOKING)
-#endif /* _KERNEL */
-
-#endif /* !_SYS_CALLOUT_H_ */
diff --git a/StdLib/Include/sys/cdefs.h b/StdLib/Include/sys/cdefs.h deleted file mode 100644 index c6e3d7b120..0000000000 --- a/StdLib/Include/sys/cdefs.h +++ /dev/null @@ -1,15 +0,0 @@ -/** @file
- Wrapper to allow existing references to <sys/cdefs.h>,
- in code being ported, to work.
-
- Copyright (c) 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.
-**/
-
-#include <sys/EfiCdefs.h>
diff --git a/StdLib/Include/sys/cdefs_aout.h b/StdLib/Include/sys/cdefs_aout.h deleted file mode 100644 index 2eb0a90266..0000000000 --- a/StdLib/Include/sys/cdefs_aout.h +++ /dev/null @@ -1,136 +0,0 @@ -/* $NetBSD: cdefs_aout.h,v 1.20 2006/05/18 17:55:38 christos Exp $ */
-
-/*
- * Written by J.T. Conklin <jtc@wimsey.com> 01/17/95.
- * Public domain.
- */
-
-#ifndef _SYS_CDEFS_AOUT_H_
-#define _SYS_CDEFS_AOUT_H_
-
-#define _C_LABEL(x) __CONCAT(_,x)
-#define _C_LABEL_STRING(x) "_"x
-
-#define ___RENAME(x)
-
-#define __indr_reference(sym,alias) /* nada, since we do weak refs */
-
-#ifdef __GNUC__
-#if __STDC__
- #ifndef DONT_USE_STRONG_WEAK_ALIAS
- #define __strong_alias(alias,sym) \
- __asm(".global " _C_LABEL_STRING(#alias) "\n" \
- _C_LABEL_STRING(#alias) " = " _C_LABEL_STRING(#sym));
- #define __weak_alias(alias,sym) \
- __asm(".weak " _C_LABEL_STRING(#alias) "\n" \
- _C_LABEL_STRING(#alias) " = " _C_LABEL_STRING(#sym));
-
- /* Do not use __weak_extern, use __weak_reference instead */
- #define __weak_extern(sym) \
- __asm(".weak " _C_LABEL_STRING(#sym));
-
- #if __GNUC_PREREQ__(4, 0)
- #define __weak_reference(sym) __attribute__((__weakref__))
- #else
- #define __weak_reference(sym) ; __asm(".weak " _C_LABEL_STRING(#sym))
- #endif
-
- #define __warn_references(sym,msg) \
- __asm(".stabs \"" msg "\",30,0,0,0"); \
- __asm(".stabs \"_" #sym "\",1,0,0,0");
- #else
- #define __strong_alias(alias,sym) /* NOTHING */
- #define __weak_alias(alias,sym) /* NOTHING */
- #define __weak_extern(sym) /* NOTHING */
- #define __weak_reference(sym) /* NOTHING */
-
- #if defined(__CC_ARM) || defined(__APPLE__)
- #define __warn_references(sym,msg)
- #else
- #define __warn_references(sym,msg) \
- __asm(".stabs \"" msg "\",30,0,0,0"); \
- __asm(".stabs \"_" #sym "\",1,0,0,0");
- #endif
- #endif
-#else /* __STDC__ */
- #define __weak_alias(alias,sym) ___weak_alias(_/**/alias,_/**/sym)
- #define ___weak_alias(alias,sym) \
- __asm(".weak alias\nalias = sym");
- /* Do not use __weak_extern, use __weak_reference instead */
- #define __weak_extern(sym) ___weak_extern(_/**/sym)
- #define ___weak_extern(sym) \
- __asm(".weak sym");
-
- #if __GNUC_PREREQ__(4, 0)
- #define __weak_reference(sym) __attribute__((__weakref__))
- #else
- #define ___weak_reference(sym) ; __asm(".weak sym");
- #define __weak_reference(sym) ___weak_reference(_/**/sym)
- #endif
-
- #define __warn_references(sym,msg) \
- __asm(".stabs msg,30,0,0,0"); \
- __asm(".stabs \"_/**/sym\",1,0,0,0");
-#endif /* __STDC__ */
-#else /* __GNUC__ */
- #define __warn_references(sym,msg)
-#endif /* __GNUC__ */
-
-#if defined(__sh__) /* XXX SH COFF */
-#undef __indr_reference(sym,alias)
-#undef __warn_references(sym,msg)
-#define __warn_references(sym,msg)
-#endif
-
-#define __IDSTRING(_n,_s) \
- __asm(".data ; .asciz \"" _s "\" ; .text")
-
-#undef __KERNEL_RCSID
-
-//#define __RCSID(_s) __IDSTRING(rcsid,_s)
-#define __RCSID(_s)
-#define __SCCSID(_s)
-#define __SCCSID2(_s)
-#if 0 /* XXX userland __COPYRIGHTs have \ns in them */
-#define __COPYRIGHT(_s) __IDSTRING(copyright,_s)
-#else
-#define __COPYRIGHT(_s) \
- static const char copyright[] __attribute__((__unused__)) = _s
-#endif
-
-#if defined(USE_KERNEL_RCSIDS) || !defined(_KERNEL)
-#define __KERNEL_RCSID(_n,_s) __IDSTRING(__CONCAT(rcsid,_n),_s)
-#else
-#define __KERNEL_RCSID(_n,_s)
-#endif
-#define __KERNEL_SCCSID(_n,_s)
-#define __KERNEL_COPYRIGHT(_n, _s) __IDSTRING(__CONCAT(copyright,_n),_s)
-
-#ifndef __lint__
-#define __link_set_make_entry(set, sym, type) \
- static void const * const \
- __link_set_##set##_sym_##sym __used = &sym; \
- __asm(".stabs \"___link_set_" #set "\", " #type ", 0, 0, _" #sym)
-#else
-#define __link_set_make_entry(set, sym, type) \
- extern void const * const __link_set_##set##_sym_##sym
-#endif /* __lint__ */
-
-#define __link_set_add_text(set, sym) __link_set_make_entry(set, sym, 23)
-#define __link_set_add_rodata(set, sym) __link_set_make_entry(set, sym, 23)
-#define __link_set_add_data(set, sym) __link_set_make_entry(set, sym, 25)
-#define __link_set_add_bss(set, sym) __link_set_make_entry(set, sym, 27)
-
-#define __link_set_decl(set, ptype) \
-extern struct { \
- int __ls_length; \
- ptype *__ls_items[1]; \
-} __link_set_##set
-
-#define __link_set_start(set) (&(__link_set_##set).__ls_items[0])
-#define __link_set_end(set) \
- (&(__link_set_##set).__ls_items[(__link_set_##set).__ls_length])
-
-#define __link_set_count(set) ((__link_set_##set).__ls_length)
-
-#endif /* !_SYS_CDEFS_AOUT_H_ */
diff --git a/StdLib/Include/sys/dirent.h b/StdLib/Include/sys/dirent.h deleted file mode 100644 index 2c171de5b7..0000000000 --- a/StdLib/Include/sys/dirent.h +++ /dev/null @@ -1,144 +0,0 @@ -/** @file
- Declarations pertaining to directory entries under the UEFI environment.
-
- The information is based upon the EFI_FILE_INFO structure
- in MdePkg/Include/Guid/FileInfo.h.
-
- 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
- which 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) 1989, 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.
-
- @(#)dirent.h 8.3 (Berkeley) 8/10/94
- NetBSD: dirent.h,v 1.23 2005/12/26 18:41:36 perry Exp
-**/
-#ifndef _SYS_DIRENT_H_
-#define _SYS_DIRENT_H_
-
-#include <Uefi.h>
-
-#include <sys/featuretest.h>
-#include <time.h>
-#include <sys/time.h>
-
-#define MAXNAMLEN 511
-
-/*
- * The dirent structure defines the format of directory entries returned by
- * read(fd, ...) when fd refers to a directory.
- *
- * All names are wide characters and are guaranteed to be null terminated.
- * The maximum length of a name in a directory is MAXNAMLEN.
- *
- * This structure is identical to the EFI_FILE_INFO structure. A new
- * structure is declared because one must be able to refer to it
- * as struct dirent.
- */
-struct dirent {
- UINT64 Size; // (d_reclen) Size of this dirent structure instance,
- // including the Null-terminated FileName string.
- UINT64 FileSize; // The size of the file in bytes.
- UINT64 PhysicalSize; // The amount of physical space the file consumes
- // on the file system volume.
- EFI_TIME CreateTime; // The time the file was created.
- EFI_TIME LastAccessTime; // The time when the file was last accessed.
- EFI_TIME ModificationTime; // The time when the file's contents were last modified.
- UINT64 Attribute; // (d_type) The attribute bits for the file. See below.
- CHAR16 FileName[1]; // (d_name) The Null-terminated name of the file.
-};
-
-/* For compatibility */
-#define d_name FileName
-#define d_type Attribute
-#define d_reclen Size
-
-
-/*
- * File Attributes
- */
-#define DT_UNKNOWN 0
-#define DT_READ_ONLY 0x0000000000000001
-#define DT_HIDDEN 0x0000000000000002
-#define DT_SYSTEM 0x0000000000000004
-#define DT_RESERVED 0x0000000000000008
-#define DT_DIRECTORY 0x0000000000000010
-#define DT_ARCHIVE 0x0000000000000020
-#define DT_CHR 0x0000000000010000 // File attaches to a character device
-#define DT_BLK 0x0000000000020000 // File attaches to a block device
-#define DT_SOCKET 0x0000000000030000 // File attaches to a socket
-#define DT_VALID_ATTR 0x0000000000030037 // Mask for valid attribute bits
-
-/*
- * The _DIRENT_ALIGN macro returns the alignment of struct dirent.
- * struct dirent uses 8.
- */
-#define _DIRENT_ALIGN(dp) (sizeof((dp)->Size) - 1)
-
-/*
- * The _DIRENT_NAMEOFF macro returns the offset of the d_name field in
- * struct dirent
- */
-#define _DIRENT_NAMEOFF(dp) \
- ((char *)(void *)&(dp)->FileName - (char *)(void *)dp)
-
-/*
- * The _DIRENT_RECLEN macro gives the minimum record length which will hold
- * a name of size "namlen". This requires the amount of space in struct dirent
- * without the d_name field, plus enough space for the name with a terminating
- * null byte (namlen+1), rounded up to a the appropriate byte boundary.
- */
-#define _DIRENT_RECLEN(dp, namlen) \
- ((_DIRENT_NAMEOFF(dp) + (namlen) + 1 + _DIRENT_ALIGN(dp)) & \
- ~_DIRENT_ALIGN(dp))
-
-#define _DIRENT_NAMELEN(dp) \
- ((dp)->Size - _DIRENT_NAMEOFF(dp) - 1)
-
-/*
- * The _DIRENT_SIZE macro returns the minimum record length required for
- * name name stored in the current record.
- */
-#define _DIRENT_SIZE(dp) _DIRENT_RECLEN(dp, _DIRENT_NAMELEN(dp))
-
-/*
- * The _DIRENT_NEXT macro advances to the next dirent record.
- */
-#define _DIRENT_NEXT(dp) ((void *)((char *)(void *)(dp) + (dp)->Size))
-
-/*
- * The _DIRENT_MINSIZE returns the size of an empty (invalid) record.
- */
-#define _DIRENT_MINSIZE(dp) _DIRENT_RECLEN(dp, 0)
-
-#endif /* !_SYS_DIRENT_H_ */
diff --git a/StdLib/Include/sys/endian.h b/StdLib/Include/sys/endian.h deleted file mode 100644 index dfe013fa40..0000000000 --- a/StdLib/Include/sys/endian.h +++ /dev/null @@ -1,309 +0,0 @@ -/** @file
- Byte order related definitions and declarations.
-
- 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) 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:
- - Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
- - 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.
- - 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 COPYRIGHT HOLDERS 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 COPYRIGHT HOLDERS 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: endian.h,v 1.24 2006/05/05 15:08:11 christos Exp
- endian.h 8.1 (Berkeley) 6/11/93
-**/
-#ifndef _SYS_ENDIAN_H_
-#define _SYS_ENDIAN_H_
-
-#include <sys/EfiCdefs.h>
-
-/*
- * Definitions for byte order, according to byte significance from low
- * address to high.
- */
-#define _LITTLE_ENDIAN 1234 /* LSB first: i386, vax */
-#define _BIG_ENDIAN 4321 /* MSB first: 68000, ibm, net */
-#define _PDP_ENDIAN 3412 /* LSB first in word, MSW first in long */
-
-
-#if defined(_XOPEN_SOURCE) || defined(_NETBSD_SOURCE)
-#ifndef _LOCORE
-
-/* C-family endian-ness definitions */
-
-#include <sys/ansi.h>
-#include <sys/types.h>
-
-#ifndef in_addr_t
-typedef __in_addr_t in_addr_t;
-#define in_addr_t __in_addr_t
-#endif
-
-#ifndef in_port_t
-typedef __in_port_t in_port_t;
-#define in_port_t __in_port_t
-#endif
-
-__BEGIN_DECLS
-uint32_t htonl(uint32_t) __attribute__((__const__));
-uint16_t htons(uint16_t) __attribute__((__const__));
-uint32_t ntohl(uint32_t) __attribute__((__const__));
-uint16_t ntohs(uint16_t) __attribute__((__const__));
-__END_DECLS
-
-#endif /* !_LOCORE */
-#endif /* _XOPEN_SOURCE || _NETBSD_SOURCE */
-
-
-#include <machine/endian_machdep.h>
-
-/*
- * Define the order of 32-bit words in 64-bit words.
- */
-#if _BYTE_ORDER == _LITTLE_ENDIAN
-#define _QUAD_HIGHWORD 1
-#define _QUAD_LOWWORD 0
-#endif
-
-#if _BYTE_ORDER == _BIG_ENDIAN
-#define _QUAD_HIGHWORD 0
-#define _QUAD_LOWWORD 1
-#endif
-
-
-#if defined(_XOPEN_SOURCE) || defined(_NETBSD_SOURCE)
-/*
- * Traditional names for byteorder. These are defined as the numeric
- * sequences so that third party code can "#define XXX_ENDIAN" and not
- * cause errors.
- */
-#define LITTLE_ENDIAN 1234 /* LSB first: i386, vax */
-#define BIG_ENDIAN 4321 /* MSB first: 68000, ibm, net */
-#define PDP_ENDIAN 3412 /* LSB first in word, MSW first in long */
-#define BYTE_ORDER _BYTE_ORDER
-
-#ifndef _LOCORE
-
-#include <machine/bswap.h>
-
-/*
- * Macros for network/external number representation conversion.
- */
-#if BYTE_ORDER == BIG_ENDIAN && !defined(__lint__)
-#define ntohl(x) (x)
-#define ntohs(x) (x)
-#define htonl(x) (x)
-#define htons(x) (x)
-
-#define NTOHL(x) (void) (x)
-#define NTOHS(x) (void) (x)
-#define HTONL(x) (void) (x)
-#define HTONS(x) (void) (x)
-
-#else /* LITTLE_ENDIAN || !defined(__lint__) */
-
-#define ntohl(x) bswap32((uint32_t)(x))
-#define ntohs(x) bswap16((uint16_t)(x))
-#define htonl(x) bswap32((uint32_t)(x))
-#define htons(x) bswap16((uint16_t)(x))
-
-#define NTOHL(x) (x) = ntohl((uint32_t)(x))
-#define NTOHS(x) (x) = ntohs((uint16_t)(x))
-#define HTONL(x) (x) = htonl((uint32_t)(x))
-#define HTONS(x) (x) = htons((uint16_t)(x))
-#endif /* LITTLE_ENDIAN || !defined(__lint__) */
-
-/*
- * Macros to convert to a specific endianness.
- */
-
-#if BYTE_ORDER == BIG_ENDIAN
-
-#define htobe16(x) (x)
-#define htobe32(x) (x)
-#define htobe64(x) (x)
-#define htole16(x) bswap16((uint16_t)(x))
-#define htole32(x) bswap32((uint32_t)(x))
-#define htole64(x) bswap64((uint64_t)(x))
-
-#define HTOBE16(x) (void) (x)
-#define HTOBE32(x) (void) (x)
-#define HTOBE64(x) (void) (x)
-#define HTOLE16(x) (x) = bswap16((uint16_t)(x))
-#define HTOLE32(x) (x) = bswap32((uint32_t)(x))
-#define HTOLE64(x) (x) = bswap64((uint64_t)(x))
-
-#else /* LITTLE_ENDIAN */
-
-#define htobe16(x) bswap16((uint16_t)(x))
-#define htobe32(x) bswap32((uint32_t)(x))
-#define htobe64(x) bswap64((uint64_t)(x))
-#define htole16(x) (x)
-#define htole32(x) (x)
-#define htole64(x) (x)
-
-#define HTOBE16(x) (x) = bswap16((uint16_t)(x))
-#define HTOBE32(x) (x) = bswap32((uint32_t)(x))
-#define HTOBE64(x) (x) = bswap64((uint64_t)(x))
-#define HTOLE16(x) (void) (x)
-#define HTOLE32(x) (void) (x)
-#define HTOLE64(x) (void) (x)
-
-#endif /* LITTLE_ENDIAN */
-
-#define be16toh(x) htobe16(x)
-#define be32toh(x) htobe32(x)
-#define be64toh(x) htobe64(x)
-#define le16toh(x) htole16(x)
-#define le32toh(x) htole32(x)
-#define le64toh(x) htole64(x)
-
-#define BE16TOH(x) HTOBE16(x)
-#define BE32TOH(x) HTOBE32(x)
-#define BE64TOH(x) HTOBE64(x)
-#define LE16TOH(x) HTOLE16(x)
-#define LE32TOH(x) HTOLE32(x)
-#define LE64TOH(x) HTOLE64(x)
-
-/*
- * Routines to encode/decode big- and little-endian multi-octet values
- * to/from an octet stream.
- */
-
-static __inline void __unused
-be16enc(void *buf, uint16_t u)
-{
- uint8_t *p = (uint8_t *)buf;
-
- p[0] = (uint8_t)(((unsigned)u >> 8) & 0xff);
- p[1] = (uint8_t)(u & 0xff);
-}
-
-static __inline void __unused
-le16enc(void *buf, uint16_t u)
-{
- uint8_t *p = (uint8_t *)buf;
-
- p[0] = (uint8_t)(u & 0xff);
- p[1] = (uint8_t)(((unsigned)u >> 8) & 0xff);
-}
-
-static __inline uint16_t __unused
-be16dec(const void *buf)
-{
- const uint8_t *p = (const uint8_t *)buf;
-
- return ((p[0] << 8) | p[1]);
-}
-
-static __inline uint16_t __unused
-le16dec(const void *buf)
-{
- const uint8_t *p = (const uint8_t *)buf;
-
- return ((p[1] << 8) | p[0]);
-}
-
-static __inline void __unused
-be32enc(void *buf, uint32_t u)
-{
- uint8_t *p = (uint8_t *)buf;
-
- p[0] = (uint8_t)((u >> 24) & 0xff);
- p[1] = (uint8_t)((u >> 16) & 0xff);
- p[2] = (uint8_t)((u >> 8) & 0xff);
- p[3] = (uint8_t)(u & 0xff);
-}
-
-static __inline void __unused
-le32enc(void *buf, uint32_t u)
-{
- uint8_t *p = (uint8_t *)buf;
-
- p[0] = (uint8_t)(u & 0xff);
- p[1] = (uint8_t)((u >> 8) & 0xff);
- p[2] = (uint8_t)((u >> 16) & 0xff);
- p[3] = (uint8_t)((u >> 24) & 0xff);
-}
-
-static __inline uint32_t __unused
-be32dec(const void *buf)
-{
- const uint8_t *p = (const uint8_t *)buf;
-
- return ((p[0] << 24) | (p[1] << 16) | (p[2] << 8) | p[3]);
-}
-
-static __inline uint32_t __unused
-le32dec(const void *buf)
-{
- const uint8_t *p = (const uint8_t *)buf;
-
- return ((p[3] << 24) | (p[2] << 16) | (p[1] << 8) | p[0]);
-}
-
-static __inline void __unused
-be64enc(void *buf, uint64_t u)
-{
- uint8_t *p = (uint8_t *)buf;
-
- be32enc(p, (uint32_t)(u >> 32));
- be32enc(p + 4, (uint32_t)(u & 0xffffffffULL));
-}
-
-static __inline void __unused
-le64enc(void *buf, uint64_t u)
-{
- uint8_t *p = (uint8_t *)buf;
-
- le32enc(p, (uint32_t)(u & 0xffffffffULL));
- le32enc(p + 4, (uint32_t)(u >> 32));
-}
-
-static __inline uint64_t __unused
-be64dec(const void *buf)
-{
- const uint8_t *p = (const uint8_t *)buf;
-
- return (((uint64_t)be32dec(p) << 32) | be32dec(p + 4));
-}
-
-static __inline uint64_t __unused
-le64dec(const void *buf)
-{
- const uint8_t *p = (const uint8_t *)buf;
-
- return (le32dec(p) | ((uint64_t)le32dec(p + 4) << 32));
-}
-
-#endif /* !_LOCORE */
-#endif /* _XOPEN_SOURCE || _NETBSD_SOURCE */
-#endif /* !_SYS_ENDIAN_H_ */
diff --git a/StdLib/Include/sys/errno.h b/StdLib/Include/sys/errno.h deleted file mode 100644 index 50c5af6630..0000000000 --- a/StdLib/Include/sys/errno.h +++ /dev/null @@ -1,152 +0,0 @@ -/** @file
- The header <sys/errno.h> defines several values, all relating to the reporting of
- error conditions.
-
- The enum members expand to integral constant expressions
- with distinct nonzero values, suitable for use in #if preprocessing
- directives. These default values are specified as an enum in order to ease
- the maintenance of the values.
-
- Copyright (c) 2011 - 2014, 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.
-**/
-#ifdef _ERRNO_H // May only be included from <errno.h>
-#ifndef _SYS_ERRNO_H
-#define _SYS_ERRNO_H
-
-/* Define the error numbers, sequentially, beginning at 1. */
-enum {
- __ESUCCESS = 0, /* 0 For those rare times one needs to say all is OK */
- __EMINERRORVAL = 1, /* The lowest valid error value */
- __EPERM = __EMINERRORVAL, /* 1 Operation not permitted */
- __ENOENT, /* 2 No such file or directory */
- __ESRCH, /* 3 No such process */
- __EINTR, /* 4 Interrupted system call */
- __EIO, /* 5 Input/output error */
- __ENXIO, /* 6 Device not configured */
- __E2BIG, /* 7 Argument list too long */
- __ENOEXEC, /* 8 Exec format error */
- __EBADF, /* 9 Bad file descriptor */
- __ECHILD, /* 10 No child processes */
- __EDEADLK, /* 11 Resource deadlock avoided */
- __ENOMEM, /* 12 Cannot allocate memory */
- __EACCES, /* 13 Permission denied */
- __EFAULT, /* 14 Bad address */
- __ENOTBLK, /* 15 Block device required */
- __EBUSY, /* 16 Device busy */
- __EEXIST, /* 17 File exists */
- __EXDEV, /* 18 Cross-device link */
- __ENODEV, /* 19 Operation not supported by device */
- __ENOTDIR, /* 20 Not a directory */
- __EISDIR, /* 21 Is a directory */
- __EINVAL, /* 22 Invalid argument */
- __ENFILE, /* 23 Too many open files in system */
- __EMFILE, /* 24 Too many open file descriptors */
- __ENOTTY, /* 25 Inappropriate ioctl for device */
- __ETXTBSY, /* 26 Text file busy */
- __EFBIG, /* 27 File too large */
- __ENOSPC, /* 28 No space left on device */
- __ESPIPE, /* 29 Illegal seek */
- __EROFS, /* 30 Read-only filesystem */
- __EMLINK, /* 31 Too many links */
- __EPIPE, /* 32 Broken pipe */
-
- /* math software -- these are the only two values required by the C Standard */
- __EDOM, /* 33 Numerical argument out of domain */
- __ERANGE, /* 34 Result too large */
-
- /* non-blocking and interrupt i/o */
- __EAGAIN, /* 35 Resource temporarily unavailable */
- __EWOULDBLOCK = __EAGAIN, /* 35 Operation would block */
- __EINPROGRESS, /* 36 Operation now in progress */
- __EALREADY, /* 37 Operation already in progress */
-
- /* ipc/network software -- argument errors */
- __ENOTSOCK, /* 38 Socket operation on non-socket */
- __EDESTADDRREQ, /* 39 Destination address required */
- __EMSGSIZE, /* 40 Message too long */
- __EPROTOTYPE, /* 41 Protocol wrong type for socket */
- __ENOPROTOOPT, /* 42 Protocol not available */
- __EPROTONOSUPPORT, /* 43 Protocol not supported */
- __ESOCKTNOSUPPORT, /* 44 Socket type not supported */
- __EOPNOTSUPP, /* 45 Operation not supported */
- __ENOTSUP = __EOPNOTSUPP, /* 45 Operation not supported */
- __EPFNOSUPPORT, /* 46 Protocol family not supported */
- __EAFNOSUPPORT, /* 47 Address family not supported by protocol family */
- __EADDRINUSE, /* 48 Address already in use */
- __EADDRNOTAVAIL, /* 49 Can't assign requested address */
-
- /* ipc/network software -- operational errors */
- __ENETDOWN, /* 50 Network is down */
- __ENETUNREACH, /* 51 Network is unreachable */
- __ENETRESET, /* 52 Network dropped connection on reset */
- __ECONNABORTED, /* 53 Software caused connection abort */
- __ECONNRESET, /* 54 Connection reset by peer */
- __ENOBUFS, /* 55 No buffer space available */
- __EISCONN, /* 56 Socket is already connected */
- __ENOTCONN, /* 57 Socket is not connected */
- __ESHUTDOWN, /* 58 Can't send after socket shutdown */
- __ETOOMANYREFS, /* 59 Too many references: can't splice */
- __ETIMEDOUT, /* 60 Operation timed out */
- __ECONNREFUSED, /* 61 Connection refused */
- __ELOOP, /* 62 Too many levels of symbolic links */
- __ENAMETOOLONG, /* 63 File name too long */
- __EHOSTDOWN, /* 64 Host is down */
- __EHOSTUNREACH, /* 65 No route to host */
-
- __ENOTEMPTY, /* 66 Directory not empty */
-
- /* quotas, etc. */
- __EPROCLIM, /* 67 Too many processes */
- __EUSERS, /* 68 Too many users */
- __EDQUOT, /* 69 Disc quota exceeded */
-
- /* Network File System */
- __ESTALE, /* 70 Stale NFS file handle */
- __EREMOTE, /* 71 Too many levels of remote in path */
- __EBADRPC, /* 72 RPC struct is bad */
- __ERPCMISMATCH, /* 73 RPC version wrong */
- __EPROGUNAVAIL, /* 74 RPC prog. not avail */
- __EPROGMISMATCH, /* 75 Program version wrong */
- __EPROCUNAVAIL, /* 76 Bad procedure for program */
- __ENOLCK, /* 77 No locks available */
- __ENOSYS, /* 78 Function not implemented */
- __EFTYPE, /* 79 Inappropriate file type or format */
- __EAUTH, /* 80 Authentication error */
- __ENEEDAUTH, /* 81 Need authenticator */
- __EIDRM, /* 82 Identifier removed */
- __ENOMSG, /* 83 No message of desired type */
- __EOVERFLOW, /* 84 Value too large to be stored in data type */
- __EILSEQ, /* 85 Illegal byte sequence */
- __ENOTHING_1, /* 86 Place Holder */
- __ECANCELED, /* 87 Operation canceled */
-
- __EBADMSG, /* 88 Bad message */
- __ENODATA, /* 89 No message available */
- __ENOSR, /* 90 No STREAM resources */
- __ENOSTR, /* 91 Not a STREAM */
- __ETIME, /* 92 STREAM ioctl timeout */
-
- __ENOATTR, /* 93 Attribute not found */
-
- __EDOOFUS, /* 94 Programming error */
-
- __EMULTIHOP, /* 95 Multihop attempted */
- __ENOLINK, /* 96 Link has been severed */
- __EPROTO, /* 97 Protocol error */
-
- __EBUFSIZE, /* 98 Buffer too small to hold result */
-
- __EMAXERRORVAL /* One more than the highest defined error value. */
-};
-
-#endif /* _SYS_ERRNO_H */
-#else /* not defined _ERRNO_H */
-#error <sys/errno.h> must only be included by <errno.h>.
-#endif /* _ERRNO_H */
diff --git a/StdLib/Include/sys/fcntl.h b/StdLib/Include/sys/fcntl.h deleted file mode 100644 index dba4d2471e..0000000000 --- a/StdLib/Include/sys/fcntl.h +++ /dev/null @@ -1,200 +0,0 @@ -/** @file
- This file includes the definitions for open and fcntl described by POSIX
- for <fcntl.h>; it also includes related kernel definitions.
-
- Copyright (c) 2010 - 2014, 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 which
- 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) 1983, 1990, 1993
- The Regents of the University of California. All rights reserved.
- (c) UNIX System Laboratories, Inc.
- All or some portions of this file are derived from material licensed
- to the University of California by American Telephone and Telegraph
- Co. or Unix System Laboratories, Inc. and are reproduced herein with
- the permission of UNIX System Laboratories, Inc.
-
- 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.
-
- fcntl.h 8.3 (Berkeley) 1/21/94
- NetBSD: fcntl.h,v 1.34 2006/10/05 14:48:33 chs Exp
- */
-#ifndef _SYS_FCNTL_H_
-#define _SYS_FCNTL_H_
-
-#include <sys/featuretest.h>
-#include <sys/types.h>
-
-#include <sys/stat.h>
-
-/** @{
- File status flags used by open(2), fcntl(2).
- They are also used (indirectly) in the kernel file structure f_flags,
- which is a superset of the open/fcntl flags.
- Open/fcntl flags begin with O_; kernel-internal flags begin with F.
-**/
-/* open-only flags */
-#define O_RDONLY 0x00000000 ///< open for reading only
-#define O_WRONLY 0x00000001 ///< open for writing only
-#define O_RDWR 0x00000002 ///< open for reading and writing
-#define O_ACCMODE 0x00000003 ///< mask for above modes
-
-#define O_NONBLOCK 0x00000004 ///< no delay
-#define O_APPEND 0x00000008 ///< set append mode
-#define O_CREAT 0x00000200 ///< create if nonexistent
-#define O_TRUNC 0x00000400 ///< truncate to zero length
-#define O_EXCL 0x00000800 ///< Grant EXCLusive access, or error if already exists and O_CREAT
-
-#define O_DIRECTORY 0x00001000 ///< error if path is not a directory
-#define O_NOCTTY 0x00002000 ///< Don't make this the controlling TTY
-#define O_TTY_INIT 0x00004000 ///< Initialize TTY to "sane" values on open
-
-/* UEFI-specific open-only flags. */
-#define O_HIDDEN 0x00010000 ///< Hidden file attribute
-#define O_SYSTEM 0x00020000 ///< System file attribute
-#define O_ARCHIVE 0x00040000 ///< Archive file attribute
-/// @}
-
-#define O_SETMASK 0x0000000F ///< Flags modifiable by F_SETFD (fcntl)
-
-/*
- * Constants used for fcntl(2)
- */
-
-/** @{ command values used for fcntl(2). **/
-#define F_DUPFD 0 ///< duplicate file descriptor
-#define F_GETFD 1 ///< get file descriptor flags
-#define F_SETFD 2 ///< set file descriptor flags
-#define F_GETFL 3 ///< get file status flags
-#define F_SETFL 4 ///< set file status flags
-#define F_GETOWN 5 ///< get SIGIO/SIGURG proc/pgrp
-#define F_SETOWN 6 ///< set SIGIO/SIGURG proc/pgrp
-#define F_GETLK 7 ///< get record locking information
-#define F_SETLK 8 ///< set record locking information
-#define F_SETLKW 9 ///< F_SETLK; wait if blocked
-#define F_CLOSEM 10 ///< close all fds >= to the one given
-#define F_MAXFD 11 ///< return the max open fd
-/// @}
-
-/** file descriptor flags (F_GETFD, F_SETFD). **/
-#define FD_CLOEXEC 1 ///< close-on-exec flag
-
-/** @{ record locking flags (F_GETLK, F_SETLK, F_SETLKW). **/
-#define F_RDLCK 1 ///< shared or read lock
-#define F_UNLCK 2 ///< unlock
-#define F_WRLCK 3 ///< exclusive or write lock
-/// @}
-
-/** @{ Constants for fcntl's passed to the underlying fs - like ioctl's. **/
-#define F_PARAM_MASK 0xfff
-#define F_PARAM_LEN(x) (((x) >> 16) & F_PARAM_MASK)
-#define F_PARAM_MAX 4095
-#define F_FSCTL (int)0x80000000 ///< This fcntl goes to the fs
-#define F_FSVOID (int)0x40000000 ///< no parameters
-#define F_FSOUT (int)0x20000000 ///< copy out parameter
-#define F_FSIN (int)0x10000000 ///< copy in parameter
-#define F_FSINOUT (F_FSIN | F_FSOUT)
-#define F_FSDIRMASK (int)0x70000000 ///< mask for IN/OUT/VOID
-#define F_FSPRIV (int)0x00008000 ///< command is fs-specific
-/// @}
-
-/* Always ensure that these are consistent with <stdio.h> and <unistd.h>! */
-#ifndef SEEK_SET
- #define SEEK_SET 0 /* set file offset to offset */
-#endif
-#ifndef SEEK_CUR
- #define SEEK_CUR 1 /* set file offset to current plus offset */
-#endif
-#ifndef SEEK_END
- #define SEEK_END 2 /* set file offset to EOF plus offset */
-#endif
-
-#include <sys/EfiCdefs.h>
-
-__BEGIN_DECLS
-#ifndef __FCNTL_SYSCALLS_DECLARED
- #define __FCNTL_SYSCALLS_DECLARED
-
- /** The open() function establishes the connection between a file and a file
- descriptor. It creates an open file description that refers to a file
- and a file descriptor that refers to that open file description. The file
- descriptor is used by other I/O functions to refer to that file.
-
- The open() function returns a file descriptor for the named file that is
- the lowest file descriptor not currently open for that process. The open
- file description is new, and therefore the file descriptor shall not
- share it with any other process in the system.
-
- The file offset used to mark the current position within the file is set
- to the beginning of the file.
-
- The file status flags and file access modes of the open file description
- are set according to the value of oflags.
-
- Values for oflags are constructed by a bitwise-inclusive OR of flags from
- the following list, defined in <fcntl.h>. Applications shall specify
- exactly one of { O_RDONLY, O_RDWR, O_WRONLY } in the value of oflags.
- Any combination of { O_NONBLOCK, O_APPEND, O_CREAT, O_TRUNC, O_EXCL } may
- also be specified in oflags.
-
- Values for mode specify the access permissions for newly created files.
-
- @param[in] Path The path argument points to a pathname naming the
- object to be opened.
- @param[in] oflags File status flags and file access modes of the
- open file description.
- @param[in] mode File access permission bits as defined in
- <sys/stat.h>.
-
- @return Upon successful completion, open() opens the file and returns
- a non-negative integer representing the lowest numbered
- unused file descriptor. Otherwise, open returns -1 and sets
- errno to indicate the error. If a negative value is
- returned, no files are created or modified.
-
- @retval EMFILE No file descriptors available -- Max number already open.
- @retval EINVAL Bad value specified for oflags or mode.
- @retval ENOMEM Failure allocating memory for internal buffers.
- @retval EEXIST File exists and open attempted with (O_EXCL | O_CREAT) set.
- @retval EIO UEFI failure. Check value in EFIerrno.
- **/
- int open(const char *Path, int oflags, int mode);
-
- /**
- **/
- int creat(const char *, mode_t);
-
- /**
- **/
- int fcntl(int, int, ...);
-#endif // __FCNTL_SYSCALLS_DECLARED
-__END_DECLS
-
-#endif /* !_SYS_FCNTL_H_ */
diff --git a/StdLib/Include/sys/fd_set.h b/StdLib/Include/sys/fd_set.h deleted file mode 100644 index acbfbf0c9a..0000000000 --- a/StdLib/Include/sys/fd_set.h +++ /dev/null @@ -1,107 +0,0 @@ -/* $NetBSD: fd_set.h,v 1.2 2005/12/11 12:25:20 christos Exp $ */
-
-/*-
- * Copyright (c) 1992, 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.
- *
- * from: @(#)types.h 8.4 (Berkeley) 1/21/94
- */
-
-#ifndef _SYS_FD_SET_H_
-#define _SYS_FD_SET_H_
-
-#include <sys/EfiCdefs.h>
-#include <machine/int_types.h>
-
-/*
- * Implementation dependent defines, hidden from user space. X/Open does not
- * specify them.
- */
-#define __NBBY 8 /* number of bits in a byte */
-typedef __int32_t __fd_mask;
-
-/* bits per mask */
-#define __NFDBITS ((unsigned int)sizeof(__fd_mask) * __NBBY)
-
-#define __howmany(x, y) (((x) + ((y) - 1)) / (y))
-
-/*
- * Select uses bit masks of file descriptors in longs. These macros
- * manipulate such bit fields (the filesystem macros use chars).
- * FD_SETSIZE may be defined by the user, but the default here should
- * be enough for most uses.
- */
-#ifndef FD_SETSIZE
-#define FD_SETSIZE 256
-#endif
-
-typedef struct fd_set {
- __fd_mask fds_bits[__howmany(FD_SETSIZE, __NFDBITS)];
-} fd_set;
-
-#define FD_SET(n, p) \
- ((p)->fds_bits[(n)/__NFDBITS] |= (1 << ((n) % __NFDBITS)))
-#define FD_CLR(n, p) \
- ((p)->fds_bits[(n)/__NFDBITS] &= ~(1 << ((n) % __NFDBITS)))
-#define FD_ISSET(n, p) \
- ((p)->fds_bits[(n)/__NFDBITS] & (1 << ((n) % __NFDBITS)))
-#if __GNUC_PREREQ__(2, 95)
-#define FD_ZERO(p) (void)__builtin_memset((p), 0, sizeof(*(p)))
-#else
-#define FD_ZERO(p) do { \
- fd_set *__fds = (p); \
- unsigned int __i; \
- for (__i = 0; __i < __howmany(FD_SETSIZE, __NFDBITS); __i++) \
- __fds->fds_bits[__i] = 0; \
- } while (/* CONSTCOND */ 0)
-#endif /* GCC 2.95 */
-
-/*
- * Expose our internals if we are not required to hide them.
- */
-#if defined(_NETBSD_SOURCE)
-
-#define fd_mask __fd_mask
-#define NFDBITS __NFDBITS
-#ifndef howmany
-#define howmany(a, b) __howmany(a, b)
-#endif
-
-#if __GNUC_PREREQ__(2, 95)
-#define FD_COPY(f, t) (void)__builtin_memcpy((t), (f), sizeof(*(f)))
-#else
-#define FD_COPY(f, t) do { \
- fd_set *__f = (f), *__t = (t); \
- unsigned int __i; \
- for (__i = 0; __i < __howmany(FD_SETSIZE, __NFDBITS); __i++) \
- __t->fds_bits[__i] = __f->fds_bits[__i]; \
- } while (/* CONSTCOND */ 0)
-#endif /* GCC 2.95 */
-
-#endif /* _NETBSD_SOURCE */
-
-#endif /* _SYS_FD_SET_H_ */
diff --git a/StdLib/Include/sys/featuretest.h b/StdLib/Include/sys/featuretest.h deleted file mode 100644 index f36396af17..0000000000 --- a/StdLib/Include/sys/featuretest.h +++ /dev/null @@ -1,73 +0,0 @@ -/* $NetBSD: featuretest.h,v 1.8 2005/12/11 12:25:20 christos Exp $ */
-
-/*
- * Written by Klaus Klein <kleink@NetBSD.org>, February 2, 1998.
- * Public domain.
- *
- * NOTE: Do not protect this header against multiple inclusion. Doing
- * so can have subtle side-effects due to header file inclusion order
- * and testing of e.g. _POSIX_SOURCE vs. _POSIX_C_SOURCE. Instead,
- * protect each CPP macro that we want to supply.
- */
-
-/*
- * Feature-test macros are defined by several standards, and allow an
- * application to specify what symbols they want the system headers to
- * expose, and hence what standard they want them to conform to.
- * There are two classes of feature-test macros. The first class
- * specify complete standards, and if one of these is defined, header
- * files will try to conform to the relevant standard. They are:
- *
- * ANSI macros:
- * _ANSI_SOURCE ANSI C89
- *
- * POSIX macros:
- * _POSIX_SOURCE == 1 IEEE Std 1003.1 (version?)
- * _POSIX_C_SOURCE == 1 IEEE Std 1003.1-1990
- * _POSIX_C_SOURCE == 2 IEEE Std 1003.2-1992
- * _POSIX_C_SOURCE == 199309L IEEE Std 1003.1b-1993
- * _POSIX_C_SOURCE == 199506L ISO/IEC 9945-1:1996
- * _POSIX_C_SOURCE == 200112L IEEE Std 1003.1-2001
- *
- * X/Open macros:
- * _XOPEN_SOURCE System Interfaces and Headers, Issue 4, Ver 2
- * _XOPEN_SOURCE_EXTENDED == 1 XSH4.2 UNIX extensions
- * _XOPEN_SOURCE == 500 System Interfaces and Headers, Issue 5
- * _XOPEN_SOURCE == 520 Networking Services (XNS), Issue 5.2
- * _XOPEN_SOURCE == 600 IEEE Std 1003.1-2001, XSI option
- *
- * NetBSD macros:
- * _NETBSD_SOURCE == 1 Make all NetBSD features available.
- *
- * If more than one of these "major" feature-test macros is defined,
- * then the set of facilities provided (and namespace used) is the
- * union of that specified by the relevant standards, and in case of
- * conflict, the earlier standard in the above list has precedence (so
- * if both _POSIX_C_SOURCE and _NETBSD_SOURCE are defined, the version
- * of rename() that's used is the POSIX one). If none of the "major"
- * feature-test macros is defined, _NETBSD_SOURCE is assumed.
- *
- * There are also "minor" feature-test macros, which enable extra
- * functionality in addition to some base standard. They should be
- * defined along with one of the "major" macros. The "minor" macros
- * are:
- *
- * _REENTRANT
- * _ISOC99_SOURCE
- * _LARGEFILE_SOURCE Large File Support
- * <http://ftp.sas.com/standards/large.file/x_open.20Mar96.html>
- */
-
-#if defined(_POSIX_SOURCE) && !defined(_POSIX_C_SOURCE)
-#define _POSIX_C_SOURCE 1L
-#endif
-
-#if !defined(_ANSI_SOURCE) && !defined(_POSIX_C_SOURCE) && \
- !defined(_XOPEN_SOURCE) && !defined(_NETBSD_SOURCE)
-#define _NETBSD_SOURCE 1
-#endif
-
-#if ((_POSIX_C_SOURCE - 0) >= 199506L || (_XOPEN_SOURCE - 0) >= 500) && \
- !defined(_REENTRANT)
-#define _REENTRANT
-#endif
diff --git a/StdLib/Include/sys/file.h b/StdLib/Include/sys/file.h deleted file mode 100644 index cce35f1637..0000000000 --- a/StdLib/Include/sys/file.h +++ /dev/null @@ -1,102 +0,0 @@ -/*
- * Copyright (c) 1982, 1986, 1989, 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. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. 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.
- *
- * @(#)file.h 8.3 (Berkeley) 1/9/95
- * $Id: file.h,v 1.1.1.1 2006/05/30 06:12:53 hhzhou Exp $
- */
-
-#ifndef _SYS_FILE_H_
-#define _SYS_FILE_H_
-
-#ifndef KERNEL
-#include <sys/fcntl.h>
-#include <sys/unistd.h>
-#endif
-
-#ifdef KERNEL
-#include <sys/queue.h>
-
-struct proc;
-struct uio;
-
-/*
- * Kernel descriptor table.
- * One entry for each open kernel vnode and socket.
- */
-struct file {
- LIST_ENTRY(file) f_list;/* list of active files */
- short f_flag; /* see fcntl.h */
-#define DTYPE_VNODE 1 /* file */
-#define DTYPE_SOCKET 2 /* communications endpoint */
-#define DTYPE_PIPE 3 /* pipe */
-#define DTYPE_FIFO 4 /* fifo (named pipe) */
- short f_type; /* descriptor type */
- short f_count; /* reference count */
- short f_msgcount; /* references from message queue */
- struct ucred *f_cred; /* credentials associated with descriptor */
- struct fileops {
- int (*fo_read) __P((struct file *fp, struct uio *uio,
- struct ucred *cred, int flags));
- int (*fo_write) __P((struct file *fp, struct uio *uio,
- struct ucred *cred, int flags));
-#define FOF_OFFSET 1
- int (*fo_ioctl) __P((struct file *fp, u_long com,
- caddr_t data, struct proc *p));
- int (*fo_poll) __P((struct file *fp, int events,
- struct ucred *cred, struct proc *p));
- int (*fo_close) __P((struct file *fp, struct proc *p));
- } *f_ops;
- int f_seqcount; /*
- * count of sequential accesses -- cleared
- * by most seek operations.
- */
- off_t f_nextread; /*
- * offset of next expected read
- */
- off_t f_offset;
- caddr_t f_data; /* vnode or socket */
-};
-
-#ifdef MALLOC_DECLARE
-MALLOC_DECLARE(M_FILE);
-#endif
-
-LIST_HEAD(filelist, file);
-extern struct filelist filehead; /* head of list of open files */
-extern struct fileops vnops;
-extern int maxfiles; /* kernel limit on number of open files */
-extern int maxfilesperproc; /* per process limit on number of open files */
-extern int nfiles; /* actual number of open files */
-
-#endif /* KERNEL */
-
-#endif /* !SYS_FILE_H */
diff --git a/StdLib/Include/sys/filio.h b/StdLib/Include/sys/filio.h deleted file mode 100644 index e514c267a7..0000000000 --- a/StdLib/Include/sys/filio.h +++ /dev/null @@ -1,61 +0,0 @@ -/** @file
-
- Copyright (c) 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) 1982, 1986, 1990, 1993, 1994
- * The Regents of the University of California. All rights reserved.
- * (c) UNIX System Laboratories, Inc.
- * All or some portions of this file are derived from material licensed
- * to the University of California by American Telephone and Telegraph
- * Co. or Unix System Laboratories, Inc. and are reproduced herein with
- * the permission of UNIX System Laboratories, Inc.
- *
- * 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.
- *
- * @(#)filio.h 8.1 (Berkeley) 3/28/94
- NetBSD: filio.h,v 1.10 2005/12/11 12:25:20 christos Exp
- */
-
-#ifndef _SYS_FILIO_H_
-#define _SYS_FILIO_H_
-
-#include <sys/ioccom.h>
-
-typedef const struct timeval* ptimeval_t;
-
-/* File-descriptor ioctl's. */
-
-#define FIODLEX _IO ('f', 1) /* set Delete-on-Close */
-#define FIONDLEX _IO ('f', 2) /* clear Delete-on-Close */
-#define FIOSETIME _IOW ('f', 127, ptimeval_t) /* Set access and modification times */
-
-#endif /* !_SYS_FILIO_H_ */
diff --git a/StdLib/Include/sys/float_ieee754.h b/StdLib/Include/sys/float_ieee754.h deleted file mode 100644 index ab2f54c615..0000000000 --- a/StdLib/Include/sys/float_ieee754.h +++ /dev/null @@ -1,105 +0,0 @@ -/** @file
- 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) 1992, 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.
- *
- * @(#)float.h 8.1 (Berkeley) 6/10/93
- NetBSD: float_ieee754.h,v 1.8 2005/12/11 12:25:20 christos Exp
-
- * NOTICE: This is not a standalone file. To use it, #include it in
- * your port's float.h header.
-**/
-
-#ifndef _SYS_FLOAT_IEEE754_H_
-#define _SYS_FLOAT_IEEE754_H_
-
-#include <sys/EfiCdefs.h>
-#include <sys/featuretest.h>
-
-#ifndef FLT_ROUNDS
-__BEGIN_DECLS
-extern int __flt_rounds(void);
-__END_DECLS
-#define FLT_ROUNDS __flt_rounds()
-#endif
-
-#ifndef FLT_EVAL_METHOD
-#if __GNUC_PREREQ__(3, 3)
-#define FLT_EVAL_METHOD __FLT_EVAL_METHOD__
-#endif /* GCC >= 3.3 */
-#endif /* defined(FLT_EVAL_METHOD) */
-
-#define FLT_RADIX 2 /* b */
-
-#define FLT_MANT_DIG 24 /* p */
-#define FLT_EPSILON 1.19209290E-7F /* b**(1-p) */
-#define FLT_DIG 6 /* floor((p-1)*log10(b))+(b == 10) */
-#define FLT_MIN_EXP (-125) /* emin */
-#define FLT_MIN 1.17549435E-38F /* b**(emin-1) */
-#define FLT_MIN_10_EXP (-37) /* ceil(log10(b**(emin-1))) */
-#define FLT_MAX_EXP 128 /* emax */
-//#define FLT_MAX 3.40282347e+38F /* (1-b**(-p))*b**emax */
-#define FLT_MAX 3.402823e+38F /* (1-b**(-p))*b**emax */
-#define FLT_MAX_10_EXP 38 /* floor(log10((1-b**(-p))*b**emax)) */
-
-#define DBL_MANT_DIG 53
-#define DBL_EPSILON 2.2204460492503131E-16
-#define DBL_DIG 15
-#define DBL_MIN_EXP (-1021)
-#define DBL_MIN 2.2250738585072014E-308
-#define DBL_MIN_10_EXP (-307)
-#define DBL_MAX_EXP 1024
-#define DBL_MAX 1.7976931348623157E+308
-#define DBL_MAX_10_EXP 308
-
-/*
- * If no extended-precision type is defined by the machine-dependent
- * header including this, default to `long double' being double-precision.
- */
-#ifndef LDBL_MANT_DIG
- #define LDBL_MANT_DIG DBL_MANT_DIG
- #define LDBL_EPSILON DBL_EPSILON
- #define LDBL_DIG DBL_DIG
- #define LDBL_MIN_EXP DBL_MIN_EXP
- #define LDBL_MIN DBL_MIN
- #define LDBL_MIN_10_EXP DBL_MIN_10_EXP
- #define LDBL_MAX_EXP DBL_MAX_EXP
- #define LDBL_MAX DBL_MAX
- #define LDBL_MAX_10_EXP DBL_MAX_10_EXP
-
- #define DECIMAL_DIG 17 /* ceil((1+p*log10(b))-(b==10) */
-#endif /* LDBL_MANT_DIG */
-
-#endif /* _SYS_FLOAT_IEEE754_H_ */
diff --git a/StdLib/Include/sys/ieee754.h b/StdLib/Include/sys/ieee754.h deleted file mode 100644 index 740b58eb55..0000000000 --- a/StdLib/Include/sys/ieee754.h +++ /dev/null @@ -1,152 +0,0 @@ -/* $NetBSD: ieee754.h,v 1.6.24.1 2007/05/07 19:49:10 pavel Exp $ */
-
-/*
- * Copyright (c) 1992, 1993
- * The Regents of the University of California. All rights reserved.
- *
- * This software was developed by the Computer Systems Engineering group
- * at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and
- * contributed to Berkeley.
- *
- * All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Lawrence Berkeley Laboratory.
- *
- * 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.
- *
- * @(#)ieee.h 8.1 (Berkeley) 6/11/93
- */
-#ifndef _SYS_IEEE754_H_
-#define _SYS_IEEE754_H_
-
-/*
- * NOTICE: This is not a standalone file. To use it, #include it in
- * your port's ieee.h header.
- */
-
-#include <machine/endian.h>
-
-/*
- * <sys/ieee754.h> defines the layout of IEEE 754 floating point types.
- * Only single-precision and double-precision types are defined here;
- * extended types, if available, are defined in the machine-dependent
- * header.
- */
-
-/*
- * Define the number of bits in each fraction and exponent.
- *
- * k k+1
- * Note that 1.0 x 2 == 0.1 x 2 and that denorms are represented
- *
- * (-exp_bias+1)
- * as fractions that look like 0.fffff x 2 . This means that
- *
- * -126
- * the number 0.10000 x 2 , for instance, is the same as the normalized
- *
- * -127 -128
- * float 1.0 x 2 . Thus, to represent 2 , we need one leading zero
- *
- * -129
- * in the fraction; to represent 2 , we need two, and so on. This
- *
- * (-exp_bias-fracbits+1)
- * implies that the smallest denormalized number is 2
- *
- * for whichever format we are talking about: for single precision, for
- *
- * -126 -149
- * instance, we get .00000000000000000000001 x 2 , or 1.0 x 2 , and
- *
- * -149 == -127 - 23 + 1.
- */
-#define SNG_EXPBITS 8
-#define SNG_FRACBITS 23
-
-struct ieee_single {
-#if _BYTE_ORDER == _BIG_ENDIAN
- u_int sng_sign:1;
- u_int sng_exp:SNG_EXPBITS;
- u_int sng_frac:SNG_FRACBITS;
-#else
- u_int sng_frac:SNG_FRACBITS;
- u_int sng_exp:SNG_EXPBITS;
- u_int sng_sign:1;
-#endif
-};
-
-#define DBL_EXPBITS 11
-#define DBL_FRACHBITS 20
-#define DBL_FRACLBITS 32
-#define DBL_FRACBITS (DBL_FRACHBITS + DBL_FRACLBITS)
-
-struct ieee_double {
-#if _BYTE_ORDER == _BIG_ENDIAN
- u_int dbl_sign:1;
- u_int dbl_exp:DBL_EXPBITS;
- u_int dbl_frach:DBL_FRACHBITS;
- u_int dbl_fracl:DBL_FRACLBITS;
-#else
- u_int dbl_fracl:DBL_FRACLBITS;
- u_int dbl_frach:DBL_FRACHBITS;
- u_int dbl_exp:DBL_EXPBITS;
- u_int dbl_sign:1;
-#endif
-};
-
-/*
- * Floats whose exponent is in [1..INFNAN) (of whatever type) are
- * `normal'. Floats whose exponent is INFNAN are either Inf or NaN.
- * Floats whose exponent is zero are either zero (iff all fraction
- * bits are zero) or subnormal values.
- *
- * At least one `signalling NaN' and one `quiet NaN' value must be
- * implemented. It is left to the architecture to specify how to
- * distinguish between these.
- */
-#define SNG_EXP_INFNAN 255
-#define DBL_EXP_INFNAN 2047
-
-/*
- * Exponent biases.
- */
-#define SNG_EXP_BIAS 127
-#define DBL_EXP_BIAS 1023
-
-/*
- * Convenience data structures.
- */
-union ieee_single_u {
- float sngu_f;
- struct ieee_single sngu_sng;
-};
-
-union ieee_double_u {
- double dblu_d;
- struct ieee_double dblu_dbl;
-};
-#endif /* _SYS_IEEE754_H_ */
diff --git a/StdLib/Include/sys/inttypes.h b/StdLib/Include/sys/inttypes.h deleted file mode 100644 index 5dc3565f3d..0000000000 --- a/StdLib/Include/sys/inttypes.h +++ /dev/null @@ -1,52 +0,0 @@ -/* $NetBSD: inttypes.h,v 1.4 2001/04/28 15:41:30 kleink Exp $ */
-
-/*-
- * Copyright (c) 1998, 2000 The NetBSD Foundation, Inc.
- * All rights reserved.
- *
- * This code is derived from software contributed to The NetBSD Foundation
- * by Klaus J. 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 _SYS_INTTYPES_H_
-#define _SYS_INTTYPES_H_
-
-/*
- * 7.8 Format conversion of integer types
- */
-
-#include <sys/stdint.h>
-
-#if !defined(__cplusplus) || defined(__STDC_FORMAT_MACROS)
-#include <machine/int_fmtio.h>
-#endif
-
-#endif /* !_SYS_INTTYPES_H_ */
diff --git a/StdLib/Include/sys/ioccom.h b/StdLib/Include/sys/ioccom.h deleted file mode 100644 index 852a082b28..0000000000 --- a/StdLib/Include/sys/ioccom.h +++ /dev/null @@ -1,68 +0,0 @@ -/* $NetBSD: ioccom.h,v 1.8 2005/12/11 12:25:20 christos Exp $ */
-
-/*-
- * Copyright (c) 1982, 1986, 1990, 1993, 1994
- * 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.
- *
- * @(#)ioccom.h 8.3 (Berkeley) 1/9/95
- */
-#ifndef _SYS_IOCCOM_H_
-#define _SYS_IOCCOM_H_
-
-/*
- * Ioctl's have the command encoded in the lower word, and the size of
- * any in or out parameters in the upper word. The high 3 bits of the
- * upper word are used to encode the in/out status of the parameter.
- */
-#define IOCPARM_MASK 0x1fff /* parameter length, at most 13 bits */
-
-#define IOCPARM_LEN(x) (((x) >> 16) & IOCPARM_MASK)
-#define IOCBASECMD(x) ((x) & ~(IOCPARM_MASK << 16))
-#define IOCGROUP(x) (((x) >> 8) & 0xff)
-
-#define IOCPARM_MAX NBPG /* max size of ioctl args, mult. of NBPG */
- /* no parameters */
-#define IOC_VOID (unsigned long)0x20000000
- /* copy parameters out */
-#define IOC_OUT (unsigned long)0x40000000
- /* copy parameters in */
-#define IOC_IN (unsigned long)0x80000000
- /* copy parameters in and out */
-#define IOC_INOUT (IOC_IN|IOC_OUT)
- /* mask for IN/OUT/VOID */
-#define IOC_DIRMASK (unsigned long)0xe0000000
-
-#define _IOC(inout,group,num,len) (inout | ((len & IOCPARM_MASK) << 16) | ((group) << 8) | (num))
-
-#define _IO(g,n) _IOC(IOC_VOID, (g), (n), 0)
-#define _IOR(g,n,t) _IOC(IOC_OUT, (g), (n), sizeof(t))
-#define _IOW(g,n,t) _IOC(IOC_IN, (g), (n), sizeof(t))
-
-/* this should be _IORW, but stdio got there first */
-#define _IOWR(g,n,t) _IOC(IOC_INOUT, (g), (n), sizeof(t))
-
-#endif /* !_SYS_IOCCOM_H_ */
diff --git a/StdLib/Include/sys/ioctl.h b/StdLib/Include/sys/ioctl.h deleted file mode 100644 index 2378fd2c84..0000000000 --- a/StdLib/Include/sys/ioctl.h +++ /dev/null @@ -1,101 +0,0 @@ -/** @file
- Device Control, ioctl, definitions and declarations.
-
- Copyright (c) 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) 1982, 1986, 1990, 1993, 1994
- * The Regents of the University of California. All rights reserved.
- * (c) UNIX System Laboratories, Inc.
- * All or some portions of this file are derived from material licensed
- * to the University of California by American Telephone and Telegraph
- * Co. or Unix System Laboratories, Inc. and are reproduced herein with
- * the permission of UNIX System Laboratories, Inc.
- *
- * 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.
-
- NetBSD: ioctl.h,v 1.34 2005/12/11 12:25:20 christos Exp
- ioctl.h 8.6 (Berkeley) 3/28/94
-**/
-#ifndef _SYS_IOCTL_H_
-#define _SYS_IOCTL_H_
-
-
-//#include <sys/ttycom.h>
-
-/*
- * Pun for SunOS prior to 3.2. SunOS 3.2 and later support TIOCGWINSZ
- * and TIOCSWINSZ (yes, even 3.2-3.5, the fact that it wasn't documented
- * nonwithstanding).
- */
-struct ttysize {
- unsigned short ts_lines;
- unsigned short ts_cols;
- unsigned short ts_xxx;
- unsigned short ts_yyy;
-};
-//#define TIOCGSIZE TIOCGWINSZ
-//#define TIOCSSIZE TIOCSWINSZ
-
-//#include <sys/ioccom.h>
-
-//#include <sys/dkio.h>
-//#include <sys/filio.h>
-//#include <sys/sockio.h>
-
-/*
- * Passthrough ioctl commands. These are passed through to devices
- * as they are, it is expected that the device (an LKM, for example),
- * will know how to deal with them. One for each emulation, so that
- * no namespace clashes will occur between them, for devices that
- * may be dealing with specific ioctls for multiple emulations.
- */
-
-struct ioctl_pt {
- unsigned long com;
- void *data;
-};
-
-#define PTIOCNETBSD _IOW('Z', 0, struct ioctl_pt)
-#define PTIOCSUNOS _IOW('Z', 1, struct ioctl_pt)
-#define PTIOCSVR4 _IOW('Z', 2, struct ioctl_pt)
-#define PTIOCLINUX _IOW('Z', 3, struct ioctl_pt)
-#define PTIOCFREEBSD _IOW('Z', 4, struct ioctl_pt)
-#define PTIOCOSF1 _IOW('Z', 5, struct ioctl_pt)
-#define PTIOCULTRIX _IOW('Z', 6, struct ioctl_pt)
-#define PTIOCWIN32 _IOW('Z', 7, struct ioctl_pt)
-
-#include <sys/EfiCdefs.h>
-
-__BEGIN_DECLS
-int ioctl(int, unsigned long, ...);
-__END_DECLS
-#endif /* !_SYS_IOCTL_H_ */
diff --git a/StdLib/Include/sys/localedef.h b/StdLib/Include/sys/localedef.h deleted file mode 100644 index 63ea8a2307..0000000000 --- a/StdLib/Include/sys/localedef.h +++ /dev/null @@ -1,100 +0,0 @@ -/* $NetBSD: localedef.h,v 1.7 2005/11/29 03:12:16 christos Exp $ */
-
-/*
- * Copyright (c) 1994 Winning Strategies, Inc.
- * 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. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Winning Strategies, Inc.
- * 4. The name of the author may not be used to endorse or promote products
- * derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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 _SYS_LOCALEDEF_H_
-#define _SYS_LOCALEDEF_H_
-
-typedef struct {
- const char *yesexpr;
- const char *noexpr;
- const char *yesstr;
- const char *nostr;
-} _MessagesLocale;
-
-extern const _MessagesLocale *_CurrentMessagesLocale;
-extern const _MessagesLocale _DefaultMessagesLocale;
-
-
-typedef struct {
- const char *int_curr_symbol;
- const char *currency_symbol;
- const char *mon_decimal_point;
- const char *mon_thousands_sep;
- const char *mon_grouping;
- const char *positive_sign;
- const char *negative_sign;
- char int_frac_digits;
- char frac_digits;
- char p_cs_precedes;
- char p_sep_by_space;
- char n_cs_precedes;
- char n_sep_by_space;
- char p_sign_posn;
- char n_sign_posn;
- char int_p_cs_precedes;
- char int_n_cs_precedes;
- char int_p_sep_by_space;
- char int_n_sep_by_space;
- char int_p_sign_posn;
- char int_n_sign_posn;
-} _MonetaryLocale;
-
-extern const _MonetaryLocale *_CurrentMonetaryLocale;
-extern const _MonetaryLocale _DefaultMonetaryLocale;
-
-
-typedef struct {
- const char *decimal_point;
- const char *thousands_sep;
- const char *grouping;
-} _NumericLocale;
-
-extern const _NumericLocale *_CurrentNumericLocale;
-extern const _NumericLocale _DefaultNumericLocale;
-
-
-typedef struct {
- const char *abday[7];
- const char *day[7];
- const char *abmon[12];
- const char *mon[12];
- const char *am_pm[2];
- const char *d_t_fmt;
- const char *d_fmt;
- const char *t_fmt;
- const char *t_fmt_ampm;
-} _TimeLocale;
-
-extern const _TimeLocale *_CurrentTimeLocale;
-extern const _TimeLocale _DefaultTimeLocale;
-
-#endif /* !_SYS_LOCALEDEF_H_ */
diff --git a/StdLib/Include/sys/param.h b/StdLib/Include/sys/param.h deleted file mode 100644 index 19de391a9f..0000000000 --- a/StdLib/Include/sys/param.h +++ /dev/null @@ -1,321 +0,0 @@ -/* $NetBSD: param.h,v 1.244.2.9.2.2 2008/10/05 08:44:03 bouyer Exp $ */
-
-/*-
- * Copyright (c) 1982, 1986, 1989, 1993
- * The Regents of the University of California. All rights reserved.
- * (c) UNIX System Laboratories, Inc.
- * All or some portions of this file are derived from material licensed
- * to the University of California by American Telephone and Telegraph
- * Co. or Unix System Laboratories, Inc. and are reproduced herein with
- * the permission of UNIX System Laboratories, Inc.
- *
- * 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 8.3 (Berkeley) 4/4/95
- */
-
-#ifndef _SYS_PARAM_H_
-#define _SYS_PARAM_H_
-
-/*
- * Historic BSD #defines -- probably will remain untouched for all time.
- */
-#define BSD 199506 /* System version (year & month). */
-#define BSD4_3 1
-#define BSD4_4 1
-
-/*
- * #define __NetBSD_Version__ MMmmrrpp00
- *
- * M = major version
- * m = minor version; a minor number of 99 indicates current.
- * r = 0 (*)
- * p = patchlevel
- *
- * When new releases are made, src/gnu/usr.bin/groff/tmac/mdoc.local
- * needs to be updated and the changes sent back to the groff maintainers.
- *
- * (*) Up to 2.0I "release" used to be "",A-Z,Z[A-Z] but numeric
- * e.g. NetBSD-1.2D = 102040000 ('D' == 4)
- * NetBSD-2.0H (200080000) was changed on 20041001 to:
- * 2.99.9 (299000900)
- */
-
-#define __NetBSD_Version__ 400000003 /* NetBSD 4.0.1 */
-
-#define __NetBSD_Prereq__(M,m,p) (((((M) * 100000000) + \
- (m) * 1000000) + (p) * 100) <= __NetBSD_Version__)
-
-/*
- * Historical NetBSD #define
- *
- * NetBSD 1.4 was the last release for which this value was incremented.
- * The value is now permanently fixed at 199905. It will never be
- * changed again.
- *
- * New code must use __NetBSD_Version__ instead, and should not even
- * count on NetBSD being defined.
- *
- */
-
-#define NetBSD 199905 /* NetBSD version (year & month). */
-
-#ifndef _LOCORE
-//#include <sys/inttypes.h>
-#include <sys/types.h>
-#endif
-
-/*
- * Machine-independent constants (some used in following include files).
- * Redefined constants are from POSIX 1003.1 limits file.
- *
- * MAXCOMLEN should be >= sizeof(ac_comm) (see <acct.h>)
- * MAXLOGNAME should be >= UT_NAMESIZE (see <utmp.h>)
- */
-#include <sys/syslimits.h>
-
-#define MAXCOMLEN 16 /* max command name remembered */
-#define MAXINTERP PATH_MAX /* max interpreter file name length */
-/* DEPRECATED: use LOGIN_NAME_MAX instead. */
-#define MAXLOGNAME (LOGIN_NAME_MAX - 1) /* max login name length */
-#define NCARGS ARG_MAX /* max bytes for an exec function */
-#define NGROUPS NGROUPS_MAX /* max number groups */
-#define NOGROUP 65535 /* marker for empty group set member */
-#define MAXHOSTNAMELEN 256 /* max hostname size */
-
-#ifndef NOFILE
-#define NOFILE OPEN_MAX /* max open files per process */
-#endif
-#ifndef MAXUPRC /* max simultaneous processes */
-#define MAXUPRC CHILD_MAX /* POSIX 1003.1-compliant default */
-#else
-#if (MAXUPRC - 0) < CHILD_MAX
-#error MAXUPRC less than CHILD_MAX. See options(4) for details.
-#endif /* (MAXUPRC - 0) < CHILD_MAX */
-#endif /* !defined(MAXUPRC) */
-
-/* Signals. */
-#include <sys/signal.h>
-
-/* Machine type dependent parameters. */
-#include <machine/param.h>
-#include <machine/limits.h>
-
-/* pages ("clicks") to disk blocks */
-#define ctod(x) ((x) << (PGSHIFT - DEV_BSHIFT))
-#define dtoc(x) ((x) >> (PGSHIFT - DEV_BSHIFT))
-
-/* bytes to pages */
-#define ctob(x) ((x) << PGSHIFT)
-#define btoc(x) (((x) + PGOFSET) >> PGSHIFT)
-
-/* bytes to disk blocks */
-#define dbtob(x) ((x) << DEV_BSHIFT)
-#define btodb(x) ((x) >> DEV_BSHIFT)
-
-/*
- * Stack macros. On most architectures, the stack grows down,
- * towards lower addresses; it is the rare architecture where
- * it grows up, towards higher addresses.
- *
- * STACK_GROW and STACK_SHRINK adjust a stack pointer by some
- * size, no questions asked. STACK_ALIGN aligns a stack pointer.
- *
- * STACK_ALLOC returns a pointer to allocated stack space of
- * some size; given such a pointer and a size, STACK_MAX gives
- * the maximum (in the "maxsaddr" sense) stack address of the
- * allocated memory.
- */
-#if defined(_KERNEL) || defined(__EXPOSE_STACK)
-#ifdef __MACHINE_STACK_GROWS_UP
-#define STACK_GROW(sp, _size) (((caddr_t)(sp)) + (_size))
-#define STACK_SHRINK(sp, _size) (((caddr_t)(sp)) - (_size))
-#define STACK_ALIGN(sp, bytes) \
- ((caddr_t)((((unsigned long)(sp)) + (bytes)) & ~(bytes)))
-#define STACK_ALLOC(sp, _size) ((caddr_t)(sp))
-#define STACK_MAX(p, _size) (((caddr_t)(p)) + (_size))
-#else
-#define STACK_GROW(sp, _size) (((caddr_t)(sp)) - (_size))
-#define STACK_SHRINK(sp, _size) (((caddr_t)(sp)) + (_size))
-#define STACK_ALIGN(sp, bytes) \
- ((caddr_t)(((unsigned long)(sp)) & ~(bytes)))
-#define STACK_ALLOC(sp, _size) (((caddr_t)(sp)) - (_size))
-#define STACK_MAX(p, _size) ((caddr_t)(p))
-#endif
-#endif /* defined(_KERNEL) || defined(__EXPOSE_STACK) */
-
-/*
- * Priorities. Note that with 32 run queues, differences less than 4 are
- * insignificant.
- */
-#define PSWP 0
-#define PVM 4
-#define PINOD 8
-#define PRIBIO 16
-#define PVFS 20
-#define PZERO 22 /* No longer magic, shouldn't be here. XXX */
-#define PSOCK 24
-#define PWAIT 32
-#define PLOCK 36
-#define PPAUSE 40
-#define PUSER 50
-#define MAXPRI 127 /* Priorities range from 0 through MAXPRI. */
-
-#define PRIMASK 0x0ff
-#define PCATCH 0x100 /* OR'd with pri for tsleep to check signals */
-#define PNORELOCK 0x200 /* OR'd with pri for cond_wait() to not relock
- the interlock */
-#define PNOEXITERR 0x400 /* OR'd with pri for tsleep to not exit
- with an error code when LWPs are exiting */
-#define NBPW sizeof(int) /* number of bytes per word (integer) */
-
-#define CMASK 022 /* default file mask: S_IWGRP|S_IWOTH */
-#define NODEV (dev_t)(-1) /* non-existent device */
-
-#define CBLOCK 64 /* Clist block size, must be a power of 2. */
-#define CBQSIZE (CBLOCK/NBBY) /* Quote bytes/cblock - can do better. */
- /* Data chars/clist. */
-#define CBSIZE (CBLOCK - (int)sizeof(struct cblock *) - CBQSIZE)
-#define CROUND (CBLOCK - 1) /* Clist rounding. */
-
-/*
- * File system parameters and macros.
- *
- * The file system is made out of blocks of at most MAXBSIZE units, with
- * smaller units (fragments) only in the last direct block. MAXBSIZE
- * primarily determines the size of buffers in the buffer pool. It may be
- * made larger without any effect on existing file systems; however making
- * it smaller may make some file systems unmountable.
- */
-#ifndef MAXBSIZE /* XXX */
-#define MAXBSIZE MAXPHYS
-#endif
-#define MAXFRAG 8
-
-/*
- * MAXPATHLEN defines the longest permissible path length after expanding
- * symbolic links. It is used to allocate a temporary buffer from the buffer
- * pool in which to do the name expansion, hence should be a power of two,
- * and must be less than or equal to MAXBSIZE. MAXSYMLINKS defines the
- * maximum number of symbolic links that may be expanded in a path name.
- * It should be set high enough to allow all legitimate uses, but halt
- * infinite loops reasonably quickly.
- */
-#define MAXPATHLEN PATH_MAX
-#define MAXSYMLINKS 32
-
-/* Bit map related macros. */
-#define setbit(a,i) ((a)[(i)/NBBY] |= 1<<((i)%NBBY))
-#define clrbit(a,i) ((a)[(i)/NBBY] &= ~(1<<((i)%NBBY)))
-#define isset(a,i) ((a)[(i)/NBBY] & (1<<((i)%NBBY)))
-#define isclr(a,i) (((a)[(i)/NBBY] & (1<<((i)%NBBY))) == 0)
-
-/* Macros for counting and rounding. */
-#ifndef howmany
-#define howmany(x, y) (((x)+((y)-1))/(y))
-#endif
-#define roundup(x, y) ((((x)+((y)-1))/(y))*(y))
-#define rounddown(x,y) (((x)/(y))*(y))
-#define powerof2(x) ((((x)-1)&(x))==0)
-
-///* Macros for min/max. */
-//#define MIN(a,b) (((a)<(b))?(a):(b))
-//#define MAX(a,b) (((a)>(b))?(a):(b))
-
-/*
- * Constants for setting the parameters of the kernel memory allocator.
- *
- * 2 ** MINBUCKET is the smallest unit of memory that will be
- * allocated. It must be at least large enough to hold a pointer.
- *
- * Units of memory less or equal to MAXALLOCSAVE will permanently
- * allocate physical memory; requests for these size pieces of
- * memory are quite fast. Allocations greater than MAXALLOCSAVE must
- * always allocate and free physical memory; requests for these
- * size allocations should be done infrequently as they will be slow.
- *
- * Constraints: NBPG <= MAXALLOCSAVE <= 2 ** (MINBUCKET + 14), and
- * MAXALLOCSAVE must be a power of two.
- */
-#ifdef _LP64
-#define MINBUCKET 5 /* 5 => min allocation of 32 bytes */
-#else
-#define MINBUCKET 4 /* 4 => min allocation of 16 bytes */
-#endif
-#define MAXALLOCSAVE (2 * NBPG)
-
-/*
- * Scale factor for scaled integers used to count %cpu time and load avgs.
- *
- * The number of CPU `tick's that map to a unique `%age' can be expressed
- * by the formula (1 / (2 ^ (FSHIFT - 11))). The maximum load average that
- * can be calculated (assuming 32 bits) can be closely approximated using
- * the formula (2 ^ (2 * (16 - FSHIFT))) for (FSHIFT < 15).
- *
- * For the scheduler to maintain a 1:1 mapping of CPU `tick' to `%age',
- * FSHIFT must be at least 11; this gives us a maximum load avg of ~1024.
- */
-#define FSHIFT 11 /* bits to right of fixed binary point */
-#define FSCALE (1<<FSHIFT)
-
-/*
- * The time for a process to be blocked before being very swappable.
- * This is a number of seconds which the system takes as being a non-trivial
- * amount of real time. You probably shouldn't change this;
- * it is used in subtle ways (fractions and multiples of it are, that is, like
- * half of a ``long time'', almost a long time, etc.)
- * It is related to human patience and other factors which don't really
- * change over time.
- */
-#define MAXSLP 20
-
-/*
- * Defaults for Unified Buffer Cache parameters.
- * These may be overridden in <machine/param.h>.
- */
-
-#ifndef UBC_WINSHIFT
-#define UBC_WINSHIFT 13
-#endif
-#ifndef UBC_NWINS
-#define UBC_NWINS 1024
-#endif
-
-#ifdef _KERNEL
-/*
- * macro to convert from milliseconds to hz without integer overflow
- * Default version using only 32bits arithmetics.
- * 64bit port can define 64bit version in their <machine/param.h>
- * 0x20000 is safe for hz < 20000
- */
-#ifndef mstohz
-#define mstohz(ms) \
- (__predict_false((ms) >= 0x20000) ? \
- ((ms +0u) / 1000u) * hz : \
- ((ms +0u) * hz) / 1000u)
-#endif
-#endif /* _KERNEL */
-
-#endif /* !_SYS_PARAM_H_ */
diff --git a/StdLib/Include/sys/poll.h b/StdLib/Include/sys/poll.h deleted file mode 100644 index ead648d490..0000000000 --- a/StdLib/Include/sys/poll.h +++ /dev/null @@ -1,91 +0,0 @@ -/** @file
- Definitions in support of the poll() function.
-
- * 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.
-
- Copyright (c) 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.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.
-
- NetBSD: poll.h,v 1.11 2005/12/11 12:25:20 christos Exp
-**/
-#ifndef _SYS_POLL_H_
-#define _SYS_POLL_H_
-
-#include <sys/featuretest.h>
-#include <sys/EfiCdefs.h>
-
-typedef unsigned int nfds_t;
-
-struct pollfd {
- int fd; /* file descriptor */
- short events; /* events to look for */
- short revents; /* events returned */
-};
-
-/*
- * Testable events (may be specified in events field).
- */
-#define POLLIN 0x0001
-#define POLLPRI 0x0002
-#define POLLOUT 0x0004
-#define POLLRDNORM 0x0040
-#define POLLWRNORM POLLOUT
-#define POLLRDBAND 0x0080
-#define POLLWRBAND 0x0100
-
-/*
- * Non-testable events (ignored in events field, valid in return only).
- */
-#define POLLERR 0x0008
-#define POLLHUP 0x0010
-#define POLLNVAL 0x0020 // Invalid parameter in POLL call
-#define POLL_RETONLY (POLLERR | POLLHUP | POLLNVAL)
-
-/*
- * Infinite timeout value.
- */
-#define INFTIM -1
-
-__BEGIN_DECLS
-int poll(struct pollfd *, nfds_t, int);
-__END_DECLS
-
-#endif /* !_SYS_POLL_H_ */
diff --git a/StdLib/Include/sys/pool.h b/StdLib/Include/sys/pool.h deleted file mode 100644 index 43c080a227..0000000000 --- a/StdLib/Include/sys/pool.h +++ /dev/null @@ -1,311 +0,0 @@ -/* $NetBSD: pool.h,v 1.54 2006/08/20 09:35:25 yamt Exp $ */
-
-/*-
- * Copyright (c) 1997, 1998, 1999, 2000 The NetBSD Foundation, Inc.
- * All rights reserved.
- *
- * This code is derived from software contributed to The NetBSD Foundation
- * by Paul Kranenburg; by Jason R. Thorpe of the Numerical Aerospace
- * Simulation Facility, NASA Ames Research Center.
- *
- * 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 _SYS_POOL_H_
-#define _SYS_POOL_H_
-
-#ifdef _KERNEL
-#define __POOL_EXPOSE
-#endif
-
-#if defined(_KERNEL_OPT)
-#include "opt_pool.h"
-#endif
-
-#ifdef __POOL_EXPOSE
-#include <sys/lock.h>
-#include <sys/queue.h>
-#include <sys/time.h>
-#include <sys/tree.h>
-#if defined(_KERNEL)
-#include <sys/callback.h>
-#endif /* defined(_KERNEL) */
-#endif
-
-#define PCG_NOBJECTS 16
-
-#define POOL_PADDR_INVALID ((paddr_t) -1)
-
-#ifdef __POOL_EXPOSE
-/* The pool cache group. */
-struct pool_cache_group {
- LIST_ENTRY(pool_cache_group)
- pcg_list; /* link in the pool cache's group list */
- u_int pcg_avail; /* # available objects */
- /* pointers to the objects */
- struct {
- void *pcgo_va; /* cache object virtual address */
- paddr_t pcgo_pa;/* cache object physical address */
- } pcg_objects[PCG_NOBJECTS];
-};
-
-LIST_HEAD(pool_cache_grouplist,pool_cache_group);
-struct pool_cache {
- LIST_ENTRY(pool_cache)
- pc_poollist; /* entry on pool's group list */
- struct pool_cache_grouplist
- pc_emptygroups; /* list of empty cache groups */
- struct pool_cache_grouplist
- pc_fullgroups; /* list of full cache groups */
- struct pool_cache_grouplist
- pc_partgroups; /* list of partial cache groups */
- struct pool *pc_pool; /* parent pool */
- struct simplelock pc_slock; /* mutex */
-
- int (*pc_ctor)(void *, void *, int);
- void (*pc_dtor)(void *, void *);
- void *pc_arg;
-
- /* Statistics. */
- unsigned long pc_hits; /* cache hits */
- unsigned long pc_misses; /* cache misses */
-
- unsigned long pc_ngroups; /* # cache groups */
-
- unsigned long pc_nitems; /* # objects currently in cache */
-};
-
-struct pool_allocator {
- void *(*pa_alloc)(struct pool *, int);
- void (*pa_free)(struct pool *, void *);
- unsigned int pa_pagesz;
-
- /* The following fields are for internal use only. */
- struct simplelock pa_slock;
- TAILQ_HEAD(, pool) pa_list; /* list of pools using this allocator */
- int pa_flags;
-#define PA_INITIALIZED 0x01
- int pa_pagemask;
- int pa_pageshift;
- struct vm_map *pa_backingmap;
-#if defined(_KERNEL)
- struct vm_map **pa_backingmapptr;
- SLIST_ENTRY(pool_allocator) pa_q;
-#endif /* defined(_KERNEL) */
-};
-
-LIST_HEAD(pool_pagelist,pool_item_header);
-
-struct pool {
- LIST_ENTRY(pool)
- pr_poollist;
- struct pool_pagelist
- pr_emptypages; /* Empty pages */
- struct pool_pagelist
- pr_fullpages; /* Full pages */
- struct pool_pagelist
- pr_partpages; /* Partially-allocated pages */
- struct pool_item_header *pr_curpage;
- struct pool *pr_phpool; /* Pool item header pool */
- LIST_HEAD(,pool_cache)
- pr_cachelist; /* Caches for this pool */
- unsigned int pr_size; /* Size of item */
- unsigned int pr_align; /* Requested alignment, must be 2^n */
- unsigned int pr_itemoffset; /* Align this offset in item */
- unsigned int pr_minitems; /* minimum # of items to keep */
- unsigned int pr_minpages; /* same in page units */
- unsigned int pr_maxpages; /* maximum # of pages to keep */
- unsigned int pr_npages; /* # of pages allocated */
- unsigned int pr_itemsperpage;/* # items that fit in a page */
- unsigned int pr_slack; /* unused space in a page */
- unsigned int pr_nitems; /* number of available items in pool */
- unsigned int pr_nout; /* # items currently allocated */
- unsigned int pr_hardlimit; /* hard limit to number of allocated
- items */
- struct pool_allocator *pr_alloc;/* back-end allocator */
- TAILQ_ENTRY(pool) pr_alloc_list;/* link on allocator's pool list */
-
- /* Drain hook. */
- void (*pr_drain_hook)(void *, int);
- void *pr_drain_hook_arg;
-
- const char *pr_wchan; /* tsleep(9) identifier */
- unsigned int pr_flags; /* r/w flags */
- unsigned int pr_roflags; /* r/o flags */
-#define PR_NOWAIT 0x00 /* for symmetry */
-#define PR_WAITOK 0x02
-#define PR_WANTED 0x04
-#define PR_PHINPAGE 0x40
-#define PR_LOGGING 0x80
-#define PR_LIMITFAIL 0x100 /* even if waiting, fail if we hit limit */
-#define PR_RECURSIVE 0x200 /* pool contains pools, for vmstat(8) */
-#define PR_NOTOUCH 0x400 /* don't use free items to keep internal state*/
-#define PR_NOALIGN 0x800 /* don't assume backend alignment */
-
- /*
- * `pr_slock' protects the pool's data structures when removing
- * items from or returning items to the pool, or when reading
- * or updating read/write fields in the pool descriptor.
- *
- * We assume back-end page allocators provide their own locking
- * scheme. They will be called with the pool descriptor _unlocked_,
- * since the page allocators may block.
- */
- struct simplelock pr_slock;
-
- SPLAY_HEAD(phtree, pool_item_header) pr_phtree;
-
- int pr_maxcolor; /* Cache colouring */
- int pr_curcolor;
- int pr_phoffset; /* Offset in page of page header */
-
- /*
- * Warning message to be issued, and a per-time-delta rate cap,
- * if the hard limit is reached.
- */
- const char *pr_hardlimit_warning;
- struct timeval pr_hardlimit_ratecap;
- struct timeval pr_hardlimit_warning_last;
-
- /*
- * Instrumentation
- */
- unsigned long pr_nget; /* # of successful requests */
- unsigned long pr_nfail; /* # of unsuccessful requests */
- unsigned long pr_nput; /* # of releases */
- unsigned long pr_npagealloc; /* # of pages allocated */
- unsigned long pr_npagefree; /* # of pages released */
- unsigned int pr_hiwat; /* max # of pages in pool */
- unsigned long pr_nidle; /* # of idle pages */
-
- /*
- * Diagnostic aides.
- */
- struct pool_log *pr_log;
- int pr_curlogentry;
- int pr_logsize;
-
- const char *pr_entered_file; /* reentrancy check */
- long pr_entered_line;
-
-#if defined(_KERNEL)
- struct callback_entry pr_reclaimerentry;
-#endif
-};
-#endif /* __POOL_EXPOSE */
-
-#ifdef _KERNEL
-/*
- * pool_allocator_kmem is the default that all pools get unless
- * otherwise specified. pool_allocator_nointr is provided for
- * pools that know they will never be accessed in interrupt
- * context.
- */
-extern struct pool_allocator pool_allocator_kmem;
-extern struct pool_allocator pool_allocator_nointr;
-#ifdef POOL_SUBPAGE
-/* The above are subpage allocators in this case. */
-extern struct pool_allocator pool_allocator_kmem_fullpage;
-extern struct pool_allocator pool_allocator_nointr_fullpage;
-#endif
-
-struct link_pool_init { /* same as args to pool_init() */
- struct pool *pp;
- size_t size;
- u_int align;
- u_int align_offset;
- int flags;
- const char *wchan;
- struct pool_allocator *palloc;
-};
-#define POOL_INIT(pp, size, align, align_offset, flags, wchan, palloc) \
-struct pool pp; \
-static const struct link_pool_init _link_ ## pp[1] = { \
- { &pp, size, align, align_offset, flags, wchan, palloc } \
-}; \
-__link_set_add_rodata(pools, _link_ ## pp)
-
-void pool_subsystem_init(void);
-
-void pool_init(struct pool *, size_t, u_int, u_int,
- int, const char *, struct pool_allocator *);
-void pool_destroy(struct pool *);
-
-void pool_set_drain_hook(struct pool *,
- void (*)(void *, int), void *);
-
-void *pool_get(struct pool *, int);
-void pool_put(struct pool *, void *);
-int pool_reclaim(struct pool *);
-
-#ifdef POOL_DIAGNOSTIC
-/*
- * These versions do reentrancy checking.
- */
-void *_pool_get(struct pool *, int, const char *, long);
-void _pool_put(struct pool *, void *, const char *, long);
-int _pool_reclaim(struct pool *, const char *, long);
-#define pool_get(h, f) _pool_get((h), (f), __FILE__, __LINE__)
-#define pool_put(h, v) _pool_put((h), (v), __FILE__, __LINE__)
-#define pool_reclaim(h) _pool_reclaim((h), __FILE__, __LINE__)
-#endif /* POOL_DIAGNOSTIC */
-
-int pool_prime(struct pool *, int);
-void pool_setlowat(struct pool *, int);
-void pool_sethiwat(struct pool *, int);
-void pool_sethardlimit(struct pool *, int, const char *, int);
-void pool_drain(void *);
-
-/*
- * Debugging and diagnostic aides.
- */
-void pool_print(struct pool *, const char *);
-void pool_printit(struct pool *, const char *,
- void (*)(const char *, ...));
-void pool_printall(const char *, void (*)(const char *, ...));
-int pool_chk(struct pool *, const char *);
-
-/*
- * Pool cache routines.
- */
-void pool_cache_init(struct pool_cache *, struct pool *,
- int (*)(void *, void *, int),
- void (*)(void *, void *),
- void *);
-void pool_cache_destroy(struct pool_cache *);
-void *pool_cache_get_paddr(struct pool_cache *, int, paddr_t *);
-#define pool_cache_get(pc, f) pool_cache_get_paddr((pc), (f), NULL)
-void pool_cache_put_paddr(struct pool_cache *, void *, paddr_t);
-#define pool_cache_put(pc, o) pool_cache_put_paddr((pc), (o), \
- POOL_PADDR_INVALID)
-void pool_cache_destruct_object(struct pool_cache *, void *);
-void pool_cache_invalidate(struct pool_cache *);
-#endif /* _KERNEL */
-
-#endif /* _SYS_POOL_H_ */
diff --git a/StdLib/Include/sys/resource.h b/StdLib/Include/sys/resource.h deleted file mode 100644 index c54c816cd6..0000000000 --- a/StdLib/Include/sys/resource.h +++ /dev/null @@ -1,143 +0,0 @@ -/* $NetBSD: resource.h,v 1.29 2006/07/23 22:06:14 ad Exp $ */
-
-/*
- * Copyright (c) 1982, 1986, 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.
- *
- * @(#)resource.h 8.4 (Berkeley) 1/9/95
- */
-
-#ifndef _SYS_RESOURCE_H_
-#define _SYS_RESOURCE_H_
-
-#include <sys/featuretest.h>
-#include <sys/time.h>
-
-/*
- * Process priority specifications to get/setpriority.
- */
-#define PRIO_MIN -20
-#define PRIO_MAX 20
-
-#define PRIO_PROCESS 0
-#define PRIO_PGRP 1
-#define PRIO_USER 2
-
-/*
- * Resource utilization information.
- */
-
-#define RUSAGE_SELF 0
-#define RUSAGE_CHILDREN -1
-
-struct rusage {
- struct timeval ru_utime; /* user time used */
- struct timeval ru_stime; /* system time used */
- long ru_maxrss; /* max resident set size */
-#ifdef _KERNEL
-#define ru_first ru_ixrss
-#endif
- long ru_ixrss; /* integral shared memory size */
- long ru_idrss; /* integral unshared data " */
- long ru_isrss; /* integral unshared stack " */
- long ru_minflt; /* page reclaims */
- long ru_majflt; /* page faults */
- long ru_nswap; /* swaps */
- long ru_inblock; /* block input operations */
- long ru_oublock; /* block output operations */
- long ru_msgsnd; /* messages sent */
- long ru_msgrcv; /* messages received */
- long ru_nsignals; /* signals received */
- long ru_nvcsw; /* voluntary context switches */
- long ru_nivcsw; /* involuntary " */
-#ifdef _KERNEL
-#define ru_last ru_nivcsw
-#endif
-};
-
-/*
- * Resource limits
- */
-#define RLIMIT_CPU 0 /* cpu time in milliseconds */
-#define RLIMIT_FSIZE 1 /* maximum file size */
-#define RLIMIT_DATA 2 /* data size */
-#define RLIMIT_STACK 3 /* stack size */
-#define RLIMIT_CORE 4 /* core file size */
-#define RLIMIT_RSS 5 /* resident set size */
-#define RLIMIT_MEMLOCK 6 /* locked-in-memory address space */
-#define RLIMIT_NPROC 7 /* number of processes */
-#define RLIMIT_NOFILE 8 /* number of open files */
-#define RLIMIT_SBSIZE 9 /* maximum size of all socket buffers */
-
-#if defined(_NETBSD_SOURCE)
-#define RLIM_NLIMITS 10 /* number of resource limits */
-#endif
-
-#define RLIM_INFINITY (~((u_quad_t)1 << 63)) /* no limit */
-#define RLIM_SAVED_MAX RLIM_INFINITY /* unrepresentable hard limit */
-#define RLIM_SAVED_CUR RLIM_INFINITY /* unrepresentable soft limit */
-
-#if defined(_KERNEL)
-/* 4.3BSD compatibility rlimit argument structure. */
-struct orlimit {
- int32_t rlim_cur; /* current (soft) limit */
- int32_t rlim_max; /* maximum value for rlim_cur */
-};
-#endif
-
-struct rlimit {
- rlim_t rlim_cur; /* current (soft) limit */
- rlim_t rlim_max; /* maximum value for rlim_cur */
-};
-
-#if defined(_NETBSD_SOURCE)
-/* Load average structure. */
-struct loadavg {
- fixpt_t ldavg[3];
- long fscale;
-};
-#endif
-
-#ifdef _KERNEL
-extern struct loadavg averunnable;
-struct pcred;
-int dosetrlimit(struct lwp *, struct proc *, int, struct rlimit *);
-int donice(struct lwp *, struct proc *, int);
-
-#else
-#include <sys/EfiCdefs.h>
-
-__BEGIN_DECLS
-int getpriority(int, id_t);
-int getrlimit(int, struct rlimit *);
-int getrusage(int, struct rusage *);
-int setpriority(int, id_t, int);
-int setrlimit(int, const struct rlimit *);
-__END_DECLS
-
-#endif /* _KERNEL */
-#endif /* !_SYS_RESOURCE_H_ */
diff --git a/StdLib/Include/sys/select.h b/StdLib/Include/sys/select.h deleted file mode 100644 index 5166a0552f..0000000000 --- a/StdLib/Include/sys/select.h +++ /dev/null @@ -1,52 +0,0 @@ -/* $NetBSD: select.h,v 1.27 2006/02/16 20:17:20 perry Exp $ */
-
-/*-
- * Copyright (c) 1992, 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.
- *
- * @(#)select.h 8.2 (Berkeley) 1/4/94
- */
-
-#ifndef _SYS_SELECT_H_
-#define _SYS_SELECT_H_
-
-#include <sys/EfiCdefs.h>
-#include <sys/fd_set.h>
-
-#include <sys/sigtypes.h>
-#include <sys/time.h>
-#include <time.h>
-
-__BEGIN_DECLS
-int pselect(int, fd_set * __restrict, fd_set * __restrict,
- fd_set * __restrict, const struct timespec * __restrict,
- const sigset_t * __restrict);
-int select(int, fd_set * __restrict, fd_set * __restrict,
- fd_set * __restrict, struct timeval * __restrict);
-__END_DECLS
-
-#endif /* !_SYS_SELECT_H_ */
diff --git a/StdLib/Include/sys/signal.h b/StdLib/Include/sys/signal.h deleted file mode 100644 index e93b2aba37..0000000000 --- a/StdLib/Include/sys/signal.h +++ /dev/null @@ -1,68 +0,0 @@ -/** @file
-
- Implementation and Platform specific portion of <signal.h>.
-
- 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.
-**/
-#ifndef _SYS_SIGNAL_H
-#define _SYS_SIGNAL_H
-#include <sys/EfiCdefs.h>
-#include <machine/signal.h>
-
-/** The actual (default) signal numbers are assigned using an anonymous enum
- so that the compiler can do the work of assigning values. This helps
- ensure that the developer should never have to renumber the signals or
- figure out what number to assign to a new signal.
-
- Properly constructed programs will NEVER depend upon signal numbers being
- in a particular order or having a particular value. All that is guaranteed
- is that each signal number is distinct, positive, and non-zero.
-**/
-enum {
- __SigInt = 1,
- __SigIll,
- __SigAbrt,
- __SigFpe,
- __SigSegv,
- __SigTerm,
- __SigBreak,
- __SigAlrm,
- __SigVtAlrm,
- __SigProf,
- __SigUsr1,
- __SigUsr2,
- __SigWinch,
- __SigPipe,
- __SigQuit,
- __Sig_Last
-};
-
-/** The type of a signal handler function. **/
-typedef void __sighandler_t(int);
-
-__BEGIN_DECLS
-/** The signal function associates a "signal handler" with a signal number.
-
- For historical reasons; programs expect signal to be declared
- in <sys/signal.h>.
-
- @param[in] sig Signal number that function is to be associated with.
- @param[in] function The "handler" function to be associated with signal sig.
-
- @return If the request can be honored, the signal function returns the
- value of func for the most recent successful call to signal for
- the specified signal sig. Otherwise, a value of SIG_ERR is
- returned and a positive value is stored in errno.
- */
-__sighandler_t *signal(int sig, __sighandler_t *func);
-
-__END_DECLS
-
-#endif /* _SYS_SIGNAL_H */
diff --git a/StdLib/Include/sys/sigtypes.h b/StdLib/Include/sys/sigtypes.h deleted file mode 100644 index c640296f49..0000000000 --- a/StdLib/Include/sys/sigtypes.h +++ /dev/null @@ -1,123 +0,0 @@ -/* $NetBSD: sigtypes.h,v 1.8 2005/12/11 12:25:21 christos Exp $ */
-
-/*
- * Copyright (c) 1982, 1986, 1989, 1991, 1993
- * The Regents of the University of California. All rights reserved.
- * (c) UNIX System Laboratories, Inc.
- * All or some portions of this file are derived from material licensed
- * to the University of California by American Telephone and Telegraph
- * Co. or Unix System Laboratories, Inc. and are reproduced herein with
- * the permission of UNIX System Laboratories, Inc.
- *
- * 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.
- *
- * @(#)signal.h 8.4 (Berkeley) 5/4/95
- */
-
-#ifndef _SYS_SIGTYPES_H_
-#define _SYS_SIGTYPES_H_
-
-/*
- * This header file defines various signal-related types. We also keep
- * the macros to manipulate sigset_t here, to encapsulate knowledge of
- * its internals.
- */
-
-#include <sys/featuretest.h>
-#include <machine/int_types.h>
-#include <machine/ansi.h>
-
-#ifdef _EFI_SIZE_T_
- typedef _EFI_SIZE_T_ size_t;
- #undef _EFI_SIZE_T_
- #undef _BSD_SIZE_T_
-#endif
-
-#if defined(_POSIX_C_SOURCE) || defined(_XOPEN_SOURCE) || \
- defined(_NETBSD_SOURCE)
-
-typedef struct {
- __uint32_t __bits[4];
-} sigset_t;
-
-/*
- * Macro for manipulating signal masks.
- */
-#define __sigmask(n) (1 << (((unsigned int)(n) - 1) & 31))
-#define __sigword(n) (((unsigned int)(n) - 1) >> 5)
-#define __sigaddset(s, n) ((s)->__bits[__sigword(n)] |= __sigmask(n))
-#define __sigdelset(s, n) ((s)->__bits[__sigword(n)] &= ~__sigmask(n))
-#define __sigismember(s, n) (((s)->__bits[__sigword(n)] & __sigmask(n)) != 0)
-#define __sigemptyset(s) ((s)->__bits[0] = 0x00000000, \
- (s)->__bits[1] = 0x00000000, \
- (s)->__bits[2] = 0x00000000, \
- (s)->__bits[3] = 0x00000000)
-#define __sigsetequal(s1,s2) ((s1)->__bits[0] == (s2)->__bits[0] && \
- (s1)->__bits[1] == (s2)->__bits[1] && \
- (s1)->__bits[2] == (s2)->__bits[2] && \
- (s1)->__bits[3] == (s2)->__bits[3])
-#define __sigfillset(s) ((s)->__bits[0] = 0xffffffff, \
- (s)->__bits[1] = 0xffffffff, \
- (s)->__bits[2] = 0xffffffff, \
- (s)->__bits[3] = 0xffffffff)
-#define __sigplusset(s, t) \
- do { \
- (t)->__bits[0] |= (s)->__bits[0]; \
- (t)->__bits[1] |= (s)->__bits[1]; \
- (t)->__bits[2] |= (s)->__bits[2]; \
- (t)->__bits[3] |= (s)->__bits[3]; \
- } while (/* CONSTCOND */ 0)
-#define __sigminusset(s, t) \
- do { \
- (t)->__bits[0] &= ~(s)->__bits[0]; \
- (t)->__bits[1] &= ~(s)->__bits[1]; \
- (t)->__bits[2] &= ~(s)->__bits[2]; \
- (t)->__bits[3] &= ~(s)->__bits[3]; \
- } while (/* CONSTCOND */ 0)
-#define __sigandset(s, t) \
- do { \
- (t)->__bits[0] &= (s)->__bits[0]; \
- (t)->__bits[1] &= (s)->__bits[1]; \
- (t)->__bits[2] &= (s)->__bits[2]; \
- (t)->__bits[3] &= (s)->__bits[3]; \
- } while (/* CONSTCOND */ 0)
-
-#if (defined(_XOPEN_SOURCE) && defined(_XOPEN_SOURCE_EXTENDED)) || \
- (_XOPEN_SOURCE - 0) >= 500 || defined(_NETBSD_SOURCE)
-typedef struct
-#if defined(_NETBSD_SOURCE)
- sigaltstack
-#endif /* _NETBSD_SOURCE */
- {
- void *ss_sp; /* signal stack base */
- size_t ss_size; /* signal stack length */
- int ss_flags; /* SS_DISABLE and/or SS_ONSTACK */
-} stack_t;
-
-#endif /* _XOPEN_SOURCE_EXTENDED || XOPEN_SOURCE >= 500 || _NETBSD_SOURCE */
-
-#endif /* _POSIX_C_SOURCE || _XOPEN_SOURCE || ... */
-
-#endif /* !_SYS_SIGTYPES_H_ */
diff --git a/StdLib/Include/sys/socket.h b/StdLib/Include/sys/socket.h deleted file mode 100644 index 11434ed641..0000000000 --- a/StdLib/Include/sys/socket.h +++ /dev/null @@ -1,571 +0,0 @@ -/* $NetBSD: socket.h,v 1.82 2006/06/27 03:49:08 mrg Exp $ */
-
-/*
- * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
- * 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 project 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 PROJECT 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 PROJECT 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.
- */
-
-/*
- * Copyright (c) 1982, 1985, 1986, 1988, 1993, 1994
- * 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.
- *
- * @(#)socket.h 8.6 (Berkeley) 5/3/95
- */
-
-#ifndef _SYS_SOCKET_H_
-#define _SYS_SOCKET_H_
-
-#include <sys/featuretest.h>
-
-/*
- * Definitions related to sockets: types, address families, options.
- */
-
-/*
- * Data types.
- */
-#include <sys/ansi.h>
-
-#ifndef sa_family_t
-typedef __sa_family_t sa_family_t;
-#define sa_family_t __sa_family_t
-#endif
-
-#ifndef socklen_t
-typedef __socklen_t socklen_t;
-#define socklen_t __socklen_t
-#endif
-
-#include <machine/ansi.h>
-
-#ifdef _EFI_SIZE_T_
-typedef _EFI_SIZE_T_ size_t;
-#undef _EFI_SIZE_T_
-#undef _BSD_SIZE_T_
-#endif
-
-#ifdef _BSD_SSIZE_T_
-typedef _BSD_SSIZE_T_ ssize_t;
-#undef _BSD_SSIZE_T_
-#endif
-
-#include <sys/uio.h>
-
-/*
- * Socket types.
- */
-#define SOCK_STREAM 1 /* stream socket */
-#define SOCK_DGRAM 2 /* datagram socket */
-#define SOCK_RAW 3 /* raw-protocol interface */
-#define SOCK_RDM 4 /* reliably-delivered message */
-#define SOCK_SEQPACKET 5 /* sequenced packet stream */
-
-/*
- * Option flags per-socket.
- */
-#define SO_DEBUG 0x0001 /* turn on debugging info recording */
-#define SO_ACCEPTCONN 0x0002 /* socket has had listen() */
-#define SO_REUSEADDR 0x0004 /* allow local address reuse */
-#define SO_KEEPALIVE 0x0008 /* keep connections alive */
-#define SO_DONTROUTE 0x0010 /* just use interface addresses */
-#define SO_BROADCAST 0x0020 /* permit sending of broadcast msgs */
-#define SO_USELOOPBACK 0x0040 /* bypass hardware when possible */
-#define SO_LINGER 0x0080 /* linger on close if data present */
-#define SO_OOBINLINE 0x0100 /* leave received OOB data in line */
-#define SO_REUSEPORT 0x0200 /* allow local address & port reuse */
-#define SO_TIMESTAMP 0x0400 /* timestamp received dgram traffic */
-
-
-/*
- * Additional options, not kept in so_options.
- */
-#define SO_SNDBUF 0x1001 /* send buffer size */
-#define SO_RCVBUF 0x1002 /* receive buffer size */
-#define SO_SNDLOWAT 0x1003 /* send low-water mark */
-#define SO_RCVLOWAT 0x1004 /* receive low-water mark */
-#define SO_SNDTIMEO 0x1005 /* send timeout */
-#define SO_RCVTIMEO 0x1006 /* receive timeout */
-#define SO_ERROR 0x1007 /* get error status and clear */
-#define SO_TYPE 0x1008 /* get socket type */
-#define SO_OVERFLOWED 0x1009 /* datagrams: return packets dropped */
-
-/*
- * Structure used for manipulating linger option.
- */
-struct linger {
- int l_onoff; /* option on/off */
- int l_linger; /* linger time in seconds */
-};
-
-/*
- * Level number for (get/set)sockopt() to apply to socket itself.
- */
-#define SOL_SOCKET 0xffff /* options for socket level */
-
-/*
- * Address families.
- */
-#define AF_UNSPEC 0 /* unspecified */
-#define AF_LOCAL 1 /* local to host (pipes, portals) */
-#define AF_UNIX AF_LOCAL /* backward compatibility */
-#define AF_INET 2 /* internetwork: UDP, TCP, etc. */
-#define AF_IMPLINK 3 /* arpanet imp addresses */
-#define AF_PUP 4 /* pup protocols: e.g. BSP */
-#define AF_CHAOS 5 /* mit CHAOS protocols */
-#define AF_NS 6 /* XEROX NS protocols */
-#define AF_ISO 7 /* ISO protocols */
-#define AF_OSI AF_ISO
-#define AF_ECMA 8 /* european computer manufacturers */
-#define AF_DATAKIT 9 /* datakit protocols */
-#define AF_CCITT 10 /* CCITT protocols, X.25 etc */
-#define AF_SNA 11 /* IBM SNA */
-#define AF_DECnet 12 /* DECnet */
-#define AF_DLI 13 /* DEC Direct data link interface */
-#define AF_LAT 14 /* LAT */
-#define AF_HYLINK 15 /* NSC Hyperchannel */
-#define AF_APPLETALK 16 /* Apple Talk */
-#define AF_ROUTE 17 /* Internal Routing Protocol */
-#define AF_LINK 18 /* Link layer interface */
-#if defined(_NETBSD_SOURCE)
-#define pseudo_AF_XTP 19 /* eXpress Transfer Protocol (no AF) */
-#endif
-#define AF_COIP 20 /* connection-oriented IP, aka ST II */
-#define AF_CNT 21 /* Computer Network Technology */
-#if defined(_NETBSD_SOURCE)
-#define pseudo_AF_RTIP 22 /* Help Identify RTIP packets */
-#endif
-#define AF_IPX 23 /* Novell Internet Protocol */
-#define AF_INET6 24 /* IP version 6 */
-#if defined(_NETBSD_SOURCE)
-#define pseudo_AF_PIP 25 /* Help Identify PIP packets */
-#endif
-#define AF_ISDN 26 /* Integrated Services Digital Network*/
-#define AF_E164 AF_ISDN /* CCITT E.164 recommendation */
-#define AF_NATM 27 /* native ATM access */
-#define AF_ARP 28 /* (rev.) addr. res. prot. (RFC 826) */
-#if defined(_NETBSD_SOURCE)
-#define pseudo_AF_KEY 29 /* Internal key management protocol */
-#define pseudo_AF_HDRCMPLT 30 /* Used by BPF to not rewrite hdrs
- in interface output routine */
-#endif
-#define AF_BLUETOOTH 31
-
-#define AF_MAX 32
-
-/*
- * Structure used by kernel to store most
- * addresses.
- */
-struct sockaddr {
- __uint8_t sa_len; /* total length */
- sa_family_t sa_family; /* address family */
- char sa_data[14]; /* actually longer; address value */
-};
-
-#if defined(_KERNEL)
-/*
- * Structure used by kernel to pass protocol
- * information in raw sockets.
- */
-struct sockproto {
- u_short sp_family; /* address family */
- u_short sp_protocol; /* protocol */
-};
-#endif /* _KERNEL */
-
-#if 1
-/*
- * RFC 2553: protocol-independent placeholder for socket addresses
- */
-#define _SS_MAXSIZE 128
-#define _SS_ALIGNSIZE (sizeof(__int64_t))
-#define _SS_PAD1SIZE (_SS_ALIGNSIZE - 2)
-#define _SS_PAD2SIZE (_SS_MAXSIZE - 2 - \
- _SS_PAD1SIZE - _SS_ALIGNSIZE)
-
-#if (_XOPEN_SOURCE - 0) >= 500 || defined(_NETBSD_SOURCE)
-struct sockaddr_storage {
- __uint8_t ss_len; /* address length */
- sa_family_t ss_family; /* address family */
- char __ss_pad1[_SS_PAD1SIZE];
- __int64_t __ss_align;/* force desired structure storage alignment */
- char __ss_pad2[_SS_PAD2SIZE];
-};
-#endif /* _XOPEN_SOURCE >= 500 || _NETBSD_SOURCE */
-#endif /* 1 */
-
-/*
- * Protocol families, same as address families for now.
- */
-#define PF_UNSPEC AF_UNSPEC
-#define PF_LOCAL AF_LOCAL
-#define PF_UNIX PF_LOCAL /* backward compatibility */
-#define PF_INET AF_INET
-#define PF_IMPLINK AF_IMPLINK
-#define PF_PUP AF_PUP
-#define PF_CHAOS AF_CHAOS
-#define PF_NS AF_NS
-#define PF_ISO AF_ISO
-#define PF_OSI AF_ISO
-#define PF_ECMA AF_ECMA
-#define PF_DATAKIT AF_DATAKIT
-#define PF_CCITT AF_CCITT
-#define PF_SNA AF_SNA
-#define PF_DECnet AF_DECnet
-#define PF_DLI AF_DLI
-#define PF_LAT AF_LAT
-#define PF_HYLINK AF_HYLINK
-#define PF_APPLETALK AF_APPLETALK
-#define PF_ROUTE AF_ROUTE
-#define PF_LINK AF_LINK
-#if defined(_NETBSD_SOURCE)
-#define PF_XTP pseudo_AF_XTP /* really just proto family, no AF */
-#endif
-#define PF_COIP AF_COIP
-#define PF_CNT AF_CNT
-#define PF_INET6 AF_INET6
-#define PF_IPX AF_IPX /* same format as AF_NS */
-#if defined(_NETBSD_SOURCE)
-#define PF_RTIP pseudo_AF_RTIP /* same format as AF_INET */
-#define PF_PIP pseudo_AF_PIP
-#endif
-#define PF_ISDN AF_ISDN /* same as E164 */
-#define PF_E164 AF_E164
-#define PF_NATM AF_NATM
-#define PF_ARP AF_ARP
-#if defined(_NETBSD_SOURCE)
-#define PF_KEY pseudo_AF_KEY /* like PF_ROUTE, only for key mgmt */
-#endif
-#define PF_BLUETOOTH AF_BLUETOOTH
-
-#define PF_MAX AF_MAX
-
-#if defined(_NETBSD_SOURCE)
-
-#ifndef gid_t
-typedef __gid_t gid_t; /* group id */
-#define gid_t __gid_t
-#endif
-
-#ifndef uid_t
-typedef __uid_t uid_t; /* user id */
-#define uid_t __uid_t
-#endif
-
-/*
- * Socket credentials.
- */
-struct sockcred {
- uid_t sc_uid; /* real user id */
- uid_t sc_euid; /* effective user id */
- gid_t sc_gid; /* real group id */
- gid_t sc_egid; /* effective group id */
- int sc_ngroups; /* number of supplemental groups */
- gid_t sc_groups[1]; /* variable length */
-};
-
-/*
- * Compute size of a sockcred structure with groups.
- */
-#define SOCKCREDSIZE(ngrps) \
- (sizeof(struct sockcred) + (sizeof(gid_t) * ((ngrps) - 1)))
-#endif /* _NETBSD_SOURCE */
-
-
-#if defined(_NETBSD_SOURCE)
-/*
- * Definitions for network related sysctl, CTL_NET.
- *
- * Second level is protocol family.
- * Third level is protocol number.
- *
- * Further levels are defined by the individual families below.
- */
-#define NET_MAXID AF_MAX
-
-#define CTL_NET_NAMES { \
- { 0, 0 }, \
- { "local", CTLTYPE_NODE }, \
- { "inet", CTLTYPE_NODE }, \
- { "implink", CTLTYPE_NODE }, \
- { "pup", CTLTYPE_NODE }, \
- { "chaos", CTLTYPE_NODE }, \
- { "xerox_ns", CTLTYPE_NODE }, \
- { "iso", CTLTYPE_NODE }, \
- { "emca", CTLTYPE_NODE }, \
- { "datakit", CTLTYPE_NODE }, \
- { "ccitt", CTLTYPE_NODE }, \
- { "ibm_sna", CTLTYPE_NODE }, \
- { "decnet", CTLTYPE_NODE }, \
- { "dec_dli", CTLTYPE_NODE }, \
- { "lat", CTLTYPE_NODE }, \
- { "hylink", CTLTYPE_NODE }, \
- { "appletalk", CTLTYPE_NODE }, \
- { "route", CTLTYPE_NODE }, \
- { "link_layer", CTLTYPE_NODE }, \
- { "xtp", CTLTYPE_NODE }, \
- { "coip", CTLTYPE_NODE }, \
- { "cnt", CTLTYPE_NODE }, \
- { "rtip", CTLTYPE_NODE }, \
- { "ipx", CTLTYPE_NODE }, \
- { "inet6", CTLTYPE_NODE }, \
- { "pip", CTLTYPE_NODE }, \
- { "isdn", CTLTYPE_NODE }, \
- { "natm", CTLTYPE_NODE }, \
- { "arp", CTLTYPE_NODE }, \
- { "key", CTLTYPE_NODE }, \
-}
-
-struct kinfo_pcb {
- __uint64_t ki_pcbaddr; /* PTR: pcb addr */
- __uint64_t ki_ppcbaddr; /* PTR: ppcb addr */
- __uint64_t ki_sockaddr; /* PTR: socket addr */
-
- __uint32_t ki_family; /* INT: protocol family */
- __uint32_t ki_type; /* INT: socket type */
- __uint32_t ki_protocol; /* INT: protocol */
- __uint32_t ki_pflags; /* INT: generic protocol flags */
-
- __uint32_t ki_sostate; /* INT: socket state */
- __uint32_t ki_prstate; /* INT: protocol state */
- __int32_t ki_tstate; /* INT: tcp state */
- __uint32_t ki_tflags; /* INT: tcp flags */
-
- __uint64_t ki_rcvq; /* U_LONG: receive queue len */
- __uint64_t ki_sndq; /* U_LONG: send queue len */
-
- union {
- struct sockaddr _kis_src; /* STRUCT: local address */
- char _kis_pad[256 + 8]; /* pad to max addr length */
- } ki_s;
- union {
- struct sockaddr _kid_dst; /* STRUCT: remote address */
- char _kid_pad[256 + 8]; /* pad to max addr length */
- } ki_d;
-
- __uint64_t ki_inode; /* INO_T: fake inode number */
- __uint64_t ki_vnode; /* PTR: if associated with file */
- __uint64_t ki_conn; /* PTR: control block of peer */
- __uint64_t ki_refs; /* PTR: referencing socket */
- __uint64_t ki_nextref; /* PTR: link in refs list */
-};
-
-#define ki_src ki_s._kis_src
-#define ki_dst ki_d._kid_dst
-
-#define PCB_SLOP 20
-#define PCB_ALL 0
-
-#endif /* _NETBSD_SOURCE */
-
-#if defined(_NETBSD_SOURCE)
-/*
- * PF_ROUTE - Routing table
- *
- * Three additional levels are defined:
- * Fourth: address family, 0 is wildcard
- * Fifth: type of info, defined below
- * Sixth: flag(s) to mask with for NET_RT_FLAGS
- */
-#define NET_RT_DUMP 1 /* dump; may limit to a.f. */
-#define NET_RT_FLAGS 2 /* by flags, e.g. RESOLVING */
-#define NET_RT_OIFLIST 3 /* old NET_RT_IFLIST (pre 1.5) */
-#define NET_RT_IFLIST 4 /* survey interface list */
-#define NET_RT_MAXID 5
-
-#define CTL_NET_RT_NAMES { \
- { 0, 0 }, \
- { "dump", CTLTYPE_STRUCT }, \
- { "flags", CTLTYPE_STRUCT }, \
- { 0, 0 }, \
- { "iflist", CTLTYPE_STRUCT }, \
-}
-#endif /* _NETBSD_SOURCE */
-
-/*
- * Maximum queue length specifiable by listen(2).
- */
-#ifndef SOMAXCONN
-#define SOMAXCONN 128
-#endif
-
-/*
- * Message header for recvmsg and sendmsg calls.
- * Used value-result for recvmsg, value only for sendmsg.
- */
-struct msghdr {
- void *msg_name; /* optional address */
- socklen_t msg_namelen; /* size of address */
- struct iovec *msg_iov; /* scatter/gather array */
- int msg_iovlen; /* # elements in msg_iov */
- void *msg_control; /* ancillary data, see below */
- socklen_t msg_controllen; /* ancillary data buffer len */
- int msg_flags; /* flags on received message */
-};
-
-#define MSG_OOB 0x0001 /* process out-of-band data */
-#define MSG_PEEK 0x0002 /* peek at incoming message */
-#define MSG_DONTROUTE 0x0004 /* send without using routing tables */
-#define MSG_EOR 0x0008 /* data completes record */
-#define MSG_TRUNC 0x0010 /* data discarded before delivery */
-#define MSG_CTRUNC 0x0020 /* control data lost before delivery */
-#define MSG_WAITALL 0x0040 /* wait for full request or error */
-#define MSG_DONTWAIT 0x0080 /* this message should be nonblocking */
-#define MSG_BCAST 0x0100 /* this message was rcvd using link-level brdcst */
-#define MSG_MCAST 0x0200 /* this message was rcvd using link-level mcast */
-#define MSG_NOSIGNAL 0x0400 /* do not generate SIGPIPE on EOF */
-
-/*
- * Header for ancillary data objects in msg_control buffer.
- * Used for additional information with/about a datagram
- * not expressible by flags. The format is a sequence
- * of message elements headed by cmsghdr structures.
- */
-struct cmsghdr {
- socklen_t cmsg_len; /* data byte count, including hdr */
- int cmsg_level; /* originating protocol */
- int cmsg_type; /* protocol-specific type */
-/* followed by u_char cmsg_data[]; */
-};
-
-/* given pointer to struct cmsghdr, return pointer to data */
-#define CMSG_DATA(cmsg) \
- ((u_char *)(void *)(cmsg) + __CMSG_ALIGN(sizeof(struct cmsghdr)))
-#define CCMSG_DATA(cmsg) \
- ((const u_char *)(const void *)(cmsg) + \
- __CMSG_ALIGN(sizeof(struct cmsghdr)))
-
-/*
- * Alignment requirement for CMSG struct manipulation.
- * This basically behaves the same as ALIGN() ARCH/include/param.h.
- * We declare it separately for two reasons:
- * (1) avoid dependency between machine/param.h, and (2) to sync with kernel's
- * idea of ALIGNBYTES at runtime.
- * without (2), we can't guarantee binary compatibility in case of future
- * changes in ALIGNBYTES.
- */
-#define __CMSG_ALIGN(n) (((n) + __cmsg_alignbytes()) & ~__cmsg_alignbytes())
-#ifdef _KERNEL
-#define CMSG_ALIGN(n) __CMSG_ALIGN(n)
-#endif
-
-/* given pointer to struct cmsghdr, return pointer to next cmsghdr */
-#define CMSG_NXTHDR(mhdr, cmsg) \
- (((__caddr_t)(cmsg) + __CMSG_ALIGN((cmsg)->cmsg_len) + \
- __CMSG_ALIGN(sizeof(struct cmsghdr)) > \
- (((__caddr_t)(mhdr)->msg_control) + (mhdr)->msg_controllen)) ? \
- (struct cmsghdr *)0 : \
- (struct cmsghdr *)((__caddr_t)(cmsg) + \
- __CMSG_ALIGN((cmsg)->cmsg_len)))
-
-/*
- * RFC 2292 requires to check msg_controllen, in case that the kernel returns
- * an empty list for some reasons.
- */
-#define CMSG_FIRSTHDR(mhdr) \
- ((mhdr)->msg_controllen >= sizeof(struct cmsghdr) ? \
- (struct cmsghdr *)(mhdr)->msg_control : \
- (struct cmsghdr *)0)
-
-#define CMSG_SPACE(l) (__CMSG_ALIGN(sizeof(struct cmsghdr)) + __CMSG_ALIGN(l))
-#define CMSG_LEN(l) (__CMSG_ALIGN(sizeof(struct cmsghdr)) + (l))
-
-/* "Socket"-level control message types: */
-#define SCM_RIGHTS 0x01 /* access rights (array of int) */
-#if defined(_NETBSD_SOURCE)
-#define SCM_TIMESTAMP 0x02 /* timestamp (struct timeval) */
-#define SCM_CREDS 0x04 /* credentials (struct sockcred) */
-#endif
-
-/*
- * Types of socket shutdown(2).
- */
-#define SHUT_RD 0 /* Disallow further receives. */
-#define SHUT_WR 1 /* Disallow further sends. */
-#define SHUT_RDWR 2 /* Disallow further sends/receives. */
-
-#include <sys/EfiCdefs.h>
-
-__BEGIN_DECLS
-int __cmsg_alignbytes(void);
-__END_DECLS
-
-#ifndef _KERNEL
-
-__BEGIN_DECLS
-int accept(int, struct sockaddr * __restrict, socklen_t * __restrict);
-int bind(int, const struct sockaddr *, socklen_t);
-int connect(int, const struct sockaddr *, socklen_t);
-int getpeername(int, struct sockaddr * __restrict, socklen_t * __restrict);
-int getsockname(int, struct sockaddr * __restrict, socklen_t * __restrict);
-int getsockopt(int, int, int, void * __restrict, socklen_t * __restrict);
-int listen(int, int);
-ssize_t recv(int, void *, size_t, int);
-ssize_t recvfrom(int, void * __restrict, size_t, int,
- struct sockaddr * __restrict, socklen_t * __restrict);
-ssize_t recvmsg(int, struct msghdr *, int);
-ssize_t send(int, const void *, size_t, int);
-ssize_t sendto(int, const void *,
- size_t, int, const struct sockaddr *, socklen_t);
-ssize_t sendmsg(int, const struct msghdr *, int);
-int setsockopt(int, int, int, const void *, socklen_t);
-int shutdown(int, int);
-int sockatmark(int);
-int socket(int, int, int)
-#if !defined(__LIBC12_SOURCE__) && !defined(_STANDALONE)
-__RENAME(__socket30)
-#endif
- ;
-int socketpair(int, int, int, int *);
-__END_DECLS
-#endif /* !_KERNEL */
-
-#endif /* !_SYS_SOCKET_H_ */
diff --git a/StdLib/Include/sys/sockio.h b/StdLib/Include/sys/sockio.h deleted file mode 100644 index 5711ed2014..0000000000 --- a/StdLib/Include/sys/sockio.h +++ /dev/null @@ -1,100 +0,0 @@ -/*-
- * Copyright (c) 1982, 1986, 1990, 1993, 1994
- * The Regents of the University of California. All rights reserved.
- *
- * Portions copyright (c) 1999, 2000
- * Intel Corporation.
- * 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. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- *
- * This product includes software developed by the University of
- * California, Berkeley, Intel Corporation, and its contributors.
- *
- * 4. Neither the name of University, Intel Corporation, or their respective
- * 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, INTEL CORPORATION 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,
- * INTEL CORPORATION 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.
- *
- * @(#)sockio.h 8.1 (Berkeley) 3/28/94
- * $Id: sockio.h,v 1.1.1.1 2006/05/30 06:12:59 hhzhou Exp $
- */
-
-#ifndef _SYS_SOCKIO_H_
-#define _SYS_SOCKIO_H_
-
-#include <sys/ioccom.h>
-
-/* Socket ioctl's. */
-#define SIOCSHIWAT _IOW('s', 0, int) /* set high watermark */
-#define SIOCGHIWAT _IOR('s', 1, int) /* get high watermark */
-#define SIOCSLOWAT _IOW('s', 2, int) /* set low watermark */
-#define SIOCGLOWAT _IOR('s', 3, int) /* get low watermark */
-#define SIOCATMARK _IOR('s', 7, int) /* at oob mark? */
-#define SIOCSPGRP _IOW('s', 8, int) /* set process group */
-#define SIOCGPGRP _IOR('s', 9, int) /* get process group */
-#ifndef _ORG_FREEBSD_
-#define SIOCUPCALL _IOW('s', 10, struct upcall_req)/* register upcall req */
-#endif
-
-#define SIOCADDRT _IOW('r', 10, struct ortentry) /* add route */
-#define SIOCDELRT _IOW('r', 11, struct ortentry) /* delete route */
-#define SIOCGETVIFCNT _IOWR('r', 15, struct sioc_vif_req)/* get vif pkt cnt */
-#define SIOCGETSGCNT _IOWR('r', 16, struct sioc_sg_req) /* get s,g pkt cnt */
-
-#define SIOCSIFADDR _IOW('i', 12, struct ifreq) /* set ifnet address */
-#define OSIOCGIFADDR _IOWR('i', 13, struct ifreq) /* get ifnet address */
-#define SIOCGIFADDR _IOWR('i', 33, struct ifreq) /* get ifnet address */
-#define SIOCSIFDSTADDR _IOW('i', 14, struct ifreq) /* set p-p address */
-#define OSIOCGIFDSTADDR _IOWR('i', 15, struct ifreq) /* get p-p address */
-#define SIOCGIFDSTADDR _IOWR('i', 34, struct ifreq) /* get p-p address */
-#define SIOCSIFFLAGS _IOW('i', 16, struct ifreq) /* set ifnet flags */
-#define SIOCGIFFLAGS _IOWR('i', 17, struct ifreq) /* get ifnet flags */
-#define OSIOCGIFBRDADDR _IOWR('i', 18, struct ifreq) /* get broadcast addr */
-#define SIOCGIFBRDADDR _IOWR('i', 35, struct ifreq) /* get broadcast addr */
-#define SIOCSIFBRDADDR _IOW('i', 19, struct ifreq) /* set broadcast addr */
-#define OSIOCGIFCONF _IOWR('i', 20, struct ifconf) /* get ifnet list */
-#define SIOCGIFCONF _IOWR('i', 36, struct ifconf) /* get ifnet list */
-#define OSIOCGIFNETMASK _IOWR('i', 21, struct ifreq) /* get net addr mask */
-#define SIOCGIFNETMASK _IOWR('i', 37, struct ifreq) /* get net addr mask */
-#define SIOCSIFNETMASK _IOW('i', 22, struct ifreq) /* set net addr mask */
-#define SIOCGIFMETRIC _IOWR('i', 23, struct ifreq) /* get IF metric */
-#define SIOCSIFMETRIC _IOW('i', 24, struct ifreq) /* set IF metric */
-#define SIOCDIFADDR _IOW('i', 25, struct ifreq) /* delete IF addr */
-#define SIOCAIFADDR _IOW('i', 26, struct ifaliasreq)/* add/chg IF alias */
-
-#define SIOCADDMULTI _IOW('i', 49, struct ifreq) /* add m'cast addr */
-#define SIOCDELMULTI _IOW('i', 50, struct ifreq) /* del m'cast addr */
-#define SIOCGIFMTU _IOWR('i', 51, struct ifreq) /* get IF mtu */
-#define SIOCSIFMTU _IOW('i', 52, struct ifreq) /* set IF mtu */
-#define SIOCGIFPHYS _IOWR('i', 53, struct ifreq) /* get IF wire */
-#define SIOCSIFPHYS _IOW('i', 54, struct ifreq) /* set IF wire */
-#define SIOCSIFMEDIA _IOWR('i', 55, struct ifreq) /* set net media */
-#define SIOCGIFMEDIA _IOWR('i', 56, struct ifmediareq) /* get net media */
-#define SIOCSIFGENERIC _IOW('i', 57, struct ifreq) /* generic IF set op */
-#define SIOCGIFGENERIC _IOWR('i', 58, struct ifreq) /* generic IF get op */
-
-#endif /* !_SYS_SOCKIO_H_ */
diff --git a/StdLib/Include/sys/stat.h b/StdLib/Include/sys/stat.h deleted file mode 100644 index 83fc58025a..0000000000 --- a/StdLib/Include/sys/stat.h +++ /dev/null @@ -1,217 +0,0 @@ -/** @file
-
- Copyright (c) 2010 - 2014, 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) 1982, 1986, 1989, 1993
- The Regents of the University of California. All rights reserved.
- (c) UNIX System Laboratories, Inc.
- All or some portions of this file are derived from material licensed
- to the University of California by American Telephone and Telegraph
- Co. or Unix System Laboratories, Inc. and are reproduced herein with
- the permission of UNIX System Laboratories, Inc.
-
- 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.
-
- stat.h 8.12 (Berkeley) 8/17/94
- NetBSD: stat.h,v 1.54 2006/02/24 22:01:30 thorpej Exp
- */
-#ifndef _SYS_STAT_H_
-#define _SYS_STAT_H_
-
-#include <sys/featuretest.h>
-#include <sys/types.h>
-#include <sys/time.h>
-
-struct stat {
- off_t st_size; ///< file size, in bytes
- off_t st_physsize; ///< physical space the file consumes
- off_t st_curpos; ///< current position within the file, or XY coord. for Console
- dtime_t st_birthtime; ///< time of creation
- dtime_t st_atime; ///< time of last access
- dtime_t st_mtime; ///< time of last data modification
- mode_t st_mode; ///< file attributes
-
- blksize_t st_blksize; ///< optimal blocksize for I/O
- uint32_t st_spare[1];
-};
-
-#define S_ISUID 0004000 ///< set user id on execution
-#define S_ISGID 0002000 ///< set group id on execution
-#define S_ISTXT 0001000 ///< sticky bit
-
-#define S_IRWXU 0000700 ///< RWX mask for owner
-#define S_IRUSR 0000400 ///< R for owner
-#define S_IWUSR 0000200 ///< W for owner
-#define S_IXUSR 0000100 ///< X for owner
-
-#define S_IREAD S_IRUSR
-#define S_IWRITE S_IWUSR
-#define S_IEXEC S_IXUSR
-
-#define S_IRWXG 0000070 ///< RWX mask for group
-#define S_IRGRP 0000040 ///< R for group
-#define S_IWGRP 0000020 ///< W for group
-#define S_IXGRP 0000010 ///< X for group
-
-#define S_IRWXO 0000007 ///< RWX mask for other
-#define S_IROTH 0000004 ///< R for other
-#define S_IWOTH 0000002 ///< W for other
-#define S_IXOTH 0000001 ///< X for other
-
-/* The Octal access modes, above, fall into the Hex mask 0x00000FFF.
- Traditionally, the remainder of the flags are specified in Octal
- but they are expressed in Hex here for modern clarity.
-
- The basic file types, specified within 0x0000F000, are mutually exclusive.
-*/
-#define _S_IFMT 0x000FF000 ///< type-of-file mask
-#define _S_IFIFO 0x00001000 ///< named pipe (fifo)
-#define _S_IFCHR 0x00002000 ///< character special device
-#define _S_IFDIR 0x00004000 ///< directory
-#define _S_IFBLK 0x00006000 ///< block special device
-#define _S_IFREG 0x00008000 ///< regular
-#define _S_IFSOCK 0x0000C000 ///< socket
-#define _S_ITTY 0x00010000 ///< File connects to a TTY device
-#define _S_IWTTY 0x00020000 ///< TTY sends and receives Wide characters
-#define _S_ICONSOLE 0x00030000 ///< UEFI Console Device
-
-/* UEFI specific (FAT file system) File attributes.
- Specified in Hexadecimal instead of Octal.
- These bits correspond to the xx portion of _S_IFMT
-*/
-#define S_IREADONLY 0x00100000 // Read Only File
-#define S_IHIDDEN 0x00200000 // Hidden File
-#define S_ISYSTEM 0x00400000 // System File
-#define S_IDIRECTORY 0x01000000 // Directory
-#define S_IARCHIVE 0x02000000 // Archive Bit
-#define S_IROFS 0x08000000 ///< Read Only File System
-
-#define S_EFIONLY 0xFFF00000 ///< Flags only used by the EFI system calls.
-
-#define S_EFISHIFT 20 // LS bit of the UEFI attributes
-
-#define S_IFMT _S_IFMT
-#define S_IFIFO _S_IFIFO
-#define S_IFCHR _S_IFCHR
-#define S_IFDIR _S_IFDIR
-#define S_IFBLK _S_IFBLK
-#define S_IFREG _S_IFREG
-#define S_IFSOCK _S_IFSOCK
-#define S_ITTY _S_ITTY
-#define S_IWTTY _S_IWTTY
-#define S_ICONSOLE _S_ICONSOLE
-
-#define S_ISFIFO(m) ((m & _S_IFMT) == _S_IFIFO) ///< fifo
-#define S_ISCHR(m) ((m & _S_IFMT) == _S_IFCHR) ///< char special
-#define S_ISDIR(m) ((m & _S_IFMT) == _S_IFDIR) ///< directory
-#define S_ISBLK(m) ((m & _S_IFMT) == _S_IFBLK) ///< block special
-#define S_ISREG(m) ((m & _S_IFMT) == _S_IFREG) ///< regular file
-#define S_ISSOCK(m) ((m & _S_IFMT) == _S_IFSOCK) ///< socket
-
-
-/* The following three macros have been changed to reflect
- access permissions that better reflect the UEFI FAT file system.
- UEFI only supports Read or Read+Write instead of the *nix
- rwx paradigm. Thus, using 0777 is the closest analog.
-*/
-#define ACCESSPERMS (S_IRWXU|S_IRWXG|S_IRWXO) ///< 0777
-#define ALLPERMS (S_IRWXU|S_IRWXG|S_IRWXO) ///< 0777
-#define DEFFILEMODE (S_IRWXU|S_IRWXG|S_IRWXO) ///< 0777
-
-#define READ_PERMS (S_IRUSR | S_IRGRP | S_IROTH) ///< 0444
-#define WRITE_PERMS (S_IWUSR | S_IWGRP | S_IWOTH) ///< 0222
-#define EXEC_PERMS (S_IXUSR | S_IXGRP | S_IXOTH) ///< 0111
-
-#define S_BLKSIZE 512 ///< block size used in the stat struct
-
-/*
- * Definitions of flags stored in file flags word.
- *
- * Super-user and owner changeable flags.
- */
-#define UF_SETTABLE 0x0000ffff ///< mask of owner changeable flags
-#define UF_NODUMP 0x00000001 ///< do not dump file
-#define UF_IMMUTABLE 0x00000002 ///< file may not be changed
-#define UF_APPEND 0x00000004 ///< writes to file may only append
-/* UF_NOUNLINK 0x00000010 [NOT IMPLEMENTED] */
-/*
- * Super-user changeable flags.
- */
-#define SF_SETTABLE 0xffff0000 ///< mask of superuser changeable flags
-#define SF_ARCHIVED 0x00010000 ///< file is archived
-#define SF_IMMUTABLE 0x00020000 ///< file may not be changed
-#define SF_APPEND 0x00040000 ///< writes to file may only append
-/* SF_NOUNLINK 0x00100000 [NOT IMPLEMENTED] */
-
-#include <sys/EfiCdefs.h>
-
-__BEGIN_DECLS
-#ifndef __STAT_SYSCALLS_DECLARED
- #define __STAT_SYSCALLS_DECLARED
-
- /**
- **/
- mode_t umask (mode_t);
-
- /**
- **/
- int mkdir (const char *, mode_t);
-
- /**
- **/
- int fstat (int, struct stat *);
-
- /**
- **/
- int lstat (const char *, struct stat *);
-
-/** Obtains information about the file pointed to by path.
-
- Opens the file pointed to by path, calls _EFI_FileInfo with the file's handle,
- then closes the file.
-
- @param[in] path Path to the file to obtain information about.
- @param[out] statbuf Buffer in which the file status is put.
-
- @retval 0 Successful Completion.
- @retval -1 An error has occurred and errno has been set to
- identify the error.
-**/
- int stat (const char *, struct stat *);
-
- /**
- **/
- int chmod (const char *, mode_t);
-#endif // __STAT_SYSCALLS_DECLARED
-__END_DECLS
-
-#endif /* !_SYS_STAT_H_ */
diff --git a/StdLib/Include/sys/stdint.h b/StdLib/Include/sys/stdint.h deleted file mode 100644 index 7989fe0156..0000000000 --- a/StdLib/Include/sys/stdint.h +++ /dev/null @@ -1,107 +0,0 @@ -/* $NetBSD: stdint.h,v 1.5 2005/12/11 12:25:21 christos Exp $ */
-
-/*-
- * Copyright (c) 2001, 2004 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 _SYS_STDINT_H_
-#define _SYS_STDINT_H_
-
-#include <sys/EfiCdefs.h>
-#include <machine/int_types.h>
-
-#ifndef int8_t
-typedef __int8_t int8_t;
-#define int8_t __int8_t
-#endif
-
-#ifndef uint8_t
-typedef __uint8_t uint8_t;
-#define uint8_t __uint8_t
-#endif
-
-#ifndef int16_t
-typedef __int16_t int16_t;
-#define int16_t __int16_t
-#endif
-
-#ifndef uint16_t
-typedef __uint16_t uint16_t;
-#define uint16_t __uint16_t
-#endif
-
-#ifndef int32_t
-typedef __int32_t int32_t;
-#define int32_t __int32_t
-#endif
-
-#ifndef uint32_t
-typedef __uint32_t uint32_t;
-#define uint32_t __uint32_t
-#endif
-
-#ifndef int64_t
-typedef __int64_t int64_t;
-#define int64_t __int64_t
-#endif
-
-#ifndef uint64_t
-typedef __uint64_t uint64_t;
-#define uint64_t __uint64_t
-#endif
-
-#ifndef intptr_t
-typedef __intptr_t intptr_t;
-#define intptr_t __intptr_t
-#endif
-
-#ifndef uintptr_t
-typedef __uintptr_t uintptr_t;
-#define uintptr_t __uintptr_t
-#endif
-
-#include <machine/int_mwgwtypes.h>
-
-#if !defined(__cplusplus) || defined(__STDC_LIMIT_MACROS)
-#include <machine/int_limits.h>
-#endif
-
-#if !defined(__cplusplus) || defined(__STDC_CONSTANT_MACROS)
-#include <machine/int_const.h>
-#endif
-
-//#include <machine/wchar_limits.h>
-
-#endif /* !_SYS_STDINT_H_ */
diff --git a/StdLib/Include/sys/sysctl.h b/StdLib/Include/sys/sysctl.h deleted file mode 100644 index 2382900bae..0000000000 --- a/StdLib/Include/sys/sysctl.h +++ /dev/null @@ -1,505 +0,0 @@ -/*
- * Copyright (c) 1989, 1993
- * The Regents of the University of California. All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * Mike Karels at Berkeley Software Design, Inc.
- *
- * Portions copyright (c) 1999, 2000
- * Intel Corporation.
- * 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. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- *
- * This product includes software developed by the University of
- * California, Berkeley, Intel Corporation, and its contributors.
- *
- * 4. Neither the name of University, Intel Corporation, or their respective
- * 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, INTEL CORPORATION 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,
- * INTEL CORPORATION 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.
- *
- * @(#)sysctl.h 8.1 (Berkeley) 6/2/93
- * $Id: sysctl.h,v 1.1.1.1 2006/05/30 06:13:00 hhzhou Exp $
- */
-
-#ifndef _SYS_SYSCTL_H_
-#define _SYS_SYSCTL_H_
-
-#include <sys/_posix.h>
-
-/*
- * Definitions for sysctl call. The sysctl call uses a hierarchical name
- * for objects that can be examined or modified. The name is expressed as
- * a sequence of integers. Like a file path name, the meaning of each
- * component depends on its place in the hierarchy. The top-level and kern
- * identifiers are defined here, and other identifiers are defined in the
- * respective subsystem header files.
- */
-
-#define CTL_MAXNAME 12 /* largest number of components supported */
-
-/*
- * Each subsystem defined by sysctl defines a list of variables
- * for that subsystem. Each name is either a node with further
- * levels defined below it, or it is a leaf of some particular
- * type given below. Each sysctl level defines a set of name/type
- * pairs to be used by sysctl(1) in manipulating the subsystem.
- */
-struct ctlname {
- char *ctl_name; /* subsystem name */
- int ctl_type; /* type of name */
-};
-
-#define CTLTYPE 0xf /* Mask for the type */
-#define CTLTYPE_NODE 1 /* name is a node */
-#define CTLTYPE_INT 2 /* name describes an integer */
-#define CTLTYPE_STRING 3 /* name describes a string */
-#define CTLTYPE_QUAD 4 /* name describes a 64-bit number */
-#define CTLTYPE_OPAQUE 5 /* name describes a structure */
-#define CTLTYPE_STRUCT CTLTYPE_OPAQUE /* name describes a structure */
-
-#define CTLFLAG_RD 0x80000000 /* Allow reads of variable */
-#define CTLFLAG_WR 0x40000000 /* Allow writes to the variable */
-#define CTLFLAG_RW (CTLFLAG_RD|CTLFLAG_WR)
-#define CTLFLAG_NOLOCK 0x20000000 /* XXX Don't Lock */
-#define CTLFLAG_ANYBODY 0x10000000 /* All users can set this var */
-#define CTLFLAG_SECURE 0x08000000 /* Permit set only if securelevel<=0 */
-
-/*
- * USE THIS instead of a hardwired number from the categories below
- * to get dynamically assigned sysctl entries using the linker-set
- * technology. This is the way nearly all new sysctl variables should
- * be implemented.
- * e.g. SYSCTL_INT(_parent, OID_AUTO, name, CTLFLAG_RW, &variable, 0, "");
- */
-#define OID_AUTO (-1)
-
-#ifdef KERNEL
-#define SYSCTL_HANDLER_ARGS (struct sysctl_oid *oidp, void *arg1, int arg2, \
- struct sysctl_req *req)
-
-/*
- * This describes the access space for a sysctl request. This is needed
- * so that we can use the interface from the kernel or from user-space.
- */
-struct sysctl_req {
- struct proc *p;
- int lock;
- void *oldptr;
- size_t oldlen;
- size_t oldidx;
- int (*oldfunc)(struct sysctl_req *, const void *, size_t);
- void *newptr;
- size_t newlen;
- size_t newidx;
- int (*newfunc)(struct sysctl_req *, void *, size_t);
-};
-
-#ifndef _ORG_FREEBSD_
-#include <sys/ioccom.h>
-/*
- * Pseudo sysctl call through ioctl(2) interface
- */
-#define IOCSYSCTL _IOWR('X', 0, struct sysctl_req)
-
-struct pseudo_sysctl {
- int *name;
- u_int namelen;
- struct sysctl_req req;
-};
-
-#endif
-
-/*
- * This describes one "oid" in the MIB tree. Potentially more nodes can
- * be hidden behind it, expanded by the handler.
- */
-struct sysctl_oid {
- int oid_number;
- int oid_kind;
- void *oid_arg1;
- int oid_arg2;
- const char *oid_name;
- int (*oid_handler) SYSCTL_HANDLER_ARGS;
- const char *oid_fmt;
-};
-
-#define SYSCTL_IN(r, p, l) (r->newfunc)(r, p, l)
-#define SYSCTL_OUT(r, p, l) (r->oldfunc)(r, p, l)
-
-int sysctl_handle_int SYSCTL_HANDLER_ARGS;
-int sysctl_handle_long SYSCTL_HANDLER_ARGS;
-int sysctl_handle_intptr SYSCTL_HANDLER_ARGS;
-int sysctl_handle_string SYSCTL_HANDLER_ARGS;
-int sysctl_handle_opaque SYSCTL_HANDLER_ARGS;
-
-#ifdef _ORG_FREEBSD_
-/* This constructs a "raw" MIB oid. */
-#define SYSCTL_OID(parent, nbr, name, kind, a1, a2, handler, fmt, descr) \
- static struct sysctl_oid sysctl__##parent##_##name = { \
- nbr, kind, a1, a2, #name, handler, fmt }; \
- DATA_SET(sysctl_##parent, sysctl__##parent##_##name)
-
-/* This constructs a node from which other oids can hang. */
-#define SYSCTL_NODE(parent, nbr, name, access, handler, descr) \
- extern struct linker_set sysctl_##parent##_##name; \
- SYSCTL_OID(parent, nbr, name, CTLTYPE_NODE|access, \
- (void*)&sysctl_##parent##_##name, 0, handler, "N", descr); \
- DATA_SET(sysctl_##parent##_##name, sysctl__##parent##_##name)
-#else
-#define SYSCTL_OID(parent, nbr, name, kind, a1, a2, handler, fmt, descr)
-#define SYSCTL_NODE(parent, nbr, name, access, handler, descr)
-#endif
-
-/* Oid for a string. len can be 0 to indicate '\0' termination. */
-#define SYSCTL_STRING(parent, nbr, name, access, arg, len, descr) \
- SYSCTL_OID(parent, nbr, name, CTLTYPE_STRING|access, \
- arg, len, sysctl_handle_string, "A", descr)
-
-/* Oid for an int. If ptr is NULL, val is returned. */
-#define SYSCTL_INT(parent, nbr, name, access, ptr, val, descr) \
- SYSCTL_OID(parent, nbr, name, CTLTYPE_INT|access, \
- ptr, val, sysctl_handle_int, "I", descr)
-
-/* Oid for a long. The pointer must be non NULL. */
-#define SYSCTL_LONG(parent, nbr, name, access, ptr, descr) \
- SYSCTL_OID(parent, nbr, name, CTLTYPE_INT|access, \
- ptr, 0, sysctl_handle_long, "L", descr)
-
-/* Oid for an opaque object. Specified by a pointer and a length. */
-#define SYSCTL_OPAQUE(parent, nbr, name, access, ptr, len, fmt, descr) \
- SYSCTL_OID(parent, nbr, name, CTLTYPE_OPAQUE|access, \
- ptr, len, sysctl_handle_opaque, fmt, descr)
-
-/* Oid for a struct. Specified by a pointer and a type. */
-#define SYSCTL_STRUCT(parent, nbr, name, access, ptr, type, descr) \
- SYSCTL_OID(parent, nbr, name, CTLTYPE_OPAQUE|access, \
- ptr, sizeof(struct type), sysctl_handle_opaque, \
- "S," #type, descr)
-
-/* Oid for a procedure. Specified by a pointer and an arg. */
-#define SYSCTL_PROC(parent, nbr, name, access, ptr, arg, handler, fmt, descr) \
- SYSCTL_OID(parent, nbr, name, access, \
- ptr, arg, handler, fmt, descr)
-#endif /* KERNEL */
-
-/*
- * Top-level identifiers
- */
-#define CTL_UNSPEC 0 /* unused */
-#define CTL_KERN 1 /* "high kernel": proc, limits */
-#define CTL_VM 2 /* virtual memory */
-#define CTL_VFS 3 /* file system, mount type is next */
-#define CTL_NET 4 /* network, see socket.h */
-#define CTL_DEBUG 5 /* debugging parameters */
-#define CTL_HW 6 /* generic cpu/io */
-#define CTL_MACHDEP 7 /* machine dependent */
-#define CTL_USER 8 /* user-level */
-#define CTL_P1003_1B 9 /* POSIX 1003.1B */
-#define CTL_MAXID 10 /* number of valid top-level ids */
-
-#define CTL_NAMES { \
- { 0, 0 }, \
- { "kern", CTLTYPE_NODE }, \
- { "vm", CTLTYPE_NODE }, \
- { "vfs", CTLTYPE_NODE }, \
- { "net", CTLTYPE_NODE }, \
- { "debug", CTLTYPE_NODE }, \
- { "hw", CTLTYPE_NODE }, \
- { "machdep", CTLTYPE_NODE }, \
- { "user", CTLTYPE_NODE }, \
- { "p1003_1b", CTLTYPE_NODE }, \
-}
-
-/*
- * CTL_KERN identifiers
- */
-#define KERN_OSTYPE 1 /* string: system version */
-#define KERN_OSRELEASE 2 /* string: system release */
-#define KERN_OSREV 3 /* int: system revision */
-#define KERN_VERSION 4 /* string: compile time info */
-#define KERN_MAXVNODES 5 /* int: max vnodes */
-#define KERN_MAXPROC 6 /* int: max processes */
-#define KERN_MAXFILES 7 /* int: max open files */
-#define KERN_ARGMAX 8 /* int: max arguments to exec */
-#define KERN_SECURELVL 9 /* int: system security level */
-#define KERN_HOSTNAME 10 /* string: hostname */
-#define KERN_HOSTID 11 /* int: host identifier */
-#define KERN_CLOCKRATE 12 /* struct: struct clockrate */
-#define KERN_VNODE 13 /* struct: vnode structures */
-#define KERN_PROC 14 /* struct: process entries */
-#define KERN_FILE 15 /* struct: file entries */
-#define KERN_PROF 16 /* node: kernel profiling info */
-#define KERN_POSIX1 17 /* int: POSIX.1 version */
-#define KERN_NGROUPS 18 /* int: # of supplemental group ids */
-#define KERN_JOB_CONTROL 19 /* int: is job control available */
-#define KERN_SAVED_IDS 20 /* int: saved set-user/group-ID */
-#define KERN_BOOTTIME 21 /* struct: time kernel was booted */
-#define KERN_NISDOMAINNAME 22 /* string: YP domain name */
-#define KERN_UPDATEINTERVAL 23 /* int: update process sleep time */
-#define KERN_OSRELDATE 24 /* int: OS release date */
-#define KERN_NTP_PLL 25 /* node: NTP PLL control */
-#define KERN_BOOTFILE 26 /* string: name of booted kernel */
-#define KERN_MAXFILESPERPROC 27 /* int: max open files per proc */
-#define KERN_MAXPROCPERUID 28 /* int: max processes per uid */
-#define KERN_DUMPDEV 29 /* dev_t: device to dump on */
-#define KERN_IPC 30 /* node: anything related to IPC */
-#define KERN_DUMMY 31 /* unused */
-#define KERN_PS_STRINGS 32 /* int: address of PS_STRINGS */
-#define KERN_USRSTACK 33 /* int: address of USRSTACK */
-#define KERN_LOGSIGEXIT 34 /* int: do we log sigexit procs? */
-#define KERN_MAXID 35 /* number of valid kern ids */
-
-#define CTL_KERN_NAMES { \
- { 0, 0 }, \
- { "ostype", CTLTYPE_STRING }, \
- { "osrelease", CTLTYPE_STRING }, \
- { "osrevision", CTLTYPE_INT }, \
- { "version", CTLTYPE_STRING }, \
- { "maxvnodes", CTLTYPE_INT }, \
- { "maxproc", CTLTYPE_INT }, \
- { "maxfiles", CTLTYPE_INT }, \
- { "argmax", CTLTYPE_INT }, \
- { "securelevel", CTLTYPE_INT }, \
- { "hostname", CTLTYPE_STRING }, \
- { "hostid", CTLTYPE_INT }, \
- { "clockrate", CTLTYPE_STRUCT }, \
- { "vnode", CTLTYPE_STRUCT }, \
- { "proc", CTLTYPE_STRUCT }, \
- { "file", CTLTYPE_STRUCT }, \
- { "profiling", CTLTYPE_NODE }, \
- { "posix1version", CTLTYPE_INT }, \
- { "ngroups", CTLTYPE_INT }, \
- { "job_control", CTLTYPE_INT }, \
- { "saved_ids", CTLTYPE_INT }, \
- { "boottime", CTLTYPE_STRUCT }, \
- { "nisdomainname", CTLTYPE_STRING }, \
- { "update", CTLTYPE_INT }, \
- { "osreldate", CTLTYPE_INT }, \
- { "ntp_pll", CTLTYPE_NODE }, \
- { "bootfile", CTLTYPE_STRING }, \
- { "maxfilesperproc", CTLTYPE_INT }, \
- { "maxprocperuid", CTLTYPE_INT }, \
- { "dumpdev", CTLTYPE_STRUCT }, /* we lie; don't print as int */ \
- { "ipc", CTLTYPE_NODE }, \
- { "dummy", CTLTYPE_INT }, \
- { "ps_strings", CTLTYPE_INT }, \
- { "usrstack", CTLTYPE_INT }, \
- { "logsigexit", CTLTYPE_INT }, \
-}
-
-/*
- * CTL_VFS identifiers
- */
-#define CTL_VFS_NAMES { \
- { "vfsconf", CTLTYPE_STRUCT }, \
-}
-
-/*
- * KERN_PROC subtypes
- */
-#define KERN_PROC_ALL 0 /* everything */
-#define KERN_PROC_PID 1 /* by process id */
-#define KERN_PROC_PGRP 2 /* by process group id */
-#define KERN_PROC_SESSION 3 /* by session of pid */
-#define KERN_PROC_TTY 4 /* by controlling tty */
-#define KERN_PROC_UID 5 /* by effective uid */
-#define KERN_PROC_RUID 6 /* by real uid */
-
-/*
- * KERN_IPC identifiers
- */
-#define KIPC_MAXSOCKBUF 1 /* int: max size of a socket buffer */
-#define KIPC_SOCKBUF_WASTE 2 /* int: wastage factor in sockbuf */
-#define KIPC_SOMAXCONN 3 /* int: max length of connection q */
-#define KIPC_MAX_LINKHDR 4 /* int: max length of link header */
-#define KIPC_MAX_PROTOHDR 5 /* int: max length of network header */
-#define KIPC_MAX_HDR 6 /* int: max total length of headers */
-#define KIPC_MAX_DATALEN 7 /* int: max length of data? */
-#define KIPC_MBSTAT 8 /* struct: mbuf usage statistics */
-#define KIPC_NMBCLUSTERS 9 /* int: maximum mbuf clusters */
-
-/*
- * CTL_HW identifiers
- */
-#define HW_MACHINE 1 /* string: machine class */
-#define HW_MODEL 2 /* string: specific machine model */
-#define HW_NCPU 3 /* int: number of cpus */
-#define HW_BYTEORDER 4 /* int: machine byte order */
-#define HW_PHYSMEM 5 /* int: total memory */
-#define HW_USERMEM 6 /* int: non-kernel memory */
-#define HW_PAGESIZE 7 /* int: software page size */
-#define HW_DISKNAMES 8 /* strings: disk drive names */
-#define HW_DISKSTATS 9 /* struct: diskstats[] */
-#define HW_FLOATINGPT 10 /* int: has HW floating point? */
-#define HW_MACHINE_ARCH 11 /* string: machine architecture */
-#define HW_MAXID 12 /* number of valid hw ids */
-
-#define CTL_HW_NAMES { \
- { 0, 0 }, \
- { "machine", CTLTYPE_STRING }, \
- { "model", CTLTYPE_STRING }, \
- { "ncpu", CTLTYPE_INT }, \
- { "byteorder", CTLTYPE_INT }, \
- { "physmem", CTLTYPE_INT }, \
- { "usermem", CTLTYPE_INT }, \
- { "pagesize", CTLTYPE_INT }, \
- { "disknames", CTLTYPE_STRUCT }, \
- { "diskstats", CTLTYPE_STRUCT }, \
- { "floatingpoint", CTLTYPE_INT }, \
-}
-
-/*
- * CTL_USER definitions
- */
-#define USER_CS_PATH 1 /* string: _CS_PATH */
-#define USER_BC_BASE_MAX 2 /* int: BC_BASE_MAX */
-#define USER_BC_DIM_MAX 3 /* int: BC_DIM_MAX */
-#define USER_BC_SCALE_MAX 4 /* int: BC_SCALE_MAX */
-#define USER_BC_STRING_MAX 5 /* int: BC_STRING_MAX */
-#define USER_COLL_WEIGHTS_MAX 6 /* int: COLL_WEIGHTS_MAX */
-#define USER_EXPR_NEST_MAX 7 /* int: EXPR_NEST_MAX */
-#define USER_LINE_MAX 8 /* int: LINE_MAX */
-#define USER_RE_DUP_MAX 9 /* int: RE_DUP_MAX */
-#define USER_POSIX2_VERSION 10 /* int: POSIX2_VERSION */
-#define USER_POSIX2_C_BIND 11 /* int: POSIX2_C_BIND */
-#define USER_POSIX2_C_DEV 12 /* int: POSIX2_C_DEV */
-#define USER_POSIX2_CHAR_TERM 13 /* int: POSIX2_CHAR_TERM */
-#define USER_POSIX2_FORT_DEV 14 /* int: POSIX2_FORT_DEV */
-#define USER_POSIX2_FORT_RUN 15 /* int: POSIX2_FORT_RUN */
-#define USER_POSIX2_LOCALEDEF 16 /* int: POSIX2_LOCALEDEF */
-#define USER_POSIX2_SW_DEV 17 /* int: POSIX2_SW_DEV */
-#define USER_POSIX2_UPE 18 /* int: POSIX2_UPE */
-#define USER_STREAM_MAX 19 /* int: POSIX2_STREAM_MAX */
-#define USER_TZNAME_MAX 20 /* int: POSIX2_TZNAME_MAX */
-#define USER_MAXID 21 /* number of valid user ids */
-
-#define CTL_USER_NAMES { \
- { 0, 0 }, \
- { "cs_path", CTLTYPE_STRING }, \
- { "bc_base_max", CTLTYPE_INT }, \
- { "bc_dim_max", CTLTYPE_INT }, \
- { "bc_scale_max", CTLTYPE_INT }, \
- { "bc_string_max", CTLTYPE_INT }, \
- { "coll_weights_max", CTLTYPE_INT }, \
- { "expr_nest_max", CTLTYPE_INT }, \
- { "line_max", CTLTYPE_INT }, \
- { "re_dup_max", CTLTYPE_INT }, \
- { "posix2_version", CTLTYPE_INT }, \
- { "posix2_c_bind", CTLTYPE_INT }, \
- { "posix2_c_dev", CTLTYPE_INT }, \
- { "posix2_char_term", CTLTYPE_INT }, \
- { "posix2_fort_dev", CTLTYPE_INT }, \
- { "posix2_fort_run", CTLTYPE_INT }, \
- { "posix2_localedef", CTLTYPE_INT }, \
- { "posix2_sw_dev", CTLTYPE_INT }, \
- { "posix2_upe", CTLTYPE_INT }, \
- { "stream_max", CTLTYPE_INT }, \
- { "tzname_max", CTLTYPE_INT }, \
-}
-
-#define CTL_P1003_1B_ASYNCHRONOUS_IO 1 /* boolean */
-#define CTL_P1003_1B_MAPPED_FILES 2 /* boolean */
-#define CTL_P1003_1B_MEMLOCK 3 /* boolean */
-#define CTL_P1003_1B_MEMLOCK_RANGE 4 /* boolean */
-#define CTL_P1003_1B_MEMORY_PROTECTION 5 /* boolean */
-#define CTL_P1003_1B_MESSAGE_PASSING 6 /* boolean */
-#define CTL_P1003_1B_PRIORITIZED_IO 7 /* boolean */
-#define CTL_P1003_1B_PRIORITY_SCHEDULING 8 /* boolean */
-#define CTL_P1003_1B_REALTIME_SIGNALS 9 /* boolean */
-#define CTL_P1003_1B_SEMAPHORES 10 /* boolean */
-#define CTL_P1003_1B_FSYNC 11 /* boolean */
-#define CTL_P1003_1B_SHARED_MEMORY_OBJECTS 12 /* boolean */
-#define CTL_P1003_1B_SYNCHRONIZED_IO 13 /* boolean */
-#define CTL_P1003_1B_TIMERS 14 /* boolean */
-#define CTL_P1003_1B_AIO_LISTIO_MAX 15 /* int */
-#define CTL_P1003_1B_AIO_MAX 16 /* int */
-#define CTL_P1003_1B_AIO_PRIO_DELTA_MAX 17 /* int */
-#define CTL_P1003_1B_DELAYTIMER_MAX 18 /* int */
-#define CTL_P1003_1B_MQ_OPEN_MAX 19 /* int */
-#define CTL_P1003_1B_PAGESIZE 20 /* int */
-#define CTL_P1003_1B_RTSIG_MAX 21 /* int */
-#define CTL_P1003_1B_SEM_NSEMS_MAX 22 /* int */
-#define CTL_P1003_1B_SEM_VALUE_MAX 23 /* int */
-#define CTL_P1003_1B_SIGQUEUE_MAX 24 /* int */
-#define CTL_P1003_1B_TIMER_MAX 25 /* int */
-
-#define CTL_P1003_1B_MAXID 26
-
-#define CTL_P1003_1B_NAMES { \
- { 0, 0 }, \
- { "asynchronous_io", CTLTYPE_INT }, \
- { "mapped_files", CTLTYPE_INT }, \
- { "memlock", CTLTYPE_INT }, \
- { "memlock_range", CTLTYPE_INT }, \
- { "memory_protection", CTLTYPE_INT }, \
- { "message_passing", CTLTYPE_INT }, \
- { "prioritized_io", CTLTYPE_INT }, \
- { "priority_scheduling", CTLTYPE_INT }, \
- { "realtime_signals", CTLTYPE_INT }, \
- { "semaphores", CTLTYPE_INT }, \
- { "fsync", CTLTYPE_INT }, \
- { "shared_memory_objects", CTLTYPE_INT }, \
- { "synchronized_io", CTLTYPE_INT }, \
- { "timers", CTLTYPE_INT }, \
- { "aio_listio_max", CTLTYPE_INT }, \
- { "aio_max", CTLTYPE_INT }, \
- { "aio_prio_delta_max", CTLTYPE_INT }, \
- { "delaytimer_max", CTLTYPE_INT }, \
- { "mq_open_max", CTLTYPE_INT }, \
- { "pagesize", CTLTYPE_INT }, \
- { "rtsig_max", CTLTYPE_INT }, \
- { "nsems_max", CTLTYPE_INT }, \
- { "sem_value_max", CTLTYPE_INT }, \
- { "sigqueue_max", CTLTYPE_INT }, \
- { "timer_max", CTLTYPE_INT }, \
-}
-
-#ifdef KERNEL
-
-extern char machine[];
-extern char osrelease[];
-extern char ostype[];
-
-int kernel_sysctl(struct proc *p, int *name, u_int namelen, void *old,
- size_t *oldlenp, void *new, size_t newlen,
- size_t *retval);
-void sysctl_order_all(void);
-int userland_sysctl(struct proc *p, int *name, u_int namelen, void *old,
- size_t *oldlenp, int inkernel, void *new, size_t newlen,
- size_t *retval);
-
-#else /* !KERNEL */
-#include <sys/EfiCdefs.h>
-
-__BEGIN_DECLS
-int sysctl __P((int *, u_int, void *, size_t *, void *, size_t));
-int sysctlbyname __P((const char *, void *, size_t *, void *, size_t));
-__END_DECLS
-#endif /* KERNEL */
-
-#endif /* !_SYS_SYSCTL_H_ */
diff --git a/StdLib/Include/sys/syslimits.h b/StdLib/Include/sys/syslimits.h deleted file mode 100644 index 9515e8f570..0000000000 --- a/StdLib/Include/sys/syslimits.h +++ /dev/null @@ -1,67 +0,0 @@ -/** @file
- Platform specific values for <limits.h>.
-
- Copyright (c) 2010 - 2012, 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) 1988, 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.
- *
- * syslimits.h 8.1 (Berkeley) 6/2/93
- * NetBSD: syslimits.h,v 1.23 2005/12/11 12:25:21 christos Exp
-**/
-
-#ifndef _SYS_SYSLIMITS_H_
-#define _SYS_SYSLIMITS_H_
-
-#include <sys/featuretest.h>
-
-#define ARG_MAX (2 * 1024) ///< Maximum bytes for an exec function.
-#define ARGC_MAX (64) ///< Maximum value for argc.
-
-#define MAX_INPUT 255 ///< Maximum bytes in terminal input.
-#define MAX_OUTPUT 255 ///< Maximum bytes in terminal output.
-#define NAME_MAX 255 ///< Maximum bytes in a file name.
-#ifndef OPEN_MAX
- #define OPEN_MAX 20 ///< Maximum open files per process.
-#endif
-#define PATH_MAX 1024 ///< Maximum bytes in pathname.
-#define PIPE_BUF 512 ///< Maximum bytes for atomic pipe writes.
-
-#ifndef CHILD_MAX
- #define CHILD_MAX 128 ///< Maximum simultaneous processes.
-#endif
-
-#define LOGIN_NAME_MAX 17 ///< Maximum login name length including the NUL.
-
-#endif /* !_SYS_SYSLIMITS_H_ */
diff --git a/StdLib/Include/sys/termios.h b/StdLib/Include/sys/termios.h deleted file mode 100644 index 671a5c06c0..0000000000 --- a/StdLib/Include/sys/termios.h +++ /dev/null @@ -1,428 +0,0 @@ -/** @file
- Macros and declarations for terminal oriented ioctls and
- I/O discipline.
-
- Copyright (c) 2012 - 2014, 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) 1988, 1989, 1993, 1994
- * 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.
- *
- * @(#)termios.h 8.3 (Berkeley) 3/28/94
- NetBSD: termios.h,v 1.29 2005/12/11 12:25:21 christos Exp
-**/
-#ifndef _SYS_TERMIOS_H_
-#define _SYS_TERMIOS_H_
-
-#include <sys/ansi.h>
-#include <sys/featuretest.h>
-
-/* Special Control Characters
- *
- * Index into c_cc[] character array.
- */
-typedef enum {
-/* Name Enabled by */
- VTABLEN, /* OXTABS - Length between TAB stops. */
- VEOF, /* ICANON */
- VEOL, /* ICANON */
- VERASE, /* ICANON */
- VKILL, /* ICANON */
- VINTR, /* ISIG */
- VQUIT, /* ISIG */
- VMIN, /* !ICANON */
- VTIME, /* !ICANON */
-
- /* Extensions from BSD and POSIX -- Not yet implemented for UEFI */
- VWERASE, /* IEXTEN, ICANON -- Erase the WORD to the left of the cursor */
- VREPRINT, /* IEXTEN, ICANON -- Re-draw the current line (input buffer) */
- VLNEXT, /* IEXTEN, ICANON -- Input the next character literally */
- VDISCARD, /* IEXTEN -- Toggle. Discards output display until toggled. */
-
- /* NCCS must always be the last member of this enum. */
- NCCS /* Number of control characters in c_cc[] */
-} CCC_INDEX;
-
-#define _POSIX_VDISABLE ((unsigned char)'\377')
-
-#define CCEQ(val, c) (c == val ? val != _POSIX_VDISABLE : 0)
-
-/*
- * Input flags - software input processing
- c_iflag
-*/
-#define INLCR 0x0001 /* map NL into CR */
-#define IGNCR 0x0002 /* ignore CR */
-#define ICRNL 0x0004 /* map CR to NL (ala CRMOD) */
-#define IGNSPEC 0x0008 /* Ignore function, control, and other non-printing special keys. */
-#ifdef HAVE_DA_SERIAL
- #define ISTRIP 0x0010 /* strip 8th bit off chars */
- #define IGNBRK 0x0020 /* ignore BREAK condition */
- #define BRKINT 0x0040 /* map BREAK to SIGINTR */
- #define IRESRV1 0x0080
- #define IGNPAR 0x0100 /* ignore (discard) parity errors */
- #define PARMRK 0x0200 /* mark parity and framing errors */
- #define INPCK 0x0400 /* enable checking of parity errors */
- #define IXON 0x0800 /* enable output flow control */
- #define IXOFF 0x1000 /* enable input flow control */
- #define IXANY 0x2000 /* any char will restart after stop */
-#endif /* HAVE_DA_SERIAL */
-
-/*
- * Output flags - software output processing
- c_oflag
- */
-#define OPOST 0x0001 /* enable following output processing */
-#define ONLCR 0x0002 /* map NL to CR-NL (ala CRMOD) */
-#define OXTABS 0x0004 /* expand tabs to spaces */
-#define ONOEOT 0x0008 /* discard EOT's (^D) on output */
-#define OCRNL 0x0010 /* map CR to NL */
-#define ONOCR 0x0020 /* discard CR's when on column 0 */
-#define ONLRET 0x0040 /* move to column 0 on CR */
-#define OCTRL 0x0080 /* Map control characters to the sequence ^C */
-
-/*
- * Control flags - hardware control of terminal
- c_cflag
- */
-#ifdef HAVE_DA_SERIAL
- #define CIGNORE 0x0001 /* ignore control flags */
- #define CSIZE 0x0300 /* character size mask */
- #define CS5 0x0000 /* 5 bits (pseudo) */
- #define CS6 0x0100 /* 6 bits */
- #define CS7 0x0200 /* 7 bits */
- #define CS8 0x0300 /* 8 bits */
- #define CSTOPB 0x0400 /* send 2 stop bits, else 1 */
- #define CREAD 0x0800 /* enable receiver */
- #define PARENB 0x1000 /* parity enable */
- #define PARODD 0x2000 /* odd parity, else even */
- #define HUPCL 0x4000 /* hang up on last close */
- #define CLOCAL 0x8000 /* ignore modem status lines */
-#endif
-
-
-/*
- * "Local" flags - dumping ground for other state
- *
- * Warning: some flags in this structure begin with
- * the letter "I" and look like they belong in the
- * input flag.
- */
-#define ECHO 0x0001 /* enable echoing */
-#define ECHOE 0x0002 /* visually erase chars */
-#define ECHOK 0x0004 /* echo NL after line kill */
-#define ECHONL 0x0008 /* echo NL even if ECHO is off */
-#define ISIG 0x0010 /* enable signals INTR, QUIT, [D]SUSP */
-#define ICANON 0x0020 /* canonicalize input lines */
-#define IEXTEN 0x0040 /* enable Extensions */
-#define SKIP_1 0x0100 /* Currently unused */
-#define TOSTOP 0x0200 /* stop background jobs on output */
-#define PENDIN 0x0400 /* re-echo input buffer at next read */
-#define NOFLSH 0x0800 /* don't flush output on signal */
-#define FLUSHO 0x1000 /* output being flushed (state) */
-
-typedef INT8 cc_t;
-typedef UINT16 tcflag_t;
-typedef UINT32 speed_t;
-
-struct termios {
- INT32 c_ispeed; /* input speed - Use a signed type instead of speed_t */
- INT32 c_ospeed; /* output speed - to ease integer promotion when used. */
- tcflag_t c_iflag; /* input flags */
- tcflag_t c_oflag; /* output flags */
- tcflag_t c_cflag; /* control flags */
- tcflag_t c_lflag; /* local flags */
- cc_t c_cc[NCCS]; /* control chars */
-};
-
-/*
- * Commands passed to tcsetattr() for setting the termios structure.
- */
-#define TCSANOW 0 /* make change immediate */
-#define TCSADRAIN 1 /* drain output, then change */
-#define TCSAFLUSH 2 /* drain output, flush input */
-#define TCSASOFT 0x10 /* flag - don't alter h.w. state */
-
-/*
- * Standard speeds
- */
-#define B0 0
-#define B50 50
-#define B75 75
-#define B110 110
-#define B134 134
-#define B150 150
-#define B200 200
-#define B300 300
-#define B600 600
-#define B1200 1200
-#define B1800 1800
-#define B2400 2400
-#define B4800 4800
-#define B9600 9600
-#define B19200 19200
-#define B38400 38400
-
-// Extended speed definitions
-#define B7200 7200
-#define B14400 14400
-#define B28800 28800
-#define B57600 57600
-#define B76800 76800
-#define B115200 115200
-#define B230400 230400
-#define B460800 460800
-#define B921600 921600
-
-#define TCIFLUSH 1
-#define TCOFLUSH 2
-#define TCIOFLUSH 3
-#define TCOOFF 1
-#define TCOON 2
-#define TCIOFF 3
-#define TCION 4
-
-#include <sys/EfiCdefs.h>
-
-__BEGIN_DECLS
-
-/** Get input baud rate.
-
- Extracts the input baud rate from the termios structure pointed to by the
- pTermios argument.
-
- @param[in] pTermios A pointer to the termios structure from which to extract
- the input baud rate.
-
- @return The value of the input speed is returned exactly as it is contained
- in the termios structure, without interpretation.
-**/
-speed_t cfgetispeed (const struct termios *);
-
-/** Get output baud rate.
-
- Extracts the output baud rate from the termios structure pointed to by the
- pTermios argument.
-
- @param[in] pTermios A pointer to the termios structure from which to extract
- the output baud rate.
-
- @return The value of the output speed is returned exactly as it is contained
- in the termios structure, without interpretation.
-**/
-speed_t cfgetospeed (const struct termios *);
-
-/** Set input baud rate.
-
- Replaces the input baud rate, in the termios structure pointed to by the
- pTermios argument, with the value of NewSpeed.
-
- @param[out] pTermios A pointer to the termios structure into which to set
- the input baud rate.
- @param[in] NewSpeed The new input baud rate.
-
- @retval 0 The operation completed successfully.
- @retval -1 An error occured and errno is set to indicate the error.
- * EINVAL - The value of NewSpeed is outside the range of
- possible speed values as specified in <sys/termios.h>.
-**/
-int cfsetispeed (struct termios *, speed_t);
-
-/** Set output baud rate.
-
- Replaces the output baud rate, in the termios structure pointed to by the
- pTermios argument, with the value of NewSpeed.
-
- @param[out] pTermios A pointer to the termios structure into which to set
- the output baud rate.
- @param[in] NewSpeed The new output baud rate.
-
- @retval 0 The operation completed successfully.
- @retval -1 An error occured and errno is set to indicate the error.
- * EINVAL - The value of NewSpeed is outside the range of
- possible speed values as specified in <sys/termios.h>.
-**/
-int cfsetospeed (struct termios *, speed_t);
-
-/** Get the parameters associated with an interactive IO device.
-
- Get the parameters associated with the device referred to by
- fd and store them into the termios structure referenced by pTermios.
-
- @param[in] fd The file descriptor for an open interactive IO device.
- @param[out] pTermios A pointer to a termios structure into which to store
- attributes of the interactive IO device.
-
- @retval 0 The operation completed successfully.
- @retval -1 An error occured and errno is set to indicate the error.
- * EBADF - The fd argument is not a valid file descriptor.
- * ENOTTY - The file associated with fd is not an interactive IO device.
-**/
-int tcgetattr (int, struct termios *);
-
-/** Set the parameters associated with an interactive IO device.
-
- Set the parameters associated with the device referred to by
- fd to the values in the termios structure referenced by pTermios.
-
- Behavior is modified by the value of the OptAct parameter:
- * TCSANOW: The change shall occur immediately.
- * TCSADRAIN: The change shall occur after all output written to fd is
- transmitted. This action should be used when changing parameters which
- affect output.
- * TCSAFLUSH: The change shall occur after all output written to fd is
- transmitted, and all input so far received but not read shall be
- discarded before the change is made.
-
- @param[in] fd The file descriptor for an open interactive IO device.
- @param[in] OptAct Currently has no effect.
- @param[in] pTermios A pointer to a termios structure into which to retrieve
- attributes to set in the interactive IO device.
-
- @retval 0 The operation completed successfully.
- @retval -1 An error occured and errno is set to indicate the error.
- * EBADF - The fd argument is not a valid file descriptor.
- * ENOTTY - The file associated with fd is not an interactive IO device.
-**/
-int tcsetattr (int, int, const struct termios *);
-
-/** Transmit pending output.
-
-
- @param[in] fd The file descriptor for an open interactive IO device.
-
- @retval 0 The operation completed successfully.
- @retval -1 An error occured and errno is set to indicate the error.
- * EBADF - The fd argument is not a valid file descriptor.
- * ENOTTY - The file associated with fd is not an interactive IO device.
- * EINTR - A signal interrupted tcdrain().
- * ENOTSUP - This function is not supported.
-**/
-int tcdrain (int);
-
-/** Suspend or restart the transmission or reception of data.
-
- This function will suspend or resume transmission or reception of data on
- the file referred to by fd, depending on the value of Action.
-
- @param[in] fd The file descriptor of an open interactive IO device (terminal).
- @param[in] Action The action to be performed:
- * TCOOFF - Suspend output.
- * TCOON - Resume suspended output.
- * TCIOFF - If fd refers to an IIO device, transmit a
- STOP character, which is intended to cause the
- terminal device to stop transmitting data.
- * TCION - If fd refers to an IIO device, transmit a
- START character, which is intended to cause the
- terminal device to start transmitting data.
-
- @retval 0 The operation completed successfully.
- @retval -1 An error occured and errno is set to indicate the error.
- * EBADF - The fd argument is not a valid file descriptor.
- * ENOTTY - The file associated with fd is not an interactive IO device.
- * EINVAL - The Action argument is not a supported value.
- * ENOTSUP - This function is not supported.
-**/
-int tcflow (int, int);
-
-/** Discard non-transmitted output data, non-read input data, or both.
-
-
- @param[in] fd The file descriptor for an open interactive IO device.
- @param[in] QueueSelector The IO queue to be affected:
- * TCIFLUSH - If fd refers to a device open for input, flush
- pending input. Otherwise error EINVAL.
- * TCOFLUSH - If fd refers to a device open for output,
- flush pending output. Otherwise error EINVAL.
- * TCIOFLUSH - If fd refers to a device open for both
- input and output, flush pending input and output.
- Otherwise error EINVAL.
-
- @retval 0 The operation completed successfully.
- @retval -1 An error occured and errno is set to indicate the error.
- * EBADF - The fd argument is not a valid file descriptor.
- * ENOTTY - The file associated with fd is not an interactive IO device.
- * EINVAL - The QueueSelector argument is not a supported value.
- * ENOTSUP - This function is not supported.
-**/
-int tcflush (int, int);
-
-//int tcsendbreak (int, int);
-//pid_t tcgetsid (int);
-
-//void cfmakeraw (struct termios *);
-//int cfsetspeed (struct termios *, speed_t);
-__END_DECLS
-
-/* Input values for UEFI Keyboard Scan Codes.
-
- The UEFI Keyboard Scan Codes are mapped into the upper range of the Unicode
- Private Use Area so that the characters can be inserted into the input stream
- and treated the same as any other character.
-
- These values are only used for input. If these codes are output to the
- console, or another interactive I/O device, the behavior will depend upon
- the current locale and UEFI character set loaded.
-*/
-typedef enum {
- TtySpecKeyMin = 0xF7F0,
- /* This area is reserved for use by internal I/O software.
- At least 4 values must exist between TtySpecKeyMin and TtyFunKeyMin.
- */
- TtyFunKeyMin = 0xF7FA,
- TtyKeyEject = 0xF7FA,
- TtyRecovery, TtyToggleDisplay, TtyHibernate,
- TtySuspend, TtyBrightnessDown, TtyBrightnessUp,
- TtyVolumeDown = 0xF87F,
- TtyVolumeUp, TtyMute,
- TtyF24 = 0xF88D,
- TtyF23, TtyF22, TtyF21, TtyF20,
- TtyF19, TtyF18, TtyF17, TtyF16,
- TtyF15, TtyF14, TtyF13,
- TtyEscape = 0xF8E9,
- TtyF12, TtyF11, TtyF10, TtyF9,
- TtyF8, TtyF7, TtyF6, TtyF5,
- TtyF4, TtyF3, TtyF2, TtyF1,
- TtyPageDown, TtyPageUp, TtyDelete, TtyInsert,
- TtyEnd, TtyHome, TtyLeftArrow, TtyRightArrow,
- TtyDownArrow,
- TtyUpArrow = 0xF8FF,
- TtyFunKeyMax = 0xF900
-} TtyFunKey;
-
-// Non-UEFI character definitions
-#define CHAR_EOT 0x0004 /* End of Text (EOT) character -- Unix End-of-File character */
-#define CHAR_SUB 0x001a /* MSDOS End-of-File character */
-#define CHAR_ESC 0x001b /* Escape (ESC) character */
-
-#endif /* !_SYS_TERMIOS_H_ */
diff --git a/StdLib/Include/sys/time.h b/StdLib/Include/sys/time.h deleted file mode 100644 index 2b05b116b7..0000000000 --- a/StdLib/Include/sys/time.h +++ /dev/null @@ -1,200 +0,0 @@ -/** @file
- System-specific declarations and macros related to time.
-
- 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) 1982, 1986, 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.
-
- time.h 8.5 (Berkeley) 5/4/95
- NetBSD: time.h,v 1.56 2006/06/18 21:09:24 uwe Exp
- */
-#ifndef _SYS_TIME_H_
-#define _SYS_TIME_H_
-
-#include <Uefi.h>
-#include <sys/featuretest.h>
-#include <sys/types.h>
-
-/*
- * Traditional *nix structure returned by gettimeofday(2) system call,
- * and used in other calls.
- */
-struct timeval {
- LONG32 tv_sec; /* seconds */
- LONG32 tv_usec; /* and microseconds */
-};
-
-/*
- * Structure defined by POSIX.1b to be like a timeval.
- * This works within EFI since the times really are time_t.
- */
-struct timespec {
- time_t tv_sec; /* seconds */
- LONG32 tv_nsec; /* and nanoseconds */
-};
-
-#define TIMEVAL_TO_TIMESPEC(tv, ts) do { \
- (ts)->tv_sec = (tv)->tv_sec; \
- (ts)->tv_nsec = (tv)->tv_usec * 1000; \
-} while (/*CONSTCOND*/0)
-
-#define TIMESPEC_TO_TIMEVAL(tv, ts) do { \
- (tv)->tv_sec = (ts)->tv_sec; \
- (tv)->tv_usec = (ts)->tv_nsec / 1000; \
-} while (/*CONSTCOND*/0)
-
-/* Operations on timevals. */
-#define timerclear(tvp) (tvp)->tv_sec = (tvp)->tv_usec = 0
-#define timerisset(tvp) ((tvp)->tv_sec || (tvp)->tv_usec)
-
-#define timercmp(tvp, uvp, cmp) \
- (((tvp)->tv_sec == (uvp)->tv_sec) ? \
- ((tvp)->tv_usec cmp (uvp)->tv_usec) : \
- ((tvp)->tv_sec cmp (uvp)->tv_sec))
-
-#define timeradd(tvp, uvp, vvp) \
- do { \
- (vvp)->tv_sec = (tvp)->tv_sec + (uvp)->tv_sec; \
- (vvp)->tv_usec = (tvp)->tv_usec + (uvp)->tv_usec; \
- if ((vvp)->tv_usec >= 1000000) { \
- (vvp)->tv_sec++; \
- (vvp)->tv_usec -= 1000000; \
- } \
- } while (/* CONSTCOND */ 0)
-
-#define timersub(tvp, uvp, vvp) \
- do { \
- (vvp)->tv_sec = (tvp)->tv_sec - (uvp)->tv_sec; \
- (vvp)->tv_usec = (tvp)->tv_usec - (uvp)->tv_usec; \
- if ((vvp)->tv_usec < 0) { \
- (vvp)->tv_sec--; \
- (vvp)->tv_usec += 1000000; \
- } \
- } while (/* CONSTCOND */ 0)
-
-/* Operations on timespecs. */
-#define timespecclear(tsp) (tsp)->tv_sec = (tsp)->tv_nsec = 0
-#define timespecisset(tsp) ((tsp)->tv_sec || (tsp)->tv_nsec)
-
-#define timespeccmp(tsp, usp, cmp) \
- (((tsp)->tv_sec == (usp)->tv_sec) ? \
- ((tsp)->tv_nsec cmp (usp)->tv_nsec) : \
- ((tsp)->tv_sec cmp (usp)->tv_sec))
-
-#define timespecadd(tsp, usp, vsp) \
- do { \
- (vsp)->tv_sec = (tsp)->tv_sec + (usp)->tv_sec; \
- (vsp)->tv_nsec = (tsp)->tv_nsec + (usp)->tv_nsec; \
- if ((vsp)->tv_nsec >= 1000000000L) { \
- (vsp)->tv_sec++; \
- (vsp)->tv_nsec -= 1000000000L; \
- } \
- } while (/* CONSTCOND */ 0)
-
-#define timespecsub(tsp, usp, vsp) \
- do { \
- (vsp)->tv_sec = (tsp)->tv_sec - (usp)->tv_sec; \
- (vsp)->tv_nsec = (tsp)->tv_nsec - (usp)->tv_nsec; \
- if ((vsp)->tv_nsec < 0) { \
- (vsp)->tv_sec--; \
- (vsp)->tv_nsec += 1000000000L; \
- } \
- } while (/* CONSTCOND */ 0)
-
-/*
- * Names of the interval timers, and structure
- * defining a timer setting.
- */
-#define ITIMER_REAL 0
-#define ITIMER_VIRTUAL 1
-#define ITIMER_PROF 2
-
-struct itimerval {
- struct timeval it_interval; /* timer interval */
- struct timeval it_value; /* current value */
-};
-
-/*
- * Structure defined by POSIX.1b to be like a itimerval, but with
- * timespecs. Used in the timer_*() system calls.
- */
-struct itimerspec {
- struct timespec it_interval;
- struct timespec it_value;
-};
-
-#define CLOCK_REALTIME 0
-#define CLOCK_VIRTUAL 1
-#define CLOCK_PROF 2
-#define CLOCK_MONOTONIC 3
-
-#define TIMER_RELTIME 0x0 /* relative timer */
-#define TIMER_ABSTIME 0x1 /* absolute timer */
-
-#if 0
- #if (_POSIX_C_SOURCE - 0) >= 200112L || \
- (defined(_XOPEN_SOURCE) && defined(_XOPEN_SOURCE_EXTENDED)) || \
- (_XOPEN_SOURCE - 0) >= 500 || defined(_NETBSD_SOURCE)
- #include <sys/select.h>
- #endif
-#endif /* if 0 */
-
-#include <sys/EfiCdefs.h>
-#include <time.h>
-
-/* Functions useful for dealing with EFI */
-__BEGIN_DECLS
-
-/* Convert an EFI_TIME structure into a time_t value. */
-time_t Efi2Time( EFI_TIME *EfiBDtime);
-
-/* Convert a time_t value into an EFI_TIME structure.
- It is the caller's responsibility to free the returned structure.
-*/
-EFI_TIME * Time2Efi(time_t OTime);
-
-/* Convert an EFI_TIME structure into a C Standard tm structure. */
-void Efi2Tm( EFI_TIME *EfiBDtime, struct tm *NewTime);
-void Tm2Efi( struct tm *BdTime, EFI_TIME *ETime);
-
-/* BSD compatibility functions */
-int gettimeofday (struct timeval *tp, void *ignore);
-/* POSIX compatibility functions */
-int getitimer (int which, struct itimerval *value);
-int setitimer (int which, const struct itimerval *value, struct itimerval *ovalue);
-
-__END_DECLS
-
-#endif /* !_SYS_TIME_H_ */
diff --git a/StdLib/Include/sys/types.h b/StdLib/Include/sys/types.h deleted file mode 100644 index 54ae00836f..0000000000 --- a/StdLib/Include/sys/types.h +++ /dev/null @@ -1,301 +0,0 @@ -/** @file
- System type declarations.
-
- 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) 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:
- - Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
- - 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.
- - 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 COPYRIGHT HOLDERS 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 COPYRIGHT HOLDERS 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: types.h,v 1.71.12.1 2007/09/27 13:40:47 xtraeme Exp
- types.h 8.4 (Berkeley) 1/21/94
-**/
-#ifndef _SYS_TYPES_H_
-#define _SYS_TYPES_H_
-
-#include <sys/EfiCdefs.h>
-
-/* Machine type dependent parameters. */
-#include <machine/types.h>
-
-#include <machine/ansi.h>
-#include <machine/int_types.h>
-
-
-#include <sys/ansi.h>
-
-#ifndef int8_t
- typedef __int8_t int8_t;
- #define int8_t __int8_t
-#endif
-
-#ifndef uint8_t
- typedef __uint8_t uint8_t;
- #define uint8_t __uint8_t
-#endif
-
-#ifndef int16_t
- typedef __int16_t int16_t;
- #define int16_t __int16_t
-#endif
-
-#ifndef uint16_t
- typedef __uint16_t uint16_t;
- #define uint16_t __uint16_t
-#endif
-
-#ifndef int32_t
- typedef __int32_t int32_t;
- #define int32_t __int32_t
-#endif
-
-#ifndef uint32_t
- typedef __uint32_t uint32_t;
- #define uint32_t __uint32_t
-#endif
-
-#ifndef int64_t
- typedef __int64_t int64_t;
- #define int64_t __int64_t
-#endif
-
-#ifndef uint64_t
- typedef __uint64_t uint64_t;
- #define uint64_t __uint64_t
-#endif
-
-typedef uint8_t u_int8_t;
-typedef uint16_t u_int16_t;
-typedef uint32_t u_int32_t;
-typedef uint64_t u_int64_t;
-
-#include <machine/endian.h>
-
-#if defined(_NETBSD_SOURCE)
- typedef UINT8 u_char;
- typedef UINT16 u_short;
- typedef UINTN u_int;
- typedef ULONGN u_long;
-
- typedef UINT8 unchar; /* Sys V compatibility */
- typedef UINT16 ushort; /* Sys V compatibility */
- typedef UINTN uint; /* Sys V compatibility */
- typedef ULONGN ulong; /* Sys V compatibility */
-
- typedef u_long cpuid_t;
-#endif
-
-typedef uint64_t u_quad_t; /* quads */
-typedef int64_t quad_t;
-typedef quad_t * qaddr_t;
-
-/*
- * The types longlong_t and u_longlong_t exist for use with the
- * Sun-derived XDR routines involving these types, and their usage
- * in other contexts is discouraged. Further note that these types
- * may not be equivalent to "long long" and "unsigned long long",
- * they are only guaranteed to be signed and unsigned 64-bit types
- * respectively. Portable programs that need 64-bit types should use
- * the C99 types int64_t and uint64_t instead.
- */
-
-typedef int64_t longlong_t; /* for XDR */
-typedef uint64_t u_longlong_t; /* for XDR */
-
-typedef int64_t blkcnt_t; /* fs block count */
-typedef uint32_t blksize_t; /* fs optimal block size */
-
-#ifndef fsblkcnt_t
- typedef __fsblkcnt_t fsblkcnt_t; /* fs block count (statvfs) */
- #define fsblkcnt_t __fsblkcnt_t
-#endif
-
-#ifndef fsfilcnt_t
- typedef __fsfilcnt_t fsfilcnt_t; /* fs file count */
- #define fsfilcnt_t __fsfilcnt_t
-#endif
-
-#ifndef caddr_t
- typedef __caddr_t caddr_t; /* core address */
- #define caddr_t __caddr_t
-#endif
-
-#ifdef __daddr_t
- typedef __daddr_t daddr_t; /* disk address */
- #undef __daddr_t
-#else
- typedef int64_t daddr_t; /* disk address */
-#endif
-
-typedef uint32_t dev_t; /* device number */
-typedef uint32_t fixpt_t; /* fixed point number */
-
-#ifndef gid_t
- typedef __gid_t gid_t; /* group id */
- #define gid_t __gid_t
-#endif
-
-typedef uint32_t id_t; /* group id, process id or user id */
-typedef uint64_t ino_t; /* inode number */
-typedef EFI_LONG_T key_t; /* IPC key (for Sys V IPC) */
-
-#ifndef mode_t
- typedef __mode_t mode_t; /* permissions */
- #define mode_t __mode_t
-#endif
-
-typedef uint32_t nlink_t; /* link count */
-
-#ifndef off_t
- typedef __off_t off_t; /* file offset */
- #define off_t __off_t
-#endif
-
-#ifndef pid_t
- typedef __pid_t pid_t; /* process id */
- #define pid_t __pid_t
-#endif
-typedef int32_t lwpid_t; /* LWP id */
-typedef quad_t rlim_t; /* resource limit */
-typedef int32_t segsz_t; /* segment size */
-typedef int32_t swblk_t; /* swap offset */
-
-#ifndef uid_t
- typedef __uid_t uid_t; /* user id */
- #define uid_t __uid_t
-#endif
-
-typedef int64_t dtime_t; /* on-disk time_t */
-
-#if defined(_LIBC)
- /*
- * semctl(2)'s argument structure. This is here for the benefit of
- * <sys/syscallargs.h>. It is not in the user's namespace in SUSv2.
- * The SUSv2 semctl(2) takes variable arguments.
- */
- union __semun {
- int val; /* value for SETVAL */
- struct semid_ds *buf; /* buffer for IPC_STAT & IPC_SET */
- unsigned short *array; /* array for GETALL & SETALL */
- };
- /* For the same reason as above */
- #include <sys/stdint.h>
- typedef intptr_t semid_t;
-#endif /* _LIBC */
-
-/*
- * These belong in EfiSysCall.h, but are also placed here to ensure that
- * long arguments will be promoted to off_t if the program fails to
- * include that header or explicitly cast them to off_t.
- */
-#ifndef __OFF_T_SYSCALLS_DECLARED
- #define __OFF_T_SYSCALLS_DECLARED
- __BEGIN_DECLS
- extern off_t lseek (int, off_t, int);
- extern int truncate (const char *, off_t);
- extern int ftruncate (int, off_t);
- __END_DECLS
-#endif /* __OFF_T_SYSCALLS_DECLARED */
-
-#if defined(_NETBSD_SOURCE)
- /* Major, minor numbers, dev_t's. */
- #define major(x) ((int32_t)((((x) & 0x000fff00) >> 8)))
- #define minor(x) ((int32_t)((((x) & 0xfff00000) >> 12) | \
- (((x) & 0x000000ff) >> 0)))
- #define makedev(x,y) ((dev_t)((((x) << 8) & 0x000fff00) | \
- (((y) << 12) & 0xfff00000) | \
- (((y) << 0) & 0x000000ff)))
-#endif
-
-#if defined(_BSD_CLOCK_T_) && defined(_EFI_CLOCK_T)
- typedef _EFI_CLOCK_T clock_t;
- #undef _BSD_CLOCK_T_
- #undef _EFI_CLOCK_T
-#endif
-
-#ifdef _EFI_SIZE_T_
- typedef _EFI_SIZE_T_ size_t;
- #define _SIZE_T
- #undef _BSD_SIZE_T_
- #undef _EFI_SIZE_T_
-#endif
-
-#ifdef _BSD_SSIZE_T_
- typedef _BSD_SSIZE_T_ ssize_t;
- #undef _BSD_SSIZE_T_
-#endif
-
-#if defined(_BSD_TIME_T_) && defined(_EFI_TIME_T)
- typedef _EFI_TIME_T time_t;
- #undef _BSD_TIME_T_
- #undef _EFI_TIME_T
-#endif
-
-#ifdef _BSD_CLOCKID_T_
- typedef _BSD_CLOCKID_T_ clockid_t;
- #undef _BSD_CLOCKID_T_
-#endif
-
-#ifdef _BSD_TIMER_T_
- typedef _BSD_TIMER_T_ timer_t;
- #undef _BSD_TIMER_T_
-#endif
-
-#ifdef _BSD_SUSECONDS_T_
- typedef _BSD_SUSECONDS_T_ suseconds_t;
- #undef _BSD_SUSECONDS_T_
-#endif
-
-#ifdef _BSD_USECONDS_T_
- typedef _BSD_USECONDS_T_ useconds_t;
- #undef _BSD_USECONDS_T_
-#endif
-
-#ifdef _NETBSD_SOURCE
- #include <sys/fd_set.h>
- #define NBBY __NBBY
-
- typedef struct kauth_cred *kauth_cred_t;
-
-#endif
-
-#if 0
- #if !defined(_KERNEL) && !defined(_STANDALONE)
- #if (_POSIX_C_SOURCE - 0L) >= 199506L || (_XOPEN_SOURCE - 0) >= 500 || \
- defined(_NETBSD_SOURCE)
- #include <pthread_types.h>
- #endif
- #endif
-#endif /* if 0 */
-
-#endif /* !_SYS_TYPES_H_ */
diff --git a/StdLib/Include/sys/uio.h b/StdLib/Include/sys/uio.h deleted file mode 100644 index e6d667ba30..0000000000 --- a/StdLib/Include/sys/uio.h +++ /dev/null @@ -1,124 +0,0 @@ -/* $NetBSD: uio.h,v 1.34 2006/03/01 12:38:32 yamt Exp $ */
-
-/*
- * Copyright (c) 1982, 1986, 1993, 1994
- * 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.
- *
- * @(#)uio.h 8.5 (Berkeley) 2/22/94
- */
-
-#ifndef _SYS_UIO_H_
-#define _SYS_UIO_H_
-
-#ifdef _KERNEL
-#ifndef __UIO_EXPOSE
-#define __UIO_EXPOSE
-#endif
-#endif
-
-#include <machine/ansi.h>
-#include <sys/featuretest.h>
-
-#ifdef _EFI_SIZE_T_
-typedef _EFI_SIZE_T_ size_t;
-#undef _EFI_SIZE_T_
-#undef _BSD_SIZE_T_
-#endif
-
-#ifdef _BSD_SSIZE_T_
-typedef _BSD_SSIZE_T_ ssize_t;
-#undef _BSD_SSIZE_T_
-#endif
-
-struct iovec {
- void *iov_base; /* Base address. */
- size_t iov_len; /* Length. */
-};
-
-#if defined(_NETBSD_SOURCE)
-#include <sys/ansi.h>
-
-#ifndef off_t
-typedef __off_t off_t; /* file offset */
-#define off_t __off_t
-#endif
-
-enum uio_rw { UIO_READ, UIO_WRITE };
-
-/* Segment flag values. */
-enum uio_seg {
- UIO_USERSPACE, /* from user data space */
- UIO_SYSSPACE /* from system space */
-};
-
-#ifdef __UIO_EXPOSE
-
-struct uio {
- struct iovec *uio_iov; /* pointer to array of iovecs */
- int uio_iovcnt; /* number of iovecs in array */
- off_t uio_offset; /* offset into file this uio corresponds to */
- size_t uio_resid; /* residual i/o count */
- enum uio_rw uio_rw; /* see above */
- struct vmspace *uio_vmspace;
-};
-#define UIO_SETUP_SYSSPACE(uio) uio_setup_sysspace(uio)
-
-#endif /* __UIO_EXPOSE */
-
-/*
- * Limits
- */
-/* Deprecated: use IOV_MAX from <limits.h> instead. */
-#define UIO_MAXIOV 1024 /* max 1K of iov's */
-#endif /* _NETBSD_SOURCE */
-
-#ifdef _KERNEL
-#include <sys/mallocvar.h>
-
-MALLOC_DECLARE(M_IOV);
-
-#define UIO_SMALLIOV 8 /* 8 on stack, else malloc */
-
-void uio_setup_sysspace(struct uio *);
-#endif
-
-#ifndef _KERNEL
-#include <sys/EfiCdefs.h>
-
-__BEGIN_DECLS
-#if defined(_NETBSD_SOURCE)
-ssize_t preadv(int, const struct iovec *, int, off_t);
-ssize_t pwritev(int, const struct iovec *, int, off_t);
-#endif /* _NETBSD_SOURCE */
-ssize_t readv(int, const struct iovec *, int);
-ssize_t writev(int, const struct iovec *, int);
-__END_DECLS
-#else
-int ureadc(int, struct uio *);
-#endif /* !_KERNEL */
-
-#endif /* !_SYS_UIO_H_ */
diff --git a/StdLib/Include/sys/unistd.h b/StdLib/Include/sys/unistd.h deleted file mode 100644 index 274e29f096..0000000000 --- a/StdLib/Include/sys/unistd.h +++ /dev/null @@ -1,95 +0,0 @@ -/** @file
-
- Copyright (c) 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) 1989, 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.
- *
- * @(#)unistd.h 8.2 (Berkeley) 1/7/94
- NetBSD: unistd.h,v 1.35 2006/08/14 18:17:48 rpaulo Exp
-**/
-#ifndef _SYS_UNISTD_H_
-#define _SYS_UNISTD_H_
-
-#include <sys/featuretest.h>
-
-/* compile-time symbolic constants */
-
-/*
- * According to POSIX 1003.1:
- * "The saved set-user-ID capability allows a program to regain the
- * effective user ID established at the last exec call."
- * However, the setuid/setgid function as specified by POSIX 1003.1 does
- * not allow changing the effective ID from the super-user without also
- * changed the saved ID, so it is impossible to get super-user privileges
- * back later. Instead we provide this feature independent of the current
- * effective ID through the seteuid/setegid function. In addition, we do
- * not use the saved ID as specified by POSIX 1003.1 in setuid/setgid,
- * because this would make it impossible for a set-user-ID executable
- * owned by a user other than the super-user to permanently revoke its
- * extra privileges.
- */
-#ifdef _NOT_AVAILABLE
-#define _POSIX_SAVED_IDS /* saved set-user-ID and set-group-ID */
-#endif
-
-#define _POSIX_VERSION 199009L
-#define _POSIX2_VERSION 199212L
-
-/* execution-time symbolic constants */
- /* timers */
-#define _POSIX_TIMERS 200112L
-
-/* Always ensure that these are consistent with <fcntl.h>!
- whence values for lseek(2).
-*/
-#ifndef SEEK_SET
-#define SEEK_SET 0 /**< set file offset to offset */
-#endif
-#ifndef SEEK_CUR
-#define SEEK_CUR 1 /**< set file offset to current plus offset */
-#endif
-#ifndef SEEK_END
-#define SEEK_END 2 /**< set file offset to EOF plus offset */
-#endif
-
-/* whence values for lseek(2); renamed by POSIX 1003.1 */
-#define L_SET SEEK_SET
-#define L_INCR SEEK_CUR
-#define L_XTND SEEK_END
-
-/* configurable system strings */
-#define _CS_PATH 1
-
-#endif /* !_SYS_UNISTD_H_ */
diff --git a/StdLib/Include/sys/wait.h b/StdLib/Include/sys/wait.h deleted file mode 100644 index 64200aa999..0000000000 --- a/StdLib/Include/sys/wait.h +++ /dev/null @@ -1,170 +0,0 @@ -/* $NetBSD: wait.h,v 1.24 2005/12/11 12:25:21 christos Exp $ */
-
-/*
- * Copyright (c) 1982, 1986, 1989, 1993, 1994
- * 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.
- *
- * @(#)wait.h 8.2 (Berkeley) 7/10/94
- */
-#ifndef _SYS_WAIT_H_
-#define _SYS_WAIT_H_
-
-#include <sys/featuretest.h>
-#include <sys/types.h>
-
-/*
- * This file holds definitions relevent to the wait4 system call
- * and the alternate interfaces that use it (wait, wait3, waitpid).
- */
-
-/*
- * Macros to test the exit status returned by wait
- * and extract the relevant values.
- */
-#define _W_INT(w) (*(int *)(void *)&(w)) /* convert union wait to int */
-
-#define _WSTATUS(x) (_W_INT(x) & 0177)
-#define _WSTOPPED 0177 /* _WSTATUS if process is stopped */
-#define WIFSTOPPED(x) (_WSTATUS(x) == _WSTOPPED)
-#define WSTOPSIG(x) ((int)(((unsigned int)_W_INT(x)) >> 8) & 0xff)
-#define WIFSIGNALED(x) (_WSTATUS(x) != _WSTOPPED && _WSTATUS(x) != 0)
-#define WTERMSIG(x) (_WSTATUS(x))
-#define WIFEXITED(x) (_WSTATUS(x) == 0)
-#define WEXITSTATUS(x) ((int)(((unsigned int)_W_INT(x)) >> 8) & 0xff)
-#define WCOREFLAG 0200
-#define WCOREDUMP(x) (_W_INT(x) & WCOREFLAG)
-
-#define W_EXITCODE(ret, sig) ((ret) << 8 | (sig))
-#define W_STOPCODE(sig) ((sig) << 8 | _WSTOPPED)
-
-/*
- * Option bits for the third argument of wait4. WNOHANG causes the
- * wait to not hang if there are no stopped or terminated processes, rather
- * returning an error indication in this case (pid==0). WUNTRACED
- * indicates that the caller should receive status about untraced children
- * which stop due to signals. If children are stopped and a wait without
- * this option is done, it is as though they were still running... nothing
- * about them is returned.
- */
-#define WNOHANG 0x00000001 /* don't hang in wait */
-#define WUNTRACED 0x00000002 /* tell about stopped,
- untraced children */
-#if defined(_XOPEN_SOURCE) || defined(_NETBSD_SOURCE)
-#define WALTSIG 0x00000004 /* wait for processes that exit
- with an alternate signal (i.e.
- not SIGCHLD) */
-#define WALLSIG 0x00000008 /* wait for processes that exit
- with any signal, i.e. SIGCHLD
- and alternates */
-
-/*
- * These are the Linux names of some of the above flags, for compatibility
- * with Linux's clone(2) API.
- */
-#define __WCLONE WALTSIG
-#define __WALL WALLSIG
-
-/*
- * These bits are used in order to support SVR4 (etc) functionality
- * without replicating sys_wait4 5 times.
- */
-#define WNOWAIT 0x00010000 /* Don't mark child 'P_WAITED' */
-#define WNOZOMBIE 0x00020000 /* Ignore zombies */
-#endif /* _XOPEN_SOURCE || _NETBSD_SOURCE */
-
-/* POSIX extensions and 4.2/4.3 compatibility: */
-
-/*
- * Tokens for special values of the "pid" parameter to wait4.
- */
-#define WAIT_ANY (-1) /* any process */
-#define WAIT_MYPGRP 0 /* any process in my process group */
-
-/*
- * Deprecated:
- * Structure of the information in the status word returned by wait4.
- * If w_stopval==WSTOPPED, then the second structure describes
- * the information returned, else the first.
- */
-union wait {
- int w_status; /* used in syscall */
- /*
- * Terminated process status.
- */
- struct {
-#if BYTE_ORDER == LITTLE_ENDIAN
- unsigned int w_Termsig:7, /* termination signal */
- w_Coredump:1, /* core dump indicator */
- w_Retcode:8, /* exit code if w_termsig==0 */
- w_Filler:16; /* upper bits filler */
-#endif
-#if BYTE_ORDER == BIG_ENDIAN
- unsigned int w_Filler:16, /* upper bits filler */
- w_Retcode:8, /* exit code if w_termsig==0 */
- w_Coredump:1, /* core dump indicator */
- w_Termsig:7; /* termination signal */
-#endif
- } w_T;
- /*
- * Stopped process status. Returned
- * only for traced children unless requested
- * with the WUNTRACED option bit.
- */
- struct {
-#if BYTE_ORDER == LITTLE_ENDIAN
- unsigned int w_Stopval:8, /* == W_STOPPED if stopped */
- w_Stopsig:8, /* signal that stopped us */
- w_Filler:16; /* upper bits filler */
-#endif
-#if BYTE_ORDER == BIG_ENDIAN
- unsigned int w_Filler:16, /* upper bits filler */
- w_Stopsig:8, /* signal that stopped us */
- w_Stopval:8; /* == W_STOPPED if stopped */
-#endif
- } w_S;
-};
-#define w_termsig w_T.w_Termsig
-#define w_coredump w_T.w_Coredump
-#define w_retcode w_T.w_Retcode
-#define w_stopval w_S.w_Stopval
-#define w_stopsig w_S.w_Stopsig
-
-#define WSTOPPED _WSTOPPED
-
-__BEGIN_DECLS
-pid_t wait(int *);
-
-#if 0 /* Normally declared here but not implemented for UEFI. */
-struct rusage; /* forward declaration */
-
-pid_t waitpid(pid_t, int *, int);
-pid_t wait3(int *, int, struct rusage *);
-pid_t wait4(pid_t, int *, int, struct rusage *);
-#endif
-__END_DECLS
-
-#endif /* !_SYS_WAIT_H_ */
|