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