Lines Matching refs:event

75 	struct sdei_event *event;  member
80 #define CROSSCALL_INIT(arg, event) \ argument
82 arg.event = event; \
88 struct sdei_event *event) in sdei_do_local_call() argument
92 CROSSCALL_INIT(arg, event); in sdei_do_local_call()
99 struct sdei_event *event) in sdei_do_cross_call() argument
103 CROSSCALL_INIT(arg, event); in sdei_do_cross_call()
189 static int sdei_api_event_get_info(u32 event, u32 info, u64 *result) in sdei_api_event_get_info() argument
191 return invoke_sdei_fn(SDEI_1_0_FN_SDEI_EVENT_GET_INFO, event, info, 0, in sdei_api_event_get_info()
201 struct sdei_event *event; in sdei_event_create() local
206 event = kzalloc(sizeof(*event), GFP_KERNEL); in sdei_event_create()
207 if (!event) { in sdei_event_create()
212 INIT_LIST_HEAD(&event->list); in sdei_event_create()
213 event->event_num = event_num; in sdei_event_create()
219 event->priority = result; in sdei_event_create()
225 event->type = result; in sdei_event_create()
227 if (event->type == SDEI_EVENT_TYPE_SHARED) { in sdei_event_create()
234 reg->event_num = event->event_num; in sdei_event_create()
235 reg->priority = event->priority; in sdei_event_create()
239 event->registered = reg; in sdei_event_create()
253 reg->event_num = event->event_num; in sdei_event_create()
254 reg->priority = event->priority; in sdei_event_create()
259 event->private_registered = regs; in sdei_event_create()
263 list_add(&event->list, &sdei_list); in sdei_event_create()
266 return event; in sdei_event_create()
269 kfree(event); in sdei_event_create()
273 static void sdei_event_destroy_llocked(struct sdei_event *event) in sdei_event_destroy_llocked() argument
278 list_del(&event->list); in sdei_event_destroy_llocked()
280 if (event->type == SDEI_EVENT_TYPE_SHARED) in sdei_event_destroy_llocked()
281 kfree(event->registered); in sdei_event_destroy_llocked()
283 free_percpu(event->private_registered); in sdei_event_destroy_llocked()
285 kfree(event); in sdei_event_destroy_llocked()
288 static void sdei_event_destroy(struct sdei_event *event) in sdei_event_destroy() argument
291 sdei_event_destroy_llocked(event); in sdei_event_destroy()
394 err = sdei_api_event_enable(arg->event->event_num); in _local_event_enable()
402 struct sdei_event *event; in sdei_event_enable() local
405 event = sdei_event_find(event_num); in sdei_event_enable()
406 if (!event) { in sdei_event_enable()
413 if (event->type == SDEI_EVENT_TYPE_SHARED) in sdei_event_enable()
414 err = sdei_api_event_enable(event->event_num); in sdei_event_enable()
416 err = sdei_do_cross_call(_local_event_enable, event); in sdei_event_enable()
420 event->reenable = true; in sdei_event_enable()
440 err = sdei_api_event_disable(arg->event->event_num); in _ipi_event_disable()
448 struct sdei_event *event; in sdei_event_disable() local
451 event = sdei_event_find(event_num); in sdei_event_disable()
452 if (!event) { in sdei_event_disable()
458 event->reenable = false; in sdei_event_disable()
461 if (event->type == SDEI_EVENT_TYPE_SHARED) in sdei_event_disable()
462 err = sdei_api_event_disable(event->event_num); in sdei_event_disable()
464 err = sdei_do_cross_call(_ipi_event_disable, event); in sdei_event_disable()
484 err = sdei_api_event_unregister(arg->event->event_num); in _local_event_unregister()
492 struct sdei_event *event; in sdei_event_unregister() local
497 event = sdei_event_find(event_num); in sdei_event_unregister()
498 if (!event) { in sdei_event_unregister()
505 event->reregister = false; in sdei_event_unregister()
506 event->reenable = false; in sdei_event_unregister()
509 if (event->type == SDEI_EVENT_TYPE_SHARED) in sdei_event_unregister()
510 err = sdei_api_event_unregister(event->event_num); in sdei_event_unregister()
512 err = sdei_do_cross_call(_local_event_unregister, event); in sdei_event_unregister()
517 sdei_event_destroy(event); in sdei_event_unregister()
531 struct sdei_event *event; in sdei_unregister_shared() local
535 list_for_each_entry(event, &sdei_list, list) { in sdei_unregister_shared()
536 if (event->type != SDEI_EVENT_TYPE_SHARED) in sdei_unregister_shared()
539 err = sdei_api_event_unregister(event->event_num); in sdei_unregister_shared()
566 reg = per_cpu_ptr(arg->event->private_registered, smp_processor_id()); in _local_event_register()
567 err = sdei_api_event_register(arg->event->event_num, sdei_entry_point, in _local_event_register()
576 struct sdei_event *event; in sdei_event_register() local
587 event = sdei_event_create(event_num, cb, arg); in sdei_event_register()
588 if (IS_ERR(event)) { in sdei_event_register()
589 err = PTR_ERR(event); in sdei_event_register()
595 if (event->type == SDEI_EVENT_TYPE_SHARED) { in sdei_event_register()
596 err = sdei_api_event_register(event->event_num, in sdei_event_register()
598 event->registered, in sdei_event_register()
601 err = sdei_do_cross_call(_local_event_register, event); in sdei_event_register()
603 sdei_do_cross_call(_local_event_unregister, event); in sdei_event_register()
607 sdei_event_destroy(event); in sdei_event_register()
613 event->reregister = true; in sdei_event_register()
625 struct sdei_event *event; in sdei_reregister_shared() local
629 list_for_each_entry(event, &sdei_list, list) { in sdei_reregister_shared()
630 if (event->type != SDEI_EVENT_TYPE_SHARED) in sdei_reregister_shared()
633 if (event->reregister) { in sdei_reregister_shared()
634 err = sdei_api_event_register(event->event_num, in sdei_reregister_shared()
635 sdei_entry_point, event->registered, in sdei_reregister_shared()
639 event->event_num); in sdei_reregister_shared()
640 sdei_event_destroy_llocked(event); in sdei_reregister_shared()
645 if (event->reenable) { in sdei_reregister_shared()
646 err = sdei_api_event_enable(event->event_num); in sdei_reregister_shared()
649 event->event_num); in sdei_reregister_shared()
662 struct sdei_event *event; in sdei_cpuhp_down() local
667 list_for_each_entry(event, &sdei_list, list) { in sdei_cpuhp_down()
668 if (event->type == SDEI_EVENT_TYPE_SHARED) in sdei_cpuhp_down()
671 err = sdei_do_local_call(_local_event_unregister, event); in sdei_cpuhp_down()
674 event->event_num, err); in sdei_cpuhp_down()
684 struct sdei_event *event; in sdei_cpuhp_up() local
689 list_for_each_entry(event, &sdei_list, list) { in sdei_cpuhp_up()
690 if (event->type == SDEI_EVENT_TYPE_SHARED) in sdei_cpuhp_up()
693 if (event->reregister) { in sdei_cpuhp_up()
694 err = sdei_do_local_call(_local_event_register, event); in sdei_cpuhp_up()
697 event->event_num, err); in sdei_cpuhp_up()
701 if (event->reenable) { in sdei_cpuhp_up()
702 err = sdei_do_local_call(_local_event_enable, event); in sdei_cpuhp_up()
705 event->event_num, err); in sdei_cpuhp_up()