Home | History | Annotate | Line # | Download | only in include
      1  1.16      mrg /*	$NetBSD: cacheops.h,v 1.16 2010/06/06 04:50:07 mrg Exp $	*/
      2   1.1      leo 
      3   1.1      leo /*-
      4   1.1      leo  * Copyright (c) 1997 The NetBSD Foundation, Inc.
      5   1.1      leo  * All rights reserved.
      6   1.1      leo  *
      7   1.1      leo  * This code is derived from software contributed to The NetBSD Foundation
      8   1.1      leo  * by Leo Weppelman
      9   1.1      leo  *
     10   1.1      leo  * Redistribution and use in source and binary forms, with or without
     11   1.1      leo  * modification, are permitted provided that the following conditions
     12   1.1      leo  * are met:
     13   1.1      leo  * 1. Redistributions of source code must retain the above copyright
     14   1.1      leo  *    notice, this list of conditions and the following disclaimer.
     15   1.1      leo  * 2. Redistributions in binary form must reproduce the above copyright
     16   1.1      leo  *    notice, this list of conditions and the following disclaimer in the
     17   1.1      leo  *    documentation and/or other materials provided with the distribution.
     18   1.1      leo  *
     19   1.1      leo  * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
     20   1.1      leo  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
     21   1.1      leo  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
     22   1.1      leo  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
     23   1.1      leo  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
     24   1.1      leo  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
     25   1.1      leo  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
     26   1.1      leo  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
     27   1.1      leo  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
     28   1.1      leo  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
     29   1.1      leo  * POSSIBILITY OF SUCH DAMAGE.
     30   1.1      leo  */
     31   1.1      leo 
     32   1.4  minoura #ifndef _M68K_CACHEOPS_H_
     33   1.4  minoura #define	_M68K_CACHEOPS_H_
     34   1.4  minoura 
     35  1.16      mrg #include "opt_m68k_arch.h"
     36  1.16      mrg 
     37   1.1      leo #if notyet /* XXX */
     38   1.1      leo #include <machine/cpuconf.h>
     39   1.1      leo #endif
     40   1.1      leo 
     41   1.1      leo #include <m68k/cacheops_20.h>
     42   1.1      leo #include <m68k/cacheops_30.h>
     43   1.1      leo #include <m68k/cacheops_40.h>
     44   1.1      leo #include <m68k/cacheops_60.h>
     45   1.1      leo 
     46   1.9      chs #define M68K_CACHEOPS_NTYPES (defined(M68K_CACHEOPS_MACHDEP) + \
     47   1.9      chs 	defined(M68020) + defined(M68030) + defined(M68040) + defined(M68060))
     48   1.9      chs 
     49   1.9      chs #if M68K_CACHEOPS_NTYPES == 1
     50   1.9      chs 
     51   1.9      chs #if defined(M68020)
     52   1.1      leo 
     53   1.1      leo #define	DCIA()		DCIA_20()
     54   1.9      chs #define	DCIAS(pa)	DCIAS_20((pa))
     55   1.1      leo #define	DCIS()		DCIS_20()
     56   1.1      leo #define	DCIU()		DCIU_20()
     57   1.9      chs #define	ICIA()		ICIA_20()
     58   1.9      chs #define	ICPA()		ICPA_20()
     59   1.1      leo #define	PCIA()		PCIA_20()
     60   1.9      chs #define	TBIA()		TBIA_20()
     61   1.9      chs #define	TBIAS()		TBIAS_20()
     62   1.9      chs #define	TBIAU()		TBIAU_20()
     63   1.9      chs #define	TBIS(va)	TBIS_20((va))
     64   1.1      leo 
     65   1.9      chs #elif defined(M68030)
     66   1.1      leo 
     67   1.1      leo #define	DCIA()		DCIA_30()
     68   1.9      chs #define	DCIAS(pa)	DCIAS_30((pa))
     69   1.1      leo #define	DCIS()		DCIS_30()
     70   1.1      leo #define	DCIU()		DCIU_30()
     71   1.9      chs #define	ICIA()		ICIA_30()
     72   1.9      chs #define	ICPA()		ICPA_30()
     73   1.1      leo #define	PCIA()		PCIA_30()
     74   1.9      chs #define	TBIA()		TBIA_30()
     75   1.9      chs #define	TBIAS()		TBIAS_30()
     76   1.9      chs #define	TBIAU()		TBIAU_30()
     77   1.9      chs #define	TBIS(va)	TBIS_30((va))
     78   1.1      leo 
     79   1.9      chs #elif defined(M68040)
     80   1.1      leo 
     81   1.1      leo #define	DCIA()		DCIA_40()
     82   1.9      chs #define	DCIAS(pa)	DCIAS_40((pa))
     83   1.1      leo #define	DCIS()		DCIS_40()
     84   1.1      leo #define	DCIU()		DCIU_40()
     85   1.9      chs #define	ICIA()		ICIA_40()
     86   1.9      chs #define	ICPA()		ICPA_40()
     87   1.9      chs #define	PCIA()		PCIA_40()
     88   1.9      chs #define	TBIA()		TBIA_40()
     89   1.9      chs #define	TBIAS()		TBIAS_40()
     90   1.9      chs #define	TBIAU()		TBIAU_40()
     91   1.9      chs #define	TBIS(va)	TBIS_40((va))
     92   1.1      leo 
     93   1.9      chs #elif defined(M68060)
     94   1.1      leo 
     95   1.1      leo #define	DCIA()		DCIA_60()
     96   1.9      chs #define	DCIAS(pa)	DCIAS_60((pa))
     97   1.1      leo #define	DCIS()		DCIS_60()
     98   1.1      leo #define	DCIU()		DCIU_60()
     99   1.9      chs #define	ICIA()		ICIA_60()
    100   1.9      chs #define	ICPA()		ICPA_60()
    101   1.9      chs #define	PCIA()		PCIA_60()
    102   1.9      chs #define	TBIA()		TBIA_60()
    103   1.9      chs #define	TBIAS()		TBIAS_60()
    104   1.9      chs #define	TBIAU()		TBIAU_60()
    105   1.9      chs #define	TBIS(va)	TBIS_60((va))
    106   1.1      leo 
    107   1.1      leo #endif
    108   1.1      leo 
    109   1.9      chs #else /* M68K_CACHEOPS_NTYPES == 1 */
    110   1.1      leo 
    111   1.1      leo #define	DCIA()		_DCIA()
    112   1.9      chs #define	DCIAS(pa)	_DCIAS((pa))
    113   1.1      leo #define	DCIS()		_DCIS()
    114   1.1      leo #define	DCIU()		_DCIU()
    115   1.9      chs #define	ICIA()		_ICIA()
    116   1.9      chs #define	ICPA()		_ICPA()
    117   1.8       is #define	PCIA()		_PCIA()
    118   1.9      chs #define	TBIA()		_TBIA()
    119   1.9      chs #define	TBIAS()		_TBIAS()
    120   1.9      chs #define	TBIAU()		_TBIAU()
    121   1.9      chs #define	TBIS(va)	_TBIS((va))
    122   1.1      leo 
    123   1.9      chs #endif /* M68K_CACHEOPS_NTYPES == 1 */
    124   1.1      leo 
    125  1.10  thorpej void	_DCIA(void);
    126  1.10  thorpej void	_DCIAS(paddr_t);
    127  1.10  thorpej void	_DCIS(void);
    128  1.10  thorpej void	_DCIU(void);
    129  1.10  thorpej void	_ICIA(void);
    130  1.10  thorpej void	_ICPA(void);
    131  1.10  thorpej void	_PCIA(void);
    132  1.10  thorpej void	_TBIA(void);
    133  1.10  thorpej void	_TBIAS(void);
    134  1.10  thorpej void	_TBIAU(void);
    135  1.10  thorpej void	_TBIS(vaddr_t);
    136   1.4  minoura 
    137  1.12  tsutsui 
    138  1.12  tsutsui #if defined(M68040) || defined(M68060)
    139  1.12  tsutsui 
    140  1.12  tsutsui /*
    141  1.12  tsutsui  * These cache ops are identical between M68040 and M68060
    142  1.12  tsutsui  * and not available on M68020 and M68030 so no need to check cputype.
    143  1.12  tsutsui  */
    144  1.12  tsutsui #define	DCFA()		DCFA_40()
    145  1.12  tsutsui #define	DCPA()		DCPA_40()
    146  1.12  tsutsui #define	ICPL(pa)	ICPL_40(pa)
    147  1.12  tsutsui #define	ICPP(pa)	ICPP_40(pa)
    148  1.12  tsutsui #define	DCPL(pa)	DCPL_40(pa)
    149  1.12  tsutsui #define	DCPP(pa)	DCPP_40(pa)
    150  1.12  tsutsui #define	DCFL(pa)	DCFL_40(pa)
    151  1.12  tsutsui #define	DCFP(pa)	DCFP_40(pa)
    152  1.12  tsutsui 
    153  1.12  tsutsui #endif
    154  1.12  tsutsui 
    155   1.4  minoura #endif /* _M68K_CACHEOPS_H_ */
    156