Put all console initialization into 1 exported function (pccnattach()).

Delay setting of cn_tab->cn_dev until autoconfiguration attach
  to get the minor number right. (not really needed, but for
  consistency with pccons and serial consoles)
Comment out unused pccnprobe() and pccninit().
XXX I didn't use "#if PCVT_NETBSD > ???" anymore, nor separated from
  FreeBSD. The driver is not centrally maintained anyway.
This commit is contained in:
drochner 1997-08-23 14:17:46 +00:00
parent fe882d2810
commit d09a42059f
2 changed files with 32 additions and 4 deletions

View File

@ -1,4 +1 @@
int pccngetc __P((dev_t));
void pccnputc __P((dev_t, int));
void pccnpollc __P((dev_t, int));
void pccninit __P((struct consdev *));
int pccnattach __P((void));

View File

@ -365,6 +365,22 @@ pcattach(struct isa_device *dev)
*/
while (config_found(self, ia->ia_ic, NULL) != NULL)
/* will break when no more children */ ;
if(pcvt_is_console) {
int maj;
/* locate the major number */
for (maj = 0; maj < nchrdev; maj++)
if (cdevsw[maj].d_open == pcopen)
break;
cn_tab->cn_dev = makedev(maj, 0);
/* minor number selects virtual screen,
console always uses "0" (hardwired at
various places) */
printf("%s: console\n", sc->sc_dev.dv_xname);
}
#endif /* PCVT_NETBSD > 110 */
#else /* PCVT_NETBSD > 100 */
vthand.ih_fun = pcrint;
@ -1110,6 +1126,7 @@ consinit() /* init for kernel messages during boot */
}
#endif /* PCVT_NETBSD */
#if 0
#if (PCVT_NETBSD > 101 || PCVT_FREEBSD > 205)
void
pccnprobe(struct consdev *cp)
@ -1170,6 +1187,20 @@ pccninit(struct consdev *cp)
return 0;
#endif
}
#endif /* 0 */
int
pccnattach()
{
static struct consdev pccons = { NULL, NULL,
pccngetc, pccnputc, pccnpollc, NODEV, CN_NORMAL};
cn_tab = &pccons;
pcvt_is_console = 1;
return(0);
}
#if (PCVT_NETBSD > 101 || PCVT_FREEBSD > 205)
void