lib: consolidate util macros in util/util.h This change groups the offsetof, container_of and ARRAY_SIZE macros in a single header file util/util.h. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
lib/list: Fix handling of empty lists The current list_for_each_entry_safe marco SEGVs on empty lists; the list_entry will give us a NULL tmp on the first iteration. This change removes the use of list_entry, as we're effectively by-passing its NULL return semantics with our own. Signed-off-by: Jeremy Kerr <jk@ozlabs.org> Signed-off-by: Geoff Levand <geoff@infradead.org>
list: Fix seg fault with list_for_each_entry_safe Signed-off-by: Geoff Levand <geoff@infradead.org>
lib/list: Add list_for_each_entry_safe Add a list iterator that is safe against deletion of the current element. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Add new macro DEFINE_LIST() Signed-off-by: Geoff Levand <geoff@infradead.org>
Add list_prev_entry, list_next_entry Signed-off-by: Geoff Levand <geoff@infradead.org>
Return NULL for head list_entry Signed-off-by: Geoff Levand <geoff@infradead.org>
Cleanup list formatting Signed-off-by: Geoff Levand <geoff@infradead.org>
Add STATIC_LIST initializer Signed-off-by: Geoff Levand <geoff@infradead.org>
Rename symbol new Change the symbol 'new' to an alternative. The symbol new is reserved for C++ compilers. Signed-off-by: Geoff Levand <geoffrey.levand@am.sony.com>
Add list_for_each_entry_continue routine Add a new list iteration routine list_for_each_entry_continue(). Continues iteration from a user specified list item. Signed-off-by: Geoff Levand <geoffrey.levand@am.sony.com>
Add list insert routines Add new list insertion routines list_insert_before(), list_insert_after(), and list_add_tail(). Also, change list_add() to use list_insert_after(). Signed-off-by: Geoff Levand <geoffrey.levand@am.sony.com> Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Use talloc for device handler destruction Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Add device handler cleanup Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Initial support for multiple UIs Move the device discovery code from separate udev helpers to a single process to listen on two sockets: one SOCK_DGRAM for incoming udev events, and one SOCK_STREAM for UIs to connect. Initial support for client/server infrastructure, still need to wire-up the udev messages. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>