diff --git a/reactos/ntoskrnl/cc/cacheman.c b/reactos/ntoskrnl/cc/cacheman.c index 195027b82ea..d9217e28819 100644 --- a/reactos/ntoskrnl/cc/cacheman.c +++ b/reactos/ntoskrnl/cc/cacheman.c @@ -14,8 +14,27 @@ #define NDEBUG #include +PFSN_PREFETCHER_GLOBALS CcPfGlobals; + /* FUNCTIONS *****************************************************************/ +VOID +NTAPI +CcPfInitializePrefetcher(VOID) +{ + /* Notify debugger */ + DbgPrintEx(DPFLTR_PREFETCHER_ID, + DPFLTR_TRACE_LEVEL, + "CCPF: InitializePrefetecher()\n"); + + /* Setup the Prefetcher Data */ + InitializeListHead(&CcPfGlobals.ActiveTraces); + InitializeListHead(&CcPfGlobals.CompletedTraces); + ExInitializeFastMutex(&CcPfGlobals.CompletedTracesLock); + + /* FIXME: Setup the rest of the prefetecher */ +} + BOOLEAN NTAPI CcInitializeCacheManager(VOID) diff --git a/reactos/ntoskrnl/ex/hdlsterm.c b/reactos/ntoskrnl/ex/hdlsterm.c new file mode 100644 index 00000000000..d8d988162a9 --- /dev/null +++ b/reactos/ntoskrnl/ex/hdlsterm.c @@ -0,0 +1,32 @@ +/* + * PROJECT: ReactOS Kernel + * LICENSE: GPL - See COPYING in the top level directory + * FILE: ntoskrnl/ex/hdlsterm.c + * PURPOSE: Headless Terminal Support + * PROGRAMMERS: Alex Ionescu (alex.ionescu@reactos.org) + */ + +/* INCLUDES ******************************************************************/ + +#include +#include + +/* GLOBALS *******************************************************************/ + +/* FUNCTIONS *****************************************************************/ + +VOID +NTAPI +HeadlessInit(IN PLOADER_PARAMETER_BLOCK LoaderBlock) +{ + PHEADLESS_LOADER_BLOCK HeadlessBlock; + + /* Get the headless loader block */ + HeadlessBlock = LoaderBlock->Extension->HeadlessLoaderBlock; + if (HeadlessBlock) + { + DPRINT1("ReactOS does not currently have Headless Terminal support!\n"); + } +} + +/* EOF */ diff --git a/reactos/ntoskrnl/ex/time.c b/reactos/ntoskrnl/ex/time.c index 86ceef45a94..8dd4aaed68f 100644 --- a/reactos/ntoskrnl/ex/time.c +++ b/reactos/ntoskrnl/ex/time.c @@ -21,6 +21,7 @@ TIME_ZONE_INFORMATION ExpTimeZoneInfo; ULONG ExpLastTimeZoneBias = -1; LARGE_INTEGER ExpTimeZoneBias; +ULONG ExpAltTimeZoneBias; ULONG ExpTimeZoneId; ULONG ExpTickCountMultiplier; ERESOURCE ExpTimeRefreshLock; diff --git a/reactos/ntoskrnl/ex/xipdisp.c b/reactos/ntoskrnl/ex/xipdisp.c new file mode 100644 index 00000000000..c767e4af296 --- /dev/null +++ b/reactos/ntoskrnl/ex/xipdisp.c @@ -0,0 +1,77 @@ +/* + * PROJECT: ReactOS Kernel + * LICENSE: GPL - See COPYING in the top level directory + * FILE: ntoskrnl/ex/xipdisp.c + * PURPOSE: eXecute In Place (XIP) Support. + * PROGRAMMERS: Alex Ionescu (alex.ionescu@reactos.org) + */ + +/* INCLUDES ******************************************************************/ + +#include +#include + +/* GLOBALS *******************************************************************/ + +/* FUNCTIONS *****************************************************************/ + +PMEMORY_ALLOCATION_DESCRIPTOR +NTAPI +XIPpFindMemoryDescriptor(IN PLOADER_PARAMETER_BLOCK LoaderBlock) +{ + PLIST_ENTRY NextEntry; + PMEMORY_ALLOCATION_DESCRIPTOR Descriptor = NULL; + + /* Loop the memory descriptors */ + for (NextEntry = LoaderBlock->MemoryDescriptorListHead.Flink; + NextEntry != &LoaderBlock->MemoryDescriptorListHead; + NextEntry = NextEntry->Flink) + { + /* Get the current descriptor and check if it's the XIP ROM */ + Descriptor = CONTAINING_RECORD(NextEntry, + MEMORY_ALLOCATION_DESCRIPTOR, + ListEntry); + if (Descriptor->MemoryType == LoaderXIPRom) return Descriptor; + } + + /* Nothing found if we got here */ + return NULL; +} + +VOID +NTAPI +XIPInit(IN PLOADER_PARAMETER_BLOCK LoaderBlock) +{ + PCHAR CommandLine, XipBoot, XipRom, XipMegs, XipVerbose; + PMEMORY_ALLOCATION_DESCRIPTOR XipDescriptor; + + /* Get the command line */ + CommandLine = LoaderBlock->LoadOptions; + if (!CommandLine) return; + + /* Get XIP settings */ + XipBoot = strstr(CommandLine, "XIPBOOT"); + XipRom = strstr(CommandLine, "XIPROM="); + XipMegs = strstr(CommandLine, "XIPMEGS="); + XipVerbose = strstr(CommandLine, "XIPVERBOSE"); + + /* Check if this is a verbose boot */ + if (XipVerbose) + { + /* Print out our header */ + DbgPrint("\n\nXIP: debug timestamp at line %d in %s: <<<%s %s>>>\n\n", + __LINE__, + __FILE__, + __DATE__, + __TIME__); + } + + /* Find the XIP memory descriptor */ + XipDescriptor = XIPpFindMemoryDescriptor(LoaderBlock); + if (!XipDescriptor) return; + + /* FIXME: TODO */ + DPRINT1("ReactOS does not yet support eXecute In Place boot technology\n"); +} + +/* EOF */ diff --git a/reactos/ntoskrnl/include/internal/cc.h b/reactos/ntoskrnl/include/internal/cc.h index f69bf01f337..7e1ba8a8c58 100644 --- a/reactos/ntoskrnl/include/internal/cc.h +++ b/reactos/ntoskrnl/include/internal/cc.h @@ -1,6 +1,107 @@ #ifndef __INCLUDE_INTERNAL_CC_H #define __INCLUDE_INTERNAL_CC_H +typedef struct _PF_SCENARIO_ID +{ + WCHAR ScenName[30]; + ULONG HashId; +} PF_SCENARIO_ID, *PPF_SCENARIO_ID; + +typedef struct _PF_LOG_ENTRY +{ + ULONG FileOffset:30; + ULONG Type:2; + union + { + ULONG FileKey; + ULONG FileSequenceNumber; + }; +} PF_LOG_ENTRY, *PPF_LOG_ENTRY; + +typedef struct _PFSN_LOG_ENTRIES +{ + LIST_ENTRY TraceBuffersLink; + LONG NumEntries; + LONG MaxEntries; + PF_LOG_ENTRY Entries[ANYSIZE_ARRAY]; +} PFSN_LOG_ENTRIES, *PPFSN_LOG_ENTRIES; + +typedef struct _PF_SECTION_INFO +{ + ULONG FileKey; + ULONG FileSequenceNumber; + ULONG FileIdLow; + ULONG FileIdHigh; +} PF_SECTION_INFO, *PPF_SECTION_INFO; + +typedef struct _PF_TRACE_HEADER +{ + ULONG Version; + ULONG MagicNumber; + ULONG Size; + PF_SCENARIO_ID ScenarioId; + ULONG ScenarioType; // PF_SCENARIO_TYPE + ULONG EventEntryIdxs[8]; + ULONG NumEventEntryIdxs; + ULONG TraceBufferOffset; + ULONG NumEntries; + ULONG SectionInfoOffset; + ULONG NumSections; + ULONG FaultsPerPeriod[10]; + LARGE_INTEGER LaunchTime; + ULONGLONG Reserved[5]; +} PF_TRACE_HEADER, *PPF_TRACE_HEADER; + +typedef struct _PFSN_TRACE_DUMP +{ + LIST_ENTRY CompletedTracesLink; + PF_TRACE_HEADER Trace; +} PFSN_TRACE_DUMP, *PPFSN_TRACE_DUMP; + +typedef struct _PFSN_TRACE_HEADER +{ + ULONG Magic; + LIST_ENTRY ActiveTracesLink; + PF_SCENARIO_ID ScenarioId; + ULONG ScenarioType; // PF_SCENARIO_TYPE + ULONG EventEntryIdxs[8]; + ULONG NumEventEntryIdxs; + PPFSN_LOG_ENTRIES CurrentTraceBuffer; + LIST_ENTRY TraceBuffersList; + ULONG NumTraceBuffers; + KSPIN_LOCK TraceBufferSpinLock; + KTIMER TraceTimer; + LARGE_INTEGER TraceTimerPeriod; + KDPC TraceTimerDpc; + KSPIN_LOCK TraceTimerSpinLock; + ULONG FaultsPerPeriod[10]; + LONG LastNumFaults; + LONG CurPeriod; + LONG NumFaults; + LONG MaxFaults; + PEPROCESS Process; + EX_RUNDOWN_REF RefCount; + WORK_QUEUE_ITEM EndTraceWorkItem; + LONG EndTraceCalled; + PPFSN_TRACE_DUMP TraceDump; + NTSTATUS TraceDumpStatus; + LARGE_INTEGER LaunchTime; + PPF_SECTION_INFO SectionInfo; + ULONG SectionInfoCount; +} PFSN_TRACE_HEADER, *PPFSN_TRACE_HEADER; + +typedef struct _PFSN_PREFETCHER_GLOBALS +{ + LIST_ENTRY ActiveTraces; + KSPIN_LOCK ActiveTracesLock; + PPFSN_TRACE_HEADER SystemWideTrace; + LIST_ENTRY CompletedTraces; + FAST_MUTEX CompletedTracesLock; + LONG NumCompletedTraces; + PKEVENT CompletedTracesEvent; + LONG ActivePrefetches; +} PFSN_PREFETCHER_GLOBALS, *PPFSN_PREFETCHER_GLOBALS; + typedef struct _BCB { LIST_ENTRY BcbSegmentListHead; @@ -61,6 +162,12 @@ typedef struct _INTERNAL_BCB CSHORT RefCount; /* (At offset 0x34 on WinNT4) */ } INTERNAL_BCB, *PINTERNAL_BCB; +VOID +NTAPI +CcPfInitializePrefetcher( + VOID +); + VOID NTAPI CcMdlReadComplete2( diff --git a/reactos/ntoskrnl/include/internal/po.h b/reactos/ntoskrnl/include/internal/po.h index c627dfbd4d7..f1cbc2192c0 100644 --- a/reactos/ntoskrnl/include/internal/po.h +++ b/reactos/ntoskrnl/include/internal/po.h @@ -70,6 +70,15 @@ PopAddRemoveSysCapsCallback( IN PVOID Context ); +// +// Notifications +// +VOID +NTAPI +PoNotifySystemTimeSet( + VOID +); + // // Global data inside the Power Manager // diff --git a/reactos/ntoskrnl/ntoskrnl.mc b/reactos/ntoskrnl/ntoskrnl.mc index 589a2742cad..8e5d3c68459 100644 --- a/reactos/ntoskrnl/ntoskrnl.mc +++ b/reactos/ntoskrnl/ntoskrnl.mc @@ -1130,6 +1130,38 @@ The BIOS in this system is not fully ACPI compliant. Please contact your system vendor for an updated BIOS. . +MessageId=0xA8 +Severity=Informational +Facility=System +SymbolicName=BOOTING_IN_SAFEMODE_MINIMAL +Language=English +The system is booting in safemode - Minimal Services +. + +MessageId=0xA9 +Severity=Informational +Facility=System +SymbolicName=BOOTING_IN_SAFEMODE_NETWORK +Language=English +The system is booting in safemode - Minimal Services with Network +. + +MessageId=0xAA +Severity=Informational +Facility=System +SymbolicName=BOOTING_IN_SAFEMODE_DSREPAIR +Language=English +The system is booting in safemode - Directory Services Repair +. + +MessageId=0xB7 +Severity=Informational +Facility=System +SymbolicName=BOOTLOG_ENABLED +Language=English +Boot Logging Enabled +. + MessageId=0xBE Severity=Success Facility=System @@ -1337,7 +1369,7 @@ Severity=Informational Facility=System SymbolicName=WINDOWS_NT_MP_STRING Language=English -MulitProcessor Kernel +MultiProcessor Kernel . MessageId=0x9D diff --git a/reactos/ntoskrnl/ntoskrnl.rbuild b/reactos/ntoskrnl/ntoskrnl.rbuild index b158724b460..c3798a45627 100644 --- a/reactos/ntoskrnl/ntoskrnl.rbuild +++ b/reactos/ntoskrnl/ntoskrnl.rbuild @@ -124,6 +124,7 @@ fmutex.c handle.c harderr.c + hdlsterm.c init.c keyedevt.c locale.c @@ -141,6 +142,7 @@ uuid.c win32k.c work.c + xipdisp.c zone.c diff --git a/reactos/ntoskrnl/po/events.c b/reactos/ntoskrnl/po/events.c index 35d7887d426..5a730a795a0 100644 --- a/reactos/ntoskrnl/po/events.c +++ b/reactos/ntoskrnl/po/events.c @@ -11,6 +11,29 @@ //#define NDEBUG #include +PKWIN32_POWEREVENT_CALLOUT PopEventCallout; +extern PCALLBACK_OBJECT SetSystemTimeCallback; + +VOID +NTAPI +PoNotifySystemTimeSet(VOID) +{ + KIRQL OldIrql; + + /* Check if Win32k registered a notification callback */ + if (PopEventCallout) + { + /* Raise to dispatch */ + KeRaiseIrql(DISPATCH_LEVEL, &OldIrql); + + /* Notify the callback */ + ExNotifyCallback(SetSystemTimeCallback, NULL, NULL); + + /* Lower IRQL back */ + KeLowerIrql(OldIrql); + } +} + NTSTATUS NTAPI PopAddRemoveSysCapsCallback( diff --git a/reactos/ntoskrnl/ps/win32.c b/reactos/ntoskrnl/ps/win32.c index c09291cf497..33f7fb61665 100644 --- a/reactos/ntoskrnl/ps/win32.c +++ b/reactos/ntoskrnl/ps/win32.c @@ -20,6 +20,7 @@ PKWIN32_THREAD_CALLOUT PspW32ThreadCallout = NULL; extern PKWIN32_PARSEMETHOD_CALLOUT ExpWindowStationObjectParse; extern PKWIN32_DELETEMETHOD_CALLOUT ExpWindowStationObjectDelete; extern PKWIN32_DELETEMETHOD_CALLOUT ExpDesktopObjectDelete; +extern PKWIN32_POWEREVENT_CALLOUT PopEventCallout; /* PRIVATE FUNCTIONS *********************************************************/ @@ -112,6 +113,7 @@ PsEstablishWin32Callouts(IN PWIN32_CALLOUTS_FPNS CalloutData) ExpWindowStationObjectParse = CalloutData->WindowStationParseProcedure; ExpWindowStationObjectDelete = CalloutData->WindowStationDeleteProcedure; ExpDesktopObjectDelete = CalloutData->DesktopDeleteProcedure; + PopEventCallout = CalloutData->PowerEventCallout; } NTSTATUS