Rework shared headers
This commit is contained in:
@ -2,7 +2,7 @@
|
||||
#include <stdbool.h>
|
||||
#include "fs/littlefs/lfs.h"
|
||||
#include "vfs/vfs.h"
|
||||
#include "hdrs/errors.h"
|
||||
#include "errors.h"
|
||||
#include "kprintf.h"
|
||||
#include "dlmalloc/malloc.h"
|
||||
#include "hal/hal.h"
|
||||
|
@ -12,7 +12,7 @@
|
||||
#include "pit.h"
|
||||
#include "proc/proc.h"
|
||||
#include "syscall/syscall.h"
|
||||
#include "hdrs/errors.h"
|
||||
#include "errors.h"
|
||||
|
||||
void hal_intr_disable(void) {
|
||||
asm volatile("cli");
|
||||
|
@ -9,7 +9,7 @@
|
||||
#include "util/util.h"
|
||||
#include "kprintf.h"
|
||||
#include "elf.h"
|
||||
#include "hdrs/errors.h"
|
||||
#include "errors.h"
|
||||
#include "vfs/vfs.h"
|
||||
#include "bootinfo/bootinfo.h"
|
||||
|
||||
|
@ -5,6 +5,7 @@
|
||||
#include "hal/hal.h"
|
||||
#include "spinlock/spinlock.h"
|
||||
#include "bitmap/bitmap.h"
|
||||
#include "vfs/vfs.h"
|
||||
|
||||
#define PROC_NAME_MAX 0x100
|
||||
|
||||
@ -12,6 +13,7 @@
|
||||
#define PROC_STACKSIZE (PROC_STACKBLOCKS * BITMAP_BLOCK_SIZE)
|
||||
|
||||
#define PROC_MAX 0x100 // max amount of processes
|
||||
#define PROC_VFSHANDLES_MAX 0x80
|
||||
|
||||
typedef struct {
|
||||
IntrStackFrame trapframe;
|
||||
@ -28,12 +30,17 @@ enum {
|
||||
|
||||
typedef struct Proc {
|
||||
struct Proc *next;
|
||||
|
||||
uint64_t pid;
|
||||
char name[PROC_NAME_MAX];
|
||||
|
||||
ProcPlatformData platformdata;
|
||||
uint8_t state;
|
||||
VasRange *vas;
|
||||
|
||||
bool kern;
|
||||
|
||||
VfsObj *vobjs[PROC_VFSHANDLES_MAX];
|
||||
} Proc;
|
||||
|
||||
typedef struct {
|
||||
|
@ -1,7 +1,7 @@
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
#include "spinlock/spinlock.h"
|
||||
#include "hdrs/errors.h"
|
||||
#include "errors.h"
|
||||
#include "dlmalloc/malloc.h"
|
||||
#include "ramsd.h"
|
||||
#include "storedev.h"
|
||||
|
@ -3,7 +3,7 @@
|
||||
#include "storedev.h"
|
||||
#include "spinlock/spinlock.h"
|
||||
#include "kprintf.h"
|
||||
#include "hdrs/errors.h"
|
||||
#include "errors.h"
|
||||
#include "dlmalloc/malloc.h"
|
||||
#include "ramsd.h"
|
||||
#include "util/util.h"
|
||||
|
@ -2,23 +2,15 @@
|
||||
#include "syscall.h"
|
||||
#include "proc/proc.h"
|
||||
#include "spinlock/spinlock.h"
|
||||
#include "hdrs/errors.h"
|
||||
#include "errors.h"
|
||||
#include "util/util.h"
|
||||
#include "sysdefs/processctl.h"
|
||||
|
||||
#define PID_SELF_MAGIC 0x5E1F
|
||||
|
||||
enum {
|
||||
PCTL_KILL = 0,
|
||||
};
|
||||
|
||||
typedef struct {
|
||||
|
||||
} ProcessCtl;
|
||||
|
||||
int32_t SYSCALL3(sys_processctl, pid1, cmd1, optsptr1) {
|
||||
uint64_t pid = pid1;
|
||||
uint64_t cmd = cmd1;
|
||||
ProcessCtl *pctl = (ProcessCtl *)(void *)optsptr1;
|
||||
int32_t ret = E_OK;
|
||||
|
||||
spinlock_acquire(&PROCS.spinlock);
|
||||
|
@ -1,9 +1,9 @@
|
||||
#include <stdint.h>
|
||||
#include "syscall.h"
|
||||
#include "hdrs/errors.h"
|
||||
#include "errors.h"
|
||||
#include "kprintf.h"
|
||||
#include "processctl.h"
|
||||
#include "hdrs/syscall.h"
|
||||
#include "sysdefs/syscall.h"
|
||||
|
||||
int32_t SYSCALL1(sys_debugprint, string) {
|
||||
char *p = (char *)string;
|
||||
|
@ -7,7 +7,7 @@
|
||||
#include "util/util.h"
|
||||
#include "hshtb.h"
|
||||
#include "assert.h"
|
||||
#include "hdrs/errors.h"
|
||||
#include "errors.h"
|
||||
#include "fs/portlfs/portlfs.h"
|
||||
#include "storedev/storedev.h"
|
||||
#include "baseimg/baseimg.h"
|
||||
|
Reference in New Issue
Block a user