Edward O'Callaghan has uploaded this change for review.

View Change

programmer: Use correct type for flashbase

The flashbase is a machine-sized integer representation of
address space and so use the appropriate type that is correctly
sized to encode such data.

Spotted-by: Martin Roth <martin.roth@amd.corp-partner.google.com>
Change-Id: Ib9057e438731b9cccde0e24d5c8f758c3af1d47f
Signed-off-by: Edward O'Callaghan <quasisec@google.com>
---
M flashrom.c
M include/programmer.h
2 files changed, 18 insertions(+), 2 deletions(-)

git pull ssh://review.coreboot.org:29418/flashrom refs/changes/28/75328/1
diff --git a/flashrom.c b/flashrom.c
index 19afb54..b6e5cf8 100644
--- a/flashrom.c
+++ b/flashrom.c
@@ -21,6 +21,7 @@

#include <stdbool.h>
#include <stdio.h>
+#include <stdint.h>
#include <sys/types.h>
#include <string.h>
#include <unistd.h>
@@ -48,7 +49,7 @@
struct decode_sizes max_rom_decode;

/* If nonzero, used as the start address of bottom-aligned flash. */
-unsigned long flashbase;
+uintptr_t flashbase;

/* Is writing allowed with this programmer? */
bool programmer_may_write;
diff --git a/include/programmer.h b/include/programmer.h
index 5b304f5..562f58a 100644
--- a/include/programmer.h
+++ b/include/programmer.h
@@ -292,7 +292,7 @@
// FIXME: These need to be local, not global
extern struct decode_sizes max_rom_decode;
extern bool programmer_may_write;
-extern unsigned long flashbase;
+extern uintptr_t flashbase; /* used in programmer_enable.c */
char *extract_programmer_param_str(const struct programmer_cfg *cfg, const char *param_name);

/* spi.c */

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

Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: Ib9057e438731b9cccde0e24d5c8f758c3af1d47f
Gerrit-Change-Number: 75328
Gerrit-PatchSet: 1
Gerrit-Owner: Edward O'Callaghan <quasisec@chromium.org>
Gerrit-MessageType: newchange