From 6fbeba1e7c0960a3d69560608d3dd88aef1ece0d Mon Sep 17 00:00:00 2001 From: David Welch Date: Fri, 16 Mar 2001 23:05:00 +0000 Subject: [PATCH] Moved microkernel to the architecture specific directory svn path=/trunk/; revision=1704 --- reactos/ntoskrnl/Makefile | 3 +- reactos/ntoskrnl/Makefile.i386 | 3 +- reactos/ntoskrnl/ke/bug.c | 32 +++++++------- reactos/ntoskrnl/ke/catch.c | 3 +- reactos/ntoskrnl/ke/{ => i386}/kernel.c | 59 ++++++++++++------------- reactos/ntoskrnl/ke/process.c | 22 ++++++++- reactos/ntoskrnl/ke/sem.c | 40 ++++++++++++----- 7 files changed, 99 insertions(+), 63 deletions(-) rename reactos/ntoskrnl/ke/{ => i386}/kernel.c (55%) diff --git a/reactos/ntoskrnl/Makefile b/reactos/ntoskrnl/Makefile index 39a30a00ffc..8d2199b537d 100644 --- a/reactos/ntoskrnl/Makefile +++ b/reactos/ntoskrnl/Makefile @@ -1,4 +1,4 @@ -# $Id: Makefile,v 1.23 2001/03/15 23:41:31 dwelch Exp $ +# $Id: Makefile,v 1.24 2001/03/16 23:04:59 dwelch Exp $ # # ReactOS Operating System # @@ -94,7 +94,6 @@ OBJECTS_KE = \ ke/dpc.o \ ke/error.o \ ke/event.o \ - ke/kernel.o \ ke/kqueue.o \ ke/main.o \ ke/mutex.o \ diff --git a/reactos/ntoskrnl/Makefile.i386 b/reactos/ntoskrnl/Makefile.i386 index 0d66681b49c..685eb63d3a3 100644 --- a/reactos/ntoskrnl/Makefile.i386 +++ b/reactos/ntoskrnl/Makefile.i386 @@ -17,7 +17,8 @@ OBJECTS_KE_I386 := \ ke/i386/gdt.o \ ke/i386/idt.o \ ke/i386/ldt.o \ - ke/i386/brkpoint.o + ke/i386/brkpoint.o \ + ke/i386/kernel.o OBJECTS_MM_I386 := \ mm/i386/memsafe.o \ diff --git a/reactos/ntoskrnl/ke/bug.c b/reactos/ntoskrnl/ke/bug.c index 804fd6428ce..00761aeb55b 100644 --- a/reactos/ntoskrnl/ke/bug.c +++ b/reactos/ntoskrnl/ke/bug.c @@ -16,7 +16,7 @@ * 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.16 2001/03/14 00:21:22 dwelch Exp $ +/* $Id: bug.c,v 1.17 2001/03/16 23:04:59 dwelch Exp $ * * PROJECT: ReactOS kernel * FILE: ntoskrnl/ke/bug.c @@ -59,26 +59,26 @@ KeDeregisterBugCheckCallback (PKBUGCHECK_CALLBACK_RECORD CallbackRecord) } BOOLEAN STDCALL -KeRegisterBugCheckCallback (PKBUGCHECK_CALLBACK_RECORD CallbackRecord, +KeRegisterBugCheckCallback (PKBUGCHECK_CALLBACK_RECORD CallbackRecord, PKBUGCHECK_CALLBACK_ROUTINE CallbackRoutine, - PVOID Buffer, - ULONG Length, - PUCHAR Component) + PVOID Buffer, + ULONG Length, + PUCHAR Component) { - InsertTailList(&BugcheckCallbackListHead,&CallbackRecord->Entry); - CallbackRecord->Length=Length; - CallbackRecord->Buffer=Buffer; - CallbackRecord->Component=Component; - CallbackRecord->CallbackRoutine=CallbackRoutine; + InsertTailList(&BugcheckCallbackListHead, &CallbackRecord->Entry); + CallbackRecord->Length = Length; + CallbackRecord->Buffer = Buffer; + CallbackRecord->Component = Component; + CallbackRecord->CallbackRoutine = CallbackRoutine; return(TRUE); } VOID STDCALL -KeBugCheckEx (ULONG BugCheckCode, - ULONG BugCheckParameter1, - ULONG BugCheckParameter2, - ULONG BugCheckParameter3, - ULONG BugCheckParameter4) +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 @@ -119,7 +119,7 @@ KeBugCheckEx (ULONG BugCheckCode, } VOID STDCALL -KeBugCheck (ULONG BugCheckCode) +KeBugCheck (ULONG BugCheckCode) /* * FUNCTION: Brings the system down in a controlled manner when an * inconsistency that might otherwise cause corruption has been detected diff --git a/reactos/ntoskrnl/ke/catch.c b/reactos/ntoskrnl/ke/catch.c index b82fa4a363b..1506b3412a3 100644 --- a/reactos/ntoskrnl/ke/catch.c +++ b/reactos/ntoskrnl/ke/catch.c @@ -16,9 +16,8 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -/* $Id: catch.c,v 1.10 2001/03/16 18:11:22 dwelch Exp $ +/* $Id: catch.c,v 1.11 2001/03/16 23:04:59 dwelch Exp $ * - * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel * FILE: ntoskrnl/ke/catch.c * PURPOSE: Exception handling diff --git a/reactos/ntoskrnl/ke/kernel.c b/reactos/ntoskrnl/ke/i386/kernel.c similarity index 55% rename from reactos/ntoskrnl/ke/kernel.c rename to reactos/ntoskrnl/ke/i386/kernel.c index 11af84d5e91..0ae9c063de3 100644 --- a/reactos/ntoskrnl/ke/kernel.c +++ b/reactos/ntoskrnl/ke/i386/kernel.c @@ -1,5 +1,22 @@ /* - * COPYRIGHT: See COPYING in the top level directory + * ReactOS kernel + * Copyright (C) 1998, 1999, 2000, 2001 ReactOS Team + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ +/* * PROJECT: ReactOS kernel * FILE: ntoskrnl/ke/kernel.c * PURPOSE: Initializes the kernel @@ -14,40 +31,15 @@ #include #include #include +#include #define NDEBUG #include -/* GLOBALS *******************************************************************/ - -static ULONG HardwareMathSupport; - /* FUNCTIONS *****************************************************************/ -VOID KiCheckFPU(VOID) -{ - unsigned short int status; - int cr0; - - HardwareMathSupport = 0; - - __asm__("clts\n\t"); - __asm__("fninit\n\t"); - __asm__("fstsw %0\n\t" : "=a" (status)); - if (status != 0) - { - __asm__("movl %%cr0, %0\n\t" : "=a" (cr0)); - cr0 = cr0 | 0x4; - __asm__("movl %0, %%cr0\n\t" : - : "a" (cr0)); - DbgPrint("No FPU detected\n"); - return; - } - /* FIXME: Do fsetpm */ - HardwareMathSupport = 1; -} - -VOID KeInit1(VOID) +VOID +KeInit1(VOID) { KiCheckFPU(); @@ -55,7 +47,8 @@ VOID KeInit1(VOID) KeInitInterrupts (); } -VOID KeInit2(VOID) +VOID +KeInit2(VOID) { PVOID PcrPage; @@ -80,3 +73,9 @@ VOID KeInit2(VOID) (ULONG)PcrPage); memset((PVOID)KPCR_BASE, 0, 4096); } + + + + + + diff --git a/reactos/ntoskrnl/ke/process.c b/reactos/ntoskrnl/ke/process.c index 468a14fbc29..7e6c8d5b7b5 100644 --- a/reactos/ntoskrnl/ke/process.c +++ b/reactos/ntoskrnl/ke/process.c @@ -1,10 +1,28 @@ -/* $Id: process.c,v 1.6 2000/12/23 02:37:40 dwelch Exp $ +/* + * ReactOS kernel + * Copyright (C) 1998, 1999, 2000, 2001 ReactOS Team + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * 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.7 2001/03/16 23:04:59 dwelch Exp $ * - * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel * FILE: ntoskrnl/ke/process.c * PURPOSE: Microkernel process management * PROGRAMMER: David Welch (welch@cwcom.net) + * PORTABILITY: No. * UPDATE HISTORY: * Created 22/05/98 */ diff --git a/reactos/ntoskrnl/ke/sem.c b/reactos/ntoskrnl/ke/sem.c index a35cbeaab29..99f7b94d6b7 100644 --- a/reactos/ntoskrnl/ke/sem.c +++ b/reactos/ntoskrnl/ke/sem.c @@ -1,6 +1,23 @@ -/* $Id: sem.c,v 1.7 2000/06/29 23:35:38 dwelch Exp $ +/* + * ReactOS kernel + * Copyright (C) 1998, 1999, 2000, 2001 ReactOS Team + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ +/* $Id: sem.c,v 1.8 2001/03/16 23:04:59 dwelch Exp $ * - * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel * FILE: ntoskrnl/ke/sem.c * PURPOSE: Implements kernel semaphores @@ -20,9 +37,10 @@ /* FUNCTIONS *****************************************************************/ -VOID STDCALL KeInitializeSemaphore (PKSEMAPHORE Semaphore, - LONG Count, - LONG Limit) +VOID STDCALL +KeInitializeSemaphore (PKSEMAPHORE Semaphore, + LONG Count, + LONG Limit) { KeInitializeDispatcherHeader(&Semaphore->Header, InternalSemaphoreType, @@ -31,15 +49,17 @@ VOID STDCALL KeInitializeSemaphore (PKSEMAPHORE Semaphore, Semaphore->Limit=Limit; } -LONG STDCALL KeReadStateSemaphore (PKSEMAPHORE Semaphore) +LONG STDCALL +KeReadStateSemaphore (PKSEMAPHORE Semaphore) { return(Semaphore->Header.SignalState); } -LONG STDCALL 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