version 1.3, 2007/10/16 21:35:30 |
version 1.4, 2007/10/16 22:33:24 |
|
|
#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> |
|
|
|
|
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 fcons_handle *fhp = &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; |
|
|
/* we export struct fcons_handle */ |
/* we export struct fcons_handle */ |
fhp->getc = tacons_getc; |
fhp->getc = tacons_getc; |
fhp->putc = tacons_putc; |
fhp->putc = tacons_putc; |
|
|
|
/* give our dd to fcons_handle */ |
|
fhp->fh_ownerdd = ddp; |
|
|
self->dv_aux = fhp; |
self->dv_aux = fhp; |
|
|