tools/power/acpi/tools/acpidump/apmain.c
Source file repositories/reference/linux-study-clean/tools/power/acpi/tools/acpidump/apmain.c
File Facts
- System
- Linux kernel
- Corpus path
tools/power/acpi/tools/acpidump/apmain.c- Extension
.c- Size
- 8785 bytes
- Lines
- 367
- 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
acpidump.h
Detected Declarations
function ap_display_usagefunction ap_insert_actionfunction ap_do_options
Annotated Snippet
switch (j) {
/*
* Global options
*/
case 'b': /* Dump all input tables to binary files */
gbl_binary_mode = TRUE;
continue;
case 'c': /* Dump customized tables */
if (!strcmp(acpi_gbl_optarg, "on")) {
gbl_dump_customized_tables = TRUE;
} else if (!strcmp(acpi_gbl_optarg, "off")) {
gbl_dump_customized_tables = FALSE;
} else {
fprintf(stderr,
"%s: Cannot handle this switch, please use on|off\n",
acpi_gbl_optarg);
return (-1);
}
continue;
case 'h':
case '?':
ap_display_usage();
return (1);
case 'o': /* Redirect output to a single file */
if (ap_open_output_file(acpi_gbl_optarg)) {
return (-1);
}
continue;
case 'r': /* Dump tables from specified RSDP */
status =
acpi_ut_strtoul64(acpi_gbl_optarg, &gbl_rsdp_base);
if (ACPI_FAILURE(status)) {
fprintf(stderr,
"%s: Could not convert to a physical address\n",
acpi_gbl_optarg);
return (-1);
}
continue;
case 's': /* Print table summaries only */
gbl_summary_mode = TRUE;
continue;
case 'x': /* Do not use XSDT */
if (!acpi_gbl_do_not_use_xsdt) {
acpi_gbl_do_not_use_xsdt = TRUE;
} else {
gbl_do_not_dump_xsdt = TRUE;
}
continue;
case 'v': /* -v: (Version): signon already emitted, just exit */
switch (acpi_gbl_optarg[0]) {
case '^': /* -v: (Version) */
fprintf(stderr,
ACPI_COMMON_SIGNON(AP_UTILITY_NAME));
return (1);
case 'd':
fprintf(stderr,
ACPI_COMMON_SIGNON(AP_UTILITY_NAME));
printf(ACPI_COMMON_BUILD_TIME);
return (1);
default:
printf("Unknown option: -v%s\n",
acpi_gbl_optarg);
return (-1);
}
break;
case 'z': /* Verbose mode */
gbl_verbose_mode = TRUE;
fprintf(stderr, ACPI_COMMON_SIGNON(AP_UTILITY_NAME));
Annotation
- Immediate include surface: `acpidump.h`.
- Detected declarations: `function ap_display_usage`, `function ap_insert_action`, `function ap_do_options`.
- 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.