Subversion Repositories HelenOS

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
4667 trochtova 1
#ifndef ISA_H
2
#define ISA_H
3
 
4
#include <adt/list.h>
5
#include <stdio.h>
6
#include <stdlib.h>
7
#include <string.h>
8
 
9
int isa_bus_init();
10
 
11
struct bridge_to_isa;
12
struct bridge_to_isa_ops;
13
struct isa_drv_ops;
14
struct isa_drv;
15
 
16
typedef struct bridge_to_isa bridge_to_isa_t;
17
typedef struct bridge_to_isa_ops bridge_to_isa_ops_t;
18
typedef struct isa_drv_ops isa_drv_ops_t;
19
typedef struct isa_drv isa_drv_t;
20
 
21
 
22
struct isa_drv_ops {
23
    void (*probe)(bridge_to_isa_t *parent);
24
};
25
 
26
struct isa_drv {
27
    const char *name;
28
    link_t link;
29
    isa_drv_ops_t *ops;    
30
};
31
 
32
struct bridge_to_isa {
33
    link_t link;
34
    void *data;
35
    bridge_to_isa_ops_t *ops;  
36
};
37
 
38
struct bridge_to_isa_ops {
39
    void * (*absolutize)(void *phys_addr); 
40
};
41
 
42
static inline bridge_to_isa_t * isa_alloc_bridge()
43
{
44
    bridge_to_isa_t *bridge = (bridge_to_isa_t *)malloc(sizeof(bridge_to_isa_t));
45
    link_initialize(&bridge->link);
46
    bridge->data = NULL;
47
    bridge->ops = NULL;
48
    return bridge;
49
}
50
 
51
static inline void isa_init_bridge(bridge_to_isa_t *bridge, bridge_to_isa_ops_t *ops, void *data)
52
{
53
    bridge->data = data;
54
    bridge->ops = ops; 
55
}
56
 
57
void isa_register_bridge(bridge_to_isa_t *bridge);
58
void isa_register_driver(isa_drv_t *drv);
59
 
60
#endif