drivers/gpu/drm/radeon/mkregtable.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/radeon/mkregtable.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/radeon/mkregtable.c- Extension
.c- Size
- 6409 bytes
- Lines
- 281
- Domain
- Driver Families
- Bucket
- drivers/gpu
- Inferred role
- Driver Families: implementation source
- Status
- source implementation candidate
Why This File Exists
Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
sys/types.hstdlib.hstring.hstdio.hregex.hlibgen.h
Detected Declarations
struct list_headstruct offsetstruct tablefunction INIT_LIST_HEADfunction __list_addfunction list_add_tailfunction table_offset_addfunction table_initfunction table_printfunction table_buildfunction parser_authfunction main
Annotated Snippet
struct list_head {
struct list_head *next, *prev;
};
static inline void INIT_LIST_HEAD(struct list_head *list)
{
list->next = list;
list->prev = list;
}
/*
* Insert a new entry between two known consecutive entries.
*
* This is only for internal list manipulation where we know
* the prev/next entries already!
*/
#ifndef CONFIG_DEBUG_LIST
static inline void __list_add(struct list_head *new,
struct list_head *prev, struct list_head *next)
{
next->prev = new;
new->next = next;
new->prev = prev;
prev->next = new;
}
#else
extern void __list_add(struct list_head *new,
struct list_head *prev, struct list_head *next);
#endif
/**
* list_add_tail - add a new entry
* @new: new entry to be added
* @head: list head to add it before
*
* Insert a new entry before the specified head.
* This is useful for implementing queues.
*/
static inline void list_add_tail(struct list_head *new, struct list_head *head)
{
__list_add(new, head->prev, head);
}
/**
* list_entry - get the struct for this entry
* @ptr: the &struct list_head pointer.
* @type: the type of the struct this is embedded in.
* @member: the name of the list_head within the struct.
*/
#define list_entry(ptr, type, member) \
container_of(ptr, type, member)
/**
* list_for_each_entry - iterate over list of given type
* @pos: the type * to use as a loop cursor.
* @head: the head for your list.
* @member: the name of the list_head within the struct.
*/
#define list_for_each_entry(pos, head, member) \
for (pos = list_entry((head)->next, typeof(*pos), member); \
&pos->member != (head); \
pos = list_entry(pos->member.next, typeof(*pos), member))
struct offset {
struct list_head list;
unsigned offset;
};
struct table {
struct list_head offsets;
unsigned offset_max;
unsigned nentry;
unsigned *table;
char *gpu_prefix;
};
static struct offset *offset_new(unsigned o)
{
struct offset *offset;
offset = (struct offset *)malloc(sizeof(struct offset));
if (offset) {
INIT_LIST_HEAD(&offset->list);
offset->offset = o;
}
return offset;
}
static void table_offset_add(struct table *t, struct offset *offset)
Annotation
- Immediate include surface: `sys/types.h`, `stdlib.h`, `string.h`, `stdio.h`, `regex.h`, `libgen.h`.
- Detected declarations: `struct list_head`, `struct offset`, `struct table`, `function INIT_LIST_HEAD`, `function __list_add`, `function list_add_tail`, `function table_offset_add`, `function table_init`, `function table_print`, `function table_build`.
- Atlas domain: Driver Families / drivers/gpu.
- Implementation status: source implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.