-Wall fixes. Add klinux.h to export function declarations
This commit is contained in:
parent
a398339b6d
commit
777f31cd0b
|
@ -39,7 +39,6 @@ void
|
||||||
BusRead (int adbPort, void *closure)
|
BusRead (int adbPort, void *closure)
|
||||||
{
|
{
|
||||||
unsigned char buf[3];
|
unsigned char buf[3];
|
||||||
unsigned char *b;
|
|
||||||
int n;
|
int n;
|
||||||
int dx, dy;
|
int dx, dy;
|
||||||
unsigned long flags;
|
unsigned long flags;
|
||||||
|
|
|
@ -406,7 +406,6 @@ LinuxKeyboardEnable (int fd, void *closure)
|
||||||
struct termios nTty;
|
struct termios nTty;
|
||||||
unsigned char buf[256];
|
unsigned char buf[256];
|
||||||
int n;
|
int n;
|
||||||
int flags;
|
|
||||||
|
|
||||||
ioctl (fd, KDGKBMODE, &LinuxKbdTrans);
|
ioctl (fd, KDGKBMODE, &LinuxKbdTrans);
|
||||||
tcgetattr (fd, &LinuxTermios);
|
tcgetattr (fd, &LinuxTermios);
|
||||||
|
|
|
@ -0,0 +1,34 @@
|
||||||
|
/*
|
||||||
|
* $Id$
|
||||||
|
*
|
||||||
|
* Copyright © 2003 Keith Packard
|
||||||
|
*
|
||||||
|
* Permission to use, copy, modify, distribute, and sell this software and its
|
||||||
|
* documentation for any purpose is hereby granted without fee, provided that
|
||||||
|
* the above copyright notice appear in all copies and that both that
|
||||||
|
* copyright notice and this permission notice appear in supporting
|
||||||
|
* documentation, and that the name of Keith Packard not be used in
|
||||||
|
* advertising or publicity pertaining to distribution of the software without
|
||||||
|
* specific, written prior permission. Keith Packard makes no
|
||||||
|
* representations about the suitability of this software for any purpose. It
|
||||||
|
* is provided "as is" without express or implied warranty.
|
||||||
|
*
|
||||||
|
* KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
|
||||||
|
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
|
||||||
|
* EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
|
||||||
|
* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
|
||||||
|
* DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
|
||||||
|
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
||||||
|
* PERFORMANCE OF THIS SOFTWARE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef _KLINUX_H_
|
||||||
|
#define _KLINUX_H_
|
||||||
|
|
||||||
|
Bool
|
||||||
|
LinuxFindPci (CARD16 vendor, CARD16 device, CARD32 count, KdCardAttr *attr);
|
||||||
|
|
||||||
|
unsigned char *
|
||||||
|
LinuxGetPciCfg(KdCardAttr *attr);
|
||||||
|
|
||||||
|
#endif /* _KLINUX_H_ */
|
|
@ -26,6 +26,7 @@
|
||||||
#include <config.h>
|
#include <config.h>
|
||||||
#endif
|
#endif
|
||||||
#include "kdrive.h"
|
#include "kdrive.h"
|
||||||
|
#include "klinux.h"
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
#include <linux/vt.h>
|
#include <linux/vt.h>
|
||||||
|
@ -41,14 +42,14 @@ int LinuxApmFd = -1;
|
||||||
static int activeVT;
|
static int activeVT;
|
||||||
static Bool enabled;
|
static Bool enabled;
|
||||||
|
|
||||||
void
|
static void
|
||||||
LinuxVTRequest (int sig)
|
LinuxVTRequest (int sig)
|
||||||
{
|
{
|
||||||
kdSwitchPending = TRUE;
|
kdSwitchPending = TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Check before chowning -- this avoids touching the file system */
|
/* Check before chowning -- this avoids touching the file system */
|
||||||
void
|
static void
|
||||||
LinuxCheckChown (char *file)
|
LinuxCheckChown (char *file)
|
||||||
{
|
{
|
||||||
struct stat st;
|
struct stat st;
|
||||||
|
@ -63,13 +64,12 @@ LinuxCheckChown (char *file)
|
||||||
chown (file, u, g);
|
chown (file, u, g);
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
static int
|
||||||
LinuxInit ()
|
LinuxInit ()
|
||||||
{
|
{
|
||||||
int i, fd;
|
int fd = -1;
|
||||||
char vtname[11];
|
char vtname[11];
|
||||||
struct vt_stat vts;
|
struct vt_stat vts;
|
||||||
struct stat statb;
|
|
||||||
|
|
||||||
LinuxConsoleFd = -1;
|
LinuxConsoleFd = -1;
|
||||||
/* check if we're run with euid==0 */
|
/* check if we're run with euid==0 */
|
||||||
|
@ -131,7 +131,7 @@ LinuxFindPci (CARD16 vendor, CARD16 device, CARD32 count, KdCardAttr *attr)
|
||||||
{
|
{
|
||||||
FILE *f;
|
FILE *f;
|
||||||
char line[2048], *l, *end;
|
char line[2048], *l, *end;
|
||||||
CARD32 bus, id, mode, addr;
|
CARD32 bus, id, addr;
|
||||||
int n;
|
int n;
|
||||||
CARD32 ven_dev;
|
CARD32 ven_dev;
|
||||||
Bool ret = FALSE;
|
Bool ret = FALSE;
|
||||||
|
@ -194,7 +194,8 @@ LinuxFindPci (CARD16 vendor, CARD16 device, CARD32 count, KdCardAttr *attr)
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned char *
|
unsigned char *
|
||||||
LinuxGetPciCfg(KdCardAttr *attr) {
|
LinuxGetPciCfg(KdCardAttr *attr)
|
||||||
|
{
|
||||||
char filename[256];
|
char filename[256];
|
||||||
FILE *f;
|
FILE *f;
|
||||||
unsigned char *cfg;
|
unsigned char *cfg;
|
||||||
|
@ -224,7 +225,7 @@ LinuxGetPciCfg(KdCardAttr *attr) {
|
||||||
return cfg;
|
return cfg;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
static void
|
||||||
LinuxSetSwitchMode (int mode)
|
LinuxSetSwitchMode (int mode)
|
||||||
{
|
{
|
||||||
struct sigaction act;
|
struct sigaction act;
|
||||||
|
@ -263,14 +264,14 @@ LinuxSetSwitchMode (int mode)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
static void
|
||||||
LinuxApmBlock (pointer blockData, OSTimePtr pTimeout, pointer pReadmask)
|
LinuxApmBlock (pointer blockData, OSTimePtr pTimeout, pointer pReadmask)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
static Bool LinuxApmRunning;
|
static Bool LinuxApmRunning;
|
||||||
|
|
||||||
void
|
static void
|
||||||
LinuxApmWakeup (pointer blockData, int result, pointer pReadmask)
|
LinuxApmWakeup (pointer blockData, int result, pointer pReadmask)
|
||||||
{
|
{
|
||||||
fd_set *readmask = (fd_set *) pReadmask;
|
fd_set *readmask = (fd_set *) pReadmask;
|
||||||
|
@ -322,7 +323,7 @@ LinuxApmWakeup (pointer blockData, int result, pointer pReadmask)
|
||||||
#define NOBLOCK FNDELAY
|
#define NOBLOCK FNDELAY
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void
|
static void
|
||||||
LinuxEnable (void)
|
LinuxEnable (void)
|
||||||
{
|
{
|
||||||
if (enabled)
|
if (enabled)
|
||||||
|
@ -364,7 +365,7 @@ LinuxEnable (void)
|
||||||
enabled = TRUE;
|
enabled = TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
Bool
|
static Bool
|
||||||
LinuxSpecialKey (KeySym sym)
|
LinuxSpecialKey (KeySym sym)
|
||||||
{
|
{
|
||||||
struct vt_stat vts;
|
struct vt_stat vts;
|
||||||
|
@ -383,7 +384,7 @@ LinuxSpecialKey (KeySym sym)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
static void
|
||||||
LinuxDisable (void)
|
LinuxDisable (void)
|
||||||
{
|
{
|
||||||
ioctl(LinuxConsoleFd, KDSETMODE, KD_TEXT); /* Back to text mode ... */
|
ioctl(LinuxConsoleFd, KDSETMODE, KD_TEXT); /* Back to text mode ... */
|
||||||
|
@ -402,7 +403,7 @@ LinuxDisable (void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
static void
|
||||||
LinuxFini (void)
|
LinuxFini (void)
|
||||||
{
|
{
|
||||||
struct vt_mode VT;
|
struct vt_mode VT;
|
||||||
|
|
|
@ -94,7 +94,6 @@ MouseFlush (Kbufio *b, char *buf, int size)
|
||||||
{
|
{
|
||||||
CARD32 now = GetTimeInMillis ();
|
CARD32 now = GetTimeInMillis ();
|
||||||
CARD32 done = now + 100;
|
CARD32 done = now + 100;
|
||||||
int p = 0;
|
|
||||||
int c;
|
int c;
|
||||||
int n = 0;
|
int n = 0;
|
||||||
|
|
||||||
|
@ -434,7 +433,7 @@ static int
|
||||||
ps2SkipInit (KdMouseInfo *mi, int ninit, Bool ret_next)
|
ps2SkipInit (KdMouseInfo *mi, int ninit, Bool ret_next)
|
||||||
{
|
{
|
||||||
Kmouse *km = mi->driver;
|
Kmouse *km = mi->driver;
|
||||||
int c;
|
int c = -1;
|
||||||
int skipping;
|
int skipping;
|
||||||
Bool waiting;
|
Bool waiting;
|
||||||
|
|
||||||
|
@ -465,7 +464,6 @@ static Bool
|
||||||
ps2Init (KdMouseInfo *mi)
|
ps2Init (KdMouseInfo *mi)
|
||||||
{
|
{
|
||||||
Kmouse *km = mi->driver;
|
Kmouse *km = mi->driver;
|
||||||
int c;
|
|
||||||
int skipping;
|
int skipping;
|
||||||
Bool waiting;
|
Bool waiting;
|
||||||
int id;
|
int id;
|
||||||
|
@ -507,6 +505,7 @@ ps2Init (KdMouseInfo *mi)
|
||||||
* skipped
|
* skipped
|
||||||
*/
|
*/
|
||||||
(void) ps2SkipInit (mi, ninit, FALSE);
|
(void) ps2SkipInit (mi, ninit, FALSE);
|
||||||
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static Bool busParse (KdMouseInfo *mi, unsigned char *ev, int ne)
|
static Bool busParse (KdMouseInfo *mi, unsigned char *ev, int ne)
|
||||||
|
@ -584,13 +583,12 @@ static const KmouseProt msProt = {
|
||||||
static Bool logiComplete (KdMouseInfo *mi, unsigned char *ev, int ne)
|
static Bool logiComplete (KdMouseInfo *mi, unsigned char *ev, int ne)
|
||||||
{
|
{
|
||||||
Kmouse *km = mi->driver;
|
Kmouse *km = mi->driver;
|
||||||
const KmouseProt *prot = km->prot;
|
|
||||||
int c;
|
|
||||||
|
|
||||||
if ((ev[0] & 0x40) == 0x40)
|
if ((ev[0] & 0x40) == 0x40)
|
||||||
return ne == 3;
|
return ne == 3;
|
||||||
if (km->stage != MouseBroken && (ev[0] & ~0x23) == 0)
|
if (km->stage != MouseBroken && (ev[0] & ~0x23) == 0)
|
||||||
return ne == 1;
|
return ne == 1;
|
||||||
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int logiValid (KdMouseInfo *mi, unsigned char *ev, int ne)
|
static int logiValid (KdMouseInfo *mi, unsigned char *ev, int ne)
|
||||||
|
@ -880,6 +878,8 @@ MouseRead (int mousePort, void *closure)
|
||||||
km->stage = MouseBroken;
|
km->stage = MouseBroken;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case MouseWorking:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -911,14 +911,13 @@ char *kdefaultMouse[] = {
|
||||||
|
|
||||||
#define NUM_DEFAULT_MOUSE (sizeof (kdefaultMouse) / sizeof (kdefaultMouse[0]))
|
#define NUM_DEFAULT_MOUSE (sizeof (kdefaultMouse) / sizeof (kdefaultMouse[0]))
|
||||||
|
|
||||||
int
|
Bool
|
||||||
MouseInit (void)
|
MouseInit (void)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
int fd;
|
int fd;
|
||||||
Kmouse *km;
|
Kmouse *km;
|
||||||
KdMouseInfo *mi, *next;
|
KdMouseInfo *mi, *next;
|
||||||
KmouseProt *mp;
|
|
||||||
int n = 0;
|
int n = 0;
|
||||||
char *prot;
|
char *prot;
|
||||||
|
|
||||||
|
@ -966,6 +965,7 @@ MouseInit (void)
|
||||||
close (fd);
|
close (fd);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
|
@ -79,7 +79,6 @@ Ps2Read (int ps2Port, void *closure)
|
||||||
int n;
|
int n;
|
||||||
int dx, dy;
|
int dx, dy;
|
||||||
unsigned long flags;
|
unsigned long flags;
|
||||||
int id = (int) closure;
|
|
||||||
unsigned long left_button = KD_BUTTON_1;
|
unsigned long left_button = KD_BUTTON_1;
|
||||||
unsigned long right_button = KD_BUTTON_3;
|
unsigned long right_button = KD_BUTTON_3;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue