blob: 12de30bc4090a64f323e9c61678fb6d2867ae86c [file] [log] [blame]
Dmitry V. Levin9aaf88c2014-02-05 14:51:19 +00001#include "defs.h"
Dmitry V. Levin9aaf88c2014-02-05 14:51:19 +00002
Dmitry V. Levin0ed617b2014-04-25 23:30:54 +00003#include "xlat/bootflags1.h"
Dmitry V. Levin0ed617b2014-04-25 23:30:54 +00004#include "xlat/bootflags2.h"
Dmitry V. Levin0ed617b2014-04-25 23:30:54 +00005#include "xlat/bootflags3.h"
Dmitry V. Levin9aaf88c2014-02-05 14:51:19 +00006
Dmitry V. Levina0bd3742015-04-07 01:36:50 +00007SYS_FUNC(reboot)
Dmitry V. Levin9aaf88c2014-02-05 14:51:19 +00008{
Dmitry V. Levinb83bb1c2016-04-26 17:41:44 +00009 const unsigned int magic1 = tcp->u_arg[0];
10 const unsigned int magic2 = tcp->u_arg[1];
11 const unsigned int cmd = tcp->u_arg[2];
12
Elliott Hughesb7556142018-02-20 17:03:16 -080013 printxval(bootflags1, magic1, "LINUX_REBOOT_MAGIC_???");
Dmitry V. Levin9aaf88c2014-02-05 14:51:19 +000014 tprints(", ");
Elliott Hughesb7556142018-02-20 17:03:16 -080015 printxval(bootflags2, magic2, "LINUX_REBOOT_MAGIC_???");
Dmitry V. Levin9aaf88c2014-02-05 14:51:19 +000016 tprints(", ");
Elliott Hughesb7556142018-02-20 17:03:16 -080017 printxval(bootflags3, cmd, "LINUX_REBOOT_CMD_???");
Dmitry V. Levinb83bb1c2016-04-26 17:41:44 +000018 if (cmd == LINUX_REBOOT_CMD_RESTART2) {
Dmitry V. Levin9aaf88c2014-02-05 14:51:19 +000019 tprints(", ");
Elliott Hughesb7556142018-02-20 17:03:16 -080020 /*
21 * The size of kernel buffer is 256 bytes and
22 * the last byte is always zero, at most 255 bytes
23 * are copied from the user space.
24 */
25 printstr_ex(tcp, tcp->u_arg[3], 255, QUOTE_0_TERMINATED);
Dmitry V. Levin9aaf88c2014-02-05 14:51:19 +000026 }
Dmitry V. Levin307945d2015-07-17 20:27:00 +000027 return RVAL_DECODED;
Dmitry V. Levin9aaf88c2014-02-05 14:51:19 +000028}