/*1* Copyright 2010 Tilera Corporation. All Rights Reserved.2*3* This program is free software; you can redistribute it and/or4* modify it under the terms of the GNU General Public License5* as published by the Free Software Foundation, version 2.6*7* This program is distributed in the hope that it will be useful, but8* WITHOUT ANY WARRANTY; without even the implied warranty of9* MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or10* NON INFRINGEMENT. See the GNU General Public License for11* more details.12*/1314#ifndef _ASM_TILE_CACHE_H15#define _ASM_TILE_CACHE_H1617#include <arch/chip.h>1819/* bytes per L1 data cache line */20#define L1_CACHE_SHIFT CHIP_L1D_LOG_LINE_SIZE()21#define L1_CACHE_BYTES (1 << L1_CACHE_SHIFT)2223/* bytes per L2 cache line */24#define L2_CACHE_SHIFT CHIP_L2_LOG_LINE_SIZE()25#define L2_CACHE_BYTES (1 << L2_CACHE_SHIFT)26#define L2_CACHE_ALIGN(x) (((x)+(L2_CACHE_BYTES-1)) & -L2_CACHE_BYTES)2728/*29* TILE-Gx is fully coherent so we don't need to define ARCH_DMA_MINALIGN.30*/31#ifndef __tilegx__32#define ARCH_DMA_MINALIGN L2_CACHE_BYTES33#endif3435/* use the cache line size for the L2, which is where it counts */36#define SMP_CACHE_BYTES_SHIFT L2_CACHE_SHIFT37#define SMP_CACHE_BYTES L2_CACHE_BYTES38#define INTERNODE_CACHE_SHIFT L2_CACHE_SHIFT39#define INTERNODE_CACHE_BYTES L2_CACHE_BYTES4041/* Group together read-mostly things to avoid cache false sharing */42#define __read_mostly __attribute__((__section__(".data..read_mostly")))4344/*45* Attribute for data that is kept read/write coherent until the end of46* initialization, then bumped to read/only incoherent for performance.47*/48#define __write_once __attribute__((__section__(".w1data")))4950#endif /* _ASM_TILE_CACHE_H */515253