#define __UBOOT_UBI_H
#include <common.h>
+#include <compiler.h>
#include <malloc.h>
#include <div64.h>
#include <linux/crc32.h>
+#include <linux/types.h>
+#include <linux/list.h>
+#include <linux/rbtree.h>
+#include <linux/string.h>
#include <linux/mtd/mtd.h>
+#include <linux/mtd/ubi.h>
#ifdef CONFIG_CMD_ONENAND
#include <onenand_uboot.h>
#undef CONFIG_MTD_UBI_DEBUG_MSG_BLD
#define CONFIG_MTD_UBI_DEBUG_DISABLE_BGT
-/* compiler options */
-#define uninitialized_var(x) x = x
-
/* build.c */
#define get_device(...)
#define put_device(...)
#define ubi_sysfs_close(...) do { } while (0)
static inline int is_power_of_2(unsigned long n)
{
- return (n != 0 && ((n & (n - 1)) == 0));
+ return (n != 0 && ((n & (n - 1)) == 0));
}
/* FIXME */
#define init_rwsem(...) do { } while (0)
#define down_read(...) do { } while (0)
#define down_write(...) do { } while (0)
-#define down_write_trylock(...) 0
+#define down_write_trylock(...) 1
#define up_read(...) do { } while (0)
#define up_write(...) do { } while (0)
return IS_ERR_VALUE((unsigned long)ptr);
}
-/* Force a compilation error if condition is true */
-#define BUILD_BUG_ON(condition) ((void)sizeof(char[1 - 2*!!(condition)]))
-
/* module */
#define THIS_MODULE 0
-#define try_module_get(...) 0
+#define try_module_get(...) 1
#define module_put(...) do { } while (0)
#define module_init(...)
#define module_exit(...)
#define MODULE_AUTHOR(...)
#define MODULE_LICENSE(...)
+#ifndef __UBIFS_H__
#include "../drivers/mtd/ubi/ubi.h"
+#endif
/* functions */
extern int ubi_mtd_param_parse(const char *val, struct kernel_param *kp);