Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:kernel\resource.c Create Date:2022-07-28 09:05:15
Last Modify:2022-05-22 11:14:39 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:allocate_resource - allocate empty slot in the resource tree given range & alignment

Proto:int allocate_resource(struct resource *root, struct resource *new, resource_size_t size, resource_size_t min, resource_size_t max, resource_size_t align, resource_size_tresource_size_tresource_size_t (*alignf)(void *, const struct resource *, , ), void *alignf_data)

Type:int

Parameter:

TypeParameterName
struct resource *root
struct resource *new
resource_size_tsize
resource_size_tmin
resource_size_tmax
resource_size_talign
resource_size_t (*alignf
void *alignf_data
731  If Not alignf Then alignf = simple_align_resource
734  min = min
735  max = max
736  align = align
737  alignf = alignf
738  alignf_data = alignf_data
740  If parent Then
743  Return allocate_resource - allocate a slot in the resource tree given range & alignment
746  write_lock( & resource_lock)
747  err = Find empty slot in the resource tree given range and alignment.
748  If err >= 0 && Return the conflict entry if you can't request it Then err = -EBUSY
750  write_unlock( & resource_lock)
751  Return err