From nobody Tue Dec 9 20:12:34 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 4dQqlR1N1Jz6JkkQ for ; Tue, 09 Dec 2025 20:12:35 +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 4dQqlQ5GhNz3wHv for ; Tue, 09 Dec 2025 20:12:34 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765311154; 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=Yo6lM9fQlujTyrrjmQosWcBqHmkZE/E2BSCqsSAQubQ=; b=tGltmxPYZmR4XmDWyFkeAJhvGZtZBTrc/WkC6foySsfTl25VCx7u+bYNnPrcgRHbugH7XX Woe4wfr7otZPorLLD272xQJ36Je15ztiGDWZOHy/M7Rv2Ss3KFw0Q9D3yn2/vRl128panU x4McnFShy8ss2RAnrMD+YJXo5XhsiBMEiDzEwYikHjUIlPvddsXhFfKy3JRV0ceHJfPZwZ GadoEHcm6gwWaGdAqB2mrUjdj0Jwamiky2DXYiwLE1GSR8lE2EZfIID9p4VZEOsgcflhoV i+RAsouCQVb/N4+YCkhPKGJ1rtCuNtHhsKb9xBwORgabWBoSstXvwNYQRSLFgg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765311154; 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=Yo6lM9fQlujTyrrjmQosWcBqHmkZE/E2BSCqsSAQubQ=; b=X7ySTT3yWBBLdLK+qFsU5IUYrTtIdgKWv7llkPvH+PAYiiP5lYTZlTwGLS/mm9NlXS+edb 6MDGwcDfUbRTNU0JNRHcFvdh6Bk6RFW3vTLt3Pk5hq7Vl1BLpHxpP1njbVCBMuNfWOcCUV vp0lOZ+oDI38dwCp3/azcfbThGEKUT6WALTSHlZLAhZlYGjXmIh5ZDaE8vAv5E/hwQZlRY Z1BLmVhuQ/KZtEjIoy3Y7gjj2btiZSxOTHG+LmW+o7qlYvV6V3+2olTWzewYqfUp784gus qSY+hWrjrXGndeIM78RZ7hSt9NcjePEa43wWDk6+38ednVeH9kdFsRN3kKfP9Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1765311154; a=rsa-sha256; cv=none; b=fLI3nChL58fnpe625/WWVsEtSF6Ty0+pBxOm5dWwu2ZfYxhK8MXOO9y07g3aNwEkOJMdgy xLx6xMLFldTngMzj6k0edNUu38J59TB93pPMYJvuCiApJLB4WCR4SkV6sVO56TgLJUIIeB +/v032qBqPCiumHF6M3TYagJ3FgOzkRDm4/J+b743H8dLqkwFDbnvp4y0rUzJTbdB4PG/S MGnz0BFWJ0b9XnDQZu2s/VqtllAPK5EB6OWm15PthfgfznCgcHhxvU6MG0DZO7yx1bLGsI e+l2aN3Vef2LgL+jUsFBsK200Wywd642g2d+A7MtziIJ6CNcpDUQZLPUCvH9Tg== 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 4dQqlQ4hQcz1CxQ for ; Tue, 09 Dec 2025 20:12:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 2f5d0 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Tue, 09 Dec 2025 20:12:34 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: 2a23faee4f12 - main - acpi_bus_alloc_gas: 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: 2a23faee4f12cebf57fd1716bf846a53cc737c3b Auto-Submitted: auto-generated Date: Tue, 09 Dec 2025 20:12:34 +0000 Message-Id: <693882b2.2f5d0.173cf137@gitrepo.freebsd.org> The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=2a23faee4f12cebf57fd1716bf846a53cc737c3b commit 2a23faee4f12cebf57fd1716bf846a53cc737c3b Author: John Baldwin AuthorDate: 2025-12-09 20:02:43 +0000 Commit: John Baldwin CommitDate: 2025-12-09 20:02:43 +0000 acpi_bus_alloc_gas: Pass rid by value Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D53405 --- sys/dev/acpica/acpi.c | 8 ++++---- sys/dev/acpica/acpi_apei.c | 4 ++-- sys/dev/acpica/acpi_cpu.c | 4 ++-- sys/dev/acpica/acpi_package.c | 2 +- sys/dev/acpica/acpi_throttle.c | 4 ++-- sys/dev/acpica/acpivar.h | 2 +- sys/dev/wdatwd/wdatwd.c | 2 +- 7 files changed, 13 insertions(+), 13 deletions(-) diff --git a/sys/dev/acpica/acpi.c b/sys/dev/acpica/acpi.c index 408570f53a21..d2ccdfbf6535 100644 --- a/sys/dev/acpica/acpi.c +++ b/sys/dev/acpica/acpi.c @@ -1770,13 +1770,13 @@ acpi_unmap_resource(device_t bus, device_t child, struct resource *r, /* Allocate an IO port or memory resource, given its GAS. */ int -acpi_bus_alloc_gas(device_t dev, int *type, int *rid, ACPI_GENERIC_ADDRESS *gas, +acpi_bus_alloc_gas(device_t dev, int *type, int rid, ACPI_GENERIC_ADDRESS *gas, struct resource **res, u_int flags) { int error, res_type; error = ENOMEM; - if (type == NULL || rid == NULL || gas == NULL || res == NULL) + if (type == NULL || gas == NULL || res == NULL) return (EINVAL); /* We only support memory and IO spaces. */ @@ -1802,14 +1802,14 @@ acpi_bus_alloc_gas(device_t dev, int *type, int *rid, ACPI_GENERIC_ADDRESS *gas, if (gas->Address == 0 || gas->BitWidth == 0) return (EINVAL); - bus_set_resource(dev, res_type, *rid, gas->Address, + bus_set_resource(dev, res_type, rid, gas->Address, gas->BitWidth / 8); *res = bus_alloc_resource_any(dev, res_type, rid, RF_ACTIVE | flags); if (*res != NULL) { *type = res_type; error = 0; } else - bus_delete_resource(dev, res_type, *rid); + bus_delete_resource(dev, res_type, rid); return (error); } diff --git a/sys/dev/acpica/acpi_apei.c b/sys/dev/acpica/acpi_apei.c index 624c81ad1b4f..0d23b504cb60 100644 --- a/sys/dev/acpica/acpi_apei.c +++ b/sys/dev/acpica/acpi_apei.c @@ -700,7 +700,7 @@ apei_attach(device_t dev) rid = 0; TAILQ_FOREACH(ge, &sc->ges, link) { ge->res_rid = rid++; - acpi_bus_alloc_gas(dev, &ge->res_type, &ge->res_rid, + acpi_bus_alloc_gas(dev, &ge->res_type, ge->res_rid, &ge->v1.ErrorStatusAddress, &ge->res, 0); if (ge->res) { ge->buf = pmap_mapdev_attr(READ8(ge->res, 0), @@ -710,7 +710,7 @@ apei_attach(device_t dev) } if (ge->v1.Header.Type == ACPI_HEST_TYPE_GENERIC_ERROR_V2) { ge->res2_rid = rid++; - acpi_bus_alloc_gas(dev, &ge->res2_type, &ge->res2_rid, + acpi_bus_alloc_gas(dev, &ge->res2_type, ge->res2_rid, &ge->v2.ReadAckRegister, &ge->res2, RF_SHAREABLE); if (ge->res2 == NULL) device_printf(dev, "Can't allocate ack resource.\n"); diff --git a/sys/dev/acpica/acpi_cpu.c b/sys/dev/acpica/acpi_cpu.c index 2cd6c8bd4758..37246890fd79 100644 --- a/sys/dev/acpica/acpi_cpu.c +++ b/sys/dev/acpica/acpi_cpu.c @@ -732,7 +732,7 @@ acpi_cpu_generic_cx_probe(struct acpi_cpu_softc *sc) if (AcpiGbl_FADT.C2Latency <= 100) { gas.Address = sc->cpu_p_blk + 4; cx_ptr->res_rid = 0; - acpi_bus_alloc_gas(sc->cpu_dev, &cx_ptr->res_type, &cx_ptr->res_rid, + acpi_bus_alloc_gas(sc->cpu_dev, &cx_ptr->res_type, cx_ptr->res_rid, &gas, &cx_ptr->p_lvlx, RF_SHAREABLE); if (cx_ptr->p_lvlx != NULL) { cx_ptr->type = ACPI_STATE_C2; @@ -749,7 +749,7 @@ acpi_cpu_generic_cx_probe(struct acpi_cpu_softc *sc) if (AcpiGbl_FADT.C3Latency <= 1000 && !(cpu_quirks & CPU_QUIRK_NO_C3)) { gas.Address = sc->cpu_p_blk + 5; cx_ptr->res_rid = 1; - acpi_bus_alloc_gas(sc->cpu_dev, &cx_ptr->res_type, &cx_ptr->res_rid, + acpi_bus_alloc_gas(sc->cpu_dev, &cx_ptr->res_type, cx_ptr->res_rid, &gas, &cx_ptr->p_lvlx, RF_SHAREABLE); if (cx_ptr->p_lvlx != NULL) { cx_ptr->type = ACPI_STATE_C3; diff --git a/sys/dev/acpica/acpi_package.c b/sys/dev/acpica/acpi_package.c index 4e64fdbbab2b..e0a3b40e507e 100644 --- a/sys/dev/acpica/acpi_package.c +++ b/sys/dev/acpica/acpi_package.c @@ -126,7 +126,7 @@ acpi_PkgGas(device_t dev, ACPI_OBJECT *res, int idx, int *type, int *rid, memcpy(&gas, obj->Buffer.Pointer + 3, sizeof(gas)); - return (acpi_bus_alloc_gas(dev, type, rid, &gas, dst, flags)); + return (acpi_bus_alloc_gas(dev, type, *rid, &gas, dst, flags)); } int diff --git a/sys/dev/acpica/acpi_throttle.c b/sys/dev/acpica/acpi_throttle.c index 8b2919c71073..ce8b7c411859 100644 --- a/sys/dev/acpica/acpi_throttle.c +++ b/sys/dev/acpica/acpi_throttle.c @@ -275,7 +275,7 @@ acpi_throttle_evaluate(struct acpi_throttle_softc *sc) return (ENXIO); } memcpy(&gas, obj.Buffer.Pointer + 3, sizeof(gas)); - acpi_bus_alloc_gas(sc->cpu_dev, &sc->cpu_p_type, &thr_rid, + acpi_bus_alloc_gas(sc->cpu_dev, &sc->cpu_p_type, thr_rid, &gas, &sc->cpu_p_cnt, 0); if (sc->cpu_p_cnt != NULL && bootverbose) { device_printf(sc->cpu_dev, "P_CNT from _PTC %#jx\n", @@ -295,7 +295,7 @@ acpi_throttle_evaluate(struct acpi_throttle_softc *sc) gas.Address = sc->cpu_p_blk; gas.SpaceId = ACPI_ADR_SPACE_SYSTEM_IO; gas.BitWidth = 32; - acpi_bus_alloc_gas(sc->cpu_dev, &sc->cpu_p_type, &thr_rid, + acpi_bus_alloc_gas(sc->cpu_dev, &sc->cpu_p_type, thr_rid, &gas, &sc->cpu_p_cnt, 0); if (sc->cpu_p_cnt != NULL) { if (bootverbose) diff --git a/sys/dev/acpica/acpivar.h b/sys/dev/acpica/acpivar.h index 71d8e46ab310..4da1a5a35a41 100644 --- a/sys/dev/acpica/acpivar.h +++ b/sys/dev/acpica/acpivar.h @@ -419,7 +419,7 @@ int acpi_parse_prw(ACPI_HANDLE h, struct acpi_prw_data *prw); ACPI_STATUS acpi_Startup(void); void acpi_UserNotify(const char *subsystem, ACPI_HANDLE h, uint8_t notify); -int acpi_bus_alloc_gas(device_t dev, int *type, int *rid, +int acpi_bus_alloc_gas(device_t dev, int *type, int rid, ACPI_GENERIC_ADDRESS *gas, struct resource **res, u_int flags); void acpi_walk_subtables(void *first, void *end, diff --git a/sys/dev/wdatwd/wdatwd.c b/sys/dev/wdatwd/wdatwd.c index c67e37281307..8873dd74103c 100644 --- a/sys/dev/wdatwd/wdatwd.c +++ b/sys/dev/wdatwd/wdatwd.c @@ -612,7 +612,7 @@ wdatwd_probe(device_t dev) int type, rid = 0; struct resource *res; - if (acpi_bus_alloc_gas(dev, &type, &rid, + if (acpi_bus_alloc_gas(dev, &type, rid, &((ACPI_WDAT_ENTRY *)(wdat + 1))->RegisterRegion, &res, 0)) return (ENXIO);