Initial commit
[xorg_rtime.git] / xorg-server-1.4 / hw / xfree86 / os-support / bsd / sparc64_video.c
blobfb5e8529bcb4532cffdf45fa37fd76151769bee8
1 /*
2 * Copyright 1992 by Rich Murphey <Rich@Rice.edu>
3 * Copyright 1993 by David Wexelblat <dwex@goblin.org>
5 * Permission to use, copy, modify, distribute, and sell this software and its
6 * documentation for any purpose is hereby granted without fee, provided that
7 * the above copyright notice appear in all copies and that both that
8 * copyright notice and this permission notice appear in supporting
9 * documentation, and that the names of Rich Murphey and David Wexelblat
10 * not be used in advertising or publicity pertaining to distribution of
11 * the software without specific, written prior permission. Rich Murphey and
12 * David Wexelblat make no representations about the suitability of this
13 * software for any purpose. It is provided "as is" without express or
14 * implied warranty.
16 * RICH MURPHEY AND DAVID WEXELBLAT DISCLAIM ALL WARRANTIES WITH REGARD TO
17 * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
18 * FITNESS, IN NO EVENT SHALL RICH MURPHEY OR DAVID WEXELBLAT BE LIABLE FOR
19 * ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
20 * RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
21 * CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
22 * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
26 #ifdef HAVE_XORG_CONFIG_H
27 #include <xorg-config.h>
28 #endif
30 #include <X11/X.h>
31 #include "xf86.h"
32 #include "xf86Priv.h"
34 #include "xf86_OSlib.h"
35 #include "xf86OSpriv.h"
37 #ifndef MAP_FAILED
38 #define MAP_FAILED ((caddr_t)-1)
39 #endif
41 /***************************************************************************/
42 /* Video Memory Mapping section */
43 /***************************************************************************/
45 static pointer sparc64MapVidMem(int, unsigned long, unsigned long, int);
46 static void sparc64UnmapVidMem(int, pointer, unsigned long);
48 void
49 xf86OSInitVidMem(VidMemInfoPtr pVidMem)
51 pVidMem->linearSupported = TRUE;
52 pVidMem->mapMem = sparc64MapVidMem;
53 pVidMem->unmapMem = sparc64UnmapVidMem;
54 pVidMem->initialised = TRUE;
57 static pointer
58 sparc64MapVidMem(int ScreenNum, unsigned long Base, unsigned long Size,
59 int flags)
61 int fd = xf86Info.screenFd;
62 pointer base;
64 #ifdef DEBUG
65 xf86MsgVerb(X_INFO, 3, "mapVidMem %lx, %lx, fd = %d",
66 Base, Size, fd);
67 #endif
69 base = mmap(0, Size,
70 (flags & VIDMEM_READONLY) ?
71 PROT_READ : (PROT_READ | PROT_WRITE),
72 MAP_SHARED, fd, Base);
73 if (base == MAP_FAILED)
74 FatalError("%s: could not mmap screen [s=%x,a=%x] (%s)",
75 "xf86MapVidMem", Size, Base, strerror(errno));
76 return base;
79 static void
80 sparc64UnmapVidMem(int ScreenNum, pointer Base, unsigned long Size)
82 munmap(Base, Size);
85 _X_EXPORT int
86 xf86ReadBIOS(unsigned long Base, unsigned long Offset, unsigned char *Buf,
87 int Len)
90 return (0);
93 /***************************************************************************/
94 /* Interrupt Handling section */
95 /***************************************************************************/
97 _X_EXPORT Bool
98 xf86DisableInterrupts()
101 return(TRUE);
104 _X_EXPORT void
105 xf86EnableInterrupts()
108 return;