xv6/vectors.pl
rsc eaea18cb9c PDF at http://am.lcs.mit.edu/~rsc/xv6.pdf
Various changes made while offline.

 + bwrite sector argument is redundant; use b->sector.
 + reformatting of files for nicer PDF page breaks
 + distinguish between locked, unlocked inodes in type signatures
 + change FD_FILE to FD_INODE
 + move userinit (nee proc0init) to proc.c
 + move ROOTDEV to param.h
 + always parenthesize sizeof argument
2007-08-22 06:01:32 +00:00

49 lines
999 B
Perl
Executable file

#!/usr/bin/perl -w
# Generate vectors.S, the trap/interrupt entry points.
# There has to be one entry point per interrupt number
# since otherwise there's no way for trap() to discover
# the interrupt number.
print "# generated by vectors.pl - do not edit\n";
print "# handlers\n";
print ".text\n";
print ".globl alltraps\n";
for(my $i = 0; $i < 256; $i++){
print ".globl vector$i\n";
print "vector$i:\n";
if(($i < 8 || $i > 14) && $i != 17){
print " pushl \$0\n";
}
print " pushl \$$i\n";
print " jmp alltraps\n";
}
print "\n# vector table\n";
print ".data\n";
print ".globl vectors\n";
print "vectors:\n";
for(my $i = 0; $i < 256; $i++){
print " .long vector$i\n";
}
# sample output:
# # handlers
# .text
# .globl alltraps
# .globl vector0
# vector0:
# pushl $0
# pushl $0
# jmp alltraps
# ...
#
# # vector table
# .data
# .globl vectors
# vectors:
# .long vector0
# .long vector1
# .long vector2
# ...