1/*	$NetBSD: cache_r10k.h,v 1.4 2016/07/11 16:15:35 matt Exp $	*/
2
3/*
4 * Copyright (c) 2003 KIYOHARA Takashi <kiyohara@kk.iij4u.or.jp>
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:
9 * 1. Redistributions of source code must retain the above copyright
10 *    notice, this list of conditions and the following disclaimer.
11 * 2. Redistributions in binary form must reproduce the above copyright
12 *    notice, this list of conditions and the following disclaimer in the
13 *    documentation and/or other materials provided with the distribution.
14 *
15 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
16 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
17 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
18 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
19 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
20 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
21 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
22 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
24 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25 */
26
27/*
28 * Copyright 2001 Wasabi Systems, Inc.
29 * All rights reserved.
30 *
31 * Written by Jason R. Thorpe for Wasabi Systems, Inc.
32 *
33 * Redistribution and use in source and binary forms, with or without
34 * modification, are permitted provided that the following conditions
35 * are met:
36 * 1. Redistributions of source code must retain the above copyright
37 *    notice, this list of conditions and the following disclaimer.
38 * 2. Redistributions in binary form must reproduce the above copyright
39 *    notice, this list of conditions and the following disclaimer in the
40 *    documentation and/or other materials provided with the distribution.
41 * 3. All advertising materials mentioning features or use of this software
42 *    must display the following acknowledgement:
43 *	This product includes software developed for the NetBSD Project by
44 *	Wasabi Systems, Inc.
45 * 4. The name of Wasabi Systems, Inc. may not be used to endorse
46 *    or promote products derived from this software without specific prior
47 *    written permission.
48 *
49 * THIS SOFTWARE IS PROVIDED BY WASABI SYSTEMS, INC. ``AS IS'' AND
50 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
51 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
52 * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL WASABI SYSTEMS, INC
53 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
54 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
55 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
56 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
57 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
58 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
59 * POSSIBILITY OF SUCH DAMAGE.
60 */
61
62/*
63 * Cache definitions/operations for R10000-style caches.
64 */
65
66#define	CACHEOP_R10K_CBARRIER		(5 << 2)	/* I */
67#define	CACHEOP_R10K_IDX_LOAD_DATA	(6 << 2)	/* I, D, SD */
68#define	CACHEOP_R10K_IDX_STORE_DATA	(7 << 2)	/* SI, SD */
69
70#if defined(_KERNEL) && !defined(_LOCORE)
71
72void	r10k_icache_sync_all(void);
73void	r10k_icache_sync_range(register_t, vsize_t);
74void	r10k_icache_sync_range_index(vaddr_t, vsize_t);
75void	r10k_pdcache_wbinv_all(void);
76void	r10k_pdcache_wbinv_range(register_t, vsize_t);
77void	r10k_pdcache_wbinv_range_index(vaddr_t, vsize_t);
78void	r10k_pdcache_inv_range(register_t, vsize_t);
79void	r10k_pdcache_wb_range(register_t, vsize_t);
80void	r10k_sdcache_wbinv_all(void);
81void	r10k_sdcache_wbinv_range(register_t, vsize_t);
82void	r10k_sdcache_wbinv_range_index(vaddr_t, vsize_t);
83void	r10k_sdcache_inv_range(register_t, vsize_t);
84void	r10k_sdcache_wb_range(register_t, vsize_t);
85
86#endif /* _KERNEL && !_LOCORE */
87
88