Script updates for unmangling hashed function names, and updates for some of the...
[madwifi/.git] / scripts / update_hal_unmangle
index 734144412f7d0b861a20238e66e218a23ae918c8..ce57f4bed33df55c40e82acc0fef896041752521 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/bin/bash
 #
 # Copyright (c) 2007 Michael Taylor
 # All rights reserved.
 #
 # $Id: foo $
 #
-#!/bin/bash
 # This script assumes that ath0 exists, but that's it.
+# 
+# XXX: Must get chip suffix/prefix to the function names, rather than hardcoded
+CHIP=ar5212
+# 
+function uniq() {
+       sort -u "$1" >"$1.tmp"
+       cp "$1.tmp" "$1"
+       rm "$1.tmp"
+}
+dmesg -c &>/dev/null && iwpriv ath0 dump_hal_map && dmesg | \
+       sed -n -r -e "/zz[0-9a-f]{8}/ { s~^([^+]*)[^=]*=(.*)~s/\1\/\2 (\1)/g~; s/ah_/${CHIP}_/; p; } " \
+        >>hal_unmangle.sed
+uniq hal_unmangle.sed
 dmesg -c &>/dev/null && iwpriv ath0 dump_hal_map && dmesg | \
-       sed -n -r -e "/zz[0-9a-f]{8}/ { s~^([^+]*)[^=]*=(.*)~s/\1\/\2 (\1)/g~; p; } " \
-        >hal_unmangle.sed
+       sed -n -r -e "/zz[0-9a-f]{8}/ { s~^([^+]*)[^=]*=(.*)~--redefine-sym \1=\2~; s/ah_/${CHIP}_/; p; } " \
+       >>hal_unmangle.objcopy
+uniq hal_unmangle.objcopy
+