arch/powerpc/platforms/pseries/dlpar.c
Source file repositories/reference/linux-study-clean/arch/powerpc/platforms/pseries/dlpar.c
File Facts
- System
- Linux kernel
- Corpus path
arch/powerpc/platforms/pseries/dlpar.c- Extension
.c- Size
- 16820 bytes
- Lines
- 829
- Domain
- Architecture Layer
- Bucket
- arch/powerpc
- 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.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/kernel.hlinux/notifier.hlinux/spinlock.hlinux/cpu.hlinux/slab.hlinux/sysfs.hlinux/of.hof_helpers.hpseries.hasm/machdep.hlinux/uaccess.hasm/rtas.hasm/rtas-work-area.hasm/prom.h
Detected Declarations
struct pseries_hp_workstruct cc_workareafunction dlpar_free_cc_propertyfunction dlpar_free_one_cc_nodefunction dlpar_free_cc_nodesfunction dlpar_attach_nodefunction dlpar_detach_nodefunction dlpar_changeset_attach_cc_nodesfunction dlpar_acquire_drcfunction dlpar_release_drcfunction dlpar_unisolate_drcfunction get_device_node_with_drc_indexfunction for_each_node_with_propertyfunction get_device_node_with_drc_infofunction for_each_node_with_propertyfunction get_device_node_with_drc_indexesfunction for_each_node_with_propertyfunction dlpar_hp_dt_addfunction changeset_detach_node_recursivefunction for_each_child_of_nodefunction dlpar_hp_dt_removefunction for_each_node_with_propertyfunction dlpar_hp_dtfunction handle_dlpar_errorlogfunction pseries_hp_work_fnfunction queue_hotplug_eventfunction dlpar_parse_resourcefunction dlpar_parse_actionfunction dlpar_parse_id_typefunction dlpar_storefunction dlpar_showfunction dlpar_workqueue_initfunction dlpar_sysfs_init
Annotated Snippet
struct pseries_hp_work {
struct work_struct work;
struct pseries_hp_errorlog *errlog;
};
struct cc_workarea {
__be32 drc_index;
__be32 zero;
__be32 name_offset;
__be32 prop_length;
__be32 prop_offset;
};
void dlpar_free_cc_property(struct property *prop)
{
kfree(prop->name);
kfree(prop->value);
kfree(prop);
}
static struct property *dlpar_parse_cc_property(struct cc_workarea *ccwa)
{
struct property *prop;
char *name;
char *value;
prop = kzalloc_obj(*prop);
if (!prop)
return NULL;
name = (char *)ccwa + be32_to_cpu(ccwa->name_offset);
prop->name = kstrdup(name, GFP_KERNEL);
if (!prop->name) {
dlpar_free_cc_property(prop);
return NULL;
}
prop->length = be32_to_cpu(ccwa->prop_length);
value = (char *)ccwa + be32_to_cpu(ccwa->prop_offset);
prop->value = kmemdup(value, prop->length, GFP_KERNEL);
if (!prop->value) {
dlpar_free_cc_property(prop);
return NULL;
}
return prop;
}
static struct device_node *dlpar_parse_cc_node(struct cc_workarea *ccwa)
{
struct device_node *dn;
const char *name;
dn = kzalloc_obj(*dn);
if (!dn)
return NULL;
name = (const char *)ccwa + be32_to_cpu(ccwa->name_offset);
dn->full_name = kstrdup(name, GFP_KERNEL);
if (!dn->full_name) {
kfree(dn);
return NULL;
}
of_node_set_flag(dn, OF_DYNAMIC);
of_node_init(dn);
return dn;
}
static void dlpar_free_one_cc_node(struct device_node *dn)
{
struct property *prop;
while (dn->properties) {
prop = dn->properties;
dn->properties = prop->next;
dlpar_free_cc_property(prop);
}
kfree(dn->full_name);
kfree(dn);
}
void dlpar_free_cc_nodes(struct device_node *dn)
{
if (dn->child)
dlpar_free_cc_nodes(dn->child);
if (dn->sibling)
Annotation
- Immediate include surface: `linux/kernel.h`, `linux/notifier.h`, `linux/spinlock.h`, `linux/cpu.h`, `linux/slab.h`, `linux/sysfs.h`, `linux/of.h`, `of_helpers.h`.
- Detected declarations: `struct pseries_hp_work`, `struct cc_workarea`, `function dlpar_free_cc_property`, `function dlpar_free_one_cc_node`, `function dlpar_free_cc_nodes`, `function dlpar_attach_node`, `function dlpar_detach_node`, `function dlpar_changeset_attach_cc_nodes`, `function dlpar_acquire_drc`, `function dlpar_release_drc`.
- Atlas domain: Architecture Layer / arch/powerpc.
- 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.