- Create cmhardwr.c for ARM, stub it out.

- Implement KiInitMachineDependent -- this is only useful for x86 and has nothing relevant to ARM, so we just return.
- Implement HalAllProcessorsStarted (again, a no-op) and HalQueryRealTimeClock (uses the RTC on the board -- uboot must set it up first).
- Make sure we get the right Sp during a system call (this is still broken though).
- We need to fix our system call handler next.


svn path=/trunk/; revision=33977
This commit is contained in:
ReactOS Portable Systems Group 2008-06-15 05:40:27 +00:00
parent 531a8ad588
commit def9fa66b4
8 changed files with 84 additions and 20 deletions

View file

@ -18,6 +18,7 @@
#include <ndk/iofuncs.h> #include <ndk/iofuncs.h>
#include <ndk/kdfuncs.h> #include <ndk/kdfuncs.h>
#include <ndk/kefuncs.h> #include <ndk/kefuncs.h>
#include <ndk/rtlfuncs.h>
#include <internal/arm/ke.h> #include <internal/arm/ke.h>
#include <internal/arm/intrin_i.h> #include <internal/arm/intrin_i.h>
#include <bugcodes.h> #include <bugcodes.h>
@ -135,12 +136,14 @@ HalAdjustResourceList(
} }
/*
* @implemented
*/
BOOLEAN BOOLEAN
NTAPI NTAPI
HalAllProcessorsStarted(VOID) HalAllProcessorsStarted(VOID)
{ {
UNIMPLEMENTED; /* Do nothing */
return TRUE; return TRUE;
} }
@ -733,16 +736,31 @@ HalQueryDisplayParameters(
UNIMPLEMENTED; UNIMPLEMENTED;
} }
#define RTC_DATA (PVOID)0xE00E8000
BOOLEAN BOOLEAN
NTAPI NTAPI
HalQueryRealTimeClock( HalQueryRealTimeClock(IN PTIME_FIELDS Time)
PTIME_FIELDS Time)
{ {
UNIMPLEMENTED; LARGE_INTEGER LargeTime;
return FALSE; ULONG Seconds;
}
//
// Query the RTC value
//
Seconds = READ_REGISTER_ULONG(RTC_DATA);
//
// Convert to time
//
RtlSecondsSince1970ToTime(Seconds, &LargeTime);
//
// Convert to time-fields
//
RtlTimeToTimeFields(&LargeTime, Time);
return TRUE;
}
ULONG ULONG
NTAPI NTAPI

View file

@ -0,0 +1,25 @@
/*
* PROJECT: ReactOS Kernel
* LICENSE: GPL - See COPYING in the top level directory
* FILE: ntoskrnl/config/arm/cmhardwr.c
* PURPOSE: Configuration Manager - ARM Specific Code
* PROGRAMMERS: ReactOS Portable Systems Group
*/
/* INCLUDES ******************************************************************/
#include "ntoskrnl.h"
#define NDEBUG
#include "debug.h"
/* GLOBALS *******************************************************************/
/* FUNCTIONS *****************************************************************/
NTSTATUS
NTAPI
CmpInitializeMachineDependentConfiguration(IN PLOADER_PARAMETER_BLOCK LoaderBlock)
{
UNIMPLEMENTED;
return STATUS_NOT_IMPLEMENTED;
}

View file

@ -1265,12 +1265,6 @@ Phase1InitializationDiscard(IN PVOID Context)
OBJECT_ATTRIBUTES ObjectAttributes; OBJECT_ATTRIBUTES ObjectAttributes;
HANDLE KeyHandle, OptionHandle; HANDLE KeyHandle, OptionHandle;
PRTL_USER_PROCESS_PARAMETERS ProcessParameters = NULL; PRTL_USER_PROCESS_PARAMETERS ProcessParameters = NULL;
#ifdef _ARM_
DPRINT1("*** Phase 1 Initialization Thread\n");
DPRINT1("Beginning consistency checks...\n");
// CHECK STACKS, IRQLS, DISPATCHER AND MAKE SURE WE ARE GOOD TO GO!
//while (TRUE);
#endif
/* Allocate the initialization buffer */ /* Allocate the initialization buffer */
InitBuffer = ExAllocatePoolWithTag(NonPagedPool, InitBuffer = ExAllocatePoolWithTag(NonPagedPool,

View file

@ -40,6 +40,16 @@ DebugService(IN ULONG ServiceType,
arm_kprintf("%s", Buffer); arm_kprintf("%s", Buffer);
} }
VOID
NTAPI
KiInitMachineDependent(VOID)
{
//
// There is nothing to do on ARM
//
return;
}
VOID VOID
NTAPI NTAPI
KiInitializeKernel(IN PKPROCESS InitProcess, KiInitializeKernel(IN PKPROCESS InitProcess,

View file

@ -45,9 +45,7 @@ GENERATE_ARM_STUB KeDisableInterrupts
GENERATE_ARM_STUB KiDispatchException GENERATE_ARM_STUB KiDispatchException
GENERATE_ARM_STUB KiSwapProcess GENERATE_ARM_STUB KiSwapProcess
GENERATE_ARM_STUB KeSwitchKernelStack GENERATE_ARM_STUB KeSwitchKernelStack
GENERATE_ARM_STUB KiInitMachineDependent
GENERATE_ARM_STUB KiComputeTimerTableIndex GENERATE_ARM_STUB KiComputeTimerTableIndex
GENERATE_ARM_STUB CmpInitializeMachineDependentConfiguration
// //
// Traps, Debugging and Execeptions // Traps, Debugging and Execeptions

View file

@ -400,7 +400,7 @@ CopyLoop:
cmp r6, #4 cmp r6, #4
//strne sp, [r5], #4 //strne sp, [r5], #4
//subne r6, r6, #1 //subne r6, r6, #1
beq . bge .
// //
// Now do the system call // Now do the system call

View file

@ -490,15 +490,29 @@ KiSystemService(IN PKTHREAD Thread,
// If more than four, we'll have some on the user stack // If more than four, we'll have some on the user stack
// //
if (ArgumentCount > 4) if (ArgumentCount > 4)
{
//
// Check where the stack is
//
if (Thread->PreviousMode == UserMode)
{ {
// //
// FIXME: Validate the user stack // FIXME: Validate the user stack
// //
Argument = (PULONG)TrapFrame->UserSp;
}
else
{
//
// We were called from the kernel
//
Argument = (PULONG)TrapFrame->SvcSp;
}
// //
// Copy the rest // Copy the rest
// //
Argument = (PULONG)TrapFrame->UserSp; DPRINT1("Stack: %p\n", Argument);
for (i = 4; i < ArgumentCount; i++) for (i = 4; i < ArgumentCount; i++)
{ {
// //

View file

@ -126,6 +126,11 @@
<file>cmhardwr.c</file> <file>cmhardwr.c</file>
</directory> </directory>
</if> </if>
<if property="ARCH" value="arm">
<directory name="arm">
<file>cmhardwr.c</file>
</directory>
</if>
<if property="ARCH" value="powerpc"> <if property="ARCH" value="powerpc">
<directory name="powerpc"> <directory name="powerpc">
<file>cmhardwr.c</file> <file>cmhardwr.c</file>