4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License, Version 1.0 only
6 * (the "License"). You may not use this file except in compliance
9 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 * or http://www.opensolaris.org/os/licensing.
11 * See the License for the specific language governing permissions
12 * and limitations under the License.
14 * When distributing Covered Code, include this CDDL HEADER in each
15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 * If applicable, add the following below this CDDL HEADER, with the
17 * fields enclosed by brackets "[]" replaced with your own identifying
18 * information: Portions Copyright [yyyy] [name of copyright owner]
23 * Copyright 1997 Sun Microsystems, Inc. All rights reserved.
24 * Use is subject to license terms.
27 /* Copyright (c) 1988 AT&T */
28 /* All Rights Reserved */
31 * University Copyright- Copyright (c) 1982, 1986, 1988
32 * The Regents of the University of California
35 * University Acknowledgment- Portions of this document are derived from
36 * software developed by the University of California, Berkeley, and its
40 #pragma ident "%Z%%M% %I% %E% SMI"
44 #include <sys/types.h>
48 * additional memory routine to deal with memory areas in units of chtypes.
52 memSset(chtype
*s
, chtype c
, int n
)
60 count
= (n
- 1) * sizeof (chtype
);
62 chtype
*sfrom
= s
; /* %r5 */
64 to
= (char *)(sfrom
+ 1);
67 asm(" movblkb %r8, %r7, %r6");
68 /* bcopy (count, to, from) */
69 } else if (count
== 0)
75 char *to
; /* 0(%fp) */
76 char *from
; /* 4(%fp) */
79 count
= (n
- 1) * sizeof (chtype
);
81 chtype
*sfrom
= s
; /* %r7 */
83 to
= (char *)(sfrom
+ 1);
87 /* Evidently one can not specify the regs for movblb. So I move */
88 /* them in myself below to the regs where they belong. */
89 asm(" movw %r8,%r2"); /* count */
90 asm(" movw 0(%fp),%r1"); /* to */
91 asm(" movw 4(%fp),%r0"); /* from */
93 } else if (count
== 0)
101 #endif /* u3b2 || u3b15 */
104 /* The vax block copy command doesn't work the way I want. */
105 /* If anyone finds a version that does, I'd like to know. */
108 /* this is the code within memcpy which shows how to do a block copy */
110 memcpy(char *to
, char *from
, int count
)
113 asm(" movc3 12(ap),*4(ap),*8(ap)");
116 #endif /* __bad__vax__ */