* Start out with 0 critical sections * that apply to this firmware load.
* No need to swap cmdpointer; it's either 0 or set to * cmdstore_busaddr, which is already swapped.
ahc_loadseq(struct ahc_softc *ahc){	struct	cs cs_table[num_critical_sections];	u_int	begin_set[num_critical_sections];	u_int	end_set[num_critical_sections];	struct	patch *cur_patch;	u_int	cs_count;	u_int	cur_cs;	u_int	i;	int	downloaded;	u_int	skip_addr;	u_int	sg_prefetch_cnt;	uint8_t	download_consts[7];	/*	 * Start out with 0 critical sections	 * that apply to this firmware load.	 */	cs_count = 0;	cur_cs = 0;	memset(begin_set, 0, sizeof(begin_set));	memset(end_set, 0, sizeof(end_set));	/* Setup downloadable constant table */	download_consts[QOUTFIFO_OFFSET] = 0;	if (ahc->targetcmds != NULL)		download_consts[QOUTFIFO_OFFSET] += 32;	download_consts[QINFIFO_OFFSET] = download_consts[QOUTFIFO_OFFSET] + 1;	download_consts[CACHESIZE_MASK] = ahc->pci_cachesize - 1;	download_consts[INVERTED_CACHESIZE_MASK] = ~(ahc->pci_cachesize - 1);	sg_prefetch_cnt = ahc->pci_cachesize;	if (sg_prefetch_cnt < (2 * sizeof(struct ahc_dma_seg)))		sg_prefetch_cnt = 2 * sizeof(struct ahc_dma_seg);	download_consts[SG_PREFETCH_CNT] = sg_prefetch_cnt;	download_consts[SG_PREFETCH_ALIGN_MASK] = ~(sg_prefetch_cnt - 1);	download_consts[SG_PREFETCH_ADDR_MASK] = (sg_prefetch_cnt - 1);	cur_patch = patches;	downloaded = 0;	skip_addr = 0;	ahc_outb(ahc, SEQCTL, PERRORDIS|FAILDIS|FASTMODE|LOADRAM);	ahc_outb(ahc, SEQADDR0, 0);	ahc_outb(ahc, SEQADDR1, 0);	for (i = 0; i < sizeof(seqprog)/4; i++) {		if (ahc_check_patch(ahc, &cur_patch, i, &skip_addr) == 0) {			/*			 * Don't download this instruction as it			 * is in a patch that was removed.			 */			continue;		}		/*		 * Move through the CS table until we find a CS		 * that might apply to this instruction.		 */		for (; cur_cs < num_critical_sections; cur_cs++) {			if (critical_sections[cur_cs].end <= i) {				if (begin_set[cs_count] == TRUE				 && end_set[cs_count] == FALSE) {					cs_table[cs_count].end = downloaded;				 	end_set[cs_count] = TRUE;					cs_count++;				}				continue;			}			if (critical_sections[cur_cs].begin <= i			 && begin_set[cs_count] == FALSE) {				cs_table[cs_count].begin = downloaded;				begin_set[cs_count] = TRUE;			}			break;		}		ahc_download_instr(ahc, i, download_consts);		downloaded++;	}	ahc->num_critical_sections = cs_count;	if (cs_count != 0) {		cs_count *= sizeof(struct cs);		ahc->critical_sections = malloc(cs_count, M_DEVBUF, M_NOWAIT);		if (ahc->critical_sections == NULL)			panic("ahc_loadseq: Could not malloc");		memcpy(ahc->critical_sections, cs_table, cs_count);	}	ahc_outb(ahc, SEQCTL, PERRORDIS|FAILDIS|FASTMODE);	ahc_restart(ahc);	if (bootverbose)		printf(" %d instructions downloaded\n", downloaded);}