FreeBSD/sys/mips/rmi/fmn.c
/* 
 * XLR COP2 supports watermark interrupts based on the number of 
 * messages pending in all the buckets in the core.  We increase 
 * the watermark until all the possible handler threads in the core
 * are woken up.
 */
XLR COP2 supports watermark interrupts based on the number of
messages pending in all the buckets in the core.  We increase
the watermark until all the possible handler threads in the core
are woken up.
XLR COP2 supports watermark interrupts based on the number of messages pending in all the buckets in the core . We increase the watermark until all the possible handler threads in the core are woken up .
static void
msgrng_setconfig(int running, int nthr)
{
	uint32_t config, mflags;
	int watermark = 1;	
	int wm_intr_value;
	KASSERT(nthr >= 0 && nthr <= msgring_maxthreads,
	    ("Bad value of nthr %d", nthr));
	KASSERT(running <= nthr, ("Bad value of running %d", running));
	if (running == nthr) {
		wm_intr_value = 0;
	} else {
		switch (running) {
		case 0: break;		
		case 1:
			watermark = 32; break;
		case 2:
			watermark = 48; break;
		case 3: 
			watermark = 56; break;
		}
		wm_intr_value = 0x2;	
	}
	mflags = msgrng_access_enable();
	config = (watermark << 24) | (IRQ_MSGRING << 16) | (1 << 8) |
		wm_intr_value;
	write_c0_eirr64(1ULL << IRQ_MSGRING);
	msgrng_write_config(config);
	msgrng_restore(mflags);
}
static void msgrng_setconfig ( int running , int nthr ) { uint32_t config , mflags ; int watermark = 1 ; int wm_intr_value ; KASSERT ( nthr >= 0 && nthr <= msgring_maxthreads , ( " " , nthr ) ) ; KASSERT ( running <= nthr , ( " " , running ) ) ; if ( running == nthr ) { wm_intr_value = 0 ; } else { switch ( running ) { case 0 : break ; case 1 : watermark = 32 ; break ; case 2 : watermark = 48 ; break ; case 3 : watermark = 56 ; break ; } wm_intr_value = 0x2 ; } mflags = msgrng_access_enable ( ) ; config = ( watermark << 24 ) | ( IRQ_MSGRING << 16 ) | ( 1 << 8 ) | wm_intr_value ; write_c0_eirr64 ( 1ULL << IRQ_MSGRING ) ; msgrng_write_config ( config ) ; msgrng_restore ( mflags ) ; }
XLR COP2 supports watermark interrupts based on the number of
 messages pending in all the buckets in the core.
XLR COP2 supports watermark interrupts based on the number of messages pending in all the buckets in the core .
/* non zero needed */ /* keep default */ /* set watermark enable interrupt */ /* clear pending interrupts, they will get re-raised if still valid */