blob: ea46f51dfad37a7c07b47f595c66437a684e6451 [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.
Stefan Reinauerabc0c852010-11-22 08:09:50 +000015 */
16
17#include <arch/io.h>
Stefan Reinauerabc0c852010-11-22 08:09:50 +000018#include <console/console.h>
Patrick Georgibd79c5e2014-11-28 22:35:36 +010019#include <halt.h>
Stefan Reinauerabc0c852010-11-22 08:09:50 +000020
Patrick Georgi394965d2010-11-22 13:07:10 +000021#ifndef __ROMCC__
22#define NORETURN __attribute__((noreturn))
Patrick Georgi394965d2010-11-22 13:07:10 +000023
Stefan Reinauerabc0c852010-11-22 08:09:50 +000024/* Report a fatal error */
Patrick Georgi394965d2010-11-22 13:07:10 +000025void NORETURN die(const char *msg)
Stefan Reinauerabc0c852010-11-22 08:09:50 +000026{
Stefan Reinauerd6865222015-01-05 13:12:38 -080027 printk(BIOS_EMERG, "%s", msg);
Patrick Georgibd79c5e2014-11-28 22:35:36 +010028 halt();
Stefan Reinauerabc0c852010-11-22 08:09:50 +000029}
Stefan Reinauerd6865222015-01-05 13:12:38 -080030#endif