Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:Find empty slot in the resource tree with the given range and* alignment constraints

Proto:static int __find_resource(struct resource *root, struct resource *old, struct resource *new, resource_size_t size, struct resource_constraint *constraint)

Type:int

Parameter:

TypeParameterName
struct resource *root
struct resource *old
struct resource *new
resource_size_tsize
struct resource_constraint *constraint
597  this = child
598  tmp = new
600  start = start
605  If this && start == start Then
606  start = If this == old Then start Else end + 1
607  this = sibling
609  cycle
610  If (this) Then end = If this == old Then end Else start - 1
612  Else end = end
615  If end < start Then Go to next
618  resource_clip( & tmp, min, max)
619  arch_remove_reservations( & tmp)
622  start = @a is a power of 2 value (start, align)
623  end = end
624  flags = flags & ~No address assigned yet
625  If start >= start Then
626  flags = flags
629  end = start + size - 1
632  start = start
633  end = end
634  Return 0
638  :
638  If Not this || end == end Then Break
641  If this != old Then start = end + 1
643  this = sibling
645  Return -EBUSY
Caller
NameDescribe
find_resourceFind empty slot in the resource tree given range and alignment.
reallocate_resourceallocate_resource - allocate a slot in the resource tree given range & alignment