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