Home | History | Annotate | Line # | Download | only in include
locore.h revision 1.5
      1  1.5    mhitch /*	$NetBSD: locore.h,v 1.5 1997/06/15 17:33:53 mhitch Exp $	*/
      2  1.1  jonathan 
      3  1.1  jonathan /*
      4  1.1  jonathan  * Copyright 1996 The Board of Trustees of The Leland Stanford
      5  1.1  jonathan  * Junior University. All Rights Reserved.
      6  1.1  jonathan  *
      7  1.1  jonathan  * Permission to use, copy, modify, and distribute this
      8  1.1  jonathan  * software and its documentation for any purpose and without
      9  1.1  jonathan  * fee is hereby granted, provided that the above copyright
     10  1.1  jonathan  * notice appear in all copies.  Stanford University
     11  1.1  jonathan  * makes no representations about the suitability of this
     12  1.1  jonathan  * software for any purpose.  It is provided "as is" without
     13  1.1  jonathan  * express or implied warranty.
     14  1.1  jonathan  */
     15  1.1  jonathan 
     16  1.1  jonathan /*
     17  1.1  jonathan  * Jump table for MIPS cpu locore functions that are implemented
     18  1.1  jonathan  * differently on different generations, or instruction-level
     19  1.1  jonathan  * archtecture (ISA) level, the Mips family.
     20  1.1  jonathan  * The following functions must be provided for each mips ISA level:
     21  1.1  jonathan  *
     22  1.1  jonathan  *
     23  1.1  jonathan  *	MachConfigCache
     24  1.1  jonathan  *	MachFlushCache
     25  1.1  jonathan  *	MachFlushDCache
     26  1.1  jonathan  *	MachFlushICache
     27  1.1  jonathan  *	MachForceCacheUpdate
     28  1.1  jonathan  *	MachSetPID
     29  1.1  jonathan  *	MachTLBFlush
     30  1.1  jonathan  *	MachTLBFlushAddr __P()
     31  1.1  jonathan  *	MachTLBUpdate (u_int, (pt_entry_t?) u_int);
     32  1.1  jonathan  *	MachTLBWriteIndexed
     33  1.5    mhitch  *	wbflush
     34  1.5    mhitch  *	proc_trampoline()
     35  1.1  jonathan  *
     36  1.1  jonathan  * We currently provide support for:
     37  1.1  jonathan  *
     38  1.1  jonathan  *	r2000 and r3000 (mips ISA-I)
     39  1.1  jonathan  *	r4000 and r4400 in 32-bit mode (mips ISA-III?)
     40  1.1  jonathan  */
     41  1.1  jonathan 
     42  1.1  jonathan #ifndef _MIPS_LOCORE_H
     43  1.1  jonathan #define  _MIPS_LOCORE_H
     44  1.2  jonathan 
     45  1.2  jonathan /*
     46  1.2  jonathan  * locore service routine for exeception vectors. Used outside locore
     47  1.2  jonathan  * only to print them by name in stack tracebacks
     48  1.2  jonathan  */
     49  1.2  jonathan 
     50  1.3  jonathan extern void mips1_ConfigCache  __P((void));
     51  1.3  jonathan extern void mips1_FlushCache  __P((void));
     52  1.3  jonathan extern void mips1_FlushDCache  __P((vm_offset_t addr, vm_offset_t len));
     53  1.3  jonathan extern void mips1_FlushICache  __P((vm_offset_t addr, vm_offset_t len));
     54  1.3  jonathan extern void mips1_ForceCacheUpdate __P((void));
     55  1.3  jonathan extern void mips1_SetPID   __P((int pid));
     56  1.3  jonathan extern void mips1_TLBFlush __P((void));
     57  1.3  jonathan extern void mips1_TLBFlushAddr   __P( /* XXX Really pte highpart ? */
     58  1.1  jonathan 					  (vm_offset_t addr));
     59  1.5    mhitch extern int mips1_TLBUpdate __P((u_int, /*pt_entry_t*/ u_int));
     60  1.3  jonathan extern void mips1_TLBWriteIndexed  __P((u_int index, u_int high,
     61  1.1  jonathan 					    u_int low));
     62  1.5    mhitch extern void mips1_wbflush __P((void));
     63  1.5    mhitch extern void mips1_proc_trampoline __P((void));
     64  1.1  jonathan 
     65  1.3  jonathan extern void mips3_ConfigCache __P((void));
     66  1.3  jonathan extern void mips3_FlushCache  __P((void));
     67  1.3  jonathan extern void mips3_FlushDCache __P((vm_offset_t addr, vm_offset_t len));
     68  1.3  jonathan extern void mips3_FlushICache __P((vm_offset_t addr, vm_offset_t len));
     69  1.3  jonathan extern void mips3_ForceCacheUpdate __P((void));
     70  1.3  jonathan extern void mips3_SetPID  __P((int pid));
     71  1.3  jonathan extern void mips3_TLBFlush __P((void));
     72  1.3  jonathan extern void mips3_TLBFlushAddr __P( /* XXX Really pte highpart ? */
     73  1.1  jonathan 					  (vm_offset_t addr));
     74  1.5    mhitch extern int mips3_TLBUpdate __P((u_int, /*pt_entry_t*/ u_int));
     75  1.5    mhitch extern void mips3_TLBWriteIndexedVPS __P((u_int index, void *tlb));
     76  1.3  jonathan extern void mips3_TLBWriteIndexed __P((u_int index, u_int high,
     77  1.5    mhitch 					   u_int lo0, u_int lo1));
     78  1.5    mhitch extern void mips3_wbflush __P((void));
     79  1.5    mhitch extern void mips3_proc_trampoline __P((void));
     80  1.1  jonathan 
     81  1.1  jonathan /*
     82  1.1  jonathan  *  A vector with an entry for each mips-ISA-level dependent
     83  1.1  jonathan  * locore function, and macros which jump through it.
     84  1.1  jonathan  * XXX the macro names are chosen to be compatible with the old
     85  1.1  jonathan  * Sprite  coding-convention names used in 4.4bsd/pmax.
     86  1.1  jonathan  */
     87  1.1  jonathan typedef struct  {
     88  1.1  jonathan 	void (*configCache) __P((void));
     89  1.1  jonathan 	void (*flushCache)  __P((void));
     90  1.1  jonathan 	void (*flushDCache) __P((vm_offset_t addr, vm_offset_t len));
     91  1.1  jonathan 	void (*flushICache) __P((vm_offset_t addr, vm_offset_t len));
     92  1.1  jonathan 	void (*forceCacheUpdate)  __P((void));
     93  1.1  jonathan 	void (*setTLBpid)  __P((int pid));
     94  1.1  jonathan 	void (*tlbFlush)  __P((void));
     95  1.1  jonathan 	void (*tlbFlushAddr)  __P((vm_offset_t)); /* XXX Really pte highpart ? */
     96  1.5    mhitch 	int (*tlbUpdate)  __P((u_int highreg, u_int lowreg));
     97  1.5    mhitch #ifdef MIPS3
     98  1.5    mhitch 	void (*tlbWriteIndexed)  __P((u_int, u_int, u_int, u_int));
     99  1.5    mhitch #else
    100  1.1  jonathan 	void (*tlbWriteIndexed)  __P((u_int, u_int, u_int));
    101  1.5    mhitch #endif
    102  1.5    mhitch 	void (*wbflush) __P((void));
    103  1.5    mhitch 	void (*proc_trampoline) __P((void));
    104  1.1  jonathan } mips_locore_jumpvec_t;
    105  1.1  jonathan 
    106  1.1  jonathan 
    107  1.1  jonathan /*
    108  1.1  jonathan  * The "active" locore-fuction vector, and
    109  1.1  jonathan 
    110  1.1  jonathan  */
    111  1.1  jonathan extern mips_locore_jumpvec_t mips_locore_jumpvec;
    112  1.1  jonathan extern mips_locore_jumpvec_t r2000_locore_vec;
    113  1.1  jonathan extern mips_locore_jumpvec_t r4000_locore_vec;
    114  1.1  jonathan 
    115  1.1  jonathan #define MachConfigCache		(*(mips_locore_jumpvec.configCache))
    116  1.1  jonathan #define MachFlushCache		(*(mips_locore_jumpvec.flushCache))
    117  1.1  jonathan #define MachFlushDCache		(*(mips_locore_jumpvec.flushDCache))
    118  1.1  jonathan #define MachFlushICache		(*(mips_locore_jumpvec.flushICache))
    119  1.1  jonathan #define MachForceCacheUpdate	(*(mips_locore_jumpvec.forceCacheUpdate))
    120  1.1  jonathan #define MachSetPID		(*(mips_locore_jumpvec.setTLBpid))
    121  1.1  jonathan #define MachTLBFlush		(*(mips_locore_jumpvec.tlbFlush))
    122  1.1  jonathan #define MachTLBFlushAddr	(*(mips_locore_jumpvec.tlbFlushAddr))
    123  1.1  jonathan #define MachTLBUpdate		(*(mips_locore_jumpvec.tlbUpdate))
    124  1.1  jonathan #define MachTLBWriteIndexed	(*(mips_locore_jumpvec.tlbWriteIndexed))
    125  1.5    mhitch #define wbflush			(*(mips_locore_jumpvec.wbflush))
    126  1.5    mhitch #define proc_trampoline		(mips_locore_jumpvec.proc_trampoline)
    127  1.1  jonathan 
    128  1.1  jonathan #endif	/* _MIPS_LOCORE_H */
    129