zephyr/include
Benjamin Walsh d032bb88cc dlist: add SYS_DLIST_ITERATE_FROM_NODE()
Like SYS_DLIST_FOR_EACH_NODE(), but __dn contains a node where to fetch
the next node from, NULL to start at the head.

Note that the function does not iterate from @a node, but from
node->next. This allows the following:

sys_dnode_t *funcA(sys_dlist_t *list, sys_dnode_t *node)
{
	SYS_DLIST_ITERATE_FROM_NODE(list, node) {
		if (node == <some condition>) {
			return node;
		}
	}
	return NULL;
}

sys_dlist_t list = &<some list>;
sys_dnode_t *node = NULL;

do {
	node = funcA(list, node)
	if (node == <some other condition>) {
		goto found;
	}
} while(node);

<handle error>

found:
<do stuff with node>

Change-Id: I17a5787594a0ed1a4745bd2e1557dd54895105ca
Signed-off-by: Benjamin Walsh <walsh.benj@gmail.com>
2017-02-16 04:56:22 +00:00
..
arch arc: add _tsc_read for 64-bit timestamp 2017-02-15 05:55:09 +00:00
bluetooth Bluetooth: GATT: introduce volatile subscription flag 2017-02-06 17:43:18 +00:00
crypto include/crypto: Crypto abstraction header 2017-02-15 01:08:13 +00:00
debug license: Replace Apache boilerplate with SPDX tag 2017-01-19 03:50:58 +00:00
display grove: fix variable type mismatch 2017-02-11 00:14:15 +00:00
drivers mvic: include stdint for uint32_t 2017-02-11 07:00:40 +00:00
fs license: Replace Apache boilerplate with SPDX tag 2017-01-19 03:50:58 +00:00
linker gen_isr_tables: apply offset to irq parameter 2017-02-15 04:49:19 +00:00
logging kernel_event_logger: add additional function prototypes 2017-01-19 20:17:29 +00:00
misc dlist: add SYS_DLIST_ITERATE_FROM_NODE() 2017-02-16 04:56:22 +00:00
net net: Remove duplicate const specifier 2017-02-15 12:20:08 +02:00
shell license: Replace Apache boilerplate with SPDX tag 2017-01-19 03:50:58 +00:00
toolchain gcc: add compiler_barrier() macro 2017-02-16 04:56:20 +00:00
usb usb: Change transfer_len type to int32_t in usb_request_handler typedef 2017-01-30 12:01:49 +00:00
adc.h license: Replace Apache boilerplate with SPDX tag 2017-01-19 03:50:58 +00:00
aio_comparator.h license: Replace Apache boilerplate with SPDX tag 2017-01-19 03:50:58 +00:00
atomic.h license: Replace Apache boilerplate with SPDX tag 2017-01-19 03:50:58 +00:00
cache.h license: Replace Apache boilerplate with SPDX tag 2017-01-19 03:50:58 +00:00
clock_control.h license: Replace Apache boilerplate with SPDX tag 2017-01-19 03:50:58 +00:00
counter.h license: Replace Apache boilerplate with SPDX tag 2017-01-19 03:50:58 +00:00
device.h license: Replace Apache boilerplate with SPDX tag 2017-01-19 03:50:58 +00:00
disk_access.h license: Replace Apache boilerplate with SPDX tag 2017-01-19 03:50:58 +00:00
dma.h drivers: dma_shim: update dma qmsi shim driver 2017-02-10 02:18:16 +00:00
eth.h license: Replace Apache boilerplate with SPDX tag 2017-01-19 03:50:58 +00:00
flash.h license: Replace Apache boilerplate with SPDX tag 2017-01-19 03:50:58 +00:00
fs.h license: Replace Apache boilerplate with SPDX tag 2017-01-19 03:50:58 +00:00
gpio.h gpio: Clarify API 2017-02-06 13:15:49 +00:00
i2c.h i2c: Adds a functions set that supports flexible addressing. 2017-02-11 05:20:07 +00:00
init.h license: Replace Apache boilerplate with SPDX tag 2017-01-19 03:50:58 +00:00
ipm.h license: Replace Apache boilerplate with SPDX tag 2017-01-19 03:50:58 +00:00
irq_offload.h license: Replace Apache boilerplate with SPDX tag 2017-01-19 03:50:58 +00:00
irq.h irq: introduce 'direct' interrupt API definition 2017-02-02 17:46:33 +00:00
kernel_version.h license: Replace Apache boilerplate with SPDX tag 2017-01-19 03:50:58 +00:00
kernel.h Fixed compilation error caused by bad initialization of unamed union field. 2017-02-13 08:04:27 -08:00
legacy.h legacy: work around XCC issue in MDEF threads 2017-02-13 11:39:02 -08:00
linker-defs.h Xtensa port: Added support for Xtensa architecture to linker-defs.h. 2017-02-13 08:04:27 -08:00
linker-tool-gcc.h Xtensa port: Added linker script for several Xtensa cores. 2017-02-13 08:04:27 -08:00
linker-tool.h license: Replace Apache boilerplate with SPDX tag 2017-01-19 03:50:58 +00:00
microkernel.h license: Replace Apache boilerplate with SPDX tag 2017-01-19 03:50:58 +00:00
nanokernel.h license: Replace Apache boilerplate with SPDX tag 2017-01-19 03:50:58 +00:00
pinmux.h license: Replace Apache boilerplate with SPDX tag 2017-01-19 03:50:58 +00:00
power.h license: Replace Apache boilerplate with SPDX tag 2017-01-19 03:50:58 +00:00
pwm.h license: Replace Apache boilerplate with SPDX tag 2017-01-19 03:50:58 +00:00
random.h license: Replace Apache boilerplate with SPDX tag 2017-01-19 03:50:58 +00:00
rtc.h license: Replace Apache boilerplate with SPDX tag 2017-01-19 03:50:58 +00:00
section_tags.h Merge "Merge arm branch into master" 2017-02-11 04:00:58 +00:00
sections.h gen_isr_tables: New static interrupt build mechanism 2017-02-11 01:27:58 +00:00
sensor.h sensor: fix typo in sensor.h 2017-02-15 11:44:36 +00:00
shared_irq.h license: Replace Apache boilerplate with SPDX tag 2017-01-19 03:50:58 +00:00
spi.h license: Replace Apache boilerplate with SPDX tag 2017-01-19 03:50:58 +00:00
sw_isr_table.h gen_isr_tables: New static interrupt build mechanism 2017-02-11 01:27:58 +00:00
sys_clock.h license: Replace Apache boilerplate with SPDX tag 2017-01-19 03:50:58 +00:00
sys_io.h license: Replace Apache boilerplate with SPDX tag 2017-01-19 03:50:58 +00:00
toolchain.h license: Replace Apache boilerplate with SPDX tag 2017-01-19 03:50:58 +00:00
uart.h license: Replace Apache boilerplate with SPDX tag 2017-01-19 03:50:58 +00:00
watchdog.h license: Replace Apache boilerplate with SPDX tag 2017-01-19 03:50:58 +00:00
zephyr.h license: Replace Apache boilerplate with SPDX tag 2017-01-19 03:50:58 +00:00