drivers/video/fbdev/core/fb_procfs.c
Source file repositories/reference/linux-study-clean/drivers/video/fbdev/core/fb_procfs.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/video/fbdev/core/fb_procfs.c- Extension
.c- Size
- 1103 bytes
- Lines
- 63
- Domain
- Driver Families
- Bucket
- drivers/video
- 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.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/proc_fs.hfb_internal.h
Detected Declarations
function fb_seq_stopfunction fb_seq_showfunction fb_init_procfsfunction fb_cleanup_procfs
Annotated Snippet
// SPDX-License-Identifier: GPL-2.0
#include <linux/proc_fs.h>
#include "fb_internal.h"
static struct proc_dir_entry *fb_proc_dir_entry;
static void *fb_seq_start(struct seq_file *m, loff_t *pos)
{
mutex_lock(®istration_lock);
return (*pos < FB_MAX) ? pos : NULL;
}
static void fb_seq_stop(struct seq_file *m, void *v)
{
mutex_unlock(®istration_lock);
}
static void *fb_seq_next(struct seq_file *m, void *v, loff_t *pos)
{
(*pos)++;
return (*pos < FB_MAX) ? pos : NULL;
}
static int fb_seq_show(struct seq_file *m, void *v)
{
int i = *(loff_t *)v;
struct fb_info *fi = registered_fb[i];
if (fi)
seq_printf(m, "%d %s\n", fi->node, fi->fix.id);
return 0;
}
static const struct seq_operations __maybe_unused fb_proc_seq_ops = {
.start = fb_seq_start,
.stop = fb_seq_stop,
.next = fb_seq_next,
.show = fb_seq_show,
};
int fb_init_procfs(void)
{
struct proc_dir_entry *proc;
proc = proc_create_seq("fb", 0, NULL, &fb_proc_seq_ops);
if (!proc)
return -ENOMEM;
fb_proc_dir_entry = proc;
return 0;
}
void fb_cleanup_procfs(void)
{
proc_remove(fb_proc_dir_entry);
}
Annotation
- Immediate include surface: `linux/proc_fs.h`, `fb_internal.h`.
- Detected declarations: `function fb_seq_stop`, `function fb_seq_show`, `function fb_init_procfs`, `function fb_cleanup_procfs`.
- Atlas domain: Driver Families / drivers/video.
- Implementation status: source implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
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.