xref: /titanic_51/usr/src/uts/i86pc/sys/machsystm.h (revision 6d59ee3710c0fb9401adfe5bb3ca303ae9cef724)
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  * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
23  * Use is subject to license terms.
24  */
25 
26 #ifndef _SYS_MACHSYSTM_H
27 #define	_SYS_MACHSYSTM_H
28 
29 #pragma ident	"%Z%%M%	%I%	%E% SMI"
30 
31 /*
32  * Numerous platform-dependent interfaces that don't seem to belong
33  * in any other header file.
34  *
35  * This file should not be included by code that purports to be
36  * platform-independent.
37  *
38  */
39 
40 #include <sys/machparam.h>
41 #include <sys/varargs.h>
42 #include <sys/thread.h>
43 #include <sys/cpuvar.h>
44 #include <vm/page.h>
45 
46 #ifdef __cplusplus
47 extern "C" {
48 #endif
49 
50 #ifdef _KERNEL
51 
52 extern void mp_halt(char *);
53 
54 extern int Cpudelay;
55 extern void setcpudelay(void);
56 
57 extern void send_dirint(int, int);
58 extern void siron(void);
59 
60 extern void return_instr(void);
61 
62 extern int kcpc_hw_load_pcbe(void);
63 extern void kcpc_hw_init(cpu_t *cp);
64 extern int kcpc_hw_overflow_intr_installed;
65 
66 struct memconf {
67 	pfn_t	mcf_spfn;	/* begin page fram number */
68 	pfn_t	mcf_epfn;	/* end page frame number */
69 };
70 
71 struct system_hardware {
72 	int		hd_nodes;		/* number of nodes */
73 	int		hd_cpus_per_node; 	/* max cpus in a node */
74 	struct memconf 	hd_mem[MAXNODES];
75 						/*
76 						 * memory layout for each
77 						 * node.
78 						 */
79 };
80 extern struct system_hardware system_hardware;
81 extern void get_system_configuration(void);
82 extern void mmu_init(void);
83 extern int cpuid2nodeid(int);
84 extern void map_kaddr(caddr_t, pfn_t, int, int);
85 
86 extern void memscrub_init(void);
87 extern void memscrub_disable(void);
88 
89 extern unsigned int microdata;
90 extern int use_mp;
91 
92 extern struct cpu	cpus[];		/* pointer to other cpus */
93 extern struct cpu	*cpu[];		/* pointer to all cpus */
94 
95 extern uintptr_t hole_start, hole_end;
96 
97 #define	INVALID_VADDR(a)	\
98 	(((a) >= (caddr_t)hole_start && (a) < (caddr_t)hole_end))
99 
100 /* kpm mapping window */
101 extern size_t   kpm_size;
102 extern uchar_t  kpm_size_shift;
103 extern caddr_t  kpm_vbase;
104 
105 #endif /* _KERNEL */
106 
107 #ifdef __cplusplus
108 }
109 #endif
110 
111 #endif	/* _SYS_MACHSYSTM_H */
112