From 64c33bb910012c35c64dec2f457a436e3cecbc98 Mon Sep 17 00:00:00 2001 From: Eric Kohl Date: Sun, 4 Jun 2000 19:51:05 +0000 Subject: [PATCH] Fixed STDCALL issues in Ke functions Renamed KiTimerInterrupt() to KeUpdateSystemTime() Added KeNumberProcessors variable svn path=/trunk/; revision=1175 --- reactos/include/ddk/kefuncs.h | 574 +++++++++++++++++++++++++-------- reactos/include/ddk/ketypes.h | 7 + reactos/include/internal/ke.h | 1 - reactos/ntoskrnl/hal/x86/irq.c | 4 +- reactos/ntoskrnl/ke/apc.c | 32 +- reactos/ntoskrnl/ke/bug.c | 44 ++- reactos/ntoskrnl/ke/critical.c | 17 +- reactos/ntoskrnl/ke/dpc.c | 42 ++- reactos/ntoskrnl/ke/event.c | 34 +- reactos/ntoskrnl/ke/kqueue.c | 38 ++- reactos/ntoskrnl/ke/main.c | 3 +- reactos/ntoskrnl/ke/mutex.c | 38 ++- reactos/ntoskrnl/ke/process.c | 17 +- reactos/ntoskrnl/ke/sem.c | 32 +- reactos/ntoskrnl/ke/spinlock.c | 42 ++- reactos/ntoskrnl/ke/timer.c | 91 +++++- reactos/ntoskrnl/ke/wait.c | 34 +- reactos/ntoskrnl/ps/thread.c | 22 +- reactos/ntoskrnl/ps/tinfo.c | 6 +- 19 files changed, 816 insertions(+), 262 deletions(-) diff --git a/reactos/include/ddk/kefuncs.h b/reactos/include/ddk/kefuncs.h index 83126a4f8ac..ea5795a4b6b 100644 --- a/reactos/include/ddk/kefuncs.h +++ b/reactos/include/ddk/kefuncs.h @@ -1,23 +1,15 @@ #ifndef __INCLUDE_DDK_KEFUNCS_H #define __INCLUDE_DDK_KEFUNCS_H + /* KERNEL FUNCTIONS ********************************************************/ -VOID KeInitializeApc(PKAPC Apc, - PKTHREAD Thread, - UCHAR StateIndex, - PKKERNEL_ROUTINE KernelRoutine, - PKRUNDOWN_ROUTINE RundownRoutine, - PKNORMAL_ROUTINE NormalRoutine, - UCHAR Mode, - PVOID Context); +VOID +STDCALL +KeAttachProcess ( + struct _EPROCESS* Process + ); -VOID KeInsertQueueApc(PKAPC Apc, - PVOID SystemArgument1, - PVOID SystemArgument2, - UCHAR Mode); -VOID KeAttachProcess(struct _EPROCESS* Process); -VOID KeDetachProcess(VOID); VOID KeDrainApcQueue(VOID); PKPROCESS KeGetCurrentProcess(VOID); @@ -28,127 +20,31 @@ PKPROCESS KeGetCurrentProcess(VOID); * SpinLock = Initialized spinlock * OldIrql (OUT) = Set the previous irql on return */ -VOID KeAcquireSpinLock(PKSPIN_LOCK SpinLock, PKIRQL OldIrql); - -VOID KeAcquireSpinLockAtDpcLevel(PKSPIN_LOCK SpinLock); -BOOLEAN KeCancelTimer(PKTIMER Timer); -VOID KeClearEvent(PKEVENT Event); -NTSTATUS STDCALL KeDelayExecutionThread (KPROCESSOR_MODE WaitMode, - BOOLEAN Alertable, - PLARGE_INTEGER Internal); -BOOLEAN KeDeregisterBugCheckCallback(PKBUGCHECK_CALLBACK_RECORD - CallbackRecord); -VOID KeEnterCriticalRegion(VOID); -VOID KeFlushIoBuffers(PMDL Mdl, BOOLEAN ReadOperation, BOOLEAN DmaOperation); -KIRQL -STDCALL -KeGetCurrentIrql ( - VOID - ); -ULONG KeGetCurrentProcessorNumber(VOID); -ULONG KeGetDcacheFillSize(VOID); -PKTHREAD KeGetCurrentThread(VOID); -ULONG KeGetPreviousMode(VOID); -VOID KeInitializeCallbackRecord(PKBUGCHECK_CALLBACK_RECORD CallbackRecord); -VOID KeInitializeDeviceQueue(PKDEVICE_QUEUE DeviceQueue); -VOID KeInitializeDpc(PKDPC Dpc, PKDEFERRED_ROUTINE DeferredRoutine, - PVOID DeferredContext); -VOID KeInitializeEvent(PKEVENT Event, EVENT_TYPE Type, BOOLEAN State); -VOID KeInitializeMutex(PKMUTEX Mutex, ULONG Level); -VOID KeInitializeSemaphore(PKSEMAPHORE Semaphore, LONG Count, LONG Limit); -VOID KeInitializeTimer(PKTIMER Timer); -VOID KeInitializeTimerEx(PKTIMER Timer, TIMER_TYPE Type); -BOOLEAN KeInsertByKeyDeviceQueue(PKDEVICE_QUEUE DeviceQueue, - PKDEVICE_QUEUE_ENTRY DeviceQueueEntry, - ULONG SortKey); -BOOLEAN KeInsertDeviceQueue(PKDEVICE_QUEUE DeviceQueue, - PKDEVICE_QUEUE_ENTRY DeviceQueueEntry); -BOOLEAN KeInsertQueueDpc(PKDPC Dpc, PVOID SystemArgument1, - PVOID SystemArgument2); -VOID KeLeaveCriticalRegion(VOID); VOID STDCALL -KeLowerIrql ( - KIRQL NewIrql +KeAcquireSpinLock ( + PKSPIN_LOCK SpinLock, + PKIRQL OldIrql ); -LARGE_INTEGER KeQueryPerformanceCounter(PLARGE_INTEGER PerformanceFrequency); -VOID KeQuerySystemTime(PLARGE_INTEGER CurrentTime); -VOID KeQueryTickCount(PLARGE_INTEGER TickCount); -ULONG KeQueryTimeIncrement(VOID); + VOID STDCALL -KeRaiseIrql ( - KIRQL NewIrql, - PKIRQL OldIrql +KeAcquireSpinLockAtDpcLevel ( + PKSPIN_LOCK SpinLock ); -LONG KeReadStateEvent(PKEVENT Event); -LONG KeReadStateMutex(PKMUTEX Mutex); -LONG KeReadStateSemaphore(PKSEMAPHORE Semaphore); -BOOLEAN KeReadStateTimer(PKTIMER Timer); -BOOLEAN KeRegisterBugCheckCallback(PKBUGCHECK_CALLBACK_RECORD CallbackRecord, - PKBUGCHECK_CALLBACK_ROUTINE CallbackRoutine, - PVOID Buffer, - ULONG Length, - PUCHAR Component); -LONG KeReleaseMutex(PKMUTEX Mutex, BOOLEAN Wait); -LONG KeReleaseSemaphore(PKSEMAPHORE Semaphore, KPRIORITY Increment, - LONG Adjustment, BOOLEAN Wait); -VOID KeReleaseSpinLock(PKSPIN_LOCK Spinlock, KIRQL NewIrql); -VOID KeReleaseSpinLockFromDpcLevel(PKSPIN_LOCK Spinlock); -PKDEVICE_QUEUE_ENTRY KeRemoveByKeyDeviceQueue(PKDEVICE_QUEUE DeviceQueue, - ULONG SortKey); -PKDEVICE_QUEUE_ENTRY KeRemoveDeviceQueue(PKDEVICE_QUEUE DeviceQueue); -BOOLEAN KeRemoveEntryDeviceQueue(PKDEVICE_QUEUE DeviceQueue, - PKDEVICE_QUEUE_ENTRY DeviceQueueEntry); -BOOLEAN KeRemoveQueueDpc(PKDPC Dpc); -LONG KeResetEvent(PKEVENT Event); -LONG KeSetBasePriorityThread(PKTHREAD Thread, LONG Increment); -LONG KeSetEvent(PKEVENT Event, KPRIORITY Increment, BOOLEAN Wait); -KPRIORITY KeSetPriorityThread(PKTHREAD Thread, KPRIORITY Priority); -BOOLEAN KeSetTimer(PKTIMER Timer, LARGE_INTEGER DueTime, PKDPC Dpc); -BOOLEAN KeSetTimerEx(PKTIMER Timer, - LARGE_INTEGER DueTime, - LONG Period, - PKDPC Dpc); -VOID STDCALL KeStallExecutionProcessor(ULONG MicroSeconds); -BOOLEAN KeSynchronizeExecution(PKINTERRUPT Interrupt, - PKSYNCHRONIZE_ROUTINE SynchronizeRoutine, - PVOID SynchronizeContext); -NTSTATUS KeWaitForMultipleObjects(ULONG Count, - PVOID Object[], - WAIT_TYPE WaitType, - KWAIT_REASON WaitReason, - KPROCESSOR_MODE WaitMode, - BOOLEAN Alertable, - PLARGE_INTEGER Timeout, - PKWAIT_BLOCK WaitBlockArray); -NTSTATUS KeWaitForMutexObject(PKMUTEX Mutex, - KWAIT_REASON WaitReason, - KPROCESSOR_MODE WaitMode, - BOOLEAN Alertable, - PLARGE_INTEGER Timeout); -NTSTATUS KeWaitForSingleObject(PVOID Object, - KWAIT_REASON WaitReason, - KPROCESSOR_MODE WaitMode, - BOOLEAN Alertable, - PLARGE_INTEGER Timeout); - -/* - * FUNCTION: Initializes a spinlock - * ARGUMENTS: - * SpinLock = Spinlock to initialize - */ -VOID KeInitializeSpinLock(PKSPIN_LOCK SpinLock); - -/* - * FUNCTION: Sets the current irql without altering the current processor - * state - * ARGUMENTS: - * newlvl = IRQ level to set - * NOTE: This is for internal use only - */ -VOID KeSetCurrentIrql(KIRQL newlvl); +/* + * FUNCTION: Brings the system down in a controlled manner when an + * inconsistency that might otherwise cause corruption has been detected + * ARGUMENTS: + * BugCheckCode = Specifies the reason for the bug check + * RETURNS: Doesn't + */ +VOID +STDCALL +KeBugCheck ( + ULONG BugCheckCode + ); /* * FUNCTION: Brings the system down in a controlled manner when an @@ -158,20 +54,422 @@ VOID KeSetCurrentIrql(KIRQL newlvl); * BugCheckParameter[1-4] = Additional information about bug * RETURNS: Doesn't */ -VOID KeBugCheckEx(ULONG BugCheckCode, - ULONG BugCheckParameter1, - ULONG BugCheckParameter2, - ULONG BugCheckParameter3, - ULONG BugCheckParameter4); +VOID +STDCALL +KeBugCheckEx ( + ULONG BugCheckCode, + ULONG BugCheckParameter1, + ULONG BugCheckParameter2, + ULONG BugCheckParameter3, + ULONG BugCheckParameter4 + ); + +BOOLEAN +STDCALL +KeCancelTimer ( + PKTIMER Timer + ); + +VOID +STDCALL +KeClearEvent ( + PKEVENT Event + ); + +NTSTATUS STDCALL KeDelayExecutionThread (KPROCESSOR_MODE WaitMode, + BOOLEAN Alertable, + PLARGE_INTEGER Internal); +BOOLEAN +STDCALL +KeDeregisterBugCheckCallback ( + PKBUGCHECK_CALLBACK_RECORD CallbackRecord + ); + +VOID +STDCALL +KeDetachProcess ( + VOID + ); + +VOID +STDCALL +KeEnterCriticalRegion ( + VOID + ); + +VOID KeFlushIoBuffers(PMDL Mdl, BOOLEAN ReadOperation, BOOLEAN DmaOperation); + +KIRQL +STDCALL +KeGetCurrentIrql ( + VOID + ); + +ULONG KeGetCurrentProcessorNumber(VOID); + +PKTHREAD +STDCALL +KeGetCurrentThread ( + VOID + ); + +ULONG KeGetDcacheFillSize(VOID); + +ULONG +STDCALL +KeGetPreviousMode ( + VOID + ); + +VOID +STDCALL +KeInitializeApc ( + PKAPC Apc, + PKTHREAD Thread, + UCHAR StateIndex, + PKKERNEL_ROUTINE KernelRoutine, + PKRUNDOWN_ROUTINE RundownRoutine, + PKNORMAL_ROUTINE NormalRoutine, + UCHAR Mode, + PVOID Context + ); + + +VOID KeInitializeCallbackRecord(PKBUGCHECK_CALLBACK_RECORD CallbackRecord); + +VOID +STDCALL +KeInitializeDeviceQueue ( + PKDEVICE_QUEUE DeviceQueue + ); + +VOID +STDCALL +KeInitializeDpc ( + PKDPC Dpc, + PKDEFERRED_ROUTINE DeferredRoutine, + PVOID DeferredContext + ); + +VOID +STDCALL +KeInitializeEvent ( + PKEVENT Event, + EVENT_TYPE Type, + BOOLEAN State + ); + +VOID +STDCALL +KeInitializeMutex ( + PKMUTEX Mutex, + ULONG Level + ); + +VOID +STDCALL +KeInitializeSemaphore ( + PKSEMAPHORE Semaphore, + LONG Count, + LONG Limit + ); /* - * FUNCTION: Brings the system down in a controlled manner when an - * inconsistency that might otherwise cause corruption has been detected + * FUNCTION: Initializes a spinlock * ARGUMENTS: - * BugCheckCode = Specifies the reason for the bug check - * RETURNS: Doesn't + * SpinLock = Spinlock to initialize */ -VOID KeBugCheck(ULONG BugCheckCode); +VOID +STDCALL +KeInitializeSpinLock ( + PKSPIN_LOCK SpinLock + ); + +VOID +STDCALL +KeInitializeTimer ( + PKTIMER Timer + ); + +VOID +STDCALL +KeInitializeTimerEx ( + PKTIMER Timer, + TIMER_TYPE Type + ); + +BOOLEAN +STDCALL +KeInsertByKeyDeviceQueue ( + PKDEVICE_QUEUE DeviceQueue, + PKDEVICE_QUEUE_ENTRY DeviceQueueEntry, + ULONG SortKey + ); + +BOOLEAN +STDCALL +KeInsertDeviceQueue ( + PKDEVICE_QUEUE DeviceQueue, + PKDEVICE_QUEUE_ENTRY DeviceQueueEntry + ); + +VOID +STDCALL +KeInsertQueueApc ( + PKAPC Apc, + PVOID SystemArgument1, + PVOID SystemArgument2, + UCHAR Mode + ); + +BOOLEAN +STDCALL +KeInsertQueueDpc ( + PKDPC Dpc, + PVOID SystemArgument1, + PVOID SystemArgument2 + ); + +VOID +STDCALL +KeLeaveCriticalRegion ( + VOID + ); + +VOID +STDCALL +KeLowerIrql ( + KIRQL NewIrql + ); + +LARGE_INTEGER +STDCALL +KeQueryPerformanceCounter ( + PLARGE_INTEGER PerformanceFrequency + ); + +VOID +STDCALL +KeQuerySystemTime ( + PLARGE_INTEGER CurrentTime + ); + +VOID +STDCALL +KeQueryTickCount ( + PLARGE_INTEGER TickCount + ); + +ULONG +STDCALL +KeQueryTimeIncrement ( + VOID + ); + +VOID +STDCALL +KeRaiseIrql ( + KIRQL NewIrql, + PKIRQL OldIrql + ); + +LONG +STDCALL +KeReadStateEvent ( + PKEVENT Event + ); + +LONG +STDCALL +KeReadStateMutex ( + PKMUTEX Mutex + ); + +LONG +STDCALL +KeReadStateSemaphore ( + PKSEMAPHORE Semaphore + ); + +BOOLEAN +STDCALL +KeReadStateTimer ( + PKTIMER Timer + ); + +BOOLEAN +STDCALL +KeRegisterBugCheckCallback ( + PKBUGCHECK_CALLBACK_RECORD CallbackRecord, + PKBUGCHECK_CALLBACK_ROUTINE CallbackRoutine, + PVOID Buffer, + ULONG Length, + PUCHAR Component + ); + +LONG +STDCALL +KeReleaseMutex ( + PKMUTEX Mutex, + BOOLEAN Wait + ); + +LONG +STDCALL +KeReleaseSemaphore ( + PKSEMAPHORE Semaphore, + KPRIORITY Increment, + LONG Adjustment, + BOOLEAN Wait + ); + +VOID +STDCALL +KeReleaseSpinLock ( + PKSPIN_LOCK Spinlock, + KIRQL NewIrql + ); + +VOID +STDCALL +KeReleaseSpinLockFromDpcLevel ( + PKSPIN_LOCK Spinlock + ); + +PKDEVICE_QUEUE_ENTRY +STDCALL +KeRemoveByKeyDeviceQueue ( + PKDEVICE_QUEUE DeviceQueue, + ULONG SortKey + ); + +PKDEVICE_QUEUE_ENTRY +STDCALL +KeRemoveDeviceQueue ( + PKDEVICE_QUEUE DeviceQueue + ); + +BOOLEAN +STDCALL +KeRemoveEntryDeviceQueue ( + PKDEVICE_QUEUE DeviceQueue, + PKDEVICE_QUEUE_ENTRY DeviceQueueEntry + ); + +BOOLEAN +STDCALL +KeRemoveQueueDpc ( + PKDPC Dpc + ); + +LONG +STDCALL +KeResetEvent ( + PKEVENT Event + ); + +LONG +STDCALL +KeSetBasePriorityThread ( + PKTHREAD Thread, + LONG Increment + ); + +LONG +STDCALL +KeSetEvent ( + PKEVENT Event, + KPRIORITY Increment, + BOOLEAN Wait + ); + +KPRIORITY +STDCALL +KeSetPriorityThread ( + PKTHREAD Thread, + KPRIORITY Priority + ); + +BOOLEAN +STDCALL +KeSetTimer ( + PKTIMER Timer, + LARGE_INTEGER DueTime, + PKDPC Dpc + ); + +BOOLEAN +STDCALL +KeSetTimerEx ( + PKTIMER Timer, + LARGE_INTEGER DueTime, + LONG Period, + PKDPC Dpc + ); + +VOID +STDCALL +KeStallExecutionProcessor ( + ULONG MicroSeconds + ); + +BOOLEAN +STDCALL +KeSynchronizeExecution ( + PKINTERRUPT Interrupt, + PKSYNCHRONIZE_ROUTINE SynchronizeRoutine, + PVOID SynchronizeContext + ); + +VOID +STDCALL +KeUpdateSystemTime ( + VOID + ); + +NTSTATUS +STDCALL +KeWaitForMultipleObjects ( + ULONG Count, + PVOID Object[], + WAIT_TYPE WaitType, + KWAIT_REASON WaitReason, + KPROCESSOR_MODE WaitMode, + BOOLEAN Alertable, + PLARGE_INTEGER Timeout, + PKWAIT_BLOCK WaitBlockArray + ); + +NTSTATUS +STDCALL +KeWaitForMutexObject ( + PKMUTEX Mutex, + KWAIT_REASON WaitReason, + KPROCESSOR_MODE WaitMode, + BOOLEAN Alertable, + PLARGE_INTEGER Timeout + ); + +NTSTATUS +STDCALL +KeWaitForSingleObject ( + PVOID Object, + KWAIT_REASON WaitReason, + KPROCESSOR_MODE WaitMode, + BOOLEAN Alertable, + PLARGE_INTEGER Timeout + ); + + +/* + * FUNCTION: Sets the current irql without altering the current processor + * state + * ARGUMENTS: + * newlvl = IRQ level to set + * NOTE: This is for internal use only + */ +VOID KeSetCurrentIrql(KIRQL newlvl); + // io permission map has a 8k size // Each bit in the IOPM corresponds to an io port byte address. The bitmap diff --git a/reactos/include/ddk/ketypes.h b/reactos/include/ddk/ketypes.h index 29b5c9b9bb9..c3dca54647b 100644 --- a/reactos/include/ddk/ketypes.h +++ b/reactos/include/ddk/ketypes.h @@ -3,6 +3,13 @@ #ifndef __INCLUDE_DDK_KETYPES_H #define __INCLUDE_DDK_KETYPES_H +#ifdef __NTOSKRNL__ +extern CHAR EXPORTED KeNumberProcessors; +#else +extern CHAR IMPORTED KeNumberProcessors; +#endif + + struct _KMUTANT; typedef LONG KPRIORITY; diff --git a/reactos/include/internal/ke.h b/reactos/include/internal/ke.h index e5935b9e93a..71da6429835 100644 --- a/reactos/include/internal/ke.h +++ b/reactos/include/internal/ke.h @@ -21,7 +21,6 @@ BOOLEAN KeDispatcherObjectWake(DISPATCHER_HEADER* hdr); VOID KiInterruptDispatch(ULONG irq); VOID KiDispatchInterrupt(ULONG irq); -VOID KiTimerInterrupt(VOID); VOID KeDrainDpcQueue(VOID); VOID KeExpireTimers(VOID); NTSTATUS KeAddThreadTimeout(PKTHREAD Thread, PLARGE_INTEGER Interval); diff --git a/reactos/ntoskrnl/hal/x86/irq.c b/reactos/ntoskrnl/hal/x86/irq.c index aeb180860fe..0c13a8e1431 100644 --- a/reactos/ntoskrnl/hal/x86/irq.c +++ b/reactos/ntoskrnl/hal/x86/irq.c @@ -1,4 +1,4 @@ -/* $Id: irq.c,v 1.11 2000/04/09 15:58:13 ekohl Exp $ +/* $Id: irq.c,v 1.12 2000/06/04 19:49:37 ekohl Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -123,7 +123,7 @@ asmlinkage VOID KiInterruptDispatch(ULONG irq) if (irq==0) { - KiTimerInterrupt(); + KeUpdateSystemTime (); } else { diff --git a/reactos/ntoskrnl/ke/apc.c b/reactos/ntoskrnl/ke/apc.c index 254c64608dd..5a74acb9ee8 100644 --- a/reactos/ntoskrnl/ke/apc.c +++ b/reactos/ntoskrnl/ke/apc.c @@ -133,10 +133,14 @@ VOID KeCallApcsThread(VOID) // Thread->Tcb.WaitStatus = STATUS_KERNEL_APC; } -VOID KeInsertQueueApc(PKAPC Apc, - PVOID SystemArgument1, - PVOID SystemArgument2, - UCHAR Mode) +VOID +STDCALL +KeInsertQueueApc ( + PKAPC Apc, + PVOID SystemArgument1, + PVOID SystemArgument2, + UCHAR Mode + ) /* * FUNCTION: Queues an APC for execution * ARGUMENTS: @@ -200,14 +204,18 @@ VOID KeInsertQueueApc(PKAPC Apc, } } -VOID KeInitializeApc(PKAPC Apc, - PKTHREAD Thread, - UCHAR StateIndex, - PKKERNEL_ROUTINE KernelRoutine, - PKRUNDOWN_ROUTINE RundownRoutine, - PKNORMAL_ROUTINE NormalRoutine, - UCHAR Mode, - PVOID Context) +VOID +STDCALL +KeInitializeApc ( + PKAPC Apc, + PKTHREAD Thread, + UCHAR StateIndex, + PKKERNEL_ROUTINE KernelRoutine, + PKRUNDOWN_ROUTINE RundownRoutine, + PKNORMAL_ROUTINE NormalRoutine, + UCHAR Mode, + PVOID Context + ) /* * FUNCTION: Initialize an APC object * ARGUMENTS: diff --git a/reactos/ntoskrnl/ke/bug.c b/reactos/ntoskrnl/ke/bug.c index 754debdeba7..26b7e76b023 100644 --- a/reactos/ntoskrnl/ke/bug.c +++ b/reactos/ntoskrnl/ke/bug.c @@ -1,4 +1,5 @@ -/* +/* $Id: bug.c,v 1.11 2000/06/04 19:50:12 ekohl Exp $ + * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel * FILE: ntoskrnl/ke/bug.c @@ -25,7 +26,11 @@ VOID PsDumpThreads(VOID); /* FUNCTIONS *****************************************************************/ -BOOLEAN KeDeregisterBugCheckCallback(PKBUGCHECK_CALLBACK_RECORD CallbackRecord) +BOOLEAN +STDCALL +KeDeregisterBugCheckCallback ( + PKBUGCHECK_CALLBACK_RECORD CallbackRecord + ) { UNIMPLEMENTED; } @@ -41,11 +46,15 @@ VOID KeInitializeCallbackRecord(PKBUGCHECK_CALLBACK_RECORD CallbackRecord) UNIMPLEMENTED; } -BOOLEAN KeRegisterBugCheckCallback(PKBUGCHECK_CALLBACK_RECORD CallbackRecord, - PKBUGCHECK_CALLBACK_ROUTINE CallbackRoutine, - PVOID Buffer, - ULONG Length, - PUCHAR Component) +BOOLEAN +STDCALL +KeRegisterBugCheckCallback ( + PKBUGCHECK_CALLBACK_RECORD CallbackRecord, + PKBUGCHECK_CALLBACK_ROUTINE CallbackRoutine, + PVOID Buffer, + ULONG Length, + PUCHAR Component + ) { InsertTailList(&BugcheckCallbackListHead,&CallbackRecord->Entry); CallbackRecord->Length=Length; @@ -55,11 +64,15 @@ BOOLEAN KeRegisterBugCheckCallback(PKBUGCHECK_CALLBACK_RECORD CallbackRecord, return(TRUE); } -VOID KeBugCheckEx(ULONG BugCheckCode, - ULONG BugCheckParameter1, - ULONG BugCheckParameter2, - ULONG BugCheckParameter3, - ULONG BugCheckParameter4) +VOID +STDCALL +KeBugCheckEx ( + ULONG BugCheckCode, + ULONG BugCheckParameter1, + ULONG BugCheckParameter2, + ULONG BugCheckParameter3, + ULONG BugCheckParameter4 + ) /* * FUNCTION: Brings the system down in a controlled manner when an * inconsistency that might otherwise cause corruption has been detected @@ -80,7 +93,11 @@ VOID KeBugCheckEx(ULONG BugCheckCode, __asm__("hlt\n\t"); //PJS: use HLT instruction, rather than busy wait } -VOID KeBugCheck(ULONG BugCheckCode) +VOID +STDCALL +KeBugCheck ( + ULONG BugCheckCode + ) /* * FUNCTION: Brings the system down in a controlled manner when an * inconsistency that might otherwise cause corruption has been detected @@ -105,3 +122,4 @@ VOID KeBugCheck(ULONG BugCheckCode) } } +/* EOF */ diff --git a/reactos/ntoskrnl/ke/critical.c b/reactos/ntoskrnl/ke/critical.c index 301240ed5cc..2a7311467a8 100644 --- a/reactos/ntoskrnl/ke/critical.c +++ b/reactos/ntoskrnl/ke/critical.c @@ -1,4 +1,5 @@ -/* +/* $Id: critical.c,v 1.4 2000/06/04 19:50:12 ekohl Exp $ + * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel * FILE: ntoskrnl/ke/critical.c @@ -17,14 +18,24 @@ /* FUNCTIONS *****************************************************************/ -VOID KeEnterCriticalRegion() +VOID +STDCALL +KeEnterCriticalRegion ( + VOID + ) { DPRINT("KeEnterCriticalRegion()\n"); KeGetCurrentThread()->KernelApcDisable -= 1; } -VOID KeLeaveCriticalRegion() +VOID +STDCALL +KeLeaveCriticalRegion ( + VOID + ) { DPRINT("KeLeaveCriticalRegion()\n"); KeGetCurrentThread()->KernelApcDisable += 1; } + +/* EOF */ diff --git a/reactos/ntoskrnl/ke/dpc.c b/reactos/ntoskrnl/ke/dpc.c index 414e7a4c002..c11ec5ab788 100644 --- a/reactos/ntoskrnl/ke/dpc.c +++ b/reactos/ntoskrnl/ke/dpc.c @@ -30,8 +30,13 @@ ULONG DpcQueueSize = 0; /* FUNCTIONS ****************************************************************/ -VOID KeInitializeDpc(PKDPC Dpc, PKDEFERRED_ROUTINE DeferredRoutine, - PVOID DeferredContext) +VOID +STDCALL +KeInitializeDpc ( + PKDPC Dpc, + PKDEFERRED_ROUTINE DeferredRoutine, + PVOID DeferredContext + ) /* * FUNCTION: Initalizes a DPC * ARGUMENTS: @@ -93,7 +98,11 @@ void KeDrainDpcQueue(void) } } -BOOLEAN KeRemoveQueueDpc(PKDPC Dpc) +BOOLEAN +STDCALL +KeRemoveQueueDpc ( + PKDPC Dpc + ) /* * FUNCTION: Removes DPC object from the system dpc queue * ARGUMENTS: @@ -118,8 +127,13 @@ BOOLEAN KeRemoveQueueDpc(PKDPC Dpc) return(TRUE); } -BOOLEAN KeInsertQueueDpc(PKDPC dpc, PVOID SystemArgument1, - PVOID SystemArgument2) +BOOLEAN +STDCALL +KeInsertQueueDpc ( + PKDPC Dpc, + PVOID SystemArgument1, + PVOID SystemArgument2 + ) /* * FUNCTION: Queues a DPC for execution when the IRQL of a processor * drops below DISPATCH_LEVEL @@ -132,24 +146,24 @@ BOOLEAN KeInsertQueueDpc(PKDPC dpc, PVOID SystemArgument1, { KIRQL oldlvl; DPRINT("KeInsertQueueDpc(dpc %x, SystemArgument1 %x, SystemArgument2 %x)\n", - dpc, SystemArgument1, SystemArgument2); + Dpc, SystemArgument1, SystemArgument2); assert(KeGetCurrentIrql()>=DISPATCH_LEVEL); - dpc->Number=0; - dpc->Importance=Medium; - dpc->SystemArgument1=SystemArgument1; - dpc->SystemArgument2=SystemArgument2; - if (dpc->Lock) + Dpc->Number=0; + Dpc->Importance=Medium; + Dpc->SystemArgument1=SystemArgument1; + Dpc->SystemArgument2=SystemArgument2; + if (Dpc->Lock) { return(FALSE); } KeRaiseIrql( HIGH_LEVEL, &oldlvl ); KeAcquireSpinLockAtDpcLevel(&DpcQueueLock); - InsertHeadList(&DpcQueueHead,&dpc->DpcListEntry); - DPRINT("dpc->DpcListEntry.Flink %x\n", dpc->DpcListEntry.Flink); + InsertHeadList(&DpcQueueHead,&Dpc->DpcListEntry); + DPRINT("Dpc->DpcListEntry.Flink %x\n", Dpc->DpcListEntry.Flink); DpcQueueSize++; - dpc->Lock=(PULONG)1; + Dpc->Lock=(PULONG)1; KeReleaseSpinLock( &DpcQueueLock, oldlvl ); DPRINT("DpcQueueHead.Flink %x\n",DpcQueueHead.Flink); DPRINT("Leaving KeInsertQueueDpc()\n",0); diff --git a/reactos/ntoskrnl/ke/event.c b/reactos/ntoskrnl/ke/event.c index 1823e0d739a..e84d7fddbc2 100644 --- a/reactos/ntoskrnl/ke/event.c +++ b/reactos/ntoskrnl/ke/event.c @@ -18,13 +18,23 @@ /* FUNCTIONS ****************************************************************/ -VOID KeClearEvent(PKEVENT Event) +VOID +STDCALL +KeClearEvent ( + PKEVENT Event + ) { DPRINT("KeClearEvent(Event %x)\n", Event); Event->Header.SignalState=FALSE; } -VOID KeInitializeEvent(PKEVENT Event, EVENT_TYPE Type, BOOLEAN State) +VOID +STDCALL +KeInitializeEvent ( + PKEVENT Event, + EVENT_TYPE Type, + BOOLEAN State + ) { ULONG IType; @@ -48,17 +58,31 @@ VOID KeInitializeEvent(PKEVENT Event, EVENT_TYPE Type, BOOLEAN State) InitializeListHead(&(Event->Header.WaitListHead)); } -LONG KeReadStateEvent(PKEVENT Event) +LONG +STDCALL +KeReadStateEvent ( + PKEVENT Event + ) { return(Event->Header.SignalState); } -LONG KeResetEvent(PKEVENT Event) +LONG +STDCALL +KeResetEvent ( + PKEVENT Event + ) { return(InterlockedExchange(&(Event->Header.SignalState),0)); } -LONG KeSetEvent(PKEVENT Event, KPRIORITY Increment, BOOLEAN Wait) +LONG +STDCALL +KeSetEvent ( + PKEVENT Event, + KPRIORITY Increment, + BOOLEAN Wait + ) { int ret; diff --git a/reactos/ntoskrnl/ke/kqueue.c b/reactos/ntoskrnl/ke/kqueue.c index 907393173b5..2afd0d33680 100644 --- a/reactos/ntoskrnl/ke/kqueue.c +++ b/reactos/ntoskrnl/ke/kqueue.c @@ -23,9 +23,13 @@ VOID InsertBeforeEntryInList(PLIST_ENTRY Head, PLIST_ENTRY After, InsertHeadList(After, Entry); } -BOOLEAN KeInsertByKeyDeviceQueue(PKDEVICE_QUEUE DeviceQueue, - PKDEVICE_QUEUE_ENTRY DeviceQueueEntry, - ULONG SortKey) +BOOLEAN +STDCALL +KeInsertByKeyDeviceQueue ( + PKDEVICE_QUEUE DeviceQueue, + PKDEVICE_QUEUE_ENTRY DeviceQueueEntry, + ULONG SortKey + ) { KIRQL oldlvl; PLIST_ENTRY current; @@ -64,8 +68,12 @@ BOOLEAN KeInsertByKeyDeviceQueue(PKDEVICE_QUEUE DeviceQueue, return(TRUE); } -PKDEVICE_QUEUE_ENTRY KeRemoveByKeyDeviceQueue(PKDEVICE_QUEUE DeviceQueue, - ULONG SortKey) +PKDEVICE_QUEUE_ENTRY +STDCALL +KeRemoveByKeyDeviceQueue ( + PKDEVICE_QUEUE DeviceQueue, + ULONG SortKey + ) { KIRQL oldlvl; PLIST_ENTRY current; @@ -95,7 +103,11 @@ PKDEVICE_QUEUE_ENTRY KeRemoveByKeyDeviceQueue(PKDEVICE_QUEUE DeviceQueue, return(NULL); } -PKDEVICE_QUEUE_ENTRY KeRemoveDeviceQueue(PKDEVICE_QUEUE DeviceQueue) +PKDEVICE_QUEUE_ENTRY +STDCALL +KeRemoveDeviceQueue ( + PKDEVICE_QUEUE DeviceQueue + ) /* * FUNCTION: Removes an entry from a device queue * ARGUMENTS: @@ -128,7 +140,11 @@ PKDEVICE_QUEUE_ENTRY KeRemoveDeviceQueue(PKDEVICE_QUEUE DeviceQueue) return(entry); } -VOID KeInitializeDeviceQueue(PKDEVICE_QUEUE DeviceQueue) +VOID +STDCALL +KeInitializeDeviceQueue ( + PKDEVICE_QUEUE DeviceQueue + ) /* * FUNCTION: Intializes a device queue * ARGUMENTS: @@ -141,8 +157,12 @@ VOID KeInitializeDeviceQueue(PKDEVICE_QUEUE DeviceQueue) KeInitializeSpinLock(&DeviceQueue->Lock); } -BOOLEAN KeInsertDeviceQueue(PKDEVICE_QUEUE DeviceQueue, - PKDEVICE_QUEUE_ENTRY DeviceQueueEntry) +BOOLEAN +STDCALL +KeInsertDeviceQueue ( + PKDEVICE_QUEUE DeviceQueue, + PKDEVICE_QUEUE_ENTRY DeviceQueueEntry + ) /* * FUNCTION: Inserts an entry in a device queue * ARGUMENTS: diff --git a/reactos/ntoskrnl/ke/main.c b/reactos/ntoskrnl/ke/main.c index 522128f6631..43427e58b39 100644 --- a/reactos/ntoskrnl/ke/main.c +++ b/reactos/ntoskrnl/ke/main.c @@ -1,4 +1,4 @@ -/* $Id: main.c,v 1.45 2000/06/03 21:35:51 ekohl Exp $ +/* $Id: main.c,v 1.46 2000/06/04 19:50:12 ekohl Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -32,6 +32,7 @@ ULONG EXPORTED NtBuildNumber = KERNEL_VERSION_BUILD; ULONG EXPORTED NtGlobalFlag = 0; +CHAR EXPORTED KeNumberProcessors = 1; /* FUNCTIONS ****************************************************************/ diff --git a/reactos/ntoskrnl/ke/mutex.c b/reactos/ntoskrnl/ke/mutex.c index 9b083bc3c57..368aa5138fe 100644 --- a/reactos/ntoskrnl/ke/mutex.c +++ b/reactos/ntoskrnl/ke/mutex.c @@ -1,4 +1,5 @@ -/* +/* $Id: mutex.c,v 1.5 2000/06/04 19:50:12 ekohl Exp $ + * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel * FILE: ntoskrnl/ke/mutex.c @@ -17,7 +18,12 @@ /* FUNCTIONS *****************************************************************/ -VOID KeInitializeMutex(PKMUTEX Mutex, ULONG Level) +VOID +STDCALL +KeInitializeMutex ( + PKMUTEX Mutex, + ULONG Level + ) { KeInitializeDispatcherHeader(&Mutex->Header, InternalMutexType, @@ -25,12 +31,21 @@ VOID KeInitializeMutex(PKMUTEX Mutex, ULONG Level) TRUE); } -LONG KeReadStateMutex(PKMUTEX Mutex) +LONG +STDCALL +KeReadStateMutex ( + PKMUTEX Mutex + ) { return(Mutex->Header.SignalState); } -LONG KeReleaseMutex(PKMUTEX Mutex, BOOLEAN Wait) +LONG +STDCALL +KeReleaseMutex ( + PKMUTEX Mutex, + BOOLEAN Wait + ) { KeAcquireDispatcherDatabaseLock(Wait); Mutex->Header.SignalState--; @@ -43,12 +58,17 @@ LONG KeReleaseMutex(PKMUTEX Mutex, BOOLEAN Wait) return(0); } -NTSTATUS KeWaitForMutexObject(PKMUTEX Mutex, - KWAIT_REASON WaitReason, - KPROCESSOR_MODE WaitMode, - BOOLEAN Alertable, - PLARGE_INTEGER Timeout) +NTSTATUS +STDCALL +KeWaitForMutexObject ( + PKMUTEX Mutex, + KWAIT_REASON WaitReason, + KPROCESSOR_MODE WaitMode, + BOOLEAN Alertable, + PLARGE_INTEGER Timeout + ) { return(KeWaitForSingleObject(Mutex,WaitReason,WaitMode,Alertable,Timeout)); } +/* EOF */ diff --git a/reactos/ntoskrnl/ke/process.c b/reactos/ntoskrnl/ke/process.c index a2c311545e6..b8b06a24ab1 100644 --- a/reactos/ntoskrnl/ke/process.c +++ b/reactos/ntoskrnl/ke/process.c @@ -1,4 +1,5 @@ -/* +/* $Id: process.c,v 1.4 2000/06/04 19:50:12 ekohl Exp $ + * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel * FILE: ntoskrnl/ke/process.c @@ -19,7 +20,11 @@ /* FUNCTIONS *****************************************************************/ -VOID KeAttachProcess(PEPROCESS Process) +VOID +STDCALL +KeAttachProcess ( + PEPROCESS Process + ) { KIRQL oldlvl; PETHREAD CurrentThread; @@ -50,7 +55,11 @@ VOID KeAttachProcess(PEPROCESS Process) KeLowerIrql(oldlvl); } -VOID KeDetachProcess(VOID) +VOID +STDCALL +KeDetachProcess ( + VOID + ) { KIRQL oldlvl; PETHREAD CurrentThread; @@ -78,3 +87,5 @@ VOID KeDetachProcess(VOID) KeLowerIrql(oldlvl); } + +/* EOF */ diff --git a/reactos/ntoskrnl/ke/sem.c b/reactos/ntoskrnl/ke/sem.c index c9d6a42d0f5..4b432de20c7 100644 --- a/reactos/ntoskrnl/ke/sem.c +++ b/reactos/ntoskrnl/ke/sem.c @@ -1,4 +1,5 @@ -/* +/* $Id: sem.c,v 1.6 2000/06/04 19:50:12 ekohl Exp $ + * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel * FILE: ntoskrnl/ke/sem.c @@ -18,9 +19,13 @@ /* FUNCTIONS *****************************************************************/ -VOID KeInitializeSemaphore(PKSEMAPHORE Semaphore, - LONG Count, - LONG Limit) +VOID +STDCALL +KeInitializeSemaphore ( + PKSEMAPHORE Semaphore, + LONG Count, + LONG Limit + ) { KeInitializeDispatcherHeader(&Semaphore->Header, InternalSemaphoreType, @@ -29,15 +34,23 @@ VOID KeInitializeSemaphore(PKSEMAPHORE Semaphore, Semaphore->Limit=Limit; } -LONG KeReadStateSemaphore(PKSEMAPHORE Semaphore) +LONG +STDCALL +KeReadStateSemaphore ( + PKSEMAPHORE Semaphore + ) { return(Semaphore->Header.SignalState); } -LONG KeReleaseSemaphore(PKSEMAPHORE Semaphore, - KPRIORITY Increment, - LONG Adjustment, - BOOLEAN Wait) +LONG +STDCALL +KeReleaseSemaphore ( + PKSEMAPHORE Semaphore, + KPRIORITY Increment, + LONG Adjustment, + BOOLEAN Wait + ) /* * FUNCTION: KeReleaseSemaphore releases a given semaphore object. This * routine supplies a runtime priority boost for waiting threads. If this @@ -85,3 +98,4 @@ LONG KeReleaseSemaphore(PKSEMAPHORE Semaphore, return initState; } +/* EOF */ diff --git a/reactos/ntoskrnl/ke/spinlock.c b/reactos/ntoskrnl/ke/spinlock.c index 62cf7f49109..c318b3c5e08 100644 --- a/reactos/ntoskrnl/ke/spinlock.c +++ b/reactos/ntoskrnl/ke/spinlock.c @@ -21,9 +21,13 @@ /* FUNCTIONS ***************************************************************/ -BOOLEAN KeSynchronizeExecution(PKINTERRUPT Interrupt, - PKSYNCHRONIZE_ROUTINE SynchronizeRoutine, - PVOID SynchronizeContext) +BOOLEAN +STDCALL +KeSynchronizeExecution ( + PKINTERRUPT Interrupt, + PKSYNCHRONIZE_ROUTINE SynchronizeRoutine, + PVOID SynchronizeContext + ) /* * FUNCTION: Synchronizes the execution of a given routine with the ISR * of a given interrupt object @@ -49,7 +53,11 @@ BOOLEAN KeSynchronizeExecution(PKINTERRUPT Interrupt, return(ret); } -VOID KeInitializeSpinLock(PKSPIN_LOCK SpinLock) +VOID +STDCALL +KeInitializeSpinLock ( + PKSPIN_LOCK SpinLock + ) /* * FUNCTION: Initalizes a spinlock * ARGUMENTS: @@ -59,7 +67,11 @@ VOID KeInitializeSpinLock(PKSPIN_LOCK SpinLock) SpinLock->Lock = 0; } -VOID KeAcquireSpinLockAtDpcLevel(PKSPIN_LOCK SpinLock) +VOID +STDCALL +KeAcquireSpinLockAtDpcLevel ( + PKSPIN_LOCK SpinLock + ) /* * FUNCTION: Acquires a spinlock when the caller is already running at * dispatch level @@ -76,7 +88,11 @@ VOID KeAcquireSpinLockAtDpcLevel(PKSPIN_LOCK SpinLock) } } -VOID KeReleaseSpinLockFromDpcLevel(PKSPIN_LOCK SpinLock) +VOID +STDCALL +KeReleaseSpinLockFromDpcLevel ( + PKSPIN_LOCK SpinLock + ) /* * FUNCTION: Releases a spinlock when the caller was running at dispatch * level before acquiring it @@ -92,7 +108,12 @@ VOID KeReleaseSpinLockFromDpcLevel(PKSPIN_LOCK SpinLock) (void)InterlockedExchange(&SpinLock->Lock, 0); } -VOID KeAcquireSpinLock(PKSPIN_LOCK SpinLock, PKIRQL OldIrql) +VOID +STDCALL +KeAcquireSpinLock ( + PKSPIN_LOCK SpinLock, + PKIRQL OldIrql + ) /* * FUNCTION: Acquires a spinlock * ARGUMENTS: @@ -104,7 +125,12 @@ VOID KeAcquireSpinLock(PKSPIN_LOCK SpinLock, PKIRQL OldIrql) KeAcquireSpinLockAtDpcLevel(SpinLock); } -VOID KeReleaseSpinLock(PKSPIN_LOCK SpinLock, KIRQL NewIrql) +VOID +STDCALL +KeReleaseSpinLock ( + PKSPIN_LOCK SpinLock, + KIRQL NewIrql + ) /* * FUNCTION: Releases a spinlock * ARGUMENTS: diff --git a/reactos/ntoskrnl/ke/timer.c b/reactos/ntoskrnl/ke/timer.c index 157119787df..3b3d280f0f8 100644 --- a/reactos/ntoskrnl/ke/timer.c +++ b/reactos/ntoskrnl/ke/timer.c @@ -1,4 +1,4 @@ -/* $Id: timer.c,v 1.27 2000/02/14 10:27:40 ariadne Exp $ +/* $Id: timer.c,v 1.28 2000/06/04 19:50:12 ekohl Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -145,9 +145,13 @@ NTSTATUS STDCALL NtDelayExecution(IN ULONG Alertable, } -NTSTATUS STDCALL KeDelayExecutionThread(KPROCESSOR_MODE WaitMode, - BOOLEAN Alertable, - PLARGE_INTEGER Interval) +NTSTATUS +STDCALL +KeDelayExecutionThread ( + KPROCESSOR_MODE WaitMode, + BOOLEAN Alertable, + PLARGE_INTEGER Interval + ) /* * FUNCTION: Puts the current thread into an alertable or nonalertable * wait state for a given internal @@ -167,7 +171,11 @@ NTSTATUS STDCALL KeDelayExecutionThread(KPROCESSOR_MODE WaitMode, NULL)); } -LARGE_INTEGER KeQueryPerformanceCounter(PLARGE_INTEGER PerformanceFreq) +LARGE_INTEGER +STDCALL +KeQueryPerformanceCounter ( + PLARGE_INTEGER PerformanceFreq + ) /* * FUNCTION: Queries the finest grained running count avaiable in the system * ARGUMENTS: @@ -185,7 +193,11 @@ LARGE_INTEGER KeQueryPerformanceCounter(PLARGE_INTEGER PerformanceFreq) return *PerformanceFreq; } -ULONG KeQueryTimeIncrement(VOID) +ULONG +STDCALL +KeQueryTimeIncrement ( + VOID + ) /* * FUNCTION: Gets the increment (in 100-nanosecond units) that is added to * the system clock every time the clock interrupts @@ -195,7 +207,11 @@ ULONG KeQueryTimeIncrement(VOID) return(CLOCK_INCREMENT); } -VOID KeQuerySystemTime(PLARGE_INTEGER CurrentTime) +VOID +STDCALL +KeQuerySystemTime ( + PLARGE_INTEGER CurrentTime + ) /* * FUNCTION: Gets the current system time * ARGUMENTS: @@ -208,7 +224,11 @@ VOID KeQuerySystemTime(PLARGE_INTEGER CurrentTime) } -NTSTATUS STDCALL NtGetTickCount (PULONG UpTime) +NTSTATUS +STDCALL +NtGetTickCount ( + PULONG UpTime + ) { LARGE_INTEGER TickCount; if ( UpTime == NULL ) @@ -219,7 +239,13 @@ NTSTATUS STDCALL NtGetTickCount (PULONG UpTime) } -BOOLEAN KeSetTimer(PKTIMER Timer, LARGE_INTEGER DueTime, PKDPC Dpc) +BOOLEAN +STDCALL +KeSetTimer ( + PKTIMER Timer, + LARGE_INTEGER DueTime, + PKDPC Dpc + ) /* * FUNCTION: Sets the absolute or relative interval at which a timer object * is to be set to the signaled state and optionally supplies a @@ -236,8 +262,14 @@ BOOLEAN KeSetTimer(PKTIMER Timer, LARGE_INTEGER DueTime, PKDPC Dpc) return(KeSetTimerEx(Timer, DueTime, 0, Dpc)); } -BOOLEAN KeSetTimerEx(PKTIMER Timer, LARGE_INTEGER DueTime, LONG Period, - PKDPC Dpc) +BOOLEAN +STDCALL +KeSetTimerEx ( + PKTIMER Timer, + LARGE_INTEGER DueTime, + LONG Period, + PKDPC Dpc + ) /* * FUNCTION: Sets the absolute or relative interval at which a timer object * is to be set to the signaled state and optionally supplies a @@ -280,7 +312,11 @@ BOOLEAN KeSetTimerEx(PKTIMER Timer, LARGE_INTEGER DueTime, LONG Period, return FALSE; } -BOOLEAN KeCancelTimer(PKTIMER Timer) +BOOLEAN +STDCALL +KeCancelTimer ( + PKTIMER Timer + ) /* * FUNCTION: Removes a timer from the system timer list * ARGUMENTS: @@ -308,12 +344,20 @@ BOOLEAN KeCancelTimer(PKTIMER Timer) return(TRUE); } -BOOLEAN KeReadStateTimer(PKTIMER Timer) +BOOLEAN +STDCALL +KeReadStateTimer ( + PKTIMER Timer + ) { return(Timer->Header.SignalState); } -VOID KeInitializeTimer(PKTIMER Timer) +VOID +STDCALL +KeInitializeTimer ( + PKTIMER Timer + ) /* * FUNCTION: Initalizes a kernel timer object * ARGUMENTS: @@ -324,7 +368,12 @@ VOID KeInitializeTimer(PKTIMER Timer) KeInitializeTimerEx(Timer,NotificationTimer); } -VOID KeInitializeTimerEx(PKTIMER Timer, TIMER_TYPE Type) +VOID +STDCALL +KeInitializeTimerEx ( + PKTIMER Timer, + TIMER_TYPE Type + ) /* * FUNCTION: Initializes a kernel timer object * ARGUMENTS: @@ -359,7 +408,11 @@ VOID KeInitializeTimerEx(PKTIMER Timer, TIMER_TYPE Type) Timer->TimerListEntry.Flink = Timer->TimerListEntry.Blink = NULL; } -VOID KeQueryTickCount(PLARGE_INTEGER TickCount) +VOID +STDCALL +KeQueryTickCount ( + PLARGE_INTEGER TickCount + ) /* * FUNCTION: Returns the number of ticks since the system was booted * ARGUMENTS: @@ -429,7 +482,11 @@ VOID KeExpireTimers(VOID) } -VOID KiTimerInterrupt(VOID) +VOID +STDCALL +KeUpdateSystemTime ( + VOID + ) /* * FUNCTION: Handles a timer interrupt */ diff --git a/reactos/ntoskrnl/ke/wait.c b/reactos/ntoskrnl/ke/wait.c index 421c4139f20..ad62f3cab17 100644 --- a/reactos/ntoskrnl/ke/wait.c +++ b/reactos/ntoskrnl/ke/wait.c @@ -364,11 +364,15 @@ BOOLEAN KeDispatcherObjectWake(DISPATCHER_HEADER* hdr) } -NTSTATUS KeWaitForSingleObject(PVOID Object, - KWAIT_REASON WaitReason, - KPROCESSOR_MODE WaitMode, - BOOLEAN Alertable, - PLARGE_INTEGER Timeout) +NTSTATUS +STDCALL +KeWaitForSingleObject ( + PVOID Object, + KWAIT_REASON WaitReason, + KPROCESSOR_MODE WaitMode, + BOOLEAN Alertable, + PLARGE_INTEGER Timeout + ) /* * FUNCTION: Puts the current thread into a wait state until the * given dispatcher object is set to signalled @@ -449,14 +453,18 @@ NTSTATUS KeWaitForSingleObject(PVOID Object, } -NTSTATUS KeWaitForMultipleObjects(ULONG Count, - PVOID Object[], - WAIT_TYPE WaitType, - KWAIT_REASON WaitReason, - KPROCESSOR_MODE WaitMode, - BOOLEAN Alertable, - PLARGE_INTEGER Timeout, - PKWAIT_BLOCK WaitBlockArray) +NTSTATUS +STDCALL +KeWaitForMultipleObjects ( + ULONG Count, + PVOID Object[], + WAIT_TYPE WaitType, + KWAIT_REASON WaitReason, + KPROCESSOR_MODE WaitMode, + BOOLEAN Alertable, + PLARGE_INTEGER Timeout, + PKWAIT_BLOCK WaitBlockArray + ) { DISPATCHER_HEADER* hdr; PKWAIT_BLOCK blk; diff --git a/reactos/ntoskrnl/ps/thread.c b/reactos/ntoskrnl/ps/thread.c index 4f3325f62ac..b6c21f0807e 100644 --- a/reactos/ntoskrnl/ps/thread.c +++ b/reactos/ntoskrnl/ps/thread.c @@ -1,4 +1,4 @@ -/* $Id: thread.c,v 1.47 2000/06/03 21:36:32 ekohl Exp $ +/* $Id: thread.c,v 1.48 2000/06/04 19:51:05 ekohl Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -106,7 +106,11 @@ VOID PsUnfreezeProcessThreads(PEPROCESS Process) KeReleaseSpinLock(&PiThreadListLock, oldIrql); } -PKTHREAD KeGetCurrentThread(VOID) +PKTHREAD +STDCALL +KeGetCurrentThread ( + VOID + ) { return(&(CurrentThread->Tcb)); } @@ -415,7 +419,12 @@ VOID PsInitThreadManagment(VOID) * Sets thread's base priority relative to the process' base priority * Should only be passed in THREAD_PRIORITY_ constants in pstypes.h */ -LONG KeSetBasePriorityThread(PKTHREAD Thread, LONG Increment) +LONG +STDCALL +KeSetBasePriorityThread ( + PKTHREAD Thread, + LONG Increment + ) { Thread->BasePriority = ((PETHREAD)Thread)->ThreadsProcess->Pcb.BasePriority + Increment; if( Thread->BasePriority < 0 ) @@ -427,7 +436,12 @@ LONG KeSetBasePriorityThread(PKTHREAD Thread, LONG Increment) } -KPRIORITY KeSetPriorityThread(PKTHREAD Thread, KPRIORITY Priority) +KPRIORITY +STDCALL +KeSetPriorityThread ( + PKTHREAD Thread, + KPRIORITY Priority + ) { KPRIORITY OldPriority; KIRQL oldIrql; diff --git a/reactos/ntoskrnl/ps/tinfo.c b/reactos/ntoskrnl/ps/tinfo.c index 4dc9795b460..2c8a5426f16 100644 --- a/reactos/ntoskrnl/ps/tinfo.c +++ b/reactos/ntoskrnl/ps/tinfo.c @@ -122,7 +122,11 @@ VOID KeSetPreviousMode(ULONG Mode) PsGetCurrentThread()->Tcb.PreviousMode = Mode; } -ULONG KeGetPreviousMode(VOID) +ULONG +STDCALL +KeGetPreviousMode ( + VOID + ) { /* CurrentThread is in ntoskrnl/ps/thread.c */ return (ULONG)PsGetCurrentThread()->Tcb.PreviousMode;