diff --git a/sys/pc98/cbus/syscons_cbus.c b/sys/pc98/cbus/syscons_cbus.c index 7a8b584b175e..28f26d48e381 100644 --- a/sys/pc98/cbus/syscons_cbus.c +++ b/sys/pc98/cbus/syscons_cbus.c @@ -148,15 +148,16 @@ int sc_get_cons_priority(int *unit, int *flags) { int disabled; + char *at; int u, f; - int i; *unit = -1; - for (i = -1; (i = resource_locate(i, SC_DRIVER_NAME)) >= 0;) { - u = resource_query_unit(i); + for (u = 0; u < 16; u++) { if ((resource_int_value(SC_DRIVER_NAME, u, "disabled", &disabled) == 0) && disabled) continue; + if (resource_string_value(SC_DRIVER_NAME, u, "at", &at) != 0) + continue; if (resource_int_value(SC_DRIVER_NAME, u, "flags", &f) != 0) f = 0; if (f & SC_KERNEL_CONSOLE) { @@ -171,7 +172,7 @@ sc_get_cons_priority(int *unit, int *flags) *flags = f; } } - if ((i < 0) && (*unit < 0)) + if (*unit < 0) return CN_DEAD; return CN_INTERNAL; } diff --git a/sys/pc98/pc98/syscons_pc98.c b/sys/pc98/pc98/syscons_pc98.c index 7a8b584b175e..28f26d48e381 100644 --- a/sys/pc98/pc98/syscons_pc98.c +++ b/sys/pc98/pc98/syscons_pc98.c @@ -148,15 +148,16 @@ int sc_get_cons_priority(int *unit, int *flags) { int disabled; + char *at; int u, f; - int i; *unit = -1; - for (i = -1; (i = resource_locate(i, SC_DRIVER_NAME)) >= 0;) { - u = resource_query_unit(i); + for (u = 0; u < 16; u++) { if ((resource_int_value(SC_DRIVER_NAME, u, "disabled", &disabled) == 0) && disabled) continue; + if (resource_string_value(SC_DRIVER_NAME, u, "at", &at) != 0) + continue; if (resource_int_value(SC_DRIVER_NAME, u, "flags", &f) != 0) f = 0; if (f & SC_KERNEL_CONSOLE) { @@ -171,7 +172,7 @@ sc_get_cons_priority(int *unit, int *flags) *flags = f; } } - if ((i < 0) && (*unit < 0)) + if (*unit < 0) return CN_DEAD; return CN_INTERNAL; }