# HG changeset patch # User Tom Sutcliffe # Date 1283888316 -3600 # Node ID 31c9a831b70402f3d6dbc14fd295404feed335bc # Parent 27ac5e7cd5fb9b0f4c897f5021a777b827fadc50# Parent 8dc858aede5210eadcc2188be5a655451dbef05e merge diff -r 8dc858aede52 -r 31c9a831b704 build/common/common.mmh --- a/build/common/common.mmh Sat Aug 28 00:14:27 2010 +0100 +++ b/build/common/common.mmh Tue Sep 07 20:38:36 2010 +0100 @@ -277,7 +277,9 @@ #endif #if defined(FSHELL_PLATFORM_S60) && FSHELL_PLATFORM_S60 >= 5 +#ifdef FSHELL_COMMS_SUPPORT #define FSHELL_CORE_SUPPORT_SYSINFO_WLAN +#endif #define FSHELL_CORE_SUPPORT_SECURE_TIME #endif diff -r 8dc858aede52 -r 31c9a831b704 build/common/fsh_rombuild_defs.iby --- a/build/common/fsh_rombuild_defs.iby Sat Aug 28 00:14:27 2010 +0100 +++ b/build/common/fsh_rombuild_defs.iby Tue Sep 07 20:38:36 2010 +0100 @@ -22,7 +22,7 @@ #define FSHELL_DATA_FILE(fileNameFrom, fileNameTo) data=##fileNameFrom fileNameTo #define FSHELL_EXECUTABLE_FILE(fileName) file=\epoc32\release\##MAIN##\##BUILD##\##fileName sys\bin\##fileName -#define FSHELL_EXECUTABLE_AS_DATA(fileNameFrom, fileNameTo) data=\epoc32\release\##MAIN##\##BUILD##\fileNameFrom sys\bin\fileNameTo +#define FSHELL_EXECUTABLE_AS_DATA(fileNameFrom, fileNameTo) data=\epoc32\release\##MAIN##\##BUILD##\fileNameFrom sys\bin\##fileNameTo #define FSHELL_DEBUG_EXECUTABLE_FILE(fileName) file=\epoc32\release\##MAIN##\##BUILD##\##fileName sys\bin\##fileName #define FSHELL_RENAMED_EXECUTABLE_FILE(fileNameFrom, fileNameTo) file=\epoc32\release\##MAIN##\##BUILD##\##fileNameFrom sys\bin\##fileNameTo #define FSHELL_DEBUG_RENAMED_EXECUTABLE_FILE(fileNameFrom, fileNameTo) file=\epoc32\release\##MAIN##\##BUILD##\##fileNameFrom sys\bin\##fileNameTo @@ -46,7 +46,7 @@ #define FSHELL_DATA_FILE(fileNameFrom, fileNameTo) data=##fileNameFrom fileNameTo #define FSHELL_EXECUTABLE_FILE(fileName) file=##ABI_DIR##\##DEBUG_DIR##\##fileName sys\bin\##fileName -#define FSHELL_EXECUTABLE_AS_DATA(fileNameFrom, fileNameTo) file=##ABI_DIR##\##DEBUG_DIR##\fileNameFrom sys\bin\fileNameTo +#define FSHELL_EXECUTABLE_AS_DATA(fileNameFrom, fileNameTo) file=##ABI_DIR##\##DEBUG_DIR##\fileNameFrom sys\bin\##fileNameTo #define FSHELL_DEBUG_EXECUTABLE_FILE(fileName) file=##ABI_DIR##\##DEBUG_DIR##\##fileName sys\bin\##fileName #define FSHELL_RENAMED_EXECUTABLE_FILE(fileNameFrom, fileNameTo) file=##ABI_DIR##\##BUILD_DIR\##fileNameFrom sys\bin\##fileNameTo #define FSHELL_DEBUG_RENAMED_EXECUTABLE_FILE(fileNameFrom, fileNameTo) file=##ABI_DIR##\##DEBUG_DIR\##fileNameFrom sys\bin\##fileNameTo diff -r 8dc858aede52 -r 31c9a831b704 build/common/fshell.iby --- a/build/common/fshell.iby Sat Aug 28 00:14:27 2010 +0100 +++ b/build/common/fshell.iby Tue Sep 07 20:38:36 2010 +0100 @@ -45,4 +45,8 @@ #include FSHELL_EXECUTABLE_FILE(consoleextensions.dll) // TODO move this to the new fshell_consoles.iby +#ifdef FSHELL_TRACECORE_SUPPORT +FSHELL_EXECUTABLE_FILE(terminalkeyboardcons.dll) // TODO move this to the new fshell_consoles.iby +#endif + #endif // FSHELL_IBY diff -r 8dc858aede52 -r 31c9a831b704 build/sf/3tshell/fshell_platform.iby --- a/build/sf/3tshell/fshell_platform.iby Sat Aug 28 00:14:27 2010 +0100 +++ b/build/sf/3tshell/fshell_platform.iby Tue Sep 07 20:38:36 2010 +0100 @@ -21,6 +21,8 @@ #else +#define FSHELL_REPLACE_ECONS + // The minimum that fshell requires to rombuild successfully // Don't ask me... diff -r 8dc858aede52 -r 31c9a831b704 commands/fzip/fzip.cif --- a/commands/fzip/fzip.cif Sat Aug 28 00:14:27 2010 +0100 +++ b/commands/fzip/fzip.cif Tue Sep 07 20:38:36 2010 +0100 @@ -38,11 +38,11 @@ ==option bool r recurse -Include sub-directories and any files contained therein when archiving. Must be used in conjunction with '--unzip'. +Include sub-directories and any files contained therein when archiving. ==option filename f file multiple -A file to archive. Only applicable when creating a new archive. +A file or directory to archive. Only applicable when creating a new archive. If a directory is specified then it and any files contained immediately within that directory are archived. Use --recurse to archive all sub-directories and files within the directory. ==option enum t compression-type diff -r 8dc858aede52 -r 31c9a831b704 commands/hal/hal.cpp --- a/commands/hal/hal.cpp Sat Aug 28 00:14:27 2010 +0100 +++ b/commands/hal/hal.cpp Tue Sep 07 20:38:36 2010 +0100 @@ -14,6 +14,7 @@ #include #include #include +#include using namespace IoUtils; @@ -127,13 +128,7 @@ { if (!iOptions.IsPresent(&iDumpFileName)) { -#ifdef FSHELL_9_1_SUPPORT - TInt ch = 'c'; - HAL::Get(HAL::ESystemDrive, ch); - iDumpFileName[0] = 'A' + ch; -#else - iDumpFileName[0] = 'A' + static_cast(RFs::GetSystemDrive()); -#endif + iDumpFileName[0] = LtkUtils::GetSystemDrive(); } RFile file; LeaveIfErr(file.Open(FsL(), iDumpFileName, EFileRead), _L("Couldn't open \"%S\" for reading"), &iDumpFileName); diff -r 8dc858aede52 -r 31c9a831b704 commands/pubsub/pubsub.cif --- a/commands/pubsub/pubsub.cif Sat Aug 28 00:14:27 2010 +0100 +++ b/commands/pubsub/pubsub.cif Tue Sep 07 20:38:36 2010 +0100 @@ -68,6 +68,10 @@ When specified in conjunction with the C command, uses C to get the notifications instead of using C or C. +==option bool r raw + +When specified in conjunction with the C command, print out just the value, rather than the usual more verbose format that shows the category, key, type and value. + ==copyright Copyright (c) 2008-2010 Accenture. All rights reserved. diff -r 8dc858aede52 -r 31c9a831b704 commands/pubsub/pubsub.cpp --- a/commands/pubsub/pubsub.cpp Sat Aug 28 00:14:27 2010 +0100 +++ b/commands/pubsub/pubsub.cpp Tue Sep 07 20:38:36 2010 +0100 @@ -68,6 +68,7 @@ HBufC* iStringVal; TInt iIntVal; TBool iForce; + TBool iRaw; TBool iNotify; TBool iDefine; @@ -342,15 +343,29 @@ switch (type) { case EInt: - Printf(_L("0x%08x 0x%08x TInt: %d (0x%x)\r\n"), aCategory, aKey, valInt, valInt); + if (iRaw) + { + Printf(_L("%d"), valInt); + } + else + { + Printf(_L("0x%08x 0x%08x TInt: %d (0x%x)\r\n"), aCategory, aKey, valInt, valInt); + } break; case EDes: { - TPtrC8 des(valDes); - if (!aFull) des.Set(valDes.Left(32)); // Don't print the whole thing, only 2 lines max - Printf(_L("0x%08x 0x%08x TDesC8 hex dump:\r\n"), aCategory, aKey); - LtkUtils::HexDumpToOutput(des, Stdout()); - if (des.Length() < valDes.Length()) Write(_L("...\r\n")); + if (iRaw) + { + Printf(_L8("%S"), &valDes); + } + else + { + TPtrC8 des(valDes); + if (!aFull) des.Set(valDes.Left(32)); // Don't print the whole thing, only 2 lines max + Printf(_L("0x%08x 0x%08x TDesC8 hex dump:\r\n"), aCategory, aKey); + LtkUtils::HexDumpToOutput(des, Stdout()); + if (des.Length() < valDes.Length()) Write(_L("...\r\n")); + } break; } default: @@ -376,6 +391,7 @@ #ifdef FSHELL_TRACE_SUPPORT aOptions.AppendBoolL(iUseBtrace, _L("btrace")); #endif + aOptions.AppendBoolL(iRaw, _L("raw")); //aOptions.AppendStringL(iStringVal, '8', _L("set-data"), _L("Sets the specified key to this 8-bit value")); //aOptions.AppendBoolL(iDelete, 'l', _L("delete"), _L("Deletes the specified property")); } diff -r 8dc858aede52 -r 31c9a831b704 commands/variant/variant.cif --- a/commands/variant/variant.cif Sat Aug 28 00:14:27 2010 +0100 +++ b/commands/variant/variant.cif Tue Sep 07 20:38:36 2010 +0100 @@ -20,7 +20,7 @@ If the device matches the given command line options, KErrNone is returned. If not, KErrNotSupported is returned. Note that the command will not print any error message in the case of the variant not being supported, so that it doesn't make script output untidy. If an error message is required, use the C<--verbose> option. -In addition there are two special variants understood by all implementations of this command: C and C for WINS[CW] emulator and non-emulator platforms respectively. +In addition there are some other special variant names supported, that are derived at compile time from the platform.mmh macros and similar: run the tool with no arguments to see the full list. Example usage: @@ -28,6 +28,8 @@ variant wins && do-something-emulator-specific variant h4 h6 && do-something-for-h4-and-h6 +If no arguments are specified, all the supported and understood variants are listed. + ==option uint u uid multiple Test whether the device matches any of the specified machine UIDs. @@ -38,7 +40,7 @@ ==option bool l list -List the variant names that this command understands. Note this is all of them, not just the ones that match the current platform. +Has no effect, kept for compatability. ==argument string variantname optional multiple diff -r 8dc858aede52 -r 31c9a831b704 commands/variant/variant.cpp --- a/commands/variant/variant.cpp Sat Aug 28 00:14:27 2010 +0100 +++ b/commands/variant/variant.cpp Tue Sep 07 20:38:36 2010 +0100 @@ -12,6 +12,7 @@ #include #include "variant.h" +#include #include // @@ -67,30 +68,56 @@ { 0x2000DA56, DESC("5800") }, { 0x2001F0A1, DESC("satio") }, // I assume this is what it shipped with... { 0x20029a73, DESC("n8") }, // Likewise... + { 0x102734e3, DESC("qemu") }, }; const TInt KMachineIdVariantCount = sizeof(KMachineIdVariants) / sizeof(TVariant); +// This is a list of things configured in or out at compile time based on the platform.mmh macros and similar +const LtkUtils::SLitC KOtherSupportedVariants[] = + { +#ifdef __WINS__ + DESC("wins"), +#else + DESC("target"), +#endif +#ifdef FSHELL_TRACECORE_SUPPORT + DESC("tracecore-support"), +#endif + }; +const TInt KOtherSupportedVariantsCount = sizeof(KOtherSupportedVariants) / sizeof(LtkUtils::SLitC); + void CCmdVariant::DoRunL() { - if (iList) + TInt localMachineUid = GetMachineUidL(); + + if (iMachineId.Count() == 0 && iVariant.Count() == 0) { - Printf(_L("Supported variants: ")); + Printf(_L("Variant names understood by this command: ")); for (TInt i = 0; i < KMachineIdVariantCount; i++) { Printf(_L("%S, "), &KMachineIdVariants[i].iName); } - // Finally add the ones which don't appear in KMachineIdVariants - Write(_L("wins, target\r\n")); + // Finally add the ones which can appear in KOtherSupportedVariants + Printf(_L("wins, target, tracecore-support\r\n")); + + Printf(_L("Variant names supported by this device: ")); + for (TInt i = 0; i < KMachineIdVariantCount; i++) + { + if (localMachineUid == KMachineIdVariants[i].iUid) + { + Printf(_L("%S, "), &KMachineIdVariants[i].iName); + } + } + for (TInt i = 0; i < KOtherSupportedVariantsCount; i++) + { + if (i > 0) Printf(_L(", ")); + Printf(KOtherSupportedVariants[i]()); + } + Printf(_L("\r\n")); Complete(KErrNone); return; } - if (iMachineId.Count() == 0 && iVariant.Count() == 0) - { - LeaveIfErr(KErrArgument, _L("You must specify at least one argument or --uid option")); - } - - TInt localMachineUid = GetMachineUidL(); TBool match = EFalse; if (iMachineId.Count()) { @@ -115,11 +142,14 @@ match = ETrue; } } -#ifdef __WINS__ - if (iVariant[i]->CompareF(_L("wins")) == 0) match = ETrue; -#else - if (iVariant[i]->CompareF(_L("target")) == 0) match = ETrue; -#endif + + for (TInt j = 0; match == EFalse && j < KOtherSupportedVariantsCount; j++) + { + if (iVariant[i]->CompareF(KOtherSupportedVariants[j]) == 0) + { + match = ETrue; + } + } } } diff -r 8dc858aede52 -r 31c9a831b704 core/builtins/var.cif --- a/core/builtins/var.cif Sat Aug 28 00:14:27 2010 +0100 +++ b/core/builtins/var.cif Tue Sep 07 20:38:36 2010 +0100 @@ -64,6 +64,10 @@ Subtracts the given value from the environment variable. Semantics as per add. +==enum-value multiply + +Multiply the specified environment variable by the given value. + ==argument string argument optional The argument to the operation. diff -r 8dc858aede52 -r 31c9a831b704 core/group/comm.script --- a/core/group/comm.script Sat Aug 28 00:14:27 2010 +0100 +++ b/core/group/comm.script Tue Sep 07 20:38:36 2010 +0100 @@ -11,6 +11,8 @@ # Accenture - Initial contribution # +variant wins && error -5 "comm.script is not supported on the emulator" + # NaviEngine, port next to VGA variant naviengine && export ARGS "--console vt100busdevcons --console-title pdd=euart1,ldd=ecomm,port=1,rate=115200" @@ -26,8 +28,16 @@ # OPP Mid-Size Prototype, requires a special USB cable with a UART bridge built into it (normally covered in heat shrink) or a "black box". variant opp-mid-size && export ARGS "--console vt100busdevcons --console-title pdd=euart1,ldd=ecomm,rate=115200,port=4" +# QEMU simulator - assumes you're using 2nd emulated serial port for fshell, ie with options similar to "-serial file:rdebug.txt -serial COMx" +variant qemu && export ARGS "--console vt100busdevcons --console-title pdd=eserial,ldd=ecomm,rate=115200,port=1" + # Add new variants here + +# Only try terminal keyboard if there hasn't been a better match for the hardware (and tracecore is supported) +# Therefore, this rule should stay near the bottom of the file +var ARGS not-defined && variant tracecore-support && export ARGS "--console terminalkeyboardcons --console-size 120,40" + # And finally, start fshell with the given configuration var ARGS defined || error -5 "Variant not recognised, can't open serial connection" fshell $ARGS & \ No newline at end of file diff -r 8dc858aede52 -r 31c9a831b704 core/group/fshell_autoexec.bat --- a/core/group/fshell_autoexec.bat Sat Aug 28 00:14:27 2010 +0100 +++ b/core/group/fshell_autoexec.bat Tue Sep 07 20:38:36 2010 +0100 @@ -1,1 +1,1 @@ -fshell autostart +start fshell autostart diff -r 8dc858aede52 -r 31c9a831b704 core/group/fshell_core.iby --- a/core/group/fshell_core.iby Sat Aug 28 00:14:27 2010 +0100 +++ b/core/group/fshell_core.iby Tue Sep 07 20:38:36 2010 +0100 @@ -170,19 +170,16 @@ #endif #ifdef FSHELL_REPLACE_ECONS -//FSHELL_RENAMED_EXECUTABLE_FILE(iocons.dll, econs.dll) -// New method that doesn't involve removing other occurences of econs.dll from your IBYs. See TODO -FSHELL_EXECUTABLE_AS_DATA(iocons.dll, iocons.dll) +FSHELL_EXECUTABLE_AS_DATA(iocons.dll,iocons.dll) #ifdef FSHELL_USE_BLUETOOTH_CONSOLE -FSHELL_DATA_FILE(ZSYSTEM\console\iosrv.ini.bluetooth, system\console\iosrv.ini) +FSHELL_DATA_FILE(ZSYSTEM\console\iosrv.ini.bluetooth,system\console\iosrv.ini) #else -//TomS: I don't think this should be here any more - the VT100 consoles don't need it and I get by quite happily without it -//FSHELL_DATA_FILE(ZSYSTEM\console\iosrv.ini.econs_fb, system\console\iosrv.ini) +FSHELL_DATA_FILE(ZSYSTEM\console\iosrv.ini.econs_fb,system\console\iosrv.ini) #ifdef FSHELL_WSERV_SUPPORT -FSHELL_RENAMED_EXECUTABLE_FILE(econseik.dll, econs_fb.dll) +FSHELL_RENAMED_EXECUTABLE_FILE(econseik.dll,econs_fb.dll) #else -FSHELL_RENAMED_EXECUTABLE_FILE(econs.dll, econs_fb.dll) +FSHELL_RENAMED_EXECUTABLE_FILE(econs.dll,econs_fb.dll) #endif #endif // FSHELL_USE_BLUETOOTH_CONSOLE diff -r 8dc858aede52 -r 31c9a831b704 core/src/commands.cpp --- a/core/src/commands.cpp Sat Aug 28 00:14:27 2010 +0100 +++ b/core/src/commands.cpp Tue Sep 07 20:38:36 2010 +0100 @@ -3428,16 +3428,19 @@ break; case EAdd: case ESubtract: + case EMultiply: { - if (iArg == NULL) LeaveIfErr(KErrArgument, _L("Argument must be specified for add and subtract operations")); + if (iArg == NULL) LeaveIfErr(KErrArgument, _L("Argument must be specified for add, subtract and multiply operations")); TLex lex(*iArg); TInt operand; TInt err = lex.Val(operand); LeaveIfErr(err, _L("Couldn't parse an integer from argument '%S'"), iArg); - if (iOperation == ESubtract) operand = -operand; - TInt current = 0; - TRAP_IGNORE(current = env.GetAsIntL(*iVar1)); // If it doesn't yet exist or isn't an int, we'll treat it as if it was zero - env.SetL(*iVar1, current + operand); + TInt value = 0; + TRAP_IGNORE(value = env.GetAsIntL(*iVar1)); // If it doesn't yet exist or isn't an int, we'll treat it as if it was zero + if (iOperation == ESubtract) value = value - operand; + else if (iOperation == EMultiply) value = value * operand; + else value = value + operand; + env.SetL(*iVar1, value); break; } default: @@ -3535,8 +3538,6 @@ if (err < 0) { aError.Report(); - const TDesC& scriptPath = Env().GetAsDes(KScriptPath); - const TDesC& scriptName = Env().GetAsDes(KScriptName); PrintError(err, _L("Aborted \"%S\" at line %d"), &aError.ScriptFileName(), aError.ScriptLineNumber()); } Complete(err); diff -r 8dc858aede52 -r 31c9a831b704 core/src/commands.h --- a/core/src/commands.h Sat Aug 28 00:14:27 2010 +0100 +++ b/core/src/commands.h Tue Sep 07 20:38:36 2010 +0100 @@ -729,6 +729,7 @@ ENotEqual, EAdd, ESubtract, + EMultiply, } iOperation; HBufC* iVar1; HBufC* iArg; diff -r 8dc858aede52 -r 31c9a831b704 core/src/fshell.cpp --- a/core/src/fshell.cpp Sat Aug 28 00:14:27 2010 +0100 +++ b/core/src/fshell.cpp Tue Sep 07 20:38:36 2010 +0100 @@ -405,9 +405,7 @@ User::LeaveIfError(fs.Connect()); _LIT(KPath, "%c:\\sys\\bin\\econs.dll"); TBuf<32> econsPath; - TChar systemDrive = 'c'; - fs.DriveToChar(fs.GetSystemDrive(), systemDrive); - econsPath.Format(KPath, TUint(systemDrive)); + econsPath.Format(KPath, LtkUtils::GetSystemDrive()); TEntry ioconsEntry; err = fs.Entry(iocons.FileName(), ioconsEntry); if (err == KErrNone) diff -r 8dc858aede52 -r 31c9a831b704 core/src/fshell.mmp --- a/core/src/fshell.mmp Sat Aug 28 00:14:27 2010 +0100 +++ b/core/src/fshell.mmp Tue Sep 07 20:38:36 2010 +0100 @@ -94,7 +94,7 @@ #ifdef SBSV2 sourcepath /epoc32/build/fshell/core/generated/PLAT #else -sourcepath \epoc32\build\fshell\core\generated\ ## PLAT +sourcepath \epoc32\build\fshell\core\generated\PLAT #endif source fshell_version.cpp diff -r 8dc858aede52 -r 31c9a831b704 core/tsrc/fshell-basic-test.script --- a/core/tsrc/fshell-basic-test.script Sat Aug 28 00:14:27 2010 +0100 +++ b/core/tsrc/fshell-basic-test.script Tue Sep 07 20:38:36 2010 +0100 @@ -154,6 +154,11 @@ #TODO with $A defined this no longer works - is this reasonable? I'm guessing the string is expanded left-to-right. #echo $A$INNER | export -s RESULT # I'd like this to expand to $ANEST then to "correct" but it expands to aaaNEST +# Check what characters are allowed in an environment variable name - I'm assuming |&$^#;"' aren't a good idea +export AWKWARD-!£%*()_+=/\[]{}:@ "really awkward thing" +echo -n "Evil $AWKWARD-!£%*()_+=/\[]{}:@." | export -s RESULT +var RESULT == "Evil really awkward thing." || $Error + # Test that errors reported from scripts are reported with correct line numbers export EXPECTED_ERR "Error: Aborted ^"$SCRIPT_PATHprinterror.script^" at line 17 : KErrNotFound (-1)^r^n" diff -r 8dc858aede52 -r 31c9a831b704 documentation/change_history.pod --- a/documentation/change_history.pod Sat Aug 28 00:14:27 2010 +0100 +++ b/documentation/change_history.pod Tue Sep 07 20:38:36 2010 +0100 @@ -24,7 +24,7 @@ =item * -Added L console, for platforms that support Terminal Keyboard and Trace Core. +Added L console, for platforms that support Terminal Keyboard and Trace Core. On such platforms comm.script (and thus -DFSHELL_AUTOSTART) will use it if there is no better match for the hardware platform. =item * @@ -46,6 +46,8 @@ fshell's current working directory is now normalised (via new TFileName2::Normalize function) so that the case matches what's on the filesystem). +=back + =head2 Release 000.2-000.5 Test releases with build fixes. diff -r 8dc858aede52 -r 31c9a831b704 libraries/iosrv/bmarm/iocliu.def --- a/libraries/iosrv/bmarm/iocliu.def Sat Aug 28 00:14:27 2010 +0100 +++ b/libraries/iosrv/bmarm/iocliu.def Tue Sep 07 20:38:36 2010 +0100 @@ -141,7 +141,7 @@ ConnectL__10RIoSession @ 140 NONAME R3UNUSED ; RIoSession::ConnectL(void) Connect__10RIoSession @ 141 NONAME R3UNUSED ; RIoSession::Connect(void) ConsoleImplementation__Q27IoUtils12CCommandBase @ 142 NONAME R3UNUSED ; IoUtils::CCommandBase::ConsoleImplementation(void) - CopyL__Q27IoUtils12CEnvironmentRCQ27IoUtils12CEnvironment @ 143 NONAME R3UNUSED ; IoUtils::CEnvironment::CopyL(IoUtils::CEnvironment const &) + CopyL__Q27IoUtils12CEnvironmentRCQ27IoUtils12CEnvironment @ 143 NONAME R3UNUSED ABSENT ; IoUtils::CEnvironment::CopyL(IoUtils::CEnvironment const &) Count__CQ27IoUtils12CEnvironment @ 144 NONAME R3UNUSED ; IoUtils::CEnvironment::Count(void) const CreateImplementationLC__CQ27IoUtils25CServerCommandConstructor @ 145 NONAME R3UNUSED ; IoUtils::CServerCommandConstructor::CreateImplementationLC(void) const CreateL__10RIoConsoleR10RIoSessionRC7TDesC16R10RIoConsoleT2RC5TSizeUi @ 146 NONAME ; RIoConsole::CreateL(RIoSession &, TDesC16 const &, RIoConsole &, TDesC16 const &, TSize const &, unsigned int) @@ -196,8 +196,8 @@ Exit__Q27IoUtils11CServerBasei @ 195 NONAME R3UNUSED ; IoUtils::CServerBase::Exit(int) Ext__CQ27IoUtils10TFileName2 @ 196 NONAME R3UNUSED ; IoUtils::TFileName2::Ext(void) const Extension___Q27IoUtils12CCommandBaseUiRPvPv @ 197 NONAME ; IoUtils::CCommandBase::Extension_(unsigned int, void *&, void *) - ExternalizeL__CQ27IoUtils12CEnvironmentR5TDes8 @ 198 NONAME R3UNUSED ; IoUtils::CEnvironment::ExternalizeL(TDes8 &) const - ExternalizedSize__CQ27IoUtils12CEnvironment @ 199 NONAME R3UNUSED ; IoUtils::CEnvironment::ExternalizedSize(void) const + ExternalizeL__CQ27IoUtils12CEnvironmentR5TDes8 @ 198 NONAME R3UNUSED ABSENT ; IoUtils::CEnvironment::ExternalizeL(TDes8 &) const + ExternalizedSize__CQ27IoUtils12CEnvironment @ 199 NONAME R3UNUSED ABSENT ; IoUtils::CEnvironment::ExternalizedSize(void) const Factory__Q27IoUtils11CServerBase @ 200 NONAME R3UNUSED ; IoUtils::CServerBase::Factory(void) Factory__Q27IoUtils18CServerCommandBase @ 201 NONAME R3UNUSED ; IoUtils::CServerCommandBase::Factory(void) FindFileL__Q27IoUtils10TFileName2R3RFs @ 202 NONAME R3UNUSED ; IoUtils::TFileName2::FindFileL(RFs &) @@ -371,11 +371,11 @@ Reset__Q27IoUtils14CTextFormatter @ 370 NONAME R3UNUSED ; IoUtils::CTextFormatter::Reset(void) RunCommandL__Q27IoUtils12CCommandBase @ 371 NONAME R3UNUSED ; IoUtils::CCommandBase::RunCommandL(void) RunCommandL__Q27IoUtils12CCommandBasePC7TDesC16PQ27IoUtils12CEnvironment @ 372 NONAME R3UNUSED ; IoUtils::CCommandBase::RunCommandL(TDesC16 const *, IoUtils::CEnvironment *) - RunCommandL__Q27IoUtils12CCommandBaseR10RIoSessionR13RIoReadHandleR14RIoWriteHandleT3PC7TDesC16PQ27IoUtils12CEnvironment @ 373 NONAME ; IoUtils::CCommandBase::RunCommandL(RIoSession &, RIoReadHandle &, RIoWriteHandle &, RIoWriteHandle &, TDesC16 const *, IoUtils::CEnvironment *) - RunCommand__Q27IoUtils12CCommandBase @ 374 NONAME R3UNUSED ; IoUtils::CCommandBase::RunCommand(void) - RunCommand__Q27IoUtils12CCommandBasePC7TDesC16PQ27IoUtils12CEnvironment @ 375 NONAME R3UNUSED ; IoUtils::CCommandBase::RunCommand(TDesC16 const *, IoUtils::CEnvironment *) - RunCommand__Q27IoUtils12CCommandBaseR10RIoSessionR13RIoReadHandleR14RIoWriteHandleT3PC7TDesC16PQ27IoUtils12CEnvironment @ 376 NONAME ; IoUtils::CCommandBase::RunCommand(RIoSession &, RIoReadHandle &, RIoWriteHandle &, RIoWriteHandle &, TDesC16 const *, IoUtils::CEnvironment *) - RunCommand__Q27IoUtils12CCommandBaseR10RIoSessionR13RIoReadHandleR14RIoWriteHandleT3PC7TDesC16PQ27IoUtils12CEnvironmentPQ27IoUtils20MCommandBaseObserver @ 377 NONAME ; IoUtils::CCommandBase::RunCommand(RIoSession &, RIoReadHandle &, RIoWriteHandle &, RIoWriteHandle &, TDesC16 const *, IoUtils::CEnvironment *, IoUtils::MCommandBaseObserver *) + RunCommandL__Q27IoUtils12CCommandBaseR10RIoSessionR13RIoReadHandleR14RIoWriteHandleT3PC7TDesC16PQ27IoUtils12CEnvironment @ 373 NONAME ABSENT ; IoUtils::CCommandBase::RunCommandL(RIoSession &, RIoReadHandle &, RIoWriteHandle &, RIoWriteHandle &, TDesC16 const *, IoUtils::CEnvironment *) + RunCommand__Q27IoUtils12CCommandBase @ 374 NONAME R3UNUSED ABSENT ; IoUtils::CCommandBase::RunCommand(void) + RunCommand__Q27IoUtils12CCommandBasePC7TDesC16PQ27IoUtils12CEnvironment @ 375 NONAME R3UNUSED ABSENT ; IoUtils::CCommandBase::RunCommand(TDesC16 const *, IoUtils::CEnvironment *) + RunCommand__Q27IoUtils12CCommandBaseR10RIoSessionR13RIoReadHandleR14RIoWriteHandleT3PC7TDesC16PQ27IoUtils12CEnvironment @ 376 NONAME ABSENT ; IoUtils::CCommandBase::RunCommand(RIoSession &, RIoReadHandle &, RIoWriteHandle &, RIoWriteHandle &, TDesC16 const *, IoUtils::CEnvironment *) + RunCommand__Q27IoUtils12CCommandBaseR10RIoSessionR13RIoReadHandleR14RIoWriteHandleT3PC7TDesC16PQ27IoUtils12CEnvironmentPQ27IoUtils20MCommandBaseObserver @ 377 NONAME ABSENT ; IoUtils::CCommandBase::RunCommand(RIoSession &, RIoReadHandle &, RIoWriteHandle &, RIoWriteHandle &, TDesC16 const *, IoUtils::CEnvironment *, IoUtils::MCommandBaseObserver *) RunError__Q27IoUtils12CCommandBasei @ 378 NONAME R3UNUSED ; IoUtils::CCommandBase::RunError(int) RunL__Q27IoUtils12CCommandBase @ 379 NONAME R3UNUSED ; IoUtils::CCommandBase::RunL(void) Run__Q27IoUtils13RChildProcessR14TRequestStatus @ 380 NONAME R3UNUSED ; IoUtils::RChildProcess::Run(TRequestStatus &) @@ -519,4 +519,35 @@ SubCommand__CQ27IoUtils16CCommandInfoFileRC7TDesC16 @ 518 NONAME R3UNUSED ; IoUtils::CCommandInfoFile::SubCommand(TDesC16 const &) const TypeDescription__Q27IoUtils18CBranchCommandBase @ 519 NONAME R3UNUSED ; IoUtils::CBranchCommandBase::TypeDescription(void) __as__Q27IoUtils5TEnumRCQ27IoUtils5TEnum @ 520 NONAME R3UNUSED ; IoUtils::TEnum::operator=(IoUtils::TEnum const &) + AllSet__CQ27IoUtils20RCommandArgumentList @ 521 NONAME R3UNUSED ; IoUtils::RCommandArgumentList::AllSet(void) const + Cif__CQ27IoUtils12CCommandBase @ 522 NONAME R3UNUSED ; IoUtils::CCommandBase::Cif(void) const + Copyright__CQ27IoUtils16CCommandInfoFile @ 523 NONAME R3UNUSED ; IoUtils::CCommandInfoFile::Copyright(void) const + Count__CQ27IoUtils20RCommandArgumentList @ 524 NONAME R3UNUSED ; IoUtils::RCommandArgumentList::Count(void) const + CreateEnvironmentL__Q27IoUtils12CCommandBasePQ27IoUtils12CEnvironment @ 525 NONAME R3UNUSED ; IoUtils::CCommandBase::CreateEnvironmentL(IoUtils::CEnvironment *) + CreateSharedEnvironmentL__Q27IoUtils12CEnvironment @ 526 NONAME R3UNUSED ; IoUtils::CEnvironment::CreateSharedEnvironmentL(void) + CtrlCPressed__Q27IoUtils20MCommandExtensionsV2 @ 527 NONAME R3UNUSED ; IoUtils::MCommandExtensionsV2::CtrlCPressed(void) + EnumValueList__CQ27IoUtils6TValue @ 528 NONAME R3UNUSED ; IoUtils::TValue::EnumValueList(void) const + EnvVar__CQ27IoUtils6TValue @ 529 NONAME R3UNUSED ; IoUtils::TValue::EnvVar(void) const + ExtensionVersion__CQ27IoUtils20MCommandExtensionsV1 @ 530 NONAME R3UNUSED ; IoUtils::MCommandExtensionsV1::ExtensionVersion(void) const + ExtensionVersion__CQ27IoUtils20MCommandExtensionsV2 @ 531 NONAME R3UNUSED ; IoUtils::MCommandExtensionsV2::ExtensionVersion(void) const + ExternalizeLC__CQ27IoUtils12CEnvironment @ 532 NONAME R3UNUSED ; IoUtils::CEnvironment::ExternalizeLC(void) const + GetKeysL__CQ27IoUtils12CEnvironmentRt13RPointerArray1Z7HBufC16 @ 533 NONAME R3UNUSED ; IoUtils::CEnvironment::GetKeysL(RPointerArray &) const + IoSession__C12TIoHandleSet @ 534 NONAME R3UNUSED ; TIoHandleSet::IoSession(void) const + KeyPressed__Q27IoUtils20MCommandExtensionsV2UiUi @ 535 NONAME R3UNUSED ; IoUtils::MCommandExtensionsV2::KeyPressed(unsigned int, unsigned int) + Normalize__Q27IoUtils10TFileName2R3RFs @ 536 NONAME R3UNUSED ; IoUtils::TFileName2::Normalize(RFs &) + ReadKey__Q27IoUtils12CCommandBase @ 537 NONAME R3UNUSED ; IoUtils::CCommandBase::ReadKey(void) + RemoveAll__Q27IoUtils12CEnvironment @ 538 NONAME R3UNUSED ; IoUtils::CEnvironment::RemoveAll(void) + Session__C9RIoHandle @ 539 NONAME R3UNUSED ; RIoHandle::Session(void) const + SetCif__Q27IoUtils12CCommandBaseRCQ27IoUtils16CCommandInfoFile @ 540 NONAME R3UNUSED ; IoUtils::CCommandBase::SetCif(IoUtils::CCommandInfoFile const &) + SetExtension__Q27IoUtils12CCommandBasePQ27IoUtils20MCommandExtensionsV1 @ 541 NONAME R3UNUSED ; IoUtils::CCommandBase::SetExtension(IoUtils::MCommandExtensionsV1 *) + SetLocalL__Q27IoUtils12CEnvironmentRC7TDesC16 @ 542 NONAME R3UNUSED ; IoUtils::CEnvironment::SetLocalL(TDesC16 const &) + Stderr__C12TIoHandleSet @ 543 NONAME R3UNUSED ; TIoHandleSet::Stderr(void) const + Stdin__C12TIoHandleSet @ 544 NONAME R3UNUSED ; TIoHandleSet::Stdin(void) const + Stdout__C12TIoHandleSet @ 545 NONAME R3UNUSED ; TIoHandleSet::Stdout(void) const + StringifyError__CQ27IoUtils20MCommandExtensionsV1i @ 546 NONAME R3UNUSED ; IoUtils::MCommandExtensionsV1::StringifyError(int) const + Type__CQ27IoUtils6TValue @ 547 NONAME R3UNUSED ; IoUtils::TValue::Type(void) const + ValuePtr__CQ27IoUtils6TValue @ 548 NONAME R3UNUSED ; IoUtils::TValue::ValuePtr(void) const + __12TIoHandleSetR10RIoSessionR13RIoReadHandleR14RIoWriteHandleT3 @ 549 NONAME ; TIoHandleSet::TIoHandleSet(RIoSession &, RIoReadHandle &, RIoWriteHandle &, RIoWriteHandle &) + __vc__CQ27IoUtils20RCommandArgumentListi @ 550 NONAME R3UNUSED ; IoUtils::RCommandArgumentList::operator[](int) const + AcceptsMultiple__CQ27IoUtils6TValue @ 551 NONAME R3UNUSED ; IoUtils::TValue::AcceptsMultiple(void) const diff -r 8dc858aede52 -r 31c9a831b704 libraries/iosrv/client/command_base.cpp --- a/libraries/iosrv/client/command_base.cpp Sat Aug 28 00:14:27 2010 +0100 +++ b/libraries/iosrv/client/command_base.cpp Tue Sep 07 20:38:36 2010 +0100 @@ -3632,7 +3632,9 @@ return iProcess; } -#define CASE_RETURN_LIT(XXX) case XXX: { _LIT(_KLit, #XXX); return &_KLit; } +// Really should define a standard CASE_LIT macro that every compiler can handle... +#include +#define CASE_RETURN_LIT(x) case x: { static const LtkUtils::SLitC KName = DESC(#x); return &KName; } #define CASE_RETURN_LIT2(XXX, YYY) case XXX: { _LIT(_KLit, YYY); return &_KLit; } #define DEFAULT_RETURN_LIT(XXX) default: { _LIT(_KLit, XXX); return &_KLit; } diff -r 8dc858aede52 -r 31c9a831b704 libraries/ltkutils/BMARM/ltkutils-tcb.DEF --- a/libraries/ltkutils/BMARM/ltkutils-tcb.DEF Sat Aug 28 00:14:27 2010 +0100 +++ b/libraries/ltkutils/BMARM/ltkutils-tcb.DEF Tue Sep 07 20:38:36 2010 +0100 @@ -167,4 +167,5 @@ FormatSize__8LtkUtilsR5TDes8x @ 166 NONAME ; LtkUtils::FormatSize(TDes8 &, long long) FormatSize___8LtkUtilsR6TDes16x @ 167 NONAME ; LtkUtils::FormatSize_(TDes16 &, long long) Description__CQ28LtkUtils16RAllocatorHelper @ 168 NONAME R3UNUSED ; LtkUtils::RAllocatorHelper::Description(void) const + GetSystemDrive__8LtkUtilsv @ 169 NONAME R3UNUSED ; LtkUtils::GetSystemDrive(void) diff -r 8dc858aede52 -r 31c9a831b704 libraries/ltkutils/BMARM/ltkutils.DEF --- a/libraries/ltkutils/BMARM/ltkutils.DEF Sat Aug 28 00:14:27 2010 +0100 +++ b/libraries/ltkutils/BMARM/ltkutils.DEF Tue Sep 07 20:38:36 2010 +0100 @@ -181,4 +181,5 @@ FormatSize__8LtkUtilsR5TDes8x @ 180 NONAME ; LtkUtils::FormatSize(TDes8 &, long long) FormatSize___8LtkUtilsR6TDes16x @ 181 NONAME ; LtkUtils::FormatSize_(TDes16 &, long long) Description__CQ28LtkUtils16RAllocatorHelper @ 182 NONAME R3UNUSED ; LtkUtils::RAllocatorHelper::Description(void) const + GetSystemDrive__8LtkUtilsv @ 183 NONAME R3UNUSED ; LtkUtils::GetSystemDrive(void) diff -r 8dc858aede52 -r 31c9a831b704 libraries/ltkutils/bwins/ltkutils-tcb.def --- a/libraries/ltkutils/bwins/ltkutils-tcb.def Sat Aug 28 00:14:27 2010 +0100 +++ b/libraries/ltkutils/bwins/ltkutils-tcb.def Tue Sep 07 20:38:36 2010 +0100 @@ -152,4 +152,5 @@ ?FormatSize@LtkUtils@@YAXAAVTDes8@@_J@Z @ 151 NONAME ; void LtkUtils::FormatSize(class TDes8 &, long long) ?FormatSize@LtkUtils@@YAXAAVTDes16@@_J@Z @ 152 NONAME ; void LtkUtils::FormatSize(class TDes16 &, long long) ?Description@RAllocatorHelper@LtkUtils@@QBEABVTDesC16@@XZ @ 153 NONAME ; class TDesC16 const & LtkUtils::RAllocatorHelper::Description(void) const + ?GetSystemDrive@LtkUtils@@YADXZ @ 154 NONAME ; char LtkUtils::GetSystemDrive(void) diff -r 8dc858aede52 -r 31c9a831b704 libraries/ltkutils/bwins/ltkutils.def --- a/libraries/ltkutils/bwins/ltkutils.def Sat Aug 28 00:14:27 2010 +0100 +++ b/libraries/ltkutils/bwins/ltkutils.def Tue Sep 07 20:38:36 2010 +0100 @@ -181,4 +181,5 @@ ?FormatSize@LtkUtils@@YAXAAVTDes8@@_J@Z @ 180 NONAME ; void LtkUtils::FormatSize(class TDes8 &, long long) ?FormatSize@LtkUtils@@YAXAAVTDes16@@_J@Z @ 181 NONAME ; void LtkUtils::FormatSize(class TDes16 &, long long) ?Description@RAllocatorHelper@LtkUtils@@QBEABVTDesC16@@XZ @ 182 NONAME ; class TDesC16 const & LtkUtils::RAllocatorHelper::Description(void) const + ?GetSystemDrive@LtkUtils@@YADXZ @ 183 NONAME ; char LtkUtils::GetSystemDrive(void) diff -r 8dc858aede52 -r 31c9a831b704 libraries/ltkutils/eabi/ltkutils-tcb.def --- a/libraries/ltkutils/eabi/ltkutils-tcb.def Sat Aug 28 00:14:27 2010 +0100 +++ b/libraries/ltkutils/eabi/ltkutils-tcb.def Tue Sep 07 20:38:36 2010 +0100 @@ -182,4 +182,5 @@ _ZN8LtkUtils10FormatSizeER5TDes8x @ 181 NONAME _ZN8LtkUtils10FormatSizeER6TDes16x @ 182 NONAME _ZNK8LtkUtils16RAllocatorHelper11DescriptionEv @ 183 NONAME + _ZN8LtkUtils14GetSystemDriveEv @ 184 NONAME diff -r 8dc858aede52 -r 31c9a831b704 libraries/ltkutils/eabi/ltkutils.def --- a/libraries/ltkutils/eabi/ltkutils.def Sat Aug 28 00:14:27 2010 +0100 +++ b/libraries/ltkutils/eabi/ltkutils.def Tue Sep 07 20:38:36 2010 +0100 @@ -218,4 +218,5 @@ _ZN8LtkUtils10FormatSizeER5TDes8x @ 217 NONAME _ZN8LtkUtils10FormatSizeER6TDes16x @ 218 NONAME _ZNK8LtkUtils16RAllocatorHelper11DescriptionEv @ 219 NONAME + _ZN8LtkUtils14GetSystemDriveEv @ 220 NONAME diff -r 8dc858aede52 -r 31c9a831b704 libraries/ltkutils/inc/heaputils.h --- a/libraries/ltkutils/inc/heaputils.h Sat Aug 28 00:14:27 2010 +0100 +++ b/libraries/ltkutils/inc/heaputils.h Tue Sep 07 20:38:36 2010 +0100 @@ -9,7 +9,9 @@ // Initial Contributors: // Accenture - Initial contribution // - +// Contributors: +// Adrian Issott (Nokia) - Updates for kernel-side alloc helper +// #ifndef FSHELL_HEAP_UTILS_H #define FSHELL_HEAP_UTILS_H @@ -41,6 +43,7 @@ public: HUIMPORT_C RAllocatorHelper(); #ifdef __KERNEL_MODE__ + TLinAddr GetKernelAllocator(DChunk* aKernelChunk); TInt OpenKernelHeap(); #else HUIMPORT_C TInt Open(RAllocator* aAllocator); @@ -116,13 +119,19 @@ protected: TInt FinishConstruction(); - TInt IdentifyAllocatorType(TBool aAllocatorIsUdeb); + TInt IdentifyAllocatorType(TBool aAllocatorIsUdeb, TBool aIsTheKernelHeap=EFalse); TInt OpenChunkHeap(TLinAddr aChunkBase, TInt aChunkMaxSize); #ifndef __KERNEL_MODE__ static TInt EuserIsUdeb(); #endif virtual TInt ReadData(TLinAddr aLocation, TAny* aResult, TInt aSize) const; virtual TInt WriteData(TLinAddr aLocation, const TAny* aData, TInt aSize); + +#ifndef __KERNEL_MODE__ +protected: +#else +public: +#endif virtual TInt TryLock(); virtual void TryUnlock(); @@ -171,10 +180,10 @@ #ifdef __KERNEL_MODE__ -class RKernelSideAllocatorHelper : public RAllocatorHelper - { +class RUserAllocatorHelper : public RAllocatorHelper + { public: - RKernelSideAllocatorHelper(); + RUserAllocatorHelper(); TInt OpenUserHeap(TUint aThreadId, TLinAddr aAllocatorAddress, TBool aEuserIsUdeb); virtual DChunk* OpenUnderlyingChunk(); // Must be in CS virtual void Close(); @@ -188,6 +197,24 @@ DThread* iThread; }; +class RKernelCopyAllocatorHelper : public RAllocatorHelper + { +public: + RKernelCopyAllocatorHelper(); + TInt OpenCopiedHeap(DChunk* aOriginalChunk, DChunk* aCopiedChunk, TInt aOffset); + virtual DChunk* OpenUnderlyingChunk(); // Must be in CS + virtual void Close(); + +protected: + virtual TInt ReadData(TLinAddr aLocation, TAny* aResult, TInt aSize) const; + virtual TInt WriteData(TLinAddr aLocation, const TAny* aData, TInt aSize); + virtual TInt TryLock(); + virtual void TryUnlock(); +private: + DChunk* iCopiedChunk; + TInt iOffset; // from the original kernel heap to the copied heap + }; + #else class RProxyAllocatorHelper : public RAllocatorHelper diff -r 8dc858aede52 -r 31c9a831b704 libraries/ltkutils/inc/ltkutils.h --- a/libraries/ltkutils/inc/ltkutils.h Sat Aug 28 00:14:27 2010 +0100 +++ b/libraries/ltkutils/inc/ltkutils.h Tue Sep 07 20:38:36 2010 +0100 @@ -65,6 +65,9 @@ template inline void CleanupResetPushL(T& aRef); + + IMPORT_C char GetSystemDrive(); // 9.1 doesn't have RFs::GetSystemDrive() + /**** * The functions below are not available if you're linking against ltkutils-tcb.dll. They * rely on being able to link against All -TCB dlls. diff -r 8dc858aede52 -r 31c9a831b704 libraries/ltkutils/src/heaphackery.cpp --- a/libraries/ltkutils/src/heaphackery.cpp Sat Aug 28 00:14:27 2010 +0100 +++ b/libraries/ltkutils/src/heaphackery.cpp Tue Sep 07 20:38:36 2010 +0100 @@ -9,6 +9,10 @@ // Initial Contributors: // Accenture - Initial contribution // +// Contributors: +// Adrian Issott (Nokia) - Updates for kernel-side alloc helper +// + #ifdef TEST_HYBRIDHEAP_ASSERTS #define private public #include @@ -23,7 +27,7 @@ #include #define MEM Kern -__ASSERT_COMPILE(sizeof(LtkUtils::RKernelSideAllocatorHelper) == 10*4); +__ASSERT_COMPILE(sizeof(LtkUtils::RUserAllocatorHelper) == 10*4); #define KERN_ENTER_CS() NKern::ThreadEnterCS() #define KERN_LEAVE_CS() NKern::ThreadLeaveCS() #define LOG(args...) @@ -104,6 +108,23 @@ #ifdef __KERNEL_MODE__ +TLinAddr LtkUtils::RAllocatorHelper::GetKernelAllocator(DChunk* aKernelChunk) + { + TLinAddr allocatorAddress; +#ifdef __WINS__ + allocatorAddress = (TLinAddr)aKernelChunk->Base(); +#else + // Copied from P::KernelInfo + const TRomHeader& romHdr=Epoc::RomHeader(); + const TRomEntry* primaryEntry=(const TRomEntry*)Kern::SuperPage().iPrimaryEntry; + const TRomImageHeader* primaryImageHeader=(const TRomImageHeader*)primaryEntry->iAddressLin; + TLinAddr stack = romHdr.iKernDataAddress + Kern::RoundToPageSize(romHdr.iTotalSvDataSize); + TLinAddr heap = stack + Kern::RoundToPageSize(primaryImageHeader->iStackSize); + allocatorAddress = heap; +#endif + return allocatorAddress; + } + TInt RAllocatorHelper::OpenKernelHeap() { _LIT(KName, "SvHeap"); @@ -123,19 +144,14 @@ } } iChunk = foundChunk; - chunkContainer->Signal(); -#ifdef __WINS__ - TInt err = OpenChunkHeap((TLinAddr)foundChunk->Base(), 0); // It looks like DChunk::iBase/DChunk::iFixedBase should both be ok for the kernel chunk -#else - // Copied from P::KernelInfo - const TRomHeader& romHdr=Epoc::RomHeader(); - const TRomEntry* primaryEntry=(const TRomEntry*)Kern::SuperPage().iPrimaryEntry; - const TRomImageHeader* primaryImageHeader=(const TRomImageHeader*)primaryEntry->iAddressLin; - TLinAddr stack = romHdr.iKernDataAddress + Kern::RoundToPageSize(romHdr.iTotalSvDataSize); - TLinAddr heap = stack + Kern::RoundToPageSize(primaryImageHeader->iStackSize); - TInt err = OpenChunkHeap(heap, 0); // aChunkMaxSize is only used for trying the middle of the chunk for hybrid allocatorness, and the kernel heap doesn't use that (thankfully). So we can safely pass in zero. + chunkContainer->Signal(); + + iAllocatorAddress = GetKernelAllocator(foundChunk); -#endif + // It looks like DChunk::iBase/DChunk::iFixedBase should both be ok for the kernel chunk + // aChunkMaxSize is only used for trying the middle of the chunk for hybrid allocatorness, and the kernel heap doesn't use that (thankfully). So we can safely pass in zero. + TInt err = OpenChunkHeap((TLinAddr)foundChunk->Base(), 0); + if (!err) err = FinishConstruction(); NKern::ThreadLeaveCS(); return err; @@ -288,11 +304,11 @@ #ifdef __KERNEL_MODE__ -LtkUtils::RKernelSideAllocatorHelper::RKernelSideAllocatorHelper() +LtkUtils::RUserAllocatorHelper::RUserAllocatorHelper() : iThread(NULL) {} -void LtkUtils::RKernelSideAllocatorHelper::Close() +void LtkUtils::RUserAllocatorHelper::Close() { NKern::ThreadEnterCS(); if (iThread) @@ -304,27 +320,27 @@ NKern::ThreadLeaveCS(); } -TInt LtkUtils::RKernelSideAllocatorHelper::ReadData(TLinAddr aLocation, TAny* aResult, TInt aSize) const +TInt LtkUtils::RUserAllocatorHelper::ReadData(TLinAddr aLocation, TAny* aResult, TInt aSize) const { return Kern::ThreadRawRead(iThread, (const TAny*)aLocation, aResult, aSize); } -TInt LtkUtils::RKernelSideAllocatorHelper::WriteData(TLinAddr aLocation, const TAny* aData, TInt aSize) +TInt LtkUtils::RUserAllocatorHelper::WriteData(TLinAddr aLocation, const TAny* aData, TInt aSize) { return Kern::ThreadRawWrite(iThread, (TAny*)aLocation, aData, aSize); } -TInt LtkUtils::RKernelSideAllocatorHelper::TryLock() +TInt LtkUtils::RUserAllocatorHelper::TryLock() { return KErrNotSupported; } -void LtkUtils::RKernelSideAllocatorHelper::TryUnlock() +void LtkUtils::RUserAllocatorHelper::TryUnlock() { // Not supported } -TInt LtkUtils::RKernelSideAllocatorHelper::OpenUserHeap(TUint aThreadId, TLinAddr aAllocatorAddress, TBool aEuserIsUdeb) +TInt LtkUtils::RUserAllocatorHelper::OpenUserHeap(TUint aThreadId, TLinAddr aAllocatorAddress, TBool aEuserIsUdeb) { NKern::ThreadEnterCS(); DObjectCon* threads = Kern::Containers()[EThread]; @@ -344,34 +360,102 @@ return err; } +LtkUtils::RKernelCopyAllocatorHelper::RKernelCopyAllocatorHelper() + : iCopiedChunk(NULL), iOffset(0) + {} + +TInt LtkUtils::RKernelCopyAllocatorHelper::OpenCopiedHeap(DChunk* aOriginalChunk, DChunk* aCopiedChunk, TInt aOffset) + { + TInt err = aCopiedChunk->Open(); + if (!err) + { + iCopiedChunk = aCopiedChunk; + iOffset = aOffset; + + // We need to set iAllocatorAddress to point to the allocator in the original chunk and not the copy + // because all the internal pointers will be relative to that. Instead we use iOffset in the Read / Write Data + // calls + iAllocatorAddress = GetKernelAllocator(aOriginalChunk); + + // It looks like DChunk::iBase/DChunk::iFixedBase should both be ok for the kernel chunk + // aChunkMaxSize is only used for trying the middle of the chunk for hybrid allocatorness, and the kernel heap doesn't use that (thankfully). So we can safely pass in zero. + err = OpenChunkHeap((TLinAddr)aCopiedChunk->Base(), 0); + } + + return err; + } + +DChunk* LtkUtils::RKernelCopyAllocatorHelper::OpenUnderlyingChunk() + { + // We should never get here + __NK_ASSERT_ALWAYS(EFalse); + return NULL; + } + +void LtkUtils::RKernelCopyAllocatorHelper::Close() + { + if (iCopiedChunk) + { + NKern::ThreadEnterCS(); + iCopiedChunk->Close(NULL); + iCopiedChunk = NULL; + NKern::ThreadLeaveCS(); + } + iOffset = 0; + RAllocatorHelper::Close(); + } + +TInt LtkUtils::RKernelCopyAllocatorHelper::ReadData(TLinAddr aLocation, TAny* aResult, TInt aSize) const + { + memcpy(aResult, (const TAny*)(aLocation+iOffset), aSize); + return KErrNone; + } + +TInt LtkUtils::RKernelCopyAllocatorHelper::WriteData(TLinAddr aLocation, const TAny* aData, TInt aSize) + { + memcpy((TAny*)(aLocation+iOffset), aData, aSize); + return KErrNone; + } + +TInt LtkUtils::RKernelCopyAllocatorHelper::TryLock() + { + return KErrNotSupported; + } + +void LtkUtils::RKernelCopyAllocatorHelper::TryUnlock() + { + // Not supported + } + #endif // __KERNEL_MODE__ TInt RAllocatorHelper::OpenChunkHeap(TLinAddr aChunkBase, TInt aChunkMaxSize) { - iAllocatorAddress = aChunkBase; #ifdef __KERNEL_MODE__ // Must be in CS // Assumes that this only ever gets called for the kernel heap. Otherwise goes through RKernelSideAllocatorHelper::OpenUserHeap. TInt udeb = EFalse; // We can't figure this out until after we've got the heap + TBool isTheKernelHeap = ETrue; #else // Assumes the chunk isn't the kernel heap. It's not a good idea to try messing with the kernel heap from user side... TInt udeb = EuserIsUdeb(); if (udeb < 0) return udeb; // error + TBool isTheKernelHeap = EFalse; #endif - TInt err = IdentifyAllocatorType(udeb); + TInt err = IdentifyAllocatorType(udeb, isTheKernelHeap); if (err == KErrNone && iAllocatorType == EAllocator) { // We've no reason to assume it's an allocator because we don't know the iAllocatorAddress actually is an RAllocator* err = KErrNotFound; } - if (err) + if (err && aChunkMaxSize > 0) { TInt oldErr = err; TAllocatorType oldType = iAllocatorType; // Try middle of chunk, in case it's an RHybridHeap iAllocatorAddress += aChunkMaxSize / 2; - err = IdentifyAllocatorType(udeb); + err = IdentifyAllocatorType(udeb, isTheKernelHeap); if (err || iAllocatorType == EAllocator) { // No better than before @@ -389,7 +473,7 @@ TInt err = kernelAllocator->DebugFunction(7, NULL, NULL); // 7 is RAllocator::TAllocDebugOp::EGetFail if (err == 9999) { - // udeb new + // udeb new hybrid heap udeb = ETrue; } else if (err == KErrNotSupported) @@ -397,7 +481,7 @@ // Old heap - fall back to slightly nasty non-thread-safe method kernelAllocator->DebugFunction(RAllocator::ESetFail, (TAny*)RAllocator::EFailNext, (TAny*)1); TAny* res = Kern::Alloc(4); - if (res) udeb = ETrue; + if (!res) udeb = ETrue; Kern::Free(res); } else @@ -408,7 +492,7 @@ // Put everything back kernelAllocator->DebugFunction(RAllocator::ESetFail, (TAny*)RAllocator::ENone, (TAny*)0); // And update the type now we know the udeb-ness for certain - err = IdentifyAllocatorType(udeb); + err = IdentifyAllocatorType(udeb, isTheKernelHeap); } #endif return err; @@ -535,7 +619,7 @@ KERN_LEAVE_CS(); } -TInt RAllocatorHelper::IdentifyAllocatorType(TBool aAllocatorIsUdeb) +TInt RAllocatorHelper::IdentifyAllocatorType(TBool aAllocatorIsUdeb, TBool aIsTheKernelHeap) { iAllocatorType = EUnknown; @@ -543,7 +627,9 @@ TInt err = ReadWord(iAllocatorAddress + _FOFF(RHackAllocator, iHandles), handlesPtr); if (err) return err; - if (handlesPtr == iAllocatorAddress + _FOFF(RHackHeap, iChunkHandle) || handlesPtr == iAllocatorAddress + _FOFF(RHackHeap, iLock)) + if (aIsTheKernelHeap || + handlesPtr == iAllocatorAddress + _FOFF(RHackHeap, iChunkHandle) || + handlesPtr == iAllocatorAddress + _FOFF(RHackHeap, iLock)) { // It's an RHeap of some kind - I doubt any other RAllocator subclass will use iHandles in this way TUint32 base = 0; @@ -971,6 +1057,7 @@ return KErrCorrupt; } } + while (pC!=pF) // walk allocated cells up to next free cell { TInt l; // pC->len; @@ -1450,6 +1537,7 @@ } } +// Really should be called TotalSizeForCellType(...) HUEXPORT_C TInt RAllocatorHelper::SizeForCellType(TExtendedCellType aType) { if (aType & EBadnessMask) return KErrArgument; @@ -1596,7 +1684,7 @@ return iChunk; } -DChunk* LtkUtils::RKernelSideAllocatorHelper::OpenUnderlyingChunk() +DChunk* LtkUtils::RUserAllocatorHelper::OpenUnderlyingChunk() { if (iAllocatorType != EUrelOldRHeap && iAllocatorType != EUdebOldRHeap && iAllocatorType != EUrelHybridHeap && iAllocatorType != EUdebHybridHeap) return NULL; // Note RKernelSideAllocatorHelper doesn't use or access RAllocatorHelper::iChunk, because we figure out the chunk handle in a different way. diff -r 8dc858aede52 -r 31c9a831b704 libraries/ltkutils/src/ltkhal.cpp --- a/libraries/ltkutils/src/ltkhal.cpp Sat Aug 28 00:14:27 2010 +0100 +++ b/libraries/ltkutils/src/ltkhal.cpp Tue Sep 07 20:38:36 2010 +0100 @@ -9,9 +9,12 @@ // Initial Contributors: // Accenture - Initial contribution // +#include #include #include +#include #include +#include LtkUtils::CHalAttribute::CHalAttribute(TInt aAttribute, TInt aDeviceNumber, TInt aValue, TInt aError, const TDesC& aAttributeName, HBufC* aDescription) : iAttribute(aAttribute), iDeviceNumber(aDeviceNumber), iValue(aValue), iError(aError), iAttributeName(aAttributeName), iDescription(aDescription) @@ -341,3 +344,16 @@ CleanupStack::Pop(&buf); // attrib now owns its HBufC* return attrib; } + +EXPORT_C char LtkUtils::GetSystemDrive() + { +#ifdef FSHELL_9_1_SUPPORT + TInt ch = EDriveC; + HAL::Get(HAL::ESystemDrive, ch); + return 'a' + ch; +#else + TChar systemDrive = 'c'; + RFs::DriveToChar(RFs::GetSystemDrive(), systemDrive); + return (char)(TUint)systemDrive; +#endif + } diff -r 8dc858aede52 -r 31c9a831b704 libraries/ltkutils/src/proxyallocatorhelper.cpp --- a/libraries/ltkutils/src/proxyallocatorhelper.cpp Sat Aug 28 00:14:27 2010 +0100 +++ b/libraries/ltkutils/src/proxyallocatorhelper.cpp Tue Sep 07 20:38:36 2010 +0100 @@ -31,12 +31,20 @@ #ifdef FSHELL_MEMORY_ACCESS_SUPPORT TUint8* allocatorAddress; TInt err = iMemoryAccess->GetAllocatorAddress(iThreadId, allocatorAddress); - if (!err) + if (err == KErrNone) { - iAllocatorAddress = (TLinAddr)allocatorAddress; - TInt udeb = EuserIsUdeb(); - if (udeb < 0) return udeb; // error - err = IdentifyAllocatorType(udeb); + if (allocatorAddress == NULL) + { + // If the thread has not yet been resumed it's valid for it not to have an allocator yet + err = KErrNotReady; + } + else + { + iAllocatorAddress = (TLinAddr)allocatorAddress; + TInt udeb = EuserIsUdeb(); + if (udeb < 0) return udeb; // error + err = IdentifyAllocatorType(udeb); + } } return err; #else diff -r 8dc858aede52 -r 31c9a831b704 plugins/consoles/common/BMARM/consoleextensions.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/consoles/common/BMARM/consoleextensions.def Tue Sep 07 20:38:36 2010 +0100 @@ -0,0 +1,10 @@ +EXPORTS + WriteStdErr__19MIosrvConsoleHelperRC7TDesC16 @ 1 NONAME R3UNUSED ; MIosrvConsoleHelper::WriteStdErr(TDesC16 const &) + Debug__C19MIosrvConsoleHelper @ 2 NONAME R3UNUSED ; MIosrvConsoleHelper::Debug(void) const + HandleConsoleCreationError__19MIosrvConsoleHelperRC7TDesC16i @ 3 NONAME R3UNUSED ; MIosrvConsoleHelper::HandleConsoleCreationError(TDesC16 const &, int) + MIosrvConsoleHelper_Extension__19MIosrvConsoleHelperUiRPvPv @ 4 NONAME ; MIosrvConsoleHelper::MIosrvConsoleHelper_Extension(unsigned int, void *&, void *) + Message__19MIosrvConsoleHelperQ219MIosrvConsoleHelper10TVerbosityGt11TRefByValue1ZC7TDesC16e @ 5 NONAME ; MIosrvConsoleHelper::Message(MIosrvConsoleHelper::TVerbosity, TRefByValue,...) + SetDebug__19MIosrvConsoleHelperi @ 6 NONAME R3UNUSED ; MIosrvConsoleHelper::SetDebug(int) + UnderlyingConsole__C19MIosrvConsoleHelper @ 7 NONAME R3UNUSED ; MIosrvConsoleHelper::UnderlyingConsole(void) const + CleanupUnderlyingConsole__19MIosrvConsoleHelper @ 8 NONAME R3UNUSED ; MIosrvConsoleHelper::CleanupUnderlyingConsole(void) + diff -r 8dc858aede52 -r 31c9a831b704 plugins/consoles/terminalkeyboardcons/terminalkeyboardcons.cpp --- a/plugins/consoles/terminalkeyboardcons/terminalkeyboardcons.cpp Sat Aug 28 00:14:27 2010 +0100 +++ b/plugins/consoles/terminalkeyboardcons/terminalkeyboardcons.cpp Tue Sep 07 20:38:36 2010 +0100 @@ -100,13 +100,14 @@ User::Leave(err); } - // Idiotic driver only accepts connections from processes with nokia vid - like that will stop us + // Annoying driver only accepts connections from processes with nokia vid - like that will stop us TUint originalVid = RProcess().VendorId(); RMemoryAccess memAccess; User::LeaveIfError(memAccess.Open()); TProcessProperties props; props.iVid = 0x101FB657; - RProcess me; me.Open(RProcess().Id()); + RProcess me; + User::LeaveIfError(me.Open(RProcess().Id())); memAccess.SetProcessProperties(me, props); err = iDriver.Open(); diff -r 8dc858aede52 -r 31c9a831b704 plugins/consoles/terminalkeyboardcons/terminalkeyboardcons.mmp --- a/plugins/consoles/terminalkeyboardcons/terminalkeyboardcons.mmp Sat Aug 28 00:14:27 2010 +0100 +++ b/plugins/consoles/terminalkeyboardcons/terminalkeyboardcons.mmp Tue Sep 07 20:38:36 2010 +0100 @@ -20,6 +20,7 @@ userinclude . userinclude ..\vt100cons\src\vt100 // For vtc_cursor_tracker.h #include +systeminclude \epoc32\include\internal // this is where the tracecore headers live, and the platform paths macros don't consistantly include it across different versions of the platform... source terminalkeyboardcons.cpp sourcepath ..\vt100cons\src\vt100 diff -r 8dc858aede52 -r 31c9a831b704 plugins/consoles/vt100cons/BMARM/vt100U.def --- a/plugins/consoles/vt100cons/BMARM/vt100U.def Sat Aug 28 00:14:27 2010 +0100 +++ b/plugins/consoles/vt100cons/BMARM/vt100U.def Tue Sep 07 20:38:36 2010 +0100 @@ -9,7 +9,7 @@ GetKeyPress__25CVtConsoleInputControllerR9TKeyPressR14TRequestStatus @ 8 NONAME R3UNUSED ; CVtConsoleInputController::GetKeyPress(TKeyPress &, TRequestStatus &) KeyCode__C15CVtcConsoleBase @ 9 NONAME R3UNUSED ; CVtcConsoleBase::KeyCode(void) const KeyModifiers__C15CVtcConsoleBase @ 10 NONAME R3UNUSED ; CVtcConsoleBase::KeyModifiers(void) const - Message__15CVtcConsoleBaseQ215CVtcConsoleBase10TVerbosityGt11TRefByValue1ZC7TDesC16e @ 11 NONAME ; CVtcConsoleBase::Message(CVtcConsoleBase::TVerbosity, TRefByValue,...) + Message__15CVtcConsoleBaseQ215CVtcConsoleBase10TVerbosityGt11TRefByValue1ZC7TDesC16e @ 11 NONAME ABSENT ; CVtcConsoleBase::Message(CVtcConsoleBase::TVerbosity, TRefByValue,...) NewLC__25CVtConsoleInputControllerR13MConsoleInputRQ28LtkUtils8CIniFile @ 12 NONAME R3UNUSED ; CVtConsoleInputController::NewLC(MConsoleInput &, LtkUtils::CIniFile &) NewL__25CVtConsoleInputControllerR13MConsoleInputRQ28LtkUtils8CIniFile @ 13 NONAME R3UNUSED ; CVtConsoleInputController::NewL(MConsoleInput &, LtkUtils::CIniFile &) NewL__26CVtConsoleOutputControllerR14MConsoleOutputRQ28LtkUtils8CIniFileRC5TSize @ 14 NONAME R3UNUSED ; CVtConsoleOutputController::NewL(MConsoleOutput &, LtkUtils::CIniFile &, TSize const &) @@ -31,7 +31,8 @@ __15CVtcConsoleBase @ 30 NONAME R3UNUSED ; CVtcConsoleBase::CVtcConsoleBase(void) __9TKeyPress @ 31 NONAME R3UNUSED ; TKeyPress::TKeyPress(void) CancelGetKeyPress__25CVtConsoleInputController @ 32 NONAME R3UNUSED ; CVtConsoleInputController::CancelGetKeyPress(void) - Debug__15CVtcConsoleBase @ 33 NONAME R3UNUSED ; CVtcConsoleBase::Debug(void) - SetDebug__15CVtcConsoleBasei @ 34 NONAME R3UNUSED ; CVtcConsoleBase::SetDebug(int) + Debug__15CVtcConsoleBase @ 33 NONAME R3UNUSED ABSENT ; CVtcConsoleBase::Debug(void) + SetDebug__15CVtcConsoleBasei @ 34 NONAME R3UNUSED ABSENT ; CVtcConsoleBase::SetDebug(int) ReadKeywordValuePair__15CVtcConsoleBaseR6TLex16R7TPtrC16T2 @ 35 NONAME R3UNUSED ; CVtcConsoleBase::ReadKeywordValuePair(TLex16 &, TPtrC16 &, TPtrC16 &) + ConstructL__15CVtcConsoleBaseRC7TDesC16i @ 36 NONAME R3UNUSED ; CVtcConsoleBase::ConstructL(TDesC16 const &, int)