Changing the message union to anonymous.
This allows us to write things like this: message m; m.m_notify.interrupts = new_value; or message *mp; mp->m_notify.interrupts = new_value; The shorthands macro have been adapted for the new scheme, and will be kept as long as we have generic messages being used. Change-Id: Icfd02b5f126892b1d5d2cebe8c8fb02b180000f7
This commit is contained in:
@@ -1598,7 +1598,7 @@ static void w_intr_wait(void)
|
||||
if (r != 0)
|
||||
panic("sys_inb failed: %d", r);
|
||||
w_wn->w_status= w_status;
|
||||
w_hw_int(m.NOTIFY_INTMASK);
|
||||
w_hw_int(m.m_notify.interrupts);
|
||||
break;
|
||||
default:
|
||||
/*
|
||||
|
||||
@@ -583,7 +583,7 @@ static int flt_receive(message *mess, int which)
|
||||
}
|
||||
|
||||
if(mess->m_source == CLOCK && is_ipc_notify(ipc_status)) {
|
||||
if (mess->NOTIFY_TIMESTAMP < flt_alarm((clock_t) -1)) {
|
||||
if (mess->m_notify.timestamp < flt_alarm((clock_t) -1)) {
|
||||
#if DEBUG
|
||||
printf("Filter: SKIPPING old alarm "
|
||||
"notification\n");
|
||||
|
||||
@@ -769,7 +769,7 @@ static void start_motor(void)
|
||||
if (is_ipc_notify(ipc_status)) {
|
||||
switch (_ENDPOINT_P(mess.m_source)) {
|
||||
case CLOCK:
|
||||
f_expire_tmrs(mess.NOTIFY_TIMESTAMP);
|
||||
f_expire_tmrs(mess.m_notify.timestamp);
|
||||
break;
|
||||
default :
|
||||
f_busy = BSY_IDLE;
|
||||
@@ -845,7 +845,7 @@ static int seek(void)
|
||||
if (is_ipc_notify(ipc_status)) {
|
||||
switch (_ENDPOINT_P(mess.m_source)) {
|
||||
case CLOCK:
|
||||
f_expire_tmrs(mess.NOTIFY_TIMESTAMP);
|
||||
f_expire_tmrs(mess.m_notify.timestamp);
|
||||
break;
|
||||
default :
|
||||
f_busy = BSY_IDLE;
|
||||
@@ -1123,7 +1123,7 @@ static void f_reset(void)
|
||||
if (is_ipc_notify(ipc_status)) {
|
||||
switch (_ENDPOINT_P(mess.m_source)) {
|
||||
case CLOCK:
|
||||
f_expire_tmrs(mess.NOTIFY_TIMESTAMP);
|
||||
f_expire_tmrs(mess.m_notify.timestamp);
|
||||
break;
|
||||
default :
|
||||
f_busy = BSY_IDLE;
|
||||
@@ -1174,7 +1174,7 @@ static int f_intr_wait(void)
|
||||
if (is_ipc_notify(ipc_status)) {
|
||||
switch (_ENDPOINT_P(mess.m_source)) {
|
||||
case CLOCK:
|
||||
f_expire_tmrs(mess.NOTIFY_TIMESTAMP);
|
||||
f_expire_tmrs(mess.m_notify.timestamp);
|
||||
break;
|
||||
default :
|
||||
f_busy = BSY_IDLE;
|
||||
|
||||
@@ -237,7 +237,7 @@ int main(int argc, char *argv[])
|
||||
handle_hw_intr();
|
||||
break;
|
||||
case CLOCK:
|
||||
expire_timers(m.NOTIFY_TIMESTAMP);
|
||||
expire_timers(m.m_notify.timestamp);
|
||||
break;
|
||||
default:
|
||||
panic(" illegal notify from: %d", m.m_source);
|
||||
|
||||
@@ -226,11 +226,11 @@ message *m;
|
||||
}
|
||||
|
||||
/* Re-enable Rx interrupt. */
|
||||
if(m->NOTIFY_INTMASK & (1 << RX_INT))
|
||||
if(m->m_notify.interrupts & (1 << RX_INT))
|
||||
lan8710a_enable_interrupt(RX_INT);
|
||||
|
||||
/* Re-enable Tx interrupt. */
|
||||
if(m->NOTIFY_INTMASK & (1 << TX_INT))
|
||||
if(m->m_notify.interrupts & (1 << TX_INT))
|
||||
lan8710a_enable_interrupt(TX_INT);
|
||||
}
|
||||
|
||||
|
||||
@@ -589,7 +589,7 @@ rs_interrupt(message *m)
|
||||
int line;
|
||||
rs232_t *rs;
|
||||
|
||||
irq_set = m->NOTIFY_INTMASK;
|
||||
irq_set = m->m_notify.interrupts;
|
||||
for (line = 0, rs = rs_lines; line < NR_RS_LINES; line++, rs++) {
|
||||
if (irq_set & (1 << rs->irq_hook_id)) {
|
||||
rs232_handler(rs);
|
||||
|
||||
@@ -534,7 +534,7 @@ void rs_interrupt(message *m)
|
||||
int i;
|
||||
rs232_t *rs;
|
||||
|
||||
irq_set= m->NOTIFY_INTMASK;
|
||||
irq_set= m->m_notify.interrupts;
|
||||
for (i= 0, rs = rs_lines; i<NR_RS_LINES; i++, rs++)
|
||||
{
|
||||
if (irq_set & (1 << rs->irq))
|
||||
|
||||
@@ -186,18 +186,18 @@ int main(void)
|
||||
switch (_ENDPOINT_P(tty_mess.m_source)) {
|
||||
case CLOCK:
|
||||
/* run watchdogs of expired timers */
|
||||
expire_timers(tty_mess.NOTIFY_TIMESTAMP);
|
||||
expire_timers(tty_mess.m_notify.timestamp);
|
||||
break;
|
||||
case HARDWARE:
|
||||
/* hardware interrupt notification */
|
||||
|
||||
#if NR_RS_LINES > 0
|
||||
/* serial I/O */
|
||||
if (tty_mess.NOTIFY_INTMASK & rs_irq_set)
|
||||
if (tty_mess.m_notify.interrupts & rs_irq_set)
|
||||
rs_interrupt(&tty_mess);
|
||||
#endif
|
||||
/* run watchdogs of expired timers */
|
||||
expire_timers(tty_mess.NOTIFY_TIMESTAMP);
|
||||
expire_timers(tty_mess.m_notify.timestamp);
|
||||
break;
|
||||
default:
|
||||
/* do nothing */
|
||||
|
||||
Reference in New Issue
Block a user