Changeset View
Changeset View
Standalone View
Standalone View
sys/tools/fw_stub.awk
Show First 20 Lines • Show All 137 Lines • ▼ Show 20 Lines | |||||
printc("#include <sys/systm.h>\n"); | printc("#include <sys/systm.h>\n"); | ||||
if (opt_l) { | if (opt_l) { | ||||
printc("static long " opt_l "_license_ack = 0;"); | printc("static long " opt_l "_license_ack = 0;"); | ||||
} | } | ||||
for (file_i = 0; file_i < num_files; file_i++) { | for (file_i = 0; file_i < num_files; file_i++) { | ||||
symb = filenames[file_i]; | symb = filenames[file_i]; | ||||
# '-', '.' and '/' are converted to '_' | # '-', '.', '/', and '@' are converted to '_' | ||||
gsub(/-|\.|\//, "_", symb); | gsub(/-|\.|\/|@/, "_", symb); | ||||
printc("extern char _binary_" symb "_start[], _binary_" symb "_end[];"); | printc("extern char _binary_" symb "_start[], _binary_" symb "_end[];"); | ||||
} | } | ||||
printc("\nstatic int\n"\ | printc("\nstatic int\n"\ | ||||
modname "_fw_modevent(module_t mod, int type, void *unused)\ | modname "_fw_modevent(module_t mod, int type, void *unused)\ | ||||
{\ | {\ | ||||
const struct firmware *fp;"); | const struct firmware *fp;"); | ||||
if (num_files > 1) | if (num_files > 1) | ||||
Show All 11 Lines | if (!" opt_l "_license_ack) {\ | ||||
return(EPERM);\ | return(EPERM);\ | ||||
}\n"); | }\n"); | ||||
} | } | ||||
for (file_i = 0; file_i < num_files; file_i++) { | for (file_i = 0; file_i < num_files; file_i++) { | ||||
short = shortnames[file_i]; | short = shortnames[file_i]; | ||||
symb = filenames[file_i]; | symb = filenames[file_i]; | ||||
version = versions[file_i]; | version = versions[file_i]; | ||||
# '-', '.' and '/' are converted to '_' | # '-', '.', '/', and '@' are converted to '_' | ||||
gsub(/-|\.|\//, "_", symb); | gsub(/-|\.|\/|@/, "_", symb); | ||||
reg = "\t\tfp = "; | reg = "\t\tfp = "; | ||||
reg = reg "firmware_register(\"" short "\", _binary_" symb "_start , "; | reg = reg "firmware_register(\"" short "\", _binary_" symb "_start , "; | ||||
reg = reg "(size_t)(_binary_" symb "_end - _binary_" symb "_start), "; | reg = reg "(size_t)(_binary_" symb "_end - _binary_" symb "_start), "; | ||||
reg = reg version ", "; | reg = reg version ", "; | ||||
if (file_i == 0) | if (file_i == 0) | ||||
reg = reg "NULL);"; | reg = reg "NULL);"; | ||||
▲ Show 20 Lines • Show All 56 Lines • Show Last 20 Lines |