xref: /illumos-gate/usr/src/uts/sun4u/sys/iocache.h (revision 71d45228ba245d505c3beae1d756e775616f6d5a)
1 /*
2  * CDDL HEADER START
3  *
4  * The contents of this file are subject to the terms of the
5  * Common Development and Distribution License, Version 1.0 only
6  * (the "License").  You may not use this file except in compliance
7  * with the License.
8  *
9  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10  * or http://www.opensolaris.org/os/licensing.
11  * See the License for the specific language governing permissions
12  * and limitations under the License.
13  *
14  * When distributing Covered Code, include this CDDL HEADER in each
15  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16  * If applicable, add the following below this CDDL HEADER, with the
17  * fields enclosed by brackets "[]" replaced with your own identifying
18  * information: Portions Copyright [yyyy] [name of copyright owner]
19  *
20  * CDDL HEADER END
21  */
22 /*
23  * Copyright (c) 1991-1994,1997-1998 by Sun Microsystems, Inc.
24  * All rights reserved.
25  */
26 
27 #ifndef _SYS_IOCACHE_H
28 #define	_SYS_IOCACHE_H
29 
30 #pragma ident	"%Z%%M%	%I%	%E% SMI"
31 
32 #ifndef _ASM
33 #include <sys/sysiosbus.h>
34 #endif
35 
36 #ifdef	__cplusplus
37 extern "C" {
38 #endif
39 
40 #define	OFF_STR_BUF_CTRL_REG	0x2800
41 #define	STR_BUF_CTRL_REG_SIZE	(NATURAL_REG_SIZE)
42 #define	OFF_STR_BUF_FLUSH_REG	0x2808
43 #define	STR_BUF_FLUSH_REG_SIZE	(NATURAL_REG_SIZE)
44 #define	OFF_STR_BUF_SYNC_REG	0x2810
45 #define	STR_BUF_SYNC_REG_SIZE	(NATURAL_REG_SIZE)
46 #define	STR_BUF_PAGE_TAG_DIAG	0x5800
47 
48 #define	STREAM_BUF_DISABLE	0x0ull
49 #define	STREAM_BUF_ENABLE	0x1ull
50 #define	STREAM_BUF_DIAG_ENABLE	0x2ull
51 #define	IOCACHE_LINE_SIZE_MASK	0x3f		/* 64 byte line size */
52 #define	STREAM_BUF_OFF		1		/* All stream bufs off */
53 #define	STREAM_BUF_TIMEOUT	2		/* Streaming buf timed out */
54 #define	STREAM_CACHE_LINES	16
55 
56 #define	STR_PG_VALID		0x2ull
57 #define	STR_PG_SHIFT		11
58 #define	STR_PG_MASK		0x3ffffull
59 
60 #if defined(_KERNEL) && !defined(_ASM)
61 
62 extern int stream_buf_init(struct sbus_soft_state *, caddr_t);
63 extern int stream_buf_resume_init(struct sbus_soft_state *);
64 extern void sync_stream_buf(struct sbus_soft_state *, uint_t, uint_t, int *,
65     uint64_t);
66 
67 #endif /* _KERNEL && !_ASM */
68 
69 #ifdef	__cplusplus
70 }
71 #endif
72 
73 #endif	/* _SYS_IOCACHE_H */
74