blob: 02735494a3c6e196d40f98f7bdaa6866deb39966 [file] [log] [blame]
Heinrich Schuchardtf7d6b072018-12-26 17:20:35 +01001// 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 Schuchardtf7d6b072018-12-26 17:20:35 +01008#include <command.h>
9
Simon Glassed38aef2020-05-10 11:40:03 -060010static int do_undefined(struct cmd_tbl *cmdtp, int flag, int argc,
11 char *const argv[])
Heinrich Schuchardtf7d6b072018-12-26 17:20:35 +010012{
13 asm volatile (".word 0xffff\n");
14 return CMD_RET_FAILURE;
15}
16
Simon Glassed38aef2020-05-10 11:40:03 -060017static struct cmd_tbl cmd_sub[] = {
Heinrich Schuchardtf7d6b072018-12-26 17:20:35 +010018 U_BOOT_CMD_MKENT(undefined, CONFIG_SYS_MAXARGS, 1, do_undefined,
19 "", ""),
20};
21
Tom Rini4c1ca0d2024-06-19 10:09:44 -060022U_BOOT_LONGHELP(exception,
Heinrich Schuchardtf7d6b072018-12-26 17:20:35 +010023 "<ex>\n"
24 " The following exceptions are available:\n"
Tom Rini4c1ca0d2024-06-19 10:09:44 -060025 " undefined - undefined instruction\n");
Heinrich Schuchardtf7d6b072018-12-26 17:20:35 +010026
27#include <exception.h>