version 1.4, 2007/10/29 21:10:02 |
version 1.5, 2008/01/11 15:36:01 |
|
|
#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. |
|
|
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; |
|
|
|
|
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 |