Update or add comments to files and functions for use by Doxygen.

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@12139 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
darylm503 2011-08-15 19:05:36 +00:00
parent abb4e5f346
commit a430bdb132
11 changed files with 1745 additions and 713 deletions

View File

@ -1,21 +1,21 @@
/**
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.
/** @file
Machine (processor architecture) specific portion of <signal.h>.
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) 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.
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
**/
#ifndef _MACHINE_SIGNAL_H
#define _MACHINE_SIGNAL_H
#include <sys/EfiCdefs.h>
/** The type sig_atomic_t is the (possibly volatile-qualified) integer type of
an object that can be accessed as an atomic entity, even in the presence
of asynchronous interrupts.
/** The type sig_atomic_t is the type of an object that can be accessed as an
atomic entity, even in the presence of asynchronous interrupts.
**/
typedef INTN sig_atomic_t;

View File

@ -44,44 +44,97 @@
#ifndef _LOCALE_H_
#define _LOCALE_H_
/** This is a structure containing members pertaining to the formatting of numeric values.
There is no requirement for members of this structure to be in any particular order.
/** This is a structure containing members pertaining to the formatting and display of numeric values.
Each member of this structure is commented with its value in the "C" locale.
The decimal_point member must point to a string with a length greater than zero.
All other pointer members may point to "" in order to indicate that the value is not available
in the current locale, or that it is of zero length. Except for grouping and mon_grouping, the
strings start and end in the initial shift state.
The remaining members, of type char, are non-negative numbers or CHAR_MAX, which indicates that
the value is not available in the current locale.
Members grouping and mon_grouping point to strings where each element (character) of the string
indicates the size of the corresponding group of digits and is interpreted as follows:
- CHAR_MAX No further grouping is to be performed.
- 0 The previous element is to be repeatedly used for the remainder of the digits.
- other The ISO specification states: "The integer value is the number of digits that
compose the current group. The next element is examined to determine the size
of the next group of digits before the current group." The EDK II implementation
interprets this to mean that the groups are specified left-to-right.
The *_sep_by_space members are interpreted as follows:
- 0 No space separates the currency symbol and value.
- 1 If the currency symbol and sign string are adjacent, a space separates them from the
value; otherwise, a space separates the currency symbol from the value.
- 2 If the currency symbol and sign string are adjacent, a space separates them;
otherwise, a space separates the sign string from the value.
For int_p_sep_by_space and int_n_sep_by_space, the fourth character of int_curr_symbol is
used instead of a space.
The values of the *_sign_posn members are interpreted as follows:
- 0 Parentheses surround the quantity and currency symbol.
- 1 The sign string precedes the quantity and currency symbol.
- 2 The sign string succeeds the quantity and currency symbol.
- 3 The sign string immediately precedes the currency symbol.
- 4 The sign string immediately succeeds the currency symbol.
**/
struct lconv {
char *decimal_point;
char *thousands_sep;
char *grouping;
char *int_curr_symbol;
char *currency_symbol;
char *mon_decimal_point;
char *mon_thousands_sep;
char *mon_grouping;
char *positive_sign;
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;
char *decimal_point; /**< "." Non-monetary decimal-point. */
char *thousands_sep; /**< "" Separates groups of digits before the decimal-point */
char *grouping; /**< "" A string whose elements (characters) indicate the size
of each group of digits in formatted nonmonetary quantities. */
char *int_curr_symbol; /**< "" A 4-character string providing the international currency
symbol. The first three characters contain the alphabetic
international currency symbol in accordance with those
specified in ISO 4217. The fourth character, immediately
preceding the null character, is the character used to separate
the international currency symbol from the monetary quantity. */
char *currency_symbol; /**< "" The local currency symbol for the current locale. */
char *mon_decimal_point; /**< "" The decimal point used for monetary values. */
char *mon_thousands_sep; /**< "" The separator for digit groups preceeding the decimal-point. */
char *mon_grouping; /**< "" A string, like grouping, for monetary values. */
char *positive_sign; /**< "" A string to indicate a non-negative monetary value. */
char *negative_sign; /**< "" A string to indicate a negative monetary value. */
char int_frac_digits; /**< CHAR_MAX The number of digits after the decimal-point for international
monetary values. */
char frac_digits; /**< CHAR_MAX The number of digits after the decimal-point for local
monetary values. */
char p_cs_precedes; /**< CHAR_MAX Set to 1 or 0 if the currency_symbol respectively precedes or
succeeds the value for non-negative local monetary values. */
char p_sep_by_space; /**< CHAR_MAX Value specifying the separation between the currency_symbol,
the sign string, and the value for non-negative local values. */
char n_cs_precedes; /**< CHAR_MAX Set to 1 or 0 if the currency_symbol respectively precedes or
succeeds the value for negative local monetary values. */
char n_sep_by_space; /**< CHAR_MAX Value specifying the separation between the currency_symbol,
the sign string, and the value for negative local values. */
char p_sign_posn; /**< CHAR_MAX Value specifying the positioning of the positive_sign for a
non-negative local monetary quantity. */
char n_sign_posn; /**< CHAR_MAX Value specifying the positioning of the negative_sign for a
negative local monetary quantity. */
char int_p_cs_precedes; /**< CHAR_MAX Set to 1 or 0 if the currency_symbol respectively precedes or
succeeds the value for non-negative international monetary values. */
char int_n_cs_precedes; /**< CHAR_MAX Set to 1 or 0 if the currency_symbol respectively precedes or
succeeds the value for negative international monetary values. */
char int_p_sep_by_space; /**< CHAR_MAX Value specifying the separation between the currency_symbol,
the sign string, and the value for non-negative international values. */
char int_n_sep_by_space; /**< CHAR_MAX Value specifying the separation between the currency_symbol,
the sign string, and the value for negative international values. */
char int_p_sign_posn; /**< CHAR_MAX Value specifying the positioning of the positive_sign for a
non-negative international monetary quantity. */
char int_n_sign_posn; /**< CHAR_MAX Value specifying the positioning of the negative_sign for a
negative international monetary quantity. */
};
/** These macros expand to integer expressions suitable for use as the first
argument to the setlocale() function.
/** @{
These macros expand to integer expressions suitable for use as the first
argument (category) to the setlocale() function.
Only the first six macros are required by the C language specification.
Implementations are free to extend this list, as has been done with LC_MESSAGES,
with additional macro definitions, beginning with the characters LC_ and
an uppercase letter.
@{
**/
#define LC_ALL 0 ///< The application's entire locale.
#define LC_COLLATE 1 ///< Affects the behavior of the strcoll and strxfrm functions.
@ -91,25 +144,51 @@ struct lconv {
#define LC_TIME 5 ///< Affects the behavior of the strftime and wcsftime functions.
#define LC_MESSAGES 6
#define _LC_LAST 7 ///< Number of defined macros. Marks end.
/// @}
/*@}*/
#include <sys/EfiCdefs.h>
/** @fn char *setlocale(int, const char *)
/** @fn char *setlocale(int category, const char *locale)
@brief The setlocale function is used to retrieve or change parts or all of the current locale.
@details If locale is NULL, or the same as the current locale, this function just retrieves the
values for the specified category in the current locale. Otherwise, the specified category
in the current locale is set to the corresponding values from the specified locale and a pointer
to the new values is returned.
@param[in] category The portion of the current locale to be affected by this call.
The LC_ macros list the supported categories and the meaning of each.
@param[in] locale A value of "C" for locale specifies the minimal environment for C translation;
A value of "" specifies the native environment, which is "C" for this
implementation. If locale is NULL, the current locale is specified.
@return A pointer to the string associated with the specified category for the new locale,
a pointer to the string associated with the category for the current locale,
or NULL if category or locale can not be honored. The return value should not be
modified by the program, but may be overwritten by subsequent calls to either
setlocale or localeconv.
**/
/** @fn struct lconv *localeconv(void)
@brief The localeconv function returns a pointer to a lconv structure containing the appropriate
values for the current locale.
@return A pointer to a filled-in lconv structure. The returned structure should not be
modified by the program, but may be overwritten by subsequent calls to either
setlocale or localeconv.
**/
__BEGIN_DECLS
#ifdef __SETLOCALE_SOURCE__
char *setlocale(int, const char *);
char *__setlocale(int, const char *);
char *setlocale(int category, const char *locale);
char *__setlocale(int category, const char *locale);
#else /* !__SETLOCALE_SOURCE__ */
char *setlocale(int, const char *) __RENAME(__setlocale_mb_len_max_32);
char *setlocale(int category, const char *locale) __RENAME(__setlocale_mb_len_max_32);
#endif /* !__SETLOCALE_SOURCE__ */
struct lconv *localeconv(void);
char *__setlocale_mb_len_max_32(int, const char *);
char *__setlocale_mb_len_max_32(int category, const char *locale);
__END_DECLS
#endif /* _LOCALE_H_ */

View File

@ -1,6 +1,15 @@
/* $NetBSD: math.h,v 1.44 2006/03/25 16:41:11 xtraeme Exp $ */
/** @file
Floating-point Math functions and macros.
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) 1993 by Sun Microsystems, Inc. All rights reserved.
*
@ -9,18 +18,20 @@
* software is freely granted, provided that this notice
* is preserved.
* ====================================================
*/
/*
* @(#)fdlibm.h 5.1 93/09/24
*/
NetBSD: math.h,v 1.44 2006/03/25 16:41:11 xtraeme Exp
dlibm.h 5.1 93/09/24
**/
#ifndef _MATH_H_
#define _MATH_H_
#include <sys/EfiCdefs.h>
#include <sys/featuretest.h>
#include <sys/featuretest.h>
/** @{
@brief These are forward references to unions and macros used internaly
by the implementation of the math functions and macros.
**/
union __float_u {
unsigned char __dummy[sizeof(float)];
float __val;
@ -36,8 +47,7 @@ union __long_double_u {
long double __val;
};
#include <machine/math.h> /* may use __float_u, __double_u,
or __long_double_u */
#include <machine/math.h> /* may use __float_u, __double_u, or __long_double_u */
#ifdef __HAVE_LONG_DOUBLE
#define __fpmacro_unary_floating(__name, __arg0) \
@ -55,64 +65,290 @@ union __long_double_u {
: __ ## __name ## d (__arg0))
#endif /* __HAVE_LONG_DOUBLE */
extern const union __double_u __infinity;
extern const union __float_u __infinityf;
extern const union __long_double_u __infinityl;
/* C99 7.12.3.1 int fpclassify(real-floating x) */
#define fpclassify(__x) __fpmacro_unary_floating(fpclassify, __x)
/* C99 7.12.3.3 int isinf(real-floating x) */
#ifdef __isinf
#define isinf(__x) __isinf(__x)
#else
#define isinf(__x) __fpmacro_unary_floating(isinf, __x)
#endif
/* C99 7.12.3.4 int isnan(real-floating x) */
#ifdef __isnan
#define isnan(__x) __isnan(__x)
#else
#define isnan(__x) __fpmacro_unary_floating(isnan, __x)
#endif
/*@)*/
/*#############################################################
* ISO C95
*/
/**@{
Double, float, and long double versions, respectively, of HUGE_VAL.
*/
#define HUGE_VAL __infinity.__val
#define HUGE_VALF __infinityf.__val
#define HUGE_VALL __infinityl.__val
/*@)*/
__BEGIN_DECLS
/*
* ANSI/POSIX
*/
/* 7.12#3 HUGE_VAL, HUGELF, HUGE_VALL */
extern const union __double_u __infinity;
#define HUGE_VAL __infinity.__val
/** Compute the principal value of the arc cosine of Arg.
@param[in] Arg The value to compute the arc cosine of.
@return The computed value of the arc cosine of Arg in the interval [0,pi] radians.
If Arg is not in the interval [-1,+1], errno is set to EDOM.
**/
double acos(double Arg);
/** Compute the principal value of the arc sine of Arg.
@param[in] Arg The value to compute the arc sine of.
@return The computed value of the arc sine of Arg in the interval [-pi/2,+pi/2] radians.
If Arg is not in the interval [-1,+1], errno is set to EDOM.
**/
double asin(double Arg);
/** Compute the principal value of the arc tangent of Arg.
@param[in] Arg The value to compute the arc tangent of.
@return The computed value of the arc tangent of Arg in the interval [-pi/2,+pi/2] radians.
**/
double atan(double Arg);
/** Compute the value of the arc tangent of (Num / Denom).
The sign of both arguments is used to determine the quadrant of the return value.
@param[in] Num The numerator of the value to compute the arc tangent of.
@param[in] Denom The denominator of the value to compute the arc tangent of.
@return The computed value of the arc tangent of (Num / Denom) in the interval [-pi,+pi] radians.
**/
double atan2(double Num, double Denom);
/** Compute the value of the cosine of Arg, measured in radians.
@param[in] Arg The value to compute the cosine of.
@return The computed value of the cosine of Arg.
**/
double cos(double Arg);
/** Compute the value of the sine of Arg.
@param[in] Arg The value to compute the sine of.
@return The computed value of the sine of Arg.
**/
double sin(double Arg);
/** Compute the value of the tangent of Arg.
@param[in] Arg The value to compute the tangent of.
@return The computed value of the tangent of Arg.
**/
double tan(double Arg);
/** Compute the value of the hyperbolic cosine of Arg.
@param[in] Arg The value to compute the hyperbolic cosine of.
@return The computed value of the hyperbolic cosine of Arg.
If the magnitude of Arg is too large, errno is set to ERANGE.
**/
double cosh(double Arg);
/** Compute the value of the hyperbolic sine of Arg.
@param[in] Arg The value to compute the hyperbolic sine of.
@return The computed value of the hyperbolic sine of Arg.
If the magnitude of Arg is too large, errno is set to ERANGE.
**/
double sinh(double Arg);
/** Compute the value of the hyperbolic tangent of Arg.
@param[in] Arg The value to compute the hyperbolic tangent of.
@return The computed value of the hyperbolic tangent of Arg.
**/
double tanh(double Arg);
/** Compute the base-e exponential of Arg.
@param[in] Arg The value to compute the base-e exponential of.
@return The computed value of e**Arg.
If the magnitude of Arg is too large, errno is set to ERANGE.
**/
double exp(double Arg);
/** Break a floating-point number into a normalized fraction and an integral power of 2.
@param[in] Value The floating-point value to be broken down.
@param[out] Exp A pointer to an integer object to receive the integral power of 2 exponent.
@return The frexp function returns a value R, such that Value == R**Exp.
If Value is zero, both parts of the result are zero.
**/
double frexp(double Value, int *Exp);
/** Multiply a floating-point number, Value, by an integral power of 2, Exp.
@param[in] Value The floating-point value to be multiplied.
@param[out] Exp The integral power of 2 to multiply Value by.
@return The ldexp function returns a value R, such that R = Value x 2**Exp.
If a range error occurs, errno will be set to ERANGE.
**/
double ldexp(double Value, int Exp);
/** Compute the natural logarithm of Arg.
@param[in] Arg The value to compute the natural logarithm of.
@return The log function returns log base-e of Arg. If Arg is negative, errno is set to EDOM.
Otherwise, errno will be set to ERANGE if a range error occurs.
**/
double log(double Arg);
/** Compute the common (base-10) logarithm of Arg.
@param[in] Arg The value to compute the common logarithm of.
@return The log10 function returns log base-10 of Arg. If Arg is negative, errno is set to EDOM.
Otherwise, errno will be set to ERANGE if Arg is 0.
**/
double log10(double Arg);
/** Compute the base-2 logarithm of Arg.
@param[in] Arg The value to compute the base-2 logarithm of.
@return The log function returns log base-2 of Arg. If Arg is negative, errno is set to EDOM.
Otherwise, errno will be set to ERANGE if Arg is 0.
**/
double log2(double Arg);
/** Break Value into integral and fractional parts, each of which has the same type and sign
as Value. Store the integral part in the object pointed to by Integ and return the
fractional part.
@param[in] Value The value to compute the arc cosine of.
@param[out] Integ Pointer to where the integral component is to be stored.
@return The fractional part of Value is returned directly while the integral part is
returned in the location pointed to by Integ.
**/
double modf(double Value, double *Integ);
/** Compute Value raised to the power Exp.
@param[in] Value The value to be raised.
@param[in] Exp The power Value is to be raised to.
@return The pow function returns Value**Exp. If an error occurs, errno will be set as follows:
- EDOM: Value is finite and negative and Exp is finite and not an integer.
- EDOM: Both Value and Exp are zero.
- EDOM: Value is zero and Exp is less than zero.
**/
double pow(double Value, double Exp);
/** Compute the non-negative square root of Arg.
@param[in] Arg The value to compute the square root of.
@return The square root of Arg. If Arg is less than zero, errno is set to EDOM.
**/
double sqrt(double Arg);
/** Compute the smallest integer value not less than Arg.
@param[in] Arg The value to compute the ceiling of.
@return The ceiling of Arg expressed as a floating-point number.
**/
double ceil(double Arg);
/** Compute the absolute value of Arg.
@param[in] Arg The value to compute the absolute value of.
@return The absolute value of Arg.
**/
double fabs(double Arg);
/** Compute the largest integer value not greater than Arg.
@param[in] Arg The value to compute the floor of.
@return The largest integer value not greater than Arg, expressed as a floating-point number.
**/
double floor(double);
/** Compute the floating-point remainder of A1 / A2.
@param[in] A1 The dividend.
@param[in] A2 The divisor.
@return The remainder of A1 / A2 with the same sign as A1. If A2 is zero, the fmod function
returns 0.
**/
double fmod(double A1, double A2);
int finite(double);
double expm1(double);
/**@{
C99, Posix, or NetBSD functions that are not part of the C95 specification.
**/
/*
* Functions callable from C, intended to support IEEE arithmetic.
*/
double copysign(double, double);
double scalbn(double, int);
/*
* ISO C99
* Library implementation
*/
/* 7.12#3 HUGE_VAL, HUGELF, HUGE_VALL */
extern const union __float_u __infinityf;
#define HUGE_VALF __infinityf.__val
int __fpclassifyf(float);
int __fpclassifyd(double);
int __isinff(float);
int __isinfd(double);
int __isnanf(float);
int __isnand(double);
extern const union __long_double_u __infinityl;
#define HUGE_VALL __infinityl.__val
#ifdef __HAVE_LONG_DOUBLE
int __fpclassifyl(long double);
int __isinfl(long double);
int __isnanl(long double);
#endif /* __HAVE_LONG_DOUBLE */
/*@}*/
/* 7.12#4 INFINITY */
#ifdef __INFINITY
#define INFINITY __INFINITY /* float constant which overflows */
#else
#define INFINITY HUGE_VALF /* positive infinity */
#endif /* __INFINITY */
__END_DECLS
/* 7.12#5 NAN: a quiet NaN, if supported */
#ifdef __HAVE_NANF
extern const union __float_u __nanf;
#define NAN __nanf.__val
#endif /* __HAVE_NANF */
/* 7.12#6 number classification macros */
#define FP_INFINITE 0x00
#define FP_NAN 0x01
#define FP_NORMAL 0x02
#define FP_SUBNORMAL 0x03
#define FP_ZERO 0x04
/* NetBSD extensions */
#define _FP_LOMD 0x80 /* range for machine-specific classes */
#define _FP_HIMD 0xff
/*
* XOPEN/SVID
*/
#define M_E 2.7182818284590452354 /* e */
#define M_LOG2E 1.4426950408889634074 /* log 2e */
#define M_LOG10E 0.43429448190325182765 /* log 10e */
#define M_LN2 0.69314718055994530942 /* log e2 */
#define M_LN10 2.30258509299404568402 /* log e10 */
#define M_PI 3.14159265358979323846 /* pi */
#define M_PI_2 1.57079632679489661923 /* pi/2 */
#define M_PI_4 0.78539816339744830962 /* pi/4 */
#define M_1_PI 0.31830988618379067154 /* 1/pi */
#define M_2_PI 0.63661977236758134308 /* 2/pi */
#define M_2_SQRTPI 1.12837916709551257390 /* 2/sqrt(pi) */
#define M_SQRT2 1.41421356237309504880 /* sqrt(2) */
#define M_SQRT1_2 0.70710678118654752440 /* 1/sqrt(2) */
#define MAXFLOAT ((float)3.40282346638528860e+38)
/**@{
Extensions provided by NetBSD but not required by the C95 standard.
**/
extern int signgam;
enum fdversion {fdlibm_ieee = -1, fdlibm_svid, fdlibm_xopen, fdlibm_posix};
@ -120,7 +356,7 @@ enum fdversion {fdlibm_ieee = -1, fdlibm_svid, fdlibm_xopen, fdlibm_posix};
#define _LIB_VERSION_TYPE enum fdversion
#define _LIB_VERSION _fdlib_version
/* if global variable _LIB_VERSION is not desirable, one may
/** If global variable _LIB_VERSION is not desirable, one may
* change the following to be a constant by:
* #define _LIB_VERSION_TYPE const enum version
* In that case, after one initializes the value _LIB_VERSION (see
@ -146,11 +382,7 @@ struct exception {
#define HUGE MAXFLOAT
/*
* set X_TLOSS = pi*2**52, which is possibly defined in <values.h>
* (one may replace the following line by "#include <values.h>")
*/
/** set X_TLOSS = pi*2**52 **/
#define X_TLOSS 1.41484755040568800000e+16
#define DOMAIN 1
@ -159,295 +391,52 @@ struct exception {
#define UNDERFLOW 4
#define TLOSS 5
#define PLOSS 6
/*@}*/
__BEGIN_DECLS
/*
* ANSI/POSIX
*/
double acos(double);
double asin(double);
double atan(double);
double atan2(double, double);
double cos(double);
double sin(double);
double tan(double);
double cosh(double);
double sinh(double);
double tanh(double);
double exp(double);
double frexp(double, int *);
double ldexp(double, int);
double log(double);
double log2(double);
double log10(double);
double modf(double, double *);
double pow(double, double);
double sqrt(double);
double ceil(double);
double fabs(double);
double floor(double);
double fmod(double, double);
//#if defined(_XOPEN_SOURCE) || defined(_NETBSD_SOURCE)
//double erf(double);
//double erfc(double);
//double gamma(double);
//double hypot(double, double);
int finite(double);
//double j0(double);
//double j1(double);
//double jn(int, double);
//double lgamma(double);
//double y0(double);
//double y1(double);
//double yn(int, double);
//#if (_XOPEN_SOURCE - 0) >= 500 || defined(_NETBSD_SOURCE)
//double acosh(double);
//double asinh(double);
//double atanh(double);
//double cbrt(double);
double expm1(double);
//int ilogb(double);
//double log1p(double);
//double logb(double);
//double nextafter(double, double);
//double remainder(double, double);
//double rint(double);
//double scalb(double, double);
//#endif /* (_XOPEN_SOURCE - 0) >= 500 || defined(_NETBSD_SOURCE)*/
//#endif /* _XOPEN_SOURCE || _NETBSD_SOURCE */
/* 7.12.3.1 int fpclassify(real-floating x) */
#define fpclassify(__x) __fpmacro_unary_floating(fpclassify, __x)
#if 0
/*
* ISO C99
*/
#if !defined(_ANSI_SOURCE) && !defined(_POSIX_C_SOURCE) && \
!defined(_XOPEN_SOURCE) || \
((__STDC_VERSION__ - 0) >= 199901L) || \
((_POSIX_C_SOURCE - 0) >= 200112L) || \
((_XOPEN_SOURCE - 0) >= 600) || \
defined(_ISOC99_SOURCE) || defined(_NETBSD_SOURCE)
/* 7.12.3.2 int isfinite(real-floating x) */
#define isfinite(__x) __fpmacro_unary_floating(isfinite, __x)
/* 7.12.3.5 int isnormal(real-floating x) */
#define isnormal(__x) (fpclassify(__x) == FP_NORMAL)
/* 7.12.3.6 int signbit(real-floating x) */
#define signbit(__x) __fpmacro_unary_floating(signbit, __x)
/* 7.12.4 trigonometric */
float acosf(float);
float asinf(float);
float atanf(float);
float atan2f(float, float);
float cosf(float);
float sinf(float);
float tanf(float);
/* 7.12.5 hyperbolic */
float acoshf(float);
float asinhf(float);
float atanhf(float);
float coshf(float);
float sinhf(float);
float tanhf(float);
/* 7.12.6 exp / log */
float expf(float);
float expm1f(float);
float frexpf(float, int *);
int ilogbf(float);
float ldexpf(float, int);
float logf(float);
float log2f(float);
float log10f(float);
float log1pf(float);
float logbf(float);
float modff(float, float *);
float scalbnf(float, int);
/* 7.12.7 power / absolute */
float cbrtf(float);
float fabsf(float);
float hypotf(float, float);
float powf(float, float);
float sqrtf(float);
/* 7.12.8 error / gamma */
float erff(float);
float erfcf(float);
float lgammaf(float);
/* 7.12.9 nearest integer */
float ceilf(float);
float floorf(float);
float rintf(float);
double round(double);
float roundf(float);
double trunc(double);
float truncf(float);
long int lrint(double);
long int lrintf(float);
/* LONGLONG */
long long int llrint(double);
/* LONGLONG */
long long int llrintf(float);
long int lround(double);
long int lroundf(float);
/* LONGLONG */
long long int llround(double);
/* LONGLONG */
long long int llroundf(float);
/* 7.12.10 remainder */
float fmodf(float, float);
float remainderf(float, float);
/* 7.2.11 manipulation */
float copysignf(float, float);
double nan(const char *);
float nanf(const char *);
long double nanl(const char *);
float nextafterf(float, float);
#endif /* !_ANSI_SOURCE && ... */
#if defined(_NETBSD_SOURCE)
#ifndef __cplusplus
int matherr(struct exception *);
#endif
#endif /* _NETBSD_SOURCE */
/*
* IEEE Test Vector
*/
double significand(double);
#endif /* if 0 */
/* 7.12.3.3 int isinf(real-floating x) */
#ifdef __isinf
#define isinf(__x) __isinf(__x)
/* 7.12#4 INFINITY */
#ifdef __INFINITY
#define INFINITY __INFINITY /**< float constant which overflows */
#else
#define isinf(__x) __fpmacro_unary_floating(isinf, __x)
#endif
#define INFINITY HUGE_VALF /**< positive infinity */
#endif /* __INFINITY */
/* 7.12.3.4 int isnan(real-floating x) */
#ifdef __isnan
#define isnan(__x) __isnan(__x)
#else
#define isnan(__x) __fpmacro_unary_floating(isnan, __x)
#endif
/* 7.12#5 NAN: a quiet NaN, if supported */
#ifdef __HAVE_NANF
extern const union __float_u __nanf;
#define NAN __nanf.__val
#endif /* __HAVE_NANF */
/*
* Functions callable from C, intended to support IEEE arithmetic.
/**@{
C99 7.12#6 Number classification macros represent mutually exclusive kinds of floating-point
values.
**/
#define FP_INFINITE 0x00
#define FP_NAN 0x01
#define FP_NORMAL 0x02
#define FP_SUBNORMAL 0x03
#define FP_ZERO 0x04
/* NetBSD extensions */
#define _FP_LOMD 0x80 /**< range for machine-specific classes */
#define _FP_HIMD 0xff
/*@)*/
/**@{
* Constants ala XOPEN/SVID.
*/
double copysign(double, double);
double scalbn(double, int);
#if 0
/*
* BSD math library entry points
*/
#ifndef __MATH_PRIVATE__
double cabs(/* struct complex { double r; double i; } */);
#endif
double drem(double, double);
#if defined(_NETBSD_SOURCE) || defined(_REENTRANT)
/*
* Reentrant version of gamma & lgamma; passes signgam back by reference
* as the second argument; user must allocate space for signgam.
*/
double gamma_r(double, int *);
double lgamma_r(double, int *);
#endif /* _NETBSD_SOURCE || _REENTRANT */
#if defined(_NETBSD_SOURCE)
/* float versions of ANSI/POSIX functions */
float gammaf(float);
int isinff(float);
int isnanf(float);
int finitef(float);
float j0f(float);
float j1f(float);
float jnf(int, float);
float y0f(float);
float y1f(float);
float ynf(int, float);
float scalbf(float, float);
/*
* float version of IEEE Test Vector
*/
float significandf(float);
/*
* float versions of BSD math library entry points
*/
#ifndef __MATH_PRIVATE__
float cabsf(/* struct complex { float r; float i; } */);
#endif
float dremf(float, float);
#endif /* _NETBSD_SOURCE */
#if defined(_NETBSD_SOURCE) || defined(_REENTRANT)
/*
* Float versions of reentrant version of gamma & lgamma; passes
* signgam back by reference as the second argument; user must
* allocate space for signgam.
*/
float gammaf_r(float, int *);
float lgammaf_r(float, int *);
#endif /* !... || _REENTRANT */
#endif /* if 0 */
///*
// * Library implementation
// */
int __fpclassifyf(float);
int __fpclassifyd(double);
//int __isfinitef(float);
//int __isfinited(double);
int __isinff(float);
int __isinfd(double);
int __isnanf(float);
int __isnand(double);
//int __signbitf(float);
//int __signbitd(double);
//#ifdef __HAVE_LONG_DOUBLE
int __fpclassifyl(long double);
//int __isfinitel(long double);
int __isinfl(long double);
int __isnanl(long double);
//int __signbitl(long double);
//#endif
__END_DECLS
#define M_E 2.7182818284590452354 /**< e */
#define M_LOG2E 1.4426950408889634074 /**< log 2e */
#define M_LOG10E 0.43429448190325182765 /**< log 10e */
#define M_LN2 0.69314718055994530942 /**< log e2 */
#define M_LN10 2.30258509299404568402 /**< log e10 */
#define M_PI 3.14159265358979323846 /**< pi */
#define M_PI_2 1.57079632679489661923 /**< pi/2 */
#define M_PI_4 0.78539816339744830962 /**< pi/4 */
#define M_1_PI 0.31830988618379067154 /**< 1/pi */
#define M_2_PI 0.63661977236758134308 /**< 2/pi */
#define M_2_SQRTPI 1.12837916709551257390 /**< 2/sqrt(pi) */
#define M_SQRT2 1.41421356237309504880 /**< sqrt(2) */
#define M_SQRT1_2 0.70710678118654752440 /**< 1/sqrt(2) */
#define MAXFLOAT ((float)3.40282346638528860e+38)
/*@}*/
#endif /* _MATH_H_ */

View File

@ -1,16 +1,15 @@
/** @file
The header <setjmp.h> defines the macro setjmp, and declares one function
and one type, for bypassing the normal function call and return discipline.
This file defines the macro setjmp, and declares the function longjmp
and the type jmp_buf, for bypassing the normal function call and return discipline.
Copyright (c) 2010, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials are licensed and made available under
the terms and conditions of the BSD License that accompanies this distribution.
The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php.
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Copyright (c) 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 _SETJMP_H
#define _SETJMP_H
@ -40,7 +39,8 @@ typedef BASE_LIBRARY_JUMP_BUFFER jmp_buf[1];
@return If the return is from a direct invocation, the setjmp macro
returns the value zero. If the return is from a call to the longjmp
function, the setjmp macro returns a nonzero value.
function, the setjmp macro returns a nonzero value based upon the value
of the second argument to the longjmp function.
**/
#define setjmp(env) (INTN)SetJump((env))
@ -52,7 +52,10 @@ typedef BASE_LIBRARY_JUMP_BUFFER jmp_buf[1];
macro was within the scope of an identifier with variably modified type and
execution has left that scope in the interim, the behavior is undefined.
After longjmp is completed, program execution continues as if the
@param[in] env The jump buffer containing the environment to be returned to.
@param[in] val A non-zero value to be returned from setjmp.
@return After longjmp is completed, program execution continues as if the
corresponding invocation of the setjmp macro had just returned the value
specified by val. The longjmp function cannot cause the setjmp macro to
return the value 0; if val is 0, the setjmp macro returns the value 1.

View File

@ -1,28 +1,25 @@
/** @file
The header <signal.h> declares a type and two functions and defines several
This file declares a type and two functions and defines several
macros, for handling various signals (conditions that may be reported during
program execution).
The UEFI implementation of <signal.h> maps signals onto the UEFI
event mechanism.
For historical reasons; programs expect signal to be declared
in <sys/signal.h>. The signal function is documented in <sys/signal.h>.
An implementation need not generate any of these signals, except as a result
of explicit calls to the raise function. Additional signals and pointers to
undeclarable functions, with macro definitions beginning, respectively, with
the letters SIG and an uppercase letter or with SIG_ and an uppercase letter
may also be specified by the implementation. The complete set of signals,
their semantics, and their default handling is implementation-defined; all
signal numbers shall be positive.
The signal function is declared in the C Standard as:<BR>
void (*signal(int sig, void (*func)(int)))(int);
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.
The EDK II implementation of the library or base firmware does not generate
any of these signals, except as a result of explicit calls to the raise function.
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) 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 _SIGNAL_H
#define _SIGNAL_H
@ -36,7 +33,8 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
This, possibly machine specific, type is defined in <machine/signal.h>.
*/
/** The following three macros expand to constant expressions with distinct
/** @{
The following three macros expand to constant expressions with distinct
values that have type compatible with the second argument to, and the
return value of, the signal function, and whose values compare unequal to
the address of any declarable function.
@ -44,11 +42,13 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#define SIG_IGN ((__sighandler_t *) 0)
#define SIG_DFL ((__sighandler_t *) 1)
#define SIG_ERR ((__sighandler_t *) 3)
/*@}*/
/** The following members expand to positive integer constant expressions with
/** @{
The following macros expand to positive integer constant expressions with
type int and distinct values that are the signal numbers, each
corresponding to the specified condition.
Many existing programs expect these to be macros.
The C95 specification requires these to be macros.
**/
#define SIGINT __SigInt ///< receipt of an interactive attention signal
#define SIGILL __SigIll ///< detection of an invalid function image, such as an invalid instruction
@ -66,24 +66,18 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#define SIGPIPE __SigPipe ///< Added for Posix timer functions
#define SIGQUIT __SigQuit ///< Added for Posix timer functions
#define SIG_LAST __Sig_Last ///< One more than the largest signal number
/*@}*/
__BEGIN_DECLS
/* For historical reasons; programs expect signal to be declared
in <sys/signal.h>. The function is documented in <sys/signal.h>.
The function is declared in the C Standard as:<BR>
void (*signal(int sig, void (*func)(int)))(int);
*/
/** Send a signal.
The raise function carries out the actions described for signal,
in <sys/signal.h>, for the signal sig. If a signal handler is called, the
raise function shall not return until after the signal handler does.
raise function does not return until after the signal handler does.
@return The raise function returns zero if successful,
nonzero if unsuccessful.
or nonzero if unsuccessful.
**/
int raise(int sig);

View File

@ -1,54 +1,53 @@
/** @file
The header <stdarg.h> declares a type and defines three macros, for advancing
through a list of arguments whose number and types are not known to the
called function when it is translated.
This header, <stdarg.h>, declares type va_list and defines macros: va_start, va_arg, va_end;
for advancing through a list of arguments whose number and types are not known to the
called function when it is translated.
A function may be called with a variable number of arguments of varying types.
Its parameter list contains one or more parameters. The rightmost parameter
plays a special role in the access mechanism, and will be designated paramN
in this description.
A function may be called with a variable number of arguments of varying types.
The rightmost argument plays a special role in the access mechanism, and will
be designated paramN in this and subsequent descriptions.
The type va_list is a type suitable for holding information needed by the
macros va_start, va_arg, and va_end. If access to the varying arguments
is desired, the called function shall declare an object (referred to as ap
in these descriptions) having type va_list. The object ap may be passed as
an argument to another function; if that function invokes the va_arg macro
with parameter ap, the value of ap in the calling function is indeterminate
and shall be passed to the va_end macro prior to any further reference to ap.
The type va_list is a type suitable for holding information needed by the
macros va_start, va_arg, and va_end. If access to the varying arguments
is desired, the called function shall declare an object (referred to as ap
in these descriptions) having type va_list. The object ap may be passed as
an argument to another function; if the receiving function invokes the va_arg macro
with parameter ap, the value of ap in the calling function becomes indeterminate
and must be passed to the va_end macro prior to any further reference to ap.
The va_start and va_arg macros shall be implemented as macros, not as actual
functions. It is unspecified, by the C library standards, whether va_end
is a macro or an identifier declared with external linkage. If a macro
definition is suppressed in order to access an actual function, or a
program defines an external identifier with the name va_end, the behavior
is undefined. The va_start and va_end macros shall be invoked in the
function accepting a varying number of arguments, if access to the varying
arguments is desired.
The va_start and va_arg macros must be implemented as macros, not as actual
functions. The va_start and va_end macros must be invoked in the
function accepting a varying number of arguments, if access to the varying
arguments is desired.
Copyright (c) 2010, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials are licensed and made available under
the terms and conditions of the BSD License that accompanies this distribution.
The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php.
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Copyright (c) 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 _STDARG_H
#define _STDARG_H
#include <sys/EfiCdefs.h>
/** The type va_list is a type suitable for holding information needed by the
/** @{
The type va_list is a type suitable for holding information needed by the
macros va_start, va_arg, and va_end.
Depending upon compiler or CPU architecture, different definitions are required.
**/
#if defined(__GNUC__)
typedef __builtin_va_list va_list;
#else
#define va_list VA_LIST
#endif
/*@}*/
/** The va_start macro shall be invoked before any access to the unnamed arguments.
/** @{
The va_start macro must be invoked before any access to the unnamed arguments.
The va_start macro initializes ap for subsequent use by va_arg and va_end.
Synopsys: void va_start(va_list ap, paramN);
@ -71,8 +70,10 @@ typedef __builtin_va_list va_list;
#else
#define va_start VA_START
#endif
/*@}*/
/** The va_arg macro expands to an expression that has the type and value of
/** @{
The va_arg macro expands to an expression that has the type and value of
the next argument in the call. The parameter ap shall be the same as the
va_list ap initialized by va_start. Each invocation of va_arg modifies ap
so that the values of successive arguments are returned in turn. The
@ -99,8 +100,10 @@ typedef __builtin_va_list va_list;
#else
#define va_arg VA_ARG
#endif
/*@}*/
/** The va_end macro facillitates a normal return from the function whose
/** @{
The va_end macro facillitates a normal return from the function whose
variable argument list was referred to by the expansion of va_start that
initialized the va_list ap.
@ -119,12 +122,16 @@ typedef __builtin_va_list va_list;
#else
#define va_end VA_END
#endif
/*@}*/
/** For BSD compatibility. **/
/** @{
For BSD compatibility.
**/
#if defined(__GNUC__)
#define va_copy __builtin_va_copy
#else
#define va_copy(s,d) (s) = (d)
#endif
/*@}*/
#endif /* _STDARG_H */

View File

@ -1,8 +1,12 @@
/** @file
The header <stdbool.h> defines four macros: bool, true, false,
and __bool_true_false_are_defined.
Macros to simplify boolean expressions and operations.
The macro bool expands to _Bool.
This header is not specified by the C95 standard but is included here for
operational convenience.
The macro bool expands to _Bool, as required by the C99 specification.
This subsequently expands to BOOLEAN, is a UEFI data type which is automatically
defined correctly for the target CPU architecture.
The remaining three macros are suitable for use in #if preprocessing
directives. They are true, which expands to the integer constant 1,
@ -12,23 +16,22 @@
A program may undefine and perhaps then redefine the
macros bool, true, and false.
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.
**/
#ifndef _STDBOOL_H
#define _STDBOOL_H
#include <sys/EfiCdefs.h>
#define bool _Bool
#define true 1
#define false 0
#define bool _Bool
#define true 1
#define false 0
#define __bool_true_false_are_defined 1
#endif /* _STDBOOL_H */

View File

@ -1,64 +1,68 @@
/** @file
Common Definitions.
Common "Standard" Definitions.
Copyright (c) 2010, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials are licensed and made available under
the terms and conditions of the BSD License that accompanies this distribution.
The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php.
The files stddef.h and stdlib.h are "catch all" headers for definitions and declarations
that don't fit well in the other headers. There are two separate header files because
the contents of <stddef.h> are valid in both freestanding and hosted environment, while the
header <stdlib.h> contains elements that are only valid in a hosted environment.
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
This means that the elements in this file may not impose dependencies on headers other than
<float.h>, <iso646.h>, <limits.h>, <stdarg.h>, <stdbool.h>, and (of course) <sys/EfiCdefs.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 _STDDEF_H
#define _STDDEF_H
#include <sys/EfiCdefs.h>
/** ptrdiff_t is the signed integer type of the result of subtracting two pointers.
**/
#ifdef _EFI_PTRDIFF_T_
/** ptrdiff_t is the signed integer type of the result of subtracting two pointers. **/
typedef _EFI_PTRDIFF_T_ ptrdiff_t;
#undef _EFI_PTRDIFF_T_
#endif
/** size_t is the unsigned integer type of the result of the sizeof operator.
**/
#ifdef _EFI_SIZE_T_
/** size_t is the unsigned integer type of the result of the sizeof operator. **/
typedef _EFI_SIZE_T_ size_t;
#undef _EFI_SIZE_T_
#undef _BSD_SIZE_T_
#endif
/** wchar_t is an integer type whose range of values can represent distinct
codes for all members of the largest extended character set specified among
the supported locales. The null character shall have the code value zero.
**/
#ifndef __cplusplus
#ifdef _EFI_WCHAR_T
/** wchar_t is an integer type whose range of values can represent distinct
codes for all members of the largest extended character set specified among
the supported locales. The null character shall have the code value zero.
**/
typedef _EFI_WCHAR_T wchar_t;
#undef _EFI_WCHAR_T
#undef _BSD_WCHAR_T_
#endif
#endif
/** NULL expands to an implementation-defined null pointer constant.
/** @def NULL
A macro that expands to a null pointer constant.<BR>
NULL is defined in MdePkg/Include/Base.h which is automatically included
by the EDK II build tools.
**/
/** offsetof(type, member-designator) expands to an integer constant expression
that has type size_t, the value of which is the offset in bytes, to the
structure member (designated by member-designator), from the beginning of
its structure (designated by type). The type and member designator shall be
such that given<BR>
static type t;<BR>
then the expression &(t.member-designator) evaluates to an address constant.
(If the specified member is a bit-field, the behavior is undefined.)
/** The offsetof macro determines the offset of the beginning of a structure
member from the beginning of the structure.
The macro expands to an integer constant expression that has type size_t,
the value of which is the offset in bytes, to the structure member (Member),
from the beginning of its structure (StrucName).
Alliased to OFFSET_OF which is defined in MdePkg/Include/Base.h which is
automatically included by the EDK II build tools.
**/
#define offsetof(type, member) OFFSET_OF(type, member)
#define offsetof(StrucName, Member) OFFSET_OF(StrucName, Member)
#endif /* _STDDEF_H */

File diff suppressed because it is too large Load Diff

View File

@ -1,19 +1,30 @@
/**
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.
/** @file
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
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,
@ -36,6 +47,7 @@ enum {
/** 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
@ -49,8 +61,8 @@ typedef void __sighandler_t(int);
the specified signal sig. Otherwise, a value of SIG_ERR is
returned and a positive value is stored in errno.
*/
__BEGIN_DECLS
__sighandler_t *signal(int sig, __sighandler_t *func);
__END_DECLS
#endif /* _SYS_SIGNAL_H */

View File

@ -56,7 +56,7 @@ fgetpos(FILE *fp, fpos_t *pos)
_DIAGASSERT(fp != NULL);
_DIAGASSERT(pos != NULL);
if(fp == NULL) {
if((fp == NULL) || (pos == NULL)) {
errno = EINVAL;
return (EOF);
}