From: Lionel Sambuc Date: Thu, 28 Nov 2013 17:17:38 +0000 (+0100) Subject: Changing the message union to anonymous. X-Git-Tag: v3.3.0~491 X-Git-Url: http://zhaoyanbai.com/repos/%22http:/www.isc.org/icons/jquery.js?a=commitdiff_plain;h=175d3e7eaed1b8451c799de4ecf1ed828d874fc8;p=minix.git 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 --- diff --git a/drivers/at_wini/at_wini.c b/drivers/at_wini/at_wini.c index 13ba50de4..2bfc26a38 100644 --- a/drivers/at_wini/at_wini.c +++ b/drivers/at_wini/at_wini.c @@ -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: /* diff --git a/drivers/filter/driver.c b/drivers/filter/driver.c index c7ae6f851..80e97cc7b 100644 --- a/drivers/filter/driver.c +++ b/drivers/filter/driver.c @@ -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"); diff --git a/drivers/floppy/floppy.c b/drivers/floppy/floppy.c index 698b96d07..75b436715 100644 --- a/drivers/floppy/floppy.c +++ b/drivers/floppy/floppy.c @@ -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; diff --git a/drivers/fxp/fxp.c b/drivers/fxp/fxp.c index 49757ff8f..ff24d7f5e 100644 --- a/drivers/fxp/fxp.c +++ b/drivers/fxp/fxp.c @@ -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); diff --git a/drivers/lan8710a/lan8710a.c b/drivers/lan8710a/lan8710a.c index dd466b3a4..69e37b9d7 100644 --- a/drivers/lan8710a/lan8710a.c +++ b/drivers/lan8710a/lan8710a.c @@ -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); } diff --git a/drivers/tty/arch/earm/rs232.c b/drivers/tty/arch/earm/rs232.c index ce9c6f22e..13d817591 100644 --- a/drivers/tty/arch/earm/rs232.c +++ b/drivers/tty/arch/earm/rs232.c @@ -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); diff --git a/drivers/tty/arch/i386/rs232.c b/drivers/tty/arch/i386/rs232.c index c5a3a7cf6..d98979d3d 100644 --- a/drivers/tty/arch/i386/rs232.c +++ b/drivers/tty/arch/i386/rs232.c @@ -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; iirq)) diff --git a/drivers/tty/tty.c b/drivers/tty/tty.c index 43e21997d..6bc715743 100644 --- a/drivers/tty/tty.c +++ b/drivers/tty/tty.c @@ -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 */ diff --git a/include/minix/com.h b/include/minix/com.h index 4bb5075ed..463ded22c 100644 --- a/include/minix/com.h +++ b/include/minix/com.h @@ -107,11 +107,6 @@ #define is_ipc_asynch(ipc_status) \ (is_ipc_notify(ipc_status) || IPC_STATUS_CALL(ipc_status) == SENDA) -/* Shorthands for message parameters passed with notifications. */ -#define NOTIFY_TIMESTAMP m_u.m_notify.timestamp -#define NOTIFY_INTMASK m_u.m_notify.interrupts -#define NOTIFY_SIGSET m_u.m_notify.sigset - /*===========================================================================* * Messages for BUS controller drivers * *===========================================================================*/ @@ -476,12 +471,12 @@ #define SG_SIZE m2_i2 /* no. of entries */ /* Field names for SYS_GETKSIG, _ENDKSIG, _KILL, _SIGSEND, _SIGRETURN. */ -#define SYS_SIG_ENDPT m_u.m_sigcalls.ep /* process number for inform */ -#define SYS_SIG_NUMBER m_u.m_sigcalls.sig /* signal number to send */ -#define SYS_SIG_FLAGS m_u.m_sigcalls.flags /* signal flags field */ -#define SYS_SIG_MAP m_u.m_sigcalls.sigs /* used to pass signal bit map */ -#define SYS_SIG_CTXT_PTR m_u.m_sigcalls.sigctx /* pointer to signal context */ -#define SYS_SIG_HOW m_u.m_sigcalls.how /* used to pass signal bit map */ +#define SYS_SIG_ENDPT m_sigcalls.ep /* process number for inform */ +#define SYS_SIG_NUMBER m_sigcalls.sig /* signal number to send */ +#define SYS_SIG_FLAGS m_sigcalls.flags /* signal flags field */ +#define SYS_SIG_MAP m_sigcalls.sigs /* used to pass signal bit map */ +#define SYS_SIG_CTXT_PTR m_sigcalls.sigctx /* pointer to signal context */ +#define SYS_SIG_HOW m_sigcalls.how /* used to pass signal bit map */ /* Field names for SYS_FORK, _EXEC, _EXIT, GETMCONTEXT, SETMCONTEXT.*/ #define PR_ENDPT m1_i1 /* indicates a process */ @@ -823,18 +818,18 @@ /* General calls. */ #define VM_MMAP (VM_RQ_BASE+10) -# define VMM_ADDR m_u.m_mmap.addr -# define VMM_LEN m_u.m_mmap.len -# define VMM_PROT m_u.m_mmap.prot -# define VMM_FLAGS m_u.m_mmap.flags -# define VMM_FD m_u.m_mmap.fd -# define VMM_OFFSET m_u.m_mmap.offset -# define VMM_FORWHOM m_u.m_mmap.forwhom -# define VMM_RETADDR m_u.m_mmap.retaddr +# define VMM_ADDR m_mmap.addr +# define VMM_LEN m_mmap.len +# define VMM_PROT m_mmap.prot +# define VMM_FLAGS m_mmap.flags +# define VMM_FD m_mmap.fd +# define VMM_OFFSET m_mmap.offset +# define VMM_FORWHOM m_mmap.forwhom +# define VMM_RETADDR m_mmap.retaddr #define VM_MUNMAP (VM_RQ_BASE+17) -# define VMUM_ADDR m_u.m_mmap.addr -# define VMUM_LEN m_u.m_mmap.len +# define VMUM_ADDR m_mmap.addr +# define VMUM_LEN m_mmap.len /* to VM: inform VM about a region of memory that is used for * bus-master DMA @@ -913,8 +908,8 @@ # define VMRE_FLAGS m1_i3 #define VM_SHM_UNMAP (VM_RQ_BASE+34) -# define VMUN_ENDPT m_u.m_mmap.forwhom -# define VMUN_ADDR m_u.m_mmap.addr +# define VMUN_ENDPT m_mmap.forwhom +# define VMUN_ADDR m_mmap.addr #define VM_GETPHYS (VM_RQ_BASE+35) # define VMPHYS_ENDPT m2_i1 diff --git a/include/minix/ipc.h b/include/minix/ipc.h index 276434430..40ac90b3e 100644 --- a/include/minix/ipc.h +++ b/include/minix/ipc.h @@ -114,19 +114,6 @@ typedef struct { } mess_11; _ASSERT_MSG_SIZE(mess_11); -typedef struct { - dev_t dev; /* 64bits long. */ - off_t dev_offset; - off_t ino_offset; - ino_t ino; - u32_t *flags_ptr; - void *block; - u8_t pages; - u8_t flags; - uint8_t padding[12]; -} mess_vmmcp; -_ASSERT_MSG_SIZE(mess_vmmcp); - typedef struct { u64_t timestamp; /* valid for every notify msg */ u64_t interrupts; /* raised interrupts; valid if from HARDWARE */ @@ -162,6 +149,19 @@ typedef struct { } mess_vm_vfs_mmap; _ASSERT_MSG_SIZE(mess_vm_vfs_mmap); +typedef struct { + dev_t dev; /* 64bits long. */ + off_t dev_offset; + off_t ino_offset; + ino_t ino; + void *block; + u32_t *flags_ptr; + u8_t pages; + u8_t flags; + uint8_t padding[12]; +} mess_vmmcp; +_ASSERT_MSG_SIZE(mess_vmmcp); + typedef struct { void *addr; u8_t flags; @@ -184,114 +184,114 @@ typedef struct { mess_9 m_m9; mess_10 m_m10; mess_11 m_m11; + mess_mmap m_mmap; mess_vmmcp m_vmmcp; mess_vmmcp_reply m_vmmcp_reply; - mess_mmap m_mmap; mess_vm_vfs_mmap m_vm_vfs; mess_notify m_notify; /* notify messages */ mess_sigcalls m_sigcalls; /* SYS_{GETKSIG,ENDKSIG,KILL,SIGSEND,SIGRETURN} */ - u32_t size[14]; /* message payload may have 14 longs at most */ - } m_u; + u8_t size[56]; /* message payload may have 56 bytes at most */ + }; } message __aligned(16); /* Ensure the complete union respects the IPC assumptions. */ -typedef int _ASSERT_message[/* CONSTCOND */sizeof(message) == 64 ?1 : -1]; +typedef int _ASSERT_message[/* CONSTCOND */sizeof(message) == 64 ? 1 : -1]; /* The following defines provide names for useful members. */ -#define m1_i1 m_u.m_m1.m1i1 -#define m1_i2 m_u.m_m1.m1i2 -#define m1_i3 m_u.m_m1.m1i3 -#define m1_p1 m_u.m_m1.m1p1 -#define m1_p2 m_u.m_m1.m1p2 -#define m1_p3 m_u.m_m1.m1p3 -#define m1_p4 m_u.m_m1.m1p4 -#define m1_ull1 m_u.m_m1.m1ull1 - -#define m2_ll1 m_u.m_m2.m2ll1 -#define m2_i1 m_u.m_m2.m2i1 -#define m2_i2 m_u.m_m2.m2i2 -#define m2_i3 m_u.m_m2.m2i3 -#define m2_l1 m_u.m_m2.m2l1 -#define m2_l2 m_u.m_m2.m2l2 -#define m2_p1 m_u.m_m2.m2p1 -#define m2_sigset m_u.m_m2.sigset - -#define m2_s1 m_u.m_m2.m2s1 - -#define m3_i1 m_u.m_m3.m3i1 -#define m3_i2 m_u.m_m3.m3i2 -#define m3_p1 m_u.m_m3.m3p1 -#define m3_ca1 m_u.m_m3.m3ca1 - -#define m4_ll1 m_u.m_m4.m4ll1 -#define m4_l1 m_u.m_m4.m4l1 -#define m4_l2 m_u.m_m4.m4l2 -#define m4_l3 m_u.m_m4.m4l3 -#define m4_l4 m_u.m_m4.m4l4 -#define m4_l5 m_u.m_m4.m4l5 - -#define m5_s1 m_u.m_m5.m5s1 -#define m5_s2 m_u.m_m5.m5s2 -#define m5_i1 m_u.m_m5.m5i1 -#define m5_i2 m_u.m_m5.m5i2 -#define m5_l1 m_u.m_m5.m5l1 -#define m5_l2 m_u.m_m5.m5l2 -#define m5_l3 m_u.m_m5.m5l3 - -#define m6_l1 m_u.m_m6.m6l1 -#define m6_l2 m_u.m_m6.m6l2 -#define m6_l3 m_u.m_m6.m6l3 -#define m6_s1 m_u.m_m6.m6s1 -#define m6_s2 m_u.m_m6.m6s2 -#define m6_s3 m_u.m_m6.m6s3 -#define m6_c1 m_u.m_m6.m6c1 -#define m6_c2 m_u.m_m6.m6c2 -#define m6_p1 m_u.m_m6.m6p1 -#define m6_p2 m_u.m_m6.m6p2 - -#define m7_i1 m_u.m_m7.m7i1 -#define m7_i2 m_u.m_m7.m7i2 -#define m7_i3 m_u.m_m7.m7i3 -#define m7_i4 m_u.m_m7.m7i4 -#define m7_i5 m_u.m_m7.m7i5 -#define m7_p1 m_u.m_m7.m7p1 -#define m7_p2 m_u.m_m7.m7p2 - -#define m8_i1 m_u.m_m8.m8i1 -#define m8_i2 m_u.m_m8.m8i2 -#define m8_p1 m_u.m_m8.m8p1 -#define m8_p2 m_u.m_m8.m8p2 -#define m8_p3 m_u.m_m8.m8p3 -#define m8_p4 m_u.m_m8.m8p4 - -#define m9_l1 m_u.m_m9.m9l1 -#define m9_l2 m_u.m_m9.m9l2 -#define m9_l3 m_u.m_m9.m9l3 -#define m9_l4 m_u.m_m9.m9l4 -#define m9_l5 m_u.m_m9.m9l5 -#define m9_s1 m_u.m_m9.m9s1 -#define m9_s2 m_u.m_m9.m9s2 -#define m9_s3 m_u.m_m9.m9s3 -#define m9_s4 m_u.m_m9.m9s4 -#define m9_ull1 m_u.m_m9.m9ull1 - -#define m10_i1 m_u.m_m10.m10i1 -#define m10_i2 m_u.m_m10.m10i2 -#define m10_i3 m_u.m_m10.m10i3 -#define m10_i4 m_u.m_m10.m10i4 -#define m10_l1 m_u.m_m10.m10l1 -#define m10_l2 m_u.m_m10.m10l2 -#define m10_l3 m_u.m_m10.m10l3 - -#define m11_i1 m_u.m_m11.m11i1 -#define m11_s1 m_u.m_m11.m11s1 -#define m11_s2 m_u.m_m11.m11s2 -#define m11_s3 m_u.m_m11.m11s3 -#define m11_s4 m_u.m_m11.m11s4 -#define m11_p1 m_u.m_m11.m11p1 -#define m11_p2 m_u.m_m11.m11p2 -#define m11_p3 m_u.m_m11.m11p3 -#define m11_p4 m_u.m_m11.m11p4 +#define m1_i1 m_m1.m1i1 +#define m1_i2 m_m1.m1i2 +#define m1_i3 m_m1.m1i3 +#define m1_p1 m_m1.m1p1 +#define m1_p2 m_m1.m1p2 +#define m1_p3 m_m1.m1p3 +#define m1_p4 m_m1.m1p4 +#define m1_ull1 m_m1.m1ull1 + +#define m2_ll1 m_m2.m2ll1 +#define m2_i1 m_m2.m2i1 +#define m2_i2 m_m2.m2i2 +#define m2_i3 m_m2.m2i3 +#define m2_l1 m_m2.m2l1 +#define m2_l2 m_m2.m2l2 +#define m2_p1 m_m2.m2p1 +#define m2_sigset m_m2.sigset + +#define m2_s1 m_m2.m2s1 + +#define m3_i1 m_m3.m3i1 +#define m3_i2 m_m3.m3i2 +#define m3_p1 m_m3.m3p1 +#define m3_ca1 m_m3.m3ca1 + +#define m4_ll1 m_m4.m4ll1 +#define m4_l1 m_m4.m4l1 +#define m4_l2 m_m4.m4l2 +#define m4_l3 m_m4.m4l3 +#define m4_l4 m_m4.m4l4 +#define m4_l5 m_m4.m4l5 + +#define m5_s1 m_m5.m5s1 +#define m5_s2 m_m5.m5s2 +#define m5_i1 m_m5.m5i1 +#define m5_i2 m_m5.m5i2 +#define m5_l1 m_m5.m5l1 +#define m5_l2 m_m5.m5l2 +#define m5_l3 m_m5.m5l3 + +#define m6_l1 m_m6.m6l1 +#define m6_l2 m_m6.m6l2 +#define m6_l3 m_m6.m6l3 +#define m6_s1 m_m6.m6s1 +#define m6_s2 m_m6.m6s2 +#define m6_s3 m_m6.m6s3 +#define m6_c1 m_m6.m6c1 +#define m6_c2 m_m6.m6c2 +#define m6_p1 m_m6.m6p1 +#define m6_p2 m_m6.m6p2 + +#define m7_i1 m_m7.m7i1 +#define m7_i2 m_m7.m7i2 +#define m7_i3 m_m7.m7i3 +#define m7_i4 m_m7.m7i4 +#define m7_i5 m_m7.m7i5 +#define m7_p1 m_m7.m7p1 +#define m7_p2 m_m7.m7p2 + +#define m8_i1 m_m8.m8i1 +#define m8_i2 m_m8.m8i2 +#define m8_p1 m_m8.m8p1 +#define m8_p2 m_m8.m8p2 +#define m8_p3 m_m8.m8p3 +#define m8_p4 m_m8.m8p4 + +#define m9_l1 m_m9.m9l1 +#define m9_l2 m_m9.m9l2 +#define m9_l3 m_m9.m9l3 +#define m9_l4 m_m9.m9l4 +#define m9_l5 m_m9.m9l5 +#define m9_s1 m_m9.m9s1 +#define m9_s2 m_m9.m9s2 +#define m9_s3 m_m9.m9s3 +#define m9_s4 m_m9.m9s4 +#define m9_ull1 m_m9.m9ull1 + +#define m10_i1 m_m10.m10i1 +#define m10_i2 m_m10.m10i2 +#define m10_i3 m_m10.m10i3 +#define m10_i4 m_m10.m10i4 +#define m10_l1 m_m10.m10l1 +#define m10_l2 m_m10.m10l2 +#define m10_l3 m_m10.m10l3 + +#define m11_i1 m_m11.m11i1 +#define m11_s1 m_m11.m11s1 +#define m11_s2 m_m11.m11s2 +#define m11_s3 m_m11.m11s3 +#define m11_s4 m_m11.m11s4 +#define m11_p1 m_m11.m11p1 +#define m11_p2 m_m11.m11p2 +#define m11_p3 m_m11.m11p3 +#define m11_p4 m_m11.m11p4 /*==========================================================================* * Minix run-time system (IPC). * diff --git a/kernel/proc.c b/kernel/proc.c index bb81ac911..36c51ce20 100644 --- a/kernel/proc.c +++ b/kernel/proc.c @@ -101,14 +101,15 @@ static void set_idle_name(char * name, int n) #define BuildNotifyMessage(m_ptr, src, dst_ptr) \ memset((m_ptr), 0, sizeof(*(m_ptr))); \ (m_ptr)->m_type = NOTIFY_MESSAGE; \ - (m_ptr)->NOTIFY_TIMESTAMP = get_monotonic(); \ + (m_ptr)->m_notify.timestamp = get_monotonic(); \ switch (src) { \ case HARDWARE: \ - (m_ptr)->NOTIFY_INTMASK = priv(dst_ptr)->s_int_pending; \ + (m_ptr)->m_notify.interrupts = \ + priv(dst_ptr)->s_int_pending; \ priv(dst_ptr)->s_int_pending = 0; \ break; \ case SYSTEM: \ - memcpy(&(m_ptr)->NOTIFY_SIGSET, \ + memcpy(&(m_ptr)->m_notify.sigset, \ &priv(dst_ptr)->s_sig_pending, \ sizeof(sigset_t)); \ sigemptyset(&priv(dst_ptr)->s_sig_pending); \ diff --git a/lib/libblockdriver/driver.c b/lib/libblockdriver/driver.c index 02805297a..96f97c416 100644 --- a/lib/libblockdriver/driver.c +++ b/lib/libblockdriver/driver.c @@ -392,12 +392,12 @@ void blockdriver_process_on_thread(struct blockdriver *bdp, message *m_ptr, switch (_ENDPOINT_P(m_ptr->m_source)) { case HARDWARE: if (bdp->bdr_intr) - (*bdp->bdr_intr)(m_ptr->NOTIFY_INTMASK); + (*bdp->bdr_intr)(m_ptr->m_notify.interrupts); break; case CLOCK: if (bdp->bdr_alarm) - (*bdp->bdr_alarm)(m_ptr->NOTIFY_TIMESTAMP); + (*bdp->bdr_alarm)(m_ptr->m_notify.timestamp); break; default: diff --git a/lib/libc/sys-minix/mmap.c b/lib/libc/sys-minix/mmap.c index 6a9d833be..616c2bd33 100644 --- a/lib/libc/sys-minix/mmap.c +++ b/lib/libc/sys-minix/mmap.c @@ -58,15 +58,15 @@ int minix_vfs_mmap(endpoint_t who, off_t offset, size_t len, memset(&m, 0, sizeof(message)); - m.m_u.m_vm_vfs.who = who; - m.m_u.m_vm_vfs.offset = offset; - m.m_u.m_vm_vfs.dev = dev; - m.m_u.m_vm_vfs.ino = ino; - m.m_u.m_vm_vfs.vaddr = vaddr; - m.m_u.m_vm_vfs.len = len; - m.m_u.m_vm_vfs.fd = fd; - m.m_u.m_vm_vfs.clearend = clearend; - m.m_u.m_vm_vfs.flags = flags; + m.m_vm_vfs.who = who; + m.m_vm_vfs.offset = offset; + m.m_vm_vfs.dev = dev; + m.m_vm_vfs.ino = ino; + m.m_vm_vfs.vaddr = vaddr; + m.m_vm_vfs.len = len; + m.m_vm_vfs.fd = fd; + m.m_vm_vfs.clearend = clearend; + m.m_vm_vfs.flags = flags; return _syscall(VM_PROC_NR, VM_VFS_MMAP, &m); } diff --git a/lib/libchardriver/chardriver.c b/lib/libchardriver/chardriver.c index 176819dec..7016eb8da 100644 --- a/lib/libchardriver/chardriver.c +++ b/lib/libchardriver/chardriver.c @@ -447,12 +447,12 @@ void chardriver_process(struct chardriver *cdp, message *m_ptr, int ipc_status) switch (_ENDPOINT_P(m_ptr->m_source)) { case HARDWARE: if (cdp->cdr_intr) - cdp->cdr_intr(m_ptr->NOTIFY_INTMASK); + cdp->cdr_intr(m_ptr->m_notify.interrupts); break; case CLOCK: if (cdp->cdr_alarm) - cdp->cdr_alarm(m_ptr->NOTIFY_TIMESTAMP); + cdp->cdr_alarm(m_ptr->m_notify.timestamp); break; default: diff --git a/lib/libddekit/src/dde.c b/lib/libddekit/src/dde.c index 6c117fcc5..d10514c53 100644 --- a/lib/libddekit/src/dde.c +++ b/lib/libddekit/src/dde.c @@ -64,7 +64,7 @@ static void dispatcher_thread(void *unused) { case HARDWARE: for (i =0 ; i < 32 ; i++) { - if(m.NOTIFY_INTMASK & (1 << i)) + if(m.m_notify.interrupts & (1 << i)) { _ddekit_interrupt_trigger(i); } diff --git a/lib/libgpio/gpio_omap.c b/lib/libgpio/gpio_omap.c index 18005df6e..a5c99334f 100644 --- a/lib/libgpio/gpio_omap.c +++ b/lib/libgpio/gpio_omap.c @@ -349,8 +349,8 @@ omap_message_hook(message * m) switch (_ENDPOINT_P(m->m_source)) { case HARDWARE: /* Hardware interrupt return a "set" if pending interrupts */ - irq_set = m->NOTIFY_INTMASK; - log_debug(&log, "HW message 0X%08llx\n", m->NOTIFY_INTMASK); + irq_set = m->m_notify.interrupts; + log_debug(&log, "HW message 0X%08llx\n", m->m_notify.interrupts); bank = &omap_gpio_banks[0]; for (i = 0; omap_gpio_banks[i].name != NULL; i++) { bank = &omap_gpio_banks[i]; diff --git a/lib/libinputdriver/inputdriver.c b/lib/libinputdriver/inputdriver.c index e4e1c3948..fd0ef1b9a 100644 --- a/lib/libinputdriver/inputdriver.c +++ b/lib/libinputdriver/inputdriver.c @@ -146,12 +146,12 @@ inputdriver_process(struct inputdriver *idp, message *m_ptr, int ipc_status) switch (_ENDPOINT_P(m_ptr->m_source)) { case HARDWARE: if (idp->idr_intr) - idp->idr_intr(m_ptr->NOTIFY_INTMASK); + idp->idr_intr(m_ptr->m_notify.interrupts); break; case CLOCK: if (idp->idr_alarm) - idp->idr_alarm(m_ptr->NOTIFY_TIMESTAMP); + idp->idr_alarm(m_ptr->m_notify.timestamp); break; default: diff --git a/lib/libsys/sef_signal.c b/lib/libsys/sef_signal.c index dd3bbb3f0..d26ec47fe 100644 --- a/lib/libsys/sef_signal.c +++ b/lib/libsys/sef_signal.c @@ -93,7 +93,7 @@ int do_sef_signal_request(message *m_ptr) if(m_ptr->m_source == SYSTEM) { /* Handle kernel signals. */ - sigset = m_ptr->NOTIFY_SIGSET; + sigset = m_ptr->m_notify.sigset; for (signo = SIGK_FIRST; signo <= SIGK_LAST; signo++) { int s = sigismember(&sigset, signo); assert(s >= 0); diff --git a/lib/libsys/vm_cache.c b/lib/libsys/vm_cache.c index 7b3d2b326..1cf19b4fa 100644 --- a/lib/libsys/vm_cache.c +++ b/lib/libsys/vm_cache.c @@ -28,14 +28,14 @@ int vm_cachecall(message *m, int call, void *addr, dev_t dev, off_t dev_offset, assert(dev != NO_DEV); - m->m_u.m_vmmcp.dev_offset = dev_offset; - m->m_u.m_vmmcp.ino_offset = ino_offset; - m->m_u.m_vmmcp.ino = ino; - m->m_u.m_vmmcp.block = addr; - m->m_u.m_vmmcp.flags_ptr = flags; - m->m_u.m_vmmcp.dev = dev; - m->m_u.m_vmmcp.pages = blocksize / PAGE_SIZE; - m->m_u.m_vmmcp.flags = 0; + m->m_vmmcp.dev_offset = dev_offset; + m->m_vmmcp.ino_offset = ino_offset; + m->m_vmmcp.ino = ino; + m->m_vmmcp.block = addr; + m->m_vmmcp.flags_ptr = flags; + m->m_vmmcp.dev = dev; + m->m_vmmcp.pages = blocksize / PAGE_SIZE; + m->m_vmmcp.flags = 0; return _taskcall(VM_PROC_NR, call, m); } @@ -49,7 +49,7 @@ void *vm_map_cacheblock(dev_t dev, off_t dev_offset, ino, ino_offset, flags, blocksize) != OK) return MAP_FAILED; - return m.m_u.m_vmmcp_reply.addr; + return m.m_vmmcp_reply.addr; } int vm_set_cacheblock(void *block, dev_t dev, off_t dev_offset, @@ -70,7 +70,7 @@ vm_clear_cache(dev_t dev) memset(&m, 0, sizeof(m)); - m.m_u.m_vmmcp.dev = dev; + m.m_vmmcp.dev = dev; return _taskcall(VM_PROC_NR, VM_CLEARCACHE, &m); } diff --git a/servers/lwip/lwip.c b/servers/lwip/lwip.c index 00bee12ae..0edd7af51 100644 --- a/servers/lwip/lwip.c +++ b/servers/lwip/lwip.c @@ -275,7 +275,7 @@ int main(__unused int argc, __unused char ** argv) else if (is_ipc_notify(ipc_status)) { switch (m.m_source) { case CLOCK: - expire_timers(m.NOTIFY_TIMESTAMP); + expire_timers(m.m_notify.timestamp); break; case DS_PROC_NR: ds_event(); diff --git a/servers/pm/main.c b/servers/pm/main.c index 32bb4fdc1..523e8c491 100644 --- a/servers/pm/main.c +++ b/servers/pm/main.c @@ -65,7 +65,7 @@ int main() /* Check for system notifications first. Special cases. */ if (is_ipc_notify(ipc_status)) { if (_ENDPOINT_P(m_in.m_source) == CLOCK) - expire_timers(m_in.NOTIFY_TIMESTAMP); + expire_timers(m_in.m_notify.timestamp); /* done, continue */ continue; diff --git a/servers/rs/main.c b/servers/rs/main.c index 7488b4366..7ac1f4c49 100644 --- a/servers/rs/main.c +++ b/servers/rs/main.c @@ -81,7 +81,7 @@ int main(void) continue; default: /* heartbeat notification */ if (rproc_ptr[who_p] != NULL) { /* mark heartbeat time */ - rproc_ptr[who_p]->r_alive_tm = m.NOTIFY_TIMESTAMP; + rproc_ptr[who_p]->r_alive_tm = m.m_notify.timestamp; } else { printf("RS: warning: got unexpected notify message from %d\n", m.m_source); diff --git a/servers/rs/manager.c b/servers/rs/manager.c index 6caa2c2a5..689360b6d 100644 --- a/servers/rs/manager.c +++ b/servers/rs/manager.c @@ -237,7 +237,7 @@ int srv_update(endpoint_t src_e, endpoint_t dst_e) *===========================================================================*/ void update_period(message *m_ptr) { - clock_t now = m_ptr->NOTIFY_TIMESTAMP; + clock_t now = m_ptr->m_notify.timestamp; short has_update_timed_out; message m; struct rprocpub *rpub; diff --git a/servers/rs/request.c b/servers/rs/request.c index fd64a6e5b..a9480e624 100755 --- a/servers/rs/request.c +++ b/servers/rs/request.c @@ -730,7 +730,7 @@ message *m_ptr; { register struct rproc *rp; register struct rprocpub *rpub; - clock_t now = m_ptr->NOTIFY_TIMESTAMP; + clock_t now = m_ptr->m_notify.timestamp; int s; long period; diff --git a/servers/sched/main.c b/servers/sched/main.c index dfa38046d..8e0a990b5 100644 --- a/servers/sched/main.c +++ b/servers/sched/main.c @@ -50,7 +50,7 @@ int main(void) if (is_ipc_notify(ipc_status)) { switch(who_e) { case CLOCK: - expire_timers(m_in.NOTIFY_TIMESTAMP); + expire_timers(m_in.m_notify.timestamp); continue; /* don't reply */ default : result = ENOSYS; diff --git a/servers/vfs/main.c b/servers/vfs/main.c index f266168c5..1e0099767 100644 --- a/servers/vfs/main.c +++ b/servers/vfs/main.c @@ -109,7 +109,7 @@ int main(void) break; case CLOCK: /* Timer expired. Used only for select(). Check it. */ - expire_timers(m_in.NOTIFY_TIMESTAMP); + expire_timers(m_in.m_notify.timestamp); break; default: printf("VFS: ignoring notification from %d\n", who_e); diff --git a/servers/vm/mem_cache.c b/servers/vm/mem_cache.c index 46fc90255..8e7e97b88 100644 --- a/servers/vm/mem_cache.c +++ b/servers/vm/mem_cache.c @@ -85,11 +85,11 @@ static int cache_resize(struct vmproc *vmp, struct vir_region *vr, vir_bytes l) int do_mapcache(message *msg) { - dev_t dev = msg->m_u.m_vmmcp.dev; - u64_t dev_off = msg->m_u.m_vmmcp.dev_offset; - u64_t ino_off = msg->m_u.m_vmmcp.ino_offset; + dev_t dev = msg->m_vmmcp.dev; + off_t dev_off = msg->m_vmmcp.dev_offset; + off_t ino_off = msg->m_vmmcp.ino_offset; int n; - phys_bytes bytes = msg->m_u.m_vmmcp.pages * VM_PAGE_SIZE; + phys_bytes bytes = msg->m_vmmcp.pages * VM_PAGE_SIZE; struct vir_region *vr; struct vmproc *caller; vir_bytes offset; @@ -120,7 +120,7 @@ do_mapcache(message *msg) assert(offset < vr->length); if(!(hb = find_cached_page_bydev(dev, dev_off + offset, - msg->m_u.m_vmmcp.ino, ino_off + offset, 1))) { + msg->m_vmmcp.ino, ino_off + offset, 1))) { map_unmap_region(caller, vr, 0, bytes); return ENOENT; } @@ -141,7 +141,7 @@ do_mapcache(message *msg) memset(msg, 0, sizeof(*msg)); - msg->m_u.m_vmmcp_reply.addr = (void *) vr->vaddr; + msg->m_vmmcp_reply.addr = (void *) vr->vaddr; assert(vr); @@ -170,13 +170,13 @@ int do_setcache(message *msg) { int r; - dev_t dev = msg->m_u.m_vmmcp.dev; - u64_t dev_off = (u64_t) msg->m_u.m_vmmcp.dev_offset; - u64_t ino_off = (u64_t) msg->m_u.m_vmmcp.ino_offset; + dev_t dev = msg->m_vmmcp.dev; + off_t dev_off = msg->m_vmmcp.dev_offset; + off_t ino_off = msg->m_vmmcp.ino_offset; int n; struct vmproc *caller; phys_bytes offset; - phys_bytes bytes = msg->m_u.m_vmmcp.pages * VM_PAGE_SIZE; + phys_bytes bytes = msg->m_vmmcp.pages * VM_PAGE_SIZE; if(bytes < VM_PAGE_SIZE) return EINVAL; @@ -191,7 +191,7 @@ do_setcache(message *msg) for(offset = 0; offset < bytes; offset += VM_PAGE_SIZE) { struct vir_region *region; struct phys_region *phys_region = NULL; - vir_bytes v = (vir_bytes) msg->m_u.m_vmmcp.block + offset; + vir_bytes v = (vir_bytes) msg->m_vmmcp.block + offset; struct cached_page *hb; if(!(region = map_lookup(caller, v, &phys_region))) { @@ -205,7 +205,7 @@ do_setcache(message *msg) } if((hb=find_cached_page_bydev(dev, dev_off + offset, - msg->m_u.m_vmmcp.ino, ino_off + offset, 1))) { + msg->m_vmmcp.ino, ino_off + offset, 1))) { /* block inode info updated */ if(hb->page != phys_region->ph) { /* previous cache entry has become @@ -235,7 +235,7 @@ do_setcache(message *msg) phys_region->memtype = &mem_type_cache; if((r=addcache(dev, dev_off + offset, - msg->m_u.m_vmmcp.ino, ino_off + offset, phys_region->ph)) != OK) { + msg->m_vmmcp.ino, ino_off + offset, phys_region->ph)) != OK) { printf("VM: addcache failed\n"); return r; } @@ -256,7 +256,7 @@ do_clearcache(message *msg) { dev_t dev; - dev = msg->m_u.m_vmmcp.dev; + dev = msg->m_vmmcp.dev; clear_cache_bydev(dev); diff --git a/servers/vm/mmap.c b/servers/vm/mmap.c index 55f70d56b..52977cad9 100644 --- a/servers/vm/mmap.c +++ b/servers/vm/mmap.c @@ -141,18 +141,18 @@ int do_vfs_mmap(message *m) /* It might be disabled */ if(!enable_filemap) return ENXIO; - clearend = m->m_u.m_vm_vfs.clearend; - flags = m->m_u.m_vm_vfs.flags; + clearend = m->m_vm_vfs.clearend; + flags = m->m_vm_vfs.flags; - if((r=vm_isokendpt(m->m_u.m_vm_vfs.who, &n)) != OK) - panic("bad ep %d from vfs", m->m_u.m_vm_vfs.who); + if((r=vm_isokendpt(m->m_vm_vfs.who, &n)) != OK) + panic("bad ep %d from vfs", m->m_vm_vfs.who); vmp = &vmproc[n]; - return mmap_file(vmp, m->m_u.m_vm_vfs.fd, m->m_u.m_vm_vfs.offset, + return mmap_file(vmp, m->m_vm_vfs.fd, m->m_vm_vfs.offset, MAP_PRIVATE | MAP_FIXED, - m->m_u.m_vm_vfs.ino, m->m_u.m_vm_vfs.dev, + m->m_vm_vfs.ino, m->m_vm_vfs.dev, (u64_t) LONG_MAX * VM_PAGE_SIZE, - m->m_u.m_vm_vfs.vaddr, m->m_u.m_vm_vfs.len, &v, + m->m_vm_vfs.vaddr, m->m_vm_vfs.len, &v, clearend, flags, 0); }