SC
#define SCN_GETCH(SC) \
sr = (SC)->sc_chbase[CH_SR]; \
(SC)->sc_rbuf[i++ & SCN_RING_MASK] = (SC)->sc_chbase[CH_DAT]
#define SCN_OP_BIS(SC,VAL) ((SC)->sc_duart->base[DU_OPSET] = (VAL))
#define SCN_OP_BIC(SC,VAL) ((SC)->sc_duart->base[DU_OPCLR] = (VAL))
#define SCN_DCD(SC) (((SC)->sc_duart->base[DU_IP] & (SC)->sc_ip_dcd) == 0)
#define DMAWAIT(SC, COND, MSG, DONTPANIC) do if (COND) { \
__FILE__, __LINE__, DMA_GCSR(SC)); \
#define XDC_TWAIT(SC, N) \
(SC)->waitq[(SC)->waitend] = (N); \
(SC)->waitend = ((SC)->waitend + 1) % XDC_MAXIOPB; \
(SC)->nwait++; \
#define XDC_HWAIT(SC, N) \
(SC)->waithead = ((SC)->waithead == 0) ? \
(XDC_MAXIOPB - 1) : ((SC)->waithead - 1); \
(SC)->waitq[(SC)->waithead] = (N); \
(SC)->nwait++; \
#define XDC_FREE(SC, N) \
(SC)->freereq[(SC)->nfree++] = (N); \
(SC)->reqs[N].mode = 0; \
if ((SC)->nfree == 1) \
wakeup(&(SC)->nfree); \
#define XDC_DONE(SC,RQ,ER) \
if ((SC)->ndone-- == XDC_SUBWAITLIM) \
wakeup(&(SC)->ndone); \
(ER) = (SC)->reqs[RQ].errno; \
XDC_FREE((SC), (RQ)); \
#define XYC_DONE(SC,ER) \
(ER) = (SC)->ciorq->errno; \
(SC)->ciorq->mode = XY_SUB_FREE; \
wakeup((SC)->ciorq); \
#define DMAWAIT(SC, COND, MSG, DONTPANIC) do if (COND) { \
(u_long)L64854_GCSR(SC)); \
{"success", SC(succ_msgs)},
{"invalid command", SC(icmd_msgs)},
{"unit offline", SC(offl_msgs)},
{"media format error", SC(media_fmt_msgs)},
{"write protected", SC(wrprot_msgs)},
{"data error", SC(data_msgs)},
{"host buffer access error", SC(host_buffer_msgs)},
{"controller error", SC(cntlr_msgs)},
{"drive error", SC(drive_msgs)},
#define DPRINTF(LEVEL, SC, FMT, ARGS...) do \
container_of((SC), struct pms_softc, u.synaptics); \
(SC)->waitend = ((SC)->waitend + 1) % XDC_MAXIOPB; \
(SC)->nwait++; \
#define XDC_HWAIT(SC, N) { \
(SC)->waithead = ((SC)->waithead == 0) ? \
(XDC_MAXIOPB - 1) : ((SC)->waithead - 1); \
(SC)->waitq[(SC)->waithead] = (N); \
(SC)->nwait++; \
#define XDC_FREE(SC, N) { \
(SC)->freereq[(SC)->nfree++] = (N); \
(SC)->reqs[N].mode = 0; \
if ((SC)->nfree == 1) wakeup(&(SC)->nfree); \
#define XDC_DONE(SC,RQ,ER) { \
if ((SC)->ndone-- == XDC_SUBWAITLIM) \
wakeup(&(SC)->ndone); \
(ER) = (SC)->reqs[RQ].errnum; \
XDC_FREE((SC), (RQ)); \
#define XDC_TWAIT(SC, N) { \
(SC)->waitq[(SC)->waitend] = (N); \
#define XYC_DONE(SC,ER) { \
(ER) = (SC)->ciorq->errnum; \
(SC)->ciorq->mode = XY_SUB_FREE; \
wakeup((SC)->ciorq); \
long SC; /* suppress multiple copies */
extern long SC; /* suppress multiple copies */
if (SC && ncopies > 1)
SC = (cgetcap(bp, "sc", ':') != NULL);