summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2023-05-20 11:47:48 +0200
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2023-05-20 11:47:48 +0200
commitaa6b7afb4110c6b764a0972f11f13c4df512631a (patch)
treeff807c2414fdcc5b1c461a048d67012731039326
parenta1e661afe96997997be16b97dbafbf250c5f4d16 (diff)
libdde_linux26: Add infrastructure to build on 64bit
-rw-r--r--libdde_linux26/Makeconf4
-rw-r--r--libdde_linux26/Makeconf.local2
-rw-r--r--libdde_linux26/contrib/include/linux/autoconf.h6
-rw-r--r--libdde_linux26/include/Makefile8
-rw-r--r--libdde_linux26/lib/src/Makefile12
-rw-r--r--libdde_linux26/lib/src_ip/Makefile4
-rw-r--r--libdde_linux26/mk/Makeconf2
-rw-r--r--libdde_linux26/mk/prog.mk4
8 files changed, 31 insertions, 11 deletions
diff --git a/libdde_linux26/Makeconf b/libdde_linux26/Makeconf
index 00c590929..d233ec5df 100644
--- a/libdde_linux26/Makeconf
+++ b/libdde_linux26/Makeconf
@@ -5,7 +5,7 @@ KBUILD_DEFINES = -D"KBUILD_STR(s)=\#s" \
# for some reasons, Linux 2.6 does not include autoconf.h in the implementation
# files but does so on the command line
-ifeq ($(ARCH), x86)
+ifneq (,$(filter $(ARCH),x86 amd64))
KBUILD_CPPFLAGS = -include linux/autoconf.h
endif
@@ -35,7 +35,7 @@ MODE_USE_C = y
L4_MULTITHREADED = y
# arch-specific stuff
-ifeq ($(ARCH), x86)
+ifneq (,$(filter $(ARCH),x86 amd64))
MY_DDE_INCDIR += $(OBJ_BASE)/include/linux-headers/asm/mach-default
endif
diff --git a/libdde_linux26/Makeconf.local b/libdde_linux26/Makeconf.local
index 589c18242..51976dae8 100644
--- a/libdde_linux26/Makeconf.local
+++ b/libdde_linux26/Makeconf.local
@@ -5,7 +5,7 @@ CONFIG_DDE26_BLOCK := y
CONFIG_DDE26_CHAR :=y
SYSTEMS = x86-l4v2
-ARCH = x86
+ARCH ?= x86
SYSTEM = x86-l4v2
OBJ_BASE = $(PKGDIR)/build
diff --git a/libdde_linux26/contrib/include/linux/autoconf.h b/libdde_linux26/contrib/include/linux/autoconf.h
index a0464b300..6b4ac2d63 100644
--- a/libdde_linux26/contrib/include/linux/autoconf.h
+++ b/libdde_linux26/contrib/include/linux/autoconf.h
@@ -467,7 +467,13 @@
#define CONFIG_TMPFS 1
#define CONFIG_QUOTA 1
#define CONFIG_ASK_IP_FIB_HASH 1
+#ifdef __x86_64__
+#define CONFIG_X86_64 1
+#define CONFIG_64BIT 1
+#else
#define CONFIG_X86_32 1
+#else
+#endif
#define CONFIG_PCI_MMCONFIG 1
#define CONFIG_SCHED_HRTICK 1
#define CONFIG_GENERIC_TIME 1
diff --git a/libdde_linux26/include/Makefile b/libdde_linux26/include/Makefile
index 2ac8b9497..04aacfda5 100644
--- a/libdde_linux26/include/Makefile
+++ b/libdde_linux26/include/Makefile
@@ -10,7 +10,7 @@ include $(L4DIR)/mk/Makeconf
include $(L4DIR)/mk/include.mk
#ifeq ($(CONFIG_DDE26),y)
-ifneq ($(BUILD_ARCH),amd64)
+#ifneq ($(BUILD_ARCH),amd64)
SUFFIX_amd64 = x86_64
SUFFIX_x86 = x86
SUFFIX_arm = arm
@@ -18,8 +18,8 @@ SUFFIX_arm = arm
# macro to establish a symlink to a dir if not already existing
MAKELINK = if [ ! $1 -ef $2 ] ; then ln -sf $3 $2 ; fi
-BUILD_ARCH = x86
-ARCH = $(BUILD_ARCH)
+#BUILD_ARCH = x86
+#ARCH = $(BUILD_ARCH)
all::
$(VERBOSE)$(call MAKELINK, \
@@ -30,5 +30,5 @@ install::
$(VERBOSE)$(call MAKELINK, \
$(INSTALLDIR)/$(ARCH)/$(INSTALL_INC_PREFIX)/asm-$(SUFFIX_$(ARCH)),\
$(INSTALLDIR)/$(ARCH)/$(INSTALL_INC_PREFIX)/asm, asm-$(SUFFIX_$(ARCH)))
-endif
+#endif
#endif
diff --git a/libdde_linux26/lib/src/Makefile b/libdde_linux26/lib/src/Makefile
index abcc533e7..673d8bda8 100644
--- a/libdde_linux26/lib/src/Makefile
+++ b/libdde_linux26/lib/src/Makefile
@@ -27,7 +27,7 @@ ifeq ($(CONFIG_DDE26_CHAR),y)
TARGET += libdde_linux26_char.a
endif
-ifeq ($(ARCH), x86)
+ifneq (,$(filter $(ARCH),x86 amd64))
ARCH_DIR = arch/x86
endif
@@ -66,6 +66,16 @@ SRC_C_libdde_linux26.o.a += $(ARCH_DIR)/kernel/setup.c
SRC_S_libdde_linux26_net.a += $(ARCH_DIR)/lib/checksum_32.S
endif
+ifeq ($(ARCH), amd64)
+SRC_S_libdde_linux26.o.a += $(ARCH_DIR)/lib/semaphore_64.S
+SRC_S_libdde_linux26.o.a += $(ARCH_DIR)/lib/delay.o
+SRC_C_libdde_linux26.o.a += lib/rwsem.c
+SRC_C_libdde_linux26.o.a += $(ARCH_DIR)/kernel/pci-dma.c
+SRC_C_libdde_linux26.o.a += $(ARCH_DIR)/kernel/pci-nommu.c
+SRC_C_libdde_linux26.o.a += $(ARCH_DIR)/kernel/setup.c
+SRC_C_libdde_linux26_net.a += $(ARCH_DIR)/lib/checksum.c
+endif
+
ifeq ($(ARCH), arm)
SRC_S_libdde_linux26.o.a += $(ARCH_DIR)/lib/changebit.S
SRC_S_libdde_linux26.o.a += $(ARCH_DIR)/lib/clearbit.S
diff --git a/libdde_linux26/lib/src_ip/Makefile b/libdde_linux26/lib/src_ip/Makefile
index 9665ff9b2..5a9325d3b 100644
--- a/libdde_linux26/lib/src_ip/Makefile
+++ b/libdde_linux26/lib/src_ip/Makefile
@@ -10,7 +10,7 @@ endif
SYSTEMS = x86-l4v2
-ifeq ($(ARCH), x86)
+ifneq (,$(filter $(ARCH),x86 amd64))
ARCH_DIR = arch/i386
endif
@@ -22,7 +22,7 @@ PRIVATE_INCDIR += $(CONTRIB)/drivers/pci $(PKGDIR)/linux26/lib/src/arch/l4 \
$(CONTRIB)/$(ARCH_DIR)/pci $(CONTRIB)/drivers/base/ \
$(CONTRIB)/lib $(PKGDIR_OBJ) $(CONTRIB)/net/core
-ifeq ($(ARCH), x86)
+ifneq (,$(filter $(ARCH),x86 amd64))
SRC_S_libdde_linux26_net_ip.a += $(ARCH_DIR)/lib/checksum.S
endif
diff --git a/libdde_linux26/mk/Makeconf b/libdde_linux26/mk/Makeconf
index fa6474ae3..7bb0b828d 100644
--- a/libdde_linux26/mk/Makeconf
+++ b/libdde_linux26/mk/Makeconf
@@ -32,7 +32,7 @@ ifeq ($(origin _L4DIR_MK_MAKECONF),undefined)
_L4DIR_MK_MAKECONF=y
SYSTEMS = x86-l4v2
-ARCH = x86
+ARCH ?= x86
# the default target is all
all::
diff --git a/libdde_linux26/mk/prog.mk b/libdde_linux26/mk/prog.mk
index c1d5d9a86..e1c060797 100644
--- a/libdde_linux26/mk/prog.mk
+++ b/libdde_linux26/mk/prog.mk
@@ -79,7 +79,11 @@ endif
LDFLAGS += -Wl,-gc-sections
#endif
#endif
+ifeq ($(ARCH), x86)
LDFLAGS += -Wl,-Tdefault.ld
+else
+LDFLAGS += -Wl,-Tdefault-64.ld
+endif
#include $(L4DIR)/mk/install.inc