bsd: Replacement screenFd on consoleFd because they are equivalent
Signed-off-by: Alexandr Shadchin <Alexandr.Shadchin@gmail.com> Reviewed-by: Jamey Sharp <jamey@minilop.net> Tested-by: Matthieu Herrb <matthieu.herrb@laas.fr>
This commit is contained in:
parent
f015351c73
commit
38bd1e123d
|
@ -111,7 +111,6 @@ xf86InfoRec xf86Info = {
|
|||
.caughtSignal = FALSE,
|
||||
.currentScreen = NULL,
|
||||
#ifdef CSRG_BASED
|
||||
.screenFd = -1,
|
||||
.consType = -1,
|
||||
#endif
|
||||
.allowMouseOpenFail = FALSE,
|
||||
|
|
|
@ -76,8 +76,6 @@ typedef struct {
|
|||
/* graphics part */
|
||||
ScreenPtr currentScreen;
|
||||
#if defined(CSRG_BASED) || defined(__FreeBSD_kernel__)
|
||||
int screenFd; /* fd for memory mapped access to
|
||||
* vga card */
|
||||
int consType; /* Which console driver? */
|
||||
#endif
|
||||
|
||||
|
|
|
@ -340,7 +340,7 @@ mapVidMem(int ScreenNum, unsigned long Base, unsigned long Size, int flags)
|
|||
base = mmap(0, Size,
|
||||
(flags & VIDMEM_READONLY) ?
|
||||
PROT_READ : (PROT_READ | PROT_WRITE),
|
||||
MAP_FLAGS, xf86Info.screenFd,
|
||||
MAP_FLAGS, xf86Info.consoleFd,
|
||||
(unsigned long)Base + BUS_BASE);
|
||||
if (base == MAP_FAILED)
|
||||
{
|
||||
|
|
|
@ -213,7 +213,7 @@ mapVidMem(int ScreenNum, unsigned long Base, unsigned long Size, int flags)
|
|||
base = mmap(0, Size,
|
||||
(flags & VIDMEM_READONLY) ?
|
||||
PROT_READ : (PROT_READ | PROT_WRITE),
|
||||
MAP_FLAGS, xf86Info.screenFd,
|
||||
MAP_FLAGS, xf86Info.consoleFd,
|
||||
(unsigned long)Base - 0xA0000);
|
||||
if (base == MAP_FAILED)
|
||||
{
|
||||
|
@ -306,7 +306,7 @@ checkMapInfo(Bool warn, int Region)
|
|||
|
||||
if(!memAccP->Checked)
|
||||
{
|
||||
if(ioctl(xf86Info.screenFd, memAccP->ioctl, &(memAccP->memInfo)) == -1)
|
||||
if(ioctl(xf86Info.consoleFd, memAccP->ioctl, &(memAccP->memInfo)) == -1)
|
||||
{
|
||||
if(warn)
|
||||
{
|
||||
|
@ -360,7 +360,7 @@ xf86MapInfoMap(struct memAccess *memInfoP, pointer Base, unsigned long Size)
|
|||
Size,
|
||||
PROT_READ | PROT_WRITE,
|
||||
MAP_SHARED,
|
||||
xf86Info.screenFd,
|
||||
xf86Info.consoleFd,
|
||||
(unsigned long)mapInfoP->u.map_info_mmap.map_offset))
|
||||
== (pointer)-1)
|
||||
{
|
||||
|
|
|
@ -211,7 +211,6 @@ xf86OpenConsole()
|
|||
fclose(stdin);
|
||||
#endif
|
||||
xf86Info.consoleFd = fd;
|
||||
xf86Info.screenFd = fd;
|
||||
|
||||
switch (xf86Info.consType)
|
||||
{
|
||||
|
@ -688,22 +687,12 @@ xf86CloseConsole()
|
|||
case WSCONS:
|
||||
{
|
||||
int mode = WSDISPLAYIO_MODE_EMUL;
|
||||
ioctl(xf86Info.screenFd, WSDISPLAYIO_SMODE, &mode);
|
||||
ioctl(xf86Info.consoleFd, WSDISPLAYIO_SMODE, &mode);
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
if (xf86Info.screenFd != xf86Info.consoleFd)
|
||||
{
|
||||
close(xf86Info.screenFd);
|
||||
close(xf86Info.consoleFd);
|
||||
if ((xf86Info.consoleFd = open("/dev/console",O_RDONLY,0)) <0)
|
||||
{
|
||||
xf86FatalError("xf86CloseConsole: Cannot open /dev/console (%s)",
|
||||
strerror(errno));
|
||||
}
|
||||
}
|
||||
close(xf86Info.consoleFd);
|
||||
if (devConsoleFd >= 0)
|
||||
close(devConsoleFd);
|
||||
|
|
|
@ -258,7 +258,7 @@ mapVidMem(int ScreenNum, unsigned long Base, unsigned long Size, int flags)
|
|||
base = mmap(0, Size,
|
||||
(flags & VIDMEM_READONLY) ?
|
||||
PROT_READ : (PROT_READ | PROT_WRITE),
|
||||
MAP_FLAGS, xf86Info.screenFd,
|
||||
MAP_FLAGS, xf86Info.consoleFd,
|
||||
(unsigned long)Base - 0xA0000
|
||||
);
|
||||
if (base == MAP_FAILED)
|
||||
|
|
|
@ -73,7 +73,7 @@ volatile unsigned char *ioBase = MAP_FAILED;
|
|||
static pointer
|
||||
ppcMapVidMem(int ScreenNum, unsigned long Base, unsigned long Size, int flags)
|
||||
{
|
||||
int fd = xf86Info.screenFd;
|
||||
int fd = xf86Info.consoleFd;
|
||||
pointer base;
|
||||
#ifdef DEBUG
|
||||
xf86MsgVerb(X_INFO, 3, "mapVidMem %lx, %lx, fd = %d",
|
||||
|
@ -125,7 +125,7 @@ xf86ReadBIOS(unsigned long Base, unsigned long Offset, unsigned char *Buf,
|
|||
|
||||
Bool xf86EnableIO()
|
||||
{
|
||||
int fd = xf86Info.screenFd;
|
||||
int fd = xf86Info.consoleFd;
|
||||
|
||||
xf86MsgVerb(X_WARNING, 3, "xf86EnableIO %d\n", fd);
|
||||
if (ioBase == MAP_FAILED)
|
||||
|
|
|
@ -58,7 +58,7 @@ static pointer
|
|||
sparc64MapVidMem(int ScreenNum, unsigned long Base, unsigned long Size,
|
||||
int flags)
|
||||
{
|
||||
int fd = xf86Info.screenFd;
|
||||
int fd = xf86Info.consoleFd;
|
||||
pointer base;
|
||||
|
||||
#ifdef DEBUG
|
||||
|
|
Loading…
Reference in New Issue
Block a user