aboutsummaryrefslogtreecommitdiff
path: root/kernel/inc
diff options
context:
space:
mode:
authorMarvin Borner2021-03-15 22:54:54 +0100
committerMarvin Borner2021-03-15 22:54:54 +0100
commitdc9f9f55cb6b38b87d8c228ae9abb4b53ebfb25c (patch)
treee4a51d5e94f963bcabe834b3ba535a8da871c42f /kernel/inc
parent665b00e7f44e5088b134d111ba1d5226c11f0ae8 (diff)
System hardening and errno impl
Diffstat (limited to 'kernel/inc')
-rw-r--r--kernel/inc/fb.h4
-rw-r--r--kernel/inc/fs.h12
-rw-r--r--kernel/inc/load.h3
-rw-r--r--kernel/inc/mm.h6
4 files changed, 15 insertions, 10 deletions
diff --git a/kernel/inc/fb.h b/kernel/inc/fb.h
index 3e7b08f..212230b 100644
--- a/kernel/inc/fb.h
+++ b/kernel/inc/fb.h
@@ -1,7 +1,7 @@
// MIT License, Copyright (c) 2021 Marvin Borner
-#ifndef FB
-#define FB
+#ifndef FB_H
+#define FB_H
#include <boot.h>
diff --git a/kernel/inc/fs.h b/kernel/inc/fs.h
index cd97b99..fd5c470 100644
--- a/kernel/inc/fs.h
+++ b/kernel/inc/fs.h
@@ -21,7 +21,7 @@ struct device {
s32 (*read)(void *buf, u32 offset, u32 count, struct device *dev);
s32 (*write)(void *buf, u32 offset, u32 count, struct device *dev);
s32 (*ioctl)(u32 request, void *arg1, void *arg2, void *arg3, struct device *dev);
- u8 (*ready)(void);
+ s32 (*ready)(void);
};
void device_install(void);
@@ -45,8 +45,8 @@ struct vfs {
struct device *dev);
s32 (*stat)(const char *path, struct stat *buf, struct device *dev);
s32 (*wait)(const char *path, u32 func_ptr, struct device *dev);
- u8 (*perm)(const char *path, enum vfs_perm perm, struct device *dev);
- u8 (*ready)(const char *path, struct device *dev);
+ s32 (*ready)(const char *path, struct device *dev);
+ s32 (*perm)(const char *path, enum vfs_perm perm, struct device *dev);
};
struct mount_info {
@@ -67,7 +67,7 @@ s32 vfs_ioctl(const char *path, u32 request, void *arg1, void *arg2, void *arg3)
s32 vfs_stat(const char *path, struct stat *buf);
s32 vfs_wait(const char *path, u32 func_ptr);
s32 vfs_poll(const char **files);
-u8 vfs_ready(const char *path);
+s32 vfs_ready(const char *path);
struct device *device_get_by_name(const char *name);
struct device *device_get_by_id(u32 id);
@@ -176,7 +176,7 @@ struct ext2_file {
s32 ext2_read(const char *path, void *buf, u32 offset, u32 count, struct device *dev);
s32 ext2_stat(const char *path, struct stat *buf, struct device *dev);
-u8 ext2_perm(const char *path, enum vfs_perm perm, struct device *dev);
-u8 ext2_ready(const char *path, struct device *dev);
+s32 ext2_perm(const char *path, enum vfs_perm perm, struct device *dev);
+s32 ext2_ready(const char *path, struct device *dev);
#endif
diff --git a/kernel/inc/load.h b/kernel/inc/load.h
index f493e84..bd3b10d 100644
--- a/kernel/inc/load.h
+++ b/kernel/inc/load.h
@@ -3,8 +3,9 @@
#ifndef LOAD_H
#define LOAD_H
+#include <def.h>
#include <proc.h>
-int bin_load(const char *path, struct proc *proc);
+s32 bin_load(const char *path, struct proc *proc);
#endif
diff --git a/kernel/inc/mm.h b/kernel/inc/mm.h
index fa2ebd1..98dcf46 100644
--- a/kernel/inc/mm.h
+++ b/kernel/inc/mm.h
@@ -101,7 +101,11 @@ void memory_map_identity(struct page_dir *dir, struct memory_range prange, u32 f
void memory_free(struct page_dir *dir, struct memory_range vrange);
void memory_switch_dir(struct page_dir *dir);
void memory_backup_dir(struct page_dir **backup);
-u8 memory_user_valid(u32 addr);
+
+// Bypass should almost never be used
+void memory_bypass_enable(void);
+void memory_bypass_disable(void);
+u8 memory_valid(const void *addr);
void memory_install(struct mem_info *mem_info, struct vid_info *vid_info);