cregit-Linux how code gets into the kernel

Release 4.7 include/linux/highmem.h

Directory: include/linux
#ifndef _LINUX_HIGHMEM_H

#define _LINUX_HIGHMEM_H

#include <linux/fs.h>
#include <linux/kernel.h>
#include <linux/bug.h>
#include <linux/mm.h>
#include <linux/uaccess.h>
#include <linux/hardirq.h>

#include <asm/cacheflush.h>

#ifndef ARCH_HAS_FLUSH_ANON_PAGE

static inline void flush_anon_page(struct vm_area_struct *vma, struct page *page, unsigned long vmaddr) { }

Contributors

PersonTokensPropCommitsCommitProp
james bottomleyjames bottomley1575.00%150.00%
russell kingrussell king525.00%150.00%
Total20100.00%2100.00%

#endif #ifndef ARCH_HAS_FLUSH_KERNEL_DCACHE_PAGE
static inline void flush_kernel_dcache_page(struct page *page) { }

Contributors

PersonTokensPropCommitsCommitProp
james bottomleyjames bottomley11100.00%1100.00%
Total11100.00%1100.00%


static inline void flush_kernel_vmap_range(void *vaddr, int size) { }

Contributors

PersonTokensPropCommitsCommitProp
james bottomleyjames bottomley13100.00%1100.00%
Total13100.00%1100.00%


static inline void invalidate_kernel_vmap_range(void *vaddr, int size) { }

Contributors

PersonTokensPropCommitsCommitProp
james bottomleyjames bottomley13100.00%1100.00%
Total13100.00%1100.00%

#endif #include <asm/kmap_types.h> #ifdef CONFIG_HIGHMEM #include <asm/highmem.h> /* declarations for linux/mm/highmem.c */ unsigned int nr_free_highpages(void); extern unsigned long totalhigh_pages; void kmap_flush_unused(void); struct page *kmap_to_page(void *addr); #else /* CONFIG_HIGHMEM */
static inline unsigned int nr_free_highpages(void) { return 0; }

Contributors

PersonTokensPropCommitsCommitProp
pre-gitpre-git13100.00%2100.00%
Total13100.00%2100.00%


static inline struct page *kmap_to_page(void *addr) { return virt_to_page(addr); }

Contributors

PersonTokensPropCommitsCommitProp
mel gormanmel gorman19100.00%1100.00%
Total19100.00%1100.00%

#define totalhigh_pages 0UL #ifndef ARCH_HAS_KMAP
static inline void *kmap(struct page *page) { might_sleep(); return page_address(page); }

Contributors

PersonTokensPropCommitsCommitProp
pre-gitpre-git1986.36%375.00%
andrew mortonandrew morton313.64%125.00%
Total22100.00%4100.00%


static inline void kunmap(struct page *page) { }

Contributors

PersonTokensPropCommitsCommitProp
matthew wilcoxmatthew wilcox763.64%133.33%
pre-gitpre-git436.36%266.67%
Total11100.00%3100.00%


static inline void *kmap_atomic(struct page *page) { preempt_disable(); pagefault_disable(); return page_address(page); }

Contributors

PersonTokensPropCommitsCommitProp
geert uytterhoevengeert uytterhoeven1872.00%125.00%
david hildenbranddavid hildenbrand312.00%125.00%
pre-gitpre-git312.00%125.00%
americo wangamerico wang14.00%125.00%
Total25100.00%4100.00%

#define kmap_atomic_prot(page, prot) kmap_atomic(page)
static inline void __kunmap_atomic(void *addr) { pagefault_enable(); preempt_enable(); }

Contributors

PersonTokensPropCommitsCommitProp
andi kleenandi kleen1058.82%120.00%
david hildenbranddavid hildenbrand317.65%120.00%
pre-gitpre-git211.76%120.00%
peter zijlstrapeter zijlstra15.88%120.00%
andrew mortonandrew morton15.88%120.00%
Total17100.00%5100.00%

