Fix ccache behaviour if more than one ccache in PATH
[coreboot.git] / util / acpi / acpidump-all
blobfe10e9d1e6cfee5604fc07ebffc7ed1a4c445c97
1 #!/bin/bash
3 # Copyright (C) 2007-2010 by coresystems GmbH
5 # This program is free software; you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation; version 2 of the License.
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
14 # You should have received a copy of the GNU General Public License
15 # along with this program; if not, write to the Free Software
16 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
19 rm -rf out
20 mkdir out
22 # walk through all ACPI tables with their addresses
23 # example:
24 # RSDT @ 0xcf6794ba
25 # we can not just dump the tables by their names because some
26 # machines have double ACPI tables
28 acpidump | grep "@ 0x" | while read line
30 NAME=$( echo `echo $line|cut -f1 -d@` )
31 FNAME=$( echo $NAME | sed s/\ /_/g |sed s/\!/b/g )
32 ADDR=$( echo `echo $line|cut -f2 -d@` )
33 if [ "${!FNAME}" == "" ]; then
34 eval $FNAME=0
35 else
36 eval $FNAME=$(( ${!FNAME} + 1 ))
38 printf "Processing table \"$NAME\" at $ADDR ... "
39 printf "${!FNAME} tables of that kind found before.\n"
41 # acpidump -s ${!FNAME} --table "$NAME" > out/$FNAME-$ADDR-${!FNAME}.txt
42 acpidump -b -s ${!FNAME} --table "$NAME" > out/$FNAME-$ADDR-${!FNAME}.bin
43 if [ "`file -b out/$FNAME-$ADDR-${!FNAME}.bin`" != "ASCII text" ]; then
44 iasl -d out/$FNAME-$ADDR-${!FNAME}.bin &>/dev/null
45 else
46 printf "Skipping $NAME because it was not dumped correctly.\n\n"
49 done