summaryrefslogtreecommitdiff
path: root/cbtable.c
diff options
context:
space:
mode:
authorhailfinger <hailfinger@2b7e53f0-3cfb-0310-b3e9-8179ed1497e1>2014-03-05 00:16:16 +0000
committerhailfinger <hailfinger@2b7e53f0-3cfb-0310-b3e9-8179ed1497e1>2014-03-05 00:16:16 +0000
commit0d66aa92097e085afa2656fc40753067fef25fda (patch)
tree4c51123a51fc9f3810ea6d646fbd453fd647b6b7 /cbtable.c
parentee55e5449046b8d681590536848db4f52a3c9344 (diff)
downloadflashrom-0d66aa92097e085afa2656fc40753067fef25fda.tar.gz
Clean up physmap, fix unaligned mapping problems
Convert all physmaps in dmi.c to use aligned readonly maps. Convert all physmaps in cbtable.c to use unaligned readonly maps. Make physunmap() a generic architecture-independent wrapper. Add physunmap_unaligned() to complement physmap*_unaligned(). Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net> Acked-by: Stefan Tauner <stefan.tauner@student.tuwien.ac.at> git-svn-id: https://code.coreboot.org/svn/flashrom/trunk@1765 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Diffstat (limited to 'cbtable.c')
-rw-r--r--cbtable.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/cbtable.c b/cbtable.c
index e5bcb45..c100bbb 100644
--- a/cbtable.c
+++ b/cbtable.c
@@ -261,7 +261,7 @@ int cb_parse_table(const char **vendor, const char **model)
#else
start = 0x0;
#endif
- table_area = physmap_ro("low megabyte", start, BYTES_TO_MAP - start);
+ table_area = physmap_ro_unaligned("low megabyte", start, BYTES_TO_MAP - start);
if (ERROR_PTR == table_area) {
msg_perr("Failed getting access to coreboot low tables.\n");
return -1;
@@ -276,8 +276,9 @@ int cb_parse_table(const char **vendor, const char **model)
if (forward->tag == LB_TAG_FORWARD) {
start = forward->forward;
start &= ~(getpagesize() - 1);
- physunmap(table_area, BYTES_TO_MAP);
- table_area = physmap_ro("high tables", start, BYTES_TO_MAP);
+ physunmap_unaligned(table_area, BYTES_TO_MAP);
+ // FIXME: table_area is never unmapped below, nor is it unmapped above in the no-forward case
+ table_area = physmap_ro_unaligned("high tables", start, BYTES_TO_MAP);
if (ERROR_PTR == table_area) {
msg_perr("Failed getting access to coreboot high tables.\n");
return -1;