Replaced boot_param by LOADER_PARAMETER_BLOCK

Added missing dpc functions
Fixed some Ke macros

svn path=/trunk/; revision=1217
This commit is contained in:
Eric Kohl 2000-07-01 18:27:03 +00:00
parent 95f8770ae2
commit 6abd233802
19 changed files with 246 additions and 206 deletions

View file

@ -175,23 +175,13 @@ enum
OBJ_OPENIF = 0x10, OBJ_OPENIF = 0x10,
}; };
/*
* PURPOSE: DPC priorities
*/
enum
{
High,
Medium,
Low,
};
/* /*
* PURPOSE: Timer types * PURPOSE: Timer types
*/ */
enum enum
{ {
NotificationTimer, NotificationTimer,
SynchronizationTimer, SynchronizationTimer,
}; };
/* /*
@ -249,12 +239,12 @@ enum
#define LOW_LEVEL 0 // Lowest interrupt level #define LOW_LEVEL 0 // Lowest interrupt level
#define APC_LEVEL 1 // APC interrupt level #define APC_LEVEL 1 // APC interrupt level
#define DISPATCH_LEVEL 2 // Dispatcher level #define DISPATCH_LEVEL 2 // Dispatcher level
#define PROFILE_LEVEL 27 // timer used for profiling. #define PROFILE_LEVEL 27 // timer used for profiling.
#define CLOCK1_LEVEL 28 // Interval clock 1 level - Not used on x86 #define CLOCK1_LEVEL 28 // Interval clock 1 level - Not used on x86
#define CLOCK2_LEVEL 28 // Interval clock 2 level #define CLOCK2_LEVEL 28 // Interval clock 2 level
#define IPI_LEVEL 29 // Interprocessor interrupt level #define IPI_LEVEL 29 // Interprocessor interrupt level
#define POWER_LEVEL 30 // Power failure level #define POWER_LEVEL 30 // Power failure level
#define HIGH_LEVEL 31 // Highest interrupt level #define HIGH_LEVEL 31 // Highest interrupt level
#define SYNCH_LEVEL (IPI_LEVEL-1) // synchronization level #define SYNCH_LEVEL (IPI_LEVEL-1) // synchronization level
#endif #endif

View file

@ -1,4 +1,4 @@
/* $Id: halddk.h,v 1.2 2000/06/30 22:49:26 ekohl Exp $ /* $Id: halddk.h,v 1.3 2000/07/01 18:20:41 ekohl Exp $
* *
* COPYRIGHT: See COPYING in the top level directory * COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel * PROJECT: ReactOS kernel
@ -456,6 +456,13 @@ HalGetInterruptVector (
PKAFFINITY Affinity PKAFFINITY Affinity
); );
BOOLEAN
STDCALL
HalInitSystem (
ULONG BootPhase,
PLOADER_PARAMETER_BLOCK LoaderBlock
);
VOID VOID
STDCALL STDCALL
HalInitializeProcessor ( HalInitializeProcessor (

View file

@ -1,9 +1,22 @@
#ifndef __INCLUDE_DDK_KEDEF_H
#define __INCLUDE_DDK_KEDEF_H
typedef enum _KINTERRUPT_MODE typedef enum _KINTERRUPT_MODE
{ {
LevelSensitive, LevelSensitive,
Latched, Latched,
} KINTERRUPT_MODE; } KINTERRUPT_MODE;
/*
* PURPOSE: DPC importance
*/
typedef enum _KDPC_IMPORTANCE
{
LowImportance,
MediumImportance,
HighImportance
} KDPC_IMPORTANCE;
typedef enum _EVENT_TYPE typedef enum _EVENT_TYPE
{ {
NotificationEvent, NotificationEvent,
@ -39,3 +52,5 @@ typedef enum _KWAIT_REASON
WrKernel, WrKernel,
MaximumWaitReason, MaximumWaitReason,
} KWAIT_REASON; } KWAIT_REASON;
#endif

View file

