diff options
Diffstat (limited to 'src/arch/x86/include')
| -rw-r--r-- | src/arch/x86/include/bits/entropy.h | 14 | ||||
| -rw-r--r-- | src/arch/x86/include/bits/errfile.h | 1 | ||||
| -rw-r--r-- | src/arch/x86/include/bits/io.h | 3 | ||||
| -rw-r--r-- | src/arch/x86/include/ipxe/cpuid.h | 3 | ||||
| -rw-r--r-- | src/arch/x86/include/ipxe/pcbios/dhcparch.h | 20 | ||||
| -rw-r--r-- | src/arch/x86/include/ipxe/rtc_entropy.h | 62 | ||||
| -rw-r--r-- | src/arch/x86/include/ipxe/x86_io.h | 3 | ||||
| -rw-r--r-- | src/arch/x86/include/linux/ipxe/dhcp_arch.h | 41 |
8 files changed, 27 insertions, 120 deletions
diff --git a/src/arch/x86/include/bits/entropy.h b/src/arch/x86/include/bits/entropy.h deleted file mode 100644 index 5ac7fcd2e..000000000 --- a/src/arch/x86/include/bits/entropy.h +++ /dev/null @@ -1,14 +0,0 @@ -#ifndef _BITS_ENTROPY_H -#define _BITS_ENTROPY_H - -/** @file - * - * x86-specific entropy API implementations - * - */ - -FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); - -#include <ipxe/rtc_entropy.h> - -#endif /* _BITS_ENTROPY_H */ diff --git a/src/arch/x86/include/bits/errfile.h b/src/arch/x86/include/bits/errfile.h index b0ae1abc2..b5316a586 100644 --- a/src/arch/x86/include/bits/errfile.h +++ b/src/arch/x86/include/bits/errfile.h @@ -28,6 +28,7 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); #define ERRFILE_cpuid ( ERRFILE_ARCH | ERRFILE_CORE | 0x00110000 ) #define ERRFILE_rdtsc_timer ( ERRFILE_ARCH | ERRFILE_CORE | 0x00120000 ) #define ERRFILE_acpi_timer ( ERRFILE_ARCH | ERRFILE_CORE | 0x00130000 ) +#define ERRFILE_rdrand ( ERRFILE_ARCH | ERRFILE_CORE | 0x00140000 ) #define ERRFILE_bootsector ( ERRFILE_ARCH | ERRFILE_IMAGE | 0x00000000 ) #define ERRFILE_bzimage ( ERRFILE_ARCH | ERRFILE_IMAGE | 0x00010000 ) diff --git a/src/arch/x86/include/bits/io.h b/src/arch/x86/include/bits/io.h index 60c2e3edf..95673ad8d 100644 --- a/src/arch/x86/include/bits/io.h +++ b/src/arch/x86/include/bits/io.h @@ -9,6 +9,9 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); +/** Page shift */ +#define PAGE_SHIFT 12 + #include <ipxe/x86_io.h> #endif /* _BITS_IO_H */ diff --git a/src/arch/x86/include/ipxe/cpuid.h b/src/arch/x86/include/ipxe/cpuid.h index 3983dfb89..90d1bf01d 100644 --- a/src/arch/x86/include/ipxe/cpuid.h +++ b/src/arch/x86/include/ipxe/cpuid.h @@ -39,6 +39,9 @@ struct x86_features { /** Get standard features */ #define CPUID_FEATURES 0x00000001UL +/** RDRAND instruction is supported */ +#define CPUID_FEATURES_INTEL_ECX_RDRAND 0x40000000UL + /** Hypervisor is present */ #define CPUID_FEATURES_INTEL_ECX_HYPERVISOR 0x80000000UL diff --git a/src/arch/x86/include/ipxe/pcbios/dhcparch.h b/src/arch/x86/include/ipxe/pcbios/dhcparch.h new file mode 100644 index 000000000..13138ea96 --- /dev/null +++ b/src/arch/x86/include/ipxe/pcbios/dhcparch.h @@ -0,0 +1,20 @@ +#ifndef _IPXE_PCBIOS_DHCPARCH_H +#define _IPXE_PCBIOS_DHCPARCH_H + +/** @file + * + * DHCP client architecture definitions + * + */ + +FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); + +#include <ipxe/dhcp.h> + +/** DHCP client architecture */ +#define DHCP_ARCH_CLIENT_ARCHITECTURE DHCP_CLIENT_ARCHITECTURE_X86 + +/** DHCP client network device interface */ +#define DHCP_ARCH_CLIENT_NDI 1 /* UNDI */ , 2, 1 /* v2.1 */ + +#endif /* _IPXE_PCBIOS_DHCPARCH_H */ diff --git a/src/arch/x86/include/ipxe/rtc_entropy.h b/src/arch/x86/include/ipxe/rtc_entropy.h deleted file mode 100644 index 581abcd3e..000000000 --- a/src/arch/x86/include/ipxe/rtc_entropy.h +++ /dev/null @@ -1,62 +0,0 @@ -#ifndef _IPXE_RTC_ENTROPY_H -#define _IPXE_RTC_ENTROPY_H - -/** @file - * - * RTC-based entropy source - * - */ - -FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); - -#include <stdint.h> - -#ifdef ENTROPY_RTC -#define ENTROPY_PREFIX_rtc -#else -#define ENTROPY_PREFIX_rtc __rtc_ -#endif - -/** - * min-entropy per sample - * - * @ret min_entropy min-entropy of each sample - */ -static inline __always_inline min_entropy_t -ENTROPY_INLINE ( rtc, min_entropy_per_sample ) ( void ) { - - /* The min-entropy has been measured on several platforms - * using the entropy_sample test code. Modelling the samples - * as independent, and using a confidence level of 99.99%, the - * measurements were as follows: - * - * qemu-kvm : 7.38 bits - * VMware : 7.46 bits - * Physical hardware : 2.67 bits - * - * We choose the lowest of these (2.67 bits) and apply a 50% - * safety margin to allow for some potential non-independence - * of samples. - */ - return MIN_ENTROPY ( 1.3 ); -} - -extern uint8_t rtc_sample ( void ); - -/** - * Get noise sample - * - * @ret noise Noise sample - * @ret rc Return status code - */ -static inline __always_inline int -ENTROPY_INLINE ( rtc, get_noise ) ( noise_sample_t *noise ) { - - /* Get sample */ - *noise = rtc_sample(); - - /* Always successful */ - return 0; -} - -#endif /* _IPXE_RTC_ENTROPY_H */ diff --git a/src/arch/x86/include/ipxe/x86_io.h b/src/arch/x86/include/ipxe/x86_io.h index a6ebe1f4c..eeb3f8454 100644 --- a/src/arch/x86/include/ipxe/x86_io.h +++ b/src/arch/x86/include/ipxe/x86_io.h @@ -28,9 +28,6 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); * */ -/** Page shift */ -#define PAGE_SHIFT 12 - /* * Physical<->Bus address mappings * diff --git a/src/arch/x86/include/linux/ipxe/dhcp_arch.h b/src/arch/x86/include/linux/ipxe/dhcp_arch.h deleted file mode 100644 index d60905f22..000000000 --- a/src/arch/x86/include/linux/ipxe/dhcp_arch.h +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (C) 2010 Piotr JaroszyĆski <p.jaroszynski@gmail.com> - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA - * 02110-1301, USA. - * - * You can also choose to distribute this program under the terms of - * the Unmodified Binary Distribution Licence (as given in the file - * COPYING.UBDL), provided that you have satisfied its requirements. - */ - -#ifndef _LINUX_DHCP_ARCH_H -#define _LINUX_DHCP_ARCH_H - -/** @file - * - * Architecture-specific DHCP options - */ - -FILE_LICENCE(GPL2_OR_LATER_OR_UBDL); - -#include <ipxe/dhcp.h> - -// Emulate one of the supported arch-platforms -#include <arch/i386/include/pcbios/ipxe/dhcp_arch.h> -//#include <arch/i386/include/efi/ipxe/dhcp_arch.h> -//#include <arch/x86_64/include/efi/ipxe/dhcp_arch.h> - -#endif |
