ReactOS.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
List overview
Download
Ros-diffs
July 2008
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
ros-diffs@reactos.org
25 participants
761 discussions
Start a n
N
ew thread
[pschweitzer] 34978: Refactored directory change notification: - Used PSEH - Added a simple test case - Renamed it to VfatNotifyChange The code looks better, should work better but is still commented out because of missing implementations in FsRtl. See issue #2821 for more details.
by pschweitzer@svn.reactos.org
Author: pschweitzer Date: Thu Jul 31 03:06:02 2008 New Revision: 34978 URL:
http://svn.reactos.org/svn/reactos?rev=34978&view=rev
Log: Refactored directory change notification: - Used PSEH - Added a simple test case - Renamed it to VfatNotifyChange The code looks better, should work better but is still commented out because of missing implementations in FsRtl. See issue #2821 for more details. Modified: branches/pierre-fsd/drivers/filesystems/fastfat/dir.c Modified: branches/pierre-fsd/drivers/filesystems/fastfat/dir.c URL:
http://svn.reactos.org/svn/reactos/branches/pierre-fsd/drivers/filesystems/…
============================================================================== --- branches/pierre-fsd/drivers/filesystems/fastfat/dir.c [iso-8859-1] (original) +++ branches/pierre-fsd/drivers/filesystems/fastfat/dir.c [iso-8859-1] Thu Jul 31 03:06:02 2008 @@ -471,54 +471,112 @@ return RC; } -#if 0 -static NTSTATUS NotifyChange (PVFAT_IRP_CONTEXT IrpContext) //bug 2821 +VOID VfatNotifyChangeFinal (PVFAT_IRP_CONTEXT IrpContext, + PVFATFCB pFcb, + BOOLEAN AcquiredFCB, + BOOLEAN PostRequest, + PNTSTATUS pRC) +{ + if (PostRequest) + { + if (AcquiredFCB) + { + ExReleaseResourceLite(&pFcb->MainResource); + AcquiredFCB = FALSE; + } + *pRC = STATUS_PENDING; + } + else + { + VfatFreeIrpContext(IrpContext); + } + + if (AcquiredFCB) + { + ExReleaseResourceLite(&pFcb->MainResource); + AcquiredFCB = FALSE; + } +} + +_SEH_DEFINE_LOCALS(VfatNotifyChangeFinal) +{ + PVFAT_IRP_CONTEXT IrpContext; + PVFATFCB pFcb; + BOOLEAN AcquiredFCB; + BOOLEAN PostRequest; + PNTSTATUS pRC; +}; + +_SEH_FINALLYFUNC(VfatNotifyChangeFinal_PSEH) +{ + _SEH_ACCESS_LOCALS(VfatNotifyChangeFinal); + VfatNotifyChangeFinal(_SEH_VAR(IrpContext), _SEH_VAR(pFcb), + _SEH_VAR(AcquiredFCB), _SEH_VAR(PostRequest), _SEH_VAR(pRC)); +} + +static NTSTATUS VfatNotifyChange (PVFAT_IRP_CONTEXT IrpContext) { PIRP pIrp; PVFATCCB pCcb; PVFATFCB pFcb; PDEVICE_EXTENSION pVcb; - BOOLEAN WatchTree = FALSE; - ULONG CompletionFilter = 0; - BOOLEAN PostRequest = FALSE; +#if 0 + BOOLEAN WatchTree = FALSE; + ULONG CompletionFilter = 0; +#endif NTSTATUS RC = STATUS_SUCCESS; - +#if 0 PIO_STACK_LOCATION Stack = IrpContext->Stack; - +#endif + pIrp = (PIRP) IrpContext->Irp; pFcb = (PVFATFCB) IrpContext->FileObject->FsContext; pCcb = (PVFATCCB) IrpContext->FileObject->FsContext2; pVcb = (PDEVICE_EXTENSION) IrpContext->DeviceExt; - - if (!ExAcquireResourceSharedLite(&pFcb->MainResource, - (BOOLEAN)(IrpContext->Flags & IRPCONTEXT_CANWAIT))) - { - PostRequest = TRUE; - } - - if (!PostRequest) - { + + if (!vfatFCBIsDirectory(pFcb)) + { + return STATUS_INVALID_PARAMETER; + } + +#if 0 + _SEH_TRY + { + _SEH_DECLARE_LOCALS(VfatNotifyChangeFinal); + _SEH_VAR(IrpContext) = IrpContext; + _SEH_VAR(pFcb) = pFcb; + _SEH_VAR(AcquiredFCB) = FALSE; + _SEH_VAR(PostRequest) = FALSE; + _SEH_VAR(pRC) = &RC; + + if (!ExAcquireResourceSharedLite(&pFcb->MainResource, + (BOOLEAN)(IrpContext->Flags & IRPCONTEXT_CANWAIT))) + { + _SEH_VAR(PostRequest) = TRUE; + RC = STATUS_PENDING; + _SEH_LEAVE; + } + _SEH_VAR(AcquiredFCB) = TRUE; + CompletionFilter = Stack->Parameters.NotifyDirectory.CompletionFilter; WatchTree = (Stack->Flags & SL_WATCH_TREE ? TRUE : FALSE); - + + /* FIXME: FsRtlNotifyFullChangeDirectory is unimplemented */ FsRtlNotifyFullChangeDirectory(pVcb->NotifySync, &(pVcb->NotifyList), pCcb, (PSTRING)&(pFcb->LongNameU), WatchTree, FALSE, CompletionFilter, pIrp, NULL, NULL); - } - - if (PostRequest) - { - VfatQueueRequest(IrpContext); - } - else - { - VfatFreeIrpContext(IrpContext); - ExReleaseResourceLite(&pFcb->MainResource); - } - + + RC = STATUS_PENDING; + } + _SEH_FINALLY(VfatNotifyChangeFinal_PSEH) + _SEH_END; +#else + DPRINT (" vfat, dir : change\n"); + RC = STATUS_NOT_IMPLEMENTED; +#endif + return RC; } -#endif NTSTATUS VfatDirectoryControl (PVFAT_IRP_CONTEXT IrpContext) @@ -535,17 +593,11 @@ RC = DoQuery (IrpContext); break; case IRP_MN_NOTIFY_CHANGE_DIRECTORY: -#if 0 - RC = NotifyChange (IrpContext); -#else - DPRINT (" vfat, dir : change\n"); - RC = STATUS_NOT_IMPLEMENTED; -#endif + RC = VfatNotifyChange (IrpContext); break; default: // error - DbgPrint ("unexpected minor function %x in VFAT driver\n", - IrpContext->MinorFunction); + DbgPrint ("unexpected minor function %x in VFAT driver\n", IrpContext->MinorFunction); RC = STATUS_INVALID_DEVICE_REQUEST; break; }
16 years, 4 months
1
0
0
0
[ros-arm-bringup] 34977: - Fix ARM NTOS brekage (and amd64/ppc): - Only build kd/i386 on i386 builds since this code is x86-32 centric. - Only call KdpEnableSafeMem on i386 builds, since the code uses x86-32 centric defines.
by ros-arm-bringup@svn.reactos.org
Author: ros-arm-bringup Date: Thu Jul 31 02:31:55 2008 New Revision: 34977 URL:
http://svn.reactos.org/svn/reactos?rev=34977&view=rev
Log: - Fix ARM NTOS brekage (and amd64/ppc): - Only build kd/i386 on i386 builds since this code is x86-32 centric. - Only call KdpEnableSafeMem on i386 builds, since the code uses x86-32 centric defines. Modified: trunk/reactos/ntoskrnl/kd/kdinit.c trunk/reactos/ntoskrnl/ntoskrnl-generic.rbuild Modified: trunk/reactos/ntoskrnl/kd/kdinit.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/kd/kdinit.c?rev=3…
============================================================================== --- trunk/reactos/ntoskrnl/kd/kdinit.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/kd/kdinit.c [iso-8859-1] Thu Jul 31 02:31:55 2008 @@ -258,7 +258,11 @@ return TRUE; } else - KdpEnableSafeMem(); + { +#ifdef _M_IX86 + KdpEnableSafeMem(); +#endif + } /* Call the Initialization Routines of the Registered Providers */ KdpCallInitRoutine(BootPhase); Modified: trunk/reactos/ntoskrnl/ntoskrnl-generic.rbuild URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ntoskrnl-generic.…
============================================================================== --- trunk/reactos/ntoskrnl/ntoskrnl-generic.rbuild [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/ntoskrnl-generic.rbuild [iso-8859-1] Thu Jul 31 02:31:55 2008 @@ -273,9 +273,11 @@ </directory> </directory> <directory name="kd"> - <directory name="i386"> - <file>kdmemsup.c</file> - </directory> + <if property="ARCH" value="i386"> + <directory name="i386"> + <file>kdmemsup.c</file> + </directory> + </if> </directory> <if property="_WINKD_" value="0"> <directory name="kdbg">
16 years, 4 months
1
0
0
0
[ros-arm-bringup] 34976: mmcreatevirtualmapping internal should accept process as input parameter, not assume null. implement a broken version of mmcreateprocessaddressspace. commit current checkpoint of arm mmu manager virtual mapping rewrite to sync with i386 code. the kernel part works fine and the kernel boots as far as it did before, but the code is still ugly.
by ros-arm-bringup@svn.reactos.org
Author: ros-arm-bringup Date: Thu Jul 31 02:09:28 2008 New Revision: 34976 URL:
http://svn.reactos.org/svn/reactos?rev=34976&view=rev
Log: mmcreatevirtualmapping internal should accept process as input parameter, not assume null. implement a broken version of mmcreateprocessaddressspace. commit current checkpoint of arm mmu manager virtual mapping rewrite to sync with i386 code. the kernel part works fine and the kernel boots as far as it did before, but the code is still ugly. Modified: trunk/reactos/ntoskrnl/mm/arm/stubs.c Modified: trunk/reactos/ntoskrnl/mm/arm/stubs.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/arm/stubs.c?re…
============================================================================== --- trunk/reactos/ntoskrnl/mm/arm/stubs.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/mm/arm/stubs.c [iso-8859-1] Thu Jul 31 02:09:28 2008 @@ -66,9 +66,9 @@ IN PVOID Address, IN BOOLEAN Create) { - ULONG PdeOffset; - PMMPTE PointerPde; - MMPTE Pte; + //ULONG PdeOffset; + PMMPTE PointerPde, PointerPte; + MMPTE TempPde, TempPte; NTSTATUS Status; PFN_NUMBER Pfn; @@ -86,6 +86,12 @@ } // + // Get our templates + // + TempPde = MiArmTemplatePde; + TempPte = MiArmTemplatePte; + + // // Get the PDE // PointerPde = MiGetPdeAddress(Address); @@ -99,18 +105,16 @@ // // Does it exist in the kernel page directory? // - PdeOffset = MiGetPdeOffset(Address); - if (MmGlobalKernelPageDirectory[PdeOffset] == 0) + //PdeOffset = MiGetPdeOffset(Address); + //if (MmGlobalKernelPageDirectory[PdeOffset] == 0) { // // It doesn't. Is this a create operation? If not, fail // if (Create == FALSE) return NULL; - - // - // THIS WHOLE PATH IS TODO - // - ASSERT(FALSE); + kernelHack: + DPRINT1("Must create a page for: %p PDE: %p\n", // Offset: %lx!\n", + Address, PointerPde);//, PdeOffset); // // Allocate a non paged pool page for the PDE @@ -119,20 +123,51 @@ if (!NT_SUCCESS(Status)) return NULL; // - // Make the entry valid - // - Pte.u.Hard.AsUlong = 0xDEADBEEF; + // Setup the PFN + // + TempPde.u.Hard.L1.Coarse.BaseAddress = (Pfn << PAGE_SHIFT) >> CPT_SHIFT; // + // Write the PDE + // + ASSERT(PointerPde->u.Hard.L1.Fault.Type == FaultPte); + ASSERT(TempPde.u.Hard.L1.Coarse.Type == CoarsePte); + *PointerPde = TempPde; + + // // Save it // - MmGlobalKernelPageDirectory[PdeOffset] = Pte.u.Hard.AsUlong; + //MmGlobalKernelPageDirectory[PdeOffset] = TempPde.u.Hard.AsUlong; + //DPRINT1("KPD: %p PDEADDR: %p\n", &MmGlobalKernelPageDirectory[PdeOffset], MiGetPdeAddress(Address)); + + // + // FIXFIX: Double check with Felix tomorrow + // +///// + // + // Get the PTE for this 1MB region + // + PointerPte = MiGetPteAddress(MiGetPteAddress(Address)); + DPRINT1("PointerPte: %p\n", PointerPte); + + // + // Write the PFN of the PDE + // + TempPte.u.Hard.L2.Small.BaseAddress = Pfn; + + // + // Write the PTE + // + ASSERT(PointerPte->u.Hard.L2.Fault.Type == FaultPte); + ASSERT(TempPte.u.Hard.L2.Small.Type == SmallPte); + *PointerPte = TempPte; +///// } // // Now set the actual PDE // - PointerPde = (PMMPTE)&MmGlobalKernelPageDirectory[PdeOffset]; + //PointerPde = (PMMPTE)&MmGlobalKernelPageDirectory[PdeOffset]; } else { @@ -144,6 +179,7 @@ // // THIS WHOLE PATH IS TODO // + goto kernelHack; ASSERT(FALSE); // @@ -155,12 +191,12 @@ // // Make the entry valid // - Pte.u.Hard.AsUlong = 0xDEADBEEF; + TempPte.u.Hard.AsUlong = 0xDEADBEEF; // // Set it // - *PointerPde = Pte; + *PointerPde = TempPte; } } @@ -247,7 +283,7 @@ // // Invalidate the TLB entry // - MiFlushTlb(PointerPde, MiAddressToPte(Address)); + MiFlushTlb(PointerPde, MiGetPteAddress(Address)); } BOOLEAN @@ -256,12 +292,76 @@ IN PEPROCESS Process, IN PLARGE_INTEGER DirectoryTableBase) { - // - // FIXME-USER: Need to create address space - // - UNIMPLEMENTED; - while (TRUE); - return 0; + NTSTATUS Status; + ULONG i; + PFN_NUMBER Pfn[2]; + PMMPTE PageDirectory, PointerPde; + MMPTE TempPde; + ASSERT(FALSE); + + // + // Loop two tables (Hyperspace and TTB). Each one is 16KB + // + // + for (i = 0; i < 8; i++) + { + // + // Allocate a page + // + Status = MmRequestPageMemoryConsumer(MC_NPPOOL, FALSE, &Pfn[i]); + if (!NT_SUCCESS(Status)) ASSERT(FALSE); + } + + // + // Map the base + // + PageDirectory = MmCreateHyperspaceMapping(Pfn[0]); + + // + // Copy the PDEs for kernel-mode + // + RtlCopyMemory(PageDirectory + MiGetPdeOffset(MmSystemRangeStart), + MmGlobalKernelPageDirectory + MiGetPdeOffset(MmSystemRangeStart), + (1024 - MiGetPdeOffset(MmSystemRangeStart)) * sizeof(ULONG)); + + + // + // Setup the PDE for the table base + // + TempPde = MiArmTemplatePde; + TempPde.u.Hard.L1.Coarse.BaseAddress = (Pfn[0] << PAGE_SHIFT) >> CPT_SHIFT; + PointerPde = &PageDirectory[MiGetPdeOffset(PTE_BASE)]; + + // + // Write the PDE + // + ASSERT(PointerPde->u.Hard.L1.Fault.Type == FaultPte); + ASSERT(TempPde.u.Hard.L1.Coarse.Type == CoarsePte); + *PointerPde = TempPde; + + // + // Setup the PDE for the hyperspace + // + TempPde.u.Hard.L1.Coarse.BaseAddress = (Pfn[1] << PAGE_SHIFT) >> CPT_SHIFT; + PointerPde = &PageDirectory[MiGetPdeOffset(HYPER_SPACE)]; + + // + // Write the PDE + // + ASSERT(PointerPde->u.Hard.L1.Fault.Type == FaultPte); + ASSERT(TempPde.u.Hard.L1.Coarse.Type == CoarsePte); + *PointerPde = TempPde; + + // + // Unmap the page directory + // + MmDeleteHyperspaceMapping(PageDirectory); + + // + // Return the page table base + // + DirectoryTableBase->QuadPart = Pfn[0] << PAGE_SHIFT; + return TRUE; } VOID @@ -349,86 +449,63 @@ NTSTATUS NTAPI -MmCreateVirtualMappingInternal(IN PVOID Address, +MmCreateVirtualMappingInternal(IN PEPROCESS Process, + IN PVOID Address, IN ULONG Protection, IN PPFN_NUMBER Pages, IN ULONG PageCount, IN BOOLEAN MarkAsMapped) { - PMMPTE PointerPte, LastPte, PointerPde, LastPde; - MMPTE TempPte, TempPde; - NTSTATUS Status; - PFN_NUMBER Pfn; + PMMPTE PointerPte = NULL; + MMPTE TempPte; + PVOID Addr; + ULONG OldPdeOffset, PdeOffset, i; DPRINT("[KMAP]: %p %d\n", Address, PageCount); //ASSERT(Address >= MmSystemRangeStart); // - // Get our templates + // Get our template PTE // TempPte = MiArmTemplatePte; - TempPde = MiArmTemplatePde; - - // - // Check if we have PDEs for this region - // - PointerPde = MiGetPdeAddress(Address); - LastPde = PointerPde + (PageCount / 256); - while (PointerPde <= LastPde) - { - // - // Check if we need to allocate the PDE - // - if (PointerPde->u.Hard.L1.Fault.Type == FaultPte) + + // + // Loop every page + // + Addr = Address; + OldPdeOffset = MiGetPdeOffset(Addr) + 1; + for (i = 0; i < PageCount; i++) + { + // + // Get the next PDE offset and check if it's a new one + // + PdeOffset = MiGetPdeOffset(Addr); + if (OldPdeOffset != PdeOffset) { // - // Request a page - // - Status = MmRequestPageMemoryConsumer(MC_NPPOOL, FALSE, &Pfn); - if (!NT_SUCCESS(Status)) return Status; + // Get rid of the old L2 Table, if this was the last PTE on it + // + MiUnmapPageTable(PointerPte); // - // Setup the PFN - // - TempPde.u.Hard.L1.Coarse.BaseAddress = (Pfn << PAGE_SHIFT) >> CPT_SHIFT; - - // - // Write the PDE - // - ASSERT(PointerPde->u.Hard.L1.Fault.Type == FaultPte); - ASSERT(TempPde.u.Hard.L1.Coarse.Type == CoarsePte); - *PointerPde = TempPde; - - // - // Get the PTE for this 1MB region - // - PointerPte = MiGetPteAddress(MiGetPteAddress(Address)); - - // - // Write the PFN of the PDE - // - TempPte.u.Hard.L2.Small.BaseAddress = Pfn; - - // - // Write the PTE - // - ASSERT(PointerPte->u.Hard.L2.Fault.Type == FaultPte); - ASSERT(TempPte.u.Hard.L2.Small.Type == SmallPte); - *PointerPte = TempPte; + // Get the PTE for this address, and create the PDE for it + // + PointerPte = MiGetPageTableForProcess(NULL, Addr, TRUE); + ASSERT(PointerPte); + } + else + { + // + // Go to the next PTE on this PDE + // + ASSERT(PointerPte); + PointerPte++; } // - // Next - // - PointerPde++; - } - - // - // Get start and end address and loop each PTE - // - PointerPte = MiGetPteAddress(Address); - LastPte = PointerPte + PageCount - 1; - while (PointerPte <= LastPte) - { + // Save the current PDE + // + OldPdeOffset = PdeOffset; + // // Mark it as mapped // @@ -447,9 +524,9 @@ *PointerPte = TempPte; // - // Next - // - PointerPte++; + // Move to the next page + // + Addr = (PVOID)((ULONG_PTR)Addr + PAGE_SIZE); } // @@ -468,7 +545,8 @@ // // Call the internal version // - return MmCreateVirtualMappingInternal(Address, + return MmCreateVirtualMappingInternal(NULL, + Address, Protection, Pages, PageCount, @@ -491,7 +569,8 @@ // // Call the internal version // - return MmCreateVirtualMappingInternal(Address, + return MmCreateVirtualMappingInternal(Process, + Address, Protection, Pages, PageCount,
16 years, 4 months
1
0
0
0
[ros-arm-bringup] 34975: dont include i386 headers in arm mmu manager headers.
by ros-arm-bringup@svn.reactos.org
Author: ros-arm-bringup Date: Thu Jul 31 02:07:00 2008 New Revision: 34975 URL:
http://svn.reactos.org/svn/reactos?rev=34975&view=rev
Log: dont include i386 headers in arm mmu manager headers. Modified: trunk/reactos/ntoskrnl/include/internal/arm/mm.h trunk/reactos/ntoskrnl/include/internal/i386/mm.h Modified: trunk/reactos/ntoskrnl/include/internal/arm/mm.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/include/internal/…
============================================================================== --- trunk/reactos/ntoskrnl/include/internal/arm/mm.h [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/include/internal/arm/mm.h [iso-8859-1] Thu Jul 31 02:07:00 2008 @@ -166,4 +166,7 @@ #define PDE_BASE 0xC1000000 #define HYPER_SPACE 0xC1100000 +struct _EPROCESS; +PULONG MmGetPageDirectory(VOID); + #endif Modified: trunk/reactos/ntoskrnl/include/internal/i386/mm.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/include/internal/…
============================================================================== --- trunk/reactos/ntoskrnl/include/internal/i386/mm.h [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/include/internal/i386/mm.h [iso-8859-1] Thu Jul 31 02:07:00 2008 @@ -4,6 +4,8 @@ #ifndef __NTOSKRNL_INCLUDE_INTERNAL_I386_MM_H #define __NTOSKRNL_INCLUDE_INTERNAL_I386_MM_H + +#ifdef _M_IX86 struct _EPROCESS; PULONG MmGetPageDirectory(VOID); @@ -28,4 +30,6 @@ /* Easy accessing PFN in PTE */ #define PFN_FROM_PTE(v) ((v)->u.Hard.PageFrameNumber) +#endif + #endif /* __NTOSKRNL_INCLUDE_INTERNAL_I386_MM_H */
16 years, 4 months
1
0
0
0
[ros-arm-bringup] 34974: implement kiuserinitializeapc, and begin writing test code for kiswapprocess.
by ros-arm-bringup@svn.reactos.org
Author: ros-arm-bringup Date: Thu Jul 31 02:06:19 2008 New Revision: 34974 URL:
http://svn.reactos.org/svn/reactos?rev=34974&view=rev
Log: implement kiuserinitializeapc, and begin writing test code for kiswapprocess. Modified: trunk/reactos/ntoskrnl/ke/arm/stubs_asm.s trunk/reactos/ntoskrnl/ke/arm/trapc.c trunk/reactos/ntoskrnl/ke/arm/usercall.c Modified: trunk/reactos/ntoskrnl/ke/arm/stubs_asm.s URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ke/arm/stubs_asm.…
============================================================================== --- trunk/reactos/ntoskrnl/ke/arm/stubs_asm.s [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/ke/arm/stubs_asm.s [iso-8859-1] Thu Jul 31 02:06:19 2008 @@ -32,8 +32,6 @@ // // User Mode Support // -GENERATE_ARM_STUB KiInitializeUserApc -GENERATE_ARM_STUB KiSwapProcess GENERATE_ARM_STUB KeSwitchKernelStack GENERATE_ARM_STUB RtlCreateUserThread GENERATE_ARM_STUB RtlInitializeContext Modified: trunk/reactos/ntoskrnl/ke/arm/trapc.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ke/arm/trapc.c?re…
============================================================================== --- trunk/reactos/ntoskrnl/ke/arm/trapc.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/ke/arm/trapc.c [iso-8859-1] Thu Jul 31 02:06:19 2008 @@ -85,6 +85,32 @@ KeArmWaitForInterrupt(); } } +} + +VOID +NTAPI +KiSwapProcess(IN PKPROCESS NewProcess, + IN PKPROCESS OldProcess) +{ + ARM_TTB_REGISTER TtbRegister; + DPRINT1("Swapping from: %p (%16s) to %p (%16s)\n", + OldProcess, ((PEPROCESS)OldProcess)->ImageFileName, + NewProcess, ((PEPROCESS)NewProcess)->ImageFileName); + + // + // Update the page directory base + // + TtbRegister.AsUlong = (ULONG)NewProcess->DirectoryTableBase.LowPart; + ASSERT(TtbRegister.Reserved == 0); + KeArmTranslationTableRegisterSet(TtbRegister); + + // + // FIXME: Flush the TLB + // + + + DPRINT1("Survived!\n"); + while (TRUE); } BOOLEAN Modified: trunk/reactos/ntoskrnl/ke/arm/usercall.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ke/arm/usercall.c…
============================================================================== --- trunk/reactos/ntoskrnl/ke/arm/usercall.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/ke/arm/usercall.c [iso-8859-1] Thu Jul 31 02:06:19 2008 @@ -261,3 +261,47 @@ // Thread->TrapFrame = (PKTRAP_FRAME)TrapFrame->PreviousTrapFrame; } + +VOID +NTAPI +KiInitializeUserApc(IN PKEXCEPTION_FRAME ExceptionFrame, + IN PKTRAP_FRAME TrapFrame, + IN PKNORMAL_ROUTINE NormalRoutine, + IN PVOID NormalContext, + IN PVOID SystemArgument1, + IN PVOID SystemArgument2) +{ + CONTEXT Context; + ULONG_PTR Stack; + ULONG ContextLength; + DPRINT1("User APC: %p %p %p\n", NormalContext, SystemArgument1, SystemArgument2); + + // + // Build the user mode context + // + Context.ContextFlags = CONTEXT_FULL; + KeTrapFrameToContext(TrapFrame, ExceptionFrame, &Context); + + // + // Setup the context on the user stack + // + ContextLength = sizeof(CONTEXT); + Stack = (ULONG_PTR)(Context.Sp & ~7) - ContextLength; + + // + // Make sure the stack is valid, and copy the context + // + ProbeForWrite((PVOID)Stack, ContextLength, sizeof(QUAD)); + RtlMoveMemory((PVOID)Stack, &Context, sizeof(CONTEXT)); + + // + // Setup the trap frame when we return to user mode + // + TrapFrame->R0 = (ULONG)NormalContext; + TrapFrame->R1 = (ULONG)SystemArgument1; + TrapFrame->R2 = (ULONG)SystemArgument2; + TrapFrame->R3 = (ULONG)NormalRoutine; + TrapFrame->R8 = Stack; + TrapFrame->UserSp = Stack; + TrapFrame->UserLr = (ULONG)KeUserApcDispatcher; +}
16 years, 4 months
1
0
0
0
[ros-arm-bringup] 34973: fix formatting of i386 mmu code.
by ros-arm-bringup@svn.reactos.org
Author: ros-arm-bringup Date: Thu Jul 31 02:04:58 2008 New Revision: 34973 URL:
http://svn.reactos.org/svn/reactos?rev=34973&view=rev
Log: fix formatting of i386 mmu code. Modified: trunk/reactos/ntoskrnl/mm/i386/page.c Modified: trunk/reactos/ntoskrnl/mm/i386/page.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/i386/page.c?re…
============================================================================== --- trunk/reactos/ntoskrnl/mm/i386/page.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/mm/i386/page.c [iso-8859-1] Thu Jul 31 02:04:58 2008 @@ -52,9 +52,9 @@ #else __inline LARGE_INTEGER PTE_TO_PAGE(ULONG npage) { - LARGE_INTEGER dummy; - dummy.QuadPart = (LONGLONG)(PAGE_MASK(npage)); - return dummy; + LARGE_INTEGER dummy; + dummy.QuadPart = (LONGLONG)(PAGE_MASK(npage)); + return dummy; } #endif @@ -66,28 +66,28 @@ NTAPI MiFlushTlbIpiRoutine(ULONG_PTR Address) { - if (Address == (ULONG_PTR)-1) - { - KeFlushCurrentTb(); - } - else if (Address == (ULONG_PTR)-2) - { - KeFlushCurrentTb(); - } - else - { - __invlpg((PVOID)Address); - } - return 0; + if (Address == (ULONG_PTR)-1) + { + KeFlushCurrentTb(); + } + else if (Address == (ULONG_PTR)-2) + { + KeFlushCurrentTb(); + } + else + { + __invlpg((PVOID)Address); + } + return 0; } VOID MiFlushTlb(PULONG Pt, PVOID Address) { - if ((Pt && MmUnmapPageTable(Pt)) || Address >= MmSystemRangeStart) - { - __invlpg(Address); - } + if ((Pt && MmUnmapPageTable(Pt)) || Address >= MmSystemRangeStart) + { + __invlpg(Address); + } } @@ -95,73 +95,73 @@ PULONG MmGetPageDirectory(VOID) { - return (PULONG)__readcr3(); + return (PULONG)__readcr3(); } static ULONG ProtectToPTE(ULONG flProtect) { - ULONG Attributes = 0; - - if (flProtect & (PAGE_NOACCESS|PAGE_GUARD)) - { - Attributes = 0; - } - else if (flProtect & PAGE_IS_WRITABLE) - { - Attributes = PA_PRESENT | PA_READWRITE; - } - else if (flProtect & (PAGE_IS_READABLE | PAGE_IS_EXECUTABLE)) - { - Attributes = PA_PRESENT; - } - else - { - DPRINT1("Unknown main protection type.\n"); - KEBUGCHECK(0); - } - - if (flProtect & PAGE_SYSTEM) - { - } - else - { - Attributes = Attributes | PA_USER; - } - if (flProtect & PAGE_NOCACHE) - { - Attributes = Attributes | PA_CD; - } - if (flProtect & PAGE_WRITETHROUGH) - { - Attributes = Attributes | PA_WT; - } - return(Attributes); + ULONG Attributes = 0; + + if (flProtect & (PAGE_NOACCESS|PAGE_GUARD)) + { + Attributes = 0; + } + else if (flProtect & PAGE_IS_WRITABLE) + { + Attributes = PA_PRESENT | PA_READWRITE; + } + else if (flProtect & (PAGE_IS_READABLE | PAGE_IS_EXECUTABLE)) + { + Attributes = PA_PRESENT; + } + else + { + DPRINT1("Unknown main protection type.\n"); + KEBUGCHECK(0); + } + + if (flProtect & PAGE_SYSTEM) + { + } + else + { + Attributes = Attributes | PA_USER; + } + if (flProtect & PAGE_NOCACHE) + { + Attributes = Attributes | PA_CD; + } + if (flProtect & PAGE_WRITETHROUGH) + { + Attributes = Attributes | PA_WT; + } + return(Attributes); } NTSTATUS NTAPI Mmi386ReleaseMmInfo(PEPROCESS Process) { - PUSHORT LdtDescriptor; - ULONG LdtBase; - PULONG PageDir; - ULONG i; - - DPRINT("Mmi386ReleaseMmInfo(Process %x)\n",Process); - - LdtDescriptor = (PUSHORT) &Process->Pcb.LdtDescriptor; - LdtBase = LdtDescriptor[1] | - ((LdtDescriptor[2] & 0xff) << 16) | - ((LdtDescriptor[3] & ~0xff) << 16); - - DPRINT("LdtBase: %x\n", LdtBase); - - if (LdtBase) - { - ExFreePool((PVOID) LdtBase); - } - + PUSHORT LdtDescriptor; + ULONG LdtBase; + PULONG PageDir; + ULONG i; + + DPRINT("Mmi386ReleaseMmInfo(Process %x)\n",Process); + + LdtDescriptor = (PUSHORT) &Process->Pcb.LdtDescriptor; + LdtBase = LdtDescriptor[1] | + ((LdtDescriptor[2] & 0xff) << 16) | + ((LdtDescriptor[3] & ~0xff) << 16); + + DPRINT("LdtBase: %x\n", LdtBase); + + if (LdtBase) + { + ExFreePool((PVOID) LdtBase); + } + PageDir = MmCreateHyperspaceMapping(PTE_TO_PFN(Process->Pcb.DirectoryTableBase.u.LowPart)); for (i = 0; i < ADDR_TO_PDE_OFFSET(MmSystemRangeStart); i++) { @@ -176,15 +176,15 @@ MmReleasePageMemoryConsumer(MC_NPPOOL, PTE_TO_PFN(Process->Pcb.DirectoryTableBase.u.LowPart)); #if defined(__GNUC__) - - Process->Pcb.DirectoryTableBase.QuadPart = 0LL; + + Process->Pcb.DirectoryTableBase.QuadPart = 0LL; #else - - Process->Pcb.DirectoryTableBase.QuadPart = 0; + + Process->Pcb.DirectoryTableBase.QuadPart = 0; #endif - - DPRINT("Finished Mmi386ReleaseMmInfo()\n"); - return(STATUS_SUCCESS); + + DPRINT("Finished Mmi386ReleaseMmInfo()\n"); + return(STATUS_SUCCESS); } NTSTATUS @@ -210,237 +210,237 @@ IN PEPROCESS Process, IN PLARGE_INTEGER DirectoryTableBase) { - NTSTATUS Status; - ULONG i, j; - PFN_TYPE Pfn[2]; - PULONG PageDirectory; - - DPRINT("MmCopyMmInfo(Src %x, Dest %x)\n", MinWs, Process); - - for (i = 0; i < 2; i++) - { - Status = MmRequestPageMemoryConsumer(MC_NPPOOL, FALSE, &Pfn[i]); - if (!NT_SUCCESS(Status)) - { - for (j = 0; j < i; j++) - { - MmReleasePageMemoryConsumer(MC_NPPOOL, Pfn[j]); - } - - return FALSE; - } - } - - PageDirectory = MmCreateHyperspaceMapping(Pfn[0]); - - memcpy(PageDirectory + ADDR_TO_PDE_OFFSET(MmSystemRangeStart), - MmGlobalKernelPageDirectory + ADDR_TO_PDE_OFFSET(MmSystemRangeStart), - (1024 - ADDR_TO_PDE_OFFSET(MmSystemRangeStart)) * sizeof(ULONG)); - - DPRINT("Addr %x\n",ADDR_TO_PDE_OFFSET(PAGETABLE_MAP)); - PageDirectory[ADDR_TO_PDE_OFFSET(PAGETABLE_MAP)] = PFN_TO_PTE(Pfn[0]) | PA_PRESENT | PA_READWRITE; - PageDirectory[ADDR_TO_PDE_OFFSET(HYPERSPACE)] = PFN_TO_PTE(Pfn[1]) | PA_PRESENT | PA_READWRITE; - - MmDeleteHyperspaceMapping(PageDirectory); - - DirectoryTableBase->QuadPart = PFN_TO_PTE(Pfn[0]); - DPRINT("Finished MmCopyMmInfo(): %I64x\n", DirectoryTableBase->QuadPart); - return TRUE; + NTSTATUS Status; + ULONG i, j; + PFN_TYPE Pfn[2]; + PULONG PageDirectory; + + DPRINT("MmCopyMmInfo(Src %x, Dest %x)\n", MinWs, Process); + + for (i = 0; i < 2; i++) + { + Status = MmRequestPageMemoryConsumer(MC_NPPOOL, FALSE, &Pfn[i]); + if (!NT_SUCCESS(Status)) + { + for (j = 0; j < i; j++) + { + MmReleasePageMemoryConsumer(MC_NPPOOL, Pfn[j]); + } + + return FALSE; + } + } + + PageDirectory = MmCreateHyperspaceMapping(Pfn[0]); + + memcpy(PageDirectory + ADDR_TO_PDE_OFFSET(MmSystemRangeStart), + MmGlobalKernelPageDirectory + ADDR_TO_PDE_OFFSET(MmSystemRangeStart), + (1024 - ADDR_TO_PDE_OFFSET(MmSystemRangeStart)) * sizeof(ULONG)); + + DPRINT("Addr %x\n",ADDR_TO_PDE_OFFSET(PAGETABLE_MAP)); + PageDirectory[ADDR_TO_PDE_OFFSET(PAGETABLE_MAP)] = PFN_TO_PTE(Pfn[0]) | PA_PRESENT | PA_READWRITE; + PageDirectory[ADDR_TO_PDE_OFFSET(HYPERSPACE)] = PFN_TO_PTE(Pfn[1]) | PA_PRESENT | PA_READWRITE; + + MmDeleteHyperspaceMapping(PageDirectory); + + DirectoryTableBase->QuadPart = PFN_TO_PTE(Pfn[0]); + DPRINT("Finished MmCopyMmInfo(): %I64x\n", DirectoryTableBase->QuadPart); + return TRUE; } VOID NTAPI MmDeletePageTable(PEPROCESS Process, PVOID Address) { - PEPROCESS CurrentProcess = PsGetCurrentProcess(); - - if (Process != NULL && Process != CurrentProcess) - { - KeAttachProcess(&Process->Pcb); - } - - MiAddressToPde(Address)->u.Long = 0; - MiFlushTlb((PULONG)MiAddressToPde(Address), - MiAddressToPte(Address)); - - if (Address >= MmSystemRangeStart) - { - KEBUGCHECK(0); - // MmGlobalKernelPageDirectory[ADDR_TO_PDE_OFFSET(Address)] = 0; - } - if (Process != NULL && Process != CurrentProcess) - { - KeDetachProcess(); - } + PEPROCESS CurrentProcess = PsGetCurrentProcess(); + + if (Process != NULL && Process != CurrentProcess) + { + KeAttachProcess(&Process->Pcb); + } + + MiAddressToPde(Address)->u.Long = 0; + MiFlushTlb((PULONG)MiAddressToPde(Address), + MiAddressToPte(Address)); + + if (Address >= MmSystemRangeStart) + { + KEBUGCHECK(0); + // MmGlobalKernelPageDirectory[ADDR_TO_PDE_OFFSET(Address)] = 0; + } + if (Process != NULL && Process != CurrentProcess) + { + KeDetachProcess(); + } } VOID NTAPI MmFreePageTable(PEPROCESS Process, PVOID Address) { - PEPROCESS CurrentProcess = PsGetCurrentProcess(); - ULONG i; - PFN_TYPE Pfn; - PULONG PageTable; - - DPRINT("ProcessId %d, Address %x\n", Process->UniqueProcessId, Address); - if (Process != NULL && Process != CurrentProcess) - { - KeAttachProcess(&Process->Pcb); - } - - PageTable = (PULONG)PAGE_ROUND_DOWN((PVOID)MiAddressToPte(Address)); - for (i = 0; i < 1024; i++) - { - if (PageTable[i] != 0) - { + PEPROCESS CurrentProcess = PsGetCurrentProcess(); + ULONG i; + PFN_TYPE Pfn; + PULONG PageTable; + + DPRINT("ProcessId %d, Address %x\n", Process->UniqueProcessId, Address); + if (Process != NULL && Process != CurrentProcess) + { + KeAttachProcess(&Process->Pcb); + } + + PageTable = (PULONG)PAGE_ROUND_DOWN((PVOID)MiAddressToPte(Address)); + for (i = 0; i < 1024; i++) + { + if (PageTable[i] != 0) + { DbgPrint("Page table entry not clear at %x/%x (is %x)\n", ((ULONG)Address / (4*1024*1024)), i, PageTable[i]); KEBUGCHECK(0); - } - } - Pfn = MiAddressToPde(Address)->u.Hard.PageFrameNumber; - MiAddressToPde(Address)->u.Long = 0; - MiFlushTlb((PULONG)MiAddressToPde(Address), MiAddressToPte(Address)); - - if (Address >= MmSystemRangeStart) - { - // MmGlobalKernelPageDirectory[ADDR_TO_PDE_OFFSET(Address)] = 0; - KEBUGCHECK(0); - } - else - { - MmReleasePageMemoryConsumer(MC_NPPOOL, Pfn); - } - if (Process != NULL && Process != CurrentProcess) - { - KeDetachProcess(); - } + } + } + Pfn = MiAddressToPde(Address)->u.Hard.PageFrameNumber; + MiAddressToPde(Address)->u.Long = 0; + MiFlushTlb((PULONG)MiAddressToPde(Address), MiAddressToPte(Address)); + + if (Address >= MmSystemRangeStart) + { + // MmGlobalKernelPageDirectory[ADDR_TO_PDE_OFFSET(Address)] = 0; + KEBUGCHECK(0); + } + else + { + MmReleasePageMemoryConsumer(MC_NPPOOL, Pfn); + } + if (Process != NULL && Process != CurrentProcess) + { + KeDetachProcess(); + } } static PULONG MmGetPageTableForProcess(PEPROCESS Process, PVOID Address, BOOLEAN Create) { - ULONG PdeOffset = ADDR_TO_PDE_OFFSET(Address); - NTSTATUS Status; - PFN_TYPE Pfn; - ULONG Entry; - PULONG Pt, PageDir; - - if (Address < MmSystemRangeStart && Process && Process != PsGetCurrentProcess()) - { - PageDir = MmCreateHyperspaceMapping(PTE_TO_PFN(Process->Pcb.DirectoryTableBase.LowPart)); - if (PageDir == NULL) - { - KEBUGCHECK(0); - } - if (0 == InterlockedCompareExchangeUL(&PageDir[PdeOffset], 0, 0)) - { - if (Create == FALSE) - { - MmDeleteHyperspaceMapping(PageDir); - return NULL; - } - Status = MmRequestPageMemoryConsumer(MC_NPPOOL, FALSE, &Pfn); - if (!NT_SUCCESS(Status) || Pfn == 0) - { - KEBUGCHECK(0); - } - Entry = InterlockedCompareExchangeUL(&PageDir[PdeOffset], PFN_TO_PTE(Pfn) | PA_PRESENT | PA_READWRITE | PA_USER, 0); - if (Entry != 0) - { - MmReleasePageMemoryConsumer(MC_NPPOOL, Pfn); - Pfn = PTE_TO_PFN(Entry); - } - } - else - { - Pfn = PTE_TO_PFN(PageDir[PdeOffset]); - } - MmDeleteHyperspaceMapping(PageDir); - Pt = MmCreateHyperspaceMapping(Pfn); - if (Pt == NULL) - { - KEBUGCHECK(0); - } - return Pt + ADDR_TO_PTE_OFFSET(Address); - } - PageDir = (PULONG)MiAddressToPde(Address); - if (0 == InterlockedCompareExchangeUL(PageDir, 0, 0)) - { - if (Address >= MmSystemRangeStart) - { - if (0 == InterlockedCompareExchangeUL(&MmGlobalKernelPageDirectory[PdeOffset], 0, 0)) - { - if (Create == FALSE) - { - return NULL; - } + ULONG PdeOffset = ADDR_TO_PDE_OFFSET(Address); + NTSTATUS Status; + PFN_TYPE Pfn; + ULONG Entry; + PULONG Pt, PageDir; + + if (Address < MmSystemRangeStart && Process && Process != PsGetCurrentProcess()) + { + PageDir = MmCreateHyperspaceMapping(PTE_TO_PFN(Process->Pcb.DirectoryTableBase.LowPart)); + if (PageDir == NULL) + { + KEBUGCHECK(0); + } + if (0 == InterlockedCompareExchangeUL(&PageDir[PdeOffset], 0, 0)) + { + if (Create == FALSE) + { + MmDeleteHyperspaceMapping(PageDir); + return NULL; + } Status = MmRequestPageMemoryConsumer(MC_NPPOOL, FALSE, &Pfn); - if (!NT_SUCCESS(Status) || Pfn == 0) - { - KEBUGCHECK(0); - } - Entry = PFN_TO_PTE(Pfn) | PA_PRESENT | PA_READWRITE; - if (Ke386GlobalPagesEnabled) - { - Entry |= PA_GLOBAL; - } - if(0 != InterlockedCompareExchangeUL(&MmGlobalKernelPageDirectory[PdeOffset], Entry, 0)) - { - MmReleasePageMemoryConsumer(MC_NPPOOL, Pfn); - } - } - (void)InterlockedExchangeUL(PageDir, MmGlobalKernelPageDirectory[PdeOffset]); - } - else - { - if (Create == FALSE) - { - return NULL; - } - Status = MmRequestPageMemoryConsumer(MC_NPPOOL, FALSE, &Pfn); - if (!NT_SUCCESS(Status) || Pfn == 0) - { - KEBUGCHECK(0); - } - Entry = InterlockedCompareExchangeUL(PageDir, PFN_TO_PTE(Pfn) | PA_PRESENT | PA_READWRITE | PA_USER, 0); - if (Entry != 0) - { - MmReleasePageMemoryConsumer(MC_NPPOOL, Pfn); - } - } - } - return (PULONG)MiAddressToPte(Address); + if (!NT_SUCCESS(Status) || Pfn == 0) + { + KEBUGCHECK(0); + } + Entry = InterlockedCompareExchangeUL(&PageDir[PdeOffset], PFN_TO_PTE(Pfn) | PA_PRESENT | PA_READWRITE | PA_USER, 0); + if (Entry != 0) + { + MmReleasePageMemoryConsumer(MC_NPPOOL, Pfn); + Pfn = PTE_TO_PFN(Entry); + } + } + else + { + Pfn = PTE_TO_PFN(PageDir[PdeOffset]); + } + MmDeleteHyperspaceMapping(PageDir); + Pt = MmCreateHyperspaceMapping(Pfn); + if (Pt == NULL) + { + KEBUGCHECK(0); + } + return Pt + ADDR_TO_PTE_OFFSET(Address); + } + PageDir = (PULONG)MiAddressToPde(Address); + if (0 == InterlockedCompareExchangeUL(PageDir, 0, 0)) + { + if (Address >= MmSystemRangeStart) + { + if (0 == InterlockedCompareExchangeUL(&MmGlobalKernelPageDirectory[PdeOffset], 0, 0)) + { + if (Create == FALSE) + { + return NULL; + } + Status = MmRequestPageMemoryConsumer(MC_NPPOOL, FALSE, &Pfn); + if (!NT_SUCCESS(Status) || Pfn == 0) + { + KEBUGCHECK(0); + } + Entry = PFN_TO_PTE(Pfn) | PA_PRESENT | PA_READWRITE; + if (Ke386GlobalPagesEnabled) + { + Entry |= PA_GLOBAL; + } + if(0 != InterlockedCompareExchangeUL(&MmGlobalKernelPageDirectory[PdeOffset], Entry, 0)) + { + MmReleasePageMemoryConsumer(MC_NPPOOL, Pfn); + } + } + (void)InterlockedExchangeUL(PageDir, MmGlobalKernelPageDirectory[PdeOffset]); + } + else + { + if (Create == FALSE) + { + return NULL; + } + Status = MmRequestPageMemoryConsumer(MC_NPPOOL, FALSE, &Pfn); + if (!NT_SUCCESS(Status) || Pfn == 0) + { + KEBUGCHECK(0); + } + Entry = InterlockedCompareExchangeUL(PageDir, PFN_TO_PTE(Pfn) | PA_PRESENT | PA_READWRITE | PA_USER, 0); + if (Entry != 0) + { + MmReleasePageMemoryConsumer(MC_NPPOOL, Pfn); + } + } + } + return (PULONG)MiAddressToPte(Address); } BOOLEAN MmUnmapPageTable(PULONG Pt) { - if (Pt >= (PULONG)PAGETABLE_MAP && Pt < (PULONG)PAGETABLE_MAP + 1024*1024) - { - return TRUE; - } - - if (Pt) - { - MmDeleteHyperspaceMapping((PVOID)PAGE_ROUND_DOWN(Pt)); - } - return FALSE; + if (Pt >= (PULONG)PAGETABLE_MAP && Pt < (PULONG)PAGETABLE_MAP + 1024*1024) + { + return TRUE; + } + + if (Pt) + { + MmDeleteHyperspaceMapping((PVOID)PAGE_ROUND_DOWN(Pt)); + } + return FALSE; } static ULONG MmGetPageEntryForProcess(PEPROCESS Process, PVOID Address) { - ULONG Pte; - PULONG Pt; - - Pt = MmGetPageTableForProcess(Process, Address, FALSE); - if (Pt) - { - Pte = *Pt; - MmUnmapPageTable(Pt); - return Pte; - } - return 0; + ULONG Pte; + PULONG Pt; + + Pt = MmGetPageTableForProcess(Process, Address, FALSE); + if (Pt) + { + Pte = *Pt; + MmUnmapPageTable(Pt); + return Pte; + } + return 0; } PFN_TYPE @@ -448,13 +448,13 @@ MmGetPfnForProcess(PEPROCESS Process, PVOID Address) { - ULONG Entry; - Entry = MmGetPageEntryForProcess(Process, Address); - if (!(Entry & PA_PRESENT)) - { - return 0; - } - return(PTE_TO_PFN(Entry)); + ULONG Entry; + Entry = MmGetPageEntryForProcess(Process, Address); + if (!(Entry & PA_PRESENT)) + { + return 0; + } + return(PTE_TO_PFN(Entry)); } VOID @@ -464,58 +464,58 @@ * FUNCTION: Delete a virtual mapping */ { - BOOLEAN WasValid; - ULONG Pte; - PULONG Pt; - - Pt = MmGetPageTableForProcess(Process, Address, FALSE); - if (Pt == NULL) - { - KEBUGCHECK(0); - } - /* - * Atomically disable the present bit and get the old value. - */ - do - { + BOOLEAN WasValid; + ULONG Pte; + PULONG Pt; + + Pt = MmGetPageTableForProcess(Process, Address, FALSE); + if (Pt == NULL) + { + KEBUGCHECK(0); + } + /* + * Atomically disable the present bit and get the old value. + */ + do + { Pte = *Pt; - } while (Pte != InterlockedCompareExchangeUL(Pt, Pte & ~PA_PRESENT, Pte)); - - MiFlushTlb(Pt, Address); - WasValid = (PAGE_MASK(Pte) != 0); - if (!WasValid) - { - KEBUGCHECK(0); - } - - /* - * Return some information to the caller - */ - if (WasDirty != NULL) - { - *WasDirty = Pte & PA_DIRTY; - } - if (Page != NULL) - { - *Page = PTE_TO_PFN(Pte); - } + } while (Pte != InterlockedCompareExchangeUL(Pt, Pte & ~PA_PRESENT, Pte)); + + MiFlushTlb(Pt, Address); + WasValid = (PAGE_MASK(Pte) != 0); + if (!WasValid) + { + KEBUGCHECK(0); + } + + /* + * Return some information to the caller + */ + if (WasDirty != NULL) + { + *WasDirty = Pte & PA_DIRTY; + } + if (Page != NULL) + { + *Page = PTE_TO_PFN(Pte); + } } VOID NTAPI MmRawDeleteVirtualMapping(PVOID Address) { - PULONG Pt; - - Pt = MmGetPageTableForProcess(NULL, Address, FALSE); - if (Pt && *Pt) - { - /* - * Set the entry to zero - */ - (void)InterlockedExchangeUL(Pt, 0); - MiFlushTlb(Pt, Address); - } + PULONG Pt; + + Pt = MmGetPageTableForProcess(NULL, Address, FALSE); + if (Pt && *Pt) + { + /* + * Set the entry to zero + */ + (void)InterlockedExchangeUL(Pt, 0); + MiFlushTlb(Pt, Address); + } } VOID @@ -526,63 +526,63 @@ * FUNCTION: Delete a virtual mapping */ { - BOOLEAN WasValid = FALSE; - PFN_TYPE Pfn; - ULONG Pte; - PULONG Pt; - - DPRINT("MmDeleteVirtualMapping(%x, %x, %d, %x, %x)\n", - Process, Address, FreePage, WasDirty, Page); - - Pt = MmGetPageTableForProcess(Process, Address, FALSE); - - if (Pt == NULL) - { - if (WasDirty != NULL) - { + BOOLEAN WasValid = FALSE; + PFN_TYPE Pfn; + ULONG Pte; + PULONG Pt; + + DPRINT("MmDeleteVirtualMapping(%x, %x, %d, %x, %x)\n", + Process, Address, FreePage, WasDirty, Page); + + Pt = MmGetPageTableForProcess(Process, Address, FALSE); + + if (Pt == NULL) + { + if (WasDirty != NULL) + { *WasDirty = FALSE; - } - if (Page != NULL) - { + } + if (Page != NULL) + { *Page = 0; - } - return; - } - - /* - * Atomically set the entry to zero and get the old value. - */ - Pte = InterlockedExchangeUL(Pt, 0); - - MiFlushTlb(Pt, Address); - - WasValid = (PAGE_MASK(Pte) != 0); - if (WasValid) - { - Pfn = PTE_TO_PFN(Pte); - MmMarkPageUnmapped(Pfn); - } - else - { - Pfn = 0; - } - - if (FreePage && WasValid) - { - MmReleasePageMemoryConsumer(MC_NPPOOL, Pfn); - } - - /* - * Return some information to the caller - */ - if (WasDirty != NULL) - { - *WasDirty = Pte & PA_DIRTY ? TRUE : FALSE; - } - if (Page != NULL) - { - *Page = Pfn; - } + } + return; + } + + /* + * Atomically set the entry to zero and get the old value. + */ + Pte = InterlockedExchangeUL(Pt, 0); + + MiFlushTlb(Pt, Address); + + WasValid = (PAGE_MASK(Pte) != 0); + if (WasValid) + { + Pfn = PTE_TO_PFN(Pte); + MmMarkPageUnmapped(Pfn); + } + else + { + Pfn = 0; + } + + if (FreePage && WasValid) + { + MmReleasePageMemoryConsumer(MC_NPPOOL, Pfn); + } + + /* + * Return some information to the caller + */ + if (WasDirty != NULL) + { + *WasDirty = Pte & PA_DIRTY ? TRUE : FALSE; + } + if (Page != NULL) + { + *Page = Pfn; + } } VOID @@ -593,51 +593,51 @@ * FUNCTION: Delete a virtual mapping */ { - ULONG Pte; - PULONG Pt; - - Pt = MmGetPageTableForProcess(Process, Address, FALSE); - - if (Pt == NULL) - { - *SwapEntry = 0; - return; - } - - /* - * Atomically set the entry to zero and get the old value. - */ - Pte = InterlockedExchangeUL(Pt, 0); - - MiFlushTlb(Pt, Address); - - /* - * Return some information to the caller - */ - *SwapEntry = Pte >> 1; + ULONG Pte; + PULONG Pt; + + Pt = MmGetPageTableForProcess(Process, Address, FALSE); + + if (Pt == NULL) + { + *SwapEntry = 0; + return; + } + + /* + * Atomically set the entry to zero and get the old value. + */ + Pte = InterlockedExchangeUL(Pt, 0); + + MiFlushTlb(Pt, Address); + + /* + * Return some information to the caller + */ + *SwapEntry = Pte >> 1; } BOOLEAN Mmi386MakeKernelPageTableGlobal(PVOID PAddress) { - PULONG Pt, Pde; - Pde = (PULONG)MiAddressToPde(PAddress); - if (*Pde == 0) - { - Pt = MmGetPageTableForProcess(NULL, PAddress, FALSE); - if (Pt != NULL) - { + PULONG Pt, Pde; + Pde = (PULONG)MiAddressToPde(PAddress); + if (*Pde == 0) + { + Pt = MmGetPageTableForProcess(NULL, PAddress, FALSE); + if (Pt != NULL) + { return TRUE; - } - } - return(FALSE); + } + } + return(FALSE); } BOOLEAN NTAPI MmIsDirtyPage(PEPROCESS Process, PVOID Address) { - return MmGetPageEntryForProcess(Process, Address) & PA_DIRTY ? TRUE : FALSE; + return MmGetPageEntryForProcess(Process, Address) & PA_DIRTY ? TRUE : FALSE; } BOOLEAN @@ -646,24 +646,24 @@ { PULONG Pt; ULONG Pte; - + if (Address < MmSystemRangeStart && Process == NULL) { DPRINT1("MmIsAccessedAndResetAccessPage is called for user space without a process.\n"); KEBUGCHECK(0); } - + Pt = MmGetPageTableForProcess(Process, Address, FALSE); if (Pt == NULL) { KEBUGCHECK(0); } - + do { Pte = *Pt; } while (Pte != InterlockedCompareExchangeUL(Pt, Pte & ~PA_ACCESSED, Pte)); - + if (Pte & PA_ACCESSED) { MiFlushTlb(Pt, Address); @@ -682,25 +682,25 @@ { PULONG Pt; ULONG Pte; - + if (Address < MmSystemRangeStart && Process == NULL) { DPRINT1("MmSetCleanPage is called for user space without a process.\n"); KEBUGCHECK(0); } - + Pt = MmGetPageTableForProcess(Process, Address, FALSE); - + if (Pt == NULL) { KEBUGCHECK(0); } - + do { Pte = *Pt; } while (Pte != InterlockedCompareExchangeUL(Pt, Pte & ~PA_DIRTY, Pte)); - + if (Pte & PA_DIRTY) { MiFlushTlb(Pt, Address); @@ -715,76 +715,76 @@ NTAPI MmSetDirtyPage(PEPROCESS Process, PVOID Address) { - PULONG Pt; - ULONG Pte; - - if (Address < MmSystemRangeStart && Process == NULL) - { - DPRINT1("MmSetDirtyPage is called for user space without a process.\n"); - KEBUGCHECK(0); - } - - Pt = MmGetPageTableForProcess(Process, Address, FALSE); - if (Pt == NULL) - { - KEBUGCHECK(0); - } - - do - { - Pte = *Pt; - } while (Pte != InterlockedCompareExchangeUL(Pt, Pte | PA_DIRTY, Pte)); - if (!(Pte & PA_DIRTY)) - { - MiFlushTlb(Pt, Address); - } - else - { - MmUnmapPageTable(Pt); - } + PULONG Pt; + ULONG Pte; + + if (Address < MmSystemRangeStart && Process == NULL) + { + DPRINT1("MmSetDirtyPage is called for user space without a process.\n"); + KEBUGCHECK(0); + } + + Pt = MmGetPageTableForProcess(Process, Address, FALSE); + if (Pt == NULL) + { + KEBUGCHECK(0); + } + + do + { + Pte = *Pt; + } while (Pte != InterlockedCompareExchangeUL(Pt, Pte | PA_DIRTY, Pte)); + if (!(Pte & PA_DIRTY)) + { + MiFlushTlb(Pt, Address); + } + else + { + MmUnmapPageTable(Pt); + } } VOID NTAPI MmEnableVirtualMapping(PEPROCESS Process, PVOID Address) { - PULONG Pt; - ULONG Pte; - - Pt = MmGetPageTableForProcess(Process, Address, FALSE); - if (Pt == NULL) - { - KEBUGCHECK(0); - } - - do - { - Pte = *Pt; - } while (Pte != InterlockedCompareExchangeUL(Pt, Pte | PA_PRESENT, Pte)); - if (!(Pte & PA_PRESENT)) - { - MiFlushTlb(Pt, Address); - } - else - { - MmUnmapPageTable(Pt); - } + PULONG Pt; + ULONG Pte; + + Pt = MmGetPageTableForProcess(Process, Address, FALSE); + if (Pt == NULL) + { + KEBUGCHECK(0); + } + + do + { + Pte = *Pt; + } while (Pte != InterlockedCompareExchangeUL(Pt, Pte | PA_PRESENT, Pte)); + if (!(Pte & PA_PRESENT)) + { + MiFlushTlb(Pt, Address); + } + else + { + MmUnmapPageTable(Pt); + } } BOOLEAN NTAPI MmIsPagePresent(PEPROCESS Process, PVOID Address) { - return MmGetPageEntryForProcess(Process, Address) & PA_PRESENT ? TRUE : FALSE; + return MmGetPageEntryForProcess(Process, Address) & PA_PRESENT ? TRUE : FALSE; } BOOLEAN NTAPI MmIsPageSwapEntry(PEPROCESS Process, PVOID Address) { - ULONG Entry; - Entry = MmGetPageEntryForProcess(Process, Address); - return !(Entry & PA_PRESENT) && Entry != 0 ? TRUE : FALSE; + ULONG Entry; + Entry = MmGetPageEntryForProcess(Process, Address); + return !(Entry & PA_PRESENT) && Entry != 0 ? TRUE : FALSE; } NTSTATUS @@ -792,80 +792,80 @@ MmCreateVirtualMappingForKernel(PVOID Address, ULONG flProtect, PPFN_TYPE Pages, - ULONG PageCount) -{ - ULONG Attributes; - ULONG i; - PVOID Addr; - ULONG PdeOffset, oldPdeOffset; - PULONG Pt; - ULONG Pte; - BOOLEAN NoExecute = FALSE; - - DPRINT("MmCreateVirtualMappingForKernel(%x, %x, %x, %d)\n", + ULONG PageCount) +{ + ULONG Attributes; + ULONG i; + PVOID Addr; + ULONG PdeOffset, oldPdeOffset; + PULONG Pt; + ULONG Pte; + BOOLEAN NoExecute = FALSE; + + DPRINT("MmCreateVirtualMappingForKernel(%x, %x, %x, %d)\n", Address, flProtect, Pages, PageCount); - - if (Address < MmSystemRangeStart) - { - DPRINT1("MmCreateVirtualMappingForKernel is called for user space\n"); - KEBUGCHECK(0); - } - - Attributes = ProtectToPTE(flProtect); - if (Attributes & 0x80000000) - { - NoExecute = TRUE; - } - Attributes &= 0xfff; - if (Ke386GlobalPagesEnabled) - { - Attributes |= PA_GLOBAL; - } - - Addr = Address; - - oldPdeOffset = ADDR_TO_PDE_OFFSET(Addr); - Pt = MmGetPageTableForProcess(NULL, Addr, TRUE); - if (Pt == NULL) - { - KEBUGCHECK(0); - } - Pt--; - - for (i = 0; i < PageCount; i++, Addr = (PVOID)((ULONG_PTR)Addr + PAGE_SIZE)) - { - if (!(Attributes & PA_PRESENT) && Pages[i] != 0) - { + + if (Address < MmSystemRangeStart) + { + DPRINT1("MmCreateVirtualMappingForKernel is called for user space\n"); + KEBUGCHECK(0); + } + + Attributes = ProtectToPTE(flProtect); + if (Attributes & 0x80000000) + { + NoExecute = TRUE; + } + Attributes &= 0xfff; + if (Ke386GlobalPagesEnabled) + { + Attributes |= PA_GLOBAL; + } + + Addr = Address; + + oldPdeOffset = ADDR_TO_PDE_OFFSET(Addr); + Pt = MmGetPageTableForProcess(NULL, Addr, TRUE); + if (Pt == NULL) + { + KEBUGCHECK(0); + } + Pt--; + + for (i = 0; i < PageCount; i++, Addr = (PVOID)((ULONG_PTR)Addr + PAGE_SIZE)) + { + if (!(Attributes & PA_PRESENT) && Pages[i] != 0) + { DPRINT1("Setting physical address but not allowing access at address " "0x%.8X with attributes %x/%x.\n", Addr, Attributes, flProtect); KEBUGCHECK(0); - } - - PdeOffset = ADDR_TO_PDE_OFFSET(Addr); - if (oldPdeOffset != PdeOffset) - { + } + + PdeOffset = ADDR_TO_PDE_OFFSET(Addr); + if (oldPdeOffset != PdeOffset) + { Pt = MmGetPageTableForProcess(NULL, Addr, TRUE); - if (Pt == NULL) - { - KEBUGCHECK(0); - } - } - else - { + if (Pt == NULL) + { + KEBUGCHECK(0); + } + } + else + { Pt++; - } - oldPdeOffset = PdeOffset; - - Pte = *Pt; - if (Pte != 0) - { + } + oldPdeOffset = PdeOffset; + + Pte = *Pt; + if (Pte != 0) + { KEBUGCHECK(0); - } - (void)InterlockedExchangeUL(Pt, PFN_TO_PTE(Pages[i]) | Attributes); - } - - return(STATUS_SUCCESS); + } + (void)InterlockedExchangeUL(Pt, PFN_TO_PTE(Pages[i]) | Attributes); + } + + return(STATUS_SUCCESS); } NTSTATUS @@ -874,45 +874,45 @@ PVOID Address, SWAPENTRY SwapEntry) { - PULONG Pt; - ULONG Pte; - - if (Process == NULL && Address < MmSystemRangeStart) - { - DPRINT1("No process\n"); - KEBUGCHECK(0); - } - if (Process != NULL && Address >= MmSystemRangeStart) - { - DPRINT1("Setting kernel address with process context\n"); - KEBUGCHECK(0); - } - if (SwapEntry & (1 << 31)) - { - KEBUGCHECK(0); - } - - Pt = MmGetPageTableForProcess(Process, Address, TRUE); - if (Pt == NULL) - { - KEBUGCHECK(0); - } - Pte = *Pt; - if (PAGE_MASK((Pte)) != 0) - { - MmMarkPageUnmapped(PTE_TO_PFN((Pte))); - } - (void)InterlockedExchangeUL(Pt, SwapEntry << 1); - if (Pte != 0) - { - MiFlushTlb(Pt, Address); - } - else - { - MmUnmapPageTable(Pt); - } - - return(STATUS_SUCCESS); + PULONG Pt; + ULONG Pte; + + if (Process == NULL && Address < MmSystemRangeStart) + { + DPRINT1("No process\n"); + KEBUGCHECK(0); + } + if (Process != NULL && Address >= MmSystemRangeStart) + { + DPRINT1("Setting kernel address with process context\n"); + KEBUGCHECK(0); + } + if (SwapEntry & (1 << 31)) + { + KEBUGCHECK(0); + } + + Pt = MmGetPageTableForProcess(Process, Address, TRUE); + if (Pt == NULL) + { + KEBUGCHECK(0); + } + Pte = *Pt; + if (PAGE_MASK((Pte)) != 0) + { + MmMarkPageUnmapped(PTE_TO_PFN((Pte))); + } + (void)InterlockedExchangeUL(Pt, SwapEntry << 1); + if (Pte != 0) + { + MiFlushTlb(Pt, Address); + } + else + { + MmUnmapPageTable(Pt); + } + + return(STATUS_SUCCESS); } @@ -924,119 +924,119 @@ PPFN_TYPE Pages, ULONG PageCount) { - ULONG Attributes; - PVOID Addr; - ULONG i; - ULONG oldPdeOffset, PdeOffset; - PULONG Pt = NULL; - ULONG Pte; - BOOLEAN NoExecute = FALSE; - - DPRINT("MmCreateVirtualMappingUnsafe(%x, %x, %x, %x (%x), %d)\n", - Process, Address, flProtect, Pages, *Pages, PageCount); - - if (Process == NULL) - { - if (Address < MmSystemRangeStart) - { - DPRINT1("No process\n"); - KEBUGCHECK(0); - } - if (PageCount > 0x10000 || - (ULONG_PTR) Address / PAGE_SIZE + PageCount > 0x100000) - { - DPRINT1("Page count to large\n"); - KEBUGCHECK(0); - } - } - else - { - if (Address >= MmSystemRangeStart) - { - DPRINT1("Setting kernel address with process context\n"); - KEBUGCHECK(0); - } - if (PageCount > (ULONG_PTR)MmSystemRangeStart / PAGE_SIZE || - (ULONG_PTR) Address / PAGE_SIZE + PageCount > - (ULONG_PTR)MmSystemRangeStart / PAGE_SIZE) - { - DPRINT1("Page Count to large\n"); - KEBUGCHECK(0); - } - } - - Attributes = ProtectToPTE(flProtect); - if (Attributes & 0x80000000) - { - NoExecute = TRUE; - } - Attributes &= 0xfff; - if (Address >= MmSystemRangeStart) - { - Attributes &= ~PA_USER; - if (Ke386GlobalPagesEnabled) - { - Attributes |= PA_GLOBAL; - } - } - else - { - Attributes |= PA_USER; - } - - Addr = Address; - oldPdeOffset = ADDR_TO_PDE_OFFSET(Addr) + 1; - for (i = 0; i < PageCount; i++, Addr = (PVOID)((ULONG_PTR)Addr + PAGE_SIZE)) - { - if (!(Attributes & PA_PRESENT) && Pages[i] != 0) - { + ULONG Attributes; + PVOID Addr; + ULONG i; + ULONG oldPdeOffset, PdeOffset; + PULONG Pt = NULL; + ULONG Pte; + BOOLEAN NoExecute = FALSE; + + DPRINT("MmCreateVirtualMappingUnsafe(%x, %x, %x, %x (%x), %d)\n", + Process, Address, flProtect, Pages, *Pages, PageCount); + + if (Process == NULL) + { + if (Address < MmSystemRangeStart) + { + DPRINT1("No process\n"); + KEBUGCHECK(0); + } + if (PageCount > 0x10000 || + (ULONG_PTR) Address / PAGE_SIZE + PageCount > 0x100000) + { + DPRINT1("Page count to large\n"); + KEBUGCHECK(0); + } + } + else + { + if (Address >= MmSystemRangeStart) + { + DPRINT1("Setting kernel address with process context\n"); + KEBUGCHECK(0); + } + if (PageCount > (ULONG_PTR)MmSystemRangeStart / PAGE_SIZE || + (ULONG_PTR) Address / PAGE_SIZE + PageCount > + (ULONG_PTR)MmSystemRangeStart / PAGE_SIZE) + { + DPRINT1("Page Count to large\n"); + KEBUGCHECK(0); + } + } + + Attributes = ProtectToPTE(flProtect); + if (Attributes & 0x80000000) + { + NoExecute = TRUE; + } + Attributes &= 0xfff; + if (Address >= MmSystemRangeStart) + { + Attributes &= ~PA_USER; + if (Ke386GlobalPagesEnabled) + { + Attributes |= PA_GLOBAL; + } + } + else + { + Attributes |= PA_USER; + } + + Addr = Address; + oldPdeOffset = ADDR_TO_PDE_OFFSET(Addr) + 1; + for (i = 0; i < PageCount; i++, Addr = (PVOID)((ULONG_PTR)Addr + PAGE_SIZE)) + { + if (!(Attributes & PA_PRESENT) && Pages[i] != 0) + { DPRINT1("Setting physical address but not allowing access at address " "0x%.8X with attributes %x/%x.\n", Addr, Attributes, flProtect); KEBUGCHECK(0); - } - PdeOffset = ADDR_TO_PDE_OFFSET(Addr); - if (oldPdeOffset != PdeOffset) - { + } + PdeOffset = ADDR_TO_PDE_OFFSET(Addr); + if (oldPdeOffset != PdeOffset) + { MmUnmapPageTable(Pt); - Pt = MmGetPageTableForProcess(Process, Addr, TRUE); - if (Pt == NULL) - { - KEBUGCHECK(0); - } - } - else - { + Pt = MmGetPageTableForProcess(Process, Addr, TRUE); + if (Pt == NULL) + { + KEBUGCHECK(0); + } + } + else + { Pt++; - } - oldPdeOffset = PdeOffset; - - Pte = *Pt; - MmMarkPageMapped(Pages[i]); - if (PAGE_MASK((Pte)) != 0 && !((Pte) & PA_PRESENT)) - { + } + oldPdeOffset = PdeOffset; + + Pte = *Pt; + MmMarkPageMapped(Pages[i]); + if (PAGE_MASK((Pte)) != 0 && !((Pte) & PA_PRESENT)) + { KEBUGCHECK(0); - } - if (PAGE_MASK((Pte)) != 0) - { + } + if (PAGE_MASK((Pte)) != 0) + { MmMarkPageUnmapped(PTE_TO_PFN((Pte))); - } - (void)InterlockedExchangeUL(Pt, PFN_TO_PTE(Pages[i]) | Attributes); - if (Pte != 0) - { + } + (void)InterlockedExchangeUL(Pt, PFN_TO_PTE(Pages[i]) | Attributes); + if (Pte != 0) + { if (Address > MmSystemRangeStart || (Pt >= (PULONG)PAGETABLE_MAP && Pt < (PULONG)PAGETABLE_MAP + 1024*1024)) { - MiFlushTlb(Pt, Address); - } - } - } - if (Addr > Address) - { - MmUnmapPageTable(Pt); - } - - return(STATUS_SUCCESS); + MiFlushTlb(Pt, Address); + } + } + } + if (Addr > Address) + { + MmUnmapPageTable(Pt); + } + + return(STATUS_SUCCESS); } NTSTATUS @@ -1047,102 +1047,102 @@ PPFN_TYPE Pages, ULONG PageCount) { - ULONG i; - - for (i = 0; i < PageCount; i++) - { - if (!MmIsPageInUse(Pages[i])) - { - DPRINT1("Page at address %x not in use\n", PFN_TO_PTE(Pages[i])); - KEBUGCHECK(0); - } - } - - return(MmCreateVirtualMappingUnsafe(Process, - Address, - flProtect, - Pages, - PageCount)); + ULONG i; + + for (i = 0; i < PageCount; i++) + { + if (!MmIsPageInUse(Pages[i])) + { + DPRINT1("Page at address %x not in use\n", PFN_TO_PTE(Pages[i])); + KEBUGCHECK(0); + } + } + + return(MmCreateVirtualMappingUnsafe(Process, + Address, + flProtect, + Pages, + PageCount)); } ULONG NTAPI MmGetPageProtect(PEPROCESS Process, PVOID Address) { - ULONG Entry; - ULONG Protect; - - Entry = MmGetPageEntryForProcess(Process, Address); - - - if (!(Entry & PA_PRESENT)) - { - Protect = PAGE_NOACCESS; - } - else - { - if (Entry & PA_READWRITE) - { - Protect = PAGE_READWRITE; - } - else - { - Protect = PAGE_EXECUTE_READ; - } - if (Entry & PA_CD) - { - Protect |= PAGE_NOCACHE; - } - if (Entry & PA_WT) - { - Protect |= PAGE_WRITETHROUGH; - } - if (!(Entry & PA_USER)) - { - Protect |= PAGE_SYSTEM; - } - - } - return(Protect); + ULONG Entry; + ULONG Protect; + + Entry = MmGetPageEntryForProcess(Process, Address); + + + if (!(Entry & PA_PRESENT)) + { + Protect = PAGE_NOACCESS; + } + else + { + if (Entry & PA_READWRITE) + { + Protect = PAGE_READWRITE; + } + else + { + Protect = PAGE_EXECUTE_READ; + } + if (Entry & PA_CD) + { + Protect |= PAGE_NOCACHE; + } + if (Entry & PA_WT) + { + Protect |= PAGE_WRITETHROUGH; + } + if (!(Entry & PA_USER)) + { + Protect |= PAGE_SYSTEM; + } + + } + return(Protect); } VOID NTAPI MmSetPageProtect(PEPROCESS Process, PVOID Address, ULONG flProtect) { - ULONG Attributes = 0; - BOOLEAN NoExecute = FALSE; - PULONG Pt; - - DPRINT("MmSetPageProtect(Process %x Address %x flProtect %x)\n", - Process, Address, flProtect); - - Attributes = ProtectToPTE(flProtect); - if (Attributes & 0x80000000) - { - NoExecute = TRUE; - } - Attributes &= 0xfff; - if (Address >= MmSystemRangeStart) - { - Attributes &= ~PA_USER; - if (Ke386GlobalPagesEnabled) - { - Attributes |= PA_GLOBAL; - } - } - else - { - Attributes |= PA_USER; - } - - Pt = MmGetPageTableForProcess(Process, Address, FALSE); - if (Pt == NULL) - { - KEBUGCHECK(0); - } - InterlockedExchange((PLONG)Pt, PAGE_MASK(*Pt) | Attributes | (*Pt & (PA_ACCESSED|PA_DIRTY))); - MiFlushTlb(Pt, Address); + ULONG Attributes = 0; + BOOLEAN NoExecute = FALSE; + PULONG Pt; + + DPRINT("MmSetPageProtect(Process %x Address %x flProtect %x)\n", + Process, Address, flProtect); + + Attributes = ProtectToPTE(flProtect); + if (Attributes & 0x80000000) + { + NoExecute = TRUE; + } + Attributes &= 0xfff; + if (Address >= MmSystemRangeStart) + { + Attributes &= ~PA_USER; + if (Ke386GlobalPagesEnabled) + { + Attributes |= PA_GLOBAL; + } + } + else + { + Attributes |= PA_USER; + } + + Pt = MmGetPageTableForProcess(Process, Address, FALSE); + if (Pt == NULL) + { + KEBUGCHECK(0); + } + InterlockedExchange((PLONG)Pt, PAGE_MASK(*Pt) | Attributes | (*Pt & (PA_ACCESSED|PA_DIRTY))); + MiFlushTlb(Pt, Address); } /* @@ -1154,155 +1154,155 @@ * FUNCTION: Returns the physical address corresponding to a virtual address */ { - PHYSICAL_ADDRESS p; - ULONG Pte; - - DPRINT("MmGetPhysicalAddress(vaddr %x)\n", vaddr); - Pte = MmGetPageEntryForProcess(NULL, vaddr); - if (Pte != 0 && Pte & PA_PRESENT) - { - p.QuadPart = PAGE_MASK(Pte); - p.u.LowPart |= (ULONG_PTR)vaddr & (PAGE_SIZE - 1); - } - else - { - p.QuadPart = 0; - } - return p; + PHYSICAL_ADDRESS p; + ULONG Pte; + + DPRINT("MmGetPhysicalAddress(vaddr %x)\n", vaddr); + Pte = MmGetPageEntryForProcess(NULL, vaddr); + if (Pte != 0 && Pte & PA_PRESENT) + { + p.QuadPart = PAGE_MASK(Pte); + p.u.LowPart |= (ULONG_PTR)vaddr & (PAGE_SIZE - 1); + } + else + { + p.QuadPart = 0; + } + return p; } PVOID NTAPI MmCreateHyperspaceMapping(PFN_TYPE Page) { - PVOID Address; - ULONG i; - - ULONG Entry; - PULONG Pte; - Entry = PFN_TO_PTE(Page) | PA_PRESENT | PA_READWRITE; - Pte = (PULONG)MiAddressToPte(HYPERSPACE) + Page % 1024; - if (Page & 1024) - { - for (i = Page % 1024; i < 1024; i++, Pte++) - { + PVOID Address; + ULONG i; + + ULONG Entry; + PULONG Pte; + Entry = PFN_TO_PTE(Page) | PA_PRESENT | PA_READWRITE; + Pte = (PULONG)MiAddressToPte(HYPERSPACE) + Page % 1024; + if (Page & 1024) + { + for (i = Page % 1024; i < 1024; i++, Pte++) + { if (0 == InterlockedCompareExchange((PLONG)Pte, (LONG)Entry, 0)) { - break; - } - } - if (i >= 1024) - { + break; + } + } + if (i >= 1024) + { Pte = (PULONG)MiAddressToPte(HYPERSPACE); for (i = 0; i < Page % 1024; i++, Pte++) { - if (0 == InterlockedCompareExchange((PLONG)Pte, (LONG)Entry, 0)) - { - break; - } + if (0 == InterlockedCompareExchange((PLONG)Pte, (LONG)Entry, 0)) + { + break; + } } if (i >= Page % 1024) { - KEBUGCHECK(0); - } - } - } - else - { - for (i = Page % 1024; (LONG)i >= 0; i--, Pte--) - { + KEBUGCHECK(0); + } + } + } + else + { + for (i = Page % 1024; (LONG)i >= 0; i--, Pte--) + { if (0 == InterlockedCompareExchange((PLONG)Pte, (LONG)Entry, 0)) { - break; - } - } - if ((LONG)i < 0) - { + break; + } + } + if ((LONG)i < 0) + { Pte = (PULONG)MiAddressToPte(HYPERSPACE) + 1023; for (i = 1023; i > Page % 1024; i--, Pte--) { - if (0 == InterlockedCompareExchange((PLONG)Pte, (LONG)Entry, 0)) - { - break; - } + if (0 == InterlockedCompareExchange((PLONG)Pte, (LONG)Entry, 0)) + { + break; + } } if (i <= Page % 1024) { - KEBUGCHECK(0); - } - } - } - Address = (PVOID)((ULONG_PTR)HYPERSPACE + i * PAGE_SIZE); - __invlpg(Address); - return Address; + KEBUGCHECK(0); + } + } + } + Address = (PVOID)((ULONG_PTR)HYPERSPACE + i * PAGE_SIZE); + __invlpg(Address); + return Address; } PFN_TYPE NTAPI MmChangeHyperspaceMapping(PVOID Address, PFN_TYPE NewPage) { - PFN_TYPE Pfn; - ULONG Entry; - - ASSERT (IS_HYPERSPACE(Address)); - - Entry = InterlockedExchange((PLONG)MiAddressToPte(Address), PFN_TO_PTE(NewPage) | PA_PRESENT | PA_READWRITE); - Pfn = PTE_TO_PFN(Entry); - - __invlpg(Address); - return Pfn; + PFN_TYPE Pfn; + ULONG Entry; + + ASSERT (IS_HYPERSPACE(Address)); + + Entry = InterlockedExchange((PLONG)MiAddressToPte(Address), PFN_TO_PTE(NewPage) | PA_PRESENT | PA_READWRITE); + Pfn = PTE_TO_PFN(Entry); + + __invlpg(Address); + return Pfn; } PFN_TYPE NTAPI MmDeleteHyperspaceMapping(PVOID Address) { - PFN_TYPE Pfn; - ULONG Entry; - - ASSERT (IS_HYPERSPACE(Address)); - - Entry = InterlockedExchange((PLONG)MiAddressToPte(Address), 0); - Pfn = PTE_TO_PFN(Entry); - - __invlpg(Address); - return Pfn; + PFN_TYPE Pfn; + ULONG Entry; + + ASSERT (IS_HYPERSPACE(Address)); + + Entry = InterlockedExchange((PLONG)MiAddressToPte(Address), 0); + Pfn = PTE_TO_PFN(Entry); + + __invlpg(Address); + return Pfn; } VOID NTAPI MmUpdatePageDir(PEPROCESS Process, PVOID Address, ULONG Size) { - ULONG StartOffset, EndOffset, Offset; - PULONG Pde; - - if (Address < MmSystemRangeStart) - { - KEBUGCHECK(0); - } - - StartOffset = ADDR_TO_PDE_OFFSET(Address); - EndOffset = ADDR_TO_PDE_OFFSET((PVOID)((ULONG_PTR)Address + Size)); - - if (Process != NULL && Process != PsGetCurrentProcess()) - { - Pde = MmCreateHyperspaceMapping(PTE_TO_PFN(Process->Pcb.DirectoryTableBase.u.LowPart)); - } - else - { - Pde = (PULONG)PAGEDIRECTORY_MAP; - } - for (Offset = StartOffset; Offset <= EndOffset; Offset++) - { - if (Offset != ADDR_TO_PDE_OFFSET(PAGETABLE_MAP)) - { + ULONG StartOffset, EndOffset, Offset; + PULONG Pde; + + if (Address < MmSystemRangeStart) + { + KEBUGCHECK(0); + } + + StartOffset = ADDR_TO_PDE_OFFSET(Address); + EndOffset = ADDR_TO_PDE_OFFSET((PVOID)((ULONG_PTR)Address + Size)); + + if (Process != NULL && Process != PsGetCurrentProcess()) + { + Pde = MmCreateHyperspaceMapping(PTE_TO_PFN(Process->Pcb.DirectoryTableBase.u.LowPart)); + } + else + { + Pde = (PULONG)PAGEDIRECTORY_MAP; + } + for (Offset = StartOffset; Offset <= EndOffset; Offset++) + { + if (Offset != ADDR_TO_PDE_OFFSET(PAGETABLE_MAP)) + { (void)InterlockedCompareExchangeUL(&Pde[Offset], MmGlobalKernelPageDirectory[Offset], 0); - } - } - if (Pde != (PULONG)PAGEDIRECTORY_MAP) - { - MmDeleteHyperspaceMapping(Pde); - } + } + } + if (Pde != (PULONG)PAGEDIRECTORY_MAP) + { + MmDeleteHyperspaceMapping(Pde); + } } VOID @@ -1310,25 +1310,25 @@ NTAPI MmInitGlobalKernelPageDirectory(VOID) { - ULONG i; - PULONG CurrentPageDirectory = (PULONG)PAGEDIRECTORY_MAP; - - DPRINT("MmInitGlobalKernelPageDirectory()\n"); - - for (i = ADDR_TO_PDE_OFFSET(MmSystemRangeStart); i < 1024; i++) - { - if (i != ADDR_TO_PDE_OFFSET(PAGETABLE_MAP) && - i != ADDR_TO_PDE_OFFSET(HYPERSPACE) && - 0 == MmGlobalKernelPageDirectory[i] && 0 != CurrentPageDirectory[i]) - { + ULONG i; + PULONG CurrentPageDirectory = (PULONG)PAGEDIRECTORY_MAP; + + DPRINT("MmInitGlobalKernelPageDirectory()\n"); + + for (i = ADDR_TO_PDE_OFFSET(MmSystemRangeStart); i < 1024; i++) + { + if (i != ADDR_TO_PDE_OFFSET(PAGETABLE_MAP) && + i != ADDR_TO_PDE_OFFSET(HYPERSPACE) && + 0 == MmGlobalKernelPageDirectory[i] && 0 != CurrentPageDirectory[i]) + { MmGlobalKernelPageDirectory[i] = CurrentPageDirectory[i]; - if (Ke386GlobalPagesEnabled) - { - MmGlobalKernelPageDirectory[i] |= PA_GLOBAL; - CurrentPageDirectory[i] |= PA_GLOBAL; - } - } - } + if (Ke386GlobalPagesEnabled) + { + MmGlobalKernelPageDirectory[i] |= PA_GLOBAL; + CurrentPageDirectory[i] |= PA_GLOBAL; + } + } + } } VOID @@ -1336,43 +1336,43 @@ NTAPI MiInitPageDirectoryMap(VOID) { - MEMORY_AREA* kernel_map_desc = NULL; - MEMORY_AREA* hyperspace_desc = NULL; - PHYSICAL_ADDRESS BoundaryAddressMultiple; - PVOID BaseAddress; - NTSTATUS Status; - - DPRINT("MiInitPageDirectoryMap()\n"); - - BoundaryAddressMultiple.QuadPart = 0; - BaseAddress = (PVOID)PAGETABLE_MAP; - Status = MmCreateMemoryArea(MmGetKernelAddressSpace(), - MEMORY_AREA_SYSTEM, - &BaseAddress, - 0x400000, - PAGE_READWRITE, - &kernel_map_desc, - TRUE, - 0, - BoundaryAddressMultiple); - if (!NT_SUCCESS(Status)) - { - KEBUGCHECK(0); - } - BaseAddress = (PVOID)HYPERSPACE; - Status = MmCreateMemoryArea(MmGetKernelAddressSpace(), - MEMORY_AREA_SYSTEM, - &BaseAddress, - 0x400000, - PAGE_READWRITE, - &hyperspace_desc, - TRUE, - 0, - BoundaryAddressMultiple); - if (!NT_SUCCESS(Status)) - { - KEBUGCHECK(0); - } + MEMORY_AREA* kernel_map_desc = NULL; + MEMORY_AREA* hyperspace_desc = NULL; + PHYSICAL_ADDRESS BoundaryAddressMultiple; + PVOID BaseAddress; + NTSTATUS Status; + + DPRINT("MiInitPageDirectoryMap()\n"); + + BoundaryAddressMultiple.QuadPart = 0; + BaseAddress = (PVOID)PAGETABLE_MAP; + Status = MmCreateMemoryArea(MmGetKernelAddressSpace(), + MEMORY_AREA_SYSTEM, + &BaseAddress, + 0x400000, + PAGE_READWRITE, + &kernel_map_desc, + TRUE, + 0, + BoundaryAddressMultiple); + if (!NT_SUCCESS(Status)) + { + KEBUGCHECK(0); + } + BaseAddress = (PVOID)HYPERSPACE; + Status = MmCreateMemoryArea(MmGetKernelAddressSpace(), + MEMORY_AREA_SYSTEM, + &BaseAddress, + 0x400000, + PAGE_READWRITE, + &hyperspace_desc, + TRUE, + 0, + BoundaryAddressMultiple); + if (!NT_SUCCESS(Status)) + { + KEBUGCHECK(0); + } } /* EOF */
16 years, 4 months
1
0
0
0
[arty] 34972: A debugging shell for use with KDBG. Not perfect yet but it can display the locals and stack trace at the place where reactos is stopped.
by arty@svn.reactos.org
Author: arty Date: Thu Jul 31 02:00:10 2008 New Revision: 34972 URL:
http://svn.reactos.org/svn/reactos?rev=34972&view=rev
Log: A debugging shell for use with KDBG. Not perfect yet but it can display the locals and stack trace at the place where reactos is stopped. Added: trunk/tools/reactosdbg/ trunk/tools/reactosdbg/DbgHelp/ trunk/tools/reactosdbg/DbgHelp/DbgHelp.cs trunk/tools/reactosdbg/DbgHelp/DbgHelp.csproj trunk/tools/reactosdbg/DbgHelp/Properties/ trunk/tools/reactosdbg/DbgHelp/Properties/AssemblyInfo.cs trunk/tools/reactosdbg/DbgHelp/filemap.cs trunk/tools/reactosdbg/DebugProtocol/ trunk/tools/reactosdbg/DebugProtocol/Breakpoint.cs trunk/tools/reactosdbg/DebugProtocol/DebugConnection.cs trunk/tools/reactosdbg/DebugProtocol/DebugControlAttribute.cs trunk/tools/reactosdbg/DebugProtocol/DebugMemoryStream.cs trunk/tools/reactosdbg/DebugProtocol/DebugProtocol.csproj trunk/tools/reactosdbg/DebugProtocol/IDebugProtocol.cs trunk/tools/reactosdbg/DebugProtocol/KDBG.cs trunk/tools/reactosdbg/DebugProtocol/MemoryBlock.cs trunk/tools/reactosdbg/DebugProtocol/Properties/ trunk/tools/reactosdbg/DebugProtocol/Properties/AssemblyInfo.cs trunk/tools/reactosdbg/DebugProtocol/Registers.cs trunk/tools/reactosdbg/Pipe/ trunk/tools/reactosdbg/Pipe/Pipe.csproj trunk/tools/reactosdbg/Pipe/Properties/ trunk/tools/reactosdbg/Pipe/Properties/AssemblyInfo.cs trunk/tools/reactosdbg/Pipe/pipe.cs trunk/tools/reactosdbg/Pipe/socketpipe.cs trunk/tools/reactosdbg/ReactosDBG.sln (with props) trunk/tools/reactosdbg/RosDBG/ trunk/tools/reactosdbg/RosDBG/BackTrace.Designer.cs trunk/tools/reactosdbg/RosDBG/BackTrace.cs trunk/tools/reactosdbg/RosDBG/BackTrace.resx trunk/tools/reactosdbg/RosDBG/DebugConnection.cs trunk/tools/reactosdbg/RosDBG/DebugControlAttribute.cs trunk/tools/reactosdbg/RosDBG/DebugInfoFile.cs trunk/tools/reactosdbg/RosDBG/DebugMemoryStream.cs trunk/tools/reactosdbg/RosDBG/HighLevelInteraction.cs trunk/tools/reactosdbg/RosDBG/HostWindow.Designer.cs trunk/tools/reactosdbg/RosDBG/HostWindow.cs trunk/tools/reactosdbg/RosDBG/HostWindow.resx trunk/tools/reactosdbg/RosDBG/IShell.cs trunk/tools/reactosdbg/RosDBG/IUseDebugConnection.cs trunk/tools/reactosdbg/RosDBG/IUseSymbols.cs trunk/tools/reactosdbg/RosDBG/Locals.Designer.cs trunk/tools/reactosdbg/RosDBG/Locals.cs trunk/tools/reactosdbg/RosDBG/Locals.resx trunk/tools/reactosdbg/RosDBG/MainWindow.Designer.cs trunk/tools/reactosdbg/RosDBG/MainWindow.cs trunk/tools/reactosdbg/RosDBG/MainWindow.resx trunk/tools/reactosdbg/RosDBG/MemoryWindow.Designer.cs trunk/tools/reactosdbg/RosDBG/MemoryWindow.cs trunk/tools/reactosdbg/RosDBG/MemoryWindow.resx trunk/tools/reactosdbg/RosDBG/Module.cs trunk/tools/reactosdbg/RosDBG/ModuleIndex.cs trunk/tools/reactosdbg/RosDBG/Modules.Designer.cs trunk/tools/reactosdbg/RosDBG/Modules.cs trunk/tools/reactosdbg/RosDBG/Modules.resx trunk/tools/reactosdbg/RosDBG/Program.cs trunk/tools/reactosdbg/RosDBG/Properties/ trunk/tools/reactosdbg/RosDBG/Properties/AssemblyInfo.cs trunk/tools/reactosdbg/RosDBG/Properties/Resources.Designer.cs trunk/tools/reactosdbg/RosDBG/Properties/Resources.resx trunk/tools/reactosdbg/RosDBG/Properties/Settings.Designer.cs trunk/tools/reactosdbg/RosDBG/Properties/Settings.settings trunk/tools/reactosdbg/RosDBG/RawTraffic.Designer.cs trunk/tools/reactosdbg/RosDBG/RawTraffic.cs trunk/tools/reactosdbg/RosDBG/RawTraffic.resx trunk/tools/reactosdbg/RosDBG/ReactOSWeb.Designer.cs trunk/tools/reactosdbg/RosDBG/ReactOSWeb.cs trunk/tools/reactosdbg/RosDBG/ReactOSWeb.resx trunk/tools/reactosdbg/RosDBG/RegisterView.Designer.cs trunk/tools/reactosdbg/RosDBG/RegisterView.cs trunk/tools/reactosdbg/RosDBG/RegisterView.resx trunk/tools/reactosdbg/RosDBG/Registers.cs trunk/tools/reactosdbg/RosDBG/RosDBG.csproj trunk/tools/reactosdbg/RosDBG/RosDBG.sln (with props) trunk/tools/reactosdbg/RosDBG/SourceView.Designer.cs trunk/tools/reactosdbg/RosDBG/SourceView.cs trunk/tools/reactosdbg/RosDBG/SourceView.resx trunk/tools/reactosdbg/RosDBG/TCPTargetSelect.Designer.cs trunk/tools/reactosdbg/RosDBG/TCPTargetSelect.cs trunk/tools/reactosdbg/RosDBG/TCPTargetSelect.resx trunk/tools/reactosdbg/RosDBG/gdb.cs trunk/tools/reactosdbg/RosDBG/gdbbase.cs trunk/tools/reactosdbg/RosDBG/hextest.cs trunk/tools/reactosdbg/RosDBG/socketpipe.cs trunk/tools/reactosdbg/dbghelptest/ trunk/tools/reactosdbg/dbghelptest/Makefile trunk/tools/reactosdbg/dbghelptest/dbghelp.dll (with props) trunk/tools/reactosdbg/dbghelptest/dbghelp.h (with props) trunk/tools/reactosdbg/dbghelptest/testline.c (with props) [This mail would be too long, it was shortened to contain the URLs only.] Added: trunk/tools/reactosdbg/DbgHelp/DbgHelp.cs URL:
http://svn.reactos.org/svn/reactos/trunk/tools/reactosdbg/DbgHelp/DbgHelp.c…
Added: trunk/tools/reactosdbg/DbgHelp/DbgHelp.csproj URL:
http://svn.reactos.org/svn/reactos/trunk/tools/reactosdbg/DbgHelp/DbgHelp.c…
Added: trunk/tools/reactosdbg/DbgHelp/Properties/AssemblyInfo.cs URL:
http://svn.reactos.org/svn/reactos/trunk/tools/reactosdbg/DbgHelp/Propertie…
Added: trunk/tools/reactosdbg/DbgHelp/filemap.cs URL:
http://svn.reactos.org/svn/reactos/trunk/tools/reactosdbg/DbgHelp/filemap.c…
Added: trunk/tools/reactosdbg/DebugProtocol/Breakpoint.cs URL:
http://svn.reactos.org/svn/reactos/trunk/tools/reactosdbg/DebugProtocol/Bre…
Added: trunk/tools/reactosdbg/DebugProtocol/DebugConnection.cs URL:
http://svn.reactos.org/svn/reactos/trunk/tools/reactosdbg/DebugProtocol/Deb…
Added: trunk/tools/reactosdbg/DebugProtocol/DebugControlAttribute.cs URL:
http://svn.reactos.org/svn/reactos/trunk/tools/reactosdbg/DebugProtocol/Deb…
Added: trunk/tools/reactosdbg/DebugProtocol/DebugMemoryStream.cs URL:
http://svn.reactos.org/svn/reactos/trunk/tools/reactosdbg/DebugProtocol/Deb…
Added: trunk/tools/reactosdbg/DebugProtocol/DebugProtocol.csproj URL:
http://svn.reactos.org/svn/reactos/trunk/tools/reactosdbg/DebugProtocol/Deb…
Added: trunk/tools/reactosdbg/DebugProtocol/IDebugProtocol.cs URL:
http://svn.reactos.org/svn/reactos/trunk/tools/reactosdbg/DebugProtocol/IDe…
Added: trunk/tools/reactosdbg/DebugProtocol/KDBG.cs URL:
http://svn.reactos.org/svn/reactos/trunk/tools/reactosdbg/DebugProtocol/KDB…
Added: trunk/tools/reactosdbg/DebugProtocol/MemoryBlock.cs URL:
http://svn.reactos.org/svn/reactos/trunk/tools/reactosdbg/DebugProtocol/Mem…
Added: trunk/tools/reactosdbg/DebugProtocol/Properties/AssemblyInfo.cs URL:
http://svn.reactos.org/svn/reactos/trunk/tools/reactosdbg/DebugProtocol/Pro…
Added: trunk/tools/reactosdbg/DebugProtocol/Registers.cs URL:
http://svn.reactos.org/svn/reactos/trunk/tools/reactosdbg/DebugProtocol/Reg…
Added: trunk/tools/reactosdbg/Pipe/Pipe.csproj URL:
http://svn.reactos.org/svn/reactos/trunk/tools/reactosdbg/Pipe/Pipe.csproj?…
Added: trunk/tools/reactosdbg/Pipe/Properties/AssemblyInfo.cs URL:
http://svn.reactos.org/svn/reactos/trunk/tools/reactosdbg/Pipe/Properties/A…
Added: trunk/tools/reactosdbg/Pipe/pipe.cs URL:
http://svn.reactos.org/svn/reactos/trunk/tools/reactosdbg/Pipe/pipe.cs?rev=…
Added: trunk/tools/reactosdbg/Pipe/socketpipe.cs URL:
http://svn.reactos.org/svn/reactos/trunk/tools/reactosdbg/Pipe/socketpipe.c…
Added: trunk/tools/reactosdbg/ReactosDBG.sln URL:
http://svn.reactos.org/svn/reactos/trunk/tools/reactosdbg/ReactosDBG.sln?re…
Added: trunk/tools/reactosdbg/RosDBG/BackTrace.Designer.cs URL:
http://svn.reactos.org/svn/reactos/trunk/tools/reactosdbg/RosDBG/BackTrace.…
Added: trunk/tools/reactosdbg/RosDBG/BackTrace.cs URL:
http://svn.reactos.org/svn/reactos/trunk/tools/reactosdbg/RosDBG/BackTrace.…
Added: trunk/tools/reactosdbg/RosDBG/BackTrace.resx URL:
http://svn.reactos.org/svn/reactos/trunk/tools/reactosdbg/RosDBG/BackTrace.…
Added: trunk/tools/reactosdbg/RosDBG/DebugConnection.cs URL:
http://svn.reactos.org/svn/reactos/trunk/tools/reactosdbg/RosDBG/DebugConne…
Added: trunk/tools/reactosdbg/RosDBG/DebugControlAttribute.cs URL:
http://svn.reactos.org/svn/reactos/trunk/tools/reactosdbg/RosDBG/DebugContr…
Added: trunk/tools/reactosdbg/RosDBG/DebugInfoFile.cs URL:
http://svn.reactos.org/svn/reactos/trunk/tools/reactosdbg/RosDBG/DebugInfoF…
Added: trunk/tools/reactosdbg/RosDBG/DebugMemoryStream.cs URL:
http://svn.reactos.org/svn/reactos/trunk/tools/reactosdbg/RosDBG/DebugMemor…
Added: trunk/tools/reactosdbg/RosDBG/HighLevelInteraction.cs URL:
http://svn.reactos.org/svn/reactos/trunk/tools/reactosdbg/RosDBG/HighLevelI…
Added: trunk/tools/reactosdbg/RosDBG/HostWindow.Designer.cs URL:
http://svn.reactos.org/svn/reactos/trunk/tools/reactosdbg/RosDBG/HostWindow…
Added: trunk/tools/reactosdbg/RosDBG/HostWindow.cs URL:
http://svn.reactos.org/svn/reactos/trunk/tools/reactosdbg/RosDBG/HostWindow…
Added: trunk/tools/reactosdbg/RosDBG/HostWindow.resx URL:
http://svn.reactos.org/svn/reactos/trunk/tools/reactosdbg/RosDBG/HostWindow…
Added: trunk/tools/reactosdbg/RosDBG/IShell.cs URL:
http://svn.reactos.org/svn/reactos/trunk/tools/reactosdbg/RosDBG/IShell.cs?…
Added: trunk/tools/reactosdbg/RosDBG/IUseDebugConnection.cs URL:
http://svn.reactos.org/svn/reactos/trunk/tools/reactosdbg/RosDBG/IUseDebugC…
Added: trunk/tools/reactosdbg/RosDBG/IUseSymbols.cs URL:
http://svn.reactos.org/svn/reactos/trunk/tools/reactosdbg/RosDBG/IUseSymbol…
Added: trunk/tools/reactosdbg/RosDBG/Locals.Designer.cs URL:
http://svn.reactos.org/svn/reactos/trunk/tools/reactosdbg/RosDBG/Locals.Des…
Added: trunk/tools/reactosdbg/RosDBG/Locals.cs URL:
http://svn.reactos.org/svn/reactos/trunk/tools/reactosdbg/RosDBG/Locals.cs?…
Added: trunk/tools/reactosdbg/RosDBG/Locals.resx URL:
http://svn.reactos.org/svn/reactos/trunk/tools/reactosdbg/RosDBG/Locals.res…
Added: trunk/tools/reactosdbg/RosDBG/MainWindow.Designer.cs URL:
http://svn.reactos.org/svn/reactos/trunk/tools/reactosdbg/RosDBG/MainWindow…
Added: trunk/tools/reactosdbg/RosDBG/MainWindow.cs URL:
http://svn.reactos.org/svn/reactos/trunk/tools/reactosdbg/RosDBG/MainWindow…
Added: trunk/tools/reactosdbg/RosDBG/MainWindow.resx URL:
http://svn.reactos.org/svn/reactos/trunk/tools/reactosdbg/RosDBG/MainWindow…
Added: trunk/tools/reactosdbg/RosDBG/MemoryWindow.Designer.cs URL:
http://svn.reactos.org/svn/reactos/trunk/tools/reactosdbg/RosDBG/MemoryWind…
Added: trunk/tools/reactosdbg/RosDBG/MemoryWindow.cs URL:
http://svn.reactos.org/svn/reactos/trunk/tools/reactosdbg/RosDBG/MemoryWind…
Added: trunk/tools/reactosdbg/RosDBG/MemoryWindow.resx URL:
http://svn.reactos.org/svn/reactos/trunk/tools/reactosdbg/RosDBG/MemoryWind…
Added: trunk/tools/reactosdbg/RosDBG/Module.cs URL:
http://svn.reactos.org/svn/reactos/trunk/tools/reactosdbg/RosDBG/Module.cs?…
Added: trunk/tools/reactosdbg/RosDBG/ModuleIndex.cs URL:
http://svn.reactos.org/svn/reactos/trunk/tools/reactosdbg/RosDBG/ModuleInde…
Added: trunk/tools/reactosdbg/RosDBG/Modules.Designer.cs URL:
http://svn.reactos.org/svn/reactos/trunk/tools/reactosdbg/RosDBG/Modules.De…
Added: trunk/tools/reactosdbg/RosDBG/Modules.cs URL:
http://svn.reactos.org/svn/reactos/trunk/tools/reactosdbg/RosDBG/Modules.cs…
Added: trunk/tools/reactosdbg/RosDBG/Modules.resx URL:
http://svn.reactos.org/svn/reactos/trunk/tools/reactosdbg/RosDBG/Modules.re…
Added: trunk/tools/reactosdbg/RosDBG/Program.cs URL:
http://svn.reactos.org/svn/reactos/trunk/tools/reactosdbg/RosDBG/Program.cs…
Added: trunk/tools/reactosdbg/RosDBG/Properties/AssemblyInfo.cs URL:
http://svn.reactos.org/svn/reactos/trunk/tools/reactosdbg/RosDBG/Properties…
Added: trunk/tools/reactosdbg/RosDBG/Properties/Resources.Designer.cs URL:
http://svn.reactos.org/svn/reactos/trunk/tools/reactosdbg/RosDBG/Properties…
Added: trunk/tools/reactosdbg/RosDBG/Properties/Resources.resx URL:
http://svn.reactos.org/svn/reactos/trunk/tools/reactosdbg/RosDBG/Properties…
Added: trunk/tools/reactosdbg/RosDBG/Properties/Settings.Designer.cs URL:
http://svn.reactos.org/svn/reactos/trunk/tools/reactosdbg/RosDBG/Properties…
Added: trunk/tools/reactosdbg/RosDBG/Properties/Settings.settings URL:
http://svn.reactos.org/svn/reactos/trunk/tools/reactosdbg/RosDBG/Properties…
Added: trunk/tools/reactosdbg/RosDBG/RawTraffic.Designer.cs URL:
http://svn.reactos.org/svn/reactos/trunk/tools/reactosdbg/RosDBG/RawTraffic…
Added: trunk/tools/reactosdbg/RosDBG/RawTraffic.cs URL:
http://svn.reactos.org/svn/reactos/trunk/tools/reactosdbg/RosDBG/RawTraffic…
Added: trunk/tools/reactosdbg/RosDBG/RawTraffic.resx URL:
http://svn.reactos.org/svn/reactos/trunk/tools/reactosdbg/RosDBG/RawTraffic…
Added: trunk/tools/reactosdbg/RosDBG/ReactOSWeb.Designer.cs URL:
http://svn.reactos.org/svn/reactos/trunk/tools/reactosdbg/RosDBG/ReactOSWeb…
Added: trunk/tools/reactosdbg/RosDBG/ReactOSWeb.cs URL:
http://svn.reactos.org/svn/reactos/trunk/tools/reactosdbg/RosDBG/ReactOSWeb…
Added: trunk/tools/reactosdbg/RosDBG/ReactOSWeb.resx URL:
http://svn.reactos.org/svn/reactos/trunk/tools/reactosdbg/RosDBG/ReactOSWeb…
Added: trunk/tools/reactosdbg/RosDBG/RegisterView.Designer.cs URL:
http://svn.reactos.org/svn/reactos/trunk/tools/reactosdbg/RosDBG/RegisterVi…
Added: trunk/tools/reactosdbg/RosDBG/RegisterView.cs URL:
http://svn.reactos.org/svn/reactos/trunk/tools/reactosdbg/RosDBG/RegisterVi…
Added: trunk/tools/reactosdbg/RosDBG/RegisterView.resx URL:
http://svn.reactos.org/svn/reactos/trunk/tools/reactosdbg/RosDBG/RegisterVi…
Added: trunk/tools/reactosdbg/RosDBG/Registers.cs URL:
http://svn.reactos.org/svn/reactos/trunk/tools/reactosdbg/RosDBG/Registers.…
Added: trunk/tools/reactosdbg/RosDBG/RosDBG.csproj URL:
http://svn.reactos.org/svn/reactos/trunk/tools/reactosdbg/RosDBG/RosDBG.csp…
Added: trunk/tools/reactosdbg/RosDBG/RosDBG.sln URL:
http://svn.reactos.org/svn/reactos/trunk/tools/reactosdbg/RosDBG/RosDBG.sln…
Added: trunk/tools/reactosdbg/RosDBG/SourceView.Designer.cs URL:
http://svn.reactos.org/svn/reactos/trunk/tools/reactosdbg/RosDBG/SourceView…
Added: trunk/tools/reactosdbg/RosDBG/SourceView.cs URL:
http://svn.reactos.org/svn/reactos/trunk/tools/reactosdbg/RosDBG/SourceView…
Added: trunk/tools/reactosdbg/RosDBG/SourceView.resx URL:
http://svn.reactos.org/svn/reactos/trunk/tools/reactosdbg/RosDBG/SourceView…
Added: trunk/tools/reactosdbg/RosDBG/TCPTargetSelect.Designer.cs URL:
http://svn.reactos.org/svn/reactos/trunk/tools/reactosdbg/RosDBG/TCPTargetS…
Added: trunk/tools/reactosdbg/RosDBG/TCPTargetSelect.cs URL:
http://svn.reactos.org/svn/reactos/trunk/tools/reactosdbg/RosDBG/TCPTargetS…
Added: trunk/tools/reactosdbg/RosDBG/TCPTargetSelect.resx URL:
http://svn.reactos.org/svn/reactos/trunk/tools/reactosdbg/RosDBG/TCPTargetS…
Added: trunk/tools/reactosdbg/RosDBG/gdb.cs URL:
http://svn.reactos.org/svn/reactos/trunk/tools/reactosdbg/RosDBG/gdb.cs?rev…
Added: trunk/tools/reactosdbg/RosDBG/gdbbase.cs URL:
http://svn.reactos.org/svn/reactos/trunk/tools/reactosdbg/RosDBG/gdbbase.cs…
Added: trunk/tools/reactosdbg/RosDBG/hextest.cs URL:
http://svn.reactos.org/svn/reactos/trunk/tools/reactosdbg/RosDBG/hextest.cs…
Added: trunk/tools/reactosdbg/RosDBG/socketpipe.cs URL:
http://svn.reactos.org/svn/reactos/trunk/tools/reactosdbg/RosDBG/socketpipe…
Added: trunk/tools/reactosdbg/dbghelptest/Makefile URL:
http://svn.reactos.org/svn/reactos/trunk/tools/reactosdbg/dbghelptest/Makef…
Added: trunk/tools/reactosdbg/dbghelptest/dbghelp.dll URL:
http://svn.reactos.org/svn/reactos/trunk/tools/reactosdbg/dbghelptest/dbghe…
Added: trunk/tools/reactosdbg/dbghelptest/dbghelp.h URL:
http://svn.reactos.org/svn/reactos/trunk/tools/reactosdbg/dbghelptest/dbghe…
Added: trunk/tools/reactosdbg/dbghelptest/testline.c URL:
http://svn.reactos.org/svn/reactos/trunk/tools/reactosdbg/dbghelptest/testl…
16 years, 4 months
1
0
0
0
[tkreuzer] 34971: - do not define -nostartfiles for kernel, it looks like ld creates unaligned section pointers then - comment out RtlCapturestackLimits - use KeGetCurrentPrcb instead if KetGetPcr()->Prcb - fix use of KPCR->Prcb - use %p instead of %08x for ULONG_PTR - update stubs - add more files to build - add FrLdrDbgPrint prototype to ntoskrnl.h
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Wed Jul 30 21:20:15 2008 New Revision: 34971 URL:
http://svn.reactos.org/svn/reactos?rev=34971&view=rev
Log: - do not define -nostartfiles for kernel, it looks like ld creates unaligned section pointers then - comment out RtlCapturestackLimits - use KeGetCurrentPrcb instead if KetGetPcr()->Prcb - fix use of KPCR->Prcb - use %p instead of %08x for ULONG_PTR - update stubs - add more files to build - add FrLdrDbgPrint prototype to ntoskrnl.h Modified: branches/ros-amd64-bringup/reactos/ReactOS-amd64.rbuild branches/ros-amd64-bringup/reactos/ntoskrnl/amd64stubs.c branches/ros-amd64-bringup/reactos/ntoskrnl/ex/sysinfo.c branches/ros-amd64-bringup/reactos/ntoskrnl/include/internal/ntoskrnl.h branches/ros-amd64-bringup/reactos/ntoskrnl/ke/bug.c branches/ros-amd64-bringup/reactos/ntoskrnl/ntoskrnl-amd64hack.rbuild branches/ros-amd64-bringup/reactos/ntoskrnl/rtl/libsupp.c Modified: branches/ros-amd64-bringup/reactos/ReactOS-amd64.rbuild URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/React…
============================================================================== --- branches/ros-amd64-bringup/reactos/ReactOS-amd64.rbuild [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/ReactOS-amd64.rbuild [iso-8859-1] Wed Jul 30 21:20:15 2008 @@ -17,7 +17,7 @@ <property name="PLATFORM" value="PC"/> <property name="usewrc" value="false"/> <property name="WINEBUILD_FLAGS" value="--kill-at"/> - <property name="NTOSKRNL_SHARED" value="-nostartfiles -shared"/> + <property name="NTOSKRNL_SHARED" value="-shared"/> <linkerflag>-enable-stdcall-fixup</linkerflag> <if property="OPTIMIZE" value="1"> Modified: branches/ros-amd64-bringup/reactos/ntoskrnl/amd64stubs.c URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/ntosk…
============================================================================== --- branches/ros-amd64-bringup/reactos/ntoskrnl/amd64stubs.c [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/ntoskrnl/amd64stubs.c [iso-8859-1] Wed Jul 30 21:20:15 2008 @@ -9,26 +9,11 @@ STUB(KeRaiseIrqlToDpcLevel) STUB(KiIdleLoop) STUB(KeGetCurrentIrql) -STUB(KeBugCheckEx) STUB(KeAcquireInStackQueuedSpinLockRaiseToSynch) STUB(KeNumberProcessors) STUB(KeBugcheckCallbackListHead) -STUB(NtAdjustGroupsToken) -STUB(NtAdjustPrivilegesToken) STUB(ExpInterlockedPushEntrySList) -STUB(PsGetCurrentThreadId) STUB(NtContinue) -STUB(NtCreateEvent) -STUB(NtCreateMutant) -STUB(NtCreateSemaphore) -STUB(NtCreateThread) -STUB(NtCreateTimer) -STUB(NtCreateToken) -STUB(NtDebugContinue) -STUB(NtDuplicateToken) -STUB(NtFilterToken) -STUB(NtFlushInstructionCache) -STUB(NtDebugActiveProcess) STUB(KeActiveProcessors) STUB(KeDisableInterrupts) STUB(KiSwapContext) @@ -36,7 +21,6 @@ STUB(KiDispatchException) STUB(MiGetUserPageDirectoryCount) STUB(MmStats) -STUB(PsCreateSystemThread) STUB(ExAcquireResourceLock) STUB(ExReleaseResourceLock) STUB(MiNonPagedPoolLength) @@ -46,90 +30,28 @@ STUB(KeBugcheckReasonCallbackListHead) STUB(BugCheckCallbackLock) STUB(NtCallbackReturn) -STUB(NtCancelTimer) -STUB(NtClearEvent) -STUB(NtCompareTokens) -STUB(NtCreateDebugObject) -STUB(NtCreateIoCompletion) -STUB(NtEnumerateSystemEnvironmentValuesEx) -STUB(NtImpersonateAnonymousToken) -STUB(NtOpenEvent) -STUB(NtOpenIoCompletion) -STUB(NtOpenMutant) -STUB(NtOpenSemaphore) -STUB(NtOpenThread) -STUB(NtOpenThreadToken) -STUB(NtOpenTimer) -STUB(NtPulseEvent) -STUB(NtQueryEvent) -STUB(NtQueryInformationToken) -STUB(NtQueryIoCompletion) -STUB(NtQueryMutant) -STUB(NtQuerySemaphore) -STUB(NtQuerySystemEnvironmentValue) -STUB(NtQuerySystemEnvironmentValueEx) -STUB(NtQuerySystemInformation) -STUB(NtQueryTimer) STUB(NtRaiseException) -STUB(NtReleaseMutant) -STUB(NtReleaseSemaphore) -STUB(NtRemoveIoCompletion) -STUB(NtRemoveProcessDebug) -STUB(NtResetEvent) -STUB(NtSetEvent) -STUB(NtSetEventBoostPriority) -STUB(NtSetInformationTokenNtSetInformationDebugObject) -STUB(NtSetIoCompletion) STUB(NtSetLdtEntries) -STUB(NtSetSystemEnvironmentValue) -STUB(NtSetSystemEnvironmentValueEx) -STUB(NtSetSystemInformation) -STUB(NtSetTimer) STUB(NtVdmControl) -STUB(NtWaitForDebugEvent) -STUB(NtGetCurrentProcessorNumber) -STUB(NtOpenThreadTokenEx) -STUB(NtSetInformationDebugObject) -STUB(NtSetInformationToken) STUB(KiSwapProcess) STUB(KeGetCurrentProcessorNumber) STUB(Ke386InitThreadWithContext) STUB(ExpInterlockedPopEntrySList) STUB(ExAllocateFromNPagedLookasideList) -STUB(ExInitializeNPagedLookasideList) -STUB(SeTokenType) STUB(RtlGetCallersAddress) STUB(RtlCompareMemory) -STUB(DbgkpSendApiMessage) -STUB(DbgkpTraceLevel) -STUB(ExpInitializeEventImplementation) -STUB(ExpInitializeMutantImplementation) -STUB(ExpInitializeSemaphoreImplementation) -STUB(ExpInitializeTimerImplementation) STUB(ExpEnvironmentLock) STUB(ExpFirmwareTableProviderListHead) -STUB(IoAcquireCancelSpinLock) -STUB(IoReleaseCancelSpinLock) STUB(ExInterlockedInsertTailList) STUB(ExInterlockedRemoveHeadList) STUB(ExInterlockedAddLargeStatistic) -STUB(IopCompletionMapping) STUB(CmpInitializeMachineDependentConfiguration) -STUB(ExpInitLookasideLists) STUB(ExpFirmwareTableResource) STUB(MmNumberOfPhysicalPages) -STUB(RtlInitializeRangeListPackage) -STUB(ExInitPoolLookasidePointers) -STUB(KiInitializeBugCheck) -STUB(DbgkInitialize) STUB(MmMapLockedPage) STUB(PsThreadType) STUB(ExfInterlockedCompareExchange64) -STUB(ExInitializePagedLookasideList) STUB(ExInterlockedInsertHeadList) -STUB(IoCheckEaBufferValidity) -STUB(ExEventObjectType) -STUB(IopDeleteIoCompletion) STUB(IoCompletionType) STUB(IoCompletionPacketLookaside) STUB(CancelSpinLock) @@ -140,97 +62,42 @@ STUB(MmPfnDatabase) STUB(MmHighestPhysicalPage) STUB(MiFreeDescriptorOrg) -STUB(_PsThreadType) -STUB(_ExEventObjectType) +STUB(ExEventObjectType) STUB(KeRosDumpStackFrames) STUB(RtlWalkFrameChain) STUB(ExSystemLookasideListHead) STUB(PspGetOrSetContextKernelRoutine) -STUB(PspW32ThreadCallout) -STUB(ExTimerRundown) STUB(KeConnectInterrupt) -STUB(ExInitializeSystemLookasideList) STUB(KeRaiseUserException) -STUB(PsIsThreadTerminating) -STUB(ExMutantObjectType) STUB(_ExSemaphoreObjectType) -STUB(DbgkClearProcessDebugObject) STUB(KeFeatureBits) -STUB(SepTokenObjectType) -STUB(SeExchangePrimaryToken) -STUB(SeIsTokenChild) -STUB(SeTokenImpersonationLevel) -STUB(SeSubProcessToken) -STUB(SeAssignPrimaryToke) -STUB(SeCopyClientToken) -STUB(SepInitializeTokenImplementation) STUB(KiSystemService) STUB(KdpGdbStubInit) STUB(KdbpGetCommandLineSettings) STUB(KdbpSafeReadMemory) -STUB(RtlpAllocateMemory) STUB(RtlFillMemoryUlong) STUB(RtlCaptureContext) STUB(RtlpGetExceptionAddress) -STUB(RtlpCheckForActiveDebugger) STUB(RtlDispatchException) -STUB(RtlpFreeMemory) -STUB(RtlpLockAtomTable) -STUB(RtlpUnlockAtomTable) -STUB(PspW32ProcessCallout) STUB(DbgkDebugObjectType) -STUB(DbgkCopyProcessDebugPort) -STUB(SeAssignPrimaryToken) -STUB(SeDeassignPrimaryToken) -STUB(SepCreateSystemProcessToken) STUB(KdbEnterDebuggerException) STUB(KdbpCliModuleLoaded) -STUB(RtlpSetInDbgPrint) -STUB(CHECK_PAGED_CODE_RTL) -STUB(RtlpGetAtomEntry) -STUB(RtlpFreeAtomHandle) -STUB(RtlpFreeAtomTableEntry) -STUB(RtlpAllocAtomTableEntry) -STUB(RtlAcquirePebLock) -STUB(RtlpGetMode) -STUB(RtlReleasePebLock) -STUB(RtlEnterHeapLock) -STUB(RtlLeaveHeapLock) -STUB(RtlInitializeHeapLock) -STUB(LdrShutdownThread) -STUB(RtlpDestroyAtomHandleTable) -STUB(RtlpDestroyAtomTableLock) -STUB(RtlpFreeAtomTable) -STUB(RtlpAllocAtomTable) -STUB(RtlpInitAtomTableLock) -STUB(RtlpCreateAtomHandleTable) -STUB(RtlpAllocDeallocQueryBufferSize) -STUB(find_entry) -STUB(RtlDeleteHeapLock) STUB(RtlUnwind) -STUB(RtlpCreateAtomHandle) STUB(RtlInitializeContext) -STUB(RtlpCurrentPeb) STUB(DbgCommandString) STUB(ExAcquireRundownProtection) STUB(ExAcquireRundownProtectionCacheAware) STUB(ExAcquireRundownProtectionCacheAwareEx) STUB(ExAcquireRundownProtectionEx) STUB(ExAllocateFromPagedLookasideList) -STUB(ExDeleteNPagedLookasideList) -STUB(ExDeletePagedLookasideList) STUB(ExEnterCriticalRegionAndAcquireResourceShared) STUB(ExEnterCriticalRegionAndAcquireSharedWaitForExclusive) STUB(ExFreeToPagedLookasideList) -STUB(ExGetCurrentProcessorCounts) -STUB(ExGetCurrentProcessorCpuUsage) -STUB(ExGetPreviousMode) STUB(ExInitializeRundownProtection) STUB(ExInterlockedAddLargeInteger) STUB(ExInterlockedAddUlong) STUB(ExInterlockedPopEntryList) STUB(ExInterlockedPushEntryList) -STUB(ExIsProcessorFeaturePresent) STUB(ExQueryDepthSList) STUB(ExRaiseException) STUB(ExRaiseStatus) @@ -243,7 +110,6 @@ STUB(ExRundownCompleted) STUB(ExRundownCompletedCacheAware) STUB(ExSemaphoreObjectType) -STUB(ExVerifySuite) STUB(ExWaitForRundownProtectionRelease) STUB(ExWaitForRundownProtectionReleaseCacheAware) STUB(ExpInterlockedFlushSList) @@ -263,27 +129,12 @@ STUB(HalDispatchTable) STUB(HeadlessDispatch) STUB(InitializeSListHead) -STUB(IoCheckDesiredAccess) -STUB(IoCheckFunctionAccess) -STUB(IoCheckQuerySetVolumeInformation) STUB(IoEnumerateRegisteredFiltersList) STUB(IoFileObjectType) STUB(IoForwardAndCatchIrp) -STUB(IoGetCurrentProcess) -STUB(IoGetDeviceToVerify) -STUB(IoGetInitialStack) STUB(IoGetPagingIoPriority) -STUB(IoGetStackLimits) STUB(IoIs32bitProcess) -STUB(IoIsSystemThread) -STUB(IoIsWdmVersionAvailable) -STUB(IoSetCompletionRoutineEx) -STUB(IoSetDeviceToVerify) -STUB(IoSetHardErrorOrVerifyDevice) -STUB(IoSetIoCompletion) -STUB(IoThreadToProcess) STUB(IoTranslateBusAddress) -STUB(IoValidateDeviceIoControlAccess) STUB(IoWMIDeviceObjectToProviderId) STUB(KdDebuggerEnabled) STUB(KdDebuggerNotPresent) @@ -294,12 +145,9 @@ STUB(KeAcquireSpinLockForDpc) STUB(KeAcquireSpinLockRaiseToDpc) STUB(KeAcquireSpinLockRaiseToSynch) -STUB(KeDeregisterBugCheckCallback) -STUB(KeDeregisterBugCheckReasonCallback) STUB(KeDeregisterNmiCallback) STUB(KeEnterCriticalRegion) STUB(KeEnterGuardedRegion) -STUB(KeEnterKernelDebugger) STUB(KeExpandKernelStackAndCallout) STUB(KeFlushEntireTb) STUB(KeGenericCallDpc) @@ -314,8 +162,6 @@ STUB(KeQueryMultiThreadProcessorSet) STUB(KeQueryPrcbAddress) STUB(KeReadStateMutex) -STUB(KeRegisterBugCheckCallback) -STUB(KeRegisterBugCheckReasonCallback) STUB(KeRegisterNmiCallback) STUB(KeReleaseInStackQueuedSpinLockForDpc) STUB(KeReleaseQueuedSpinLock) @@ -355,35 +201,17 @@ STUB(PoRequestShutdownEvent) STUB(PoSetHiberRange) STUB(PoShutdownBugCheck) -STUB(PsEstablishWin32Callouts) STUB(PsGetCurrentProcess) STUB(PsGetCurrentProcessWow64Process) STUB(PsGetCurrentThread) -STUB(PsGetCurrentThreadPreviousMode) STUB(PsGetCurrentThreadProcess) STUB(PsGetCurrentThreadProcessId) -STUB(PsGetCurrentThreadStackBase) -STUB(PsGetCurrentThreadStackLimit) STUB(PsGetCurrentThreadTeb) -STUB(PsGetCurrentThreadWin32Thread) STUB(PsGetCurrentThreadWin32ThreadAndEnterCriticalRegion) STUB(PsGetProcessSessionIdEx) STUB(PsGetProcessWow64Process) -STUB(PsGetThreadFreezeCount) -STUB(PsGetThreadHardErrorsAreDisabled) -STUB(PsGetThreadId) -STUB(PsGetThreadProcess) -STUB(PsGetThreadProcessId) -STUB(PsGetThreadSessionId) -STUB(PsGetThreadTeb) -STUB(PsGetThreadWin32Thread) STUB(PsIsSystemProcess) -STUB(PsIsSystemThread) -STUB(PsIsThreadImpersonating) -STUB(PsLookupThreadByThreadId) STUB(PsProcessType) -STUB(PsSetThreadHardErrorsAreDisabled) -STUB(PsSetThreadWin32Thread) STUB(PsWrapApcWow64Thread) STUB(RtlAnsiStringToUnicodeSize) STUB(RtlCompareMemoryUlong) @@ -409,14 +237,8 @@ STUB(RtlUnwindEx) STUB(RtlVirtualUnwind) STUB(RtlZeroMemory) -STUB(SeFilterToken) -STUB(SeQueryAuthenticationIdToken) -STUB(SeQueryInformationToken) -STUB(SeQuerySessionIdToken) STUB(SeReportSecurityEvent) STUB(SeSetAuditParameter) -STUB(SeTokenIsAdmin) -STUB(SeTokenIsRestricted) STUB(SeTokenObjectType) STUB(VfFailDeviceNode) STUB(VfFailDriver) @@ -443,4 +265,9 @@ STUB(KeAcquireInStackQueuedSpinLock) STUB(KeReleaseInStackQueuedSpinLock) STUB(KfAcquireSpinLock) -STUB(KeBugCheck) +STUB(KiSaveProcessorControlState) +STUB(KeProcessorArchitecture) +STUB(KeProcessorLevel) +STUB(KeProcessorRevision) +STUB(RtlpGetStackLimits) +STUB(KeSwitchKernelStack) Modified: branches/ros-amd64-bringup/reactos/ntoskrnl/ex/sysinfo.c URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/ntosk…
============================================================================== --- branches/ros-amd64-bringup/reactos/ntoskrnl/ex/sysinfo.c [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/ntoskrnl/ex/sysinfo.c [iso-8859-1] Wed Jul 30 21:20:15 2008 @@ -899,7 +899,7 @@ } CurrentTime.QuadPart = KeQueryInterruptTime(); - Prcb = KeGetPcr()->Prcb; + Prcb = KeGetCurrentPrcb(); for (i = 0; i < KeNumberProcessors; i++) { Spi->IdleTime.QuadPart = (Prcb->IdleThread->KernelTime + Prcb->IdleThread->UserTime) * 100000LL; @@ -1195,7 +1195,11 @@ for (i = 0; i < KeNumberProcessors; i++) { Prcb = KiProcessorBlock[i]; +#ifdef _M_AMD64 + Pcr = CONTAINING_RECORD(Prcb, KPCR, CurrentPrcb); +#else Pcr = CONTAINING_RECORD(Prcb, KPCR, Prcb); +#endif #ifdef _M_ARM // This code should probably be done differently sii->ContextSwitches = Pcr->ContextSwitches; #else @@ -1929,6 +1933,9 @@ for (;;); #elif defined(_M_ARM) __asm__ __volatile__("mov r1, #0; mcr p15, 0, r1, c7, c5, 0"); +#elif defined(_M_AMD64) + DPRINT1("NtFlushInstructionCache() is not implemented\n"); + for (;;); #else #error Unknown architecture #endif Modified: branches/ros-amd64-bringup/reactos/ntoskrnl/include/internal/ntoskrnl.h URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/ntosk…
============================================================================== --- branches/ros-amd64-bringup/reactos/ntoskrnl/include/internal/ntoskrnl.h [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/ntoskrnl/include/internal/ntoskrnl.h [iso-8859-1] Wed Jul 30 21:20:15 2008 @@ -70,6 +70,8 @@ #include "vdm.h" #include "hal.h" #include "arch/intrin_i.h" + +ULONG (*FrLdrDbgPrint)(const char *Format, ...); #include <pshpack1.h> /* Modified: branches/ros-amd64-bringup/reactos/ntoskrnl/ke/bug.c URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/ntosk…
============================================================================== --- branches/ros-amd64-bringup/reactos/ntoskrnl/ke/bug.c [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/ntoskrnl/ke/bug.c [iso-8859-1] Wed Jul 30 21:20:15 2008 @@ -227,7 +227,7 @@ return (USHORT)i; } - +#ifndef _M_AMD64 VOID FASTCALL KeRosDumpStackFrameArray(IN PULONG Frames, @@ -316,6 +316,7 @@ } } } +#endif VOID NTAPI @@ -725,8 +726,8 @@ /* Show the technical Data */ sprintf(AnsiName, - "\r\n\r\n*** STOP: 0x%08lX (0x%p,0x%p,0x%p,0x%p)\r\n\r\n", - KiBugCheckData[0], + "\r\n\r\n*** STOP: 0x%p (0x%p,0x%p,0x%p,0x%p)\r\n\r\n", + (PVOID)KiBugCheckData[0], (PVOID)KiBugCheckData[1], (PVOID)KiBugCheckData[2], (PVOID)KiBugCheckData[3], Modified: branches/ros-amd64-bringup/reactos/ntoskrnl/ntoskrnl-amd64hack.rbuild URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/ntosk…
============================================================================== --- branches/ros-amd64-bringup/reactos/ntoskrnl/ntoskrnl-amd64hack.rbuild [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/ntoskrnl/ntoskrnl-amd64hack.rbuild [iso-8859-1] Wed Jul 30 21:20:15 2008 @@ -96,7 +96,7 @@ </if> <file>apc.c</file> <file>balmgr.c</file> - <!-- file>bug.c</file --> + <file>bug.c</file> <file>clock.c</file> <file>config.c</file> <file>devqueue.c</file> @@ -170,7 +170,7 @@ </directory> <directory name="dbgk"> <file>dbgkutil.c</file> - <!-- file>dbgkobj.c</file --> + <file>dbgkobj.c</file> </directory> <directory name="ex" root="intermediate"> <file>zw.S</file> @@ -187,7 +187,7 @@ <file>callback.c</file> <file>dbgctrl.c</file> <file>efi.c</file> - <!-- file>event.c</file --> + <file>event.c</file> <file>evtpair.c</file> <file>exintrin.c</file> <file>fastinterlck.c</file> @@ -198,17 +198,17 @@ <file>init.c</file> <file>keyedevt.c</file> <file>locale.c</file> - <!-- file>lookas.c</file --> - <!-- file>mutant.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>sem.c</file> <file>shutdown.c</file> - <!-- file>sysinfo.c</file --> + <file>sysinfo.c</file> <file>time.c</file> - <!-- file>timer.c</file --> + <file>timer.c</file> <file>uuid.c</file> <file>win32k.c</file> <file>work.c</file> @@ -253,7 +253,7 @@ <file>drvrlist.c</file> <file>error.c</file> <file>file.c</file> - <!-- file>iocomp.c</file --> + <file>iocomp.c</file> <file>ioevent.c</file> <file>iofunc.c</file> <file>iomdl.c</file> @@ -266,7 +266,7 @@ <file>ramdisk.c</file> <file>rawfs.c</file> <file>remlock.c</file> - <!-- file>util.c</file --> + <file>util.c</file> <file>symlink.c</file> <file>volume.c</file> </directory> @@ -437,8 +437,8 @@ <file>quota.c</file> <file>security.c</file> <file>state.c</file> - <!-- file>thread.c</file --> - <!-- file>win32.c</file --> + <file>thread.c</file> + <file>win32.c</file> </directory> <directory name="rtl"> <if property="ARCH" value="arm"> @@ -446,7 +446,7 @@ <file>rtlexcpt.c</file> </directory> </if> - <!-- file>libsupp.c</file --> + <file>libsupp.c</file> <file>misc.c</file> <file>strtok.c</file> </directory> @@ -459,7 +459,7 @@ <file>sd.c</file> <file>semgr.c</file> <file>sid.c</file> - <!-- file>token.c</file --> + <file>token.c</file> </directory> <directory name="vdm"> <if property="ARCH" value="i386"> Modified: branches/ros-amd64-bringup/reactos/ntoskrnl/rtl/libsupp.c URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/ntosk…
============================================================================== --- branches/ros-amd64-bringup/reactos/ntoskrnl/rtl/libsupp.c [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/ntoskrnl/rtl/libsupp.c [iso-8859-1] Wed Jul 30 21:20:15 2008 @@ -211,7 +211,7 @@ return FALSE; } -#ifndef _ARM_ +#if !defined(_ARM_) && !defined(_AMD64_) BOOLEAN NTAPI
16 years, 4 months
1
0
0
0
[tkreuzer] 34970: - update KPCR and KIPCR - add KeGetPcr() and update KeGetCurrentProcessorNumber
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Wed Jul 30 21:16:59 2008 New Revision: 34970 URL:
http://svn.reactos.org/svn/reactos?rev=34970&view=rev
Log: - update KPCR and KIPCR - add KeGetPcr() and update KeGetCurrentProcessorNumber Modified: branches/ros-amd64-bringup/reactos/include/ddk/winddk.h branches/ros-amd64-bringup/reactos/include/ndk/amd64/ketypes.h Modified: branches/ros-amd64-bringup/reactos/include/ddk/winddk.h URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/inclu…
============================================================================== --- branches/ros-amd64-bringup/reactos/include/ddk/winddk.h [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/include/ddk/winddk.h [iso-8859-1] Wed Jul 30 21:16:59 2008 @@ -5516,23 +5516,38 @@ typedef struct _KPCR { - NT_TIB NtTib; - struct _KPRCB *CurrentPrcb; - ULONG64 SavedRcx; - ULONG64 SavedR11; + union + { + NT_TIB NtTib; + struct + { + union _KGDTENTRY64 *GdtBase; + struct _KTSS64 *TssBase; + ULONG64 UserRsp; + struct _KPCR *Self; + struct _KPRCB *CurrentPrcb; + PKSPIN_LOCK_QUEUE LockArray; + PVOID Used_Self; + }; + }; + union _KIDTENTRY64 *IdtBase; + ULONG64 Unused[2]; KIRQL Irql; UCHAR SecondLevelCacheAssociativity; - UCHAR Number; + UCHAR ObsoleteNumber; UCHAR Fill0; - ULONG Irr; - ULONG IrrActive; - ULONG Idr; + ULONG Unused0[3]; USHORT MajorVersion; USHORT MinorVersion; ULONG StallScaleFactor; - union _KIDTENTRY64 *IdtBase; - union _KGDTENTRY64 *GdtBase; - struct _KTSS64 *TssBase; + PVOID Unused1[3]; + ULONG KernelReserved[15]; + ULONG SecondLevelCacheSize; + ULONG HalReserved[16]; + ULONG Unused2; + PVOID KdVersionBlock; + PVOID Unused3; + ULONG PcrAlign1[24]; } KPCR, *PKPCR; typedef struct _KFLOATING_SAVE { @@ -5552,10 +5567,17 @@ VOID); FORCEINLINE +PKPCR +KeGetPcr(VOID) +{ + return (PKPCR)__readgsqword(FIELD_OFFSET(KPCR, Self)); +} + +FORCEINLINE ULONG KeGetCurrentProcessorNumber(VOID) { - return (ULONG)__readgsbyte(FIELD_OFFSET(KPCR, Number)); + return (ULONG)__readgsword(0x184); } #elif defined(__PowerPC__) Modified: branches/ros-amd64-bringup/reactos/include/ndk/amd64/ketypes.h URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/inclu…
============================================================================== --- branches/ros-amd64-bringup/reactos/include/ndk/amd64/ketypes.h [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/include/ndk/amd64/ketypes.h [iso-8859-1] Wed Jul 30 21:16:59 2008 @@ -635,41 +635,42 @@ NT_TIB NtTib; struct { - struct _EXCEPTION_REGISTRATION_RECORD *Used_ExceptionList; - PVOID Used_StackBase; - PVOID PerfGlobalGroupMask; - PVOID TssCopy; - ULONG ContextSwitches; - KAFFINITY SetMemberCopy; + union _KGDTENTRY64 *GdtBase; + struct _KTSS64 *TssBase; + ULONG64 UserRsp; + struct _KPCR *Self; + struct _KPRCB *CurrentPrcb; + PKSPIN_LOCK_QUEUE LockArray; PVOID Used_Self; }; }; - struct _KPCR *Self; - struct _KPRCB *Prcb; + union _KIDTENTRY64 *IdtBase; + ULONG64 Unused[2]; KIRQL Irql; - ULONG IRR; - ULONG IrrActive; - ULONG IDR; - PVOID KdVersionBlock; - PKIDTENTRY IDT; - PKGDTENTRY GDT; - struct _KTSS *TSS; + UCHAR SecondLevelCacheAssociativity; + UCHAR ObsoleteNumber; + UCHAR Fill0; + ULONG Unused0[3]; USHORT MajorVersion; USHORT MinorVersion; - KAFFINITY SetMember; ULONG StallScaleFactor; - UCHAR SparedUnused; - UCHAR Number; - UCHAR Reserved; - UCHAR L2CacheAssociativity; - ULONG VdmAlert; - ULONG KernelReserved[14]; + PVOID Unused1[3]; + ULONG KernelReserved[15]; ULONG SecondLevelCacheSize; ULONG HalReserved[16]; - ULONG InterruptMode; - UCHAR Spare1; - ULONG KernelReserved2[17]; - KPRCB PrcbData; + ULONG Unused2; + ULONG Fill1; + PVOID KdVersionBlock; // 0x108 + PVOID Unused3; + ULONG PcrAlign1[24]; + + ULONG Unknown1; // 0x178 + ULONG Unknown2; + ULONG Unknown3; + USHORT CpuNumber; // 0x184 + // hack: + ULONG ContextSwitches; + } KIPCR, *PKIPCR; #pragma pack(pop)
16 years, 4 months
1
0
0
0
[tkreuzer] 34969: - some ULONG / SIZE_T fixes - handle amd64 in PspCreateThread
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Wed Jul 30 19:35:26 2008 New Revision: 34969 URL:
http://svn.reactos.org/svn/reactos?rev=34969&view=rev
Log: - some ULONG / SIZE_T fixes - handle amd64 in PspCreateThread Modified: branches/ros-amd64-bringup/reactos/include/ndk/exfuncs.h branches/ros-amd64-bringup/reactos/ntoskrnl/ex/lookas.c branches/ros-amd64-bringup/reactos/ntoskrnl/include/internal/ke.h branches/ros-amd64-bringup/reactos/ntoskrnl/io/iomgr/error.c branches/ros-amd64-bringup/reactos/ntoskrnl/io/iomgr/util.c branches/ros-amd64-bringup/reactos/ntoskrnl/ps/thread.c Modified: branches/ros-amd64-bringup/reactos/include/ndk/exfuncs.h URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/inclu…
============================================================================== --- branches/ros-amd64-bringup/reactos/include/ndk/exfuncs.h [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/include/ndk/exfuncs.h [iso-8859-1] Wed Jul 30 19:35:26 2008 @@ -390,8 +390,8 @@ NtQuerySystemInformation( IN SYSTEM_INFORMATION_CLASS SystemInformationClass, OUT PVOID SystemInformation, - IN SIZE_T Length, - OUT PSIZE_T ResultLength + IN ULONG Length, + OUT PULONG ResultLength ); NTSYSCALLAPI @@ -539,7 +539,7 @@ NtSetSystemInformation( IN SYSTEM_INFORMATION_CLASS SystemInformationClass, IN PVOID SystemInformation, - IN SIZE_T SystemInformationLength + IN ULONG SystemInformationLength ); NTSYSCALLAPI Modified: branches/ros-amd64-bringup/reactos/ntoskrnl/ex/lookas.c URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/ntosk…
============================================================================== --- branches/ros-amd64-bringup/reactos/ntoskrnl/ex/lookas.c [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/ntoskrnl/ex/lookas.c [iso-8859-1] Wed Jul 30 19:35:26 2008 @@ -222,7 +222,7 @@ IN PALLOCATE_FUNCTION Allocate OPTIONAL, IN PFREE_FUNCTION Free OPTIONAL, IN ULONG Flags, - IN ULONG Size, + IN SIZE_T Size, IN ULONG Tag, IN USHORT Depth) { @@ -274,7 +274,7 @@ IN PALLOCATE_FUNCTION Allocate OPTIONAL, IN PFREE_FUNCTION Free OPTIONAL, IN ULONG Flags, - IN ULONG Size, + IN SIZE_T Size, IN ULONG Tag, IN USHORT Depth) { Modified: branches/ros-amd64-bringup/reactos/ntoskrnl/include/internal/ke.h URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/ntosk…
============================================================================== --- branches/ros-amd64-bringup/reactos/ntoskrnl/include/internal/ke.h [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/ntoskrnl/include/internal/ke.h [iso-8859-1] Wed Jul 30 19:35:26 2008 @@ -742,10 +742,10 @@ NTAPI KeBugCheckWithTf( ULONG BugCheckCode, - ULONG BugCheckParameter1, - ULONG BugCheckParameter2, - ULONG BugCheckParameter3, - ULONG BugCheckParameter4, + ULONG_PTR BugCheckParameter1, + ULONG_PTR BugCheckParameter2, + ULONG_PTR BugCheckParameter3, + ULONG_PTR BugCheckParameter4, PKTRAP_FRAME Tf ); Modified: branches/ros-amd64-bringup/reactos/ntoskrnl/io/iomgr/error.c URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/ntosk…
============================================================================== --- branches/ros-amd64-bringup/reactos/ntoskrnl/io/iomgr/error.c [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/ntoskrnl/io/iomgr/error.c [iso-8859-1] Wed Jul 30 19:35:26 2008 @@ -214,10 +214,10 @@ } /* Align the buffer */ - StringBuffer = (PVOID)ALIGN_UP(StringBuffer, WCHAR); + StringBuffer = ALIGN_UP_POINTER(StringBuffer, WCHAR); /* Set the offset for the driver's name to the current buffer */ - ErrorMessage->DriverNameOffset = (ULONG)(StringBuffer - + ErrorMessage->DriverNameOffset = (ULONG_PTR)(StringBuffer - (ULONG_PTR)ErrorMessage); /* Check how much space we have left for the device string */ Modified: branches/ros-amd64-bringup/reactos/ntoskrnl/io/iomgr/util.c URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/ntosk…
============================================================================== --- branches/ros-amd64-bringup/reactos/ntoskrnl/io/iomgr/util.c [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/ntoskrnl/io/iomgr/util.c [iso-8859-1] Wed Jul 30 19:35:26 2008 @@ -50,8 +50,8 @@ */ VOID NTAPI -IoGetStackLimits(OUT PULONG LowLimit, - OUT PULONG HighLimit) +IoGetStackLimits(OUT PULONG_PTR LowLimit, + OUT PULONG_PTR HighLimit) { PKPRCB Prcb = KeGetCurrentPrcb(); ULONG_PTR DpcStack = (ULONG_PTR)(Prcb->DpcStack); Modified: branches/ros-amd64-bringup/reactos/ntoskrnl/ps/thread.c URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/ntosk…
============================================================================== --- branches/ros-amd64-bringup/reactos/ntoskrnl/ps/thread.c [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/ntoskrnl/ps/thread.c [iso-8859-1] Wed Jul 30 19:35:26 2008 @@ -104,7 +104,7 @@ Prcb = KeGetCurrentPrcb(); NewCookie = Prcb->MmPageFaultCount ^ Prcb->InterruptTime ^ SystemTime.u.LowPart ^ SystemTime.u.HighPart ^ - (ULONG)&SystemTime; + (ULONG_PTR)&SystemTime; /* Set the new cookie*/ InterlockedCompareExchange((LONG*)&SharedUserData->Cookie, @@ -333,6 +333,9 @@ #elif defined(_M_ARM) Thread->StartAddress = (PVOID)ThreadContext->Pc; Thread->Win32StartAddress = (PVOID)ThreadContext->R0; +#elif defined(_M_AMD64) + Thread->StartAddress = (PVOID)ThreadContext->Rip; + Thread->Win32StartAddress = (PVOID)ThreadContext->Rax; #else #error Unknown architecture #endif
16 years, 4 months
1
0
0
0
← Newer
1
2
3
4
5
...
77
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
Results per page:
10
25
50
100
200