From 328029e178152c8eceebd40d14ff80ccf2039970 Mon Sep 17 00:00:00 2001 From: Ingo Weinhold Date: Mon, 30 Mar 2009 15:00:10 +0000 Subject: [PATCH] Patch by Alexander von Gluck (kallisti5) to get the PPC build going again (mostly at least). Also disables -Werror for the binutils, but those should be fixed eventually. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29804 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- build/scripts/build_cross_tools_gcc4 | 2 +- headers/private/kernel/arch/ppc/arch_thread.h | 4 ++-- headers/private/kernel/arch/thread.h | 8 -------- src/bin/bemail_utils/spamdbm.cpp | 11 ----------- src/system/kernel/arch/ppc/arch_cpu.cpp | 4 ++-- src/system/kernel/arch/ppc/arch_int.cpp | 2 +- src/system/kernel/arch/ppc/arch_thread.c | 5 ----- 7 files changed, 6 insertions(+), 30 deletions(-) diff --git a/build/scripts/build_cross_tools_gcc4 b/build/scripts/build_cross_tools_gcc4 index 5d8f5434ef..aa1e6b380a 100755 --- a/build/scripts/build_cross_tools_gcc4 +++ b/build/scripts/build_cross_tools_gcc4 @@ -89,7 +89,7 @@ mkdir -p $installDir/lib/gcc/$haikuMachine/$gccVersion cd $binutilsObjDir CFLAGS="-O2" CXXFLAGS="-O2" $binutilsSourceDir/configure \ --prefix=$installDir --target=$haikuMachine --disable-nls \ - --disable-shared --disable-multilib || exit 1 + --disable-shared --disable-multilib --disable-werror || exit 1 $MAKE || exit 1 $MAKE install || exit 1 diff --git a/headers/private/kernel/arch/ppc/arch_thread.h b/headers/private/kernel/arch/ppc/arch_thread.h index b9e1cbdacb..93fc550be6 100644 --- a/headers/private/kernel/arch/ppc/arch_thread.h +++ b/headers/private/kernel/arch/ppc/arch_thread.h @@ -20,7 +20,7 @@ void ppc_pop_iframe(struct iframe_stack *stack); struct iframe *ppc_get_user_iframe(void); -extern inline struct thread * +static inline struct thread * arch_thread_get_current_thread(void) { struct thread *t; @@ -29,7 +29,7 @@ arch_thread_get_current_thread(void) } -extern inline void +static inline void arch_thread_set_current_thread(struct thread *t) { asm volatile("mtsprg2 %0" : : "r"(t)); diff --git a/headers/private/kernel/arch/thread.h b/headers/private/kernel/arch/thread.h index ecb6358d25..012411fe7c 100644 --- a/headers/private/kernel/arch/thread.h +++ b/headers/private/kernel/arch/thread.h @@ -29,14 +29,6 @@ status_t arch_thread_enter_userspace(struct thread *t, addr_t entry, void arch_thread_switch_kstack_and_call(struct thread *t, addr_t new_kstack, void (*func)(void *), void *arg); -// ToDo: doing this this way is an ugly hack - please fix me! -// (those functions are "static inline" for x86 - since -// "extern inline" doesn't work for "gcc -g"...) -#ifndef ARCH_x86 -struct thread *arch_thread_get_current_thread(void); -void arch_thread_set_current_thread(struct thread *t); -#endif - bool arch_on_signal_stack(struct thread *thread); status_t arch_setup_signal_frame(struct thread *t, struct sigaction *sa, int signal, int signalMask); diff --git a/src/bin/bemail_utils/spamdbm.cpp b/src/bin/bemail_utils/spamdbm.cpp index 3d9a63a943..01a35085d0 100644 --- a/src/bin/bemail_utils/spamdbm.cpp +++ b/src/bin/bemail_utils/spamdbm.cpp @@ -471,17 +471,6 @@ #include #include -#if __POWERPC__ /* atoll is missing from the PowerPC standard library. */ -static long long atoll (const char *str) { - long long result = 0; - if (!str || !str[0]) - return 0; - if (sscanf (str, "%Ld", &result) != 1) - result = 0; - return result; -} -#endif - /* Standard C++ library. */ #include diff --git a/src/system/kernel/arch/ppc/arch_cpu.cpp b/src/system/kernel/arch/ppc/arch_cpu.cpp index eb4182b5c7..e4d5299f19 100644 --- a/src/system/kernel/arch/ppc/arch_cpu.cpp +++ b/src/system/kernel/arch/ppc/arch_cpu.cpp @@ -85,7 +85,7 @@ arch_cpu_sync_icache(void *address, size_t len) void arch_cpu_memory_read_barrier(void) { -#warning PPC: is it model-dependant ? +// WARNING PPC: is it model-dependant ? asm volatile ("lwsync"); } @@ -93,7 +93,7 @@ arch_cpu_memory_read_barrier(void) void arch_cpu_memory_write_barrier(void) { -#warning PPC: is it model-dependant ? +// WARNING PPC: is it model-dependant ? asm volatile ("isync"); asm volatile ("eieio"); } diff --git a/src/system/kernel/arch/ppc/arch_int.cpp b/src/system/kernel/arch/ppc/arch_int.cpp index 89a08c6b3c..710bfc08dd 100644 --- a/src/system/kernel/arch/ppc/arch_int.cpp +++ b/src/system/kernel/arch/ppc/arch_int.cpp @@ -126,7 +126,7 @@ ppc_exception_entry(int vector, struct iframe *iframe) if (kernelDebugger) { // if this thread has a fault handler, we're allowed to be here struct thread *thread = thread_get_current_thread(); - if (thread && thread->fault_handler != NULL) { + if (thread && thread->fault_handler != 0) { iframe->srr0 = thread->fault_handler; break; } diff --git a/src/system/kernel/arch/ppc/arch_thread.c b/src/system/kernel/arch/ppc/arch_thread.c index 3e63ecbc87..561d04c8f8 100644 --- a/src/system/kernel/arch/ppc/arch_thread.c +++ b/src/system/kernel/arch/ppc/arch_thread.c @@ -235,11 +235,6 @@ arch_restore_signal_frame(void) } -void -arch_check_syscall_restart(struct thread *thread) -{ -} - /** Saves everything needed to restore the frame in the child fork in the * arch_fork_arg structure to be passed to arch_restore_fork_frame().