Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/lib/libc/arch/arm/sys Add some explanatory comments.



details:   https://anonhg.NetBSD.org/src/rev/6166630f3fc3
branches:  trunk
changeset: 501952:6166630f3fc3
user:      bjh21 <bjh21%NetBSD.org@localhost>
date:      Tue Jan 09 19:30:38 2001 +0000

description:
Add some explanatory comments.

diffstat:

 lib/libc/arch/arm/sys/Ovfork.S    |  10 +++++++---
 lib/libc/arch/arm/sys/__vfork14.S |  10 +++++++---
 lib/libc/arch/arm/sys/fork.S      |  14 +++++++++++---
 3 files changed, 25 insertions(+), 9 deletions(-)

diffs (91 lines):

diff -r 642713e4d14b -r 6166630f3fc3 lib/libc/arch/arm/sys/Ovfork.S
--- a/lib/libc/arch/arm/sys/Ovfork.S    Tue Jan 09 19:22:31 2001 +0000
+++ b/lib/libc/arch/arm/sys/Ovfork.S    Tue Jan 09 19:30:38 2001 +0000
@@ -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.
@@ -42,6 +42,10 @@
 
 /*
  * 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
        .align  0
@@ -50,8 +54,8 @@
        mov     r2, r14
        swi     SYS_vfork
        bcs     cerror
-       sub     r1, r1, #0x00000001
-       and     r0, r0, r1
+       sub     r1, r1, #1      /* r1 == 0xffffffff if parent, 0 if child */
+       and     r0, r0, r1      /* r0 == 0 if child, else unchanged */
 #ifdef __APCS_26__
        movs    r15, r2
 #else
diff -r 642713e4d14b -r 6166630f3fc3 lib/libc/arch/arm/sys/__vfork14.S
--- a/lib/libc/arch/arm/sys/__vfork14.S Tue Jan 09 19:22:31 2001 +0000
+++ b/lib/libc/arch/arm/sys/__vfork14.S Tue Jan 09 19:30:38 2001 +0000
@@ -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.
@@ -39,6 +39,10 @@
 
 /*
  * 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
        .align  0
@@ -47,8 +51,8 @@
        mov     r2, r14
        swi     SYS___vfork14
        bcs     cerror
-       sub     r1, r1, #0x00000001
-       and     r0, r0, r1
+       sub     r1, r1, #1      /* r1 == 0xffffffff if parent, 0 if child */
+       and     r0, r0, r1      /* r0 == 0 if child, else unchanged */
 #ifdef __APCS_26__
        movs    r15, r2
 #else
diff -r 642713e4d14b -r 6166630f3fc3 lib/libc/arch/arm/sys/fork.S
--- a/lib/libc/arch/arm/sys/fork.S      Tue Jan 09 19:22:31 2001 +0000
+++ b/lib/libc/arch/arm/sys/fork.S      Tue Jan 09 19:30:38 2001 +0000
@@ -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.
@@ -41,9 +41,17 @@
 WEAK_ALIAS(fork, _fork)
 #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)
-       sub     r1, r1, #0x00000001
-       and     r0, r0, r1
+       sub     r1, r1, #1      /* r1 == 0xffffffff if parent, 0 if child */
+       and     r0, r0, r1      /* r0 == 0 if child, else unchanged */
 #ifdef __APCS_26__
        movs    r15, r14
 #else



Home | Main Index | Thread Index | Old Index