loader: remove shouting from ORB's variable name
[hvf.git] / cp / shell / cmd_system.c
blobac9eedc822f8ef96f51b2070fe7a747b6ff4a6a2
1 /*
2 * (C) Copyright 2007-2011 Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
4 * This file is released under the GPLv2. See the COPYING file for more
5 * details.
6 */
8 #include <ebcdic.h>
9 #include <binfmt_elf.h>
10 #include <bcache.h>
11 #include <edf.h>
14 *!!! IPL
15 *!! SYNTAX
16 *! \tok{\sc IPL} <vdev>
17 *!! XATNYS
18 *!! AUTH G
19 *!! PURPOSE
20 *! Perform a ...
21 *!! NOTES
22 *! \item Not yet implemented.
23 *!! SETON
25 static int cmd_ipl(struct virt_sys *sys, char *cmd, int len)
27 u64 vdevnum = 0;
28 char *c;
30 SHELL_CMD_AUTH(sys, G);
32 /* get IPL vdev # */
33 c = __extract_hex(cmd, &vdevnum);
34 if (IS_ERR(c))
35 goto nss;
37 /* device numbers are 16-bits */
38 if (vdevnum & ~0xffff)
39 goto nss;
41 /* find the virtual device */
43 #if 0
44 for_each_vdev(sys, vdev)
45 if (vdev->pmcw.dev_num == (u16) vdevnum) {
46 ret = guest_ipl_nss(sys, "ipldev");
47 if (ret)
48 return ret;
50 assert(0);
52 return -EINVAL;
54 #endif
56 nss:
57 /* device not found */
58 return guest_ipl_nss(sys, cmd);
61 /*!!! SYSTEM CLEAR
62 *!! SYNTAX
63 *! \tok{\sc SYStem} \tok{\sc CLEAR}
64 *!! XATNYS
65 *!! AUTH G
66 *!! PURPOSE
67 *! Identical to reset-clear button on a real mainframe.
69 *!!! SYSTEM RESET
70 *!p >>--SYSTEM--RESET-------------------------------------------------------------><
71 *!! SYNTAX
72 *! \tok{\sc SYStem} \tok{\sc RESET}
73 *!! XATNYS
74 *!! AUTH G
75 *!! PURPOSE
76 *! Identical to reset-normal button on a real mainframe.
78 *!!! SYSTEM RESTART
79 *!! SYNTAX
80 *! \tok{\sc SYStem} \tok{\sc RESTART}
81 *!! XATNYS
82 *!! AUTH G
83 *!! PURPOSE
84 *! Perform a restart operation.
85 *!! NOTES
86 *! \item Not yet implemented.
87 *!! SETON
89 *!!! SYSTEM STORE
90 *!! SYNTAX
91 *! \tok{\sc SYStem} \tok{\sc STORE}
92 *!! XATNYS
93 *!! AUTH G
94 *!! PURPOSE
95 *! Perform a ...
96 *!! NOTES
97 *! \item Not yet implemented.
98 *!! SETON
100 static int cmd_system(struct virt_sys *sys, char *cmd, int len)
102 SHELL_CMD_AUTH(sys, G);
104 if (!strcasecmp(cmd, "CLEAR")) {
105 guest_system_reset_clear(sys);
106 con_printf(sys->con, "STORAGE CLEARED - SYSTEM RESET\n");
107 } else if (!strcasecmp(cmd, "RESET")) {
108 guest_system_reset_normal(sys);
109 con_printf(sys->con, "SYSTEM RESET\n");
110 } else if (!strcasecmp(cmd, "RESTART")) {
111 con_printf(sys->con, "SYSTEM RESTART is not yet supported\n");
112 } else if (!strcasecmp(cmd, "STORE")) {
113 con_printf(sys->con, "SYSTEM STORE is not yet supported\n");
114 } else
115 con_printf(sys->con, "SYSTEM: Unknown variable '%s'\n", cmd);
117 return 0;