2017-02-28 16:55:01 +00:00
|
|
|
From 397b06ff74f7fd8fc71f5991bdfbfa6ef6da98fd Mon Sep 17 00:00:00 2001
|
2017-02-02 20:28:32 +00:00
|
|
|
From: Peter Jones <pjones@redhat.com>
|
|
|
|
Date: Thu, 2 Feb 2017 15:25:48 -0500
|
2017-02-28 16:55:01 +00:00
|
|
|
Subject: [PATCH 05/10] Fix a sign error in the debughook example app
|
|
|
|
|
|
|
|
On ISO C90 on i386 4294967294 is a signed integer, and so x can't be
|
|
|
|
greater (or equal) to that. Make it an unsigned and choose a better type
|
|
|
|
for the variable.
|
2017-02-02 20:28:32 +00:00
|
|
|
|
|
|
|
Signed-off-by: Peter Jones <pjones@redhat.com>
|
|
|
|
---
|
2017-02-28 16:55:01 +00:00
|
|
|
apps/debughook.c | 4 ++--
|
|
|
|
1 file changed, 2 insertions(+), 2 deletions(-)
|
2017-02-02 20:28:32 +00:00
|
|
|
|
|
|
|
diff --git a/apps/debughook.c b/apps/debughook.c
|
2017-02-28 16:55:01 +00:00
|
|
|
index fb6cdad..e1d1c50 100644
|
2017-02-02 20:28:32 +00:00
|
|
|
--- a/apps/debughook.c
|
|
|
|
+++ b/apps/debughook.c
|
2017-02-28 16:55:01 +00:00
|
|
|
@@ -45,7 +45,7 @@ DebugHook(void)
|
|
|
|
UINT8 *data = NULL;
|
|
|
|
UINTN dataSize = 0;
|
|
|
|
EFI_STATUS efi_status;
|
|
|
|
- register volatile UINTN x = 0;
|
|
|
|
+ register volatile unsigned long long x = 0;
|
|
|
|
extern char _text, _data;
|
|
|
|
|
|
|
|
if (x)
|
2017-02-02 20:28:32 +00:00
|
|
|
@@ -66,7 +66,7 @@ DebugHook(void)
|
|
|
|
while (x++) {
|
|
|
|
/* Make this so it can't /totally/ DoS us. */
|
|
|
|
#if defined(__x86_64__) || defined(__i386__) || defined(__i686__)
|
|
|
|
- if (x > 4294967294)
|
|
|
|
+ if (x > 4294967294ULL)
|
|
|
|
break;
|
|
|
|
__asm__ __volatile__("pause");
|
|
|
|
#elif defined(__aarch64__)
|
|
|
|
--
|
|
|
|
2.9.3
|
|
|
|
|