xref: /titanic_51/usr/src/uts/i86pc/sys/psm.h (revision 791a814c934fcd4deb13b26c1f116ff283272a0d)
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 2004 Sun Microsystems, Inc.  All rights reserved.
24  * Use is subject to license terms.
25  */
26 
27 #ifndef	_SYS_PSM_H
28 #define	_SYS_PSM_H
29 
30 #pragma ident	"%Z%%M%	%I%	%E% SMI"
31 
32 /*
33  * Platform Specific Module (PSM)
34  */
35 
36 /*
37  * Include the loadable module wrapper.
38  */
39 #include <sys/types.h>
40 #include <sys/conf.h>
41 #include <sys/modctl.h>
42 #include <sys/sunddi.h>
43 #include <sys/kmem.h>
44 #include <sys/psm_defs.h>
45 #include <sys/psm_types.h>
46 
47 #ifdef	__cplusplus
48 extern "C" {
49 #endif
50 
51 /*
52  * PSM External Interfaces
53  */
54 extern int psm_mod_init(void **, struct psm_info *);
55 extern int psm_mod_fini(void **, struct psm_info *);
56 extern int psm_mod_info(void **, struct psm_info *, struct modinfo *);
57 
58 extern int psm_add_intr(int, avfunc, char *, int, caddr_t);
59 extern int psm_add_nmintr(int, avfunc, char *, caddr_t);
60 extern processorid_t psm_get_cpu_id(void);
61 
62 /* map physical address */
63 /*
64  * XX64: Changing psm_map() to take a paddr_t rather than a uint32_t will
65  * be a flag day.  Other drivers in the WOS use the psm_map() interface, so
66  * we need this hack to get them to coexist for pre-integration testing.
67  */
68 extern caddr_t psm_map_new(paddr_t, size_t, int);
69 #define	psm_map psm_map_new
70 
71 /* unmap the physical address return from psm_map_phys() */
72 extern void psm_unmap(caddr_t, size_t);
73 
74 #define	PSM_PROT_READ		0x0000
75 #define	PSM_PROT_WRITE		0x0001
76 
77 /* handle memory error */
78 extern void psm_handle_memerror(uint32_t);
79 
80 /* kernel debugger present? */
81 extern int psm_debugger(void);
82 
83 #ifdef	__cplusplus
84 }
85 #endif
86 
87 #endif	/* _SYS_PSM_H */
88