Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/i386/stand/lib Compute real/protected %sp/%esp offs...



details:   https://anonhg.NetBSD.org/src/rev/69b55e0f64e9
branches:  trunk
changeset: 759896:69b55e0f64e9
user:      jakllsch <jakllsch%NetBSD.org@localhost>
date:      Sun Dec 19 17:18:23 2010 +0000

description:
Compute real/protected %sp/%esp offset in 'gdt_fixup' using all 32-bits.
Allows the case of %ss being less than %cs to work.
Also, completely save and restore the general-purpose registers we use.

diffstat:

 sys/arch/i386/stand/lib/realprot.S |  16 ++++++++--------
 1 files changed, 8 insertions(+), 8 deletions(-)

diffs (44 lines):

diff -r 7c75fc3975d2 -r 69b55e0f64e9 sys/arch/i386/stand/lib/realprot.S
--- a/sys/arch/i386/stand/lib/realprot.S        Sun Dec 19 17:17:50 2010 +0000
+++ b/sys/arch/i386/stand/lib/realprot.S        Sun Dec 19 17:18:23 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: realprot.S,v 1.9 2009/11/21 11:54:47 dsl Exp $ */
+/*     $NetBSD: realprot.S,v 1.10 2010/12/19 17:18:23 jakllsch Exp $   */
 
 /*-
  * Copyright (c) 2003 The NetBSD Foundation, Inc.
@@ -90,18 +90,18 @@
        .global gdt_fixup
 gdt_fixup:
        .code16
-       push    %ax
-       push    %dx
+       pushl   %eax
+       pushl   %edx
 
        xorl    %eax, %eax
        mov     %cs, %ax
        mov     %ax, ourseg
        /* sort out stuff for %ss != %ds */
+       xorl    %edx, %edx
        movw    %ss, %dx
        movw    %dx, stkseg
-       subw    %ax, %dx
-       shll    $16, %edx
-       shrl    $12, %edx
+       subl    %eax, %edx
+       shll    $4, %edx
        movl    %edx, stkdif
 
        /* fix up GDT entries for bootstrap */
@@ -121,8 +121,8 @@
        addl    $gdt, %eax
        movl    %eax, gdtarg+2
 
-       pop     %dx
-       pop     %ax
+       popl    %edx
+       popl    %eax
        ret
 
 /*



Home | Main Index | Thread Index | Old Index