Add some explanatory comments.

This commit is contained in:
bjh21 2001-01-09 19:30:38 +00:00
parent 7be4ef2ff0
commit f5fadef6d9
3 changed files with 25 additions and 9 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: Ovfork.S,v 1.1 2000/12/29 20:14:00 bjh21 Exp $ */ /* $NetBSD: Ovfork.S,v 1.2 2001/01/09 19:30:38 bjh21 Exp $ */
/*- /*-
* Copyright (c) 1990 The Regents of the University of California. * Copyright (c) 1990 The Regents of the University of California.
@ -42,6 +42,10 @@ WARN_REFERENCES(vfork, \
/* /*
* pid = vfork(); * pid = vfork();
*
* On return from the SWI:
* r1 == 0 in parent process, r1 == 1 in child process.
* r0 == pid of child in parent, r0 == pid of parent in child.
*/ */
.text .text
.align 0 .align 0
@ -50,8 +54,8 @@ ENTRY(vfork)
mov r2, r14 mov r2, r14
swi SYS_vfork swi SYS_vfork
bcs cerror bcs cerror
sub r1, r1, #0x00000001 sub r1, r1, #1 /* r1 == 0xffffffff if parent, 0 if child */
and r0, r0, r1 and r0, r0, r1 /* r0 == 0 if child, else unchanged */
#ifdef __APCS_26__ #ifdef __APCS_26__
movs r15, r2 movs r15, r2
#else #else

View File

@ -1,4 +1,4 @@
/* $NetBSD: __vfork14.S,v 1.1 2000/12/29 20:14:01 bjh21 Exp $ */ /* $NetBSD: __vfork14.S,v 1.2 2001/01/09 19:30:38 bjh21 Exp $ */
/*- /*-
* Copyright (c) 1990 The Regents of the University of California. * Copyright (c) 1990 The Regents of the University of California.
@ -39,6 +39,10 @@
/* /*
* pid = vfork(); * pid = vfork();
*
* On return from the SWI:
* r1 == 0 in parent process, r1 == 1 in child process.
* r0 == pid of child in parent, r0 == pid of parent in child.
*/ */
.text .text
.align 0 .align 0
@ -47,8 +51,8 @@ ENTRY(__vfork14)
mov r2, r14 mov r2, r14
swi SYS___vfork14 swi SYS___vfork14
bcs cerror bcs cerror
sub r1, r1, #0x00000001 sub r1, r1, #1 /* r1 == 0xffffffff if parent, 0 if child */
and r0, r0, r1 and r0, r0, r1 /* r0 == 0 if child, else unchanged */
#ifdef __APCS_26__ #ifdef __APCS_26__
movs r15, r2 movs r15, r2
#else #else

View File

@ -1,4 +1,4 @@
/* $NetBSD: fork.S,v 1.1 2000/12/29 20:14:02 bjh21 Exp $ */ /* $NetBSD: fork.S,v 1.2 2001/01/09 19:30:38 bjh21 Exp $ */
/*- /*-
* Copyright (c) 1990 The Regents of the University of California. * Copyright (c) 1990 The Regents of the University of California.
@ -41,9 +41,17 @@
WEAK_ALIAS(fork, _fork) WEAK_ALIAS(fork, _fork)
#endif #endif
/*
* pid = fork();
*
* On return from the SWI:
* r1 == 0 in parent process, r1 == 1 in child process.
* r0 == pid of child in parent, r0 == pid of parent in child.
*/
_SYSCALL(_fork,fork) _SYSCALL(_fork,fork)
sub r1, r1, #0x00000001 sub r1, r1, #1 /* r1 == 0xffffffff if parent, 0 if child */
and r0, r0, r1 and r0, r0, r1 /* r0 == 0 if child, else unchanged */
#ifdef __APCS_26__ #ifdef __APCS_26__
movs r15, r14 movs r15, r14
#else #else