From 55ad7b7d6ff33c6155fcf90a0d419315e815313e Mon Sep 17 00:00:00 2001 From: arun Date: Mon, 16 Aug 2004 22:09:58 +0000 Subject: The existing code fails some corner cases. Replace it with ia64_bsp_adjust() which has been tested to work in all cases for arbitrary (bsp, nslots) combinations. reviewed by: marcel@ --- sys/ia64/ia64/unaligned.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'sys/ia64') diff --git a/sys/ia64/ia64/unaligned.c b/sys/ia64/ia64/unaligned.c index 0b04f38..2124e99 100644 --- a/sys/ia64/ia64/unaligned.c +++ b/sys/ia64/ia64/unaligned.c @@ -74,16 +74,13 @@ static void * greg_ptr(mcontext_t *mc, int gr) { uint64_t *p; - int bias, nslots; + int nslots; if (gr <= 0 || gr >= 32 + (mc->mc_special.cfm & 0x7f)) return (NULL); if (gr >= 32) { - p = (void*)mc->mc_special.bspstore; - nslots = (mc->mc_special.cfm & 0x7f) - gr + 32; - bias = (0x1f8 - (mc->mc_special.bspstore & 0x1f8)) >> 3; - nslots += (nslots + bias) / 63; - p -= nslots; + nslots = IA64_CFM_SOF(mc->mc_special.cfm) - gr + 32; + p = (void *)ia64_bsp_adjust(mc->mc_special.bspstore, -nslots); gr = 0; } else if (gr >= 14) { p = &mc->mc_scratch.gr14; -- cgit v1.1