aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--common/board_r.c3
-rw-r--r--drivers/block/blkcache.c9
-rw-r--r--include/blk.h6
3 files changed, 17 insertions, 1 deletions
diff --git a/common/board_r.c b/common/board_r.c
index 8a0c111..4f56c19 100644
--- a/common/board_r.c
+++ b/common/board_r.c
@@ -865,6 +865,9 @@ static init_fnc_t init_sequence_r[] = {
#if defined(CONFIG_PRAM)
initr_mem,
#endif
+#ifdef CONFIG_BLOCK_CACHE
+ blkcache_init,
+#endif
run_main_loop,
};
diff --git a/drivers/block/blkcache.c b/drivers/block/blkcache.c
index 1fa6498..f603aa1 100644
--- a/drivers/block/blkcache.c
+++ b/drivers/block/blkcache.c
@@ -21,13 +21,20 @@ struct block_cache_node {
char *cache;
};
-static LIST_HEAD(block_cache);
+static struct list_head block_cache;
static struct block_cache_stats _stats = {
.max_blocks_per_entry = 8,
.max_entries = 32
};
+int blkcache_init(void)
+{
+ INIT_LIST_HEAD(&block_cache);
+
+ return 0;
+}
+
static struct block_cache_node *cache_find(int iftype, int devnum,
lbaint_t start, lbaint_t blkcnt,
unsigned long blksz)
diff --git a/include/blk.h b/include/blk.h
index d0c033a..65db69f 100644
--- a/include/blk.h
+++ b/include/blk.h
@@ -113,6 +113,12 @@ struct blk_desc {
(PAD_SIZE(size, blk_desc->blksz))
#if CONFIG_IS_ENABLED(BLOCK_CACHE)
+
+/**
+ * blkcache_init() - initialize the block cache list pointers
+ */
+int blkcache_init(void);
+
/**
* blkcache_read() - attempt to read a set of blocks from cache
*