arch/sh/mm/consistent.c
Source file repositories/reference/linux-study-clean/arch/sh/mm/consistent.c
File Facts
- System
- Linux kernel
- Corpus path
arch/sh/mm/consistent.c- Extension
.c- Size
- 1580 bytes
- Lines
- 66
- Domain
- Architecture Layer
- Bucket
- arch/sh
- Inferred role
- Architecture Layer: implementation source
- Status
- source 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.
- Touches IRQ or DMA behavior; this matters for the representative real-device path.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/mm.hlinux/init.hlinux/platform_device.hlinux/dma-mapping.hlinux/io.h
Detected Declarations
function Copyrightfunction memchunk_cmdline_overridefunction platform_resource_setup_memory
Annotated Snippet
if (!strncmp(name, p, k) && p[k] == '=') {
p += k + 1;
*sizep = memparse(p, NULL);
pr_info("%s: forcing memory chunk size to 0x%08lx\n",
name, *sizep);
break;
}
}
}
int __init platform_resource_setup_memory(struct platform_device *pdev,
char *name, unsigned long memsize)
{
struct resource *r;
dma_addr_t dma_handle;
void *buf;
r = pdev->resource + pdev->num_resources - 1;
if (r->flags) {
pr_warn("%s: unable to find empty space for resource\n", name);
return -EINVAL;
}
memchunk_cmdline_override(name, &memsize);
if (!memsize)
return 0;
buf = dma_alloc_coherent(&pdev->dev, memsize, &dma_handle, GFP_KERNEL);
if (!buf) {
pr_warn("%s: unable to allocate memory\n", name);
return -ENOMEM;
}
r->flags = IORESOURCE_MEM;
r->start = dma_handle;
r->end = r->start + memsize - 1;
r->name = name;
return 0;
}
Annotation
- Immediate include surface: `linux/mm.h`, `linux/init.h`, `linux/platform_device.h`, `linux/dma-mapping.h`, `linux/io.h`.
- Detected declarations: `function Copyright`, `function memchunk_cmdline_override`, `function platform_resource_setup_memory`.
- Atlas domain: Architecture Layer / arch/sh.
- Implementation status: source implementation candidate.
- IRQ or DMA behavior appears here, which is relevant to the selected PCIe/NVMe device path.
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.