tools/include/tools/dis-asm-compat.h
Source file repositories/reference/linux-study-clean/tools/include/tools/dis-asm-compat.h
File Facts
- System
- Linux kernel
- Corpus path
tools/include/tools/dis-asm-compat.h- Extension
.h- Size
- 1413 bytes
- Lines
- 56
- Domain
- Support Tooling And Documentation
- Bucket
- tools
- Inferred role
- Support Tooling And Documentation: implementation source
- Status
- source implementation candidate
Why This File Exists
Repository support layer: documentation, build tooling, samples, user-space helper tools, generated initramfs support, licenses, and validation utilities.
- Repository support layer: documentation, build tooling, samples, user-space helper tools, generated initramfs support, licenses, and validation utilities.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
stdio.hdis-asm.h
Detected Declarations
enum disassembler_stylefunction init_disassemble_info_compatfunction init_disassemble_info
Annotated Snippet
#ifndef _TOOLS_DIS_ASM_COMPAT_H
#define _TOOLS_DIS_ASM_COMPAT_H
#include <stdio.h>
#include <dis-asm.h>
/* define types for older binutils version, to centralize ifdef'ery a bit */
#ifndef DISASM_INIT_STYLED
enum disassembler_style {DISASSEMBLER_STYLE_NOT_EMPTY};
typedef int (*fprintf_styled_ftype) (void *, enum disassembler_style, const char*, ...);
#endif
/*
* Trivial fprintf wrapper to be used as the fprintf_styled_func argument to
* init_disassemble_info_compat() when normal fprintf suffices.
*/
static inline int fprintf_styled(void *out,
enum disassembler_style style,
const char *fmt, ...)
{
va_list args;
int r;
(void)style;
va_start(args, fmt);
r = vfprintf(out, fmt, args);
va_end(args);
return r;
}
/*
* Wrapper for init_disassemble_info() that hides version
* differences. Depending on binutils version and architecture either
* fprintf_func or fprintf_styled_func will be called.
*/
static inline void init_disassemble_info_compat(struct disassemble_info *info,
void *stream,
fprintf_ftype unstyled_func,
fprintf_styled_ftype styled_func)
{
#ifdef DISASM_INIT_STYLED
init_disassemble_info(info, stream,
unstyled_func,
styled_func);
#else
(void)styled_func;
init_disassemble_info(info, stream,
unstyled_func);
#endif
}
#endif /* _TOOLS_DIS_ASM_COMPAT_H */
Annotation
- Immediate include surface: `stdio.h`, `dis-asm.h`.
- Detected declarations: `enum disassembler_style`, `function init_disassemble_info_compat`, `function init_disassemble_info`.
- Atlas domain: Support Tooling And Documentation / tools.
- 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.