1 /* Public domain. */ 2 3 #ifndef _LINUX_DEVICE_H 4 #define _LINUX_DEVICE_H 5 6 #include <sys/types.h> 7 #include <sys/systm.h> 8 #include <sys/device.h> 9 #include <sys/param.h> 10 #include <sys/proc.h> 11 #include <linux/slab.h> 12 #include <linux/ioport.h> 13 #include <linux/lockdep.h> 14 #include <linux/pm.h> 15 16 struct device_node; 17 18 struct device_driver { 19 struct device *dev; 20 }; 21 22 struct device_attribute { 23 }; 24 25 #define DEVICE_ATTR(_name, _mode, _show, _store) \ 26 struct device_attribute dev_attr_##_name 27 28 #define device_create_file(a, b) 0 29 #define device_remove_file(a, b) 30 31 #define dev_get_drvdata(x) NULL 32 #define dev_set_drvdata(x, y) 33 #define dev_name(dev) "" 34 35 #define dev_pm_set_driver_flags(x, y) 36 37 #define devm_kzalloc(x, y, z) kzalloc(y, z) 38 39 #define dev_warn(dev, fmt, arg...) \ 40 printf("drm:pid%d:%s *WARNING* " fmt, curproc->p_p->ps_pid, \ 41 __func__ , ## arg) 42 #define dev_notice(dev, fmt, arg...) \ 43 printf("drm:pid%d:%s *NOTICE* " fmt, curproc->p_p->ps_pid, \ 44 __func__ , ## arg) 45 #define dev_crit(dev, fmt, arg...) \ 46 printf("drm:pid%d:%s *ERROR* " fmt, curproc->p_p->ps_pid, \ 47 __func__ , ## arg) 48 #define dev_err(dev, fmt, arg...) \ 49 printf("drm:pid%d:%s *ERROR* " fmt, curproc->p_p->ps_pid, \ 50 __func__ , ## arg) 51 #define dev_printk(level, dev, fmt, arg...) \ 52 printf("drm:pid%d:%s *PRINTK* " fmt, curproc->p_p->ps_pid, \ 53 __func__ , ## arg) 54 55 #ifdef DRMDEBUG 56 #define dev_info(dev, fmt, arg...) \ 57 printf("drm: " fmt, ## arg) 58 #define dev_dbg(dev, fmt, arg...) \ 59 printf("drm:pid%d:%s *DEBUG* " fmt, curproc->p_p->ps_pid, \ 60 __func__ , ## arg) 61 #else 62 #define dev_info(dev, fmt, arg...) \ 63 do { } while(0) 64 #define dev_dbg(dev, fmt, arg...) \ 65 do { } while(0) 66 #endif 67 68 #endif 69