William Juul | c051bbe | 2007-11-15 11:13:05 +0100 | [diff] [blame] | 1 | /* |
Wolfgang Denk | 74e0dde | 2008-08-14 14:41:06 +0200 | [diff] [blame] | 2 | * YAFFS: Yet another Flash File System . A NAND-flash specific file system. |
William Juul | c051bbe | 2007-11-15 11:13:05 +0100 | [diff] [blame] | 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 | /* |
| 17 | * ydirectenv.h: Environment wrappers for YAFFS direct. |
| 18 | */ |
| 19 | |
| 20 | #ifndef __YDIRECTENV_H__ |
| 21 | #define __YDIRECTENV_H__ |
| 22 | |
Wolfgang Denk | 74e0dde | 2008-08-14 14:41:06 +0200 | [diff] [blame] | 23 | /* Direct interface */ |
William Juul | c051bbe | 2007-11-15 11:13:05 +0100 | [diff] [blame] | 24 | |
| 25 | #include "devextras.h" |
| 26 | |
William Juul | e24ebad | 2007-11-15 12:23:57 +0100 | [diff] [blame] | 27 | /* XXX U-BOOT XXX */ |
| 28 | #if 0 |
William Juul | c051bbe | 2007-11-15 11:13:05 +0100 | [diff] [blame] | 29 | #include "stdlib.h" |
| 30 | #include "stdio.h" |
| 31 | #include "string.h" |
William Juul | e24ebad | 2007-11-15 12:23:57 +0100 | [diff] [blame] | 32 | #include "assert.h" |
| 33 | #endif |
William Juul | c051bbe | 2007-11-15 11:13:05 +0100 | [diff] [blame] | 34 | #include "yaffs_malloc.h" |
| 35 | |
William Juul | e24ebad | 2007-11-15 12:23:57 +0100 | [diff] [blame] | 36 | /* XXX U-BOOT XXX */ |
| 37 | #if 0 |
William Juul | c051bbe | 2007-11-15 11:13:05 +0100 | [diff] [blame] | 38 | #define YBUG() assert(1) |
William Juul | e24ebad | 2007-11-15 12:23:57 +0100 | [diff] [blame] | 39 | #endif |
William Juul | c051bbe | 2007-11-15 11:13:05 +0100 | [diff] [blame] | 40 | |
| 41 | #define YCHAR char |
| 42 | #define YUCHAR unsigned char |
| 43 | #define _Y(x) x |
| 44 | #define yaffs_strcpy(a,b) strcpy(a,b) |
| 45 | #define yaffs_strncpy(a,b,c) strncpy(a,b,c) |
| 46 | #define yaffs_strncmp(a,b,c) strncmp(a,b,c) |
| 47 | #define yaffs_strlen(s) strlen(s) |
| 48 | #define yaffs_sprintf sprintf |
| 49 | #define yaffs_toupper(a) toupper(a) |
| 50 | |
| 51 | #ifdef NO_Y_INLINE |
| 52 | #define Y_INLINE |
| 53 | #else |
| 54 | #define Y_INLINE inline |
| 55 | #endif |
| 56 | |
| 57 | #define YMALLOC(x) yaffs_malloc(x) |
| 58 | #define YFREE(x) free(x) |
| 59 | #define YMALLOC_ALT(x) yaffs_malloc(x) |
| 60 | #define YFREE_ALT(x) free(x) |
| 61 | |
| 62 | #define YMALLOC_DMA(x) yaffs_malloc(x) |
| 63 | |
| 64 | #define YYIELD() do {} while(0) |
| 65 | |
| 66 | |
| 67 | |
| 68 | //#define YINFO(s) YPRINTF(( __FILE__ " %d %s\n",__LINE__,s)) |
| 69 | //#define YALERT(s) YINFO(s) |
| 70 | |
| 71 | |
| 72 | #define TENDSTR "\n" |
| 73 | #define TSTR(x) x |
| 74 | #define TOUT(p) printf p |
| 75 | |
| 76 | |
| 77 | #define YAFFS_LOSTNFOUND_NAME "lost+found" |
| 78 | #define YAFFS_LOSTNFOUND_PREFIX "obj" |
| 79 | //#define YPRINTF(x) printf x |
| 80 | |
| 81 | #include "yaffscfg.h" |
| 82 | |
| 83 | #define Y_CURRENT_TIME yaffsfs_CurrentTime() |
| 84 | #define Y_TIME_CONVERT(x) x |
| 85 | |
| 86 | #define YAFFS_ROOT_MODE 0666 |
| 87 | #define YAFFS_LOSTNFOUND_MODE 0666 |
| 88 | |
| 89 | #define yaffs_SumCompare(x,y) ((x) == (y)) |
| 90 | #define yaffs_strcmp(a,b) strcmp(a,b) |
| 91 | |
| 92 | #endif |