Commit graph

1524 commits

Author SHA1 Message Date
Timo Kreuzer 5024944fa7 [NTOS]
Fix compilation with MSVC. Dedicated to Stefan.

svn path=/trunk/; revision=46264
2010-03-18 16:30:54 +00:00
Timo Kreuzer 69330a5795 [NTOS]
Rewrite Trap exits stubs in raw assembly (2nd try) and remove inline assembly. Bugcheck in KiTrap0DHandler, when the fault was not handled. Replace code patching for sysexit vs iret with a function pointer. Slightly refactor KiSystemServiceHandler/KiFastCallEntryHanlder. Unroll the loop in the systemcall handler and use volatile keyword when reloading TrapFrame and DescriptorTable from the new stack after converting to gui thread to prevent the compiler from optimizing it away (or moving it out of the loop). Add an asm macro KiCallHandler, which expands to call on debug builds to make sure backtraces work as expected and to jmp on release builds for improved performance. Modify KiExitV86Trap to always exit and add DECLSPEC_NORETURN. Use __debugbreak() instead of while(TRUE) on errors in KiExitTrapDebugChecks.
The old code hat 2 issues: one was restoring segments in KiExitV86Trap when they shouldn't be, leading to a bugcheck. And the other was a long hang (5 mintes or more) in 3rd stage on qemu when selecting RosDbg, caused by the KiFastCallExitHandler function pointer being initialized with a pointer to the iret handler. Initializing it in code solved the issue. To figure out why is left as an exercise to the reader.

svn path=/trunk/; revision=46247
2010-03-17 13:12:46 +00:00
Timo Kreuzer cbdf28bb6a [HEADERS]
Reintegrate header-work branch. Thanks to hours of boring work on the ddk headers (Most of it done by Amine Khaldi), we have now a decent set, which is still incomplete but already relatively close to latest WDK. A clean rebuild is recommended.

svn path=/trunk/; revision=46155
2010-03-12 23:16:29 +00:00
Sir Richard 8a4845b409 [NTOS]: Have I/O Manager Volume Device Objects register with the Power Manager so that they can receive dope.
[NTOS]: Reimplement NtShutdownSystem.
[NTOS]: Implement NtSetSystemPowerState for the shutdown/reboot cases.
[NTOS]: Use the dope from the volume device objects to flush all writeable (non-floppy) devices. Pending hard-disk changes are now flushed to disks before shutdown.
[NTOS]: Flush \\REGISTRY during shutdown. This flushes all pending changes.
[NTOS]: Call into Cc to flush lazy writer during shutdown.
[NTOS]: Stop killing processes on shutdown. The kernel should not be doing this.
[NTOS]: Don't only shutdown disk file systems, but also cdrom and tape.
[NTOS]: Don't only notify drivers of first-chance shutdown -- also parse the last-change shutdown list.
[NTOS]: Reference drivers registering for shutdown notifications so that they remain loaded for them to get the notification at shutdown.
[NTOS]: Notify drivers that have registered/opened the Power State callback.
[NTOS]: A lot of the Po* power state code is highly simplified, but provides a good roadmap to anyone interested in this functionality long-term.

svn path=/trunk/; revision=46004
2010-03-08 20:47:10 +00:00
Sir Richard a15d2634ea [NTOS]: Implement CmSetLazyFlushState to disable lazy writing in the Cm.
[NTOS]: Implement ExSwapInWorkerThreads to in-swap any worker threads when needed.
[NTOS]: Add HAL stubs for HalEndOfBoot and HalSetWakeEnable since most HALs set this to NULL.
[DDK]: Add some missing definitions.

