函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:mm\percpu.c Create Date:2022-07-27 15:52:05
Last Modify:2022-05-23 13:52:24 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称: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

函数原型:phys_addr_t per_cpu_ptr_to_phys(void *addr)

返回类型:phys_addr_t

参数:

类型参数名称
void *addr
2063  __percpubase等于 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  如果addr大于等于first_lowaddr小于first_high
2085  start等于per_cpu_ptr(base, cpu)
2087  如果addr大于等于startaddr小于startpcpu_unit_size
2088  in_first_chunk = true
2089  退出
2094  如果in_first_chunk
2095  如果非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.则返回:__pa(addr)
2097  否则返回:Change "struct page" to physical address.(Support for virtually mapped pages )加offset_in_page(addr)
2100  否则返回:Change "struct page" to physical address.(pcpu_addr_to_page(addr))加offset_in_page(addr)
调用者
名称描述
crash_prepare_elf64_headers
get_cpu_gdt_paddrProvide the physical address of the GDT page.