Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:mm\percpu.c Create Date:2022-07-28 14:27:36
Last Modify:2022-05-23 13:52:24 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:per_cpu_ptr_to_phys - convert translated percpu address to physical address*@addr: the address to be converted to physical address* Given @addr which is dereferenceable address obtained via one of* percpu access macros, this function translates it into

Proto:phys_addr_t per_cpu_ptr_to_phys(void *addr)

Type:phys_addr_t

Parameter:

TypeParameterName
void *addr
2063  __percpu * base = UP, it's always identity mapped (he address of the first chunk which starts with the kernel static area )
2064  bool in_first_chunk = false
2078  first_low = he address of the first chunk which starts with the kernel static area + pcpu_unit_page_offset(cpus with the lowest and highest unit addresses , 0)
2080  first_high = he address of the first chunk which starts with the kernel static area + pcpu_unit_page_offset(pcpu_high_unit_cpu, pcpu_unit_pages)
2082  If addr >= first_low && addr < first_high Then
2085  start = per_cpu_ptr(base, cpu)
2087  If addr >= start && addr < start + pcpu_unit_size Then
2088  in_first_chunk = true
2089  Break
2094  If in_first_chunk Then
2095  If Not Determine if an address is within the vmalloc range* On nommu, vmalloc/vfree wrap through kmalloc/kfree directly, so there* is no special casing required. Then Return __pa(addr)
2097  Else Return Change "struct page" to physical address.(Support for virtually mapped pages ) + offset_in_page(addr)
2100  Else Return Change "struct page" to physical address.(pcpu_addr_to_page(addr)) + offset_in_page(addr)
Caller
NameDescribe
get_cpu_gdt_paddrProvide the physical address of the GDT page.