arch/m68k/sun3/sun3dvma.c
Source file repositories/reference/linux-study-clean/arch/m68k/sun3/sun3dvma.c
File Facts
- System
- Linux kernel
- Corpus path
arch/m68k/sun3/sun3dvma.c- Extension
.c- Size
- 6735 bytes
- Lines
- 360
- Domain
- Architecture Layer
- Bucket
- arch/m68k
- Inferred role
- Architecture Layer: exported/initcall integration point
- Status
- integration implementation candidate
Why This File Exists
CPU and platform-specific kernel glue: boot entry, traps, syscall entry, interrupts, page tables, context switch, and low-level barriers.
- CPU and platform-specific kernel glue: boot entry, traps, syscall entry, interrupts, page tables, context switch, and low-level barriers.
- Exports symbols or registers init work; inspect boot/module ordering and who consumes the exported contract.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/memblock.hlinux/init.hlinux/module.hlinux/kernel.hlinux/gfp.hlinux/mm.hlinux/list.hasm/page.hasm/dvma.h
Detected Declarations
struct holefunction print_usefunction print_holesfunction refillfunction list_for_eachfunction get_baddrfunction list_for_eachfunction free_baddrfunction list_for_eachfunction dvma_initfunction dvma_map_alignfunction dvma_unmapfunction dvma_freeexport dvma_map_alignexport dvma_unmapexport dvma_malloc_alignexport dvma_free
Annotated Snippet
struct hole {
unsigned long start;
unsigned long end;
unsigned long size;
struct list_head list;
};
static struct list_head hole_list;
static struct list_head hole_cache;
static struct hole initholes[64];
#ifdef DVMA_DEBUG
static unsigned long dvma_allocs;
static unsigned long dvma_frees;
static unsigned long long dvma_alloc_bytes;
static unsigned long long dvma_free_bytes;
static void print_use(void)
{
int i;
int j = 0;
pr_info("dvma entry usage:\n");
for(i = 0; i < IOMMU_TOTAL_ENTRIES; i++) {
if(!iommu_use[i])
continue;
j++;
pr_info("dvma entry: %08x len %08lx\n",
(i << DVMA_PAGE_SHIFT) + DVMA_START, iommu_use[i]);
}
pr_info("%d entries in use total\n", j);
pr_info("allocation/free calls: %lu/%lu\n", dvma_allocs, dvma_frees);
pr_info("allocation/free bytes: %Lx/%Lx\n", dvma_alloc_bytes,
dvma_free_bytes);
}
static void print_holes(struct list_head *holes)
{
struct list_head *cur;
struct hole *hole;
pr_info("listing dvma holes\n");
list_for_each(cur, holes) {
hole = list_entry(cur, struct hole, list);
if((hole->start == 0) && (hole->end == 0) && (hole->size == 0))
continue;
pr_info("hole: start %08lx end %08lx size %08lx\n",
hole->start, hole->end, hole->size);
}
pr_info("end of hole listing...\n");
}
#endif /* DVMA_DEBUG */
static inline int refill(void)
{
struct hole *hole;
struct hole *prev = NULL;
struct list_head *cur;
int ret = 0;
list_for_each(cur, &hole_list) {
hole = list_entry(cur, struct hole, list);
if(!prev) {
prev = hole;
continue;
}
if(hole->end == prev->start) {
hole->size += prev->size;
hole->end = prev->end;
list_move(&(prev->list), &hole_cache);
ret++;
}
}
return ret;
Annotation
- Immediate include surface: `linux/memblock.h`, `linux/init.h`, `linux/module.h`, `linux/kernel.h`, `linux/gfp.h`, `linux/mm.h`, `linux/list.h`, `asm/page.h`.
- Detected declarations: `struct hole`, `function print_use`, `function print_holes`, `function refill`, `function list_for_each`, `function get_baddr`, `function list_for_each`, `function free_baddr`, `function list_for_each`, `function dvma_init`.
- Atlas domain: Architecture Layer / arch/m68k.
- Implementation status: integration 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.