[ros-diffs] [martinf] 45001: define _tcscpy_s and _tsplitpath_s again for native VC++ builds
martinf at svn.reactos.org
martinf at svn.reactos.org
Fri Jan 8 16:10:50 CET 2010
- Previous message: [ros-diffs] [ros-arm-bringup] 45000: Trap Handlers in C Patch 1 of X (Patch by Sir_Richard <ros.arm at reactos.org>): [NTOS]: The kernel normally does not save FPU state during Ring 0 transitions since the FPU should not be used. The one exception is when a kernel debugger is attached. Unfortunately, the latter check in ReactOS results in even "print on the serial line" to count as "debugger attached", and thus FPU state was almost always saved, slowing down traps significantly. [NTOS]: The kernel also does not typically save DRx (debug) registers unless they were in use. During an exception dispatch, they are zeroed out, and later during trap exit, if any debug register is set, DR7 is updated to enable that hardware breakpoint. Unfortunately, the code to clear the debug registers had a bug: DR2 was never cleared. Because DR2 ended up being a random stack value during trap frame generation, this caused a bogus address to be added to DR2, and DR7 would then enable the 2nd hardware breakpoint. This caused the kernel to always save DRx state, which is slow, and worse, could cause random hardware breakpoints to fire. [NTOS]: Start implementing trap handling in C. ASM trap handlers will now only be 5 lines of assembly including a function call to a C handler. All C handling code uses maximum two arguments and is all FASTCALL for efficiency. [NTOS]: Implement C versions of TRAP_PROLOG and TRAP_EPILOG. Implement C version of Ki386EoiHelper. Implement C version of CommonDispatchException (and helper) and KiFatalSystemException. Implement C version of CHECK_FOR_APC_DELIVER. Implement trap debugging checks as a separate entity instead of always doing them. [NTOS]: Add missing intrinsics for DS/ES/GS segment query. The kernel is now ready for some trap handling to be done in C. Due to the FPU/Debug fixes and relaxation of paranoid debug checks, the C code will likely be faster than the original assembly.
- Next message: [ros-diffs] [ros-arm-bringup] 45002: Trap Handlers in C Patch 2 of X (Patch by Sir_Richard <ros.arm at reactos.org>): [NTOS]: Convert Trap 0, 1, 3, 4, 5, 8, 10, 11, 12, 15, 17, 2C (Assertion) and 2D (Debug) to C. Tested INT3 and still works as expected, and obviously DbgPrint is still functionning (0x2D). The other traps are mainly programming errors such as bound overflow or integer overflow, so we need some test cases, but they should work. Note the 3-4 lines of C for what used to be dozens of ASM lines. [NTOS]: Fix infinite loop in KiCheckForApcDelivery. Stefan Ginsberg: Could you please implement the relevant Extended GCC ASM into MSVC?
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Author: martinf
Date: Fri Jan 8 16:10:50 2010
New Revision: 45001
URL: http://svn.reactos.org/svn/reactos?rev=45001&view=rev
Log:
define _tcscpy_s and _tsplitpath_s again for native VC++ builds
Modified:
trunk/reactos/base/shell/explorer/utility/utility.h
Modified: trunk/reactos/base/shell/explorer/utility/utility.h
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/explorer/utility/utility.h?rev=45001&r1=45000&r2=45001&view=diff
==============================================================================
--- trunk/reactos/base/shell/explorer/utility/utility.h [iso-8859-1] (original)
+++ trunk/reactos/base/shell/explorer/utility/utility.h [iso-8859-1] Fri Jan 8 16:10:50 2010
@@ -194,10 +194,20 @@
#define strcpy_s(d, l, s) strcpy(d, s)
#define wcscpy_s(d, l, s) wcscpy(d, s)
#define wcsncpy_s(d, l, s, n) wcsncpy(d, s, n)
+
+#if defined(_tcscpy) && !defined(_tcscpy_s)
+#define _tcscpy_s(d, l, s) _tcscpy(d, s)
+#endif
+
+#if defined(_tsplitpath) && !defined(_tsplitpath_s)
+#define _tsplitpath_s(f, d,dl, p,pl, n,nl, e,el) _tsplitpath(f, d, p, n, e)
+#else
+#define _wsplitpath_s(f, d,dl, p,pl, n,nl, e,el) _wsplitpath(f, d, p, n, e)
+#define _splitpath_s(f, d,dl, p,pl, n,nl, e,el) _splitpath(f, d, p, n, e)
+#endif
+
#define _stprintf_s1(b, l, f, p1) _stprintf(b, f, p1)
#define _stprintf_s2(b, l, f, p1,p2) _stprintf(b, f, p1,p2)
-#define _wsplitpath_s(f, d,dl, p,pl, n,nl, e,el) _wsplitpath(f, d, p, n, e)
-#define _splitpath_s(f, d,dl, p,pl, n,nl, e,el) _splitpath(f, d, p, n, e)
#endif // __STDC_WANT_SECURE_LIB__
- Previous message: [ros-diffs] [ros-arm-bringup] 45000: Trap Handlers in C Patch 1 of X (Patch by Sir_Richard <ros.arm at reactos.org>): [NTOS]: The kernel normally does not save FPU state during Ring 0 transitions since the FPU should not be used. The one exception is when a kernel debugger is attached. Unfortunately, the latter check in ReactOS results in even "print on the serial line" to count as "debugger attached", and thus FPU state was almost always saved, slowing down traps significantly. [NTOS]: The kernel also does not typically save DRx (debug) registers unless they were in use. During an exception dispatch, they are zeroed out, and later during trap exit, if any debug register is set, DR7 is updated to enable that hardware breakpoint. Unfortunately, the code to clear the debug registers had a bug: DR2 was never cleared. Because DR2 ended up being a random stack value during trap frame generation, this caused a bogus address to be added to DR2, and DR7 would then enable the 2nd hardware breakpoint. This caused the kernel to always save DRx state, which is slow, and worse, could cause random hardware breakpoints to fire. [NTOS]: Start implementing trap handling in C. ASM trap handlers will now only be 5 lines of assembly including a function call to a C handler. All C handling code uses maximum two arguments and is all FASTCALL for efficiency. [NTOS]: Implement C versions of TRAP_PROLOG and TRAP_EPILOG. Implement C version of Ki386EoiHelper. Implement C version of CommonDispatchException (and helper) and KiFatalSystemException. Implement C version of CHECK_FOR_APC_DELIVER. Implement trap debugging checks as a separate entity instead of always doing them. [NTOS]: Add missing intrinsics for DS/ES/GS segment query. The kernel is now ready for some trap handling to be done in C. Due to the FPU/Debug fixes and relaxation of paranoid debug checks, the C code will likely be faster than the original assembly.
- Next message: [ros-diffs] [ros-arm-bringup] 45002: Trap Handlers in C Patch 2 of X (Patch by Sir_Richard <ros.arm at reactos.org>): [NTOS]: Convert Trap 0, 1, 3, 4, 5, 8, 10, 11, 12, 15, 17, 2C (Assertion) and 2D (Debug) to C. Tested INT3 and still works as expected, and obviously DbgPrint is still functionning (0x2D). The other traps are mainly programming errors such as bound overflow or integer overflow, so we need some test cases, but they should work. Note the 3-4 lines of C for what used to be dozens of ASM lines. [NTOS]: Fix infinite loop in KiCheckForApcDelivery. Stefan Ginsberg: Could you please implement the relevant Extended GCC ASM into MSVC?
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the Ros-diffs
mailing list