cregit-Linux how code gets into the kernel

Release 4.10 arch/mips/mm/highmem.c

Directory: arch/mips/mm
#include <linux/compiler.h>
#include <linux/init.h>
#include <linux/export.h>
#include <linux/highmem.h>
#include <linux/sched.h>
#include <linux/smp.h>
#include <asm/fixmap.h>
#include <asm/tlbflush.h>


static pte_t *kmap_pte;



unsigned long highstart_pfn, highend_pfn;


void *kmap(struct page *page) { void *addr; might_sleep(); if (!PageHighMem(page)) return page_address(page); addr = kmap_high(page); flush_tlb_one((unsigned long)addr); return addr; }

Contributors

PersonTokensPropCommitsCommitProp
ralf baechleralf baechle4588.24%125.00%
dave hansendave hansen47.84%125.00%
peter zijlstrapeter zijlstra11.96%125.00%
andrew mortonandrew morton11.96%125.00%
Total51100.00%4100.00%

EXPORT_SYMBOL(kmap);
void kunmap(struct page *page) { BUG_ON(in_interrupt()); if (!PageHighMem(page)) return; kunmap_high(page); }

Contributors

PersonTokensPropCommitsCommitProp
ralf baechleralf baechle2583.33%250.00%
dave hansendave hansen413.33%125.00%
peter zijlstrapeter zijlstra13.33%125.00%
Total30100.00%4100.00%

EXPORT_SYMBOL(kunmap); /* * kmap_atomic/kunmap_atomic is significantly faster than kmap/kunmap because * no global lock is needed and because the kmap code must perform a global TLB * invalidation when the kmap pool wraps. * * However when holding an atomic kmap is is not legal to sleep, so atomic * kmaps are appropriate for short, tight code paths only. */
void *kmap_atomic(struct page *page) { unsigned long vaddr; int idx, type; preempt_disable(); pagefault_disable(); if (!PageHighMem(page)) return page_address(page); type = kmap_atomic_idx_push(); idx = type + KM_TYPE_NR*smp_processor_id(); vaddr = __fix_to_virt(FIX_KMAP_BEGIN + idx); #ifdef CONFIG_DEBUG_HIGHMEM BUG_ON(!pte_none(*(kmap_pte - idx))); #endif set_pte(kmap_pte-idx, mk_pte(page, PAGE_KERNEL)); local_flush_tlb_one((unsigned long)vaddr); return (void*) vaddr; }

Contributors

PersonTokensPropCommitsCommitProp
ralf baechleralf baechle9383.04%333.33%
peter zijlstrapeter zijlstra98.04%222.22%
dave hansendave hansen43.57%111.11%
david hildenbranddavid hildenbrand32.68%111.11%
akinobu mitaakinobu mita21.79%111.11%
americo wangamerico wang10.89%111.11%
Total112100.00%9100.00%

EXPORT_SYMBOL(kmap_atomic);
void __kunmap_atomic(void *kvaddr) { unsigned long vaddr = (unsigned long) kvaddr & PAGE_MASK; int type __maybe_unused; if (vaddr < FIXADDR_START) { // FIXME pagefault_enable(); preempt_enable(); return; } type = kmap_atomic_idx(); #ifdef CONFIG_DEBUG_HIGHMEM { int idx = type + KM_TYPE_NR * smp_processor_id(); BUG_ON(vaddr != __fix_to_virt(FIX_KMAP_BEGIN + idx)); /* * force other mappings to Oops if they'll try to access * this pte without first remap it */ pte_clear(&init_mm, vaddr, kmap_pte-idx); local_flush_tlb_one(vaddr); } #endif kmap_atomic_idx_pop(); pagefault_enable(); preempt_enable(); }

Contributors

PersonTokensPropCommitsCommitProp
ralf baechleralf baechle5957.84%333.33%
peter zijlstrapeter zijlstra2827.45%333.33%
david hildenbranddavid hildenbrand65.88%111.11%
david s. millerdavid s. miller54.90%111.11%
andrew mortonandrew morton43.92%111.11%
Total102100.00%9100.00%

EXPORT_SYMBOL(__kunmap_atomic); /* * This is the same as kmap_atomic() but can map memory that doesn't * have a struct page associated with it. */
void *kmap_atomic_pfn(unsigned long pfn) { unsigned long vaddr; int idx, type; preempt_disable(); pagefault_disable(); type = kmap_atomic_idx_push(); idx = type + KM_TYPE_NR*smp_processor_id(); vaddr = __fix_to_virt(FIX_KMAP_BEGIN + idx); set_pte(kmap_pte-idx, pfn_pte(pfn, PAGE_KERNEL)); flush_tlb_one(vaddr); return (void*) vaddr; }

Contributors

PersonTokensPropCommitsCommitProp
ralf baechleralf baechle6081.08%233.33%
peter zijlstrapeter zijlstra912.16%233.33%
david hildenbranddavid hildenbrand34.05%116.67%
akinobu mitaakinobu mita22.70%116.67%
Total74100.00%6100.00%


void __init kmap_init(void) { unsigned long kmap_vstart; /* cache the first kmap pte */ kmap_vstart = __fix_to_virt(FIX_KMAP_BEGIN); kmap_pte = kmap_get_fixmap_pte(kmap_vstart); }

Contributors

PersonTokensPropCommitsCommitProp
ralf baechleralf baechle27100.00%2100.00%
Total27100.00%2100.00%


Overall Contributors

PersonTokensPropCommitsCommitProp
ralf baechleralf baechle35478.15%631.58%
peter zijlstrapeter zijlstra5111.26%315.79%
david hildenbranddavid hildenbrand122.65%15.26%
dave hansendave hansen122.65%15.26%
andrew mortonandrew morton61.32%315.79%
david s. millerdavid s. miller51.10%15.26%
akinobu mitaakinobu mita40.88%15.26%
paul gortmakerpaul gortmaker40.88%15.26%
yoichi yuasayoichi yuasa30.66%15.26%
americo wangamerico wang20.44%15.26%
Total453100.00%19100.00%
Directory: arch/mips/mm
Information contained on this website is for historical information purposes only and does not indicate or represent copyright ownership.