MAXCPU
extern struct gate_descriptor idt_arr[MAXCPU][NIDT];
if (nproc > MAXCPU) {
if (sc->sc_ncores > MAXCPU)
struct sysctl_oid *sc_sysctl_cpu[MAXCPU];
struct vmbus_pcpu_data vmbus_pcpu[MAXCPU];
struct kinfo_cputime cputime_percpu[MAXCPU];
struct kinfo_pctrack cputime_pctrack[MAXCPU][PCTRACK_SIZE];
static struct knote_cache_list knote_cache_lists[MAXCPU];
static struct task *deadlwp_task[MAXCPU];
static struct lwplist deadlwp_list[MAXCPU];
static struct lwkt_token deadlwp_token[MAXCPU];
static struct systimer emergency_intr_timer[MAXCPU];
static struct thread *emergency_intr_thread[MAXCPU];
struct intr_info ary[MAXCPU][MAX_INTS];
static int max_installed_hard_intr[MAXCPU];
struct ktr_cpu ktr_cpu[MAXCPU] = {
struct tstate tstate[MAXCPU];
static struct sensor_taskthr sensor_task_threads[MAXCPU];
} sysref_array[MAXCPU];
static softclock_pcpu_t softclock_pcpu_ary[MAXCPU];
static struct lwkt_ipiq_latency_log lwkt_ipiq_latency_logs[MAXCPU];
static struct ipiq_stats ipiq_stats_percpu[MAXCPU];
int visited[MAXCPU], i, j, pos, cpuid;
bzero(visited, MAXCPU * sizeof(int));
pcpu_sysctl = kmalloc(sizeof(*pcpu_sysctl) * MAXCPU, M_PCPUSYS,
char physical_siblings[8*MAXCPU];
char core_siblings[8*MAXCPU];
__read_frequently static cpu_node_t cpu_topology_nodes[MAXCPU];
static char cpu_topology_members[8*MAXCPU];
for (i = 0 ; i < MAXCPU && cpu_root_node->child_node[i]; ++i) {
static struct thread *cpuhelper[MAXCPU];
struct taskqgroup_cpu tqg_queue[MAXCPU];
struct taskqueue *taskqueue_thread[MAXCPU];
u_int32_t min_level = MAXCPU; /* number of levels < MAXCPU */
static struct usched_bsd4_pcpu bsd4_pcpu[MAXCPU];
static struct usched_dfly_pcpu dfly_pcpu[MAXCPU];
static struct usched_dummy_pcpu dummy_pcpu[MAXCPU];
static char flushingbufs[MAXCPU];
struct bufpcpu bufpcpu[MAXCPU];
static struct mntcache pcpu_mntcache[MAXCPU];
static struct arc4_data *arc4_data_pcpu[MAXCPU];
static struct ifsubq_stage_head ifsubq_stage_heads[MAXCPU];
static struct poll_comm *poll_common[MAXCPU];
static struct iopoll_ctx *rxpoll_context[MAXCPU];
static struct iopoll_ctx *txpoll_context[MAXCPU];
struct ifpoll_io ifpi_rx[MAXCPU];
struct ifpoll_io ifpi_tx[MAXCPU];
static struct ipfw_context *ipfw_ctx[MAXCPU];
extern struct ipfw3_state_context *fw3_state_ctx[MAXCPU];
struct ipfw3_context *fw3_ctx[MAXCPU];
extern struct ipfw3_context *fw3_ctx[MAXCPU];
extern struct ipfw3_context *fw3_ctx[MAXCPU];
extern struct ipfw3_state_context *fw3_state_ctx[MAXCPU];
struct ipfw3_state_context *fw3_state_ctx[MAXCPU];
extern struct ipfw3_context *fw3_ctx[MAXCPU];
extern struct ipfw3_context *fw3_ctx[MAXCPU];
extern struct ipfw3_context *fw3_ctx[MAXCPU];
extern struct ipfw3_context *fw3_ctx[MAXCPU];
struct ip_fw3_nat_context *ip_fw3_nat_ctx[MAXCPU];
extern struct ipfw3_context *fw3_ctx[MAXCPU];
static struct netisr_data *netisr_data[MAXCPU];
struct thread *netisr_threads[MAXCPU];
struct netmsg_barrier *br_msgs[MAXCPU];
extern struct thread *netisr_threads[MAXCPU];
static struct radix_mask *rn_mkfreelist[MAXCPU];
static struct radix_node_head *mask_rnheads[MAXCPU];
static struct rtstatistics rtstatistics_percpu[MAXCPU] __cachealign;
struct radix_node_head *rt_tables[MAXCPU][AF_MAX+1];
extern struct radix_node_head *rt_tables[MAXCPU][AF_MAX+1];
struct lwkt_port *ng_msgport[MAXCPU];
extern struct lwkt_port *ng_msgport[MAXCPU];
static struct arp_pcpu_data *arp_data[MAXCPU];
static struct in_rtq_pcpu in_rtq_pcpu[MAXCPU];
static struct initport_index initport_indices[MAXCPU];
static struct ipflow_pcpu *ipflow_pcpu_data[MAXCPU];
struct iprandinfo iprandcpu[MAXCPU];
struct in_ifaddrhead in_ifaddrheads[MAXCPU]; /* first inet address */
struct in_ifaddrhashhead *in_ifaddrhashtbls[MAXCPU];
static struct mbuf *ipforward_mtemp[MAXCPU];
struct ip_stats ipstats_percpu[MAXCPU] __cachealign;
static struct ipfrag_queue ipfrag_queue_pcpu[MAXCPU];
extern struct ip_stats ipstats_percpu[MAXCPU];
struct inpcbinfo tcbinfo[MAXCPU];
struct tcpcbackq tcpcbackq[MAXCPU];
struct tcp_reass_pcpu tcp_reassq[MAXCPU];
struct tcp_isn tcp_isn_ary[MAXCPU];
struct tcp_stats tcpstats_percpu[MAXCPU] __cachealign;
struct tcp_state_count tcpstate_count[MAXCPU] __cachealign;
static struct tcp_syncache_percpu *tcp_syncache_percpu[MAXCPU];
extern struct tcp_stats tcpstats_percpu[MAXCPU];
extern struct tcp_state_count tcpstate_count[MAXCPU];
struct inpcbinfo udbinfo[MAXCPU];
struct udpstat udpstat_percpu[MAXCPU] __cachealign;
extern struct inpcbinfo udbinfo[MAXCPU];
extern struct udpstat udpstat_percpu[MAXCPU];
static struct in6_rttimo_ctx in6_rtqtimo_ctx[MAXCPU];
static struct in6_rttimo_ctx in6_mtutimo_ctx[MAXCPU];
struct route_in6 ip6_forward_rt_array[MAXCPU];
static char ethstr[MAXCPU][ETHER_ADDRSTRLEN + 1];
struct mpls_stats mplsstats_percpu[MAXCPU];
struct route mplsforward_rt[MAXCPU];
extern struct mpls_stats mplsstats_percpu[MAXCPU];
KASSERT(rm->rm_cpuid >= 0 && rm->rm_cpuid < MAXCPU,
} ioapic_irqmaps[MAXCPU][IOAPIC_HWI_VECTORS];
for (cpu = 0; cpu < MAXCPU; ++cpu) {
ap_max = MAXCPU - 1;
if (ap_max > MAXCPU - 1)
ap_max = MAXCPU - 1;
for (cpu = 0; cpu < MAXCPU; ++cpu) {
KASSERT(rm->rm_cpuid >= 0 && rm->rm_cpuid < MAXCPU,
} icu_irqmaps[MAXCPU][IDT_HWI_VECTORS];
} tsc_saved[MAXCPU];
struct privatespace *CPU_prvspace[MAXCPU] = { &CPU_prvspace_bsp };
int64_t tsc_offsets[MAXCPU];
struct gate_descriptor idt_arr[MAXCPU][NIDT];
struct region_descriptor r_idt_arr[MAXCPU];
for (cpu = 0; cpu < MAXCPU; ++cpu) {
for (cpu = 0; cpu < MAXCPU; ++cpu) {
eaddr <= (vm_offset_t)&CPU_prvspace[MAXCPU]) {
static struct cpu_idle_stat cpu_idle_stats[MAXCPU];
struct pcb stoppcbs[MAXCPU];
for (id = 0; id < MAXCPU; ++id) {
for (id = 0; id < MAXCPU; id++) {
else if (cpu < MAXCPU) {
static struct rman irq_rman[MAXCPU], drq_rman, port_rman, mem_rman;
static pmap_inval_info_t invinfo[MAXCPU];
KKASSERT(n >= 0 && n < MAXCPU);
struct syscallwc SysCallsWorstCase[MAXCPU];
extern pthread_t ap_tids[MAXCPU];
eaddr <= (vm_offset_t)&CPU_prvspace[MAXCPU]) {
if (optcpus < 1 || optcpus > MAXCPU)
usage_err("Bad ncpus, valid range is 1-%d", MAXCPU);
static sysclock_t vktimer_reload[MAXCPU];
int64_t tsc_offsets[MAXCPU];
pthread_t ap_tids[MAXCPU];
struct cpu_node * child_node[MAXCPU];
extern struct kinfo_cputime cputime_percpu[MAXCPU];
#define MAPENTRYBSP_CACHE (MAXCPU+1)
static struct vm_map_entry cpu_map_entry_init_ap[MAXCPU][MAPENTRYAP_CACHE];
for (i = 0; i < MAXCPU && cpup->child_node[i]; ++i)
struct pktgen_pcpu pktg_pcpu[MAXCPU];
static struct cpu_state pcpu_state[MAXCPU];
static int cpu2pwrdom[MAXCPU]; /* cpu to cpu power domain map */
static struct kinfo_cputime ocpu_time[MAXCPU];
static struct kinfo_cputime ncpu_time[MAXCPU];
#define MAXDOM MAXCPU /* worst case, 1 cpu per domain */