From 5e0b8d508ed51004bd836384293be00950ee62c9 Mon Sep 17 00:00:00 2001 From: Pasha Date: Tue, 20 Feb 2024 18:49:50 +0000 Subject: init gnumach copy --- x86_64/Makefrag.am | 245 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 245 insertions(+) create mode 100644 x86_64/Makefrag.am (limited to 'x86_64/Makefrag.am') diff --git a/x86_64/Makefrag.am b/x86_64/Makefrag.am new file mode 100644 index 0000000..b0bc45c --- /dev/null +++ b/x86_64/Makefrag.am @@ -0,0 +1,245 @@ +# Makefile fragment for x86_64. + +# Copyright (C) 1997, 1999, 2006, 2007 Free Software Foundation, Inc. + +# Permission to use, copy, modify and distribute this software and its +# documentation is hereby granted, provided that both the copyright +# notice and this permission notice appear in all copies of the +# software, derivative works or modified versions, and any portions +# thereof, and that both notices appear in supporting documentation. +# +# THE FREE SOFTWARE FOUNDATION ALLOWS FREE USE OF THIS SOFTWARE IN ITS +# "AS IS" CONDITION. THE FREE SOFTWARE FOUNDATION DISCLAIMS ANY +# LIABILITY OF ANY KIND FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE +# USE OF THIS SOFTWARE. + +# +# Building a distribution. +# +EXTRA_DIST += \ + x86_64/ldscript \ + x86_64/x86_64 \ + x86_64/include/mach/x86_64 + +if HOST_x86_64 + +# +# Source files for any x86_64 kernel. +# + +libkernel_a_SOURCES += \ + i386/i386at/acpi_parse_apic.h \ + i386/i386at/acpi_parse_apic.c \ + i386/i386at/autoconf.c \ + i386/i386at/autoconf.h \ + i386/i386at/biosmem.c \ + i386/i386at/biosmem.h \ + i386/i386at/conf.c \ + i386/i386at/cons_conf.c \ + i386/i386at/elf.h \ + i386/i386at/idt.h \ + i386/i386at/model_dep.c \ + i386/i386at/model_dep.h \ + i386/include/mach/sa/stdarg.h + +if PLATFORM_at +libkernel_a_SOURCES += \ + x86_64/boothdr.S \ + i386/i386at/com.c \ + i386/i386at/com.h \ + i386/i386at/comreg.h \ + i386/i386at/cram.h \ + i386/i386at/disk.h \ + i386/i386at/i8250.h \ + i386/i386at/immc.c \ + i386/i386at/int_init.c \ + i386/i386at/int_init.h \ + x86_64/interrupt.S \ + i386/i386at/kd.c \ + i386/i386at/kd.h \ + i386/i386at/kd_event.c \ + i386/i386at/kd_event.h \ + i386/i386at/kd_queue.c \ + i386/i386at/kd_queue.h \ + i386/i386at/kd_mouse.c \ + i386/i386at/kd_mouse.h \ + x86_64/kdasm.S \ + i386/i386at/kdsoft.h \ + i386/i386at/mem.c \ + i386/i386at/mem.h \ + i386/i386at/rtc.c \ + i386/i386at/rtc.h +endif + +# +# `lpr' device support. +# + +if enable_lpr +libkernel_a_SOURCES += \ + i386/i386at/lpr.c \ + i386/i386at/lpr.h +endif + + +# +# Further source files for any x86_64 kernel. +# + +libkernel_a_SOURCES += \ + i386/i386/percpu.h \ + i386/i386/percpu.c \ + x86_64/cswitch.S \ + x86_64/copy_user.c \ + x86_64/debug_trace.S \ + x86_64/idt_inittab.S \ + x86_64/locore.S \ + x86_64/spl.S + +if PLATFORM_at +libkernel_a_SOURCES += \ + i386/i386/apic.h \ + i386/i386/apic.c \ + i386/i386/hardclock.c \ + i386/i386/hardclock.h \ + i386/i386/irq.c \ + i386/i386/irq.h \ + i386/i386/msr.h \ + i386/i386/pit.c \ + i386/i386/pit.h + +if enable_apic +libkernel_a_SOURCES += \ + i386/i386at/ioapic.c +else +libkernel_a_SOURCES += \ + i386/i386/pic.c \ + i386/i386/pic.h \ + i386/i386at/pic_isa.c +endif +endif + +# +# KDB support. +# + +if enable_kdb +libkernel_a_SOURCES += \ + x86_64/_setjmp.S +endif + + +# +# Files from the generic sources that we want. +# + +libkernel_a_SOURCES += \ + chips/busses.c \ + chips/busses.h \ + device/cirbuf.c + +# +# Automatically generated source files. +# +# See Makerules.mig.am. +# + +nodist_lib_dep_tr_for_defs_a_SOURCES += \ + i386/i386/mach_i386.server.defs.c +nodist_libkernel_a_SOURCES += \ + i386/i386/mach_i386.server.h \ + i386/i386/mach_i386.server.c \ + i386/i386/mach_i386.server.msgids +# i386/i386/mach_i386.server.defs + +nodist_libkernel_a_SOURCES += \ + i386/i386/i386asm.h + +# +# Architecture specialities. +# + +AM_CPPFLAGS += \ + -I$(top_srcdir)/i386 \ + -I$(top_srcdir)/i386/i386 \ + -I$(top_srcdir)/i386/include/mach/sa + +AM_CFLAGS += \ + -mno-red-zone \ + -mcmodel=kernel \ + -mno-3dnow \ + -mno-mmx \ + -mno-sse \ + -mno-sse2 + +# +# Installation. +# + +include_mach_x86_64dir = $(includedir)/mach/x86_64 +include_mach_x86_64_HEADERS = \ + i386/include/mach/i386/asm.h \ + i386/include/mach/i386/boolean.h \ + i386/include/mach/i386/eflags.h \ + i386/include/mach/i386/exception.h \ + i386/include/mach/i386/fp_reg.h \ + i386/include/mach/i386/ioccom.h \ + i386/include/mach/i386/kern_return.h \ + i386/include/mach/i386/mach_i386.defs \ + i386/include/mach/i386/mach_i386_types.h \ + i386/include/mach/i386/machine_types.defs \ + i386/include/mach/i386/multiboot.h \ + i386/include/mach/i386/thread_status.h \ + i386/include/mach/i386/trap.h \ + i386/include/mach/i386/vm_param.h \ + i386/include/mach/i386/vm_types.h + +if enable_user32 +include_mach_x86_64_HEADERS += i386/include/mach/i386/syscall_sw.h +else +include_mach_x86_64_HEADERS += x86_64/include/syscall_sw.h +endif + +# +# Platform specific parts. +# + +KERNEL_MAP_BASE=0xffffffff80000000 + +if PLATFORM_at +# For now simply keep all the kernel virtual space in the last 2G. +# We could use a more elaborate schema if needed (e.g. reserving a +# larger area for directmap or the kernel heap)), I think only the +# test/bss/data sections need to be placed here kere because of +# -mcmodel=kernel +gnumach_LINKFLAGS += \ + --defsym _START_MAP=$(_START_MAP) \ + --defsym _START=$(_START_MAP) \ + --defsym KERNEL_MAP_SHIFT=$(KERNEL_MAP_BASE) \ + -z max-page-size=0x1000 \ + -T '$(srcdir)'/x86_64/ldscript + +AM_CCASFLAGS += \ + -Ii386 +endif + +if PLATFORM_xen +libkernel_a_SOURCES += \ + x86_64/xen_locore.S \ + x86_64/xen_boothdr.S \ + i386/xen/xen.c \ + i386/i386/xen.h + +gnumach_LINKFLAGS += \ + --defsym _START_MAP=$(KERNEL_MAP_BASE) \ + --defsym _START=$(KERNEL_MAP_BASE) \ + --defsym KERNEL_MAP_SHIFT=0 \ + -T '$(srcdir)'/x86_64/ldscript +endif + +AM_CFLAGS += -D_START_MAP=$(_START_MAP) \ + -DKERNEL_MAP_BASE=$(KERNEL_MAP_BASE) +AM_CCASFLAGS += -D_START_MAP=$(_START_MAP) \ + -DKERNEL_MAP_BASE=$(KERNEL_MAP_BASE) + +endif # HOST_x86_64 -- cgit v1.2.1