source: mainline/uspace/drv/bus/isa/isa.c@ 1a11a16

lfn serial ticket/834-toolchain-update topic/msim-upgrade topic/simplify-dev-export
Last change on this file since 1a11a16 was 1a11a16, checked in by Jan Vesely <jano.vesely@…>, 14 years ago

isa: Implement interrupt enable routine.

  • Property mode set to 100644
File size: 13.6 KB
RevLine 
[892e4e1]1/*
2 * Copyright (c) 2010 Lenka Trochtova
[68414f4a]3 * Copyright (c) 2011 Jiri Svoboda
[892e4e1]4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:
9 *
10 * - Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer.
12 * - Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution.
15 * - The name of the author may not be used to endorse or promote products
16 * derived from this software without specific prior written permission.
17 *
18 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
19 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
20 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
21 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
22 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
23 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
25 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
27 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 */
29
30/**
31 * @defgroup isa ISA bus driver.
32 * @brief HelenOS ISA bus driver.
33 * @{
34 */
35
36/** @file
37 */
38
[f278930]39#include <adt/list.h>
[892e4e1]40#include <assert.h>
41#include <stdio.h>
42#include <errno.h>
43#include <bool.h>
44#include <fibril_synch.h>
45#include <stdlib.h>
[c47e1a8]46#include <str.h>
[cd0684d]47#include <str_error.h>
[892e4e1]48#include <ctype.h>
49#include <macros.h>
[c1a8ae52]50#include <malloc.h>
51#include <dirent.h>
52#include <fcntl.h>
53#include <sys/stat.h>
[1a11a16]54#include <ipc/irc.h>
55#include <ipc/services.h>
56#include <sysinfo.h>
57#include <ns.h>
[892e4e1]58
[af6b5157]59#include <ddf/driver.h>
[fc51296]60#include <ddf/log.h>
[41b56084]61#include <ops/hw_res.h>
[5dc9622]62
[892e4e1]63#include <devman.h>
64#include <ipc/devman.h>
[5dc9622]65#include <device/hw_res.h>
[892e4e1]66
67#define NAME "isa"
[8b1e15ac]68#define CHILD_FUN_CONF_PATH "/drv/isa/isa.dev"
[892e4e1]69
[f278930]70/** Obtain soft-state from device node */
71#define ISA_BUS(dev) ((isa_bus_t *) ((dev)->driver_data))
72
73/** Obtain soft-state from function node */
74#define ISA_FUN(fun) ((isa_fun_t *) ((fun)->driver_data))
[68414f4a]75
[5dc9622]76#define ISA_MAX_HW_RES 4
77
[f278930]78typedef struct {
79 fibril_mutex_t mutex;
80 ddf_dev_t *dev;
81 ddf_fun_t *fctl;
82 list_t functions;
83} isa_bus_t;
84
[68414f4a]85typedef struct isa_fun {
[f278930]86 fibril_mutex_t mutex;
[83a2f43]87 ddf_fun_t *fnode;
[032e0bb]88 hw_resource_list_t hw_resources;
[f278930]89 link_t bus_link;
[68414f4a]90} isa_fun_t;
[5dc9622]91
[83a2f43]92static hw_resource_list_t *isa_get_fun_resources(ddf_fun_t *fnode)
[5dc9622]93{
[68414f4a]94 isa_fun_t *fun = ISA_FUN(fnode);
95 assert(fun != NULL);
[032e0bb]96
[68414f4a]97 return &fun->hw_resources;
[5dc9622]98}
99
[83a2f43]100static bool isa_enable_fun_interrupt(ddf_fun_t *fnode)
[5dc9622]101{
[1a11a16]102 /* This is an old ugly way, copied from pci driver */
103 assert(fnode);
104 isa_fun_t *isa_fun = fnode->driver_data;
[032e0bb]105
[1a11a16]106 sysarg_t apic;
107 sysarg_t i8259;
108
109 async_sess_t *irc_sess = NULL;
110
111 if (((sysinfo_get_value("apic", &apic) == EOK) && (apic))
112 || ((sysinfo_get_value("i8259", &i8259) == EOK) && (i8259))) {
113 irc_sess = service_connect_blocking(EXCHANGE_SERIALIZE,
114 SERVICE_IRC, 0, 0);
115 }
116
117 if (!irc_sess)
118 return false;
119
120 assert(isa_fun);
121 hw_resource_list_t *res = &isa_fun->hw_resources;
122 assert(res);
123 for (size_t i = 0; i < res->count; i++) {
124 if (res->resources[i].type == INTERRUPT) {
125 const int irq = res->resources[i].res.interrupt.irq;
126
127 async_exch_t *exch = async_exchange_begin(irc_sess);
128 const int rc =
129 async_req_1_0(exch, IRC_ENABLE_INTERRUPT, irq);
130 async_exchange_end(exch);
131
132 if (rc != EOK) {
133 async_hangup(irc_sess);
134 return false;
135 }
136 }
137 }
138
139 async_hangup(irc_sess);
140 return true;
[5dc9622]141}
142
[8b1e15ac]143static hw_res_ops_t isa_fun_hw_res_ops = {
144 &isa_get_fun_resources,
145 &isa_enable_fun_interrupt
[5dc9622]146};
147
[83a2f43]148static ddf_dev_ops_t isa_fun_ops;
[5dc9622]149
[83a2f43]150static int isa_add_device(ddf_dev_t *dev);
[f278930]151static int isa_dev_remove(ddf_dev_t *dev);
[5b68e0c]152static int isa_fun_online(ddf_fun_t *fun);
153static int isa_fun_offline(ddf_fun_t *fun);
[892e4e1]154
[032e0bb]155/** The isa device driver's standard operations */
[892e4e1]156static driver_ops_t isa_ops = {
[5b68e0c]157 .add_device = &isa_add_device,
[f278930]158 .dev_remove = &isa_dev_remove,
[5b68e0c]159 .fun_online = &isa_fun_online,
160 .fun_offline = &isa_fun_offline
[892e4e1]161};
162
[032e0bb]163/** The isa device driver structure. */
[892e4e1]164static driver_t isa_driver = {
165 .name = NAME,
166 .driver_ops = &isa_ops
167};
168
[f278930]169static isa_fun_t *isa_fun_create(isa_bus_t *isa, const char *name)
[c1a8ae52]170{
[f278930]171 ddf_fun_t *fnode = ddf_fun_create(isa->dev, fun_inner, name);
172 if (fnode == NULL)
[c1a8ae52]173 return NULL;
[032e0bb]174
[f278930]175 isa_fun_t *fun = ddf_fun_data_alloc(fnode, sizeof(isa_fun_t));
176 if (fun == NULL)
[c1a8ae52]177 return NULL;
[032e0bb]178
[f278930]179 fibril_mutex_initialize(&fun->mutex);
[68414f4a]180 fun->fnode = fnode;
[8b1e15ac]181 return fun;
[c1a8ae52]182}
183
[68414f4a]184static char *fun_conf_read(const char *conf_path)
[032e0bb]185{
186 bool suc = false;
[c1a8ae52]187 char *buf = NULL;
188 bool opened = false;
[032e0bb]189 int fd;
[c47e1a8]190 size_t len = 0;
[032e0bb]191
[c1a8ae52]192 fd = open(conf_path, O_RDONLY);
193 if (fd < 0) {
[ebcb05a]194 ddf_msg(LVL_ERROR, "Unable to open %s", conf_path);
[c1a8ae52]195 goto cleanup;
[032e0bb]196 }
197
198 opened = true;
199
[c1a8ae52]200 len = lseek(fd, 0, SEEK_END);
[fc51296]201 lseek(fd, 0, SEEK_SET);
[c1a8ae52]202 if (len == 0) {
[ebcb05a]203 ddf_msg(LVL_ERROR, "Configuration file '%s' is empty.",
[fc51296]204 conf_path);
[032e0bb]205 goto cleanup;
[c1a8ae52]206 }
[032e0bb]207
[c1a8ae52]208 buf = malloc(len + 1);
209 if (buf == NULL) {
[ebcb05a]210 ddf_msg(LVL_ERROR, "Memory allocation failed.");
[c1a8ae52]211 goto cleanup;
[032e0bb]212 }
213
[c1a8ae52]214 if (0 >= read(fd, buf, len)) {
[ebcb05a]215 ddf_msg(LVL_ERROR, "Unable to read file '%s'.", conf_path);
[c1a8ae52]216 goto cleanup;
217 }
[032e0bb]218
[c1a8ae52]219 buf[len] = 0;
[032e0bb]220
[c1a8ae52]221 suc = true;
[032e0bb]222
[c1a8ae52]223cleanup:
[032e0bb]224 if (!suc && buf != NULL) {
225 free(buf);
[c1a8ae52]226 buf = NULL;
227 }
[032e0bb]228
229 if (opened)
230 close(fd);
231
232 return buf;
[c1a8ae52]233}
234
[032e0bb]235static char *str_get_line(char *str, char **next)
236{
[5dc9622]237 char *line = str;
[032e0bb]238
239 if (str == NULL) {
[f928a8a]240 *next = NULL;
241 return NULL;
242 }
[032e0bb]243
244 while (*str != '\0' && *str != '\n') {
[5dc9622]245 str++;
[032e0bb]246 }
247
248 if (*str != '\0') {
[5dc9622]249 *next = str + 1;
250 } else {
251 *next = NULL;
[032e0bb]252 }
253
254 *str = '\0';
[5dc9622]255 return line;
[c1a8ae52]256}
257
258static bool line_empty(const char *line)
259{
[032e0bb]260 while (line != NULL && *line != 0) {
261 if (!isspace(*line))
[c1a8ae52]262 return false;
[032e0bb]263 line++;
264 }
265
266 return true;
[c1a8ae52]267}
268
[032e0bb]269static char *get_device_name(char *line)
270{
271 /* Skip leading spaces. */
272 while (*line != '\0' && isspace(*line)) {
[c1a8ae52]273 line++;
274 }
[032e0bb]275
276 /* Get the name part of the rest of the line. */
277 strtok(line, ":");
278
279 /* Allocate output buffer. */
[5dc9622]280 size_t size = str_size(line) + 1;
281 char *name = malloc(size);
[032e0bb]282
283 if (name != NULL) {
284 /* Copy the result to the output buffer. */
[5dc9622]285 str_cpy(name, size, line);
[c1a8ae52]286 }
287
288 return name;
289}
290
[032e0bb]291static inline char *skip_spaces(char *line)
[c1a8ae52]292{
[032e0bb]293 /* Skip leading spaces. */
294 while (*line != '\0' && isspace(*line))
[c1a8ae52]295 line++;
296
[032e0bb]297 return line;
298}
[c1a8ae52]299
[68414f4a]300static void isa_fun_set_irq(isa_fun_t *fun, int irq)
[c1a8ae52]301{
[68414f4a]302 size_t count = fun->hw_resources.count;
303 hw_resource_t *resources = fun->hw_resources.resources;
[032e0bb]304
[5dc9622]305 if (count < ISA_MAX_HW_RES) {
306 resources[count].type = INTERRUPT;
307 resources[count].res.interrupt.irq = irq;
[032e0bb]308
[68414f4a]309 fun->hw_resources.count++;
[032e0bb]310
[ebcb05a]311 ddf_msg(LVL_NOTE, "Added irq 0x%x to function %s", irq,
[68414f4a]312 fun->fnode->name);
[032e0bb]313 }
[5dc9622]314}
315
[68414f4a]316static void isa_fun_set_io_range(isa_fun_t *fun, size_t addr, size_t len)
[5dc9622]317{
[68414f4a]318 size_t count = fun->hw_resources.count;
319 hw_resource_t *resources = fun->hw_resources.resources;
[032e0bb]320
[5dc9622]321 if (count < ISA_MAX_HW_RES) {
322 resources[count].type = IO_RANGE;
323 resources[count].res.io_range.address = addr;
324 resources[count].res.io_range.size = len;
[032e0bb]325 resources[count].res.io_range.endianness = LITTLE_ENDIAN;
326
[68414f4a]327 fun->hw_resources.count++;
[032e0bb]328
[fc51296]329 ddf_msg(LVL_NOTE, "Added io range (addr=0x%x, size=0x%x) to "
[ebcb05a]330 "function %s", (unsigned int) addr, (unsigned int) len,
[68414f4a]331 fun->fnode->name);
[032e0bb]332 }
[c1a8ae52]333}
334
[68414f4a]335static void fun_parse_irq(isa_fun_t *fun, char *val)
[c1a8ae52]336{
337 int irq = 0;
338 char *end = NULL;
[032e0bb]339
[8b1e15ac]340 val = skip_spaces(val);
[5dc9622]341 irq = (int)strtol(val, &end, 0x10);
[032e0bb]342
343 if (val != end)
[8b1e15ac]344 isa_fun_set_irq(fun, irq);
[c1a8ae52]345}
346
[68414f4a]347static void fun_parse_io_range(isa_fun_t *fun, char *val)
[c1a8ae52]348{
[5dc9622]349 size_t addr, len;
350 char *end = NULL;
[032e0bb]351
[8b1e15ac]352 val = skip_spaces(val);
[5dc9622]353 addr = strtol(val, &end, 0x10);
[032e0bb]354
355 if (val == end)
[5dc9622]356 return;
[032e0bb]357
[8b1e15ac]358 val = skip_spaces(end);
[5dc9622]359 len = strtol(val, &end, 0x10);
[032e0bb]360
361 if (val == end)
[5dc9622]362 return;
[032e0bb]363
[8b1e15ac]364 isa_fun_set_io_range(fun, addr, len);
[c1a8ae52]365}
366
[5dc9622]367static void get_match_id(char **id, char *val)
[c1a8ae52]368{
[5dc9622]369 char *end = val;
[032e0bb]370
371 while (!isspace(*end))
[5dc9622]372 end++;
[032e0bb]373
[f928a8a]374 size_t size = end - val + 1;
[5dc9622]375 *id = (char *)malloc(size);
[032e0bb]376 str_cpy(*id, size, val);
[5dc9622]377}
378
[68414f4a]379static void fun_parse_match_id(isa_fun_t *fun, char *val)
[032e0bb]380{
[5dc9622]381 char *id = NULL;
382 int score = 0;
383 char *end = NULL;
[cd0684d]384 int rc;
[032e0bb]385
[68414f4a]386 val = skip_spaces(val);
[032e0bb]387
[5fe1c32]388 score = (int)strtol(val, &end, 10);
[5dc9622]389 if (val == end) {
[fc51296]390 ddf_msg(LVL_ERROR, "Cannot read match score for function "
[ebcb05a]391 "%s.", fun->fnode->name);
[5dc9622]392 return;
393 }
[032e0bb]394
[bab6388]395 val = skip_spaces(end);
[5dc9622]396 get_match_id(&id, val);
[032e0bb]397 if (id == NULL) {
[ebcb05a]398 ddf_msg(LVL_ERROR, "Cannot read match ID for function %s.",
[fc51296]399 fun->fnode->name);
[5dc9622]400 return;
401 }
[032e0bb]402
[fc51296]403 ddf_msg(LVL_DEBUG, "Adding match id '%s' with score %d to "
[ebcb05a]404 "function %s", id, score, fun->fnode->name);
[cd0684d]405
406 rc = ddf_fun_add_match_id(fun->fnode, id, score);
[fc51296]407 if (rc != EOK) {
[ebcb05a]408 ddf_msg(LVL_ERROR, "Failed adding match ID: %s",
[fc51296]409 str_error(rc));
410 }
[ef9460b]411
412 free(id);
[c1a8ae52]413}
414
[68414f4a]415static bool prop_parse(isa_fun_t *fun, char *line, const char *prop,
416 void (*read_fn)(isa_fun_t *, char *))
[5fe1c32]417{
418 size_t proplen = str_size(prop);
[032e0bb]419
420 if (str_lcmp(line, prop, proplen) == 0) {
[5fe1c32]421 line += proplen;
422 line = skip_spaces(line);
[8b1e15ac]423 (*read_fn)(fun, line);
[032e0bb]424
[5fe1c32]425 return true;
426 }
[032e0bb]427
428 return false;
[5fe1c32]429}
430
[68414f4a]431static void fun_prop_parse(isa_fun_t *fun, char *line)
[c1a8ae52]432{
[032e0bb]433 /* Skip leading spaces. */
[c1a8ae52]434 line = skip_spaces(line);
[032e0bb]435
[68414f4a]436 if (!prop_parse(fun, line, "io_range", &fun_parse_io_range) &&
437 !prop_parse(fun, line, "irq", &fun_parse_irq) &&
[fc51296]438 !prop_parse(fun, line, "match", &fun_parse_match_id)) {
439
[ebcb05a]440 ddf_msg(LVL_ERROR, "Undefined device property at line '%s'",
[fc51296]441 line);
[032e0bb]442 }
[c1a8ae52]443}
444
[68414f4a]445static void fun_hw_res_alloc(isa_fun_t *fun)
[5dc9622]446{
[818fffe]447 fun->hw_resources.resources =
[032e0bb]448 (hw_resource_t *)malloc(sizeof(hw_resource_t) * ISA_MAX_HW_RES);
[5dc9622]449}
450
[f278930]451static void fun_hw_res_free(isa_fun_t *fun)
452{
453 free(fun->hw_resources.resources);
454 fun->hw_resources.resources = NULL;
455}
456
457static char *isa_fun_read_info(char *fun_conf, isa_bus_t *isa)
[c1a8ae52]458{
459 char *line;
[8b1e15ac]460 char *fun_name = NULL;
[032e0bb]461
462 /* Skip empty lines. */
463 while (true) {
[8b1e15ac]464 line = str_get_line(fun_conf, &fun_conf);
[032e0bb]465
466 if (line == NULL) {
467 /* no more lines */
[c1a8ae52]468 return NULL;
469 }
[032e0bb]470
471 if (!line_empty(line))
[c1a8ae52]472 break;
473 }
[032e0bb]474
475 /* Get device name. */
[8b1e15ac]476 fun_name = get_device_name(line);
477 if (fun_name == NULL)
[c1a8ae52]478 return NULL;
[032e0bb]479
[f278930]480 isa_fun_t *fun = isa_fun_create(isa, fun_name);
[8b1e15ac]481 if (fun == NULL) {
482 free(fun_name);
[c1a8ae52]483 return NULL;
484 }
[032e0bb]485
486 /* Allocate buffer for the list of hardware resources of the device. */
[68414f4a]487 fun_hw_res_alloc(fun);
[032e0bb]488
489 /* Get properties of the device (match ids, irq and io range). */
490 while (true) {
[8b1e15ac]491 line = str_get_line(fun_conf, &fun_conf);
[032e0bb]492
[5dc9622]493 if (line_empty(line)) {
[032e0bb]494 /* no more device properties */
[5dc9622]495 break;
496 }
[032e0bb]497
498 /*
499 * Get the device's property from the configuration line
500 * and store it in the device structure.
501 */
[68414f4a]502 fun_prop_parse(fun, line);
[c1a8ae52]503 }
[032e0bb]504
505 /* Set device operations to the device. */
[97a62fe]506 fun->fnode->ops = &isa_fun_ops;
507
[ebcb05a]508 ddf_msg(LVL_DEBUG, "Binding function %s.", fun->fnode->name);
[032e0bb]509
[97a62fe]510 /* XXX Handle error */
511 (void) ddf_fun_bind(fun->fnode);
[032e0bb]512
[f278930]513 list_append(&fun->bus_link, &isa->functions);
514
[8b1e15ac]515 return fun_conf;
[c1a8ae52]516}
517
[f278930]518static void fun_conf_parse(char *conf, isa_bus_t *isa)
[c1a8ae52]519{
[032e0bb]520 while (conf != NULL && *conf != '\0') {
[f278930]521 conf = isa_fun_read_info(conf, isa);
[032e0bb]522 }
[c1a8ae52]523}
524
[f278930]525static void isa_functions_add(isa_bus_t *isa)
[c1a8ae52]526{
[8b1e15ac]527 char *fun_conf;
[032e0bb]528
[68414f4a]529 fun_conf = fun_conf_read(CHILD_FUN_CONF_PATH);
[8b1e15ac]530 if (fun_conf != NULL) {
[f278930]531 fun_conf_parse(fun_conf, isa);
[8b1e15ac]532 free(fun_conf);
[c1a8ae52]533 }
534}
[892e4e1]535
[83a2f43]536static int isa_add_device(ddf_dev_t *dev)
[892e4e1]537{
[f278930]538 isa_bus_t *isa;
539
[ebcb05a]540 ddf_msg(LVL_DEBUG, "isa_add_device, device handle = %d",
[ab3a851]541 (int) dev->handle);
[032e0bb]542
[f278930]543 isa = ddf_dev_data_alloc(dev, sizeof(isa_bus_t));
544 if (isa == NULL)
545 return ENOMEM;
546
547 fibril_mutex_initialize(&isa->mutex);
548 isa->dev = dev;
549 list_initialize(&isa->functions);
550
[8b1e15ac]551 /* Make the bus device more visible. Does not do anything. */
[ebcb05a]552 ddf_msg(LVL_DEBUG, "Adding a 'ctl' function");
[8b1e15ac]553
[f278930]554 fibril_mutex_lock(&isa->mutex);
555
556 isa->fctl = ddf_fun_create(dev, fun_exposed, "ctl");
557 if (isa->fctl == NULL) {
[ebcb05a]558 ddf_msg(LVL_ERROR, "Failed creating control function.");
[97a62fe]559 return EXDEV;
560 }
561
[f278930]562 if (ddf_fun_bind(isa->fctl) != EOK) {
563 ddf_fun_destroy(isa->fctl);
[ebcb05a]564 ddf_msg(LVL_ERROR, "Failed binding control function.");
[97a62fe]565 return EXDEV;
566 }
[8b1e15ac]567
[68414f4a]568 /* Add functions as specified in the configuration file. */
[f278930]569 isa_functions_add(isa);
[ebcb05a]570 ddf_msg(LVL_NOTE, "Finished enumerating legacy functions");
[032e0bb]571
[f278930]572 fibril_mutex_unlock(&isa->mutex);
573
574 return EOK;
575}
576
577static int isa_dev_remove(ddf_dev_t *dev)
578{
579 isa_bus_t *isa = ISA_BUS(dev);
580 int rc;
581
582 fibril_mutex_lock(&isa->mutex);
583
584 while (!list_empty(&isa->functions)) {
585 isa_fun_t *fun = list_get_instance(list_first(&isa->functions),
586 isa_fun_t, bus_link);
587
588 rc = ddf_fun_offline(fun->fnode);
589 if (rc != EOK) {
590 fibril_mutex_unlock(&isa->mutex);
591 ddf_msg(LVL_ERROR, "Failed offlining %s", fun->fnode->name);
592 return rc;
593 }
594
595 rc = ddf_fun_unbind(fun->fnode);
596 if (rc != EOK) {
597 fibril_mutex_unlock(&isa->mutex);
598 ddf_msg(LVL_ERROR, "Failed unbinding %s", fun->fnode->name);
599 return rc;
600 }
601
602 list_remove(&fun->bus_link);
603
604 fun_hw_res_free(fun);
605 ddf_fun_destroy(fun->fnode);
606 }
607
608 if (ddf_fun_unbind(isa->fctl) != EOK) {
609 fibril_mutex_unlock(&isa->mutex);
610 ddf_msg(LVL_ERROR, "Failed unbinding control function.");
611 return EXDEV;
612 }
613
614 fibril_mutex_unlock(&isa->mutex);
615
[df747b9c]616 return EOK;
[892e4e1]617}
618
[5b68e0c]619static int isa_fun_online(ddf_fun_t *fun)
620{
621 ddf_msg(LVL_DEBUG, "isa_fun_online()");
622 return ddf_fun_online(fun);
623}
624
625static int isa_fun_offline(ddf_fun_t *fun)
626{
627 ddf_msg(LVL_DEBUG, "isa_fun_offline()");
628 return ddf_fun_offline(fun);
629}
630
631
[1a11a16]632static void isa_init()
[5dc9622]633{
[fc51296]634 ddf_log_init(NAME, LVL_ERROR);
[68414f4a]635 isa_fun_ops.interfaces[HW_RES_DEV_IFACE] = &isa_fun_hw_res_ops;
[5dc9622]636}
637
[892e4e1]638int main(int argc, char *argv[])
639{
[032e0bb]640 printf(NAME ": HelenOS ISA bus driver\n");
[5dc9622]641 isa_init();
[83a2f43]642 return ddf_driver_main(&isa_driver);
[892e4e1]643}
644
645/**
646 * @}
647 */
Note: See TracBrowser for help on using the repository browser.