rpi: Restore ctors and bss functions

* Fixes pre-mmu new and malloc's
* Use nothrow for new
This commit is contained in:
Alexander von Gluck IV
2012-05-08 22:53:30 -05:00
parent 78004f1677
commit eaad49bab7
2 changed files with 3 additions and 12 deletions
@@ -80,7 +80,9 @@ serial_cleanup(void)
extern "C" void
serial_init(void)
{
gUART = new UartPL011(uart_base_debug());
gUART = new(nothrow) UartPL011(uart_base_debug());
if (gUART == 0)
return;
gUART->InitEarly();
gUART->Init();
@@ -37,28 +37,18 @@ void _start(void);
static void
clear_bss(void)
{
/* TODO: fix boot_loader_routerboard_mipsel.ld
* so this code works, or find a workaround.
*/
/*
memset(&__bss_start, 0, &_end - &__bss_start);
*/
}
static void
call_ctors(void)
{
/* TODO: fix boot_loader_routerboard_mipsel.ld
* so this code works, or find a workaround.
*/
/*
void (**f)(void);
for (f = &__ctor_list; f < &__ctor_end; f++) {
(**f)();
}
*/
}
@@ -98,7 +88,6 @@ platform_exit(void)
void
pi_start(void)
{
#warning IMPLEMENT _start
stage2_args args;
clear_bss();