ctxsw.s,v
来自「TCP-IP红宝书源代码」· S,V 代码 · 共 73 行
S,V
73 行
head 1.2;
access;
symbols;
locks
dls:1.2; strict;
comment @# @;
1.2
date 97.09.21.19.29.30; author dls; state Dist;
branches;
next 1.1;
1.1
date 94.05.06.03.12.23; author dls; state Works;
branches;
next ;
desc
@@
1.2
log
@pre-3e code
@
text
@/* ctxsw.s - ctxsw */
.text
.globl _ctxsw
newmask: .word 0
/*------------------------------------------------------------------------
* ctxsw - call is ctxsw(&oldsp, &oldmask, &newsp, &newmask)
*------------------------------------------------------------------------
*/
_ctxsw:
pushl %ebp
movl %esp,%ebp
pushl 12(%ebp)
call _disable
movl 20(%ebp),%eax
movw (%eax),%dx
movw %dx,newmask
pushfl /* save flags */
pushal /* save general regs */
/* save segment registers here, if multiple allowed */
movl 8(%ebp),%eax
movl %esp,(%eax) /* save old SP */
movl 16(%ebp),%eax
movl (%eax),%esp /* restore new SP */
/* restore new segment registers here, if multiple allowed */
popal /* restore general registers */
popfl /* restore flags */
pushl $newmask
call _restore
leave
ret
@
1.1
log
@Initial revision
@
text
@@
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?