diff options
Diffstat (limited to 'common/recipes-bsp/gummiboot/files/0006-Add-32-bit-compatible-rdtsc-asm.patch')
| -rw-r--r-- | common/recipes-bsp/gummiboot/files/0006-Add-32-bit-compatible-rdtsc-asm.patch | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/common/recipes-bsp/gummiboot/files/0006-Add-32-bit-compatible-rdtsc-asm.patch b/common/recipes-bsp/gummiboot/files/0006-Add-32-bit-compatible-rdtsc-asm.patch new file mode 100644 index 00000000..e170b695 --- /dev/null +++ b/common/recipes-bsp/gummiboot/files/0006-Add-32-bit-compatible-rdtsc-asm.patch | |||
| @@ -0,0 +1,52 @@ | |||
| 1 | From e4711180646eb1fd701c4e5b124e5dc5372d446d Mon Sep 17 00:00:00 2001 | ||
| 2 | Message-Id: <e4711180646eb1fd701c4e5b124e5dc5372d446d.1367620002.git.dvhart@linux.intel.com> | ||
| 3 | From: Darren Hart <dvhart@linux.intel.com> | ||
| 4 | Date: Fri, 3 May 2013 15:10:43 -0700 | ||
| 5 | Subject: [PATCH] Add 32 bit compatible rdtsc asm | ||
| 6 | |||
| 7 | Gcc's inline asm constraints have different meanings on x86_64 and ia32. | ||
| 8 | Include a 32 bit version for the rdtsc function. Drop the empty 32 bit | ||
| 9 | version of time_usec as it and the cpuid function both function properly | ||
| 10 | when compiled for 32 bit systems. | ||
| 11 | |||
| 12 | Tested on the following CPU: | ||
| 13 | Intel(R) Atom(TM) CPU E640 @ 1.00GHz | ||
| 14 | |||
| 15 | A value of 1000000000 was detected. | ||
| 16 | |||
| 17 | Signed-off-by: Darren Hart <dvhart@linux.intel.com> | ||
| 18 | --- | ||
| 19 | src/efi/gummiboot.c | 10 +++++++--- | ||
| 20 | 1 files changed, 7 insertions(+), 3 deletions(-) | ||
| 21 | |||
| 22 | diff --git a/src/efi/gummiboot.c b/src/efi/gummiboot.c | ||
| 23 | index 9be8f8e..971e05c 100644 | ||
| 24 | --- a/src/efi/gummiboot.c | ||
| 25 | +++ b/src/efi/gummiboot.c | ||
| 26 | @@ -89,6 +89,13 @@ static UINT64 ticks_read(void) { | ||
| 27 | __asm__ volatile ("rdtsc" : "=a" (a), "=d" (d)); | ||
| 28 | return (d << 32) | a; | ||
| 29 | } | ||
| 30 | +#else | ||
| 31 | +static UINT64 ticks_read(void) { | ||
| 32 | + UINT64 val; | ||
| 33 | + __asm__ volatile ("rdtsc" : "=A" (val)); | ||
| 34 | + return val; | ||
| 35 | +} | ||
| 36 | +#endif | ||
| 37 | |||
| 38 | static void cpuid_read(UINT32 info, UINT32 *eax, UINT32 *ebx, UINT32 *ecx, UINT32 *edx) { | ||
| 39 | *eax = info; | ||
| 40 | @@ -186,9 +193,6 @@ static UINT64 time_usec(void) { | ||
| 41 | |||
| 42 | return 1000 * 1000 * ticks / cpufreq; | ||
| 43 | } | ||
| 44 | -#else | ||
| 45 | -static UINT64 time_usec(void) { return 0; } | ||
| 46 | -#endif | ||
| 47 | |||
| 48 | static EFI_STATUS efivar_set_raw(const EFI_GUID *vendor, CHAR16 *name, CHAR8 *buf, UINTN size, BOOLEAN persistent) { | ||
| 49 | UINT32 flags; | ||
| 50 | -- | ||
| 51 | 1.7.5.4 | ||
| 52 | |||
