blob: b0e04a49033668902d73ad311feffffed07cdaae [file] [log] [blame]
Stefan Reinauerabc0c852010-11-22 08:09:50 +00001/*
2 * This file is part of the coreboot project.
Stefan Reinauer5ff7c132011-10-31 12:56:45 -07003 *
Stefan Reinauerabc0c852010-11-22 08:09:50 +00004 * Copyright (C) 2003 Eric Biederman
5 *
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
9 * the License.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
19 * MA 02110-1301 USA
20 */
21
22#include <arch/io.h>
Stefan Reinauerabc0c852010-11-22 08:09:50 +000023#include <console/console.h>
Patrick Georgibd79c5e2014-11-28 22:35:36 +010024#include <halt.h>
Stefan Reinauerabc0c852010-11-22 08:09:50 +000025
Patrick Georgi394965d2010-11-22 13:07:10 +000026#ifndef __ROMCC__
27#define NORETURN __attribute__((noreturn))
Patrick Georgi394965d2010-11-22 13:07:10 +000028
Stefan Reinauerabc0c852010-11-22 08:09:50 +000029/* Report a fatal error */
Patrick Georgi394965d2010-11-22 13:07:10 +000030void NORETURN die(const char *msg)
Stefan Reinauerabc0c852010-11-22 08:09:50 +000031{
Stefan Reinauerd6865222015-01-05 13:12:38 -080032 printk(BIOS_EMERG, "%s", msg);
Patrick Georgibd79c5e2014-11-28 22:35:36 +010033 halt();
Stefan Reinauerabc0c852010-11-22 08:09:50 +000034}
Stefan Reinauerd6865222015-01-05 13:12:38 -080035#endif