crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianStructuresLib/Arm/Registers/EmbeddedTrace/ArmETRegisterCollection.cs
changeset 0 818e61de6cd1
equal deleted inserted replaced
-1:000000000000 0:818e61de6cd1
       
     1 /*
       
     2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 * 
       
    14 * Description:
       
    15 *
       
    16 */
       
    17 using System;
       
    18 using System.Collections.Generic;
       
    19 using System.Text;
       
    20 using SymbianStructuresLib.Arm.Registers;
       
    21 
       
    22 namespace SymbianStructuresLib.Arm.Registers.EmbeddedTrace
       
    23 {
       
    24     public abstract class ArmETRegisterCollection : ArmRegisterCollection
       
    25     {
       
    26         #region Constructors
       
    27         protected ArmETRegisterCollection( TArmRegisterBank aBank )
       
    28             : base( aBank )
       
    29         {
       
    30             AddDefaults();
       
    31         }
       
    32         #endregion
       
    33     }
       
    34 
       
    35     public class ArmETMRegisterCollection : ArmETRegisterCollection
       
    36     {
       
    37         #region Constructors
       
    38         public ArmETMRegisterCollection()
       
    39             : base( TArmRegisterBank.ETypeETM )
       
    40         {
       
    41         }
       
    42         #endregion
       
    43 
       
    44         #region From ArmRegisterCollection
       
    45         public override void AddDefaults()
       
    46         {
       
    47             base.Clear();
       
    48             //
       
    49             Array items = Enum.GetValues( typeof( TArmRegisterType ) );
       
    50             foreach ( object enumEntry in items )
       
    51             {
       
    52                 TArmRegisterType value = (TArmRegisterType) enumEntry;
       
    53                 if ( value >= TArmRegisterType.EArmReg_ETM_Control && value <= TArmRegisterType.EArmReg_ETM_Id )
       
    54                 {
       
    55                     Add( value, 0 );
       
    56                 }
       
    57             }
       
    58         }
       
    59         #endregion
       
    60     }
       
    61 
       
    62     public class ArmETBRegisterCollection : ArmETRegisterCollection
       
    63     {
       
    64         #region Constructors
       
    65         public ArmETBRegisterCollection()
       
    66             : base( TArmRegisterBank.ETypeETM )
       
    67         {
       
    68         }
       
    69         #endregion
       
    70 
       
    71         #region From ArmRegisterCollection
       
    72         public override void AddDefaults()
       
    73         {
       
    74             base.Clear();
       
    75             //
       
    76             Array items = Enum.GetValues( typeof( TArmRegisterType ) );
       
    77             foreach ( object enumEntry in items )
       
    78             {
       
    79                 TArmRegisterType value = (TArmRegisterType) enumEntry;
       
    80                 if ( value >= TArmRegisterType.EArmReg_ETB_RamDepth && value <= TArmRegisterType.EArmReg_ETB_Id )
       
    81                 {
       
    82                     Add( value, 0 );
       
    83                 }
       
    84             }
       
    85         }
       
    86         #endregion
       
    87     }
       
    88 }