[ros-bugs] [Bug 5071] New: intrin_i.h: sgdt & lgdt fixed for msvc

ReactOS.Bugzilla at reactos.org ReactOS.Bugzilla at reactos.org
Wed Dec 30 17:26:38 CET 2009


           Summary: intrin_i.h: sgdt & lgdt fixed for msvc
           Product: ReactOS
           Version: TRUNK
          Platform: VMWare 6
        OS/Version: Microsoft Windows XP
            Status: UNCONFIRMED
          Severity: blocker
          Priority: P3
         Component: Kernel
        AssignedTo: hackbunny at reactos.org
        ReportedBy: jc1 at diwaves.com
         QAContact: ros-bugs at reactos.org

In intrin_i.h there are two inline functions that are defined differently based
on __GNUC__ or _MSV_VER. The _MSC_VER ones make ntoskrnl crash early on boot.
As these functions were written, sgd & lgdt stored and loaded the gdt to/from
the pointer variable passed instead of the location the pointer points to.
Fixed and tested.
Couldn't cc to sginsberg at reactos.org, bugzilla doesn't know him
Patch follows:


Ke386GetGlobalDescriptorTable(OUT PVOID Descriptor)
-       __asm sgdt [Descriptor]
+       __asm {
+               mov ebx, Descriptor
+               sgdt [ebx];
+       }

Ke386SetGlobalDescriptorTable(IN PVOID Descriptor)
-       __asm lgdt [Descriptor]
+       __asm {
+               mov ebx, Descriptor;
+               lgdt [ebx];
+       }

Configure bugmail: http://www.reactos.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.

More information about the Ros-bugs mailing list