2022-10-02 16:10:53 +00:00
|
|
|
#include <luna.h>
|
2022-10-08 10:06:09 +00:00
|
|
|
#include <stdlib.h>
|
2022-10-02 16:10:53 +00:00
|
|
|
#include <string.h>
|
|
|
|
#include <sys/syscall.h>
|
|
|
|
#include <unistd.h>
|
|
|
|
|
|
|
|
#define noreturn __attribute__((noreturn))
|
|
|
|
|
|
|
|
extern "C"
|
|
|
|
{
|
|
|
|
pid_t gettid()
|
|
|
|
{
|
|
|
|
return syscall(SYS_gettid);
|
|
|
|
}
|
|
|
|
|
|
|
|
unsigned int msleep(unsigned int ms)
|
|
|
|
{
|
2022-10-07 16:19:06 +00:00
|
|
|
return (unsigned int)syscall(SYS_sleep, ms);
|
2022-10-02 16:10:53 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
noreturn void __luna_abort(const char* message)
|
|
|
|
{
|
|
|
|
syscall(SYS_write, message, strlen(message));
|
2022-10-08 10:06:09 +00:00
|
|
|
abort();
|
2022-10-02 16:10:53 +00:00
|
|
|
}
|
|
|
|
}
|