Lines Matching refs:event
77 struct sdei_event *event; member
82 #define CROSSCALL_INIT(arg, event) \ argument
84 arg.event = event; \
90 struct sdei_event *event) in sdei_do_local_call() argument
94 CROSSCALL_INIT(arg, event); in sdei_do_local_call()
101 struct sdei_event *event) in sdei_do_cross_call() argument
105 CROSSCALL_INIT(arg, event); in sdei_do_cross_call()
191 static int sdei_api_event_get_info(u32 event, u32 info, u64 *result) in sdei_api_event_get_info() argument
193 return invoke_sdei_fn(SDEI_1_0_FN_SDEI_EVENT_GET_INFO, event, info, 0, in sdei_api_event_get_info()
203 struct sdei_event *event; in sdei_event_create() local
208 event = kzalloc(sizeof(*event), GFP_KERNEL); in sdei_event_create()
209 if (!event) { in sdei_event_create()
214 INIT_LIST_HEAD(&event->list); in sdei_event_create()
215 event->event_num = event_num; in sdei_event_create()
221 event->priority = result; in sdei_event_create()
227 event->type = result; in sdei_event_create()
229 if (event->type == SDEI_EVENT_TYPE_SHARED) { in sdei_event_create()
236 reg->event_num = event->event_num; in sdei_event_create()
237 reg->priority = event->priority; in sdei_event_create()
241 event->registered = reg; in sdei_event_create()
255 reg->event_num = event->event_num; in sdei_event_create()
256 reg->priority = event->priority; in sdei_event_create()
261 event->private_registered = regs; in sdei_event_create()
265 list_add(&event->list, &sdei_list); in sdei_event_create()
268 return event; in sdei_event_create()
271 kfree(event); in sdei_event_create()
275 static void sdei_event_destroy_llocked(struct sdei_event *event) in sdei_event_destroy_llocked() argument
280 list_del(&event->list); in sdei_event_destroy_llocked()
282 if (event->type == SDEI_EVENT_TYPE_SHARED) in sdei_event_destroy_llocked()
283 kfree(event->registered); in sdei_event_destroy_llocked()
285 free_percpu(event->private_registered); in sdei_event_destroy_llocked()
287 kfree(event); in sdei_event_destroy_llocked()
290 static void sdei_event_destroy(struct sdei_event *event) in sdei_event_destroy() argument
293 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()
482 err = sdei_api_event_unregister(arg->event->event_num); in _local_event_unregister()
490 struct sdei_event *event; in sdei_event_unregister() local
495 event = sdei_event_find(event_num); in sdei_event_unregister()
496 if (!event) { in sdei_event_unregister()
503 event->reregister = false; in sdei_event_unregister()
504 event->reenable = false; in sdei_event_unregister()
507 if (event->type == SDEI_EVENT_TYPE_SHARED) in sdei_event_unregister()
508 err = sdei_api_event_unregister(event->event_num); in sdei_event_unregister()
510 err = sdei_do_cross_call(_local_event_unregister, event); in sdei_event_unregister()
515 sdei_event_destroy(event); in sdei_event_unregister()
529 struct sdei_event *event; in sdei_unregister_shared() local
533 list_for_each_entry(event, &sdei_list, list) { in sdei_unregister_shared()
534 if (event->type != SDEI_EVENT_TYPE_SHARED) in sdei_unregister_shared()
537 err = sdei_api_event_unregister(event->event_num); in sdei_unregister_shared()
562 reg = per_cpu_ptr(arg->event->private_registered, smp_processor_id()); in _local_event_register()
563 err = sdei_api_event_register(arg->event->event_num, sdei_entry_point, in _local_event_register()
572 struct sdei_event *event; in sdei_event_register() local
583 event = sdei_event_create(event_num, cb, arg); in sdei_event_register()
584 if (IS_ERR(event)) { in sdei_event_register()
585 err = PTR_ERR(event); in sdei_event_register()
591 if (event->type == SDEI_EVENT_TYPE_SHARED) { in sdei_event_register()
592 err = sdei_api_event_register(event->event_num, in sdei_event_register()
594 event->registered, in sdei_event_register()
597 err = sdei_do_cross_call(_local_event_register, event); in sdei_event_register()
599 sdei_do_cross_call(_local_event_unregister, event); in sdei_event_register()
603 sdei_event_destroy(event); in sdei_event_register()
609 event->reregister = true; in sdei_event_register()
621 struct sdei_event *event; in sdei_reregister_shared() local
625 list_for_each_entry(event, &sdei_list, list) { in sdei_reregister_shared()
626 if (event->type != SDEI_EVENT_TYPE_SHARED) in sdei_reregister_shared()
629 if (event->reregister) { in sdei_reregister_shared()
630 err = sdei_api_event_register(event->event_num, in sdei_reregister_shared()
631 sdei_entry_point, event->registered, in sdei_reregister_shared()
635 event->event_num); in sdei_reregister_shared()
636 sdei_event_destroy_llocked(event); in sdei_reregister_shared()
641 if (event->reenable) { in sdei_reregister_shared()
642 err = sdei_api_event_enable(event->event_num); in sdei_reregister_shared()
645 event->event_num); in sdei_reregister_shared()
658 struct sdei_event *event; in sdei_cpuhp_down() local
663 list_for_each_entry(event, &sdei_list, list) { in sdei_cpuhp_down()
664 if (event->type == SDEI_EVENT_TYPE_SHARED) in sdei_cpuhp_down()
667 err = sdei_do_local_call(_local_event_unregister, event); in sdei_cpuhp_down()
670 event->event_num, err); in sdei_cpuhp_down()
680 struct sdei_event *event; in sdei_cpuhp_up() local
685 list_for_each_entry(event, &sdei_list, list) { in sdei_cpuhp_up()
686 if (event->type == SDEI_EVENT_TYPE_SHARED) in sdei_cpuhp_up()
689 if (event->reregister) { in sdei_cpuhp_up()
690 err = sdei_do_local_call(_local_event_register, event); in sdei_cpuhp_up()
693 event->event_num, err); in sdei_cpuhp_up()
697 if (event->reenable) { in sdei_cpuhp_up()
698 err = sdei_do_local_call(_local_event_enable, event); in sdei_cpuhp_up()
701 event->event_num, err); in sdei_cpuhp_up()