=================================================================== RCS file: /cvs/funnyos/arch/testarm/dev/tacons.c,v retrieving revision 1.3 retrieving revision 1.7 diff -u -r1.3 -r1.7 --- funnyos/arch/testarm/dev/tacons.c 2007/10/16 21:35:30 1.3 +++ funnyos/arch/testarm/dev/tacons.c 2008/01/11 15:25:20 1.7 @@ -1,11 +1,12 @@ /* - * $Id: tacons.c,v 1.3 2007/10/16 20:35:30 init Exp $ + * $Id: tacons.c,v 1.7 2008/01/11 15:25:20 nbrk Exp $ */ #include #include #include #include +#include #include #include @@ -17,11 +18,13 @@ char tacons_getc(void *); void tacons_putc(void *, char); void tacons_early_putc(char); +void tacons_interrupt(struct device *self); struct driver tacons_dr = { sizeof(struct tacons_dd), tacons_attach, - NULL + NULL, + tacons_interrupt }; @@ -29,7 +32,7 @@ tacons_attach(struct device *self, uint32_t loc, uint8_t flags) { struct tacons_dd *ddp = self->dv_devdata; - struct fcons_handle *fhp = &ddp->td_consops; + struct fcons_handle *fhp = &ddp->td_fh; /* aquire bus handle from parent */ ddp->td_bhp = self->dv_parent->dv_aux; @@ -41,6 +44,9 @@ fhp->getc = tacons_getc; fhp->putc = tacons_putc; + /* give our dd to fcons_handle */ + fhp->fh_ownerdd = ddp; + self->dv_aux = fhp; printf("testarm simple console (non-blocking, halt)\n"); @@ -70,7 +76,7 @@ */ struct tacons_dd *tdp = ddp; - return( bus_write_1(tdp->td_dhp, tdp->td_ioaddr, ch) ); + bus_write_1(tdp->td_bhp, tdp->td_ioaddr, ch); } @@ -83,5 +89,17 @@ */ *(char *)(TACONS_REG_BASE + TACONS_OFF_IO) = ch; +} + + +void +tacons_interrupt(struct device *self) +{ + struct tacons_dd *ddp = (struct tacons_dd *)self->dv_devdata; + char ch; + + ch = bus_read_1(ddp->td_bhp, ddp->td_ioaddr); + + fcons_ienqueue(ch); }