From nobody Wed Oct 19 15:22:48 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 4MswGP389Fz4gHHD for ; Wed, 19 Oct 2022 15:52:13 +0000 (UTC) (envelope-from takawata@sana.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 4MswGL319qz3WpK for ; Wed, 19 Oct 2022 15:52:08 +0000 (UTC) (envelope-from takawata@sana.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 ESMTPS id 29JFMmbY084219 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO) for ; Thu, 20 Oct 2022 00:22:48 +0900 (JST) (envelope-from takawata@sana.init-main.com) Received: (from takawata@localhost) by sana.init-main.com (8.16.1/8.16.1/Submit) id 29JFMm0t084218 for freebsd-hackers@freebsd.org; Thu, 20 Oct 2022 00:22:48 +0900 (JST) (envelope-from takawata) Date: Thu, 20 Oct 2022 00:22:48 +0900 From: Takanori Watanabe To: freebsd-hackers@freebsd.org Subject: Re: How can I get raw value of interrupt ACPI resource value in INTRNG? Message-ID: References: <202210191250.29JCoK1s083469@sana.init-main.com> 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-Disposition: inline In-Reply-To: <202210191250.29JCoK1s083469@sana.init-main.com> X-Rspamd-Queue-Id: 4MswGL319qz3WpK X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=none (mx1.freebsd.org: domain of takawata@sana.init-main.com has no SPF policy when checking 210.138.194.104) smtp.mailfrom=takawata@sana.init-main.com X-Spamd-Result: default: False [-0.76 / 15.00]; AUTH_NA(1.00)[]; SUBJECT_ENDS_QUESTION(1.00)[]; NEURAL_HAM_SHORT(-1.00)[-1.000]; NEURAL_HAM_MEDIUM(-0.99)[-0.993]; NEURAL_HAM_LONG(-0.97)[-0.967]; FORGED_SENDER(0.30)[takawata@init-main.com,takawata@sana.init-main.com]; MIME_GOOD(-0.10)[text/plain]; R_SPF_NA(0.00)[no SPF record]; ASN(0.00)[asn:2497, ipnet:210.138.0.0/16, country:JP]; DMARC_NA(0.00)[init-main.com]; R_DKIM_NA(0.00)[]; MLMMJ_DEST(0.00)[freebsd-hackers@freebsd.org]; RCVD_TLS_LAST(0.00)[]; RCVD_COUNT_THREE(0.00)[3]; MIME_TRACE(0.00)[0:+]; FROM_HAS_DN(0.00)[]; FREEFALL_USER(0.00)[takawata]; ARC_NA(0.00)[]; MID_RHS_MATCH_FROMTLD(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; TO_DN_NONE(0.00)[]; PREVIOUSLY_DELIVERED(0.00)[freebsd-hackers@freebsd.org]; RCPT_COUNT_ONE(0.00)[1]; FROM_NEQ_ENVFROM(0.00)[takawata@init-main.com,takawata@sana.init-main.com] X-ThisMailContainsUnwantedMimeParts: N On Wed, Oct 19, 2022 at 09:50:20PM +0900, Takanori Watanabe wrote: > 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? intr_activate_irq called by bus_activate_resource sets the object containing irq raw value. I resolved myself.