Author: sginsberg
Date: Fri Aug 22 09:29:01 2008
New Revision: 35529
URL:
http://svn.reactos.org/svn/reactos?rev=35529&view=rev
Log:
- Add EFLAGS_IOPL to asm.h and make use of it in assembly
- Fix a potential 64-bit warning in handle.c
- Comment fixes
Modified:
trunk/reactos/include/ndk/asm.h
trunk/reactos/ntoskrnl/ex/handle.c
trunk/reactos/ntoskrnl/ex/locale.c
trunk/reactos/ntoskrnl/ke/i386/boot.S
trunk/reactos/ntoskrnl/ke/i386/exp.c
trunk/reactos/ntoskrnl/ke/i386/thrdini.c
trunk/reactos/ntoskrnl/ke/i386/trap.s
trunk/reactos/ntoskrnl/ke/i386/v86m_sup.S
trunk/reactos/ntoskrnl/ps/kill.c
Modified: trunk/reactos/include/ndk/asm.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/ndk/asm.h?rev=3552…
==============================================================================
--- trunk/reactos/include/ndk/asm.h [iso-8859-1] (original)
+++ trunk/reactos/include/ndk/asm.h [iso-8859-1] Fri Aug 22 09:29:01 2008
@@ -450,6 +450,7 @@
#ifdef __ASM__
#define EFLAGS_TF 0x100
#define EFLAGS_INTERRUPT_MASK 0x200
+#define EFLAGS_IOPL 0x3000
#define EFLAGS_NESTED_TASK 0x4000
#define EFLAGS_V86_MASK 0x20000
#define EFLAGS_ALIGN_CHECK 0x40000
Modified: trunk/reactos/ntoskrnl/ex/handle.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ex/handle.c?rev=3…
==============================================================================
--- trunk/reactos/ntoskrnl/ex/handle.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/ex/handle.c [iso-8859-1] Fri Aug 22 09:29:01 2008
@@ -59,7 +59,7 @@
/* Direct index */
case 0:
- /* Use level 1 and just get the entry directlry */
+ /* Use level 1 and just get the entry directly */
Level1 = (PUCHAR)TableBase;
Entry = (PVOID)&Level1[Handle.Value *
(sizeof(HANDLE_TABLE_ENTRY) /
@@ -210,8 +210,8 @@
PEPROCESS Process = HandleTable->QuotaProcess;
ULONG i, j;
ULONG_PTR TableCode = HandleTable->TableCode;
- ULONG TableLevel = TableCode & 3;
ULONG_PTR TableBase = TableCode & ~3;
+ ULONG TableLevel = (ULONG)(TableCode & 3);
PHANDLE_TABLE_ENTRY Level1, *Level2, **Level3;
PAGED_CODE();
Modified: trunk/reactos/ntoskrnl/ex/locale.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ex/locale.c?rev=3…
==============================================================================
--- trunk/reactos/ntoskrnl/ex/locale.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/ex/locale.c [iso-8859-1] Fri Aug 22 09:29:01 2008
@@ -74,7 +74,7 @@
/* Success, is the value the right type? */
if (ValueInfo->Type == REG_SZ)
{
- /* It is. Initailize the data and convert it */
+ /* It is. Initialize the data and convert it */
RtlInitUnicodeString(&ValueString, (PWSTR)ValueInfo->Data);
Status = RtlUnicodeStringToInteger(&ValueString, 16, &Value);
if (NT_SUCCESS(Status))
Modified: trunk/reactos/ntoskrnl/ke/i386/boot.S
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ke/i386/boot.S?re…
==============================================================================
--- trunk/reactos/ntoskrnl/ke/i386/boot.S [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/ke/i386/boot.S [iso-8859-1] Fri Aug 22 09:29:01 2008
@@ -36,7 +36,7 @@
test dword ptr [esp+4], 0x80000000
jnz _KiSystemStartupReal@4
- /* FREELDR Boot: Cal the FreeLDR wrapper */
+ /* FREELDR Boot: Call the FreeLDR wrapper */
jmp @KiRosPrepareForSystemStartup@8
.endfunc
Modified: trunk/reactos/ntoskrnl/ke/i386/exp.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ke/i386/exp.c?rev…
==============================================================================
--- trunk/reactos/ntoskrnl/ke/i386/exp.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/ke/i386/exp.c [iso-8859-1] Fri Aug 22 09:29:01 2008
@@ -72,7 +72,7 @@
extern KIDTENTRY KiIdt[MAXIMUM_IDTVECTOR];
/* Loop the IDT */
- for (i = 0; i <= MAXIMUM_IDTVECTOR; i ++)
+ for (i = 0; i <= MAXIMUM_IDTVECTOR; i++)
{
/* Save the current Selector */
FlippedSelector = KiIdt[i].Selector;
@@ -113,7 +113,7 @@
/* Check if the caller gave us a mask */
if (!DrMask)
{
- /* He didn't use the one from the thread */
+ /* He didn't, use the one from the thread */
Mask = KeGetCurrentThread()->DispatcherHeader.DebugActive;
}
else
@@ -266,7 +266,7 @@
NTAPI
KiSsFromTrapFrame(IN PKTRAP_FRAME TrapFrame)
{
- /* If this was V86 Mode */
+ /* Check if this was V86 Mode */
if (TrapFrame->EFlags & EFLAGS_V86_MASK)
{
/* Just return it */
@@ -274,7 +274,7 @@
}
else if (TrapFrame->SegCs & MODE_MASK)
{
- /* Usermode, return the User SS */
+ /* User mode, return the User SS */
return TrapFrame->HardwareSegSs | RPL_MASK;
}
else
@@ -599,7 +599,7 @@
}
/* Check if thread has IOPL and force it enabled if so */
- if (KeGetCurrentThread()->Iopl) TrapFrame->EFlags |= 0x3000;
+ if (KeGetCurrentThread()->Iopl) TrapFrame->EFlags |= EFLAGS_IOPL;
/* Restore IRQL */
if (OldIrql < APC_LEVEL) KeLowerIrql(OldIrql);
Modified: trunk/reactos/ntoskrnl/ke/i386/thrdini.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ke/i386/thrdini.c…
==============================================================================
--- trunk/reactos/ntoskrnl/ke/i386/thrdini.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/ke/i386/thrdini.c [iso-8859-1] Fri Aug 22 09:29:01 2008
@@ -132,7 +132,7 @@
Thread->NpxState = NPX_STATE_NOT_LOADED &~ CR0_MP;
}
- /* Disable any debug regiseters */
+ /* Disable any debug registers */
Context->ContextFlags &= ~CONTEXT_DEBUG_REGISTERS;
/* Setup the Trap Frame */
Modified: trunk/reactos/ntoskrnl/ke/i386/trap.s
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ke/i386/trap.s?re…
==============================================================================
--- trunk/reactos/ntoskrnl/ke/i386/trap.s [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/ke/i386/trap.s [iso-8859-1] Fri Aug 22 09:29:01 2008
@@ -1836,7 +1836,7 @@
CheckRing3Io:
/* Get EFLAGS and IOPL */
mov ebx, [ebp+KTRAP_FRAME_EFLAGS]
- and ebx, 0x3000
+ and ebx, EFLAGS_IOPL
shr ebx, 12
/* Check the CS's RPL mask */
Modified: trunk/reactos/ntoskrnl/ke/i386/v86m_sup.S
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ke/i386/v86m_sup.…
==============================================================================
--- trunk/reactos/ntoskrnl/ke/i386/v86m_sup.S [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/ke/i386/v86m_sup.S [iso-8859-1] Fri Aug 22 09:29:01 2008
@@ -215,7 +215,7 @@
or eax, edx
/* Add IOPL Mask */
- or eax, 0x3000
+ or eax, EFLAGS_IOPL
/* Get flat ESP */
movzx ecx, word ptr [ebp+KTRAP_FRAME_SS]
@@ -277,7 +277,7 @@
mov [ebp+KTRAP_FRAME_ESP], edx
/* Mask out EFLAGS */
- and eax, ~0x3000
+ and eax, ~EFLAGS_IOPL
mov ebx, ebx
and ebx, ~0x4000
and ecx, EFLAGS_ALIGN_CHECK + 0x4000 + EFLAGS_INTERRUPT_MASK
@@ -353,7 +353,7 @@
mov [ebp+KTRAP_FRAME_EFLAGS], edx
/* Set the IOPL Mask */
- or eax, 0x3000
+ or eax, EFLAGS_IOPL
/* Get stack flat address */
movzx ecx, word ptr [ebp+KTRAP_FRAME_SS]
@@ -450,7 +450,7 @@
MaskEFlags:
/* Mask out EFLAGS */
- and ebx, ~(0x3000 + EFLAGS_VIF + 0x4000 + EFLAGS_VIP)
+ and ebx, ~(EFLAGS_IOPL + EFLAGS_VIF + 0x4000 + EFLAGS_VIP)
mov ecx, ebx
/* FIXME: Check for VME support */
Modified: trunk/reactos/ntoskrnl/ps/kill.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ps/kill.c?rev=355…
==============================================================================
--- trunk/reactos/ntoskrnl/ps/kill.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/ps/kill.c [iso-8859-1] Fri Aug 22 09:29:01 2008
@@ -1142,7 +1142,7 @@
/* Lock the Process */
if (!ExAcquireRundownProtection(&Process->RundownProtect))
{
- /* Failed to lock, fal */
+ /* Failed to lock, fail */
ObDereferenceObject (Process);
return STATUS_PROCESS_IS_TERMINATING;
}
@@ -1182,7 +1182,7 @@
/* Also make sure the caller gave us our handle */
if (KillByHandle)
{
- /* Dereference the project */
+ /* Dereference the process */
ObDereferenceObject(Process);
/* Terminate ourselves */