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