arch/powerpc/platforms/pseries/rng.c
Source file repositories/reference/linux-study-clean/arch/powerpc/platforms/pseries/rng.c
File Facts
- System
- Linux kernel
- Corpus path
arch/powerpc/platforms/pseries/rng.c- Extension
.c- Size
- 714 bytes
- Lines
- 38
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/kernel.hlinux/of.hasm/archrandom.hasm/machdep.hasm/plpar_wrappers.hpseries.h
Detected Declarations
function pseries_get_random_longfunction pseries_rng_init
Annotated Snippet
// SPDX-License-Identifier: GPL-2.0-or-later
/*
* Copyright 2013, Michael Ellerman, IBM Corporation.
*/
#define pr_fmt(fmt) "pseries-rng: " fmt
#include <linux/kernel.h>
#include <linux/of.h>
#include <asm/archrandom.h>
#include <asm/machdep.h>
#include <asm/plpar_wrappers.h>
#include "pseries.h"
static int pseries_get_random_long(unsigned long *v)
{
unsigned long retbuf[PLPAR_HCALL_BUFSIZE];
if (plpar_hcall(H_RANDOM, retbuf) == H_SUCCESS) {
*v = retbuf[0];
return 1;
}
return 0;
}
void __init pseries_rng_init(void)
{
struct device_node *dn;
dn = of_find_compatible_node(NULL, NULL, "ibm,random");
if (!dn)
return;
ppc_md.get_random_seed = pseries_get_random_long;
of_node_put(dn);
}
Annotation
- Immediate include surface: `linux/kernel.h`, `linux/of.h`, `asm/archrandom.h`, `asm/machdep.h`, `asm/plpar_wrappers.h`, `pseries.h`.
- Detected declarations: `function pseries_get_random_long`, `function pseries_rng_init`.
- 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.