get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

GET /api/patches/2195790/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 2195790,
    "url": "http://patchwork.ozlabs.org/api/patches/2195790/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/opensbi/patch/20260211222025.2463312-3-raymondmaoca@gmail.com/",
    "project": {
        "id": 67,
        "url": "http://patchwork.ozlabs.org/api/projects/67/?format=api",
        "name": "OpenSBI development",
        "link_name": "opensbi",
        "list_id": "opensbi.lists.infradead.org",
        "list_email": "opensbi@lists.infradead.org",
        "web_url": "https://github.com/riscv/opensbi",
        "scm_url": "",
        "webscm_url": "",
        "list_archive_url": "",
        "list_archive_url_format": "",
        "commit_url_format": "https://github.com/riscv/opensbi/commit/{}"
    },
    "msgid": "<20260211222025.2463312-3-raymondmaoca@gmail.com>",
    "list_archive_url": null,
    "date": "2026-02-11T22:20:24",
    "name": "[2/3] lib: utils: irqchip: implement APLIC hwirq operation hooks",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "c65e4c20aea1a77db23952323a073467253cc8fc",
    "submitter": {
        "id": 91989,
        "url": "http://patchwork.ozlabs.org/api/people/91989/?format=api",
        "name": "Raymond Mao",
        "email": "raymondmaoca@gmail.com"
    },
    "delegate": null,
    "mbox": "http://patchwork.ozlabs.org/project/opensbi/patch/20260211222025.2463312-3-raymondmaoca@gmail.com/mbox/",
    "series": [
        {
            "id": 491914,
            "url": "http://patchwork.ozlabs.org/api/series/491914/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/opensbi/list/?series=491914",
            "date": "2026-02-11T22:20:24",
            "name": "APLIC hwirq implementation for irqchip",
            "version": 1,
            "mbox": "http://patchwork.ozlabs.org/series/491914/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/2195790/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/2195790/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "\n <opensbi-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org>",
        "X-Original-To": "incoming@patchwork.ozlabs.org",
        "Delivered-To": "patchwork-incoming@legolas.ozlabs.org",
        "Authentication-Results": [
            "legolas.ozlabs.org;\n\tdkim=pass (2048-bit key;\n secure) header.d=lists.infradead.org header.i=@lists.infradead.org\n header.a=rsa-sha256 header.s=bombadil.20210309 header.b=1A9P4Ibh;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256\n header.s=20230601 header.b=dWFX2raj;\n\tdkim-atps=neutral",
            "legolas.ozlabs.org;\n spf=none (no SPF record) smtp.mailfrom=lists.infradead.org\n (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org;\n envelope-from=opensbi-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org;\n receiver=patchwork.ozlabs.org)"
        ],
        "Received": [
            "from bombadil.infradead.org (bombadil.infradead.org\n [IPv6:2607:7c80:54:3::133])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519 server-signature ECDSA (secp384r1) server-digest SHA384)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4fBCZ03fpSz1xpY\n\tfor <incoming@patchwork.ozlabs.org>; Thu, 12 Feb 2026 09:20:52 +1100 (AEDT)",
            "from localhost ([::1] helo=bombadil.infradead.org)\n\tby bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux))\n\tid 1vqIZi-000000017y9-1oF3;\n\tWed, 11 Feb 2026 22:20:46 +0000",
            "from mail-qt1-x832.google.com ([2607:f8b0:4864:20::832])\n\tby bombadil.infradead.org with esmtps (Exim 4.98.2 #2 (Red Hat Linux))\n\tid 1vqIZf-000000017wa-2DGC\n\tfor opensbi@lists.infradead.org;\n\tWed, 11 Feb 2026 22:20:44 +0000",
            "by mail-qt1-x832.google.com with SMTP id\n d75a77b69052e-50686cd093dso8032831cf.3\n        for <opensbi@lists.infradead.org>;\n Wed, 11 Feb 2026 14:20:43 -0800 (PST)",
            "from ubuntu.localdomain (174-138-202-16.cpe.distributel.net.\n [174.138.202.16])\n        by smtp.gmail.com with ESMTPSA id\n d75a77b69052e-50684b6b576sm22824291cf.21.2026.02.11.14.20.41\n        (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n        Wed, 11 Feb 2026 14:20:42 -0800 (PST)"
        ],
        "DKIM-Signature": [
            "v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;\n\td=lists.infradead.org; s=bombadil.20210309; h=Sender:\n\tContent-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post:\n\tList-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:\n\tMessage-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description:\n\tResent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:\n\tList-Owner; bh=H0fYFRe6Wq0CkEMVu6frgpVMfbKIuN5Ebm4DgJP1330=; b=1A9P4IbhZimBlS\n\t52WlreMxb6rvblGIgA/UTo0Iswj8R/SeSxcPjM3UkMfO9W7AdHKsJfGiuNh2rwtl03Ovsrq8fcHxZ\n\twrvKBL+eb02KDwK8zcajB2J4Dxei0Aowe0v2RQSczehaEyE8OSxheaksgIYPM2I4InH5ub80OdNTo\n\tt91xJQfzFylbd/nVwxY9gZmRrDafrTV3YdtDWSCr16IqW4xWPpsiTdhC3cgqrQ3Kn1cdjLbZfV3CZ\n\tIi/QXwiGnogjjOn2tuUZHRPXtGAUz/Rw8o9wqenpiJSrJW+f2fEqFvGqd3MaixrNsGT47Empy2KAw\n\t+poHWxHQ74bWnHXkUtBg==;",
            "v=1; a=rsa-sha256; c=relaxed/relaxed;\n        d=gmail.com; s=20230601; t=1770848442; x=1771453242;\n darn=lists.infradead.org;\n        h=content-transfer-encoding:mime-version:references:in-reply-to\n         :message-id:date:subject:cc:to:from:from:to:cc:subject:date\n         :message-id:reply-to;\n        bh=D0oUF/yXoa3yx8OZxDltX0SSitiFNmmS/M11Q7PywcY=;\n        b=dWFX2rajbuauKKkBdFHAaYdjJHCMX9uoS1Z+MTTNEZYw8Uy3baBUBeU6Gwwy4LsvP6\n         rdo86SPJBo2oOR7Cly/GSYnqEBU9t0dzh76pcCv6PLrnHNkLn0Hc00+Dn9Ud5SZEbap+\n         uG+zUuzNNKpcrwV4p9E4p2LBx0jv977S9knkrRDGgmb0oqSRQCz3UEfQiFsuzhWomsLE\n         zQdt/cd8rm7FNb8h606Ud80S/Cq+aPMMqviQtTBO/rYXsGDC8Gy6fX0YVbYvFW5lAZw4\n         IOUDejWPkRDbRONjnRzUOPTi42GlYnU+TQR/WErjEAWzdBkGOLBTBAR//XGU7CZyFOkh\n         a77g=="
        ],
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n        d=1e100.net; s=20230601; t=1770848442; x=1771453242;\n        h=content-transfer-encoding:mime-version:references:in-reply-to\n         :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from\n         :to:cc:subject:date:message-id:reply-to;\n        bh=D0oUF/yXoa3yx8OZxDltX0SSitiFNmmS/M11Q7PywcY=;\n        b=bPd7DbDdfPxPIHkeCB0g7FAATZwBMZ5Owk1hNAUt+9+2LEBl0Zn88pkFug8FFd5/TL\n         5UN3X9HyqrnKkVcoDkSi5R6OXmFSTDaZE4+2tqHxNCJ43/YpRzoC+gxQXwU/jaDN186e\n         wNNHX/WQ4XRNhVpGtI68UegmHWKJBKXHoUGa27J8/yPmpE0xT5FPAtp5tR+S2m3QulJZ\n         pUDMFsMp1cM3CFAUtyPAIGcEyVBZWto9QgrG0pp3rvAB7q26cBJ8giHHmd5tjmxJ3Jue\n         cMtkG+DvzD7DmaYtHqoR3J8ytSo9mRfTOdrQkBUURMc40RhCm5Q4/jCnwBiJnjZ2dm5g\n         M0rw==",
        "X-Gm-Message-State": "AOJu0YwkuRYxvyhTpfHOwRfU/t2GbYOD1w2kNmB4i8EOvX3HFGUxWEH7\n\t3pBMjyI42Jf3fzizm7CBvdRdolZrqFq/8p876LGlRfTrQA4VMBr5VWupa2dNew==",
        "X-Gm-Gg": "AZuq6aLKbOVVsdUvIIgNgkuDQKqeqjqEG7Ja/0k3t6iKEBP8QhVvHsLqfl6BKkgDnmd\n\thNYHzZ6qcN4rZW899ym4Zu7SLPQS1X8eA5hVG/8qEVSI4gf/J9Rjfv76ov8apGOdCfOMjbQ9WDC\n\tNyx+mHSWoAky+qJqtP+e8LXpBABICBeN7wEI4E+fYQs1gybxs4R9oxC5N7SH0JDZFWFb9aSv4OD\n\tsaO04BtdMQOeYHp6yWnSmIhZcTr0bYYIRUjLiBRuQ1nN2t0qVJUUUgt93SwZ0NFScnViZaleCfT\n\tskJV2VyFc0wDKjAzhG8DhQFM4TEWXy3J1PCljwtD134ZzkUqyLU6v0ZTavFmIb+7zbcAovEOn6M\n\tQYPc3Mg0W+U5+yY5Qv8/LFQIre29NoUGO195yIfHv8EF1h/45DvSd/HTXzWlc9Mbo26feeGTrWn\n\tps8yQRY9ULIMm4yZSc+3GAsylCP06u1qay0Qq0B6SxTbLjCPVTOc2U81QqTLUXFPmvwS40ur577\n\tKljzFTooac=",
        "X-Received": "by 2002:a05:622a:1391:b0:503:2d1f:68a2 with SMTP id\n d75a77b69052e-50691c5c449mr16665641cf.70.1770848442400;\n        Wed, 11 Feb 2026 14:20:42 -0800 (PST)",
        "From": "Raymond Mao <raymondmaoca@gmail.com>",
        "To": "opensbi@lists.infradead.org",
        "Cc": "scott@riscstar.com,\n\tdave.patel@riscstar.com,\n\traymond.mao@riscstar.com,\n\trobin.randhawa@sifive.com,\n\tsamuel.holland@sifive.com,\n\tanup.patel@qti.qualcomm.com,\n\tanuppate@qti.qualcomm.com,\n\tdhaval@rivosinc.com,\n\tpeter.lin@sifive.com",
        "Subject": "[PATCH 2/3] lib: utils: irqchip: implement APLIC hwirq operation\n hooks",
        "Date": "Wed, 11 Feb 2026 17:20:24 -0500",
        "Message-Id": "<20260211222025.2463312-3-raymondmaoca@gmail.com>",
        "X-Mailer": "git-send-email 2.25.1",
        "In-Reply-To": "<20260211222025.2463312-1-raymondmaoca@gmail.com>",
        "References": "<20260211222025.2463312-1-raymondmaoca@gmail.com>",
        "MIME-Version": "1.0",
        "X-CRM114-Version": "20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 ",
        "X-CRM114-CacheID": "sfid-20260211_142043_594750_DD0FE72A ",
        "X-CRM114-Status": "GOOD (  18.38  )",
        "X-Spam-Score": "-2.1 (--)",
        "X-Spam-Report": "Spam detection software,\n running on the system \"bombadil.infradead.org\",\n has NOT identified this incoming email as spam.  The original\n message has been attached to this so you can view it or label\n similar future email.  If you have any questions, see\n the administrator of that system for details.\n Content preview:  From: Raymond Mao Add all APLIC reqiured operation hooks,\n   includeing mask / unmask / eoi / setup / process and register them during\n   cold init. During setup, program a minimal APLIC direct-mode configuration\n    and enable [...]\n Content analysis details:   (-2.1 points, 5.0 required)\n  pts rule name              description\n ---- ----------------------\n --------------------------------------------------\n -0.0 RCVD_IN_DNSWL_NONE     RBL: Sender listed at https://www.dnswl.org/, no\n                             trust\n                             [2607:f8b0:4864:20:0:0:0:832 listed in]\n                             [list.dnswl.org]\n  0.0 SPF_HELO_NONE          SPF: HELO does not publish an SPF Record\n -0.0 SPF_PASS               SPF: sender matches SPF record\n -0.1 DKIM_VALID_AU          Message has a valid DKIM or DK signature from\n author's\n                             domain\n -0.1 DKIM_VALID             Message has at least one valid DKIM or DK\n signature\n  0.1 DKIM_SIGNED            Message has a DKIM or DK signature,\n not necessarily valid\n -0.1 DKIM_VALID_EF          Message has a valid DKIM or DK signature from\n                             envelope-from domain\n -1.9 BAYES_00               BODY: Bayes spam probability is 0 to 1%\n                             [score: 0.0000]\n  0.0 FREEMAIL_FROM          Sender email is commonly abused enduser mail\n provider\n                             [raymondmaoca(at)gmail.com]",
        "X-BeenThere": "opensbi@lists.infradead.org",
        "X-Mailman-Version": "2.1.34",
        "Precedence": "list",
        "List-Id": "<opensbi.lists.infradead.org>",
        "List-Unsubscribe": "<http://lists.infradead.org/mailman/options/opensbi>,\n <mailto:opensbi-request@lists.infradead.org?subject=unsubscribe>",
        "List-Archive": "<http://lists.infradead.org/pipermail/opensbi/>",
        "List-Post": "<mailto:opensbi@lists.infradead.org>",
        "List-Help": "<mailto:opensbi-request@lists.infradead.org?subject=help>",
        "List-Subscribe": "<http://lists.infradead.org/mailman/listinfo/opensbi>,\n <mailto:opensbi-request@lists.infradead.org?subject=subscribe>",
        "Content-Type": "text/plain; charset=\"us-ascii\"",
        "Content-Transfer-Encoding": "7bit",
        "Sender": "\"opensbi\" <opensbi-bounces@lists.infradead.org>",
        "Errors-To": "opensbi-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org"
    },
    "content": "From: Raymond Mao <raymond.mao@riscstar.com>\n\nAdd all APLIC reqiured operation hooks, includeing mask / unmask /\neoi / setup / process and register them during cold init.\nDuring setup, program a minimal APLIC direct-mode configuration and\nenable MEIE, confirm external interrupts are claimed via IDC.CLAIMI.\nAdd function to fetch the TOPI value and extract the source ID (hwirq)\nfrom CLAIMI, which is used by APLIC process hook.\n\nSigned-off-by: Raymond Mao <raymond.mao@riscstar.com>\n---\n lib/utils/irqchip/aplic.c | 191 ++++++++++++++++++++++++++++++++++++++\n 1 file changed, 191 insertions(+)",
    "diff": "diff --git a/lib/utils/irqchip/aplic.c b/lib/utils/irqchip/aplic.c\nindex ec69c82b..f0ecef42 100644\n--- a/lib/utils/irqchip/aplic.c\n+++ b/lib/utils/irqchip/aplic.c\n@@ -245,6 +245,178 @@ static int aplic_check_msicfg(struct aplic_msicfg_data *msicfg)\n \treturn 0;\n }\n \n+static int aplic_hwirq_handler(u32 hwirq, void *opaque)\n+{\n+\t(void)opaque;\n+\n+\tsbi_printf(\"[APLIC] Enter registered hwirq %u raw handler callback\\n\",\n+\t\t   hwirq);\n+\n+\treturn SBI_OK;\n+}\n+\n+static inline void *aplic_idc_base(unsigned long aplic_addr, u32 idc_index)\n+{\n+\treturn (void *)(aplic_addr + APLIC_IDC_BASE +\n+\t\t\t(unsigned long)idc_index * APLIC_IDC_SIZE);\n+}\n+\n+static void aplic_hwirq_mask(struct sbi_irqchip_device *chip, u32 hwirq)\n+{\n+\tstruct aplic_data *w = chip->chip_priv;\n+\n+\tif (!w || !hwirq)\n+\t\treturn;\n+\n+\tif (!w->addr || hwirq > w->num_source)\n+\t\treturn;\n+\n+\t/* Disable source */\n+\twritel(hwirq, (void *)(w->addr + APLIC_CLRIENUM));\n+}\n+\n+static void aplic_hwirq_unmask(struct sbi_irqchip_device *chip, u32 hwirq)\n+{\n+\tstruct aplic_data *w = chip->chip_priv;\n+\n+\tif (!w || !hwirq)\n+\t\treturn;\n+\n+\tif (!w->addr || hwirq > w->num_source)\n+\t\treturn;\n+\n+\t/* Enable source */\n+\twritel(hwirq, (void *)(w->addr + APLIC_SETIENUM));\n+}\n+\n+static int aplic_hwirq_claim(struct sbi_irqchip_device *chip, u32 *hwirq)\n+{\n+\tstruct aplic_data *w = chip->chip_priv;\n+\tu32 hartid = current_hartid();\n+\tint hidx = sbi_hartid_to_hartindex(hartid);\n+\tvoid *idc;\n+\tu32 v, id;\n+\n+\tif (!w || !hwirq)\n+\t\treturn SBI_EINVAL;\n+\n+\tif (!w->addr || hidx < 0 || (u32)hidx >= w->num_idc)\n+\t\treturn SBI_ENODEV;\n+\n+\tidc = aplic_idc_base(w->addr, (u32)hidx);\n+\n+\t/*\n+\t * Read CLAIMI: returns TOPI value.\n+\t * ID==0 means spurious interrupt (spec-defined).\n+\t */\n+\tv = readl(idc + APLIC_IDC_CLAIMI); /* dequeue */\n+\t/*\n+\t * QEMU workaround: Read CLAIMI a second time since QEMU's APLIC model\n+\t * currently has a bug and may not clear pending on deassert after the\n+\t * first reading.\n+\t */\n+\tif (readl(idc + APLIC_IDC_CLAIMI) != v)\n+\t\treturn SBI_ENOENT;\n+\n+\tid = (v >> APLIC_IDC_TOPI_ID_SHIFT) & APLIC_IDC_TOPI_ID_MASK;\n+\n+\t/* ID==0 means spurious / no pending wired interrupt */\n+\tif (!id)\n+\t\treturn SBI_ENOENT;\n+\n+\t/* Bound check against DT-discovered num_src */\n+\tif (id > w->num_source)\n+\t\treturn SBI_EINVAL;\n+\n+\t*hwirq = id;\n+\n+\treturn SBI_OK;\n+}\n+\n+static void aplic_hwirq_eoi(struct sbi_irqchip_device *chip, u32 hwirq)\n+{\n+\tstruct aplic_data *w = chip->chip_priv;\n+\tu32 hartid = current_hartid();\n+\tint hidx = sbi_hartid_to_hartindex(hartid);\n+\tvoid *idc;\n+\n+\tsbi_printf(\"[APLIC] Enter regitered EOI of hwirq %u\\n\", hwirq);\n+\n+\tif (!w || !w->addr)\n+\t\treturn;\n+\tif (hidx < 0 || (u32)hidx >= w->num_idc)\n+\t\treturn;\n+\n+\tidc = aplic_idc_base(w->addr, (u32)hidx);\n+\n+\t/* QEMU workaround: clear pending after source deassert for level IRQ */\n+\twritel(hwirq, idc + APLIC_CLRIPNUM);\n+}\n+\n+static int aplic_hwirq_setup(struct sbi_irqchip_device *chip, u32 hwirq)\n+{\n+\tconst u32 hart_idx = 0;\n+\tunsigned long idc;\n+\tstruct aplic_data *w = chip->chip_priv;\n+\n+\tidc = w->addr + APLIC_IDC_BASE + hart_idx * APLIC_IDC_SIZE;\n+\n+\t/* APLIC: sourcecfg/target/enable */\n+\twritel(APLIC_SOURCECFG_SM_LEVEL_HIGH,\n+\t       (void *)(w->addr + APLIC_SOURCECFG_BASE + (hwirq - 1) * 4));\n+\n+\twritel((hart_idx << APLIC_TARGET_HART_IDX_SHIFT) | APLIC_DEFAULT_PRIORITY,\n+\t       (void *)(w->addr + APLIC_TARGET_BASE + (hwirq - 1) * 4));\n+\n+\twritel(hwirq, (void *)(w->addr + APLIC_SETIENUM));\n+\n+\t/* Direct mode for aia=aplic: DM=0 => don't set DM bit */\n+\twritel(APLIC_DOMAINCFG_IE | APLIC_DOMAINCFG_BE,\n+\t       (void *)(w->addr + APLIC_DOMAINCFG));\n+\n+\t/* IDC delivery */\n+\twritel(APLIC_ENABLE_IDELIVERY, (void *)(idc + APLIC_IDC_IDELIVERY));\n+\twritel(APLIC_ENABLE_ITHRESHOLD, (void *)(idc + APLIC_IDC_ITHRESHOLD));\n+\n+\t/* Enable MEIE + global MIE */\n+\tcsr_set(CSR_MIE, (1UL << 11));  /* MEIE */\n+\tcsr_set(CSR_MSTATUS, MSTATUS_MIE);\n+\n+\treturn SBI_OK;\n+}\n+\n+static int aplic_process_hwirqs(struct sbi_irqchip_device *chip)\n+{\n+\tif (!chip)\n+\t\treturn SBI_ENODEV;\n+\n+\tfor (;;) {\n+\t\tu32 hwirq = 0;\n+\t\tint rc = aplic_hwirq_claim(chip, &hwirq);\n+\n+\t\tif (rc == SBI_ENOENT)\n+\t\t\tbreak;\n+\t\tif (rc)\n+\t\t\treturn rc;\n+\n+\t\tif (!hwirq)\n+\t\t\tbreak;\n+\n+\t\tsbi_printf(\"[APLIC] IDC_TOPI_ID from CLAIMI (hwirq) %u\\n\",\n+\t\t\t   hwirq);\n+\n+\t\tif (hwirq > chip->num_hwirq) {\n+\t\t\tsbi_printf(\"[APLIC] hwirq %u > max (num_hwirq) %u)\\n\",\n+\t\t\t\t   hwirq, chip->num_hwirq);\n+\t\t\tbreak;\n+\t\t}\n+\n+\t\tsbi_irqchip_process_hwirq(chip, hwirq);\n+\t}\n+\n+\treturn SBI_OK;\n+}\n+\n int aplic_cold_irqchip_init(struct aplic_data *aplic)\n {\n \tint rc;\n@@ -308,12 +480,31 @@ int aplic_cold_irqchip_init(struct aplic_data *aplic)\n \t/* Register irqchip device */\n \taplic->irqchip.id = aplic->unique_id;\n \taplic->irqchip.num_hwirq = aplic->num_source + 1;\n+\taplic->irqchip.chip_priv = aplic;\n+\taplic->irqchip.hwirq_mask = aplic_hwirq_mask;\n+\taplic->irqchip.hwirq_unmask = aplic_hwirq_unmask;\n+\taplic->irqchip.hwirq_eoi = aplic_hwirq_eoi;\n+\t/*\n+\t * Only the domain that directly injects interrupts into M-mode external\n+\t * interrupt line should provide process_hwirqs().\n+\t *\n+\t * The other domain (e.g. S-mode) may still be registered so that its\n+\t * other ops (mask/unmask/config/etc.) can be used, but it must not\n+\t * claim to be the external interrupt line provider.\n+\t */\n+\tif (aplic->targets_mmode)\n+\t\taplic->irqchip.process_hwirqs = aplic_process_hwirqs;\n+\taplic->irqchip.hwirq_setup = aplic_hwirq_setup;\n \trc = sbi_irqchip_add_device(&aplic->irqchip);\n \tif (rc)\n \t\treturn rc;\n \n \t/* Attach to the aplic list */\n \tsbi_list_add_tail(&aplic->node, &aplic_list);\n+\trc = sbi_irqchip_register_handler(&aplic->irqchip, 1, aplic->num_source,\n+\t\t\t\t\t  aplic_hwirq_handler, NULL);\n+\tif (rc)\n+\t\treturn rc;\n \n \treturn 0;\n }\n",
    "prefixes": [
        "2/3"
    ]
}