xref: /onnv-gate/usr/src/uts/common/avs/ns/solaris/nsc_solaris.c (revision 7836:4e95154b5b7a)
1*7836SJohn.Forte@Sun.COM /*
2*7836SJohn.Forte@Sun.COM  * CDDL HEADER START
3*7836SJohn.Forte@Sun.COM  *
4*7836SJohn.Forte@Sun.COM  * The contents of this file are subject to the terms of the
5*7836SJohn.Forte@Sun.COM  * Common Development and Distribution License (the "License").
6*7836SJohn.Forte@Sun.COM  * You may not use this file except in compliance with the License.
7*7836SJohn.Forte@Sun.COM  *
8*7836SJohn.Forte@Sun.COM  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9*7836SJohn.Forte@Sun.COM  * or http://www.opensolaris.org/os/licensing.
10*7836SJohn.Forte@Sun.COM  * See the License for the specific language governing permissions
11*7836SJohn.Forte@Sun.COM  * and limitations under the License.
12*7836SJohn.Forte@Sun.COM  *
13*7836SJohn.Forte@Sun.COM  * When distributing Covered Code, include this CDDL HEADER in each
14*7836SJohn.Forte@Sun.COM  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15*7836SJohn.Forte@Sun.COM  * If applicable, add the following below this CDDL HEADER, with the
16*7836SJohn.Forte@Sun.COM  * fields enclosed by brackets "[]" replaced with your own identifying
17*7836SJohn.Forte@Sun.COM  * information: Portions Copyright [yyyy] [name of copyright owner]
18*7836SJohn.Forte@Sun.COM  *
19*7836SJohn.Forte@Sun.COM  * CDDL HEADER END
20*7836SJohn.Forte@Sun.COM  */
21*7836SJohn.Forte@Sun.COM /*
22*7836SJohn.Forte@Sun.COM  * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
23*7836SJohn.Forte@Sun.COM  * Use is subject to license terms.
24*7836SJohn.Forte@Sun.COM  */
25*7836SJohn.Forte@Sun.COM 
26*7836SJohn.Forte@Sun.COM /*
27*7836SJohn.Forte@Sun.COM  *	This file contains interface code to the kernel.
28*7836SJohn.Forte@Sun.COM  */
29*7836SJohn.Forte@Sun.COM 
30*7836SJohn.Forte@Sun.COM /* LINTLIBRARY */
31*7836SJohn.Forte@Sun.COM 
32*7836SJohn.Forte@Sun.COM #include <sys/types.h>
33*7836SJohn.Forte@Sun.COM #include <sys/param.h>
34*7836SJohn.Forte@Sun.COM #include <sys/errno.h>
35*7836SJohn.Forte@Sun.COM #include <sys/kmem.h>
36*7836SJohn.Forte@Sun.COM #include <sys/ksynch.h>
37*7836SJohn.Forte@Sun.COM #include <sys/cmn_err.h>
38*7836SJohn.Forte@Sun.COM #include <sys/uio.h>
39*7836SJohn.Forte@Sun.COM #include <sys/conf.h>
40*7836SJohn.Forte@Sun.COM #include <sys/ddi.h>
41*7836SJohn.Forte@Sun.COM 
42*7836SJohn.Forte@Sun.COM #include <sys/nsctl/nsctl.h>
43*7836SJohn.Forte@Sun.COM #include "nsc_list.h"
44*7836SJohn.Forte@Sun.COM 
45*7836SJohn.Forte@Sun.COM /*
46*7836SJohn.Forte@Sun.COM  * _nsc_init_start
47*7836SJohn.Forte@Sun.COM  *
48*7836SJohn.Forte@Sun.COM  * ARGUMENTS:
49*7836SJohn.Forte@Sun.COM  *
50*7836SJohn.Forte@Sun.COM  * RETURNS:
51*7836SJohn.Forte@Sun.COM  *
52*7836SJohn.Forte@Sun.COM  * USAGE:
53*7836SJohn.Forte@Sun.COM  *
54*7836SJohn.Forte@Sun.COM  * CALLED BY:
55*7836SJohn.Forte@Sun.COM  */
56*7836SJohn.Forte@Sun.COM void
_nsc_init_start(void)57*7836SJohn.Forte@Sun.COM _nsc_init_start(void)
58*7836SJohn.Forte@Sun.COM {
59*7836SJohn.Forte@Sun.COM }
60*7836SJohn.Forte@Sun.COM 
61*7836SJohn.Forte@Sun.COM /*
62*7836SJohn.Forte@Sun.COM  * _nsc_init_os -
63*7836SJohn.Forte@Sun.COM  *
64*7836SJohn.Forte@Sun.COM  * ARGUMENTS:
65*7836SJohn.Forte@Sun.COM  *
66*7836SJohn.Forte@Sun.COM  * RETURNS:
67*7836SJohn.Forte@Sun.COM  *
68*7836SJohn.Forte@Sun.COM  * USAGE:
69*7836SJohn.Forte@Sun.COM  *
70*7836SJohn.Forte@Sun.COM  * CALLED BY:
71*7836SJohn.Forte@Sun.COM  */
72*7836SJohn.Forte@Sun.COM void
_nsc_init_os(void)73*7836SJohn.Forte@Sun.COM _nsc_init_os(void)
74*7836SJohn.Forte@Sun.COM {
75*7836SJohn.Forte@Sun.COM }
76*7836SJohn.Forte@Sun.COM 
77*7836SJohn.Forte@Sun.COM /*
78*7836SJohn.Forte@Sun.COM  * _nsc_deinit_os -
79*7836SJohn.Forte@Sun.COM  *
80*7836SJohn.Forte@Sun.COM  * ARGUMENTS:
81*7836SJohn.Forte@Sun.COM  *
82*7836SJohn.Forte@Sun.COM  * RETURNS:
83*7836SJohn.Forte@Sun.COM  *
84*7836SJohn.Forte@Sun.COM  * USAGE:
85*7836SJohn.Forte@Sun.COM  *
86*7836SJohn.Forte@Sun.COM  * CALLED BY:
87*7836SJohn.Forte@Sun.COM  */
88*7836SJohn.Forte@Sun.COM void
_nsc_deinit_os(void)89*7836SJohn.Forte@Sun.COM _nsc_deinit_os(void)
90*7836SJohn.Forte@Sun.COM {
91*7836SJohn.Forte@Sun.COM }
92*7836SJohn.Forte@Sun.COM 
93*7836SJohn.Forte@Sun.COM /* dummy routine unless RMS/MC is really running */
94*7836SJohn.Forte@Sun.COM void
_nsc_self_alive()95*7836SJohn.Forte@Sun.COM _nsc_self_alive()
96*7836SJohn.Forte@Sun.COM {
97*7836SJohn.Forte@Sun.COM }
98*7836SJohn.Forte@Sun.COM 
99*7836SJohn.Forte@Sun.COM /*
100*7836SJohn.Forte@Sun.COM  * Check other nodes: checks for the heart_beat of other nodes and decides
101*7836SJohn.Forte@Sun.COM  * if a node that was up went down... or a node that was down is now
102*7836SJohn.Forte@Sun.COM  * up. Events NODE_UP and NODE_DOWN are posted to myself (this node)
103*7836SJohn.Forte@Sun.COM  * Any processing that happens in these event handlers SHOULD abide by
104*7836SJohn.Forte@Sun.COM  * the health monitor rules for the health monitor to work correctly.
105*7836SJohn.Forte@Sun.COM  * If excessive computation during these events is required, consider the
106*7836SJohn.Forte@Sun.COM  * possibility of forking of a process OR breaking up the computation into
107*7836SJohn.Forte@Sun.COM  * smaller parts, and making sure that we call "SELF_ALIVE()" "often".
108*7836SJohn.Forte@Sun.COM  * This is not the suggested mechanism, but there are times when we need it.
109*7836SJohn.Forte@Sun.COM  */
110*7836SJohn.Forte@Sun.COM 
111*7836SJohn.Forte@Sun.COM void
_nsc_check_other_nodes()112*7836SJohn.Forte@Sun.COM _nsc_check_other_nodes()
113*7836SJohn.Forte@Sun.COM {
114*7836SJohn.Forte@Sun.COM }
115*7836SJohn.Forte@Sun.COM 
116*7836SJohn.Forte@Sun.COM /*
117*7836SJohn.Forte@Sun.COM  * Is our partner active ? (Should never block)
118*7836SJohn.Forte@Sun.COM  */
119*7836SJohn.Forte@Sun.COM int
alternate_health_hbeat()120*7836SJohn.Forte@Sun.COM alternate_health_hbeat()
121*7836SJohn.Forte@Sun.COM {
122*7836SJohn.Forte@Sun.COM 	return (0);
123*7836SJohn.Forte@Sun.COM }
124*7836SJohn.Forte@Sun.COM 
125*7836SJohn.Forte@Sun.COM 
126*7836SJohn.Forte@Sun.COM static int
mark_rm_pages_to_dump(addr,size,dump)127*7836SJohn.Forte@Sun.COM mark_rm_pages_to_dump(addr, size, dump)
128*7836SJohn.Forte@Sun.COM caddr_t addr;
129*7836SJohn.Forte@Sun.COM int size, dump;
130*7836SJohn.Forte@Sun.COM {
131*7836SJohn.Forte@Sun.COM 	return (0);
132*7836SJohn.Forte@Sun.COM }
133*7836SJohn.Forte@Sun.COM 
134*7836SJohn.Forte@Sun.COM 
135*7836SJohn.Forte@Sun.COM void
_nsc_mark_pages(caddr_t addr,size_t size,int dump)136*7836SJohn.Forte@Sun.COM _nsc_mark_pages(caddr_t addr, size_t size, int dump)
137*7836SJohn.Forte@Sun.COM {
138*7836SJohn.Forte@Sun.COM 	if (mark_rm_pages_to_dump(addr, (int)size, dump) < 0)
139*7836SJohn.Forte@Sun.COM 		cmn_err(CE_WARN, "_nsc_mark_pages: %s failed - 0x%p size %d",
140*7836SJohn.Forte@Sun.COM 			(dump ? "mark" : "unmark"), addr, (int)size);
141*7836SJohn.Forte@Sun.COM }
142