summaryrefslogtreecommitdiffstats
path: root/sys/i386
diff options
context:
space:
mode:
authorjkim <jkim@FreeBSD.org>2007-03-30 23:19:08 +0000
committerjkim <jkim@FreeBSD.org>2007-03-30 23:19:08 +0000
commitcfce99a4a78556cec08b185f51e0955a76fbf428 (patch)
tree4111dc8cc5c532e82b699b39dd6ce85ddfd89101 /sys/i386
parent68e1929a87132d2424d32053f0fa0e98974bcef4 (diff)
downloadFreeBSD-src-cfce99a4a78556cec08b185f51e0955a76fbf428.zip
FreeBSD-src-cfce99a4a78556cec08b185f51e0955a76fbf428.tar.gz
Fix off-by-4 error in address validation for i386, reduce PCB reloading, and
fix more style(9) nits. Pointed out by: bde Discussed with: kib Reviewd by: bde
Diffstat (limited to 'sys/i386')
-rw-r--r--sys/i386/i386/support.s25
1 files changed, 10 insertions, 15 deletions
diff --git a/sys/i386/i386/support.s b/sys/i386/i386/support.s
index 645a80f..546698e 100644
--- a/sys/i386/i386/support.s
+++ b/sys/i386/i386/support.s
@@ -1537,39 +1537,36 @@ NON_GPROF_ENTRY(__bb_init_func)
.text
futex_fault:
- movl PCPU(CURPCB),%edx
- movl $0,PCB_ONFAULT(%edx)
+ movl $0,PCB_ONFAULT(%ecx)
movl $-EFAULT,%eax
ret
/* int futex_xchgl(int oparg, caddr_t uaddr, int *oldval); */
ENTRY(futex_xchgl)
- movl PCPU(CURPCB),%eax
- movl $futex_fault,PCB_ONFAULT(%eax)
+ movl PCPU(CURPCB),%ecx
+ movl $futex_fault,PCB_ONFAULT(%ecx)
movl 4(%esp),%eax
movl 8(%esp),%edx
- cmpl $VM_MAXUSER_ADDRESS,%edx
+ cmpl $VM_MAXUSER_ADDRESS-4,%edx
ja futex_fault
#ifdef SMP
lock
#endif
xchgl %eax,(%edx)
- movl 0xc(%esp),%edx
+ movl 12(%esp),%edx
movl %eax,(%edx)
xorl %eax,%eax
-
- movl PCPU(CURPCB),%edx
- movl $0,PCB_ONFAULT(%edx)
+ movl $0,PCB_ONFAULT(%ecx)
ret
/* int futex_addl(int oparg, caddr_t uaddr, int *oldval); */
ENTRY(futex_addl)
- movl PCPU(CURPCB),%eax
- movl $futex_fault,PCB_ONFAULT(%eax)
+ movl PCPU(CURPCB),%ecx
+ movl $futex_fault,PCB_ONFAULT(%ecx)
movl 4(%esp),%eax
movl 8(%esp),%edx
- cmpl $VM_MAXUSER_ADDRESS,%edx
+ cmpl $VM_MAXUSER_ADDRESS-4,%edx
ja futex_fault
#ifdef SMP
@@ -1579,7 +1576,5 @@ ENTRY(futex_addl)
movl 12(%esp),%edx
movl %eax,(%edx)
xorl %eax,%eax
-
- movl PCPU(CURPCB),%edx
- movl $0,PCB_ONFAULT(%edx)
+ movl $0,PCB_ONFAULT(%ecx)
ret
OpenPOWER on IntegriCloud