Home | History | Annotate | Download | only in direct
      1 /*
      2  * YAFFS: Yet another FFS. A NAND-flash specific file system.
      3  * ydirectenv.h: Environment wrappers for direct.
      4  *
      5  * Copyright (C) 2002 Aleph One Ltd.
      6  *   for Toby Churchill Ltd and Brightstar Engineering
      7  *
      8  * Created by Charles Manning <charles (at) aleph1.co.uk>
      9  *
     10  * This program is free software; you can redistribute it and/or modify
     11  * it under the terms of the GNU Lesser General Public License version 2.1 as
     12  * published by the Free Software Foundation.
     13  *
     14  *
     15  * Note: Only YAFFS headers are LGPL, YAFFS C code is covered by GPL.
     16  *
     17  * $Id: ydirectenv.h,v 1.4 2006/10/03 10:13:03 charles Exp $
     18  *
     19  */
     20 
     21 #ifndef __YDIRECTENV_H__
     22 #define __YDIRECTENV_H__
     23 
     24 // Direct interface
     25 
     26 #include "devextras.h"
     27 
     28 #include "stdlib.h"
     29 #include "stdio.h"
     30 #include "string.h"
     31 
     32 #define YCHAR char
     33 #define YUCHAR unsigned char
     34 #define _Y(x) x
     35 #define yaffs_strcpy(a,b)    strcpy(a,b)
     36 #define yaffs_strncpy(a,b,c) strncpy(a,b,c)
     37 #define yaffs_strlen(s)	     strlen(s)
     38 #define yaffs_sprintf	     sprintf
     39 #define yaffs_toupper(a)     toupper(a)
     40 
     41 #ifdef NO_Y_INLINE
     42 #define Y_INLINE
     43 #else
     44 #define Y_INLINE inline
     45 #endif
     46 
     47 #define YMALLOC(x) malloc(x)
     48 #define YFREE(x)   free(x)
     49 #define YMALLOC_ALT(x) malloc(x)
     50 #define YFREE_ALT(x)   free(x)
     51 
     52 #define YMALLOC_DMA(x) malloc(x)
     53 
     54 #define YYIELD()  do {} while(0)
     55 
     56 
     57 
     58 //#define YINFO(s) YPRINTF(( __FILE__ " %d %s\n",__LINE__,s))
     59 //#define YALERT(s) YINFO(s)
     60 
     61 
     62 #define TENDSTR "\n"
     63 #define TSTR(x) x
     64 #define TOUT(p) printf p
     65 
     66 
     67 #define YAFFS_LOSTNFOUND_NAME		"lost+found"
     68 #define YAFFS_LOSTNFOUND_PREFIX		"obj"
     69 //#define YPRINTF(x) printf x
     70 
     71 #include "yaffscfg.h"
     72 
     73 #define Y_CURRENT_TIME yaffsfs_CurrentTime()
     74 #define Y_TIME_CONVERT(x) x
     75 
     76 #define YAFFS_ROOT_MODE				0666
     77 #define YAFFS_LOSTNFOUND_MODE		0666
     78 
     79 #define yaffs_SumCompare(x,y) ((x) == (y))
     80 #define yaffs_strcmp(a,b) strcmp(a,b)
     81 
     82 #endif
     83 
     84 
     85