Home | History | Annotate | Line # | Download | only in include
cpu.h revision 1.90.16.12
      1 /*	$NetBSD: cpu.h,v 1.90.16.12 2010/01/15 06:46:58 matt Exp $	*/
      2 
      3 /*-
      4  * Copyright (c) 1992, 1993
      5  *	The Regents of the University of California.  All rights reserved.
      6  *
      7  * This code is derived from software contributed to Berkeley by
      8  * Ralph Campbell and Rick Macklem.
      9  *
     10  * Redistribution and use in source and binary forms, with or without
     11  * modification, are permitted provided that the following conditions
     12  * are met:
     13  * 1. Redistributions of source code must retain the above copyright
     14  *    notice, this list of conditions and the following disclaimer.
     15  * 2. Redistributions in binary form must reproduce the above copyright
     16  *    notice, this list of conditions and the following disclaimer in the
     17  *    documentation and/or other materials provided with the distribution.
     18  * 3. Neither the name of the University nor the names of its contributors
     19  *    may be used to endorse or promote products derived from this software
     20  *    without specific prior written permission.
     21  *
     22  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
     23  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
     24  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
     25  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
     26  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
     27  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
     28  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
     29  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
     30  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
     31  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
     32  * SUCH DAMAGE.
     33  *
     34  *	@(#)cpu.h	8.4 (Berkeley) 1/4/94
     35  */
     36 
     37 #ifndef _CPU_H_
     38 #define _CPU_H_
     39 
     40 #include <mips/cpuregs.h>
     41 
     42 /*
     43  * Exported definitions unique to NetBSD/mips cpu support.
     44  */
     45 
     46 #ifdef _KERNEL
     47 #ifndef _LOCORE
     48 #include <sys/cpu_data.h>
     49 #include <sys/device.h>
     50 
     51 #if defined(_KERNEL_OPT)
     52 #include "opt_lockdebug.h"
     53 #include "opt_multiprocessor.h"
     54 #endif
     55 
     56 struct pridtab {
     57 	int	cpu_cid;
     58 	int	cpu_pid;
     59 	int	cpu_rev;	/* -1 == wildcard */
     60 	int	cpu_copts;	/* -1 == wildcard */
     61 	int	cpu_isa;	/* -1 == probed (mips32/mips64) */
     62 	int	cpu_ntlb;	/* -1 == unknown, 0 == probed */
     63 	int	cpu_flags;
     64 	u_int	cpu_cp0flags;	/* presence of some cp0 regs */
     65 	u_int	cpu_cidflags;	/* company-specific flags */
     66 	const char	*cpu_name;
     67 };
     68 
     69 extern const struct pridtab *mycpu;
     70 
     71 /*
     72  * bitfield defines for cpu_cp0flags
     73  */
     74 #define  MIPS_CP0FL_USE		__BIT(0)	/* use these flags */
     75 #define  MIPS_CP0FL_ECC		__BIT(1)
     76 #define  MIPS_CP0FL_CACHE_ERR	__BIT(2)
     77 #define  MIPS_CP0FL_EIRR	__BIT(3)
     78 #define  MIPS_CP0FL_EIMR	__BIT(4)
     79 #define  MIPS_CP0FL_EBASE	__BIT(5)
     80 #define  MIPS_CP0FL_CONFIG	__BIT(6)
     81 #define  MIPS_CP0FL_CONFIGn(n)	(__BIT(7) << ((n) & 7))
     82 
     83 /*
     84  * cpu_cidflags defines, by company
     85  */
     86 /*
     87  * RMI company-specific cpu_cidflags
     88  */
     89 #define MIPS_CIDFL_RMI_TYPE     	__BITS(2,0)
     90 # define  CIDFL_RMI_TYPE_XLR     	0
     91 # define  CIDFL_RMI_TYPE_XLS     	1
     92 # define  CIDFL_RMI_TYPE_XLP     	2
     93 #define MIPS_CIDFL_RMI_THREADS_MASK	__BITS(6,3)
     94 # define MIPS_CIDFL_RMI_THREADS_SHIFT	3
     95 #define MIPS_CIDFL_RMI_CORES_MASK	__BITS(10,7)
     96 # define MIPS_CIDFL_RMI_CORES_SHIFT	7
     97 # define LOG2_1	0
     98 # define LOG2_2	1
     99 # define LOG2_4	2
    100 # define LOG2_8	3
    101 # define MIPS_CIDFL_RMI_CPUS(ncores, nthreads)				\
    102 		((LOG2_ ## ncores << MIPS_CIDFL_RMI_CORES_SHIFT)	\
    103 		|(LOG2_ ## nthreads << MIPS_CIDFL_RMI_THREADS_SHIFT))
    104 # define MIPS_CIDFL_RMI_NTHREADS(cidfl)					\
    105 		(1 << (((cidfl) & MIPS_CIDFL_RMI_THREADS_MASK)		\
    106 			>> MIPS_CIDFL_RMI_THREADS_SHIFT))
    107 # define MIPS_CIDFL_RMI_NCORES(cidfl)					\
    108 		(1 << (((cidfl) & MIPS_CIDFL_RMI_CORES_MASK)		\
    109 			>> MIPS_CIDFL_RMI_CORES_SHIFT))
    110 #define MIPS_CIDFL_RMI_L2SZ_MASK	__BITS(14,11)
    111 # define MIPS_CIDFL_RMI_L2SZ_SHIFT	11
    112 # define RMI_L2SZ_256KB	 0
    113 # define RMI_L2SZ_512KB  1
    114 # define RMI_L2SZ_1MB    2
    115 # define RMI_L2SZ_2MB    3
    116 # define RMI_L2SZ_4MB    4
    117 # define MIPS_CIDFL_RMI_L2(l2sz)					\
    118 		(RMI_L2SZ_ ## l2sz << MIPS_CIDFL_RMI_L2SZ_SHIFT)
    119 # define MIPS_CIDFL_RMI_L2SZ(cidfl)					\
    120 		((256*1024) << (((cidfl) & MIPS_CIDFL_RMI_L2SZ_MASK)	\
    121 			>> MIPS_CIDFL_RMI_L2SZ_SHIFT))
    122 
    123 
    124 
    125 struct cpu_info {
    126 	struct cpu_data ci_data;	/* MI per-cpu data */
    127 	struct cpu_info *ci_next;	/* Next CPU in list */
    128 	cpuid_t ci_cpuid;		/* Machine-level identifier */
    129 	u_long ci_cpu_freq;		/* CPU frequency */
    130 	u_long ci_cycles_per_hz;	/* CPU freq / hz */
    131 	u_long ci_divisor_delay;	/* for delay/DELAY */
    132 	u_long ci_divisor_recip;	/* unused, for obsolete microtime(9) */
    133 	struct lwp *ci_curlwp;		/* currently running lwp */
    134 	struct lwp *ci_fpcurlwp;	/* the current FPU owner */
    135 	int ci_want_resched;		/* user preemption pending */
    136 	int ci_mtx_count;		/* negative count of held mutexes */
    137 	int ci_mtx_oldspl;		/* saved SPL value */
    138 	int ci_idepth;			/* hardware interrupt depth */
    139 	device_t ci_dev;		/* owning device */
    140 	vaddr_t ci_ebase;		/* VA of exception base */
    141 	paddr_t ci_ebase_pa;		/* PA of exception base */
    142 	/*
    143 	 * Per-cpu pmap information
    144 	 */
    145 	uint32_t ci_pmap_asid_max;
    146 	uint32_t ci_pmap_asid_next;
    147 	uint32_t ci_pmap_asid_generation;
    148 	struct segtab *ci_pmap_segbase;
    149 };
    150 
    151 #define	CPU_INFO_ITERATOR		int
    152 #define	CPU_INFO_FOREACH(cii, ci)	\
    153     (void)(cii), ci = &cpu_info_store; ci != NULL; ci = ci->ci_next
    154 
    155 #endif /* !_LOCORE */
    156 #endif /* _KERNEL */
    157 
    158 /*
    159  * CTL_MACHDEP definitions.
    160  */
    161 #define CPU_CONSDEV		1	/* dev_t: console terminal device */
    162 #define CPU_BOOTED_KERNEL	2	/* string: booted kernel name */
    163 #define CPU_ROOT_DEVICE		3	/* string: root device name */
    164 #define CPU_LLSC		4	/* OS/CPU supports LL/SC instruction */
    165 
    166 /*
    167  * Platform can override, but note this breaks userland compatibility
    168  * with other mips platforms.
    169  */
    170 #ifndef CPU_MAXID
    171 #define CPU_MAXID		5	/* number of valid machdep ids */
    172 
    173 #endif
    174 
    175 #ifdef _KERNEL
    176 #if defined(_LKM) || defined(_STANDALONE)
    177 /* Assume all CPU architectures are valid for LKM's and standlone progs */
    178 #define	MIPS1	1
    179 #define	MIPS3	1
    180 #define	MIPS4	1
    181 #define	MIPS32	1
    182 #define	MIPS64	1
    183 #endif
    184 
    185 #if (MIPS1 + MIPS3 + MIPS4 + MIPS32 + MIPS64) == 0
    186 #error at least one of MIPS1, MIPS3, MIPS4, MIPS32 or MIPS64 must be specified
    187 #endif
    188 
    189 /* Shortcut for MIPS3 or above defined */
    190 #if defined(MIPS3) || defined(MIPS4) || defined(MIPS32) || defined(MIPS64)
    191 #define	MIPS3_PLUS	1
    192 #else
    193 #undef MIPS3_PLUS
    194 #endif
    195 
    196 /*
    197  * Macros to find the CPU architecture we're on at run-time,
    198  * or if possible, at compile-time.
    199  */
    200 
    201 #define	CPU_ARCH_MIPSx	0		/* XXX unknown */
    202 #define	CPU_ARCH_MIPS1	(1 << 0)
    203 #define	CPU_ARCH_MIPS2	(1 << 1)
    204 #define	CPU_ARCH_MIPS3	(1 << 2)
    205 #define	CPU_ARCH_MIPS4	(1 << 3)
    206 #define	CPU_ARCH_MIPS5	(1 << 4)
    207 #define	CPU_ARCH_MIPS32	(1 << 5)
    208 #define	CPU_ARCH_MIPS64	(1 << 6)
    209 
    210 /* Note: must be kept in sync with -ffixed-?? Makefile.mips. */
    211 #define MIPS_CURLWP             $23
    212 #define MIPS_CURLWP_QUOTED      "$23"
    213 #define MIPS_CURLWP_CARD	23
    214 #define	MIPS_CURLWP_FRAME(x)	FRAME_S7(x)
    215 
    216 #ifndef _LOCORE
    217 
    218 extern struct cpu_info cpu_info_store;
    219 register struct lwp *mips_curlwp asm(MIPS_CURLWP_QUOTED);
    220 
    221 #define	curlwp			mips_curlwp
    222 #define	curcpu()		(curlwp->l_cpu)
    223 #define	curpcb			((struct pcb *)curlwp->l_addr)
    224 #define	fpcurlwp		(curcpu()->ci_fpcurlwp)
    225 #define	cpu_number()		(0)
    226 #define	cpu_proc_fork(p1, p2)	((void)((p2)->p_md.md_abi = (p1)->p_md.md_abi))
    227 
    228 /* XXX simonb
    229  * Should the following be in a cpu_info type structure?
    230  * And how many of these are per-cpu vs. per-system?  (Ie,
    231  * we can assume that all cpus have the same mmu-type, but
    232  * maybe not that all cpus run at the same clock speed.
    233  * Some SGI's apparently support R12k and R14k in the same
    234  * box.)
    235  */
    236 extern int cpu_arch;
    237 extern int mips_cpu_flags;
    238 extern int mips_has_r4k_mmu;
    239 extern int mips_has_llsc;
    240 extern int mips3_pg_cached;
    241 #ifdef _LP64
    242 extern uint64_t mips3_xkphys_cached;
    243 #endif
    244 extern u_int mips3_pg_shift;
    245 
    246 #define	CPU_MIPS_R4K_MMU		0x0001
    247 #define	CPU_MIPS_NO_LLSC		0x0002
    248 #define	CPU_MIPS_CAUSE_IV		0x0004
    249 #define	CPU_MIPS_HAVE_SPECIAL_CCA	0x0008	/* Defaults to '3' if not set. */
    250 #define	CPU_MIPS_CACHED_CCA_MASK	0x0070
    251 #define	CPU_MIPS_CACHED_CCA_SHIFT	 4
    252 #define	CPU_MIPS_DOUBLE_COUNT		0x0080	/* 1 cp0 count == 2 clock cycles */
    253 #define	CPU_MIPS_USE_WAIT		0x0100	/* Use "wait"-based cpu_idle() */
    254 #define	CPU_MIPS_NO_WAIT		0x0200	/* Inverse of previous, for mips32/64 */
    255 #define	CPU_MIPS_D_CACHE_COHERENT	0x0400	/* D-cache is fully coherent */
    256 #define	CPU_MIPS_I_D_CACHE_COHERENT	0x0800	/* I-cache funcs don't need to flush the D-cache */
    257 #define	CPU_MIPS_NO_LLADDR		0x1000
    258 #define	CPU_MIPS_HAVE_MxCR		0x2000	/* have mfcr, mtcr insns */
    259 #define	MIPS_NOT_SUPP			0x8000
    260 
    261 #endif	/* !_LOCORE */
    262 
    263 #if ((MIPS1 + MIPS3 + MIPS4 + MIPS32 + MIPS64) == 1) || defined(_LOCORE)
    264 
    265 #if defined(MIPS1)
    266 
    267 # define CPUISMIPS3		0
    268 # define CPUIS64BITS		0
    269 # define CPUISMIPS32		0
    270 # define CPUISMIPS64		0
    271 # define CPUISMIPSNN		0
    272 # define MIPS_HAS_R4K_MMU	0
    273 # define MIPS_HAS_CLOCK		0
    274 # define MIPS_HAS_LLSC		0
    275 # define MIPS_HAS_LLADDR	0
    276 
    277 #elif defined(MIPS3) || defined(MIPS4)
    278 
    279 # define CPUISMIPS3		1
    280 # define CPUIS64BITS		1
    281 # define CPUISMIPS32		0
    282 # define CPUISMIPS64		0
    283 # define CPUISMIPSNN		0
    284 # define MIPS_HAS_R4K_MMU	1
    285 # define MIPS_HAS_CLOCK		1
    286 # if defined(_LOCORE)
    287 #  if !defined(MIPS3_5900) && !defined(MIPS3_4100)
    288 #   define MIPS_HAS_LLSC	1
    289 #  else
    290 #   define MIPS_HAS_LLSC	0
    291 #  endif
    292 # else	/* _LOCORE */
    293 #  define MIPS_HAS_LLSC		(mips_has_llsc)
    294 # endif	/* _LOCORE */
    295 # define MIPS_HAS_LLADDR	((mips_cpu_flags & CPU_MIPS_NO_LLADDR) == 0)
    296 
    297 #elif defined(MIPS32)
    298 
    299 # define CPUISMIPS3		1
    300 # define CPUIS64BITS		0
    301 # define CPUISMIPS32		1
    302 # define CPUISMIPS64		0
    303 # define CPUISMIPSNN		1
    304 # define MIPS_HAS_R4K_MMU	1
    305 # define MIPS_HAS_CLOCK		1
    306 # define MIPS_HAS_LLSC		1
    307 # define MIPS_HAS_LLADDR	((mips_cpu_flags & CPU_MIPS_NO_LLADDR) == 0)
    308 
    309 #elif defined(MIPS64)
    310 
    311 # define CPUISMIPS3		1
    312 # define CPUIS64BITS		1
    313 # define CPUISMIPS32		0
    314 # define CPUISMIPS64		1
    315 # define CPUISMIPSNN		1
    316 # define MIPS_HAS_R4K_MMU	1
    317 # define MIPS_HAS_CLOCK		1
    318 # define MIPS_HAS_LLSC		1
    319 # define MIPS_HAS_LLADDR	((mips_cpu_flags & CPU_MIPS_NO_LLADDR) == 0)
    320 
    321 #endif
    322 
    323 #else /* run-time test */
    324 
    325 #ifndef	_LOCORE
    326 
    327 #define	MIPS_HAS_R4K_MMU	(mips_has_r4k_mmu)
    328 #define	MIPS_HAS_LLSC		(mips_has_llsc)
    329 #define	MIPS_HAS_LLADDR		((mips_cpu_flags & CPU_MIPS_NO_LLADDR) == 0)
    330 
    331 /* This test is ... rather bogus */
    332 #define	CPUISMIPS3	((cpu_arch & \
    333 	(CPU_ARCH_MIPS3 | CPU_ARCH_MIPS4 | CPU_ARCH_MIPS32 | CPU_ARCH_MIPS64)) != 0)
    334 
    335 /* And these aren't much better while the previous test exists as is... */
    336 #define	CPUISMIPS32	((cpu_arch & CPU_ARCH_MIPS32) != 0)
    337 #define	CPUISMIPS64	((cpu_arch & CPU_ARCH_MIPS64) != 0)
    338 #define	CPUISMIPSNN	((cpu_arch & (CPU_ARCH_MIPS32 | CPU_ARCH_MIPS64)) != 0)
    339 #define	CPUIS64BITS	((cpu_arch & \
    340 	(CPU_ARCH_MIPS3 | CPU_ARCH_MIPS4 | CPU_ARCH_MIPS64)) != 0)
    341 
    342 #define	MIPS_HAS_CLOCK	(cpu_arch >= CPU_ARCH_MIPS3)
    343 
    344 #else	/* !_LOCORE */
    345 
    346 #define	MIPS_HAS_LLSC	0
    347 
    348 #endif	/* !_LOCORE */
    349 
    350 #endif /* run-time test */
    351 
    352 #ifndef	_LOCORE
    353 
    354 /*
    355  * definitions of cpu-dependent requirements
    356  * referenced in generic code
    357  */
    358 #define	cpu_swapout(p)			panic("cpu_swapout: can't get here");
    359 
    360 void cpu_intr(uint32_t, uint32_t, vaddr_t, uint32_t);
    361 
    362 /*
    363  * Arguments to hardclock and gatherstats encapsulate the previous
    364  * machine state in an opaque clockframe.
    365  */
    366 struct clockframe {
    367 	vaddr_t	pc;	/* program counter at time of interrupt */
    368 	uint32_t	sr;	/* status register at time of interrupt */
    369 	u_int		ppl;	/* previous priority level at time of interrupt */
    370 };
    371 
    372 /*
    373  * A port must provde CLKF_USERMODE() for use in machine-independent code.
    374  * These differ on r4000 and r3000 systems; provide them in the
    375  * port-dependent file that includes this one, using the macros below.
    376  */
    377 
    378 /* mips1 versions */
    379 #define	MIPS1_CLKF_USERMODE(framep)	((framep)->sr & MIPS_SR_KU_PREV)
    380 
    381 /* mips3 versions */
    382 #define	MIPS3_CLKF_USERMODE(framep)	((framep)->sr & MIPS_SR_KSU_USER)
    383 
    384 #define	CLKF_PC(framep)		((framep)->pc)
    385 #define	CLKF_INTR(framep)	(0)
    386 
    387 #if defined(MIPS3_PLUS) && !defined(MIPS1)		/* XXX bogus! */
    388 #define	CLKF_USERMODE(framep)	MIPS3_CLKF_USERMODE(framep)
    389 #endif
    390 
    391 #if !defined(MIPS3_PLUS) && defined(MIPS1)		/* XXX bogus! */
    392 #define	CLKF_USERMODE(framep)	MIPS1_CLKF_USERMODE(framep)
    393 #endif
    394 
    395 #if defined(MIPS3_PLUS) && defined(MIPS1)		/* XXX bogus! */
    396 #define CLKF_USERMODE(framep) \
    397     ((CPUISMIPS3) ? MIPS3_CLKF_USERMODE(framep):  MIPS1_CLKF_USERMODE(framep))
    398 #endif
    399 
    400 /*
    401  * This is used during profiling to integrate system time.  It can safely
    402  * assume that the process is resident.
    403  */
    404 #define	PROC_PC(p)							\
    405 	(((struct frame *)(p)->p_md.md_regs)->f_regs[37])	/* XXX PC */
    406 
    407 /*
    408  * Preempt the current process if in interrupt from user mode,
    409  * or after the current trap/syscall if in system mode.
    410  */
    411 void	cpu_need_resched(struct cpu_info *, int);
    412 
    413 /*
    414  * Give a profiling tick to the current process when the user profiling
    415  * buffer pages are invalid.  On the MIPS, request an ast to send us
    416  * through trap, marking the proc as needing a profiling tick.
    417  */
    418 #define	cpu_need_proftick(l)						\
    419 do {									\
    420 	(l)->l_pflag |= LP_OWEUPC;					\
    421 	aston(l);							\
    422 } while (/*CONSTCOND*/0)
    423 
    424 /*
    425  * Notify the current lwp (l) that it has a signal pending,
    426  * process as soon as possible.
    427  */
    428 #define	cpu_signotify(l)	aston(l)
    429 
    430 #define aston(l)		((l)->l_md.md_astpending = 1)
    431 
    432 /*
    433  * Misc prototypes and variable declarations.
    434  */
    435 struct lwp;
    436 struct user;
    437 
    438 extern struct segtab *segbase;		/* current segtab base */
    439 extern int mips_poolpage_vmfreelist;	/* freelist to allocate poolpages */
    440 
    441 /* copy.S */
    442 int8_t	ufetch_int8(void *);
    443 int16_t	ufetch_int16(void *);
    444 int32_t ufetch_int32(void *);
    445 uint8_t	ufetch_uint8(void *);
    446 uint16_t ufetch_uint16(void *);
    447 uint32_t ufetch_uint32(void *);
    448 int8_t	ufetch_int8_intrsafe(void *);
    449 int16_t	ufetch_int16_intrsafe(void *);
    450 int32_t ufetch_int32_intrsafe(void *);
    451 uint8_t	ufetch_uint8_intrsafe(void *);
    452 uint16_t ufetch_uint16_intrsafe(void *);
    453 uint32_t ufetch_uint32_intrsafe(void *);
    454 #ifdef _LP64
    455 int64_t ufetch_int64(void *);
    456 uint64_t ufetch_uint64(void *);
    457 int64_t ufetch_int64_intrsafe(void *);
    458 uint64_t ufetch_uint64_intrsafe(void *);
    459 #endif
    460 char	ufetch_char(void *);
    461 short	ufetch_short(void *);
    462 int	ufetch_int(void *);
    463 long	ufetch_long(void *);
    464 char	ufetch_char_intrsafe(void *);
    465 short	ufetch_short_intrsafe(void *);
    466 int	ufetch_int_intrsafe(void *);
    467 long	ufetch_long_intrsafe(void *);
    468 
    469 u_char	ufetch_uchar(void *);
    470 u_short	ufetch_ushort(void *);
    471 u_int	ufetch_uint(void *);
    472 u_long	ufetch_ulong(void *);
    473 u_char	ufetch_uchar_intrsafe(void *);
    474 u_short	ufetch_ushort_intrsafe(void *);
    475 u_int	ufetch_uint_intrsafe(void *);
    476 u_long	ufetch_ulong_intrsafe(void *);
    477 void 	*ufetch_ptr(void *);
    478 
    479 int	ustore_int8(void *, int8_t);
    480 int	ustore_int16(void *, int16_t);
    481 int	ustore_int32(void *, int32_t);
    482 int	ustore_uint8(void *, uint8_t);
    483 int	ustore_uint16(void *, uint16_t);
    484 int	ustore_uint32(void *, uint32_t);
    485 int	ustore_int8_intrsafe(void *, int8_t);
    486 int	ustore_int16_intrsafe(void *, int16_t);
    487 int	ustore_int32_intrsafe(void *, int32_t);
    488 int	ustore_uint8_intrsafe(void *, uint8_t);
    489 int	ustore_uint16_intrsafe(void *, uint16_t);
    490 int	ustore_uint32_intrsafe(void *, uint32_t);
    491 #ifdef _LP64
    492 int	ustore_int64(void *, int64_t);
    493 int	ustore_uint64(void *, uint64_t);
    494 int	ustore_int64_intrsafe(void *, int64_t);
    495 int	ustore_uint64_intrsafe(void *, uint64_t);
    496 #endif
    497 int	ustore_char(void *, char);
    498 int	ustore_char_intrsafe(void *, char);
    499 int	ustore_short(void *, short);
    500 int	ustore_short_intrsafe(void *, short);
    501 int	ustore_int(void *, int);
    502 int	ustore_int_intrsafe(void *, int);
    503 int	ustore_long(void *, long);
    504 int	ustore_long_intrsafe(void *, long);
    505 int	ustore_uchar(void *, u_char);
    506 int	ustore_uchar_intrsafe(void *, u_char);
    507 int	ustore_ushort(void *, u_short);
    508 int	ustore_ushort_intrsafe(void *, u_short);
    509 int	ustore_uint(void *, u_int);
    510 int	ustore_uint_intrsafe(void *, u_int);
    511 int	ustore_ulong(void *, u_long);
    512 int	ustore_ulong_intrsafe(void *, u_long);
    513 int 	ustore_ptr(void *, void *);
    514 int	ustore_ptr_intrsafe(void *, void *);
    515 
    516 int	ustore_uint32_isync(void *, uint32_t);
    517 
    518 /* trap.c */
    519 void	netintr(void);
    520 int	kdbpeek(vaddr_t);
    521 
    522 /* mips_machdep.c */
    523 struct mips_vmfreelist;
    524 struct phys_ram_seg;
    525 void	dumpsys(void);
    526 int	savectx(struct user *);
    527 void	mips_init_msgbuf(void);
    528 void	mips_init_lwp0_uarea(void);
    529 void	mips_page_physload(vaddr_t, vaddr_t,
    530 	    const struct phys_ram_seg *, size_t,
    531 	    const struct mips_vmfreelist *, size_t);
    532 void	savefpregs(struct lwp *);
    533 void	loadfpregs(struct lwp *);
    534 
    535 /* locore*.S */
    536 int	badaddr(void *, size_t);
    537 int	badaddr64(uint64_t, size_t);
    538 
    539 /* mips_machdep.c */
    540 void	cpu_identify(device_t);
    541 void	mips_vector_init(void);
    542 
    543 #endif /* ! _LOCORE */
    544 #endif /* _KERNEL */
    545 #endif /* _CPU_H_ */
    546