new copyright notice
[unix-history] / usr / src / sys / tahoe / include / cpu.h
CommitLineData
afd2b441 1/*
e55cb871
KB
2 * Copyright (c) 1986, 1988 The Regents of the University of California.
3 * All rights reserved.
afd2b441 4 *
e55cb871
KB
5 * This code is derived from software contributed to Berkeley by
6 * Computer Consoles Inc.
7 *
6dc0e27a 8 * %sccs.include.redist.c%
e55cb871 9 *
6dc0e27a 10 * @(#)cpu.h 7.3 (Berkeley) %G%
afd2b441
MK
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
1366286d
MK
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
afd2b441
MK
28#ifndef LOCORE
29#ifdef KERNEL
30char ckey_cache[NCKEY]; /* 1 =>'s key i may be in code cache */
31short ckey_cnt[NCKEY]; /* code key reference count */
32char dkey_cache[NDKEY]; /* 1 =>'s key i may be in data cache */
33short dkey_cnt[NDKEY]; /* data key reference count */
34#endif
35
36/*
37 * Statistics maintained for code and
38 * data cache key allocations algorithms.
39 */
40struct keystats {
1366286d
MK
41 long ks_avail; /* number of keys currently unallocated */
42 long ks_dirty; /* number of keys currently waiting for purge */
afd2b441 43 long ks_allocs; /* number of keys allocated */
1366286d 44 long ks_allocfree; /* key allocated from free slot */
afd2b441
MK
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 */
1366286d 48 long ks_inval; /* number of times keys exchanged */
afd2b441
MK
49};
50#endif
51
52long *user_psl; /* user mode psl for ast's */
53int intenable; /* interrupts enable startup flag */
54int clk_enable; /* clock enable startup flag */
55
56/*
57 * Enable realtime clock.
58 */
59#define enablertclock() (clk_enable = 1)