1*9b6bd2d9Srmind /* $NetBSD: cacheops_machdep.h,v 1.7 2011/02/08 20:20:20 rmind Exp $ */
240e5b839Schs
340e5b839Schs /*
4*9b6bd2d9Srmind * Copyright (c) 1988 University of Utah.
540e5b839Schs * Copyright (c) 1980, 1990, 1993
640e5b839Schs * The Regents of the University of California. All rights reserved.
740e5b839Schs *
840e5b839Schs * This code is derived from software contributed to Berkeley by
940e5b839Schs * the Systems Programming Group of the University of Utah Computer
1040e5b839Schs * Science Department.
1140e5b839Schs *
1240e5b839Schs * Redistribution and use in source and binary forms, with or without
1340e5b839Schs * modification, are permitted provided that the following conditions
1440e5b839Schs * are met:
1540e5b839Schs * 1. Redistributions of source code must retain the above copyright
1640e5b839Schs * notice, this list of conditions and the following disclaimer.
1740e5b839Schs * 2. Redistributions in binary form must reproduce the above copyright
1840e5b839Schs * notice, this list of conditions and the following disclaimer in the
1940e5b839Schs * documentation and/or other materials provided with the distribution.
20aad01611Sagc * 3. Neither the name of the University nor the names of its contributors
21aad01611Sagc * may be used to endorse or promote products derived from this software
22aad01611Sagc * without specific prior written permission.
23aad01611Sagc *
24aad01611Sagc * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
25aad01611Sagc * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
26aad01611Sagc * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
27aad01611Sagc * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
28aad01611Sagc * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
29aad01611Sagc * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
30aad01611Sagc * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
31aad01611Sagc * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
32aad01611Sagc * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
33aad01611Sagc * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
34aad01611Sagc * SUCH DAMAGE.
35aad01611Sagc */
3640e5b839Schs
3740e5b839Schs #ifndef _NEWS68K_CACHEOPS_MACHDEP_H_
3840e5b839Schs #define _NEWS68K_CACHEOPS_MACHDEP_H_
3940e5b839Schs
4040e5b839Schs extern void *cache_clr;
4140e5b839Schs
42fbae48b9Sperry static __inline int __attribute__((__unused__))
DCIx_md(void)4340e5b839Schs DCIx_md(void)
4440e5b839Schs {
4540e5b839Schs volatile uint8_t *p = cache_clr;
4640e5b839Schs
4740e5b839Schs if (ectype != EC_VIRT) {
4840e5b839Schs return 0;
4940e5b839Schs }
5040e5b839Schs
5140e5b839Schs *p = 0xff;
5240e5b839Schs return 1;
5340e5b839Schs }
5440e5b839Schs
55fbae48b9Sperry static __inline int __attribute__((__unused__))
DCIA_md(void)5640e5b839Schs DCIA_md(void)
5740e5b839Schs {
5840e5b839Schs return DCIx_md();
5940e5b839Schs }
6040e5b839Schs
61fbae48b9Sperry static __inline int __attribute__((__unused__))
DCIS_md(void)6240e5b839Schs DCIS_md(void)
6340e5b839Schs {
6440e5b839Schs return DCIx_md();
6540e5b839Schs }
6640e5b839Schs
67fbae48b9Sperry static __inline int __attribute__((__unused__))
DCIU_md(void)6840e5b839Schs DCIU_md(void)
6940e5b839Schs {
7040e5b839Schs return DCIx_md();
7140e5b839Schs }
7240e5b839Schs
73fbae48b9Sperry static __inline int __attribute__((__unused__))
PCIA_md(void)7440e5b839Schs PCIA_md(void)
7540e5b839Schs {
7640e5b839Schs volatile uint8_t *p = cache_clr;
7740e5b839Schs
7840e5b839Schs if (ectype != EC_PHYS) {
7940e5b839Schs return 0;
8040e5b839Schs }
8140e5b839Schs
8240e5b839Schs *p = 0xff;
8340e5b839Schs return 1;
8440e5b839Schs }
8540e5b839Schs #endif /* _NEWS68K_CACHEOPS_MACHDEP_H_ */
86