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

Commit e854d8b2 authored by David Woodhouse's avatar David Woodhouse Committed by Bjorn Helgaas
Browse files

PCI: Add arch_can_pci_mmap_io() on architectures which can mmap() I/O space



This is relatively esoteric, and knowing that we don't have it makes life
easier in some cases rather than just an eventual -EINVAL from
pci_mmap_page_range().

Signed-off-by: default avatarDavid Woodhouse <dwmw@amazon.co.uk>
Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
parent 11df1954
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -119,7 +119,8 @@ useful return codes should be provided.

Platforms which support write-combining maps of PCI resources must define
arch_can_pci_mmap_wc() which shall evaluate to non-zero at runtime when
write-combining is permitted.
write-combining is permitted. Platforms which support maps of I/O resources
define arch_can_pci_mmap_io() similarly.

Legacy resources are protected by the HAVE_PCI_LEGACY define.  Platforms
wishing to support legacy functionality should define it and provide
+2 −1
Original line number Diff line number Diff line
@@ -49,6 +49,7 @@ struct vm_area_struct;

/* Tell drivers/pci/proc.c that we have pci_mmap_page_range() */
#define HAVE_PCI_MMAP		1
#define arch_can_pci_mmap_io()	1

extern int pci_legacy_read(struct pci_bus *bus, loff_t port, u32 *val,
			   size_t count);
+1 −0
Original line number Diff line number Diff line
@@ -80,6 +80,7 @@ struct vm_area_struct;

/* Tell drivers/pci/proc.c that we have pci_mmap_page_range() and it does WC */
#define HAVE_PCI_MMAP		1
#define arch_can_pci_mmap_io()	1
#define arch_can_pci_mmap_wc()	1

extern int pci_legacy_read(struct pci_bus *bus, loff_t port, u32 *val,
+1 −0
Original line number Diff line number Diff line
@@ -42,6 +42,7 @@ static inline int pci_proc_domain(struct pci_bus *bus)
/* Platform support for /proc/bus/pci/X/Y mmap()s. */

#define HAVE_PCI_MMAP
#define arch_can_pci_mmap_io()	1
#define HAVE_ARCH_PCI_GET_UNMAPPED_AREA
#define get_pci_unmapped_area get_fb_unmapped_area

+2 −1
Original line number Diff line number Diff line
@@ -48,6 +48,7 @@ struct pci_dev;

/* Tell drivers/pci/proc.c that we have pci_mmap_page_range() */
#define HAVE_PCI_MMAP		1
#define arch_can_pci_mmap_io()	1

#endif /* __KERNEL__ */

Loading