mirror of https://github.com/ipxe/ipxe.git
[efi] Update to current EDK2 headers
Signed-off-by: Michael Brown <mcb30@ipxe.org>pull/55/head
parent
54dcfed375
commit
f796d5b6b6
|
@ -34,7 +34,7 @@ FILE_LICENCE ( BSD3 );
|
|||
|
||||
#if _MSC_EXTENSIONS
|
||||
//
|
||||
// use Microsoft* C complier dependent integer width types
|
||||
// use Microsoft* C compiler dependent integer width types
|
||||
//
|
||||
typedef unsigned __int64 UINT64;
|
||||
typedef __int64 INT64;
|
||||
|
|
|
@ -30,9 +30,16 @@ FILE_LICENCE ( BSD3 );
|
|||
#pragma pack()
|
||||
#endif
|
||||
|
||||
//
|
||||
// RVCT does not support the __builtin_unreachable() macro
|
||||
//
|
||||
#ifdef __ARMCC_VERSION
|
||||
#define UNREACHABLE()
|
||||
#endif
|
||||
|
||||
#if _MSC_EXTENSIONS
|
||||
//
|
||||
// use Microsoft* C complier dependent integer width types
|
||||
// use Microsoft* C compiler dependent integer width types
|
||||
//
|
||||
typedef unsigned __int64 UINT64;
|
||||
typedef __int64 INT64;
|
||||
|
|
|
@ -86,6 +86,117 @@ VERIFY_SIZE_OF (CHAR16, 2);
|
|||
#define GLOBAL_REMOVE_IF_UNREFERENCED
|
||||
#endif
|
||||
|
||||
//
|
||||
// Should be used in combination with NORETURN to avoid 'noreturn' returns
|
||||
// warnings.
|
||||
//
|
||||
#ifndef UNREACHABLE
|
||||
#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 4)
|
||||
///
|
||||
/// Signal compilers and analyzers that this call is not reachable. It is
|
||||
/// up to the compiler to remove any code past that point.
|
||||
/// Not implemented by GCC 4.4 or earlier.
|
||||
///
|
||||
#define UNREACHABLE() __builtin_unreachable ()
|
||||
#elif defined (__has_feature)
|
||||
#if __has_builtin (__builtin_unreachable)
|
||||
///
|
||||
/// Signal compilers and analyzers that this call is not reachable. It is
|
||||
/// up to the compiler to remove any code past that point.
|
||||
///
|
||||
#define UNREACHABLE() __builtin_unreachable ()
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef UNREACHABLE
|
||||
///
|
||||
/// Signal compilers and analyzers that this call is not reachable. It is
|
||||
/// up to the compiler to remove any code past that point.
|
||||
///
|
||||
#define UNREACHABLE()
|
||||
#endif
|
||||
#endif
|
||||
|
||||
//
|
||||
// Signaling compilers and analyzers that a certain function cannot return may
|
||||
// remove all following code and thus lead to better optimization and less
|
||||
// false positives.
|
||||
//
|
||||
#ifndef NORETURN
|
||||
#if defined (__GNUC__) || defined (__clang__)
|
||||
///
|
||||
/// Signal compilers and analyzers that the function cannot return.
|
||||
/// It is up to the compiler to remove any code past a call to functions
|
||||
/// flagged with this attribute.
|
||||
///
|
||||
#define NORETURN __attribute__((noreturn))
|
||||
#elif defined(_MSC_EXTENSIONS) && !defined(MDE_CPU_EBC)
|
||||
///
|
||||
/// Signal compilers and analyzers that the function cannot return.
|
||||
/// It is up to the compiler to remove any code past a call to functions
|
||||
/// flagged with this attribute.
|
||||
///
|
||||
#define NORETURN __declspec(noreturn)
|
||||
#else
|
||||
///
|
||||
/// Signal compilers and analyzers that the function cannot return.
|
||||
/// It is up to the compiler to remove any code past a call to functions
|
||||
/// flagged with this attribute.
|
||||
///
|
||||
#define NORETURN
|
||||
#endif
|
||||
#endif
|
||||
|
||||
//
|
||||
// Should be used in combination with ANALYZER_NORETURN to avoid 'noreturn'
|
||||
// returns warnings.
|
||||
//
|
||||
#ifndef ANALYZER_UNREACHABLE
|
||||
#ifdef __clang_analyzer__
|
||||
#if __has_builtin (__builtin_unreachable)
|
||||
///
|
||||
/// Signal the analyzer that this call is not reachable.
|
||||
/// This excludes compilers.
|
||||
///
|
||||
#define ANALYZER_UNREACHABLE() __builtin_unreachable ()
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef ANALYZER_UNREACHABLE
|
||||
///
|
||||
/// Signal the analyzer that this call is not reachable.
|
||||
/// This excludes compilers.
|
||||
///
|
||||
#define ANALYZER_UNREACHABLE()
|
||||
#endif
|
||||
#endif
|
||||
|
||||
//
|
||||
// Static Analyzers may issue errors about potential NULL-dereferences when
|
||||
// dereferencing a pointer, that has been checked before, outside of a
|
||||
// NULL-check. This may lead to false positives, such as when using ASSERT()
|
||||
// for verification.
|
||||
//
|
||||
#ifndef ANALYZER_NORETURN
|
||||
#ifdef __has_feature
|
||||
#if __has_feature (attribute_analyzer_noreturn)
|
||||
///
|
||||
/// Signal analyzers that the function cannot return.
|
||||
/// This excludes compilers.
|
||||
///
|
||||
#define ANALYZER_NORETURN __attribute__((analyzer_noreturn))
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef ANALYZER_NORETURN
|
||||
///
|
||||
/// Signal the analyzer that the function cannot return.
|
||||
/// This excludes compilers.
|
||||
///
|
||||
#define ANALYZER_NORETURN
|
||||
#endif
|
||||
#endif
|
||||
|
||||
//
|
||||
// For symbol name in assembly code, an extra "_" is sometimes necessary
|
||||
//
|
||||
|
@ -193,7 +304,7 @@ struct _LIST_ENTRY {
|
|||
|
||||
//
|
||||
// UEFI specification claims 1 and 0. We are concerned about the
|
||||
// complier portability so we did it this way.
|
||||
// compiler portability so we did it this way.
|
||||
//
|
||||
|
||||
///
|
||||
|
@ -480,7 +591,31 @@ struct _LIST_ENTRY {
|
|||
|
||||
#define VA_COPY(Dest, Start) __va_copy (Dest, Start)
|
||||
|
||||
#elif defined(__GNUC__) && !defined(NO_BUILTIN_VA_FUNCS)
|
||||
#elif defined(__GNUC__)
|
||||
|
||||
#if defined(MDE_CPU_X64) && !defined(NO_MSABI_VA_FUNCS)
|
||||
//
|
||||
// X64 only. Use MS ABI version of GCC built-in macros for variable argument lists.
|
||||
//
|
||||
///
|
||||
/// Both GCC and LLVM 3.8 for X64 support new variable argument intrinsics for Microsoft ABI
|
||||
///
|
||||
|
||||
///
|
||||
/// Variable used to traverse the list of arguments. This type can vary by
|
||||
/// implementation and could be an array or structure.
|
||||
///
|
||||
typedef __builtin_ms_va_list VA_LIST;
|
||||
|
||||
#define VA_START(Marker, Parameter) __builtin_ms_va_start (Marker, Parameter)
|
||||
|
||||
#define VA_ARG(Marker, TYPE) ((sizeof (TYPE) < sizeof (UINTN)) ? (TYPE)(__builtin_va_arg (Marker, UINTN)) : (TYPE)(__builtin_va_arg (Marker, TYPE)))
|
||||
|
||||
#define VA_END(Marker) __builtin_ms_va_end (Marker)
|
||||
|
||||
#define VA_COPY(Dest, Start) __builtin_ms_va_copy (Dest, Start)
|
||||
|
||||
#else
|
||||
//
|
||||
// Use GCC built-in macros for variable argument lists.
|
||||
//
|
||||
|
@ -499,6 +634,8 @@ typedef __builtin_va_list VA_LIST;
|
|||
|
||||
#define VA_COPY(Dest, Start) __builtin_va_copy (Dest, Start)
|
||||
|
||||
#endif
|
||||
|
||||
#else
|
||||
///
|
||||
/// Variable used to traverse the list of arguments. This type can vary by
|
||||
|
@ -1038,7 +1175,7 @@ typedef UINTN RETURN_STATUS;
|
|||
#if defined(_MSC_EXTENSIONS) && !defined (__INTEL_COMPILER) && !defined (MDE_CPU_EBC)
|
||||
#pragma intrinsic(_ReturnAddress)
|
||||
/**
|
||||
Get the return address of the calling funcation.
|
||||
Get the return address of the calling function.
|
||||
|
||||
Based on intrinsic function _ReturnAddress that provides the address of
|
||||
the instruction in the calling function that will be executed after
|
||||
|
@ -1046,27 +1183,27 @@ typedef UINTN RETURN_STATUS;
|
|||
|
||||
@param L Return Level.
|
||||
|
||||
@return The return address of the calling funcation or 0 if L != 0.
|
||||
@return The return address of the calling function or 0 if L != 0.
|
||||
|
||||
**/
|
||||
#define RETURN_ADDRESS(L) ((L == 0) ? _ReturnAddress() : (VOID *) 0)
|
||||
#elif defined(__GNUC__)
|
||||
void * __builtin_return_address (unsigned int level);
|
||||
/**
|
||||
Get the return address of the calling funcation.
|
||||
Get the return address of the calling function.
|
||||
|
||||
Based on built-in Function __builtin_return_address that returns
|
||||
the return address of the current function, or of one of its callers.
|
||||
|
||||
@param L Return Level.
|
||||
|
||||
@return The return address of the calling funcation.
|
||||
@return The return address of the calling function.
|
||||
|
||||
**/
|
||||
#define RETURN_ADDRESS(L) __builtin_return_address (L)
|
||||
#else
|
||||
/**
|
||||
Get the return address of the calling funcation.
|
||||
Get the return address of the calling function.
|
||||
|
||||
@param L Return Level.
|
||||
|
||||
|
|
|
@ -81,7 +81,7 @@ FILE_LICENCE ( BSD3 );
|
|||
#pragma warning ( disable : 4057 )
|
||||
|
||||
//
|
||||
// ASSERT(FALSE) or while (TRUE) are legal constructes so supress this warning
|
||||
// ASSERT(FALSE) or while (TRUE) are legal constructs so suppress this warning
|
||||
//
|
||||
#pragma warning ( disable : 4127 )
|
||||
|
||||
|
@ -121,7 +121,7 @@ FILE_LICENCE ( BSD3 );
|
|||
#if defined(_MSC_EXTENSIONS)
|
||||
|
||||
//
|
||||
// use Microsoft C complier dependent integer width types
|
||||
// use Microsoft C compiler dependent integer width types
|
||||
//
|
||||
|
||||
///
|
||||
|
|
|
@ -5,11 +5,10 @@
|
|||
PCI Local Bus Specification, 2.2
|
||||
PCI-to-PCI Bridge Architecture Specification, Revision 1.2
|
||||
PC Card Standard, 8.0
|
||||
PCI Power Management Interface Specifiction, Revision 1.2
|
||||
|
||||
|
||||
|
||||
Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) 2014 - 2105, Hewlett-Packard Development Company, L.P.<BR>
|
||||
Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) 2014 - 2015, Hewlett-Packard Development Company, L.P.<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
|
||||
|
@ -638,6 +637,7 @@ typedef union {
|
|||
#define EFI_PCI_CAPABILITY_ID_SLOTID 0x04
|
||||
#define EFI_PCI_CAPABILITY_ID_MSI 0x05
|
||||
#define EFI_PCI_CAPABILITY_ID_HOTPLUG 0x06
|
||||
#define EFI_PCI_CAPABILITY_ID_SHPC 0x0C
|
||||
|
||||
///
|
||||
/// Capabilities List Header
|
||||
|
@ -648,18 +648,6 @@ typedef struct {
|
|||
UINT8 NextItemPtr;
|
||||
} EFI_PCI_CAPABILITY_HDR;
|
||||
|
||||
///
|
||||
/// Power Management Register Block Definition
|
||||
/// Section 3.2, PCI Power Management Interface Specifiction, Revision 1.2
|
||||
///
|
||||
typedef struct {
|
||||
EFI_PCI_CAPABILITY_HDR Hdr;
|
||||
UINT16 PMC;
|
||||
UINT16 PMCSR;
|
||||
UINT8 BridgeExtention;
|
||||
UINT8 Data;
|
||||
} EFI_PCI_CAPABILITY_PMI;
|
||||
|
||||
///
|
||||
/// PMC - Power Management Capabilities
|
||||
/// Section 3.2.3, PCI Power Management Interface Specifiction, Revision 1.2
|
||||
|
@ -668,7 +656,7 @@ typedef union {
|
|||
struct {
|
||||
UINT16 Version : 3;
|
||||
UINT16 PmeClock : 1;
|
||||
UINT16 : 1;
|
||||
UINT16 Reserved : 1;
|
||||
UINT16 DeviceSpecificInitialization : 1;
|
||||
UINT16 AuxCurrent : 3;
|
||||
UINT16 D1Support : 1;
|
||||
|
@ -687,7 +675,9 @@ typedef union {
|
|||
typedef union {
|
||||
struct {
|
||||
UINT16 PowerState : 2;
|
||||
UINT16 : 6;
|
||||
UINT16 ReservedForPciExpress : 1;
|
||||
UINT16 NoSoftReset : 1;
|
||||
UINT16 Reserved : 4;
|
||||
UINT16 PmeEnable : 1;
|
||||
UINT16 DataSelect : 4;
|
||||
UINT16 DataScale : 2;
|
||||
|
@ -696,6 +686,36 @@ typedef union {
|
|||
UINT16 Data;
|
||||
} EFI_PCI_PMCSR;
|
||||
|
||||
#define PCI_POWER_STATE_D0 0
|
||||
#define PCI_POWER_STATE_D1 1
|
||||
#define PCI_POWER_STATE_D2 2
|
||||
#define PCI_POWER_STATE_D3_HOT 3
|
||||
|
||||
///
|
||||
/// PMCSR_BSE - PMCSR PCI-to-PCI Bridge Support Extensions
|
||||
/// Section 3.2.5, PCI Power Management Interface Specifiction, Revision 1.2
|
||||
///
|
||||
typedef union {
|
||||
struct {
|
||||
UINT8 Reserved : 6;
|
||||
UINT8 B2B3 : 1;
|
||||
UINT8 BusPowerClockControl : 1;
|
||||
} Bits;
|
||||
UINT8 Uint8;
|
||||
} EFI_PCI_PMCSR_BSE;
|
||||
|
||||
///
|
||||
/// Power Management Register Block Definition
|
||||
/// Section 3.2, PCI Power Management Interface Specifiction, Revision 1.2
|
||||
///
|
||||
typedef struct {
|
||||
EFI_PCI_CAPABILITY_HDR Hdr;
|
||||
EFI_PCI_PMC PMC;
|
||||
EFI_PCI_PMCSR PMCSR;
|
||||
EFI_PCI_PMCSR_BSE BridgeExtention;
|
||||
UINT8 Data;
|
||||
} EFI_PCI_CAPABILITY_PMI;
|
||||
|
||||
///
|
||||
/// A.G.P Capability
|
||||
/// Section 6.1.4, Accelerated Graphics Port Interface Specification, Revision 1.0
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
Provides string functions, linked list functions, math functions, synchronization
|
||||
functions, file path functions, and CPU architecture-specific functions.
|
||||
|
||||
Copyright (c) 2006 - 2015, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.<BR>
|
||||
Portions copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>
|
||||
This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions of the BSD License
|
||||
|
@ -189,6 +189,8 @@ typedef struct {
|
|||
/**
|
||||
Returns the length of a Null-terminated Unicode string.
|
||||
|
||||
This function is similar as strlen_s defined in C11.
|
||||
|
||||
If String is not aligned on a 16-bit boundary, then ASSERT().
|
||||
|
||||
@param String A pointer to a Null-terminated Unicode string.
|
||||
|
@ -211,10 +213,14 @@ StrnLenS (
|
|||
Copies the string pointed to by Source (including the terminating null char)
|
||||
to the array pointed to by Destination.
|
||||
|
||||
This function is similar as strcpy_s defined in C11.
|
||||
|
||||
If Destination is not aligned on a 16-bit boundary, then ASSERT().
|
||||
If Source is not aligned on a 16-bit boundary, then ASSERT().
|
||||
If an error would be returned, then the function will also ASSERT().
|
||||
|
||||
If an error is returned, then the Destination is unmodified.
|
||||
|
||||
@param Destination A pointer to a Null-terminated Unicode string.
|
||||
@param DestMax The maximum number of Destination Unicode
|
||||
char, including terminating null char.
|
||||
|
@ -243,10 +249,14 @@ StrCpyS (
|
|||
Source to the array pointed to by Destination. If no null char is copied from
|
||||
Source, then Destination[Length] is always set to null.
|
||||
|
||||
This function is similar as strncpy_s defined in C11.
|
||||
|
||||
If Length > 0 and Destination is not aligned on a 16-bit boundary, then ASSERT().
|
||||
If Length > 0 and Source is not aligned on a 16-bit boundary, then ASSERT().
|
||||
If an error would be returned, then the function will also ASSERT().
|
||||
|
||||
If an error is returned, then the Destination is unmodified.
|
||||
|
||||
@param Destination A pointer to a Null-terminated Unicode string.
|
||||
@param DestMax The maximum number of Destination Unicode
|
||||
char, including terminating null char.
|
||||
|
@ -277,10 +287,14 @@ StrnCpyS (
|
|||
Appends a copy of the string pointed to by Source (including the terminating
|
||||
null char) to the end of the string pointed to by Destination.
|
||||
|
||||
This function is similar as strcat_s defined in C11.
|
||||
|
||||
If Destination is not aligned on a 16-bit boundary, then ASSERT().
|
||||
If Source is not aligned on a 16-bit boundary, then ASSERT().
|
||||
If an error would be returned, then the function will also ASSERT().
|
||||
|
||||
If an error is returned, then the Destination is unmodified.
|
||||
|
||||
@param Destination A pointer to a Null-terminated Unicode string.
|
||||
@param DestMax The maximum number of Destination Unicode
|
||||
char, including terminating null char.
|
||||
|
@ -313,10 +327,14 @@ StrCatS (
|
|||
copied from Source, then Destination[StrLen(Destination) + Length] is always
|
||||
set to null.
|
||||
|
||||
This function is similar as strncat_s defined in C11.
|
||||
|
||||
If Destination is not aligned on a 16-bit boundary, then ASSERT().
|
||||
If Source is not aligned on a 16-bit boundary, then ASSERT().
|
||||
If an error would be returned, then the function will also ASSERT().
|
||||
|
||||
If an error is returned, then the Destination is unmodified.
|
||||
|
||||
@param Destination A pointer to a Null-terminated Unicode string.
|
||||
@param DestMax The maximum number of Destination Unicode
|
||||
char, including terminating null char.
|
||||
|
@ -348,6 +366,8 @@ StrnCatS (
|
|||
/**
|
||||
Returns the length of a Null-terminated Ascii string.
|
||||
|
||||
This function is similar as strlen_s defined in C11.
|
||||
|
||||
@param String A pointer to a Null-terminated Ascii string.
|
||||
@param MaxSize The maximum number of Destination Ascii
|
||||
char, including terminating null char.
|
||||
|
@ -368,8 +388,12 @@ AsciiStrnLenS (
|
|||
Copies the string pointed to by Source (including the terminating null char)
|
||||
to the array pointed to by Destination.
|
||||
|
||||
This function is similar as strcpy_s defined in C11.
|
||||
|
||||
If an error would be returned, then the function will also ASSERT().
|
||||
|
||||
If an error is returned, then the Destination is unmodified.
|
||||
|
||||
@param Destination A pointer to a Null-terminated Ascii string.
|
||||
@param DestMax The maximum number of Destination Ascii
|
||||
char, including terminating null char.
|
||||
|
@ -398,8 +422,12 @@ AsciiStrCpyS (
|
|||
Source to the array pointed to by Destination. If no null char is copied from
|
||||
Source, then Destination[Length] is always set to null.
|
||||
|
||||
This function is similar as strncpy_s defined in C11.
|
||||
|
||||
If an error would be returned, then the function will also ASSERT().
|
||||
|
||||
If an error is returned, then the Destination is unmodified.
|
||||
|
||||
@param Destination A pointer to a Null-terminated Ascii string.
|
||||
@param DestMax The maximum number of Destination Ascii
|
||||
char, including terminating null char.
|
||||
|
@ -430,8 +458,12 @@ AsciiStrnCpyS (
|
|||
Appends a copy of the string pointed to by Source (including the terminating
|
||||
null char) to the end of the string pointed to by Destination.
|
||||
|
||||
This function is similar as strcat_s defined in C11.
|
||||
|
||||
If an error would be returned, then the function will also ASSERT().
|
||||
|
||||
If an error is returned, then the Destination is unmodified.
|
||||
|
||||
@param Destination A pointer to a Null-terminated Ascii string.
|
||||
@param DestMax The maximum number of Destination Ascii
|
||||
char, including terminating null char.
|
||||
|
@ -464,8 +496,12 @@ AsciiStrCatS (
|
|||
copied from Source, then Destination[StrLen(Destination) + Length] is always
|
||||
set to null.
|
||||
|
||||
This function is similar as strncat_s defined in C11.
|
||||
|
||||
If an error would be returned, then the function will also ASSERT().
|
||||
|
||||
If an error is returned, then the Destination is unmodified.
|
||||
|
||||
@param Destination A pointer to a Null-terminated Ascii string.
|
||||
@param DestMax The maximum number of Destination Ascii
|
||||
char, including terminating null char.
|
||||
|
@ -986,7 +1022,11 @@ StrHexToUint64 (
|
|||
IN CONST CHAR16 *String
|
||||
);
|
||||
|
||||
#ifndef DISABLE_NEW_DEPRECATED_INTERFACES
|
||||
|
||||
/**
|
||||
[ATTENTION] This function is deprecated for security reason.
|
||||
|
||||
Convert a Null-terminated Unicode string to a Null-terminated
|
||||
ASCII string and returns the ASCII string.
|
||||
|
||||
|
@ -1026,6 +1066,56 @@ UnicodeStrToAsciiStr (
|
|||
OUT CHAR8 *Destination
|
||||
);
|
||||
|
||||
#endif
|
||||
|
||||
/**
|
||||
Convert a Null-terminated Unicode string to a Null-terminated
|
||||
ASCII string.
|
||||
|
||||
This function is similar to AsciiStrCpyS.
|
||||
|
||||
This function converts the content of the Unicode string Source
|
||||
to the ASCII string Destination by copying the lower 8 bits of
|
||||
each Unicode character. The function terminates the ASCII string
|
||||
Destination by appending a Null-terminator character at the end.
|
||||
|
||||
The caller is responsible to make sure Destination points to a buffer with size
|
||||
equal or greater than ((StrLen (Source) + 1) * sizeof (CHAR8)) in bytes.
|
||||
|
||||
If any Unicode characters in Source contain non-zero value in
|
||||
the upper 8 bits, then ASSERT().
|
||||
|
||||
If Source is not aligned on a 16-bit boundary, then ASSERT().
|
||||
If an error would be returned, then the function will also ASSERT().
|
||||
|
||||
If an error is returned, then the Destination is unmodified.
|
||||
|
||||
@param Source The pointer to a Null-terminated Unicode string.
|
||||
@param Destination The pointer to a Null-terminated ASCII string.
|
||||
@param DestMax The maximum number of Destination Ascii
|
||||
char, including terminating null char.
|
||||
|
||||
@retval RETURN_SUCCESS String is converted.
|
||||
@retval RETURN_BUFFER_TOO_SMALL If DestMax is NOT greater than StrLen(Source).
|
||||
@retval RETURN_INVALID_PARAMETER If Destination is NULL.
|
||||
If Source is NULL.
|
||||
If PcdMaximumAsciiStringLength is not zero,
|
||||
and DestMax is greater than
|
||||
PcdMaximumAsciiStringLength.
|
||||
If PcdMaximumUnicodeStringLength is not zero,
|
||||
and DestMax is greater than
|
||||
PcdMaximumUnicodeStringLength.
|
||||
If DestMax is 0.
|
||||
@retval RETURN_ACCESS_DENIED If Source and Destination overlap.
|
||||
|
||||
**/
|
||||
RETURN_STATUS
|
||||
EFIAPI
|
||||
UnicodeStrToAsciiStrS (
|
||||
IN CONST CHAR16 *Source,
|
||||
OUT CHAR8 *Destination,
|
||||
IN UINTN DestMax
|
||||
);
|
||||
|
||||
#ifndef DISABLE_NEW_DEPRECATED_INTERFACES
|
||||
|
||||
|
@ -1529,8 +1619,11 @@ AsciiStrHexToUint64 (
|
|||
IN CONST CHAR8 *String
|
||||
);
|
||||
|
||||
#ifndef DISABLE_NEW_DEPRECATED_INTERFACES
|
||||
|
||||
/**
|
||||
[ATTENTION] This function is deprecated for security reason.
|
||||
|
||||
Convert one Null-terminated ASCII string to a Null-terminated
|
||||
Unicode string and returns the Unicode string.
|
||||
|
||||
|
@ -1564,6 +1657,52 @@ AsciiStrToUnicodeStr (
|
|||
OUT CHAR16 *Destination
|
||||
);
|
||||
|
||||
#endif
|
||||
|
||||
/**
|
||||
Convert one Null-terminated ASCII string to a Null-terminated
|
||||
Unicode string.
|
||||
|
||||
This function is similar to StrCpyS.
|
||||
|
||||
This function converts the contents of the ASCII string Source to the Unicode
|
||||
string Destination. The function terminates the Unicode string Destination by
|
||||
appending a Null-terminator character at the end.
|
||||
|
||||
The caller is responsible to make sure Destination points to a buffer with size
|
||||
equal or greater than ((AsciiStrLen (Source) + 1) * sizeof (CHAR16)) in bytes.
|
||||
|
||||
If Destination is not aligned on a 16-bit boundary, then ASSERT().
|
||||
If an error would be returned, then the function will also ASSERT().
|
||||
|
||||
If an error is returned, then the Destination is unmodified.
|
||||
|
||||
@param Source The pointer to a Null-terminated ASCII string.
|
||||
@param Destination The pointer to a Null-terminated Unicode string.
|
||||
@param DestMax The maximum number of Destination Unicode
|
||||
char, including terminating null char.
|
||||
|
||||
@retval RETURN_SUCCESS String is converted.
|
||||
@retval RETURN_BUFFER_TOO_SMALL If DestMax is NOT greater than StrLen(Source).
|
||||
@retval RETURN_INVALID_PARAMETER If Destination is NULL.
|
||||
If Source is NULL.
|
||||
If PcdMaximumUnicodeStringLength is not zero,
|
||||
and DestMax is greater than
|
||||
PcdMaximumUnicodeStringLength.
|
||||
If PcdMaximumAsciiStringLength is not zero,
|
||||
and DestMax is greater than
|
||||
PcdMaximumAsciiStringLength.
|
||||
If DestMax is 0.
|
||||
@retval RETURN_ACCESS_DENIED If Source and Destination overlap.
|
||||
|
||||
**/
|
||||
RETURN_STATUS
|
||||
EFIAPI
|
||||
AsciiStrToUnicodeStrS (
|
||||
IN CONST CHAR8 *Source,
|
||||
OUT CHAR16 *Destination,
|
||||
IN UINTN DestMax
|
||||
);
|
||||
|
||||
/**
|
||||
Converts an 8-bit value to an 8-bit BCD value.
|
||||
|
@ -1635,7 +1774,7 @@ PathRemoveLastItem(
|
|||
|
||||
@param[in] Path The pointer to the string containing the path.
|
||||
|
||||
@return Returns Path, otherwise returns NULL to indicate that an error has occured.
|
||||
@return Returns Path, otherwise returns NULL to indicate that an error has occurred.
|
||||
**/
|
||||
CHAR16*
|
||||
EFIAPI
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/** @file
|
||||
HOB related definitions in PI.
|
||||
|
||||
Copyright (c) 2006 - 2015, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) 2006 - 2016, 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
|
||||
|
@ -11,7 +11,7 @@ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
|||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
|
||||
@par Revision Reference:
|
||||
PI Version 1.4
|
||||
PI Version 1.4a
|
||||
|
||||
**/
|
||||
|
||||
|
@ -295,7 +295,7 @@ typedef UINT32 EFI_RESOURCE_ATTRIBUTE_TYPE;
|
|||
#define EFI_RESOURCE_ATTRIBUTE_PERSISTABLE 0x01000000
|
||||
|
||||
#define EFI_RESOURCE_ATTRIBUTE_READ_ONLY_PROTECTED 0x00040000
|
||||
#define EFI_RESOURCE_ATTRIBUTE_READ_ONLY_PROTECTABLE 0x00800000
|
||||
#define EFI_RESOURCE_ATTRIBUTE_READ_ONLY_PROTECTABLE 0x00080000
|
||||
|
||||
//
|
||||
// Physical memory relative reliability attribute. This
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
from a software point of view. The path must persist from boot to boot, so
|
||||
it can not contain things like PCI bus numbers that change from boot to boot.
|
||||
|
||||
Copyright (c) 2006 - 2015, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) 2006 - 2016, 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
|
||||
|
@ -511,7 +511,7 @@ typedef struct {
|
|||
UINT16 HBAPortNumber;
|
||||
///
|
||||
/// The Port multiplier port number that facilitates the connection
|
||||
/// to the device. Bit 15 should be set if the device is directly
|
||||
/// to the device. Must be set to 0xFFFF if the device is directly
|
||||
/// connected to the HBA.
|
||||
///
|
||||
UINT16 PortMultiplierPortNumber;
|
||||
|
@ -856,6 +856,15 @@ typedef struct {
|
|||
UINT8 SlotNumber;
|
||||
} SD_DEVICE_PATH;
|
||||
|
||||
///
|
||||
/// EMMC (Embedded MMC) Device Path SubType.
|
||||
///
|
||||
#define MSG_EMMC_DP 0x1D
|
||||
typedef struct {
|
||||
EFI_DEVICE_PATH_PROTOCOL Header;
|
||||
UINT8 SlotNumber;
|
||||
} EMMC_DEVICE_PATH;
|
||||
|
||||
///
|
||||
/// iSCSI Device Path SubType
|
||||
///
|
||||
|
@ -1241,6 +1250,7 @@ typedef union {
|
|||
WIFI_DEVICE_PATH WiFi;
|
||||
UFS_DEVICE_PATH Ufs;
|
||||
SD_DEVICE_PATH Sd;
|
||||
EMMC_DEVICE_PATH Emmc;
|
||||
HARDDRIVE_DEVICE_PATH HardDrive;
|
||||
CDROM_DEVICE_PATH CD;
|
||||
|
||||
|
@ -1297,6 +1307,7 @@ typedef union {
|
|||
WIFI_DEVICE_PATH *WiFi;
|
||||
UFS_DEVICE_PATH *Ufs;
|
||||
SD_DEVICE_PATH *Sd;
|
||||
EMMC_DEVICE_PATH *Emmc;
|
||||
HARDDRIVE_DEVICE_PATH *HardDrive;
|
||||
CDROM_DEVICE_PATH *CD;
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/** @file
|
||||
The file provides services to access to images in the images database.
|
||||
|
||||
Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) 2006 - 2016, 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
|
||||
|
@ -17,6 +17,8 @@
|
|||
|
||||
FILE_LICENCE ( BSD3 );
|
||||
|
||||
#include <ipxe/efi/Protocol/GraphicsOutput.h>
|
||||
|
||||
#define EFI_HII_IMAGE_PROTOCOL_GUID \
|
||||
{ 0x31a6406a, 0x6bdf, 0x4e46, { 0xb2, 0xa2, 0xeb, 0xaa, 0x89, 0xc4, 0x9, 0x20 } }
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/** @file
|
||||
EFI Multicast Trivial File Tranfer Protocol Definition
|
||||
EFI Multicast Trivial File Transfer Protocol Definition
|
||||
|
||||
Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>
|
||||
This program and the accompanying materials are licensed and made available under
|
||||
|
@ -214,7 +214,7 @@ EFI_STATUS
|
|||
);
|
||||
|
||||
/**
|
||||
Timeout callback funtion.
|
||||
Timeout callback function.
|
||||
|
||||
@param This The pointer to the EFI_MTFTP4_PROTOCOL instance.
|
||||
@param Token The token that is provided in the
|
||||
|
|
|
@ -162,7 +162,7 @@ typedef EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL SIMPLE_TEXT_OUTPUT_INTERFACE;
|
|||
Reset the text output device hardware and optionaly run diagnostics
|
||||
|
||||
@param This The protocol instance pointer.
|
||||
@param ExtendedVerification Driver may perform more exhaustive verfication
|
||||
@param ExtendedVerification Driver may perform more exhaustive verification
|
||||
operation of the device during reset.
|
||||
|
||||
@retval EFI_SUCCESS The text output device was reset.
|
||||
|
|
|
@ -3,7 +3,8 @@
|
|||
IFR is primarily consumed by the EFI presentation engine, and produced by EFI
|
||||
internal application and drivers as well as all add-in card option-ROM drivers
|
||||
|
||||
Copyright (c) 2006 - 2015, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.<BR>
|
||||
(C) Copyright 2016 Hewlett Packard Enterprise Development LP<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
|
||||
|
@ -211,6 +212,7 @@ typedef struct _EFI_HII_FONT_PACKAGE_HDR {
|
|||
#define EFI_HII_GIBT_GLYPHS 0x11
|
||||
#define EFI_HII_GIBT_GLYPH_DEFAULT 0x12
|
||||
#define EFI_HII_GIBT_GLYPHS_DEFAULT 0x13
|
||||
#define EFI_HII_GIBT_GLYPH_VARIABILITY 0x14
|
||||
#define EFI_HII_GIBT_DUPLICATE 0x20
|
||||
#define EFI_HII_GIBT_SKIP2 0x21
|
||||
#define EFI_HII_GIBT_SKIP1 0x22
|
||||
|
@ -283,6 +285,13 @@ typedef struct _EFI_HII_GIBT_GLYPHS_DEFAULT_BLOCK {
|
|||
UINT8 BitmapData[1];
|
||||
} EFI_HII_GIBT_GLYPHS_DEFAULT_BLOCK;
|
||||
|
||||
typedef struct _EFI_HII_GIBT_VARIABILITY_BLOCK {
|
||||
EFI_HII_GLYPH_BLOCK Header;
|
||||
EFI_HII_GLYPH_INFO Cell;
|
||||
UINT8 GlyphPackInBits;
|
||||
UINT8 BitmapData [1];
|
||||
} EFI_HII_GIBT_VARIABILITY_BLOCK;
|
||||
|
||||
typedef struct _EFI_HII_GIBT_SKIP1_BLOCK {
|
||||
EFI_HII_GLYPH_BLOCK Header;
|
||||
UINT8 SkipCount;
|
||||
|
@ -491,6 +500,7 @@ typedef struct _EFI_HII_IMAGE_BLOCK {
|
|||
#define EFI_HII_IIBT_IMAGE_24BIT 0x16
|
||||
#define EFI_HII_IIBT_IMAGE_24BIT_TRANS 0x17
|
||||
#define EFI_HII_IIBT_IMAGE_JPEG 0x18
|
||||
#define EFI_HII_IIBT_IMAGE_PNG 0x19
|
||||
#define EFI_HII_IIBT_DUPLICATE 0x20
|
||||
#define EFI_HII_IIBT_SKIP2 0x21
|
||||
#define EFI_HII_IIBT_SKIP1 0x22
|
||||
|
@ -611,6 +621,12 @@ typedef struct _EFI_HII_IIBT_JPEG_BLOCK {
|
|||
UINT8 Data[1];
|
||||
} EFI_HII_IIBT_JPEG_BLOCK;
|
||||
|
||||
typedef struct _EFI_HII_IIBT_PNG_BLOCK {
|
||||
EFI_HII_IMAGE_BLOCK Header;
|
||||
UINT32 Size;
|
||||
UINT8 Data[1];
|
||||
} EFI_HII_IIBT_PNG_BLOCK;
|
||||
|
||||
typedef struct _EFI_HII_IIBT_SKIP1_BLOCK {
|
||||
EFI_HII_IMAGE_BLOCK Header;
|
||||
UINT8 SkipCount;
|
||||
|
@ -2112,4 +2128,10 @@ typedef struct _EFI_HII_AIBT_SKIP2_BLOCK {
|
|||
///
|
||||
#define STRING_TOKEN(t) t
|
||||
|
||||
///
|
||||
/// IMAGE_TOKEN is not defined in UEFI specification. But it is placed
|
||||
/// here for the easy access by C files and VFR source files.
|
||||
///
|
||||
#define IMAGE_TOKEN(t) t
|
||||
|
||||
#endif
|
||||
|
|
|
@ -1081,7 +1081,7 @@ typedef struct s_pxe_cpb_start_31 {
|
|||
|
||||
///
|
||||
/// protocol driver can provide anything for this Unique_ID, UNDI remembers
|
||||
/// that as just a 64bit value assocaited to the interface specified by
|
||||
/// that as just a 64bit value associated to the interface specified by
|
||||
/// the ifnum and gives it back as a parameter to all the call-back routines
|
||||
/// when calling for that interface!
|
||||
///
|
||||
|
|
|
@ -1006,11 +1006,15 @@ EFI_STATUS
|
|||
|
||||
@param[in] ResetType The type of reset to perform.
|
||||
@param[in] ResetStatus The status code for the reset.
|
||||
@param[in] DataSize The size, in bytes, of WatchdogData.
|
||||
@param[in] DataSize The size, in bytes, of ResetData.
|
||||
@param[in] ResetData For a ResetType of EfiResetCold, EfiResetWarm, or
|
||||
EfiResetShutdown the data buffer starts with a Null-terminated
|
||||
string, optionally followed by additional binary data.
|
||||
|
||||
The string is a description that the caller may use to further
|
||||
indicate the reason for the system reset. ResetData is only
|
||||
valid if ResetStatus is something other than EFI_SUCCESS
|
||||
unless the ResetType is EfiResetPlatformSpecific
|
||||
where a minimum amount of ResetData is always required.
|
||||
**/
|
||||
typedef
|
||||
VOID
|
||||
|
|
|
@ -29,6 +29,19 @@ FILE_LICENCE ( BSD3 );
|
|||
#pragma pack()
|
||||
#endif
|
||||
|
||||
#if defined(__GNUC__) && defined(__pic__) && !defined(USING_LTO)
|
||||
//
|
||||
// Mark all symbol declarations and references as hidden, meaning they will
|
||||
// not be subject to symbol preemption. This allows the compiler to refer to
|
||||
// symbols directly using relative references rather than via the GOT, which
|
||||
// contains absolute symbol addresses that are subject to runtime relocation.
|
||||
//
|
||||
// The LTO linker will not emit GOT based relocations when all symbol
|
||||
// references can be resolved locally, and so there is no need to set the
|
||||
// pragma in that case (and doing so will cause other issues).
|
||||
//
|
||||
#pragma GCC visibility push (hidden)
|
||||
#endif
|
||||
|
||||
#if defined(__INTEL_COMPILER)
|
||||
//
|
||||
|
@ -82,7 +95,7 @@ FILE_LICENCE ( BSD3 );
|
|||
#pragma warning ( disable : 4057 )
|
||||
|
||||
//
|
||||
// ASSERT(FALSE) or while (TRUE) are legal constructes so supress this warning
|
||||
// ASSERT(FALSE) or while (TRUE) are legal constructs so suppress this warning
|
||||
//
|
||||
#pragma warning ( disable : 4127 )
|
||||
|
||||
|
@ -121,7 +134,7 @@ FILE_LICENCE ( BSD3 );
|
|||
|
||||
#if defined(_MSC_EXTENSIONS)
|
||||
//
|
||||
// use Microsoft C complier dependent integer width types
|
||||
// use Microsoft C compiler dependent integer width types
|
||||
//
|
||||
|
||||
///
|
||||
|
|
Loading…
Reference in New Issue