ydirectenv.h 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. /*
  2. * YAFFS: Yet another Flash File System . A NAND-flash specific file system.
  3. *
  4. * Copyright (C) 2002-2007 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. /*
  16. * ydirectenv.h: Environment wrappers for YAFFS direct.
  17. */
  18. #ifndef __YDIRECTENV_H__
  19. #define __YDIRECTENV_H__
  20. /* Direct interface */
  21. #include "devextras.h"
  22. /* XXX U-BOOT XXX */
  23. #if 0
  24. #include "stdlib.h"
  25. #include "stdio.h"
  26. #include "string.h"
  27. #include "assert.h"
  28. #endif
  29. #include "yaffs_malloc.h"
  30. /* XXX U-BOOT XXX */
  31. #if 0
  32. #define YBUG() assert(1)
  33. #endif
  34. #define YCHAR char
  35. #define YUCHAR unsigned char
  36. #define _Y(x) x
  37. #define yaffs_strcpy(a,b) strcpy(a,b)
  38. #define yaffs_strncpy(a,b,c) strncpy(a,b,c)
  39. #define yaffs_strncmp(a,b,c) strncmp(a,b,c)
  40. #define yaffs_strlen(s) strlen(s)
  41. #define yaffs_sprintf sprintf
  42. #define yaffs_toupper(a) toupper(a)
  43. #ifdef NO_Y_INLINE
  44. #define Y_INLINE
  45. #else
  46. #define Y_INLINE inline
  47. #endif
  48. #define YMALLOC(x) yaffs_malloc(x)
  49. #define YFREE(x) free(x)
  50. #define YMALLOC_ALT(x) yaffs_malloc(x)
  51. #define YFREE_ALT(x) free(x)
  52. #define YMALLOC_DMA(x) yaffs_malloc(x)
  53. #define YYIELD() do {} while(0)
  54. //#define YINFO(s) YPRINTF(( __FILE__ " %d %s\n",__LINE__,s))
  55. //#define YALERT(s) YINFO(s)
  56. #define TENDSTR "\n"
  57. #define TSTR(x) x
  58. #define TOUT(p) printf p
  59. #define YAFFS_LOSTNFOUND_NAME "lost+found"
  60. #define YAFFS_LOSTNFOUND_PREFIX "obj"
  61. //#define YPRINTF(x) printf x
  62. #include "yaffscfg.h"
  63. #define Y_CURRENT_TIME yaffsfs_CurrentTime()
  64. #define Y_TIME_CONVERT(x) x
  65. #define YAFFS_ROOT_MODE 0666
  66. #define YAFFS_LOSTNFOUND_MODE 0666
  67. #define yaffs_SumCompare(x,y) ((x) == (y))
  68. #define yaffs_strcmp(a,b) strcmp(a,b)
  69. #endif