aboutsummaryrefslogtreecommitdiff
path: root/external
diff options
context:
space:
mode:
authorOliver O'Halloran <oohall@gmail.com>2017-11-30 16:31:22 +1100
committerStewart Smith <stewart@linux.vnet.ibm.com>2017-12-01 00:54:47 -0600
commitaee9b0218454b09e6e2e0f4c0b7045326299264c (patch)
tree106cb01cfee7c553f37f8781f6238467a08c7744 /external
parent4717bc7bc8591628d40429ae7911f80e20b6c7f8 (diff)
downloadskiboot-aee9b0218454b09e6e2e0f4c0b7045326299264c.zip
skiboot-aee9b0218454b09e6e2e0f4c0b7045326299264c.tar.gz
skiboot-aee9b0218454b09e6e2e0f4c0b7045326299264c.tar.bz2
gard: Allow records with an ID of 0xffffffff
We currently assume that a record with an ID of 0xffffffff is invalid. Apparently this is incorrect and we should display these records, so expand the check to compare the entire record with 0xff rather than just the ID. Signed-off-by: Oliver O'Halloran <oohall@gmail.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Diffstat (limited to 'external')
-rw-r--r--external/gard/gard.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/external/gard/gard.c b/external/gard/gard.c
index a491516..c280bbf 100644
--- a/external/gard/gard.c
+++ b/external/gard/gard.c
@@ -42,8 +42,6 @@
#include "gard.h"
-#define CLEARED_RECORD_ID 0xFFFFFFFF
-
#define FDT_PATH "/proc/device-tree"
#define FDT_FSP_NODE FDT_PATH"/fsps"
#define FDT_ACTIVE_FLASH_PATH FDT_PATH"/chosen/ibm,system-flash"
@@ -326,9 +324,11 @@ int parse_path(const char *str, struct entity_path *parsed)
return 0;
}
+static struct gard_record blank_record;
+
static bool is_valid_record(struct gard_record *g)
{
- return be32toh(g->record_id) != CLEARED_RECORD_ID;
+ return memcmp(&blank_record, g, sizeof(*g));
}
static int do_iterate(struct gard_ctx *ctx,
@@ -806,6 +806,7 @@ int main(int argc, char **argv)
ctx = &_ctx;
memset(ctx, 0, sizeof(*ctx));
+ memset(&blank_record, 0xff, sizeof(blank_record));
if (is_fsp()) {
fprintf(stderr, "This is the OpenPower gard tool which does "