]> git.saurik.com Git - apple/xnu.git/blame - pexpert/i386/kdasm.s
xnu-123.5.tar.gz
[apple/xnu.git] / pexpert / i386 / kdasm.s
CommitLineData
1c79356b
A
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/* CMU_ENDHIST */
23/*
24 * Mach Operating System
25 * Copyright (c) 1991,1990,1989 Carnegie Mellon University
26 * All Rights Reserved.
27 *
28 * Permission to use, copy, modify and distribute this software and its
29 * documentation is hereby granted, provided that both the copyright
30 * notice and this permission notice appear in all copies of the
31 * software, derivative works or modified versions, and any portions
32 * thereof, and that both notices appear in supporting documentation.
33 *
34 * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
35 * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
36 * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
37 *
38 * Carnegie Mellon requests users of this software to return to
39 *
40 * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
41 * School of Computer Science
42 * Carnegie Mellon University
43 * Pittsburgh PA 15213-3890
44 *
45 * any improvements or extensions that they make and grant Carnegie Mellon
46 * the rights to redistribute these changes.
47 */
48/*
49 */
50
51/*
52 * Some inline code to speed up major block copies to and from the
53 * screen buffer.
54 *
55 * Copyright Ing. C. Olivetti & C. S.p.A. 1988, 1989.
56 * All rights reserved.
57 *
58 * orc!eugene 28 Oct 1988
59 *
60 */
61/*
62 * Copyright 1988, 1989 by Olivetti Advanced Technology Center, Inc.,
63 * Cupertino, California.
64 *
65 * All Rights Reserved
66 *
67 * Permission to use, copy, modify, and distribute this software and
68 * its documentation for any purpose and without fee is hereby
69 * granted, provided that the above copyright notice appears in all
70 * copies and that both the copyright notice and this permission notice
71 * appear in supporting documentation, and that the name of Olivetti
72 * not be used in advertising or publicity pertaining to distribution
73 * of the software without specific, written prior permission.
74 *
75 * OLIVETTI DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE
76 * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS,
77 * IN NO EVENT SHALL OLIVETTI BE LIABLE FOR ANY SPECIAL, INDIRECT, OR
78 * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
79 * LOSS OF USE, DATA OR PROFITS, WHETHER IN ACTION OF CONTRACT,
80 * NEGLIGENCE, OR OTHER TORTIOUS ACTION, ARISING OUR OF OR IN CONNECTION
81 * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
82 */
83
84/* $ Header: $ */
85
86
87
88/*
89 * Function: kd_slmwd()
90 *
91 * This function "slams" a word (char/attr) into the screen memory using
92 * a block fill operation on the 386.
93 *
94 */
95
96#define start 0x08(%ebp)
97#define count 0x0c(%ebp)
98#define value 0x10(%ebp)
99
100 .text
101 .align 2
102 .globl _kd_slmwd
103
104_kd_slmwd:
105 pushl %ebp
106 movl %esp, %ebp
107 pushl %edi
108
109 movl start, %edi
110 movl count, %ecx
111 movw value, %ax
112 cld
113 rep
114 stosw
115
116 popl %edi
117 leave
118 ret
119#undef start
120#undef count
121#undef value
122
123/*
124 * "slam up"
125 */
126
127#define from 0x08(%ebp)
128#define to 0x0c(%ebp)
129#define count 0x10(%ebp)
130 .align 2
131 .globl _kd_slmscu
132
133_kd_slmscu:
134 pushl %ebp
135 movl %esp, %ebp
136 pushl %esi
137 pushl %edi
138
139 movl from, %esi
140 movl to, %edi
141 movl count, %ecx
142 cmpl %edi, %esi
143 cld
144 rep
145 movsw
146
147 popl %edi
148 popl %esi
149 leave
150 ret
151
152/*
153 * "slam down"
154 */
155 .align 2
156 .globl _kd_slmscd
157
158_kd_slmscd:
159 pushl %ebp
160 movl %esp, %ebp
161 pushl %esi
162 pushl %edi
163
164 movl from, %esi
165 movl to, %edi
166 movl count, %ecx
167 cmpl %edi, %esi
168 std
169 rep
170 movsw
171 cld
172
173 popl %edi
174 popl %esi
175 leave
176 ret
177#undef from
178#undef to
179#undef count