aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBruce Evans <bde@FreeBSD.org>2002-01-17 17:49:23 +0000
committerBruce Evans <bde@FreeBSD.org>2002-01-17 17:49:23 +0000
commite744f30933170c2edde832886636f2c5179f4de9 (patch)
tree2100d26b7e6ca16285349cbf6a1a72c315a1cb67
parent825ce531a6c2177214bd87f9a7550f4bc4cdeac9 (diff)
Notes
-rw-r--r--sys/amd64/amd64/cpu_switch.S8
-rw-r--r--sys/amd64/amd64/swtch.s8
-rw-r--r--sys/amd64/include/pcb.h2
-rw-r--r--sys/i386/i386/swtch.s8
-rw-r--r--sys/i386/include/pcb.h2
-rw-r--r--sys/kern/subr_trap.c2
6 files changed, 12 insertions, 18 deletions
diff --git a/sys/amd64/amd64/cpu_switch.S b/sys/amd64/amd64/cpu_switch.S
index ae967c4f0813..230c2fdd2c2a 100644
--- a/sys/amd64/amd64/cpu_switch.S
+++ b/sys/amd64/amd64/cpu_switch.S
@@ -98,8 +98,7 @@ ENTRY(cpu_switch)
movl %gs,PCB_GS(%edx)
/* Test if debug registers should be saved. */
- movb PCB_FLAGS(%edx),%al
- andb $PCB_DBREGS,%al
+ testl $PCB_DBREGS,PCB_FLAGS(%edx)
jz 1f /* no, skip over */
movl %dr7,%eax /* yes, do the save */
movl %eax,PCB_DR7(%edx)
@@ -271,9 +270,8 @@ sw1b:
cpu_switch_load_gs:
movl PCB_GS(%edx),%gs
- /* Test if debug regisers should be restored. */
- movb PCB_FLAGS(%edx),%al
- andb $PCB_DBREGS,%al
+ /* Test if debug registers should be restored. */
+ testl $PCB_DBREGS,PCB_FLAGS(%edx)
jz 1f
/*
diff --git a/sys/amd64/amd64/swtch.s b/sys/amd64/amd64/swtch.s
index ae967c4f0813..230c2fdd2c2a 100644
--- a/sys/amd64/amd64/swtch.s
+++ b/sys/amd64/amd64/swtch.s
@@ -98,8 +98,7 @@ ENTRY(cpu_switch)
movl %gs,PCB_GS(%edx)
/* Test if debug registers should be saved. */
- movb PCB_FLAGS(%edx),%al
- andb $PCB_DBREGS,%al
+ testl $PCB_DBREGS,PCB_FLAGS(%edx)
jz 1f /* no, skip over */
movl %dr7,%eax /* yes, do the save */
movl %eax,PCB_DR7(%edx)
@@ -271,9 +270,8 @@ sw1b:
cpu_switch_load_gs:
movl PCB_GS(%edx),%gs
- /* Test if debug regisers should be restored. */
- movb PCB_FLAGS(%edx),%al
- andb $PCB_DBREGS,%al
+ /* Test if debug registers should be restored. */
+ testl $PCB_DBREGS,PCB_FLAGS(%edx)
jz 1f
/*
diff --git a/sys/amd64/include/pcb.h b/sys/amd64/include/pcb.h
index 9eb0f819c57d..d4a375a20788 100644
--- a/sys/amd64/include/pcb.h
+++ b/sys/amd64/include/pcb.h
@@ -62,7 +62,7 @@ struct pcb {
int pcb_dr7;
union savefpu pcb_save;
- u_char pcb_flags;
+ u_int pcb_flags;
#define FP_SOFTFP 0x01 /* process using software fltng pnt emulator */
#define PCB_DBREGS 0x02 /* process using debug registers */
#define PCB_NPXTRAP 0x04 /* npx trap pending */
diff --git a/sys/i386/i386/swtch.s b/sys/i386/i386/swtch.s
index ae967c4f0813..230c2fdd2c2a 100644
--- a/sys/i386/i386/swtch.s
+++ b/sys/i386/i386/swtch.s
@@ -98,8 +98,7 @@ ENTRY(cpu_switch)
movl %gs,PCB_GS(%edx)
/* Test if debug registers should be saved. */
- movb PCB_FLAGS(%edx),%al
- andb $PCB_DBREGS,%al
+ testl $PCB_DBREGS,PCB_FLAGS(%edx)
jz 1f /* no, skip over */
movl %dr7,%eax /* yes, do the save */
movl %eax,PCB_DR7(%edx)
@@ -271,9 +270,8 @@ sw1b:
cpu_switch_load_gs:
movl PCB_GS(%edx),%gs
- /* Test if debug regisers should be restored. */
- movb PCB_FLAGS(%edx),%al
- andb $PCB_DBREGS,%al
+ /* Test if debug registers should be restored. */
+ testl $PCB_DBREGS,PCB_FLAGS(%edx)
jz 1f
/*
diff --git a/sys/i386/include/pcb.h b/sys/i386/include/pcb.h
index 9eb0f819c57d..d4a375a20788 100644
--- a/sys/i386/include/pcb.h
+++ b/sys/i386/include/pcb.h
@@ -62,7 +62,7 @@ struct pcb {
int pcb_dr7;
union savefpu pcb_save;
- u_char pcb_flags;
+ u_int pcb_flags;
#define FP_SOFTFP 0x01 /* process using software fltng pnt emulator */
#define PCB_DBREGS 0x02 /* process using debug registers */
#define PCB_NPXTRAP 0x04 /* npx trap pending */
diff --git a/sys/kern/subr_trap.c b/sys/kern/subr_trap.c
index 46a19b76664d..722ef92bb9ca 100644
--- a/sys/kern/subr_trap.c
+++ b/sys/kern/subr_trap.c
@@ -173,7 +173,7 @@ ast(framep)
}
#if defined(DEV_NPX) && !defined(SMP)
if (PCPU_GET(curpcb)->pcb_flags & PCB_NPXTRAP) {
- atomic_clear_char(&PCPU_GET(curpcb)->pcb_flags,
+ atomic_clear_int(&PCPU_GET(curpcb)->pcb_flags,
PCB_NPXTRAP);
ucode = npxtrap();
if (ucode != -1) {