Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:lib\genalloc.c Create Date:2022-07-28 06:56:53
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:gen_pool_add_owner- add a new chunk of special memory to the pool*@pool: pool to add new memory chunk to*@virt: virtual starting address of memory chunk to add to pool*@phys: physical starting address of memory chunk to add to pool*@size: size in bytes of

Proto:int gen_pool_add_owner(struct gen_pool *pool, unsigned long virt, phys_addr_t phys, size_t size, int nid, void *owner)

Type:int

Parameter:

TypeParameterName
struct gen_pool *pool
unsigned longvirt
phys_addr_tphys
size_tsize
intnid
void *owner
186  nbits = size >> minimum allocation order
187  nbytes = sizeof(structgen_pool_chunk) + BITS_TO_LONGS(nbits) * sizeof(long)
190  chunk = vzalloc_node(nbytes, nid)
191  If Value for the false possibility is greater at compile time(chunk == NULL) Then Return -ENOMEM
194  physical starting address of memory chunk = phys
195  start address of memory chunk = virt
196  d address of memory chunk (inclusive) = virt + size - 1
197  private data to retrieve at alloc time = owner
198  atomic_long_set( & avail, size)
200  spin_lock( & lock)
201  list_add_rcu - add a new entry to rcu-protected list*@new: new entry to be added*@head: list head to add it after* Insert a new entry after the specified head
202  spin_unlock( & lock)
204  Return 0
Caller
NameDescribe
gen_pool_add_virt