error.c 484 B

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