From 386671b4d0397c0d2778832f96a1eff7c7c924d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Revol?= Date: Thu, 17 May 2012 19:08:19 +0200 Subject: [PATCH] U-Boot: Guard ARM-specific stuff * those must be cleaned up and moved away * allows building U-Boot loader for ppc --- src/system/boot/platform/u-boot/mmu.cpp | 15 +++++++++++++++ src/system/boot/platform/u-boot/video.cpp | 13 ++++++++++--- 2 files changed, 25 insertions(+), 3 deletions(-) diff --git a/src/system/boot/platform/u-boot/mmu.cpp b/src/system/boot/platform/u-boot/mmu.cpp index 15e5193ef4..96afc2d827 100644 --- a/src/system/boot/platform/u-boot/mmu.cpp +++ b/src/system/boot/platform/u-boot/mmu.cpp @@ -14,7 +14,9 @@ #include #include #include +#ifdef __ARM__ #include +#endif #include #include @@ -37,6 +39,7 @@ // You also need to define ENABLE_SERIAL in serial.cpp // for output to work. +#ifdef __ARM__ /* TODO: @@ -620,6 +623,8 @@ mmu_init(void) gKernelArgs.cpu_kstack[0].start + gKernelArgs.cpu_kstack[0].size)); } +#endif + // #pragma mark - @@ -628,19 +633,25 @@ extern "C" status_t platform_allocate_region(void **_address, size_t size, uint8 protection, bool /*exactAddress*/) { +#ifdef __ARM__ void *address = mmu_allocate(*_address, size); if (address == NULL) return B_NO_MEMORY; *_address = address; return B_OK; +#else + return B_ERROR; +#endif } extern "C" status_t platform_free_region(void *address, size_t size) { +#ifdef __ARM__ mmu_free(address, size); +#endif return B_OK; } @@ -657,6 +668,7 @@ platform_release_heap(struct stage2_args *args, void *base) status_t platform_init_heap(struct stage2_args *args, void **_base, void **_top) { +#ifdef __ARM__ void *heap = (void *)get_next_physical_address(args->heap_size); if (heap == NULL) return B_NO_MEMORY; @@ -664,4 +676,7 @@ platform_init_heap(struct stage2_args *args, void **_base, void **_top) *_base = heap; *_top = (void *)((int8 *)heap + args->heap_size); return B_OK; +#else + return B_ERROR; +#endif } diff --git a/src/system/boot/platform/u-boot/video.cpp b/src/system/boot/platform/u-boot/video.cpp index 4db887db3f..4d775e490e 100644 --- a/src/system/boot/platform/u-boot/video.cpp +++ b/src/system/boot/platform/u-boot/video.cpp @@ -5,7 +5,10 @@ #include "video.h" +//XXX +#ifdef __ARM__ #include "arch_video.h" +#endif #include #include @@ -92,14 +95,16 @@ platform_switch_to_logo(void) status_t err; +#ifdef __ARM__ err = arch_set_default_video_mode(); dprintf("set video mode: 0x%08x\n", err); if (err < B_OK) return; +#endif err = video_display_splash((addr_t)gFrameBufferBase); dprintf("video_display_splash: 0x%08x\n", err); - #warning ARM:TODO + #warning U-Boot:TODO } @@ -107,7 +112,7 @@ extern "C" void platform_switch_to_text_mode(void) { TRACE(("%s()\n", __FUNCTION__)); - #warning ARM:TODO + #warning U-Boot:TODO } @@ -115,8 +120,10 @@ extern "C" status_t platform_init_video(void) { TRACE(("%s()\n", __FUNCTION__)); - #warning ARM:TODO + #warning U-Boot:TODO +#ifdef __ARM__ arch_probe_video_mode(); +#endif //XXX for testing //platform_switch_to_logo(); //return arch_probe_video_mode();