exception.c 660 B

1234567891011121314151617181920212223242526272829
  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. asm volatile (".word 0xffff\n");
  13. return CMD_RET_FAILURE;
  14. }
  15. static struct cmd_tbl cmd_sub[] = {
  16. U_BOOT_CMD_MKENT(undefined, CONFIG_SYS_MAXARGS, 1, do_undefined,
  17. "", ""),
  18. };
  19. static char exception_help_text[] =
  20. "<ex>\n"
  21. " The following exceptions are available:\n"
  22. " undefined - undefined instruction\n"
  23. ;
  24. #include <exception.h>