exception64.c 751 B

123456789101112131415161718192021222324252627282930313233
  1. // SPDX-License-Identifier: GPL-2.0+
  2. /*
  3. * The 'exception' command can be used for testing exception handling.
  4. *
  5. * Copyright (c) 2018, Heinrich Schuchardt <xypron.glpk@gmx.de>
  6. */
  7. #include <common.h>
  8. #include <command.h>
  9. static int do_undefined(struct cmd_tbl *cmdtp, int flag, int argc,
  10. char *const argv[])
  11. {
  12. /*
  13. * 0xe7f...f. is undefined in ARM mode
  14. * 0xde.. is undefined in Thumb mode
  15. */
  16. asm volatile (".word 0xe7f7defb\n");
  17. return CMD_RET_FAILURE;
  18. }
  19. static struct cmd_tbl cmd_sub[] = {
  20. U_BOOT_CMD_MKENT(undefined, CONFIG_SYS_MAXARGS, 1, do_undefined,
  21. "", ""),
  22. };
  23. static char exception_help_text[] =
  24. "<ex>\n"
  25. " The following exceptions are available:\n"
  26. " undefined - undefined instruction\n"
  27. ;
  28. #include <exception.h>