- NtUserWaitForInputIdle: Call EngGetTickCount, removing duplicated code
[reactos.git] / reactos / ntoskrnl / ke / powerpc / ppc_irq.c
index 3fef825..f4b1b82 100644 (file)
@@ -21,7 +21,7 @@
 #include <ppcmmu/mmu.h>\r
 \r
 #define NDEBUG\r
-#include <internal/debug.h>\r
+#include <debug.h>\r
 \r
 KDPC KiExpireTimerDpc;\r
 extern ULONG KiMaximumDpcQueueDepth;\r
@@ -191,7 +191,7 @@ KeTrapFrameToIRQTrapFrame(PKTRAP_FRAME TrapFrame,
  * @implemented\r
  */\r
 VOID\r
-STDCALL\r
+NTAPI\r
 KeUpdateRunTime(IN PKTRAP_FRAME  TrapFrame,\r
                 IN KIRQL  Irql)\r
 {\r
@@ -301,7 +301,7 @@ KeUpdateRunTime(IN PKTRAP_FRAME  TrapFrame,
  * @implemented\r
  */\r
 VOID\r
-STDCALL\r
+NTAPI\r
 KeUpdateSystemTime(IN PKTRAP_FRAME TrapFrame,\r
                    IN KIRQL Irql,\r
                    IN ULONG Increment)\r
@@ -349,9 +349,6 @@ KeUpdateSystemTime(IN PKTRAP_FRAME TrapFrame,
         SharedUserData->TickCount.LowPart = Time.LowPart;\r
         SharedUserData->TickCount.High1Time = Time.HighPart;\r
 \r
-        /* Update tick count in shared user data as well */\r
-        SharedUserData->TickCountLowDeprecated++;\r
-\r
         /* Queue a DPC that will expire timers */\r
         KeInsertQueueDpc(&KiExpireTimerDpc, 0, 0);\r
     }\r
@@ -365,7 +362,7 @@ KeUpdateSystemTime(IN PKTRAP_FRAME TrapFrame,
     }\r
 }\r
 \r
-VOID STDCALL\r
+VOID NTAPI\r
 KiInterruptDispatch2 (ULONG vector, KIRQL old_level)\r
 /*\r
  * FUNCTION: Calls all the interrupt handlers for a given irq.\r
@@ -540,7 +537,7 @@ KeDumpIrqList(VOID)
  * @implemented\r
  */\r
 BOOLEAN\r
-STDCALL\r
+NTAPI\r
 KeConnectInterrupt(PKINTERRUPT InterruptObject)\r
 {\r
    KIRQL oldlvl,synch_oldlvl;\r
@@ -615,7 +612,7 @@ KeConnectInterrupt(PKINTERRUPT InterruptObject)
  *        InterruptObject = isr to release\r
  */\r
 BOOLEAN\r
-STDCALL\r
+NTAPI\r
 KeDisconnectInterrupt(PKINTERRUPT InterruptObject)\r
 {\r
     KIRQL oldlvl,synch_oldlvl;\r
@@ -671,7 +668,7 @@ KeDisconnectInterrupt(PKINTERRUPT InterruptObject)
  * @implemented\r
  */\r
 VOID\r
-STDCALL\r
+NTAPI\r
 KeInitializeInterrupt(PKINTERRUPT Interrupt,\r
                       PKSERVICE_ROUTINE ServiceRoutine,\r
                       PVOID ServiceContext,\r
@@ -751,14 +748,18 @@ ULONG
 NTAPI\r
 KdpServiceDispatcher(ULONG Service, PCHAR Buffer, ULONG Length);\r
 \r
+typedef ULONG (*PSYSCALL_FUN)\r
+(ULONG,ULONG,ULONG,ULONG,ULONG,ULONG,ULONG,ULONG,ULONG,ULONG);\r
+\r
 VOID\r
 NTAPI\r
 KiSystemService(ppc_trap_frame_t *trap_frame)\r
 {\r
     int i;\r
     PKSYSTEM_ROUTINE SystemRoutine;\r
+    PSYSCALL_FUN SyscallFunction;\r
 \r
-    switch(trap_frame->gpr[8])\r
+    switch(trap_frame->gpr[0])\r
     {\r
     case 0x10000: /* DebugService */\r
        for( i = 0; i < trap_frame->gpr[5]; i++ )\r
@@ -777,6 +778,24 @@ KiSystemService(ppc_trap_frame_t *trap_frame)
         SystemRoutine((PKSTART_ROUTINE)trap_frame->gpr[4], \r
                       (PVOID)trap_frame->gpr[5]);\r
         break;\r
+\r
+        /* Handle a normal system call */\r
+    default:\r
+        SyscallFunction = \r
+            ((PSYSCALL_FUN*)KeServiceDescriptorTable\r
+             [trap_frame->gpr[0] >> 12].Base)[trap_frame->gpr[0] & 0xfff];\r
+        trap_frame->gpr[3] = SyscallFunction\r
+            (trap_frame->gpr[3],\r
+             trap_frame->gpr[4],\r
+             trap_frame->gpr[5],\r
+             trap_frame->gpr[6],\r
+             trap_frame->gpr[7],\r
+             trap_frame->gpr[8],\r
+             trap_frame->gpr[9],\r
+             trap_frame->gpr[10],\r
+             trap_frame->gpr[11],\r
+             trap_frame->gpr[12]);\r
+        break;\r
     }\r
 }\r
 \r