123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172 |
- #include <types.h>
- #include <lib.h>
- #include <lamebus/lamebus.h>
- #include <lamebus/ltimer.h>
- #include "autoconf.h"
- #define LOW_VERSION 1
- #define HIGH_VERSION 1
- struct ltimer_softc *
- attach_ltimer_to_lamebus(int ltimerno, struct lamebus_softc *sc)
- {
- struct ltimer_softc *lt;
- int slot = lamebus_probe(sc, LB_VENDOR_CS161, LBCS161_TIMER,
- LOW_VERSION, HIGH_VERSION);
- if (slot < 0) {
-
- return NULL;
- }
- lt = kmalloc(sizeof(struct ltimer_softc));
- if (lt==NULL) {
-
- return NULL;
- }
- (void)ltimerno;
-
- lt->lt_bus = sc;
- lt->lt_buspos = slot;
-
- lamebus_mark(sc, slot);
- lamebus_attach_interrupt(sc, slot, lt, ltimer_irq);
- return lt;
- }
|