summaryrefslogtreecommitdiff
path: root/util/romcc/romcc.c
AgeCommit message (Collapse)Author
2018-06-14src: Get rid of unneeded whitespaceElyes HAOUAS
Change-Id: I630d49ab504d9f6e052806b516a600fa41b9a8da Signed-off-by: Elyes HAOUAS <ehaouas@noos.fr> Reviewed-on: https://review.coreboot.org/26991 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2017-02-10util/romcc: Don't reference a variable after checking it for NULLPatrick Georgi
Change-Id: Ic8e850bdf75d38fc061fb3a8c55d38bcf09c305a Signed-off-by: Patrick Georgi <pgeorgi@chromium.org> Found-by: Coverity Scan #1129146 Reviewed-on: https://review.coreboot.org/17886 Tested-by: build bot (Jenkins) Reviewed-by: Nico Huber <nico.h@gmx.de>
2017-01-06util/romcc: avoid shifting more than the variable's widthPatrick Georgi
That's undefined behavior in C Change-Id: I671ed8abf02e57a7cc993d1a85354e905f51717d Signed-off-by: Patrick Georgi <pgeorgi@chromium.org> Found-by: Coverity Scan #1229557 Reviewed-on: https://review.coreboot.org/18014 Tested-by: build bot (Jenkins) Reviewed-by: Martin Roth <martinroth@google.com>
2017-01-03util/romcc: remove dead assignmentsPatrick Georgi
Change-Id: Iab6fe065faeacfca3b41eb5bae1075dcfb1a2b05 Signed-off-by: Patrick Georgi <pgeorgi@chromium.org> Found-by: scan-build (clang 3.8) Reviewed-on: https://review.coreboot.org/18021 Tested-by: build bot (Jenkins) Reviewed-by: Martin Roth <martinroth@google.com>
2017-01-03util/romcc: Ensure that bit shift is validPatrick Georgi
Change-Id: Idbe147c1217f793b0360a752383203c658b0bdce Signed-off-by: Patrick Georgi <pgeorgi@chromium.org> Found-by: Coverity Scan #1287090 Reviewed-on: https://review.coreboot.org/18020 Tested-by: build bot (Jenkins) Reviewed-by: Martin Roth <martinroth@google.com>
2017-01-03util/romcc: avoid leaking a typePatrick Georgi
Only allocate ptr_type when it's actually used. Change-Id: Iea5f93601a42f02a1866bdff099f63935fdd5b8d Signed-off-by: Patrick Georgi <pgeorgi@chromium.org> Found-by: Coverity Scan #1129117 Reviewed-on: https://review.coreboot.org/18017 Tested-by: build bot (Jenkins) Reviewed-by: Martin Roth <martinroth@google.com>
2017-01-03util/romcc: avoid dereferencing NULL pointerPatrick Georgi
argv is only filled for macro->argc > 0. Change-Id: I5ff21098384afc823efa14be3d5565507fb2b3b2 Signed-off-by: Patrick Georgi <pgeorgi@chromium.org> Found-by: Coverity Scan #1287089 Reviewed-on: https://review.coreboot.org/18016 Tested-by: build bot (Jenkins) Reviewed-by: Martin Roth <martinroth@google.com>
2017-01-03util/romcc: free variable after usePatrick Georgi
closure_type is copied then never used again. Close that leak. Change-Id: Idd4201f7fc6495fde5ad2e1feb7e499e38986e92 Signed-off-by: Patrick Georgi <pgeorgi@chromium.org> Found-by: Coverity Scan #1287073 Reviewed-on: https://review.coreboot.org/18015 Tested-by: build bot (Jenkins) Reviewed-by: Martin Roth <martinroth@google.com>
2016-12-16util/romcc: Don't read 'member' if it might be NULLPatrick Georgi
The earlier loop exits gracefully iff i == index. In other cases, member might be NULL, so check that the scan was successful before using its results. Change-Id: I818c233d797d82fa819243c4626dd9c4b7de3ac6 Signed-off-by: Patrick Georgi <pgeorgi@chromium.org> Found-by: Coverity Scan #1129147 Reviewed-on: https://review.coreboot.org/17887 Tested-by: build bot (Jenkins) Reviewed-by: Martin Roth <martinroth@google.com>
2016-12-16util/romcc: remove self-assignmentPatrick Georgi
Change-Id: I0f78b55b28011cdefc90665bca2a7ea17647e955 Signed-off-by: Patrick Georgi <pgeorgi@chromium.org> Found-by: Coverity Scan #1129127 Reviewed-on: https://review.coreboot.org/17885 Tested-by: build bot (Jenkins) Reviewed-by: Martin Roth <martinroth@google.com> Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
2016-12-16util/romcc: Move access after NULL-checkPatrick Georgi
Change-Id: I7f9c38fd6e75b32fe1ed8a60c7054f4dd1fcd5c0 Signed-off-by: Patrick Georgi <pgeorgi@chromium.org> Found-by: Coverity Scan #1129104 Reviewed-on: https://review.coreboot.org/17884 Tested-by: build bot (Jenkins) Reviewed-by: Martin Roth <martinroth@google.com>
2016-12-16util/romcc: Fix resource leakPatrick Georgi
Change-Id: I0d260254bab714ec939fc199b3a133b0fc05b10d Signed-off-by: Patrick Georgi <pgeorgi@chromium.org> Found-by: Coverity Scan #1129112 Reviewed-on: https://review.coreboot.org/17883 Tested-by: build bot (Jenkins) Reviewed-by: Martin Roth <martinroth@google.com>
2015-11-19romcc: Allow adding non-existent paths to include pathStefan Reinauer
This models gcc's (and other compilers') behavior to not bail out with an error when one of the include paths does not exist. Change-Id: Ic93a55cea6b32516fd76da9b49abe7b990829889 Signed-off-by: Stefan Reinauer <stefan.reinauer@coreboot.org> Reviewed-on: http://review.coreboot.org/12469 Tested-by: build bot (Jenkins) Reviewed-by: Martin Roth <martinroth@google.com> Reviewed-by: Patrick Georgi <pgeorgi@google.com> Reviewed-by: Marc Jones <marc@marcjonesconsulting.com>
2014-09-06romcc: avoid use-after-freePatrick Georgi
Windows bugchecks on this for a while, so we ifndef'd the free() call out. Now some Linuxes (depending on their glibc) also fail on it, so just remove the call altogether at the cost of some leaked memory (couple hundred kilobytes) because tracking down the precise fix is too hard. In case someone wants to fix it, valgrind sees the issues, so revert this change and work on romcc's memory management until valgrind is happy. To get a fix in, provide a good explanation why your change is actually the right way to fix it - for silencing valgrind, this change will do. Change-Id: Iae3f847e09a0d7bcb8bb4f50983a1b0727570b23 Signed-off-by: Patrick Georgi <patrick@georgi-clan.de> Reviewed-on: http://review.coreboot.org/6846 Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org> Tested-by: build bot (Jenkins)
2014-08-12util: replace fseek/ftell/rewind with fstatPatrick Georgi
It's a more direct approach to get the file size. Change-Id: If49df26bf4996bd556c675f3a673d0003b4adf89 Signed-off-by: Patrick Georgi <patrick@georgi-clan.de> Reviewed-on: http://review.coreboot.org/6594 Tested-by: build bot (Jenkins) Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
2014-08-10romcc: properly check out-of-range unsigned longsPatrick Georgi
Testing if an unsigned long is greater than ULONG_T_MAX isn't very useful. The second half of the test checked for too small values (ie. <= -ULONG_T_MAX). In both cases errno is set to ERANGE, so just check for that. Change-Id: I92bad9d1715673531bef5d5d5756feddeb7674b4 Found-by: Coverity Scan Signed-off-by: Patrick Georgi <patrick@georgi-clan.de> Reviewed-on: http://review.coreboot.org/6568 Tested-by: build bot (Jenkins) Reviewed-by: Edward O'Callaghan <eocallaghan@alterapraxis.com> Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2014-03-17romcc.c: Fixes warning about unused function from unused macros.Edward O'Callaghan
GCC suppresses warnings about unused static functions if they are inline, however Clang only does this for header files. None of these MASK_ declarations are used, so just remove them. Change-Id: Ia230beba3f6367237838d9b3d90536459e1d52cb Signed-off-by: Edward O'Callaghan <eocallaghan@alterapraxis.com> Reviewed-on: http://review.coreboot.org/5273 Tested-by: build bot (Jenkins) Reviewed-by: Kyösti Mälkki <kyosti.malkki@gmail.com> Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
2014-03-08utils/romcc.c: Fix spurious unsigned integer comparisons.Edward O'Callaghan
Clang warns about comparisons of unsigned integers with being below zero. Remove spurious logic checks that are always false. Change-Id: I70c4d5331df81e48bf7ef27ff98400c4218f7edc Signed-off-by: Edward O'Callaghan <eocallaghan@alterapraxis.com> Reviewed-on: http://review.coreboot.org/5275 Tested-by: build bot (Jenkins) Reviewed-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
2013-11-16romcc: Fix off-by-onePatrick Georgi
Arrays are indexed 0..(number_of_element-1). Change-Id: I2157e74340568636d588113d1d2d8cae50082da2 Found-by: Coverity Scan Signed-off-by: Patrick Georgi <patrick@georgi-clan.de> Reviewed-on: http://review.coreboot.org/4089 Reviewed-by: Ronald G. Minnich <rminnich@gmail.com> Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org> Tested-by: build bot (Jenkins)
2013-05-10romcc: support attribute((packed))Stefan Reinauer
right now this is just a fake option to get rid of ifdefs in coreboot's code. Change-Id: I59233f3c1d266b4e716a5921e9db298c7f96751d Signed-off-by: Stefan Reinauer <reinauer@google.com> Reviewed-on: http://review.coreboot.org/3225 Reviewed-by: Ronald G. Minnich <rminnich@gmail.com> Tested-by: build bot (Jenkins)
2013-02-19romcc: Don't fail on function prototypesPatrick Georgi
Instead, ignore them. One is as non-standard as the other and ignoring is more convenient since we don't need to guard prototypes with #ifndef __ROMCC_ all the time. Change-Id: I7be93a2ed0966ba1a86f0294132a204e6c8bf24f Signed-off-by: Patrick Georgi <patrick@georgi-clan.de> Reviewed-on: http://review.coreboot.org/2424 Tested-by: build bot (Jenkins) Reviewed-by: Martin Roth <martin.roth@se-eng.com> Reviewed-by: Marc Jones <marcj303@gmail.com>
2012-06-22ROMCC: fix unused attribute lookupSven Schnelle
commit 57cd1dd29679918afa650c2a7e82a474765f357d added this attribute, but with wrong length, so it actually never matched. Change-Id: Ibcc7816b5fa895faa66710cc29de38f129be6a2b Signed-off-by: Sven Schnelle <svens@stackframe.org> Reviewed-on: http://review.coreboot.org/1133 Reviewed-by: Patrick Georgi <patrick@georgi-clan.de> Tested-by: build bot (Jenkins) Reviewed-by: Mathias Krause <minipli@googlemail.com>
2012-06-22Teach romcc about attribute((unused))Stefan Reinauer
This makes it easier to use the same code on romcc and gcc. Specifying attribute((unused)) on romcc does nothing. Change-Id: If9a6900cad12900e499c4b8c91586511eb801987 Signed-off-by: Stefan Reinauer <reinauer@google.com> Reviewed-on: http://review.coreboot.org/1132 Reviewed-by: Ronald G. Minnich <rminnich@gmail.com> Tested-by: build bot (Jenkins) Reviewed-by: Peter Stuge <peter@stuge.se>
2012-03-31Enable -Werror for romccStefan Reinauer
... and remove some dead code. Change-Id: Id959bdf57af09db2a1f5742555c2dcabca38ac9a Signed-off-by: Stefan Reinauer <reinauer@google.com> Reviewed-on: http://review.coreboot.org/818 Tested-by: build bot (Jenkins) Reviewed-by: Patrick Georgi <patrick@georgi-clan.de>
2012-02-07romcc: kill gcc warnings and .gitignore generated filesBernhard Urban
don't remove calls to `flatten()' and `correct_coalesce_conflicts()', since they (probably) have side effects. Change-Id: I78fc4163b3f5f1f5f3c5153f9559c22e11e8344d Signed-off-by: Bernhard Urban <lewurm@gmail.com> Reviewed-on: http://review.coreboot.org/605 Tested-by: build bot (Jenkins) Reviewed-by: Marc Jones <marcj303@gmail.com> Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2010-04-27Since some people disapprove of white space cleanups mixed in regular commitsStefan Reinauer
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
2010-04-03Add noreturn attribute to die() in romcc.Stefan Reinauer
This makes life a lot easier for static analyzers such as scan-build. Signed-off-by: Stefan Reinauer <stepan@coresystems.de> Acked-by: Stefan Reinauer <stepan@coresystems.de> git-svn-id: svn://svn.coreboot.org/coreboot/trunk@5351 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
2010-03-25Add support to build with ccache in the build systemPatrick Georgi
Signed-off-by: Patrick Georgi <patrick.georgi@coresystems.de> Acked-by: Stefan Reinauer <stepan@coresystems.de> git-svn-id: svn://svn.coreboot.org/coreboot/trunk@5297 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
2010-03-25Copy argument of -include as it's modified later.Patrick Georgi
Signed-off-by: Patrick Georgi <patrick.georgi@coresystems.de> Acked-by: Stefan Reinauer <stepan@coresystems.de> git-svn-id: svn://svn.coreboot.org/coreboot/trunk@5290 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
2010-03-17Catch non-static arrays in romcc. Not allowed.Eric W. Biederman
Signed-off-by: Eric W. Biederman <ebiederm@xmission.com> Acked-by: Stefan Reinauer <stepan@coresystems.de> git-svn-id: svn://svn.coreboot.org/coreboot/trunk@5230 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
2010-03-16back out r5212 and r5210; Follow the thread of Stefan Reinauer
http://www.coreboot.org/pipermail/coreboot/2010-March/056501.html for the details. Signed-off-by: Stefan Reinauer <stepan@coresystems.de> Acked-by: Stefan Reinauer <stepan@coresystems.de> git-svn-id: svn://svn.coreboot.org/coreboot/trunk@5214 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
2010-03-15Use copy_triple only on non-flattened nodes.Patrick Georgi
Signed-off-by: Patrick Georgi <patrick.georgi@coresystems.de> Acked-by: Stefan Reinauer <stepan@coresystems.de> git-svn-id: svn://svn.coreboot.org/coreboot/trunk@5212 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
2010-03-14Fix segfault of romcc when complex assignment operatorsPatrick Georgi
were applied to non-trivial LHSs, eg. c[4] |= 1; Signed-off-by: Patrick Georgi <patrick.georgi@coresystems.de> Acked-by: Stefan Reinauer <stepan@coresystems.de> git-svn-id: svn://svn.coreboot.org/coreboot/trunk@5210 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
2010-02-28Add attribute((noreturn)) to romccStefan Reinauer
It doesn't do anything, but it allows the same code to be compiled with gcc and romcc. Signed-off-by: Stefan Reinauer <stepan@coresystems.de> Acked-by: Ronald G. Minnich <rminnich@gmail.com> git-svn-id: svn://svn.coreboot.org/coreboot/trunk@5172 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
2010-02-22This is a general cleanup patchStefan Reinauer
- drop include/part and move files to include/ - get rid lots of warnings - make resource allocator happy with w83627thg - trivial cbmem resume fix - fix payload and log level settings in abuild - fix kontron mptable for virtual wire mode - drop some dead includes and dead code. Signed-off-by: Stefan Reinauer <stepan@coresystems.de> Acked-by: Ronald G. Minnich <rminnich@gmail.com> git-svn-id: svn://svn.coreboot.org/coreboot/trunk@5136 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
2010-02-12romcc: Fix a few (harmless) warningsPeter Stuge
Signed-off-by: Peter Stuge <peter@stuge.se> Acked-by: Peter Stuge <peter@stuge.se> git-svn-id: svn://svn.coreboot.org/coreboot/trunk@5123 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
2010-02-11romcc: Ignore empty string tokens. So far, romcc emitted a single ↵Patrick Georgi
double-quote for them. Signed-off-by: Patrick Georgi <patrick.georgi@coresystems.de> Acked-by: Patrick Georgi <patrick.georgi@coresystems.de> git-svn-id: svn://svn.coreboot.org/coreboot/trunk@5116 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
2010-02-11separate build.h and config.h usage (now possible because newconfig is gone)Stefan Reinauer
Signed-off-by: Stefan Reinauer <stepan@coresystems.de> Acked-by: Patrick Georgi <patrick.georgi@coresystems.de> This patch is slightly reworked to include a necessary romcc change that allows more than one -include specified on the command line, and gets rid of the explicit build.h dependencies of all files. (The files do keep an explicit config.h dependency though) git-svn-id: svn://svn.coreboot.org/coreboot/trunk@5114 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
2010-01-05* Explicitly add __PRE_RAM__ where it should be added.Stefan Reinauer
* Don't implicitly add __PRE_RAM__ in romcc. Fixes intel/xe7501devkit Signed-off-by: Stefan Reinauer <stepan@coresystems.de> Acked-by: Ronald G. Minnich <rminnich@gmail.com> Acked-by: Patrick Georgi <patrick.georgi@coresystems.de> git-svn-id: svn://svn.coreboot.org/coreboot/trunk@4998 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
2009-12-31romcc:Patrick Georgi
- Set __PRE_RAM__ define per default - Properly handle ignored (#ifdef'd out) #include lines amd/serengeti_cheetah_fam10: - write ACPI files to $(obj) instead of the top dir (alias $(CURDIR)) tinybootblock: - provide a way to define code that should be added to the bootblock, to map the entire ROM for use by CBFS amd/model_fxx, amd/model_10xxx: - add CONFIG_SSE walkcbfs.S: - eliminate the use of two registers, to make space for romcc to wiggle amd/serengeti_cheetah_fam10: - use the enable_rom framework. not entirely functional yet Boot-tested on emulation/qemu-x86 Build-tested on amd/serengeti_cheetah_fam10 amd/serengeti_cheetah_fam10 fails in amdht/ somewhere, but builds Signed-off-by: Patrick Georgi <patrick.georgi@coresystems.de> Acked-by: Ronald G. Minnich <rminnich@gmail.com> git-svn-id: svn://svn.coreboot.org/coreboot/trunk@4994 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
2009-11-21Make the kconfig-style build work in mingw:Patrick Georgi
* use relative paths in ldscript.ld and crt0_includes.h * avoid use of dd(1) in xcompile * build libregex for kconfig, if necessary * work around missing utsname on win32 * unlink targets before rename on win32 * implement (crude) mkstemp for win32 * avoid open/read/close, use fopen/fread/fclose instead * don't free certain data structures in romcc on win32 to avoid crashes (likely use-after-free()) * handle "\CRLF" and win32 style absolute paths (X:/ or X:\) in romcc * make lzma (part of cbfstool) build on XP * implement ntohl/htonl on win32 * handle CRLF in awk script * set larger stack for romcc on win32 Signed-off-by: Patrick Georgi <patrick.georgi@coresystems.de> Acked-by: Peter Stuge <peter@stuge.se> git-svn-id: svn://svn.coreboot.org/coreboot/trunk@4952 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
2009-11-12Trivial debug print format string fix for romcc.Myles Watson
Signed-off-by: Myles Watson <mylesgw@gmail.com> Acked-by: Myles Watson <mylesgw@gmail.com> git-svn-id: svn://svn.coreboot.org/coreboot/trunk@4938 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
2009-10-27Improve coreboot build output and eliminate some warnings:Uwe Hermann
- Add static and const where possible. - Turn some #warning entries into TODO comments. - Add missing prototypes. - Remove unused variables. - Fix printf arguments or cast them as needed. - Make sconfig output look better. Drop useless "PARSED THE TREE" output. - Print "(this may take a while)" while building romcc. Add missing "\n". Signed-off-by: Uwe Hermann <uwe@hermann-uwe.de> Acked-by: Myles Watosn <mylesgw@gmail.com> git-svn-id: svn://svn.coreboot.org/coreboot/trunk@4874 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
2009-08-2020090819-2-trim-down-cbfs:Patrick Georgi
CBFS uses sprintf, which requires vtxprintf, which requires (in the current design) a nested function. That works on x86, but on PPC this requires a trampoline. In the ROM stage, this is not available, so remove the single use of sprintf and replace it with a direct string handler - it's only used to fill in fixed-length hex values. 20090819-3-more-noreturns-in-romcc: Mark two more functions in romcc as noreturn. Helps clang's scan-build a bit 20090819-4-cbfsify-ppc: Make PPC use CBFS. Support big endian ELF in cbfs-mkstage. Untested and not complete yet. 20090819-5-fix-ppc-build: The CBFS build system requires ROM_IMAGE_SIZE to have a somewhat plausible value. With fixes to tohex* functions as discussed on the list, and correct function names. Signed-off-by: Patrick Georgi <patrick.georgi@coresystems.de> Acked-by: Myles Watson <mylesgw@gmail.com> Acked-by: Stefan Reinauer <stepan@coresystems.de> git-svn-id: svn://svn.coreboot.org/coreboot/trunk@4558 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
2009-05-26Various fixes to the tree to get coreboot-v2 to build on SolarisPatrick Georgi
- Replace $(PWD) with $(CURDIR) in Makefiles. I don't know why the Solaris version behaves differently, but CURDIR is a safe choice on gnu make (and we require gnu make already) - Use tail -1 instead of tail -n1 in a file that already relies on tail -1 support in another place - Use tail -1 as alternative to tail -n1 in another place - Use #define for ulong_t in romcc, as that name is used on Solaris - Avoid fprinting a null pointer. The standard doesn't mandate that this is a special case, and Solaris doesn't implement it that way. Signed-off-by: Patrick Georgi <patrick.georgi@coresystems.de> Acked-by: Ronald G. Minnich <rminnich@gmail.com> git-svn-id: svn://svn.coreboot.org/coreboot/trunk@4305 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
2009-04-21scan-build prefers -include over --includes=, gcc knows both.Patrick Georgi
With this change, romcc knows -include and the build system uses it. Also use a full path to settings.h because scan-build has trouble finding it otherwise. Signed-off-by: Patrick Georgi <patrick.georgi@coresystems.de> Acked-by: Joseph Smith <joe@settoplinux.org> git-svn-id: svn://svn.coreboot.org/coreboot/trunk@4151 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
2009-04-04fix some warnings by casting safely. (trivial)Stefan Reinauer
Signed-off-by: Stefan Reinauer <stepan@coresystems.de> Acked-by: Stefan Reinauer <stepan@coresystems.de> git-svn-id: svn://svn.coreboot.org/coreboot/trunk@4064 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
2009-04-03This patch implements --include=file.h for romcc.Stefan Reinauer
The compile_file calls seem to be in the wrong order, but romcc actually requires it that (probably some stack-like file processing) Signed-off-by: Stefan Reinauer <stepan@coresystems.de> Acked-by: Patrick Georgi <patrick.georgi@coresystems.de> git-svn-id: svn://svn.coreboot.org/coreboot/trunk@4051 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
2007-10-24This change removes all warnings from romcc in my build environment,Stefan Reinauer
making the output of "make -s" finally usable.. (still trivial, doesn't change any logic or remove any code) Signed-off-by: Stefan Reinauer <stepan@coresystems.de> Acked-by: Stefan Reinauer <stepan@coresystems.de> git-svn-id: svn://svn.coreboot.org/coreboot/trunk@2894 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
2006-12-02fix romcc preprocessor bugEric Biederman
Signed-off-by: Eric Biederman <ebiederman@lnxi.com> Acked-by: Stefan Reinauer <stepan@coresystems.de> git-svn-id: svn://svn.coreboot.org/coreboot/trunk@2515 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
2006-02-19gcc 4.1 fixes.Stefan Reinauer
git-svn-id: svn://svn.coreboot.org/coreboot/trunk@2177 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
2005-08-10- reverting back to original romcc.c before hdama checkin broke allJason Schildt
other builds. git-svn-id: svn://svn.coreboot.org/coreboot/trunk@2005 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
2005-08-09- Merge from linuxbios-lnxi (Linux Networx repository) up to public tree.Jason Schildt
- Special version for HDAMA rev G with 33Mhz test and reboot out. - Support for CPU rev E, dual core, memory hoisting, - corrected an SST flashing problem. Kernel bug work around (NUMA) - added a Kernel bug work around for assigning CPU's to memory. r2@gog: svnadmin | 2005-08-03 08:47:54 -0600 Create local LNXI branch r1110@gog: jschildt | 2005-08-09 10:35:51 -0600 - Merge from Tom Zimmerman's additions to the hdama code for dual core and 33Mhz fix. r1111@gog: jschildt | 2005-08-09 11:07:11 -0600 Stable Release tag for HDAMA-1.1.8.10 and HDAMA-1.1.8.10LANL r1112@gog: jschildt | 2005-08-09 15:09:32 -0600 - temporarily removing hdama tag to update to public repository. Will reset tag after update. git-svn-id: svn://svn.coreboot.org/coreboot/trunk@2004 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
2005-08-04GCC4 fixLi-Ta Lo
git-svn-id: svn://svn.coreboot.org/coreboot/trunk@1989 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
2004-11-15- Don't force spew level debug messages on the kherpiEric Biederman
- optimize_link_read_pointers compiles now on the solo so don't disable it. - Start sorting out the confusion between and object and an initobject on the ppc ports - Major bugfix release of romcc to support to remove preprocessor deficiencies. The line and column numbers are computed are now correct. But watch out the error messages sometimes report the location of the next token so things are still a little skewed. git-svn-id: svn://svn.coreboot.org/coreboot/trunk@1784 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
2004-11-09- Clean up the CPP output a little bitEric Biederman
git-svn-id: svn://svn.coreboot.org/coreboot/trunk@1771 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
2004-11-09- Fix silly thinkos in that caused parsing problems in romcc.Eric Biederman
git-svn-id: svn://svn.coreboot.org/coreboot/trunk@1770 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
2004-11-09- Fix minor glitch in romcc where it would not return from a header fileEric Biederman
if it had a preprocessor directive on the last line. git-svn-id: svn://svn.coreboot.org/coreboot/trunk@1769 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
2004-11-08- Romcc preprocessor bug fixes, (The code size went down about 350 lines.. :)Eric Biederman
- Preprocessor constant expression evaluation is no long a special case so unsigned long values can not be used. - Undefined macros are not converted to 0. But a big warning is printed. - Garbage at the of an #include directive is now done in tokens instead of in characters. This allows comments after an #include directive. - Repaired a previously unnoticed regression in constant expression evaluation. Logical expressions can now be evaluated again. git-svn-id: svn://svn.coreboot.org/coreboot/trunk@1767 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
2004-10-30- To reduce confuse rename the parts of linuxbios bios that run fromEric Biederman
ram linuxbios_ram instead of linuxbios_c and linuxbios_payload... - Reordered the linker sections so the LinuxBIOS fallback image can take more the 64KiB on x86 - ROM_IMAGE_SIZE now will work when it is specified as larger than 64KiB. - Tweaked the reset16.inc and reset16.lds to move the sanity check to see if everything will work. - Start using romcc's built in preprocessor (This will simplify header compiler checks) - Add helper functions for examining all of the resources - Remove debug strings from chip.h - Add llshell to src/arch/i386/llshell (Sometime later I can try it...) - Add the ability to catch exceptions on x86 - Add gdb_stub support to x86 - Removed old cpu options - Added an option so we can detect movnti support - Remove some duplicate definitions from pci_ids.h - Remove the 64bit resource code in amdk8/northbridge.c in preparation for making it generic - Minor romcc bug fixes git-svn-id: svn://svn.coreboot.org/coreboot/trunk@1727 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
2004-06-29- Small bug fixes to romcc. The deep problems with not inlining functions ↵Eric Biederman
remain git-svn-id: svn://svn.coreboot.org/coreboot/trunk@1615 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
2004-05-29- Don't confuse return statements with conditional branchesEric Biederman
git-svn-id: svn://svn.coreboot.org/coreboot/trunk@1587 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
2004-05-28- Upgrade to romcc version 0.63Eric Biederman
This includes more test cases Lots of small bug fixes A built in C preprocessor Initial support for not inlining everything __attribute__((noinline)) works Better command line options and help Constants arrays can be read at compile time Asm statements that are not volatile will now be removed when their outputs go unused Loads and stores that are not volatile will be removed when their values go unused The number of FIXMES in the code is finally starting to go down. git-svn-id: svn://svn.coreboot.org/coreboot/trunk@1582 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
2004-03-11- Moved hlt() to it's own header.Eric Biederman
- Reworked pnp superio device support. Now complete superio support is less than 100 lines. - Added support for hard coding resource assignments in Config.lb - Minor bug fixes to romcc - Initial support for catching the x86 processor BIST error codes. I've only seen this trigger once in production during a very suspcious reset but... - added raminit_test to test the code paths in raminit.c for the Opteron - Removed the IORESOURCE_SET bit and added IORESOURCE_ASSIGNED and IORESOURCE_STORED so we can tell what we have really done. - Added generic AGP/IOMMU setting code to x86 - Added an implementation of memmove and removed reserved identifiers from memcpy - Added minimal support for booting on pre b3 stepping K8 cores - Moved the checksum on amd8111 boards because our default location was on top of extended RTC registers - On the Hdama added support for enabling i2c hub so we can get at the temperature sensors. Not that i2c bus was implemented well enough to make that useful. - Redid the Opteron port so we should only need one reset and most of memory initialization is done in cpu_fixup. This is much, much faster. - Attempted to make the VGA IO region assigment work. The code seems to work now... - Redid the error handling in amdk8/raminit.c to distinguish between a bad value and a smbus error, and moved memory clearing out to cpufixup. - Removed CONFIG_KEYBOARD as it was useless. See pc87360/superio.c for how to setup a legacy keyboard properly. - Reworked the register values for standard hardware, moving the defintions from chip.h into the headers of the initialization routines. This is much saner and is actually implemented. - Made the hdama port an under clockers BIOS. I debuged so many interesting problems. - On amd8111_lpc added setup of architectural/legacy hardware - Enabled PCI error reporting as much as possible. - Enhanded build_opt_tbl to generate a header of the cmos option locations so that romcc compiled code can query the cmos options. - In romcc gracefully handle function names that degenerate into function pointers - Bumped the version to 1.1.6 as we are getting closer to 2.0 TODO finish optimizing the HT links of non dual boards TODO make all Opteron board work again TODO convert all superio devices to use the new helpers TODO convert the via/epia to freebios2 conventions TODO cpu fixup/setup by cpu type git-svn-id: svn://svn.coreboot.org/coreboot/trunk@1390 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
2003-12-05- Lower DEBUG_CONSISTENCY to 1 2 is only really useful when debuggingEric Biederman
the register allocator. git-svn-id: svn://svn.coreboot.org/coreboot/trunk@1306 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
2003-10-22- Update romcc to version 0.37Eric Biederman
git-svn-id: svn://svn.coreboot.org/coreboot/trunk@1225 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
2003-10-11 - O2, enums, and switch statements work in romccEric Biederman
- Support for compiling romcc on non x86 platforms - new romc options -msse and -mmmx for specifying extra registers to use - Bug fixes to device the device disable/enable framework and an amd8111 implementation - Move the link specification to the chip specification instead of the path - Allow specifying devices with internal bridges. - Initial via epia support - Opteron errata fixes git-svn-id: svn://svn.coreboot.org/coreboot/trunk@1200 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
2003-09-17fix romcc compiling 32bit code on amd64Stefan Reinauer
git-svn-id: svn://svn.coreboot.org/coreboot/trunk@1118 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
2003-07-21- First pass at s2880 support.Eric Biederman
- SMP cleanups (remove SMP only use CONFIG_SMP) - Minor tweaks to romcc to keep it from taking forever compiling - failover fixes - Get a good implementation of k8_cpufixup and sizeram for the opteron git-svn-id: svn://svn.coreboot.org/coreboot/trunk@998 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
2003-07-12- Structure handling fixes.Eric Biederman
- Fix for asm statements with multiple results. git-svn-id: svn://svn.coreboot.org/coreboot/trunk@942 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
2003-07-04- Moved 2 of the test cases into tests for failureEric Biederman
- Reworked the transformation into ssa form and now I catch all unitialized variable uses. - Several more test cases - Bumped the version to 0.34 - Verified that -O2 the scc_transform now works. git-svn-id: svn://svn.coreboot.org/coreboot/trunk@934 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
2003-07-04- Minor fixes for handling structure constants and array values that are not ↵Eric Biederman
sdecls git-svn-id: svn://svn.coreboot.org/coreboot/trunk@933 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
2003-07-03- Allow for a larger rhs on phi variablesEric Biederman
git-svn-id: svn://svn.coreboot.org/coreboot/trunk@932 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
2003-07-01- Massive set of cleanups/fixes for romcc. Lots of corner cases now workEric Biederman
properly. And a few long standing bugs have been rooted out and removed. git-svn-id: svn://svn.coreboot.org/coreboot/trunk@931 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
2003-06-28- Update romcc so that it more successfully spills registers to the xmm ↵Eric Biederman
registers - Add several more test cases. - Bump the version number to .32 git-svn-id: svn://svn.coreboot.org/coreboot/trunk@919 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
2003-06-25- Error on function prototypesEric Biederman
- Fix a last couple of structure related bugs git-svn-id: svn://svn.coreboot.org/coreboot/trunk@914 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
2003-06-24- A few more fixes to get pointers to structures working correctly.Eric Biederman
git-svn-id: svn://svn.coreboot.org/coreboot/trunk@901 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
2003-06-24- Fix handling of structures stored in memoryEric Biederman
git-svn-id: svn://svn.coreboot.org/coreboot/trunk@899 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
2003-06-20- Implement goto supportEric Biederman
- Register allocator bug fixes. * coalesce_live_ranges now also updates the interference graph of live instructions * resolve_tangle now avoids copies to phi * correct_tangles is now called in a loop so that all tangles get fixed - Bug the version of romcc to 0.30 git-svn-id: svn://svn.coreboot.org/coreboot/trunk@886 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
2003-06-19- Update the romcc version.Eric Biederman
- Add an additional consistency check to romcc and fix the more obvious problems it has uncovered With this update there are no known silent failures in romcc. - Update the memory initialization code to setup all 3 of the memory sizing registers properly - In auto.c test our dynamic maximum amount of ram. git-svn-id: svn://svn.coreboot.org/coreboot/trunk@885 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
2003-06-18- A new test case for romccEric Biederman
- Minor romcc fixes - In smbus_wail_until_done a romcc glitch with || in romcc where it likes to run out of registers. Use | to be explicit that I don't need the short circuiting behavior. - Remove unused #defines from coherent_ht.c - Update the test in auto.c to 512M - Add definition of log2 to romcc_io.h - Implement SPD memory sizing in raminit.c - Reduce the number of memory devices back 2 to for the SOLO board. git-svn-id: svn://svn.coreboot.org/coreboot/trunk@883 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
2003-06-17- Minor mod to reset16.inc to work with newer binutils hopefully this works ↵Eric Biederman
with older ones... - Update apic.h to include the APIC_TASK_PRI register definition - Update mptable.c to have a reasonable board OEM and productid - Additional testfiles for romcc. - Split out auto.c and early failover.c moving their generic bits elsewere - Enable cache of the rom - Fixes to amd8111_lpc.c so that we successfully setup virtual wire mode on the ioapic git-svn-id: svn://svn.coreboot.org/coreboot/trunk@880 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
2003-06-16- Reduce the algorithmic complexity of parts of the register allocatorEric Biederman
so the worst case runtime of romcc is much more predictable git-svn-id: svn://svn.coreboot.org/coreboot/trunk@879 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
2003-06-11- Factoring of auto.cEric Biederman
- Implementation of fallback/normal support for the amd solo board - Minor bugfix in romcc git-svn-id: svn://svn.coreboot.org/coreboot/trunk@867 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
2003-06-10- Update romcc to version 0.27 and add more tests.Eric Biederman
git-svn-id: svn://svn.coreboot.org/coreboot/trunk@865 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
2003-05-16- Fix ? expressions previously they were reversed.Eric Biederman
git-svn-id: svn://svn.coreboot.org/coreboot/trunk@830 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
2003-05-13- Intermediate fix to allow register allocator failureEric Biederman
git-svn-id: svn://svn.coreboot.org/coreboot/trunk@829 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
2003-05-13- Add a test to make certain romcc is properly allocating registers.Eric Biederman
git-svn-id: svn://svn.coreboot.org/coreboot/trunk@828 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
2003-05-09- Implement support for structures, typedefs, and __builtin_rdmsr, ↵Eric Biederman
__builtin_wrmsr in romcc git-svn-id: svn://svn.coreboot.org/coreboot/trunk@819 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
2003-04-26- misc minor fixesEric Biederman
git-svn-id: svn://svn.coreboot.org/coreboot/trunk@802 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
2003-04-22- Checking latest version of romccEric Biederman
git-svn-id: svn://svn.coreboot.org/coreboot/trunk@783 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1