Lines Matching defs:CPU

75  * Per-CPU data.
83 processorid_t cpu_id; /* CPU number */
84 processorid_t cpu_seqid; /* sequential CPU id (0..ncpus-1) */
85 volatile cpu_flag_t cpu_flags; /* flags indicating CPU state */
88 kthread_t *cpu_idle_thread; /* idle thread for this CPU */
89 kthread_t *cpu_pause_thread; /* pause thread for this CPU */
92 struct cpupart *cpu_part; /* partition with this CPU */
105 struct cpu *cpu_next; /* next existing CPU */
106 struct cpu *cpu_prev; /* prev existing CPU */
107 struct cpu *cpu_next_onln; /* next online (enabled) CPU */
108 struct cpu *cpu_prev_onln; /* prev online (enabled) CPU */
109 struct cpu *cpu_next_part; /* next CPU in partition */
110 struct cpu *cpu_prev_part; /* prev CPU in partition */
111 struct cpu *cpu_next_lgrp; /* next CPU in latency group */
112 struct cpu *cpu_prev_lgrp; /* prev CPU in latency group */
113 struct cpu *cpu_next_lpl; /* next CPU in lgrp partition */
125 * Note that cpu_disp is set before the CPU is added to the system
155 cpu_stats_t cpu_stats; /* per-CPU statistics */
174 time_t cpu_state_begin; /* when CPU entered current state */
224 * cpu_generation is updated whenever CPU goes on-line or off-line.
246 * The cpu_core structure consists of per-CPU state available in any context.
291 * CPU_PSEUDO_RANDOM() returns a per CPU value that changes each time one
296 #define CPU_PSEUDO_RANDOM() (CPU->cpu_rotor++)
305 * Flags in the CPU structure.
311 * CPU_ENABLE indicates that the CPU is participating in I/O interrupts
313 * is off, the CPU will not be given interrupts that can be sent elsewhere,
314 * but will still get interrupts from devices associated with that CPU only,
318 * other than interrupt threads to run on that CPU. A CPU will not have
322 * CPU and it will not have to run interrupt threads. In this case it'll
334 #define CPU_RUNNING 0x001 /* CPU running */
335 #define CPU_READY 0x002 /* CPU ready for cross-calls */
336 #define CPU_QUIESCED 0x004 /* CPU will stay in idle */
337 #define CPU_EXISTS 0x008 /* CPU is configured */
338 #define CPU_ENABLE 0x010 /* CPU enabled for interrupts */
339 #define CPU_OFFLINE 0x020 /* CPU offline via p_online */
340 #define CPU_POWEROFF 0x040 /* CPU is powered off */
341 #define CPU_FROZEN 0x080 /* CPU is frozen via CPR suspend */
342 #define CPU_SPARE 0x100 /* CPU offline available for use */
343 #define CPU_FAULTED 0x200 /* CPU offline diagnosed faulty */
354 #define CPU_FORCED 0x0001 /* Force CPU offline */
384 * These flags must be changed only by the current CPU.
386 #define CPU_DISP_DONTSTEAL 0x01 /* CPU undergoing context swtch */
387 #define CPU_DISP_HALTED 0x02 /* CPU halted waiting for interrupt */
395 * bitmap may vary in size depending on the maximum CPU id a specific
397 * the platform supports, since CPU ids can be sparse. We define two
398 * sets of macros; one for platforms where the maximum CPU id is less
437 * Find one CPU in the cpuset.
438 * Sets "cpu" to the id of the found CPU, or CPUSET_NOTINSET if no cpu
446 * Determine the smallest and largest CPU id in the set. Returns
551 extern struct cpu *cpu[]; /* indexed by CPU number */
552 extern struct cpu **cpu_seq; /* indexed by sequential CPU id */
560 extern processorid_t max_cpuid; /* maximum CPU number */
567 #define CPU (curcpup()) /* Pointer to current CPU */
569 #define CPU (curthread->t_cpu) /* Pointer to current CPU */
573 * CPU_CURRENT indicates to thread_affinity_set to use CPU->cpu_id
580 * Per-CPU statistics
591 CPU_STATS_ADDQ(CPU, class, stat, amount); \
608 * Increment CPU generation value.
609 * This macro should be called whenever CPU goes on-line or off-line.
617 * CPU support routines.
642 void poke_cpu(int cpun); /* interrupt another CPU (to preempt) */
660 cpu_t *cpu_get(processorid_t cpun); /* get the CPU struct associated */
669 cpu_t *cpu_intr_next(cpu_t *cp); /* get next online CPU taking intrs */
671 int cpu_intr_on(cpu_t *cp); /* CPU taking I/O interrupts? */
677 * Routines for checking CPU states.
679 int cpu_is_online(cpu_t *); /* check if CPU is online */
680 int cpu_is_nointr(cpu_t *); /* check if CPU can service intrs */
681 int cpu_is_active(cpu_t *); /* check if CPU can run threads */
682 int cpu_is_offline(cpu_t *); /* check if CPU is offline */
683 int cpu_is_poweredoff(cpu_t *); /* check if CPU is powered off */
685 int cpu_flagged_online(cpu_flag_t); /* flags show CPU is online */
686 int cpu_flagged_nointr(cpu_flag_t); /* flags show CPU not handling intrs */
687 int cpu_flagged_active(cpu_flag_t); /* flags show CPU scheduling threads */
688 int cpu_flagged_offline(cpu_flag_t); /* flags show CPU is offline */
689 int cpu_flagged_poweredoff(cpu_flag_t); /* flags show CPU is powered off */
692 * The processor_info(2) state of a CPU is a simplified representation suitable
694 * internal per-CPU state as given by the cpu_flags member of the cpu structure,
696 * critical to a subsystem's disposition of a particular CPU.
703 void cpu_set_curr_clock(uint64_t); /* indicate the current CPU's freq */
704 void cpu_set_supp_freqs(cpu_t *, const char *); /* set the CPU supported */
741 extern kmutex_t cpu_lock; /* lock protecting CPU data */
744 * CPU state change events
747 * information by registering CPU state change callbacks using
748 * register_cpu_setup_func(). Whenever any CPU changes its state, the callback
752 * CPU ID
765 * CPU_INIT A new CPU is started and added to the list of active CPUs
768 * CPU_CONFIG A newly inserted CPU is prepared for starting running code
771 * CPU_UNCONFIG CPU has been powered off and needs cleanup
774 * CPU_ON CPU is enabled but does not run anything yet
776 * CPU_INTR_ON CPU is enabled and has interrupts enabled
778 * CPU_OFF CPU is going offline but can still run threads
780 * CPU_CPUPART_OUT CPU is going to move out of its partition
782 * CPU_CPUPART_IN CPU is going to move to a new partition
784 * CPU_SETUP CPU is set up during boot and can run threads
809 * Call specified function on the given CPU
816 * Create various strings that describe the given CPU for the