gm45: Allow coexistance with ME firmware.
[coreboot.git] / src / include / assert.h
blob346e76961e8083bc6fbac30542e3be38e3570298
1 /*
2 * This file is part of the coreboot project.
4 * Copyright (C) 2010 coresystems GmbH
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License as
8 * published by the Free Software Foundation; version 2 of the License.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
20 #ifndef __ASSERT_H__
21 #define __ASSERT_H__
23 #if defined(__PRE_RAM__) && !CONFIG_CACHE_AS_RAM
25 /* ROMCC versions */
26 #define ASSERT(x) { \
27 if(!(x)) { \
28 print_emerg("ASSERTION FAILED: file '"); \
29 print_emerg(__FILE__); \
30 print_emerg("', line 0x"); \
31 print_debug_hex32(__LINE__); \
32 print_emerg("\n"); \
33 /* die(""); */ \
34 } \
37 #define BUG() { \
38 print_emerg("BUG ENCOUNTERED: SYSTEM HALTED at file '");\
39 print_emerg(__FILE__); \
40 print_emerg("', line 0x"); \
41 print_debug_hex32(__LINE__); \
42 print_emerg("\n"); \
43 /* die(""); */ \
46 #else
48 /* GCC and CAR versions */
49 #define ASSERT(x) { \
50 if (!(x)) { \
51 printk(BIOS_EMERG, "ASSERTION FAILED: file '%s', " \
52 " line %d\n", __FILE__, __LINE__); \
53 /* die(""); */ \
54 } \
56 #define BUG() { \
57 printk(BIOS_EMERG, "BUG ENCOUNTERED: SYSTEM HALTED at file '%s', " \
58 " line %d\n", __FILE__, __LINE__); \
59 /* die(""); */ \
62 #endif
64 #endif // __ASSERT_H__