Commit graph

40704 commits

Author SHA1 Message Date
James Tabor 502cd1c9c9 - Turn off debug print outs.
svn path=/trunk/; revision=45278
2010-01-27 00:06:48 +00:00
Sir Richard 49ca1be9f3 [HAL]: Implement the profile and clock interrupt trap/handlers in C instead of ASM. This allows the kernel to remove the ugly hacks based on internal knowledge of how the assembly/stack of the HAL is supposed to look like. Everything is now done through a clean C interface.
[NTOS]: Remove said hacks and have a normal C implementation of KeUpdateSystemTime. It exits the interrupt through a soft interrupt exit.
[NTOS]: Implement 4 lines of support code needed to handle interrupts during V8086 mode, which were lacking since we weren't hitting this case yet.
Note that now the KeUpdateSystemTime interface is not "compatible" with Windows anymore. This does not matter, since the only possible caller of KeUpdateSystemTime is a very specific HAL routine that needs a very specific stack layout to actually work, so the chance of anyone calling this API is absolutely zero (no, not even some experimental driver. It's absolutely impossible).

svn path=/trunk/; revision=45276
2010-01-26 21:41:05 +00:00
Sir Richard 92df9a6434 [HAL]: Rewrite all V8086-related code in C instead of ASM. Delete v86.s. Makes uses of new macros and developments in NTOS, but should now only end up getting called at shutdown and for bugchecks.
svn path=/trunk/; revision=45272
2010-01-26 19:41:31 +00:00
Sir Richard 842d2aa5f9 [PERF]: What to do when your SYSEXIT code has a bug? Set KiFastSystemCallDisable to TRUE so it never gets used. Now, for the first time in 3 years and 3 months (not giving a specific revision # to protect the 'innocent'), ReactOS actually fully uses the SYSENTER/SYSEXIT instructions isntead of IRETD, since my code doesn't exhibit the bug and SYSEXIT is safe to use. This should save a good hundred cycles or more per system call.
svn path=/trunk/; revision=45271
2010-01-26 19:39:21 +00:00
Sir Richard dd14b916ff [PERF]: After spending the better part of the last two days rewriting the HAL V8086 code (used for BIOS Display Reset) in C, it dawned upon me that it shouldn't even be used during bootup in the first place! The boot loader, running in real-mode, already sets video mode 12 when starting ReactOS. We then repeat the operation, but since we're in protected mode, we have to emulate the whole sheebang with V8086 mode. We now initialize bootvid without requesting a mode switch (which was broken up until a commit ago). This gives us a dirty palette and VGA state. We then call VidResetDisplay to clean up the palette and setup the VGA registers correctly, but we only reset the screen if a custom /BOOTLOGO command is used (which isn't supported yet). We therefore don't need to enter V8086 mode at all up until the switch to graphics mode from the video card driver. Note that Windows doesn't do this (Win7 might due to the new Boot Graphics Library), so we're actually booting faster!
svn path=/trunk/; revision=45270
2010-01-26 19:29:37 +00:00
Sir Richard 590b4a4093 [BOOTVID]: Fix completely broken VidInitialize routine. I have no idea what the original code was trying to accomplish.
svn path=/trunk/; revision=45269
2010-01-26 19:21:41 +00:00
Sir Richard 71162a52f5 [NTOS]: Refactor some stub code and add a couple of more possible trap exit mechanisms (needed for HAL). Later we should really combine all the exit macros into one, as we've done for the entry macro.
svn path=/trunk/; revision=45268
2010-01-26 17:54:50 +00:00
Sir Richard 66a3a56604 [HAL]: Move the HalpApcInterrupt and HalpDispatchInterrupt to pic.c now that there is a C-macro to generate such stubs. Remove irq.S from build/sources.
svn path=/trunk/; revision=45267
2010-01-26 16:31:32 +00:00
Sir Richard 12a31f1df7 [NTOS]: Implement a C/Extended ASM macro for generating trap stubs, removing the need to do this in ASM. The macro covers all possible entries, from SYSENTER to a fake sotware interrupt (needed for HAL changes later). By being somewhat in C, it makes the code cleaner to read and uses C expressions to make its decisions, making the code more maintanable as well. It also removes the need for separate assembly files.
[NTOS]: Modify the semantics of how a fast system call (SYSENTER) is processed in the stub, by moving more work in the C handler, such as setting up FS and getting the correct argument stack. Saves us some cycles too (and allows the trap stub macro to be more generic).

svn path=/trunk/; revision=45266
2010-01-26 15:43:13 +00:00
Dmitry Chapyshev 102c63a3b6 - Update Ukrainian translation by Igor Paliychuk (igor-hkr[at]mail[dot]ru)
svn path=/trunk/; revision=45260
2010-01-26 10:23:30 +00:00
Sir Richard 219e108e3c [NTOS]: Split the GENERATE_TRAP_HANDLER in two separate macros. The original builds the name of the function (and makes it global), while the TRAP_HANDLER_PROLOG is actually the code.
[NTOS]: Make TRAP_HANDLER_PROLOG handle software traps, in which the interrupt stack must be faked.
[NTOS]: Optimize TRAP_HANDLER_PROLOG by not pushing an error code and then making space on the stack without the error code -- just make space with the error code in the first place (nobody reads the value, so having it zero or garbage isn't important).
[HAL]:  Implement the APC and DPC software interrupt traps in C instead of ASM. Delete all contents of irq.S except the two GENERATE_TRAP_HANDLER stubs.

svn path=/trunk/; revision=45244
2010-01-25 03:00:01 +00:00
Sir Richard ef75d24bac [HAL]: Implement HalEndSystemInterrupt and HalpEndSoftwareInterrupt. Remove more ASM code/tables that aren't unused anymore.
svn path=/trunk/; revision=45243
2010-01-25 01:51:47 +00:00
James Tabor 501fcfdd81 [Win32k|Ggi32]
- Diagnostic commit used for troubleshooting leaking region handles.
- Updates to headers and experimental code added for regions.

svn path=/trunk/; revision=45242
2010-01-25 01:33:01 +00:00
Sir Richard 461a068032 [HAL]: Implement HalRequestSoftwareInterrupt in C instead of ASM. Remove deprecated ASM code that was unused.
svn path=/trunk/; revision=45241
2010-01-25 01:26:53 +00:00
Sir Richard fdae8b5c9c [HAL]: KfLowerIrql in C instead of ASM. Add the SWInterruptLookUpTable and SWInterruptHandlerTable to the code and keep the same mechanism as the ASM code used.
svn path=/trunk/; revision=45240
2010-01-25 01:20:43 +00:00
Sir Richard 8e91a3a3f9 [HAL]: Okay, this one was my fault, forgot to built the nasty-ass HALMPS. Move the CMOS lock routines to the shared CMOS file.
svn path=/trunk/; revision=45239
2010-01-24 23:57:09 +00:00
Sir Richard 44b79bf92f You really need to get your compiler version shit together. I was told GCC 4.4 is what's used in ReactOS, yet the build server insists on using an old and broken version of GCC that doesn't support half the things we're trying to do here! Hackfix the Mask Table by providing ugly and incomprehensible hex magic numbers for the mappings, if a GCC older than 4.4 is used.
svn path=/trunk/; revision=45238
2010-01-24 23:35:07 +00:00
Sir Richard 1215f71ed8 [HAL]: Implement and document the HalpSpecialDismissTable. Explain how each IRQ should be handled and what the special cases are. Implement said special cases (based on ISA System Architecture, 3rd Edition).
[HAL]: Implement HalBeginSystemInterrupt in C instead of ASM, it jumps into one of the IRQ handlers registered in the HalpSpecialDismissTable.

svn path=/trunk/; revision=45237
2010-01-24 23:30:43 +00:00
Sir Richard f79bc2e7f0 [HAL]: Implement HalEnableSystemInterrupt and HalDisableSystemInterrupt in C instead of ASM.
svn path=/trunk/; revision=45236
2010-01-24 23:21:36 +00:00
Sir Richard 9c976d58e7 [HAL]: Document and implement KiI8259MaskTable in C using actual bit positions. Each mapping is best to the best of my ability.
[HAL]: Implement KfRaiseIrql in C, remove ASM version.

svn path=/trunk/; revision=45235
2010-01-24 23:19:40 +00:00
Sir Richard 575fd458f2 [HAL]: Implement KeGetCurrentIrql, KeRaiseIrqlToDpcLevel, KeRaiseIrqlToSynchLevel, HalClearSoftwareInterrupt in C instead of ASM.
svn path=/trunk/; revision=45234
2010-01-24 23:14:08 +00:00
Sir Richard ab8a8ee784 [HAL] Merge HalpAcquireSystemHardwareSpinLock and HalpReleaseCmosSpinLock from Timo's AMD64 branch, and delete ASM implementations.
svn path=/trunk/; revision=45233
2010-01-24 23:12:30 +00:00
Dmitry Gorbachev 47d6a16b10 - Use __builtin_trap for old GCC, too.
- KiEoiHelper, KiDispatchExceptionFromTrapFrame: mark noreturn.
- Return DECLSPEC_NORETURNs.

svn path=/trunk/; revision=45232
2010-01-24 15:18:50 +00:00
Sir Richard b4d77b18a8 [PERF]: Make the trap entry/exit macros inlined, just as they used to be before in their pure-assembly forms. This should boost performance quite a bit by avoiding 2-3 extra calls during traps and system calls.
[NTOS]: Cleanup the traphdlr.c vs. trap_x.h mess into something much more structured. trap_x.h is now all inlined C functions which pretty much replace the asmmacros.S file. It is meant to be used outside the kernel as well (such as by the HAL, which requires trap entry/exit too).
[PERF]: Give UNREACHABLE another try, this time with GCC 4.5+, 4.4+, 4.4- and MSVC support.
[PERF]: Remove ABIOS checks since ReactOS does not support this, and since it doesn't look like the target kernel actually does either, we can remove this vestigal/unsupported code, saving some extra branches and checks.

svn path=/trunk/; revision=45231
2010-01-24 05:40:04 +00:00
Dmitry Gorbachev b743407fd6 Comment out DECLSPEC_NORETURN for now.
svn path=/trunk/; revision=45230
2010-01-24 02:25:20 +00:00
Dmitry Gorbachev bb62cd780b Use for GCC before 4.5, too...
svn path=/trunk/; revision=45229
2010-01-24 02:07:40 +00:00
Dmitry Gorbachev 8e4230d981 Trying r45222 hack again...
svn path=/trunk/; revision=45228
2010-01-24 01:58:20 +00:00
Dmitry Gorbachev a79f0c18c8 Put #endif where it should be.
svn path=/trunk/; revision=45227
2010-01-24 01:47:27 +00:00
Dmitry Gorbachev 5811cad11d Forgot ntdef.h
svn path=/trunk/; revision=45226
2010-01-24 01:37:13 +00:00
Dmitry Gorbachev 601c4ee420 Trying to fix build...
svn path=/trunk/; revision=45225
2010-01-24 01:35:25 +00:00
Dmitry Gorbachev 8b7f482f2a Fix vmwinst.exe crash (bug #5134).
svn path=/trunk/; revision=45224
2010-01-24 00:50:54 +00:00
Sir Richard 280c5bef1e [PERF]: Make all trap handlers, trap exit code, fatal exit code, and exception dispatch code "no return" since it always leads to an iret or other kind of non-directly-returning mechanism. This allows the compiler to optimize better and also remove useless code at the bottom of the functions. Since __builtin_unreachable is only for GCC 4.5, we use exit(0) for now (it will never be reached) to trick GCC.
svn path=/trunk/; revision=45223
2010-01-23 23:59:59 +00:00
Sir Richard f4cdf7ef0f [PSDK]: Define DECLSPEC_NORETURN for MSVC and GCC.
svn path=/trunk/; revision=45222
2010-01-23 23:58:29 +00:00
James Tabor 98006d367a [Win32k]
- Fixed DCE masks, clipping and added support for mirror and process owned dce.
- Reference: http://www.reactos.org/archives/public/ros-dev/2008-July/010498.html http://www.reactos.org/archives/public/ros-dev/2008-July/010499.html

svn path=/trunk/; revision=45221
2010-01-23 23:55:32 +00:00
Dmitry Gorbachev 24c017fb93 Fix initialization of PICs.
svn path=/trunk/; revision=45220
2010-01-23 23:39:43 +00:00
Dmitry Gorbachev c88ec84439 Fix build.
svn path=/trunk/; revision=45218
2010-01-23 21:57:15 +00:00
Sir Richard cdb563f380 [PERF]: Replace early ZwClose system calls with ObCloseHandle(KernelMode). This avoids taking a system call for those cases and gives a slight perf boost to booting up the system. It also pushes the first system call somewhat later in the boot process, allowing for easier debugging should the interface have issues/need tracing.
[NTOS]: Do not attempt querying the Registry Primary Handle for the Backing Hive File Size in the case where there is no actual Primary! There was no error checking so nobody noticed this happens -- it also probably resets Cluster to 0 (instead of 1), which can cause corruption in some cases.
[NTOS]: Make KiUserTrap use the MODE_MASK instead of hard-coding a check for Ring 0 CS (which is slower and not as correct).

svn path=/trunk/; revision=45217
2010-01-23 21:27:26 +00:00
Dmitry Gorbachev 89f8b943b1 Remove duplicate definitions (now in time.c).
svn path=/trunk/; revision=45216
2010-01-23 21:24:36 +00:00
Matthias Kupfer 4edc99f6d0 - fix and add German translations
svn path=/trunk/; revision=45215
2010-01-23 20:18:23 +00:00
Sir Richard 0cae32e094 [NTOS]: Export the C KiEoiHelper alongside the ASM Ke386EoiHelper. Yes, this is a "ReactOS-only" export, but really this interface is reserved for the HAL, and as long as we keep Ke386EoiHelper, the NT HAL should still work.
Need to revisit/finalize this decision and whether or not we can emulate the C-interface with Ke386EoiHelper somehow (reliably).

svn path=/trunk/; revision=45214
2010-01-23 19:31:54 +00:00
Sir Richard 84a02b856b [NDK]: Some prototype fixes.
svn path=/trunk/; revision=45213
2010-01-23 19:29:33 +00:00
Sir Richard e18680bb11 [NTOS]: KiDispatchInterrupt crushes EBX, so maybe it should preserve it first? This only worked because KiDispatchInterrupt was only called by ASM code that already was magically aware of this fact, and preserved (or didn't use) EBX before making the call. Yuck!
svn path=/trunk/; revision=45212
2010-01-23 19:28:26 +00:00
Aleksey Bragin 5c2e1ab00c Jose Catena <jc1@diwaves.com>
- Fix a typo in aulldvrm (one of the dividends was always wrong).
See issue #5139 for more details.

svn path=/trunk/; revision=45211
2010-01-23 19:26:06 +00:00
Sir Richard c030074001 [PERF]: Do not declare the PCR in KeGetPcr as volatile. It is only volatile as in "if there is a context switch, the PCR is different". You are in a LOT of trouble if the thread switches while your code is running in the first place, and your code is somehow running as a different thread!
This change makes C code a lot neater, especially during PCR access, because it doesn't force reloading the PCR each time. For example, Read-Modify-Operations on the PCR, such as AND are 1 line of assembly instead of 3.
This helps and will help further with the C HAL, as well as the C trap handlers.

svn path=/trunk/; revision=45210
2010-01-23 18:28:14 +00:00
Dmitry Gorbachev 41563f3396 Fix English translation of RApps. Andrew Faulds (ajfweb =at= googlemail =dot= com), bug #5138.
svn path=/trunk/; revision=45209
2010-01-23 17:26:30 +00:00
Dmitry Chapyshev 1c1c72324a - Add/update Ukrainian translation by Sakara Yevhen (eresid[at]gmail[dot]com) and Igor Paliychuk (igor-hkr[at]mail[dot]ru)
- Update Russian translation for sysdm

svn path=/trunk/; revision=45205
2010-01-22 17:03:08 +00:00
Dmitry Chapyshev aa2498046e - Add/update Ukrainian translation by Sakara Yevhen (eresid[at]gmail[dot]com) and Igor Paliychuk (igor-hkr[at]mail[dot]ru)
- Update Russian translation for spider

svn path=/trunk/; revision=45204
2010-01-22 16:53:12 +00:00
James Tabor 94298228e1 [Win32k]
- Remove CriticalRegion calls.

svn path=/trunk/; revision=45198
2010-01-22 01:29:21 +00:00
James Tabor be48e3ae53 [Win32k]
- Remove CriticalRegion calls.

svn path=/trunk/; revision=45197
2010-01-22 01:12:06 +00:00
Timo Kreuzer f4519c0c43 Merge from amd64-branch:
44886 KxAcquireSpinLock: check for already owned lock only on debug builds, fix check in inner loop, don't call Kii386SpinOnSpinLock inside the inner loop, but instead of it, simplify the code. Stubplement Kii386SpinOnSpinLock in C
44893 Move spinlock inline functions into their own header, so they can be shared with hal.

svn path=/trunk/; revision=45196
2010-01-21 22:34:01 +00:00