diff options
Diffstat (limited to 'riscv/configfrag.ac')
-rw-r--r-- | riscv/configfrag.ac | 91 |
1 files changed, 91 insertions, 0 deletions
diff --git a/riscv/configfrag.ac b/riscv/configfrag.ac new file mode 100644 index 0000000..e20634b --- /dev/null +++ b/riscv/configfrag.ac @@ -0,0 +1,91 @@ +dnl Configure fragment for riscv. + +dnl Copyright (C) 1999, 2004, 2006, 2007, 2008 Free Software Foundation, Inc. + +dnl Permission to use, copy, modify and distribute this software and its +dnl documentation is hereby granted, provided that both the copyright +dnl notice and this permission notice appear in all copies of the +dnl software, derivative works or modified versions, and any portions +dnl thereof, and that both notices appear in supporting documentation. +dnl +dnl THE FREE SOFTWARE FOUNDATION ALLOWS FREE USE OF THIS SOFTWARE IN ITS +dnl "AS IS" CONDITION. THE FREE SOFTWARE FOUNDATION DISCLAIMS ANY +dnl LIABILITY OF ANY KIND FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE +dnl USE OF THIS SOFTWARE. + +# +# Definitions. +# + +[case $host_cpu in + riscv32)] + AM_CONDITIONAL([HOST_riscv32], [true]) + + CFLAGS="$CFLAGS -mcmodel=medany -march=rv64gcv" + + # Some of the riscv-specific code checks for these. + AC_DEFINE([__ELF__], [1], [__ELF__]) + + # Determines the size of the CPU cache line. + AC_DEFINE([CPU_L1_SHIFT], [6], [CPU_L1_SHIFT]) + + [# Does the architecture provide machine-specific interfaces? + mach_machine_routines=1;; + *)] + AM_CONDITIONAL([HOST_riscv32], [false])[;; +esac + +case $host_cpu in + riscv64)] + AM_CONDITIONAL([HOST_riscv64], [true]) + + CFLAGS="$CFLAGS -mcmodel=medany -march=rv64gcv" + + # Some of the riscv-specific code checks for these. + AC_DEFINE([__ELF__], [1], [__ELF__]) + + # Determines the size of the CPU cache line. + AC_DEFINE([CPU_L1_SHIFT], [6], [CPU_L1_SHIFT]) + + [# Does the architecture provide machine-specific interfaces? + mach_machine_routines=1;; + *)] + AM_CONDITIONAL([HOST_riscv64], [false])[;; +esac + +case $host_platform in + riscv)] + AM_CONDITIONAL([PLATFORM_riscv], [true])[;; + *)] + AM_CONDITIONAL([PLATFORM_riscv], [false])[;; +esac] + +# +# Options. +# + +# The immediate console, useful for debugging early system +# initialization. Disabled by default. +AC_DEFINE([ENABLE_IMMEDIATE_CONSOLE], [0], [ENABLE_IMMEDIATE_CONSOLE]) + +AC_ARG_ENABLE([apic], + AS_HELP_STRING([--enable-apic], [LAPIC/IOAPIC support])) +[if [ x"$enable_apic" = xyes ]; then] + AC_DEFINE([APIC], [1], [APIC support]) + AM_CONDITIONAL([enable_apic], [true]) +[else] + AM_CONDITIONAL([enable_apic], [false]) +[fi] + +AC_ARG_WITH([_START_MAP], + AS_HELP_STRING([--with-_START_MAP=0x1000000], [specify kernel mapping start address]), + [_START_MAP="$withval"], [_START_MAP=0x1000000]) +AC_SUBST(_START_MAP) + +AC_CONFIG_LINKS([asm:$systype/include/asm + uapi:$systype/include/uapi + generated:$systype/include/generated]) + +dnl Local Variables: +dnl mode: autoconf +dnl End: |