summaryrefslogtreecommitdiff
path: root/sys/include
diff options
context:
space:
mode:
Diffstat (limited to 'sys/include')
-rw-r--r--sys/include/dev/dmi/dmi.h2
-rw-r--r--sys/include/dev/dmi/dmivar.h41
-rw-r--r--sys/include/fs/ctlfs.h6
-rw-r--r--sys/include/sys/dmi.h63
-rw-r--r--sys/include/sys/filedesc.h6
-rw-r--r--sys/include/sys/socket.h4
-rw-r--r--sys/include/sys/syscall.h1
-rw-r--r--sys/include/sys/types.h26
8 files changed, 129 insertions, 20 deletions
diff --git a/sys/include/dev/dmi/dmi.h b/sys/include/dev/dmi/dmi.h
index d24397a..8b7030c 100644
--- a/sys/include/dev/dmi/dmi.h
+++ b/sys/include/dev/dmi/dmi.h
@@ -34,7 +34,9 @@
const char *dmi_vendor(void);
const char *dmi_prodver(void);
+const char *dmi_prodfam(void);
const char *dmi_product(void);
const char *dmi_cpu_manufact(void);
+const char *dmi_cpu_version(void);
#endif /* !_DMI_DMI_H_ */
diff --git a/sys/include/dev/dmi/dmivar.h b/sys/include/dev/dmi/dmivar.h
new file mode 100644
index 0000000..e5da92f
--- /dev/null
+++ b/sys/include/dev/dmi/dmivar.h
@@ -0,0 +1,41 @@
+/*
+ * Copyright (c) 2023-2025 Ian Marco Moffett and the Osmora Team.
+ * 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 Hyra 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 _DEV_DMIVAR_H_
+#define _DEV_DMIVAR_H_
+
+#include <sys/types.h>
+#include <sys/sio.h>
+#include <fs/ctlfs.h>
+
+extern struct ctlops g_ctl_board_ident;
+
+int dmi_board_ctl_read(struct ctlfs_dev *cdp, struct sio_txn *sio);
+
+#endif /* !_DEV_DMIVAR_H_ */
diff --git a/sys/include/fs/ctlfs.h b/sys/include/fs/ctlfs.h
index 90f42f0..29ae358 100644
--- a/sys/include/fs/ctlfs.h
+++ b/sys/include/fs/ctlfs.h
@@ -42,12 +42,10 @@ struct ctlops {
/*
* Ctlfs op arguments
*
- * @devname: Device name.
- * @major: Device major
- * @minor: Device minor.
- * @mode: Access flags.
* @devname [1]: Device name (node name)
* @ctlname: [1]: Control name (node entry name)
+ * @ops: Callbacks / fs hooks
+ * @mode: Access flags.
*/
struct ctlfs_dev {
union {
diff --git a/sys/include/sys/dmi.h b/sys/include/sys/dmi.h
new file mode 100644
index 0000000..a21cff6
--- /dev/null
+++ b/sys/include/sys/dmi.h
@@ -0,0 +1,63 @@
+/*
+ * Copyright (c) 2023-2025 Ian Marco Moffett and the Osmora Team.
+ * 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 Hyra 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 _SYS_DMI_H_
+#define _SYS_DMI_H_
+
+#if defined(_KERNEL)
+#include <sys/types.h>
+#else
+#include <stdint.h>
+#include <stddef.h>
+#endif /* _KERNEL */
+
+/*
+ * Provides board information through
+ * DMI.
+ *
+ * @cpu_version: CPU version string
+ * @cpu_manuf: CPU manufacturer string
+ * @product: Board product string
+ * @vendor: Board vendor string
+ * @version: Product version string
+ *
+ * If index 0 of any of the strings contain
+ * '\0', then they are unsupported/unused.
+ *
+ * XXX: Strings are null terminated
+ */
+struct dmi_board {
+ char cpu_version[64];
+ char cpu_manuf[32];
+ char product[32];
+ char vendor[32];
+ char version[32];
+};
+
+#endif /* !_SYS_DMI_H_ */
diff --git a/sys/include/sys/filedesc.h b/sys/include/sys/filedesc.h
index 4ce2db2..adbcfa8 100644
--- a/sys/include/sys/filedesc.h
+++ b/sys/include/sys/filedesc.h
@@ -55,12 +55,12 @@ int fd_close(unsigned int fd);
int fd_read(unsigned int fd, void *buf, size_t count);
int fd_write(unsigned int fd, void *buf, size_t count);
-int fd_alloc(struct filedesc **fd_out);
+int fd_alloc(struct proc *td, struct filedesc **fd_out);
int fd_open(const char *pathname, int flags);
off_t fd_seek(int fildes, off_t offset, int whence);
-int fd_dup(int fd);
-struct filedesc *fd_get(unsigned int fdno);
+int fd_dup(struct proc *td, int fd);
+struct filedesc *fd_get(struct proc *td, unsigned int fdno);
scret_t sys_lseek(struct syscall_args *scargs);
diff --git a/sys/include/sys/socket.h b/sys/include/sys/socket.h
index 5ce1ec6..c82ae4e 100644
--- a/sys/include/sys/socket.h
+++ b/sys/include/sys/socket.h
@@ -36,6 +36,7 @@
#include <sys/uio.h>
#if defined(_KERNEL)
#include <sys/types.h>
+#include <sys/proc.h>
#include <sys/syscall.h>
#include <sys/mutex.h>
#else
@@ -154,6 +155,7 @@ struct ksocket {
struct sockaddr sockaddr;
struct sockaddr_un un;
};
+ struct proc *owner;
struct cmsg_list cmsg_list;
struct sockbuf buf;
struct mutex *mtx;
@@ -161,6 +163,7 @@ struct ksocket {
scret_t sys_socket(struct syscall_args *scargs);
scret_t sys_bind(struct syscall_args *scargs);
+scret_t sys_connect(struct syscall_args *scargs);
scret_t sys_recv(struct syscall_args *scargs);
scret_t sys_send(struct syscall_args *scargs);
@@ -171,6 +174,7 @@ scret_t sys_sendmsg(struct syscall_args *scargs);
int socket(int domain, int type, int protocol);
int bind(int sockfd, const struct sockaddr *addr, socklen_t len);
+int connect(int sockfd, const struct sockaddr *addr, socklen_t len);
ssize_t send(int sockfd, const void *buf, size_t size, int flags);
ssize_t recv(int sockfd, void *buf, size_t len, int flags);
diff --git a/sys/include/sys/syscall.h b/sys/include/sys/syscall.h
index d79a697..9798d80 100644
--- a/sys/include/sys/syscall.h
+++ b/sys/include/sys/syscall.h
@@ -65,6 +65,7 @@
#define SYS_send 24
#define SYS_sendmsg 25
#define SYS_recvmsg 26
+#define SYS_connect 27
#if defined(_KERNEL)
/* Syscall return value and arg type */
diff --git a/sys/include/sys/types.h b/sys/include/sys/types.h
index f9ccd34..223f455 100644
--- a/sys/include/sys/types.h
+++ b/sys/include/sys/types.h
@@ -82,11 +82,11 @@ typedef __uint64_t uint64_t;
#endif
#if __SIZEOF_SIZE_T__ == 8
-typedef uint64_t __size_t;
-typedef int64_t __ssize_t; /* Byte count or error */
+typedef __uint64_t __size_t;
+typedef __int64_t __ssize_t; /* Byte count or error */
#elif __SIZEOF_SIZE_T__ == 4
-typedef uint32_t __size_t;
-typedef int32_t __ssize_t; /* Byte count or error */
+typedef __uint32_t __size_t;
+typedef __int32_t __ssize_t; /* Byte count or error */
#else
#error "Unsupported size_t size"
#endif
@@ -100,15 +100,15 @@ typedef __size_t uintptr_t;
typedef __size_t off_t;
typedef int pid_t;
typedef int dev_t;
-typedef uint32_t uid_t;
-typedef uint32_t mode_t;
-typedef uint32_t ino_t;
-typedef uint32_t nlink_t;
-typedef uint32_t uid_t;
-typedef uint32_t gid_t;
-typedef uint32_t blksize_t;
-typedef uint32_t blkcnt_t;
-typedef uint64_t time_t;
+typedef __uint32_t uid_t;
+typedef __uint32_t mode_t;
+typedef __uint32_t ino_t;
+typedef __uint32_t nlink_t;
+typedef __uint32_t uid_t;
+typedef __uint32_t gid_t;
+typedef __uint32_t blksize_t;
+typedef __uint32_t blkcnt_t;
+typedef __uint64_t time_t;
#if defined(_HAVE_PTRDIFF_T)
typedef __ptrdiff_t ptrdiff_t;
#endif /* _HAVE_PTRDIFF_T */