Lines Matching refs:pcpu
77 struct pcpu { struct
86 static struct pcpu pcpu_devices[NR_CPUS]; argument
136 static int pcpu_sigp_retry(struct pcpu *pcpu, u8 order, u32 parm) in pcpu_sigp_retry() argument
141 cc = __pcpu_sigp(pcpu->address, order, parm, NULL); in pcpu_sigp_retry()
150 static inline int pcpu_stopped(struct pcpu *pcpu) in pcpu_stopped() argument
154 if (__pcpu_sigp(pcpu->address, SIGP_SENSE, in pcpu_stopped()
160 static inline int pcpu_running(struct pcpu *pcpu) in pcpu_running() argument
162 if (__pcpu_sigp(pcpu->address, SIGP_SENSE_RUNNING, in pcpu_running()
172 static struct pcpu *pcpu_find_address(const struct cpumask *mask, u16 address) in pcpu_find_address()
182 static void pcpu_ec_call(struct pcpu *pcpu, int ec_bit) in pcpu_ec_call() argument
186 if (test_and_set_bit(ec_bit, &pcpu->ec_mask)) in pcpu_ec_call()
188 order = pcpu_running(pcpu) ? SIGP_EXTERNAL_CALL : SIGP_EMERGENCY_SIGNAL; in pcpu_ec_call()
189 pcpu->ec_clk = get_tod_clock_fast(); in pcpu_ec_call()
190 pcpu_sigp_retry(pcpu, order, 0); in pcpu_ec_call()
193 static int pcpu_alloc_lowcore(struct pcpu *pcpu, int cpu) in pcpu_alloc_lowcore() argument
220 pcpu_sigp_retry(pcpu, SIGP_SET_PREFIX, __pa(lc)); in pcpu_alloc_lowcore()
233 static void pcpu_free_lowcore(struct pcpu *pcpu) in pcpu_free_lowcore() argument
239 cpu = pcpu - pcpu_devices; in pcpu_free_lowcore()
244 pcpu_sigp_retry(pcpu, SIGP_SET_PREFIX, 0); in pcpu_free_lowcore()
254 static void pcpu_prepare_secondary(struct pcpu *pcpu, int cpu) in pcpu_prepare_secondary() argument
280 static void pcpu_attach_task(struct pcpu *pcpu, struct task_struct *tsk) in pcpu_attach_task() argument
285 cpu = pcpu - pcpu_devices; in pcpu_attach_task()
299 static void pcpu_start_fn(struct pcpu *pcpu, void (*func)(void *), void *data) in pcpu_start_fn() argument
304 cpu = pcpu - pcpu_devices; in pcpu_start_fn()
310 pcpu_sigp_retry(pcpu, SIGP_RESTART, 0); in pcpu_start_fn()
323 static void pcpu_delegate(struct pcpu *pcpu, in pcpu_delegate() argument
330 lc = lowcore_ptr[pcpu - pcpu_devices]; in pcpu_delegate()
333 if (pcpu->address == source_cpu) { in pcpu_delegate()
338 pcpu_sigp_retry(pcpu, SIGP_STOP, 0); in pcpu_delegate()
339 pcpu_sigp_retry(pcpu, SIGP_CPU_RESET, 0); in pcpu_delegate()
359 : : "d" (pcpu->address), "d" (source_cpu), in pcpu_delegate()
390 struct pcpu *pcpu; in smp_call_online_cpu() local
393 pcpu = pcpu_find_address(cpu_online_mask, stap()); in smp_call_online_cpu()
394 if (!pcpu) in smp_call_online_cpu()
396 pcpu = pcpu_devices + cpumask_first(cpu_online_mask); in smp_call_online_cpu()
397 pcpu_delegate(pcpu, func, data, (unsigned long) restart_stack); in smp_call_online_cpu()
466 struct pcpu *pcpu = pcpu_devices + cpu; in smp_emergency_stop() local
467 set_bit(ec_stop_cpu, &pcpu->ec_mask); in smp_emergency_stop()
468 while (__pcpu_sigp(pcpu->address, SIGP_EMERGENCY_SIGNAL, in smp_emergency_stop()
623 struct pcpu *pcpu; in smp_store_status() local
626 pcpu = pcpu_devices + cpu; in smp_store_status()
629 if (__pcpu_sigp_relax(pcpu->address, SIGP_STORE_STATUS_AT_ADDRESS, in smp_store_status()
637 if (__pcpu_sigp_relax(pcpu->address, SIGP_STORE_ADDITIONAL_STATUS, in smp_store_status()
773 struct pcpu *pcpu; in smp_add_core() local
785 pcpu = pcpu_devices + cpu; in smp_add_core()
786 pcpu->address = address + i; in smp_add_core()
788 pcpu->state = CPU_STATE_CONFIGURED; in smp_add_core()
790 pcpu->state = CPU_STATE_STANDBY; in smp_add_core()
922 struct pcpu *pcpu = pcpu_devices + cpu; in __cpu_up() local
925 if (pcpu->state != CPU_STATE_CONFIGURED) in __cpu_up()
927 if (pcpu_sigp_retry(pcpu, SIGP_INITIAL_CPU_RESET, 0) != in __cpu_up()
931 rc = pcpu_alloc_lowcore(pcpu, cpu); in __cpu_up()
939 pcpu_prepare_secondary(pcpu, cpu); in __cpu_up()
940 pcpu_attach_task(pcpu, tidle); in __cpu_up()
941 pcpu_start_fn(pcpu, smp_start_secondary, NULL); in __cpu_up()
983 struct pcpu *pcpu; in __cpu_die() local
986 pcpu = pcpu_devices + cpu; in __cpu_die()
987 while (!pcpu_stopped(pcpu)) in __cpu_die()
989 pcpu_free_lowcore(pcpu); in __cpu_die()
1026 struct pcpu *pcpu = pcpu_devices; in smp_prepare_boot_cpu() local
1029 pcpu->state = CPU_STATE_CONFIGURED; in smp_prepare_boot_cpu()
1068 struct pcpu *pcpu; in cpu_configure_store() local
1087 pcpu = pcpu_devices + cpu; in cpu_configure_store()
1091 if (pcpu->state != CPU_STATE_CONFIGURED) in cpu_configure_store()
1093 rc = sclp_core_deconfigure(pcpu->address >> smp_cpu_mt_shift); in cpu_configure_store()
1099 pcpu[i].state = CPU_STATE_STANDBY; in cpu_configure_store()
1106 if (pcpu->state != CPU_STATE_STANDBY) in cpu_configure_store()
1108 rc = sclp_core_configure(pcpu->address >> smp_cpu_mt_shift); in cpu_configure_store()
1114 pcpu[i].state = CPU_STATE_CONFIGURED; in cpu_configure_store()