xref: /titanic_51/usr/src/uts/sun4/cpu/cpu_module.c (revision b52a336e0ccd9ef29cd11bb3c7e530788483ee04)
17c478bd9Sstevel@tonic-gate /*
27c478bd9Sstevel@tonic-gate  * CDDL HEADER START
37c478bd9Sstevel@tonic-gate  *
47c478bd9Sstevel@tonic-gate  * The contents of this file are subject to the terms of the
51e2e7a75Shuah  * Common Development and Distribution License (the "License").
61e2e7a75Shuah  * You may not use this file except in compliance with the License.
77c478bd9Sstevel@tonic-gate  *
87c478bd9Sstevel@tonic-gate  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
97c478bd9Sstevel@tonic-gate  * or http://www.opensolaris.org/os/licensing.
107c478bd9Sstevel@tonic-gate  * See the License for the specific language governing permissions
117c478bd9Sstevel@tonic-gate  * and limitations under the License.
127c478bd9Sstevel@tonic-gate  *
137c478bd9Sstevel@tonic-gate  * When distributing Covered Code, include this CDDL HEADER in each
147c478bd9Sstevel@tonic-gate  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
157c478bd9Sstevel@tonic-gate  * If applicable, add the following below this CDDL HEADER, with the
167c478bd9Sstevel@tonic-gate  * fields enclosed by brackets "[]" replaced with your own identifying
177c478bd9Sstevel@tonic-gate  * information: Portions Copyright [yyyy] [name of copyright owner]
187c478bd9Sstevel@tonic-gate  *
197c478bd9Sstevel@tonic-gate  * CDDL HEADER END
207c478bd9Sstevel@tonic-gate  */
217c478bd9Sstevel@tonic-gate /*
22*b52a336eSPavel Tatashin  * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
237c478bd9Sstevel@tonic-gate  */
247c478bd9Sstevel@tonic-gate 
257c478bd9Sstevel@tonic-gate #include <sys/cpu_module.h>
267c478bd9Sstevel@tonic-gate #include <sys/lockstat.h>
277c478bd9Sstevel@tonic-gate 
287c478bd9Sstevel@tonic-gate /*
297c478bd9Sstevel@tonic-gate  * This is a dummy file that provides the default cpu module
307c478bd9Sstevel@tonic-gate  * that is linked to unix.
317c478bd9Sstevel@tonic-gate  */
327c478bd9Sstevel@tonic-gate 
337c478bd9Sstevel@tonic-gate uint_t	root_phys_addr_lo_mask;
347c478bd9Sstevel@tonic-gate int64_t timedelta;
357c478bd9Sstevel@tonic-gate hrtime_t hres_last_tick;
36b5b48cc1Ssudheer volatile timestruc_t hrestime;
377c478bd9Sstevel@tonic-gate int64_t hrestime_adj;
38b5b48cc1Ssudheer volatile int hres_lock;
397c478bd9Sstevel@tonic-gate uint_t nsec_scale;
407c478bd9Sstevel@tonic-gate uint_t nsec_shift;
417c478bd9Sstevel@tonic-gate uint_t adj_shift;
427c478bd9Sstevel@tonic-gate hrtime_t hrtime_base;
437c478bd9Sstevel@tonic-gate int traptrace_use_stick;
441e2e7a75Shuah uint_t cpu_impl_dual_pgsz;
45023e71deSHaik Aftandilian uint64_t native_tick_offset;
46023e71deSHaik Aftandilian uint64_t native_stick_offset;
477c478bd9Sstevel@tonic-gate 
487c478bd9Sstevel@tonic-gate void
497c478bd9Sstevel@tonic-gate cpu_setup(void)
507c478bd9Sstevel@tonic-gate {}
517c478bd9Sstevel@tonic-gate 
527c478bd9Sstevel@tonic-gate void
537c478bd9Sstevel@tonic-gate cpu_init_tick_freq(void)
547c478bd9Sstevel@tonic-gate {}
557c478bd9Sstevel@tonic-gate 
567c478bd9Sstevel@tonic-gate /*ARGSUSED*/
577c478bd9Sstevel@tonic-gate void
581e2e7a75Shuah vtag_flushpage(caddr_t addr, uint64_t sfmmup)
597c478bd9Sstevel@tonic-gate {}
607c478bd9Sstevel@tonic-gate 
617c478bd9Sstevel@tonic-gate void
627c478bd9Sstevel@tonic-gate vtag_flushall(void)
637c478bd9Sstevel@tonic-gate {}
647c478bd9Sstevel@tonic-gate 
657c478bd9Sstevel@tonic-gate void
661e2e7a75Shuah vtag_flushall_uctxs(void)
677c478bd9Sstevel@tonic-gate {}
687c478bd9Sstevel@tonic-gate 
697c478bd9Sstevel@tonic-gate /*ARGSUSED*/
707c478bd9Sstevel@tonic-gate void
711e2e7a75Shuah vtag_flushpage_tl1(uint64_t addr, uint64_t sfmmup)
727c478bd9Sstevel@tonic-gate {}
737c478bd9Sstevel@tonic-gate 
747c478bd9Sstevel@tonic-gate /*ARGSUSED*/
757c478bd9Sstevel@tonic-gate void
761e2e7a75Shuah vtag_flush_pgcnt_tl1(uint64_t addr, uint64_t sfmmup_pgcnt)
777c478bd9Sstevel@tonic-gate {}
787c478bd9Sstevel@tonic-gate 
797c478bd9Sstevel@tonic-gate /*ARGSUSED*/
807c478bd9Sstevel@tonic-gate void
817c478bd9Sstevel@tonic-gate vtag_flushall_tl1(uint64_t dummy1, uint64_t dummy2)
827c478bd9Sstevel@tonic-gate {}
837c478bd9Sstevel@tonic-gate 
847c478bd9Sstevel@tonic-gate /*ARGSUSED*/
857c478bd9Sstevel@tonic-gate void
869853d9e8SJason Beloro vtag_unmap_perm_tl1(uint64_t addr, uint64_t ctx)
879853d9e8SJason Beloro {}
889853d9e8SJason Beloro 
899853d9e8SJason Beloro /*ARGSUSED*/
909853d9e8SJason Beloro void
917c478bd9Sstevel@tonic-gate vac_flushpage(pfn_t pf, int color)
927c478bd9Sstevel@tonic-gate {}
937c478bd9Sstevel@tonic-gate 
947c478bd9Sstevel@tonic-gate /*ARGSUSED*/
957c478bd9Sstevel@tonic-gate void
967c478bd9Sstevel@tonic-gate vac_flushpage_tl1(uint64_t pf, uint64_t color)
977c478bd9Sstevel@tonic-gate {}
987c478bd9Sstevel@tonic-gate 
997c478bd9Sstevel@tonic-gate /*ARGSUSED*/
1007c478bd9Sstevel@tonic-gate void
1017c478bd9Sstevel@tonic-gate vac_flushcolor(int color, pfn_t pf)
1027c478bd9Sstevel@tonic-gate {}
1037c478bd9Sstevel@tonic-gate 
1047c478bd9Sstevel@tonic-gate /*ARGSUSED*/
1057c478bd9Sstevel@tonic-gate void
1067c478bd9Sstevel@tonic-gate vac_flushcolor_tl1(uint64_t color, uint64_t dummy)
1077c478bd9Sstevel@tonic-gate {}
1087c478bd9Sstevel@tonic-gate 
1097c478bd9Sstevel@tonic-gate /*ARGSUSED*/
1107c478bd9Sstevel@tonic-gate void
1117c478bd9Sstevel@tonic-gate init_mondo(xcfunc_t func, uint64_t arg1, uint64_t arg2)
1127c478bd9Sstevel@tonic-gate {}
1137c478bd9Sstevel@tonic-gate 
1147c478bd9Sstevel@tonic-gate /*ARGSUSED*/
1157c478bd9Sstevel@tonic-gate void
1167c478bd9Sstevel@tonic-gate send_one_mondo(int cpuid)
1177c478bd9Sstevel@tonic-gate {}
1187c478bd9Sstevel@tonic-gate 
1197c478bd9Sstevel@tonic-gate /*ARGSUSED*/
1207c478bd9Sstevel@tonic-gate void
1217c478bd9Sstevel@tonic-gate send_mondo_set(cpuset_t set)
1227c478bd9Sstevel@tonic-gate {}
1237c478bd9Sstevel@tonic-gate 
1247c478bd9Sstevel@tonic-gate /*ARGSUSED*/
1257c478bd9Sstevel@tonic-gate void
1267c478bd9Sstevel@tonic-gate flush_instr_mem(caddr_t addr, size_t len)
1277c478bd9Sstevel@tonic-gate {}
1287c478bd9Sstevel@tonic-gate 
1297c478bd9Sstevel@tonic-gate void
1307c478bd9Sstevel@tonic-gate syncfpu(void)
1317c478bd9Sstevel@tonic-gate {}
1327c478bd9Sstevel@tonic-gate 
1337c478bd9Sstevel@tonic-gate /*ARGSUSED*/
1347c478bd9Sstevel@tonic-gate void
1357c478bd9Sstevel@tonic-gate cpu_change_speed(uint64_t divisor, uint64_t arg2)
1367c478bd9Sstevel@tonic-gate {}
1377c478bd9Sstevel@tonic-gate 
1387c478bd9Sstevel@tonic-gate u_longlong_t
1397c478bd9Sstevel@tonic-gate gettick(void)
1407c478bd9Sstevel@tonic-gate { return (0); }
1417c478bd9Sstevel@tonic-gate 
142*b52a336eSPavel Tatashin u_longlong_t
143*b52a336eSPavel Tatashin randtick(void)
144*b52a336eSPavel Tatashin { return (0); }
145*b52a336eSPavel Tatashin 
1467c478bd9Sstevel@tonic-gate uint64_t
1477c478bd9Sstevel@tonic-gate gettick_counter(void)
1487c478bd9Sstevel@tonic-gate { return (0); }
1497c478bd9Sstevel@tonic-gate 
1507c478bd9Sstevel@tonic-gate /*ARGSUSED*/
1517c478bd9Sstevel@tonic-gate void
1527c478bd9Sstevel@tonic-gate gethrestime(timespec_t *tp)
1537c478bd9Sstevel@tonic-gate {}
1547c478bd9Sstevel@tonic-gate 
1557c478bd9Sstevel@tonic-gate time_t
1567c478bd9Sstevel@tonic-gate gethrestime_sec(void)
1577c478bd9Sstevel@tonic-gate { return (0); }
1587c478bd9Sstevel@tonic-gate 
1597c478bd9Sstevel@tonic-gate /*ARGSUSED*/
1607c478bd9Sstevel@tonic-gate void
1617c478bd9Sstevel@tonic-gate gethrestime_lasttick(timespec_t *tp)
1627c478bd9Sstevel@tonic-gate {}
1637c478bd9Sstevel@tonic-gate 
1647c478bd9Sstevel@tonic-gate hrtime_t
1657c478bd9Sstevel@tonic-gate gethrtime(void)
1667c478bd9Sstevel@tonic-gate { return (0); }
1677c478bd9Sstevel@tonic-gate 
1687c478bd9Sstevel@tonic-gate hrtime_t
1697c478bd9Sstevel@tonic-gate gethrtime_unscaled(void)
1707c478bd9Sstevel@tonic-gate { return (0); }
1717c478bd9Sstevel@tonic-gate 
1727c478bd9Sstevel@tonic-gate hrtime_t
1737c478bd9Sstevel@tonic-gate gethrtime_waitfree(void)
1747c478bd9Sstevel@tonic-gate { return (0); }
1757c478bd9Sstevel@tonic-gate 
1767c478bd9Sstevel@tonic-gate hrtime_t
1777c478bd9Sstevel@tonic-gate dtrace_gethrtime(void)
1787c478bd9Sstevel@tonic-gate { return (0); }
1797c478bd9Sstevel@tonic-gate 
1807c478bd9Sstevel@tonic-gate uint_t
1817c478bd9Sstevel@tonic-gate get_impl(void)
1827c478bd9Sstevel@tonic-gate { return (0); }
1837c478bd9Sstevel@tonic-gate 
1847c478bd9Sstevel@tonic-gate hrtime_t
1857c478bd9Sstevel@tonic-gate get_hrestime(void)
1867c478bd9Sstevel@tonic-gate { return (0); }
1877c478bd9Sstevel@tonic-gate 
1887c478bd9Sstevel@tonic-gate ulong_t
1897c478bd9Sstevel@tonic-gate get_timestamp(void)
1907c478bd9Sstevel@tonic-gate { return (0); }
1917c478bd9Sstevel@tonic-gate 
1927c478bd9Sstevel@tonic-gate ulong_t
1937c478bd9Sstevel@tonic-gate get_virtime(void)
1947c478bd9Sstevel@tonic-gate { return (0); }
1957c478bd9Sstevel@tonic-gate 
1967c478bd9Sstevel@tonic-gate hrtime_t
1977c478bd9Sstevel@tonic-gate gethrtime_max(void)
1987c478bd9Sstevel@tonic-gate { return (0); }
1997c478bd9Sstevel@tonic-gate 
2007c478bd9Sstevel@tonic-gate /*ARGSUSED*/
2017c478bd9Sstevel@tonic-gate void
2027c478bd9Sstevel@tonic-gate scalehrtime(hrtime_t *hrt)
2037c478bd9Sstevel@tonic-gate {}
2047c478bd9Sstevel@tonic-gate 
2057c478bd9Sstevel@tonic-gate void
2067c478bd9Sstevel@tonic-gate hres_tick(void)
2077c478bd9Sstevel@tonic-gate {}
2087c478bd9Sstevel@tonic-gate 
2097c478bd9Sstevel@tonic-gate /*ARGSUSED*/
2107c478bd9Sstevel@tonic-gate void
2117c478bd9Sstevel@tonic-gate tickcmpr_set(uint64_t clock_cycles)
2127c478bd9Sstevel@tonic-gate {}
2137c478bd9Sstevel@tonic-gate 
2147c478bd9Sstevel@tonic-gate void
2157c478bd9Sstevel@tonic-gate tickcmpr_disable(void)
2167c478bd9Sstevel@tonic-gate {}
2177c478bd9Sstevel@tonic-gate 
2187c478bd9Sstevel@tonic-gate /*ARGSUSED*/
2197c478bd9Sstevel@tonic-gate void
2207c478bd9Sstevel@tonic-gate tick_write_delta(uint64_t delta)
2217c478bd9Sstevel@tonic-gate {}
2227c478bd9Sstevel@tonic-gate 
2237c478bd9Sstevel@tonic-gate int
2247c478bd9Sstevel@tonic-gate tickcmpr_disabled(void)
2257c478bd9Sstevel@tonic-gate { return (0); }
2267c478bd9Sstevel@tonic-gate 
2277c478bd9Sstevel@tonic-gate /*ARGSUSED*/
2287c478bd9Sstevel@tonic-gate void
2297c478bd9Sstevel@tonic-gate drv_usecwait(clock_t n)
2307c478bd9Sstevel@tonic-gate {}
2317c478bd9Sstevel@tonic-gate 
2327c478bd9Sstevel@tonic-gate /*
2337c478bd9Sstevel@tonic-gate  * Processor-optimized memory routines
2347c478bd9Sstevel@tonic-gate  */
2357c478bd9Sstevel@tonic-gate /*ARGSUSED*/
2367c478bd9Sstevel@tonic-gate int
2377c478bd9Sstevel@tonic-gate kcopy(const void *from, void *to, size_t count)
2387c478bd9Sstevel@tonic-gate { return (0); }
2397c478bd9Sstevel@tonic-gate 
2407c478bd9Sstevel@tonic-gate /*ARGSUSED*/
2417c478bd9Sstevel@tonic-gate int
2427c478bd9Sstevel@tonic-gate kcopy_nta(const void *from, void *to, size_t count, int dummy)
2437c478bd9Sstevel@tonic-gate { return (0); }
2447c478bd9Sstevel@tonic-gate 
2457c478bd9Sstevel@tonic-gate /*ARGSUSED*/
2467c478bd9Sstevel@tonic-gate void
2477c478bd9Sstevel@tonic-gate bcopy(const void *from, void *to, size_t count)
2487c478bd9Sstevel@tonic-gate {}
2497c478bd9Sstevel@tonic-gate 
2507c478bd9Sstevel@tonic-gate /*ARGSUSED*/
2517c478bd9Sstevel@tonic-gate void
2527c478bd9Sstevel@tonic-gate ovbcopy(const void *from, void *to, size_t count)
2537c478bd9Sstevel@tonic-gate {}
2547c478bd9Sstevel@tonic-gate 
2557c478bd9Sstevel@tonic-gate /*ARGSUSED*/
2567c478bd9Sstevel@tonic-gate int
2577c478bd9Sstevel@tonic-gate copyin(const void *uaddr, void *kaddr, size_t count)
2587c478bd9Sstevel@tonic-gate { return (0); }
2597c478bd9Sstevel@tonic-gate 
2607c478bd9Sstevel@tonic-gate /*ARGSUSED*/
2617c478bd9Sstevel@tonic-gate int
2627c478bd9Sstevel@tonic-gate xcopyin(const void *uaddr, void *kaddr, size_t count)
2637c478bd9Sstevel@tonic-gate { return (0); }
2647c478bd9Sstevel@tonic-gate 
2657c478bd9Sstevel@tonic-gate /*ARGSUSED*/
2667c478bd9Sstevel@tonic-gate int
2677c478bd9Sstevel@tonic-gate xcopyin_nta(const void *uaddr, void *kaddr, size_t count, int dummy)
2687c478bd9Sstevel@tonic-gate { return (0); }
2697c478bd9Sstevel@tonic-gate 
2707c478bd9Sstevel@tonic-gate /*ARGSUSED*/
2717c478bd9Sstevel@tonic-gate int
2727c478bd9Sstevel@tonic-gate copyout(const void *kaddr, void *uaddr, size_t count)
2737c478bd9Sstevel@tonic-gate { return (0); }
2747c478bd9Sstevel@tonic-gate 
2757c478bd9Sstevel@tonic-gate /*ARGSUSED*/
2767c478bd9Sstevel@tonic-gate int
2777c478bd9Sstevel@tonic-gate xcopyout(const void *kaddr, void *uaddr, size_t count)
2787c478bd9Sstevel@tonic-gate { return (0); }
2797c478bd9Sstevel@tonic-gate 
2807c478bd9Sstevel@tonic-gate /*ARGSUSED*/
2817c478bd9Sstevel@tonic-gate int
2827c478bd9Sstevel@tonic-gate xcopyout_nta(const void *kaddr, void *uaddr, size_t count, int dummy)
2837c478bd9Sstevel@tonic-gate { return (0); }
2847c478bd9Sstevel@tonic-gate 
2857c478bd9Sstevel@tonic-gate /*ARGSUSED*/
2867c478bd9Sstevel@tonic-gate void
2877c478bd9Sstevel@tonic-gate copyout_noerr(const void *kfrom, void *uto, size_t count)
2887c478bd9Sstevel@tonic-gate {}
2897c478bd9Sstevel@tonic-gate 
2907c478bd9Sstevel@tonic-gate /*ARGSUSED*/
2917c478bd9Sstevel@tonic-gate void
2927c478bd9Sstevel@tonic-gate copyin_noerr(const void *kfrom, void *uto, size_t count)
2937c478bd9Sstevel@tonic-gate {}
2947c478bd9Sstevel@tonic-gate 
2957c478bd9Sstevel@tonic-gate /*ARGSUSED*/
2967c478bd9Sstevel@tonic-gate int
2977c478bd9Sstevel@tonic-gate xcopyin_little(const void *uaddr, void *kaddr, size_t count)
2987c478bd9Sstevel@tonic-gate { return (0); }
2997c478bd9Sstevel@tonic-gate 
3007c478bd9Sstevel@tonic-gate /*ARGSUSED*/
3017c478bd9Sstevel@tonic-gate int
3027c478bd9Sstevel@tonic-gate xcopyout_little(const void *kaddr, void *uaddr, size_t count)
3037c478bd9Sstevel@tonic-gate { return (0); }
3047c478bd9Sstevel@tonic-gate 
3057c478bd9Sstevel@tonic-gate /*ARGSUSED*/
3067c478bd9Sstevel@tonic-gate void
3077c478bd9Sstevel@tonic-gate hwblkpagecopy(const void *src, void *dst)
3087c478bd9Sstevel@tonic-gate {}
3097c478bd9Sstevel@tonic-gate 
3107c478bd9Sstevel@tonic-gate /*ARGSUSED*/
3117c478bd9Sstevel@tonic-gate void
3127c478bd9Sstevel@tonic-gate hw_pa_bcopy32(uint64_t src, uint64_t dst)
3137c478bd9Sstevel@tonic-gate {}
3147c478bd9Sstevel@tonic-gate 
3157c478bd9Sstevel@tonic-gate /*ARGSUSED*/
3167c478bd9Sstevel@tonic-gate int
3177c478bd9Sstevel@tonic-gate hwblkclr(void *addr, size_t len)
3187c478bd9Sstevel@tonic-gate { return (0); }
3197c478bd9Sstevel@tonic-gate 
3207c478bd9Sstevel@tonic-gate int use_hw_bzero;
3217c478bd9Sstevel@tonic-gate int use_hw_bcopy;
3227c478bd9Sstevel@tonic-gate uint_t hw_copy_limit_1;
3237c478bd9Sstevel@tonic-gate uint_t hw_copy_limit_2;
3247c478bd9Sstevel@tonic-gate uint_t hw_copy_limit_4;
3257c478bd9Sstevel@tonic-gate uint_t hw_copy_limit_8;
3267c478bd9Sstevel@tonic-gate 
3277c478bd9Sstevel@tonic-gate /*
3287c478bd9Sstevel@tonic-gate  * tick operations
3297c478bd9Sstevel@tonic-gate  */
3307c478bd9Sstevel@tonic-gate 
3317c478bd9Sstevel@tonic-gate void
3327c478bd9Sstevel@tonic-gate tick_rtt(void)
3337c478bd9Sstevel@tonic-gate { }
3347c478bd9Sstevel@tonic-gate 
3357c478bd9Sstevel@tonic-gate void
3367c478bd9Sstevel@tonic-gate pil14_interrupt(void)
3377c478bd9Sstevel@tonic-gate { }
3387c478bd9Sstevel@tonic-gate 
339b9e93c10SJonathan Haslam void
340b9e93c10SJonathan Haslam pil15_interrupt(void)
341b9e93c10SJonathan Haslam { }
342b9e93c10SJonathan Haslam 
3437c478bd9Sstevel@tonic-gate /* ARGSUSED */
3447c478bd9Sstevel@tonic-gate void
3457c478bd9Sstevel@tonic-gate cpu_init_private(struct cpu *cp)
3467c478bd9Sstevel@tonic-gate {}
3477c478bd9Sstevel@tonic-gate 
3487c478bd9Sstevel@tonic-gate /* ARGSUSED */
3497c478bd9Sstevel@tonic-gate void
3507c478bd9Sstevel@tonic-gate cpu_uninit_private(struct cpu *cp)
3517c478bd9Sstevel@tonic-gate {}
3527c478bd9Sstevel@tonic-gate 
3537c478bd9Sstevel@tonic-gate void
3547c478bd9Sstevel@tonic-gate sticksync_slave(void)
3557c478bd9Sstevel@tonic-gate {}
3567c478bd9Sstevel@tonic-gate 
3577c478bd9Sstevel@tonic-gate void
3587c478bd9Sstevel@tonic-gate sticksync_master(void)
3597c478bd9Sstevel@tonic-gate {}
3607c478bd9Sstevel@tonic-gate 
3617c478bd9Sstevel@tonic-gate /*ARGSUSED*/
3627c478bd9Sstevel@tonic-gate int
3637c478bd9Sstevel@tonic-gate dtrace_blksuword32(uintptr_t addr, uint32_t *data, int tryagain)
3647c478bd9Sstevel@tonic-gate { return (-1); }
365