Sync usage with man page.
[netbsd-mini2440.git] / sys / arch / pmax / include / tc_machdep.h
blob5b5368f38cf850b60a2d79847111dfa54a3020ad
1 /* $NetBSD: tc_machdep.h,v 1.17 2000/02/29 04:41:59 nisimura Exp $ */
3 /*
4 * Copyright (c) 1994, 1995 Carnegie-Mellon University.
5 * All rights reserved.
7 * Author: Jonathan Stone, Chris G. Demetriou
9 * Permission to use, copy, modify and distribute this software and
10 * its documentation is hereby granted, provided that both the copyright
11 * notice and this permission notice appear in all copies of the
12 * software, derivative works or modified versions, and any portions
13 * thereof, and that both notices appear in supporting documentation.
15 * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
16 * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND
17 * FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
19 * Carnegie Mellon requests users of this software to return to
21 * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
22 * School of Computer Science
23 * Carnegie Mellon University
24 * Pittsburgh PA 15213-3890
26 * any improvements or extensions that they make and grant Carnegie the
27 * rights to redistribute these changes.
31 * Machine-specific definitions for TURBOchannel support.
33 * This file must typedef the following types:
35 * tc_addr_t TURBOchannel bus address
36 * tc_offset_t TURBOchannel bus address difference (offset)
38 * This file must prototype or define the following functions
39 * or macros (one or more of which may be no-ops):
41 * tc_mb() read/write memory barrier (any CPU<->memory
42 * reads/writes before must complete before any
43 * CPU<->memory reads/writes after).
44 * tc_wmb() write memory barrier (any CPU<->memory writes
45 * before must complete before any CPU<->memory
46 * writes after).
47 * tc_syncbus() sync TC bus; make sure CPU writes are
48 * propagated across the TURBOchannel bus.
49 * tc_badaddr() return non-zero if the given address is invalid.
50 * TC_DENSE_TO_SPARSE()
51 * convert the given physical address in
52 * TURBOchannel dense space to the corresponding
53 * address in TURBOchannel sparse space.
54 * TC_PHYS_TO_UNCACHED()
55 * convert the given system memory physical address
56 * to the physical address of the corresponding
57 * region that is not cached.
60 #ifndef _PMAX_TC_MACHDEP_H_
61 #define _PMAX_TC_MACHDEP_H_
63 #include <mips/cpuregs.h> /* defines MIPS_PHYS_TO_KSEG1 */
65 typedef paddr_t tc_addr_t;
66 typedef int32_t tc_offset_t;
68 #define tc_mb() wbflush()
69 #define tc_wmb() wbflush()
70 #define tc_syncbus() wbflush() /* XXX how to do this on a DECstation ? */
72 #define tc_badaddr(tcaddr) badaddr((void *)(tcaddr), sizeof (uint32_t))
74 #define TC_DENSE_TO_SPARSE(addr) (addr)
76 #define TC_PHYS_TO_UNCACHED(addr) MIPS_PHYS_TO_KSEG1(addr)
79 * Use the following macros to compare device names on a pmax, as
80 * the autoconfig structs are in a state of flux.
82 #define TC_BUS_MATCHNAME(ta, name) \
83 (strncmp( (ta)->ta_modname, (name), TC_ROM_LLEN+1) == 0)
85 #define KV(x) ((tc_addr_t)MIPS_PHYS_TO_KSEG1(x))
86 #define C(x) ((void *)(u_long)(x))
88 #endif /* !_PMAX_TC_MACHDEP_H_ */