drivers/scsi/aic7xxx/aicasm/aicasm_symbol.c
Source file repositories/reference/linux-study-clean/drivers/scsi/aic7xxx/aicasm/aicasm_symbol.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/scsi/aic7xxx/aicasm/aicasm_symbol.c- Extension
.c- Size
- 16061 bytes
- Lines
- 691
- Domain
- Driver Families
- Bucket
- drivers/scsi
- Inferred role
- Driver Families: implementation source
- Status
- source implementation candidate
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.
Dependency Surface
sys/types.haicdb.hfcntl.hinttypes.hregex.hstdio.hstdlib.hstring.hsysexits.hctype.haicasm_symbol.haicasm.h
Detected Declarations
function symbol_createfunction symbol_deletefunction symtable_openfunction symtable_closefunction symtable_getfunction symlist_searchfunction symlist_addfunction symlist_freefunction symlist_mergefunction aic_print_file_prologuefunction aic_print_includefunction aic_print_reg_dump_typesfunction aic_print_reg_dump_startfunction aic_print_reg_dump_endfunction aic_print_reg_dump_entryfunction symtable_dumpfunction SLIST_FOREACH
Annotated Snippet
if (symbol->info.finfo != NULL) {
symlist_free(&symbol->info.finfo->symrefs);
free(symbol->info.finfo);
}
break;
case DOWNLOAD_CONST:
case CONST:
if (symbol->info.cinfo != NULL)
free(symbol->info.cinfo);
break;
case LABEL:
if (symbol->info.linfo != NULL)
free(symbol->info.linfo);
break;
case UNINITIALIZED:
default:
break;
}
free(symbol->name);
free(symbol);
}
void
symtable_open()
{
symtable = dbopen(/*filename*/NULL,
O_CREAT | O_NONBLOCK | O_RDWR, /*mode*/0, DB_HASH,
/*openinfo*/NULL);
if (symtable == NULL) {
perror("Symbol table creation failed");
exit(EX_SOFTWARE);
/* NOTREACHED */
}
}
void
symtable_close()
{
if (symtable != NULL) {
DBT key;
DBT data;
while (symtable->seq(symtable, &key, &data, R_FIRST) == 0) {
symbol_t *stored_ptr;
memcpy(&stored_ptr, data.data, sizeof(stored_ptr));
symbol_delete(stored_ptr);
}
symtable->close(symtable);
}
}
/*
* The semantics of get is to return an uninitialized symbol entry
* if a lookup fails.
*/
symbol_t *
symtable_get(char *name)
{
symbol_t *stored_ptr;
DBT key;
DBT data;
int retval;
key.data = (void *)name;
key.size = strlen(name);
if ((retval = symtable->get(symtable, &key, &data, /*flags*/0)) != 0) {
if (retval == -1) {
perror("Symbol table get operation failed");
exit(EX_SOFTWARE);
/* NOTREACHED */
} else if (retval == 1) {
/* Symbol wasn't found, so create a new one */
symbol_t *new_symbol;
new_symbol = symbol_create(name);
data.data = &new_symbol;
data.size = sizeof(new_symbol);
if (symtable->put(symtable, &key, &data,
/*flags*/0) !=0) {
perror("Symtable put failed");
exit(EX_SOFTWARE);
}
return (new_symbol);
} else {
perror("Unexpected return value from db get routine");
exit(EX_SOFTWARE);
/* NOTREACHED */
Annotation
- Immediate include surface: `sys/types.h`, `aicdb.h`, `fcntl.h`, `inttypes.h`, `regex.h`, `stdio.h`, `stdlib.h`, `string.h`.
- Detected declarations: `function symbol_create`, `function symbol_delete`, `function symtable_open`, `function symtable_close`, `function symtable_get`, `function symlist_search`, `function symlist_add`, `function symlist_free`, `function symlist_merge`, `function aic_print_file_prologue`.
- Atlas domain: Driver Families / drivers/scsi.
- 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.