kernel/include/ksched.h
/* find out the currently highest priority where a thread is ready to run */
/* interrupts must be locked */
find out the currently highest priority where a thread is ready to run
interrupts must be locked
find out the currently highest priority where a thread is ready to run interrupts must be locked
static inline int _get_highest_ready_prio(void)
{
	int bitmap = 0;
	u32_t ready_range;
#if (K_NUM_PRIORITIES <= 32)
	ready_range = _ready_q.prio_bmap[0];
#else
	for (;; bitmap++) {
		__ASSERT(bitmap < K_NUM_PRIO_BITMAPS, "prio out-of-range\n");
		if (_ready_q.prio_bmap[bitmap]) {
			ready_range = _ready_q.prio_bmap[bitmap];
			break;
		}
	}
#endif
	int abs_prio = (find_lsb_set(ready_range) - 1) + (bitmap << 5);
	__ASSERT(abs_prio < K_NUM_PRIORITIES, "prio out-of-range\n");
	return abs_prio - _NUM_COOP_PRIO;
}
static inline int _get_highest_ready_prio ( void ) { int bitmap = 0 ; u32_t ready_range ; #if ( K_NUM_PRIORITIES <= 32 ) ready_range = _ready_q . prio_bmap [ 0 ] ; #else for ( ; ; bitmap ++ ) { __ASSERT ( bitmap < K_NUM_PRIO_BITMAPS , " \n " ) ; if ( _ready_q . prio_bmap [ bitmap ] ) { ready_range = _ready_q . prio_bmap [ bitmap ] ; break ; } } #endif int abs_prio = ( find_lsb_set ( ready_range ) - 1 ) + ( bitmap << 5 ) ; __ASSERT ( abs_prio < K_NUM_PRIORITIES , " \n " ) ; return abs_prio - _NUM_COOP_PRIO ; }
find out the currently highest priority where a thread is ready to run
interrupts must be locked
find out the currently highest priority where a thread is ready to run interrupts must be locked