yportenv.h 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. /*
  2. * YAFFS: Yet another Flash File System . A NAND-flash specific file system.
  3. *
  4. * Copyright (C) 2002-2010 Aleph One Ltd.
  5. * for Toby Churchill Ltd and Brightstar Engineering
  6. *
  7. * Created by Charles Manning <charles@aleph1.co.uk>
  8. *
  9. * This program is free software; you can redistribute it and/or modify
  10. * it under the terms of the GNU Lesser General Public License version 2.1 as
  11. * published by the Free Software Foundation.
  12. *
  13. * Note: Only YAFFS headers are LGPL, YAFFS C code is covered by GPL.
  14. */
  15. #ifndef __YPORTENV_LINUX_H__
  16. #define __YPORTENV_LINUX_H__
  17. #include <linux/version.h>
  18. #include <linux/kernel.h>
  19. #include <linux/mm.h>
  20. #include <linux/sched.h>
  21. #include <linux/string.h>
  22. #include <linux/slab.h>
  23. #include <linux/vmalloc.h>
  24. #include <linux/xattr.h>
  25. #include <linux/list.h>
  26. #include <linux/types.h>
  27. #include <linux/fs.h>
  28. #include <linux/stat.h>
  29. #include <linux/sort.h>
  30. #include <linux/bitops.h>
  31. #define YCHAR char
  32. #define YUCHAR unsigned char
  33. #define _Y(x) x
  34. #define YAFFS_LOSTNFOUND_NAME "lost+found"
  35. #define YAFFS_LOSTNFOUND_PREFIX "obj"
  36. #define YAFFS_ROOT_MODE 0755
  37. #define YAFFS_LOSTNFOUND_MODE 0700
  38. #define Y_CURRENT_TIME CURRENT_TIME.tv_sec
  39. #define Y_TIME_CONVERT(x) (x).tv_sec
  40. #define compile_time_assertion(assertion) \
  41. ({ int x = __builtin_choose_expr(assertion, 0, (void)0); (void) x; })
  42. #ifndef Y_DUMP_STACK
  43. #define Y_DUMP_STACK() dump_stack()
  44. #endif
  45. #define yaffs_trace(msk, fmt, ...) do { \
  46. if(yaffs_trace_mask & (msk)) \
  47. printk(KERN_DEBUG "yaffs: " fmt "\n", ##__VA_ARGS__); \
  48. } while(0)
  49. #ifndef YBUG
  50. #define YBUG() do {\
  51. yaffs_trace(YAFFS_TRACE_BUG,\
  52. "bug " __FILE__ " %d",\
  53. __LINE__);\
  54. Y_DUMP_STACK();\
  55. } while (0)
  56. #endif
  57. #endif