From nobody Sun Dec 1 04:57:49 2024 X-Original-To: dev-commits-src-branches@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 4Y1F660rTJz5gD3p; Sun, 01 Dec 2024 04:57:50 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Y1F6569z7z4Cmt; Sun, 1 Dec 2024 04:57:49 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1733029069; 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=VtO87J8rBB/2xNvRHJrnMewsFrMr2vAIcx5oHNVOxxg=; b=nDWPy3sAAqTxuP93Vo26ixraW8TrOtorgntnGXzgZfTY0XZTJLXfHvnDtwLPfMaDVeHp1p pxMbMIEdjnRQgRZfq+9gBPwmNIQu7A7yvbQxnKBLZ8594ohz8ahI2775ST99/lR+1Epvw1 SojUZPsyr+EWJjxiRTEwpJlebCZYhbpId/O9rC71kSaKF8zkxrahVfcJr2pTQPgkIxZ8Zw UwlqfyidwX/IGLx4cYOhFDHIIRSRWXPOkV8XFjbKr90piYfJO0MouTJ/N8nbuIcJdQOTjO A50JU9/D9ngd+kq8IAh12EkKfW6+Shki7j5/O3SDmJn8/YR0MTiHB5uOc4x9Qw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1733029069; 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=VtO87J8rBB/2xNvRHJrnMewsFrMr2vAIcx5oHNVOxxg=; b=rZ/vwgpsBcrWhsAvHaA8JohdMiHATV4ZEY77DRRmpgNm5Vhdtyiaa6sTYU8Tmc4W0yQTS9 VL0ZyPnUzHoLj8hRHqiowfXBunsq7I+mRHW1q0fcC3C7+yjQsrz7u8Aw0ZgPjCWiaVgyJW MuD/hQhlarspEYKI4oUR1/UWHRLOnxODUm+gWsFW5eIWePlmrwiVl5rU/bkVDqBpjzb4nP cQwPC845H8KEg5dN78i7YFeSJxpzrosXH6nEeUFEEIH5vLsxg8sUlt/GQamuB555rqVx7o LfYPG2/wCqBiUbOk7BAPu00g97QV1k6caN34cYnBmWj0zSyNuuJZ1SIHZBXbig== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1733029069; a=rsa-sha256; cv=none; b=TmPJY+8SRg/GXl0rDUh/C0aQqzFZ8lC5MZhnATZzuu9TS6moVzMdRa7y9VvoEy4pONfvwT W2pOvO2YKlS+E0kapl/LZIVFm9xHmydDTCRo6Y2rEzmIF/Muw0f7h8scmfODqD3nOJLiXL C1YmtYOP0xXPfEH885taNvg6sL9eN80wG0b+LdFyRQrZMC0ux8o4BIRhvg4+hVI8Hd2FR8 Ddgvou59O1ebzJ4w1iwsFvUSub361SuGmuCl+vbm76n//mCYmCDBoIIfR4GUvU16S9+kD/ 6Lf9gVCZzrgO59MYqC/W+JqFKEGjo6pBh9VXOJK9l3vwtXgIjKWvPda8CdbHrw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Y1F655fTczf7W; Sun, 1 Dec 2024 04:57:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4B14vnXr097044; Sun, 1 Dec 2024 04:57:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4B14vnt1097041; Sun, 1 Dec 2024 04:57:49 GMT (envelope-from git) Date: Sun, 1 Dec 2024 04:57:49 GMT Message-Id: <202412010457.4B14vnt1097041@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 165e8ecbea01 - stable/13 - legacy cpu: Add proper device_probe and device_attach routines List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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/stable/13 X-Git-Reftype: branch X-Git-Commit: 165e8ecbea011e7661dd48c67579304daa570270 Auto-Submitted: auto-generated The branch stable/13 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=165e8ecbea011e7661dd48c67579304daa570270 commit 165e8ecbea011e7661dd48c67579304daa570270 Author: John Baldwin AuthorDate: 2024-10-21 14:24:28 +0000 Commit: John Baldwin CommitDate: 2024-11-30 21:34:50 +0000 legacy cpu: Add proper device_probe and device_attach routines Set a device description in probe and handle both adding and attaching children in attach. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D47185 (cherry picked from commit ab4f969f8d305665c478b25d4268501445fa5ba6) --- sys/x86/x86/legacy.c | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/sys/x86/x86/legacy.c b/sys/x86/x86/legacy.c index 3a5e878be7ed..1bbaf31af0ee 100644 --- a/sys/x86/x86/legacy.c +++ b/sys/x86/x86/legacy.c @@ -268,6 +268,8 @@ legacy_write_ivar(device_t dev, device_t child, int which, uintptr_t value) * cpufreq(4) hang off this. */ static void cpu_identify(driver_t *driver, device_t parent); +static device_probe_t cpu_probe; +static device_attach_t cpu_attach; static int cpu_read_ivar(device_t dev, device_t child, int index, uintptr_t *result); static device_t cpu_add_child(device_t bus, u_int order, const char *name, @@ -282,8 +284,8 @@ struct cpu_device { static device_method_t cpu_methods[] = { /* Device interface */ DEVMETHOD(device_identify, cpu_identify), - DEVMETHOD(device_probe, bus_generic_probe), - DEVMETHOD(device_attach, bus_generic_attach), + DEVMETHOD(device_probe, cpu_probe), + DEVMETHOD(device_attach, cpu_attach), DEVMETHOD(device_detach, bus_generic_detach), DEVMETHOD(device_shutdown, bus_generic_shutdown), DEVMETHOD(device_suspend, bus_generic_suspend), @@ -331,6 +333,21 @@ cpu_identify(driver_t *driver, device_t parent) } } +static int +cpu_probe(device_t dev) +{ + device_set_desc(dev, "legacy CPU"); + return (BUS_PROBE_DEFAULT); +} + +static int +cpu_attach(device_t dev) +{ + bus_generic_probe(dev); + bus_generic_attach(dev); + return (0); +} + static device_t cpu_add_child(device_t bus, u_int order, const char *name, int unit) {