Heinrich Schuchardt | dab8788 | 2018-12-26 17:20:35 +0100 | [diff] [blame] | 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 | |
Heinrich Schuchardt | dab8788 | 2018-12-26 17:20:35 +0100 | [diff] [blame] | 8 | #include <command.h> |
| 9 | |
Simon Glass | 0914011 | 2020-05-10 11:40:03 -0600 | [diff] [blame] | 10 | static int do_undefined(struct cmd_tbl *cmdtp, int flag, int argc, |
| 11 | char *const argv[]) |
Heinrich Schuchardt | dab8788 | 2018-12-26 17:20:35 +0100 | [diff] [blame] | 12 | { |
| 13 | asm volatile (".word 0xffff\n"); |
| 14 | return CMD_RET_FAILURE; |
| 15 | } |
| 16 | |
Simon Glass | 0914011 | 2020-05-10 11:40:03 -0600 | [diff] [blame] | 17 | static struct cmd_tbl cmd_sub[] = { |
Heinrich Schuchardt | dab8788 | 2018-12-26 17:20:35 +0100 | [diff] [blame] | 18 | U_BOOT_CMD_MKENT(undefined, CONFIG_SYS_MAXARGS, 1, do_undefined, |
| 19 | "", ""), |
| 20 | }; |
| 21 | |
| 22 | static char exception_help_text[] = |
| 23 | "<ex>\n" |
| 24 | " The following exceptions are available:\n" |
| 25 | " undefined - undefined instruction\n" |
| 26 | ; |
| 27 | |
| 28 | #include <exception.h> |