From 8b281334a0bf4bce28d0f877cf0bbddd41ac25ea Mon Sep 17 00:00:00 2001 From: Richard Henderson Date: Sat, 26 Nov 2011 15:57:37 -0800 Subject: m68k-linux: Implement atomic operations via syscall. libgcc/ * config/m68k/linux.h (TARGET_INIT_LIBFUNCS): New. * config/m68k/m68k.c (m68k_init_sync_libfuncs): New. gcc/ * config/m68k/linux-atomic.c: New file. * config/m68k/t-linux: New file. * config.host (m68k-uclinux, m68k-linux): Use it. From-SVN: r181746 --- gcc/config/m68k/linux.h | 4 ++++ gcc/config/m68k/m68k.c | 8 ++++++++ 2 files changed, 12 insertions(+) (limited to 'gcc/config/m68k') diff --git a/gcc/config/m68k/linux.h b/gcc/config/m68k/linux.h index 70738d2..325faf7 100644 --- a/gcc/config/m68k/linux.h +++ b/gcc/config/m68k/linux.h @@ -235,3 +235,7 @@ along with GCC; see the file COPYING3. If not see #undef WCHAR_TYPE_SIZE #define WCHAR_TYPE_SIZE BITS_PER_WORD + +/* Install the __sync libcalls. */ +#undef TARGET_INIT_LIBFUNCS +#define TARGET_INIT_LIBFUNCS m68k_init_sync_libfuncs diff --git a/gcc/config/m68k/m68k.c b/gcc/config/m68k/m68k.c index 51a04ed..61267a8 100644 --- a/gcc/config/m68k/m68k.c +++ b/gcc/config/m68k/m68k.c @@ -47,6 +47,7 @@ along with GCC; see the file COPYING3. If not see #include "insn-codes.h" #include "ggc.h" #include "opts.h" +#include "optabs.h" enum reg_class regno_reg_class[] = { @@ -164,6 +165,7 @@ static rtx m68k_function_arg (cumulative_args_t, enum machine_mode, const_tree, bool); static bool m68k_cannot_force_const_mem (enum machine_mode mode, rtx x); static bool m68k_output_addr_const_extra (FILE *, rtx); +static void m68k_init_sync_libfuncs (void) ATTRIBUTE_UNUSED; /* Initialize the GCC target structure. */ @@ -6524,4 +6526,10 @@ m68k_conditional_register_usage (void) fixed_regs[PIC_REG] = call_used_regs[PIC_REG] = 1; } +static void +m68k_init_sync_libfuncs (void) +{ + init_sync_libfuncs (UNITS_PER_WORD); +} + #include "gt-m68k.h" -- cgit v1.1