@ -4,15 +4,6 @@
/* KERNEL FUNCTIONS ********************************************************/ /* KERNEL FUNCTIONS ********************************************************/
VOID
STDCALL
KeAttachProcess (
struct _EPROCESS* Process
);
VOID KeDrainApcQueue(VOID);
PKPROCESS KeGetCurrentProcess(VOID);
/* /*
* FUNCTION: Acquires a spinlock so the caller can synchronize access to * FUNCTION: Acquires a spinlock so the caller can synchronize access to
* data * data
@ -23,14 +14,26 @@ PKPROCESS KeGetCurrentProcess(VOID);
VOID VOID
STDCALL STDCALL
KeAcquireSpinLock ( KeAcquireSpinLock (
PKSPIN_LOCK SpinLock, IN PKSPIN_LOCK SpinLock,
PKIRQL OldIrql OUT PKIRQL OldIrql
); );
VOID VOID
STDCALL STDCALL
KeAcquireSpinLockAtDpcLevel ( KeAcquireSpinLockAtDpcLevel (
PKSPIN_LOCK SpinLock IN PKSPIN_LOCK SpinLock
);
KIRQL
FASTCALL
KeAcquireSpinLockRaiseToSynch (
IN PKSPIN_LOCK SpinLock
);
VOID
STDCALL
KeAttachProcess (
IN PEPROCESS Process
); );
/* /*
@ -43,7 +46,7 @@ KeAcquireSpinLockAtDpcLevel (
VOID VOID
STDCALL STDCALL
KeBugCheck ( KeBugCheck (
ULONG BugCheckCode IN ULONG BugCheckCode
); );
/* /*
@ -57,23 +60,23 @@ KeBugCheck (
VOID VOID
STDCALL STDCALL
KeBugCheckEx ( KeBugCheckEx (
ULONG BugCheckCode, IN ULONG BugCheckCode,
ULONG BugCheckParameter1, IN ULONG BugCheckParameter1,
ULONG BugCheckParameter2, IN ULONG BugCheckParameter2,
ULONG BugCheckParameter3, IN ULONG BugCheckParameter3,
ULONG BugCheckParameter4 IN ULONG BugCheckParameter4
); );
BOOLEAN BOOLEAN
STDCALL STDCALL
KeCancelTimer ( KeCancelTimer (
PKTIMER Timer IN PKTIMER Timer
); );
VOID VOID
STDCALL STDCALL
KeClearEvent ( KeClearEvent (
PKEVENT Event IN PKEVENT Event
); );
NTSTATUS NTSTATUS
@ -87,7 +90,7 @@ KeDelayExecutionThread (
BOOLEAN BOOLEAN
STDCALL STDCALL
KeDeregisterBugCheckCallback ( KeDeregisterBugCheckCallback (
PKBUGCHECK_CALLBACK_RECORD CallbackRecord IN PKBUGCHECK_CALLBACK_RECORD CallbackRecord
); );
VOID VOID
@ -102,7 +105,32 @@ KeEnterCriticalRegion (
VOID VOID
); );
VOID KeFlushIoBuffers(PMDL Mdl, BOOLEAN ReadOperation, BOOLEAN DmaOperation); /*
* FUNCTION: Enters the kernel debugger
* ARGUMENTS:
* None
*/
VOID
STDCALL
KeEnterKernelDebugger (
VOID
);
/*
* VOID
* KeFlushIoBuffers (
* PMDL Mdl,
* BOOLEAN ReadOperation,
* BOOLEAN DmaOperation
* );
*/
#define KeFlushIoBuffers(Mdl,ReadOperation,DmaOperation)
VOID
STDCALL
KeFlushWriteBuffer (
VOID
);
KIRQL KIRQL
STDCALL STDCALL
@ -118,7 +146,13 @@ KeGetCurrentThread (
VOID VOID
); );
ULONG KeGetDcacheFillSize(VOID); /*
* ULONG KeGetDcacheFillSize(VOID);
*
* FUNCTION:
* Returns the microprocessor's data cache-line boundary in bytes
*/
#define KeGetDcacheFillSize() 1L
ULONG ULONG
STDCALL STDCALL
@ -278,6 +312,17 @@ KeRaiseIrql (
PKIRQL OldIrql PKIRQL OldIrql
); );
/*
* FUNCTION: Raises a user mode exception
* ARGUMENTS:
* ExceptionCode = Status code of the exception
*/
VOID
STDCALL
KeRaiseUserException (
IN NTSTATUS ExceptionCode
);
LONG LONG
STDCALL STDCALL
KeReadStateEvent ( KeReadStateEvent (
@ -388,6 +433,13 @@ KeSetEvent (
BOOLEAN Wait BOOLEAN Wait
); );
VOID
STDCALL
KeSetImportanceDpc (
IN PKDPC Dpc,
IN KDPC_IMPORTANCE Importance
);
KPRIORITY KPRIORITY
STDCALL STDCALL
KeSetPriorityThread ( KeSetPriorityThread (
@ -395,6 +447,13 @@ KeSetPriorityThread (
KPRIORITY Priority KPRIORITY Priority
); );
VOID
STDCALL
KeSetTargetProcessorDpc (
IN PKDPC Dpc,
IN CCHAR Number
);
BOOLEAN BOOLEAN
STDCALL STDCALL
KeSetTimer ( KeSetTimer (
@ -473,14 +532,14 @@ KeWaitForSingleObject (
* newlvl = IRQ level to set * newlvl = IRQ level to set
* NOTE: This is for internal use only * NOTE: This is for internal use only
*/ */
VOID KeSetCurrentIrql(KIRQL newlvl); //VOID KeSetCurrentIrql(KIRQL newlvl);
// io permission map has a 8k size // io permission map has a 8k size
// Each bit in the IOPM corresponds to an io port byte address. The bitmap // Each bit in the IOPM corresponds to an io port byte address. The bitmap
// is initialized to allow IO at any port. [ all bits set ]. // is initialized to allow IO at any port. [ all bits set ].
typedef struct _IOPM typedef struct _IOPM
{ {
UCHAR Bitmap[8192]; UCHAR Bitmap[8192];
} IOPM, *PIOPM; } IOPM, *PIOPM;
@ -537,29 +596,6 @@ NTSTATUS KeI386ReleaseGdtSelectors(OUT PULONG SelArray,
NTSTATUS KeI386AllocateGdtSelectors(OUT PULONG SelArray, NTSTATUS KeI386AllocateGdtSelectors(OUT PULONG SelArray,
IN ULONG NumOfSelectors); IN ULONG NumOfSelectors);
/*
* FUNCTION: Raises a user mode exception
* ARGUMENTS:
* ExceptionCode = Status code of the exception
*/
VOID KeRaiseUserException(NTSTATUS ExceptionCode);
/*
* FUNCTION: Enters the kernel debugger
* ARGUMENTS:
* None
*/
VOID
STDCALL
KeEnterKernelDebugger (VOID);
VOID
STDCALL
KeFlushWriteBuffer (
VOID
);
KIRQL KIRQL
FASTCALL FASTCALL
@ -567,12 +603,6 @@ KfAcquireSpinLock (
IN PKSPIN_LOCK SpinLock IN PKSPIN_LOCK SpinLock
); );
KIRQL
FASTCALL
KeAcquireSpinLockRaiseToSynch (
IN PKSPIN_LOCK SpinLock
);
VOID VOID
FASTCALL FASTCALL
KfLowerIrql ( KfLowerIrql (

View file

@ -209,10 +209,10 @@ struct _KDPC;
typedef VOID (*PKDEFERRED_ROUTINE)(struct _KDPC* Dpc, PVOID DeferredContext, typedef VOID (*PKDEFERRED_ROUTINE)(struct _KDPC* Dpc, PVOID DeferredContext,
PVOID SystemArgument1, PVOID SystemArgument2); PVOID SystemArgument1, PVOID SystemArgument2);
typedef struct _KDPC
/* /*
* PURPOSE: Defines a delayed procedure call object * PURPOSE: Defines a delayed procedure call object
*/ */
typedef struct _KDPC
{ {
SHORT Type; SHORT Type;
UCHAR Number; UCHAR Number;

View file

@ -1,4 +1,4 @@
/* $Id: display.c,v 1.6 2000/03/19 13:34:47 ekohl Exp $ /* $Id: display.c,v 1.7 2000/07/01 18:23:06 ekohl Exp $
* *
* COPYRIGHT: See COPYING in the top level directory * COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel * PROJECT: ReactOS kernel
@ -97,7 +97,7 @@ HalPutCharacter (CHAR Character)
/* PRIVATE FUNCTIONS ********************************************************/ /* PRIVATE FUNCTIONS ********************************************************/
VOID VOID
HalInitializeDisplay (boot_param *bp) HalInitializeDisplay (PLOADER_PARAMETER_BLOCK LoaderBlock)
/* /*
* FUNCTION: Initalize the display * FUNCTION: Initalize the display
* ARGUMENTS: * ARGUMENTS:
@ -113,8 +113,8 @@ HalInitializeDisplay (boot_param *bp)
// VideoBuffer = HalMapPhysicalMemory (0xb8000, 2); // VideoBuffer = HalMapPhysicalMemory (0xb8000, 2);
/* Set cursor position */ /* Set cursor position */
CursorX = bp->cursorx; CursorX = LoaderBlock->cursorx;
CursorY = bp->cursory; CursorY = LoaderBlock->cursory;
/* read screen size from the crtc */ /* read screen size from the crtc */
/* FIXME: screen size should be read from the boot paramseters */ /* FIXME: screen size should be read from the boot paramseters */

View file

@ -1,4 +1,4 @@
/* $Id: dma.c,v 1.6 2000/06/12 14:53:38 ekohl Exp $ /* $Id: dma.c,v 1.7 2000/07/01 18:23:06 ekohl Exp $
* *
* COPYRIGHT: See COPYING in the top level directory * COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel * PROJECT: ReactOS kernel
@ -159,12 +159,4 @@ HalReadDmaCounter (
UNIMPLEMENTED; UNIMPLEMENTED;
} }
ULONG KeGetDcacheFillSize()
/*
* FUNCTION: Returns the microprocessor's data cache-line boundary in bytes
*/
{
return(1);
}
/* EOF */ /* EOF */

View file

@ -1,4 +1,4 @@
/* $Id: halinit.c,v 1.11 2000/04/09 15:58:13 ekohl Exp $ /* $Id: halinit.c,v 1.12 2000/07/01 18:23:06 ekohl Exp $
* *
* COPYRIGHT: See COPYING in the top level directory * COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel * PROJECT: ReactOS kernel
@ -24,13 +24,13 @@
BOOLEAN BOOLEAN
STDCALL STDCALL
HalInitSystem ( HalInitSystem (
ULONG Phase, ULONG BootPhase,
boot_param *bp PLOADER_PARAMETER_BLOCK LoaderBlock
) )
{ {
if (Phase == 0) if (BootPhase == 0)
{ {
HalInitializeDisplay (bp); HalInitializeDisplay (LoaderBlock);
HalpCalibrateStallExecution (); HalpCalibrateStallExecution ();
KeInitExceptions (); KeInitExceptions ();
HalpInitIRQs (); HalpInitIRQs ();

View file

@ -24,7 +24,7 @@ VOID Hal_bios32_probe(VOID);
*/ */
BOOLEAN Hal_bios32_is_service_present(ULONG service); BOOLEAN Hal_bios32_is_service_present(ULONG service);
VOID HalInitializeDisplay (boot_param *bp); VOID HalInitializeDisplay (PLOADER_PARAMETER_BLOCK LoaderBlock);
VOID HalResetDisplay (VOID); VOID HalResetDisplay (VOID);
VOID VOID
@ -37,12 +37,4 @@ VOID HalpCalibrateStallExecution(VOID);
VOID HalpDispatchInterrupt (ULONG irq); VOID HalpDispatchInterrupt (ULONG irq);
VOID HalpInitIRQs (VOID); VOID HalpInitIRQs (VOID);
BOOLEAN
STDCALL
HalInitSystem (
ULONG Phase,
boot_param *bp
);
#endif /* __INTERNAL_HAL_HAL_H */ #endif /* __INTERNAL_HAL_HAL_H */

View file

@ -19,8 +19,10 @@ BOOLEAN KeDispatcherObjectWake(DISPATCHER_HEADER* hdr);
VOID KiInterruptDispatch(ULONG irq); VOID KiInterruptDispatch(ULONG irq);
VOID KiDispatchInterrupt(ULONG irq); VOID KiDispatchInterrupt(ULONG irq);
VOID KeDrainApcQueue(VOID);
VOID KeDrainDpcQueue(VOID); VOID KeDrainDpcQueue(VOID);
VOID KeExpireTimers(VOID); VOID KeExpireTimers(VOID);
PKPROCESS KeGetCurrentProcess(VOID);
NTSTATUS KeAddThreadTimeout(PKTHREAD Thread, PLARGE_INTEGER Interval); NTSTATUS KeAddThreadTimeout(PKTHREAD Thread, PLARGE_INTEGER Interval);
VOID KeInitializeDispatcherHeader(DISPATCHER_HEADER* Header, ULONG Type, VOID KeInitializeDispatcherHeader(DISPATCHER_HEADER* Header, ULONG Type,
ULONG Size, ULONG SignalState); ULONG Size, ULONG SignalState);
@ -33,6 +35,16 @@ VOID KeCallApcsThread(VOID);
VOID KeRemoveAllWaitsThread(PETHREAD Thread, NTSTATUS WaitStatus); VOID KeRemoveAllWaitsThread(PETHREAD Thread, NTSTATUS WaitStatus);
PULONG KeGetStackTopThread(PETHREAD Thread); PULONG KeGetStackTopThread(PETHREAD Thread);
/*
* 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);
/* INITIALIZATION FUNCTIONS *************************************************/ /* INITIALIZATION FUNCTIONS *************************************************/
VOID KeInitExceptions(VOID); VOID KeInitExceptions(VOID);

View file

@ -7,41 +7,6 @@
#ifndef __ASM__ #ifndef __ASM__
typedef struct
{
/*
* Magic value (useless really)
*/
unsigned int magic;
/*
* Cursor position
*/
unsigned int cursorx;
unsigned int cursory;
/*
* Number of files (including the kernel) loaded
*/
unsigned int nr_files;
/*
* Range of physical memory being used by the system
*/
unsigned int start_mem;
unsigned int end_mem;
/*
* List of module lengths (terminated by a 0)
*/
unsigned int module_length[64];
/*
* Kernel parameter string
*/
char kernel_parameters[256];
} boot_param;
#include <ddk/ntddk.h> #include <ddk/ntddk.h>
#include <stdarg.h> #include <stdarg.h>
@ -78,7 +43,7 @@ VOID NtInit(VOID);
/* /*
* Initalization functions (called once by main()) * Initalization functions (called once by main())
*/ */
VOID MmInitSystem(ULONG Phase, boot_param* bp, ULONG LastKernelAddress); VOID MmInitSystem(ULONG Phase, PLOADER_PARAMETER_BLOCK LoaderBlock, ULONG LastKernelAddress);
VOID IoInit(VOID); VOID IoInit(VOID);
VOID ObInit(VOID); VOID ObInit(VOID);
VOID PsInit(VOID); VOID PsInit(VOID);
@ -86,7 +51,7 @@ VOID TstBegin(VOID);
VOID KeInit(VOID); VOID KeInit(VOID);
VOID CmInitializeRegistry(VOID); VOID CmInitializeRegistry(VOID);
VOID CmImportHive(PCHAR); VOID CmImportHive(PCHAR);
VOID KdInitSystem(ULONG Reserved, boot_param* BootParam); VOID KdInitSystem(ULONG Reserved, PLOADER_PARAMETER_BLOCK LoaderBlock);
#endif /* __ASM__ */ #endif /* __ASM__ */

View file

@ -1,4 +1,4 @@
/* $Id: kdebug.c,v 1.11 2000/05/24 22:29:36 dwelch Exp $ /* $Id: kdebug.c,v 1.12 2000/07/01 18:25:00 ekohl Exp $
* *
* COPYRIGHT: See COPYING in the top level directory * COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel * PROJECT: ReactOS kernel
@ -64,8 +64,8 @@ PrintString (char* fmt,...)
VOID VOID
KdInitSystem ( KdInitSystem (
ULONG Reserved, ULONG Reserved,
boot_param* BootParam PLOADER_PARAMETER_BLOCK LoaderBlock
) )
{ {
KD_PORT_INFORMATION PortInfo; KD_PORT_INFORMATION PortInfo;
@ -81,7 +81,7 @@ KdInitSystem (
*/ */
/* check for 'DEBUGPORT' */ /* check for 'DEBUGPORT' */
p1 = BootParam->kernel_parameters; p1 = LoaderBlock->kernel_parameters;
while (p1 && (p2 = strchr (p1, '/'))) while (p1 && (p2 = strchr (p1, '/')))
{ {
p2++; p2++;
@ -120,7 +120,7 @@ KdInitSystem (
} }
/* check for 'BAUDRATE' */ /* check for 'BAUDRATE' */
p1 = BootParam->kernel_parameters; p1 = LoaderBlock->kernel_parameters;
while (p1 && (p2 = strchr (p1, '/'))) while (p1 && (p2 = strchr (p1, '/')))
{ {
p2++; p2++;
@ -143,7 +143,7 @@ KdInitSystem (
} }
/* Check for 'DEBUG'. Dont' accept 'DEBUGPORT'!*/ /* Check for 'DEBUG'. Dont' accept 'DEBUGPORT'!*/
p1 = BootParam->kernel_parameters; p1 = LoaderBlock->kernel_parameters;
while (p1 && (p2 = strchr (p1, '/'))) while (p1 && (p2 = strchr (p1, '/')))
{ {
p2++; p2++;
@ -159,7 +159,7 @@ KdInitSystem (
} }
/* Check for 'NODEBUG' */ /* Check for 'NODEBUG' */
p1 = BootParam->kernel_parameters; p1 = LoaderBlock->kernel_parameters;
while (p1 && (p2 = strchr (p1, '/'))) while (p1 && (p2 = strchr (p1, '/')))
{ {
p2++; p2++;
@ -173,7 +173,7 @@ KdInitSystem (
} }
/* Check for 'CRASHDEBUG' */ /* Check for 'CRASHDEBUG' */
p1 = BootParam->kernel_parameters; p1 = LoaderBlock->kernel_parameters;
while (p1 && (p2 = strchr (p1, '/'))) while (p1 && (p2 = strchr (p1, '/')))
{ {
p2++; p2++;
@ -187,7 +187,7 @@ KdInitSystem (
} }
/* Check for 'BREAK' */ /* Check for 'BREAK' */
p1 = BootParam->kernel_parameters; p1 = LoaderBlock->kernel_parameters;
while (p1 && (p2 = strchr (p1, '/'))) while (p1 && (p2 = strchr (p1, '/')))
{ {
p2++; p2++;

View file

@ -1,4 +1,4 @@
/* $Id: bug.c,v 1.11 2000/06/04 19:50:12 ekohl Exp $ /* $Id: bug.c,v 1.12 2000/07/01 18:26:10 ekohl Exp $
* *
* COPYRIGHT: See COPYING in the top level directory * COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel * PROJECT: ReactOS kernel
@ -26,6 +26,12 @@ VOID PsDumpThreads(VOID);
/* FUNCTIONS *****************************************************************/ /* FUNCTIONS *****************************************************************/
VOID KeInitializeBugCheck(VOID)
{
InitializeListHead(&BugcheckCallbackListHead);
InBugCheck = 0;
}
BOOLEAN BOOLEAN
STDCALL STDCALL
KeDeregisterBugCheckCallback ( KeDeregisterBugCheckCallback (
@ -35,12 +41,6 @@ KeDeregisterBugCheckCallback (
UNIMPLEMENTED; UNIMPLEMENTED;
} }
VOID KeInitializeBugCheck(VOID)
{
InitializeListHead(&BugcheckCallbackListHead);
InBugCheck = 0;
}
VOID KeInitializeCallbackRecord(PKBUGCHECK_CALLBACK_RECORD CallbackRecord) VOID KeInitializeCallbackRecord(PKBUGCHECK_CALLBACK_RECORD CallbackRecord)
{ {
UNIMPLEMENTED; UNIMPLEMENTED;

View file

@ -1,4 +1,5 @@
/* /* $Id: dpc.c,v 1.16 2000/07/01 18:26:10 ekohl Exp $
*
* COPYRIGHT: See COPYING in the top level directory * COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel * PROJECT: ReactOS kernel
* FILE: ntoskrnl/ke/dpc.c * FILE: ntoskrnl/ke/dpc.c
@ -8,7 +9,7 @@
* 28/05/98: Created * 28/05/98: Created
* 12/3/99: Phillip Susi: Fixed IRQL problem * 12/3/99: Phillip Susi: Fixed IRQL problem
*/ */
/* /*
* NOTE: See also the higher level support routines in ntoskrnl/io/dpc.c * NOTE: See also the higher level support routines in ntoskrnl/io/dpc.c
*/ */
@ -139,7 +140,7 @@ BOOLEAN STDCALL KeInsertQueueDpc (PKDPC Dpc,
assert(KeGetCurrentIrql()>=DISPATCH_LEVEL); assert(KeGetCurrentIrql()>=DISPATCH_LEVEL);
Dpc->Number=0; Dpc->Number=0;
Dpc->Importance=Medium; Dpc->Importance=MediumImportance;
Dpc->SystemArgument1=SystemArgument1; Dpc->SystemArgument1=SystemArgument1;
Dpc->SystemArgument2=SystemArgument2; Dpc->SystemArgument2=SystemArgument2;
if (Dpc->Lock) if (Dpc->Lock)
@ -158,6 +159,40 @@ BOOLEAN STDCALL KeInsertQueueDpc (PKDPC Dpc,
return(TRUE); return(TRUE);
} }
/*
* FUNCTION: Specifies the DPCs importance
* ARGUMENTS:
* Dpc = Initalizes DPC
* Importance = DPC importance
* RETURNS: None
*/
VOID
STDCALL
KeSetImportanceDpc (
IN PKDPC Dpc,
IN KDPC_IMPORTANCE Importance
)
{
Dpc->Importance = Importance;
}
/*
* FUNCTION: Specifies on which processor the DPC will run
* ARGUMENTS:
* Dpc = Initalizes DPC
* Number = Processor number
* RETURNS: None
*/
VOID
STDCALL
KeSetTargetProcessorDpc (
IN PKDPC Dpc,
IN CCHAR Number
)
{
UNIMPLEMENTED;
}
VOID KeInitDpc(VOID) VOID KeInitDpc(VOID)
/* /*
* FUNCTION: Initialize DPC handling * FUNCTION: Initialize DPC handling
@ -167,3 +202,4 @@ VOID KeInitDpc(VOID)
KeInitializeSpinLock(&DpcQueueLock); KeInitializeSpinLock(&DpcQueueLock);
} }
/* EOF */

View file

@ -1,4 +1,4 @@
/* $Id: main.c,v 1.49 2000/06/30 22:53:32 ekohl Exp $ /* $Id: main.c,v 1.50 2000/07/01 18:26:11 ekohl Exp $
* *
* COPYRIGHT: See COPYING in the top level directory * COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel * PROJECT: ReactOS kernel
@ -163,7 +163,8 @@ unsigned int old_idt[256][2];
//extern unsigned int idt[]; //extern unsigned int idt[];
unsigned int old_idt_valid = 1; unsigned int old_idt_valid = 1;
void _main(boot_param* _bp)
void _main (PLOADER_PARAMETER_BLOCK LoaderBlock)
/* /*
* FUNCTION: Called by the boot loader to start the kernel * FUNCTION: Called by the boot loader to start the kernel
* ARGUMENTS: * ARGUMENTS:
@ -175,31 +176,31 @@ void _main(boot_param* _bp)
unsigned int i; unsigned int i;
unsigned int start; unsigned int start;
unsigned int start1; unsigned int start1;
boot_param bp;
unsigned int last_kernel_address; unsigned int last_kernel_address;
// memset((void *)&edata,0,((int)&end)-((int)&edata));
/* /*
* Copy the parameters to a local buffer because lowmem will go away * Copy the parameters to a local buffer because lowmem will go away
*/ */
memcpy(&bp,_bp,sizeof(boot_param)); memcpy (&KeLoaderBlock,
LoaderBlock,
sizeof(LOADER_PARAMETER_BLOCK));
/* /*
* FIXME: Preliminary hack!!!! * FIXME: Preliminary hack!!!!
* Initializes the kernel parameter line. * Initializes the kernel parameter line.
* This should be done by the boot loader. * This should be done by the boot loader.
*/ */
strcpy (bp.kernel_parameters, "/DEBUGPORT=SCREEN"); strcpy (KeLoaderBlock.kernel_parameters,
"/DEBUGPORT=SCREEN");
/* /*
* Initialization phase 0 * Initialization phase 0
*/ */
HalInitSystem (0, &bp); HalInitSystem (0, &KeLoaderBlock);
HalDisplayString("Starting ReactOS "KERNEL_VERSION_STR" (Build "KERNEL_VERSION_BUILD_STR")\n"); HalDisplayString("Starting ReactOS "KERNEL_VERSION_STR" (Build "KERNEL_VERSION_BUILD_STR")\n");
start = KERNEL_BASE + PAGE_ROUND_UP(bp.module_length[0]); start = KERNEL_BASE + PAGE_ROUND_UP(KeLoaderBlock.module_length[0]);
if (start < ((int)&end)) if (start < ((int)&end))
{ {
PrintString("start %x end %x\n",start,(int)&end); PrintString("start %x end %x\n",start,(int)&end);
@ -209,22 +210,22 @@ void _main(boot_param* _bp)
for(;;) for(;;)
__asm__("hlt\n\t"); __asm__("hlt\n\t");
} }
start1 = start+PAGE_ROUND_UP(bp.module_length[1]); start1 = start+PAGE_ROUND_UP(KeLoaderBlock.module_length[1]);
last_kernel_address = KERNEL_BASE; last_kernel_address = KERNEL_BASE;
for (i=0; i<=bp.nr_files; i++) for (i=0; i<=KeLoaderBlock.nr_files; i++)
{ {
last_kernel_address = last_kernel_address + last_kernel_address = last_kernel_address +
PAGE_ROUND_UP(bp.module_length[i]); PAGE_ROUND_UP(KeLoaderBlock.module_length[i]);
} }
DPRINT("MmInitSystem()\n"); DPRINT("MmInitSystem()\n");
MmInitSystem(0, &bp, last_kernel_address); MmInitSystem(0, &KeLoaderBlock, last_kernel_address);
/* /*
* Initialize the kernel debugger * Initialize the kernel debugger
*/ */
KdInitSystem (0, &bp); KdInitSystem (0, &KeLoaderBlock);
if (KdPollBreakIn ()) if (KdPollBreakIn ())
{ {
DbgBreakPointWithStatus (DBG_STATUS_CONTROL_C); DbgBreakPointWithStatus (DBG_STATUS_CONTROL_C);
@ -237,9 +238,9 @@ void _main(boot_param* _bp)
DPRINT("Kernel Initialization Phase 1\n"); DPRINT("Kernel Initialization Phase 1\n");
DPRINT("HalInitSystem()\n"); DPRINT("HalInitSystem()\n");
HalInitSystem (1, &bp); HalInitSystem (1, &KeLoaderBlock);
DPRINT("MmInitSystem()\n"); DPRINT("MmInitSystem()\n");
MmInitSystem(1, &bp, 0); MmInitSystem(1, &KeLoaderBlock, 0);
DPRINT("KeInit()\n"); DPRINT("KeInit()\n");
KeInit(); KeInit();
@ -265,31 +266,31 @@ void _main(boot_param* _bp)
/* /*
* Initalize services loaded at boot time * Initalize services loaded at boot time
*/ */
DPRINT1("%d files loaded\n",bp.nr_files); DPRINT1("%d files loaded\n",KeLoaderBlock.nr_files);
/* Pass 1: load registry chunks passed in */ /* Pass 1: load registry chunks passed in */
start = KERNEL_BASE + PAGE_ROUND_UP(bp.module_length[0]); start = KERNEL_BASE + PAGE_ROUND_UP(KeLoaderBlock.module_length[0]);
for (i = 1; i < bp.nr_files; i++) for (i = 1; i < KeLoaderBlock.nr_files; i++)
{ {
if (!strcmp ((PCHAR) start, "REGEDIT4")) if (!strcmp ((PCHAR) start, "REGEDIT4"))
{ {
DPRINT1("process registry chunk at %08lx\n", start); DPRINT1("process registry chunk at %08lx\n", start);
CmImportHive((PCHAR) start); CmImportHive((PCHAR) start);
} }
start = start + bp.module_length[i]; start = start + KeLoaderBlock.module_length[i];
} }
/* Pass 2: process boot loaded drivers */ /* Pass 2: process boot loaded drivers */
start = KERNEL_BASE + PAGE_ROUND_UP(bp.module_length[0]); start = KERNEL_BASE + PAGE_ROUND_UP(KeLoaderBlock.module_length[0]);
start1 = start + bp.module_length[1]; start1 = start + KeLoaderBlock.module_length[1];
for (i=1;i<bp.nr_files;i++) for (i=1;i<KeLoaderBlock.nr_files;i++)
{ {
if (strcmp ((PCHAR) start, "REGEDIT4")) if (strcmp ((PCHAR) start, "REGEDIT4"))
{ {
DPRINT1("process module at %08lx\n", start); DPRINT1("process module at %08lx\n", start);
LdrProcessDriver((PVOID)start); LdrProcessDriver((PVOID)start);
} }
start = start + bp.module_length[i]; start = start + KeLoaderBlock.module_length[i];
} }
/* Create the SystemRoot symbolic link */ /* Create the SystemRoot symbolic link */
@ -323,5 +324,4 @@ void _main(boot_param* _bp)
PsTerminateSystemThread(STATUS_SUCCESS); PsTerminateSystemThread(STATUS_SUCCESS);
} }
/* EOF */ /* EOF */

View file

@ -1,4 +1,4 @@
/* $Id: mdl.c,v 1.18 2000/04/02 13:32:41 ea Exp $ /* $Id: mdl.c,v 1.19 2000/07/01 18:27:03 ekohl Exp $
* *
* COPYRIGHT: See COPYING in the top level directory * COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel * PROJECT: ReactOS kernel
@ -109,12 +109,6 @@ VOID MmPrepareMdlForReuse(PMDL Mdl)
UNIMPLEMENTED; UNIMPLEMENTED;
} }
VOID KeFlushIoBuffers(PMDL Mdl, BOOLEAN ReadOperation, BOOLEAN DmaOperation)
{
/* NOP on the x86 */
/* See ntddk.h from Windows 98 DDK */
}
VOID MmBuildMdlFromPages(PMDL Mdl) VOID MmBuildMdlFromPages(PMDL Mdl)
{ {
ULONG i; ULONG i;
@ -129,9 +123,9 @@ VOID MmBuildMdlFromPages(PMDL Mdl)
} }
} }
VOID STDCALL MmProbeAndLockPages(PMDL Mdl,
VOID STDCALL MmProbeAndLockPages(PMDL Mdl,
KPROCESSOR_MODE AccessMode, KPROCESSOR_MODE AccessMode,
LOCK_OPERATION Operation) LOCK_OPERATION Operation)
/* /*

View file

@ -1,4 +1,4 @@
/* $Id: mm.c,v 1.31 2000/06/25 03:59:15 dwelch Exp $ /* $Id: mm.c,v 1.32 2000/07/01 18:27:03 ekohl Exp $
* *
* COPYRIGHT: See COPYING in the top directory * COPYRIGHT: See COPYING in the top directory
* PROJECT: ReactOS kernel * PROJECT: ReactOS kernel
@ -62,20 +62,20 @@ VOID MiShutdownMemoryManager(VOID)
{ {
} }
VOID MmInitVirtualMemory(boot_param* bp, ULONG LastKernelAddress) VOID MmInitVirtualMemory(PLOADER_PARAMETER_BLOCK LoaderBlock, ULONG LastKernelAddress)
/* /*
* FUNCTION: Intialize the memory areas list * FUNCTION: Intialize the memory areas list
* ARGUMENTS: * ARGUMENTS:
* bp = Pointer to the boot parameters * LoaderBlock = Pointer to the boot parameters
* kernel_len = Length of the kernel * kernel_len = Length of the kernel
*/ */
{ {
unsigned int kernel_len = bp->end_mem - bp->start_mem; unsigned int kernel_len = LoaderBlock->end_mem - LoaderBlock->start_mem;
PVOID BaseAddress; PVOID BaseAddress;
ULONG Length; ULONG Length;
ULONG ParamLength = kernel_len; ULONG ParamLength = kernel_len;
DPRINT("MmInitVirtualMemory(%x)\n",bp); DPRINT("MmInitVirtualMemory(%x)\n",LoaderBlock);
LastKernelAddress = PAGE_ROUND_UP(LastKernelAddress); LastKernelAddress = PAGE_ROUND_UP(LastKernelAddress);
@ -229,7 +229,7 @@ MM_SYSTEM_SIZE STDCALL MmQuerySystemSize(VOID)
return(MmSystemSize); return(MmSystemSize);
} }
void MmInitialize(boot_param* bp, ULONG LastKernelAddress) void MmInitialize(PLOADER_PARAMETER_BLOCK LoaderBlock, ULONG LastKernelAddress)
/* /*
* FUNCTION: Initalize memory managment * FUNCTION: Initalize memory managment
*/ */
@ -239,7 +239,8 @@ void MmInitialize(boot_param* bp, ULONG LastKernelAddress)
int i; int i;
unsigned int kernel_len; unsigned int kernel_len;
DPRINT("MmInitialize(bp %x, LastKernelAddress %x)\n", bp, DPRINT("MmInitialize(LoaderBlock %x, LastKernelAddress %x)\n",
LoaderBlock,
LastKernelAddress); LastKernelAddress);
/* /*
@ -252,8 +253,8 @@ void MmInitialize(boot_param* bp, ULONG LastKernelAddress)
* (we assume the kernel occupies a continuous range of physical * (we assume the kernel occupies a continuous range of physical
* memory) * memory)
*/ */
first_krnl_phys_addr = bp->start_mem; first_krnl_phys_addr = LoaderBlock->start_mem;
last_krnl_phys_addr = bp->end_mem; last_krnl_phys_addr = LoaderBlock->end_mem;
DPRINT("first krnl %x\nlast krnl %x\n",first_krnl_phys_addr, DPRINT("first krnl %x\nlast krnl %x\n",first_krnl_phys_addr,
last_krnl_phys_addr); last_krnl_phys_addr);
@ -295,16 +296,20 @@ void MmInitialize(boot_param* bp, ULONG LastKernelAddress)
/* /*
* Intialize memory areas * Intialize memory areas
*/ */
MmInitVirtualMemory(bp, LastKernelAddress); MmInitVirtualMemory(LoaderBlock, LastKernelAddress);
} }
VOID MmInitSystem (ULONG Phase, boot_param* bp, ULONG LastKernelAddress) VOID MmInitSystem (
ULONG Phase,
PLOADER_PARAMETER_BLOCK LoaderBlock,
ULONG LastKernelAddress
)
{ {
if (Phase == 0) if (Phase == 0)
{ {
/* Phase 0 Initialization */ /* Phase 0 Initialization */
MmInitializeKernelAddressSpace(); MmInitializeKernelAddressSpace();
MmInitialize (bp, LastKernelAddress); MmInitialize (LoaderBlock, LastKernelAddress);
} }
else else
{ {

View file

@ -1,4 +1,4 @@
; $Id: ntoskrnl.def,v 1.77 2000/06/30 22:50:53 ekohl Exp $ ; $Id: ntoskrnl.def,v 1.78 2000/07/01 18:22:14 ekohl Exp $
; ;
; reactos/ntoskrnl/ntoskrnl.def ; reactos/ntoskrnl/ntoskrnl.def
; ;
@ -340,7 +340,6 @@ KeEnterKernelDebugger@0
;KeFindConfigurationEntry ;KeFindConfigurationEntry
;KeFindConfigurationNextEntry ;KeFindConfigurationNextEntry
;KeFlushEntireTb ;KeFlushEntireTb
KeFlushIoBuffers
KeGetCurrentThread@0 KeGetCurrentThread@0
KeGetPreviousMode@0 KeGetPreviousMode@0
;KeI386AbiosCall ;KeI386AbiosCall
@ -410,12 +409,12 @@ KeSetBasePriorityThread@8
KeSetEvent@12 KeSetEvent@12
;KeSetEventBoostPriority ;KeSetEventBoostPriority
;KeSetIdealProcessorThread ;KeSetIdealProcessorThread
;KeSetImportanceDpc KeSetImportanceDpc@8
;KeSetKernelStackSwapEnable ;KeSetKernelStackSwapEnable
KeSetPriorityThread@8 KeSetPriorityThread@8
;KeSetProfileIrql ;KeSetProfileIrql
;KeSetSwapContextNotifyRoutine ;KeSetSwapContextNotifyRoutine
;KeSetTargetProcessorDpc KeSetTargetProcessorDpc@8
;KeSetThreadSelectNotifyRoutine ;KeSetThreadSelectNotifyRoutine
;KeSetTimeIncrement ;KeSetTimeIncrement
KeSetTimer@16 KeSetTimer@16

View file

@ -1,4 +1,4 @@
; $Id: ntoskrnl.edf,v 1.64 2000/06/30 22:50:53 ekohl Exp $ ; $Id: ntoskrnl.edf,v 1.65 2000/07/01 18:22:14 ekohl Exp $
; ;
; reactos/ntoskrnl/ntoskrnl.def ; reactos/ntoskrnl/ntoskrnl.def
; ;
@ -336,7 +336,10 @@ KeDetachProcess=KeDetachProcess@0
;KeDisconnectInterrupt ;KeDisconnectInterrupt
KeEnterCriticalRegion=KeEnterCriticalRegion@0 KeEnterCriticalRegion=KeEnterCriticalRegion@0
KeEnterKernelDebugger=KeEnterKernelDebugger@0 KeEnterKernelDebugger=KeEnterKernelDebugger@0
KeFlushIoBuffers ;KeFindConfigurationEntry
;KeFindConfigurationNextEntry
;KeFlushEntireTb
KeGetCurrentThread=KeGetCurrentThread@0
KeGetPreviousMode=KeGetPreviousMode@0 KeGetPreviousMode=KeGetPreviousMode@0
;KeI386AbiosCall ;KeI386AbiosCall
;KeI386AllocateGdtSelectors ;KeI386AllocateGdtSelectors
@ -405,12 +408,12 @@ KeSetBasePriorityThread=KeSetBasePriorityThread@8
KeSetEvent=KeSetEvent@12 KeSetEvent=KeSetEvent@12
;KeSetEventBoostPriority ;KeSetEventBoostPriority
;KeSetIdealProcessorThread ;KeSetIdealProcessorThread
;KeSetImportanceDpc KeSetImportanceDpc=KeSetImportanceDpc@8
;KeSetKernelStackSwapEnable ;KeSetKernelStackSwapEnable
KeSetPriorityThread=KeSetPriorityThread@8 KeSetPriorityThread=KeSetPriorityThread@8
;KeSetProfileIrql ;KeSetProfileIrql
;KeSetSwapContextNotifyRoutine ;KeSetSwapContextNotifyRoutine
;KeSetTargetProcessorDpc KeSetTargetProcessorDpc=KeSetTargetProcessorDpc@8
;KeSetThreadSelectNotifyRoutine ;KeSetThreadSelectNotifyRoutine
;KeSetTimeIncrement ;KeSetTimeIncrement
KeSetTimer=KeSetTimer@16 KeSetTimer=KeSetTimer@16