summaryrefslogtreecommitdiff
path: root/src/sys/include
diff options
context:
space:
mode:
Diffstat (limited to 'src/sys/include')
-rw-r--r--src/sys/include/compat/unix/syscall.h4
-rw-r--r--src/sys/include/os/reboot.h37
-rw-r--r--src/sys/include/sys/syscall.h1
3 files changed, 41 insertions, 1 deletions
diff --git a/src/sys/include/compat/unix/syscall.h b/src/sys/include/compat/unix/syscall.h
index 2cca0bc..7a612c3 100644
--- a/src/sys/include/compat/unix/syscall.h
+++ b/src/sys/include/compat/unix/syscall.h
@@ -35,6 +35,7 @@
#include <sys/mount.h>
#include <sys/syscall.h>
#include <os/iotap.h>
+#include <os/reboot.h>
/*
* Exit the current process - exit(2) syscall
@@ -72,7 +73,8 @@ scret_t(*g_unix_sctab[])(struct syscall_args *) = {
[SYS_mount] = sys_mount,
[SYS_open] = sys_open,
[SYS_muxtap] = sys_muxtap,
- [SYS_getargv] = sys_getargv
+ [SYS_getargv] = sys_getargv,
+ [SYS_reboot] = sys_reboot
};
#endif /* !_NEED_UNIX_SCTAB */
diff --git a/src/sys/include/os/reboot.h b/src/sys/include/os/reboot.h
new file mode 100644
index 0000000..f0f967e
--- /dev/null
+++ b/src/sys/include/os/reboot.h
@@ -0,0 +1,37 @@
+/*
+ * Copyright (c) 2025 Ian Marco Moffett and L5 engineers
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the project nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef _OS_REBOOT_H_
+#define _OS_REBOOT_H_
+
+#include <sys/syscall.h>
+
+scret_t sys_reboot(struct syscall_args *scargs);
+
+#endif /* !_OS_REBOOT_H_ */
diff --git a/src/sys/include/sys/syscall.h b/src/sys/include/sys/syscall.h
index 8353eda..9616aed 100644
--- a/src/sys/include/sys/syscall.h
+++ b/src/sys/include/sys/syscall.h
@@ -53,6 +53,7 @@
#define SYS_open 0x08 /* open a file */
#define SYS_muxtap 0x09 /* mux an I/O tap */
#define SYS_getargv 0x0A /* get process argv */
+#define SYS_reboot 0x0B /* reboot the system */
typedef __ssize_t scret_t;
typedef __ssize_t scarg_t;