* Release any memory backing unused microcode blobs back to the system. * We copy the selected update and free the entire microcode file. */
| 232 | * We copy the selected update and free the entire microcode file. |
| 233 | */ |
| 234 | static void |
| 235 | ucode_release(void *arg __unused) |
| 236 | { |
| 237 | char *name, *type; |
| 238 | caddr_t file; |
| 239 | int release; |
| 240 | |
| 241 | if (early_ucode_data == NULL) |
| 242 | return; |
| 243 | release = 1; |
| 244 | TUNABLE_INT_FETCH("debug.ucode.release", &release); |
| 245 | if (!release) |
| 246 | return; |
| 247 | |
| 248 | restart: |
| 249 | file = 0; |
| 250 | for (;;) { |
| 251 | file = preload_search_next_name(file); |
| 252 | if (file == 0) |
| 253 | break; |
| 254 | type = (char *)preload_search_info(file, MODINFO_TYPE); |
| 255 | if (type == NULL || strcmp(type, "cpu_microcode") != 0) |
| 256 | continue; |
| 257 | |
| 258 | name = preload_search_info(file, MODINFO_NAME); |
| 259 | preload_delete_name(name); |
| 260 | goto restart; |
| 261 | } |
| 262 | } |
| 263 | SYSINIT(ucode_release, SI_SUB_SMP + 1, SI_ORDER_ANY, ucode_release, NULL); |
| 264 | |
| 265 | void |
nothing calls this directly
no test coverage detected