From nobody Wed Oct 19 12:50:20 2022 X-Original-To: freebsd-hackers@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Msrtd5nsCz4fwvF for ; Wed, 19 Oct 2022 13:19:53 +0000 (UTC) (envelope-from takawata@init-main.com) Received: from sana.init-main.com (104.194.138.210.bn.2iij.net [210.138.194.104]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "amnesiac", Issuer "amnesiac" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4MsrtX6QZjz3GPD for ; Wed, 19 Oct 2022 13:19:48 +0000 (UTC) (envelope-from takawata@init-main.com) Received: from sana.init-main.com (localhost [127.0.0.1]) by sana.init-main.com (8.16.1/8.16.1) with ESMTP id 29JCoK1s083469 for ; Wed, 19 Oct 2022 21:50:20 +0900 (JST) (envelope-from takawata@init-main.com) Message-Id: <202210191250.29JCoK1s083469@sana.init-main.com> From: Takanori Watanabe To: freebsd-hackers@freebsd.org Subject: How can I get raw value of interrupt ACPI resource value in INTRNG? List-Id: Technical discussions relating to FreeBSD List-Archive: https://lists.freebsd.org/archives/freebsd-hackers List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-hackers@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <83467.1666183820.1@sana.init-main.com> Date: Wed, 19 Oct 2022 21:50:20 +0900 X-Rspamd-Queue-Id: 4MsrtX6QZjz3GPD X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of takawata@init-main.com designates 210.138.194.104 as permitted sender) smtp.mailfrom=takawata@init-main.com X-Spamd-Result: default: False [-1.65 / 15.00]; SUBJECT_ENDS_QUESTION(1.00)[]; NEURAL_HAM_LONG(-1.00)[-0.999]; NEURAL_HAM_MEDIUM(-1.00)[-0.996]; NEURAL_HAM_SHORT(-0.86)[-0.859]; SUBJECT_ENDS_SPACES(0.50)[]; R_SPF_ALLOW(-0.20)[+a]; MIME_GOOD(-0.10)[text/plain]; MLMMJ_DEST(0.00)[freebsd-hackers@freebsd.org]; RCVD_TLS_LAST(0.00)[]; R_DKIM_NA(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; ASN(0.00)[asn:2497, ipnet:210.138.0.0/16, country:JP]; MIME_TRACE(0.00)[0:+]; ARC_NA(0.00)[]; MID_RHS_MATCH_FROMTLD(0.00)[]; RCPT_COUNT_ONE(0.00)[1]; FROM_HAS_DN(0.00)[]; FREEFALL_USER(0.00)[takawata]; DMARC_NA(0.00)[init-main.com]; TO_MATCH_ENVRCPT_ALL(0.00)[]; TO_DN_NONE(0.00)[]; PREVIOUSLY_DELIVERED(0.00)[freebsd-hackers@freebsd.org]; RCVD_COUNT_TWO(0.00)[2] X-ThisMailContainsUnwantedMimeParts: N I wrote ACPI Generic Event device driver, found at least in qemu. https://reviews.freebsd.org/D37032 This works fine for qemu, but I have problem about this. This driver receive interrupt and invoke "_EVT" method to process ACPI function, such as sending Notify to other ACPI device. This driver can handle multiple interrupt, though qemu use only one and the event cause is obtained from memory-mapped I/O by ACPI bytecode. To distingish each interrupts, the spec requires the driver invoke _EVT method with IRQ identifier. This IRQ identifier should be interrupt resource value encoded in _CRS data, and I believe it is available from rman_get_start(theResource), but I aware the resource value in dmesg and ACPI resource value that can be available from DSDT is not same. I look inside and found irq number mapping is done before setting resource by rman_set_resource and the raw value of the resource is hidden in subr_intr.c static function, it seems. How can I do to obtain raw ACPI IRQ resource value?