| 1 | /*- |
| 2 | * Copyright (c) 1990 The Regents of the University of California. |
| 3 | * All rights reserved. |
| 4 | * |
| 5 | * This code is derived from software contributed to Berkeley by |
| 6 | * William Jolitz. |
| 7 | * |
| 8 | * %sccs.include.redist.c% |
| 9 | */ |
| 10 | |
| 11 | #if defined(SYSLIBC_SCCS) && !defined(lint) |
| 12 | .asciz "@(#)sigprocmask.s 5.2 (Berkeley) %G%" |
| 13 | #endif /* SYSLIBC_SCCS and not lint */ |
| 14 | |
| 15 | #include "SYS.h" |
| 16 | |
| 17 | err: |
| 18 | jmp cerror |
| 19 | |
| 20 | ENTRY(sigprocmask) |
| 21 | movl 8(%esp),%ecx # fetch new sigset pointer |
| 22 | cmpl $0,%ecx # check new sigset pointer |
| 23 | jne 1f # if not null, indirect |
| 24 | /* movl $0,8(%esp) # null mask pointer: block empty set */ |
| 25 | movl $1,4(%esp) # SIG_BLOCK |
| 26 | jmp 2f |
| 27 | 1: movl (%ecx),%ecx # fetch indirect ... |
| 28 | movl %ecx,8(%esp) # to new mask arg |
| 29 | 2: movl $ SYS_sigprocmask , %eax |
| 30 | LCALL(0x7,0) |
| 31 | jb err |
| 32 | movl 12(%esp),%ecx # fetch old mask requested |
| 33 | cmpl $0,%ecx # test if old mask requested |
| 34 | je out |
| 35 | movl %eax,(%ecx) # store old mask |
| 36 | out: |
| 37 | xorl %eax,%eax |
| 38 | ret |