0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011 KASAN_SANITIZE := n
0012 KCSAN_SANITIZE := n
0013 OBJECT_FILES_NON_STANDARD := y
0014
0015
0016 KCOV_INSTRUMENT := n
0017
0018 always-y := realmode.bin realmode.relocs
0019
0020 wakeup-objs := wakeup_asm.o wakemain.o video-mode.o
0021 wakeup-objs += copy.o bioscall.o regs.o
0022
0023
0024
0025
0026 wakeup-objs += video-vga.o
0027 wakeup-objs += video-vesa.o
0028 wakeup-objs += video-bios.o
0029
0030 realmode-y += header.o
0031 realmode-y += trampoline_$(BITS).o
0032 realmode-y += stack.o
0033 realmode-y += reboot.o
0034 realmode-$(CONFIG_ACPI_SLEEP) += $(wakeup-objs)
0035
0036 targets += $(realmode-y)
0037
0038 REALMODE_OBJS = $(addprefix $(obj)/,$(realmode-y))
0039
0040 sed-pasyms := -n -r -e 's/^([0-9a-fA-F]+) [ABCDGRSTVW] (.+)$$/pa_\2 = \2;/p'
0041
0042 quiet_cmd_pasyms = PASYMS $@
0043 cmd_pasyms = $(NM) $(real-prereqs) | sed $(sed-pasyms) | sort | uniq > $@
0044
0045 targets += pasyms.h
0046 $(obj)/pasyms.h: $(REALMODE_OBJS) FORCE
0047 $(call if_changed,pasyms)
0048
0049 targets += realmode.lds
0050 $(obj)/realmode.lds: $(obj)/pasyms.h
0051
0052 LDFLAGS_realmode.elf := -m elf_i386 --emit-relocs -T
0053 CPPFLAGS_realmode.lds += -P -C -I$(objtree)/$(obj)
0054
0055 targets += realmode.elf
0056 $(obj)/realmode.elf: $(obj)/realmode.lds $(REALMODE_OBJS) FORCE
0057 $(call if_changed,ld)
0058
0059 OBJCOPYFLAGS_realmode.bin := -O binary
0060
0061 targets += realmode.bin
0062 $(obj)/realmode.bin: $(obj)/realmode.elf $(obj)/realmode.relocs FORCE
0063 $(call if_changed,objcopy)
0064
0065 quiet_cmd_relocs = RELOCS $@
0066 cmd_relocs = arch/x86/tools/relocs --realmode $< > $@
0067
0068 targets += realmode.relocs
0069 $(obj)/realmode.relocs: $(obj)/realmode.elf FORCE
0070 $(call if_changed,relocs)
0071
0072
0073
0074 KBUILD_CFLAGS := $(REALMODE_CFLAGS) -D_SETUP -D_WAKEUP \
0075 -I$(srctree)/arch/x86/boot
0076 KBUILD_AFLAGS := $(KBUILD_CFLAGS) -D__ASSEMBLY__
0077 KBUILD_CFLAGS += -fno-asynchronous-unwind-tables
0078 GCOV_PROFILE := n
0079 UBSAN_SANITIZE := n