cregit-Linux how code gets into the kernel

Release 4.11 arch/arm/kernel/io.c

Directory: arch/arm/kernel
#include <linux/export.h>
#include <linux/types.h>
#include <linux/io.h>
#include <linux/spinlock.h>

static DEFINE_RAW_SPINLOCK(__io_lock);

/*
 * Generic atomic MMIO modify.
 *
 * Allows thread-safe access to registers shared by unrelated subsystems.
 * The access is protected by a single MMIO-wide lock.
 */

void atomic_io_modify_relaxed(void __iomem *reg, u32 mask, u32 set) { unsigned long flags; u32 value; raw_spin_lock_irqsave(&__io_lock, flags); value = readl_relaxed(reg) & ~mask; value |= (set & mask); writel_relaxed(value, reg); raw_spin_unlock_irqrestore(&__io_lock, flags); }

Contributors

PersonTokensPropCommitsCommitProp
Ezequiel García64100.00%1100.00%
Total64100.00%1100.00%

EXPORT_SYMBOL(atomic_io_modify_relaxed);
void atomic_io_modify(void __iomem *reg, u32 mask, u32 set) { unsigned long flags; u32 value; raw_spin_lock_irqsave(&__io_lock, flags); value = readl_relaxed(reg) & ~mask; value |= (set & mask); writel(value, reg); raw_spin_unlock_irqrestore(&__io_lock, flags); }

Contributors

PersonTokensPropCommitsCommitProp
Ezequiel García64100.00%1100.00%
Total64100.00%1100.00%

EXPORT_SYMBOL(atomic_io_modify); /* * Copy data from IO memory space to "real" memory space. * This needs to be optimized. */
void _memcpy_fromio(void *to, const volatile void __iomem *from, size_t count) { unsigned char *t = to; while (count) { count--; *t = readb(from); t++; from++; } }

Contributors

PersonTokensPropCommitsCommitProp
Linus Torvalds (pre-git)3571.43%240.00%
Russell King1122.45%240.00%
Ben Dooks36.12%120.00%
Total49100.00%5100.00%

EXPORT_SYMBOL(_memcpy_fromio); /* * Copy data from "real" memory space to IO memory space. * This needs to be optimized. */
void _memcpy_toio(volatile void __iomem *to, const void *from, size_t count) { const unsigned char *f = from; while (count) { count--; writeb(*f, to); f++; to++; } }

Contributors

PersonTokensPropCommitsCommitProp
Linus Torvalds (pre-git)3672.00%350.00%
Russell King1122.00%233.33%
Ben Dooks36.00%116.67%
Total50100.00%6100.00%

EXPORT_SYMBOL(_memcpy_toio); /* * "memset" on IO memory space. * This needs to be optimized. */
void _memset_io(volatile void __iomem *dst, int c, size_t count) { while (count) { count--; writeb(c, dst); dst++; } }

Contributors

PersonTokensPropCommitsCommitProp
Linus Torvalds (pre-git)3288.89%250.00%
Ben Dooks38.33%125.00%
Russell King12.78%125.00%
Total36100.00%4100.00%

EXPORT_SYMBOL(_memset_io);

Overall Contributors

PersonTokensPropCommitsCommitProp
Ezequiel García14847.74%19.09%
Linus Torvalds (pre-git)11838.06%436.36%
Russell King3410.97%436.36%
Ben Dooks92.90%19.09%
Paul Gortmaker10.32%19.09%
Total310100.00%11100.00%
Directory: arch/arm/kernel
Information contained on this website is for historical information purposes only and does not indicate or represent copyright ownership.
Created with cregit.