From nobody Tue Dec 9 20:12:32 2025 X-Original-To: dev-commits-src-main@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 4dQqlN5SLkz6JkmY for ; Tue, 09 Dec 2025 20:12:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dQqlN3nXlz3wQV for ; Tue, 09 Dec 2025 20:12:32 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765311152; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=SHHnHqpDbkALY7jhvrwG5z1uPE3FIU2yWdi3N1UIUL4=; b=CcbPljJ7qEayVTJsi1e1MJpR6uZ/fEN5K/HeiKiseyce62yKIEmJqvymRk5JEl/SHroupU 4znvEyOQlwzhwoprjfLelAb3SrJsmBWacDOB36iVlyf+C4Me44QkS1MLR9Lpq0xWjk0imN Zs+tMZJzSLQosgKRkPlPougEovknit6uhZAUkffv5zBonP2RZCx308rbUzA2WEglzxgsQm hXLWJTHlbEAYTtQIrhxExpuejAENDaO5MkSfCzyAbVfaGfjLL3MJW8DvmwQxUTV75CKWri 1EggQ/T2pH+TEHDc4iZksBqYOTFg46QnHvgknC99buIIHVTwEmXmDywZXXiAWQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765311152; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=SHHnHqpDbkALY7jhvrwG5z1uPE3FIU2yWdi3N1UIUL4=; b=DEI4VD5mUP4AZeYP3q3sPykw0oNcm2ZN2DgPrGNm3SGBZNeFilwqyR51CNqNHuCGs32SnW poGXt5wtdvD/MlVQkvA7BlFewBvMtYrJOd1CNb14naNci6QDGHZYkSzBoKcCuC8w1Zrn0e PUMgvkuo02IpyN7JXX/Mt8GHQ7O1c2pyNeyn0nar5mPdvuu+Fz3y6nqOPwIcGmXNtYact/ dyGylG8vhzLTlGiWcXFDJgVzJJpELRgUsYRQwin5dPrBONTTEhjXMv1NRLcx0xEwVgArxE UAuciHRTfiOskJH/jfK5GaLwbMmzQSkpl25buZvN/QlThWl0zy2s/hvcK0EsIg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1765311152; a=rsa-sha256; cv=none; b=nCvIy+JzchaH/mqKnjaqojN2ehAI3dwpxVgxBGjkkuhJYJyNodAZoAYvNRLXz/DO6AiQNL SQpHQfZGsawFTClczAfHIWpw3tbvbLxL7yCT7Ed846XUsfdjg5sfiGdo3mrCW9tHqETvIj 589PycBQhIiXWN/joizkU1+xYPs3Q0n5gJIjUm9NSX4k1xlv7iZMDNFVSmQahVf/SQe6Cy sd+Vw/8pFw+jIvbJnM5cyyL7QPdkI9JcokwS30DuEKVHko3a8FVOPA992HSulZjZrnN9Ry fNGGnaoksbtvXIbI20t8/ofmhGAPIEUAq+29SR2ABX2MPusS878hbHYkebu9lQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4dQqlN3KxYz1CxM for ; Tue, 09 Dec 2025 20:12:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 2e750 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Tue, 09 Dec 2025 20:12:32 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: e279724ae5a7 - main - resource_list_reserve: Pass rid by value List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e279724ae5a720c84cd86f1ce6fdac31fb94e735 Auto-Submitted: auto-generated Date: Tue, 09 Dec 2025 20:12:32 +0000 Message-Id: <693882b0.2e750.56f0c6cd@gitrepo.freebsd.org> The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=e279724ae5a720c84cd86f1ce6fdac31fb94e735 commit e279724ae5a720c84cd86f1ce6fdac31fb94e735 Author: John Baldwin AuthorDate: 2025-12-09 20:00:20 +0000 Commit: John Baldwin CommitDate: 2025-12-09 20:00:20 +0000 resource_list_reserve: Pass rid by value Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D53403 --- sys/dev/acpica/acpi.c | 2 +- sys/dev/dpaa2/dpaa2_rc.c | 2 +- sys/dev/pci/pci.c | 23 +++++++++++------------ sys/kern/subr_bus.c | 6 +++--- sys/sys/bus.h | 2 +- 5 files changed, 17 insertions(+), 18 deletions(-) diff --git a/sys/dev/acpica/acpi.c b/sys/dev/acpica/acpi.c index a40ee709e762..408570f53a21 100644 --- a/sys/dev/acpica/acpi.c +++ b/sys/dev/acpica/acpi.c @@ -1525,7 +1525,7 @@ acpi_reserve_resources(device_t dev) * acpi_alloc_resource() will sub-alloc from the system * resource. */ - resource_list_reserve(rl, dev, children[i], rle->type, &rle->rid, + resource_list_reserve(rl, dev, children[i], rle->type, rle->rid, rle->start, rle->end, rle->count, 0); } } diff --git a/sys/dev/dpaa2/dpaa2_rc.c b/sys/dev/dpaa2/dpaa2_rc.c index c360b6fcc929..36cacd1daa4b 100644 --- a/sys/dev/dpaa2/dpaa2_rc.c +++ b/sys/dev/dpaa2/dpaa2_rc.c @@ -3321,7 +3321,7 @@ dpaa2_rc_add_res(device_t rcdev, device_t child, enum dpaa2_dev_type devtype, /* Reserve a newly added DPAA2 resource. */ res = resource_list_reserve(&dinfo->resources, rcdev, child, devtype, - rid, (rman_res_t) dpaa2_dev, (rman_res_t) dpaa2_dev, 1, + *rid, (rman_res_t) dpaa2_dev, (rman_res_t) dpaa2_dev, 1, flags & ~RF_ACTIVE); if (!res) { device_printf(rcdev, "%s: failed to reserve %s (rid=%d) for: %s " diff --git a/sys/dev/pci/pci.c b/sys/dev/pci/pci.c index 6d929b2f236c..d42388a15a04 100644 --- a/sys/dev/pci/pci.c +++ b/sys/dev/pci/pci.c @@ -3481,7 +3481,7 @@ pci_add_map(device_t bus, device_t dev, int reg, struct resource_list *rl, * driver for this device will later inherit this resource in * pci_alloc_resource(). */ - res = resource_list_reserve(rl, bus, dev, type, ®, start, end, count, + res = resource_list_reserve(rl, bus, dev, type, reg, start, end, count, flags); if ((pci_do_realloc_bars || pci_has_quirk(pci_get_devid(dev), PCI_QUIRK_REALLOC_BAR)) @@ -3494,7 +3494,7 @@ pci_add_map(device_t bus, device_t dev, int reg, struct resource_list *rl, */ resource_list_delete(rl, type, reg); resource_list_add(rl, type, reg, 0, ~0, count); - res = resource_list_reserve(rl, bus, dev, type, ®, 0, ~0, + res = resource_list_reserve(rl, bus, dev, type, reg, 0, ~0, count, flags); } if (res == NULL) { @@ -3553,11 +3553,11 @@ pci_ata_maps(device_t bus, device_t dev, struct resource_list *rl, int force, } else { rid = PCIR_BAR(0); resource_list_add(rl, type, rid, 0x1f0, 0x1f7, 8); - (void)resource_list_reserve(rl, bus, dev, type, &rid, 0x1f0, + (void)resource_list_reserve(rl, bus, dev, type, rid, 0x1f0, 0x1f7, 8, 0); rid = PCIR_BAR(1); resource_list_add(rl, type, rid, 0x3f6, 0x3f6, 1); - (void)resource_list_reserve(rl, bus, dev, type, &rid, 0x3f6, + (void)resource_list_reserve(rl, bus, dev, type, rid, 0x3f6, 0x3f6, 1, 0); } if (progif & PCIP_STORAGE_IDE_MODESEC) { @@ -3568,11 +3568,11 @@ pci_ata_maps(device_t bus, device_t dev, struct resource_list *rl, int force, } else { rid = PCIR_BAR(2); resource_list_add(rl, type, rid, 0x170, 0x177, 8); - (void)resource_list_reserve(rl, bus, dev, type, &rid, 0x170, + (void)resource_list_reserve(rl, bus, dev, type, rid, 0x170, 0x177, 8, 0); rid = PCIR_BAR(3); resource_list_add(rl, type, rid, 0x376, 0x376, 1); - (void)resource_list_reserve(rl, bus, dev, type, &rid, 0x376, + (void)resource_list_reserve(rl, bus, dev, type, rid, 0x376, 0x376, 1, 0); } pci_add_map(bus, dev, PCIR_BAR(4), rl, force, @@ -3815,7 +3815,7 @@ pci_reserve_secbus(device_t bus, device_t dev, pcicfgregs *cfg, struct resource *res; char *cp; rman_res_t start, end, count; - int rid, sec_bus, sec_reg, sub_bus, sub_reg, sup_bus; + int sec_bus, sec_reg, sub_bus, sub_reg, sup_bus; switch (cfg->hdrtype & PCIM_HDRTYPE) { case PCIM_HDRTYPE_BRIDGE: @@ -3895,8 +3895,7 @@ pci_reserve_secbus(device_t bus, device_t dev, pcicfgregs *cfg, if (pci_clear_buses) goto clear; - rid = 0; - res = resource_list_reserve(rl, bus, dev, PCI_RES_BUS, &rid, + res = resource_list_reserve(rl, bus, dev, PCI_RES_BUS, 0, start, end, count, 0); if (res != NULL) return; @@ -3945,7 +3944,7 @@ pci_alloc_secbus(device_t dev, device_t child, int rid, rman_res_t start, if (resource_list_find(rl, PCI_RES_BUS, rid) == NULL) resource_list_add(rl, PCI_RES_BUS, rid, start, end, count); if (!resource_list_reserved(rl, PCI_RES_BUS, rid)) { - res = resource_list_reserve(rl, dev, child, PCI_RES_BUS, &rid, + res = resource_list_reserve(rl, dev, child, PCI_RES_BUS, rid, start, end, count, flags & ~RF_ACTIVE); if (res == NULL) { resource_list_delete(rl, PCI_RES_BUS, rid); @@ -4106,7 +4105,7 @@ pci_add_resources_ea(device_t bus, device_t dev, int alloc_iov) continue; resource_list_add(rl, type, rid, start, end, count); - res = resource_list_reserve(rl, bus, dev, type, &rid, start, end, count, + res = resource_list_reserve(rl, bus, dev, type, rid, start, end, count, flags); if (res == NULL) { resource_list_delete(rl, type, rid); @@ -5591,7 +5590,7 @@ pci_reserve_map(device_t dev, device_t child, int type, int *rid, * appropriate BAR for that resource. */ resource_list_add(rl, type, *rid, start, end, count); - res = resource_list_reserve(rl, dev, child, type, rid, start, end, + res = resource_list_reserve(rl, dev, child, type, *rid, start, end, count, flags & ~RF_ACTIVE); if (res == NULL) { resource_list_delete(rl, type, *rid); diff --git a/sys/kern/subr_bus.c b/sys/kern/subr_bus.c index 86538ac8b9d8..d2363d6c625e 100644 --- a/sys/kern/subr_bus.c +++ b/sys/kern/subr_bus.c @@ -3096,7 +3096,7 @@ resource_list_delete(struct resource_list *rl, int type, int rid) */ struct resource * resource_list_reserve(struct resource_list *rl, device_t bus, device_t child, - int type, int *rid, rman_res_t start, rman_res_t end, rman_res_t count, u_int flags) + int type, int rid, rman_res_t start, rman_res_t end, rman_res_t count, u_int flags) { struct resource_list_entry *rle = NULL; int passthrough = (device_get_parent(child) != bus); @@ -3109,10 +3109,10 @@ resource_list_reserve(struct resource_list *rl, device_t bus, device_t child, panic( "resource_list_reserve() should only reserve inactive resources"); - r = resource_list_alloc(rl, bus, child, type, *rid, start, end, count, + r = resource_list_alloc(rl, bus, child, type, rid, start, end, count, flags); if (r != NULL) { - rle = resource_list_find(rl, type, *rid); + rle = resource_list_find(rl, type, rid); rle->flags |= RLE_RESERVED; } return (r); diff --git a/sys/sys/bus.h b/sys/sys/bus.h index 96e3da3498ea..10f596654150 100644 --- a/sys/sys/bus.h +++ b/sys/sys/bus.h @@ -393,7 +393,7 @@ int resource_list_release_active(struct resource_list *rl, struct resource * resource_list_reserve(struct resource_list *rl, device_t bus, device_t child, - int type, int *rid, + int type, int rid, rman_res_t start, rman_res_t end, rman_res_t count, u_int flags); int resource_list_unreserve(struct resource_list *rl,