From nobody Sun Dec 01 04:56:59 2024 X-Original-To: dev-commits-src-all@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 4Y1F582HQMz5gD2f; Sun, 01 Dec 2024 04:57:00 +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 4Y1F575kJXz482K; Sun, 1 Dec 2024 04:56:59 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1733029019; 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=BfPaquzK/11tBzQxSc8nToGDevz6MvarkhS+FTjcmKw=; b=BZ3ApxcctRe9K8Y2o3zTKiCar9E+dK+y4W+9FBGqAD1F2nJZld+njXda8a+LjrJ9ZzOlrN k6kKWoX0W+PQdANY9GPCbgS2Y+BH9qU9pL0WET0mNiTqeIPpk5keXH46l5AnnwQyiAP2u9 jRpjNUZyevub1mwt2tLku/Ch5O9mCW+yjeOc/SmfpJtoXI54rlsX+mLvbJNkjxuPu1UvHy +w4UMC5pVpzyaPTynw5GUsE9PQCvakuJmrmAkUn28CdFHrW38mb5Ac630kjtIJGQDW70A8 9ydrarCEthIUfSQtuGUhjmb+xs65xRlDND8O52SgfYGCtnsaMkrAgRpMzg9vyQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1733029019; 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=BfPaquzK/11tBzQxSc8nToGDevz6MvarkhS+FTjcmKw=; b=kGzpCY50YI2WziO2s9v+o0ZLNcZZQ9bQkYpm31N/ph+97saZchVbkHdt1i6MWtinBisYW7 nP3XqVmYP+c7U/tZPn7Jqdyk81Xcy5Dancq6G1IlmGUQ8HVlaNzSeq9eTR0cBrjlvyPPBo pnh488VTsiAe+iqjAkv9RwdxINVpxYDL07u9LnuvpPxk6qIce82SFf8gk7RkU/WTP+pk9k 4A+MnFyGSkiXv91tM52M1MKLfZSI2LnEthDLzZ/o9DuHdG1Jf4XaupTzMI279lH9jGMKnO fq20e+PXvRq4alJYuFXsNgDWGIr7dezu+YM+D8y0O1Rrld0T69Bibay7lqEDYg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1733029019; a=rsa-sha256; cv=none; b=B4Q0vHuOV1LiMXxoNHpfA1Vl3VkOScLkxMe8/Gfndr5tREWEayqKWNZEyVN7O/qJh8Eiyv 27Jjoseq1+XnPpBrFYPfYBA1OZCNBBEAya7CCFdZJh9Hcrte1UueJKkv7iXr9P0QLiIKmq mp1EYCL4vijZVenDRFMMrEKO8qIh+2Fd3hYiPu/Z+OVp+8/psIW6WEfo9fysGWZLQRH9Ch lmqNFf2r2H5FWKjq46YeX/wzmYTS6zBulIeJek3dVxdvl3Viw0Ri/+DoaN60S4/Zmp3zLR udtEmuRqw4gXBP27VIuqE9YkmEz9i3+fOKwGA3RUDuG987IHlXodSjiYb/IToQ== 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 4Y1F575L8fzdmw; Sun, 1 Dec 2024 04:56:59 +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 4B14uxcD094649; Sun, 1 Dec 2024 04:56:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4B14uxNa094646; Sun, 1 Dec 2024 04:56:59 GMT (envelope-from git) Date: Sun, 1 Dec 2024 04:56:59 GMT Message-Id: <202412010456.4B14uxNa094646@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: 47158359cbc1 - stable/14 - legacy cpu: Add proper device_probe and device_attach routines List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@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/14 X-Git-Reftype: branch X-Git-Commit: 47158359cbc1f01fb5fa899a2287e86b61da8906 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=47158359cbc1f01fb5fa899a2287e86b61da8906 commit 47158359cbc1f01fb5fa899a2287e86b61da8906 Author: John Baldwin AuthorDate: 2024-10-21 14:24:28 +0000 Commit: John Baldwin CommitDate: 2024-12-01 02:46:04 +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 6ece5e085dab..23439a4b549f 100644 --- a/sys/x86/x86/legacy.c +++ b/sys/x86/x86/legacy.c @@ -267,6 +267,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, @@ -281,8 +283,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), @@ -330,6 +332,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) {