2008-03-02 20:18:17 +00:00
|
|
|
<?xml version="1.0"?>
|
|
|
|
<!DOCTYPE module SYSTEM "../tools/rbuild/project.dtd">
|
|
|
|
<group xmlns:xi="http://www.w3.org/2001/XInclude">
|
|
|
|
<bootstrap installbase="$(CDOUTPUT)" />
|
2008-10-29 16:42:03 +00:00
|
|
|
<importlibrary definition="ntoskrnl.pspec" />
|
2008-03-02 20:18:17 +00:00
|
|
|
<define name="__NTOSKRNL__" />
|
|
|
|
<define name="_NTOSKRNL_" />
|
|
|
|
<define name="_NTSYSTEM_" />
|
|
|
|
<define name="_IN_KERNEL_" />
|
2010-03-07 02:55:13 +00:00
|
|
|
<define name="NTDDI_VERSION">0x05020400</define>
|
2008-03-02 20:18:17 +00:00
|
|
|
<if property="_WINKD_" value="1">
|
|
|
|
<define name="_WINKD_" />
|
|
|
|
</if>
|
2008-07-27 16:33:57 +00:00
|
|
|
<if property="_ELF_" value="1">
|
2008-03-02 20:18:17 +00:00
|
|
|
<define name="_ELF_" />
|
|
|
|
</if>
|
|
|
|
<include base="cmlib">.</include>
|
|
|
|
<include base="ntoskrnl">include</include>
|
|
|
|
<include base="ntoskrnl" root="intermediate"></include>
|
|
|
|
<include base="ntoskrnl" root="intermediate">include</include>
|
|
|
|
<include base="ntoskrnl" root="intermediate">include/internal</include>
|
|
|
|
<include base="ReactOS">include/reactos/drivers</include>
|
|
|
|
<library>csq</library>
|
|
|
|
<library>hal</library>
|
|
|
|
<library>pseh</library>
|
|
|
|
<library>cmlib</library>
|
2008-10-26 12:16:04 +00:00
|
|
|
<library>rtl</library>
|
2008-03-02 20:18:17 +00:00
|
|
|
<library>rossym</library>
|
|
|
|
<library>libcntpr</library>
|
|
|
|
<library>kdcom</library>
|
|
|
|
<library>bootvid</library>
|
|
|
|
<library>wdmguid</library>
|
2008-05-20 19:46:14 +00:00
|
|
|
<dependency>bugcodes</dependency>
|
2008-11-25 21:13:57 +00:00
|
|
|
<directory name="include">
|
2010-02-09 18:14:58 +00:00
|
|
|
<pch>ntoskrnl.h</pch>
|
2008-11-25 21:13:57 +00:00
|
|
|
</directory>
|
2008-03-02 20:18:17 +00:00
|
|
|
<directory name="ke">
|
|
|
|
<if property="ARCH" value="i386">
|
|
|
|
<directory name="i386">
|
|
|
|
<file>abios.c</file>
|
|
|
|
<file>cpu.c</file>
|
2010-01-20 04:05:08 +00:00
|
|
|
<file>context.c</file>
|
2008-03-02 20:18:17 +00:00
|
|
|
<file>ctxswitch.S</file>
|
|
|
|
<file>exp.c</file>
|
|
|
|
<file>irqobj.c</file>
|
|
|
|
<file>kiinit.c</file>
|
|
|
|
<file>ldt.c</file>
|
|
|
|
<file>mtrr.c</file>
|
|
|
|
<file>patpge.c</file>
|
|
|
|
<file>thrdini.c</file>
|
|
|
|
<file>trap.s</file>
|
Trap Handlers in C Patch 1 of X (Patch by Sir_Richard <ros.arm@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.
svn path=/trunk/; revision=45000
2010-01-08 15:04:19 +00:00
|
|
|
<file>traphdlr.c</file>
|
2008-03-02 20:18:17 +00:00
|
|
|
<file>usercall_asm.S</file>
|
|
|
|
<file>usercall.c</file>
|
|
|
|
<file>v86vdm.c</file>
|
|
|
|
</directory>
|
|
|
|
</if>
|
|
|
|
<if property="ARCH" value="arm">
|
|
|
|
<directory name="arm">
|
|
|
|
<file first="true">boot.s</file>
|
|
|
|
<file>cpu.c</file>
|
2008-06-11 19:13:25 +00:00
|
|
|
<file>ctxswtch.s</file>
|
2008-03-02 20:18:17 +00:00
|
|
|
<file>exp.c</file>
|
|
|
|
<file>kiinit.c</file>
|
|
|
|
<file>stubs_asm.s</file>
|
|
|
|
<file>thrdini.c</file>
|
2008-03-11 02:45:13 +00:00
|
|
|
<file>trap.s</file>
|
|
|
|
<file>trapc.c</file>
|
- Rewrite the low-level trap/exception/system call code from the ground up:
- Do not corrupt the stack anymore
- Use a consistent trap frame layout (enable OldIrql and PreviousMode, and set the 0xBADB0D00 debug mark)
- Use slower but more correct trap prolog/epilog code for now.
- Generalize all prolog/epilog code into macros just like on x86. As a result, traps are now 6 lines of code.
- Rewrite the system call interface from the ground up:
- System calls didn't actually work: a debug print made the stack layout magical enough so that they didn't normally crush, but only slowly ate the stack.
- Copying arguments from caller to system call was, as the comment on the original code so aptly put it, "total shit".
- Due to ABI concerns, and to provide an actual template on how you're -supposed- to implement something like system calls on RISC processors, we now use
a model similar to BSD, but about ten times better (with that much less code too). We'll document it later on the RosPSG Wiki.
- This code probably contains some of the most vile-yet-elegant macro magic ever written for such low-level code as system call dispatching.
- The result of all this is that we're at the same place as before (RamdiskAddDevice needs to be implemented by the Ramdisk guys) but with a sane low-level
backend that isn't slowly eating away the stack, corrupting data, and basically working through random chance.
- Move timebase code from stubs.c to its own file, time.c.
- Silence multiple debug prints and fix a corrupted debug print in KiSystemStartup.
svn path=/trunk/; revision=34366
2008-07-08 09:11:44 +00:00
|
|
|
<file>usercall.c</file>
|
2008-03-02 20:18:17 +00:00
|
|
|
</directory>
|
|
|
|
</if>
|
|
|
|
<if property="ARCH" value="powerpc">
|
|
|
|
<directory name="powerpc">
|
|
|
|
<file first="true">main_asm.S</file>
|
|
|
|
<file>cpu.c</file>
|
|
|
|
<file>exp.c</file>
|
|
|
|
<file>kiinit.c</file>
|
|
|
|
<file>ppc_irq.c</file>
|
|
|
|
<file>stubs.c</file>
|
|
|
|
<file>systimer.c</file>
|
|
|
|
<file>thrdini.c</file>
|
|
|
|
<file>ctxswitch.c</file>
|
|
|
|
<file>ctxhelp.S</file>
|
|
|
|
</directory>
|
|
|
|
</if>
|
|
|
|
<file>apc.c</file>
|
|
|
|
<file>balmgr.c</file>
|
|
|
|
<file>bug.c</file>
|
|
|
|
<file>clock.c</file>
|
|
|
|
<file>config.c</file>
|
|
|
|
<file>devqueue.c</file>
|
|
|
|
<file>dpc.c</file>
|
|
|
|
<file>eventobj.c</file>
|
|
|
|
<file>except.c</file>
|
|
|
|
<file>freeldr.c</file>
|
2009-11-08 21:22:24 +00:00
|
|
|
<file>freeze.c</file>
|
2008-03-02 20:18:17 +00:00
|
|
|
<file>gate.c</file>
|
|
|
|
<file>gmutex.c</file>
|
|
|
|
<file>ipi.c</file>
|
|
|
|
<file>krnlinit.c</file>
|
|
|
|
<file>mutex.c</file>
|
|
|
|
<file>procobj.c</file>
|
|
|
|
<file>profobj.c</file>
|
|
|
|
<file>queue.c</file>
|
|
|
|
<file>semphobj.c</file>
|
|
|
|
<file>spinlock.c</file>
|
2010-01-19 06:16:47 +00:00
|
|
|
<file>time.c</file>
|
2008-03-02 20:18:17 +00:00
|
|
|
<file>thrdschd.c</file>
|
|
|
|
<file>thrdobj.c</file>
|
|
|
|
<file>timerobj.c</file>
|
|
|
|
<file>wait.c</file>
|
|
|
|
</directory>
|
|
|
|
<directory name="cc">
|
|
|
|
<file>cacheman.c</file>
|
|
|
|
<file>copy.c</file>
|
|
|
|
<file>fs.c</file>
|
|
|
|
<file>mdl.c</file>
|
|
|
|
<file>pin.c</file>
|
|
|
|
<file>view.c</file>
|
|
|
|
</directory>
|
|
|
|
<directory name="config">
|
|
|
|
<if property="ARCH" value="i386">
|
|
|
|
<directory name="i386">
|
|
|
|
<file>cmhardwr.c</file>
|
|
|
|
</directory>
|
|
|
|
</if>
|
2008-06-15 05:40:27 +00:00
|
|
|
<if property="ARCH" value="arm">
|
|
|
|
<directory name="arm">
|
|
|
|
<file>cmhardwr.c</file>
|
|
|
|
</directory>
|
|
|
|
</if>
|
2008-03-02 20:18:17 +00:00
|
|
|
<if property="ARCH" value="powerpc">
|
|
|
|
<directory name="powerpc">
|
|
|
|
<file>cmhardwr.c</file>
|
|
|
|
</directory>
|
|
|
|
</if>
|
|
|
|
<file>cmalloc.c</file>
|
|
|
|
<file>cmapi.c</file>
|
|
|
|
<file>cmboot.c</file>
|
|
|
|
<file>cmcheck.c</file>
|
|
|
|
<file>cmcontrl.c</file>
|
|
|
|
<file>cmconfig.c</file>
|
|
|
|
<file>cmdata.c</file>
|
|
|
|
<file>cmdelay.c</file>
|
|
|
|
<file>cmindex.c</file>
|
|
|
|
<file>cminit.c</file>
|
|
|
|
<file>cmhook.c</file>
|
|
|
|
<file>cmkcbncb.c</file>
|
|
|
|
<file>cmkeydel.c</file>
|
|
|
|
<file>cmlazy.c</file>
|
|
|
|
<file>cmmapvw.c</file>
|
|
|
|
<file>cmname.c</file>
|
|
|
|
<file>cmparse.c</file>
|
|
|
|
<file>cmse.c</file>
|
|
|
|
<file>cmsecach.c</file>
|
|
|
|
<file>cmsysini.c</file>
|
|
|
|
<file>cmvalue.c</file>
|
|
|
|
<file>cmvalche.c</file>
|
|
|
|
<file>cmwraprs.c</file>
|
|
|
|
<file>ntapi.c</file>
|
|
|
|
</directory>
|
|
|
|
<directory name="dbgk">
|
|
|
|
<file>dbgkutil.c</file>
|
|
|
|
<file>dbgkobj.c</file>
|
|
|
|
</directory>
|
|
|
|
<directory name="ex" root="intermediate">
|
|
|
|
<file>zw.S</file>
|
|
|
|
</directory>
|
|
|
|
<directory name="ex">
|
|
|
|
<if property="ARCH" value="i386">
|
|
|
|
<directory name="i386">
|
|
|
|
<file>interlck_asm.S</file>
|
|
|
|
<file>fastinterlck_asm.S</file>
|
2008-03-12 19:07:32 +00:00
|
|
|
<file>ioport.S</file>
|
2008-03-02 20:18:17 +00:00
|
|
|
</directory>
|
|
|
|
</if>
|
|
|
|
<file>atom.c</file>
|
|
|
|
<file>callback.c</file>
|
|
|
|
<file>dbgctrl.c</file>
|
|
|
|
<file>efi.c</file>
|
|
|
|
<file>event.c</file>
|
|
|
|
<file>evtpair.c</file>
|
2008-03-11 04:42:54 +00:00
|
|
|
<file>exintrin.c</file>
|
2008-03-12 19:07:32 +00:00
|
|
|
<file>fastinterlck.c</file>
|
2008-03-02 20:18:17 +00:00
|
|
|
<file>fmutex.c</file>
|
|
|
|
<file>handle.c</file>
|
|
|
|
<file>harderr.c</file>
|
|
|
|
<file>hdlsterm.c</file>
|
|
|
|
<file>init.c</file>
|
|
|
|
<file>keyedevt.c</file>
|
|
|
|
<file>locale.c</file>
|
|
|
|
<file>lookas.c</file>
|
|
|
|
<file>mutant.c</file>
|
|
|
|
<file>pushlock.c</file>
|
|
|
|
<file>profile.c</file>
|
|
|
|
<file>resource.c</file>
|
|
|
|
<file>rundown.c</file>
|
|
|
|
<file>sem.c</file>
|
|
|
|
<file>shutdown.c</file>
|
|
|
|
<file>sysinfo.c</file>
|
|
|
|
<file>time.c</file>
|
|
|
|
<file>timer.c</file>
|
|
|
|
<file>uuid.c</file>
|
|
|
|
<file>win32k.c</file>
|
|
|
|
<file>work.c</file>
|
|
|
|
<file>xipdisp.c</file>
|
|
|
|
<file>zone.c</file>
|
|
|
|
</directory>
|
|
|
|
<directory name="fsrtl">
|
|
|
|
<file>dbcsname.c</file>
|
|
|
|
<file>fastio.c</file>
|
|
|
|
<file>faulttol.c</file>
|
|
|
|
<file>filelock.c</file>
|
|
|
|
<file>filter.c</file>
|
|
|
|
<file>filtrctx.c</file>
|
|
|
|
<file>fsfilter.c</file>
|
|
|
|
<file>fsrtlpc.c</file>
|
|
|
|
<file>largemcb.c</file>
|
|
|
|
<file>name.c</file>
|
|
|
|
<file>notify.c</file>
|
|
|
|
<file>oplock.c</file>
|
|
|
|
<file>pnp.c</file>
|
|
|
|
<file>stackovf.c</file>
|
|
|
|
<file>tunnel.c</file>
|
|
|
|
<file>unc.c</file>
|
|
|
|
</directory>
|
|
|
|
<directory name="fstub">
|
|
|
|
<file>disksup.c</file>
|
|
|
|
<file>fstubex.c</file>
|
|
|
|
<file>halstub.c</file>
|
|
|
|
</directory>
|
|
|
|
<directory name="inbv">
|
|
|
|
<file>inbv.c</file>
|
|
|
|
</directory>
|
|
|
|
<directory name="io">
|
|
|
|
<directory name="iomgr">
|
|
|
|
<file>adapter.c</file>
|
|
|
|
<file>arcname.c</file>
|
|
|
|
<file>bootlog.c</file>
|
|
|
|
<file>controller.c</file>
|
|
|
|
<file>device.c</file>
|
|
|
|
<file>deviface.c</file>
|
|
|
|
<file>driver.c</file>
|
|
|
|
<file>drvrlist.c</file>
|
|
|
|
<file>error.c</file>
|
|
|
|
<file>file.c</file>
|
|
|
|
<file>iocomp.c</file>
|
|
|
|
<file>ioevent.c</file>
|
|
|
|
<file>iofunc.c</file>
|
|
|
|
<file>iomdl.c</file>
|
|
|
|
<file>iomgr.c</file>
|
|
|
|
<file>iorsrce.c</file>
|
|
|
|
<file>iotimer.c</file>
|
|
|
|
<file>iowork.c</file>
|
|
|
|
<file>irp.c</file>
|
|
|
|
<file>irq.c</file>
|
2008-06-30 02:15:48 +00:00
|
|
|
<file>ramdisk.c</file>
|
2008-03-02 20:18:17 +00:00
|
|
|
<file>rawfs.c</file>
|
|
|
|
<file>remlock.c</file>
|
|
|
|
<file>util.c</file>
|
|
|
|
<file>symlink.c</file>
|
|
|
|
<file>volume.c</file>
|
|
|
|
</directory>
|
|
|
|
<directory name="pnpmgr">
|
|
|
|
<file>plugplay.c</file>
|
|
|
|
<file>pnpdma.c</file>
|
|
|
|
<file>pnpmgr.c</file>
|
|
|
|
<file>pnpnotify.c</file>
|
|
|
|
<file>pnpreport.c</file>
|
|
|
|
<file>pnproot.c</file>
|
|
|
|
</directory>
|
|
|
|
</directory>
|
2009-11-09 21:38:26 +00:00
|
|
|
<if property="_WINKD_" value="0">
|
2009-10-17 14:31:38 +00:00
|
|
|
<directory name="kd">
|
|
|
|
<if property="ARCH" value="i386">
|
|
|
|
<directory name="i386">
|
|
|
|
<file>kdmemsup.c</file>
|
|
|
|
</directory>
|
|
|
|
</if>
|
|
|
|
</directory>
|
|
|
|
</if>
|
2008-03-02 20:18:17 +00:00
|
|
|
<if property="_WINKD_" value="0">
|
|
|
|
<directory name="kdbg">
|
|
|
|
<if property="ARCH" value="i386">
|
|
|
|
<directory name="i386">
|
|
|
|
<if property="KDBG" value="1">
|
|
|
|
<group>
|
|
|
|
<file>i386-dis.c</file>
|
|
|
|
<file>kdb_help.S</file>
|
|
|
|
<file>longjmp.S</file>
|
|
|
|
<file>setjmp.S</file>
|
|
|
|
</group>
|
|
|
|
</if>
|
|
|
|
</directory>
|
|
|
|
</if>
|
|
|
|
<if property="KDBG" value="1">
|
|
|
|
<file>kdb.c</file>
|
|
|
|
<file>kdb_cli.c</file>
|
|
|
|
<file>kdb_expr.c</file>
|
|
|
|
<file>kdb_keyboard.c</file>
|
|
|
|
<file>kdb_serial.c</file>
|
|
|
|
</if>
|
2008-12-02 19:05:11 +00:00
|
|
|
<if property="DBG_OR_KDBG" value="true">
|
2008-03-02 20:18:17 +00:00
|
|
|
<file>kdb_symbols.c</file>
|
|
|
|
</if>
|
|
|
|
</directory>
|
|
|
|
<directory name="kd">
|
|
|
|
<directory name="wrappers">
|
|
|
|
<file>bochs.c</file>
|
|
|
|
<if property="ARCH" value="i386">
|
|
|
|
<file>gdbstub.c</file>
|
|
|
|
</if>
|
|
|
|
<if property="ARCH" value="powerpc">
|
|
|
|
<file>gdbstub_powerpc.c</file>
|
|
|
|
</if>
|
|
|
|
<file>kdbg.c</file>
|
|
|
|
</directory>
|
|
|
|
<file>kdinit.c</file>
|
|
|
|
<file>kdio.c</file>
|
|
|
|
<file>kdmain.c</file>
|
|
|
|
</directory>
|
|
|
|
</if>
|
|
|
|
<if property="_WINKD_" value ="1">
|
|
|
|
<directory name="kd64">
|
2009-10-10 19:27:54 +00:00
|
|
|
<if property="ARCH" value="i386">
|
|
|
|
<directory name="i386">
|
2009-11-08 11:41:35 +00:00
|
|
|
<file>kdx86.c</file>
|
2009-10-10 19:27:54 +00:00
|
|
|
</directory>
|
|
|
|
</if>
|
|
|
|
<if property="ARCH" value="amd64">
|
|
|
|
<directory name="amd64">
|
2009-11-08 11:41:35 +00:00
|
|
|
<file>kdx64.c</file>
|
2009-10-10 19:27:54 +00:00
|
|
|
</directory>
|
|
|
|
</if>
|
|
|
|
<if property="ARCH" value="arm">
|
|
|
|
<directory name="arm">
|
2009-11-08 11:41:35 +00:00
|
|
|
<file>kdarm.c</file>
|
2009-10-10 19:27:54 +00:00
|
|
|
</directory>
|
|
|
|
</if>
|
2008-03-02 20:18:17 +00:00
|
|
|
<file>kdapi.c</file>
|
|
|
|
<file>kdbreak.c</file>
|
|
|
|
<file>kddata.c</file>
|
|
|
|
<file>kdinit.c</file>
|
|
|
|
<file>kdlock.c</file>
|
|
|
|
<file>kdprint.c</file>
|
|
|
|
<file>kdtrap.c</file>
|
|
|
|
</directory>
|
|
|
|
</if>
|
|
|
|
<directory name="lpc">
|
|
|
|
<file>close.c</file>
|
|
|
|
<file>complete.c</file>
|
|
|
|
<file>connect.c</file>
|
|
|
|
<file>create.c</file>
|
|
|
|
<file>listen.c</file>
|
|
|
|
<file>port.c</file>
|
|
|
|
<file>reply.c</file>
|
|
|
|
<file>send.c</file>
|
|
|
|
</directory>
|
|
|
|
<directory name="mm">
|
|
|
|
<if property="ARCH" value="i386">
|
|
|
|
<directory name="i386">
|
|
|
|
<file>page.c</file>
|
|
|
|
</directory>
|
|
|
|
</if>
|
|
|
|
<if property="ARCH" value="arm">
|
|
|
|
<directory name="arm">
|
2010-02-09 02:14:20 +00:00
|
|
|
<file>page.c</file>
|
2008-03-02 20:18:17 +00:00
|
|
|
</directory>
|
|
|
|
</if>
|
|
|
|
<if property="ARCH" value="powerpc">
|
|
|
|
<directory name="powerpc">
|
|
|
|
<file>pfault.c</file>
|
|
|
|
<file>page.c</file>
|
|
|
|
</directory>
|
|
|
|
</if>
|
2009-06-23 04:59:32 +00:00
|
|
|
<directory name="ARM3">
|
2009-07-15 17:55:13 +00:00
|
|
|
<if property="ARCH" value="i386">
|
|
|
|
<directory name="i386">
|
|
|
|
<file>init.c</file>
|
|
|
|
</directory>
|
|
|
|
</if>
|
|
|
|
<if property="ARCH" value="arm">
|
|
|
|
<directory name="arm">
|
|
|
|
<file>init.c</file>
|
|
|
|
</directory>
|
|
|
|
</if>
|
- Reimplement MmAllocateContiguousMemory, MmAllocateContiguousMemorySpecifyCache, MmFreeContiguousMemory, MmFreeContiguousMemorySpecifyCache:
- Use a smarter algorithm (as described here: http://www.microsoft.com/whdc/Driver/tips/ContigMem.mspx) to first try to satisfy the allocation by a simple nonpaged pool allocation (for cached requests only).
- This range is then checked for physical continuity, since it's not guaranteed for non-initial-pool allocations (and right now in ReactOS, it never is).
- As a fallback, Windows NT then attempts to scan free nonpaged pool pages. This is not yet implemented since the ReactOS nonpaged pool is not usually contiguous (to the level that NT's is).
- When the ARM pool is implemented and replaces nonpaged pool, this code path will have to be implemented.
- As a last resort, the actual PFN database is scanned for contiguous free pages.
- ReactOS used MmGetContiguousPages for this, which blindly scanned the PFN database. New MiFindContinuousPages will scan the physical memory descriptor block recently implemented, which avoids going over pages we already know are going to be unusable.
- The ReactOS function also held the PFN lock for the entire duration of the scan, which is significant on systems with large memory. Instead, we make an initial unsafe scan first, and only lock when we think we've found a correct range (and we'll then reconfirm the ranges).
- Finally, the older function actually did a double-scan to try to avoid using memory ranges under 16MB, which was useless on today's systems and also rather inefficient.
- Other than that, the actual setup of the PFN entry is copy-pasted from the old ReactOS function, so nothing's changed there -- the page still looks the same, but the selection algorithm is faster and more accurate.
- Once the pages are found, we piggyback on the new I/O mapping mechanism (which uses System PTEs) instead of doing it all over by hand as before.
- Since the underlying support is still System PTEs, once again, optimizations to that component will yield significant improvements here too.
svn path=/trunk/; revision=41657
2009-06-28 05:43:12 +00:00
|
|
|
<file>contmem.c</file>
|
2009-06-28 07:32:52 +00:00
|
|
|
<file>drvmgmt.c</file>
|
2009-06-27 22:39:03 +00:00
|
|
|
<file>dynamic.c</file>
|
2009-07-09 09:33:49 +00:00
|
|
|
<file>expool.c</file>
|
2009-06-23 07:32:43 +00:00
|
|
|
<file>hypermap.c</file>
|
2009-06-27 03:03:24 +00:00
|
|
|
<file>iosup.c</file>
|
- Major rewrite of Memory Descriptor List (MDL) implementation (moving it towards using System PTEs).
- MmCreateMdl, MmSizeOfMdl: No Change.
- MmBuildMdlForNonPagedPool: Do not use MmGetPfnForProcess, just normal PMMPTE manipulation.
- This seems to cause issues in certain scenarios, because in ReactOS, nonpaged pool, a resident and guaranteed resources, does not always have its PDEs mapped!
- By calling MmGetPfnForProcess, this wound up in the annals of ReactOS mm code, which lazy-remapped the PDE. We detected this issue specifically in the cache manager, and fixed it there. It should not appear anywhere else.
- MmAllocatePagesForMdl, MmAllocatePagesForMdlEx, MmFreePagesFromMdl:
- The *Ex function is now implemented.
- Allocating pages now uses MiAllocatePagesForMdl, which is based on the older MmAllocPagesSpecifyRange.
- The code is cleaner, better commented, and better handles partial MDLs.
- Cache flags are still ignored (so the Ex functionality isn't really there).
- MmMapLockedPages, MmMapLockedPagesSpecifyCache, MmUnmapLockedPages:
- These functions now use System PTEs for the mappings, instead of the hacked-up "MDL Mapping Space".
- This frees up 256MB of Kernel Virtual Address Space.
- Takes advantage of all System PTE functionality.
- Once again, optimizations in the System PTE code will be felt here.
- For user-space mappings however, the old code is still kept and used.
- MiMapLockedPagesInUserSpace and MiUnMapLockedPagesInUserSpace are now in virtual.c and provide this.
- MmProbeAndLockPages, MmUnlockPages:
- The pages are actually probed now, in SEH. This did not seem to happen before (did someone misread the function's name?)
- Probe for write is only done for write access to user pages (as documented).
- We do not probe/check for write access for kernel requests (force Operation to be IoReadAccess).
- Proper locking is used now: Address Space lock for user mappings, PFN lock for kernel mappings.
- Faulting in pages (to make them available before locking) is now done outside the address space/PFN lock.
- You don't want to be holding a spinlock/mutex while doing disk I/O!
- For write/modify access, if the PTE is not writable, fail the request since the PTE protection overrides.
- However, if the PTE is writable but also copy on write, then we'll fault the page in for write access, which is a legitimate operation for certain user-mode scenarios.
- The old version always provided the CopyOnWrite behavior, even for non-CopyOnWrite pages!
- Reference and lock every valid page that has a PFN entry (non-I/O Pages).
- The older code did not seem to lock pages that had to be faulted in (weren't already valid).
- Cleanup the cleanup code (no pun intended). Because we now mark the pages as locked early-on, and because of changes in MmUnlockPages, we can simply use MmUnlockPages in case of error, since it will be able to fully back-out and references/locks that we did.
- Previous code attempted to do this on its own, in a pretty inconsistent manner, which would leave page leaks (both in references and lock count).
- In MmUnlockPages, not as many changes, but we now:
- Still make sure that an I/O Mapping MDL doesn't have valid PFN database pages (non-I/O).
- An MDL can cover pages that are both I/O mapped and RAM mapped, so we have to unlock/dereference the latter instead of skipping them as the old code did.
- Use the PFN lock when checking pages and unlocking/dereferencing them.
- Overall, non-complete MDLs are now marked by having a -1 PFN, and the MDL code has been updated to early-break out of page-scanning loops and/or ignore such pages, which can happen in a sparse MDL.
- Implementation has been tested on VMWare and QEMU for a variety of tasks and was found to be reliable and stable.
svn path=/trunk/; revision=41707
2009-06-30 08:29:22 +00:00
|
|
|
<file>mdlsup.c</file>
|
2010-02-10 02:00:56 +00:00
|
|
|
<file>mminit.c</file>
|
2009-10-15 17:01:31 +00:00
|
|
|
<file>mmsup.c</file>
|
2009-06-30 08:55:18 +00:00
|
|
|
<file>ncache.c</file>
|
- Implement ARM3 page fault handling.
- Paged pool PTEs are demand zero PTEs while the memory hasn't been accessed -- this is the only type of fault supported.
- Because paged pool PDEs are also demand-paged, added code to handle demand paging of PDEs as well.
- Also, because paged pool is non-resident, but can be accessed from any process, we need a mechanism to sync up the kernel's page directory with the per-process one, on demand. This is done at startup, but other processes may have paged in paged pool that another process knows nothing about when he faults.
- Similar to the hack ReactOS Mm uses, but done properly.
- This is what that shadow system page directory is finally being used for.
- Assert if we get a user-mode fault, a transition fault, or a soft fault, since these shouldn't happen.
- Disable APCs while dispatching faults, and pseudo-use the working set lock.
- Assert if we get write errors on read-only pages, since we don't use those in ARM3 yet.
- Assert if we have a paged out PTE, this shouldn't happen yet.
- Enable test to see if we can touch a paged pool allocation.
svn path=/trunk/; revision=43507
2009-10-15 22:08:26 +00:00
|
|
|
<file>pagfault.c</file>
|
2010-02-20 14:40:21 +00:00
|
|
|
<file>pfnlist.c</file>
|
2009-06-23 04:59:32 +00:00
|
|
|
<file>pool.c</file>
|
2009-06-27 08:41:45 +00:00
|
|
|
<file>procsup.c</file>
|
2009-06-23 04:59:32 +00:00
|
|
|
<file>syspte.c</file>
|
2009-10-15 16:50:49 +00:00
|
|
|
<file>virtual.c</file>
|
2009-06-23 04:59:32 +00:00
|
|
|
</directory>
|
2008-03-02 20:18:17 +00:00
|
|
|
<file>anonmem.c</file>
|
|
|
|
<file>balance.c</file>
|
|
|
|
<file>freelist.c</file>
|
|
|
|
<file>marea.c</file>
|
2009-10-31 01:11:43 +00:00
|
|
|
<if property="_WINKD_" value ="1">
|
|
|
|
<file>mmdbg.c</file>
|
|
|
|
</if>
|
- Create mmsup.c in ReactOS memory manager directory. It hosts misc support functions:
- Copy kmap.c here, since it's the very definition of "misc support function"
- Copy some exported functions in mm.c which were listed as "misc functions"
- Warn that current implementation of MmIsNonPagedSystemAddressValid will kill kittens.
- Rename mm.c to mmfault.c, since other than the misc functions now in mmsup.c, it was all routines to handle page/access faults.
- Warn that MmIsAddressValid, as currently implemented, kills puppies.
- Move WriteWatch functions to virtual.c since they're part of the Virtual API system call set already hosted there.
- Move the global variables that people had been throwing in here to mminit.c, which is slightly more appropriate.
- Move wset.c's MmTrimUserMemory to balance.c, since that's where all other similar functions are located.
- Incidentally, kill wset.c, as this was the only function present.
- No functional changes, just refactoring and cleanup (other than warning the critter murder the two broken functions will achieve if called).
svn path=/trunk/; revision=41659
2009-06-28 07:52:30 +00:00
|
|
|
<file>mmfault.c</file>
|
2008-03-02 20:18:17 +00:00
|
|
|
<file>mminit.c</file>
|
|
|
|
<file>mpw.c</file>
|
|
|
|
<file>pagefile.c</file>
|
|
|
|
<file>pageop.c</file>
|
|
|
|
<file>pe.c</file>
|
2010-01-03 05:24:30 +00:00
|
|
|
<file>ppool.c</file>
|
2008-03-02 20:18:17 +00:00
|
|
|
<file>procsup.c</file>
|
|
|
|
<file>region.c</file>
|
|
|
|
<file>rmap.c</file>
|
|
|
|
<file>section.c</file>
|
|
|
|
<file>sysldr.c</file>
|
|
|
|
<file>virtual.c</file>
|
|
|
|
<if property="_ELF_" value="1">
|
|
|
|
<file>elf32.c</file>
|
|
|
|
<file>elf64.c</file>
|
|
|
|
</if>
|
|
|
|
</directory>
|
|
|
|
<directory name="ob">
|
|
|
|
<file>obdir.c</file>
|
|
|
|
<file>obinit.c</file>
|
|
|
|
<file>obhandle.c</file>
|
|
|
|
<file>obname.c</file>
|
|
|
|
<file>oblife.c</file>
|
|
|
|
<file>obref.c</file>
|
2008-04-01 21:21:29 +00:00
|
|
|
<file>obsdcach.c</file>
|
2008-03-02 20:18:17 +00:00
|
|
|
<file>obsecure.c</file>
|
|
|
|
<file>oblink.c</file>
|
|
|
|
<file>obwait.c</file>
|
|
|
|
</directory>
|
|
|
|
<directory name="po">
|
2010-03-08 20:47:10 +00:00
|
|
|
<file>events.c</file>
|
2008-03-02 20:18:17 +00:00
|
|
|
<file>power.c</file>
|
2010-03-08 20:47:10 +00:00
|
|
|
<file>poshtdwn.c</file>
|
|
|
|
<file>povolume.c</file>
|
2008-03-02 20:18:17 +00:00
|
|
|
</directory>
|
|
|
|
<directory name="ps">
|
2008-06-06 21:51:21 +00:00
|
|
|
<if property="ARCH" value="i386">
|
|
|
|
<directory name="i386">
|
|
|
|
<file>psctx.c</file>
|
2009-10-29 10:04:15 +00:00
|
|
|
<file>psldt.c</file>
|
2008-06-06 21:51:21 +00:00
|
|
|
</directory>
|
|
|
|
</if>
|
2008-06-11 16:48:07 +00:00
|
|
|
<if property="ARCH" value="arm">
|
|
|
|
<directory name="arm">
|
|
|
|
<file>psctx.c</file>
|
|
|
|
</directory>
|
|
|
|
</if>
|
2008-03-02 20:18:17 +00:00
|
|
|
<file>debug.c</file>
|
|
|
|
<file>job.c</file>
|
|
|
|
<file>kill.c</file>
|
|
|
|
<file>psnotify.c</file>
|
|
|
|
<file>process.c</file>
|
|
|
|
<file>psmgr.c</file>
|
|
|
|
<file>query.c</file>
|
|
|
|
<file>quota.c</file>
|
|
|
|
<file>security.c</file>
|
|
|
|
<file>state.c</file>
|
|
|
|
<file>thread.c</file>
|
|
|
|
<file>win32.c</file>
|
|
|
|
</directory>
|
|
|
|
<directory name="rtl">
|
2008-03-11 02:45:13 +00:00
|
|
|
<if property="ARCH" value="arm">
|
|
|
|
<directory name="arm">
|
|
|
|
<file>rtlexcpt.c</file>
|
|
|
|
</directory>
|
|
|
|
</if>
|
2008-08-17 18:01:49 +00:00
|
|
|
<if property="ARCH" value="i386">
|
|
|
|
<directory name="i386">
|
|
|
|
<file>stack.S</file>
|
|
|
|
</directory>
|
|
|
|
</if>
|
2008-03-02 20:18:17 +00:00
|
|
|
<file>libsupp.c</file>
|
|
|
|
<file>misc.c</file>
|
|
|
|
</directory>
|
|
|
|
<directory name="se">
|
|
|
|
<file>access.c</file>
|
|
|
|
<file>acl.c</file>
|
|
|
|
<file>audit.c</file>
|
|
|
|
<file>lsa.c</file>
|
|
|
|
<file>priv.c</file>
|
|
|
|
<file>sd.c</file>
|
|
|
|
<file>semgr.c</file>
|
|
|
|
<file>sid.c</file>
|
|
|
|
<file>token.c</file>
|
|
|
|
</directory>
|
|
|
|
<directory name="vdm">
|
|
|
|
<if property="ARCH" value="i386">
|
|
|
|
<file>vdmmain.c</file>
|
|
|
|
<file>vdmexec.c</file>
|
|
|
|
</if>
|
|
|
|
</directory>
|
|
|
|
<directory name="wmi">
|
|
|
|
<file>wmi.c</file>
|
|
|
|
</directory>
|
|
|
|
<file>ntoskrnl.rc</file>
|
|
|
|
<linkerscript>ntoskrnl_$(ARCH).lnk</linkerscript>
|
|
|
|
</group>
|