summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sys/dev/ic/aic7xxx.c42
-rw-r--r--sys/dev/microcode/aic7xxx/aicasm.c10
2 files changed, 38 insertions, 14 deletions
diff --git a/sys/dev/ic/aic7xxx.c b/sys/dev/ic/aic7xxx.c
index 589c0273b80..4e55f981b69 100644
--- a/sys/dev/ic/aic7xxx.c
+++ b/sys/dev/ic/aic7xxx.c
@@ -28,10 +28,10 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: aic7xxx.c,v 1.47 2003/04/27 11:22:52 ho Exp $
+ * $Id: aic7xxx.c,v 1.48 2003/08/12 20:27:03 mickey Exp $
*
* $FreeBSD: src/sys/dev/aic7xxx/aic7xxx.c,v 1.80 2001/12/16 17:38:30 gibbs Exp $
- * $OpenBSD: aic7xxx.c,v 1.47 2003/04/27 11:22:52 ho Exp $
+ * $OpenBSD: aic7xxx.c,v 1.48 2003/08/12 20:27:03 mickey Exp $
*/
#ifdef __OpenBSD__
@@ -230,7 +230,7 @@ static void ahc_dumpseq(struct ahc_softc *ahc);
#endif
static void ahc_loadseq(struct ahc_softc *ahc);
static int ahc_check_patch(struct ahc_softc *ahc,
- struct patch **start_patch,
+ const struct patch **start_patch,
u_int start_instr, u_int *skip_addr);
static void ahc_download_instr(struct ahc_softc *ahc,
u_int instrptr, uint8_t *dconsts);
@@ -562,6 +562,22 @@ ahc_handle_seqint(struct ahc_softc *ahc, u_int intstat)
hscb->datacnt = sg->len;
hscb->sgptr = scb->sg_list_phys | SG_FULL_RESID;
hscb->sgptr = ahc_htole32(hscb->sgptr);
+#ifdef __OpenBSD__
+ bus_dmamap_sync(ahc->scb_data->sense_dmat,
+ ahc->scb_data->sense_dmamap,
+ (scb - ahc->scb_data->scbarray) *
+ sizeof(struct scsi_sense_data),
+ sizeof(struct scsi_sense_data),
+ BUS_DMASYNC_PREREAD);
+ bus_dmamap_sync(ahc->scb_data->sg_dmat,
+ scb->sg_map->sg_dmamap,
+ 0, scb->sg_map->sg_dmamap->dm_mapsize,
+ BUS_DMASYNC_PREWRITE);
+ bus_dmamap_sync(ahc->scb_data->hscb_dmat,
+ ahc->scb_data->hscb_dmamap,
+ 0, ahc->scb_data->hscb_dmamap->dm_mapsize,
+ BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE);
+#endif
scb->sg_count = 1;
scb->flags |= SCB_SENSE;
ahc_qinfifo_requeue_tail(ahc, scb);
@@ -4577,6 +4593,8 @@ ahc_init(struct ahc_softc *ahc)
for (i = 0; i < 256; i++)
ahc->qinfifo[i] = SCB_LIST_NULL;
+ ahc_sync_qinfifo(ahc, BUS_DMASYNC_PREWRITE);
+
if ((ahc->features & AHC_MULTI_TID) != 0) {
ahc_outb(ahc, TARGID, 0);
ahc_outb(ahc, TARGID + 1, 0);
@@ -5044,7 +5062,11 @@ ahc_qinfifo_requeue(struct ahc_softc *ahc, struct scb *prev_scb,
ahc_sync_scb(ahc, prev_scb,
BUS_DMASYNC_PREREAD|BUS_DMASYNC_PREWRITE);
}
- ahc->qinfifo[ahc->qinfifonext++] = scb->hscb->tag;
+ ahc->qinfifo[ahc->qinfifonext] = scb->hscb->tag;
+ ahc_dmamap_sync(ahc, ahc->shared_data_dmat, ahc->shared_data_dmamap,
+ /*offset*/ahc->qinfifonext+256, /*len*/1,
+ BUS_DMASYNC_PREWRITE);
+ ahc->qinfifonext++;
scb->hscb->next = ahc->next_queued_scb->hscb->tag;
ahc_sync_scb(ahc, scb, BUS_DMASYNC_PREREAD|BUS_DMASYNC_PREWRITE);
}
@@ -5081,6 +5103,8 @@ ahc_search_qinfifo(struct ahc_softc *ahc, int target, char channel,
int i;
int have_qregs;
+ ahc_sync_qinfifo(ahc, BUS_DMASYNC_POSTWRITE);
+
qintail = ahc->qinfifonext;
have_qregs = (ahc->features & AHC_QUEUE_REGS) != 0;
if (have_qregs) {
@@ -6015,7 +6039,7 @@ 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;
+ const struct patch *cur_patch;
u_int cs_count;
u_int cur_cs;
u_int i;
@@ -6104,11 +6128,11 @@ ahc_loadseq(struct ahc_softc *ahc)
}
static int
-ahc_check_patch(struct ahc_softc *ahc, struct patch **start_patch,
+ahc_check_patch(struct ahc_softc *ahc, const struct patch **start_patch,
u_int start_instr, u_int *skip_addr)
{
- struct patch *cur_patch;
- struct patch *last_patch;
+ const struct patch *cur_patch;
+ const struct patch *last_patch;
u_int num_patches;
num_patches = sizeof(patches)/sizeof(struct patch);
@@ -6167,7 +6191,7 @@ ahc_download_instr(struct ahc_softc *ahc, u_int instrptr, uint8_t *dconsts)
case AIC_OP_JE:
case AIC_OP_JZ:
{
- struct patch *cur_patch;
+ const struct patch *cur_patch;
int address_offset;
u_int address;
u_int skip_addr;
diff --git a/sys/dev/microcode/aic7xxx/aicasm.c b/sys/dev/microcode/aic7xxx/aicasm.c
index 0eac26d40b1..c6a4c027b45 100644
--- a/sys/dev/microcode/aic7xxx/aicasm.c
+++ b/sys/dev/microcode/aic7xxx/aicasm.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: aicasm.c,v 1.9 2002/11/19 18:36:18 jason Exp $ */
+/* $OpenBSD: aicasm.c,v 1.10 2003/08/12 20:27:02 mickey Exp $ */
/*
* Aic7xxx SCSI host adapter firmware asssembler
*
@@ -38,7 +38,7 @@
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGES.
*
- * $Id: aicasm.c,v 1.9 2002/11/19 18:36:18 jason Exp $
+ * $Id: aicasm.c,v 1.10 2003/08/12 20:27:02 mickey Exp $
*
* $FreeBSD: src/sys/dev/aic7xxx/aicasm/aicasm.c,v 1.34 2002/06/05 22:51:54 gibbs Exp $
*/
@@ -336,7 +336,7 @@ output_code()
" *\n"
"%s */\n", versions);
- fprintf(ofile, "static u_int8_t seqprog[] = {\n");
+ fprintf(ofile, "static const u_int8_t seqprog[] = {\n");
for(cur_instr = seq_program.tqh_first;
cur_instr != NULL;
cur_instr = cur_instr->links.tqe_next) {
@@ -390,7 +390,7 @@ output_code()
" uint32_t begin :10,\n"
" skip_instr :10,\n"
" skip_patch :12;\n"
-"} patches[] = {\n", patch_arg_list);
+"} const patches[] = {\n", patch_arg_list);
for(cur_patch = TAILQ_FIRST(&patches);
cur_patch != NULL;
@@ -407,7 +407,7 @@ output_code()
"static struct cs {\n"
" u_int16_t begin;\n"
" u_int16_t end;\n"
-"} critical_sections[] = {\n");
+"} const critical_sections[] = {\n");
for(cs = TAILQ_FIRST(&cs_tailq);
cs != NULL;