diff options
author | Benji Dial <benji6283@gmail.com> | 2020-09-13 22:59:42 -0400 |
---|---|---|
committer | Benji Dial <benji6283@gmail.com> | 2020-09-13 22:59:42 -0400 |
commit | 20853582d5385d12421433d21910e783caa00764 (patch) | |
tree | 446bbd18353cfe0897d293a822458b7960a3645e /src/user/include/pland/syscall.h | |
parent | 44d29a33df81ac07163d5146a9e43a0c4fb80af0 (diff) | |
download | portland-os-20853582d5385d12421433d21910e783caa00764.tar.gz |
dirinfo command
Diffstat (limited to 'src/user/include/pland/syscall.h')
-rw-r--r-- | src/user/include/pland/syscall.h | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/user/include/pland/syscall.h b/src/user/include/pland/syscall.h index 75383fc..e16a7fb 100644 --- a/src/user/include/pland/syscall.h +++ b/src/user/include/pland/syscall.h @@ -45,9 +45,16 @@ enum _scn { _SCN_GET_KEY, _SCN_ALLOCATE_RAM, _SCN_MEMORY_INFO, - _SCN_WAIT_FOR_TASK + _SCN_WAIT_FOR_TASK, + _SCN_ENUMERATE_DIR }; +typedef struct { + bool is_dir; + char name[100]; + uint32_t size; +} _dir_info_entry; + static inline uint32_t _sc0(enum _scn eax) { volatile uint32_t out; asm ( @@ -166,4 +173,8 @@ static inline void _wait_for_task(_process_handle_t handle) { _sc1(_SCN_WAIT_FOR_TASK, handle); } +static inline uint32_t _enumerate_dir(_drive_number_t drive_number, const char *path, _dir_info_entry *buffer, uint32_t max_count) { + return _sc4(_SCN_ENUMERATE_DIR, drive_number, (uint32_t)path, (uint32_t)buffer, max_count); +} + #endif
\ No newline at end of file |