Merge from vendor branch BSDTAR:
[dragonfly.git] / sys / i386 / acpica5 / genwakecode.sh
1 #!/bin/sh
2 # $FreeBSD: src/sys/i386/acpica/genwakecode.sh,v 1.1 2002/05/01 21:52:34 peter Exp $
3 # $DragonFly: src/sys/i386/acpica5/Attic/genwakecode.sh,v 1.1 2004/02/21 06:48:05 dillon Exp $
4 #
5 echo "/* generated from `pwd`/acpi_wakecode.o */"
6 echo 'static char wakecode[] = {';
7 hexdump -Cv acpi_wakecode.bin | \
8     sed -e 's/^[0-9a-f][0-9a-f]*//' -e 's/\|.*$//' | \
9     while read line
10     do
11         for code in ${line}
12         do
13             echo -n "0x${code},";
14         done
15     done
16 echo '};'
17
18 nm -n acpi_wakecode.o | while read offset dummy what
19 do
20     echo "#define ${what}       0x${offset}"
21 done
22
23 exit 0