Fix style(9) nits.
This commit is contained in:
parent
dd962f5b8a
commit
b4f9625a6e
@ -68,7 +68,7 @@ __FBSDID("$FreeBSD$");
|
||||
|
||||
static devclass_t sc_devclass;
|
||||
|
||||
static sc_softc_t main_softc;
|
||||
static sc_softc_t main_softc;
|
||||
#ifdef SC_NO_SUSPEND_VTYSWITCH
|
||||
static int sc_no_suspend_vtswitch = 1;
|
||||
#else
|
||||
@ -76,26 +76,28 @@ static int sc_no_suspend_vtswitch = 0;
|
||||
#endif
|
||||
static int sc_cur_scr;
|
||||
|
||||
TUNABLE_INT("hw.syscons.sc_no_suspend_vtswitch", (int *)&sc_no_suspend_vtswitch);
|
||||
TUNABLE_INT("hw.syscons.sc_no_suspend_vtswitch", &sc_no_suspend_vtswitch);
|
||||
SYSCTL_DECL(_hw_syscons);
|
||||
SYSCTL_INT(_hw_syscons, OID_AUTO, sc_no_suspend_vtswitch, CTLFLAG_RW,
|
||||
&sc_no_suspend_vtswitch, 0, "Disable VT switch before suspend.");
|
||||
|
||||
static void
|
||||
scidentify (driver_t *driver, device_t parent)
|
||||
scidentify(driver_t *driver, device_t parent)
|
||||
{
|
||||
|
||||
BUS_ADD_CHILD(parent, ISA_ORDER_SPECULATIVE, "sc", 0);
|
||||
}
|
||||
|
||||
static int
|
||||
scprobe(device_t dev)
|
||||
{
|
||||
|
||||
/* No pnp support */
|
||||
if (isa_get_vendorid(dev))
|
||||
return (ENXIO);
|
||||
|
||||
device_set_desc(dev, "System console");
|
||||
return sc_probe_unit(device_get_unit(dev), device_get_flags(dev));
|
||||
return (sc_probe_unit(device_get_unit(dev), device_get_flags(dev)));
|
||||
}
|
||||
|
||||
static int
|
||||
@ -154,7 +156,8 @@ scresume(device_t dev)
|
||||
int
|
||||
sc_max_unit(void)
|
||||
{
|
||||
return devclass_get_maxunit(sc_devclass);
|
||||
|
||||
return (devclass_get_maxunit(sc_devclass));
|
||||
}
|
||||
|
||||
sc_softc_t
|
||||
@ -163,46 +166,46 @@ sc_softc_t
|
||||
sc_softc_t *sc;
|
||||
|
||||
if (unit < 0)
|
||||
return NULL;
|
||||
if (flags & SC_KERNEL_CONSOLE) {
|
||||
return (NULL);
|
||||
if ((flags & SC_KERNEL_CONSOLE) != 0) {
|
||||
/* FIXME: clear if it is wired to another unit! */
|
||||
sc = &main_softc;
|
||||
} else {
|
||||
sc = (sc_softc_t *)device_get_softc(devclass_get_device(sc_devclass, unit));
|
||||
sc = device_get_softc(devclass_get_device(sc_devclass, unit));
|
||||
if (sc == NULL)
|
||||
return NULL;
|
||||
return (NULL);
|
||||
}
|
||||
sc->unit = unit;
|
||||
if (!(sc->flags & SC_INIT_DONE)) {
|
||||
if ((sc->flags & SC_INIT_DONE) == 0) {
|
||||
sc->keyboard = -1;
|
||||
sc->adapter = -1;
|
||||
sc->cursor_char = SC_CURSOR_CHAR;
|
||||
sc->mouse_char = SC_MOUSE_CHAR;
|
||||
}
|
||||
return sc;
|
||||
return (sc);
|
||||
}
|
||||
|
||||
sc_softc_t
|
||||
*sc_find_softc(struct video_adapter *adp, struct keyboard *kbd)
|
||||
{
|
||||
sc_softc_t *sc;
|
||||
int units;
|
||||
int i;
|
||||
int units;
|
||||
|
||||
sc = &main_softc;
|
||||
if (((adp == NULL) || (adp == sc->adp))
|
||||
&& ((kbd == NULL) || (kbd == sc->kbd)))
|
||||
return sc;
|
||||
if ((adp == NULL || adp == sc->adp) &&
|
||||
(kbd == NULL || kbd == sc->kbd))
|
||||
return (sc);
|
||||
units = devclass_get_maxunit(sc_devclass);
|
||||
for (i = 0; i < units; ++i) {
|
||||
sc = (sc_softc_t *)device_get_softc(devclass_get_device(sc_devclass, i));
|
||||
sc = device_get_softc(devclass_get_device(sc_devclass, i));
|
||||
if (sc == NULL)
|
||||
continue;
|
||||
if (((adp == NULL) || (adp == sc->adp))
|
||||
&& ((kbd == NULL) || (kbd == sc->kbd)))
|
||||
return sc;
|
||||
if ((adp == NULL || adp == sc->adp) &&
|
||||
(kbd == NULL || kbd == sc->kbd))
|
||||
return (sc);
|
||||
}
|
||||
return NULL;
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
int
|
||||
@ -220,7 +223,7 @@ sc_get_cons_priority(int *unit, int *flags)
|
||||
if (arch_i386_is_xbox) {
|
||||
*unit = 0;
|
||||
*flags = SC_KERNEL_CONSOLE;
|
||||
return CN_INTERNAL;
|
||||
return (CN_INTERNAL);
|
||||
}
|
||||
#endif
|
||||
|
||||
@ -249,24 +252,24 @@ sc_get_cons_priority(int *unit, int *flags)
|
||||
*flags = 0;
|
||||
}
|
||||
#if 0
|
||||
return ((*flags & SC_KERNEL_CONSOLE) ? CN_INTERNAL : CN_NORMAL);
|
||||
return ((*flags & SC_KERNEL_CONSOLE) != 0 ? CN_INTERNAL : CN_NORMAL);
|
||||
#endif
|
||||
return CN_INTERNAL;
|
||||
return (CN_INTERNAL);
|
||||
}
|
||||
|
||||
void
|
||||
sc_get_bios_values(bios_values_t *values)
|
||||
{
|
||||
#if defined(__i386__) || defined(__amd64__)
|
||||
u_int8_t shift;
|
||||
uint8_t shift;
|
||||
|
||||
values->cursor_start = *(u_int8_t *)BIOS_PADDRTOVADDR(0x461);
|
||||
values->cursor_end = *(u_int8_t *)BIOS_PADDRTOVADDR(0x460);
|
||||
shift = *(u_int8_t *)BIOS_PADDRTOVADDR(0x417);
|
||||
values->shift_state = ((shift & BIOS_CLKED) ? CLKED : 0)
|
||||
| ((shift & BIOS_NLKED) ? NLKED : 0)
|
||||
| ((shift & BIOS_SLKED) ? SLKED : 0)
|
||||
| ((shift & BIOS_ALKED) ? ALKED : 0);
|
||||
values->cursor_start = *(uint8_t *)BIOS_PADDRTOVADDR(0x461);
|
||||
values->cursor_end = *(uint8_t *)BIOS_PADDRTOVADDR(0x460);
|
||||
shift = *(uint8_t *)BIOS_PADDRTOVADDR(0x417);
|
||||
values->shift_state = ((shift & BIOS_CLKED) != 0 ? CLKED : 0) |
|
||||
((shift & BIOS_NLKED) != 0 ? NLKED : 0) |
|
||||
((shift & BIOS_SLKED) != 0 ? SLKED : 0) |
|
||||
((shift & BIOS_ALKED) != 0 ? ALKED : 0);
|
||||
#else
|
||||
values->cursor_start = 0;
|
||||
values->cursor_end = 32;
|
||||
@ -278,17 +281,17 @@ sc_get_bios_values(bios_values_t *values)
|
||||
int
|
||||
sc_tone(int herz)
|
||||
{
|
||||
|
||||
#if defined(HAS_TIMER_SPKR)
|
||||
if (herz) {
|
||||
if (timer_spkr_acquire())
|
||||
return EBUSY;
|
||||
return (EBUSY);
|
||||
timer_spkr_setfreq(herz);
|
||||
} else {
|
||||
} else
|
||||
timer_spkr_release();
|
||||
}
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
return (0);
|
||||
}
|
||||
|
||||
static device_method_t sc_methods[] = {
|
||||
|
Loading…
x
Reference in New Issue
Block a user