Author: tkreuzer
Date: Tue Nov 10 04:30:58 2009
New Revision: 44071
URL:
http://svn.reactos.org/svn/reactos?rev=44071&view=rev
Log:
fix build of ntoskrnl
Removed:
branches/ros-amd64-bringup/reactos/ntoskrnl/kd64/amd64/kdsup.c
Modified:
branches/ros-amd64-bringup/reactos/ntoskrnl/include/internal/amd64/ke.h
branches/ros-amd64-bringup/reactos/ntoskrnl/include/internal/amd64/mm.h
branches/ros-amd64-bringup/reactos/ntoskrnl/io/iomgr/arcname.c
branches/ros-amd64-bringup/reactos/ntoskrnl/kd64/amd64/kdx64.c
branches/ros-amd64-bringup/reactos/ntoskrnl/ke/amd64/cpu.c
branches/ros-amd64-bringup/reactos/ntoskrnl/ke/amd64/kiinit.c
branches/ros-amd64-bringup/reactos/ntoskrnl/mm/amd64/init.c
branches/ros-amd64-bringup/reactos/ntoskrnl/ntoskrnl-generic.rbuild
Modified: branches/ros-amd64-bringup/reactos/ntoskrnl/include/internal/amd64/ke.h
URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/ntosk…
==============================================================================
--- branches/ros-amd64-bringup/reactos/ntoskrnl/include/internal/amd64/ke.h [iso-8859-1]
(original)
+++ branches/ros-amd64-bringup/reactos/ntoskrnl/include/internal/amd64/ke.h [iso-8859-1]
Tue Nov 10 04:30:58 2009
@@ -66,6 +66,11 @@
#define KfReleaseSpinLock KeReleaseSpinLock
extern ULONG Ke386CacheAlignment;
+extern ULONG KeI386NpxPresent;
+extern ULONG KeI386XMMIPresent;
+extern ULONG KeI386FxsrPresent;
+extern ULONG KeI386CpuType;
+extern ULONG KeI386CpuStep;
#define IMAGE_FILE_MACHINE_ARCHITECTURE IMAGE_FILE_MACHINE_AMD64
@@ -101,6 +106,16 @@
#define KeGetTrapFrameInterruptState(TrapFrame) \
BooleanFlagOn((TrapFrame)->EFlags, EFLAGS_INTERRUPT_MASK)
+//
+// Invalidates the TLB entry for a specified address
+//
+FORCEINLINE
+VOID
+KeInvalidateTlbEntry(IN PVOID Address)
+{
+ /* Invalidate the TLB entry for this address */
+ __invlpg(Address);
+}
struct _KPCR;
VOID
Modified: branches/ros-amd64-bringup/reactos/ntoskrnl/include/internal/amd64/mm.h
URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/ntosk…
==============================================================================
--- branches/ros-amd64-bringup/reactos/ntoskrnl/include/internal/amd64/mm.h [iso-8859-1]
(original)
+++ branches/ros-amd64-bringup/reactos/ntoskrnl/include/internal/amd64/mm.h [iso-8859-1]
Tue Nov 10 04:30:58 2009
@@ -86,7 +86,8 @@
#define MI_PAGED_POOL_START (PVOID)0xFFFFFA8000000000ULL
#define MI_NONPAGED_POOL_END (PVOID)0xFFFFFAE000000000ULL
-
+#define MI_DEBUG_MAPPING (PVOID)0xFFFFFFFF80000000ULL // FIXME
+
#define MM_HIGHEST_VAD_ADDRESS \
(PVOID)((ULONG_PTR)MM_HIGHEST_USER_ADDRESS - (16 * PAGE_SIZE))
Modified: branches/ros-amd64-bringup/reactos/ntoskrnl/io/iomgr/arcname.c
URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/ntosk…
==============================================================================
--- branches/ros-amd64-bringup/reactos/ntoskrnl/io/iomgr/arcname.c [iso-8859-1]
(original)
+++ branches/ros-amd64-bringup/reactos/ntoskrnl/io/iomgr/arcname.c [iso-8859-1] Tue Nov 10
04:30:58 2009
@@ -354,7 +354,9 @@
/* Now calculate the checksum */
for (i = 0; i < 2048 / sizeof(ULONG); i++) CheckSum += Buffer[i];
+#ifndef _M_AMD64
if (KeRosLoaderBlock) goto freeldrhack;
+#endif
/* Search if this device is the actual boot CD */
for (NextEntry = ArcDiskInfo->DiskSignatureListHead.Flink;
Removed: branches/ros-amd64-bringup/reactos/ntoskrnl/kd64/amd64/kdsup.c
URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/ntosk…
==============================================================================
--- branches/ros-amd64-bringup/reactos/ntoskrnl/kd64/amd64/kdsup.c [iso-8859-1]
(original)
+++ branches/ros-amd64-bringup/reactos/ntoskrnl/kd64/amd64/kdsup.c (removed)
@@ -1,373 +1,0 @@
-/*
- * PROJECT: ReactOS Kernel
- * LICENSE: GPL - See COPYING in the top level directory
- * FILE: ntoskrnl/kd64/amd64/kdsup.c
- * PURPOSE: KD support routines for AMD64
- * PROGRAMMERS: Timo Kreuzer (timo.kreuzer(a)reactos.org)
- */
-
-/* INCLUDES *****************************************************************/
-
-#include <ntoskrnl.h>
-#define NDEBUG
-#include <debug.h>
-
-#undef UNIMPLEMENTED
-#define UNIMPLEMENTED KdpDprintf("%s is unimplemented\n", __FUNCTION__)
-
-/* FUNCTIONS *****************************************************************/
-
-VOID
-NTAPI
-KdpSysGetVersion(IN PDBGKD_GET_VERSION64 Version)
-{
- /* Copy the version block */
- RtlCopyMemory(Version, &KdVersionBlock, sizeof(DBGKD_GET_VERSION64));
-}
-
-VOID
-NTAPI
-KdpGetStateChange(IN PDBGKD_MANIPULATE_STATE64 State,
- IN PCONTEXT Context)
-{
- PKPRCB Prcb;
- ULONG i;
-
- /* Check for success */
- if (NT_SUCCESS(State->u.Continue2.ContinueStatus))
- {
- /* Check if we're tracing */
- if (State->u.Continue2.ControlSet.TraceFlag)
- {
- /* Enable TF */
- Context->EFlags |= EFLAGS_TF;
- }
- else
- {
- /* Remove it */
- Context->EFlags &= ~EFLAGS_TF;
- }
-
- /* Loop all processors */
- for (i = 0; i < KeNumberProcessors; i++)
- {
- /* Get the PRCB and update DR7 and DR6 */
- Prcb = KiProcessorBlock[i];
- Prcb->ProcessorState.SpecialRegisters.KernelDr7 =
- State->u.Continue2.ControlSet.Dr7;
- Prcb->ProcessorState.SpecialRegisters.KernelDr6 = 0;
- }
-
- /* Check if we have new symbol information */
- if (State->u.Continue2.ControlSet.CurrentSymbolStart != 1)
- {
- /* Update it */
- KdpCurrentSymbolStart =
- State->u.Continue2.ControlSet.CurrentSymbolStart;
- KdpCurrentSymbolEnd= State->u.Continue2.ControlSet.CurrentSymbolEnd;
- }
- }
-}
-
-VOID
-NTAPI
-KdpSetContextState(IN PDBGKD_ANY_WAIT_STATE_CHANGE WaitStateChange,
- IN PCONTEXT Context)
-{
- PKPRCB Prcb = KeGetCurrentPrcb();
-
- /* Copy i386 specific debug registers */
- WaitStateChange->ControlReport.Dr6 = Prcb->ProcessorState.SpecialRegisters.
- KernelDr6;
- WaitStateChange->ControlReport.Dr7 = Prcb->ProcessorState.SpecialRegisters.
- KernelDr7;
-
- /* Copy i386 specific segments */
- WaitStateChange->ControlReport.SegCs = (USHORT)Context->SegCs;
- WaitStateChange->ControlReport.SegDs = (USHORT)Context->SegDs;
- WaitStateChange->ControlReport.SegEs = (USHORT)Context->SegEs;
- WaitStateChange->ControlReport.SegFs = (USHORT)Context->SegFs;
-
- /* Copy EFlags */
- WaitStateChange->ControlReport.EFlags = Context->EFlags;
-
- /* Set Report Flags */
- WaitStateChange->ControlReport.ReportFlags = REPORT_INCLUDES_SEGS;
- if (WaitStateChange->ControlReport.SegCs == KGDT_64_R0_CODE)
- {
- WaitStateChange->ControlReport.ReportFlags |= REPORT_STANDARD_CS;
- }
-}
-
-NTSTATUS
-NTAPI
-KdpSysReadMsr(IN ULONG Msr,
- OUT PLARGE_INTEGER MsrValue)
-{
- /* Use SEH to protect from invalid MSRs */
- _SEH2_TRY
- {
- MsrValue->QuadPart = __readmsr(Msr);
- }
- _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
- {
- _SEH2_YIELD(return STATUS_NO_SUCH_DEVICE);
- }
- _SEH2_END
-
- return STATUS_SUCCESS;
-}
-
-NTSTATUS
-NTAPI
-KdpSysWriteMsr(IN ULONG Msr,
- IN PLARGE_INTEGER MsrValue)
-{
- /* Use SEH to protect from invalid MSRs */
- _SEH2_TRY
- {
- __writemsr(Msr, MsrValue->QuadPart);
- }
- _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
- {
- _SEH2_YIELD(return STATUS_NO_SUCH_DEVICE);
- }
- _SEH2_END
-
- return STATUS_SUCCESS;
-}
-
-NTSTATUS
-NTAPI
-KdpSysReadBusData(IN ULONG BusDataType,
- IN ULONG BusNumber,
- IN ULONG SlotNumber,
- IN ULONG Offset,
- IN PVOID Buffer,
- IN ULONG Length,
- OUT PULONG ActualLength)
-{
- UNIMPLEMENTED;
- while (TRUE);
- return STATUS_UNSUCCESSFUL;
-}
-
-NTSTATUS
-NTAPI
-KdpSysWriteBusData(IN ULONG BusDataType,
- IN ULONG BusNumber,
- IN ULONG SlotNumber,
- IN ULONG Offset,
- IN PVOID Buffer,
- IN ULONG Length,
- OUT PULONG ActualLength)
-{
- UNIMPLEMENTED;
- while (TRUE);
- return STATUS_UNSUCCESSFUL;
-}
-
-NTSTATUS
-NTAPI
-KdpSysReadControlSpace(IN ULONG Processor,
- IN ULONG64 BaseAddress,
- IN PVOID Buffer,
- IN ULONG Length,
- OUT PULONG ActualLength)
-{
- PVOID ControlStart;
- PKPRCB Prcb = KiProcessorBlock[Processor];
- PKIPCR Pcr = CONTAINING_RECORD(Prcb, KIPCR, Prcb);
-
- switch (BaseAddress)
- {
- case AMD64_DEBUG_CONTROL_SPACE_KPCR:
- /* Copy a pointer to the Pcr */
- ControlStart = &Pcr;
- *ActualLength = sizeof(PVOID);
- break;
-
- case AMD64_DEBUG_CONTROL_SPACE_KPRCB:
- /* Copy a pointer to the Prcb */
- ControlStart = &Prcb;
- *ActualLength = sizeof(PVOID);
- break;
-
- case AMD64_DEBUG_CONTROL_SPACE_KSPECIAL:
- /* Copy SpecialRegisters */
- ControlStart = &Prcb->ProcessorState.SpecialRegisters;
- *ActualLength = sizeof(KSPECIAL_REGISTERS);
- break;
-
- case AMD64_DEBUG_CONTROL_SPACE_KTHREAD:
- /* Copy a pointer to the current Thread */
- ControlStart = &Prcb->CurrentThread;
- *ActualLength = sizeof(PVOID);
- break;
-
- default:
- *ActualLength = 0;
- ASSERT(FALSE);
- return STATUS_UNSUCCESSFUL;
- }
-
- /* Copy the memory */
- RtlCopyMemory(Buffer, ControlStart, min(Length, *ActualLength));
-
- /* Finish up */
- return STATUS_SUCCESS;
-}
-
-NTSTATUS
-NTAPI
-KdpSysWriteControlSpace(IN ULONG Processor,
- IN ULONG64 BaseAddress,
- IN PVOID Buffer,
- IN ULONG Length,
- OUT PULONG ActualLength)
-{
- PVOID ControlStart;
- PKPRCB Prcb = KiProcessorBlock[Processor];
- PKIPCR Pcr = CONTAINING_RECORD(Prcb, KIPCR, Prcb);
-
- switch (BaseAddress)
- {
- case AMD64_DEBUG_CONTROL_SPACE_KSPECIAL:
- /* Copy SpecialRegisters */
- ControlStart = &Prcb->ProcessorState.SpecialRegisters;
- *ActualLength = sizeof(KSPECIAL_REGISTERS);
- break;
-
- default:
- *ActualLength = 0;
- ASSERT(FALSE);
- return STATUS_UNSUCCESSFUL;
- }
-
- /* Copy the memory */
- RtlCopyMemory(ControlStart, Buffer, min(Length, *ActualLength));
-
- return STATUS_SUCCESS;
-}
-
-NTSTATUS
-NTAPI
-KdpSysReadIoSpace(IN ULONG InterfaceType,
- IN ULONG BusNumber,
- IN ULONG AddressSpace,
- IN ULONG64 IoAddress,
- OUT PVOID DataValue,
- IN ULONG DataSize,
- OUT PULONG ActualDataSize)
-{
- /* Verify parameters */
- if (InterfaceType != Isa || BusNumber != 0 || AddressSpace != 1)
- {
- /* No data was read */
- *ActualDataSize = 0;
- return STATUS_INVALID_PARAMETER;
- }
-
- /* Check for correct alignment */
- if ((IoAddress & (DataSize - 1)))
- {
- /* Invalid alignment */
- *ActualDataSize = 0;
- return STATUS_DATATYPE_MISALIGNMENT;
- }
-
- switch (DataSize)
- {
- case sizeof(UCHAR):
- /* Read one UCHAR */
- *(PUCHAR)DataValue = READ_PORT_UCHAR((PUCHAR)IoAddress);
- break;
-
- case sizeof(USHORT):
- /* Read one USHORT */
- *(PUSHORT)DataValue = READ_PORT_USHORT((PUSHORT)IoAddress);
- break;
-
- case sizeof(ULONG):
- /* Read one ULONG */
- *(PULONG)DataValue = READ_PORT_ULONG((PULONG)IoAddress);
- break;
-
- default:
- /* Invalid data size */
- *ActualDataSize = 0;
- return STATUS_INVALID_PARAMETER;
- }
-
- /* Return the size of the data */
- *ActualDataSize = DataSize;
-
- /* Success! */
- return STATUS_SUCCESS;
-}
-
-
-NTSTATUS
-NTAPI
-KdpSysWriteIoSpace(IN ULONG InterfaceType,
- IN ULONG BusNumber,
- IN ULONG AddressSpace,
- IN ULONG64 IoAddress,
- IN PVOID DataValue,
- IN ULONG DataSize,
- OUT PULONG ActualDataSize)
-{
- /* Verify parameters */
- if (InterfaceType != Isa || BusNumber != 0 || AddressSpace != 1)
- {
- /* No data was written */
- *ActualDataSize = 0;
- return STATUS_INVALID_PARAMETER;
- }
-
- /* Check for correct alignment */
- if ((IoAddress & (DataSize - 1)))
- {
- /* Invalid alignment */
- *ActualDataSize = 0;
- return STATUS_DATATYPE_MISALIGNMENT;
- }
-
- switch (DataSize)
- {
- case sizeof(UCHAR):
- /* Write one UCHAR */
- WRITE_PORT_UCHAR((PUCHAR)IoAddress, *(PUCHAR)DataValue);
- break;
-
- case sizeof(USHORT):
- /* Write one USHORT */
- WRITE_PORT_USHORT((PUSHORT)IoAddress, *(PUSHORT)DataValue);
- break;
-
- case sizeof(ULONG):
- /* Write one ULONG */
- WRITE_PORT_ULONG((PULONG)IoAddress, *(PULONG)DataValue);
- break;
-
- default:
- /* Invalid data size */
- *ActualDataSize = 0;
- return STATUS_INVALID_PARAMETER;
- }
-
- /* Return the size of the data */
- *ActualDataSize = DataSize;
-
- /* Success! */
- return STATUS_SUCCESS;
-}
-
-NTSTATUS
-NTAPI
-KdpSysCheckLowMemory(IN ULONG Flags)
-{
- UNIMPLEMENTED;
- while (TRUE);
- return STATUS_UNSUCCESSFUL;
-}
Modified: branches/ros-amd64-bringup/reactos/ntoskrnl/kd64/amd64/kdx64.c
URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/ntosk…
==============================================================================
--- branches/ros-amd64-bringup/reactos/ntoskrnl/kd64/amd64/kdx64.c [iso-8859-1]
(original)
+++ branches/ros-amd64-bringup/reactos/ntoskrnl/kd64/amd64/kdx64.c [iso-8859-1] Tue Nov 10
04:30:58 2009
@@ -22,8 +22,43 @@
KdpGetStateChange(IN PDBGKD_MANIPULATE_STATE64 State,
IN PCONTEXT Context)
{
- UNIMPLEMENTED;
- while (TRUE);
+ PKPRCB Prcb;
+ ULONG i;
+
+ /* Check for success */
+ if (NT_SUCCESS(State->u.Continue2.ContinueStatus))
+ {
+ /* Check if we're tracing */
+ if (State->u.Continue2.ControlSet.TraceFlag)
+ {
+ /* Enable TF */
+ Context->EFlags |= EFLAGS_TF;
+ }
+ else
+ {
+ /* Remove it */
+ Context->EFlags &= ~EFLAGS_TF;
+ }
+
+ /* Loop all processors */
+ for (i = 0; i < KeNumberProcessors; i++)
+ {
+ /* Get the PRCB and update DR7 and DR6 */
+ Prcb = KiProcessorBlock[i];
+ Prcb->ProcessorState.SpecialRegisters.KernelDr7 =
+ State->u.Continue2.ControlSet.Dr7;
+ Prcb->ProcessorState.SpecialRegisters.KernelDr6 = 0;
+ }
+
+ /* Check if we have new symbol information */
+ if (State->u.Continue2.ControlSet.CurrentSymbolStart != 1)
+ {
+ /* Update it */
+ KdpCurrentSymbolStart =
+ State->u.Continue2.ControlSet.CurrentSymbolStart;
+ KdpCurrentSymbolEnd= State->u.Continue2.ControlSet.CurrentSymbolEnd;
+ }
+ }
}
VOID
@@ -31,8 +66,29 @@
KdpSetContextState(IN PDBGKD_ANY_WAIT_STATE_CHANGE WaitStateChange,
IN PCONTEXT Context)
{
- UNIMPLEMENTED;
- while (TRUE);
+ PKPRCB Prcb = KeGetCurrentPrcb();
+
+ /* Copy i386 specific debug registers */
+ WaitStateChange->ControlReport.Dr6 = Prcb->ProcessorState.SpecialRegisters.
+ KernelDr6;
+ WaitStateChange->ControlReport.Dr7 = Prcb->ProcessorState.SpecialRegisters.
+ KernelDr7;
+
+ /* Copy i386 specific segments */
+ WaitStateChange->ControlReport.SegCs = (USHORT)Context->SegCs;
+ WaitStateChange->ControlReport.SegDs = (USHORT)Context->SegDs;
+ WaitStateChange->ControlReport.SegEs = (USHORT)Context->SegEs;
+ WaitStateChange->ControlReport.SegFs = (USHORT)Context->SegFs;
+
+ /* Copy EFlags */
+ WaitStateChange->ControlReport.EFlags = Context->EFlags;
+
+ /* Set Report Flags */
+ WaitStateChange->ControlReport.ReportFlags = REPORT_INCLUDES_SEGS;
+ if (WaitStateChange->ControlReport.SegCs == KGDT_64_R0_CODE)
+ {
+ WaitStateChange->ControlReport.ReportFlags |= REPORT_STANDARD_CS;
+ }
}
NTSTATUS
@@ -40,9 +96,18 @@
KdpSysReadMsr(IN ULONG Msr,
OUT PLARGE_INTEGER MsrValue)
{
- UNIMPLEMENTED;
- while (TRUE);
- return STATUS_UNSUCCESSFUL;
+ /* Use SEH to protect from invalid MSRs */
+ _SEH2_TRY
+ {
+ MsrValue->QuadPart = __readmsr(Msr);
+ }
+ _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
+ {
+ _SEH2_YIELD(return STATUS_NO_SUCH_DEVICE);
+ }
+ _SEH2_END
+
+ return STATUS_SUCCESS;
}
NTSTATUS
@@ -50,9 +115,18 @@
KdpSysWriteMsr(IN ULONG Msr,
IN PLARGE_INTEGER MsrValue)
{
- UNIMPLEMENTED;
- while (TRUE);
- return STATUS_UNSUCCESSFUL;
+ /* Use SEH to protect from invalid MSRs */
+ _SEH2_TRY
+ {
+ __writemsr(Msr, MsrValue->QuadPart);
+ }
+ _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
+ {
+ _SEH2_YIELD(return STATUS_NO_SUCH_DEVICE);
+ }
+ _SEH2_END
+
+ return STATUS_SUCCESS;
}
NTSTATUS
@@ -93,9 +167,47 @@
IN ULONG Length,
OUT PULONG ActualLength)
{
- UNIMPLEMENTED;
- while (TRUE);
- return STATUS_UNSUCCESSFUL;
+ PVOID ControlStart;
+ PKPRCB Prcb = KiProcessorBlock[Processor];
+ PKIPCR Pcr = CONTAINING_RECORD(Prcb, KIPCR, Prcb);
+
+ switch (BaseAddress)
+ {
+ case AMD64_DEBUG_CONTROL_SPACE_KPCR:
+ /* Copy a pointer to the Pcr */
+ ControlStart = &Pcr;
+ *ActualLength = sizeof(PVOID);
+ break;
+
+ case AMD64_DEBUG_CONTROL_SPACE_KPRCB:
+ /* Copy a pointer to the Prcb */
+ ControlStart = &Prcb;
+ *ActualLength = sizeof(PVOID);
+ break;
+
+ case AMD64_DEBUG_CONTROL_SPACE_KSPECIAL:
+ /* Copy SpecialRegisters */
+ ControlStart = &Prcb->ProcessorState.SpecialRegisters;
+ *ActualLength = sizeof(KSPECIAL_REGISTERS);
+ break;
+
+ case AMD64_DEBUG_CONTROL_SPACE_KTHREAD:
+ /* Copy a pointer to the current Thread */
+ ControlStart = &Prcb->CurrentThread;
+ *ActualLength = sizeof(PVOID);
+ break;
+
+ default:
+ *ActualLength = 0;
+ ASSERT(FALSE);
+ return STATUS_UNSUCCESSFUL;
+ }
+
+ /* Copy the memory */
+ RtlCopyMemory(Buffer, ControlStart, min(Length, *ActualLength));
+
+ /* Finish up */
+ return STATUS_SUCCESS;
}
NTSTATUS
@@ -106,9 +218,28 @@
IN ULONG Length,
OUT PULONG ActualLength)
{
- UNIMPLEMENTED;
- while (TRUE);
- return STATUS_UNSUCCESSFUL;
+ PVOID ControlStart;
+ PKPRCB Prcb = KiProcessorBlock[Processor];
+ PKIPCR Pcr = CONTAINING_RECORD(Prcb, KIPCR, Prcb);
+
+ switch (BaseAddress)
+ {
+ case AMD64_DEBUG_CONTROL_SPACE_KSPECIAL:
+ /* Copy SpecialRegisters */
+ ControlStart = &Prcb->ProcessorState.SpecialRegisters;
+ *ActualLength = sizeof(KSPECIAL_REGISTERS);
+ break;
+
+ default:
+ *ActualLength = 0;
+ ASSERT(FALSE);
+ return STATUS_UNSUCCESSFUL;
+ }
+
+ /* Copy the memory */
+ RtlCopyMemory(ControlStart, Buffer, min(Length, *ActualLength));
+
+ return STATUS_SUCCESS;
}
NTSTATUS
@@ -117,13 +248,54 @@
IN ULONG BusNumber,
IN ULONG AddressSpace,
IN ULONG64 IoAddress,
- IN PVOID DataValue,
+ OUT PVOID DataValue,
IN ULONG DataSize,
OUT PULONG ActualDataSize)
{
- UNIMPLEMENTED;
- while (TRUE);
- return STATUS_UNSUCCESSFUL;
+ /* Verify parameters */
+ if (InterfaceType != Isa || BusNumber != 0 || AddressSpace != 1)
+ {
+ /* No data was read */
+ *ActualDataSize = 0;
+ return STATUS_INVALID_PARAMETER;
+ }
+
+ /* Check for correct alignment */
+ if ((IoAddress & (DataSize - 1)))
+ {
+ /* Invalid alignment */
+ *ActualDataSize = 0;
+ return STATUS_DATATYPE_MISALIGNMENT;
+ }
+
+ switch (DataSize)
+ {
+ case sizeof(UCHAR):
+ /* Read one UCHAR */
+ *(PUCHAR)DataValue = READ_PORT_UCHAR((PUCHAR)IoAddress);
+ break;
+
+ case sizeof(USHORT):
+ /* Read one USHORT */
+ *(PUSHORT)DataValue = READ_PORT_USHORT((PUSHORT)IoAddress);
+ break;
+
+ case sizeof(ULONG):
+ /* Read one ULONG */
+ *(PULONG)DataValue = READ_PORT_ULONG((PULONG)IoAddress);
+ break;
+
+ default:
+ /* Invalid data size */
+ *ActualDataSize = 0;
+ return STATUS_INVALID_PARAMETER;
+ }
+
+ /* Return the size of the data */
+ *ActualDataSize = DataSize;
+
+ /* Success! */
+ return STATUS_SUCCESS;
}
NTSTATUS
@@ -136,6 +308,56 @@
IN ULONG DataSize,
OUT PULONG ActualDataSize)
{
+ /* Verify parameters */
+ if (InterfaceType != Isa || BusNumber != 0 || AddressSpace != 1)
+ {
+ /* No data was written */
+ *ActualDataSize = 0;
+ return STATUS_INVALID_PARAMETER;
+ }
+
+ /* Check for correct alignment */
+ if ((IoAddress & (DataSize - 1)))
+ {
+ /* Invalid alignment */
+ *ActualDataSize = 0;
+ return STATUS_DATATYPE_MISALIGNMENT;
+ }
+
+ switch (DataSize)
+ {
+ case sizeof(UCHAR):
+ /* Write one UCHAR */
+ WRITE_PORT_UCHAR((PUCHAR)IoAddress, *(PUCHAR)DataValue);
+ break;
+
+ case sizeof(USHORT):
+ /* Write one USHORT */
+ WRITE_PORT_USHORT((PUSHORT)IoAddress, *(PUSHORT)DataValue);
+ break;
+
+ case sizeof(ULONG):
+ /* Write one ULONG */
+ WRITE_PORT_ULONG((PULONG)IoAddress, *(PULONG)DataValue);
+ break;
+
+ default:
+ /* Invalid data size */
+ *ActualDataSize = 0;
+ return STATUS_INVALID_PARAMETER;
+ }
+
+ /* Return the size of the data */
+ *ActualDataSize = DataSize;
+
+ /* Success! */
+ return STATUS_SUCCESS;
+}
+
+NTSTATUS
+NTAPI
+KdpSysCheckLowMemory(IN ULONG Flags)
+{
UNIMPLEMENTED;
while (TRUE);
return STATUS_UNSUCCESSFUL;
@@ -143,15 +365,6 @@
NTSTATUS
NTAPI
-KdpSysCheckLowMemory(IN ULONG Flags)
-{
- UNIMPLEMENTED;
- while (TRUE);
- return STATUS_UNSUCCESSFUL;
-}
-
-NTSTATUS
-NTAPI
KdpAllowDisable(VOID)
{
UNIMPLEMENTED;
Modified: branches/ros-amd64-bringup/reactos/ntoskrnl/ke/amd64/cpu.c
URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/ntosk…
==============================================================================
--- branches/ros-amd64-bringup/reactos/ntoskrnl/ke/amd64/cpu.c [iso-8859-1] (original)
+++ branches/ros-amd64-bringup/reactos/ntoskrnl/ke/amd64/cpu.c [iso-8859-1] Tue Nov 10
04:30:58 2009
@@ -566,39 +566,6 @@
BOOLEAN
NTAPI
-KeFreezeExecution(IN PKTRAP_FRAME TrapFrame,
- IN PKEXCEPTION_FRAME ExceptionFrame)
-{
- ULONG64 Flags = 0;
-
- /* Disable interrupts and get previous state */
- Flags = __readeflags();
- //Flags = __getcallerseflags();
- _disable();
-
- /* Save freeze flag */
- KiFreezeFlag = 4;
-
- /* Save the old IRQL */
- KiOldIrql = KeGetCurrentIrql();
-
- /* Return whether interrupts were enabled */
- return (Flags & EFLAGS_INTERRUPT_MASK) ? TRUE: FALSE;
-}
-
-VOID
-NTAPI
-KeThawExecution(IN BOOLEAN Enable)
-{
- /* Cleanup CPU caches */
- KeFlushCurrentTb();
-
- /* Re-enable interrupts */
- if (Enable) _enable();
-}
-
-BOOLEAN
-NTAPI
KeInvalidateAllCaches(VOID)
{
/* Invalidate all caches */
Modified: branches/ros-amd64-bringup/reactos/ntoskrnl/ke/amd64/kiinit.c
URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/ntosk…
==============================================================================
--- branches/ros-amd64-bringup/reactos/ntoskrnl/ke/amd64/kiinit.c [iso-8859-1] (original)
+++ branches/ros-amd64-bringup/reactos/ntoskrnl/ke/amd64/kiinit.c [iso-8859-1] Tue Nov 10
04:30:58 2009
@@ -17,6 +17,9 @@
KF_NX_BIT)
/* GLOBALS *******************************************************************/
+
+/* Function pointer for early debug prints */
+ULONG (*FrLdrDbgPrint)(const char *Format, ...);
/* Spinlocks used only on X86 */
KSPIN_LOCK KiFreezeExecutionLock;
Modified: branches/ros-amd64-bringup/reactos/ntoskrnl/mm/amd64/init.c
URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/ntosk…
==============================================================================
--- branches/ros-amd64-bringup/reactos/ntoskrnl/mm/amd64/init.c [iso-8859-1] (original)
+++ branches/ros-amd64-bringup/reactos/ntoskrnl/mm/amd64/init.c [iso-8859-1] Tue Nov 10
04:30:58 2009
@@ -69,6 +69,11 @@
ULONG64 MmNumberOfSystemPtes;
PMMPTE MmSystemPagePtes;
ULONG64 MxPfnAllocation;
+
+PVOID MmSystemCacheStart;
+PVOID MmSystemCacheEnd;
+MMSUPPORT MmSystemCacheWs;
+
///////////////////////////////////////////////
Modified: branches/ros-amd64-bringup/reactos/ntoskrnl/ntoskrnl-generic.rbuild
URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/ntosk…
==============================================================================
--- branches/ros-amd64-bringup/reactos/ntoskrnl/ntoskrnl-generic.rbuild [iso-8859-1]
(original)
+++ branches/ros-amd64-bringup/reactos/ntoskrnl/ntoskrnl-generic.rbuild [iso-8859-1] Tue
Nov 10 04:30:58 2009
@@ -111,7 +111,9 @@
<file>dpc.c</file>
<file>eventobj.c</file>
<file>except.c</file>
- <file>freeldr.c</file>
+ <if property="ARCH" value="i386">
+ <file>freeldr.c</file>
+ </if>
<file>freeze.c</file>
<file>gate.c</file>
<file>gmutex.c</file>