mirror of
https://github.com/reactos/reactos.git
synced 2025-08-03 17:56:00 +00:00
- Implement NtSetLdrEntries, NtVdmControl, KeSaveStateForHibernate, KeQueryActiveProcessors, KeSetDmaIoCoherency, KeFlushEntireTb, KeGetRecommendedSharedDataAlignment, KeDisableInterrupts, KeInvalidateAllCaches, KeIcacheFlushCount and remove them from stubs_asm.S
svn path=/trunk/; revision=34496
This commit is contained in:
parent
4a8378a9d2
commit
a4346dc05e
4 changed files with 169 additions and 25 deletions
|
@ -134,6 +134,13 @@ KeArmInvalidateTlbEntry(IN PVOID Address)
|
||||||
__asm__ __volatile__ ("mcr p15, 0, %0, c8, c7, 1" : : "r"(Address) : "cc");
|
__asm__ __volatile__ ("mcr p15, 0, %0, c8, c7, 1" : : "r"(Address) : "cc");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
FORCEINLINE
|
||||||
|
VOID
|
||||||
|
KeArmInvalidateAllCaches(VOID)
|
||||||
|
{
|
||||||
|
__asm__ __volatile__ ("mcr p15, 0, %0, c7, c7, 0" : : "r"(0) : "cc");
|
||||||
|
}
|
||||||
|
|
||||||
FORCEINLINE
|
FORCEINLINE
|
||||||
VOID
|
VOID
|
||||||
KeArmFlushIcache(VOID)
|
KeArmFlushIcache(VOID)
|
||||||
|
|
|
@ -16,6 +16,15 @@
|
||||||
|
|
||||||
ULONG KeFixedTbEntries;
|
ULONG KeFixedTbEntries;
|
||||||
ULONG KiDmaIoCoherency;
|
ULONG KiDmaIoCoherency;
|
||||||
|
ULONG KeIcacheFlushCount = 0;
|
||||||
|
CCHAR KeNumberProcessors;
|
||||||
|
ULONG KeDcacheFlushCount;
|
||||||
|
ULONG KeActiveProcessors;
|
||||||
|
ULONG KeProcessorArchitecture;
|
||||||
|
ULONG KeProcessorLevel;
|
||||||
|
ULONG KeProcessorRevision;
|
||||||
|
ULONG KeFeatureBits;
|
||||||
|
ULONG KeLargestCacheLine = 32; // FIXME: It depends
|
||||||
|
|
||||||
/* FUNCTIONS ******************************************************************/
|
/* FUNCTIONS ******************************************************************/
|
||||||
|
|
||||||
|
@ -115,6 +124,16 @@ KeFlushTb(VOID)
|
||||||
KeArmFlushTlb();
|
KeArmFlushTlb();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
VOID
|
||||||
|
NTAPI
|
||||||
|
KeFlushCurrentTb(VOID)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
// Rename?
|
||||||
|
//
|
||||||
|
KeFlushTb();
|
||||||
|
}
|
||||||
|
|
||||||
VOID
|
VOID
|
||||||
NTAPI
|
NTAPI
|
||||||
KiSaveProcessorControlState(OUT PKPROCESSOR_STATE ProcessorState)
|
KiSaveProcessorControlState(OUT PKPROCESSOR_STATE ProcessorState)
|
||||||
|
@ -127,3 +146,146 @@ KiSaveProcessorControlState(OUT PKPROCESSOR_STATE ProcessorState)
|
||||||
ProcessorState->SpecialRegisters.CacheRegister = KeArmCacheRegisterGet();
|
ProcessorState->SpecialRegisters.CacheRegister = KeArmCacheRegisterGet();
|
||||||
ProcessorState->SpecialRegisters.StatusRegister = KeArmStatusRegisterGet();
|
ProcessorState->SpecialRegisters.StatusRegister = KeArmStatusRegisterGet();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
BOOLEAN
|
||||||
|
NTAPI
|
||||||
|
KeInvalidateAllCaches(VOID)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
// Invalidate D cache and I cache
|
||||||
|
//
|
||||||
|
KeArmInvalidateAllCaches();
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
BOOLEAN
|
||||||
|
NTAPI
|
||||||
|
KeDisableInterrupts(VOID)
|
||||||
|
{
|
||||||
|
ARM_STATUS_REGISTER Flags;
|
||||||
|
|
||||||
|
//
|
||||||
|
// Get current interrupt state and disable interrupts
|
||||||
|
//
|
||||||
|
Flags = KeArmStatusRegisterGet();
|
||||||
|
_disable();
|
||||||
|
|
||||||
|
//
|
||||||
|
// Return previous interrupt state
|
||||||
|
//
|
||||||
|
return Flags.IrqDisable;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* PUBLIC FUNCTIONS ***********************************************************/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* @implemented
|
||||||
|
*/
|
||||||
|
ULONG
|
||||||
|
NTAPI
|
||||||
|
KeGetRecommendedSharedDataAlignment(VOID)
|
||||||
|
{
|
||||||
|
/* Return the global variable */
|
||||||
|
return KeLargestCacheLine;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* @implemented
|
||||||
|
*/
|
||||||
|
VOID
|
||||||
|
NTAPI
|
||||||
|
KeFlushEntireTb(IN BOOLEAN Invalid,
|
||||||
|
IN BOOLEAN AllProcessors)
|
||||||
|
{
|
||||||
|
KIRQL OldIrql;
|
||||||
|
|
||||||
|
//
|
||||||
|
// Raise the IRQL for the TB Flush
|
||||||
|
//
|
||||||
|
OldIrql = KeRaiseIrqlToSynchLevel();
|
||||||
|
|
||||||
|
//
|
||||||
|
// Flush the TB for the Current CPU
|
||||||
|
//
|
||||||
|
KeFlushCurrentTb();
|
||||||
|
|
||||||
|
//
|
||||||
|
// Return to Original IRQL
|
||||||
|
//
|
||||||
|
KeLowerIrql(OldIrql);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* @implemented
|
||||||
|
*/
|
||||||
|
VOID
|
||||||
|
NTAPI
|
||||||
|
KeSetDmaIoCoherency(IN ULONG Coherency)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
// Save the coherency globally
|
||||||
|
//
|
||||||
|
KiDmaIoCoherency = Coherency;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* @implemented
|
||||||
|
*/
|
||||||
|
KAFFINITY
|
||||||
|
NTAPI
|
||||||
|
KeQueryActiveProcessors(VOID)
|
||||||
|
{
|
||||||
|
PAGED_CODE();
|
||||||
|
|
||||||
|
//
|
||||||
|
// Simply return the number of active processors
|
||||||
|
//
|
||||||
|
return KeActiveProcessors;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* @implemented
|
||||||
|
*/
|
||||||
|
VOID
|
||||||
|
__cdecl
|
||||||
|
KeSaveStateForHibernate(IN PKPROCESSOR_STATE State)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
// Capture the context
|
||||||
|
//
|
||||||
|
RtlCaptureContext(&State->ContextFrame);
|
||||||
|
|
||||||
|
//
|
||||||
|
// Capture the control state
|
||||||
|
//
|
||||||
|
KiSaveProcessorControlState(State);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* SYSTEM CALLS NOT VALID ON THIS CPU *****************************************/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* @implemented
|
||||||
|
*/
|
||||||
|
NTSTATUS
|
||||||
|
NTAPI
|
||||||
|
NtVdmControl(IN ULONG ControlCode,
|
||||||
|
IN PVOID ControlData)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
// Does not exist on ARM
|
||||||
|
//
|
||||||
|
return STATUS_NOT_IMPLEMENTED;
|
||||||
|
}
|
||||||
|
|
||||||
|
NTSTATUS
|
||||||
|
NTAPI
|
||||||
|
NtSetLdtEntries(IN ULONG Selector1,
|
||||||
|
IN LDT_ENTRY LdtEntry1,
|
||||||
|
IN ULONG Selector2,
|
||||||
|
IN LDT_ENTRY LdtEntry2)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
// Does not exist on ARM
|
||||||
|
//
|
||||||
|
return STATUS_NOT_IMPLEMENTED;
|
||||||
|
}
|
||||||
|
|
|
@ -2,10 +2,3 @@
|
||||||
#define NDEBUG
|
#define NDEBUG
|
||||||
#include "debug.h"
|
#include "debug.h"
|
||||||
|
|
||||||
CCHAR KeNumberProcessors;
|
|
||||||
ULONG KeDcacheFlushCount;
|
|
||||||
ULONG KeActiveProcessors;
|
|
||||||
ULONG KeProcessorArchitecture;
|
|
||||||
ULONG KeProcessorLevel;
|
|
||||||
ULONG KeProcessorRevision;
|
|
||||||
ULONG KeFeatureBits;
|
|
||||||
|
|
|
@ -40,21 +40,3 @@ GENERATE_ARM_STUB RtlInitializeContext
|
||||||
GENERATE_ARM_STUB KeUserModeCallback
|
GENERATE_ARM_STUB KeUserModeCallback
|
||||||
GENERATE_ARM_STUB NtCallbackReturn
|
GENERATE_ARM_STUB NtCallbackReturn
|
||||||
GENERATE_ARM_STUB NtContinue
|
GENERATE_ARM_STUB NtContinue
|
||||||
|
|
||||||
//
|
|
||||||
// Non-ARM Functionality
|
|
||||||
//
|
|
||||||
GENERATE_ARM_STUB NtSetLdtEntries
|
|
||||||
GENERATE_ARM_STUB NtVdmControl
|
|
||||||
|
|
||||||
//
|
|
||||||
// Ke Arch-Specific Helpers
|
|
||||||
//
|
|
||||||
GENERATE_ARM_STUB KeDisableInterrupts
|
|
||||||
GENERATE_ARM_STUB KeFlushEntireTb
|
|
||||||
GENERATE_ARM_STUB KeGetRecommendedSharedDataAlignment
|
|
||||||
GENERATE_ARM_STUB KeIcacheFlushCount
|
|
||||||
GENERATE_ARM_STUB KeInvalidateAllCaches
|
|
||||||
GENERATE_ARM_STUB KeQueryActiveProcessors
|
|
||||||
GENERATE_ARM_STUB KeSaveStateForHibernate
|
|
||||||
GENERATE_ARM_STUB KeSetDmaIoCoherency
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue