xref: /illumos-gate/usr/src/uts/i86pc/sys/smp_impldefs.h (revision 89a7715a55deca73d03076f5c24463717f0aaa91)
1 /*
2  * CDDL HEADER START
3  *
4  * The contents of this file are subject to the terms of the
5  * Common Development and Distribution License (the "License").
6  * You may not use this file except in compliance with the License.
7  *
8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9  * or http://www.opensolaris.org/os/licensing.
10  * See the License for the specific language governing permissions
11  * and limitations under the License.
12  *
13  * When distributing Covered Code, include this CDDL HEADER in each
14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15  * If applicable, add the following below this CDDL HEADER, with the
16  * fields enclosed by brackets "[]" replaced with your own identifying
17  * information: Portions Copyright [yyyy] [name of copyright owner]
18  *
19  * CDDL HEADER END
20  */
21 
22 /*
23  * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
24  * Use is subject to license terms.
25  */
26 
27 #ifndef _SYS_SMP_IMPLDEFS_H
28 #define	_SYS_SMP_IMPLDEFS_H
29 
30 #pragma ident	"%Z%%M%	%I%	%E% SMI"
31 
32 #include <sys/types.h>
33 #include <sys/sunddi.h>
34 #include <sys/cpuvar.h>
35 #include <sys/avintr.h>
36 #include <sys/pic.h>
37 #include <sys/xc_levels.h>
38 #include <sys/psm_types.h>
39 
40 #ifdef	__cplusplus
41 extern "C" {
42 #endif
43 
44 #define	WARM_RESET_VECTOR	0x467	/* the ROM/BIOS vector for 	*/
45 					/* starting up secondary cpu's	*/
46 /* timer modes for clkinitf */
47 #define	TIMER_ONESHOT		0x1
48 #define	TIMER_PERIODIC		0x2
49 
50 /*
51  *	External Reference Functions
52  */
53 extern void (*psminitf)();	/* psm init entry point			*/
54 extern void (*picinitf)();	/* pic init entry point			*/
55 extern int (*clkinitf)(int, int *);	/* clock init entry point	*/
56 extern int (*ap_mlsetup)(); 	/* completes init of starting cpu	*/
57 extern void (*send_dirintf)();	/* send interprocessor intr		*/
58 extern hrtime_t (*gethrtimef)(); /* get high resolution timer value	*/
59 extern hrtime_t (*gethrtimeunscaledf)(); /* get high res timer unscaled value */
60 extern void (*psm_shutdownf)(int, int);	/* machine dependent shutdown	*/
61 extern void (*psm_preshutdownf)(int, int); /* machine dependent pre-shutdown */
62 extern void (*psm_notifyf)(int); /* PSMI module notification		*/
63 extern void (*psm_set_idle_cpuf)(processorid_t); /* cpu changed to idle */
64 extern void (*psm_unset_idle_cpuf)(processorid_t); /* cpu out of idle 	*/
65 extern int (*psm_disable_intr)(processorid_t); /* disable intr to cpu	*/
66 extern void (*psm_enable_intr)(processorid_t); /* enable intr to cpu	*/
67 extern int (*psm_get_clockirq)(int); /* get clock vector		*/
68 extern int (*psm_get_ipivect)(int, int); /* get interprocessor intr vec */
69 extern int (*psm_clkinit)(int);	/* timer init entry point		*/
70 extern void (*psm_timer_reprogram)(hrtime_t); /* timer reprogram	*/
71 extern void (*psm_timer_enable)(void);		/* timer enable		*/
72 extern void (*psm_timer_disable)(void);		/* timer disable	*/
73 extern void (*psm_post_cyclic_setup)(void *arg); /* psm cyclic setup	*/
74 extern int (*psm_state)(psm_state_request_t *); /* psm state save/restore */
75 
76 extern int (*slvltovect)(int);	/* ipl interrupt priority level		*/
77 extern int (*setlvl)(int, int *); /* set intr pri represented by vect	*/
78 extern void (*setlvlx)(int, int); /* set intr pri to specified level	*/
79 extern void (*setspl)(int);	/* mask intr below or equal given ipl	*/
80 extern int (*addspl)(int, int, int, int); /* add intr mask of vector 	*/
81 extern int (*delspl)(int, int, int, int); /* delete intr mask of vector */
82 
83 /* trigger a software intr */
84 extern void (*setsoftint)(int, struct av_softinfo *);
85 
86 /* kmdb private entry point */
87 extern void (*kdisetsoftint)(int, struct av_softinfo *);
88 
89 extern uint_t xc_serv(caddr_t, caddr_t); /* cross call service routine	*/
90 extern void av_set_softint_pending();	/* set software interrupt pending */
91 extern void kdi_av_set_softint_pending(); /* kmdb private entry point */
92 extern void microfind(void);	/* initialize tenmicrosec		*/
93 
94 /* map physical address							*/
95 
96 /*
97  * XX64: Changing psm_map_phys() to take a paddr_t rather than a uint32_t
98  * will be a flag day.  Other drivers in the WOS use the psm_map()
99  * interface, so we need this hack to get them to coexist for
100  * pre-integration testing.
101  */
102 extern caddr_t psm_map_phys_new(paddr_t, size_t, int);
103 #define	psm_map_phys psm_map_phys_new
104 
105 /* unmap the physical address given in psm_map_phys() from the addr	*/
106 extern void psm_unmap_phys(caddr_t, size_t);
107 extern void psm_modloadonly(void);
108 extern void psm_install(void);
109 extern void psm_modload(void);
110 
111 /*
112  *	External Reference Data
113  */
114 extern struct av_head autovect[]; /* array of auto intr vectors		*/
115 extern uint32_t rm_platter_pa;	/* phy addr realmode startup storage	*/
116 extern caddr_t rm_platter_va;	/* virt addr realmode startup storage	*/
117 extern cpuset_t mp_cpus;	/* bit map of possible cpus found	*/
118 
119 #ifdef	__cplusplus
120 }
121 #endif
122 
123 #endif	/* _SYS_SMP_IMPLDEFS_H */
124