Library progress
This commit is contained in:
parent
021e3234d8
commit
453beb04ad
@ -7,6 +7,7 @@ LIBRARIES=libc
|
|||||||
libc_FILES=" \
|
libc_FILES=" \
|
||||||
__sigreturn.s \
|
__sigreturn.s \
|
||||||
_ipc.s \
|
_ipc.s \
|
||||||
|
_ipcnew.s \
|
||||||
brksize.s"
|
brksize.s"
|
||||||
|
|
||||||
STARTFILES="\
|
STARTFILES="\
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
.sect .text; .sect .rom; .sect .data; .sect .bss
|
.sect .text; .sect .rom; .sect .data; .sect .bss
|
||||||
.define __echo, __notify, __send, __nb_send, __receive, __nb_receive, __sendrec
|
.define __echo, __notify, __send, __receive, __sendrec
|
||||||
|
|
||||||
! See src/kernel/ipc.h for C definitions
|
! See src/kernel/ipc.h for C definitions
|
||||||
SEND = 1
|
SEND = 1
|
||||||
@ -7,19 +7,17 @@ RECEIVE = 2
|
|||||||
SENDREC = 3
|
SENDREC = 3
|
||||||
NOTIFY = 4
|
NOTIFY = 4
|
||||||
ECHO = 8
|
ECHO = 8
|
||||||
NB_SEND = 1 + 16 ! flags 0x10 to prevent blocking
|
|
||||||
NB_RECEIVE = 2 + 16 ! flags 0x10 to prevent blocking
|
|
||||||
SYSVEC = 33 ! trap to kernel
|
SYSVEC = 33 ! trap to kernel
|
||||||
|
|
||||||
SRC_DST = 8 ! source/ destination process
|
SRC_DST = 8 ! source/ destination process
|
||||||
ECHO_MESS = 8 ! doesn't have SRC_DST
|
ECHO_MESS = 8 ! echo doesn't have SRC_DST
|
||||||
MESSAGE = 12 ! message pointer
|
MESSAGE = 12 ! message pointer
|
||||||
|
|
||||||
!*========================================================================*
|
!*========================================================================*
|
||||||
! IPC assembly routines *
|
! IPC assembly routines *
|
||||||
!*========================================================================*
|
!*========================================================================*
|
||||||
! all message passing routines save ebp, but destroy eax and ecx.
|
! all message passing routines save ebp, but destroy eax and ecx.
|
||||||
.define __echo, __notify, __send, __nb_send, __receive, __nb_receive, __sendrec
|
.define __echo, __notify, __send, __receive, __sendrec
|
||||||
.sect .text
|
.sect .text
|
||||||
__send:
|
__send:
|
||||||
push ebp
|
push ebp
|
||||||
@ -33,18 +31,6 @@ __send:
|
|||||||
pop ebp
|
pop ebp
|
||||||
ret
|
ret
|
||||||
|
|
||||||
__nb_send:
|
|
||||||
push ebp
|
|
||||||
mov ebp, esp
|
|
||||||
push ebx
|
|
||||||
mov eax, SRC_DST(ebp) ! eax = dest-src
|
|
||||||
mov ebx, MESSAGE(ebp) ! ebx = message pointer
|
|
||||||
mov ecx, NB_SEND ! _nb_send(dest, ptr)
|
|
||||||
int SYSVEC ! trap to the kernel
|
|
||||||
pop ebx
|
|
||||||
pop ebp
|
|
||||||
ret
|
|
||||||
|
|
||||||
__receive:
|
__receive:
|
||||||
push ebp
|
push ebp
|
||||||
mov ebp, esp
|
mov ebp, esp
|
||||||
@ -57,18 +43,6 @@ __receive:
|
|||||||
pop ebp
|
pop ebp
|
||||||
ret
|
ret
|
||||||
|
|
||||||
__nb_receive:
|
|
||||||
push ebp
|
|
||||||
mov ebp, esp
|
|
||||||
push ebx
|
|
||||||
mov eax, SRC_DST(ebp) ! eax = dest-src
|
|
||||||
mov ebx, MESSAGE(ebp) ! ebx = message pointer
|
|
||||||
mov ecx, NB_RECEIVE ! _nb_receive(src, ptr)
|
|
||||||
int SYSVEC ! trap to the kernel
|
|
||||||
pop ebx
|
|
||||||
pop ebp
|
|
||||||
ret
|
|
||||||
|
|
||||||
__sendrec:
|
__sendrec:
|
||||||
push ebp
|
push ebp
|
||||||
mov ebp, esp
|
mov ebp, esp
|
||||||
|
75
lib/i386/rts/_ipcnew.s
Executable file
75
lib/i386/rts/_ipcnew.s
Executable file
@ -0,0 +1,75 @@
|
|||||||
|
.sect .text; .sect .rom; .sect .data; .sect .bss
|
||||||
|
.define __ipc_request, __ipc_reply, __ipc_notify, __ipc_receive
|
||||||
|
|
||||||
|
! See src/kernel/ipc.h for C definitions.
|
||||||
|
IPC_REQUEST = 16 ! each gets a distinct bit
|
||||||
|
IPC_REPLY = 32
|
||||||
|
IPC_NOTIFY = 64
|
||||||
|
IPC_RECEIVE = 128
|
||||||
|
|
||||||
|
SYSVEC = 33 ! trap to kernel
|
||||||
|
|
||||||
|
! Offsets of arguments relative to stack pointer.
|
||||||
|
SRC_DST = 8 ! source/ destination process
|
||||||
|
SEND_MSG = 12 ! message pointer for sending
|
||||||
|
EVENT_SET = 12 ! notification event set
|
||||||
|
RECV_MSG = 16 ! message pointer for receiving
|
||||||
|
|
||||||
|
|
||||||
|
!*========================================================================*
|
||||||
|
! IPC assembly routines *
|
||||||
|
!*========================================================================*
|
||||||
|
! all message passing routines save ebp, but destroy eax, ecx, and edx.
|
||||||
|
.define __ipc_request, __ipc_reply, __ipc_notify, __ipc_receive
|
||||||
|
.sect .text
|
||||||
|
|
||||||
|
__ipc_request:
|
||||||
|
push ebp
|
||||||
|
mov ebp, esp
|
||||||
|
push ebx
|
||||||
|
mov eax, SRC_DST(ebp) ! eax = destination
|
||||||
|
mov ebx, SEND_MSG(ebp) ! ebx = message pointer
|
||||||
|
mov ecx, IPC_REQUEST ! _ipc_request(dst, ptr)
|
||||||
|
int SYSVEC ! trap to the kernel
|
||||||
|
pop ebx
|
||||||
|
pop ebp
|
||||||
|
ret
|
||||||
|
|
||||||
|
__ipc_reply:
|
||||||
|
push ebp
|
||||||
|
mov ebp, esp
|
||||||
|
push ebx
|
||||||
|
mov eax, SRC_DST(ebp) ! eax = destination
|
||||||
|
mov ebx, SEND_MSG(ebp) ! ebx = message pointer
|
||||||
|
mov ecx, IPC_REPLY ! _ipc_reply(dst, ptr)
|
||||||
|
int SYSVEC ! trap to the kernel
|
||||||
|
pop ebx
|
||||||
|
pop ebp
|
||||||
|
ret
|
||||||
|
|
||||||
|
__ipc_receive:
|
||||||
|
push ebp
|
||||||
|
mov ebp, esp
|
||||||
|
push ebx
|
||||||
|
mov eax, SRC_DST(ebp) ! eax = source
|
||||||
|
mov edx, EVENT_SET(ebp) ! ebx = event set
|
||||||
|
mov ebx, RCV_MSG(ebp) ! ebx = message pointer
|
||||||
|
mov ecx, IPC_RECEIVE ! _ipc_receive(src, events, ptr)
|
||||||
|
int SYSVEC ! trap to the kernel
|
||||||
|
pop ebx
|
||||||
|
pop ebp
|
||||||
|
ret
|
||||||
|
|
||||||
|
__ipc_notify:
|
||||||
|
push ebp
|
||||||
|
mov ebp, esp
|
||||||
|
push ebx
|
||||||
|
mov eax, SRC_DST(ebp) ! ebx = destination
|
||||||
|
mov edx, EVENT_SET(ebp) ! edx = event set
|
||||||
|
mov ecx, IPC_NOTIFY ! _ipc_notify(dst, events)
|
||||||
|
int SYSVEC ! trap to the kernel
|
||||||
|
pop ebx
|
||||||
|
pop ebp
|
||||||
|
ret
|
||||||
|
|
||||||
|
|
@ -11,6 +11,7 @@ libc_FILES=" \
|
|||||||
_findproc.c \
|
_findproc.c \
|
||||||
_freemem.c \
|
_freemem.c \
|
||||||
_getnpid.c \
|
_getnpid.c \
|
||||||
|
_getsigset.c \
|
||||||
_getnprocnr.c \
|
_getnprocnr.c \
|
||||||
_getpprocnr.c \
|
_getpprocnr.c \
|
||||||
_getprocnr.c \
|
_getprocnr.c \
|
||||||
|
15
lib/other/_getsigset.c
Normal file
15
lib/other/_getsigset.c
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
#include <lib.h>
|
||||||
|
#define getsigset _getsigset
|
||||||
|
#include <unistd.h>
|
||||||
|
|
||||||
|
|
||||||
|
PUBLIC int getsigset(sp)
|
||||||
|
sigset_t *sp; /* where to put it */
|
||||||
|
{
|
||||||
|
message m;
|
||||||
|
m.m2_i1 = SELF; /* request own signal set */
|
||||||
|
if (_syscall(PM_PROC_NR, PROCSTAT, &m) < 0) return(-1);
|
||||||
|
*sp = m.m2_l1;
|
||||||
|
return(0);
|
||||||
|
}
|
||||||
|
|
@ -47,6 +47,7 @@ libc_FILES=" \
|
|||||||
getppid.s \
|
getppid.s \
|
||||||
getpprocnr.s \
|
getpprocnr.s \
|
||||||
getprocnr.s \
|
getprocnr.s \
|
||||||
|
getsigset.s \
|
||||||
getsysinfo.s \
|
getsysinfo.s \
|
||||||
getuid.s \
|
getuid.s \
|
||||||
ioctl.s \
|
ioctl.s \
|
||||||
|
Loading…
x
Reference in New Issue
Block a user