arch/powerpc/platforms/pseries/vphn.c
Source file repositories/reference/linux-study-clean/arch/powerpc/platforms/pseries/vphn.c
File Facts
- System
- Linux kernel
- Corpus path
arch/powerpc/platforms/pseries/vphn.c- Extension
.c- Size
- 2497 bytes
- Lines
- 91
- Domain
- Architecture Layer
- Bucket
- arch/powerpc
- 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.
Dependency Surface
asm/byteorder.hasm/vphn.hasm/hvcall.h
Detected Declarations
function vphn_unpack_associativityfunction hcall_vphn
Annotated Snippet
if (is_32bit) {
/*
* Let's concatenate the 16 bits of this field to the
* 15 lower bits of the previous field
*/
unpacked[++nr_assoc_doms] =
cpu_to_be32(last << 16 | new);
is_32bit = false;
} else if (new == VPHN_FIELD_UNUSED)
/* This is the list terminator */
break;
else if (new & VPHN_FIELD_MSB) {
/* Data is in the lower 15 bits of this field */
unpacked[++nr_assoc_doms] =
cpu_to_be32(new & VPHN_FIELD_MASK);
} else {
/*
* Data is in the lower 15 bits of this field
* concatenated with the next 16 bit field
*/
last = new;
is_32bit = true;
}
}
/* The first cell contains the length of the property */
unpacked[0] = cpu_to_be32(nr_assoc_doms);
return nr_assoc_doms;
}
/* NOTE: This file is included by a selftest and built in userspace. */
#ifdef __KERNEL__
#include <asm/hvcall.h>
long hcall_vphn(unsigned long cpu, u64 flags, __be32 *associativity)
{
long rc;
long retbuf[PLPAR_HCALL9_BUFSIZE] = {0};
rc = plpar_hcall9(H_HOME_NODE_ASSOCIATIVITY, retbuf, flags, cpu);
if (rc == H_SUCCESS)
vphn_unpack_associativity(retbuf, associativity);
return rc;
}
#endif
Annotation
- Immediate include surface: `asm/byteorder.h`, `asm/vphn.h`, `asm/hvcall.h`.
- Detected declarations: `function vphn_unpack_associativity`, `function hcall_vphn`.
- Atlas domain: Architecture Layer / arch/powerpc.
- 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.