Home | History | Annotate | Line # | Download | only in arm32
bcopy_page.S revision 1.1
      1 /*	$NetBSD: bcopy_page.S,v 1.1 2001/03/04 08:25:39 matt Exp $	*/
      2 
      3 /*
      4  * Copyright (c) 1995 Scott Stevens
      5  * All rights reserved.
      6  *
      7  * Redistribution and use in source and binary forms, with or without
      8  * modification, are permitted provided that the following conditions
      9  * are met:
     10  * 1. Redistributions of source code must retain the above copyright
     11  *    notice, this list of conditions and the following disclaimer.
     12  * 2. Redistributions in binary form must reproduce the above copyright
     13  *    notice, this list of conditions and the following disclaimer in the
     14  *    documentation and/or other materials provided with the distribution.
     15  * 3. All advertising materials mentioning features or use of this software
     16  *    must display the following acknowledgement:
     17  *	This product includes software developed by Scott Stevens.
     18  * 4. The name of the author may not be used to endorse or promote products
     19  *    derived from this software without specific prior written permission.
     20  *
     21  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
     22  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
     23  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
     24  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
     25  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
     26  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
     27  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
     28  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
     29  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
     30  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
     31  *
     32  * RiscBSD kernel project
     33  *
     34  * bcopy_page.S
     35  *
     36  * page optimised bcopy and bzero routines
     37  *
     38  * Created      : 08/04/95
     39  */
     40 
     41 #include <machine/param.h>
     42 #include <machine/asm.h>
     43 
     44 /*
     45  * bcopy_page(src, dest)
     46  *
     47  * Optimised copy page routine.
     48  *
     49  * On entry:
     50  *   r0 - src address
     51  *   r1 - dest address
     52  *
     53  * Requires:
     54  *   number of bytes per page (NBPG) is a multiple of 512
     55  */
     56 
     57 ENTRY(bcopy_page)
     58 	stmfd	sp!, {r4-r10, lr}
     59 	mov	r2, #(NBPG >> 9)
     60 
     61 Lloopcopy:
     62 	ldmia	r0!, {r3-r10}
     63 	stmia	r1!, {r3-r10}
     64 	ldmia	r0!, {r3-r10}
     65 	stmia	r1!, {r3-r10}
     66 	ldmia	r0!, {r3-r10}
     67 	stmia	r1!, {r3-r10}
     68 	ldmia	r0!, {r3-r10}
     69 	stmia	r1!, {r3-r10}
     70 
     71 	ldmia	r0!, {r3-r10}
     72 	stmia	r1!, {r3-r10}
     73 	ldmia	r0!, {r3-r10}
     74 	stmia	r1!, {r3-r10}
     75 	ldmia	r0!, {r3-r10}
     76 	stmia	r1!, {r3-r10}
     77 	ldmia	r0!, {r3-r10}
     78 	stmia	r1!, {r3-r10}
     79 
     80 	ldmia	r0!, {r3-r10}
     81 	stmia	r1!, {r3-r10}
     82 	ldmia	r0!, {r3-r10}
     83 	stmia	r1!, {r3-r10}
     84 	ldmia	r0!, {r3-r10}
     85 	stmia	r1!, {r3-r10}
     86 	ldmia	r0!, {r3-r10}
     87 	stmia	r1!, {r3-r10}
     88 
     89 	ldmia	r0!, {r3-r10}
     90 	stmia	r1!, {r3-r10}
     91 	ldmia	r0!, {r3-r10}
     92 	stmia	r1!, {r3-r10}
     93 	ldmia	r0!, {r3-r10}
     94 	stmia	r1!, {r3-r10}
     95 	ldmia	r0!, {r3-r10}
     96 	stmia	r1!, {r3-r10}
     97 
     98 	subs	r2, r2, #1
     99 	bne	Lloopcopy
    100 
    101 	ldmfd	sp!, {r4-r10, pc}
    102 
    103 /*
    104  * bzero_page(dest)
    105  *
    106  * Optimised zero page routine.
    107  *
    108  * On entry:
    109  *   r0 - dest address
    110  *
    111  * Requires:
    112  *   number of bytes per page (NBPG) is a multiple of 512
    113  */
    114 
    115 ENTRY(bzero_page)
    116 	stmfd	sp!, {r4-r10, lr}
    117 	mov	r2, #(NBPG >> 9)
    118 
    119 	mov	r3, #0
    120 	mov	r4, #0
    121 	mov	r5, #0
    122 	mov	r6, #0
    123 	mov	r7, #0
    124 	mov	r8, #0
    125 	mov	r9, #0
    126 	mov	r10, #0
    127 
    128 Lloopzero:
    129 	stmia	r0!, {r3-r10}
    130 	stmia	r0!, {r3-r10}
    131 	stmia	r0!, {r3-r10}
    132 	stmia	r0!, {r3-r10}
    133 
    134 	stmia	r0!, {r3-r10}
    135 	stmia	r0!, {r3-r10}
    136 	stmia	r0!, {r3-r10}
    137 	stmia	r0!, {r3-r10}
    138 
    139 	stmia	r0!, {r3-r10}
    140 	stmia	r0!, {r3-r10}
    141 	stmia	r0!, {r3-r10}
    142 	stmia	r0!, {r3-r10}
    143 
    144 	stmia	r0!, {r3-r10}
    145 	stmia	r0!, {r3-r10}
    146 	stmia	r0!, {r3-r10}
    147 	stmia	r0!, {r3-r10}
    148 
    149 	subs	r2, r2, #1
    150 	bne	Lloopzero
    151 
    152 	ldmfd	sp!, {r4-r10, pc}
    153