Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/i386/i386 KNF a little, use C-style comments, and r...



details:   https://anonhg.NetBSD.org/src/rev/f97d9a27ea84
branches:  trunk
changeset: 345220:f97d9a27ea84
user:      maxv <maxv%NetBSD.org@localhost>
date:      Fri May 13 13:24:01 2016 +0000

description:
KNF a little, use C-style comments, and remove susword/fusword. No
functional changes.

diffstat:

 sys/arch/i386/i386/copy.S |  84 ++++++++++++----------------------------------
 1 files changed, 23 insertions(+), 61 deletions(-)

diffs (182 lines):

diff -r 0194441e21f4 -r f97d9a27ea84 sys/arch/i386/i386/copy.S
--- a/sys/arch/i386/i386/copy.S Fri May 13 13:22:28 2016 +0000
+++ b/sys/arch/i386/i386/copy.S Fri May 13 13:24:01 2016 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: copy.S,v 1.23 2014/01/10 16:47:07 pedro Exp $  */
+/*     $NetBSD: copy.S,v 1.24 2016/05/13 13:24:01 maxv Exp $   */
 /*     NetBSD: locore.S,v 1.34 2005/04/01 11:59:31 yamt Exp $  */
 
 /*-
@@ -65,7 +65,7 @@
  */
 
 #include <machine/asm.h>
-__KERNEL_RCSID(0, "$NetBSD: copy.S,v 1.23 2014/01/10 16:47:07 pedro Exp $");
+__KERNEL_RCSID(0, "$NetBSD: copy.S,v 1.24 2016/05/13 13:24:01 maxv Exp $");
 
 #include "assym.h"
 
@@ -86,10 +86,10 @@
 #define DEFERRED_SWITCH_CHECK \
        CHECK_DEFERRED_SWITCH                   ; \
        jnz     99f                             ; \
-    98:
+       98:
 
 #define DEFERRED_SWITCH_CALL \
-    99:                                                ; \
+       99:                                             ; \
        call    _C_LABEL(do_pmap_load)          ; \
        jmp     98b
 
