[PATCH:libpciaccess 2/3] Fix build on NetBSD-4.

Matthieu Herrb matthieu.herrb at laas.fr
Wed Jun 12 15:17:14 PDT 2013


On Wed, Jun 12, 2013 at 01:43:32PM +0200, Thomas Klausner wrote:
> ---
>  configure.ac     | 10 ++++++++++
>  src/netbsd_pci.c | 13 +++++++++++++
>  2 files changed, 23 insertions(+)
> 

Reviewed-by: Matthieu Herrb <matthieu.herrb at laas.fr>

May be add a comment to explain which NetBSD version uses which API to
access MTRR settings ? 

> diff --git a/configure.ac b/configure.ac
> index 3441b63..537cfe3 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -108,7 +108,17 @@ AC_SYS_LARGEFILE
>  
>  AC_CHECK_HEADERS([err.h])
>  
> +if test "x$netbsd" = xyes; then
> +AC_CHECK_HEADERS([machine/sysarch.h])
> +AC_CHECK_HEADERS([machine/mtrr.h], [have_mtrr_h="yes"], [have_mtrr_h="no"],
> +[#ifdef HAVE_MACHINE_SYSARCH_H
> +#include <sys/types.h>
> +#include <machine/sysarch.h>
> +#endif
> +])
> +else
>  AC_CHECK_HEADER([asm/mtrr.h], [have_mtrr_h="yes"], [have_mtrr_h="no"])
> +fi
>  
>  if test "x$have_mtrr_h" = xyes; then
g>      AC_DEFINE(HAVE_MTRR, 1, [Use MTRRs on mappings])
> diff --git a/src/netbsd_pci.c b/src/netbsd_pci.c
> index c9bd052..2d99680 100644
> --- a/src/netbsd_pci.c
> +++ b/src/netbsd_pci.c
> @@ -21,10 +21,23 @@
>  #include <sys/mman.h>
>  #include <sys/types.h>
>  
> +#ifdef HAVE_CONFIG_H
> +#include "config.h"
> +#endif
> +
>  #ifdef HAVE_MTRR
>  #include <machine/sysarch.h>
>  #include <machine/mtrr.h>
> +#ifdef _X86_SYSARCH_L
>  #define netbsd_set_mtrr(mr, num)	_X86_SYSARCH_L(set_mtrr)(mr, num)
> +#else
> +#ifdef __i386__
> +#define netbsd_set_mtrr(mr, num)	i386_set_mtrr((mr), (num))
> +#endif
> +#ifdef __amd64__
> +#define netbsd_set_mtrr(mr, num)	x86_64_set_mtrr((mr), (num))
> +#endif
> +#endif
>  #endif
>  
>  #include <dev/pci/pcidevs.h>
> -- 
> 1.8.2.3
> 
> _______________________________________________
> xorg-devel at lists.x.org: X.Org development
> Archives: http://lists.x.org/archives/xorg-devel
> Info: http://lists.x.org/mailman/listinfo/xorg-devel

-- 
Matthieu Herrb


More information about the xorg-devel mailing list