equal
deleted
inserted
replaced
1 // Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). |
1 // Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies). |
2 // All rights reserved. |
2 // All rights reserved. |
3 // This component and the accompanying materials are made available |
3 // This component and the accompanying materials are made available |
4 // under the terms of the License "Eclipse Public License v1.0" |
4 // under the terms of the License "Eclipse Public License v1.0" |
5 // which accompanies this distribution, and is available |
5 // which accompanies this distribution, and is available |
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
91 LOCAL_C TInt SearchEntryInTRomDir(const TRomDir* aActDir, const TPtrC aFileName, TRomEntry* &aEntry); |
91 LOCAL_C TInt SearchEntryInTRomDir(const TRomDir* aActDir, const TPtrC aFileName, TRomEntry* &aEntry); |
92 |
92 |
93 |
93 |
94 // -- WINS Specific ---------------------------------------------------------- |
94 // -- WINS Specific ---------------------------------------------------------- |
95 |
95 |
96 #ifdef __WINS__ |
96 #if defined(__WINS__) || defined(HCRTEST_AVOID_BSP_HCR_DAT) |
97 |
97 |
98 // Set to ensure Rom Hdr dependency does not break compilation in |
98 // Set to ensure Rom Hdr dependency does not break compilation in |
99 // LocateCoreImgRepository() at the end of this file. |
99 // LocateCoreImgRepository() at the end of this file. |
100 // Undef incase it is set in MMP file, avoids compiler warning. |
100 // Undef incase it is set in MMP file, avoids compiler warning. |
101 // |
101 // |
102 #undef HCRTEST_COREIMG_DONTUSE_ROMHDR |
102 #undef HCRTEST_COREIMG_DONTUSE_ROMHDR |
103 #define HCRTEST_COREIMG_DONTUSE_ROMHDR |
103 #define HCRTEST_COREIMG_DONTUSE_ROMHDR |
104 |
104 |
105 #endif |
105 #endif |
|
106 |
106 |
107 |
107 // -- FUNCTIONS --------------------------------------------------------------- |
108 // -- FUNCTIONS --------------------------------------------------------------- |
108 |
109 |
109 /** |
110 /** |
110 Returns 1 when a1 > a2 |
111 Returns 1 when a1 > a2 |
2953 #ifdef HCRTEST_COREIMG_DONTUSE_ROMHDR |
2954 #ifdef HCRTEST_COREIMG_DONTUSE_ROMHDR |
2954 |
2955 |
2955 // Use this testing more on Emulator platform |
2956 // Use this testing more on Emulator platform |
2956 // and on hardware when ROM Header is not to be used or not implemented |
2957 // and on hardware when ROM Header is not to be used or not implemented |
2957 |
2958 |
|
2959 #ifdef HCRTEST_AVOID_BSP_HCR_DAT |
|
2960 const TText8* hcrfile = (const TText8*) "test_hcr.dat"; |
|
2961 #else |
2958 const TText8* hcrfile = (const TText8*) "hcr.dat"; |
2962 const TText8* hcrfile = (const TText8*) "hcr.dat"; |
|
2963 #endif |
2959 TInt retVal = SearchCoreImgRepository(aRepos, hcrfile); |
2964 TInt retVal = SearchCoreImgRepository(aRepos, hcrfile); |
2960 if (retVal != KErrNone) |
2965 if (retVal != KErrNone) |
2961 return retVal; |
2966 HCR_TRACE_RETURN(retVal); |
2962 |
2967 |
2963 #else |
2968 #else |
2964 |
2969 |
2965 const TRomHeader& romHeader = Epoc::RomHeader(); // 0x80000000; |
2970 const TRomHeader& romHeader = Epoc::RomHeader(); // 0x80000000; |
2966 HCR_TRACE2("--- ROM Header: 0x%08x, HCR file address: 0x%08x", &romHeader, romHeader.iHcrFileAddress); |
2971 HCR_TRACE2("--- ROM Header: 0x%08x, HCR file address: 0x%08x", &romHeader, romHeader.iHcrFileAddress); |
2978 #endif |
2983 #endif |
2979 NKern::ThreadEnterCS(); |
2984 NKern::ThreadEnterCS(); |
2980 aRepos = HCR::TRepositoryFile::New(reinterpret_cast<const HCR::SRepositoryFile *>(romHeader.iHcrFileAddress)); |
2985 aRepos = HCR::TRepositoryFile::New(reinterpret_cast<const HCR::SRepositoryFile *>(romHeader.iHcrFileAddress)); |
2981 NKern::ThreadLeaveCS(); |
2986 NKern::ThreadLeaveCS(); |
2982 if (aRepos == 0) |
2987 if (aRepos == 0) |
2983 return KErrNoMemory; |
2988 HCR_TRACE_RETURN(KErrNoMemory); |
2984 } |
2989 } |
2985 else |
2990 else |
2986 return KErrNotFound; |
2991 HCR_TRACE_RETURN(KErrNotFound); |
2987 |
2992 |
2988 #endif // HCRTEST_COREIMG_DONTUSE_ROMHDR |
2993 #endif // HCRTEST_COREIMG_DONTUSE_ROMHDR |
2989 |
2994 |
2990 |
2995 |
2991 return KErrNone; |
2996 return KErrNone; |