Skip to content

Commit 62bdb28

Browse files
dhowellstorvalds
authored andcommitted
MN10300: Handle missing sys_cacheflush() when caching disabled
When caching is disabled on the MN10300 arch, the sys_cacheflush() function is removed by conditional stuff in the makefiles, but is still referred to by the syscall table. Provide a null version that just returns 0 when caching is disabled (or -EINVAL if the arguments are silly). Signed-off-by: David Howells <dhowells@redhat.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent 0f44fbd commit 62bdb28

File tree

2 files changed

+27
-8
lines changed

2 files changed

+27
-8
lines changed

arch/mn10300/mm/Makefile

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,11 @@
22
# Makefile for the MN10300-specific memory management code
33
#
44

5+
cacheflush-y := cache.o cache-mn10300.o
6+
cacheflush-$(CONFIG_MN10300_CACHE_WBACK) += cache-flush-mn10300.o
7+
8+
cacheflush-$(CONFIG_MN10300_CACHE_DISABLED) := cache-disabled.o
9+
510
obj-y := \
611
init.o fault.o pgtable.o extable.o tlb-mn10300.o mmu-context.o \
7-
misalignment.o dma-alloc.o
8-
9-
ifneq ($(CONFIG_MN10300_CACHE_DISABLED),y)
10-
obj-y += cache.o cache-mn10300.o
11-
ifeq ($(CONFIG_MN10300_CACHE_WBACK),y)
12-
obj-y += cache-flush-mn10300.o
13-
endif
14-
endif
12+
misalignment.o dma-alloc.o $(cacheflush-y)

arch/mn10300/mm/cache-disabled.c

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
/* Handle the cache being disabled
2+
*
3+
* Copyright (C) 2010 Red Hat, Inc. All Rights Reserved.
4+
* Written by David Howells (dhowells@redhat.com)
5+
*
6+
* This program is free software; you can redistribute it and/or
7+
* modify it under the terms of the GNU General Public Licence
8+
* as published by the Free Software Foundation; either version
9+
* 2 of the Licence, or (at your option) any later version.
10+
*/
11+
#include <linux/mm.h>
12+
13+
/*
14+
* allow userspace to flush the instruction cache
15+
*/
16+
asmlinkage long sys_cacheflush(unsigned long start, unsigned long end)
17+
{
18+
if (end < start)
19+
return -EINVAL;
20+
return 0;
21+
}

0 commit comments

Comments
 (0)