NetBSD Problem Report #55963
From www@netbsd.org Fri Jan 29 06:47:33 2021
Return-Path: <www@netbsd.org>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits))
(Client CN "mail.NetBSD.org", Issuer "mail.NetBSD.org CA" (not verified))
by mollari.NetBSD.org (Postfix) with ESMTPS id 5050C1A9239
for <gnats-bugs@gnats.NetBSD.org>; Fri, 29 Jan 2021 06:47:33 +0000 (UTC)
Message-Id: <20210129064731.BE9561A923B@mollari.NetBSD.org>
Date: Fri, 29 Jan 2021 06:47:31 +0000 (UTC)
From: hashikaw@mail.ru
Reply-To: hashikaw@mail.ru
To: gnats-bugs@NetBSD.org
Subject: #ifdef __HAVE_PCI_CONF_HOOK is needed to define pcihost_conf_hook() at pcihost_fdt.c
X-Send-Pr-Version: www-1.0
>Number: 55963
>Category: kern
>Synopsis: #ifdef __HAVE_PCI_CONF_HOOK is needed to define pcihost_conf_hook() at pcihost_fdt.c
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: kern-bug-people
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Fri Jan 29 06:50:00 +0000 2021
>Originator: Kouichi Hashikawa
>Release: NetBSD-9.99.79
>Organization:
>Environment:
>Description:
On src/sys/arch/arm/fdt/pcihost_fdt.c, I think #ifdef __HAVE_PCI_CONF_HOOK is needed to define pcihost_conf_hook(). Please refer src/sys/arch/arm/include/pci_machdep.h.
>How-To-Repeat:
>Fix:
I think,
--- ../fdt/pcihost_fdt.c-dist 2021-01-29 15:28:38.947344323 +0900
+++ ../fdt/pcihost_fdt.c 2021-01-29 15:35:40.763832665 +0900
@@ -74,7 +74,9 @@
static u_int pcihost_get_segment(void *);
static pcireg_t pcihost_conf_read(void *, pcitag_t, int);
static void pcihost_conf_write(void *, pcitag_t, int, pcireg_t);
+#ifdef __HAVE_PCI_CONF_HOOK
static int pcihost_conf_hook(void *, int, int, int, pcireg_t);
+#endif /* __HAVE_PCI_CONF_HOOK */
static void pcihost_conf_interrupt(void *, int, int, int, int, int *);
static int pcihost_intr_map(const struct pci_attach_args *,
@@ -85,12 +87,12 @@
static int pcihost_intr_setattr(void *, pci_intr_handle_t *, int,
uint64_t);
static void * pcihost_intr_establish(void *, pci_intr_handle_t,
- int, int (*)(void *), void *,
- const char *);
+ int, int (*)(void *), void *,
+ const char *);
static void pcihost_intr_disestablish(void *, void *);
static int pcihost_bus_space_map(void *, bus_addr_t, bus_size_t,
- int, bus_space_handle_t *);
+ int, bus_space_handle_t *);
CFATTACH_DECL_NEW(pcihost_fdt, sizeof(struct pcihost_softc),
pcihost_match, pcihost_attach, NULL, NULL);
@@ -208,7 +210,9 @@
pc->pc_get_segment = pcihost_get_segment;
pc->pc_conf_read = pcihost_conf_read;
pc->pc_conf_write = pcihost_conf_write;
+#ifdef __HAVE_PCI_CONF_HOOK
pc->pc_conf_hook = pcihost_conf_hook;
+#endif /* __HAVE_PCI_CONF_HOOK */
pc->pc_conf_interrupt = pcihost_conf_interrupt;
pc->pc_intr_v = priv;
@@ -452,11 +456,13 @@
bus_space_write_4(sc->sc_bst, sc->sc_bsh, reg, val);
}
+#ifdef __HAVE_PCI_CONF_HOOK
static int
pcihost_conf_hook(void *v, int b, int d, int f, pcireg_t id)
{
return PCI_CONF_DEFAULT;
}
+#endif /* __HAVE_PCI_CONF_HOOK */
static void
pcihost_conf_interrupt(void *v, int bus, int dev, int ipin, int swiz, int *ilinep)
(Contact us)
$NetBSD: query-full-pr,v 1.46 2020/01/03 16:35:01 leot Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2020
The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.