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