Skip to content

Commit

Permalink
update README with info on sleep, malloc and free functions
Browse files Browse the repository at this point in the history
  • Loading branch information
kfish committed May 22, 2009
1 parent fcff54c commit 40ef5b8
Showing 1 changed file with 27 additions and 1 deletion.
28 changes: 27 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,14 @@ deterministic locking and unlocking order to avoid circular waiting.
Processes or threads requiring simultaneous access to more than one resource
should lock and unlock them simultaneously via libuiomux.

UIOMux will save and restore memory-mapped IO registers associated with a
UIO devices report activity through a read of their file descriptor. UIOMux
provides a simplified interface for waiting for a UIO managed resource.

UIOMux provides functions for allocating the UIO memory reserved by the
kernel for each device. Allocations are tied to the calling process ID, and
are cleared on process exit.

UIOMux can save and restore memory-mapped IO registers associated with a
UIO device. Registers are saved on uiomux_unlock() and restored on
uiomux_lock(), if intervening users have used the device.

Expand All @@ -61,6 +68,7 @@ Commandline tool
Reporting:
query List available UIO device names that can be managed by UIOMux.
info Show memory layout of each UIO device managed by UIOMux.
meminfo Show memory allocations of each UIO device managed by UIOMux.

Management:
reset Reset the UIOMux system. This initializes the UIOMux shared state,
Expand All @@ -71,6 +79,7 @@ Commandline tool
tool's 'info' and 'reset' commands.



libuiomux API
-------------

Expand Down Expand Up @@ -136,6 +145,23 @@ Note however that all locks obtained via libuiomux will be automatically
unlocked on program termination to minimize the potential damage caused by
rogue processes.

UIO devices report activity through a read of their file descriptor. A
simplified interface is offered for waiting for a UIO managed resource:

uiomux_sleep (uiomux, resource);

UIOMux also provides a co-operative memory allocation scheme. To allocate
memory from a UIO managed resource:

uiomux_malloc (uiomux, resource, size, alignment);

To free allocated memory from a UIO managed resource:

uiomux_free (uiomux, resource, address, size);

Note that any outstanding allocations are removed on process exit, and any
invalid allocations are cleared on uiomux_open().

Finally, each process or thread that opened a UIOMux* handle should
close it by calling uiomux_close(). This will remove associated memory maps,
unlock locked resources and mark used memory for deallocation:
Expand Down

0 comments on commit 40ef5b8

Please sign in to comment.