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