From eaad49bab7bde02b6333d6e88b3d9286e6bd9e0d Mon Sep 17 00:00:00 2001 From: Alexander von Gluck IV Date: Tue, 8 May 2012 22:53:30 -0500 Subject: [PATCH] rpi: Restore ctors and bss functions * Fixes pre-mmu new and malloc's * Use nothrow for new --- src/system/boot/platform/raspberrypi_arm/serial.cpp | 4 +++- src/system/boot/platform/raspberrypi_arm/start.c | 11 ----------- 2 files changed, 3 insertions(+), 12 deletions(-) diff --git a/src/system/boot/platform/raspberrypi_arm/serial.cpp b/src/system/boot/platform/raspberrypi_arm/serial.cpp index 1fb320d12e..29995d02bc 100644 --- a/src/system/boot/platform/raspberrypi_arm/serial.cpp +++ b/src/system/boot/platform/raspberrypi_arm/serial.cpp @@ -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(); diff --git a/src/system/boot/platform/raspberrypi_arm/start.c b/src/system/boot/platform/raspberrypi_arm/start.c index f4db435c4a..258744af14 100644 --- a/src/system/boot/platform/raspberrypi_arm/start.c +++ b/src/system/boot/platform/raspberrypi_arm/start.c @@ -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();