Changeset af6b5157 in mainline for uspace/lib/drv/include/ddf/driver.h
- Timestamp:
- 2011-02-15T20:09:24Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 2a770a35
- Parents:
- 83a2f43
- File:
-
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/drv/include/ddf/driver.h
r83a2f43 raf6b5157 1 1 /* 2 2 * Copyright (c) 2010 Lenka Trochtova 3 * Copyright (c) 2011 Jiri Svoboda 3 4 * All rights reserved. 4 5 * … … 33 34 */ 34 35 35 #ifndef LIBDRV_DRIVER_H_36 #define LIBDRV_DRIVER_H_36 #ifndef DDF_DRIVER_H_ 37 #define DDF_DRIVER_H_ 37 38 38 #include <kernel/ddi/irq.h>39 #include <adt/list.h>40 #include <devman.h>41 39 #include <ipc/devman.h> 42 40 #include <ipc/dev_iface.h> 43 #include <assert.h>44 #include <ddi.h>45 #include <libarch/ddi.h>46 #include <fibril_synch.h>47 #include <malloc.h>48 41 49 #include " dev_iface.h"42 #include "../dev_iface.h" 50 43 51 44 typedef struct ddf_dev ddf_dev_t; … … 53 46 54 47 /* 55 * Device class48 * Device 56 49 */ 57 50 … … 80 73 remote_handler_t *default_handler; 81 74 } ddf_dev_ops_t; 82 83 /*84 * Device85 */86 75 87 76 /** Device structure */ … … 160 149 extern int ddf_fun_add_match_id(ddf_fun_t *, const char *, int); 161 150 162 extern void *function_get_ops(ddf_fun_t *, dev_inferface_idx_t);163 164 /*165 * Interrupts166 */167 168 typedef void interrupt_handler_t(ddf_dev_t *, ipc_callid_t, ipc_call_t *);169 170 typedef struct interrupt_context {171 int id;172 ddf_dev_t *dev;173 int irq;174 interrupt_handler_t *handler;175 link_t link;176 } interrupt_context_t;177 178 typedef struct interrupt_context_list {179 int curr_id;180 link_t contexts;181 fibril_mutex_t mutex;182 } interrupt_context_list_t;183 184 extern interrupt_context_t *create_interrupt_context(void);185 extern void delete_interrupt_context(interrupt_context_t *);186 extern void init_interrupt_context_list(interrupt_context_list_t *);187 extern void add_interrupt_context(interrupt_context_list_t *,188 interrupt_context_t *);189 extern void remove_interrupt_context(interrupt_context_list_t *,190 interrupt_context_t *);191 extern interrupt_context_t *find_interrupt_context_by_id(192 interrupt_context_list_t *, int);193 extern interrupt_context_t *find_interrupt_context(194 interrupt_context_list_t *, ddf_dev_t *, int);195 196 extern int register_interrupt_handler(ddf_dev_t *, int, interrupt_handler_t *,197 irq_code_t *);198 extern int unregister_interrupt_handler(ddf_dev_t *, int);199 200 extern remote_handler_t *function_get_default_handler(ddf_fun_t *);201 151 extern int ddf_fun_add_to_class(ddf_fun_t *fun, const char *class_name); 202 152
Note:
See TracChangeset
for help on using the changeset viewer.