Subversion Repositories HelenOS

Rev

Rev 4119 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 4119 Rev 4148
Line 37... Line 37...
37
#include <genarch/drivers/z8530/z8530.h>
37
#include <genarch/drivers/z8530/z8530.h>
38
#include <console/chardev.h>
38
#include <console/chardev.h>
39
#include <ddi/irq.h>
39
#include <ddi/irq.h>
40
#include <arch/asm.h>
40
#include <arch/asm.h>
41
#include <mm/slab.h>
41
#include <mm/slab.h>
-
 
42
#include <ddi/device.h>
42
 
43
 
43
static indev_operations_t kbrdin_ops = {
44
static indev_operations_t kbrdin_ops = {
44
    .poll = NULL
45
    .poll = NULL
45
};
46
};
46
 
47
 
Line 85... Line 86...
85
        indev_push_character(&instance->kbrdin, x);
86
        indev_push_character(&instance->kbrdin, x);
86
    }
87
    }
87
}
88
}
88
 
89
 
89
/** Initialize z8530. */
90
/** Initialize z8530. */
90
indev_t *z8530_init(z8530_t *dev, devno_t devno, inr_t inr, cir_t cir, void *cir_arg)
91
indev_t *z8530_init(z8530_t *dev, inr_t inr, cir_t cir, void *cir_arg)
91
{
92
{
92
    z8530_instance_t *instance
93
    z8530_instance_t *instance
93
        = malloc(sizeof(z8530_instance_t), FRAME_ATOMIC);
94
        = malloc(sizeof(z8530_instance_t), FRAME_ATOMIC);
94
    if (!instance)
95
    if (!instance)
95
        return false;
96
        return false;
96
   
97
   
97
    indev_initialize("z8530", &instance->kbrdin, &kbrdin_ops);
98
    indev_initialize("z8530", &instance->kbrdin, &kbrdin_ops);
98
   
99
   
99
    instance->devno = devno;
-
 
100
    instance->z8530 = dev;
100
    instance->z8530 = dev;
101
   
101
   
102
    irq_initialize(&instance->irq);
102
    irq_initialize(&instance->irq);
103
    instance->irq.devno = devno;
103
    instance->irq.devno = device_assign_devno();
104
    instance->irq.inr = inr;
104
    instance->irq.inr = inr;
105
    instance->irq.claim = z8530_claim;
105
    instance->irq.claim = z8530_claim;
106
    instance->irq.handler = z8530_irq_handler;
106
    instance->irq.handler = z8530_irq_handler;
107
    instance->irq.instance = instance;
107
    instance->irq.instance = instance;
108
    instance->irq.cir = cir;
108
    instance->irq.cir = cir;