extern LOADER_PARAMETER_BLOCK EXPORTED KeLoaderBlock;
extern ULONG EXPORTED KeDcacheFlushCount;
extern ULONG EXPORTED KeIcacheFlushCount;
+extern KAFFINITY EXPORTED KeActiveProcessors;
+extern ULONG EXPORTED KiDmaIoCoherency; /* RISC Architectures only */
+extern ULONG EXPORTED KeMaximumIncrement;
+extern ULONG EXPORTED KeMinimumIncrement;
#else
extern CHAR IMPORTED KeNumberProcessors;
+extern KAFFINITY IMPORTED KeActiveProcessors;
extern LOADER_PARAMETER_BLOCK IMPORTED KeLoaderBlock;
extern ULONG EXPORTED KeDcacheFlushCount;
extern ULONG EXPORTED KeIcacheFlushCount;
+extern ULONG IMPORTED KiDmaIoCoherency; /* RISC Architectures only */
+extern ULONG IMPORTED KeMaximumIncrement;
+extern ULONG IMPORTED KeMinimumIncrement;
#endif
-/* $Id: kdebug.c,v 1.55 2004/08/15 16:39:04 chorns Exp $
+/* $Id: kdebug.c,v 1.56 2004/10/13 22:27:03 ion Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
UNIMPLEMENTED;
}
-/*
- * @unimplemented
- */
-BOOLEAN
-STDCALL
-KeIsAttachedProcess(
- VOID
- )
-{
- UNIMPLEMENTED;
- return FALSE;
-}
-
/*
* @implemented
*/
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-/* $Id: bug.c,v 1.46 2004/09/28 15:02:29 weiden Exp $
+/* $Id: bug.c,v 1.47 2004/10/13 22:27:03 ion Exp $
*
* PROJECT: ReactOS kernel
* FILE: ntoskrnl/ke/bug.c
}
/*
- * @unimplemented
+ * @implemented
*/
BOOLEAN STDCALL
KeDeregisterBugCheckCallback(PKBUGCHECK_CALLBACK_RECORD CallbackRecord)
{
- UNIMPLEMENTED;
- return FALSE;
+ /* Check the Current State */
+ if (CallbackRecord->State == BufferInserted) {
+ CallbackRecord->State = BufferEmpty;
+ RemoveEntryList(&CallbackRecord->Entry);
+ return TRUE;
+ }
+
+ /* The callback wasn't registered */
+ return FALSE;
}
/*
ULONG Length,
PUCHAR Component)
{
- InsertTailList(&BugcheckCallbackListHead, &CallbackRecord->Entry);
- CallbackRecord->Length = Length;
- CallbackRecord->Buffer = Buffer;
- CallbackRecord->Component = Component;
- CallbackRecord->CallbackRoutine = CallbackRoutine;
- return(TRUE);
+
+ /* Check the Current State first so we don't double-register */
+ if (CallbackRecord->State == BufferEmpty) {
+ CallbackRecord->Length = Length;
+ CallbackRecord->Buffer = Buffer;
+ CallbackRecord->Component = Component;
+ CallbackRecord->CallbackRoutine = CallbackRoutine;
+ CallbackRecord->State = BufferInserted;
+ InsertTailList(&BugcheckCallbackListHead, &CallbackRecord->Entry);
+
+ return TRUE;
+ }
+
+ /* The Callback was already registered */
+ return(FALSE);
}
VOID STDCALL
-/* $Id: device.c,v 1.3 2004/10/13 01:42:14 ion Exp $
+/* $Id: device.c,v 1.4 2004/10/13 22:27:03 ion Exp $
*
* FILE: ntoskrnl/ke/profile.c
* PURPOSE: Kernel Device/Settings Functions
#include <internal/debug.h>
/*
- * @unimplemented
+ * @implemented
*/
STDCALL
PVOID
IN PULONG RegKey
)
{
- UNIMPLEMENTED;
- return 0;
+ /* Start Search at Root */
+ return KeFindConfigurationNextEntry(Unknown, Class, Type, RegKey, NULL);
}
/*
/*
- * @unimplemented
+ * @implemented
*/
STDCALL
VOID
IN ULONG Coherency
)
{
- UNIMPLEMENTED;
+ KiDmaIoCoherency = Coherency;
}
/*
}
/*
- * @unimplemented
+ * @implemented
*/
STDCALL
KAFFINITY
VOID
)
{
- UNIMPLEMENTED;
- return 0;
+ return KeActiveProcessors;
}
}
/*
- * @unimplemented
+ * @implemented
*/
VOID
STDCALL
IN PKTHREAD *Thread OPTIONAL
)
{
- UNIMPLEMENTED;
+ PKTHREAD WaitingThread;
+
+ /* Get Thread that is currently waiting. First get the Wait Block, then the Thread */
+ WaitingThread = CONTAINING_RECORD(Event->Header.WaitListHead.Flink, KWAIT_BLOCK, WaitListEntry)->Thread;
+
+ /* Return it to caller if requested */
+ if ARGUMENT_PRESENT(Thread) *Thread = WaitingThread;
+
+ /* Reset the Quantum and Unwait the Thread */
+ WaitingThread->Quantum = WaitingThread->ApcState.Process->ThreadQuantum;
+ KeRemoveAllWaitsThread((PETHREAD)WaitingThread, STATUS_SUCCESS, TRUE);
}
/* EOF */
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-/* $Id: main.c,v 1.198 2004/10/03 03:03:54 ion Exp $
+/* $Id: main.c,v 1.199 2004/10/13 22:27:03 ion Exp $
*
* PROJECT: ReactOS kernel
* FILE: ntoskrnl/ke/main.c
ULONG EXPORTED NtBuildNumber = KERNEL_VERSION_BUILD;
ULONG EXPORTED NtGlobalFlag = 0;
CHAR EXPORTED KeNumberProcessors;
+KAFFINITY EXPORTED KeActiveProcessors;
LOADER_PARAMETER_BLOCK EXPORTED KeLoaderBlock;
ULONG EXPORTED KeDcacheFlushCount = 0;
ULONG EXPORTED KeIcacheFlushCount = 0;
+ULONG EXPORTED KiDmaIoCoherency = 0; /* RISC Architectures only */
#else
/* Microsoft-style declarations */
EXPORTED ULONG NtBuildNumber = KERNEL_VERSION_BUILD;
EXPORTED ULONG NtGlobalFlag = 0;
EXPORTED CHAR KeNumberProcessors;
+EXPORTED KAFFINITY KeActiveProcessors;
EXPORTED LOADER_PARAMETER_BLOCK KeLoaderBlock;
EXPORTED ULONG KeDcacheFlushCount = 0;
EXPORTED ULONG KeIcacheFlushCount = 0;
+EXPORTED ULONG KiDmaIoCoherency = 0; /* RISC Architectures only */
#endif /* __GNUC__ */
static LOADER_MODULE KeLoaderModules[64];
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-/* $Id: process.c,v 1.28 2004/10/13 01:42:14 ion Exp $
+/* $Id: process.c,v 1.29 2004/10/13 22:27:03 ion Exp $
*
* PROJECT: ReactOS kernel
* FILE: ntoskrnl/ke/process.c
}
/*
- * @unimplemented
+ * @implemented
+ */
+BOOLEAN
+STDCALL
+KeIsAttachedProcess(
+ VOID
+ )
+{
+ return KeGetCurrentThread()->ApcStateIndex;
+}
+
+/*
+ * @implemented
*/
VOID
STDCALL
-/* $Id: timer.c,v 1.79 2004/10/01 20:09:57 hbirr Exp $
+/* $Id: timer.c,v 1.80 2004/10/13 22:27:03 ion Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
*/
#define CLOCK_INCREMENT (100000)
+#ifdef __GNUC__
+ULONG EXPORTED KeMaximumIncrement = 100000;
+ULONG EXPORTED KeMinimumIncrement = 100000;
+#else
+/* Microsoft-style declarations */
+EXPORTED ULONG KeMaximumIncrement = 100000;
+EXPORTED ULONG KeMinimumIncrement = 100000;
+#endif
+
+
+
/*
* PURPOSE: List of timers
*/
}
/*
- * @unimplemented
+ * @implemented
*/
ULONG
STDCALL
OUT PULONG UserTime
)
{
- UNIMPLEMENTED;
- return 0;
+ /* Return the User Time */
+ *UserTime = Thread->UserTime;
+
+ /* Return the Kernel Time */
+ return Thread->KernelTime;
}
/*
- * @unimplemented
+ * @implemented
*/
VOID
STDCALL
IN ULONG MinIncrement
)
{
- UNIMPLEMENTED;
+ /* Set some Internal Variables */
+ /* FIXME: We use a harcoded CLOCK_INCREMENT. That *must* be changed */
+ KeMaximumIncrement = MaxIncrement;
+ KeMinimumIncrement = MinIncrement;
}
/*
/*
- * @unimplemented
+ * @implemented
*/
VOID
STDCALL
IN PKTRAP_FRAME TrapFrame
)
{
- UNIMPLEMENTED;
+ KIRQL OldIrql;
+
+ /* These are equivalent... we should just remove the Ki and stick it here... */
+ KiUpdateProcessThreadTime(OldIrql, (PKIRQ_TRAPFRAME)TrapFrame);
}
/*
- * @unimplemented
+ * @implemented
*/
VOID
STDCALL
IN ULONG Increment
)
{
- UNIMPLEMENTED;
+ KIRQL OldIrql;
+
+ /* These are equivalent... we should just remove the Ki and stick it here... */
+ KiUpdateSystemTime(OldIrql, (PKIRQ_TRAPFRAME)TrapFrame);
}
/*EOF*/