Skip to content
Snippets Groups Projects
Commit 985e18d1 authored by Masahiro Yamada's avatar Masahiro Yamada Committed by Sonic Zhang
Browse files

blackfin: Do not generate unused header bootrom-asm-offsets.h

parent 9bac8f77
No related branches found
No related tags found
No related merge requests found
...@@ -807,7 +807,6 @@ clean: ...@@ -807,7 +807,6 @@ clean:
$(obj)board/matrix_vision/*/bootscript.img \ $(obj)board/matrix_vision/*/bootscript.img \
$(obj)board/voiceblue/eeprom \ $(obj)board/voiceblue/eeprom \
$(obj)u-boot.lds \ $(obj)u-boot.lds \
$(obj)arch/blackfin/cpu/bootrom-asm-offsets.[chs] \
$(obj)arch/blackfin/cpu/init.{lds,elf} $(obj)arch/blackfin/cpu/init.{lds,elf}
@rm -f $(obj)include/bmp_logo.h @rm -f $(obj)include/bmp_logo.h
@rm -f $(obj)include/bmp_logo_data.h @rm -f $(obj)include/bmp_logo_data.h
......
bootrom-asm-offsets.[chs]
init.lds init.lds
init.elf init.elf
...@@ -23,16 +23,6 @@ obj-y += traps.o ...@@ -23,16 +23,6 @@ obj-y += traps.o
extra-y += check_initcode extra-y += check_initcode
extra-y += bootrom-asm-offsets.h
$(obj)bootrom-asm-offsets.c: bootrom-asm-offsets.c.in bootrom-asm-offsets.awk
echo '#include <asm/mach-common/bits/bootrom.h>' | $(CPP) $(CPPFLAGS) - | gawk -f ./bootrom-asm-offsets.awk > $@.tmp
mv $@.tmp $@
$(obj)bootrom-asm-offsets.s: $(obj)bootrom-asm-offsets.c
$(CC) $(CFLAGS) -S $^ -o $@.tmp
mv $@.tmp $@
$(obj)bootrom-asm-offsets.h: $(obj)bootrom-asm-offsets.s
sed -ne "/^->/{s:^->\([^ ]*\) [\$$#]*\([^ ]*\) \(.*\):#define \1 \2 /* \3 */:; s:->::; p;}" $^ > $@
# make sure our initcode (which goes into LDR) does not # make sure our initcode (which goes into LDR) does not
# have relocs or external references # have relocs or external references
$(obj)initcode.o: CFLAGS += -fno-function-sections -fno-data-sections $(obj)initcode.o: CFLAGS += -fno-function-sections -fno-data-sections
......
#!/usr/bin/gawk -f
BEGIN {
print "/* DO NOT EDIT: AUTOMATICALLY GENERATED"
print " * Input files: bootrom-asm-offsets.awk bootrom-asm-offsets.c.in"
print " * DO NOT EDIT: AUTOMATICALLY GENERATED"
print " */"
print ""
system("cat bootrom-asm-offsets.c.in")
print "{"
}
{
/* find a structure definition */
if ($0 ~ /typedef struct .* {/) {
delete members;
i = 0;
/* extract each member of the structure */
while (1) {
getline
if ($1 == "}")
break;
gsub(/[*;]/, "");
members[i++] = $NF;
}
/* grab the structure's name */
struct = $NF;
sub(/;$/, "", struct);
/* output the DEFINE() macros */
while (i-- > 0)
print "\tDEFINE(" struct ", " members[i] ");"
print ""
}
}
END {
print "\treturn 0;"
print "}"
}
/* A little trick taken from the kernel asm-offsets.h where we convert
* the C structures automatically into a bunch of defines for use in
* the assembly files.
*/
#include <linux/stddef.h>
#include <asm/mach-common/bits/bootrom.h>
#define _DEFINE(sym, val) asm volatile("\n->" #sym " %0 " #val : : "i" (val))
#define DEFINE(s, m) _DEFINE(offset_##s##_##m, offsetof(s, m))
int main(int argc, char * const argv[])
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment