/* This function sets the maximum number of SCBs and DDBs which can be used by the sequencer. This is normally 512 and 128 respectively. If support for more SCBs or more DDBs is required then CMDCTXBASE, DEVCTXBASE and CTXDOMAIN are initialized here to extend context memory to point to host memory, thus allowing unlimited support for SCBs and DDBs  */
static int asd_init_ctxmem(struct asd_ha_struct *asd_ha)
/* This function sets the maximum number of SCBs and DDBs which can be used by the sequencer. This is normally 512 and 128 respectively. If support for more SCBs or more DDBs is required then CMDCTXBASE, DEVCTXBASE and CTXDOMAIN are initialized here to extend context memory to point to host memory, thus allowing unlimited support for SCBs and DDBs  */
static int asd_init_ctxmem(struct asd_ha_struct *asd_ha)
{
	int bitmap_bytes;
	asd_get_max_scb_ddb(asd_ha);
	asd_extend_devctx(asd_ha);
	asd_extend_cmdctx(asd_ha);
	bitmap_bytes = (asd_ha->hw_prof.max_ddbs+7)/8;
	bitmap_bytes = BITS_TO_LONGS(bitmap_bytes*8)*sizeof(unsigned long);
	asd_ha->hw_prof.ddb_bitmap = kzalloc(bitmap_bytes, GFP_KERNEL);
	if (!asd_ha->hw_prof.ddb_bitmap)
		return -ENOMEM;
	spin_lock_init(&asd_ha->hw_prof.ddb_lock);
	return 0;
}