brdbootldr/ubootldr/restart.cpp
changeset 43 96e5fb8b040d
equal deleted inserted replaced
-1:000000000000 43:96e5fb8b040d
       
     1 // Copyright (c) 2005-2009 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 // restart the board via an appropriate method either back into the bootloader
       
    15 // or to boot an image
       
    16 // 
       
    17 //
       
    18 
       
    19 /**
       
    20  @file
       
    21 */
       
    22 
       
    23 #include <e32const.h>
       
    24 #include <e32const_private.h>
       
    25 #include <e32std.h>
       
    26 #include <e32std_private.h>
       
    27 #include <e32svr.h>
       
    28 #include <e32cons.h>
       
    29 #include <f32file.h>
       
    30 #include <hal.h>
       
    31 #include <u32hal.h>
       
    32 #include "bootloader_variantconfig.h"
       
    33 #include <nkern/nk_trace.h>
       
    34 #include <e32twin.h>
       
    35 
       
    36 #define FILE_ID	0x594D555D
       
    37 #include "bootldr.h"
       
    38 #include "ubootldrldd.h"
       
    39 
       
    40 GLDEF_C void Restart(TInt aCode)
       
    41 	{
       
    42 	TInt r = User::LoadLogicalDevice(KBootldrLddName);
       
    43 
       
    44 	RUBootldrLdd Ldd;
       
    45 	r = Ldd.Open();
       
    46 	if (r!=KErrNone)
       
    47 			{
       
    48 			PrintToScreen(_L("FAULT due to LDD open\r\n"));
       
    49 			BOOT_FAULT();
       
    50 			}
       
    51 	if (aCode)
       
    52 		Ldd.Reboot(aCode);
       
    53 
       
    54 	Ldd.Reboot(KtRestartReasonHardRestart);
       
    55 	}