1 // kernel_emu.h 2 3 #include <stdarg.h> 4 5 #include <OS.h> 6 7 #include "FSCapabilities.h" 8 9 10 struct selectsync; 11 struct file_io_vec; 12 13 namespace UserlandFS { 14 namespace KernelEmu { 15 16 int new_path(const char *path, char **copy); 17 void free_path(char *p); 18 19 status_t notify_listener(int32 operation, uint32 details, dev_t device, 20 ino_t oldDirectory, ino_t directory, ino_t node, 21 const char* oldName, const char* name); 22 status_t notify_select_event(selectsync *sync, uint8 event, 23 bool unspecifiedEvent); 24 status_t notify_query(port_id port, int32 token, int32 operation, 25 dev_t device, ino_t directory, const char* name, ino_t node); 26 27 status_t get_vnode(dev_t nsid, ino_t vnid, void** node); 28 status_t put_vnode(dev_t nsid, ino_t vnid); 29 status_t acquire_vnode(dev_t nsid, ino_t vnodeID); 30 status_t new_vnode(dev_t nsid, ino_t vnid, void* data, 31 const FSVNodeCapabilities& capabilities); 32 status_t publish_vnode(dev_t nsid, ino_t vnid, void* data, int type, 33 uint32 flags, const FSVNodeCapabilities& capabilities); 34 status_t publish_vnode(dev_t nsid, ino_t vnid, void* data, 35 const FSVNodeCapabilities& capabilities); 36 status_t remove_vnode(dev_t nsid, ino_t vnid); 37 status_t unremove_vnode(dev_t nsid, ino_t vnid); 38 status_t get_vnode_removed(dev_t nsid, ino_t vnid, bool* removed); 39 40 status_t file_cache_create(dev_t mountID, ino_t vnodeID, off_t size); 41 status_t file_cache_delete(dev_t mountID, ino_t vnodeID); 42 status_t file_cache_set_enabled(dev_t mountID, ino_t vnodeID, bool enabled); 43 status_t file_cache_set_size(dev_t mountID, ino_t vnodeID, off_t size); 44 status_t file_cache_sync(dev_t mountID, ino_t vnodeID); 45 46 status_t file_cache_read(dev_t mountID, ino_t vnodeID, void *cookie, 47 off_t offset, void *bufferBase, size_t *_size); 48 status_t file_cache_write(dev_t mountID, ino_t vnodeID, void *cookie, 49 off_t offset, const void *buffer, size_t *_size); 50 51 status_t do_iterative_fd_io(dev_t volumeID, int fd, int32 requestID, 52 void* cookie, const file_io_vec* vecs, uint32 vecCount); 53 54 void kernel_debugger(const char *message); 55 void vpanic(const char *format, va_list args); 56 void panic(const char *format, ...) __attribute__ ((format (__printf__, 1, 2))); 57 58 void vdprintf(const char *format, va_list args); 59 void dprintf(const char *format, ...) 60 __attribute__ ((format (__printf__, 1, 2))); 61 62 void dump_block(const char *buffer, int size, const char *prefix); 63 64 int add_debugger_command(char *name, int (*func)(int argc, char **argv), 65 char *help); 66 int remove_debugger_command(char *name, int (*func)(int argc, char **argv)); 67 uint32 parse_expression(const char *string); 68 69 thread_id spawn_kernel_thread(thread_entry function, const char *threadName, 70 long priority, void *arg); 71 72 73 } // namespace KernelEmu 74 } // namespace UserlandFS 75 76