Move to new processctl syscall, share common kernel and ulib headers
This commit is contained in:
@ -11,7 +11,7 @@ SRCFILES := $(call GRABSRC, \
|
||||
system \
|
||||
)
|
||||
|
||||
CFLAGS += -isystem $(ROOT)/ulib -isystem $(ROOT)/std/include
|
||||
CFLAGS += -isystem $(ROOT)/share/hdrs -isystem $(ROOT)/ulib -isystem $(ROOT)/std/include
|
||||
|
||||
ASFILES := $(call GET_ASFILES, $(SRCFILES))
|
||||
CFILES := $(call GET_CFILES, $(SRCFILES))
|
||||
|
@ -6,5 +6,7 @@
|
||||
_start:
|
||||
call _premain
|
||||
|
||||
mov $SYS_QUITPROC, %rax
|
||||
movq $2, %rax // sys processctl
|
||||
movq $0x5E1F, %rdi // self magic num
|
||||
movq $0, %rsi // kill cmd
|
||||
int $0x80
|
||||
|
BIN
ulib/libulib.a
BIN
ulib/libulib.a
Binary file not shown.
@ -1,9 +1,6 @@
|
||||
#ifndef ULIB_SYSCALL_SYSCALL_H_
|
||||
#define ULIB_SYSCALL_SYSCALL_H_
|
||||
|
||||
#define SYS_DEBUGPRINT 1
|
||||
#define SYS_QUITPROC 2
|
||||
|
||||
#if !defined(__ASSEMBLER__)
|
||||
|
||||
uint64_t syscall(uint64_t num, uint64_t arg1, uint64_t arg2,
|
||||
|
@ -1,9 +1,13 @@
|
||||
#include <stdint.h>
|
||||
#include <system/system.h>
|
||||
#include <syscall/syscall.h>
|
||||
|
||||
#include <syscall.h>
|
||||
|
||||
void sys_debugprint(const char *string) {
|
||||
syscall(SYS_DEBUGPRINT, (uint64_t)string, 0, 0, 0, 0, 0);
|
||||
}
|
||||
|
||||
int32_t sys_processctl(uint64_t pid, uint64_t cmd, void *extra) {
|
||||
return syscall(SYS_PROCESSCTL, pid, cmd, (uint64_t)extra, 0, 0, 0);
|
||||
}
|
||||
|
||||
|
@ -1,6 +1,9 @@
|
||||
#ifndef ULIB_SYSTEM_SYSTEM_H_
|
||||
#define ULIB_SYSTEM_SYSTEM_H_
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
void sys_debugprint(const char *string);
|
||||
int32_t sys_processctl(uint64_t pid, uint64_t cmd, void *extra);
|
||||
|
||||
#endif // ULIB_SYSTEM_SYSTEM_H_
|
||||
|
Reference in New Issue
Block a user