Commit 24ba7e2a authored by David Mosberger's avatar David Mosberger

.del-print_offsets.awk~ce325580e04f9929:

  Delete: arch/ia64/tools/print_offsets.awk
.del-Makefile~90bde6a95198c56c:
  Delete: arch/ia64/tools/Makefile
parent a2412488
CFLAGS = -g -O2 -Wall $(CPPFLAGS)
TARGET = include/asm-ia64/offsets.h
src = $(obj)
clean-files := print_offsets.s print_offsets offsets.h
$(TARGET): $(obj)/offsets.h
@if ! cmp -s $(obj)/offsets.h ${TARGET}; then \
echo -e "*** Updating ${TARGET}..."; \
cp $(obj)/offsets.h ${TARGET}; \
else \
echo "*** ${TARGET} is up to date"; \
fi
#
# If we're cross-compiling, we use the cross-compiler to translate
# print_offsets.c into an assembly file and then awk to translate this
# file into offsets.h. This avoids having to use a simulator to
# generate this file. This is based on an idea suggested by Asit
# Mallick. If we're running natively, we can of course just build
# print_offsets and run it. --davidm
#
ifeq ($(CROSS_COMPILE),)
$(obj)/offsets.h: $(obj)/print_offsets
$(obj)/print_offsets > $(obj)/offsets.h
comma := ,
$(obj)/print_offsets: $(src)/print_offsets.c FORCE
[ -r $(TARGET) ] || echo "#define IA64_TASK_SIZE 0" > $(TARGET)
$(CC) $(CFLAGS) -DKBUILD_BASENAME=$(subst $(comma),_,$(subst -,_,$(*F))) \
$(src)/print_offsets.c -o $@
FORCE:
else
$(obj)/offsets.h: $(obj)/print_offsets.s
$(AWK) -f $(src)/print_offsets.awk $^ > $@
$(obj)/print_offsets.s: $(src)/print_offsets.c
[ -r $(TARGET) ] || echo "#define IA64_TASK_SIZE 0" > $(TARGET)
$(CC) $(CFLAGS) -DKBUILD_BASENAME=$(subst $(comma),_,$(subst -,_,$(*F))) -S $^ -o $@
endif
.PHONY: all modules modules_install
BEGIN {
print "#ifndef _ASM_IA64_OFFSETS_H"
print "#define _ASM_IA64_OFFSETS_H"
print "/*"
print " * DO NOT MODIFY"
print " *"
print " * This file was generated by arch/ia64/tools/print_offsets.awk."
print " *"
print " */"
print ""
print "#define CLONE_IDLETASK_BIT 12"
print "#define CLONE_SETTLS_BIT 19"
}
# look for .tab:
# stringz "name"
# data value
# sequence
/.*[.]size/ {
inside_table = 0
}
/\/\/ end/ {
inside_table = 0
}
/.*[.]rodata/ {
inside_table = 0
}
{
if (inside_table) {
if ($1 == "//") getline;
name=$2
getline
getline
if ($1 == "//") getline;
value=$2
len = length(name)
name = substr(name, 2, len - 2)
len -= 2
if (len == 0)
print ""
else {
len += 8
if (len >= 40) {
space=" "
} else {
space=""
while (len < 40) {
len += 8
space = space"\t"
}
}
printf("#define %s%s%lu\t/* 0x%lx */\n", name, space, value, value)
}
}
}
/tab:/ {
inside_table = 1
}
/tab\#:/ {
inside_table = 1
}
END {
print ""
print "#endif /* _ASM_IA64_OFFSETS_H */"
}
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