svn path=/trunk/; revision=46001
2010-03-08 20:37:24 +00:00
Sir Richard 12d0dbfe9e Patch for better boot logo/progress bar, fixed /SOS (debug) boot screen/output, removal of "funny" shutdown messages, addition of shutdown logo/screen, and misc:
[NTOS]: Add missing InbvIndicateProgress routine to update the progress bar while drivers are loading. Make boot and system driver initialization call it for each new driver. This updates the progress bar in the 25-75% range which was defined prior to IoInitSystem.
[NTOS]: Fix InbvUpdateProgressBar code to correctly handle the floor and ceiling.
[NTOS]: Remove shutdown "funny messages", do correct shutdown (should fix the ACPI shutdown issues) procedure. Display the shutdown screen on systems without ACPI (just like Windows does).
[NTOS]: Add a resource header with IDB_ definitions for all the embedded bitmaps, instead of using magic numbers and guessing which is which.
[NTOS]: Fix the boot logo initialization code as it was all wrong. 5 is the logo to be used during shutdown, for example, not the full logo background (which is supposed to be in 1, with a special palette that's faded in). Also handle server vs workstation scenarios.
[NTOS]: Booting in the new WinNT mode now correctly displays the blue background screen when in debug (/SOS) mode, and the header/footer also has the correct color, as does the separator band.
[DDK]: Add missing SUITE_TYPE definitions.
[NTOS]: Remove logo files that are simply not needed for ReactOS (Compute Cluster Edition, Tablet PC, etc...)
[NTOS]: Fix logo files (mostly) to have correct palettes. Note that 1.bmp is still quite different from Windows (no fade).

svn path=/trunk/; revision=45822
2010-03-04 06:26:11 +00:00
Timo Kreuzer ddf5c06d6f Revert r45774 until I know why qemu is broken
svn path=/trunk/; revision=45792
2010-03-03 16:30:56 +00:00
Timo Kreuzer 7b6dfd6be4 [NTOS]
- Rewrite trap handler exit stubs in pure assembly, remove gcc inline assembly.
- Replace jmp to C handler with KiCallHandler macro, that expands to jmp on release builds for speed and call on debug builds to fix backtraces.
- Unroll the Syscall handler loop and use volatile keyword when reloading TrapFrame and DescriptorTable from the new stack to prevent the compiler from optimizing it away / moving it out of the loop.
- Bugcheck in KiTrap0DHandler, if the fault couldn't be resolved.
- Remove handling of V86 traps and edited traps in KiServiceExit, ASSERT to make sure they never happen.
- Replace code patching of the syscall exit handler with a function pointer.
- Use __debugbreak() instead of while(TRUE) in KiExitTrapDebugChecks

svn path=/trunk/; revision=45774
2010-03-03 02:27:14 +00:00
Timo Kreuzer 9ea495ba33 Create a branch for header work.
svn path=/branches/header-work/; revision=45691
2010-02-26 22:57:55 +00:00
Ged Murphy c5b25b8e9b - Move from using include guards to pragma once.
- Whilst this is non-standard and potentially makes the code less portable, it's supported by both gcc and msvc and should bringg increased compilation speed due to its optimized behaviour (doesn't need to invoke the preprocessor)
- Patch by Amine Khaldi [amine.khaldi@reactos.org]

