Simplify arm_video.c; we will never have PCI graphics on this architecture.
This also makes it possible to run wsudl(4) on armv7 machines with echi(4). Tested for non-regression on zaurus by Sigi Rudzio. Thanks.
This commit is contained in:
parent
610dc591ff
commit
031b04adf7
@ -1,5 +1,5 @@
|
||||
/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bsd/ppc_video.c,v 1.6 2003/10/07 23:14:55 herrb Exp $ */
|
||||
/* $OpenBSD: arm_video.c,v 1.11 2014/09/27 17:53:02 matthieu Exp $ */
|
||||
/* $OpenBSD: arm_video.c,v 1.12 2015/05/27 15:11:12 matthieu Exp $ */
|
||||
/*
|
||||
* Copyright 1992 by Rich Murphey <Rich@Rice.edu>
|
||||
* Copyright 1993 by David Wexelblat <dwex@goblin.org>
|
||||
@ -69,33 +69,23 @@
|
||||
#include "xf86_OSlib.h"
|
||||
#include "xf86OSpriv.h"
|
||||
|
||||
#include "bus/Pci.h"
|
||||
|
||||
#ifndef MAP_FAILED
|
||||
#define MAP_FAILED ((caddr_t)-1)
|
||||
#endif
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/sysctl.h>
|
||||
|
||||
/***************************************************************************/
|
||||
/* Video Memory Mapping section */
|
||||
/***************************************************************************/
|
||||
|
||||
#ifdef __OpenBSD__
|
||||
#undef DEV_MEM
|
||||
#define DEV_MEM "/dev/xf86"
|
||||
#endif
|
||||
|
||||
static void* ppcMapVidMem(int, unsigned long, unsigned long, int flags);
|
||||
static void ppcUnmapVidMem(int, void *, unsigned long);
|
||||
static void* armMapVidMem(int, unsigned long, unsigned long, int flags);
|
||||
static void armUnmapVidMem(int, void *, unsigned long);
|
||||
|
||||
void
|
||||
xf86OSInitVidMem(VidMemInfoPtr pVidMem)
|
||||
{
|
||||
pVidMem->linearSupported = TRUE;
|
||||
pVidMem->mapMem = ppcMapVidMem;
|
||||
pVidMem->unmapMem = ppcUnmapVidMem;
|
||||
pVidMem->mapMem = armMapVidMem;
|
||||
pVidMem->unmapMem = armUnmapVidMem;
|
||||
pVidMem->initialised = TRUE;
|
||||
}
|
||||
|
||||
@ -103,7 +93,7 @@ xf86OSInitVidMem(VidMemInfoPtr pVidMem)
|
||||
volatile unsigned char *ioBase = MAP_FAILED;
|
||||
|
||||
static void*
|
||||
ppcMapVidMem(int ScreenNum, unsigned long Base, unsigned long Size, int flags)
|
||||
armMapVidMem(int ScreenNum, unsigned long Base, unsigned long Size, int flags)
|
||||
{
|
||||
int fd = xf86Info.consoleFd;
|
||||
void *base;
|
||||
@ -124,40 +114,17 @@ ppcMapVidMem(int ScreenNum, unsigned long Base, unsigned long Size, int flags)
|
||||
}
|
||||
|
||||
static void
|
||||
ppcUnmapVidMem(int ScreenNum, void *Base, unsigned long Size)
|
||||
armUnmapVidMem(int ScreenNum, void *Base, unsigned long Size)
|
||||
{
|
||||
|
||||
munmap(Base, Size);
|
||||
}
|
||||
|
||||
static int kmem = -1;
|
||||
|
||||
int
|
||||
xf86ReadBIOS(unsigned long Base, unsigned long Offset, unsigned char *Buf,
|
||||
int Len)
|
||||
{
|
||||
int rv;
|
||||
|
||||
if (Base < 0x80000000) {
|
||||
xf86Msg(X_WARNING, "No VGA Base=%#lx\n", Base);
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (kmem == -1) {
|
||||
kmem = open(DEV_MEM, 2);
|
||||
if (kmem == -1) {
|
||||
FatalError("xf86ReadBIOS: open %s", DEV_MEM);
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
xf86MsgVerb(X_INFO, 3, "xf86ReadBIOS() %lx %lx, %x\n",
|
||||
Base, Offset, Len);
|
||||
#endif
|
||||
|
||||
lseek(kmem, Base + Offset, 0);
|
||||
rv = read(kmem, Buf, Len);
|
||||
return rv;
|
||||
return -1;
|
||||
}
|
||||
|
||||
/*
|
||||
@ -166,26 +133,6 @@ xf86ReadBIOS(unsigned long Base, unsigned long Offset, unsigned char *Buf,
|
||||
void
|
||||
xf86PrivilegedInit(void)
|
||||
{
|
||||
int mib[2];
|
||||
char buf[128];
|
||||
size_t len;
|
||||
|
||||
mib[0] = CTL_HW;
|
||||
mib[1] = HW_MACHINE;
|
||||
len = sizeof(buf);
|
||||
if (sysctl(mib, 2, buf, &len, NULL, 0) < 0) {
|
||||
FatalError("Cannot get hw.machine");
|
||||
}
|
||||
if (strcmp(buf, "zaurus") != 0 &&
|
||||
strcmp(buf, "armish") != 0) {
|
||||
/* Not Zaurus */
|
||||
kmem = open(DEV_MEM, 2);
|
||||
if (kmem == -1) {
|
||||
ErrorF("errno: %d\n", errno);
|
||||
FatalError("xf86PrivilegedInit: open %s", DEV_MEM);
|
||||
}
|
||||
pci_system_init();
|
||||
}
|
||||
xf86OpenConsole();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user