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

Diff for /funnyos/arch/testarm/dev/tacons.c between version 1.2 and 1.6

version 1.2, 2007/10/16 21:28:24 version 1.6, 2007/10/29 21:10:03
Line 6 
Line 6 
 #include <sys/bus.h>  #include <sys/bus.h>
   
 #include <arch/testarm/dev/taconsreg.h>  #include <arch/testarm/dev/taconsreg.h>
   #include <arch/testarm/dev/taconsvar.h>
 #include <dev/fcons/fconsvar.h>  #include <dev/fcons/fconsvar.h>
 #include <libkern/printf.h>  #include <libkern/printf.h>
   
Line 21 
Line 22 
 struct driver tacons_dr = {  struct driver tacons_dr = {
         sizeof(struct tacons_dd),          sizeof(struct tacons_dd),
         tacons_attach,          tacons_attach,
           NULL,
         NULL          NULL
 };  };
   
Line 29 
Line 31 
 tacons_attach(struct device *self, uint32_t loc, uint8_t flags)  tacons_attach(struct device *self, uint32_t loc, uint8_t flags)
 {  {
         struct tacons_dd *ddp = self->dv_devdata;          struct tacons_dd *ddp = self->dv_devdata;
         struct consoleops *cop = &ddp->td_consops;          struct fcons_handle *fhp = &ddp->td_fh;
   
         /* aquire bus handle from parent */          /* aquire bus handle from parent */
         ddp->td_bhp = self->dv_parent->dv_aux;          ddp->td_bhp = self->dv_parent->dv_aux;
Line 37 
Line 39 
         /* all reads/writes will use this addr; in testarm cons this is the same addr for getc/putc */          /* all reads/writes will use this addr; in testarm cons this is the same addr for getc/putc */
         ddp->td_ioaddr = loc;          ddp->td_ioaddr = loc;
   
         /* we export struct consoleops */          /* we export struct fcons_handle */
         cop->getc = tacons_getc;          fhp->getc = tacons_getc;
         cop->putc = tacons_putc;          fhp->putc = tacons_putc;
   
         self->dv_aux = cop;          /* give our dd to fcons_handle */
           fhp->fh_ownerdd = ddp;
   
           self->dv_aux = fhp;
   
         printf("testarm simple console (non-blocking, halt)\n");          printf("testarm simple console (non-blocking, halt)\n");
   
         return(0);          return(0);
Line 70 
Line 75 
          */           */
         struct tacons_dd *tdp = ddp;          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);
 }  }
   
   

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.6

CVSweb