MCPcopy Create free account
hub / github.com/F-Stack/f-stack / cnremove

Function cnremove

freebsd/kern/kern_cons.c:236–267  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

234}
235
236void
237cnremove(struct consdev *cn)
238{
239 struct cn_device *cnd;
240 int i;
241
242 STAILQ_FOREACH(cnd, &cn_devlist, cnd_next) {
243 if (cnd->cnd_cn != cn)
244 continue;
245 if (STAILQ_FIRST(&cn_devlist) == cnd)
246 ttyconsdev_select(NULL);
247 STAILQ_REMOVE(&cn_devlist, cnd, cn_device, cnd_next);
248 cnd->cnd_cn = NULL;
249
250 /* Remove this device from available mask. */
251 for (i = 0; i < CNDEVTAB_SIZE; i++)
252 if (cnd == &cn_devtab[i]) {
253 cons_avail_mask &= ~(1 << i);
254 break;
255 }
256#if 0
257 /*
258 * XXX
259 * syscons gets really confused if console resources are
260 * freed after the system has initialized.
261 */
262 if (cn->cn_term != NULL)
263 cn->cn_ops->cn_term(cn);
264#endif
265 return;
266 }
267}
268
269void
270cnselect(struct consdev *cn)

Callers 2

cninitFunction · 0.85
sysctl_kern_consoleFunction · 0.85

Calls 1

ttyconsdev_selectFunction · 0.85

Tested by

no test coverage detected