Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 66eab4df authored by Michael S. Tsirkin's avatar Michael S. Tsirkin
Browse files

lib: add GENERIC_PCI_IOMAP



Many architectures want a generic pci_iomap but
not the rest of iomap.c. Split that to a separate .c
file and add a new config symbol. select automatically
by GENERIC_IOMAP.

Signed-off-by: default avatarMichael S. Tsirkin <mst@redhat.com>
parent 4673ca8e
Loading
Loading
Loading
Loading
+2 −2
Original line number Original line Diff line number Diff line
@@ -19,6 +19,8 @@
#include <asm-generic/iomap.h>
#include <asm-generic/iomap.h>
#endif
#endif


#include <asm-generic/pci_iomap.h>

#ifndef mmiowb
#ifndef mmiowb
#define mmiowb() do {} while (0)
#define mmiowb() do {} while (0)
#endif
#endif
@@ -283,9 +285,7 @@ static inline void writesb(const void __iomem *addr, const void *buf, int len)
#define __io_virt(x) ((void __force *) (x))
#define __io_virt(x) ((void __force *) (x))


#ifndef CONFIG_GENERIC_IOMAP
#ifndef CONFIG_GENERIC_IOMAP
/* Create a virtual mapping cookie for a PCI BAR (memory or IO) */
struct pci_dev;
struct pci_dev;
extern void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long max);
static inline void pci_iounmap(struct pci_dev *dev, void __iomem *p)
static inline void pci_iounmap(struct pci_dev *dev, void __iomem *p)
{
{
}
}
+3 −6
Original line number Original line Diff line number Diff line
@@ -67,18 +67,15 @@ extern void ioport_unmap(void __iomem *);
#endif
#endif


#ifdef CONFIG_PCI
#ifdef CONFIG_PCI
/* Create a virtual mapping cookie for a PCI BAR (memory or IO) */
/* Destroy a virtual mapping cookie for a PCI BAR (memory or IO) */
struct pci_dev;
struct pci_dev;
extern void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long max);
extern void pci_iounmap(struct pci_dev *dev, void __iomem *);
extern void pci_iounmap(struct pci_dev *dev, void __iomem *);
#else
#else
struct pci_dev;
struct pci_dev;
static inline void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long max)
{
	return NULL;
}
static inline void pci_iounmap(struct pci_dev *dev, void __iomem *addr)
static inline void pci_iounmap(struct pci_dev *dev, void __iomem *addr)
{ }
{ }
#endif
#endif


#include <asm-generic/pci_iomap.h>

#endif
#endif
+25 −0
Original line number Original line Diff line number Diff line
/* Generic I/O port emulation, based on MN10300 code
 *
 * Copyright (C) 2007 Red Hat, Inc. All Rights Reserved.
 * Written by David Howells (dhowells@redhat.com)
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public Licence
 * as published by the Free Software Foundation; either version
 * 2 of the Licence, or (at your option) any later version.
 */
#ifndef __ASM_GENERIC_PCI_IOMAP_H
#define __ASM_GENERIC_PCI_IOMAP_H

struct pci_dev;
#ifdef CONFIG_PCI
/* Create a virtual mapping cookie for a PCI BAR (memory or IO) */
extern void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long max);
#else
static inline void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long max)
{
	return NULL;
}
#endif

#endif /* __ASM_GENERIC_IO_H */
+4 −0
Original line number Original line Diff line number Diff line
@@ -19,8 +19,12 @@ config RATIONAL
config GENERIC_FIND_FIRST_BIT
config GENERIC_FIND_FIRST_BIT
	bool
	bool


config GENERIC_PCI_IOMAP
	bool

config GENERIC_IOMAP
config GENERIC_IOMAP
	bool
	bool
	select GENERIC_PCI_IOMAP


config CRC_CCITT
config CRC_CCITT
	tristate "CRC-CCITT functions"
	tristate "CRC-CCITT functions"
+1 −0
Original line number Original line Diff line number Diff line
@@ -33,6 +33,7 @@ endif


lib-$(CONFIG_HOTPLUG) += kobject_uevent.o
lib-$(CONFIG_HOTPLUG) += kobject_uevent.o
obj-$(CONFIG_GENERIC_IOMAP) += iomap.o
obj-$(CONFIG_GENERIC_IOMAP) += iomap.o
obj-$(CONFIG_GENERIC_PCI_IOMAP) += pci_iomap.o
obj-$(CONFIG_HAS_IOMEM) += iomap_copy.o devres.o
obj-$(CONFIG_HAS_IOMEM) += iomap_copy.o devres.o
obj-$(CONFIG_CHECK_SIGNATURE) += check_signature.o
obj-$(CONFIG_CHECK_SIGNATURE) += check_signature.o
obj-$(CONFIG_DEBUG_LOCKING_API_SELFTESTS) += locking-selftest.o
obj-$(CONFIG_DEBUG_LOCKING_API_SELFTESTS) += locking-selftest.o
Loading