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 r6,r6,0,MSR_FP_BIT+1,MSR_FP_BIT-1 ; Force floating point off
46 rlwinm r6,r6,0,MSR_VEC_BIT+1,MSR_VEC_BIT-1 ; Force vectors off
47 rlwinm r7, r6, 0, MSR_DR_BIT+1, MSR_DR_BIT-1
49 isync /* Ensure data translations are off */
55 ble- .L_db_phys_copy_bytes
63 bgt+ .L_db_phys_copy_loop
65 /* If no leftover bytes, we're done now */
67 beq+ .L_db_phys_copy_done
69 .L_db_phys_copy_bytes:
72 .L_db_phys_copy_byte_loop:
79 bne+ .L_db_phys_copy_loop
82 mtmsr r6 /* Restore original translations */
83 isync /* Ensure data translations are off */
88 * db_phys_cmp(src_a, src_b, bytecount)
93 * This routine will compare bytecount bytes from physical address src_a and physical
97 /* Switch off data translations */
99 rlwinm r6,r6,0,MSR_FP_BIT+1,MSR_FP_BIT-1 ; Force floating point off
100 rlwinm r6,r6,0,MSR_VEC_BIT+1,MSR_VEC_BIT-1 ; Force vectors off
101 rlwinm r7, r6, 0, MSR_DR_BIT+1, MSR_DR_BIT-1
103 isync /* Ensure data translations are off */
109 ble- .L_db_phys_cmp_bytes
117 bne .L_db_phys_cmp_false
119 bgt+ .L_db_phys_cmp_loop
121 /* If no leftover bytes, we're done now */
123 beq+ .L_db_phys_cmp_true
125 .L_db_phys_cmp_bytes:
128 .L_db_phys_cmp_byte_loop:
135 bne .L_db_phys_cmp_false
137 bne+ .L_db_phys_cmp_loop
141 b .L_db_phys_cmp_done
143 .L_db_phys_cmp_false:
147 mtmsr r6 /* Restore original translations */
148 isync /* Ensure data translations are off */