diff --git a/Makefile.am b/Makefile.am index 9827e06..862c82d 100644 --- a/Makefile.am +++ b/Makefile.am @@ -25,6 +25,10 @@ if ARCH_X86 libkernaux_a_SOURCES += src/arch/x86.S endif +if ARCH_X86_64 +libkernaux_a_SOURCES += src/arch/x86_64.S +endif + if ENABLE_CMDLINE libkernaux_a_SOURCES += src/cmdline.c TESTS += \ diff --git a/configure.ac b/configure.ac index 47e5d7d..ee69f38 100644 --- a/configure.ac +++ b/configure.ac @@ -16,12 +16,14 @@ AC_ARG_ENABLE([multiboot2], AS_HELP_STRING([--disable-multiboot2], [disable Mult AC_ARG_ENABLE([pfa], AS_HELP_STRING([--disable-pfa], [disable Page Frame Allocator])) AM_CONDITIONAL([ARCH_X86], [test "$host_cpu" = x86]) +AM_CONDITIONAL([ARCH_X86_64], [test "$host_cpu" = x86_64]) AM_CONDITIONAL([ENABLE_CMDLINE], [test "$enable_cmdline" != no]) AM_CONDITIONAL([ENABLE_CONSOLE], [test "$enable_console" != no]) AM_CONDITIONAL([ENABLE_MULTIBOOT2], [test "$enable_multiboot2" != no]) AM_CONDITIONAL([ENABLE_PFA], [test "$enable_pfa" != no]) AS_IF([test "$host_cpu" = x86], [AC_DEFINE([ARCH_X86], [1], [architecture is x86])]) +AS_IF([test "$host_cpu" = x86_64], [AC_DEFINE([ARCH_X86_64], [1], [architecture is x86_64])]) AS_IF([test "$enable_cmdline" != no], [AC_DEFINE([ENABLE_CMDLINE], [1], [enabled command line parser])]) AS_IF([test "$enable_console" != no], [AC_DEFINE([ENABLE_CONSOLE], [1], [enabled serial console])]) AS_IF([test "$enable_multiboot2" != no], [AC_DEFINE([ENABLE_MULTIBOOT2], [1], [enabled Multiboot 2 information parser])]) diff --git a/include/Makefile.am b/include/Makefile.am index ad88137..05837cd 100644 --- a/include/Makefile.am +++ b/include/Makefile.am @@ -1,5 +1,6 @@ nobase_include_HEADERS = \ kernaux/arch/x86.h \ + kernaux/arch/x86_64.h \ kernaux/cmdline.h \ kernaux/console.h \ kernaux/multiboot2.h \ diff --git a/include/kernaux/arch/x86_64.h b/include/kernaux/arch/x86_64.h new file mode 100644 index 0000000..748d276 --- /dev/null +++ b/include/kernaux/arch/x86_64.h @@ -0,0 +1,12 @@ +#ifndef KERNAUX_INCLUDED_ARCH_X86_64 +#define KERNAUX_INCLUDED_ARCH_X86_64 1 + +#ifdef __cplusplus +extern "C" { +#endif + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/src/arch/x86_64.S b/src/arch/x86_64.S new file mode 100644 index 0000000..f97325b --- /dev/null +++ b/src/arch/x86_64.S @@ -0,0 +1 @@ +#include "../config.h"