函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:kernel\resource.c Create Date:2022-07-27 10:05:17
Last Modify:2022-05-22 11:14:39 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:__request_region - create a new busy resource region*@parent: parent resource descriptor*@start: resource start address*@n: resource region size*@name: reserving caller's ID string*@flags: IO resource flags

函数原型:struct resource *__request_region(struct resource *parent, resource_size_t start, resource_size_t n, const char *name, int flags)

返回类型:struct resource

参数:

类型参数名称
struct resource *parent
resource_size_tstart
resource_size_tn
const char *name
intflags
1127  DECLARE_WAITQUEUE(wait, 当前进程)
1128  res等于alloc_resource(GFP_KERNEL)
1130  如果非res则返回:NULL
1133  name等于name
1134  start等于start
1135  end等于startn减1
1137  write_lock( & resource_lock)
1139  循环
1142  flags等于resource_type(parent)按位或resource_ext_type(parent)
1143  flags或等于Driver has marked this resource busy 按位或flags
1144  desc等于desc
1146  conflict等于Return the conflict entry if you can't request it
1147  如果非conflict退出
1154  如果desc恒等于IORES_DESC_DEVICE_PRIVATE_MEMORY
1155  打印警告信息("Unaddressable device %s %pR conflicts with %pR", name, conflict, res)
1158  如果conflict不等于parent
1159  如果非flags按位与Driver has marked this resource busy 的值则
1160  parent等于conflict
1161  继续下一循环
1164  如果flags按位与flags按位与Resource is software muxed
1168  schedule()
1171  继续下一循环
1174  free_resource(res)
1175  res = NULL
1176  退出
1178  write_unlock( & resource_lock)
1179  返回:res
调用者
名称描述
__devm_request_region
register_memory_resourceadd this memory to iomem resource