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 #include <sys/time.h>
00026
00027 #ifdef __cplusplus
00028 extern "C" {
00029 #endif
00030
00157 struct uiomux;
00158 typedef struct uiomux UIOMux;
00159
00164 uiomux_resource_t
00165 uiomux_query(void);
00166
00170 const char * uiomux_name(uiomux_resource_t resource);
00171
00182 int uiomux_list_device(char ***names, int *count);
00183
00189 int
00190 uiomux_info (UIOMux * uiomux);
00191
00197 int
00198 uiomux_meminfo (UIOMux * uiomux);
00199
00205 UIOMux *
00206 uiomux_open (void);
00207
00213 UIOMux *
00214 uiomux_open_blocks(uiomux_resource_t resources);
00215
00225 UIOMux *
00226 uiomux_open_named(const char *name[]);
00227
00233 int
00234 uiomux_close (UIOMux * uiomux);
00235
00246 uiomux_resource_t
00247 uiomux_check_resource(struct uiomux *uiomux, uiomux_resource_t resource);
00248
00257 char *uiomux_check_name(struct uiomux *uiomux, uiomux_resource_t resource);
00258
00265 int
00266 uiomux_lock (UIOMux * uiomux, uiomux_resource_t resources);
00267
00274 int
00275 uiomux_unlock (UIOMux * uiomux, uiomux_resource_t resources);
00276
00283 int
00284 uiomux_sleep (UIOMux * uiomux, uiomux_resource_t resource);
00285
00296 int
00297 uiomux_sleep_timeout (UIOMux * uiomux, uiomux_resource_t resource,
00298 struct timeval *timeout);
00299
00309 int
00310 uiomux_wakeup(struct uiomux *uiomux, uiomux_resource_t resource);
00311
00322 unsigned long
00323 uiomux_get_mmio (UIOMux * uiomux, uiomux_resource_t resource,
00324 unsigned long * address, unsigned long * size, void ** iomem);
00325
00336 unsigned long
00337 uiomux_get_mem (UIOMux * uiomux, uiomux_resource_t resource,
00338 unsigned long * address, unsigned long * size, void ** iomem);
00339
00349 unsigned long
00350 uiomux_virt_to_phys (UIOMux * uiomux, uiomux_resource_t resource,
00351 void * virt_address);
00352
00359 unsigned long
00360 uiomux_all_virt_to_phys (void * virt_address);
00361
00371 void *
00372 uiomux_phys_to_virt(UIOMux * uiomux, uiomux_resource_t resource,
00373 unsigned long phys_address);
00374
00385 void *
00386 uiomux_malloc (UIOMux * uiomux, uiomux_resource_t resource,
00387 size_t size, int align);
00388
00400 void *
00401 uiomux_malloc_shared (UIOMux * uiomux, uiomux_resource_t resource,
00402 size_t size, int align);
00403
00411 void
00412 uiomux_free (UIOMux * uiomux, uiomux_resource_t resource,
00413 void * address, size_t size);
00414
00424 int
00425 uiomux_register (void *virt, unsigned long phys_address, size_t size);
00426
00434 int
00435 uiomux_unregister (void *virt);
00436
00437
00438 #include <uiomux/system.h>
00439 #include <uiomux/dump.h>
00440
00441 #ifdef __cplusplus
00442 }
00443 #endif
00444
00445 #endif