Remove the /Wp64 switch from the cabman project file (no idea why it was enabled anyway ;-) and the _W64 macros from the code.
svn path=/trunk/; revision=32395
Implemented KeAcquireInSTackQueuedSpinLock, KeAcquireInStackQueuedSpinLockRaiseToSYnc and KeReleaseInStackQueuedSpinLock based on x86 UP versions.
On ARM, the PCR is fully exposed, so some APIs are always-inlined direct-memory-access (unlike x86 which has the fs selector, and undocumented parts of the PCR). This means we can define several macros -- fixed the headers to allow this, by defining the previous stuff for x86 only.
Setup registry data in the ARM loader block.
The ARM port boots all the way through ExpInitializeExecutive until reaching MmInit1. The boot-registry is correctly loaded and parsed, as are NLS files!
svn path=/trunk/; revision=32379
To the translators that translated winhelp to Greek, Lithuan, Portugese and Ukrainian. Can you please send your translations to winehq? I will keep them anyway, but this way its easier to keep synched.
svn path=/trunk/; revision=32377
The PAE implementation has been moved to pagepae.c, in case someone will ever want to revive.
Even in that case, it's recommended to build two kernels like everyone else does, instead of doing runtime conditionals for every single page operation.
svn path=/trunk/; revision=32374
Not only does this allow us to do MmInit1 in MmInitSystem, where it should be, but it also fixes the fact that several KUSER_SHARED_DATA flags were being zeroed out.
As an added benefit, ARM/PPC ports now need to worry about Mm much later then before (well after the HAL has initialized and interrupts are enabled).
svn path=/trunk/; revision=32373
"Oh my God, I can't believe this is real."
We can now continue the ARM port since the ARM port uses real ARC memory descriptors and not the completely hacked up pages the kernel was previously crossing its fingers to get. As a side effect, this probably unblocks the final hurdle to get ReactOS booted by NTLDR.
svn path=/trunk/; revision=32372
Unfortunately, fixing this bug now caused any unused memory in the FreeLDR-mapped region of 6MB to appear...well...unused. This would normally be a good thing, except ReactOS started crashing.
We fixed it by applying the Glorious Hack. See freelist.c:359.
svn path=/trunk/; revision=32369
The selection of the non-paged pool base address was broken (ion's comment was correct, but his implementation was not) -- NP pool now follows the PFN, or end of FreeLDR mapping area.
There was no reason to put paged pool at a 4MB boundary away from NP pool -- it now follows it immediately.
Got rid of multiple values which were calculated 3, even 4 times in a row, or even values that were calculated but never used (such as kernel_len).
Got rid of the shuffling back and forth of kernel and virtual start/end addresses. A global now keeps track of this, and MmInit1 is now solely responsible for assigning addresses to each kernel region.
Added new debug routine to show the kernel regions mapped -- enabled by default for now to visually detect any problems (once ReactOS's drivers go over 6MB, there may be).
svn path=/trunk/; revision=32368
Add assertions to this function, to make sure PFN access is always valid (previous code would sometimes KEBUGCHECK(0) without a real explenation if such cases were encounted -- but developers randomly chose which functions would be protected).
Also, since PFNs are 0-based, do allow Pfn == MmPageArraySize if someone is reading the last PFN on the system.
Finally, protect some of the functions which were accessing the PFN entries outside the PFN list lock.
svn path=/trunk/; revision=32365
Stop initializing fields to 0 if we've already cleared the entire array!
Stop setting arbitrary values for MapCount and ReferenceCount -- both the KPCR, KUSER_SHARED_DATA and PDE are mapped!
Stop saying Video ROM has a reference count, it's the same as BIOS memory, except the MiIsPfnRam function doesn't detect it and we have a hack for it.
svn path=/trunk/; revision=32361
Moved out the division calculations even one more step out of the loop -- now they're really calculated once, instead of 1000 times (an improvement over the 400000 times they were calculated previously).
svn path=/trunk/; revision=32358
Remove the incomprehensible PFN allocation being done for the pages holding the page list array. We now: 1) Find the highest usable RAM page 2) Allocate the PTEs to hold the array from that point on and lower.
Don't do expensive divisions for every single page on the system being looped! Precompute the values ONCE.
Don't set the reference count for the KPCR and KUSER_SHARED_DATA to 0, these are LIVE pages!
Removed the hack which pre-initializes the balancer -- this isn't needed anymore since the initial PTEs are allocated always from RAM now.
Add some comments about the assumptions being made in this code regarding all PCs having the same kind of memory maps.
svn path=/trunk/; revision=32357
[FORMATTING] Make MmInitializePageList readable by human beings.
Remove code in MmInitializePageList which was just repeating what MmInit1 had already done (why?). Remove alignment code which was duplicated (why??).
svn path=/trunk/; revision=32354
Also, it seems someone added code to get the First/LastKernPhysAddrs without having them setup (they are setup by the FreeLDR hack-code in freeldr.c, not by "real" bootloaders)... so why set them up in the first place? The code now uses the nice memory-list based routines to get this information instead.
Re-factored some detection and debugging code, cleaned up comments.
svn path=/trunk/; revision=32353
Make a specialized UNIMPLEMENTED for Mm code so we don't go too far into the boot with 100 failures hanging behind our backs, which makes it hard to debug progress.
svn path=/trunk/; revision=32351
We still identity map the bottom 0MB of memory with a 1MB page, since this makes the most sense.
We now map the low 8MB of memory to 0x80000000-0x807FFFFF, also with 4KB pages. This area will be discardable after early-init, and contains the early boot structures allocated by FreeLDR.
The Loader Parameter Block and its Extension are now dynamically allocated, instead of being static inside FreeLDR.
Fixed some bugs in the ARM_PTE structure.
svn path=/trunk/; revision=32350