From owner-p4-projects Fri Nov 29 20: 9: 3 2002 Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id B567937B404; Fri, 29 Nov 2002 20:08:57 -0800 (PST) Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 647CA37B401 for ; Fri, 29 Nov 2002 20:08:57 -0800 (PST) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0C20843E4A for ; Fri, 29 Nov 2002 20:08:57 -0800 (PST) (envelope-from marcel@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id gAU454mV013469 for ; Fri, 29 Nov 2002 20:05:04 -0800 (PST) (envelope-from marcel@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id gAU454Uo013466 for perforce@freebsd.org; Fri, 29 Nov 2002 20:05:04 -0800 (PST) Date: Fri, 29 Nov 2002 20:05:04 -0800 (PST) Message-Id: <200211300405.gAU454Uo013466@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to marcel@freebsd.org using -f From: Marcel Moolenaar Subject: PERFORCE change 21689 for review To: Perforce Change Reviews Sender: owner-p4-projects@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG http://perforce.freebsd.org/chv.cgi?CH=21689 Change 21689 by marcel@marcel_nfs on 2002/11/29 20:04:29 Strip this file from anything that smells like isa or i386. Hook the sc device to the nexus instead. Affected files ... .. //depot/projects/ia64/sys/isa/syscons_isa.c#4 edit Differences ... ==== //depot/projects/ia64/sys/isa/syscons_isa.c#4 (text+ko) ==== @@ -37,25 +37,6 @@ #include #include - -#ifdef __i386__ - -#include -#include -#include - -#include -#include - -#include - -#define BIOS_CLKED (1 << 6) -#define BIOS_NLKED (1 << 5) -#define BIOS_SLKED (1 << 4) -#define BIOS_ALKED 0 - -#endif /* __i386__ */ - #include #include @@ -66,17 +47,15 @@ static sc_softc_t main_softc; 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, 65536, "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)); @@ -85,48 +64,10 @@ static int scattach(device_t dev) { + return sc_attach_unit(device_get_unit(dev), device_get_flags(dev)); } -#ifndef SC_NO_SUSPEND_VTYSWITCH -static int sc_cur_scr; -#endif - -static int -scsuspend(device_t dev) -{ -#ifndef SC_NO_SUSPEND_VTYSWITCH - int retry = 10; - static int dummy; - sc_softc_t *sc; - - sc = &main_softc; - sc_cur_scr = sc->cur_scp->index; - do { - sc_switch_scr(sc, 0); - if (!sc->switch_in_progress) { - break; - } - tsleep(&dummy, 0, "scsuspend", 100); - } while (retry--); - -#endif - return (0); -} - -static int -scresume(device_t dev) -{ -#ifndef SC_NO_SUSPEND_VTYSWITCH - sc_softc_t *sc; - - sc = &main_softc; - sc_switch_scr(sc, sc_cur_scr); - -#endif - return (0); -} - int sc_max_unit(void) { @@ -184,93 +125,32 @@ int sc_get_cons_priority(int *unit, int *flags) { - int disabled; - const char *at; - int u, f; - - *unit = -1; - 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) { - /* the user designates this unit to be the console */ - *unit = u; - *flags = f; - break; - } - if (*unit < 0) { - /* ...otherwise remember the first found unit */ - *unit = u; - *flags = f; - } - } - if (*unit < 0) - return CN_DEAD; -#if 0 - return ((*flags & SC_KERNEL_CONSOLE) ? CN_INTERNAL : CN_NORMAL); -#endif + *unit = 0; + *flags = 0; return CN_INTERNAL; } void sc_get_bios_values(bios_values_t *values) { -#ifdef __i386__ - u_int8_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->bell_pitch = BELL_PITCH; -#else /* !__i386__ */ + /* XXX - MD */ values->cursor_start = 0; values->cursor_end = 32; values->shift_state = 0; values->bell_pitch = BELL_PITCH; -#endif /* __i386__ */ } int sc_tone(int herz) { -#ifdef __i386__ - int pitch; - - if (herz) { - /* set command for counter 2, 2 byte write */ - if (acquire_timer2(TIMER_16BIT | TIMER_SQWAVE)) - return EBUSY; - /* set pitch */ - pitch = timer_freq/herz; - outb(TIMER_CNTR2, pitch); - outb(TIMER_CNTR2, pitch >> 8); - /* enable counter 2 output to speaker */ - outb(IO_PPI, inb(IO_PPI) | 3); - } else { - /* disable counter 2 output to speaker */ - outb(IO_PPI, inb(IO_PPI) & 0xFC); - release_timer2(); - } -#endif /* __i386__ */ - + /* XXX - MD */ return 0; } static device_method_t sc_methods[] = { DEVMETHOD(device_identify, scidentify), - DEVMETHOD(device_probe, scprobe), - DEVMETHOD(device_attach, scattach), - DEVMETHOD(device_suspend, scsuspend), - DEVMETHOD(device_resume, scresume), + DEVMETHOD(device_probe, scprobe), + DEVMETHOD(device_attach, scattach), { 0, 0 } }; @@ -280,4 +160,4 @@ sizeof(sc_softc_t), }; -DRIVER_MODULE(sc, isa, sc_driver, sc_devclass, 0, 0); +DRIVER_MODULE(sc, nexus, sc_driver, sc_devclass, 0, 0); To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe p4-projects" in the body of the message