// SPDX-License-Identifier: GPL-2.0/* * Copyright IBM Corp. 2016, 2023 * Author(s): Martin Schwidefsky <schwidefsky@de.ibm.com> * * Adjunct processor bus, queue related code. */#define pr_fmt(fmt) "ap: " fmt#include<linux/export.h>#include<linux/init.h>#include<linux/slab.h>#include<asm/facility.h>#define CREATE_TRACE_POINTS#include<asm/trace/ap.h>#include"ap_bus.h"#include"ap_debug.h"EXPORT_TRACEPOINT_SYMBOL(s390_ap_nqap);EXPORT_TRACEPOINT_SYMBOL(s390_ap_dqap);staticvoid__ap_flush_queue(structap_queue*aq);/* * some AP queue helper functions */staticinlineboolap_q_supported_in_se(structap_queue*aq){returnaq->card->hwinfo.ep11||aq->card->hwinfo.accel;}staticinlineboolap_q_supports_bind(structap_queue*aq){returnaq->card->hwinfo.ep11||aq->card->hwinfo.accel;}staticinlineboolap_q_supports_assoc(structap_queue*aq){returnaq->card->hwinfo.ep11;}staticinlineboolap_q_needs_bind(structap_queue*aq){returnap_q_supports_bind(aq)&&ap_sb_available();}/** * ap_queue_enable_irq(): Enable interrupt support on this AP queue. * @aq: The AP queue * @ind: the notification indicator byte * * Enables interruption on AP queue via ap_aqic(). Based on the return * value it waits a while and tests the AP queue if interrupts * have been switched on using ap_test_queue(). */staticintap_queue_enable_irq(structap_queue*aq,void*ind){unionap_qirq_ctrlqirqctrl={.value=0};structap_queue_statusstatus;qirqctrl.ir=1;qirqctrl.isc=AP_ISC;status=ap_aqic(aq->