xref: /titanic_50/usr/src/uts/i86pc/sys/smp_impldefs.h (revision 0b5ce10aee80822ecc7df77df92a5e24078ba196)
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 (c) 1993, 2010, Oracle and/or its affiliates. All rights reserved.
24  */
25 
26 #ifndef _SYS_SMP_IMPLDEFS_H
27 #define	_SYS_SMP_IMPLDEFS_H
28 
29 #include <sys/types.h>
30 #include <sys/sunddi.h>
31 #include <sys/cpuvar.h>
32 #include <sys/avintr.h>
33 #include <sys/pic.h>
34 #include <sys/xc_levels.h>
35 #include <sys/psm_types.h>
36 
37 #ifdef	__cplusplus
38 extern "C" {
39 #endif
40 
41 #define	WARM_RESET_VECTOR	0x467	/* the ROM/BIOS vector for 	*/
42 					/* starting up secondary cpu's	*/
43 /* timer modes for clkinitf */
44 #define	TIMER_ONESHOT		0x1
45 #define	TIMER_PERIODIC		0x2
46 
47 /*
48  *	External Reference Functions
49  */
50 extern void (*psminitf)();	/* psm init entry point			*/
51 extern void (*picinitf)();	/* pic init entry point			*/
52 extern int (*clkinitf)(int, int *);	/* clock init entry point	*/
53 extern int (*ap_mlsetup)(); 	/* completes init of starting cpu	*/
54 extern void (*send_dirintf)();	/* send interprocessor intr		*/
55 extern hrtime_t (*gethrtimef)(); /* get high resolution timer value	*/
56 extern hrtime_t (*gethrtimeunscaledf)(); /* get high res timer unscaled value */
57 extern void (*psm_shutdownf)(int, int);	/* machine dependent shutdown	*/
58 extern void (*psm_preshutdownf)(int, int); /* machine dependent pre-shutdown */
59 extern void (*psm_notifyf)(int); /* PSMI module notification		*/
60 extern void (*psm_set_idle_cpuf)(processorid_t); /* cpu changed to idle */
61 extern void (*psm_unset_idle_cpuf)(processorid_t); /* cpu out of idle 	*/
62 extern int (*psm_disable_intr)(processorid_t); /* disable intr to cpu	*/
63 extern void (*psm_enable_intr)(processorid_t); /* enable intr to cpu	*/
64 extern int (*psm_get_clockirq)(int); /* get clock vector		*/
65 extern int (*psm_get_ipivect)(int, int); /* get interprocessor intr vec */
66 extern int (*psm_clkinit)(int);	/* timer init entry point		*/
67 extern void (*psm_timer_reprogram)(hrtime_t); /* timer reprogram	*/
68 extern void (*psm_timer_enable)(void);		/* timer enable		*/
69 extern void (*psm_timer_disable)(void);		/* timer disable	*/
70 extern void (*psm_post_cyclic_setup)(void *arg); /* psm cyclic setup	*/
71 extern int (*psm_state)(psm_state_request_t *); /* psm state save/restore */
72 extern uchar_t (*psm_get_ioapicid)(uchar_t);	/* get io-apic id */
73 extern uint32_t (*psm_get_localapicid)(uint32_t);	/* get local-apic id */
74 extern uchar_t (*psm_xlate_vector_by_irq)(uchar_t); /* get vector for an irq */
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 extern int (*get_pending_spl)(void);	/* get highest pending ipl */
83 extern int (*addintr)(void *, int, avfunc, char *, int, caddr_t, caddr_t,
84     uint64_t *, dev_info_t *);	/* replacement of add_avintr */
85 extern void (*remintr)(void *, int, avfunc, int); /* replace of rem_avintr */
86 
87 /* trigger a software intr */
88 extern void (*setsoftint)(int, struct av_softinfo *);
89 
90 /* kmdb private entry point */
91 extern void (*kdisetsoftint)(int, struct av_softinfo *);
92 
93 extern uint_t xc_serv(caddr_t, caddr_t); /* cross call service routine	*/
94 extern void av_set_softint_pending();	/* set software interrupt pending */
95 extern void kdi_av_set_softint_pending(); /* kmdb private entry point */
96 extern void microfind(void);	/* initialize tenmicrosec		*/
97 
98 /* map physical address							*/
99 
100 /*
101  * XX64: Changing psm_map_phys() to take a paddr_t rather than a uint32_t
102  * will be a flag day.  Other drivers in the WOS use the psm_map()
103  * interface, so we need this hack to get them to coexist for
104  * pre-integration testing.
105  */
106 extern caddr_t psm_map_phys_new(paddr_t, size_t, int);
107 #define	psm_map_phys psm_map_phys_new
108 
109 /* unmap the physical address given in psm_map_phys() from the addr	*/
110 extern void psm_unmap_phys(caddr_t, size_t);
111 extern void psm_modloadonly(void);
112 extern void psm_install(void);
113 extern void psm_modload(void);
114 
115 /*
116  *	External Reference Data
117  */
118 extern struct av_head autovect[]; /* array of auto intr vectors		*/
119 extern uint32_t rm_platter_pa;	/* phy addr realmode startup storage	*/
120 extern caddr_t rm_platter_va;	/* virt addr realmode startup storage	*/
121 extern cpuset_t mp_cpus;	/* bit map of possible cpus found	*/
122 
123 /*
124  * virtulization support for psm
125  */
126 extern void *psm_vt_ops;
127 
128 #ifdef	__cplusplus
129 }
130 #endif
131 
132 #endif	/* _SYS_SMP_IMPLDEFS_H */
133