FreeBSD/sys/mips/nlm/hal/fmn.c
/*
 * base		- CMS module base address for this node.
 * qid		- is the output queue id otherwise called as vc id
 * spill_base   - is the 40-bit physical address of spill memory. Must be
		  4KB aligned.
 * nsegs	- No of segments where a "1" indicates 4KB. Spill size must be
 *                a multiple of 4KB.
 */
base         - CMS module base address for this node.
qid          - is the output queue id otherwise called as vc id
spill_base   - is the 40-bit physical address of spill memory. Must be
4KB aligned.
nsegs        - No of segments where a "1" indicates 4KB. Spill size must be
a multiple of 4KB.
base - CMS module base address for this node . qid - is the output queue id otherwise called as vc id spill_base - is the 40 - bit physical address of spill memory . Must be 4KB aligned . nsegs - No of segments where a " 1 " indicates 4KB . Spill size must be a multiple of 4KB .
int nlm_cms_alloc_spill_q(uint64_t base, int qid, uint64_t spill_base,
				int nsegs)
{
	uint64_t queue_config;
	uint32_t spill_start;
	if (nsegs > CMS_MAX_SPILL_SEGMENTS_PER_QUEUE) {
		return 1;
	}
	queue_config = nlm_read_cms_reg(base,(CMS_OUTPUTQ_CONFIG(qid)));
	spill_start = ((spill_base >> 12) & 0x3F);
	queue_config = (((uint64_t)CMS_SPILL_ENA << 62) |
				(((spill_base >> 18) & 0x3FFFFF) << 27) |
				(spill_start + nsegs - 1) << 21 |
				(spill_start << 15));
	nlm_write_cms_reg(base,(CMS_OUTPUTQ_CONFIG(qid)),queue_config);
	return 0;
}
int nlm_cms_alloc_spill_q ( uint64_t base , int qid , uint64_t spill_base , int nsegs ) { uint64_t queue_config ; uint32_t spill_start ; if ( nsegs > CMS_MAX_SPILL_SEGMENTS_PER_QUEUE ) { return 1 ; } queue_config = nlm_read_cms_reg ( base , ( CMS_OUTPUTQ_CONFIG ( qid ) ) ) ; spill_start = ( ( spill_base >> 12 ) & 0x3F ) ; queue_config = ( ( ( uint64_t ) CMS_SPILL_ENA << 62 ) | ( ( ( spill_base >> 18 ) & 0x3FFFFF ) << 27 ) | ( spill_start + nsegs - 1 ) << 21 | ( spill_start << 15 ) ) ; nlm_write_cms_reg ( base , ( CMS_OUTPUTQ_CONFIG ( qid ) ) , queue_config ) ; return 0 ; }
base         - CMS module base address for this node.
base - CMS module base address for this node .
/* Spill configuration */