Patrick Rudolph has uploaded this change for review.

View Change

postcar_loader: Use size_t

To make it easier to pop arguments from stack use size_t instead of int.
This is a noop on x86_32.

Change-Id: I226f79eaea425229eb2e3d9b9a312c9bf47d3b6a
Signed-off-by: Patrick Rudolph <patrick.rudolph@9elements.com>
---
M src/arch/x86/include/arch/cpu.h
M src/arch/x86/postcar_loader.c
2 files changed, 10 insertions(+), 10 deletions(-)

git pull ssh://review.coreboot.org:29418/coreboot refs/changes/75/32375/1
diff --git a/src/arch/x86/include/arch/cpu.h b/src/arch/x86/include/arch/cpu.h
index 61b17a6..1cdf2db 100644
--- a/src/arch/x86/include/arch/cpu.h
+++ b/src/arch/x86/include/arch/cpu.h
@@ -310,8 +310,8 @@
struct postcar_frame {
uintptr_t stack;
uint32_t upper_mask;
- int max_var_mtrrs;
- int num_var_mtrrs;
+ size_t max_var_mtrrs;
+ size_t num_var_mtrrs;
};

/*
diff --git a/src/arch/x86/postcar_loader.c b/src/arch/x86/postcar_loader.c
index d62487e..a043f1b 100644
--- a/src/arch/x86/postcar_loader.c
+++ b/src/arch/x86/postcar_loader.c
@@ -25,13 +25,13 @@
#include <stage_cache.h>
#include <timestamp.h>

-static inline void stack_push(struct postcar_frame *pcf, uint32_t val)
-{
- uint32_t *ptr;
-
- pcf->stack -= sizeof(val);
- ptr = (void *)pcf->stack;
- *ptr = val;
+#define stack_push(pcf, val) \
+{ \
+ typeof(val) *ptr; \
+ \
+ pcf->stack -= sizeof(val); \
+ ptr = (void *)pcf->stack; \
+ *ptr = val; \
}

static void postcar_frame_prepare(struct postcar_frame *pcf)
@@ -74,7 +74,7 @@
uint32_t mtrr_size;

if (pcf->num_var_mtrrs >= pcf->max_var_mtrrs) {
- printk(BIOS_ERR, "No more variable MTRRs: %d\n",
+ printk(BIOS_ERR, "No more variable MTRRs: %zd\n",
pcf->max_var_mtrrs);
return;
}

To view, visit change 32375. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I226f79eaea425229eb2e3d9b9a312c9bf47d3b6a
Gerrit-Change-Number: 32375
Gerrit-PatchSet: 1
Gerrit-Owner: Patrick Rudolph <patrick.rudolph@9elements.com>
Gerrit-MessageType: newchange