1 #include <errno.h> 2 #include <fcntl.h> 3 #include <stdio.h> 4 #include <unistd.h> 5 6 #include <drivers/device_manager.h> 7 #include <generic_syscall.h> 8 #include <string.h> 9 #include <syscalls.h> 10 11 #include "dm_wrapper.h" 12 13 14 status_t init_dm_wrapper(void) 15 { 16 uint32 version = 0; 17 return _kern_generic_syscall(DEVICE_MANAGER_SYSCALLS, B_SYSCALL_INFO, &version, sizeof(version)); 18 } 19 20 status_t uninit_dm_wrapper(void) 21 { 22 return B_OK; 23 } 24 25 status_t 26 get_root(uint32 *cookie) 27 { 28 return _kern_generic_syscall(DEVICE_MANAGER_SYSCALLS, DM_GET_ROOT, cookie, sizeof(uint32)); 29 } 30 31 status_t 32 get_child(uint32 *device) 33 { 34 return _kern_generic_syscall(DEVICE_MANAGER_SYSCALLS, DM_GET_CHILD, device, sizeof(uint32)); 35 } 36 37 status_t 38 get_next_child(uint32 *device) 39 { 40 return _kern_generic_syscall(DEVICE_MANAGER_SYSCALLS, DM_GET_NEXT_CHILD, device, sizeof(uint32)); 41 } 42 43 status_t 44 dm_get_next_attr(struct dev_attr *attr) 45 { 46 return _kern_generic_syscall(DEVICE_MANAGER_SYSCALLS, DM_GET_NEXT_ATTRIBUTE, attr, sizeof(struct dev_attr)); 47 } 48 49