| 234 | } |
| 235 | |
| 236 | void |
| 237 | cnremove(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 | |
| 269 | void |
| 270 | cnselect(struct consdev *cn) |
no test coverage detected