arch/parisc/kernel/pdt.c
Source file repositories/reference/linux-study-clean/arch/parisc/kernel/pdt.c
File Facts
- System
- Linux kernel
- Corpus path
arch/parisc/kernel/pdt.c- Extension
.c- Size
- 9270 bytes
- Lines
- 364
- Domain
- Architecture Layer
- Bucket
- arch/parisc
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/memblock.hlinux/seq_file.hlinux/kthread.hlinux/proc_fs.hlinux/initrd.hlinux/pgtable.hlinux/mm.hasm/pdc.hasm/pdcpat.hasm/sections.hasm/pgtable.h
Detected Declarations
enum pdt_access_typefunction errorfunction get_info_pat_newfunction get_info_pat_cellfunction report_mem_errfunction pdc_pdt_initfunction pdt_mainloopfunction pdt_initcall
Annotated Snippet
switch (pdt_type) {
case PDT_PAT_NEW:
ret = get_info_pat_new();
break;
case PDT_PAT_CELL:
ret = get_info_pat_cell();
break;
default:
ret = pdc_mem_pdt_info(&pdt_status);
break;
}
if (ret != PDC_OK) {
pr_warn("PDT: unexpected failure %d\n", ret);
return -EINVAL;
}
/* if no new PDT entries, just wait again */
num = pdt_status.pdt_entries - old_num_entries;
if (num <= 0)
continue;
/* decrease poll interval in case we found memory errors */
if (pdt_status.pdt_entries &&
pdt_poll_interval == PDT_POLL_INTERVAL_DEFAULT)
pdt_poll_interval = PDT_POLL_INTERVAL_SHORT;
/* limit entries to get */
if (num > MAX_PDT_ENTRIES) {
num = MAX_PDT_ENTRIES;
pdt_status.pdt_entries = old_num_entries + num;
}
/* get new entries */
switch (pdt_type) {
#ifdef CONFIG_64BIT
case PDT_PAT_CELL:
if (pdt_status.pdt_entries > MAX_PDT_ENTRIES) {
pr_crit("PDT: too many entries.\n");
return -ENOMEM;
}
ret = pdc_pat_mem_read_cell_pdt(&pat_pret, pdt_entry,
MAX_PDT_ENTRIES);
bad_mem_ptr = &pdt_entry[old_num_entries];
break;
case PDT_PAT_NEW:
ret = pdc_pat_mem_read_pd_pdt(&pat_pret,
pdt_entry,
num * sizeof(unsigned long),
old_num_entries * sizeof(unsigned long));
bad_mem_ptr = &pdt_entry[0];
break;
#endif
default:
ret = pdc_mem_pdt_read_entries(&pdt_read_ret,
pdt_entry);
bad_mem_ptr = &pdt_entry[old_num_entries];
break;
}
/* report and mark memory broken */
while (num--) {
unsigned long pde = *bad_mem_ptr++;
report_mem_err(pde);
#ifdef CONFIG_MEMORY_FAILURE
if ((pde & PDT_ADDR_PERM_ERR) ||
((pde & PDT_ADDR_SINGLE_ERR) == 0))
memory_failure(pde >> PAGE_SHIFT, 0);
else
soft_offline_page(pde >> PAGE_SHIFT, 0);
#else
pr_crit("PDT: memory error at 0x%lx ignored.\n"
"Rebuild kernel with CONFIG_MEMORY_FAILURE=y "
"for real handling.\n",
pde & PDT_ADDR_PHYS_MASK);
#endif
}
}
return 0;
}
static int __init pdt_initcall(void)
{
struct task_struct *kpdtd_task;
Annotation
- Immediate include surface: `linux/memblock.h`, `linux/seq_file.h`, `linux/kthread.h`, `linux/proc_fs.h`, `linux/initrd.h`, `linux/pgtable.h`, `linux/mm.h`, `asm/pdc.h`.
- Detected declarations: `enum pdt_access_type`, `function error`, `function get_info_pat_new`, `function get_info_pat_cell`, `function report_mem_err`, `function pdc_pdt_init`, `function pdt_mainloop`, `function pdt_initcall`.
- Atlas domain: Architecture Layer / arch/parisc.
- 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.