os/kernelhwsrv/brdbootldr/ubootldr/restart.cpp
author sl@SLION-WIN7.fritz.box
Fri, 15 Jun 2012 03:10:57 +0200
changeset 0 bde4ae8d615e
permissions -rw-r--r--
First public contribution.
sl@0
     1
// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
sl@0
     2
// All rights reserved.
sl@0
     3
// This component and the accompanying materials are made available
sl@0
     4
// under the terms of the License "Eclipse Public License v1.0"
sl@0
     5
// which accompanies this distribution, and is available
sl@0
     6
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
sl@0
     7
//
sl@0
     8
// Initial Contributors:
sl@0
     9
// Nokia Corporation - initial contribution.
sl@0
    10
//
sl@0
    11
// Contributors:
sl@0
    12
//
sl@0
    13
// Description:
sl@0
    14
// restart the board via an appropriate method either back into the bootloader
sl@0
    15
// or to boot an image
sl@0
    16
// 
sl@0
    17
//
sl@0
    18
sl@0
    19
/**
sl@0
    20
 @file
sl@0
    21
*/
sl@0
    22
sl@0
    23
#include <e32const.h>
sl@0
    24
#include <e32const_private.h>
sl@0
    25
#include <e32std.h>
sl@0
    26
#include <e32std_private.h>
sl@0
    27
#include <e32svr.h>
sl@0
    28
#include <e32cons.h>
sl@0
    29
#include <f32file.h>
sl@0
    30
#include <hal.h>
sl@0
    31
#include <u32hal.h>
sl@0
    32
#include "bootloader_variantconfig.h"
sl@0
    33
#include <nkern/nk_trace.h>
sl@0
    34
#include <e32twin.h>
sl@0
    35
sl@0
    36
#define FILE_ID	0x594D555D
sl@0
    37
#include "bootldr.h"
sl@0
    38
#include "ubootldrldd.h"
sl@0
    39
sl@0
    40
GLDEF_C void Restart(TInt aCode)
sl@0
    41
	{
sl@0
    42
	TInt r = User::LoadLogicalDevice(KBootldrLddName);
sl@0
    43
sl@0
    44
	RUBootldrLdd Ldd;
sl@0
    45
	r = Ldd.Open();
sl@0
    46
	if (r!=KErrNone)
sl@0
    47
			{
sl@0
    48
			PrintToScreen(_L("FAULT due to LDD open\r\n"));
sl@0
    49
			BOOT_FAULT();
sl@0
    50
			}
sl@0
    51
	if (aCode)
sl@0
    52
		Ldd.Reboot(aCode);
sl@0
    53
sl@0
    54
	Ldd.Reboot(KtRestartReasonHardRestart);
sl@0
    55
	}