Commit f0c518a9 authored by Kai Germaschewski's avatar Kai Germaschewski

Merge http://linux-isdn.bkbits.net/linux-2.5.make

into tp1.ruhr-uni-bochum.de:/home/kai/kernel/v2.5/linux-2.5.make
parents 48fc1713 f3c28355
......@@ -330,18 +330,16 @@ scripts:
# The targets are still named depend / dep for traditional
# reasons, but the only thing we do here is generating
# the module version checksums.
# FIXME: For now, we are also calling "archdep" from here,
# which should be replaced by a more sensible solution.
.PHONY: depend dep $(patsubst %,_sfdep_%,$(SUBDIRS))
depend dep: .hdepend
# .hdepend is our (misnomed) marker for whether we've run
# generated module versions and made archdep
# generated module versions
.hdepend: $(if $(filter dep depend,$(MAKECMDGOALS)),FORCE)
@$(MAKE) archdep include/linux/modversions.h
@$(MAKE) include/linux/modversions.h
@touch $@
ifdef CONFIG_MODVERSIONS
......@@ -420,8 +418,8 @@ $(patsubst %, _modinst_%, $(SUBDIRS)) :
else # CONFIG_MODULES
# ---------------------------------------------------------------------------
# Modules not configured
# ---------------------------------------------------------------------------
modules modules_install: FORCE
@echo
......@@ -433,6 +431,25 @@ modules modules_install: FORCE
endif # CONFIG_MODULES
# Generate asm-offsets.h
# ---------------------------------------------------------------------------
define generate-asm-offsets.h
(set -e; \
echo "#ifndef __ASM_OFFSETS_H__"; \
echo "#define __ASM_OFFSETS_H__"; \
echo "/*"; \
echo " * DO NOT MODIFY."; \
echo " *"; \
echo " * This file was generated by arch/$(ARCH)/Makefile"; \
echo " *"; \
echo " */"; \
echo ""; \
sed -ne "/^->/{s:^->\([^ ]*\) [\$$#]*\([^ ]*\) \(.*\):#define \1 \2 /* \3 */:; s:->::; p;}"; \
echo ""; \
echo "#endif" )
endef
# RPM target
# ---------------------------------------------------------------------------
......
......@@ -127,10 +127,6 @@ archmrproper:
rm -f arch/alpha/vmlinux.lds
rm -f include/asm-alpha/asm_offsets.h
archdep:
$(MAKE) -C arch/alpha/kernel asm_offsets
@$(MAKEBOOT) dep
vmlinux: arch/alpha/vmlinux.lds
arch/alpha/vmlinux.lds: arch/alpha/vmlinux.lds.in
......@@ -138,3 +134,19 @@ arch/alpha/vmlinux.lds: arch/alpha/vmlinux.lds.in
bootpfile:
@$(MAKEBOOT) bootpfile
prepare: include/asm-$(ARCH)/asm_offsets.h
arch/$(ARCH)/kernel/asm-offsets.s: include/asm include/linux/version.h \
include/config/MARKER
include/asm-$(ARCH)/asm_offsets.h.tmp: arch/$(ARCH)/kernel/asm-offsets.s
@$(generate-asm-offsets.h) < $< > $@
include/asm-$(ARCH)/asm_offsets.h: include/asm-$(ARCH)/asm_offsets.h.tmp
@echo -n ' Generating $@'
@$(update-if-changed)
CLEAN_FILES += include/asm-$(ARCH)/offset.h.tmp \
include/asm-$(ARCH)/offset.h
......@@ -96,6 +96,4 @@ clean:
rm -f tools/mkbb tools/bootlx tools/lxboot tools/bootph
rm -f vmlinux.nh ksize.h
dep:
FORCE:
......@@ -94,17 +94,3 @@ endif
endif # GENERIC
include $(TOPDIR)/Rules.make
ASM_OFFSETS_H = $(TOPDIR)/include/asm-alpha/asm_offsets.h
asm_offsets:
$(CC) $(CFLAGS) -S -o - check_asm.c | \
sed -e '/xyzzy/ { s/xyzzy //; p; }; d;' > asm_offsets.tmp
@if cmp -s asm_offsets.tmp $(ASM_OFFSETS_H); then \
set -x; rm asm_offsets.tmp; \
else \
set -x; mv asm_offsets.tmp $(ASM_OFFSETS_H); \
fi
clean::
rm -f check_asm
/*
* Generate definitions needed by assembly language modules.
* This code generates raw asm output which is post-processed to extract
* and format the required data.
*/
#include <linux/types.h>
#include <linux/stddef.h>
#include <linux/sched.h>
#include <asm/io.h>
#define DEFINE(sym, val) \
asm volatile("\n->" #sym " %0 " #val : : "i" (val))
#define BLANK() asm volatile("\n->" : : )
void foo(void)
{
DEFINE(TI_TASK, offsetof(struct thread_info, task));
DEFINE(TI_FLAGS, offsetof(struct thread_info, flags));
DEFINE(TI_CPU, offsetof(struct thread_info, cpu));
BLANK();
DEFINE(PT_PTRACED, PT_PTRACED);
DEFINE(CLONE_VM, CLONE_VM);
DEFINE(SIGCHLD, SIGCHLD);
BLANK();
DEFINE(HAE_CACHE, offsetof(struct alpha_machine_vector, hae_cache));
DEFINE(HAE_REG, offsetof(struct alpha_machine_vector, hae_register));
}
#include <linux/types.h>
#include <linux/stddef.h>
#include <linux/sched.h>
#include <asm/io.h>
#define OUT(x) \
asm ("\nxyzzy " x)
#define DEF(name, val) \
asm volatile ("\nxyzzy #define " name " %0" : : "i"(val))
void foo(void)
{
OUT("#ifndef __ASM_OFFSETS_H__");
OUT("#define __ASM_OFFSETS_H__");
OUT("");
DEF("TI_TASK", offsetof(struct thread_info, task));
DEF("TI_FLAGS", offsetof(struct thread_info, flags));
DEF("TI_CPU", offsetof(struct thread_info, cpu));
DEF("PT_PTRACED", PT_PTRACED);
DEF("CLONE_VM", CLONE_VM);
DEF("SIGCHLD", SIGCHLD);
DEF("HAE_CACHE", offsetof(struct alpha_machine_vector, hae_cache));
DEF("HAE_REG", offsetof(struct alpha_machine_vector, hae_register));
OUT("");
OUT("#endif /* __ASM_OFFSETS_H__ */");
}
......@@ -65,6 +65,4 @@ __divlu.o: $(ev6)divide.S
__remlu.o: $(ev6)divide.S
$(CC) $(AFLAGS) -DREM -DINTSIZE -c -o __remlu.o $(ev6)divide.S
dep:
include $(TOPDIR)/Rules.make
......@@ -195,29 +195,25 @@ endif
MAKEBOOT =$(MAKE) -C arch/$(ARCH)/boot
MAKETOOLS =$(MAKE) -C arch/$(ARCH)/tools
# The following is a hack to get 'constants.h' up
# to date before starting compilation
$(patsubst %,_dir_%, $(SUBDIRS)): maketools
$(patsubst %,_modsubdir_%,$(MOD_DIRS)): maketools
# Update machine arch and proc symlinks if something which affects
# them changed. We use .arch and .proc to indicate when they were
# updated last, otherwise make uses the target directory mtime.
include/asm-arm/.arch: $(wildcard include/config/arch/*.h)
@echo 'Making asm-arm/arch -> asm-arm/arch-$(INCDIR) symlink'
@echo ' Making asm-arm/arch -> asm-arm/arch-$(INCDIR) symlink'
@rm -f include/asm-arm/arch
@ln -sf arch-$(INCDIR) include/asm-arm/arch
@touch $@
include/asm-arm/.proc: $(wildcard include/config/cpu/32.h) $(wildcard include/config/cpu/26.h)
@echo 'Making asm-arm/proc -> asm-arm/proc-$(PROCESSOR) symlink'
@echo ' Making asm-arm/proc -> asm-arm/proc-$(PROCESSOR) symlink'
@rm -f include/asm-arm/proc
@ln -sf proc-$(PROCESSOR) include/asm-arm/proc
@touch $@
.hdepend: include/asm-arm/.arch include/asm-arm/.proc
prepare: include/asm-arm/.arch include/asm-arm/.proc \
include/asm-arm/constants.h
@$(MAKETOOLS)
vmlinux: arch/arm/vmlinux.lds
......@@ -234,7 +230,6 @@ CLEAN_FILES += \
arch/arm/vmlinux.lds
MRPROPER_FILES += \
arch/arm/tools/constants.h* \
include/asm-arm/arch include/asm-arm/.arch \
include/asm-arm/proc include/asm-arm/.proc \
include/asm-arm/constants.h* \
......@@ -247,13 +242,9 @@ archmrproper: FORCE
archclean: FORCE
@$(MAKEBOOT) clean
archdep: FORCE
@$(MAKETOOLS) dep
@$(MAKEBOOT) dep
# we need version.h
maketools: include/linux/version.h FORCE
@$(MAKETOOLS) all
@$(MAKETOOLS)
# My testing targets (that short circuit a few dependencies)
zImg:; @$(MAKEBOOT) zImage
......@@ -277,3 +268,13 @@ bp:; @$(MAKEBOOT) bootpImage
echo "$$CFG does not exist"; \
fi; \
)
arch/$(ARCH)/kernel/asm-offsets.s: include/asm include/linux/version.h \
include/config/MARKER
include/asm-$(ARCH)/constants.h.tmp: arch/$(ARCH)/kernel/asm-offsets.s
@$(generate-asm-offsets.h) < $< > $@
include/asm-$(ARCH)/constants.h: include/asm-$(ARCH)/constants.h.tmp
@echo -n ' Generating $@'
@$(update-if-changed)
......@@ -125,7 +125,7 @@ zImage: compressed/vmlinux
bootpImage: bootp/bootp
$(OBJCOPY) -O binary -R .note -R .comment -S bootp/bootp $@
compressed/vmlinux: $(TOPDIR)/vmlinux dep
compressed/vmlinux: $(TOPDIR)/vmlinux
@$(MAKE) -C compressed vmlinux
bootp/bootp: zImage initrd
......@@ -145,5 +145,3 @@ clean:
$(RM) Image zImage bootpImage
@$(MAKE) -C compressed clean
@$(MAKE) -C bootp clean
dep:
/*
* linux/arch/arm/tools/getconsdata.c
*
* Copyright (C) 1995-2001 Russell King
* Copyright (C) 1995-2001 Russell King
* 2001-2002 Keith Owens
*
* Generate definitions needed by assembly language modules.
* This code generates raw asm output which is post-processed to extract
* and format the required data.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*/
#include <linux/config.h>
#include <linux/sched.h>
#include <linux/mm.h>
......@@ -31,45 +35,48 @@
#warning GCC 2.95.2 and earlier miscompiles kernels.
#endif
#define OFF_TSK(n) (unsigned long)&(((struct task_struct *)0)->n)
#define OFF_VMA(n) (unsigned long)&(((struct vm_area_struct *)0)->n)
#define DEFN(name,off) asm("\n#define "name" %0" :: "I" (off))
void func(void)
{
DEFN("TSK_USED_MATH", OFF_TSK(used_math));
DEFN("TSK_ACTIVE_MM", OFF_TSK(active_mm));
/* Use marker if you need to separate the values later */
DEFN("VMA_VM_MM", OFF_VMA(vm_mm));
DEFN("VMA_VM_FLAGS", OFF_VMA(vm_flags));
#define DEFINE(sym, val) \
asm volatile("\n->" #sym " %0 " #val : : "i" (val))
DEFN("VM_EXEC", VM_EXEC);
#define BLANK() asm volatile("\n->" : : )
int main(void)
{
DEFINE(TSK_USED_MATH, offsetof(struct task_struct, used_math));
DEFINE(TSK_ACTIVE_MM, offsetof(struct task_struct, active_mm));
BLANK();
DEFINE(VMA_VM_MM, offsetof(struct vm_area_struct, vm_mm));
DEFINE(VMA_VM_FLAGS, offsetof(struct vm_area_struct, vm_flags));
BLANK();
DEFINE(VM_EXEC, VM_EXEC);
BLANK();
#ifdef CONFIG_CPU_32
DEFN("HPTE_TYPE_SMALL", PTE_TYPE_SMALL);
DEFN("HPTE_AP_READ", PTE_AP_READ);
DEFN("HPTE_AP_WRITE", PTE_AP_WRITE);
DEFN("LPTE_PRESENT", L_PTE_PRESENT);
DEFN("LPTE_YOUNG", L_PTE_YOUNG);
DEFN("LPTE_BUFFERABLE", L_PTE_BUFFERABLE);
DEFN("LPTE_CACHEABLE", L_PTE_CACHEABLE);
DEFN("LPTE_USER", L_PTE_USER);
DEFN("LPTE_WRITE", L_PTE_WRITE);
DEFN("LPTE_EXEC", L_PTE_EXEC);
DEFN("LPTE_DIRTY", L_PTE_DIRTY);
DEFINE(HPTE_TYPE_SMALL, PTE_TYPE_SMALL);
DEFINE(HPTE_AP_READ, PTE_AP_READ);
DEFINE(HPTE_AP_WRITE, PTE_AP_WRITE);
BLANK();
DEFINE(LPTE_PRESENT, L_PTE_PRESENT);
DEFINE(LPTE_YOUNG, L_PTE_YOUNG);
DEFINE(LPTE_BUFFERABLE, L_PTE_BUFFERABLE);
DEFINE(LPTE_CACHEABLE, L_PTE_CACHEABLE);
DEFINE(LPTE_USER, L_PTE_USER);
DEFINE(LPTE_WRITE, L_PTE_WRITE);
DEFINE(LPTE_EXEC, L_PTE_EXEC);
DEFINE(LPTE_DIRTY, L_PTE_DIRTY);
#endif
BLANK();
#ifdef CONFIG_CPU_26
DEFN("PAGE_PRESENT", _PAGE_PRESENT);
DEFN("PAGE_READONLY", _PAGE_READONLY);
DEFN("PAGE_NOT_USER", _PAGE_NOT_USER);
DEFN("PAGE_OLD", _PAGE_OLD);
DEFN("PAGE_CLEAN", _PAGE_CLEAN);
DEFINE(PAGE_PRESENT, _PAGE_PRESENT);
DEFINE(PAGE_READONLY, _PAGE_READONLY);
DEFINE(PAGE_NOT_USER, _PAGE_NOT_USER);
DEFINE(PAGE_OLD, _PAGE_OLD);
DEFINE(PAGE_CLEAN, _PAGE_CLEAN);
#endif
DEFN("PAGE_SZ", PAGE_SIZE);
DEFN("SYS_ERROR0", 0x9f0000);
BLANK();
DEFINE(PAGE_SZ, PAGE_SIZE);
BLANK();
DEFINE(SYS_ERROR0, 0x9f0000);
return 0;
}
......@@ -4,40 +4,9 @@
# Copyright (C) 2001 Russell King
#
all: $(TOPDIR)/include/asm-arm/mach-types.h \
$(TOPDIR)/include/asm-arm/constants.h
all: $(TOPDIR)/include/asm-arm/mach-types.h
$(TOPDIR)/include/asm-arm/mach-types.h: mach-types gen-mach-types
awk -f gen-mach-types mach-types > $@
# Generate the constants.h header file using the compiler. We get
# the compiler to spit out assembly code, and then mundge it into
# what we want. We do this in several stages so make picks up on
# any errors that occur along the way.
constants.h: constants-hdr getconstants.c
$(CC) $(CFLAGS) -S -o $@.tmp.1 getconstants.c
sed 's/^\(#define .* \)[#$$]\(.*\)/\1\2/;/^#define/!d' $@.tmp.1 > $@.tmp.2
cat constants-hdr $@.tmp.2 > $@
$(RM) $@.tmp*
# Only update include/asm-arm/constants.h when it has actually changed.
$(TOPDIR)/include/asm-arm/constants.h: constants.h
cmp constants.h $@ >/dev/null 2>&1 || cp -p constants.h $@
# Build our dependencies, and then generate the constants and
# mach-types header files. If we do it now, mkdep will pick
# the dependencies up later on when it runs through the other
# directories
dep:
$(TOPDIR)/scripts/mkdep $(CFLAGS) $(EXTRA_CFLAGS) -- getconstants.c |\
sed s,getconstants.o,constants.h, > .depend
$(MAKE) all
.PHONY: all dep
ifneq ($(wildcard .depend),)
include .depend
endif
.PHONY: all
/*
* This file is automatically generated from arch/arm/tools/getconstants.c.
* Do not edit! Only include this file in assembly (.S) files!
*/
......@@ -100,6 +100,3 @@ archclean:
rm -rf $(LD_SCRIPT).tmp
archmrproper:
archdep:
@$(MAKEBOOT) dep
......@@ -7,8 +7,6 @@ zImage: compressed/vmlinuz
compressed/vmlinuz: $(TOPDIR)/vmlinux
@$(MAKE) -C compressed vmlinuz
dep:
clean:
rm -f zImage tools/build compressed/vmlinux.out
@$(MAKE) -C compressed clean
......@@ -108,7 +108,7 @@ MAKEBOOT = $(MAKE) -C arch/$(ARCH)/boot
vmlinux: arch/i386/vmlinux.lds
.PHONY: zImage bzImage compressed zlilo bzlilo zdisk bzdisk install \
clean archclean archmrproper archdep
clean archclean archmrproper
zImage: vmlinux
@$(MAKEBOOT) zImage
......@@ -140,6 +140,3 @@ archclean:
@$(MAKEBOOT) clean
archmrproper:
archdep:
@$(MAKEBOOT) dep
......@@ -97,8 +97,6 @@ bsetup.o: bsetup.s
bsetup.s: setup.S video.S Makefile $(BOOT_INCL) $(TOPDIR)/include/linux/version.h $(TOPDIR)/include/linux/compile.h
$(CPP) $(CPPFLAGS) -D__BIG_KERNEL__ -D__ASSEMBLY__ -traditional $(SVGA_MODE) $(RAMDISK) $< -o $@
dep:
clean:
@echo 'Cleaning up (boot)'
@rm -f tools/build
......
......@@ -127,8 +127,11 @@ archmrproper:
rm -f arch/$(ARCH)/vmlinux.lds
@$(MAKE) -C arch/$(ARCH)/tools mrproper
archdep:
@$(MAKEBOOT) dep
bootpfile:
@$(MAKEBOOT) bootpfile
prepare: $(TOPDIR)/include/asm-ia64/offsets.h
$(TOPDIR)/include/asm-ia64/offsets.h: include/asm include/linux/version.h \
include/config/MARKER
@$(MAKE) -C arch/$(ARCH)/tools $@
\ No newline at end of file
......@@ -23,5 +23,3 @@ bootloader: $(OBJECTS)
clean:
rm -f $(TARGETS)
dep:
......@@ -9,7 +9,7 @@ mrproper:
clean:
rm -f print_offsets.s print_offsets offsets.h
fastdep: offsets.h
$(TARGET): offsets.h
@if ! cmp -s offsets.h ${TARGET}; then \
echo -e "*** Updating ${TARGET}..."; \
cp offsets.h ${TARGET}; \
......
......@@ -172,5 +172,3 @@ archclean:
rm -f arch/m68k/kernel/m68k_defs.h arch/m68k/kernel/m68k_defs.d
archmrproper:
archdep:
......@@ -308,9 +308,3 @@ archclean:
archmrproper:
@$(MAKEBOOT) mrproper
$(MAKE) -C arch/$(ARCH)/tools mrproper
archdep:
if [ ! -f $(TOPDIR)/include/asm-$(ARCH)/offset.h ]; then \
touch $(TOPDIR)/include/asm-$(ARCH)/offset.h; \
fi;
@$(MAKEBOOT) dep
......@@ -35,9 +35,6 @@ elf2ecoff: elf2ecoff.c
addinitrd: addinitrd.c
$(HOSTCC) -o $@ $^
# Don't build dependencies, this may die if $(CC) isn't gcc
dep:
clean:
rm -f vmlinux.ecoff
rm -f zImage zImage.tmp
......
......@@ -176,9 +176,3 @@ archclean:
archmrproper:
@$(MAKEBOOT) mrproper
$(MAKE) -C arch/$(ARCH)/tools mrproper
archdep:
if [ ! -f $(TOPDIR)/include/asm-$(ARCH)/offset.h ]; then \
touch $(TOPDIR)/include/asm-$(ARCH)/offset.h; \
fi;
@$(MAKEBOOT) dep
......@@ -26,9 +26,6 @@ elf2ecoff: elf2ecoff.c
addinitrd: addinitrd.c
$(HOSTCC) -o $@ $^
# Don't build dependencies, this may die if $(CC) isn't gcc
dep:
clean:
rm -f vmlinux.ecoff
......
......@@ -78,5 +78,3 @@ install:
archclean:
archmrproper:
archdep:
......@@ -116,6 +116,3 @@ archclean:
@$(MAKEBOOT) clean
archmrproper:
archdep: scripts/mkdep
$(MAKEBOOT) fastdep
......@@ -66,5 +66,5 @@ archclean:
archmrproper:
archdep:
$(MAKEBOOT) fastdep
prepare:
$(MAKEBOOT) dep
......@@ -121,9 +121,6 @@ imagesize.c: vmlinux.gz
clean:
rm -f piggyback note addnote $(OBJS) zImage zImage.initrd vmlinux.gz no_initrd.o imagesize.c addSystemMap vmlinux.sm addRamDisk vmlinux.initrd vmlinux.sminitrd
fastdep:
$(TOPDIR)/scripts/mkdep *.[Sch] > .depend
dep:
$(CPP) $(CPPFLAGS) -M *.S *.c > .depend
......@@ -58,8 +58,5 @@ archclean:
archmrproper:
archdep:
@$(MAKEBOOT) dep
install: vmlinux
@$(MAKEBOOT) BOOTIMAGE=image install
......@@ -22,8 +22,6 @@ image: $(TOPDIR)/vmlinux \
listing: ../../../vmlinux
$(OBJDUMP) --disassemble --disassemble-all --disassemble-zeroes --reloc $(TOPDIR)/vmlinux > listing
dep:
clean:
rm -f image listing iplfba.boot ipleckd.boot ipldump.boot
......
......@@ -56,6 +56,3 @@ archclean:
$(MAKE) -C arch/$(ARCH)/kernel clean
archmrproper:
archdep:
@$(MAKEBOOT) dep
......@@ -24,8 +24,6 @@ image: $(TOPDIR)/vmlinux \
listing: ../../../vmlinux
$(OBJDUMP) --disassemble --disassemble-all --disassemble-zeroes --reloc $(TOPDIR)/vmlinux > listing
dep:
clean:
rm -f image listing iplfba.boot ipleckd.boot ipldump.boot
......
......@@ -94,6 +94,3 @@ archclean:
archmrproper:
rm -f arch/sh/vmlinux.lds
archdep:
@$(MAKEBOOT) dep
......@@ -25,8 +25,6 @@ install: Image
zinstall: zImage
sh -x ./install.sh $(KERNELRELEASE) zImage $(TOPDIR)/System.map "$(INSTALL_PATH)"
dep:
clean:
rm -f tools/build
rm -f setup bootsect zImage compressed/vmlinux.out
......
......@@ -58,9 +58,9 @@ archclean:
archmrproper:
rm -f $(TOPDIR)/include/asm-sparc/asm_offsets.h
archdep: check_asm
prepare: check_asm
check_asm: include/linux/version.h
check_asm: include/linux/version.h include/linux/asm include/config/MARKER
$(MAKE) -C arch/sparc/kernel check_asm
tftpboot.img:
......
......@@ -85,7 +85,5 @@ archclean:
archmrproper:
archdep:
tftpboot.img:
$(MAKE) -C arch/sparc64/boot tftpboot.img
......@@ -18,6 +18,3 @@ tftpboot.img: piggyback $(TOPDIR)/vmlinux $(ROOT_IMG)
piggyback: piggyback.c
$(HOSTCC) $(HOSTCFLAGS) -o piggyback piggyback.c
dep:
......@@ -54,7 +54,7 @@ CFLAGS += -finline-limit=2000
HEAD := arch/x86_64/kernel/head.o arch/x86_64/kernel/head64.o arch/x86_64/kernel/init_task.o
SUBDIRS := arch/x86_64/tools $(SUBDIRS) arch/x86_64/kernel arch/x86_64/mm arch/x86_64/lib
SUBDIRS += arch/x86_64/kernel arch/x86_64/mm arch/x86_64/lib
CORE_FILES := arch/x86_64/kernel/kernel.o $(CORE_FILES)
CORE_FILES += arch/x86_64/mm/mm.o
LIBS := $(TOPDIR)/arch/x86_64/lib/lib.a $(LIBS)
......@@ -76,38 +76,43 @@ MAKEBOOT = $(MAKE) -C arch/$(ARCH)/boot
vmlinux: arch/x86_64/vmlinux.lds
.PHONY: zImage bzImage compressed zlilo bzlilo zdisk bzdisk install \
clean archclean archmrproper archdep checkoffset
clean archclean archmrproper
checkoffset: FORCE include/asm
make -C arch/$(ARCH)/tools $(TOPDIR)/include/asm-x86_64/offset.h
bzImage: checkoffset vmlinux
bzImage: vmlinux
@$(MAKEBOOT) bzImage
bzImage-padded: checkoffset vmlinux
bzImage-padded: vmlinux
@$(MAKEBOOT) bzImage-padded
tmp:
@$(MAKEBOOT) BOOTIMAGE=bzImage zlilo
bzlilo: checkoffset vmlinux
bzlilo: vmlinux
@$(MAKEBOOT) BOOTIMAGE=bzImage zlilo
bzdisk: checkoffset vmlinux
bzdisk: vmlinux
@$(MAKEBOOT) BOOTIMAGE=bzImage zdisk
install: checkoffset vmlinux
install: vmlinux
@$(MAKEBOOT) BOOTIMAGE=bzImage install
archclean:
@$(MAKEBOOT) clean
@$(MAKE) -C $(TOPDIR)/arch/x86_64/tools clean
archmrproper:
rm -f $(TOPDIR)/arch/x86_64/tools/offset.h
rm -f $(TOPDIR)/arch/x86_64/tools/offset.tmp
rm -f $(TOPDIR)/include/asm-x86_64/offset.h
archdep:
@$(MAKE) -C $(TOPDIR)/arch/x86_64/tools all
@$(MAKEBOOT) dep
prepare: include/asm-$(ARCH)/offset.h
arch/$(ARCH)/kernel/asm-offsets.s: include/asm include/linux/version.h \
include/config/MARKER
include/asm-$(ARCH)/offset.h.tmp: arch/$(ARCH)/kernel/asm-offsets.s
@$(generate-asm-offsets.h) < $< > $@
include/asm-$(ARCH)/offset.h: include/asm-$(ARCH)/offset.h.tmp
@echo -n ' Generating $@'
@$(update-if-changed)
CLEAN_FILES += include/asm-$(ARCH)/offset.h.tmp \
include/asm-$(ARCH)/offset.h
\ No newline at end of file
......@@ -100,12 +100,8 @@ bsetup.o: bsetup.s
bsetup.s: setup.S video.S Makefile $(BOOT_INCL) $(TOPDIR)/include/linux/version.h $(TOPDIR)/include/linux/compile.h
$(IA32_CPP) $(CPPFLAGS) -D__BIG_KERNEL__ -D__ASSEMBLY__ -traditional $(SVGA_MODE) $(RAMDISK) $< -o $@
dep:
clean:
rm -f tools/build
rm -f setup bootsect zImage compressed/vmlinux.out
rm -f bsetup bbootsect bzImage compressed/bvmlinux.out
@$(MAKE) -C compressed clean
/* Written 2000 by Andi Kleen */
/* This program is never executed, just its assembly is examined for offsets
(this trick is needed to get cross compiling right) */
/* $Id: offset.c,v 1.13 2002/01/08 15:19:57 ak Exp $ */
#define ASM_OFFSET_H 1
#ifndef __KERNEL__
#define __KERNEL__
#endif
/*
* Generate definitions needed by assembly language modules.
* This code generates raw asm output which is post-processed to extract
* and format the required data.
*/
#include <linux/sched.h>
#include <linux/stddef.h>
#include <linux/errno.h>
......@@ -15,26 +13,26 @@
#include <asm/segment.h>
#include <asm/thread_info.h>
#define output(x) asm volatile ("--- " x)
#define outconst(x,y) asm volatile ("--- " x : : "i" (y))
#define DEFINE(sym, val) \
asm volatile("\n->" #sym " %0 " #val : : "i" (val))
int main(void)
{
output("/* Auto generated by arch/../tools/offset.c at " __DATE__ ". Do not edit. */\n");
output("#ifndef ASM_OFFSET_H\n");
output("#define ASM_OFFSET_H 1\n");
#define BLANK() asm volatile("\n->" : : )
#define ENTRY(entry) outconst("#define tsk_" #entry " %0", offsetof(struct task_struct, entry))
int main(void)
{
#define ENTRY(entry) DEFINE(tsk_ ## entry, offsetof(struct task_struct, entry))
ENTRY(state);
ENTRY(flags);
ENTRY(thread);
BLANK();
#undef ENTRY
#define ENTRY(entry) outconst("#define threadinfo_" #entry " %0", offsetof(struct thread_info, entry))
#define ENTRY(entry) DEFINE(threadinfo__ ## entry, offsetof(struct thread_info, entry))
ENTRY(flags);
ENTRY(addr_limit);
ENTRY(preempt_count);
BLANK();
#undef ENTRY
#define ENTRY(entry) outconst("#define pda_" #entry " %0", offsetof(struct x8664_pda, entry))
#define ENTRY(entry) DEFINE(pda__ ## entry, offsetof(struct x8664_pda, entry))
ENTRY(kernelstack);
ENTRY(oldrsp);
ENTRY(pcurrent);
......@@ -42,8 +40,7 @@ int main(void)
ENTRY(irqcount);
ENTRY(cpunumber);
ENTRY(irqstackptr);
BLANK();
#undef ENTRY
output("#endif\n");
return(0);
}
return 0;
}
TARGET = $(TOPDIR)/include/asm-x86_64/offset.h
all:
mrproper:
fastdep: $(TARGET)
.PHONY: all
$(TARGET): offset.h
cmp -s $^ $@ || (cp $^ $(TARGET).new && mv $(TARGET).new $(TARGET))
.PHONY : offset.h all modules modules_install
offset.h: offset.sed offset.c FORCE
$(CC) $(CFLAGS) -S -o offset.tmp offset.c
sed -n -f offset.sed < offset.tmp > offset.h
clean:
rm -f offset.[hs] $(TARGET).new offset.tmp
mrproper:
rm -f offset.[hs] $(TARGET)
rm -f $(TARGET)
include $(TOPDIR)/Rules.make
/---/ {
s/---//
s/\$//
s/^ //
s/^ //
p
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment