From 3b0708baaa383752c65fd09bd69d9d79e6857817 Mon Sep 17 00:00:00 2001 From: jhb Date: Thu, 25 Oct 2001 16:52:43 +0000 Subject: Use %ecx instead of %ebx for the scratch register while updating %dr7 since %ecx isn't a call safe register and thus we don't have to save and restore it. Submitted by: bde --- sys/amd64/amd64/cpu_switch.S | 8 +++----- sys/amd64/amd64/swtch.s | 8 +++----- sys/i386/i386/swtch.s | 8 +++----- 3 files changed, 9 insertions(+), 15 deletions(-) diff --git a/sys/amd64/amd64/cpu_switch.S b/sys/amd64/amd64/cpu_switch.S index 97958fc..c664c29 100644 --- a/sys/amd64/amd64/cpu_switch.S +++ b/sys/amd64/amd64/cpu_switch.S @@ -281,11 +281,9 @@ cpu_switch_load_gs: movl %eax,%dr0 movl %dr7,%eax /* load dr7 so as not to */ andl $0x0000fc00,%eax /* disturb reserved bits */ - pushl %ebx - movl PCB_DR7(%edx),%ebx - andl $~0x0000fc00,%ebx /* re-enable the restored watchpoints */ - orl %ebx,%eax - popl %ebx + movl PCB_DR7(%edx),%ecx + andl $~0x0000fc00,%ecx /* re-enable the restored watchpoints */ + orl %ecx,%eax movl %eax,%dr7 1: ret diff --git a/sys/amd64/amd64/swtch.s b/sys/amd64/amd64/swtch.s index 97958fc..c664c29 100644 --- a/sys/amd64/amd64/swtch.s +++ b/sys/amd64/amd64/swtch.s @@ -281,11 +281,9 @@ cpu_switch_load_gs: movl %eax,%dr0 movl %dr7,%eax /* load dr7 so as not to */ andl $0x0000fc00,%eax /* disturb reserved bits */ - pushl %ebx - movl PCB_DR7(%edx),%ebx - andl $~0x0000fc00,%ebx /* re-enable the restored watchpoints */ - orl %ebx,%eax - popl %ebx + movl PCB_DR7(%edx),%ecx + andl $~0x0000fc00,%ecx /* re-enable the restored watchpoints */ + orl %ecx,%eax movl %eax,%dr7 1: ret diff --git a/sys/i386/i386/swtch.s b/sys/i386/i386/swtch.s index 97958fc..c664c29 100644 --- a/sys/i386/i386/swtch.s +++ b/sys/i386/i386/swtch.s @@ -281,11 +281,9 @@ cpu_switch_load_gs: movl %eax,%dr0 movl %dr7,%eax /* load dr7 so as not to */ andl $0x0000fc00,%eax /* disturb reserved bits */ - pushl %ebx - movl PCB_DR7(%edx),%ebx - andl $~0x0000fc00,%ebx /* re-enable the restored watchpoints */ - orl %ebx,%eax - popl %ebx + movl PCB_DR7(%edx),%ecx + andl $~0x0000fc00,%ecx /* re-enable the restored watchpoints */ + orl %ecx,%eax movl %eax,%dr7 1: ret -- cgit v1.1