Home | History | Annotate | Line # | Download | only in include
cpu.h revision 1.12
      1  1.12       ryo /*	$NetBSD: cpu.h,v 1.12 2021/11/02 11:26:04 ryo Exp $	*/
      2   1.1     skrll 
      3   1.1     skrll /*	$OpenBSD: cpu.h,v 1.55 2008/07/23 17:39:35 kettenis Exp $	*/
      4   1.1     skrll 
      5   1.1     skrll /*
      6   1.1     skrll  * Copyright (c) 2000-2004 Michael Shalayeff
      7   1.1     skrll  * All rights reserved.
      8   1.1     skrll  *
      9   1.1     skrll  * Redistribution and use in source and binary forms, with or without
     10   1.1     skrll  * modification, are permitted provided that the following conditions
     11   1.1     skrll  * are met:
     12   1.1     skrll  * 1. Redistributions of source code must retain the above copyright
     13   1.1     skrll  *    notice, this list of conditions and the following disclaimer.
     14   1.1     skrll  * 2. Redistributions in binary form must reproduce the above copyright
     15   1.1     skrll  *    notice, this list of conditions and the following disclaimer in the
     16   1.1     skrll  *    documentation and/or other materials provided with the distribution.
     17   1.1     skrll  *
     18   1.1     skrll  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
     19   1.1     skrll  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
     20   1.1     skrll  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
     21   1.1     skrll  * IN NO EVENT SHALL THE AUTHOR OR HIS RELATIVES BE LIABLE FOR ANY DIRECT,
     22   1.1     skrll  * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
     23   1.1     skrll  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
     24   1.1     skrll  * SERVICES; LOSS OF MIND, USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
     25   1.1     skrll  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
     26   1.1     skrll  * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
     27   1.1     skrll  * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
     28   1.1     skrll  * THE POSSIBILITY OF SUCH DAMAGE.
     29   1.1     skrll  */
     30   1.1     skrll /*
     31   1.1     skrll  * Copyright (c) 1988-1994, The University of Utah and
     32   1.1     skrll  * the Computer Systems Laboratory at the University of Utah (CSL).
     33   1.1     skrll  * All rights reserved.
     34   1.1     skrll  *
     35   1.1     skrll  * Permission to use, copy, modify and distribute this software is hereby
     36   1.1     skrll  * granted provided that (1) source code retains these copyright, permission,
     37   1.1     skrll  * and disclaimer notices, and (2) redistributions including binaries
     38   1.1     skrll  * reproduce the notices in supporting documentation, and (3) all advertising
     39   1.1     skrll  * materials mentioning features or use of this software display the following
     40   1.1     skrll  * acknowledgement: ``This product includes software developed by the
     41   1.1     skrll  * Computer Systems Laboratory at the University of Utah.''
     42   1.1     skrll  *
     43   1.1     skrll  * THE UNIVERSITY OF UTAH AND CSL ALLOW FREE USE OF THIS SOFTWARE IN ITS "AS
     44   1.1     skrll  * IS" CONDITION.  THE UNIVERSITY OF UTAH AND CSL DISCLAIM ANY LIABILITY OF
     45   1.1     skrll  * ANY KIND FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
     46   1.1     skrll  *
     47   1.1     skrll  * CSL requests users of this software to return to csl-dist (at) cs.utah.edu any
     48   1.1     skrll  * improvements that they make and grant CSL redistribution rights.
     49   1.1     skrll  *
     50   1.9     skrll  * 	Utah $Hdr: cpu.h 1.19 94/12/16$
     51   1.1     skrll  */
     52   1.1     skrll 
     53   1.1     skrll #ifndef	_MACHINE_CPU_H_
     54   1.1     skrll #define	_MACHINE_CPU_H_
     55   1.1     skrll 
     56   1.1     skrll #ifdef _KERNEL_OPT
     57   1.1     skrll #include "opt_cputype.h"
     58  1.11       ryo #include "opt_gprof.h"
     59   1.1     skrll #include "opt_multiprocessor.h"
     60   1.1     skrll #endif
     61   1.1     skrll 
     62   1.1     skrll #include <machine/trap.h>
     63   1.1     skrll #include <machine/frame.h>
     64   1.1     skrll #include <machine/reg.h>
     65   1.1     skrll #include <machine/intrdefs.h>
     66   1.1     skrll 
     67   1.1     skrll #ifndef __ASSEMBLER__
     68   1.1     skrll #include <machine/intr.h>
     69   1.1     skrll #endif
     70   1.1     skrll 
     71   1.1     skrll #ifndef _LOCORE
     72   1.1     skrll 
     73   1.1     skrll /* types */
     74   1.1     skrll enum hppa_cpu_type {
     75   1.1     skrll 	hpc_unknown,
     76   1.1     skrll 	hpcx,	/* PA7000 (x)		PA 1.0 */
     77   1.1     skrll 	hpcxs,	/* PA7000 (s)		PA 1.1a */
     78   1.1     skrll 	hpcxt,	/* PA7100 (t)		PA 1.1b */
     79   1.1     skrll 	hpcxl,	/* PA7100LC (l)		PA 1.1c */
     80   1.1     skrll 	hpcxtp,	/* PA7200 (t')		PA 1.1d */
     81   1.1     skrll 	hpcxl2,	/* PA7300LC (l2)	PA 1.1e */
     82   1.1     skrll 	hpcxu,	/* PA8000 (u)		PA 2.0 */
     83   1.5     skrll 	hpcxup,	/* PA8200 (u+)		PA 2.0 */
     84   1.1     skrll 	hpcxw,	/* PA8500 (w)		PA 2.0 */
     85   1.1     skrll 	hpcxwp,	/* PA8600 (w+)		PA 2.0 */
     86   1.1     skrll 	hpcxw2, /* PA8700 (piranha)	PA 2.0 */
     87   1.1     skrll 	mako	/* PA8800 (mako)	PA 2.0 */
     88   1.1     skrll };
     89   1.1     skrll 
     90   1.3  christos #ifdef _KERNEL
     91   1.1     skrll /*
     92   1.1     skrll  * A CPU description.
     93   1.1     skrll  */
     94   1.1     skrll struct hppa_cpu_info {
     95   1.1     skrll 	/* The official name of the chip. */
     96   1.1     skrll 	const char *hci_chip_name;
     97   1.1     skrll 
     98   1.1     skrll 	/* The nickname for the chip. */
     99   1.1     skrll 	const char *hci_chip_nickname;
    100   1.1     skrll 
    101   1.1     skrll 	/* The type and PA-RISC specification of the chip. */
    102   1.1     skrll 	const char hci_chip_type[8];
    103   1.1     skrll 	enum hppa_cpu_type hci_cputype;
    104   1.1     skrll 	int  hci_cpuversion;
    105   1.1     skrll 	int  hci_features;		/* CPU types and features */
    106   1.1     skrll #define	HPPA_FTRS_TLBU		0x00000001
    107   1.1     skrll #define	HPPA_FTRS_BTLBU		0x00000002
    108   1.1     skrll #define	HPPA_FTRS_HVT		0x00000004
    109   1.1     skrll #define	HPPA_FTRS_W32B		0x00000008
    110   1.1     skrll 
    111   1.1     skrll 	const char *hci_chip_spec;
    112   1.1     skrll 
    113   1.1     skrll 	int (*desidhash)(void);
    114   1.1     skrll 	const u_int *itlbh, *dtlbh, *itlbnah, *dtlbnah, *tlbdh;
    115   1.1     skrll 	int (*dbtlbins)(int, pa_space_t, vaddr_t, paddr_t, vsize_t, u_int);
    116   1.1     skrll 	int (*ibtlbins)(int, pa_space_t, vaddr_t, paddr_t, vsize_t, u_int);
    117   1.1     skrll 	int (*btlbprg)(int);
    118   1.1     skrll 	int (*hptinit)(vaddr_t, vsize_t);
    119   1.1     skrll };
    120   1.1     skrll 
    121   1.1     skrll extern const struct hppa_cpu_info *hppa_cpu_info;
    122   1.1     skrll extern int cpu_modelno;
    123   1.1     skrll extern int cpu_revision;
    124   1.1     skrll #endif
    125   1.1     skrll #endif
    126   1.1     skrll 
    127   1.1     skrll /*
    128   1.1     skrll  * COPR/SFUs
    129   1.1     skrll  */
    130   1.1     skrll #define	HPPA_FPUS	0xc0
    131   1.1     skrll #define	HPPA_PMSFUS	0x20	/* ??? */
    132   1.1     skrll 
    133   1.1     skrll /*
    134   1.1     skrll  * Exported definitions unique to hppa/PA-RISC cpu support.
    135   1.1     skrll  */
    136   1.1     skrll 
    137   1.1     skrll /*
    138   1.1     skrll  * COPR/SFUs
    139   1.1     skrll  */
    140   1.1     skrll #define	HPPA_FPUVER(w)	(((w) & 0x003ff800) >> 11)
    141   1.1     skrll #define	HPPA_FPU_OP(w)	((w) >> 26)
    142   1.1     skrll #define	HPPA_FPU_UNMPL	0x01	/* exception reg, the rest is << 1 */
    143   1.1     skrll #define	HPPA_FPU_ILL	0x80	/* software-only */
    144   1.1     skrll #define	HPPA_FPU_I	0x01
    145   1.1     skrll #define	HPPA_FPU_U	0x02
    146   1.1     skrll #define	HPPA_FPU_O	0x04
    147   1.1     skrll #define	HPPA_FPU_Z	0x08
    148   1.1     skrll #define	HPPA_FPU_V	0x10
    149   1.1     skrll #define	HPPA_FPU_D	0x20
    150   1.1     skrll #define	HPPA_FPU_T	0x40
    151   1.1     skrll #define	HPPA_FPU_XMASK	0x7f
    152   1.1     skrll #define	HPPA_FPU_T_POS	25
    153   1.1     skrll #define	HPPA_FPU_RM	0x00000600
    154   1.1     skrll #define	HPPA_FPU_CQ	0x00fff800
    155   1.1     skrll #define	HPPA_FPU_C	0x04000000
    156   1.1     skrll #define	HPPA_FPU_FLSH	27
    157   1.1     skrll #define	HPPA_FPU_INIT	(0)
    158   1.1     skrll #define	HPPA_FPU_FORK(s) ((s) & ~((uint64_t)(HPPA_FPU_XMASK) << 32))
    159   1.1     skrll 
    160   1.1     skrll /*
    161   1.1     skrll  * definitions of cpu-dependent requirements
    162   1.1     skrll  * referenced in generic code
    163   1.1     skrll  */
    164   1.1     skrll #if defined(HP8000_CPU) || defined(HP8200_CPU) || \
    165   1.1     skrll     defined(HP8500_CPU) || defined(HP8600_CPU)
    166   1.1     skrll 
    167   1.1     skrll /* PA2.0 aliases */
    168   1.1     skrll #define	HPPA_PGALIAS	0x00400000
    169   1.1     skrll #define	HPPA_PGAMASK	0xffc00000	/* PA bits 0-9 not used in index */
    170   1.1     skrll #define	HPPA_PGAOFF	0x003fffff
    171   1.1     skrll 
    172   1.1     skrll #else
    173   1.1     skrll 
    174   1.1     skrll /* PA1.x aliases */
    175   1.1     skrll #define	HPPA_PGALIAS	0x00100000
    176   1.1     skrll #define	HPPA_PGAMASK	0xfff00000	/* PA bits 0-11 not used in index */
    177   1.1     skrll #define	HPPA_PGAOFF	0x000fffff
    178   1.1     skrll 
    179   1.1     skrll #endif
    180   1.1     skrll 
    181   1.1     skrll #define	HPPA_SPAMASK	0xf0f0f000	/* PA bits 0-3,8-11,16-19 not used */
    182   1.1     skrll 
    183   1.1     skrll #define	HPPA_IOSPACE	0xf0000000
    184   1.1     skrll #define	HPPA_IOLEN      0x10000000
    185   1.1     skrll #define	HPPA_PDC_LOW	0xef000000
    186   1.1     skrll #define	HPPA_PDC_HIGH	0xf1000000
    187   1.1     skrll #define	HPPA_IOBCAST	0xfffc0000
    188   1.1     skrll #define	HPPA_LBCAST	0xfffc0000
    189   1.1     skrll #define	HPPA_GBCAST	0xfffe0000
    190   1.1     skrll #define	HPPA_FPA	0xfff80000
    191   1.1     skrll #define	HPPA_FLEX_DATA	0xfff80001
    192   1.1     skrll #define	HPPA_DMA_ENABLE	0x00000001
    193   1.1     skrll #define	HPPA_SPA_ENABLE	0x00000020
    194   1.1     skrll #define	HPPA_NMODSPBUS	64
    195   1.1     skrll 
    196   1.1     skrll #ifdef MULTIPROCESSOR
    197   1.1     skrll 
    198   1.1     skrll #define	GET_CURCPU(r)		mfctl CR_CURCPU, r
    199   1.1     skrll #define	GET_CURCPU_SPACE(s, r)	GET_CURCPU(r)
    200   1.1     skrll #define	GET_CURLWP(r)		mfctl CR_CURCPU, r ! ldw CI_CURLWP(r), r
    201   1.1     skrll #define	GET_CURLWP_SPACE(s, r)	mfctl CR_CURCPU, r ! ldw CI_CURLWP(s, r), r
    202   1.1     skrll 
    203   1.1     skrll #define	SET_CURLWP(r,t)		mfctl CR_CURCPU, t ! stw r, CI_CURLWP(t)
    204   1.1     skrll 
    205   1.1     skrll #else /*  MULTIPROCESSOR */
    206   1.1     skrll 
    207   1.1     skrll #define	GET_CURCPU(r)		mfctl CR_CURLWP, r ! ldw L_CPU(r), r
    208   1.1     skrll #define	GET_CURCPU_SPACE(s, r)	mfctl CR_CURLWP, r ! ldw L_CPU(s, r), r
    209   1.1     skrll #define	GET_CURLWP(r)		mfctl CR_CURLWP, r
    210   1.1     skrll #define	GET_CURLWP_SPACE(s, r)	GET_CURLWP(r)
    211   1.1     skrll 
    212   1.1     skrll #define	SET_CURLWP(r,t) mtctl   r, CR_CURLWP
    213   1.1     skrll 
    214   1.1     skrll #endif /*  MULTIPROCESSOR */
    215   1.1     skrll 
    216   1.1     skrll #ifndef _LOCORE
    217   1.1     skrll #ifdef _KERNEL
    218   1.1     skrll 
    219   1.1     skrll /*
    220   1.1     skrll  * External definitions unique to PA-RISC cpu support.
    221   1.1     skrll  * These are the "public" declarations - those needed in
    222   1.1     skrll  * machine-independent source code.  The "private" ones
    223   1.1     skrll  * are in machdep.h.
    224   1.1     skrll  *
    225   1.1     skrll  * Note that the name of this file is NOT meant to imply
    226   1.1     skrll  * that it has anything to do with PA-RISC CPU stuff.
    227   1.1     skrll  * The name "cpu" is historical, and used in the common
    228   1.1     skrll  * code to identify machine-dependent functions, etc.
    229   1.1     skrll  */
    230   1.1     skrll 
    231   1.1     skrll /* clockframe describes the system before we took an interrupt. */
    232   1.1     skrll struct clockframe {
    233   1.1     skrll 	int	cf_flags;
    234   1.1     skrll 	int	cf_spl;
    235   1.1     skrll 	u_int	cf_pc;
    236   1.1     skrll };
    237   1.1     skrll #define	CLKF_PC(framep)		((framep)->cf_pc)
    238   1.1     skrll #define	CLKF_INTR(framep)	((framep)->cf_flags & TFF_INTR)
    239   1.1     skrll #define	CLKF_USERMODE(framep)	((framep)->cf_flags & T_USER)
    240   1.1     skrll 
    241   1.1     skrll int	clock_intr(void *);
    242   1.1     skrll 
    243   1.1     skrll /*
    244   1.1     skrll  * LWP_PC: the program counter for the given lwp.
    245   1.1     skrll  */
    246   1.1     skrll #define	LWP_PC(l)		((l)->l_md.md_regs->tf_iioq_head)
    247   1.1     skrll 
    248   1.1     skrll #define	cpu_signotify(l)	(setsoftast(l))
    249   1.1     skrll #define	cpu_need_proftick(l)	((l)->l_pflag |= LP_OWEUPC, setsoftast(l))
    250   1.1     skrll 
    251   1.1     skrll #endif /* _KERNEL */
    252   1.1     skrll 
    253   1.1     skrll #ifndef __ASSEMBLER__
    254   1.1     skrll #if defined(_KERNEL) || defined(_KMEMUSER)
    255   1.1     skrll 
    256   1.1     skrll #include <sys/cpu_data.h>
    257   1.1     skrll #include <sys/evcnt.h>
    258   1.1     skrll 
    259   1.1     skrll /*
    260   1.1     skrll  * Note that the alignment of ci_trap_save is important since we want to keep
    261   1.1     skrll  * it within a single cache line.  As a result, it must be kept as the first
    262   1.1     skrll  * entry within the cpu_info struct.
    263   1.1     skrll  */
    264   1.1     skrll struct cpu_info {
    265   1.1     skrll 	/* Keep this first to simplify the trap handlers */
    266   1.1     skrll 	register_t	ci_trapsave[16];/* the "phys" part of frame */
    267   1.1     skrll 
    268   1.1     skrll 	struct cpu_data ci_data;	/* MI per-cpu data */
    269   1.1     skrll 
    270   1.1     skrll #ifndef _KMEMUSER
    271   1.1     skrll 	hppa_hpa_t	ci_hpa;
    272   1.1     skrll 	register_t	ci_psw;		/* Processor Status Word. */
    273   1.1     skrll 	paddr_t		ci_fpu_state;	/* LWP FPU state address, or zero. */
    274   1.1     skrll 	u_long		ci_itmr;
    275   1.1     skrll 
    276   1.1     skrll 	int		ci_cpuid;	/* CPU index (see cpus[] array) */
    277   1.1     skrll 	int		ci_mtx_count;
    278   1.1     skrll 	int		ci_mtx_oldspl;
    279   1.1     skrll 	int		ci_want_resched;
    280   1.1     skrll 
    281   1.1     skrll 	volatile int	ci_cpl;
    282   1.1     skrll 	volatile int	ci_ipending;	/* The pending interrupts. */
    283   1.1     skrll 	u_int		ci_intr_depth;	/* Nonzero iff running an interrupt. */
    284   1.1     skrll 	u_int		ci_ishared;
    285   1.1     skrll 	u_int		ci_eiem;
    286   1.1     skrll 
    287   1.1     skrll 	u_int		ci_imask[NIPL];
    288   1.1     skrll 
    289   1.1     skrll 	struct hppa_interrupt_register	ci_ir;
    290   1.1     skrll 	struct hppa_interrupt_bit	ci_ib[HPPA_INTERRUPT_BITS];
    291   1.5     skrll 
    292   1.7     skrll 	struct lwp	*ci_onproc;	/* current user LWP / kthread */
    293   1.1     skrll #if defined(MULTIPROCESSOR)
    294   1.1     skrll 	struct lwp	*ci_curlwp;	/* CPU owner */
    295   1.1     skrll 	paddr_t		ci_stack;	/* stack for spin up */
    296   1.1     skrll 	volatile int	ci_flags;	/* CPU status flags */
    297   1.1     skrll #define	CPUF_PRIMARY	0x0001		/* ... is monarch/primary */
    298   1.1     skrll #define	CPUF_RUNNING	0x0002 		/* ... is running. */
    299   1.1     skrll 
    300   1.1     skrll 	volatile u_long	ci_ipi;		/* IPIs pending */
    301   1.1     skrll 
    302   1.1     skrll 	struct cpu_softc *ci_softc;
    303   1.1     skrll #endif
    304  1.11       ryo #if defined(GPROF) && defined(MULTIPROCESSOR)
    305  1.11       ryo 	struct gmonparam *ci_gmon;	/* MI per-cpu GPROF */
    306  1.11       ryo #endif
    307   1.1     skrll #endif /* !_KMEMUSER */
    308   1.1     skrll } __aligned(64);
    309   1.1     skrll 
    310   1.1     skrll #endif /* _KERNEL || _KMEMUSER */
    311   1.1     skrll #endif /* __ASSEMBLER__ */
    312   1.1     skrll 
    313   1.1     skrll #if defined(_KERNEL)
    314   1.1     skrll 
    315   1.1     skrll /*
    316   1.1     skrll  * definitions of cpu-dependent requirements
    317   1.1     skrll  * referenced in generic code
    318   1.1     skrll  */
    319   1.1     skrll 
    320   1.2     skrll void	cpu_proc_fork(struct proc *, struct proc *);
    321   1.1     skrll 
    322  1.10     skrll struct lwp *hppa_curlwp(void);
    323  1.10     skrll struct cpu_info *hppa_curcpu(void);
    324  1.10     skrll 
    325  1.10     skrll #if defined(_MODULE)
    326  1.10     skrll #define	curcpu()			hppa_curcpu()
    327  1.10     skrll #define	curlwp				hppa_curlwp()
    328  1.10     skrll #endif
    329   1.1     skrll 
    330  1.10     skrll #if defined(MULTIPROCESSOR) || defined(_MODULE)
    331   1.1     skrll /* Number of CPUs in the system */
    332   1.1     skrll extern int hppa_ncpu;
    333   1.1     skrll 
    334   1.1     skrll #define	HPPA_MAXCPUS	4
    335  1.10     skrll 
    336   1.1     skrll #define	cpu_number()			(curcpu()->ci_cpuid)
    337   1.1     skrll 
    338   1.1     skrll #define	CPU_IS_PRIMARY(ci)		((ci)->ci_cpuid == 0)
    339   1.1     skrll #define	CPU_INFO_ITERATOR		int
    340   1.1     skrll #define	CPU_INFO_FOREACH(cii, ci)	cii = 0, ci =  &cpus[0]; cii < hppa_ncpu; cii++, ci++
    341   1.1     skrll 
    342   1.1     skrll void	cpu_boot_secondary_processors(void);
    343   1.1     skrll 
    344  1.10     skrll #if !defined(_MODULE)
    345  1.12       ryo static __inline __always_inline struct cpu_info *
    346  1.10     skrll _hppa_curcpu(void)
    347   1.1     skrll {
    348   1.1     skrll 	struct cpu_info *ci;
    349   1.1     skrll 
    350   1.1     skrll 	__asm volatile("mfctl %1, %0" : "=r" (ci): "i" (CR_CURCPU));
    351   1.1     skrll 
    352   1.1     skrll 	return ci;
    353   1.1     skrll }
    354   1.1     skrll 
    355  1.10     skrll #define	curcpu()			_hppa_curcpu()
    356  1.10     skrll #endif
    357   1.1     skrll 
    358   1.1     skrll #else /*  MULTIPROCESSOR */
    359   1.1     skrll 
    360   1.1     skrll #define	HPPA_MAXCPUS	1
    361   1.1     skrll #define	curcpu()			(&cpus[0])
    362   1.1     skrll #define	cpu_number()			0
    363   1.1     skrll 
    364   1.1     skrll static __inline struct lwp *
    365  1.10     skrll _hppa_curlwp(void)
    366   1.1     skrll {
    367   1.1     skrll 	struct lwp *l;
    368   1.1     skrll 
    369   1.1     skrll 	__asm volatile("mfctl %1, %0" : "=r" (l): "i" (CR_CURLWP));
    370   1.1     skrll 
    371   1.1     skrll 	return l;
    372   1.1     skrll }
    373   1.1     skrll 
    374  1.10     skrll #define	curlwp				_hppa_curlwp()
    375   1.1     skrll 
    376   1.1     skrll #endif /* MULTIPROCESSOR */
    377   1.1     skrll 
    378   1.1     skrll extern struct cpu_info cpus[HPPA_MAXCPUS];
    379   1.1     skrll 
    380   1.1     skrll #define	DELAY(x) delay(x)
    381   1.1     skrll 
    382   1.1     skrll static __inline paddr_t
    383   1.1     skrll kvtop(const void *va)
    384   1.1     skrll {
    385   1.1     skrll 	paddr_t pa;
    386   1.1     skrll 
    387   1.1     skrll 	__asm volatile ("lpa %%r0(%1), %0" : "=r" (pa) : "r" (va));
    388   1.1     skrll 	return pa;
    389   1.1     skrll }
    390   1.1     skrll 
    391   1.1     skrll extern int (*cpu_desidhash)(void);
    392   1.1     skrll 
    393   1.1     skrll static __inline bool
    394   1.1     skrll hppa_cpu_ispa20_p(void)
    395   1.1     skrll {
    396   1.1     skrll 
    397   1.1     skrll 	return (hppa_cpu_info->hci_features & HPPA_FTRS_W32B) != 0;
    398   1.1     skrll }
    399   1.1     skrll 
    400   1.1     skrll static __inline bool
    401   1.1     skrll hppa_cpu_hastlbu_p(void)
    402   1.1     skrll {
    403   1.1     skrll 
    404   1.1     skrll 	return (hppa_cpu_info->hci_features & HPPA_FTRS_TLBU) != 0;
    405   1.1     skrll }
    406   1.1     skrll 
    407   1.1     skrll void	delay(u_int);
    408   1.1     skrll void	hppa_init(paddr_t, void *);
    409   1.1     skrll void	trap(int, struct trapframe *);
    410   1.1     skrll void	hppa_ras(struct lwp *);
    411   1.1     skrll int	spcopy(pa_space_t, const void *, pa_space_t, void *, size_t);
    412   1.1     skrll int	spstrcpy(pa_space_t, const void *, pa_space_t, void *, size_t,
    413   1.1     skrll     size_t *);
    414   1.1     skrll int	copy_on_fault(void);
    415   1.1     skrll void	lwp_trampoline(void);
    416   1.1     skrll int	cpu_dumpsize(void);
    417   1.1     skrll int	cpu_dump(void);
    418   1.1     skrll 
    419   1.1     skrll #ifdef MULTIPROCESSOR
    420   1.1     skrll void	cpu_boot_secondary_processors(void);
    421   1.1     skrll void	cpu_hw_init(void);
    422   1.1     skrll void	cpu_hatch(void);
    423   1.1     skrll #endif
    424   1.1     skrll #endif	/* _KERNEL */
    425   1.1     skrll 
    426   1.1     skrll /*
    427   1.1     skrll  * Boot arguments stuff
    428   1.1     skrll  */
    429   1.1     skrll 
    430   1.1     skrll #define	BOOTARG_LEN	(PAGE_SIZE)
    431   1.1     skrll #define	BOOTARG_OFF	(0x10000)
    432   1.1     skrll 
    433   1.1     skrll /*
    434   1.1     skrll  * CTL_MACHDEP definitions.
    435   1.1     skrll  */
    436   1.1     skrll #define	CPU_CONSDEV		1	/* dev_t: console terminal device */
    437   1.1     skrll #define	CPU_BOOTED_KERNEL	2	/* string: booted kernel name */
    438   1.1     skrll #define	CPU_LCD_BLINK           3	/* int: twiddle heartbeat LED/LCD */
    439   1.1     skrll 
    440   1.1     skrll #ifdef _KERNEL
    441   1.1     skrll #include <sys/queue.h>
    442   1.1     skrll 
    443   1.1     skrll struct blink_lcd {
    444   1.1     skrll 	void (*bl_func)(void *, int);
    445   1.1     skrll 	void *bl_arg;
    446   1.1     skrll 	SLIST_ENTRY(blink_lcd) bl_next;
    447   1.1     skrll };
    448   1.1     skrll 
    449   1.1     skrll extern void blink_lcd_register(struct blink_lcd *);
    450   1.1     skrll #endif	/* _KERNEL */
    451   1.1     skrll #endif	/* !_LOCORE */
    452   1.1     skrll 
    453   1.1     skrll #endif /* _MACHINE_CPU_H_ */
    454