Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/sommerfeld_i386mp_1]: src/sys/arch/i386/acpi simplify: use hexdump to pr...



details:   https://anonhg.NetBSD.org/src/rev/fd39ce5c88e2
branches:  sommerfeld_i386mp_1
changeset: 482551:fd39ce5c88e2
user:      christos <christos%NetBSD.org@localhost>
date:      Tue Jun 18 17:21:34 2002 +0000

description:
simplify: use hexdump to produce the output in the desired form instead
of massaging it with sed.

diffstat:

 sys/arch/i386/acpi/genwakecode.sh |  31 +++++++++++++++++++++++++++++++
 1 files changed, 31 insertions(+), 0 deletions(-)

diffs (35 lines):

diff -r 259c7d692c51 -r fd39ce5c88e2 sys/arch/i386/acpi/genwakecode.sh
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/arch/i386/acpi/genwakecode.sh Tue Jun 18 17:21:34 2002 +0000
@@ -0,0 +1,31 @@
+#!/bin/sh
+# $NetBSD: genwakecode.sh,v 1.3.2.2 2002/06/18 17:21:34 christos Exp $
+# FreeBSD: src/sys/i386/acpica/genwakecode.sh,v 1.1 2002/05/01 21:52:34 peter Exp $
+echo '/* THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. */'
+head -1 acpi_wakecode.S | sed 's@^.*\$\(NetBSD:.*\)\$.*$@/* from: \1 */@'
+echo -n '/* $'
+echo 'NetBSD: $ */'
+echo
+
+nm -n acpi_wakecode.o | while read offset dummy what
+do
+    if [ x"${offset}" = x"U" ]; then
+       echo error: undefined symbol \"${dummy}\". 1>&2
+       exit 1
+    fi
+    case $dummy in
+    t)
+       echo "#define   ${what} 0x${offset}"
+       ;;
+    *)
+       ;;
+    esac
+    true
+done || exit 1
+
+echo 
+echo 'static const unsigned char wakecode[] = {';
+hexdump -v -e '"\t" 8/1 "0x%02x, " "\n"' < acpi_wakecode.bin
+echo '};'
+
+exit 0



Home | Main Index | Thread Index | Old Index