rmixl_cpu.c revision 1.8
11.8Smatt/* $NetBSD: rmixl_cpu.c,v 1.8 2015/06/10 22:31:00 matt Exp $ */ 21.2Smatt 31.2Smatt/* 41.2Smatt * Copyright 2002 Wasabi Systems, Inc. 51.2Smatt * All rights reserved. 61.2Smatt * 71.2Smatt * Written by Simon Burge for Wasabi Systems, Inc. 81.2Smatt * 91.2Smatt * Redistribution and use in source and binary forms, with or without 101.2Smatt * modification, are permitted provided that the following conditions 111.2Smatt * are met: 121.2Smatt * 1. Redistributions of source code must retain the above copyright 131.2Smatt * notice, this list of conditions and the following disclaimer. 141.2Smatt * 2. Redistributions in binary form must reproduce the above copyright 151.2Smatt * notice, this list of conditions and the following disclaimer in the 161.2Smatt * documentation and/or other materials provided with the distribution. 171.2Smatt * 3. All advertising materials mentioning features or use of this software 181.2Smatt * must display the following acknowledgement: 191.2Smatt * This product includes software developed for the NetBSD Project by 201.2Smatt * Wasabi Systems, Inc. 211.2Smatt * 4. The name of Wasabi Systems, Inc. may not be used to endorse 221.2Smatt * or promote products derived from this software without specific prior 231.2Smatt * written permission. 241.2Smatt * 251.2Smatt * THIS SOFTWARE IS PROVIDED BY WASABI SYSTEMS, INC. ``AS IS'' AND 261.2Smatt * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 271.2Smatt * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 281.2Smatt * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL WASABI SYSTEMS, INC 291.2Smatt * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 301.2Smatt * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 311.2Smatt * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 321.2Smatt * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 331.2Smatt * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 341.2Smatt * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 351.2Smatt * POSSIBILITY OF SUCH DAMAGE. 361.2Smatt */ 371.2Smatt 381.2Smatt#include "locators.h" 391.2Smatt 401.2Smatt#include <sys/cdefs.h> 411.8Smatt__KERNEL_RCSID(0, "$NetBSD: rmixl_cpu.c,v 1.8 2015/06/10 22:31:00 matt Exp $"); 421.2Smatt 431.2Smatt#include "opt_multiprocessor.h" 441.2Smatt#include "opt_ddb.h" 451.2Smatt 461.2Smatt#include <sys/param.h> 471.2Smatt#include <sys/device.h> 481.2Smatt#include <sys/systm.h> 491.2Smatt#include <sys/cpu.h> 501.2Smatt#include <sys/lock.h> 511.2Smatt#include <sys/lwp.h> 521.2Smatt#include <sys/cpu.h> 531.2Smatt#include <sys/malloc.h> 541.2Smatt#include <uvm/uvm_pglist.h> 551.2Smatt#include <uvm/uvm_extern.h> 561.2Smatt#include <mips/regnum.h> 571.2Smatt#include <mips/asm.h> 581.2Smatt#include <mips/pmap.h> 591.2Smatt#include <mips/rmi/rmixlreg.h> 601.2Smatt#include <mips/rmi/rmixlvar.h> 611.2Smatt#include <mips/rmi/rmixl_cpucorevar.h> 621.2Smatt#include <mips/rmi/rmixl_cpuvar.h> 631.2Smatt#include <mips/rmi/rmixl_intr.h> 641.2Smatt#include <mips/rmi/rmixl_fmnvar.h> 651.2Smatt#ifdef DDB 661.2Smatt#include <mips/db_machdep.h> 671.2Smatt#endif 681.2Smatt 691.2Smatt 701.2Smattstatic int cpu_rmixl_match(device_t, cfdata_t, void *); 711.2Smattstatic void cpu_rmixl_attach(device_t, device_t, void *); 721.2Smattstatic void cpu_rmixl_attach_primary(struct rmixl_cpu_softc * const); 731.2Smatt#ifdef NOTYET 741.2Smattstatic int cpu_fmn_intr(void *, rmixl_fmn_rxmsg_t *); 751.2Smatt#endif 761.2Smatt 771.2Smatt#ifdef MULTIPROCESSOR 781.2Smattvoid cpu_rmixl_hatch(struct cpu_info *); 791.3Scliffvoid cpu_rmixl_run(struct cpu_info *); 801.2Smattstatic int cpu_setup_trampoline_common(struct cpu_info *, struct rmixl_cpu_trampoline_args *); 811.2Smattstatic void cpu_setup_trampoline_callback(struct cpu_info *); 821.2Smatt#endif /* MULTIPROCESSOR */ 831.2Smatt 841.2Smatt#ifdef DEBUG 851.2Smattvoid rmixl_cpu_data_print(struct cpu_data *); 861.2Smattstruct cpu_info * 871.2Smatt rmixl_cpuinfo_print(u_int); 881.2Smatt#endif /* DEBUG */ 891.2Smatt 901.2SmattCFATTACH_DECL_NEW(cpu_rmixl, sizeof(struct rmixl_cpu_softc), 911.2Smatt cpu_rmixl_match, cpu_rmixl_attach, NULL, NULL); 921.2Smatt 931.2Smatt#ifdef MULTIPROCESSOR 941.2Smattstatic struct rmixl_cpu_trampoline_args rmixl_cpu_trampoline_args; 951.2Smatt#endif 961.2Smatt 971.2Smatt/* 981.4Smatt * cpu_rmixl_watchpoint_init - initialize COP0 watchpoint stuff 991.2Smatt * 1001.2Smatt * clear IEU_DEFEATURE[DBE] to ensure T_WATCH on watchpoint exception 1011.2Smatt * set COP0 watchhi and watchlo 1021.3Scliff * 1031.3Scliff * disable all watchpoints 1041.2Smatt */ 1051.2Smattstatic void 1061.4Smattcpu_rmixl_watchpoint_init(void) 1071.2Smatt{ 1081.3Scliff uint32_t r; 1091.3Scliff 1101.3Scliff r = rmixl_mfcr(RMIXL_PCR_IEU_DEFEATURE); 1111.3Scliff r &= ~__BIT(7); /* DBE */ 1121.3Scliff rmixl_mtcr(RMIXL_PCR_IEU_DEFEATURE, r); 1131.3Scliff 1141.3Scliff cpuwatch_clr_all(); 1151.2Smatt} 1161.2Smatt 1171.2Smatt/* 1181.2Smatt * cpu_xls616_erratum 1191.2Smatt * 1201.2Smatt * on the XLS616, COUNT/COMPARE clock regs seem to interact between 1211.2Smatt * threads on a core 1221.2Smatt * 1231.2Smatt * the symptom of the error is retarded clock interrupts 1241.2Smatt * and very slow apparent system performance 1251.2Smatt * 1261.2Smatt * other XLS chips may have the same problem. 1271.2Smatt * we may need to add other PID checks. 1281.2Smatt */ 1291.2Smattstatic inline bool 1301.2Smattcpu_xls616_erratum(device_t parent, struct cpucore_attach_args *ca) 1311.2Smatt{ 1321.2Smatt#if 0 1331.2Smatt if (mips_options.mips_cpu->cpu_pid == MIPS_XLS616) { 1341.2Smatt if (ca->ca_thread > 0) { 1351.2Smatt aprint_error_dev(parent, "XLS616 CLOCK ERRATUM: " 1361.2Smatt "deconfigure cpu%d\n", ca->ca_thread); 1371.2Smatt return true; 1381.2Smatt } 1391.2Smatt } 1401.2Smatt#endif 1411.2Smatt return false; 1421.2Smatt} 1431.2Smatt 1441.2Smattstatic bool 1451.2Smattcpu_rmixl_erratum(device_t parent, struct cpucore_attach_args *ca) 1461.2Smatt{ 1471.2Smatt return cpu_xls616_erratum(parent, ca); 1481.2Smatt} 1491.2Smatt 1501.2Smattstatic int 1511.2Smattcpu_rmixl_match(device_t parent, cfdata_t cf, void *aux) 1521.2Smatt{ 1531.2Smatt struct cpucore_attach_args *ca = aux; 1541.2Smatt int thread = cf->cf_loc[CPUCORECF_THREAD]; 1551.2Smatt 1561.2Smatt if (!cpu_rmixl(mips_options.mips_cpu)) 1571.2Smatt return 0; 1581.2Smatt 1591.2Smatt if (strncmp(ca->ca_name, cf->cf_name, strlen(cf->cf_name)) == 0 1601.2Smatt#ifndef MULTIPROCESSOR 1611.2Smatt && ca->ca_thread == 0 1621.2Smatt#endif 1631.2Smatt && (thread == CPUCORECF_THREAD_DEFAULT || thread == ca->ca_thread) 1641.2Smatt && (!cpu_rmixl_erratum(parent, ca))) 1651.2Smatt return 1; 1661.2Smatt 1671.2Smatt return 0; 1681.2Smatt} 1691.2Smatt 1701.2Smattstatic void 1711.2Smattcpu_rmixl_attach(device_t parent, device_t self, void *aux) 1721.2Smatt{ 1731.2Smatt struct rmixl_cpu_softc * const sc = device_private(self); 1741.2Smatt struct cpu_info *ci = NULL; 1751.2Smatt static bool once = false; 1761.2Smatt extern void rmixl_spl_init_cpu(void); 1771.2Smatt 1781.2Smatt if (once == false) { 1791.2Smatt /* first attach is the primary cpu */ 1801.2Smatt once = true; 1811.2Smatt ci = curcpu(); 1821.2Smatt sc->sc_dev = self; 1831.2Smatt sc->sc_ci = ci; 1841.2Smatt ci->ci_softc = (void *)sc; 1851.2Smatt 1861.2Smatt rmixl_spl_init_cpu(); /* spl initialization for CPU#0 */ 1871.2Smatt cpu_rmixl_attach_primary(sc); 1881.2Smatt 1891.2Smatt#ifdef MULTIPROCESSOR 1901.2Smatt mips_locoresw.lsw_cpu_init = cpu_rmixl_hatch; 1911.3Scliff mips_locoresw.lsw_cpu_run = cpu_rmixl_run; 1921.2Smatt } else { 1931.4Smatt struct cpucore_attach_args * const ca = aux; 1941.2Smatt struct cpucore_softc * const ccsc = device_private(parent); 1951.2Smatt rmixlfw_psb_type_t psb_type = rmixl_configuration.rc_psb_type; 1961.2Smatt cpuid_t cpuid; 1971.2Smatt 1981.2Smatt KASSERT(ca->ca_core < 8); 1991.2Smatt KASSERT(ca->ca_thread < 4); 2001.2Smatt cpuid = (ca->ca_core << 2) | ca->ca_thread; 2011.2Smatt ci = cpu_info_alloc(ccsc->sc_tlbinfo, cpuid, 2021.2Smatt /* XXX */ 0, ca->ca_core, ca->ca_thread); 2031.2Smatt KASSERT(ci != NULL); 2041.2Smatt if (ccsc->sc_tlbinfo == NULL) 2051.2Smatt ccsc->sc_tlbinfo = ci->ci_tlb_info; 2061.2Smatt sc->sc_dev = self; 2071.2Smatt sc->sc_ci = ci; 2081.2Smatt ci->ci_softc = (void *)sc; 2091.2Smatt 2101.2Smatt switch (psb_type) { 2111.2Smatt case PSB_TYPE_RMI: 2121.2Smatt case PSB_TYPE_DELL: 2131.2Smatt cpu_setup_trampoline_callback(ci); 2141.2Smatt break; 2151.2Smatt default: 2161.2Smatt aprint_error(": psb type=%s cpu_wakeup unsupported\n", 2171.2Smatt rmixlfw_psb_type_name(psb_type)); 2181.2Smatt return; 2191.2Smatt } 2201.2Smatt 2211.2Smatt for (size_t i=0; i < 10000; i++) { 2221.8Smatt if (!kcpuset_isset(cpus_hatched, cpu_index(ci))) 2231.2Smatt break; 2241.2Smatt DELAY(100); 2251.2Smatt } 2261.8Smatt if (!kcpuset_isset(cpus_hatched, cpu_index(ci))) { 2271.2Smatt aprint_error(": failed to hatch\n"); 2281.2Smatt return; 2291.2Smatt } 2301.2Smatt#endif /* MULTIPROCESSOR */ 2311.2Smatt } 2321.2Smatt 2331.2Smatt /* 2341.2Smatt * do per-cpu interrupt initialization 2351.2Smatt */ 2361.2Smatt rmixl_intr_init_cpu(ci); 2371.2Smatt 2381.2Smatt aprint_normal("\n"); 2391.2Smatt 2401.2Smatt cpu_attach_common(self, ci); 2411.2Smatt} 2421.2Smatt 2431.2Smatt/* 2441.2Smatt * attach the primary processor 2451.2Smatt */ 2461.2Smattstatic void 2471.2Smattcpu_rmixl_attach_primary(struct rmixl_cpu_softc * const sc) 2481.2Smatt{ 2491.2Smatt struct cpu_info *ci = sc->sc_ci; 2501.2Smatt uint32_t ebase; 2511.2Smatt 2521.2Smatt KASSERT(CPU_IS_PRIMARY(ci)); 2531.2Smatt 2541.2Smatt /* 2551.2Smatt * obtain and set cpuid of the primary processor 2561.2Smatt */ 2571.2Smatt asm volatile("dmfc0 %0, $15, 1;" : "=r"(ebase)); 2581.2Smatt ci->ci_cpuid = ebase & __BITS(9,0); 2591.2Smatt 2601.4Smatt cpu_rmixl_watchpoint_init(); 2611.2Smatt 2621.2Smatt rmixl_fmn_init(); 2631.2Smatt 2641.2Smatt rmixl_intr_init_clk(); 2651.2Smatt#ifdef MULTIPROCESSOR 2661.2Smatt rmixl_intr_init_ipi(); 2671.2Smatt#endif 2681.2Smatt 2691.2Smatt#ifdef NOTYET 2701.2Smatt void *ih = rmixl_fmn_intr_establish(RMIXL_FMN_STID_CORE0, 2711.2Smatt cpu_fmn_intr, ci); 2721.2Smatt if (ih == NULL) 2731.2Smatt panic("%s: rmixl_fmn_intr_establish failed", 2741.2Smatt __func__); 2751.2Smatt sc->sc_ih_fmn = ih; 2761.2Smatt#endif 2771.2Smatt} 2781.2Smatt 2791.2Smatt#ifdef NOTYET 2801.2Smattstatic int 2811.2Smattcpu_fmn_intr(void *arg, rmixl_fmn_rxmsg_t *rxmsg) 2821.2Smatt{ 2831.2Smatt if (CPU_IS_PRIMARY(curcpu())) { 2841.2Smatt printf("%s: cpu%ld: rxsid=%#x, code=%d, size=%d\n", 2851.2Smatt __func__, cpu_number(), 2861.2Smatt rxmsg->rxsid, rxmsg->code, rxmsg->size); 2871.2Smatt for (int i=0; i < rxmsg->size; i++) 2881.2Smatt printf("\t%#"PRIx64"\n", rxmsg->msg.data[i]); 2891.2Smatt } 2901.2Smatt 2911.2Smatt return 1; 2921.2Smatt} 2931.2Smatt#endif 2941.2Smatt 2951.2Smatt#ifdef MULTIPROCESSOR 2961.2Smatt/* 2971.3Scliff * cpu_rmixl_run 2981.3Scliff * 2991.3Scliff * - chip-specific post-running code called from cpu_hatch via lsw_cpu_run 3001.3Scliff */ 3011.3Scliffvoid 3021.3Scliffcpu_rmixl_run(struct cpu_info *ci) 3031.3Scliff{ 3041.3Scliff struct rmixl_cpu_softc * const sc = (void *)ci->ci_softc; 3051.3Scliff cpucore_rmixl_run(device_parent(sc->sc_dev)); 3061.3Scliff} 3071.3Scliff 3081.3Scliff/* 3091.2Smatt * cpu_rmixl_hatch 3101.2Smatt * 3111.2Smatt * - chip-specific hatch code called from cpu_hatch via lsw_cpu_init 3121.2Smatt */ 3131.2Smattvoid 3141.2Smattcpu_rmixl_hatch(struct cpu_info *ci) 3151.2Smatt{ 3161.2Smatt struct rmixl_cpu_softc * const sc = (void *)ci->ci_softc; 3171.2Smatt extern void rmixl_spl_init_cpu(void); 3181.2Smatt 3191.2Smatt rmixl_spl_init_cpu(); /* spl initialization for this CPU */ 3201.2Smatt 3211.2Smatt (void)splhigh(); 3221.2Smatt 3231.7Smatt#ifdef DIAGNOSTIC 3241.7Smatt uint32_t ebase = mipsNN_cp0_ebase_read(); 3251.7Smatt KASSERT((ebase & MIPS_EBASE_CPUNUM) == ci->ci_cpuid); 3261.2Smatt KASSERT(curcpu() == ci); 3271.2Smatt#endif 3281.2Smatt 3291.2Smatt cpucore_rmixl_hatch(device_parent(sc->sc_dev)); 3301.2Smatt 3311.4Smatt cpu_rmixl_watchpoint_init(); 3321.2Smatt} 3331.2Smatt 3341.2Smattstatic int 3351.2Smattcpu_setup_trampoline_common(struct cpu_info *ci, struct rmixl_cpu_trampoline_args *ta) 3361.2Smatt{ 3371.2Smatt struct lwp *l = ci->ci_data.cpu_idlelwp; 3381.2Smatt uintptr_t stacktop; 3391.2Smatt 3401.2Smatt#ifdef DIAGNOSTIC 3411.2Smatt /* Ensure our current stack can be used by the firmware */ 3421.2Smatt uint64_t sp; 3431.2Smatt __asm__ volatile("move %0, $sp\n" : "=r"(sp)); 3441.2Smatt#ifdef _LP64 3451.2Smatt /* can be made into a KSEG0 addr */ 3461.2Smatt KASSERT(MIPS_XKPHYS_P(sp)); 3471.2Smatt KASSERT((MIPS_XKPHYS_TO_PHYS(sp) >> 32) == 0); 3481.2Smatt#else 3491.2Smatt /* is a KSEG0 addr */ 3501.2Smatt KASSERT(MIPS_KSEG0_P(sp)); 3511.2Smatt#endif /* _LP64 */ 3521.2Smatt#endif /* DIAGNOSTIC */ 3531.2Smatt 3541.2Smatt#ifndef _LP64 3551.2Smatt /* 3561.2Smatt * Ensure 'ci' is a KSEG0 address for trampoline args 3571.2Smatt * to avoid TLB fault in cpu_trampoline() when loading ci_idlelwp 3581.2Smatt */ 3591.2Smatt KASSERT(MIPS_KSEG0_P(ci)); 3601.2Smatt#endif 3611.2Smatt 3621.2Smatt /* 3631.2Smatt * Ensure 'ta' is a KSEG0 address for trampoline args 3641.2Smatt * to avoid TLB fault in trampoline when loading args. 3651.2Smatt * 3661.2Smatt * Note: 3671.2Smatt * RMI firmware only passes the lower 32-bit half of 'ta' 3681.2Smatt * to rmixl_cpu_trampoline (the upper half is clear) 3691.2Smatt * so rmixl_cpu_trampoline must reconstruct the missing upper half 3701.3Scliff * rmixl_cpu_trampoline "knows" 'ta' is a KSEG0 address 3711.3Scliff * and sign-extends to make an LP64 KSEG0 address. 3721.2Smatt */ 3731.2Smatt KASSERT(MIPS_KSEG0_P(ta)); 3741.2Smatt 3751.2Smatt /* 3761.2Smatt * marshal args for rmixl_cpu_trampoline; 3771.2Smatt * note for non-LP64 kernel, use of intptr_t 3781.2Smatt * forces sign extension of 32 bit pointers 3791.2Smatt */ 3801.2Smatt stacktop = (uintptr_t)l->l_md.md_utf - CALLFRAME_SIZ; 3811.2Smatt ta->ta_sp = (uint64_t)(intptr_t)stacktop; 3821.2Smatt ta->ta_lwp = (uint64_t)(intptr_t)l; 3831.2Smatt ta->ta_cpuinfo = (uint64_t)(intptr_t)ci; 3841.2Smatt 3851.2Smatt return 0; 3861.2Smatt} 3871.2Smatt 3881.2Smattstatic void 3891.2Smattcpu_setup_trampoline_callback(struct cpu_info *ci) 3901.2Smatt{ 3911.2Smatt void (*wakeup_cpu)(void *, void *, unsigned int); 3921.2Smatt struct rmixl_cpu_trampoline_args *ta = &rmixl_cpu_trampoline_args; 3931.2Smatt extern void rmixl_cpu_trampoline(void *); 3941.2Smatt extern void rmixlfw_wakeup_cpu(void *, void *, u_int64_t, void *); 3951.2Smatt 3961.2Smatt cpu_setup_trampoline_common(ci, ta); 3971.2Smatt 3981.2Smatt#if _LP64 3991.2Smatt wakeup_cpu = (void *)rmixl_configuration.rc_psb_info.wakeup; 4001.2Smatt#else 4011.2Smatt wakeup_cpu = (void *)(intptr_t) 4021.2Smatt (rmixl_configuration.rc_psb_info.wakeup & 0xffffffff); 4031.2Smatt#endif 4041.2Smatt 4051.2Smatt rmixlfw_wakeup_cpu(rmixl_cpu_trampoline, (void *)ta, 4061.2Smatt (uint64_t)1 << ci->ci_cpuid, wakeup_cpu); 4071.2Smatt} 4081.2Smatt#endif /* MULTIPROCESSOR */ 4091.2Smatt 4101.2Smatt 4111.2Smatt#ifdef DEBUG 4121.2Smattvoid 4131.2Smattrmixl_cpu_data_print(struct cpu_data *dp) 4141.2Smatt{ 4151.2Smatt printf("cpu_biglock_wanted %p\n", dp->cpu_biglock_wanted); 4161.2Smatt printf("cpu_callout %p\n", dp->cpu_callout); 4171.2Smatt printf("cpu_unused1 %p\n", dp->cpu_unused1); 4181.2Smatt printf("cpu_unused2 %d\n", dp->cpu_unused2); 4191.2Smatt printf("&cpu_schedstate %p\n", &dp->cpu_schedstate); /* TBD */ 4201.2Smatt printf("&cpu_xcall %p\n", &dp->cpu_xcall); /* TBD */ 4211.2Smatt printf("cpu_xcall_pending %d\n", dp->cpu_xcall_pending); 4221.2Smatt printf("cpu_onproc %p\n", dp->cpu_onproc); 4231.2Smatt printf("cpu_idlelwp %p\n", dp->cpu_idlelwp); 4241.2Smatt printf("cpu_lockstat %p\n", dp->cpu_lockstat); 4251.2Smatt printf("cpu_index %d\n", dp->cpu_index); 4261.2Smatt printf("cpu_biglock_count %d\n", dp->cpu_biglock_count); 4271.2Smatt printf("cpu_spin_locks %d\n", dp->cpu_spin_locks); 4281.2Smatt printf("cpu_simple_locks %d\n", dp->cpu_simple_locks); 4291.2Smatt printf("cpu_spin_locks2 %d\n", dp->cpu_spin_locks2); 4301.2Smatt printf("cpu_lkdebug_recurse %d\n", dp->cpu_lkdebug_recurse); 4311.2Smatt printf("cpu_softints %d\n", dp->cpu_softints); 4321.2Smatt printf("cpu_nsyscall %"PRIu64"\n", dp->cpu_nsyscall); 4331.2Smatt printf("cpu_ntrap %"PRIu64"\n", dp->cpu_ntrap); 4341.2Smatt printf("cpu_nfault %"PRIu64"\n", dp->cpu_nfault); 4351.2Smatt printf("cpu_nintr %"PRIu64"\n", dp->cpu_nintr); 4361.2Smatt printf("cpu_nsoft %"PRIu64"\n", dp->cpu_nsoft); 4371.2Smatt printf("cpu_nswtch %"PRIu64"\n", dp->cpu_nswtch); 4381.2Smatt printf("cpu_uvm %p\n", dp->cpu_uvm); 4391.2Smatt printf("cpu_softcpu %p\n", dp->cpu_softcpu); 4401.2Smatt printf("&cpu_biodone %p\n", &dp->cpu_biodone); /* TBD */ 4411.2Smatt printf("&cpu_percpu %p\n", &dp->cpu_percpu); /* TBD */ 4421.2Smatt printf("cpu_selcluster %p\n", dp->cpu_selcluster); 4431.2Smatt printf("cpu_nch %p\n", dp->cpu_nch); 4441.2Smatt printf("&cpu_ld_locks %p\n", &dp->cpu_ld_locks); /* TBD */ 4451.2Smatt printf("&cpu_ld_lock %p\n", &dp->cpu_ld_lock); /* TBD */ 4461.2Smatt printf("cpu_cc_freq %#"PRIx64"\n", dp->cpu_cc_freq); 4471.2Smatt printf("cpu_cc_skew %#"PRIx64"\n", dp->cpu_cc_skew); 4481.2Smatt} 4491.2Smatt 4501.2Smattstruct cpu_info * 4511.2Smattrmixl_cpuinfo_print(u_int cpuindex) 4521.2Smatt{ 4531.2Smatt struct cpu_info * const ci = cpu_lookup(cpuindex); 4541.2Smatt 4551.2Smatt if (ci != NULL) { 4561.2Smatt rmixl_cpu_data_print(&ci->ci_data); 4571.2Smatt printf("ci_dev %p\n", ci->ci_dev); 4581.2Smatt printf("ci_cpuid %ld\n", ci->ci_cpuid); 4591.2Smatt printf("ci_cctr_freq %ld\n", ci->ci_cctr_freq); 4601.2Smatt printf("ci_cpu_freq %ld\n", ci->ci_cpu_freq); 4611.2Smatt printf("ci_cycles_per_hz %ld\n", ci->ci_cycles_per_hz); 4621.2Smatt printf("ci_divisor_delay %ld\n", ci->ci_divisor_delay); 4631.2Smatt printf("ci_divisor_recip %ld\n", ci->ci_divisor_recip); 4641.2Smatt printf("ci_curlwp %p\n", ci->ci_curlwp); 4651.2Smatt printf("ci_want_resched %d\n", ci->ci_want_resched); 4661.2Smatt printf("ci_mtx_count %d\n", ci->ci_mtx_count); 4671.2Smatt printf("ci_mtx_oldspl %d\n", ci->ci_mtx_oldspl); 4681.2Smatt printf("ci_idepth %d\n", ci->ci_idepth); 4691.2Smatt printf("ci_cpl %d\n", ci->ci_cpl); 4701.2Smatt printf("&ci_cpl %p\n", &ci->ci_cpl); /* XXX */ 4711.2Smatt printf("ci_next_cp0_clk_intr %#x\n", ci->ci_next_cp0_clk_intr); 4721.2Smatt for (int i=0; i < SOFTINT_COUNT; i++) 4731.2Smatt printf("ci_softlwps[%d] %p\n", i, ci->ci_softlwps[i]); 4741.2Smatt printf("ci_tlb_slot %d\n", ci->ci_tlb_slot); 4751.2Smatt printf("ci_pmap_asid_cur %d\n", ci->ci_pmap_asid_cur); 4761.2Smatt printf("ci_tlb_info %p\n", ci->ci_tlb_info); 4771.2Smatt printf("ci_pmap_seg0tab %p\n", ci->ci_pmap_seg0tab); 4781.2Smatt#ifdef _LP64 4791.2Smatt printf("ci_pmap_segtab %p\n", ci->ci_pmap_segtab); 4801.2Smatt#else 4811.2Smatt printf("ci_pmap_srcbase %#"PRIxVADDR"\n", ci->ci_pmap_srcbase); 4821.2Smatt printf("ci_pmap_dstbase %#"PRIxVADDR"\n", ci->ci_pmap_dstbase); 4831.2Smatt#endif 4841.2Smatt#ifdef MULTIPROCESSOR 4851.2Smatt printf("ci_flags %#lx\n", ci->ci_flags); 4861.2Smatt printf("ci_request_ipis %#"PRIx64"\n", ci->ci_request_ipis); 4871.2Smatt printf("ci_active_ipis %#"PRIx64"\n", ci->ci_active_ipis); 4881.2Smatt printf("ci_ksp_tlb_slot %d\n", ci->ci_ksp_tlb_slot); 4891.2Smatt#endif 4901.2Smatt } 4911.2Smatt 4921.2Smatt return ci; 4931.2Smatt} 4941.2Smatt#endif /* DEBUG */ 495