The Design and Implementation of the FreeBSD Operating System, Second Edition
Now available: The Design and Implementation of the FreeBSD Operating System (Second Edition)


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]

FreeBSD/Linux Kernel Cross Reference
sys/osfmk/ppc/db_asm.s

Version: -  FREEBSD  -  FREEBSD-13-STABLE  -  FREEBSD-13-0  -  FREEBSD-12-STABLE  -  FREEBSD-12-0  -  FREEBSD-11-STABLE  -  FREEBSD-11-0  -  FREEBSD-10-STABLE  -  FREEBSD-10-0  -  FREEBSD-9-STABLE  -  FREEBSD-9-0  -  FREEBSD-8-STABLE  -  FREEBSD-8-0  -  FREEBSD-7-STABLE  -  FREEBSD-7-0  -  FREEBSD-6-STABLE  -  FREEBSD-6-0  -  FREEBSD-5-STABLE  -  FREEBSD-5-0  -  FREEBSD-4-STABLE  -  FREEBSD-3-STABLE  -  FREEBSD22  -  l41  -  OPENBSD  -  linux-2.6  -  MK84  -  PLAN9  -  xnu-8792 
SearchContext: -  none  -  3  -  10 

    1 /*
    2  * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
    3  *
    4  * @APPLE_LICENSE_HEADER_START@
    5  * 
    6  * The contents of this file constitute Original Code as defined in and
    7  * are subject to the Apple Public Source License Version 1.1 (the
    8  * "License").  You may not use this file except in compliance with the
    9  * License.  Please obtain a copy of the License at
   10  * http://www.apple.com/publicsource and read it before using this file.
   11  * 
   12  * This Original Code and all software distributed under the License are
   13  * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
   14  * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
   15  * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
   16  * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT.  Please see the
   17  * License for the specific language governing rights and limitations
   18  * under the License.
   19  * 
   20  * @APPLE_LICENSE_HEADER_END@
   21  */
   22 /*
   23  * @OSF_COPYRIGHT@
   24  */
   25 
   26 #include <debug.h>
   27 #include <ppc/asm.h>
   28 #include <ppc/proc_reg.h>
   29 #include <mach/ppc/vm_param.h>
   30 #include <assym.s>
   31 
   32 
   33 /* void
   34  * db_phys_cmp(src_a, src_b, bytecount)
   35  *      vm_offset_t     src_a;
   36  *      vm_offset_t     src_b;
   37  *      int             bytecount
   38  *
   39  * This routine will compare bytecount bytes from physical address src_a and physical
   40  * address src_b. 
   41  */
   42 
   43 #warning THIS IS BROKEN FOR 64-BIT
   44 
   45         /* Switch off data translations */
   46         lis             r7,hi16(MASK(MSR_VEC))
   47         ori             r7,r7,lo16(MASK(MSR_FP))
   48         mfmsr   r6
   49         andc    r6,r6,r7                        ; Force FP and vec off
   50         ori             r7,r7,lo16(MASK(MSR_DR))        ; Set the DR bit
   51         andc    r7,r6,r7                        ; Force DR off
   52         mtmsr   r7
   53         isync                   /* Ensure data translations are off */
   54 
   55         subi    r3,     r3,     4
   56         subi    r4,     r4,     4
   57 
   58         cmpwi   r5,     3
   59         ble-    .L_db_phys_cmp_bytes
   60 .L_db_phys_cmp_loop:
   61         lwz     r0,     4(r3)
   62         lwz     r7,     4(r4)
   63         addi    r3,     r3,     4
   64         addi    r4,     r4,     4
   65         subi    r5,     r5,     4
   66         cmpw    r0,     r7
   67         bne     .L_db_phys_cmp_false
   68         cmpwi   r5,     3
   69         bgt+    .L_db_phys_cmp_loop
   70 
   71         /* If no leftover bytes, we're done now */
   72         cmpwi   r5,     0
   73         beq+    .L_db_phys_cmp_true
   74         
   75 .L_db_phys_cmp_bytes:
   76         addi    r3,     r3,     3
   77         addi    r4,     r4,     3
   78 .L_db_phys_cmp_byte_loop:       
   79         lbz     r0,     1(r3)
   80         lbz     r7,     1(r4)
   81         addi    r3,     r3,     1
   82         addi    r4,     r4,     1
   83         subi    r5,     r5,     1
   84         cmpw    r0,     r7
   85         bne     .L_db_phys_cmp_false
   86         cmpwi   r5,     0
   87         bne+    .L_db_phys_cmp_loop
   88 
   89 .L_db_phys_cmp_true:
   90         li      r3,     1
   91         b       .L_db_phys_cmp_done
   92 
   93 .L_db_phys_cmp_false:
   94         li      r3,     0
   95 
   96 .L_db_phys_cmp_done:
   97         mtmsr   r6              /* Restore original translations */
   98         isync                   /* Ensure data translations are off */
   99 
  100         blr
  101 

Cache object: c9242bc2682a3cacb7318bb270337452


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]


This page is part of the FreeBSD/Linux Linux Kernel Cross-Reference, and was automatically generated using a modified version of the LXR engine.