arch/sparc/prom/tree_64.c
Source file repositories/reference/linux-study-clean/arch/sparc/prom/tree_64.c
File Facts
- System
- Linux kernel
- Corpus path
arch/sparc/prom/tree_64.c- Extension
.c- Size
- 8143 bytes
- Lines
- 394
- Domain
- Architecture Layer
- Bucket
- arch/sparc
- 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.
Dependency Surface
linux/string.hlinux/types.hlinux/kernel.hlinux/sched.hlinux/module.hasm/openprom.hasm/oplib.hasm/ldc.h
Detected Declarations
function Copyrightfunction __prom_getchildfunction prom_getchildfunction prom_getparentfunction __prom_getsiblingfunction prom_getsiblingfunction prom_getproplenfunction prom_getpropertyfunction prom_getintfunction prom_getintdefaultfunction prom_getboolfunction prom_getstringfunction prom_nodematchfunction prom_searchsiblingsfunction prom_finddevicefunction prom_node_has_propertyfunction prom_setpropfunction prom_inst2pkgfunction prom_ihandle2pathexport prom_getchildexport prom_getsiblingexport prom_getproplenexport prom_getpropertyexport prom_getintexport prom_getintdefaultexport prom_getboolexport prom_getstringexport prom_searchsiblingsexport prom_firstpropexport prom_nextpropexport prom_finddeviceexport prom_node_has_propertyexport prom_setprop
Annotated Snippet
// SPDX-License-Identifier: GPL-2.0
/*
* tree.c: Basic device tree traversal/scanning for the Linux
* prom library.
*
* Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu)
* Copyright (C) 1996,1997 Jakub Jelinek (jj@sunsite.mff.cuni.cz)
*/
#include <linux/string.h>
#include <linux/types.h>
#include <linux/kernel.h>
#include <linux/sched.h>
#include <linux/module.h>
#include <asm/openprom.h>
#include <asm/oplib.h>
#include <asm/ldc.h>
static phandle prom_node_to_node(const char *type, phandle node)
{
unsigned long args[5];
args[0] = (unsigned long) type;
args[1] = 1;
args[2] = 1;
args[3] = (unsigned int) node;
args[4] = (unsigned long) -1;
p1275_cmd_direct(args);
return (phandle) args[4];
}
/* Return the child of node 'node' or zero if no this node has no
* direct descendent.
*/
inline phandle __prom_getchild(phandle node)
{
return prom_node_to_node("child", node);
}
phandle prom_getchild(phandle node)
{
phandle cnode;
if ((s32)node == -1)
return 0;
cnode = __prom_getchild(node);
if ((s32)cnode == -1)
return 0;
return cnode;
}
EXPORT_SYMBOL(prom_getchild);
inline phandle prom_getparent(phandle node)
{
phandle cnode;
if ((s32)node == -1)
return 0;
cnode = prom_node_to_node("parent", node);
if ((s32)cnode == -1)
return 0;
return cnode;
}
/* Return the next sibling of node 'node' or zero if no more siblings
* at this level of depth in the tree.
*/
inline phandle __prom_getsibling(phandle node)
{
return prom_node_to_node(prom_peer_name, node);
}
phandle prom_getsibling(phandle node)
{
phandle sibnode;
if ((s32)node == -1)
return 0;
sibnode = __prom_getsibling(node);
if ((s32)sibnode == -1)
return 0;
return sibnode;
}
EXPORT_SYMBOL(prom_getsibling);
/* Return the length in bytes of property 'prop' at node 'node'.
Annotation
- Immediate include surface: `linux/string.h`, `linux/types.h`, `linux/kernel.h`, `linux/sched.h`, `linux/module.h`, `asm/openprom.h`, `asm/oplib.h`, `asm/ldc.h`.
- Detected declarations: `function Copyright`, `function __prom_getchild`, `function prom_getchild`, `function prom_getparent`, `function __prom_getsibling`, `function prom_getsibling`, `function prom_getproplen`, `function prom_getproperty`, `function prom_getint`, `function prom_getintdefault`.
- Atlas domain: Architecture Layer / arch/sparc.
- 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.