[systemd-devel] [gummiboot][PATCH 4/5] util: confine x86 asm to x86 architectures

Koen Kooi koen.kooi at linaro.org
Sat Apr 11 01:23:25 PDT 2015


Also add a stub function that just returns '1' to avoid missing symbols.

Signed-off-by: Koen Kooi <koen.kooi at linaro.org>
---
 src/efi/util.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/src/efi/util.c b/src/efi/util.c
index 689bc7c..6ce1f18 100644
--- a/src/efi/util.c
+++ b/src/efi/util.c
@@ -33,14 +33,17 @@ UINT64 ticks_read(VOID) {
         __asm__ volatile ("rdtsc" : "=a" (a), "=d" (d));
         return (d << 32) | a;
 }
-#endif
-
-#ifdef __i386__
+#elif __i386__
 UINT64 ticks_read(VOID) {
         UINT64 val;
         __asm__ volatile ("rdtsc" : "=A" (val));
         return val;
 }
+#else
+UINT64 ticks_read(VOID) {
+        UINT64 val = 1;
+        return val;
+}
 #endif
 
 /* count TSC ticks during a millisecond delay */
-- 
2.0.1



More information about the systemd-devel mailing list