No need to directly hard-crash the Xserver when strdup() fails, instead
try to handle the situation gracefully.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
The old PCCONS driver only seems to be used on minimal install disks and
cannot coexist with newer ones (at least that's the feedback I've gotten
from BSD community), so there's probably no practical use case for
supporting it in Xorg anymore.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Using calloc() instead of malloc() as preventive measure, so there
never can be any hidden bugs or leaks due uninitialized memory.
The extra cost of using this compiler intrinsic should be practically
impossible to measure - in many cases a good compiler can even deduce
if certain areas really don't need to be zero'd (because they're written
to right after allocation) and create more efficient machine code.
The code pathes in question are pretty cold anyways, so it's probably
not worth even thinking about potential extra runtime costs.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
There doesn't seem to be any driver for these cards anymore,
so no need for trying to probe them anymore.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
There doesn't seem to be any sungt driver anymore, so no need for
trying to probe those cards any longer.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
There doesn't seem to be any suncg12 driver anymore, so no need for
trying to probe those cards any longer.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
There doesn't seem to be any suncg8 driver anymore, so no need for
trying to probe those cards any longer.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
There doesn't seem to be any suncg4 driver anymore, so no need for
trying to probe those cards any longer.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
There doesn't seem to be any suncg2 driver anymore, no need for trying
to probe those cards any longer.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
There doesn't seem to be any sunbw2 driver anymore, so no need for trying
to probe those cards any longer.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
In order to be able to build on Linux w/ platform_noop
(when no recent enough libdrm found), a few more dummy functions
are needed here.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1848>
public server module API headers shouldn't be clobbered with non-exported
definitions, so move them out to private header file.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1290>
DEV_MEM define isn't used by any drivers, and BSD seems to be the only one
left using that define (Linux uses the symbol, but defines on its own)
Therefore, just define it where actually used and drop it from the global
xf86OSlib.h file.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1411>
The only consumer seems to be one BSD specific file, the few drivers using
the *_iopl seem to include it on their own. Thus, no need to keep it in
public headers.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1420>
These only had been used by xf86-video-chips, but meanwhile this
defines them on it's own, so we can drop them from here now.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1420>
Most of the support for such OS'es was removed in 2010 for
xorg-server-1.10.0, but a few bits lingered on, and a few
comments were left out-of-date.
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1667>
This has been nothing but an alias for two decades now (somewhere in R6.6),
so there doesn't seem to be any practical need for this indirection.
The macro still needs to remain, as long as (external) drivers still using it.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1529>
The xnfreallocarray was added along (and just as an alias to) XNFreallocarray
back a decade ago. It's just used in a few places and it's only saves us from
passing the first parameter (NULL), so the actual benefit isn't really huge.
No (known) driver is using it, so the macro can be dropped entirely.
Fixes: ae75d50395
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1529>
Clears -Wcalloc-transposed-args warnings from gcc 14.1, such as:
../dix/main.c:165:42: warning: ‘calloc’ sizes specified with ‘sizeof’ in the
earlier argument and not in the later argument [-Wcalloc-transposed-args]
165 | serverClient = calloc(sizeof(ClientRec), 1);
| ^~~~~~~~~
../dix/main.c:165:42: note: earlier argument should specify number of
elements, later size of each element
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1606>
../hw/xfree86/os-support/bsd/bsd_init.c: In function ‘xf86CloseConsole’:
../hw/xfree86/os-support/xf86_os_support.h:22:6: error: ‘dispatchException’ undeclared (first use in this function)
22 | if (dispatchException & DE_TERMINATE) { \
| ^~~~~~~~~~~~~~~~~
../hw/xfree86/os-support/bsd/bsd_init.c:634:13: note: in expansion of macro ‘xf86FatalError’
634 | xf86FatalError("xf86CloseConsole: KDDISABIO failed (%s)",
| ^~~~~~~~~~~~~~
../hw/xfree86/os-support/xf86_os_support.h:22:6: note: each undeclared identifier is reported only once for each function it appears in
22 | if (dispatchException & DE_TERMINATE) { \
| ^~~~~~~~~~~~~~~~~
../hw/xfree86/os-support/bsd/bsd_init.c:634:13: note: in expansion of macro ‘xf86FatalError’
634 | xf86FatalError("xf86CloseConsole: KDDISABIO failed (%s)",
| ^~~~~~~~~~~~~~
../hw/xfree86/os-support/xf86_os_support.h:22:26: error: ‘DE_TERMINATE’ undeclared (first use in this function); did you mean ‘ACTION_TERMINATE’?
22 | if (dispatchException & DE_TERMINATE) { \
| ^~~~~~~~~~~~
../hw/xfree86/os-support/bsd/bsd_init.c:634:13: note: in expansion of macro ‘xf86FatalError’
634 | xf86FatalError("xf86CloseConsole: KDDISABIO failed (%s)",
| ^~~~~~~~~~~~~~
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1575>
This header isn't public and holds defines for code in os/ directory,
so no need to keep it in the global header dir - it's probably better
off in os/ directory - just like we already have with many others.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1389>
All supported platforms, except Linux, have have to call xf86InitVidMem()
from xf86scanpci(), so we can make the code much simpler.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1548>
The sun_apm.c support was written to a draft version of the interfaces that
were integrated under a different name (SRN - Suspend/Resume Notification)
in 2007 for OpenSolaris, and what eventually became Solaris 11.0. Adopt the
official names and use the system-provided header file for these now.
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1540>
Left over from the builtin keyboard driver removed from the Xorg
server in 2006 (commit 3eeb62e8f5).
Requires xorg/driver/xf86-input-keyboard@40ef7d9e24987eb6708d822d0ea070
to build the current keyboard driver with this change.
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1541>
This header is internal (not installed) and holds definitions for sources
in config/, thus it fells more clean moving it to config/, too.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1357>
Fix warnings on missing prototypes:
> ../hw/xfree86/os-support/bsd/bsd_VTsw.c:56:20: warning: a function declaration without a prototype is deprecated in all versions of C [-Wstrict-prototypes]
> xf86VTSwitchPending()
> ^
> void
> ../hw/xfree86/os-support/bsd/bsd_VTsw.c:67:17: warning: a function declaration without a prototype is deprecated in all versions of C [-Wstrict-prototypes]
> xf86VTSwitchAway()
> ^
> void
> ../hw/xfree86/os-support/bsd/bsd_VTsw.c:82:15: warning: a function declaration without a prototype is deprecated in all versions of C [-Wstrict-prototypes]
> xf86VTSwitchTo()
> ^
> void
> ../hw/xfree86/os-support/bsd/bsd_init.c:155:16: warning: a function declaration without a prototype is deprecated in all versions of C [-Wstrict-prototypes]
> xf86OpenConsole()
> ^
> void
> ../hw/xfree86/os-support/bsd/bsd_init.c:322:15: warning: a function declaration without a prototype is deprecated in all versions of C [-Wstrict-prototypes]
> xf86OpenPccons()
> ^
> void
> ../hw/xfree86/os-support/bsd/bsd_init.c:347:16: warning: a function declaration without a prototype is deprecated in all versions of C [-Wstrict-prototypes]
> xf86OpenSyscons()
> ^
> void
> ../hw/xfree86/os-support/bsd/bsd_init.c:453:13: warning: a function declaration without a prototype is deprecated in all versions of C [-Wstrict-prototypes]
> xf86OpenPcvt()
> ^
> void
> ../hw/xfree86/os-support/bsd/bsd_init.c:596:17: warning: a function declaration without a prototype is deprecated in all versions of C [-Wstrict-prototypes]
> xf86CloseConsole()
> ^
> void
> ../hw/xfree86/os-support/bsd/bsd_init.c:673:11: warning: a function declaration without a prototype is deprecated in all versions of C [-Wstrict-prototypes]
> xf86UseMsg()
> ^
> void
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1428>
This macro is only used inside xfree86's os-support layer, not by any
(known) drivers. Thus no need to have it exported in the public API.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1456>
It's cleaner to have public headers only holding public stuff and
xf86_os_support seems to be much more appropriate place for this.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1456>