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 <device_manager_defs.h> 8 #include <generic_syscall_defs.h> 9 #include <string.h> 10 #include <syscalls.h> 11 12 #include "dm_wrapper.h" 13 14 15 status_t init_dm_wrapper(void) 16 { 17 uint32 version = 0; 18 return _kern_generic_syscall(DEVICE_MANAGER_SYSCALLS, B_SYSCALL_INFO, &version, sizeof(version)); 19 } 20 21 status_t uninit_dm_wrapper(void) 22 { 23 return B_OK; 24 } 25 26 status_t 27 get_root(device_node_cookie *cookie) 28 { 29 return _kern_generic_syscall(DEVICE_MANAGER_SYSCALLS, DM_GET_ROOT, cookie, sizeof(device_node_cookie)); 30 } 31 32 status_t 33 get_child(device_node_cookie *device) 34 { 35 return _kern_generic_syscall(DEVICE_MANAGER_SYSCALLS, DM_GET_CHILD, device, sizeof(device_node_cookie)); 36 } 37 38 status_t 39 get_next_child(device_node_cookie *device) 40 { 41 return _kern_generic_syscall(DEVICE_MANAGER_SYSCALLS, DM_GET_NEXT_CHILD, device, sizeof(device_node_cookie)); 42 } 43 44 status_t 45 dm_get_next_attr(struct device_attr_info *attr) 46 { 47 return _kern_generic_syscall(DEVICE_MANAGER_SYSCALLS, DM_GET_NEXT_ATTRIBUTE, attr, sizeof(struct device_attr_info)); 48 } 49 50