// SPDX-License-Identifier: GPL-2.01// Copyright (C) 2018 Hangzhou C-SKY Microsystems co.,ltd.23#include <linux/syscalls.h>4#include <asm/page.h>5#include <asm/cacheflush.h>6#include <asm/cachectl.h>78SYSCALL_DEFINE3(cacheflush,9void __user *, addr,10unsigned long, bytes,11int, cache)12{13switch (cache) {14case BCACHE:15case DCACHE:16dcache_wb_range((unsigned long)addr,17(unsigned long)addr + bytes);18if (cache != BCACHE)19break;20fallthrough;21case ICACHE:22flush_icache_mm_range(current->mm,23(unsigned long)addr,24(unsigned long)addr + bytes);25break;26default:27return -EINVAL;28}2930return 0;31}323334