#define kmap_atomic_pfn(pfn) kmap_atomic(pfn_to_page(pfn)) #define kmap_flush_unused() do {} while(0) #endif #endif /* CONFIG_HIGHMEM */ #if defined(CONFIG_HIGHMEM) || defined(CONFIG_X86_32) DECLARE_PER_CPU(int, __kmap_atomic_idx);
static inline int kmap_atomic_idx_push(void) { int idx = __this_cpu_inc_return(__kmap_atomic_idx) - 1; #ifdef CONFIG_DEBUG_HIGHMEM WARN_ON_ONCE(in_irq() && !irqs_disabled()); BUG_ON(idx >= KM_TYPE_NR); #endif return idx; }

Contributors

PersonTokensPropCommitsCommitProp
peter zijlstrapeter zijlstra4090.91%133.33%
christoph lameterchristoph lameter36.82%133.33%
chintan pandyachintan pandya12.27%133.33%
Total44100.00%3100.00%


static inline int kmap_atomic_idx(void) { return __this_cpu_read(__kmap_atomic_idx) - 1; }

Contributors

PersonTokensPropCommitsCommitProp
peter zijlstrapeter zijlstra1694.12%150.00%
christoph lameterchristoph lameter15.88%150.00%
Total17100.00%2100.00%


static inline void kmap_atomic_idx_pop(void) { #ifdef CONFIG_DEBUG_HIGHMEM int idx = __this_cpu_dec_return(__kmap_atomic_idx); BUG_ON(idx < 0); #else __this_cpu_dec(__kmap_atomic_idx); #endif }

Contributors

PersonTokensPropCommitsCommitProp
peter zijlstrapeter zijlstra2466.67%150.00%
christoph lameterchristoph lameter1233.33%150.00%
Total36100.00%2100.00%

#endif /* * Prevent people trying to call kunmap_atomic() as if it were kunmap() * kunmap_atomic() should get the return value of kmap_atomic, not the page. */ #define kunmap_atomic(addr) \ do { \ BUILD_BUG_ON(__same_type((addr), struct page *)); \ __kunmap_atomic(addr); \ } while (0) /* when CONFIG_HIGHMEM is not set these will be plain clear/copy_page */ #ifndef clear_user_highpage
static inline void clear_user_highpage(struct page *page, unsigned long vaddr) { void *addr = kmap_atomic(page); clear_user_page(addr, vaddr, page); kunmap_atomic(addr); }

Contributors

PersonTokensPropCommitsCommitProp
pre-gitpre-git2666.67%250.00%
linus torvaldslinus torvalds1128.21%125.00%
david mosbergerdavid mosberger25.13%125.00%
Total39100.00%4100.00%

#endif #ifndef __HAVE_ARCH_ALLOC_ZEROED_USER_HIGHPAGE /** * __alloc_zeroed_user_highpage - Allocate a zeroed HIGHMEM page for a VMA with caller-specified movable GFP flags * @movableflags: The GFP flags related to the pages future ability to move like __GFP_MOVABLE * @vma: The VMA the page is to be allocated for * @vaddr: The virtual address the page will be inserted into * * This function will allocate a page for a VMA but the caller is expected * to specify via movableflags whether the page will be movable in the * future or not * * An architecture may override this function by defining * __HAVE_ARCH_ALLOC_ZEROED_USER_HIGHPAGE and providing their own * implementation. */
static inline struct page * __alloc_zeroed_user_highpage(gfp_t movableflags, struct vm_area_struct *vma, unsigned long vaddr) { struct page *page = alloc_page_vma(GFP_HIGHUSER | movableflags, vma, vaddr); if (page) clear_user_highpage(page, vaddr); return page; }

Contributors

PersonTokensPropCommitsCommitProp
christoph lameterchristoph lameter4180.39%133.33%
mel gormanmel gorman611.76%133.33%
michael ellermanmichael ellerman47.84%133.33%
Total51100.00%3100.00%

#endif /** * alloc_zeroed_user_highpage_movable - Allocate a zeroed HIGHMEM page for a VMA that the caller knows can move * @vma: The VMA the page is to be allocated for * @vaddr: The virtual address the page will be inserted into * * This function will allocate a page for a VMA that the caller knows will * be able to migrate in the future using move_pages() or reclaimed */
static inline struct page * alloc_zeroed_user_highpage_movable(struct vm_area_struct *vma, unsigned long vaddr) { return __alloc_zeroed_user_highpage(__GFP_MOVABLE, vma, vaddr); }

Contributors

PersonTokensPropCommitsCommitProp
mel gormanmel gorman28100.00%1100.00%
Total28100.00%1100.00%


static inline void clear_highpage(struct page *page) { void *kaddr = kmap_atomic(page); clear_page(kaddr); kunmap_atomic(kaddr); }

Contributors

PersonTokensPropCommitsCommitProp
pre-gitpre-git2064.52%266.67%
ingo molnaringo molnar1135.48%133.33%
Total31100.00%3100.00%


static inline void zero_user_segments(struct page *page, unsigned start1, unsigned end1, unsigned start2, unsigned end2) { void *kaddr = kmap_atomic(page); BUG_ON(end1 > PAGE_SIZE || end2 > PAGE_SIZE); if (end1 > start1) memset(kaddr + start1, 0, end1 - start1); if (end2 > start2) memset(kaddr + start2, 0, end2 - start2); kunmap_atomic(kaddr); flush_dcache_page(page); }

Contributors

PersonTokensPropCommitsCommitProp
christoph lameterchristoph lameter8693.48%150.00%
nate diller*nate diller*66.52%150.00%
Total92100.00%2100.00%


static inline void zero_user_segment(struct page *page, unsigned start, unsigned end) { zero_user_segments(page, start, end, 0, 0); }

Contributors

PersonTokensPropCommitsCommitProp
christoph lameterchristoph lameter31100.00%1100.00%
Total31100.00%1100.00%


static inline void zero_user(struct page *page, unsigned start, unsigned size) { zero_user_segments(page, start, start + size, 0, 0); }

Contributors

PersonTokensPropCommitsCommitProp
christoph lameterchristoph lameter33100.00%1100.00%
Total33100.00%1100.00%

#ifndef __HAVE_ARCH_COPY_USER_HIGHPAGE
static inline void copy_user_highpage(struct page *to, struct page *from, unsigned long vaddr, struct vm_area_struct *vma) { char *vfrom, *vto; vfrom = kmap_atomic(from); vto = kmap_atomic(to); copy_user_page(vto, vfrom, vaddr, to); kunmap_atomic(vto); kunmap_atomic(vfrom); }

Contributors

PersonTokensPropCommitsCommitProp
pre-gitpre-git5580.88%342.86%
atsushi nemotoatsushi nemoto57.35%114.29%
linus torvaldslinus torvalds45.88%114.29%
peter zijlstrapeter zijlstra22.94%114.29%
david mosbergerdavid mosberger22.94%114.29%
Total68100.00%7100.00%

#endif
static inline void copy_highpage(struct page *to, struct page *from) { char *vfrom, *vto; vfrom = kmap_atomic(from); vto = kmap_atomic(to); copy_page(vto, vfrom); kunmap_atomic(vto); kunmap_atomic(vfrom); }

Contributors

PersonTokensPropCommitsCommitProp
andrew mortonandrew morton5396.36%150.00%
peter zijlstrapeter zijlstra23.64%150.00%
Total55100.00%2100.00%

#endif /* _LINUX_HIGHMEM_H */

Overall Contributors

PersonTokensPropCommitsCommitProp
christoph lameterchristoph lameter22025.88%47.14%
pre-gitpre-git16519.41%916.07%
peter zijlstrapeter zijlstra11113.06%58.93%
james bottomleyjames bottomley677.88%47.14%
mel gormanmel gorman657.65%23.57%
andrew mortonandrew morton607.06%47.14%
linus torvaldslinus torvalds222.59%23.57%
jeremy fitzhardingejeremy fitzhardinge192.24%11.79%
geert uytterhoevengeert uytterhoeven182.12%11.79%
ingo molnaringo molnar111.29%11.79%
russell kingrussell king101.18%23.57%
atsushi nemotoatsushi nemoto101.18%23.57%
andi kleenandi kleen101.18%11.79%
americo wangamerico wang80.94%35.36%
matthew wilcoxmatthew wilcox70.82%11.79%
david hildenbranddavid hildenbrand60.71%11.79%
cesar eduardo barroscesar eduardo barros60.71%11.79%
nate diller*nate diller*60.71%11.79%
vivek goyalvivek goyal60.71%11.79%
michael ellermanmichael ellerman40.47%11.79%
david mosbergerdavid mosberger40.47%11.79%
richard hendersonrichard henderson30.35%11.79%
kumar galakumar gala30.35%11.79%
catalin marinascatalin marinas30.35%11.79%
akinobu mitaakinobu mita20.24%11.79%
chintan pandyachintan pandya10.12%11.79%
paul gortmakerpaul gortmaker10.12%11.79%
andreas fenkartandreas fenkart10.12%11.79%
dave jonesdave jones10.12%11.79%
Total850100.00%56100.00%
Directory: include/linux
Information contained on this website is for historical information purposes only and does not indicate or represent copyright ownership.
{% endraw %}