1 // kernel_emu.h 2 3 #include <stdarg.h> 4 5 #include <OS.h> 6 7 struct selectsync; 8 9 namespace UserlandFS { 10 namespace KernelEmu { 11 12 typedef void* fs_vnode; 13 14 int new_path(const char *path, char **copy); 15 void free_path(char *p); 16 17 status_t notify_listener(int32 operation, uint32 details, dev_t device, 18 ino_t oldDirectory, ino_t directory, ino_t node, 19 const char* oldName, const char* name); 20 status_t notify_select_event(selectsync *sync, uint8 event, 21 bool unspecifiedEvent); 22 status_t notify_query(port_id port, int32 token, int32 operation, 23 dev_t device, ino_t directory, const char* name, ino_t node); 24 25 status_t get_vnode(dev_t nsid, ino_t vnid, fs_vnode* data); 26 status_t put_vnode(dev_t nsid, ino_t vnid); 27 status_t new_vnode(dev_t nsid, ino_t vnid, fs_vnode data); 28 status_t publish_vnode(dev_t nsid, ino_t vnid, fs_vnode data); 29 status_t remove_vnode(dev_t nsid, ino_t vnid); 30 status_t unremove_vnode(dev_t nsid, ino_t vnid); 31 status_t get_vnode_removed(dev_t nsid, ino_t vnid, bool* removed); 32 33 void kernel_debugger(const char *message); 34 void vpanic(const char *format, va_list args); 35 void panic(const char *format, ...) __attribute__ ((format (__printf__, 1, 2))); 36 37 void vdprintf(const char *format, va_list args); 38 void dprintf(const char *format, ...) 39 __attribute__ ((format (__printf__, 1, 2))); 40 41 void dump_block(const char *buffer, int size, const char *prefix); 42 43 int add_debugger_command(char *name, int (*func)(int argc, char **argv), 44 char *help); 45 int remove_debugger_command(char *name, int (*func)(int argc, char **argv)); 46 uint32 parse_expression(const char *string); 47 48 thread_id spawn_kernel_thread(thread_entry function, const char *threadName, 49 long priority, void *arg); 50 51 52 } // namespace KernelEmu 53 } // namespace UserlandFS 54 55