aboutsummaryrefslogtreecommitdiffstats
blob: 2f452da63ee63cc47c6ddcc18bf545151c952ef7 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
/*
 * cache-2dmanager.h
 *
 * Copyright (C) 2011-2012 Texas Instruments Corporation.
 *
 * This package is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 as
 * published by the Free Software Foundation.
 *
 * THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
 * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
 * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
 */

#ifndef CACHE_2DMANAGER_H_
#define CACHE_2DMANAGER_H_

#include "slab.h"

#ifdef CONFIG_ARCH_OMAP4
#define L1CACHE_SIZE 32768
#define L2CACHE_SIZE 1048576

#define L1THRESHOLD L1CACHE_SIZE
#define L2THRESHOLD L2CACHE_SIZE
#else
#error Cache configuration must be specified.
#endif

struct c2dmrgn {
	char *start;	/* addr of upper left of rect */
	size_t span;	/* bytes to be operated on per line */
	size_t lines;	/* lines to be operated on */
	long stride;	/* bytes per line */
};

/*
 *	c2dm_l1cache(count, rgns, dir)
 *
 *	L1 Cache operations in 2D
 *
 *	- count  - number of regions
 *	- rgns   - array of regions
 *	- dir	 - cache operation direction
 *
 */
void c2dm_l1cache(int count, struct c2dmrgn rgns[], int dir);

/*
 *	c2dm_l2cache(count, rgns, dir)
 *
 *	L2 Cache operations in 2D
 *
 *	- count  - number of regions
 *	- rgns   - array of regions
 *	- dir	 - cache operation direction
 *
 */
void c2dm_l2cache(int count, struct c2dmrgn rgns[], int dir);


#endif /* CACHE_2DMANAGER_H_ */