130263Skarels /* 2*35733Sbostic * Copyright (c) 1986, 1988 The Regents of the University of California. 3*35733Sbostic * All rights reserved. 430263Skarels * 5*35733Sbostic * This code is derived from software contributed to Berkeley by 6*35733Sbostic * Computer Consoles Inc. 7*35733Sbostic * 8*35733Sbostic * Redistribution and use in source and binary forms are permitted 9*35733Sbostic * provided that the above copyright notice and this paragraph are 10*35733Sbostic * duplicated in all such forms and that any documentation, 11*35733Sbostic * advertising materials, and other materials related to such 12*35733Sbostic * distribution and use acknowledge that the software was developed 13*35733Sbostic * by the University of California, Berkeley. The name of the 14*35733Sbostic * University may not be used to endorse or promote products derived 15*35733Sbostic * from this software without specific prior written permission. 16*35733Sbostic * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR 17*35733Sbostic * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED 18*35733Sbostic * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. 19*35733Sbostic * 20*35733Sbostic * @(#)cpu.h 7.2 (Berkeley) 09/27/88 2130263Skarels */ 2230263Skarels 2330263Skarels /* 2430263Skarels * Assorted definitions unique to TAHOE CPU support. 2530263Skarels */ 2630263Skarels 2730263Skarels #define uncache(v) mtpr(PDCS, (caddr_t)(v)) 2830263Skarels #define movow(a,w) _movow((u_short *)(a), (u_short)(w)) 2930263Skarels #define movob(a,b) _movob((u_char *)(a), (u_char)(b)) 3030263Skarels 3130263Skarels #define resettodr() /* no todr to set */ 3230263Skarels 3330626Skarels #define MAXCKEY 255 /* maximal allowed code key */ 3430626Skarels #define MAXDKEY 255 /* maximal allowed data key */ 3530626Skarels #define NCKEY (MAXCKEY+1) /* # code keys, including 0 (reserved) */ 3630626Skarels #define NDKEY (MAXDKEY+1) /* # data keys, including 0 (reserved) */ 3730626Skarels 3830263Skarels #ifndef LOCORE 3930263Skarels #ifdef KERNEL 4030263Skarels char ckey_cache[NCKEY]; /* 1 =>'s key i may be in code cache */ 4130263Skarels short ckey_cnt[NCKEY]; /* code key reference count */ 4230263Skarels char dkey_cache[NDKEY]; /* 1 =>'s key i may be in data cache */ 4330263Skarels short dkey_cnt[NDKEY]; /* data key reference count */ 4430263Skarels #endif 4530263Skarels 4630263Skarels /* 4730263Skarels * Statistics maintained for code and 4830263Skarels * data cache key allocations algorithms. 4930263Skarels */ 5030263Skarels struct keystats { 5130626Skarels long ks_avail; /* number of keys currently unallocated */ 5230626Skarels long ks_dirty; /* number of keys currently waiting for purge */ 5330263Skarels long ks_allocs; /* number of keys allocated */ 5430626Skarels long ks_allocfree; /* key allocated from free slot */ 5530263Skarels long ks_norefs; /* key marked in use, but refcnt 0 */ 5630263Skarels long ks_taken; /* key taken from single process */ 5730263Skarels long ks_shared; /* key taken from multiple processes */ 5830626Skarels long ks_inval; /* number of times keys exchanged */ 5930263Skarels }; 6030263Skarels #endif 6130263Skarels 6230263Skarels long *user_psl; /* user mode psl for ast's */ 6330263Skarels int intenable; /* interrupts enable startup flag */ 6430263Skarels int clk_enable; /* clock enable startup flag */ 6530263Skarels 6630263Skarels /* 6730263Skarels * Enable realtime clock. 6830263Skarels */ 6930263Skarels #define enablertclock() (clk_enable = 1) 70