1 /* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/misc/BUSmemcpy.s,v 1.2 1998/07/25 16:56:49 dawes Exp $ */
2 /******************************************************************************
3 Copyright 1993 by Glenn G. Lai
7 Permission to use, copy, modify, and distribute this software and its
8 documentation for any purpose and without fee is hereby granted,
9 provided that the above copyright notice appear in all copies and that
10 both that copyright notice and this permission notice appear in
11 supporting documentation, and that the name of Glenn G. Lai not be
12 used in advertising or publicity pertaining to distribution of the
13 software without specific, written prior permission.
15 Glenn G. Lai DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
16 ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
17 DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
18 ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
19 WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
20 ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
28 ******************************************************************************/
29 /* $XConsortium: BUSmemcpy.s /main/4 1996/02/21 17:39:34 kaleb $ */
32 * Modified to use long-alignment of video memory rather than word-alignment
33 * to improve performance for LocalBus video cards. Function names changed
34 * from ISAToMem and MemToISA to BusToMem and MemToBus.
36 * David Dawes <dawes@XFree86.org>, 25 August 1993.
46 /* BusToMem copies from video memory to main memory
47 MemToBus copies from main memory to video memory
49 void xf86BusToMem(unsigned char *dst, unsigned char *src, int len);
50 void xf86MemToBus(unsigned char *dst, unsigned char *src, int len);
53 #define dst REGOFF(4,ESP)
54 #define src REGOFF(8,ESP)
55 #define len REGOFF(12,ESP)
57 GLOBL GLNAME(xf86BusToMem)
58 GLOBL GLNAME(xf86MemToBus)
62 STRING("Copyright 8/9/1993 by Glenn G. Lai")
78 TEST_L (CONST(1), ESI)
85 TEST_L (CONST(2), ESI)
108 /************************/
111 GLNAME(xf86MemToBus):
120 CMP_L (CONST(7), ECX)
123 TEST_L (CONST(1), EDI)
130 TEST_L (CONST(2), EDI)
139 AND_L (CONST(3), EAX)
140 SHR_L (CONST(2), ECX)