diff options
Diffstat (limited to 'src/user/include')
-rw-r--r-- | src/user/include/knob/task.h | 4 | ||||
-rw-r--r-- | src/user/include/pland/syscall.h | 12 |
2 files changed, 12 insertions, 4 deletions
diff --git a/src/user/include/knob/task.h b/src/user/include/knob/task.h index ea5df62..6539a00 100644 --- a/src/user/include/knob/task.h +++ b/src/user/include/knob/task.h @@ -1,9 +1,11 @@ #ifndef KNOB_TASK_H #define KNOB_TASK_H +#include <stdint.h> #include <stdbool.h> -bool try_run_command(const char *path); +uint32_t run_command(const char *path); +bool try_run_command_blocking(const char *path); void yield_task(); #endif
\ No newline at end of file diff --git a/src/user/include/pland/syscall.h b/src/user/include/pland/syscall.h index c597e2b..75383fc 100644 --- a/src/user/include/pland/syscall.h +++ b/src/user/include/pland/syscall.h @@ -8,6 +8,7 @@ typedef uint32_t _file_handle_t; typedef uint32_t _task_handle_t; typedef uint32_t _drive_number_t; typedef uint32_t _pages_t; +typedef uint32_t _process_handle_t; typedef enum { _KEY_BACKSPACE = '\b', @@ -43,7 +44,8 @@ enum _scn { _SCN_LOG_STRING, _SCN_GET_KEY, _SCN_ALLOCATE_RAM, - _SCN_MEMORY_INFO + _SCN_MEMORY_INFO, + _SCN_WAIT_FOR_TASK }; static inline uint32_t _sc0(enum _scn eax) { @@ -124,8 +126,8 @@ static inline uint32_t _file_size(_file_handle_t handle) { return _sc1(_SCN_FILE_SIZE, handle); } -static inline bool _start_task(_drive_number_t drive_number, const char *path, const char *pass) { - return (bool)_sc3(_SCN_START_TASK, drive_number, (uint32_t)path, (uint32_t)pass); +static inline _process_handle_t _start_task(_drive_number_t drive_number, const char *path, const char *pass) { + return _sc3(_SCN_START_TASK, drive_number, (uint32_t)path, (uint32_t)pass); } static inline void _log_string(const char *sz) { @@ -160,4 +162,8 @@ static inline _pages_t _this_process_memory_left() { return _sc1(_SCN_MEMORY_INFO, 0x4); } +static inline void _wait_for_task(_process_handle_t handle) { + _sc1(_SCN_WAIT_FOR_TASK, handle); +} + #endif
\ No newline at end of file |