kernel/eka/drivers/medmmc/toc.h
changeset 247 d8d70de2bd36
child 300 1d28c8722707
equal deleted inserted replaced
201:43365a9b78a3 247:d8d70de2bd36
       
     1 // Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of the License "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 // TOC Partition Management for Embedded MMC devices
       
    15 // 
       
    16 //
       
    17 
       
    18 
       
    19 #ifndef __EMMC_TOC_H__
       
    20 #define __EMMC_TOC_H__
       
    21 
       
    22 #include <emmcptn.h>
       
    23 
       
    24 // TOC item
       
    25 const TUint  KMaxItemNameLen = 12;
       
    26 
       
    27 struct STocItem
       
    28     {
       
    29     TUint32 iStart;
       
    30     TUint32 iSize;
       
    31     TUint32 iFlags;
       
    32     TUint32 iAlign;
       
    33     TUint32 iLoadAddress;
       
    34     TText8  iFileName[KMaxItemNameLen];
       
    35 	};
       
    36 
       
    37 //- Constants ---------------------------------------------------------------
       
    38 
       
    39 const TUint32 KTocStartSector       = 1280; // TOC starts from 0xA0000 / 0x200
       
    40 
       
    41 const TText8  KTocRofsName[]        = "SOS-ROFS";
       
    42 const TText8  KTocRofsName1[]       = "SOS+ROFS"; 
       
    43 const TText8  KTocRofsExtName[]     = "SOS-ROFX";
       
    44 const TText8  KTocRofsGeneric[]     = "ROFS";  
       
    45 const TText8  KTocRomGeneric[]      = "SOS+CORE";  
       
    46 
       
    47 const TText8  KTocCps[]             = "SOS-CPS";
       
    48 const TText8  KTocRofsExtGeneric[]  = "ROFX";    
       
    49 const TText8  KTocSwap[]            = "SOS-SWAP";
       
    50 const TText8  KTocUserName[]        = "SOS-USER";
       
    51 const TText8  KTocCrashLog[]        = "SOS-CRASH";
       
    52 const TText8  KTocToc[]             = "TOC";
       
    53 const TText8  KTocSosToc[]          = "SOS-TOC";
       
    54 
       
    55 const TUint8  KMaxNbrOfTocItems     = 16;
       
    56 const TUint8  KXMaxNbrOfTocItems    = 16;
       
    57 const TUint32 KEndOfToc             = 0xFFFFFFFFUL;
       
    58 
       
    59 const TText8  KTocRofs1Generic[]    = "ROFS1";
       
    60 const TText8  KTocRofs2Generic[]    = "ROFS2";
       
    61 const TText8  KTocRofs3Generic[]    = "ROFS3"; 
       
    62 const TText8  KTocRofs4Generic[]    = "ROFS4";
       
    63 const TText8  KTocRofs5Generic[]    = "ROFS5";
       
    64 const TText8  KTocRofs6Generic[]    = "ROFS6";
       
    65 const TUint   KNoOfROFSPartitions   = 6;
       
    66 
       
    67 const TInt    KSectorShift          = 9;
       
    68 /**
       
    69 TOC access for kernel side clients.
       
    70 */
       
    71 class Toc
       
    72     {
       
    73     public:
       
    74         /**
       
    75          *  Search entry in TOC with aName as part of ItemName.
       
    76          *  @return KErrNone if successful 
       
    77          */
       
    78         TInt GetItemByName(const TText8* aName, STocItem& aItem);
       
    79 		
       
    80 	public:
       
    81 		/**	Array for keep whole TOC */
       
    82 		STocItem iTOC[KMaxNbrOfTocItems];
       
    83 				
       
    84 		/** Offset of TOC from beginning*/
       
    85 		TUint32  iTocStartSector;
       
    86     };
       
    87 
       
    88 #endif // __EMMC_TOC_H__
       
    89