Debian Codegraph @

i386/i386at/kdasm.S

raw
1 /*
2 * Mach Operating System
3 * Copyright (c) 1991,1990,1989 Carnegie Mellon University
4 * All Rights Reserved.
5 *
6 * Permission to use, copy, modify and distribute this software and its
7 * documentation is hereby granted, provided that both the copyright
8 * notice and this permission notice appear in all copies of the
9 * software, derivative works or modified versions, and any portions
10 * thereof, and that both notices appear in supporting documentation.
11 *
12 * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
13 * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
14 * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
15 *
16 * Carnegie Mellon requests users of this software to return to
17 *
18 * Software Distribution Coordinator or [email protected]
19 * School of Computer Science
20 * Carnegie Mellon University
21 * Pittsburgh PA 15213-3890
22 *
23 * any improvements or extensions that they make and grant Carnegie Mellon
24 * the rights to redistribute these changes.
25 */
26 /*
27 * Some inline code to speed up major block copies to and from the
28 * screen buffer.
29 *
30 * Copyright Ing. C. Olivetti & C. S.p.A. 1988, 1989.
31 * All rights reserved.
32 *
33 * orc!eugene 28 Oct 1988
34 *
35 */
36 /*
37 Copyright 1988, 1989 by Olivetti Advanced Technology Center, Inc.,
38 Cupertino, California.
39
40 All Rights Reserved
41
42 Permission to use, copy, modify, and distribute this software and
43 its documentation for any purpose and without fee is hereby
44 granted, provided that the above copyright notice appears in all
45 copies and that both the copyright notice and this permission notice
46 appear in supporting documentation, and that the name of Olivetti
47 not be used in advertising or publicity pertaining to distribution
48 of the software without specific, written prior permission.
49
50 OLIVETTI DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE
51 INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS,
52 IN NO EVENT SHALL OLIVETTI BE LIABLE FOR ANY SPECIAL, INDIRECT, OR
53 CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
54 LOSS OF USE, DATA OR PROFITS, WHETHER IN ACTION OF CONTRACT,
55 NEGLIGENCE, OR OTHER TORTIOUS ACTION, ARISING OUR OF OR IN CONNECTION
56 WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
57 */
58
59 /* $ Header: $ */
60
61
62 #include <mach/machine/asm.h>
63
64 /*
65 * Function: kd_slmwd()
66 *
67 * This function "slams" a word (char/attr) into the screen memory using
68 * a block fill operation on the 386.
69 *
70 */
71
72 #define start B_ARG0
73 #define count B_ARG1
74 #define value B_ARG2
75
76 ENTRY(kd_slmwd)
77 pushl %ebp
78 movl %esp, %ebp
79 pushl %edi
80
81 movl start, %edi
82 movl count, %ecx
83 movw value, %ax
84 cld
85 rep
86 stosw
87
88 popl %edi
89 leave
90 ret
91 #undef start
92 #undef count
93 #undef value
94
95 /*
96 * "slam up"
97 */
98
99 #define from B_ARG0
100 #define to B_ARG1
101 #define count B_ARG2
102 ENTRY(kd_slmscu)
103 pushl %ebp
104 movl %esp, %ebp
105 pushl %esi
106 pushl %edi
107
108 movl from, %esi
109 movl to, %edi
110 movl count, %ecx
111 cmpl %edi, %esi
112 cld
113 rep
114 movsw
115
116 popl %edi
117 popl %esi
118 leave
119 ret
120
121 /*
122 * "slam down"
123 */
124 ENTRY(kd_slmscd)
125 pushl %ebp
126 movl %esp, %ebp
127 pushl %esi
128 pushl %edi
129
130 movl from, %esi
131 movl to, %edi
132 movl count, %ecx
133 cmpl %edi, %esi
134 std
135 rep
136 movsw
137 cld
138
139 popl %edi
140 popl %esi
141 leave
142 ret
143 #undef from
144 #undef to
145 #undef count