summaryrefslogtreecommitdiff
path: root/util
diff options
context:
space:
mode:
authorStefan Reinauer <stepan@coresystems.de>2010-04-27 06:56:47 +0000
committerStefan Reinauer <stepan@openbios.org>2010-04-27 06:56:47 +0000
commit14e22779625de673569c7b950ecc2753fb915b31 (patch)
tree14a6ed759e116e9e6e9bbd7f499b74b96d6cc072 /util
parent0e1e8065e303030c39c3f2c27e5d32ee58a16c66 (diff)
downloadcoreboot-14e22779625de673569c7b950ecc2753fb915b31.tar.xz
Since some people disapprove of white space cleanups mixed in regular commits
while others dislike them being extra commits, let's clean them up once and for all for the existing code. If it's ugly, let it only be ugly once :-) Signed-off-by: Stefan Reinauer <stepan@coresystems.de> Acked-by: Stefan Reinauer <stepan@coresystems.de> git-svn-id: svn://svn.coreboot.org/coreboot/trunk@5507 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Diffstat (limited to 'util')
-rwxr-xr-xutil/abuild/abuild26
-rw-r--r--util/abuild/abuild.16
-rw-r--r--util/amdtools/README6
-rwxr-xr-xutil/amdtools/k8-compare-pci-space.pl6
-rwxr-xr-xutil/amdtools/k8-interpret-extended-memory-settings.pl4
-rwxr-xr-xutil/amdtools/parse-bkdg.pl4
-rw-r--r--util/cbfstool/EXAMPLE2
-rw-r--r--util/cbfstool/Makefile2
-rw-r--r--util/cbfstool/cbfs.h6
-rw-r--r--util/cbfstool/common.c4
-rw-r--r--util/cbfstool/lzma/C/7zip/Common/InBuffer.h2
-rw-r--r--util/cbfstool/lzma/C/7zip/Common/OutBuffer.cpp4
-rw-r--r--util/cbfstool/lzma/C/7zip/Common/OutBuffer.h2
-rw-r--r--util/cbfstool/lzma/C/7zip/Common/StdAfx.h2
-rw-r--r--util/cbfstool/lzma/C/7zip/Common/StreamUtils.cpp4
-rw-r--r--util/cbfstool/lzma/C/7zip/Compress/LZ/BinTree/BinTree.h6
-rw-r--r--util/cbfstool/lzma/C/7zip/Compress/LZ/BinTree/BinTreeMain.h48
-rw-r--r--util/cbfstool/lzma/C/7zip/Compress/LZ/IMatchFinder.h4
-rw-r--r--util/cbfstool/lzma/C/7zip/Compress/LZ/LZInWindow.cpp6
-rw-r--r--util/cbfstool/lzma/C/7zip/Compress/LZ/LZInWindow.h2
-rw-r--r--util/cbfstool/lzma/C/7zip/Compress/LZ/StdAfx.h2
-rw-r--r--util/cbfstool/lzma/C/7zip/Compress/LZMA/LZMA.h8
-rw-r--r--util/cbfstool/lzma/C/7zip/Compress/LZMA/LZMAEncoder.cpp128
-rw-r--r--util/cbfstool/lzma/C/7zip/Compress/LZMA/LZMAEncoder.h38
-rw-r--r--util/cbfstool/lzma/C/7zip/Compress/RangeCoder/RangeCoder.h20
-rw-r--r--util/cbfstool/lzma/C/7zip/Compress/RangeCoder/RangeCoderBit.cpp8
-rw-r--r--util/cbfstool/lzma/C/7zip/Compress/RangeCoder/RangeCoderBitTree.h6
-rw-r--r--util/cbfstool/lzma/C/7zip/Compress/RangeCoder/RangeCoderOpt.h2
-rw-r--r--util/cbfstool/lzma/C/7zip/Decompress/LzmaDecode.c46
-rw-r--r--util/cbfstool/lzma/C/7zip/Decompress/LzmaDecode.h14
-rw-r--r--util/cbfstool/lzma/C/7zip/ICoder.h14
-rw-r--r--util/cbfstool/lzma/C/7zip/IStream.h2
-rw-r--r--util/cbfstool/lzma/C/Common/Alloc.cpp10
-rw-r--r--util/cbfstool/lzma/C/Common/CRC.cpp4
-rw-r--r--util/cbfstool/lzma/C/Common/CRC.h2
-rw-r--r--util/cbfstool/lzma/C/Common/MyCom.h12
-rw-r--r--util/cbfstool/lzma/C/Common/MyGuidDef.h2
-rw-r--r--util/cbfstool/lzma/C/Common/MyUnknown.h6
-rw-r--r--util/cbfstool/lzma/C/Common/MyWindows.h12
-rw-r--r--util/cbfstool/lzma/C/Common/NewHandler.h8
-rw-r--r--util/cbfstool/lzma/C/Common/StdAfx.h2
-rw-r--r--util/cbfstool/lzma/C/LGPL.txt2
-rw-r--r--util/cbfstool/lzma/minilzma.cc58
-rwxr-xr-xutil/crossgcc/buildgcc4
-rw-r--r--util/crossgcc/patches/gcc-4.3.2_use-gnu-style-comments-in-assembly.patch6
-rw-r--r--util/crossgcc/patches/gcc-4.3.3_use-gnu-style-comments-in-assembly.patch6
-rw-r--r--util/crossgcc/patches/gcc-4.4.1_less-junk-in-crtbegin.patch14
-rw-r--r--util/crossgcc/patches/gcc-4.4.2_less-junk-in-crtbegin.patch14
-rw-r--r--util/dump_mmcr/dumpmmcr.c58
-rw-r--r--util/ectool/ec.c2
-rw-r--r--util/getpir/README6
-rw-r--r--util/inteltool/Makefile8
-rw-r--r--util/inteltool/cpu.c20
-rw-r--r--util/inteltool/gpio.c4
-rw-r--r--util/inteltool/inteltool.c18
-rw-r--r--util/inteltool/inteltool.h4
-rw-r--r--util/inteltool/memory.c6
-rw-r--r--util/inteltool/pcie.c16
-rw-r--r--util/inteltool/powermgt.c8
-rw-r--r--util/inteltool/rootcmplx.c8
-rw-r--r--util/k8resdump/Makefile8
-rw-r--r--util/kconfig/confdata.c2
-rw-r--r--util/kconfig/lex.zconf.c_shipped86
-rw-r--r--util/kconfig/lxdialog/BIG.FAT.WARNING2
-rw-r--r--util/kconfig/lxdialog/menubox.c2
-rw-r--r--util/kconfig/mconf.c2
-rw-r--r--util/kconfig/regex.c556
-rw-r--r--util/kconfig/regex.h24
-rw-r--r--util/kconfig/zconf.tab.c_shipped2
-rw-r--r--util/lbtdump/Makefile2
-rw-r--r--util/lbtdump/lbtdump.c20
-rw-r--r--util/mkelfImage/Makefile4
-rw-r--r--util/mkelfImage/News8
-rwxr-xr-xutil/mkelfImage/config/config.guess2
-rwxr-xr-xutil/mkelfImage/config/install-sh16
-rw-r--r--util/mkelfImage/configure.ac16
-rw-r--r--util/mkelfImage/include/elf_boot.h6
-rw-r--r--util/mkelfImage/include/linuxbios_tables.h4
-rw-r--r--util/mkelfImage/include/mkelfImage.h2
-rw-r--r--util/mkelfImage/kunzip_src/arch/alpha/include/stdint.h6
-rw-r--r--util/mkelfImage/kunzip_src/arch/alpha/lib/divide.S2
-rw-r--r--util/mkelfImage/kunzip_src/arch/alpha/lib/kunzip.lds6
-rw-r--r--util/mkelfImage/kunzip_src/arch/i386/include/stdint.h6
-rw-r--r--util/mkelfImage/kunzip_src/arch/i386/lib/kunzip.lds6
-rw-r--r--util/mkelfImage/kunzip_src/arch/i386/lib/start.S1
-rw-r--r--util/mkelfImage/kunzip_src/include/stdarg.h2
-rw-r--r--util/mkelfImage/kunzip_src/include/string.h14
-rw-r--r--util/mkelfImage/kunzip_src/lib/inflate.c32
-rw-r--r--util/mkelfImage/kunzip_src/lib/kunzip.c4
-rw-r--r--util/mkelfImage/linux-i386/convert.lds6
-rw-r--r--util/mkelfImage/linux-i386/convert_params.c196
-rw-r--r--util/mkelfImage/linux-i386/head.S48
-rw-r--r--util/mkelfImage/linux-i386/mkelf-linux-i386.c12
-rw-r--r--util/mkelfImage/linux-i386/uniform_boot.h14
-rw-r--r--util/mkelfImage/linux-i386/x86-linux.h8
-rw-r--r--util/mkelfImage/linux-ia64/convert_params.c18
-rw-r--r--util/mkelfImage/linux-ia64/head.S30
-rw-r--r--util/mkelfImage/linux-ia64/mkelf-linux-ia64.c14
-rw-r--r--util/mkelfImage/main/mkelfImage.c22
-rw-r--r--util/mkelfImage/main/mkelfImage.man2
-rw-r--r--util/mkelfImage/mkelfImage.spec.in6
-rw-r--r--util/mptable/mptable.c38
-rwxr-xr-xutil/msrtool/configure2
-rw-r--r--util/msrtool/geodegx2.c2
-rw-r--r--util/msrtool/msrtool.c2
-rw-r--r--util/nrv2b/nrv2b.c144
-rw-r--r--util/nvramtool/Makefile2
-rw-r--r--util/nvramtool/cmos_lowlevel.c4
-rw-r--r--util/nvramtool/cmos_ops.c2
-rw-r--r--util/nvramtool/common.c2
-rw-r--r--util/nvramtool/coreboot_tables.h12
-rw-r--r--util/nvramtool/hexdump.c2
-rw-r--r--util/nvramtool/ip_checksum.h2
-rw-r--r--util/nvramtool/nvramtool.82
-rw-r--r--util/optionlist/Makefile12
-rwxr-xr-xutil/optionlist/kconfig2wiki12
-rw-r--r--util/options/build_opt_tbl.c24
-rw-r--r--util/resetcf/resetcf.c8
-rw-r--r--util/romcc/Makefile2
-rw-r--r--util/romcc/do_tests.sh14
-rw-r--r--util/romcc/romcc.c1398
-rw-r--r--util/romcc/tests.sh12
-rw-r--r--util/romcc/tests/fail_test10.c2
-rw-r--r--util/romcc/tests/fail_test2.c10
-rw-r--r--util/romcc/tests/hello_world.c4
-rw-r--r--util/romcc/tests/hello_world1.c4
-rw-r--r--util/romcc/tests/hello_world2.c4
-rw-r--r--util/romcc/tests/include/linux_console.h32
-rw-r--r--util/romcc/tests/include/linuxi386_syscall.h12
-rw-r--r--util/romcc/tests/linux_console.h32
-rw-r--r--util/romcc/tests/linux_test13.c2
-rw-r--r--util/romcc/tests/linux_test2.c22
-rw-r--r--util/romcc/tests/linux_test3.c8
-rw-r--r--util/romcc/tests/linux_test4.c2
-rw-r--r--util/romcc/tests/linux_test5.c34
-rw-r--r--util/romcc/tests/linuxi386_syscall.h12
-rw-r--r--util/romcc/tests/raminit_test.c110
-rw-r--r--util/romcc/tests/raminit_test1.c110
-rw-r--r--util/romcc/tests/raminit_test2.c110
-rw-r--r--util/romcc/tests/raminit_test6.c810
-rw-r--r--util/romcc/tests/raminit_test7.c810
-rw-r--r--util/romcc/tests/simple_test.c10
-rw-r--r--util/romcc/tests/simple_test1.c10
-rw-r--r--util/romcc/tests/simple_test10.c2
-rw-r--r--util/romcc/tests/simple_test19.c2
-rw-r--r--util/romcc/tests/simple_test2.c2
-rw-r--r--util/romcc/tests/simple_test20.c2
-rw-r--r--util/romcc/tests/simple_test22.c12
-rw-r--r--util/romcc/tests/simple_test27.c4
-rw-r--r--util/romcc/tests/simple_test3.c4
-rw-r--r--util/romcc/tests/simple_test30.c66
-rw-r--r--util/romcc/tests/simple_test32.c4
-rw-r--r--util/romcc/tests/simple_test36.c2
-rw-r--r--util/romcc/tests/simple_test37.c2
-rw-r--r--util/romcc/tests/simple_test38.c52
-rw-r--r--util/romcc/tests/simple_test39.c54
-rw-r--r--util/romcc/tests/simple_test4.c14
-rw-r--r--util/romcc/tests/simple_test43.c6
-rw-r--r--util/romcc/tests/simple_test45.c8
-rw-r--r--util/romcc/tests/simple_test46.c6
-rw-r--r--util/romcc/tests/simple_test47.c8
-rw-r--r--util/romcc/tests/simple_test48.c2
-rw-r--r--util/romcc/tests/simple_test49.c2
-rw-r--r--util/romcc/tests/simple_test5.c6
-rw-r--r--util/romcc/tests/simple_test50.c16
-rw-r--r--util/romcc/tests/simple_test54.c78
-rw-r--r--util/romcc/tests/simple_test56.c2
-rw-r--r--util/romcc/tests/simple_test59.c44
-rw-r--r--util/romcc/tests/simple_test6.c4
-rw-r--r--util/romcc/tests/simple_test61.c2
-rw-r--r--util/romcc/tests/simple_test65.c2
-rw-r--r--util/romcc/tests/simple_test66.c4
-rw-r--r--util/romcc/tests/simple_test67.c2
-rw-r--r--util/romcc/tests/simple_test7.c4
-rw-r--r--util/romcc/tests/simple_test72.c42
-rw-r--r--util/romcc/tests/simple_test73.c32
-rw-r--r--util/romcc/tests/simple_test74.c4
-rw-r--r--util/romcc/tests/simple_test75.c2
-rw-r--r--util/romcc/tests/simple_test76.c4
-rw-r--r--util/romcc/tests/simple_test81.c2
-rw-r--r--util/sconfig/lex.yy.c_shipped86
-rw-r--r--util/sconfig/sconfig.tab.c_shipped10
-rw-r--r--util/sconfig/sconfig.tab.h_shipped10
-rw-r--r--util/superiotool/smsc.c2
-rw-r--r--util/superiotool/superiotool.82
-rw-r--r--util/vgabios/Makefile4
-rw-r--r--util/vgabios/testbios.c10
187 files changed, 3224 insertions, 3225 deletions
diff --git a/util/abuild/abuild b/util/abuild/abuild
index 22962a8a40..9ba75ca753 100755
--- a/util/abuild/abuild
+++ b/util/abuild/abuild
@@ -10,7 +10,7 @@
# This file is subject to the terms and conditions of the GNU General
# Public License. See the file COPYING in the main directory of this
# archive for more details.
-#
+#
#set -x # Turn echo on....
@@ -99,10 +99,10 @@ function xml
function xmlfile
{
- test "$mode" == "xml" && {
+ test "$mode" == "xml" && {
printf '<![CDATA[\n'
cat $1
- printf ']]>\n'
+ printf ']]>\n'
} >> $XMLFILE
}
@@ -119,9 +119,9 @@ function mainboards
{
# make this a function so we can easily select
# without breaking readability
-
+
VENDOR=$1
-
+
ls -1 $ROOT/src/mainboard/$VENDOR | grep -v Kconfig
}
@@ -143,7 +143,7 @@ function create_config
build_dir=$TARGET/${VENDOR}_${MAINBOARD}
# get a working payload for the board if we have one.
- # the --payload option expects a directory containing
+ # the --payload option expects a directory containing
# a shell script payload.sh
# Usage: payload.sh [VENDOR] [DEVICE]
# the script returns an absolute path to the payload binary.
@@ -253,7 +253,7 @@ function create_buildenv
}
function compile_target
-{
+{
VENDOR=$1
MAINBOARD=$2
@@ -381,17 +381,17 @@ function build_target
done
fi
-
+
# TBD: look for suitable cross compiler suite
# cross-$TARCH-gcc and cross-$TARCH-ld
-
+
# Check result:
if [ $found_crosscompiler == "false" ]; then
printf "$TARCH: skipped, we're $ARCH\n\n"
xml " <status>notbuilt</status>"
xml ""
xml "</mainboard>"
-
+
return 0
else
printf "$TARCH: ok, $ARCH using ${CROSS_COMPILE}gcc\n"
@@ -426,14 +426,14 @@ function build_target
xml "</mainboard>"
return 0
}
-
+
stime=`perl -e 'print time();' 2>/dev/null || date +%s`
create_buildenv $VENDOR $MAINBOARD $CONFIG
if [ $? -eq 0 -a $configureonly -eq 0 ]; then
if [ "$scanbuild" = "true" ]; then
rm -rf $TARGET/scan-build-results-tmp
fi
- compile_target $VENDOR $MAINBOARD &&
+ compile_target $VENDOR $MAINBOARD &&
xml " <status>ok</status>" ||
xml "<status>broken</status>"
if [ "$scanbuild" = "true" ]; then
@@ -541,7 +541,7 @@ function myhelp
printf " (defaults to $ROOT)\n\n"
}
-function myversion
+function myversion
{
cat << EOF
diff --git a/util/abuild/abuild.1 b/util/abuild/abuild.1
index 44439e9213..33f30cb2a7 100644
--- a/util/abuild/abuild.1
+++ b/util/abuild/abuild.1
@@ -50,13 +50,13 @@ and will be created in the current directory.
.TP
.B "\-T, \-\-test"
Submit generated image(s) to the automated test system.
-The results of the tests will be made available at
+The results of the tests will be made available at
.B http://qa.coreboot.org/log_manual.php
.TP
.B "\-c, \-\-cpus [<numcpus>|max]"
-Build on
+Build on
.B numcpus
-cpus at the same time, or on all available with
+cpus at the same time, or on all available with
.B max\fR.
.TP
.B "\-s, \-\-silent"
diff --git a/util/amdtools/README b/util/amdtools/README
index a1601fe8c7..da14bf3c00 100644
--- a/util/amdtools/README
+++ b/util/amdtools/README
@@ -24,9 +24,9 @@ Finally run the txt file through the parse-bkdg.pl script like so:
Now we have the bkdg.data file that is used by the other scripts.
If you want to test the scripts without doing all this work, you can use some
-sample input files from the 'example_input/' directory.
+sample input files from the 'example_input/' directory.
---
+--
Ward Vandewege, 2009-10-28.
ward@jhvc.com
-
+
diff --git a/util/amdtools/k8-compare-pci-space.pl b/util/amdtools/k8-compare-pci-space.pl
index 16ecb34067..97ef3e9ff1 100755
--- a/util/amdtools/k8-compare-pci-space.pl
+++ b/util/amdtools/k8-compare-pci-space.pl
@@ -55,7 +55,7 @@ sub parse_file {
next if (!(/^([a-f0-9]{2}): ([[a-f0-9 ]+)$/i));
# Line format
# 00: 22 10 02 11 00 00 00 00 00 00 00 06 00 00 80 00
-#print STDERR hex($1) . " ($1): $2\n";
+#print STDERR hex($1) . " ($1): $2\n";
my $regoffset = hex($1);
my @values = split(/ /,$2);
for (my $i=0;$i<=$#values;$i++) {
@@ -93,7 +93,7 @@ sub parse_file_old {
if ($tmp[1] eq '98.l') {
$register = ($tmp[2] =~ /(..)$/)[0]; # last 2 digits are (hex) of what we wrote to the register, if second field is 98.l
$devreg = "$device $register";
- if ("$binrep" =~ /^1/) {
+ if ("$binrep" =~ /^1/) {
# bit 31 *must* be 1 if readout is to be correct
print "$tmp[0] - $register<br>\n" if ($DEBUG);
} else {
@@ -107,7 +107,7 @@ sub parse_file_old {
$data{$devreg}{$filename} = $packed;
}
}
- return %data;
+ return %data;
}
sub interpret_differences {
diff --git a/util/amdtools/k8-interpret-extended-memory-settings.pl b/util/amdtools/k8-interpret-extended-memory-settings.pl
index 0bb4e62a44..3ecc2a53e0 100755
--- a/util/amdtools/k8-interpret-extended-memory-settings.pl
+++ b/util/amdtools/k8-interpret-extended-memory-settings.pl
@@ -63,7 +63,7 @@ sub parse_file {
if ($tmp[1] eq '98.l') {
$register = ($tmp[2] =~ /(..)$/)[0]; # last 2 digits are (hex) of what we wrote to the register, if second field is 98.l
$devreg = "$device $register";
- if ("$binrep" =~ /^1/) {
+ if ("$binrep" =~ /^1/) {
# bit 31 *must* be 1 if readout is to be correct
print "$tmp[0] - $register<br>\n" if ($DEBUG);
} else {
@@ -77,7 +77,7 @@ sub parse_file {
$data{$devreg}{$filename} = $packed;
}
}
- return %data;
+ return %data;
}
sub interpret_differences {
diff --git a/util/amdtools/parse-bkdg.pl b/util/amdtools/parse-bkdg.pl
index d359e4abe7..8ef93b7616 100755
--- a/util/amdtools/parse-bkdg.pl
+++ b/util/amdtools/parse-bkdg.pl
@@ -191,7 +191,7 @@ while (<>) {
$previous_start = $start;
$previous_stop = $stop;
- # the 'range' field is not useful in this instance, but used in the 'fields' version of this block to easily go
+ # the 'range' field is not useful in this instance, but used in the 'fields' version of this block to easily go
# from a bit position to the corresponding range.
my $str = "
\$info{'$registers[0]'}{'ranges'}{'" . $f[0] . "'}{'function'} = \"" . $f[2] . "\";
@@ -260,7 +260,7 @@ sub multiply {
my $tmp = $str;
$tmp =~ s/\{'$range'\}/{'$i'}/g;
$tmp =~ s/\{'ranges'\}/{'fields'}/g;
- $tmp .=
+ $tmp .=
$output .= $tmp;
}
diff --git a/util/cbfstool/EXAMPLE b/util/cbfstool/EXAMPLE
index e4e198e355..0f7aea6773 100644
--- a/util/cbfstool/EXAMPLE
+++ b/util/cbfstool/EXAMPLE
@@ -1,4 +1,4 @@
- rm coreboot.rom;
+ rm coreboot.rom;
./cbfstool coreboot.rom create 0x80000 0x10000 /tmp/coreboot.strip
./cbfstool coreboot.rom add-payload /tmp/filo.elf normal/payload l
./cbfstool coreboot.rom print
diff --git a/util/cbfstool/Makefile b/util/cbfstool/Makefile
index d74c44ee5d..843e677503 100644
--- a/util/cbfstool/Makefile
+++ b/util/cbfstool/Makefile
@@ -41,7 +41,7 @@ all: $(BINARY)
clean:
rm -f $(COMMON) $(BINARY)
-tags:
+tags:
ctags *.[ch]
CXXFLAGS=-DCOMPACT -g
diff --git a/util/cbfstool/cbfs.h b/util/cbfstool/cbfs.h
index 9661bbd2c9..0d33710229 100644
--- a/util/cbfstool/cbfs.h
+++ b/util/cbfstool/cbfs.h
@@ -79,12 +79,12 @@ struct cbfs_payload {
/* The deleted type is chosen to be a value
* that can be written in a FLASH from all other
- * values.
+ * values.
*/
#define CBFS_COMPONENT_DELETED 0
-/* for all known FLASH, this value can be changed
- * to all other values. This allows NULL files to be
+/* for all known FLASH, this value can be changed
+ * to all other values. This allows NULL files to be
* changed without a block erase
*/
#define CBFS_COMPONENT_NULL 0xFFFFFFFF
diff --git a/util/cbfstool/common.c b/util/cbfstool/common.c
index 30d52816b1..b071864b5c 100644
--- a/util/cbfstool/common.c
+++ b/util/cbfstool/common.c
@@ -183,10 +183,10 @@ void print_cbfs_directory(const char *filename)
(struct cbfs_file *)phys_to_virt(current);
uint32_t length = ntohl(thisfile->len);
char *fname = (char *)(phys_to_virt(current) + sizeof(struct cbfs_file));
- if (strlen(fname) == 0)
+ if (strlen(fname) == 0)
fname = "(empty)";
- printf("%-30s 0x%-8x %-12s %d\n", fname,
+ printf("%-30s 0x%-8x %-12s %d\n", fname,
current - phys_start, strfiletype(ntohl(thisfile->type)),
length);
current =
diff --git a/util/cbfstool/lzma/C/7zip/Common/InBuffer.h b/util/cbfstool/lzma/C/7zip/Common/InBuffer.h
index 057caa1659..bfa4bc968b 100644
--- a/util/cbfstool/lzma/C/7zip/Common/InBuffer.h
+++ b/util/cbfstool/lzma/C/7zip/Common/InBuffer.h
@@ -38,7 +38,7 @@ public:
bool Create(UInt32 bufferSize);
void Free();
-
+
void SetStream(ISequentialInStream *stream);
void Init();
void ReleaseStream() { _stream.Release(); }
diff --git a/util/cbfstool/lzma/C/7zip/Common/OutBuffer.cpp b/util/cbfstool/lzma/C/7zip/Common/OutBuffer.cpp
index a73fa7c5b9..b4c8b7ee48 100644
--- a/util/cbfstool/lzma/C/7zip/Common/OutBuffer.cpp
+++ b/util/cbfstool/lzma/C/7zip/Common/OutBuffer.cpp
@@ -43,9 +43,9 @@ void COutBuffer::Init()
}
UInt64 COutBuffer::GetProcessedSize() const
-{
+{
UInt64 res = _processedSize + _pos - _streamPos;
- if (_streamPos > _pos)
+ if (_streamPos > _pos)
res += _bufferSize;
return res;
}
diff --git a/util/cbfstool/lzma/C/7zip/Common/OutBuffer.h b/util/cbfstool/lzma/C/7zip/Common/OutBuffer.h
index 0ce54e21e6..659368be30 100644
--- a/util/cbfstool/lzma/C/7zip/Common/OutBuffer.h
+++ b/util/cbfstool/lzma/C/7zip/Common/OutBuffer.h
@@ -36,7 +36,7 @@ public:
COutBuffer(): _buffer(0), _pos(0), _stream(0), _buffer2(0) {}
~COutBuffer() { Free(); }
-
+
bool Create(UInt32 bufferSize);
void Free();
diff --git a/util/cbfstool/lzma/C/7zip/Common/StdAfx.h b/util/cbfstool/lzma/C/7zip/Common/StdAfx.h
index 27a77b104b..ef555ec12a 100644
--- a/util/cbfstool/lzma/C/7zip/Common/StdAfx.h
+++ b/util/cbfstool/lzma/C/7zip/Common/StdAfx.h
@@ -6,4 +6,4 @@
#include "../../Common/MyWindows.h"
#include "../../Common/NewHandler.h"
-#endif
+#endif
diff --git a/util/cbfstool/lzma/C/7zip/Common/StreamUtils.cpp b/util/cbfstool/lzma/C/7zip/Common/StreamUtils.cpp
index a5d9ac0ef0..f5d2da5b55 100644
--- a/util/cbfstool/lzma/C/7zip/Common/StreamUtils.cpp
+++ b/util/cbfstool/lzma/C/7zip/Common/StreamUtils.cpp
@@ -11,7 +11,7 @@ HRESULT ReadStream(ISequentialInStream *stream, void *data, UInt32 size, UInt32
*processedSize = 0;
while(size != 0)
{
- UInt32 processedSizeLoc;
+ UInt32 processedSizeLoc;
HRESULT res = stream->Read(data, size, &processedSizeLoc);
if (processedSize != 0)
*processedSize += processedSizeLoc;
@@ -30,7 +30,7 @@ HRESULT WriteStream(ISequentialOutStream *stream, const void *data, UInt32 size,
*processedSize = 0;
while(size != 0)
{
- UInt32 processedSizeLoc;
+ UInt32 processedSizeLoc;
HRESULT res = stream->Write(data, size, &processedSizeLoc);
if (processedSize != 0)
*processedSize += processedSizeLoc;
diff --git a/util/cbfstool/lzma/C/7zip/Compress/LZ/BinTree/BinTree.h b/util/cbfstool/lzma/C/7zip/Compress/LZ/BinTree/BinTree.h
index b3b3f13a56..243d5a3888 100644
--- a/util/cbfstool/lzma/C/7zip/Compress/LZ/BinTree/BinTree.h
+++ b/util/cbfstool/lzma/C/7zip/Compress/LZ/BinTree/BinTree.h
@@ -2,13 +2,13 @@
#include "../LZInWindow.h"
#include "../IMatchFinder.h"
-
+
namespace BT_NAMESPACE {
typedef UInt32 CIndex;
const UInt32 kMaxValForNormalize = (UInt32(1) << 31) - 1;
-class CMatchFinder:
+class CMatchFinder:
public IMatchFinder,
public CLZInWindow,
public CMyUnknownImp,
@@ -40,7 +40,7 @@ class CMatchFinder:
STDMETHOD_(Int32, NeedChangeBufferPos)(UInt32 numCheckBytes);
STDMETHOD_(void, ChangeBufferPos)();
- STDMETHOD(Create)(UInt32 historySize, UInt32 keepAddBufferBefore,
+ STDMETHOD(Create)(UInt32 historySize, UInt32 keepAddBufferBefore,
UInt32 matchMaxLen, UInt32 keepAddBufferAfter);
STDMETHOD(GetMatches)(UInt32 *distances);
STDMETHOD(Skip)(UInt32 num);
diff --git a/util/cbfstool/lzma/C/7zip/Compress/LZ/BinTree/BinTreeMain.h b/util/cbfstool/lzma/C/7zip/Compress/LZ/BinTree/BinTreeMain.h
index 7a6f621a06..d47a03de90 100644
--- a/util/cbfstool/lzma/C/7zip/Compress/LZ/BinTree/BinTreeMain.h
+++ b/util/cbfstool/lzma/C/7zip/Compress/LZ/BinTree/BinTreeMain.h
@@ -25,7 +25,7 @@ namespace BT_NAMESPACE {
static const UInt32 kMinMatchCheck = kNumHashBytes;
static const UInt32 kStartMaxLen = 1;
#else
- #ifdef HASH_ZIP
+ #ifdef HASH_ZIP
#define kNumHashDirectBytes 0
static const UInt32 kNumHashBytes = 3;
static const UInt32 kHashSize = 1 << 16;
@@ -73,11 +73,11 @@ void CMatchFinder::FreeMemory()
}
CMatchFinder::~CMatchFinder()
-{
+{
FreeMemory();
}
-STDMETHODIMP CMatchFinder::Create(UInt32 historySize, UInt32 keepAddBufferBefore,
+STDMETHODIMP CMatchFinder::Create(UInt32 historySize, UInt32 keepAddBufferBefore,
UInt32 matchMaxLen, UInt32 keepAddBufferAfter)
{
if (historySize > kMaxValForNormalize - 256)
@@ -85,15 +85,15 @@ STDMETHODIMP CMatchFinder::Create(UInt32 historySize, UInt32 keepAddBufferBefore
FreeMemory();
return E_INVALIDARG;
}
- _cutValue =
+ _cutValue =
#ifdef _HASH_CHAIN
8 + (matchMaxLen >> 2);
#else
16 + (matchMaxLen >> 1);
#endif
- UInt32 sizeReserv = (historySize + keepAddBufferBefore +
+ UInt32 sizeReserv = (historySize + keepAddBufferBefore +
matchMaxLen + keepAddBufferAfter) / 2 + 256;
- if (CLZInWindow::Create(historySize + keepAddBufferBefore,
+ if (CLZInWindow::Create(historySize + keepAddBufferBefore,
matchMaxLen + keepAddBufferAfter, sizeReserv))
{
_matchMaxLen = matchMaxLen;
@@ -161,8 +161,8 @@ STDMETHODIMP CMatchFinder::Init()
}
STDMETHODIMP_(void) CMatchFinder::ReleaseStream()
-{
- // ReleaseStream();
+{
+ // ReleaseStream();
}
#ifdef HASH_ARRAY_2
@@ -173,7 +173,7 @@ STDMETHODIMP_(void) CMatchFinder::ReleaseStream()
hash2Value = temp & (kHash2Size - 1); \
hash3Value = (temp ^ (UInt32(cur[2]) << 8)) & (kHash3Size - 1); \
hashValue = (temp ^ (UInt32(cur[2]) << 8) ^ (CCRC::Table[cur[3]] << 5)) & _hashMask; }
-
+
#else // no HASH_ARRAY_3
#define HASH_CALC { \
UInt32 temp = CCRC::Table[cur[0]] ^ cur[1]; \
@@ -181,12 +181,12 @@ STDMETHODIMP_(void) CMatchFinder::ReleaseStream()
hashValue = (temp ^ (UInt32(cur[2]) << 8)) & _hashMask; }
#endif // HASH_ARRAY_3
#else // no HASH_ARRAY_2
-#ifdef HASH_ZIP
+#ifdef HASH_ZIP
inline UInt32 Hash(const Byte *pointer)
{
return ((UInt32(pointer[0]) << 8) ^ CCRC::Table[pointer[1]] ^ pointer[2]) & (kHashSize - 1);
}
-#else // no HASH_ZIP
+#else // no HASH_ZIP
inline UInt32 Hash(const Byte *pointer)
{
return pointer[0] ^ (UInt32(pointer[1]) << 8);
@@ -205,7 +205,7 @@ STDMETHODIMP CMatchFinder::GetMatches(UInt32 *distances)
if(lenLimit < kMinMatchCheck)
{
distances[0] = 0;
- return MovePos();
+ return MovePos();
}
}
@@ -298,17 +298,17 @@ STDMETHODIMP CMatchFinder::GetMatches(UInt32 *distances)
UInt32 cyclicPos = (delta <= _cyclicBufferPos) ?
(_cyclicBufferPos - delta):
(_cyclicBufferPos - delta + _cyclicBufferSize);
- CIndex *pair = son +
+ CIndex *pair = son +
#ifdef _HASH_CHAIN
cyclicPos;
#else
(cyclicPos << 1);
#endif
-
+
// _mm_prefetch((const char *)pair, _MM_HINT_T0);
-
+
const Byte *pb = _buffer + curMatch;
- UInt32 len =
+ UInt32 len =
#ifdef _HASH_CHAIN
kNumHashDirectBytes;
if (pb[maxLen] == cur[maxLen])
@@ -369,7 +369,7 @@ STDMETHODIMP CMatchFinder::Skip(UInt32 num)
#ifdef _HASH_CHAIN
if (_streamPos - _pos < kNumHashBytes)
{
- RINOK(MovePos());
+ RINOK(MovePos());
continue;
}
#else
@@ -425,18 +425,18 @@ STDMETHODIMP CMatchFinder::Skip(UInt32 num)
*ptr0 = *ptr1 = kEmptyHashValue;
break;
}
-
+
UInt32 delta = _pos - curMatch;
UInt32 cyclicPos = (delta <= _cyclicBufferPos) ?
(_cyclicBufferPos - delta):
(_cyclicBufferPos - delta + _cyclicBufferSize);
CIndex *pair = son + (cyclicPos << 1);
-
+
// _mm_prefetch((const char *)pair, _MM_HINT_T0);
-
+
const Byte *pb = _buffer + curMatch;
UInt32 len = MyMin(len0, len1);
-
+
if (pb[len] == cur[len])
{
while(++len != lenLimit)
@@ -479,7 +479,7 @@ void CMatchFinder::Normalize()
{
UInt32 subValue = _pos - _cyclicBufferSize;
CIndex *items = _hash;
- UInt32 numItems = (_hashSizeSum + _cyclicBufferSize
+ UInt32 numItems = (_hashSizeSum + _cyclicBufferSize
#ifndef _HASH_CHAIN
* 2
#endif
@@ -509,7 +509,7 @@ HRESULT CMatchFinder::MovePos()
STDMETHODIMP_(Byte) CMatchFinder::GetIndexByte(Int32 index)
{ return CLZInWindow::GetIndexByte(index); }
-STDMETHODIMP_(UInt32) CMatchFinder::GetMatchLen(Int32 index,
+STDMETHODIMP_(UInt32) CMatchFinder::GetMatchLen(Int32 index,
UInt32 back, UInt32 limit)
{ return CLZInWindow::GetMatchLen(index, back, limit); }
@@ -527,5 +527,5 @@ STDMETHODIMP_(void) CMatchFinder::ChangeBufferPos()
#undef HASH_CALC
#undef kNumHashDirectBytes
-
+
}
diff --git a/util/cbfstool/lzma/C/7zip/Compress/LZ/IMatchFinder.h b/util/cbfstool/lzma/C/7zip/Compress/LZ/IMatchFinder.h
index 8b8480b2d2..53b9c1ecc5 100644
--- a/util/cbfstool/lzma/C/7zip/Compress/LZ/IMatchFinder.h
+++ b/util/cbfstool/lzma/C/7zip/Compress/LZ/IMatchFinder.h
@@ -15,10 +15,10 @@ struct IInWindowStream: public IUnknown
STDMETHOD_(Int32, NeedChangeBufferPos)(UInt32 numCheckBytes) PURE;
STDMETHOD_(void, ChangeBufferPos)() PURE;
};
-
+
struct IMatchFinder: public IInWindowStream
{
- STDMETHOD(Create)(UInt32 historySize, UInt32 keepAddBufferBefore,
+ STDMETHOD(Create)(UInt32 historySize, UInt32 keepAddBufferBefore,
UInt32 matchMaxLen, UInt32 keepAddBufferAfter) PURE;
STDMETHOD(GetMatches)(UInt32 *distances) PURE;
STDMETHOD(Skip)(UInt32 num) PURE;
diff --git a/util/cbfstool/lzma/C/7zip/Compress/LZ/LZInWindow.cpp b/util/cbfstool/lzma/C/7zip/Compress/LZ/LZInWindow.cpp
index 0e65c4254b..c4d331e933 100644
--- a/util/cbfstool/lzma/C/7zip/Compress/LZ/LZInWindow.cpp
+++ b/util/cbfstool/lzma/C/7zip/Compress/LZ/LZInWindow.cpp
@@ -62,8 +62,8 @@ void CLZInWindow::ReleaseStream()
// _streamPos >= _pos + _keepSizeAfter
// _posLimit = _streamPos - _keepSizeAfter;
// else
-//
-
+//
+
HRESULT CLZInWindow::ReadBlock()
{
if(_streamEndWasReached)
@@ -98,7 +98,7 @@ void CLZInWindow::MoveBlock()
UInt32 offset = (UInt32)(_buffer - _bufferBase) + _pos - _keepSizeBefore;
// we need one additional byte, since MovePos moves on 1 byte.
if (offset > 0)
- offset--;
+ offset--;
UInt32 numBytes = (UInt32)(_buffer - _bufferBase) + _streamPos - offset;
memmove(_bufferBase, _bufferBase + offset, numBytes);
_buffer -= offset;
diff --git a/util/cbfstool/lzma/C/7zip/Compress/LZ/LZInWindow.h b/util/cbfstool/lzma/C/7zip/Compress/LZ/LZInWindow.h
index 54f2cb7bba..670a570378 100644
--- a/util/cbfstool/lzma/C/7zip/Compress/LZ/LZInWindow.h
+++ b/util/cbfstool/lzma/C/7zip/Compress/LZ/LZInWindow.h
@@ -56,7 +56,7 @@ public:
// index + limit have not to exceed _keepSizeAfter;
// -2G <= index < 2G
UInt32 GetMatchLen(Int32 index, UInt32 distance, UInt32 limit) const
- {
+ {
if(_streamEndWasReached)
if ((_pos + index) + limit > _streamPos)
limit = _streamPos - (_pos + index);
diff --git a/util/cbfstool/lzma/C/7zip/Compress/LZ/StdAfx.h b/util/cbfstool/lzma/C/7zip/Compress/LZ/StdAfx.h
index 3ff6d8a29f..b637fd4007 100644
--- a/util/cbfstool/lzma/C/7zip/Compress/LZ/StdAfx.h
+++ b/util/cbfstool/lzma/C/7zip/Compress/LZ/StdAfx.h
@@ -3,4 +3,4 @@
#ifndef __STDAFX_H
#define __STDAFX_H
-#endif
+#endif
diff --git a/util/cbfstool/lzma/C/7zip/Compress/LZMA/LZMA.h b/util/cbfstool/lzma/C/7zip/Compress/LZMA/LZMA.h
index 7bc4c438af..e262aa2af2 100644
--- a/util/cbfstool/lzma/C/7zip/Compress/LZMA/LZMA.h
+++ b/util/cbfstool/lzma/C/7zip/Compress/LZMA/LZMA.h
@@ -27,10 +27,10 @@ public:
bool IsCharState() const { return Index < 7; }
};
-const int kNumPosSlotBits = 6;
-const int kDicLogSizeMin = 0;
-const int kDicLogSizeMax = 32;
-const int kDistTableSizeMax = kDicLogSizeMax * 2;
+const int kNumPosSlotBits = 6;
+const int kDicLogSizeMin = 0;
+const int kDicLogSizeMax = 32;
+const int kDistTableSizeMax = kDicLogSizeMax * 2;
const UInt32 kNumLenToPosStates = 4;
diff --git a/util/cbfstool/lzma/C/7zip/Compress/LZMA/LZMAEncoder.cpp b/util/cbfstool/lzma/C/7zip/Compress/LZMA/LZMAEncoder.cpp
index 8d8f0a004c..1fff04aac8 100644
--- a/util/cbfstool/lzma/C/7zip/Compress/LZMA/LZMAEncoder.cpp
+++ b/util/cbfstool/lzma/C/7zip/Compress/LZMA/LZMAEncoder.cpp
@@ -47,7 +47,7 @@ namespace NLZMA {
const int kDefaultDictionaryLogSize = 22;
const UInt32 kNumFastBytesDefault = 0x20;
-enum
+enum
{
kBT2,
kBT3,
@@ -55,7 +55,7 @@ enum
kHC4
};
-static const wchar_t *kMatchFinderIDs[] =
+static const wchar_t *kMatchFinderIDs[] =
{
L"BT2",
L"BT3",
@@ -90,7 +90,7 @@ void CLiteralEncoder2::Encode(NRangeCoder::CEncoder *rangeEncoder, Byte symbol)
{
UInt32 context = 1;
int i = 8;
- do
+ do
{
i--;
UInt32 bit = (symbol >> i) & 1;
@@ -100,12 +100,12 @@ void CLiteralEncoder2::Encode(NRangeCoder::CEncoder *rangeEncoder, Byte symbol)
while(i != 0);
}
-void CLiteralEncoder2::EncodeMatched(NRangeCoder::CEncoder *rangeEncoder,
+void CLiteralEncoder2::EncodeMatched(NRangeCoder::CEncoder *rangeEncoder,
Byte matchByte, Byte symbol)
{
UInt32 context = 1;
int i = 8;
- do
+ do
{
i--;
UInt32 bit = (symbol >> i) & 1;
@@ -134,7 +134,7 @@ UInt32 CLiteralEncoder2::GetPrice(bool matchMode, Byte matchByte, Byte symbol) c
int i = 8;
if (matchMode)
{
- do
+ do
{
i--;
UInt32 matchBit = (matchByte >> i) & 1;
@@ -277,7 +277,7 @@ HRESULT CEncoder::Create()
}
#endif
#endif
-
+
#ifdef COMPRESS_MF_HC
case kHC4:
{
@@ -304,7 +304,7 @@ HRESULT CEncoder::Create()
}
#endif
}
-
+
if (!_literalEncoder.Create(_numLiteralPosStateBits, _numLiteralContextBits))
return E_OUTOFMEMORY;
@@ -342,7 +342,7 @@ static int FindMatchFinder(const wchar_t *s)
return -1;
}
-STDMETHODIMP CEncoder::SetCoderProperties(const PROPID *propIDs,
+STDMETHODIMP CEncoder::SetCoderProperties(const PROPID *propIDs,
const PROPVARIANT *properties, UInt32 numProperties)
{
for (UInt32 i = 0; i < numProperties; i++)
@@ -372,7 +372,7 @@ STDMETHODIMP CEncoder::SetCoderProperties(const PROPID *propIDs,
if (prop.vt != VT_UI4)
return E_INVALIDARG;
UInt32 maximize = prop.ulVal;
- _fastMode = (maximize == 0);
+ _fastMode = (maximize == 0);
// _maxMode = (maximize >= 2);
break;
}
@@ -483,7 +483,7 @@ STDMETHODIMP CEncoder::SetCoderProperties(const PROPID *propIDs,
}
STDMETHODIMP CEncoder::WriteCoderProperties(ISequentialOutStream *outStream)
-{
+{
const UInt32 kPropSize = 5;
Byte properties[kPropSize];
properties[0] = (_posStateBits * 5 + _numLiteralPosStateBits) * 9 + _numLiteralContextBits;
@@ -587,7 +587,7 @@ UInt32 CEncoder::Backward(UInt32 &backRes, UInt32 cur)
while(cur != 0);
backRes = _optimum[0].BackPrev;
_optimumCurrentIndex = _optimum[0].PosPrev;
- return _optimumCurrentIndex;
+ return _optimumCurrentIndex;
}
/*
@@ -606,7 +606,7 @@ HRESULT CEncoder::GetOptimum(UInt32 position, UInt32 &backRes, UInt32 &lenRes)
return S_OK;
}
_optimumCurrentIndex = _optimumEndIndex = 0;
-
+
UInt32 lenMain, numDistancePairs;
if (!_longestMatchWasFound)
{
@@ -644,7 +644,7 @@ HRESULT CEncoder::GetOptimum(UInt32 position, UInt32 &backRes, UInt32 &lenRes)
continue;
}
UInt32 lenTest;
- for (lenTest = 2; lenTest < numAvailableBytes &&
+ for (lenTest = 2; lenTest < numAvailableBytes &&
data[lenTest] == data[(size_t)lenTest - backOffset]; lenTest++);
repLens[i] = lenTest;
if (lenTest > repLens[repMaxIndex])
@@ -660,7 +660,7 @@ HRESULT CEncoder::GetOptimum(UInt32 position, UInt32 &backRes, UInt32 &lenRes)
UInt32 *matchDistances = _matchDistances + 1;
if(lenMain >= _numFastBytes)
{
- backRes = matchDistances[numDistancePairs - 1] + kNumRepDistances;
+ backRes = matchDistances[numDistancePairs - 1] + kNumRepDistances;
lenRes = lenMain;
return MovePos(lenMain - 1);
}
@@ -678,7 +678,7 @@ HRESULT CEncoder::GetOptimum(UInt32 position, UInt32 &backRes, UInt32 &lenRes)
UInt32 posState = (position & _posStateMask);
- _optimum[1].Price = _isMatch[_state.Index][posState].GetPrice0() +
+ _optimum[1].Price = _isMatch[_state.Index][posState].GetPrice0() +
_literalEncoder.GetSubCoder(position, _previousByte)->GetPrice(!_state.IsCharState(), matchByte, currentByte);
_optimum[1].MakeAsChar();
@@ -722,7 +722,7 @@ HRESULT CEncoder::GetOptimum(UInt32 position, UInt32 &backRes, UInt32 &lenRes)
{
UInt32 curAndLenPrice = price + _repMatchLenEncoder.GetPrice(repLen - 2, posState);
COptimal &optimum = _optimum[repLen];
- if (curAndLenPrice < optimum.Price)
+ if (curAndLenPrice < optimum.Price)
{
optimum.Price = curAndLenPrice;
optimum.PosPrev = 0;
@@ -746,7 +746,7 @@ HRESULT CEncoder::GetOptimum(UInt32 position, UInt32 &backRes, UInt32 &lenRes)
UInt32 distance = matchDistances[offs + 1];
UInt32 curAndLenPrice = normalMatchPrice + GetPosLenPrice(distance, len, posState);
COptimal &optimum = _optimum[len];
- if (curAndLenPrice < optimum.Price)
+ if (curAndLenPrice < optimum.Price)
{
optimum.Price = curAndLenPrice;
optimum.PosPrev = 0;
@@ -847,7 +847,7 @@ HRESULT CEncoder::GetOptimum(UInt32 position, UInt32 &backRes, UInt32 &lenRes)
curOptimum.State = state;
for(UInt32 i = 0; i < kNumRepDistances; i++)
curOptimum.Backs[i] = reps[i];
- UInt32 curPrice = curOptimum.Price;
+ UInt32 curPrice = curOptimum.Price;
const Byte *data = _matchFinder->GetPointerToCurrentPos() - 1;
const Byte currentByte = *data;
const Byte matchByte = data[(size_t)0 - reps[0] - 1];
@@ -861,7 +861,7 @@ HRESULT CEncoder::GetOptimum(UInt32 position, UInt32 &backRes, UInt32 &lenRes)
COptimal &nextOptimum = _optimum[cur + 1];
bool nextIsChar = false;
- if (curAnd1Price < nextOptimum.Price)
+ if (curAnd1Price < nextOptimum.Price)
{
nextOptimum.Price = curAnd1Price;
nextOptimum.PosPrev = cur;
@@ -871,7 +871,7 @@ HRESULT CEncoder::GetOptimum(UInt32 position, UInt32 &backRes, UInt32 &lenRes)
UInt32 matchPrice = curPrice + _isMatch[state.Index][posState].GetPrice1();
UInt32 repMatchPrice = matchPrice + _isRep[state.Index].GetPrice1();
-
+
if(matchByte == currentByte &&
!(nextOptimum.PosPrev < cur && nextOptimum.BackPrev == 0))
{
@@ -903,7 +903,7 @@ HRESULT CEncoder::GetOptimum(UInt32 position, UInt32 &backRes, UInt32 &lenRes)
UInt32 backOffset = reps[0] + 1;
UInt32 limit = MyMin(numAvailableBytesFull, _numFastBytes + 1);
UInt32 temp;
- for (temp = 1; temp < limit &&
+ for (temp = 1; temp < limit &&
data[temp] == data[(size_t)temp - backOffset]; temp++);
UInt32 lenTest2 = temp - 1;
if (lenTest2 >= 2)
@@ -911,7 +911,7 @@ HRESULT CEncoder::GetOptimum(UInt32 position, UInt32 &backRes, UInt32 &lenRes)
CState state2 = state;
state2.UpdateChar();
UInt32 posStateNext = (position + 1) & _posStateMask;
- UInt32 nextRepMatchPrice = curAnd1Price +
+ UInt32 nextRepMatchPrice = curAnd1Price +
_isMatch[state2.Index][posStateNext].GetPrice1() +
_isRep[state2.Index].GetPrice1();
// for (; lenTest2 >= 2; lenTest2--)
@@ -922,7 +922,7 @@ HRESULT CEncoder::GetOptimum(UInt32 position, UInt32 &backRes, UInt32 &lenRes)
UInt32 curAndLenPrice = nextRepMatchPrice + GetRepPrice(
0, lenTest2, state2, posStateNext);
COptimal &optimum = _optimum[offset];
- if (curAndLenPrice < optimum.Price)
+ if (curAndLenPrice < optimum.Price)
{
optimum.Price = curAndLenPrice;
optimum.PosPrev = cur + 1;
@@ -933,8 +933,8 @@ HRESULT CEncoder::GetOptimum(UInt32 position, UInt32 &backRes, UInt32 &lenRes)
}
}
}
-
- UInt32 startLen = 2; // speed optimization
+
+ UInt32 startLen = 2; // speed optimization
for(UInt32 repIndex = 0; repIndex < kNumRepDistances; repIndex++)
{
// UInt32 repLen = _matchFinder->GetMatchLen(0 - 1, reps[repIndex], newLen); // test it;
@@ -943,7 +943,7 @@ HRESULT CEncoder::GetOptimum(UInt32 position, UInt32 &backRes, UInt32 &lenRes)
data[1] != data[(size_t)1 - backOffset])
continue;
UInt32 lenTest;
- for (lenTest = 2; lenTest < numAvailableBytes &&
+ for (lenTest = 2; lenTest < numAvailableBytes &&
data[lenTest] == data[(size_t)lenTest - backOffset]; lenTest++);
while(lenEnd < cur + lenTest)
_optimum[++lenEnd].Price = kIfinityPrice;
@@ -953,7 +953,7 @@ HRESULT CEncoder::GetOptimum(UInt32 position, UInt32 &backRes, UInt32 &lenRes)
{
UInt32 curAndLenPrice = price + _repMatchLenEncoder.GetPrice(lenTest - 2, posState);
COptimal &optimum = _optimum[cur + lenTest];
- if (curAndLenPrice < optimum.Price)
+ if (curAndLenPrice < optimum.Price)
{
optimum.Price = curAndLenPrice;
optimum.PosPrev = cur;
@@ -963,15 +963,15 @@ HRESULT CEncoder::GetOptimum(UInt32 position, UInt32 &backRes, UInt32 &lenRes)
}
while(--lenTest >= 2);
lenTest = lenTestTemp;
-
+
if (repIndex == 0)
startLen = lenTest + 1;
-
+
// if (_maxMode)
{
UInt32 lenTest2 = lenTest + 1;
UInt32 limit = MyMin(numAvailableBytesFull, lenTest2 + _numFastBytes);
- for (; lenTest2 < limit &&
+ for (; lenTest2 < limit &&
data[lenTest2] == data[(size_t)lenTest2 - backOffset]; lenTest2++);
lenTest2 -= lenTest + 1;
if (lenTest2 >= 2)
@@ -979,17 +979,17 @@ HRESULT CEncoder::GetOptimum(UInt32 position, UInt32 &backRes, UInt32 &lenRes)
CState state2 = state;
state2.UpdateRep();
UInt32 posStateNext = (position + lenTest) & _posStateMask;
- UInt32 curAndLenCharPrice =
- price + _repMatchLenEncoder.GetPrice(lenTest - 2, posState) +
+ UInt32 curAndLenCharPrice =
+ price + _repMatchLenEncoder.GetPrice(lenTest - 2, posState) +
_isMatch[state2.Index][posStateNext].GetPrice0() +
_literalEncoder.GetSubCoder(position + lenTest, data[(size_t)lenTest - 1])->GetPrice(
true, data[(size_t)lenTest - backOffset], data[lenTest]);
state2.UpdateChar();
posStateNext = (position + lenTest + 1) & _posStateMask;
- UInt32 nextRepMatchPrice = curAndLenCharPrice +
+ UInt32 nextRepMatchPrice = curAndLenCharPrice +
_isMatch[state2.Index][posStateNext].GetPrice1() +
_isRep[state2.Index].GetPrice1();
-
+
// for(; lenTest2 >= 2; lenTest2--)
{
UInt32 offset = cur + lenTest + 1 + lenTest2;
@@ -998,7 +998,7 @@ HRESULT CEncoder::GetOptimum(UInt32 position, UInt32 &backRes, UInt32 &lenRes)
UInt32 curAndLenPrice = nextRepMatchPrice + GetRepPrice(
0, lenTest2, state2, posStateNext);
COptimal &optimum = _optimum[offset];
- if (curAndLenPrice < optimum.Price)
+ if (curAndLenPrice < optimum.Price)
{
optimum.Price = curAndLenPrice;
optimum.PosPrev = cur + lenTest + 1;
@@ -1012,7 +1012,7 @@ HRESULT CEncoder::GetOptimum(UInt32 position, UInt32 &backRes, UInt32 &lenRes)
}
}
}
-
+
// for(UInt32 lenTest = 2; lenTest <= newLen; lenTest++)
if (newLen > numAvailableBytes)
{
@@ -1040,11 +1040,11 @@ HRESULT CEncoder::GetOptimum(UInt32 position, UInt32 &backRes, UInt32 &lenRes)
curAndLenPrice += _distancesPrices[lenToPosState][curBack];
else
curAndLenPrice += _posSlotPrices[lenToPosState][posSlot] + _alignPrices[curBack & kAlignMask];
-
+
curAndLenPrice += _lenEncoder.GetPrice(lenTest - kMatchMinLen, posState);
-
+
COptimal &optimum = _optimum[cur + lenTest];
- if (curAndLenPrice < optimum.Price)
+ if (curAndLenPrice < optimum.Price)
{
optimum.Price = curAndLenPrice;
optimum.PosPrev = cur;
@@ -1058,7 +1058,7 @@ HRESULT CEncoder::GetOptimum(UInt32 position, UInt32 &backRes, UInt32 &lenRes)
UInt32 backOffset = curBack + 1;
UInt32 lenTest2 = lenTest + 1;
UInt32 limit = MyMin(numAvailableBytesFull, lenTest2 + _numFastBytes);
- for (; lenTest2 < limit &&
+ for (; lenTest2 < limit &&
data[lenTest2] == data[(size_t)lenTest2 - backOffset]; lenTest2++);
lenTest2 -= lenTest + 1;
if (lenTest2 >= 2)
@@ -1066,16 +1066,16 @@ HRESULT CEncoder::GetOptimum(UInt32 position, UInt32 &backRes, UInt32 &lenRes)
CState state2 = state;
state2.UpdateMatch();
UInt32 posStateNext = (position + lenTest) & _posStateMask;
- UInt32 curAndLenCharPrice = curAndLenPrice +
+ UInt32 curAndLenCharPrice = curAndLenPrice +
_isMatch[state2.Index][posStateNext].GetPrice0() +
- _literalEncoder.GetSubCoder(position + lenTest, data[(size_t)lenTest - 1])->GetPrice(
+ _literalEncoder.GetSubCoder(position + lenTest, data[(size_t)lenTest - 1])->GetPrice(
true, data[(size_t)lenTest - backOffset], data[lenTest]);
state2.UpdateChar();
posStateNext = (posStateNext + 1) & _posStateMask;
- UInt32 nextRepMatchPrice = curAndLenCharPrice +
+ UInt32 nextRepMatchPrice = curAndLenCharPrice +
_isMatch[state2.Index][posStateNext].GetPrice1() +
_isRep[state2.Index].GetPrice1();
-
+
// for(; lenTest2 >= 2; lenTest2--)
{
UInt32 offset = cur + lenTest + 1 + lenTest2;
@@ -1083,7 +1083,7 @@ HRESULT CEncoder::GetOptimum(UInt32 position, UInt32 &backRes, UInt32 &lenRes)
_optimum[++lenEnd].Price = kIfinityPrice;
UInt32 curAndLenPrice = nextRepMatchPrice + GetRepPrice(0, lenTest2, state2, posStateNext);
COptimal &optimum = _optimum[offset];
- if (curAndLenPrice < optimum.Price)
+ if (curAndLenPrice < optimum.Price)
{
optimum.Price = curAndLenPrice;
optimum.PosPrev = cur + lenTest + 1;
@@ -1122,7 +1122,7 @@ HRESULT CEncoder::ReadMatchDistances(UInt32 &lenRes, UInt32 &numDistancePairs)
{
lenRes = _matchDistances[1 + numDistancePairs - 2];
if (lenRes == _numFastBytes)
- lenRes += _matchFinder->GetMatchLen(lenRes - 1, _matchDistances[1 + numDistancePairs - 1],
+ lenRes += _matchFinder->GetMatchLen(lenRes - 1, _matchDistances[1 + numDistancePairs - 1],
kMatchMaxLen - lenRes);
}
_additionalOffset++;
@@ -1180,7 +1180,7 @@ HRESULT CEncoder::GetOptimumFast(UInt32 position, UInt32 &backRes, UInt32 &lenRe
UInt32 *matchDistances = _matchDistances + 1;
if(lenMain >= _numFastBytes)
{
- backRes = matchDistances[numDistancePairs - 1] + kNumRepDistances;
+ backRes = matchDistances[numDistancePairs - 1] + kNumRepDistances;
lenRes = lenMain;
return MovePos(lenMain - 1);
}
@@ -1203,7 +1203,7 @@ HRESULT CEncoder::GetOptimumFast(UInt32 position, UInt32 &backRes, UInt32 &lenRe
if (repLens[repMaxIndex] >= 2)
{
- if (repLens[repMaxIndex] + 1 >= lenMain ||
+ if (repLens[repMaxIndex] + 1 >= lenMain ||
repLens[repMaxIndex] + 2 >= lenMain && (backMain > (1 << 9)) ||
repLens[repMaxIndex] + 3 >= lenMain && (backMain > (1 << 15)))
{
@@ -1212,14 +1212,14 @@ HRESULT CEncoder::GetOptimumFast(UInt32 position, UInt32 &backRes, UInt32 &lenRe
return MovePos(lenRes - 1);
}
}
-
+
if (lenMain >= 2 && numAvailableBytes > 2)
{
RINOK(ReadMatchDistances(_longestMatchLength, _numDistancePairs));
if (_longestMatchLength >= 2)
{
UInt32 newDistance = matchDistances[_numDistancePairs - 1];
- if (_longestMatchLength >= lenMain && newDistance < backMain ||
+ if (_longestMatchLength >= lenMain && newDistance < backMain ||
_longestMatchLength == lenMain + 1 && !ChangePair(backMain, newDistance) ||
_longestMatchLength > lenMain + 1 ||
_longestMatchLength + 1 >= lenMain && lenMain >= 3 && ChangePair(newDistance, backMain))
@@ -1250,7 +1250,7 @@ HRESULT CEncoder::GetOptimumFast(UInt32 position, UInt32 &backRes, UInt32 &lenRe
return S_OK;
}
}
- backRes = backMain + kNumRepDistances;
+ backRes = backMain + kNumRepDistances;
lenRes = lenMain;
return MovePos(lenMain - 2);
}
@@ -1269,7 +1269,7 @@ HRESULT CEncoder::Flush(UInt32 nowPos)
void CEncoder::WriteEndMarker(UInt32 posState)
{
- // This function for writing End Mark for stream version of LZMA.
+ // This function for writing End Mark for stream version of LZMA.
// In current version this feature is not used.
if (!_writeEndMark)
return;
@@ -1289,7 +1289,7 @@ void CEncoder::WriteEndMarker(UInt32 posState)
}
HRESULT CEncoder::CodeReal(ISequentialInStream *inStream,
- ISequentialOutStream *outStream,
+ ISequentialOutStream *outStream,
const UInt64 *inSize, const UInt64 *outSize,
ICompressProgressInfo *progress)
{
@@ -1312,7 +1312,7 @@ HRESULT CEncoder::CodeReal(ISequentialInStream *inStream,
}
HRESULT CEncoder::SetStreams(ISequentialInStream *inStream,
- ISequentialOutStream *outStream,
+ ISequentialOutStream *outStream,
const UInt64 *inSize, const UInt64 *outSize)
{
_inStream = inStream;
@@ -1320,7 +1320,7 @@ HRESULT CEncoder::SetStreams(ISequentialInStream *inStream,
RINOK(Create());
RINOK(SetOutStream(outStream));
RINOK(Init());
-
+
// CCoderReleaser releaser(this);
/*
@@ -1455,7 +1455,7 @@ HRESULT CEncoder::CodeOneBlock(UInt64 *inSize, UInt64 *outSize, Int32 *finished)
pos -= kNumRepDistances;
UInt32 posSlot = GetPosSlot(pos);
_posSlotEncoder[GetLenToPosState(len)].Encode(&_rangeEncoder, posSlot);
-
+
if (posSlot >= kStartPosModelIndex)
{
UInt32 footerBits = ((posSlot >> 1) - 1);
@@ -1463,7 +1463,7 @@ HRESULT CEncoder::CodeOneBlock(UInt64 *inSize, UInt64 *outSize, Int32 *finished)
UInt32 posReduced = pos - base;
if (posSlot < kEndPosModelIndex)
- NRangeCoder::ReverseBitTreeEncode(_posEncoders + base - posSlot - 1,
+ NRangeCoder::ReverseBitTreeEncode(_posEncoders + base - posSlot - 1,
&_rangeEncoder, footerBits, posReduced);
else
{
@@ -1511,26 +1511,26 @@ STDMETHODIMP CEncoder::Code(ISequentialInStream *inStream,
ICompressProgressInfo *progress)
{
#ifndef _NO_EXCEPTIONS
- try
- {
+ try
+ {
#endif
- return CodeReal(inStream, outStream, inSize, outSize, progress);
+ return CodeReal(inStream, outStream, inSize, outSize, progress);
#ifndef _NO_EXCEPTIONS
}
catch(const COutBufferException &e) { return e.ErrorCode; }
catch(...) { return E_FAIL; }
#endif
}
-
+
void CEncoder::FillDistancesPrices()
{
UInt32 tempPrices[kNumFullDistances];
for (UInt32 i = kStartPosModelIndex; i < kNumFullDistances; i++)
- {
+ {
UInt32 posSlot = GetPosSlot(i);
UInt32 footerBits = ((posSlot >> 1) - 1);
UInt32 base = ((2 | (posSlot & 1)) << footerBits);
- tempPrices[i] = NRangeCoder::ReverseBitTreeGetPrice(_posEncoders +
+ tempPrices[i] = NRangeCoder::ReverseBitTreeGetPrice(_posEncoders +
base - posSlot - 1, footerBits, i - base);
}
diff --git a/util/cbfstool/lzma/C/7zip/Compress/LZMA/LZMAEncoder.h b/util/cbfstool/lzma/C/7zip/Compress/LZMA/LZMAEncoder.h
index f4c2c15131..2a41948495 100644
--- a/util/cbfstool/lzma/C/7zip/Compress/LZMA/LZMAEncoder.h
+++ b/util/cbfstool/lzma/C/7zip/Compress/LZMA/LZMAEncoder.h
@@ -39,11 +39,11 @@ struct COptimal
bool Prev2;
UInt32 PosPrev2;
- UInt32 BackPrev2;
+ UInt32 BackPrev2;
- UInt32 Price;
+ UInt32 Price;
UInt32 PosPrev; // posNext;
- UInt32 BackPrev;
+ UInt32 BackPrev;
UInt32 Backs[kNumRepDistances];
void MakeAsChar() { BackPrev = UInt32(-1); Prev1IsChar = false; }
void MakeAsShortRep() { BackPrev = 0; ; Prev1IsChar = false; }
@@ -99,7 +99,7 @@ public:
CLiteralEncoder(): _coders(0) {}
~CLiteralEncoder() { Free(); }
void Free()
- {
+ {
MyFree(_coders);
_coders = 0;
}
@@ -172,7 +172,7 @@ public:
}
-class CEncoder :
+class CEncoder :
public ICompressCoder,
public ICompressSetOutStream,
public ICompressSetCoderProperties,
@@ -195,7 +195,7 @@ class CEncoder :
CMyBitEncoder _posEncoders[kNumFullDistances - kEndPosModelIndex];
NRangeCoder::CBitTreeEncoder<kNumMoveBits, kNumAlignBits> _posAlignEncoder;
-
+
NLength::CPriceTableEncoder _lenEncoder;
NLength::CPriceTableEncoder _repMatchLenEncoder;
@@ -206,7 +206,7 @@ class CEncoder :
bool _fastMode;
// bool _maxMode;
UInt32 _numFastBytes;
- UInt32 _longestMatchLength;
+ UInt32 _longestMatchLength;
UInt32 _numDistancePairs;
UInt32 _additionalOffset;
@@ -217,7 +217,7 @@ class CEncoder :
bool _longestMatchWasFound;
UInt32 _posSlotPrices[kNumLenToPosStates][kDistTableSizeMax];
-
+
UInt32 _distancesPrices[kNumLenToPosStates][kNumFullDistances];
UInt32 _alignPrices[kAlignTableSize];
@@ -257,7 +257,7 @@ class CEncoder :
setMfPasses = 0;
_matchFinder.Release();
}
-
+
HRESULT ReadMatchDistances(UInt32 &len, UInt32 &numDistancePairs);
HRESULT MovePos(UInt32 num);
@@ -266,7 +266,7 @@ class CEncoder :
return _isRepG0[state.Index].GetPrice0() +
_isRep0Long[state.Index][posState].GetPrice0();
}
-
+
UInt32 GetPureRepPrice(UInt32 repIndex, CState state, UInt32 posState) const
{
UInt32 price;
@@ -307,7 +307,7 @@ class CEncoder :
if (pos < kNumFullDistances)
price = _distancesPrices[lenToPosState][pos];
else
- price = _posSlotPrices[lenToPosState][GetPosSlot2(pos)] +
+ price = _posSlotPrices[lenToPosState][GetPosSlot2(pos)] +
_alignPrices[pos & kAlignMask];
return price + _lenEncoder.GetPrice(len - kMatchMinLen, posState);
}
@@ -319,7 +319,7 @@ class CEncoder :
if (pos < kNumFullDistances)
price = _distancesPrices[lenToPosState][pos];
else
- price = _posSlotPrices[lenToPosState][GetPosSlot2(pos)] +
+ price = _posSlotPrices[lenToPosState][GetPosSlot2(pos)] +
_alignPrices[pos & kAlignMask];
return price + _lenEncoder.GetPrice(len - kMatchMinLen, posState);
}
@@ -330,7 +330,7 @@ class CEncoder :
void FillDistancesPrices();
void FillAlignPrices();
-
+
void ReleaseMFStream()
{
if (_matchFinder && _needReleaseMFStream)
@@ -373,9 +373,9 @@ public:
ICompressSetCoderProperties,
ICompressWriteCoderProperties
)
-
+
HRESULT Init();
-
+
// ICompressCoder interface
HRESULT SetStreams(ISequentialInStream *inStream,
ISequentialOutStream *outStream,
@@ -383,20 +383,20 @@ public:
HRESULT CodeOneBlock(UInt64 *inSize, UInt64 *outSize, Int32 *finished);
HRESULT CodeReal(ISequentialInStream *inStream,
- ISequentialOutStream *outStream,
+ ISequentialOutStream *outStream,
const UInt64 *inSize, const UInt64 *outSize,
ICompressProgressInfo *progress);
// ICompressCoder interface
STDMETHOD(Code)(ISequentialInStream *inStream,
- ISequentialOutStream *outStream,
+ ISequentialOutStream *outStream,
const UInt64 *inSize, const UInt64 *outSize,
ICompressProgressInfo *progress);
// ICompressSetCoderProperties2
- STDMETHOD(SetCoderProperties)(const PROPID *propIDs,
+ STDMETHOD(SetCoderProperties)(const PROPID *propIDs,
const PROPVARIANT *properties, UInt32 numProperties);
-
+
// ICompressWriteCoderProperties
STDMETHOD(WriteCoderProperties)(ISequentialOutStream *outStream);
diff --git a/util/cbfstool/lzma/C/7zip/Compress/RangeCoder/RangeCoder.h b/util/cbfstool/lzma/C/7zip/Compress/RangeCoder/RangeCoder.h
index bbb2ba82d3..d77442be45 100644
--- a/util/cbfstool/lzma/C/7zip/Compress/RangeCoder/RangeCoder.h
+++ b/util/cbfstool/lzma/C/7zip/Compress/RangeCoder/RangeCoder.h
@@ -34,7 +34,7 @@ public:
void FlushData()
{
- // Low += 1;
+ // Low += 1;
for(int i = 0; i < 5; i++)
ShiftLow();
}
@@ -56,7 +56,7 @@ public:
void ShiftLow()
{
- if ((UInt32)Low < (UInt32)0xFF000000 || (int)(Low >> 32) != 0)
+ if ((UInt32)Low < (UInt32)0xFF000000 || (int)(Low >> 32) != 0)
{
Byte temp = _cache;
do
@@ -65,12 +65,12 @@ public:
temp = 0xFF;
}
while(--_cacheSize != 0);
- _cache = (Byte)((UInt32)Low >> 24);
- }
- _cacheSize++;
- Low = (UInt32)Low << 8;
+ _cache = (Byte)((UInt32)Low >> 24);
+ }
+ _cacheSize++;
+ Low = (UInt32)Low << 8;
}
-
+
void EncodeDirectBits(UInt32 value, int numTotalBits)
{
for (int i = numTotalBits - 1; i >= 0; i--)
@@ -122,7 +122,7 @@ public:
Range <<= 8;
}
}
-
+
void SetStream(ISequentialInStream *stream) { Stream.SetStream(stream); }
void Init()
{
@@ -150,7 +150,7 @@ public:
UInt32 DecodeDirectBits(int numTotalBits)
{
UInt32 range = Range;
- UInt32 code = Code;
+ UInt32 code = Code;
UInt32 result = 0;
for (int i = numTotalBits; i != 0; i--)
{
@@ -170,7 +170,7 @@ public:
if (range < kTopValue)
{
code = (code << 8) | Stream.ReadByte();
- range <<= 8;
+ range <<= 8;
}
}
Range = range;
diff --git a/util/cbfstool/lzma/C/7zip/Compress/RangeCoder/RangeCoderBit.cpp b/util/cbfstool/lzma/C/7zip/Compress/RangeCoder/RangeCoderBit.cpp
index 8e4c4d3a9e..6c1c78e14e 100644
--- a/util/cbfstool/lzma/C/7zip/Compress/RangeCoder/RangeCoderBit.cpp
+++ b/util/cbfstool/lzma/C/7zip/Compress/RangeCoder/RangeCoderBit.cpp
@@ -20,7 +20,7 @@ void CPriceTables::Init()
UInt32 start = 1 << (kNumBits - i - 1);
UInt32 end = 1 << (kNumBits - i);
for (UInt32 j = start; j < end; j++)
- ProbPrices[j] = (i << kNumBitPriceShiftBits) +
+ ProbPrices[j] = (i << kNumBitPriceShiftBits) +
(((end - j) << kNumBitPriceShiftBits) >> (kNumBits - i - 1));
}
@@ -29,7 +29,7 @@ void CPriceTables::Init()
for(UInt32 i = 1; i < (kBitModelTotal >> kNumMoveReducingBits) - 1; i++)
ProbPrices[i] = kBitPrice;
*/
-
+
/*
const double kDummyMultMid = (1.0 / kBitPrice) / 2;
const double kDummyMultMid = 0;
@@ -39,7 +39,7 @@ void CPriceTables::Init()
for(UInt32 i = 1; i < (kBitModelTotal >> kNumMoveReducingBits) - 1; i++)
ProbPrices[i] = UInt32((fabs(lnAll - log(double(i))) / ln2 + kDummyMultMid) * kBitPrice);
*/
-
+
/*
// experimental, slow, solution:
for(UInt32 i = 1; i < (kBitModelTotal >> kNumMoveReducingBits) - 1; i++)
@@ -70,7 +70,7 @@ void CPriceTables::Init()
range -= (1 << 31);
}
}
- ProbPrices[i] = (bitCount
+ ProbPrices[i] = (bitCount
// + (1 << (kCyclesBits - 1))
) >> kCyclesBits;
}
diff --git a/util/cbfstool/lzma/C/7zip/Compress/RangeCoder/RangeCoderBitTree.h b/util/cbfstool/lzma/C/7zip/Compress/RangeCoder/RangeCoderBitTree.h
index 4f0c78b49d..461e2f049f 100644
--- a/util/cbfstool/lzma/C/7zip/Compress/RangeCoder/RangeCoderBitTree.h
+++ b/util/cbfstool/lzma/C/7zip/Compress/RangeCoder/RangeCoderBitTree.h
@@ -108,7 +108,7 @@ public:
};
template <int numMoveBits>
-void ReverseBitTreeEncode(CBitEncoder<numMoveBits> *Models,
+void ReverseBitTreeEncode(CBitEncoder<numMoveBits> *Models,
CEncoder *rangeEncoder, int NumBitLevels, UInt32 symbol)
{
UInt32 modelIndex = 1;
@@ -122,7 +122,7 @@ void ReverseBitTreeEncode(CBitEncoder<numMoveBits> *Models,
}
template <int numMoveBits>
-UInt32 ReverseBitTreeGetPrice(CBitEncoder<numMoveBits> *Models,
+UInt32 ReverseBitTreeGetPrice(CBitEncoder<numMoveBits> *Models,
UInt32 NumBitLevels, UInt32 symbol)
{
UInt32 price = 0;
@@ -138,7 +138,7 @@ UInt32 ReverseBitTreeGetPrice(CBitEncoder<numMoveBits> *Models,
}
template <int numMoveBits>
-UInt32 ReverseBitTreeDecode(CBitDecoder<numMoveBits> *Models,
+UInt32 ReverseBitTreeDecode(CBitDecoder<numMoveBits> *Models,
CDecoder *rangeDecoder, int NumBitLevels)
{
UInt32 modelIndex = 1;
diff --git a/util/cbfstool/lzma/C/7zip/Compress/RangeCoder/RangeCoderOpt.h b/util/cbfstool/lzma/C/7zip/Compress/RangeCoder/RangeCoderOpt.h
index 668b9a5b0a..5779277635 100644
--- a/util/cbfstool/lzma/C/7zip/Compress/RangeCoder/RangeCoderOpt.h
+++ b/util/cbfstool/lzma/C/7zip/Compress/RangeCoder/RangeCoderOpt.h
@@ -5,7 +5,7 @@
#define RC_INIT_VAR \
UInt32 range = rangeDecoder->Range; \
- UInt32 code = rangeDecoder->Code;
+ UInt32 code = rangeDecoder->Code;
#define RC_FLUSH_VAR \
rangeDecoder->Range = range; \
diff --git a/util/cbfstool/lzma/C/7zip/Decompress/LzmaDecode.c b/util/cbfstool/lzma/C/7zip/Decompress/LzmaDecode.c
index 21bf40bde0..83508436df 100644
--- a/util/cbfstool/lzma/C/7zip/Decompress/LzmaDecode.c
+++ b/util/cbfstool/lzma/C/7zip/Decompress/LzmaDecode.c
@@ -1,21 +1,21 @@
/*
LzmaDecode.c
LZMA Decoder (optimized for Speed version)
-
+
LZMA SDK 4.22 Copyright (c) 1999-2005 Igor Pavlov (2005-06-10)
http://www.7-zip.org/
LZMA SDK is licensed under two licenses:
1) GNU Lesser General Public License (GNU LGPL)
2) Common Public License (CPL)
- It means that you can select one of these two licenses and
+ It means that you can select one of these two licenses and
follow rules of that license.
SPECIAL EXCEPTION:
- Igor Pavlov, as the author of this Code, expressly permits you to
- statically or dynamically link your Code (or bind by name) to the
- interfaces of this file without subjecting your linked Code to the
- terms of the CPL or GNU LGPL. Any modifications or additions
+ Igor Pavlov, as the author of this Code, expressly permits you to
+ statically or dynamically link your Code (or bind by name) to the
+ interfaces of this file without subjecting your linked Code to the
+ terms of the CPL or GNU LGPL. Any modifications or additions
to this file, however, are subject to the LGPL or CPL terms.
*/
@@ -50,7 +50,7 @@
#define RC_TEST { if (Buffer == BufferLim) return LZMA_RESULT_DATA_ERROR; }
#define RC_INIT(buffer, bufferSize) Buffer = buffer; BufferLim = buffer + bufferSize; RC_INIT2
-
+
#endif
#define RC_NORMALIZE if (Range < kTopValue) { RC_TEST; Range <<= 8; Code = (Code << 8) | RC_READ_BYTE; }
@@ -61,9 +61,9 @@
#define RC_GET_BIT2(p, mi, A0, A1) IfBit0(p) \
{ UpdateBit0(p); mi <<= 1; A0; } else \
- { UpdateBit1(p); mi = (mi + mi) + 1; A1; }
-
-#define RC_GET_BIT(p, mi) RC_GET_BIT2(p, mi, ; , ;)
+ { UpdateBit1(p); mi = (mi + mi) + 1; A1; }
+
+#define RC_GET_BIT(p, mi) RC_GET_BIT2(p, mi, ; , ;)
#define RangeDecoderBitTreeDecode(probs, numLevels, res) \
{ int i = numLevels; res = 1; \
@@ -86,7 +86,7 @@
#define LenLow (LenChoice2 + 1)
#define LenMid (LenLow + (kNumPosStatesMax << kLenNumLowBits))
#define LenHigh (LenMid + (kNumPosStatesMax << kLenNumMidBits))
-#define kNumLenProbs (LenHigh + kLenNumHighSymbols)
+#define kNumLenProbs (LenHigh + kLenNumHighSymbols)
#define kNumStates 12
@@ -172,7 +172,7 @@ int LzmaDecode(CLzmaDecoderState *vs,
int lc = vs->Properties.lc;
#ifdef _LZMA_OUT_READ
-
+
UInt32 Range = vs->Range;
UInt32 Code = vs->Code;
#ifdef _LZMA_IN_CB
@@ -214,7 +214,7 @@ int LzmaDecode(CLzmaDecoderState *vs,
UInt32 numProbs = Literal + ((UInt32)LZMA_LIT_SIZE << (lc + vs->Properties.lp));
UInt32 i;
for (i = 0; i < numProbs; i++)
- p[i] = kBitModelTotal >> 1;
+ p[i] = kBitModelTotal >> 1;
rep0 = rep1 = rep2 = rep3 = 1;
state = 0;
globalPos = 0;
@@ -265,7 +265,7 @@ int LzmaDecode(CLzmaDecoderState *vs,
for (i = 0; i < numProbs; i++)
p[i] = kBitModelTotal >> 1;
}
-
+
#ifdef _LZMA_IN_CB
RC_INIT;
#else
@@ -279,7 +279,7 @@ int LzmaDecode(CLzmaDecoderState *vs,
CProb *prob;
UInt32 bound;
int posState = (int)(
- (nowPos
+ (nowPos
#ifdef _LZMA_OUT_READ
+ globalPos
#endif
@@ -291,9 +291,9 @@ int LzmaDecode(CLzmaDecoderState *vs,
{
int symbol = 1;
UpdateBit0(prob)
- prob = p + Literal + (LZMA_LIT_SIZE *
+ prob = p + Literal + (LZMA_LIT_SIZE *
(((
- (nowPos
+ (nowPos
#ifdef _LZMA_OUT_READ
+ globalPos
#endif
@@ -342,7 +342,7 @@ int LzmaDecode(CLzmaDecoderState *vs,
else if (state < 10) state -= 3;
else state -= 6;
}
- else
+ else
{
UpdateBit1(prob);
prob = p + IsRep + state;
@@ -369,14 +369,14 @@ int LzmaDecode(CLzmaDecoderState *vs,
UInt32 pos;
#endif
UpdateBit0(prob);
-
+
#ifdef _LZMA_OUT_READ
if (distanceLimit == 0)
#else
if (nowPos == 0)
#endif
return LZMA_RESULT_DATA_ERROR;
-
+
state = state < kNumLitStates ? 9 : 11;
#ifdef _LZMA_OUT_READ
pos = dictionaryPos - rep0;
@@ -412,7 +412,7 @@ int LzmaDecode(CLzmaDecoderState *vs,
UpdateBit0(prob);
distance = rep1;
}
- else
+ else
{
UpdateBit1(prob);
prob = p + IsRepG2 + state;
@@ -473,7 +473,7 @@ int LzmaDecode(CLzmaDecoderState *vs,
int posSlot;
state += kNumLitStates;
prob = p + PosSlot +
- ((len < kNumLenToPosStates ? len : kNumLenToPosStates - 1) <<
+ ((len < kNumLenToPosStates ? len : kNumLenToPosStates - 1) <<
kNumPosSlotBits);
RangeDecoderBitTreeDecode(prob, kNumPosSlotBits, posSlot);
if (posSlot >= kStartPosModelIndex)
@@ -528,7 +528,7 @@ int LzmaDecode(CLzmaDecoderState *vs,
len += kMatchMinLen;
#ifdef _LZMA_OUT_READ
- if (rep0 > distanceLimit)
+ if (rep0 > distanceLimit)
#else
if (rep0 > nowPos)
#endif
diff --git a/util/cbfstool/lzma/C/7zip/Decompress/LzmaDecode.h b/util/cbfstool/lzma/C/7zip/Decompress/LzmaDecode.h
index 213062af12..abc02d7edf 100644
--- a/util/cbfstool/lzma/C/7zip/Decompress/LzmaDecode.h
+++ b/util/cbfstool/lzma/C/7zip/Decompress/LzmaDecode.h
@@ -1,4 +1,4 @@
-/*
+/*
LzmaDecode.h
LZMA Decoder interface
@@ -8,14 +8,14 @@
LZMA SDK is licensed under two licenses:
1) GNU Lesser General Public License (GNU LGPL)
2) Common Public License (CPL)
- It means that you can select one of these two licenses and
+ It means that you can select one of these two licenses and
follow rules of that license.
SPECIAL EXCEPTION:
- Igor Pavlov, as the author of this code, expressly permits you to
- statically or dynamically link your code (or bind by name) to the
- interfaces of this file without subjecting your linked code to the
- terms of the CPL or GNU LGPL. Any modifications or additions
+ Igor Pavlov, as the author of this code, expressly permits you to
+ statically or dynamically link your code (or bind by name) to the
+ interfaces of this file without subjecting your linked code to the
+ terms of the CPL or GNU LGPL. Any modifications or additions
to this file, however, are subject to the LGPL or CPL terms.
*/
@@ -29,7 +29,7 @@
/* Use read function for output data */
/* #define _LZMA_PROB32 */
-/* It can increase speed on some 32-bit CPUs,
+/* It can increase speed on some 32-bit CPUs,
but memory usage will be doubled in that case */
/* #define _LZMA_LOC_OPT */
diff --git a/util/cbfstool/lzma/C/7zip/ICoder.h b/util/cbfstool/lzma/C/7zip/ICoder.h
index d84575dc45..3d1d8f01c9 100644
--- a/util/cbfstool/lzma/C/7zip/ICoder.h
+++ b/util/cbfstool/lzma/C/7zip/ICoder.h
@@ -19,8 +19,8 @@ CODER_INTERFACE(ICompressProgressInfo, 0x04)
CODER_INTERFACE(ICompressCoder, 0x05)
{
STDMETHOD(Code)(ISequentialInStream *inStream,
- ISequentialOutStream *outStream,
- const UInt64 *inSize,
+ ISequentialOutStream *outStream,
+ const UInt64 *inSize,
const UInt64 *outSize,
ICompressProgressInfo *progress) PURE;
};
@@ -28,9 +28,9 @@ CODER_INTERFACE(ICompressCoder, 0x05)
CODER_INTERFACE(ICompressCoder2, 0x18)
{
STDMETHOD(Code)(ISequentialInStream **inStreams,
- const UInt64 **inSizes,
+ const UInt64 **inSizes,
UInt32 numInStreams,
- ISequentialOutStream **outStreams,
+ ISequentialOutStream **outStreams,
const UInt64 **outSizes,
UInt32 numOutStreams,
ICompressProgressInfo *progress) PURE;
@@ -49,7 +49,7 @@ namespace NCoderPropID
kNumFastBytes = 0x450,
kMatchFinder,
kMatchFinderCycles,
- kNumPasses = 0x460,
+ kNumPasses = 0x460,
kAlgorithm = 0x470,
kMultiThread = 0x480,
kNumThreads,
@@ -59,7 +59,7 @@ namespace NCoderPropID
CODER_INTERFACE(ICompressSetCoderProperties, 0x20)
{
- STDMETHOD(SetCoderProperties)(const PROPID *propIDs,
+ STDMETHOD(SetCoderProperties)(const PROPID *propIDs,
const PROPVARIANT *properties, UInt32 numProperties) PURE;
};
@@ -124,7 +124,7 @@ CODER_INTERFACE(ICompressFilter, 0x40)
// Filter return outSize (UInt32)
// if (outSize <= size): Filter have converted outSize bytes
// if (outSize > size): Filter have not converted anything.
- // and it needs at least outSize bytes to convert one block
+ // and it needs at least outSize bytes to convert one block
// (it's for crypto block algorithms).
};
diff --git a/util/cbfstool/lzma/C/7zip/IStream.h b/util/cbfstool/lzma/C/7zip/IStream.h
index bba21a3158..b638efe4ec 100644
--- a/util/cbfstool/lzma/C/7zip/IStream.h
+++ b/util/cbfstool/lzma/C/7zip/IStream.h
@@ -21,7 +21,7 @@ STREAM_INTERFACE(ISequentialInStream, 0x01)
/*
Out: if size != 0, return_value = S_OK and (*processedSize == 0),
then there are no more bytes in stream.
- if (size > 0) && there are bytes in stream,
+ if (size > 0) && there are bytes in stream,
this function must read at least 1 byte.
This function is allowed to read less than number of remaining bytes in stream.
You must call Read function in loop, if you need exact amount of data
diff --git a/util/cbfstool/lzma/C/Common/Alloc.cpp b/util/cbfstool/lzma/C/Common/Alloc.cpp
index 6220a84f23..bdba16d1d1 100644
--- a/util/cbfstool/lzma/C/Common/Alloc.cpp
+++ b/util/cbfstool/lzma/C/Common/Alloc.cpp
@@ -35,7 +35,7 @@ void MyFree(void *address) throw()
if (address != 0)
fprintf(stderr, "\nFree; count = %10d", --g_allocCount);
#endif
-
+
::free(address);
}
@@ -62,7 +62,7 @@ void MidFree(void *address) throw()
::VirtualFree(address, 0, MEM_RELEASE);
}
-static SIZE_T g_LargePageSize =
+static SIZE_T g_LargePageSize =
#ifdef _WIN64
(1 << 21);
#else
@@ -92,10 +92,10 @@ void *BigAlloc(size_t size) throw()
#ifdef _SZ_ALLOC_DEBUG
fprintf(stderr, "\nAlloc_Big %10d bytes; count = %10d", size, g_allocCountBig++);
#endif
-
+
if (size >= (1 << 18))
{
- void *res = ::VirtualAlloc(0, (size + g_LargePageSize - 1) & (~(g_LargePageSize - 1)),
+ void *res = ::VirtualAlloc(0, (size + g_LargePageSize - 1) & (~(g_LargePageSize - 1)),
MEM_COMMIT, PAGE_READWRITE);
if (res != 0)
return res;
@@ -109,7 +109,7 @@ void BigFree(void *address) throw()
if (address != 0)
fprintf(stderr, "\nFree_Big; count = %10d", --g_allocCountBig);
#endif
-
+
if (address == 0)
return;
::VirtualFree(address, 0, MEM_RELEASE);
diff --git a/util/cbfstool/lzma/C/Common/CRC.cpp b/util/cbfstool/lzma/C/Common/CRC.cpp
index 35e1a18751..de5d561def 100644
--- a/util/cbfstool/lzma/C/Common/CRC.cpp
+++ b/util/cbfstool/lzma/C/Common/CRC.cpp
@@ -14,9 +14,9 @@ void CCRC::InitTable()
{
UInt32 r = i;
for (int j = 0; j < 8; j++)
- if (r & 1)
+ if (r & 1)
r = (r >> 1) ^ kCRCPoly;
- else
+ else
r >>= 1;
CCRC::Table[i] = r;
}
diff --git a/util/cbfstool/lzma/C/Common/CRC.h b/util/cbfstool/lzma/C/Common/CRC.h
index 6b4f1b796b..f3279a5ef8 100644
--- a/util/cbfstool/lzma/C/Common/CRC.h
+++ b/util/cbfstool/lzma/C/Common/CRC.h
@@ -20,7 +20,7 @@ public:
void UpdateUInt32(UInt32 v);
void UpdateUInt64(UInt64 v);
void Update(const void *data, size_t size);
- UInt32 GetDigest() const { return _value ^ 0xFFFFFFFF; }
+ UInt32 GetDigest() const { return _value ^ 0xFFFFFFFF; }
static UInt32 CalculateDigest(const void *data, size_t size)
{
CCRC crc;
diff --git a/util/cbfstool/lzma/C/Common/MyCom.h b/util/cbfstool/lzma/C/Common/MyCom.h
index e903493013..b8dbf38999 100644
--- a/util/cbfstool/lzma/C/Common/MyCom.h
+++ b/util/cbfstool/lzma/C/Common/MyCom.h
@@ -26,11 +26,11 @@ public:
// T& operator*() const { return *_p; }
T** operator&() { return &_p; }
T* operator->() const { return _p; }
- T* operator=(T* p)
- {
+ T* operator=(T* p)
+ {
if (p != 0)
p->AddRef();
- if (_p)
+ if (_p)
_p->Release();
_p = p;
return p;
@@ -114,8 +114,8 @@ public:
unsigned int Length() const { return ::SysStringLen(m_str); }
operator BSTR() const { return m_str; }
BSTR* operator&() { return &m_str; }
- BSTR MyCopy() const
- {
+ BSTR MyCopy() const
+ {
int byteLen = ::SysStringByteLen(m_str);
BSTR res = ::SysAllocStringByteLen(NULL, byteLen);
memmove(res, m_str, byteLen);
@@ -147,7 +147,7 @@ public:
};
#define MY_QUERYINTERFACE_BEGIN STDMETHOD(QueryInterface) \
- (REFGUID iid, void **outObject) {
+ (REFGUID iid, void **outObject) {
#define MY_QUERYINTERFACE_ENTRY(i) if (iid == IID_ ## i) \
{ *outObject = (void *)(i *)this; AddRef(); return S_OK; }
diff --git a/util/cbfstool/lzma/C/Common/MyGuidDef.h b/util/cbfstool/lzma/C/Common/MyGuidDef.h
index a7f8118ec9..7de64333cb 100644
--- a/util/cbfstool/lzma/C/Common/MyGuidDef.h
+++ b/util/cbfstool/lzma/C/Common/MyGuidDef.h
@@ -23,7 +23,7 @@ typedef struct {
#ifdef __cplusplus
inline bool operator==(REFGUID g1, REFGUID g2)
-{
+{
for (int i = 0; i < (int)sizeof(g1); i++)
if (((const unsigned char *)&g1)[i] != ((const unsigned char *)&g2)[i])
return false;
diff --git a/util/cbfstool/lzma/C/Common/MyUnknown.h b/util/cbfstool/lzma/C/Common/MyUnknown.h
index d28d854256..052c284f41 100644
--- a/util/cbfstool/lzma/C/Common/MyUnknown.h
+++ b/util/cbfstool/lzma/C/Common/MyUnknown.h
@@ -9,7 +9,7 @@
#if (_WIN32_WCE > 300)
#include <basetyps.h>
#else
-#define MIDL_INTERFACE(x) struct
+#define MIDL_INTERFACE(x) struct
#endif
#else
#include <basetyps.h>
@@ -17,8 +17,8 @@
#include <unknwn.h>
-#else
+#else
#include "MyWindows.h"
#endif
-
+
#endif
diff --git a/util/cbfstool/lzma/C/Common/MyWindows.h b/util/cbfstool/lzma/C/Common/MyWindows.h
index 0212fa77a3..e564c024ad 100644
--- a/util/cbfstool/lzma/C/Common/MyWindows.h
+++ b/util/cbfstool/lzma/C/Common/MyWindows.h
@@ -85,9 +85,9 @@ typedef LONG SCODE;
#define E_INVALIDARG ((HRESULT)0x80070057L)
#ifdef _MSC_VER
-#define STDMETHODCALLTYPE __stdcall
+#define STDMETHODCALLTYPE __stdcall
#else
-#define STDMETHODCALLTYPE
+#define STDMETHODCALLTYPE
#endif
#define STDMETHOD_(t, f) virtual t STDMETHODCALLTYPE f
@@ -97,7 +97,7 @@ typedef LONG SCODE;
#define PURE = 0
-#define MIDL_INTERFACE(x) struct
+#define MIDL_INTERFACE(x) struct
struct IUnknown
{
@@ -113,7 +113,7 @@ typedef IUnknown *LPUNKNOWN;
#define VARIANT_FALSE ((VARIANT_BOOL)0)
enum VARENUM
-{
+{
VT_EMPTY = 0,
VT_NULL = 1,
VT_I2 = 2,
@@ -153,7 +153,7 @@ typedef struct tagPROPVARIANT
PROPVAR_PAD1 wReserved1;
PROPVAR_PAD2 wReserved2;
PROPVAR_PAD3 wReserved3;
- union
+ union
{
CHAR cVal;
UCHAR bVal;
@@ -191,7 +191,7 @@ MY_EXTERN_C LONG CompareFileTime(const FILETIME* ft1, const FILETIME* ft2);
#define CP_OEMCP 1
typedef enum tagSTREAM_SEEK
-{
+{
STREAM_SEEK_SET = 0,
STREAM_SEEK_CUR = 1,
STREAM_SEEK_END = 2
diff --git a/util/cbfstool/lzma/C/Common/NewHandler.h b/util/cbfstool/lzma/C/Common/NewHandler.h
index 0619fc69e5..215ba05f10 100644
--- a/util/cbfstool/lzma/C/Common/NewHandler.h
+++ b/util/cbfstool/lzma/C/Common/NewHandler.h
@@ -6,11 +6,11 @@
class CNewException {};
#ifdef _WIN32
-void
+void
#ifdef _MSC_VER
-__cdecl
+__cdecl
#endif
operator delete(void *p) throw();
-#endif
+#endif
-#endif
+#endif
diff --git a/util/cbfstool/lzma/C/Common/StdAfx.h b/util/cbfstool/lzma/C/Common/StdAfx.h
index 681ee9356e..b8ba1d5c4c 100644
--- a/util/cbfstool/lzma/C/Common/StdAfx.h
+++ b/util/cbfstool/lzma/C/Common/StdAfx.h
@@ -6,4 +6,4 @@
// #include "MyWindows.h"
#include "NewHandler.h"
-#endif
+#endif
diff --git a/util/cbfstool/lzma/C/LGPL.txt b/util/cbfstool/lzma/C/LGPL.txt
index 60db6f46a4..1a71fd04a0 100644
--- a/util/cbfstool/lzma/C/LGPL.txt
+++ b/util/cbfstool/lzma/C/LGPL.txt
@@ -146,7 +146,7 @@ such a program is covered only if its contents constitute a work based
on the Library (independent of the use of the Library in a tool for
writing it). Whether that is true depends on what the Library does
and what the program that uses the Library does.
-
+
1. You may copy and distribute verbatim copies of the Library's
complete source code as you receive it, in any medium, provided that
you conspicuously and appropriately publish on each copy an
diff --git a/util/cbfstool/lzma/minilzma.cc b/util/cbfstool/lzma/minilzma.cc
index 5437b59946..2625cb5083 100644
--- a/util/cbfstool/lzma/minilzma.cc
+++ b/util/cbfstool/lzma/minilzma.cc
@@ -89,7 +89,7 @@ static UInt32 SelectDictionarySizeFor(unsigned datasize)
if(datasize <= 512) return 512;
if(datasize <= 1024) return 1024;
if(datasize <= 4096) return 4096;
- if(datasize <= 16384) return 32768;
+ if(datasize <= 16384) return 32768;
if(datasize <= 65536) return 528288;
if(datasize <= 528288) return 1048576*4;
if(datasize <= 786432) reutrn 1048576*16;
@@ -105,12 +105,12 @@ class CInStreamRam: public ISequentialInStream, public CMyUnknownImp
size_t Pos;
public:
MY_UNKNOWN_IMP
-
+
CInStreamRam(const std::vector<unsigned char>& buf) : input(buf), Pos(0)
{
}
virtual ~CInStreamRam() {}
-
+
STDMETHOD(Read)(void *data, UInt32 size, UInt32 *processedSize);
};
@@ -118,12 +118,12 @@ STDMETHODIMP CInStreamRam::Read(void *data, UInt32 size, UInt32 *processedSize)
{
UInt32 remain = input.size() - Pos;
if (size > remain) size = remain;
-
+
std::memcpy(data, &input[Pos], size);
Pos += size;
-
+
if(processedSize != NULL) *processedSize = size;
-
+
return S_OK;
}
@@ -133,27 +133,27 @@ class COutStreamRam: public ISequentialOutStream, public CMyUnknownImp
size_t Pos;
public:
MY_UNKNOWN_IMP
-
+
COutStreamRam(): result(), Pos(0) { }
virtual ~COutStreamRam() { }
-
+
void Reserve(unsigned n) { result.reserve(n); }
const std::vector<Byte>& Get() const { return result; }
-
+
HRESULT WriteByte(Byte b)
{
if(Pos >= result.size()) result.resize(Pos+1);
result[Pos++] = b;
return S_OK;
}
-
+
STDMETHOD(Write)(const void *data, UInt32 size, UInt32 *processedSize);
};
STDMETHODIMP COutStreamRam::Write(const void *data, UInt32 size, UInt32 *processedSize)
{
if(Pos+size > result.size()) result.resize(Pos+size);
-
+
std::memcpy(&result[Pos], data, size);
if(processedSize != NULL) *processedSize = size;
Pos += size;
@@ -163,15 +163,15 @@ STDMETHODIMP COutStreamRam::Write(const void *data, UInt32 size, UInt32 *process
const std::vector<unsigned char> LZMACompress(const std::vector<unsigned char>& buf)
{
if(buf.empty()) return buf;
-
+
const UInt32 dictionarysize = SelectDictionarySizeFor(buf.size());
-
+
NCompress::NLZMA::CEncoder *encoderSpec = new NCompress::NLZMA::CEncoder;
CMyComPtr<ICompressCoder> encoder = encoderSpec;
- const PROPID propIDs[] =
+ const PROPID propIDs[] =
{
NCoderPropID::kAlgorithm,
- NCoderPropID::kDictionarySize,
+ NCoderPropID::kDictionarySize,
NCoderPropID::kNumFastBytes,
};
const unsigned kNumProps = sizeof(propIDs) / sizeof(propIDs[0]);
@@ -185,16 +185,16 @@ const std::vector<unsigned char> LZMACompress(const std::vector<unsigned char>&
Error:
return std::vector<unsigned char> ();
}
-
+
COutStreamRam *const outStreamSpec = new COutStreamRam;
CMyComPtr<ISequentialOutStream> outStream = outStreamSpec;
CInStreamRam *const inStreamSpec = new CInStreamRam(buf);
CMyComPtr<ISequentialInStream> inStream = inStreamSpec;
-
+
outStreamSpec->Reserve(buf.size());
if (encoderSpec->WriteCoderProperties(outStream) != S_OK) goto Error;
-
+
for (unsigned i = 0; i < 8; i++)
{
UInt64 t = (UInt64)buf.size();
@@ -203,7 +203,7 @@ const std::vector<unsigned char> LZMACompress(const std::vector<unsigned char>&
HRESULT lzmaResult = encoder->Code(inStream, outStream, 0, 0, 0);
if (lzmaResult != S_OK) goto Error;
-
+
return outStreamSpec->Get();
}
@@ -216,22 +216,22 @@ const std::vector<unsigned char> LZMADeCompress
(const std::vector<unsigned char>& buf)
{
if(buf.size() <= 5+8) return std::vector<unsigned char> ();
-
+
uint_least64_t out_sizemax = R64(&buf[5]);
-
+
std::vector<unsigned char> result(out_sizemax);
-
+
CLzmaDecoderState state;
LzmaDecodeProperties(&state.Properties, &buf[0], LZMA_PROPERTIES_SIZE);
state.Probs = new CProb[LzmaGetNumProbs(&state.Properties)];
-
+
SizeT in_done;
SizeT out_done;
LzmaDecode(&state, &buf[13], buf.size()-13, &in_done,
&result[0], result.size(), &out_done);
-
+
delete[] state.Probs;
-
+
result.resize(out_done);
return result;
}
@@ -242,7 +242,7 @@ int main(int argc, char *argv[])
char *s;
FILE *f, *infile, *outfile;
int c;
-
+
if (argc != 4) {
std::fprintf(stderr, "'lzma e file1 file2' encodes file1 into file2.\n"
"'lzma d file2 file1' decodes file2 into file1.\n");
@@ -270,9 +270,9 @@ int main(int argc, char *argv[])
fread(Buf,si, 1, infile);
std::vector<unsigned char> result;
- if (toupper(*argv[1]) == 'E')
+ if (toupper(*argv[1]) == 'E')
result = LZMACompress(std::vector<unsigned char>(Buf,Buf+si));
- else
+ else
result = LZMADeCompress(std::vector<unsigned char>(Buf,Buf+si));
fwrite(&result[0], result.size(), 1, outfile);
@@ -289,7 +289,7 @@ extern "C" {
* @param in a pointer to the buffer
* @param in_len the length in bytes
* @param out a pointer to a buffer of at least size in_len
- * @param out_len a pointer to the compressed length of in
+ * @param out_len a pointer to the compressed length of in
*/
void do_lzma_compress(char *in, int in_len, char *out, int *out_len) {
diff --git a/util/crossgcc/buildgcc b/util/crossgcc/buildgcc
index 2ff6234f2e..bacaf500a7 100755
--- a/util/crossgcc/buildgcc
+++ b/util/crossgcc/buildgcc
@@ -3,7 +3,7 @@
# Copyright (C) 2008-2009 by coresystems GmbH
# written by Patrick Georgi <patrick.georgi@coresystems.de> and
# Stefan Reinauer <stefan.reinauer@coresystems.de>
-#
+#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; version 2 of the License.
@@ -202,7 +202,7 @@ for PACKAGE in GMP MPFR GCC BINUTILS GDB $MINGW_PACKAGES; do
archive=$PACKAGE"_ARCHIVE"
archive=${!archive}
dir=$PACKAGE"_DIR"
- test -d ${!dir} || (
+ test -d ${!dir} || (
printf " * `basename $archive`\n"
FLAGS=zxf
test ${archive:${#archive}-2:2} = "gz" && FLAGS=zxf
diff --git a/util/crossgcc/patches/gcc-4.3.2_use-gnu-style-comments-in-assembly.patch b/util/crossgcc/patches/gcc-4.3.2_use-gnu-style-comments-in-assembly.patch
index b5bfb2013a..168f0d0655 100644
--- a/util/crossgcc/patches/gcc-4.3.2_use-gnu-style-comments-in-assembly.patch
+++ b/util/crossgcc/patches/gcc-4.3.2_use-gnu-style-comments-in-assembly.patch
@@ -1,11 +1,11 @@
--- gcc-4.3.2/gcc/config/i386/unix.h~ 2009-01-20 16:05:45.000000000 +0100
+++ gcc-4.3.2/gcc/config/i386/unix.h 2009-01-20 16:05:47.000000000 +0100
@@ -32,7 +32,7 @@
-
+
/* String containing the assembler's comment-starter. */
-
+
-#define ASM_COMMENT_START "/"
+#define ASM_COMMENT_START "#"
-
+
/* Output to assembler file text saying following lines
may contain character constants, extra white space, comments, etc. */
diff --git a/util/crossgcc/patches/gcc-4.3.3_use-gnu-style-comments-in-assembly.patch b/util/crossgcc/patches/gcc-4.3.3_use-gnu-style-comments-in-assembly.patch
index aa72efb06e..d5a16dade9 100644
--- a/util/crossgcc/patches/gcc-4.3.3_use-gnu-style-comments-in-assembly.patch
+++ b/util/crossgcc/patches/gcc-4.3.3_use-gnu-style-comments-in-assembly.patch
@@ -1,11 +1,11 @@
--- gcc-4.3.3/gcc/config/i386/unix.h~ 2009-01-20 16:05:45.000000000 +0100
+++ gcc-4.3.3/gcc/config/i386/unix.h 2009-01-20 16:05:47.000000000 +0100
@@ -32,7 +32,7 @@
-
+
/* String containing the assembler's comment-starter. */
-
+
-#define ASM_COMMENT_START "/"
+#define ASM_COMMENT_START "#"
-
+
/* Output to assembler file text saying following lines
may contain character constants, extra white space, comments, etc. */
diff --git a/util/crossgcc/patches/gcc-4.4.1_less-junk-in-crtbegin.patch b/util/crossgcc/patches/gcc-4.4.1_less-junk-in-crtbegin.patch
index 3c005003df..4df9694c6a 100644
--- a/util/crossgcc/patches/gcc-4.4.1_less-junk-in-crtbegin.patch
+++ b/util/crossgcc/patches/gcc-4.4.1_less-junk-in-crtbegin.patch
@@ -3,7 +3,7 @@
@@ -204,6 +204,7 @@
= { (func_ptr) (-1) };
#endif /* __DTOR_LIST__ alternatives */
-
+
+#if 0
#ifdef USE_EH_FRAME_REGISTRY
/* Stick a label at the beginning of the frame unwind info so we can register
@@ -13,13 +13,13 @@
= { };
#endif /* JCR_SECTION_NAME */
+#endif
-
+
#if defined(INIT_SECTION_ASM_OP) || defined(INIT_ARRAY_SECTION_ASM_OP)
-
+
@@ -309,6 +311,7 @@
}
#endif /* !defined(FINI_ARRAY_SECTION_ASM_OP) */
-
+
+#if 0
#ifdef USE_EH_FRAME_REGISTRY
#ifdef CRT_GET_RFIB_DATA
@@ -29,13 +29,13 @@
#endif
#endif
+#endif
-
+
completed = 1;
}
@@ -333,6 +337,7 @@
= { __do_global_dtors_aux };
#endif /* !defined(FINI_SECTION_ASM_OP) */
-
+
+#if 0
#if defined(USE_EH_FRAME_REGISTRY) || defined(JCR_SECTION_NAME)
/* Stick a call to __register_frame_info into the .init section. For some
@@ -45,6 +45,6 @@
#endif /* JCR_SECTION_NAME */
}
+#endif
-
+
#ifdef INIT_SECTION_ASM_OP
CRT_CALL_STATIC_FUNCTION (INIT_SECTION_ASM_OP, frame_dummy)
diff --git a/util/crossgcc/patches/gcc-4.4.2_less-junk-in-crtbegin.patch b/util/crossgcc/patches/gcc-4.4.2_less-junk-in-crtbegin.patch
index a1a7981555..a1c248069d 100644
--- a/util/crossgcc/patches/gcc-4.4.2_less-junk-in-crtbegin.patch
+++ b/util/crossgcc/patches/gcc-4.4.2_less-junk-in-crtbegin.patch
@@ -3,7 +3,7 @@
@@ -204,6 +204,7 @@
= { (func_ptr) (-1) };
#endif /* __DTOR_LIST__ alternatives */
-
+
+#if 0
#ifdef USE_EH_FRAME_REGISTRY
/* Stick a label at the beginning of the frame unwind info so we can register
@@ -13,13 +13,13 @@
= { };
#endif /* JCR_SECTION_NAME */
+#endif
-
+
#if defined(INIT_SECTION_ASM_OP) || defined(INIT_ARRAY_SECTION_ASM_OP)
-
+
@@ -309,6 +311,7 @@
}
#endif /* !defined(FINI_ARRAY_SECTION_ASM_OP) */
-
+
+#if 0
#ifdef USE_EH_FRAME_REGISTRY
#ifdef CRT_GET_RFIB_DATA
@@ -29,13 +29,13 @@
#endif
#endif
+#endif
-
+
completed = 1;
}
@@ -333,6 +337,7 @@
= { __do_global_dtors_aux };
#endif /* !defined(FINI_SECTION_ASM_OP) */
-
+
+#if 0
#if defined(USE_EH_FRAME_REGISTRY) || defined(JCR_SECTION_NAME)
/* Stick a call to __register_frame_info into the .init section. For some
@@ -45,6 +45,6 @@
#endif /* JCR_SECTION_NAME */
}
+#endif
-
+
#ifdef INIT_SECTION_ASM_OP
CRT_CALL_STATIC_FUNCTION (INIT_SECTION_ASM_OP, frame_dummy)
diff --git a/util/dump_mmcr/dumpmmcr.c b/util/dump_mmcr/dumpmmcr.c
index a652eb3320..de2bfec349 100644
--- a/util/dump_mmcr/dumpmmcr.c
+++ b/util/dump_mmcr/dumpmmcr.c
@@ -1,9 +1,9 @@
/*
* dump mmcr of Elan520 uController (incomplete, see 22005b pg23+).
*
- * Copyright 2006 coresystems GmbH
- * Stefan Reinauer <stepan@coresystems.de>
- *
+ * Copyright 2006 coresystems GmbH
+ * Stefan Reinauer <stepan@coresystems.de>
+ *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
@@ -37,12 +37,12 @@ int print_mmcr(struct mmcr *mmcr)
int i;
printf("revid is 0x%x\n\n", val(mmcr, revid));
printf("cpucontrol is 0x%x\n\n", val(mmcr, cpucontrol));
-
+
printf("\n");
printf("drcctl is 0x%x\n", val(mmcr, memregs.drcctl));
printf("drctmctl is 0x%x\n", val(mmcr, memregs.drctmctl));
printf("drccfg is 0x%x\n", val(mmcr, memregs.drccfg));
- printf("bendaddr is 0x%02x%02x%02x%02x\n",
+ printf("bendaddr is 0x%02x%02x%02x%02x\n",
val(mmcr, memregs.drcbendadr[3]),
val(mmcr, memregs.drcbendadr[2]),
val(mmcr, memregs.drcbendadr[1]),
@@ -53,15 +53,15 @@ int print_mmcr(struct mmcr *mmcr)
printf("cktest is 0x%x\n", val(mmcr, memregs.ecccktest));
printf("sbadd is 0x%x\n", val(mmcr, memregs.eccsbadd));
printf("mbadd is 0x%x\n", val(mmcr, memregs.eccmbadd));
-
+
printf("\n");
printf("dbctl is 0x%x\n", val(mmcr, dbctl.dbctl));
-
+
printf("\n");
printf("bootcs is 0x%x\n", val(mmcr, romregs.bootcs));
printf("romcs1 is 0x%x\n", val(mmcr, romregs.romcs1));
printf("romcs2 is 0x%x\n", val(mmcr, romregs.romcs2));
-
+
printf("\n");
printf("hbctl is 0x%x\n", val(mmcr, hostbridge.ctl));
printf("hbtgtirqctl is 0x%x\n", val(mmcr, hostbridge.tgtirqctl));
@@ -69,20 +69,20 @@ int print_mmcr(struct mmcr *mmcr)
printf("hbmstirqctl is 0x%x\n", val(mmcr, hostbridge.mstirqctl));
printf("hbmstirqsta is 0x%x\n", val(mmcr, hostbridge.mstirqsta));
printf("mstintadd is 0x%x\n", val(mmcr, hostbridge.mstintadd));
-
-
+
+
printf("\n");
printf("sysarbctl is 0x%x\n", val(mmcr, sysarb.ctl));
printf("pciarbsta is 0x%x\n", val(mmcr, sysarb.sta));
printf("sysarbmenb is 0x%x\n", val(mmcr, sysarb.menb));
printf("arbprictl is 0x%x\n", val(mmcr, sysarb.prictl));
-
+
printf("\n");
printf("adddecctl is 0x%x\n", val(mmcr, sysmap.adddecctl));
printf("wpvsta is 0x%x\n", val(mmcr, sysmap.wpvsta));
for (i=0; i<16; i++)
printf("par %d is 0x%x\n", i, val(mmcr, sysmap.par[i]));
-
+
printf("\n");
printf("gpecho is 0x%x\n", val(mmcr, gpctl.gpecho));
printf("gpcsdw is 0x%x\n", val(mmcr, gpctl.gpcsdw));
@@ -96,9 +96,9 @@ int print_mmcr(struct mmcr *mmcr)
printf("gpwroff is 0x%x\n", val(mmcr, gpctl.gpwroff));
printf("gpalew is 0x%x\n", val(mmcr, gpctl.gpalew));
printf("gpaleoff is 0x%x\n", val(mmcr, gpctl.gpaleoff));
-
+
printf("\n");
-
+
printf("piopfs15_0 is 0x%x\n", val(mmcr, pio.pfs15_0));
printf("piopfs31_16 is 0x%x\n", val(mmcr, pio.pfs31_16));
printf("cspfs is 0x%x\n", val(mmcr, pio.cspfs));
@@ -112,19 +112,19 @@ int print_mmcr(struct mmcr *mmcr)
printf("pioset31_16 is 0x%x\n", val(mmcr, pio.set31_16));
printf("pioclr15_0 is 0x%x\n", val(mmcr, pio.clr15_0));
printf("pioclr31_16 is 0x%x\n", val(mmcr, pio.clr31_16));
-
+
printf("swtmrmilli is 0x%x\n", val(mmcr, swtmr.swtmrmilli));
printf("swtmrmicro is 0x%x\n", val(mmcr, swtmr.swtmrmicro));
printf("swtmrcfg is 0x%x\n", val(mmcr, swtmr.swtmrcfg));
-
+
printf("status is 0x%x\n", val(mmcr, gptimers.status));
printf("pad is 0x%x\n", val(mmcr, gptimers.pad));
-
+
printf("timers[0].ctl is 0x%x\n", val(mmcr, gptimers.timer[0].ctl));
printf("timers[0].cnt is 0x%x\n", val(mmcr, gptimers.timer[0].cnt));
printf("timers[0].maxcmpa is 0x%x\n", val(mmcr, gptimers.timer[0].maxcmpa));
printf("timers[0].maxcmpb is 0x%x\n", val(mmcr, gptimers.timer[0].maxcmpb));
-
+
printf("timers[1].ctl is 0x%x\n", val(mmcr, gptimers.timer[1].ctl));
printf("timers[1].cnt is 0x%x\n", val(mmcr, gptimers.timer[1].cnt));
printf("timers[1].maxcmpa is 0x%x\n", val(mmcr, gptimers.timer[1].maxcmpa));
@@ -132,24 +132,24 @@ int print_mmcr(struct mmcr *mmcr)
printf("timers[2].ctl is 0x%x\n", val(mmcr, gptimers.ctl2));
printf("timers[2].cnt is 0x%x\n", val(mmcr, gptimers.cnt2));
printf("timers[2].maxcmpa is 0x%x\n", val(mmcr, gptimers.maxcmpa2));
-
+
printf("ctl is 0x%x\n", val(mmcr, watchdog.ctl));
printf("cntll is 0x%x\n", val(mmcr, watchdog.cntll));
printf("cntlh is 0x%x\n", val(mmcr, watchdog.cntlh));
-
+
printf("uart 1 ctl is 0x%x\n", val(mmcr, uarts.uart[0].ctl));
printf("uart 1 sta is 0x%x\n", val(mmcr, uarts.uart[0].sta));
printf("uart 1 fcrshad is 0x%x\n", val(mmcr, uarts.uart[0].fcrshad));
printf("uart 2 ctl is 0x%x\n", val(mmcr, uarts.uart[1].ctl));
printf("uart 2 sta is 0x%x\n", val(mmcr, uarts.uart[1].sta));
printf("uart 2 fcrshad is 0x%x\n", val(mmcr, uarts.uart[1].fcrshad));
-
+
printf("ssi ctl is 0x%x\n", val(mmcr, ssi.ctl));
printf("ssi xmit is 0x%x\n", val(mmcr, ssi.xmit));
printf("ssi cmd is 0x%x\n", val(mmcr, ssi.cmd));
printf("ssi sta is 0x%x\n", val(mmcr, ssi.sta));
printf("ssi rcv is 0x%x\n", val(mmcr, ssi.rcv));
-
+
printf("pcicr is 0x%x\n", val(mmcr, pic.pcicr));
printf("mpicmode is 0x%x\n", val(mmcr, pic.mpicmode));
printf("sl1picmode is 0x%x\n", val(mmcr, pic.sl1picmode));
@@ -189,12 +189,12 @@ int print_mmcr(struct mmcr *mmcr)
printf("gp8imap is 0x%x\n", val(mmcr, pic.gp8imap));
printf("gp9imap is 0x%x\n", val(mmcr, pic.gp9imap));
printf("gp10imap is 0x%x\n", val(mmcr, pic.gp10imap));
-
+
printf("sysinfo is 0x%x\n", val(mmcr, reset.sysinfo));
printf("rescfg is 0x%x\n", val(mmcr, reset.rescfg));
printf("ressta is 0x%x\n", val(mmcr, reset.ressta));
-
-
+
+
printf("ctl is 0x%x\n", val(mmcr, dmacontrol.ctl));
printf("mmio is 0x%x\n", val(mmcr, dmacontrol.mmio));
printf("extchanmapa is 0x%x\n", val(mmcr, dmacontrol.extchanmapa));
@@ -230,7 +230,7 @@ int print_mmcr(struct mmcr *mmcr)
printf("nxtttch6 is 0x%x\n", val(mmcr, dmacontrol.nxtttch6));
printf("nxtttcl7 is 0x%x\n", val(mmcr, dmacontrol.nxtttcl7));
printf("nxtttch7 is 0x%x\n", val(mmcr, dmacontrol.nxtttch7));
-
+
return 0;
}
@@ -248,15 +248,15 @@ int map_mmcr(void)
if (getpagesize() > size) {
size = getpagesize();
}
-
+
mmcr = mmap(0, size, PROT_WRITE | PROT_READ, MAP_SHARED,
fd_mem, (off_t) (0xFFFEF000));
-
+
if (mmcr == MAP_FAILED) {
perror("Error MMAP /dev/mem");
exit(1);
}
-
+
print_mmcr((struct mmcr *)mmcr);
#if 0
diff --git a/util/ectool/ec.c b/util/ectool/ec.c
index 351015d050..35c8d789ab 100644
--- a/util/ectool/ec.c
+++ b/util/ectool/ec.c
@@ -121,6 +121,6 @@ uint8_t ec_idx_read(uint16_t addr)
outb(addr & 0xff, lpc_idx + 2);
outb(addr >> 8, lpc_idx + 1);
-
+
return inb(lpc_idx + 3);
}
diff --git a/util/getpir/README b/util/getpir/README
index 33d0de2a93..651458583b 100644
--- a/util/getpir/README
+++ b/util/getpir/README
@@ -2,11 +2,11 @@ ABOUT:
This utility will help to create irq_table.c file, that is very hard to create
manually, specialy when you are testing new motherboards, changing your
-hardware often, placing new cards, etc..
+hardware often, placing new cards, etc..
USAGE:
-Steps
+Steps
1. make distclean;
2. make getpir
3. ./getpir
@@ -23,7 +23,7 @@ Steps
checkpir.c Will verify the irq_tables.c, currently it only checks the
checksum. In case of wrong checksum, a good value is proposed, so you can
edit irq_tables.c manualy and replace checksum.
-
+
Do not run make checkpir and ./checkpir directly because it needs to be linked
to irq_table.o first.
diff --git a/util/inteltool/Makefile b/util/inteltool/Makefile
index 248e51f726..3850682e5f 100644
--- a/util/inteltool/Makefile
+++ b/util/inteltool/Makefile
@@ -1,9 +1,9 @@
#
# Makefile for inteltool utility
#
-# Copyright (C) 2008 by coresystems GmbH
-# written by Stefan Reinauer <stepan@coresystems.de>
-#
+# Copyright (C) 2008 by coresystems GmbH
+# written by Stefan Reinauer <stepan@coresystems.de>
+#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
@@ -25,7 +25,7 @@ CC = gcc
INSTALL = /usr/bin/install
PREFIX = /usr/local
CFLAGS = -O2 -g -Wall -W
-LDFLAGS = -lpci -lz
+LDFLAGS = -lpci -lz
OBJS = inteltool.o cpu.o gpio.o rootcmplx.o powermgt.o memory.o pcie.o
diff --git a/util/inteltool/cpu.c b/util/inteltool/cpu.c
index dd23d8196f..828f99f84f 100644
--- a/util/inteltool/cpu.c
+++ b/util/inteltool/cpu.c
@@ -1,8 +1,8 @@
/*
* inteltool - dump all registers on an Intel CPU + chipset based system.
*
- * Copyright (C) 2008-2010 by coresystems GmbH
- *
+ * Copyright (C) 2008-2010 by coresystems GmbH
+ *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
@@ -104,7 +104,7 @@ int print_intel_core_msrs(void)
{ 0x002a, "EBL_CR_POWERON" },
{ 0x0033, "TEST_CTL" },
{ 0x003f, "THERM_DIODE_OFFSET" },
- //{ 0x0079, "IA32_BIOS_UPDT_TRIG" }, // Seems to be RO
+ //{ 0x0079, "IA32_BIOS_UPDT_TRIG" }, // Seems to be RO
{ 0x008b, "IA32_BIOS_SIGN_ID" },
{ 0x00c1, "PERFCTR0" },
{ 0x00c2, "PERFCTR1" },
@@ -308,8 +308,8 @@ int print_intel_core_msrs(void)
};
/* Pentium 4 and XEON */
- /*
- * All MSRs per
+ /*
+ * All MSRs per
*
* Intel® 64 and IA-32 Architectures
* Software Developer.s Manual
@@ -326,7 +326,7 @@ int print_intel_core_msrs(void)
{ 0x002a, "MSR_EBC_HARD_POWERON" },
{ 0x002b, "MSR_EBC_SOFT_POWRON" },
{ 0x002c, "MSR_EBC_FREQUENCY_ID" },
-// WRITE ONLY { 0x0079, "IA32_BIOS_UPDT_TRIG" },
+// WRITE ONLY { 0x0079, "IA32_BIOS_UPDT_TRIG" },
{ 0x019c, "IA32_THERM_STATUS" },
{ 0x019d, "MSR_THERM2_CTL" },
{ 0x01a0, "IA32_MISC_ENABLE" },
@@ -365,7 +365,7 @@ int print_intel_core_msrs(void)
{ 0x0303, "MSR_BPU_COUNTER3" },
/* Skipped through 0x3ff for now*/
- /* All MCX_ADDR AND MCX_MISC MSRs depend on a bit being
+ /* All MCX_ADDR AND MCX_MISC MSRs depend on a bit being
* set in MCX_STATUS */
{ 0x400, "IA32_MC0_CTL" },
{ 0x401, "IA32_MC0_STATUS" },
@@ -374,7 +374,7 @@ int print_intel_core_msrs(void)
{ 0x404, "IA32_MC1_CTL" },
{ 0x405, "IA32_MC1_STATUS" },
{ 0x406, "IA32_MC1_ADDR" },
- { 0x407, "IA32_MC1_MISC" },
+ { 0x407, "IA32_MC1_MISC" },
{ 0x408, "IA32_MC2_CTL" },
{ 0x409, "IA32_MC2_STATUS" },
{ 0x40a, "IA32_MC2_ADDR" },
@@ -439,7 +439,7 @@ int print_intel_core_msrs(void)
*/
{ 0x0600, "IA32_DS_AREA" },
/* 0x0680 - 0x06cf Branch Records Skipped */
-
+
};
@@ -461,7 +461,7 @@ int print_intel_core_msrs(void)
cpu_t *cpu = NULL;
- /* Get CPU family and model, not the stepping
+ /* Get CPU family and model, not the stepping
* (TODO: extended family/model)
*/
id = cpuid(1) & 0xff0;
diff --git a/util/inteltool/gpio.c b/util/inteltool/gpio.c
index a02817d586..665f4696ea 100644
--- a/util/inteltool/gpio.c
+++ b/util/inteltool/gpio.c
@@ -1,8 +1,8 @@
/*
* inteltool - dump all registers on an Intel CPU + chipset based system.
*
- * Copyright (C) 2008 by coresystems GmbH
- *
+ * Copyright (C) 2008 by coresystems GmbH
+ *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
diff --git a/util/inteltool/inteltool.c b/util/inteltool/inteltool.c
index 2c8ab747dc..9c23d49f65 100644
--- a/util/inteltool/inteltool.c
+++ b/util/inteltool/inteltool.c
@@ -1,9 +1,9 @@
/*
* inteltool - dump all registers on an Intel CPU + chipset based system.
*
- * Copyright (C) 2008-2010 by coresystems GmbH
- * written by Stefan Reinauer <stepan@coresystems.de>
- *
+ * Copyright (C) 2008-2010 by coresystems GmbH
+ * written by Stefan Reinauer <stepan@coresystems.de>
+ *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
@@ -69,7 +69,7 @@ void *map_physical(unsigned long phys_addr, size_t len)
virt_addr = mmap(0, len, PROT_WRITE | PROT_READ, MAP_SHARED,
fd_mem, (off_t) phys_addr);
-
+
if (virt_addr == MAP_FAILED) {
printf("Error mapping physical memory 0x%08lx[0x%x]\n", phys_addr, len);
return NULL;
@@ -214,11 +214,11 @@ int main(int argc, char *argv[])
pci_scan_bus(pacc);
/* Find the required devices */
- for (dev = pacc->devices; dev; dev = dev->next) {
+ for (dev = pacc->devices; dev; dev = dev->next) {
pci_fill_info(dev, PCI_FILL_CLASS);
/* The ISA/LPC bridge can be 0x1f, 0x07, or 0x04 so we probe. */
if (dev->device_class == 0x0601) { /* ISA/LPC bridge */
- if (sb == NULL)
+ if (sb == NULL)
sb = dev;
else
fprintf(stderr, "Multiple devices with class ID"
@@ -254,7 +254,7 @@ int main(int argc, char *argv[])
}
id = cpuid(1);
- printf("Intel CPU: Family %x, Model %x\n",
+ printf("Intel CPU: Family %x, Model %x\n",
(id >> 8) & 0xf, (id >> 4) & 0xf);
/* Determine names */
@@ -265,10 +265,10 @@ int main(int argc, char *argv[])
if (sb->device_id == supported_chips_list[i].device_id)
sbname = supported_chips_list[i].name;
- printf("Intel Northbridge: %04x:%04x (%s)\n",
+ printf("Intel Northbridge: %04x:%04x (%s)\n",
nb->vendor_id, nb->device_id, nbname);
- printf("Intel Southbridge: %04x:%04x (%s)\n",
+ printf("Intel Southbridge: %04x:%04x (%s)\n",
sb->vendor_id, sb->device_id, sbname);
/* Now do the deed */
diff --git a/util/inteltool/inteltool.h b/util/inteltool/inteltool.h
index 74bfdca802..45b210dfca 100644
--- a/util/inteltool/inteltool.h
+++ b/util/inteltool/inteltool.h
@@ -1,8 +1,8 @@
/*
* inteltool - dump all registers on an Intel CPU + chipset based system.
*
- * Copyright (C) 2008-2010 by coresystems GmbH
- *
+ * Copyright (C) 2008-2010 by coresystems GmbH
+ *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
diff --git a/util/inteltool/memory.c b/util/inteltool/memory.c
index 5c5a07e03a..393725b0ff 100644
--- a/util/inteltool/memory.c
+++ b/util/inteltool/memory.c
@@ -1,8 +1,8 @@
/*
* inteltool - dump all registers on an Intel CPU + chipset based system.
*
- * Copyright (C) 2008-2010 by coresystems GmbH
- *
+ * Copyright (C) 2008-2010 by coresystems GmbH
+ *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
@@ -60,7 +60,7 @@ int print_mchbar(struct pci_dev *nb)
}
mchbar = map_physical(mchbar_phys, size);
-
+
if (mchbar == NULL) {
perror("Error mapping MCHBAR");
exit(1);
diff --git a/util/inteltool/pcie.c b/util/inteltool/pcie.c
index 5acb0b6ba2..5b58f0ccdb 100644
--- a/util/inteltool/pcie.c
+++ b/util/inteltool/pcie.c
@@ -1,8 +1,8 @@
/*
* inteltool - dump all registers on an Intel CPU + chipset based system.
*
- * Copyright (C) 2008-2010 by coresystems GmbH
- *
+ * Copyright (C) 2008-2010 by coresystems GmbH
+ *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
@@ -57,7 +57,7 @@ int print_epbar(struct pci_dev *nb)
}
epbar = map_physical(epbar_phys, size);
-
+
if (epbar == NULL) {
perror("Error mapping EPBAR");
exit(1);
@@ -109,7 +109,7 @@ int print_dmibar(struct pci_dev *nb)
}
dmibar = map_physical(dmibar_phys, size);
-
+
if (dmibar == NULL) {
perror("Error mapping DMIBAR");
exit(1);
@@ -182,17 +182,17 @@ int print_pciexbar(struct pci_dev *nb)
default: // RSVD
printf("Undefined address base. Bailing out.\n");
return 1;
- }
+ }
printf("PCIEXBAR: 0x%08llx\n", pciexbar_phys);
pciexbar = map_physical(pciexbar_phys, (max_busses * 1024 * 1024));
-
+
if (pciexbar == NULL) {
perror("Error mapping PCIEXBAR");
exit(1);
}
-
+
for (bus = 0; bus < max_busses; bus++) {
for (dev = 0; dev < 32; dev++) {
for (fn = 0; fn < 8; fn++) {
@@ -200,7 +200,7 @@ int print_pciexbar(struct pci_dev *nb)
if (*(uint16_t *)(pciexbar + devbase) == 0xffff)
continue;
-
+
/* This is a heuristics. Anyone got a better check? */
if( (*(uint32_t *)(pciexbar + devbase + 256) == 0xffffffff) &&
(*(uint32_t *)(pciexbar + devbase + 512) == 0xffffffff) ) {
diff --git a/util/inteltool/powermgt.c b/util/inteltool/powermgt.c
index 47db163eed..ee0f485958 100644
--- a/util/inteltool/powermgt.c
+++ b/util/inteltool/powermgt.c
@@ -1,9 +1,9 @@
/*
* inteltool - dump all registers on an Intel CPU + chipset based system.
*
- * Copyright (C) 2008-2010 by coresystems GmbH
- * written by Stefan Reinauer <stepan@coresystems.de>
- *
+ * Copyright (C) 2008-2010 by coresystems GmbH
+ * written by Stefan Reinauer <stepan@coresystems.de>
+ *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
@@ -145,7 +145,7 @@ static const io_register_t ich8_pm_registers[] = {
{ 0x7c, 4, "RESERVED" },
};
-/*
+/*
* INTEL I/O Controller Hub 6 Family
* http://www.intel.com/assets/pdf/datasheet/301473.pdf
*/
diff --git a/util/inteltool/rootcmplx.c b/util/inteltool/rootcmplx.c
index 9c3f70f4ef..b67e230b9a 100644
--- a/util/inteltool/rootcmplx.c
+++ b/util/inteltool/rootcmplx.c
@@ -1,9 +1,9 @@
/*
* inteltool - dump all registers on an Intel CPU + chipset based system.
*
- * Copyright (C) 2008 by coresystems GmbH
- * written by Stefan Reinauer <stepan@coresystems.de>
- *
+ * Copyright (C) 2008 by coresystems GmbH
+ * written by Stefan Reinauer <stepan@coresystems.de>
+ *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
@@ -51,7 +51,7 @@ int print_rcba(struct pci_dev *sb)
}
rcba = map_physical(rcba_phys, size);
-
+
if (rcba == NULL) {
perror("Error mapping RCBA");
exit(1);
diff --git a/util/k8resdump/Makefile b/util/k8resdump/Makefile
index 7cf039036e..944dbe6cf7 100644
--- a/util/k8resdump/Makefile
+++ b/util/k8resdump/Makefile
@@ -1,6 +1,6 @@
#
# Makefile for k8redump utility
-#
+#
# Original from Stefan Reinauer <stepan@openbios.org>
#
@@ -14,9 +14,9 @@ PREFIX = /usr/local
CFLAGS = -Os -Wall -Werror
OS_ARCH = $(shell uname)
ifeq ($(OS_ARCH), SunOS)
-LDFLAGS = -lpci
+LDFLAGS = -lpci
else
-LDFLAGS = -lpci -lz -static
+LDFLAGS = -lpci -lz -static
STRIP_ARGS = -s
endif
@@ -33,7 +33,7 @@ clean:
distclean: clean
rm -f $(PROGRAM) .dependencies
-
+
dep:
@$(CC) -MM *.c > .dependencies
diff --git a/util/kconfig/confdata.c b/util/kconfig/confdata.c
index 56a0eb0851..3bbad3010a 100644
--- a/util/kconfig/confdata.c
+++ b/util/kconfig/confdata.c
@@ -19,7 +19,7 @@
#define mkdir(x,y) mkdir(x)
#define UNLINK_IF_NECESSARY(x) unlink(x)
#else
-#define UNLINK_IF_NECESSARY(X)
+#define UNLINK_IF_NECESSARY(X)
#endif
static void conf_warning(const char *fmt, ...)
diff --git a/util/kconfig/lex.zconf.c_shipped b/util/kconfig/lex.zconf.c_shipped
index 1911092521..6897092b94 100644
--- a/util/kconfig/lex.zconf.c_shipped
+++ b/util/kconfig/lex.zconf.c_shipped
@@ -52,7 +52,7 @@
#if __STDC_VERSION__ >= 199901L
/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
- * if you want the limit (max/min) macros for int types.
+ * if you want the limit (max/min) macros for int types.
*/
#ifndef __STDC_LIMIT_MACROS
#define __STDC_LIMIT_MACROS 1
@@ -69,7 +69,7 @@ typedef uint32_t flex_uint32_t;
typedef signed char flex_int8_t;
typedef short int flex_int16_t;
typedef int flex_int32_t;
-typedef unsigned char flex_uint8_t;
+typedef unsigned char flex_uint8_t;
typedef unsigned short int flex_uint16_t;
typedef unsigned int flex_uint32_t;
#endif /* ! C99 */
@@ -179,7 +179,7 @@ extern FILE *zconfin, *zconfout;
#define EOB_ACT_LAST_MATCH 2
#define YY_LESS_LINENO(n)
-
+
/* Return all but the first "n" matched characters back to the input stream. */
#define yyless(n) \
do \
@@ -246,7 +246,7 @@ struct yy_buffer_state
int yy_bs_lineno; /**< The line count. */
int yy_bs_column; /**< The column count. */
-
+
/* Whether to try to fill the input buffer when we reach the
* end of it.
*/
@@ -866,7 +866,7 @@ extern int zconfwrap (void );
#endif
static void yyunput (int c,char *buf_ptr );
-
+
#ifndef yytext_ptr
static void yy_flex_strncpy (char *,yyconst char *,int );
#endif
@@ -971,7 +971,7 @@ YY_DECL
register yy_state_type yy_current_state;
register char *yy_cp, *yy_bp;
register int yy_act;
-
+
int str = 0;
int ts, i;
@@ -1574,7 +1574,7 @@ static int yy_get_next_buffer (void)
{
register yy_state_type yy_current_state;
register char *yy_cp;
-
+
yy_current_state = (yy_start);
for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
@@ -1593,7 +1593,7 @@ static int yy_get_next_buffer (void)
static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state )
{
register int yy_is_jam;
-
+
yy_current_state = yy_nxt[yy_current_state][1];
yy_is_jam = (yy_current_state <= 0);
@@ -1603,7 +1603,7 @@ static int yy_get_next_buffer (void)
static void yyunput (int c, register char * yy_bp )
{
register char *yy_cp;
-
+
yy_cp = (yy_c_buf_p);
/* undo effects of setting up zconftext */
@@ -1646,7 +1646,7 @@ static int yy_get_next_buffer (void)
{
int c;
-
+
*(yy_c_buf_p) = (yy_hold_char);
if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR )
@@ -1713,12 +1713,12 @@ static int yy_get_next_buffer (void)
/** Immediately switch to a different input stream.
* @param input_file A readable stream.
- *
+ *
* @note This function does not reset the start condition to @c INITIAL .
*/
void zconfrestart (FILE * input_file )
{
-
+
if ( ! YY_CURRENT_BUFFER ){
zconfensure_buffer_stack ();
YY_CURRENT_BUFFER_LVALUE =
@@ -1731,11 +1731,11 @@ static int yy_get_next_buffer (void)
/** Switch to a different input buffer.
* @param new_buffer The new input buffer.
- *
+ *
*/
void zconf_switch_to_buffer (YY_BUFFER_STATE new_buffer )
{
-
+
/* TODO. We should be able to replace this entire function body
* with
* zconfpop_buffer_state();
@@ -1775,13 +1775,13 @@ static void zconf_load_buffer_state (void)
/** Allocate and initialize an input buffer state.
* @param file A readable stream.
* @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
- *
+ *
* @return the allocated buffer state.
*/
YY_BUFFER_STATE zconf_create_buffer (FILE * file, int size )
{
YY_BUFFER_STATE b;
-
+
b = (YY_BUFFER_STATE) zconfalloc(sizeof( struct yy_buffer_state ) );
if ( ! b )
YY_FATAL_ERROR( "out of dynamic memory in zconf_create_buffer()" );
@@ -1804,11 +1804,11 @@ static void zconf_load_buffer_state (void)
/** Destroy the buffer.
* @param b a buffer created with zconf_create_buffer()
- *
+ *
*/
void zconf_delete_buffer (YY_BUFFER_STATE b )
{
-
+
if ( ! b )
return;
@@ -1829,7 +1829,7 @@ static void zconf_load_buffer_state (void)
{
int oerrno = errno;
-
+
zconf_flush_buffer(b );
b->yy_input_file = file;
@@ -1845,13 +1845,13 @@ static void zconf_load_buffer_state (void)
}
b->yy_is_interactive = 0;
-
+
errno = oerrno;
}
/** Discard all buffered characters. On the next scan, YY_INPUT will be called.
* @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
- *
+ *
*/
void zconf_flush_buffer (YY_BUFFER_STATE b )
{
@@ -1880,7 +1880,7 @@ static void zconf_load_buffer_state (void)
* the current state. This function will allocate the stack
* if necessary.
* @param new_buffer The new state.
- *
+ *
*/
void zconfpush_buffer_state (YY_BUFFER_STATE new_buffer )
{
@@ -1910,7 +1910,7 @@ void zconfpush_buffer_state (YY_BUFFER_STATE new_buffer )
/** Removes and deletes the top of the stack, if present.
* The next element becomes the new top.
- *
+ *
*/
void zconfpop_buffer_state (void)
{
@@ -1934,7 +1934,7 @@ void zconfpop_buffer_state (void)
static void zconfensure_buffer_stack (void)
{
int num_to_alloc;
-
+
if (!(yy_buffer_stack)) {
/* First allocation is just for 2 elements, since we don't know if this
@@ -1945,9 +1945,9 @@ static void zconfensure_buffer_stack (void)
(yy_buffer_stack) = (struct yy_buffer_state**)zconfalloc
(num_to_alloc * sizeof(struct yy_buffer_state*)
);
-
+
memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));
-
+
(yy_buffer_stack_max) = num_to_alloc;
(yy_buffer_stack_top) = 0;
return;
@@ -1973,13 +1973,13 @@ static void zconfensure_buffer_stack (void)
/** Setup the input buffer state to scan directly from a user-specified character buffer.
* @param base the character buffer
* @param size the size in bytes of the character buffer
- *
- * @return the newly allocated buffer state object.
+ *
+ * @return the newly allocated buffer state object.
*/
YY_BUFFER_STATE zconf_scan_buffer (char * base, yy_size_t size )
{
YY_BUFFER_STATE b;
-
+
if ( size < 2 ||
base[size-2] != YY_END_OF_BUFFER_CHAR ||
base[size-1] != YY_END_OF_BUFFER_CHAR )
@@ -2008,14 +2008,14 @@ YY_BUFFER_STATE zconf_scan_buffer (char * base, yy_size_t size )
/** Setup the input buffer state to scan a string. The next call to zconflex() will
* scan from a @e copy of @a str.
* @param str a NUL-terminated string to scan
- *
+ *
* @return the newly allocated buffer state object.
* @note If you want to scan bytes that may contain NUL values, then use
* zconf_scan_bytes() instead.
*/
YY_BUFFER_STATE zconf_scan_string (yyconst char * yystr )
{
-
+
return zconf_scan_bytes(yystr,strlen(yystr) );
}
@@ -2023,7 +2023,7 @@ YY_BUFFER_STATE zconf_scan_string (yyconst char * yystr )
* scan from a @e copy of @a bytes.
* @param bytes the byte buffer to scan
* @param len the number of bytes in the buffer pointed to by @a bytes.
- *
+ *
* @return the newly allocated buffer state object.
*/
YY_BUFFER_STATE zconf_scan_bytes (yyconst char * yybytes, int _yybytes_len )
@@ -2032,7 +2032,7 @@ YY_BUFFER_STATE zconf_scan_bytes (yyconst char * yybytes, int _yybytes_len )
char *buf;
yy_size_t n;
int i;
-
+
/* Get memory for full buffer, including space for trailing EOB's. */
n = _yybytes_len + 2;
buf = (char *) zconfalloc(n );
@@ -2086,16 +2086,16 @@ static void yy_fatal_error (yyconst char* msg )
/* Accessor methods (get/set functions) to struct members. */
/** Get the current line number.
- *
+ *
*/
int zconfget_lineno (void)
{
-
+
return zconflineno;
}
/** Get the input stream.
- *
+ *
*/
FILE *zconfget_in (void)
{
@@ -2103,7 +2103,7 @@ FILE *zconfget_in (void)
}
/** Get the output stream.
- *
+ *
*/
FILE *zconfget_out (void)
{
@@ -2111,7 +2111,7 @@ FILE *zconfget_out (void)
}
/** Get the length of the current token.
- *
+ *
*/
int zconfget_leng (void)
{
@@ -2119,7 +2119,7 @@ int zconfget_leng (void)
}
/** Get the current token.
- *
+ *
*/
char *zconfget_text (void)
@@ -2129,18 +2129,18 @@ char *zconfget_text (void)
/** Set the current line number.
* @param line_number
- *
+ *
*/
void zconfset_lineno (int line_number )
{
-
+
zconflineno = line_number;
}
/** Set the input stream. This does not discard the current
* input buffer.
* @param in_str A readable stream.
- *
+ *
* @see zconf_switch_to_buffer
*/
void zconfset_in (FILE * in_str )
@@ -2194,7 +2194,7 @@ static int yy_init_globals (void)
/* zconflex_destroy is for both reentrant and non-reentrant scanners. */
int zconflex_destroy (void)
{
-
+
/* Pop the buffer stack, destroying each element. */
while(YY_CURRENT_BUFFER){
zconf_delete_buffer(YY_CURRENT_BUFFER );
diff --git a/util/kconfig/lxdialog/BIG.FAT.WARNING b/util/kconfig/lxdialog/BIG.FAT.WARNING
index a8999d82bd..7cb5a7ec93 100644
--- a/util/kconfig/lxdialog/BIG.FAT.WARNING
+++ b/util/kconfig/lxdialog/BIG.FAT.WARNING
@@ -1,4 +1,4 @@
This is NOT the official version of dialog. This version has been
significantly modified from the original. It is for use by the Linux
-kernel configuration script. Please do not bother Savio Lam with
+kernel configuration script. Please do not bother Savio Lam with
questions about this program.
diff --git a/util/kconfig/lxdialog/menubox.c b/util/kconfig/lxdialog/menubox.c
index 243d6c0cb3..fe882fc284 100644
--- a/util/kconfig/lxdialog/menubox.c
+++ b/util/kconfig/lxdialog/menubox.c
@@ -26,7 +26,7 @@
*
* *) A bugfix for the Page-Down problem
*
- * *) Formerly when I used Page Down and Page Up, the cursor would be set
+ * *) Formerly when I used Page Down and Page Up, the cursor would be set
* to the first position in the menu box. Now lxdialog is a bit
* smarter and works more like other menu systems (just have a look at
* it).
diff --git a/util/kconfig/mconf.c b/util/kconfig/mconf.c
index fc804bb366..692c0e954d 100644
--- a/util/kconfig/mconf.c
+++ b/util/kconfig/mconf.c
@@ -506,7 +506,7 @@ static void build_conf(struct menu *menu)
if (def_menu) {
item_add_str(" (%s)", _(menu_get_prompt(def_menu)));
item_add_str(" --->");
-#if 0
+#if 0
/* coreboot doesn't need this representation */
if (def_menu->list) {
indent += 2;
diff --git a/util/kconfig/regex.c b/util/kconfig/regex.c
index 8169880d7e..e63c8148b3 100644
--- a/util/kconfig/regex.c
+++ b/util/kconfig/regex.c
@@ -75,7 +75,7 @@ char *realloc ();
/* This must be nonzero for the wordchar and notwordchar pattern
commands in re_match_2. */
-#ifndef Sword
+#ifndef Sword
#define Sword 1
#endif
@@ -173,8 +173,8 @@ init_syntax_once ()
use `alloca' instead of `malloc'. This is because using malloc in
re_search* or re_match* could cause memory leaks when C-g is used in
Emacs; also, malloc is slower and causes storage fragmentation. On
- the other hand, malloc is more portable, and easier to debug.
-
+ the other hand, malloc is more portable, and easier to debug.
+
Because we sometimes use alloca, some routines have to be macros,
not functions -- `alloca'-allocated space disappears at the end of the
function it is called in. */
@@ -199,7 +199,7 @@ init_syntax_once ()
#ifndef _AIX /* Already did AIX, up at the top. */
char *alloca ();
#endif /* not _AIX */
-#endif /* not HAVE_ALLOCA_H */
+#endif /* not HAVE_ALLOCA_H */
#endif /* not __GNUC__ */
#endif /* not alloca */
@@ -302,9 +302,9 @@ typedef enum
/* Analogously, for end of buffer/string. */
endbuf,
-
+
/* Followed by two byte relative address to which to jump. */
- jump,
+ jump,
/* Same as jump, but marks the end of an alternative. */
jump_past_alt,
@@ -312,11 +312,11 @@ typedef enum
/* Followed by two-byte relative address of place to resume at
in case of failure. */
on_failure_jump,
-
+
/* Like on_failure_jump, but pushes a placeholder instead of the
current string position when executed. */
on_failure_keep_string_jump,
-
+
/* Throw away latest failure point and then jump to following
two-byte relative address. */
pop_failure_jump,
@@ -412,7 +412,7 @@ extract_number (dest, source)
int *dest;
unsigned char *source;
{
- int temp = SIGN_EXTEND_CHAR (*(source + 1));
+ int temp = SIGN_EXTEND_CHAR (*(source + 1));
*dest = *source & 0377;
*dest += temp << 8;
}
@@ -438,7 +438,7 @@ static void
extract_number_and_incr (destination, source)
int *destination;
unsigned char **source;
-{
+{
extract_number (destination, *source);
*source += 2;
}
@@ -487,8 +487,8 @@ print_fastmap (fastmap)
char *fastmap;
{
unsigned was_a_range = 0;
- unsigned i = 0;
-
+ unsigned i = 0;
+
while (i < (1 << BYTEWIDTH))
{
if (fastmap[i++])
@@ -507,7 +507,7 @@ print_fastmap (fastmap)
}
}
}
- putchar ('\n');
+ putchar ('\n');
}
@@ -528,7 +528,7 @@ print_partial_compiled_pattern (start, end)
printf ("(null)\n");
return;
}
-
+
/* Loop over pattern commands. */
while (p < pend)
{
@@ -574,14 +574,14 @@ print_partial_compiled_pattern (start, end)
printf ("/charset%s",
(re_opcode_t) *(p - 1) == charset_not ? "_not" : "");
-
+
assert (p + *p < pend);
for (c = 0; c < *p; c++)
{
unsigned bit;
unsigned char map_byte = p[1 + c];
-
+
putchar ('/');
for (bit = 0; bit < BYTEWIDTH; bit++)
@@ -618,7 +618,7 @@ print_partial_compiled_pattern (start, end)
case push_dummy_failure:
printf ("/push_dummy_failure");
break;
-
+
case maybe_pop_jump:
extract_number_and_incr (&mcnt, &p);
printf ("/maybe_pop_jump/0/%d", mcnt);
@@ -627,36 +627,36 @@ print_partial_compiled_pattern (start, end)
case pop_failure_jump:
extract_number_and_incr (&mcnt, &p);
printf ("/pop_failure_jump/0/%d", mcnt);
- break;
-
+ break;
+
case jump_past_alt:
extract_number_and_incr (&mcnt, &p);
printf ("/jump_past_alt/0/%d", mcnt);
- break;
-
+ break;
+
case jump:
extract_number_and_incr (&mcnt, &p);
printf ("/jump/0/%d", mcnt);
break;
- case succeed_n:
+ case succeed_n:
extract_number_and_incr (&mcnt, &p);
extract_number_and_incr (&mcnt2, &p);
printf ("/succeed_n/0/%d/0/%d", mcnt, mcnt2);
break;
-
- case jump_n:
+
+ case jump_n:
extract_number_and_incr (&mcnt, &p);
extract_number_and_incr (&mcnt2, &p);
printf ("/jump_n/0/%d/0/%d", mcnt, mcnt2);
break;
-
- case set_number_at:
+
+ case set_number_at:
extract_number_and_incr (&mcnt, &p);
extract_number_and_incr (&mcnt2, &p);
printf ("/set_number_at/0/%d/0/%d", mcnt, mcnt2);
break;
-
+
case wordbound:
printf ("/wordbound");
break;
@@ -668,10 +668,10 @@ print_partial_compiled_pattern (start, end)
case wordbeg:
printf ("/wordbeg");
break;
-
+
case wordend:
printf ("/wordend");
-
+
#ifdef emacs
case before_dot:
printf ("/before_dot");
@@ -690,7 +690,7 @@ print_partial_compiled_pattern (start, end)
mcnt = *p++;
printf ("/%d", mcnt);
break;
-
+
case notsyntaxspec:
printf ("/notsyntaxspec");
mcnt = *p++;
@@ -701,7 +701,7 @@ print_partial_compiled_pattern (start, end)
case wordchar:
printf ("/wordchar");
break;
-
+
case notwordchar:
printf ("/notwordchar");
break;
@@ -758,7 +758,7 @@ print_double_string (where, string1, size1, string2, size2)
int size2;
{
unsigned this_char;
-
+
if (where == NULL)
printf ("(null)");
else
@@ -768,7 +768,7 @@ print_double_string (where, string1, size1, string2, size2)
for (this_char = where - string1; this_char < size1; this_char++)
printchar (string1[this_char]);
- where = string2;
+ where = string2;
}
for (this_char = where - string2; this_char < size2; this_char++)
@@ -809,7 +809,7 @@ re_set_syntax (syntax)
reg_syntax_t syntax;
{
reg_syntax_t ret = re_syntax_options;
-
+
re_syntax_options = syntax;
return ret;
}
@@ -845,7 +845,7 @@ static boolean at_begline_loc_p (), at_endline_loc_p ();
static boolean group_in_compile_stack ();
static reg_errcode_t compile_range ();
-/* Fetch the next character in the uncompiled pattern---translating it
+/* Fetch the next character in the uncompiled pattern---translating it
if necessary. Also cast from a signed character in the constant
string passed to us by the user to an unsigned char that we can use
as an array index (in, e.g., `translate'). */
@@ -985,7 +985,7 @@ typedef struct
pattern_offset_t begalt_offset;
pattern_offset_t fixup_alt_jump;
pattern_offset_t inner_group_offset;
- pattern_offset_t laststart_offset;
+ pattern_offset_t laststart_offset;
regnum_t regnum;
} compile_stack_elt_t;
@@ -1028,7 +1028,7 @@ typedef struct
PATFETCH (c); \
} \
} \
- }
+ }
#define CHAR_CLASS_MAX_LENGTH 6 /* Namely, `xdigit'. */
@@ -1054,7 +1054,7 @@ typedef struct
`fastmap_accurate' is zero;
`re_nsub' is the number of subexpressions in PATTERN;
`not_bol' and `not_eol' are zero;
-
+
The `fastmap' and `newline_anchor' fields are neither
examined nor set. */
@@ -1069,20 +1069,20 @@ regex_compile (pattern, size, syntax, bufp)
`char *' (i.e., signed), we declare these variables as unsigned, so
they can be reliably used as array indices. */
register unsigned char c, c1;
-
+
/* A random tempory spot in PATTERN. */
const char *p1;
/* Points to the end of the buffer, where we should append. */
register unsigned char *b;
-
+
/* Keeps track of unclosed groups. */
compile_stack_type compile_stack;
/* Points to the current (ending) position in the pattern. */
const char *p = pattern;
const char *pend = pattern + size;
-
+
/* How to translate the characters in the pattern. */
char *translate = bufp->translate;
@@ -1103,7 +1103,7 @@ regex_compile (pattern, size, syntax, bufp)
/* Place in the uncompiled pattern (i.e., the {) to
which to go back if the interval is invalid. */
const char *beg_interval;
-
+
/* Address of the place where a forward jump should go to the end of
the containing expression. Each alternative of an `or' -- except the
last -- ends with a forward jump of this sort. */
@@ -1119,7 +1119,7 @@ regex_compile (pattern, size, syntax, bufp)
if (debug)
{
unsigned debug_count;
-
+
for (debug_count = 0; debug_count < size; debug_count++)
printchar (pattern[debug_count]);
putchar ('\n');
@@ -1143,9 +1143,9 @@ regex_compile (pattern, size, syntax, bufp)
printer (for debugging) will think there's no pattern. We reset it
at the end. */
bufp->used = 0;
-
+
/* Always count groups, whether or not bufp->no_sub is set. */
- bufp->re_nsub = 0;
+ bufp->re_nsub = 0;
#if !defined (emacs) && !defined (SYNTAX_TABLE)
/* Initialize the syntax table. */
@@ -1196,7 +1196,7 @@ regex_compile (pattern, size, syntax, bufp)
case '$':
{
if ( /* If at end of pattern, it's an operator. */
- p == pend
+ p == pend
/* If context independent, it's an operator. */
|| syntax & RE_CONTEXT_INDEP_ANCHORS
/* Otherwise, depends on what's next. */
@@ -1227,7 +1227,7 @@ regex_compile (pattern, size, syntax, bufp)
{
/* Are we optimizing this jump? */
boolean keep_string_p = false;
-
+
/* 1 means zero (many) matches is allowed. */
char zero_times_ok = 0, many_times_ok = 0;
@@ -1275,7 +1275,7 @@ regex_compile (pattern, size, syntax, bufp)
/* Star, etc. applied to an empty pattern is equivalent
to an empty pattern. */
- if (!laststart)
+ if (!laststart)
break;
/* Now we know whether or not zero matches is allowed
@@ -1284,7 +1284,7 @@ regex_compile (pattern, size, syntax, bufp)
{ /* More than one repetition is allowed, so put in at the
end a backward relative jump from `b' to before the next
jump we're going to put in below (which jumps from
- laststart to after this jump).
+ laststart to after this jump).
But if we are at the `*' in the exact sequence `.*\n',
insert an unconditional jump backwards to the .,
@@ -1361,7 +1361,7 @@ regex_compile (pattern, size, syntax, bufp)
/* We test `*p == '^' twice, instead of using an if
statement, so we only need one BUF_PUSH. */
- BUF_PUSH (*p == '^' ? charset_not : charset);
+ BUF_PUSH (*p == '^' ? charset_not : charset);
if (*p == '^')
p++;
@@ -1411,8 +1411,8 @@ regex_compile (pattern, size, syntax, bufp)
was a character: if this is a hyphen not at the
beginning or the end of a list, then it's the range
operator. */
- if (c == '-'
- && !(p - 2 >= pattern && p[-2] == '[')
+ if (c == '-'
+ && !(p - 2 >= pattern && p[-2] == '[')
&& !(p - 3 >= pattern && p[-3] == '[' && p[-2] == '^')
&& *p != ']')
{
@@ -1427,7 +1427,7 @@ regex_compile (pattern, size, syntax, bufp)
/* Move past the `-'. */
PATFETCH (c1);
-
+
ret = compile_range (&p, pend, translate, syntax, b);
if (ret != REG_NOERROR) return ret;
}
@@ -1456,7 +1456,7 @@ regex_compile (pattern, size, syntax, bufp)
str[c1] = '\0';
/* If isn't a word bracketed by `[:' and:`]':
- undo the ending character, the letters, and leave
+ undo the ending character, the letters, and leave
the leading `:' and `[' (but set bits for them). */
if (c == ':' && *p == ']')
{
@@ -1473,12 +1473,12 @@ regex_compile (pattern, size, syntax, bufp)
boolean is_space = STREQ (str, "space");
boolean is_upper = STREQ (str, "upper");
boolean is_xdigit = STREQ (str, "xdigit");
-
+
if (!IS_CHAR_CLASS (str)) return REG_ECTYPE;
/* Throw away the ] at the end of the character
class. */
- PATFETCH (c);
+ PATFETCH (c);
if (p == pend) return REG_EBRACK;
@@ -1503,7 +1503,7 @@ regex_compile (pattern, size, syntax, bufp)
else
{
c1++;
- while (c1--)
+ while (c1--)
PATUNFETCH;
SET_LIST_BIT ('[');
SET_LIST_BIT (':');
@@ -1519,8 +1519,8 @@ regex_compile (pattern, size, syntax, bufp)
/* Discard any (non)matching list bytes that are all 0 at the
end of the map. Decrease the map-length byte too. */
- while ((int) b[-1] > 0 && b[b[-1] - 1] == 0)
- b[-1]--;
+ while ((int) b[-1] > 0 && b[b[-1] - 1] == 0)
+ b[-1]--;
b += b[-1];
}
break;
@@ -1580,7 +1580,7 @@ regex_compile (pattern, size, syntax, bufp)
regnum++;
if (COMPILE_STACK_FULL)
- {
+ {
RETALLOC (compile_stack.stack, compile_stack.size << 1,
compile_stack_elt_t);
if (compile_stack.stack == NULL) return REG_ESPACE;
@@ -1593,7 +1593,7 @@ regex_compile (pattern, size, syntax, bufp)
whole pattern moves because of realloc, they will still
be valid. */
COMPILE_STACK_TOP.begalt_offset = begalt - bufp->buffer;
- COMPILE_STACK_TOP.fixup_alt_jump
+ COMPILE_STACK_TOP.fixup_alt_jump
= fixup_alt_jump ? fixup_alt_jump - bufp->buffer + 1 : 0;
COMPILE_STACK_TOP.laststart_offset = b - bufp->buffer;
COMPILE_STACK_TOP.regnum = regnum;
@@ -1607,7 +1607,7 @@ regex_compile (pattern, size, syntax, bufp)
COMPILE_STACK_TOP.inner_group_offset = b - bufp->buffer + 2;
BUF_PUSH_3 (start_memory, regnum, 0);
}
-
+
compile_stack.avail++;
fixup_alt_jump = 0;
@@ -1636,7 +1636,7 @@ regex_compile (pattern, size, syntax, bufp)
`pop_failure_jump' to pop. See comments at
`push_dummy_failure' in `re_match_2'. */
BUF_PUSH (push_dummy_failure);
-
+
/* We allocated space for this jump when we assigned
to `fixup_alt_jump', in the `handle_alt' case below. */
STORE_JUMP (jump_past_alt, fixup_alt_jump, b - 1);
@@ -1658,11 +1658,11 @@ regex_compile (pattern, size, syntax, bufp)
as in `(ab)c(de)' -- the second group is #2. */
regnum_t this_group_regnum;
- compile_stack.avail--;
+ compile_stack.avail--;
begalt = bufp->buffer + COMPILE_STACK_TOP.begalt_offset;
fixup_alt_jump
= COMPILE_STACK_TOP.fixup_alt_jump
- ? bufp->buffer + COMPILE_STACK_TOP.fixup_alt_jump - 1
+ ? bufp->buffer + COMPILE_STACK_TOP.fixup_alt_jump - 1
: 0;
laststart = bufp->buffer + COMPILE_STACK_TOP.laststart_offset;
this_group_regnum = COMPILE_STACK_TOP.regnum;
@@ -1677,7 +1677,7 @@ regex_compile (pattern, size, syntax, bufp)
{
unsigned char *inner_group_loc
= bufp->buffer + COMPILE_STACK_TOP.inner_group_offset;
-
+
*inner_group_loc = regnum - this_group_regnum;
BUF_PUSH_3 (stop_memory, this_group_regnum,
regnum - this_group_regnum);
@@ -1706,10 +1706,10 @@ regex_compile (pattern, size, syntax, bufp)
jump (put in below, which in turn will jump to the next
(if any) alternative's such jump, etc.). The last such
jump jumps to the correct final destination. A picture:
- _____ _____
- | | | |
- | v | v
- a | b | c
+ _____ _____
+ | | | |
+ | v | v
+ a | b | c
If we are at `b', then fixup_alt_jump right now points to a
three-byte space after `a'. We'll put in the jump, set
@@ -1731,10 +1731,10 @@ regex_compile (pattern, size, syntax, bufp)
break;
- case '{':
+ case '{':
/* If \{ is a literal. */
if (!(syntax & RE_INTERVALS)
- /* If we're at `\{' and it's not the open-interval
+ /* If we're at `\{' and it's not the open-interval
operator. */
|| ((syntax & RE_INTERVALS) && (syntax & RE_NO_BK_BRACES))
|| (p - 2 == pattern && p == pend))
@@ -1773,11 +1773,11 @@ regex_compile (pattern, size, syntax, bufp)
{
if (syntax & RE_NO_BK_BRACES)
goto unfetch_interval;
- else
+ else
return REG_BADBR;
}
- if (!(syntax & RE_NO_BK_BRACES))
+ if (!(syntax & RE_NO_BK_BRACES))
{
if (c != '\\') return REG_EBRACE;
@@ -1788,7 +1788,7 @@ regex_compile (pattern, size, syntax, bufp)
{
if (syntax & RE_NO_BK_BRACES)
goto unfetch_interval;
- else
+ else
return REG_BADBR;
}
@@ -1824,7 +1824,7 @@ regex_compile (pattern, size, syntax, bufp)
jump_n <succeed_n addr> <jump count>
(The upper bound and `jump_n' are omitted if
`upper_bound' is 1, though.) */
- else
+ else
{ /* If the upper bound is > 1, we need to insert
more at the end of the loop. */
unsigned nbytes = 10 + (upper_bound > 1) * 10;
@@ -1841,7 +1841,7 @@ regex_compile (pattern, size, syntax, bufp)
lower_bound);
b += 5;
- /* Code to initialize the lower bound. Insert
+ /* Code to initialize the lower bound. Insert
before the `succeed_n'. The `5' is the last two
bytes of this `set_number_at', plus 3 bytes of
the following `succeed_n'. */
@@ -1852,7 +1852,7 @@ regex_compile (pattern, size, syntax, bufp)
{ /* More than one repetition is allowed, so
append a backward jump to the `succeed_n'
that starts this interval.
-
+
When we've reached this during matching,
we'll have matched the interval once, so
jump back only `upper_bound - 1' times. */
@@ -1870,7 +1870,7 @@ regex_compile (pattern, size, syntax, bufp)
so everything is getting moved up by 5.
Conclusion: (b - 2) - (laststart + 3) + 5,
i.e., b - laststart.
-
+
We insert this at the beginning of the loop
so that if we fail during matching, we'll
reinitialize the bounds. */
@@ -1891,7 +1891,7 @@ regex_compile (pattern, size, syntax, bufp)
beg_interval = NULL;
/* normal_char and normal_backslash need `c'. */
- PATFETCH (c);
+ PATFETCH (c);
if (!(syntax & RE_NO_BK_BRACES))
{
@@ -1907,7 +1907,7 @@ regex_compile (pattern, size, syntax, bufp)
BUF_PUSH (at_dot);
break;
- case 's':
+ case 's':
laststart = b;
PATFETCH (c);
BUF_PUSH_2 (syntaxspec, syntax_spec_code[c]);
@@ -1998,11 +1998,11 @@ regex_compile (pattern, size, syntax, bufp)
/* Expects the character in `c'. */
normal_char:
/* If no exactn currently being built. */
- if (!pending_exact
+ if (!pending_exact
/* If last exactn not at current position. */
|| pending_exact + *pending_exact + 1 != b
-
+
/* We have only one byte following the exactn for the count. */
|| *pending_exact == (1 << BYTEWIDTH) - 1
@@ -2017,26 +2017,26 @@ regex_compile (pattern, size, syntax, bufp)
: (p[0] == '\\' && p[1] == '{'))))
{
/* Start building a new exactn. */
-
+
laststart = b;
BUF_PUSH_2 (exactn, 0);
pending_exact = b - 1;
}
-
+
BUF_PUSH (c);
(*pending_exact)++;
break;
} /* switch (c) */
} /* while p != pend */
-
+
/* Through the pattern now. */
-
+
if (fixup_alt_jump)
STORE_JUMP (jump_past_alt, fixup_alt_jump, b);
- if (!COMPILE_STACK_EMPTY)
+ if (!COMPILE_STACK_EMPTY)
return REG_EPAREN;
free (compile_stack.stack);
@@ -2092,14 +2092,14 @@ insert_op1 (op, loc, arg, end)
re_opcode_t op;
unsigned char *loc;
int arg;
- unsigned char *end;
+ unsigned char *end;
{
register unsigned char *pfrom = end;
register unsigned char *pto = end + 3;
while (pfrom != loc)
*--pto = *--pfrom;
-
+
store_op1 (op, loc, arg);
}
@@ -2111,14 +2111,14 @@ insert_op2 (op, loc, arg1, arg2, end)
re_opcode_t op;
unsigned char *loc;
int arg1, arg2;
- unsigned char *end;
+ unsigned char *end;
{
register unsigned char *pfrom = end;
register unsigned char *pto = end + 5;
while (pfrom != loc)
*--pto = *--pfrom;
-
+
store_op2 (op, loc, arg1, arg2);
}
@@ -2134,7 +2134,7 @@ at_begline_loc_p (pattern, p, syntax)
{
const char *prev = p - 2;
boolean prev_prev_backslash = prev > pattern && prev[-1] == '\\';
-
+
return
/* After a subexpression? */
(*prev == '(' && (syntax & RE_NO_BK_PARENS || prev_prev_backslash))
@@ -2154,7 +2154,7 @@ at_endline_loc_p (p, pend, syntax)
const char *next = p;
boolean next_backslash = *next == '\\';
const char *next_next = p + 1 < pend ? p + 1 : NULL;
-
+
return
/* Before a subexpression? */
(syntax & RE_NO_BK_PARENS ? *next == ')'
@@ -2165,7 +2165,7 @@ at_endline_loc_p (p, pend, syntax)
}
-/* Returns true if REGNUM is in one of COMPILE_STACK's elements and
+/* Returns true if REGNUM is in one of COMPILE_STACK's elements and
false if it's not. */
static boolean
@@ -2175,8 +2175,8 @@ group_in_compile_stack (compile_stack, regnum)
{
int this_element;
- for (this_element = compile_stack.avail - 1;
- this_element >= 0;
+ for (this_element = compile_stack.avail - 1;
+ this_element >= 0;
this_element--)
if (compile_stack.stack[this_element].regnum == regnum)
return true;
@@ -2190,9 +2190,9 @@ group_in_compile_stack (compile_stack, regnum)
starting character is in `P[-2]'. (`P[-1]' is the character `-'.)
Then we set the translation of all bits between the starting and
ending characters (inclusive) in the compiled pattern B.
-
+
Return an error code.
-
+
We use these short variable names so we can use the same macros as
`regex_compile' itself. */
@@ -2207,7 +2207,7 @@ compile_range (p_ptr, pend, translate, syntax, b)
const char *p = *p_ptr;
int range_start, range_end;
-
+
if (p == pend)
return REG_ERANGE;
@@ -2216,7 +2216,7 @@ compile_range (p_ptr, pend, translate, syntax, b)
is set, the range endpoints will be negative if we fetch using a
signed char *.
- We also want to fetch the endpoints without translating them; the
+ We also want to fetch the endpoints without translating them; the
appropriate translation is done in the bit-setting loop below. */
range_start = ((unsigned char *) p)[-2];
range_end = ((unsigned char *) p)[0];
@@ -2237,14 +2237,14 @@ compile_range (p_ptr, pend, translate, syntax, b)
{
SET_LIST_BIT (TRANSLATE (this_char));
}
-
+
return REG_NOERROR;
}
/* Failure stack declarations and macros; both re_compile_fastmap and
re_match_2 use a failure stack. These have to be macros because of
REGEX_ALLOCATE. */
-
+
/* Number of failure points for which to initially allocate space
when matching. If this number is exceeded, we allocate more
@@ -2292,8 +2292,8 @@ typedef struct
/* Double the size of FAIL_STACK, up to approximately `re_max_failures' items.
Return 1 if succeeds, and 0 if either ran out of memory
- allocating space for it or it was already too large.
-
+ allocating space for it or it was already too large.
+
REGEX_REALLOCATE requires `destination' be declared. */
#define DOUBLE_FAIL_STACK(fail_stack) \
@@ -2310,7 +2310,7 @@ typedef struct
1)))
-/* Push PATTERN_OP on FAIL_STACK.
+/* Push PATTERN_OP on FAIL_STACK.
Return 1 if was able to do so and 0 if ran out of memory allocating
space to do so. */
@@ -2341,12 +2341,12 @@ typedef struct
/* Push the information about the state we will need
- if we ever fail back to it.
-
+ if we ever fail back to it.
+
Requires variables fail_stack, regstart, regend, reg_info, and
num_regs be declared. DOUBLE_FAIL_STACK requires `destination' be
declared.
-
+
Does `return FAILURE_CODE' if runs out of memory. */
#define PUSH_FAILURE_POINT(pattern_place, string_place, failure_code) \
@@ -2454,7 +2454,7 @@ typedef struct
LOW_REG, HIGH_REG -- the highest and lowest active registers.
REGSTART, REGEND -- arrays of string positions.
REG_INFO -- array of information about each subexpression.
-
+
Also assumes the variables `fail_stack' and (if debugging), `bufp',
`pend', `string1', `size1', `string2', and `size2'. */
@@ -2522,7 +2522,7 @@ typedef struct
The caller must supply the address of a (1 << BYTEWIDTH)-byte data
area as BUFP->fastmap.
-
+
We set the `fastmap', `fastmap_accurate', and `can_be_null' fields in
the pattern buffer.
@@ -2539,7 +2539,7 @@ re_compile_fastmap (bufp)
#endif
/* We don't push any register information onto the failure stack. */
unsigned num_regs = 0;
-
+
register char *fastmap = bufp->fastmap;
unsigned char *pattern = bufp->buffer;
unsigned long size = bufp->used;
@@ -2556,27 +2556,27 @@ re_compile_fastmap (bufp)
boolean succeed_n_p = false;
assert (fastmap != NULL && p != NULL);
-
+
INIT_FAIL_STACK ();
bzero (fastmap, 1 << BYTEWIDTH); /* Assume nothing's valid. */
bufp->fastmap_accurate = 1; /* It will be when we're done. */
bufp->can_be_null = 0;
-
+
while (p != pend || !FAIL_STACK_EMPTY ())
{
if (p == pend)
{
bufp->can_be_null |= path_can_be_null;
-
+
/* Reset for next path. */
path_can_be_null = true;
-
+
p = fail_stack.stack[--fail_stack.avail];
}
/* We should never be about to go beyond the end of the pattern. */
assert (p < pend);
-
+
#ifdef SWITCH_ENUM_BUG
switch ((int) ((re_opcode_t) *p++))
#else
@@ -2700,10 +2700,10 @@ re_compile_fastmap (bufp)
case jump_past_alt:
case dummy_failure_jump:
EXTRACT_NUMBER_AND_INCR (j, p);
- p += j;
+ p += j;
if (j > 0)
continue;
-
+
/* Jump backward implies we just went through the body of a
loop and matched nothing. Opcode jumped to should be
`on_failure_jump' or `succeed_n'. Just treat it like an
@@ -2715,10 +2715,10 @@ re_compile_fastmap (bufp)
p++;
EXTRACT_NUMBER_AND_INCR (j, p);
- p += j;
-
+ p += j;
+
/* If what's on the stack is where we are now, pop it. */
- if (!FAIL_STACK_EMPTY ()
+ if (!FAIL_STACK_EMPTY ()
&& fail_stack.stack[fail_stack.avail - 1] == p)
fail_stack.avail--;
@@ -2756,7 +2756,7 @@ re_compile_fastmap (bufp)
case succeed_n:
/* Get to the number of times to succeed. */
- p += 2;
+ p += 2;
/* Increment p past the n for when k != 0. */
EXTRACT_NUMBER_AND_INCR (k, p);
@@ -2847,7 +2847,7 @@ re_search (bufp, string, size, startpos, range, regs)
int size, startpos, range;
struct re_registers *regs;
{
- return re_search_2 (bufp, NULL, 0, string, size, startpos, range,
+ return re_search_2 (bufp, NULL, 0, string, size, startpos, range,
regs, size);
}
@@ -2855,17 +2855,17 @@ re_search (bufp, string, size, startpos, range, regs)
/* Using the compiled pattern in BUFP->buffer, first tries to match the
virtual concatenation of STRING1 and STRING2, starting first at index
STARTPOS, then at STARTPOS + 1, and so on.
-
+
STRING1 and STRING2 have length SIZE1 and SIZE2, respectively.
-
+
RANGE is how far to scan while trying to match. RANGE = 0 means try
only at STARTPOS; in general, the last start tried is STARTPOS +
RANGE.
-
+
In REGS, return the indices of the virtual concatenation of STRING1
and STRING2 that matched the entire BUFP->buffer and its contained
subexpressions.
-
+
Do not consider matching one past the index STOP in the virtual
concatenation of STRING1 and STRING2.
@@ -2892,7 +2892,7 @@ re_search_2 (bufp, string1, size1, string2, size2, startpos, range, regs, stop)
/* Check for out-of-range STARTPOS. */
if (startpos < 0 || startpos > total_size)
return -1;
-
+
/* Fix up RANGE if it might eventually take us outside
the virtual concatenation of STRING1 and STRING2. */
if (endpos < -1)
@@ -2914,10 +2914,10 @@ re_search_2 (bufp, string1, size1, string2, size2, startpos, range, regs, stop)
if (fastmap && !bufp->fastmap_accurate)
if (re_compile_fastmap (bufp) == -2)
return -2;
-
+
/* Loop through the string, looking for a place to start matching. */
for (;;)
- {
+ {
/* If a fastmap is supplied, skip quickly over characters that
cannot be the start of a match. If the pattern can match the
null string, however, we don't need to skip characters; we want
@@ -2934,7 +2934,7 @@ re_search_2 (bufp, string1, size1, string2, size2, startpos, range, regs, stop)
lim = range - (size1 - startpos);
d = (startpos >= size1 ? string2 - size1 : string1) + startpos;
-
+
/* Written out as an if-else to avoid testing `translate'
inside the loop. */
if (translate)
@@ -2951,7 +2951,7 @@ re_search_2 (bufp, string1, size1, string2, size2, startpos, range, regs, stop)
else /* Searching backwards. */
{
register char c = (size1 == 0 || startpos >= size1
- ? string2[startpos - size1]
+ ? string2[startpos - size1]
: string1[startpos]);
if (!fastmap[(unsigned char) TRANSLATE (c)])
@@ -2968,21 +2968,21 @@ re_search_2 (bufp, string1, size1, string2, size2, startpos, range, regs, stop)
startpos, regs, stop);
if (val >= 0)
return startpos;
-
+
if (val == -2)
return -2;
advance:
- if (!range)
+ if (!range)
break;
- else if (range > 0)
+ else if (range > 0)
{
- range--;
+ range--;
startpos++;
}
else
{
- range++;
+ range++;
startpos--;
}
}
@@ -3001,8 +3001,8 @@ static boolean alt_match_null_string_p (),
onto the failure stack. Other register information, such as the
starting and ending positions (which are addresses), and the list of
inner groups (which is a bits list) are maintained in separate
- variables.
-
+ variables.
+
We are making a (strictly speaking) nonportable assumption here: that
the compiler will pack our bit fields into something that fits into
the type of `word', i.e., is something that fits into one item on the
@@ -3076,7 +3076,7 @@ typedef union
/* Test if at very beginning or at very end of the virtual concatenation
of `string1' and `string2'. If only one string, it's `string2'. */
#define AT_STRINGS_BEG(d) ((d) == (size1 ? string1 : string2) || !size2)
-#define AT_STRINGS_END(d) ((d) == end2)
+#define AT_STRINGS_END(d) ((d) == end2)
/* Test if D points to a character which is word-constituent. We have
@@ -3139,7 +3139,7 @@ re_match (bufp, string, size, pos, regs)
int size, pos;
struct re_registers *regs;
{
- return re_match_2 (bufp, NULL, 0, string, size, pos, regs, size);
+ return re_match_2 (bufp, NULL, 0, string, size, pos, regs, size);
}
#endif /* not emacs */
@@ -3148,7 +3148,7 @@ re_match (bufp, string, size, pos, regs)
the (virtual) concatenation of STRING1 and STRING2 (of length SIZE1
and SIZE2, respectively). We start matching at POS, and stop
matching at STOP.
-
+
If REGS is non-null and the `no_sub' field of BUFP is nonzero, we
store offsets for the substring each group matched in REGS. See the
documentation for exactly how many groups we fill.
@@ -3179,7 +3179,7 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
/* Where we are in the data, and the end of the current string. */
const char *d, *dend;
-
+
/* Where we are in the pattern, and the end of the pattern. */
unsigned char *p = bufp->buffer;
register unsigned char *pend = p + bufp->used;
@@ -3206,7 +3206,7 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
return, for use in backreferences. The number here includes
an element for register zero. */
unsigned num_regs = bufp->re_nsub + 1;
-
+
/* The currently active registers. */
unsigned lowest_active_reg = NO_LOWEST_ACTIVE_REG;
unsigned highest_active_reg = NO_HIGHEST_ACTIVE_REG;
@@ -3233,15 +3233,15 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
matched any of the pattern so far this time through the reg_num-th
subexpression. These two fields get reset each time through any
loop their register is in. */
- register_info_type *reg_info;
+ register_info_type *reg_info;
/* The following record the register info as found in the above
- variables when we find a match better than any we've seen before.
+ variables when we find a match better than any we've seen before.
This happens as we backtrack through the failure points, which in
turn happens only if we have not yet matched the entire string. */
unsigned best_regs_set = false;
const char **best_regstart, **best_regend;
-
+
/* Logically, this is `best_regend[0]'. But we don't want to have to
allocate space for that if we're not allocating space for anything
else (see below). Also, we never need info about register 0 for
@@ -3258,13 +3258,13 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
#ifdef DEBUG
/* Counts the total number of registers pushed. */
- unsigned num_regs_pushed = 0;
+ unsigned num_regs_pushed = 0;
#endif
DEBUG_PRINT1 ("\n\nEntering re_match_2.\n");
-
+
INIT_FAIL_STACK ();
-
+
/* Do not bother to initialize all the register variables if there are
no groups in the pattern, as it takes a fair amount of time. If
there are groups, we include space for register 0 (the whole
@@ -3282,8 +3282,8 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
reg_dummy = REGEX_TALLOC (num_regs, const char *);
reg_info_dummy = REGEX_TALLOC (num_regs, register_info_type);
- if (!(regstart && regend && old_regstart && old_regend && reg_info
- && best_regstart && best_regend && reg_dummy && reg_info_dummy))
+ if (!(regstart && regend && old_regstart && old_regend && reg_info
+ && best_regstart && best_regend && reg_dummy && reg_info_dummy))
{
FREE_VARIABLES ();
return -2;
@@ -3306,21 +3306,21 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
FREE_VARIABLES ();
return -1;
}
-
+
/* Initialize subexpression text positions to -1 to mark ones that no
start_memory/stop_memory has been seen for. Also initialize the
register information struct. */
for (mcnt = 1; mcnt < num_regs; mcnt++)
{
- regstart[mcnt] = regend[mcnt]
+ regstart[mcnt] = regend[mcnt]
= old_regstart[mcnt] = old_regend[mcnt] = REG_UNSET_VALUE;
-
+
REG_MATCH_NULL_STRING_P (reg_info[mcnt]) = MATCH_NULL_UNSET_VALUE;
IS_ACTIVE (reg_info[mcnt]) = 0;
MATCHED_SOMETHING (reg_info[mcnt]) = 0;
EVER_MATCHED_SOMETHING (reg_info[mcnt]) = 0;
}
-
+
/* We move `string1' into `string2' if the latter's empty -- but not if
`string1' is null. */
if (size2 == 0 && string1 != NULL)
@@ -3345,7 +3345,7 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
end_match_2 = string2 + stop - size1;
}
- /* `p' scans through the pattern as `d' scans through the data.
+ /* `p' scans through the pattern as `d' scans through the data.
`dend' is the end of the input string that `d' points within. `d'
is advanced into the following input string whenever necessary, but
this happens before fetching; therefore, at the beginning of the
@@ -3367,7 +3367,7 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
DEBUG_PRINT1 ("The string to match is: `");
DEBUG_PRINT_DOUBLE_STRING (d, string1, size1, string2, size2);
DEBUG_PRINT1 ("'\n");
-
+
/* This loops over pattern commands. It exits by returning from the
function if the match is complete, or it drops through if the match
fails at this starting point in the input data. */
@@ -3378,16 +3378,16 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
if (p == pend)
{ /* End of pattern means we might have succeeded. */
DEBUG_PRINT1 ("end of pattern ... ");
-
+
/* If we haven't matched the entire string, and we want the
longest match, try backtracking. */
if (d != end_match_2)
{
DEBUG_PRINT1 ("backtracking.\n");
-
+
if (!FAIL_STACK_EMPTY ())
{ /* More failure points to try. */
- boolean same_str_p = (FIRST_STRING_P (match_end)
+ boolean same_str_p = (FIRST_STRING_P (match_end)
== MATCHING_IN_FIRST_STRING);
/* If exceeds best match so far, save it. */
@@ -3397,20 +3397,20 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
{
best_regs_set = true;
match_end = d;
-
+
DEBUG_PRINT1 ("\nSAVING match as best so far.\n");
-
+
for (mcnt = 1; mcnt < num_regs; mcnt++)
{
best_regstart[mcnt] = regstart[mcnt];
best_regend[mcnt] = regend[mcnt];
}
}
- goto fail;
+ goto fail;
}
/* If no failure points, don't restore garbage. */
- else if (best_regs_set)
+ else if (best_regs_set)
{
restore_best_regs:
/* Restore best match. It may happen that `dend ==
@@ -3419,7 +3419,7 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
strings `x-' and `y-z-', if the two strings are
not consecutive in memory. */
DEBUG_PRINT1 ("Restoring best registers.\n");
-
+
d = match_end;
dend = ((d >= string1 && d <= end1)
? end_match_1 : end_match_2);
@@ -3474,7 +3474,7 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
regs->end[0] = (MATCHING_IN_FIRST_STRING ? d - string1
: d - string2 + size1);
}
-
+
/* Go through the first `min (num_regs, regs->num_regs)'
registers, since that is all we initialized. */
for (mcnt = 1; mcnt < MIN (num_regs, regs->num_regs); mcnt++)
@@ -3487,7 +3487,7 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
regs->end[mcnt] = POINTER_TO_OFFSET (regend[mcnt]);
}
}
-
+
/* If the regs structure we return has more elements than
were in the pattern, set the extra elements to -1. If
we (re)allocated the registers, this is the case,
@@ -3503,8 +3503,8 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
nfailure_points_pushed - nfailure_points_popped);
DEBUG_PRINT2 ("%u registers pushed.\n", num_regs_pushed);
- mcnt = d - pos - (MATCHING_IN_FIRST_STRING
- ? string1
+ mcnt = d - pos - (MATCHING_IN_FIRST_STRING
+ ? string1
: string2 - size1);
DEBUG_PRINT2 ("Returning %d from re_match_2.\n", mcnt);
@@ -3594,7 +3594,7 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
p += 1 + *p;
if (!not) goto fail;
-
+
SET_REGS_MATCHED ();
d++;
break;
@@ -3611,9 +3611,9 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
/* Find out if this group can match the empty string. */
p1 = p; /* To send to group_match_null_string_p. */
-
+
if (REG_MATCH_NULL_STRING_P (reg_info[*p]) == MATCH_NULL_UNSET_VALUE)
- REG_MATCH_NULL_STRING_P (reg_info[*p])
+ REG_MATCH_NULL_STRING_P (reg_info[*p])
= group_match_null_string_p (&p1, pend, reg_info);
/* Save the position in the string where we were the last time
@@ -3624,7 +3624,7 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
old_regstart[*p] = REG_MATCH_NULL_STRING_P (reg_info[*p])
? REG_UNSET (regstart[*p]) ? d : regstart[*p]
: regstart[*p];
- DEBUG_PRINT2 (" old_regstart: %d\n",
+ DEBUG_PRINT2 (" old_regstart: %d\n",
POINTER_TO_OFFSET (old_regstart[*p]));
regstart[*p] = d;
@@ -3632,10 +3632,10 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
IS_ACTIVE (reg_info[*p]) = 1;
MATCHED_SOMETHING (reg_info[*p]) = 0;
-
+
/* This is the new highest active register. */
highest_active_reg = *p;
-
+
/* If nothing was active before, this is the new lowest active
register. */
if (lowest_active_reg == NO_LOWEST_ACTIVE_REG)
@@ -3651,7 +3651,7 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
number, and the number of inner groups. */
case stop_memory:
DEBUG_PRINT3 ("EXECUTING stop_memory %d (%d):\n", *p, p[1]);
-
+
/* We need to save the string position the last time we were at
this close-group operator in case the group is operated
upon by a repetition operator, e.g., with `((a*)*(b*)*)*'
@@ -3660,7 +3660,7 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
old_regend[*p] = REG_MATCH_NULL_STRING_P (reg_info[*p])
? REG_UNSET (regend[*p]) ? d : regend[*p]
: regend[*p];
- DEBUG_PRINT2 (" old_regend: %d\n",
+ DEBUG_PRINT2 (" old_regend: %d\n",
POINTER_TO_OFFSET (old_regend[*p]));
regend[*p] = d;
@@ -3668,7 +3668,7 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
/* This register isn't active anymore. */
IS_ACTIVE (reg_info[*p]) = 0;
-
+
/* If this was the only register active, nothing is active
anymore. */
if (lowest_active_reg == highest_active_reg)
@@ -3684,7 +3684,7 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
unsigned char r = *p - 1;
while (r > 0 && !IS_ACTIVE (reg_info[r]))
r--;
-
+
/* If we end up at register zero, that means that we saved
the registers as the result of an `on_failure_jump', not
a `start_memory', and we jumped to past the innermost
@@ -3700,7 +3700,7 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
else
highest_active_reg = r;
}
-
+
/* If just failed to match something this time around with a
group that's operated on by a repetition operator, try to
force exit from the ``loop'', and restore the register
@@ -3708,10 +3708,10 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
last match. */
if ((!MATCHED_SOMETHING (reg_info[*p])
|| (re_opcode_t) p[-3] == start_memory)
- && (p + 2) < pend)
+ && (p + 2) < pend)
{
boolean is_a_jump_n = false;
-
+
p1 = p + 2;
mcnt = 0;
switch ((re_opcode_t) *p1++)
@@ -3726,12 +3726,12 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
if (is_a_jump_n)
p1 += 2;
break;
-
+
default:
/* do nothing */ ;
}
p1 += mcnt;
-
+
/* If the next operation is a jump backwards in the pattern
to an on_failure_jump right before the start_memory
corresponding to this stop_memory, exit from the loop
@@ -3745,17 +3745,17 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
failed match, e.g., with `(a*)*b' against `ab' for
regstart[1], and, e.g., with `((a*)*(b*)*)*'
against `aba' for regend[3].
-
+
Also restore the registers for inner groups for,
e.g., `((a*)(b*))*' against `aba' (register 3 would
otherwise get trashed). */
-
+
if (EVER_MATCHED_SOMETHING (reg_info[*p]))
{
- unsigned r;
-
+ unsigned r;
+
EVER_MATCHED_SOMETHING (reg_info[*p]) = 0;
-
+
/* Restore this and inner groups' (if any) registers. */
for (r = *p; r < *p + *(p + 1); r++)
{
@@ -3764,7 +3764,7 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
/* xx why this test? */
if ((int) old_regend[r] >= (int) regstart[r])
regend[r] = old_regend[r];
- }
+ }
}
p1++;
EXTRACT_NUMBER_AND_INCR (mcnt, p1);
@@ -3773,7 +3773,7 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
goto fail;
}
}
-
+
/* Move past the register number and the inner group count. */
p += 2;
break;
@@ -3790,16 +3790,16 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
/* Can't back reference a group which we've never matched. */
if (REG_UNSET (regstart[regno]) || REG_UNSET (regend[regno]))
goto fail;
-
+
/* Where in input to try to start matching. */
d2 = regstart[regno];
-
+
/* Where to stop matching; if both the place to start and
the place to stop matching are in the same string, then
set to the place to stop, otherwise, for now have to use
the end of the first string. */
- dend2 = ((FIRST_STRING_P (regstart[regno])
+ dend2 = ((FIRST_STRING_P (regstart[regno])
== FIRST_STRING_P (regend[regno]))
? regend[regno] : end_match_1);
for (;;)
@@ -3823,16 +3823,16 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
/* How many characters left in this segment to match. */
mcnt = dend - d;
-
+
/* Want how many consecutive characters we can match in
one shot, so, if necessary, adjust the count. */
if (mcnt > dend2 - d2)
mcnt = dend2 - d2;
-
+
/* Compare that many; failure if mismatch, else move
past them. */
- if (translate
- ? bcmp_translate (d, d2, mcnt, translate)
+ if (translate
+ ? bcmp_translate (d, d2, mcnt, translate)
: bcmp (d, d2, mcnt))
goto fail;
d += mcnt, d2 += mcnt;
@@ -3846,7 +3846,7 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
`newline_anchor' is set, after newlines. */
case begline:
DEBUG_PRINT1 ("EXECUTING begline.\n");
-
+
if (AT_STRINGS_BEG (d))
{
if (!bufp->not_bol) break;
@@ -3867,7 +3867,7 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
{
if (!bufp->not_eol) break;
}
-
+
/* We have to ``prefetch'' the next character. */
else if ((d == end1 ? *string2 : *d) == '\n'
&& bufp->newline_anchor)
@@ -3901,7 +3901,7 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
then the . fails against the \n. But the next thing we want
to do is match the \n against the \n; if we restored the
string value, we would be back at the foo.
-
+
Because this is used only in specific cases, we don't need to
check all the things that `on_failure_jump' does, to make
sure the right things get saved on the stack. Hence we don't
@@ -3911,7 +3911,7 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
case; that seems worse than this. */
case on_failure_keep_string_jump:
DEBUG_PRINT1 ("EXECUTING on_failure_keep_string_jump");
-
+
EXTRACT_NUMBER_AND_INCR (mcnt, p);
DEBUG_PRINT3 (" %d (to 0x%x):\n", mcnt, p + mcnt);
@@ -3920,7 +3920,7 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
/* Uses of on_failure_jump:
-
+
Each alternative starts with an on_failure_jump that points
to the beginning of the next alternative. Each alternative
except the last ends with a jump that in effect jumps past
@@ -3986,7 +3986,7 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
would have to backtrack because of (as in, e.g., `a*a')
then we can change to pop_failure_jump, because we'll
never have to backtrack.
-
+
This is not true in the case of alternatives: in
`(a|ab)*' we do need to backtrack to the `ab' alternative
(e.g., if the string was `ab'). But instead of trying to
@@ -4018,7 +4018,7 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
p1 = p + mcnt;
/* p1[0] ... p1[2] are the `on_failure_jump' corresponding
- to the `maybe_finalize_jump' of this case. Examine what
+ to the `maybe_finalize_jump' of this case. Examine what
follows. */
if ((re_opcode_t) p1[3] == exactn && p1[5] != c)
{
@@ -4026,12 +4026,12 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
DEBUG_PRINT3 (" %c != %c => pop_failure_jump.\n",
c, p1[5]);
}
-
+
else if ((re_opcode_t) p1[3] == charset
|| (re_opcode_t) p1[3] == charset_not)
{
int not = (re_opcode_t) p1[3] == charset_not;
-
+
if (c < (unsigned char) (p1[4] * BYTEWIDTH)
&& p1[5 + c / BYTEWIDTH] & (1 << (c % BYTEWIDTH)))
not = !not;
@@ -4080,7 +4080,7 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
}
/* Note fall through. */
-
+
/* Unconditionally jump (without popping any failure points). */
case jump:
unconditional_jump:
@@ -4090,7 +4090,7 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
DEBUG_PRINT2 ("(to 0x%x).\n", p);
break;
-
+
/* We need this opcode so we can detect where alternatives end
in `group_match_null_string_p' et al. */
case jump_past_alt:
@@ -4125,7 +4125,7 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
/* Have to succeed matching what follows at least n times.
After that, handle like `on_failure_jump'. */
- case succeed_n:
+ case succeed_n:
EXTRACT_NUMBER (mcnt, p + 2);
DEBUG_PRINT2 ("EXECUTING succeed_n %d.\n", mcnt);
@@ -4146,8 +4146,8 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
goto on_failure;
}
break;
-
- case jump_n:
+
+ case jump_n:
EXTRACT_NUMBER (mcnt, p + 2);
DEBUG_PRINT2 ("EXECUTING jump_n %d.\n", mcnt);
@@ -4156,13 +4156,13 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
{
mcnt--;
STORE_NUMBER (p + 2, mcnt);
- goto unconditional_jump;
+ goto unconditional_jump;
}
/* If don't have to jump any more, skip over the rest of command. */
- else
- p += 4;
+ else
+ p += 4;
break;
-
+
case set_number_at:
{
DEBUG_PRINT1 ("EXECUTING set_number_at.\n");
@@ -4207,13 +4207,13 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
if (PTR_CHAR_POS ((unsigned char *) d) >= point)
goto fail;
break;
-
+
case at_dot:
DEBUG_PRINT1 ("EXECUTING at_dot.\n");
if (PTR_CHAR_POS ((unsigned char *) d) != point)
goto fail;
break;
-
+
case after_dot:
DEBUG_PRINT1 ("EXECUTING after_dot.\n");
if (PTR_CHAR_POS ((unsigned char *) d) <= point)
@@ -4266,7 +4266,7 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
SET_REGS_MATCHED ();
d++;
break;
-
+
case notwordchar:
DEBUG_PRINT1 ("EXECUTING non-Emacs notwordchar.\n");
PREFETCH ();
@@ -4276,7 +4276,7 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
d++;
break;
#endif /* not emacs */
-
+
default:
abort ();
}
@@ -4301,7 +4301,7 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
if (p < pend)
{
boolean is_a_jump_n = false;
-
+
/* If failed to a backwards jump that's part of a repetition
loop, need to pop this failure point and use the next one. */
switch ((re_opcode_t) *p)
@@ -4313,7 +4313,7 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
case jump:
p1 = p + 1;
EXTRACT_NUMBER_AND_INCR (mcnt, p1);
- p1 += mcnt;
+ p1 += mcnt;
if ((is_a_jump_n && (re_opcode_t) *p1 == succeed_n)
|| (!is_a_jump_n
@@ -4344,10 +4344,10 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
/* We are passed P pointing to a register number after a start_memory.
-
+
Return true if the pattern up to the corresponding stop_memory can
match the empty string, and false otherwise.
-
+
If we find the matching stop_memory, sets P to point to one past its number.
Otherwise, sets P to an undefined byte less than or equal to END.
@@ -4361,20 +4361,20 @@ group_match_null_string_p (p, end, reg_info)
int mcnt;
/* Point to after the args to the start_memory. */
unsigned char *p1 = *p + 2;
-
+
while (p1 < end)
{
/* Skip over opcodes that can match nothing, and return true or
false, as appropriate, when we get to one that can't, or to the
matching stop_memory. */
-
+
switch ((re_opcode_t) *p1)
{
/* Could be either a loop or a series of alternatives. */
case on_failure_jump:
p1++;
EXTRACT_NUMBER_AND_INCR (mcnt, p1);
-
+
/* If the next operation is not a jump backwards in the
pattern. */
@@ -4388,7 +4388,7 @@ group_match_null_string_p (p, end, reg_info)
/on_failure_jump/0/6/exactn/1/a/jump_past_alt/0/6
/on_failure_jump/0/6/exactn/1/b/jump_past_alt/0/3
- /exactn/1/c
+ /exactn/1/c
So, we have to first go through the first (n-1)
alternatives and then deal with the last one separately. */
@@ -4404,19 +4404,19 @@ group_match_null_string_p (p, end, reg_info)
is, including the ending `jump_past_alt' and
its number. */
- if (!alt_match_null_string_p (p1, p1 + mcnt - 3,
+ if (!alt_match_null_string_p (p1, p1 + mcnt - 3,
reg_info))
return false;
/* Move to right after this alternative, including the
jump_past_alt. */
- p1 += mcnt;
+ p1 += mcnt;
/* Break if it's the beginning of an n-th alternative
that doesn't begin with an on_failure_jump. */
if ((re_opcode_t) *p1 != on_failure_jump)
break;
-
+
/* Still have to check that it's not an n-th
alternative that starts with an on_failure_jump. */
p1++;
@@ -4441,14 +4441,14 @@ group_match_null_string_p (p, end, reg_info)
} /* if mcnt > 0 */
break;
-
+
case stop_memory:
assert (p1[1] == **p);
*p = p1 + 2;
return true;
-
- default:
+
+ default:
if (!common_op_match_null_string_p (&p1, end, reg_info))
return false;
}
@@ -4461,7 +4461,7 @@ group_match_null_string_p (p, end, reg_info)
/* Similar to group_match_null_string_p, but doesn't deal with alternatives:
It expects P to be the first byte of a single alternative and END one
byte past the last. The alternative can contain groups. */
-
+
static boolean
alt_match_null_string_p (p, end, reg_info)
unsigned char *p, *end;
@@ -4469,12 +4469,12 @@ alt_match_null_string_p (p, end, reg_info)
{
int mcnt;
unsigned char *p1 = p;
-
+
while (p1 < end)
{
- /* Skip over opcodes that can match nothing, and break when we get
+ /* Skip over opcodes that can match nothing, and break when we get
to one that can't. */
-
+
switch ((re_opcode_t) *p1)
{
/* It's a loop. */
@@ -4483,8 +4483,8 @@ alt_match_null_string_p (p, end, reg_info)
EXTRACT_NUMBER_AND_INCR (mcnt, p1);
p1 += mcnt;
break;
-
- default:
+
+ default:
if (!common_op_match_null_string_p (&p1, end, reg_info))
return false;
}
@@ -4495,8 +4495,8 @@ alt_match_null_string_p (p, end, reg_info)
/* Deals with the ops common to group_match_null_string_p and
- alt_match_null_string_p.
-
+ alt_match_null_string_p.
+
Sets P to one after the op and its arguments, if any. */
static boolean
@@ -4531,7 +4531,7 @@ common_op_match_null_string_p (p, end, reg_info)
reg_no = *p1;
assert (reg_no > 0 && reg_no <= MAX_REGNUM);
ret = group_match_null_string_p (&p1, end, reg_info);
-
+
/* Have to set this here in case we're checking a group which
contains a group and a back reference to it. */
@@ -4541,7 +4541,7 @@ common_op_match_null_string_p (p, end, reg_info)
if (!ret)
return false;
break;
-
+
/* If this is an optimized succeed_n for zero times, make the jump. */
case jump:
EXTRACT_NUMBER_AND_INCR (mcnt, p1);
@@ -4553,7 +4553,7 @@ common_op_match_null_string_p (p, end, reg_info)
case succeed_n:
/* Get to the number of times to succeed. */
- p1 += 2;
+ p1 += 2;
EXTRACT_NUMBER_AND_INCR (mcnt, p1);
if (mcnt == 0)
@@ -4566,7 +4566,7 @@ common_op_match_null_string_p (p, end, reg_info)
return false;
break;
- case duplicate:
+ case duplicate:
if (!REG_MATCH_NULL_STRING_P (reg_info[*p1]))
return false;
break;
@@ -4586,7 +4586,7 @@ common_op_match_null_string_p (p, end, reg_info)
/* Return zero if TRANSLATE[S1] and TRANSLATE[S2] are identical for LEN
bytes; nonzero otherwise. */
-
+
static int
bcmp_translate (s1, s2, len, translate)
unsigned char *s1, *s2;
@@ -4607,10 +4607,10 @@ bcmp_translate (s1, s2, len, translate)
/* re_compile_pattern is the GNU regular expression compiler: it
compiles PATTERN (of length SIZE) and puts the result in BUFP.
Returns 0 if the pattern was valid, otherwise an error string.
-
+
Assumes the `allocated' (and perhaps `buffer') and `translate' fields
are set in BUFP on entry.
-
+
We call regex_compile to do the actual compilation. */
const char *
@@ -4620,23 +4620,23 @@ re_compile_pattern (pattern, length, bufp)
struct re_pattern_buffer *bufp;
{
reg_errcode_t ret;
-
+
/* GNU code is written to assume at least RE_NREGS registers will be set
(and at least one extra will be -1). */
bufp->regs_allocated = REGS_UNALLOCATED;
-
+
/* And GNU code determines whether or not to get register information
by passing null for the REGS argument to re_match, etc., not by
setting no_sub. */
bufp->no_sub = 0;
-
+
/* Match anchors at newline. */
bufp->newline_anchor = 1;
-
+
ret = regex_compile (pattern, length, re_syntax_options, bufp);
return re_error_msg[(int) ret];
-}
+}
/* Entry points compatible with 4.2 BSD regex library. We don't define
them if this is an Emacs or POSIX compilation. */
@@ -4651,7 +4651,7 @@ re_comp (s)
const char *s;
{
reg_errcode_t ret;
-
+
if (!s)
{
if (!re_comp_buf.buffer)
@@ -4678,7 +4678,7 @@ re_comp (s)
re_comp_buf.newline_anchor = 1;
ret = regex_compile (s, strlen (s), re_syntax_options, &re_comp_buf);
-
+
/* Yes, we're discarding `const' here. */
return (char *) re_error_msg[(int) ret];
}
@@ -4735,7 +4735,7 @@ re_exec (s)
int
regcomp (preg, pattern, cflags)
regex_t *preg;
- const char *pattern;
+ const char *pattern;
int cflags;
{
reg_errcode_t ret;
@@ -4746,17 +4746,17 @@ regcomp (preg, pattern, cflags)
/* regex_compile will allocate the space for the compiled pattern. */
preg->buffer = 0;
preg->allocated = 0;
-
+
/* Don't bother to use a fastmap when searching. This simplifies the
REG_NEWLINE case: if we used a fastmap, we'd have to put all the
characters after newlines into the fastmap. This way, we just try
every character. */
preg->fastmap = 0;
-
+
if (cflags & REG_ICASE)
{
unsigned i;
-
+
preg->translate = (char *) malloc (CHAR_SET_SIZE);
if (preg->translate == NULL)
return (int) REG_ESPACE;
@@ -4781,38 +4781,38 @@ regcomp (preg, pattern, cflags)
preg->no_sub = !!(cflags & REG_NOSUB);
- /* POSIX says a null character in the pattern terminates it, so we
+ /* POSIX says a null character in the pattern terminates it, so we
can use strlen here in compiling the pattern. */
ret = regex_compile (pattern, strlen (pattern), syntax, preg);
-
+
/* POSIX doesn't distinguish between an unmatched open-group and an
unmatched close-group: both are REG_EPAREN. */
if (ret == REG_ERPAREN) ret = REG_EPAREN;
-
+
return (int) ret;
}
/* regexec searches for a given pattern, specified by PREG, in the
string STRING.
-
+
If NMATCH is zero or REG_NOSUB was set in the cflags argument to
`regcomp', we ignore PMATCH. Otherwise, we assume PMATCH has at
least NMATCH elements, and we set them to the offsets of the
corresponding matched substrings.
-
+
EFLAGS specifies `execution flags' which affect matching: if
REG_NOTBOL is set, then ^ does not match at the beginning of the
string; if REG_NOTEOL is set, then $ does not match at the end.
-
+
We return 0 if we find a match and REG_NOMATCH if not. */
int
regexec (preg, string, nmatch, pmatch, eflags)
const regex_t *preg;
- const char *string;
- size_t nmatch;
- regmatch_t pmatch[];
+ const char *string;
+ size_t nmatch;
+ regmatch_t pmatch[];
int eflags;
{
int ret;
@@ -4822,15 +4822,15 @@ regexec (preg, string, nmatch, pmatch, eflags)
boolean want_reg_info = !preg->no_sub && nmatch > 0;
private_preg = *preg;
-
+
private_preg.not_bol = !!(eflags & REG_NOTBOL);
private_preg.not_eol = !!(eflags & REG_NOTEOL);
-
+
/* The user has told us exactly how many registers to return
information about, via `nmatch'. We have to pass that on to the
matching routines. */
private_preg.regs_allocated = REGS_FIXED;
-
+
if (want_reg_info)
{
regs.num_regs = nmatch;
@@ -4844,7 +4844,7 @@ regexec (preg, string, nmatch, pmatch, eflags)
ret = re_search (&private_preg, string, len,
/* start: */ 0, /* range: */ len,
want_reg_info ? &regs : (struct re_registers *) 0);
-
+
/* Copy the register information to the POSIX structure. */
if (want_reg_info)
{
@@ -4884,7 +4884,7 @@ regerror (errcode, preg, errbuf, errbuf_size)
if (errcode < 0
|| errcode >= (sizeof (re_error_msg) / sizeof (re_error_msg[0])))
- /* Only error codes returned by the rest of the code should be passed
+ /* Only error codes returned by the rest of the code should be passed
to this routine. If we are given anything else, or if other regex
code generates an invalid error code, then the program has a bug.
Dump core so we can fix it. */
@@ -4898,7 +4898,7 @@ regerror (errcode, preg, errbuf, errbuf_size)
msg = "Success";
msg_size = strlen (msg) + 1; /* Includes the null. */
-
+
if (errbuf_size != 0)
{
if (msg_size > errbuf_size)
@@ -4923,7 +4923,7 @@ regfree (preg)
if (preg->buffer != NULL)
free (preg->buffer);
preg->buffer = NULL;
-
+
preg->allocated = 0;
preg->used = 0;
diff --git a/util/kconfig/regex.h b/util/kconfig/regex.h
index 408dd21034..91243971af 100644
--- a/util/kconfig/regex.h
+++ b/util/kconfig/regex.h
@@ -42,7 +42,7 @@ typedef unsigned reg_syntax_t;
#define RE_BACKSLASH_ESCAPE_IN_LISTS (1)
/* If this bit is not set, then + and ? are operators, and \+ and \? are
- literals.
+ literals.
If set, then \+ and \? are operators and + and ? are literals. */
#define RE_BK_PLUS_QM (RE_BACKSLASH_ESCAPE_IN_LISTS << 1)
@@ -58,7 +58,7 @@ typedef unsigned reg_syntax_t;
^ is an anchor if it is at the beginning of a regular
expression or after an open-group or an alternation operator;
$ is an anchor if it is at the end of a regular expression, or
- before a close-group or an alternation operator.
+ before a close-group or an alternation operator.
This bit could be (re)combined with RE_CONTEXT_INDEP_OPS, because
POSIX draft 11.2 says that * etc. in leading positions is undefined.
@@ -69,7 +69,7 @@ typedef unsigned reg_syntax_t;
/* If this bit is set, then special characters are always special
regardless of where they are in the pattern.
If this bit is not set, then special characters are special only in
- some contexts; otherwise they are ordinary. Specifically,
+ some contexts; otherwise they are ordinary. Specifically,
* + ? and intervals are only special when not after the beginning,
open-group, or alternation operator. */
#define RE_CONTEXT_INDEP_OPS (RE_CONTEXT_INDEP_ANCHORS << 1)
@@ -91,7 +91,7 @@ typedef unsigned reg_syntax_t;
#define RE_HAT_LISTS_NOT_NEWLINE (RE_DOT_NOT_NULL << 1)
/* If this bit is set, either \{...\} or {...} defines an
- interval, depending on RE_NO_BK_BRACES.
+ interval, depending on RE_NO_BK_BRACES.
If not set, \{, \}, {, and } are literals. */
#define RE_INTERVALS (RE_HAT_LISTS_NOT_NEWLINE << 1)
@@ -116,7 +116,7 @@ typedef unsigned reg_syntax_t;
If not set, then \<digit> is a back-reference. */
#define RE_NO_BK_REFS (RE_NO_BK_PARENS << 1)
-/* If this bit is set, then | is an alternation operator, and \| is literal.
+/* If this bit is set, then | is an alternation operator, and \| is literal.
If not set, then \| is an alternation operator, and | is literal. */
#define RE_NO_BK_VBAR (RE_NO_BK_REFS << 1)
@@ -138,7 +138,7 @@ extern reg_syntax_t re_syntax_options;
/* Define combinations of the above bits for the standard possibilities.
(The [[[ comments delimit what gets put into the Texinfo file, so
- don't delete them!) */
+ don't delete them!) */
/* [[[begin syntaxes]]] */
#define RE_SYNTAX_EMACS 0
@@ -205,7 +205,7 @@ extern reg_syntax_t re_syntax_options;
#ifdef RE_DUP_MAX
#undef RE_DUP_MAX
#endif
-#define RE_DUP_MAX ((1 << 15) - 1)
+#define RE_DUP_MAX ((1 << 15) - 1)
/* POSIX `cflags' bits (i.e., information for `regcomp'). */
@@ -217,7 +217,7 @@ extern reg_syntax_t re_syntax_options;
/* If this bit is set, then ignore case when matching.
If not set, then case is significant. */
#define REG_ICASE (REG_EXTENDED << 1)
-
+
/* If this bit is set, then anchors do not match at newline
characters in the string.
If not set, then anchors do match at newlines. */
@@ -256,7 +256,7 @@ typedef enum
REG_EESCAPE, /* Trailing backslash. */
REG_ESUBREG, /* Invalid back reference. */
REG_EBRACK, /* Unmatched left bracket. */
- REG_EPAREN, /* Parenthesis imbalance. */
+ REG_EPAREN, /* Parenthesis imbalance. */
REG_EBRACE, /* Unmatched \{. */
REG_BADBR, /* Invalid contents of \{\}. */
REG_ERANGE, /* Invalid range end. */
@@ -287,7 +287,7 @@ struct re_pattern_buffer
unsigned long allocated;
/* Number of bytes actually used in `buffer'. */
- unsigned long used;
+ unsigned long used;
/* Syntax setting with which the pattern was compiled. */
reg_syntax_t syntax;
@@ -331,7 +331,7 @@ struct re_pattern_buffer
unsigned no_sub : 1;
/* If set, a beginning-of-line anchor doesn't match at the
- beginning of the string. */
+ beginning of the string. */
unsigned not_bol : 1;
/* Similarly for an end-of-line anchor. */
@@ -443,7 +443,7 @@ extern int re_match
/* Relates to `re_match' as `re_search_2' relates to `re_search'. */
-extern int re_match_2
+extern int re_match_2
_RE_ARGS ((struct re_pattern_buffer *buffer, const char *string1,
int length1, const char *string2, int length2,
int start, struct re_registers *regs, int stop));
diff --git a/util/kconfig/zconf.tab.c_shipped b/util/kconfig/zconf.tab.c_shipped
index b0c90c32b1..34560605f5 100644
--- a/util/kconfig/zconf.tab.c_shipped
+++ b/util/kconfig/zconf.tab.c_shipped
@@ -1393,7 +1393,7 @@ yyparse ()
#endif
#endif
{
-
+
int yystate;
int yyn;
int yyresult;
diff --git a/util/lbtdump/Makefile b/util/lbtdump/Makefile
index f6a4fbd40a..9e923aea6a 100644
--- a/util/lbtdump/Makefile
+++ b/util/lbtdump/Makefile
@@ -1,7 +1,7 @@
TARGET=lbtdump
CC=gcc
-CFLAGS=-g -O -Wall
+CFLAGS=-g -O -Wall
all: $(TARGET)
diff --git a/util/lbtdump/lbtdump.c b/util/lbtdump/lbtdump.c
index 2c08ec8dc9..82ea06c024 100644
--- a/util/lbtdump/lbtdump.c
+++ b/util/lbtdump/lbtdump.c
@@ -48,8 +48,8 @@ unsigned long compute_checksum(void *addr, unsigned long length)
(((char *)rec) < (((char *)head) + sizeof(*head) + head->table_bytes)) && \
(rec->size >= 1) && \
((((char *)rec) + rec->size) <= (((char *)head) + sizeof(*head) + head->table_bytes)); \
- rec = (struct lb_record *)(((char *)rec) + rec->size))
-
+ rec = (struct lb_record *)(((char *)rec) + rec->size))
+
static int count_lb_records(struct lb_header *head)
{
@@ -72,7 +72,7 @@ struct lb_header *find_lb_table(void *base, unsigned long start, unsigned long e
struct lb_record *recs = (struct lb_record *)(((char*)base) + addr + sizeof(*head));
if (memcmp(head->signature, "LBIO", 4) != 0)
continue;
- fprintf(stdout, "Found candidate at: %08lx-%08lx\n",
+ fprintf(stdout, "Found candidate at: %08lx-%08lx\n",
addr, addr + head->table_bytes);
if (head->header_bytes != sizeof(*head)) {
fprintf(stderr, "Header bytes of %d are incorrect\n",
@@ -162,7 +162,7 @@ void print_memory(struct lb_record *ptr, unsigned long addr)
(unsigned long long)start, (unsigned long long)end, mem_type);
pretty_print_number(stdout, start);
printf(" - ");
- pretty_print_number(stdout, end);
+ pretty_print_number(stdout, end);
printf(")\n");
}
}
@@ -174,7 +174,7 @@ void print_mainboard(struct lb_record *ptr, unsigned long addr)
rec = (struct lb_mainboard *)ptr;
max_size = rec->size - sizeof(*rec);
printf("vendor: %.*s part number: %.*s\n",
- max_size - rec->vendor_idx, rec->strings + rec->vendor_idx,
+ max_size - rec->vendor_idx, rec->strings + rec->vendor_idx,
max_size - rec->part_number_idx, rec->strings + rec->part_number_idx);
}
@@ -235,7 +235,7 @@ void print_option_checksum(struct lb_record *ptr, unsigned long addr)
struct cmos_checksum *rec;
rec = (struct cmos_checksum *)ptr;
printf("checksum %d, rec len %d, range %d-%d location %d type %d\n",
- rec->tag, rec->size,
+ rec->tag, rec->size,
rec->range_start, rec->range_end, rec->location, rec->type);
}
@@ -271,7 +271,7 @@ static struct lb_record *next_record(struct lb_record *rec)
return (struct lb_record *)(((char *)rec) + rec->size);
}
-void print_lb_records(struct lb_record *rec, struct lb_record *last,
+void print_lb_records(struct lb_record *rec, struct lb_record *last,
unsigned long addr)
{
struct lb_record *next;
@@ -279,8 +279,8 @@ void print_lb_records(struct lb_record *rec, struct lb_record *last,
int count;
count = 0;
- for(next = next_record(rec); (rec < last) && (next <= last);
- rec = next, addr += rec->size) {
+ for(next = next_record(rec); (rec < last) && (next <= last);
+ rec = next, addr += rec->size) {
next = next_record(rec);
count++;
for(i = 0; lb_types[i].print != 0; i++) {
@@ -309,7 +309,7 @@ void print_lb_table(struct lb_header *head, unsigned long addr)
print_lb_records(rec, last, addr + head->header_bytes);
}
-int main(int argc, char **argv)
+int main(int argc, char **argv)
{
unsigned char *low_1MB;
struct lb_header *lb_table;
diff --git a/util/mkelfImage/Makefile b/util/mkelfImage/Makefile
index 2100ed4cbe..cd265cf994 100644
--- a/util/mkelfImage/Makefile
+++ b/util/mkelfImage/Makefile
@@ -39,7 +39,7 @@ SRCS+=$(GENERATED_SRCS)
PSRCS:=$(patsubst ./%,mkelfImage-$(VERSION)/%,$(SRCS))
PSRCS+=./mkelfImage-$(VERSION).spec
-SBIN_TARGETS=$(OBJDIR)/sbin/mkelfImage
+SBIN_TARGETS=$(OBJDIR)/sbin/mkelfImage
MAN8_TARGETS=$(OBJDIR)/man/man8/mkelfImage.8
TARGETS:=$(SBIN_TARGETS) $(MAN8_TARGETS)
@@ -56,7 +56,7 @@ include linux-ia64/Makefile
clean::
@$(RM) -rf objdir
@$(RM) -rf rpm
- @$(RM) -f config.log config.status config.cache
+ @$(RM) -f config.log config.status config.cache
@$(RM) -f $(SBIN_TARGETS) $(MAN1_TARGETS)
@$(RM) -f mkelfImage-$(VERSION) $(TARBALL)
diff --git a/util/mkelfImage/News b/util/mkelfImage/News
index fbf8b6ace2..c02c881d9a 100644
--- a/util/mkelfImage/News
+++ b/util/mkelfImage/News
@@ -67,9 +67,9 @@
Better firmware detection, and stripping excess symbols from the
generated object.
-* 1.11 24 January 2002
+* 1.11 24 January 2002
Bug fix to command line processing.
-
+
* 1.10 21 January 2002
Starting using the PHDRS directive which many versions of ld cannot
handle correctly. The symptom is generally a file that is 9MB in
@@ -103,7 +103,7 @@
Code cleanup in bzImage support.
* 1.5 1 Febuary 2001
- Add support for bzImage
+ Add support for bzImage
* 1.4 ???
???
@@ -113,7 +113,7 @@
* 1.2 18 December 2000
Work around for some versions of ld not treating /dev/null and an
- empty file the same
+ empty file the same
* 1.1 30 November 2000
Fix for ramdisks and large amounts of memory with 2.2 series
diff --git a/util/mkelfImage/config/config.guess b/util/mkelfImage/config/config.guess
index ed2e03b7f2..ff40ddb038 100755
--- a/util/mkelfImage/config/config.guess
+++ b/util/mkelfImage/config/config.guess
@@ -845,7 +845,7 @@ EOF
;;
a.out-i386-linux)
echo "${UNAME_MACHINE}-pc-linux-gnuaout"
- exit 0 ;;
+ exit 0 ;;
coff-i386)
echo "${UNAME_MACHINE}-pc-linux-gnucoff"
exit 0 ;;
diff --git a/util/mkelfImage/config/install-sh b/util/mkelfImage/config/install-sh
index e9de23842d..594a4edbff 100755
--- a/util/mkelfImage/config/install-sh
+++ b/util/mkelfImage/config/install-sh
@@ -115,7 +115,7 @@ fi
if [ x"$dir_arg" != x ]; then
dst=$src
src=""
-
+
if [ -d $dst ]; then
instcmd=:
chmodcmd=""
@@ -125,7 +125,7 @@ if [ x"$dir_arg" != x ]; then
else
# Waiting for this to be detected by the "$instcmd $src $dsttmp" command
-# might cause directories to be created, which would be especially bad
+# might cause directories to be created, which would be especially bad
# if $src (and thus $dsttmp) contains '*'.
if [ -f $src -o -d $src ]
@@ -135,7 +135,7 @@ else
echo "install: $src does not exist"
exit 1
fi
-
+
if [ x"$dst" = x ]
then
echo "install: no destination specified"
@@ -163,7 +163,7 @@ dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'`
# Skip lots of stat calls in the usual case.
if [ ! -d "$dstdir" ]; then
-defaultIFS='
+defaultIFS='
'
IFS="${IFS-${defaultIFS}}"
@@ -202,17 +202,17 @@ else
# If we're going to rename the final executable, determine the name now.
- if [ x"$transformarg" = x ]
+ if [ x"$transformarg" = x ]
then
dstfile=`basename $dst`
else
- dstfile=`basename $dst $transformbasename |
+ dstfile=`basename $dst $transformbasename |
sed $transformarg`$transformbasename
fi
# don't allow the sed command to completely eliminate the filename
- if [ x"$dstfile" = x ]
+ if [ x"$dstfile" = x ]
then
dstfile=`basename $dst`
else
@@ -243,7 +243,7 @@ else
# Now rename the file to the real destination.
$doit $rmcmd -f $dstdir/$dstfile &&
- $doit $mvcmd $dsttmp $dstdir/$dstfile
+ $doit $mvcmd $dsttmp $dstdir/$dstfile
fi &&
diff --git a/util/mkelfImage/configure.ac b/util/mkelfImage/configure.ac
index 652b952de4..7aebd36e54 100644
--- a/util/mkelfImage/configure.ac
+++ b/util/mkelfImage/configure.ac
@@ -1,7 +1,7 @@
-dnl
+dnl
dnl configure.ac for mkelfImage
-dnl
-dnl
+dnl
+dnl
dnl ---Required
AC_INIT(Makefile.conf.in)
@@ -16,11 +16,11 @@ AC_CANONICAL_HOST
dnl Compute target cpu
-case $host_cpu in
- i?86 )
+case $host_cpu in
+ i?86 )
target_cpu="i386"
;;
- * )
+ * )
target_cpu="$host_cpu"
;;
esac
@@ -111,7 +111,7 @@ if test "$with_i386" != "no" ; then
fi
AC_CHECK_PROG([I386_CC], [$cc], [$cc], [""], [$PATH])
if test "$I386_CC" = no; then
-
+
AC_MSG_ERROR([$cc not found])
fi
AC_CHECK_PROG([I386_CPP], [$cpp], [$cpp], [""], [$PATH])
@@ -148,7 +148,7 @@ if test "$with_ia64" != "no" ; then
fi
AC_CHECK_PROG([IA64_CC], [$cc], [$cc], [""], [$PATH])
if test "$IA64_CC" = no; then
-
+
AC_MSG_ERROR([$cc not found])
fi
AC_CHECK_PROG([IA64_CPP], [$cpp], [$cpp], [""], [$PATH])
diff --git a/util/mkelfImage/include/elf_boot.h b/util/mkelfImage/include/elf_boot.h
index f90013ffa8..41c4c72d6e 100644
--- a/util/mkelfImage/include/elf_boot.h
+++ b/util/mkelfImage/include/elf_boot.h
@@ -1,5 +1,5 @@
-#ifndef ELF_BOOT_H
-#define ELF_BOOT_H
+#ifndef ELF_BOOT_H
+#define ELF_BOOT_H
/* This defines the structure of a table of parameters useful for ELF
@@ -35,7 +35,7 @@ typedef struct Elf_Bhdr
Elf_Half b_records;
} Elf_Bhdr;
-/*
+/*
* ELF Notes.
*/
diff --git a/util/mkelfImage/include/linuxbios_tables.h b/util/mkelfImage/include/linuxbios_tables.h
index 8ee3257ee0..75464fdd9e 100644
--- a/util/mkelfImage/include/linuxbios_tables.h
+++ b/util/mkelfImage/include/linuxbios_tables.h
@@ -8,7 +8,7 @@
* is expected to be information that cannot be discovered by
* other means, such as quering the hardware directly.
*
- * All of the information should be Position Independent Data.
+ * All of the information should be Position Independent Data.
* That is it should be safe to relocated any of the information
* without it's meaning/correctnes changing. For table that
* can reasonably be used on multiple architectures the data
@@ -63,7 +63,7 @@ struct lb_memory_range {
uint32_t type;
#define LB_MEM_RAM 1
#define LB_MEM_RESERVED 2
-
+
};
struct lb_memory {
diff --git a/util/mkelfImage/include/mkelfImage.h b/util/mkelfImage/include/mkelfImage.h
index 917f46e8c2..db1d356c86 100644
--- a/util/mkelfImage/include/mkelfImage.h
+++ b/util/mkelfImage/include/mkelfImage.h
@@ -25,7 +25,7 @@ extern struct memelfphdr *add_program_headers(struct memelfheader *ehdr, int cou
extern struct memelfnote *add_notes(struct memelfheader *ehdr, int count);
typedef char *(probe_t)(char *kernel_buf, off_t kernel_size);
-typedef int (mkelf_t)(int argc, char **argv,
+typedef int (mkelf_t)(int argc, char **argv,
struct memelfheader *hdr, char *kernel_buf, off_t kernel_size);
typedef void (usage_t)(void);
struct file_type {
diff --git a/util/mkelfImage/kunzip_src/arch/alpha/include/stdint.h b/util/mkelfImage/kunzip_src/arch/alpha/include/stdint.h
index 9b93a0c84f..9da5cc4972 100644
--- a/util/mkelfImage/kunzip_src/arch/alpha/include/stdint.h
+++ b/util/mkelfImage/kunzip_src/arch/alpha/include/stdint.h
@@ -3,7 +3,7 @@
/* Exact integral types */
typedef unsigned char uint8_t;
-typedef signed char int8_t;
+typedef signed char int8_t;
typedef unsigned short uint16_t;
typedef signed short int16_t;
@@ -17,7 +17,7 @@ typedef signed long int64_t;
/* Small types */
typedef unsigned char uint_least8_t;
-typedef signed char int_least8_t;
+typedef signed char int_least8_t;
typedef unsigned short uint_least16_t;
typedef signed short int_least16_t;
@@ -30,7 +30,7 @@ typedef signed long int_least64_t;
/* Fast Types */
typedef unsigned char uint_fast8_t;
-typedef signed char int_fast8_t;
+typedef signed char int_fast8_t;
typedef unsigned long uint_fast16_t;
typedef signed long int_fast16_t;
diff --git a/util/mkelfImage/kunzip_src/arch/alpha/lib/divide.S b/util/mkelfImage/kunzip_src/arch/alpha/lib/divide.S
index a4bc1f751e..863e881348 100644
--- a/util/mkelfImage/kunzip_src/arch/alpha/lib/divide.S
+++ b/util/mkelfImage/kunzip_src/arch/alpha/lib/divide.S
@@ -19,7 +19,7 @@
* These are not normal C functions: instead of the normal
* calling sequence, these expect their arguments in registers
* $24 and $25, and return the result in $27. Register $28 may
- * be clobbered (assembly temporary), anything else must be saved.
+ * be clobbered (assembly temporary), anything else must be saved.
*
* In short: painful.
*
diff --git a/util/mkelfImage/kunzip_src/arch/alpha/lib/kunzip.lds b/util/mkelfImage/kunzip_src/arch/alpha/lib/kunzip.lds
index ed632686a8..467e64d100 100644
--- a/util/mkelfImage/kunzip_src/arch/alpha/lib/kunzip.lds
+++ b/util/mkelfImage/kunzip_src/arch/alpha/lib/kunzip.lds
@@ -21,18 +21,18 @@ SECTIONS
/* Global data */
.data : {
_data = .;
- *(.data)
+ *(.data)
CONSTRUCTORS
*(.got)
*(.sdata)
_edata = .;
}
-
+
/* Important align _bss so bss may be zeroed with quadword access */
. = ALIGN(BASIC_ALIGN);
.bss : {
_bss = .;
- *(.sbss)
+ *(.sbss)
*(.scommon)
*(.bss)
*(COMMON)
diff --git a/util/mkelfImage/kunzip_src/arch/i386/include/stdint.h b/util/mkelfImage/kunzip_src/arch/i386/include/stdint.h
index 58d7519cde..f24aab1294 100644
--- a/util/mkelfImage/kunzip_src/arch/i386/include/stdint.h
+++ b/util/mkelfImage/kunzip_src/arch/i386/include/stdint.h
@@ -3,7 +3,7 @@
/* Exact integral types */
typedef unsigned char uint8_t;
-typedef signed char int8_t;
+typedef signed char int8_t;
typedef unsigned short uint16_t;
typedef signed short int16_t;
@@ -16,7 +16,7 @@ typedef signed long long int64_t;
/* Small types */
typedef unsigned char uint_least8_t;
-typedef signed char int_least8_t;
+typedef signed char int_least8_t;
typedef unsigned short uint_least16_t;
typedef signed short int_least16_t;
@@ -29,7 +29,7 @@ typedef signed long long int_least64_t;
/* Fast Types */
typedef unsigned char uint_fast8_t;
-typedef signed char int_fast8_t;
+typedef signed char int_fast8_t;
typedef unsigned int uint_fast16_t;
typedef signed int int_fast16_t;
diff --git a/util/mkelfImage/kunzip_src/arch/i386/lib/kunzip.lds b/util/mkelfImage/kunzip_src/arch/i386/lib/kunzip.lds
index 0e649005cf..4d95da42f5 100644
--- a/util/mkelfImage/kunzip_src/arch/i386/lib/kunzip.lds
+++ b/util/mkelfImage/kunzip_src/arch/i386/lib/kunzip.lds
@@ -21,18 +21,18 @@ SECTIONS
/* Global data */
.data : {
_data = .;
- *(.data)
+ *(.data)
CONSTRUCTORS
*(.got)
*(.sdata)
_edata = .;
}
-
+
/* Important align _bss so bss may be zeroed with quadword access */
. = ALIGN(BASIC_ALIGN);
.bss : {
_bss = .;
- *(.sbss)
+ *(.sbss)
*(.scommon)
*(.bss)
*(COMMON)
diff --git a/util/mkelfImage/kunzip_src/arch/i386/lib/start.S b/util/mkelfImage/kunzip_src/arch/i386/lib/start.S
index fec7c9da66..80ad476ae0 100644
--- a/util/mkelfImage/kunzip_src/arch/i386/lib/start.S
+++ b/util/mkelfImage/kunzip_src/arch/i386/lib/start.S
@@ -33,4 +33,3 @@ jmp_to_program_entry:
movl 24+__original_registers, %esp
movl 28+__original_registers, %ebp
jmp *__entry
- \ No newline at end of file
diff --git a/util/mkelfImage/kunzip_src/include/stdarg.h b/util/mkelfImage/kunzip_src/include/stdarg.h
index 24f3383198..a3f1f2d587 100644
--- a/util/mkelfImage/kunzip_src/include/stdarg.h
+++ b/util/mkelfImage/kunzip_src/include/stdarg.h
@@ -136,7 +136,7 @@ void va_end (__gnuc_va_list); /* Defined in libgcc.a */
/* Define va_list, if desired, from __gnuc_va_list. */
/* We deliberately do not define va_list when called from
stdio.h, because ANSI C says that stdio.h is not supposed to define
- va_list. stdio.h needs to have access to that data type,
+ va_list. stdio.h needs to have access to that data type,
but must not use that name. It should use the name __gnuc_va_list,
which is safe because it is reserved for the implementation. */
diff --git a/util/mkelfImage/kunzip_src/include/string.h b/util/mkelfImage/kunzip_src/include/string.h
index dbaa1ecd17..fa301c822e 100644
--- a/util/mkelfImage/kunzip_src/include/string.h
+++ b/util/mkelfImage/kunzip_src/include/string.h
@@ -3,23 +3,23 @@
#include <stddef.h>
-// yes, linux has fancy ones. We don't care. This stuff gets used
+// yes, linux has fancy ones. We don't care. This stuff gets used
// hardly at all. And the pain of including those files is just too high.
//extern inline void strcpy(char *dst, char *src) {while (*src) *dst++ = *src++;}
//extern inline int strlen(char *src) { int i = 0; while (*src++) i++; return i;}
-static inline size_t strnlen(const char *src, size_t max) {
- int i = 0;
+static inline size_t strnlen(const char *src, size_t max) {
+ int i = 0;
if (max<0) {
- while (*src++)
- i++;
+ while (*src++)
+ i++;
return i;
}
else {
- while ((*src++) && (i < max))
- i++;
+ while ((*src++) && (i < max))
+ i++;
return i;
}
}
diff --git a/util/mkelfImage/kunzip_src/lib/inflate.c b/util/mkelfImage/kunzip_src/lib/inflate.c
index 894a98cd27..82818a6d53 100644
--- a/util/mkelfImage/kunzip_src/lib/inflate.c
+++ b/util/mkelfImage/kunzip_src/lib/inflate.c
@@ -1,5 +1,5 @@
-#define DEBG(x)
-#define DEBG1(x)
+#define DEBG(x)
+#define DEBG1(x)
/* Taken from /usr/src/linux/lib/inflate.c [unmodified]
Used for start32, 1/11/2000
James Hendricks, Dale Webster */
@@ -7,9 +7,9 @@
/* inflate.c -- Not copyrighted 1992 by Mark Adler
version c10p1, 10 January 1993 */
-/*
+/*
* Adapted for booting Linux by Hannu Savolainen 1993
- * based on gzip-1.0.3
+ * based on gzip-1.0.3
*
* Nicolas Pitre <nico@cam.org>, 1999/04/14 :
* Little mods for all variable to reside either into rodata or bss segments
@@ -54,7 +54,7 @@
chunks), otherwise the dynamic method is used. In the latter case, the
codes are customized to the probabilities in the current block, and so
can code it much better than the pre-determined fixed codes.
-
+
The Huffman codes themselves are decoded using a multi-level table
lookup, in order to maximize the speed of decoding plus the speed of
building the decoding tables. See the comments below that precede the
@@ -121,7 +121,7 @@ static char rcsid[] = "#Id: inflate.c,v 0.14 1993/06/10 13:27:04 jloup Exp #";
#include "gzip.h"
#define STATIC
#endif /* !STATIC */
-
+
#define slide window
/* Huffman code lookup table entry--this entry is four bytes for machines
@@ -142,7 +142,7 @@ struct huft {
/* Function prototypes */
-STATIC int huft_build OF((unsigned *, unsigned, unsigned,
+STATIC int huft_build OF((unsigned *, unsigned, unsigned,
const ush *, const ush *, struct huft **, int *));
STATIC int huft_free OF((struct huft *));
STATIC int inflate_codes OF((struct huft *, struct huft *, int, int));
@@ -188,7 +188,7 @@ static const ush cpdext[] = { /* Extra bits for distance codes */
/* Macros for inflate() bit peeking and grabbing.
The usage is:
-
+
NEEDBITS(j)
x = b & mask_bits[j];
DUMPBITS(j)
@@ -315,7 +315,7 @@ DEBG("huft1 ");
memzero(c, sizeof(c));
p = b; i = n;
do {
- Tracecv(*p, (stderr, (n-i >= ' ' && n-i <= '~' ? "%c %d\n" : "0x%x %d\n"),
+ Tracecv(*p, (stderr, (n-i >= ' ' && n-i <= '~' ? "%c %d\n" : "0x%x %d\n"),
n-i, *p));
c[*p]++; /* assume all entries <= BMAX */
p++; /* Can't combine with above line (Solaris bug) */
@@ -509,7 +509,7 @@ struct huft *t; /* table to free */
q = (--p)->v.t;
free((char*)p);
p = q;
- }
+ }
return 0;
}
@@ -978,7 +978,7 @@ STATIC int inflate()
hufts = 0;
malloc_mark(&mark);
if ((r = inflate_block(&e)) != 0) {
- malloc_release(&mark);
+ malloc_release(&mark);
return r;
}
malloc_release(&mark);
@@ -1014,7 +1014,7 @@ static ulg crc; /* initialized in makecrc() so it'll reside in bss */
#define CRC_VALUE (crc ^ 0xffffffffL)
/*
- * Code to compute the CRC-32 table. Borrowed from
+ * Code to compute the CRC-32 table. Borrowed from
* gzip-1.0.3/makecrc.c.
*/
@@ -1122,7 +1122,7 @@ int gunzip(void)
if ((flags & ORIG_NAME) != 0) {
/* Discard the old name */
while (get_byte() != 0) /* null */ ;
- }
+ }
/* Discard file comment if any */
if ((flags & COMMENT) != 0) {
@@ -1148,7 +1148,7 @@ int gunzip(void)
}
return -1;
}
-
+
/* Get the crc and original length */
/* crc32 (see algorithm.doc)
* uncompressed input size modulo 2^32
@@ -1157,12 +1157,12 @@ int gunzip(void)
orig_crc |= (ulg) get_byte() << 8;
orig_crc |= (ulg) get_byte() << 16;
orig_crc |= (ulg) get_byte() << 24;
-
+
orig_len = (ulg) get_byte();
orig_len |= (ulg) get_byte() << 8;
orig_len |= (ulg) get_byte() << 16;
orig_len |= (ulg) get_byte() << 24;
-
+
/* Validate decompression */
if (orig_crc != CRC_VALUE) {
error("crc error");
diff --git a/util/mkelfImage/kunzip_src/lib/kunzip.c b/util/mkelfImage/kunzip_src/lib/kunzip.c
index 4bfe504f70..b8ae1c1ecc 100644
--- a/util/mkelfImage/kunzip_src/lib/kunzip.c
+++ b/util/mkelfImage/kunzip_src/lib/kunzip.c
@@ -7,7 +7,7 @@
*/
#ifdef DEBUG
-# define Trace(x)
+# define Trace(x)
# define Tracev(x)
# define Tracevv(x)
# define Tracec(c,x)
@@ -113,7 +113,7 @@ static void flush_window(void)
limit = outcnt;
}
out = output_ptr;
- DBG(("flush 0x%08lx start 0x%08lx limit 0x%08lx\n",
+ DBG(("flush 0x%08lx start 0x%08lx limit 0x%08lx\n",
(unsigned long) out, (unsigned long)n, limit));
for (; n < limit; n++) {
ch = *out++ = *in++;
diff --git a/util/mkelfImage/linux-i386/convert.lds b/util/mkelfImage/linux-i386/convert.lds
index 8c9eba799a..59cd714aa6 100644
--- a/util/mkelfImage/linux-i386/convert.lds
+++ b/util/mkelfImage/linux-i386/convert.lds
@@ -11,8 +11,8 @@ SECTIONS
*(.text)
*(.text.*)
} = 0x9090
- .rodata (.): {
- *(.rodata)
+ .rodata (.): {
+ *(.rodata)
*(.rodata.*)
}
_etext = .; /* End of text section */
@@ -28,7 +28,7 @@ SECTIONS
}
_end = . ;
bss_sizex = _end - _bss;
-
+
/DISCARD/ : {
*(.comment)
*(.note)
diff --git a/util/mkelfImage/linux-i386/convert_params.c b/util/mkelfImage/linux-i386/convert_params.c
index 5af3fafca3..819f797390 100644
--- a/util/mkelfImage/linux-i386/convert_params.c
+++ b/util/mkelfImage/linux-i386/convert_params.c
@@ -15,9 +15,9 @@ long user_stack [STACK_SIZE] = { 0 };
unsigned long * stack_start = & user_stack[STACK_SIZE];
/* FIXME expand on drive_info_)struct... */
-struct drive_info_struct {
- uint8_t dummy[32];
-};
+struct drive_info_struct {
+ uint8_t dummy[32];
+};
struct sys_desc_table {
uint16_t length;
uint8_t table[318];
@@ -150,7 +150,7 @@ struct parameters {
uint16_t ramdisk_flags; /* 0x1f8 */
#define RAMDISK_IMAGE_START_MASK 0x07FF
#define RAMDISK_PROMPT_FLAG 0x8000
-#define RAMDISK_LOAD_FLAG 0x4000
+#define RAMDISK_LOAD_FLAG 0x4000
uint8_t reserved8[2]; /* 0x1fa */
uint16_t orig_root_dev; /* 0x1fc */
uint8_t reserved9[1]; /* 0x1fe */
@@ -292,7 +292,7 @@ static void printf(const char *fmt, ...)
continue;
}
if (*++fmt == 's') {
- for(p = va_arg(args, char *); *p != '\0'; p++)
+ for(p = va_arg(args, char *); *p != '\0'; p++)
putchar(*p);
}
else { /* Length of item is bounded */
@@ -314,7 +314,7 @@ static void printf(const char *fmt, ...)
fmt++;
}
}
-
+
/*
* Before each format q points to tmp buffer
* After each format q points past end of item
@@ -376,7 +376,7 @@ static void printf(const char *fmt, ...)
}
/*
- * String Functions
+ * String Functions
* =============================================================================
*/
@@ -408,7 +408,7 @@ void* memcpy(void *dest, const void *src, size_t len)
d = dest;
s = src;
- for (i=0; i < len; i++)
+ for (i=0; i < len; i++)
d[i] = s[i];
return dest;
@@ -426,7 +426,7 @@ int memcmp(void *src1, void *src2, size_t len)
}
}
return 0;
-
+
}
/*
@@ -510,7 +510,7 @@ void append_command_line(struct parameters *real_mode, char *arg, int arg_bytes)
*dest++ = '\0';
}
-static void set_memsize_k(struct parameters *real_mode, unsigned long mem_k)
+static void set_memsize_k(struct parameters *real_mode, unsigned long mem_k)
{
/* ALT_MEM_K maxes out at 4GB */
if (mem_k > 0x3fffff) {
@@ -527,7 +527,7 @@ static void set_memsize_k(struct parameters *real_mode, unsigned long mem_k)
}
static void add_e820_map(struct parameters *real_mode,
- unsigned long long addr, unsigned long long size,
+ unsigned long long addr, unsigned long long size,
unsigned long type)
{
unsigned long long high;
@@ -628,8 +628,8 @@ static void convert_multiboot_memmap(
multi_puts("size: "); multi_put_hex(size); multi_puts("\n");
multi_puts("end: "); multi_put_hex((unsigned)end); multi_puts("\n");
for(seg = info->mmap_addr; (seg < end); seg = next_seg(seg,size)) {
- multi_puts("multi-mem: ");
- multi_put_lhex(seg->size);
+ multi_puts("multi-mem: ");
+ multi_put_lhex(seg->size);
multi_puts(" @ ");
multi_put_lhex(seg->addr);
multi_puts(" (");
@@ -662,7 +662,7 @@ static void convert_multiboot(
set_memsize_k(info->real_mode, mb_info->mem_upper + (1 << 10));
}
if (mb_info->flags & MULTIBOOT_CMDLINE_VALID) {
- append_command_line(info->real_mode, mb_info->command_line,
+ append_command_line(info->real_mode, mb_info->command_line,
MULTIBOOT_MAX_COMMAND_LINE);
}
if (info->need_mem_sizes && (mb_info->flags & MULTIBOOT_MMAP_VALID)) {
@@ -699,8 +699,8 @@ static void convert_uniform_boot_memory(
entries = (mem->size - sizeof(*mem))/sizeof(mem->map[0]);
for(i = 0; (i < entries) && (i < E820MAX); i++) {
unsigned long type;
- ube_puts("ube-mem: ");
- ube_put_lhex(mem->map[i].size);
+ ube_puts("ube-mem: ");
+ ube_put_lhex(mem->map[i].size);
ube_puts(" @ ");
ube_put_lhex(mem->map[i].start);
ube_puts(" (");
@@ -724,7 +724,7 @@ static void convert_uniform_boot_memory(
break;
}
ube_puts(")\n");
- add_e820_map(real_mode,
+ add_e820_map(real_mode,
mem->map[i].start, mem->map[i].size, type);
}
}
@@ -762,9 +762,9 @@ static void convert_uniform_boot(struct param_info *info,
* =============================================================================
*/
-/* we're getting screwed again and again by this problem of the 8259.
- * so we're going to leave this lying around for inclusion into
- * crt0.S on an as-needed basis.
+/* we're getting screwed again and again by this problem of the 8259.
+ * so we're going to leave this lying around for inclusion into
+ * crt0.S on an as-needed basis.
* well, that went ok, I hope. Now we have to reprogram the interrupts :-(
* we put them right after the intel-reserved hardware interrupts, at
* int 0x20-0x2F. There they won't mess up anything. Sadly IBM really
@@ -786,7 +786,7 @@ static void setup_i8259(void)
outb(0x02, 0xA1); /*! 8259-2 is slave*/
outb(0x01, 0x21); /*! 8086 mode for both*/
- outb(0x01, 0xA1);
+ outb(0x01, 0xA1);
outb(0xFF, 0xA1); /*! mask off all interrupts for now*/
outb(0xFB, 0x21); /*! mask all irq's but irq2 which is cascaded*/
@@ -831,11 +831,11 @@ static int count_elf_notes(Elf_Bhdr *bhdr)
printf("elf_note = %lx\n", (unsigned long)note);
printf("elf_namesz = %x\n", hdr->n_namesz);
printf("elf_descsz = %x\n", hdr->n_descsz);
- printf("elf_type = %x\n", hdr->n_type);
+ printf("elf_type = %x\n", hdr->n_type);
printf("elf_name = %lx\n", (unsigned long)n_name);
printf("elf_desc = %lx\n", (unsigned long)n_desc);
#endif
- if (next > end)
+ if (next > end)
break;
count++;
note = next;
@@ -843,7 +843,7 @@ static int count_elf_notes(Elf_Bhdr *bhdr)
return count;
}
-static Elf_Nhdr *find_elf_note(Elf_Bhdr *bhdr,
+static Elf_Nhdr *find_elf_note(Elf_Bhdr *bhdr,
Elf_Word namesz, unsigned char *name, Elf_Word type)
{
unsigned char *note, *end;
@@ -856,7 +856,7 @@ static Elf_Nhdr *find_elf_note(Elf_Bhdr *bhdr,
n_name = note + sizeof(*hdr);
n_desc = n_name + ((hdr->n_namesz + 3) & ~3);
next = n_desc + ((hdr->n_descsz + 3) & ~3);
- if (next > end)
+ if (next > end)
break;
if ((hdr->n_type == type) &&
(hdr->n_namesz == namesz) &&
@@ -897,7 +897,7 @@ static void convert_elf_boot(struct param_info *info, Elf_Bhdr *bhdr)
n_name = note + sizeof(*hdr);
n_desc = n_name + ((hdr->n_namesz + 3) & ~3);
next = n_desc + ((hdr->n_descsz + 3) & ~3);
- if (next > end)
+ if (next > end)
break;
for(i = 0; i < sizeof(elf_notes)/sizeof(elf_notes[0]); i++) {
if ((hdr->n_type == elf_notes[i].type) &&
@@ -935,7 +935,7 @@ static unsigned count_lb_records(void *start, unsigned long length)
count = 0;
end = ((char *)start) + length;
for(rec = start; ((void *)rec < end) &&
- (rec->size <= (unsigned long)(end - (void *)rec));
+ (rec->size <= (unsigned long)(end - (void *)rec));
rec = (void *)(((char *)rec) + rec->size)) {
count++;
}
@@ -948,7 +948,7 @@ static struct lb_header *__find_lb_table(void *start, void *end)
/* For now be stupid.... */
for(ptr = start; (void *)ptr < end; ptr += 16) {
struct lb_header *head = (void *)ptr;
- if ((head->signature[0] == 'L') &&
+ if ((head->signature[0] == 'L') &&
(head->signature[1] == 'B') &&
(head->signature[2] == 'I') &&
(head->signature[3] == 'O') &&
@@ -1001,10 +1001,10 @@ static void convert_lb_memory(struct param_info *info, struct lb_memory *mem)
unsigned long type;
unsigned long long end;
end = mem->map[i].start + mem->map[i].size;
- lb_puts("lb-mem: ");
+ lb_puts("lb-mem: ");
lb_put_lhex(mem->map[i].start);
lb_puts(" - ");
- lb_put_lhex(end);
+ lb_put_lhex(end);
lb_puts(" (");
switch(mem->map[i].type) {
case LB_MEM_RAM:
@@ -1017,12 +1017,12 @@ static void convert_lb_memory(struct param_info *info, struct lb_memory *mem)
break;
}
lb_puts(")\n");
- add_e820_map(info->real_mode,
+ add_e820_map(info->real_mode,
mem->map[i].start, mem->map[i].size, type);
}
info->need_mem_sizes = 0;
}
-
+
static void query_lb_values(struct param_info *info)
{
struct lb_header *head;
@@ -1032,17 +1032,17 @@ static void query_lb_values(struct param_info *info)
start = ((unsigned char *)head) + sizeof(*head);
end = ((char *)start) + head->table_bytes;
for(rec = start; ((void *)rec < end) &&
- (rec->size <= (unsigned long)(end - (void *)rec));
+ (rec->size <= (unsigned long)(end - (void *)rec));
rec = (void *)(((char *)rec) + rec->size)) {
switch(rec->tag) {
case LB_TAG_MEMORY:
{
struct lb_memory *mem;
mem = (struct lb_memory *) rec;
- convert_lb_memory(info, mem);
+ convert_lb_memory(info, mem);
break;
}
- default:
+ default:
break;
};
}
@@ -1087,7 +1087,7 @@ static void get_meminfo(struct param_info *info)
struct e820entry *seg = meminfo.map + i;
end = seg->addr + seg->size;
pc_puts("BIOS-e820: ");
- pc_put_lhex(seg->addr);
+ pc_put_lhex(seg->addr);
pc_puts(" - ");
pc_put_lhex(end);
pc_puts(" (");
@@ -1108,7 +1108,7 @@ static void get_meminfo(struct param_info *info)
break;
}
pc_puts(")\n");
- add_e820_map(info->real_mode,
+ add_e820_map(info->real_mode,
seg->addr, seg->size, seg->type);
}
info->real_mode->alt_mem_k = meme801();
@@ -1191,7 +1191,7 @@ static void query_bootloader_param_class(struct param_info *info)
}
}
-static void query_bootloader_values(struct param_info *info)
+static void query_bootloader_values(struct param_info *info)
{
if (info->has_multiboot) {
convert_multiboot(info, info->data);
@@ -1252,7 +1252,7 @@ static int bootloader_query_firmware_class(struct param_info *info)
detected_firmware_type = 1;
}
if (!detected_firmware_type && hdr &&
- (hdr->n_descsz == 1) &&
+ (hdr->n_descsz == 1) &&
(memcmp(n_desc, "", 1) == 0)) {
/* No firmware is present */
detected_firmware_type = 1;
@@ -1305,7 +1305,7 @@ static void query_firmware_values(struct param_info *info)
if (info->has_pcbios) {
query_pcbios_values(info);
}
-
+
}
/*
@@ -1325,59 +1325,59 @@ static void print_offsets(void)
printf("orig_video_page =%x\n", (uint32_t)&real_mode->orig_video_page);
printf("orig_video_mode =%x\n", (uint32_t)&real_mode->orig_video_mode);
printf("orig_video_cols =%x\n", (uint32_t)&real_mode->orig_video_cols);
- printf("unused2 =%x\n", (uint32_t)&real_mode->unused2);
- printf("orig_video_ega_bx =%x\n", (uint32_t)&real_mode->orig_video_ega_bx);
+ printf("unused2 =%x\n", (uint32_t)&real_mode->unused2);
+ printf("orig_video_ega_bx =%x\n", (uint32_t)&real_mode->orig_video_ega_bx);
printf("unused3 =%x\n", (uint32_t)&real_mode->unused3);
- printf("orig_video_lines =%x\n", (uint32_t)&real_mode->orig_video_lines);
- printf("orig_video_isVGA =%x\n", (uint32_t)&real_mode->orig_video_isVGA);
+ printf("orig_video_lines =%x\n", (uint32_t)&real_mode->orig_video_lines);
+ printf("orig_video_isVGA =%x\n", (uint32_t)&real_mode->orig_video_isVGA);
printf("orig_video_points =%x\n", (uint32_t)&real_mode->orig_video_points);
printf("lfb_width =%x\n", (uint32_t)&real_mode->lfb_width);
printf("lfb_height =%x\n", (uint32_t)&real_mode->lfb_height);
- printf("lfb_depth =%x\n", (uint32_t)&real_mode->lfb_depth);
- printf("lfb_base =%x\n", (uint32_t)&real_mode->lfb_base);
- printf("lfb_size =%x\n", (uint32_t)&real_mode->lfb_size);
- printf("cl_magic =%x\n", (uint32_t)&real_mode->cl_magic);
+ printf("lfb_depth =%x\n", (uint32_t)&real_mode->lfb_depth);
+ printf("lfb_base =%x\n", (uint32_t)&real_mode->lfb_base);
+ printf("lfb_size =%x\n", (uint32_t)&real_mode->lfb_size);
+ printf("cl_magic =%x\n", (uint32_t)&real_mode->cl_magic);
printf("cl_offset =%x\n", (uint32_t)&real_mode->cl_offset);
printf("lfb_linelength =%x\n", (uint32_t)&real_mode->lfb_linelength);
printf("red_size =%x\n", (uint32_t)&real_mode->red_size);
- printf("red_pos =%x\n", (uint32_t)&real_mode->red_pos);
+ printf("red_pos =%x\n", (uint32_t)&real_mode->red_pos);
printf("green_size =%x\n", (uint32_t)&real_mode->green_size);
- printf("green_pos =%x\n", (uint32_t)&real_mode->green_pos);
- printf("blue_size =%x\n", (uint32_t)&real_mode->blue_size);
- printf("blue_pos =%x\n", (uint32_t)&real_mode->blue_pos);
+ printf("green_pos =%x\n", (uint32_t)&real_mode->green_pos);
+ printf("blue_size =%x\n", (uint32_t)&real_mode->blue_size);
+ printf("blue_pos =%x\n", (uint32_t)&real_mode->blue_pos);
printf("rsvd_size =%x\n", (uint32_t)&real_mode->rsvd_size);
- printf("rsvd_pos =%x\n", (uint32_t)&real_mode->rsvd_pos);
+ printf("rsvd_pos =%x\n", (uint32_t)&real_mode->rsvd_pos);
printf("vesapm_seg =%x\n", (uint32_t)&real_mode->vesapm_seg);
printf("vesapm_off =%x\n", (uint32_t)&real_mode->vesapm_off);
- printf("pages =%x\n", (uint32_t)&real_mode->pages);
- printf("reserved4 =%x\n", (uint32_t)&real_mode->reserved4);
+ printf("pages =%x\n", (uint32_t)&real_mode->pages);
+ printf("reserved4 =%x\n", (uint32_t)&real_mode->reserved4);
printf("apm_bios_info =%x\n", (uint32_t)&real_mode->apm_bios_info);
- printf("drive_info =%x\n", (uint32_t)&real_mode->drive_info);
+ printf("drive_info =%x\n", (uint32_t)&real_mode->drive_info);
printf("sys_desc_table =%x\n", (uint32_t)&real_mode->sys_desc_table);
- printf("alt_mem_k =%x\n", (uint32_t)&real_mode->alt_mem_k);
- printf("reserved5 =%x\n", (uint32_t)&real_mode->reserved5);
- printf("e820_map_nr =%x\n", (uint32_t)&real_mode->e820_map_nr);
- printf("reserved6 =%x\n", (uint32_t)&real_mode->reserved6);
- printf("mount_root_rdonly =%x\n", (uint32_t)&real_mode->mount_root_rdonly);
+ printf("alt_mem_k =%x\n", (uint32_t)&real_mode->alt_mem_k);
+ printf("reserved5 =%x\n", (uint32_t)&real_mode->reserved5);
+ printf("e820_map_nr =%x\n", (uint32_t)&real_mode->e820_map_nr);
+ printf("reserved6 =%x\n", (uint32_t)&real_mode->reserved6);
+ printf("mount_root_rdonly =%x\n", (uint32_t)&real_mode->mount_root_rdonly);
printf("reserved7 =%x\n", (uint32_t)&real_mode->reserved7);
printf("ramdisk_flags =%x\n", (uint32_t)&real_mode->ramdisk_flags);
- printf("reserved8 =%x\n", (uint32_t)&real_mode->reserved8);
+ printf("reserved8 =%x\n", (uint32_t)&real_mode->reserved8);
printf("orig_root_dev =%x\n", (uint32_t)&real_mode->orig_root_dev);
- printf("reserved9 =%x\n", (uint32_t)&real_mode->reserved9);
+ printf("reserved9 =%x\n", (uint32_t)&real_mode->reserved9);
printf("aux_device_info =%x\n", (uint32_t)&real_mode->aux_device_info);
- printf("reserved10 =%x\n", (uint32_t)&real_mode->reserved10);
+ printf("reserved10 =%x\n", (uint32_t)&real_mode->reserved10);
printf("param_block_signature=%x\n", (uint32_t)&real_mode->param_block_signature);
- printf("param_block_version =%x\n", (uint32_t)&real_mode->param_block_version);
- printf("reserved11 =%x\n", (uint32_t)&real_mode->reserved11);
+ printf("param_block_version =%x\n", (uint32_t)&real_mode->param_block_version);
+ printf("reserved11 =%x\n", (uint32_t)&real_mode->reserved11);
printf("loader_type =%x\n", (uint32_t)&real_mode->loader_type);
printf("loader_flags =%x\n", (uint32_t)&real_mode->loader_flags);
- printf("reserved12 =%x\n", (uint32_t)&real_mode->reserved12);
+ printf("reserved12 =%x\n", (uint32_t)&real_mode->reserved12);
printf("kernel_start =%x\n", (uint32_t)&real_mode->kernel_start);
printf("initrd_start =%x\n", (uint32_t)&real_mode->initrd_start);
printf("initrd_size =%x\n", (uint32_t)&real_mode->initrd_size);
printf("reserved13 =%x\n", (uint32_t)&real_mode->reserved13);
- printf("e820_map =%x\n", (uint32_t)&real_mode->e820_map);
- printf("reserved16 =%x\n", (uint32_t)&real_mode->reserved16);
+ printf("e820_map =%x\n", (uint32_t)&real_mode->e820_map);
+ printf("reserved16 =%x\n", (uint32_t)&real_mode->reserved16);
printf("command_line =%x\n", (uint32_t)&real_mode->command_line);
printf("reserved17 =%x\n", (uint32_t)&real_mode->reserved17);
}
@@ -1397,7 +1397,7 @@ static void print_linux_params(struct param_info *info)
printf("orig_video_ega_bx=%x\n", info->real_mode->orig_video_ega_bx);
printf("orig_video_isVGA =%x\n", info->real_mode->orig_video_isVGA);
printf("orig_video_points=%x\n", info->real_mode->orig_video_points);
-
+
/* System descriptor table... */
printf("sys_dest_table_len=%x\n", info->real_mode->sys_desc_table.length);
@@ -1407,27 +1407,27 @@ static void print_linux_params(struct param_info *info)
printf("alt_mem_k =%x\n", info->real_mode->alt_mem_k);
printf("e820_map_nr =%x\n", info->real_mode->e820_map_nr);
for(i = 0; i < E820MAX; i++) {
- printf("addr[%x] =%Lx\n",
+ printf("addr[%x] =%Lx\n",
i, info->real_mode->e820_map[i].addr);
- printf("size[%x] =%Lx\n",
+ printf("size[%x] =%Lx\n",
i, info->real_mode->e820_map[i].size);
- printf("type[%x] =%Lx\n",
+ printf("type[%x] =%Lx\n",
i, info->real_mode->e820_map[i].type);
}
- printf("mount_root_rdonly=%x\n", info->real_mode->mount_root_rdonly);
- printf("ramdisk_flags =%x\n", info->real_mode->ramdisk_flags);
- printf("orig_root_dev =%x\n", info->real_mode->orig_root_dev);
- printf("aux_device_info =%x\n", info->real_mode->aux_device_info);
+ printf("mount_root_rdonly=%x\n", info->real_mode->mount_root_rdonly);
+ printf("ramdisk_flags =%x\n", info->real_mode->ramdisk_flags);
+ printf("orig_root_dev =%x\n", info->real_mode->orig_root_dev);
+ printf("aux_device_info =%x\n", info->real_mode->aux_device_info);
printf("param_block_signature=%x\n", *((uint32_t *)info->real_mode->param_block_signature));
- printf("loader_type =%x\n", info->real_mode->loader_type);
+ printf("loader_type =%x\n", info->real_mode->loader_type);
printf("loader_flags =%x\n", info->real_mode->loader_flags);
printf("initrd_start =%x\n", info->real_mode->initrd_start);
- printf("initrd_size =%x\n", info->real_mode->initrd_size);
+ printf("initrd_size =%x\n", info->real_mode->initrd_size);
/* Where I'm putting the command line */
- printf("cl_magic =%x\n", info->real_mode->cl_magic);
+ printf("cl_magic =%x\n", info->real_mode->cl_magic);
printf("cl_offset =%x\n", info->real_mode->cl_offset);
-
+
/* Now print the command line */
printf("command_line =%s\n", info->real_mode->command_line);
}
@@ -1445,7 +1445,7 @@ void initialize_linux_params(struct param_info *info)
int len;
/* First the defaults */
memset(info->real_mode, 0, PAGE_SIZE);
-
+
/* Default screen size */
info->real_mode->orig_x = 0;
info->real_mode->orig_y = 25;
@@ -1456,10 +1456,10 @@ void initialize_linux_params(struct param_info *info)
info->real_mode->orig_video_ega_bx = 0;
info->real_mode->orig_video_isVGA = 1;
info->real_mode->orig_video_points = 16;
-
+
/* Fill this in later */
info->real_mode->ext_mem_k = 0;
-
+
/* Fill in later... */
info->real_mode->e820_map_nr = 0;
@@ -1468,7 +1468,7 @@ void initialize_linux_params(struct param_info *info)
info->real_mode->cl_offset = 2048;
info->real_mode->cmd_line_ptr = info->real_mode->cl_offset + (unsigned long) info->real_mode;
-
+
/* Now set the command line */
len = strnlen(info->image->cmdline, sizeof(info->real_mode->command_line) -1);
memcpy(info->real_mode->command_line, info->image->cmdline, len);
@@ -1476,49 +1476,49 @@ void initialize_linux_params(struct param_info *info)
/* from the bios initially */
memset(&info->real_mode->apm_bios_info, 0, sizeof(info->real_mode->apm_bios_info));
-
+
memset(&info->real_mode->drive_info, 0, sizeof(info->real_mode->drive_info));
/* forget it for now... */
- info->real_mode->sys_desc_table.length = 0;
-
+ info->real_mode->sys_desc_table.length = 0;
+
/* Fill this in later */
info->real_mode->alt_mem_k = 0;
info->real_mode->ext_mem_k = 0;
-
+
/* default yes: this can be overridden on the command line */
info->real_mode->mount_root_rdonly = 0xFFFF;
-
+
/* old ramdisk options, These really should be command line
* things...
*/
info->real_mode->ramdisk_flags = info->image->ramdisk_flags;
/* default to /dev/hda.
- * Override this on the command line if necessary
+ * Override this on the command line if necessary
*/
info->real_mode->orig_root_dev = info->image->root_dev;
-
+
/* Originally from the bios? */
info->real_mode->aux_device_info = 0;
-
+
/* Boot block magic */
memcpy(info->real_mode->param_block_signature, "HdrS", 4);
info->real_mode->param_block_version = 0x0201;
-
+
/* Say I'm a kernel boot loader */
info->real_mode->loader_type = (LOADER_TYPE_KERNEL << 4) + 0 /* version */;
-
+
/* No loader flags */
info->real_mode->loader_flags = 0;
-
+
/* Ramdisk address and size ... */
info->real_mode->initrd_start = 0;
info->real_mode->initrd_size = 0;
if (info->image->initrd_size) {
info->real_mode->initrd_start = info->image->initrd_start;
info->real_mode->initrd_size = info->image->initrd_size;
- }
+ }
/* Now remember those things that I need */
info->need_mem_sizes = 1;
@@ -1556,7 +1556,7 @@ void *convert_params(unsigned type, void *data, void *param, void *image)
#if 0
printf("info.real_mode = 0x%x\n", info.real_mode );
printf("Jumping to Linux\n");
-#endif
+#endif
return info.real_mode;
}
diff --git a/util/mkelfImage/linux-i386/head.S b/util/mkelfImage/linux-i386/head.S
index b35c62a983..9c52896e0c 100644
--- a/util/mkelfImage/linux-i386/head.S
+++ b/util/mkelfImage/linux-i386/head.S
@@ -8,7 +8,7 @@
*
* Other parts were taken from etherboot-5.0.5
*/
-
+
#define ASSEMBLY 1
#define RELOC 0x10000
@@ -37,7 +37,7 @@ startup_32:
jz 1f
movl 4(%esp), %eax
movl %eax, boot_param
-1:
+1:
movl stack_start, %esp
@@ -63,7 +63,7 @@ startup_32:
# Linux makes stupid assumptions about the segments
# that are already setup, so setup a new gdt & ldt
# and then reload the segment registers.
-
+
lgdt gdt_48
lidt idt_48
@@ -80,17 +80,17 @@ startup_32:
pushl boot_data # boot data pointer as second arg
pushl boot_type # boot data type as first argument
call convert_params
-
+
movl %eax, %esi # put the real mode pointer in a safe place
addl $16, %esp # pop the arguments
-
+
# Setup the registers before jumping to linux
# clear eflags
pushl $0
- popfl
+ popfl
# Flag to indicate we are the bootstrap processor
xorl %ebx, %ebx
@@ -231,7 +231,7 @@ jmpe820:
cmpl $SMAP, %eax
jne bail820
-good820:
+good820:
/* If this is useable memory, we save it by simply advancing %di by
* sizeof(e820rec)
*/
@@ -250,7 +250,7 @@ bail820:
popl %eax
subl %esi, %eax /* Compute how many structure we read */
- /* Restore everything else */
+ /* Restore everything else */
popl %edi
popl %esi
popl %ebx
@@ -260,7 +260,7 @@ bail820:
/**************************************************************************
-MEME801 - Determine size of extended memory
+MEME801 - Determine size of extended memory
**************************************************************************/
.globl meme801
meme801:
@@ -270,12 +270,12 @@ meme801:
call _prot_to_real
.code16
- stc # fix to work around buggy
- xorw %cx,%cx # BIOSes which dont clear/set
- xorw %dx,%dx # carry on pass/error of
- # e801h memory size call
- # or merely pass cx,dx though
- # without changing them.
+ stc # fix to work around buggy
+ xorw %cx,%cx # BIOSes which dont clear/set
+ xorw %dx,%dx # carry on pass/error of
+ # e801h memory size call
+ # or merely pass cx,dx though
+ # without changing them.
movw $0xe801,%ax
int $0x15
jc e801absent
@@ -284,7 +284,7 @@ meme801:
jne e801usecxdx # which report their extended
cmpw $0x0, %dx # memory in AX/BX rather than
jne e801usecxdx # CX/DX. The spec I have read
- movw %ax, %cx # seems to indicate AX/BX
+ movw %ax, %cx # seems to indicate AX/BX
movw %bx, %dx # are more reasonable anyway...
e801usecxdx:
@@ -298,7 +298,7 @@ e801usecxdx:
e801absent:
xorl %eax,%eax
-e801out:
+e801out:
data32 call _real_to_prot
.code32
/* Restore Everything */
@@ -308,7 +308,7 @@ e801out:
ret
/**************************************************************************
-MEM88 - Determine size of extended memory
+MEM88 - Determine size of extended memory
**************************************************************************/
.globl mem88
mem88:
@@ -330,7 +330,7 @@ mem88:
popl %esi
popl %ebx
ret
-
+
/**************************************************************************
BASEMEMSIZE - Get size of the conventional (base) memory
@@ -375,7 +375,7 @@ _real_to_prot:
popl %eax /* Fix up return address */
addl $RELOC,%eax
pushl %eax
-
+
/* switch to protected mode idt */
cs
lidt idt_48
@@ -469,7 +469,7 @@ gdt:
.byte (RELOC>>16),0x93,0x00,(RELOC>>24)
/* For 2.5.x the kernel segments have moved */
-
+
/* 0x28 dummy */
.quad 0
@@ -485,7 +485,7 @@ gdt:
.quad 0
/* 0x58 dummy */
.quad 0
-
+
/* 0x60 */
.word 0xFFFF # 4Gb - (0x100000*0x1000 = 4Gb)
@@ -534,7 +534,7 @@ gdt:
* 20 - PNPBIOS support
* 21 - APM BIOS support
* 22 - APM BIOS support
- * 23 - APM BIOS support
+ * 23 - APM BIOS support
*/
gdt_end:
@@ -546,7 +546,7 @@ gdt64:
.quad 0x00af9a000000ffff /* __KERNEL_CS */
.quad 0x00cf92000000ffff /* __KERNEL_DS */
gdt64_end:
-
+
.section ".trailer", "a"
/* Constants set at build time, these are at the very end of my image */
.balign 16
diff --git a/util/mkelfImage/linux-i386/mkelf-linux-i386.c b/util/mkelfImage/linux-i386/mkelf-linux-i386.c
index 172c05ad17..47256fd2f4 100644
--- a/util/mkelfImage/linux-i386/mkelf-linux-i386.c
+++ b/util/mkelfImage/linux-i386/mkelf-linux-i386.c
@@ -228,7 +228,7 @@ static void parse_elf64_kernel(struct kernel_info *info, char *kernel_buf, size_
if(!phdrs)
die("We need at least one phdr\n");
-
+
info->phdrs = phdrs;
info->entry = le64_to_cpu(ehdr->e_entry);
#if 0
@@ -296,7 +296,7 @@ void linux_i386_usage(void)
#define DEFAULT_RAMDISK_BASE (8*1024*1024)
-int linux_i386_mkelf(int argc, char **argv,
+int linux_i386_mkelf(int argc, char **argv,
struct memelfheader *ehdr, char *kernel_buf, off_t kernel_size)
{
const char *ramdisk, *cmdline;
@@ -379,7 +379,7 @@ int linux_i386_mkelf(int argc, char **argv,
strncpy(params->cmdline, cmdline, sizeof(params->cmdline));
params->cmdline[sizeof(params->cmdline)-1]= '\0';
-
+
/* Add a program header for the note section */
index = 4;
index += (kinfo.phdrs - 1);
@@ -388,7 +388,7 @@ int linux_i386_mkelf(int argc, char **argv,
/* Fill in the program headers*/
phdr[0].p_type = PT_NOTE;
-
+
/* Fill in the converter program headers */
phdr[1].p_paddr = CONVERTLOC;
phdr[1].p_vaddr = CONVERTLOC;
@@ -420,7 +420,7 @@ int linux_i386_mkelf(int argc, char **argv,
phdr[index].p_data = kinfo.kernel[i];
index++;
}
-
+
/* Put the ramdisk at ramdisk base.
*/
params->initrd_start = params->initrd_size = 0;
@@ -438,7 +438,7 @@ int linux_i386_mkelf(int argc, char **argv,
params->initrd_size = phdr[index].p_filesz;
index++;
}
-
+
/* Set the start location */
params->entry = kinfo.entry;
params->switch_64 = kinfo.switch_64;
diff --git a/util/mkelfImage/linux-i386/uniform_boot.h b/util/mkelfImage/linux-i386/uniform_boot.h
index 5291fa66bb..ac814967f6 100644
--- a/util/mkelfImage/linux-i386/uniform_boot.h
+++ b/util/mkelfImage/linux-i386/uniform_boot.h
@@ -1,25 +1,25 @@
#ifndef _LINUX_UNIFORM_BOOT_H
#define _LINUX_UNIFORM_BOOT_H
-/* The uniform boot environment information is restricted to
+/* The uniform boot environment information is restricted to
* hardware information. In particular for a simple enough machine
* all of the environment information should be able to reside in
* a rom and not need to be moved. This information is the
* information a trivial boot room can pass to linux to let it
- * run the hardware.
+ * run the hardware.
*
- * Also all of the information should be Position Independent Data.
+ * Also all of the information should be Position Independent Data.
* That is it should be safe to relocated any of the information
* without it's meaning/correctnes changing. The exception is the
* uniform_boot_header with it's two pointers arg & env.
- *
+ *
* The addresses in the arg & env pointers must be physical
* addresses. A physical address is an address you put in the page
- * table.
+ * table.
*
* The Command line is for user policy. Things like the default
* root device.
- *
+ *
*/
struct uniform_boot_header
@@ -55,7 +55,7 @@ struct ube_memory_range {
#define UBE_MEM_RESERVED 2
#define UBE_MEM_ACPI 3
#define UBE_MEM_NVS 4
-
+
};
struct ube_memory {
diff --git a/util/mkelfImage/linux-i386/x86-linux.h b/util/mkelfImage/linux-i386/x86-linux.h
index fe1673ea67..521988815c 100644
--- a/util/mkelfImage/linux-i386/x86-linux.h
+++ b/util/mkelfImage/linux-i386/x86-linux.h
@@ -18,9 +18,9 @@ struct e820entry {
} __attribute__((packed));
/* FIXME expand on drive_info_struct... */
-struct drive_info_struct {
- uint8_t dummy[32];
-};
+struct drive_info_struct {
+ uint8_t dummy[32];
+};
struct sys_desc_table {
uint16_t length;
uint8_t table[318];
@@ -90,7 +90,7 @@ struct x86_linux_param_header {
uint16_t ramdisk_flags; /* 0x1f8 */
#define RAMDISK_IMAGE_START_MASK 0x07FF
#define RAMDISK_PROMPT_FLAG 0x8000
-#define RAMDISK_LOAD_FLAG 0x4000
+#define RAMDISK_LOAD_FLAG 0x4000
uint16_t vid_mode; /* 0x1fa */
uint16_t root_dev; /* 0x1fc */
uint8_t reserved9[1]; /* 0x1fe */
diff --git a/util/mkelfImage/linux-ia64/convert_params.c b/util/mkelfImage/linux-ia64/convert_params.c
index 5022e52c4c..a58f4adf80 100644
--- a/util/mkelfImage/linux-ia64/convert_params.c
+++ b/util/mkelfImage/linux-ia64/convert_params.c
@@ -58,7 +58,7 @@ static void printf(const char *fmt, ...)
continue;
}
if (*++fmt == 's') {
- for(p = va_arg(args, char *); *p != '\0'; p++)
+ for(p = va_arg(args, char *); *p != '\0'; p++)
putchar(*p);
}
else { /* Length of item is bounded */
@@ -76,7 +76,7 @@ static void printf(const char *fmt, ...)
fmt++;
}
}
-
+
/*
* Before each format q points to tmp buffer
* After each format q points past end of item
@@ -150,7 +150,7 @@ int memcmp(void *vs1, void *vs2, size_t size)
return *s1 - *s2;
}
return 0;
-
+
}
void strappend(char *dest, const char *src, size_t max)
@@ -229,7 +229,7 @@ static void convert_bhdr_params(Elf_Bhdr *bhdr)
{
unsigned char *note, *end;
char *ldr_name, *ldr_version, *firmware;
-
+
ldr_name = ldr_version = firmware = 0;
note = ((char *)bhdr) + sizeof(*bhdr);
@@ -241,10 +241,10 @@ static void convert_bhdr_params(Elf_Bhdr *bhdr)
n_name = note + sizeof(*hdr);
n_desc = n_name + ((hdr->n_namesz + 3) & ~3);
next = n_desc + ((hdr->n_descsz + 3) & ~3);
- if (next > end)
+ if (next > end)
break;
#if 0
- printf("n_type: %x n_name(%d): n_desc(%d): \n",
+ printf("n_type: %x n_name(%d): n_desc(%d): \n",
hdr->n_type, hdr->n_namesz, hdr->n_descsz);
#endif
@@ -302,7 +302,7 @@ static void convert_bhdr_params(Elf_Bhdr *bhdr)
note = next;
}
if (ldr_name && ldr_version) {
- printf("Loader: %s version: %s\n",
+ printf("Loader: %s version: %s\n",
ldr_name, ldr_version);
}
if (firmware) {
@@ -311,12 +311,12 @@ static void convert_bhdr_params(Elf_Bhdr *bhdr)
}
}
-void *convert_params(unsigned long arg1, unsigned long r28,
+void *convert_params(unsigned long arg1, unsigned long r28,
struct image_parameters *params)
{
struct ia64_boot_param *orig_bp;
Elf_Bhdr *bhdr = (Elf_Bhdr*)arg1;
-
+
/* handle the options I can easily deal with */
bp.command_line = (unsigned long)&params->cmdline;
bp.initrd_start = params->initrd_start;
diff --git a/util/mkelfImage/linux-ia64/head.S b/util/mkelfImage/linux-ia64/head.S
index 4a12fb5566..df1b6827cb 100644
--- a/util/mkelfImage/linux-ia64/head.S
+++ b/util/mkelfImage/linux-ia64/head.S
@@ -1,5 +1,5 @@
#define ASSEMBLY 1
-
+
.text
#include "convert.h"
@@ -13,13 +13,13 @@ _start:
movl r15=@gprel(_start)
;;
sub gp=r14,r15 /* gp = _start - @gprel(_start), current value of gp */
- ;;
+ ;;
mov out0=in0
mov out1=r28
add out2=@gprel(params),gp
br.call.sptk.few rp=convert_params
-
+
mov r28=r8
add r15=@gprel(entry), gp
;;
@@ -50,7 +50,7 @@ _start:
#define UART_FCR 0x02
#define UART_LCR 0x03
#define UART_MCR 0x04
-
+
#define UART_DLL 0x00
#define UART_DLM 0x01
/* Status */
@@ -75,38 +75,38 @@ uart_init:
/* set the UART_BASE */
movl r31=UART_PHYS_BASE
;;
-
+
/* disable interrupts */
add r30=UART_IER,r31
mov r29=0x00
- ;;
+ ;;
st1 [r30]=r29
/* enable fifos */
add r30=UART_FCR,r31
mov r29=0x01
- ;;
+ ;;
st1 [r30]=r29
/* Set Baud Rate Divisor to UART_BAUD */
add r30=UART_LCR,r31
mov r29=0x83
- ;;
+ ;;
st1 [r30]=r29
add r30=UART_DLL,r31
mov r29=UART_DIV_LO
- ;;
+ ;;
st1 [r30]=r29
-
+
add r30=UART_DLM,r31
mov r29=UART_DIV_HI
- ;;
+ ;;
st1 [r30]=r29
add r30=UART_LCR,r31
mov r29=0x03
- ;;
+ ;;
st1 [r30]=r29
br.ret.sptk.few rp
@@ -133,7 +133,7 @@ __uart_tx_byte:
;;
st1.rel.nta [r30]=r32
;;
-
+
/* Wait until the UART is empty to be certain the byte is flushed */
add r30=UART_LSR,r31
;;
@@ -153,7 +153,7 @@ __uart_tx_hex_char:
(p63) add r32=48,r32 /* digits*/
(p62) add r32=55,r32 /* letters */
br.cond.sptk.few __uart_tx_byte
-
+
uart_tx_hex64:
/* set the UART_bASE */
movl r31=UART_PHYS_BASE
@@ -212,7 +212,7 @@ uart_tx_hex64:
;;
mov ar.pfs = r26
mov rp = r27
- ;;
+ ;;
br.ret.sptk.few rp
#endif
diff --git a/util/mkelfImage/linux-ia64/mkelf-linux-ia64.c b/util/mkelfImage/linux-ia64/mkelf-linux-ia64.c
index cfd79869ae..d4236cac99 100644
--- a/util/mkelfImage/linux-ia64/mkelf-linux-ia64.c
+++ b/util/mkelfImage/linux-ia64/mkelf-linux-ia64.c
@@ -112,8 +112,8 @@ static int populate_kernel_phdrs(struct kernel_info *info, struct memelfphdr *ph
if (paddr > le64_to_cpu(info->phdr[j].p_paddr)) {
continue;
}
- if (hdr &&
- le64_to_cpu(hdr->p_paddr) <
+ if (hdr &&
+ le64_to_cpu(hdr->p_paddr) <
le64_to_cpu(info->phdr[j].p_paddr)) {
continue;
}
@@ -131,7 +131,7 @@ static int populate_kernel_phdrs(struct kernel_info *info, struct memelfphdr *ph
}
return i;
}
-
+
void linux_ia64_usage(void)
{
@@ -192,7 +192,7 @@ int linux_ia64_mkelf(int argc, char **argv,
ehdr->ei_data = ELFDATA2LSB;
ehdr->e_type = ET_EXEC;
ehdr->e_machine = EM_IA_64;
-
+
/* locate the payload buffer */
payload_buf = payload;
payload_size = sizeof(payload);
@@ -221,10 +221,10 @@ int linux_ia64_mkelf(int argc, char **argv,
/* Fill in the program headers*/
phdr[0].p_type = PT_NOTE;
-
+
/* Fill in the kernel program headers */
- index = 1 + populate_kernel_phdrs(&kinfo, phdr + 1);
-
+ index = 1 + populate_kernel_phdrs(&kinfo, phdr + 1);
+
/* Fill in the converter program header */
phdr[index].p_paddr = roundup(phdr[index -1].p_paddr + phdr[index -1].p_memsz, 16);
phdr[index].p_vaddr = phdr[index].p_paddr;
diff --git a/util/mkelfImage/main/mkelfImage.c b/util/mkelfImage/main/mkelfImage.c
index bb318b3f37..0dcc8c2fc1 100644
--- a/util/mkelfImage/main/mkelfImage.c
+++ b/util/mkelfImage/main/mkelfImage.c
@@ -71,7 +71,7 @@ uint16_t add_ipchksums(unsigned long offset, uint16_t sum, uint16_t new)
sum = ~sum & 0xFFFF;
new = ~new & 0xFFFF;
if (offset & 1) {
- /* byte swap the sum if it came from an odd offset
+ /* byte swap the sum if it came from an odd offset
* since the computation is endian independant this
* works.
*/
@@ -114,7 +114,7 @@ char *slurp_file(const char *filename, off_t *r_size)
off_t size, progress;
ssize_t result;
struct stat stats;
-
+
if (!filename) {
*r_size = 0;
@@ -305,7 +305,7 @@ static void serialize_notes(char *buf, struct memelfheader *ehdr)
notes = ehdr->e_notenum;
size = sizeof_notes(note, notes);
memset(buf, 0, size);
-
+
/* Write the Elf Notes */
offset = 0;
for(i = 0; i < notes; i++) {
@@ -317,11 +317,11 @@ static void serialize_notes(char *buf, struct memelfheader *ehdr)
hdr.n_type = cpu_to_elf32(ehdr, note[i].n_type);
/* Copy the note into the buffer */
- memcpy(buf + offset, &hdr, sizeof(hdr));
+ memcpy(buf + offset, &hdr, sizeof(hdr));
offset += sizeof(hdr);
- memcpy(buf + offset, note[i].n_name, n_namesz);
+ memcpy(buf + offset, note[i].n_name, n_namesz);
offset += roundup(n_namesz, 4);
- memcpy(buf + offset, note[i].n_desc, note[i].n_descsz);
+ memcpy(buf + offset, note[i].n_desc, note[i].n_descsz);
offset += roundup(note[i].n_descsz, 4);
}
@@ -382,7 +382,7 @@ static void serialize_phdrs(char *buf, struct memelfheader *ehdr, size_t note_si
size_t offset, note_offset;
if (ehdr->ei_class == ELFCLASS32) {
Elf32_Phdr *phdr = (Elf32_Phdr *)buf;
- note_offset =
+ note_offset =
sizeof(Elf32_Ehdr) + (sizeof(Elf32_Phdr)*ehdr->e_phnum);
offset = note_offset + note_size;
for(i = 0; i < ehdr->e_phnum; i++) {
@@ -406,7 +406,7 @@ static void serialize_phdrs(char *buf, struct memelfheader *ehdr, size_t note_si
}
else if (ehdr->ei_class == ELFCLASS64) {
Elf64_Phdr *phdr = (Elf64_Phdr *)buf;
- note_offset =
+ note_offset =
sizeof(Elf64_Ehdr) + (sizeof(Elf64_Phdr)*ehdr->e_phnum);
offset = note_offset + note_size;
for(i = 0; i < ehdr->e_phnum; i++) {
@@ -478,7 +478,7 @@ static void write_elf(struct memelfheader *ehdr, char *output)
if (ehdr->ei_class == ELFCLASS32) {
ehdr_size = sizeof(Elf32_Ehdr);
phdr_size = sizeof(Elf32_Phdr) * ehdr->e_phnum;
- }
+ }
else if (ehdr->ei_class == ELFCLASS64) {
ehdr_size = sizeof(Elf64_Ehdr);
phdr_size = sizeof(Elf64_Phdr) * ehdr->e_phnum;
@@ -505,7 +505,7 @@ static void write_elf(struct memelfheader *ehdr, char *output)
/* Compute the final form of the notes */
serialize_notes(buf + ehdr_size + phdr_size, ehdr);
-
+
/* Now write the elf image */
fd = open(output, O_WRONLY | O_CREAT | O_EXCL, S_IRUSR | S_IRGRP | S_IROTH);
if (fd < 0) {
@@ -612,7 +612,7 @@ int main(int argc, char **argv)
}
}
fileind = optind;
-
+
/* Reset getopt for the next pass */
opterr = 1;
optind = 1;
diff --git a/util/mkelfImage/main/mkelfImage.man b/util/mkelfImage/main/mkelfImage.man
index f3f50d56d0..faf3613d47 100644
--- a/util/mkelfImage/main/mkelfImage.man
+++ b/util/mkelfImage/main/mkelfImage.man
@@ -1,5 +1,5 @@
.\" Automatically generated by Pod::Man v1.3, Pod::Parser v1.13
-.\" But now manually maintained
+.\" But now manually maintained
.\"
.\" Standard preamble:
.\" ========================================================================
diff --git a/util/mkelfImage/mkelfImage.spec.in b/util/mkelfImage/mkelfImage.spec.in
index a10eca4aa3..73abe6eef6 100644
--- a/util/mkelfImage/mkelfImage.spec.in
+++ b/util/mkelfImage/mkelfImage.spec.in
@@ -1,6 +1,6 @@
Summary: make an elf network bootable image for linux
Name: mkelfImage
-Version:
+Version:
Release: 0
Copyright: GPL
Group: Development/Tools
@@ -12,8 +12,8 @@ BuildRoot: %{_tmppath}/%{name}
mkelfImage is a program that makes a elf boot image for linux kernel images.
The image should work with any i386 multiboot compliant boot loader, an ELF boot
loader that passes no options, a loader compliant with the linuxBIOS elf booting
-spec or with the linux kexec kernel patch. A key feature here is that nothing
-relies upon BIOS calls, but they are made when necessary. This is useful for
+spec or with the linux kexec kernel patch. A key feature here is that nothing
+relies upon BIOS calls, but they are made when necessary. This is useful for
systems running linuxbios.
%prep
diff --git a/util/mptable/mptable.c b/util/mptable/mptable.c
index b253b75248..fea99ac877 100644
--- a/util/mptable/mptable.c
+++ b/util/mptable/mptable.c
@@ -296,7 +296,7 @@ int grope = 0;
int verbose = 0;
int noisy = 0;
/* preamble to the mptable. This is fixed for all coreboots */
-
+
char *preamble[] = {
"#include <console/console.h>",
"#include <arch/smp/mpspec.h>",
@@ -404,7 +404,7 @@ write_code(char **code)
printf("%s\n", *code++);
}
/*
- *
+ *
*/
int
main( int argc, char *argv[] )
@@ -415,7 +415,7 @@ main( int argc, char *argv[] )
int defaultConfig;
/* announce ourselves */
-
+
if (verbose) puts( SEP_LINE2 );
printf( "/* generated by MPTable, version %d.%d.%d*/\n", VMAJOR, VMINOR, VDELTA );
@@ -427,7 +427,7 @@ main( int argc, char *argv[] )
for(argc--, argv++; argc; argc--, argv++){
if ( strcmp( argv[0], "-dmesg") == 0 ) {
dmesg = 1;
- } else
+ } else
if ( strcmp( argv[0], "-help") == 0 )
{
usage();
@@ -648,7 +648,7 @@ apic_probe( vm_offset_t* paddr, int* where )
/*
- *
+ *
*/
static void
MPFloatingPointer( vm_offset_t paddr, int where, mpfps_t* mpfps )
@@ -719,7 +719,7 @@ MPFloatingPointer( vm_offset_t paddr, int where, mpfps_t* mpfps )
/*
- *
+ *
*/
static void
MPConfigDefault( int featureByte )
@@ -776,7 +776,7 @@ MPConfigDefault( int featureByte )
/*
- *
+ *
*/
static void
MPConfigTableHeader( uint32_t pap )
@@ -966,7 +966,7 @@ MPConfigTableHeader( uint32_t pap )
/*
- *
+ *
*/
static int
readType( void )
@@ -984,7 +984,7 @@ readType( void )
/*
- *
+ *
*/
static void
seekEntry( vm_offset_t addr )
@@ -995,7 +995,7 @@ seekEntry( vm_offset_t addr )
/*
- *
+ *
*/
static void
readEntry( void* entry, int size )
@@ -1034,7 +1034,7 @@ processorEntry( void )
/*
- *
+ *
*/
static int
lookupBusType( char* name )
@@ -1103,13 +1103,13 @@ ioApicEntry( void )
apics[ entry.apicID ] = entry.apicID;
// the numbering and setup of ioapics is so irrational
- // that for now we will punt.
+ // that for now we will punt.
#if 0
if (entry.apicFlags & IOAPICENTRY_FLAG_EN)
printf("\tsmp_write_ioapic(mc, 0x%x, 0x%x, 0x%x);\n",
entry.apicID, entry.apicVersion, entry.apicAddress);
#endif
-
+
}
@@ -1144,11 +1144,11 @@ intEntry( void )
printf( "\t %5d", (int)entry.srcBusID );
if ( busses[ (int)entry.srcBusID ] == PCI )
- printf( "\t%2d:%c",
+ printf( "\t%2d:%c",
((int)entry.srcBusIRQ >> 2) & 0x1f,
((int)entry.srcBusIRQ & 0x03) + 'A' );
else
- printf( "\t 0x%x:0x%x(0x%x)",
+ printf( "\t 0x%x:0x%x(0x%x)",
(int)entry.srcBusIRQ>>2,
(int)entry.srcBusIRQ & 3,
(int)entry.srcBusIRQ );
@@ -1163,7 +1163,7 @@ intEntry( void )
(int)entry.srcBusIRQ,
(int)entry.dstApicID ,
(int)entry.dstApicINT );
-
+
}
static void
@@ -1186,7 +1186,7 @@ lintEntry( void )
printf( "\t %5d", (int)entry.srcBusID );
if ( busses[ (int)entry.srcBusID ] == PCI )
- printf( "\t%2d:%c",
+ printf( "\t%2d:%c",
((int)entry.srcBusIRQ >> 2) & 0x1f,
((int)entry.srcBusIRQ & 0x03) + 'A' );
else
@@ -1201,7 +1201,7 @@ lintEntry( void )
(int)entry.srcBusID,
(int)entry.srcBusIRQ,
(int)entry.dstApicINT );
-
+
}
@@ -1304,7 +1304,7 @@ doOptionList( void )
/*
- *
+ *
*/
static void
pnstr( uint8_t* s, int c )
diff --git a/util/msrtool/configure b/util/msrtool/configure
index 88c38af6bd..e52054ba5e 100755
--- a/util/msrtool/configure
+++ b/util/msrtool/configure
@@ -82,7 +82,7 @@ trycompile() {
echo " using: ${CFLAGS} ${1}" 1>&2
echo "${CFLAGS} ${1}"
exit 0
- }
+ }
shift
i=$(($i+1))
done
diff --git a/util/msrtool/geodegx2.c b/util/msrtool/geodegx2.c
index 938444ff71..8ec06c2172 100644
--- a/util/msrtool/geodegx2.c
+++ b/util/msrtool/geodegx2.c
@@ -187,7 +187,7 @@ const struct msrdef geodegx2_msrs[] = {
{ MSR1(0), "Enable" },
{ MSR1(1), "Disable" },
{ BITVAL_EOT }
- }},
+ }},
{ 37, 4, RESERVED },
{ 33, 1, "HOI_LOI", "High / Low Order Interleave Select", PRESENT_BIN, {
{ MSR1(0), "Low Order Interleave" },
diff --git a/util/msrtool/msrtool.c b/util/msrtool/msrtool.c
index 47b4938739..9cbf358ce4 100644
--- a/util/msrtool/msrtool.c
+++ b/util/msrtool/msrtool.c
@@ -346,7 +346,7 @@ int main(int argc, char *argv[]) {
if (targets)
for (tn = 0; tn < targets_found; tn++)
printf_quiet("Forced target %s: %s\n", targets[tn]->name, targets[tn]->prettyname);
- else
+ else
for (t = alltargets; !TARGET_ISEOT(*t); t++) {
printf_verbose("Probing for target %s: %s\n", t->name, t->prettyname);
if (!t->probe(t))
diff --git a/util/nrv2b/nrv2b.c b/util/nrv2b/nrv2b.c
index c8daa4d47f..e9b72a69bb 100644
--- a/util/nrv2b/nrv2b.c
+++ b/util/nrv2b/nrv2b.c
@@ -25,10 +25,10 @@
library from upx. That code is:
Copyright (C) 1996-2002 Markus Franz Xaver Johannes Oberhumer
And is distributed under the terms of the GPL.
- The conversion was performed
+ The conversion was performed
by Eric Biederman <ebiederman@lnxi.com>.
20 August 2002
-
+
**************************************************************/
#define UCLPACK_COMPAT 0
#include <stdio.h>
@@ -144,19 +144,19 @@ struct ucl_compress
int init;
unsigned int look; /* bytes in lookahead buffer */
-
+
unsigned int m_len;
unsigned int m_off;
-
+
unsigned int last_m_len;
unsigned int last_m_off;
-
+
const unsigned char *bp;
const unsigned char *ip;
const unsigned char *in;
const unsigned char *in_end;
unsigned char *out;
-
+
uint32_t bb_b;
unsigned bb_k;
unsigned bb_c_endian;
@@ -164,7 +164,7 @@ struct ucl_compress
unsigned bb_c_s8;
unsigned char *bb_p;
unsigned char *bb_op;
-
+
struct ucl_compress_config conf;
unsigned int *result;
@@ -173,7 +173,7 @@ struct ucl_compress
unsigned int printcount; /* counter for reporting progress every 1K
bytes */
-
+
/* some stats */
unsigned long lit_bytes;
unsigned long match_bytes;
@@ -209,13 +209,13 @@ struct ucl_swd
unsigned int n;
unsigned int f;
unsigned int threshold;
-
+
/* public - configuration */
unsigned int max_chain;
unsigned int nice_length;
int use_best_off;
unsigned int lazy_insert;
-
+
/* public - output */
unsigned int m_len;
unsigned int m_off;
@@ -224,27 +224,27 @@ struct ucl_swd
#if defined(SWD_BEST_OFF)
unsigned int best_off[ SWD_BEST_OFF ];
#endif
-
+
/* semi public */
struct ucl_compress *c;
unsigned int m_pos;
#if defined(SWD_BEST_OFF)
unsigned int best_pos[ SWD_BEST_OFF ];
#endif
-
+
/* private */
const uint8_t *dict;
const uint8_t *dict_end;
unsigned int dict_len;
-
+
/* private */
unsigned int ip; /* input pointer (lookahead) */
unsigned int bp; /* buffer pointer */
unsigned int rp; /* remove pointer */
unsigned int b_size;
-
+
unsigned char *b_wrap;
-
+
unsigned int node_count;
unsigned int first_rp;
@@ -266,7 +266,7 @@ static void assert_match(const struct ucl_swd * swd, unsigned int m_len,
{
const struct ucl_compress *c = swd->c;
unsigned int d_off;
-
+
assert(m_len >= 2);
if (m_off <= (unsigned int) (c->bp - c->in))
{
@@ -468,7 +468,7 @@ void swd_remove_node(struct ucl_swd *s, unsigned int node)
if (s->node_count == 0)
{
unsigned int key;
-
+
#ifdef UCL_DEBUG
if (s->first_rp != UINT_MAX)
{
@@ -481,11 +481,11 @@ void swd_remove_node(struct ucl_swd *s, unsigned int node)
s->first_rp = UINT_MAX;
}
#endif
-
+
key = HEAD3(s->b,node);
assert(s->llen3[key] > 0);
--s->llen3[key];
-
+
key = HEAD2(s->b,node);
assert(s->head2[key] != NIL2);
if ((unsigned int) s->head2[key] == node)
@@ -544,18 +544,18 @@ void swd_search(struct ucl_swd *s, unsigned int node, unsigned int cnt)
const unsigned char * bp = s->b + s->bp;
const unsigned char * bx = s->b + s->bp + s->look;
unsigned char scan_end1;
-
+
assert(s->m_len > 0);
-
+
scan_end1 = bp[m_len - 1];
for ( ; cnt-- > 0; node = s->succ3[node])
{
p1 = bp;
p2 = b + node;
px = bx;
-
+
assert(m_len < s->look);
-
+
if (
p2[m_len - 1] == scan_end1 &&
p2[m_len] == p1[m_len] &&
@@ -564,11 +564,11 @@ void swd_search(struct ucl_swd *s, unsigned int node, unsigned int cnt)
{
unsigned int i;
assert(memcmp(bp,&b[node],3) == 0);
-
+
p1 += 2; p2 += 2;
do {} while (++p1 < px && *p1 == *++p2);
i = p1 - bp;
-
+
#ifdef UCL_DEBUG
if (memcmp(bp,&b[node],i) != 0)
printf("%5ld %5ld %02x%02x %02x%02x\n",
@@ -576,7 +576,7 @@ void swd_search(struct ucl_swd *s, unsigned int node, unsigned int cnt)
bp[0], bp[1], b[node], b[node+1]);
#endif
assert(memcmp(bp,&b[node],i) == 0);
-
+
#if defined(SWD_BEST_OFF)
if (i < SWD_BEST_OFF)
{
@@ -603,10 +603,10 @@ void swd_search(struct ucl_swd *s, unsigned int node, unsigned int cnt)
static int swd_search2(struct ucl_swd *s)
{
unsigned int key;
-
+
assert(s->look >= 2);
assert(s->m_len > 0);
-
+
key = s->head2[ HEAD2(s->b,s->bp) ];
if (key == NIL2)
return 0;
@@ -620,7 +620,7 @@ static int swd_search2(struct ucl_swd *s)
if (s->best_pos[2] == 0)
s->best_pos[2] = key + 1;
#endif
-
+
if (s->m_len < 2)
{
s->m_len = 2;
@@ -702,25 +702,25 @@ init_match ( struct ucl_compress *c, struct ucl_swd *s,
uint32_t flags )
{
int r;
-
+
assert(!c->init);
c->init = 1;
-
+
s->c = c;
-
+
c->last_m_len = c->last_m_off = 0;
-
+
c->textsize = c->codesize = c->printcount = 0;
c->lit_bytes = c->match_bytes = c->rep_bytes = 0;
c->lazy = 0;
-
+
r = swd_init(s,dict,dict_len);
if (r != UCL_E_OK)
{
swd_exit(s);
return r;
}
-
+
s->use_best_off = (flags & 1) ? 1 : 0;
return UCL_E_OK;
}
@@ -730,7 +730,7 @@ find_match ( struct ucl_compress *c, struct ucl_swd *s,
unsigned int this_len, unsigned int skip )
{
assert(c->init);
-
+
if (skip > 0)
{
assert(this_len >= skip);
@@ -742,7 +742,7 @@ find_match ( struct ucl_compress *c, struct ucl_swd *s,
assert(this_len <= 1);
c->textsize += this_len - skip;
}
-
+
s->m_len = THRESHOLD;
#ifdef SWD_BEST_OFF
if (s->use_best_off)
@@ -751,9 +751,9 @@ find_match ( struct ucl_compress *c, struct ucl_swd *s,
swd_findbest(s);
c->m_len = s->m_len;
c->m_off = s->m_off;
-
+
swd_getbyte(s);
-
+
if (s->b_char < 0)
{
c->look = 0;
@@ -765,7 +765,7 @@ find_match ( struct ucl_compress *c, struct ucl_swd *s,
c->look = s->look + 1;
}
c->bp = c->ip - c->look;
-
+
#if 0
/* brute force match search */
if (c->m_len > THRESHOLD && c->m_len + 1 <= c->look)
@@ -773,7 +773,7 @@ find_match ( struct ucl_compress *c, struct ucl_swd *s,
const uint8_t *ip = c->bp;
const uint8_t *m = c->bp - c->m_off;
const uint8_t *in = c->in;
-
+
if (ip - in > N)
in = ip - N;
for (;;)
@@ -791,7 +791,7 @@ find_match ( struct ucl_compress *c, struct ucl_swd *s,
}
}
#endif
-
+
return UCL_E_OK;
}
@@ -924,7 +924,7 @@ code_match(struct ucl_compress *c, unsigned int m_len, const unsigned int m_off)
code_match(c, c->conf.max_match - 3, m_off);
m_len -= c->conf.max_match - 3;
}
-
+
c->match_bytes += m_len;
if (m_len > c->result[3])
c->result[3] = m_len;
@@ -987,9 +987,9 @@ len_of_coded_match(struct ucl_compress *c, unsigned int m_len, unsigned int
|| m_off > c->conf.max_offset)
return -1;
assert(m_off > 0);
-
+
m_len = m_len - 2 - (m_off > M2_MAX_OFFSET);
-
+
if (m_off == c->last_m_off)
b = 1 + 2;
else
@@ -1038,7 +1038,7 @@ int ucl_nrv2b_99_compress(
#define SC_MAX_CHAIN 4096
#define SC_FLAGS 1
#define SC_MAX_OFFSET N
-
+
memset(c, 0, sizeof(*c));
c->ip = c->in = in;
c->in_end = in + in_len;
@@ -1054,10 +1054,10 @@ int ucl_nrv2b_99_compress(
if (r != 0)
return UCL_E_INVALID_ARGUMENT;
c->bb_op = out;
-
+
ii = c->ip; /* point to start of literal run */
lit = 0;
-
+
swd = (struct ucl_swd *) malloc(sizeof(*swd));
if (!swd)
@@ -1082,7 +1082,7 @@ int ucl_nrv2b_99_compress(
swd->nice_length = SC_NICE_LENGTH;
if (c->conf.max_match < swd->nice_length)
swd->nice_length = c->conf.max_match;
-
+
c->last_m_off = 1;
r = find_match(c,swd,0,0);
if (r != UCL_E_OK)
@@ -1092,19 +1092,19 @@ int ucl_nrv2b_99_compress(
unsigned int ahead;
unsigned int max_ahead;
int l1, l2;
-
+
c->codesize = c->bb_op - out;
-
+
m_len = c->m_len;
m_off = c->m_off;
-
+
assert(c->bp == c->ip - c->look);
assert(c->bp >= in);
if (lit == 0)
ii = c->bp;
assert(ii + lit == c->bp);
assert(swd->b_char == *(c->bp));
-
+
if (m_len < 2 || (m_len == 2 && (m_off > M2_MAX_OFFSET))
|| m_off > c->conf.max_offset)
{
@@ -1115,10 +1115,10 @@ int ucl_nrv2b_99_compress(
assert(r == 0);
continue;
}
-
+
/* a match */
assert_match(swd,m_len,m_off);
-
+
/* shall we try a lazy match ? */
ahead = 0;
if (SC_TRY_LAZY <= 0 || m_len >= SC_MAX_LAZY || m_off ==
@@ -1139,7 +1139,7 @@ int ucl_nrv2b_99_compress(
max_ahead = m_len -1;
}
}
-
+
while (ahead < max_ahead && c->look > m_len)
{
if (m_len >= SC_GOOD_LENGTH)
@@ -1148,11 +1148,11 @@ int ucl_nrv2b_99_compress(
swd->max_chain = SC_MAX_CHAIN;
r = find_match(c,swd,1,0);
ahead++;
-
+
assert(r == 0);
assert(c->look > 0);
assert(ii + lit + ahead == c->bp);
-
+
if (c->m_len < 2)
continue;
l2 = len_of_coded_match(c,c->m_len,c->m_off);
@@ -1168,36 +1168,36 @@ int ucl_nrv2b_99_compress(
goto lazy_match_done;
}
}
-
+
assert(ii + lit + ahead == c->bp);
-
+
/* 1 - code run */
code_run(c,ii,lit);
lit = 0;
-
+
/* 2 - code match */
code_match(c,m_len,m_off);
swd->max_chain = SC_MAX_CHAIN;
r = find_match(c,swd,m_len,1+ahead);
assert(r == 0);
-
+
lazy_match_done: ;
}
-
+
/* store final run */
code_run(c,ii,lit);
-
+
/* EOF */
bbPutBit(c, 0);
code_prefix_ss11(c, 0x1000000U);
bbPutByte(c, 0xff);
bbFlushBits(c, 0);
-
+
assert(c->textsize == in_len);
c->codesize = c->bb_op - out;
*out_len = c->bb_op - out;
-
+
#if 0
printf("%7ld %7ld -> %7ld %7ld %7ld %ld (max: %d %d %d)\n",
(long) c->textsize, (long) in_len, (long) c->codesize,
@@ -1205,7 +1205,7 @@ int ucl_nrv2b_99_compress(
c->result[1], c->result[3], c->result[5]);
#endif
assert(c->lit_bytes + c->match_bytes == in_len);
-
+
swd_exit(swd);
free(swd);
@@ -1250,7 +1250,7 @@ void Encode(void) /* compression */
tw = host_to_i86ul(in_len);
if (fwrite(&tw, sizeof(tw), 1, outfile) != 1)
Error("Can't write."); /* output size of text */
-#endif
+#endif
if (in_len == 0)
return;
rewind(infile);
@@ -1292,7 +1292,7 @@ void Encode(void) /* compression */
Fprintf((stderr, "input/output = %ld/%ld = %.3f\n", in_len, out_len,
(double)in_len / out_len));
#endif
-
+
}
#endif
@@ -1365,7 +1365,7 @@ void Decode(void) /* recover */
if (!src)
Error("Can't malloc");
src_len = fread(src, 1, max_src_len, infile);
- if (src_len <= 0)
+ if (src_len <= 0)
Error("Can't read");
for(;;) {
@@ -1395,7 +1395,7 @@ void Decode(void) /* recover */
}
m_len = GETBIT(bb, src, ilen);
m_len = m_len*2 + GETBIT(bb, src, ilen);
- if (m_len == 0)
+ if (m_len == 0)
{
m_len++;
do {
@@ -1437,7 +1437,7 @@ int main(int argc, char *argv[])
char *s;
FILE *f;
int c;
-
+
if (argc == 2) {
outfile = stdout;
if ((f = tmpfile()) == NULL) {
diff --git a/util/nvramtool/Makefile b/util/nvramtool/Makefile
index 752e106da8..010c859b4f 100644
--- a/util/nvramtool/Makefile
+++ b/util/nvramtool/Makefile
@@ -1,6 +1,6 @@
#
# Makefile for nvram utility
-#
+#
# (C) 2005-2008 coresystems GmbH
# written by Stefan Reinauer <stepan@coresystems.de>
#
diff --git a/util/nvramtool/cmos_lowlevel.c b/util/nvramtool/cmos_lowlevel.c
index 67d561b267..ecfc99b74f 100644
--- a/util/nvramtool/cmos_lowlevel.c
+++ b/util/nvramtool/cmos_lowlevel.c
@@ -75,7 +75,7 @@ static inline unsigned char get_bits(unsigned long long value, unsigned bit,
static inline void put_bits(unsigned char value, unsigned bit,
unsigned nr_bits, unsigned long long *result)
{
- *result += ((unsigned long long)(value &
+ *result += ((unsigned long long)(value &
((unsigned char)((1 << nr_bits) - 1)))) << bit;
}
@@ -161,7 +161,7 @@ void cmos_write(const cmos_entry_t * e, unsigned long long value)
} else {
for (next_bit = 0, bits_left = length;
bits_left; next_bit += nr_bits, bits_left -= nr_bits) {
- nr_bits = cmos_bit_op_strategy(bit + next_bit,
+ nr_bits = cmos_bit_op_strategy(bit + next_bit,
bits_left, &where);
cmos_write_bits(&where, nr_bits,
get_bits(value, next_bit, nr_bits));
diff --git a/util/nvramtool/cmos_ops.c b/util/nvramtool/cmos_ops.c
index 73d68e0a23..86ffe1022b 100644
--- a/util/nvramtool/cmos_ops.c
+++ b/util/nvramtool/cmos_ops.c
@@ -122,7 +122,7 @@ int prepare_cmos_write(const cmos_entry_t * e, const char value_str[],
break;
case CMOS_ENTRY_HEX:
- /* See if the first character of 'value_str' (excluding
+ /* See if the first character of 'value_str' (excluding
* any initial whitespace) is a minus sign.
*/
for (p = value_str; isspace(*p); p++) ;
diff --git a/util/nvramtool/common.c b/util/nvramtool/common.c
index c80c2da6df..45338ec4de 100644
--- a/util/nvramtool/common.c
+++ b/util/nvramtool/common.c
@@ -48,7 +48,7 @@ int get_line_from_file(FILE * f, char line[], int line_buf_size)
return LINE_EOF;
/* If the file contains a line that is too long, then it's best
- * to let the user know right away rather than passing back a
+ * to let the user know right away rather than passing back a
* truncated result that will lead to problems later on.
*/
return (strlen(line) == ((size_t) (line_buf_size - 1))) ?
diff --git a/util/nvramtool/coreboot_tables.h b/util/nvramtool/coreboot_tables.h
index d6e1b76942..08f0be63fa 100644
--- a/util/nvramtool/coreboot_tables.h
+++ b/util/nvramtool/coreboot_tables.h
@@ -17,7 +17,7 @@
* is expected to be information that cannot be discovered by
* other means, such as quering the hardware directly.
*
- * All of the information should be Position Independent Data.
+ * All of the information should be Position Independent Data.
* That is it should be safe to relocated any of the information
* without it's meaning/correctnes changing. For table that
* can reasonably be used on multiple architectures the data
@@ -40,9 +40,9 @@
* table entries and be backwards compatible, but it is not required.
*/
-/* Since coreboot is usually compiled 32bit, gcc will align 64bit
- * types to 32bit boundaries. If the coreboot table is dumped on a
- * 64bit system, a uint64_t would be aligned to 64bit boundaries,
+/* Since coreboot is usually compiled 32bit, gcc will align 64bit
+ * types to 32bit boundaries. If the coreboot table is dumped on a
+ * 64bit system, a uint64_t would be aligned to 64bit boundaries,
* breaking the table format.
*
* lb_uint64 will keep 64bit coreboot table values aligned to 32bit
@@ -177,7 +177,7 @@ struct cmos_entries {
uint32_t config; /* e=enumeration, h=hex, r=reserved */
uint32_t config_id; /* a number linking to an enumeration record */
#define CMOS_MAX_NAME_LENGTH 32
- uint8_t name[CMOS_MAX_NAME_LENGTH]; /* name of entry in ascii,
+ uint8_t name[CMOS_MAX_NAME_LENGTH]; /* name of entry in ascii,
variable length int aligned */
};
@@ -192,7 +192,7 @@ struct cmos_enums {
uint32_t config_id; /* a number identifying the config id */
uint32_t value; /* the value associated with the text */
#define CMOS_MAX_TEXT_LENGTH 32
- uint8_t text[CMOS_MAX_TEXT_LENGTH]; /* enum description in ascii,
+ uint8_t text[CMOS_MAX_TEXT_LENGTH]; /* enum description in ascii,
variable length int aligned */
};
diff --git a/util/nvramtool/hexdump.c b/util/nvramtool/hexdump.c
index 78199eb0ce..405703fe73 100644
--- a/util/nvramtool/hexdump.c
+++ b/util/nvramtool/hexdump.c
@@ -88,7 +88,7 @@ void hexdump(const void *mem, int bytes, uint64_t addrprint_start,
* terminates, the number of remaining bytes to display (if any)
* will not be enough to fill an entire line.
*/
- for (bytes_left = bytes;
+ for (bytes_left = bytes;
bytes_left >= format->bytes_per_line;
bytes_left -= format->bytes_per_line) {
/* print start address for current line */
diff --git a/util/nvramtool/ip_checksum.h b/util/nvramtool/ip_checksum.h
index ebd52ceb2c..f2a13070a3 100644
--- a/util/nvramtool/ip_checksum.h
+++ b/util/nvramtool/ip_checksum.h
@@ -7,7 +7,7 @@
/* Note: The contents of this file were borrowed from the coreboot source
* code which may be obtained from http://www.coreboot.org.
- * Specifically, this code was obtained from coreboot (LinuxBIOS)
+ * Specifically, this code was obtained from coreboot (LinuxBIOS)
* version 1.0.0.8.
*/
diff --git a/util/nvramtool/nvramtool.8 b/util/nvramtool/nvramtool.8
index e12070bf39..9159a2a6dd 100644
--- a/util/nvramtool/nvramtool.8
+++ b/util/nvramtool/nvramtool.8
@@ -114,7 +114,7 @@ input.
If
.B "VALUE"
is present then set the CMOS checksum for the coreboot parameters to
-.B "VALUE."
+.B "VALUE."
Otherwise, show the checksum value.
.TP
.B "-l [ARG]"
diff --git a/util/optionlist/Makefile b/util/optionlist/Makefile
index 3fb69232ec..5d0d2d298f 100644
--- a/util/optionlist/Makefile
+++ b/util/optionlist/Makefile
@@ -1,24 +1,24 @@
-#
+#
# Copyright (C) 2010 coresystems GmbH
-#
+#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; version 2 of the License.
-#
+#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
-#
+#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-#
+#
SVNVERSION := $(shell LC_ALL=C svnversion -cn ../.. | sed -e "s/.*://" -e "s/\([0-9]*\).*/\1/" | grep "[0-9]" || LC_ALL=C svn info . | grep ^Revision | sed "s/.*[[:blank:]]\+\([0-9]*\)[^0-9]*/\1/" | grep "[0-9]" || echo unknown)
-all:
+all:
cd ../..; util/optionlist/kconfig2wiki src/Kconfig $(SVNVERSION) > util/optionlist/Options.wiki
clean:
diff --git a/util/optionlist/kconfig2wiki b/util/optionlist/kconfig2wiki
index 0a2b0aaf86..23d464a3ea 100755
--- a/util/optionlist/kconfig2wiki
+++ b/util/optionlist/kconfig2wiki
@@ -1,25 +1,25 @@
#!/usr/bin/python
-#
+#
# kconfig2wiki - Kconfig to MediaWiki converter for
# http://www.coreboot.org/Coreboot_Options
-#
+#
# Copyright (C) 2010 coresystems GmbH
# based on http://landley.net/kdocs/make/menuconfig2html.py
# Copyright (C) by Rob Landley
-#
+#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; version 2 of the License
-#
+#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
-#
+#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-#
+#
helplen = 0
extra_chapters = 0
diff --git a/util/options/build_opt_tbl.c b/util/options/build_opt_tbl.c
index ae36f87e03..3660f4e2ab 100644
--- a/util/options/build_opt_tbl.c
+++ b/util/options/build_opt_tbl.c
@@ -99,7 +99,7 @@ static void test_for_entry_overlaps(void *entry_start, void *entry_end)
ce->name);
exit(1);
}
- /* test if entries 8 or more in length are even bytes */
+ /* test if entries 8 or more in length are even bytes */
if(ce->length%8){
printf("Error - Entry %s length over 8 must be a multiple of 8\n",
ce->name);
@@ -164,7 +164,7 @@ static unsigned long get_number(char *line, char **ptr, int base)
char *ptr2;
value = strtoul(*ptr, &ptr2, base);
if (ptr2 == *ptr) {
- printf("Error missing digits at: \n%s\n in line:\n%s\n",
+ printf("Error missing digits at: \n%s\n in line:\n%s\n",
*ptr, line);
exit(1);
}
@@ -237,15 +237,15 @@ static int is_ident(char *str)
*
* The input comes from the configuration file which contains two parts
* entries and enumerations. Each section is started with the key words
- * entries and enumerations. Records then follow in their respective
+ * entries and enumerations. Records then follow in their respective
* formats.
*
* The output of this program is the cmos definitions table. It is stored
- * in the cmos_table array. If this module is called, and the global
+ * in the cmos_table array. If this module is called, and the global
* table_file has been implimented by the user, the table is also written
* to the specified file.
*
- * This program exits with a return code of 1 on error. It returns 0 on
+ * This program exits with a return code of 1 on error. It returns 0 on
* successful completion
*/
int main(int argc, char **argv)
@@ -336,7 +336,7 @@ int main(int argc, char **argv)
ce=(struct cmos_entries*)(cmos_table+(ct->header_length));
cptr = (char*)ce;
for(;;){ /* this section loops through the entry records */
- if(fgets(line,INPUT_LINE_MAX,fp)==NULL)
+ if(fgets(line,INPUT_LINE_MAX,fp)==NULL)
break; /* end if no more input */
// FIXME mode should be a single enum.
if(!entry_mode) { /* skip input until the entries key word */
@@ -378,8 +378,8 @@ int main(int argc, char **argv)
exit(1);
}
if (!is_ident((char *)ce->name)) {
- fprintf(stderr,
- "Error - Name %s is an invalid identifier in line\n %s\n",
+ fprintf(stderr,
+ "Error - Name %s is an invalid identifier in line\n %s\n",
ce->name, line);
exit(1);
}
@@ -408,7 +408,7 @@ int main(int argc, char **argv)
for(;enum_mode;){ /* loop to build the enumerations section */
long ptr;
- if(fgets(line,INPUT_LINE_MAX,fp)==NULL)
+ if(fgets(line,INPUT_LINE_MAX,fp)==NULL)
break; /* go till end of input */
if (strstr(line, "checksums") != 0) {
@@ -432,7 +432,7 @@ int main(int argc, char **argv)
for(cnt=0;(line[ptr]!='\n')&&(cnt<31);ptr++,cnt++)
c_enums->text[cnt]=line[ptr];
c_enums->text[cnt]=0;
-
+
/* make the record int aligned */
cnt++;
if(cnt%4)
@@ -473,7 +473,7 @@ int main(int argc, char **argv)
skip_spaces(line, &ptr);
cs->location = get_number(line, &ptr, 10);
-
+
/* Make certain there are spaces until the end of the line */
skip_spaces(line, &ptr);
@@ -498,7 +498,7 @@ int main(int argc, char **argv)
exit(1);
}
if ((cs->location >= (CMOS_IMAGE_BUFFER_SIZE*8)) ||
- ((cs->location + 16) > (CMOS_IMAGE_BUFFER_SIZE*8)))
+ ((cs->location + 16) > (CMOS_IMAGE_BUFFER_SIZE*8)))
{
fprintf(stderr, "Error - location is to big in line\n%s\n", line);
exit(1);
diff --git a/util/resetcf/resetcf.c b/util/resetcf/resetcf.c
index 1977f7dbcb..01e270c824 100644
--- a/util/resetcf/resetcf.c
+++ b/util/resetcf/resetcf.c
@@ -23,7 +23,7 @@ main(int argc, char *argv[])
{
v = mmap(0, length, PROT_READ | PROT_WRITE, MAP_SHARED,fd,nvram);
fprintf(stderr, "mmap returns %p\n", v);
-
+
if ( v == (void *) -1)
{
perror("mmap");
@@ -33,10 +33,10 @@ main(int argc, char *argv[])
perror("open /dev/mem");
exit(1);
}
-
+
for( i = 0x836 ; i < 0x840 ; i++){
*(unsigned char *)(v+i) = 0;
}
-
-
+
+
}
diff --git a/util/romcc/Makefile b/util/romcc/Makefile
index 1734fe5c89..6543fbb3b7 100644
--- a/util/romcc/Makefile
+++ b/util/romcc/Makefile
@@ -149,7 +149,7 @@ TEST_ASM_O2_mmmx_msse:=$(patsubst %.c, tests/%.S-O2-mmmx-msse, $(TESTS))
TEST_ASM_O2_mmmx_call :=$(patsubst %.c, tests/%.S-O2-mmmx-call, $(TESTS))
TEST_ASM_O2_mmmx_msse_call:=$(patsubst %.c, tests/%.S-O2-mmmx-msse-call, $(TESTS))
TEST_ASM_ALL:= $(TEST_ASM) $(TEST_ASM_O) $(TEST_ASM_O2) $(TEST_ASM_mmmx) $(TEST_ASM_msse) $(TEST_ASM_mmmx_msse) $(TEST_ASM_O_mmmx) $(TEST_ASM_O_msse) $(TEST_ASM_O_mmmx_msse) $(TEST_ASM_O2_mmmx) $(TEST_ASM_O2_msse) $(TEST_ASM_O2_mmmx_msse) $(TEST_ASM_O2_mmmx_call) $(TEST_ASM_O2_mmmx_msse_call)
-TEST_ASM_MOST:= $(TEST_ASM_O) $(TEST_ASM_O_mmmx) $(TEST_ASM_O_msse) $(TEST_ASM_O_mmmx_msse) $(TEST_ASM_O2) $(TEST_ASM_O2_mmmx) $(TEST_ASM_O2_msse) $(TEST_ASM_O2_mmmx_msse)
+TEST_ASM_MOST:= $(TEST_ASM_O) $(TEST_ASM_O_mmmx) $(TEST_ASM_O_msse) $(TEST_ASM_O_mmmx_msse) $(TEST_ASM_O2) $(TEST_ASM_O2_mmmx) $(TEST_ASM_O2_msse) $(TEST_ASM_O2_mmmx_msse)
# $(TEST_ASM_O2_mmmx_call) $(TEST_ASM_O2_mmmx_msse_call)
TEST_OBJ:=$(patsubst %.c, tests/%.o, $(TESTS))
TEST_ELF:=$(patsubst %.c, tests/%.elf, $(TESTS))
diff --git a/util/romcc/do_tests.sh b/util/romcc/do_tests.sh
index fdbe2a6189..2ce39d17e1 100644
--- a/util/romcc/do_tests.sh
+++ b/util/romcc/do_tests.sh
@@ -22,12 +22,12 @@ LIST="1 2 3 4 5 6"
BASE="raminit_test"
#SKIP="6"
EXPECTED_BAD=""
-fi
+fi
if [ "$type" = "hello" ] ; then
LIST="1 2"
BASE="hello_world"
EXPECTED_BAD=""
-fi
+fi
SKIPPED=""
@@ -36,7 +36,7 @@ BAD=""
OLD_BAD=""
NEW_BAD=""
NEW_GOOD=""
-for i in $LIST ; do
+for i in $LIST ; do
DO_SKIP=""
for j in $SKIP ; do
if [ "$j" = "$i" ] ; then
@@ -55,8 +55,8 @@ for i in $LIST ; do
break;
fi
done
- echo -e -n "$i $PROBLEM\t"
- if ./tests.sh $BASE $i > /dev/null 2> /dev/null ; then
+ echo -e -n "$i $PROBLEM\t"
+ if ./tests.sh $BASE $i > /dev/null 2> /dev/null ; then
echo OK
if [ ! -z "$PROBLEM" ] ; then
NEW_GOOD="$NEW_GOOD$i "
@@ -65,10 +65,10 @@ for i in $LIST ; do
else
echo -n "FAILED: "
tail -n 1 tests/$BASE$i.debug2 | tr -d '\r\n'
- echo
+ echo
if [ -z "$PROBLEM" ] ; then
NEW_BAD="$NEW_BAD$i "
- else
+ else
OLD_BAD="$OLD_BAD$i "
fi
BAD="$BAD$i "
diff --git a/util/romcc/romcc.c b/util/romcc/romcc.c
index e691f3f585..7eced78ed2 100644
--- a/util/romcc/romcc.c
+++ b/util/romcc/romcc.c
@@ -25,9 +25,9 @@
#define MAX_CWD_SIZE 4096
#define MAX_ALLOCATION_PASSES 100
-/* NOTE: Before you even start thinking to touch anything
+/* NOTE: Before you even start thinking to touch anything
* in this code, set DEBUG_ROMCC_WARNINGS to 1 to get an
- * insight on the original author's thoughts. We introduced
+ * insight on the original author's thoughts. We introduced
* this switch as romcc was about the only thing producing
* massive warnings in our code..
*/
@@ -61,7 +61,7 @@
#endif
/* Control flow graph of a loop without goto.
- *
+ *
* AAA
* +---/
* /
@@ -74,31 +74,31 @@
* |\ GGG HHH | continue;
* | \ \ | |
* | \ III | /
- * | \ | / /
- * | vvv /
- * +----BBB /
+ * | \ | / /
+ * | vvv /
+ * +----BBB /
* | /
* vv
* JJJ
*
- *
+ *
* AAA
* +-----+ | +----+
* | \ | / |
* | BBB +-+ |
* | / \ / | |
* | CCC JJJ / /
- * | / \ / /
- * | DDD EEE / /
+ * | / \ / /
+ * | DDD EEE / /
* | | +-/ /
- * | FFF /
- * | / \ /
- * | GGG HHH /
+ * | FFF /
+ * | / \ /
+ * | GGG HHH /
* | | +-/
* | III
- * +--+
+ * +--+
+ *
*
- *
* DFlocal(X) = { Y <- Succ(X) | idom(Y) != X }
* DFup(Z) = { Y <- DF(Z) | idom(Y) != X }
*
@@ -117,7 +117,7 @@
* DDD EEE DDD: [ ] ( BBB ) EEE: [ JJJ ] ()
* |
* FFF FFF: [ ] ( BBB )
- * / \
+ * / \
* GGG HHH GGG: [ ] ( BBB ) HHH: [ BBB ] ()
* |
* III III: [ BBB ] ()
@@ -125,7 +125,7 @@
*
* BBB and JJJ are definitely the dominance frontier.
* Where do I place phi functions and how do I make that decision.
- *
+ *
*/
struct filelist {
@@ -231,7 +231,7 @@ static char *slurp_file(const char *dirname, const char *filename, off_t *r_size
off_t size, progress;
ssize_t result;
FILE* file;
-
+
if (!filename) {
*r_size = 0;
return 0;
@@ -406,14 +406,14 @@ struct token {
#define OP_SUB 9
#define OP_SL 10
#define OP_USR 11
-#define OP_SSR 12
-#define OP_AND 13
+#define OP_SSR 12
+#define OP_AND 13
#define OP_XOR 14
#define OP_OR 15
#define OP_POS 16 /* Dummy positive operator don't use it */
#define OP_NEG 17
#define OP_INVERT 18
-
+
#define OP_EQ 20
#define OP_NOTEQ 21
#define OP_SLESS 22
@@ -424,7 +424,7 @@ struct token {
#define OP_ULESSEQ 27
#define OP_SMOREEQ 28
#define OP_UMOREEQ 29
-
+
#define OP_LFALSE 30 /* Test if the expression is logically false */
#define OP_LTRUE 31 /* Test if the expression is logcially true */
@@ -483,7 +483,7 @@ struct token {
* assigned yet, or variables whose value we simply do not know.
*/
-#define OP_WRITE 60
+#define OP_WRITE 60
/* OP_WRITE moves one pseudo register to another.
* MISC(0) holds the destination pseudo register, which must be an OP_DECL.
* RHS(0) holds the psuedo to move.
@@ -552,10 +552,10 @@ struct token {
* The value represented by an OP_TUPLE is held in N registers.
* LHS(0..N-1) refer to those registers.
* ->use is a list of statements that use the value.
- *
+ *
* Although OP_TUPLE always has register sized pieces they are not
* used until structures are flattened/decomposed into their register
- * components.
+ * components.
* ???? registers ????
*/
@@ -569,10 +569,10 @@ struct token {
#define OP_FCALL 72
-/* OP_FCALL performs a procedure call.
+/* OP_FCALL performs a procedure call.
* MISC(0) holds a pointer to the OP_LIST of a function
* RHS(x) holds argument x of a function
- *
+ *
* Currently not seen outside of expressions.
*/
#define OP_PROG 73
@@ -622,16 +622,16 @@ struct token {
* ->use is the list of all branches that use this label.
*/
-#define OP_ADECL 87
+#define OP_ADECL 87
/* OP_ADECL is a triple that establishes an lvalue for assignments.
* A variable takes N registers to contain.
* LHS(0..N-1) refer to an OP_PIECE triple that represents
* the Xth register that the variable is stored in.
* ->use is a list of statements that use the variable.
- *
+ *
* Although OP_ADECL always has register sized pieces they are not
* used until structures are flattened/decomposed into their register
- * components.
+ * components.
*/
#define OP_SDECL 88
@@ -643,12 +643,12 @@ struct token {
#define OP_PHI 89
-/* OP_PHI is a triple used in SSA form code.
+/* OP_PHI is a triple used in SSA form code.
* It is used when multiple code paths merge and a variable needs
* a single assignment from any of those code paths.
* The operation is a cross between OP_DECL and OP_WRITE, which
* is what OP_PHI is generated from.
- *
+ *
* RHS(x) points to the value from code path x
* The number of RHS entries is the number of control paths into the block
* in which OP_PHI resides. The elements of the array point to point
@@ -661,12 +661,12 @@ struct token {
/* continuation helpers
*/
#define OP_CPS_BRANCH 90 /* an unconditional branch */
-/* OP_CPS_BRANCH calls a continuation
+/* OP_CPS_BRANCH calls a continuation
* RHS(x) holds argument x of the function
* TARG(0) holds OP_CPS_START target
*/
#define OP_CPS_CBRANCH 91 /* a conditional branch */
-/* OP_CPS_CBRANCH conditionally calls one of two continuations
+/* OP_CPS_CBRANCH conditionally calls one of two continuations
* RHS(0) holds the branch condition
* RHS(x + 1) holds argument x of the function
* TARG(0) holds the OP_CPS_START to jump to when true
@@ -680,7 +680,7 @@ struct token {
* ->next holds where the OP_CPS_RET will return to.
*/
#define OP_CPS_RET 93
-/* OP_CPS_RET conditionally calls one of two continuations
+/* OP_CPS_RET conditionally calls one of two continuations
* RHS(0) holds the variable with the return function address
* RHS(x + 1) holds argument x of the function
* The branch target may be any OP_CPS_START
@@ -821,7 +821,7 @@ static const struct op_info table_ops[] = {
[OP_CONVERT ] = OP( 0, 1, 0, 0, PURE | DEF | BLOCK, "convert"),
[OP_PIECE ] = OP( 0, 0, 1, 0, PURE | DEF | STRUCTURAL | PART, "piece"),
[OP_ASM ] = OP(-1, -1, 0, 0, PURE, "asm"),
-[OP_DEREF ] = OP( 0, 1, 0, 0, 0 | DEF | BLOCK, "deref"),
+[OP_DEREF ] = OP( 0, 1, 0, 0, 0 | DEF | BLOCK, "deref"),
[OP_DOT ] = OP( 0, 0, 1, 0, PURE | DEF | PART, "dot"),
[OP_INDEX ] = OP( 0, 0, 1, 0, PURE | DEF | PART, "index"),
@@ -892,7 +892,7 @@ static const struct op_info table_ops[] = {
#undef OP
#define OP_MAX (sizeof(table_ops)/sizeof(table_ops[0]))
-static const char *tops(int index)
+static const char *tops(int index)
{
static const char unknown[] = "unknown op";
if (index < 0) {
@@ -1003,7 +1003,7 @@ struct block {
struct block_set *ipdomfrontier;
struct block *ipdom;
int vertex;
-
+
};
struct symbol {
@@ -1179,11 +1179,11 @@ struct compile_state {
* make up the union.
* type->elements hold the length of the linked list
*/
-#define TYPE_POINTER 0x1200
+#define TYPE_POINTER 0x1200
/* For TYPE_POINTER:
* type->left holds the type pointed to.
*/
-#define TYPE_FUNCTION 0x1300
+#define TYPE_FUNCTION 0x1300
/* For TYPE_FUNCTION:
* type->left holds the return type.
* type->right holds the type of the arguments
@@ -1205,7 +1205,7 @@ struct compile_state {
* type->elements holds the number of elements.
*/
#define TYPE_TUPLE 0x1900
-/* TYPE_TUPLE is a basic building block when defining
+/* TYPE_TUPLE is a basic building block when defining
* positionally reference type conglomerations. (i.e. closures)
* In essence it is a wrapper for TYPE_PRODUCT, like TYPE_STRUCT
* except it has no field names.
@@ -1214,7 +1214,7 @@ struct compile_state {
* type->elements hold the number of elements in the closure.
*/
#define TYPE_JOIN 0x1a00
-/* TYPE_JOIN is a basic building block when defining
+/* TYPE_JOIN is a basic building block when defining
* positionally reference type conglomerations. (i.e. closures)
* In essence it is a wrapper for TYPE_OVERLAP, like TYPE_UNION
* except it has no field names.
@@ -1307,9 +1307,9 @@ static struct reg_info arch_reg_constraint(
struct compile_state *state, struct type *type, const char *constraint);
static struct reg_info arch_reg_clobber(
struct compile_state *state, const char *clobber);
-static struct reg_info arch_reg_lhs(struct compile_state *state,
+static struct reg_info arch_reg_lhs(struct compile_state *state,
struct triple *ins, int index);
-static struct reg_info arch_reg_rhs(struct compile_state *state,
+static struct reg_info arch_reg_rhs(struct compile_state *state,
struct triple *ins, int index);
static int arch_reg_size(int reg);
static struct triple *transform_to_arch_instruction(
@@ -1490,9 +1490,9 @@ static int set_arg(
}
return result;
}
-
-static void flag_usage(FILE *fp, const struct compiler_flag *ptr,
+
+static void flag_usage(FILE *fp, const struct compiler_flag *ptr,
const char *prefix, const char *invert_prefix)
{
for(;ptr->name; ptr++) {
@@ -1509,7 +1509,7 @@ static void arg_usage(FILE *fp, const struct compiler_arg *ptr,
for(;ptr->name; ptr++) {
const struct compiler_flag *flag;
for(flag = &ptr->flags[0]; flag->name; flag++) {
- fprintf(fp, "%s%s=%s\n",
+ fprintf(fp, "%s%s=%s\n",
prefix, ptr->name, flag->name);
}
}
@@ -1522,7 +1522,7 @@ static int append_string(size_t *max, const char ***vec, const char *str,
count = ++(*max);
*vec = xrealloc(*vec, sizeof(char *)*count, "name");
(*vec)[count -1] = 0;
- (*vec)[count -2] = str;
+ (*vec)[count -2] = str;
return 0;
}
@@ -1553,7 +1553,7 @@ static int append_define(struct compiler_state *compiler, const char *str)
rest = identifier(str, end);
if (rest != end) {
int len = end - str - 1;
- arg_error("Invalid name cannot define macro: `%*.*s'\n",
+ arg_error("Invalid name cannot define macro: `%*.*s'\n",
len, len, str);
}
result = append_string(&compiler->define_count,
@@ -1570,7 +1570,7 @@ static int append_undef(struct compiler_state *compiler, const char *str)
rest = identifier(str, end);
if (rest != end) {
int len = end - str - 1;
- arg_error("Invalid name cannot undefine macro: `%*.*s'\n",
+ arg_error("Invalid name cannot undefine macro: `%*.*s'\n",
len, len, str);
}
result = append_string(&compiler->undef_count,
@@ -1742,7 +1742,7 @@ static int get_col(struct file_state *file)
for(col = 0; ptr < end; ptr++) {
if (*ptr != '\t') {
col++;
- }
+ }
else {
col = (col & ~7) + 8;
}
@@ -1756,7 +1756,7 @@ static void loc(FILE *fp, struct compile_state *state, struct triple *triple)
if (triple && triple->occurance) {
struct occurance *spot;
for(spot = triple->occurance; spot; spot = spot->parent) {
- fprintf(fp, "%s:%d.%d: ",
+ fprintf(fp, "%s:%d.%d: ",
spot->filename, spot->line, spot->col);
}
return;
@@ -1765,11 +1765,11 @@ static void loc(FILE *fp, struct compile_state *state, struct triple *triple)
return;
}
col = get_col(state->file);
- fprintf(fp, "%s:%d.%d: ",
+ fprintf(fp, "%s:%d.%d: ",
state->file->report_name, state->file->report_line, col);
}
-static void __attribute__ ((noreturn)) internal_error(struct compile_state *state, struct triple *ptr,
+static void __attribute__ ((noreturn)) internal_error(struct compile_state *state, struct triple *ptr,
const char *fmt, ...)
{
FILE *fp = state->errout;
@@ -1789,7 +1789,7 @@ static void __attribute__ ((noreturn)) internal_error(struct compile_state *stat
}
-static void internal_warning(struct compile_state *state, struct triple *ptr,
+static void internal_warning(struct compile_state *state, struct triple *ptr,
const char *fmt, ...)
{
FILE *fp = state->errout;
@@ -1807,7 +1807,7 @@ static void internal_warning(struct compile_state *state, struct triple *ptr,
-static void __attribute__ ((noreturn)) error(struct compile_state *state, struct triple *ptr,
+static void __attribute__ ((noreturn)) error(struct compile_state *state, struct triple *ptr,
const char *fmt, ...)
{
FILE *fp = state->errout;
@@ -1828,14 +1828,14 @@ static void __attribute__ ((noreturn)) error(struct compile_state *state, struct
exit(1);
}
-static void warning(struct compile_state *state, struct triple *ptr,
+static void warning(struct compile_state *state, struct triple *ptr,
const char *fmt, ...)
{
FILE *fp = state->errout;
va_list args;
va_start(args, fmt);
loc(fp, state, ptr);
- fprintf(fp, "warning: ");
+ fprintf(fp, "warning: ");
if (ptr && (state->compiler->debug & DEBUG_ABORT_ON_ERROR)) {
fprintf(fp, "%p %-10s ", ptr, tops(ptr->op));
}
@@ -1903,7 +1903,7 @@ static void use_triple(struct triple *used, struct triple *user)
}
ptr = &(*ptr)->next;
}
- /* Append new to the head of the list,
+ /* Append new to the head of the list,
* copy_func and rename_block_variables
* depends on this.
*/
@@ -1978,7 +1978,7 @@ static struct occurance *new_occurance(struct compile_state *state)
(last->line == line) &&
(last->function == function) &&
((last->filename == filename) ||
- (strcmp(last->filename, filename) == 0)))
+ (strcmp(last->filename, filename) == 0)))
{
get_occurance(last);
return last;
@@ -2074,7 +2074,7 @@ static struct triple unknown_triple = {
static size_t registers_of(struct compile_state *state, struct type *type);
-static struct triple *alloc_triple(struct compile_state *state,
+static struct triple *alloc_triple(struct compile_state *state,
int op, struct type *type, int lhs_wanted, int rhs_wanted,
struct occurance *occurance)
{
@@ -2174,7 +2174,7 @@ static struct triple *copy_triple(struct compile_state *state, struct triple *sr
return copy;
}
-static struct triple *new_triple(struct compile_state *state,
+static struct triple *new_triple(struct compile_state *state,
int op, struct type *type, int lhs, int rhs)
{
struct triple *ret;
@@ -2184,7 +2184,7 @@ static struct triple *new_triple(struct compile_state *state,
return ret;
}
-static struct triple *build_triple(struct compile_state *state,
+static struct triple *build_triple(struct compile_state *state,
int op, struct type *type, struct triple *left, struct triple *right,
struct occurance *occurance)
{
@@ -2201,7 +2201,7 @@ static struct triple *build_triple(struct compile_state *state,
return ret;
}
-static struct triple *triple(struct compile_state *state,
+static struct triple *triple(struct compile_state *state,
int op, struct type *type, struct triple *left, struct triple *right)
{
struct triple *ret;
@@ -2217,7 +2217,7 @@ static struct triple *triple(struct compile_state *state,
return ret;
}
-static struct triple *branch(struct compile_state *state,
+static struct triple *branch(struct compile_state *state,
struct triple *targ, struct triple *test)
{
struct triple *ret;
@@ -2260,7 +2260,7 @@ static void insert_triple(struct compile_state *state,
static int triple_stores_block(struct compile_state *state, struct triple *ins)
{
- /* This function is used to determine if u.block
+ /* This function is used to determine if u.block
* is utilized to store the current block number.
*/
int stores_block;
@@ -2270,7 +2270,7 @@ static int triple_stores_block(struct compile_state *state, struct triple *ins)
}
static int triple_is_branch(struct compile_state *state, struct triple *ins);
-static struct block *block_of_triple(struct compile_state *state,
+static struct block *block_of_triple(struct compile_state *state,
struct triple *ins)
{
struct triple *first;
@@ -2279,8 +2279,8 @@ static struct block *block_of_triple(struct compile_state *state,
}
first = state->first;
while(ins != first && !triple_is_branch(state, ins->prev) &&
- !triple_stores_block(state, ins))
- {
+ !triple_stores_block(state, ins))
+ {
if (ins == ins->prev) {
internal_error(state, ins, "ins == ins->prev?");
}
@@ -2456,30 +2456,30 @@ static void display_triple(FILE *fp, struct triple *ins)
}
else if (ins->op == OP_INTCONST) {
fprintf(fp, "(%p) %c%c%c %-7s %-2d %-10s <0x%08lx> ",
- ins, pre, post, vol, reg, ins->template_id, tops(ins->op),
+ ins, pre, post, vol, reg, ins->template_id, tops(ins->op),
(unsigned long)(ins->u.cval));
}
else if (ins->op == OP_ADDRCONST) {
fprintf(fp, "(%p) %c%c%c %-7s %-2d %-10s %-10p <0x%08lx>",
- ins, pre, post, vol, reg, ins->template_id, tops(ins->op),
+ ins, pre, post, vol, reg, ins->template_id, tops(ins->op),
MISC(ins, 0), (unsigned long)(ins->u.cval));
}
else if (ins->op == OP_INDEX) {
fprintf(fp, "(%p) %c%c%c %-7s %-2d %-10s %-10p <0x%08lx>",
- ins, pre, post, vol, reg, ins->template_id, tops(ins->op),
+ ins, pre, post, vol, reg, ins->template_id, tops(ins->op),
RHS(ins, 0), (unsigned long)(ins->u.cval));
}
else if (ins->op == OP_PIECE) {
fprintf(fp, "(%p) %c%c%c %-7s %-2d %-10s %-10p <0x%08lx>",
- ins, pre, post, vol, reg, ins->template_id, tops(ins->op),
+ ins, pre, post, vol, reg, ins->template_id, tops(ins->op),
MISC(ins, 0), (unsigned long)(ins->u.cval));
}
else {
int i, count;
- fprintf(fp, "(%p) %c%c%c %-7s %-2d %-10s",
+ fprintf(fp, "(%p) %c%c%c %-7s %-2d %-10s",
ins, pre, post, vol, reg, ins->template_id, tops(ins->op));
if (table_ops[ins->op].flags & BITFIELD) {
- fprintf(fp, " <%2d-%2d:%2d>",
+ fprintf(fp, " <%2d-%2d:%2d>",
ins->u.bitfield.offset,
ins->u.bitfield.offset + ins->u.bitfield.size,
ins->u.bitfield.size);
@@ -2509,9 +2509,9 @@ static void display_triple(FILE *fp, struct triple *ins)
fprintf(fp, " @");
for(ptr = ins->occurance; ptr; ptr = ptr->parent) {
fprintf(fp, " %s,%s:%d.%d",
- ptr->function,
+ ptr->function,
ptr->filename,
- ptr->line,
+ ptr->line,
ptr->col);
}
if (ins->op == OP_ASM) {
@@ -2532,9 +2532,9 @@ static void display_triple_changes(
orig_count = TRIPLE_SIZE(orig);
if ((new->op != orig->op) ||
(new_count != orig_count) ||
- (memcmp(orig->param, new->param,
+ (memcmp(orig->param, new->param,
orig_count * sizeof(orig->param[0])) != 0) ||
- (memcmp(&orig->u, &new->u, sizeof(orig->u)) != 0))
+ (memcmp(&orig->u, &new->u, sizeof(orig->u)) != 0))
{
struct occurance *ptr;
int i, min_count, indent;
@@ -2542,7 +2542,7 @@ static void display_triple_changes(
if (orig->op == new->op) {
fprintf(fp, " %-11s", tops(orig->op));
} else {
- fprintf(fp, " [%-10s %-10s]",
+ fprintf(fp, " [%-10s %-10s]",
tops(new->op), tops(orig->op));
}
min_count = new_count;
@@ -2551,12 +2551,12 @@ static void display_triple_changes(
}
for(indent = i = 0; i < min_count; i++) {
if (orig->param[i] == new->param[i]) {
- fprintf(fp, " %-11p",
+ fprintf(fp, " %-11p",
orig->param[i]);
indent += 12;
} else {
fprintf(fp, " [%-10p %-10p]",
- new->param[i],
+ new->param[i],
orig->param[i]);
indent += 24;
}
@@ -2571,7 +2571,7 @@ static void display_triple_changes(
}
if ((new->op == OP_INTCONST)||
(new->op == OP_ADDRCONST)) {
- fprintf(fp, " <0x%08lx>",
+ fprintf(fp, " <0x%08lx>",
(unsigned long)(new->u.cval));
indent += 13;
}
@@ -2592,11 +2592,11 @@ static void display_triple_changes(
fprintf(fp, " @");
for(ptr = orig->occurance; ptr; ptr = ptr->parent) {
fprintf(fp, " %s,%s:%d.%d",
- ptr->function,
+ ptr->function,
ptr->filename,
- ptr->line,
+ ptr->line,
ptr->col);
-
+
}
fprintf(fp, "\n");
fflush(fp);
@@ -2606,7 +2606,7 @@ static void display_triple_changes(
static int triple_is_pure(struct compile_state *state, struct triple *ins, unsigned id)
{
/* Does the triple have no side effects.
- * I.e. Rexecuting the triple with the same arguments
+ * I.e. Rexecuting the triple with the same arguments
* gives the same value.
*/
unsigned pure;
@@ -2619,7 +2619,7 @@ static int triple_is_pure(struct compile_state *state, struct triple *ins, unsig
return (pure == PURE) && !(id & TRIPLE_FLAG_VOLATILE);
}
-static int triple_is_branch_type(struct compile_state *state,
+static int triple_is_branch_type(struct compile_state *state,
struct triple *ins, unsigned type)
{
/* Is this one of the passed branch types? */
@@ -2660,7 +2660,7 @@ static int triple_is_ret(struct compile_state *state, struct triple *ins)
/* Is this triple a return instruction? */
return triple_is_branch_type(state, ins, RETBRANCH);
}
-
+
#if DEBUG_ROMCC_WARNING
static int triple_is_simple_ubranch(struct compile_state *state, struct triple *ins)
{
@@ -2741,27 +2741,27 @@ static struct triple **triple_iter(struct compile_state *state,
}
}
return ret;
-
+
}
static struct triple **triple_lhs(struct compile_state *state,
struct triple *ins, struct triple **last)
{
- return triple_iter(state, ins->lhs, &LHS(ins,0),
+ return triple_iter(state, ins->lhs, &LHS(ins,0),
ins, last);
}
static struct triple **triple_rhs(struct compile_state *state,
struct triple *ins, struct triple **last)
{
- return triple_iter(state, ins->rhs, &RHS(ins,0),
+ return triple_iter(state, ins->rhs, &RHS(ins,0),
ins, last);
}
static struct triple **triple_misc(struct compile_state *state,
struct triple *ins, struct triple **last)
{
- return triple_iter(state, ins->misc, &MISC(ins,0),
+ return triple_iter(state, ins->misc, &MISC(ins,0),
ins, last);
}
@@ -2829,7 +2829,7 @@ static struct triple **triple_targ(struct compile_state *state,
static struct triple **triple_edge_targ(struct compile_state *state,
struct triple *ins, struct triple **last)
{
- return do_triple_targ(state, ins, last,
+ return do_triple_targ(state, ins, last,
state->functions_joined, !state->functions_joined);
}
@@ -2860,7 +2860,7 @@ static struct triple *after_lhs(struct compile_state *state, struct triple *ins)
}
/* Function piece accessor functions */
-static struct triple *do_farg(struct compile_state *state,
+static struct triple *do_farg(struct compile_state *state,
struct triple *func, unsigned index)
{
struct type *ftype;
@@ -2889,7 +2889,7 @@ static struct triple *fretaddr(struct compile_state *state, struct triple *func)
{
return do_farg(state, func, 1);
}
-static struct triple *farg(struct compile_state *state,
+static struct triple *farg(struct compile_state *state,
struct triple *func, unsigned index)
{
return do_farg(state, func, index + 2);
@@ -2938,7 +2938,7 @@ static void verify_use(struct compile_state *state,
}
}
-static int find_rhs_use(struct compile_state *state,
+static int find_rhs_use(struct compile_state *state,
struct triple *user, struct triple *used)
{
struct triple **param;
@@ -3171,7 +3171,7 @@ static void print_blocks(struct compile_state *state, const char *func, FILE *fp
#define TOK_FIRST_MACRO TOK_MDEFINE
#define TOK_LAST_MACRO TOK_MENDIF
-
+
#define TOK_MIF 112
#define TOK_MELSE 113
#define TOK_MIDENT 114
@@ -3291,7 +3291,7 @@ static const char *tokens[] = {
[TOK_MIF ] = "#if",
[TOK_MELSE ] = "#else",
[TOK_MIDENT ] = "#:ident:",
-[TOK_EOL ] = "EOL",
+[TOK_EOL ] = "EOL",
[TOK_EOF ] = "EOF",
};
@@ -3315,7 +3315,7 @@ static struct hash_entry *lookup(
unsigned int index;
index = hash(name, name_len);
entry = state->hash_table[index];
- while(entry &&
+ while(entry &&
((entry->name_len != name_len) ||
(memcmp(entry->name, name, name_len) != 0))) {
entry = entry->next;
@@ -3345,7 +3345,7 @@ static void ident_to_keyword(struct compile_state *state, struct token *tk)
entry = tk->ident;
if (entry && ((entry->tok == TOK_TYPE_NAME) ||
(entry->tok == TOK_ENUM_CONST) ||
- ((entry->tok >= TOK_FIRST_KEYWORD) &&
+ ((entry->tok >= TOK_FIRST_KEYWORD) &&
(entry->tok <= TOK_LAST_KEYWORD)))) {
tk->tok = entry->tok;
}
@@ -3406,7 +3406,7 @@ static void symbol(
romcc_symbol(state, ident, chain, def, type, state->scope_depth);
}
-static void var_symbol(struct compile_state *state,
+static void var_symbol(struct compile_state *state,
struct hash_entry *ident, struct triple *def)
{
if ((def->type->type & TYPE_MASK) == TYPE_PRODUCT) {
@@ -3415,7 +3415,7 @@ static void var_symbol(struct compile_state *state,
symbol(state, ident, &ident->sym_ident, def, def->type);
}
-static void label_symbol(struct compile_state *state,
+static void label_symbol(struct compile_state *state,
struct hash_entry *ident, struct triple *label, int depth)
{
romcc_symbol(state, ident, &ident->sym_label, label, &void_type, depth);
@@ -3444,7 +3444,7 @@ static void end_scope(struct compile_state *state)
int i;
int depth;
/* Walk through the hash table and remove all symbols
- * in the current scope.
+ * in the current scope.
*/
depth = state->scope_depth;
for(i = 0; i < HASH_TABLE_SIZE; i++) {
@@ -3527,7 +3527,7 @@ static void undef_macro(struct compile_state *state, struct hash_entry *ident)
struct macro_arg *arg, *anext;
macro = ident->sym_define;
ident->sym_define = 0;
-
+
/* Free the macro arguments... */
anext = macro->args;
while(anext) {
@@ -3544,8 +3544,8 @@ static void undef_macro(struct compile_state *state, struct hash_entry *ident)
}
}
-static void do_define_macro(struct compile_state *state,
- struct hash_entry *ident, const char *body,
+static void do_define_macro(struct compile_state *state,
+ struct hash_entry *ident, const char *body,
int argc, struct macro_arg *args)
{
struct macro *macro;
@@ -3559,7 +3559,7 @@ static void do_define_macro(struct compile_state *state,
int identical_bodies, identical_args;
struct macro_arg *oarg;
/* Explicitly allow identical redfinitions of the same macro */
- identical_bodies =
+ identical_bodies =
(macro->buf_len == body_len) &&
(memcmp(macro->buf, body, body_len) == 0);
identical_args = macro->argc == argc;
@@ -3589,7 +3589,7 @@ static void do_define_macro(struct compile_state *state,
ident->sym_define = macro;
}
-
+
static void define_macro(
struct compile_state *state,
struct hash_entry *ident,
@@ -3641,7 +3641,7 @@ static void register_builtin_macros(struct compile_state *state)
register_builtin_macro(state, "__STDC__", "0");
/* In particular I don't conform to C99 */
register_builtin_macro(state, "__STDC_VERSION__", "199901L");
-
+
}
static void process_cmdline_macros(struct compile_state *state)
@@ -3688,7 +3688,7 @@ static int digitp(int c)
{
int ret = 0;
switch(c) {
- case '0': case '1': case '2': case '3': case '4':
+ case '0': case '1': case '2': case '3': case '4':
case '5': case '6': case '7': case '8': case '9':
ret = 1;
break;
@@ -3708,7 +3708,7 @@ static int hexdigitp(int c)
{
int ret = 0;
switch(c) {
- case '0': case '1': case '2': case '3': case '4':
+ case '0': case '1': case '2': case '3': case '4':
case '5': case '6': case '7': case '8': case '9':
case 'A': case 'B': case 'C': case 'D': case 'E': case 'F':
case 'a': case 'b': case 'c': case 'd': case 'e': case 'f':
@@ -3717,7 +3717,7 @@ static int hexdigitp(int c)
}
return ret;
}
-static int hexdigval(int c)
+static int hexdigval(int c)
{
int val = -1;
if ((c >= '0') && (c <= '9')) {
@@ -3736,7 +3736,7 @@ static int octdigitp(int c)
{
int ret = 0;
switch(c) {
- case '0': case '1': case '2': case '3':
+ case '0': case '1': case '2': case '3':
case '4': case '5': case '6': case '7':
ret = 1;
break;
@@ -3809,7 +3809,7 @@ static int char_value(struct compile_state *state,
case '?': c = '?'; str++; break;
case '\'': c = '\''; str++; break;
case '"': c = '"'; str++; break;
- case 'x':
+ case 'x':
c = 0;
str++;
while((str < end) && hexdigitp(*str)) {
@@ -3818,7 +3818,7 @@ static int char_value(struct compile_state *state,
str++;
}
break;
- case '0': case '1': case '2': case '3':
+ case '0': case '1': case '2': case '3':
case '4': case '5': case '6': case '7':
c = 0;
while((str < end) && octdigitp(*str)) {
@@ -3845,7 +3845,7 @@ static const char *next_char(struct file_state *file, const char *pos, int index
int c = *pos;
/* Is this a trigraph? */
if (file->trigraphs &&
- (c == '?') && ((end - pos) >= 3) && (pos[1] == '?'))
+ (c == '?') && ((end - pos) >= 3) && (pos[1] == '?'))
{
switch(pos[2]) {
case '=': c = '#'; break;
@@ -3899,7 +3899,7 @@ static int get_char(struct file_state *file, const char *pos)
c = *pos;
/* If it is a trigraph get the trigraph value */
if (file->trigraphs &&
- (c == '?') && ((end - pos) >= 3) && (pos[1] == '?'))
+ (c == '?') && ((end - pos) >= 3) && (pos[1] == '?'))
{
switch(pos[2]) {
case '=': c = '#'; break;
@@ -3944,7 +3944,7 @@ static size_t char_strlen(struct file_state *file, const char *src, const char *
return len;
}
-static void char_strcpy(char *dest,
+static void char_strcpy(char *dest,
struct file_state *file, const char *src, const char *end)
{
while(src < end) {
@@ -3955,7 +3955,7 @@ static void char_strcpy(char *dest,
}
}
-static char *char_strdup(struct file_state *file,
+static char *char_strdup(struct file_state *file,
const char *start, const char *end, const char *id)
{
char *str;
@@ -4015,7 +4015,7 @@ static void save_string(struct file_state *file,
tk->str_len = strlen(str);
}
-static void raw_next_token(struct compile_state *state,
+static void raw_next_token(struct compile_state *state,
struct file_state *file, struct token *tk)
{
const char *token;
@@ -4052,7 +4052,7 @@ static void raw_next_token(struct compile_state *state,
tokp = next_char(file, tokp, 1);
while((c = get_char(file, tokp)) != -1) {
/* Advance to the next character only after we verify
- * the current character is not a newline.
+ * the current character is not a newline.
* EOL is special to the preprocessor so we don't
* want to loose any.
*/
@@ -4144,12 +4144,12 @@ static void raw_next_token(struct compile_state *state,
/* Save the character value */
save_string(file, tk, token, tokp, "literal character");
}
- /* integer and floating constants
+ /* integer and floating constants
* Integer Constants
* {digits}
* 0[Xx]{hexdigits}
* 0{octdigit}+
- *
+ *
* Floating constants
* {digits}.{digits}[Ee][+-]?{digits}
* {digits}.{digits}
@@ -4259,9 +4259,9 @@ static void raw_next_token(struct compile_state *state,
}
}
/* C99 alternate macro characters */
- else if ((c == '%') && (c1 == ':') && (c2 == '%') && (c3 == ':')) {
+ else if ((c == '%') && (c1 == ':') && (c2 == '%') && (c3 == ':')) {
eat += 3;
- tok = TOK_CONCATENATE;
+ tok = TOK_CONCATENATE;
}
else if ((c == '.') && (c1 == '.') && (c2 == '.')) { eat += 2; tok = TOK_DOTS; }
else if ((c == '<') && (c1 == '<') && (c2 == '=')) { eat += 2; tok = TOK_SLEQ; }
@@ -4344,7 +4344,7 @@ struct macro_arg_value {
size_t len;
};
static struct macro_arg_value *read_macro_args(
- struct compile_state *state, struct macro *macro,
+ struct compile_state *state, struct macro *macro,
struct file_state *file, struct token *tk)
{
struct macro_arg_value *argv;
@@ -4366,15 +4366,15 @@ static struct macro_arg_value *read_macro_args(
}
paren_depth = 0;
i = 0;
-
+
for(;;) {
const char *start;
size_t len;
start = file->pos;
raw_next_token(state, file, tk);
-
+
if (!paren_depth && (tk->tok == TOK_COMMA) &&
- (argv[i].ident != state->i___VA_ARGS__))
+ (argv[i].ident != state->i___VA_ARGS__))
{
i++;
if (i >= macro->argc) {
@@ -4383,11 +4383,11 @@ static struct macro_arg_value *read_macro_args(
}
continue;
}
-
+
if (tk->tok == TOK_LPAREN) {
paren_depth++;
}
-
+
if (tk->tok == TOK_RPAREN) {
if (paren_depth == 0) {
break;
@@ -4405,7 +4405,7 @@ static struct macro_arg_value *read_macro_args(
argv[i].len += len;
}
if (i != macro->argc -1) {
- error(state, 0, "missing %s arg %d\n",
+ error(state, 0, "missing %s arg %d\n",
macro->ident->name, i +2);
}
return argv;
@@ -4467,14 +4467,14 @@ static void append_macro_chars(struct compile_state *state,
buf->pos += flen;
}
-static int compile_macro(struct compile_state *state,
+static int compile_macro(struct compile_state *state,
struct file_state **filep, struct token *tk);
-static void macro_expand_args(struct compile_state *state,
+static void macro_expand_args(struct compile_state *state,
struct macro *macro, struct macro_arg_value *argv, struct token *tk)
{
int i;
-
+
for(i = 0; i < macro->argc; i++) {
struct file_state fmacro, *file;
struct macro_buf buf;
@@ -4501,7 +4501,7 @@ static void macro_expand_args(struct compile_state *state,
file = &fmacro;
for(;;) {
raw_next_token(state, file, tk);
-
+
/* If we have recursed into another macro body
* get out of it.
*/
@@ -4527,7 +4527,7 @@ static void macro_expand_args(struct compile_state *state,
append_macro_chars(state, macro->ident->name, &buf,
file, tk->pos, file->pos);
}
-
+
xfree(argv[i].value);
argv[i].value = buf.str;
argv[i].len = buf.pos;
@@ -4560,12 +4560,12 @@ static void expand_macro(struct compile_state *state,
fmacro.macro = 1;
fmacro.trigraphs = 0;
fmacro.join_lines = 0;
-
+
/* Allocate a buffer to hold the macro expansion */
buf->len = macro->buf_len + 3;
buf->str = xmalloc(buf->len, macro->ident->name);
buf->pos = 0;
-
+
fstart = fmacro.pos;
raw_next_token(state, &fmacro, tk);
while(tk->tok != TOK_EOF) {
@@ -4609,7 +4609,7 @@ static void expand_macro(struct compile_state *state,
if (*str == '\\') {
str = "\\";
len = 2;
- }
+ }
else if (*str == '"') {
str = "\\\"";
len = 2;
@@ -4651,7 +4651,7 @@ static void expand_macro(struct compile_state *state,
}
append_macro_text(state, macro->ident->name, buf, fstart, flen);
-
+
fstart = fmacro.pos;
raw_next_token(state, &fmacro, tk);
}
@@ -4683,19 +4683,19 @@ static void tag_macro_name(struct compile_state *state,
fmacro.macro = 1;
fmacro.trigraphs = 0;
fmacro.join_lines = 0;
-
+
/* Allocate a new macro expansion buffer */
buf->len = macro->buf_len + 3;
buf->str = xmalloc(buf->len, macro->ident->name);
buf->pos = 0;
-
+
fstart = fmacro.pos;
raw_next_token(state, &fmacro, tk);
while(tk->tok != TOK_EOF) {
flen = fmacro.pos - fstart;
if ((tk->tok == TOK_IDENT) &&
(tk->ident == macro->ident) &&
- (tk->val.notmacro == 0))
+ (tk->val.notmacro == 0))
{
append_macro_text(state, macro->ident->name, buf, fstart, flen);
fstart = "$";
@@ -4703,14 +4703,14 @@ static void tag_macro_name(struct compile_state *state,
}
append_macro_text(state, macro->ident->name, buf, fstart, flen);
-
+
fstart = fmacro.pos;
raw_next_token(state, &fmacro, tk);
}
xfree(fmacro.buf);
}
-static int compile_macro(struct compile_state *state,
+static int compile_macro(struct compile_state *state,
struct file_state **filep, struct token *tk)
{
struct file_state *file;
@@ -4817,7 +4817,7 @@ static int if_value(struct compile_state *state)
offset = state->if_depth % CHAR_BIT;
return !!(state->if_bytes[index] & (1 << (offset)));
}
-static void set_if_value(struct compile_state *state, int value)
+static void set_if_value(struct compile_state *state, int value)
{
int index, offset;
index = state->if_depth / CHAR_BIT;
@@ -4880,8 +4880,8 @@ static void raw_token(struct compile_state *state, struct token *tk)
rescan = 0;
file = state->file;
/* Exit out of an include directive or macro call */
- if ((tk->tok == TOK_EOF) &&
- (file != state->macro_file) && file->prev)
+ if ((tk->tok == TOK_EOF) &&
+ (file != state->macro_file) && file->prev)
{
state->file = file->prev;
/* file->basename is used keep it */
@@ -4948,8 +4948,8 @@ static void token(struct compile_state *state, struct token *tk)
pp_token(state, tk);
}
}
- /* Eat tokens disabled by the preprocessor
- * (Unless we are parsing a preprocessor directive
+ /* Eat tokens disabled by the preprocessor
+ * (Unless we are parsing a preprocessor directive
*/
else if (if_eat(state) && (state->token_base == 0)) {
pp_token(state, tk);
@@ -4983,7 +4983,7 @@ static struct token *do_eat_token(struct compile_state *state, int tok)
struct token *tk;
int i;
check_tok(state, get_token(state, 1), tok);
-
+
/* Free the old token value */
tk = get_token(state, 0);
if (tk->str_len) {
@@ -5161,7 +5161,7 @@ static void preprocess(struct compile_state *state, struct token *current_token)
*/
int old_token_base;
int tok;
-
+
state->macro_file = state->file;
old_token_base = state->token_base;
@@ -5245,7 +5245,7 @@ static void preprocess(struct compile_state *state, struct token *current_token)
pp_eat(state, TOK_MUNDEF);
if (if_eat(state)) /* quit early when #if'd out */
break;
-
+
ident = pp_eat(state, TOK_MIDENT)->ident;
undef_macro(state, ident);
@@ -5255,7 +5255,7 @@ static void preprocess(struct compile_state *state, struct token *current_token)
pp_eat(state, TOK_MPRAGMA);
if (if_eat(state)) /* quit early when #if'd out */
break;
- warning(state, 0, "Ignoring pragma");
+ warning(state, 0, "Ignoring pragma");
break;
case TOK_MELIF:
pp_eat(state, TOK_MELIF);
@@ -5266,7 +5266,7 @@ static void preprocess(struct compile_state *state, struct token *current_token)
if (if_value(state)) {
eat_tokens(state, TOK_MENDIF);
}
- /* If the previous #if was not taken see if the #elif enables the
+ /* If the previous #if was not taken see if the #elif enables the
* trailing code.
*/
else {
@@ -5358,11 +5358,11 @@ static void preprocess(struct compile_state *state, struct token *current_token)
else if (tok == TOK_DOTS) {
pp_eat(state, TOK_DOTS);
aident = state->i___VA_ARGS__;
- }
+ }
else {
aident = pp_eat(state, TOK_MIDENT)->ident;
}
-
+
narg = xcmalloc(sizeof(*arg), "macro arg");
narg->ident = aident;
@@ -5404,7 +5404,7 @@ static void preprocess(struct compile_state *state, struct token *current_token)
mend = get_token(state, 1)->pos;
}
}
-
+
/* Now that I have found the body defined the token */
do_define_macro(state, ident,
char_strdup(state->file, mstart, mend, "macro buf"),
@@ -5415,7 +5415,7 @@ static void preprocess(struct compile_state *state, struct token *current_token)
{
const char *start, *end;
int len;
-
+
pp_eat(state, TOK_MERROR);
/* Find the start of the line */
raw_peek(state);
@@ -5436,13 +5436,13 @@ static void preprocess(struct compile_state *state, struct token *current_token)
{
const char *start, *end;
int len;
-
+
pp_eat(state, TOK_MWARNING);
/* Find the start of the line */
raw_peek(state);
start = get_token(state, 1)->pos;
-
+
/* Find the end of the line */
while((tok = raw_peek(state)) != TOK_EOL) {
raw_eat(state, tok);
@@ -5536,7 +5536,7 @@ static void preprocess(struct compile_state *state, struct token *current_token)
if (tok == TOK_MIDENT) {
name2 = get_token(state, 1)->ident->name;
}
- error(state, 0, "Invalid preprocessor directive: %s %s",
+ error(state, 0, "Invalid preprocessor directive: %s %s",
name1, name2);
break;
}
@@ -5621,7 +5621,7 @@ static struct type *invalid_type(struct compile_state *state, struct type *type)
case TYPE_STRUCT:
case TYPE_TUPLE:
member = type->left;
- while(member && (invalid == 0) &&
+ while(member && (invalid == 0) &&
((member->type & TYPE_MASK) == TYPE_PRODUCT)) {
invalid = invalid_type(state, member->left);
member = member->right;
@@ -5647,7 +5647,7 @@ static struct type *invalid_type(struct compile_state *state, struct type *type)
break;
}
return invalid;
-
+
}
#define MASK_UCHAR(X) ((X) & ((ulong_t)0xff))
@@ -5682,7 +5682,7 @@ static struct type void_ptr_type = {
};
#if DEBUG_ROMCC_WARNING
-static struct type void_func_type = {
+static struct type void_func_type = {
.type = TYPE_FUNCTION,
.left = &void_type,
.right = &void_type,
@@ -5815,19 +5815,19 @@ static void name_of(FILE *fp, struct type *type)
name_of(fp, type->right);
break;
case TYPE_ENUM:
- fprintf(fp, "enum %s",
+ fprintf(fp, "enum %s",
(type->type_ident)? type->type_ident->name : "");
qual_of(fp, type);
break;
case TYPE_STRUCT:
- fprintf(fp, "struct %s { ",
+ fprintf(fp, "struct %s { ",
(type->type_ident)? type->type_ident->name : "");
name_of(fp, type->left);
fprintf(fp, " } ");
qual_of(fp, type);
break;
case TYPE_UNION:
- fprintf(fp, "union %s { ",
+ fprintf(fp, "union %s { ",
(type->type_ident)? type->type_ident->name : "");
name_of(fp, type->left);
fprintf(fp, " } ");
@@ -5844,7 +5844,7 @@ static void name_of(FILE *fp, struct type *type)
fprintf(fp, " [%ld]", (long)(type->elements));
break;
case TYPE_TUPLE:
- fprintf(fp, "tuple { ");
+ fprintf(fp, "tuple { ");
name_of(fp, type->left);
fprintf(fp, " } ");
qual_of(fp, type);
@@ -5991,7 +5991,7 @@ static size_t align_of_in_bytes(struct compile_state *state, struct type *type)
static size_t size_of(struct compile_state *state, struct type *type);
static size_t reg_size_of(struct compile_state *state, struct type *type);
-static size_t needed_padding(struct compile_state *state,
+static size_t needed_padding(struct compile_state *state,
struct type *type, size_t offset)
{
size_t padding, align;
@@ -6013,7 +6013,7 @@ static size_t needed_padding(struct compile_state *state,
return padding;
}
-static size_t reg_needed_padding(struct compile_state *state,
+static size_t reg_needed_padding(struct compile_state *state,
struct type *type, size_t offset)
{
size_t padding, align;
@@ -6022,7 +6022,7 @@ static size_t reg_needed_padding(struct compile_state *state,
* fit into the current register.
*/
if (((type->type & TYPE_MASK) == TYPE_BITFIELD) &&
- (((offset + type->elements)/REG_SIZEOF_REG) != (offset/REG_SIZEOF_REG)))
+ (((offset + type->elements)/REG_SIZEOF_REG) != (offset/REG_SIZEOF_REG)))
{
align = REG_SIZEOF_REG;
}
@@ -6219,7 +6219,7 @@ static size_t size_of_in_bytes(struct compile_state *state, struct type *type)
return bits_to_bytes(size_of(state, type));
}
-static size_t field_offset(struct compile_state *state,
+static size_t field_offset(struct compile_state *state,
struct type *type, struct hash_entry *field)
{
struct type *member;
@@ -6260,7 +6260,7 @@ static size_t field_offset(struct compile_state *state,
return size;
}
-static size_t field_reg_offset(struct compile_state *state,
+static size_t field_reg_offset(struct compile_state *state,
struct type *type, struct hash_entry *field)
{
struct type *member;
@@ -6301,7 +6301,7 @@ static size_t field_reg_offset(struct compile_state *state,
return size;
}
-static struct type *field_type(struct compile_state *state,
+static struct type *field_type(struct compile_state *state,
struct type *type, struct hash_entry *field)
{
struct type *member;
@@ -6330,14 +6330,14 @@ static struct type *field_type(struct compile_state *state,
else {
internal_error(state, 0, "field_type only works on structures and unions");
}
-
+
if (!member || (member->field_ident != field)) {
error(state, 0, "member %s not present", field->name);
}
return member;
}
-static size_t index_offset(struct compile_state *state,
+static size_t index_offset(struct compile_state *state,
struct type *type, ulong_t index)
{
struct type *member;
@@ -6383,14 +6383,14 @@ static size_t index_offset(struct compile_state *state,
}
}
else {
- internal_error(state, 0,
+ internal_error(state, 0,
"request for index %u in something not an array, tuple or join",
index);
}
return size;
}
-static size_t index_reg_offset(struct compile_state *state,
+static size_t index_reg_offset(struct compile_state *state,
struct type *type, ulong_t index)
{
struct type *member;
@@ -6417,7 +6417,7 @@ static size_t index_reg_offset(struct compile_state *state,
if (i != index) {
internal_error(state, 0, "Missing member index: %u", index);
}
-
+
}
else if ((type->type & TYPE_MASK) == TYPE_JOIN) {
ulong_t i;
@@ -6437,7 +6437,7 @@ static size_t index_reg_offset(struct compile_state *state,
}
}
else {
- internal_error(state, 0,
+ internal_error(state, 0,
"request for index %u in something not an array, tuple or join",
index);
}
@@ -6488,7 +6488,7 @@ static struct type *index_type(struct compile_state *state,
}
else {
member = 0;
- internal_error(state, 0,
+ internal_error(state, 0,
"request for index %u in something not an array, tuple or join",
index);
}
@@ -6713,7 +6713,7 @@ static struct type *reg_type(
name_of(state->errout, type);
fprintf(state->errout, "\n");
internal_error(state, 0, "reg_type not yet defined for type");
-
+
}
}
/* If I have a single register compound type not a bit-field
@@ -6741,7 +6741,7 @@ static struct type *reg_type(
}
static struct type *next_field(struct compile_state *state,
- struct type *type, struct type *prev_member)
+ struct type *type, struct type *prev_member)
{
struct type *member;
if ((type->type & TYPE_MASK) != TYPE_STRUCT) {
@@ -6762,13 +6762,13 @@ static struct type *next_field(struct compile_state *state,
prev_member = 0;
}
if (prev_member) {
- internal_error(state, 0, "prev_member %s not present",
+ internal_error(state, 0, "prev_member %s not present",
prev_member->field_ident->name);
}
return member;
}
-typedef void (*walk_type_fields_cb_t)(struct compile_state *state, struct type *type,
+typedef void (*walk_type_fields_cb_t)(struct compile_state *state, struct type *type,
size_t ret_offset, size_t mem_offset, void *arg);
static void walk_type_fields(struct compile_state *state,
@@ -6791,15 +6791,15 @@ static void walk_struct_fields(struct compile_state *state,
if ((mtype->type & TYPE_MASK) == TYPE_PRODUCT) {
mtype = mtype->left;
}
- walk_type_fields(state, mtype,
- reg_offset +
+ walk_type_fields(state, mtype,
+ reg_offset +
field_reg_offset(state, type, mtype->field_ident),
- mem_offset +
+ mem_offset +
field_offset(state, type, mtype->field_ident),
cb, arg);
tptr = tptr->right;
}
-
+
}
static void walk_type_fields(struct compile_state *state,
@@ -7086,7 +7086,7 @@ static struct type *compatible_ptrs(struct type *left, struct type *right)
result = new_type(qual_type, result, 0);
}
return result;
-
+
}
static struct triple *integral_promotion(
struct compile_state *state, struct triple *def)
@@ -7106,7 +7106,7 @@ static struct triple *integral_promotion(
def->type = new_type(int_type, 0, 0);
}
else {
- def = triple(state, OP_CONVERT,
+ def = triple(state, OP_CONVERT,
new_type(int_type, 0, 0), def, 0);
}
}
@@ -7165,7 +7165,7 @@ static int is_compound_type(struct type *type)
case TYPE_STRUCT:
case TYPE_TUPLE:
case TYPE_UNION:
- case TYPE_JOIN:
+ case TYPE_JOIN:
is_compound = 1;
break;
default:
@@ -7205,8 +7205,8 @@ static int is_lvalue(struct compile_state *state, struct triple *def)
if (!def) {
return 0;
}
- if ((def->op == OP_ADECL) ||
- (def->op == OP_SDECL) ||
+ if ((def->op == OP_ADECL) ||
+ (def->op == OP_SDECL) ||
(def->op == OP_DEREF) ||
(def->op == OP_BLOBCONST) ||
(def->op == OP_LIST)) {
@@ -7223,7 +7223,7 @@ static void clvalue(struct compile_state *state, struct triple *def)
if (!def) {
internal_error(state, def, "nothing where lvalue expected?");
}
- if (!is_lvalue(state, def)) {
+ if (!is_lvalue(state, def)) {
error(state, def, "lvalue expected");
}
}
@@ -7267,7 +7267,7 @@ static struct triple *int_const(
static struct triple *read_expr(struct compile_state *state, struct triple *def);
-static struct triple *do_mk_addr_expr(struct compile_state *state,
+static struct triple *do_mk_addr_expr(struct compile_state *state,
struct triple *expr, struct type *type, ulong_t offset)
{
struct triple *result;
@@ -7276,7 +7276,7 @@ static struct triple *do_mk_addr_expr(struct compile_state *state,
ptr_type = new_type(TYPE_POINTER | (type->type & QUAL_MASK), type, 0);
-
+
result = 0;
if (expr->op == OP_ADECL) {
error(state, expr, "address of auto variables not supported");
@@ -7452,7 +7452,7 @@ static struct triple *read_expr(struct compile_state *state, struct triple *def)
return def;
}
-int is_write_compatible(struct compile_state *state,
+int is_write_compatible(struct compile_state *state,
struct type *dest, struct type *rval)
{
int compatible = 0;
@@ -7604,7 +7604,7 @@ struct type *ptr_arithmetic_result(
/* Sanity checks to ensure I am working with the proper types */
ptr_arithmetic(state, left);
arithmetic(state, right);
- if (TYPE_ARITHMETIC(left->type->type) &&
+ if (TYPE_ARITHMETIC(left->type->type) &&
TYPE_ARITHMETIC(right->type->type)) {
type = arithmetic_result(state, left, right);
}
@@ -7620,7 +7620,7 @@ struct type *ptr_arithmetic_result(
/* boolean helper function */
-static struct triple *ltrue_expr(struct compile_state *state,
+static struct triple *ltrue_expr(struct compile_state *state,
struct triple *expr)
{
switch(expr->op) {
@@ -7636,7 +7636,7 @@ static struct triple *ltrue_expr(struct compile_state *state,
return expr;
}
-static struct triple *lfalse_expr(struct compile_state *state,
+static struct triple *lfalse_expr(struct compile_state *state,
struct triple *expr)
{
return triple(state, OP_LFALSE, &int_type, expr, 0);
@@ -7652,15 +7652,15 @@ static struct triple *mkland_expr(
/* Generate some intermediate triples */
end = label(state);
var = variable(state, &int_type);
-
+
/* Store the left hand side value */
lstore = write_expr(state, var, left);
/* Jump if the value is false */
- jmp = branch(state, end,
+ jmp = branch(state, end,
lfalse_expr(state, read_expr(state, var)));
mid = label(state);
-
+
/* Store the right hand side value */
rstore = write_expr(state, var, right);
@@ -7669,7 +7669,7 @@ static struct triple *mkland_expr(
/* Generate the prog for a logical and */
def = mkprog(state, var, lstore, jmp, mid, rstore, end, val, 0UL);
-
+
return def;
}
@@ -7682,17 +7682,17 @@ static struct triple *mklor_expr(
/* Generate some intermediate triples */
end = label(state);
var = variable(state, &int_type);
-
+
/* Store the left hand side value */
left = write_expr(state, var, left);
-
+
/* Jump if the value is true */
jmp = branch(state, end, read_expr(state, var));
mid = label(state);
-
+
/* Store the right hand side value */
right = write_expr(state, var, right);
-
+
/* An expression for the computed value*/
val = read_expr(state, var);
@@ -7703,7 +7703,7 @@ static struct triple *mklor_expr(
}
static struct triple *mkcond_expr(
- struct compile_state *state,
+ struct compile_state *state,
struct triple *test, struct triple *left, struct triple *right)
{
struct triple *def, *val, *var, *jmp1, *jmp2, *top, *mid, *end;
@@ -7758,7 +7758,7 @@ static struct triple *mkcond_expr(
/* Store the right hand side value */
right = write_expr(state, var, right);
-
+
/* An expression for the computed value */
val = read_expr(state, var);
@@ -7850,7 +7850,7 @@ static struct triple *flatten_generic(
insert_triple(state, first, ptr);
ptr->id |= TRIPLE_FLAG_FLATTENED;
ptr->id &= ~TRIPLE_FLAG_LOCAL;
-
+
/* Now flatten the lhs elements */
for(i = 0; i < lhs; i++) {
struct triple **ins = &LHS(ptr, i);
@@ -7881,7 +7881,7 @@ static struct triple *flatten_prog(
unuse_triple(first, body->prev);
use_triple(body, body->prev);
}
-
+
if (!(val->id & TRIPLE_FLAG_FLATTENED)) {
internal_error(state, val, "val not flattened?");
}
@@ -7993,7 +7993,7 @@ static struct triple *flatten(
base = MISC(ptr, 0);
offset = bits_to_bytes(field_offset(state, base->type, ptr->u.field));
left = RHS(base, 0);
- ptr = triple(state, OP_ADD, left->type,
+ ptr = triple(state, OP_ADD, left->type,
read_expr(state, left),
int_const(state, &ulong_type, offset));
free_triple(state, base);
@@ -8214,8 +8214,8 @@ static struct triple *mk_add_expr(
if (!equiv_types(right->type, ptr_math)) {
right = mk_cast_expr(state, ptr_math, right);
}
- right = triple(state, op, ptr_math, right,
- int_const(state, ptr_math,
+ right = triple(state, op, ptr_math, right,
+ int_const(state, ptr_math,
size_of_in_bytes(state, left->type->left)));
}
return triple(state, OP_ADD, result_type, left, right);
@@ -8241,8 +8241,8 @@ static struct triple *mk_sub_expr(
if (!equiv_types(right->type, ptr_math)) {
right = mk_cast_expr(state, ptr_math, right);
}
- right = triple(state, op, ptr_math, right,
- int_const(state, ptr_math,
+ right = triple(state, op, ptr_math, right,
+ int_const(state, ptr_math,
size_of_in_bytes(state, left->type->left)));
}
return triple(state, OP_SUB, result_type, left, right);
@@ -8288,7 +8288,7 @@ static struct triple *mk_post_dec_expr(
struct triple *val;
lvalue(state, def);
val = read_expr(state, def);
- return triple(state, OP_VAL, def->type,
+ return triple(state, OP_VAL, def->type,
write_expr(state, def,
mk_sub_expr(state, val, int_const(state, &int_type, 1)))
, val);
@@ -8320,12 +8320,12 @@ static int is_simple_const(struct triple *ins)
/* Is this a constant that u.cval has the value.
* Or equivalently is this a constant that read_const
* works on.
- * So far only OP_INTCONST qualifies.
+ * So far only OP_INTCONST qualifies.
*/
return (ins->op == OP_INTCONST);
}
-static int constants_equal(struct compile_state *state,
+static int constants_equal(struct compile_state *state,
struct triple *left, struct triple *right)
{
int equal;
@@ -8402,7 +8402,7 @@ static long_t bit_count(ulong_t value)
}
}
return count;
-
+
}
#endif
@@ -8465,12 +8465,12 @@ static ulong_t read_const(struct compile_state *state,
struct triple *ins, struct triple *rhs)
{
switch(rhs->type->type &TYPE_MASK) {
- case TYPE_CHAR:
+ case TYPE_CHAR:
case TYPE_SHORT:
case TYPE_INT:
case TYPE_LONG:
- case TYPE_UCHAR:
- case TYPE_USHORT:
+ case TYPE_UCHAR:
+ case TYPE_USHORT:
case TYPE_UINT:
case TYPE_ULONG:
case TYPE_POINTER:
@@ -8520,7 +8520,7 @@ int const_eq(struct compile_state *state, struct triple *ins,
rval = read_const(state, ins, right);
result = (lval == rval);
}
- else if ((left->op == OP_ADDRCONST) &&
+ else if ((left->op == OP_ADDRCONST) &&
(right->op == OP_ADDRCONST)) {
result = (MISC(left, 0) == MISC(right, 0)) &&
(left->u.cval == right->u.cval);
@@ -8530,7 +8530,7 @@ int const_eq(struct compile_state *state, struct triple *ins,
result = -1;
}
return result;
-
+
}
int const_ucmp(struct compile_state *state, struct triple *ins,
@@ -8555,7 +8555,7 @@ int const_ucmp(struct compile_state *state, struct triple *ins,
result = -1;
}
}
- else if ((left->op == OP_ADDRCONST) &&
+ else if ((left->op == OP_ADDRCONST) &&
(right->op == OP_ADDRCONST) &&
(MISC(left, 0) == MISC(right, 0))) {
result = 0;
@@ -8652,7 +8652,7 @@ static void check_lhs(struct compile_state *state, struct triple *ins)
for(;expr;expr = triple_lhs(state, ins, expr)) {
internal_error(state, ins, "unexpected lhs");
}
-
+
}
#endif
@@ -8710,7 +8710,7 @@ static void wipe_branch(struct compile_state *state, struct triple *ins)
}
#endif
-static void mkcopy(struct compile_state *state,
+static void mkcopy(struct compile_state *state,
struct triple *ins, struct triple *rhs)
{
struct block *block;
@@ -8732,7 +8732,7 @@ static void mkcopy(struct compile_state *state,
use_triple(RHS(ins, 0), ins);
}
-static void mkconst(struct compile_state *state,
+static void mkconst(struct compile_state *state,
struct triple *ins, ulong_t value)
{
if (!is_integral(ins) && !is_pointer(ins)) {
@@ -8762,7 +8762,7 @@ static void mkaddr_const(struct compile_state *state,
}
#if DEBUG_DECOMPOSE_PRINT_TUPLES
-static void print_tuple(struct compile_state *state,
+static void print_tuple(struct compile_state *state,
struct triple *ins, struct triple *tuple)
{
FILE *fp = state->dbgout;
@@ -8773,11 +8773,11 @@ static void print_tuple(struct compile_state *state,
name_of(fp, LHS(tuple, 0)->type);
}
fprintf(fp, "\n");
-
+
}
#endif
-static struct triple *decompose_with_tuple(struct compile_state *state,
+static struct triple *decompose_with_tuple(struct compile_state *state,
struct triple *ins, struct triple *tuple)
{
struct triple *next;
@@ -8799,7 +8799,7 @@ static struct triple *decompose_with_tuple(struct compile_state *state,
propogate_use(state, ins, tuple);
release_triple(state, ins);
-
+
return next;
}
@@ -8817,7 +8817,7 @@ static struct triple *decompose_unknownval(struct compile_state *state,
#endif
get_occurance(ins->occurance);
- tuple = alloc_triple(state, OP_TUPLE, ins->type, -1, -1,
+ tuple = alloc_triple(state, OP_TUPLE, ins->type, -1, -1,
ins->occurance);
for(i = 0; i < tuple->lhs; i++) {
@@ -8834,7 +8834,7 @@ static struct triple *decompose_unknownval(struct compile_state *state,
}
-static struct triple *decompose_read(struct compile_state *state,
+static struct triple *decompose_read(struct compile_state *state,
struct triple *ins)
{
struct triple *tuple, *lval;
@@ -8850,7 +8850,7 @@ static struct triple *decompose_read(struct compile_state *state,
ins->occurance);
if ((tuple->lhs != lval->lhs) &&
- (!triple_is_def(state, lval) || (tuple->lhs != 1)))
+ (!triple_is_def(state, lval) || (tuple->lhs != 1)))
{
internal_error(state, ins, "lhs size inconsistency?");
}
@@ -8870,7 +8870,7 @@ static struct triple *decompose_read(struct compile_state *state,
}
get_occurance(tuple->occurance);
- read = alloc_triple(state, OP_READ, piece->type, -1, -1,
+ read = alloc_triple(state, OP_READ, piece->type, -1, -1,
tuple->occurance);
RHS(read, 0) = piece;
@@ -8897,12 +8897,12 @@ static struct triple *decompose_read(struct compile_state *state,
return decompose_with_tuple(state, ins, tuple);
}
-static struct triple *decompose_write(struct compile_state *state,
+static struct triple *decompose_write(struct compile_state *state,
struct triple *ins)
{
struct triple *tuple, *lval, *val;
ulong_t i;
-
+
lval = MISC(ins, 0);
val = RHS(ins, 0);
get_occurance(ins->occurance);
@@ -8910,7 +8910,7 @@ static struct triple *decompose_write(struct compile_state *state,
ins->occurance);
if ((tuple->lhs != lval->lhs) &&
- (!triple_is_def(state, lval) || tuple->lhs != 1))
+ (!triple_is_def(state, lval) || tuple->lhs != 1))
{
internal_error(state, ins, "lhs size inconsistency?");
}
@@ -8930,7 +8930,7 @@ static struct triple *decompose_write(struct compile_state *state,
}
pval = LHS(val, i);
}
-
+
/* See if the piece is really a bitref */
bitref = 0;
if (piece->op == OP_BITREF) {
@@ -8958,7 +8958,7 @@ static struct triple *decompose_write(struct compile_state *state,
}
get_occurance(tuple->occurance);
- write = alloc_triple(state, OP_WRITE, piece->type, -1, -1,
+ write = alloc_triple(state, OP_WRITE, piece->type, -1, -1,
tuple->occurance);
MISC(write, 0) = piece;
RHS(write, 0) = pval;
@@ -8977,7 +8977,7 @@ static void decompose_load_cb(struct compile_state *state,
{
struct decompose_load_info *info = arg;
struct triple *load;
-
+
if (reg_offset > info->tuple->lhs) {
internal_error(state, info->tuple, "lhs to small?");
}
@@ -8987,7 +8987,7 @@ static void decompose_load_cb(struct compile_state *state,
LHS(info->tuple, reg_offset/REG_SIZEOF_REG) = load;
}
-static struct triple *decompose_load(struct compile_state *state,
+static struct triple *decompose_load(struct compile_state *state,
struct triple *ins)
{
struct triple *tuple;
@@ -9020,7 +9020,7 @@ static void decompose_store_cb(struct compile_state *state,
{
struct decompose_store_info *info = arg;
struct triple *store;
-
+
if (reg_offset > info->tuple->lhs) {
internal_error(state, info->tuple, "lhs to small?");
}
@@ -9031,7 +9031,7 @@ static void decompose_store_cb(struct compile_state *state,
LHS(info->tuple, reg_offset/REG_SIZEOF_REG) = store;
}
-static struct triple *decompose_store(struct compile_state *state,
+static struct triple *decompose_store(struct compile_state *state,
struct triple *ins)
{
struct triple *tuple;
@@ -9053,7 +9053,7 @@ static struct triple *decompose_store(struct compile_state *state,
return decompose_with_tuple(state, ins, tuple);
}
-static struct triple *decompose_dot(struct compile_state *state,
+static struct triple *decompose_dot(struct compile_state *state,
struct triple *ins)
{
struct triple *tuple, *lval;
@@ -9075,7 +9075,7 @@ static struct triple *decompose_dot(struct compile_state *state,
#endif
get_occurance(ins->occurance);
- tuple = alloc_triple(state, OP_TUPLE, type, -1, -1,
+ tuple = alloc_triple(state, OP_TUPLE, type, -1, -1,
ins->occurance);
if (((ins->type->type & TYPE_MASK) == TYPE_BITFIELD) &&
@@ -9110,7 +9110,7 @@ static struct triple *decompose_dot(struct compile_state *state,
piece->u.bitfield.offset = reg_offset % REG_SIZEOF_REG;
}
else if ((reg_offset % REG_SIZEOF_REG) != 0) {
- internal_error(state, ins,
+ internal_error(state, ins,
"request for a nonbitfield sub register?");
}
@@ -9120,7 +9120,7 @@ static struct triple *decompose_dot(struct compile_state *state,
return decompose_with_tuple(state, ins, tuple);
}
-static struct triple *decompose_index(struct compile_state *state,
+static struct triple *decompose_index(struct compile_state *state,
struct triple *ins)
{
struct triple *tuple, *lval;
@@ -9140,7 +9140,7 @@ static struct triple *decompose_index(struct compile_state *state,
#endif
get_occurance(ins->occurance);
- tuple = alloc_triple(state, OP_TUPLE, type, -1, -1,
+ tuple = alloc_triple(state, OP_TUPLE, type, -1, -1,
ins->occurance);
for(i = 0; i < tuple->lhs; i++, idx++) {
@@ -9210,7 +9210,7 @@ static void decompose_compound_types(struct compile_state *state)
case OP_INDEX:
next = decompose_index(state, ins);
break;
-
+
}
#if DEBUG_DECOMPOSE_HIRES
fprintf(fp, "decompose next: %p \n", next);
@@ -9234,7 +9234,7 @@ static void decompose_compound_types(struct compile_state *state)
else {
release_triple(state, ins);
}
- }
+ }
ins = next;
} while(ins != first);
ins = first;
@@ -9243,7 +9243,7 @@ static void decompose_compound_types(struct compile_state *state)
if (ins->op == OP_BITREF) {
if (ins->use) {
internal_error(state, ins, "bitref used");
- }
+ }
else {
release_triple(state, ins);
}
@@ -9973,7 +9973,7 @@ static void simplify_sextract(struct compile_state *state, struct triple *ins)
val &= mask;
val <<= (SIZEOF_LONG - ins->u.bitfield.size);
sval = val;
- sval >>= (SIZEOF_LONG - ins->u.bitfield.size);
+ sval >>= (SIZEOF_LONG - ins->u.bitfield.size);
mkconst(state, ins, sval);
}
}
@@ -10094,7 +10094,7 @@ static struct triple *branch_target(struct compile_state *state, struct triple *
* loop back onto themselves. If I see one don't advance the
* target.
*/
- while(triple_is_structural(state, targ) &&
+ while(triple_is_structural(state, targ) &&
(targ->next != targ) && (targ->next != state->first)) {
targ = targ->next;
}
@@ -10111,7 +10111,7 @@ static void simplify_branch(struct compile_state *state, struct triple *ins)
if (ins->use != 0) {
internal_error(state, ins, "branch use");
}
- /* The challenge here with simplify branch is that I need to
+ /* The challenge here with simplify branch is that I need to
* make modifications to the control flow graph as well
* as to the branch instruction itself. That is handled
* by rebuilding the basic blocks after simplify all is called.
@@ -10128,7 +10128,7 @@ static void simplify_branch(struct compile_state *state, struct triple *ins)
struct triple *targ;
simplified = 0;
targ = branch_target(state, ins);
- if ((targ != ins) && (targ->op == OP_BRANCH) &&
+ if ((targ != ins) && (targ->op == OP_BRANCH) &&
!phi_dependency(targ->u.block))
{
unuse_triple(TARG(ins, 0), ins);
@@ -10208,7 +10208,7 @@ static void simplify_label(struct compile_state *state, struct triple *ins)
unuse_triple(ins, use);
use_triple(ins->prev, use);
}
-
+
}
}
if (ins->use) {
@@ -10245,7 +10245,7 @@ static void simplify_phi(struct compile_state *state, struct triple *ins)
return;
}
}
-
+
/* See if all of rhs members of a phi are the same */
value = slot[0];
for(i = 1; i < zrhs; i++) {
@@ -10373,11 +10373,11 @@ static const struct simplify_table {
[OP_BSF ] = { simplify_bsf, COMPILER_SIMPLIFY_OP },
[OP_BSR ] = { simplify_bsr, COMPILER_SIMPLIFY_OP },
[OP_RDMSR ] = { simplify_noop, COMPILER_SIMPLIFY_OP },
-[OP_WRMSR ] = { simplify_noop, COMPILER_SIMPLIFY_OP },
+[OP_WRMSR ] = { simplify_noop, COMPILER_SIMPLIFY_OP },
[OP_HLT ] = { simplify_noop, COMPILER_SIMPLIFY_OP },
};
-static inline void debug_simplify(struct compile_state *state,
+static inline void debug_simplify(struct compile_state *state,
simplify_t do_simplify, struct triple *ins)
{
#if DEBUG_SIMPLIFY_HIRES
@@ -10412,14 +10412,14 @@ static void simplify(struct compile_state *state, struct triple *ins)
else {
do_simplify = table_simplify[op].func;
}
- if (do_simplify &&
+ if (do_simplify &&
!(state->compiler->flags & table_simplify[op].flag)) {
do_simplify = simplify_noop;
}
if (do_simplify && (ins->id & TRIPLE_FLAG_VOLATILE)) {
do_simplify = simplify_noop;
}
-
+
if (!do_simplify) {
internal_error(state, ins, "cannot simplify op: %d %s",
op, tops(op));
@@ -10548,7 +10548,7 @@ static void register_builtin_function(struct compile_state *state,
ident = lookup(state, name, name_len);
ftype->type_ident = ident;
symbol(state, ident, &ident->sym_ident, def, ftype);
-
+
state->file = file.prev;
state->function = 0;
state->main_function = 0;
@@ -10595,7 +10595,7 @@ static struct type *register_builtin_type(struct compile_state *state,
name_len = strlen(name);
ident = lookup(state, name, name_len);
-
+
if ((type->type & TYPE_MASK) == TYPE_PRODUCT) {
ulong_t elements = 0;
struct type *field;
@@ -10644,23 +10644,23 @@ static void register_builtins(struct compile_state *state)
register_builtin_function(state, "__builtin_uldiv", OP_UDIVT, uldiv_type,
&ulong_type, &ulong_type);
- register_builtin_function(state, "__builtin_inb", OP_INB, &uchar_type,
+ register_builtin_function(state, "__builtin_inb", OP_INB, &uchar_type,
&ushort_type);
register_builtin_function(state, "__builtin_inw", OP_INW, &ushort_type,
&ushort_type);
- register_builtin_function(state, "__builtin_inl", OP_INL, &uint_type,
+ register_builtin_function(state, "__builtin_inl", OP_INL, &uint_type,
&ushort_type);
- register_builtin_function(state, "__builtin_outb", OP_OUTB, &void_type,
+ register_builtin_function(state, "__builtin_outb", OP_OUTB, &void_type,
&uchar_type, &ushort_type);
- register_builtin_function(state, "__builtin_outw", OP_OUTW, &void_type,
+ register_builtin_function(state, "__builtin_outw", OP_OUTW, &void_type,
&ushort_type, &ushort_type);
- register_builtin_function(state, "__builtin_outl", OP_OUTL, &void_type,
+ register_builtin_function(state, "__builtin_outl", OP_OUTL, &void_type,
&uint_type, &ushort_type);
-
- register_builtin_function(state, "__builtin_bsf", OP_BSF, &int_type,
+
+ register_builtin_function(state, "__builtin_bsf", OP_BSF, &int_type,
&int_type);
- register_builtin_function(state, "__builtin_bsr", OP_BSR, &int_type,
+ register_builtin_function(state, "__builtin_bsr", OP_BSR, &int_type,
&int_type);
msr_type = register_builtin_type(state, "__builtin_msr_t",
@@ -10671,13 +10671,13 @@ static void register_builtins(struct compile_state *state)
&ulong_type);
register_builtin_function(state, "__builtin_wrmsr", OP_WRMSR, &void_type,
&ulong_type, &ulong_type, &ulong_type);
-
- register_builtin_function(state, "__builtin_hlt", OP_HLT, &void_type,
+
+ register_builtin_function(state, "__builtin_hlt", OP_HLT, &void_type,
&void_type);
}
static struct type *declarator(
- struct compile_state *state, struct type *type,
+ struct compile_state *state, struct type *type,
struct hash_entry **ident, int need_ident);
static void decl(struct compile_state *state, struct triple *first);
static struct type *specifier_qualifier_list(struct compile_state *state);
@@ -11208,8 +11208,8 @@ static struct triple *shift_expr(struct compile_state *state)
right = read_expr(state, add_expr(state));
integral(state, right);
right = integral_promotion(state, right);
-
- op = (tok == TOK_SL)? OP_SL :
+
+ op = (tok == TOK_SL)? OP_SL :
is_signed(left->type)? OP_SSR: OP_USR;
def = triple(state, op, left->type, left, right);
@@ -11383,7 +11383,7 @@ static struct triple *lor_expr(struct compile_state *state)
right = read_expr(state, land_expr(state));
bool(state, right);
- def = mklor_expr(state,
+ def = mklor_expr(state,
ltrue_expr(state, left),
ltrue_expr(state, right));
}
@@ -11457,7 +11457,7 @@ static struct triple *eval_const_expr(
do {
valid_ins(state, ptr);
if ((ptr->op == OP_PHI) || (ptr->op == OP_LIST)) {
- internal_error(state, ptr,
+ internal_error(state, ptr,
"unexpected %s in constant expression",
tops(ptr->op));
}
@@ -11472,8 +11472,8 @@ static struct triple *eval_const_expr(
else if (triple_is_cbranch(state, ptr)) {
struct triple *cond_val;
cond_val = get_cv(state, cv, RHS(ptr, 0));
- if (!cond_val || !is_const(cond_val) ||
- (cond_val->op != OP_INTCONST))
+ if (!cond_val || !is_const(cond_val) ||
+ (cond_val->op != OP_INTCONST))
{
internal_error(state, ptr, "bad branch condition");
}
@@ -11489,16 +11489,16 @@ static struct triple *eval_const_expr(
else if (ptr->op == OP_WRITE) {
struct triple *val;
val = get_cv(state, cv, RHS(ptr, 0));
-
- set_cv(state, cv, MISC(ptr, 0),
+
+ set_cv(state, cv, MISC(ptr, 0),
copy_triple(state, val));
- set_cv(state, cv, ptr,
+ set_cv(state, cv, ptr,
copy_triple(state, val));
ptr = ptr->next;
}
else if (ptr->op == OP_READ) {
- set_cv(state, cv, ptr,
- copy_triple(state,
+ set_cv(state, cv, ptr,
+ copy_triple(state,
get_cv(state, cv, RHS(ptr, 0))));
ptr = ptr->next;
}
@@ -11519,7 +11519,7 @@ static struct triple *eval_const_expr(
else {
error(state, ptr, "impure operation in constant expression");
}
-
+
} while(ptr != head);
/* Get the result value */
@@ -11565,7 +11565,7 @@ static struct triple *assignment_expr(struct compile_state *state)
* a larger set of statements than standard C. As long
* as the subset of the grammar that is standard C behaves
* correctly this should cause no problems.
- *
+ *
* For the extra token strings accepted by the grammar
* none of them should produce a valid lvalue, so they
* should not produce functioning programs.
@@ -11578,7 +11578,7 @@ static struct triple *assignment_expr(struct compile_state *state)
case TOK_EQ:
lvalue(state, left);
eat(state, TOK_EQ);
- def = write_expr(state, left,
+ def = write_expr(state, left,
read_expr(state, assignment_expr(state)));
break;
case TOK_TIMESEQ:
@@ -11598,7 +11598,7 @@ static struct triple *assignment_expr(struct compile_state *state)
case TOK_MODEQ: op = sign? OP_SMOD : OP_UMOD; break;
}
def = write_expr(state, left,
- triple(state, op, left->type,
+ triple(state, op, left->type,
read_expr(state, left), right));
break;
case TOK_PLUSEQ:
@@ -11634,7 +11634,7 @@ static struct triple *assignment_expr(struct compile_state *state)
case TOK_OREQ: op = OP_OR; break;
}
def = write_expr(state, left,
- triple(state, op, left->type,
+ triple(state, op, left->type,
read_expr(state, left), right));
break;
}
@@ -11711,7 +11711,7 @@ static void for_statement(struct compile_state *state, struct triple *first)
head = test = tail = jmp1 = jmp2 = 0;
if (peek(state) != TOK_SEMI) {
head = expr(state);
- }
+ }
eat(state, TOK_SEMI);
if (peek(state) != TOK_SEMI) {
test = expr(state);
@@ -11843,7 +11843,7 @@ static void return_statement(struct compile_state *state, struct triple *first)
eat(state, TOK_SEMI);
/* See if this last statement in a function */
- last = ((peek(state) == TOK_RBRACE) &&
+ last = ((peek(state) == TOK_RBRACE) &&
(state->scope_depth == GLOBAL_SCOPE_DEPTH +2));
/* Find the return variable */
@@ -12186,7 +12186,7 @@ static void asm_statement(struct compile_state *state, struct triple *first)
for(i = 0; i < out; i++) {
struct triple *constraint;
constraint = out_param[i].constraint;
- info->tmpl.lhs[i] = arch_reg_constraint(state,
+ info->tmpl.lhs[i] = arch_reg_constraint(state,
out_param[i].expr->type, constraint->u.blob);
free_triple(state, constraint);
}
@@ -12216,9 +12216,9 @@ static void asm_statement(struct compile_state *state, struct triple *first)
}
info->tmpl.lhs[val] = cinfo;
info->tmpl.rhs[i] = cinfo;
-
+
} else {
- info->tmpl.rhs[i] = arch_reg_constraint(state,
+ info->tmpl.rhs[i] = arch_reg_constraint(state,
in_param[i].expr->type, str);
}
free_triple(state, constraint);
@@ -12238,7 +12238,7 @@ static void asm_statement(struct compile_state *state, struct triple *first)
size_t size = arch_reg_size(info->tmpl.lhs[i].reg);
if (size >= SIZEOF_LONG) {
type = &ulong_type;
- }
+ }
else if (size >= SIZEOF_INT) {
type = &uint_type;
}
@@ -12315,7 +12315,7 @@ static void statement(struct compile_state *state, struct triple *first)
compound_statement(state, first);
}
else if (tok == TOK_IF) {
- if_statement(state, first);
+ if_statement(state, first);
}
else if (tok == TOK_FOR) {
for_statement(state, first);
@@ -12345,7 +12345,7 @@ static void statement(struct compile_state *state, struct triple *first)
asm_statement(state, first);
}
else if ((tok == TOK_IDENT) && (peek2(state) == TOK_COLON)) {
- labeled_statement(state, first);
+ labeled_statement(state, first);
}
else if (tok == TOK_CASE) {
case_statement(state, first);
@@ -12367,7 +12367,7 @@ static struct type *param_decl(struct compile_state *state)
struct type *type;
struct hash_entry *ident;
/* Cheat so the declarator will know we are not global */
- start_scope(state);
+ start_scope(state);
ident = 0;
type = decl_specifiers(state);
type = declarator(state, type, &ident, 0);
@@ -12407,7 +12407,7 @@ static struct type *type_name(struct compile_state *state)
}
static struct type *direct_declarator(
- struct compile_state *state, struct type *type,
+ struct compile_state *state, struct type *type,
struct hash_entry **pident, int need_ident)
{
struct hash_entry *ident;
@@ -12485,7 +12485,7 @@ static struct type *direct_declarator(
}
static struct type *declarator(
- struct compile_state *state, struct type *type,
+ struct compile_state *state, struct type *type,
struct hash_entry **pident, int need_ident)
{
while(peek(state) == TOK_STAR) {
@@ -12504,7 +12504,7 @@ static struct type *typedef_name(
ident = eat(state, TOK_TYPE_NAME)->ident;
type = ident->sym_ident->type;
specifiers |= type->type & QUAL_MASK;
- if ((specifiers & (STOR_MASK | QUAL_MASK)) !=
+ if ((specifiers & (STOR_MASK | QUAL_MASK)) !=
(type->type & (STOR_MASK | QUAL_MASK))) {
type = clone_type(specifiers, type);
}
@@ -12538,7 +12538,7 @@ static struct type *enum_specifier(
struct type *entry;
eident = eat(state, TOK_IDENT)->ident;
if (eident->sym_ident) {
- error(state, 0, "%s already declared",
+ error(state, 0, "%s already declared",
eident->name);
}
eident->tok = TOK_ENUM_CONST;
@@ -12671,13 +12671,13 @@ static struct type *struct_or_union_specifier(
symbol(state, ident, &ident->sym_tag, 0, struct_type);
}
}
- if (ident && ident->sym_tag &&
- ident->sym_tag->type &&
+ if (ident && ident->sym_tag &&
+ ident->sym_tag->type &&
((ident->sym_tag->type->type & TYPE_MASK) == type_main)) {
struct_type = clone_type(spec, ident->sym_tag->type);
}
else if (ident && !struct_type) {
- error(state, 0, "%s %s undeclared",
+ error(state, 0, "%s %s undeclared",
(type_main == TYPE_STRUCT)?"struct" : "union",
ident->name);
}
@@ -12965,7 +12965,7 @@ static struct type *type_specifier(
type = typedef_name(state, spec);
break;
default:
- error(state, 0, "bad type specifier %s",
+ error(state, 0, "bad type specifier %s",
tokens[tok]);
break;
}
@@ -13145,7 +13145,7 @@ static struct triple *initializer(
(equiv_types(type->left, result->type->left))) {
type->elements = result->type->elements;
}
- if (is_lvalue(state, result) &&
+ if (is_lvalue(state, result) &&
((result->type->type & TYPE_MASK) == TYPE_ARRAY) &&
(type->type & TYPE_MASK) != TYPE_ARRAY)
{
@@ -13211,7 +13211,7 @@ static struct triple *initializer(
}
dest = ((char *)buf) + bits_to_bytes(info.offset);
#if DEBUG_INITIALIZER
- fprintf(state->errout, "dest = buf + %d max_offset: %d value_size: %d op: %d\n",
+ fprintf(state->errout, "dest = buf + %d max_offset: %d value_size: %d op: %d\n",
dest - buf,
bits_to_bytes(max_offset),
bits_to_bytes(value_size),
@@ -13243,7 +13243,7 @@ static struct triple *initializer(
info.offset += value_size;
if ((type->type & TYPE_MASK) == TYPE_STRUCT) {
info.type = next_field(state, type, info.type);
- info.offset = field_offset(state, type,
+ info.offset = field_offset(state, type,
info.type->field_ident);
}
} while(comma && (peek(state) != TOK_RBRACE));
@@ -13338,7 +13338,7 @@ static struct triple *function_definition(
if (((param->type & TYPE_MASK) != TYPE_VOID) && !param->field_ident) {
error(state, 0, "No identifier for paramter %d\n", i);
}
-
+
/* Get a list of statements for this function. */
def = triple(state, OP_LIST, type, 0, 0);
@@ -13361,7 +13361,7 @@ static struct triple *function_definition(
ctype->elements = 1;
/* Add a variable for the return value */
- crtype = new_type(TYPE_TUPLE,
+ crtype = new_type(TYPE_TUPLE,
/* Remove all type qualifiers from the return type */
new_type(TYPE_PRODUCT, ctype, clone_type(0, type->left)), 0);
crtype->elements = 2;
@@ -13394,7 +13394,7 @@ static struct triple *function_definition(
}
/* Add the declaration static const char __func__ [] = "func-name" */
- fname_type = new_type(TYPE_ARRAY,
+ fname_type = new_type(TYPE_ARRAY,
clone_type(QUAL_CONST | STOR_STATIC, &char_type), 0);
fname_type->type |= QUAL_CONST | STOR_STATIC;
fname_type->elements = strlen(state->function) + 1;
@@ -13439,7 +13439,7 @@ static struct triple *function_definition(
return def;
}
-static struct triple *do_decl(struct compile_state *state,
+static struct triple *do_decl(struct compile_state *state,
struct type *type, struct hash_entry *ident)
{
struct triple *def;
@@ -13477,7 +13477,7 @@ static struct triple *do_decl(struct compile_state *state,
((type->type & TYPE_MASK) == TYPE_ARRAY) &&
((type->type & STOR_MASK) != STOR_STATIC))
error(state, 0, "non static arrays not supported");
- if (ident &&
+ if (ident &&
((type->type & STOR_MASK) == STOR_STATIC) &&
((type->type & QUAL_CONST) == 0)) {
error(state, 0, "non const static variables not supported");
@@ -13520,8 +13520,8 @@ static void decl(struct compile_state *state, struct triple *first)
}
eat(state, TOK_EQ);
flatten(state, first,
- init_expr(state,
- ident->sym_ident->def,
+ init_expr(state,
+ ident->sym_ident->def,
initializer(state, type)));
}
arrays_complete(state, type);
@@ -13557,7 +13557,7 @@ static void decls(struct compile_state *state)
}
}
-/*
+/*
* Function inlining
*/
struct triple_reg_set {
@@ -13580,21 +13580,21 @@ static void walk_blocks(struct compile_state *state, struct basic_blocks *bb,
void *arg);
static void print_block(
struct compile_state *state, struct block *block, void *arg);
-static int do_triple_set(struct triple_reg_set **head,
+static int do_triple_set(struct triple_reg_set **head,
struct triple *member, struct triple *new_member);
static void do_triple_unset(struct triple_reg_set **head, struct triple *member);
static struct reg_block *compute_variable_lifetimes(
struct compile_state *state, struct basic_blocks *bb);
-static void free_variable_lifetimes(struct compile_state *state,
+static void free_variable_lifetimes(struct compile_state *state,
struct basic_blocks *bb, struct reg_block *blocks);
#if DEBUG_EXPLICIT_CLOSURES
-static void print_live_variables(struct compile_state *state,
+static void print_live_variables(struct compile_state *state,
struct basic_blocks *bb, struct reg_block *rb, FILE *fp);
#endif
static struct triple *call(struct compile_state *state,
- struct triple *retvar, struct triple *ret_addr,
+ struct triple *retvar, struct triple *ret_addr,
struct triple *targ, struct triple *ret)
{
struct triple *call;
@@ -13673,19 +13673,19 @@ static void mark_live(struct compile_state *state, struct triple *func, void *ar
static void mark_live_functions(struct compile_state *state)
{
- /* Ensure state->main_function is the last function in
+ /* Ensure state->main_function is the last function in
* the list of functions.
*/
if ((state->main_function->next != state->functions) ||
(state->functions->prev != state->main_function)) {
- internal_error(state, 0,
+ internal_error(state, 0,
"state->main_function is not at the end of the function list ");
}
state->main_function->u.cval = 1;
reverse_walk_functions(state, mark_live, 0);
}
-static int local_triple(struct compile_state *state,
+static int local_triple(struct compile_state *state,
struct triple *func, struct triple *ins)
{
int local = (ins->id & TRIPLE_FLAG_LOCAL);
@@ -13699,7 +13699,7 @@ static int local_triple(struct compile_state *state,
return local;
}
-struct triple *copy_func(struct compile_state *state, struct triple *ofunc,
+struct triple *copy_func(struct compile_state *state, struct triple *ofunc,
struct occurance *base_occurance)
{
struct triple *nfunc;
@@ -13742,7 +13742,7 @@ struct triple *copy_func(struct compile_state *state, struct triple *ofunc,
}
new->id |= TRIPLE_FLAG_FLATTENED;
new->id |= old->id & TRIPLE_FLAG_COPY;
-
+
/* During the copy remember new as user of old */
use_triple(old, new);
@@ -13781,7 +13781,7 @@ struct triple *copy_func(struct compile_state *state, struct triple *ofunc,
old = old->next;
new = new->next;
} while((old != ofirst) && (new != nfirst));
-
+
/* Make a third pass to cleanup the extra useses */
old = ofirst;
new = nfirst;
@@ -13830,7 +13830,7 @@ static void expand_inline_call(
}
result = 0;
if ((nfunc->type->left->type & TYPE_MASK) != TYPE_VOID) {
- result = read_expr(state,
+ result = read_expr(state,
deref_index(state, fresult(state, nfunc), 1));
}
if (state->compiler->debug & DEBUG_INLINE) {
@@ -13842,8 +13842,8 @@ static void expand_inline_call(
fprintf(fp, "__________ %s _________ done\n\n", __FUNCTION__);
}
- /*
- * Get rid of the extra triples
+ /*
+ * Get rid of the extra triples
*/
/* Remove the read of the return address */
ins = RHS(nfunc, 0)->prev->prev;
@@ -13859,7 +13859,7 @@ static void expand_inline_call(
release_triple(state, ins);
/* Remove the retaddres variable */
retvar = fretaddr(state, nfunc);
- if ((retvar->lhs != 1) ||
+ if ((retvar->lhs != 1) ||
(retvar->op != OP_ADECL) ||
(retvar->next->op != OP_PIECE) ||
(MISC(retvar->next, 0) != retvar)) {
@@ -13902,7 +13902,7 @@ static void expand_inline_call(
/*
*
* Type of the result variable.
- *
+ *
* result
* |
* +----------+------------+
@@ -13912,7 +13912,7 @@ static void expand_inline_call(
* +------------------+---------------+
* | |
* closure1 ... closuerN
- * | |
+ * | |
* +----+--+-+--------+-----+ +----+----+---+-----+
* | | | | | | | | |
* var1 var2 var3 ... varN result var1 var2 ... varN result
@@ -13930,7 +13930,7 @@ static void expand_inline_call(
* var1 var2 ... varN result var1 var2 ... varN result
*/
-static int add_closure_type(struct compile_state *state,
+static int add_closure_type(struct compile_state *state,
struct triple *func, struct type *closure_type)
{
struct type *type, *ctype, **next;
@@ -13963,19 +13963,19 @@ static int add_closure_type(struct compile_state *state,
fprintf(fp, "new_type: ");
name_of(fp, type);
fprintf(fp, "\n");
- fprintf(fp, "ctype: %p %d bits: %d ",
+ fprintf(fp, "ctype: %p %d bits: %d ",
ctype, ctype->elements, reg_size_of(state, ctype));
name_of(fp, ctype);
fprintf(fp, "\n");
#endif
-
+
/* Regenerate the variable with the new type definition */
new_var = pre_triple(state, var, OP_ADECL, type, 0, 0);
new_var->id |= TRIPLE_FLAG_FLATTENED;
for(i = 0; i < new_var->lhs; i++) {
LHS(new_var, i)->id |= TRIPLE_FLAG_FLATTENED;
}
-
+
/* Point everyone at the new variable */
propogate_use(state, var, new_var);
@@ -13984,7 +13984,7 @@ static int add_closure_type(struct compile_state *state,
release_triple(state, LHS(var, i));
}
release_triple(state, var);
-
+
/* Return the index of the added closure type */
return ctype->elements - 1;
}
@@ -14079,7 +14079,7 @@ static int lookup_closure_index(struct compile_state *state,
for(index0 = ins->next->next;
(index0->op == OP_INDEX) &&
(MISC(index0, 0) == result) &&
- (index0->u.cval == 0) ;
+ (index0->u.cval == 0) ;
index0 = write->next)
{
index1 = index0->next;
@@ -14123,12 +14123,12 @@ static void compute_closure_variables(struct compile_state *state,
int i, max_index;
#define MAX_INDICIES (sizeof(used_indicies)*CHAR_BIT)
#define ID_BITS(X) ((X) & (TRIPLE_FLAG_LOCAL -1))
- struct {
+ struct {
unsigned id;
int index;
} *info;
-
+
/* Find the basic blocks of this function */
bb.func = me;
bb.first = RHS(me, 0);
@@ -14177,7 +14177,7 @@ static void compute_closure_variables(struct compile_state *state,
ins = ins->next;
} while(ins != first);
- /*
+ /*
* Build the list of variables to enclose.
*
* A target it to put the same variable in the
@@ -14362,7 +14362,7 @@ static void expand_function_call(
if (!*closure_next) {
*closure_next = type;
} else {
- *closure_next = new_type(TYPE_PRODUCT, *closure_next,
+ *closure_next = new_type(TYPE_PRODUCT, *closure_next,
type);
closure_next = &(*closure_next)->right;
}
@@ -14422,22 +14422,22 @@ static void expand_function_call(
/* Initialize the return value */
if ((rtype->type & TYPE_MASK) != TYPE_VOID) {
- flatten(state, ret_loc,
- write_expr(state,
+ flatten(state, ret_loc,
+ write_expr(state,
deref_index(state, fresult(state, func), 1),
new_triple(state, OP_UNKNOWNVAL, rtype, 0, 0)));
}
ret_addr = flatten(state, ret_loc, ret_addr);
ret_set = flatten(state, ret_loc, write_expr(state, retvar, ret_addr));
- jmp = flatten(state, ret_loc,
+ jmp = flatten(state, ret_loc,
call(state, retvar, ret_addr, func_first, func_last));
/* Find the result */
if ((rtype->type & TYPE_MASK) != TYPE_VOID) {
struct triple * result;
- result = flatten(state, first,
- read_expr(state,
+ result = flatten(state, first,
+ read_expr(state,
deref_index(state, fresult(state, func), 1)));
propogate_use(state, fcall, result);
@@ -14456,7 +14456,7 @@ static void expand_function_call(
}
/* Generate an expression for the value */
new = flatten(state, first,
- read_expr(state,
+ read_expr(state,
closure_expr(state, func, closure_idx, i)));
@@ -14469,7 +14469,7 @@ static void expand_function_call(
/*
* If the original is a value update the dominated uses.
*/
-
+
/* Analyze the basic blocks so I can see who dominates whom */
bb.func = me;
bb.first = RHS(me, 0);
@@ -14477,7 +14477,7 @@ static void expand_function_call(
bb.func = 0;
}
analyze_basic_blocks(state, &bb);
-
+
#if DEBUG_EXPLICIT_CLOSURES
fprintf(state->errout, "Updating domindated uses: %p -> %p\n",
@@ -14485,7 +14485,7 @@ static void expand_function_call(
#endif
/* If fcall dominates the use update the expression */
for(use = set->member->use; use; use = next) {
- /* Replace use modifies the use chain and
+ /* Replace use modifies the use chain and
* removes use, so I must take a copy of the
* next entry early.
*/
@@ -14678,7 +14678,7 @@ static void insert_function(struct compile_state *state,
if (state->compiler->debug & DEBUG_INLINE) {
FILE *fp = state->errout;
- fprintf(fp, "%s func count: %d\n",
+ fprintf(fp, "%s func count: %d\n",
func->type->type_ident->name, func->u.cval);
}
if (func->u.cval == 0) {
@@ -14703,7 +14703,7 @@ struct triple *input_asm(struct compile_state *state)
struct asm_info *info;
struct triple *def;
int i, out;
-
+
info = xcmalloc(sizeof(*info), "asm_info");
info->str = "";
@@ -14713,7 +14713,7 @@ struct triple *input_asm(struct compile_state *state)
def = new_triple(state, OP_ASM, &void_type, out, 0);
def->u.ainfo = info;
def->id |= TRIPLE_FLAG_VOLATILE;
-
+
for(i = 0; i < out; i++) {
struct triple *piece;
piece = triple(state, OP_PIECE, &int_type, def, 0);
@@ -14729,7 +14729,7 @@ struct triple *output_asm(struct compile_state *state)
struct asm_info *info;
struct triple *def;
int in;
-
+
info = xcmalloc(sizeof(*info), "asm_info");
info->str = "";
@@ -14739,7 +14739,7 @@ struct triple *output_asm(struct compile_state *state)
def = new_triple(state, OP_ASM, &void_type, 0, in);
def->u.ainfo = info;
def->id |= TRIPLE_FLAG_VOLATILE;
-
+
return def;
}
@@ -14776,11 +14776,11 @@ static void join_functions(struct compile_state *state)
/* Verify the external arguments */
if (registers_of(state, args_type) > ARCH_INPUT_REGS) {
- error(state, state->main_function,
+ error(state, state->main_function,
"Too many external input arguments");
}
if (registers_of(state, result_type) > ARCH_OUTPUT_REGS) {
- error(state, state->main_function,
+ error(state, state->main_function,
"Too many external output arguments");
}
@@ -14810,8 +14810,8 @@ static void join_functions(struct compile_state *state)
param = param->left;
}
if (registers_of(state, param) != 1) {
- error(state, state->main_function,
- "Arg: %d %s requires multiple registers",
+ error(state, state->main_function,
+ "Arg: %d %s requires multiple registers",
idx + 1, param->field_ident->name);
}
expr = read_expr(state, LHS(in, idx));
@@ -14819,7 +14819,7 @@ static void join_functions(struct compile_state *state)
expr = flatten(state, call, expr);
use_triple(expr, call);
- idx++;
+ idx++;
}
@@ -14858,7 +14858,7 @@ static void join_functions(struct compile_state *state)
}
/* Allocate a dummy containing function */
- func = triple(state, OP_LIST,
+ func = triple(state, OP_LIST,
new_type(TYPE_FUNCTION, &void_type, &void_type), 0, 0);
func->type->type_ident = lookup(state, "", 0);
RHS(func, 0) = state->first;
@@ -14887,7 +14887,7 @@ static void join_functions(struct compile_state *state)
static int do_use_block(
- struct block *used, struct block_set **head, struct block *user,
+ struct block *used, struct block_set **head, struct block *user,
int front)
{
struct block_set **ptr, *new;
@@ -14942,13 +14942,13 @@ static void use_block(struct block *used, struct block *user)
/* Append new to the head of the list, print_block
* depends on this.
*/
- count = do_use_block(used, &used->use, user, 1);
+ count = do_use_block(used, &used->use, user, 1);
used->users += count;
}
static void unuse_block(struct block *used, struct block *unuser)
{
int count;
- count = do_unuse_block(used, &used->use, unuser);
+ count = do_unuse_block(used, &used->use, unuser);
used->users -= count;
}
@@ -15007,7 +15007,7 @@ static void unipdomf_block(struct block *block, struct block *unipdomf)
}
static int walk_triples(
- struct compile_state *state,
+ struct compile_state *state,
int (*cb)(struct compile_state *state, struct triple *ptr, void *arg),
void *arg)
{
@@ -15040,7 +15040,7 @@ static int do_print_triple(struct compile_state *state, struct triple *ins, void
}
display_triple(fp, ins);
- if (triple_is_branch(state, ins) && ins->use &&
+ if (triple_is_branch(state, ins) && ins->use &&
(ins->op != OP_RET) && (ins->op != OP_FCALL)) {
internal_error(state, ins, "branch used?");
}
@@ -15161,7 +15161,7 @@ static void free_basic_block(struct compile_state *state, struct block *block)
while((edge = block->edges)) {
child = edge->member;
remove_block_edge(block, child);
-
+
if (child && (child->vertex != -1)) {
free_basic_block(state, child);
}
@@ -15172,7 +15172,7 @@ static void free_basic_block(struct compile_state *state, struct block *block)
#endif
}
-static void free_basic_blocks(struct compile_state *state,
+static void free_basic_blocks(struct compile_state *state,
struct basic_blocks *bb)
{
struct triple *first, *ins;
@@ -15187,10 +15187,10 @@ static void free_basic_blocks(struct compile_state *state,
}
ins = ins->next;
} while(ins != first);
-
+
}
-static struct block *basic_block(struct compile_state *state,
+static struct block *basic_block(struct compile_state *state,
struct basic_blocks *bb, struct triple *first)
{
struct block *block;
@@ -15209,7 +15209,7 @@ static struct block *basic_block(struct compile_state *state,
block->vertex = bb->last_vertex;
ptr = first;
do {
- if ((ptr != first) && triple_is_label(state, ptr) && (ptr->use)) {
+ if ((ptr != first) && triple_is_label(state, ptr) && (ptr->use)) {
break;
}
block->last = ptr;
@@ -15224,7 +15224,7 @@ static struct block *basic_block(struct compile_state *state,
} while (ptr != bb->first);
if ((ptr == bb->first) ||
((ptr->next == bb->first) && (
- triple_is_end(state, ptr) ||
+ triple_is_end(state, ptr) ||
triple_is_ret(state, ptr))))
{
/* The block has no outflowing edges */
@@ -15289,7 +15289,7 @@ static struct block *basic_block(struct compile_state *state,
struct block_set *edge;
FILE *fp = state->errout;
fprintf(fp, "basic_block: %10p [%2d] ( %10p - %10p )",
- block, block->vertex,
+ block, block->vertex,
block->first, block->last);
for(edge = block->edges; edge; edge = edge->next) {
fprintf(fp, " %10p [%2d]",
@@ -15333,7 +15333,7 @@ static void print_block(
FILE *fp = arg;
fprintf(fp, "\nblock: %p (%d) ",
- block,
+ block,
block->vertex);
for(edge = block->edges; edge; edge = edge->next) {
@@ -15357,7 +15357,7 @@ static void print_block(
}
fprintf(fp, "users %d: ", block->users);
for(user = block->use; user; user = user->next) {
- fprintf(fp, "%p (%d) ",
+ fprintf(fp, "%p (%d) ",
user->member,
user->member->vertex);
}
@@ -15383,7 +15383,7 @@ static void print_blocks(struct compile_state *state, const char *func, FILE *fp
}
}
-static void prune_nonblock_triples(struct compile_state *state,
+static void prune_nonblock_triples(struct compile_state *state,
struct basic_blocks *bb)
{
struct block *block;
@@ -15415,7 +15415,7 @@ static void prune_nonblock_triples(struct compile_state *state,
} while(ins != first);
}
-static void setup_basic_blocks(struct compile_state *state,
+static void setup_basic_blocks(struct compile_state *state,
struct basic_blocks *bb)
{
if (!triple_stores_block(state, bb->first)) {
@@ -15430,8 +15430,8 @@ static void setup_basic_blocks(struct compile_state *state,
bb->first_block = basic_block(state, bb, bb->first);
/* Be certain the last instruction of a function, or the
- * entire program is in a basic block. When it is not find
- * the start of the block, insert a label if necessary and build
+ * entire program is in a basic block. When it is not find
+ * the start of the block, insert a label if necessary and build
* basic block. Then add a fake edge from the start block
* to the final block.
*/
@@ -15447,7 +15447,7 @@ static void setup_basic_blocks(struct compile_state *state,
add_block_edge(bb->first_block, tail, 0);
use_block(tail, bb->first_block);
}
-
+
/* Find the last basic block.
*/
bb->last_block = block_of_triple(state, bb->first->prev);
@@ -15548,7 +15548,7 @@ static int initialize_spdblock(
return vertex;
}
-static int setup_spdblocks(struct compile_state *state,
+static int setup_spdblocks(struct compile_state *state,
struct basic_blocks *bb, struct sdom_block *sd)
{
struct block *block;
@@ -15558,7 +15558,7 @@ static int setup_spdblocks(struct compile_state *state,
/* Walk through the graph and find unconnected blocks. Add a
* fake edge from the unconnected blocks to the end of the
- * graph.
+ * graph.
*/
block = bb->first_block->last->next->u.block;
for(; block && block != bb->first_block; block = block->last->next->u.block) {
@@ -15602,16 +15602,16 @@ static void compress_ancestors(struct sdom_block *v)
}
}
-static void compute_sdom(struct compile_state *state,
+static void compute_sdom(struct compile_state *state,
struct basic_blocks *bb, struct sdom_block *sd)
{
int i;
- /* // step 2
+ /* // step 2
* for each v <= pred(w) {
* u = EVAL(v);
- * if (semi[u] < semi[w] {
- * semi[w] = semi[u];
- * }
+ * if (semi[u] < semi[w] {
+ * semi[w] = semi[u];
+ * }
* }
* add w to bucket(vertex(semi[w]));
* LINK(parent(w), w);
@@ -15646,22 +15646,22 @@ static void compute_sdom(struct compile_state *state,
next = v->sdom_next;
unsdom_block(v);
u = (!v->ancestor) ? v : (compress_ancestors(v), v->label);
- v->block->idom = (u->sdom->vertex < v->sdom->vertex)?
+ v->block->idom = (u->sdom->vertex < v->sdom->vertex)?
u->block : parent->block;
}
}
}
-static void compute_spdom(struct compile_state *state,
+static void compute_spdom(struct compile_state *state,
struct basic_blocks *bb, struct sdom_block *sd)
{
int i;
- /* // step 2
+ /* // step 2
* for each v <= pred(w) {
* u = EVAL(v);
- * if (semi[u] < semi[w] {
- * semi[w] = semi[u];
- * }
+ * if (semi[u] < semi[w] {
+ * semi[w] = semi[u];
+ * }
* }
* add w to bucket(vertex(semi[w]));
* LINK(parent(w), w);
@@ -15695,13 +15695,13 @@ static void compute_spdom(struct compile_state *state,
next = v->sdom_next;
unsdom_block(v);
u = (!v->ancestor) ? v : (compress_ancestors(v), v->label);
- v->block->ipdom = (u->sdom->vertex < v->sdom->vertex)?
+ v->block->ipdom = (u->sdom->vertex < v->sdom->vertex)?
u->block : parent->block;
}
}
}
-static void compute_idom(struct compile_state *state,
+static void compute_idom(struct compile_state *state,
struct basic_blocks *bb, struct sdom_block *sd)
{
int i;
@@ -15716,7 +15716,7 @@ static void compute_idom(struct compile_state *state,
sd[1].block->idom = 0;
}
-static void compute_ipdom(struct compile_state *state,
+static void compute_ipdom(struct compile_state *state,
struct basic_blocks *bb, struct sdom_block *sd)
{
int i;
@@ -15733,13 +15733,13 @@ static void compute_ipdom(struct compile_state *state,
/* Theorem 1:
* Every vertex of a flowgraph G = (V, E, r) except r has
- * a unique immediate dominator.
+ * a unique immediate dominator.
* The edges {(idom(w), w) |w <= V - {r}} form a directed tree
- * rooted at r, called the dominator tree of G, such that
+ * rooted at r, called the dominator tree of G, such that
* v dominates w if and only if v is a proper ancestor of w in
* the dominator tree.
*/
- /* Lemma 1:
+ /* Lemma 1:
* If v and w are vertices of G such that v <= w,
* than any path from v to w must contain a common ancestor
* of v and w in T.
@@ -15752,7 +15752,7 @@ static void compute_ipdom(struct compile_state *state,
* sdom(u) >= sdom(w). Then idom(w) = sdom(w).
*/
/* Theorem 3:
- * Let w != r and let u be a vertex for which sdom(u) is
+ * Let w != r and let u be a vertex for which sdom(u) is
* minimum amoung vertices u satisfying sdom(w) -> u -> w.
* Then sdom(u) <= sdom(w) and idom(u) = idom(w).
*/
@@ -15770,11 +15770,11 @@ static void find_immediate_dominators(struct compile_state *state,
/* Theorem 4:
* For any vertex w != r.
* sdom(w) = min(
- * {v|(v,w) <= E and v < w } U
+ * {v|(v,w) <= E and v < w } U
* {sdom(u) | u > w and there is an edge (v, w) such that u -> v})
*/
/* Corollary 1:
- * Let w != r and let u be a vertex for which sdom(u) is
+ * Let w != r and let u be a vertex for which sdom(u) is
* minimum amoung vertices u satisfying sdom(w) -> u -> w.
* Then:
* { sdom(w) if sdom(w) = sdom(u),
@@ -15782,7 +15782,7 @@ static void find_immediate_dominators(struct compile_state *state,
* { idom(u) otherwise
*/
/* The algorithm consists of the following 4 steps.
- * Step 1. Carry out a depth-first search of the problem graph.
+ * Step 1. Carry out a depth-first search of the problem graph.
* Number the vertices from 1 to N as they are reached during
* the search. Initialize the variables used in succeeding steps.
* Step 2. Compute the semidominators of all vertices by applying
@@ -15922,7 +15922,7 @@ static void print_dominated2(
for(i = 0; i < depth; i++) {
fprintf(fp, " ");
}
- fprintf(fp, "%3d: %p (%p - %p) @",
+ fprintf(fp, "%3d: %p (%p - %p) @",
block->vertex, block, block->first, block->last);
ins = block->first;
while(ins != block->last && (ins->occurance->line == 0)) {
@@ -15973,7 +15973,7 @@ static int print_frontiers(
fprintf(fp, " %d", user->member->vertex);
}
fprintf(fp, "\n");
-
+
for(edge = block->edges; edge; edge = edge->next) {
vertex = print_frontiers(state, fp, edge->member, vertex);
}
@@ -15984,7 +15984,7 @@ static void print_dominance_frontiers(struct compile_state *state,
{
fprintf(fp, "\ndominance frontiers\n");
print_frontiers(state, fp, bb->first_block, 0);
-
+
}
static void analyze_idominators(struct compile_state *state, struct basic_blocks *bb)
@@ -16050,7 +16050,7 @@ static void print_ipdominance_frontiers(struct compile_state *state,
{
fprintf(fp, "\nipdominance frontiers\n");
print_pfrontiers(state, fp, bb->last_block, 0);
-
+
}
static void analyze_ipdominators(struct compile_state *state,
@@ -16086,7 +16086,7 @@ static int tdominates(struct compile_state *state,
bsub = block_of_triple(state, sub);
if (bdom != bsub) {
result = bdominates(state, bdom, bsub);
- }
+ }
else {
struct triple *ins;
if (!bdom || !bsub) {
@@ -16132,7 +16132,7 @@ static void insert_phi_operations(struct compile_state *state)
if (!triple_is_auto_var(state, var) || !var->use) {
continue;
}
-
+
iter += 1;
work_list = 0;
work_list_tail = &work_list;
@@ -16145,7 +16145,7 @@ static void insert_phi_operations(struct compile_state *state)
continue;
}
if (user->member->op != OP_WRITE) {
- internal_error(state, user->member,
+ internal_error(state, user->member,
"bad variable access");
}
block = user->member->u.block;
@@ -16178,7 +16178,7 @@ static void insert_phi_operations(struct compile_state *state)
/* Insert a phi function for this variable */
get_occurance(var->occurance);
phi = alloc_triple(
- state, OP_PHI, var->type, -1, in_edges,
+ state, OP_PHI, var->type, -1, in_edges,
var->occurance);
phi->u.block = front;
MISC(phi, 0) = var;
@@ -16581,7 +16581,7 @@ static void prune_unused_phis(struct compile_state *state)
struct triple *first, *phi;
struct phi_triple *live;
int phis, i;
-
+
/* Find the first instruction */
first = state->first;
@@ -16592,7 +16592,7 @@ static void prune_unused_phis(struct compile_state *state)
phis += 1;
}
}
-
+
/* Mark them all dead */
live = xcmalloc(sizeof(*live) * (phis + 1), "phi_triple");
phis = 0;
@@ -16606,7 +16606,7 @@ static void prune_unused_phis(struct compile_state *state)
phi->id = phis;
phis += 1;
}
-
+
/* Mark phis alive that are used by non phis */
for(i = 0; i < phis; i++) {
struct triple_set *set;
@@ -16639,7 +16639,7 @@ static void prune_unused_phis(struct compile_state *state)
slot[j] = unknown;
use_triple(unknown, phi);
transform_to_arch_instruction(state, unknown);
-#if 0
+#if 0
warning(state, phi, "variable not set at index %d on all paths to use", j);
#endif
}
@@ -16773,7 +16773,7 @@ static void transform_from_ssa_form(struct compile_state *state)
}
var = post_triple(state, phi, OP_ADECL, phi->type, 0, 0);
var = var->next; /* point at the var */
-
+
/* Replaces use of phi with var */
propogate_use(state, phi, var);
@@ -16826,7 +16826,7 @@ static void transform_from_ssa_form(struct compile_state *state)
if (!eblock->first) {
internal_error(state, 0, "empty block?");
}
-
+
/* Make certain the write is placed in the edge block... */
/* Walk through the edge block backwards to find an
* appropriate location for the OP_WRITE.
@@ -16873,7 +16873,7 @@ static void transform_from_ssa_form(struct compile_state *state)
/* Release the phi function */
release_triple(state, phi);
}
-
+
/* Walk all of the operations to find the adecls */
for(var = first->next; var != first ; var = var->next) {
struct triple_set *use, *use_next;
@@ -16890,7 +16890,7 @@ static void transform_from_ssa_form(struct compile_state *state)
int zrhs, i, used;
use_next = use->next;
user = use->member;
-
+
/* Generate a read of var */
read = pre_triple(state, user, OP_READ, var->type, var, 0);
use_triple(var, read);
@@ -16909,7 +16909,7 @@ static void transform_from_ssa_form(struct compile_state *state)
if (used) {
unuse_triple(var, user);
use_triple(read, user);
- }
+ }
/* If we didn't use it release the extra triple */
else {
release_triple(state, read);
@@ -16921,7 +16921,7 @@ static void transform_from_ssa_form(struct compile_state *state)
#define HI() if (state->compiler->debug & DEBUG_REBUILD_SSA_FORM) { \
FILE *fp = state->dbgout; \
fprintf(fp, "@ %s:%d\n", __FILE__, __LINE__); romcc_print_blocks(state, fp); \
- }
+ }
static void rebuild_ssa_form(struct compile_state *state)
{
@@ -16936,7 +16936,7 @@ HI();
HI();
rename_variables(state);
HI();
-
+
prune_block_variables(state, state->bb.first_block);
HI();
prune_unused_phis(state);
@@ -16944,7 +16944,7 @@ HI();
}
#undef HI
-/*
+/*
* Register conflict resolution
* =========================================================
*/
@@ -16974,7 +16974,7 @@ static struct reg_info find_def_color(
if (tinfo.reg >= MAX_REGISTERS) {
tinfo.reg = REG_UNSET;
}
- if ((tinfo.reg != REG_UNSET) &&
+ if ((tinfo.reg != REG_UNSET) &&
(info.reg != REG_UNSET) &&
(tinfo.reg != info.reg)) {
internal_error(state, def, "register conflict");
@@ -17227,7 +17227,7 @@ static struct triple *typed_pre_copy(
use_triple(in, ins);
transform_to_arch_instruction(state, in);
return in;
-
+
}
static struct triple *pre_copy(
struct compile_state *state, struct triple *ins, int index)
@@ -17284,7 +17284,7 @@ static void insert_copies_to_phi(struct compile_state *state)
move->u.block = eblock;
move->id |= TRIPLE_FLAG_PRE_SPLIT;
use_triple(val, move);
-
+
slot[edge] = move;
unuse_triple(val, phi);
use_triple(move, phi);
@@ -17341,7 +17341,7 @@ struct triple_reg_set;
struct reg_block;
-static int do_triple_set(struct triple_reg_set **head,
+static int do_triple_set(struct triple_reg_set **head,
struct triple *member, struct triple *new_member)
{
struct triple_reg_set **ptr, *new;
@@ -17459,7 +17459,7 @@ static struct triple *part_to_piece(struct compile_state *state, struct triple *
return ins;
}
-static int this_def(struct compile_state *state,
+static int this_def(struct compile_state *state,
struct triple *ins, struct triple *other)
{
if (ins == other) {
@@ -17637,7 +17637,7 @@ static struct reg_block *compute_variable_lifetimes(
return blocks;
}
-static void free_variable_lifetimes(struct compile_state *state,
+static void free_variable_lifetimes(struct compile_state *state,
struct basic_blocks *bb, struct reg_block *blocks)
{
int i;
@@ -17660,16 +17660,16 @@ static void free_variable_lifetimes(struct compile_state *state,
}
typedef void (*wvl_cb_t)(
- struct compile_state *state,
- struct reg_block *blocks, struct triple_reg_set *live,
+ struct compile_state *state,
+ struct reg_block *blocks, struct triple_reg_set *live,
struct reg_block *rb, struct triple *ins, void *arg);
static void walk_variable_lifetimes(struct compile_state *state,
- struct basic_blocks *bb, struct reg_block *blocks,
+ struct basic_blocks *bb, struct reg_block *blocks,
wvl_cb_t cb, void *arg)
{
int i;
-
+
for(i = 1; i <= state->bb.last_vertex; i++) {
struct triple_reg_set *live;
struct triple_reg_set *entry, *next;
@@ -17704,7 +17704,7 @@ static void walk_variable_lifetimes(struct compile_state *state,
* going on.
*/
cb(state, blocks, live, rb, ptr, arg);
-
+
/* Remove the current definition from live */
do_triple_unset(&live, ptr);
@@ -17757,7 +17757,7 @@ static void print_live_variables_block(
block, block->vertex);
for(edge = block->edges; edge; edge = edge->next) {
fprintf(fp, " %p<-%p",
- edge->member,
+ edge->member,
edge->member && edge->member->use?edge->member->use->member : 0);
}
fprintf(fp, "\n");
@@ -17811,7 +17811,7 @@ static void print_live_variables_block(
fprintf(fp, "\n");
}
-static void print_live_variables(struct compile_state *state,
+static void print_live_variables(struct compile_state *state,
struct basic_blocks *bb, struct reg_block *rb, FILE *fp)
{
struct print_live_variable_info info;
@@ -17847,7 +17847,7 @@ struct dead_triple {
#define TRIPLE_FLAG_FREE 1
};
-static void print_dead_triples(struct compile_state *state,
+static void print_dead_triples(struct compile_state *state,
struct dead_triple *dtriple)
{
struct triple *first, *ins;
@@ -17865,7 +17865,7 @@ static void print_dead_triples(struct compile_state *state,
if ((ins->op == OP_LABEL) && (ins->use)) {
fprintf(fp, "\n%p:\n", ins);
}
- fprintf(fp, "%c",
+ fprintf(fp, "%c",
(dt->flags & TRIPLE_FLAG_ALIVE)?' ': '-');
display_triple(fp, ins);
if (triple_is_branch(state, ins)) {
@@ -17932,7 +17932,7 @@ static void eliminate_inefectual_code(struct compile_state *state)
/* Now put then in an array and mark all of the triples dead */
dtriple = xcmalloc(sizeof(*dtriple) * (triples + 1), "dtriples");
-
+
ins = first;
i = 1;
block = 0;
@@ -18003,7 +18003,7 @@ static void eliminate_inefectual_code(struct compile_state *state)
}
print_dead_triples(state, dtriple);
for(dt = &dtriple[1]; dt <= &dtriple[triples]; dt++) {
- if ((dt->triple->op == OP_NOOP) &&
+ if ((dt->triple->op == OP_NOOP) &&
(dt->flags & TRIPLE_FLAG_ALIVE)) {
internal_error(state, dt->triple, "noop effective?");
}
@@ -18062,13 +18062,13 @@ static void insert_mandatory_copies(struct compile_state *state)
if (i < 0) {
continue;
}
-
+
/* Find the users color requirements */
rinfo = arch_reg_rhs(state, entry->member, i);
if (rinfo.reg >= MAX_REGISTERS) {
rinfo.reg = REG_UNSET;
}
-
+
/* See if I need a pre_copy */
if (rinfo.reg != REG_UNSET) {
if ((reg != REG_UNSET) && (reg != rinfo.reg)) {
@@ -18085,14 +18085,14 @@ static void insert_mandatory_copies(struct compile_state *state)
* They do not take up any registers until a
* copy places them in one.
*/
- if ((info.reg == REG_UNNEEDED) &&
+ if ((info.reg == REG_UNNEEDED) &&
(rinfo.reg != REG_UNNEEDED)) {
do_pre_copy = 1;
}
}
do_post_copy =
!do_pre_copy &&
- (((info.reg != REG_UNSET) &&
+ (((info.reg != REG_UNSET) &&
(reg != REG_UNSET) &&
(info.reg != reg)) ||
((info.regcm & regcm) == 0));
@@ -18108,7 +18108,7 @@ static void insert_mandatory_copies(struct compile_state *state)
if (i < 0) {
continue;
}
-
+
/* Find the users color requirements */
rinfo = arch_reg_rhs(state, entry->member, i);
if (rinfo.reg >= MAX_REGISTERS) {
@@ -18157,7 +18157,7 @@ static void insert_mandatory_copies(struct compile_state *state)
}
}
regcm &= rinfo.regcm;
-
+
}
if (do_post_copy) {
struct reg_info pre, post;
@@ -18251,7 +18251,7 @@ static void print_interference_block(
block, block->vertex);
for(edge = block->edges; edge; edge = edge->next) {
fprintf(fp, " %p<-%p",
- edge->member,
+ edge->member,
edge->member && edge->member->use?edge->member->use->member : 0);
}
fprintf(fp, "\n");
@@ -18297,7 +18297,7 @@ static void print_interference_block(
op = ptr->op;
done = (ptr == block->last);
lr = rstate->lrd[ptr->id].lr;
-
+
id = ptr->id;
ptr->id = rstate->lrd[id].orig_id;
SET_REG(ptr->id, lr->color);
@@ -18462,7 +18462,7 @@ static struct lre_hash **lre_probe(struct reg_state *rstate,
right = tmp;
}
index = hash_live_edge(left, right);
-
+
ptr = &rstate->hash[index];
while(*ptr) {
if (((*ptr)->left == left) && ((*ptr)->right == right)) {
@@ -18481,7 +18481,7 @@ static int interfere(struct reg_state *rstate,
return ptr && *ptr;
}
-static void add_live_edge(struct reg_state *rstate,
+static void add_live_edge(struct reg_state *rstate,
struct live_range *left, struct live_range *right)
{
/* FIXME the memory allocation overhead is noticeable here... */
@@ -18520,7 +18520,7 @@ static void add_live_edge(struct reg_state *rstate,
edge->node = right;
left->edges = edge;
left->degree += 1;
-
+
edge = xmalloc(sizeof(*edge), "live_range_edge");
edge->next = right->edges;
edge->node = left;
@@ -18572,7 +18572,7 @@ static void remove_live_edges(struct reg_state *rstate, struct live_range *range
}
}
-static void transfer_live_edges(struct reg_state *rstate,
+static void transfer_live_edges(struct reg_state *rstate,
struct live_range *dest, struct live_range *src)
{
struct live_range_edge *edge, *next;
@@ -18587,7 +18587,7 @@ static void transfer_live_edges(struct reg_state *rstate,
/* Interference graph...
- *
+ *
* new(n) --- Return a graph with n nodes but no edges.
* add(g,x,y) --- Return a graph including g with an between x and y
* interfere(g, x, y) --- Return true if there exists an edge between the nodes
@@ -18600,11 +18600,11 @@ static void transfer_live_edges(struct reg_state *rstate,
* The adjacency vectors support an efficient implementation of neighbors.
*/
-/*
+/*
* +---------------------------------------------------+
* | +--------------+ |
* v v | |
- * renumber -> build graph -> colalesce -> spill_costs -> simplify -> select
+ * renumber -> build graph -> colalesce -> spill_costs -> simplify -> select
*
* -- In simplify implment optimistic coloring... (No backtracking)
* -- Implement Rematerialization it is the only form of spilling we can perform
@@ -18620,7 +18620,7 @@ static void transfer_live_edges(struct reg_state *rstate,
#if DEBUG_ROMCC_WARNING
static void different_colored(
- struct compile_state *state, struct reg_state *rstate,
+ struct compile_state *state, struct reg_state *rstate,
struct triple *parent, struct triple *ins)
{
struct live_range *lr;
@@ -18656,13 +18656,13 @@ static struct live_range *coalesce_ranges(
}
if ((lr1->color == REG_UNNEEDED) ||
(lr2->color == REG_UNNEEDED)) {
- internal_error(state, 0,
+ internal_error(state, 0,
"cannot coalesce live ranges without a possible color");
}
if ((lr1->color != lr2->color) &&
(lr1->color != REG_UNSET) &&
(lr2->color != REG_UNSET)) {
- internal_error(state, lr1->defs->def,
+ internal_error(state, lr1->defs->def,
"cannot coalesce live ranges of different colors");
}
color = lr1->color;
@@ -18693,7 +18693,7 @@ static struct live_range *coalesce_ranges(
/* If there is a clear dominate live range put it in lr1,
* For purposes of this test phi functions are
* considered dominated by the definitions that feed into
- * them.
+ * them.
*/
if ((lr1->defs->prev->def->op == OP_PHI) ||
((lr2->defs->prev->def->op != OP_PHI) &&
@@ -18724,12 +18724,12 @@ static struct live_range *coalesce_ranges(
lr2->defs->def,
lr2->color);
#endif
-
+
/* Append lr2 onto lr1 */
#if DEBUG_ROMCC_WARNINGS
#warning "FIXME should this be a merge instead of a splice?"
#endif
- /* This FIXME item applies to the correctness of live_range_end
+ /* This FIXME item applies to the correctness of live_range_end
* and to the necessity of making multiple passes of coalesce_live_ranges.
* A failure to find some coalesce opportunities in coaleace_live_ranges
* does not impact the correct of the compiler just the efficiency with
@@ -18739,7 +18739,7 @@ static struct live_range *coalesce_ranges(
mid1 = lr1->defs->prev;
mid2 = lr2->defs;
end = lr2->defs->prev;
-
+
head->prev = end;
end->next = head;
@@ -18844,7 +18844,7 @@ static void initialize_live_ranges(
rstate->lr[i].classes = info.regcm;
rstate->lr[i].degree = 0;
rstate->lrd[j].lr = &rstate->lr[i];
- }
+ }
/* Otherwise give the triple the dummy live range. */
else {
rstate->lrd[j].lr = &rstate->lr[0];
@@ -18871,7 +18871,7 @@ static void initialize_live_ranges(
if (ins->id > rstate->defs) {
internal_error(state, ins, "bad id");
}
-
+
/* Walk through the template of ins and coalesce live ranges */
zlhs = ins->lhs;
if ((zlhs == 0) && triple_is_def(state, ins)) {
@@ -18917,7 +18917,7 @@ static void initialize_live_ranges(
}
if (rinfo.reg == linfo.reg) {
- coalesce_ranges(state, rstate,
+ coalesce_ranges(state, rstate,
lhs->lr, rhs->lr);
}
}
@@ -18927,8 +18927,8 @@ static void initialize_live_ranges(
}
static void graph_ins(
- struct compile_state *state,
- struct reg_block *blocks, struct triple_reg_set *live,
+ struct compile_state *state,
+ struct reg_block *blocks, struct triple_reg_set *live,
struct reg_block *rb, struct triple *ins, void *arg)
{
struct reg_state *rstate = arg;
@@ -18943,7 +18943,7 @@ static void graph_ins(
return;
}
def = rstate->lrd[ins->id].lr;
-
+
/* Create an edge between ins and everything that is
* alive, unless the live_range cannot share
* a physical register with ins.
@@ -18991,8 +18991,8 @@ static struct live_range *get_verify_live_range(
}
static void verify_graph_ins(
- struct compile_state *state,
- struct reg_block *blocks, struct triple_reg_set *live,
+ struct compile_state *state,
+ struct reg_block *blocks, struct triple_reg_set *live,
struct reg_block *rb, struct triple *ins, void *arg)
{
struct reg_state *rstate = arg;
@@ -19013,17 +19013,17 @@ static void verify_graph_ins(
}
lr2 = get_verify_live_range(state, rstate, entry2->member);
if (lr1 == lr2) {
- internal_error(state, entry2->member,
+ internal_error(state, entry2->member,
"live range with 2 values simultaneously alive");
}
if (!arch_regcm_intersect(lr1->classes, lr2->classes)) {
continue;
}
if (!interfere(rstate, lr1, lr2)) {
- internal_error(state, entry2->member,
+ internal_error(state, entry2->member,
"edges don't interfere?");
}
-
+
lr1_found = 0;
lr2_degree = 0;
for(edge2 = lr2->edges; edge2; edge2 = edge2->next) {
@@ -19047,8 +19047,8 @@ static void verify_graph_ins(
#endif
static void print_interference_ins(
- struct compile_state *state,
- struct reg_block *blocks, struct triple_reg_set *live,
+ struct compile_state *state,
+ struct reg_block *blocks, struct triple_reg_set *live,
struct reg_block *rb, struct triple *ins, void *arg)
{
struct reg_state *rstate = arg;
@@ -19118,7 +19118,7 @@ static int coalesce_live_ranges(
* Forcing a value to stay in a single register
* for an extended period of time does have
* limitations when applied to non homogenous
- * register pool.
+ * register pool.
*
* The two cases I have identified are:
* 1) Two forced register assignments may
@@ -19136,7 +19136,7 @@ static int coalesce_live_ranges(
* functions. This creates a 2 headed live
* range that cannot be sanely split.
*
- * - phi functions (coalesced in initialize_live_ranges)
+ * - phi functions (coalesced in initialize_live_ranges)
* are handled as pre split live ranges so we will
* never attempt to split them.
*/
@@ -19186,7 +19186,7 @@ static int coalesce_live_ranges(
if ((lr1->classes & lr2->classes) == 0) {
continue;
}
-
+
if (interfere(rstate, lr1, lr2)) {
continue;
}
@@ -19261,7 +19261,7 @@ static int correct_coalesce_conflicts(
{
int conflicts;
conflicts = 0;
- walk_variable_lifetimes(state, &state->bb, blocks,
+ walk_variable_lifetimes(state, &state->bb, blocks,
fix_coalesce_conflicts, &conflicts);
return conflicts;
}
@@ -19277,7 +19277,7 @@ static void replace_set_use(struct compile_state *state,
}
}
-static void replace_block_use(struct compile_state *state,
+static void replace_block_use(struct compile_state *state,
struct reg_block *blocks, struct triple *orig, struct triple *new)
{
int i;
@@ -19369,7 +19369,7 @@ static struct triple *resolve_tangle(
}
info = find_lhs_color(state, tangle, 0);
SET_INFO(tangle->id, info);
-
+
return copy;
}
@@ -19395,7 +19395,7 @@ static void fix_tangles(struct compile_state *state,
}
reg_inc_used(state, used, info.reg);
}
-
+
/* Now find the least dominated definition of a register in
* conflict I have seen so far.
*/
@@ -19408,7 +19408,7 @@ static void fix_tangles(struct compile_state *state,
/* Changing copies that feed into phi functions
* is incorrect.
*/
- if (set->member->use &&
+ if (set->member->use &&
(set->member->use->member->op == OP_PHI)) {
continue;
}
@@ -19438,7 +19438,7 @@ static int correct_tangles(
int tangles;
tangles = 0;
color_instructions(state);
- walk_variable_lifetimes(state, &state->bb, blocks,
+ walk_variable_lifetimes(state, &state->bb, blocks,
fix_tangles, &tangles);
return tangles;
}
@@ -19469,7 +19469,7 @@ struct triple *find_constrained_def(
if (regcm == info.regcm) {
continue;
}
-
+
/* If there is just one use.
* That use cannot accept a larger register class.
* There are no intervening definitions except
@@ -19480,7 +19480,7 @@ struct triple *find_constrained_def(
#if DEBUG_ROMCC_WARNINGS
#warning "FIXME ignore cases that cannot be fixed (a definition followed by a use)"
#endif
-
+
/* Of the constrained live ranges deal with the
* least dominated one first.
@@ -19489,7 +19489,7 @@ struct triple *find_constrained_def(
fprintf(state->errout, "canidate: %p %-8s regcm: %x %x\n",
lrd->def, tops(lrd->def->op), regcm, info.regcm);
}
- if (!constrained ||
+ if (!constrained ||
tdominates(state, lrd->def, constrained))
{
constrained = lrd->def;
@@ -19499,13 +19499,13 @@ struct triple *find_constrained_def(
}
static int split_constrained_ranges(
- struct compile_state *state, struct reg_state *rstate,
+ struct compile_state *state, struct reg_state *rstate,
struct live_range *range)
{
/* Walk through the edges in conflict and our current live
* range, and find definitions that are more severly constrained
* than they type of data they contain require.
- *
+ *
* Then pick one of those ranges and relax the constraints.
*/
struct live_range_edge *edge;
@@ -19533,14 +19533,14 @@ static int split_constrained_ranges(
}
return !!constrained;
}
-
+
static int split_ranges(
struct compile_state *state, struct reg_state *rstate,
char *used, struct live_range *range)
{
int split;
if (state->compiler->debug & DEBUG_RANGE_CONFLICTS) {
- fprintf(state->errout, "split_ranges %d %s %p\n",
+ fprintf(state->errout, "split_ranges %d %s %p\n",
rstate->passes, tops(range->defs->def->op), range->defs->def);
}
if ((range->color == REG_UNNEEDED) ||
@@ -19550,7 +19550,7 @@ static int split_ranges(
split = split_constrained_ranges(state, rstate, range);
/* Ideally I would split the live range that will not be used
- * for the longest period of time in hopes that this will
+ * for the longest period of time in hopes that this will
* (a) allow me to spill a register or
* (b) allow me to place a value in another register.
*
@@ -19564,7 +19564,7 @@ static int split_ranges(
#if DEBUG_ROMCC_WARNINGS
#warning "WISHLIST implement live range splitting..."
#endif
-
+
if (!split && (state->compiler->debug & DEBUG_RANGE_CONFLICTS2)) {
FILE *fp = state->errout;
print_interference_blocks(state, rstate, fp, 0);
@@ -19616,7 +19616,7 @@ static void cgdebug_loc(struct compile_state *state, struct triple *ins)
}
}
-static int select_free_color(struct compile_state *state,
+static int select_free_color(struct compile_state *state,
struct reg_state *rstate, struct live_range *range)
{
struct triple_set *entry;
@@ -19646,7 +19646,7 @@ static int select_free_color(struct compile_state *state,
for(edge = range->edges; edge; edge = edge->next) {
i++;
}
- cgdebug_printf(state, "\n%s edges: %d",
+ cgdebug_printf(state, "\n%s edges: %d",
tops(range->defs->def->op), i);
cgdebug_loc(state, range->defs->def);
cgdebug_printf(state, "\n");
@@ -19656,7 +19656,7 @@ static int select_free_color(struct compile_state *state,
arch_reg_str(i));
}
}
- }
+ }
/* If a color is already assigned see if it will work */
if (range->color != REG_UNSET) {
@@ -19784,7 +19784,7 @@ static int select_free_color(struct compile_state *state,
* pick the first color that is free.
*/
if (range->color == REG_UNSET) {
- range->color =
+ range->color =
arch_select_free_register(state, used, range->classes);
}
if (range->color == REG_UNSET) {
@@ -19810,7 +19810,7 @@ static int select_free_color(struct compile_state *state,
tops(lrd->def->op), lrd->def);
lrd = lrd->next;
} while(lrd != range->defs);
-
+
warning(state, range->defs->def, "classes: %x",
range->classes);
for(i = 0; i < MAX_REGISTERS; i++) {
@@ -19923,7 +19923,7 @@ static void verify_colors(struct compile_state *state, struct reg_state *rstate)
do {
if (triple_is_def(state, ins)) {
if ((ins->id < 0) || (ins->id > rstate->defs)) {
- internal_error(state, ins,
+ internal_error(state, ins,
"triple without a live range def");
}
lr = rstate->lrd[ins->id].lr;
@@ -19958,7 +19958,7 @@ static void color_triples(struct compile_state *state, struct reg_state *rstate)
ins = first;
do {
if ((ins->id < 0) || (ins->id > rstate->defs)) {
- internal_error(state, ins,
+ internal_error(state, ins,
"triple without a live range");
}
lrd = &rstate->lrd[ins->id];
@@ -19979,7 +19979,7 @@ static struct live_range *merge_sort_lr(
mid = first + size/2;
first = merge_sort_lr(first, mid -1);
mid = merge_sort_lr(mid, last);
-
+
join = 0;
join_tail = &join;
/* merge the two lists */
@@ -20008,7 +20008,7 @@ static struct live_range *merge_sort_lr(
/* Splice the remaining list */
pick = (first)? first : mid;
*join_tail = pick;
- if (pick) {
+ if (pick) {
pick->group_prev = join_tail;
}
}
@@ -20021,7 +20021,7 @@ static struct live_range *merge_sort_lr(
return join;
}
-static void ids_from_rstate(struct compile_state *state,
+static void ids_from_rstate(struct compile_state *state,
struct reg_state *rstate)
{
struct triple *ins, *first;
@@ -20117,14 +20117,14 @@ static void allocate_registers(struct compile_state *state)
tangles = correct_tangles(state, rstate.blocks);
} while(tangles);
-
+
print_blocks(state, "resolve_tangles", state->dbgout);
verify_consistency(state);
-
+
/* Allocate and initialize the live ranges */
initialize_live_ranges(state, &rstate);
- /* Note currently doing coalescing in a loop appears to
+ /* Note currently doing coalescing in a loop appears to
* buys me nothing. The code is left this way in case
* there is some value in it. Or if a future bugfix
* yields some benefit.
@@ -20139,18 +20139,18 @@ static void allocate_registers(struct compile_state *state)
/* Compute the interference graph */
walk_variable_lifetimes(
- state, &state->bb, rstate.blocks,
+ state, &state->bb, rstate.blocks,
graph_ins, &rstate);
-
+
/* Display the interference graph if desired */
if (state->compiler->debug & DEBUG_INTERFERENCE) {
print_interference_blocks(state, &rstate, state->dbgout, 1);
fprintf(state->dbgout, "\nlive variables by instruction\n");
walk_variable_lifetimes(
- state, &state->bb, rstate.blocks,
+ state, &state->bb, rstate.blocks,
print_interference_ins, &rstate);
}
-
+
coalesced = coalesce_live_ranges(state, &rstate);
if (state->compiler->debug & DEBUG_COALESCING) {
@@ -20164,13 +20164,13 @@ static void allocate_registers(struct compile_state *state)
# endif
/* Verify the interference graph */
walk_variable_lifetimes(
- state, &state->bb, rstate.blocks,
+ state, &state->bb, rstate.blocks,
verify_graph_ins, &rstate);
# if 0
fprintf(state->errout, "verify_graph_ins done\n");
#endif
#endif
-
+
/* Build the groups low and high. But with the nodes
* first sorted by degree order.
*/
@@ -20190,13 +20190,13 @@ static void allocate_registers(struct compile_state *state)
struct live_range *range;
next = &(*point)->group_next;
range = *point;
-
+
/* If it has a low degree or it already has a color
* place the node in low.
*/
if ((range->degree < regc_max_size(state, range->classes)) ||
(range->color != REG_UNSET)) {
- cgdebug_printf(state, "Lo: %5d degree %5d%s\n",
+ cgdebug_printf(state, "Lo: %5d degree %5d%s\n",
range - rstate.lr, range->degree,
(range->color != REG_UNSET) ? " (colored)": "");
*range->group_prev = range->group_next;
@@ -20213,7 +20213,7 @@ static void allocate_registers(struct compile_state *state)
next = point;
}
else {
- cgdebug_printf(state, "hi: %5d degree %5d%s\n",
+ cgdebug_printf(state, "hi: %5d degree %5d%s\n",
range - rstate.lr, range->degree,
(range->color != REG_UNSET) ? " (colored)": "");
}
@@ -20306,7 +20306,7 @@ static int is_lattice_lo(struct compile_state *state, struct lattice_node *lnode
return (lnode->val != lnode->def) && !is_scc_const(state, lnode->val);
}
-static void scc_add_fedge(struct compile_state *state, struct scc_state *scc,
+static void scc_add_fedge(struct compile_state *state, struct scc_state *scc,
struct flow_edge *fedge)
{
if (state->compiler->debug & DEBUG_SCC_TRANSFORM2) {
@@ -20436,12 +20436,12 @@ static void initialize_scc_state(
ins_count, ssa_edge_count, state->bb.last_vertex);
}
scc->ins_count = ins_count;
- scc->lattice =
+ scc->lattice =
xcmalloc(sizeof(*scc->lattice)*(ins_count + 1), "lattice");
- scc->ssa_edges =
+ scc->ssa_edges =
xcmalloc(sizeof(*scc->ssa_edges)*(ssa_edge_count + 1), "ssa_edges");
- scc->flow_blocks =
- xcmalloc(sizeof(*scc->flow_blocks)*(state->bb.last_vertex + 1),
+ scc->flow_blocks =
+ xcmalloc(sizeof(*scc->flow_blocks)*(state->bb.last_vertex + 1),
"flow_blocks");
/* Initialize pass one collect up the nodes */
@@ -20580,7 +20580,7 @@ static void initialize_scc_state(
fedge->out_next = 0;
fedge->executable = 0;
fedge->dst->in = fedge;
-
+
/* Initialize the work lists */
scc->flow_work_list = 0;
scc->ssa_work_list = 0;
@@ -20592,7 +20592,7 @@ static void initialize_scc_state(
}
}
-
+
static void free_scc_state(
struct compile_state *state, struct scc_state *scc)
{
@@ -20608,7 +20608,7 @@ static void free_scc_state(
xfree(scc->flow_blocks);
xfree(scc->ssa_edges);
xfree(scc->lattice);
-
+
}
static struct lattice_node *triple_to_lattice(
@@ -20637,7 +20637,7 @@ static struct triple *preserve_lval(
return old;
}
-static int lval_changed(struct compile_state *state,
+static int lval_changed(struct compile_state *state,
struct triple *old, struct lattice_node *lnode)
{
int changed;
@@ -20672,7 +20672,7 @@ static void scc_debug_lnode(
struct triple *val, **expr;
val = lnode->val? lnode->val : lnode->def;
fprintf(fp, "%p %s %3d %10s (",
- lnode->def,
+ lnode->def,
((lnode->def->op == OP_PHI)? "phi: ": "expr:"),
lnode->def->id,
tops(lnode->def->op));
@@ -20700,7 +20700,7 @@ static int compute_lnode_val(struct compile_state *state, struct scc_state *scc,
struct triple *old, *scratch;
struct triple **dexpr, **vexpr;
int count, i;
-
+
/* Store the original value */
old = preserve_lval(state, lnode);
@@ -20757,9 +20757,9 @@ static int compute_lnode_val(struct compile_state *state, struct scc_state *scc,
lnode->val = 0; /* Lattice low by definition */
}
/* Find the case when I am lattice high */
- if (lnode->val &&
+ if (lnode->val &&
(lnode->val->op == lnode->def->op) &&
- (memcmp(lnode->val->param, lnode->def->param,
+ (memcmp(lnode->val->param, lnode->def->param,
count * sizeof(lnode->val->param[0])) == 0) &&
(memcmp(&lnode->val->u, &lnode->def->u, sizeof(lnode->def->u)) == 0)) {
lnode->val = lnode->def;
@@ -20782,7 +20782,7 @@ static int compute_lnode_val(struct compile_state *state, struct scc_state *scc,
}
}
/* Find the cases that are always lattice lo */
- if (lnode->val &&
+ if (lnode->val &&
triple_is_def(state, lnode->val) &&
!triple_is_pure(state, lnode->val, lnode->old_id)) {
lnode->val = 0;
@@ -20790,7 +20790,7 @@ static int compute_lnode_val(struct compile_state *state, struct scc_state *scc,
/* See if the lattice value has changed */
changed = lval_changed(state, old, lnode);
/* See if this value should not change */
- if ((lnode->val != lnode->def) &&
+ if ((lnode->val != lnode->def) &&
(( !triple_is_def(state, lnode->def) &&
!triple_is_cbranch(state, lnode->def)) ||
(lnode->def->op == OP_PIECE))) {
@@ -20807,7 +20807,7 @@ static int compute_lnode_val(struct compile_state *state, struct scc_state *scc,
if (lnode->val != scratch) {
xfree(scratch);
}
-
+
return changed;
}
@@ -20834,7 +20834,7 @@ static void scc_visit_cbranch(struct compile_state *state, struct scc_state *scc
fprintf(fp, "%s: %d (",
tops(lnode->def->op),
lnode->def->id);
-
+
for(fedge = lnode->fblock->out; fedge; fedge = fedge->out_next) {
fprintf(fp, " %d", fedge->dst->block->vertex);
}
@@ -20882,7 +20882,7 @@ static void scc_visit_cbranch(struct compile_state *state, struct scc_state *scc
}
-static void scc_add_sedge_dst(struct compile_state *state,
+static void scc_add_sedge_dst(struct compile_state *state,
struct scc_state *scc, struct ssa_edge *sedge)
{
if (triple_is_cbranch(state, sedge->dst->def)) {
@@ -20893,7 +20893,7 @@ static void scc_add_sedge_dst(struct compile_state *state,
}
}
-static void scc_visit_phi(struct compile_state *state, struct scc_state *scc,
+static void scc_visit_phi(struct compile_state *state, struct scc_state *scc,
struct lattice_node *lnode)
{
struct lattice_node *tmp;
@@ -20913,7 +20913,7 @@ static void scc_visit_phi(struct compile_state *state, struct scc_state *scc,
index = 0;
for(fedge = lnode->fblock->in; fedge; index++, fedge = fedge->in_next) {
if (state->compiler->debug & DEBUG_SCC_TRANSFORM) {
- fprintf(state->errout, "Examining edge: %d vertex: %d executable: %d\n",
+ fprintf(state->errout, "Examining edge: %d vertex: %d executable: %d\n",
index,
fedge->dst->block->vertex,
fedge->executable
@@ -21001,14 +21001,14 @@ static void scc_writeback_values(
struct flow_edge *fedge;
int executable;
executable = 0;
- for(fedge = lnode->fblock->in;
+ for(fedge = lnode->fblock->in;
!executable && fedge; fedge = fedge->in_next) {
executable |= fedge->executable;
}
if (executable) {
internal_warning(state, lnode->def,
"lattice node %d %s->%s still high?",
- ins->id,
+ ins->id,
tops(lnode->def->op),
tops(lnode->val->op));
}
@@ -21024,7 +21024,7 @@ static void scc_writeback_values(
mkconst(state, ins, lnode->val->u.cval);
break;
case OP_ADDRCONST:
- mkaddr_const(state, ins,
+ mkaddr_const(state, ins,
MISC(lnode->val, 0), lnode->val->u.cval);
break;
default:
@@ -21083,9 +21083,9 @@ static void scc_transform(struct compile_state *state)
reps++;
}
}
-
+
if (state->compiler->debug & DEBUG_SCC_TRANSFORM) {
- fprintf(state->errout, "vertex: %d reps: %d\n",
+ fprintf(state->errout, "vertex: %d reps: %d\n",
block->vertex, reps);
}
@@ -21138,11 +21138,11 @@ static void scc_transform(struct compile_state *state)
}
}
}
-
+
scc_writeback_values(state, &scc);
free_scc_state(state, &scc);
rebuild_ssa_form(state);
-
+
print_blocks(state, __func__, state->dbgout);
}
@@ -21155,7 +21155,7 @@ static void transform_to_arch_instructions(struct compile_state *state)
do {
ins = transform_to_arch_instruction(state, ins);
} while(ins != first);
-
+
print_blocks(state, __func__, state->dbgout);
}
@@ -21226,7 +21226,7 @@ static void verify_uses(struct compile_state *state)
}
ins = ins->next;
} while(ins != first);
-
+
}
static void verify_blocks_present(struct compile_state *state)
{
@@ -21240,14 +21240,14 @@ static void verify_blocks_present(struct compile_state *state)
valid_ins(state, ins);
if (triple_stores_block(state, ins)) {
if (!ins->u.block) {
- internal_error(state, ins,
+ internal_error(state, ins,
"%p not in a block?", ins);
}
}
ins = ins->next;
} while(ins != first);
-
-
+
+
}
static int edge_present(struct compile_state *state, struct block *block, struct triple *edge)
@@ -21332,12 +21332,12 @@ static void verify_blocks(struct compile_state *state)
}
}
if (block->users != users) {
- internal_error(state, block->first,
+ internal_error(state, block->first,
"computed users %d != stored users %d",
users, block->users);
}
if (!triple_stores_block(state, block->last->next)) {
- internal_error(state, block->last->next,
+ internal_error(state, block->last->next,
"cannot find next block");
}
block = block->last->next->u.block;
@@ -21359,7 +21359,7 @@ static void verify_domination(struct compile_state *state)
if (!state->bb.first_block) {
return;
}
-
+
first = state->first;
ins = first;
do {
@@ -21386,7 +21386,7 @@ static void verify_domination(struct compile_state *state)
bset = bset->next;
}
if (!bset) {
- internal_error(state, set->member,
+ internal_error(state, set->member,
"no edge for phi rhs %d", i);
}
use_point = bset->member->last;
@@ -21395,11 +21395,11 @@ static void verify_domination(struct compile_state *state)
if (use_point &&
!tdominates(state, ins, use_point)) {
if (is_const(ins)) {
- internal_warning(state, ins,
+ internal_warning(state, ins,
"non dominated rhs use point %p?", use_point);
}
else {
- internal_error(state, ins,
+ internal_error(state, ins,
"non dominated rhs use point %p?", use_point);
}
}
@@ -21464,7 +21464,7 @@ static void verify_piece(struct compile_state *state)
static void verify_ins_colors(struct compile_state *state)
{
struct triple *first, *ins;
-
+
first = state->first;
ins = first;
do {
@@ -21581,7 +21581,7 @@ static void verify_consistency(struct compile_state *state)
fprintf(state->dbgout, "consistency verified\n");
}
}
-#else
+#else
static void verify_consistency(struct compile_state *state) {}
#endif /* DEBUG_CONSISTENCY */
@@ -21694,7 +21694,7 @@ static void print_op_asm(struct compile_state *state,
param);
}
piece = (param < lhs)? LHS(ins, param) : RHS(ins, param - lhs);
- fprintf(fp, "%s",
+ fprintf(fp, "%s",
arch_reg_str(ID_REG(piece->id)));
ptr = next -1;
}
@@ -21954,14 +21954,14 @@ static int arch_regcm_intersect(unsigned regcm1, unsigned regcm2)
{
/* See if two register classes may have overlapping registers */
unsigned gpr_mask = REGCM_GPR8 | REGCM_GPR8_LO | REGCM_GPR16_8 | REGCM_GPR16 |
- REGCM_GPR32_8 | REGCM_GPR32 |
+ REGCM_GPR32_8 | REGCM_GPR32 |
REGCM_DIVIDEND32 | REGCM_DIVIDEND64;
/* Special case for the immediates */
if ((regcm1 & (REGCM_IMM32 | REGCM_IMM16 | REGCM_IMM8)) &&
((regcm1 & ~(REGCM_IMM32 | REGCM_IMM16 | REGCM_IMM8)) == 0) &&
(regcm2 & (REGCM_IMM32 | REGCM_IMM16 | REGCM_IMM8)) &&
- ((regcm2 & ~(REGCM_IMM32 | REGCM_IMM16 | REGCM_IMM8)) == 0)) {
+ ((regcm2 & ~(REGCM_IMM32 | REGCM_IMM16 | REGCM_IMM8)) == 0)) {
return 0;
}
return (regcm1 & regcm2) ||
@@ -21994,7 +21994,7 @@ static void arch_reg_equivs(
*equiv++ = REG_DXAX;
*equiv++ = REG_EDXEAX;
break;
- case REG_BL:
+ case REG_BL:
#if X86_4_8BIT_GPRS
*equiv++ = REG_BH;
#endif
@@ -22054,19 +22054,19 @@ static void arch_reg_equivs(
*equiv++ = REG_BH;
*equiv++ = REG_EBX;
break;
- case REG_CX:
+ case REG_CX:
*equiv++ = REG_CL;
*equiv++ = REG_CH;
*equiv++ = REG_ECX;
break;
- case REG_DX:
+ case REG_DX:
*equiv++ = REG_DL;
*equiv++ = REG_DH;
*equiv++ = REG_EDX;
*equiv++ = REG_DXAX;
*equiv++ = REG_EDXEAX;
break;
- case REG_SI:
+ case REG_SI:
*equiv++ = REG_ESI;
break;
case REG_DI:
@@ -22102,19 +22102,19 @@ static void arch_reg_equivs(
*equiv++ = REG_DXAX;
*equiv++ = REG_EDXEAX;
break;
- case REG_ESI:
+ case REG_ESI:
*equiv++ = REG_SI;
break;
- case REG_EDI:
+ case REG_EDI:
*equiv++ = REG_DI;
break;
- case REG_EBP:
+ case REG_EBP:
*equiv++ = REG_BP;
break;
- case REG_ESP:
+ case REG_ESP:
*equiv++ = REG_SP;
break;
- case REG_DXAX:
+ case REG_DXAX:
*equiv++ = REG_AL;
*equiv++ = REG_AH;
*equiv++ = REG_DL;
@@ -22125,7 +22125,7 @@ static void arch_reg_equivs(
*equiv++ = REG_EDX;
*equiv++ = REG_EDXEAX;
break;
- case REG_EDXEAX:
+ case REG_EDXEAX:
*equiv++ = REG_AL;
*equiv++ = REG_AH;
*equiv++ = REG_DL;
@@ -22137,15 +22137,15 @@ static void arch_reg_equivs(
*equiv++ = REG_DXAX;
break;
}
- *equiv++ = REG_UNSET;
+ *equiv++ = REG_UNSET;
}
static unsigned arch_avail_mask(struct compile_state *state)
{
unsigned avail_mask;
/* REGCM_GPR8 is not available */
- avail_mask = REGCM_GPR8_LO | REGCM_GPR16_8 | REGCM_GPR16 |
- REGCM_GPR32 | REGCM_GPR32_8 |
+ avail_mask = REGCM_GPR8_LO | REGCM_GPR16_8 | REGCM_GPR16 |
+ REGCM_GPR32 | REGCM_GPR32_8 |
REGCM_DIVIDEND32 | REGCM_DIVIDEND64 |
REGCM_IMM32 | REGCM_IMM16 | REGCM_IMM8 | REGCM_FLAGS;
if (state->arch->features & X86_MMX_REGS) {
@@ -22188,7 +22188,7 @@ static unsigned arch_regcm_reg_normalize(struct compile_state *state, unsigned r
/* Remove the immediate register classes */
regcm &= ~(REGCM_IMM32 | REGCM_IMM16 | REGCM_IMM8);
return regcm;
-
+
}
static unsigned arch_reg_regcm(struct compile_state *state, int reg)
@@ -22332,7 +22332,7 @@ static struct reg_info arch_reg_clobber(
return result;
}
-static int do_select_reg(struct compile_state *state,
+static int do_select_reg(struct compile_state *state,
char *used, int reg, unsigned classes)
{
unsigned mask;
@@ -22357,7 +22357,7 @@ static int arch_select_free_register(
* increase the odds the register allocator will work when
* it guesses first give out registers from register classes
* least likely to run out of registers.
- *
+ *
*/
int i, reg;
reg = REG_UNSET;
@@ -22392,7 +22392,7 @@ static int arch_select_free_register(
}
-static unsigned arch_type_to_regcm(struct compile_state *state, struct type *type)
+static unsigned arch_type_to_regcm(struct compile_state *state, struct type *type)
{
#if DEBUG_ROMCC_WARNINGS
@@ -22402,13 +22402,13 @@ static unsigned arch_type_to_regcm(struct compile_state *state, struct type *typ
mask = 0;
switch(type->type & TYPE_MASK) {
case TYPE_ARRAY:
- case TYPE_VOID:
- mask = 0;
+ case TYPE_VOID:
+ mask = 0;
break;
case TYPE_CHAR:
case TYPE_UCHAR:
mask = REGCM_GPR8 | REGCM_GPR8_LO |
- REGCM_GPR16 | REGCM_GPR16_8 |
+ REGCM_GPR16 | REGCM_GPR16_8 |
REGCM_GPR32 | REGCM_GPR32_8 |
REGCM_DIVIDEND32 | REGCM_DIVIDEND64 |
REGCM_MMX | REGCM_XMM |
@@ -22462,7 +22462,7 @@ static int is_imm32(struct triple *imm)
// always true.
return ((imm->op == OP_INTCONST) /* && (imm->u.cval <= 0xffffffffUL) */ ) ||
(imm->op == OP_ADDRCONST);
-
+
}
static int is_imm16(struct triple *imm)
{
@@ -22578,13 +22578,13 @@ static int get_imm8(struct triple *ins, struct triple **expr)
#endif
#define COPY8_REGCM (REGCM_DIVIDEND64 | REGCM_DIVIDEND32 | REGCM_GPR32 | REGCM_GPR16 | REGCM_GPR8_LO | REGCM_MMX | REGCM_XMM)
-#define COPY16_REGCM (REGCM_DIVIDEND64 | REGCM_DIVIDEND32 | REGCM_GPR32 | REGCM_GPR16 | REGCM_MMX | REGCM_XMM)
+#define COPY16_REGCM (REGCM_DIVIDEND64 | REGCM_DIVIDEND32 | REGCM_GPR32 | REGCM_GPR16 | REGCM_MMX | REGCM_XMM)
#define COPY32_REGCM (REGCM_DIVIDEND64 | REGCM_DIVIDEND32 | REGCM_GPR32 | REGCM_MMX | REGCM_XMM)
static struct ins_template templates[] = {
[TEMPLATE_NOP] = {
- .lhs = {
+ .lhs = {
[ 0] = { REG_UNNEEDED, REGCM_IMMALL },
[ 1] = { REG_UNNEEDED, REGCM_IMMALL },
[ 2] = { REG_UNNEEDED, REGCM_IMMALL },
@@ -22651,10 +22651,10 @@ static struct ins_template templates[] = {
[63] = { REG_UNNEEDED, REGCM_IMMALL },
},
},
- [TEMPLATE_INTCONST8] = {
+ [TEMPLATE_INTCONST8] = {
.lhs = { [0] = { REG_UNNEEDED, REGCM_IMM8 } },
},
- [TEMPLATE_INTCONST32] = {
+ [TEMPLATE_INTCONST32] = {
.lhs = { [0] = { REG_UNNEEDED, REGCM_IMM32 } },
},
[TEMPLATE_UNKNOWNVAL] = {
@@ -22684,32 +22684,32 @@ static struct ins_template templates[] = {
.lhs = { [0] = { REG_UNSET, COPY32_REGCM } },
.rhs = { [0] = { REG_UNNEEDED, REGCM_IMM32 | REGCM_IMM16 | REGCM_IMM8 } },
},
- [TEMPLATE_PHI8] = {
+ [TEMPLATE_PHI8] = {
.lhs = { [0] = { REG_VIRT0, COPY8_REGCM } },
.rhs = { [0] = { REG_VIRT0, COPY8_REGCM } },
},
- [TEMPLATE_PHI16] = {
+ [TEMPLATE_PHI16] = {
.lhs = { [0] = { REG_VIRT0, COPY16_REGCM } },
- .rhs = { [0] = { REG_VIRT0, COPY16_REGCM } },
+ .rhs = { [0] = { REG_VIRT0, COPY16_REGCM } },
},
- [TEMPLATE_PHI32] = {
+ [TEMPLATE_PHI32] = {
.lhs = { [0] = { REG_VIRT0, COPY32_REGCM } },
- .rhs = { [0] = { REG_VIRT0, COPY32_REGCM } },
+ .rhs = { [0] = { REG_VIRT0, COPY32_REGCM } },
},
[TEMPLATE_STORE8] = {
- .rhs = {
+ .rhs = {
[0] = { REG_UNSET, REGCM_GPR32 },
[1] = { REG_UNSET, REGCM_GPR8_LO },
},
},
[TEMPLATE_STORE16] = {
- .rhs = {
+ .rhs = {
[0] = { REG_UNSET, REGCM_GPR32 },
[1] = { REG_UNSET, REGCM_GPR16 },
},
},
[TEMPLATE_STORE32] = {
- .rhs = {
+ .rhs = {
[0] = { REG_UNSET, REGCM_GPR32 },
[1] = { REG_UNSET, REGCM_GPR32 },
},
@@ -22728,84 +22728,84 @@ static struct ins_template templates[] = {
},
[TEMPLATE_BINARY8_REG] = {
.lhs = { [0] = { REG_VIRT0, REGCM_GPR8_LO } },
- .rhs = {
+ .rhs = {
[0] = { REG_VIRT0, REGCM_GPR8_LO },
[1] = { REG_UNSET, REGCM_GPR8_LO },
},
},
[TEMPLATE_BINARY16_REG] = {
.lhs = { [0] = { REG_VIRT0, REGCM_GPR16 } },
- .rhs = {
+ .rhs = {
[0] = { REG_VIRT0, REGCM_GPR16 },
[1] = { REG_UNSET, REGCM_GPR16 },
},
},
[TEMPLATE_BINARY32_REG] = {
.lhs = { [0] = { REG_VIRT0, REGCM_GPR32 } },
- .rhs = {
+ .rhs = {
[0] = { REG_VIRT0, REGCM_GPR32 },
[1] = { REG_UNSET, REGCM_GPR32 },
},
},
[TEMPLATE_BINARY8_IMM] = {
.lhs = { [0] = { REG_VIRT0, REGCM_GPR8_LO } },
- .rhs = {
+ .rhs = {
[0] = { REG_VIRT0, REGCM_GPR8_LO },
[1] = { REG_UNNEEDED, REGCM_IMM8 },
},
},
[TEMPLATE_BINARY16_IMM] = {
.lhs = { [0] = { REG_VIRT0, REGCM_GPR16 } },
- .rhs = {
+ .rhs = {
[0] = { REG_VIRT0, REGCM_GPR16 },
[1] = { REG_UNNEEDED, REGCM_IMM16 },
},
},
[TEMPLATE_BINARY32_IMM] = {
.lhs = { [0] = { REG_VIRT0, REGCM_GPR32 } },
- .rhs = {
+ .rhs = {
[0] = { REG_VIRT0, REGCM_GPR32 },
[1] = { REG_UNNEEDED, REGCM_IMM32 },
},
},
[TEMPLATE_SL8_CL] = {
.lhs = { [0] = { REG_VIRT0, REGCM_GPR8_LO } },
- .rhs = {
+ .rhs = {
[0] = { REG_VIRT0, REGCM_GPR8_LO },
[1] = { REG_CL, REGCM_GPR8_LO },
},
},
[TEMPLATE_SL16_CL] = {
.lhs = { [0] = { REG_VIRT0, REGCM_GPR16 } },
- .rhs = {
+ .rhs = {
[0] = { REG_VIRT0, REGCM_GPR16 },
[1] = { REG_CL, REGCM_GPR8_LO },
},
},
[TEMPLATE_SL32_CL] = {
.lhs = { [0] = { REG_VIRT0, REGCM_GPR32 } },
- .rhs = {
+ .rhs = {
[0] = { REG_VIRT0, REGCM_GPR32 },
[1] = { REG_CL, REGCM_GPR8_LO },
},
},
[TEMPLATE_SL8_IMM] = {
.lhs = { [0] = { REG_VIRT0, REGCM_GPR8_LO } },
- .rhs = {
+ .rhs = {
[0] = { REG_VIRT0, REGCM_GPR8_LO },
[1] = { REG_UNNEEDED, REGCM_IMM8 },
},
},
[TEMPLATE_SL16_IMM] = {
.lhs = { [0] = { REG_VIRT0, REGCM_GPR16 } },
- .rhs = {
+ .rhs = {
[0] = { REG_VIRT0, REGCM_GPR16 },
[1] = { REG_UNNEEDED, REGCM_IMM8 },
},
},
[TEMPLATE_SL32_IMM] = {
.lhs = { [0] = { REG_VIRT0, REGCM_GPR32 } },
- .rhs = {
+ .rhs = {
[0] = { REG_VIRT0, REGCM_GPR32 },
[1] = { REG_UNNEEDED, REGCM_IMM8 },
},
@@ -22887,19 +22887,19 @@ static struct ins_template templates[] = {
.rhs = { [0] = { REG_UNSET, REGCM_GPR32 } },
},
[TEMPLATE_INB_DX] = {
- .lhs = { [0] = { REG_AL, REGCM_GPR8_LO } },
+ .lhs = { [0] = { REG_AL, REGCM_GPR8_LO } },
.rhs = { [0] = { REG_DX, REGCM_GPR16 } },
},
[TEMPLATE_INB_IMM] = {
- .lhs = { [0] = { REG_AL, REGCM_GPR8_LO } },
+ .lhs = { [0] = { REG_AL, REGCM_GPR8_LO } },
.rhs = { [0] = { REG_UNNEEDED, REGCM_IMM8 } },
},
- [TEMPLATE_INW_DX] = {
- .lhs = { [0] = { REG_AX, REGCM_GPR16 } },
+ [TEMPLATE_INW_DX] = {
+ .lhs = { [0] = { REG_AX, REGCM_GPR16 } },
.rhs = { [0] = { REG_DX, REGCM_GPR16 } },
},
- [TEMPLATE_INW_IMM] = {
- .lhs = { [0] = { REG_AX, REGCM_GPR16 } },
+ [TEMPLATE_INW_IMM] = {
+ .lhs = { [0] = { REG_AX, REGCM_GPR16 } },
.rhs = { [0] = { REG_UNNEEDED, REGCM_IMM8 } },
},
[TEMPLATE_INL_DX] = {
@@ -22910,19 +22910,19 @@ static struct ins_template templates[] = {
.lhs = { [0] = { REG_EAX, REGCM_GPR32 } },
.rhs = { [0] = { REG_UNNEEDED, REGCM_IMM8 } },
},
- [TEMPLATE_OUTB_DX] = {
+ [TEMPLATE_OUTB_DX] = {
.rhs = {
[0] = { REG_AL, REGCM_GPR8_LO },
[1] = { REG_DX, REGCM_GPR16 },
},
},
- [TEMPLATE_OUTB_IMM] = {
+ [TEMPLATE_OUTB_IMM] = {
.rhs = {
- [0] = { REG_AL, REGCM_GPR8_LO },
+ [0] = { REG_AL, REGCM_GPR8_LO },
[1] = { REG_UNNEEDED, REGCM_IMM8 },
},
},
- [TEMPLATE_OUTW_DX] = {
+ [TEMPLATE_OUTW_DX] = {
.rhs = {
[0] = { REG_AX, REGCM_GPR16 },
[1] = { REG_DX, REGCM_GPR16 },
@@ -22930,19 +22930,19 @@ static struct ins_template templates[] = {
},
[TEMPLATE_OUTW_IMM] = {
.rhs = {
- [0] = { REG_AX, REGCM_GPR16 },
+ [0] = { REG_AX, REGCM_GPR16 },
[1] = { REG_UNNEEDED, REGCM_IMM8 },
},
},
- [TEMPLATE_OUTL_DX] = {
+ [TEMPLATE_OUTL_DX] = {
.rhs = {
[0] = { REG_EAX, REGCM_GPR32 },
[1] = { REG_DX, REGCM_GPR16 },
},
},
- [TEMPLATE_OUTL_IMM] = {
+ [TEMPLATE_OUTL_IMM] = {
.rhs = {
- [0] = { REG_EAX, REGCM_GPR32 },
+ [0] = { REG_EAX, REGCM_GPR32 },
[1] = { REG_UNNEEDED, REGCM_IMM8 },
},
},
@@ -22951,7 +22951,7 @@ static struct ins_template templates[] = {
.rhs = { [0] = { REG_UNSET, REGCM_GPR32 } },
},
[TEMPLATE_RDMSR] = {
- .lhs = {
+ .lhs = {
[0] = { REG_EAX, REGCM_GPR32 },
[1] = { REG_EDX, REGCM_GPR32 },
},
@@ -22966,27 +22966,27 @@ static struct ins_template templates[] = {
},
[TEMPLATE_UMUL8] = {
.lhs = { [0] = { REG_AX, REGCM_GPR16 } },
- .rhs = {
+ .rhs = {
[0] = { REG_AL, REGCM_GPR8_LO },
[1] = { REG_UNSET, REGCM_GPR8_LO },
},
},
[TEMPLATE_UMUL16] = {
.lhs = { [0] = { REG_DXAX, REGCM_DIVIDEND32 } },
- .rhs = {
+ .rhs = {
[0] = { REG_AX, REGCM_GPR16 },
[1] = { REG_UNSET, REGCM_GPR16 },
},
},
[TEMPLATE_UMUL32] = {
.lhs = { [0] = { REG_EDXEAX, REGCM_DIVIDEND64 } },
- .rhs = {
+ .rhs = {
[0] = { REG_EAX, REGCM_GPR32 },
[1] = { REG_UNSET, REGCM_GPR32 },
},
},
[TEMPLATE_DIV8] = {
- .lhs = {
+ .lhs = {
[0] = { REG_AL, REGCM_GPR8_LO },
[1] = { REG_AH, REGCM_GPR8 },
},
@@ -22996,7 +22996,7 @@ static struct ins_template templates[] = {
},
},
[TEMPLATE_DIV16] = {
- .lhs = {
+ .lhs = {
[0] = { REG_AX, REGCM_GPR16 },
[1] = { REG_DX, REGCM_GPR16 },
},
@@ -23006,7 +23006,7 @@ static struct ins_template templates[] = {
},
},
[TEMPLATE_DIV32] = {
- .lhs = {
+ .lhs = {
[0] = { REG_EAX, REGCM_GPR32 },
[1] = { REG_EDX, REGCM_GPR32 },
},
@@ -23027,7 +23027,7 @@ static void fixup_branch(struct compile_state *state,
}
test = pre_triple(state, branch,
cmp_op, cmp_type, left, right);
- test->template_id = TEMPLATE_TEST32;
+ test->template_id = TEMPLATE_TEST32;
if (cmp_op == OP_CMP) {
test->template_id = TEMPLATE_CMP32_REG;
if (get_imm32(test, &RHS(test, 1))) {
@@ -23061,13 +23061,13 @@ static void fixup_branches(struct compile_state *state,
right = RHS(cmp, 1);
}
branch = entry->member;
- fixup_branch(state, branch, jmp_op,
+ fixup_branch(state, branch, jmp_op,
cmp->op, cmp->type, left, right);
}
}
}
-static void bool_cmp(struct compile_state *state,
+static void bool_cmp(struct compile_state *state,
struct triple *ins, int cmp_op, int jmp_op, int set_op)
{
struct triple_set *entry, *next;
@@ -23134,7 +23134,7 @@ struct reg_info arch_reg_lhs(struct compile_state *state, struct triple *ins, in
break;
default:
if (ins->template_id > LAST_TEMPLATE) {
- internal_error(state, ins, "bad template number %d",
+ internal_error(state, ins, "bad template number %d",
ins->template_id);
}
template = &templates[ins->template_id];
@@ -23169,7 +23169,7 @@ struct reg_info arch_reg_rhs(struct compile_state *state, struct triple *ins, in
/* Fall through */
default:
if (ins->template_id > LAST_TEMPLATE) {
- internal_error(state, ins, "bad template number %d",
+ internal_error(state, ins, "bad template number %d",
ins->template_id);
}
template = &templates[ins->template_id];
@@ -23187,7 +23187,7 @@ static struct triple *mod_div(struct compile_state *state,
struct triple *ins, int div_op, int index)
{
struct triple *div, *piece0, *piece1;
-
+
/* Generate the appropriate division instruction */
div = post_triple(state, ins, div_op, ins->type, 0, 0);
RHS(div, 0) = RHS(ins, 0);
@@ -23497,8 +23497,8 @@ static struct triple *transform_to_arch_instruction(
case OP_NEG:
ins->template_id = TEMPLATE_UNARY32;
break;
- case OP_EQ:
- bool_cmp(state, ins, OP_CMP, OP_JMP_EQ, OP_SET_EQ);
+ case OP_EQ:
+ bool_cmp(state, ins, OP_CMP, OP_JMP_EQ, OP_SET_EQ);
break;
case OP_NOTEQ:
bool_cmp(state, ins, OP_CMP, OP_JMP_NOTEQ, OP_SET_NOTEQ);
@@ -23538,7 +23538,7 @@ static struct triple *transform_to_arch_instruction(
ins->template_id = TEMPLATE_NOP;
break;
case OP_CBRANCH:
- fixup_branch(state, ins, OP_JMP_NOTEQ, OP_TEST,
+ fixup_branch(state, ins, OP_JMP_NOTEQ, OP_TEST,
RHS(ins, 0)->type, RHS(ins, 0), 0);
break;
case OP_CALL:
@@ -23644,20 +23644,20 @@ static void generate_local_labels(struct compile_state *state)
first = state->first;
label = first;
do {
- if ((label->op == OP_LABEL) ||
+ if ((label->op == OP_LABEL) ||
(label->op == OP_SDECL)) {
if (label->use) {
label->u.cval = next_label(state);
} else {
label->u.cval = 0;
}
-
+
}
label = label->next;
} while(label != first);
}
-static int check_reg(struct compile_state *state,
+static int check_reg(struct compile_state *state,
struct triple *triple, int classes)
{
unsigned mask;
@@ -23688,7 +23688,7 @@ static const char *arch_regs[] = {
"%edx:%eax",
"%dx:%ax",
"%mm0", "%mm1", "%mm2", "%mm3", "%mm4", "%mm5", "%mm6", "%mm7",
- "%xmm0", "%xmm1", "%xmm2", "%xmm3",
+ "%xmm0", "%xmm1", "%xmm2", "%xmm3",
"%xmm4", "%xmm5", "%xmm6", "%xmm7",
};
static const char *arch_reg_str(int reg)
@@ -23747,7 +23747,7 @@ static int reg_size(struct compile_state *state, struct triple *ins)
}
return arch_reg_size(reg);
}
-
+
const char *type_suffix(struct compile_state *state, struct type *type)
@@ -23770,7 +23770,7 @@ static void print_const_val(
{
switch(ins->op) {
case OP_INTCONST:
- fprintf(fp, " $%ld ",
+ fprintf(fp, " $%ld ",
(long)(ins->u.cval));
break;
case OP_ADDRCONST:
@@ -23783,7 +23783,7 @@ static void print_const_val(
internal_error(state, ins, "unlabeled constant");
}
fprintf(fp, " $L%s%lu+%lu ",
- state->compiler->label_prefix,
+ state->compiler->label_prefix,
(unsigned long)(MISC(ins, 0)->u.cval),
(unsigned long)(ins->u.cval));
break;
@@ -23801,12 +23801,12 @@ static void print_const(struct compile_state *state,
switch(ins->type->type & TYPE_MASK) {
case TYPE_CHAR:
case TYPE_UCHAR:
- fprintf(fp, ".byte 0x%02lx\n",
+ fprintf(fp, ".byte 0x%02lx\n",
(unsigned long)(ins->u.cval));
break;
case TYPE_SHORT:
case TYPE_USHORT:
- fprintf(fp, ".short 0x%04lx\n",
+ fprintf(fp, ".short 0x%04lx\n",
(unsigned long)(ins->u.cval));
break;
case TYPE_INT:
@@ -23814,7 +23814,7 @@ static void print_const(struct compile_state *state,
case TYPE_LONG:
case TYPE_ULONG:
case TYPE_POINTER:
- fprintf(fp, ".int %lu\n",
+ fprintf(fp, ".int %lu\n",
(unsigned long)(ins->u.cval));
break;
default:
@@ -23824,7 +23824,7 @@ static void print_const(struct compile_state *state,
internal_error(state, ins, "Unknown constant type. Val: %lu",
(unsigned long)(ins->u.cval));
}
-
+
break;
case OP_ADDRCONST:
if ((MISC(ins, 0)->op != OP_SDECL) &&
@@ -23896,7 +23896,7 @@ static long get_mask_pool_ref(
}
static void print_binary_op(struct compile_state *state,
- const char *op, struct triple *ins, FILE *fp)
+ const char *op, struct triple *ins, FILE *fp)
{
unsigned mask;
mask = REGCM_GPR32 | REGCM_GPR16 | REGCM_GPR8_LO;
@@ -23923,7 +23923,7 @@ static void print_binary_op(struct compile_state *state,
reg(state, RHS(ins, 0), mask));
}
}
-static void print_unary_op(struct compile_state *state,
+static void print_unary_op(struct compile_state *state,
const char *op, struct triple *ins, FILE *fp)
{
unsigned mask;
@@ -23987,7 +23987,7 @@ static void print_op_in(struct compile_state *state, struct triple *ins, FILE *f
internal_error(state, ins, "src != %%dx");
}
fprintf(fp, "\t%s %s, %s\n",
- op,
+ op,
reg(state, RHS(ins, 0), REGCM_GPR16),
reg(state, ins, mask));
}
@@ -24013,7 +24013,7 @@ static void print_op_out(struct compile_state *state, struct triple *ins, FILE *
internal_error(state, ins, "src != %%eax");
}
if (is_const(RHS(ins, 1))) {
- fprintf(fp, "\t%s %s,",
+ fprintf(fp, "\t%s %s,",
op, reg(state, RHS(ins, 0), mask));
print_const_val(state, RHS(ins, 1), fp);
fprintf(fp, "\n");
@@ -24025,7 +24025,7 @@ static void print_op_out(struct compile_state *state, struct triple *ins, FILE *
internal_error(state, ins, "dst != %%dx");
}
fprintf(fp, "\t%s %s, %s\n",
- op,
+ op,
reg(state, RHS(ins, 0), mask),
reg(state, RHS(ins, 1), REGCM_GPR16));
}
@@ -24075,7 +24075,7 @@ static void print_op_move(struct compile_state *state,
src_regcm = arch_reg_regcm(state, src_reg);
dst_regcm = arch_reg_regcm(state, dst_reg);
/* If the class is the same just move the register */
- if (src_regcm & dst_regcm &
+ if (src_regcm & dst_regcm &
(REGCM_GPR8_LO | REGCM_GPR16 | REGCM_GPR32)) {
if ((src_reg != dst_reg) || !omit_copy) {
fprintf(fp, "\tmov %s, %s\n",
@@ -24089,7 +24089,7 @@ static void print_op_move(struct compile_state *state,
src_reg = (src_reg - REGC_GPR32_FIRST) + REGC_GPR16_FIRST;
if ((src_reg != dst_reg) || !omit_copy) {
fprintf(fp, "\tmovw %s, %s\n",
- arch_reg_str(src_reg),
+ arch_reg_str(src_reg),
arch_reg_str(dst_reg));
}
}
@@ -24126,7 +24126,7 @@ static void print_op_move(struct compile_state *state,
}
}
/* Move 8/16bit to 16/32bit */
- else if ((src_regcm & (REGCM_GPR8_LO | REGCM_GPR16)) &&
+ else if ((src_regcm & (REGCM_GPR8_LO | REGCM_GPR16)) &&
(dst_regcm & (REGCM_GPR16 | REGCM_GPR32))) {
const char *op;
op = is_signed(src->type)? "movsx": "movzx";
@@ -24198,7 +24198,7 @@ static void print_op_move(struct compile_state *state,
const char *extend;
extend = is_signed(src->type)? "cltd":"movl $0, %edx";
fprintf(fp, "\tmov %s, %%eax\n\t%s\n",
- arch_reg_str(src_reg),
+ arch_reg_str(src_reg),
extend);
}
/* Move from 64bit gpr to gpr */
@@ -24206,7 +24206,7 @@ static void print_op_move(struct compile_state *state,
(dst_regcm & (REGCM_GPR32 | REGCM_GPR16 | REGCM_GPR8_LO))) {
if (dst_regcm & REGCM_GPR32) {
src_reg = REG_EAX;
- }
+ }
else if (dst_regcm & REGCM_GPR16) {
src_reg = REG_AX;
}
@@ -24411,19 +24411,19 @@ static void print_op_move(struct compile_state *state,
}
if (dst_regcm & (REGCM_GPR32 | REGCM_GPR16 | REGCM_GPR8_LO)) {
- fprintf(fp, "\tshl $%d, %s\n",
- shift_bits,
+ fprintf(fp, "\tshl $%d, %s\n",
+ shift_bits,
reg(state, dst, REGCM_GPR32 | REGCM_GPR16 | REGCM_GPR8_LO));
- fprintf(fp, "\tsar $%d, %s\n",
- shift_bits,
+ fprintf(fp, "\tsar $%d, %s\n",
+ shift_bits,
reg(state, dst, REGCM_GPR32 | REGCM_GPR16 | REGCM_GPR8_LO));
}
else if (dst_regcm & (REGCM_MMX | REGCM_XMM)) {
fprintf(fp, "\tpslld $%d, %s\n",
- shift_bits,
+ shift_bits,
reg(state, dst, REGCM_MMX | REGCM_XMM));
fprintf(fp, "\tpsrad $%d, %s\n",
- shift_bits,
+ shift_bits,
reg(state, dst, REGCM_MMX | REGCM_XMM));
}
else {
@@ -24454,7 +24454,7 @@ static void print_op_load(struct compile_state *state,
case TYPE_INT: case TYPE_UINT:
case TYPE_LONG: case TYPE_ULONG:
case TYPE_POINTER:
- op = "movl";
+ op = "movl";
break;
default:
internal_error(state, ins, "unknown type in load");
@@ -24462,7 +24462,7 @@ static void print_op_load(struct compile_state *state,
break;
}
fprintf(fp, "\t%s (%s), %s\n",
- op,
+ op,
reg(state, src, REGCM_GPR32),
reg(state, dst, REGCM_GPR32));
}
@@ -24497,8 +24497,8 @@ static void print_op_store(struct compile_state *state,
reg(state, src, REGCM_GPR8_LO | REGCM_GPR16 | REGCM_GPR32),
reg(state, dst, REGCM_GPR32));
}
-
-
+
+
}
static void print_op_smul(struct compile_state *state,
@@ -24599,7 +24599,7 @@ static void print_op_branch(struct compile_state *state,
internal_error(state, branch, "Invalid branch op");
break;
}
-
+
}
#if 1
if (branch->op == OP_CALL) {
@@ -24607,7 +24607,7 @@ static void print_op_branch(struct compile_state *state,
}
#endif
fprintf(fp, "\t%s L%s%lu\n",
- bop,
+ bop,
state->compiler->label_prefix,
(unsigned long)(TARG(branch, 0)->u.cval));
}
@@ -24653,19 +24653,19 @@ static void print_op_set(struct compile_state *state,
sop, reg(state, set, REGCM_GPR8_LO));
}
-static void print_op_bit_scan(struct compile_state *state,
- struct triple *ins, FILE *fp)
+static void print_op_bit_scan(struct compile_state *state,
+ struct triple *ins, FILE *fp)
{
const char *op;
switch(ins->op) {
case OP_BSF: op = "bsf"; break;
case OP_BSR: op = "bsr"; break;
- default:
+ default:
internal_error(state, ins, "unknown bit scan");
op = 0;
break;
}
- fprintf(fp,
+ fprintf(fp,
"\t%s %s, %s\n"
"\tjnz 1f\n"
"\tmovl $-1, %s\n"
@@ -24682,18 +24682,18 @@ static void print_sdecl(struct compile_state *state,
{
fprintf(fp, ".section \"" DATA_SECTION "\"\n");
fprintf(fp, ".balign %ld\n", (long int)align_of_in_bytes(state, ins->type));
- fprintf(fp, "L%s%lu:\n",
+ fprintf(fp, "L%s%lu:\n",
state->compiler->label_prefix, (unsigned long)(ins->u.cval));
print_const(state, MISC(ins, 0), fp);
fprintf(fp, ".section \"" TEXT_SECTION "\"\n");
-
+
}
static void print_instruction(struct compile_state *state,
struct triple *ins, FILE *fp)
{
/* Assumption: after I have exted the register allocator
- * everything is in a valid register.
+ * everything is in a valid register.
*/
switch(ins->op) {
case OP_ASM:
@@ -24725,7 +24725,7 @@ static void print_instruction(struct compile_state *state,
case OP_SDECL:
print_sdecl(state, ins, fp);
break;
- case OP_COPY:
+ case OP_COPY:
case OP_CONVERT:
print_op_move(state, ins, fp);
break;
@@ -24760,10 +24760,10 @@ static void print_instruction(struct compile_state *state,
print_op_set(state, ins, fp);
break;
case OP_INB: case OP_INW: case OP_INL:
- print_op_in(state, ins, fp);
+ print_op_in(state, ins, fp);
break;
case OP_OUTB: case OP_OUTW: case OP_OUTL:
- print_op_out(state, ins, fp);
+ print_op_out(state, ins, fp);
break;
case OP_BSF:
case OP_BSR:
@@ -24792,7 +24792,7 @@ static void print_instruction(struct compile_state *state,
if (!ins->use) {
return;
}
- fprintf(fp, "L%s%lu:\n",
+ fprintf(fp, "L%s%lu:\n",
state->compiler->label_prefix, (unsigned long)(ins->u.cval));
break;
case OP_ADECL:
@@ -24839,7 +24839,7 @@ static void print_instructions(struct compile_state *state)
first = state->first;
ins = first;
do {
- if (print_location &&
+ if (print_location &&
last_occurance != ins->occurance) {
if (!ins->occurance->parent) {
fprintf(fp, "\t/* %s,%s:%d.%d */\n",
@@ -24886,7 +24886,7 @@ static void generate_code(struct compile_state *state)
{
generate_local_labels(state);
print_instructions(state);
-
+
}
static void print_preprocessed_tokens(struct compile_state *state)
@@ -24907,7 +24907,7 @@ static void print_preprocessed_tokens(struct compile_state *state)
break;
}
tk = eat(state, tok);
- token_str =
+ token_str =
tk->ident ? tk->ident->name :
tk->str_len ? tk->val.str :
tokens[tk->tok];
@@ -24916,8 +24916,8 @@ static void print_preprocessed_tokens(struct compile_state *state)
while(file->macro && file->prev) {
file = file->prev;
}
- if (!file->macro &&
- ((file->line != line) || (file->basename != filename)))
+ if (!file->macro &&
+ ((file->line != line) || (file->basename != filename)))
{
int i, col;
if ((file->basename == filename) &&
@@ -24938,9 +24938,9 @@ static void print_preprocessed_tokens(struct compile_state *state)
fprintf(fp, " ");
}
}
-
+
fprintf(fp, "%s ", token_str);
-
+
if (state->compiler->debug & DEBUG_TOKENS) {
loc(state->dbgout, state, 0);
fprintf(state->dbgout, "%s <- `%s'\n",
@@ -25030,7 +25030,7 @@ static void compile(const char *filename,
register_builtins(&state);
compile_file(&state, filename, 1);
-
+
while (includes) {
compile_file(&state, includes->filename, 1);
includes=includes->next;
@@ -25047,8 +25047,8 @@ static void compile(const char *filename,
/* Exit the global definition scope */
end_scope(&state);
- /* Now that basic compilation has happened
- * optimize the intermediate code
+ /* Now that basic compilation has happened
+ * optimize the intermediate code
*/
optimize(&state);
@@ -25104,8 +25104,8 @@ int main(int argc, char **argv)
struct compiler_state compiler;
struct arch_state arch;
int all_opts;
-
-
+
+
/* I don't want any surprises */
setlocale(LC_ALL, "C");
diff --git a/util/romcc/tests.sh b/util/romcc/tests.sh
index 4dddbb1920..823d71d772 100644
--- a/util/romcc/tests.sh
+++ b/util/romcc/tests.sh
@@ -21,7 +21,7 @@ stem="$root$N"
base=tests/$stem
op="-Itests/include"
op="$op -feliminate-inefectual-code -fsimplify -fscc-transform "
-#op="$op -O2 "
+#op="$op -O2 "
#op="$op -mmmx -msse"
op="$op -finline-policy=defaulton"
#op="$op -finline-policy=nopenalty"
@@ -47,12 +47,12 @@ op="$op -fdebug-scc-transform2"
#op="-fdebug -fdebug-inline -O2 -mmmx "
#op="-fdebug -fdebug-live-range-conflicts -fdebug-live-range-conflicts2 -fno-debug-interference -fdebug-color-graph -fdebug-coalescing -fmax-allocation-passes=10 -O2 -mmmx -msse"
#op="-fdebug -O2 -mmmx -msse"
-#op="-fdebug -fdebug-inline -fno-eliminate-inefectual-code -fno-always-inline -mmmx"
-#op="-fdebug -fdebug-inline -fno-always-inline -mmmx"
+#op="-fdebug -fdebug-inline -fno-eliminate-inefectual-code -fno-always-inline -mmmx"
+#op="-fdebug -fdebug-inline -fno-always-inline -mmmx"
export ALLOC_CHECK_=2
-rm -f core $base.S $base.debug $base.debug2 $base.elf $base.out &&
-make romcc &&
-$ROMCC $op -o $base.S $base.c 2>&1 > $base.debug | tee $base.debug2
+rm -f core $base.S $base.debug $base.debug2 $base.elf $base.out &&
+make romcc &&
+$ROMCC $op -o $base.S $base.c 2>&1 > $base.debug | tee $base.debug2
if [ '(' -f $base.c ')' -a '(' '!' -f core ')' -a '(' -f $base.S ')' ]; then
if [ "$stem" = "linux_test$N" ] ; then
as $base.S -o $base.o &&
diff --git a/util/romcc/tests/fail_test10.c b/util/romcc/tests/fail_test10.c
index 1993e0e59c..7cfd9a9c3b 100644
--- a/util/romcc/tests/fail_test10.c
+++ b/util/romcc/tests/fail_test10.c
@@ -14,6 +14,6 @@ static struct result main(int a, int b, struct big_arg d)
result.b = 1;
result.c = b + 1;
result.d = a + 1;
-
+
}
diff --git a/util/romcc/tests/fail_test2.c b/util/romcc/tests/fail_test2.c
index 74d6eb1d94..6a02486a8d 100644
--- a/util/romcc/tests/fail_test2.c
+++ b/util/romcc/tests/fail_test2.c
@@ -3,16 +3,16 @@ static void main(void)
unsigned min;
int value, latency;
-
-
+
+
latency = -2;
-
+
if (latency > (((min) >> 8) & 0xff)) {
value = 0xa;
}
-
+
if (value < 0) return;
-
+
((min) = (((min) & ~0xff)));
}
diff --git a/util/romcc/tests/hello_world.c b/util/romcc/tests/hello_world.c
index b5ce540dc9..cba88a9a6d 100644
--- a/util/romcc/tests/hello_world.c
+++ b/util/romcc/tests/hello_world.c
@@ -66,7 +66,7 @@ void uart_wait_to_tx_byte(void)
void uart_wait_until_sent(void)
{
- while(!(inb(CONFIG_TTYS0_BASE + UART_LSR) & 0x40))
+ while(!(inb(CONFIG_TTYS0_BASE + UART_LSR) & 0x40))
;
}
@@ -96,7 +96,7 @@ void uart_init(void)
void __console_tx_char(unsigned char byte)
{
uart_tx_byte(byte);
-
+
}
void __console_tx_string(char *str)
diff --git a/util/romcc/tests/hello_world1.c b/util/romcc/tests/hello_world1.c
index b5ce540dc9..cba88a9a6d 100644
--- a/util/romcc/tests/hello_world1.c
+++ b/util/romcc/tests/hello_world1.c
@@ -66,7 +66,7 @@ void uart_wait_to_tx_byte(void)
void uart_wait_until_sent(void)
{
- while(!(inb(CONFIG_TTYS0_BASE + UART_LSR) & 0x40))
+ while(!(inb(CONFIG_TTYS0_BASE + UART_LSR) & 0x40))
;
}
@@ -96,7 +96,7 @@ void uart_init(void)
void __console_tx_char(unsigned char byte)
{
uart_tx_byte(byte);
-
+
}
void __console_tx_string(char *str)
diff --git a/util/romcc/tests/hello_world2.c b/util/romcc/tests/hello_world2.c
index 18380d37e8..c6e8092ed3 100644
--- a/util/romcc/tests/hello_world2.c
+++ b/util/romcc/tests/hello_world2.c
@@ -66,7 +66,7 @@ void uart_wait_to_tx_byte(void)
void uart_wait_until_sent(void)
{
- while(!(inb(CONFIG_TTYS0_BASE + UART_LSR) & 0x40))
+ while(!(inb(CONFIG_TTYS0_BASE + UART_LSR) & 0x40))
;
}
@@ -96,7 +96,7 @@ void uart_init(void)
void __console_tx_char(unsigned char byte)
{
uart_tx_byte(byte);
-
+
}
void __console_tx_string(char *str)
diff --git a/util/romcc/tests/include/linux_console.h b/util/romcc/tests/include/linux_console.h
index 861c701e5d..5f9dec21f9 100644
--- a/util/romcc/tests/include/linux_console.h
+++ b/util/romcc/tests/include/linux_console.h
@@ -6,37 +6,37 @@
static const char *addr_of_char(unsigned char ch)
{
static const char byte[] = {
- 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
+ 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
- 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,
+ 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,
0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f,
- 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27,
+ 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27,
0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f,
- 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37,
+ 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37,
0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f,
- 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47,
+ 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47,
0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f,
- 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57,
+ 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57,
0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f,
- 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67,
+ 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67,
0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f,
- 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77,
+ 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77,
0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f,
- 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87,
+ 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87,
0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f,
- 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97,
+ 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97,
0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f,
- 0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7,
+ 0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7,
0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf,
- 0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7,
+ 0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7,
0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf,
- 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7,
+ 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7,
0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf,
- 0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7,
+ 0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7,
0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf,
- 0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7,
+ 0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7,
0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef,
- 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7,
+ 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7,
0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff,
};
return byte + ch;
diff --git a/util/romcc/tests/include/linuxi386_syscall.h b/util/romcc/tests/include/linuxi386_syscall.h
index d202661c67..30b4a2c6e0 100644
--- a/util/romcc/tests/include/linuxi386_syscall.h
+++ b/util/romcc/tests/include/linuxi386_syscall.h
@@ -34,7 +34,7 @@ static struct syscall_result syscall1(unsigned long nr, unsigned long arg1)
: "=a" (res)
: "a" (nr), "b" (arg1));
return syscall_return(res);
-
+
}
static struct syscall_result syscall2(unsigned long nr, unsigned long arg1, unsigned long arg2)
@@ -45,7 +45,7 @@ static struct syscall_result syscall2(unsigned long nr, unsigned long arg1, unsi
: "=a" (res)
: "a" (nr), "b" (arg1), "c" (arg2));
return syscall_return(res);
-
+
}
@@ -58,7 +58,7 @@ static struct syscall_result syscall3(unsigned long nr, unsigned long arg1, unsi
: "=a" (res)
: "a" (nr), "b" (arg1), "c" (arg2), "d" (arg3));
return syscall_return(res);
-
+
}
static struct syscall_result syscall4(unsigned long nr, unsigned long arg1, unsigned long arg2,
@@ -70,7 +70,7 @@ static struct syscall_result syscall4(unsigned long nr, unsigned long arg1, unsi
: "=a" (res)
: "a" (nr), "b" (arg1), "c" (arg2), "d" (arg3), "S" (arg4));
return syscall_return(res);
-
+
}
static struct syscall_result syscall5(unsigned long nr, unsigned long arg1, unsigned long arg2,
@@ -80,10 +80,10 @@ static struct syscall_result syscall5(unsigned long nr, unsigned long arg1, unsi
asm volatile(
"int $0x80"
: "=a" (res)
- : "a" (nr), "b" (arg1), "c" (arg2), "d" (arg3),
+ : "a" (nr), "b" (arg1), "c" (arg2), "d" (arg3),
"S" (arg4), "D" (arg5));
return syscall_return(res);
-
+
}
#define NR_exit 1
diff --git a/util/romcc/tests/linux_console.h b/util/romcc/tests/linux_console.h
index 0837dfc577..1b6466eca1 100644
--- a/util/romcc/tests/linux_console.h
+++ b/util/romcc/tests/linux_console.h
@@ -6,37 +6,37 @@
static const char *addr_of_char(unsigned char ch)
{
static const char byte[] = {
- 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
+ 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
- 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,
+ 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,
0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f,
- 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27,
+ 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27,
0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f,
- 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37,
+ 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37,
0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f,
- 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47,
+ 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47,
0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f,
- 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57,
+ 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57,
0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f,
- 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67,
+ 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67,
0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f,
- 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77,
+ 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77,
0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f,
- 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87,
+ 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87,
0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f,
- 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97,
+ 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97,
0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f,
- 0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7,
+ 0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7,
0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf,
- 0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7,
+ 0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7,
0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf,
- 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7,
+ 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7,
0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf,
- 0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7,
+ 0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7,
0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf,
- 0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7,
+ 0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7,
0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef,
- 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7,
+ 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7,
0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff,
};
return byte + ch;
diff --git a/util/romcc/tests/linux_test13.c b/util/romcc/tests/linux_test13.c
index 83ef239854..9bc80eac7d 100644
--- a/util/romcc/tests/linux_test13.c
+++ b/util/romcc/tests/linux_test13.c
@@ -43,5 +43,5 @@ static void main(void)
print_debug("A\n");
dimm_mask = spd_detect_dimms(cpu);
print_debug("B\n");
- _exit(0);
+ _exit(0);
}
diff --git a/util/romcc/tests/linux_test2.c b/util/romcc/tests/linux_test2.c
index 8f40fa0d47..766f498a0a 100644
--- a/util/romcc/tests/linux_test2.c
+++ b/util/romcc/tests/linux_test2.c
@@ -70,14 +70,14 @@ static void setup_coherent_ht_domain(void)
(((FN) & 0x07) << 8) | \
((WHERE) & 0xFF))
- /* Routing Table Node i
- * F0:0x40 i = 0,
+ /* Routing Table Node i
+ * F0:0x40 i = 0,
* F0:0x44 i = 1,
- * F0:0x48 i = 2,
+ * F0:0x48 i = 2,
* F0:0x4c i = 3,
- * F0:0x50 i = 4,
+ * F0:0x50 i = 4,
* F0:0x54 i = 5,
- * F0:0x58 i = 6,
+ * F0:0x58 i = 6,
* F0:0x5c i = 7
* [ 0: 3] Request Route
* [0] Route to this node
@@ -104,7 +104,7 @@ static void setup_coherent_ht_domain(void)
PCI_ADDR(0, 0x18, 0, 0x58), 0xfff0f0f0, 0x00010101,
PCI_ADDR(0, 0x18, 0, 0x5c), 0xfff0f0f0, 0x00010101,
- /* Hypetransport Transaction Control Register
+ /* Hypetransport Transaction Control Register
* F0:0x68
* [ 0: 0] Disable read byte probe
* 0 = Probes issues
@@ -146,7 +146,7 @@ static void setup_coherent_ht_domain(void)
* [12:12] Change ISOC to Ordered
* 0 = Bit 1 of coherent HT RdSz/WrSz command used for iosynchronous prioritization
* 1 = Bit 1 of coherent HT RdSz/WrSz command used for ordering.
- * [14:13] Buffer Release Priority select
+ * [14:13] Buffer Release Priority select
* 00 = 64
* 01 = 16
* 10 = 8
@@ -253,7 +253,7 @@ static void setup_coherent_ht_domain(void)
* [13:13] HT Stop Tristate Enable
* 0 = Driven during an LDTSTOP_L
* 1 = Tristated during and LDTSTOP_L
- * [14:14] Extended CTL Time
+ * [14:14] Extended CTL Time
* 0 = CTL is asserted for 16 bit times during link initialization
* 1 = CTL is asserted for 50us during link initialization
* [18:16] Max Link Width In (Read-Only?)
@@ -519,7 +519,7 @@ static void setup_coherent_ht_domain(void)
* 1 = base/limit registers i are read-only
* [ 7: 4] Reserved
* [31: 8] Memory-Mapped I/O Base Address i (39-16)
- * This field defines the upper address bits of a 40bit address
+ * This field defines the upper address bits of a 40bit address
* that defines the start of memory-mapped I/O region i
*/
PCI_ADDR(0, 0x18, 1, 0x80), 0x000000f0, 0x00e00003,
@@ -580,7 +580,7 @@ static void setup_coherent_ht_domain(void)
* [ 3: 2] Reserved
* [ 4: 4] VGA Enable
* 0 = VGA matches Disabled
- * 1 = matches all address < 64K and where A[9:0] is in the
+ * 1 = matches all address < 64K and where A[9:0] is in the
* range 3B0-3BB or 3C0-3DF independen of the base & limit registers
* [ 5: 5] ISA Enable
* 0 = ISA matches Disabled
@@ -588,7 +588,7 @@ static void setup_coherent_ht_domain(void)
* from matching agains this base/limit pair
* [11: 6] Reserved
* [24:12] PCI I/O Base i
- * This field defines the start of PCI I/O region n
+ * This field defines the start of PCI I/O region n
* [31:25] Reserved
*/
PCI_ADDR(0, 0x18, 1, 0xC0), 0xFE000FCC, 0x0000d003,
diff --git a/util/romcc/tests/linux_test3.c b/util/romcc/tests/linux_test3.c
index 97187ae5e6..4c7a882f75 100644
--- a/util/romcc/tests/linux_test3.c
+++ b/util/romcc/tests/linux_test3.c
@@ -4,15 +4,15 @@ static void goto_test(void)
{
int i;
print_debug("goto_test\n");
-
+
i = 0;
goto bottom;
{
top:
- print_debug("i = ");
- print_debug_hex8(i);
+ print_debug("i = ");
+ print_debug_hex8(i);
print_debug("\n");
-
+
i = i + 1;
}
bottom:
diff --git a/util/romcc/tests/linux_test4.c b/util/romcc/tests/linux_test4.c
index 1f09918362..71f4d6541e 100644
--- a/util/romcc/tests/linux_test4.c
+++ b/util/romcc/tests/linux_test4.c
@@ -7,7 +7,7 @@ struct socket_desc {
short across;
};
-static void main(void)
+static void main(void)
{
static const struct socket_desc cpu_socketsA[] = {
{ .up = 2, .down = -1, .across = 1 }, /* Node 0 */
diff --git a/util/romcc/tests/linux_test5.c b/util/romcc/tests/linux_test5.c
index 13093fb0fc..473f57289d 100644
--- a/util/romcc/tests/linux_test5.c
+++ b/util/romcc/tests/linux_test5.c
@@ -4,7 +4,7 @@
inline int log2(int value)
{
/* __builtin_bsr is a exactly equivalent to the x86 machine
- * instruction with the exception that it returns -1
+ * instruction with the exception that it returns -1
* when the value presented to it is zero.
* Otherwise __builtin_bsr returns the zero based index of
* the highest bit set.
@@ -91,8 +91,8 @@ static unsigned spd_to_dimm(unsigned device)
static void disable_dimm(unsigned index)
{
- print_debug("disabling dimm");
- print_debug_hex8(index);
+ print_debug("disabling dimm");
+ print_debug_hex8(index);
print_debug("\r\n");
#if 0
pci_write_config32(PCI_DEV(0, 0x18, 2), DRAM_CSBASE + (((index << 1)+0)<<2), 0);
@@ -175,8 +175,8 @@ static const struct mem_param *spd_set_memclk(void)
min_latency = 2;
#if 1
- print_debug("min_cycle_time: ");
- print_debug_hex8(min_cycle_time);
+ print_debug("min_cycle_time: ");
+ print_debug_hex8(min_cycle_time);
print_debug(" min_latency: ");
print_debug_hex8(min_latency);
print_debug("\r\n");
@@ -236,8 +236,8 @@ static const struct mem_param *spd_set_memclk(void)
#if 1
print_debug("device: ");
print_debug_hex8(device);
- print_debug(" new_cycle_time: ");
- print_debug_hex8(new_cycle_time);
+ print_debug(" new_cycle_time: ");
+ print_debug_hex8(new_cycle_time);
print_debug(" new_latency: ");
print_debug_hex8(new_latency);
print_debug("\r\n");
@@ -249,8 +249,8 @@ static const struct mem_param *spd_set_memclk(void)
#if 1
print_debug("device: ");
print_debug_hex8(device);
- print_debug(" new_cycle_time: ");
- print_debug_hex8(new_cycle_time);
+ print_debug(" new_cycle_time: ");
+ print_debug_hex8(new_cycle_time);
print_debug(" new_latency: ");
print_debug_hex8(new_latency);
print_debug("\r\n");
@@ -270,8 +270,8 @@ static const struct mem_param *spd_set_memclk(void)
#if 1
print_debug("device: ");
print_debug_hex8(device);
- print_debug(" min_cycle_time: ");
- print_debug_hex8(min_cycle_time);
+ print_debug(" min_cycle_time: ");
+ print_debug_hex8(min_cycle_time);
print_debug(" min_latency: ");
print_debug_hex8(min_latency);
print_debug("\r\n");
@@ -309,11 +309,11 @@ static const struct mem_param *spd_set_memclk(void)
if ((latency != min_latency) || (index >= 3)) {
goto dimm_err;
}
-
+
/* Read the min_cycle_time for this latency */
value = smbus_read_byte(device, latency_indicies[index]);
-
- /* All is good if the selected clock speed
+
+ /* All is good if the selected clock speed
* is what I need or slower.
*/
if (value <= min_cycle_time) {
@@ -324,8 +324,8 @@ static const struct mem_param *spd_set_memclk(void)
disable_dimm(spd_to_dimm(device));
}
#if 1
- print_debug("min_cycle_time: ");
- print_debug_hex8(min_cycle_time);
+ print_debug("min_cycle_time: ");
+ print_debug_hex8(min_cycle_time);
print_debug(" min_latency: ");
print_debug_hex8(min_latency);
print_debug("\r\n");
@@ -347,7 +347,7 @@ static const struct mem_param *spd_set_memclk(void)
value |= latencies[min_latency - 2];
pci_write_config32(PCI_DEV(0, 0x18, 2), DRAM_CONFIG_LOW, value);
#endif
-
+
return param;
}
diff --git a/util/romcc/tests/linuxi386_syscall.h b/util/romcc/tests/linuxi386_syscall.h
index 7eb513db36..96a5936c3c 100644
--- a/util/romcc/tests/linuxi386_syscall.h
+++ b/util/romcc/tests/linuxi386_syscall.h
@@ -34,7 +34,7 @@ static struct syscall_result syscall1(unsigned long nr, unsigned long arg1)
: "=a" (res)
: "a" (nr), "b" (arg1));
return syscall_return(res);
-
+
}
static struct syscall_result syscall2(unsigned long nr, unsigned long arg1, unsigned long arg2)
@@ -45,7 +45,7 @@ static struct syscall_result syscall2(unsigned long nr, unsigned long arg1, unsi
: "=a" (res)
: "a" (nr), "b" (arg1), "c" (arg2));
return syscall_return(res);
-
+
}
@@ -58,7 +58,7 @@ static struct syscall_result syscall3(unsigned long nr, unsigned long arg1, unsi
: "=a" (res)
: "a" (nr), "b" (arg1), "c" (arg2), "d" (arg3));
return syscall_return(res);
-
+
}
static struct syscall_result syscall4(unsigned long nr, unsigned long arg1, unsigned long arg2,
@@ -70,7 +70,7 @@ static struct syscall_result syscall4(unsigned long nr, unsigned long arg1, unsi
: "=a" (res)
: "a" (nr), "b" (arg1), "c" (arg2), "d" (arg3), "S" (arg4));
return syscall_return(res);
-
+
}
static struct syscall_result syscall5(unsigned long nr, unsigned long arg1, unsigned long arg2,
@@ -80,10 +80,10 @@ static struct syscall_result syscall5(unsigned long nr, unsigned long arg1, unsi
asm volatile(
"int $0x80"
: "=a" (res)
- : "a" (nr), "b" (arg1), "c" (arg2), "d" (arg3),
+ : "a" (nr), "b" (arg1), "c" (arg2), "d" (arg3),
"S" (arg4), "D" (arg5));
return syscall_return(res);
-
+
}
#define NR_exit 1
diff --git a/util/romcc/tests/raminit_test.c b/util/romcc/tests/raminit_test.c
index 2c6fa8c750..569d75ba62 100644
--- a/util/romcc/tests/raminit_test.c
+++ b/util/romcc/tests/raminit_test.c
@@ -136,7 +136,7 @@ void uart_wait_to_tx_byte(void)
void uart_wait_until_sent(void)
{
- while(!(inb(CONFIG_TTYS0_BASE + UART_LSR) & 0x40))
+ while(!(inb(CONFIG_TTYS0_BASE + UART_LSR) & 0x40))
;
}
@@ -355,7 +355,7 @@ int smbus_read_byte(unsigned device, unsigned address)
/* CAS latency 2 */
#if (CAS_LATENCY == 2)
#define CAS_NB 0x17
- /*
+ /*
* 7 == 0111
* 1 == 0001
*/
@@ -367,7 +367,7 @@ int smbus_read_byte(unsigned device, unsigned address)
#endif
/* CAS latency 3 */
-#if (CAS_LATENCY == 3)
+#if (CAS_LATENCY == 3)
#define CAS_NB 0x13
/*
* 3 == 0011
@@ -381,11 +381,11 @@ int smbus_read_byte(unsigned device, unsigned address)
#endif
#ifndef CAS_NB
-#error "Nothing defined"
+#error "Nothing defined"
#endif
/* Default values for config registers */
-
+
static void set_nbxcfg(void)
{
/* NBXCFG 0x50 - 0x53 */
@@ -417,7 +417,7 @@ static void set_nbxcfg(void)
* ECC Diagnostic Mode Enable == 0 Not Enabled
* MDA present == 0 Not Present
* USWC Write Post During During I/O Bridge Access Enable == 1 Enabled
- * In Order Queue Depth (IQD) (RO) == ??
+ * In Order Queue Depth (IQD) (RO) == ??
*/
pcibios_write_config_dword(I440GX_BUS, I440GX_DEVFN, 0x50, 0xff00000c);
}
@@ -486,7 +486,7 @@ static void set_mbsc(void)
* MD[63:0]# Buffer Strength Control 1 == 3x
* MECC[7:0] Buffer Strength Control 2 == 3x
* MECC[7:0] Buffer Strength Control 1 == 3x
- * CSB7# Buffer Strength == 3x
+ * CSB7# Buffer Strength == 3x
* CSA7# Buffer Strength == 3x
* CSB6# Buffer Strength == 3x
* CSA6# Buffer Strength == 3x
@@ -575,13 +575,13 @@ static void set_pgpol(void)
static void set_mbfs(void)
{
/* MBFS - Memory Buffer Frequencey Select Register */
- /* 0xffff7f
- * [23:20] f == 1111
- * [19:16] f == 1111
- * [15:12] f == 1111
- * [11: 8] f == 1111
- * [ 7: 4] 7 == 0111
- * [ 3: 0] f == 1111
+ /* 0xffff7f
+ * [23:20] f == 1111
+ * [19:16] f == 1111
+ * [15:12] f == 1111
+ * [11: 8] f == 1111
+ * [ 7: 4] 7 == 0111
+ * [ 3: 0] f == 1111
* MAA[14:0], WEA#, SRASA#, SCASA# == 100Mhz Buffers Enabled
* MAB[14,13,10,12:11,9:0], WEB#, SRASB#, SCASB# == 100Mhz Buffers Enabled
* MD[63:0] Control 2 == 100 Mhz Buffer Enable
@@ -622,12 +622,12 @@ static void set_drtc(void)
static void set_pmcr(void)
{
- /* PMCR -- BIOS sets 0x90 into it.
+ /* PMCR -- BIOS sets 0x90 into it.
* 0x10 is REQUIRED.
* we have never used it. So why did this ever work?
*/
pcibios_write_config_byte(I440GX_BUS, I440GX_DEVFN, 0x7a, 0x90);
-
+
}
void sdram_set_registers(void)
{
@@ -651,7 +651,7 @@ void sdram_set_registers(void)
int log2(int value)
{
/* __builtin_bsr is a exactly equivalent to the x86 machine
- * instruction with the exception that it returns -1
+ * instruction with the exception that it returns -1
* when the value presented to it is zero.
* Otherwise __builtin_bsr returns the zero based index of
* the highest bit set.
@@ -670,7 +670,7 @@ static void spd_set_drb(void)
unsigned end_of_memory;
unsigned device;
unsigned drb_reg;
-
+
end_of_memory = 0; /* in multiples of 8MiB */
device = SMBUS_MEM_DEVICE_START;
drb_reg = 0x60;
@@ -704,13 +704,13 @@ static void spd_set_drb(void)
#else
side1_bits += log2((byte2 << 8) | byte);
#endif
-
+
/* now I have the ram size in bits as a power of two (less 1) */
/* Make it mulitples of 8MB */
side1_bits -= 25;
-
+
/* side two */
-
+
/* number of physical banks */
byte = smbus_read_byte(device, 5);
if (byte > 1) {
@@ -783,8 +783,8 @@ static void spd_set_dramc(void)
}
dramc = 0x8;
if ((byte & 0x12) != 0) {
- /* this is a registered part.
- * observation: for register parts, BIOS zeros (!)
+ /* this is a registered part.
+ * observation: for register parts, BIOS zeros (!)
* registers CA-CC. This has an undocumented meaning.
*/
/* But it does make sense the oppisite of registered
@@ -835,7 +835,7 @@ static void spd_enable_refresh(void)
}
byte &= 0x7f;
/* Default refresh rate be conservative */
- refresh_rate = 5;
+ refresh_rate = 5;
/* see if the ram refresh is a supported one */
if (byte < 6) {
#if HAVE_STATIC_ARRAY_SUPPORT
@@ -856,7 +856,7 @@ static void spd_set_sdramc(void)
static void spd_set_rps(void)
{
/*
- * Effects: Uses serial presence detect to set the row size
+ * Effects: Uses serial presence detect to set the row size
* on a given DIMM
* FIXME: Check for illegal/unsupported ram configurations and abort
*/
@@ -881,16 +881,16 @@ static void spd_set_rps(void)
page_size = byte & 0xf;
/* make it in multiples of 2Kb */
page_size -= 11;
-
+
if (page_size <= 0) continue;
-
+
/* FIXME: do something with page sizes greather than 8KB!! */
page_sizes |= (page_size << index);
-
+
/* side two */
byte = smbus_read_byte(device, 5);
if (byte <= 1) continue;
-
+
/* For now only handle the symmetrical case */
page_sizes |= (page_size << (index +2));
}
@@ -898,10 +898,10 @@ static void spd_set_rps(void)
/* we have just verified that we have to have this code. It appears that
* the registered SDRAMs do indeed set the RPS wrong. sheesh.
*/
- /* at this point, page_sizes holds the RPS for all ram.
- * we have verified that for registered DRAM the values are
+ /* at this point, page_sizes holds the RPS for all ram.
+ * we have verified that for registered DRAM the values are
* 1/2 the size they should be. So we test for registered
- * and then double the sizes if needed.
+ * and then double the sizes if needed.
*/
dramc = pcibios_read_config_byte(I440GX_BUS, I440GX_DEVFN, 0x57);
@@ -909,9 +909,9 @@ static void spd_set_rps(void)
/* registered */
/* BIOS makes weird page size for registered! */
- /* what we have found is you need to set the EVEN banks to
- * twice the size. Fortunately there is a very easy way to
- * do this. First, read the WORD value of register 0x74.
+ /* what we have found is you need to set the EVEN banks to
+ * twice the size. Fortunately there is a very easy way to
+ * do this. First, read the WORD value of register 0x74.
*/
page_sizes += 0x1111;
}
@@ -938,8 +938,8 @@ static void spd_set_pgpol(void)
bank_sizes = 0;
bank = 0;
device = SMBUS_MEM_DEVICE_START;
- for(; device <= SMBUS_MEM_DEVICE_END;
- bank += 2, device += SMBUS_MEM_DEVICE_INC) {
+ for(; device <= SMBUS_MEM_DEVICE_END;
+ bank += 2, device += SMBUS_MEM_DEVICE_INC) {
int byte;
/* logical banks */
@@ -947,7 +947,7 @@ static void spd_set_pgpol(void)
if (byte < 0) continue;
if (byte < 4) continue;
bank_sizes |= (1 << bank);
-
+
/* side 2 */
/* Number of physical banks */
byte = smbus_read_byte(device, 5);
@@ -974,14 +974,14 @@ static void spd_set_nbxcfg(void)
/* Say all dimms have no ECC support */
reg = 0xff;
index = 0;
-
+
device = SMBUS_MEM_DEVICE_START;
for(; device <= SMBUS_MEM_DEVICE_END; index += 2, device += SMBUS_MEM_DEVICE_INC) {
int byte;
byte = smbus_read_byte(device, 11);
if (byte < 0) continue;
-#if !USE_ECC
+#if !USE_ECC
byte = 0; /* Disable ECC */
#endif
/* 0 == None, 1 == Parity, 2 == ECC */
@@ -1015,7 +1015,7 @@ static void spd_set_nbxcfg(void)
/* try this.
* We should be setting bit 2 in register 76 and we're not
* technically we should see if CL=2 for the ram,
- * but registered is so screwed up that it's kind of a lost
+ * but registered is so screwed up that it's kind of a lost
* cause.
*/
byte = pcibios_read_config_byte(I440GX_BUS, I440GX_DEVFN, 0x76);
@@ -1098,7 +1098,7 @@ static void dimms_read(unsigned long offset)
int i;
for(i = 0; i < 8; i++) {
unsigned long dummy;
- unsigned long addr;
+ unsigned long addr;
unsigned long next_base;
next_base = dimm_base(i +1);
@@ -1108,8 +1108,8 @@ static void dimms_read(unsigned long offset)
}
addr += offset;
#if HAVE_STRING_SUPPORT
- print_debug("Reading ");
- print_debug_hex32(addr);
+ print_debug("Reading ");
+ print_debug_hex32(addr);
print_debug("\n");
#endif
#if HAVE_POINTER_SUPPORT
@@ -1120,8 +1120,8 @@ static void dimms_read(unsigned long offset)
#endif
#endif
#if HAVE_STRING_SUPPORT
- print_debug("Reading ");
- print_debug_hex32(addr ^ 0xddf8);
+ print_debug("Reading ");
+ print_debug_hex32(addr ^ 0xddf8);
print_debug("\n");
#endif
#if HAVE_POINTER_SUPPORT
@@ -1132,9 +1132,9 @@ static void dimms_read(unsigned long offset)
#endif
#endif
#if HAVE_STRING_SUPPORT
- print_debug("Read ");
- print_debug_hex32(addr);
- print_debug_hex32(addr ^ 0xddf8);
+ print_debug("Read ");
+ print_debug_hex32(addr);
+ print_debug_hex32(addr ^ 0xddf8);
print_debug("\n");
#endif
}
@@ -1212,9 +1212,9 @@ void sdram_enable(void)
#if HAVE_STRING_SUPPORT
print_debug("Ram Enable 2\n");
#endif
-
+
/* Now we need 8 AUTO REFRESH / CBR cycles to be performed */
-
+
sdram_set_command_cbr();
sdram_assert_command();
sdram_assert_command();
@@ -1224,11 +1224,11 @@ void sdram_enable(void)
sdram_assert_command();
sdram_assert_command();
sdram_assert_command();
-
+
#if HAVE_STRING_SUPPORT
print_debug("Ram Enable 3\n");
#endif
-
+
/* mode register set */
sdram_set_mode_register();
/* MAx[14:0] lines,
@@ -1245,7 +1245,7 @@ void sdram_enable(void)
/* normal operation */
sdram_set_command_none();
-
+
#if HAVE_STRING_SUPPORT
print_debug("Ram Enable 5\n");
#endif
@@ -1270,7 +1270,7 @@ void sdram_initialize(void)
print_debug("Ram3\n");
#endif
/* Now that everything is setup enable the SDRAM.
- * Some chipsets do the work for use while on others
+ * Some chipsets do the work for use while on others
* we need to it by hand.
*/
sdram_enable();
diff --git a/util/romcc/tests/raminit_test1.c b/util/romcc/tests/raminit_test1.c
index 2c6fa8c750..569d75ba62 100644
--- a/util/romcc/tests/raminit_test1.c
+++ b/util/romcc/tests/raminit_test1.c
@@ -136,7 +136,7 @@ void uart_wait_to_tx_byte(void)
void uart_wait_until_sent(void)
{
- while(!(inb(CONFIG_TTYS0_BASE + UART_LSR) & 0x40))
+ while(!(inb(CONFIG_TTYS0_BASE + UART_LSR) & 0x40))
;
}
@@ -355,7 +355,7 @@ int smbus_read_byte(unsigned device, unsigned address)
/* CAS latency 2 */
#if (CAS_LATENCY == 2)
#define CAS_NB 0x17
- /*
+ /*
* 7 == 0111
* 1 == 0001
*/
@@ -367,7 +367,7 @@ int smbus_read_byte(unsigned device, unsigned address)
#endif
/* CAS latency 3 */
-#if (CAS_LATENCY == 3)
+#if (CAS_LATENCY == 3)
#define CAS_NB 0x13
/*
* 3 == 0011
@@ -381,11 +381,11 @@ int smbus_read_byte(unsigned device, unsigned address)
#endif
#ifndef CAS_NB
-#error "Nothing defined"
+#error "Nothing defined"
#endif
/* Default values for config registers */
-
+
static void set_nbxcfg(void)
{
/* NBXCFG 0x50 - 0x53 */
@@ -417,7 +417,7 @@ static void set_nbxcfg(void)
* ECC Diagnostic Mode Enable == 0 Not Enabled
* MDA present == 0 Not Present
* USWC Write Post During During I/O Bridge Access Enable == 1 Enabled
- * In Order Queue Depth (IQD) (RO) == ??
+ * In Order Queue Depth (IQD) (RO) == ??
*/
pcibios_write_config_dword(I440GX_BUS, I440GX_DEVFN, 0x50, 0xff00000c);
}
@@ -486,7 +486,7 @@ static void set_mbsc(void)
* MD[63:0]# Buffer Strength Control 1 == 3x
* MECC[7:0] Buffer Strength Control 2 == 3x
* MECC[7:0] Buffer Strength Control 1 == 3x
- * CSB7# Buffer Strength == 3x
+ * CSB7# Buffer Strength == 3x
* CSA7# Buffer Strength == 3x
* CSB6# Buffer Strength == 3x
* CSA6# Buffer Strength == 3x
@@ -575,13 +575,13 @@ static void set_pgpol(void)
static void set_mbfs(void)
{
/* MBFS - Memory Buffer Frequencey Select Register */
- /* 0xffff7f
- * [23:20] f == 1111
- * [19:16] f == 1111
- * [15:12] f == 1111
- * [11: 8] f == 1111
- * [ 7: 4] 7 == 0111
- * [ 3: 0] f == 1111
+ /* 0xffff7f
+ * [23:20] f == 1111
+ * [19:16] f == 1111
+ * [15:12] f == 1111
+ * [11: 8] f == 1111
+ * [ 7: 4] 7 == 0111
+ * [ 3: 0] f == 1111
* MAA[14:0], WEA#, SRASA#, SCASA# == 100Mhz Buffers Enabled
* MAB[14,13,10,12:11,9:0], WEB#, SRASB#, SCASB# == 100Mhz Buffers Enabled
* MD[63:0] Control 2 == 100 Mhz Buffer Enable
@@ -622,12 +622,12 @@ static void set_drtc(void)
static void set_pmcr(void)
{
- /* PMCR -- BIOS sets 0x90 into it.
+ /* PMCR -- BIOS sets 0x90 into it.
* 0x10 is REQUIRED.
* we have never used it. So why did this ever work?
*/
pcibios_write_config_byte(I440GX_BUS, I440GX_DEVFN, 0x7a, 0x90);
-
+
}
void sdram_set_registers(void)
{
@@ -651,7 +651,7 @@ void sdram_set_registers(void)
int log2(int value)
{
/* __builtin_bsr is a exactly equivalent to the x86 machine
- * instruction with the exception that it returns -1
+ * instruction with the exception that it returns -1
* when the value presented to it is zero.
* Otherwise __builtin_bsr returns the zero based index of
* the highest bit set.
@@ -670,7 +670,7 @@ static void spd_set_drb(void)
unsigned end_of_memory;
unsigned device;
unsigned drb_reg;
-
+
end_of_memory = 0; /* in multiples of 8MiB */
device = SMBUS_MEM_DEVICE_START;
drb_reg = 0x60;
@@ -704,13 +704,13 @@ static void spd_set_drb(void)
#else
side1_bits += log2((byte2 << 8) | byte);
#endif
-
+
/* now I have the ram size in bits as a power of two (less 1) */
/* Make it mulitples of 8MB */
side1_bits -= 25;
-
+
/* side two */
-
+
/* number of physical banks */
byte = smbus_read_byte(device, 5);
if (byte > 1) {
@@ -783,8 +783,8 @@ static void spd_set_dramc(void)
}
dramc = 0x8;
if ((byte & 0x12) != 0) {
- /* this is a registered part.
- * observation: for register parts, BIOS zeros (!)
+ /* this is a registered part.
+ * observation: for register parts, BIOS zeros (!)
* registers CA-CC. This has an undocumented meaning.
*/
/* But it does make sense the oppisite of registered
@@ -835,7 +835,7 @@ static void spd_enable_refresh(void)
}
byte &= 0x7f;
/* Default refresh rate be conservative */
- refresh_rate = 5;
+ refresh_rate = 5;
/* see if the ram refresh is a supported one */
if (byte < 6) {
#if HAVE_STATIC_ARRAY_SUPPORT
@@ -856,7 +856,7 @@ static void spd_set_sdramc(void)
static void spd_set_rps(void)
{
/*
- * Effects: Uses serial presence detect to set the row size
+ * Effects: Uses serial presence detect to set the row size
* on a given DIMM
* FIXME: Check for illegal/unsupported ram configurations and abort
*/
@@ -881,16 +881,16 @@ static void spd_set_rps(void)
page_size = byte & 0xf;
/* make it in multiples of 2Kb */
page_size -= 11;
-
+
if (page_size <= 0) continue;
-
+
/* FIXME: do something with page sizes greather than 8KB!! */
page_sizes |= (page_size << index);
-
+
/* side two */
byte = smbus_read_byte(device, 5);
if (byte <= 1) continue;
-
+
/* For now only handle the symmetrical case */
page_sizes |= (page_size << (index +2));
}
@@ -898,10 +898,10 @@ static void spd_set_rps(void)
/* we have just verified that we have to have this code. It appears that
* the registered SDRAMs do indeed set the RPS wrong. sheesh.
*/
- /* at this point, page_sizes holds the RPS for all ram.
- * we have verified that for registered DRAM the values are
+ /* at this point, page_sizes holds the RPS for all ram.
+ * we have verified that for registered DRAM the values are
* 1/2 the size they should be. So we test for registered
- * and then double the sizes if needed.
+ * and then double the sizes if needed.
*/
dramc = pcibios_read_config_byte(I440GX_BUS, I440GX_DEVFN, 0x57);
@@ -909,9 +909,9 @@ static void spd_set_rps(void)
/* registered */
/* BIOS makes weird page size for registered! */
- /* what we have found is you need to set the EVEN banks to
- * twice the size. Fortunately there is a very easy way to
- * do this. First, read the WORD value of register 0x74.
+ /* what we have found is you need to set the EVEN banks to
+ * twice the size. Fortunately there is a very easy way to
+ * do this. First, read the WORD value of register 0x74.
*/
page_sizes += 0x1111;
}
@@ -938,8 +938,8 @@ static void spd_set_pgpol(void)
bank_sizes = 0;
bank = 0;
device = SMBUS_MEM_DEVICE_START;
- for(; device <= SMBUS_MEM_DEVICE_END;
- bank += 2, device += SMBUS_MEM_DEVICE_INC) {
+ for(; device <= SMBUS_MEM_DEVICE_END;
+ bank += 2, device += SMBUS_MEM_DEVICE_INC) {
int byte;
/* logical banks */
@@ -947,7 +947,7 @@ static void spd_set_pgpol(void)
if (byte < 0) continue;
if (byte < 4) continue;
bank_sizes |= (1 << bank);
-
+
/* side 2 */
/* Number of physical banks */
byte = smbus_read_byte(device, 5);
@@ -974,14 +974,14 @@ static void spd_set_nbxcfg(void)
/* Say all dimms have no ECC support */
reg = 0xff;
index = 0;
-
+
device = SMBUS_MEM_DEVICE_START;
for(; device <= SMBUS_MEM_DEVICE_END; index += 2, device += SMBUS_MEM_DEVICE_INC) {
int byte;
byte = smbus_read_byte(device, 11);
if (byte < 0) continue;
-#if !USE_ECC
+#if !USE_ECC
byte = 0; /* Disable ECC */
#endif
/* 0 == None, 1 == Parity, 2 == ECC */
@@ -1015,7 +1015,7 @@ static void spd_set_nbxcfg(void)
/* try this.
* We should be setting bit 2 in register 76 and we're not
* technically we should see if CL=2 for the ram,
- * but registered is so screwed up that it's kind of a lost
+ * but registered is so screwed up that it's kind of a lost
* cause.
*/
byte = pcibios_read_config_byte(I440GX_BUS, I440GX_DEVFN, 0x76);
@@ -1098,7 +1098,7 @@ static void dimms_read(unsigned long offset)
int i;
for(i = 0; i < 8; i++) {
unsigned long dummy;
- unsigned long addr;
+ unsigned long addr;
unsigned long next_base;
next_base = dimm_base(i +1);
@@ -1108,8 +1108,8 @@ static void dimms_read(unsigned long offset)
}
addr += offset;
#if HAVE_STRING_SUPPORT
- print_debug("Reading ");
- print_debug_hex32(addr);
+ print_debug("Reading ");
+ print_debug_hex32(addr);
print_debug("\n");
#endif
#if HAVE_POINTER_SUPPORT
@@ -1120,8 +1120,8 @@ static void dimms_read(unsigned long offset)
#endif
#endif
#if HAVE_STRING_SUPPORT
- print_debug("Reading ");
- print_debug_hex32(addr ^ 0xddf8);
+ print_debug("Reading ");
+ print_debug_hex32(addr ^ 0xddf8);
print_debug("\n");
#endif
#if HAVE_POINTER_SUPPORT
@@ -1132,9 +1132,9 @@ static void dimms_read(unsigned long offset)
#endif
#endif
#if HAVE_STRING_SUPPORT
- print_debug("Read ");
- print_debug_hex32(addr);
- print_debug_hex32(addr ^ 0xddf8);
+ print_debug("Read ");
+ print_debug_hex32(addr);
+ print_debug_hex32(addr ^ 0xddf8);
print_debug("\n");
#endif
}
@@ -1212,9 +1212,9 @@ void sdram_enable(void)
#if HAVE_STRING_SUPPORT
print_debug("Ram Enable 2\n");
#endif
-
+
/* Now we need 8 AUTO REFRESH / CBR cycles to be performed */
-
+
sdram_set_command_cbr();
sdram_assert_command();
sdram_assert_command();
@@ -1224,11 +1224,11 @@ void sdram_enable(void)
sdram_assert_command();
sdram_assert_command();
sdram_assert_command();
-
+
#if HAVE_STRING_SUPPORT
print_debug("Ram Enable 3\n");
#endif
-
+
/* mode register set */
sdram_set_mode_register();
/* MAx[14:0] lines,
@@ -1245,7 +1245,7 @@ void sdram_enable(void)
/* normal operation */
sdram_set_command_none();
-
+
#if HAVE_STRING_SUPPORT
print_debug("Ram Enable 5\n");
#endif
@@ -1270,7 +1270,7 @@ void sdram_initialize(void)
print_debug("Ram3\n");
#endif
/* Now that everything is setup enable the SDRAM.
- * Some chipsets do the work for use while on others
+ * Some chipsets do the work for use while on others
* we need to it by hand.
*/
sdram_enable();
diff --git a/util/romcc/tests/raminit_test2.c b/util/romcc/tests/raminit_test2.c
index 2294b34e78..d20ae6d431 100644
--- a/util/romcc/tests/raminit_test2.c
+++ b/util/romcc/tests/raminit_test2.c
@@ -136,7 +136,7 @@ void uart_wait_to_tx_byte(void)
void uart_wait_until_sent(void)
{
- while(!(inb(CONFIG_TTYS0_BASE + UART_LSR) & 0x40))
+ while(!(inb(CONFIG_TTYS0_BASE + UART_LSR) & 0x40))
;
}
@@ -355,7 +355,7 @@ int smbus_read_byte(unsigned device, unsigned address)
/* CAS latency 2 */
#if (CAS_LATENCY == 2)
#define CAS_NB 0x17
- /*
+ /*
* 7 == 0111
* 1 == 0001
*/
@@ -367,7 +367,7 @@ int smbus_read_byte(unsigned device, unsigned address)
#endif
/* CAS latency 3 */
-#if (CAS_LATENCY == 3)
+#if (CAS_LATENCY == 3)
#define CAS_NB 0x13
/*
* 3 == 0011
@@ -381,11 +381,11 @@ int smbus_read_byte(unsigned device, unsigned address)
#endif
#ifndef CAS_NB
-#error "Nothing defined"
+#error "Nothing defined"
#endif
/* Default values for config registers */
-
+
static void set_nbxcfg(void)
{
/* NBXCFG 0x50 - 0x53 */
@@ -417,7 +417,7 @@ static void set_nbxcfg(void)
* ECC Diagnostic Mode Enable == 0 Not Enabled
* MDA present == 0 Not Present
* USWC Write Post During During I/O Bridge Access Enable == 1 Enabled
- * In Order Queue Depth (IQD) (RO) == ??
+ * In Order Queue Depth (IQD) (RO) == ??
*/
pcibios_write_config_dword(I440GX_BUS, I440GX_DEVFN, 0x50, 0xff00000c);
}
@@ -486,7 +486,7 @@ static void set_mbsc(void)
* MD[63:0]# Buffer Strength Control 1 == 3x
* MECC[7:0] Buffer Strength Control 2 == 3x
* MECC[7:0] Buffer Strength Control 1 == 3x
- * CSB7# Buffer Strength == 3x
+ * CSB7# Buffer Strength == 3x
* CSA7# Buffer Strength == 3x
* CSB6# Buffer Strength == 3x
* CSA6# Buffer Strength == 3x
@@ -575,13 +575,13 @@ static void set_pgpol(void)
static void set_mbfs(void)
{
/* MBFS - Memory Buffer Frequencey Select Register */
- /* 0xffff7f
- * [23:20] f == 1111
- * [19:16] f == 1111
- * [15:12] f == 1111
- * [11: 8] f == 1111
- * [ 7: 4] 7 == 0111
- * [ 3: 0] f == 1111
+ /* 0xffff7f
+ * [23:20] f == 1111
+ * [19:16] f == 1111
+ * [15:12] f == 1111
+ * [11: 8] f == 1111
+ * [ 7: 4] 7 == 0111
+ * [ 3: 0] f == 1111
* MAA[14:0], WEA#, SRASA#, SCASA# == 100Mhz Buffers Enabled
* MAB[14,13,10,12:11,9:0], WEB#, SRASB#, SCASB# == 100Mhz Buffers Enabled
* MD[63:0] Control 2 == 100 Mhz Buffer Enable
@@ -622,12 +622,12 @@ static void set_drtc(void)
static void set_pmcr(void)
{
- /* PMCR -- BIOS sets 0x90 into it.
+ /* PMCR -- BIOS sets 0x90 into it.
* 0x10 is REQUIRED.
* we have never used it. So why did this ever work?
*/
pcibios_write_config_byte(I440GX_BUS, I440GX_DEVFN, 0x7a, 0x90);
-
+
}
void sdram_set_registers(void)
{
@@ -651,7 +651,7 @@ void sdram_set_registers(void)
int log2(int value)
{
/* __builtin_bsr is a exactly equivalent to the x86 machine
- * instruction with the exception that it returns -1
+ * instruction with the exception that it returns -1
* when the value presented to it is zero.
* Otherwise __builtin_bsr returns the zero based index of
* the highest bit set.
@@ -670,7 +670,7 @@ static void spd_set_drb(void)
unsigned end_of_memory;
unsigned device;
unsigned drb_reg;
-
+
end_of_memory = 0; /* in multiples of 8MiB */
device = SMBUS_MEM_DEVICE_START;
drb_reg = 0x60;
@@ -704,13 +704,13 @@ static void spd_set_drb(void)
#else
side1_bits += log2((byte2 << 8) | byte);
#endif
-
+
/* now I have the ram size in bits as a power of two (less 1) */
/* Make it mulitples of 8MB */
side1_bits -= 25;
-
+
/* side two */
-
+
/* number of physical banks */
byte = smbus_read_byte(device, 5);
if (byte > 1) {
@@ -783,8 +783,8 @@ static void spd_set_dramc(void)
}
dramc = 0x8;
if ((byte & 0x12) != 0) {
- /* this is a registered part.
- * observation: for register parts, BIOS zeros (!)
+ /* this is a registered part.
+ * observation: for register parts, BIOS zeros (!)
* registers CA-CC. This has an undocumented meaning.
*/
/* But it does make sense the oppisite of registered
@@ -835,7 +835,7 @@ static void spd_enable_refresh(void)
}
byte &= 0x7f;
/* Default refresh rate be conservative */
- refresh_rate = 5;
+ refresh_rate = 5;
/* see if the ram refresh is a supported one */
if (byte < 6) {
#if HAVE_STATIC_ARRAY_SUPPORT
@@ -856,7 +856,7 @@ static void spd_set_sdramc(void)
static void spd_set_rps(void)
{
/*
- * Effects: Uses serial presence detect to set the row size
+ * Effects: Uses serial presence detect to set the row size
* on a given DIMM
* FIXME: Check for illegal/unsupported ram configurations and abort
*/
@@ -881,16 +881,16 @@ static void spd_set_rps(void)
page_size = byte & 0xf;
/* make it in multiples of 2Kb */
page_size -= 11;
-
+
if (page_size <= 0) continue;
-
+
/* FIXME: do something with page sizes greather than 8KB!! */
page_sizes |= (page_size << index);
-
+
/* side two */
byte = smbus_read_byte(device, 5);
if (byte <= 1) continue;
-
+
/* For now only handle the symmetrical case */
page_sizes |= (page_size << (index +2));
}
@@ -898,10 +898,10 @@ static void spd_set_rps(void)
/* we have just verified that we have to have this code. It appears that
* the registered SDRAMs do indeed set the RPS wrong. sheesh.
*/
- /* at this point, page_sizes holds the RPS for all ram.
- * we have verified that for registered DRAM the values are
+ /* at this point, page_sizes holds the RPS for all ram.
+ * we have verified that for registered DRAM the values are
* 1/2 the size they should be. So we test for registered
- * and then double the sizes if needed.
+ * and then double the sizes if needed.
*/
dramc = pcibios_read_config_byte(I440GX_BUS, I440GX_DEVFN, 0x57);
@@ -909,9 +909,9 @@ static void spd_set_rps(void)
/* registered */
/* BIOS makes weird page size for registered! */
- /* what we have found is you need to set the EVEN banks to
- * twice the size. Fortunately there is a very easy way to
- * do this. First, read the WORD value of register 0x74.
+ /* what we have found is you need to set the EVEN banks to
+ * twice the size. Fortunately there is a very easy way to
+ * do this. First, read the WORD value of register 0x74.
*/
page_sizes += 0x1111;
}
@@ -938,8 +938,8 @@ static void spd_set_pgpol(void)
bank_sizes = 0;
bank = 0;
device = SMBUS_MEM_DEVICE_START;
- for(; device <= SMBUS_MEM_DEVICE_END;
- bank += 2, device += SMBUS_MEM_DEVICE_INC) {
+ for(; device <= SMBUS_MEM_DEVICE_END;
+ bank += 2, device += SMBUS_MEM_DEVICE_INC) {
int byte;
/* logical banks */
@@ -947,7 +947,7 @@ static void spd_set_pgpol(void)
if (byte < 0) continue;
if (byte < 4) continue;
bank_sizes |= (1 << bank);
-
+
/* side 2 */
/* Number of physical banks */
byte = smbus_read_byte(device, 5);
@@ -974,14 +974,14 @@ static void spd_set_nbxcfg(void)
/* Say all dimms have no ECC support */
reg = 0xff;
index = 0;
-
+
device = SMBUS_MEM_DEVICE_START;
for(; device <= SMBUS_MEM_DEVICE_END; index += 2, device += SMBUS_MEM_DEVICE_INC) {
int byte;
byte = smbus_read_byte(device, 11);
if (byte < 0) continue;
-#if !USE_ECC
+#if !USE_ECC
byte = 0; /* Disable ECC */
#endif
/* 0 == None, 1 == Parity, 2 == ECC */
@@ -1015,7 +1015,7 @@ static void spd_set_nbxcfg(void)
/* try this.
* We should be setting bit 2 in register 76 and we're not
* technically we should see if CL=2 for the ram,
- * but registered is so screwed up that it's kind of a lost
+ * but registered is so screwed up that it's kind of a lost
* cause.
*/
byte = pcibios_read_config_byte(I440GX_BUS, I440GX_DEVFN, 0x76);
@@ -1098,7 +1098,7 @@ static void dimms_read(unsigned long offset)
int i;
for(i = 0; i < 8; i++) {
unsigned long dummy;
- unsigned long addr;
+ unsigned long addr;
unsigned long next_base;
next_base = dimm_base(i +1);
@@ -1108,8 +1108,8 @@ static void dimms_read(unsigned long offset)
}
addr += offset;
#if HAVE_STRING_SUPPORT
- print_debug("Reading ");
- print_debug_hex32(addr);
+ print_debug("Reading ");
+ print_debug_hex32(addr);
print_debug("\n");
#endif
#if HAVE_POINTER_SUPPORT
@@ -1120,8 +1120,8 @@ static void dimms_read(unsigned long offset)
#endif
#endif
#if HAVE_STRING_SUPPORT
- print_debug("Reading ");
- print_debug_hex32(addr ^ 0xddf8);
+ print_debug("Reading ");
+ print_debug_hex32(addr ^ 0xddf8);
print_debug("\n");
#endif
#if HAVE_POINTER_SUPPORT
@@ -1132,9 +1132,9 @@ static void dimms_read(unsigned long offset)
#endif
#endif
#if HAVE_STRING_SUPPORT
- print_debug("Read ");
- print_debug_hex32(addr);
- print_debug_hex32(addr ^ 0xddf8);
+ print_debug("Read ");
+ print_debug_hex32(addr);
+ print_debug_hex32(addr ^ 0xddf8);
print_debug("\n");
#endif
}
@@ -1212,9 +1212,9 @@ void sdram_enable(void)
#if HAVE_STRING_SUPPORT
print_debug("Ram Enable 2\n");
#endif
-
+
/* Now we need 8 AUTO REFRESH / CBR cycles to be performed */
-
+
sdram_set_command_cbr();
sdram_assert_command();
sdram_assert_command();
@@ -1224,11 +1224,11 @@ void sdram_enable(void)
sdram_assert_command();
sdram_assert_command();
sdram_assert_command();
-
+
#if HAVE_STRING_SUPPORT
print_debug("Ram Enable 3\n");
#endif
-
+
/* mode register set */
sdram_set_mode_register();
/* MAx[14:0] lines,
@@ -1245,7 +1245,7 @@ void sdram_enable(void)
/* normal operation */
sdram_set_command_none();
-
+
#if HAVE_STRING_SUPPORT
print_debug("Ram Enable 5\n");
#endif
@@ -1270,7 +1270,7 @@ void sdram_initialize(void)
print_debug("Ram3\n");
#endif
/* Now that everything is setup enable the SDRAM.
- * Some chipsets do the work for use while on others
+ * Some chipsets do the work for use while on others
* we need to it by hand.
*/
sdram_enable();
diff --git a/util/romcc/tests/raminit_test6.c b/util/romcc/tests/raminit_test6.c
index a0c3f055be..e99e355e33 100644
--- a/util/romcc/tests/raminit_test6.c
+++ b/util/romcc/tests/raminit_test6.c
@@ -1,30 +1,30 @@
typedef unsigned char uint8_t;
-typedef signed char int8_t;
+typedef signed char int8_t;
typedef unsigned short uint16_t;
typedef signed short int16_t;
typedef unsigned int uint32_t;
typedef signed int int32_t;
-
+
typedef unsigned char uint_least8_t;
-typedef signed char int_least8_t;
+typedef signed char int_least8_t;
typedef unsigned short uint_least16_t;
typedef signed short int_least16_t;
typedef unsigned int uint_least32_t;
typedef signed int int_least32_t;
-
+
typedef unsigned char uint_fast8_t;
-typedef signed char int_fast8_t;
+typedef signed char int_fast8_t;
typedef unsigned int uint_fast16_t;
typedef signed int int_fast16_t;
typedef unsigned int uint_fast32_t;
typedef signed int int_fast32_t;
-
+
typedef int intptr_t;
typedef unsigned int uintptr_t;
-
+
typedef long int intmax_t;
typedef unsigned long int uintmax_t;
-
+
static inline unsigned long apic_read(unsigned long reg)
{
return *((volatile unsigned long *)(0xfee00000 +reg));
@@ -37,7 +37,7 @@ static inline void apic_wait_icr_idle(void)
{
do { } while ( apic_read( 0x300 ) & 0x01000 );
}
-
+
static void outb(unsigned char value, unsigned short port)
{
__builtin_outb(value, port);
@@ -65,7 +65,7 @@ static unsigned char inl(unsigned short port)
static inline void outsb(uint16_t port, const void *addr, unsigned long count)
{
__asm__ __volatile__ (
- "cld ; rep ; outsb "
+ "cld ; rep ; outsb "
: "=S" (addr), "=c" (count)
: "d"(port), "0"(addr), "1" (count)
);
@@ -73,7 +73,7 @@ static inline void outsb(uint16_t port, const void *addr, unsigned long count)
static inline void outsw(uint16_t port, const void *addr, unsigned long count)
{
__asm__ __volatile__ (
- "cld ; rep ; outsw "
+ "cld ; rep ; outsw "
: "=S" (addr), "=c" (count)
: "d"(port), "0"(addr), "1" (count)
);
@@ -81,7 +81,7 @@ static inline void outsw(uint16_t port, const void *addr, unsigned long count)
static inline void outsl(uint16_t port, const void *addr, unsigned long count)
{
__asm__ __volatile__ (
- "cld ; rep ; outsl "
+ "cld ; rep ; outsl "
: "=S" (addr), "=c" (count)
: "d"(port), "0"(addr), "1" (count)
);
@@ -89,7 +89,7 @@ static inline void outsl(uint16_t port, const void *addr, unsigned long count)
static inline void insb(uint16_t port, void *addr, unsigned long count)
{
__asm__ __volatile__ (
- "cld ; rep ; insb "
+ "cld ; rep ; insb "
: "=D" (addr), "=c" (count)
: "d"(port), "0"(addr), "1" (count)
);
@@ -97,7 +97,7 @@ static inline void insb(uint16_t port, void *addr, unsigned long count)
static inline void insw(uint16_t port, void *addr, unsigned long count)
{
__asm__ __volatile__ (
- "cld ; rep ; insw "
+ "cld ; rep ; insw "
: "=D" (addr), "=c" (count)
: "d"(port), "0"(addr), "1" (count)
);
@@ -105,7 +105,7 @@ static inline void insw(uint16_t port, void *addr, unsigned long count)
static inline void insl(uint16_t port, void *addr, unsigned long count)
{
__asm__ __volatile__ (
- "cld ; rep ; insl "
+ "cld ; rep ; insl "
: "=D" (addr), "=c" (count)
: "d"(port), "0"(addr), "1" (count)
);
@@ -180,7 +180,7 @@ static uldiv_t uldiv(unsigned long numer, unsigned long denom)
}
int log2(int value)
{
-
+
return __builtin_bsr(value);
}
typedef unsigned device_t;
@@ -237,11 +237,11 @@ static device_t pci_locate_device(unsigned pci_id, device_t dev)
}
return (0xffffffffU) ;
}
-
-
-
-
-
+
+
+
+
+
static int uart_can_tx_byte(void)
{
return inb(1016 + 0x05 ) & 0x20;
@@ -253,29 +253,29 @@ static void uart_wait_to_tx_byte(void)
}
static void uart_wait_until_sent(void)
{
- while(!(inb(1016 + 0x05 ) & 0x40))
+ while(!(inb(1016 + 0x05 ) & 0x40))
;
}
static void uart_tx_byte(unsigned char data)
{
uart_wait_to_tx_byte();
outb(data, 1016 + 0x00 );
-
+
uart_wait_until_sent();
}
static void uart_init(void)
{
-
+
outb(0x0, 1016 + 0x01 );
-
+
outb(0x01, 1016 + 0x02 );
-
+
outb(0x80 | 3 , 1016 + 0x03 );
outb((115200/ 115200 ) & 0xFF, 1016 + 0x00 );
outb(((115200/ 115200 ) >> 8) & 0xFF, 1016 + 0x01 );
outb(3 , 1016 + 0x03 );
}
-
+
static void __console_tx_byte(unsigned char byte)
{
uart_tx_byte(byte);
@@ -380,12 +380,12 @@ static void print_spew_hex32(unsigned int value) { __console_tx_hex32(8 , value)
static void print_spew(const char *str) { __console_tx_string(8 , str); }
static void console_init(void)
{
- static const char console_test[] =
+ static const char console_test[] =
"\r\n\r\nLinuxBIOS-"
- "1.1.4"
- ".0Fallback"
+ "1.1.4"
+ ".0Fallback"
" "
- "Thu Oct 9 20:29:48 MDT 2003"
+ "Thu Oct 9 20:29:48 MDT 2003"
" starting...\r\n";
print_info(console_test);
}
@@ -400,9 +400,9 @@ static void write_phys(unsigned long addr, unsigned long value)
{
asm volatile(
"movnti %1, (%0)"
- :
- : "r" (addr), "r" (value)
- :
+ :
+ : "r" (addr), "r" (value)
+ :
);
}
static unsigned long read_phys(unsigned long addr)
@@ -414,28 +414,28 @@ static unsigned long read_phys(unsigned long addr)
static void ram_fill(unsigned long start, unsigned long stop)
{
unsigned long addr;
-
+
print_debug("DRAM fill: ");
print_debug_hex32(start);
print_debug("-");
print_debug_hex32(stop);
print_debug("\r\n");
for(addr = start; addr < stop ; addr += 4) {
-
+
if (!(addr & 0xffff)) {
print_debug_hex32(addr);
print_debug("\r");
}
write_phys(addr, addr);
};
-
+
print_debug_hex32(addr);
print_debug("\r\nDRAM filled\r\n");
}
static void ram_verify(unsigned long start, unsigned long stop)
{
unsigned long addr;
-
+
print_debug("DRAM verify: ");
print_debug_hex32(start);
print_debug_char('-');
@@ -443,31 +443,31 @@ static void ram_verify(unsigned long start, unsigned long stop)
print_debug("\r\n");
for(addr = start; addr < stop ; addr += 4) {
unsigned long value;
-
+
if (!(addr & 0xffff)) {
print_debug_hex32(addr);
print_debug("\r");
}
value = read_phys(addr);
if (value != addr) {
-
+
print_err_hex32(addr);
print_err_char(':');
print_err_hex32(value);
print_err("\r\n");
}
}
-
+
print_debug_hex32(addr);
print_debug("\r\nDRAM verified\r\n");
}
void ram_check(unsigned long start, unsigned long stop)
{
int result;
-
+
print_debug("Testing DRAM : ");
print_debug_hex32(start);
- print_debug("-");
+ print_debug("-");
print_debug_hex32(stop);
print_debug("\r\n");
ram_fill(start, stop);
@@ -476,7 +476,7 @@ void ram_check(unsigned long start, unsigned long stop)
}
static int enumerate_ht_chain(unsigned link)
{
-
+
unsigned next_unitid, last_unitid;
int reset_needed = 0;
next_unitid = 1;
@@ -485,7 +485,7 @@ static int enumerate_ht_chain(unsigned link)
uint8_t hdr_type, pos;
last_unitid = next_unitid;
id = pci_read_config32(( ((( 0 ) & 0xFF) << 16) | ((( 0 ) & 0x1f) << 11) | ((( 0 ) & 0x7) << 8)) , 0x00 );
-
+
if (((id & 0xffff) == 0x0000) || ((id & 0xffff) == 0xffff) ||
(((id >> 16) & 0xffff) == 0xffff) ||
(((id >> 16) & 0xffff) == 0x0000)) {
@@ -531,7 +531,7 @@ static void enable_smbus(void)
pci_write_config32(dev, 0x58, 0x0f00 | 1);
enable = pci_read_config8(dev, 0x41);
pci_write_config8(dev, 0x41, enable | (1 << 7));
-
+
outw(inw(0x0f00 + 0xe0 ), 0x0f00 + 0xe0 );
}
static inline void smbus_delay(void)
@@ -550,7 +550,7 @@ static int smbus_wait_until_ready(void)
break;
}
if(loops == ((100*1000*10) / 2)) {
- outw(inw(0x0f00 + 0xe0 ),
+ outw(inw(0x0f00 + 0xe0 ),
0x0f00 + 0xe0 );
}
} while(--loops);
@@ -563,7 +563,7 @@ static int smbus_wait_until_done(void)
do {
unsigned short val;
smbus_delay();
-
+
val = inw(0x0f00 + 0xe0 );
if (((val & 0x8) == 0) | ((val & 0x437) != 0)) {
break;
@@ -579,29 +579,29 @@ static int smbus_read_byte(unsigned device, unsigned address)
if (smbus_wait_until_ready() < 0) {
return -2;
}
-
-
-
+
+
+
outw(inw(0x0f00 + 0xe2 ) & ~((1<<10)|(1<<9)|(1<<8)|(1<<4)), 0x0f00 + 0xe2 );
-
+
outw(((device & 0x7f) << 1) | 1, 0x0f00 + 0xe4 );
-
+
outb(address & 0xFF, 0x0f00 + 0xe8 );
-
+
outw((inw(0x0f00 + 0xe2 ) & ~7) | (0x2), 0x0f00 + 0xe2 );
-
-
+
+
outw(inw(0x0f00 + 0xe0 ), 0x0f00 + 0xe0 );
-
+
outw(0, 0x0f00 + 0xe6 );
-
+
outw((inw(0x0f00 + 0xe2 ) | (1 << 3)), 0x0f00 + 0xe2 );
-
+
if (smbus_wait_until_done() < 0) {
return -3;
}
global_status_register = inw(0x0f00 + 0xe0 );
-
+
byte = inw(0x0f00 + 0xe6 ) & 0xff;
if (global_status_register != (1 << 4)) {
return -1;
@@ -636,31 +636,31 @@ static tsc_t rdtsc(void)
{
tsc_t res;
asm ("rdtsc"
- : "=a" (res.lo), "=d"(res.hi)
- :
- :
+ : "=a" (res.lo), "=d"(res.hi)
+ :
+ :
);
return res;
}
void init_timer(void)
{
-
+
apic_write(0x320 , (1 << 17)|(1<< 16)|(0 << 12)|(0 << 0));
-
+
apic_write(0x3E0 , 0xB );
-
+
apic_write(0x380 , 0xffffffff);
}
void udelay(unsigned usecs)
{
uint32_t start, value, ticks;
-
+
ticks = usecs * 200;
start = apic_read(0x390 );
do {
value = apic_read(0x390 );
} while((start - value) < ticks);
-
+
}
void mdelay(unsigned msecs)
{
@@ -732,8 +732,8 @@ static void print_debug_pci_dev(unsigned dev)
static void print_pci_devices(void)
{
device_t dev;
- for(dev = ( ((( 0 ) & 0xFF) << 16) | ((( 0 ) & 0x1f) << 11) | ((( 0 ) & 0x7) << 8)) ;
- dev <= ( ((( 0 ) & 0xFF) << 16) | ((( 0x1f ) & 0x1f) << 11) | ((( 0x7 ) & 0x7) << 8)) ;
+ for(dev = ( ((( 0 ) & 0xFF) << 16) | ((( 0 ) & 0x1f) << 11) | ((( 0 ) & 0x7) << 8)) ;
+ dev <= ( ((( 0 ) & 0xFF) << 16) | ((( 0x1f ) & 0x1f) << 11) | ((( 0x7 ) & 0x7) << 8)) ;
dev += ( ((( 0 ) & 0xFF) << 16) | ((( 0 ) & 0x1f) << 11) | ((( 1 ) & 0x7) << 8)) ) {
uint32_t id;
id = pci_read_config32(dev, 0x00 );
@@ -751,7 +751,7 @@ static void dump_pci_device(unsigned dev)
int i;
print_debug_pci_dev(dev);
print_debug("\r\n");
-
+
for(i = 0; i <= 255; i++) {
unsigned char val;
if ((i & 0x0f) == 0) {
@@ -769,8 +769,8 @@ static void dump_pci_device(unsigned dev)
static void dump_pci_devices(void)
{
device_t dev;
- for(dev = ( ((( 0 ) & 0xFF) << 16) | ((( 0 ) & 0x1f) << 11) | ((( 0 ) & 0x7) << 8)) ;
- dev <= ( ((( 0 ) & 0xFF) << 16) | ((( 0x1f ) & 0x1f) << 11) | ((( 0x7 ) & 0x7) << 8)) ;
+ for(dev = ( ((( 0 ) & 0xFF) << 16) | ((( 0 ) & 0x1f) << 11) | ((( 0 ) & 0x7) << 8)) ;
+ dev <= ( ((( 0 ) & 0xFF) << 16) | ((( 0x1f ) & 0x1f) << 11) | ((( 0x7 ) & 0x7) << 8)) ;
dev += ( ((( 0 ) & 0xFF) << 16) | ((( 0 ) & 0x1f) << 11) | ((( 1 ) & 0x7) << 8)) ) {
uint32_t id;
id = pci_read_config32(dev, 0x00 );
@@ -791,8 +791,8 @@ static void dump_spd_registers(const struct mem_controller *ctrl)
device = ctrl->channel0[i];
if (device) {
int j;
- print_debug("dimm: ");
- print_debug_hex8(i);
+ print_debug("dimm: ");
+ print_debug_hex8(i);
print_debug(".0: ");
print_debug_hex8(device);
for(j = 0; j < 256; j++) {
@@ -817,8 +817,8 @@ static void dump_spd_registers(const struct mem_controller *ctrl)
device = ctrl->channel1[i];
if (device) {
int j;
- print_debug("dimm: ");
- print_debug_hex8(i);
+ print_debug("dimm: ");
+ print_debug_hex8(i);
print_debug(".1: ");
print_debug_hex8(device);
for(j = 0; j < 256; j++) {
@@ -842,13 +842,13 @@ static void dump_spd_registers(const struct mem_controller *ctrl)
}
}
}
-
+
static unsigned int cpuid(unsigned int op)
{
unsigned int ret;
unsigned dummy2,dummy3,dummy4;
- asm volatile (
- "cpuid"
+ asm volatile (
+ "cpuid"
: "=a" (ret), "=b" (dummy2), "=c" (dummy3), "=d" (dummy4)
: "a" (op)
);
@@ -865,13 +865,13 @@ static int is_cpu_pre_c0(void)
static void memreset_setup(void)
{
if (is_cpu_pre_c0()) {
-
+
outb((0 << 7)|(0 << 6)|(0<<5)|(0<<4)|(1<<2)|(0<<0), 0x0f00 + 0xc0 + 28);
-
+
outb((0 << 7)|(0 << 6)|(0<<5)|(0<<4)|(1<<2)|(0<<0), 0x0f00 + 0xc0 + 29);
}
else {
-
+
outb((0 << 7)|(0 << 6)|(0<<5)|(0<<4)|(1<<2)|(1<<0), 0x0f00 + 0xc0 + 29);
}
}
@@ -879,15 +879,15 @@ static void memreset(int controllers, const struct mem_controller *ctrl)
{
if (is_cpu_pre_c0()) {
udelay(800);
-
+
outb((0<<7)|(0<<6)|(0<<5)|(0<<4)|(1<<2)|(1<<0), 0x0f00 + 0xc0 + 28);
udelay(90);
}
}
static unsigned int generate_row(uint8_t node, uint8_t row, uint8_t maxnodes)
{
-
- uint32_t ret=0x00010101;
+
+ uint32_t ret=0x00010101;
static const unsigned int rows_2p[2][2] = {
{ 0x00050101, 0x00010404 },
{ 0x00010404, 0x00050101 }
@@ -905,33 +905,33 @@ static inline int spd_read_byte(unsigned device, unsigned address)
{
return smbus_read_byte(device, address);
}
-
+
static void coherent_ht_mainboard(unsigned cpus)
{
}
-
+
void cpu_ldtstop(unsigned cpus)
{
uint32_t tmp;
device_t dev;
unsigned cnt;
for(cnt=0; cnt<cpus; cnt++) {
-
+
pci_write_config8(( ((( 0 ) & 0xFF) << 16) | ((( 24 ) & 0x1f) << 11) | ((( 3 ) & 0x7) << 8)) ,0x81,0x23);
-
+
pci_write_config32(( ((( 0 ) & 0xFF) << 16) | ((( 24 ) & 0x1f) << 11) | ((( 3 ) & 0x7) << 8)) ,0xd4,0x00000701);
-
+
pci_write_config32(( ((( 0 ) & 0xFF) << 16) | ((( 24 ) & 0x1f) << 11) | ((( 3 ) & 0x7) << 8)) ,0xd8,0x00000000);
-
+
tmp=pci_read_config32(( ((( 0 ) & 0xFF) << 16) | ((( 24 ) & 0x1f) << 11) | ((( 2 ) & 0x7) << 8)) ,0x90);
pci_write_config32(( ((( 0 ) & 0xFF) << 16) | ((( 24 ) & 0x1f) << 11) | ((( 2 ) & 0x7) << 8)) ,0x90, tmp | (1<<24) );
}
}
-
-
-
-
-
+
+
+
+
+
static void setup_resource_map(const unsigned int *register_values, int max)
{
int i;
@@ -952,8 +952,8 @@ static void setup_resource_map(const unsigned int *register_values, int max)
static void setup_default_resource_map(void)
{
static const unsigned int register_values[] = {
-
-
+
+
( ((( 0 ) & 0xFF) << 16) | ((( 0x18 ) & 0x1f) << 11) | ((( 1 ) & 0x07) << 8) | (( 0x44 ) & 0xFF)) , 0x0000f8f8, 0x00000000,
( ((( 0 ) & 0xFF) << 16) | ((( 0x18 ) & 0x1f) << 11) | ((( 1 ) & 0x07) << 8) | (( 0x4C ) & 0xFF)) , 0x0000f8f8, 0x00000001,
( ((( 0 ) & 0xFF) << 16) | ((( 0x18 ) & 0x1f) << 11) | ((( 1 ) & 0x07) << 8) | (( 0x54 ) & 0xFF)) , 0x0000f8f8, 0x00000002,
@@ -962,7 +962,7 @@ static void setup_default_resource_map(void)
( ((( 0 ) & 0xFF) << 16) | ((( 0x18 ) & 0x1f) << 11) | ((( 1 ) & 0x07) << 8) | (( 0x6C ) & 0xFF)) , 0x0000f8f8, 0x00000005,
( ((( 0 ) & 0xFF) << 16) | ((( 0x18 ) & 0x1f) << 11) | ((( 1 ) & 0x07) << 8) | (( 0x74 ) & 0xFF)) , 0x0000f8f8, 0x00000006,
( ((( 0 ) & 0xFF) << 16) | ((( 0x18 ) & 0x1f) << 11) | ((( 1 ) & 0x07) << 8) | (( 0x7C ) & 0xFF)) , 0x0000f8f8, 0x00000007,
-
+
( ((( 0 ) & 0xFF) << 16) | ((( 0x18 ) & 0x1f) << 11) | ((( 1 ) & 0x07) << 8) | (( 0x40 ) & 0xFF)) , 0x0000f8fc, 0x00000000,
( ((( 0 ) & 0xFF) << 16) | ((( 0x18 ) & 0x1f) << 11) | ((( 1 ) & 0x07) << 8) | (( 0x48 ) & 0xFF)) , 0x0000f8fc, 0x00000000,
( ((( 0 ) & 0xFF) << 16) | ((( 0x18 ) & 0x1f) << 11) | ((( 1 ) & 0x07) << 8) | (( 0x50 ) & 0xFF)) , 0x0000f8fc, 0x00000000,
@@ -971,7 +971,7 @@ static void setup_default_resource_map(void)
( ((( 0 ) & 0xFF) << 16) | ((( 0x18 ) & 0x1f) << 11) | ((( 1 ) & 0x07) << 8) | (( 0x68 ) & 0xFF)) , 0x0000f8fc, 0x00000000,
( ((( 0 ) & 0xFF) << 16) | ((( 0x18 ) & 0x1f) << 11) | ((( 1 ) & 0x07) << 8) | (( 0x70 ) & 0xFF)) , 0x0000f8fc, 0x00000000,
( ((( 0 ) & 0xFF) << 16) | ((( 0x18 ) & 0x1f) << 11) | ((( 1 ) & 0x07) << 8) | (( 0x78 ) & 0xFF)) , 0x0000f8fc, 0x00000000,
-
+
( ((( 0 ) & 0xFF) << 16) | ((( 0x18 ) & 0x1f) << 11) | ((( 1 ) & 0x07) << 8) | (( 0x84 ) & 0xFF)) , 0x00000048, 0x00000000,
( ((( 0 ) & 0xFF) << 16) | ((( 0x18 ) & 0x1f) << 11) | ((( 1 ) & 0x07) << 8) | (( 0x8C ) & 0xFF)) , 0x00000048, 0x00000000,
( ((( 0 ) & 0xFF) << 16) | ((( 0x18 ) & 0x1f) << 11) | ((( 1 ) & 0x07) << 8) | (( 0x94 ) & 0xFF)) , 0x00000048, 0x00000000,
@@ -980,7 +980,7 @@ static void setup_default_resource_map(void)
( ((( 0 ) & 0xFF) << 16) | ((( 0x18 ) & 0x1f) << 11) | ((( 1 ) & 0x07) << 8) | (( 0xAC ) & 0xFF)) , 0x00000048, 0x00000000,
( ((( 0 ) & 0xFF) << 16) | ((( 0x18 ) & 0x1f) << 11) | ((( 1 ) & 0x07) << 8) | (( 0xB4 ) & 0xFF)) , 0x00000048, 0x00000000,
( ((( 0 ) & 0xFF) << 16) | ((( 0x18 ) & 0x1f) << 11) | ((( 1 ) & 0x07) << 8) | (( 0xBC ) & 0xFF)) , 0x00000048, 0x00ffff00,
-
+
( ((( 0 ) & 0xFF) << 16) | ((( 0x18 ) & 0x1f) << 11) | ((( 1 ) & 0x07) << 8) | (( 0x80 ) & 0xFF)) , 0x000000f0, 0x00000000,
( ((( 0 ) & 0xFF) << 16) | ((( 0x18 ) & 0x1f) << 11) | ((( 1 ) & 0x07) << 8) | (( 0x88 ) & 0xFF)) , 0x000000f0, 0x00000000,
( ((( 0 ) & 0xFF) << 16) | ((( 0x18 ) & 0x1f) << 11) | ((( 1 ) & 0x07) << 8) | (( 0x90 ) & 0xFF)) , 0x000000f0, 0x00000000,
@@ -989,17 +989,17 @@ static void setup_default_resource_map(void)
( ((( 0 ) & 0xFF) << 16) | ((( 0x18 ) & 0x1f) << 11) | ((( 1 ) & 0x07) << 8) | (( 0xA8 ) & 0xFF)) , 0x000000f0, 0x00000000,
( ((( 0 ) & 0xFF) << 16) | ((( 0x18 ) & 0x1f) << 11) | ((( 1 ) & 0x07) << 8) | (( 0xB0 ) & 0xFF)) , 0x000000f0, 0x00000000,
( ((( 0 ) & 0xFF) << 16) | ((( 0x18 ) & 0x1f) << 11) | ((( 1 ) & 0x07) << 8) | (( 0xB8 ) & 0xFF)) , 0x000000f0, 0x00fc0003,
-
+
( ((( 0 ) & 0xFF) << 16) | ((( 0x18 ) & 0x1f) << 11) | ((( 1 ) & 0x07) << 8) | (( 0xC4 ) & 0xFF)) , 0xFE000FC8, 0x01fff000,
( ((( 0 ) & 0xFF) << 16) | ((( 0x18 ) & 0x1f) << 11) | ((( 1 ) & 0x07) << 8) | (( 0xCC ) & 0xFF)) , 0xFE000FC8, 0x00000000,
( ((( 0 ) & 0xFF) << 16) | ((( 0x18 ) & 0x1f) << 11) | ((( 1 ) & 0x07) << 8) | (( 0xD4 ) & 0xFF)) , 0xFE000FC8, 0x00000000,
( ((( 0 ) & 0xFF) << 16) | ((( 0x18 ) & 0x1f) << 11) | ((( 1 ) & 0x07) << 8) | (( 0xDC ) & 0xFF)) , 0xFE000FC8, 0x00000000,
-
+
( ((( 0 ) & 0xFF) << 16) | ((( 0x18 ) & 0x1f) << 11) | ((( 1 ) & 0x07) << 8) | (( 0xC0 ) & 0xFF)) , 0xFE000FCC, 0x00000003,
( ((( 0 ) & 0xFF) << 16) | ((( 0x18 ) & 0x1f) << 11) | ((( 1 ) & 0x07) << 8) | (( 0xC8 ) & 0xFF)) , 0xFE000FCC, 0x00000000,
( ((( 0 ) & 0xFF) << 16) | ((( 0x18 ) & 0x1f) << 11) | ((( 1 ) & 0x07) << 8) | (( 0xD0 ) & 0xFF)) , 0xFE000FCC, 0x00000000,
( ((( 0 ) & 0xFF) << 16) | ((( 0x18 ) & 0x1f) << 11) | ((( 1 ) & 0x07) << 8) | (( 0xD8 ) & 0xFF)) , 0xFE000FCC, 0x00000000,
-
+
( ((( 0 ) & 0xFF) << 16) | ((( 0x18 ) & 0x1f) << 11) | ((( 1 ) & 0x07) << 8) | (( 0xE0 ) & 0xFF)) , 0x0000FC88, 0xff000003,
( ((( 0 ) & 0xFF) << 16) | ((( 0x18 ) & 0x1f) << 11) | ((( 1 ) & 0x07) << 8) | (( 0xE4 ) & 0xFF)) , 0x0000FC88, 0x00000000,
( ((( 0 ) & 0xFF) << 16) | ((( 0x18 ) & 0x1f) << 11) | ((( 1 ) & 0x07) << 8) | (( 0xE8 ) & 0xFF)) , 0x0000FC88, 0x00000000,
@@ -1012,8 +1012,8 @@ static void setup_default_resource_map(void)
static void sdram_set_registers(const struct mem_controller *ctrl)
{
static const unsigned int register_values[] = {
-
-
+
+
( ((( 0 ) & 0xFF) << 16) | ((( 0x18 ) & 0x1f) << 11) | ((( 1 ) & 0x07) << 8) | (( 0x44 ) & 0xFF)) , 0x0000f8f8, 0x00000000,
( ((( 0 ) & 0xFF) << 16) | ((( 0x18 ) & 0x1f) << 11) | ((( 1 ) & 0x07) << 8) | (( 0x4C ) & 0xFF)) , 0x0000f8f8, 0x00000001,
( ((( 0 ) & 0xFF) << 16) | ((( 0x18 ) & 0x1f) << 11) | ((( 1 ) & 0x07) << 8) | (( 0x54 ) & 0xFF)) , 0x0000f8f8, 0x00000002,
@@ -1022,7 +1022,7 @@ static void sdram_set_registers(const struct mem_controller *ctrl)
( ((( 0 ) & 0xFF) << 16) | ((( 0x18 ) & 0x1f) << 11) | ((( 1 ) & 0x07) << 8) | (( 0x6C ) & 0xFF)) , 0x0000f8f8, 0x00000005,
( ((( 0 ) & 0xFF) << 16) | ((( 0x18 ) & 0x1f) << 11) | ((( 1 ) & 0x07) << 8) | (( 0x74 ) & 0xFF)) , 0x0000f8f8, 0x00000006,
( ((( 0 ) & 0xFF) << 16) | ((( 0x18 ) & 0x1f) << 11) | ((( 1 ) & 0x07) << 8) | (( 0x7C ) & 0xFF)) , 0x0000f8f8, 0x00000007,
-
+
( ((( 0 ) & 0xFF) << 16) | ((( 0x18 ) & 0x1f) << 11) | ((( 1 ) & 0x07) << 8) | (( 0x40 ) & 0xFF)) , 0x0000f8fc, 0x00000000,
( ((( 0 ) & 0xFF) << 16) | ((( 0x18 ) & 0x1f) << 11) | ((( 1 ) & 0x07) << 8) | (( 0x48 ) & 0xFF)) , 0x0000f8fc, 0x00000000,
( ((( 0 ) & 0xFF) << 16) | ((( 0x18 ) & 0x1f) << 11) | ((( 1 ) & 0x07) << 8) | (( 0x50 ) & 0xFF)) , 0x0000f8fc, 0x00000000,
@@ -1031,7 +1031,7 @@ static void sdram_set_registers(const struct mem_controller *ctrl)
( ((( 0 ) & 0xFF) << 16) | ((( 0x18 ) & 0x1f) << 11) | ((( 1 ) & 0x07) << 8) | (( 0x68 ) & 0xFF)) , 0x0000f8fc, 0x00000000,
( ((( 0 ) & 0xFF) << 16) | ((( 0x18 ) & 0x1f) << 11) | ((( 1 ) & 0x07) << 8) | (( 0x70 ) & 0xFF)) , 0x0000f8fc, 0x00000000,
( ((( 0 ) & 0xFF) << 16) | ((( 0x18 ) & 0x1f) << 11) | ((( 1 ) & 0x07) << 8) | (( 0x78 ) & 0xFF)) , 0x0000f8fc, 0x00000000,
-
+
( ((( 0 ) & 0xFF) << 16) | ((( 0x18 ) & 0x1f) << 11) | ((( 2 ) & 0x07) << 8) | (( 0x40 ) & 0xFF)) , 0x001f01fe, 0x00000000,
( ((( 0 ) & 0xFF) << 16) | ((( 0x18 ) & 0x1f) << 11) | ((( 2 ) & 0x07) << 8) | (( 0x44 ) & 0xFF)) , 0x001f01fe, 0x00000000,
( ((( 0 ) & 0xFF) << 16) | ((( 0x18 ) & 0x1f) << 11) | ((( 2 ) & 0x07) << 8) | (( 0x48 ) & 0xFF)) , 0x001f01fe, 0x00000000,
@@ -1040,7 +1040,7 @@ static void sdram_set_registers(const struct mem_controller *ctrl)
( ((( 0 ) & 0xFF) << 16) | ((( 0x18 ) & 0x1f) << 11) | ((( 2 ) & 0x07) << 8) | (( 0x54 ) & 0xFF)) , 0x001f01fe, 0x00000000,
( ((( 0 ) & 0xFF) << 16) | ((( 0x18 ) & 0x1f) << 11) | ((( 2 ) & 0x07) << 8) | (( 0x58 ) & 0xFF)) , 0x001f01fe, 0x00000000,
( ((( 0 ) & 0xFF) << 16) | ((( 0x18 ) & 0x1f) << 11) | ((( 2 ) & 0x07) << 8) | (( 0x5C ) & 0xFF)) , 0x001f01fe, 0x00000000,
-
+
( ((( 0 ) & 0xFF) << 16) | ((( 0x18 ) & 0x1f) << 11) | ((( 2 ) & 0x07) << 8) | (( 0x60 ) & 0xFF)) , 0xC01f01ff, 0x00000000,
( ((( 0 ) & 0xFF) << 16) | ((( 0x18 ) & 0x1f) << 11) | ((( 2 ) & 0x07) << 8) | (( 0x64 ) & 0xFF)) , 0xC01f01ff, 0x00000000,
( ((( 0 ) & 0xFF) << 16) | ((( 0x18 ) & 0x1f) << 11) | ((( 2 ) & 0x07) << 8) | (( 0x68 ) & 0xFF)) , 0xC01f01ff, 0x00000000,
@@ -1049,33 +1049,33 @@ static void sdram_set_registers(const struct mem_controller *ctrl)
( ((( 0 ) & 0xFF) << 16) | ((( 0x18 ) & 0x1f) << 11) | ((( 2 ) & 0x07) << 8) | (( 0x74 ) & 0xFF)) , 0xC01f01ff, 0x00000000,
( ((( 0 ) & 0xFF) << 16) | ((( 0x18 ) & 0x1f) << 11) | ((( 2 ) & 0x07) << 8) | (( 0x78 ) & 0xFF)) , 0xC01f01ff, 0x00000000,
( ((( 0 ) & 0xFF) << 16) | ((( 0x18 ) & 0x1f) << 11) | ((( 2 ) & 0x07) << 8) | (( 0x7C ) & 0xFF)) , 0xC01f01ff, 0x00000000,
-
+
( ((( 0 ) & 0xFF) << 16) | ((( 0x18 ) & 0x1f) << 11) | ((( 2 ) & 0x07) << 8) | (( 0x80 ) & 0xFF)) , 0xffff8888, 0x00000000,
-
+
( ((( 0 ) & 0xFF) << 16) | ((( 0x18 ) & 0x1f) << 11) | ((( 2 ) & 0x07) << 8) | (( 0x88 ) & 0xFF)) , 0xe8088008, 0x02522001 ,
-
+
( ((( 0 ) & 0xFF) << 16) | ((( 0x18 ) & 0x1f) << 11) | ((( 2 ) & 0x07) << 8) | (( 0x8c ) & 0xFF)) , 0xff8fe08e, (0 << 20)|(0 << 8)|(0 << 4)|(0 << 0),
-
- ( ((( 0 ) & 0xFF) << 16) | ((( 0x18 ) & 0x1f) << 11) | ((( 2 ) & 0x07) << 8) | (( 0x90 ) & 0xFF)) , 0xf0000000,
- (4 << 25)|(0 << 24)|
- (0 << 23)|(0 << 22)|(0 << 21)|(0 << 20)|
- (1 << 19)|(0 << 18)|(1 << 17)|(0 << 16)|
- (2 << 14)|(0 << 13)|(0 << 12)|
- (0 << 11)|(0 << 10)|(0 << 9)|(0 << 8)|
+
+ ( ((( 0 ) & 0xFF) << 16) | ((( 0x18 ) & 0x1f) << 11) | ((( 2 ) & 0x07) << 8) | (( 0x90 ) & 0xFF)) , 0xf0000000,
+ (4 << 25)|(0 << 24)|
+ (0 << 23)|(0 << 22)|(0 << 21)|(0 << 20)|
+ (1 << 19)|(0 << 18)|(1 << 17)|(0 << 16)|
+ (2 << 14)|(0 << 13)|(0 << 12)|
+ (0 << 11)|(0 << 10)|(0 << 9)|(0 << 8)|
(0 << 3) |(0 << 1) |(0 << 0),
-
+
( ((( 0 ) & 0xFF) << 16) | ((( 0x18 ) & 0x1f) << 11) | ((( 2 ) & 0x07) << 8) | (( 0x94 ) & 0xFF)) , 0xc180f0f0,
(0 << 29)|(0 << 28)|(0 << 27)|(0 << 26)|(0 << 25)|
(0 << 20)|(0 << 19)|(3 << 16)|(0 << 8)|(0 << 0),
-
+
( ((( 0 ) & 0xFF) << 16) | ((( 0x18 ) & 0x1f) << 11) | ((( 2 ) & 0x07) << 8) | (( 0x98 ) & 0xFF)) , 0xfc00ffff, 0x00000000,
-
+
( ((( 0 ) & 0xFF) << 16) | ((( 0x18 ) & 0x1f) << 11) | ((( 3 ) & 0x07) << 8) | (( 0x58 ) & 0xFF)) , 0xffe0e0e0, 0x00000000,
-
+
( ((( 0 ) & 0xFF) << 16) | ((( 0x18 ) & 0x1f) << 11) | ((( 3 ) & 0x07) << 8) | (( 0x5C ) & 0xFF)) , 0x0000003e, 0x00000000,
-
+
( ((( 0 ) & 0xFF) << 16) | ((( 0x18 ) & 0x1f) << 11) | ((( 3 ) & 0x07) << 8) | (( 0x60 ) & 0xFF)) , 0xffffff00, 0x00000000,
-
+
( ((( 0 ) & 0xFF) << 16) | ((( 0x18 ) & 0x1f) << 11) | ((( 3 ) & 0x07) << 8) | (( 0x94 ) & 0xFF)) , 0xffff8000, 0x00000f70,
( ((( 0 ) & 0xFF) << 16) | ((( 0x18 ) & 0x1f) << 11) | ((( 3 ) & 0x07) << 8) | (( 0x90 ) & 0xFF)) , 0xffffff80, 0x00000002,
( ((( 0 ) & 0xFF) << 16) | ((( 0x18 ) & 0x1f) << 11) | ((( 3 ) & 0x07) << 8) | (( 0x98 ) & 0xFF)) , 0x0000000f, 0x00068300,
@@ -1107,14 +1107,14 @@ static int is_dual_channel(const struct mem_controller *ctrl)
}
static int is_opteron(const struct mem_controller *ctrl)
{
-
+
uint32_t nbcap;
nbcap = pci_read_config32(ctrl->f3, 0xE8 );
return !!(nbcap & 0x0001 );
}
static int is_registered(const struct mem_controller *ctrl)
{
-
+
uint32_t dcl;
dcl = pci_read_config32(ctrl->f2, 0x90 );
return !(dcl & (1<<18) );
@@ -1125,45 +1125,45 @@ struct dimm_size {
};
static struct dimm_size spd_get_dimm_size(unsigned device)
{
-
+
struct dimm_size sz;
int value, low;
sz.side1 = 0;
sz.side2 = 0;
-
- value = spd_read_byte(device, 3);
+
+ value = spd_read_byte(device, 3);
if (value < 0) goto out;
sz.side1 += value & 0xf;
- value = spd_read_byte(device, 4);
+ value = spd_read_byte(device, 4);
if (value < 0) goto out;
sz.side1 += value & 0xf;
- value = spd_read_byte(device, 17);
+ value = spd_read_byte(device, 17);
if (value < 0) goto out;
sz.side1 += log2(value & 0xff);
-
- value = spd_read_byte(device, 7);
+
+ value = spd_read_byte(device, 7);
if (value < 0) goto out;
value &= 0xff;
value <<= 8;
-
- low = spd_read_byte(device, 6);
+
+ low = spd_read_byte(device, 6);
if (low < 0) goto out;
value = value | (low & 0xff);
sz.side1 += log2(value);
-
- value = spd_read_byte(device, 5);
+
+ value = spd_read_byte(device, 5);
if (value <= 1) goto out;
-
+
sz.side2 = sz.side1;
- value = spd_read_byte(device, 3);
+ value = spd_read_byte(device, 3);
if (value < 0) goto out;
- if ((value & 0xf0) == 0) goto out;
- sz.side2 -= (value & 0x0f);
- sz.side2 += ((value >> 4) & 0x0f);
- value = spd_read_byte(device, 4);
+ if ((value & 0xf0) == 0) goto out;
+ sz.side2 -= (value & 0x0f);
+ sz.side2 += ((value >> 4) & 0x0f);
+ value = spd_read_byte(device, 4);
if (value < 0) goto out;
- sz.side2 -= (value & 0x0f);
- sz.side2 += ((value >> 4) & 0x0f);
+ sz.side2 -= (value & 0x0f);
+ sz.side2 += ((value >> 4) & 0x0f);
out:
return sz;
}
@@ -1176,32 +1176,32 @@ static void set_dimm_size(const struct mem_controller *ctrl, struct dimm_size sz
}
map = pci_read_config32(ctrl->f2, 0x80 );
map &= ~(0xf << (index + 4));
-
-
+
+
base0 = base1 = 0;
-
+
if (sz.side1 >= (25 +3)) {
map |= (sz.side1 - (25 + 3)) << (index *4);
base0 = (1 << ((sz.side1 - (25 + 3)) + 21)) | 1;
}
-
+
if (sz.side2 >= (25 + 3)) {
base1 = (1 << ((sz.side2 - (25 + 3)) + 21)) | 1;
}
-
+
if (is_dual_channel(ctrl)) {
base0 = (base0 << 1) | (base0 & 1);
base1 = (base1 << 1) | (base1 & 1);
}
-
+
base0 &= ~0x001ffffe;
base1 &= ~0x001ffffe;
-
+
pci_write_config32(ctrl->f2, 0x40 + (((index << 1)+0)<<2), base0);
pci_write_config32(ctrl->f2, 0x40 + (((index << 1)+1)<<2), base1);
pci_write_config32(ctrl->f2, 0x80 , map);
-
-
+
+
if (base0) {
dch = pci_read_config32(ctrl->f2, 0x94 );
dch |= (1 << 26) << index;
@@ -1211,7 +1211,7 @@ static void set_dimm_size(const struct mem_controller *ctrl, struct dimm_size sz
static void spd_set_ram_size(const struct mem_controller *ctrl)
{
int i;
-
+
for(i = 0; (i < 4) && (ctrl->channel0[i]); i++) {
struct dimm_size sz;
sz = spd_get_dimm_size(ctrl->channel0[i]);
@@ -1221,7 +1221,7 @@ static void spd_set_ram_size(const struct mem_controller *ctrl)
static void route_dram_accesses(const struct mem_controller *ctrl,
unsigned long base_k, unsigned long limit_k)
{
-
+
unsigned node_id;
unsigned limit;
unsigned base;
@@ -1246,25 +1246,25 @@ static void route_dram_accesses(const struct mem_controller *ctrl,
}
static void set_top_mem(unsigned tom_k)
{
-
+
if (!tom_k) {
set_bios_reset();
print_debug("No memory - reset");
-
+
pci_write_config8(( ((( 0 ) & 0xFF) << 16) | ((( 0x04 ) & 0x1f) << 11) | ((( 3 ) & 0x7) << 8)) , 0x41, 0xf1);
-
+
outb(0x0e, 0x0cf9);
}
-
+
print_debug("RAM: 0x");
print_debug_hex32(tom_k);
print_debug(" KB\r\n");
-
+
msr_t msr;
msr.lo = (tom_k & 0x003fffff) << 10;
msr.hi = (tom_k & 0xffc00000) >> 22;
wrmsr(0xC001001D , msr);
-
+
if (tom_k >= 0x003f0000) {
tom_k = 0x3f0000;
}
@@ -1274,15 +1274,15 @@ static void set_top_mem(unsigned tom_k)
}
static unsigned long interleave_chip_selects(const struct mem_controller *ctrl)
{
-
- static const uint32_t csbase_low[] = {
+
+ static const uint32_t csbase_low[] = {
(1 << (13 - 4)),
(1 << (14 - 4)),
- (1 << (14 - 4)),
+ (1 << (14 - 4)),
(1 << (15 - 4)),
(1 << (15 - 4)),
(1 << (16 - 4)),
- (1 << (16 - 4)),
+ (1 << (16 - 4)),
};
uint32_t csbase_inc;
int chip_selects, index;
@@ -1290,16 +1290,16 @@ static unsigned long interleave_chip_selects(const struct mem_controller *ctrl)
int dual_channel;
unsigned common_size;
uint32_t csbase, csmask;
-
+
chip_selects = 0;
common_size = 0;
for(index = 0; index < 8; index++) {
unsigned size;
uint32_t value;
-
+
value = pci_read_config32(ctrl->f2, 0x40 + (index << 2));
-
-
+
+
if (!(value & 1)) {
continue;
}
@@ -1308,36 +1308,36 @@ static unsigned long interleave_chip_selects(const struct mem_controller *ctrl)
if (common_size == 0) {
common_size = size;
}
-
+
if (common_size != size) {
return 0;
}
}
-
+
bits = log2(chip_selects);
if (((1 << bits) != chip_selects) || (bits < 1) || (bits > 3)) {
return 0;
-
+
}
-
+
if ((bits == 3) && (common_size == (1 << (32 - 3)))) {
print_debug("8 4GB chip selects cannot be interleaved\r\n");
return 0;
}
-
+
if (is_dual_channel(ctrl)) {
csbase_inc = csbase_low[log2(common_size) - 1] << 1;
} else {
csbase_inc = csbase_low[log2(common_size)];
}
-
+
csbase = 0 | 1;
csmask = (((common_size << bits) - 1) << 21);
csmask |= 0xfe00 & ~((csbase_inc << bits) - csbase_inc);
for(index = 0; index < 8; index++) {
uint32_t value;
value = pci_read_config32(ctrl->f2, 0x40 + (index << 2));
-
+
if (!(value & 1)) {
continue;
}
@@ -1345,19 +1345,19 @@ static unsigned long interleave_chip_selects(const struct mem_controller *ctrl)
pci_write_config32(ctrl->f2, 0x60 + (index << 2), csmask);
csbase += csbase_inc;
}
-
+
print_debug("Interleaved\r\n");
-
+
return common_size << (15 + bits);
}
static unsigned long order_chip_selects(const struct mem_controller *ctrl)
{
unsigned long tom;
-
-
+
+
tom = 0;
for(;;) {
-
+
unsigned index, canidate;
uint32_t csbase, csmask;
unsigned size;
@@ -1366,46 +1366,46 @@ static unsigned long order_chip_selects(const struct mem_controller *ctrl)
for(index = 0; index < 8; index++) {
uint32_t value;
value = pci_read_config32(ctrl->f2, 0x40 + (index << 2));
-
+
if (!(value & 1)) {
continue;
}
-
-
+
+
if (value <= csbase) {
continue;
}
-
-
+
+
if (tom & (1 << (index + 24))) {
continue;
}
-
+
csbase = value;
canidate = index;
}
-
+
if (csbase == 0) {
break;
}
-
+
size = csbase >> 21;
-
+
tom |= (1 << (canidate + 24));
-
+
csbase = (tom << 21) | 1;
-
+
tom += size;
-
+
csmask = ((size -1) << 21);
- csmask |= 0xfe00;
-
+ csmask |= 0xfe00;
+
pci_write_config32(ctrl->f2, 0x40 + (canidate << 2), csbase);
-
+
pci_write_config32(ctrl->f2, 0x60 + (canidate << 2), csmask);
-
+
}
-
+
return (tom & ~0xff000000) << 15;
}
static void order_dimms(const struct mem_controller *ctrl)
@@ -1416,14 +1416,14 @@ static void order_dimms(const struct mem_controller *ctrl)
if (!tom_k) {
tom_k = order_chip_selects(ctrl);
}
-
+
base_k = 0;
for(node_id = 0; node_id < ctrl->node_id; node_id++) {
uint32_t limit, base;
unsigned index;
index = node_id << 3;
base = pci_read_config32(ctrl->f1, 0x40 + index);
-
+
if ((base & 3) == 3) {
limit = pci_read_config32(ctrl->f1, 0x44 + index);
base_k = ((limit + 0x00010000) & 0xffff0000) >> 2;
@@ -1435,8 +1435,8 @@ static void order_dimms(const struct mem_controller *ctrl)
}
static void disable_dimm(const struct mem_controller *ctrl, unsigned index)
{
- print_debug("disabling dimm");
- print_debug_hex8(index);
+ print_debug("disabling dimm");
+ print_debug_hex8(index);
print_debug("\r\n");
pci_write_config32(ctrl->f2, 0x40 + (((index << 1)+0)<<2), 0);
pci_write_config32(ctrl->f2, 0x40 + (((index << 1)+1)<<2), 0);
@@ -1456,11 +1456,11 @@ static void spd_handle_unbuffered_dimms(const struct mem_controller *ctrl)
disable_dimm(ctrl, i);
continue;
}
-
+
if (value & (1 << 1)) {
registered = 1;
- }
-
+ }
+
else {
unbuffered = 1;
}
@@ -1482,29 +1482,29 @@ static void spd_enable_2channels(const struct mem_controller *ctrl)
{
int i;
uint32_t nbcap;
-
-
+
+
static const unsigned addresses[] = {
- 2,
- 3,
- 4,
- 5,
- 6,
- 7,
- 9,
- 11,
- 13,
- 17,
- 18,
- 21,
- 23,
- 26,
- 27,
- 28,
- 29,
- 30,
- 41,
- 42,
+ 2,
+ 3,
+ 4,
+ 5,
+ 6,
+ 7,
+ 9,
+ 11,
+ 13,
+ 17,
+ 18,
+ 21,
+ 23,
+ 26,
+ 27,
+ 28,
+ 29,
+ 30,
+ 41,
+ 42,
};
nbcap = pci_read_config32(ctrl->f3, 0xE8 );
if (!(nbcap & 0x0001 )) {
@@ -1543,7 +1543,7 @@ static void spd_enable_2channels(const struct mem_controller *ctrl)
}
struct mem_param {
uint8_t cycle_time;
- uint8_t divisor;
+ uint8_t divisor;
uint8_t tRC;
uint8_t tRFC;
uint32_t dch_memclk;
@@ -1616,35 +1616,35 @@ static const struct mem_param *get_mem_param(unsigned min_cycle_time)
}
static const struct mem_param *spd_set_memclk(const struct mem_controller *ctrl)
{
-
+
const struct mem_param *param;
unsigned min_cycle_time, min_latency;
int i;
uint32_t value;
static const int latency_indicies[] = { 26, 23, 9 };
static const unsigned char min_cycle_times[] = {
- [0 ] = 0x50,
- [1 ] = 0x60,
- [2 ] = 0x75,
- [3 ] = 0xa0,
+ [0 ] = 0x50,
+ [1 ] = 0x60,
+ [2 ] = 0x75,
+ [3 ] = 0xa0,
};
value = pci_read_config32(ctrl->f3, 0xE8 );
min_cycle_time = min_cycle_times[(value >> 5 ) & 3 ];
min_latency = 2;
-
+
for(i = 0; (i < 4) && (ctrl->channel0[i]); i++) {
int new_cycle_time, new_latency;
int index;
int latencies;
int latency;
-
+
new_cycle_time = 0xa0;
new_latency = 5;
latencies = spd_read_byte(ctrl->channel0[i], 18);
if (latencies <= 0) continue;
-
+
latency = log2(latencies) -2;
-
+
for(index = 0; index < 3; index++, latency++) {
int value;
if ((latency < 2) || (latency > 4) ||
@@ -1655,7 +1655,7 @@ static const struct mem_param *spd_set_memclk(const struct mem_controller *ctrl)
if (value < 0) {
continue;
}
-
+
if ((value >= min_cycle_time) && (value < new_cycle_time)) {
new_cycle_time = value;
new_latency = latency;
@@ -1664,17 +1664,17 @@ static const struct mem_param *spd_set_memclk(const struct mem_controller *ctrl)
if (new_latency > 4){
continue;
}
-
+
if (new_cycle_time > min_cycle_time) {
min_cycle_time = new_cycle_time;
}
-
+
if (new_latency > min_latency) {
min_latency = new_latency;
}
}
-
-
+
+
for(i = 0; (i < 4) && (ctrl->channel0[i]); i++) {
int latencies;
int latency;
@@ -1685,9 +1685,9 @@ static const struct mem_param *spd_set_memclk(const struct mem_controller *ctrl)
if (latencies <= 0) {
goto dimm_err;
}
-
+
latency = log2(latencies) -2;
-
+
for(index = 0; index < 3; index++, latency++) {
if (!(latencies & (1 << latency))) {
continue;
@@ -1695,36 +1695,36 @@ static const struct mem_param *spd_set_memclk(const struct mem_controller *ctrl)
if (latency == min_latency)
break;
}
-
+
if ((latency != min_latency) || (index >= 3)) {
goto dimm_err;
}
-
-
+
+
value = spd_read_byte(ctrl->channel0[i], latency_indicies[index]);
-
-
+
+
if (value <= min_cycle_time) {
continue;
}
-
+
dimm_err:
disable_dimm(ctrl, i);
}
-
+
param = get_mem_param(min_cycle_time);
-
+
value = pci_read_config32(ctrl->f2, 0x94 );
value &= ~(0x7 << 20 );
value |= param->dch_memclk;
pci_write_config32(ctrl->f2, 0x94 , value);
static const unsigned latencies[] = { 1 , 5 , 2 };
-
+
value = pci_read_config32(ctrl->f2, 0x88 );
value &= ~(0x7 << 0 );
value |= latencies[min_latency - 2] << 0 ;
pci_write_config32(ctrl->f2, 0x88 , value);
-
+
return param;
}
static int update_dimm_Trc(const struct mem_controller *ctrl, const struct mem_param *param, int i)
@@ -1969,7 +1969,7 @@ static void set_Twtr(const struct mem_controller *ctrl, const struct mem_param *
{
uint32_t dth;
unsigned clocks;
- clocks = 1;
+ clocks = 1;
dth = pci_read_config32(ctrl->f2, 0x8c );
dth &= ~(0x1 << 0 );
dth |= ((clocks - 1 ) << 0 );
@@ -1988,11 +1988,11 @@ static void set_Trwt(const struct mem_controller *ctrl, const struct mem_param *
if (is_opteron(ctrl)) {
if (latency == 1 ) {
if (divisor == ((6 << 0) + 0)) {
-
+
clocks = 3;
}
else if (divisor > ((6 << 0)+0)) {
-
+
clocks = 2;
}
}
@@ -2001,11 +2001,11 @@ static void set_Trwt(const struct mem_controller *ctrl, const struct mem_param *
}
else if (latency == 2 ) {
if (divisor == ((6 << 0)+0)) {
-
+
clocks = 4;
}
else if (divisor > ((6 << 0)+0)) {
-
+
clocks = 3;
}
}
@@ -2037,7 +2037,7 @@ static void set_Trwt(const struct mem_controller *ctrl, const struct mem_param *
if ((clocks < 1 ) || (clocks > 6 )) {
die("Unknown Trwt");
}
-
+
dth = pci_read_config32(ctrl->f2, 0x8c );
dth &= ~(0x7 << 4 );
dth |= ((clocks - 1 ) << 4 );
@@ -2046,7 +2046,7 @@ static void set_Trwt(const struct mem_controller *ctrl, const struct mem_param *
}
static void set_Twcl(const struct mem_controller *ctrl, const struct mem_param *param)
{
-
+
uint32_t dth;
unsigned clocks;
if (is_registered(ctrl)) {
@@ -2070,19 +2070,19 @@ static void set_read_preamble(const struct mem_controller *ctrl, const struct me
rdpreamble = 0;
if (is_registered(ctrl)) {
if (divisor == ((10 << 1)+0)) {
-
+
rdpreamble = ((9 << 1)+ 0);
}
else if (divisor == ((7 << 1)+1)) {
-
+
rdpreamble = ((8 << 1)+0);
}
else if (divisor == ((6 << 1)+0)) {
-
+
rdpreamble = ((7 << 1)+1);
}
else if (divisor == ((5 << 1)+0)) {
-
+
rdpreamble = ((7 << 1)+0);
}
}
@@ -2096,42 +2096,42 @@ static void set_read_preamble(const struct mem_controller *ctrl, const struct me
}
}
if (divisor == ((10 << 1)+0)) {
-
+
if (slots <= 2) {
-
+
rdpreamble = ((9 << 1)+0);
} else {
-
+
rdpreamble = ((14 << 1)+0);
}
}
else if (divisor == ((7 << 1)+1)) {
-
+
if (slots <= 2) {
-
+
rdpreamble = ((7 << 1)+0);
} else {
-
+
rdpreamble = ((11 << 1)+0);
}
}
else if (divisor == ((6 << 1)+0)) {
-
+
if (slots <= 2) {
-
+
rdpreamble = ((7 << 1)+0);
} else {
-
+
rdpreamble = ((9 << 1)+0);
}
}
else if (divisor == ((5 << 1)+0)) {
-
+
if (slots <= 2) {
-
+
rdpreamble = ((5 << 1)+0);
} else {
-
+
rdpreamble = ((7 << 1)+0);
}
}
@@ -2154,11 +2154,11 @@ static void set_max_async_latency(const struct mem_controller *ctrl, const struc
async_lat = 0;
if (is_registered(ctrl)) {
if (dimms == 4) {
-
+
async_lat = 9;
- }
+ }
else {
-
+
async_lat = 8;
}
}
@@ -2167,11 +2167,11 @@ static void set_max_async_latency(const struct mem_controller *ctrl, const struc
die("Too many unbuffered dimms");
}
else if (dimms == 3) {
-
+
async_lat = 7;
}
else {
-
+
async_lat = 6;
}
}
@@ -2181,7 +2181,7 @@ static void set_max_async_latency(const struct mem_controller *ctrl, const struc
static void set_idle_cycle_limit(const struct mem_controller *ctrl, const struct mem_param *param)
{
uint32_t dch;
-
+
dch = pci_read_config32(ctrl->f2, 0x94 );
dch &= ~(0x7 << 16 );
dch |= 3 << 16 ;
@@ -2193,39 +2193,39 @@ static void spd_set_dram_timing(const struct mem_controller *ctrl, const struct
int dimms;
int i;
int rc;
-
+
init_Tref(ctrl, param);
for(i = 0; (i < 4) && ctrl->channel0[i]; i++) {
int rc;
-
+
if (update_dimm_Trc (ctrl, param, i) < 0) goto dimm_err;
if (update_dimm_Trfc(ctrl, param, i) < 0) goto dimm_err;
if (update_dimm_Trcd(ctrl, param, i) < 0) goto dimm_err;
if (update_dimm_Trrd(ctrl, param, i) < 0) goto dimm_err;
if (update_dimm_Tras(ctrl, param, i) < 0) goto dimm_err;
if (update_dimm_Trp (ctrl, param, i) < 0) goto dimm_err;
-
+
if (update_dimm_Tref(ctrl, param, i) < 0) goto dimm_err;
-
+
if (update_dimm_x4 (ctrl, param, i) < 0) goto dimm_err;
if (update_dimm_ecc(ctrl, param, i) < 0) goto dimm_err;
continue;
dimm_err:
disable_dimm(ctrl, i);
-
+
}
-
+
set_Twr(ctrl, param);
-
+
set_Twtr(ctrl, param);
set_Trwt(ctrl, param);
set_Twcl(ctrl, param);
-
+
set_read_preamble(ctrl, param);
set_max_async_latency(ctrl, param);
set_idle_cycle_limit(ctrl, param);
}
-static void sdram_set_spd_registers(const struct mem_controller *ctrl)
+static void sdram_set_spd_registers(const struct mem_controller *ctrl)
{
const struct mem_param *param;
spd_enable_2channels(ctrl);
@@ -2238,18 +2238,18 @@ static void sdram_set_spd_registers(const struct mem_controller *ctrl)
static void sdram_enable(int controllers, const struct mem_controller *ctrl)
{
int i;
-
+
for(i = 0; i < controllers; i++) {
uint32_t dch;
dch = pci_read_config32(ctrl[i].f2, 0x94 );
dch |= (1 << 25) ;
pci_write_config32(ctrl[i].f2, 0x94 , dch);
}
-
+
memreset(controllers, ctrl);
for(i = 0; i < controllers; i++) {
uint32_t dcl;
-
+
dcl = pci_read_config32(ctrl[i].f2, 0x90 );
if (dcl & (1<<17) ) {
uint32_t mnc;
@@ -2289,7 +2289,7 @@ static void sdram_enable(int controllers, const struct mem_controller *ctrl)
if (dcl & (1<<17) ) {
print_debug("Clearing memory: ");
if (!is_cpu_pre_c0()) {
-
+
dcl &= ~((1<<11) | (1<<10) );
pci_write_config32(ctrl[i].f2, 0x90 , dcl);
do {
@@ -2299,10 +2299,10 @@ static void sdram_enable(int controllers, const struct mem_controller *ctrl)
uint32_t base, last_scrub_k, scrub_k;
uint32_t cnt,zstart,zend;
msr_t msr,msr_201;
-
+
pci_write_config32(ctrl[i].f3, 0x58 ,
(0 << 16) | (0 << 8) | (0 << 0));
-
+
msr_201 = rdmsr(0x201);
zstart = pci_read_config32(ctrl[0].f1, 0x40 + (i*8));
zend = pci_read_config32(ctrl[0].f1, 0x44 + (i*8));
@@ -2313,50 +2313,50 @@ static void sdram_enable(int controllers, const struct mem_controller *ctrl)
print_debug("-");
print_debug_hex32(zend);
print_debug("\r\n");
-
-
+
+
msr = rdmsr(0x2ff );
msr.lo &= ~(1<<10);
wrmsr(0x2ff , msr);
-
+
msr = rdmsr(0xc0010015);
msr.lo |= (1<<17);
wrmsr(0xc0010015,msr);
for(;zstart<zend;zstart+=4) {
-
+
if(zstart == 0x0fc)
continue;
-
-
+
+
__asm__ volatile(
"movl %%cr0, %0\n\t"
"orl $0x40000000, %0\n\t"
"movl %0, %%cr0\n\t"
:"=r" (cnt)
);
-
-
+
+
msr.lo = 1 + ((zstart&0x0ff)<<24);
msr.hi = (zstart&0x0ff00)>>8;
wrmsr(0x200,msr);
-
+
msr.hi = 0x000000ff;
msr.lo = 0xfc000800;
wrmsr(0x201,msr);
-
+
__asm__ volatile(
"movl %%cr0, %0\n\t"
"andl $0x9fffffff, %0\n\t"
- "movl %0, %%cr0\n\t"
- :"=r" (cnt)
+ "movl %0, %%cr0\n\t"
+ :"=r" (cnt)
);
-
+
msr.lo = (zstart&0xff) << 24;
msr.hi = (zstart&0xff00) >> 8;
wrmsr(0xc0000100,msr);
- print_debug_char((zstart > 0x0ff)?'+':'-');
-
-
+ print_debug_char((zstart > 0x0ff)?'+':'-');
+
+
__asm__ volatile(
"1: \n\t"
"movl %0, %%fs:(%1)\n\t"
@@ -2365,67 +2365,67 @@ static void sdram_enable(int controllers, const struct mem_controller *ctrl)
"jnz 1b\n\t"
:
: "a" (0), "D" (0), "c" (0x01000000)
- );
+ );
}
-
-
+
+
__asm__ volatile(
"movl %%cr0, %0\n\t"
"orl $0x40000000, %0\n\t"
"movl %0, %%cr0\n\t"
- :"=r" (cnt)
+ :"=r" (cnt)
);
-
-
+
+
msr = rdmsr(0x2ff );
msr.lo |= 0x0400;
wrmsr(0x2ff , msr);
-
+
msr.lo = 6;
msr.hi = 0;
wrmsr(0x200,msr);
wrmsr(0x201,msr_201);
-
+
msr.lo = 0;
msr.hi = 0;
wrmsr(0xc0000100,msr);
-
+
__asm__ volatile(
"movl %%cr0, %0\n\t"
"andl $0x9fffffff, %0\n\t"
- "movl %0, %%cr0\n\t"
- :"=r" (cnt)
+ "movl %0, %%cr0\n\t"
+ :"=r" (cnt)
);
-
-
+
+
msr = rdmsr(0xc0010015);
msr.lo &= ~(1<<17);
wrmsr(0xc0010015,msr);
-
+
base = pci_read_config32(ctrl[i].f1, 0x40 + (ctrl[i].node_id << 3));
base &= 0xffff0000;
-
+
pci_write_config32(ctrl[i].f3, 0x5C , base << 8);
pci_write_config32(ctrl[i].f3, 0x60 , base >> 24);
-
- pci_write_config32(ctrl[i].f3, 0x58 ,
+
+ pci_write_config32(ctrl[i].f3, 0x58 ,
(22 << 16) | (22 << 8) | (22 << 0));
print_debug("done\r\n");
}
}
}
-
-
-
-
-
+
+
+
+
+
typedef uint8_t u8;
typedef uint32_t u32;
typedef int8_t bool;
static void disable_probes(void)
{
-
-
+
+
u32 val;
print_debug("Disabling read/write/fill probes for UP... ");
val=pci_read_config32(( ((( 0 ) & 0xFF) << 16) | ((( 24+ 0 ) & 0x1f) << 11) | ((( 0 ) & 0x7) << 8)) , 0x68);
@@ -2433,8 +2433,8 @@ static void disable_probes(void)
pci_write_config32(( ((( 0 ) & 0xFF) << 16) | ((( 24+ 0 ) & 0x1f) << 11) | ((( 0 ) & 0x7) << 8)) , 0x68, val);
print_debug("done.\r\n");
}
-
-static void wait_ap_stop(u8 node)
+
+static void wait_ap_stop(u8 node)
{
unsigned long reg;
unsigned long i;
@@ -2444,7 +2444,7 @@ static void wait_ap_stop(u8 node)
if((regx & (1<<4))==1) break;
}
reg = pci_read_config32(( ((( 0 ) & 0xFF) << 16) | ((( 24+ node ) & 0x1f) << 11) | ((( 0 ) & 0x7) << 8)) ,0x6c);
- reg &= ~(1<<4);
+ reg &= ~(1<<4);
pci_write_config32(( ((( 0 ) & 0xFF) << 16) | ((( 24+ node ) & 0x1f) << 11) | ((( 0 ) & 0x7) << 8)) , 0x6c, reg);
}
static void notify_bsp_ap_is_stopped(void)
@@ -2453,31 +2453,31 @@ static void notify_bsp_ap_is_stopped(void)
unsigned long apic_id;
apic_id = *((volatile unsigned long *)(0xfee00000 + 0x020 ));
apic_id >>= 24;
-
+
if(apic_id != 0) {
-
+
reg = pci_read_config32(( ((( 0 ) & 0xFF) << 16) | ((( 24+ apic_id ) & 0x1f) << 11) | ((( 0 ) & 0x7) << 8)) , 0x6C);
reg |= 1<<4;
pci_write_config32(( ((( 0 ) & 0xFF) << 16) | ((( 24+ apic_id ) & 0x1f) << 11) | ((( 0 ) & 0x7) << 8)) , 0x6C, reg);
}
-
+
}
-
+
static void enable_routing(u8 node)
{
u32 val;
-
-
+
+
print_debug("Enabling routing table for node ");
print_debug_hex32(node);
val=pci_read_config32(( ((( 0 ) & 0xFF) << 16) | ((( 24+ node ) & 0x1f) << 11) | ((( 0 ) & 0x7) << 8)) , 0x6c);
val &= ~((1<<6)|(1<<5)|(1<<4)|(1<<1)|(1<<0));
pci_write_config32(( ((( 0 ) & 0xFF) << 16) | ((( 24+ node ) & 0x1f) << 11) | ((( 0 ) & 0x7) << 8)) , 0x6c, val);
-
+
if(node!=0) {
wait_ap_stop(node);
}
-
+
print_debug(" done.\r\n");
}
static void rename_temp_node(u8 node)
@@ -2486,21 +2486,21 @@ static void rename_temp_node(u8 node)
print_debug("Renaming current temp node to ");
print_debug_hex32(node);
val=pci_read_config32(( ((( 0 ) & 0xFF) << 16) | ((( 24+ 7 ) & 0x1f) << 11) | ((( 0 ) & 0x7) << 8)) , 0x60);
- val &= (~7);
- val |= node;
+ val &= (~7);
+ val |= node;
pci_write_config32(( ((( 0 ) & 0xFF) << 16) | ((( 24+ 7 ) & 0x1f) << 11) | ((( 0 ) & 0x7) << 8)) , 0x60, val);
print_debug(" done.\r\n");
}
static bool check_connection(u8 src, u8 dest, u8 link)
{
-
+
u32 val;
-
-
+
+
val=pci_read_config32(( ((( 0 ) & 0xFF) << 16) | ((( 24+ src ) & 0x1f) << 11) | ((( 0 ) & 0x7) << 8)) , 0x98+link);
if ( (val&0x17) != 0x03)
return 0;
-
+
val=pci_read_config32(( ((( 0 ) & 0xFF) << 16) | ((( 24+ dest ) & 0x1f) << 11) | ((( 0 ) & 0x7) << 8)) ,0);
if(val != 0x11001022)
return 0;
@@ -2513,37 +2513,37 @@ static void optimize_connection(u8 node1, u8 link1, u8 node2, u8 link2)
uint16_t freq_cap1, freq_cap2, freq_cap, freq_mask;
uint8_t width_cap1, width_cap2, width_cap, width, ln_width1, ln_width2;
uint8_t freq;
-
-
+
+
freq_cap1 = pci_read_config16(( ((( 0 ) & 0xFF) << 16) | ((( 24+ node1 ) & 0x1f) << 11) | ((( 0 ) & 0x7) << 8)) , 0x80 + link1 + 0x0a );
freq_cap2 = pci_read_config16(( ((( 0 ) & 0xFF) << 16) | ((( 24+ node2 ) & 0x1f) << 11) | ((( 0 ) & 0x7) << 8)) , 0x80 + link2 + 0x0a );
-
-
+
+
freq = log2(freq_cap1 & freq_cap2 & 0xff);
-
+
pci_write_config8(( ((( 0 ) & 0xFF) << 16) | ((( 24+ node1 ) & 0x1f) << 11) | ((( 0 ) & 0x7) << 8)) , 0x80 + link1 + 0x09 , freq);
pci_write_config8(( ((( 0 ) & 0xFF) << 16) | ((( 24+ node2 ) & 0x1f) << 11) | ((( 0 ) & 0x7) << 8)) , 0x80 + link2 + 0x09 , freq);
-
+
width_cap1 = pci_read_config8(( ((( 0 ) & 0xFF) << 16) | ((( 24+ node1 ) & 0x1f) << 11) | ((( 0 ) & 0x7) << 8)) , 0x80 + link1 + 6 );
width_cap2 = pci_read_config8(( ((( 0 ) & 0xFF) << 16) | ((( 24+ node2 ) & 0x1f) << 11) | ((( 0 ) & 0x7) << 8)) , 0x80 + link2 + 6 );
-
+
ln_width1 = link_width_to_pow2[width_cap1 & 7];
ln_width2 = link_width_to_pow2[(width_cap2 >> 4) & 7];
if (ln_width1 > ln_width2) {
ln_width1 = ln_width2;
}
width = pow2_to_link_width[ln_width1];
-
+
ln_width1 = link_width_to_pow2[(width_cap1 >> 4) & 7];
ln_width2 = link_width_to_pow2[width_cap2 & 7];
if (ln_width1 > ln_width2) {
ln_width1 = ln_width2;
}
width |= pow2_to_link_width[ln_width1] << 4;
-
-
+
+
pci_write_config8(( ((( 0 ) & 0xFF) << 16) | ((( 24+ node1 ) & 0x1f) << 11) | ((( 0 ) & 0x7) << 8)) , 0x80 + link1 + 6 + 1, width);
-
+
width = ((width & 0x70) >> 4) | ((width & 0x7) << 4);
pci_write_config8(( ((( 0 ) & 0xFF) << 16) | ((( 24+ node2 ) & 0x1f) << 11) | ((( 0 ) & 0x7) << 8)) , 0x80 + link2 + 6 + 1, width);
}
@@ -2571,8 +2571,8 @@ static void setup_remote_row(u8 source, u8 dest, u8 cpus)
}
static void setup_remote_node(u8 node, u8 cpus)
{
- static const uint8_t pci_reg[] = {
- 0x44, 0x4c, 0x54, 0x5c, 0x64, 0x6c, 0x74, 0x7c,
+ static const uint8_t pci_reg[] = {
+ 0x44, 0x4c, 0x54, 0x5c, 0x64, 0x6c, 0x74, 0x7c,
0x40, 0x48, 0x50, 0x58, 0x60, 0x68, 0x70, 0x78,
0x84, 0x8c, 0x94, 0x9c, 0xa4, 0xac, 0xb4, 0xbc,
0x80, 0x88, 0x90, 0x98, 0xa0, 0xa8, 0xb0, 0xb8,
@@ -2585,7 +2585,7 @@ static void setup_remote_node(u8 node, u8 cpus)
print_debug("setup_remote_node\r\n");
for(row=0; row<cpus; row++)
setup_remote_row(node, row, cpus);
-
+
for(i = 0; i < sizeof(pci_reg)/sizeof(pci_reg[0]); i++) {
uint32_t value;
uint8_t reg;
@@ -2606,24 +2606,24 @@ static u8 setup_smp(void)
u8 cpus=2;
print_debug("Enabling SMP settings\r\n");
setup_row(0,0,cpus);
-
+
setup_temp_row(0,1,cpus);
-
+
if (!check_connection(0, 7, 0x20 )) {
print_debug("No connection to Node 1.\r\n");
- fill_row( 0 ,7,0x00010101 ) ;
- setup_uniprocessor();
+ fill_row( 0 ,7,0x00010101 ) ;
+ setup_uniprocessor();
return 1;
}
-
+
optimize_connection(0, 0x20 , 7, 0x20 );
- setup_node(0, cpus);
- setup_remote_node(1, cpus);
- rename_temp_node(1);
- enable_routing(1);
-
- fill_row( 0 ,7,0x00010101 ) ;
-
+ setup_node(0, cpus);
+ setup_remote_node(1, cpus);
+ rename_temp_node(1);
+ enable_routing(1);
+
+ fill_row( 0 ,7,0x00010101 ) ;
+
print_debug_hex32(cpus);
print_debug(" nodes initialized.\r\n");
return cpus;
@@ -2636,29 +2636,29 @@ static unsigned detect_mp_capabilities(unsigned cpus)
print_debug_hex32(cpus);
print_debug("\r\n");
if (cpus>2)
- mask=0x06;
+ mask=0x06;
else
- mask=0x02;
+ mask=0x02;
for (node=0; node<cpus; node++) {
if ((pci_read_config32(( ((( 0 ) & 0xFF) << 16) | ((( 24+ node ) & 0x1f) << 11) | ((( 3 ) & 0x7) << 8)) , 0xe8) & mask)!=mask)
mp_cap= (0) ;
}
if (mp_cap)
return cpus;
-
+
print_debug("One of the CPUs is not MP capable. Going back to UP\r\n");
for (node=cpus; node>0; node--)
for (row=cpus; row>0; row--)
fill_row(( ((( 0 ) & 0xFF) << 16) | ((( 24+ node-1 ) & 0x1f) << 11) | ((( 0 ) & 0x7) << 8)) , row-1, 0x00010101 );
-
+
return setup_uniprocessor();
}
static void coherent_ht_finalize(unsigned cpus)
{
int node;
bool rev_a0;
-
-
+
+
print_debug("coherent_ht_finalize\r\n");
rev_a0= is_cpu_rev_a0();
for (node=0; node<cpus; node++) {
@@ -2686,36 +2686,36 @@ static int setup_coherent_ht_domain(void)
cpus=setup_smp();
cpus=detect_mp_capabilities(cpus);
coherent_ht_finalize(cpus);
-
+
coherent_ht_mainboard(cpus);
return reset_needed;
}
void sdram_no_memory(void)
{
print_err("No memory!!\r\n");
- while(1) {
- hlt();
+ while(1) {
+ hlt();
}
}
-
+
void sdram_initialize(int controllers, const struct mem_controller *ctrl)
{
int i;
-
+
for(i = 0; i < controllers; i++) {
print_debug("Ram1.");
print_debug_hex8(i);
print_debug("\r\n");
sdram_set_registers(ctrl + i);
}
-
+
for(i = 0; i < controllers; i++) {
print_debug("Ram2.");
print_debug_hex8(i);
print_debug("\r\n");
sdram_set_spd_registers(ctrl + i);
}
-
+
print_debug("Ram3\r\n");
sdram_enable(controllers, ctrl);
print_debug("Ram4\r\n");
@@ -2733,17 +2733,17 @@ static void stop_this_cpu(void)
{
unsigned apicid;
apicid = apic_read(0x020 ) >> 24;
-
+
apic_write(0x310 , (( apicid )<<24) );
apic_write(0x300 , 0x08000 | 0x04000 | 0x00500 );
-
+
apic_wait_icr_idle();
-
+
apic_write(0x310 , (( apicid )<<24) );
apic_write(0x300 , 0x08000 | 0x00500 );
-
+
apic_wait_icr_idle();
-
+
for(;;) {
hlt();
}
@@ -2756,7 +2756,7 @@ static void pc87360_enable_serial(void)
}
static void main(void)
{
-
+
static const struct mem_controller cpu[] = {
{
.node_id = 0,
@@ -2792,9 +2792,9 @@ static void main(void)
setup_coherent_ht_domain();
enumerate_ht_chain(0);
distinguish_cpu_resets(0);
-
+
enable_smbus();
memreset_setup();
sdram_initialize(sizeof(cpu)/sizeof(cpu[0]), cpu);
-
+
}
diff --git a/util/romcc/tests/raminit_test7.c b/util/romcc/tests/raminit_test7.c
index be62d30573..184e912fff 100644
--- a/util/romcc/tests/raminit_test7.c
+++ b/util/romcc/tests/raminit_test7.c
@@ -1,30 +1,30 @@
typedef unsigned char uint8_t;
-typedef signed char int8_t;
+typedef signed char int8_t;
typedef unsigned short uint16_t;
typedef signed short int16_t;
typedef unsigned int uint32_t;
typedef signed int int32_t;
-
+
typedef unsigned char uint_least8_t;
-typedef signed char int_least8_t;
+typedef signed char int_least8_t;
typedef unsigned short uint_least16_t;
typedef signed short int_least16_t;
typedef unsigned int uint_least32_t;
typedef signed int int_least32_t;
-
+
typedef unsigned char uint_fast8_t;
-typedef signed char int_fast8_t;
+typedef signed char int_fast8_t;
typedef unsigned int uint_fast16_t;
typedef signed int int_fast16_t;
typedef unsigned int uint_fast32_t;
typedef signed int int_fast32_t;
-
+
typedef int intptr_t;
typedef unsigned int uintptr_t;
-
+
typedef long int intmax_t;
typedef unsigned long int uintmax_t;
-
+
static inline unsigned long apic_read(unsigned long reg)
{
return *((volatile unsigned long *)(0xfee00000 +reg));
@@ -37,7 +37,7 @@ static inline void apic_wait_icr_idle(void)
{
do { } while ( apic_read( 0x300 ) & 0x01000 );
}
-
+
static void outb(unsigned char value, unsigned short port)
{
__builtin_outb(value, port);
@@ -65,7 +65,7 @@ static unsigned char inl(unsigned short port)
static inline void outsb(uint16_t port, const void *addr, unsigned long count)
{
__asm__ __volatile__ (
- "cld ; rep ; outsb "
+ "cld ; rep ; outsb "
: "=S" (addr), "=c" (count)
: "d"(port), "0"(addr), "1" (count)
);
@@ -73,7 +73,7 @@ static inline void outsb(uint16_t port, const void *addr, unsigned long count)
static inline void outsw(uint16_t port, const void *addr, unsigned long count)
{
__asm__ __volatile__ (
- "cld ; rep ; outsw "
+ "cld ; rep ; outsw "
: "=S" (addr), "=c" (count)
: "d"(port), "0"(addr), "1" (count)
);
@@ -81,7 +81,7 @@ static inline void outsw(uint16_t port, const void *addr, unsigned long count)
static inline void outsl(uint16_t port, const void *addr, unsigned long count)
{
__asm__ __volatile__ (
- "cld ; rep ; outsl "
+ "cld ; rep ; outsl "
: "=S" (addr), "=c" (count)
: "d"(port), "0"(addr), "1" (count)
);
@@ -89,7 +89,7 @@ static inline void outsl(uint16_t port, const void *addr, unsigned long count)
static inline void insb(uint16_t port, void *addr, unsigned long count)
{
__asm__ __volatile__ (
- "cld ; rep ; insb "
+ "cld ; rep ; insb "
: "=D" (addr), "=c" (count)
: "d"(port), "0"(addr), "1" (count)
);
@@ -97,7 +97,7 @@ static inline void insb(uint16_t port, void *addr, unsigned long count)
static inline void insw(uint16_t port, void *addr, unsigned long count)
{
__asm__ __volatile__ (
- "cld ; rep ; insw "
+ "cld ; rep ; insw "
: "=D" (addr), "=c" (count)
: "d"(port), "0"(addr), "1" (count)
);
@@ -105,7 +105,7 @@ static inline void insw(uint16_t port, void *addr, unsigned long count)
static inline void insl(uint16_t port, void *addr, unsigned long count)
{
__asm__ __volatile__ (
- "cld ; rep ; insl "
+ "cld ; rep ; insl "
: "=D" (addr), "=c" (count)
: "d"(port), "0"(addr), "1" (count)
);
@@ -180,7 +180,7 @@ static uldiv_t uldiv(unsigned long numer, unsigned long denom)
}
int log2(int value)
{
-
+
return __builtin_bsr(value);
}
typedef unsigned device_t;
@@ -237,11 +237,11 @@ static device_t pci_locate_device(unsigned pci_id, device_t dev)
}
return (0xffffffffU) ;
}
-
-
-
-
-
+
+
+
+
+
static int uart_can_tx_byte(void)
{
return inb(1016 + 0x05 ) & 0x20;
@@ -253,29 +253,29 @@ static void uart_wait_to_tx_byte(void)
}
static void uart_wait_until_sent(void)
{
- while(!(inb(1016 + 0x05 ) & 0x40))
+ while(!(inb(1016 + 0x05 ) & 0x40))
;
}
static void uart_tx_byte(unsigned char data)
{
uart_wait_to_tx_byte();
outb(data, 1016 + 0x00 );
-
+
uart_wait_until_sent();
}
static void uart_init(void)
{
-
+
outb(0x0, 1016 + 0x01 );
-
+
outb(0x01, 1016 + 0x02 );
-
+
outb(0x80 | 3 , 1016 + 0x03 );
outb((115200/ 115200 ) & 0xFF, 1016 + 0x00 );
outb(((115200/ 115200 ) >> 8) & 0xFF, 1016 + 0x01 );
outb(3 , 1016 + 0x03 );
}
-
+
static void __console_tx_byte(unsigned char byte)
{
uart_tx_byte(byte);
@@ -385,12 +385,12 @@ static void print_spew_hex32(unsigned int value) { __console_tx_hex32(8 , value)
static void print_spew(const char *str) { __console_tx_string(8 , str); }
static void console_init(void)
{
- static const char console_test[] =
+ static const char console_test[] =
"\r\n\r\nLinuxBIOS-"
- "1.1.4"
- ".0Fallback"
+ "1.1.4"
+ ".0Fallback"
" "
- "Thu Oct 9 20:29:48 MDT 2003"
+ "Thu Oct 9 20:29:48 MDT 2003"
" starting...\r\n";
print_info(console_test);
}
@@ -405,9 +405,9 @@ static void write_phys(unsigned long addr, unsigned long value)
{
asm volatile(
"movnti %1, (%0)"
- :
- : "r" (addr), "r" (value)
- :
+ :
+ : "r" (addr), "r" (value)
+ :
);
}
static unsigned long read_phys(unsigned long addr)
@@ -419,28 +419,28 @@ static unsigned long read_phys(unsigned long addr)
static void ram_fill(unsigned long start, unsigned long stop)
{
unsigned long addr;
-
+
print_debug("DRAM fill: ");
print_debug_hex32(start);
print_debug("-");
print_debug_hex32(stop);
print_debug("\r\n");
for(addr = start; addr < stop ; addr += 4) {
-
+
if (!(addr & 0xffff)) {
print_debug_hex32(addr);
print_debug("\r");
}
write_phys(addr, addr);
};
-
+
print_debug_hex32(addr);
print_debug("\r\nDRAM filled\r\n");
}
static void ram_verify(unsigned long start, unsigned long stop)
{
unsigned long addr;
-
+
print_debug("DRAM verify: ");
print_debug_hex32(start);
print_debug_char('-');
@@ -448,31 +448,31 @@ static void ram_verify(unsigned long start, unsigned long stop)
print_debug("\r\n");
for(addr = start; addr < stop ; addr += 4) {
unsigned long value;
-
+
if (!(addr & 0xffff)) {
print_debug_hex32(addr);
print_debug("\r");
}
value = read_phys(addr);
if (value != addr) {
-
+
print_err_hex32(addr);
print_err_char(':');
print_err_hex32(value);
print_err("\r\n");
}
}
-
+
print_debug_hex32(addr);
print_debug("\r\nDRAM verified\r\n");
}
void ram_check(unsigned long start, unsigned long stop)
{
int result;
-
+
print_debug("Testing DRAM : ");
print_debug_hex32(start);
- print_debug("-");
+ print_debug("-");
print_debug_hex32(stop);
print_debug("\r\n");
ram_fill(start, stop);
@@ -481,7 +481,7 @@ void ram_check(unsigned long start, unsigned long stop)
}
static int enumerate_ht_chain(unsigned link)
{
-
+
unsigned next_unitid, last_unitid;
int reset_needed = 0;
next_unitid = 1;
@@ -490,7 +490,7 @@ static int enumerate_ht_chain(unsigned link)
uint8_t hdr_type, pos;
last_unitid = next_unitid;
id = pci_read_config32(( ((( 0 ) & 0xFF) << 16) | ((( 0 ) & 0x1f) << 11) | ((( 0 ) & 0x7) << 8)) , 0x00 );
-
+
if (((id & 0xffff) == 0x0000) || ((id & 0xffff) == 0xffff) ||
(((id >> 16) & 0xffff) == 0xffff) ||
(((id >> 16) & 0xffff) == 0x0000)) {
@@ -536,7 +536,7 @@ static void enable_smbus(void)
pci_write_config32(dev, 0x58, 0x0f00 | 1);
enable = pci_read_config8(dev, 0x41);
pci_write_config8(dev, 0x41, enable | (1 << 7));
-
+
outw(inw(0x0f00 + 0xe0 ), 0x0f00 + 0xe0 );
}
static inline void smbus_delay(void)
@@ -555,7 +555,7 @@ static int smbus_wait_until_ready(void)
break;
}
if(loops == ((100*1000*10) / 2)) {
- outw(inw(0x0f00 + 0xe0 ),
+ outw(inw(0x0f00 + 0xe0 ),
0x0f00 + 0xe0 );
}
} while(--loops);
@@ -568,7 +568,7 @@ static int smbus_wait_until_done(void)
do {
unsigned short val;
smbus_delay();
-
+
val = inw(0x0f00 + 0xe0 );
if (((val & 0x8) == 0) | ((val & 0x437) != 0)) {
break;
@@ -584,29 +584,29 @@ static int smbus_read_byte(unsigned device, unsigned address)
if (smbus_wait_until_ready() < 0) {
return -2;
}
-
-
-
+
+
+
outw(inw(0x0f00 + 0xe2 ) & ~((1<<10)|(1<<9)|(1<<8)|(1<<4)), 0x0f00 + 0xe2 );
-
+
outw(((device & 0x7f) << 1) | 1, 0x0f00 + 0xe4 );
-
+
outb(address & 0xFF, 0x0f00 + 0xe8 );
-
+
outw((inw(0x0f00 + 0xe2 ) & ~7) | (0x2), 0x0f00 + 0xe2 );
-
-
+
+
outw(inw(0x0f00 + 0xe0 ), 0x0f00 + 0xe0 );
-
+
outw(0, 0x0f00 + 0xe6 );
-
+
outw((inw(0x0f00 + 0xe2 ) | (1 << 3)), 0x0f00 + 0xe2 );
-
+
if (smbus_wait_until_done() < 0) {
return -3;
}
global_status_register = inw(0x0f00 + 0xe0 );
-
+
byte = inw(0x0f00 + 0xe6 ) & 0xff;
if (global_status_register != (1 << 4)) {
return -1;
@@ -641,31 +641,31 @@ static tsc_t rdtsc(void)
{
tsc_t res;
asm ("rdtsc"
- : "=a" (res.lo), "=d"(res.hi)
- :
- :
+ : "=a" (res.lo), "=d"(res.hi)
+ :
+ :
);
return res;
}
void init_timer(void)
{
-
+
apic_write(0x320 , (1 << 17)|(1<< 16)|(0 << 12)|(0 << 0));
-
+
apic_write(0x3E0 , 0xB );
-
+
apic_write(0x380 , 0xffffffff);
}
void udelay(unsigned usecs)
{
uint32_t start, value, ticks;
-
+
ticks = usecs * 200;
start = apic_read(0x390 );
do {
value = apic_read(0x390 );
} while((start - value) < ticks);
-
+
}
void mdelay(unsigned msecs)
{
@@ -737,8 +737,8 @@ static void print_debug_pci_dev(unsigned dev)
static void print_pci_devices(void)
{
device_t dev;
- for(dev = ( ((( 0 ) & 0xFF) << 16) | ((( 0 ) & 0x1f) << 11) | ((( 0 ) & 0x7) << 8)) ;
- dev <= ( ((( 0 ) & 0xFF) << 16) | ((( 0x1f ) & 0x1f) << 11) | ((( 0x7 ) & 0x7) << 8)) ;
+ for(dev = ( ((( 0 ) & 0xFF) << 16) | ((( 0 ) & 0x1f) << 11) | ((( 0 ) & 0x7) << 8)) ;
+ dev <= ( ((( 0 ) & 0xFF) << 16) | ((( 0x1f ) & 0x1f) << 11) | ((( 0x7 ) & 0x7) << 8)) ;
dev += ( ((( 0 ) & 0xFF) << 16) | ((( 0 ) & 0x1f) << 11) | ((( 1 ) & 0x7) << 8)) ) {
uint32_t id;
id = pci_read_config32(dev, 0x00 );
@@ -756,7 +756,7 @@ static void dump_pci_device(unsigned dev)
int i;
print_debug_pci_dev(dev);
print_debug("\r\n");
-
+
for(i = 0; i <= 255; i++) {
unsigned char val;
if ((i & 0x0f) == 0) {
@@ -774,8 +774,8 @@ static void dump_pci_device(unsigned dev)
static void dump_pci_devices(void)
{
device_t dev;
- for(dev = ( ((( 0 ) & 0xFF) << 16) | ((( 0 ) & 0x1f) << 11) | ((( 0 ) & 0x7) << 8)) ;
- dev <= ( ((( 0 ) & 0xFF) << 16) | ((( 0x1f ) & 0x1f) << 11) | ((( 0x7 ) & 0x7) << 8)) ;
+ for(dev = ( ((( 0 ) & 0xFF) << 16) | ((( 0 ) & 0x1f) << 11) | ((( 0 ) & 0x7) << 8)) ;
+ dev <= ( ((( 0 ) & 0xFF) << 16) | ((( 0x1f ) & 0x1f) << 11) | ((( 0x7 ) & 0x7) << 8)) ;
dev += ( ((( 0 ) & 0xFF) << 16) | ((( 0 ) & 0x1f) << 11) | ((( 1 ) & 0x7) << 8)) ) {
uint32_t id;
id = pci_read_config32(dev, 0x00 );
@@ -796,8 +796,8 @@ static void dump_spd_registers(const struct mem_controller *ctrl)
device = ctrl->channel0[i];
if (device) {
int j;
- print_debug("dimm: ");
- print_debug_hex8(i);
+ print_debug("dimm: ");
+ print_debug_hex8(i);
print_debug(".0: ");
print_debug_hex8(device);
for(j = 0; j < 256; j++) {
@@ -822,8 +822,8 @@ static void dump_spd_registers(const struct mem_controller *ctrl)
device = ctrl->channel1[i];
if (device) {
int j;
- print_debug("dimm: ");
- print_debug_hex8(i);
+ print_debug("dimm: ");
+ print_debug_hex8(i);
print_debug(".1: ");
print_debug_hex8(device);
for(j = 0; j < 256; j++) {
@@ -847,13 +847,13 @@ static void dump_spd_registers(const struct mem_controller *ctrl)
}
}
}
-
+
static unsigned int cpuid(unsigned int op)
{
unsigned int ret;
unsigned dummy2,dummy3,dummy4;
- asm volatile (
- "cpuid"
+ asm volatile (
+ "cpuid"
: "=a" (ret), "=b" (dummy2), "=c" (dummy3), "=d" (dummy4)
: "a" (op)
);
@@ -870,13 +870,13 @@ static int is_cpu_pre_c0(void)
static void memreset_setup(void)
{
if (is_cpu_pre_c0()) {
-
+
outb((0 << 7)|(0 << 6)|(0<<5)|(0<<4)|(1<<2)|(0<<0), 0x0f00 + 0xc0 + 28);
-
+
outb((0 << 7)|(0 << 6)|(0<<5)|(0<<4)|(1<<2)|(0<<0), 0x0f00 + 0xc0 + 29);
}
else {
-
+
outb((0 << 7)|(0 << 6)|(0<<5)|(0<<4)|(1<<2)|(1<<0), 0x0f00 + 0xc0 + 29);
}
}
@@ -884,15 +884,15 @@ static void memreset(int controllers, const struct mem_controller *ctrl)
{
if (is_cpu_pre_c0()) {
udelay(800);
-
+
outb((0<<7)|(0<<6)|(0<<5)|(0<<4)|(1<<2)|(1<<0), 0x0f00 + 0xc0 + 28);
udelay(90);
}
}
static unsigned int generate_row(uint8_t node, uint8_t row, uint8_t maxnodes)
{
-
- uint32_t ret=0x00010101;
+
+ uint32_t ret=0x00010101;
static const unsigned int rows_2p[2][2] = {
{ 0x00050101, 0x00010404 },
{ 0x00010404, 0x00050101 }
@@ -910,33 +910,33 @@ static inline int spd_read_byte(unsigned device, unsigned address)
{
return smbus_read_byte(device, address);
}
-
+
static void coherent_ht_mainboard(unsigned cpus)
{
}
-
+
void cpu_ldtstop(unsigned cpus)
{
uint32_t tmp;
device_t dev;
unsigned cnt;
for(cnt=0; cnt<cpus; cnt++) {
-
+
pci_write_config8(( ((( 0 ) & 0xFF) << 16) | ((( 24 ) & 0x1f) << 11) | ((( 3 ) & 0x7) << 8)) ,0x81,0x23);
-
+
pci_write_config32(( ((( 0 ) & 0xFF) << 16) | ((( 24 ) & 0x1f) << 11) | ((( 3 ) & 0x7) << 8)) ,0xd4,0x00000701);
-
+
pci_write_config32(( ((( 0 ) & 0xFF) << 16) | ((( 24 ) & 0x1f) << 11) | ((( 3 ) & 0x7) << 8)) ,0xd8,0x00000000);
-
+
tmp=pci_read_config32(( ((( 0 ) & 0xFF) << 16) | ((( 24 ) & 0x1f) << 11) | ((( 2 ) & 0x7) << 8)) ,0x90);
pci_write_config32(( ((( 0 ) & 0xFF) << 16) | ((( 24 ) & 0x1f) << 11) | ((( 2 ) & 0x7) << 8)) ,0x90, tmp | (1<<24) );
}
}
-
-
-
-
-
+
+
+
+
+
static void setup_resource_map(const unsigned int *register_values, int max)
{
int i;
@@ -957,8 +957,8 @@ static void setup_resource_map(const unsigned int *register_values, int max)
static void setup_default_resource_map(void)
{
static const unsigned int register_values[] = {
-
-
+
+
( ((( 0 ) & 0xFF) << 16) | ((( 0x18 ) & 0x1f) << 11) | ((( 1 ) & 0x07) << 8) | (( 0x44 ) & 0xFF)) , 0x0000f8f8, 0x00000000,
( ((( 0 ) & 0xFF) << 16) | ((( 0x18 ) & 0x1f) << 11) | ((( 1 ) & 0x07) << 8) | (( 0x4C ) & 0xFF)) , 0x0000f8f8, 0x00000001,
( ((( 0 ) & 0xFF) << 16) | ((( 0x18 ) & 0x1f) << 11) | ((( 1 ) & 0x07) << 8) | (( 0x54 ) & 0xFF)) , 0x0000f8f8, 0x00000002,
@@ -967,7 +967,7 @@ static void setup_default_resource_map(void)
( ((( 0 ) & 0xFF) << 16) | ((( 0x18 ) & 0x1f) << 11) | ((( 1 ) & 0x07) << 8) | (( 0x6C ) & 0xFF)) , 0x0000f8f8, 0x00000005,
( ((( 0 ) & 0xFF) << 16) | ((( 0x18 ) & 0x1f) << 11) | ((( 1 ) & 0x07) << 8) | (( 0x74 ) & 0xFF)) , 0x0000f8f8, 0x00000006,
( ((( 0 ) & 0xFF) << 16) | ((( 0x18 ) & 0x1f) << 11) | ((( 1 ) & 0x07) << 8) | (( 0x7C ) & 0xFF)) , 0x0000f8f8, 0x00000007,
-
+
( ((( 0 ) & 0xFF) << 16) | ((( 0x18 ) & 0x1f) << 11) | ((( 1 ) & 0x07) << 8) | (( 0x40 ) & 0xFF)) , 0x0000f8fc, 0x00000000,
( ((( 0 ) & 0xFF) << 16) | ((( 0x18 ) & 0x1f) << 11) | ((( 1 ) & 0x07) << 8) | (( 0x48 ) & 0xFF)) , 0x0000f8fc, 0x00000000,
( ((( 0 ) & 0xFF) << 16) | ((( 0x18 ) & 0x1f) << 11) | ((( 1 ) & 0x07) << 8) | (( 0x50 ) & 0xFF)) , 0x0000f8fc, 0x00000000,
@@ -976,7 +976,7 @@ static void setup_default_resource_map(void)
( ((( 0 ) & 0xFF) << 16) | ((( 0x18 ) & 0x1f) << 11) | ((( 1 ) & 0x07) << 8) | (( 0x68 ) & 0xFF)) , 0x0000f8fc, 0x00000000,
( ((( 0 ) & 0xFF) << 16) | ((( 0x18 ) & 0x1f) << 11) | ((( 1 ) & 0x07) << 8) | (( 0x70 ) & 0xFF)) , 0x0000f8fc, 0x00000000,
( ((( 0 ) & 0xFF) << 16) | ((( 0x18 ) & 0x1f) << 11) | ((( 1 ) & 0x07) << 8) | (( 0x78 ) & 0xFF)) , 0x0000f8fc, 0x00000000,
-
+
( ((( 0 ) & 0xFF) << 16) | ((( 0x18 ) & 0x1f) << 11) | ((( 1 ) & 0x07) << 8) | (( 0x84 ) & 0xFF)) , 0x00000048, 0x00000000,
( ((( 0 ) & 0xFF) << 16) | ((( 0x18 ) & 0x1f) << 11) | ((( 1 ) & 0x07) << 8) | (( 0x8C ) & 0xFF)) , 0x00000048, 0x00000000,
( ((( 0 ) & 0xFF) << 16) | ((( 0x18 ) & 0x1f) << 11) | ((( 1 ) & 0x07) << 8) | (( 0x94 ) & 0xFF)) , 0x00000048, 0x00000000,
@@ -985,7 +985,7 @@ static void setup_default_resource_map(void)
( ((( 0 ) & 0xFF) << 16) | ((( 0x18 ) & 0x1f) << 11) | ((( 1 ) & 0x07) << 8) | (( 0xAC ) & 0xFF)) , 0x00000048, 0x00000000,
( ((( 0 ) & 0xFF) << 16) | ((( 0x18 ) & 0x1f) << 11) | ((( 1 ) & 0x07) << 8) | (( 0xB4 ) & 0xFF)) , 0x00000048, 0x00000000,
( ((( 0 ) & 0xFF) << 16) | ((( 0x18 ) & 0x1f) << 11) | ((( 1 ) & 0x07) << 8) | (( 0xBC ) & 0xFF)) , 0x00000048, 0x00ffff00,
-
+
( ((( 0 ) & 0xFF) << 16) | ((( 0x18 ) & 0x1f) << 11) | ((( 1 ) & 0x07) << 8) | (( 0x80 ) & 0xFF)) , 0x000000f0, 0x00000000,
( ((( 0 ) & 0xFF) << 16) | ((( 0x18 ) & 0x1f) << 11) | ((( 1 ) & 0x07) << 8) | (( 0x88 ) & 0xFF)) , 0x000000f0, 0x00000000,
( ((( 0 ) & 0xFF) << 16) | ((( 0x18 ) & 0x1f) << 11) | ((( 1 ) & 0x07) << 8) | (( 0x90 ) & 0xFF)) , 0x000000f0, 0x00000000,
@@ -994,17 +994,17 @@ static void setup_default_resource_map(void)
( ((( 0 ) & 0xFF) << 16) | ((( 0x18 ) & 0x1f) << 11) | ((( 1 ) & 0x07) << 8) | (( 0xA8 ) & 0xFF)) , 0x000000f0, 0x00000000,
( ((( 0 ) & 0xFF) << 16) | ((( 0x18 ) & 0x1f) << 11) | ((( 1 ) & 0x07) << 8) | (( 0xB0 ) & 0xFF)) , 0x000000f0, 0x00000000,
( ((( 0 ) & 0xFF) << 16) | ((( 0x18 ) & 0x1f) << 11) | ((( 1 ) & 0x07) << 8) | (( 0xB8 ) & 0xFF)) , 0x000000f0, 0x00fc0003,
-
+
( ((( 0 ) & 0xFF) << 16) | ((( 0x18 ) & 0x1f) << 11) | ((( 1 ) & 0x07) << 8) | (( 0xC4 ) & 0xFF)) , 0xFE000FC8, 0x01fff000,
( ((( 0 ) & 0xFF) << 16) | ((( 0x18 ) & 0x1f) << 11) | ((( 1 ) & 0x07) << 8) | (( 0xCC ) & 0xFF)) , 0xFE000FC8, 0x00000000,
( ((( 0 ) & 0xFF) << 16) | ((( 0x18 ) & 0x1f) << 11) | ((( 1 ) & 0x07) << 8) | (( 0xD4 ) & 0xFF)) , 0xFE000FC8, 0x00000000,
( ((( 0 ) & 0xFF) << 16) | ((( 0x18 ) & 0x1f) << 11) | ((( 1 ) & 0x07) << 8) | (( 0xDC ) & 0xFF)) , 0xFE000FC8, 0x00000000,
-
+
( ((( 0 ) & 0xFF) << 16) | ((( 0x18 ) & 0x1f) << 11) | ((( 1 ) & 0x07) << 8) | (( 0xC0 ) & 0xFF)) , 0xFE000FCC, 0x00000003,
( ((( 0 ) & 0xFF) << 16) | ((( 0x18 ) & 0x1f) << 11) | ((( 1 ) & 0x07) << 8) | (( 0xC8 ) & 0xFF)) , 0xFE000FCC, 0x00000000,
( ((( 0 ) & 0xFF) << 16) | ((( 0x18 ) & 0x1f) << 11) | ((( 1 ) & 0x07) << 8) | (( 0xD0 ) & 0xFF)) , 0xFE000FCC, 0x00000000,
( ((( 0 ) & 0xFF) << 16) | ((( 0x18 ) & 0x1f) << 11) | ((( 1 ) & 0x07) << 8) | (( 0xD8 ) & 0xFF)) , 0xFE000FCC, 0x00000000,
-
+
( ((( 0 ) & 0xFF) << 16) | ((( 0x18 ) & 0x1f) << 11) | ((( 1 ) & 0x07) << 8) | (( 0xE0 ) & 0xFF)) , 0x0000FC88, 0xff000003,
( ((( 0 ) & 0xFF) << 16) | ((( 0x18 ) & 0x1f) << 11) | ((( 1 ) & 0x07) << 8) | (( 0xE4 ) & 0xFF)) , 0x0000FC88, 0x00000000,
( ((( 0 ) & 0xFF) << 16) | ((( 0x18 ) & 0x1f) << 11) | ((( 1 ) & 0x07) << 8) | (( 0xE8 ) & 0xFF)) , 0x0000FC88, 0x00000000,
@@ -1017,8 +1017,8 @@ static void setup_default_resource_map(void)
static void sdram_set_registers(const struct mem_controller *ctrl)
{
static const unsigned int register_values[] = {
-
-
+
+
( ((( 0 ) & 0xFF) << 16) | ((( 0x18 ) & 0x1f) << 11) | ((( 1 ) & 0x07) << 8) | (( 0x44 ) & 0xFF)) , 0x0000f8f8, 0x00000000,
( ((( 0 ) & 0xFF) << 16) | ((( 0x18 ) & 0x1f) << 11) | ((( 1 ) & 0x07) << 8) | (( 0x4C ) & 0xFF)) , 0x0000f8f8, 0x00000001,
( ((( 0 ) & 0xFF) << 16) | ((( 0x18 ) & 0x1f) << 11) | ((( 1 ) & 0x07) << 8) | (( 0x54 ) & 0xFF)) , 0x0000f8f8, 0x00000002,
@@ -1027,7 +1027,7 @@ static void sdram_set_registers(const struct mem_controller *ctrl)
( ((( 0 ) & 0xFF) << 16) | ((( 0x18 ) & 0x1f) << 11) | ((( 1 ) & 0x07) << 8) | (( 0x6C ) & 0xFF)) , 0x0000f8f8, 0x00000005,
( ((( 0 ) & 0xFF) << 16) | ((( 0x18 ) & 0x1f) << 11) | ((( 1 ) & 0x07) << 8) | (( 0x74 ) & 0xFF)) , 0x0000f8f8, 0x00000006,
( ((( 0 ) & 0xFF) << 16) | ((( 0x18 ) & 0x1f) << 11) | ((( 1 ) & 0x07) << 8) | (( 0x7C ) & 0xFF)) , 0x0000f8f8, 0x00000007,
-
+
( ((( 0 ) & 0xFF) << 16) | ((( 0x18 ) & 0x1f) << 11) | ((( 1 ) & 0x07) << 8) | (( 0x40 ) & 0xFF)) , 0x0000f8fc, 0x00000000,
( ((( 0 ) & 0xFF) << 16) | ((( 0x18 ) & 0x1f) << 11) | ((( 1 ) & 0x07) << 8) | (( 0x48 ) & 0xFF)) , 0x0000f8fc, 0x00000000,
( ((( 0 ) & 0xFF) << 16) | ((( 0x18 ) & 0x1f) << 11) | ((( 1 ) & 0x07) << 8) | (( 0x50 ) & 0xFF)) , 0x0000f8fc, 0x00000000,
@@ -1036,7 +1036,7 @@ static void sdram_set_registers(const struct mem_controller *ctrl)
( ((( 0 ) & 0xFF) << 16) | ((( 0x18 ) & 0x1f) << 11) | ((( 1 ) & 0x07) << 8) | (( 0x68 ) & 0xFF)) , 0x0000f8fc, 0x00000000,
( ((( 0 ) & 0xFF) << 16) | ((( 0x18 ) & 0x1f) << 11) | ((( 1 ) & 0x07) << 8) | (( 0x70 ) & 0xFF)) , 0x0000f8fc, 0x00000000,
( ((( 0 ) & 0xFF) << 16) | ((( 0x18 ) & 0x1f) << 11) | ((( 1 ) & 0x07) << 8) | (( 0x78 ) & 0xFF)) , 0x0000f8fc, 0x00000000,
-
+
( ((( 0 ) & 0xFF) << 16) | ((( 0x18 ) & 0x1f) << 11) | ((( 2 ) & 0x07) << 8) | (( 0x40 ) & 0xFF)) , 0x001f01fe, 0x00000000,
( ((( 0 ) & 0xFF) << 16) | ((( 0x18 ) & 0x1f) << 11) | ((( 2 ) & 0x07) << 8) | (( 0x44 ) & 0xFF)) , 0x001f01fe, 0x00000000,
( ((( 0 ) & 0xFF) << 16) | ((( 0x18 ) & 0x1f) << 11) | ((( 2 ) & 0x07) << 8) | (( 0x48 ) & 0xFF)) , 0x001f01fe, 0x00000000,
@@ -1045,7 +1045,7 @@ static void sdram_set_registers(const struct mem_controller *ctrl)
( ((( 0 ) & 0xFF) << 16) | ((( 0x18 ) & 0x1f) << 11) | ((( 2 ) & 0x07) << 8) | (( 0x54 ) & 0xFF)) , 0x001f01fe, 0x00000000,
( ((( 0 ) & 0xFF) << 16) | ((( 0x18 ) & 0x1f) << 11) | ((( 2 ) & 0x07) << 8) | (( 0x58 ) & 0xFF)) , 0x001f01fe, 0x00000000,
( ((( 0 ) & 0xFF) << 16) | ((( 0x18 ) & 0x1f) << 11) | ((( 2 ) & 0x07) << 8) | (( 0x5C ) & 0xFF)) , 0x001f01fe, 0x00000000,
-
+
( ((( 0 ) & 0xFF) << 16) | ((( 0x18 ) & 0x1f) << 11) | ((( 2 ) & 0x07) << 8) | (( 0x60 ) & 0xFF)) , 0xC01f01ff, 0x00000000,
( ((( 0 ) & 0xFF) << 16) | ((( 0x18 ) & 0x1f) << 11) | ((( 2 ) & 0x07) << 8) | (( 0x64 ) & 0xFF)) , 0xC01f01ff, 0x00000000,
( ((( 0 ) & 0xFF) << 16) | ((( 0x18 ) & 0x1f) << 11) | ((( 2 ) & 0x07) << 8) | (( 0x68 ) & 0xFF)) , 0xC01f01ff, 0x00000000,
@@ -1054,33 +1054,33 @@ static void sdram_set_registers(const struct mem_controller *ctrl)
( ((( 0 ) & 0xFF) << 16) | ((( 0x18 ) & 0x1f) << 11) | ((( 2 ) & 0x07) << 8) | (( 0x74 ) & 0xFF)) , 0xC01f01ff, 0x00000000,
( ((( 0 ) & 0xFF) << 16) | ((( 0x18 ) & 0x1f) << 11) | ((( 2 ) & 0x07) << 8) | (( 0x78 ) & 0xFF)) , 0xC01f01ff, 0x00000000,
( ((( 0 ) & 0xFF) << 16) | ((( 0x18 ) & 0x1f) << 11) | ((( 2 ) & 0x07) << 8) | (( 0x7C ) & 0xFF)) , 0xC01f01ff, 0x00000000,
-
+
( ((( 0 ) & 0xFF) << 16) | ((( 0x18 ) & 0x1f) << 11) | ((( 2 ) & 0x07) << 8) | (( 0x80 ) & 0xFF)) , 0xffff8888, 0x00000000,
-
+
( ((( 0 ) & 0xFF) << 16) | ((( 0x18 ) & 0x1f) << 11) | ((( 2 ) & 0x07) << 8) | (( 0x88 ) & 0xFF)) , 0xe8088008, 0x02522001 ,
-
+
( ((( 0 ) & 0xFF) << 16) | ((( 0x18 ) & 0x1f) << 11) | ((( 2 ) & 0x07) << 8) | (( 0x8c ) & 0xFF)) , 0xff8fe08e, (0 << 20)|(0 << 8)|(0 << 4)|(0 << 0),
-
- ( ((( 0 ) & 0xFF) << 16) | ((( 0x18 ) & 0x1f) << 11) | ((( 2 ) & 0x07) << 8) | (( 0x90 ) & 0xFF)) , 0xf0000000,
- (4 << 25)|(0 << 24)|
- (0 << 23)|(0 << 22)|(0 << 21)|(0 << 20)|
- (1 << 19)|(0 << 18)|(1 << 17)|(0 << 16)|
- (2 << 14)|(0 << 13)|(0 << 12)|
- (0 << 11)|(0 << 10)|(0 << 9)|(0 << 8)|
+
+ ( ((( 0 ) & 0xFF) << 16) | ((( 0x18 ) & 0x1f) << 11) | ((( 2 ) & 0x07) << 8) | (( 0x90 ) & 0xFF)) , 0xf0000000,
+ (4 << 25)|(0 << 24)|
+ (0 << 23)|(0 << 22)|(0 << 21)|(0 << 20)|
+ (1 << 19)|(0 << 18)|(1 << 17)|(0 << 16)|
+ (2 << 14)|(0 << 13)|(0 << 12)|
+ (0 << 11)|(0 << 10)|(0 << 9)|(0 << 8)|
(0 << 3) |(0 << 1) |(0 << 0),
-
+
( ((( 0 ) & 0xFF) << 16) | ((( 0x18 ) & 0x1f) << 11) | ((( 2 ) & 0x07) << 8) | (( 0x94 ) & 0xFF)) , 0xc180f0f0,
(0 << 29)|(0 << 28)|(0 << 27)|(0 << 26)|(0 << 25)|
(0 << 20)|(0 << 19)|(3 << 16)|(0 << 8)|(0 << 0),
-
+
( ((( 0 ) & 0xFF) << 16) | ((( 0x18 ) & 0x1f) << 11) | ((( 2 ) & 0x07) << 8) | (( 0x98 ) & 0xFF)) , 0xfc00ffff, 0x00000000,
-
+
( ((( 0 ) & 0xFF) << 16) | ((( 0x18 ) & 0x1f) << 11) | ((( 3 ) & 0x07) << 8) | (( 0x58 ) & 0xFF)) , 0xffe0e0e0, 0x00000000,
-
+
( ((( 0 ) & 0xFF) << 16) | ((( 0x18 ) & 0x1f) << 11) | ((( 3 ) & 0x07) << 8) | (( 0x5C ) & 0xFF)) , 0x0000003e, 0x00000000,
-
+
( ((( 0 ) & 0xFF) << 16) | ((( 0x18 ) & 0x1f) << 11) | ((( 3 ) & 0x07) << 8) | (( 0x60 ) & 0xFF)) , 0xffffff00, 0x00000000,
-
+
( ((( 0 ) & 0xFF) << 16) | ((( 0x18 ) & 0x1f) << 11) | ((( 3 ) & 0x07) << 8) | (( 0x94 ) & 0xFF)) , 0xffff8000, 0x00000f70,
( ((( 0 ) & 0xFF) << 16) | ((( 0x18 ) & 0x1f) << 11) | ((( 3 ) & 0x07) << 8) | (( 0x90 ) & 0xFF)) , 0xffffff80, 0x00000002,
( ((( 0 ) & 0xFF) << 16) | ((( 0x18 ) & 0x1f) << 11) | ((( 3 ) & 0x07) << 8) | (( 0x98 ) & 0xFF)) , 0x0000000f, 0x00068300,
@@ -1112,14 +1112,14 @@ static int is_dual_channel(const struct mem_controller *ctrl)
}
static int is_opteron(const struct mem_controller *ctrl)
{
-
+
uint32_t nbcap;
nbcap = pci_read_config32(ctrl->f3, 0xE8 );
return !!(nbcap & 0x0001 );
}
static int is_registered(const struct mem_controller *ctrl)
{
-
+
uint32_t dcl;
dcl = pci_read_config32(ctrl->f2, 0x90 );
return !(dcl & (1<<18) );
@@ -1130,45 +1130,45 @@ struct dimm_size {
};
static struct dimm_size spd_get_dimm_size(unsigned device)
{
-
+
struct dimm_size sz;
int value, low;
sz.side1 = 0;
sz.side2 = 0;
-
- value = spd_read_byte(device, 3);
+
+ value = spd_read_byte(device, 3);
if (value < 0) goto out;
sz.side1 += value & 0xf;
- value = spd_read_byte(device, 4);
+ value = spd_read_byte(device, 4);
if (value < 0) goto out;
sz.side1 += value & 0xf;
- value = spd_read_byte(device, 17);
+ value = spd_read_byte(device, 17);
if (value < 0) goto out;
sz.side1 += log2(value & 0xff);
-
- value = spd_read_byte(device, 7);
+
+ value = spd_read_byte(device, 7);
if (value < 0) goto out;
value &= 0xff;
value <<= 8;
-
- low = spd_read_byte(device, 6);
+
+ low = spd_read_byte(device, 6);
if (low < 0) goto out;
value = value | (low & 0xff);
sz.side1 += log2(value);
-
- value = spd_read_byte(device, 5);
+
+ value = spd_read_byte(device, 5);
if (value <= 1) goto out;
-
+
sz.side2 = sz.side1;
- value = spd_read_byte(device, 3);
+ value = spd_read_byte(device, 3);
if (value < 0) goto out;
- if ((value & 0xf0) == 0) goto out;
- sz.side2 -= (value & 0x0f);
- sz.side2 += ((value >> 4) & 0x0f);
- value = spd_read_byte(device, 4);
+ if ((value & 0xf0) == 0) goto out;
+ sz.side2 -= (value & 0x0f);
+ sz.side2 += ((value >> 4) & 0x0f);
+ value = spd_read_byte(device, 4);
if (value < 0) goto out;
- sz.side2 -= (value & 0x0f);
- sz.side2 += ((value >> 4) & 0x0f);
+ sz.side2 -= (value & 0x0f);
+ sz.side2 += ((value >> 4) & 0x0f);
out:
return sz;
}
@@ -1181,32 +1181,32 @@ static void set_dimm_size(const struct mem_controller *ctrl, struct dimm_size sz
}
map = pci_read_config32(ctrl->f2, 0x80 );
map &= ~(0xf << (index + 4));
-
-
+
+
base0 = base1 = 0;
-
+
if (sz.side1 >= (25 +3)) {
map |= (sz.side1 - (25 + 3)) << (index *4);
base0 = (1 << ((sz.side1 - (25 + 3)) + 21)) | 1;
}
-
+
if (sz.side2 >= (25 + 3)) {
base1 = (1 << ((sz.side2 - (25 + 3)) + 21)) | 1;
}
-
+
if (is_dual_channel(ctrl)) {
base0 = (base0 << 1) | (base0 & 1);
base1 = (base1 << 1) | (base1 & 1);
}
-
+
base0 &= ~0x001ffffe;
base1 &= ~0x001ffffe;
-
+
pci_write_config32(ctrl->f2, 0x40 + (((index << 1)+0)<<2), base0);
pci_write_config32(ctrl->f2, 0x40 + (((index << 1)+1)<<2), base1);
pci_write_config32(ctrl->f2, 0x80 , map);
-
-
+
+
if (base0) {
dch = pci_read_config32(ctrl->f2, 0x94 );
dch |= (1 << 26) << index;
@@ -1216,7 +1216,7 @@ static void set_dimm_size(const struct mem_controller *ctrl, struct dimm_size sz
static void spd_set_ram_size(const struct mem_controller *ctrl)
{
int i;
-
+
for(i = 0; (i < 4) && (ctrl->channel0[i]); i++) {
struct dimm_size sz;
sz = spd_get_dimm_size(ctrl->channel0[i]);
@@ -1226,7 +1226,7 @@ static void spd_set_ram_size(const struct mem_controller *ctrl)
static void route_dram_accesses(const struct mem_controller *ctrl,
unsigned long base_k, unsigned long limit_k)
{
-
+
unsigned node_id;
unsigned limit;
unsigned base;
@@ -1251,25 +1251,25 @@ static void route_dram_accesses(const struct mem_controller *ctrl,
}
static void set_top_mem(unsigned tom_k)
{
-
+
if (!tom_k) {
set_bios_reset();
print_debug("No memory - reset");
-
+
pci_write_config8(( ((( 0 ) & 0xFF) << 16) | ((( 0x04 ) & 0x1f) << 11) | ((( 3 ) & 0x7) << 8)) , 0x41, 0xf1);
-
+
outb(0x0e, 0x0cf9);
}
-
+
print_debug("RAM: 0x");
print_debug_hex32(tom_k);
print_debug(" KB\r\n");
-
+
msr_t msr;
msr.lo = (tom_k & 0x003fffff) << 10;
msr.hi = (tom_k & 0xffc00000) >> 22;
wrmsr(0xC001001D , msr);
-
+
if (tom_k >= 0x003f0000) {
tom_k = 0x3f0000;
}
@@ -1279,15 +1279,15 @@ static void set_top_mem(unsigned tom_k)
}
static unsigned long interleave_chip_selects(const struct mem_controller *ctrl)
{
-
- static const uint32_t csbase_low[] = {
+
+ static const uint32_t csbase_low[] = {
(1 << (13 - 4)),
(1 << (14 - 4)),
- (1 << (14 - 4)),
+ (1 << (14 - 4)),
(1 << (15 - 4)),
(1 << (15 - 4)),
(1 << (16 - 4)),
- (1 << (16 - 4)),
+ (1 << (16 - 4)),
};
uint32_t csbase_inc;
int chip_selects, index;
@@ -1295,16 +1295,16 @@ static unsigned long interleave_chip_selects(const struct mem_controller *ctrl)
int dual_channel;
unsigned common_size;
uint32_t csbase, csmask;
-
+
chip_selects = 0;
common_size = 0;
for(index = 0; index < 8; index++) {
unsigned size;
uint32_t value;
-
+
value = pci_read_config32(ctrl->f2, 0x40 + (index << 2));
-
-
+
+
if (!(value & 1)) {
continue;
}
@@ -1313,36 +1313,36 @@ static unsigned long interleave_chip_selects(const struct mem_controller *ctrl)
if (common_size == 0) {
common_size = size;
}
-
+
if (common_size != size) {
return 0;
}
}
-
+
bits = log2(chip_selects);
if (((1 << bits) != chip_selects) || (bits < 1) || (bits > 3)) {
return 0;
-
+
}
-
+
if ((bits == 3) && (common_size == (1 << (32 - 3)))) {
print_debug("8 4GB chip selects cannot be interleaved\r\n");
return 0;
}
-
+
if (is_dual_channel(ctrl)) {
csbase_inc = csbase_low[log2(common_size) - 1] << 1;
} else {
csbase_inc = csbase_low[log2(common_size)];
}
-
+
csbase = 0 | 1;
csmask = (((common_size << bits) - 1) << 21);
csmask |= 0xfe00 & ~((csbase_inc << bits) - csbase_inc);
for(index = 0; index < 8; index++) {
uint32_t value;
value = pci_read_config32(ctrl->f2, 0x40 + (index << 2));
-
+
if (!(value & 1)) {
continue;
}
@@ -1350,19 +1350,19 @@ static unsigned long interleave_chip_selects(const struct mem_controller *ctrl)
pci_write_config32(ctrl->f2, 0x60 + (index << 2), csmask);
csbase += csbase_inc;
}
-
+
print_debug("Interleaved\r\n");
-
+
return common_size << (15 + bits);
}
static unsigned long order_chip_selects(const struct mem_controller *ctrl)
{
unsigned long tom;
-
-
+
+
tom = 0;
for(;;) {
-
+
unsigned index, canidate;
uint32_t csbase, csmask;
unsigned size;
@@ -1371,46 +1371,46 @@ static unsigned long order_chip_selects(const struct mem_controller *ctrl)
for(index = 0; index < 8; index++) {
uint32_t value;
value = pci_read_config32(ctrl->f2, 0x40 + (index << 2));
-
+
if (!(value & 1)) {
continue;
}
-
-
+
+
if (value <= csbase) {
continue;
}
-
-
+
+
if (tom & (1 << (index + 24))) {
continue;
}
-
+
csbase = value;
canidate = index;
}
-
+
if (csbase == 0) {
break;
}
-
+
size = csbase >> 21;
-
+
tom |= (1 << (canidate + 24));
-
+
csbase = (tom << 21) | 1;
-
+
tom += size;
-
+
csmask = ((size -1) << 21);
- csmask |= 0xfe00;
-
+ csmask |= 0xfe00;
+
pci_write_config32(ctrl->f2, 0x40 + (canidate << 2), csbase);
-
+
pci_write_config32(ctrl->f2, 0x60 + (canidate << 2), csmask);
-
+
}
-
+
return (tom & ~0xff000000) << 15;
}
static void order_dimms(const struct mem_controller *ctrl)
@@ -1421,14 +1421,14 @@ static void order_dimms(const struct mem_controller *ctrl)
if (!tom_k) {
tom_k = order_chip_selects(ctrl);
}
-
+
base_k = 0;
for(node_id = 0; node_id < ctrl->node_id; node_id++) {
uint32_t limit, base;
unsigned index;
index = node_id << 3;
base = pci_read_config32(ctrl->f1, 0x40 + index);
-
+
if ((base & 3) == 3) {
limit = pci_read_config32(ctrl->f1, 0x44 + index);
base_k = ((limit + 0x00010000) & 0xffff0000) >> 2;
@@ -1440,8 +1440,8 @@ static void order_dimms(const struct mem_controller *ctrl)
}
static void disable_dimm(const struct mem_controller *ctrl, unsigned index)
{
- print_debug("disabling dimm");
- print_debug_hex8(index);
+ print_debug("disabling dimm");
+ print_debug_hex8(index);
print_debug("\r\n");
pci_write_config32(ctrl->f2, 0x40 + (((index << 1)+0)<<2), 0);
pci_write_config32(ctrl->f2, 0x40 + (((index << 1)+1)<<2), 0);
@@ -1461,11 +1461,11 @@ static void spd_handle_unbuffered_dimms(const struct mem_controller *ctrl)
disable_dimm(ctrl, i);
continue;
}
-
+
if (value & (1 << 1)) {
registered = 1;
- }
-
+ }
+
else {
unbuffered = 1;
}
@@ -1487,29 +1487,29 @@ static void spd_enable_2channels(const struct mem_controller *ctrl)
{
int i;
uint32_t nbcap;
-
-
+
+
static const unsigned addresses[] = {
- 2,
- 3,
- 4,
- 5,
- 6,
- 7,
- 9,
- 11,
- 13,
- 17,
- 18,
- 21,
- 23,
- 26,
- 27,
- 28,
- 29,
- 30,
- 41,
- 42,
+ 2,
+ 3,
+ 4,
+ 5,
+ 6,
+ 7,
+ 9,
+ 11,
+ 13,
+ 17,
+ 18,
+ 21,
+ 23,
+ 26,
+ 27,
+ 28,
+ 29,
+ 30,
+ 41,
+ 42,
};
nbcap = pci_read_config32(ctrl->f3, 0xE8 );
if (!(nbcap & 0x0001 )) {
@@ -1548,7 +1548,7 @@ static void spd_enable_2channels(const struct mem_controller *ctrl)
}
struct mem_param {
uint8_t cycle_time;
- uint8_t divisor;
+ uint8_t divisor;
uint8_t tRC;
uint8_t tRFC;
uint32_t dch_memclk;
@@ -1621,35 +1621,35 @@ static const struct mem_param *get_mem_param(unsigned min_cycle_time)
}
static const struct mem_param *spd_set_memclk(const struct mem_controller *ctrl)
{
-
+
const struct mem_param *param;
unsigned min_cycle_time, min_latency;
int i;
uint32_t value;
static const int latency_indicies[] = { 26, 23, 9 };
static const unsigned char min_cycle_times[] = {
- [0 ] = 0x50,
- [1 ] = 0x60,
- [2 ] = 0x75,
- [3 ] = 0xa0,
+ [0 ] = 0x50,
+ [1 ] = 0x60,
+ [2 ] = 0x75,
+ [3 ] = 0xa0,
};
value = pci_read_config32(ctrl->f3, 0xE8 );
min_cycle_time = min_cycle_times[(value >> 5 ) & 3 ];
min_latency = 2;
-
+
for(i = 0; (i < 4) && (ctrl->channel0[i]); i++) {
int new_cycle_time, new_latency;
int index;
int latencies;
int latency;
-
+
new_cycle_time = 0xa0;
new_latency = 5;
latencies = spd_read_byte(ctrl->channel0[i], 18);
if (latencies <= 0) continue;
-
+
latency = log2(latencies) -2;
-
+
for(index = 0; index < 3; index++, latency++) {
int value;
if ((latency < 2) || (latency > 4) ||
@@ -1660,7 +1660,7 @@ static const struct mem_param *spd_set_memclk(const struct mem_controller *ctrl)
if (value < 0) {
continue;
}
-
+
if ((value >= min_cycle_time) && (value < new_cycle_time)) {
new_cycle_time = value;
new_latency = latency;
@@ -1669,17 +1669,17 @@ static const struct mem_param *spd_set_memclk(const struct mem_controller *ctrl)
if (new_latency > 4){
continue;
}
-
+
if (new_cycle_time > min_cycle_time) {
min_cycle_time = new_cycle_time;
}
-
+
if (new_latency > min_latency) {
min_latency = new_latency;
}
}
-
-
+
+
for(i = 0; (i < 4) && (ctrl->channel0[i]); i++) {
int latencies;
int latency;
@@ -1690,9 +1690,9 @@ static const struct mem_param *spd_set_memclk(const struct mem_controller *ctrl)
if (latencies <= 0) {
goto dimm_err;
}
-
+
latency = log2(latencies) -2;
-
+
for(index = 0; index < 3; index++, latency++) {
if (!(latencies & (1 << latency))) {
continue;
@@ -1700,36 +1700,36 @@ static const struct mem_param *spd_set_memclk(const struct mem_controller *ctrl)
if (latency == min_latency)
break;
}
-
+
if ((latency != min_latency) || (index >= 3)) {
goto dimm_err;
}
-
-
+
+
value = spd_read_byte(ctrl->channel0[i], latency_indicies[index]);
-
-
+
+
if (value <= min_cycle_time) {
continue;
}
-
+
dimm_err:
disable_dimm(ctrl, i);
}
-
+
param = get_mem_param(min_cycle_time);
-
+
value = pci_read_config32(ctrl->f2, 0x94 );
value &= ~(0x7 << 20 );
value |= param->dch_memclk;
pci_write_config32(ctrl->f2, 0x94 , value);
static const unsigned latencies[] = { 1 , 5 , 2 };
-
+
value = pci_read_config32(ctrl->f2, 0x88 );
value &= ~(0x7 << 0 );
value |= latencies[min_latency - 2] << 0 ;
pci_write_config32(ctrl->f2, 0x88 , value);
-
+
return param;
}
static int update_dimm_Trc(const struct mem_controller *ctrl, const struct mem_param *param, int i)
@@ -1974,7 +1974,7 @@ static void set_Twtr(const struct mem_controller *ctrl, const struct mem_param *
{
uint32_t dth;
unsigned clocks;
- clocks = 1;
+ clocks = 1;
dth = pci_read_config32(ctrl->f2, 0x8c );
dth &= ~(0x1 << 0 );
dth |= ((clocks - 1 ) << 0 );
@@ -1993,11 +1993,11 @@ static void set_Trwt(const struct mem_controller *ctrl, const struct mem_param *
if (is_opteron(ctrl)) {
if (latency == 1 ) {
if (divisor == ((6 << 0) + 0)) {
-
+
clocks = 3;
}
else if (divisor > ((6 << 0)+0)) {
-
+
clocks = 2;
}
}
@@ -2006,11 +2006,11 @@ static void set_Trwt(const struct mem_controller *ctrl, const struct mem_param *
}
else if (latency == 2 ) {
if (divisor == ((6 << 0)+0)) {
-
+
clocks = 4;
}
else if (divisor > ((6 << 0)+0)) {
-
+
clocks = 3;
}
}
@@ -2042,7 +2042,7 @@ static void set_Trwt(const struct mem_controller *ctrl, const struct mem_param *
if ((clocks < 1 ) || (clocks > 6 )) {
die("Unknown Trwt");
}
-
+
dth = pci_read_config32(ctrl->f2, 0x8c );
dth &= ~(0x7 << 4 );
dth |= ((clocks - 1 ) << 4 );
@@ -2051,7 +2051,7 @@ static void set_Trwt(const struct mem_controller *ctrl, const struct mem_param *
}
static void set_Twcl(const struct mem_controller *ctrl, const struct mem_param *param)
{
-
+
uint32_t dth;
unsigned clocks;
if (is_registered(ctrl)) {
@@ -2075,19 +2075,19 @@ static void set_read_preamble(const struct mem_controller *ctrl, const struct me
rdpreamble = 0;
if (is_registered(ctrl)) {
if (divisor == ((10 << 1)+0)) {
-
+
rdpreamble = ((9 << 1)+ 0);
}
else if (divisor == ((7 << 1)+1)) {
-
+
rdpreamble = ((8 << 1)+0);
}
else if (divisor == ((6 << 1)+0)) {
-
+
rdpreamble = ((7 << 1)+1);
}
else if (divisor == ((5 << 1)+0)) {
-
+
rdpreamble = ((7 << 1)+0);
}
}
@@ -2101,42 +2101,42 @@ static void set_read_preamble(const struct mem_controller *ctrl, const struct me
}
}
if (divisor == ((10 << 1)+0)) {
-
+
if (slots <= 2) {
-
+
rdpreamble = ((9 << 1)+0);
} else {
-
+
rdpreamble = ((14 << 1)+0);
}
}
else if (divisor == ((7 << 1)+1)) {
-
+
if (slots <= 2) {
-
+
rdpreamble = ((7 << 1)+0);
} else {
-
+
rdpreamble = ((11 << 1)+0);
}
}
else if (divisor == ((6 << 1)+0)) {
-
+
if (slots <= 2) {
-
+
rdpreamble = ((7 << 1)+0);
} else {
-
+
rdpreamble = ((9 << 1)+0);
}
}
else if (divisor == ((5 << 1)+0)) {
-
+
if (slots <= 2) {
-
+
rdpreamble = ((5 << 1)+0);
} else {
-
+
rdpreamble = ((7 << 1)+0);
}
}
@@ -2159,11 +2159,11 @@ static void set_max_async_latency(const struct mem_controller *ctrl, const struc
async_lat = 0;
if (is_registered(ctrl)) {
if (dimms == 4) {
-
+
async_lat = 9;
- }
+ }
else {
-
+
async_lat = 8;
}
}
@@ -2172,11 +2172,11 @@ static void set_max_async_latency(const struct mem_controller *ctrl, const struc
die("Too many unbuffered dimms");
}
else if (dimms == 3) {
-
+
async_lat = 7;
}
else {
-
+
async_lat = 6;
}
}
@@ -2186,7 +2186,7 @@ static void set_max_async_latency(const struct mem_controller *ctrl, const struc
static void set_idle_cycle_limit(const struct mem_controller *ctrl, const struct mem_param *param)
{
uint32_t dch;
-
+
dch = pci_read_config32(ctrl->f2, 0x94 );
dch &= ~(0x7 << 16 );
dch |= 3 << 16 ;
@@ -2198,39 +2198,39 @@ static void spd_set_dram_timing(const struct mem_controller *ctrl, const struct
int dimms;
int i;
int rc;
-
+
init_Tref(ctrl, param);
for(i = 0; (i < 4) && ctrl->channel0[i]; i++) {
int rc;
-
+
if (update_dimm_Trc (ctrl, param, i) < 0) goto dimm_err;
if (update_dimm_Trfc(ctrl, param, i) < 0) goto dimm_err;
if (update_dimm_Trcd(ctrl, param, i) < 0) goto dimm_err;
if (update_dimm_Trrd(ctrl, param, i) < 0) goto dimm_err;
if (update_dimm_Tras(ctrl, param, i) < 0) goto dimm_err;
if (update_dimm_Trp (ctrl, param, i) < 0) goto dimm_err;
-
+
if (update_dimm_Tref(ctrl, param, i) < 0) goto dimm_err;
-
+
if (update_dimm_x4 (ctrl, param, i) < 0) goto dimm_err;
if (update_dimm_ecc(ctrl, param, i) < 0) goto dimm_err;
continue;
dimm_err:
disable_dimm(ctrl, i);
-
+
}
-
+
set_Twr(ctrl, param);
-
+
set_Twtr(ctrl, param);
set_Trwt(ctrl, param);
set_Twcl(ctrl, param);
-
+
set_read_preamble(ctrl, param);
set_max_async_latency(ctrl, param);
set_idle_cycle_limit(ctrl, param);
}
-static void sdram_set_spd_registers(const struct mem_controller *ctrl)
+static void sdram_set_spd_registers(const struct mem_controller *ctrl)
{
const struct mem_param *param;
spd_enable_2channels(ctrl);
@@ -2243,18 +2243,18 @@ static void sdram_set_spd_registers(const struct mem_controller *ctrl)
static void sdram_enable(int controllers, const struct mem_controller *ctrl)
{
int i;
-
+
for(i = 0; i < controllers; i++) {
uint32_t dch;
dch = pci_read_config32(ctrl[i].f2, 0x94 );
dch |= (1 << 25) ;
pci_write_config32(ctrl[i].f2, 0x94 , dch);
}
-
+
memreset(controllers, ctrl);
for(i = 0; i < controllers; i++) {
uint32_t dcl;
-
+
dcl = pci_read_config32(ctrl[i].f2, 0x90 );
if (dcl & (1<<17) ) {
uint32_t mnc;
@@ -2294,7 +2294,7 @@ static void sdram_enable(int controllers, const struct mem_controller *ctrl)
if (dcl & (1<<17) ) {
print_debug("Clearing memory: ");
if (!is_cpu_pre_c0()) {
-
+
dcl &= ~((1<<11) | (1<<10) );
pci_write_config32(ctrl[i].f2, 0x90 , dcl);
do {
@@ -2304,10 +2304,10 @@ static void sdram_enable(int controllers, const struct mem_controller *ctrl)
uint32_t base, last_scrub_k, scrub_k;
uint32_t cnt,zstart,zend;
msr_t msr,msr_201;
-
+
pci_write_config32(ctrl[i].f3, 0x58 ,
(0 << 16) | (0 << 8) | (0 << 0));
-
+
msr_201 = rdmsr(0x201);
zstart = pci_read_config32(ctrl[0].f1, 0x40 + (i*8));
zend = pci_read_config32(ctrl[0].f1, 0x44 + (i*8));
@@ -2318,50 +2318,50 @@ static void sdram_enable(int controllers, const struct mem_controller *ctrl)
print_debug("-");
print_debug_hex32(zend);
print_debug("\r\n");
-
-
+
+
msr = rdmsr(0x2ff );
msr.lo &= ~(1<<10);
wrmsr(0x2ff , msr);
-
+
msr = rdmsr(0xc0010015);
msr.lo |= (1<<17);
wrmsr(0xc0010015,msr);
for(;zstart<zend;zstart+=4) {
-
+
if(zstart == 0x0fc)
continue;
-
-
+
+
__asm__ volatile(
"movl %%cr0, %0\n\t"
"orl $0x40000000, %0\n\t"
"movl %0, %%cr0\n\t"
:"=r" (cnt)
);
-
-
+
+
msr.lo = 1 + ((zstart&0x0ff)<<24);
msr.hi = (zstart&0x0ff00)>>8;
wrmsr(0x200,msr);
-
+
msr.hi = 0x000000ff;
msr.lo = 0xfc000800;
wrmsr(0x201,msr);
-
+
__asm__ volatile(
"movl %%cr0, %0\n\t"
"andl $0x9fffffff, %0\n\t"
- "movl %0, %%cr0\n\t"
- :"=r" (cnt)
+ "movl %0, %%cr0\n\t"
+ :"=r" (cnt)
);
-
+
msr.lo = (zstart&0xff) << 24;
msr.hi = (zstart&0xff00) >> 8;
wrmsr(0xc0000100,msr);
- print_debug_char((zstart > 0x0ff)?'+':'-');
-
-
+ print_debug_char((zstart > 0x0ff)?'+':'-');
+
+
__asm__ volatile(
"1: \n\t"
"movl %0, %%fs:(%1)\n\t"
@@ -2370,67 +2370,67 @@ static void sdram_enable(int controllers, const struct mem_controller *ctrl)
"jnz 1b\n\t"
:
: "a" (0), "D" (0), "c" (0x01000000)
- );
+ );
}
-
-
+
+
__asm__ volatile(
"movl %%cr0, %0\n\t"
"orl $0x40000000, %0\n\t"
"movl %0, %%cr0\n\t"
- :"=r" (cnt)
+ :"=r" (cnt)
);
-
-
+
+
msr = rdmsr(0x2ff );
msr.lo |= 0x0400;
wrmsr(0x2ff , msr);
-
+
msr.lo = 6;
msr.hi = 0;
wrmsr(0x200,msr);
wrmsr(0x201,msr_201);
-
+
msr.lo = 0;
msr.hi = 0;
wrmsr(0xc0000100,msr);
-
+
__asm__ volatile(
"movl %%cr0, %0\n\t"
"andl $0x9fffffff, %0\n\t"
- "movl %0, %%cr0\n\t"
- :"=r" (cnt)
+ "movl %0, %%cr0\n\t"
+ :"=r" (cnt)
);
-
-
+
+
msr = rdmsr(0xc0010015);
msr.lo &= ~(1<<17);
wrmsr(0xc0010015,msr);
-
+
base = pci_read_config32(ctrl[i].f1, 0x40 + (ctrl[i].node_id << 3));
base &= 0xffff0000;
-
+
pci_write_config32(ctrl[i].f3, 0x5C , base << 8);
pci_write_config32(ctrl[i].f3, 0x60 , base >> 24);
-
- pci_write_config32(ctrl[i].f3, 0x58 ,
+
+ pci_write_config32(ctrl[i].f3, 0x58 ,
(22 << 16) | (22 << 8) | (22 << 0));
print_debug("done\r\n");
}
}
}
-
-
-
-
-
+
+
+
+
+
typedef uint8_t u8;
typedef uint32_t u32;
typedef int8_t bool;
static void disable_probes(void)
{
-
-
+
+
u32 val;
print_debug("Disabling read/write/fill probes for UP... ");
val=pci_read_config32(( ((( 0 ) & 0xFF) << 16) | ((( 24+ 0 ) & 0x1f) << 11) | ((( 0 ) & 0x7) << 8)) , 0x68);
@@ -2438,8 +2438,8 @@ static void disable_probes(void)
pci_write_config32(( ((( 0 ) & 0xFF) << 16) | ((( 24+ 0 ) & 0x1f) << 11) | ((( 0 ) & 0x7) << 8)) , 0x68, val);
print_debug("done.\r\n");
}
-
-static void wait_ap_stop(u8 node)
+
+static void wait_ap_stop(u8 node)
{
unsigned long reg;
unsigned long i;
@@ -2449,7 +2449,7 @@ static void wait_ap_stop(u8 node)
if((regx & (1<<4))==1) break;
}
reg = pci_read_config32(( ((( 0 ) & 0xFF) << 16) | ((( 24+ node ) & 0x1f) << 11) | ((( 0 ) & 0x7) << 8)) ,0x6c);
- reg &= ~(1<<4);
+ reg &= ~(1<<4);
pci_write_config32(( ((( 0 ) & 0xFF) << 16) | ((( 24+ node ) & 0x1f) << 11) | ((( 0 ) & 0x7) << 8)) , 0x6c, reg);
}
static void notify_bsp_ap_is_stopped(void)
@@ -2458,31 +2458,31 @@ static void notify_bsp_ap_is_stopped(void)
unsigned long apic_id;
apic_id = *((volatile unsigned long *)(0xfee00000 + 0x020 ));
apic_id >>= 24;
-
+
if(apic_id != 0) {
-
+
reg = pci_read_config32(( ((( 0 ) & 0xFF) << 16) | ((( 24+ apic_id ) & 0x1f) << 11) | ((( 0 ) & 0x7) << 8)) , 0x6C);
reg |= 1<<4;
pci_write_config32(( ((( 0 ) & 0xFF) << 16) | ((( 24+ apic_id ) & 0x1f) << 11) | ((( 0 ) & 0x7) << 8)) , 0x6C, reg);
}
-
+
}
-
+
static void enable_routing(u8 node)
{
u32 val;
-
-
+
+
print_debug("Enabling routing table for node ");
print_debug_hex32(node);
val=pci_read_config32(( ((( 0 ) & 0xFF) << 16) | ((( 24+ node ) & 0x1f) << 11) | ((( 0 ) & 0x7) << 8)) , 0x6c);
val &= ~((1<<6)|(1<<5)|(1<<4)|(1<<1)|(1<<0));
pci_write_config32(( ((( 0 ) & 0xFF) << 16) | ((( 24+ node ) & 0x1f) << 11) | ((( 0 ) & 0x7) << 8)) , 0x6c, val);
-
+
if(node!=0) {
wait_ap_stop(node);
}
-
+
print_debug(" done.\r\n");
}
static void rename_temp_node(u8 node)
@@ -2491,21 +2491,21 @@ static void rename_temp_node(u8 node)
print_debug("Renaming current temp node to ");
print_debug_hex32(node);
val=pci_read_config32(( ((( 0 ) & 0xFF) << 16) | ((( 24+ 7 ) & 0x1f) << 11) | ((( 0 ) & 0x7) << 8)) , 0x60);
- val &= (~7);
- val |= node;
+ val &= (~7);
+ val |= node;
pci_write_config32(( ((( 0 ) & 0xFF) << 16) | ((( 24+ 7 ) & 0x1f) << 11) | ((( 0 ) & 0x7) << 8)) , 0x60, val);
print_debug(" done.\r\n");
}
static bool check_connection(u8 src, u8 dest, u8 link)
{
-
+
u32 val;
-
-
+
+
val=pci_read_config32(( ((( 0 ) & 0xFF) << 16) | ((( 24+ src ) & 0x1f) << 11) | ((( 0 ) & 0x7) << 8)) , 0x98+link);
if ( (val&0x17) != 0x03)
return 0;
-
+
val=pci_read_config32(( ((( 0 ) & 0xFF) << 16) | ((( 24+ dest ) & 0x1f) << 11) | ((( 0 ) & 0x7) << 8)) ,0);
if(val != 0x11001022)
return 0;
@@ -2518,37 +2518,37 @@ static void optimize_connection(u8 node1, u8 link1, u8 node2, u8 link2)
uint16_t freq_cap1, freq_cap2, freq_cap, freq_mask;
uint8_t width_cap1, width_cap2, width_cap, width, ln_width1, ln_width2;
uint8_t freq;
-
-
+
+
freq_cap1 = pci_read_config16(( ((( 0 ) & 0xFF) << 16) | ((( 24+ node1 ) & 0x1f) << 11) | ((( 0 ) & 0x7) << 8)) , 0x80 + link1 + 0x0a );
freq_cap2 = pci_read_config16(( ((( 0 ) & 0xFF) << 16) | ((( 24+ node2 ) & 0x1f) << 11) | ((( 0 ) & 0x7) << 8)) , 0x80 + link2 + 0x0a );
-
-
+
+
freq = log2(freq_cap1 & freq_cap2 & 0xff);
-
+
pci_write_config8(( ((( 0 ) & 0xFF) << 16) | ((( 24+ node1 ) & 0x1f) << 11) | ((( 0 ) & 0x7) << 8)) , 0x80 + link1 + 0x09 , freq);
pci_write_config8(( ((( 0 ) & 0xFF) << 16) | ((( 24+ node2 ) & 0x1f) << 11) | ((( 0 ) & 0x7) << 8)) , 0x80 + link2 + 0x09 , freq);
-
+
width_cap1 = pci_read_config8(( ((( 0 ) & 0xFF) << 16) | ((( 24+ node1 ) & 0x1f) << 11) | ((( 0 ) & 0x7) << 8)) , 0x80 + link1 + 6 );
width_cap2 = pci_read_config8(( ((( 0 ) & 0xFF) << 16) | ((( 24+ node2 ) & 0x1f) << 11) | ((( 0 ) & 0x7) << 8)) , 0x80 + link2 + 6 );
-
+
ln_width1 = link_width_to_pow2[width_cap1 & 7];
ln_width2 = link_width_to_pow2[(width_cap2 >> 4) & 7];
if (ln_width1 > ln_width2) {
ln_width1 = ln_width2;
}
width = pow2_to_link_width[ln_width1];
-
+
ln_width1 = link_width_to_pow2[(width_cap1 >> 4) & 7];
ln_width2 = link_width_to_pow2[width_cap2 & 7];
if (ln_width1 > ln_width2) {
ln_width1 = ln_width2;
}
width |= pow2_to_link_width[ln_width1] << 4;
-
-
+
+
pci_write_config8(( ((( 0 ) & 0xFF) << 16) | ((( 24+ node1 ) & 0x1f) << 11) | ((( 0 ) & 0x7) << 8)) , 0x80 + link1 + 6 + 1, width);
-
+
width = ((width & 0x70) >> 4) | ((width & 0x7) << 4);
pci_write_config8(( ((( 0 ) & 0xFF) << 16) | ((( 24+ node2 ) & 0x1f) << 11) | ((( 0 ) & 0x7) << 8)) , 0x80 + link2 + 6 + 1, width);
}
@@ -2576,8 +2576,8 @@ static void setup_remote_row(u8 source, u8 dest, u8 cpus)
}
static void setup_remote_node(u8 node, u8 cpus)
{
- static const uint8_t pci_reg[] = {
- 0x44, 0x4c, 0x54, 0x5c, 0x64, 0x6c, 0x74, 0x7c,
+ static const uint8_t pci_reg[] = {
+ 0x44, 0x4c, 0x54, 0x5c, 0x64, 0x6c, 0x74, 0x7c,
0x40, 0x48, 0x50, 0x58, 0x60, 0x68, 0x70, 0x78,
0x84, 0x8c, 0x94, 0x9c, 0xa4, 0xac, 0xb4, 0xbc,
0x80, 0x88, 0x90, 0x98, 0xa0, 0xa8, 0xb0, 0xb8,
@@ -2590,7 +2590,7 @@ static void setup_remote_node(u8 node, u8 cpus)
print_debug("setup_remote_node\r\n");
for(row=0; row<cpus; row++)
setup_remote_row(node, row, cpus);
-
+
for(i = 0; i < sizeof(pci_reg)/sizeof(pci_reg[0]); i++) {
uint32_t value;
uint8_t reg;
@@ -2611,24 +2611,24 @@ static u8 setup_smp(void)
u8 cpus=2;
print_debug("Enabling SMP settings\r\n");
setup_row(0,0,cpus);
-
+
setup_temp_row(0,1,cpus);
-
+
if (!check_connection(0, 7, 0x20 )) {
print_debug("No connection to Node 1.\r\n");
- fill_row( 0 ,7,0x00010101 ) ;
- setup_uniprocessor();
+ fill_row( 0 ,7,0x00010101 ) ;
+ setup_uniprocessor();
return 1;
}
-
+
optimize_connection(0, 0x20 , 7, 0x20 );
- setup_node(0, cpus);
- setup_remote_node(1, cpus);
- rename_temp_node(1);
- enable_routing(1);
-
- fill_row( 0 ,7,0x00010101 ) ;
-
+ setup_node(0, cpus);
+ setup_remote_node(1, cpus);
+ rename_temp_node(1);
+ enable_routing(1);
+
+ fill_row( 0 ,7,0x00010101 ) ;
+
print_debug_hex32(cpus);
print_debug(" nodes initialized.\r\n");
return cpus;
@@ -2641,29 +2641,29 @@ static unsigned detect_mp_capabilities(unsigned cpus)
print_debug_hex32(cpus);
print_debug("\r\n");
if (cpus>2)
- mask=0x06;
+ mask=0x06;
else
- mask=0x02;
+ mask=0x02;
for (node=0; node<cpus; node++) {
if ((pci_read_config32(( ((( 0 ) & 0xFF) << 16) | ((( 24+ node ) & 0x1f) << 11) | ((( 3 ) & 0x7) << 8)) , 0xe8) & mask)!=mask)
mp_cap= (0) ;
}
if (mp_cap)
return cpus;
-
+
print_debug("One of the CPUs is not MP capable. Going back to UP\r\n");
for (node=cpus; node>0; node--)
for (row=cpus; row>0; row--)
fill_row(( ((( 0 ) & 0xFF) << 16) | ((( 24+ node-1 ) & 0x1f) << 11) | ((( 0 ) & 0x7) << 8)) , row-1, 0x00010101 );
-
+
return setup_uniprocessor();
}
static void coherent_ht_finalize(unsigned cpus)
{
int node;
bool rev_a0;
-
-
+
+
print_debug("coherent_ht_finalize\r\n");
rev_a0= is_cpu_rev_a0();
for (node=0; node<cpus; node++) {
@@ -2691,36 +2691,36 @@ static int setup_coherent_ht_domain(void)
cpus=setup_smp();
cpus=detect_mp_capabilities(cpus);
coherent_ht_finalize(cpus);
-
+
coherent_ht_mainboard(cpus);
return reset_needed;
}
void sdram_no_memory(void)
{
print_err("No memory!!\r\n");
- while(1) {
- hlt();
+ while(1) {
+ hlt();
}
}
-
+
void sdram_initialize(int controllers, const struct mem_controller *ctrl)
{
int i;
-
+
for(i = 0; i < controllers; i++) {
print_debug("Ram1.");
print_debug_hex8(i);
print_debug("\r\n");
sdram_set_registers(ctrl + i);
}
-
+
for(i = 0; i < controllers; i++) {
print_debug("Ram2.");
print_debug_hex8(i);
print_debug("\r\n");
sdram_set_spd_registers(ctrl + i);
}
-
+
print_debug("Ram3\r\n");
sdram_enable(controllers, ctrl);
print_debug("Ram4\r\n");
@@ -2738,17 +2738,17 @@ static void stop_this_cpu(void)
{
unsigned apicid;
apicid = apic_read(0x020 ) >> 24;
-
+
apic_write(0x310 , (( apicid )<<24) );
apic_write(0x300 , 0x08000 | 0x04000 | 0x00500 );
-
+
apic_wait_icr_idle();
-
+
apic_write(0x310 , (( apicid )<<24) );
apic_write(0x300 , 0x08000 | 0x00500 );
-
+
apic_wait_icr_idle();
-
+
for(;;) {
hlt();
}
@@ -2761,7 +2761,7 @@ static void pc87360_enable_serial(void)
}
static void main(void)
{
-
+
static const struct mem_controller cpu[] = {
{
.node_id = 0,
@@ -2797,9 +2797,9 @@ static void main(void)
setup_coherent_ht_domain();
enumerate_ht_chain(0);
distinguish_cpu_resets(0);
-
+
enable_smbus();
memreset_setup();
sdram_initialize(sizeof(cpu)/sizeof(cpu[0]), cpu);
-
+
}
diff --git a/util/romcc/tests/simple_test.c b/util/romcc/tests/simple_test.c
index 4065c51a2f..9791d9e352 100644
--- a/util/romcc/tests/simple_test.c
+++ b/util/romcc/tests/simple_test.c
@@ -78,7 +78,7 @@ void uart_wait_to_tx_byte(void)
void uart_wait_until_sent(void)
{
- while(!(inb(CONFIG_TTYS0_BASE + UART_LSR) & 0x40))
+ while(!(inb(CONFIG_TTYS0_BASE + UART_LSR) & 0x40))
;
}
@@ -170,7 +170,7 @@ static void and(void)
i = 1;
j = 2;
k = i && j;
-
+
}
static void and_test(void)
{
@@ -236,9 +236,9 @@ static void fun(void)
static void func(void)
{
int bar, baz;
- int i;
-
- baz = add(1, 2);
+ int i;
+
+ baz = add(1, 2);
baz = add(1, 2);
bar = 1;
baz = 2;
diff --git a/util/romcc/tests/simple_test1.c b/util/romcc/tests/simple_test1.c
index 4065c51a2f..9791d9e352 100644
--- a/util/romcc/tests/simple_test1.c
+++ b/util/romcc/tests/simple_test1.c
@@ -78,7 +78,7 @@ void uart_wait_to_tx_byte(void)
void uart_wait_until_sent(void)
{
- while(!(inb(CONFIG_TTYS0_BASE + UART_LSR) & 0x40))
+ while(!(inb(CONFIG_TTYS0_BASE + UART_LSR) & 0x40))
;
}
@@ -170,7 +170,7 @@ static void and(void)
i = 1;
j = 2;
k = i && j;
-
+
}
static void and_test(void)
{
@@ -236,9 +236,9 @@ static void fun(void)
static void func(void)
{
int bar, baz;
- int i;
-
- baz = add(1, 2);
+ int i;
+
+ baz = add(1, 2);
baz = add(1, 2);
bar = 1;
baz = 2;
diff --git a/util/romcc/tests/simple_test10.c b/util/romcc/tests/simple_test10.c
index 3e7f510d67..af9bf076a1 100644
--- a/util/romcc/tests/simple_test10.c
+++ b/util/romcc/tests/simple_test10.c
@@ -11,7 +11,7 @@ static void spd_set_drb(void)
*/
unsigned end_of_memory;
unsigned char device;
-
+
end_of_memory = 0; /* in multiples of 8MiB */
device = SMBUS_MEM_DEVICE_START;
while (device <= SMBUS_MEM_DEVICE_END) {
diff --git a/util/romcc/tests/simple_test19.c b/util/romcc/tests/simple_test19.c
index 0bdcf422ef..cb1f4940d7 100644
--- a/util/romcc/tests/simple_test19.c
+++ b/util/romcc/tests/simple_test19.c
@@ -1,4 +1,4 @@
-static void hlt(void)
+static void hlt(void)
{
__builtin_hlt();
}
diff --git a/util/romcc/tests/simple_test2.c b/util/romcc/tests/simple_test2.c
index aef936a8ff..b576d3064d 100644
--- a/util/romcc/tests/simple_test2.c
+++ b/util/romcc/tests/simple_test2.c
@@ -18,7 +18,7 @@ static void spd_set_drb(void)
*/
unsigned end_of_memory;
unsigned device;
-
+
end_of_memory = 0; /* in multiples of 8MiB */
device = SMBUS_MEM_DEVICE_START;
while (device <= SMBUS_MEM_DEVICE_END) {
diff --git a/util/romcc/tests/simple_test20.c b/util/romcc/tests/simple_test20.c
index 1998853af1..f32aeac8af 100644
--- a/util/romcc/tests/simple_test20.c
+++ b/util/romcc/tests/simple_test20.c
@@ -86,7 +86,7 @@ void uart_wait_to_tx_byte(void)
void uart_wait_until_sent(void)
{
- while(!(inb(CONFIG_TTYS0_BASE + UART_LSR) & 0x40))
+ while(!(inb(CONFIG_TTYS0_BASE + UART_LSR) & 0x40))
;
}
diff --git a/util/romcc/tests/simple_test22.c b/util/romcc/tests/simple_test22.c
index 81d2ed008d..a67f5fd36c 100644
--- a/util/romcc/tests/simple_test22.c
+++ b/util/romcc/tests/simple_test22.c
@@ -34,7 +34,7 @@ static struct syscall_result syscall1(unsigned long nr, unsigned long arg1)
: "=a" (res)
: "a" (nr), "b" (arg1));
return syscall_return(res);
-
+
}
static struct syscall_result syscall2(unsigned long nr, unsigned long arg1, unsigned long arg2)
@@ -45,7 +45,7 @@ static struct syscall_result syscall2(unsigned long nr, unsigned long arg1, unsi
: "=a" (res)
: "a" (nr), "b" (arg1), "c" (arg2));
return syscall_return(res);
-
+
}
@@ -58,7 +58,7 @@ static struct syscall_result syscall3(unsigned long nr, unsigned long arg1, unsi
: "=a" (res)
: "a" (nr), "b" (arg1), "c" (arg2), "d" (arg3));
return syscall_return(res);
-
+
}
static struct syscall_result syscall4(unsigned long nr, unsigned long arg1, unsigned long arg2,
@@ -70,7 +70,7 @@ static struct syscall_result syscall4(unsigned long nr, unsigned long arg1, unsi
: "=a" (res)
: "a" (nr), "b" (arg1), "c" (arg2), "d" (arg3), "S" (arg4));
return syscall_return(res);
-
+
}
static struct syscall_result syscall5(unsigned long nr, unsigned long arg1, unsigned long arg2,
@@ -80,10 +80,10 @@ static struct syscall_result syscall5(unsigned long nr, unsigned long arg1, unsi
asm volatile(
"int $0x80"
: "=a" (res)
- : "a" (nr), "b" (arg1), "c" (arg2), "d" (arg3),
+ : "a" (nr), "b" (arg1), "c" (arg2), "d" (arg3),
"S" (arg4), "D" (arg5));
return syscall_return(res);
-
+
}
#define NR_exit 1
diff --git a/util/romcc/tests/simple_test27.c b/util/romcc/tests/simple_test27.c
index f278f62e8a..ac52368061 100644
--- a/util/romcc/tests/simple_test27.c
+++ b/util/romcc/tests/simple_test27.c
@@ -66,7 +66,7 @@ void uart_wait_to_tx_byte(void)
void uart_wait_until_sent(void)
{
- while(!(inb(CONFIG_TTYS0_BASE + UART_LSR) & 0x40))
+ while(!(inb(CONFIG_TTYS0_BASE + UART_LSR) & 0x40))
;
}
@@ -96,7 +96,7 @@ void uart_init(void)
void __console_tx_char(unsigned char byte)
{
uart_tx_byte(byte);
-
+
}
void __console_tx_string(char *str)
diff --git a/util/romcc/tests/simple_test3.c b/util/romcc/tests/simple_test3.c
index 008d0ab528..864760c418 100644
--- a/util/romcc/tests/simple_test3.c
+++ b/util/romcc/tests/simple_test3.c
@@ -7,7 +7,7 @@ static void spd_set_drb(void)
*/
unsigned end_of_memory;
unsigned device;
-
+
end_of_memory = 0; /* in multiples of 8MiB */
device = 0x50;
while (device <= 0x53) {
@@ -23,7 +23,7 @@ static void spd_set_drb(void)
/* Make it mulitples of 8MB */
side1_bits -= 25;
}
-
+
/* Compute the end address for the DRB register */
/* Only process dimms < 2GB (2^8 * 8MB) */
if (1) {
diff --git a/util/romcc/tests/simple_test30.c b/util/romcc/tests/simple_test30.c
index 6582a91c1a..ede20917d9 100644
--- a/util/romcc/tests/simple_test30.c
+++ b/util/romcc/tests/simple_test30.c
@@ -34,7 +34,7 @@ static struct syscall_result syscall1(unsigned long nr, unsigned long arg1)
: "=a" (res)
: "a" (nr), "b" (arg1));
return syscall_return(res);
-
+
}
static struct syscall_result syscall2(unsigned long nr, unsigned long arg1, unsigned long arg2)
@@ -45,7 +45,7 @@ static struct syscall_result syscall2(unsigned long nr, unsigned long arg1, unsi
: "=a" (res)
: "a" (nr), "b" (arg1), "c" (arg2));
return syscall_return(res);
-
+
}
@@ -58,7 +58,7 @@ static struct syscall_result syscall3(unsigned long nr, unsigned long arg1, unsi
: "=a" (res)
: "a" (nr), "b" (arg1), "c" (arg2), "d" (arg3));
return syscall_return(res);
-
+
}
static struct syscall_result syscall4(unsigned long nr, unsigned long arg1, unsigned long arg2,
@@ -70,7 +70,7 @@ static struct syscall_result syscall4(unsigned long nr, unsigned long arg1, unsi
: "=a" (res)
: "a" (nr), "b" (arg1), "c" (arg2), "d" (arg3), "S" (arg4));
return syscall_return(res);
-
+
}
static struct syscall_result syscall5(unsigned long nr, unsigned long arg1, unsigned long arg2,
@@ -80,10 +80,10 @@ static struct syscall_result syscall5(unsigned long nr, unsigned long arg1, unsi
asm volatile(
"int $0x80"
: "=a" (res)
- : "a" (nr), "b" (arg1), "c" (arg2), "d" (arg3),
+ : "a" (nr), "b" (arg1), "c" (arg2), "d" (arg3),
"S" (arg4), "D" (arg5));
return syscall_return(res);
-
+
}
#define NR_exit 1
@@ -301,37 +301,37 @@ static void _exit(int status)
static const char *addr_of_char(unsigned char ch)
{
static const char byte[] = {
- 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
+ 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
- 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,
+ 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,
0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f,
- 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27,
+ 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27,
0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f,
- 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37,
+ 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37,
0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f,
- 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47,
+ 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47,
0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f,
- 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57,
+ 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57,
0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f,
- 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67,
+ 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67,
0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f,
- 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77,
+ 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77,
0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f,
- 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87,
+ 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87,
0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f,
- 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97,
+ 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97,
0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f,
- 0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7,
+ 0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7,
0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf,
- 0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7,
+ 0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7,
0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf,
- 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7,
+ 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7,
0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf,
- 0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7,
+ 0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7,
0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf,
- 0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7,
+ 0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7,
0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef,
- 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7,
+ 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7,
0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff,
};
return byte + ch;
@@ -484,14 +484,14 @@ static void setup_coherent_ht_domain(void)
(((FN) & 0x07) << 8) | \
((WHERE) & 0xFF))
- /* Routing Table Node i
- * F0:0x40 i = 0,
+ /* Routing Table Node i
+ * F0:0x40 i = 0,
* F0:0x44 i = 1,
- * F0:0x48 i = 2,
+ * F0:0x48 i = 2,
* F0:0x4c i = 3,
- * F0:0x50 i = 4,
+ * F0:0x50 i = 4,
* F0:0x54 i = 5,
- * F0:0x58 i = 6,
+ * F0:0x58 i = 6,
* F0:0x5c i = 7
* [ 0: 3] Request Route
* [0] Route to this node
@@ -518,7 +518,7 @@ static void setup_coherent_ht_domain(void)
PCI_ADDR(0, 0x18, 0, 0x58), 0xfff0f0f0, 0x00010101,
PCI_ADDR(0, 0x18, 0, 0x5c), 0xfff0f0f0, 0x00010101,
- /* Hypetransport Transaction Control Register
+ /* Hypetransport Transaction Control Register
* F0:0x68
* [ 0: 0] Disable read byte probe
* 0 = Probes issues
@@ -560,7 +560,7 @@ static void setup_coherent_ht_domain(void)
* [12:12] Change ISOC to Ordered
* 0 = Bit 1 of coherent HT RdSz/WrSz command used for iosynchronous prioritization
* 1 = Bit 1 of coherent HT RdSz/WrSz command used for ordering.
- * [14:13] Buffer Release Priority select
+ * [14:13] Buffer Release Priority select
* 00 = 64
* 01 = 16
* 10 = 8
@@ -667,7 +667,7 @@ static void setup_coherent_ht_domain(void)
* [13:13] HT Stop Tristate Enable
* 0 = Driven during an LDTSTOP_L
* 1 = Tristated during and LDTSTOP_L
- * [14:14] Extended CTL Time
+ * [14:14] Extended CTL Time
* 0 = CTL is asserted for 16 bit times during link initialization
* 1 = CTL is asserted for 50us during link initialization
* [18:16] Max Link Width In (Read-Only?)
@@ -933,7 +933,7 @@ static void setup_coherent_ht_domain(void)
* 1 = base/limit registers i are read-only
* [ 7: 4] Reserved
* [31: 8] Memory-Mapped I/O Base Address i (39-16)
- * This field defines the upper address bits of a 40bit address
+ * This field defines the upper address bits of a 40bit address
* that defines the start of memory-mapped I/O region i
*/
PCI_ADDR(0, 0x18, 1, 0x80), 0x000000f0, 0x00e00003,
@@ -994,7 +994,7 @@ static void setup_coherent_ht_domain(void)
* [ 3: 2] Reserved
* [ 4: 4] VGA Enable
* 0 = VGA matches Disabled
- * 1 = matches all address < 64K and where A[9:0] is in the
+ * 1 = matches all address < 64K and where A[9:0] is in the
* range 3B0-3BB or 3C0-3DF independen of the base & limit registers
* [ 5: 5] ISA Enable
* 0 = ISA matches Disabled
@@ -1002,7 +1002,7 @@ static void setup_coherent_ht_domain(void)
* from matching agains this base/limit pair
* [11: 6] Reserved
* [24:12] PCI I/O Base i
- * This field defines the start of PCI I/O region n
+ * This field defines the start of PCI I/O region n
* [31:25] Reserved
*/
PCI_ADDR(0, 0x18, 1, 0xC0), 0xFE000FCC, 0x0000d003,
diff --git a/util/romcc/tests/simple_test32.c b/util/romcc/tests/simple_test32.c
index bd6947a2ba..28dbb8972e 100644
--- a/util/romcc/tests/simple_test32.c
+++ b/util/romcc/tests/simple_test32.c
@@ -3,7 +3,7 @@ void main(void)
unsigned long addr, start, stop;
start = 0x00100000;
stop = 0x00180000;
-
+
for(addr = start; addr < stop ;) {
unsigned char ch;
@@ -12,7 +12,7 @@ void main(void)
while(__builtin_inb(0x3f))
;
__builtin_outb(ch, 0x3f8);
-
+
while(__builtin_inb(0x3f))
;
}
diff --git a/util/romcc/tests/simple_test36.c b/util/romcc/tests/simple_test36.c
index 9044bda7b9..53aaf91aed 100644
--- a/util/romcc/tests/simple_test36.c
+++ b/util/romcc/tests/simple_test36.c
@@ -34,7 +34,7 @@ static void order_dimms(void)
__builtin_outl(0xc260, 0xCF8);
__builtin_outl(csmask, 0xCFC);
}
-
+
tom &= ~0xff000000;
__builtin_outl(tom, 0x1234);
diff --git a/util/romcc/tests/simple_test37.c b/util/romcc/tests/simple_test37.c
index 85c622b17d..d6ddc2ec98 100644
--- a/util/romcc/tests/simple_test37.c
+++ b/util/romcc/tests/simple_test37.c
@@ -4,7 +4,7 @@ static void main(void)
csbase = 0x40;
csmask = 0xfe00;
-
+
__builtin_outl(csbase, 0x40);
__builtin_outl(csmask, 0x60);
}
diff --git a/util/romcc/tests/simple_test38.c b/util/romcc/tests/simple_test38.c
index db001a26a8..9239664fdf 100644
--- a/util/romcc/tests/simple_test38.c
+++ b/util/romcc/tests/simple_test38.c
@@ -34,7 +34,7 @@ static struct syscall_result syscall1(unsigned long nr, unsigned long arg1)
: "=a" (res)
: "a" (nr), "b" (arg1));
return syscall_return(res);
-
+
}
static struct syscall_result syscall2(unsigned long nr, unsigned long arg1, unsigned long arg2)
@@ -45,7 +45,7 @@ static struct syscall_result syscall2(unsigned long nr, unsigned long arg1, unsi
: "=a" (res)
: "a" (nr), "b" (arg1), "c" (arg2));
return syscall_return(res);
-
+
}
@@ -58,7 +58,7 @@ static struct syscall_result syscall3(unsigned long nr, unsigned long arg1, unsi
: "=a" (res)
: "a" (nr), "b" (arg1), "c" (arg2), "d" (arg3));
return syscall_return(res);
-
+
}
static struct syscall_result syscall4(unsigned long nr, unsigned long arg1, unsigned long arg2,
@@ -70,7 +70,7 @@ static struct syscall_result syscall4(unsigned long nr, unsigned long arg1, unsi
: "=a" (res)
: "a" (nr), "b" (arg1), "c" (arg2), "d" (arg3), "S" (arg4));
return syscall_return(res);
-
+
}
static struct syscall_result syscall5(unsigned long nr, unsigned long arg1, unsigned long arg2,
@@ -80,10 +80,10 @@ static struct syscall_result syscall5(unsigned long nr, unsigned long arg1, unsi
asm volatile(
"int $0x80"
: "=a" (res)
- : "a" (nr), "b" (arg1), "c" (arg2), "d" (arg3),
+ : "a" (nr), "b" (arg1), "c" (arg2), "d" (arg3),
"S" (arg4), "D" (arg5));
return syscall_return(res);
-
+
}
#define NR_exit 1
@@ -301,37 +301,37 @@ static void _exit(int status)
static const char *addr_of_char(unsigned char ch)
{
static const char byte[] = {
- 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
+ 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
- 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,
+ 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,
0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f,
- 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27,
+ 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27,
0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f,
- 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37,
+ 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37,
0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f,
- 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47,
+ 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47,
0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f,
- 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57,
+ 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57,
0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f,
- 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67,
+ 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67,
0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f,
- 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77,
+ 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77,
0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f,
- 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87,
+ 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87,
0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f,
- 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97,
+ 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97,
0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f,
- 0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7,
+ 0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7,
0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf,
- 0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7,
+ 0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7,
0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf,
- 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7,
+ 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7,
0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf,
- 0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7,
+ 0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7,
0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf,
- 0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7,
+ 0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7,
0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef,
- 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7,
+ 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7,
0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff,
};
return byte + ch;
@@ -401,15 +401,15 @@ static void goto_test(void)
{
int i;
print_debug("goto_test\n");
-
+
i = 0;
goto bottom;
{
top:
- print_debug("i = ");
- print_debug_hex8(i);
+ print_debug("i = ");
+ print_debug_hex8(i);
print_debug("\n");
-
+
i = i + 1;
}
bottom:
diff --git a/util/romcc/tests/simple_test39.c b/util/romcc/tests/simple_test39.c
index a7b999bf7b..1c67cab590 100644
--- a/util/romcc/tests/simple_test39.c
+++ b/util/romcc/tests/simple_test39.c
@@ -34,7 +34,7 @@ static struct syscall_result syscall1(unsigned long nr, unsigned long arg1)
: "=a" (res)
: "a" (nr), "b" (arg1));
return syscall_return(res);
-
+
}
static struct syscall_result syscall2(unsigned long nr, unsigned long arg1, unsigned long arg2)
@@ -45,7 +45,7 @@ static struct syscall_result syscall2(unsigned long nr, unsigned long arg1, unsi
: "=a" (res)
: "a" (nr), "b" (arg1), "c" (arg2));
return syscall_return(res);
-
+
}
@@ -58,7 +58,7 @@ static struct syscall_result syscall3(unsigned long nr, unsigned long arg1, unsi
: "=a" (res)
: "a" (nr), "b" (arg1), "c" (arg2), "d" (arg3));
return syscall_return(res);
-
+
}
static struct syscall_result syscall4(unsigned long nr, unsigned long arg1, unsigned long arg2,
@@ -70,7 +70,7 @@ static struct syscall_result syscall4(unsigned long nr, unsigned long arg1, unsi
: "=a" (res)
: "a" (nr), "b" (arg1), "c" (arg2), "d" (arg3), "S" (arg4));
return syscall_return(res);
-
+
}
static struct syscall_result syscall5(unsigned long nr, unsigned long arg1, unsigned long arg2,
@@ -80,10 +80,10 @@ static struct syscall_result syscall5(unsigned long nr, unsigned long arg1, unsi
asm volatile(
"int $0x80"
: "=a" (res)
- : "a" (nr), "b" (arg1), "c" (arg2), "d" (arg3),
+ : "a" (nr), "b" (arg1), "c" (arg2), "d" (arg3),
"S" (arg4), "D" (arg5));
return syscall_return(res);
-
+
}
#define NR_exit 1
@@ -301,37 +301,37 @@ static void _exit(int status)
static const char *addr_of_char(unsigned char ch)
{
static const char byte[] = {
- 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
+ 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
- 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,
+ 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,
0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f,
- 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27,
+ 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27,
0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f,
- 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37,
+ 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37,
0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f,
- 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47,
+ 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47,
0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f,
- 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57,
+ 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57,
0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f,
- 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67,
+ 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67,
0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f,
- 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77,
+ 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77,
0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f,
- 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87,
+ 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87,
0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f,
- 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97,
+ 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97,
0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f,
- 0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7,
+ 0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7,
0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf,
- 0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7,
+ 0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7,
0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf,
- 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7,
+ 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7,
0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf,
- 0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7,
+ 0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7,
0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf,
- 0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7,
+ 0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7,
0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef,
- 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7,
+ 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7,
0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff,
};
return byte + ch;
@@ -401,15 +401,15 @@ static void goto_test(void)
{
int i;
print_debug("goto_test\n");
-
+
i = 0;
goto bottom;
{
top:
- print_debug("i = ");
- print_debug_hex8(i);
+ print_debug("i = ");
+ print_debug_hex8(i);
print_debug("\n");
-
+
i = i + 1;
}
bottom:
@@ -424,7 +424,7 @@ struct socket_desc {
short across;
};
-static void main(void)
+static void main(void)
{
static const struct socket_desc cpu_socketsA[] = {
{ .up = 2, .down = -1, .across = 1 }, /* Node 0 */
diff --git a/util/romcc/tests/simple_test4.c b/util/romcc/tests/simple_test4.c
index 4f72dcad67..2ac6a4d5f4 100644
--- a/util/romcc/tests/simple_test4.c
+++ b/util/romcc/tests/simple_test4.c
@@ -86,7 +86,7 @@ static void pcibios_write_config_dword(
int log2(int value)
{
/* __builtin_bsr is a exactly equivalent to the x86 machine
- * instruction with the exception that it returns -1
+ * instruction with the exception that it returns -1
* when the value presented to it is zero.
* Otherwise __builtin_bsr returns the zero based index of
* the highest bit set.
@@ -149,7 +149,7 @@ void uart_wait_to_tx_byte(void)
void uart_wait_until_sent(void)
{
- while(!(inb(CONFIG_TTYS0_BASE + UART_LSR) & 0x40))
+ while(!(inb(CONFIG_TTYS0_BASE + UART_LSR) & 0x40))
;
}
@@ -274,7 +274,7 @@ void print_spew(char *str) { __console_tx_string(str); }
#define PM_BUS 0
#define PM_DEVFN (PIIX4_DEVFN+3)
-#if HAVE_CONSTANT_PROPOGATION
+#if HAVE_CONSTANT_PROPOGATION
#define SMBUS_IO_BASE 0x1000
#define SMBHSTSTAT 0
#define SMBHSTCTL 2
@@ -428,7 +428,7 @@ static void spd_set_drb(void)
unsigned end_of_memory;
unsigned char device;
unsigned char drb_reg;
-
+
end_of_memory = 0; /* in multiples of 8MiB */
device = SMBUS_MEM_DEVICE_START;
#if !CALCULATE_DRB_REG
@@ -464,13 +464,13 @@ static void spd_set_drb(void)
#else
side1_bits += log2((((byte2 << 8) | byte));
#endif
-
+
/* now I have the ram size in bits as a power of two (less 1) */
/* Make it mulitples of 8MB */
side1_bits -= 25;
/* side two */
-
+
/* number of physical banks */
byte = smbus_read_byte(device, 5);
if (byte > 1) {
@@ -487,7 +487,7 @@ static void spd_set_drb(void)
#if CALCULATE_DRB_REG
drb_reg = ((device - SMBUS_MEM_DEVICE_START) << 1) + 0x60;
#endif
-
+
#if HAVE_STRING_SUPPORT
print_debug("end_of_memory: "); print_debug_hex32(end_of_memory); print_debug("\n");
#endif
diff --git a/util/romcc/tests/simple_test43.c b/util/romcc/tests/simple_test43.c
index 4fb2735d83..464f26f918 100644
--- a/util/romcc/tests/simple_test43.c
+++ b/util/romcc/tests/simple_test43.c
@@ -24,13 +24,13 @@ static void spd_set_memclk(void)
if (!loops) {
goto end;
}
-
+
loops = 1000000;
while(--loops)
;
- end:
+ end:
;
-
+
}
loops = 1000000;
while(--loops)
diff --git a/util/romcc/tests/simple_test45.c b/util/romcc/tests/simple_test45.c
index beb041708c..5e8d742fa8 100644
--- a/util/romcc/tests/simple_test45.c
+++ b/util/romcc/tests/simple_test45.c
@@ -10,8 +10,8 @@ static void spd_set_memclk(void)
device = 0x50;
new_cycle_time = 0xa0;
new_latency = 5;
-
-
+
+
latency = 0;
for(index = 0; index < 3; index++, latency++) {
unsigned long loops;
@@ -23,10 +23,10 @@ static void spd_set_memclk(void)
if (!loops) {
continue;
}
-
+
__builtin_outb(device, 0xe4);
__builtin_outb(index, 0xe8);
-
+
loops = 1000000;
while(--loops)
;
diff --git a/util/romcc/tests/simple_test46.c b/util/romcc/tests/simple_test46.c
index bd84246b02..0b831254a1 100644
--- a/util/romcc/tests/simple_test46.c
+++ b/util/romcc/tests/simple_test46.c
@@ -22,16 +22,16 @@ static void spd_set_memclk(void)
if (loops < 0) {
continue;
}
-
+
__builtin_outb(device, 0x10e4);
__builtin_outb(address, 0x10e8);
-
+
loops = 1000000;
if ((loops?0:-1) < 0) {
continue;
}
}
-
+
if (new_cycle_time > min_cycle_time) {
min_cycle_time = new_cycle_time;
}
diff --git a/util/romcc/tests/simple_test47.c b/util/romcc/tests/simple_test47.c
index 28d72eaa9a..d1c54aeced 100644
--- a/util/romcc/tests/simple_test47.c
+++ b/util/romcc/tests/simple_test47.c
@@ -16,18 +16,18 @@ static void spd_set_memclk(void)
for(index = 0; index < 3; index++, latency++) {
unsigned long loops;
unsigned address = index;
-
+
loops = 1000000;
do {
} while(--loops);
if (loops) {
continue;
}
-
+
__builtin_outb(device, 0x10e4);
-
+
__builtin_outb(address & 0xFF, 0x10e8);
-
+
loops = 1000000;
while(--loops)
;
diff --git a/util/romcc/tests/simple_test48.c b/util/romcc/tests/simple_test48.c
index 779ecfdc96..cf9ee8ab0f 100644
--- a/util/romcc/tests/simple_test48.c
+++ b/util/romcc/tests/simple_test48.c
@@ -9,5 +9,5 @@ static void main(void)
__builtin_outb(j, 0xef90);
next:
__builtin_outb(i, 0x5678);
-
+
}
diff --git a/util/romcc/tests/simple_test49.c b/util/romcc/tests/simple_test49.c
index a5a12c1cd8..b18b4cb4b9 100644
--- a/util/romcc/tests/simple_test49.c
+++ b/util/romcc/tests/simple_test49.c
@@ -11,5 +11,5 @@ static void main(void)
}
}
__builtin_outb(i, 0x5678);
-
+
}
diff --git a/util/romcc/tests/simple_test5.c b/util/romcc/tests/simple_test5.c
index efc1e9489a..725d7453df 100644
--- a/util/romcc/tests/simple_test5.c
+++ b/util/romcc/tests/simple_test5.c
@@ -85,7 +85,7 @@ static void pcibios_write_config_dword(
int log2(int value)
{
/* __builtin_bsr is a exactly equivalent to the x86 machine
- * instruction with the exception that it returns -1
+ * instruction with the exception that it returns -1
* when the value presented to it is zero.
* Otherwise __builtin_bsr returns the zero based index of
* the highest bit set.
@@ -102,7 +102,7 @@ int log2(int value)
#define PM_BUS 0
#define PM_DEVFN (PIIX4_DEVFN+3)
-#if HAVE_CONSTANT_PROPOGATION
+#if HAVE_CONSTANT_PROPOGATION
#define SMBUS_IO_BASE 0x1000
#define SMBHSTSTAT 0
#define SMBHSTCTL 2
@@ -290,7 +290,7 @@ static void spd_enable_refresh(void)
}
byte &= 0x7f;
/* Default refresh rate be conservative */
- refresh_rate = 5;
+ refresh_rate = 5;
/* see if the ram refresh is a supported one */
if (byte < 6) {
#if HAVE_STATIC_ARRAY_SUPPORT
diff --git a/util/romcc/tests/simple_test50.c b/util/romcc/tests/simple_test50.c
index 51c7c505c9..f8d29b716f 100644
--- a/util/romcc/tests/simple_test50.c
+++ b/util/romcc/tests/simple_test50.c
@@ -3,17 +3,17 @@ typedef __builtin_ldiv_t ldiv_t;
typedef __builtin_udiv_t udiv_t;
typedef __builtin_uldiv_t uldiv_t;
-static div_t div(int numer, int denom)
-{
- return __builtin_div(numer, denom);
+static div_t div(int numer, int denom)
+{
+ return __builtin_div(numer, denom);
}
-static ldiv_t ldiv(long numer, long denom)
-{
- return __builtin_ldiv(numer, denom);
+static ldiv_t ldiv(long numer, long denom)
+{
+ return __builtin_ldiv(numer, denom);
}
static udiv_t udiv(unsigned numer, unsigned denom)
-{
- return __builtin_udiv(numer, denom);
+{
+ return __builtin_udiv(numer, denom);
}
static uldiv_t uldiv(unsigned long numer, unsigned long denom)
{
diff --git a/util/romcc/tests/simple_test54.c b/util/romcc/tests/simple_test54.c
index ec3208f4aa..37dce795c5 100644
--- a/util/romcc/tests/simple_test54.c
+++ b/util/romcc/tests/simple_test54.c
@@ -34,7 +34,7 @@ static struct syscall_result syscall1(unsigned long nr, unsigned long arg1)
: "=a" (res)
: "a" (nr), "b" (arg1));
return syscall_return(res);
-
+
}
static struct syscall_result syscall2(unsigned long nr, unsigned long arg1, unsigned long arg2)
@@ -45,7 +45,7 @@ static struct syscall_result syscall2(unsigned long nr, unsigned long arg1, unsi
: "=a" (res)
: "a" (nr), "b" (arg1), "c" (arg2));
return syscall_return(res);
-
+
}
@@ -58,7 +58,7 @@ static struct syscall_result syscall3(unsigned long nr, unsigned long arg1, unsi
: "=a" (res)
: "a" (nr), "b" (arg1), "c" (arg2), "d" (arg3));
return syscall_return(res);
-
+
}
static struct syscall_result syscall4(unsigned long nr, unsigned long arg1, unsigned long arg2,
@@ -70,7 +70,7 @@ static struct syscall_result syscall4(unsigned long nr, unsigned long arg1, unsi
: "=a" (res)
: "a" (nr), "b" (arg1), "c" (arg2), "d" (arg3), "S" (arg4));
return syscall_return(res);
-
+
}
static struct syscall_result syscall5(unsigned long nr, unsigned long arg1, unsigned long arg2,
@@ -80,10 +80,10 @@ static struct syscall_result syscall5(unsigned long nr, unsigned long arg1, unsi
asm volatile(
"int $0x80"
: "=a" (res)
- : "a" (nr), "b" (arg1), "c" (arg2), "d" (arg3),
+ : "a" (nr), "b" (arg1), "c" (arg2), "d" (arg3),
"S" (arg4), "D" (arg5));
return syscall_return(res);
-
+
}
#define NR_exit 1
@@ -301,37 +301,37 @@ static void _exit(int status)
static const char *addr_of_char(unsigned char ch)
{
static const char byte[] = {
- 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
+ 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
- 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,
+ 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,
0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f,
- 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27,
+ 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27,
0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f,
- 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37,
+ 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37,
0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f,
- 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47,
+ 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47,
0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f,
- 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57,
+ 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57,
0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f,
- 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67,
+ 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67,
0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f,
- 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77,
+ 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77,
0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f,
- 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87,
+ 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87,
0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f,
- 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97,
+ 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97,
0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f,
- 0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7,
+ 0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7,
0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf,
- 0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7,
+ 0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7,
0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf,
- 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7,
+ 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7,
0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf,
- 0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7,
+ 0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7,
0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf,
- 0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7,
+ 0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7,
0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef,
- 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7,
+ 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7,
0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff,
};
return byte + ch;
@@ -407,7 +407,7 @@ static void print_debug(const char *str) { console_tx_string(str); }
int log2(int value)
{
/* __builtin_bsr is a exactly equivalent to the x86 machine
- * instruction with the exception that it returns -1
+ * instruction with the exception that it returns -1
* when the value presented to it is zero.
* Otherwise __builtin_bsr returns the zero based index of
* the highest bit set.
@@ -503,8 +503,8 @@ static unsigned spd_to_dimm(unsigned device)
static void disable_dimm(unsigned index)
{
- print_debug("disabling dimm");
- print_debug_hex8(index);
+ print_debug("disabling dimm");
+ print_debug_hex8(index);
print_debug("\r\n");
#if 0
pci_write_config32(PCI_DEV(0, 0x18, 2), DRAM_CSBASE + (((index << 1)+0)<<2), 0);
@@ -587,8 +587,8 @@ static const struct mem_param *spd_set_memclk(void)
min_latency = 2;
#if 1
- print_debug("min_cycle_time: ");
- print_debug_hex8(min_cycle_time);
+ print_debug("min_cycle_time: ");
+ print_debug_hex8(min_cycle_time);
print_debug(" min_latency: ");
print_debug_hex8(min_latency);
print_debug("\r\n");
@@ -648,8 +648,8 @@ static const struct mem_param *spd_set_memclk(void)
#if 1
print_debug("device: ");
print_debug_hex8(device);
- print_debug(" new_cycle_time: ");
- print_debug_hex8(new_cycle_time);
+ print_debug(" new_cycle_time: ");
+ print_debug_hex8(new_cycle_time);
print_debug(" new_latency: ");
print_debug_hex8(new_latency);
print_debug("\r\n");
@@ -661,8 +661,8 @@ static const struct mem_param *spd_set_memclk(void)
#if 1
print_debug("device: ");
print_debug_hex8(device);
- print_debug(" new_cycle_time: ");
- print_debug_hex8(new_cycle_time);
+ print_debug(" new_cycle_time: ");
+ print_debug_hex8(new_cycle_time);
print_debug(" new_latency: ");
print_debug_hex8(new_latency);
print_debug("\r\n");
@@ -682,8 +682,8 @@ static const struct mem_param *spd_set_memclk(void)
#if 1
print_debug("device: ");
print_debug_hex8(device);
- print_debug(" min_cycle_time: ");
- print_debug_hex8(min_cycle_time);
+ print_debug(" min_cycle_time: ");
+ print_debug_hex8(min_cycle_time);
print_debug(" min_latency: ");
print_debug_hex8(min_latency);
print_debug("\r\n");
@@ -721,11 +721,11 @@ static const struct mem_param *spd_set_memclk(void)
if ((latency != min_latency) || (index >= 3)) {
goto dimm_err;
}
-
+
/* Read the min_cycle_time for this latency */
value = smbus_read_byte(device, latency_indicies[index]);
-
- /* All is good if the selected clock speed
+
+ /* All is good if the selected clock speed
* is what I need or slower.
*/
if (value <= min_cycle_time) {
@@ -736,8 +736,8 @@ static const struct mem_param *spd_set_memclk(void)
disable_dimm(spd_to_dimm(device));
}
#if 1
- print_debug("min_cycle_time: ");
- print_debug_hex8(min_cycle_time);
+ print_debug("min_cycle_time: ");
+ print_debug_hex8(min_cycle_time);
print_debug(" min_latency: ");
print_debug_hex8(min_latency);
print_debug("\r\n");
@@ -759,7 +759,7 @@ static const struct mem_param *spd_set_memclk(void)
value |= latencies[min_latency - 2];
pci_write_config32(PCI_DEV(0, 0x18, 2), DRAM_CONFIG_LOW, value);
#endif
-
+
return param;
}
diff --git a/util/romcc/tests/simple_test56.c b/util/romcc/tests/simple_test56.c
index 831ee9a4ca..570b4eeec3 100644
--- a/util/romcc/tests/simple_test56.c
+++ b/util/romcc/tests/simple_test56.c
@@ -31,7 +31,7 @@ static void spd_enable_refresh(void)
}
byte &= 0x7f;
/* Default refresh rate be conservative */
- refresh_rate = 5;
+ refresh_rate = 5;
/* see if the ram refresh is a supported one */
if (byte < 6) {
refresh_rate = refresh_rates[byte];
diff --git a/util/romcc/tests/simple_test59.c b/util/romcc/tests/simple_test59.c
index 4b0ee36133..a54c0435d3 100644
--- a/util/romcc/tests/simple_test59.c
+++ b/util/romcc/tests/simple_test59.c
@@ -34,7 +34,7 @@ static struct syscall_result syscall1(unsigned long nr, unsigned long arg1)
: "=a" (res)
: "a" (nr), "b" (arg1));
return syscall_return(res);
-
+
}
static struct syscall_result syscall2(unsigned long nr, unsigned long arg1, unsigned long arg2)
@@ -45,7 +45,7 @@ static struct syscall_result syscall2(unsigned long nr, unsigned long arg1, unsi
: "=a" (res)
: "a" (nr), "b" (arg1), "c" (arg2));
return syscall_return(res);
-
+
}
@@ -58,7 +58,7 @@ static struct syscall_result syscall3(unsigned long nr, unsigned long arg1, unsi
: "=a" (res)
: "a" (nr), "b" (arg1), "c" (arg2), "d" (arg3));
return syscall_return(res);
-
+
}
static struct syscall_result syscall4(unsigned long nr, unsigned long arg1, unsigned long arg2,
@@ -70,7 +70,7 @@ static struct syscall_result syscall4(unsigned long nr, unsigned long arg1, unsi
: "=a" (res)
: "a" (nr), "b" (arg1), "c" (arg2), "d" (arg3), "S" (arg4));
return syscall_return(res);
-
+
}
static struct syscall_result syscall5(unsigned long nr, unsigned long arg1, unsigned long arg2,
@@ -80,10 +80,10 @@ static struct syscall_result syscall5(unsigned long nr, unsigned long arg1, unsi
asm volatile(
"int $0x80"
: "=a" (res)
- : "a" (nr), "b" (arg1), "c" (arg2), "d" (arg3),
+ : "a" (nr), "b" (arg1), "c" (arg2), "d" (arg3),
"S" (arg4), "D" (arg5));
return syscall_return(res);
-
+
}
#define NR_exit 1
@@ -301,37 +301,37 @@ static void _exit(int status)
static const char *addr_of_char(unsigned char ch)
{
static const char byte[] = {
- 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
+ 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
- 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,
+ 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,
0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f,
- 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27,
+ 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27,
0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f,
- 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37,
+ 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37,
0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f,
- 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47,
+ 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47,
0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f,
- 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57,
+ 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57,
0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f,
- 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67,
+ 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67,
0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f,
- 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77,
+ 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77,
0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f,
- 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87,
+ 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87,
0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f,
- 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97,
+ 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97,
0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f,
- 0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7,
+ 0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7,
0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf,
- 0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7,
+ 0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7,
0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf,
- 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7,
+ 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7,
0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf,
- 0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7,
+ 0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7,
0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf,
- 0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7,
+ 0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7,
0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef,
- 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7,
+ 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7,
0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff,
};
return byte + ch;
diff --git a/util/romcc/tests/simple_test6.c b/util/romcc/tests/simple_test6.c
index aba7f1f549..147614e84b 100644
--- a/util/romcc/tests/simple_test6.c
+++ b/util/romcc/tests/simple_test6.c
@@ -81,7 +81,7 @@ static void pcibios_write_config_dword(
int log2(int value)
{
/* __builtin_bsr is a exactly equivalent to the x86 machine
- * instruction with the exception that it returns -1
+ * instruction with the exception that it returns -1
* when the value presented to it is zero.
* Otherwise __builtin_bsr returns the zero based index of
* the highest bit set.
@@ -98,7 +98,7 @@ int log2(int value)
#define PM_BUS 0
#define PM_DEVFN (PIIX4_DEVFN+3)
-#if HAVE_CONSTANT_PROPOGATION
+#if HAVE_CONSTANT_PROPOGATION
#define SMBUS_IO_BASE 0x1000
#define SMBHSTSTAT 0
#define SMBHSTCTL 2
diff --git a/util/romcc/tests/simple_test61.c b/util/romcc/tests/simple_test61.c
index 583a9db36b..2b235ccd5e 100644
--- a/util/romcc/tests/simple_test61.c
+++ b/util/romcc/tests/simple_test61.c
@@ -16,7 +16,7 @@ static void spd_set_nbxcfg(void)
/* set the device I'm talking too */
__builtin_outb(device, 0x1004);
-
+
/* poll for transaction completion */
byte = __builtin_inb(0x10);
while(byte == 0) {
diff --git a/util/romcc/tests/simple_test65.c b/util/romcc/tests/simple_test65.c
index 642882c2a2..9921e2e9cc 100644
--- a/util/romcc/tests/simple_test65.c
+++ b/util/romcc/tests/simple_test65.c
@@ -6,5 +6,5 @@ static void main(void)
{
enum tag foo;
foo = Y;
-
+
}
diff --git a/util/romcc/tests/simple_test66.c b/util/romcc/tests/simple_test66.c
index 5857855700..afc0255345 100644
--- a/util/romcc/tests/simple_test66.c
+++ b/util/romcc/tests/simple_test66.c
@@ -1,8 +1,8 @@
typedef unsigned char uint8_t;
static unsigned int generate_row(uint8_t row, uint8_t maxnodes)
{
-
- unsigned int ret=0x00010101;
+
+ unsigned int ret=0x00010101;
static const unsigned int rows_2p[2][2] = {
{ 0x00050101, 0x00010404 },
{ 0x00010404, 0x00050101 }
diff --git a/util/romcc/tests/simple_test67.c b/util/romcc/tests/simple_test67.c
index 3bfdc5a072..70d7170292 100644
--- a/util/romcc/tests/simple_test67.c
+++ b/util/romcc/tests/simple_test67.c
@@ -11,7 +11,7 @@ static void main(void)
if (!(dcl & (1 << 8))) {
if (dimms == 4) {
async_lat = 9;
- }
+ }
else {
async_lat = 8;
}
diff --git a/util/romcc/tests/simple_test7.c b/util/romcc/tests/simple_test7.c
index 571f2cdb71..a2065463a3 100644
--- a/util/romcc/tests/simple_test7.c
+++ b/util/romcc/tests/simple_test7.c
@@ -1,4 +1,4 @@
-void main(void)
+void main(void)
{
int i;
i = 0;
@@ -8,5 +8,5 @@ void main(void)
j = i++;
__builtin_outb(j, 0xdc);
} while(i <= 9);
-
+
}
diff --git a/util/romcc/tests/simple_test72.c b/util/romcc/tests/simple_test72.c
index 2011fea7fa..10f6ee9f4d 100644
--- a/util/romcc/tests/simple_test72.c
+++ b/util/romcc/tests/simple_test72.c
@@ -1,37 +1,37 @@
static const char *addr_of_char(unsigned char ch)
{
static const char byte[] = {
- 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
+ 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
- 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,
+ 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,
0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f,
- 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27,
+ 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27,
0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f,
- 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37,
+ 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37,
0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f,
- 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47,
+ 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47,
0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f,
- 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57,
+ 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57,
0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f,
- 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67,
+ 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67,
0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f,
- 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77,
+ 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77,
0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f,
- 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87,
+ 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87,
0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f,
- 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97,
+ 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97,
0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f,
- 0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7,
+ 0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7,
0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf,
- 0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7,
+ 0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7,
0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf,
- 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7,
+ 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7,
0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf,
- 0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7,
+ 0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7,
0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf,
- 0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7,
+ 0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7,
0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef,
- 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7,
+ 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7,
0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff,
};
return byte + ch;
@@ -45,7 +45,7 @@ static void print_debug_char(int c)
:
: "a" (4), "b" (1), "c" (addr_of_char(c)), "d" (1)
);
-
+
}
static void print_debug_nibble(unsigned nibble)
{
@@ -122,7 +122,7 @@ static void spd_set_memclk(void)
int index;
int latencies;
int latency;
-
+
/* First find the supported CAS latencies
* Byte 18 for DDR SDRAM is interpreted:
* bit 0 == CAS Latency = 1.0
@@ -138,12 +138,12 @@ static void spd_set_memclk(void)
new_latency = 5;
latencies = smbus_read_byte(device, 18);
-
+
/* Compute the lowest cas latency supported */
latency = __builtin_bsr(latencies) -2;
/* Loop through and find a fast clock with a low latency */
- for(index = 0; index < 1; index++, latency++)
+ for(index = 0; index < 1; index++, latency++)
{
int value;
@@ -152,7 +152,7 @@ static void spd_set_memclk(void)
continue;
}
value = smbus_read_byte(device, index);
-
+
/* Only increase the latency if we decreas the clock */
if ((value >= min_cycle_time) && (value < new_cycle_time)) {
new_cycle_time = value;
diff --git a/util/romcc/tests/simple_test73.c b/util/romcc/tests/simple_test73.c
index f9e00cd4f8..da69cf5e7d 100644
--- a/util/romcc/tests/simple_test73.c
+++ b/util/romcc/tests/simple_test73.c
@@ -1,37 +1,37 @@
static const char *addr_of_char(unsigned char ch)
{
static const char byte[] = {
- 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
+ 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
- 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,
+ 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,
0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f,
- 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27,
+ 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27,
0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f,
- 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37,
+ 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37,
0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f,
- 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47,
+ 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47,
0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f,
- 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57,
+ 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57,
0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f,
- 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67,
+ 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67,
0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f,
- 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77,
+ 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77,
0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f,
- 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87,
+ 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87,
0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f,
- 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97,
+ 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97,
0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f,
- 0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7,
+ 0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7,
0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf,
- 0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7,
+ 0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7,
0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf,
- 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7,
+ 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7,
0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf,
- 0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7,
+ 0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7,
0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf,
- 0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7,
+ 0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7,
0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef,
- 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7,
+ 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7,
0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff,
};
return byte + ch;
diff --git a/util/romcc/tests/simple_test74.c b/util/romcc/tests/simple_test74.c
index 177e00f29e..fff1a16e3f 100644
--- a/util/romcc/tests/simple_test74.c
+++ b/util/romcc/tests/simple_test74.c
@@ -24,7 +24,7 @@ static struct syscall_result syscall1(unsigned long nr, unsigned long arg1)
: "=a" (res)
: "a" (nr), "b" (arg1));
return syscall_return(res);
-
+
}
@@ -37,7 +37,7 @@ static struct syscall_result syscall3(unsigned long nr, unsigned long arg1, unsi
: "=a" (res)
: "a" (nr), "b" (arg1), "c" (arg2), "d" (arg3));
return syscall_return(res);
-
+
}
#define NR_exit 1
diff --git a/util/romcc/tests/simple_test75.c b/util/romcc/tests/simple_test75.c
index 1ad87bd2a0..ae28a3ce1a 100644
--- a/util/romcc/tests/simple_test75.c
+++ b/util/romcc/tests/simple_test75.c
@@ -1,7 +1,7 @@
static void goto_test(void)
{
int i;
-
+
i = 0;
goto bottom;
{
diff --git a/util/romcc/tests/simple_test76.c b/util/romcc/tests/simple_test76.c
index 4f682d37d4..74b1cf1657 100644
--- a/util/romcc/tests/simple_test76.c
+++ b/util/romcc/tests/simple_test76.c
@@ -23,7 +23,7 @@ static struct syscall_result syscall1(unsigned long nr, unsigned long arg1)
: "=a" (res)
: "a" (nr), "b" (arg1));
return syscall_return(res);
-
+
}
static struct syscall_result syscall3(unsigned long nr, unsigned long arg1, unsigned long arg2,
@@ -35,7 +35,7 @@ static struct syscall_result syscall3(unsigned long nr, unsigned long arg1, unsi
: "=a" (res)
: "a" (nr), "b" (arg1), "c" (arg2), "d" (arg3));
return syscall_return(res);
-
+
}
#define NR_exit 1
diff --git a/util/romcc/tests/simple_test81.c b/util/romcc/tests/simple_test81.c
index e942679d67..1f647aae8d 100644
--- a/util/romcc/tests/simple_test81.c
+++ b/util/romcc/tests/simple_test81.c
@@ -4,5 +4,5 @@ static void main(void)
i = __builtin_inb(0x1234);
int j;
j = __builtin_inb(0xabcd);
-
+
}
diff --git a/util/sconfig/lex.yy.c_shipped b/util/sconfig/lex.yy.c_shipped
index 7239b25df4..c43d5bb3bd 100644
--- a/util/sconfig/lex.yy.c_shipped
+++ b/util/sconfig/lex.yy.c_shipped
@@ -33,7 +33,7 @@
#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
- * if you want the limit (max/min) macros for int types.
+ * if you want the limit (max/min) macros for int types.
*/
#ifndef __STDC_LIMIT_MACROS
#define __STDC_LIMIT_MACROS 1
@@ -50,7 +50,7 @@ typedef uint32_t flex_uint32_t;
typedef signed char flex_int8_t;
typedef short int flex_int16_t;
typedef int flex_int32_t;
-typedef unsigned char flex_uint8_t;
+typedef unsigned char flex_uint8_t;
typedef unsigned short int flex_uint16_t;
typedef unsigned int flex_uint32_t;
#endif /* ! C99 */
@@ -161,7 +161,7 @@ extern FILE *yyin, *yyout;
#define EOB_ACT_LAST_MATCH 2
#define YY_LESS_LINENO(n)
-
+
/* Return all but the first "n" matched characters back to the input stream. */
#define yyless(n) \
do \
@@ -223,7 +223,7 @@ struct yy_buffer_state
int yy_bs_lineno; /**< The line count. */
int yy_bs_column; /**< The column count. */
-
+
/* Whether to try to fill the input buffer when we reach the
* end of it.
*/
@@ -589,7 +589,7 @@ extern int yywrap (void );
#endif
static void yyunput (int c,char *buf_ptr );
-
+
#ifndef yytext_ptr
static void yy_flex_strncpy (char *,yyconst char *,int );
#endif
@@ -710,7 +710,7 @@ YY_DECL
register yy_state_type yy_current_state;
register char *yy_cp, *yy_bp;
register int yy_act;
-
+
if ( !(yy_init) )
{
(yy_init) = 1;
@@ -1172,7 +1172,7 @@ static int yy_get_next_buffer (void)
{
register yy_state_type yy_current_state;
register char *yy_cp;
-
+
yy_current_state = (yy_start);
for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
@@ -1226,7 +1226,7 @@ static int yy_get_next_buffer (void)
static void yyunput (int c, register char * yy_bp )
{
register char *yy_cp;
-
+
yy_cp = (yy_c_buf_p);
/* undo effects of setting up yytext */
@@ -1269,7 +1269,7 @@ static int yy_get_next_buffer (void)
{
int c;
-
+
*(yy_c_buf_p) = (yy_hold_char);
if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR )
@@ -1336,12 +1336,12 @@ static int yy_get_next_buffer (void)
/** Immediately switch to a different input stream.
* @param input_file A readable stream.
- *
+ *
* @note This function does not reset the start condition to @c INITIAL .
*/
void yyrestart (FILE * input_file )
{
-
+
if ( ! YY_CURRENT_BUFFER ){
yyensure_buffer_stack ();
YY_CURRENT_BUFFER_LVALUE =
@@ -1354,11 +1354,11 @@ static int yy_get_next_buffer (void)
/** Switch to a different input buffer.
* @param new_buffer The new input buffer.
- *
+ *
*/
void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer )
{
-
+
/* TODO. We should be able to replace this entire function body
* with
* yypop_buffer_state();
@@ -1398,13 +1398,13 @@ static void yy_load_buffer_state (void)
/** Allocate and initialize an input buffer state.
* @param file A readable stream.
* @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
- *
+ *
* @return the allocated buffer state.
*/
YY_BUFFER_STATE yy_create_buffer (FILE * file, int size )
{
YY_BUFFER_STATE b;
-
+
b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) );
if ( ! b )
YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
@@ -1427,11 +1427,11 @@ static void yy_load_buffer_state (void)
/** Destroy the buffer.
* @param b a buffer created with yy_create_buffer()
- *
+ *
*/
void yy_delete_buffer (YY_BUFFER_STATE b )
{
-
+
if ( ! b )
return;
@@ -1447,7 +1447,7 @@ static void yy_load_buffer_state (void)
#ifndef __cplusplus
extern int isatty (int );
#endif /* __cplusplus */
-
+
/* Initializes or reinitializes a buffer.
* This function is sometimes called more than once on the same buffer,
* such as during a yyrestart() or at EOF.
@@ -1456,7 +1456,7 @@ extern int isatty (int );
{
int oerrno = errno;
-
+
yy_flush_buffer(b );
b->yy_input_file = file;
@@ -1472,13 +1472,13 @@ extern int isatty (int );
}
b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
-
+
errno = oerrno;
}
/** Discard all buffered characters. On the next scan, YY_INPUT will be called.
* @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
- *
+ *
*/
void yy_flush_buffer (YY_BUFFER_STATE b )
{
@@ -1507,7 +1507,7 @@ extern int isatty (int );
* the current state. This function will allocate the stack
* if necessary.
* @param new_buffer The new state.
- *
+ *
*/
void yypush_buffer_state (YY_BUFFER_STATE new_buffer )
{
@@ -1537,7 +1537,7 @@ void yypush_buffer_state (YY_BUFFER_STATE new_buffer )
/** Removes and deletes the top of the stack, if present.
* The next element becomes the new top.
- *
+ *
*/
void yypop_buffer_state (void)
{
@@ -1561,7 +1561,7 @@ void yypop_buffer_state (void)
static void yyensure_buffer_stack (void)
{
int num_to_alloc;
-
+
if (!(yy_buffer_stack)) {
/* First allocation is just for 2 elements, since we don't know if this
@@ -1574,9 +1574,9 @@ static void yyensure_buffer_stack (void)
);
if ( ! (yy_buffer_stack) )
YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
-
+
memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));
-
+
(yy_buffer_stack_max) = num_to_alloc;
(yy_buffer_stack_top) = 0;
return;
@@ -1604,13 +1604,13 @@ static void yyensure_buffer_stack (void)
/** Setup the input buffer state to scan directly from a user-specified character buffer.
* @param base the character buffer
* @param size the size in bytes of the character buffer
- *
- * @return the newly allocated buffer state object.
+ *
+ * @return the newly allocated buffer state object.
*/
YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size )
{
YY_BUFFER_STATE b;
-
+
if ( size < 2 ||
base[size-2] != YY_END_OF_BUFFER_CHAR ||
base[size-1] != YY_END_OF_BUFFER_CHAR )
@@ -1639,14 +1639,14 @@ YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size )
/** Setup the input buffer state to scan a string. The next call to yylex() will
* scan from a @e copy of @a str.
* @param yystr a NUL-terminated string to scan
- *
+ *
* @return the newly allocated buffer state object.
* @note If you want to scan bytes that may contain NUL values, then use
* yy_scan_bytes() instead.
*/
YY_BUFFER_STATE yy_scan_string (yyconst char * yystr )
{
-
+
return yy_scan_bytes(yystr,strlen(yystr) );
}
@@ -1654,7 +1654,7 @@ YY_BUFFER_STATE yy_scan_string (yyconst char * yystr )
* scan from a @e copy of @a bytes.
* @param bytes the byte buffer to scan
* @param len the number of bytes in the buffer pointed to by @a bytes.
- *
+ *
* @return the newly allocated buffer state object.
*/
YY_BUFFER_STATE yy_scan_bytes (yyconst char * yybytes, int _yybytes_len )
@@ -1663,7 +1663,7 @@ YY_BUFFER_STATE yy_scan_bytes (yyconst char * yybytes, int _yybytes_len )
char *buf;
yy_size_t n;
int i;
-
+
/* Get memory for full buffer, including space for trailing EOB's. */
n = _yybytes_len + 2;
buf = (char *) yyalloc(n );
@@ -1717,16 +1717,16 @@ static void yy_fatal_error (yyconst char* msg )
/* Accessor methods (get/set functions) to struct members. */
/** Get the current line number.
- *
+ *
*/
int yyget_lineno (void)
{
-
+
return yylineno;
}
/** Get the input stream.
- *
+ *
*/
FILE *yyget_in (void)
{
@@ -1734,7 +1734,7 @@ FILE *yyget_in (void)
}
/** Get the output stream.
- *
+ *
*/
FILE *yyget_out (void)
{
@@ -1742,7 +1742,7 @@ FILE *yyget_out (void)
}
/** Get the length of the current token.
- *
+ *
*/
int yyget_leng (void)
{
@@ -1750,7 +1750,7 @@ int yyget_leng (void)
}
/** Get the current token.
- *
+ *
*/
char *yyget_text (void)
@@ -1760,18 +1760,18 @@ char *yyget_text (void)
/** Set the current line number.
* @param line_number
- *
+ *
*/
void yyset_lineno (int line_number )
{
-
+
yylineno = line_number;
}
/** Set the input stream. This does not discard the current
* input buffer.
* @param in_str A readable stream.
- *
+ *
* @see yy_switch_to_buffer
*/
void yyset_in (FILE * in_str )
@@ -1825,7 +1825,7 @@ static int yy_init_globals (void)
/* yylex_destroy is for both reentrant and non-reentrant scanners. */
int yylex_destroy (void)
{
-
+
/* Pop the buffer stack, destroying each element. */
while(YY_CURRENT_BUFFER){
yy_delete_buffer(YY_CURRENT_BUFFER );
diff --git a/util/sconfig/sconfig.tab.c_shipped b/util/sconfig/sconfig.tab.c_shipped
index ac41d262f2..27c570dd0f 100644
--- a/util/sconfig/sconfig.tab.c_shipped
+++ b/util/sconfig/sconfig.tab.c_shipped
@@ -2,20 +2,20 @@
/* A Bison parser, made by GNU Bison 2.4.1. */
/* Skeleton implementation for Bison's Yacc-like parsers in C
-
+
Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
Free Software Foundation, Inc.
-
+
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
-
+
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
-
+
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
@@ -28,7 +28,7 @@
special exception, which will cause the skeleton and the resulting
Bison output files to be licensed under the GNU General Public
License without this special exception.
-
+
This special exception was added by the Free Software Foundation in
version 2.2 of Bison. */
diff --git a/util/sconfig/sconfig.tab.h_shipped b/util/sconfig/sconfig.tab.h_shipped
index 8c6b5f6144..2c24fef256 100644
--- a/util/sconfig/sconfig.tab.h_shipped
+++ b/util/sconfig/sconfig.tab.h_shipped
@@ -2,20 +2,20 @@
/* A Bison parser, made by GNU Bison 2.4.1. */
/* Skeleton interface for Bison's Yacc-like parsers in C
-
+
Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
Free Software Foundation, Inc.
-
+
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
-
+
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
-
+
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
@@ -28,7 +28,7 @@
special exception, which will cause the skeleton and the resulting
Bison output files to be licensed under the GNU General Public
License without this special exception.
-
+
This special exception was added by the Free Software Foundation in
version 2.2 of Bison. */
diff --git a/util/superiotool/smsc.c b/util/superiotool/smsc.c
index 2e203ad5e3..e3125c15c3 100644
--- a/util/superiotool/smsc.c
+++ b/util/superiotool/smsc.c
@@ -68,7 +68,7 @@ static const struct superio_registers reg_table[] = {
{0x00,0x00,0x00,0x00,0x00,0x01,0x01,0x01,0x01,0x01,
0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x00,
0x00,0x00,0x00,MISC,EOT}},
- {EOT}}},
+ {EOT}}},
{0x03, "FDC37C93xFR", {
/* FIXME: There's another 0x03 but found on port 0x0d/0x0e! */
{EOT}}},
diff --git a/util/superiotool/superiotool.8 b/util/superiotool/superiotool.8
index 35046d1809..8bbcddfd93 100644
--- a/util/superiotool/superiotool.8
+++ b/util/superiotool/superiotool.8
@@ -2,7 +2,7 @@
.SH NAME
superiotool \- Super I/O detection tool
.SH SYNOPSIS
-.B superiotool \fR[\fB\-delVvh\fR]
+.B superiotool \fR[\fB\-delVvh\fR]
.SH DESCRIPTION
.B superiotool
is a GPL'd user-space utility which can
diff --git a/util/vgabios/Makefile b/util/vgabios/Makefile
index ffa30a9650..0a8dae6d59 100644
--- a/util/vgabios/Makefile
+++ b/util/vgabios/Makefile
@@ -9,7 +9,7 @@
CC = gcc
CFLAGS = -O2 -g -fomit-frame-pointer
CFLAGS += -Wall -Wundef -Wstrict-prototypes -Wmissing-prototypes
-CFLAGS += -Wwrite-strings -Wredundant-decls -Wno-trigraphs
+CFLAGS += -Wwrite-strings -Wredundant-decls -Wno-trigraphs
CFLAGS += -Wstrict-aliasing -Wshadow -Wextra
INCLUDES = -Iinclude -I../../src/devices/oprom/include/
@@ -27,7 +27,7 @@ all: testbios
testbios: $(OBJS)
$(CC) $(CFLAGS) -o $@ $^ $(LIBS)
-
+
helper_exec.o: helper_exec.c test.h
clean:
diff --git a/util/vgabios/testbios.c b/util/vgabios/testbios.c
index 2646a29ffd..c12e72187e 100644
--- a/util/vgabios/testbios.c
+++ b/util/vgabios/testbios.c
@@ -267,7 +267,7 @@ int main(int argc, char **argv)
}
}
}
-
+
if (absegname) {
abseg = mapitin(absegname, (off_t) 0xa0000, 0x20000);
if (!abseg)
@@ -302,7 +302,7 @@ int main(int argc, char **argv)
if (devfn) {
printf("Loading ax with BusDevFn = %x\n",devfn);
}
-
+
current->ax = devfn ? devfn : 0xff;
current->dx = 0x80;
// current->ip = 0;
@@ -359,7 +359,7 @@ unsigned short get_device(char *arg_val)
unsigned short devfn=0;
long bus=0,dev=0,fn=0,need_pack=0;
char *tok;
-
+
tok = strsep(&arg_val,":");
if (arg_val != NULL) {
bus = strtol(tok,0,16);
@@ -377,10 +377,10 @@ unsigned short get_device(char *arg_val)
}
else {
if (need_pack ==1 && (strlen(tok))) {
- dev = strtol(tok,0,16);
+ dev = strtol(tok,0,16);
}
}
-
+
if ( need_pack == 1) {
devfn = bus<<8 | (dev<<3) | fn;
}