Re: [kvm-unit-tests PATCH v2 05/10] x86: move x86/pci to the common lib

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



2016-01-15 17:51+0100, Andrew Jones:
> Also move pci_config_read into asm/pci.h
> 
> Signed-off-by: Andrew Jones <drjones@xxxxxxxxxx>
> ---
> +++ b/lib/asm-generic/pci.h
> @@ -0,0 +1,4 @@
> +#ifndef _ASM_GENERIC_PCI_H_
> +#define _ASM_GENERIC_PCI_H_
> +#error need architecture specific asm/pci.h
> +#endif
> +++ b/lib/x86/asm/pci.h
> @@ -0,0 +1,19 @@
> +#ifndef ASM_PCI_H
> +#define ASM_PCI_H
> +/*
> + * Copyright (C) 2013, Red Hat Inc, Michael S. Tsirkin <mst@xxxxxxxxxx>
> + *
> + * This work is licensed under the terms of the GNU LGPL, version 2.
> + */
> +#include "libcflat.h"
> +#include "pci.h"
> +#include "asm/io.h"
> +
> +static inline uint32_t pci_config_read(pcidevaddr_t dev, uint8_t reg)
> +{
> +    uint32_t index = reg | (dev << 8) | (0x1 << 31);
> +    outl(index, 0xCF8);
> +    return inl(0xCFC);

Hm, why can't this be generalized with [1/10]?

Thanks.

> +}
> +
> +#endif
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux