cregit-Linux how code gets into the kernel

Release 4.12 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 Bottomley1575.00%150.00%
Russell 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 Bottomley11100.00%1100.00%
Total11100.00%1100.00%


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

Contributors

PersonTokensPropCommitsCommitProp
James Bottomley13100.00%1100.00%
Total13100.00%1100.00%


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

Contributors

PersonTokensPropCommitsCommitProp
James 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
Linus Torvalds (pre-git)13100.00%2100.00%
Total13100.00%2100.00%


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

Contributors

PersonTokensPropCommitsCommitProp
Mel 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
Linus Torvalds (pre-git)1986.36%375.00%
Andrew Morton313.64%125.00%
Total22100.00%4100.00%


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

Contributors

PersonTokensPropCommitsCommitProp
Matthew Wilcox763.64%133.33%
Linus Torvalds (pre-git)436.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 Uytterhoeven1872.00%125.00%
David Hildenbrand312.00%125.00%
Linus Torvalds (pre-git)312.00%125.00%
Américo 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 Kleen1058.82%120.00%
David Hildenbrand317.65%120.00%
Linus Torvalds (pre-git)211.76%120.00%
Peter Zijlstra15.88%120.00%
Andrew 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 Zijlstra4090.91%133.33%
Christoph Lameter36.82%133.33%
Chintan 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 Zijlstra1694.12%150.00%
Christoph 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 Zijlstra2466.67%150.00%
Christoph 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
Linus Torvalds (pre-git)2666.67%250.00%
Linus Torvalds1128.21%125.00%
David Mosberger-Tang25.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 Lameter4180.39%133.33%
Mel Gorman611.76%133.33%
Michael 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 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
Linus Torvalds (pre-git)2064.52%266.67%
Ingo 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 Lameter92100.00%1100.00%
Total92100.00%1100.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 Lameter2787.10%150.00%
Nate Diller412.90%150.00%
Total31100.00%2100.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 Lameter3193.94%150.00%
Nate Diller26.06%150.00%
Total33100.00%2100.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
Linus Torvalds (pre-git)5580.88%342.86%
Atsushi Nemoto57.35%114.29%
Linus Torvalds45.88%114.29%
David Mosberger-Tang22.94%114.29%
Peter Zijlstra22.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 Morton5396.36%150.00%
Peter Zijlstra23.64%150.00%
Total55100.00%2100.00%

#endif /* _LINUX_HIGHMEM_H */

Overall Contributors

PersonTokensPropCommitsCommitProp
Christoph Lameter22025.88%47.14%
Linus Torvalds (pre-git)16519.41%916.07%
Peter Zijlstra11113.06%58.93%
James Bottomley677.88%47.14%
Mel Gorman657.65%23.57%
Andrew Morton607.06%47.14%
Linus Torvalds222.59%23.57%
Jeremy Fitzhardinge192.24%11.79%
Geert Uytterhoeven182.12%11.79%
Ingo Molnar111.29%11.79%
Andi Kleen101.18%11.79%
Russell King101.18%23.57%
Atsushi Nemoto101.18%23.57%
Américo Wang80.94%35.36%
Matthew Wilcox70.82%11.79%
Nate Diller60.71%11.79%
Vivek Goyal60.71%11.79%
David Hildenbrand60.71%11.79%
Cesar Eduardo Barros40.47%11.79%
David Mosberger-Tang40.47%11.79%
Michael Ellerman40.47%11.79%
Kumar Gala30.35%11.79%
Paul Gortmaker30.35%11.79%
Richard Henderson30.35%11.79%
Catalin Marinas30.35%11.79%
Akinobu Mita20.24%11.79%
Chintan Pandya10.12%11.79%
Dave Jones10.12%11.79%
Andreas Fenkart10.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.
Created with cregit.