@@ -136,7 +136,7 @@
  * `level' levels down the stack if level > 0.
  */
 ENTRY(return_address)
-       movl    %ebp,%eax       /* frame pointer -> %eax */ 
+       movl    %ebp,%eax       /* frame pointer -> %eax */
        movl    4(%esp),%ecx    /* level -> %ecx */
        movl    CPUVAR(CURLWP),%edx
        movl    L_PCB(%edx),%edx
@@ -166,15 +166,15 @@
 .Lkcopy_start:
        movl    %edi,%eax
        subl    %esi,%eax
-       cmpl    %ecx,%eax               # overlapping?
+       cmpl    %ecx,%eax               /* overlapping? */
        movl    %ecx,%edx
        jb      1f
-       # nope, copy forward
-       shrl    $2,%ecx                 # copy by 32-bit words
+       /* nope, copy forward */
+       shrl    $2,%ecx                 /* copy by 32-bit words */
        rep
        movsl
        movl    %edx,%ecx
-       andl    $3,%ecx                 # any bytes left?
+       andl    $3,%ecx                 /* any bytes left? */
        jz      0f
        rep
        movsb
@@ -185,15 +185,15 @@
        ret
 
        ALIGN_TEXT
-1:     addl    %ecx,%edi               # copy backward
+1:     addl    %ecx,%edi               /* copy backward */
        addl    %ecx,%esi
        std
-       andl    $3,%ecx                 # any fractional bytes?
+       andl    $3,%ecx                 /* any fractional bytes? */
        decl    %edi
        decl    %esi
        rep
        movsb
-       movl    %edx,%ecx               # copy remainder by 32-bit words
+       movl    %edx,%ecx               /* copy remainder by 32-bit words */
        shrl    $2,%ecx
        subl    $3,%esi
        subl    $3,%edi
@@ -337,11 +337,11 @@
        DEFERRED_SWITCH_CHECK
        pushl   %esi
        pushl   %edi
-       movl    12(%esp),%esi           # esi = from
-       movl    16(%esp),%edi           # edi = to
-       movl    20(%esp),%edx           # edx = maxlen
+       movl    12(%esp),%esi           /* esi = from */
+       movl    16(%esp),%edi           /* edi = to */
+       movl    20(%esp),%edx           /* edx = maxlen */
 .Lcopyoutstr_start:
-5:     
+5:
        /*
         * Get min(%edx, VM_MAXUSER_ADDRESS-%edi).
         */
@@ -388,9 +388,9 @@
        DEFERRED_SWITCH_CHECK
        pushl   %esi
        pushl   %edi
-       movl    12(%esp),%esi           # %esi = from
-       movl    16(%esp),%edi           # %edi = to
-       movl    20(%esp),%edx           # %edx = maxlen
+       movl    12(%esp),%esi           /* %esi = from */
+       movl    16(%esp),%edi           /* %edi = to */
+       movl    20(%esp),%edx           /* %edx = maxlen */
 
        /*
         * Get min(%edx, VM_MAXUSER_ADDRESS-%esi).
@@ -457,9 +457,9 @@
        pushl   %esi
        pushl   %edi
 
-       movl    12(%esp),%esi           # esi = from
-       movl    16(%esp),%edi           # edi = to
-       movl    20(%esp),%edx           # edx = maxlen
+       movl    12(%esp),%esi           /* esi = from */
+       movl    16(%esp),%edi           /* edi = to */
+       movl    20(%esp),%edx           /* edx = maxlen */
        incl    %edx
 
 1:     decl    %edx
@@ -508,24 +508,6 @@
        DEFERRED_SWITCH_CALL
 
 /*
- * int fusword(const void *uaddr);
- * Fetch a short from the user's address space.
- * see fusword(9)
- */
-/* LINTSTUB: Func: int fusword(const void *base) */
-ENTRY(fusword)
-       DEFERRED_SWITCH_CHECK
-       movl    4(%esp),%edx
-       cmpl    $VM_MAXUSER_ADDRESS-2,%edx
-       ja      _C_LABEL(fusuaddrfault)
-       GET_CURPCB(%ecx)
-       movl    $_C_LABEL(fusufault),PCB_ONFAULT(%ecx)
-       movzwl  (%edx),%eax
-       movl    $0,PCB_ONFAULT(%ecx)
-       ret
-       DEFERRED_SWITCH_CALL
-
-/*
  * int fuswintr(const void *uaddr);
  * Fetch a short from the user's address space.  Can be called during an
  * interrupt.
@@ -612,26 +594,6 @@
        DEFERRED_SWITCH_CALL
 
 /*
- * int susword(void *uaddr, short x);
- * Store a short in the user's address space.
- * see susword(9)
- */
-/* LINTSTUB: Func: int susword(void *base, short c) */
-ENTRY(susword)
-       DEFERRED_SWITCH_CHECK
-       movl    4(%esp),%edx
-       cmpl    $VM_MAXUSER_ADDRESS-2,%edx
-       ja      _C_LABEL(fusuaddrfault)
-       GET_CURPCB(%ecx)
-       movl    $_C_LABEL(fusufault),PCB_ONFAULT(%ecx)
-       movl    8(%esp),%eax
-       movw    %ax,(%edx)
-       xorl    %eax,%eax
-       movl    %eax,PCB_ONFAULT(%ecx)
-       ret
-       DEFERRED_SWITCH_CALL
-
-/*
  * int suswintr(void *uaddr, short x);
  * Store a short in the user's address space.  Can be called during an
  * interrupt.
@@ -736,7 +698,7 @@
        cmpl    $VM_MAXUSER_ADDRESS,%eax
        ja      _C_LABEL(x86_copyargs_efault)
        /* There are a maximum of 8 args + 2 for syscall indirect */
-       cmp     $16,%ecx
+       cmp     $16,%ecx
        movl    (%esi),%eax
        movl    4(%esi),%ecx
        movl    %eax,(%edx)



Home | Main Index | Thread Index | Old Index