From c3fc9df84a3d2745b608bee70ae8396c87b2638d Mon Sep 17 00:00:00 2001 From: Lionel Sambuc Date: Fri, 1 Nov 2013 13:34:14 +0100 Subject: [PATCH] Adding ipc_ prefix to ipc primitives * Also change _orig to _intr for clarity * Cleaned up {IPC,KER}VEC * Renamed _minix_kernel_info_struct to get_minix_kerninfo * Merged _senda.S into _ipc.S * Moved into separate files get_minix_kerninfo and _do_kernel_call * Adapted do_kernel_call to follow same _ convention as ipc functions * Drop patches in libc/net/send.c and libc/include/namespace.h Change-Id: If4ea21ecb65435170d7d87de6c826328e84c18d0 --- drivers/acpi/acpi.c | 4 +- drivers/amddev/amddev.c | 2 +- drivers/atl2/atl2.c | 6 +- drivers/dec21140A/dec21140A.c | 6 +- drivers/dp8390/dp8390.c | 14 ++--- drivers/dpeth/dp.c | 8 +-- drivers/e1000/e1000.c | 10 ++-- drivers/fb/fb_edid.c | 14 ++--- drivers/fbd/fbd.c | 20 +++---- drivers/filter/driver.c | 24 ++++---- drivers/fxp/fxp.c | 14 ++--- drivers/i2c/i2c.c | 4 +- drivers/lan8710a/lan8710a.c | 10 ++-- drivers/lance/lance.c | 8 +-- drivers/orinoco/orinoco.c | 8 +-- drivers/pci/main.c | 34 +++++------ drivers/pci/pci.c | 4 +- drivers/readclock/readclock.c | 4 +- drivers/rtl8139/rtl8139.c | 14 ++--- drivers/rtl8169/rtl8169.c | 10 ++-- drivers/tps65950/tps65950.c | 4 +- drivers/tty/arch/i386/keyboard.c | 4 +- drivers/uds/uds.h | 2 +- drivers/vbox/hgcm.c | 2 +- drivers/virtio_net/virtio_net.c | 20 +++---- include/arch/earm/include/ipcconst.h | 4 +- include/arch/i386/include/ipcconst.h | 7 ++- include/minix/ipc.h | 47 ++++++++------- kernel/arch/earm/mpx.S | 4 +- kernel/arch/i386/mpx.S | 1 + kernel/proc.h | 2 +- lib/libaudiodriver/audio_fw.c | 4 +- lib/libbdev/ipc.c | 2 +- lib/libbdev/minor.c | 2 +- lib/libblockdriver/driver.c | 4 +- lib/libc/arch/arm/sys-minix/Makefile.inc | 3 +- .../arch/arm/sys-minix/_do_kernel_call_intr.S | 8 +++ lib/libc/arch/arm/sys-minix/_ipc.S | 53 +++++++---------- lib/libc/arch/arm/sys-minix/_senda.S | 13 ----- .../arch/arm/sys-minix/get_minix_kerninfo.S | 17 ++++++ lib/libc/arch/i386/sys-minix/Makefile.inc | 3 +- .../i386/sys-minix/_do_kernel_call_intr.S | 8 +++ lib/libc/arch/i386/sys-minix/_ipc.S | 57 +++++++++---------- lib/libc/arch/i386/sys-minix/_senda.S | 17 ------ .../arch/i386/sys-minix/get_minix_kerninfo.S | 17 ++++++ lib/libc/include/namespace.h | 6 -- lib/libc/net/send.c | 6 -- lib/libc/sys-minix/init.c | 27 +++++---- lib/libc/sys-minix/sigreturn.c | 2 +- lib/libc/sys-minix/syscall.c | 4 +- lib/libchardriver/chardriver.c | 4 +- lib/libddekit/src/usb_server.c | 10 ++-- lib/libdevman/generic.c | 12 ++-- lib/libexec/exec_general.c | 2 +- lib/libi2cdriver/i2cdriver.c | 6 +- lib/libinputdriver/inputdriver.c | 2 +- lib/libminc/Makefile | 2 +- lib/libpuffs/puffs.c | 2 +- lib/libsffs/main.c | 4 +- lib/libsys/arch/i386/vbox.c | 6 +- lib/libsys/asynsend.c | 6 +- lib/libsys/gcov.c | 2 +- lib/libsys/pci_attr_r16.c | 2 +- lib/libsys/pci_attr_r32.c | 2 +- lib/libsys/pci_attr_r8.c | 2 +- lib/libsys/pci_attr_w16.c | 2 +- lib/libsys/pci_attr_w32.c | 2 +- lib/libsys/pci_attr_w8.c | 2 +- lib/libsys/pci_del_acl.c | 2 +- lib/libsys/pci_dev_name.c | 2 +- lib/libsys/pci_find_dev.c | 2 +- lib/libsys/pci_first_dev.c | 2 +- lib/libsys/pci_get_bar.c | 2 +- lib/libsys/pci_ids.c | 2 +- lib/libsys/pci_init.c | 2 +- lib/libsys/pci_next_dev.c | 2 +- lib/libsys/pci_rescan_bus.c | 2 +- lib/libsys/pci_reserve.c | 2 +- lib/libsys/pci_set_acl.c | 2 +- lib/libsys/pci_slot_name.c | 2 +- lib/libsys/sef.c | 6 +- lib/libsys/sef_init.c | 2 +- lib/libsys/sef_liveupdate.c | 2 +- lib/libsys/sef_ping.c | 2 +- lib/libsys/sysutil.h | 2 +- lib/libsys/taskcall.c | 2 +- lib/libusb/usb.c | 6 +- lib/libvtreefs/vtreefs.c | 2 +- servers/devman/bind.c | 8 +-- servers/devman/device.c | 2 +- servers/ds/main.c | 2 +- servers/ds/store.c | 4 +- servers/ext2/main.c | 2 +- servers/input/input.c | 4 +- servers/ipc/main.c | 2 +- servers/ipc/sem.c | 4 +- servers/is/dmp.c | 4 +- servers/is/main.c | 2 +- servers/iso9660fs/main.c | 2 +- servers/mfs/main.c | 2 +- servers/pfs/main.c | 2 +- servers/pm/main.c | 6 +- servers/rs/exec.c | 2 +- servers/rs/manager.c | 6 +- servers/rs/request.c | 2 +- servers/rs/utility.c | 2 +- servers/sched/main.c | 2 +- servers/vfs/main.c | 20 +++---- servers/vfs/misc.c | 8 +-- servers/vm/main.c | 10 ++-- servers/vm/mmap.c | 4 +- servers/vm/queryexit.c | 4 +- servers/vm/rs.c | 4 +- sys/arch/arm/include/asm.h | 2 +- sys/arch/i386/include/asm.h | 7 --- test/blocktest/blocktest.c | 6 +- test/kernel/sys_vumap/vumaprelay.c | 2 +- test/kernel/sys_vumap/vumaptest.c | 2 +- 118 files changed, 408 insertions(+), 407 deletions(-) create mode 100644 lib/libc/arch/arm/sys-minix/_do_kernel_call_intr.S delete mode 100644 lib/libc/arch/arm/sys-minix/_senda.S create mode 100644 lib/libc/arch/arm/sys-minix/get_minix_kerninfo.S create mode 100644 lib/libc/arch/i386/sys-minix/_do_kernel_call_intr.S delete mode 100644 lib/libc/arch/i386/sys-minix/_senda.S create mode 100644 lib/libc/arch/i386/sys-minix/get_minix_kerninfo.S diff --git a/drivers/acpi/acpi.c b/drivers/acpi/acpi.c index b1e5e1ca7..a58c06243 100644 --- a/drivers/acpi/acpi.c +++ b/drivers/acpi/acpi.c @@ -149,9 +149,9 @@ int main(void) ((struct acpi_request_hdr *)&m)->m_source); } - err = send(m.m_source, &m); + err = ipc_send(m.m_source, &m); if (err != OK) { - printf("ACPI: send failed: %d\n", err); + printf("ACPI: ipc_send failed: %d\n", err); } } } diff --git a/drivers/amddev/amddev.c b/drivers/amddev/amddev.c index 0b8c63537..913d3a545 100644 --- a/drivers/amddev/amddev.c +++ b/drivers/amddev/amddev.c @@ -84,7 +84,7 @@ int main(void) if (m.m_type == IOMMU_MAP) { r= do_add4pci(&m); m.m_type= r; - send(m.m_source, &m); + ipc_send(m.m_source, &m); continue; } printf("amddev: got message from %d\n", m.m_source); diff --git a/drivers/atl2/atl2.c b/drivers/atl2/atl2.c index 4869317d6..760f18dfb 100644 --- a/drivers/atl2/atl2.c +++ b/drivers/atl2/atl2.c @@ -735,7 +735,7 @@ static void atl2_reply(void) ATL2_DEBUG(("ATL2: sending reply, flags %x count %d\n", flags, m.DL_COUNT)); - if ((r = send(state.task_endpt, &m)) != OK) + if ((r = ipc_send(state.task_endpt, &m)) != OK) panic("unable to reply: %d", r); state.flags &= ~(ATL2_FLAG_PACK_SENT | ATL2_FLAG_PACK_RCVD); @@ -1042,7 +1042,7 @@ static void atl2_conf(message *m) m->m_type = DL_CONF_REPLY; m->DL_STAT = OK; - if ((r = send(m->m_source, m)) != OK) + if ((r = ipc_send(m->m_source, m)) != OK) printf("ATL2: unable to send reply (%d)\n", r); } @@ -1060,7 +1060,7 @@ static void atl2_getstat(message *m) m->m_type = DL_STAT_REPLY; - if ((r = send(m->m_source, m)) != OK) + if ((r = ipc_send(m->m_source, m)) != OK) printf("ATL2: unable to send reply (%d)\n", r); } diff --git a/drivers/dec21140A/dec21140A.c b/drivers/dec21140A/dec21140A.c index b4f105331..7dab36fbe 100644 --- a/drivers/dec21140A/dec21140A.c +++ b/drivers/dec21140A/dec21140A.c @@ -182,7 +182,7 @@ static void do_get_stat_s(message * mp) panic("%s %d", str_CopyErrMsg, rc); mp->m_type = DL_STAT_REPLY; - rc = send(mp->m_source, mp); + rc = ipc_send(mp->m_source, mp); if( rc != OK ) panic("%s %d", str_StatErrMsg, rc); return; @@ -251,7 +251,7 @@ static void do_conf(const message * mp) *(ether_addr_t *) reply_mess.DL_HWADDR = dep->de_address; } - if (send(mp->m_source, &reply_mess) != OK) + if (ipc_send(mp->m_source, &reply_mess) != OK) panic("%s %d", str_SendErrMsg, mp->m_source); return; @@ -269,7 +269,7 @@ static void do_reply(dpeth_t * dep) reply.DL_FLAGS = flags; reply.DL_COUNT = dep->de_read_s; - r = send(dep->de_client, &reply); + r = ipc_send(dep->de_client, &reply); if(r < 0) panic("%s %d", str_SendErrMsg, r); diff --git a/drivers/dp8390/dp8390.c b/drivers/dp8390/dp8390.c index a7ea8593e..660cfc04a 100644 --- a/drivers/dp8390/dp8390.c +++ b/drivers/dp8390/dp8390.c @@ -582,9 +582,9 @@ message *mp; (vir_bytes) sizeof(dep->de_stat), &dep->de_stat); mp->m_type= DL_STAT_REPLY; - r= send(mp->m_source, mp); + r= ipc_send(mp->m_source, mp); if (r != OK) - panic("do_getstat: send failed: %d", r); + panic("do_getstat: ipc_send failed: %d", r); return; } assert(dep->de_mode == DEM_ENABLED); @@ -598,9 +598,9 @@ message *mp; sizeof(dep->de_stat), &dep->de_stat); mp->m_type= DL_STAT_REPLY; - r= send(mp->m_source, mp); + r= ipc_send(mp->m_source, mp); if (r != OK) - panic("do_getstat: send failed: %d", r); + panic("do_getstat: ipc_send failed: %d", r); } /*===========================================================================* @@ -1741,10 +1741,10 @@ dpeth_t *dep; reply.m_type = DL_TASK_REPLY; reply.DL_FLAGS = flags; reply.DL_COUNT = dep->de_read_s; - r= send(dep->de_client, &reply); + r= ipc_send(dep->de_client, &reply); if (r < 0) - panic("dp8390: send failed: %d", r); + panic("dp8390: ipc_send failed: %d", r); dep->de_read_s = 0; dep->de_flags &= ~(DEF_PACK_SEND | DEF_PACK_RECV); @@ -1757,7 +1757,7 @@ static void mess_reply(req, reply_mess) message *req; message *reply_mess; { - if (send(req->m_source, reply_mess) != OK) + if (ipc_send(req->m_source, reply_mess) != OK) panic("dp8390: unable to mess_reply"); } diff --git a/drivers/dpeth/dp.c b/drivers/dpeth/dp.c index 818d3d181..e8f2b8097 100644 --- a/drivers/dpeth/dp.c +++ b/drivers/dpeth/dp.c @@ -67,7 +67,7 @@ static void reply(dpeth_t * dep) DEBUG(printf("\t reply %d (%lx)\n", reply.m_type, reply.DL_FLAGS)); - if ((r = send(dep->de_client, &reply)) != OK) + if ((r = ipc_send(dep->de_client, &reply)) != OK) panic(SendErrMsg, r); dep->de_read_s = 0; @@ -299,7 +299,7 @@ static void do_init(const message * mp) if (r == OK) *(ether_addr_t *) reply_mess.DL_HWADDR = dep->de_address; DEBUG(printf("\t reply %d\n", reply_mess.m_type)); - if (send(mp->m_source, &reply_mess) != OK) /* Can't send */ + if (ipc_send(mp->m_source, &reply_mess) != OK) /* Can't send */ panic(SendErrMsg, mp->m_source); return; @@ -437,9 +437,9 @@ static void do_getstat_s(const message * mp) panic(CopyErrMsg, rc); reply_mess.m_type = DL_STAT_REPLY; - rc= send(mp->m_source, &reply_mess); + rc= ipc_send(mp->m_source, &reply_mess); if (rc != OK) - panic("do_getname: send failed: %d", rc); + panic("do_getname: ipc_send failed: %d", rc); return; } diff --git a/drivers/e1000/e1000.c b/drivers/e1000/e1000.c index 9d719a2e3..afbf4160e 100644 --- a/drivers/e1000/e1000.c +++ b/drivers/e1000/e1000.c @@ -793,8 +793,8 @@ message *mp; sys_safecopyto(mp->m_source, mp->DL_GRANT, 0, (vir_bytes)&stats, sizeof(stats)); mp->m_type = DL_STAT_REPLY; - if((r=send(mp->m_source, mp)) != OK) - panic("e1000_getstat: send() failed: %d", r); + if((r=ipc_send(mp->m_source, mp)) != OK) + panic("e1000_getstat: ipc_send() failed: %d", r); } /*===========================================================================* @@ -1183,9 +1183,9 @@ e1000_t *e; } /* Acknowledge to INET. */ - if ((r = send(e->client, &msg)) != OK) + if ((r = ipc_send(e->client, &msg)) != OK) { - panic("send() failed: %d", r); + panic("ipc_send() failed: %d", r); } } @@ -1196,7 +1196,7 @@ static void mess_reply(req, reply_mess) message *req; message *reply_mess; { - if (send(req->m_source, reply_mess) != OK) + if (ipc_send(req->m_source, reply_mess) != OK) { panic("unable to send reply message"); } diff --git a/drivers/fb/fb_edid.c b/drivers/fb/fb_edid.c index f2a16c4f6..e0e4ef18b 100644 --- a/drivers/fb/fb_edid.c +++ b/drivers/fb/fb_edid.c @@ -96,9 +96,9 @@ do_read(endpoint_t driver_endpt, uint8_t *buf, size_t bufsize) m.BDEV_ID = 0; m.BDEV_MINOR = 0; - r = sendrec(driver_endpt, &m); + r = ipc_sendrec(driver_endpt, &m); if (r != OK) { - log_debug(&log, "sendrec(BDEV_OPEN) failed (r=%d)\n", r); + log_debug(&log, "ipc_sendrec(BDEV_OPEN) failed (r=%d)\n", r); return r; } @@ -116,16 +116,16 @@ do_read(endpoint_t driver_endpt, uint8_t *buf, size_t bufsize) m.BDEV_POS_LO = 0; m.BDEV_POS_HI = 0; - r = sendrec(driver_endpt, &m); + r = ipc_sendrec(driver_endpt, &m); cpf_revoke(grant_nr); if (r != OK) { - log_debug(&log, "sendrec(BDEV_READ) failed (r=%d)\n", r); + log_debug(&log, "ipc_sendrec(BDEV_READ) failed (r=%d)\n", r); /* Clean-up: try to close the device */ memset(&m, '\0', sizeof(message)); m.m_type = BDEV_CLOSE; m.BDEV_MINOR = 0; m.BDEV_ID = 0; - sendrec(driver_endpt, &m); + ipc_sendrec(driver_endpt, &m); return r; } @@ -134,9 +134,9 @@ do_read(endpoint_t driver_endpt, uint8_t *buf, size_t bufsize) m.m_type = BDEV_CLOSE; m.BDEV_MINOR = 0; m.BDEV_ID = 0; - r = sendrec(driver_endpt, &m); + r = ipc_sendrec(driver_endpt, &m); if (r != OK) { - log_debug(&log, "sendrec(BDEV_CLOSE) failed (r=%d)\n", r); + log_debug(&log, "ipc_sendrec(BDEV_CLOSE) failed (r=%d)\n", r); return r; } diff --git a/drivers/fbd/fbd.c b/drivers/fbd/fbd.c index ac79a82f5..5ffc93a1d 100644 --- a/drivers/fbd/fbd.c +++ b/drivers/fbd/fbd.c @@ -153,8 +153,8 @@ static int fbd_open(devminor_t UNUSED(minor), int access) m.BDEV_ACCESS = access; m.BDEV_ID = 0; - if ((r = sendrec(driver_endpt, &m)) != OK) - panic("sendrec to driver failed (%d)\n", r); + if ((r = ipc_sendrec(driver_endpt, &m)) != OK) + panic("ipc_sendrec to driver failed (%d)\n", r); if (m.m_type != BDEV_REPLY) panic("invalid reply from driver (%d)\n", m.m_type); @@ -177,8 +177,8 @@ static int fbd_close(devminor_t UNUSED(minor)) m.BDEV_MINOR = driver_minor; m.BDEV_ID = 0; - if ((r = sendrec(driver_endpt, &m)) != OK) - panic("sendrec to driver failed (%d)\n", r); + if ((r = ipc_sendrec(driver_endpt, &m)) != OK) + panic("ipc_sendrec to driver failed (%d)\n", r); if (m.m_type != BDEV_REPLY) panic("invalid reply from driver (%d)\n", m.m_type); @@ -218,8 +218,8 @@ static int fbd_ioctl(devminor_t UNUSED(minor), unsigned long request, m.BDEV_USER = NONE; m.BDEV_ID = 0; - if ((r = sendrec(driver_endpt, &m)) != OK) - panic("sendrec to driver failed (%d)\n", r); + if ((r = ipc_sendrec(driver_endpt, &m)) != OK) + panic("ipc_sendrec to driver failed (%d)\n", r); if (m.m_type != BDEV_REPLY) panic("invalid reply from driver (%d)\n", m.m_type); @@ -261,8 +261,8 @@ static ssize_t fbd_transfer_direct(int do_write, u64_t position, m.BDEV_POS_LO = ex64lo(position); m.BDEV_POS_HI = ex64hi(position); - if ((r = sendrec(driver_endpt, &m)) != OK) - panic("sendrec to driver failed (%d)\n", r); + if ((r = ipc_sendrec(driver_endpt, &m)) != OK) + panic("ipc_sendrec to driver failed (%d)\n", r); if (m.m_type != BDEV_REPLY) panic("invalid reply from driver (%d)\n", m.m_type); @@ -354,8 +354,8 @@ static ssize_t fbd_transfer_copy(int do_write, u64_t position, m.BDEV_POS_LO = ex64lo(position); m.BDEV_POS_HI = ex64hi(position); - if ((r = sendrec(driver_endpt, &m)) != OK) - panic("sendrec to driver failed (%d)\n", r); + if ((r = ipc_sendrec(driver_endpt, &m)) != OK) + panic("ipc_sendrec to driver failed (%d)\n", r); if (m.m_type != BDEV_REPLY) panic("invalid reply from driver (%d)\n", m.m_type); diff --git a/drivers/filter/driver.c b/drivers/filter/driver.c index 02f7eb7f7..c7ae6f851 100644 --- a/drivers/filter/driver.c +++ b/drivers/filter/driver.c @@ -19,8 +19,8 @@ static int problem_stats[BD_LAST] = { 0 }; static int driver_open(int which) { /* Perform an open or close operation on the driver. This is - * unfinished code: we should never be doing a blocking sendrec() to - * the driver. + * unfinished code: we should never be doing a blocking ipc_sendrec() + * to the driver. */ message msg; cp_grant_id_t gid; @@ -33,17 +33,17 @@ static int driver_open(int which) msg.BDEV_MINOR = driver[which].minor; msg.BDEV_ACCESS = BDEV_R_BIT | BDEV_W_BIT; msg.BDEV_ID = 0; - r = sendrec(driver[which].endpt, &msg); + r = ipc_sendrec(driver[which].endpt, &msg); if (r != OK) { /* Should we restart the driver now? */ - printf("Filter: driver_open: sendrec returned %d\n", r); + printf("Filter: driver_open: ipc_sendrec returned %d\n", r); return RET_REDO; } if(msg.m_type != BDEV_REPLY || msg.BDEV_STATUS != OK) { - printf("Filter: driver_open: sendrec returned %d, %d\n", + printf("Filter: driver_open: ipc_sendrec returned %d, %d\n", msg.m_type, msg.BDEV_STATUS); return RET_REDO; @@ -63,7 +63,7 @@ static int driver_open(int which) msg.BDEV_USER = NONE; msg.BDEV_ID = 0; - r = sendrec(driver[which].endpt, &msg); + r = ipc_sendrec(driver[which].endpt, &msg); cpf_revoke(gid); @@ -113,17 +113,17 @@ static int driver_close(int which) msg.m_type = BDEV_CLOSE; msg.BDEV_MINOR = driver[which].minor; msg.BDEV_ID = 0; - r = sendrec(driver[which].endpt, &msg); + r = ipc_sendrec(driver[which].endpt, &msg); if (r != OK) { /* Should we restart the driver now? */ - printf("Filter: driver_close: sendrec returned %d\n", r); + printf("Filter: driver_close: ipc_sendrec returned %d\n", r); return RET_REDO; } if(msg.m_type != BDEV_REPLY || msg.BDEV_STATUS != OK) { - printf("Filter: driver_close: sendrec returned %d, %d\n", + printf("Filter: driver_close: ipc_sendrec returned %d, %d\n", msg.m_type, msg.BDEV_STATUS); return RET_REDO; @@ -435,7 +435,7 @@ static void restart_driver(int which, int tell_rs) driver[which].label); #endif - r = sendrec(RS_PROC_NR, &msg); + r = ipc_sendrec(RS_PROC_NR, &msg); if (r != OK || msg.m_type != OK) panic("RS request failed: %d", r); @@ -531,10 +531,10 @@ static int flt_senda(message *mess, int which) amp->dst = driver[which].endpt; amp->msg = *mess; amp->flags = AMF_VALID; - r = senda(amsgtable, 2); + r = ipc_senda(amsgtable, 2); if(r != OK) - panic("senda returned error: %d", r); + panic("ipc_senda returned error: %d", r); return r; } diff --git a/drivers/fxp/fxp.c b/drivers/fxp/fxp.c index 19f82be44..49757ff8f 100644 --- a/drivers/fxp/fxp.c +++ b/drivers/fxp/fxp.c @@ -1433,9 +1433,9 @@ static void fxp_getstat_s(message *mp) panic("fxp_getstat_s: sys_safecopyto failed: %d", r); mp->m_type= DL_STAT_REPLY; - r= send(mp->m_source, mp); + r= ipc_send(mp->m_source, mp); if (r != OK) - panic("fxp_getstat_s: send failed: %d", r); + panic("fxp_getstat_s: ipc_send failed: %d", r); } /*===========================================================================* @@ -1939,10 +1939,10 @@ fxp_t *fp; reply.DL_FLAGS = flags; reply.DL_COUNT = fp->fxp_read_s; - r= send(fp->fxp_client, &reply); + r= ipc_send(fp->fxp_client, &reply); if (r < 0) - panic("fxp: send failed: %d", r); + panic("fxp: ipc_send failed: %d", r); fp->fxp_read_s = 0; fp->fxp_flags &= ~(FF_PACK_SENT | FF_PACK_RECV); @@ -1955,7 +1955,7 @@ static void mess_reply(req, reply_mess) message *req; message *reply_mess; { - if (send(req->m_source, reply_mess) != OK) + if (ipc_send(req->m_source, reply_mess) != OK) panic("fxp: unable to mess_reply"); } @@ -2183,10 +2183,10 @@ int pci_func; m.m2_l1= buf; m.m2_l2= size; - r= sendrec(dev_e, &m); + r= ipc_sendrec(dev_e, &m); if (r != OK) { - printf("fxp`tell_dev: sendrec to %d failed: %d\n", + printf("fxp`tell_dev: ipc_sendrec to %d failed: %d\n", dev_e, r); return; } diff --git a/drivers/i2c/i2c.c b/drivers/i2c/i2c.c index 264407526..26e7b869f 100644 --- a/drivers/i2c/i2c.c +++ b/drivers/i2c/i2c.c @@ -341,8 +341,8 @@ i2c_other(message * m, int ipc_status) memset(&m_reply, 0, sizeof(m_reply)); m_reply.m_type = r; - if ((r = send(m->m_source, &m_reply)) != OK) - log_warn(&log, "send() to %d failed: %d\n", m->m_source, r); + if ((r = ipc_send(m->m_source, &m_reply)) != OK) + log_warn(&log, "ipc_send() to %d failed: %d\n", m->m_source, r); } /* diff --git a/drivers/lan8710a/lan8710a.c b/drivers/lan8710a/lan8710a.c index 677b45477..d2b58120d 100644 --- a/drivers/lan8710a/lan8710a.c +++ b/drivers/lan8710a/lan8710a.c @@ -440,8 +440,8 @@ message *mp; sizeof(stats)); mp->m_type = DL_STAT_REPLY; - if ((r=send(mp->m_source, mp)) != OK) { - panic("lan8710a_getstat: send() failed: %d", r); + if ((r=ipc_send(mp->m_source, mp)) != OK) { + panic("lan8710a_getstat: ipc_send() failed: %d", r); } } @@ -1189,7 +1189,7 @@ static void mess_reply(req, reply) message *req;message *reply; { - if (send(req->m_source, reply) != OK) { + if (ipc_send(req->m_source, reply) != OK) { panic("unable to send reply message"); } } @@ -1235,7 +1235,7 @@ lan8710a_t *e; } /* Acknowledge to INET. */ - if ((r = send(e->client, &msg) != OK)) { - panic("send() failed: %d", r); + if ((r = ipc_send(e->client, &msg) != OK)) { + panic("ipc_send() failed: %d", r); } } diff --git a/drivers/lance/lance.c b/drivers/lance/lance.c index 5a9729d5e..05e177f68 100644 --- a/drivers/lance/lance.c +++ b/drivers/lance/lance.c @@ -677,9 +677,9 @@ ether_card_t *ec; reply.DL_FLAGS = flags; reply.DL_COUNT = ec->read_s; - r = send(ec->client, &reply); + r = ipc_send(ec->client, &reply); if (r < 0) - panic("send failed: %d", r); + panic("ipc_send failed: %d", r); ec->read_s = 0; ec->flags &= ~(ECF_PACK_SEND | ECF_PACK_RECV); @@ -693,7 +693,7 @@ static void mess_reply(req, reply_mess) message *req; message *reply_mess; { - if (send(req->m_source, reply_mess) != OK) + if (ipc_send(req->m_source, reply_mess) != OK) panic("unable to mess_reply"); } @@ -1316,7 +1316,7 @@ message *mp; panic("do_getstat_s: sys_safecopyto failed: %d", r); mp->m_type= DL_STAT_REPLY; - r= send(mp->m_source, mp); + r= ipc_send(mp->m_source, mp); if (r != OK) panic("do_getstat_s: send failed: %d", r); } diff --git a/drivers/orinoco/orinoco.c b/drivers/orinoco/orinoco.c index 87d960ce9..182b3776a 100644 --- a/drivers/orinoco/orinoco.c +++ b/drivers/orinoco/orinoco.c @@ -400,7 +400,7 @@ static void or_dump (message *m) m->m_type = TTY_FKEY_CONTROL; m->FKEY_REQUEST = FKEY_EVENTS; - if(OK!=(sendrec(TTY_PROC_NR,m)) ) + if(OK!=(ipc_sendrec(TTY_PROC_NR,m)) ) printf("Contacting the TTY failed\n"); if(bit_isset(m->FKEY_SFKEYS, 11)) { @@ -1131,7 +1131,7 @@ static void or_watchdog_f(minix_timer_t *tp) *****************************************************************************/ static void mess_reply (message * req, message * reply_mess) { - if (send (req->m_source, reply_mess) != 0) + if (ipc_send(req->m_source, reply_mess) != 0) panic("orinoco: unable to mess_reply"); } @@ -1346,7 +1346,7 @@ static void reply (t_or * orp) { reply.DL_FLAGS = flags; reply.DL_COUNT = orp->or_read_s; - r = send (orp->or_client, &reply); + r = ipc_send(orp->or_client, &reply); if (r < 0) panic("orinoco: send failed: %d", r); @@ -1786,7 +1786,7 @@ static void or_getstat_s (message * mp) { mp->m_type = DL_STAT_REPLY; - r = send(mp->m_source, mp); + r = ipc_send(mp->m_source, mp); if(r != OK) panic("orinoco: getstat_s failed: %d", r); } diff --git a/drivers/pci/main.c b/drivers/pci/main.c index 44fd49a59..392719bcf 100644 --- a/drivers/pci/main.c +++ b/drivers/pci/main.c @@ -115,7 +115,7 @@ message *mp; #endif mp->m_type= 0; - r= send(mp->m_source, mp); + r= ipc_send(mp->m_source, mp); if (r != 0) printf("PCI: do_init: unable to send to %d: %d\n", mp->m_source, r); @@ -141,7 +141,7 @@ static void do_first_dev(message *mp) mp->m1_i3= did; } mp->m_type= r; - r= send(mp->m_source, mp); + r= ipc_send(mp->m_source, mp); if (r != 0) { printf("PCI: do_first_dev: unable to send to %d: %d\n", @@ -166,7 +166,7 @@ static void do_next_dev(message *mp) mp->m1_i3= did; } mp->m_type= r; - r= send(mp->m_source, mp); + r= ipc_send(mp->m_source, mp); if (r != 0) { printf("PCI: do_next_dev: unable to send to %d: %d\n", @@ -188,7 +188,7 @@ message *mp; if (r == 1) mp->m1_i1= devind; mp->m_type= r; - r= send(mp->m_source, mp); + r= ipc_send(mp->m_source, mp); if (r != 0) { printf("PCI: do_find_dev: unable to send to %d: %d\n", @@ -214,7 +214,7 @@ message *mp; mp->m1_i1= vid; mp->m1_i2= did; mp->m_type= r; - r= send(mp->m_source, mp); + r= ipc_send(mp->m_source, mp); if (r != 0) { printf("PCI: do_ids: unable to send to %d: %d\n", @@ -251,7 +251,7 @@ message *mp; } mp->m_type= r; - r= send(mp->m_source, mp); + r= ipc_send(mp->m_source, mp); if (r != 0) { printf("PCI: do_dev_name: unable to send to %d: %d\n", @@ -287,7 +287,7 @@ message *mp; } mp->m_type= r; - r= send(mp->m_source, mp); + r= ipc_send(mp->m_source, mp); if (r != 0) { printf("PCI: do_slot_name: unable to send to %d: %d\n", @@ -388,7 +388,7 @@ static void do_reserve(message *mp) aclp= find_acl(mp->m_source); mp->m_type= pci_reserve_a(devind, mp->m_source, aclp); - r= send(mp->m_source, mp); + r= ipc_send(mp->m_source, mp); if (r != 0) { printf("do_reserve: unable to send to %d: %d\n", @@ -414,7 +414,7 @@ message *mp; } mp->m2_l1= v; mp->m_type= r; - r= send(mp->m_source, mp); + r= ipc_send(mp->m_source, mp); if (r != 0) { printf("do_attr_r8: unable to send to %d: %d\n", @@ -434,7 +434,7 @@ message *mp; v= pci_attr_r16(devind, port); mp->m2_l1= v; mp->m_type= OK; - r= send(mp->m_source, mp); + r= ipc_send(mp->m_source, mp); if (r != 0) { printf("do_attr_r16: unable to send to %d: %d\n", @@ -460,7 +460,7 @@ message *mp; } mp->m2_l1= v; mp->m_type= OK; - r= send(mp->m_source, mp); + r= ipc_send(mp->m_source, mp); if (r != 0) { printf("do_attr_r32: unable to send to %d: %d\n", @@ -480,7 +480,7 @@ message *mp; pci_attr_w8(devind, port, v); mp->m_type= OK; - r= send(mp->m_source, mp); + r= ipc_send(mp->m_source, mp); if (r != 0) { printf("do_attr_w8: unable to send to %d: %d\n", @@ -500,7 +500,7 @@ message *mp; pci_attr_w16(devind, port, v); mp->m_type= OK; - r= send(mp->m_source, mp); + r= ipc_send(mp->m_source, mp); if (r != 0) { printf("do_attr_w16: unable to send to %d: %d\n", @@ -520,7 +520,7 @@ message *mp; pci_attr_w32(devind, port, v); mp->m_type= OK; - r= send(mp->m_source, mp); + r= ipc_send(mp->m_source, mp); if (r != 0) { printf("do_attr_w32: unable to send to %d: %d\n", @@ -546,7 +546,7 @@ message *mp; mp->BUSC_PGB_IOFLAG= ioflag; } - r= send(mp->m_source, mp); + r= ipc_send(mp->m_source, mp); if (r != 0) { printf("do_get_bar: unable to send to %d: %d\n", @@ -563,7 +563,7 @@ message *mp; pci_rescan_bus(busnr); mp->m_type= OK; - r= send(mp->m_source, mp); + r= ipc_send(mp->m_source, mp); if (r != 0) { printf("do_rescan_bus: unable to send to %d: %d\n", @@ -580,7 +580,7 @@ int result; message m; m.m_type= result; - r= send(mp->m_source, &m); + r= ipc_send(mp->m_source, &m); if (r != 0) printf("reply: unable to send to %d: %d\n", mp->m_source, r); } diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c index 367d586a2..5f476d584 100644 --- a/drivers/pci/pci.c +++ b/drivers/pci/pci.c @@ -960,7 +960,7 @@ static int acpi_get_irq(unsigned bus, unsigned dev, unsigned pin) ((struct acpi_get_irq_req *)&m)->dev = dev; ((struct acpi_get_irq_req *)&m)->pin = pin; - if ((err = sendrec(acpi_ep, &m)) != OK) + if ((err = ipc_sendrec(acpi_ep, &m)) != OK) panic("PCI: error %d while receiveing from ACPI\n", err); return ((struct acpi_get_irq_resp *)&m)->irq; @@ -1831,7 +1831,7 @@ static void acpi_map_bridge(unsigned pbnr, unsigned dev, unsigned sbnr) ((struct acpi_map_bridge_req *)&m)->secondary_bus = sbnr; ((struct acpi_map_bridge_req *)&m)->device = dev; - if ((err = sendrec(acpi_ep, &m)) != OK) + if ((err = ipc_sendrec(acpi_ep, &m)) != OK) panic("PCI: error %d while receiveing from ACPI\n", err); if (((struct acpi_map_bridge_resp *)&m)->err != OK) diff --git a/drivers/readclock/readclock.c b/drivers/readclock/readclock.c index 5f70e4fff..fba2adba0 100644 --- a/drivers/readclock/readclock.c +++ b/drivers/readclock/readclock.c @@ -120,9 +120,9 @@ main(int argc, char **argv) log_debug(&log, "Sending Reply"); - r = sendnb(caller, &m); + r = ipc_sendnb(caller, &m); if (r != OK) { - log_warn(&log, "sendnb() failed\n"); + log_warn(&log, "ipc_sendnb() failed\n"); continue; } } diff --git a/drivers/rtl8139/rtl8139.c b/drivers/rtl8139/rtl8139.c index e04221165..f13966bc0 100644 --- a/drivers/rtl8139/rtl8139.c +++ b/drivers/rtl8139/rtl8139.c @@ -1536,9 +1536,9 @@ message *mp; panic("rl_getstat_s: sys_safecopyto failed: %d", r); mp->m_type= DL_STAT_REPLY; - r= send(mp->m_source, mp); + r= ipc_send(mp->m_source, mp); if (r != OK) - panic("rl_getstat_s: send failed: %d", r); + panic("rl_getstat_s: ipc_send failed: %d", r); } /*===========================================================================* @@ -1561,12 +1561,12 @@ re_t *rep; reply.DL_FLAGS = flags; reply.DL_COUNT = rep->re_read_s; - r= send(rep->re_client, &reply); + r= ipc_send(rep->re_client, &reply); if (r < 0) { printf("RTL8139 tried sending to %d, type %d\n", rep->re_client, reply.m_type); - panic("send failed: %d", r); + panic("ipc_send failed: %d", r); } rep->re_read_s = 0; @@ -1580,7 +1580,7 @@ static void mess_reply(req, reply_mess) message *req; message *reply_mess; { - if (send(req->m_source, reply_mess) != OK) + if (ipc_send(req->m_source, reply_mess) != OK) panic("unable to mess_reply"); } @@ -2262,10 +2262,10 @@ int pci_func; m.m2_l1= buf; m.m2_l2= size; - r= sendrec(dev_e, &m); + r= ipc_sendrec(dev_e, &m); if (r != OK) { - printf("rtl8139`tell_dev: sendrec to %d failed: %d\n", + printf("rtl8139`tell_dev: ipc_sendrec to %d failed: %d\n", dev_e, r); return; } diff --git a/drivers/rtl8169/rtl8169.c b/drivers/rtl8169/rtl8169.c index ecbd76afa..ed5e9588f 100644 --- a/drivers/rtl8169/rtl8169.c +++ b/drivers/rtl8169/rtl8169.c @@ -1535,9 +1535,9 @@ message *mp; panic("rl_getstat_s: sys_safecopyto failed: %d", r); mp->m_type = DL_STAT_REPLY; - r = send(mp->m_source, mp); + r = ipc_send(mp->m_source, mp); if (r != OK) - panic("rl_getstat_s: send failed: %d", r); + panic("rl_getstat_s: ipc_send failed: %d", r); } /*===========================================================================* @@ -1560,12 +1560,12 @@ re_t *rep; reply.DL_FLAGS = flags; reply.DL_COUNT = rep->re_read_s; - r = send(rep->re_client, &reply); + r = ipc_send(rep->re_client, &reply); if (r < 0) { printf("RTL8169 tried sending to %d, type %d\n", rep->re_client, reply.m_type); - panic("send failed: %d", r); + panic("ipc_send failed: %d", r); } rep->re_read_s = 0; @@ -1579,7 +1579,7 @@ static void mess_reply(req, reply_mess) message *req; message *reply_mess; { - if (send(req->m_source, reply_mess) != OK) + if (ipc_send(req->m_source, reply_mess) != OK) panic("unable to mess_reply"); } diff --git a/drivers/tps65950/tps65950.c b/drivers/tps65950/tps65950.c index b6167c067..12c066294 100644 --- a/drivers/tps65950/tps65950.c +++ b/drivers/tps65950/tps65950.c @@ -347,9 +347,9 @@ main(int argc, char *argv[]) log_debug(&log, "Sending Reply"); - r = sendnb(caller, &m); + r = ipc_sendnb(caller, &m); if (r != OK) { - log_warn(&log, "sendnb() failed\n"); + log_warn(&log, "ipc_sendnb() failed\n"); continue; } } diff --git a/drivers/tty/arch/i386/keyboard.c b/drivers/tty/arch/i386/keyboard.c index d24109eda..4f03efc84 100644 --- a/drivers/tty/arch/i386/keyboard.c +++ b/drivers/tty/arch/i386/keyboard.c @@ -521,7 +521,7 @@ message *m_ptr; /* pointer to the request message */ /* Almost done, return result to caller. */ m_ptr->m_type = result; - if ((s = sendnb(m_ptr->m_source, m_ptr)) != OK) + if ((s = ipc_sendnb(m_ptr->m_source, m_ptr)) != OK) printf("TTY: unable to reply to %d: %d", m_ptr->m_source, s); } @@ -565,7 +565,7 @@ int scode; /* scan code for a function key */ /* See if an observer is registered and send it a message. */ if (proc_nr != NONE) { - notify(proc_nr); + ipc_notify(proc_nr); } return(TRUE); } diff --git a/drivers/uds/uds.h b/drivers/uds/uds.h index 150d8b06f..db9a87940 100644 --- a/drivers/uds/uds.h +++ b/drivers/uds/uds.h @@ -172,7 +172,7 @@ struct uds_fd { /* select() */ - /* when a select is in progress, we notify() this endpoint + /* when a select is in progress, we notify this endpoint * of new data. */ endpoint_t sel_endpt; diff --git a/drivers/vbox/hgcm.c b/drivers/vbox/hgcm.c index 68d68a912..46599901c 100644 --- a/drivers/vbox/hgcm.c +++ b/drivers/vbox/hgcm.c @@ -83,7 +83,7 @@ static void send_reply(endpoint_t endpt, int ipc_status, int result, int code, m.VBOX_ID = id; if (IPC_STATUS_CALL(ipc_status) == SENDREC) - r = sendnb(endpt, &m); + r = ipc_sendnb(endpt, &m); else r = asynsend3(endpt, &m, AMF_NOREPLY); diff --git a/drivers/virtio_net/virtio_net.c b/drivers/virtio_net/virtio_net.c index 0fad9c6ef..10a8363d2 100644 --- a/drivers/virtio_net/virtio_net.c +++ b/drivers/virtio_net/virtio_net.c @@ -312,8 +312,8 @@ virtio_net_check_pending(void) /* Only reply if a pending request was handled */ if (reply.DL_FLAGS != DL_NOFLAGS) - if ((r = send(dst, &reply)) != OK) - panic("%s: send to %d failed (%d)", name, dst, r); + if ((r = ipc_send(dst, &reply)) != OK) + panic("%s: ipc_send to %d failed (%d)", name, dst, r); } static void @@ -486,8 +486,8 @@ virtio_net_write(message *m) tx_pending = 1; } - if ((r = send(m->m_source, &reply)) != OK) - panic("%s: send to %d failed (%d)", name, m->m_source, r); + if ((r = ipc_send(m->m_source, &reply)) != OK) + panic("%s: ipc_send to %d failed (%d)", name, m->m_source, r); } static void @@ -509,8 +509,8 @@ virtio_net_read(message *m) pending_rx_msg = *m; } - if ((r = send(m->m_source, &reply)) != OK) - panic("%s: send to %d failed (%d)", name, m->m_source, r); + if ((r = ipc_send(m->m_source, &reply)) != OK) + panic("%s: ipc_send to %d failed (%d)", name, m->m_source, r); } static void @@ -538,8 +538,8 @@ virtio_net_conf(message *m) reply.DL_STAT = OK; reply.DL_COUNT = 0; - if ((r = send(m->m_source, &reply)) != OK) - panic("%s: send to %d failed (%d)", name, m->m_source, r); + if ((r = ipc_send(m->m_source, &reply)) != OK) + panic("%s: ipc_send to %d failed (%d)", name, m->m_source, r); } static void @@ -560,8 +560,8 @@ virtio_net_getstat(message *m) if (r != OK) panic("%s: copy to %d failed (%d)", name, m->m_source, r); - if ((r = send(m->m_source, &reply)) != OK) - panic("%s: send to %d failed (%d)", name, m->m_source, r); + if ((r = ipc_send(m->m_source, &reply)) != OK) + panic("%s: ipc_send to %d failed (%d)", name, m->m_source, r); } static void diff --git a/include/arch/earm/include/ipcconst.h b/include/arch/earm/include/ipcconst.h index 83b9bfd5f..d181f5d4a 100644 --- a/include/arch/earm/include/ipcconst.h +++ b/include/arch/earm/include/ipcconst.h @@ -1,8 +1,8 @@ #ifndef _ARM_IPCCONST_H_ #define _ARM_IPCCONST_H_ -#define KERVEC 32 /* syscall trap to kernel */ -#define IPCVEC 33 /* ipc trap to kernel */ +#define KERVEC_INTR 32 /* syscall trap to kernel */ +#define IPCVEC_INTR 33 /* ipc trap to kernel */ #define IPC_STATUS_REG r1 diff --git a/include/arch/i386/include/ipcconst.h b/include/arch/i386/include/ipcconst.h index 56cc3046b..146d024ac 100644 --- a/include/arch/i386/include/ipcconst.h +++ b/include/arch/i386/include/ipcconst.h @@ -1,8 +1,11 @@ #ifndef _I386_IPCCONST_H_ #define _I386_IPCCONST_H_ -#define KERVEC 32 /* syscall trap to kernel */ -#define IPCVEC 33 /* ipc trap to kernel */ +#define KERVEC_INTR 32 /* syscall trap to kernel */ +#define IPCVEC_INTR 33 /* ipc trap to kernel */ + +#define KERVEC_UM 34 /* syscall trap to kernel, user-mapped code */ +#define IPCVEC_UM 35 /* ipc trap to kernel, user-mapped code */ #define IPC_STATUS_REG bx diff --git a/include/minix/ipc.h b/include/minix/ipc.h index c703ad925..b24095d76 100644 --- a/include/minix/ipc.h +++ b/include/minix/ipc.h @@ -192,24 +192,27 @@ typedef struct asynmsg #define AMF_NOTIFY_ERR 020 /* Send a notification when AMF_DONE is set and * delivery of the message failed */ -int _send_orig(endpoint_t dest, message *m_ptr); -int _receive_orig(endpoint_t src, message *m_ptr, int *status_ptr); -int _sendrec_orig(endpoint_t src_dest, message *m_ptr); -int _sendnb_orig(endpoint_t dest, message *m_ptr); -int _notify_orig(endpoint_t dest); -int _senda_orig(asynmsg_t *table, size_t count); -int _do_kernel_call_orig(message *m_ptr); +int _ipc_send_intr(endpoint_t dest, message *m_ptr); +int _ipc_receive_intr(endpoint_t src, message *m_ptr, int *status_ptr); +int _ipc_sendrec_intr(endpoint_t src_dest, message *m_ptr); +int _ipc_sendnb_intr(endpoint_t dest, message *m_ptr); +int _ipc_notify_intr(endpoint_t dest); +int _ipc_senda_intr(asynmsg_t *table, size_t count); -int _minix_kernel_info_struct(struct minix_kerninfo **); +int _do_kernel_call_intr(message *m_ptr); + +int get_minix_kerninfo(struct minix_kerninfo **); /* Hide names to avoid name space pollution. */ -#define notify _notify -#define sendrec _sendrec -#define receive _receive -#define receivenb _receivenb -#define send _send -#define sendnb _sendnb -#define senda _senda +#define ipc_notify _ipc_notify +#define ipc_sendrec _ipc_sendrec +#define ipc_receive _ipc_receive +#define ipc_receivenb _ipc_receivenb +#define ipc_send _ipc_send +#define ipc_sendnb _ipc_sendnb +#define ipc_senda _ipc_senda + +#define do_kernel_call _do_kernel_call struct minix_ipcvecs { int (*send)(endpoint_t dest, message *m_ptr); @@ -224,37 +227,37 @@ struct minix_ipcvecs { /* kernel-set IPC vectors retrieved by a constructor in libc/sys-minix/init.c */ extern struct minix_ipcvecs _minix_ipcvecs; -static inline int _send(endpoint_t dest, message *m_ptr) +static inline int _ipc_send(endpoint_t dest, message *m_ptr) { return _minix_ipcvecs.send(dest, m_ptr); } -static inline int _receive(endpoint_t src, message *m_ptr, int *st) +static inline int _ipc_receive(endpoint_t src, message *m_ptr, int *st) { return _minix_ipcvecs.receive(src, m_ptr, st); } -static inline int _sendrec(endpoint_t src_dest, message *m_ptr) +static inline int _ipc_sendrec(endpoint_t src_dest, message *m_ptr) { return _minix_ipcvecs.sendrec(src_dest, m_ptr); } -static inline int _sendnb(endpoint_t dest, message *m_ptr) +static inline int _ipc_sendnb(endpoint_t dest, message *m_ptr) { return _minix_ipcvecs.sendnb(dest, m_ptr); } -static inline int _notify(endpoint_t dest) +static inline int _ipc_notify(endpoint_t dest) { return _minix_ipcvecs.notify(dest); } -static inline int do_kernel_call(message *m_ptr) +static inline int _do_kernel_call(message *m_ptr) { return _minix_ipcvecs.do_kernel_call(m_ptr); } -static inline int _senda(asynmsg_t *table, size_t count) +static inline int _ipc_senda(asynmsg_t *table, size_t count) { return _minix_ipcvecs.senda(table, count); } diff --git a/kernel/arch/earm/mpx.S b/kernel/arch/earm/mpx.S index f1bfe9413..d10b4b6f8 100644 --- a/kernel/arch/earm/mpx.S +++ b/kernel/arch/earm/mpx.S @@ -177,9 +177,9 @@ ENTRY(svc_entry) /* save the pointer to the current process */ ldr fp, [sp] - cmp r3, #KERVEC + cmp r3, #KERVEC_INTR beq kernel_call_entry - cmp r3, #IPCVEC + cmp r3, #IPCVEC_INTR beq ipc_entry /* return -1 to the current process as an invalid SWI was called .*/ diff --git a/kernel/arch/i386/mpx.S b/kernel/arch/i386/mpx.S index 04d8b6ab5..4617bfdc2 100644 --- a/kernel/arch/i386/mpx.S +++ b/kernel/arch/i386/mpx.S @@ -29,6 +29,7 @@ #include "kernel/kernel.h" #include #include +#include #include #include #include diff --git a/kernel/proc.h b/kernel/proc.h index 2429c8a8f..f3115354e 100644 --- a/kernel/proc.h +++ b/kernel/proc.h @@ -178,7 +178,7 @@ struct proc { /* Macro to return: on which process is a certain process blocked? * return endpoint number (can be ANY) or NONE. It's important to * check RTS_SENDING first, and then RTS_RECEIVING, as they could - * both be on (if a sendrec() blocks on sending), and p_getfrom_e + * both be on (if a ipc_sendrec() blocks on sending), and p_getfrom_e * could be nonsense even though RTS_RECEIVING is on. */ #define P_BLOCKEDON(p) \ diff --git a/lib/libaudiodriver/audio_fw.c b/lib/libaudiodriver/audio_fw.c index d70a92d9b..523c1befc 100644 --- a/lib/libaudiodriver/audio_fw.c +++ b/lib/libaudiodriver/audio_fw.c @@ -859,10 +859,10 @@ int pci_func; m.m2_l1= buf; m.m2_l2= size; - r= sendrec(dev_e, &m); + r= ipc_sendrec(dev_e, &m); if (r != OK) { - printf("tell_dev: sendrec to %d failed: %d\n", dev_e, r); + printf("tell_dev: ipc_sendrec to %d failed: %d\n", dev_e, r); return; } if (m.m_type != OK) diff --git a/lib/libbdev/ipc.c b/lib/libbdev/ipc.c index 2c4ce2701..ed92ebf7a 100644 --- a/lib/libbdev/ipc.c +++ b/lib/libbdev/ipc.c @@ -158,7 +158,7 @@ int bdev_sendrec(dev_t dev, const message *m_orig) m = *m_orig; m.BDEV_ID = NO_ID; - r = sendrec(endpt, &m); + r = ipc_sendrec(endpt, &m); /* If communication failed, the driver has died. We assume it will be * restarted soon after, so we attempt recovery. Upon success, we let the diff --git a/lib/libbdev/minor.c b/lib/libbdev/minor.c index 205f16c89..fc5af9817 100644 --- a/lib/libbdev/minor.c +++ b/lib/libbdev/minor.c @@ -46,7 +46,7 @@ int bdev_minor_reopen(dev_t dev) m.BDEV_ACCESS = open_dev[i].access; m.BDEV_ID = NO_ID; - if ((r = sendrec(endpt, &m)) != OK) { + if ((r = ipc_sendrec(endpt, &m)) != OK) { printf("bdev: IPC to driver (%d) failed (%d)\n", endpt, r); return r; diff --git a/lib/libblockdriver/driver.c b/lib/libblockdriver/driver.c index b45ce39ba..6557f68c1 100644 --- a/lib/libblockdriver/driver.c +++ b/lib/libblockdriver/driver.c @@ -100,7 +100,7 @@ void blockdriver_announce(int type) char label[DS_MAX_KEYLEN]; char *driver_prefix = "drv.blk."; - /* Callers are allowed to use sendrec to communicate with drivers. + /* Callers are allowed to use ipc_sendrec to communicate with drivers. * For this reason, there may blocked callers when a driver restarts. * Ask the kernel to unblock them (if any). Note that most block drivers * will not restart statefully, and thus will skip this code. @@ -139,7 +139,7 @@ static void send_reply(endpoint_t endpt, message *m_ptr, int ipc_status) * the SENDREC's receive part, after which our next SENDNB call would fail. */ if (IPC_STATUS_CALL(ipc_status) == SENDREC) - r = sendnb(endpt, m_ptr); + r = ipc_sendnb(endpt, m_ptr); else r = asynsend3(endpt, m_ptr, AMF_NOREPLY); diff --git a/lib/libc/arch/arm/sys-minix/Makefile.inc b/lib/libc/arch/arm/sys-minix/Makefile.inc index 00d4e8e25..f638e49ea 100644 --- a/lib/libc/arch/arm/sys-minix/Makefile.inc +++ b/lib/libc/arch/arm/sys-minix/Makefile.inc @@ -11,9 +11,10 @@ ucontext.o: ucontextoffsets.h SRCS+= \ __sigreturn.S \ + _do_kernel_call_intr.S \ _ipc.S \ - _senda.S \ brksize.S \ + get_minix_kerninfo.S \ ucontext.S ucontextoffsets.h: ${CF} diff --git a/lib/libc/arch/arm/sys-minix/_do_kernel_call_intr.S b/lib/libc/arch/arm/sys-minix/_do_kernel_call_intr.S new file mode 100644 index 000000000..93b33fc7e --- /dev/null +++ b/lib/libc/arch/arm/sys-minix/_do_kernel_call_intr.S @@ -0,0 +1,8 @@ +#include +#include + +ENTRY(_do_kernel_call_intr) + /* r0 already holds msg ptr */ + mov r3, #KERVEC_INTR /* r3 determines the SVC type */ + svc #0 /* trap to kernel */ + bx lr diff --git a/lib/libc/arch/arm/sys-minix/_ipc.S b/lib/libc/arch/arm/sys-minix/_ipc.S index 74499d38c..26cee0131 100644 --- a/lib/libc/arch/arm/sys-minix/_ipc.S +++ b/lib/libc/arch/arm/sys-minix/_ipc.S @@ -4,80 +4,71 @@ /**========================================================================* */ /* IPC assembly routines * */ /**========================================================================* */ -ENTRY(_send_orig) +ENTRY(_ipc_send_intr) push {fp} mov fp, sp mov r2, r1 /* r2 = msg ptr */ mov r1, r0 /* r1 = src_dest */ - mov r0, #SEND /* _send(dest, ptr) */ - mov r3, #IPCVEC /* r3 determines the SVC type */ + mov r0, #SEND /* _ipc_send(dest, ptr) */ + mov r3, #IPCVEC_INTR /* r3 determines the SVC type */ svc #0 /* trap to kernel */ pop {fp} bx lr -ENTRY(_receive_orig) +ENTRY(_ipc_receive_intr) push {fp} mov fp, sp push {r2} /* save status ptr */ mov r2, r1 /* r2 = msg ptr */ mov r1, r0 /* r1 = src_dest */ - mov r0, #RECEIVE /* _receive(src, ptr) */ - mov r3, #IPCVEC /* r3 determines the SVC type */ + mov r0, #RECEIVE /* _ipc_receive(src, ptr) */ + mov r3, #IPCVEC_INTR /* r3 determines the SVC type */ svc #0 /* trap to kernel */ pop {r2} /* restore status ptr */ str r1, [r2] pop {fp} bx lr -ENTRY(_sendrec_orig) +ENTRY(_ipc_sendrec_intr) push {fp} mov fp, sp mov r2, r1 /* r2 = msg ptr */ mov r1, r0 /* r1 = src_dest */ - mov r0, #SENDREC /* _sendrec(srcdest, ptr) */ - mov r3, #IPCVEC /* r3 determines the SVC type */ + mov r0, #SENDREC /* _ipc_sendrec(srcdest, ptr) */ + mov r3, #IPCVEC_INTR /* r3 determines the SVC type */ svc #0 /* trap to kernel */ pop {fp} bx lr -ENTRY(_minix_kernel_info_struct) +ENTRY(_ipc_notify_intr) push {fp} mov fp, sp - push {r0} - mov r1, #0 - mov r2, #0 - mov r0, #MINIX_KERNINFO /* kerninfo() */ - mov r3, #IPCVEC /* r3 determines the SVC type */ + mov r1, r0 /* r1 = src_dest */ + mov r0, #NOTIFY /* _ipc_notify(srcdst) */ + mov r3, #IPCVEC_INTR /* r3 determines the SVC type */ svc #0 /* trap to kernel */ - pop {r2} /* r2 = return struct ptr (was r0) */ - str r1, [r2] pop {fp} bx lr -ENTRY(_notify_orig) +ENTRY(_ipc_sendnb_intr) push {fp} mov fp, sp + mov r2, r1 /* r2 = msg ptr */ mov r1, r0 /* r1 = src_dest */ - mov r0, #NOTIFY /* _notify(srcdst) */ - mov r3, #IPCVEC /* r3 determines the SVC type */ + mov r0, #SENDNB /* _ipc_sendnb(dest, ptr) */ + mov r3, #IPCVEC_INTR /* r3 determines the SVC type */ svc #0 /* trap to kernel */ pop {fp} bx lr -ENTRY(_sendnb_orig) +ENTRY(_ipc_senda_intr) push {fp} mov fp, sp - mov r2, r1 /* r2 = msg ptr */ - mov r1, r0 /* r1 = src_dest */ - mov r0, #SENDNB /* _sendnb(dest, ptr) */ - mov r3, #IPCVEC /* r3 determines the SVC type */ + mov r2, r0 /* r2 = table */ + /* r1 already holds count */ + mov r0, #SENDA /* _ipc_senda(table, count) */ + mov r3, #IPCVEC_INTR /* r3 determines the SVC type */ svc #0 /* trap to kernel */ pop {fp} bx lr - -ENTRY(_do_kernel_call_orig) - /* r0 already holds msg ptr */ - mov r3, #KERVEC /* r3 determines the SVC type */ - svc #0 /* trap to kernel */ - bx lr diff --git a/lib/libc/arch/arm/sys-minix/_senda.S b/lib/libc/arch/arm/sys-minix/_senda.S deleted file mode 100644 index 7301bacb4..000000000 --- a/lib/libc/arch/arm/sys-minix/_senda.S +++ /dev/null @@ -1,13 +0,0 @@ -#include -#include - -ENTRY(_senda_orig) - push {fp} - mov fp, sp - mov r2, r0 /* r2 = table */ - /* r1 already holds count */ - mov r0, #SENDA /* _senda(table, count) */ - mov r3, #IPCVEC /* r3 determines the SVC type */ - svc #0 /* trap to kernel */ - pop {fp} - bx lr diff --git a/lib/libc/arch/arm/sys-minix/get_minix_kerninfo.S b/lib/libc/arch/arm/sys-minix/get_minix_kerninfo.S new file mode 100644 index 000000000..b5179d19d --- /dev/null +++ b/lib/libc/arch/arm/sys-minix/get_minix_kerninfo.S @@ -0,0 +1,17 @@ +#include +#include + +ENTRY(get_minix_kerninfo) + push {fp} + mov fp, sp + push {r0} + mov r1, #0 + mov r2, #0 + mov r0, #MINIX_KERNINFO /* _get_minix_kerninfo() */ + mov r3, #IPCVEC_INTR /* r3 determines the SVC type */ + svc #0 /* trap to kernel */ + pop {r2} /* r2 = return struct ptr (was r0) */ + str r1, [r2] + pop {fp} + bx lr + diff --git a/lib/libc/arch/i386/sys-minix/Makefile.inc b/lib/libc/arch/i386/sys-minix/Makefile.inc index 00d4e8e25..f638e49ea 100644 --- a/lib/libc/arch/i386/sys-minix/Makefile.inc +++ b/lib/libc/arch/i386/sys-minix/Makefile.inc @@ -11,9 +11,10 @@ ucontext.o: ucontextoffsets.h SRCS+= \ __sigreturn.S \ + _do_kernel_call_intr.S \ _ipc.S \ - _senda.S \ brksize.S \ + get_minix_kerninfo.S \ ucontext.S ucontextoffsets.h: ${CF} diff --git a/lib/libc/arch/i386/sys-minix/_do_kernel_call_intr.S b/lib/libc/arch/i386/sys-minix/_do_kernel_call_intr.S new file mode 100644 index 000000000..69529c025 --- /dev/null +++ b/lib/libc/arch/i386/sys-minix/_do_kernel_call_intr.S @@ -0,0 +1,8 @@ +#include +#include + +ENTRY(_do_kernel_call_intr) + /* pass the message pointer to kernel in the %eax register */ + movl 4(%esp), %eax + int $KERVEC_INTR + ret diff --git a/lib/libc/arch/i386/sys-minix/_ipc.S b/lib/libc/arch/i386/sys-minix/_ipc.S index bcb70a20c..4d4c20efd 100644 --- a/lib/libc/arch/i386/sys-minix/_ipc.S +++ b/lib/libc/arch/i386/sys-minix/_ipc.S @@ -5,87 +5,84 @@ MESSAGE = 12 /* message pointer */ STATUS = 16 /* status pointer */ + /* For _ipc_senda() */ + MSGTAB = 8 /* message table */ + TABCOUNT = 12 /* number of entries in message table */ + /**========================================================================* */ /* IPC assembly routines * */ /**========================================================================* */ /* all message passing routines save ebx, but destroy eax and ecx. */ -ENTRY(_send_orig) +ENTRY(_ipc_send_intr) push %ebp movl %esp, %ebp push %ebx movl SRC_DST(%ebp), %eax /* eax = dest-src */ movl MESSAGE(%ebp), %ebx /* ebx = message pointer */ - movl $SEND, %ecx /* _send(dest, ptr) */ - int $IPCVEC_ORIG /* trap to the kernel */ + movl $SEND, %ecx /* _ipc_send(dest, ptr) */ + int $IPCVEC_INTR /* trap to the kernel */ pop %ebx pop %ebp ret -ENTRY(_receive_orig) +ENTRY(_ipc_receive_intr) push %ebp movl %esp, %ebp push %ebx movl SRC_DST(%ebp), %eax /* eax = dest-src */ movl MESSAGE(%ebp), %ebx /* ebx = message pointer */ - movl $RECEIVE, %ecx /* _receive(src, ptr) */ - int $IPCVEC_ORIG /* trap to the kernel */ + movl $RECEIVE, %ecx /* _ipc_receive(src, ptr) */ + int $IPCVEC_INTR /* trap to the kernel */ movl STATUS(%ebp), %ecx /* ecx = status pointer */ movl %ebx, (%ecx) pop %ebx pop %ebp ret -ENTRY(_sendrec_orig) +ENTRY(_ipc_sendrec_intr) push %ebp movl %esp, %ebp push %ebx movl SRC_DST(%ebp), %eax /* eax = dest-src */ movl MESSAGE(%ebp), %ebx /* ebx = message pointer */ - movl $SENDREC, %ecx /* _sendrec(srcdest, ptr) */ - int $IPCVEC_ORIG /* trap to the kernel */ + movl $SENDREC, %ecx /* _ipc_sendrec(srcdest, ptr) */ + int $IPCVEC_INTR /* trap to the kernel */ pop %ebx pop %ebp ret -ENTRY(_minix_kernel_info_struct) +ENTRY(_ipc_notify_intr) push %ebp movl %esp, %ebp push %ebx - movl $0, %eax - movl $0, %ebx - movl $MINIX_KERNINFO, %ecx - int $IPCVEC_ORIG /* trap to the kernel */ - movl 8(%ebp), %ecx /* ecx = return struct ptr */ - movl %ebx, (%ecx) + movl SRC_DST(%ebp), %eax /* eax = destination */ + movl $NOTIFY, %ecx /* _ipc_notify(srcdst) */ + int $IPCVEC_INTR /* trap to the kernel */ pop %ebx pop %ebp ret -ENTRY(_notify_orig) +ENTRY(_ipc_sendnb_intr) push %ebp movl %esp, %ebp push %ebx - movl SRC_DST(%ebp), %eax /* eax = destination */ - movl $NOTIFY, %ecx /* _notify(srcdst) */ - int $IPCVEC_ORIG /* trap to the kernel */ + movl SRC_DST(%ebp), %eax /* eax = dest-src */ + movl MESSAGE(%ebp), %ebx /* ebx = message pointer */ + movl $SENDNB, %ecx /* _ipc_sendnb(dest, ptr) */ + int $IPCVEC_INTR /* trap to the kernel */ pop %ebx pop %ebp ret -ENTRY(_sendnb_orig) +ENTRY(_ipc_senda_intr) push %ebp movl %esp, %ebp push %ebx - movl SRC_DST(%ebp), %eax /* eax = dest-src */ - movl MESSAGE(%ebp), %ebx /* ebx = message pointer */ - movl $SENDNB, %ecx /* _sendnb(dest, ptr) */ - int $IPCVEC_ORIG /* trap to the kernel */ + movl TABCOUNT(%ebp), %eax /* eax = count */ + movl MSGTAB(%ebp), %ebx /* ebx = table */ + movl $SENDA, %ecx /* _ipc_senda(table, count) */ + int $IPCVEC_INTR /* trap to the kernel */ pop %ebx pop %ebp ret -ENTRY(_do_kernel_call_orig) - /* pass the message pointer to kernel in the %eax register */ - movl 4(%esp), %eax - int $KERVEC_ORIG - ret diff --git a/lib/libc/arch/i386/sys-minix/_senda.S b/lib/libc/arch/i386/sys-minix/_senda.S deleted file mode 100644 index 256d85180..000000000 --- a/lib/libc/arch/i386/sys-minix/_senda.S +++ /dev/null @@ -1,17 +0,0 @@ -#include -#include - - MSGTAB = 8 /* message table */ - TABCOUNT = 12 /* number of entries in message table */ - -ENTRY(_senda_orig) - push %ebp - movl %esp, %ebp - push %ebx - movl TABCOUNT(%ebp), %eax /* eax = count */ - movl MSGTAB(%ebp), %ebx /* ebx = table */ - movl $SENDA, %ecx /* _senda(table, count) */ - int $IPCVEC /* trap to the kernel */ - pop %ebx - pop %ebp - ret diff --git a/lib/libc/arch/i386/sys-minix/get_minix_kerninfo.S b/lib/libc/arch/i386/sys-minix/get_minix_kerninfo.S new file mode 100644 index 000000000..7f62ee1d0 --- /dev/null +++ b/lib/libc/arch/i386/sys-minix/get_minix_kerninfo.S @@ -0,0 +1,17 @@ +#include +#include + +ENTRY(get_minix_kerninfo) + push %ebp + movl %esp, %ebp + push %ebx + movl $0, %eax + movl $0, %ebx + movl $MINIX_KERNINFO, %ecx + int $IPCVEC_INTR /* trap to the kernel */ + movl 8(%ebp), %ecx /* ecx = return struct ptr */ + movl %ebx, (%ecx) + pop %ebx + pop %ebp + ret + diff --git a/lib/libc/include/namespace.h b/lib/libc/include/namespace.h index 930a8acf2..74337eecd 100644 --- a/lib/libc/include/namespace.h +++ b/lib/libc/include/namespace.h @@ -545,13 +545,7 @@ #define seed48 _seed48 #define seekdir _seekdir #define select _select -#ifdef __minix -/* '_send' unfortunately collides with Minix IPC's _send function. - * This solution is fragile, a proper renaming of Minix IPCs should - * be done insted. */ -#else /* !__minix */ #define send _send -#endif /* !__minix */ #define setdomainname _setdomainname #define setenv _setenv #define setfsent _setfsent diff --git a/lib/libc/net/send.c b/lib/libc/net/send.c index 405970952..8cf95d8f2 100644 --- a/lib/libc/net/send.c +++ b/lib/libc/net/send.c @@ -44,15 +44,9 @@ __RCSID("$NetBSD: send.c,v 1.10 2012/03/20 17:44:18 matt Exp $"); #include -#ifdef __minix -/* UGLY: name clash with minix ipc. - * Better solution: redefine minix ipc. - */ -#else /* !__minix */ #ifdef __weak_alias __weak_alias(send, _send) #endif -#endif /* !__minix */ ssize_t send(int s, const void *msg, size_t len, int flags) diff --git a/lib/libc/sys-minix/init.c b/lib/libc/sys-minix/init.c index 544a60d53..2047479e8 100644 --- a/lib/libc/sys-minix/init.c +++ b/lib/libc/sys-minix/init.c @@ -8,23 +8,26 @@ struct minix_kerninfo *_minix_kerninfo = NULL; void __minix_init(void) __attribute__((__constructor__, __used__)); struct minix_ipcvecs _minix_ipcvecs = { - .sendrec = _sendrec_orig, - .send = _send_orig, - .notify = _notify_orig, - .senda = _senda_orig, - .sendnb = _sendnb_orig, - .receive = _receive_orig, - .do_kernel_call = _do_kernel_call_orig, + .sendrec = _ipc_sendrec_intr, + .send = _ipc_send_intr, + .notify = _ipc_notify_intr, + .senda = _ipc_senda_intr, + .sendnb = _ipc_sendnb_intr, + .receive = _ipc_receive_intr, + .do_kernel_call = _do_kernel_call_intr, }; void __minix_init(void) { - if((_minix_kernel_info_struct(&_minix_kerninfo)) != 0 - || _minix_kerninfo->kerninfo_magic != KERNINFO_MAGIC) { + if((get_minix_kerninfo(&_minix_kerninfo) != 0) || + (_minix_kerninfo->kerninfo_magic != KERNINFO_MAGIC)) + { _minix_kerninfo = NULL; - } else if((_minix_kerninfo->ki_flags & MINIX_KIF_IPCVECS) && - _minix_kerninfo->minix_ipcvecs) { + } + else if((_minix_kerninfo->ki_flags & MINIX_KIF_IPCVECS) && + (_minix_kerninfo->minix_ipcvecs != NULL)) + { _minix_ipcvecs = *_minix_kerninfo->minix_ipcvecs; - } + } } diff --git a/lib/libc/sys-minix/sigreturn.c b/lib/libc/sys-minix/sigreturn.c index 15c56f8d4..4b441407e 100644 --- a/lib/libc/sys-minix/sigreturn.c +++ b/lib/libc/sys-minix/sigreturn.c @@ -16,7 +16,7 @@ register struct sigcontext *scp; sigset_t set; /* The message can't be on the stack, because the stack will vanish out - * from under us. The send part of sendrec will succeed, but when + * from under us. The send part of ipc_sendrec will succeed, but when * a message is sent to restart the current process, who knows what will * be in the place formerly occupied by the message? */ diff --git a/lib/libc/sys-minix/syscall.c b/lib/libc/sys-minix/syscall.c index c1b53e31c..5df3f24d5 100644 --- a/lib/libc/sys-minix/syscall.c +++ b/lib/libc/sys-minix/syscall.c @@ -11,9 +11,9 @@ int _syscall(endpoint_t who, int syscallnr, message *msgptr) int status; msgptr->m_type = syscallnr; - status = sendrec(who, msgptr); + status = ipc_sendrec(who, msgptr); if (status != 0) { - /* 'sendrec' itself failed. */ + /* 'ipc_sendrec' itself failed. */ /* XXX - strerror doesn't know all the codes */ msgptr->m_type = status; } diff --git a/lib/libchardriver/chardriver.c b/lib/libchardriver/chardriver.c index 427d98e09..27ab03516 100644 --- a/lib/libchardriver/chardriver.c +++ b/lib/libchardriver/chardriver.c @@ -102,7 +102,7 @@ void chardriver_announce(void) char label[DS_MAX_KEYLEN]; char *driver_prefix = "drv.chr."; - /* Callers are allowed to use sendrec to communicate with drivers. + /* Callers are allowed to use ipc_sendrec to communicate with drivers. * For this reason, there may blocked callers when a driver restarts. * Ask the kernel to unblock them (if any). */ @@ -179,7 +179,7 @@ static void send_reply(endpoint_t endpt, message *m_ptr, int ipc_status) /* If we would block sending the message, send it asynchronously. */ if (IPC_STATUS_CALL(ipc_status) == SENDREC) - r = sendnb(endpt, m_ptr); + r = ipc_sendnb(endpt, m_ptr); else r = asynsend3(endpt, m_ptr, AMF_NOREPLY); diff --git a/lib/libddekit/src/usb_server.c b/lib/libddekit/src/usb_server.c index 88bfdaa77..a45b65bd4 100644 --- a/lib/libddekit/src/usb_server.c +++ b/lib/libddekit/src/usb_server.c @@ -198,11 +198,11 @@ static void register_driver(message *msg) if ( (drv = find_driver(ep)) != NULL) { msg->m_type = USB_REPLY; msg->USB_RESULT = OK; - send(ep,msg); + ipc_send(ep,msg); } else { msg->m_type = USB_REPLY; msg->USB_RESULT = EPERM; - send(ep,msg); + ipc_send(ep,msg); return; } @@ -216,7 +216,7 @@ static void register_driver(message *msg) msg->m_type = USB_ANNOUCE_DEV; msg->USB_DEV_ID = drv->dev; msg->USB_INTERFACES = drv->interfaces; - send(ep, msg); + ipc_send(ep, msg); } /***************************************************************************** @@ -397,7 +397,7 @@ out: } /* send reply */ - send(ep, msg); + ipc_send(ep, msg); } } @@ -437,7 +437,7 @@ static void cancle_urb(message *msg) } } - send(ep, msg); + ipc_send(ep, msg); } diff --git a/lib/libdevman/generic.c b/lib/libdevman/generic.c index ee79cfc3e..fbc099a71 100644 --- a/lib/libdevman/generic.c +++ b/lib/libdevman/generic.c @@ -116,7 +116,7 @@ int devman_add_device(struct devman_dev *dev) msg.DEVMAN_GRANT_SIZE = grant_size; /* send message */ - res = sendrec(devman_ep, &msg); + res = ipc_sendrec(devman_ep, &msg); if (res != 0) { panic("devman_add_device: could not talk to devman: %d", res); @@ -156,7 +156,7 @@ int devman_del_device(struct devman_dev *dev) msg.m_type = DEVMAN_DEL_DEV; msg.DEVMAN_DEVICE_ID = dev->dev_id; - res = sendrec(devman_ep, &msg); + res = ipc_sendrec(devman_ep, &msg); if (res != 0) { panic("devman_del_device: could not talk to devman: %d", res); @@ -221,14 +221,14 @@ static void do_bind(message *m) res = dev->bind_cb(dev->data, m->DEVMAN_ENDPOINT); m->m_type = DEVMAN_REPLY; m->DEVMAN_RESULT = res; - send(devman_ep, m); + ipc_send(devman_ep, m); return; } } } m->m_type = DEVMAN_REPLY; m->DEVMAN_RESULT = ENODEV; - send(devman_ep, m); + ipc_send(devman_ep, m); return; } @@ -247,14 +247,14 @@ static void do_unbind(message *m) res = dev->unbind_cb(dev->data, m->DEVMAN_ENDPOINT); m->m_type = DEVMAN_REPLY; m->DEVMAN_RESULT = res; - send(devman_ep, m); + ipc_send(devman_ep, m); return; } } } m->m_type = DEVMAN_REPLY; m->DEVMAN_RESULT = ENODEV; - send(devman_ep, m); + ipc_send(devman_ep, m); } /**************************************************************************** diff --git a/lib/libexec/exec_general.c b/lib/libexec/exec_general.c index 66bc57b6d..8b6367913 100644 --- a/lib/libexec/exec_general.c +++ b/lib/libexec/exec_general.c @@ -84,7 +84,7 @@ int libexec_pm_newexec(endpoint_t proc_e, struct exec_info *e) m.m_type = PM_EXEC_NEW; m.PM_EXEC_NEW_ENDPT = proc_e; m.PM_EXEC_NEW_PTR = (char *)e; - if ((r = sendrec(PM_PROC_NR, &m)) != OK) return(r); + if ((r = ipc_sendrec(PM_PROC_NR, &m)) != OK) return(r); e->allow_setuid = !!m.PM_EXEC_NEW_SUID; diff --git a/lib/libi2cdriver/i2cdriver.c b/lib/libi2cdriver/i2cdriver.c index 382c72ecf..57557896e 100644 --- a/lib/libi2cdriver/i2cdriver.c +++ b/lib/libi2cdriver/i2cdriver.c @@ -17,7 +17,7 @@ i2cdriver_announce(uint32_t bus) char label[DS_MAX_KEYLEN]; char *driver_prefix = "drv.i2c."; - /* Callers are allowed to use sendrec to communicate with drivers. + /* Callers are allowed to use ipc_sendrec to communicate with drivers. * For this reason, there may blocked callers when a driver restarts. * Ask the kernel to unblock them (if any). */ @@ -161,7 +161,7 @@ i2cdriver_reserve_device(endpoint_t bus_endpoint, i2c_addr_t address) m.m_type = BUSC_I2C_RESERVE; m.BUSC_I2C_ADDR = address; - r = sendrec(bus_endpoint, &m); + r = ipc_sendrec(bus_endpoint, &m); if (r != OK) { return EIO; } @@ -184,7 +184,7 @@ i2cdriver_exec(endpoint_t bus_endpoint, minix_i2c_ioctl_exec_t * ioctl_exec) m.m_type = BUSC_I2C_EXEC; m.BUSC_I2C_GRANT = grant_nr; - r = sendrec(bus_endpoint, &m); + r = ipc_sendrec(bus_endpoint, &m); cpf_revoke(grant_nr); if (r != OK) { return EIO; diff --git a/lib/libinputdriver/inputdriver.c b/lib/libinputdriver/inputdriver.c index 5a8b8033a..24e734c41 100644 --- a/lib/libinputdriver/inputdriver.c +++ b/lib/libinputdriver/inputdriver.c @@ -69,7 +69,7 @@ inputdriver_send_event(int mouse, unsigned short page, unsigned short code, * the input server has crashed, in which case we should stop sending * more messages to it. */ - if (send(input_endpt, &m) != OK) + if (ipc_send(input_endpt, &m) != OK) input_endpt = NONE; } diff --git a/lib/libminc/Makefile b/lib/libminc/Makefile index 99ba07153..0fa147ab5 100644 --- a/lib/libminc/Makefile +++ b/lib/libminc/Makefile @@ -149,7 +149,7 @@ CPPFLAGS.${i}+= -I${LIBCDIR}/locale mmap.c nanosleep.c open.c pread.c pwrite.c read.c reboot.c sbrk.c \ select.c setuid.c sigprocmask.c stack_utils.c stat.c stime.c \ syscall.c _ucontext.c umask.c unlink.c waitpid.c write.c \ - brksize.S _ipc.S _senda.S ucontext.S + brksize.S _do_kernel_call_intr.S get_minix_kerninfo.S _ipc.S ucontext.S .PATH.c: ${LIBCDIR}/sys-minix .PATH.S: ${ARCHDIR}/sys-minix SRCS+= ${i} diff --git a/lib/libpuffs/puffs.c b/lib/libpuffs/puffs.c index ff07483e5..2779d3956 100644 --- a/lib/libpuffs/puffs.c +++ b/lib/libpuffs/puffs.c @@ -767,7 +767,7 @@ static void reply( message *m_out /* report result */ ) { - if (OK != send(who, m_out)) /* send the message */ + if (OK != ipc_send(who, m_out)) /* send the message */ lpuffs_debug("libpuffs(%d) was unable to send reply\n", sef_self()); last_request_transid = 0; diff --git a/lib/libsffs/main.c b/lib/libsffs/main.c index 9ee468c74..fa3e24ad6 100644 --- a/lib/libsffs/main.c +++ b/lib/libsffs/main.c @@ -99,8 +99,8 @@ int transid; /* If a transaction ID was set, reset it */ m_out.m_type = TRNS_ADD_ID(m_out.m_type, transid); } - if ((r = send(m_in.m_source, &m_out)) != OK) - printf("%s: send failed (%d)\n", sffs_name, r); + if ((r = ipc_send(m_in.m_source, &m_out)) != OK) + printf("%s: ipc_send failed (%d)\n", sffs_name, r); } /*===========================================================================* diff --git a/lib/libsys/arch/i386/vbox.c b/lib/libsys/arch/i386/vbox.c index c0a26dda7..9fb25e049 100644 --- a/lib/libsys/arch/i386/vbox.c +++ b/lib/libsys/arch/i386/vbox.c @@ -47,7 +47,7 @@ vbox_conn_t vbox_open(char *name) m.VBOX_COUNT = len; m.VBOX_ID = 0; - r = sendrec(vbox_endpt, &m); + r = ipc_sendrec(vbox_endpt, &m); cpf_revoke(grant); @@ -75,7 +75,7 @@ int vbox_close(vbox_conn_t conn) m.VBOX_CONN = conn; m.VBOX_ID = 0; - r = sendrec(vbox_endpt, &m); + r = ipc_sendrec(vbox_endpt, &m); if (r != OK) return r; @@ -134,7 +134,7 @@ int vbox_call(vbox_conn_t conn, u32_t function, vbox_param_t *param, int count, m.VBOX_ID = 0; m.VBOX_FUNCTION = function; - r = sendrec(vbox_endpt, &m); + r = ipc_sendrec(vbox_endpt, &m); if (GRANT_VALID(grant)) cpf_revoke(grant); diff --git a/lib/libsys/asynsend.c b/lib/libsys/asynsend.c index c26bc1ecb..bded01be1 100644 --- a/lib/libsys/asynsend.c +++ b/lib/libsys/asynsend.c @@ -76,8 +76,8 @@ int fl; /* Can the table handle one more message? */ if (next_slot >= ASYN_NR) { /* We're full; tell the kernel to stop processing for now */ - if ((r = senda(NULL, 0)) != OK) - panic("asynsend: senda failed: %d", r); + if ((r = ipc_senda(NULL, 0)) != OK) + panic("asynsend: ipc_senda failed: %d", r); /* Move all unprocessed messages to the beginning */ dst_ind = 0; @@ -139,7 +139,7 @@ int fl; inside = 0; /* Tell the kernel to rescan the table */ - return senda(&msgtable[first_slot], len); + return ipc_senda(&msgtable[first_slot], len); } /*===========================================================================* diff --git a/lib/libsys/gcov.c b/lib/libsys/gcov.c index bb9b4a8d5..1e2d71b6d 100644 --- a/lib/libsys/gcov.c +++ b/lib/libsys/gcov.c @@ -155,6 +155,6 @@ int do_gcov_flush_impl(message *msg) assert(msg->m_source == VFS_PROC_NR); replymsg.m_type = gcov_flush(msg->GCOV_GRANT, msg->GCOV_BUFF_SZ); - return send(msg->m_source, &replymsg); + return ipc_send(msg->m_source, &replymsg); } diff --git a/lib/libsys/pci_attr_r16.c b/lib/libsys/pci_attr_r16.c index c475fba7c..3fe108596 100644 --- a/lib/libsys/pci_attr_r16.c +++ b/lib/libsys/pci_attr_r16.c @@ -20,7 +20,7 @@ int port; m.m2_i1= devind; m.m2_i2= port; - r= sendrec(pci_procnr, &m); + r= ipc_sendrec(pci_procnr, &m); if (r != 0) panic("pci_attr_r16: can't talk to PCI: %d", r); diff --git a/lib/libsys/pci_attr_r32.c b/lib/libsys/pci_attr_r32.c index 55b91a538..40e969735 100644 --- a/lib/libsys/pci_attr_r32.c +++ b/lib/libsys/pci_attr_r32.c @@ -20,7 +20,7 @@ int port; m.m2_i1= devind; m.m2_i2= port; - r= sendrec(pci_procnr, &m); + r= ipc_sendrec(pci_procnr, &m); if (r != 0) panic("pci_attr_r32: can't talk to PCI: %d", r); diff --git a/lib/libsys/pci_attr_r8.c b/lib/libsys/pci_attr_r8.c index cc890b658..2542614b5 100644 --- a/lib/libsys/pci_attr_r8.c +++ b/lib/libsys/pci_attr_r8.c @@ -20,7 +20,7 @@ int port; m.m2_i1= devind; m.m2_i2= port; - r= sendrec(pci_procnr, &m); + r= ipc_sendrec(pci_procnr, &m); if (r != 0) panic("pci_attr_r8: can't talk to PCI: %d", r); diff --git a/lib/libsys/pci_attr_w16.c b/lib/libsys/pci_attr_w16.c index 8296544be..50cee133d 100644 --- a/lib/libsys/pci_attr_w16.c +++ b/lib/libsys/pci_attr_w16.c @@ -19,7 +19,7 @@ void pci_attr_w16(int devind, int port, u16_t value) m.m2_i2= port; m.m2_l1= value; - r= sendrec(pci_procnr, &m); + r= ipc_sendrec(pci_procnr, &m); if (r != 0) panic("pci_attr_w16: can't talk to PCI: %d", r); diff --git a/lib/libsys/pci_attr_w32.c b/lib/libsys/pci_attr_w32.c index 240cca358..df8bfba94 100644 --- a/lib/libsys/pci_attr_w32.c +++ b/lib/libsys/pci_attr_w32.c @@ -19,7 +19,7 @@ void pci_attr_w32(int devind, int port, u32_t value) m.m2_i2= port; m.m2_l1= value; - r= sendrec(pci_procnr, &m); + r= ipc_sendrec(pci_procnr, &m); if (r != 0) panic("pci_attr_w32: can't talk to PCI: %d", r); diff --git a/lib/libsys/pci_attr_w8.c b/lib/libsys/pci_attr_w8.c index eb67e6bd8..c18edf52a 100644 --- a/lib/libsys/pci_attr_w8.c +++ b/lib/libsys/pci_attr_w8.c @@ -19,7 +19,7 @@ void pci_attr_w8(int devind, int port, u8_t value) m.m2_i2= port; m.m2_l1= value; - r= sendrec(pci_procnr, &m); + r= ipc_sendrec(pci_procnr, &m); if (r != 0) panic("pci_attr_w8: can't talk to PCI: %d", r); diff --git a/lib/libsys/pci_del_acl.c b/lib/libsys/pci_del_acl.c index caab03446..36c6dd2a6 100644 --- a/lib/libsys/pci_del_acl.c +++ b/lib/libsys/pci_del_acl.c @@ -33,7 +33,7 @@ endpoint_t proc_ep; m.m_type= BUSC_PCI_DEL_ACL; m.m1_i1= proc_ep; - r= sendrec(pci_procnr, &m); + r= ipc_sendrec(pci_procnr, &m); if (r != 0) panic("pci_del_acl: can't talk to PCI: %d", r); diff --git a/lib/libsys/pci_dev_name.c b/lib/libsys/pci_dev_name.c index ba9e9afd7..a2c5c7160 100644 --- a/lib/libsys/pci_dev_name.c +++ b/lib/libsys/pci_dev_name.c @@ -32,7 +32,7 @@ char *pci_dev_name(u16_t vid, u16_t did) m.m7_i3= sizeof(name); m.m7_i4= gid; - r= sendrec(pci_procnr, &m); + r= ipc_sendrec(pci_procnr, &m); cpf_revoke(gid); if (r != 0) panic("pci_dev_name: can't talk to PCI: %d", r); diff --git a/lib/libsys/pci_find_dev.c b/lib/libsys/pci_find_dev.c index 06388a292..5244c4ab5 100644 --- a/lib/libsys/pci_find_dev.c +++ b/lib/libsys/pci_find_dev.c @@ -19,7 +19,7 @@ int pci_find_dev(u8_t bus, u8_t dev, u8_t func, int *devindp) m.m1_i2= dev; m.m1_i3= func; - r= sendrec(pci_procnr, &m); + r= ipc_sendrec(pci_procnr, &m); if (r != 0) panic("pci_find_dev: can't talk to PCI: %d", r); diff --git a/lib/libsys/pci_first_dev.c b/lib/libsys/pci_first_dev.c index 8449cfccc..804ea6162 100644 --- a/lib/libsys/pci_first_dev.c +++ b/lib/libsys/pci_first_dev.c @@ -18,7 +18,7 @@ u16_t *didp; message m; m.m_type= BUSC_PCI_FIRST_DEV; - r= sendrec(pci_procnr, &m); + r= ipc_sendrec(pci_procnr, &m); if (r != 0) panic("pci_first_dev: can't talk to PCI: %d", r); if (m.m_type == 1) diff --git a/lib/libsys/pci_get_bar.c b/lib/libsys/pci_get_bar.c index d31553dae..a629f62f2 100644 --- a/lib/libsys/pci_get_bar.c +++ b/lib/libsys/pci_get_bar.c @@ -23,7 +23,7 @@ int *ioflag; m.BUSC_PGB_DEVIND= devind; m.BUSC_PGB_PORT= port; - r= sendrec(pci_procnr, &m); + r= ipc_sendrec(pci_procnr, &m); if (r != 0) panic("pci_get_bar: can't talk to PCI: %d", r); diff --git a/lib/libsys/pci_ids.c b/lib/libsys/pci_ids.c index 8e9b08454..a84f198ca 100644 --- a/lib/libsys/pci_ids.c +++ b/lib/libsys/pci_ids.c @@ -20,7 +20,7 @@ u16_t *didp; m.m_type= BUSC_PCI_IDS; m.m1_i1= devind; - r= sendrec(pci_procnr, &m); + r= ipc_sendrec(pci_procnr, &m); if (r != 0) panic("pci_ids: can't talk to PCI: %d", r); diff --git a/lib/libsys/pci_init.c b/lib/libsys/pci_init.c index d170a4b39..11e028bf1 100644 --- a/lib/libsys/pci_init.c +++ b/lib/libsys/pci_init.c @@ -21,7 +21,7 @@ void pci_init(void) panic("pci_init: unable to obtain label for 'pci': %d", r); m.m_type= BUSC_PCI_INIT; - r= sendrec(pci_procnr, &m); + r= ipc_sendrec(pci_procnr, &m); if (r != 0) panic("pci_init: can't talk to PCI: %d", r); if (m.m_type != 0) diff --git a/lib/libsys/pci_next_dev.c b/lib/libsys/pci_next_dev.c index 6fb74595a..1676c5f08 100644 --- a/lib/libsys/pci_next_dev.c +++ b/lib/libsys/pci_next_dev.c @@ -20,7 +20,7 @@ u16_t *didp; m.m_type= BUSC_PCI_NEXT_DEV; m.m1_i1= *devindp; - r= sendrec(pci_procnr, &m); + r= ipc_sendrec(pci_procnr, &m); if (r != 0) panic("pci_next_dev: can't talk to PCI: %d", r); diff --git a/lib/libsys/pci_rescan_bus.c b/lib/libsys/pci_rescan_bus.c index 933055cfe..abe1fb32d 100644 --- a/lib/libsys/pci_rescan_bus.c +++ b/lib/libsys/pci_rescan_bus.c @@ -17,7 +17,7 @@ void pci_rescan_bus(u8_t busnr) m.m_type= BUSC_PCI_RESCAN; m.m1_i1= busnr; - r= sendrec(pci_procnr, &m); + r= ipc_sendrec(pci_procnr, &m); if (r != 0) panic("pci_rescan_bus: can't talk to PCI: %d", r); diff --git a/lib/libsys/pci_reserve.c b/lib/libsys/pci_reserve.c index 4cdc2da10..92eecd2e4 100644 --- a/lib/libsys/pci_reserve.c +++ b/lib/libsys/pci_reserve.c @@ -18,7 +18,7 @@ int devind; m.m_type= BUSC_PCI_RESERVE; m.m1_i1= devind; - r= sendrec(pci_procnr, &m); + r= ipc_sendrec(pci_procnr, &m); if (r != 0) panic("pci_reserve: can't talk to PCI: %d", r); diff --git a/lib/libsys/pci_set_acl.c b/lib/libsys/pci_set_acl.c index 1f7a7492b..9d49474af 100644 --- a/lib/libsys/pci_set_acl.c +++ b/lib/libsys/pci_set_acl.c @@ -43,7 +43,7 @@ struct rs_pci *rs_pci; m.m_type= BUSC_PCI_SET_ACL; m.m1_i1= gid; - r= sendrec(pci_procnr, &m); + r= ipc_sendrec(pci_procnr, &m); cpf_revoke(gid); if (r != 0) panic("pci_set_acl: can't talk to PCI: %d", r); diff --git a/lib/libsys/pci_slot_name.c b/lib/libsys/pci_slot_name.c index 08ff6dc5e..f63025a39 100644 --- a/lib/libsys/pci_slot_name.c +++ b/lib/libsys/pci_slot_name.c @@ -32,7 +32,7 @@ int devind; m.m1_i2= sizeof(name); m.m1_i3= gid; - r= sendrec(pci_procnr, &m); + r= ipc_sendrec(pci_procnr, &m); cpf_revoke(gid); if (r != 0) panic("pci_slot_name: can't talk to PCI: %d", r); diff --git a/lib/libsys/sef.c b/lib/libsys/sef.c index fd009bd21..010d50aef 100644 --- a/lib/libsys/sef.c +++ b/lib/libsys/sef.c @@ -96,9 +96,9 @@ void sef_startup() * these messages and block till a proper initialization request arrives. */ do { - r = receive(RS_PROC_NR, &m, &status); + r = ipc_receive(RS_PROC_NR, &m, &status); if(r != OK) { - panic("unable to receive from RS: %d", r); + panic("unable to ipc_receive from RS: %d", r); } } while(!IS_SEF_INIT_REQUEST(&m)); @@ -137,7 +137,7 @@ int sef_receive_status(endpoint_t src, message *m_ptr, int *status_ptr) #endif /* Receive and return in case of error. */ - r = receive(src, m_ptr, &status); + r = ipc_receive(src, m_ptr, &status); if(status_ptr) *status_ptr = status; if(!sef_self_first_receive_done) sef_self_first_receive_done = TRUE; if(r != OK) { diff --git a/lib/libsys/sef_init.c b/lib/libsys/sef_init.c index ba67d05cd..db1de9031 100644 --- a/lib/libsys/sef_init.c +++ b/lib/libsys/sef_init.c @@ -210,7 +210,7 @@ int sef_cb_init_response_rs_reply(message *m_ptr) int r; /* Inform RS that we completed initialization with the given result. */ - r = sendrec(RS_PROC_NR, m_ptr); + r = ipc_sendrec(RS_PROC_NR, m_ptr); return r; } diff --git a/lib/libsys/sef_liveupdate.c b/lib/libsys/sef_liveupdate.c index 4219eeb70..10ed20a71 100644 --- a/lib/libsys/sef_liveupdate.c +++ b/lib/libsys/sef_liveupdate.c @@ -333,7 +333,7 @@ int sef_cb_lu_response_rs_reply(message *m_ptr) int r; /* Inform RS that we're ready with the given result. */ - r = sendrec(RS_PROC_NR, m_ptr); + r = ipc_sendrec(RS_PROC_NR, m_ptr); if ( r != OK) { return r; } diff --git a/lib/libsys/sef_ping.c b/lib/libsys/sef_ping.c index 057b95b72..2ef642c1e 100644 --- a/lib/libsys/sef_ping.c +++ b/lib/libsys/sef_ping.c @@ -58,6 +58,6 @@ void sef_cb_ping_reply_null(endpoint_t UNUSED(source)) *===========================================================================*/ void sef_cb_ping_reply_pong(endpoint_t source) { - notify(source); + ipc_notify(source); } diff --git a/lib/libsys/sysutil.h b/lib/libsys/sysutil.h index 306abfe4f..497f755f9 100644 --- a/lib/libsys/sysutil.h +++ b/lib/libsys/sysutil.h @@ -4,5 +4,5 @@ #include /* common to all libraries */ #include /* need task numbers + message types */ -#include /* need sendrec, _taskcall, etc */ +#include /* need ipc_sendrec, _taskcall, etc */ #include /* prototypes in this library */ diff --git a/lib/libsys/taskcall.c b/lib/libsys/taskcall.c index b547471b7..e95d4318b 100644 --- a/lib/libsys/taskcall.c +++ b/lib/libsys/taskcall.c @@ -14,7 +14,7 @@ register message *msgptr; int status; msgptr->m_type = syscallnr; - status = sendrec(who, msgptr); + status = ipc_sendrec(who, msgptr); if (status != 0) return(status); return(msgptr->m_type); } diff --git a/lib/libusb/usb.c b/lib/libusb/usb.c index be865f891..3a67914a2 100644 --- a/lib/libusb/usb.c +++ b/lib/libusb/usb.c @@ -48,7 +48,7 @@ int usb_send_urb(struct usb_urb* urb) msg.USB_GRANT_SIZE = urb->urb_size-sizeof(void*); /* send message */ - res = sendrec(hcd_ep, &msg); + res = ipc_sendrec(hcd_ep, &msg); if (res != 0) { panic("usb_send_urb: could not talk to hcd: %d", res); @@ -95,7 +95,7 @@ int usb_cancle_urb(struct usb_urb* urb) msg.USB_URB_ID = urb->urb_id; /* send message */ - res = sendrec(hcd_ep, &msg); + res = ipc_sendrec(hcd_ep, &msg); if (res != 0) { panic("usb_cancle_urb: could not talk to hcd: %d", res); @@ -134,7 +134,7 @@ int usb_init(char *name) strncpy(msg.USB_RB_INIT_NAME, name, M3_LONG_STRING); - res = sendrec(hcd_ep, &msg); + res = ipc_sendrec(hcd_ep, &msg); if (res != 0) { panic("usb_init: can't talk to USB: %d", res); diff --git a/lib/libvtreefs/vtreefs.c b/lib/libvtreefs/vtreefs.c index 4176dea44..1cc59ed9e 100644 --- a/lib/libvtreefs/vtreefs.c +++ b/lib/libvtreefs/vtreefs.c @@ -134,7 +134,7 @@ static void send_reply(int err, int transid) fs_m_out.m_type = TRNS_ADD_ID(fs_m_out.m_type, transid); } - if ((r = send(fs_m_in.m_source, &fs_m_out)) != OK) + if ((r = ipc_send(fs_m_in.m_source, &fs_m_out)) != OK) panic("unable to send reply: %d", r); } diff --git a/servers/devman/bind.c b/servers/devman/bind.c index 82c8eda49..298a356ee 100644 --- a/servers/devman/bind.c +++ b/servers/devman/bind.c @@ -29,7 +29,7 @@ int do_bind_device(message *m) dev->owner, m->DEVMAN_DEVICE_ID); #endif - res = sendrec(dev->owner, m); + res = ipc_sendrec(dev->owner, m); if (res != OK) { printf("[W] devman.do_bind_device(): could not send " "message to device owner (%d)\n", res); @@ -45,7 +45,7 @@ int do_bind_device(message *m) m->DEVMAN_RESULT = ENODEV; } m->m_type = DEVMAN_REPLY; - send(RS_PROC_NR, m); + ipc_send(RS_PROC_NR, m); } return 0; } @@ -77,7 +77,7 @@ int do_unbind_device(message *m) printf("devman: unbind call to %d for dev %d\n", dev->owner, m->DEVMAN_DEVICE_ID); #endif - res = sendrec(dev->owner, m); + res = ipc_sendrec(dev->owner, m); if (res != OK) { printf("[W] devman.do_unbind_device(): could not send " "message to device owner (%d)\n", res); @@ -99,7 +99,7 @@ int do_unbind_device(message *m) m->DEVMAN_RESULT = ENODEV; } m->m_type = DEVMAN_REPLY; - send(RS_PROC_NR, m); + ipc_send(RS_PROC_NR, m); } return 0; } diff --git a/servers/devman/device.c b/servers/devman/device.c index 37cb5c238..9075257e9 100644 --- a/servers/devman/device.c +++ b/servers/devman/device.c @@ -221,7 +221,7 @@ static void do_reply(message *msg, int res) { msg->m_type = DEVMAN_REPLY; msg->DEVMAN_RESULT = res; - send(msg->m_source, msg); + ipc_send(msg->m_source, msg); } /*===========================================================================* diff --git a/servers/ds/main.c b/servers/ds/main.c index 1d684dcf8..ed2892217 100644 --- a/servers/ds/main.c +++ b/servers/ds/main.c @@ -124,7 +124,7 @@ static void reply( message *m_ptr /* message buffer */ ) { - int s = send(who_e, m_ptr); /* send the message */ + int s = ipc_send(who_e, m_ptr); /* send the message */ if (OK != s) printf("DS: unable to send reply to %d: %d\n", who_e, s); } diff --git a/servers/ds/store.c b/servers/ds/store.c index 06887bcfe..93a9f6a63 100644 --- a/servers/ds/store.c +++ b/servers/ds/store.c @@ -205,7 +205,7 @@ static void update_subscribers(struct data_store *dsp, int set) } else { UNSET_BIT(ds_subs[i].old_subs, nr); } - notify(ep); + ipc_notify(ep); } } @@ -502,7 +502,7 @@ int do_subscribe(message *m_ptr) /* Notify in case of match. */ if(match_found) - notify(m_ptr->m_source); + ipc_notify(m_ptr->m_source); } return OK; diff --git a/servers/ext2/main.c b/servers/ext2/main.c index 0941c134f..76dc9e088 100644 --- a/servers/ext2/main.c +++ b/servers/ext2/main.c @@ -211,6 +211,6 @@ static void reply( message *m_out /* report result */ ) { - if (OK != send(who, m_out)) /* send the message */ + if (OK != ipc_send(who, m_out)) /* send the message */ printf("ext2(%d) was unable to send reply\n", sef_self()); } diff --git a/servers/input/input.c b/servers/input/input.c index a8389c8e4..b35cd4dbb 100644 --- a/servers/input/input.c +++ b/servers/input/input.c @@ -408,7 +408,7 @@ input_event(message *m) else { m->m_type = TTY_INPUT_EVENT; - if ((r = send(TTY_PROC_NR, m)) != OK) + if ((r = ipc_send(TTY_PROC_NR, m)) != OK) printf("INPUT: send to TTY failed (%d)\n", r); } } @@ -665,7 +665,7 @@ input_init(int UNUSED(type), sef_init_info_t *UNUSED(info)) m.m_type = TTY_INPUT_UP; - if ((r = send(TTY_PROC_NR, &m)) != OK) + if ((r = ipc_send(TTY_PROC_NR, &m)) != OK) printf("INPUT: send to TTY failed (%d)\n", r); return OK; diff --git a/servers/ipc/main.c b/servers/ipc/main.c index d9381701b..02d39d595 100644 --- a/servers/ipc/main.c +++ b/servers/ipc/main.c @@ -99,7 +99,7 @@ int main(int argc, char *argv[]) printf("IPC: error for %d: %d\n", call_type, result); - if ((r = sendnb(who_e, &m)) != OK) + if ((r = ipc_sendnb(who_e, &m)) != OK) printf("IPC send error %d.\n", r); } } else { diff --git a/servers/ipc/sem.c b/servers/ipc/sem.c index 32090ecde..558d35888 100644 --- a/servers/ipc/sem.c +++ b/servers/ipc/sem.c @@ -103,7 +103,7 @@ static void send_message_to_process(endpoint_t who, int ret, int ignore) message m; m.m_type = ret; - sendnb(who, &m); + ipc_sendnb(who, &m); } static void remove_semaphore(struct sem_struct *sem) @@ -576,7 +576,7 @@ out: if (r != OK || !no_reply) { m->m_type = r; - sendnb(who_e, m); + ipc_sendnb(who_e, m); } /* awaken process if possible */ diff --git a/servers/is/dmp.c b/servers/is/dmp.c index 64d79ca8d..819d4532b 100644 --- a/servers/is/dmp.c +++ b/servers/is/dmp.c @@ -79,8 +79,8 @@ message *m; /* notification message */ */ m->m_type = TTY_FKEY_CONTROL; m->FKEY_REQUEST = FKEY_EVENTS; - if (OK != (s=sendrec(TTY_PROC_NR, m))) - printf("IS: warning, sendrec to TTY failed: %d\n", s); + if (OK != (s=ipc_sendrec(TTY_PROC_NR, m))) + printf("IS: warning, ipc_sendrec to TTY failed: %d\n", s); /* Now check which keys were pressed: F1-F12, SF1-SF12. */ for(h=0; h < NHOOKS; h++) diff --git a/servers/is/main.c b/servers/is/main.c index 59e3c5e40..aae548e63 100644 --- a/servers/is/main.c +++ b/servers/is/main.c @@ -140,7 +140,7 @@ int result; /* report result to replyee */ { int send_status; m_out.m_type = result; /* build reply message */ - send_status = send(who, &m_out); /* send the message */ + send_status = ipc_send(who, &m_out); /* send the message */ if (OK != send_status) panic("unable to send reply!: %d", send_status); } diff --git a/servers/iso9660fs/main.c b/servers/iso9660fs/main.c index 234487d13..0836c6a69 100644 --- a/servers/iso9660fs/main.c +++ b/servers/iso9660fs/main.c @@ -142,6 +142,6 @@ void reply(who, m_out) int who; message *m_out; /* report result */ { - if (OK != send(who, m_out)) /* send the message */ + if (OK != ipc_send(who, m_out)) /* send the message */ printf("ISOFS(%d) was unable to send reply\n", sef_self()); } diff --git a/servers/mfs/main.c b/servers/mfs/main.c index 187bcca53..43c881dd0 100644 --- a/servers/mfs/main.c +++ b/servers/mfs/main.c @@ -175,7 +175,7 @@ static void reply( message *m_out /* report result */ ) { - if (OK != send(who, m_out)) /* send the message */ + if (OK != ipc_send(who, m_out)) /* send the message */ printf("MFS(%d) was unable to send reply\n", sef_self()); } diff --git a/servers/pfs/main.c b/servers/pfs/main.c index 860a1a049..09b96dc1a 100644 --- a/servers/pfs/main.c +++ b/servers/pfs/main.c @@ -167,6 +167,6 @@ message *m_out; /* report result */ { int r; - if (OK != (r = send(who, m_out))) /* send the message */ + if (OK != (r = ipc_send(who, m_out))) /* send the message */ printf("PFS: unable to send reply: %d\n", r); } diff --git a/servers/pm/main.c b/servers/pm/main.c index 25de057d9..4176557c2 100644 --- a/servers/pm/main.c +++ b/servers/pm/main.c @@ -220,7 +220,7 @@ static int sef_cb_init_fresh(int UNUSED(type), sef_init_info_t *UNUSED(info)) mess.VFS_PM_SLOT = ip->proc_nr; mess.VFS_PM_PID = rmp->mp_pid; mess.VFS_PM_ENDPT = rmp->mp_endpoint; - if (OK != (s=send(VFS_PROC_NR, &mess))) + if (OK != (s=ipc_send(VFS_PROC_NR, &mess))) panic("can't sync up with VFS: %d", s); } } @@ -229,7 +229,7 @@ static int sef_cb_init_fresh(int UNUSED(type), sef_init_info_t *UNUSED(info)) memset(&mess, 0, sizeof(mess)); mess.m_type = VFS_PM_INIT; mess.VFS_PM_ENDPT = NONE; - if (sendrec(VFS_PROC_NR, &mess) != OK || mess.m_type != OK) + if (ipc_sendrec(VFS_PROC_NR, &mess) != OK || mess.m_type != OK) panic("can't sync up with VFS"); #if defined(__i386__) @@ -266,7 +266,7 @@ int result; /* result of call (usually OK or error #) */ rmp = &mproc[proc_nr]; rmp->mp_reply.m_type = result; - if ((r = sendnb(rmp->mp_endpoint, &rmp->mp_reply)) != OK) + if ((r = ipc_sendnb(rmp->mp_endpoint, &rmp->mp_reply)) != OK) printf("PM can't reply to %d (%s): %d\n", rmp->mp_endpoint, rmp->mp_name, r); } diff --git a/servers/rs/exec.c b/servers/rs/exec.c index d154beaa9..b8215d270 100644 --- a/servers/rs/exec.c +++ b/servers/rs/exec.c @@ -134,7 +134,7 @@ static int exec_restart(int proc_e, int result, vir_bytes pc, vir_bytes ps_str) m.PM_EXEC_RESTART_PC = (void *)pc; m.PM_EXEC_RESTART_PS_STR = (void *)ps_str; - r = sendrec(PM_PROC_NR, &m); + r = ipc_sendrec(PM_PROC_NR, &m); if (r != OK) return r; diff --git a/servers/rs/manager.c b/servers/rs/manager.c index dc68d05dd..6caa2c2a5 100644 --- a/servers/rs/manager.c +++ b/servers/rs/manager.c @@ -642,7 +642,7 @@ struct rproc *rp; /* pointer to service slot */ /* If the service is a driver, map it. */ if (rpub->dev_nr > 0) { /* The purpose of non-blocking forks is to avoid involving VFS in the - * forking process, because VFS may be blocked on a sendrec() to a MFS + * forking process, because VFS may be blocked on a ipc_sendrec() to a MFS * that is waiting for a endpoint update for a dead driver. We have just * published that update, but VFS may still be blocked. As a result, VFS * may not yet have received PM's fork message. Hence, if we call @@ -682,7 +682,7 @@ struct rproc *rp; /* pointer to service slot */ m.m_type = DEVMAN_BIND; m.DEVMAN_ENDPOINT = rpub->endpoint; m.DEVMAN_DEVICE_ID = rpub->devman_id; - r = sendrec(ep, &m); + r = ipc_sendrec(ep, &m); if (r != OK || m.DEVMAN_RESULT != OK) { return kill_service(rp, "devman bind device failed", r); } @@ -739,7 +739,7 @@ struct rproc *rp; /* pointer to service slot */ m.m_type = DEVMAN_UNBIND; m.DEVMAN_ENDPOINT = rpub->endpoint; m.DEVMAN_DEVICE_ID = rpub->devman_id; - r = sendrec(ep, &m); + r = ipc_sendrec(ep, &m); if (r != OK || m.DEVMAN_RESULT != OK) { printf("RS: devman unbind device failed"); diff --git a/servers/rs/request.c b/servers/rs/request.c index ac49c8267..fd64a6e5b 100755 --- a/servers/rs/request.c +++ b/servers/rs/request.c @@ -808,7 +808,7 @@ message *m_ptr; * check and, if so request the system service's status. */ else if (now - rp->r_check_tm > rp->r_period) { - notify(rpub->endpoint); /* request status */ + ipc_notify(rpub->endpoint); /* request status */ rp->r_check_tm = now; /* mark time */ } } diff --git a/servers/rs/utility.c b/servers/rs/utility.c index fef7c5c46..6a40c7a1a 100644 --- a/servers/rs/utility.c +++ b/servers/rs/utility.c @@ -167,7 +167,7 @@ message *m_ptr; /* reply message */ if(rs_verbose && rp) printf("RS: %s being replied to\n", srv_to_string(rp)); - r = sendnb(who, m_ptr); /* send the message */ + r = ipc_sendnb(who, m_ptr); /* send the message */ if (r != OK) printf("RS: unable to send reply to %d: %d\n", who, r); } diff --git a/servers/sched/main.c b/servers/sched/main.c index 18f0dc246..dfa38046d 100644 --- a/servers/sched/main.c +++ b/servers/sched/main.c @@ -106,7 +106,7 @@ sendreply: *===========================================================================*/ static void reply(endpoint_t who_e, message *m_ptr) { - int s = send(who_e, m_ptr); /* send the message */ + int s = ipc_send(who_e, m_ptr); /* send the message */ if (OK != s) printf("SCHED: unable to send reply to %d: %d\n", who_e, s); } diff --git a/servers/vfs/main.c b/servers/vfs/main.c index 6bda04548..f266168c5 100644 --- a/servers/vfs/main.c +++ b/servers/vfs/main.c @@ -93,7 +93,7 @@ int main(void) service_pm(); continue; } else if (is_notify(call_nr)) { - /* A task notify()ed us */ + /* A task ipc_notify()ed us */ switch (who_e) { case DS_PROC_NR: /* Start a thread to handle DS events, if no thread @@ -117,7 +117,7 @@ int main(void) continue; } else if (who_p < 0) { /* i.e., message comes from a task */ /* We're going to ignore this message. Tasks should - * send notify()s only. + * send ipc_notify()s only. */ printf("VFS: ignoring message from %d (%d)\n", who_e, call_nr); continue; @@ -326,7 +326,7 @@ static int sef_cb_init_fresh(int UNUSED(type), sef_init_info_t *info) rfp->fp_umask = ~0; } while (TRUE); /* continue until process NONE */ mess.m_type = OK; /* tell PM that we succeeded */ - s = send(PM_PROC_NR, &mess); /* send synchronization message */ + s = ipc_send(PM_PROC_NR, &mess); /* send synchronization message */ system_hz = sys_hz(); @@ -495,8 +495,8 @@ static void get_work() else fp = &fproc[proc_p]; if (m_in.m_type == EDEADSRCDST) { - printf("VFS: failed sendrec\n"); - return; /* Failed 'sendrec' */ + printf("VFS: failed ipc_sendrec\n"); + return; /* Failed 'ipc_sendrec' */ } /* Negative who_p is never used to access the fproc array. Negative @@ -533,7 +533,7 @@ static void reply(message *m_out, endpoint_t whom, int result) int r; m_out->m_type = result; - r = sendnb(whom, m_out); + r = ipc_sendnb(whom, m_out); if (r != OK) { printf("VFS: %d couldn't send reply %d to %d: %d\n", mthread_self(), result, whom, r); @@ -637,9 +637,9 @@ void service_pm_postponed(void) panic("Unhandled postponed PM call %d", job_m_in.m_type); } - r = send(PM_PROC_NR, &m_out); + r = ipc_send(PM_PROC_NR, &m_out); if (r != OK) - panic("service_pm_postponed: send failed: %d", r); + panic("service_pm_postponed: ipc_send failed: %d", r); } /*===========================================================================* @@ -793,9 +793,9 @@ static void service_pm(void) return; } - r = send(PM_PROC_NR, &m_out); + r = ipc_send(PM_PROC_NR, &m_out); if (r != OK) - panic("service_pm: send failed: %d", r); + panic("service_pm: ipc_send failed: %d", r); } diff --git a/servers/vfs/misc.c b/servers/vfs/misc.c index c8cd0dc14..e02648519 100644 --- a/servers/vfs/misc.c +++ b/servers/vfs/misc.c @@ -443,8 +443,8 @@ reqdone: job_m_out.VMV_RESULT = result; job_m_out.VMV_REQID = req_id; - /* reply asynchronously as VM may not be able to receive - * a sendnb() message + /* Reply asynchronously as VM may not be able to receive + * an ipc_sendnb() message. */ job_m_out.m_type = VM_VFS_REPLY; r = asynsend3(VM_PROC_NR, &job_m_out, 0); @@ -523,8 +523,8 @@ void pm_reboot() m_out.m_type = VFS_PM_REBOOT_REPLY; - if ((r = send(PM_PROC_NR, &m_out)) != OK) - panic("pm_reboot: send failed: %d", r); + if ((r = ipc_send(PM_PROC_NR, &m_out)) != OK) + panic("pm_reboot: ipc_send failed: %d", r); } /*===========================================================================* diff --git a/servers/vm/main.c b/servers/vm/main.c index 0266a9c32..9a926e027 100644 --- a/servers/vm/main.c +++ b/servers/vm/main.c @@ -101,8 +101,8 @@ int main(void) panic("sef_receive_status() error: %d", r); if (is_ipc_notify(rcv_sts)) { - /* Unexpected notify(). */ - printf("VM: ignoring notify() from %d\n", msg.m_source); + /* Unexpected ipc_notify(). */ + printf("VM: ignoring ipc_notify() from %d\n", msg.m_source); continue; } who_e = msg.m_source; @@ -147,10 +147,10 @@ int main(void) */ if(result != SUSPEND) { msg.m_type = result; - if((r=send(who_e, &msg)) != OK) { + if((r=ipc_send(who_e, &msg)) != OK) { printf("VM: couldn't send %d to %d (err %d)\n", msg.m_type, who_e, r); - panic("send() error"); + panic("ipc_send() error"); } } } @@ -178,7 +178,7 @@ static int do_rs_init(message *m) /* RS expects this response that it then again wants to reply to: */ m->RS_INIT_RESULT = OK; - sendrec(RS_PROC_NR, m); + ipc_sendrec(RS_PROC_NR, m); return(SUSPEND); } diff --git a/servers/vm/mmap.c b/servers/vm/mmap.c index 2ba8021fe..fdffc0abb 100644 --- a/servers/vm/mmap.c +++ b/servers/vm/mmap.c @@ -199,8 +199,8 @@ static void mmap_file_cont(struct vmproc *vmp, message *replymsg, void *cbarg, mmap_reply.m_type = result; mmap_reply.VMM_ADDR = v; - if(send(vmp->vm_endpoint, &mmap_reply) != OK) - panic("VM: mmap_file_cont: send() failed"); + if(ipc_send(vmp->vm_endpoint, &mmap_reply) != OK) + panic("VM: mmap_file_cont: ipc_send() failed"); } /*===========================================================================* diff --git a/servers/vm/queryexit.c b/servers/vm/queryexit.c index e8f82c16a..67b1d8492 100644 --- a/servers/vm/queryexit.c +++ b/servers/vm/queryexit.c @@ -107,9 +107,9 @@ out: * and bypass the process to be signal is IPC itself. */ if (ipc_ep != 0 && ep != ipc_ep) { - r = notify(ipc_ep); + r = ipc_notify(ipc_ep); if (r != OK) - printf("VM: notify IPC error!\n"); + printf("VM: ipc_notify error!\n"); } return OK; } diff --git a/servers/vm/rs.c b/servers/vm/rs.c index c520d3708..493148f3d 100644 --- a/servers/vm/rs.c +++ b/servers/vm/rs.c @@ -111,9 +111,9 @@ int do_rs_update(message *m_ptr) if(reply_e == src_e) reply_e = dst_e; else if(reply_e == dst_e) reply_e = src_e; m_ptr->m_type = OK; - r = send(reply_e, m_ptr); + r = ipc_send(reply_e, m_ptr); if(r != OK) { - panic("send() error"); + panic("ipc_send() error"); } return SUSPEND; diff --git a/sys/arch/arm/include/asm.h b/sys/arch/arm/include/asm.h index dcec53c43..f5845cd24 100644 --- a/sys/arch/arm/include/asm.h +++ b/sys/arch/arm/include/asm.h @@ -92,8 +92,8 @@ #define _LABEL(x) \ .globl x; x: #define LABEL(y) _LABEL(_C_LABEL(y)) - #endif /* defined(__minix) */ + #define ASMSTR .asciz #if defined(PIC) diff --git a/sys/arch/i386/include/asm.h b/sys/arch/i386/include/asm.h index 805e20fa8..a08f4e4e3 100644 --- a/sys/arch/i386/include/asm.h +++ b/sys/arch/i386/include/asm.h @@ -218,13 +218,6 @@ #ifdef __minix #define IMPORT(sym) \ .extern _C_LABEL(sym) - -#define KERVEC_ORIG 32 /* syscall trap to kernel */ -#define IPCVEC_ORIG 33 /* ipc trap to kernel */ - -#define KERVEC_UM 34 /* syscall trap to kernel, user-mapped code */ -#define IPCVEC_UM 35 /* ipc trap to kernel, user-mapped code */ - #endif #endif /* !_I386_ASM_H_ */ diff --git a/test/blocktest/blocktest.c b/test/blocktest/blocktest.c index 7d7526cb3..70c49431d 100644 --- a/test/blocktest/blocktest.c +++ b/test/blocktest/blocktest.c @@ -172,7 +172,7 @@ static void got_result(result_t *res, char *desc) output("- driver died\n"); break; case RESULT_COMMFAIL: - output("- communication failed; sendrec returned %d\n", + output("- communication failed; ipc_sendrec returned %d\n", res->value); break; case RESULT_BADTYPE: @@ -229,7 +229,7 @@ static void reopen_device(dev_t minor) m.BDEV_ACCESS = (may_write) ? (BDEV_R_BIT | BDEV_W_BIT) : BDEV_R_BIT; m.BDEV_ID = 0; - (void) sendrec(driver_endpt, &m); + (void) ipc_sendrec(driver_endpt, &m); } static int sendrec_driver(message *m_ptr, ssize_t exp, result_t *res) @@ -245,7 +245,7 @@ static int sendrec_driver(message *m_ptr, ssize_t exp, result_t *res) m_orig = *m_ptr; - r = sendrec(driver_endpt, m_ptr); + r = ipc_sendrec(driver_endpt, m_ptr); if (r == EDEADSRCDST) { /* The driver has died. Find its new endpoint, and reopen all diff --git a/test/kernel/sys_vumap/vumaprelay.c b/test/kernel/sys_vumap/vumaprelay.c index 9702dc1ce..4880349f8 100644 --- a/test/kernel/sys_vumap/vumaprelay.c +++ b/test/kernel/sys_vumap/vumaprelay.c @@ -70,7 +70,7 @@ int main(int argc, char **argv) m.m_type = do_request(&m); - send(m.m_source, &m); + ipc_send(m.m_source, &m); } return 0; diff --git a/test/kernel/sys_vumap/vumaptest.c b/test/kernel/sys_vumap/vumaptest.c index 034aa3471..30d720352 100644 --- a/test/kernel/sys_vumap/vumaptest.c +++ b/test/kernel/sys_vumap/vumaptest.c @@ -253,7 +253,7 @@ static int relay_vumap(struct vumap_vir *vvec, int vcount, size_t offset, m.VTR_PGRANT = pgrant; m.VTR_PCOUNT = *pcount; - r = sendrec(endpt, &m); + r = ipc_sendrec(endpt, &m); cpf_revoke(pgrant); cpf_revoke(vgrant); -- 2.44.0