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 2005 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 #if defined(lint)
30 #include <sys/types.h>
31 #else /* lint */
32 #include "assym.h"
33 #endif /* lint */
34
35 #include <sys/asm_linkage.h>
36 #include <sys/machthread.h> /* for reg definition */
37
38 #include <sys/machasi.h> /* sun4u ASI */
39 #include <sys/mmu.h>
40 #include <sys/privregs.h>
41 #include <sys/machparam.h>
42 #include <vm/hat_sfmmu.h>
43 #include <sys/cpr_impl.h>
44 #include <sys/intreg.h>
45 #include <sys/clock.h>
46
47 /*
48 * resume kernel entry point from cprboot
49 * 1. restore I/D TSB registers
50 * 2. restore primary and secondary context registers
51 * 3. initialize cpu state registers
52 * 4. set up the thread and lwp registers for the cpr process
53 * 5. switch to kernel trap
54 * 6. restore checkpoint pc and stack pointer
55 * 7. longjmp back to kernel
56 *
57 * registers from cprboot:exit_to_kernel()
58 * %o0 prom cookie
59 * %o1 struct sun4u_machdep *mdp
60 *
61 * Any change to this register assignment
62 * require changes to cprboot_srt0.s
63 */
64
65 #if defined(lint)
66
67 /* ARGSUSED */
68 void
69 i_cpr_resume_setup(void *cookie, csu_md_t *mdp)
70 {}
71
72 /* ARGSUSED */
73 int
74 i_cpr_cif_wrapper(void *args)
75 { return (0); }
76
77 /* ARGSUSED */
78 void
79 dtlb_wr_entry(uint_t index, tte_t *tte, uint64_t *va_tag)
80 {}
81
82 /* ARGSUSED */
83 void
84 itlb_wr_entry(uint_t index, tte_t *tte, uint64_t *va_tag)
85 {}
86
87 #else /* lint */
88
89 !
90 ! reserve 4k for cpr tmp stack; tstack should be first,
91 ! any new data symbols should be added after tstack.
92 !
93 .seg ".data"
94 .global i_cpr_data_page, i_cpr_tstack_size
95 .global i_cpr_orig_cif
96
97 .align MMU_PAGESIZE
98 i_cpr_data_page:
99 .skip 4096
100 i_cpr_tstack:
101 .word 0
102 i_cpr_tstack_size:
103 .word 4096
104
105 .align 8
106 prom_tba:
107 .word 0, 0
108 i_cpr_orig_cif:
263 SET_SIZE(dtlb_wr_entry)
264
265
266 !
267 ! write itlb entry at index
268 !
269 ENTRY(itlb_wr_entry)
270 sllx %o0, 3, %o0 ! index << 3
271 ldx [%o1], %o5 ! o5 = tte.ll
272 ldx [%o2], %o4 ! o4 = va_tag
273 srlx %o4, MMU_PAGESHIFT, %o4 ! clear any page offset
274 sllx %o4, MMU_PAGESHIFT, %o4 ! o4 = va_tag & PAGEMASK
275 set MMU_TAG_ACCESS, %o3
276 stxa %o4, [%o3]ASI_IMMU
277 stxa %o5, [%o0]ASI_ITLB_ACCESS
278 membar #Sync
279 retl
280 nop
281 SET_SIZE(itlb_wr_entry)
282
283 #endif /* !lint */
|
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 2005 Sun Microsystems, Inc. All rights reserved.
24 * Use is subject to license terms.
25 */
26
27 #include "assym.h"
28
29 #include <sys/asm_linkage.h>
30 #include <sys/machthread.h> /* for reg definition */
31
32 #include <sys/machasi.h> /* sun4u ASI */
33 #include <sys/mmu.h>
34 #include <sys/privregs.h>
35 #include <sys/machparam.h>
36 #include <vm/hat_sfmmu.h>
37 #include <sys/cpr_impl.h>
38 #include <sys/intreg.h>
39 #include <sys/clock.h>
40
41 /*
42 * resume kernel entry point from cprboot
43 * 1. restore I/D TSB registers
44 * 2. restore primary and secondary context registers
45 * 3. initialize cpu state registers
46 * 4. set up the thread and lwp registers for the cpr process
47 * 5. switch to kernel trap
48 * 6. restore checkpoint pc and stack pointer
49 * 7. longjmp back to kernel
50 *
51 * registers from cprboot:exit_to_kernel()
52 * %o0 prom cookie
53 * %o1 struct sun4u_machdep *mdp
54 *
55 * Any change to this register assignment
56 * require changes to cprboot_srt0.s
57 */
58
59 !
60 ! reserve 4k for cpr tmp stack; tstack should be first,
61 ! any new data symbols should be added after tstack.
62 !
63 .seg ".data"
64 .global i_cpr_data_page, i_cpr_tstack_size
65 .global i_cpr_orig_cif
66
67 .align MMU_PAGESIZE
68 i_cpr_data_page:
69 .skip 4096
70 i_cpr_tstack:
71 .word 0
72 i_cpr_tstack_size:
73 .word 4096
74
75 .align 8
76 prom_tba:
77 .word 0, 0
78 i_cpr_orig_cif:
233 SET_SIZE(dtlb_wr_entry)
234
235
236 !
237 ! write itlb entry at index
238 !
239 ENTRY(itlb_wr_entry)
240 sllx %o0, 3, %o0 ! index << 3
241 ldx [%o1], %o5 ! o5 = tte.ll
242 ldx [%o2], %o4 ! o4 = va_tag
243 srlx %o4, MMU_PAGESHIFT, %o4 ! clear any page offset
244 sllx %o4, MMU_PAGESHIFT, %o4 ! o4 = va_tag & PAGEMASK
245 set MMU_TAG_ACCESS, %o3
246 stxa %o4, [%o3]ASI_IMMU
247 stxa %o5, [%o0]ASI_ITLB_ACCESS
248 membar #Sync
249 retl
250 nop
251 SET_SIZE(itlb_wr_entry)
252
|