Author: sginsberg
Date: Tue Sep 15 23:03:42 2015
New Revision: 69248
URL: http://svn.reactos.org/svn/reactos?rev=69248&view=rev
Log:
[HAL] Get rid off REGISTERCALL ("regparm(3)" for GCC) and replace with good old NTAPI (stdcall). Such an obsession with avoiding stack usage is not healthy nor makes much sense today (or even a long time before today) with processors that have a decent L1 cache, whose "cost of access" is basically the same as to that of a register, and with processors being capable of recognising basic access patterns to ensure frequently used memory (read: stack) is in the cache. Slapping FASTCALL/regparm on frequently used code does not ensure it actually operates faster. You want to know what really hurts performance (and cache)? Slapping FORCEINLINE on everything like if it was some kind of asm macro, making code needlessly bloated.
Modified:
trunk/reactos/hal/halx86/include/halp.h
trunk/reactos/hal/halx86/up/pic.c
Modified: trunk/reactos/hal/halx86/include/halp.h
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/hal/halx86/include/halp.h?…
==============================================================================
--- trunk/reactos/hal/halx86/include/halp.h [iso-8859-1] (original)
+++ trunk/reactos/hal/halx86/include/halp.h [iso-8859-1] Tue Sep 15 23:03:42 2015
@@ -10,12 +10,6 @@
#define INIT_SECTION /* Done via alloc_text for MSC */
#endif
-
-#ifdef _MSC_VER
-#define REGISTERCALL FASTCALL
-#else
-#define REGISTERCALL __attribute__((regparm(3)))
-#endif
#ifdef CONFIG_SMP
#define HAL_BUILD_TYPE (DBG ? PRCB_BUILD_DEBUG : 0)
@@ -430,14 +424,14 @@
typedef
BOOLEAN
-( REGISTERCALL *PHAL_DISMISS_INTERRUPT)(
+(NTAPI *PHAL_DISMISS_INTERRUPT)(
IN KIRQL Irql,
IN ULONG Irq,
OUT PKIRQL OldIrql
);
BOOLEAN
-REGISTERCALL
+NTAPI
HalpDismissIrqGeneric(
IN KIRQL Irql,
IN ULONG Irq,
@@ -445,7 +439,7 @@
);
BOOLEAN
-REGISTERCALL
+NTAPI
HalpDismissIrq15(
IN KIRQL Irql,
IN ULONG Irq,
@@ -453,7 +447,7 @@
);
BOOLEAN
-REGISTERCALL
+NTAPI
HalpDismissIrq13(
IN KIRQL Irql,
IN ULONG Irq,
@@ -461,7 +455,7 @@
);
BOOLEAN
-REGISTERCALL
+NTAPI
HalpDismissIrq07(
IN KIRQL Irql,
IN ULONG Irq,
@@ -469,7 +463,7 @@
);
BOOLEAN
-REGISTERCALL
+NTAPI
HalpDismissIrqLevel(
IN KIRQL Irql,
IN ULONG Irq,
@@ -477,7 +471,7 @@
);
BOOLEAN
-REGISTERCALL
+NTAPI
HalpDismissIrq15Level(
IN KIRQL Irql,
IN ULONG Irq,
@@ -485,7 +479,7 @@
);
BOOLEAN
-REGISTERCALL
+NTAPI
HalpDismissIrq13Level(
IN KIRQL Irql,
IN ULONG Irq,
@@ -493,7 +487,7 @@
);
BOOLEAN
-REGISTERCALL
+NTAPI
HalpDismissIrq07Level(
IN KIRQL Irql,
IN ULONG Irq,
Modified: trunk/reactos/hal/halx86/up/pic.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/hal/halx86/up/pic.c?rev=69…
==============================================================================
--- trunk/reactos/hal/halx86/up/pic.c [iso-8859-1] (original)
+++ trunk/reactos/hal/halx86/up/pic.c [iso-8859-1] Tue Sep 15 23:03:42 2015
@@ -843,7 +843,7 @@
}
BOOLEAN
-REGISTERCALL
+NTAPI
HalpDismissIrqGeneric(IN KIRQL Irql,
IN ULONG Irq,
OUT PKIRQL OldIrql)
@@ -853,7 +853,7 @@
}
BOOLEAN
-REGISTERCALL
+NTAPI
HalpDismissIrq15(IN KIRQL Irql,
IN ULONG Irq,
OUT PKIRQL OldIrql)
@@ -889,7 +889,7 @@
BOOLEAN
-REGISTERCALL
+NTAPI
HalpDismissIrq13(IN KIRQL Irql,
IN ULONG Irq,
OUT PKIRQL OldIrql)
@@ -902,7 +902,7 @@
}
BOOLEAN
-REGISTERCALL
+NTAPI
HalpDismissIrq07(IN KIRQL Irql,
IN ULONG Irq,
OUT PKIRQL OldIrql)
@@ -986,7 +986,7 @@
}
BOOLEAN
-REGISTERCALL
+NTAPI
HalpDismissIrqLevel(IN KIRQL Irql,
IN ULONG Irq,
OUT PKIRQL OldIrql)
@@ -996,7 +996,7 @@
}
BOOLEAN
-REGISTERCALL
+NTAPI
HalpDismissIrq15Level(IN KIRQL Irql,
IN ULONG Irq,
OUT PKIRQL OldIrql)
@@ -1031,7 +1031,7 @@
}
BOOLEAN
-REGISTERCALL
+NTAPI
HalpDismissIrq13Level(IN KIRQL Irql,
IN ULONG Irq,
OUT PKIRQL OldIrql)
@@ -1044,7 +1044,7 @@
}
BOOLEAN
-REGISTERCALL
+NTAPI
HalpDismissIrq07Level(IN KIRQL Irql,
IN ULONG Irq,
OUT PKIRQL OldIrql)
Author: sginsberg
Date: Tue Sep 15 17:55:14 2015
New Revision: 69244
URL: http://svn.reactos.org/svn/reactos?rev=69244&view=rev
Log:
Completely disable the debug register assertions in the trap exit code for KDBG as it sets them improperly. These checks should not have been added for KDBG to begin with and would have made any usage of address breakpoints inside KDBG end up in a trap exit breakpoint. Whoever knows KDBG better than I do please investigate. However, enable the DR7 debug check for KD as it handles the debug registers just fine. The likelihood of loading a driver that modifies a debug register (which would be the only other thing triggering this) is pretty slim.
Modified:
trunk/reactos/ntoskrnl/include/internal/i386/trap_x.h
Modified: trunk/reactos/ntoskrnl/include/internal/i386/trap_x.h
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/include/internal/…
==============================================================================
--- trunk/reactos/ntoskrnl/include/internal/i386/trap_x.h [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/include/internal/i386/trap_x.h [iso-8859-1] Tue Sep 15 17:55:14 2015
@@ -153,6 +153,8 @@
__debugbreak();
}
+ /* FIXME: KDBG messes around with these improperly */
+#if !defined(KDBG)
/* Check DR values */
if (KiUserTrap(TrapFrame))
{
@@ -175,8 +177,9 @@
CheckDr(1, Prcb->ProcessorState.SpecialRegisters.KernelDr1);
CheckDr(2, Prcb->ProcessorState.SpecialRegisters.KernelDr2);
CheckDr(3, Prcb->ProcessorState.SpecialRegisters.KernelDr3);
- //CheckDr(7, Prcb->ProcessorState.SpecialRegisters.KernelDr7);
- }
+ CheckDr(7, Prcb->ProcessorState.SpecialRegisters.KernelDr7);
+ }
+#endif
StopChecking = FALSE;
}