svn path=/trunk/; revision=45685
2010-02-26 11:43:19 +00:00
Sir Richard 60f00192eb [NTOS]: Remove SwapEntry parameter from MmAllocPage since it was always zero.
[NTOS]: Store SwapEntry as WsIndex. We can do this now since Flink is only used when the page is in a list (meaning it's not active, ie. free or zero), and non-active pages don't have a swap entry.

svn path=/trunk/; revision=45635
2010-02-20 14:47:23 +00:00
Sir Richard 3bdd2efbc3 [NTOS]: Disable support for global pages since it does not seem to work right on real hardware. Additionally, the code had been previously enabling global pages before the variable determining the support for such pages was even enabled, causing non-global pages to be used initially, followed later by global pages once the variable had been setup. To fix this mess, remove all global page support for now. Fixes booting on certain real hardware (or fixes other random memory corruptions).
Thanks to Caemyr.

svn path=/trunk/; revision=45627
2010-02-19 22:43:34 +00:00
Dmitry Gorbachev 1337cbf945 [NTOSKRNL] KiConvertToGuiThread() "accesses memory in an unpredictable fashion".
svn path=/trunk/; revision=45615
2010-02-18 23:25:12 +00:00
Timo Kreuzer 690fd6eb6d [NTOS] Allocate the trap frame on the stack by decreasing esp before modifying any members.
While doing it after is a tiny optimization (no need to wait for esp to be ready) and would work with all real traps (which clear cli), it doesn't work with Zw calls that directly call KiSystemService with interrupts enabled. This caused random trap frame corruption when an interrupt fired after members of the trap frame have been set but before esp was adjusted. Should hopefully fix most random failures on real hardware and qemu.

svn path=/trunk/; revision=45598
2010-02-15 20:16:15 +00:00
Sir Richard 2cd1a22f66 [NTOS]: Remove bogus assertion.
svn path=/trunk/; revision=45575
2010-02-11 18:33:52 +00:00
Sir Richard c7f7e3bac7 [NTOS]: Move more functions from the i386 ARM3 directory to the portable/shared directory, since they apply to all architectures.
[NTOS]: Refactor the mapping of the PTEs for the PFN database into MiMapPfnDatabase and move the code to portable directory.
[NTOS]: Move and refactor some other definitions, and make some numbers more portable by defining arch-specific subvalues.
[NTOS]: Make the PFN database actually 2 PFN Databases: MmPfnDatabase[0] which is the ReactOS mapping of PHYSICAL_PAGE structures, and MmPfnDatabase[1] which will be the ARM3 mapping of MMPFN structures. The latter is as-of-yet unused, but memory for it is now being reserved.

svn path=/trunk/; revision=45566
2010-02-11 00:01:32 +00:00
Timo Kreuzer dd6b443e89 [REACTOS] Add asm.h containing macros to make assembly code both GAS and ML compatible at the same time.
[NTOS/HAL] Move trap entry points from C into a GAS/ML compatile assembly file (might need fine tuning for ML). The entries are generated by a shared assembly macro TRAP_ENTRY. Removed KiTrapStub, KiIsV8086TrapSafe, KiIsUserTrapSafe, KiSetSaneSegments, removed segment handling from KiEnter*Trap.
[NTOS] Make KiFastCallEntryHandler and KiSystemServiceHandler FASTCALL and pass the systemcall number in TrapFrame->Eax
[HAL] Use _setjmp/longjmp instead of saving a trapframe in HalpBiosCall

svn path=/trunk/; revision=45565
2010-02-10 23:24:59 +00:00
Sir Richard bf310b5d1a [NTOS]: Implement new and correct MiAddressToPte, ToPde, ToPdeOffset, and MiPdeToAddres and MiAddressToPte on ARM. Remove deprecated ARM page definitions.
[NTOS]: Move HYPER_SPACE to 0xC0500000 since it must be on its own PDE. We need to revisit some FreeLDR Mm decisions later.
[NTOS]: Move certain arch-specific definitions from mm.h to the arch-specific mm.h
[NTOS]: Fix certain parts of ARM3 which made the assumption that a PDE shares the same structure as a PTE. This is true on all architectures except ARM. We now define a new MMPDE type specifically for PDEs. On x86 it is defined to MMPTE with no changes.

svn path=/trunk/; revision=45542
2010-02-09 22:56:21 +00:00
Colin Finck 75538f4c0a The big RosBE 1.5 compatibility patch. You will need RosBE 1.5 from this point!
- Set the minimum GCC version to 4.4.0 and minimum Binutils version to 20091016.
- Remove the -fno-unit-at-a-time hacks.
- Remove dgorbachev's temporary hacks for user-mode C++ applications.
- Merge ntoskrnl's "precomp.h" and "ntoskrnl.h" again, the PCH issues have been fixed.
- Use our "ofmt_stub.a" to be compatible with newer MinGW Runtime versions.
- Use LD's new -exclude-all-symbols option to not auto-export all symbols in case no DEF file or __declspec(dllexport) was specified.
  We used to patch our LD version to work around this problem.
- Use LD's --start-group and --end-group parameters to allow a more flexible linking order.
- Use GCC's -fno-set-stack-executable for amd64 and i386 targets to disable adding the __enable_execute_stack code.
- Change the makefile's name to "makefile-$(ARCH).auto" for all architectures.
- Remove some -Wno-error flags.

See issue #4810 for more details.

svn path=/trunk/; revision=45535
2010-02-09 18:14:58 +00:00
evb 1bfa0a72c8 - Make KeFlushProcessTb work. Since no MPCore support, CPU TLB is flushed instead. Maybe should use ASIDs later.
svn path=/trunk/; revision=45534
2010-02-09 18:06:26 +00:00
Sir Richard 7cd39aa34b [MISC]: Build fixes to sync up with latest changes.
[SETUPLDR]: Do not build on ARM. On a side note, I offer a bountry for "if ARCH != ARM" support in .rbuild files, instead of only allowing ==.

svn path=/trunk/; revision=45525
2010-02-09 03:05:49 +00:00
Sir Richard 9a43c209d4 [NTOS]: All calls to DbgPrint will go to DbgPrintEarly for now.
[NTOS]: More header fixes to match new definitions.

svn path=/trunk/; revision=45514
2010-02-09 02:12:27 +00:00
Sir Richard 5786bc7b81 [NTOS]: Add a branch-to-self to start testing kernel code.
[ARMLLB]: Fix incorrect frame buffer size calculation.
[FREELDR]: Finish paging setup. Now we're able to boot to the kernel entrypoint at 0x808D3000, but I'm not happy with the memory descriptors.

svn path=/trunk/; revision=45480
2010-02-07 03:01:19 +00:00
Sir Richard 996267a6ff [FREELDR]: Start rewrite of eVb's messed up FreeLDR paging code. The new code is all dynamic and makes much better decisions as to the layout of the address space and how things will be implemented. Already, we are saving 16MB of VA. For now we still consume a large (1 MB) page for simplicity for the page directory, but that can go away later. I will post a diagram later if time permits. We get to MMU enabled and the PDE_BASE mapping works.
[NTOS]: Start redefining ARMv6 paging structures.

svn path=/trunk/; revision=45477
2010-02-07 00:09:10 +00:00
Sir Richard a5996ad2bf [NTOS]: Combine all exit trap stubs into a single function with flags (same thing we did for the entry stub). Now there are only 15 lines of ASM instead of 60.
svn path=/trunk/; revision=45462
2010-02-06 14:58:23 +00:00
evb fb88430110 - Make boot.s just stub to force load address, since ARM LLB already does setup. Will get rid of later.
- Get rid of all .pagedata stuff from boot.s. Now define simpler static page tables. Will probably get rid of later.
- Fix memory map to include framebuffer, had forgotten about it. Moved framebuffer to the nearest hole found. It happens to be 0xA0000, nice coincidence (matches x86!).
- Switch to nicer 8x16 font instead of 8x13. Now FreeLDR UI looks 99% identical to real PC.
- Start writing new ARMv6 Paging Code. Enable extended page tables and access bit, redefine structures, only for OS Loader for now.
- Identity map low-memory 1MB and MMIO 2MB space at 0x10000000 for Versatile. Need to make this board-specific later.
- Need to investigate sharing code with WinLDR.
- MMU enabled and Printf/LCD output works!.


svn path=/trunk/; revision=45440
2010-02-06 00:49:30 +00:00
Sir Richard 66bdab40af [NTOS]: Yet another fix for KiEnterInterruptTrap: Set correct DS/ES before touching the TrapFrame.
[NTOS]: Make this operation an inline so any possible future code will not make this mistake twice.
Thanks to Physicus for the bug report.

svn path=/trunk/; revision=45381
2010-02-02 22:56:13 +00:00
Sir Richard 02c2d27111 [ARM]: Fix the ARM build, hopefully without breaking the x86 build in the process. Sorry buds!
svn path=/trunk/; revision=45368
2010-02-01 03:51:45 +00:00
Sir Richard 6aa9cce4bb [NTOS]: Try to fix KiEnterInterrupt once and for all. Only set segments for V8086 or user traps.
[NTOS]: Rework the way traps with possibly dirty DS/ES segments are handled. The FAST V86 hack is gone. Intead, created a "safe" version of IsTrapV86 and IsTrapUser that does an SS segment dereference (known good). The condition is then based on this, and the segments are saved and loaded safely. Note that for GCC 4.5 the ASM can be improved to directly branch or not to a label, instead of returning a boolean that is then further compared before branching.
This will fix certain exceptions that were seen in KeUpdateSystemTime, and might fix the sneaking HalpTrap0D while not in V86 mode (no promises).

svn path=/trunk/; revision=45367
2010-02-01 03:47:42 +00:00
Sir Richard c40a4a58a0 [NTOS]: Always set correct segments; the if/else branch should decide which segments to save, not whether or not to set the sane ones. Fixes boot on VirtualBox and real hardware.
svn path=/trunk/; revision=45357
2010-01-31 15:22:55 +00:00
Sir Richard 5a20627609 [NTOS]: Simplify KiTrapStub and write registers in order.
[PERF]: Change instructions used to save registers on the trap frame to fix some WaW and RaW hazards.

svn path=/trunk/; revision=45354
2010-01-30 19:10:22 +00:00
Sir Richard ed3b520c7b [PERF]: Omit setting certain useless trap frame fields.
[NTOS]: Fix KiEnterInterruptFrame. In the case of a V86 trap, the segments were overriden because this wasn't a kernel trap (missing if/elseif).

svn path=/trunk/; revision=45353
2010-01-30 18:25:30 +00:00
Sir Richard 614734706d [NTOS]: Implement the KiInterruptTemplate in C since we now have a C entrry macro. Add a new KI_HARDWARE_INT flag for the C entry macro to generate the appropriate labels for runtime patching of the KINTERRUPT pointer to work, and issue an absolute instead of relative jmp.
[NTOS]: Remove thousands of lines of assembly that are not needed anymore.
[NTOS]: Put all interrupt code in irqobj.c (platform-specific).
[NTOS]: DPC Interrupt is really the thread scheduler interrupt (DPC work happens in C), which mostly does contexts switching and scheduling decisions, so move it to ctxswitch.S

svn path=/trunk/; revision=45309
2010-01-29 01:12:08 +00:00
Sir Richard 5b14ade9f8 [NTOS]: The last big step. Now that the HAL is in C, we can handle interrupts in C. Do so using the proposed model that was #if'ed out, but with some improvements.
[NTOS]: Implement KiUnexpectedInterruptTail and KiUnexpectedInterrupt in C as well.
This is [PERF] too since the C interrupt handling code is a lot more efficient than the ASM one. Numbers look good here.

svn path=/trunk/; revision=45304
2010-01-28 23:18:53 +00:00
Sir Richard 7509f62a3b [PERF]: Optimize nested interrupt cases (where a pending interrupt exists at the end of a software or system interrupt) just like the old HAL did, by jumping into a second-level handler and completing the outer trap frame instead of the nested trap frame. This saves a lot of cycles in those cases, and they do happen quite often (pending DPC at the end of an interrupt, for example).
[NTOS/HAL]: Rework respective code to handle this by using the VDM Alert field in the KPCR.

svn path=/trunk/; revision=45301
2010-01-28 20:45:45 +00:00
Sir Richard da7d769c43 [PERF]: Not in any way a scientific number you should bet the farm on, but we do now count the number of cycles at the very first instruction of kernel initialization, at the moment SMSS initializes the registry (when we call kernel initialization complete), and at the moment there have been 12 processes created (10 without counting idle/system), which is a bit less than a normal GUI boot. We also display the number if interrupts, system calls, and context switches it took to get us there. A purely comparative number, perhaps worthy for inclusion in testman/regression tests?
svn path=/trunk/; revision=45297
2010-01-28 15:51:18 +00:00
Sir Richard 90e0457d60 [NTOS]: Rework the trap macros again. This time we needed some added complexity because of the need for runtime patching at boot. We got away with it nicely and basically implement a simple "if" in ASM, which gives us a deterministic set of instructions (vs the compiler). We then patch if if needed (see next bullet).
[NTOS]: Support systems without SYSENTER. Nothing was actually disabling the SYSEXIT mechanism recently enabled. Now IRET is always used unless a SYSENTER machine is discovered, in which case the jmp to the IRET code is patched with a jmp to SYSEXIT code.
[PERF]: Set WP0 bit in CR0 later, thus allowing the existing runtime patches (and this new one) to function without requiring MmSetPageProtect. Saves TLB flushes and page table walking/mapping on boot.
Left in some debug prints to see what buildbot reports...will remove if it survives.

svn path=/trunk/; revision=45280
2010-01-27 03:05:10 +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 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 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
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
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 601c4ee420 Trying to fix build...
svn path=/trunk/; revision=45225
2010-01-24 01:35:25 +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 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