From nobody Mon Oct 21 14:26:50 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 4XXHgZ4TMNz5ZLWp; Mon, 21 Oct 2024 14:26: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XXHgZ2lxcz4XlC; Mon, 21 Oct 2024 14:26:50 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1729520810; 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=m/hCSIJne5ht09ud648DlLE2qItNEw4Bemo2RDGqGH4=; b=J9RUCfmzQ4zLTrcrLNp/ab9rnpBfsH03A/Q04u/OAAf0jMuq1CKjDWiuOqvMr3JaQZKios qcIylrQ6Kl11OwQCVTPWSiRTh4uQN5CQ6NabiR/4X79AmGK9QMv0B/7VFIeX26YrlXmfXm e7RDDOtvKvwzGw0GSPF4Tq4InEc53AHN3UUfToLGeiPUASbAdXUaci7r5SC8f2E8HTcz8A Norq/T/c3oY3SvN0Voz3vgUJugUt/HsjLr8vq05FMXqXIuGXuNEYgn2wH8xeo/JR+wfdGu X0gfV1A5oI+EkHPi/8kZYg9ziifcXVmbmQnNqh1hpaIbaRuDzFwhkFiVnWJtpg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1729520810; 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=m/hCSIJne5ht09ud648DlLE2qItNEw4Bemo2RDGqGH4=; b=CUj331K2JWkUmaNwoAhU1IQM10E//Af8H+7Ey6EDswcitmJVTg/keLW+C9fuawUkjq5t// W8Lg8cERqKIcnPjylOiE4eVfMWEn7zB/9FF9IwVKhS/2mzU2HhvxEgLSP0ey356nOTdDiz p5sm0xWjjcz+LcUSujYYTZ0TyIuITT93RNMUY4ITzgRijTNJcddB/hyuKoBi14o7NGUhUP W5C7nfEiAzwU9Yez+pG65biW9EhZArwKneQM/SbT0XJ0GX2vsPFgmjzscKTBdAQr3qtuvz aTaIO0ZBFKXc2y6tTeu+qoqu5KosserYdAaGdKhN2Sqim420KRgn5KuRGxgmiw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1729520810; a=rsa-sha256; cv=none; b=mS5a2ajSUaHeGYPrlE96zJHZS+RwKUdzB2UudD+qYJnWkcQGfev20C1+qB58W4nNYz8trf Y+jODIaHZsrNpsInxM6WMyeOob+BZT2tBtQ6L7CUqZNOCRwa5CNh6BkSMDoELtPhQhgWsc /RmtvJfJU1yYACLc56CvBJ+PSjfIGC6nxc9TZy5jzeH3nblq6eFE3Rs3pRi1zdLHF7ksLl VFCv360DcWzfLT1c5LgXnqzo+Tyjyzs0EeUZoQkvHZmZ2VVC4UBkKIqz7XGw32vvDPZfm9 eVO4YPHmPRt/IT8fGhub9pk1G8vsD95aaVMVmrMbpE2qxxcsSGAoIztXOFmvtA== 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 4XXHgZ2MPbzZM1; Mon, 21 Oct 2024 14:26:50 +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 49LEQojK071898; Mon, 21 Oct 2024 14:26:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49LEQoem071895; Mon, 21 Oct 2024 14:26:50 GMT (envelope-from git) Date: Mon, 21 Oct 2024 14:26:50 GMT Message-Id: <202410211426.49LEQoem071895@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: ab4f969f8d30 - main - 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/main X-Git-Reftype: branch X-Git-Commit: ab4f969f8d305665c478b25d4268501445fa5ba6 Auto-Submitted: auto-generated The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=ab4f969f8d305665c478b25d4268501445fa5ba6 commit ab4f969f8d305665c478b25d4268501445fa5ba6 Author: John Baldwin AuthorDate: 2024-10-21 14:24:28 +0000 Commit: John Baldwin CommitDate: 2024-10-21 14:24:28 +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 --- 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) {