summaryrefslogtreecommitdiff
path: root/StdLib
diff options
context:
space:
mode:
authordarylm503 <darylm503@6f19259b-4bc3-4df7-8a09-765794883524>2011-08-04 23:35:57 +0000
committerdarylm503 <darylm503@6f19259b-4bc3-4df7-8a09-765794883524>2011-08-04 23:35:57 +0000
commit8379337c91e3b6da5ebc0d99d4147fb623afcd22 (patch)
tree675e644c2a2ca018d50112910be4f659794c6d17 /StdLib
parent681cc25c179fdf3462d8366edbc3a886443964c7 (diff)
Update or add comments to files and functions for use by Doxygen.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@12090 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'StdLib')
-rw-r--r--StdLib/Include/Ia32/machine/types.h2
-rw-r--r--StdLib/Include/ctype.h23
-rw-r--r--StdLib/Include/float.h15
-rw-r--r--StdLib/Include/iso646.h20
-rw-r--r--StdLib/Include/sys/ansi.h28
-rw-r--r--StdLib/Include/sys/fcntl.h158
-rw-r--r--StdLib/Include/sys/float_ieee754.h16
-rw-r--r--StdLib/Include/sys/stat.h167
-rw-r--r--StdLib/Include/sys/types.h4
-rw-r--r--StdLib/Include/x86/float.h12
-rw-r--r--StdLib/LibC/Uefi/Devices/Console/daConsole.c2
11 files changed, 253 insertions, 194 deletions
diff --git a/StdLib/Include/Ia32/machine/types.h b/StdLib/Include/Ia32/machine/types.h
index f985991ec..35c49bef0 100644
--- a/StdLib/Include/Ia32/machine/types.h
+++ b/StdLib/Include/Ia32/machine/types.h
@@ -5,7 +5,7 @@
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.
+ 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.
diff --git a/StdLib/Include/ctype.h b/StdLib/Include/ctype.h
index 64bccd5f6..fb0e2fd7d 100644
--- a/StdLib/Include/ctype.h
+++ b/StdLib/Include/ctype.h
@@ -55,6 +55,17 @@ int isalnum(int c);
**/
int isalpha(int c);
+/** The isblank function tests that a character is a white-space character that results
+ in a number of space (' ') characters being sent to the output device. In the C locale
+ this is either ' ' or '\t'.
+
+ @param[in] c The character to be tested.
+
+ @return Returns nonzero (true) if and only if the value of the parameter c
+ can be classified as specified in the description of the function.
+**/
+int isblank(int);
+
/** The iscntrl function tests for any control character.
@param[in] c The character to be tested.
@@ -150,18 +161,8 @@ int isupper(int c);
**/
int isxdigit(int c);
-/** The isblank function tests that a character is a white-space character that results
- in a number of space (' ') characters being sent to the output device. In the C locale
- this is either ' ' or '\t'.
-
- @param[in] c The character to be tested.
-
- @return Returns nonzero (true) if and only if the value of the parameter c
- can be classified as specified in the description of the function.
-**/
-int isblank(int);
-
/** The isascii function tests that a character is one of the 128 7-bit ASCII characters.
+ This function is not part of the C standard, but is commonly used.
@param[in] c The character to be tested.
diff --git a/StdLib/Include/float.h b/StdLib/Include/float.h
index ca38ade70..4a590d052 100644
--- a/StdLib/Include/float.h
+++ b/StdLib/Include/float.h
@@ -1 +1,16 @@
+/** @file
+ Limits and constants for floating-point operations.
+
+ Accuracy of the floating-point operations provided by this implementation
+ of the Standard C Library has not been determined.
+
+ 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.
+**/
#include <machine/float.h>
diff --git a/StdLib/Include/iso646.h b/StdLib/Include/iso646.h
index c72d5d663..db3450193 100644
--- a/StdLib/Include/iso646.h
+++ b/StdLib/Include/iso646.h
@@ -1,17 +1,17 @@
/** @file
- Provides alternative "spellings" for several C operators.
+ Provides alternative "spellings" for several C operators.
- The header <iso646.h> defines the following eleven macros (on the left) that expand
- to the corresponding tokens (on the right).
+ The header <iso646.h> defines the following eleven macros (on the left) that expand
+ to the corresponding tokens (on the right).
-Copyright (c) 2010, Intel Corporation. All rights reserved.<BR>
-This program and the accompanying materials are licensed and made available under
-the terms and conditions of the BSD License that accompanies this distribution.
-The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php.
+ 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.
+ 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 _ISO646_H
#define _ISO646_H
diff --git a/StdLib/Include/sys/ansi.h b/StdLib/Include/sys/ansi.h
index 4fb12987a..f8489fa2e 100644
--- a/StdLib/Include/sys/ansi.h
+++ b/StdLib/Include/sys/ansi.h
@@ -1,11 +1,11 @@
/** @file
ANSI type definitions.
- Copyright (c) 2010, Intel Corporation. All rights reserved.<BR>
+ 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.php.
+ 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.
@@ -47,17 +47,17 @@
#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 */
+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/fcntl.h b/StdLib/Include/sys/fcntl.h
index 8b691b19f..d41af5ce1 100644
--- a/StdLib/Include/sys/fcntl.h
+++ b/StdLib/Include/sys/fcntl.h
@@ -2,11 +2,11 @@
This file includes the definitions for open and fcntl described by POSIX
for <fcntl.h>; it also includes related kernel definitions.
- Copyright (c) 2010, Intel Corporation. All rights reserved.<BR>
+ 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.
+ 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.
@@ -54,71 +54,69 @@
#include <sys/stat.h>
-/*
- * File status flags: these are 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.
- */
+/** 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 */
-
-/*
- * Kernel encoding of open mode; separate read and write bits that are
- * independently testable: 1 greater than the above.
- */
-#define FREAD 0x00000001
-#define FWRITE 0x00000002
-#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 /* error if already exists */
+#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 ///< error if already exists
+/// @}
//#define O_DIRECT 0x00080000 /* direct I/O hint */
-#define O_SETMASK 0x0000000F /* Flags modifiable by F_SETFD (fcntl) */
+#define O_SETMASK 0x0000000F ///< Flags modifiable by F_SETFD (fcntl)
/*
* Constants used for fcntl(2)
*/
-/* command values */
-#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. */
+/** command values. @{ **/
+#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_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 */
+#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
@@ -136,8 +134,58 @@
__BEGIN_DECLS
#ifndef __FCNTL_SYSCALLS_DECLARED
#define __FCNTL_SYSCALLS_DECLARED
- int open(const char *, int, int );
+
+ /** 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
diff --git a/StdLib/Include/sys/float_ieee754.h b/StdLib/Include/sys/float_ieee754.h
index 1c8cfdedd..ab2f54c61 100644
--- a/StdLib/Include/sys/float_ieee754.h
+++ b/StdLib/Include/sys/float_ieee754.h
@@ -1,6 +1,13 @@
-/* $NetBSD: float_ieee754.h,v 1.8 2005/12/11 12:25:20 christos Exp $ */
+/** @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.
*
@@ -29,12 +36,11 @@
* 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_
diff --git a/StdLib/Include/sys/stat.h b/StdLib/Include/sys/stat.h
index b87f3f12e..9330a2be0 100644
--- a/StdLib/Include/sys/stat.h
+++ b/StdLib/Include/sys/stat.h
@@ -4,7 +4,7 @@
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.
+ 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.
@@ -48,82 +48,59 @@
#define _SYS_STAT_H_
#include <sys/featuretest.h>
-#include <sys/types.h> /* XXX */
+#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 */
-#if 0
- uint32_t st_flags; /* user defined flags for file */
- blkcnt_t st_blocks; /* blocks allocated for file */
- ino_t st_ino; /* inode's number */
- time_t st_ctime; /* time of last file status change */
- nlink_t st_nlink; /* number of hard links */
- uid_t st_uid; /* user ID of the file's owner */
- gid_t st_gid; /* group ID of the file's group */
- dev_t st_dev; /* inode's device */
- dev_t st_rdev; /* device type */
- uint32_t st_gen; /* file generation number */
-#endif
+ 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];
};
-#if 0
-#define st_atime st_atimespec.tv_sec
-#define st_atimensec st_atimespec.tv_nsec
-#define st_mtime st_mtimespec.tv_sec
-#define st_mtimensec st_mtimespec.tv_nsec
-#define st_ctime st_ctimespec.tv_sec
-#define st_ctimensec st_ctimespec.tv_nsec
-#define st_birthtime st_birthtimespec.tv_sec
-#define st_birthtimensec st_birthtimespec.tv_nsec
-#endif
-
-#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_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_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 */
+#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.
*/
-#define _S_IFMT 0x000FF000 /* type-of-file mask */
-#define _S_IFIFO 0x00001000 /* named pipe (fifo) */
-#define _S_IFCHR 0x00002000 /* character special */
-#define _S_IFDIR 0x00004000 /* directory */
-#define _S_IFBLK 0x00006000 /* block special */
-#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 receives Wide characters */
-#define _S_ICONSOLE 0x00030000 /* UEFI Console Device */
+#define _S_IFMT 0x000FF000 ///< type-of-file mask
+#define _S_IFIFO 0x00001000 ///< named pipe (fifo)
+#define _S_IFCHR 0x00002000 ///< character special
+#define _S_IFDIR 0x00004000 ///< directory
+#define _S_IFBLK 0x00006000 ///< block special
+#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 receives Wide characters
+#define _S_ICONSOLE 0x00030000 ///< UEFI Console Device
/* UEFI specific (FAT file system) File attributes.
Specified in Hexadecimal instead of Octal.
@@ -134,71 +111,56 @@ struct stat {
#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_IROFS 0x08000000 ///< Read Only File System
-#define S_EFIONLY 0xF0000000 /* Flags only used by the EFI system calls. */
+#define S_EFIONLY 0xF0000000 ///< Flags only used by the EFI system calls.
#define S_EFISHIFT 20 // LS bit of the UEFI attributes
-//#define _S_IFLNK 0120000 /* symbolic link */
-//#define _S_IFWHT 0160000 /* whiteout */
-//#define _S_ARCH1 0200000 /* Archive state 1, ls -l shows 'a' */
-//#define _S_ARCH2 0400000 /* Archive state 2, ls -l shows 'A' */
-//#define _S_ISVTX 0001000 /* ???? save swapped text even after use */
-
-
#define S_IFMT _S_IFMT
#define S_IFBLK _S_IFBLK
#define S_IFREG _S_IFREG
#define S_IFIFO _S_IFIFO
#define S_IFCHR _S_IFCHR
#define S_IFDIR _S_IFDIR
-//#define S_IFLNK _S_IFLNK
-//#define S_ISVTX _S_ISVTX
#define S_IFSOCK _S_IFSOCK
-//#define S_IFWHT _S_IFWHT
-//#define S_ARCH1 _S_ARCH1
-//#define S_ARCH2 _S_ARCH2
+#define S_ISDIR(m) ((m & _S_IFMT) == _S_IFDIR) ///< directory
+#define S_ISCHR(m) ((m & _S_IFMT) == _S_IFCHR) ///< char special
+#define S_ISREG(m) ((m & _S_IFMT) == _S_IFREG) ///< regular file
+#define S_ISBLK(m) ((m & _S_IFMT) == _S_IFBLK) ///< block special
+#define S_ISSOCK(m) ((m & _S_IFMT) == _S_IFSOCK) ///< socket
-#define S_ISDIR(m) ((m & _S_IFMT) == _S_IFDIR) /* directory */
-#define S_ISCHR(m) ((m & _S_IFMT) == _S_IFCHR) /* char special */
-#define S_ISREG(m) ((m & _S_IFMT) == _S_IFREG) /* regular file */
-#define S_ISBLK(m) ((m & _S_IFMT) == _S_IFBLK) /* block special */
-#define S_ISSOCK(m) ((m & _S_IFMT) == _S_IFSOCK) /* socket */
-
-#define S_ISFIFO(m) ((m & _S_IFMT) == _S_IFIFO) /* fifo */
-//#define S_ISLNK(m) ((m & _S_IFMT) == _S_IFLNK) /* symbolic link */
-//#define S_ISWHT(m) ((m & _S_IFMT) == _S_IFWHT) /* whiteout */
+#define S_ISFIFO(m) ((m & _S_IFMT) == _S_IFIFO) ///< fifo
/* 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 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 S_BLKSIZE 512 /* block size used in the stat struct */
+#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 */
+#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 */
+#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>
@@ -206,10 +168,25 @@ struct stat {
__BEGIN_DECLS
#ifndef __STAT_SYSCALLS_DECLARED
#define __STAT_SYSCALLS_DECLARED
+
+/**
+**/
extern int mkdir (const char *, mode_t);
+
+ /**
+ **/
extern int fstat (int, struct stat *);
+
+ /**
+ **/
extern int lstat (const char *, struct stat *);
+
+ /**
+ **/
extern int stat (const char *, void *);
+
+ /**
+ **/
extern int chmod (const char *, mode_t);
#endif // __STAT_SYSCALLS_DECLARED
__END_DECLS
diff --git a/StdLib/Include/sys/types.h b/StdLib/Include/sys/types.h
index 68e3ba3dd..408d74391 100644
--- a/StdLib/Include/sys/types.h
+++ b/StdLib/Include/sys/types.h
@@ -1,11 +1,11 @@
/** @file
System type declarations.
- Copyright (c) 2010, Intel Corporation. All rights reserved.<BR>
+ 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.php.
+ 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.
diff --git a/StdLib/Include/x86/float.h b/StdLib/Include/x86/float.h
index ee70bc88a..72ed75871 100644
--- a/StdLib/Include/x86/float.h
+++ b/StdLib/Include/x86/float.h
@@ -1,5 +1,15 @@
-/* $NetBSD: float.h,v 1.5 2003/10/23 23:26:06 kleink Exp $ */
+/** @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.
+
+ NetBSD: float.h,v 1.5 2003/10/23 23:26:06 kleink Exp
+**/
#ifndef _X86_FLOAT_H_
#define _X86_FLOAT_H_
diff --git a/StdLib/LibC/Uefi/Devices/Console/daConsole.c b/StdLib/LibC/Uefi/Devices/Console/daConsole.c
index 5dfc18acb..5a593557e 100644
--- a/StdLib/LibC/Uefi/Devices/Console/daConsole.c
+++ b/StdLib/LibC/Uefi/Devices/Console/daConsole.c
@@ -401,12 +401,14 @@ da_ConOpen(
(DevNode == NULL))
{
EFIerrno = RETURN_INVALID_PARAMETER;
+ errno = EINVAL;
return -1;
}
Stream = (ConInstance *)DevNode->InstanceList;
// Quick check to see if Stream looks reasonable
if(Stream->Cookie != CON_COOKIE) { // Cookie == 'IoAb'
EFIerrno = RETURN_INVALID_PARAMETER;
+ errno = EINVAL;
return -1; // Looks like a bad This pointer
}
gMD->StdIo[Stream->InstanceNum] = Stream;