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

Diff for /funnyos/dev/fcons/fcons.c between version 1.2 and 1.5

version 1.2, 2007/10/16 22:41:36 version 1.5, 2008/01/11 15:36:01
Line 5 
Line 5 
 #include <sys/device.h>  #include <sys/device.h>
 #include <dev/fcons/fconsvar.h>  #include <dev/fcons/fconsvar.h>
 #include <libkern/printf.h>  #include <libkern/printf.h>
   #include <libkern/queue.h>
   
 /*  /*
  * funnyOS console.   * funnyOS console.
Line 25 
Line 26 
 struct driver fcons_dr = {  struct driver fcons_dr = {
         sizeof(struct fcons_dd),          sizeof(struct fcons_dd),
         fcons_attach,          fcons_attach,
           NULL,
         NULL          NULL
 };  };
   
Line 33 
Line 35 
 {  {
         struct fcons_dd *ddp = self->dv_devdata;          struct fcons_dd *ddp = self->dv_devdata;
   
           /* link our parent's dv_aux (fcons_handle) to us */
           ddp->fd_fh = self->dv_parent->dv_aux;
   
         ddp->fd_currow = 0;          ddp->fd_currow = 0;
         ddp->fd_curcol = 0;          ddp->fd_curcol = 0;
   
           /* initialize iqueue */
   //      ddp->fd_iqhead = SIMPLEQ_HEAD_INITIALIZER(ddp->fd_iqhead);
           SIMPLEQ_INIT(ddp->head);
           ddp->fd_iqlength = 0;
   
         /* make current console default */          /* make current console default */
         curcons = ddp;          curcons = ddp;
   
Line 52 
Line 62 
 fcons_putchar(void *ddp, char ch)  fcons_putchar(void *ddp, char ch)
 {  {
         struct fcons_dd *fdp = ddp;          struct fcons_dd *fdp = ddp;
         struct fcons_handle *fhp = &fdp->fd_fh;          struct fcons_handle *fhp = fdp->fd_fh;
   
         /* if we reach screen width */          /* if we reach screen width */
         if (fdp->fd_curcol == (FCONS_WIDTH - 1)) {          if (fdp->fd_curcol == (FCONS_WIDTH - 1)) {
Line 92 
Line 102 
         fcons_putchar(curcons, ch);          fcons_putchar(curcons, ch);
   
         return;          return;
   }
   
   
   void
   fcons_ienqueue(char ch)
   {
           /*
            * Enqueue character into the input data queue.
            */
           struct fcons_dd *ddp;
           struct fcons_char *curfc;
           uint32_t i;
   
           /* XXX will use curcons devdata */
           ddp = curcons;
   
   #if 0
           if (ddp->fd_iqueue == NULL) {
                   /* first insertion */
                   curfc = kmalloc(sizeof(struct fcons_char));
   
                   if(curfc == NULL)
                           panic("fcons_ienqueue: can't allocate memory for new element\n");
           } else {
                   curfc = ddp->fd_iqueue;
   
                   /* locate last element */
                   for(i = 0; i < ddp->fd_iqlength - 1; i++)
                           curfc = curfc->fc_next;
           }
   #endif
           curfc = kmalloc(sizeof(struct fcons_char));
           if(curfc == NULL)
                   panic("fcons_ienqueue: can't allocate memory for new element\n");
   
           SIMPLEQ_INSERT_TAIL(ddp->fd_iqhead, curfc, fc_next);
 }  }
   
 #if 0  #if 0

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

CVSweb