- Add EFLAGS_IOPL to asm.h and make use of it in assembly

- Fix a potential 64-bit warning in handle.c
- Comment fixes

svn path=/trunk/; revision=35529
This commit is contained in:
Stefan Ginsberg 2008-08-22 14:29:01 +00:00
parent f1fe2984b3
commit 16ab5c9a07
9 changed files with 18 additions and 17 deletions

View file

@ -450,6 +450,7 @@ Author:
#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

View file

@ -59,7 +59,7 @@ ExpLookupHandleTableEntry(IN PHANDLE_TABLE HandleTable,
/* 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 @@ ExpFreeHandleTable(IN PHANDLE_TABLE HandleTable)
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();

View file

@ -74,7 +74,7 @@ ExpGetCurrentUserUILanguage(IN PWSTR MuiName,
/* 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))

View file

@ -36,7 +36,7 @@ _KiSystemStartup:
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

View file

@ -72,7 +72,7 @@ KeInitExceptions(VOID)
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 @@ KiRecordDr7(OUT PULONG Dr7Ptr,
/* 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 @@ ULONG
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 @@ KiSsFromTrapFrame(IN PKTRAP_FRAME TrapFrame)
}
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 @@ KeContextToTrapFrame(IN PCONTEXT Context,
}
/* 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);

View file

@ -132,7 +132,7 @@ Ke386InitThreadWithContext(IN PKTHREAD Thread,
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 */

View file

@ -1836,7 +1836,7 @@ NotGdt:
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 */

View file

@ -215,7 +215,7 @@ _OpcodePUSHFV86:
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 @@ NoPrefix:
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 @@ _OpcodeINTnnV86:
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 @@ _OpcodeIRETV86:
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 */

View file

@ -1142,7 +1142,7 @@ NtTerminateProcess(IN HANDLE ProcessHandle OPTIONAL,
/* 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 @@ NtTerminateProcess(IN HANDLE ProcessHandle OPTIONAL,
/* Also make sure the caller gave us our handle */
if (KillByHandle)
{
/* Dereference the project */
/* Dereference the process */
ObDereferenceObject(Process);
/* Terminate ourselves */