barebox/lib/bootstrap/common.c
Jean-Christophe PLAGNIOL-VILLARD df132b9d78 introduce common bootstrap code
This will allow to have a generic code to create different bootstrap

As example
Barebox as TI Xloader
Barebox as AT91 Bootstrap

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-01-22 22:03:44 +01:00

25 lines
399 B
C

/*
* Copyright (C) 2011 Sascha Hauer, Pengutronix
* Copyright (C) 2012 Jean-Christophe PLAGNIOL-VILLARD <plagnio@jcrosoft.com>
*
* Under GPLv2
*/
#include <common.h>
#include <bootstrap.h>
#include <filetype.h>
void bootstrap_boot(int (*func)(void), bool barebox)
{
if (!func)
return;
if (barebox && !is_barebox_head((void*)func))
return;
shutdown_barebox();
func();
while (1);
}