[BACK]Return to tacons.c CVS log [TXT][DIR] Up to [local] / funnyos / arch / testarm / dev

Annotation of funnyos/arch/testarm/dev/tacons.c, Revision 1.1.1.1

1.1       init        1: /*
                      2:  * $Id: tacons.c,v 1.1.1.1 2007/10/12 08:40:36 init Exp $
                      3:  */
                      4: #include <sys/types.h>
                      5: #include <sys/device.h>
                      6: #include <sys/bus.h>
                      7: #include <arch/testarm/dev/taconsreg.h>
                      8: #include <dev/fcons/fconsvar.h>
                      9: #include <libkern/printf.h>
                     10:
                     11: /*
                     12:  * testarm console support.
                     13:  */
                     14:
                     15: #if 0
                     16: struct consoleops      tacons_dd[NTACONS];
                     17:
                     18: int    tacons_attach(struct device *);
                     19: char   tacons_getc(struct device *);
                     20: void   tacons_putc(struct device *, char);
                     21: void   tacons_early_putc(char);
                     22:
                     23:
                     24: int
                     25: tacons_attach(struct device *self)
                     26: {
                     27:        struct consoleops *aux = self->dv_aux;
                     28:        aux = kmalloc(sizeof(struct consoleops));
                     29:
                     30:        aux->getc = tacons_getc;
                     31:        aux->putc = tacons_putc;
                     32:
                     33:        printf("testarm simple console (non-blocking, halt)\n");
                     34:
                     35:        /*
                     36:         * XXX test putc() & getc()
                     37:         * and TODO: think carefully about console abstraction layer and early printf's
                     38:         * in particular printing root/0, obio and cpu at the fcons during attachment.
                     39:         */
                     40:
                     41:        return(0);
                     42: }
                     43:
                     44:
                     45: char
                     46: tacons_getc(struct device *devp)
                     47: {
                     48:        /*
                     49:         * Get a character from the console.
                     50:         * Remember that this console is non-blocking.
                     51:         */
                     52:
                     53:        return( bus_read_1(devp->dv_parent, devp->dv_locator ? devp->dv_locator + TACONS_OFF_IO : TACONS_REG_BASE + TACONS_OFF_IO) );
                     54:
                     55: }
                     56:
                     57:
                     58: void
                     59: tacons_putc(struct device *devp, char ch)
                     60: {
                     61:        /*
                     62:         * Write a character to the console.
                     63:         */
                     64:
                     65:        bus_write_1(devp->dv_parent, devp->dv_locator ? devp->dv_locator + TACONS_OFF_IO : TACONS_REG_BASE + TACONS_OFF_IO, ch);
                     66:
                     67:        return;
                     68: }
                     69:
                     70: #endif /* not 0 */
                     71: void
                     72: tacons_early_putc(char ch)
                     73: {
                     74:        /*
                     75:         * put a character on the unconfigured console device.
                     76:         * This will be used during devconfig until fcons/0 is configured.
                     77:         */
                     78:
                     79:        *(char *)(TACONS_REG_BASE + TACONS_OFF_IO) = ch;
                     80: }
                     81:

CVSweb