Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:kernel\irq\irqdomain.c Create Date:2022-07-28 10:13:41
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:__irq_domain_add() - Allocate a new irq_domain data structure*@fwnode: firmware node for the interrupt controller*@size: Size of linear map; 0 for radix mapping only*@hwirq_max: Maximum number of interrupts supported by controller*@direct_max: Maximum

Proto:struct irq_domain *__irq_domain_add(struct fwnode_handle *fwnode, int size, irq_hw_number_t hwirq_max, int direct_max, const struct irq_domain_ops *ops, void *host_data)

Type:struct irq_domain

Parameter:

TypeParameterName
struct fwnode_handle *fwnode
intsize
irq_hw_number_thwirq_max
intdirect_max
const struct irq_domain_ops *ops
void *host_data
135  of_node = to_of_node(fwnode)
141  domain = kzalloc_node - allocate zeroed memory from a particular memory node.*@size: how many bytes of memory are required.*@flags: the type of memory to allocate (see kmalloc).*@node: memory node from which to allocate
143  If Not domain Then Return NULL
146  If fwnode && is_fwnode_irqchip(fwnode) Then
147  fwid = container_of - cast a member of a structure out to the containing structure*@ptr: the pointer to the member.*@type: the type of the container struct this is embedded in.*@member: the name of the member within the struct.(fwnode, structirqchip_fwid, fwnode)
150  Case type == IRQCHIP_FWNODE_NAMED
154  If Not name Then
159  Break
160  Default
162  name = name
163  Break
180  Else if of_node Then
188  name = kasprintf(GFP_KERNEL, "%pOF", of_node)
189  If Not name Then
191  Return NULL
194  strreplace - Replace all occurrences of character in string.*@s: The string to operate on.*@old: The character being replaced.*@new: The character @old is replaced with.* Returns pointer to the nul byte at the end of @s.
196  name = name
197  Optional data = fwnode
198  host per irq_domain flags |= IRQ_DOMAIN_NAME_ALLOCATED
201  If Not name Then
202  If fwnode Then pr_err("Invalid fwnode type for irqdomain\n")
204  name = kasprintf(GFP_KERNEL, "unknown-%d", atomic_inc_return( & unknown_domains))
206  If Not name Then
208  Return NULL
210  host per irq_domain flags |= IRQ_DOMAIN_NAME_ALLOCATED
213  Dummy ref counting routines - to be implemented later
216  INIT_RADIX_TREE( & revmap_tree, GFP_KERNEL)
217  mutex_init - initialize the mutex*@mutex: the mutex to be initialized* Initialize the mutex to unlocked state.* It is not allowed to initialize an already locked mutex.( & revmap_tree_mutex)
218  ops = ops
219  host_data = host_data
220  reverse map data. The linear map gets appended to the irq_domain = hwirq_max
221  revmap_size = size
222  revmap_direct_max_irq = direct_max
223  irq_domain_check_hierarchy(domain)
225  mutex_lock( & irq_domain_mutex)
226  debugfs_add_domain_dir(domain)
227  list_add - add a new entry*@new: new entry to be added*@head: list head to add it after* Insert a new entry after the specified head.* This is good for implementing stacks.
228  mutex_unlock - release the mutex*@lock: the mutex to be released* Unlock a mutex that has been locked by this task previously.* This function must not be used in interrupt context. Unlocking* of a not locked mutex is not allowed.
230  pr_debug("Added domain %s\n", name)
231  Return domain
Caller
NameDescribe
irq_domain_add_simpleq_domain_add_simple() - Register an irq_domain and optionally map a range of irqs*@of_node: pointer to interrupt controller's device tree node.*@size: total number of irqs in mapping*@first_irq: first number of irq block assigned to the domain,
irq_domain_add_legacyq_domain_add_legacy() - Allocate and register a legacy revmap irq_domain.*@of_node: pointer to interrupt controller's device tree node.*@size: total number of irqs in legacy mapping*@first_irq: first number of irq block assigned to the domain