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
This commit is contained in:
2013-11-01 13:34:14 +01:00
parent a5f47c23d5
commit c3fc9df84a
118 changed files with 414 additions and 413 deletions

View File

@@ -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)

View File

@@ -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

View File

@@ -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;

View File

@@ -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);

View File

@@ -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}

View File

@@ -0,0 +1,8 @@
#include <minix/ipcconst.h>
#include <machine/asm.h>
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

View File

@@ -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)
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 */
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_notify_intr)
push {fp}
mov fp, sp
mov r1, r0 /* r1 = src_dest */
mov r0, #NOTIFY /* _notify(srcdst) */
mov r3, #IPCVEC /* r3 determines the SVC type */
mov r0, #NOTIFY /* _ipc_notify(srcdst) */
mov r3, #IPCVEC_INTR /* r3 determines the SVC type */
svc #0 /* trap to kernel */
pop {fp}
bx lr
ENTRY(_sendnb_orig)
ENTRY(_ipc_sendnb_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 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(_do_kernel_call_orig)
/* r0 already holds msg ptr */
mov r3, #KERVEC /* r3 determines the SVC type */
svc #0 /* trap to kernel */
ENTRY(_ipc_senda_intr)
push {fp}
mov fp, sp
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

View File

@@ -1,13 +0,0 @@
#include <minix/ipcconst.h>
#include <machine/asm.h>
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

View File

@@ -0,0 +1,17 @@
#include <minix/ipcconst.h>
#include <machine/asm.h>
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

View File

@@ -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}

View File

@@ -0,0 +1,8 @@
#include <minix/ipcconst.h>
#include <machine/asm.h>
ENTRY(_do_kernel_call_intr)
/* pass the message pointer to kernel in the %eax register */
movl 4(%esp), %eax
int $KERVEC_INTR
ret

View File

@@ -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)
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)
pop %ebx
pop %ebp
ret
ENTRY(_notify_orig)
ENTRY(_ipc_notify_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 $NOTIFY, %ecx /* _ipc_notify(srcdst) */
int $IPCVEC_INTR /* trap to the kernel */
pop %ebx
pop %ebp
ret
ENTRY(_sendnb_orig)
ENTRY(_ipc_sendnb_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 $SENDNB, %ecx /* _ipc_sendnb(dest, ptr) */
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
ENTRY(_ipc_senda_intr)
push %ebp
movl %esp, %ebp
push %ebx
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

View File

@@ -1,17 +0,0 @@
#include <minix/ipcconst.h>
#include <machine/asm.h>
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

View File

@@ -0,0 +1,17 @@
#include <minix/ipcconst.h>
#include <machine/asm.h>
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

View File

@@ -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

View File

@@ -44,15 +44,9 @@ __RCSID("$NetBSD: send.c,v 1.10 2012/03/20 17:44:18 matt Exp $");
#include <stddef.h>
#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)

View File

@@ -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;
}
}
}

View File

@@ -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?
*/

View File

@@ -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;
}

View File

@@ -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);

View File

@@ -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);
}

View File

@@ -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);
}
/****************************************************************************

View File

@@ -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;

View File

@@ -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;

View File

@@ -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;
}

View File

@@ -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}

View File

@@ -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;

View File

@@ -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);
}
/*===========================================================================*

View File

@@ -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);

View File

@@ -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);
}
/*===========================================================================*

View File

@@ -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);
}

View File

@@ -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);

View File

@@ -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);

View File

@@ -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);

View File

@@ -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);

View File

@@ -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);

View File

@@ -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);

View File

@@ -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);

View File

@@ -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);

View File

@@ -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);

View File

@@ -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)

View File

@@ -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);

View File

@@ -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);

View File

@@ -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)

View File

@@ -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);

View File

@@ -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);

View File

@@ -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);

View File

@@ -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);

View File

@@ -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);

View File

@@ -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) {

View File

@@ -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;
}

View File

@@ -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;
}

View File

@@ -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);
}

View File

@@ -4,5 +4,5 @@
#include <lib.h> /* common to all libraries */
#include <minix/com.h> /* need task numbers + message types */
#include <minix/syslib.h> /* need sendrec, _taskcall, etc */
#include <minix/syslib.h> /* need ipc_sendrec, _taskcall, etc */
#include <minix/sysutil.h> /* prototypes in this library */

View File

@@ -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);
}

View File

@@ -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);

View File

@@ -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);
}