Annotation of kernel/machdep/ppc/genassym.awk, revision 1.1.1.1

1.1       root        1: # Awk script to create assym.h
                      2: 
                      3: BEGIN {
                      4:     printf "#ifndef _ASSYM_H_\n#define _ASSYM_H_\n"
                      5: }
                      6: 
                      7: /^[    ]*\.data/ {
                      8:     got_data = 1
                      9: }
                     10: 
                     11: /^[    ]*_.*:/ {
                     12:     if (got_data == 1) {
                     13:        printf "#define %s ", substr($1, 3, length($1) - 3);
                     14:        got_var = 1;
                     15:     }
                     16: }
                     17: /^[    ]*\.long/ {
                     18:     if (got_var == 1) {
                     19:        print $2;
                     20:        got_var = 0;
                     21:     }
                     22: }
                     23: 
                     24: # assumption for i386 for KCS_SEL etc.
                     25: # XXX change if KCS_SEL etc. ever are greater than 8 bits
                     26: /^[    ]*\.byte/ {
                     27:     if (got_var == 1) {
                     28:        print $2;
                     29:        got_var = 0;
                     30:     }
                     31: }
                     32: 
                     33: /^[    ]*.text/ {
                     34:     if (got_data == 1) exit
                     35: }
                     36: 
                     37: END {
                     38:     printf "#endif /* _ASSYM_H_ */\n"
                     39: }

unix.superglobalmegacorp.com

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