From 91857d3a8cf3727b512d2e6de93bc306f1966f49 Mon Sep 17 00:00:00 2001 From: "Igor V. Kovalenko" Date: Wed, 3 Feb 2010 17:54:14 +0000 Subject: [PATCH] pathres: consistently encode unit address on 64bit target This change fixes node unit address matching on arch where cell is not 4 byte integer (tested with sparc64.) Since we encode "reg" property chunks with encode-int we need to use the same encoding while preparing unit phys addr for comparison at path resolution time. - (exact-match): calculate phys addr length using 4 byte member encoding with /l* not cells - find-child: encode phys addr components similar to encode-int with 4 byte stores Signed-off-by: Igor V. Kovalenko Signed-off-by: Blue Swirl git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@674 f158a5a8-5612-0410-a976-696ce0be7e32 --- forth/device/pathres.fs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/forth/device/pathres.fs b/forth/device/pathres.fs index 4184d07..f248e8d 100644 --- a/forth/device/pathres.fs +++ b/forth/device/pathres.fs @@ -125,7 +125,7 @@ constant sinfo.size r@ common-match \ b) UNIT_PHYS nonempty? - r@ >si.unit_phys_len @ cells ?dup if + r@ >si.unit_phys_len @ /l* ?dup if \ check if unit_phys matches " reg" r@ >si.child @ get-package-property if -3 throw then ( unitbytes propaddr proplen ) @@ -191,7 +191,7 @@ constant sinfo.size ( ... a_lo ... a_hi olddepth n ) r@ >si.unit_phys >r begin 1- dup 0>= while - rot r> dup na1+ >r ! + rot r> dup la1+ >r l!-be repeat r> 2drop depth!