]>
git.ipfire.org Git - thirdparty/u-boot.git/blob - include/exception.h
1 /* SPDX-License-Identifier: GPL-2.0+ */
3 * The 'exception' command can be used for testing exception handling.
5 * Copyright (c) 2018, Heinrich Schuchardt <xypron.glpk@gmx.de>
10 static int do_exception(struct cmd_tbl
*cmdtp
, int flag
, int argc
,
18 /* drop sub-command parameter */
22 cp
= find_cmd_tbl(argv
[0], cmd_sub
, ARRAY_SIZE(cmd_sub
));
25 return cp
->cmd(cmdtp
, flag
, argc
, argv
);
30 static int exception_complete(int argc
, char *const argv
[], char last_char
,
31 int maxv
, char *cmdv
[])
35 struct cmd_tbl
*cmdtp
;
41 len
= strlen(argv
[1]);
46 for (cmdtp
= cmd_sub
; cmdtp
!= cmd_sub
+ ARRAY_SIZE(cmd_sub
); cmdtp
++) {
49 if (!strncmp(argv
[1], cmdtp
->name
, len
))
50 cmdv
[i
++] = cmdtp
->name
;
57 exception
, 2, 0, do_exception
,
58 "Forces an exception to occur",
59 exception_help_text
, exception_complete