Author: tfaber
Date: Mon May 11 12:27:54 2015
New Revision: 67653
URL: http://svn.reactos.org/svn/reactos?rev=67653&view=rev
Log:
[CRT]
- Add missing __INTRIN_INLINE for x64 intrinsics
Modified:
trunk/reactos/include/crt/mingw32/intrin_x86.h
Modified: trunk/reactos/include/crt/mingw32/intrin_x86.h
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/include/crt/mingw32/intrin…
==============================================================================
--- trunk/reactos/include/crt/mingw32/intrin_x86.h [iso-8859-1] (original)
+++ trunk/reactos/include/crt/mingw32/intrin_x86.h [iso-8859-1] Mon May 11 12:27:54 2015
@@ -1253,12 +1253,12 @@
}
#ifdef __x86_64__
-unsigned long long __lzcnt64(unsigned long long value)
+__INTRIN_INLINE unsigned long long __lzcnt64(unsigned long long value)
{
return __builtin_clzll(value);
}
-unsigned long long __popcnt64(unsigned long long value)
+__INTRIN_INLINE unsigned long long __popcnt64(unsigned long long value)
{
return __builtin_popcountll(value);
}
Author: aandrejevic
Date: Sun May 10 23:50:33 2015
New Revision: 67647
URL: http://svn.reactos.org/svn/reactos?rev=67647&view=rev
Log:
[FAST486]
The LMSW instruction doesn't #GP when the program tries to return to real mode.
Rather, it just doesn't happen (the PE bit remains 1).
Modified:
trunk/reactos/lib/fast486/opgroups.c
Modified: trunk/reactos/lib/fast486/opgroups.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/lib/fast486/opgroups.c?rev…
==============================================================================
--- trunk/reactos/lib/fast486/opgroups.c [iso-8859-1] (original)
+++ trunk/reactos/lib/fast486/opgroups.c [iso-8859-1] Sun May 10 23:50:33 2015
@@ -2239,11 +2239,14 @@
{
USHORT MachineStatusWord;
- /* This is a privileged instruction */
- if (Fast486GetCurrentPrivLevel(State) != 0)
- {
- Fast486Exception(State, FAST486_EXCEPTION_GP);
- return;
+ if (State->ControlRegisters[FAST486_REG_CR0] & FAST486_CR0_PE)
+ {
+ /* This is a privileged instruction */
+ if (Fast486GetCurrentPrivLevel(State) != 0)
+ {
+ Fast486Exception(State, FAST486_EXCEPTION_GP);
+ return;
+ }
}
/* Read the new Machine Status Word */
@@ -2253,16 +2256,8 @@
return;
}
- /* This instruction cannot be used to return to real mode */
- if ((State->ControlRegisters[FAST486_REG_CR0] & FAST486_CR0_PE)
- && !(MachineStatusWord & FAST486_CR0_PE))
- {
- Fast486Exception(State, FAST486_EXCEPTION_GP);
- return;
- }
-
- /* Set the lowest 4 bits */
- State->ControlRegisters[FAST486_REG_CR0] &= 0xFFFFFFF0;
+ /* Set the lowest 4 bits, but never clear bit 0 */
+ State->ControlRegisters[FAST486_REG_CR0] &= 0xFFFFFFF1;
State->ControlRegisters[FAST486_REG_CR0] |= MachineStatusWord & 0x0F;
break;