drivers/scsi/aic7xxx/aicasm/aicasm_macro_gram.y
Source file repositories/reference/linux-study-clean/drivers/scsi/aic7xxx/aicasm/aicasm_macro_gram.y
File Facts
- System
- Linux kernel
- Corpus path
drivers/scsi/aic7xxx/aicasm/aicasm_macro_gram.y- Extension
.y- Size
- 4031 bytes
- Lines
- 163
- Domain
- Driver Families
- Bucket
- drivers/scsi
- Inferred role
- Driver Families: drivers/scsi
- Status
- atlas-only
Why This File Exists
Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
sys/types.hinttypes.hregex.hstdio.hstdlib.hstring.hsysexits.h../queue.haicasm.haicasm_symbol.haicasm_insformat.h
Detected Declarations
function add_macro_argfunction mmerror
Annotated Snippet
if (macro_symbol->info.macroinfo->narg != $4) {
printf("Narg == %d", macro_symbol->info.macroinfo->narg);
stop("Too few arguments for macro invocation",
EX_DATAERR);
/* NOTREACHED */
}
macro_symbol = NULL;
YYACCEPT;
}
;
macro_arglist:
{
/* Macros can take 0 arguments */
$$ = 0;
}
| T_ARG
{
$$ = 1;
add_macro_arg($1, 1);
}
| macro_arglist ',' T_ARG
{
if ($1 == 0) {
stop("Comma without preceding argument in arg list",
EX_DATAERR);
/* NOTREACHED */
}
$$ = $1 + 1;
add_macro_arg($3, $$);
}
;
%%
static void
add_macro_arg(const char *argtext, int argnum)
{
struct macro_arg *marg;
int i;
if (macro_symbol == NULL || macro_symbol->type != MACRO) {
stop("Invalid current symbol for adding macro arg",
EX_SOFTWARE);
/* NOTREACHED */
}
/*
* Macro Invocation. Find the appropriate argument and fill
* in the replace ment text for this call.
*/
i = 0;
STAILQ_FOREACH(marg, ¯o_symbol->info.macroinfo->args, links) {
i++;
if (i == argnum)
break;
}
if (marg == NULL) {
stop("Too many arguments for macro invocation", EX_DATAERR);
/* NOTREACHED */
}
marg->replacement_text = strdup(argtext);
if (marg->replacement_text == NULL) {
stop("Unable to replicate replacement text", EX_SOFTWARE);
/* NOTREACHED */
}
}
void
mmerror(const char *string)
{
Annotation
- Immediate include surface: `sys/types.h`, `inttypes.h`, `regex.h`, `stdio.h`, `stdlib.h`, `string.h`, `sysexits.h`, `../queue.h`.
- Detected declarations: `function add_macro_arg`, `function mmerror`.
- Atlas domain: Driver Families / drivers/scsi.
- Implementation status: atlas-only.
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.