tc_machdep.h revision 1.1 1 1.1 jonathan /* $NetBSD: tc_machdep.h,v 1.1 1995/12/28 08:42:17 jonathan Exp $ */
2 1.1 jonathan
3 1.1 jonathan /*
4 1.1 jonathan * Copyright (c) 1994, 1995 Carnegie-Mellon University.
5 1.1 jonathan * All rights reserved.
6 1.1 jonathan *
7 1.1 jonathan * Author: Jonathan Stone, Chris G. Demetriou
8 1.1 jonathan *
9 1.1 jonathan * Permission to use, copy, modify and distribute this software and
10 1.1 jonathan * its documentation is hereby granted, provided that both the copyright
11 1.1 jonathan * notice and this permission notice appear in all copies of the
12 1.1 jonathan * software, derivative works or modified versions, and any portions
13 1.1 jonathan * thereof, and that both notices appear in supporting documentation.
14 1.1 jonathan *
15 1.1 jonathan * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
16 1.1 jonathan * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND
17 1.1 jonathan * FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
18 1.1 jonathan *
19 1.1 jonathan * Carnegie Mellon requests users of this software to return to
20 1.1 jonathan *
21 1.1 jonathan * Software Distribution Coordinator or Software.Distribution (at) CS.CMU.EDU
22 1.1 jonathan * School of Computer Science
23 1.1 jonathan * Carnegie Mellon University
24 1.1 jonathan * Pittsburgh PA 15213-3890
25 1.1 jonathan *
26 1.1 jonathan * any improvements or extensions that they make and grant Carnegie the
27 1.1 jonathan * rights to redistribute these changes.
28 1.1 jonathan */
29 1.1 jonathan
30 1.1 jonathan /*
31 1.1 jonathan * Machine-specific definitions for TurboChannel support.
32 1.1 jonathan *
33 1.1 jonathan * This file must typedef the following types:
34 1.1 jonathan *
35 1.1 jonathan * tc_addr_t TurboChannel bus address
36 1.1 jonathan * tc_offset_t TurboChannel bus address difference (offset)
37 1.1 jonathan *
38 1.1 jonathan * This file must prototype or define the following functions
39 1.1 jonathan * or macros (one or more of which may be no-ops):
40 1.1 jonathan *
41 1.1 jonathan * tc_mb() read/write memory barrier (any CPU<->memory
42 1.1 jonathan * reads/writes before must complete before any
43 1.1 jonathan * CPU<->memory reads/writes after).
44 1.1 jonathan * tc_wmb() write memory barrier (any CPU<->memory writes
45 1.1 jonathan * before must complete before any CPU<->memory
46 1.1 jonathan * writes after).
47 1.1 jonathan * tc_syncbus() sync TC bus; make sure CPU writes are
48 1.1 jonathan * propagated across the TurboChannel bus.
49 1.1 jonathan * tc_badaddr() return non-zero if the given address is invalid.
50 1.1 jonathan * TC_DENSE_TO_SPARSE()
51 1.1 jonathan * convert the given physical address in
52 1.1 jonathan * TurboChannel dense space to the corresponding
53 1.1 jonathan * address in TurboChannel sparse space.
54 1.1 jonathan * TC_PHYS_TO_UNCACHED()
55 1.1 jonathan * convert the given system memory physical address
56 1.1 jonathan * to the physical address of the corresponding
57 1.1 jonathan * region that is not cached.
58 1.1 jonathan */
59 1.1 jonathan
60 1.1 jonathan #ifndef __MACHINE_TC_MACHDEP_H__
61 1.1 jonathan #define __MACHINE_TC_MACHDEP_H__
62 1.1 jonathan
63 1.1 jonathan typedef int32_t tc_addr_t;
64 1.1 jonathan typedef int32_t tc_offset_t;
65 1.1 jonathan
66 1.1 jonathan #define tc_mb() wbflush()
67 1.1 jonathan #define tc_wmb() wbflush()
68 1.1 jonathan
69 1.1 jonathan /*
70 1.1 jonathan * XXX how to do this on a DECstation ?
71 1.1 jonathan */
72 1.1 jonathan #define tc_syncbus() wbflush();
73 1.1 jonathan
74 1.1 jonathan #define tc_badaddr(tcaddr) \
75 1.1 jonathan badaddr((void *)(tcaddr), sizeof (u_int32_t))
76 1.1 jonathan
77 1.1 jonathan
78 1.1 jonathan #define TC_DENSE_TO_SPARSE(addr) \
79 1.1 jonathan (addr)
80 1.1 jonathan
81 1.1 jonathan #define TC_PHYS_TO_UNCACHED(addr) \
82 1.1 jonathan (addr)
83 1.1 jonathan
84 1.1 jonathan #endif /* __MACHINE_TC_MACHDEP_H__*/
85