kernel.h 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. #ifndef __LINUX_KERNEL_H__
  2. #define __LINUX_KERNEL_H__
  3. //#include <cyg/infra/diag.h>
  4. //#include <stdio.h> //mod by prife @ 2011/11/20
  5. #define jiffies 100
  6. #define ERR_PTR(err) ((void*)(err))
  7. #define PTR_ERR(err) ((unsigned long)(err))
  8. #define IS_ERR(err) ((unsigned long)err > (unsigned long)-1000L)
  9. #define CURRENT_TIME cyg_timestamp()
  10. #define KERN_EMERG "<0>" // system is unusable
  11. #define KERN_ALERT "<1>" // action must be taken immediately
  12. #define KERN_CRIT "<2>" // critical conditions
  13. #define KERN_ERR "<3>" // error conditions
  14. #define KERN_WARNING "<4>" // warning conditions
  15. #define KERN_NOTICE "<5>" // normal but significant condition
  16. #define KERN_INFO "<6>" // informational
  17. #define KERN_DEBUG "<7>" // debug-level messages
  18. #define printk rt_kprintf//diag_printf //mod by prife
  19. #ifndef min //mod by prife
  20. #define min(x,y) (x<y?x:y)
  21. #endif
  22. #ifndef max
  23. #define max(x,y) (x<y?y:x)
  24. #endif
  25. #define min_t(t, x,y) ((t)x<(t)y?(t)x:(t)y)
  26. #endif /* __LINUX_KERNEL_H__ */