Lines Matching refs:ticker

402 		struct ticker_node *ticker;  in ticker_by_slot_get()  local
405 ticker = &node[ticker_id_head]; in ticker_by_slot_get()
406 ticks_to_expire = ticker->ticks_to_expire; in ticker_by_slot_get()
413 if (ticker->ticks_slot) { in ticker_by_slot_get()
421 ticker_id_head = ticker->next; in ticker_by_slot_get()
466 struct ticker_node *ticker; local
483 ticker = &node[_ticker_id_head];
484 _ticker_id_head = ticker->next;
489 ticker = &node[_ticker_id_head];
496 ticks_slot += ticker->ticks_slot;
502 ticker->ticks_to_expire,
514 if (ticker->ticks_slot) {
525 _ticks_to_expire += ticker->ticks_to_expire;
526 _ticker_id_head = ticker->next;
531 _ticks_to_expire += ticker->ticks_to_expire;
536 *remainder = ticker->remainder_current;
547 *lazy = ticker->lazy_current;
828 struct ticker_node *ticker)
831 if ((ticker->priority != TICKER_PRIORITY_CRITICAL) &&
832 (ticker->next != TICKER_NULL)) {
835 if (ticker->next != TICKER_NULL) {
839 uint16_t lazy_current = ticker->lazy_current;
842 if (TICKER_HAS_SLOT_WINDOW(ticker) && !ticker->ticks_slot) {
845 ticker_ticks_slot = ticker->ticks_slot;
851 if (lazy_current >= ticker->lazy_periodic) {
852 lazy_current -= ticker->lazy_periodic;
854 uint8_t id_head = ticker->next;
858 uint32_t current_age = ticker->ticks_periodic +
859 (lazy_current * ticker->ticks_periodic);
904 (ticker->ticks_periodic == 0U) ||
908 (ticker->ticks_periodic != 0U) &&
913 (ticker->force == ticker_next->force);
918 (ticker_next->force > ticker->force);
930 (ticker->priority == ticker_next->priority);
946 (lazy_current - ticker->priority));
956 TICKER_HAS_SLOT_WINDOW(ticker)) ||
960 ticker->ticks_slot);
966 TICKER_HAS_SLOT_WINDOW(ticker) &&
969 (ticker->ext_data->ticks_slot_window -
970 ticker->ticks_slot));
977 (lazy_current - ticker->priority);
989 (TICKER_HAS_SLOT_WINDOW(ticker) &&
990 !ticker->ticks_slot &&
993 (ticker->ext_data->ticks_slot_window)));
1001 (lazy_current - ticker->priority);
1130 struct ticker_node *ticker = &instance->nodes[ticker_id];
1135 ticker->ext_data->other_expire_info = &instance->expire_infos[i];
1199 struct ticker_node *ticker = &instance->nodes[current_id];
1202 ticker->ext_data->expire_info_id == ticker_id) {
1230 struct ticker_node *ticker = &instance->nodes[info->ticker_id];
1232 ticker_get_expire_info(instance, ticker->ext_data->expire_info_id,
1312 struct ticker_node *ticker;
1317 ticker = &node[ticker_id_head];
1320 ticks_to_expire = ticker->ticks_to_expire;
1330 ticker_id_head = ticker->next;
1334 if (((ticker->req - ticker->ack) & 0xff) != 1U) {
1342 if (TICKER_HAS_SLOT_WINDOW(ticker) &&
1343 (ticker->ticks_slot == 0U)) {
1346 ticker_ticks_slot = ticker->ticks_slot;
1355 ticker_resolve_collision(node, ticker))) {
1357 struct ticker_ext *ext_data = ticker->ext_data;
1363 (ticker->lazy_periodic <= ticker->lazy_current)) {
1377 ticker->lazy_current++;
1379 if ((ticker->must_expire == 0U) ||
1380 (ticker->lazy_periodic >= ticker->lazy_current) ||
1381 TICKER_RESCHEDULE_PENDING(ticker)) {
1386 ticker->ack--;
1395 if (ticker->ext_data) {
1396 ticks_drift = ticker->ext_data->ticks_drift;
1397 ticker->ext_data->ticks_drift = 0U;
1399 ticker->ext_data->reschedule_state =
1418 ticker->ack--;
1420 if (ticker->timeout_func) {
1426 ticker->ticks_to_expire_minus) &
1430 remainder_current = ticker->remainder_current;
1436 if (ticker->ext_data &&
1437 ticker->ext_data->ext_timeout_func) {
1442 timeout_func = ticker->ext_data->ext_timeout_func;
1443 expire_info = ticker->ext_data->other_expire_info;
1444 if (ticker->ext_data->expire_info_id != TICKER_NULL) {
1448 ext_context.context = ticker->context;
1463 ticker->lazy_current,
1464 ticker->force,
1472 ticker->timeout_func(ticks_at_expire,
1477 ticker->lazy_current,
1478 ticker->force,
1479 ticker->context);
1486 ticker->lazy_current = 0U;
1487 ticker->force = 0U;
1528 static void ticks_to_expire_prep(struct ticker_node *ticker,
1531 uint32_t ticks_to_expire = ticker->ticks_to_expire;
1532 uint32_t ticks_to_expire_minus = ticker->ticks_to_expire_minus;
1575 ticker->ticks_to_expire = ticks_to_expire;
1576 ticker->ticks_to_expire_minus = ticks_to_expire_minus;
1622 static uint8_t ticker_remainder_inc(struct ticker_node *ticker)
1624 return ticker_add_to_remainder(&ticker->remainder_current, ticker->remainder_periodic);
1640 static uint8_t ticker_remainder_dec(struct ticker_node *ticker)
1644 if ((ticker->remainder_current >= BIT(31)) ||
1645 (ticker->remainder_current <= (HAL_TICKER_REMAINDER_RANGE >> 1))) {
1647 ticker->remainder_current += HAL_TICKER_REMAINDER_RANGE;
1650 ticker->remainder_current -= ticker->remainder_periodic;
1688 struct ticker_node *ticker,
1695 uint32_t ticks_to_expire = ticker->ticks_to_expire;
1701 ticker->ticks_to_expire_minus += ticks_elapsed -
1707 if ((ticker->ticks_periodic != 0U) &&
1710 while ((ticks_to_expire > ticker->ticks_periodic) &&
1711 (ticker->lazy_current > user_op->params.update.lazy)) {
1712 ticks_to_expire -= ticker->ticks_periodic;
1715 ticks_to_expire -= ticker_remainder_dec(ticker);
1718 ticker->lazy_current--;
1721 while (ticker->lazy_current < user_op->params.update.lazy) {
1722 ticks_to_expire += ticker->ticks_periodic;
1725 ticks_to_expire += ticker_remainder_inc(ticker);
1728 ticker->lazy_current++;
1730 ticker->lazy_periodic = user_op->params.update.lazy;
1734 ticker->ticks_to_expire = ticks_to_expire +
1736 ticker->ticks_to_expire_minus +=
1745 struct ticker_ext *ext_data = ticker->ext_data;
1754 ticks_to_expire_prep(ticker, ticks_current, ticks_now);
1758 ticker->ticks_slot += user_op->params.update.ticks_slot_plus;
1759 if (ticker->ticks_slot > user_op->params.update.ticks_slot_minus) {
1760 ticker->ticks_slot -= user_op->params.update.ticks_slot_minus;
1762 ticker->ticks_slot = 0U;
1768 ticker->force = user_op->params.update.force;
1776 ticker->must_expire = (user_op->params.update.must_expire - 1);
1781 if (ticker->ext_data && user_op->params.update.expire_info_id != user_op->id) {
1783 !ticker->ext_data->other_expire_info) {
1791 ticker->ext_data->other_expire_info) {
1793 ticker->ext_data->other_expire_info = NULL;
1796 ticker->ext_data->expire_info_id = user_op->params.update.expire_info_id;
1797 if (ticker->ext_data->expire_info_id != TICKER_NULL) {
1805 ticker->next = *insert_head;
1827 struct ticker_node *ticker,
1837 ticker->ticks_to_expire = ticker_dequeue(instance, user_op->id);
1840 ticker_job_node_update(instance, ticker, user_op, ticks_now,
1851 ticker->req++;
1856 ticker->ticks_to_expire = ticker_dequeue(instance,
1860 if (ticker->ext_data && ticker->ext_data->expire_info_id != TICKER_NULL) {
1862 ticker->ext_data->other_expire_info = NULL;
1869 ticker->req = ticker->ack;
1966 struct ticker_node *ticker;
1981 ticker = &node[user_op->id];
1990 ticker->start_pending = 1U;
1998 state = (ticker->req - ticker->ack) & 0xff;
2006 !ticker->start_pending &&
2017 (!ticker->ext_data ||
2030 ticker_job_node_manage(instance, ticker,
2087 struct ticker_node *ticker;
2094 ticker = &node[id_expired];
2097 ticks_to_expire = ticker->ticks_to_expire;
2099 ticker->ticks_to_expire -= ticks_elapsed;
2108 state = (ticker->req - ticker->ack) & 0xff;
2115 skip_collision = (ticker->lazy_current != 0U);
2129 if (TICKER_HAS_SLOT_WINDOW(ticker) && !ticker->ticks_slot) {
2132 ticker_ticks_slot = ticker->ticks_slot;
2139 !TICKER_RESCHEDULE_PENDING(ticker)) {
2146 ticker->ticks_to_expire = 0U;
2153 instance->ticker_id_head = ticker->next;
2156 if ((ticker->ticks_periodic != 0U) ||
2157 TICKER_RESCHEDULE_PENDING(ticker)) {
2159 if (TICKER_RESCHEDULE_PENDING(ticker)) {
2164 ticker->ticks_to_expire = ticks_elapsed;
2170 ticker->req = ticker->ack;
2177 if (!ticker->lazy_current) {
2178 lazy_periodic = ticker->lazy_periodic;
2186 ticker->req = ticker->ack;
2196 ticker->ticks_periodic;
2200 ticker_remainder_inc(ticker);
2211 } else if (!ticker->must_expire) {
2218 ticker->ticks_periodic;
2222 ticker_remainder_inc(ticker);
2232 ticker->ticks_to_expire = ticks_to_expire;
2233 ticker->lazy_current += (lazy_periodic + lazy);
2236 ticks_to_expire_prep(ticker, instance->ticks_current,
2245 count = 1 + ticker->lazy_periodic;
2247 ticks_to_expire += ticker->ticks_periodic;
2248 ticks_to_expire += ticker_remainder_inc(ticker);
2258 ticks_to_expire += ticker->ticks_periodic;
2259 ticks_to_expire += ticker_remainder_inc(ticker);
2264 ticker->ticks_to_expire = ticks_to_expire;
2265 ticker->lazy_current = ticker->lazy_periodic + lazy;
2267 ticks_to_expire_prep(ticker, instance->ticks_current,
2272 ticker->force = 0U;
2276 ticker->next = *insert_head;
2280 ticker->req++;
2288 ticker->fp_op_func) {
2289 ticker->fp_op_func(TICKER_STATUS_FAILURE,
2290 ticker->op_context);
2295 ticker->req = ticker->ack;
2312 struct ticker_node *ticker,
2325 ticker->must_expire =
2332 ticker->ext_data = start->ext_data;
2335 if (ticker->ext_data) {
2336 ticker->ext_data->other_expire_info = NULL;
2337 if (ticker->ext_data->expire_info_id != TICKER_NULL) {
2355 ticker->ticks_periodic = start->ticks_periodic;
2358 ticker->remainder_periodic = start->remainder_periodic;
2361 ticker->remainder_current = start->remainder_first;
2363 ticker->remainder_current = 0U;
2367 ticker->lazy_periodic =
2371 ticker->ticks_slot = start->ticks_slot;
2374 ticker->timeout_func = start->fp_timeout_func;
2375 ticker->context = start->context;
2376 ticker->ticks_to_expire = start->ticks_first;
2377 ticker->ticks_to_expire_minus = 0U;
2378 ticks_to_expire_prep(ticker, ticks_current, start->ticks_at_start);
2380 ticker->lazy_current = 0U;
2381 ticker->force = 1U;
2404 struct ticker_node *ticker,
2410 ticker->next = TICKER_NULL;
2416 ticker->req = ticker->ack + 1;
2736 struct ticker_node *ticker,
2744 ticker->next = TICKER_NULL;
2747 if (ticker->lazy_current > ticker->lazy_periodic) {
2748 skip = ticker->lazy_current -
2749 ticker->lazy_periodic;
2776 ticker_collide->force < ticker->force) {
2794 if (ticker->ticks_periodic != 0U) {
2795 ticker->ticks_to_expire += ticker->ticks_periodic +
2796 ticker_remainder_inc(ticker);
2797 ticker->lazy_current++;
2800 if (ticker->lazy_current > ticker->lazy_periodic) {
2801 skip = ticker->lazy_current -
2802 ticker->lazy_periodic;
2810 if (ticker->ticks_to_expire >
2811 ticker->ticks_to_expire_minus) {
2812 ticker->ticks_to_expire -=
2813 ticker->ticks_to_expire_minus;
2814 ticker->ticks_to_expire_minus = 0U;
2816 ticker->ticks_to_expire_minus -=
2817 ticker->ticks_to_expire;
2818 ticker->ticks_to_expire = 0U;
2826 ticker->req = ticker->ack + 1;
2868 struct ticker_node *ticker;
2877 ticker = &node[id_insert];
2878 insert_head = ticker->next;
2895 ticker = &node[id_insert];
2904 ticker->start_pending = 0U;
2907 if (((ticker->req -
2908 ticker->ack) & 0xff) != 0U) {
2915 status = ticker_job_op_start(instance, ticker, user_op,
2921 status = ticker_job_insert(instance, id_insert, ticker,
2929 (ticker->ticks_periodic == 0U) &&
2931 ticker->fp_op_func =
2933 ticker->op_context =
3097 struct ticker_node *ticker;
3143 ticker = &instance->nodes[instance->ticker_id_head];
3144 ticks_to_expire = ticker->ticks_to_expire;