Re: git: 9cf5db63698b - main - acpi_ged: fix build, as module and non INTRNG case.

From: Warner Losh <imp_at_bsdimp.com>
Date: Mon, 24 Oct 2022 15:28:03 UTC
On Mon, Oct 24, 2022, 9:22 AM Kyle Evans <kevans@freebsd.org> wrote:

> On Mon, Oct 24, 2022 at 10:16 AM Jessica Clarke <jrtc27@freebsd.org>
> wrote:
> >
> > On 24 Oct 2022, at 15:39, Takanori Watanabe <takawata@FreeBSD.org>
> wrote:
> > >
> > > The branch main has been updated by takawata:
> > >
> > > URL:
> https://cgit.FreeBSD.org/src/commit/?id=9cf5db63698b3c73edd632412bf68735d3c20d37
> > >
> > > commit 9cf5db63698b3c73edd632412bf68735d3c20d37
> > > Author:     Takanori Watanabe <takawata@FreeBSD.org>
> > > AuthorDate: 2022-10-24 14:19:12 +0000
> > > Commit:     Takanori Watanabe <takawata@FreeBSD.org>
> > > CommitDate: 2022-10-24 14:37:28 +0000
> > >
> > >    acpi_ged: fix build, as module and non INTRNG case.
> > >
> > >    Reviewed-by: cy
> > >
> > >    Differential Revision: https://reviews.freebsd.org/D37104
> > > ---
> > > sys/dev/acpica/acpi_ged.c          | 2 +-
> > > sys/modules/acpi/acpi_ged/Makefile | 2 +-
> > > 2 files changed, 2 insertions(+), 2 deletions(-)
> > >
> > > diff --git a/sys/dev/acpica/acpi_ged.c b/sys/dev/acpica/acpi_ged.c
> > > index 9459ccc3525b..8ee56c8b0335 100644
> > > --- a/sys/dev/acpica/acpi_ged.c
> > > +++ b/sys/dev/acpica/acpi_ged.c
> > > @@ -198,7 +198,7 @@ acpi_ged_attach(device_t dev)
> > >                       }
> > >               }
> > > #else
> > > -             rawirq = rman_get_start(sc->evt[i].r);
> > > +             rawirq = rman_get_start(sc->evts[i].r);
> > >               trig = INTR_TRIGGER_LEVEL;
> > >               if (ACPI_SUCCESS(acpi_lookup_irq_resource
> > >                               (dev, sc->evts[i].rid,
> > > diff --git a/sys/modules/acpi/acpi_ged/Makefile
> b/sys/modules/acpi/acpi_ged/Makefile
> > > index a937249357f4..87dd53b88b2b 100644
> > > --- a/sys/modules/acpi/acpi_ged/Makefile
> > > +++ b/sys/modules/acpi/acpi_ged/Makefile
> > > @@ -1,7 +1,7 @@
> > > #     $FreeBSD$
> > >
> > > .PATH:        ${SRCTOP}/sys/dev/acpica
> > > -.if ${TARGET_ARCH} == aarch64
> > > +.if ${MACHINE_CPUARCH} == "aarch64"
> > > CFLAGS += -DINTRNG
> > > .endif
> > > KMOD= acpi_ged
> >
> > Why isn’t acpi_ged.c just #include’ing opt_global.h?
> >
>
> I suspect this is trying to cope with untied builds, though I agree
> it's using the wrong approach. We should push this into
> sys/conf/config.mk instead (+ arm, riscv), which should do the right
> thing and actually #define it in opt_global.h (which is included via
> CFLAGS).
>

I was about to make similar comments.  I'll take a look at fixing while I'm
on the plane today... if some else doesn't take a stab I. The mean time.

Warner

>