Changeset 80bcaed in mainline for kernel/generic/include/adt/list.h
- Timestamp:
- 2007-02-03T13:22:24Z (18 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- f619ec11
- Parents:
- fa8e7d2
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/include/adt/list.h
rfa8e7d2 r80bcaed 48 48 * @param name Name of the new statically allocated list. 49 49 */ 50 #define LIST_INITIALIZE(name) link_t name = { .prev = &name, .next = &name } 50 #define LIST_INITIALIZE(name) \ 51 link_t name = { .prev = &name, .next = &name } 51 52 52 53 /** Initialize doubly-linked circular list link … … 108 109 * Remove item from doubly-linked circular list. 109 110 * 110 * @param link Pointer to link_t structure to be removed from the list it is contained in. 111 * @param link Pointer to link_t structure to be removed from the list it is 112 * contained in. 111 113 */ 112 114 static inline void list_remove(link_t *link) … … 136 138 * concatenates splitted lists and splits concatenated lists. 137 139 * 138 * @param part1 Pointer to link_t structure leading the first (half of the headless) list. 139 * @param part2 Pointer to link_t structure leading the second (half of the headless) list. 140 * @param part1 Pointer to link_t structure leading the first (half of the 141 * headless) list. 142 * @param part2 Pointer to link_t structure leading the second (half of the 143 * headless) list. 140 144 */ 141 145 static inline void headless_list_split_or_concat(link_t *part1, link_t *part2) … … 155 159 * Split headless doubly-linked circular list. 156 160 * 157 * @param part1 Pointer to link_t structure leading the first half of the headless list. 158 * @param part2 Pointer to link_t structure leading the second half of the headless list. 161 * @param part1 Pointer to link_t structure leading the first half of the 162 * headless list. 163 * @param part2 Pointer to link_t structure leading the second half of the 164 * headless list. 159 165 */ 160 166 static inline void headless_list_split(link_t *part1, link_t *part2) … … 168 174 * 169 175 * @param part1 Pointer to link_t structure leading the first headless list. 170 * @param part2 Pointer to link_t structure leading the second headless list. 176 * @param part2 Pointer to link_t structure leading the second headless list. 171 177 */ 172 178 static inline void headless_list_concat(link_t *part1, link_t *part2) … … 175 181 } 176 182 177 #define list_get_instance(link,type,member) (type *)(((uint8_t*)(link))-((uint8_t*)&(((type *)NULL)->member))) 183 #define list_get_instance(link,type,member) \ 184 ((type *)(((uint8_t *)(link)) - ((uint8_t *)&(((type *)NULL)->member)))) 178 185 179 186 extern bool list_member(const link_t *link, const link_t *head);
Note:
See TracChangeset
for help on using the changeset viewer.