############################################################################
# arch/x86_64/src/common/Make.defs
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements.  See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.  The
# ASF licenses this file to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance with the
# License.  You may obtain a copy of the License at
#
#   http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
# License for the specific language governing permissions and limitations
# under the License.
#
############################################################################

STARTUP_OBJS = crt0$(OBJEXT)

# Common x86_64 files

CMN_CSRCS += x86_64_allocateheap.c x86_64_copystate.c x86_64_exit.c
CMN_CSRCS += x86_64_getintstack.c  x86_64_initialize.c x86_64_nputs.c
CMN_CSRCS += x86_64_modifyreg8.c x86_64_modifyreg16.c x86_64_modifyreg32.c
CMN_CSRCS += x86_64_switchcontext.c x86_64_tlb.c

ifeq ($(CONFIG_ARCH_HAVE_FORK),y)
CMN_CSRCS += x86_64_fork.c
CMN_ASRCS += fork.S
endif

ifeq ($(CONFIG_ARCH_HAVE_SYSCALL),y)
CMN_CSRCS += x86_64_syscall.c
endif

ifeq ($(CONFIG_PCI),y)
CMN_CSRCS += x86_64_pci.c
endif

ifeq ($(CONFIG_ARCH_X86_64_ACPI),y)
CMN_CSRCS += x86_64_acpi.c
CMN_CSRCS += x86_64_acpi_procfs.c
endif

ifeq ($(CONFIG_SCHED_THREAD_LOCAL),y)
CMN_CSRCS += x86_64_tls.c
endif

ifeq ($(CONFIG_ARCH_USE_MMU),y)
CMN_CSRCS += x86_64_mmu.c
endif

ifeq ($(CONFIG_ARCH_ADDRENV),y)
CMN_CSRCS += x86_64_addrenv.c x86_64_pgalloc.c x86_64_addrenv_perms.c
endif

ifeq ($(CONFIG_ARCH_KERNEL_STACK),y)
CMN_CSRCS += x86_64_addrenv_kstack.c
endif

ifneq ($(CONFIG_BUILD_FLAT),y)
CMN_CSRCS  += x86_64_task_start.c
CMN_CSRCS  += x86_64_pthread_start.c
  ifneq ($(CONFIG_DISABLE_SIGNALS),y)
    CMN_CSRCS += x86_64_signal_dispatch.c
  endif
endif

ifndef CONFIG_ALARM_ARCH
CMN_CSRCS += x86_64_udelay.c x86_64_mdelay.c
endif

ifeq ($(CONFIG_ARCH_HAVE_DEBUG),y)
CMN_CSRCS += x86_64_hwdebug.c
endif