source: mainline/uspace/srv/dd/isa.h@ cf8cc36

lfn serial ticket/834-toolchain-update topic/msim-upgrade topic/simplify-dev-export
Last change on this file since cf8cc36 was fcbd1be, checked in by Lenka Trochtova <trochtova.lenka@…>, 16 years ago

the name of the hierarchical driver was changed II

  • Property mode set to 100644
File size: 1.1 KB
Line 
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
9int isa_bus_init();
10
11struct bridge_to_isa;
12struct bridge_to_isa_ops;
13struct isa_drv_ops;
14struct isa_drv;
15
16typedef struct bridge_to_isa bridge_to_isa_t;
17typedef struct bridge_to_isa_ops bridge_to_isa_ops_t;
18typedef struct isa_drv_ops isa_drv_ops_t;
19typedef struct isa_drv isa_drv_t;
20
21
22struct isa_drv_ops {
23 void (*probe)(bridge_to_isa_t *parent);
24};
25
26struct isa_drv {
27 const char *name;
28 link_t link;
29 isa_drv_ops_t *ops;
30};
31
32struct bridge_to_isa {
33 link_t link;
34 void *data;
35 bridge_to_isa_ops_t *ops;
36};
37
38struct bridge_to_isa_ops {
39 void * (*absolutize)(void *phys_addr);
40};
41
42static 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
51static 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
57void isa_register_bridge(bridge_to_isa_t *bridge);
58void isa_register_driver(isa_drv_t *drv);
59
60#endif
Note: See TracBrowser for help on using the repository browser.