_ipc.s
来自「minix操作系统最新版本(3.1.1)的源代码」· S 代码 · 共 106 行
S
106 行
.sect .text; .sect .rom; .sect .data; .sect .bss.define __echo, __notify, __send, __nb_send, __receive, __nb_receive, __sendrec ! See src/kernel/ipc.h for C definitionsSEND = 1RECEIVE = 2SENDREC = 3 NOTIFY = 4ECHO = 8NB_SEND = 1 + 16 ! flags 0x10 to prevent blocking NB_RECEIVE = 2 + 16 ! flags 0x10 to prevent blocking SYSVEC = 33 ! trap to kernel SRC_DST = 8 ! source/ destination process ECHO_MESS = 8 ! doesn't have SRC_DST MESSAGE = 12 ! message pointer !*========================================================================*! IPC assembly routines *!*========================================================================*! all message passing routines save ebp, but destroy eax and ecx..define __echo, __notify, __send, __nb_send, __receive, __nb_receive, __sendrec .sect .text__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, SEND ! _send(dest, ptr) int SYSVEC ! trap to the kernel pop ebx pop ebp 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: push ebp mov ebp, esp push ebx mov eax, SRC_DST(ebp) ! eax = dest-src mov ebx, MESSAGE(ebp) ! ebx = message pointer mov ecx, RECEIVE ! _receive(src, ptr) int SYSVEC ! trap to the kernel pop ebx pop ebp 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: push ebp mov ebp, esp push ebx mov eax, SRC_DST(ebp) ! eax = dest-src mov ebx, MESSAGE(ebp) ! ebx = message pointer mov ecx, SENDREC ! _sendrec(srcdest, ptr) int SYSVEC ! trap to the kernel pop ebx pop ebp ret__notify: push ebp mov ebp, esp push ebx mov eax, SRC_DST(ebp) ! ebx = destination mov ecx, NOTIFY ! _notify(srcdst) int SYSVEC ! trap to the kernel pop ebx pop ebp ret__echo: push ebp mov ebp, esp push ebx mov ebx, ECHO_MESS(ebp) ! ebx = message pointer mov ecx, ECHO ! _echo(srcdest, ptr) int SYSVEC ! trap to the kernel pop ebx pop ebp ret
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?