xref: /original-bsd/sys/tahoe/include/cpu.h (revision 909c03fb)
1 /*
2  * Copyright (c) 1986, 1988 The Regents of the University of California.
3  * All rights reserved.
4  *
5  * This code is derived from software contributed to Berkeley by
6  * Computer Consoles Inc.
7  *
8  * %sccs.include.redist.c%
9  *
10  *	@(#)cpu.h	7.4 (Berkeley) 02/20/92
11  */
12 
13 /*
14  * Assorted definitions unique to TAHOE CPU support.
15  */
16 
17 #define	uncache(v)	mtpr(PDCS, (caddr_t)(v))
18 #define	movow(a,w)	_movow((u_short *)(a), (u_short)(w))
19 #define	movob(a,b)	_movob((u_char *)(a), (u_char)(b))
20 
21 #define	resettodr()	/* no todr to set */
22 
23 #define	MAXCKEY	255		/* maximal allowed code key */
24 #define	MAXDKEY	255		/* maximal allowed data key */
25 #define	NCKEY	(MAXCKEY+1)	/* # code keys, including 0 (reserved) */
26 #define	NDKEY	(MAXDKEY+1)	/* # data keys, including 0 (reserved) */
27 
28 #ifndef LOCORE
29 #ifdef KERNEL
30 char	ckey_cache[NCKEY];	/* 1 =>'s key i may be in code cache */
31 short	ckey_cnt[NCKEY];	/* code key reference count */
32 char	dkey_cache[NDKEY];	/* 1 =>'s key i may be in data cache */
33 short	dkey_cnt[NDKEY];	/* data key reference count */
34 #endif
35 
36 /*
37  * Statistics maintained for code and
38  * data cache key allocations algorithms.
39  */
40 struct	keystats {
41 	long	ks_avail;	/* number of keys currently unallocated */
42 	long	ks_dirty;	/* number of keys currently waiting for purge */
43 	long	ks_allocs;	/* number of keys allocated */
44 	long	ks_allocfree;	/* key allocated from free slot */
45 	long	ks_norefs;	/* key marked in use, but refcnt 0 */
46 	long	ks_taken;	/* key taken from single process */
47 	long	ks_shared;	/* key taken from multiple processes */
48 	long	ks_inval;	/* number of times keys exchanged */
49 };
50 #endif
51 
52 long	*user_psl;		/* user mode psl for ast's */
53 int	intenable;		/* interrupts enable startup flag */
54 int	clk_enable;		/* clock enable startup flag */
55 
56 /*
57  * Enable realtime clock.
58  */
59 #define	enablertclock()	(clk_enable = 1)
60 
61 #ifndef _MTPR_H_
62 #include "mtpr.h"
63 #endif /* !_MTPR_H_ */
64