Author: akhaldi
Date: Fri Aug 26 13:51:30 2011
New Revision: 53454
URL:
http://svn.reactos.org/svn/reactos?rev=53454&view=rev
Log:
* Sync trunk up to r53429.
Added:
branches/arty-newcc/boot/freeldr/freeldr/arch/amd64/ntsetup.c
- copied unchanged from r53429,
trunk/reactos/boot/freeldr/freeldr/arch/amd64/ntsetup.c
branches/arty-newcc/boot/freeldr/freeldr/arch/amd64/wlmemory.c
- copied unchanged from r53429,
trunk/reactos/boot/freeldr/freeldr/arch/amd64/wlmemory.c
branches/arty-newcc/boot/freeldr/freeldr/arch/arm/wlmemory.c
- copied unchanged from r53429,
trunk/reactos/boot/freeldr/freeldr/arch/arm/wlmemory.c
branches/arty-newcc/boot/freeldr/freeldr/arch/i386/ntsetup.c
- copied unchanged from r53429,
trunk/reactos/boot/freeldr/freeldr/arch/i386/ntsetup.c
branches/arty-newcc/boot/freeldr/freeldr/arch/i386/wlmemory.c
- copied unchanged from r53429,
trunk/reactos/boot/freeldr/freeldr/arch/i386/wlmemory.c
branches/arty-newcc/boot/freeldr/freeldr/windows/setupldr.c
- copied unchanged from r53429,
trunk/reactos/boot/freeldr/freeldr/windows/setupldr.c
branches/arty-newcc/hal/halx86/generic/legacy/halpnpdd.c
- copied unchanged from r53429, trunk/reactos/hal/halx86/generic/legacy/halpnpdd.c
Removed:
branches/arty-newcc/boot/freeldr/freeldr/windows/amd64/ntsetup.c
branches/arty-newcc/boot/freeldr/freeldr/windows/amd64/wlmemory.c
branches/arty-newcc/boot/freeldr/freeldr/windows/arm/wlmemory.c
branches/arty-newcc/boot/freeldr/freeldr/windows/i386/ntsetup.c
branches/arty-newcc/boot/freeldr/freeldr/windows/i386/wlmemory.c
branches/arty-newcc/boot/freeldr/freeldr/windows/setupldr2.c
Modified:
branches/arty-newcc/ (props changed)
branches/arty-newcc/baseaddress.rbuild
branches/arty-newcc/boot/freeldr/freeldr/CMakeLists.txt
branches/arty-newcc/boot/freeldr/freeldr/bootmgr.c
branches/arty-newcc/boot/freeldr/freeldr/freeldr_arch.rbuild
branches/arty-newcc/boot/freeldr/freeldr/setupldr_main.rbuild
branches/arty-newcc/dll/directx/ksproxy/output_pin.cpp
branches/arty-newcc/drivers/ksfilter/ks/filter.c
branches/arty-newcc/drivers/storage/scsiport/scsiport.c
branches/arty-newcc/drivers/wdm/audio/backpln/portcls/irpstream.cpp
branches/arty-newcc/hal/halx86/CMakeLists.txt
branches/arty-newcc/hal/halx86/generic/legacy/halpcat.c
branches/arty-newcc/hal/halx86/hal_generic_acpi.rbuild
branches/arty-newcc/hal/halx86/hal_generic_pcat.rbuild
branches/arty-newcc/include/c++/stlport/stl/config/_reactos.h
branches/arty-newcc/include/crt/msc/intrin.h
branches/arty-newcc/lib/3rdparty/stlport/CMakeLists.txt
branches/arty-newcc/media/inf/hal.inf
Propchange: branches/arty-newcc/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Aug 26 13:51:30 2011
@@ -9,4 +9,4 @@
/branches/ros-amd64-bringup:36852
/branches/ros-amd64-bringup/reactos:34711-34712,34741,34743,34770,34780-34782,34803,34812,34839,34842,34864,34870,34874,34877,34908-34909,34917,34965,35323-35324,35347-35348,35361,35436,35509,35515,35588,35655,35683,35739,35746,35762,35771,35777,35781,35789,35805,35823,35827,35902,35904-35906,35942,35947-35949,35952-35953,35966,36011-36013,36172,36360,36380,36388-36389,36393,36397,36443,36445,36475,36502-36503,36505,36570,36614,36852,36898-36899,36930,36936,36949,36951,36958,36961,36964,36969,36972,36987-36988,36990,36992,37019,37322-37323,37333-37334,37434,37472,37475,37536,37820-37821,37868-37869,37873,37990-37991,38013-38014,38092,38100,38148-38151,38264-38265,38268,38355,39151,39333,39335,39345,39639,40120,40122-40123,40125,40127-40128,40155,40247,40324,40608,40753,40926-40928,40986-40987,40989,40991,40993,40995-40996,41000-41001,41027-41030,41044-41045,41047-41050,41052,41070,41082-41086,41097-41098,41101,41449,41479-41480,41483-41485,41499-41500,41502,41531,41536,41540,41546-41547,41549,43080,43426,43451,43454,43506,43566,43574,43598,43600-43602,43604-43605,43677,43682,43757,43775,43836,43838-43840,43852,43857-43858,43860,43905-43907,43952,43954,43965,43969,43979,43981,43992,44002,44036-44037,44039-44040,44044-44045,44053,44065,44095,44123,44143-44144,44205,44238,44257,44259,44294,44338-44339,44385,44389,44391,44426,44460,44467-44468,44470-44471,44499,44501,44503-44504,44506,44510-44512,44521,44523-44526,44530,44540,44601,44634,44639,44772,44818,45124,45126-45127,45430,46394,46404,46478,46511,46523-46524,46526,46534-46535,46537-46539,46589,46805,46868,47472,47846-47847,47878,47882
/branches/tcp-rewrite-branch:48720,48840-48841,49424-49426,49454
-/trunk/reactos:50808-53421
+/trunk/reactos:50808-53429
Modified: branches/arty-newcc/baseaddress.rbuild
URL:
http://svn.reactos.org/svn/reactos/branches/arty-newcc/baseaddress.rbuild?r…
==============================================================================
--- branches/arty-newcc/baseaddress.rbuild [iso-8859-1] (original)
+++ branches/arty-newcc/baseaddress.rbuild [iso-8859-1] Fri Aug 26 13:51:30 2011
@@ -190,21 +190,21 @@
<property name="BASEADDRESS_CRYPTNET" value="0x75e60000" />
<property name="BASEADDRESS_RPCRT4" value="0x76000000" />
<property name="BASEADDRESS_SHLWAPI" value="0x76100000" />
- <property name="BASEADDRESS_INETCOMM" value="0x76140000" />
- <property name="BASEADDRESS_COMCTL32" value="0x76170000" />
- <property name="BASEADDRESS_COMDLG32" value="0x76230000" />
+ <property name="BASEADDRESS_COMCTL32" value="0x76180000" />
+ <property name="BASEADDRESS_COMDLG32" value="0x762d0000" />
<property name="BASEADDRESS_WINSTA" value="0x762f0000" />
- <property name="BASEADDRESS_IMM32" value="0x76320000" />
<property name="BASEADDRESS_D3D8THK" value="0x76340000" />
<property name="BASEADDRESS_RICHED32" value="0x76340000" />
<property name="BASEADDRESS_RICHED20" value="0x76360000" />
<property name="BASEADDRESS_ODBCCP32" value="0x76380000" />
<property name="BASEADDRESS_TWAIN_32" value="0x76380000" />
<property name="BASEADDRESS_NETSHELL" value="0x76390000" />
+ <property name="BASEADDRESS_IMM32" value="0x763a0000" />
+ <property name="BASEADDRESS_INETCOMM" value="0x763E0000" />
<property name="BASEADDRESS_LSASRV" value="0x76540000" />
<property name="BASEADDRESS_MIDIMAP" value="0x76600000" />
<property name="BASEADDRESS_WAVEMAP" value="0x76610000" />
- <property name="BASEADDRESS_MPR" value="0x76620000" />
+ <property name="BASEADDRESS_MPR" value="0x76630000" />
<property name="BASEADDRESS_MSHTML" value="0x76650000" />
<property name="BASEADDRESS_ODBC32" value="0x76710000" />
<property name="BASEADDRESS_SETUPAPI" value="0x76730000" />
@@ -243,7 +243,7 @@
<property name="BASEADDRESS_IPRTPRIO" value="0x777c0000" />
<property name="BASEADDRESS_WS2HELP" value="0x777e0000" />
<property name="BASEADDRESS_WSHIRDA" value="0x777f0000" />
- <property name="BASEADDRESS_VERSION" value="0x77a40000" />
+ <property name="BASEADDRESS_VERSION" value="0x77a30000" />
<property name="BASEADDRESS_OLE32" value="0x77a50000" />
<property name="BASEADDRESS_OLEPRO32" value="0x77b20000" />
<property name="BASEADDRESS_ACTIVEDS" value="0x77cb0000" />
Modified: branches/arty-newcc/boot/freeldr/freeldr/CMakeLists.txt
URL:
http://svn.reactos.org/svn/reactos/branches/arty-newcc/boot/freeldr/freeldr…
==============================================================================
--- branches/arty-newcc/boot/freeldr/freeldr/CMakeLists.txt [iso-8859-1] (original)
+++ branches/arty-newcc/boot/freeldr/freeldr/CMakeLists.txt [iso-8859-1] Fri Aug 26
13:51:30 2011
@@ -107,8 +107,8 @@
arch/i386/xboxmem.c
arch/i386/xboxrtc.c
arch/i386/xboxvideo.c
- windows/i386/ntsetup.c
- windows/i386/wlmemory.c
+ arch/i386/ntsetup.c
+ arch/i386/wlmemory.c
windows/headless.c
disk/scsiport.c)
if(NOT MSVC)
@@ -134,8 +134,8 @@
arch/i386/pcmem.c
arch/i386/pcrtc.c
arch/i386/pcvideo.c
- windows/amd64/ntsetup.c
- windows/amd64/wlmemory.c)
+ arch/amd64/ntsetup.c
+ arch/amd64/wlmemory.c)
else()
#TBD
endif()
@@ -191,7 +191,7 @@
inffile/inffile.c)
if(ARCH MATCHES i386 OR ARCH MATCHES amd64)
- list(APPEND SETUPLDR_SOURCE windows/setupldr2.c)
+ list(APPEND SETUPLDR_SOURCE windows/setupldr.c)
endif()
if(NOT MSVC)
Modified: branches/arty-newcc/boot/freeldr/freeldr/bootmgr.c
URL:
http://svn.reactos.org/svn/reactos/branches/arty-newcc/boot/freeldr/freeldr…
==============================================================================
--- branches/arty-newcc/boot/freeldr/freeldr/bootmgr.c [iso-8859-1] (original)
+++ branches/arty-newcc/boot/freeldr/freeldr/bootmgr.c [iso-8859-1] Fri Aug 26 13:51:30
2011
@@ -213,7 +213,7 @@
if (BootType[0] == ANSI_NULL && SectionName[0] != ANSI_NULL)
{
// Try to infere boot type value
-#ifdef __i386__
+#ifdef _M_IX86
ULONG FileId;
if (ArcOpen((CHAR*)SectionName, OpenReadOnly, &FileId) == ESUCCESS)
{
@@ -231,20 +231,15 @@
IniOpenSection("Operating Systems", &SectionId);
IniReadSettingByName(SectionId, SectionName, SettingValue, sizeof(SettingValue));
-#ifndef _M_ARM
// Install the drive mapper according to this sections drive mappings
-#if defined(__i386__) && !defined(_MSC_VER)
+#if defined(_M_IX86) && !defined(_MSC_VER)
DriveMapMapDrivesInSection(SectionName);
#endif
+
#ifdef FREELDR_REACTOS_SETUP
- if (_stricmp(BootType, "ReactOSSetup2") == 0)
- {
- // WinLdr-style boot
- LoadReactOSSetup2();
- }
- else
-#endif
-#ifdef __i386__
+ // WinLdr-style boot
+ LoadReactOSSetup2();
+#elif defined(_M_IX86)
if (_stricmp(BootType, "Windows") == 0)
{
LoadAndBootWindows(SectionName, SettingValue, 0);
@@ -273,12 +268,10 @@
{
LoadAndBootDrive(SectionName);
}
-#endif
#else
- LoadAndBootWindows(SectionName, SettingValue, _WIN32_WINNT_WS03);
-#endif
- }
-
+ LoadAndBootWindows(SectionName, SettingValue, _WIN32_WINNT_WS03);
+#endif
+ }
reboot:
UiUnInitialize("Rebooting...");
Modified: branches/arty-newcc/boot/freeldr/freeldr/freeldr_arch.rbuild
URL:
http://svn.reactos.org/svn/reactos/branches/arty-newcc/boot/freeldr/freeldr…
==============================================================================
--- branches/arty-newcc/boot/freeldr/freeldr/freeldr_arch.rbuild [iso-8859-1] (original)
+++ branches/arty-newcc/boot/freeldr/freeldr/freeldr_arch.rbuild [iso-8859-1] Fri Aug 26
13:51:30 2011
@@ -41,6 +41,8 @@
<file>xboxmem.c</file>
<file>xboxrtc.c</file>
<file>xboxvideo.c</file>
+ <file>ntsetup.c</file>
+ <file>wlmemory.c</file>
</if>
</directory>
<directory name="powerpc">
@@ -69,6 +71,8 @@
<if property="ARCH" value="amd64">
<directory name="amd64">
<file>loader.c</file>
+ <file>ntsetup.c</file>
+ <file>wlmemory.c</file>
</directory>
<directory name="i386">
<file>hardware.c</file>
@@ -87,23 +91,8 @@
</directory>
</if>
- </directory>
-
- <directory name="windows">
- <if property="ARCH" value="arm">
- <directory name="arm">
- <file>wlmemory.c</file>
- </directory>
- </if>
- <if property="ARCH" value="i386">
- <directory name="i386">
- <file>ntsetup.c</file>
- <file>wlmemory.c</file>
- </directory>
- </if>
- <if property="ARCH" value="amd64">
- <directory name="amd64">
- <file>ntsetup.c</file>
+ <if property="ARCH" value="arm">
+ <directory name="arm">
<file>wlmemory.c</file>
</directory>
</if>
Modified: branches/arty-newcc/boot/freeldr/freeldr/setupldr_main.rbuild
URL:
http://svn.reactos.org/svn/reactos/branches/arty-newcc/boot/freeldr/freeldr…
==============================================================================
--- branches/arty-newcc/boot/freeldr/freeldr/setupldr_main.rbuild [iso-8859-1] (original)
+++ branches/arty-newcc/boot/freeldr/freeldr/setupldr_main.rbuild [iso-8859-1] Fri Aug 26
13:51:30 2011
@@ -9,14 +9,7 @@
<directory name="inffile">
<file>inffile.c</file>
</directory>
- <if property="ARCH" value="i386">
- <directory name="windows">
- <file>setupldr2.c</file>
- </directory>
- </if>
- <if property="ARCH" value="amd64">
- <directory name="windows">
- <file>setupldr2.c</file>
- </directory>
- </if>
+ <directory name="windows">
+ <file>setupldr.c</file>
+ </directory>
</module>
Removed: branches/arty-newcc/boot/freeldr/freeldr/windows/amd64/ntsetup.c
URL:
http://svn.reactos.org/svn/reactos/branches/arty-newcc/boot/freeldr/freeldr…
==============================================================================
--- branches/arty-newcc/boot/freeldr/freeldr/windows/amd64/ntsetup.c [iso-8859-1]
(original)
+++ branches/arty-newcc/boot/freeldr/freeldr/windows/amd64/ntsetup.c (removed)
@@ -1,84 +1,0 @@
-/*
- * PROJECT: EFI Windows Loader
- * LICENSE: GPL - See COPYING in the top level directory
- * FILE: freeldr/windows/i386/ntsetup.c
- * PURPOSE: i386-specific setup for Windows boot
- * PROGRAMMERS: Aleksey Bragin (aleksey(a)reactos.org)
- */
-
-/* INCLUDES ***************************************************************/
-
-#include <freeldr.h>
-#include <debug.h>
-
-// this is needed for new IDT filling
-#if 0
-extern ULONG_PTR i386DivideByZero;
-extern ULONG_PTR i386DebugException;
-extern ULONG_PTR i386NMIException;
-extern ULONG_PTR i386Breakpoint;
-extern ULONG_PTR i386Overflow;
-extern ULONG_PTR i386BoundException;
-extern ULONG_PTR i386InvalidOpcode;
-extern ULONG_PTR i386FPUNotAvailable;
-extern ULONG_PTR i386DoubleFault;
-extern ULONG_PTR i386CoprocessorSegment;
-extern ULONG_PTR i386InvalidTSS;
-extern ULONG_PTR i386SegmentNotPresent;
-extern ULONG_PTR i386StackException;
-extern ULONG_PTR i386GeneralProtectionFault;
-extern ULONG_PTR i386PageFault; // exc 14
-extern ULONG_PTR i386CoprocessorError; // exc 16
-extern ULONG_PTR i386AlignmentCheck; // exc 17
-#endif
-
-/* FUNCTIONS **************************************************************/
-
-// Last step before going virtual
-void WinLdrSetupForNt(PLOADER_PARAMETER_BLOCK LoaderBlock,
- PVOID *GdtIdt,
- ULONG *PcrBasePage,
- ULONG *TssBasePage)
-{
- ULONG TssSize;
- ULONG TssPages;
- ULONG_PTR Pcr = 0;
- ULONG_PTR Tss = 0;
- ULONG BlockSize, NumPages;
-
- LoaderBlock->u.I386.CommonDataArea = (PVOID)DbgPrint; // HACK
- LoaderBlock->u.I386.MachineType = MACHINE_TYPE_ISA;
-
- /* Allocate 2 pages for PCR */
- Pcr = (ULONG_PTR)MmAllocateMemoryWithType(2 * MM_PAGE_SIZE, LoaderStartupPcrPage);
- *PcrBasePage = Pcr >> MM_PAGE_SHIFT;
- RtlZeroMemory((PVOID)Pcr, 2 * MM_PAGE_SIZE);
-
- if (Pcr == 0)
- {
- UiMessageBox("Can't allocate PCR\n");
- return;
- }
-
- /* Allocate TSS */
- TssSize = (sizeof(KTSS) + MM_PAGE_SIZE) & ~(MM_PAGE_SIZE - 1);
- TssPages = TssSize / MM_PAGE_SIZE;
-
- Tss = (ULONG_PTR)MmAllocateMemoryWithType(TssSize, LoaderMemoryData);
-
- *TssBasePage = Tss >> MM_PAGE_SHIFT;
-
- /* Allocate space for new GDT + IDT */
- BlockSize = NUM_GDT*sizeof(KGDTENTRY) + NUM_IDT*sizeof(KIDTENTRY);//FIXME: Use GDT/IDT
limits here?
- NumPages = (BlockSize + MM_PAGE_SIZE - 1) >> MM_PAGE_SHIFT;
- *GdtIdt = (PKGDTENTRY)MmAllocateMemoryWithType(NumPages * MM_PAGE_SIZE,
LoaderMemoryData);
-
- if (*GdtIdt == NULL)
- {
- UiMessageBox("Can't allocate pages for GDT+IDT!\n");
- return;
- }
-
- /* Zero newly prepared GDT+IDT */
- RtlZeroMemory(*GdtIdt, NumPages << MM_PAGE_SHIFT);
-}
Removed: branches/arty-newcc/boot/freeldr/freeldr/windows/amd64/wlmemory.c
URL:
http://svn.reactos.org/svn/reactos/branches/arty-newcc/boot/freeldr/freeldr…
==============================================================================
--- branches/arty-newcc/boot/freeldr/freeldr/windows/amd64/wlmemory.c [iso-8859-1]
(original)
+++ branches/arty-newcc/boot/freeldr/freeldr/windows/amd64/wlmemory.c (removed)
@@ -1,354 +1,0 @@
-/*
- * PROJECT: EFI Windows Loader
- * LICENSE: GPL - See COPYING in the top level directory
- * FILE: freeldr/amd64/wlmemory.c
- * PURPOSE: Memory related routines
- * PROGRAMMERS: Timo Kreuzer (timo.kreuzer(a)reactos.org)
- */
-
-/* INCLUDES ***************************************************************/
-
-#include <freeldr.h>
-
-#include <ndk/asm.h>
-#include <debug.h>
-
-//extern ULONG LoaderPagesSpanned;
-
-#define HYPER_SPACE_ENTRY 0x1EE
-
-/* GLOBALS ***************************************************************/
-
-PHARDWARE_PTE PxeBase;
-//PHARDWARE_PTE HalPageTable;
-
-
-/* FUNCTIONS **************************************************************/
-
-BOOLEAN
-MempAllocatePageTables()
-{
- DPRINTM(DPRINT_WINDOWS,">>> MempAllocatePageTables\n");
-
- /* Allocate a page for the PML4 */
- PxeBase = MmAllocateMemoryWithType(PAGE_SIZE, LoaderMemoryData);
- if (!PxeBase)
- {
- DPRINTM(DPRINT_WINDOWS,"failed to allocate PML4\n");
- return FALSE;
- }
-
- // FIXME: Physical PTEs = FirmwareTemporary ?
-
- /* Zero the PML4 */
- RtlZeroMemory(PxeBase, PAGE_SIZE);
-
- /* The page tables are located at 0xfffff68000000000
- * We create a recursive self mapping through all 4 levels at
- * virtual address 0xfffff6fb7dbedf68 */
- PxeBase[VAtoPXI(PXE_BASE)].Valid = 1;
- PxeBase[VAtoPXI(PXE_BASE)].Write = 1;
- PxeBase[VAtoPXI(PXE_BASE)].PageFrameNumber = PtrToPfn(PxeBase);
-
- // FIXME: map PDE's for hals memory mapping
-
- DPRINTM(DPRINT_WINDOWS,">>> leave MempAllocatePageTables\n");
-
- return TRUE;
-}
-
-PHARDWARE_PTE
-MempGetOrCreatePageDir(PHARDWARE_PTE PdeBase, ULONG Index)
-{
- PHARDWARE_PTE SubDir;
-
- if (!PdeBase)
- return NULL;
-
- if (!PdeBase[Index].Valid)
- {
- SubDir = MmAllocateMemoryWithType(PAGE_SIZE, LoaderMemoryData);
- if (!SubDir)
- return NULL;
- RtlZeroMemory(SubDir, PAGE_SIZE);
- PdeBase[Index].PageFrameNumber = PtrToPfn(SubDir);
- PdeBase[Index].Valid = 1;
- PdeBase[Index].Write = 1;
- }
- else
- {
- SubDir = (PVOID)((ULONG64)(PdeBase[Index].PageFrameNumber) * PAGE_SIZE);
- }
- return SubDir;
-}
-
-BOOLEAN
-MempMapSinglePage(ULONG64 VirtualAddress, ULONG64 PhysicalAddress)
-{
- PHARDWARE_PTE PpeBase, PdeBase, PteBase;
- ULONG Index;
-
- PpeBase = MempGetOrCreatePageDir(PxeBase, VAtoPXI(VirtualAddress));
- PdeBase = MempGetOrCreatePageDir(PpeBase, VAtoPPI(VirtualAddress));
- PteBase = MempGetOrCreatePageDir(PdeBase, VAtoPDI(VirtualAddress));
-
- if (!PteBase)
- {
- DPRINTM(DPRINT_WINDOWS,"!!!No Dir %p, %p, %p, %p\n", PxeBase, PpeBase,
PdeBase, PteBase);
- return FALSE;
- }
-
- Index = VAtoPTI(VirtualAddress);
- if (PteBase[Index].Valid)
- {
- DPRINTM(DPRINT_WINDOWS,"!!!Already mapped %ld\n", Index);
- return FALSE;
- }
-
- PteBase[Index].Valid = 1;
- PteBase[Index].Write = 1;
- PteBase[Index].PageFrameNumber = PhysicalAddress / PAGE_SIZE;
-
- return TRUE;
-}
-
-BOOLEAN
-MempIsPageMapped(PVOID VirtualAddress)
-{
- PHARDWARE_PTE PpeBase, PdeBase, PteBase;
- ULONG Index;
-
- Index = VAtoPXI(VirtualAddress);
- if (!PxeBase[Index].Valid)
- return FALSE;
-
- PpeBase = (PVOID)((ULONG64)(PxeBase[Index].PageFrameNumber) * PAGE_SIZE);
- Index = VAtoPPI(VirtualAddress);
- if (!PpeBase[Index].Valid)
- return FALSE;
-
- PdeBase = (PVOID)((ULONG64)(PpeBase[Index].PageFrameNumber) * PAGE_SIZE);
- Index = VAtoPDI(VirtualAddress);
- if (!PdeBase[Index].Valid)
- return FALSE;
-
- PteBase = (PVOID)((ULONG64)(PdeBase[Index].PageFrameNumber) * PAGE_SIZE);
- Index = VAtoPTI(VirtualAddress);
- if (!PteBase[Index].Valid)
- return FALSE;
-
- return TRUE;
-}
-
-ULONG
-MempMapRangeOfPages(ULONG64 VirtualAddress, ULONG64 PhysicalAddress, ULONG cPages)
-{
- ULONG i;
-
- for (i = 0; i < cPages; i++)
- {
- if (!MempMapSinglePage(VirtualAddress, PhysicalAddress))
- {
- return i;
- }
- VirtualAddress += PAGE_SIZE;
- PhysicalAddress += PAGE_SIZE;
- }
- return i;
-}
-
-BOOLEAN
-MempSetupPaging(IN ULONG StartPage,
- IN ULONG NumberOfPages)
-{
- DPRINTM(DPRINT_WINDOWS,">>> MempSetupPaging(0x%lx, %ld, %p)\n",
- StartPage, NumberOfPages, StartPage * PAGE_SIZE + KSEG0_BASE);
-
- /* Identity mapping */
- if (MempMapRangeOfPages(StartPage * PAGE_SIZE,
- StartPage * PAGE_SIZE,
- NumberOfPages) != NumberOfPages)
- {
- DPRINTM(DPRINT_WINDOWS,"Failed to map pages 1\n");
- return FALSE;
- }
-
- /* Kernel mapping */
- if (MempMapRangeOfPages(StartPage * PAGE_SIZE + KSEG0_BASE,
- StartPage * PAGE_SIZE,
- NumberOfPages) != NumberOfPages)
- {
- DPRINTM(DPRINT_WINDOWS,"Failed to map pages 2\n");
- return FALSE;
- }
-
- return TRUE;
-}
-
-VOID
-MempUnmapPage(ULONG Page)
-{
- // DPRINTM(DPRINT_WINDOWS,">>> MempUnmapPage\n");
-}
-
-VOID
-WinLdrpMapApic()
-{
- BOOLEAN LocalAPIC;
- LARGE_INTEGER MsrValue;
- ULONG CpuInfo[4];
- ULONG64 APICAddress;
-
- DPRINTM(DPRINT_WINDOWS,">>> WinLdrpMapApic\n");
-
- /* Check if we have a local APIC */
- __cpuid((int*)CpuInfo, 1);
- LocalAPIC = (((CpuInfo[3] >> 9) & 1) != 0);
-
- /* If there is no APIC, just return */
- if (!LocalAPIC)
- {
- DPRINTM(DPRINT_WINDOWS,"No APIC found.\n");
- return;
- }
-
- /* Read the APIC Address */
- MsrValue.QuadPart = __readmsr(0x1B);
- APICAddress = (MsrValue.LowPart & 0xFFFFF000);
-
- DPRINTM(DPRINT_WINDOWS, "Local APIC detected at address 0x%x\n",
- APICAddress);
-
- /* Map it */
- MempMapSinglePage(APIC_BASE, APICAddress);
-}
-
-BOOLEAN
-WinLdrMapSpecialPages(ULONG PcrBasePage)
-{
- /* Map the PCR page */
- if (!MempMapSinglePage(KIP0PCRADDRESS, PcrBasePage * PAGE_SIZE))
- {
- DPRINTM(DPRINT_WINDOWS, "Could not map PCR @ %lx\n", PcrBasePage);
- return FALSE;
- }
-
- /* Map KI_USER_SHARED_DATA */
- if (!MempMapSinglePage(KI_USER_SHARED_DATA, (PcrBasePage+1) * PAGE_SIZE))
- {
- DPRINTM(DPRINT_WINDOWS, "Could not map KI_USER_SHARED_DATA\n");
- return FALSE;
- }
-
- /* Map the APIC page */
- WinLdrpMapApic();
-
- return TRUE;
-}
-
-VOID
-WinLdrSetupGdt(PVOID GdtBase, ULONG64 TssBase)
-{
- PKGDTENTRY64 Entry;
- KDESCRIPTOR GdtDesc;
-
- /* Setup KGDT64_NULL */
- Entry = KiGetGdtEntry(GdtBase, KGDT64_NULL);
- *(PULONG64)Entry = 0x0000000000000000ULL;
-
- /* Setup KGDT64_R0_CODE */
- Entry = KiGetGdtEntry(GdtBase, KGDT64_R0_CODE);
- *(PULONG64)Entry = 0x00209b0000000000ULL;
-
- /* Setup KGDT64_R0_DATA */
- Entry = KiGetGdtEntry(GdtBase, KGDT64_R0_DATA);
- *(PULONG64)Entry = 0x00cf93000000ffffULL;
-
- /* Setup KGDT64_R3_CMCODE */
- Entry = KiGetGdtEntry(GdtBase, KGDT64_R3_CMCODE);
- *(PULONG64)Entry = 0x00cffb000000ffffULL;
-
- /* Setup KGDT64_R3_DATA */
- Entry = KiGetGdtEntry(GdtBase, KGDT64_R3_DATA);
- *(PULONG64)Entry = 0x00cff3000000ffffULL;
-
- /* Setup KGDT64_R3_CODE */
- Entry = KiGetGdtEntry(GdtBase, KGDT64_R3_CODE);
- *(PULONG64)Entry = 0x0020fb0000000000ULL;
-
- /* Setup KGDT64_R3_CMTEB */
- Entry = KiGetGdtEntry(GdtBase, KGDT64_R3_CMTEB);
- *(PULONG64)Entry = 0xff40f3fd50003c00ULL;
-
- /* Setup TSS entry */
- Entry = KiGetGdtEntry(GdtBase, KGDT64_SYS_TSS);
- KiInitGdtEntry(Entry, TssBase, sizeof(KTSS), I386_TSS, 0);
-
- /* Setup GDT descriptor */
- GdtDesc.Base = GdtBase;
- GdtDesc.Limit = NUM_GDT * sizeof(KGDTENTRY) - 1;
-
- /* Set the new Gdt */
- __lgdt(&GdtDesc.Limit);
- DbgPrint("Gdtr.Base = %p, num = %ld\n", GdtDesc.Base, NUM_GDT);
-
-}
-
-VOID
-WinLdrSetupIdt(PVOID IdtBase)
-{
- KDESCRIPTOR IdtDesc, OldIdt;
-
- /* Get old IDT */
- __sidt(&OldIdt);
-
- /* Copy the old IDT */
- RtlCopyMemory(IdtBase, (PVOID)OldIdt.Base, OldIdt.Limit + 1);
-
- /* Setup the new IDT descriptor */
- IdtDesc.Base = IdtBase;
- IdtDesc.Limit = NUM_IDT * sizeof(KIDTENTRY) - 1;
-
- /* Set the new IDT */
- __lidt(&IdtDesc.Limit);
- DbgPrint("Idtr.Base = %p\n", IdtDesc.Base);
-
-}
-
-VOID
-WinLdrSetProcessorContext(PVOID GdtIdt, IN ULONG64 Pcr, IN ULONG64 Tss)
-{
- DPRINTM(DPRINT_WINDOWS, "WinLdrSetProcessorContext %p\n", Pcr);
-
- /* Disable Interrupts */
- _disable();
-
- /* Re-initalize EFLAGS */
- __writeeflags(0);
-
- /* Set the new PML4 */
- __writecr3((ULONG64)PxeBase);
-
- /* Get kernel mode address of gdt / idt */
- GdtIdt = (PVOID)((ULONG64)GdtIdt + KSEG0_BASE);
-
- /* Create gdt entries and load gdtr */
- WinLdrSetupGdt(GdtIdt, Tss);
-
- /* Copy old Idt and set idtr */
- WinLdrSetupIdt((PVOID)((ULONG64)GdtIdt + 2048)); // HACK!
-
- /* LDT is unused */
-// __lldt(0);
-
- /* Load TSR */
- __ltr(KGDT64_SYS_TSS);
-
- DPRINTM(DPRINT_WINDOWS, "leave WinLdrSetProcessorContext\n");
-}
-
-VOID
-MempDump()
-{
-}
-
Removed: branches/arty-newcc/boot/freeldr/freeldr/windows/arm/wlmemory.c
URL:
http://svn.reactos.org/svn/reactos/branches/arty-newcc/boot/freeldr/freeldr…
==============================================================================
--- branches/arty-newcc/boot/freeldr/freeldr/windows/arm/wlmemory.c [iso-8859-1]
(original)
+++ branches/arty-newcc/boot/freeldr/freeldr/windows/arm/wlmemory.c (removed)
@@ -1,274 +1,0 @@
-/*
- * PROJECT: ReactOS Boot Loader
- * LICENSE: BSD - See COPYING.ARM in the top level directory
- * FILE: boot/freeldr/arch/arm/loader.c
- * PURPOSE: ARM Kernel Loader
- * PROGRAMMERS: ReactOS Portable Systems Group
- */
-
-/* INCLUDES ***************************************************************/
-
-#include <freeldr.h>
-#include <debug.h>
-#include <internal/arm/mm.h>
-#include <internal/arm/intrin_i.h>
-
-#define PFN_SHIFT 12
-#define LARGE_PFN_SHIFT 20
-
-#define PTE_BASE 0xC0000000
-#define PDE_BASE 0xC0400000
-#define PDR_BASE 0xFFD00000
-#define VECTOR_BASE 0xFFFF0000
-
-#ifdef _ZOOM2_
-#define IDMAP_BASE 0x81000000
-#define MMIO_BASE 0x10000000
-#else
-#define IDMAP_BASE 0x00000000
-#define MMIO_BASE 0x10000000
-#endif
-
-#define LowMemPageTableIndex (IDMAP_BASE >> PDE_SHIFT)
-#define MmioPageTableIndex (MMIO_BASE >> PDE_SHIFT)
-#define KernelPageTableIndex (KSEG0_BASE >> PDE_SHIFT)
-#define StartupPtePageTableIndex (PTE_BASE >> PDE_SHIFT)
-#define StartupPdePageTableIndex (PDE_BASE >> PDE_SHIFT)
-#define PdrPageTableIndex (PDR_BASE >> PDE_SHIFT)
-#define VectorPageTableIndex (VECTOR_BASE >> PDE_SHIFT)
-
-#ifndef _ZOOM2_
-PVOID MempPdrBaseAddress = (PVOID)0x70000;
-PVOID MempKernelBaseAddress = (PVOID)0;
-#else
-PVOID MempPdrBaseAddress = (PVOID)0x81100000;
-PVOID MempKernelBaseAddress = (PVOID)0x80000000;
-#endif
-
-/* Converts a Physical Address into a Page Frame Number */
-#define PaToPfn(p) ((p) >> PFN_SHIFT)
-#define PaToLargePfn(p) ((p) >> LARGE_PFN_SHIFT)
-#define PaPtrToPfn(p) (((ULONG_PTR)(p)) >> PFN_SHIFT)
-
-/* Converts a Physical Address into a Coarse Page Table PFN */
-#define PaPtrToPdePfn(p) (((ULONG_PTR)(p)) >> CPT_SHIFT)
-
-typedef struct _KPDR_PAGE
-{
- PAGE_DIRECTORY_ARM PageDir; // 0xC0400000 [0xFFD00000]
- CHAR HyperSpace[233 * PAGE_SIZE]; // 0xC0404000 [0xFFD04000]
- PAGE_TABLE_ARM KernelPageTable[3]; // 0xC04ED000 [0xFFDED000]
- CHAR SharedData[PAGE_SIZE]; // 0xC04F0000 [0xFFDF0000]
- CHAR KernelStack[KERNEL_STACK_SIZE]; // 0xC04F1000 [0xFFDF1000]
- CHAR PanicStack[KERNEL_STACK_SIZE]; // 0xC04F4000 [0xFFDF4000]
- CHAR InterruptStack[KERNEL_STACK_SIZE]; // 0xC04F7000 [0xFFDF7000]
- CHAR InitialProcess[PAGE_SIZE]; // 0xC04FA000 [0xFFDFA000]
- CHAR InitialThread[PAGE_SIZE]; // 0xC04FB000 [0xFFDFB000]
- CHAR Prcb[PAGE_SIZE]; // 0xC04FC000 [0xFFDFC000]
- PAGE_TABLE_ARM PageDirPageTable; // 0xC04FD000 [0xFFDFD000]
- PAGE_TABLE_ARM VectorPageTable; // 0xC04FE000 [0xFFDFE000]
- CHAR Pcr[PAGE_SIZE]; // 0xC04FF000 [0xFFDFF000]
-} KPDR_PAGE, *PKPDR_PAGE;
-
-C_ASSERT(sizeof(KPDR_PAGE) == (1 * 1024 * 1024));
-
-HARDWARE_PTE_ARMV6 TempPte;
-HARDWARE_LARGE_PTE_ARMV6 TempLargePte;
-HARDWARE_PDE_ARMV6 TempPde;
-PKPDR_PAGE PdrPage;
-
-/* FUNCTIONS **************************************************************/
-
-BOOLEAN
-MempSetupPaging(IN ULONG StartPage,
- IN ULONG NumberOfPages)
-{
- return TRUE;
-}
-
-VOID
-MempUnmapPage(IN ULONG Page)
-{
- return;
-}
-
-VOID
-MempDump(VOID)
-{
- return;
-}
-
-BOOLEAN
-WinLdrMapSpecialPages(ULONG PcrBasePage)
-{
- ULONG i;
- PHARDWARE_PTE_ARMV6 PointerPte;
- PHARDWARE_PDE_ARMV6 PointerPde;
- PHARDWARE_LARGE_PTE_ARMV6 LargePte;
- PFN_NUMBER Pfn;
-
- /* Setup the Startup PDE */
- LargePte = &PdrPage->PageDir.Pte[StartupPdePageTableIndex];
- TempLargePte.PageFrameNumber = PaToLargePfn((ULONG_PTR)&PdrPage->PageDir);
- *LargePte = TempLargePte;
-
- /* Map-in the PDR */
- LargePte = &PdrPage->PageDir.Pte[PdrPageTableIndex];
- *LargePte = TempLargePte;
-
- /* After this point, any MiAddressToPde is guaranteed not to fault */
-
- /*
- * Link them in the Startup PDE.
- * Note these are the entries in the PD at (MiAddressToPde(PTE_BASE)).
- */
- PointerPde = &PdrPage->PageDir.Pde[StartupPtePageTableIndex];
- Pfn = PaPtrToPdePfn(&PdrPage->PageDirPageTable);
- for (i = 0; i < 4; i++)
- {
- TempPde.PageFrameNumber = Pfn++;
- *PointerPde++ = TempPde;
- }
-
- /*
- * Now map these page tables in PTE space (MiAddressToPte(PTE_BASE)).
- * Note that they all live on a single page, since each is 1KB.
- */
- PointerPte = &PdrPage->PageDirPageTable.Pte[0x300];
- TempPte.PageFrameNumber = PaPtrToPfn(&PdrPage->PageDirPageTable);
- *PointerPte = TempPte;
-
- /*
- * After this point, MiAddressToPte((PDE_BASE) to MiAddressToPte(PDE_TOP))
- * is guaranteed not to fault.
- * Any subsequent page allocation will first need its page table created
- * and mapped in the PTE_BASE first, then the page table itself will be
- * editable through its flat PTE address.
- */
-
- /* Setup the Vector PDE */
- PointerPde = &PdrPage->PageDir.Pde[VectorPageTableIndex];
- TempPde.PageFrameNumber = PaPtrToPdePfn(&PdrPage->VectorPageTable);
- *PointerPde = TempPde;
-
- /* Setup the Vector PTEs */
- PointerPte = &PdrPage->VectorPageTable.Pte[0xF0];
- TempPte.PageFrameNumber = 0;
- *PointerPte = TempPte;
-
- /* TODO: Map in the kernel CPTs */
- return TRUE;
-}
-
-VOID
-WinLdrSetupForNt(IN PLOADER_PARAMETER_BLOCK LoaderBlock,
- IN PVOID *GdtIdt,
- IN ULONG *PcrBasePage,
- IN ULONG *TssBasePage)
-{
- PKPDR_PAGE PdrPage = (PVOID)0xFFD00000;
-
- /* Load cache information */
- LoaderBlock->u.Arm.FirstLevelDcacheSize = FirstLevelDcacheSize;
- LoaderBlock->u.Arm.FirstLevelDcacheFillSize = FirstLevelDcacheFillSize;
- LoaderBlock->u.Arm.FirstLevelIcacheSize = FirstLevelIcacheSize;
- LoaderBlock->u.Arm.FirstLevelIcacheFillSize = FirstLevelIcacheFillSize;
- LoaderBlock->u.Arm.SecondLevelDcacheSize = SecondLevelDcacheSize;
- LoaderBlock->u.Arm.SecondLevelDcacheFillSize = SecondLevelDcacheFillSize;
- LoaderBlock->u.Arm.SecondLevelIcacheSize = SecondLevelIcacheSize;
- LoaderBlock->u.Arm.SecondLevelIcacheFillSize = SecondLevelIcacheSize;
-
- /* Write initial context information */
- LoaderBlock->KernelStack = (ULONG_PTR)PdrPage->KernelStack;
- LoaderBlock->KernelStack += KERNEL_STACK_SIZE;
- LoaderBlock->u.Arm.PanicStack = (ULONG_PTR)PdrPage->PanicStack;
- LoaderBlock->u.Arm.PanicStack += KERNEL_STACK_SIZE;
- LoaderBlock->u.Arm.InterruptStack = (ULONG_PTR)PdrPage->InterruptStack;
- LoaderBlock->u.Arm.InterruptStack += KERNEL_STACK_SIZE;
- LoaderBlock->Prcb = (ULONG_PTR)PdrPage->Prcb;
- LoaderBlock->Process = (ULONG_PTR)PdrPage->InitialProcess;
- LoaderBlock->Thread = (ULONG_PTR)PdrPage->InitialThread;
-}
-
-BOOLEAN
-MempAllocatePageTables(VOID)
-{
- ULONG i;
- PHARDWARE_PTE_ARMV6 PointerPte;
- PHARDWARE_PDE_ARMV6 PointerPde;
- PHARDWARE_LARGE_PTE_ARMV6 LargePte;
- PFN_NUMBER Pfn;
-
- /* Setup templates */
- TempPte.Sbo = TempPte.Valid = TempLargePte.LargePage = TempLargePte.Sbo =
TempPde.Valid = 1;
-
- /* Allocate the 1MB "PDR" (Processor Data Region). Must be 1MB aligned */
- PdrPage = MmAllocateMemoryAtAddress(sizeof(KPDR_PAGE),
- MempPdrBaseAddress,
- LoaderMemoryData);
-
- /* Setup the Low Memory PDE as an identity-mapped Large Page (1MB) */
- LargePte = &PdrPage->PageDir.Pte[LowMemPageTableIndex];
- TempLargePte.PageFrameNumber = PaToLargePfn(IDMAP_BASE);
- *LargePte = TempLargePte;
-
- /* Setup the MMIO PDE as two identity mapped large pages -- the kernel will blow
these away later */
- LargePte = &PdrPage->PageDir.Pte[MmioPageTableIndex];
- Pfn = PaToLargePfn(MMIO_BASE);
- for (i = 0; i < 2; i++)
- {
- TempLargePte.PageFrameNumber = Pfn++;
- *LargePte++ = TempLargePte;
- }
-
- /* Setup the Kernel PDEs */
- PointerPde = &PdrPage->PageDir.Pde[KernelPageTableIndex];
- Pfn = PaPtrToPdePfn(PdrPage->KernelPageTable);
- for (i = 0; i < 12; i++)
- {
- TempPde.PageFrameNumber = Pfn;
- *PointerPde++ = TempPde;
- Pfn++;
- }
-
- /* Setup the Kernel PTEs */
- PointerPte = PdrPage->KernelPageTable[0].Pte;
- Pfn = PaPtrToPfn(MempKernelBaseAddress);
- for (i = 0; i < 3072; i++)
- {
- TempPte.PageFrameNumber = Pfn++;
- *PointerPte++ = TempPte;
- }
-
- /* Done */
- return TRUE;
-}
-
-VOID
-WinLdrSetProcessorContext(PVOID GdtIdt,
- IN ULONG Pcr,
- IN ULONG Tss)
-{
- ARM_CONTROL_REGISTER ControlRegister;
- ARM_TTB_REGISTER TtbRegister;
- ARM_DOMAIN_REGISTER DomainRegister;
-
- /* Set the TTBR */
- TtbRegister.AsUlong = (ULONG_PTR)&PdrPage->PageDir;
- ASSERT(TtbRegister.Reserved == 0);
- KeArmTranslationTableRegisterSet(TtbRegister);
-
- /* Disable domains and simply use access bits on PTEs */
- DomainRegister.AsUlong = 0;
- DomainRegister.Domain0 = ClientDomain;
- KeArmDomainRegisterSet(DomainRegister);
-
- /* Enable ARMv6+ paging (MMU), caches and the access bit */
- ControlRegister = KeArmControlRegisterGet();
- ControlRegister.MmuEnabled = TRUE;
- ControlRegister.ICacheEnabled = TRUE;
- ControlRegister.DCacheEnabled = TRUE;
- ControlRegister.ForceAp = TRUE;
- ControlRegister.ExtendedPageTables = TRUE;
- KeArmControlRegisterSet(ControlRegister);
-}
Removed: branches/arty-newcc/boot/freeldr/freeldr/windows/i386/ntsetup.c
URL:
http://svn.reactos.org/svn/reactos/branches/arty-newcc/boot/freeldr/freeldr…
==============================================================================
--- branches/arty-newcc/boot/freeldr/freeldr/windows/i386/ntsetup.c [iso-8859-1]
(original)
+++ branches/arty-newcc/boot/freeldr/freeldr/windows/i386/ntsetup.c (removed)
@@ -1,83 +1,0 @@
-/*
- * PROJECT: EFI Windows Loader
- * LICENSE: GPL - See COPYING in the top level directory
- * FILE: freeldr/windows/i386/ntsetup.c
- * PURPOSE: i386-specific setup for Windows boot
- * PROGRAMMERS: Aleksey Bragin (aleksey(a)reactos.org)
- */
-
-/* INCLUDES ***************************************************************/
-
-#include <freeldr.h>
-#include <debug.h>
-
-// this is needed for new IDT filling
-#if 0
-extern ULONG_PTR i386DivideByZero;
-extern ULONG_PTR i386DebugException;
-extern ULONG_PTR i386NMIException;
-extern ULONG_PTR i386Breakpoint;
-extern ULONG_PTR i386Overflow;
-extern ULONG_PTR i386BoundException;
-extern ULONG_PTR i386InvalidOpcode;
-extern ULONG_PTR i386FPUNotAvailable;
-extern ULONG_PTR i386DoubleFault;
-extern ULONG_PTR i386CoprocessorSegment;
-extern ULONG_PTR i386InvalidTSS;
-extern ULONG_PTR i386SegmentNotPresent;
-extern ULONG_PTR i386StackException;
-extern ULONG_PTR i386GeneralProtectionFault;
-extern ULONG_PTR i386PageFault; // exc 14
-extern ULONG_PTR i386CoprocessorError; // exc 16
-extern ULONG_PTR i386AlignmentCheck; // exc 17
-#endif
-
-/* FUNCTIONS **************************************************************/
-
-// Last step before going virtual
-void WinLdrSetupForNt(PLOADER_PARAMETER_BLOCK LoaderBlock,
- PVOID *GdtIdt,
- ULONG *PcrBasePage,
- ULONG *TssBasePage)
-{
- ULONG TssSize;
- //ULONG TssPages;
- ULONG_PTR Pcr = 0;
- ULONG_PTR Tss = 0;
- ULONG BlockSize, NumPages;
-
- LoaderBlock->u.I386.CommonDataArea = NULL; // Force No ABIOS support
- LoaderBlock->u.I386.MachineType = MACHINE_TYPE_ISA;
-
- /* Allocate 2 pages for PCR */
- Pcr = (ULONG_PTR)MmAllocateMemoryWithType(2 * MM_PAGE_SIZE, LoaderStartupPcrPage);
- *PcrBasePage = Pcr >> MM_PAGE_SHIFT;
-
- if (Pcr == 0)
- {
- UiMessageBox("Can't allocate PCR\n");
- return;
- }
-
- /* Allocate TSS */
- TssSize = (sizeof(KTSS) + MM_PAGE_SIZE) & ~(MM_PAGE_SIZE - 1);
- //TssPages = TssSize / MM_PAGE_SIZE;
-
- Tss = (ULONG_PTR)MmAllocateMemoryWithType(TssSize, LoaderMemoryData);
-
- *TssBasePage = Tss >> MM_PAGE_SHIFT;
-
- /* Allocate space for new GDT + IDT */
- BlockSize = NUM_GDT*sizeof(KGDTENTRY) + NUM_IDT*sizeof(KIDTENTRY);//FIXME: Use GDT/IDT
limits here?
- NumPages = (BlockSize + MM_PAGE_SIZE - 1) >> MM_PAGE_SHIFT;
- *GdtIdt = (PKGDTENTRY)MmAllocateMemoryWithType(NumPages * MM_PAGE_SIZE,
LoaderMemoryData);
-
- if (*GdtIdt == NULL)
- {
- UiMessageBox("Can't allocate pages for GDT+IDT!\n");
- return;
- }
-
- /* Zero newly prepared GDT+IDT */
- RtlZeroMemory(*GdtIdt, NumPages << MM_PAGE_SHIFT);
-}
Removed: branches/arty-newcc/boot/freeldr/freeldr/windows/i386/wlmemory.c
URL:
http://svn.reactos.org/svn/reactos/branches/arty-newcc/boot/freeldr/freeldr…
==============================================================================
--- branches/arty-newcc/boot/freeldr/freeldr/windows/i386/wlmemory.c [iso-8859-1]
(original)
+++ branches/arty-newcc/boot/freeldr/freeldr/windows/i386/wlmemory.c (removed)
@@ -1,553 +1,0 @@
-/*
- * PROJECT: EFI Windows Loader
- * LICENSE: GPL - See COPYING in the top level directory
- * FILE: freeldr/winldr/i386/wlmemory.c
- * PURPOSE: Memory related routines
- * PROGRAMMERS: Aleksey Bragin (aleksey(a)reactos.org)
- */
-
-/* INCLUDES ***************************************************************/
-
-#include <freeldr.h>
-
-#include <ndk/asm.h>
-#include <debug.h>
-
-extern ULONG TotalNLSSize;
-extern ULONG LoaderPagesSpanned;
-
-// This is needed because headers define wrong one for ReactOS
-#undef KIP0PCRADDRESS
-#define KIP0PCRADDRESS 0xffdff000
-
-#define HYPER_SPACE_ENTRY 0x300
-
-// This is needed only for SetProcessorContext routine
-#pragma pack(2)
- typedef struct
- {
- USHORT Limit;
- ULONG Base;
- } GDTIDT;
-#pragma pack(4)
-
-/* GLOBALS ***************************************************************/
-
-PHARDWARE_PTE PDE;
-PHARDWARE_PTE HalPageTable;
-
-PUCHAR PhysicalPageTablesBuffer;
-PUCHAR KernelPageTablesBuffer;
-ULONG PhysicalPageTables;
-ULONG KernelPageTables;
-
-/* FUNCTIONS **************************************************************/
-
-BOOLEAN
-MempAllocatePageTables()
-{
- ULONG NumPageTables, TotalSize;
- PUCHAR Buffer;
- // It's better to allocate PDE + PTEs contigiuos
-
- // Max number of entries = MaxPageNum >> 10
- // FIXME: This is a number to describe ALL physical memory
- // and windows doesn't expect ALL memory mapped...
- NumPageTables = TotalPagesInLookupTable >> 10;
-
- DPRINTM(DPRINT_WINDOWS, "NumPageTables = %d\n", NumPageTables);
-
- // Allocate memory block for all these things:
- // PDE, HAL mapping page table, physical mapping, kernel mapping
- TotalSize = (1 + 1 + NumPageTables * 2) * MM_PAGE_SIZE;
-
- // PDE+HAL+KernelPTEs == MemoryData
- Buffer = MmAllocateMemoryWithType(TotalSize, LoaderMemoryData);
-
- // Physical PTEs = FirmwareTemporary
- PhysicalPageTablesBuffer = (PUCHAR)Buffer + TotalSize - NumPageTables*MM_PAGE_SIZE;
- MmSetMemoryType(PhysicalPageTablesBuffer,
- NumPageTables*MM_PAGE_SIZE,
- LoaderFirmwareTemporary);
-
- // This check is now redundant
- if (Buffer + (TotalSize - NumPageTables*MM_PAGE_SIZE) !=
- PhysicalPageTablesBuffer)
- {
- DPRINTM(DPRINT_WINDOWS, "There was a problem allocating two adjacent blocks of
memory!");
- }
-
- if (Buffer == NULL || PhysicalPageTablesBuffer == NULL)
- {
- UiMessageBox("Impossible to allocate memory block for page tables!");
- return FALSE;
- }
-
- // Zero all this memory block
- RtlZeroMemory(Buffer, TotalSize);
-
- // Set up pointers correctly now
- PDE = (PHARDWARE_PTE)Buffer;
-
- // Map the page directory at 0xC0000000 (maps itself)
- PDE[HYPER_SPACE_ENTRY].PageFrameNumber = (ULONG)PDE >> MM_PAGE_SHIFT;
- PDE[HYPER_SPACE_ENTRY].Valid = 1;
- PDE[HYPER_SPACE_ENTRY].Write = 1;
-
- // The last PDE slot is allocated for HAL's memory mapping (Virtual Addresses
0xFFC00000 - 0xFFFFFFFF)
- HalPageTable = (PHARDWARE_PTE)&Buffer[MM_PAGE_SIZE*1];
-
- // Map it
- PDE[1023].PageFrameNumber = (ULONG)HalPageTable >> MM_PAGE_SHIFT;
- PDE[1023].Valid = 1;
- PDE[1023].Write = 1;
-
- // Store pointer to the table for easier access
- KernelPageTablesBuffer = &Buffer[MM_PAGE_SIZE*2];
-
- // Zero counters of page tables used
- PhysicalPageTables = 0;
- KernelPageTables = 0;
-
- return TRUE;
-}
-
-VOID
-MempAllocatePTE(ULONG Entry, PHARDWARE_PTE *PhysicalPT, PHARDWARE_PTE *KernelPT)
-{
- //Print(L"Creating PDE Entry %X\n", Entry);
-
- // Identity mapping
- *PhysicalPT =
(PHARDWARE_PTE)&PhysicalPageTablesBuffer[PhysicalPageTables*MM_PAGE_SIZE];
- PhysicalPageTables++;
-
- PDE[Entry].PageFrameNumber = (ULONG)*PhysicalPT >> MM_PAGE_SHIFT;
- PDE[Entry].Valid = 1;
- PDE[Entry].Write = 1;
-
- if (Entry+(KSEG0_BASE >> 22) > 1023)
- {
- DPRINTM(DPRINT_WINDOWS, "WARNING! Entry: %X > 1023\n", Entry+(KSEG0_BASE
>> 22));
- }
-
- // Kernel-mode mapping
- *KernelPT = (PHARDWARE_PTE)&KernelPageTablesBuffer[KernelPageTables*MM_PAGE_SIZE];
- KernelPageTables++;
-
- PDE[Entry+(KSEG0_BASE >> 22)].PageFrameNumber = ((ULONG)*KernelPT >>
MM_PAGE_SHIFT);
- PDE[Entry+(KSEG0_BASE >> 22)].Valid = 1;
- PDE[Entry+(KSEG0_BASE >> 22)].Write = 1;
-}
-
-BOOLEAN
-MempSetupPaging(IN ULONG StartPage,
- IN ULONG NumberOfPages)
-{
- PHARDWARE_PTE PhysicalPT;
- PHARDWARE_PTE KernelPT;
- ULONG Entry, Page;
-
- //Print(L"MempSetupPaging: SP 0x%X, Number: 0x%X\n", StartPage,
NumberOfPages);
-
- // HACK
- if (StartPage+NumberOfPages >= 0x80000)
- {
- //
- // We can't map this as it requires more than 1 PDE
- // and in fact it's not possible at all ;)
- //
- //Print(L"skipping...\n");
- return TRUE;
- }
-
- //
- // Now actually set up the page tables for identity mapping
- //
- for (Page = StartPage; Page < StartPage + NumberOfPages; Page++)
- {
- Entry = Page >> 10;
-
- if (((PULONG)PDE)[Entry] == 0)
- {
- MempAllocatePTE(Entry, &PhysicalPT, &KernelPT);
- }
- else
- {
- PhysicalPT = (PHARDWARE_PTE)(PDE[Entry].PageFrameNumber << MM_PAGE_SHIFT);
- KernelPT = (PHARDWARE_PTE)(PDE[Entry+(KSEG0_BASE >> 22)].PageFrameNumber
<< MM_PAGE_SHIFT);
- }
-
- PhysicalPT[Page & 0x3ff].PageFrameNumber = Page;
- PhysicalPT[Page & 0x3ff].Valid = (Page != 0);
- PhysicalPT[Page & 0x3ff].Write = (Page != 0);
-
- KernelPT[Page & 0x3ff].PageFrameNumber = Page;
- KernelPT[Page & 0x3ff].Valid = (Page != 0);
- KernelPT[Page & 0x3ff].Write = (Page != 0);
- }
-
- return TRUE;
-}
-
-VOID
-MempUnmapPage(ULONG Page)
-{
- PHARDWARE_PTE KernelPT;
- ULONG Entry = (Page >> 10) + (KSEG0_BASE >> 22);
-
- /* Don't unmap hyperspace or HAL entries */
- if (Entry == HYPER_SPACE_ENTRY || Entry == 1023)
- return;
-
- if (PDE[Entry].Valid)
- {
- KernelPT = (PHARDWARE_PTE)(PDE[Entry].PageFrameNumber << MM_PAGE_SHIFT);
-
- if (KernelPT)
- {
- KernelPT[Page & 0x3ff].PageFrameNumber = 0;
- KernelPT[Page & 0x3ff].Valid = 0;
- KernelPT[Page & 0x3ff].Write = 0;
- }
- }
-}
-
-VOID
-WinLdrpMapApic()
-{
- BOOLEAN LocalAPIC;
- LARGE_INTEGER MsrValue;
- ULONG APICAddress, CpuInfo[4];
-
- /* Check if we have a local APIC */
- __cpuid((int*)CpuInfo, 1);
- LocalAPIC = (((CpuInfo[3] >> 9) & 1) != 0);
-
- /* If there is no APIC, just return */
- if (!LocalAPIC)
- return;
-
- /* Read the APIC Address */
- MsrValue.QuadPart = __readmsr(0x1B);
- APICAddress = (MsrValue.LowPart & 0xFFFFF000);
-
- DPRINTM(DPRINT_WINDOWS, "Local APIC detected at address 0x%x\n",
- APICAddress);
-
- /* Map it */
- HalPageTable[(APIC_BASE - 0xFFC00000) >> MM_PAGE_SHIFT].PageFrameNumber
- = APICAddress >> MM_PAGE_SHIFT;
- HalPageTable[(APIC_BASE - 0xFFC00000) >> MM_PAGE_SHIFT].Valid = 1;
- HalPageTable[(APIC_BASE - 0xFFC00000) >> MM_PAGE_SHIFT].Write = 1;
- HalPageTable[(APIC_BASE - 0xFFC00000) >> MM_PAGE_SHIFT].WriteThrough = 1;
- HalPageTable[(APIC_BASE - 0xFFC00000) >> MM_PAGE_SHIFT].CacheDisable = 1;
-}
-
-BOOLEAN
-WinLdrMapSpecialPages(ULONG PcrBasePage)
-{
-
- //VideoDisplayString(L"Hello from VGA, going into the kernel\n");
- DPRINTM(DPRINT_WINDOWS, "HalPageTable: 0x%X\n", HalPageTable);
-
- // Page Tables have been setup, make special handling for PCR and TSS
- // (which is done in BlSetupFotNt in usual ntldr)
- HalPageTable[(KI_USER_SHARED_DATA - 0xFFC00000) >> MM_PAGE_SHIFT].PageFrameNumber
= PcrBasePage+1;
- HalPageTable[(KI_USER_SHARED_DATA - 0xFFC00000) >> MM_PAGE_SHIFT].Valid = 1;
- HalPageTable[(KI_USER_SHARED_DATA - 0xFFC00000) >> MM_PAGE_SHIFT].Write = 1;
-
- HalPageTable[(KIP0PCRADDRESS - 0xFFC00000) >> MM_PAGE_SHIFT].PageFrameNumber =
PcrBasePage;
- HalPageTable[(KIP0PCRADDRESS - 0xFFC00000) >> MM_PAGE_SHIFT].Valid = 1;
- HalPageTable[(KIP0PCRADDRESS - 0xFFC00000) >> MM_PAGE_SHIFT].Write = 1;
-
- // Map APIC
- WinLdrpMapApic();
-
- // Map VGA memory
- //VideoMemoryBase = MmMapIoSpace(0xb8000, 4000, MmNonCached);
- //DPRINTM(DPRINT_WINDOWS, "VideoMemoryBase: 0x%X\n", VideoMemoryBase);
-
- return TRUE;
-}
-
-
-VOID
-WinLdrSetProcessorContext(PVOID GdtIdt, IN ULONG Pcr, IN ULONG Tss)
-{
- GDTIDT GdtDesc, IdtDesc, OldIdt;
- PKGDTENTRY pGdt;
- PKIDTENTRY pIdt;
- USHORT Ldt = 0;
- //ULONG i;
-
- DPRINTM(DPRINT_WINDOWS, "GDtIdt %p, Pcr %p, Tss 0x%08X\n",
- GdtIdt, Pcr, Tss);
-
- // Enable paging
- //BS->ExitBootServices(ImageHandle,MapKey);
-
- // Disable Interrupts
- _disable();
-
- // Re-initalize EFLAGS
- __writeeflags(0);
-
- // Set the PDBR
- __writecr3((ULONG_PTR)PDE);
-
- // Enable paging by modifying CR0
- __writecr0(__readcr0() | CR0_PG);
-
- // Kernel expects the PCR to be zero-filled on startup
- // FIXME: Why zero it here when we can zero it right after allocation?
- RtlZeroMemory((PVOID)Pcr, MM_PAGE_SIZE); //FIXME: Why zero only 1 page when we allocate
2?
-
- // Get old values of GDT and IDT
- Ke386GetGlobalDescriptorTable(&GdtDesc);
- __sidt(&IdtDesc);
-
- // Save old IDT
- OldIdt.Base = IdtDesc.Base;
- OldIdt.Limit = IdtDesc.Limit;
-
- // Prepare new IDT+GDT
- GdtDesc.Base = KSEG0_BASE | (ULONG_PTR)GdtIdt;
- GdtDesc.Limit = NUM_GDT * sizeof(KGDTENTRY) - 1;
- IdtDesc.Base = (ULONG)((PUCHAR)GdtDesc.Base + GdtDesc.Limit + 1);
- IdtDesc.Limit = NUM_IDT * sizeof(KIDTENTRY) - 1;
-
- // ========================
- // Fill all descriptors now
- // ========================
-
- pGdt = (PKGDTENTRY)GdtDesc.Base;
- pIdt = (PKIDTENTRY)IdtDesc.Base;
-
- //
- // Code selector (0x8)
- // Flat 4Gb
- //
- pGdt[1].LimitLow = 0xFFFF;
- pGdt[1].BaseLow = 0;
- pGdt[1].HighWord.Bytes.BaseMid = 0;
- pGdt[1].HighWord.Bytes.Flags1 = 0x9A;
- pGdt[1].HighWord.Bytes.Flags2 = 0xCF;
- pGdt[1].HighWord.Bytes.BaseHi = 0;
-
- //
- // Data selector (0x10)
- // Flat 4Gb
- //
- pGdt[2].LimitLow = 0xFFFF;
- pGdt[2].BaseLow = 0;
- pGdt[2].HighWord.Bytes.BaseMid = 0;
- pGdt[2].HighWord.Bytes.Flags1 = 0x92;
- pGdt[2].HighWord.Bytes.Flags2 = 0xCF;
- pGdt[2].HighWord.Bytes.BaseHi = 0;
-
- //
- // Selector (0x18)
- // Flat 2Gb
- //
- pGdt[3].LimitLow = 0xFFFF;
- pGdt[3].BaseLow = 0;
- pGdt[3].HighWord.Bytes.BaseMid = 0;
- pGdt[3].HighWord.Bytes.Flags1 = 0xFA;
- pGdt[3].HighWord.Bytes.Flags2 = 0xCF;
- pGdt[3].HighWord.Bytes.BaseHi = 0;
-
- //
- // Selector (0x20)
- // Flat 2Gb
- //
- pGdt[4].LimitLow = 0xFFFF;
- pGdt[4].BaseLow = 0;
- pGdt[4].HighWord.Bytes.BaseMid = 0;
- pGdt[4].HighWord.Bytes.Flags1 = 0xF2;
- pGdt[4].HighWord.Bytes.Flags2 = 0xCF;
- pGdt[4].HighWord.Bytes.BaseHi = 0;
-
- //
- // TSS Selector (0x28)
- //
- pGdt[5].LimitLow = 0x78-1; //FIXME: Check this
- pGdt[5].BaseLow = (USHORT)(Tss & 0xffff);
- pGdt[5].HighWord.Bytes.BaseMid = (UCHAR)((Tss >> 16) & 0xff);
- pGdt[5].HighWord.Bytes.Flags1 = 0x89;
- pGdt[5].HighWord.Bytes.Flags2 = 0x00;
- pGdt[5].HighWord.Bytes.BaseHi = (UCHAR)((Tss >> 24) & 0xff);
-
- //
- // PCR Selector (0x30)
- //
- pGdt[6].LimitLow = 0x01;
- pGdt[6].BaseLow = (USHORT)(Pcr & 0xffff);
- pGdt[6].HighWord.Bytes.BaseMid = (UCHAR)((Pcr >> 16) & 0xff);
- pGdt[6].HighWord.Bytes.Flags1 = 0x92;
- pGdt[6].HighWord.Bytes.Flags2 = 0xC0;
- pGdt[6].HighWord.Bytes.BaseHi = (UCHAR)((Pcr >> 24) & 0xff);
-
- //
- // Selector (0x38)
- //
- pGdt[7].LimitLow = 0xFFFF;
- pGdt[7].BaseLow = 0;
- pGdt[7].HighWord.Bytes.BaseMid = 0;
- pGdt[7].HighWord.Bytes.Flags1 = 0xF3;
- pGdt[7].HighWord.Bytes.Flags2 = 0x40;
- pGdt[7].HighWord.Bytes.BaseHi = 0;
-
- //
- // Some BIOS stuff (0x40)
- //
- pGdt[8].LimitLow = 0xFFFF;
- pGdt[8].BaseLow = 0x400;
- pGdt[8].HighWord.Bytes.BaseMid = 0;
- pGdt[8].HighWord.Bytes.Flags1 = 0xF2;
- pGdt[8].HighWord.Bytes.Flags2 = 0x0;
- pGdt[8].HighWord.Bytes.BaseHi = 0;
-
- //
- // Selector (0x48)
- //
- pGdt[9].LimitLow = 0;
- pGdt[9].BaseLow = 0;
- pGdt[9].HighWord.Bytes.BaseMid = 0;
- pGdt[9].HighWord.Bytes.Flags1 = 0;
- pGdt[9].HighWord.Bytes.Flags2 = 0;
- pGdt[9].HighWord.Bytes.BaseHi = 0;
-
- //
- // Selector (0x50)
- //
- pGdt[10].LimitLow = 0xFFFF; //FIXME: Not correct!
- pGdt[10].BaseLow = 0;
- pGdt[10].HighWord.Bytes.BaseMid = 0x2;
- pGdt[10].HighWord.Bytes.Flags1 = 0x89;
- pGdt[10].HighWord.Bytes.Flags2 = 0;
- pGdt[10].HighWord.Bytes.BaseHi = 0;
-
- //
- // Selector (0x58)
- //
- pGdt[11].LimitLow = 0xFFFF;
- pGdt[11].BaseLow = 0;
- pGdt[11].HighWord.Bytes.BaseMid = 0x2;
- pGdt[11].HighWord.Bytes.Flags1 = 0x9A;
- pGdt[11].HighWord.Bytes.Flags2 = 0;
- pGdt[11].HighWord.Bytes.BaseHi = 0;
-
- //
- // Selector (0x60)
- //
- pGdt[12].LimitLow = 0xFFFF;
- pGdt[12].BaseLow = 0; //FIXME: Maybe not correct, but noone cares
- pGdt[12].HighWord.Bytes.BaseMid = 0x2;
- pGdt[12].HighWord.Bytes.Flags1 = 0x92;
- pGdt[12].HighWord.Bytes.Flags2 = 0;
- pGdt[12].HighWord.Bytes.BaseHi = 0;
-
- //
- // Video buffer Selector (0x68)
- //
- pGdt[13].LimitLow = 0x3FFF;
- pGdt[13].BaseLow = 0x8000;
- pGdt[13].HighWord.Bytes.BaseMid = 0x0B;
- pGdt[13].HighWord.Bytes.Flags1 = 0x92;
- pGdt[13].HighWord.Bytes.Flags2 = 0;
- pGdt[13].HighWord.Bytes.BaseHi = 0;
-
- //
- // Points to GDT (0x70)
- //
- pGdt[14].LimitLow = NUM_GDT*sizeof(KGDTENTRY) - 1;
- pGdt[14].BaseLow = 0x7000;
- pGdt[14].HighWord.Bytes.BaseMid = 0xFF;
- pGdt[14].HighWord.Bytes.Flags1 = 0x92;
- pGdt[14].HighWord.Bytes.Flags2 = 0;
- pGdt[14].HighWord.Bytes.BaseHi = 0xFF;
-
- //
- // Some unused descriptors should go here
- //
-
- // Copy the old IDT
- RtlCopyMemory(pIdt, (PVOID)OldIdt.Base, OldIdt.Limit + 1);
-
- // Mask interrupts
- //asm("cli\n"); // they are already masked before enabling paged mode
-
- // Load GDT+IDT
- Ke386SetGlobalDescriptorTable(&GdtDesc);
- __lidt(&IdtDesc);
-
- // Jump to proper CS and clear prefetch queue
-#if defined(__GNUC__)
- asm("ljmp $0x08, $1f\n"
- "1:\n");
-#elif defined(_MSC_VER)
- /* We can't express the above in MASM so we use this far return instead */
- __asm
- {
- push 8
- push offset resume
- retf
- resume:
- };
-#else
-#error
-#endif
-
- // Set SS selector
- Ke386SetSs(0x10); // DataSelector=0x10
-
- // Set DS and ES selectors
- Ke386SetDs(0x10);
- Ke386SetEs(0x10); // this is vital for rep stosd
-
- // LDT = not used ever, thus set to 0
- Ke386SetLocalDescriptorTable(Ldt);
-
- // Load TSR
- Ke386SetTr(KGDT_TSS);
-
- // Clear GS
- Ke386SetGs(0);
-
- // Set FS to PCR
- Ke386SetFs(0x30);
-
- // Real end of the function, just for information
- /* do not uncomment!
- pop edi;
- pop esi;
- pop ebx;
- mov esp, ebp;
- pop ebp;
- ret
- */
-}
-
-#if DBG
-VOID
-MempDump()
-{
- ULONG *PDE_Addr=(ULONG *)PDE;//0xC0300000;
- int i, j;
-
- DPRINTM(DPRINT_WINDOWS, "\nPDE\n");
-
- for (i=0; i<128; i++)
- {
- DPRINTM(DPRINT_WINDOWS, "0x%04X | ", i*8);
-
- for (j=0; j<8; j++)
- {
- DPRINTM(DPRINT_WINDOWS, "0x%08X ", PDE_Addr[i*8+j]);
- }
-
- DPRINTM(DPRINT_WINDOWS, "\n");
- }
-}
-#endif
-
Removed: branches/arty-newcc/boot/freeldr/freeldr/windows/setupldr2.c
URL:
http://svn.reactos.org/svn/reactos/branches/arty-newcc/boot/freeldr/freeldr…
==============================================================================
--- branches/arty-newcc/boot/freeldr/freeldr/windows/setupldr2.c [iso-8859-1] (original)
+++ branches/arty-newcc/boot/freeldr/freeldr/windows/setupldr2.c (removed)
@@ -1,373 +1,0 @@
-/*
- * FreeLoader
- *
- * Copyright (C) 2009 Aleksey Bragin <aleksey(a)reactos.org>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- */
-
-#include <freeldr.h>
-
-#include <ndk/ldrtypes.h>
-#include <arc/setupblk.h>
-
-#include <debug.h>
-
-// TODO: Move to .h
-VOID AllocateAndInitLPB(PLOADER_PARAMETER_BLOCK *OutLoaderBlock);
-BOOLEAN WinLdrLoadBootDrivers(PLOADER_PARAMETER_BLOCK LoaderBlock, LPSTR BootPath);
-void WinLdrSetupForNt(PLOADER_PARAMETER_BLOCK LoaderBlock,
- PVOID *GdtIdt,
- ULONG *PcrBasePage,
- ULONG *TssBasePage);
-VOID
-WinLdrInitializePhase1(PLOADER_PARAMETER_BLOCK LoaderBlock,
- PCHAR Options,
- PCHAR SystemPath,
- PCHAR BootPath,
- USHORT VersionToBoot);
-BOOLEAN
-WinLdrLoadNLSData(IN OUT PLOADER_PARAMETER_BLOCK LoaderBlock,
- IN LPCSTR DirectoryPath,
- IN LPCSTR AnsiFileName,
- IN LPCSTR OemFileName,
- IN LPCSTR LanguageFileName);
-BOOLEAN
-WinLdrAddDriverToList(LIST_ENTRY *BootDriverListHead,
- LPWSTR RegistryPath,
- LPWSTR ImagePath,
- LPWSTR ServiceName);
-
-
-//FIXME: Do a better way to retrieve Arc disk information
-extern ULONG reactos_disk_count;
-extern ARC_DISK_SIGNATURE reactos_arc_disk_info[];
-extern char reactos_arc_strings[32][256];
-
-extern BOOLEAN UseRealHeap;
-extern ULONG LoaderPagesSpanned;
-
-
-VOID
-SetupLdrLoadNlsData(PLOADER_PARAMETER_BLOCK LoaderBlock, HINF InfHandle, LPCSTR
SearchPath)
-{
- INFCONTEXT InfContext;
- BOOLEAN Status;
- LPCSTR AnsiName, OemName, LangName;
-
- /* Get ANSI codepage file */
- if (!InfFindFirstLine(InfHandle, "NLS", "AnsiCodepage",
&InfContext))
- {
- printf("Failed to find 'NLS/AnsiCodepage'\n");
- return;
- }
- if (!InfGetDataField(&InfContext, 1, &AnsiName))
- {
- printf("Failed to get load options\n");
- return;
- }
-
- /* Get OEM codepage file */
- if (!InfFindFirstLine(InfHandle, "NLS", "OemCodepage",
&InfContext))
- {
- printf("Failed to find 'NLS/AnsiCodepage'\n");
- return;
- }
- if (!InfGetDataField(&InfContext, 1, &OemName))
- {
- printf("Failed to get load options\n");
- return;
- }
-
- if (!InfFindFirstLine(InfHandle, "NLS", "UnicodeCasetable",
&InfContext))
- {
- printf("Failed to find 'NLS/AnsiCodepage'\n");
- return;
- }
- if (!InfGetDataField(&InfContext, 1, &LangName))
- {
- printf("Failed to get load options\n");
- return;
- }
-
- Status = WinLdrLoadNLSData(LoaderBlock, SearchPath, AnsiName, OemName, LangName);
- DPRINTM(DPRINT_WINDOWS, "NLS data loaded with status %d\n", Status);
-}
-
-VOID
-SetupLdrScanBootDrivers(PLOADER_PARAMETER_BLOCK LoaderBlock, HINF InfHandle, LPCSTR
SearchPath)
-{
- INFCONTEXT InfContext, dirContext;
- BOOLEAN Status;
- LPCSTR Media, DriverName, dirIndex, ImagePath;
- WCHAR ServiceName[256];
- WCHAR ImagePathW[256];
-
- /* Open inf section */
- if (!InfFindFirstLine(InfHandle, "SourceDisksFiles", NULL,
&InfContext))
- return;
-
- /* Load all listed boot drivers */
- do
- {
- if (InfGetDataField(&InfContext, 7, &Media) &&
- InfGetDataField(&InfContext, 0, &DriverName) &&
- InfGetDataField(&InfContext, 13, &dirIndex))
- {
- if ((strcmp(Media, "x") == 0) &&
- InfFindFirstLine(InfHandle, "Directories", dirIndex,
&dirContext) &&
- InfGetDataField(&dirContext, 1, &ImagePath))
- {
- /* Convert name to widechar */
- swprintf(ServiceName, L"%S", DriverName);
-
- /* Prepare image path */
- swprintf(ImagePathW, L"%S", ImagePath);
- wcscat(ImagePathW, L"\\");
- wcscat(ImagePathW, ServiceName);
-
- /* Remove .sys extension */
- ServiceName[wcslen(ServiceName) - 4] = 0;
-
- /* Add it to the list */
- Status = WinLdrAddDriverToList(&LoaderBlock->BootDriverListHead,
-
L"\\Registry\\Machine\\System\\CurrentControlSet\\Services\\",
- ImagePathW,
- ServiceName);
-
- if (!Status)
- {
- DPRINTM(DPRINT_WINDOWS, "could not add boot driver %s,
%s\n", SearchPath, DriverName);
- return;
- }
- }
- }
- } while (InfFindNextLine(&InfContext, &InfContext));
-}
-
-VOID LoadReactOSSetup2(VOID)
-{
- CHAR SystemPath[512], SearchPath[512];
- CHAR FileName[512];
- CHAR BootPath[512];
- LPCSTR LoadOptions, BootOptions;
- BOOLEAN BootFromFloppy;
-#if DBG
- LPCSTR DbgOptions;
-#endif
- PVOID NtosBase = NULL, HalBase = NULL, KdComBase = NULL;
- BOOLEAN Status;
- ULONG i, ErrorLine;
- HINF InfHandle;
- INFCONTEXT InfContext;
- PLOADER_PARAMETER_BLOCK LoaderBlock, LoaderBlockVA;
- PSETUP_LOADER_BLOCK SetupBlock;
- KERNEL_ENTRY_POINT KiSystemStartup;
- PLDR_DATA_TABLE_ENTRY KernelDTE, HalDTE, KdComDTE = NULL;
- // Mm-related things
- PVOID GdtIdt;
- ULONG PcrBasePage=0;
- ULONG TssBasePage=0;
- LPCSTR SourcePath;
- LPCSTR SourcePaths[] =
- {
- "", /* Only for floppy boot */
-#if defined(_M_IX86)
- "\\I386",
-#elif defined(_M_MPPC)
- "\\PPC",
-#elif defined(_M_MRX000)
- "\\MIPS",
-#endif
- "\\reactos",
- NULL
- };
-
- /* Get boot path */
- MachDiskGetBootPath(SystemPath, sizeof(SystemPath));
-
- /* And check if we booted from floppy */
- BootFromFloppy = strstr(SystemPath, "fdisk") != NULL;
-
- /* Open 'txtsetup.sif' from any of source paths */
- for (i = BootFromFloppy ? 0 : 1; ; i++)
- {
- SourcePath = SourcePaths[i];
- if (!SourcePath)
- {
- printf("Failed to open 'txtsetup.sif'\n");
- return;
- }
- sprintf(FileName, "%s\\txtsetup.sif", SourcePath);
- if (InfOpenFile (&InfHandle, FileName, &ErrorLine))
- {
- sprintf(BootPath, "%s%s\\", SystemPath, SourcePath);
- break;
- }
- }
-
- /* Get Load options - debug and non-debug */
- if (!InfFindFirstLine(InfHandle,
- "SetupData",
- "OsLoadOptions",
- &InfContext))
- {
- printf("Failed to find 'SetupData/OsLoadOptions'\n");
- return;
- }
-
- if (!InfGetDataField (&InfContext, 1, &LoadOptions))
- {
- printf("Failed to get load options\n");
- return;
- }
-
- BootOptions = LoadOptions;
-
-#if DBG
- /* Get debug load options and use them */
- if (InfFindFirstLine(InfHandle,
- "SetupData",
- "DbgOsLoadOptions",
- &InfContext))
- {
- if (!InfGetDataField(&InfContext, 1, &DbgOptions))
- DbgOptions = "";
- else
- BootOptions = DbgOptions;
- }
-#endif
-
- DPRINTM(DPRINT_WINDOWS,"BootOptions: '%s'\n", BootOptions);
-
- SetupUiInitialize();
- UiDrawStatusText("");
- UiDrawStatusText("Detecting Hardware...");
-
- /* Let user know we started loading */
- UiDrawStatusText("Loading...");
-
- /* Construct the system path */
- sprintf(SystemPath, "%s\\", SourcePath);
-
- DPRINTM(DPRINT_WINDOWS,"BootPath: '%s', SystemPath:
'%s'\n", BootPath, SystemPath);
-
- /* Allocate and minimalistic-initialize LPB */
- AllocateAndInitLPB(&LoaderBlock);
-
- /* Allocate and initialize setup loader block */
- SetupBlock = MmHeapAlloc(sizeof(SETUP_LOADER_BLOCK));
- RtlZeroMemory(SetupBlock, sizeof(SETUP_LOADER_BLOCK));
- LoaderBlock->SetupLdrBlock = SetupBlock;
-
- /* Set textmode setup flag */
- SetupBlock->Flags = SETUPLDR_TEXT_MODE;
-
- /* Detect hardware */
- UseRealHeap = TRUE;
- LoaderBlock->ConfigurationRoot = MachHwDetect();
-
- strcpy(FileName, "\\ArcName\\");
-
- /* Load kernel */
- strcpy(FileName+strlen("\\ArcName\\"), BootPath);
- strcat(FileName, "SYSTEM32\\NTOSKRNL.EXE");
- Status = WinLdrLoadImage(FileName+strlen("\\ArcName\\"), LoaderSystemCode,
&NtosBase);
- DPRINTM(DPRINT_WINDOWS, "Ntos loaded with status %d at %p\n", Status,
NtosBase);
- Status = WinLdrAllocateDataTableEntry(LoaderBlock, "ntoskrnl.exe",
- FileName, NtosBase, &KernelDTE);
- DPRINTM(DPRINT_WINDOWS, "Ntos Data Table Entry allocated with status %d at
%p\n", Status, KernelDTE);
-
- /* Load HAL */
- strcpy(FileName+strlen("\\ArcName\\"), BootPath);
- strcat(FileName, "SYSTEM32\\HAL.DLL");
- Status = WinLdrLoadImage(FileName+strlen("\\ArcName\\"), LoaderHalCode,
&HalBase);
- DPRINTM(DPRINT_WINDOWS, "HAL loaded with status %d at %p\n", Status,
HalBase);
- Status = WinLdrAllocateDataTableEntry(LoaderBlock, "hal.dll",
- FileName, HalBase, &HalDTE);
- DPRINTM(DPRINT_WINDOWS, "HAL Data Table Entry allocated with status %d at
%p\n", Status, HalDTE);
-
- /* Load kernel-debugger support dll */
- strcpy(FileName+strlen("\\ArcName\\"), BootPath);
- strcat(FileName, "SYSTEM32\\KDCOM.DLL");
- Status = WinLdrLoadImage(FileName+strlen("\\ArcName\\"), LoaderBootDriver,
&KdComBase);
- DPRINTM(DPRINT_WINDOWS, "KdCom loaded with status %d at %p\n", Status,
KdComBase);
- Status = WinLdrAllocateDataTableEntry(LoaderBlock, "kdcom.dll",
- FileName, KdComBase, &KdComDTE);
- DPRINTM(DPRINT_WINDOWS, "KdCom Data Table Entry allocated with status %d at
%p\n", Status, HalDTE);
-
- /* Load all referenced DLLs for kernel, HAL and kdcom.dll */
- strcpy(SearchPath, BootPath);
- strcat(SearchPath, "system32\\");
- Status = WinLdrScanImportDescriptorTable(LoaderBlock, SearchPath, KernelDTE);
- Status &= WinLdrScanImportDescriptorTable(LoaderBlock, SearchPath, HalDTE);
- if (KdComDTE)
- Status &= WinLdrScanImportDescriptorTable(LoaderBlock, SearchPath,
KdComDTE);
-
- if (!Status)
- {
- UiMessageBox("Error loading imported dll.");
- return;
- }
-
- /* Load NLS data, they are in system32 */
- SetupLdrLoadNlsData(LoaderBlock, InfHandle, SearchPath);
-
- /* Get a list of boot drivers */
- SetupLdrScanBootDrivers(LoaderBlock, InfHandle, BootPath);
-
- /* Load boot drivers */
- Status = WinLdrLoadBootDrivers(LoaderBlock, BootPath);
- DPRINTM(DPRINT_WINDOWS, "Boot drivers loaded with status %d\n", Status);
-
- /* Alloc PCR, TSS, do magic things with the GDT/IDT */
- WinLdrSetupForNt(LoaderBlock, &GdtIdt, &PcrBasePage, &TssBasePage);
-
- /* Initialize Phase 1 - no drivers loading anymore */
- WinLdrInitializePhase1(LoaderBlock, (PCHAR)BootOptions, SystemPath, BootPath,
_WIN32_WINNT_WS03);
-
- /* Save entry-point pointer and Loader block VAs */
- KiSystemStartup = (KERNEL_ENTRY_POINT)KernelDTE->EntryPoint;
- LoaderBlockVA = PaToVa(LoaderBlock);
-
- /* "Stop all motors", change videomode */
- MachPrepareForReactOS(TRUE);
-
- /* Debugging... */
- //DumpMemoryAllocMap();
-
- /* Turn on paging mode of CPU*/
- WinLdrTurnOnPaging(LoaderBlock, PcrBasePage, TssBasePage, GdtIdt);
-
- /* Save final value of LoaderPagesSpanned */
- LoaderBlock->Extension->LoaderPagesSpanned = LoaderPagesSpanned;
-
- DPRINTM(DPRINT_WINDOWS, "Hello from paged mode, KiSystemStartup %p,
LoaderBlockVA %p!\n",
- KiSystemStartup, LoaderBlockVA);
-
- //WinLdrpDumpMemoryDescriptors(LoaderBlockVA);
- //WinLdrpDumpBootDriver(LoaderBlockVA);
- //WinLdrpDumpArcDisks(LoaderBlockVA);
-
- /*asm(".intel_syntax noprefix\n");
- asm("test1:\n");
- asm("jmp test1\n");
- asm(".att_syntax\n");*/
-
- /* Pass control */
- (*KiSystemStartup)(LoaderBlockVA);
-
- return;
-}
Modified: branches/arty-newcc/dll/directx/ksproxy/output_pin.cpp
URL:
http://svn.reactos.org/svn/reactos/branches/arty-newcc/dll/directx/ksproxy/…
==============================================================================
--- branches/arty-newcc/dll/directx/ksproxy/output_pin.cpp [iso-8859-1] (original)
+++ branches/arty-newcc/dll/directx/ksproxy/output_pin.cpp [iso-8859-1] Fri Aug 26
13:51:30 2011
@@ -1035,7 +1035,7 @@
return NOERROR;
}
-IMemAllocator *
+IMemAllocator *
STDMETHODCALLTYPE
COutputPin::KsPeekAllocator(KSPEEKOPERATION Operation)
{
@@ -1318,7 +1318,7 @@
HRESULT
STDMETHODCALLTYPE
COutputPin::Backout(
- IPin *ppinOut,
+ IPin *ppinOut,
IGraphBuilder *pGraph)
{
#ifdef KSPROXY_TRACE
@@ -2428,7 +2428,7 @@
assert(NumHandles);
//allocate stream segment array
- StreamSegment = (PKSSTREAM_SEGMENT*)CoTaskMemAlloc(sizeof(PKSSTREAM_SEGMENT) *
NumHandles);
+ StreamSegment = (PKSSTREAM_SEGMENT*)CoTaskMemAlloc(sizeof(PVOID) * NumHandles);
if (!StreamSegment)
{
OutputDebugStringW(L"COutputPin::IoProcessRoutine out of memory\n");
@@ -2444,7 +2444,7 @@
}
// zero handles array
- ZeroMemory(StreamSegment, sizeof(PKSSTREAM_SEGMENT) * NumHandles);
+ ZeroMemory(StreamSegment, sizeof(PVOID) * NumHandles);
ZeroMemory(Samples, sizeof(IMediaSample*) * NumHandles);
// first wait for the start event to signal
@@ -2536,7 +2536,7 @@
}
//circular stream segment array
- RtlMoveMemory(StreamSegment, &StreamSegment[1], sizeof(PKSSTREAM_SEGMENT) *
(NumHandles - 1));
+ RtlMoveMemory(StreamSegment, &StreamSegment[1], sizeof(PVOID) * (NumHandles -
1));
RtlMoveMemory(Samples, &Samples[1], sizeof(IMediaSample*) * (NumHandles -
1));
}while(TRUE);
Modified: branches/arty-newcc/drivers/ksfilter/ks/filter.c
URL:
http://svn.reactos.org/svn/reactos/branches/arty-newcc/drivers/ksfilter/ks/…
==============================================================================
--- branches/arty-newcc/drivers/ksfilter/ks/filter.c [iso-8859-1] (original)
+++ branches/arty-newcc/drivers/ksfilter/ks/filter.c [iso-8859-1] Fri Aug 26 13:51:30
2011
@@ -203,7 +203,7 @@
}
/* does the filter require explicit deferred processing */
- if ((This->Filter.Descriptor->Flags &
(KSFILTER_FLAG_DISPATCH_LEVEL_PROCESSING | KSFILTER_FLAG_CRITICAL_PROCESSING |
KSFILTER_FLAG_HYPERCRITICAL_PROCESSING)) &&
+ if ((This->Filter.Descriptor->Flags &
(KSFILTER_FLAG_DISPATCH_LEVEL_PROCESSING | KSFILTER_FLAG_CRITICAL_PROCESSING |
KSFILTER_FLAG_HYPERCRITICAL_PROCESSING)) &&
KeGetCurrentIrql() > PASSIVE_LEVEL)
{
/* queue work item */
@@ -512,8 +512,8 @@
/* allocate new process pin array */
Status = _KsEdit(This->Filter.Bag,
(PVOID*)&This->ProcessPinIndex[ProcessPin->Pin->Id].Pins,
- (This->Filter.Descriptor->PinDescriptorsCount + 1) *
sizeof(PKSPROCESSPIN),
- This->Filter.Descriptor->PinDescriptorsCount *
sizeof(PKSPROCESSPIN),
+ (This->Filter.Descriptor->PinDescriptorsCount + 1) *
sizeof(PVOID),
+ This->Filter.Descriptor->PinDescriptorsCount * sizeof(PVOID),
0);
if (NT_SUCCESS(Status))
@@ -556,7 +556,7 @@
{
if (Pins[Index] == ProcessPin)
{
- RtlMoveMemory(&Pins[Index], &Pins[Index + 1], (Count - (Index + 1)) *
sizeof(PKSPROCESSPIN));
+ RtlMoveMemory(&Pins[Index], &Pins[Index + 1], (Count - (Index + 1)) *
sizeof(PVOID));
break;
}
@@ -755,7 +755,7 @@
}
/* ignore custom structs for now */
- ASSERT(This->Filter.Descriptor->PinDescriptorSize ==
sizeof(KSPIN_DESCRIPTOR_EX));
+ ASSERT(This->Filter.Descriptor->PinDescriptorSize ==
sizeof(KSPIN_DESCRIPTOR_EX));
ASSERT(This->Filter.Descriptor->PinDescriptorsCount > Pin->PinId);
Instances = (KSPIN_CINSTANCES*)Data;
@@ -787,7 +787,7 @@
}
/* ignore custom structs for now */
- ASSERT(This->Filter.Descriptor->PinDescriptorSize ==
sizeof(KSPIN_DESCRIPTOR_EX));
+ ASSERT(This->Filter.Descriptor->PinDescriptorSize ==
sizeof(KSPIN_DESCRIPTOR_EX));
ASSERT(This->Filter.Descriptor->PinDescriptorsCount > Pin->PinId);
Result = (PULONG)Data;
@@ -835,7 +835,7 @@
}
/* ignore custom structs for now */
- ASSERT(This->Filter.Descriptor->PinDescriptorSize ==
sizeof(KSPIN_DESCRIPTOR_EX));
+ ASSERT(This->Filter.Descriptor->PinDescriptorSize ==
sizeof(KSPIN_DESCRIPTOR_EX));
ASSERT(This->Filter.Descriptor->PinDescriptorsCount > Pin->PinId);
if (This->Filter.Descriptor->PinDescriptors[Pin->PinId].IntersectHandler ==
NULL ||
@@ -1147,8 +1147,8 @@
}
/* store instantiated pin arrays */
- Status = _KsEdit(This->Filter.Bag, (PVOID*)&This->FirstPin,
sizeof(PKSPIN) * FilterDescriptor->PinDescriptorsCount,
- sizeof(PKSPIN) * FilterDescriptor->PinDescriptorsCount, 0);
+ Status = _KsEdit(This->Filter.Bag, (PVOID*)&This->FirstPin,
sizeof(PVOID) * FilterDescriptor->PinDescriptorsCount,
+ sizeof(PVOID) * FilterDescriptor->PinDescriptorsCount, 0);
if (!NT_SUCCESS(Status))
{
@@ -1395,7 +1395,7 @@
/* sanity check */
ASSERT(Connect->PinId <
This->Filter.Descriptor->PinDescriptorsCount);
- DPRINT("IKsFilter_DispatchCreatePin KsValidateConnectRequest PinId %lu
CurrentInstanceCount %lu MaxPossible %lu\n", Connect->PinId,
+ DPRINT("IKsFilter_DispatchCreatePin KsValidateConnectRequest PinId %lu
CurrentInstanceCount %lu MaxPossible %lu\n", Connect->PinId,
This->PinInstanceCount[Connect->PinId],
This->Filter.Descriptor->PinDescriptors[Connect->PinId].InstancesPossible);
@@ -1922,7 +1922,7 @@
}
/* modify first pin array */
- Status = _KsEdit(This->Filter.Bag,(PVOID*)&This->FirstPin, sizeof(PKSPIN) *
Count, sizeof(PKSPIN) * This->Filter.Descriptor->PinDescriptorsCount, 0);
+ Status = _KsEdit(This->Filter.Bag,(PVOID*)&This->FirstPin, sizeof(PVOID) *
Count, sizeof(PVOID) * This->Filter.Descriptor->PinDescriptorsCount, 0);
if (!NT_SUCCESS(Status))
{
/* failed */
Modified: branches/arty-newcc/drivers/storage/scsiport/scsiport.c
URL:
http://svn.reactos.org/svn/reactos/branches/arty-newcc/drivers/storage/scsi…
==============================================================================
--- branches/arty-newcc/drivers/storage/scsiport/scsiport.c [iso-8859-1] (original)
+++ branches/arty-newcc/drivers/storage/scsiport/scsiport.c [iso-8859-1] Fri Aug 26
13:51:30 2011
@@ -1537,12 +1537,12 @@
&Dirql[i],
&Affinity[i]);
}
-
+
if (DeviceExtension->InterruptCount == 1 || Dirql[0] > Dirql[1])
MaxDirql = Dirql[0];
else
MaxDirql = Dirql[1];
-
+
for (i = 0; i < DeviceExtension->InterruptCount; i++)
{
/* Determing IRQ sharability as usual */
@@ -1576,7 +1576,7 @@
break;
}
}
-
+
if (!NT_SUCCESS(Status))
break;
}
@@ -1639,7 +1639,7 @@
/* Initialize bus scanning information */
DeviceExtension->BusesConfig = ExAllocatePoolWithTag(PagedPool,
- sizeof(PSCSI_BUS_SCAN_INFO) * DeviceExtension->PortConfig->NumberOfBuses
+ sizeof(PVOID) * DeviceExtension->PortConfig->NumberOfBuses
+ sizeof(ULONG), TAG_SCSIPORT);
if (!DeviceExtension->BusesConfig)
@@ -1651,7 +1651,7 @@
/* Zero it */
RtlZeroMemory(DeviceExtension->BusesConfig,
- sizeof(PSCSI_BUS_SCAN_INFO) * DeviceExtension->PortConfig->NumberOfBuses
+ sizeof(PVOID) * DeviceExtension->PortConfig->NumberOfBuses
+ sizeof(ULONG));
/* Store number of buses there */
@@ -2008,7 +2008,7 @@
case BusChangeDetected:
DPRINT1("UNIMPLEMENTED SCSI Notification called:
BusChangeDetected!\n");
break;
-
+
default:
DPRINT1 ("Unsupported notification from WMI: %lu\n", NotificationType);
break;
@@ -2183,7 +2183,7 @@
PortConfig->DmaPort != SP_UNINITIALIZED_VALUE)
{
Dma = 1;
-
+
if (PortConfig->DmaChannel2 != SP_UNINITIALIZED_VALUE ||
PortConfig->DmaPort2 != SP_UNINITIALIZED_VALUE)
Dma++;
@@ -2288,7 +2288,7 @@
ResourceDescriptor->u.Dma.Channel = (Dma == 2) ? PortConfig->DmaChannel2 :
PortConfig->DmaChannel;
ResourceDescriptor->u.Dma.Port = (Dma == 2) ? PortConfig->DmaPort2 :
PortConfig->DmaPort;
ResourceDescriptor->Flags = 0;
-
+
if (((Dma == 2) ? PortConfig->DmaWidth2 : PortConfig->DmaWidth) ==
Width8Bits)
ResourceDescriptor->Flags |= CM_RESOURCE_DMA_8;
else if (((Dma == 2) ? PortConfig->DmaWidth2 : PortConfig->DmaWidth) ==
Width16Bits)
@@ -2301,7 +2301,7 @@
if (((Dma == 2) ? PortConfig->DmaPort2 : PortConfig->DmaPort) ==
SP_UNINITIALIZED_VALUE)
ResourceDescriptor->u.Dma.Port = 0;
-
+
ResourceDescriptor++;
Dma--;
}
@@ -2327,12 +2327,11 @@
CHAR VendorIdString[8];
CHAR DeviceIdString[8];
UNICODE_STRING UnicodeStr;
- PCM_RESOURCE_LIST ResourceList;
+ PCM_RESOURCE_LIST ResourceList = NULL;
NTSTATUS Status;
DPRINT ("SpiGetPciConfiguration() called\n");
- RtlZeroMemory(&ResourceList, sizeof(PCM_RESOURCE_LIST));
SlotNumber.u.AsULONG = 0;
/* Loop through all devices */
@@ -5943,7 +5942,7 @@
UNICODE_STRING UnicodeString;
ANSI_STRING AnsiString;
NTSTATUS Status = STATUS_SUCCESS;
-
+
KeyValueInformation = (PKEY_VALUE_FULL_INFORMATION) Buffer;
@@ -6232,7 +6231,7 @@
break;
case CmResourceTypeInterrupt:
-
+
if (Interrupt == 0)
{
ConfigInfo->BusInterruptLevel =
@@ -6253,7 +6252,7 @@
ConfigInfo->InterruptMode2 = (PartialDescriptor->Flags
& CM_RESOURCE_INTERRUPT_LATCHED) ? Latched : LevelSensitive;
}
-
+
Interrupt++;
break;
@@ -6263,7 +6262,7 @@
{
ConfigInfo->DmaChannel = PartialDescriptor->u.Dma.Channel;
ConfigInfo->DmaPort = PartialDescriptor->u.Dma.Port;
-
+
if (PartialDescriptor->Flags & CM_RESOURCE_DMA_8)
ConfigInfo->DmaWidth = Width8Bits;
else if ((PartialDescriptor->Flags & CM_RESOURCE_DMA_16)
||
@@ -6276,7 +6275,7 @@
{
ConfigInfo->DmaChannel2 =
PartialDescriptor->u.Dma.Channel;
ConfigInfo->DmaPort2 = PartialDescriptor->u.Dma.Port;
-
+
if (PartialDescriptor->Flags & CM_RESOURCE_DMA_8)
ConfigInfo->DmaWidth2 = Width8Bits;
else if ((PartialDescriptor->Flags & CM_RESOURCE_DMA_16)
||
@@ -6285,7 +6284,7 @@
else if (PartialDescriptor->Flags & CM_RESOURCE_DMA_32)
ConfigInfo->DmaWidth2 = Width32Bits;
}
-
+
Dma++;
break;
Modified: branches/arty-newcc/drivers/wdm/audio/backpln/portcls/irpstream.cpp
URL:
http://svn.reactos.org/svn/reactos/branches/arty-newcc/drivers/wdm/audio/ba…
==============================================================================
--- branches/arty-newcc/drivers/wdm/audio/backpln/portcls/irpstream.cpp [iso-8859-1]
(original)
+++ branches/arty-newcc/drivers/wdm/audio/backpln/portcls/irpstream.cpp [iso-8859-1] Fri
Aug 26 13:51:30 2011
@@ -43,7 +43,7 @@
LIST_ENTRY m_IrpList;
LIST_ENTRY m_FreeIrpList;
- ULONG m_OutOfMapping;
+ BOOLEAN m_OutOfMapping;
ULONG m_MaxFrameSize;
ULONG m_Alignment;
ULONG m_TagSupportEnabled;
@@ -372,7 +372,7 @@
ASSERT(StreamData);
// add to current offset
- InterlockedExchangeAdd((volatile PLONG)&m_CurrentOffset, (LONG)BytesWritten);
+ InterlockedExchangeAdd((PLONG)&m_CurrentOffset, (LONG)BytesWritten);
if (m_Descriptor->DataFlow == KSPIN_DATAFLOW_OUT)
{
Modified: branches/arty-newcc/hal/halx86/CMakeLists.txt
URL:
http://svn.reactos.org/svn/reactos/branches/arty-newcc/hal/halx86/CMakeList…
==============================================================================
--- branches/arty-newcc/hal/halx86/CMakeLists.txt [iso-8859-1] (original)
+++ branches/arty-newcc/hal/halx86/CMakeLists.txt [iso-8859-1] Fri Aug 26 13:51:30 2011
@@ -38,6 +38,7 @@
generic/legacy/bus/pcidata.c
generic/legacy/bus/sysbus.c
generic/legacy/bussupp.c
+ generic/legacy/halpnpdd.c
generic/legacy/halpcat.c)
list(APPEND HAL_GENERIC_ACPI_SOURCE
Modified: branches/arty-newcc/hal/halx86/generic/legacy/halpcat.c
URL:
http://svn.reactos.org/svn/reactos/branches/arty-newcc/hal/halx86/generic/l…
==============================================================================
--- branches/arty-newcc/hal/halx86/generic/legacy/halpcat.c [iso-8859-1] (original)
+++ branches/arty-newcc/hal/halx86/generic/legacy/halpcat.c [iso-8859-1] Fri Aug 26
13:51:30 2011
@@ -60,6 +60,7 @@
return (HalpBusType == MACHINE_TYPE_EISA) ? CM_RESOURCE_PORT_16_BIT_DECODE : 0;
}
+#if 0
NTSTATUS
NTAPI
INIT_FUNCTION
@@ -69,6 +70,7 @@
//HalpDebugPciBus();
return STATUS_SUCCESS;
}
+#endif
/*
* @implemented
Modified: branches/arty-newcc/hal/halx86/hal_generic_acpi.rbuild
URL:
http://svn.reactos.org/svn/reactos/branches/arty-newcc/hal/halx86/hal_gener…
==============================================================================
--- branches/arty-newcc/hal/halx86/hal_generic_acpi.rbuild [iso-8859-1] (original)
+++ branches/arty-newcc/hal/halx86/hal_generic_acpi.rbuild [iso-8859-1] Fri Aug 26
13:51:30 2011
@@ -8,16 +8,16 @@
<define name="_NTHAL_" />
<define name="CONFIG_ACPI" />
<directory name="generic">
- <directory name="acpi">
- <file>halacpi.c</file>
- <file>halpnpdd.c</file>
- <file>busemul.c</file>
- </directory>
- <directory name="legacy">
- <directory name="bus">
- <file>pcibus.c</file>
- </directory>
- </directory>
+ <directory name="acpi">
+ <file>halacpi.c</file>
+ <file>halpnpdd.c</file>
+ <file>busemul.c</file>
+ </directory>
+ <directory name="legacy">
+ <directory name="bus">
+ <file>pcibus.c</file>
+ </directory>
+ </directory>
<if property="ARCH" value="i386">
<file>halinit.c</file>
</if>
Modified: branches/arty-newcc/hal/halx86/hal_generic_pcat.rbuild
URL:
http://svn.reactos.org/svn/reactos/branches/arty-newcc/hal/halx86/hal_gener…
==============================================================================
--- branches/arty-newcc/hal/halx86/hal_generic_pcat.rbuild [iso-8859-1] (original)
+++ branches/arty-newcc/hal/halx86/hal_generic_pcat.rbuild [iso-8859-1] Fri Aug 26
13:51:30 2011
@@ -7,18 +7,19 @@
<define name="_NTHALDLL_" />
<define name="_NTHAL_" />
<directory name="generic">
- <directory name="legacy">
- <directory name="bus">
- <file>bushndlr.c</file>
- <file>cmosbus.c</file>
- <file>isabus.c</file>
- <file>pcibus.c</file>
- <file>pcidata.c</file>
- <file>sysbus.c</file>
- </directory>
- <file>bussupp.c</file>
- <file>halpcat.c</file>
- </directory>
+ <directory name="legacy">
+ <directory name="bus">
+ <file>bushndlr.c</file>
+ <file>cmosbus.c</file>
+ <file>isabus.c</file>
+ <file>pcibus.c</file>
+ <file>pcidata.c</file>
+ <file>sysbus.c</file>
+ </directory>
+ <file>bussupp.c</file>
+ <file>halpcat.c</file>
+ <file>halpnpdd.c</file>
+ </directory>
<if property="ARCH" value="i386">
<file>halinit.c</file>
</if>
Modified: branches/arty-newcc/include/c++/stlport/stl/config/_reactos.h
URL:
http://svn.reactos.org/svn/reactos/branches/arty-newcc/include/c%2B%2B/stlp…
==============================================================================
--- branches/arty-newcc/include/c++/stlport/stl/config/_reactos.h [iso-8859-1] (original)
+++ branches/arty-newcc/include/c++/stlport/stl/config/_reactos.h [iso-8859-1] Fri Aug 26
13:51:30 2011
@@ -313,8 +313,11 @@
#ifdef __cplusplus
}
#endif
+
+#ifdef _BUILD_STLPORT
#define InterlockedPopEntrySList(list)
reinterpret_cast<_STLP_atomic_freelist::item*>(InterlockedPopEntrySList(list))
#define InterlockedFlushSList(list)
reinterpret_cast<_STLP_atomic_freelist::item*>(InterlockedFlushSList(list))
+#endif
#undef __cdecl__
#define __cdecl__
Modified: branches/arty-newcc/include/crt/msc/intrin.h
URL:
http://svn.reactos.org/svn/reactos/branches/arty-newcc/include/crt/msc/intr…
==============================================================================
--- branches/arty-newcc/include/crt/msc/intrin.h [iso-8859-1] (original)
+++ branches/arty-newcc/include/crt/msc/intrin.h [iso-8859-1] Fri Aug 26 13:51:30 2011
@@ -216,7 +216,7 @@
unsigned __int64 _byteswap_uint64(unsigned __int64 value);
#pragma intrinsic(_byteswap_uint64)
#ifdef _M_AMD64
-unsigned char _bittest64(__int64 *a, __int64 b);
+unsigned char _bittest64(__int64 const *a, __int64 b);
#pragma intrinsic(_bittest64)
#endif
Modified: branches/arty-newcc/lib/3rdparty/stlport/CMakeLists.txt
URL:
http://svn.reactos.org/svn/reactos/branches/arty-newcc/lib/3rdparty/stlport…
==============================================================================
--- branches/arty-newcc/lib/3rdparty/stlport/CMakeLists.txt [iso-8859-1] (original)
+++ branches/arty-newcc/lib/3rdparty/stlport/CMakeLists.txt [iso-8859-1] Fri Aug 26
13:51:30 2011
@@ -4,7 +4,8 @@
add_definitions(
-D_STLP_USE_EXCEPTIONS
- -D_DLL -D__USE_CRTIMP)
+ -D_DLL -D__USE_CRTIMP
+ -D_BUILD_STLPORT)
set_cpp()
Modified: branches/arty-newcc/media/inf/hal.inf
URL:
http://svn.reactos.org/svn/reactos/branches/arty-newcc/media/inf/hal.inf?re…
==============================================================================
Binary files - no diff available.