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
2025
April
March
February
January
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
February 2008
----- 2025 -----
April 2025
March 2025
February 2025
January 2025
----- 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
21 participants
460 discussions
Start a n
N
ew thread
[ros-arm-bringup] 32334: We now have a good initialization routine for ARM. We call HalInitializeProcessor (TBD) to setup the board, then we configure the PRCB and PCR. We also setup some global CPU variables and setup minimal interrupt support. The rest of the code follows the x86 design (Create initial thread/process). There's now a cpu.c for ARM as well, and the cache routines are now there. KDCOM APIs were marked as kernel stubs, so the kernel was never linking with kdcom. This has been fixe
by ros-arm-bringup@svn.reactos.org
Author: ros-arm-bringup Date: Wed Feb 13 01:50:54 2008 New Revision: 32334 URL:
http://svn.reactos.org/svn/reactos?rev=32334&view=rev
Log: We now have a good initialization routine for ARM. We call HalInitializeProcessor (TBD) to setup the board, then we configure the PRCB and PCR. We also setup some global CPU variables and setup minimal interrupt support. The rest of the code follows the x86 design (Create initial thread/process). There's now a cpu.c for ARM as well, and the cache routines are now there. KDCOM APIs were marked as kernel stubs, so the kernel was never linking with kdcom. This has been fixed, and boot now stops in kdcom!KdPortInitializeEx since there's no ARM-compatible code. Added: trunk/reactos/ntoskrnl/ke/arm/cpu.c (with props) Modified: trunk/reactos/drivers/base/kdcom/kdbg.c trunk/reactos/include/ndk/arm/ketypes.h trunk/reactos/include/reactos/armddk.h trunk/reactos/ntoskrnl/include/internal/arm/ke.h trunk/reactos/ntoskrnl/ke/arm/kiinit.c trunk/reactos/ntoskrnl/ke/arm/stubs_asm.s trunk/reactos/ntoskrnl/ntoskrnl.rbuild Modified: trunk/reactos/drivers/base/kdcom/kdbg.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/base/kdcom/kdbg.c?…
============================================================================== --- trunk/reactos/drivers/base/kdcom/kdbg.c (original) +++ trunk/reactos/drivers/base/kdcom/kdbg.c Wed Feb 13 01:50:54 2008 @@ -250,6 +250,11 @@ ULONG divisor; UCHAR lcr; +#ifdef _ARM_ + UNIMPLEMENTED; + while (TRUE); +#endif + if (PortInformation->BaudRate == 0) PortInformation->BaudRate = DEFAULT_BAUD_RATE; Modified: trunk/reactos/include/ndk/arm/ketypes.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/ndk/arm/ketypes.h?…
============================================================================== --- trunk/reactos/include/ndk/arm/ketypes.h (original) +++ trunk/reactos/include/ndk/arm/ketypes.h Wed Feb 13 01:50:54 2008 @@ -135,6 +135,7 @@ UCHAR NodeColor; UCHAR Spare1; ULONG NodeShiftedColor; + ULONG PcrPage; struct _KNODE *ParentNode; ULONG MultiThreadProcessorSet; struct _KPRCB *MultiThreadSetMaster; Modified: trunk/reactos/include/reactos/armddk.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/reactos/armddk.h?r…
============================================================================== --- trunk/reactos/include/reactos/armddk.h (original) +++ trunk/reactos/include/reactos/armddk.h Wed Feb 13 01:50:54 2008 @@ -23,6 +23,11 @@ #define USERPCR ((volatile KPCR * const)KIPCR) // +// Maximum IRQs +// +#define MAXIMUM_VECTOR 16 + +// // Just read it from the PCR // #define KeGetCurrentProcessorNumber() ((ULONG)(PCR->Number)) @@ -46,7 +51,7 @@ { ULONG MinorVersion; ULONG MajorVersion; - PKINTERRUPT_ROUTINE InterruptRoutine[16]; + PKINTERRUPT_ROUTINE InterruptRoutine[MAXIMUM_VECTOR]; PVOID XcodeDispatch; ULONG FirstLevelDcacheSize; ULONG FirstLevelDcacheFillSize; @@ -77,6 +82,7 @@ UCHAR CurrentIrql; KAFFINITY SetMember; struct _KTHREAD *CurrentThread; + ULONG ReservedVectors; KAFFINITY NotMember; ULONG SystemReserved[6]; ULONG DcacheAlignment; @@ -127,4 +133,17 @@ #define KeLowerIrql(NewIrql) KeSwapIrql(NewIrql) #define KeRaiseIrql(NewIrql, OldIrql) *(OldIrql) = KeSwapIrql(NewIrql) +// +// Cache clean and flush +// +VOID +HalSweepDcache( + VOID +); + +VOID +HalSweepIcache( + VOID +); + #endif Modified: trunk/reactos/ntoskrnl/include/internal/arm/ke.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/include/internal/…
============================================================================== --- trunk/reactos/ntoskrnl/include/internal/arm/ke.h (original) +++ trunk/reactos/ntoskrnl/include/internal/arm/ke.h Wed Feb 13 01:50:54 2008 @@ -148,6 +148,31 @@ IN PCONTEXT Context ); +VOID +KiPassiveRelease( + VOID + +); + +VOID +KiApcInterrupt( + VOID +); + +#include "mm.h" + +VOID +KeFillFixedEntryTb( + IN ARM_PTE Pte, + IN PVOID Virtual, + IN ULONG Index +); + +VOID +KeFlushTb( + VOID +); + #define KeArchInitThreadWithContext KeArmInitThreadWithContext #endif Added: trunk/reactos/ntoskrnl/ke/arm/cpu.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ke/arm/cpu.c?rev=…
============================================================================== --- trunk/reactos/ntoskrnl/ke/arm/cpu.c (added) +++ trunk/reactos/ntoskrnl/ke/arm/cpu.c Wed Feb 13 01:50:54 2008 @@ -1,0 +1,117 @@ +/* + * PROJECT: ReactOS Kernel + * LICENSE: GPL - See COPYING in the top level directory + * FILE: ntoskrnl/ke/arm/cpu.c + * PURPOSE: Implements routines for ARM CPU support + * PROGRAMMERS: ReactOS Portable Systems Group + */ + +/* INCLUDES *******************************************************************/ + +#include <ntoskrnl.h> +#define NDEBUG +#include <debug.h> + +/* GLOBALS ********************************************************************/ + +ULONG KeFixedTbEntries; +ULONG KiDmaIoCoherency; + +/* FUNCTIONS ******************************************************************/ + +VOID +KiFlushSingleTb(IN BOOLEAN Invalid, + IN PVOID Virtual) +{ + // + // Just invalidate it + // + KeArmInvalidateTlbEntry(Virtual); +} + +VOID +KeFillFixedEntryTb(IN ARM_PTE Pte, + IN PVOID Virtual, + IN ULONG Index) +{ + ARM_LOCKDOWN_REGISTER LockdownRegister; + ULONG OldVictimCount; + volatile unsigned long Temp; + PARM_TRANSLATION_TABLE TranslationTable; + + // + // Hack for 1MB Section Entries + // + Virtual = (PVOID)((ULONG)Virtual & 0xFFF00000); + + // + // On ARM, we can't set the index ourselves, so make sure that we are not + // locking down more than 8 entries. + // + UNREFERENCED_PARAMETER(Index); + KeFixedTbEntries++; + ASSERT(KeFixedTbEntries <= 8); + + // + // Flush the address + // + KiFlushSingleTb(TRUE, Virtual); + + // + // Read lockdown register and set the preserve bit + // + LockdownRegister = KeArmLockdownRegisterGet(); + LockdownRegister.Preserve = TRUE; + OldVictimCount = LockdownRegister.Victim; + KeArmLockdownRegisterSet(LockdownRegister); + + // + // Map the PTE for this virtual address + // + TranslationTable = (PVOID)KeArmTranslationTableRegisterGet().AsUlong; + TranslationTable->Pte[(ULONG)Virtual >> TTB_SHIFT] = Pte; + + // + // Now force a miss + // + Temp = *(PULONG)Virtual; + + // + // Read lockdown register + // + LockdownRegister = KeArmLockdownRegisterGet(); + if (LockdownRegister.Victim == 0) + { + // + // This can only happen on QEMU or broken CPUs since there *has* + // to have been at least a miss since the system started. For example, + // QEMU doesn't support TLB lockdown. + // + // On these systems, we'll just keep the PTE mapped + // + DPRINT1("TLB Lockdown Failure (%p). Running on QEMU?\n", Virtual); + } + else + { + // + // Clear the preserve bits + // + LockdownRegister.Preserve = FALSE; + ASSERT(LockdownRegister.Victim == OldVictimCount + 1); + KeArmLockdownRegisterSet(LockdownRegister); + + // + // Clear the PTE + // + TranslationTable->Pte[(ULONG)Virtual >> TTB_SHIFT].AsUlong = 0; + } +} + +VOID +KeFlushTb(VOID) +{ + // + // Flush the entire TLB + // + KeArmFlushTlb(); +} Propchange: trunk/reactos/ntoskrnl/ke/arm/cpu.c ------------------------------------------------------------------------------ svn:eol-style = native Propchange: trunk/reactos/ntoskrnl/ke/arm/cpu.c ------------------------------------------------------------------------------ svn:mime-type = text/plain Modified: trunk/reactos/ntoskrnl/ke/arm/kiinit.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ke/arm/kiinit.c?r…
============================================================================== --- trunk/reactos/ntoskrnl/ke/arm/kiinit.c (original) +++ trunk/reactos/ntoskrnl/ke/arm/kiinit.c Wed Feb 13 01:50:54 2008 @@ -14,14 +14,10 @@ /* GLOBALS ********************************************************************/ +KINTERRUPT KxUnexpectedInterrupt; BOOLEAN KeIsArmV6; -ULONG KeFixedTbEntries; ULONG KeNumberProcessIds; ULONG KeNumberTbEntries; - -VOID HalSweepDcache(VOID); -VOID HalSweepIcache(VOID); - #define __ARMV6__ KeIsArmV6 // @@ -42,103 +38,6 @@ // void arm_kprintf(const char *fmt, ...); arm_kprintf("%s", Buffer); -} - -VOID -KiFlushSingleTb(IN BOOLEAN Invalid, - IN PVOID Virtual) -{ - // - // Just invalidate it - // - KeArmInvalidateTlbEntry(Virtual); -} - -VOID -KeFillFixedEntryTb(IN ARM_PTE Pte, - IN PVOID Virtual, - IN ULONG Index) -{ - ARM_LOCKDOWN_REGISTER LockdownRegister; - ULONG OldVictimCount; - volatile unsigned long Temp; - PARM_TRANSLATION_TABLE TranslationTable; - - // - // Hack for 1MB Section Entries - // - Virtual = (PVOID)((ULONG)Virtual & 0xFFF00000); - - // - // On ARM, we can't set the index ourselves, so make sure that we are not - // locking down more than 8 entries. - // - UNREFERENCED_PARAMETER(Index); - KeFixedTbEntries++; - ASSERT(KeFixedTbEntries <= 8); - - // - // Flush the address - // - KiFlushSingleTb(TRUE, Virtual); - - // - // Read lockdown register and set the preserve bit - // - LockdownRegister = KeArmLockdownRegisterGet(); - LockdownRegister.Preserve = TRUE; - OldVictimCount = LockdownRegister.Victim; - KeArmLockdownRegisterSet(LockdownRegister); - - // - // Map the PTE for this virtual address - // - TranslationTable = (PVOID)KeArmTranslationTableRegisterGet().AsUlong; - TranslationTable->Pte[(ULONG)Virtual >> TTB_SHIFT] = Pte; - - // - // Now force a miss - // - Temp = *(PULONG)Virtual; - - // - // Read lockdown register - // - LockdownRegister = KeArmLockdownRegisterGet(); - if (LockdownRegister.Victim == 0) - { - // - // This can only happen on QEMU or broken CPUs since there *has* - // to have been at least a miss since the system started. For example, - // QEMU doesn't support TLB lockdown. - // - // On these systems, we'll just keep the PTE mapped - // - DPRINT1("TLB Lockdown Failure (%p). Running on QEMU?\n", Virtual); - } - else - { - // - // Clear the preserve bits - // - LockdownRegister.Preserve = FALSE; - ASSERT(LockdownRegister.Victim == OldVictimCount + 1); - KeArmLockdownRegisterSet(LockdownRegister); - - // - // Clear the PTE - // - TranslationTable->Pte[(ULONG)Virtual >> TTB_SHIFT].AsUlong = 0; - } -} - -VOID -KeFlushTb(VOID) -{ - // - // Flush the entire TLB - // - KeArmFlushTlb(); } VOID @@ -151,34 +50,164 @@ IN PLOADER_PARAMETER_BLOCK LoaderBlock) { LARGE_INTEGER PageDirectory; - PVOID DpcStack; + PKPCR Pcr; + ULONG i; DPRINT1("%s Process: %p Thread: %p Stack: %p PRCB: %p Number: %d LoaderBlock: %p\n", __FUNCTION__, InitProcess, InitThread, IdleStack, Prcb, Number, LoaderBlock); - /* Initialize the Power Management Support for this PRCB */ - PoInitializePrcb(Prcb); - - /* Save CPU state */ - KiSaveProcessorControlState(&Prcb->ProcessorState); - - /* Initialize spinlocks and DPC data */ + // + // Initialize the platform + // + HalInitializeProcessor(Number, LoaderBlock); + + // + // Save loader block + // + KeLoaderBlock = LoaderBlock; + + // + // Setup KPRCB + // + Prcb->MajorVersion = 1; + Prcb->MinorVersion = 1; + Prcb->BuildType = 0; +#ifndef CONFIG_SMP + Prcb->BuildType |= PRCB_BUILD_UNIPROCESSOR; +#endif +#ifdef DBG + Prcb->BuildType |= PRCB_BUILD_DEBUG; +#endif + Prcb->CurrentThread = InitThread; + Prcb->NextThread = NULL; + Prcb->IdleThread = InitThread; + Prcb->Number = Number; + Prcb->SetMember = 1 << Number; + Prcb->PcrPage = LoaderBlock->u.Arm.PcrPage; + + // + // Initialize spinlocks and DPC data + // KiInitSpinLocks(Prcb, Number); - - /* Check if this is the Boot CPU */ + + // + // Set the PRCB in the processor block + // + KiProcessorBlock[(ULONG)Number] = Prcb; + Pcr = (PKPCR)KeGetPcr(); + + // + // Set processor information + // + KeProcessorArchitecture = PROCESSOR_ARCHITECTURE_ARM; + KeFeatureBits = 0; + KeProcessorLevel = (USHORT)(Pcr->ProcessorId >> 8); + KeProcessorRevision = (USHORT)(Pcr->ProcessorId & 0xFF); + + // + // Set stack pointers + // + Pcr->InitialStack = IdleStack; + Pcr->StackLimit = (PVOID)((ULONG_PTR)IdleStack - KERNEL_STACK_SIZE); + + // + // Check if this is the Boot CPU + // if (!Number) { - /* Set Node Data */ - KeNodeBlock[0] = &KiNode0; - Prcb->ParentNode = KeNodeBlock[0]; - KeNodeBlock[0]->ProcessorMask = Prcb->SetMember; - - /* Lower to APC_LEVEL */ - KeLowerIrql(APC_LEVEL); + // + // Setup the unexpected interrupt + // + KxUnexpectedInterrupt.DispatchAddress = KiUnexpectedInterrupt; + for (i = 0; i < 4; i++) + { + // + // Copy the template code + // + KxUnexpectedInterrupt.DispatchCode[i] = KiInterruptTemplate[i]; + } - /* Initialize portable parts of the OS */ + // + // Set DMA coherency + // + KiDmaIoCoherency = 0; + + // + // Sweep D-Cache + // + HalSweepDcache(); + } + + // + // Set all interrupt routines to unexpected interrupts as well + // + for (i = 0; i < MAXIMUM_VECTOR; i++) + { + // + // Point to the same template + // + Pcr->InterruptRoutine[i] = &KxUnexpectedInterrupt.DispatchCode; + } + + // + // Setup profiling + // + Pcr->ProfileCount = 0; + Pcr->ProfileInterval = 0x200000; + Pcr->StallScaleFactor = 50; + + // + // Setup software interrupts + // + Pcr->InterruptRoutine[PASSIVE_LEVEL] = KiPassiveRelease; + Pcr->InterruptRoutine[APC_LEVEL] = KiApcInterrupt; + Pcr->InterruptRoutine[DISPATCH_LEVEL] = KiDispatchInterrupt; + Pcr->ReservedVectors = (1 << PASSIVE_LEVEL) | + (1 << APC_LEVEL) | + (1 << DISPATCH_LEVEL) | + (1 << IPI_LEVEL); + + // + // Set IRQL and prcessor member/number + // + Pcr->CurrentIrql = APC_LEVEL; + Pcr->SetMember = 1 << Number; + Pcr->NotMember = -Pcr->SetMember; + Pcr->Number = Number; + + // + // Remember our parent + // + InitThread->ApcState.Process = InitProcess; + + // + // Setup the active processor numbers + // + KeActiveProcessors |= 1 << Number; + KeNumberProcessors = Number + 1; + + // + // Check if this is the boot CPU + // + if (!Number) + { + // + // Setup KD + // + KdInitSystem(0, LoaderBlock); + + // + // Cleanup the rest of the processor block array + // + for (i = 1; i < MAXIMUM_PROCESSORS; i++) KiProcessorBlock[i] = NULL; + + // + // Initialize portable parts of the OS + // KiInitSystem(); - - /* Initialize the Idle Process and the Process Listhead */ + + // + // Initialize the Idle Process and the Process Listhead + // InitializeListHead(&KiProcessListHead); PageDirectory.QuadPart = 0; KeInitializeProcess(InitProcess, @@ -190,11 +219,15 @@ } else { - /* FIXME */ - DPRINT1("SMP Boot support not yet present\n"); - } - - /* Setup the Idle Thread */ + // + // FIXME + // + DPRINT1("ARM MPCore not supported\n"); + } + + // + // Setup the Idle Thread + // KeInitializeThread(InitProcess, InitThread, NULL, @@ -209,61 +242,68 @@ InitThread->Affinity = 1 << Number; InitThread->WaitIrql = DISPATCH_LEVEL; InitProcess->ActiveProcessors = 1 << Number; - - /* HACK for MmUpdatePageDir */ + + // + // HACK for MmUpdatePageDir + // ((PETHREAD)InitThread)->ThreadsProcess = (PEPROCESS)InitProcess; - - /* Initialize Kernel Memory Address Space */ + + // + // Initialize Kernel Memory Address Space + // MmInit1(MmFreeLdrFirstKrnlPhysAddr, MmFreeLdrLastKrnlPhysAddr, MmFreeLdrLastKernelAddress, NULL, 0, 4096); - - /* Set basic CPU Features that user mode can read */ - - /* Set up the thread-related fields in the PRCB */ - Prcb->CurrentThread = InitThread; - Prcb->NextThread = NULL; - Prcb->IdleThread = InitThread; - - /* Initialize the Kernel Executive */ + + // + // Initialize the Kernel Executive + // ExpInitializeExecutive(Number, LoaderBlock); - /* Only do this on the boot CPU */ + // + // Only do this on the boot CPU + // if (!Number) { - /* Calculate the time reciprocal */ + // + // Calculate the time reciprocal + // KiTimeIncrementReciprocal = KiComputeReciprocal(KeMaximumIncrement, &KiTimeIncrementShiftCount); - /* Update DPC Values in case they got updated by the executive */ + // + // Update DPC Values in case they got updated by the executive + // Prcb->MaximumDpcQueueDepth = KiMaximumDpcQueueDepth; Prcb->MinimumDpcRate = KiMinimumDpcRate; Prcb->AdjustDpcThreshold = KiAdjustDpcThreshold; - - /* Allocate the DPC Stack */ - DpcStack = MmCreateKernelStack(FALSE, 0); - if (!DpcStack) KeBugCheckEx(NO_PAGES_AVAILABLE, 1, 0, 0, 0); - Prcb->DpcStack = DpcStack; - } - - /* Raise to Dispatch */ + } + + // + // Raise to Dispatch + // KeSwapIrql(DISPATCH_LEVEL); - /* Set the Idle Priority to 0. This will jump into Phase 1 */ + // + // Set the Idle Priority to 0. This will jump into Phase 1 + // KeSetPriorityThread(InitThread, 0); - /* If there's no thread scheduled, put this CPU in the Idle summary */ + // + // If there's no thread scheduled, put this CPU in the Idle summary + // KiAcquirePrcbLock(Prcb); if (!Prcb->NextThread) KiIdleSummary |= 1 << Number; KiReleasePrcbLock(Prcb); - /* Raise back to HIGH_LEVEL and clear the PRCB for the loader block */ + // + // Raise back to HIGH_LEVEL + // KeSwapIrql(HIGH_LEVEL); - LoaderBlock->Prcb = 0; } VOID 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 (original) +++ trunk/reactos/ntoskrnl/ke/arm/stubs_asm.s Wed Feb 13 01:50:54 2008 @@ -62,6 +62,9 @@ GENERATE_ARM_STUB Kei386EoiHelper GENERATE_ARM_STUB KiCoprocessorError GENERATE_ARM_STUB KiDispatchInterrupt +GENERATE_ARM_STUB KiApcInterrupt +GENERATE_ARM_STUB KiPassiveRelease +GENERATE_ARM_STUB KiInterruptTemplate GENERATE_ARM_STUB KiUnexpectedInterrupt GENERATE_ARM_STUB MmGetPhysicalAddress GENERATE_ARM_STUB NtVdmControl @@ -122,7 +125,6 @@ GENERATE_ARM_STUB MmCreateVirtualMapping GENERATE_ARM_STUB CmpInitializeMachineDependentConfiguration GENERATE_ARM_STUB KeI386VdmInitialize -GENERATE_ARM_STUB KdDebuggerInitialize1 GENERATE_ARM_STUB MmSetDirtyPage GENERATE_ARM_STUB MmSetCleanPage GENERATE_ARM_STUB MmIsDirtyPage @@ -146,8 +148,6 @@ GENERATE_ARM_STUB RtlpGetExceptionAddress GENERATE_ARM_STUB RtlDispatchException GENERATE_ARM_STUB DebugService2 -GENERATE_ARM_STUB KdPortPutByteEx -GENERATE_ARM_STUB KdPortInitializeEx GENERATE_ARM_STUB KdpGdbStubInit GENERATE_ARM_STUB KeSwitchKernelStack GENERATE_ARM_STUB MiInitPageDirectoryMap Modified: trunk/reactos/ntoskrnl/ntoskrnl.rbuild URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ntoskrnl.rbuild?r…
============================================================================== --- trunk/reactos/ntoskrnl/ntoskrnl.rbuild (original) +++ trunk/reactos/ntoskrnl/ntoskrnl.rbuild Wed Feb 13 01:50:54 2008 @@ -61,6 +61,7 @@ <directory name="arm"> <file first="true">boot.s</file> <file>arm_kprintf.c</file> + <file>cpu.c</file> <file>kiinit.c</file> <file>stubs_asm.s</file> <file>stubs.c</file>
17 years, 2 months
1
0
0
0
[ros-arm-bringup] 32333: Added cache sweeping code into the HAL, for ARM926EJ-S and ARM1026EJ-S CPUs. Finished implementation of KiSystemStartup. Copied KiInitializeKernel from x86 to ARM, removing irrelevant parts. This is our current checkpoint.
by ros-arm-bringup@svn.reactos.org
Author: ros-arm-bringup Date: Tue Feb 12 23:32:23 2008 New Revision: 32333 URL:
http://svn.reactos.org/svn/reactos?rev=32333&view=rev
Log: Added cache sweeping code into the HAL, for ARM926EJ-S and ARM1026EJ-S CPUs. Finished implementation of KiSystemStartup. Copied KiInitializeKernel from x86 to ARM, removing irrelevant parts. This is our current checkpoint. Modified: trunk/reactos/hal/halarm/generic/hal.c trunk/reactos/include/ddk/winddk.h trunk/reactos/ntoskrnl/include/internal/arm/intrin_i.h trunk/reactos/ntoskrnl/ke/arm/kiinit.c Modified: trunk/reactos/hal/halarm/generic/hal.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/hal/halarm/generic/hal.c?r…
============================================================================== --- trunk/reactos/hal/halarm/generic/hal.c (original) +++ trunk/reactos/hal/halarm/generic/hal.c Tue Feb 12 23:32:23 2008 @@ -17,6 +17,8 @@ #include <ndk/halfuncs.h> #include <ndk/iofuncs.h> #include <ndk/kdfuncs.h> +#include <internal/arm/ke.h> +#include <internal/arm/intrin_i.h> #define NDEBUG #include <debug.h> @@ -1090,16 +1092,66 @@ return 0; } +BOOLEAN HalpProcessorIdentified; +BOOLEAN HalpTestCleanSupported; + +VOID +HalpIdentifyProcessor(VOID) +{ + ARM_ID_CODE_REGISTER IdRegister; + + // + // Don't do it again + // + HalpProcessorIdentified = TRUE; + + // + // Read the ID Code + // + IdRegister = KeArmIdCodeRegisterGet(); + + // + // Architecture "6" CPUs support test-and-clean (926EJ-S and 1026EJ-S) + // + HalpTestCleanSupported = (IdRegister.Architecture == 6); +} + + VOID HalSweepDcache(VOID) { - UNIMPLEMENTED; + // + // We get called very early on, before HalInitSystem or any of the Hal* + // processor routines, so we need to figure out what CPU we're on. + // + if (!HalpProcessorIdentified) HalpIdentifyProcessor(); + + // + // Check if we can do it the ARMv5TE-J way + // + if (HalpTestCleanSupported) + { + // + // Test, clean, flush D-Cache + // + __asm__ __volatile__ ("1: mrc p15, 0, pc, c7, c14, 3; bne 1b"); + } + else + { + // + // We need to do it it by set/way + // + UNIMPLEMENTED; + } } VOID HalSweepIcache(VOID) { - UNIMPLEMENTED; + // + // All ARM cores support the same Icache flush command, no need for HAL work + // + KeArmFlushIcache(); } /* EOF */ Modified: trunk/reactos/include/ddk/winddk.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/ddk/winddk.h?rev=3…
============================================================================== --- trunk/reactos/include/ddk/winddk.h (original) +++ trunk/reactos/include/ddk/winddk.h Tue Feb 12 23:32:23 2008 @@ -5368,7 +5368,9 @@ /* ** Architecture specific structures */ - +#define PCR_MINOR_VERSION 1 +#define PCR_MAJOR_VERSION 1 + #ifdef _X86_ typedef ULONG PFN_NUMBER, *PPFN_NUMBER; @@ -5396,9 +5398,6 @@ PVOID ArbitraryUserPointer; /* 14 */ struct _KPCR_TIB *Self; /* 18 */ } KPCR_TIB, *PKPCR_TIB; /* 1C */ - -#define PCR_MINOR_VERSION 1 -#define PCR_MAJOR_VERSION 1 typedef struct _KPCR { KPCR_TIB Tib; /* 00 */ Modified: trunk/reactos/ntoskrnl/include/internal/arm/intrin_i.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/include/internal/…
============================================================================== --- trunk/reactos/ntoskrnl/include/internal/arm/intrin_i.h (original) +++ trunk/reactos/ntoskrnl/include/internal/arm/intrin_i.h Tue Feb 12 23:32:23 2008 @@ -99,5 +99,12 @@ __asm__ __volatile__ ("mcr p15, 0, %0, c8, c7, 1" : : "r"(Address) : "cc"); } +FORCEINLINE +VOID +KeArmFlushIcache(VOID) +{ + __asm__ __volatile__ ("mcr p15, 0, %0, c7, c5, 0" : : "r"(0) : "cc"); +} + #endif Modified: trunk/reactos/ntoskrnl/ke/arm/kiinit.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ke/arm/kiinit.c?r…
============================================================================== --- trunk/reactos/ntoskrnl/ke/arm/kiinit.c (original) +++ trunk/reactos/ntoskrnl/ke/arm/kiinit.c Tue Feb 12 23:32:23 2008 @@ -139,6 +139,131 @@ // Flush the entire TLB // KeArmFlushTlb(); +} + +VOID +NTAPI +KiInitializeKernel(IN PKPROCESS InitProcess, + IN PKTHREAD InitThread, + IN PVOID IdleStack, + IN PKPRCB Prcb, + IN CCHAR Number, + IN PLOADER_PARAMETER_BLOCK LoaderBlock) +{ + LARGE_INTEGER PageDirectory; + PVOID DpcStack; + DPRINT1("%s Process: %p Thread: %p Stack: %p PRCB: %p Number: %d LoaderBlock: %p\n", + __FUNCTION__, InitProcess, InitThread, IdleStack, Prcb, Number, LoaderBlock); + + /* Initialize the Power Management Support for this PRCB */ + PoInitializePrcb(Prcb); + + /* Save CPU state */ + KiSaveProcessorControlState(&Prcb->ProcessorState); + + /* Initialize spinlocks and DPC data */ + KiInitSpinLocks(Prcb, Number); + + /* Check if this is the Boot CPU */ + if (!Number) + { + /* Set Node Data */ + KeNodeBlock[0] = &KiNode0; + Prcb->ParentNode = KeNodeBlock[0]; + KeNodeBlock[0]->ProcessorMask = Prcb->SetMember; + + /* Lower to APC_LEVEL */ + KeLowerIrql(APC_LEVEL); + + /* Initialize portable parts of the OS */ + KiInitSystem(); + + /* Initialize the Idle Process and the Process Listhead */ + InitializeListHead(&KiProcessListHead); + PageDirectory.QuadPart = 0; + KeInitializeProcess(InitProcess, + 0, + 0xFFFFFFFF, + &PageDirectory, + FALSE); + InitProcess->QuantumReset = MAXCHAR; + } + else + { + /* FIXME */ + DPRINT1("SMP Boot support not yet present\n"); + } + + /* Setup the Idle Thread */ + KeInitializeThread(InitProcess, + InitThread, + NULL, + NULL, + NULL, + NULL, + NULL, + IdleStack); + InitThread->NextProcessor = Number; + InitThread->Priority = HIGH_PRIORITY; + InitThread->State = Running; + InitThread->Affinity = 1 << Number; + InitThread->WaitIrql = DISPATCH_LEVEL; + InitProcess->ActiveProcessors = 1 << Number; + + /* HACK for MmUpdatePageDir */ + ((PETHREAD)InitThread)->ThreadsProcess = (PEPROCESS)InitProcess; + + /* Initialize Kernel Memory Address Space */ + MmInit1(MmFreeLdrFirstKrnlPhysAddr, + MmFreeLdrLastKrnlPhysAddr, + MmFreeLdrLastKernelAddress, + NULL, + 0, + 4096); + + /* Set basic CPU Features that user mode can read */ + + /* Set up the thread-related fields in the PRCB */ + Prcb->CurrentThread = InitThread; + Prcb->NextThread = NULL; + Prcb->IdleThread = InitThread; + + /* Initialize the Kernel Executive */ + ExpInitializeExecutive(Number, LoaderBlock); + + /* Only do this on the boot CPU */ + if (!Number) + { + /* Calculate the time reciprocal */ + KiTimeIncrementReciprocal = + KiComputeReciprocal(KeMaximumIncrement, + &KiTimeIncrementShiftCount); + + /* Update DPC Values in case they got updated by the executive */ + Prcb->MaximumDpcQueueDepth = KiMaximumDpcQueueDepth; + Prcb->MinimumDpcRate = KiMinimumDpcRate; + Prcb->AdjustDpcThreshold = KiAdjustDpcThreshold; + + /* Allocate the DPC Stack */ + DpcStack = MmCreateKernelStack(FALSE, 0); + if (!DpcStack) KeBugCheckEx(NO_PAGES_AVAILABLE, 1, 0, 0, 0); + Prcb->DpcStack = DpcStack; + } + + /* Raise to Dispatch */ + KeSwapIrql(DISPATCH_LEVEL); + + /* Set the Idle Priority to 0. This will jump into Phase 1 */ + KeSetPriorityThread(InitThread, 0); + + /* If there's no thread scheduled, put this CPU in the Idle summary */ + KiAcquirePrcbLock(Prcb); + if (!Prcb->NextThread) KiIdleSummary |= 1 << Number; + KiReleasePrcbLock(Prcb); + + /* Raise back to HIGH_LEVEL and clear the PRCB for the loader block */ + KeSwapIrql(HIGH_LEVEL); + LoaderBlock->Prcb = 0; } VOID @@ -281,5 +406,54 @@ // HalSweepIcache(); HalSweepDcache(); + + // + // Set PCR version + // + Pcr->MinorVersion = PCR_MINOR_VERSION; + Pcr->MajorVersion = PCR_MAJOR_VERSION; + + // + // Set boot PRCB + // + Pcr->Prcb = (PKPRCB)LoaderBlock->Prcb; + + // + // Set the different stacks + // + Pcr->InitialStack = (PVOID)LoaderBlock->KernelStack; + Pcr->PanicStack = (PVOID)LoaderBlock->u.Arm.PanicStack; + Pcr->InterruptStack = (PVOID)LoaderBlock->u.Arm.InterruptStack; + + // + // Set the current thread + // + Pcr->CurrentThread = (PKTHREAD)LoaderBlock->Thread; + + // + // Set the current IRQL to high + // + Pcr->CurrentIrql = HIGH_LEVEL; + + // + // Set processor information + // + Pcr->ProcessorId = KeArmIdCodeRegisterGet().AsUlong; + Pcr->SystemReserved[0] = KeArmControlRegisterGet().AsUlong; + + // + // Initialize the rest of the kernel now + // + KiInitializeKernel((PKPROCESS)LoaderBlock->Process, + (PKTHREAD)LoaderBlock->Thread, + (PVOID)LoaderBlock->KernelStack, + (PKPRCB)LoaderBlock->Prcb, + Pcr->Prcb->Number, + LoaderBlock); + + + // + // Jump to idle loop + // while (TRUE); }
17 years, 2 months
1
0
0
0
[frik85] 32332: minor language fix
by frik85@svn.reactos.org
Author: frik85 Date: Tue Feb 12 22:55:06 2008 New Revision: 32332 URL:
http://svn.reactos.org/svn/reactos?rev=32332&view=rev
Log: minor language fix Modified:
trunk/web/reactos.org/htdocs/peoplemap/lang/en.inc.php
Modified:
trunk/web/reactos.org/htdocs/peoplemap/lang/en.inc.php
URL:
http://svn.reactos.org/svn/reactos/trunk/web/reactos.org/htdocs/peoplemap/l…
============================================================================== ---
trunk/web/reactos.org/htdocs/peoplemap/lang/en.inc.php
(original) +++
trunk/web/reactos.org/htdocs/peoplemap/lang/en.inc.php
Tue Feb 12 22:55:06 2008 @@ -11,7 +11,7 @@ /**** English resources (charset=utf-8) ****/ $peoplemap_langres["language"] = "Language"; - $peoplemap_langres["header"] = '<a href="
http://www.reactos.org/
">Startseite</a> > ReactOS People Map'; + $peoplemap_langres["header"] = '<a href="
http://www.reactos.org/
">Home</a> > ReactOS People Map'; $peoplemap_langres["title"] = "ReactOS People Map"; $peoplemap_langres["intro"] = "The following map shows the locations of ReactOS Developers and Users";
17 years, 2 months
1
0
0
0
[frik85] 32331: improve the user group selection area, by hiding unimportant entries
by frik85@svn.reactos.org
Author: frik85 Date: Tue Feb 12 22:35:00 2008 New Revision: 32331 URL:
http://svn.reactos.org/svn/reactos?rev=32331&view=rev
Log: improve the user group selection area, by hiding unimportant entries Modified:
trunk/web/reactos.org/htdocs/peoplemap/index.php
Modified:
trunk/web/reactos.org/htdocs/peoplemap/index.php
URL:
http://svn.reactos.org/svn/reactos/trunk/web/reactos.org/htdocs/peoplemap/i…
============================================================================== ---
trunk/web/reactos.org/htdocs/peoplemap/index.php
(original) +++
trunk/web/reactos.org/htdocs/peoplemap/index.php
Tue Feb 12 22:35:00 2008 @@ -130,7 +130,7 @@ // We need a DB connection for getting the user groups and checking if the user is logged in $db = mysql_connect($DB_HOST, $DB_USER, $DB_PASS) or die("Could not connect to the database!"); - $query = "SELECT usrgroup_name_id, usrgroup_name FROM $DB_ROSCMS.usergroups"; + $query = "SELECT usrgroup_name_id, usrgroup_name FROM $DB_ROSCMS.usergroups WHERE usrgroup_visible = 1;"; $result = mysql_query($query, $db) or die("Query failed #1!"); echo "<table>";
17 years, 2 months
1
0
0
0
[ros-arm-bringup] 32330: QEMU doesn't support TLB Lockdown, so we now use a hack for QEMU and broken CPUs [albeit a portable one ; -)]. PCR access in usermode/kernelmode works. We now have HalSweepI/Dcache APIs exported and stubbed in the ARM HAL (great, since UNIMPLEMENTED macro now works). We now setup more of the PCR, including all the cache values required, then we call the HAL sweep functions (TBD).
by ros-arm-bringup@svn.reactos.org
Author: ros-arm-bringup Date: Tue Feb 12 22:01:48 2008 New Revision: 32330 URL:
http://svn.reactos.org/svn/reactos?rev=32330&view=rev
Log: QEMU doesn't support TLB Lockdown, so we now use a hack for QEMU and broken CPUs [albeit a portable one ;-)]. PCR access in usermode/kernelmode works. We now have HalSweepI/Dcache APIs exported and stubbed in the ARM HAL (great, since UNIMPLEMENTED macro now works). We now setup more of the PCR, including all the cache values required, then we call the HAL sweep functions (TBD). Modified: trunk/reactos/hal/hal/hal_arm.def trunk/reactos/hal/halarm/generic/hal.c trunk/reactos/ntoskrnl/ke/arm/kiinit.c Modified: trunk/reactos/hal/hal/hal_arm.def URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/hal/hal/hal_arm.def?rev=32…
============================================================================== --- trunk/reactos/hal/hal/hal_arm.def (original) +++ trunk/reactos/hal/hal/hal_arm.def Tue Feb 12 22:01:48 2008 @@ -64,6 +64,8 @@ HalStartNextProcessor HalStartProfileInterrupt HalStopProfileInterrupt +HalSweepIcache +HalSweepDcache HalTranslateBusAddress IoAssignDriveLetters=HalpAssignDriveLetters IoFlushAdapterBuffers Modified: trunk/reactos/hal/halarm/generic/hal.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/hal/halarm/generic/hal.c?r…
============================================================================== --- trunk/reactos/hal/halarm/generic/hal.c (original) +++ trunk/reactos/hal/halarm/generic/hal.c Tue Feb 12 22:01:48 2008 @@ -1089,4 +1089,17 @@ UNIMPLEMENTED; return 0; } + +VOID +HalSweepDcache(VOID) +{ + UNIMPLEMENTED; +} + +VOID +HalSweepIcache(VOID) +{ + UNIMPLEMENTED; +} + /* EOF */ Modified: trunk/reactos/ntoskrnl/ke/arm/kiinit.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ke/arm/kiinit.c?r…
============================================================================== --- trunk/reactos/ntoskrnl/ke/arm/kiinit.c (original) +++ trunk/reactos/ntoskrnl/ke/arm/kiinit.c Tue Feb 12 22:01:48 2008 @@ -19,6 +19,9 @@ ULONG KeNumberProcessIds; ULONG KeNumberTbEntries; +VOID HalSweepDcache(VOID); +VOID HalSweepIcache(VOID); + #define __ARMV6__ KeIsArmV6 // @@ -99,17 +102,34 @@ Temp = *(PULONG)Virtual; // - // Read lockdown register and clear the preserve bit + // Read lockdown register // LockdownRegister = KeArmLockdownRegisterGet(); - LockdownRegister.Preserve = FALSE; - ASSERT(LockdownRegister.Victim == OldVictimCount + 1); - KeArmLockdownRegisterSet(LockdownRegister); - - // - // Clear the PTE - // - TranslationTable->Pte[(ULONG)Virtual >> TTB_SHIFT].AsUlong = 0; + if (LockdownRegister.Victim == 0) + { + // + // This can only happen on QEMU or broken CPUs since there *has* + // to have been at least a miss since the system started. For example, + // QEMU doesn't support TLB lockdown. + // + // On these systems, we'll just keep the PTE mapped + // + DPRINT1("TLB Lockdown Failure (%p). Running on QEMU?\n", Virtual); + } + else + { + // + // Clear the preserve bits + // + LockdownRegister.Preserve = FALSE; + ASSERT(LockdownRegister.Victim == OldVictimCount + 1); + KeArmLockdownRegisterSet(LockdownRegister); + + // + // Clear the PTE + // + TranslationTable->Pte[(ULONG)Virtual >> TTB_SHIFT].AsUlong = 0; + } } VOID @@ -188,10 +208,78 @@ KeFillFixedEntryTb(Pte, (PVOID)USPCR, PCR_ENTRY + 1); // - // Now we should be able to use the PCR... set the cache policies + // Now we should be able to use the PCR... // Pcr = (PKPCR)KeGetPcr(); + + // + // Set the cache policy (HACK) + // Pcr->CachePolicy = 0; Pcr->AlignedCachePolicy = 0; + + // + // Copy cache information from the loader block + // + Pcr->FirstLevelDcacheSize = LoaderBlock->u.Arm.FirstLevelDcacheSize; + Pcr->SecondLevelDcacheSize = LoaderBlock->u.Arm.SecondLevelDcacheSize; + Pcr->FirstLevelIcacheSize = LoaderBlock->u.Arm.FirstLevelIcacheSize; + Pcr->SecondLevelIcacheSize = LoaderBlock->u.Arm.SecondLevelIcacheSize; + Pcr->FirstLevelDcacheFillSize = LoaderBlock->u.Arm.FirstLevelDcacheFillSize; + Pcr->SecondLevelDcacheFillSize = LoaderBlock->u.Arm.SecondLevelDcacheFillSize; + Pcr->FirstLevelIcacheFillSize = LoaderBlock->u.Arm.FirstLevelIcacheFillSize; + Pcr->SecondLevelIcacheFillSize = LoaderBlock->u.Arm.SecondLevelIcacheFillSize; + + // + // Set global d-cache fill and alignment values + // + if (Pcr->SecondLevelDcacheSize) + { + // + // Use the first level + // + Pcr->DcacheFillSize = Pcr->SecondLevelDcacheSize; + } + else + { + // + // Use the second level + // + Pcr->DcacheFillSize = Pcr->SecondLevelDcacheSize; + } + + // + // Set the alignment + // + Pcr->DcacheAlignment = Pcr->DcacheFillSize - 1; + + // + // Set global i-cache fill and alignment values + // + if (Pcr->SecondLevelIcacheSize) + { + // + // Use the first level + // + Pcr->IcacheFillSize = Pcr->SecondLevelIcacheSize; + } + else + { + // + // Use the second level + // + Pcr->IcacheFillSize = Pcr->SecondLevelIcacheSize; + } + + // + // Set the alignment + // + Pcr->IcacheAlignment = Pcr->IcacheFillSize - 1; + + // + // Now sweep caches + // + HalSweepIcache(); + HalSweepDcache(); while (TRUE); }
17 years, 2 months
1
0
0
0
[cwittich] 32329: fix some memory and resource leaks fixes by janderwald and myself
by cwittich@svn.reactos.org
Author: cwittich Date: Tue Feb 12 21:49:20 2008 New Revision: 32329 URL:
http://svn.reactos.org/svn/reactos?rev=32329&view=rev
Log: fix some memory and resource leaks fixes by janderwald and myself Modified: trunk/reactos/base/shell/explorer/desktop/desktop.cpp trunk/reactos/base/shell/explorer/explorer.cpp trunk/reactos/base/shell/explorer/globals.h trunk/reactos/base/shell/explorer/shell/entries.cpp Modified: trunk/reactos/base/shell/explorer/desktop/desktop.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/explorer/deskto…
============================================================================== --- trunk/reactos/base/shell/explorer/desktop/desktop.cpp (original) +++ trunk/reactos/base/shell/explorer/desktop/desktop.cpp Tue Feb 12 21:49:20 2008 @@ -837,11 +837,11 @@ // use a little trick to get the icons where we want them to be... - for(IconMap::const_iterator it=pos_idx.end(); --it!=pos_idx.begin(); ) { - const IconPos& pos = it->first; - - ListView_SetItemPosition32(_hwndListView, it->second, pos.second, pos.first); - } + //for(IconMap::const_iterator it=pos_idx.end(); --it!=pos_idx.begin(); ) { + // const IconPos& pos = it->first; + + // ListView_SetItemPosition32(_hwndListView, it->second, pos.second, pos.first); + //} for(IconMap::const_iterator it=pos_idx.begin(); it!=pos_idx.end(); ++it) { const IconPos& pos = it->first; Modified: trunk/reactos/base/shell/explorer/explorer.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/explorer/explor…
============================================================================== --- trunk/reactos/base/shell/explorer/explorer.cpp (original) +++ trunk/reactos/base/shell/explorer/explorer.cpp Tue Feb 12 21:49:20 2008 @@ -227,6 +227,10 @@ // hide some file extensions if (type._neverShowExt && !dont_hide_ext) { int len = ext - entry->_data.cFileName; + + if (entry->_display_name != entry->_data.cFileName) + free(entry->_display_name); + entry->_display_name = (LPTSTR) malloc((len+1)*sizeof(TCHAR)); lstrcpyn(entry->_display_name, entry->_data.cFileName, len + 1); } @@ -627,6 +631,26 @@ return _icons[id]; } +IconCache::~IconCache() +{ + for (int index = s_next_id; index >= 0; index--) + { + IconMap::iterator found = _icons.find(index); + + if (found != _icons.end()) + { + Icon& icon = found->second; + + if ((icon.get_icontype() == IT_DYNAMIC) || + (icon.get_icontype() == IT_CACHED)) + { + DestroyIcon(icon.get_hicon()); + _icons.erase(found); + } + } + } +} + void IconCache::free_icon(int icon_id) { IconMap::iterator found = _icons.find(icon_id); Modified: trunk/reactos/base/shell/explorer/globals.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/explorer/global…
============================================================================== --- trunk/reactos/base/shell/explorer/globals.h (original) +++ trunk/reactos/base/shell/explorer/globals.h Tue Feb 12 21:49:20 2008 @@ -108,6 +108,7 @@ int get_sysiml_idx() const {return _itype==IT_SYSCACHE? _sys_idx: -1;} HICON get_hicon() const {return _itype!=IT_SYSCACHE? _hicon: 0;} + ICON_TYPE get_icontype() const { return _itype; } bool destroy() {if (_itype == IT_DYNAMIC) {DestroyIcon(_hicon); return true;} else return false;} @@ -126,6 +127,7 @@ struct IconCache { IconCache() : _himlSys_small(0) {} + virtual ~IconCache(); void init(); const Icon& extract(LPCTSTR path, ICONCACHE_FLAGS flags=ICF_NORMAL); Modified: trunk/reactos/base/shell/explorer/shell/entries.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/explorer/shell/…
============================================================================== --- trunk/reactos/base/shell/explorer/shell/entries.cpp (original) +++ trunk/reactos/base/shell/explorer/shell/entries.cpp Tue Feb 12 21:49:20 2008 @@ -107,6 +107,9 @@ if (_content) free(_content); + + if (_down) + delete _down; }
17 years, 2 months
1
0
0
0
[ros-arm-bringup] 32328: Fixed some bugs in KeFillFixedEntryTb -- we actually needed to map the PTE into memory (then we can umap it). We were doing the initial PCR/PDR page allocation completely wrong since we're using 1MB section pages, not 4KB pages (this needs to be fixed later). Piggyhack arm_kprintf on top of DebugService which we now define. DPRINT1 and ASSERT now work! Send ARC paths and normalized command-line in the loader parameter block. Current state: FreeLoader v3.0 for ARM Bootarg
by ros-arm-bringup@svn.reactos.org
Author: ros-arm-bringup Date: Tue Feb 12 21:34:33 2008 New Revision: 32328 URL:
http://svn.reactos.org/svn/reactos?rev=32328&view=rev
Log: Fixed some bugs in KeFillFixedEntryTb -- we actually needed to map the PTE into memory (then we can umap it). We were doing the initial PCR/PDR page allocation completely wrong since we're using 1MB section pages, not 4KB pages (this needs to be fixed later). Piggyhack arm_kprintf on top of DebugService which we now define. DPRINT1 and ASSERT now work! Send ARC paths and normalized command-line in the loader parameter block. Current state: FreeLoader v3.0 for ARM Bootargs: rdbase=0x2000000 rdsize=0x1400000 Detecting Hardware... Loading... Reading NTOSKRNL.EXE Reading BOOTVID.DLL Reading HAL.DLL Reading HAL.DLL Reading c_1252.nls Reading c_437.nls Reading l_intl.nls Reading scsiport.sys Reading atapi.sys Reading buslogic.sys Reading pci.sys Reading class2.sys Reading disk.sys Reading vfatfs.sys Reading ndis.sys Mapped serial port to 0xc00f1000 (ntoskrnl/ke/arm/kiinit.c:135) ----------------------------------------------------- (ntoskrnl/ke/arm/kiinit.c:136) ReactOS 0.4-SVN (Build 20080207-r32151) (ntoskrnl/ke/arm/kiinit.c:137) Command Line: DEBUG DEBUGPORT=COM1 BAUDRATE=115200 SOS (ntoskrnl/ke/arm/kiinit.c:138) ARC Paths: ramdisk(0) \ ramdisk(0) \ReactOS\ Modified: trunk/reactos/boot/freeldr/freeldr/arch/arm/loader.c trunk/reactos/include/reactos/armddk.h trunk/reactos/ntoskrnl/include/internal/arm/intrin_i.h trunk/reactos/ntoskrnl/include/internal/arm/ke.h trunk/reactos/ntoskrnl/ke/arm/kiinit.c trunk/reactos/ntoskrnl/ke/arm/stubs_asm.s Modified: trunk/reactos/boot/freeldr/freeldr/arch/arm/loader.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/arch/…
============================================================================== --- trunk/reactos/boot/freeldr/freeldr/arch/arm/loader.c (original) +++ trunk/reactos/boot/freeldr/freeldr/arch/arm/loader.c Tue Feb 12 21:34:33 2008 @@ -17,6 +17,11 @@ ULONG PageDirectoryStart, PageDirectoryEnd; LOADER_PARAMETER_BLOCK ArmLoaderBlock; +CHAR ArmCommandLine[256]; +CHAR ArmArcBootPath[64]; +CHAR ArmArcHalPath[64]; +CHAR ArmNtHalPath[64]; +CHAR ArmNtBootPath[64]; LOADER_PARAMETER_EXTENSION ArmExtension; extern ARM_TRANSLATION_TABLE ArmTranslationTable; extern ROS_KERNEL_ENTRY_POINT KernelEntryPoint; @@ -142,8 +147,13 @@ ControlRegister.ICacheEnabled = TRUE; ControlRegister.DCacheEnabled = TRUE; KeArmControlRegisterSet(ControlRegister); - - ArmBoardBlock->UartRegisterBase = UART_VIRTUAL | (ArmBoardBlock->UartRegisterBase & ((1<<TTB_SHIFT)-1)); + + // + // Reconfigure UART0 + // + ArmBoardBlock->UartRegisterBase = UART_VIRTUAL | + (ArmBoardBlock->UartRegisterBase & + ((1 << TTB_SHIFT) - 1)); TuiPrintf("Mapped serial port to 0x%x\n", ArmBoardBlock->UartRegisterBase); // @@ -157,7 +167,8 @@ { ARM_CACHE_REGISTER CacheReg; PVOID Base; - + PCHAR BootPath, HalPath; + // // Initialize the loader block // @@ -196,10 +207,48 @@ // // - // Send the command line - // - ArmLoaderBlock.LoadOptions = reactos_kernel_cmdline; - + // Make a copy of the command line + // + ArmLoaderBlock.LoadOptions = ArmCommandLine; + strcpy(ArmCommandLine, reactos_kernel_cmdline); + + // + // Find the first \, separating the ARC path from NT path + // + BootPath = strchr(ArmCommandLine, '\\'); + *BootPath = ANSI_NULL; + + // + // Set the ARC Boot Path + // + strncpy(ArmArcBootPath, ArmCommandLine, 63); + ArmLoaderBlock.ArcBootDeviceName = ArmArcBootPath; + + // + // The rest of the string is the NT path + // + HalPath = strchr(BootPath + 1, ' '); + *HalPath = ANSI_NULL; + ArmNtBootPath[0] = '\\'; + strncat(ArmNtBootPath, BootPath + 1, 63); + strcat(ArmNtBootPath,"\\"); + ArmLoaderBlock.NtBootPathName = ArmNtBootPath; + + // + // Set the HAL paths + // + strncpy(ArmArcHalPath, ArmArcBootPath, 63); + ArmLoaderBlock.ArcHalDeviceName = ArmArcHalPath; + strcpy(ArmNtHalPath, "\\"); + ArmLoaderBlock.NtHalPathName = ArmNtHalPath; + + /* Use this new command line */ + strncpy(ArmLoaderBlock.LoadOptions, HalPath + 2, 255); + + /* Parse it and change every slash to a space */ + BootPath = ArmLoaderBlock.LoadOptions; + do {if (*BootPath == '/') *BootPath = ' ';} while (*BootPath++); + // // Setup cache information // @@ -234,16 +283,17 @@ ArmLoaderBlock.u.Arm.PanicStack = KSEG0_BASE | (ULONG)Base; // - // Allocate the PCRs (1MB each for now!) + // Allocate the PCR page -- align it to 1MB (we only need 4KB) // Base = MmAllocateMemoryWithType(2 * 1024 * 1024, LoaderStartupPcrPage); + Base = (PVOID)ROUND_UP(Base, 1 * 1024 * 1024); ArmLoaderBlock.u.Arm.PcrPage = (ULONG)Base >> TTB_SHIFT; - ArmLoaderBlock.u.Arm.PcrPage2 = ArmLoaderBlock.u.Arm.PcrPage + 1; - - // - // Allocate PDR pages - // - Base = MmAllocateMemoryWithType(3 * 1024 * 1024, LoaderStartupPdrPage); + + // + // Allocate PDR pages -- align them to 1MB (we only need 3xKB) + // + Base = MmAllocateMemoryWithType(4 * 1024 * 1024, LoaderStartupPdrPage); + Base = (PVOID)ROUND_UP(Base, 1 * 1024 * 1024); ArmLoaderBlock.u.Arm.PdrPage = (ULONG)Base >> TTB_SHIFT; // @@ -274,6 +324,5 @@ // // Initialize paging and load NTOSKRNL // - TuiPrintf("Kernel Command Line: %s\n", ArmLoaderBlock.LoadOptions); ArmSetupPagingAndJump(Magic); } Modified: trunk/reactos/include/reactos/armddk.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/reactos/armddk.h?r…
============================================================================== --- trunk/reactos/include/reactos/armddk.h (original) +++ trunk/reactos/include/reactos/armddk.h Tue Feb 12 21:34:33 2008 @@ -46,7 +46,7 @@ { ULONG MinorVersion; ULONG MajorVersion; - PKINTERRUPT_ROUTINE InterruptRoutine[64]; + PKINTERRUPT_ROUTINE InterruptRoutine[16]; PVOID XcodeDispatch; ULONG FirstLevelDcacheSize; ULONG FirstLevelDcacheFillSize; @@ -71,6 +71,7 @@ PVOID DataBusError; PVOID InstructionBusError; ULONG CachePolicy; + ULONG AlignedCachePolicy; UCHAR IrqlMask[64]; UCHAR IrqlTable[64]; UCHAR CurrentIrql; Modified: trunk/reactos/ntoskrnl/include/internal/arm/intrin_i.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/include/internal/…
============================================================================== --- trunk/reactos/ntoskrnl/include/internal/arm/intrin_i.h (original) +++ trunk/reactos/ntoskrnl/include/internal/arm/intrin_i.h Tue Feb 12 21:34:33 2008 @@ -38,6 +38,14 @@ return Value; } +FORCEINLINE +ARM_TTB_REGISTER +KeArmTranslationTableRegisterGet(VOID) +{ + ARM_TTB_REGISTER Value; + __asm__ __volatile__ ("mrc p15, 0, %0, c2, c0, 0" : "=r"(Value.AsUlong) : : "cc"); + return Value; +} FORCEINLINE ARM_CACHE_REGISTER Modified: trunk/reactos/ntoskrnl/include/internal/arm/ke.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/include/internal/…
============================================================================== --- trunk/reactos/ntoskrnl/include/internal/arm/ke.h (original) +++ trunk/reactos/ntoskrnl/include/internal/arm/ke.h Tue Feb 12 21:34:33 2008 @@ -9,8 +9,8 @@ // //Lockdown TLB entries // -#define PCR_ENTRY, 0 -#define PDR_ENTRY, 2 +#define PCR_ENTRY 0 +#define PDR_ENTRY 2 #define KeArchHaltProcessor() KeArmHaltProcessor() Modified: trunk/reactos/ntoskrnl/ke/arm/kiinit.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ke/arm/kiinit.c?r…
============================================================================== --- trunk/reactos/ntoskrnl/ke/arm/kiinit.c (original) +++ trunk/reactos/ntoskrnl/ke/arm/kiinit.c Tue Feb 12 21:34:33 2008 @@ -12,8 +12,6 @@ #define NDEBUG #include <debug.h> -void arm_kprintf(const char *fmt, ...); - /* GLOBALS ********************************************************************/ BOOLEAN KeIsArmV6; @@ -23,7 +21,25 @@ #define __ARMV6__ KeIsArmV6 +// +// METAFIXME: We need to stop using 1MB Section Entry TTEs! +// + /* FUNCTIONS ******************************************************************/ + +VOID +DebugService(IN ULONG ServiceType, + IN PCHAR Buffer, + IN ULONG Length, + IN ULONG Component, + IN ULONG Level) +{ + // + // ARM Bring-up Hack + // + void arm_kprintf(const char *fmt, ...); + arm_kprintf("%s", Buffer); +} VOID KiFlushSingleTb(IN BOOLEAN Invalid, @@ -42,14 +58,19 @@ { ARM_LOCKDOWN_REGISTER LockdownRegister; ULONG OldVictimCount; - ULONG Temp; - UNREFERENCED_PARAMETER(Pte); - UNREFERENCED_PARAMETER(Index); + volatile unsigned long Temp; + PARM_TRANSLATION_TABLE TranslationTable; + + // + // Hack for 1MB Section Entries + // + Virtual = (PVOID)((ULONG)Virtual & 0xFFF00000); // // On ARM, we can't set the index ourselves, so make sure that we are not // locking down more than 8 entries. // + UNREFERENCED_PARAMETER(Index); KeFixedTbEntries++; ASSERT(KeFixedTbEntries <= 8); @@ -67,6 +88,12 @@ KeArmLockdownRegisterSet(LockdownRegister); // + // Map the PTE for this virtual address + // + TranslationTable = (PVOID)KeArmTranslationTableRegisterGet().AsUlong; + TranslationTable->Pte[(ULONG)Virtual >> TTB_SHIFT] = Pte; + + // // Now force a miss // Temp = *(PULONG)Virtual; @@ -78,6 +105,11 @@ LockdownRegister.Preserve = FALSE; ASSERT(LockdownRegister.Victim == OldVictimCount + 1); KeArmLockdownRegisterSet(LockdownRegister); + + // + // Clear the PTE + // + TranslationTable->Pte[(ULONG)Virtual >> TTB_SHIFT].AsUlong = 0; } VOID @@ -93,7 +125,16 @@ KiInitializeSystem(IN ULONG Magic, IN PLOADER_PARAMETER_BLOCK LoaderBlock) { - arm_kprintf("%s:%i\n", __func__, __LINE__); + ARM_PTE Pte; + PKPCR Pcr; + DPRINT1("-----------------------------------------------------\n"); + DPRINT1("ReactOS-ARM "KERNEL_VERSION_STR" (Build "KERNEL_VERSION_BUILD_STR")\n"); + DPRINT1("Command Line: %s\n", LoaderBlock->LoadOptions); + DPRINT1("ARC Paths: %s %s %s %s\n", LoaderBlock->ArcBootDeviceName, + LoaderBlock->NtHalPathName, + LoaderBlock->ArcHalDeviceName, + LoaderBlock->NtBootPathName); + // // Detect ARM version (Architecture 6 is the ARMv5TE-J, go figure!) // @@ -124,8 +165,33 @@ KeFlushTb(); // + // Build the KIPCR pte // + Pte.L1.Section.Type = SectionPte; + Pte.L1.Section.Buffered = FALSE; + Pte.L1.Section.Cached = FALSE; + Pte.L1.Section.Reserved = 1; // ARM926EJ-S manual recommends setting to 1 + Pte.L1.Section.Domain = Domain0; + Pte.L1.Section.Access = SupervisorAccess; + Pte.L1.Section.BaseAddress = LoaderBlock->u.Arm.PcrPage; + Pte.L1.Section.Ignored = Pte.L1.Section.Ignored1 = 0; + // + // Map it into kernel address space by locking it into the TLB + // + KeFillFixedEntryTb(Pte, (PVOID)KIPCR, PCR_ENTRY); + // + // Now map the PCR into user address space as well (read-only) + // + Pte.L1.Section.Access = SharedAccess; + KeFillFixedEntryTb(Pte, (PVOID)USPCR, PCR_ENTRY + 1); + + // + // Now we should be able to use the PCR... set the cache policies + // + Pcr = (PKPCR)KeGetPcr(); + Pcr->CachePolicy = 0; + Pcr->AlignedCachePolicy = 0; while (TRUE); } 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 (original) +++ trunk/reactos/ntoskrnl/ke/arm/stubs_asm.s Tue Feb 12 21:34:33 2008 @@ -146,7 +146,6 @@ GENERATE_ARM_STUB RtlpGetExceptionAddress GENERATE_ARM_STUB RtlDispatchException GENERATE_ARM_STUB DebugService2 -GENERATE_ARM_STUB DebugService GENERATE_ARM_STUB KdPortPutByteEx GENERATE_ARM_STUB KdPortInitializeEx GENERATE_ARM_STUB KdpGdbStubInit
17 years, 2 months
1
0
0
0
[ros-arm-bringup] 32327: Added arm_kprintf() for early kernel debugging (ARM bringup). Freeldr maps the "Versatile"'s serial port into virtual memory now, and C code can just use arm_kprintf(). This is not code that is supposed to remain in the kernel, it's only needed for bringup, until enough is working so that standard serial DbgPrint() works through the original code path.
by ros-arm-bringup@svn.reactos.org
Author: ros-arm-bringup Date: Tue Feb 12 20:45:58 2008 New Revision: 32327 URL:
http://svn.reactos.org/svn/reactos?rev=32327&view=rev
Log: Added arm_kprintf() for early kernel debugging (ARM bringup). Freeldr maps the "Versatile"'s serial port into virtual memory now, and C code can just use arm_kprintf(). This is not code that is supposed to remain in the kernel, it's only needed for bringup, until enough is working so that standard serial DbgPrint() works through the original code path. Added: trunk/reactos/drivers/base/kdcom/kdcom_arm.def (with props) trunk/reactos/drivers/base/kdcom/kdcom_i386.def - copied unchanged from r32324, trunk/reactos/drivers/base/kdcom/kdcom.def trunk/reactos/ntoskrnl/ke/arm/arm_kprintf.c (with props) Removed: trunk/reactos/drivers/base/kdcom/kdcom.def Modified: trunk/reactos/boot/freeldr/freeldr/arch/arm/loader.c trunk/reactos/drivers/base/kdcom/kdbg.c trunk/reactos/drivers/base/kdcom/kdcom.rbuild trunk/reactos/ntoskrnl/ke/arm/kiinit.c trunk/reactos/ntoskrnl/ntoskrnl.rbuild Modified: trunk/reactos/boot/freeldr/freeldr/arch/arm/loader.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/arch/…
============================================================================== --- trunk/reactos/boot/freeldr/freeldr/arch/arm/loader.c (original) +++ trunk/reactos/boot/freeldr/freeldr/arch/arm/loader.c Tue Feb 12 20:45:58 2008 @@ -46,6 +46,11 @@ -1, // INVALID 8 // 8 words per line (32 bytes) }; + +// +// Where to map the serial port +// +#define UART_VIRTUAL 0xC0000000 /* FUNCTIONS ******************************************************************/ @@ -116,6 +121,12 @@ // Pte.L1.Section.BaseAddress = 0; TranslationTable->Pte[0] = Pte; + + // + // Map the page in MMIO space that contains the serial port into virtual memory + // + Pte.L1.Section.BaseAddress = ArmBoardBlock->UartRegisterBase >> TTB_SHIFT; + TranslationTable->Pte[UART_VIRTUAL >> TTB_SHIFT] = Pte; } VOID @@ -132,6 +143,9 @@ ControlRegister.DCacheEnabled = TRUE; KeArmControlRegisterSet(ControlRegister); + ArmBoardBlock->UartRegisterBase = UART_VIRTUAL | (ArmBoardBlock->UartRegisterBase & ((1<<TTB_SHIFT)-1)); + TuiPrintf("Mapped serial port to 0x%x\n", ArmBoardBlock->UartRegisterBase); + // // Jump to Kernel // Modified: trunk/reactos/drivers/base/kdcom/kdbg.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/base/kdcom/kdbg.c?…
============================================================================== --- trunk/reactos/drivers/base/kdcom/kdbg.c (original) +++ trunk/reactos/drivers/base/kdcom/kdbg.c Tue Feb 12 20:45:58 2008 @@ -18,6 +18,7 @@ #include "arc/arc.h" #include "windbgkd.h" #include <kddll.h> +#include <ioaccess.h> /* port intrinsics */ typedef struct _KD_PORT_INFORMATION { Removed: trunk/reactos/drivers/base/kdcom/kdcom.def URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/base/kdcom/kdcom.d…
============================================================================== --- trunk/reactos/drivers/base/kdcom/kdcom.def (original) +++ trunk/reactos/drivers/base/kdcom/kdcom.def (removed) @@ -1,24 +1,0 @@ -LIBRARY kdcom.dll -EXPORTS - -; Old KD -KdPortGetByte@4 -KdPortGetByteEx@8 -KdPortInitialize@12 -KdPortInitializeEx@12 -KdPortPollByte@4 -KdPortPollByteEx@8 -KdPortPutByte@4 -KdPortPutByteEx@8 -KdPortRestore@0 -KdPortSave@0 -KdPortDisableInterrupts@0 -KdPortEnableInterrupts@0 - -; New KD -KdDebuggerInitialize0@4 -KdDebuggerInitialize1@4 -KdSave@4 -KdRestore@4 -KdReceivePacket@20 -KdSendPacket@16 Modified: trunk/reactos/drivers/base/kdcom/kdcom.rbuild URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/base/kdcom/kdcom.r…
============================================================================== --- trunk/reactos/drivers/base/kdcom/kdcom.rbuild (original) +++ trunk/reactos/drivers/base/kdcom/kdcom.rbuild Tue Feb 12 20:45:58 2008 @@ -1,7 +1,7 @@ <?xml version="1.0"?> <!DOCTYPE module SYSTEM "../../../tools/rbuild/project.dtd"> <module name="kdcom" type="kernelmodedll" entrypoint="DriverEntry@8" installbase="system32/drivers" installname="kdcom.dll"> - <importlibrary definition="kdcom.def"></importlibrary> + <importlibrary definition="kdcom_$(ARCH).def"></importlibrary> <bootstrap installbase="$(CDOUTPUT)" nameoncd="kdcom.dll" /> <include base="kdcom">.</include> <library>ntoskrnl</library> Added: trunk/reactos/drivers/base/kdcom/kdcom_arm.def URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/base/kdcom/kdcom_a…
============================================================================== --- trunk/reactos/drivers/base/kdcom/kdcom_arm.def (added) +++ trunk/reactos/drivers/base/kdcom/kdcom_arm.def Tue Feb 12 20:45:58 2008 @@ -1,0 +1,24 @@ +LIBRARY kdcom.dll +EXPORTS + +; Old KD +KdPortGetByte +KdPortGetByteEx +KdPortInitialize +KdPortInitializeEx +KdPortPollByte +KdPortPollByteEx +KdPortPutByte +KdPortPutByteEx +KdPortRestore +KdPortSave +KdPortDisableInterrupts +KdPortEnableInterrupts + +; New KD +KdDebuggerInitialize0 +KdDebuggerInitialize1 +KdSave +KdRestore +KdReceivePacket +KdSendPacket Propchange: trunk/reactos/drivers/base/kdcom/kdcom_arm.def ------------------------------------------------------------------------------ svn:eol-style = native Propchange: trunk/reactos/drivers/base/kdcom/kdcom_arm.def ------------------------------------------------------------------------------ svn:mime-type = text/plain Added: trunk/reactos/ntoskrnl/ke/arm/arm_kprintf.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ke/arm/arm_kprint…
============================================================================== --- trunk/reactos/ntoskrnl/ke/arm/arm_kprintf.c (added) +++ trunk/reactos/ntoskrnl/ke/arm/arm_kprintf.c Tue Feb 12 20:45:58 2008 @@ -1,0 +1,84 @@ +/* + * PROJECT: ReactOS Kernel + * LICENSE: GPL - See COPYING in the top level directory + * FILE: ntoskrnl/ke/arm/arm_kprintf.c + * PURPOSE: Early serial printf-style kernel debugging (ARM bringup) + * PROGRAMMERS: ReactOS Portable Systems Group + */ + +/* INCLUDES *******************************************************************/ + +#include <ntoskrnl.h> +#define NDEBUG +#include <debug.h> + +/* GLOBALS ********************************************************************/ + +// +// UART Registers +// +#define UART_BASE (void*)0xc00f1000 /* HACK: freeldr mapped it here */ + +#define UART_PL01x_DR (UART_BASE + 0x00) +#define UART_PL01x_RSR (UART_BASE + 0x04) +#define UART_PL01x_ECR (UART_BASE + 0x04) +#define UART_PL01x_FR (UART_BASE + 0x18) +#define UART_PL011_IBRD (UART_BASE + 0x24) +#define UART_PL011_FBRD (UART_BASE + 0x28) +#define UART_PL011_LCRH (UART_BASE + 0x2C) +#define UART_PL011_CR (UART_BASE + 0x30) +#define UART_PL011_IMSC (UART_BASE + 0x38) + +// +// LCR Values +// +#define UART_PL011_LCRH_WLEN_8 0x60 +#define UART_PL011_LCRH_FEN 0x10 + +// +// FCR Values +// +#define UART_PL011_CR_UARTEN 0x01 +#define UART_PL011_CR_TXE 0x100 +#define UART_PL011_CR_RXE 0x200 + +// +// LSR Values +// +#define UART_PL01x_FR_RXFE 0x10 +#define UART_PL01x_FR_TXFF 0x20 + +#define READ_REGISTER_ULONG(r) (*(volatile ULONG * const)(r)) +#define WRITE_REGISTER_ULONG(r, v) (*(volatile ULONG *)(r) = (v)) + +/* FUNCTIONS ******************************************************************/ + +VOID +ArmVersaPutChar(IN INT Char) +{ + // + // Properly support new-lines + // + if (Char == '\n') ArmVersaPutChar('\r'); + + // + // Wait for ready + // + while ((READ_REGISTER_ULONG(UART_PL01x_FR) & UART_PL01x_FR_TXFF) != 0); + + // + // Send the character + // + WRITE_REGISTER_ULONG(UART_PL01x_DR, Char); +} + +void arm_kprintf(const char *fmt, ...) { + char buf[1024], *s; + va_list args; + + va_start(args, fmt); + _vsnprintf(buf,sizeof(buf),fmt,args); + va_end(args); + for (s = buf; *s; s++) + ArmVersaPutChar(*s); +} Propchange: trunk/reactos/ntoskrnl/ke/arm/arm_kprintf.c ------------------------------------------------------------------------------ svn:eol-style = native Propchange: trunk/reactos/ntoskrnl/ke/arm/arm_kprintf.c ------------------------------------------------------------------------------ svn:mime-type = text/plain Modified: trunk/reactos/ntoskrnl/ke/arm/kiinit.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ke/arm/kiinit.c?r…
============================================================================== --- trunk/reactos/ntoskrnl/ke/arm/kiinit.c (original) +++ trunk/reactos/ntoskrnl/ke/arm/kiinit.c Tue Feb 12 20:45:58 2008 @@ -11,6 +11,8 @@ #include <ntoskrnl.h> #define NDEBUG #include <debug.h> + +void arm_kprintf(const char *fmt, ...); /* GLOBALS ********************************************************************/ @@ -91,6 +93,7 @@ KiInitializeSystem(IN ULONG Magic, IN PLOADER_PARAMETER_BLOCK LoaderBlock) { + arm_kprintf("%s:%i\n", __func__, __LINE__); // // Detect ARM version (Architecture 6 is the ARMv5TE-J, go figure!) // Modified: trunk/reactos/ntoskrnl/ntoskrnl.rbuild URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ntoskrnl.rbuild?r…
============================================================================== --- trunk/reactos/ntoskrnl/ntoskrnl.rbuild (original) +++ trunk/reactos/ntoskrnl/ntoskrnl.rbuild Tue Feb 12 20:45:58 2008 @@ -60,6 +60,7 @@ <if property="ARCH" value="arm"> <directory name="arm"> <file first="true">boot.s</file> + <file>arm_kprintf.c</file> <file>kiinit.c</file> <file>stubs_asm.s</file> <file>stubs.c</file>
17 years, 2 months
1
0
0
0
[gbrunmar] 32326: Implemented IDirect3D9::GetAdapterDisplayMode()
by gbrunmar@svn.reactos.org
Author: gbrunmar Date: Tue Feb 12 20:30:32 2008 New Revision: 32326 URL:
http://svn.reactos.org/svn/reactos?rev=32326&view=rev
Log: Implemented IDirect3D9::GetAdapterDisplayMode() Modified: trunk/reactos/dll/directx/d3d9/adapter.c trunk/reactos/dll/directx/d3d9/adapter.h trunk/reactos/dll/directx/d3d9/d3d9_impl.c trunk/reactos/dll/directx/d3d9/d3d9_private.h Modified: trunk/reactos/dll/directx/d3d9/adapter.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/d3d9/adapter.c…
============================================================================== --- trunk/reactos/dll/directx/d3d9/adapter.c (original) +++ trunk/reactos/dll/directx/d3d9/adapter.c Tue Feb 12 20:30:32 2008 @@ -169,6 +169,96 @@ +static D3DFORMAT Get16BitD3DFormat(LPCSTR lpszDeviceName) +{ + HDC hDC; + HBITMAP hBitmap; + LPBITMAPINFO pBitmapInfo; + D3DFORMAT Format = D3DFMT_R5G6B5; + + if (NULL == (hDC = CreateDCA(NULL, lpszDeviceName, NULL, NULL))) + { + return Format; + } + + if (NULL == (hBitmap = CreateCompatibleBitmap(hDC, 1, 1))) + { + DeleteDC(hDC); + return Format; + } + + pBitmapInfo = LocalAlloc(LMEM_ZEROINIT, sizeof(BITMAPINFOHEADER) + 4 * sizeof(RGBQUAD)); + if (NULL == pBitmapInfo) + { + DeleteObject(hBitmap); + DeleteDC(hDC); + return Format; + } + + pBitmapInfo->bmiHeader.biSize = sizeof(BITMAPINFOHEADER); + if (GetDIBits(hDC, hBitmap, 0, 0, NULL, pBitmapInfo, DIB_RGB_COLORS) > 0) + { + if (pBitmapInfo->bmiHeader.biCompression == BI_BITFIELDS) + { + if (GetDIBits(hDC, hBitmap, 0, pBitmapInfo->bmiHeader.biHeight, NULL, pBitmapInfo, DIB_RGB_COLORS) > 0) + { + /* Check if the green field is 6 bits long */ + if (*(DWORD*)(&pBitmapInfo->bmiColors[1]) == 0x000003E0) + { + Format = D3DFMT_X1R5G5B5; + } + } + } + } + + LocalFree(pBitmapInfo); + DeleteObject(hBitmap); + DeleteDC(hDC); + + return Format; +} + +BOOL GetAdapterMode(LPCSTR lpszDeviceName, D3DDISPLAYMODE* pMode) +{ + DEVMODEA DevMode; + + memset(&DevMode, 0, sizeof(DEVMODEA)); + DevMode.dmSize = sizeof(DEVMODEA); + if (FALSE == EnumDisplaySettingsA(lpszDeviceName, ENUM_CURRENT_SETTINGS, &DevMode)) + return FALSE; + + pMode->Width = DevMode.dmPelsWidth; + pMode->Height = DevMode.dmPelsHeight; + pMode->RefreshRate = DevMode.dmDisplayFrequency; + + switch (DevMode.dmBitsPerPel) + { + case 8: + pMode->Format = D3DFMT_P8; + break; + + case 16: + pMode->Format = Get16BitD3DFormat(lpszDeviceName); + break; + + case 24: + pMode->Format = D3DFMT_R8G8B8; + break; + + case 32: + pMode->Format = D3DFMT_X8R8G8B8; + break; + + default: + pMode->Format = D3DFMT_UNKNOWN; + break; + } + + return TRUE; +} + + + static BOOL CALLBACK AdapterMonitorEnumProc(HMONITOR hMonitor, HDC hdcMonitor, LPRECT lprcMonitor, LPARAM dwData) { MONITORINFOEXA MonitorInfoEx; Modified: trunk/reactos/dll/directx/d3d9/adapter.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/d3d9/adapter.h…
============================================================================== --- trunk/reactos/dll/directx/d3d9/adapter.h (original) +++ trunk/reactos/dll/directx/d3d9/adapter.h Tue Feb 12 20:30:32 2008 @@ -11,6 +11,8 @@ BOOL GetAdapterInfo(LPCSTR lpszDeviceName, D3DADAPTER_IDENTIFIER9* pIdentifier); +BOOL GetAdapterMode(LPCSTR lpszDeviceName, D3DDISPLAYMODE* pMode); + HMONITOR GetAdapterMonitor(LPCSTR lpszDeviceName); UINT GetDisplayFormatCount(D3DFORMAT Format, const D3DDISPLAYMODE* pSupportedDisplayModes, UINT NumDisplayModes); Modified: trunk/reactos/dll/directx/d3d9/d3d9_impl.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/d3d9/d3d9_impl…
============================================================================== --- trunk/reactos/dll/directx/d3d9/d3d9_impl.c (original) +++ trunk/reactos/dll/directx/d3d9/d3d9_impl.c Tue Feb 12 20:30:32 2008 @@ -291,10 +291,51 @@ return D3D_OK; } -static HRESULT WINAPI IDirect3D9Impl_GetAdapterDisplayMode(LPDIRECT3D9 iface, UINT Adapter, D3DDISPLAYMODE* pMode) -{ - UNIMPLEMENTED - +/*++ +* @name IDirect3D9::GetAdapterDisplayMode +* @implemented +* +* The function IDirect3D9Impl_GetAdapterDisplayMode fills the pMode argument with the +* currently set display mode. +* +* @param LPDIRECT3D iface +* Pointer to the IDirect3D object returned from Direct3DCreate9() +* +* @param UINT Adapter +* Adapter index to get information about. D3DADAPTER_DEFAULT is the primary display. +* The maximum value for this is the value returned by IDirect3D::GetAdapterCount(). +* +* @param D3DDISPLAYMODE* pMode +* Pointer to a D3DDISPLAYMODE structure to be filled with the current display mode information. +* +* @return HRESULT +* If the method successfully fills the pMode structure, the return value is D3D_OK. +* If Adapter is out of range or pMode is a bad pointer, the return value will be D3DERR_INVALIDCALL. +* +*/static HRESULT WINAPI IDirect3D9Impl_GetAdapterDisplayMode(LPDIRECT3D9 iface, UINT Adapter, D3DDISPLAYMODE* pMode) +{ + LPDIRECT3D9_INT This = impl_from_IDirect3D9(iface); + LOCK_D3D9(); + + if (Adapter >= This->NumDisplayAdapters) + { + DPRINT1("Invalid Adapter number specified"); + UNLOCK_D3D9(); + return D3DERR_INVALIDCALL; + } + + if (IsBadWritePtr(pMode, sizeof(D3DDISPLAYMODE))) + { + DPRINT1("Invalid pMode parameter specified"); + UNLOCK_D3D9(); + return D3DERR_INVALIDCALL; + } + + /* TODO: Handle (This->DisplayAdapters[Adapter].bInUseFlag == FALSE) */ + if (FALSE == GetAdapterMode(This->DisplayAdapters[Adapter].szDeviceName, pMode)) + DPRINT1("Internal error, GetAdapterMode() failed."); + + UNLOCK_D3D9(); return D3D_OK; } Modified: trunk/reactos/dll/directx/d3d9/d3d9_private.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/d3d9/d3d9_priv…
============================================================================== --- trunk/reactos/dll/directx/d3d9/d3d9_private.h (original) +++ trunk/reactos/dll/directx/d3d9/d3d9_private.h Tue Feb 12 20:30:32 2008 @@ -102,11 +102,11 @@ /* 0x0260 */ DWORD unknown000083; /* 0x0264 */ DWORD unknown000084; /* 0x0268 */ DWORD unknown000085; -/* 0x026c */ DWORD dwDisplayWidth; /* Current display res */ -/* 0x0270 */ DWORD dwDisplayHeight; /* Current display res */ -/* 0x0274 */ DWORD unknown000088; -/* 0x0278 */ DWORD unknown000089; -/* 0x027c */ DWORD unknown000090; +/* 0x026c */ DWORD dwDisplayWidth; /* Current display res */ +/* 0x0270 */ DWORD dwDisplayHeight; /* Current display res */ +/* 0x0274 */ DWORD unknown000088; /* Current D3DFORMAT */ +/* 0x0278 */ DWORD unknown000089; /* Current D3DFORMAT - duplicate? */ +/* 0x027c */ DWORD MonitorFrequency; /* Current monitor frequency */ /* 0x0280 */ DWORD unknown000091; /* 0x0284 */ DWORD unknown000092; /* 0x0288 */ DWORD unknown000093;
17 years, 2 months
1
0
0
0
[dreimer] 32325: Hopefully the last String. Translators. Your turn.
by dreimer@svn.reactos.org
Author: dreimer Date: Tue Feb 12 20:00:09 2008 New Revision: 32325 URL:
http://svn.reactos.org/svn/reactos?rev=32325&view=rev
Log: Hopefully the last String. Translators. Your turn. Modified: trunk/reactos/base/setup/usetup/fslist.c trunk/reactos/base/setup/usetup/lang/de-DE.h trunk/reactos/base/setup/usetup/lang/en-US.h trunk/reactos/base/setup/usetup/lang/fr-FR.h trunk/reactos/base/setup/usetup/lang/pl-PL.h trunk/reactos/base/setup/usetup/lang/ru-RU.h trunk/reactos/base/setup/usetup/lang/sk-SK.h trunk/reactos/base/setup/usetup/mui.h Modified: trunk/reactos/base/setup/usetup/fslist.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/setup/usetup/fslist.c…
============================================================================== --- trunk/reactos/base/setup/usetup/fslist.c (original) +++ trunk/reactos/base/setup/usetup/fslist.c Tue Feb 12 20:00:09 2008 @@ -168,7 +168,7 @@ sprintf(Buffer, MUIGetString(STRING_FORMATDISK2), Item->FileSystem); } else - sprintf(Buffer, " Keep current file system (no changes) "); + sprintf(Buffer, MUIGetString(STRING_KEEPFORMAT)); if (ListEntry == &List->Selected->ListEntry) CONSOLE_SetInvertedTextXY(List->Left, Modified: trunk/reactos/base/setup/usetup/lang/de-DE.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/setup/usetup/lang/de-…
============================================================================== --- trunk/reactos/base/setup/usetup/lang/de-DE.h (original) +++ trunk/reactos/base/setup/usetup/lang/de-DE.h Tue Feb 12 20:00:09 2008 @@ -1609,9 +1609,9 @@ {STRING_SETUPCOPYINGFILES, "Setup kopiert Dateien..."}, {STRING_PAGEDMEM, - "Ausgel. Speicher"}, + "Ausg. Speicher"}, {STRING_NONPAGEDMEM, - "Nicht ausgel. Speicher"}, + "Nicht ausg. Speich."}, {STRING_FREEMEM, "Freier Speicher"}, {STRING_REGHIVEUPDATE, @@ -1644,6 +1644,8 @@ " Formatiere Partition als %S Dateisystem (Schnell) "}, {STRING_FORMATDISK2, " Formatiere Partition als %S Dateisystem "}, + {STRING_KEEPFORMAT, + " Dateisystem beibehalten (Keine Vernderungen) "}, {0, 0} }; Modified: trunk/reactos/base/setup/usetup/lang/en-US.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/setup/usetup/lang/en-…
============================================================================== --- trunk/reactos/base/setup/usetup/lang/en-US.h (original) +++ trunk/reactos/base/setup/usetup/lang/en-US.h Tue Feb 12 20:00:09 2008 @@ -1638,6 +1638,8 @@ " Format partition as %S file system (quick format) "}, {STRING_FORMATDISK2, " Format partition as %S file system "}, + {STRING_KEEPFORMAT, + " Keep current file system (no changes) "}, {0, 0} }; Modified: trunk/reactos/base/setup/usetup/lang/fr-FR.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/setup/usetup/lang/fr-…
============================================================================== --- trunk/reactos/base/setup/usetup/lang/fr-FR.h (original) +++ trunk/reactos/base/setup/usetup/lang/fr-FR.h Tue Feb 12 20:00:09 2008 @@ -1650,6 +1650,8 @@ " Format partition as %S file system (quick format) "}, {STRING_FORMATDISK2, " Format partition as %S file system "}, + {STRING_KEEPFORMAT, + " Keep current file system (no changes) "}, {0, 0} }; Modified: trunk/reactos/base/setup/usetup/lang/pl-PL.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/setup/usetup/lang/pl-…
============================================================================== --- trunk/reactos/base/setup/usetup/lang/pl-PL.h (original) +++ trunk/reactos/base/setup/usetup/lang/pl-PL.h Tue Feb 12 20:00:09 2008 @@ -1646,6 +1646,8 @@ " Format partition as %S file system (quick format) "}, {STRING_FORMATDISK2, " Format partition as %S file system "}, + {STRING_KEEPFORMAT, + " Keep current file system (no changes) "}, {0, 0} }; Modified: trunk/reactos/base/setup/usetup/lang/ru-RU.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/setup/usetup/lang/ru-…
============================================================================== --- trunk/reactos/base/setup/usetup/lang/ru-RU.h (original) +++ trunk/reactos/base/setup/usetup/lang/ru-RU.h Tue Feb 12 20:00:09 2008 @@ -1638,6 +1638,8 @@ " Format partition as %S file system (quick format) "}, {STRING_FORMATDISK2, " Format partition as %S file system "}, + {STRING_KEEPFORMAT, + " Keep current file system (no changes) "}, {0, 0} }; Modified: trunk/reactos/base/setup/usetup/lang/sk-SK.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/setup/usetup/lang/sk-…
============================================================================== --- trunk/reactos/base/setup/usetup/lang/sk-SK.h (original) +++ trunk/reactos/base/setup/usetup/lang/sk-SK.h Tue Feb 12 20:00:09 2008 @@ -1643,6 +1643,8 @@ " Format partition as %S file system (quick format) "}, {STRING_FORMATDISK2, " Format partition as %S file system "}, + {STRING_KEEPFORMAT, + " Keep current file system (no changes) "}, {0, 0} }; Modified: trunk/reactos/base/setup/usetup/mui.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/setup/usetup/mui.h?re…
============================================================================== --- trunk/reactos/base/setup/usetup/mui.h (original) +++ trunk/reactos/base/setup/usetup/mui.h Tue Feb 12 20:00:09 2008 @@ -103,5 +103,6 @@ #define STRING_CHECKINGDISK 32 #define STRING_FORMATDISK1 33 #define STRING_FORMATDISK2 34 +#define STRING_KEEPFORMAT 35 #endif
17 years, 2 months
1
0
0
0
← Newer
1
...
18
19
20
21
22
23
24
...
46
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
Results per page:
10
25
50
100
200