1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/kernelhwsrv/brdbootldr/ubootldr/restart.cpp Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,55 @@
1.4 +// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
1.5 +// All rights reserved.
1.6 +// This component and the accompanying materials are made available
1.7 +// under the terms of the License "Eclipse Public License v1.0"
1.8 +// which accompanies this distribution, and is available
1.9 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
1.10 +//
1.11 +// Initial Contributors:
1.12 +// Nokia Corporation - initial contribution.
1.13 +//
1.14 +// Contributors:
1.15 +//
1.16 +// Description:
1.17 +// restart the board via an appropriate method either back into the bootloader
1.18 +// or to boot an image
1.19 +//
1.20 +//
1.21 +
1.22 +/**
1.23 + @file
1.24 +*/
1.25 +
1.26 +#include <e32const.h>
1.27 +#include <e32const_private.h>
1.28 +#include <e32std.h>
1.29 +#include <e32std_private.h>
1.30 +#include <e32svr.h>
1.31 +#include <e32cons.h>
1.32 +#include <f32file.h>
1.33 +#include <hal.h>
1.34 +#include <u32hal.h>
1.35 +#include "bootloader_variantconfig.h"
1.36 +#include <nkern/nk_trace.h>
1.37 +#include <e32twin.h>
1.38 +
1.39 +#define FILE_ID 0x594D555D
1.40 +#include "bootldr.h"
1.41 +#include "ubootldrldd.h"
1.42 +
1.43 +GLDEF_C void Restart(TInt aCode)
1.44 + {
1.45 + TInt r = User::LoadLogicalDevice(KBootldrLddName);
1.46 +
1.47 + RUBootldrLdd Ldd;
1.48 + r = Ldd.Open();
1.49 + if (r!=KErrNone)
1.50 + {
1.51 + PrintToScreen(_L("FAULT due to LDD open\r\n"));
1.52 + BOOT_FAULT();
1.53 + }
1.54 + if (aCode)
1.55 + Ldd.Reboot(aCode);
1.56 +
1.57 + Ldd.Reboot(KtRestartReasonHardRestart);
1.58 + }