1b2441318SGreg Kroah-Hartman// SPDX-License-Identifier: GPL-2.0
2dc425a6eSKees Cook/*
3dc425a6eSKees Cook * Callers outside of misc.c need access to the error reporting routines,
4dc425a6eSKees Cook * but the *_putstr() functions need to stay in misc.c because of how
5dc425a6eSKees Cook * memcpy() and memmove() are defined for the compressed boot environment.
6dc425a6eSKees Cook */
7dc425a6eSKees Cook#include "misc.h"
86b1cc946SZhengyi Shen#include "error.h"
9dc425a6eSKees Cook
10dc425a6eSKees Cookvoid warn(char *m)
11dc425a6eSKees Cook{
12dc425a6eSKees Cook	error_putstr("\n\n");
13dc425a6eSKees Cook	error_putstr(m);
14dc425a6eSKees Cook	error_putstr("\n\n");
15dc425a6eSKees Cook}
16dc425a6eSKees Cook
17dc425a6eSKees Cookvoid error(char *m)
18dc425a6eSKees Cook{
19dc425a6eSKees Cook	warn(m);
20dc425a6eSKees Cook	error_putstr(" -- System halted");
21dc425a6eSKees Cook
22dc425a6eSKees Cook	while (1)
23dc425a6eSKees Cook		asm("hlt");
24dc425a6eSKees Cook}