diff options
Diffstat (limited to 'xorg-server/hw/kdrive')
-rw-r--r-- | xorg-server/hw/kdrive/ephyr/ephyr.c | 13 | ||||
-rw-r--r-- | xorg-server/hw/kdrive/ephyr/ephyr.h | 4 | ||||
-rw-r--r-- | xorg-server/hw/kdrive/ephyr/ephyrinit.c | 19 | ||||
-rw-r--r-- | xorg-server/hw/kdrive/ephyr/ephyrlog.h | 4 | ||||
-rw-r--r-- | xorg-server/hw/kdrive/ephyr/hostx.c | 40 | ||||
-rw-r--r-- | xorg-server/hw/kdrive/ephyr/hostx.h | 4 | ||||
-rw-r--r-- | xorg-server/hw/kdrive/ephyr/makefile | 6 | ||||
-rw-r--r-- | xorg-server/hw/kdrive/fake/fakeinit.c | 14 | ||||
-rw-r--r-- | xorg-server/hw/kdrive/sdl/sdl.c | 11 | ||||
-rw-r--r-- | xorg-server/hw/kdrive/src/kdrive.c | 6 | ||||
-rw-r--r-- | xorg-server/hw/kdrive/src/kinput.c | 27 | ||||
-rw-r--r-- | xorg-server/hw/kdrive/src/kmap.c | 9 | ||||
-rw-r--r-- | xorg-server/hw/kdrive/src/makefile | 15 |
13 files changed, 165 insertions, 7 deletions
diff --git a/xorg-server/hw/kdrive/ephyr/ephyr.c b/xorg-server/hw/kdrive/ephyr/ephyr.c index 296284a01..947a7ff1b 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; @@ -817,21 +820,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 22152ffe0..27c346dd1 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) { @@ -115,6 +116,7 @@ ddxUseMsg (void) exit(1); } +#endif void processScreenArg (char *screen_size, char *parent_id) @@ -145,6 +147,7 @@ processScreenArg (char *screen_size, char *parent_id) } } +#ifndef _MSC_VER int ddxProcessArgument (int argc, char **argv, int i) { @@ -285,6 +288,13 @@ ddxProcessArgument (int argc, char **argv, int i) return KdProcessArgument (argc, argv, i); } +#ifdef DDXBEFORERESET +void +ddxBeforeReset (void) +{ +} +#endif + void OsVendorInit (void) { @@ -299,6 +309,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/ephyrlog.h b/xorg-server/hw/kdrive/ephyr/ephyrlog.h index a07a0a097..ba52a3bce 100644 --- a/xorg-server/hw/kdrive/ephyr/ephyrlog.h +++ b/xorg-server/hw/kdrive/ephyr/ephyrlog.h @@ -43,14 +43,14 @@ #ifndef EPHYR_LOG #define EPHYR_LOG(...) \ LogMessageVerb(X_NOTICE, INFO_LOG_LEVEL, "in %s:%d:%s: ",\ - __FILE__, __LINE__, __func__) ; \ + __FILE__, __LINE__, __FUNCTION__) ; \ LogMessageVerb(X_NOTICE, INFO_LOG_LEVEL, __VA_ARGS__) #endif /*nomadik_log*/ #ifndef EPHYR_LOG_ERROR #define EPHYR_LOG_ERROR(...) \ LogMessageVerb(X_NOTICE, ERROR_LOG_LEVEL, "Error:in %s:%d:%s: ",\ - __FILE__, __LINE__, __func__) ; \ + __FILE__, __LINE__, __FUNCTION__) ; \ LogMessageVerb(X_NOTICE, ERROR_LOG_LEVEL, __VA_ARGS__) #endif /*EPHYR_LOG_ERROR*/ diff --git a/xorg-server/hw/kdrive/ephyr/hostx.c b/xorg-server/hw/kdrive/ephyr/hostx.c index d546370ba..7a828eb31 100644 --- a/xorg-server/hw/kdrive/ephyr/hostx.c +++ b/xorg-server/hw/kdrive/ephyr/hostx.c @@ -47,9 +47,11 @@ #include <string.h> /* for memset */ #include <time.h> +#ifndef _MSC_VER #include <sys/ipc.h> #include <sys/shm.h> #include <sys/time.h> +#endif #include <X11/Xlib.h> #include <X11/Xutil.h> @@ -208,7 +210,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 @@ -475,6 +481,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"); @@ -505,6 +514,7 @@ hostx_init (void) shmdt(shminfo.shmaddr); shmctl(shminfo.shmid, IPC_RMID, 0); } +#endif XFlush(HostX.dpy); @@ -647,7 +657,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); } @@ -662,10 +672,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 { @@ -681,6 +695,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 ); @@ -706,6 +723,7 @@ hostx_screen_init (EphyrScreenInfo screen, XShmAttach(HostX.dpy, &host_screen->shminfo); shm_success = True; } +#endif } if (!shm_success) @@ -834,9 +852,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 { @@ -852,6 +874,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); @@ -867,6 +892,7 @@ hostx_paint_debug_rect (struct EphyrHostScreen *host_screen, /* nanosleep seems to work better than usleep for me... */ nanosleep(&tspec, NULL); +#endif } void @@ -1288,8 +1314,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) { @@ -1325,8 +1355,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) { @@ -1341,12 +1375,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 e65e0c9bc..f455b3003 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 5cfe54ff8..f79b96f6f 100644 --- a/xorg-server/hw/kdrive/src/kdrive.c +++ b/xorg-server/hw/kdrive/src/kdrive.c @@ -321,6 +321,7 @@ KdProcessSwitch (void) KdEnableScreens (); } +#ifndef _MSC_VER void AbortDDX(void) { @@ -343,6 +344,7 @@ ddxGiveUp (void) { AbortDDX (); } +#endif Bool kdDumbDriver; Bool kdSoftCursor; @@ -1310,11 +1312,14 @@ KdInitOutput (ScreenInfo *pScreenInfo, OsRegisterSigWrapper(KdSignalWrapper); } +#ifndef _MSC_VER void OsVendorFatalError(void) { } +#endif +#ifndef _MSC_VER int DPMSSet(ClientPtr client, int level) { @@ -1326,3 +1331,4 @@ DPMSSupported (void) { return FALSE; } +#endif diff --git a/xorg-server/hw/kdrive/src/kinput.c b/xorg-server/hw/kdrive/src/kinput.c index 318d233d4..58b8f2ba9 100644 --- a/xorg-server/hw/kdrive/src/kinput.c +++ b/xorg-server/hw/kdrive/src/kinput.c @@ -104,21 +104,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 @@ -164,15 +172,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; @@ -189,11 +204,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; @@ -209,6 +228,7 @@ KdRemoveFd (int fd) sigemptyset (&act.sa_mask); sigaction (SIGIO, &act, 0); } +#endif } Bool @@ -546,11 +566,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) @@ -569,6 +591,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) { @@ -584,7 +607,7 @@ DDXRingBell(int volume, int pitch, int duration) } } } - +#endif void KdRingBell(KdKeyboardInfo *ki, int volume, int pitch, int duration) { @@ -2175,6 +2198,7 @@ miPointerScreenFuncRec kdPointerScreenFuncs = KdWarpCursor }; +#ifndef _MSC_VER void ProcessInputEvents (void) { @@ -2184,6 +2208,7 @@ ProcessInputEvents (void) 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 60e8ae134..a10c9ec09 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..db710ec4f --- /dev/null +++ b/xorg-server/hw/kdrive/src/makefile @@ -0,0 +1,15 @@ +LIBRARY = libkdrive + +CSRCS = \ + kcmap.c \ + kcurscol.c \ + kinfo.c \ + kkeymap.c \ + kmap.c \ + kmode.c \ + kshadow.c \ + kinput.c \ + kdrive.c + + + |