sync with OpenBSD -current

This commit is contained in:
purplerain 2024-08-16 22:25:46 +00:00
parent 4b69692ae6
commit 50c8bafd9f
Signed by: purplerain
GPG key ID: F42C07F07E2E35B7
4 changed files with 60 additions and 59 deletions

View file

@ -674,11 +674,6 @@
./usr/X11R6/include/xcb/xtest.h ./usr/X11R6/include/xcb/xtest.h
./usr/X11R6/include/xcb/xv.h ./usr/X11R6/include/xcb/xv.h
./usr/X11R6/include/xcb/xvmc.h ./usr/X11R6/include/xcb/xvmc.h
./usr/X11R6/lib/X11/x11perfcomp
./usr/X11R6/lib/X11/x11perfcomp/Xmark
./usr/X11R6/lib/X11/x11perfcomp/fillblnk
./usr/X11R6/lib/X11/x11perfcomp/perfboth
./usr/X11R6/lib/X11/x11perfcomp/perfratio
./usr/X11R6/lib/X11/xedit ./usr/X11R6/lib/X11/xedit
./usr/X11R6/lib/X11/xedit/lisp ./usr/X11R6/lib/X11/xedit/lisp
./usr/X11R6/lib/X11/xedit/lisp/indent.lsp ./usr/X11R6/lib/X11/xedit/lisp/indent.lsp
@ -2858,6 +2853,11 @@
./usr/X11R6/share/X11/locale/zh_TW/XI18N_OBJS ./usr/X11R6/share/X11/locale/zh_TW/XI18N_OBJS
./usr/X11R6/share/X11/locale/zh_TW/XLC_LOCALE ./usr/X11R6/share/X11/locale/zh_TW/XLC_LOCALE
./usr/X11R6/share/X11/rgb.txt ./usr/X11R6/share/X11/rgb.txt
./usr/X11R6/share/X11/x11perfcomp
./usr/X11R6/share/X11/x11perfcomp/Xmark
./usr/X11R6/share/X11/x11perfcomp/fillblnk
./usr/X11R6/share/X11/x11perfcomp/perfboth
./usr/X11R6/share/X11/x11perfcomp/perfratio
./usr/X11R6/share/X11/xkb ./usr/X11R6/share/X11/xkb
./usr/X11R6/share/X11/xkb/compat ./usr/X11R6/share/X11/xkb/compat
./usr/X11R6/share/X11/xkb/compat/README ./usr/X11R6/share/X11/xkb/compat/README

View file

@ -430,7 +430,7 @@ xf86OpenSyscons(void)
xf86Info.vtno = -1; xf86Info.vtno = -1;
} }
#if 0 #if 0
} }
#endif #endif
if (xf86Info.vtno == -1) { if (xf86Info.vtno == -1) {
@ -458,11 +458,8 @@ xf86OpenSyscons(void)
} }
close(fd); close(fd);
#ifndef __OpenBSD__ snprintf(vtname, sizeof(vtname), "/dev/ttyv%01x",
snprintf(vtname, sizeof(vtname), "/dev/ttyv%01x", xf86Info.vtno - 1); xf86Info.vtno - 1);
#else
sprintf(vtname, sizeof(vtname), "/dev/ttyC%01x", xf86Info.vtno - 1);
#endif
if ((fd = open(vtname, SYSCONS_CONSOLE_MODE, 0)) < 0) { if ((fd = open(vtname, SYSCONS_CONSOLE_MODE, 0)) < 0) {
FatalError("xf86OpenSyscons: Cannot open %s (%s)", FatalError("xf86OpenSyscons: Cannot open %s (%s)",
vtname, strerror(errno)); vtname, strerror(errno));
@ -525,7 +522,7 @@ xf86OpenPcvt(void)
#endif #endif
if (fd >= 0) { if (fd >= 0) {
if (ioctl(fd, VGAPCVTID, &pcvt_version) >= 0) { if (ioctl(fd, VGAPCVTID, &pcvt_version) >= 0) {
if(ioctl(fd, VT_GETMODE, &vtmode) < 0) { if (ioctl(fd, VT_GETMODE, &vtmode) < 0) {
FatalError("%s: VT_GETMODE failed\n%s%s\n%s", FatalError("%s: VT_GETMODE failed\n%s%s\n%s",
"xf86OpenPcvt", "xf86OpenPcvt",
"Found pcvt driver but X11 seems to be", "Found pcvt driver but X11 seems to be",
@ -551,22 +548,23 @@ xf86OpenPcvt(void)
xf86Info.vtno = initialVT; xf86Info.vtno = initialVT;
} }
else { else {
FatalError("%s: Cannot find a free VT", FatalError("%s: Cannot find a free VT", "xf86OpenPcvt");
"xf86OpenPcvt");
} }
} }
} }
close(fd); close(fd);
snprintf(vtname, sizeof(vtname), "%s%01x", vtprefix, xf86Info.vtno - 1); snprintf(vtname, sizeof(vtname), "%s%01x", vtprefix,
xf86Info.vtno - 1);
if ((fd = open(vtname, PCVT_CONSOLE_MODE, 0)) < 0) { if ((fd = open(vtname, PCVT_CONSOLE_MODE, 0)) < 0) {
ErrorF("xf86OpenPcvt: Cannot open %s (%s)", ErrorF("xf86OpenPcvt: Cannot open %s (%s)",
vtname, strerror(errno)); vtname, strerror(errno));
xf86Info.vtno = initialVT; xf86Info.vtno = initialVT;
snprintf(vtname, sizeof(vtname), "%s%01x", vtprefix, xf86Info.vtno - 1); snprintf(vtname, sizeof(vtname), "%s%01x", vtprefix,
xf86Info.vtno - 1);
if ((fd = open(vtname, PCVT_CONSOLE_MODE, 0)) < 0) { if ((fd = open(vtname, PCVT_CONSOLE_MODE, 0)) < 0) {
FatalError("xf86OpenPcvt: Cannot open %s (%s)", FatalError("xf86OpenPcvt: Cannot open %s (%s)",
vtname, strerror(errno)); vtname, strerror(errno));
} }
} }
if (ioctl(fd, VT_GETMODE, &vtmode) < 0) { if (ioctl(fd, VT_GETMODE, &vtmode) < 0) {

View file

@ -83,11 +83,11 @@ checkDevMem(Bool warn)
/* Try the aperture driver first */ /* Try the aperture driver first */
if ((fd = open(DEV_APERTURE, O_RDWR)) >= 0) { if ((fd = open(DEV_APERTURE, O_RDWR)) >= 0) {
/* Try to map a page at the VGA address */ /* Try to map a page at the VGA address */
base = mmap((caddr_t)0, 4096, PROT_READ | PROT_WRITE, base = mmap((caddr_t) 0, 4096, PROT_READ | PROT_WRITE,
MAP_FLAGS, fd, (off_t)0xA0000); MAP_FLAGS, fd, (off_t) 0xA0000);
if (base != MAP_FAILED) { if (base != MAP_FAILED) {
munmap((caddr_t)base, 4096); munmap((caddr_t) base, 4096);
devMemFd = fd; devMemFd = fd;
useDevMem = TRUE; useDevMem = TRUE;
xf86Msg(X_PROBED, "checkDevMem: using aperture driver %s\n", xf86Msg(X_PROBED, "checkDevMem: using aperture driver %s\n",
@ -104,16 +104,17 @@ checkDevMem(Bool warn)
#endif #endif
if ((fd = open(DEV_MEM, O_RDWR)) >= 0) { if ((fd = open(DEV_MEM, O_RDWR)) >= 0) {
/* Try to map a page at the VGA address */ /* Try to map a page at the VGA address */
base = mmap((caddr_t)0, 4096, PROT_READ | PROT_WRITE, base = mmap((caddr_t) 0, 4096, PROT_READ | PROT_WRITE,
MAP_FLAGS, fd, (off_t)0xA0000); MAP_FLAGS, fd, (off_t) 0xA0000);
if (base != MAP_FAILED) { if (base != MAP_FAILED) {
munmap((caddr_t)base, 4096); munmap((caddr_t) base, 4096);
devMemFd = fd; devMemFd = fd;
useDevMem = TRUE; useDevMem = TRUE;
return; return;
} }
else { else {
if (warn) { if (warn) {
xf86Msg(X_WARNING, "checkDevMem: failed to mmap %s (%s)\n", xf86Msg(X_WARNING, "checkDevMem: failed to mmap %s (%s)\n",
DEV_MEM, strerror(errno)); DEV_MEM, strerror(errno));
@ -128,17 +129,19 @@ checkDevMem(Bool warn)
#else #else
#ifndef __OpenBSD__ #ifndef __OpenBSD__
xf86Msg(X_WARNING, "checkDevMem: failed to open %s and %s\n" xf86Msg(X_WARNING, "checkDevMem: failed to open %s and %s\n"
"\t(%s)\n", DEV_APERTURE, DEV_MEM, strerror(errno)); "\t(%s)\n", DEV_MEM, DEV_APERTURE, strerror(errno));
#else /* __OpenBSD__ */ #else /* __OpenBSD__ */
xf86Msg(X_WARNING, "checkDevMem: failed to open %s and %s\n" xf86Msg(X_WARNING, "checkDevMem: failed to open %s and %s\n"
"\t(%s)\n%s", DEV_APERTURE, DEV_MEM, strerror(errno), "\t(%s)\n%s", DEV_MEM, DEV_APERTURE, strerror(errno),
SYSCTL_MSG); SYSCTL_MSG);
#endif /* __OpenBSD__ */ #endif /* __OpenBSD__ */
xf86ErrorF("\tlinear framebuffer access unavailable\n"); xf86ErrorF("\tlinear framebuffer access unavailable\n");
} }
useDevMem = FALSE; useDevMem = FALSE;
return; return;
#endif #endif
} }
@ -148,6 +151,7 @@ xf86OSInitVidMem(VidMemInfoPtr pVidMem)
checkDevMem(TRUE); checkDevMem(TRUE);
pci_system_init_dev_mem(devMemFd); pci_system_init_dev_mem(devMemFd);
pVidMem->initialised = TRUE; pVidMem->initialised = TRUE;
} }
@ -159,7 +163,7 @@ xf86OSInitVidMem(VidMemInfoPtr pVidMem)
static Bool ExtendedEnabled = FALSE; static Bool ExtendedEnabled = FALSE;
Bool Bool
xf86EnableIO() xf86EnableIO(void)
{ {
if (ExtendedEnabled) if (ExtendedEnabled)
return TRUE; return TRUE;
@ -180,7 +184,7 @@ xf86EnableIO()
} }
void void
xf86DisableIO() xf86DisableIO(void)
{ {
if (!ExtendedEnabled) if (!ExtendedEnabled)
return; return;
@ -203,7 +207,7 @@ xf86DisableIO()
static Bool ExtendedEnabled = FALSE; static Bool ExtendedEnabled = FALSE;
Bool Bool
xf86EnableIO() xf86EnableIO(void)
{ {
if (ExtendedEnabled) if (ExtendedEnabled)
return TRUE; return TRUE;
@ -224,17 +228,17 @@ xf86EnableIO()
} }
void void
xf86DisableIO() xf86DisableIO(void)
{ {
if (!ExtendedEnabled) if (!ExtendedEnabled)
return; return;
if (amd64_iopl(FALSE) == 0) { if (amd64_iopl(FALSE) == 0) {
ExtendedEnabled = FALSE; ExtendedEnabled = FALSE;
} }
/* Otherwise, the X server has revoqued its root uid, /* Otherwise, the X server has revoqued its root uid,
and thus cannot give up IO privileges any more */ and thus cannot give up IO privileges any more */
return; return;
} }
@ -244,7 +248,7 @@ xf86DisableIO()
static int IoFd = -1; static int IoFd = -1;
Bool Bool
xf86EnableIO() xf86EnableIO(void)
{ {
if (IoFd >= 0) if (IoFd >= 0)
return TRUE; return TRUE;
@ -258,7 +262,7 @@ xf86EnableIO()
} }
void void
xf86DisableIO() xf86DisableIO(void)
{ {
if (IoFd < 0) if (IoFd < 0)
return; return;
@ -279,18 +283,18 @@ xf86SetTVOut(int mode)
{ {
switch (xf86Info.consType) { switch (xf86Info.consType) {
#ifdef PCCONS_SUPPORT #ifdef PCCONS_SUPPORT
case PCCONS:{ case PCCONS:{
if (ioctl (xf86Info.consoleFd, CONSOLE_X_TV_ON, &mode) < 0) {
xf86Msg(X_WARNING,
"xf86SetTVOut: Could not set console to TV output, %s\n",
strerror(errno));
}
}
break;
#endif /* PCCONS_SUPPORT */
default: if (ioctl(xf86Info.consoleFd, CONSOLE_X_TV_ON, &mode) < 0) {
xf86Msg(X_WARNING,
"xf86SetTVOut: Could not set console to TV output, %s\n",
strerror(errno));
}
}
break;
#endif /* PCCONS_SUPPORT */
default:
FatalError("Xf86SetTVOut: Unsupported console"); FatalError("Xf86SetTVOut: Unsupported console");
break; break;
} }
@ -298,22 +302,22 @@ xf86SetTVOut(int mode)
} }
void void
xf86SetRGBOut() xf86SetRGBOut(void)
{ {
switch (xf86Info.consType) { switch (xf86Info.consType) {
#ifdef PCCONS_SUPPORT #ifdef PCCONS_SUPPORT
case PCCONS:{ case PCCONS:{
if (ioctl (xf86Info.consoleFd, CONSOLE_X_TV_OFF, 0) < 0) {
xf86Msg(X_WARNING,
"xf86SetTVOut: Could not set console to RGB output, %s\n",
strerror(errno));
}
}
break;
#endif /* PCCONS_SUPPORT */
default: if (ioctl(xf86Info.consoleFd, CONSOLE_X_TV_OFF, 0) < 0) {
xf86Msg(X_WARNING,
"xf86SetTVOut: Could not set console to RGB output, %s\n",
strerror(errno));
}
}
break;
#endif /* PCCONS_SUPPORT */
default:
FatalError("Xf86SetTVOut: Unsupported console"); FatalError("Xf86SetTVOut: Unsupported console");
break; break;
} }

View file

@ -31,7 +31,6 @@ libos_la_SOURCES = \
xstrans.c \ xstrans.c \
xprintf.c \ xprintf.c \
$(XORG_SRCS) $(XORG_SRCS)
libos_la_LIBADD = @SHA1_LIBS@ $(DLOPEN_LIBS) $(LTLIBOBJS) libos_la_LIBADD = @SHA1_LIBS@ $(DLOPEN_LIBS) $(LTLIBOBJS)
if SECURE_RPC if SECURE_RPC