cregit-Linux how code gets into the kernel

Release 4.14 arch/sh/mm/cache-sh2.c

Directory: arch/sh/mm
/*
 * arch/sh/mm/cache-sh2.c
 *
 * Copyright (C) 2002 Paul Mundt
 * Copyright (C) 2008 Yoshinori Sato
 *
 * Released under the terms of the GNU GPL v2.0.
 */

#include <linux/init.h>
#include <linux/mm.h>

#include <asm/cache.h>
#include <asm/addrspace.h>
#include <asm/processor.h>
#include <asm/cacheflush.h>
#include <asm/io.h>


static void sh2__flush_wback_region(void *start, int size) { unsigned long v; unsigned long begin, end; begin = (unsigned long)start & ~(L1_CACHE_BYTES-1); end = ((unsigned long)start + size + L1_CACHE_BYTES-1) & ~(L1_CACHE_BYTES-1); for (v = begin; v < end; v+=L1_CACHE_BYTES) { unsigned long addr = CACHE_OC_ADDRESS_ARRAY | (v & 0x00000ff0); int way; for (way = 0; way < 4; way++) { unsigned long data = __raw_readl(addr | (way << 12)); if ((data & CACHE_PHYSADDR_MASK) == (v & CACHE_PHYSADDR_MASK)) { data &= ~SH_CACHE_UPDATED; __raw_writel(data, addr | (way << 12)); } } } }

Contributors

PersonTokensPropCommitsCommitProp
Yoshinori Sato14693.59%240.00%
Paul Mundt106.41%360.00%
Total156100.00%5100.00%


static void sh2__flush_purge_region(void *start, int size) { unsigned long v; unsigned long begin, end; begin = (unsigned long)start & ~(L1_CACHE_BYTES-1); end = ((unsigned long)start + size + L1_CACHE_BYTES-1) & ~(L1_CACHE_BYTES-1); for (v = begin; v < end; v+=L1_CACHE_BYTES) __raw_writel((v & CACHE_PHYSADDR_MASK), CACHE_OC_ADDRESS_ARRAY | (v & 0x00000ff0) | 0x00000008); }

Contributors

PersonTokensPropCommitsCommitProp
Yoshinori Sato8186.17%240.00%
Paul Mundt1313.83%360.00%
Total94100.00%5100.00%


static void sh2__flush_invalidate_region(void *start, int size) { #ifdef CONFIG_CACHE_WRITEBACK /* * SH-2 does not support individual line invalidation, only a * global invalidate. */ unsigned long ccr; unsigned long flags; local_irq_save(flags); jump_to_uncached(); ccr = __raw_readl(SH_CCR); ccr |= CCR_CACHE_INVALIDATE; __raw_writel(ccr, SH_CCR); back_to_cached(); local_irq_restore(flags); #else unsigned long v; unsigned long begin, end; begin = (unsigned long)start & ~(L1_CACHE_BYTES-1); end = ((unsigned long)start + size + L1_CACHE_BYTES-1) & ~(L1_CACHE_BYTES-1); for (v = begin; v < end; v+=L1_CACHE_BYTES) __raw_writel((v & CACHE_PHYSADDR_MASK), CACHE_OC_ADDRESS_ARRAY | (v & 0x00000ff0) | 0x00000008); #endif }

Contributors

PersonTokensPropCommitsCommitProp
Yoshinori Sato12586.81%233.33%
Paul Mundt1711.81%350.00%
Geert Uytterhoeven21.39%116.67%
Total144100.00%6100.00%


void __init sh2_cache_init(void) { __flush_wback_region = sh2__flush_wback_region; __flush_purge_region = sh2__flush_purge_region; __flush_invalidate_region = sh2__flush_invalidate_region; }

Contributors

PersonTokensPropCommitsCommitProp
Paul Mundt20100.00%1100.00%
Total20100.00%1100.00%


Overall Contributors

PersonTokensPropCommitsCommitProp
Yoshinori Sato35380.96%233.33%
Paul Mundt8118.58%350.00%
Geert Uytterhoeven20.46%116.67%
Total436100.00%6100.00%
Directory: arch/sh/mm
Information contained on this website is for historical information purposes only and does not indicate or represent copyright ownership.
Created with cregit.