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