2 * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
4 * @APPLE_LICENSE_HEADER_START@
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.
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
20 * @APPLE_LICENSE_HEADER_END@
28 #include <ppc/proc_reg.h>
29 #include <mach/ppc/vm_param.h>
34 * db_phys_cmp(src_a, src_b, bytecount)
39 * This routine will compare bytecount bytes from physical address src_a and physical
43 #warning THIS IS BROKEN FOR 64-BIT
45 /* Switch off data translations */
46 lis r7,hi16(MASK(MSR_VEC))
47 ori r7,r7,lo16(MASK(MSR_FP))
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
53 isync /* Ensure data translations are off */
59 ble- .L_db_phys_cmp_bytes
67 bne .L_db_phys_cmp_false
69 bgt+ .L_db_phys_cmp_loop
71 /* If no leftover bytes, we're done now */
73 beq+ .L_db_phys_cmp_true
78 .L_db_phys_cmp_byte_loop:
85 bne .L_db_phys_cmp_false
87 bne+ .L_db_phys_cmp_loop
97 mtmsr r6 /* Restore original translations */
98 isync /* Ensure data translations are off */