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 * Redistribution and use in source and binary forms are permitted 9 * provided that the above copyright notice and this paragraph are 10 * duplicated in all such forms and that any documentation, 11 * advertising materials, and other materials related to such 12 * distribution and use acknowledge that the software was developed 13 * by the University of California, Berkeley. The name of the 14 * University may not be used to endorse or promote products derived 15 * from this software without specific prior written permission. 16 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR 17 * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED 18 * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. 19 * 20 * @(#)cpu.h 7.2 (Berkeley) 09/27/88 21 */ 22 23 /* 24 * Assorted definitions unique to TAHOE CPU support. 25 */ 26 27 #define uncache(v) mtpr(PDCS, (caddr_t)(v)) 28 #define movow(a,w) _movow((u_short *)(a), (u_short)(w)) 29 #define movob(a,b) _movob((u_char *)(a), (u_char)(b)) 30 31 #define resettodr() /* no todr to set */ 32 33 #define MAXCKEY 255 /* maximal allowed code key */ 34 #define MAXDKEY 255 /* maximal allowed data key */ 35 #define NCKEY (MAXCKEY+1) /* # code keys, including 0 (reserved) */ 36 #define NDKEY (MAXDKEY+1) /* # data keys, including 0 (reserved) */ 37 38 #ifndef LOCORE 39 #ifdef KERNEL 40 char ckey_cache[NCKEY]; /* 1 =>'s key i may be in code cache */ 41 short ckey_cnt[NCKEY]; /* code key reference count */ 42 char dkey_cache[NDKEY]; /* 1 =>'s key i may be in data cache */ 43 short dkey_cnt[NDKEY]; /* data key reference count */ 44 #endif 45 46 /* 47 * Statistics maintained for code and 48 * data cache key allocations algorithms. 49 */ 50 struct keystats { 51 long ks_avail; /* number of keys currently unallocated */ 52 long ks_dirty; /* number of keys currently waiting for purge */ 53 long ks_allocs; /* number of keys allocated */ 54 long ks_allocfree; /* key allocated from free slot */ 55 long ks_norefs; /* key marked in use, but refcnt 0 */ 56 long ks_taken; /* key taken from single process */ 57 long ks_shared; /* key taken from multiple processes */ 58 long ks_inval; /* number of times keys exchanged */ 59 }; 60 #endif 61 62 long *user_psl; /* user mode psl for ast's */ 63 int intenable; /* interrupts enable startup flag */ 64 int clk_enable; /* clock enable startup flag */ 65 66 /* 67 * Enable realtime clock. 68 */ 69 #define enablertclock() (clk_enable = 1) 70