summaryrefslogtreecommitdiffstats
path: root/sys/ia64
diff options
context:
space:
mode:
authorarun <arun@FreeBSD.org>2004-08-16 22:09:58 +0000
committerarun <arun@FreeBSD.org>2004-08-16 22:09:58 +0000
commit55ad7b7d6ff33c6155fcf90a0d419315e815313e (patch)
tree888b9a3dbf8ab037c0cf91562add33e49421fc97 /sys/ia64
parent9950f2481beaa17a6e718d0943a59783f9c962cd (diff)
downloadFreeBSD-src-55ad7b7d6ff33c6155fcf90a0d419315e815313e.zip
FreeBSD-src-55ad7b7d6ff33c6155fcf90a0d419315e815313e.tar.gz
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@
Diffstat (limited to 'sys/ia64')
-rw-r--r--sys/ia64/ia64/unaligned.c9
1 files changed, 3 insertions, 6 deletions
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;
OpenPOWER on IntegriCloud