diff options
author | José Pekkarinen <jose.pekkarinen@nokia.com> | 2016-05-18 13:18:31 +0300 |
---|---|---|
committer | José Pekkarinen <jose.pekkarinen@nokia.com> | 2016-05-18 13:42:15 +0300 |
commit | 437fd90c0250dee670290f9b714253671a990160 (patch) | |
tree | b871786c360704244a07411c69fb58da9ead4a06 /qemu/roms/ipxe/src/include/ipxe/efi | |
parent | 5bbd6fe9b8bab2a93e548c5a53b032d1939eec05 (diff) |
These changes are the raw update to qemu-2.6.
Collission happened in the following patches:
migration: do cleanup operation after completion(738df5b9)
Bug fix.(1750c932f86)
kvmclock: add a new function to update env->tsc.(b52baab2)
The code provided by the patches was already in the upstreamed
version.
Change-Id: I3cc11841a6a76ae20887b2e245710199e1ea7f9a
Signed-off-by: José Pekkarinen <jose.pekkarinen@nokia.com>
Diffstat (limited to 'qemu/roms/ipxe/src/include/ipxe/efi')
19 files changed, 271 insertions, 28 deletions
diff --git a/qemu/roms/ipxe/src/include/ipxe/efi/ProcessorBind.h b/qemu/roms/ipxe/src/include/ipxe/efi/ProcessorBind.h index 1294459f9..7466814fa 100644 --- a/qemu/roms/ipxe/src/include/ipxe/efi/ProcessorBind.h +++ b/qemu/roms/ipxe/src/include/ipxe/efi/ProcessorBind.h @@ -1,7 +1,7 @@ #ifndef _IPXE_EFI_PROCESSOR_BIND_H #define _IPXE_EFI_PROCESSOR_BIND_H -FILE_LICENCE ( GPL2_OR_LATER ); +FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); /* * EFI header files rely on having the CPU architecture directory diff --git a/qemu/roms/ipxe/src/include/ipxe/efi/Protocol/Rng.h b/qemu/roms/ipxe/src/include/ipxe/efi/Protocol/Rng.h new file mode 100644 index 000000000..f04efbb03 --- /dev/null +++ b/qemu/roms/ipxe/src/include/ipxe/efi/Protocol/Rng.h @@ -0,0 +1,158 @@ +/** @file + EFI_RNG_PROTOCOL as defined in UEFI 2.4. + The UEFI Random Number Generator Protocol is used to provide random bits for use + in applications, or entropy for seeding other random number generators. + +Copyright (c) 2013, 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 __EFI_RNG_PROTOCOL_H__ +#define __EFI_RNG_PROTOCOL_H__ + +FILE_LICENCE ( BSD3 ); + +/// +/// Global ID for the Random Number Generator Protocol +/// +#define EFI_RNG_PROTOCOL_GUID \ + { \ + 0x3152bca5, 0xeade, 0x433d, {0x86, 0x2e, 0xc0, 0x1c, 0xdc, 0x29, 0x1f, 0x44 } \ + } + +typedef struct _EFI_RNG_PROTOCOL EFI_RNG_PROTOCOL; + +/// +/// A selection of EFI_RNG_PROTOCOL algorithms. +/// The algorithms listed are optional, not meant to be exhaustive and be argmented by +/// vendors or other industry standards. +/// + +typedef EFI_GUID EFI_RNG_ALGORITHM; + +/// +/// The algorithms corresponds to SP800-90 as defined in +/// NIST SP 800-90, "Recommendation for Random Number Generation Using Deterministic Random +/// Bit Generators", March 2007. +/// +#define EFI_RNG_ALGORITHM_SP800_90_HASH_256_GUID \ + { \ + 0xa7af67cb, 0x603b, 0x4d42, {0xba, 0x21, 0x70, 0xbf, 0xb6, 0x29, 0x3f, 0x96 } \ + } +#define EFI_RNG_ALGORITHM_SP800_90_HMAC_256_GUID \ + { \ + 0xc5149b43, 0xae85, 0x4f53, {0x99, 0x82, 0xb9, 0x43, 0x35, 0xd3, 0xa9, 0xe7 } \ + } +#define EFI_RNG_ALGORITHM_SP800_90_CTR_256_GUID \ + { \ + 0x44f0de6e, 0x4d8c, 0x4045, {0xa8, 0xc7, 0x4d, 0xd1, 0x68, 0x85, 0x6b, 0x9e } \ + } +/// +/// The algorithms correspond to X9.31 as defined in +/// NIST, "Recommended Random Number Generator Based on ANSI X9.31 Appendix A.2.4 Using +/// the 3-Key Triple DES and AES Algorithm", January 2005. +/// +#define EFI_RNG_ALGORITHM_X9_31_3DES_GUID \ + { \ + 0x63c4785a, 0xca34, 0x4012, {0xa3, 0xc8, 0x0b, 0x6a, 0x32, 0x4f, 0x55, 0x46 } \ + } +#define EFI_RNG_ALGORITHM_X9_31_AES_GUID \ + { \ + 0xacd03321, 0x777e, 0x4d3d, {0xb1, 0xc8, 0x20, 0xcf, 0xd8, 0x88, 0x20, 0xc9 } \ + } +/// +/// The "raw" algorithm, when supported, is intended to provide entropy directly from +/// the source, without it going through some deterministic random bit generator. +/// +#define EFI_RNG_ALGORITHM_RAW \ + { \ + 0xe43176d7, 0xb6e8, 0x4827, {0xb7, 0x84, 0x7f, 0xfd, 0xc4, 0xb6, 0x85, 0x61 } \ + } + +/** + Returns information about the random number generation implementation. + + @param[in] This A pointer to the EFI_RNG_PROTOCOL instance. + @param[in,out] RNGAlgorithmListSize On input, the size in bytes of RNGAlgorithmList. + On output with a return code of EFI_SUCCESS, the size + in bytes of the data returned in RNGAlgorithmList. On output + with a return code of EFI_BUFFER_TOO_SMALL, + the size of RNGAlgorithmList required to obtain the list. + @param[out] RNGAlgorithmList A caller-allocated memory buffer filled by the driver + with one EFI_RNG_ALGORITHM element for each supported + RNG algorithm. The list must not change across multiple + calls to the same driver. The first algorithm in the list + is the default algorithm for the driver. + + @retval EFI_SUCCESS The RNG algorithm list was returned successfully. + @retval EFI_UNSUPPORTED The services is not supported by this driver. + @retval EFI_DEVICE_ERROR The list of algorithms could not be retrieved due to a + hardware or firmware error. + @retval EFI_INVALID_PARAMETER One or more of the parameters are incorrect. + @retval EFI_BUFFER_TOO_SMALL The buffer RNGAlgorithmList is too small to hold the result. + +**/ +typedef +EFI_STATUS +(EFIAPI *EFI_RNG_GET_INFO) ( + IN EFI_RNG_PROTOCOL *This, + IN OUT UINTN *RNGAlgorithmListSize, + OUT EFI_RNG_ALGORITHM *RNGAlgorithmList + ); + +/** + Produces and returns an RNG value using either the default or specified RNG algorithm. + + @param[in] This A pointer to the EFI_RNG_PROTOCOL instance. + @param[in] RNGAlgorithm A pointer to the EFI_RNG_ALGORITHM that identifies the RNG + algorithm to use. May be NULL in which case the function will + use its default RNG algorithm. + @param[in] RNGValueLength The length in bytes of the memory buffer pointed to by + RNGValue. The driver shall return exactly this numbers of bytes. + @param[out] RNGValue A caller-allocated memory buffer filled by the driver with the + resulting RNG value. + + @retval EFI_SUCCESS The RNG value was returned successfully. + @retval EFI_UNSUPPORTED The algorithm specified by RNGAlgorithm is not supported by + this driver. + @retval EFI_DEVICE_ERROR An RNG value could not be retrieved due to a hardware or + firmware error. + @retval EFI_NOT_READY There is not enough random data available to satisfy the length + requested by RNGValueLength. + @retval EFI_INVALID_PARAMETER RNGValue is NULL or RNGValueLength is zero. + +**/ +typedef +EFI_STATUS +(EFIAPI *EFI_RNG_GET_RNG) ( + IN EFI_RNG_PROTOCOL *This, + IN EFI_RNG_ALGORITHM *RNGAlgorithm, OPTIONAL + IN UINTN RNGValueLength, + OUT UINT8 *RNGValue + ); + +/// +/// The Random Number Generator (RNG) protocol provides random bits for use in +/// applications, or entropy for seeding other random number generators. +/// +struct _EFI_RNG_PROTOCOL { + EFI_RNG_GET_INFO GetInfo; + EFI_RNG_GET_RNG GetRNG; +}; + +extern EFI_GUID gEfiRngProtocolGuid; +extern EFI_GUID gEfiRngAlgorithmSp80090Hash256Guid; +extern EFI_GUID gEfiRngAlgorithmSp80090Hmac256Guid; +extern EFI_GUID gEfiRngAlgorithmSp80090Ctr256Guid; +extern EFI_GUID gEfiRngAlgorithmX9313DesGuid; +extern EFI_GUID gEfiRngAlgorithmX931AesGuid; +extern EFI_GUID gEfiRngAlgorithmRaw; + +#endif diff --git a/qemu/roms/ipxe/src/include/ipxe/efi/efi_autoboot.h b/qemu/roms/ipxe/src/include/ipxe/efi/efi_autoboot.h index d4a26850c..1d5ddc8c3 100644 --- a/qemu/roms/ipxe/src/include/ipxe/efi/efi_autoboot.h +++ b/qemu/roms/ipxe/src/include/ipxe/efi/efi_autoboot.h @@ -7,7 +7,7 @@ * */ -FILE_LICENCE ( GPL2_OR_LATER ); +FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); extern void efi_set_autoboot ( void ); diff --git a/qemu/roms/ipxe/src/include/ipxe/efi/efi_driver.h b/qemu/roms/ipxe/src/include/ipxe/efi/efi_driver.h index e16a24daa..f497df3e3 100644 --- a/qemu/roms/ipxe/src/include/ipxe/efi/efi_driver.h +++ b/qemu/roms/ipxe/src/include/ipxe/efi/efi_driver.h @@ -6,7 +6,7 @@ * EFI driver interface */ -FILE_LICENCE ( GPL2_OR_LATER ); +FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); #include <ipxe/device.h> #include <ipxe/tables.h> diff --git a/qemu/roms/ipxe/src/include/ipxe/efi/efi_entropy.h b/qemu/roms/ipxe/src/include/ipxe/efi/efi_entropy.h new file mode 100644 index 000000000..39a667355 --- /dev/null +++ b/qemu/roms/ipxe/src/include/ipxe/efi/efi_entropy.h @@ -0,0 +1,35 @@ +#ifndef _IPXE_EFI_ENTROPY_H +#define _IPXE_EFI_ENTROPY_H + +/** @file + * + * EFI entropy source + * + */ + +FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); + +#include <stdint.h> + +#ifdef ENTROPY_EFI +#define ENTROPY_PREFIX_efi +#else +#define ENTROPY_PREFIX_efi __efi_ +#endif + +/** + * min-entropy per sample + * + * @ret min_entropy min-entropy of each sample + */ +static inline __always_inline double +ENTROPY_INLINE ( efi, min_entropy_per_sample ) ( void ) { + + /* We use essentially the same mechanism as for the BIOS + * RTC-based entropy source, and so assume the same + * min-entropy per sample. + */ + return 1.3; +} + +#endif /* _IPXE_EFI_ENTROPY_H */ diff --git a/qemu/roms/ipxe/src/include/ipxe/efi/efi_hii.h b/qemu/roms/ipxe/src/include/ipxe/efi/efi_hii.h index 8e94bbe7e..bbec31194 100644 --- a/qemu/roms/ipxe/src/include/ipxe/efi/efi_hii.h +++ b/qemu/roms/ipxe/src/include/ipxe/efi/efi_hii.h @@ -6,7 +6,7 @@ * EFI human interface infrastructure */ -FILE_LICENCE ( GPL2_OR_LATER ); +FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); #include <string.h> #include <ipxe/efi/Uefi/UefiInternalFormRepresentation.h> diff --git a/qemu/roms/ipxe/src/include/ipxe/efi/efi_pci.h b/qemu/roms/ipxe/src/include/ipxe/efi/efi_pci.h index af36613d9..6dd945f05 100644 --- a/qemu/roms/ipxe/src/include/ipxe/efi/efi_pci.h +++ b/qemu/roms/ipxe/src/include/ipxe/efi/efi_pci.h @@ -6,7 +6,7 @@ * EFI driver interface */ -FILE_LICENCE ( GPL2_OR_LATER ); +FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); #include <ipxe/pci.h> #include <ipxe/efi/efi.h> diff --git a/qemu/roms/ipxe/src/include/ipxe/efi/efi_pci_api.h b/qemu/roms/ipxe/src/include/ipxe/efi/efi_pci_api.h index 498a0388b..887d5ee14 100644 --- a/qemu/roms/ipxe/src/include/ipxe/efi/efi_pci_api.h +++ b/qemu/roms/ipxe/src/include/ipxe/efi/efi_pci_api.h @@ -7,7 +7,7 @@ * */ -FILE_LICENCE ( GPL2_OR_LATER ); +FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); #ifdef PCIAPI_EFI #define PCIAPI_PREFIX_efi diff --git a/qemu/roms/ipxe/src/include/ipxe/efi/efi_reboot.h b/qemu/roms/ipxe/src/include/ipxe/efi/efi_reboot.h index 33921b913..249cae8c5 100644 --- a/qemu/roms/ipxe/src/include/ipxe/efi/efi_reboot.h +++ b/qemu/roms/ipxe/src/include/ipxe/efi/efi_reboot.h @@ -7,7 +7,7 @@ * */ -FILE_LICENCE ( GPL2_OR_LATER ); +FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); #ifdef REBOOT_EFI #define REBOOT_PREFIX_efi diff --git a/qemu/roms/ipxe/src/include/ipxe/efi/efi_smbios.h b/qemu/roms/ipxe/src/include/ipxe/efi/efi_smbios.h index 7642e5bc5..d890d5460 100644 --- a/qemu/roms/ipxe/src/include/ipxe/efi/efi_smbios.h +++ b/qemu/roms/ipxe/src/include/ipxe/efi/efi_smbios.h @@ -7,7 +7,7 @@ * */ -FILE_LICENCE ( GPL2_OR_LATER ); +FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); #ifdef SMBIOS_EFI #define SMBIOS_PREFIX_efi diff --git a/qemu/roms/ipxe/src/include/ipxe/efi/efi_snp.h b/qemu/roms/ipxe/src/include/ipxe/efi/efi_snp.h index a18bced5f..1e5c66626 100644 --- a/qemu/roms/ipxe/src/include/ipxe/efi/efi_snp.h +++ b/qemu/roms/ipxe/src/include/ipxe/efi/efi_snp.h @@ -18,6 +18,9 @@ #include <ipxe/efi/Protocol/HiiDatabase.h> #include <ipxe/efi/Protocol/LoadFile.h> +/** SNP transmit completion ring size */ +#define EFI_SNP_NUM_TX 32 + /** An SNP device */ struct efi_snp_device { /** List of SNP devices */ @@ -34,20 +37,16 @@ struct efi_snp_device { EFI_SIMPLE_NETWORK_MODE mode; /** Started flag */ int started; - /** Outstanding TX packet count (via "interrupt status") - * - * Used in order to generate TX completions. - */ - unsigned int tx_count_interrupts; - /** Outstanding TX packet count (via "recycled tx buffers") - * - * Used in order to generate TX completions. - */ - unsigned int tx_count_txbufs; - /** Outstanding RX packet count (via "interrupt status") */ - unsigned int rx_count_interrupts; - /** Outstanding RX packet count (via WaitForPacket event) */ - unsigned int rx_count_events; + /** Pending interrupt status */ + unsigned int interrupts; + /** Transmit completion ring */ + VOID *tx[EFI_SNP_NUM_TX]; + /** Transmit completion ring producer counter */ + unsigned int tx_prod; + /** Transmit completion ring consumer counter */ + unsigned int tx_cons; + /** Receive queue */ + struct list_head rx; /** The network interface identifier */ EFI_NETWORK_INTERFACE_IDENTIFIER_PROTOCOL nii; /** Component name protocol */ diff --git a/qemu/roms/ipxe/src/include/ipxe/efi/efi_strings.h b/qemu/roms/ipxe/src/include/ipxe/efi/efi_strings.h index 023ccda07..2f241537e 100644 --- a/qemu/roms/ipxe/src/include/ipxe/efi/efi_strings.h +++ b/qemu/roms/ipxe/src/include/ipxe/efi/efi_strings.h @@ -6,7 +6,7 @@ * EFI strings */ -FILE_LICENCE ( GPL2_OR_LATER ); +FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); #include <stddef.h> #include <stdint.h> diff --git a/qemu/roms/ipxe/src/include/ipxe/efi/efi_time.h b/qemu/roms/ipxe/src/include/ipxe/efi/efi_time.h new file mode 100644 index 000000000..099994b57 --- /dev/null +++ b/qemu/roms/ipxe/src/include/ipxe/efi/efi_time.h @@ -0,0 +1,20 @@ +#ifndef _IPXE_EFI_TIME_H +#define _IPXE_EFI_TIME_H + +/** @file + * + * EFI time source + * + */ + +FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); + +#include <stdint.h> + +#ifdef TIME_EFI +#define TIME_PREFIX_efi +#else +#define TIME_PREFIX_efi __efi_ +#endif + +#endif /* _IPXE_EFI_TIME_H */ diff --git a/qemu/roms/ipxe/src/include/ipxe/efi/efi_timer.h b/qemu/roms/ipxe/src/include/ipxe/efi/efi_timer.h index b10543d6c..c03765393 100644 --- a/qemu/roms/ipxe/src/include/ipxe/efi/efi_timer.h +++ b/qemu/roms/ipxe/src/include/ipxe/efi/efi_timer.h @@ -7,7 +7,7 @@ * */ -FILE_LICENCE ( GPL2_OR_LATER ); +FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); #ifdef TIMER_EFI #define TIMER_PREFIX_efi diff --git a/qemu/roms/ipxe/src/include/ipxe/efi/efi_uaccess.h b/qemu/roms/ipxe/src/include/ipxe/efi/efi_uaccess.h index 870a089b2..3cc750405 100644 --- a/qemu/roms/ipxe/src/include/ipxe/efi/efi_uaccess.h +++ b/qemu/roms/ipxe/src/include/ipxe/efi/efi_uaccess.h @@ -10,7 +10,7 @@ * no-ops. */ -FILE_LICENCE ( GPL2_OR_LATER ); +FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); #ifdef UACCESS_EFI #define UACCESS_PREFIX_efi diff --git a/qemu/roms/ipxe/src/include/ipxe/efi/efi_umalloc.h b/qemu/roms/ipxe/src/include/ipxe/efi/efi_umalloc.h index 911e69a96..4eb2a5f9b 100644 --- a/qemu/roms/ipxe/src/include/ipxe/efi/efi_umalloc.h +++ b/qemu/roms/ipxe/src/include/ipxe/efi/efi_umalloc.h @@ -7,7 +7,7 @@ * */ -FILE_LICENCE ( GPL2_OR_LATER ); +FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); #ifdef UMALLOC_EFI #define UMALLOC_PREFIX_efi diff --git a/qemu/roms/ipxe/src/include/ipxe/efi/efi_utils.h b/qemu/roms/ipxe/src/include/ipxe/efi/efi_utils.h index 9164be190..57268daf7 100644 --- a/qemu/roms/ipxe/src/include/ipxe/efi/efi_utils.h +++ b/qemu/roms/ipxe/src/include/ipxe/efi/efi_utils.h @@ -6,7 +6,7 @@ * EFI utilities */ -FILE_LICENCE ( GPL2_OR_LATER ); +FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); #include <ipxe/efi/efi.h> #include <ipxe/efi/Protocol/DevicePath.h> diff --git a/qemu/roms/ipxe/src/include/ipxe/efi/efi_watchdog.h b/qemu/roms/ipxe/src/include/ipxe/efi/efi_watchdog.h new file mode 100644 index 000000000..4a56b9a29 --- /dev/null +++ b/qemu/roms/ipxe/src/include/ipxe/efi/efi_watchdog.h @@ -0,0 +1,31 @@ +#ifndef _IPXE_EFI_WATCHDOG_H +#define _IPXE_EFI_WATCHDOG_H + +/** @file + * + * EFI watchdog holdoff timer + */ + +FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); + +extern struct retry_timer efi_watchdog; + +/** + * Start EFI watchdog holdoff timer + * + */ +static inline void efi_watchdog_start ( void ) { + + start_timer_nodelay ( &efi_watchdog ); +} + +/** + * Stop EFI watchdog holdoff timer + * + */ +static inline void efi_watchdog_stop ( void ) { + + stop_timer ( &efi_watchdog ); +} + +#endif /* _IPXE_EFI_WATCHDOG_H */ diff --git a/qemu/roms/ipxe/src/include/ipxe/efi/efi_wrap.h b/qemu/roms/ipxe/src/include/ipxe/efi/efi_wrap.h index 7579e0fe9..d8ed1a5cc 100644 --- a/qemu/roms/ipxe/src/include/ipxe/efi/efi_wrap.h +++ b/qemu/roms/ipxe/src/include/ipxe/efi/efi_wrap.h @@ -6,7 +6,7 @@ * EFI driver interface */ -FILE_LICENCE ( GPL2_OR_LATER ); +FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); #include <ipxe/efi/efi.h> |