cacheops_machdep.h revision 1.2.2.2 1 1.2.2.2 nathanw /* $NetBSD: cacheops_machdep.h,v 1.2.2.2 2002/11/11 22:01:52 nathanw Exp $ */
2 1.2.2.2 nathanw
3 1.2.2.2 nathanw /*
4 1.2.2.2 nathanw * Copyright (c) 1988 University of Utah.
5 1.2.2.2 nathanw * Copyright (c) 1980, 1990, 1993
6 1.2.2.2 nathanw * The Regents of the University of California. All rights reserved.
7 1.2.2.2 nathanw *
8 1.2.2.2 nathanw * This code is derived from software contributed to Berkeley by
9 1.2.2.2 nathanw * the Systems Programming Group of the University of Utah Computer
10 1.2.2.2 nathanw * Science Department.
11 1.2.2.2 nathanw *
12 1.2.2.2 nathanw * Redistribution and use in source and binary forms, with or without
13 1.2.2.2 nathanw * modification, are permitted provided that the following conditions
14 1.2.2.2 nathanw * are met:
15 1.2.2.2 nathanw * 1. Redistributions of source code must retain the above copyright
16 1.2.2.2 nathanw * notice, this list of conditions and the following disclaimer.
17 1.2.2.2 nathanw * 2. Redistributions in binary form must reproduce the above copyright
18 1.2.2.2 nathanw * notice, this list of conditions and the following disclaimer in the
19 1.2.2.2 nathanw * documentation and/or other materials provided with the distribution.
20 1.2.2.2 nathanw * 3. All advertising materials mentioning features or use of this software
21 1.2.2.2 nathanw * must display the following acknowledgement:
22 1.2.2.2 nathanw * This product includes software developed by the University of
23 1.2.2.2 nathanw * California, Berkeley and its contributors.
24 1.2.2.2 nathanw * 4. Neither the name of the University nor the names of its contributors
25 1.2.2.2 nathanw * may be used to endorse or promote products derived from this software
26 1.2.2.2 nathanw * without specific prior written permission.
27 1.2.2.2 nathanw *
28 1.2.2.2 nathanw * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
29 1.2.2.2 nathanw * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
30 1.2.2.2 nathanw * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
31 1.2.2.2 nathanw * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
32 1.2.2.2 nathanw * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
33 1.2.2.2 nathanw * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
34 1.2.2.2 nathanw * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
35 1.2.2.2 nathanw * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
36 1.2.2.2 nathanw * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
37 1.2.2.2 nathanw * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
38 1.2.2.2 nathanw * SUCH DAMAGE.
39 1.2.2.2 nathanw */
40 1.2.2.2 nathanw
41 1.2.2.2 nathanw #ifndef _NEWS68K_CACHEOPS_MACHDEP_H_
42 1.2.2.2 nathanw #define _NEWS68K_CACHEOPS_MACHDEP_H_
43 1.2.2.2 nathanw
44 1.2.2.2 nathanw extern void *cache_clr;
45 1.2.2.2 nathanw
46 1.2.2.2 nathanw static __inline int __attribute__((__unused__))
47 1.2.2.2 nathanw DCIx_md(void)
48 1.2.2.2 nathanw {
49 1.2.2.2 nathanw volatile uint8_t *p = cache_clr;
50 1.2.2.2 nathanw
51 1.2.2.2 nathanw if (ectype != EC_VIRT) {
52 1.2.2.2 nathanw return 0;
53 1.2.2.2 nathanw }
54 1.2.2.2 nathanw
55 1.2.2.2 nathanw *p = 0xff;
56 1.2.2.2 nathanw return 1;
57 1.2.2.2 nathanw }
58 1.2.2.2 nathanw
59 1.2.2.2 nathanw static __inline int __attribute__((__unused__))
60 1.2.2.2 nathanw DCIA_md(void)
61 1.2.2.2 nathanw {
62 1.2.2.2 nathanw return DCIx_md();
63 1.2.2.2 nathanw }
64 1.2.2.2 nathanw
65 1.2.2.2 nathanw static __inline int __attribute__((__unused__))
66 1.2.2.2 nathanw DCIS_md(void)
67 1.2.2.2 nathanw {
68 1.2.2.2 nathanw return DCIx_md();
69 1.2.2.2 nathanw }
70 1.2.2.2 nathanw
71 1.2.2.2 nathanw static __inline int __attribute__((__unused__))
72 1.2.2.2 nathanw DCIU_md(void)
73 1.2.2.2 nathanw {
74 1.2.2.2 nathanw return DCIx_md();
75 1.2.2.2 nathanw }
76 1.2.2.2 nathanw
77 1.2.2.2 nathanw static __inline int __attribute__((__unused__))
78 1.2.2.2 nathanw PCIA_md(void)
79 1.2.2.2 nathanw {
80 1.2.2.2 nathanw volatile uint8_t *p = cache_clr;
81 1.2.2.2 nathanw
82 1.2.2.2 nathanw if (ectype != EC_PHYS) {
83 1.2.2.2 nathanw return 0;
84 1.2.2.2 nathanw }
85 1.2.2.2 nathanw
86 1.2.2.2 nathanw *p = 0xff;
87 1.2.2.2 nathanw return 1;
88 1.2.2.2 nathanw }
89 1.2.2.2 nathanw #endif /* _NEWS68K_CACHEOPS_MACHDEP_H_ */
90