Commit c38b7327 authored by Maria Matejka's avatar Maria Matejka
Browse files

Architecture detection. This is needed for proper functioning of spinlocks.

parent 3c1d7ff3
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -153,6 +153,10 @@ prepare: $(objdir)/sysdep/paths.h | $(objdir)/.dir-stamp
$(objdir)/.dir-stamp: Makefile
	$(E)echo MKDIR -p $(addprefix $(objdir)/,$(dirs) doc)
	$(Q)mkdir -p $(addprefix $(objdir)/,$(dirs) doc)
	$(E)echo RM -f $(objdir)/sysdep/arch
	$(Q)rm -f $(objdir)/sysdep/arch
	$(E)echo LN -s $(srcdir)/sysdep/@bird_target_cpu@ $(objdir)/sysdep/arch
	$(Q)ln -s $$(readlink -f $(srcdir)/sysdep/@bird_target_cpu@) $(objdir)/sysdep/arch
	$(Q)touch $@

$(client) $(daemon):
+11 −0
Original line number Diff line number Diff line
@@ -103,6 +103,16 @@ AC_SEARCH_LIBS([clock_gettime], [rt posix4],
)

AC_CANONICAL_HOST
AC_CANONICAL_TARGET

if test -d "sysdep/$target_cpu" ; then
  bird_target_cpu="$target_cpu"
else
  AC_MSG_NOTICE([Target CPU not known, disabling architecture tweaks: $target_cpu])
  bird_target_cpu=generic-arch
fi

AC_SUBST([bird_target_cpu])

# Store this value because ac_test_CFLAGS is overwritten by AC_PROG_CC
if test "$ac_test_CFLAGS" != set ; then
@@ -457,6 +467,7 @@ AC_OUTPUT

AC_MSG_RESULT()
AC_MSG_RESULT([BIRD was configured with the following options:])
AC_MSG_RESULT([        Target CPU:		$target_cpu])
AC_MSG_RESULT([        Source directory:	$srcdir])
AC_MSG_RESULT([        Object directory:	$objdir])
AC_MSG_RESULT([        Iproute2 directory:	$iproutedir])
+1 −0
Original line number Diff line number Diff line
@@ -47,6 +47,7 @@ static inline int uint_cmp(uint i1, uint i2)
static inline int u64_cmp(u64 i1, u64 i2)
{ return (int)(i1 > i2) - (int)(i1 < i2); }

#define TARGET_ARCH_INCLUDE_PATH(file) "sysdep/" TARGET_CPU file

/* Bitfield macros */

+14 −0
Original line number Diff line number Diff line
/*
 *	BIRD -- calls for other architectures
 *
 *	(c) 2019 Maria Matejka <mq@ucw.cz>
 *
 *	Can be freely distributed and used under the terms of the GNU GPL.
 */

#ifndef _BIRD_ASM_H_
#define _BIRD_ASM_H_

#define CPU_RELAX()  __asm__ __volatile__ ("" : : : "memory")

#endif

sysdep/x86/asm.h

0 → 100644
+14 −0
Original line number Diff line number Diff line
/*
 *	BIRD -- x86-specific calls
 *
 *	(c) 2019 Maria Matejka <mq@ucw.cz>
 *
 *	Can be freely distributed and used under the terms of the GNU GPL.
 */

#ifndef _BIRD_ASM_H_
#define _BIRD_ASM_H_

#define CPU_RELAX()  __asm__ __volatile__ ("rep; nop" : : : "memory")

#endif
Loading