Compare commits

...

3 Commits

12 changed files with 33 additions and 100 deletions

View File

@ -11,7 +11,7 @@ int32_t SYSCALL0(sys_schedrelease) {
Proc *proc = PROCS.current; Proc *proc = PROCS.current;
spinlock_release(&PROCS.spinlock); spinlock_release(&PROCS.spinlock);
/* proc_sched((void *)frame); */ proc_sched((void *)frame);
return E_OK; return E_OK;
} }

View File

@ -1,25 +0,0 @@
#ifndef ULIB_MACHINE_LIMITS_H_
#define ULIB_MACHINE_LIMITS_H_
#define CHAR_BIT (8)
#define SHORT_BIT (16)
#define WCHAR_BIT (16)
#define INT_BIT (32)
#define LONG_LONG_BIT (64)
#define SCHAR_MIN (-128)
#define SCHAR_MAX (127)
#define UCHAR_MAX (255)
#define SHRT_MIN (-32768)
#define SHRT_MAX (32767)
#define USHRT_MAX (65535)
#define INT_MIN (-2147483648)
#define INT_MAX (2147483647)
#define UINT_MAX (4294967295U)
#define LONG_MAX (2147483647L)
#define LONG_MIN (-2147483648L)
#define ULONG_MAX (18446744073709551615UL)
#define LLONG_MAX (9223372036854775807LL)
#define LLONG_MIN (-9223372036854775808LL)
#define ULLONG_MAX (18446744073709551615ULL)
#endif // ULIB_MACHINE_LIMITS_H_

View File

@ -1,6 +0,0 @@
#ifndef ULIB_STD_LIMITS_H_
#define ULIB_STD_LIMITS_H_
#include <machine/limits.h>
#endif // ULIB_STD_LIMITS_H_

View File

@ -1,17 +0,0 @@
#ifndef ULIB_STD_STDLIB_H_
#define ULIB_STD_STDLIB_H_
#include <uprintf.h>
#include <string/conv.h>
#define printf uprintf
#define sprintf usprintf
#define vsprintf uvsprintf
#define snprintf usnprintf
#define vsnprintf uvsnprintf
#define vprintf uvprintf
#define strtoul string_conv_strtoul
#define strtol string_conv_strtol
#endif // ULIB_STD_STDLIB_H_

View File

@ -1,8 +1,8 @@
#include <stdint.h> #include <stdint.h>
#include <stddef.h> #include <stddef.h>
#include <machine/limits.h>
#include <string/char.h> #include <string/char.h>
#include <uprintf.h> #include <uprintf.h>
#include <limits.h>
// https://android.googlesource.com/platform/bionic/+/ics-mr0/libc/stdlib/strtoul.c // https://android.googlesource.com/platform/bionic/+/ics-mr0/libc/stdlib/strtoul.c
unsigned long string_conv_strtoul(const char *nptr, char **endptr, int base) unsigned long string_conv_strtoul(const char *nptr, char **endptr, int base)

25
ulib/ulib.h Normal file
View File

@ -0,0 +1,25 @@
#ifndef ULIB_ULIB_H_
#define ULIB_ULIB_H_
#include <ansiq/all.h>
#include <args/args.h>
#include <dlmalloc/malloc.h>
#include <string/string.h>
#include <string/char.h>
#include <sync/spinlock.h>
#include <syscall/syscall.h>
#include <system/system.h>
#include <util/util.h>
#include <uprintf.h>
#include <linklist.h>
#include <log.h>
#include <errors.h>
#include <sysdefs/ioctl.h>
#include <sysdefs/ipcpipe.h>
#include <sysdefs/mman.h>
#include <sysdefs/processctl.h>
#include <sysdefs/sched.h>
#include <sysdefs/syscall.h>
#endif // ULIB_ULIB_H_

View File

@ -1,14 +1,5 @@
#include <stdint.h> #include <stdint.h>
#include <string/string.h> #include <ulib.h>
#include <system/system.h>
#include <sysdefs/ipcpipe.h>
#include <sysdefs/processctl.h>
#include <uprintf.h>
#include <ansiq/all.h>
#include <string/char.h>
#include <util/util.h>
#include <dlmalloc/malloc.h>
#include <errors.h>
uint64_t PID; uint64_t PID;

View File

@ -1,13 +1,6 @@
#include <stddef.h> #include <stddef.h>
#include <stdint.h> #include <stdint.h>
#include <system/system.h> #include <ulib.h>
#include <sysdefs/processctl.h>
#include <util/util.h>
#include <errors.h>
#include <uprintf.h>
#include <string/string.h>
#include <dlmalloc/malloc.h>
#include <args/args.h>
#include "ls.h" #include "ls.h"
#include "macros.h" #include "macros.h"

View File

@ -1,8 +1,6 @@
#include <stddef.h> #include <stddef.h>
#include <stdint.h> #include <stdint.h>
#include <uprintf.h> #include <ulib.h>
#include <args/args.h>
#include <string/string.h>
#include "ls.h" #include "ls.h"
void main(void) { void main(void) {

View File

@ -1,15 +1,6 @@
#include <stddef.h> #include <stddef.h>
#include <stdbool.h> #include <stdbool.h>
#include <util/util.h> #include <ulib.h>
#include <string/string.h>
#include <string/char.h>
#include <linklist.h>
#include <dlmalloc/malloc.h>
#include <system/system.h>
#include <sysdefs/processctl.h>
#include <sysdefs/ipcpipe.h>
#include <uprintf.h>
#include <errors.h>
#include "interp.h" #include "interp.h"
#include "runtime.h" #include "runtime.h"

View File

@ -1,18 +1,6 @@
#include <stdint.h> #include <stdint.h>
#include <stddef.h> #include <stddef.h>
#include <uprintf.h> #include <ulib.h>
#include <args/args.h>
#include <string/string.h>
#include <string/char.h>
#include <log.h>
#include <ansiq/all.h>
#include <system/system.h>
#include <sysdefs/ipcpipe.h>
#include <sysdefs/ioctl.h>
#include <sysdefs/processctl.h>
#include <dlmalloc/malloc.h>
#include <errors.h>
#include <util/util.h>
#include "interp.h" #include "interp.h"
// keys // keys
@ -134,8 +122,6 @@ void do_mode_interactive(void) {
linebuf[cursor++] = b; linebuf[cursor++] = b;
uprintf("%c", b); uprintf("%c", b);
} }
} else {
schedrelease();
} }
} }

View File

@ -1,9 +1,6 @@
#include <stddef.h> #include <stddef.h>
#include <stdbool.h> #include <stdbool.h>
#include <linklist.h> #include <ulib.h>
#include <dlmalloc/malloc.h>
#include <string/string.h>
#include <uprintf.h>
#include "runtime.h" #include "runtime.h"
#include "interp.h" #include "interp.h"