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>
33 * db_phys_copy(src, dst, bytecount)
38 * This routine will copy bytecount bytes from physical address src to physical
41 ENTRY(db_phys_copy, TAG_NO_FRAME_USED)
43 /* Switch off data translations */
45 rlwinm r7, r6, 0, MSR_DR_BIT+1, MSR_DR_BIT-1
47 isync /* Ensure data translations are off */
53 ble- .L_db_phys_copy_bytes
61 bgt+ .L_db_phys_copy_loop
63 /* If no leftover bytes, we're done now */
65 beq+ .L_db_phys_copy_done
67 .L_db_phys_copy_bytes:
70 .L_db_phys_copy_byte_loop:
77 bne+ .L_db_phys_copy_loop
80 mtmsr r6 /* Restore original translations */
81 isync /* Ensure data translations are off */
86 * db_phys_cmp(src_a, src_b, bytecount)
91 * This routine will compare bytecount bytes from physical address src_a and physical
95 /* Switch off data translations */
97 rlwinm r7, r6, 0, MSR_DR_BIT+1, MSR_DR_BIT-1
99 isync /* Ensure data translations are off */
105 ble- .L_db_phys_cmp_bytes
113 bne .L_db_phys_cmp_false
115 bgt+ .L_db_phys_cmp_loop
117 /* If no leftover bytes, we're done now */
119 beq+ .L_db_phys_cmp_true
121 .L_db_phys_cmp_bytes:
124 .L_db_phys_cmp_byte_loop:
131 bne .L_db_phys_cmp_false
133 bne+ .L_db_phys_cmp_loop
137 b .L_db_phys_cmp_done
139 .L_db_phys_cmp_false:
143 mtmsr r6 /* Restore original translations */
144 isync /* Ensure data translations are off */