1 BEGIN { print "<ioregisters>" }
2 END { print "</ioregisters>" }
4 function xml
(addr
, name
, comment
) {
5 if( name
!= "Reserved" )
6 print "\t<ioreg address=\"" addr
"\" name=\"" name
"\"> <!-- " comment
" --></ioreg>"
9 $
1 ~
/0x
[0-9A
-F
][0-9A
-F
]/ && $
2 ~
/\
(0x
[0-9A
-F
][0-9A
-F
]\
)/ {
10 where =
match($
1, /0x
[0-9A
-F
][0-9A
-F
]/)
12 addr =
substr($
1, where
, 4)
14 for(x =
4; x
<=
NF; ++x
) {
15 sub(/[^a
-zA
-Z0
-9]/, "", $x
)
16 comment = comment
" " $x
18 xml
(addr
, $
3, comment
)
23 $
1 ~
/\
(?
0x
[0-9A
-F
][0-9A
-F
]\
)?
/ {
24 where =
match($
1, /0x
[0-9A
-F
][0-9A
-F
]/)
26 addr =
substr($
1, where
, 4)
28 for(x =
3; x
<=
NF; ++x
) {
29 sub(/[^a
-zA
-Z0
-9]/, "", $x
)
30 comment = comment
" " $x
32 xml
(addr
, $
2, comment
)