@@ -836,7 +836,7 @@ static init_fnc_t init_sequence_r[] = {
#if defined(CONFIG_PRAM)
initr_mem,
#endif
-#if defined(CONFIG_M68K) && defined(CONFIG_BLOCK_CACHE)
+#if defined(CONFIG_NEEDS_MANUAL_RELOC) && defined(CONFIG_BLOCK_CACHE)
blkcache_init,
#endif
run_main_loop,
@@ -12,6 +12,8 @@
#include <linux/ctype.h>
#include <linux/list.h>
+DECLARE_GLOBAL_DATA_PTR;
+
struct block_cache_node {
struct list_head lh;
int iftype;
@@ -22,21 +24,20 @@ struct block_cache_node {
char *cache;
};
-#ifndef CONFIG_M68K
static LIST_HEAD(block_cache);
-#else
-static struct list_head block_cache;
-#endif
static struct block_cache_stats _stats = {
.max_blocks_per_entry = 8,
.max_entries = 32
};
-#ifdef CONFIG_M68K
+#ifdef CONFIG_NEEDS_MANUAL_RELOC
int blkcache_init(void)
{
- INIT_LIST_HEAD(&block_cache);
+ struct list_head *head = &block_cache;
+
+ head->next = (uintptr_t)head->next + gd->reloc_off;
+ head->prev = (uintptr_t)head->prev + gd->reloc_off;
return 0;
}