diff options
author | Jeremy Kerr <jk@ozlabs.org> | 2018-02-20 13:35:58 +0800 |
---|---|---|
committer | Stewart Smith <stewart@linux.vnet.ibm.com> | 2018-02-21 13:28:08 +1100 |
commit | 237cd0c50a669af3aff4e804d19b785f7515179d (patch) | |
tree | 712bf5571f8e1af1348614e5aa0c1940504c7d8c /core/test | |
parent | 4c6539c1350418d83a86fec44ff1cc939152c383 (diff) | |
download | blackbird-skiboot-237cd0c50a669af3aff4e804d19b785f7515179d.tar.gz blackbird-skiboot-237cd0c50a669af3aff4e804d19b785f7515179d.zip |
core: Fix mismatched names between reserved memory nodes & properties
OPAL exposes reserved memory regions through the device tree in both new
(nodes) and old (properties) formats.
However, the names used for these don't match - we use a generated cell
address for the nodes, but the plain region name for the properties.
This change, heavily based on code from Oliver O'Halloran
<oohall@gmail.com>, reworks the dt-generation code to firstly generate
the new-format nodes, then uses those same names to generate the
property data.
Reported-by: Deb McLemore <debmc@linux.vnet.ibm.com>
CC: Oliver O'Halloran <oohall@gmail.com>
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
[stewart: fix test case]
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Diffstat (limited to 'core/test')
-rw-r--r-- | core/test/run-mem_region_reservations.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/core/test/run-mem_region_reservations.c b/core/test/run-mem_region_reservations.c index f593d9ad..ae885829 100644 --- a/core/test/run-mem_region_reservations.c +++ b/core/test/run-mem_region_reservations.c @@ -119,6 +119,7 @@ static void check_property_reservations(void) unsigned int i, l; const char *name; uint64_t *rangep; + const char *at; /* check dt properties */ names = dt_find_property(dt_root, "reserved-names"); @@ -137,7 +138,9 @@ static void check_property_reservations(void) l = strlen(name) + 1; for (i = 0; i < ARRAY_SIZE(test_regions); i++) { - if (strcmp(test_regions[i].name, name)) + at = strchr(name, '@'); + if (strncmp(test_regions[i].name, name, + at ? at-name: strlen(name))) continue; assert(test_regions[i].addr == addr); assert(!test_regions[i].found); |