diff options
author | jkim <jkim@FreeBSD.org> | 2007-03-30 23:19:08 +0000 |
---|---|---|
committer | jkim <jkim@FreeBSD.org> | 2007-03-30 23:19:08 +0000 |
commit | cfce99a4a78556cec08b185f51e0955a76fbf428 (patch) | |
tree | 4111dc8cc5c532e82b699b39dd6ce85ddfd89101 /sys | |
parent | 68e1929a87132d2424d32053f0fa0e98974bcef4 (diff) | |
download | FreeBSD-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')
-rw-r--r-- | sys/amd64/amd64/support.S | 15 | ||||
-rw-r--r-- | sys/i386/i386/support.s | 25 |
2 files changed, 17 insertions, 23 deletions
diff --git a/sys/amd64/amd64/support.S b/sys/amd64/amd64/support.S index 2182d26..eede26a 100644 --- a/sys/amd64/amd64/support.S +++ b/sys/amd64/amd64/support.S @@ -693,15 +693,14 @@ NON_GPROF_ENTRY(__bb_init_func) .text futex_fault: - movq PCPU(CURPCB),%rdx - movq $0,PCB_ONFAULT(%rdx) + movq $0,PCB_ONFAULT(%rcx) movq $-EFAULT,%rax ret /* int futex_xchgl(int oparg, caddr_t uaddr, int *oldval); */ ENTRY(futex_xchgl) - movq PCPU(CURPCB),%r11 - movq $futex_fault,PCB_ONFAULT(%r11) + movq PCPU(CURPCB),%rcx + movq $futex_fault,PCB_ONFAULT(%rcx) movq $VM_MAXUSER_ADDRESS-4,%rax cmpq %rax,%rsi @@ -713,13 +712,13 @@ ENTRY(futex_xchgl) xchgl %edi,(%rsi) movl %edi,(%rdx) xorl %eax,%eax - movq %rax,PCB_ONFAULT(%r11) + movq %rax,PCB_ONFAULT(%rcx) ret /* int futex_addl(int oparg, caddr_t uaddr, int *oldval); */ ENTRY(futex_addl) - movq PCPU(CURPCB),%r11 - movq $futex_fault,PCB_ONFAULT(%r11) + movq PCPU(CURPCB),%rcx + movq $futex_fault,PCB_ONFAULT(%rcx) movq $VM_MAXUSER_ADDRESS-4,%rax cmpq %rax,%rsi @@ -731,5 +730,5 @@ ENTRY(futex_addl) xaddl %edi,(%rsi) movl %edi,(%rdx) xorl %eax,%eax - movq %rax,PCB_ONFAULT(%r11) + movq %rax,PCB_ONFAULT(%rcx) ret 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 |