# HG changeset patch # User Cheng-Shiun Tsai # Date 1286545015 -3600 # Node ID 5937e08d5244bf9f726a0773fccb36cd86689e57 # Parent b41049883d875c3d13e0dfd79fbc9d0f3b5b4047 Implement new version of DNE1_TBPowerResourceController::DoRegisterStaticResources, to fix Bug 3803 diff -r b41049883d87 -r 5937e08d5244 navienginebsp/ne1_tb/inc/resmanpsl.h --- a/navienginebsp/ne1_tb/inc/resmanpsl.h Fri Oct 01 12:45:26 2010 +0100 +++ b/navienginebsp/ne1_tb/inc/resmanpsl.h Fri Oct 08 14:36:55 2010 +0100 @@ -81,7 +81,11 @@ public: DNE1_TBPowerResourceController(); TInt DoInitController(); - TInt DoRegisterStaticResources(DStaticPowerResource**& aStaticResourceArray, TUint16& aStaticResourceCount); + + //C TSAI: from SF4 PDK 1022, this virtual function prototype has changed, and need to re-write this function + //to match the new function prototype + //TInt DoRegisterStaticResources(DStaticPowerResource**& aStaticResourceArray, TUint16& aStaticResourceCount); + TInt DoRegisterStaticResources(RPointerArray& aStaticResourceArray); }; diff -r b41049883d87 -r 5937e08d5244 navienginebsp/ne1_tb/specific/resmanpsl.cpp --- a/navienginebsp/ne1_tb/specific/resmanpsl.cpp Fri Oct 01 12:45:26 2010 +0100 +++ b/navienginebsp/ne1_tb/specific/resmanpsl.cpp Fri Oct 08 14:36:55 2010 +0100 @@ -17,7 +17,6 @@ */ - #include "resmanpsl.h" static DNE1_TBPowerResourceController TheController; @@ -66,6 +65,65 @@ It creates an array to hold the static resource and also creates the resources and updates in the array. */ +//C TSAI: this is to fit new virtual function prototype which uses RPointerArray +TInt DNE1_TBPowerResourceController::DoRegisterStaticResources(RPointerArray& aStaticResourceArray) + { + __KTRACE_OPT(KRESMANAGER, Kern::Printf("DNE1_TBPowerResourceController::DoRegisterStaticResources [SF4 new virtual function prototype]")); + +/** Macro definition to register resource */ +#define REGISTER_RESOURCE_RPOINTERARRAY(resource, resourceArray) \ + { \ + pR = new resource(); \ + if(!pR) \ + { \ + TUint resourceCount = (TUint) resourceArray.Count(); \ + for(TUint count = 0; count < resourceCount; count++) \ + { \ + delete resourceArray[count]; \ + } \ + resourceArray.Reset(); \ + return KErrNoMemory; \ + } \ + resourceArray.Append(pR); \ + } + + DStaticPowerResource* pR = NULL; + + //Note: RPointerArray itself only deal with pointers and doesn't delete objects when Close() or Reset() + + /** Create I2S0 MCLK resource and add to the static resource array */ + REGISTER_RESOURCE_RPOINTERARRAY(DNE1_TBI2S0MclkResource, aStaticResourceArray); + /** Create I2S1 MCLK resource and add to the static resource array */ + REGISTER_RESOURCE_RPOINTERARRAY(DNE1_TBI2S1MclkResource, aStaticResourceArray); + /** Create I2S2 MCLK resource and add to the static resource array */ + REGISTER_RESOURCE_RPOINTERARRAY(DNE1_TBI2S2MclkResource, aStaticResourceArray); + /** Create I2S3 MCLK resource and add to the static resource array */ + REGISTER_RESOURCE_RPOINTERARRAY(DNE1_TBI2S3MclkResource, aStaticResourceArray); + /** Create I2S0 SCLK resource and add to the static resource array */ + REGISTER_RESOURCE_RPOINTERARRAY(DNE1_TBI2S0SclkResource, aStaticResourceArray); + /** Create I2S1 SCLK resource and add to the static resource array */ + REGISTER_RESOURCE_RPOINTERARRAY(DNE1_TBI2S1SclkResource, aStaticResourceArray); + /** Create I2S2 SCLK resource and add to the static resource array */ + REGISTER_RESOURCE_RPOINTERARRAY(DNE1_TBI2S2SclkResource, aStaticResourceArray); + /** Create I2S3 SCLK resource and add to the static resource array */ + REGISTER_RESOURCE_RPOINTERARRAY(DNE1_TBI2S3SclkResource, aStaticResourceArray); + /** Create CSI0 clock resource and add to the static resource array */ + REGISTER_RESOURCE_RPOINTERARRAY(DNE1_TBCSI0ClockResource, aStaticResourceArray); + /** Create CSI1 clock resource and add to the static resource array */ + REGISTER_RESOURCE_RPOINTERARRAY(DNE1_TBCSI1ClockResource, aStaticResourceArray); + /** Create Display DCLK resource and add to the static resource array */ + REGISTER_RESOURCE_RPOINTERARRAY(DNE1_TBDisplayDclkResource, aStaticResourceArray); + /** Create LCD resource and add to the static resource array */ + REGISTER_RESOURCE_RPOINTERARRAY(DNE1_TBLcdResource, aStaticResourceArray); + /** Create Board Power resource and add to the static resource array */ + REGISTER_RESOURCE_RPOINTERARRAY(DNE1_TBBoardPowerResource, aStaticResourceArray); + /** Create PCI clock mask enable resource and add to the static resource array */ + REGISTER_RESOURCE_RPOINTERARRAY(DNE1_TBPCIClockResource, aStaticResourceArray); + + return KErrNone; + } + +#if 0 //C TSAI: This is older function implementation (older virtual function prototype) TInt DNE1_TBPowerResourceController::DoRegisterStaticResources(DStaticPowerResource**& aStaticResourceArray, TUint16& aStaticResourceCount) { @@ -122,4 +180,6 @@ return KErrNone; } +#endif +