From 90089603393a1a67b9a4afe1f2b7237a74e1b21b Mon Sep 17 00:00:00 2001 From: Eric Biederman Date: Fri, 28 May 2004 14:11:54 +0000 Subject: - Upgrade to romcc version 0.63 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 --- util/romcc/tests/linux_test13.c | 47 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 util/romcc/tests/linux_test13.c (limited to 'util/romcc/tests/linux_test13.c') diff --git a/util/romcc/tests/linux_test13.c b/util/romcc/tests/linux_test13.c new file mode 100644 index 0000000000..83ef239854 --- /dev/null +++ b/util/romcc/tests/linux_test13.c @@ -0,0 +1,47 @@ +#include "linux_syscall.h" +#include "linux_console.h" + +struct mem_controller { + unsigned short channel0[4]; +}; + +static unsigned int spd_detect_dimms(const struct mem_controller *ctrl) +{ + unsigned dimm_mask; + int i; + + print_debug("1\n"); + dimm_mask = 0; + for(i = 0; i < 4; i++) { + int byte; + unsigned device; + + print_debug("2\n"); + device = ctrl->channel0[i]; + if (device) { + print_debug("3\n"); + byte = ctrl->channel0[i] + 2; + if (byte == 7) { + dimm_mask |= (1 << i); + } + } + print_debug("4\n"); + } + print_debug("5\n"); + return dimm_mask; +} + + +static void main(void) +{ + static const struct mem_controller cpu[] = { + { + .channel0 = { (0xa<<3)|0, (0xa<<3)|2, 0, 0 }, + }, + }; + long dimm_mask; + print_debug("A\n"); + dimm_mask = spd_detect_dimms(cpu); + print_debug("B\n"); + _exit(0); +} -- cgit v1.2.3