Heiko Stuebner | 6671aed | 2020-06-30 01:05:45 +0200 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0+ |
| 2 | /* |
| 3 | * Copyright (c) 2020 Theobroma Systems Design und Consulting GmbH |
| 4 | */ |
| 5 | |
Tom Rini | dec7ea0 | 2024-05-20 13:35:03 -0600 | [diff] [blame] | 6 | #include <vsprintf.h> |
Heiko Stuebner | 6671aed | 2020-06-30 01:05:45 +0200 | [diff] [blame] | 7 | #include <command.h> |
| 8 | |
| 9 | static int do_panic(struct cmd_tbl *cmdtp, int flag, int argc, |
| 10 | char * const argv[]) |
| 11 | { |
| 12 | char *text = (argc < 2) ? "" : argv[1]; |
| 13 | |
| 14 | panic(text); |
| 15 | |
| 16 | return CMD_RET_SUCCESS; |
| 17 | } |
| 18 | |
| 19 | U_BOOT_CMD( |
| 20 | panic, 2, 1, do_panic, |
| 21 | "Panic with optional message", |
| 22 | "[message]" |
| 23 | ); |