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:
@@ -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}
|
||||
|
||||
@@ -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
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
@@ -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
|
||||
|
||||
@@ -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}
|
||||
|
||||
@@ -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
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user