|
@@ -26,6 +26,7 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
|
26
|
26
|
#include <errno.h>
|
27
|
27
|
#include <ipxe/entropy.h>
|
28
|
28
|
#include <ipxe/crc32.h>
|
|
29
|
+#include <ipxe/profile.h>
|
29
|
30
|
#include <ipxe/efi/efi.h>
|
30
|
31
|
#include <ipxe/efi/Protocol/Rng.h>
|
31
|
32
|
|
|
@@ -104,13 +105,12 @@ static void efi_entropy_disable ( void ) {
|
104
|
105
|
/**
|
105
|
106
|
* Wait for a timer tick
|
106
|
107
|
*
|
107
|
|
- * @ret low TSC low-order bits, or negative error
|
|
108
|
+ * @ret low CPU profiling low-order bits, or negative error
|
108
|
109
|
*/
|
109
|
110
|
static int efi_entropy_tick ( void ) {
|
110
|
111
|
EFI_BOOT_SERVICES *bs = efi_systab->BootServices;
|
111
|
112
|
UINTN index;
|
112
|
113
|
uint16_t low;
|
113
|
|
- uint32_t discard_d;
|
114
|
114
|
EFI_STATUS efirc;
|
115
|
115
|
int rc;
|
116
|
116
|
|
|
@@ -129,8 +129,8 @@ static int efi_entropy_tick ( void ) {
|
129
|
129
|
return rc;
|
130
|
130
|
}
|
131
|
131
|
|
132
|
|
- /* Get current TSC low-order bits */
|
133
|
|
- __asm__ __volatile__ ( "rdtsc" : "=a" ( low ), "=d" ( discard_d ) );
|
|
132
|
+ /* Get current CPU profiling timestamp low-order bits */
|
|
133
|
+ low = profile_timestamp();
|
134
|
134
|
|
135
|
135
|
return low;
|
136
|
136
|
}
|