arch/sparc/prom/tree_32.c
Source file repositories/reference/linux-study-clean/arch/sparc/prom/tree_32.c
File Facts
- System
- Linux kernel
- Corpus path
arch/sparc/prom/tree_32.c- Extension
.c- Size
- 7252 bytes
- Lines
- 311
- 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.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/string.hlinux/types.hlinux/kernel.hlinux/sched.hlinux/ctype.hlinux/module.hasm/openprom.hasm/oplib.h
Detected Declarations
function __prom_getchildfunction prom_getchildfunction __prom_getsiblingfunction prom_getsiblingfunction prom_getproplenfunction prom_getpropertyfunction prom_getintfunction prom_getintdefaultfunction prom_getboolfunction prom_getstringfunction prom_searchsiblingsfunction prom_finddevicefunction prom_setpropfunction prom_inst2pkgexport prom_getchildexport prom_getsiblingexport prom_getproplenexport prom_getpropertyexport prom_getintexport prom_getintdefaultexport prom_getboolexport prom_getstringexport prom_searchsiblingsexport prom_nextpropexport prom_finddeviceexport prom_setprop
Annotated Snippet
if (*s == '@') {
if (isxdigit(s[1]) && s[2] == ',') {
which_io = simple_strtoul(s+1, NULL, 16);
phys_addr = simple_strtoul(s+3, &d, 16);
if (d != s + 3 && (!*d || *d == '/')
&& d <= s + 3 + 8) {
node2 = node;
while (node2 && (s32)node2 != -1) {
if (prom_getproperty (node2, "reg", (char *)reg, sizeof (reg)) > 0) {
if (which_io == reg[0].which_io && phys_addr == reg[0].phys_addr) {
node = node2;
break;
}
}
node2 = prom_getsibling(node2);
if (!node2 || (s32)node2 == -1)
break;
node2 = prom_searchsiblings(prom_getsibling(node2), nbuf);
}
}
}
while (*s != 0 && *s != '/') s++;
}
}
return node;
}
EXPORT_SYMBOL(prom_finddevice);
/* Set property 'pname' at node 'node' to value 'value' which has a length
* of 'size' bytes. Return the number of bytes the prom accepted.
*/
int prom_setprop(phandle node, const char *pname, char *value, int size)
{
unsigned long flags;
int ret;
if (size == 0)
return 0;
if ((pname == NULL) || (value == NULL))
return 0;
spin_lock_irqsave(&prom_lock, flags);
ret = prom_nodeops->no_setprop(node, pname, value, size);
restore_current();
spin_unlock_irqrestore(&prom_lock, flags);
return ret;
}
EXPORT_SYMBOL(prom_setprop);
phandle prom_inst2pkg(int inst)
{
phandle node;
unsigned long flags;
spin_lock_irqsave(&prom_lock, flags);
node = (*romvec->pv_v2devops.v2_inst2pkg)(inst);
restore_current();
spin_unlock_irqrestore(&prom_lock, flags);
if ((s32)node == -1)
return 0;
return node;
}
Annotation
- Immediate include surface: `linux/string.h`, `linux/types.h`, `linux/kernel.h`, `linux/sched.h`, `linux/ctype.h`, `linux/module.h`, `asm/openprom.h`, `asm/oplib.h`.
- Detected declarations: `function __prom_getchild`, `function prom_getchild`, `function __prom_getsibling`, `function prom_getsibling`, `function prom_getproplen`, `function prom_getproperty`, `function prom_getint`, `function prom_getintdefault`, `function prom_getbool`, `function prom_getstring`.
- Atlas domain: Architecture Layer / arch/sparc.
- Implementation status: integration implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
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.