panic.c 415 B

1234567891011121314151617181920212223
  1. // SPDX-License-Identifier: GPL-2.0+
  2. /*
  3. * Copyright (c) 2020 Theobroma Systems Design und Consulting GmbH
  4. */
  5. #include <common.h>
  6. #include <command.h>
  7. static int do_panic(struct cmd_tbl *cmdtp, int flag, int argc,
  8. char * const argv[])
  9. {
  10. char *text = (argc < 2) ? "" : argv[1];
  11. panic(text);
  12. return CMD_RET_SUCCESS;
  13. }
  14. U_BOOT_CMD(
  15. panic, 2, 1, do_panic,
  16. "Panic with optional message",
  17. "[message]"
  18. );