Remove spl markers from AMR.
MFC After: 3 days
This commit is contained in:
parent
32948b81c4
commit
fceb189d65
@ -1038,11 +1038,10 @@ static int
|
||||
amr_quartz_poll_command(struct amr_command *ac)
|
||||
{
|
||||
struct amr_softc *sc = ac->ac_sc;
|
||||
int s, error;
|
||||
int error;
|
||||
|
||||
debug_called(2);
|
||||
|
||||
s = splbio();
|
||||
error = 0;
|
||||
|
||||
/* now we have a slot, we can map the command (unmapped in amr_complete) */
|
||||
@ -1055,7 +1054,6 @@ amr_quartz_poll_command(struct amr_command *ac)
|
||||
error = amr_quartz_poll_command1(sc, ac);
|
||||
}
|
||||
|
||||
splx(s);
|
||||
return (error);
|
||||
}
|
||||
|
||||
@ -1389,7 +1387,7 @@ amr_start(struct amr_command *ac)
|
||||
static int
|
||||
amr_start1(struct amr_softc *sc, struct amr_command *ac)
|
||||
{
|
||||
int done, s, i;
|
||||
int done, i;
|
||||
|
||||
/* mark the new mailbox we are going to copy in as busy */
|
||||
ac->ac_mailbox.mb_busy = 1;
|
||||
@ -1413,7 +1411,6 @@ amr_start1(struct amr_softc *sc, struct amr_command *ac)
|
||||
*/
|
||||
debug(4, "wait for mailbox");
|
||||
for (i = 10000, done = 0; (i > 0) && !done; i--) {
|
||||
s = splbio();
|
||||
|
||||
/* is the mailbox free? */
|
||||
if (sc->amr_mailbox->mb_busy == 0) {
|
||||
@ -1428,7 +1425,6 @@ amr_start1(struct amr_softc *sc, struct amr_command *ac)
|
||||
/* this is somewhat ugly */
|
||||
DELAY(100);
|
||||
}
|
||||
splx(s); /* drop spl to allow completion interrupts */
|
||||
}
|
||||
|
||||
/*
|
||||
@ -1613,16 +1609,14 @@ amr_alloccmd_cluster(struct amr_softc *sc)
|
||||
{
|
||||
struct amr_command_cluster *acc;
|
||||
struct amr_command *ac;
|
||||
int s, i, nextslot;
|
||||
int i, nextslot;
|
||||
|
||||
if (sc->amr_nextslot > sc->amr_maxio)
|
||||
return;
|
||||
acc = malloc(AMR_CMD_CLUSTERSIZE, M_DEVBUF, M_NOWAIT | M_ZERO);
|
||||
if (acc != NULL) {
|
||||
s = splbio();
|
||||
nextslot = sc->amr_nextslot;
|
||||
TAILQ_INSERT_TAIL(&sc->amr_cmd_clusters, acc, acc_link);
|
||||
splx(s);
|
||||
for (i = 0; i < AMR_CMD_CLUSTERCOUNT; i++) {
|
||||
ac = &acc->acc_command[i];
|
||||
ac->ac_sc = sc;
|
||||
@ -1689,14 +1683,13 @@ amr_std_submit_command(struct amr_softc *sc)
|
||||
static int
|
||||
amr_quartz_get_work(struct amr_softc *sc, struct amr_mailbox *mbsave)
|
||||
{
|
||||
int s, worked;
|
||||
int worked;
|
||||
u_int32_t outd;
|
||||
u_int8_t nstatus;
|
||||
|
||||
debug_called(3);
|
||||
|
||||
worked = 0;
|
||||
s = splbio();
|
||||
|
||||
/* work waiting for us? */
|
||||
if ((outd = AMR_QGET_ODB(sc)) == AMR_QODB_READY) {
|
||||
@ -1732,20 +1725,18 @@ amr_quartz_get_work(struct amr_softc *sc, struct amr_mailbox *mbsave)
|
||||
worked = 1; /* got some work */
|
||||
}
|
||||
|
||||
splx(s);
|
||||
return(worked);
|
||||
}
|
||||
|
||||
static int
|
||||
amr_std_get_work(struct amr_softc *sc, struct amr_mailbox *mbsave)
|
||||
{
|
||||
int s, worked;
|
||||
int worked;
|
||||
u_int8_t istat;
|
||||
|
||||
debug_called(3);
|
||||
|
||||
worked = 0;
|
||||
s = splbio();
|
||||
|
||||
/* check for valid interrupt status */
|
||||
istat = AMR_SGET_ISTAT(sc);
|
||||
@ -1759,7 +1750,6 @@ amr_std_get_work(struct amr_softc *sc, struct amr_mailbox *mbsave)
|
||||
worked = 1;
|
||||
}
|
||||
|
||||
splx(s);
|
||||
return(worked);
|
||||
}
|
||||
|
||||
|
@ -94,33 +94,24 @@ static void amr_cam_complete_extcdb(struct amr_command *ac);
|
||||
static __inline void
|
||||
amr_enqueue_ccb(struct amr_softc *sc, union ccb *ccb)
|
||||
{
|
||||
int s;
|
||||
|
||||
s = splbio();
|
||||
TAILQ_INSERT_TAIL(&sc->amr_cam_ccbq, &ccb->ccb_h, sim_links.tqe);
|
||||
splx(s);
|
||||
}
|
||||
|
||||
static __inline void
|
||||
amr_requeue_ccb(struct amr_softc *sc, union ccb *ccb)
|
||||
{
|
||||
int s;
|
||||
|
||||
s = splbio();
|
||||
TAILQ_INSERT_HEAD(&sc->amr_cam_ccbq, &ccb->ccb_h, sim_links.tqe);
|
||||
splx(s);
|
||||
}
|
||||
|
||||
static __inline union ccb *
|
||||
amr_dequeue_ccb(struct amr_softc *sc)
|
||||
{
|
||||
union ccb *ccb;
|
||||
int s;
|
||||
|
||||
s = splbio();
|
||||
if ((ccb = (union ccb *)TAILQ_FIRST(&sc->amr_cam_ccbq)) != NULL)
|
||||
TAILQ_REMOVE(&sc->amr_cam_ccbq, &ccb->ccb_h, sim_links.tqe);
|
||||
splx(s);
|
||||
return(ccb);
|
||||
}
|
||||
|
||||
|
@ -344,7 +344,7 @@ static int
|
||||
amr_pci_shutdown(device_t dev)
|
||||
{
|
||||
struct amr_softc *sc = device_get_softc(dev);
|
||||
int i,error,s;
|
||||
int i,error;
|
||||
|
||||
debug_called(1);
|
||||
|
||||
@ -356,7 +356,6 @@ amr_pci_shutdown(device_t dev)
|
||||
device_printf(sc->amr_dev, "flushing cache...");
|
||||
printf("%s\n", amr_flush(sc) ? "failed" : "done");
|
||||
|
||||
s = splbio();
|
||||
error = 0;
|
||||
|
||||
/* delete all our child devices */
|
||||
@ -371,7 +370,6 @@ amr_pci_shutdown(device_t dev)
|
||||
/* XXX disable interrupts? */
|
||||
|
||||
shutdown_out:
|
||||
splx(s);
|
||||
return(error);
|
||||
}
|
||||
|
||||
|
@ -274,101 +274,74 @@ extern void amrd_intr(void *data);
|
||||
static __inline void
|
||||
amr_enqueue_bio(struct amr_softc *sc, struct bio *bio)
|
||||
{
|
||||
int s;
|
||||
|
||||
s = splbio();
|
||||
bioq_insert_tail(&sc->amr_bioq, bio);
|
||||
splx(s);
|
||||
}
|
||||
|
||||
static __inline struct bio *
|
||||
amr_dequeue_bio(struct amr_softc *sc)
|
||||
{
|
||||
struct bio *bio;
|
||||
int s;
|
||||
|
||||
s = splbio();
|
||||
if ((bio = bioq_first(&sc->amr_bioq)) != NULL)
|
||||
bioq_remove(&sc->amr_bioq, bio);
|
||||
splx(s);
|
||||
return(bio);
|
||||
}
|
||||
|
||||
static __inline void
|
||||
amr_enqueue_ready(struct amr_command *ac)
|
||||
{
|
||||
int s;
|
||||
|
||||
s = splbio();
|
||||
TAILQ_INSERT_TAIL(&ac->ac_sc->amr_ready, ac, ac_link);
|
||||
splx(s);
|
||||
}
|
||||
|
||||
static __inline void
|
||||
amr_requeue_ready(struct amr_command *ac)
|
||||
{
|
||||
int s;
|
||||
|
||||
s = splbio();
|
||||
TAILQ_INSERT_HEAD(&ac->ac_sc->amr_ready, ac, ac_link);
|
||||
splx(s);
|
||||
}
|
||||
|
||||
static __inline struct amr_command *
|
||||
amr_dequeue_ready(struct amr_softc *sc)
|
||||
{
|
||||
struct amr_command *ac;
|
||||
int s;
|
||||
|
||||
s = splbio();
|
||||
if ((ac = TAILQ_FIRST(&sc->amr_ready)) != NULL)
|
||||
TAILQ_REMOVE(&sc->amr_ready, ac, ac_link);
|
||||
splx(s);
|
||||
return(ac);
|
||||
}
|
||||
|
||||
static __inline void
|
||||
amr_enqueue_completed(struct amr_command *ac)
|
||||
{
|
||||
int s;
|
||||
|
||||
s = splbio();
|
||||
TAILQ_INSERT_TAIL(&ac->ac_sc->amr_completed, ac, ac_link);
|
||||
splx(s);
|
||||
}
|
||||
|
||||
static __inline struct amr_command *
|
||||
amr_dequeue_completed(struct amr_softc *sc)
|
||||
{
|
||||
struct amr_command *ac;
|
||||
int s;
|
||||
|
||||
s = splbio();
|
||||
if ((ac = TAILQ_FIRST(&sc->amr_completed)) != NULL)
|
||||
TAILQ_REMOVE(&sc->amr_completed, ac, ac_link);
|
||||
splx(s);
|
||||
return(ac);
|
||||
}
|
||||
|
||||
static __inline void
|
||||
amr_enqueue_free(struct amr_command *ac)
|
||||
{
|
||||
int s;
|
||||
|
||||
s = splbio();
|
||||
TAILQ_INSERT_TAIL(&ac->ac_sc->amr_freecmds, ac, ac_link);
|
||||
splx(s);
|
||||
}
|
||||
|
||||
static __inline struct amr_command *
|
||||
amr_dequeue_free(struct amr_softc *sc)
|
||||
{
|
||||
struct amr_command *ac;
|
||||
int s;
|
||||
|
||||
s = splbio();
|
||||
if ((ac = TAILQ_FIRST(&sc->amr_freecmds)) != NULL)
|
||||
TAILQ_REMOVE(&sc->amr_freecmds, ac, ac_link);
|
||||
splx(s);
|
||||
return(ac);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user