aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/hw/kdrive
diff options
context:
space:
mode:
Diffstat (limited to 'xorg-server/hw/kdrive')
-rw-r--r--xorg-server/hw/kdrive/ephyr/ephyr.c17
-rw-r--r--xorg-server/hw/kdrive/ephyr/ephyr.h4
-rw-r--r--xorg-server/hw/kdrive/ephyr/ephyrinit.c19
-rw-r--r--xorg-server/hw/kdrive/ephyr/hostx.c42
-rw-r--r--xorg-server/hw/kdrive/ephyr/hostx.h4
-rw-r--r--xorg-server/hw/kdrive/ephyr/makefile6
-rw-r--r--xorg-server/hw/kdrive/fake/fakeinit.c14
-rw-r--r--xorg-server/hw/kdrive/sdl/sdl.c11
-rw-r--r--xorg-server/hw/kdrive/src/kdrive.c7
-rw-r--r--xorg-server/hw/kdrive/src/kinput.c27
-rw-r--r--xorg-server/hw/kdrive/src/kmap.c9
-rw-r--r--xorg-server/hw/kdrive/src/makefile20
12 files changed, 171 insertions, 9 deletions
diff --git a/xorg-server/hw/kdrive/ephyr/ephyr.c b/xorg-server/hw/kdrive/ephyr/ephyr.c
index b02f9903c..7c825a3fd 100644
--- a/xorg-server/hw/kdrive/ephyr/ephyr.c
+++ b/xorg-server/hw/kdrive/ephyr/ephyr.c
@@ -61,8 +61,11 @@ Bool EphyrWantGrayScale = 0;
Bool
ephyrInitialize (KdCardInfo *card, EphyrPriv *priv)
{
+#ifdef _MSC_VER
+ __asm int 3;
+#else
OsSignal(SIGUSR1, hostx_handle_signal);
-
+#endif
priv->base = 0;
priv->bytes_per_line = 0;
return TRUE;
@@ -420,8 +423,6 @@ ephyrRandRGetInfo (ScreenPtr pScreen, Rotation *rotations)
Rotation randr;
int n = 0;
- EPHYR_LOG("mark");
-
struct { int width, height; } sizes[] =
{
{ 1600, 1200 },
@@ -442,6 +443,8 @@ ephyrRandRGetInfo (ScreenPtr pScreen, Rotation *rotations)
{ 0, 0 }
};
+ EPHYR_LOG("mark");
+
*rotations = RR_Rotate_All|RR_Reflect_All;
if (!hostx_want_preexisting_window (screen)
@@ -795,21 +798,29 @@ ephyrUpdateModifierState(unsigned int state)
static void
ephyrBlockSigio (void)
{
+#ifdef _MSC_VER
+ __asm int 3;
+#else
sigset_t set;
sigemptyset (&set);
sigaddset (&set, SIGIO);
sigprocmask (SIG_BLOCK, &set, 0);
+#endif
}
static void
ephyrUnblockSigio (void)
{
+#ifdef _MSC_VER
+ __asm int 3;
+#else
sigset_t set;
sigemptyset (&set);
sigaddset (&set, SIGIO);
sigprocmask (SIG_UNBLOCK, &set, 0);
+#endif
}
static Bool
diff --git a/xorg-server/hw/kdrive/ephyr/ephyr.h b/xorg-server/hw/kdrive/ephyr/ephyr.h
index 5d58a216c..dd22bd150 100644
--- a/xorg-server/hw/kdrive/ephyr/ephyr.h
+++ b/xorg-server/hw/kdrive/ephyr/ephyr.h
@@ -26,9 +26,11 @@
#ifndef _EPHYR_H_
#define _EPHYR_H_
#include <stdio.h>
+#ifndef _MSC_VER
#include <unistd.h>
-#include <signal.h>
#include <libgen.h>
+#endif
+#include <signal.h>
#include "os.h" /* for OsSignal() */
#include "kdrive.h"
diff --git a/xorg-server/hw/kdrive/ephyr/ephyrinit.c b/xorg-server/hw/kdrive/ephyr/ephyrinit.c
index 47ddb3d82..005b0baa9 100644
--- a/xorg-server/hw/kdrive/ephyr/ephyrinit.c
+++ b/xorg-server/hw/kdrive/ephyr/ephyrinit.c
@@ -53,6 +53,7 @@ InitCard (char *name)
KdCardInfoAdd (&ephyrFuncs, &attr, 0);
}
+#ifndef _MSC_VER
void
InitOutput (ScreenInfo *pScreenInfo, int argc, char **argv)
{
@@ -114,6 +115,7 @@ ddxUseMsg (void)
exit(1);
}
+#endif
void
processScreenArg (char *screen_size, char *parent_id)
@@ -144,6 +146,7 @@ processScreenArg (char *screen_size, char *parent_id)
}
}
+#ifndef _MSC_VER
int
ddxProcessArgument (int argc, char **argv, int i)
{
@@ -250,6 +253,13 @@ ddxProcessArgument (int argc, char **argv, int i)
return KdProcessArgument (argc, argv, i);
}
+#ifdef DDXBEFORERESET
+void
+ddxBeforeReset (void)
+{
+}
+#endif
+
void
OsVendorInit (void)
{
@@ -264,6 +274,15 @@ OsVendorInit (void)
KdOsInit (&EphyrOsFuncs);
}
+#ifdef DDXOSFATALERROR
+void
+OsVendorFatalError(void)
+{
+}
+#endif
+
+#endif
+
/* 'Fake' cursor stuff, could be improved */
static Bool
diff --git a/xorg-server/hw/kdrive/ephyr/hostx.c b/xorg-server/hw/kdrive/ephyr/hostx.c
index c870a291d..90f0ea64e 100644
--- a/xorg-server/hw/kdrive/ephyr/hostx.c
+++ b/xorg-server/hw/kdrive/ephyr/hostx.c
@@ -43,13 +43,15 @@
#include <stdlib.h>
#include <stdio.h>
-#include <unistd.h>
#include <string.h> /* for memset */
#include <time.h>
+#ifndef _MSC_VER
+#include <unistd.h>
#include <sys/ipc.h>
#include <sys/shm.h>
#include <sys/time.h>
+#endif
#include <X11/Xlib.h>
#include <X11/Xutil.h>
@@ -206,7 +208,11 @@ hostx_add_screen (EphyrScreenInfo screen,
void
hostx_set_display_name (char *name)
{
+#ifdef _MSC_VER
+ __asm int 3;
+#else
HostX.server_dpy_name = strdup (name);
+#endif
}
void
@@ -462,6 +468,9 @@ hostx_init (void)
}
/* Try to get share memory ximages for a little bit more speed */
+#ifdef _MSC_VER
+ __asm int 3;
+#else
if (!XShmQueryExtension(HostX.dpy) || getenv("XEPHYR_NO_SHM"))
{
fprintf(stderr, "\nXephyr unable to use SHM XImages\n");
@@ -492,6 +501,7 @@ hostx_init (void)
shmdt(shminfo.shmaddr);
shmctl(shminfo.shmid, IPC_RMID, 0);
}
+#endif
XFlush(HostX.dpy);
@@ -611,7 +621,7 @@ hostx_screen_init (EphyrScreenInfo screen,
struct EphyrHostScreen *host_screen = host_screen_from_screen_info (screen);
if (!host_screen)
{
- fprintf (stderr, "%s: Error in accessing hostx data\n", __func__ );
+ fprintf (stderr, "%s: Error in accessing hostx data\n", __FUNCTION__ );
exit(1);
}
@@ -626,10 +636,14 @@ hostx_screen_init (EphyrScreenInfo screen,
if (HostX.have_shm)
{
+#ifdef _MSC_VER
+ __asm int 3;
+#else
XShmDetach(HostX.dpy, &host_screen->shminfo);
XDestroyImage (host_screen->ximg);
shmdt(host_screen->shminfo.shmaddr);
shmctl(host_screen->shminfo.shmid, IPC_RMID, 0);
+#endif
}
else
{
@@ -645,6 +659,9 @@ hostx_screen_init (EphyrScreenInfo screen,
if (HostX.have_shm)
{
+#ifdef _MSC_VER
+__asm int 3;
+#else
host_screen->ximg = XShmCreateImage (HostX.dpy, HostX.visual, HostX.depth,
ZPixmap, NULL, &host_screen->shminfo,
width, buffer_height );
@@ -670,6 +687,7 @@ hostx_screen_init (EphyrScreenInfo screen,
XShmAttach(HostX.dpy, &host_screen->shminfo);
shm_success = True;
}
+#endif
}
if (!shm_success)
@@ -798,9 +816,13 @@ hostx_paint_rect (EphyrScreenInfo screen,
if (HostX.have_shm)
{
+#ifdef _MSC_VER
+ __asm int 3;
+#else
XShmPutImage (HostX.dpy, host_screen->win,
HostX.gc, host_screen->ximg,
sx, sy, dx, dy, width, height, False);
+#endif
}
else
{
@@ -816,6 +838,9 @@ hostx_paint_debug_rect (struct EphyrHostScreen *host_screen,
int x, int y,
int width, int height)
{
+#ifdef _MSC_VER
+ __asm int 3;
+#else
struct timespec tspec;
tspec.tv_sec = HostX.damage_debug_msec / (1000000);
@@ -831,6 +856,7 @@ hostx_paint_debug_rect (struct EphyrHostScreen *host_screen,
/* nanosleep seems to work better than usleep for me... */
nanosleep(&tspec, NULL);
+#endif
}
void
@@ -1265,8 +1291,12 @@ hostx_set_window_bounding_rectangles (int a_window,
rects[i].width, rects[i].height) ;
}
/*this aways returns 1*/
+#ifdef _MSC_VER
+ __asm int 3;
+#else
XShapeCombineRectangles (dpy, a_window, ShapeBounding, 0, 0,
rects, a_num_rects, ShapeSet, YXBanded) ;
+#endif
is_ok = TRUE ;
if (rects) {
@@ -1302,8 +1332,12 @@ hostx_set_window_clipping_rectangles (int a_window,
rects[i].width, rects[i].height) ;
}
/*this aways returns 1*/
+#ifdef _MSC_VER
+ __asm int 3;
+#else
XShapeCombineRectangles (dpy, a_window, ShapeClip, 0, 0,
rects, a_num_rects, ShapeSet, YXBanded) ;
+#endif
is_ok = TRUE ;
if (rects) {
@@ -1318,12 +1352,16 @@ int
hostx_has_xshape (void)
{
int event_base=0, error_base=0 ;
+#ifdef _MSC_VER
+ __asm int 3;
+#else
Display *dpy=hostx_get_display () ;
if (!XShapeQueryExtension (dpy,
&event_base,
&error_base)) {
return FALSE ;
}
+#endif
return TRUE;
}
diff --git a/xorg-server/hw/kdrive/ephyr/hostx.h b/xorg-server/hw/kdrive/ephyr/hostx.h
index 47ba61b5b..ba037d511 100644
--- a/xorg-server/hw/kdrive/ephyr/hostx.h
+++ b/xorg-server/hw/kdrive/ephyr/hostx.h
@@ -35,8 +35,12 @@
#define EPHYR_DBG(x, a...) \
fprintf(stderr, __FILE__ ":%d,%s() " x "\n", __LINE__, __func__, ##a)
#else
+#ifdef _MSC_VER
+#define EPHYR_DBG()
+#else
#define EPHYR_DBG(x, a...) do {} while (0)
#endif
+#endif
typedef struct EphyrHostXVars EphyrHostXVars;
typedef struct EphyrHostXEvent EphyrHostXEvent;
diff --git a/xorg-server/hw/kdrive/ephyr/makefile b/xorg-server/hw/kdrive/ephyr/makefile
new file mode 100644
index 000000000..eba9a93e1
--- /dev/null
+++ b/xorg-server/hw/kdrive/ephyr/makefile
@@ -0,0 +1,6 @@
+LIBRARY = libxephyr
+
+CSRCS=ephyrinit.c ephyr.c hostx.c
+
+INCLUDES += ..\src ..\..\..\exa
+
diff --git a/xorg-server/hw/kdrive/fake/fakeinit.c b/xorg-server/hw/kdrive/fake/fakeinit.c
index 2cfcbedd5..9e8372eee 100644
--- a/xorg-server/hw/kdrive/fake/fakeinit.c
+++ b/xorg-server/hw/kdrive/fake/fakeinit.c
@@ -72,12 +72,26 @@ ddxProcessArgument (int argc, char **argv, int i)
return KdProcessArgument (argc, argv, i);
}
+#ifdef DDXBEFORERESET
+void
+ddxBeforeReset (void)
+{
+}
+#endif
+
void
OsVendorInit (void)
{
KdOsInit (&FakeOsFuncs);
}
+#ifdef DDXOSFATALERROR
+void
+OsVendorFatalError(void)
+{
+}
+#endif
+
KdCardFuncs fakeFuncs = {
fakeCardInit, /* cardinit */
fakeScreenInit, /* scrinit */
diff --git a/xorg-server/hw/kdrive/sdl/sdl.c b/xorg-server/hw/kdrive/sdl/sdl.c
index 411b5d4e1..bd8106a27 100644
--- a/xorg-server/hw/kdrive/sdl/sdl.c
+++ b/xorg-server/hw/kdrive/sdl/sdl.c
@@ -369,6 +369,12 @@ int ddxProcessArgument(int argc, char **argv, int i)
return KdProcessArgument(argc, argv, i);
}
+#ifdef DDXBEFORERESET
+void ddxBeforeReset (void)
+{
+}
+#endif
+
void sdlTimer(void)
{
static int buttonState=0;
@@ -452,4 +458,9 @@ void OsVendorInit (void)
KdOsInit (&sdlOsFuncs);
}
+#ifdef DDXOSFATALERROR
+void OsVendorFatalError(void)
+{
+}
+#endif
diff --git a/xorg-server/hw/kdrive/src/kdrive.c b/xorg-server/hw/kdrive/src/kdrive.c
index e2ee4adea..3e739b8ec 100644
--- a/xorg-server/hw/kdrive/src/kdrive.c
+++ b/xorg-server/hw/kdrive/src/kdrive.c
@@ -340,6 +340,7 @@ KdProcessSwitch (void)
KdEnableScreens ();
}
+#ifndef _MSC_VER
void
AbortDDX(void)
{
@@ -362,6 +363,7 @@ ddxGiveUp ()
{
AbortDDX ();
}
+#endif
Bool kdDumbDriver;
Bool kdSoftCursor;
@@ -1394,6 +1396,7 @@ KdInitOutput (ScreenInfo *pScreenInfo,
}
#ifdef DPMSExtension
+#ifndef _MSC_VER
int
DPMSSet(ClientPtr client, int level)
{
@@ -1411,6 +1414,8 @@ DPMSSupported (void)
return FALSE;
}
#endif
+#endif
+#ifndef _MSC_VER
void ddxInitGlobals(void) { /* THANK YOU XPRINT */ }
-
+#endif
diff --git a/xorg-server/hw/kdrive/src/kinput.c b/xorg-server/hw/kdrive/src/kinput.c
index 9ba11661c..b1b04fa52 100644
--- a/xorg-server/hw/kdrive/src/kinput.c
+++ b/xorg-server/hw/kdrive/src/kinput.c
@@ -110,21 +110,29 @@ KdSigio (int sig)
static void
KdBlockSigio (void)
{
+#ifdef _MSC_VER
+ __asm int 3;
+#else
sigset_t set;
sigemptyset (&set);
sigaddset (&set, SIGIO);
sigprocmask (SIG_BLOCK, &set, 0);
+#endif
}
static void
KdUnblockSigio (void)
{
+#ifdef _MSC_VER
+ __asm int 3;
+#else
sigset_t set;
sigemptyset (&set);
sigaddset (&set, SIGIO);
sigprocmask (SIG_UNBLOCK, &set, 0);
+#endif
}
#ifdef DEBUG_SIGIO
@@ -170,15 +178,22 @@ KdResetInputMachine (void)
static void
KdNonBlockFd (int fd)
{
+#ifdef _MSC_VER
+ __asm int 3;
+#else
int flags;
flags = fcntl (fd, F_GETFL);
flags |= FASYNC|NOBLOCK;
fcntl (fd, F_SETFL, flags);
+#endif
}
static void
KdAddFd (int fd)
{
+#ifdef _MSC_VER
+ __asm int 3;
+#else
struct sigaction act;
sigset_t set;
@@ -195,11 +210,15 @@ KdAddFd (int fd)
sigaction (SIGIO, &act, 0);
sigemptyset (&set);
sigprocmask (SIG_SETMASK, &set, 0);
+#endif
}
static void
KdRemoveFd (int fd)
{
+#ifdef _MSC_VER
+ __asm int 3;
+#else
struct sigaction act;
int flags;
@@ -215,6 +234,7 @@ KdRemoveFd (int fd)
sigemptyset (&act.sa_mask);
sigaction (SIGIO, &act, 0);
}
+#endif
}
Bool
@@ -513,11 +533,13 @@ KdPointerProc(DeviceIntPtr pDevice, int onoff)
return BadImplementation;
}
+#ifndef _MSC_VER
Bool
LegalModifier(unsigned int key, DeviceIntPtr pDev)
{
return TRUE;
}
+#endif
static void
KdBell (int volume, DeviceIntPtr pDev, pointer arg, int something)
@@ -536,6 +558,7 @@ KdBell (int volume, DeviceIntPtr pDev, pointer arg, int something)
KdRingBell(ki, volume, ctrl->bell_pitch, ctrl->bell_duration);
}
+#ifndef _MSC_VER
void
DDXRingBell(int volume, int pitch, int duration)
{
@@ -551,7 +574,7 @@ DDXRingBell(int volume, int pitch, int duration)
}
}
}
-
+#endif
void
KdRingBell(KdKeyboardInfo *ki, int volume, int pitch, int duration)
{
@@ -2345,6 +2368,7 @@ miPointerScreenFuncRec kdPointerScreenFuncs =
KdWarpCursor
};
+#ifndef _MSC_VER
void
ProcessInputEvents ()
{
@@ -2354,6 +2378,7 @@ ProcessInputEvents ()
KdProcessSwitch ();
KdCheckLock ();
}
+#endif
/* FIXME use XSECURITY to work out whether the client should be allowed to
* open and close. */
diff --git a/xorg-server/hw/kdrive/src/kmap.c b/xorg-server/hw/kdrive/src/kmap.c
index ce1e28ae4..0762e72af 100644
--- a/xorg-server/hw/kdrive/src/kmap.c
+++ b/xorg-server/hw/kdrive/src/kmap.c
@@ -24,6 +24,7 @@
#include "kdrive.h"
#include <errno.h>
+#ifndef _MSC_VER
#include <unistd.h>
#include <sys/mman.h>
#ifdef HAVE_ASM_MTRR_H
@@ -31,6 +32,9 @@
#endif
#include <sys/ioctl.h>
+#else
+#define DRAW_DEBUG(a)
+#endif
void *
KdMapDevice (CARD32 addr, CARD32 size)
@@ -39,7 +43,8 @@ KdMapDevice (CARD32 addr, CARD32 size)
void *a;
void *d;
- d = VirtualAlloc (NULL, size, MEM_RESERVE, PAGE_NOACCESS);
+ d = VirtualAlloc (NULL, size, MEM_RESERVE, PAGE_READWRITE|PAGE_NOCACHE);
+/*
if (!d)
return NULL;
DRAW_DEBUG ((DEBUG_S3INIT, "Virtual address of 0x%x is 0x%x", addr, d));
@@ -53,6 +58,8 @@ KdMapDevice (CARD32 addr, CARD32 size)
return NULL;
}
DRAW_DEBUG ((DEBUG_S3INIT, "Device mapped successfully"));
+*/
+ __asm int 3;
return d;
#endif
#ifdef linux
diff --git a/xorg-server/hw/kdrive/src/makefile b/xorg-server/hw/kdrive/src/makefile
new file mode 100644
index 000000000..1400d0427
--- /dev/null
+++ b/xorg-server/hw/kdrive/src/makefile
@@ -0,0 +1,20 @@
+LIBRARY = libkdrive
+
+CSRCS = kaa.c \
+ kaapict.c \
+ kasync.c \
+ kcmap.c \
+ kcurscol.c \
+ kinfo.c \
+ kkeymap.c \
+ kmap.c \
+ kmode.c \
+ knoop.c \
+ koffscreen.c \
+ kshadow.c \
+ kinput.c \
+ kdrive.c \
+ ktest.c
+
+
+