00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef __UIOMUX_H__
00021 #define __UIOMUX_H__
00022
00023 #include <stdlib.h>
00024 #include <uiomux/resource.h>
00025
00026 #ifdef __cplusplus
00027 extern "C" {
00028 #endif
00029
00156 struct uiomux;
00157 typedef struct uiomux UIOMux;
00158
00163 uiomux_resource_t
00164 uiomux_query(void);
00165
00169 const char * uiomux_name(uiomux_resource_t resource);
00170
00177 int uiomux_list_device(char ***names, int *count);
00178
00184 int
00185 uiomux_info (UIOMux * uiomux);
00186
00192 int
00193 uiomux_meminfo (UIOMux * uiomux);
00194
00200 UIOMux *
00201 uiomux_open (void);
00202
00208 UIOMux *
00209 uiomux_open_blocks(uiomux_resource_t resources);
00210
00220 UIOMux *
00221 uiomux_open_named(const char *name[]);
00222
00228 int
00229 uiomux_close (UIOMux * uiomux);
00230
00241 uiomux_resource_t
00242 uiomux_check_resource(struct uiomux *uiomux, uiomux_resource_t resource);
00243
00252 char *uiomux_check_name(struct uiomux *uiomux, uiomux_resource_t resource);
00253
00260 int
00261 uiomux_lock (UIOMux * uiomux, uiomux_resource_t resources);
00262
00269 int
00270 uiomux_unlock (UIOMux * uiomux, uiomux_resource_t resources);
00271
00278 int
00279 uiomux_sleep (UIOMux * uiomux, uiomux_resource_t resource);
00280
00291 int
00292 uiomux_sleep_timeout (UIOMux * uiomux, uiomux_resource_t resource,
00293 struct timeval *timeout);
00294
00304 int
00305 uiomux_wakeup(struct uiomux *uiomux, uiomux_resource_t resource);
00306
00317 unsigned long
00318 uiomux_get_mmio (UIOMux * uiomux, uiomux_resource_t resource,
00319 unsigned long * address, unsigned long * size, void ** iomem);
00320
00331 unsigned long
00332 uiomux_get_mem (UIOMux * uiomux, uiomux_resource_t resource,
00333 unsigned long * address, unsigned long * size, void ** iomem);
00334
00344 unsigned long
00345 uiomux_virt_to_phys (UIOMux * uiomux, uiomux_resource_t resource,
00346 void * virt_address);
00347
00354 unsigned long
00355 uiomux_all_virt_to_phys (void * virt_address);
00356
00366 void *
00367 uiomux_phys_to_virt(UIOMux * uiomux, uiomux_resource_t resource,
00368 unsigned long phys_address);
00369
00380 void *
00381 uiomux_malloc (UIOMux * uiomux, uiomux_resource_t resource,
00382 size_t size, int align);
00383
00395 void *
00396 uiomux_malloc_shared (UIOMux * uiomux, uiomux_resource_t resource,
00397 size_t size, int align);
00398
00406 void
00407 uiomux_free (UIOMux * uiomux, uiomux_resource_t resource,
00408 void * address, size_t size);
00409
00419 int
00420 uiomux_register (void *virt, unsigned long phys_address, size_t size);
00421
00429 int
00430 uiomux_unregister (void *virt);
00431
00432
00433 #include <uiomux/system.h>
00434 #include <uiomux/dump.h>
00435
00436 #ifdef __cplusplus
00437 }
00438 #endif
00439
00440 #endif
00441