mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-08 17:47:18 +00:00
Import the "gerbert" kernel I worked on earlier this year.
It's a lot crappier than I remembered it. It's gonna need a lot of work.
This commit is contained in:
42
Kernel/Userspace.cpp
Normal file
42
Kernel/Userspace.cpp
Normal file
@@ -0,0 +1,42 @@
|
||||
#include "Userspace.h"
|
||||
#include "Syscall.h"
|
||||
#include "StdLib.h"
|
||||
|
||||
namespace Userspace {
|
||||
|
||||
int open(const char* path)
|
||||
{
|
||||
return DO_SYSCALL_A2(Syscall::PosixOpen, path, strlen(path));
|
||||
}
|
||||
|
||||
int close(int fd)
|
||||
{
|
||||
return DO_SYSCALL_A1(Syscall::PosixClose, fd);
|
||||
}
|
||||
|
||||
int read(int fd, void* outbuf, size_t nread)
|
||||
{
|
||||
return DO_SYSCALL_A3(Syscall::PosixRead, fd, outbuf, nread);
|
||||
}
|
||||
|
||||
int seek(int fd, int offset)
|
||||
{
|
||||
return DO_SYSCALL_A2(Syscall::PosixRead, fd, offset);
|
||||
}
|
||||
|
||||
int kill(pid_t pid, int sig)
|
||||
{
|
||||
return DO_SYSCALL_A2(Syscall::PosixKill, pid, sig);
|
||||
}
|
||||
|
||||
uid_t getuid()
|
||||
{
|
||||
return DO_SYSCALL_A0(Syscall::PosixGetuid);
|
||||
}
|
||||
|
||||
void sleep(DWORD ticks)
|
||||
{
|
||||
DO_SYSCALL_A1(Syscall::Sleep, ticks);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user