From nobody Thu Dec 22 10:45:48 2022 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 4Nd6RK2Q8Xz1H1Fw; Thu, 22 Dec 2022 10:45:49 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Nd6RK1rhQz4GTf; Thu, 22 Dec 2022 10:45:49 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1671705949; 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=1Jp1BkJNKLAKi7LYBmMudLMZ0tlGkt/Vhnm1yUwWXns=; b=YubSxnq3yehcayAPQVlda/5F4jNem25y+06YA6NF6GriFVDVkmGirARXCiMgvGWBYx1uEs 3ou0jejOhWgd3PyOW6SEBrs7u1HqEOM/aiypa+qeT+YWXtcbe1oA21QNT5lG0inClTBYlz 4Jg8qEKhnMt+AaWONX4oEiYelQai+LL8sGapXdcPmSPVUVocuYFfpShTpl39M5myrINkBI AAQEzeYaQ1x+pdQlv1R6K+Uysh2Xf+/SkxojAyi+kE6KIa9rue+4jLLE4AguJbYKrYJPK1 zbmQTxvOPWogAkbbIZO+iEc/tfbR0wmCWsC4ZrEa3MLk/X/uunP9iGQAuYboLw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1671705949; 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=1Jp1BkJNKLAKi7LYBmMudLMZ0tlGkt/Vhnm1yUwWXns=; b=D1YPY+thI5asNS1AF3WYcWKdTn6bRKgS6Bj9FZfPa1e8xu4V46oR8Xyyc9Mv4kOPRuPiAU L1GtE2IczaozEAHjCY0wWuSFy/LYXSLrdPjFPH6509pJOzNVborQQkng/dKA74wRQyq9So 3yh54gNcibIxNbBMfLaa9a10ZCVu/LCOFAkUTMFIz5CeJK4r8O495V/Gy+e7w09UJ47Sfc aghwzQmAxpEnv3Gv4mLfgDE5WCKuhK2Un+N4amK72/lvJlz5ICVIBu4KsPn79HKhWCGeyn RItpDiInWOqtJ6Oq8jEGiJuC2RNDWDjL3cmUYnX5HsnAnXzstuFkcYJl7GhMkg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1671705949; a=rsa-sha256; cv=none; b=fP8SZKQOYRzz1PsyhOOxPz9GlfdeqrEqDT5MVWvt+yrtVpacP7IFLM82pfk/2Szs6buKJs +feCO11KW1dL+hKAFFIIlKyUV33pVNl6u2rccyEMmb4Ouv+kWn+YsJaWMPqLbdKp2VOjC9 r61YVL1MwD+qMBJvfADKy0KblUX6xT+7Y9s5m2Jn63DFf4yEjIQc+d19OHKxz7MEwlyK09 fFevrWSj0ArqSbP+pNT+H9fo9L4CxAik4c+QTqMssTUd/Edn9+JDYq3ZjX+ea5BIIy+LIK VMJespEr8v+WayF6udR3IJqyPmHGIZKg2fwRAqew2vSQbtgnGIdlXhI7/Ujwdw== 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 4Nd6RK0nP5zrdM; Thu, 22 Dec 2022 10:45:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 2BMAjmrE053199; Thu, 22 Dec 2022 10:45:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 2BMAjmTB053198; Thu, 22 Dec 2022 10:45:48 GMT (envelope-from git) Date: Thu, 22 Dec 2022 10:45:48 GMT Message-Id: <202212221045.2BMAjmTB053198@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: 751d88119fdc - main - Fix loading the hwpmc module when ACPI is enabled 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: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 751d88119fdc1dff71d1390c7768942a9b857bc6 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=751d88119fdc1dff71d1390c7768942a9b857bc6 commit 751d88119fdc1dff71d1390c7768942a9b857bc6 Author: Andrew Turner AuthorDate: 2022-12-22 10:10:46 +0000 Commit: Andrew Turner CommitDate: 2022-12-22 10:36:18 +0000 Fix loading the hwpmc module when ACPI is enabled In 0a9a4d2cd6092 a check for OPT_ACPI was added to the hwpmc Makefile to fix loading the module in a kernel where ACPI has been disabled. This broke loading the module when ACPI was enabled in the build as OPT_ACPI isn't a Makefile macro so was always disabled. Move this check to the C files where the DEV_ACPI macro does exist. Reviewed by: gnn Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D37773 --- sys/arm64/arm64/cmn600.c | 7 ++++++- sys/dev/hwpmc/hwpmc_cmn600.c | 9 ++++++++- sys/dev/hwpmc/pmu_dmc620.c | 6 ++++++ sys/modules/hwpmc/Makefile | 2 -- 4 files changed, 20 insertions(+), 4 deletions(-) diff --git a/sys/arm64/arm64/cmn600.c b/sys/arm64/arm64/cmn600.c index a6ed7b73bafc..de673535b927 100644 --- a/sys/arm64/arm64/cmn600.c +++ b/sys/arm64/arm64/cmn600.c @@ -1,7 +1,7 @@ /*- * SPDX-License-Identifier: BSD-2-Clause-FreeBSD * - * Copyright (c) 2021 ARM Ltd + * Copyright (c) 2021-2022 Arm Ltd * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -34,6 +34,10 @@ __FBSDID("$FreeBSD$"); #include "opt_acpi.h" +/* + * This depends on ACPI, but is built unconditionally in the hwpmc module. + */ +#ifdef DEV_ACPI #include #include #include @@ -831,3 +835,4 @@ static driver_t cmn600_acpi_driver = { DRIVER_MODULE(cmn600, acpi, cmn600_acpi_driver, 0, 0); MODULE_VERSION(cmn600, 1); +#endif /* DEV_ACPI */ diff --git a/sys/dev/hwpmc/hwpmc_cmn600.c b/sys/dev/hwpmc/hwpmc_cmn600.c index 5e3ecb58c77c..59b4e8252af2 100644 --- a/sys/dev/hwpmc/hwpmc_cmn600.c +++ b/sys/dev/hwpmc/hwpmc_cmn600.c @@ -3,7 +3,7 @@ * * Copyright (c) 2003-2008 Joseph Koshy * Copyright (c) 2007 The FreeBSD Foundation - * Copyright (c) 2021 ARM Ltd + * Copyright (c) 2021-2022 ARM Ltd * * Portions of this software were developed by A. Joseph Koshy under * sponsorship from the FreeBSD Foundation and Google, Inc. @@ -35,6 +35,12 @@ #include __FBSDID("$FreeBSD$"); +#include "opt_acpi.h" + +/* + * This depends on ACPI, but is built unconditionally in the hwpmc module. + */ +#ifdef DEV_ACPI #include #include #include @@ -824,3 +830,4 @@ pmc_cmn600_finalize(struct pmc_mdep *md) } MODULE_DEPEND(pmc, cmn600, 1, 1, 1); +#endif /* DEV_ACPI */ diff --git a/sys/dev/hwpmc/pmu_dmc620.c b/sys/dev/hwpmc/pmu_dmc620.c index b2cb2404693c..464eb9004d11 100644 --- a/sys/dev/hwpmc/pmu_dmc620.c +++ b/sys/dev/hwpmc/pmu_dmc620.c @@ -2,6 +2,7 @@ * SPDX-License-Identifier: BSD-2-Clause-FreeBSD * * Copyright (c) 2021 Ampere Computing LLC + * Copyright (c) 2022 Arm Ltd * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -33,6 +34,10 @@ __FBSDID("$FreeBSD$"); #include "opt_hwpmc_hooks.h" #include "opt_acpi.h" +/* + * This depends on ACPI, but is built unconditionally in the hwpmc module. + */ +#ifdef DEV_ACPI #include #include #include @@ -275,3 +280,4 @@ DRIVER_MODULE(pmu_dmc620, acpi, pmu_dmc620_acpi_driver, 0, 0); /* Reverse dependency. hwpmc needs DMC-620 on ARM64. */ MODULE_DEPEND(pmc, pmu_dmc620, 1, 1, 1); MODULE_VERSION(pmu_dmc620, 1); +#endif /* DEV_ACPI */ diff --git a/sys/modules/hwpmc/Makefile b/sys/modules/hwpmc/Makefile index a72b3cf8d2fd..0db4c55e64f3 100644 --- a/sys/modules/hwpmc/Makefile +++ b/sys/modules/hwpmc/Makefile @@ -12,11 +12,9 @@ SRCS+= vnode_if.h .if ${MACHINE_CPUARCH} == "aarch64" SRCS+= hwpmc_arm64.c hwpmc_arm64_md.c -.if !empty(OPT_ACPI) SRCS+= cmn600.c hwpmc_cmn600.c SRCS+= hwpmc_dmc620.c pmu_dmc620.c .endif -.endif .if ${MACHINE_CPUARCH} == "amd64" SRCS+= hwpmc_amd.c hwpmc_core.c hwpmc_intel.c hwpmc_tsc.c