X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs2.git;a=blobdiff_plain;f=direct%2Fydirectenv.h;h=dcf58d03ed4102516a20641249d484d64cf5b649;hp=eff8ff93f194e7f9b23cd79dd5c7f7e86c578abb;hb=HEAD;hpb=07353dd87a46afc753441028af8f5e8629b13bdc diff --git a/direct/ydirectenv.h b/direct/ydirectenv.h index eff8ff9..ae2e23c 100644 --- a/direct/ydirectenv.h +++ b/direct/ydirectenv.h @@ -1,8 +1,7 @@ /* * YAFFS: Yet another Flash File System . A NAND-flash specific file system. * - * Copyright (C) 2002-2011 Aleph One Ltd. - * for Toby Churchill Ltd and Brightstar Engineering + * Copyright (C) 2002-2018 Aleph One Ltd. * * Created by Charles Manning * @@ -30,11 +29,23 @@ void yaffs_bug_fn(const char *file_name, int line_no); #define BUG() do { yaffs_bug_fn(__FILE__, __LINE__); } while (0) +#ifdef CONFIG_YAFFS_USE_32_BIT_TIME_T + #define YTIME_T u32 +#else + #define YTIME_T u64 +#endif #define YCHAR char #define YUCHAR unsigned char #define _Y(x) x +#ifndef Y_LOFF_T +#define Y_LOFF_T loff_t +#endif + +/* Some RTOSs (eg. VxWorks) need strnlen. */ +size_t strnlen(const char *s, size_t maxlen); + #define yaffs_strcat(a, b) strcat(a, b) #define yaffs_strcpy(a, b) strcpy(a, b) #define yaffs_strncpy(a, b, c) strncpy(a, b, c) @@ -50,10 +61,7 @@ void yaffs_bug_fn(const char *file_name, int line_no); #define hweight8(x) yaffs_hweight8(x) #define hweight32(x) yaffs_hweight32(x) -void yaffs_qsort(void *aa, size_t n, size_t es, - int (*cmp)(const void *, const void *)); - -#define sort(base, n, sz, cmp_fn, swp) yaffs_qsort(base, n, sz, cmp_fn) +#define sort(base, n, sz, cmp_fn, swp) qsort(base, n, sz, cmp_fn) #define YAFFS_PATH_DIVIDERS "/" @@ -70,11 +78,15 @@ void yaffs_qsort(void *aa, size_t n, size_t es, #define cond_resched() do {} while (0) +#ifdef CONFIG_YAFFS_NO_TRACE +#define yaffs_trace(...) do { } while (0) +#else #define yaffs_trace(msk, fmt, ...) do { \ if (yaffs_trace_mask & (msk)) \ printf("yaffs: " fmt "\n", ##__VA_ARGS__); \ } while (0) +#endif #define YAFFS_LOSTNFOUND_NAME "lost+found" #define YAFFS_LOSTNFOUND_PREFIX "obj"