aboutsummaryrefslogtreecommitdiff
path: root/kernel/inc
diff options
context:
space:
mode:
authorMarvin Borner2021-02-07 00:54:21 +0100
committerMarvin Borner2021-02-07 00:54:21 +0100
commite5086811a048120d51add9bff9ba7a669fb582f5 (patch)
tree8ccf3b193df5213548fc36c88ab83ac99d5e8654 /kernel/inc
parent6944f48d30a581d437bc2c8f873a499291412bb7 (diff)
Fixed some memory leaks (broke some stuff too)
Diffstat (limited to 'kernel/inc')
-rw-r--r--kernel/inc/fs.h33
-rw-r--r--kernel/inc/proc.h2
2 files changed, 18 insertions, 17 deletions
diff --git a/kernel/inc/fs.h b/kernel/inc/fs.h
index 64db881..64f3970 100644
--- a/kernel/inc/fs.h
+++ b/kernel/inc/fs.h
@@ -18,9 +18,9 @@ struct device {
enum dev_type type;
struct vfs *vfs;
void *data;
- u32 (*read)(void *buf, u32 offset, u32 count, struct device *dev);
- u32 (*write)(void *buf, u32 offset, u32 count, struct device *dev);
- u32 (*ready)();
+ s32 (*read)(void *buf, u32 offset, u32 count, struct device *dev);
+ s32 (*write)(void *buf, u32 offset, u32 count, struct device *dev);
+ u8 (*ready)();
};
void device_install(void);
@@ -36,10 +36,11 @@ enum vfs_type { VFS_DEVFS, VFS_TMPFS, VFS_PROCFS, VFS_EXT2 };
struct vfs {
enum vfs_type type;
int flags;
- u32 (*read)(const char *path, void *buf, u32 offset, u32 count, struct device *dev);
- u32 (*write)(const char *path, void *buf, u32 offset, u32 count, struct device *dev);
- u32 (*stat)(const char *path, struct stat *buf, struct device *dev);
- u32 (*ready)(const char *path, struct device *dev);
+ void *data;
+ s32 (*read)(const char *path, void *buf, u32 offset, u32 count, struct device *dev);
+ s32 (*write)(const char *path, void *buf, u32 offset, u32 count, struct device *dev);
+ s32 (*stat)(const char *path, struct stat *buf, struct device *dev);
+ u8 (*ready)(const char *path, struct device *dev);
};
struct mount_info {
@@ -49,15 +50,15 @@ struct mount_info {
void vfs_install(void);
-u32 vfs_mounted(struct device *dev, const char *path);
-u32 vfs_mount(struct device *dev, const char *path);
+u8 vfs_mounted(struct device *dev, const char *path);
+s32 vfs_mount(struct device *dev, const char *path);
struct device *vfs_find_dev(const char *path);
-u32 vfs_read(const char *path, void *buf, u32 offset, u32 count);
-u32 vfs_write(const char *path, void *buf, u32 offset, u32 count);
-u32 vfs_stat(const char *path, struct stat *buf);
-u32 vfs_ready(const char *path);
+s32 vfs_read(const char *path, void *buf, u32 offset, u32 count);
+s32 vfs_write(const char *path, void *buf, u32 offset, u32 count);
+s32 vfs_stat(const char *path, struct stat *buf);
+u8 vfs_ready(const char *path);
struct device *device_get_by_name(const char *name);
@@ -152,8 +153,8 @@ struct ext2_file {
u32 curr_block_pos;
};
-u32 ext2_read(const char *path, void *buf, u32 offset, u32 count, struct device *dev);
-u32 ext2_stat(const char *path, struct stat *buf, struct device *dev);
-u32 ext2_ready(const char *path, struct device *dev);
+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_ready(const char *path, struct device *dev);
#endif
diff --git a/kernel/inc/proc.h b/kernel/inc/proc.h
index d87ebef..6be7da3 100644
--- a/kernel/inc/proc.h
+++ b/kernel/inc/proc.h
@@ -21,7 +21,7 @@ enum proc_state { PROC_RUNNING, PROC_SLEEPING };
struct proc_wait {
u32 id; // dev_id
- u32 (*func)();
+ s32 (*func)();
};
struct proc {