From c885c20e96eceaf2b36349fda423be6e354c343a Mon Sep 17 00:00:00 2001 From: Matthew Dillon Date: Thu, 8 May 2008 01:21:06 +0000 Subject: [PATCH] Clear the direction flag (CLD) on entry to the kernel, to support future kernels compiled with GCC-4.3 or later. --- sys/platform/pc32/apic/apic_vector.s | 3 ++- sys/platform/pc32/i386/exception.s | 6 +++++- sys/platform/pc32/i386/support.s | 4 ++-- sys/platform/pc32/icu/icu_vector.s | 3 ++- 4 files changed, 11 insertions(+), 5 deletions(-) diff --git a/sys/platform/pc32/apic/apic_vector.s b/sys/platform/pc32/apic/apic_vector.s index b6a00d037f..783a28ada2 100644 --- a/sys/platform/pc32/apic/apic_vector.s +++ b/sys/platform/pc32/apic/apic_vector.s @@ -1,7 +1,7 @@ /* * from: vector.s, 386BSD 0.1 unknown origin * $FreeBSD: src/sys/i386/isa/apic_vector.s,v 1.47.2.5 2001/09/01 22:33:38 tegge Exp $ - * $DragonFly: src/sys/platform/pc32/apic/apic_vector.s,v 1.37 2008/01/14 15:27:16 dillon Exp $ + * $DragonFly: src/sys/platform/pc32/apic/apic_vector.s,v 1.38 2008/05/08 01:21:06 dillon Exp $ */ #include "use_npx.h" @@ -47,6 +47,7 @@ pushl %es ; \ pushl %fs ; \ pushl %gs ; \ + cld ; \ mov $KDSEL,%ax ; \ mov %ax,%ds ; \ mov %ax,%es ; \ diff --git a/sys/platform/pc32/i386/exception.s b/sys/platform/pc32/i386/exception.s index 1ea86a8474..c65f37d182 100644 --- a/sys/platform/pc32/i386/exception.s +++ b/sys/platform/pc32/i386/exception.s @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/i386/i386/exception.s,v 1.65.2.3 2001/08/15 01:23:49 peter Exp $ - * $DragonFly: src/sys/platform/pc32/i386/exception.s,v 1.31 2007/01/22 19:37:04 corecode Exp $ + * $DragonFly: src/sys/platform/pc32/i386/exception.s,v 1.32 2008/05/08 01:21:04 dillon Exp $ */ #include "use_npx.h" @@ -715,6 +715,7 @@ IDTVEC(fpu) pushl %es pushl %fs pushl %gs + cld mov $KDSEL,%ax mov %ax,%ds mov %ax,%es @@ -766,6 +767,7 @@ alltraps: pushl %es pushl %fs pushl %gs + cld .globl alltraps_with_regs_pushed alltraps_with_regs_pushed: mov $KDSEL,%ax @@ -816,6 +818,7 @@ IDTVEC(syscall) pushl %es pushl %fs pushl %gs + cld mov $KDSEL,%ax /* switch to kernel segments */ mov %ax,%ds mov %ax,%es @@ -858,6 +861,7 @@ IDTVEC(int0x80_syscall) pushl %es pushl %fs pushl %gs + cld mov $KDSEL,%ax /* switch to kernel segments */ mov %ax,%ds mov %ax,%es diff --git a/sys/platform/pc32/i386/support.s b/sys/platform/pc32/i386/support.s index ee41b1f862..b4858fd382 100644 --- a/sys/platform/pc32/i386/support.s +++ b/sys/platform/pc32/i386/support.s @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/i386/i386/support.s,v 1.67.2.5 2001/08/15 01:23:50 peter Exp $ - * $DragonFly: src/sys/platform/pc32/i386/support.s,v 1.20 2007/11/07 17:42:50 dillon Exp $ + * $DragonFly: src/sys/platform/pc32/i386/support.s,v 1.21 2008/05/08 01:21:04 dillon Exp $ */ #include "use_npx.h" @@ -201,7 +201,7 @@ ENTRY(copyout) ja copyout_fault1 /* - * Convert copyout to memcpy_vector(dest:%edi, src:%esi, conut:%ecx) + * Convert copyout to memcpy_vector(dest:%edi, src:%esi, count:%ecx) */ movl %ebx,%ecx call *memcpy_vector diff --git a/sys/platform/pc32/icu/icu_vector.s b/sys/platform/pc32/icu/icu_vector.s index a490d3a6fe..f5cbbf2323 100644 --- a/sys/platform/pc32/icu/icu_vector.s +++ b/sys/platform/pc32/icu/icu_vector.s @@ -1,7 +1,7 @@ /* * from: vector.s, 386BSD 0.1 unknown origin * $FreeBSD: src/sys/i386/isa/icu_vector.s,v 1.14.2.2 2000/07/18 21:12:42 dfr Exp $ - * $DragonFly: src/sys/platform/pc32/icu/icu_vector.s,v 1.31 2008/01/14 15:27:17 dillon Exp $ + * $DragonFly: src/sys/platform/pc32/icu/icu_vector.s,v 1.32 2008/05/08 01:21:02 dillon Exp $ */ /* * WARNING! SMP builds can use the ICU now so this code must be MP safe. @@ -69,6 +69,7 @@ pushl %es ; \ pushl %fs ; \ pushl %gs ; \ + cld ; \ mov $KDSEL,%ax ; \ mov %ax,%ds ; \ mov %ax,%es ; \ -- 2.41.0