kernel/acpi: Reduce code duplication with ACPICA.
[dragonfly.git] / sys / platform / pc64 / acpica / 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 #
4 echo "/* generated from `pwd`/acpi_wakecode.o */"
5 echo 'static char wakecode[] = {';
6 hexdump -bv acpi_wakecode.bin | \
7     sed -e 's/^[0-9a-f][0-9a-f]*//' -e 's/\([[:digit:]]\{1,\}\) */0\1,/g'
8 echo '};'
9
10 nm -n acpi_wakecode.o | while read offset dummy what
11 do
12     echo "#define ${what}       0x${offset}"
13 done
14
15 exit 0