lib/bcd.c
Source file repositories/reference/linux-study-clean/lib/bcd.c
File Facts
- System
- Linux kernel
- Corpus path
lib/bcd.c- Extension
.c- Size
- 338 bytes
- Lines
- 18
- Domain
- Kernel Services
- Bucket
- lib
- Inferred role
- Kernel Services: exported/initcall integration point
- Status
- integration implementation candidate
Why This File Exists
Shared kernel service surface used by multiple subsystems, including helpers, cryptography, virtualization support, and async I/O infrastructure.
- Shared kernel service surface used by multiple subsystems, including helpers, cryptography, virtualization support, and async I/O infrastructure.
- Exports symbols or registers init work; inspect boot/module ordering and who consumes the exported contract.
Dependency Surface
linux/bcd.hlinux/export.h
Detected Declarations
function _bcd2binfunction _bin2bcdexport _bcd2binexport _bin2bcd
Annotated Snippet
// SPDX-License-Identifier: GPL-2.0
#include <linux/bcd.h>
#include <linux/export.h>
unsigned _bcd2bin(unsigned char val)
{
return (val & 0x0f) + (val >> 4) * 10;
}
EXPORT_SYMBOL(_bcd2bin);
unsigned char _bin2bcd(unsigned val)
{
const unsigned int t = (val * 103) >> 10;
return (t << 4) | (val - t * 10);
}
EXPORT_SYMBOL(_bin2bcd);
Annotation
- Immediate include surface: `linux/bcd.h`, `linux/export.h`.
- Detected declarations: `function _bcd2bin`, `function _bin2bcd`, `export _bcd2bin`, `export _bin2bcd`.
- Atlas domain: Kernel Services / lib.
- 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.