Home | History | Annotate | Line # | Download | only in include
cpu.h revision 1.85
      1  1.85      matt /*	$NetBSD: cpu.h,v 1.85 2011/06/21 04:21:17 matt Exp $	*/
      2   1.1        ws 
      3   1.1        ws /*
      4   1.5        ws  * Copyright (C) 1999 Wolfgang Solfrank.
      5   1.5        ws  * Copyright (C) 1999 TooLs GmbH.
      6   1.9      matt  * Copyright (C) 1995-1997 Wolfgang Solfrank.
      7   1.9      matt  * Copyright (C) 1995-1997 TooLs GmbH.
      8   1.1        ws  * All rights reserved.
      9   1.1        ws  *
     10   1.1        ws  * Redistribution and use in source and binary forms, with or without
     11   1.1        ws  * modification, are permitted provided that the following conditions
     12   1.1        ws  * are met:
     13   1.1        ws  * 1. Redistributions of source code must retain the above copyright
     14   1.1        ws  *    notice, this list of conditions and the following disclaimer.
     15   1.1        ws  * 2. Redistributions in binary form must reproduce the above copyright
     16   1.1        ws  *    notice, this list of conditions and the following disclaimer in the
     17   1.1        ws  *    documentation and/or other materials provided with the distribution.
     18   1.1        ws  * 3. All advertising materials mentioning features or use of this software
     19   1.1        ws  *    must display the following acknowledgement:
     20   1.1        ws  *	This product includes software developed by TooLs GmbH.
     21   1.1        ws  * 4. The name of TooLs GmbH may not be used to endorse or promote products
     22   1.1        ws  *    derived from this software without specific prior written permission.
     23   1.1        ws  *
     24   1.1        ws  * THIS SOFTWARE IS PROVIDED BY TOOLS GMBH ``AS IS'' AND ANY EXPRESS OR
     25   1.1        ws  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
     26   1.1        ws  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
     27   1.1        ws  * IN NO EVENT SHALL TOOLS GMBH BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
     28   1.1        ws  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
     29   1.1        ws  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
     30   1.1        ws  * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
     31   1.1        ws  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
     32   1.1        ws  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
     33   1.1        ws  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
     34   1.1        ws  */
     35   1.5        ws #ifndef	_POWERPC_CPU_H_
     36   1.5        ws #define	_POWERPC_CPU_H_
     37   1.1        ws 
     38  1.27      matt struct cache_info {
     39  1.27      matt 	int dcache_size;
     40  1.27      matt 	int dcache_line_size;
     41  1.27      matt 	int icache_size;
     42  1.27      matt 	int icache_line_size;
     43  1.27      matt };
     44  1.27      matt 
     45  1.73       phx #if defined(_KERNEL) || defined(_KMEMUSER)
     46   1.9      matt #if defined(_KERNEL_OPT)
     47   1.9      matt #include "opt_lockdebug.h"
     48  1.83      matt #include "opt_modular.h"
     49   1.9      matt #include "opt_multiprocessor.h"
     50  1.16      matt #include "opt_ppcarch.h"
     51   1.9      matt #endif
     52   1.9      matt 
     53  1.73       phx #ifdef _KERNEL
     54   1.9      matt #include <machine/intr.h>
     55  1.72  uebayasi #include <sys/device_if.h>
     56  1.72  uebayasi #include <sys/evcnt.h>
     57  1.73       phx #endif
     58   1.9      matt 
     59  1.42      yamt #include <sys/cpu_data.h>
     60  1.14       eeh 
     61   1.9      matt struct cpu_info {
     62  1.42      yamt 	struct cpu_data ci_data;	/* MI per-cpu data */
     63  1.73       phx #ifdef _KERNEL
     64  1.74      matt 	device_t ci_dev;		/* device of corresponding cpu */
     65  1.74      matt 	struct cpu_softc *ci_softc;	/* private cpu info */
     66  1.23   thorpej 	struct lwp *ci_curlwp;		/* current owner of the processor */
     67   1.9      matt 
     68   1.9      matt 	struct pcb *ci_curpcb;
     69  1.38      matt 	struct pmap *ci_curpm;
     70  1.80      matt 	struct lwp *ci_softlwps[SOFTINT_COUNT];
     71  1.77      matt 	int ci_cpuid;			/* from SPR_PIR */
     72   1.9      matt 
     73  1.57       rjs 	int ci_want_resched;
     74  1.74      matt 	volatile uint64_t ci_lastintr;
     75  1.28      matt 	volatile u_long ci_lasttb;
     76  1.28      matt 	volatile int ci_tickspending;
     77  1.50     freza 	volatile int ci_cpl;
     78  1.50     freza 	volatile int ci_iactive;
     79  1.60        ad 	volatile int ci_idepth;
     80  1.84      matt 	union {
     81  1.84      matt #if !defined(PPC_BOOKE) && !defined(_MODULE)
     82  1.84      matt 		volatile imask_t un1_ipending;
     83  1.84      matt #define	ci_ipending	ci_un1.un1_ipending
     84  1.74      matt #endif
     85  1.84      matt 		uint64_t un1_pad64;
     86  1.84      matt 	} ci_un1;
     87  1.77      matt 	volatile uint32_t ci_pending_ipis;
     88  1.53        ad 	int ci_mtx_oldspl;
     89  1.53        ad 	int ci_mtx_count;
     90  1.84      matt #if defined(PPC_IBM4XX) || defined(MODULAR) || defined(_MODULE)
     91   1.9      matt 	char *ci_intstk;
     92  1.68      matt #endif
     93  1.84      matt #define	CI_SAVETEMP	(0*CPUSAVE_LEN)
     94  1.84      matt #define	CI_SAVEDDB	(1*CPUSAVE_LEN)
     95  1.84      matt #define	CI_SAVEIPKDB	(2*CPUSAVE_LEN)
     96  1.84      matt #define	CI_SAVEMMU	(3*CPUSAVE_LEN)
     97  1.84      matt #define	CI_SAVEMAX	(4*CPUSAVE_LEN)
     98  1.32      matt #define	CPUSAVE_LEN	8
     99  1.84      matt #if !defined(PPC_BOOKE) && !defined(MODULAR) && !defined(_MODULE)
    100  1.84      matt #define	CPUSAVE_SIZE	(CI_SAVEMAX*CPUSAVE_LEN)
    101  1.84      matt #else
    102  1.84      matt #define	CPUSAVE_SIZE	128
    103  1.84      matt #endif
    104  1.32      matt #define	CPUSAVE_R28	0		/* where r28 gets saved */
    105  1.32      matt #define	CPUSAVE_R29	1		/* where r29 gets saved */
    106  1.32      matt #define	CPUSAVE_R30	2		/* where r30 gets saved */
    107  1.32      matt #define	CPUSAVE_R31	3		/* where r31 gets saved */
    108  1.84      matt #define	CPUSAVE_DEAR	4		/* where IBM4XX SPR_DEAR gets saved */
    109  1.84      matt #define	CPUSAVE_DAR	4		/* where OEA SPR_DAR gets saved */
    110  1.84      matt #define	CPUSAVE_ESR	5		/* where IBM4XX SPR_ESR gets saved */
    111  1.84      matt #define	CPUSAVE_DSISR	5		/* where OEA SPR_DSISR gets saved */
    112  1.74      matt #define	CPUSAVE_SRR0	6		/* where SRR0 gets saved */
    113  1.74      matt #define	CPUSAVE_SRR1	7		/* where SRR1 gets saved */
    114  1.84      matt 	register_t ci_savearea[CPUSAVE_SIZE];
    115  1.84      matt #if defined(PPC_BOOKE) || defined(MODULAR) || defined(_MODULE)
    116  1.74      matt 	struct pmap_segtab *ci_pmap_segtabs[2];
    117  1.74      matt #define	ci_pmap_kern_segtab	ci_pmap_segtabs[0]
    118  1.74      matt #define	ci_pmap_user_segtab	ci_pmap_segtabs[1]
    119  1.74      matt 	struct pmap_tlb_info *ci_tlb_info;
    120  1.84      matt #endif /* PPC_BOOKE || MODULAR || _MODULE */
    121  1.14       eeh 	struct cache_info ci_ci;
    122  1.40      matt 	void *ci_sysmon_cookie;
    123  1.43      matt 	void (*ci_idlespin)(void);
    124  1.44    briggs 	uint32_t ci_khz;
    125  1.25      matt 	struct evcnt ci_ev_clock;	/* clock intrs */
    126  1.50     freza 	struct evcnt ci_ev_statclock; 	/* stat clock */
    127   1.9      matt 	struct evcnt ci_ev_traps;	/* calls to trap() */
    128   1.9      matt 	struct evcnt ci_ev_kdsi;	/* kernel DSI traps */
    129   1.9      matt 	struct evcnt ci_ev_udsi;	/* user DSI traps */
    130   1.9      matt 	struct evcnt ci_ev_udsi_fatal;	/* user DSI trap failures */
    131  1.33      matt 	struct evcnt ci_ev_kisi;	/* kernel ISI traps */
    132   1.9      matt 	struct evcnt ci_ev_isi;		/* user ISI traps */
    133   1.9      matt 	struct evcnt ci_ev_isi_fatal;	/* user ISI trap failures */
    134   1.9      matt 	struct evcnt ci_ev_pgm;		/* user PGM traps */
    135  1.75      matt 	struct evcnt ci_ev_debug;	/* user debug traps */
    136   1.9      matt 	struct evcnt ci_ev_fpu;		/* FPU traps */
    137   1.9      matt 	struct evcnt ci_ev_fpusw;	/* FPU context switch */
    138   1.9      matt 	struct evcnt ci_ev_ali;		/* Alignment traps */
    139   1.9      matt 	struct evcnt ci_ev_ali_fatal;	/* Alignment fatal trap */
    140   1.9      matt 	struct evcnt ci_ev_scalls;	/* system call traps */
    141   1.9      matt 	struct evcnt ci_ev_vec;		/* Altivec traps */
    142   1.9      matt 	struct evcnt ci_ev_vecsw;	/* Altivec context switches */
    143  1.16      matt 	struct evcnt ci_ev_umchk;	/* user MCHK events */
    144  1.59   garbled 	struct evcnt ci_ev_ipi;		/* IPIs received */
    145  1.74      matt 	struct evcnt ci_ev_tlbmiss_soft; /* tlb miss (no trap) */
    146  1.74      matt 	struct evcnt ci_ev_dtlbmiss_hard; /* data tlb miss (trap) */
    147  1.74      matt 	struct evcnt ci_ev_itlbmiss_hard; /* instruction tlb miss (trap) */
    148  1.73       phx #endif /* _KERNEL */
    149   1.9      matt };
    150  1.73       phx #endif /* _KERNEL || _KMEMUSER */
    151  1.73       phx 
    152  1.73       phx #ifdef _KERNEL
    153   1.9      matt 
    154  1.83      matt #if defined(MULTIPROCESSOR) && !defined(_MODULE)
    155  1.59   garbled struct cpu_hatch_data {
    156  1.82      matt 	device_t self;
    157  1.59   garbled 	struct cpu_info *ci;
    158  1.59   garbled 	int running;
    159  1.59   garbled 	int pir;
    160  1.64   garbled 	int asr;
    161  1.59   garbled 	int hid0;
    162  1.59   garbled 	int sdr1;
    163  1.59   garbled 	int sr[16];
    164  1.59   garbled 	int batu[4], batl[4];
    165  1.59   garbled 	int tbu, tbl;
    166  1.59   garbled };
    167  1.83      matt #endif /* MULTIPROCESSOR && !_MODULE */
    168  1.59   garbled 
    169  1.83      matt #if defined(MULTIPROCESSOR) || defined(_MODULE)
    170  1.83      matt #define	cpu_number()		(curcpu()->ci_index + 0)
    171   1.9      matt 
    172   1.9      matt #define CPU_IS_PRIMARY(ci)	((ci)->ci_cpuid == 0)
    173  1.83      matt #define CPU_INFO_ITERATOR	int
    174  1.83      matt #define CPU_INFO_FOREACH(cii, ci)				\
    175  1.64   garbled 	cii = 0, ci = &cpu_info[0]; cii < ncpu; cii++, ci++
    176  1.18       chs 
    177   1.9      matt #else
    178   1.9      matt #define cpu_number()		0
    179   1.9      matt 
    180  1.83      matt #define CPU_IS_PRIMARY(ci)	true
    181  1.83      matt #define CPU_INFO_ITERATOR	int
    182  1.83      matt #define CPU_INFO_FOREACH(cii, ci)				\
    183  1.18       chs 	cii = 0, ci = curcpu(); ci != NULL; ci = NULL
    184  1.18       chs 
    185  1.83      matt #endif /* MULTIPROCESSOR || _MODULE */
    186   1.9      matt 
    187  1.25      matt extern struct cpu_info cpu_info[];
    188  1.25      matt 
    189  1.77      matt static __inline struct cpu_info * curcpu(void) __pure;
    190  1.47     perry static __inline struct cpu_info *
    191  1.25      matt curcpu(void)
    192  1.25      matt {
    193  1.25      matt 	struct cpu_info *ci;
    194  1.25      matt 
    195  1.78      matt 	__asm volatile ("mfsprg0 %0" : "=r"(ci));
    196  1.25      matt 	return ci;
    197  1.25      matt }
    198  1.25      matt 
    199  1.77      matt register struct lwp *powerpc_curlwp __asm("r13");
    200  1.77      matt #define	curlwp			powerpc_curlwp
    201  1.25      matt #define curpcb			(curcpu()->ci_curpcb)
    202  1.38      matt #define curpm			(curcpu()->ci_curpm)
    203  1.25      matt 
    204  1.47     perry static __inline register_t
    205  1.18       chs mfmsr(void)
    206  1.18       chs {
    207  1.20      matt 	register_t msr;
    208  1.18       chs 
    209  1.46     perry 	__asm volatile ("mfmsr %0" : "=r"(msr));
    210  1.18       chs 	return msr;
    211  1.18       chs }
    212  1.18       chs 
    213  1.47     perry static __inline void
    214  1.20      matt mtmsr(register_t msr)
    215  1.18       chs {
    216  1.74      matt 	//KASSERT(msr & PSL_CE);
    217  1.74      matt 	//KASSERT(msr & PSL_DE);
    218  1.46     perry 	__asm volatile ("mtmsr %0" : : "r"(msr));
    219  1.19       chs }
    220  1.19       chs 
    221  1.84      matt #if !defined(_MODULE)
    222  1.47     perry static __inline uint32_t
    223  1.19       chs mftbl(void)
    224  1.19       chs {
    225  1.19       chs 	uint32_t tbl;
    226  1.19       chs 
    227  1.46     perry 	__asm volatile (
    228  1.29   hannken #ifdef PPC_IBM403
    229  1.74      matt 	"	mftblo %[tbl]"		"\n"
    230  1.74      matt #elif defined(PPC_BOOKE)
    231  1.74      matt 	"	mfspr %[tbl],268"	"\n"
    232  1.29   hannken #else
    233  1.74      matt 	"	mftbl %[tbl]"		"\n"
    234  1.29   hannken #endif
    235  1.74      matt 	: [tbl] "=r" (tbl));
    236  1.29   hannken 
    237  1.19       chs 	return tbl;
    238  1.19       chs }
    239  1.19       chs 
    240  1.47     perry static __inline uint64_t
    241  1.19       chs mftb(void)
    242  1.19       chs {
    243  1.19       chs 	uint64_t tb;
    244  1.32      matt 
    245  1.32      matt #ifdef _LP64
    246  1.46     perry 	__asm volatile ("mftb %0" : "=r"(tb));
    247  1.32      matt #else
    248  1.19       chs 	int tmp;
    249  1.19       chs 
    250  1.46     perry 	__asm volatile (
    251  1.29   hannken #ifdef PPC_IBM403
    252  1.74      matt 	"1:	mftbhi %[tb]"		"\n"
    253  1.74      matt 	"	mftblo %L[tb]"		"\n"
    254  1.74      matt 	"	mftbhi %[tmp]"		"\n"
    255  1.74      matt #elif defined(PPC_BOOKE)
    256  1.74      matt 	"1:	mfspr %[tb],269"	"\n"
    257  1.74      matt 	"	mfspr %L[tb],268"	"\n"
    258  1.74      matt 	"	mfspr %[tmp],269"	"\n"
    259  1.29   hannken #else
    260  1.74      matt 	"1:	mftbu %[tb]"		"\n"
    261  1.74      matt 	"	mftb %L[tb]"		"\n"
    262  1.74      matt 	"	mftbu %[tmp]"		"\n"
    263  1.74      matt #endif
    264  1.74      matt 	"	cmplw %[tb],%[tmp]"	"\n"
    265  1.74      matt 	"	bne- 1b"		"\n"
    266  1.74      matt 	    : [tb] "=r" (tb), [tmp] "=r"(tmp)
    267  1.74      matt 	    :: "cr0");
    268  1.32      matt #endif
    269  1.29   hannken 
    270  1.19       chs 	return tb;
    271  1.24    kleink }
    272  1.24    kleink 
    273  1.47     perry static __inline uint32_t
    274  1.24    kleink mfrtcl(void)
    275  1.24    kleink {
    276  1.24    kleink 	uint32_t rtcl;
    277  1.24    kleink 
    278  1.46     perry 	__asm volatile ("mfrtcl %0" : "=r"(rtcl));
    279  1.24    kleink 	return rtcl;
    280  1.24    kleink }
    281  1.24    kleink 
    282  1.47     perry static __inline void
    283  1.24    kleink mfrtc(uint32_t *rtcp)
    284  1.24    kleink {
    285  1.24    kleink 	uint32_t tmp;
    286  1.24    kleink 
    287  1.46     perry 	__asm volatile (
    288  1.74      matt 	"1:	mfrtcu	%[rtcu]"	"\n"
    289  1.74      matt 	"	mfrtcl	%[rtcl]"	"\n"
    290  1.74      matt 	"	mfrtcu	%[tmp]"		"\n"
    291  1.74      matt 	"	cmplw	%[rtcu],%[tmp]"	"\n"
    292  1.74      matt 	"	bne-	1b"
    293  1.74      matt 	    : [rtcu] "=r"(rtcp[0]), [rtcl] "=r"(rtcp[1]), [tmp] "=r"(tmp)
    294  1.74      matt 	    :: "cr0");
    295  1.19       chs }
    296  1.84      matt #endif /* !_MODULE */
    297  1.19       chs 
    298  1.47     perry static __inline uint32_t
    299  1.19       chs mfpvr(void)
    300  1.19       chs {
    301  1.19       chs 	uint32_t pvr;
    302  1.19       chs 
    303  1.46     perry 	__asm volatile ("mfpvr %0" : "=r"(pvr));
    304  1.19       chs 	return (pvr);
    305  1.18       chs }
    306  1.18       chs 
    307  1.84      matt #ifdef _MODULE
    308  1.84      matt extern const char __CPU_MAXNUM;
    309  1.84      matt /*
    310  1.84      matt  * Make with 0xffff to force a R_PPC_ADDR16_LO without the
    311  1.84      matt  * corresponding R_PPC_ADDR16_HI relocation.
    312  1.84      matt  */
    313  1.84      matt #define	CPU_MAXNUM	(((uintptr_t)&__CPU_MAXNUM)&0xffff)
    314  1.84      matt #endif /* _MODULE */
    315  1.84      matt 
    316  1.83      matt #if !defined(_MODULE)
    317   1.9      matt extern int powersave;
    318   1.9      matt extern int cpu_timebase;
    319   1.9      matt extern int cpu_printfataltraps;
    320  1.16      matt extern char cpu_model[];
    321  1.16      matt 
    322  1.83      matt struct cpu_info *
    323  1.83      matt 	cpu_attach_common(device_t, int);
    324  1.83      matt void	cpu_setup(device_t, struct cpu_info *);
    325  1.83      matt void	cpu_identify(char *, size_t);
    326  1.83      matt void	cpu_probe_cache(void);
    327  1.85      matt 
    328  1.83      matt void	dcache_wb_page(vaddr_t);
    329  1.83      matt void	dcache_wbinv_page(vaddr_t);
    330  1.83      matt void	dcache_inv_page(vaddr_t);
    331  1.83      matt void	dcache_zero_page(vaddr_t);
    332  1.83      matt void	icache_inv_page(vaddr_t);
    333  1.83      matt void	dcache_wb(vaddr_t, vsize_t);
    334  1.83      matt void	dcache_wbinv(vaddr_t, vsize_t);
    335  1.83      matt void	dcache_inv(vaddr_t, vsize_t);
    336  1.83      matt void	icache_inv(vaddr_t, vsize_t);
    337  1.85      matt 
    338  1.83      matt void *	mapiodev(paddr_t, psize_t);
    339  1.83      matt void	unmapiodev(vaddr_t, vsize_t);
    340   1.9      matt 
    341  1.59   garbled #ifdef MULTIPROCESSOR
    342  1.83      matt int	md_setup_trampoline(volatile struct cpu_hatch_data *,
    343  1.83      matt 	    struct cpu_info *);
    344  1.83      matt void	md_presync_timebase(volatile struct cpu_hatch_data *);
    345  1.83      matt void	md_start_timebase(volatile struct cpu_hatch_data *);
    346  1.83      matt void	md_sync_timebase(volatile struct cpu_hatch_data *);
    347  1.83      matt void	md_setup_interrupts(void);
    348  1.83      matt int	cpu_spinup(device_t, struct cpu_info *);
    349  1.83      matt register_t
    350  1.83      matt 	cpu_hatch(void);
    351  1.83      matt void	cpu_spinup_trampoline(void);
    352  1.83      matt void	cpu_boot_secondary_processors(void);
    353  1.83      matt #endif /* MULTIPROCESSOR */
    354  1.83      matt #endif /* !_MODULE */
    355  1.83      matt 
    356  1.83      matt #define	cpu_proc_fork(p1, p2)
    357  1.59   garbled 
    358   1.9      matt #define	DELAY(n)		delay(n)
    359  1.83      matt void	delay(unsigned int);
    360  1.83      matt 
    361  1.83      matt #define	CLKF_USERMODE(cf)	cpu_clkf_usermode(cf)
    362  1.83      matt #define	CLKF_PC(cf)		cpu_clkf_pc(cf)
    363  1.83      matt #define	CLKF_INTR(cf)		cpu_clkf_intr(cf)
    364  1.83      matt 
    365  1.83      matt bool	cpu_clkf_usermode(const struct clockframe *);
    366  1.83      matt vaddr_t	cpu_clkf_pc(const struct clockframe *);
    367  1.83      matt bool	cpu_clkf_intr(const struct clockframe *);
    368  1.83      matt 
    369  1.83      matt #define	LWP_PC(l)		cpu_lwp_pc(l)
    370  1.83      matt 
    371  1.83      matt vaddr_t	cpu_lwp_pc(struct lwp *);
    372   1.9      matt 
    373  1.79      matt void *	cpu_uarea_alloc(bool);
    374  1.79      matt bool	cpu_uarea_free(void *);
    375  1.77      matt void	cpu_need_resched(struct cpu_info *, int);
    376  1.77      matt void	cpu_signotify(struct lwp *);
    377  1.77      matt void	cpu_need_proftick(struct lwp *);
    378  1.77      matt #define	cpu_did_resched(l)			((l)->l_md.md_astpending = 0)
    379   1.9      matt 
    380  1.81      matt void	cpu_fixup_stubs(void);
    381  1.81      matt 
    382  1.83      matt #if !defined(PPC_IBM4XX) && !defined(PPC_BOOKE) && !defined(_MODULE)
    383  1.85      matt int	cpu_get_dfs(void);
    384  1.85      matt void	cpu_set_dfs(int);
    385  1.85      matt 
    386  1.83      matt void	oea_init(void (*)(void));
    387  1.83      matt void	oea_startup(const char *);
    388  1.83      matt void	oea_dumpsys(void);
    389  1.83      matt void	oea_install_extint(void (*)(void));
    390  1.83      matt paddr_t	kvtop(void *);
    391  1.16      matt 
    392  1.16      matt extern paddr_t msgbuf_paddr;
    393  1.16      matt extern int cpu_altivec;
    394  1.16      matt #endif
    395  1.16      matt 
    396   1.9      matt #endif /* _KERNEL */
    397   1.9      matt 
    398  1.61   garbled /* XXX The below breaks unified pmap on ppc32 */
    399  1.61   garbled 
    400  1.83      matt #if !defined(CACHELINESIZE) && !defined(_MODULE) \
    401  1.83      matt     && (defined(_KERNEL) || defined(_STANDALONE))
    402  1.83      matt #if defined(PPC_IBM403)
    403  1.62   garbled #define	CACHELINESIZE		16
    404  1.62   garbled #define MAXCACHELINESIZE	16
    405  1.83      matt #elif defined (PPC_OEA64_BRIDGE)
    406  1.62   garbled #define	CACHELINESIZE		128
    407  1.62   garbled #define MAXCACHELINESIZE	128
    408  1.51   sanjayl #else
    409  1.62   garbled #define	CACHELINESIZE		32
    410  1.62   garbled #define MAXCACHELINESIZE	32
    411  1.51   sanjayl #endif /* PPC_OEA64_BRIDGE */
    412  1.29   hannken #endif
    413  1.10      matt 
    414  1.83      matt void	__syncicache(void *, size_t);
    415  1.14       eeh 
    416   1.5        ws /*
    417   1.5        ws  * CTL_MACHDEP definitions.
    418   1.5        ws  */
    419   1.9      matt #define	CPU_CACHELINE		1
    420   1.9      matt #define	CPU_TIMEBASE		2
    421   1.9      matt #define	CPU_CPUTEMP		3
    422   1.9      matt #define	CPU_PRINTFATALTRAPS	4
    423  1.14       eeh #define	CPU_CACHEINFO		5
    424  1.16      matt #define	CPU_ALTIVEC		6
    425  1.16      matt #define	CPU_MODEL		7
    426  1.58  nisimura #define	CPU_POWERSAVE		8	/* int: use CPU powersave mode */
    427  1.58  nisimura #define	CPU_BOOTED_DEVICE	9	/* string: device we booted from */
    428  1.58  nisimura #define	CPU_BOOTED_KERNEL	10	/* string: kernel we booted */
    429  1.58  nisimura #define	CPU_MAXID		11	/* number of valid machdep ids */
    430   1.1        ws 
    431   1.5        ws #endif	/* _POWERPC_CPU_H_ */
    432