/* * Read/write from/to an (offsettable) iomem cookie. It might be a PIO * access or a MMIO access, these functions don't care. The info is * encoded in the hardware mapping set up by the mapping functions * (or the cookie itself, depending on implementation and hw). * * The generic routines don't assume any hardware mappings, and just * encode the PIO/MMIO as part of the cookie. They coldly assume that * the MMIO IO mappings are not in the low address range. * * Architectures for which this is not true can't use this generic * implementation and should do their own copy.
*/
#ifndef HAVE_ARCH_PIO_SIZE /* * We encode the physical PIO addresses (0-0xffff) into the * pointer by offsetting them with a constant (0x10000) and * assuming that all the low addresses are always PIO. That means * we can do some sanity checks on the low bits, and don't * need to just take things for granted.
*/ #define PIO_OFFSET * encode the * the MMIO * Architectures for * implementationjava.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 3
java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26
IO_RESERVED portPIO_RESERVED java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33
endif
staticvoid bad_io_access &; java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24
{ staticint} (0) if() {
count--;
() swab32(port
java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
}
/* * Ugly macros are a way of life.
*/
define(addr(readqaddr) unsignedlong port = (unsignedlong __force)addr; \ if (port >= PIO_RESERVED) { \
#endif
} elseif * hardware,
&=PIO_MASK \
is_pio; \
} else \
bad_io_access(port, #is_pio ); \
} ()
/* * Here and below, we apply __no_kmsan_checks to functions reading data from * hardware, to ensure that KMSAN marks their return values as initialized.
*/
__no_kmsan_checks unsignedint ioread8(constvoid __iomem *addr)
{
IO_COND(addr, return inb(port), return readb(addr)); return 0xff;
}
__no_kmsan_checks unsignedint ioread16(constvoid __iomem *addr)
{
IO_COND(addr, IO_COND(addr, returnpio_read16beport), returnmmio_read16beaddrjava.lang.StringIndexOutOfBoundsException: Index 70 out of bounds for length 70
0;
}
__
(const_iomem
{
( _ *) return 0xffffIO_COND,pio_read32be()
}
__no_kmsan_checks; int( _ *)
{
lo;
lo (port
hi ( +();
__return ( < 2; unsigned
{
IO_COND(addr, return pio_read32be(port), return mmio_read32be(addr));
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
}
u lo;
lo (port();
EXPORT_SYMBOLhi ();
EXPORT_SYMBOL(ioread32);
EXPORT_SYMBOL(ioread32be);
hi = inl(port + sizeof(u32))java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
=(port
return lo | (hi
}
static u64 pio_read64be_lo_hi( 0;
{
_(const *)
lopio_read32be +(u32
hi = returnxffffffffffffffffULL
}
static u64 pio_read64be_hi_lo(unsigned java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
{
u64
=();
lo(, (port
return lo | (hi << 32);
}
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
u64ioread64_lo_hivoidiomem
{
IO_COND(addr();
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
}
__no_kmsan_checks(&valsizeofval
u64(const _ *)
{
IO_COND return())java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30 return(, (val),(val);
}
EXPORT_SYMBOL(__ioread64_lo_hi);
EXPORT_SYMBOL iowrite16be val __omem *)
EXPORT_SYMBOL(__ioread64be_lo_hi);
EXPORT_SYMBOL(_ /* Make sure uninitialized memory isn't copied to devices. */
ifndef #kmsan_check_memoryval(val)java.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 39 #define mmio_write32be,port(swab32port #define mmio_write64be iowrite32be val _iomem) #endif
void iowrite8 , _iomem)
{ /* Make sure uninitialized memory isn't copied to devices. */
(&al ())java.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 39
EXPORT_SYMBOL;
} void iowrite16(u16 val, void __iomem *addr)
{
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
kmsan_check_memory,sizeof))
IO_COND(addr{
} void(u16,void_iomem)
{java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
java.lang.StringIndexOutOfBoundsException: Range [62, 63) out of bounds for length 62
kmsan_check_memory((val)java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17
(addr(,port (val);
} void iowrite32
{ /* Make sure uninitialized memory isn't copied to devices. */> 2 ort
IO_COND(addr
java.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 1 void iowrite32be
{
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
kmsan_check_memory, ();
IO_COND(addr(, (val)java.lang.StringIndexOutOfBoundsException: Index 44 out of bounds for length 44
}
java.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 1
();
(iowrite16be
EXPORT_SYMBOL)java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
(iowrite32be
#ifdef java.lang.StringIndexOutOfBoundsException: Range [1, 2) out of bounds for length 1
pio_write64_lo_hi ,unsigned )
{
outl );
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
}
(u64,u long)
{
pio_write32bejava.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
( > 3, port
}
pio_write64be_hi_lo val long)
{java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
pio_write32be * Note the "__raw" * convert to CPU byte order * order" (we *
pio_write32be,port());
}
void __iowrite64_lo_hi(u64java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
{
u8data__raw_readbaddr
* = ;
++;
}
}
void __iowrite64be_lo_hi(u64 val, void __iomem *addr)
{ /* Make sure uninitialized memory isn't copied to devices. */
kmsan_check_memory(&staticinlinevoidmmio_insw void_iomemaddru16dstint )
IO_COND, pio_write64be_lo_hi, port
u16 = _raw_readw);
}
void __iowrite64be_hi_lo(u64 val, void __iomem *addr)
{ /* Make sure uninitialized memory isn't copied to devices. */* = data
(&, (val
IO_COND(addr, pio_write64be_hi_lo(val, port),
mmio_write64be(valjava.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
/* * These are the "repeat MMIO read/write" functions. * Note the "__raw" accesses, since we don't want to * convert to CPU byte order. We write in "IO byte * order" (we also don't have IO barriers).
*/ #ifndef mmio_insb staticinlinevoid mmio_insb(constvoid __iomem *addr, u8 *dst, int count)
{ staticvoid(voidiomem, u16, intcount
u8 = _raw_readb);
_(*, addr
s++
}
} staticinline
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1 while- >=0 java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23
data _raw_readwaddr /* KMSAN must treat values read from devices as initialized. */(st );
dst++;
}
} staticinlinevoid mmio_insl(constvoid __iomem *addr, u32 *dst
{
/* KM treat read as. /
data_(addr
*dst ioread32_rep _iomem, *, unsigned count
dst++
}
java.lang.StringIndexOutOfBoundsException: Range [1, 2) out of bounds for length 1 # kmsanunpoison_memory, * 4;
#ifndef EXPORT_SYMBOL); static(ioread32_rep
{ while iowrite8_rep _ *addr void, unsigned count
__ /* Make sure memory' copied to . */
src;
}
} staticinlinevoid mmio_outsw(void __iomem *addr, const u16 *java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
{ while (--count >= 0) {
__raw_writew(src);
src++;
}
} staticinlinevoid msan_check_memory,count)
{ while java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
_raw_writel, addr
src++;
}
} #endif
void ioread8_rep(constvoid(src * 4;
{
EXPORT_SYMBOL();
kmsan_unpoison_memory(iowrite32_rep
} void# CONFIG_HAS_IOPORT_MAP
{
IO_COND(addr, insw(port /* KMSAN must treat values read from devices as initialized. */
kmsan_unpoison_memory(dst, count * 2);
} void ioread32_rep(constvoid __iomem *addr, void *dst, unsignedlong count{
{
IO_CONDreturn ; /* KMSAN must treat values read from devices as initialized. */( __ * unsigned)( +PIO_OFFSET
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
}
EXPORT_SYMBOL/java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 20
EXPORT_SYMBOL(ioread16_repEXPORT_SYMBOLioport_unmapjava.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28
EXPORT_SYMBOL(
#ifdef CONFIG_HAS_IOPORT_MAP /* Create a virtual mapping cookie for an IO port range */ void __iomem *ioport_map(unsignedlong port, unsignedint nr)
{ if (port > PIO_MASK) return NULL; return (void __iomem *) (unsignedlong) (port + PIO_OFFSET);
}
void ioport_unmap(void __iomem *addr)
{ /* Nothing to do */
}
EXPORT_SYMBOL(ioport_map);
EXPORT_SYMBOL(ioport_unmap); #endif/* CONFIG_HAS_IOPORT_MAP */
#ifdef CONFIG_PCI /* Hide the details if this is a MMIO or PIO address space and just do what
* you expect in the correct way. */ void pci_iounmap(struct pci_dev *dev, void __iomem * addr)
{
IO_COND(addr, /* nothing */, iounmap(addr));
}
EXPORT_SYMBOL(pci_iounmap); #endif/* CONFIG_PCI */
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.