__  __    __   __  _____      _            _          _____ _          _ _ 
 |  \/  |   \ \ / / |  __ \    (_)          | |        / ____| |        | | |
 | \  / |_ __\ V /  | |__) | __ ___   ____ _| |_ ___  | (___ | |__   ___| | |
 | |\/| | '__|> <   |  ___/ '__| \ \ / / _` | __/ _ \  \___ \| '_ \ / _ \ | |
 | |  | | |_ / . \  | |   | |  | |\ V / (_| | ||  __/  ____) | | | |  __/ | |
 |_|  |_|_(_)_/ \_\ |_|   |_|  |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1
 if you need WebShell for Seo everyday contact me on Telegram
 Telegram Address : @jackleet
        
        
For_More_Tools: Telegram: @jackleet | Bulk Smtp support mail sender | Business Mail Collector | Mail Bouncer All Mail | Bulk Office Mail Validator | Html Letter private



Upload:

Command:

[email protected]: ~ $
/* SPDX-License-Identifier: GPL-2.0 */
#ifndef __ASM_SH_IO_H
#define __ASM_SH_IO_H

/*
 * Convention:
 *    read{b,w,l,q}/write{b,w,l,q} are for PCI,
 *    while in{b,w,l}/out{b,w,l} are for ISA
 *
 * In addition we have 'pausing' versions: in{b,w,l}_p/out{b,w,l}_p
 * and 'string' versions: ins{b,w,l}/outs{b,w,l}
 *
 * While read{b,w,l,q} and write{b,w,l,q} contain memory barriers
 * automatically, there are also __raw versions, which do not.
 */
#include <linux/errno.h>
#include <asm/cache.h>
#include <asm/addrspace.h>
#include <asm/machvec.h>
#include <asm/page.h>
#include <linux/pgtable.h>
#include <asm-generic/iomap.h>

#define __IO_PREFIX     generic
#include <asm/io_generic.h>
#include <asm-generic/pci_iomap.h>
#include <mach/mangle-port.h>

#define __raw_writeb(v,a)	(__chk_io_ptr(a), *(volatile u8  __force *)(a) = (v))
#define __raw_writew(v,a)	(__chk_io_ptr(a), *(volatile u16 __force *)(a) = (v))
#define __raw_writel(v,a)	(__chk_io_ptr(a), *(volatile u32 __force *)(a) = (v))
#define __raw_writeq(v,a)	(__chk_io_ptr(a), *(volatile u64 __force *)(a) = (v))

#define __raw_readb(a)		(__chk_io_ptr(a), *(volatile u8  __force *)(a))
#define __raw_readw(a)		(__chk_io_ptr(a), *(volatile u16 __force *)(a))
#define __raw_readl(a)		(__chk_io_ptr(a), *(volatile u32 __force *)(a))
#define __raw_readq(a)		(__chk_io_ptr(a), *(volatile u64 __force *)(a))

#define readb_relaxed(c)	({ u8  __v = ioswabb(__raw_readb(c)); __v; })
#define readw_relaxed(c)	({ u16 __v = ioswabw(__raw_readw(c)); __v; })
#define readl_relaxed(c)	({ u32 __v = ioswabl(__raw_readl(c)); __v; })
#define readq_relaxed(c)	({ u64 __v = ioswabq(__raw_readq(c)); __v; })

#define writeb_relaxed(v,c)	((void)__raw_writeb((__force  u8)ioswabb(v),c))
#define writew_relaxed(v,c)	((void)__raw_writew((__force u16)ioswabw(v),c))
#define writel_relaxed(v,c)	((void)__raw_writel((__force u32)ioswabl(v),c))
#define writeq_relaxed(v,c)	((void)__raw_writeq((__force u64)ioswabq(v),c))

#define readb(a)		({ u8  r_ = readb_relaxed(a); rmb(); r_; })
#define readw(a)		({ u16 r_ = readw_relaxed(a); rmb(); r_; })
#define readl(a)		({ u32 r_ = readl_relaxed(a); rmb(); r_; })
#define readq(a)		({ u64 r_ = readq_relaxed(a); rmb(); r_; })

#define writeb(v,a)		({ wmb(); writeb_relaxed((v),(a)); })
#define writew(v,a)		({ wmb(); writew_relaxed((v),(a)); })
#define writel(v,a)		({ wmb(); writel_relaxed((v),(a)); })
#define writeq(v,a)		({ wmb(); writeq_relaxed((v),(a)); })

#define readsb(p,d,l)		__raw_readsb(p,d,l)
#define readsw(p,d,l)		__raw_readsw(p,d,l)
#define readsl(p,d,l)		__raw_readsl(p,d,l)

#define writesb(p,d,l)		__raw_writesb(p,d,l)
#define writesw(p,d,l)		__raw_writesw(p,d,l)
#define writesl(p,d,l)		__raw_writesl(p,d,l)

#define __BUILD_UNCACHED_IO(bwlq, type)					\
static inline type read##bwlq##_uncached(unsigned long addr)		\
{									\
	type ret;							\
	jump_to_uncached();						\
	ret = __raw_read##bwlq(addr);					\
	back_to_cached();						\
	return ret;							\
}									\
									\
static inline void write##bwlq##_uncached(type v, unsigned long addr)	\
{									\
	jump_to_uncached();						\
	__raw_write##bwlq(v, addr);					\
	back_to_cached();						\
}

__BUILD_UNCACHED_IO(b, u8)
__BUILD_UNCACHED_IO(w, u16)
__BUILD_UNCACHED_IO(l, u32)
__BUILD_UNCACHED_IO(q, u64)

#define __BUILD_MEMORY_STRING(pfx, bwlq, type)				\
									\
static inline void							\
pfx##writes##bwlq(volatile void __iomem *mem, const void *addr,		\
		  unsigned int count)					\
{									\
	const volatile type *__addr = addr;				\
									\
	while (count--) {						\
		__raw_write##bwlq(*__addr, mem);			\
		__addr++;						\
	}								\
}									\
									\
static inline void pfx##reads##bwlq(volatile void __iomem *mem,		\
				    void *addr, unsigned int count)	\
{									\
	volatile type *__addr = addr;					\
									\
	while (count--) {						\
		*__addr = __raw_read##bwlq(mem);			\
		__addr++;						\
	}								\
}

__BUILD_MEMORY_STRING(__raw_, b, u8)
__BUILD_MEMORY_STRING(__raw_, w, u16)

void __raw_writesl(void __iomem *addr, const void *data, int longlen);
void __raw_readsl(const void __iomem *addr, void *data, int longlen);

__BUILD_MEMORY_STRING(__raw_, q, u64)

#define ioport_map ioport_map
#define ioport_unmap ioport_unmap
#define pci_iounmap pci_iounmap

#define ioread8 ioread8
#define ioread16 ioread16
#define ioread16be ioread16be
#define ioread32 ioread32
#define ioread32be ioread32be

#define iowrite8 iowrite8
#define iowrite16 iowrite16
#define iowrite16be iowrite16be
#define iowrite32 iowrite32
#define iowrite32be iowrite32be

#define ioread8_rep ioread8_rep
#define ioread16_rep ioread16_rep
#define ioread32_rep ioread32_rep

#define iowrite8_rep iowrite8_rep
#define iowrite16_rep iowrite16_rep
#define iowrite32_rep iowrite32_rep

#ifdef CONFIG_HAS_IOPORT_MAP

/*
 * Slowdown I/O port space accesses for antique hardware.
 */
#undef CONF_SLOWDOWN_IO

/*
 * On SuperH I/O ports are memory mapped, so we access them using normal
 * load/store instructions. sh_io_port_base is the virtual address to
 * which all ports are being mapped.
 */
extern unsigned long sh_io_port_base;

static inline void __set_io_port_base(unsigned long pbase)
{
	*(unsigned long *)&sh_io_port_base = pbase;
	barrier();
}

#ifdef CONFIG_GENERIC_IOMAP
#define __ioport_map ioport_map
#else
extern void __iomem *__ioport_map(unsigned long addr, unsigned int size);
#endif

#ifdef CONF_SLOWDOWN_IO
#define SLOW_DOWN_IO __raw_readw(sh_io_port_base)
#else
#define SLOW_DOWN_IO
#endif

#define __BUILD_IOPORT_SINGLE(pfx, bwlq, type, p, slow)			\
									\
static inline void pfx##out##bwlq##p(type val, unsigned long port)	\
{									\
	volatile type *__addr;						\
									\
	__addr = (void __iomem *)sh_io_port_base + port;		\
	*__addr = val;							\
	slow;								\
}									\
									\
static inline type pfx##in##bwlq##p(unsigned long port)			\
{									\
	volatile type *__addr;						\
	type __val;							\
									\
	__addr = (void __iomem *)sh_io_port_base + port;		\
	__val = *__addr;						\
	slow;								\
									\
	return __val;							\
}

#define __BUILD_IOPORT_PFX(bus, bwlq, type)				\
	__BUILD_IOPORT_SINGLE(bus, bwlq, type, ,)			\
	__BUILD_IOPORT_SINGLE(bus, bwlq, type, _p, SLOW_DOWN_IO)

#define BUILDIO_IOPORT(bwlq, type)					\
	__BUILD_IOPORT_PFX(, bwlq, type)

BUILDIO_IOPORT(b, u8)
BUILDIO_IOPORT(w, u16)
BUILDIO_IOPORT(l, u32)
BUILDIO_IOPORT(q, u64)

#define __BUILD_IOPORT_STRING(bwlq, type)				\
									\
static inline void outs##bwlq(unsigned long port, const void *addr,	\
			      unsigned int count)			\
{									\
	const volatile type *__addr = addr;				\
									\
	while (count--) {						\
		out##bwlq(*__addr, port);				\
		__addr++;						\
	}								\
}									\
									\
static inline void ins##bwlq(unsigned long port, void *addr,		\
			     unsigned int count)			\
{									\
	volatile type *__addr = addr;					\
									\
	while (count--) {						\
		*__addr = in##bwlq(port);				\
		__addr++;						\
	}								\
}

__BUILD_IOPORT_STRING(b, u8)
__BUILD_IOPORT_STRING(w, u16)
__BUILD_IOPORT_STRING(l, u32)
__BUILD_IOPORT_STRING(q, u64)

#else /* !CONFIG_HAS_IOPORT_MAP */

#include <asm/io_noioport.h>

#endif

#define inb(addr)      inb(addr)
#define inw(addr)      inw(addr)
#define inl(addr)      inl(addr)
#define outb(x, addr)  outb((x), (addr))
#define outw(x, addr)  outw((x), (addr))
#define outl(x, addr)  outl((x), (addr))

#define inb_p(addr)    inb(addr)
#define inw_p(addr)    inw(addr)
#define inl_p(addr)    inl(addr)
#define outb_p(x, addr)        outb((x), (addr))
#define outw_p(x, addr)        outw((x), (addr))
#define outl_p(x, addr)        outl((x), (addr))

#define insb insb
#define insw insw
#define insl insl
#define outsb outsb
#define outsw outsw
#define outsl outsl

#define IO_SPACE_LIMIT 0xffffffff

/* We really want to try and get these to memcpy etc */
#define memset_io memset_io
#define memcpy_fromio memcpy_fromio
#define memcpy_toio memcpy_toio
void memcpy_fromio(void *, const volatile void __iomem *, unsigned long);
void memcpy_toio(volatile void __iomem *, const void *, unsigned long);
void memset_io(volatile void __iomem *, int, unsigned long);

/* Quad-word real-mode I/O, don't ask.. */
unsigned long long peek_real_address_q(unsigned long long addr);
unsigned long long poke_real_address_q(unsigned long long addr,
				       unsigned long long val);

#if !defined(CONFIG_MMU)
#define virt_to_phys(address)	((unsigned long)(address))
#define phys_to_virt(address)	((void *)(address))
#else
#define virt_to_phys(address)	(__pa(address))
#define phys_to_virt(address)	(__va(address))
#endif

#ifdef CONFIG_MMU
/*
 * I/O memory mapping functions.
 */
#define ioremap_prot ioremap_prot
#define iounmap iounmap

#define _PAGE_IOREMAP pgprot_val(PAGE_KERNEL_NOCACHE)

#define ioremap_cache(addr, size)  \
	ioremap_prot((addr), (size), pgprot_val(PAGE_KERNEL))
#endif /* CONFIG_MMU */

#include <asm-generic/io.h>

#define ARCH_HAS_VALID_PHYS_ADDR_RANGE
int valid_phys_addr_range(phys_addr_t addr, size_t size);
int valid_mmap_phys_addr_range(unsigned long pfn, size_t size);

#endif /* __ASM_SH_IO_H */

Filemanager

Name Type Size Permission Actions
Kbuild File 170 B 0644
adc.h File 211 B 0644
addrspace.h File 1.85 KB 0644
alignment.h File 654 B 0644
asm-offsets.h File 74 B 0644
atomic-grb.h File 2.97 KB 0644
atomic-irq.h File 2.01 KB 0644
atomic-llsc.h File 2.49 KB 0644
atomic.h File 693 B 0644
barrier.h File 1.47 KB 0644
bitops-cas.h File 1.73 KB 0644
bitops-grb.h File 6.21 KB 0644
bitops-llsc.h File 2.79 KB 0644
bitops-op32.h File 3.82 KB 0644
bitops.h File 1.58 KB 0644
bl_bit.h File 66 B 0644
bl_bit_32.h File 639 B 0644
bug.h File 2.77 KB 0644
cache.h File 1.31 KB 0644
cache_insns.h File 71 B 0644
cache_insns_32.h File 642 B 0644
cacheflush.h File 4.22 KB 0644
cachetype.h File 170 B 0644
checksum.h File 68 B 0644
checksum_32.h File 4.92 KB 0644
clock.h File 436 B 0644
cmpxchg-cas.h File 549 B 0644
cmpxchg-grb.h File 2.8 KB 0644
cmpxchg-irq.h File 1.04 KB 0644
cmpxchg-llsc.h File 1.06 KB 0644
cmpxchg-xchg.h File 1.24 KB 0644
cmpxchg.h File 2.09 KB 0644
device.h File 442 B 0644
dma-register.h File 1.67 KB 0644
dma.h File 3.09 KB 0644
dmabrg.h File 536 B 0644
dwarf.h File 9.66 KB 0644
elf.h File 5.87 KB 0644
entry-macros.S File 1.85 KB 0644
extable.h File 135 B 0644
fixmap.h File 2.48 KB 0644
flat.h File 865 B 0644
fpu.h File 1.67 KB 0644
freq.h File 212 B 0644
ftrace.h File 1.41 KB 0644
futex-cas.h File 728 B 0644
futex-irq.h File 482 B 0644
futex-llsc.h File 870 B 0644
futex.h File 1.35 KB 0644
hardirq.h File 267 B 0644
hd64461.h File 11.79 KB 0644
heartbeat.h File 383 B 0644
hugetlb.h File 552 B 0644
hw_breakpoint.h File 1.99 KB 0644
hw_irq.h File 915 B 0644
i2c-sh7760.h File 406 B 0644
io.h File 8.88 KB 0644
io_generic.h File 661 B 0644
io_noioport.h File 1.25 KB 0644
io_trapped.h File 1.44 KB 0644
irq.h File 1.16 KB 0644
irqflags.h File 226 B 0644
kdebug.h File 433 B 0644
kexec.h File 2.62 KB 0644
kgdb.h File 851 B 0644
kprobes.h File 1.27 KB 0644
linkage.h File 154 B 0644
machvec.h File 699 B 0644
mmiowb.h File 246 B 0644
mmu.h File 2.18 KB 0644
mmu_context.h File 4.07 KB 0644
mmu_context_32.h File 1.11 KB 0644
mmzone.h File 970 B 0644
module.h File 276 B 0644
page.h File 4.6 KB 0644
pci.h File 2.78 KB 0644
perf_event.h File 797 B 0644
pgalloc.h File 1.13 KB 0644
pgtable-2level.h File 567 B 0644
pgtable-3level.h File 1.5 KB 0644
pgtable.h File 3.89 KB 0644
pgtable_32.h File 16.53 KB 0644
platform_early.h File 1.81 KB 0644
posix_types.h File 71 B 0644
processor.h File 4.22 KB 0644
processor_32.h File 4.41 KB 0644
ptrace.h File 3.74 KB 0644
ptrace_32.h File 307 B 0644
push-switch.h File 755 B 0644
reboot.h File 472 B 0644
romimage-macros.h File 1.1 KB 0644
rtc.h File 226 B 0644
seccomp.h File 546 B 0644
sections.h File 311 B 0644
setup.h File 764 B 0644
sfp-machine.h File 2.7 KB 0644
sh7760fb.h File 5.61 KB 0644
sh_bios.h File 743 B 0644
shmparam.h File 489 B 0644
siu.h File 385 B 0644
smc37c93x.h File 5.56 KB 0644
smp-ops.h File 1.02 KB 0644
smp.h File 1.8 KB 0644
sparsemem.h File 319 B 0644
spi.h File 265 B 0644
spinlock-cas.h File 1.95 KB 0644
spinlock-llsc.h File 4.05 KB 0644
spinlock.h File 438 B 0644
spinlock_types.h File 469 B 0644
sram.h File 670 B 0644
stackprotector.h File 532 B 0644
stacktrace.h File 528 B 0644
string.h File 66 B 0644
string_32.h File 2.16 KB 0644
suspend.h File 2.52 KB 0644
switch_to.h File 190 B 0644
switch_to_32.h File 3.55 KB 0644
syscall.h File 201 B 0644
syscall_32.h File 1.59 KB 0644
syscalls.h File 532 B 0644
syscalls_32.h File 979 B 0644
thread_info.h File 4.95 KB 0644
timex.h File 637 B 0644
tlb.h File 738 B 0644
tlbflush.h File 1.77 KB 0644
topology.h File 645 B 0644
traps.h File 424 B 0644
traps_32.h File 1.42 KB 0644
types.h File 332 B 0644
uaccess.h File 4.05 KB 0644
uaccess_32.h File 4.89 KB 0644
uncached.h File 1.34 KB 0644
unistd.h File 953 B 0644
unwinder.h File 856 B 0644
user.h File 2.19 KB 0644
vermagic.h File 709 B 0644
vmalloc.h File 84 B 0644
vmlinux.lds.h File 416 B 0644
watchdog.h File 3.89 KB 0644
word-at-a-time.h File 1.34 KB 0644
Filemanager