File:  [Apple Darwin 0.x] / kernel / machdep / ppc / genassym.awk
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs
Tue Apr 24 18:26:09 2018 UTC (8 years, 2 months ago) by root
Branches: MAIN, Apple
CVS tags: HEAD, Darwin03, Darwin01
Darwin 0.1 Mach+BSD kernel

# Awk script to create assym.h

BEGIN {
    printf "#ifndef _ASSYM_H_\n#define _ASSYM_H_\n"
}

/^[ 	]*\.data/ {
    got_data = 1
}

/^[ 	]*_.*:/ {
    if (got_data == 1) {
	printf "#define %s ", substr($1, 3, length($1) - 3);
	got_var = 1;
    }
}
/^[ 	]*\.long/ {
    if (got_var == 1) {
	print $2;
	got_var = 0;
    }
}

# assumption for i386 for KCS_SEL etc.
# XXX change if KCS_SEL etc. ever are greater than 8 bits
/^[ 	]*\.byte/ {
    if (got_var == 1) {
	print $2;
	got_var = 0;
    }
}

/^[ 	]*.text/ {
    if (got_data == 1) exit
}

END {
    printf "#endif /* _ASSYM_H_ */\n"
}

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.