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 /*
23 * Copyright 2001 Sun Microsystems, Inc. All rights reserved.
24 * Use is subject to license terms.
25 */
26
27 #pragma ident "%Z%%M% %I% %E% SMI"
28
29 #include <sys/param.h>
30 #include <sys/errno.h>
31 #include <sys/asm_linkage.h>
32 #include <sys/vtrace.h>
33 #include <sys/machthread.h>
34 #include <sys/clock.h>
35 #include <sys/asi.h>
36 #include <sys/fsr.h>
37 #include <sys/privregs.h>
38 #include <sys/pte.h>
39 #include <sys/mmu.h>
40 #include <sys/spitregs.h>
41
42 #if defined(lint)
43
44 #else /* lint */
45 #include "assym.h"
46 #endif /* lint */
47
48 #define TT_HSM 0x99
49
50 #if defined(lint)
51 void
52 sysctrl_freeze(void)
53 {}
54 #else /* lint */
55 /*
56 * This routine quiets a cpu and has it spin on a barrier.
57 * It is used during memory sparing so that no memory operation
58 * occurs during the memory copy.
59 *
60 * Entry:
61 * %g1 - gate array base address
62 * %g2 - barrier base address
63 * %g3 - arg2
64 * %g4 - arg3
65 *
66 * Register Usage:
67 * %g3 - saved pstate
68 * %g4 - temporary
69 * %g5 - check for panicstr
70 */
71 ENTRY_NP(sysctrl_freeze)
72 CPU_INDEX(%g4, %g5)
73 sll %g4, 2, %g4
74 add %g4, %g1, %g4 ! compute address of gate id
75
76 st %g4, [%g4] ! indicate we are ready
77 membar #Sync
78 1:
79 sethi %hi(panicstr), %g5
80 ldn [%g5 + %lo(panicstr)], %g5
81 brnz %g5, 2f ! exit if in panic
82 nop
83 ld [%g2], %g4
84 brz,pt %g4, 1b ! spin until barrier true
85 nop
86
87 2:
88 retry
89 membar #Sync
90 SET_SIZE(sysctrl_freeze)
91
92 #endif /* lint */
|
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 /*
23 * Copyright 2001 Sun Microsystems, Inc. All rights reserved.
24 * Use is subject to license terms.
25 */
26
27 #include <sys/param.h>
28 #include <sys/errno.h>
29 #include <sys/asm_linkage.h>
30 #include <sys/vtrace.h>
31 #include <sys/machthread.h>
32 #include <sys/clock.h>
33 #include <sys/asi.h>
34 #include <sys/fsr.h>
35 #include <sys/privregs.h>
36 #include <sys/pte.h>
37 #include <sys/mmu.h>
38 #include <sys/spitregs.h>
39
40 #include "assym.h"
41
42 #define TT_HSM 0x99
43
44 /*
45 * This routine quiets a cpu and has it spin on a barrier.
46 * It is used during memory sparing so that no memory operation
47 * occurs during the memory copy.
48 *
49 * Entry:
50 * %g1 - gate array base address
51 * %g2 - barrier base address
52 * %g3 - arg2
53 * %g4 - arg3
54 *
55 * Register Usage:
56 * %g3 - saved pstate
57 * %g4 - temporary
58 * %g5 - check for panicstr
59 */
60 ENTRY_NP(sysctrl_freeze)
61 CPU_INDEX(%g4, %g5)
62 sll %g4, 2, %g4
63 add %g4, %g1, %g4 ! compute address of gate id
64
65 st %g4, [%g4] ! indicate we are ready
66 membar #Sync
67 1:
68 sethi %hi(panicstr), %g5
69 ldn [%g5 + %lo(panicstr)], %g5
70 brnz %g5, 2f ! exit if in panic
71 nop
72 ld [%g2], %g4
73 brz,pt %g4, 1b ! spin until barrier true
74 nop
75
76 2:
77 retry
78 membar #Sync
79 SET_SIZE(sysctrl_freeze)
80
|