Not needed in rm48 branch.
+++ /dev/null
-######################################
-# uLan utility library #
-######################################
-
-RPP driver library uses the uLan utility library to support some features.
-
-For information about uLan library visit:
-
- http://ulan.sourceforge.net/
+++ /dev/null
-#ifndef _UL_ITBASE_H
-#define _UL_ITBASE_H
-
-#include "ul_utdefs.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#define UL_ITBASE_UL_DEC(cust_prefix, cust_container_t, cust_item_t) \
-typedef struct { cust_container_t *container; cust_item_t *item;}\
- cust_prefix##_it_t;\
-static inline cust_item_t * \
-cust_prefix##_it2item(const cust_prefix##_it_t *it)\
-{\
- return it->item;\
-}\
-static inline void \
-cust_prefix##_first_it(cust_container_t *container, cust_prefix##_it_t *it)\
-{\
- it->container=container;\
- it->item=cust_prefix##_first(container);\
-}\
-static inline void \
-cust_prefix##_last_it(cust_container_t *container, cust_prefix##_it_t *it)\
-{\
- it->container=container;\
- it->item=cust_prefix##_last(container);\
-}\
-static inline void \
-cust_prefix##_next_it(cust_prefix##_it_t *it)\
-{\
- if(it->item) it->item=cust_prefix##_next(it->container,it->item);\
- else it->item=cust_prefix##_first(it->container);\
-}\
-static inline void \
-cust_prefix##_prev_it(cust_prefix##_it_t *it)\
-{\
- if(it->item) it->item=cust_prefix##_prev(it->container,it->item);\
- else it->item=cust_prefix##_last(it->container);\
-}\
-static inline int \
-cust_prefix##_is_end_it(cust_prefix##_it_t *it)\
-{\
- return !it->item;\
-}\
-static inline void \
-cust_prefix##_delete_it(cust_prefix##_it_t *it)\
-{\
- cust_item_t *p;\
- if(!(p=it->item)) return;\
- it->item=cust_prefix##_next(it->container,it->item);\
- cust_prefix##_delete(it->container,p);\
-}
-
-#define UL_ITBASE_SORT_DEC(cust_prefix, cust_container_t, cust_item_t, cust_key_t) \
-UL_ITBASE_UL_DEC(cust_prefix, cust_container_t, cust_item_t) \
-static inline int \
-cust_prefix##_find_it(cust_container_t *container, cust_key_t *key, cust_prefix##_it_t *it)\
-{\
- it->container=container;\
- return (it->item=cust_prefix##_find(container, key))!=0;\
-}\
-static inline int \
-cust_prefix##_find_first_it(cust_container_t *container, cust_key_t *key, cust_prefix##_it_t *it)\
-{\
- it->container=container;\
- return (it->item=cust_prefix##_find_first(container, key))!=0;\
-}\
-static inline int \
-cust_prefix##_find_after_it(cust_container_t *container, cust_key_t *key, cust_prefix##_it_t *it)\
-{\
- it->container=container;\
- return (it->item=cust_prefix##_find_after(container, key))!=0;\
-}
-
-#define ul_for_each_it(cust_prefix, root, it) \
- for(cust_prefix##_first_it(root,&it);\
- !cust_prefix##_is_end_it(&it);cust_prefix##_next_it(&it))
-
-#define ul_for_each_rev_it(cust_prefix, root, it) \
- for(cust_prefix##_last_it(root,&it);\
- !cust_prefix##_is_end_it(&it);cust_prefix##_prev_it(&it))
-
-#define ul_for_each_from_it(cust_prefix, root, key, it) \
- for(cust_prefix##_find_first_it(root, key, &it);\
- !cust_prefix##_is_end_it(&it);cust_prefix##_next_it(&it))
-
-#define ul_for_each_after_it(cust_prefix, root, key, it) \
- for(cust_prefix##_find_after_it(root, key, &it);\
- !cust_prefix##_is_end_it(&it);cust_prefix##_next_it(&it))
-
-#ifdef __cplusplus
-} /* extern "C"*/
-#endif
-
-#endif /* _UL_ITBASE_H */
+++ /dev/null
-#ifndef _UL_LISTS_H
-#define _UL_LISTS_H
-
-#include "ul_utdefs.h"
-#include "ul_listbase.h"
-#include "ul_itbase.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-typedef struct list_head ul_list_node_t;
-typedef struct list_head ul_list_head_t;
-
-#define UL_LIST_CUST_DEC(cust_prefix, cust_head_t, cust_item_t,\
- cust_head_field, cust_node_field) \
-\
-static inline cust_item_t * \
-cust_prefix##_node2item(const cust_head_t *head, const ul_list_node_t *node) \
- {return UL_CONTAINEROF(node, cust_item_t, cust_node_field);}\
-\
-static inline void \
-cust_prefix##_init_head(cust_head_t *head)\
-{\
- INIT_LIST_HEAD(&head->cust_head_field);\
-}\
-static inline void \
-cust_prefix##_init_detached(cust_item_t *item) { \
- INIT_LIST_HEAD(&item->cust_node_field); \
-} \
-static inline cust_item_t *\
-cust_prefix##_first(const cust_head_t *head)\
-{\
- ul_list_node_t *n=head->cust_head_field.next;\
- return (n!=&head->cust_head_field)?cust_prefix##_node2item(head,n):NULL;\
-}\
-static inline cust_item_t *\
-cust_prefix##_last(const cust_head_t *head)\
-{\
- ul_list_node_t *n=head->cust_head_field.prev;\
- return (n!=&head->cust_head_field)?cust_prefix##_node2item(head,n):NULL;\
-}\
-static inline cust_item_t *\
-cust_prefix##_next(const cust_head_t *head, const cust_item_t *item)\
-{\
- ul_list_node_t *n=item->cust_node_field.next;\
- return (n!=&head->cust_head_field)?cust_prefix##_node2item(head,n):NULL;\
-}\
-static inline cust_item_t *\
-cust_prefix##_prev(const cust_head_t *head, const cust_item_t *item)\
-{\
- ul_list_node_t *n=item->cust_node_field.prev;\
- return (n!=&head->cust_head_field)?cust_prefix##_node2item(head,n):NULL;\
-}\
-static inline int \
-cust_prefix##_is_empty(const cust_head_t *head)\
-{\
- return head->cust_head_field.next==&head->cust_head_field;\
-}\
-static inline void \
-cust_prefix##_ins_head(cust_head_t *head, cust_item_t *item)\
-{\
- list_add(&item->cust_node_field, &head->cust_head_field);\
-}\
-static inline void \
-cust_prefix##_ins_tail(cust_head_t *head, cust_item_t *item)\
-{\
- list_add_tail(&item->cust_node_field, &head->cust_head_field);\
-}\
-static inline void \
-cust_prefix##_insert(cust_head_t *head, cust_item_t *item)\
-{\
- cust_prefix##_ins_tail(head, item);\
-}\
-static inline void \
-cust_prefix##_delete(cust_head_t *head, cust_item_t *item)\
-{\
- list_del_init(&item->cust_node_field);\
-}\
-static inline void \
-cust_prefix##_del_item(cust_item_t *item)\
-{\
- list_del_init(&item->cust_node_field);\
-}\
-static inline cust_item_t *\
-cust_prefix##_cut_first(cust_head_t *head)\
-{\
- ul_list_node_t *n=head->cust_head_field.next;\
- if(n==&head->cust_head_field) return NULL;\
- list_del_init(n);\
- return cust_prefix##_node2item(head,n);\
-}\
-/*** Iterators ***/\
-UL_ITBASE_UL_DEC(cust_prefix, cust_head_t, cust_item_t)
-
-
-#define ul_list_for_each(cust_prefix, head, ptr) \
- for(ptr=cust_prefix##_first(head);ptr;ptr=cust_prefix##_next((head),ptr))
-
-#define ul_list_for_each_rev(cust_prefix, head, ptr) \
- for(ptr=cust_prefix##_last(head);ptr;ptr=cust_prefix##_prev((head),ptr))
-
-#define ul_list_for_each_cut(cust_prefix, head, ptr) \
- for(;(ptr=cust_prefix##_cut_first(head));)
-
-#ifdef __cplusplus
-} /* extern "C"*/
-#endif
-
-#endif /* _UL_LISTS_H */
+++ /dev/null
-#ifndef _UL_LISTBASE_H
-#define _UL_LISTBASE_H
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifndef __KERNEL__
-
-#define LIST_POISON1 ((struct list_head *) 0)
-#define LIST_POISON2 ((struct list_head *) 0)
-
-/*
- * Simple doubly linked list implementation.
- *
- * Some of the internal functions ("__xxx") are useful when
- * manipulating whole lists rather than single entries, as
- * sometimes we already know the next/prev entries and we can
- * generate better code by using them directly rather than
- * using the generic single-entry routines.
- */
-
-struct list_head {
- struct list_head *next, *prev;
-};
-
-#define LIST_HEAD_INIT(name) { &(name), &(name) }
-
-#define LIST_HEAD(name) \
- struct list_head name = LIST_HEAD_INIT(name)
-
-#define INIT_LIST_HEAD(ptr) do { \
- (ptr)->next = (ptr); (ptr)->prev = (ptr); \
-} while (0)
-
-/*
- * Insert a new entry between two known consecutive entries.
- *
- * This is only for internal list manipulation where we know
- * the prev/next entries already!
- */
-static inline void __list_add(struct list_head *newe,
- struct list_head *prev,
- struct list_head *next)
-{
- next->prev = newe;
- newe->next = next;
- newe->prev = prev;
- prev->next = newe;
-}
-
-/**
- * list_add - add a new entry
- * @new: new entry to be added
- * @head: list head to add it after
- *
- * Insert a new entry after the specified head.
- * This is good for implementing stacks.
- */
-static inline void list_add(struct list_head *newe, struct list_head *head)
-{
- __list_add(newe, head, head->next);
-}
-
-/**
- * list_add_tail - add a new entry
- * @newe: new entry to be added
- * @head: list head to add it before
- *
- * Insert a new entry before the specified head.
- * This is useful for implementing queues.
- */
-static inline void list_add_tail(struct list_head *newe, struct list_head *head)
-{
- __list_add(newe, head->prev, head);
-}
-
-/*
- * Delete a list entry by making the prev/next entries
- * point to each other.
- *
- * This is only for internal list manipulation where we know
- * the prev/next entries already!
- */
-static inline void __list_del(struct list_head * prev, struct list_head * next)
-{
- next->prev = prev;
- prev->next = next;
-}
-
-/**
- * list_del - deletes entry from list.
- * @entry: the element to delete from the list.
- * Note: list_empty on entry does not return true after this, the entry is
- * in an undefined state.
- */
-static inline void list_del(struct list_head *entry)
-{
- __list_del(entry->prev, entry->next);
- entry->next = LIST_POISON1;
- entry->prev = LIST_POISON2;
-}
-
-/**
- * list_del_init - deletes entry from list and reinitialize it.
- * @entry: the element to delete from the list.
- */
-static inline void list_del_init(struct list_head *entry)
-{
- __list_del(entry->prev, entry->next);
- INIT_LIST_HEAD(entry);
-}
-
-/**
- * list_move - delete from one list and add as another's head
- * @list: the entry to move
- * @head: the head that will precede our entry
- */
-static inline void list_move(struct list_head *list, struct list_head *head)
-{
- __list_del(list->prev, list->next);
- list_add(list, head);
-}
-
-/**
- * list_move_tail - delete from one list and add as another's tail
- * @list: the entry to move
- * @head: the head that will follow our entry
- */
-static inline void list_move_tail(struct list_head *list,
- struct list_head *head)
-{
- __list_del(list->prev, list->next);
- list_add_tail(list, head);
-}
-
-/**
- * list_empty - tests whether a list is empty
- * @head: the list to test.
- */
-static inline int list_empty(struct list_head *head)
-{
- return head->next == head;
-}
-
-static inline void __list_splice(struct list_head *list,
- struct list_head *head)
-{
- struct list_head *first = list->next;
- struct list_head *last = list->prev;
- struct list_head *where = head->next;
-
- first->prev = head;
- head->next = first;
-
- last->next = where;
- where->prev = last;
-}
-
-/**
- * list_splice - join two lists
- * @list: the new list to add.
- * @head: the place to add it in the first list.
- */
-static inline void list_splice(struct list_head *list, struct list_head *head)
-{
- if (!list_empty(list))
- __list_splice(list, head);
-}
-
-/**
- * list_splice_init - join two lists and reinitialise the emptied list.
- * @list: the new list to add.
- * @head: the place to add it in the first list.
- *
- * The list at @list is reinitialised
- */
-static inline void list_splice_init(struct list_head *list,
- struct list_head *head)
-{
- if (!list_empty(list)) {
- __list_splice(list, head);
- INIT_LIST_HEAD(list);
- }
-}
-
-/**
- * list_entry - get the struct for this entry
- * @ptr: the &struct list_head pointer.
- * @type: the type of the struct this is embedded in.
- * @member: the name of the list_struct within the struct.
- */
-#define list_entry(ptr, type, member) \
- container_of(ptr, type, member)
-
-/**
- * list_for_each - iterate over a list
- * @pos: the &struct list_head to use as a loop counter.
- * @head: the head for your list.
- */
-#define list_for_each(pos, head) \
- for (pos = (head)->next, prefetch(pos->next); pos != (head); \
- pos = pos->next, prefetch(pos->next))
-
-/**
- * __list_for_each - iterate over a list
- * @pos: the &struct list_head to use as a loop counter.
- * @head: the head for your list.
- *
- * This variant differs from list_for_each() in that it's the
- * simplest possible list iteration code, no prefetching is done.
- * Use this for code that knows the list to be very short (empty
- * or 1 entry) most of the time.
- */
-#define __list_for_each(pos, head) \
- for (pos = (head)->next; pos != (head); pos = pos->next)
-
-/**
- * list_for_each_prev - iterate over a list backwards
- * @pos: the &struct list_head to use as a loop counter.
- * @head: the head for your list.
- */
-#define list_for_each_prev(pos, head) \
- for (pos = (head)->prev, prefetch(pos->prev); pos != (head); \
- pos = pos->prev, prefetch(pos->prev))
-
-/**
- * list_for_each_safe - iterate over a list safe against removal of list entry
- * @pos: the &struct list_head to use as a loop counter.
- * @n: another &struct list_head to use as temporary storage
- * @head: the head for your list.
- */
-#define list_for_each_safe(pos, n, head) \
- for (pos = (head)->next, n = pos->next; pos != (head); \
- pos = n, n = pos->next)
-
-/**
- * list_for_each_entry - iterate over list of given type
- * @pos: the type * to use as a loop counter.
- * @head: the head for your list.
- * @member: the name of the list_struct within the struct.
- */
-#define list_for_each_entry(pos, head, member) \
- for (pos = list_entry((head)->next, typeof(*pos), member), \
- prefetch(pos->member.next); \
- &pos->member != (head); \
- pos = list_entry(pos->member.next, typeof(*pos), member), \
- prefetch(pos->member.next))
-
-/**
- * list_for_each_entry_reverse - iterate backwards over list of given type.
- * @pos: the type * to use as a loop counter.
- * @head: the head for your list.
- * @member: the name of the list_struct within the struct.
- */
-#define list_for_each_entry_reverse(pos, head, member) \
- for (pos = list_entry((head)->prev, typeof(*pos), member), \
- prefetch(pos->member.prev); \
- &pos->member != (head); \
- pos = list_entry(pos->member.prev, typeof(*pos), member), \
- prefetch(pos->member.prev))
-
-
-/**
- * list_for_each_entry_safe - iterate over list of given type safe against removal of list entry
- * @pos: the type * to use as a loop counter.
- * @n: another type * to use as temporary storage
- * @head: the head for your list.
- * @member: the name of the list_struct within the struct.
- */
-#define list_for_each_entry_safe(pos, n, head, member) \
- for (pos = list_entry((head)->next, typeof(*pos), member), \
- n = list_entry(pos->member.next, typeof(*pos), member); \
- &pos->member != (head); \
- pos = n, n = list_entry(n->member.next, typeof(*n), member))
-
-#else /*__KERNEL__*/
-
-#include <linux/list.h>
-
-#endif /*__KERNEL__*/
-
-#ifdef __cplusplus
-} /* extern "C"*/
-#endif
-
-#endif /* _UL_LISTBASE_H */
+++ /dev/null
-/*******************************************************************
- uLan Utilities Library - C library of basic reusable constructions
-
- ul_utdefs.h - common defines used in uLan utilities library
-
- *******************************************************************/
-
-
-#ifndef _UL_UTDEFS_H
-#define _UL_UTDEFS_H
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#if defined(_WIN32)&&defined(_MSC_VER)&&!defined(inline)
-#define inline _inline
-#endif
-
-#ifndef UL_OFFSETOF
-/* offset of structure field */
-#define UL_OFFSETOF(_type,_member) \
- ((size_t)&(((_type*)0)->_member))
-#endif /*UL_OFFSET*/
-
-#ifndef UL_CONTAINEROF
-#ifdef __GNUC__
-#define UL_CONTAINEROF(_ptr, _type, _member) ({ \
- const typeof( ((_type *)0)->_member ) *__mptr = (_ptr); \
- (_type *)( (char *)__mptr - UL_OFFSETOF(_type,_member) );})
-#else /*!__GNUC__*/
-#define UL_CONTAINEROF(_ptr, _type, _member) \
- ((_type *)( (char *)_ptr - UL_OFFSETOF(_type,_member)))
-#endif /*__GNUC__*/
-#endif /*UL_CONTAINEROF*/
-
-#ifndef UL_NOPSTATEMENT
-#define UL_NOPSTATEMENT do { } while(0)
-#endif
-
-#ifndef ul_cyclic_gt
-#define ul_cyclic_gt(x,y) \
- ((sizeof(x)>=sizeof(long long))&&(sizeof(y)>=sizeof(long long))? \
- (long long)((unsigned long long)(x)-(unsigned long long)(y))>0: \
- (sizeof(x)>=sizeof(long))&&(sizeof(y)>=sizeof(long))? \
- (long)((unsigned long)(x)-(unsigned long)(y))>0: \
- (sizeof(x)>=sizeof(int))&&(sizeof(y)>=sizeof(int))? \
- (int)((unsigned int)(x)-(unsigned int)(y))>0: \
- (sizeof(x)>=sizeof(short))&&(sizeof(y)>=sizeof(short))? \
- (short)((unsigned short)(x)-(unsigned short)(y))>0: \
- (signed char)((unsigned char)(x)-(unsigned char)(y))>0 \
- )
-#endif /*ul_cyclic_gt*/
-
-#ifndef ul_cyclic_ge
-#define ul_cyclic_ge(x,y) \
- ((sizeof(x)>=sizeof(long long))&&(sizeof(y)>=sizeof(long long))? \
- (long long)((unsigned long long)(x)-(unsigned long long)(y))>=0: \
- (sizeof(x)>=sizeof(long))&&(sizeof(y)>=sizeof(long))? \
- (long)((unsigned long)(x)-(unsigned long)(y))>=0: \
- (sizeof(x)>=sizeof(int))&&(sizeof(y)>=sizeof(int))? \
- (int)((unsigned int)(x)-(unsigned int)(y))>=0: \
- (sizeof(x)>=sizeof(short))&&(sizeof(y)>=sizeof(short))? \
- (short)((unsigned short)(x)-(unsigned short)(y))>=0: \
- (signed char)((unsigned char)(x)-(unsigned char)(y))>=0 \
- )
-#endif /*ul_cyclic_ge*/
-
-/* GNUC neat features */
-
-#ifdef __GNUC__
-#ifndef UL_ATTR_UNUSED
-#define UL_ATTR_PRINTF( format_idx, arg_idx ) \
- __attribute__((format (printf, format_idx, arg_idx)))
-#define UL_ATTR_SCANF( format_idx, arg_idx ) \
- __attribute__((format (scanf, format_idx, arg_idx)))
-#define UL_ATTR_FORMAT( arg_idx ) \
- __attribute__((format_arg (arg_idx)))
-#define UL_ATTR_NORETURN \
- __attribute__((noreturn))
-#define UL_ATTR_CONST \
- __attribute__((const))
-#define UL_ATTR_UNUSED \
- __attribute__((unused))
-#define UL_ATTR_CONSTRUCTOR \
- __attribute__((constructor))
-#define UL_ATTR_DESCRUCTOR \
- __attribute__((destructor))
-#define UL_ATTR_ALWAYS_INLINE \
- __attribute__((always_inline))
-#define UL_ATTR_WEAK \
- __attribute__((weak))
-#endif /*UL_ATTR_UNUSED*/
-#else /* !__GNUC__ */
-#ifndef UL_ATTR_UNUSED
-#define UL_ATTR_PRINTF( format_idx, arg_idx )
-#define UL_ATTR_SCANF( format_idx, arg_idx )
-#define UL_ATTR_FORMAT( arg_idx )
-#define UL_ATTR_NORETURN
-#define UL_ATTR_CONST
-#define UL_ATTR_UNUSED
-#define UL_ATTR_CONSTRUCTOR
-#define UL_ATTR_DESCRUCTOR
-#define UL_ATTR_ALWAYS_INLINE
-#define UL_ATTR_WEAK
-#endif /*UL_ATTR_UNUSED*/
-#endif /* !__GNUC__ */
-
-#ifndef UL_ATTR_REENTRANT
-#if (!defined(SDCC) && !defined(__SDCC)) || defined(SDCC_z80) || defined(__SDCC_z80)
- #define UL_ATTR_REENTRANT
-#else
- #define UL_ATTR_REENTRANT __reentrant
-#endif
-#endif /*UL_ATTR_REENTRANT*/
-
-#ifdef __cplusplus
-} /* extern "C"*/
-#endif
-
-#endif /* _UL_UTDEFS_H */