cache.h 1.3 KB
Newer Older
L
Linus Torvalds 已提交
1 2 3 4 5 6 7 8 9 10 11
/* $Id: cache.h,v 1.6 2004/03/11 18:08:05 lethal Exp $
 *
 * include/asm-sh/cache.h
 *
 * Copyright 1999 (C) Niibe Yutaka
 * Copyright 2002, 2003 (C) Paul Mundt
 */
#ifndef __ASM_SH_CACHE_H
#define __ASM_SH_CACHE_H
#ifdef __KERNEL__

12
#include <linux/init.h>
L
Linus Torvalds 已提交
13 14 15 16 17 18 19 20 21
#include <asm/cpu/cache.h>

#define SH_CACHE_VALID		1
#define SH_CACHE_UPDATED	2
#define SH_CACHE_COMBINED	4
#define SH_CACHE_ASSOC		8

#define L1_CACHE_BYTES		(1 << L1_CACHE_SHIFT)

22
#ifndef __ASSEMBLY__
L
Linus Torvalds 已提交
23
struct cache_info {
24 25 26
	unsigned int ways;		/* Number of cache ways */
	unsigned int sets;		/* Number of cache sets */
	unsigned int linesz;		/* Cache line size (bytes) */
L
Linus Torvalds 已提交
27

28
	unsigned int way_size;		/* sets * line size */
L
Linus Torvalds 已提交
29

30 31 32 33 34
	/*
	 * way_incr is the address offset for accessing the next way
	 * in memory mapped cache array ops.
	 */
	unsigned int way_incr;
L
Linus Torvalds 已提交
35 36 37
	unsigned int entry_shift;
	unsigned int entry_mask;

38 39 40 41 42 43 44 45 46
	/*
	 * Compute a mask which selects the address bits which overlap between
	 * 1. those used to select the cache set during indexing
	 * 2. those in the physical page number.
	 */
	unsigned int alias_mask;

	unsigned int n_aliases;		/* Number of aliases */

L
Linus Torvalds 已提交
47 48
	unsigned long flags;
};
49 50 51

int __init detect_cpu_and_cache_system(void);

52
#endif /* __ASSEMBLY__ */
L
Linus Torvalds 已提交
53 54
#endif /* __KERNEL__ */
#endif /* __ASM_SH_CACHE_H */