summaryrefslogtreecommitdiffstats
path: root/sys/i386/acpica/genwakecode.pl
diff options
context:
space:
mode:
Diffstat (limited to 'sys/i386/acpica/genwakecode.pl')
-rw-r--r--sys/i386/acpica/genwakecode.pl22
1 files changed, 22 insertions, 0 deletions
diff --git a/sys/i386/acpica/genwakecode.pl b/sys/i386/acpica/genwakecode.pl
new file mode 100644
index 0000000..1f5aede
--- /dev/null
+++ b/sys/i386/acpica/genwakecode.pl
@@ -0,0 +1,22 @@
+#!/usr/bin/perl
+# $FreeBSD$
+print "static char wakecode[] = {\n";
+open(BIN, "hexdump -Cv acpi_wakecode.bin|");
+while (<BIN>) {
+ s/^[0-9a-f]+//;
+ s/\|.*$//;
+ foreach (split()) {
+ print "0x$_,";
+ }
+ print "\n";
+}
+print "};\n";
+close(BIN);
+
+open(NM, "nm -n acpi_wakecode.o|");
+while (<NM>) {
+ split;
+ print "#define $_[2] 0x$_[0]\n";
+}
+close(NM);
+
OpenPOWER on IntegriCloud