mirror of
https://github.com/X11Libre/xserver.git
synced 2026-11-23 06:43:07 +00:00
kdrive: Add a proper header for the linux drivers
Stop declaring `extern` variables/functions throught the code. Move ddxInit out of the linux driver code. Signed-off-by: stefan11111 <stefan11111github@gmail.com>
This commit is contained in:
parent
b6384684a1
commit
08c5985cac
5 changed files with 49 additions and 39 deletions
|
|
@ -21,6 +21,7 @@
|
|||
*/
|
||||
|
||||
#include <kdrive-config.h>
|
||||
#include "klinux.h"
|
||||
#include "fbdev.h"
|
||||
|
||||
#include "dix/dix_priv.h"
|
||||
|
|
@ -55,10 +56,8 @@ static const FbScreenConf fbDefaultConfig = {
|
|||
|
||||
static void fbdevLogScreenInfo(const FbScreenConf *config, int screen_num);
|
||||
|
||||
void LinuxLogInit(void);
|
||||
|
||||
void
|
||||
LinuxLogInit(void)
|
||||
static void
|
||||
FbdevLogInit(void)
|
||||
{
|
||||
KdCardInfo *curr_card = kdCardInfo;
|
||||
char *log_file = NULL;
|
||||
|
|
@ -151,7 +150,7 @@ InitOutput(int argc, char **argv)
|
|||
void
|
||||
InitInput(int argc, char **argv)
|
||||
{
|
||||
KdOsAddInputDrivers();
|
||||
LinuxAddInputDrivers();
|
||||
KdAddConfigInputDrivers();
|
||||
KdInitInput();
|
||||
}
|
||||
|
|
@ -307,6 +306,12 @@ ddxProcessArgument(int argc, char **argv, int i)
|
|||
return KdProcessArgument(argc, argv, i);
|
||||
}
|
||||
|
||||
void ddxInit(void)
|
||||
{
|
||||
FbdevLogInit();
|
||||
KdOsInit(&LinuxFuncs);
|
||||
}
|
||||
|
||||
KdCardFuncs fbdevFuncs = {
|
||||
.cardinit = fbdevCardInit,
|
||||
.scrinit = fbdevScreenInit,
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@
|
|||
*/
|
||||
|
||||
#include <kdrive-config.h>
|
||||
#include "kdrive.h"
|
||||
#include "klinux.h"
|
||||
#include <linux/keyboard.h>
|
||||
#include <linux/kd.h>
|
||||
#define XK_PUBLISHING
|
||||
|
|
@ -41,8 +41,6 @@
|
|||
|
||||
#include "os/xserver_poll.h"
|
||||
|
||||
extern int LinuxConsoleFd;
|
||||
|
||||
/*
|
||||
* We need these to handle extended scancodes correctly (I could just use the
|
||||
* numbers below, but this makes the code more readable
|
||||
|
|
|
|||
36
hw/kdrive/linux/klinux.h
Normal file
36
hw/kdrive/linux/klinux.h
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
/* SPDX-License-Identifier: MIT OR X11
|
||||
*
|
||||
* Copyright © 2026 stefan11111 <stefan11111github@gmail.com>
|
||||
*/
|
||||
|
||||
#ifndef _KLINUX_H_
|
||||
#define _KLINUX_H_
|
||||
|
||||
#include "kdrive.h"
|
||||
|
||||
#ifdef KDRIVE_MOUSE
|
||||
extern KdPointerDriver LinuxMouseDriver;
|
||||
extern KdPointerDriver Ps2MouseDriver;
|
||||
extern KdPointerDriver MsMouseDriver;
|
||||
extern KdPointerDriver BusMouseDriver;
|
||||
#endif
|
||||
#ifdef KDRIVE_TSLIB
|
||||
extern KdPointerDriver TsDriver;
|
||||
#endif
|
||||
#ifdef KDRIVE_EVDEV
|
||||
extern KdPointerDriver LinuxEvdevMouseDriver;
|
||||
extern KdKeyboardDriver LinuxEvdevKeyboardDriver;
|
||||
#endif
|
||||
#ifdef KDRIVE_KBD
|
||||
extern KdKeyboardDriver LinuxKeyboardDriver;
|
||||
#endif
|
||||
|
||||
extern int LinuxConsoleFd;
|
||||
extern int LinuxApmFd;
|
||||
|
||||
extern KdOsFuncs LinuxFuncs;
|
||||
|
||||
/* Register the linux input drivers */
|
||||
void LinuxAddInputDrivers(void);
|
||||
|
||||
#endif /* _KLINUX_H_ */
|
||||
|
|
@ -21,7 +21,7 @@
|
|||
*/
|
||||
|
||||
#include <kdrive-config.h>
|
||||
#include "kdrive.h"
|
||||
#include "klinux.h"
|
||||
#include <errno.h>
|
||||
#include <linux/vt.h>
|
||||
#include <linux/kd.h>
|
||||
|
|
@ -31,27 +31,6 @@
|
|||
#include <linux/apm_bios.h>
|
||||
|
||||
#include "os/osdep.h"
|
||||
#include "os/ddx_priv.h"
|
||||
|
||||
#ifdef KDRIVE_MOUSE
|
||||
extern KdPointerDriver LinuxMouseDriver;
|
||||
extern KdPointerDriver Ps2MouseDriver;
|
||||
extern KdPointerDriver MsMouseDriver;
|
||||
extern KdPointerDriver BusMouseDriver;
|
||||
#endif
|
||||
#ifdef KDRIVE_TSLIB
|
||||
extern KdPointerDriver TsDriver;
|
||||
#endif
|
||||
#ifdef KDRIVE_EVDEV
|
||||
extern KdPointerDriver LinuxEvdevMouseDriver;
|
||||
extern KdKeyboardDriver LinuxEvdevKeyboardDriver;
|
||||
#endif
|
||||
#ifdef KDRIVE_KBD
|
||||
extern KdKeyboardDriver LinuxKeyboardDriver;
|
||||
#endif
|
||||
|
||||
/* Implemented by the X server */
|
||||
extern void LinuxLogInit(void);
|
||||
|
||||
static int vtno;
|
||||
int LinuxConsoleFd;
|
||||
|
|
@ -335,7 +314,7 @@ LinuxFini(void)
|
|||
}
|
||||
|
||||
void
|
||||
KdOsAddInputDrivers(void)
|
||||
LinuxAddInputDrivers(void)
|
||||
{
|
||||
#ifdef KDRIVE_MOUSE
|
||||
KdAddPointerDriver(&LinuxMouseDriver);
|
||||
|
|
@ -371,9 +350,3 @@ KdOsFuncs LinuxFuncs = {
|
|||
.Fini = LinuxFini,
|
||||
.Bell = LinuxBell,
|
||||
};
|
||||
|
||||
void ddxInit(void)
|
||||
{
|
||||
LinuxLogInit();
|
||||
KdOsInit(&LinuxFuncs);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -427,8 +427,6 @@ int
|
|||
*/
|
||||
void KdOsInit(const KdOsFuncs * pOsFuncs);
|
||||
|
||||
void
|
||||
KdOsAddInputDrivers(void);
|
||||
|
||||
Bool KdCreateScreenResources(ScreenPtr pScreen);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue