Re: [Xf4vnc-devel] ARM fixes
Brought to you by:
alanh
From: Alan H. <al...@fa...> - 2007-01-15 14:13:54
|
Thanks, i'll get this committed. Alan. On Mon, 2007-01-15 at 17:06 +1100, Paul Whittaker wrote: > I'm very glad to hear that XF4VNC is not dead - I've been happily using > it ever since XFree86 4.3.0, and was worried that I would have to switch > to the RealVNC equivalent when the day came that vnc.so no longer worked > with the latest Xorg. It's the support for Tight encoding that I find > particularly appealing. > > I have just successfully compiled XF4VNC under Debian Etch on an ARM > platform, and in the highly unlikely event that anyone ever follows in > my footsteps, a couple of tweaks are necessary: > > 1) In the monolithic XF4VNC tree, xc/lib/VncExt/Vnc.c wants to include > Xlibint.h, but this is not provided in the distribution, and compilation > fails with copious errors when gcc tries to use an incompatible > /usr/include/X11/Xlibint.h (from Xorg 7.1 in this case). Suggest that > you include copies of Xlib.h and Xlibint.h of the appropriate vintage > (XFree86 4.3.99 or whatever) in the monolithic tree. > > 2) xc/programs/Xserver/hw/xfree86/common/compiler.h needs a minor tweak > for the ARM architecture to prevent collision with glibc inb(), outb() > etc calls. I have attached a patch featuring code shamelessly pilfered > from Xorg 6.9.0. > > I was actually compiling using an old (2005) CVS snapshot rather than > the latest, but have checked the current CVS and it apparently still has > these problems. > > plain text document attachment (xf4vnc-cvs-arm.diff) > --- xc/programs/Xserver/hw/xfree86/common/compiler.h.orig 2007-01-14 08:25:15.000000000 +1100 > +++ xc/programs/Xserver/hw/xfree86/common/compiler.h 2007-01-14 10:26:21.000000000 +1100 > @@ -114,7 +114,8 @@ > > # if defined(NO_INLINE) || defined(DO_PROTOTYPES) > > -# if !defined(__sparc__) && !defined(__arm32__) \ > +# if !defined(__arm__) > +# if !defined(__sparc__) && !defined(__arm32__) \ > && !(defined(__alpha__) && defined(linux)) > > extern void outb(unsigned short, unsigned char); > @@ -124,7 +125,7 @@ > extern unsigned int inw(unsigned short); > extern unsigned int inl(unsigned short); > > -# else /* __sparc__, __arm32__, __alpha__*/ > +# else /* __sparc__, __arm32__, __alpha__*/ > > extern void outb(unsigned long, unsigned char); > extern void outw(unsigned long, unsigned short); > @@ -133,7 +134,8 @@ > extern unsigned int inw(unsigned long); > extern unsigned int inl(unsigned long); > > -# endif /* __sparc__, __arm32__, __alpha__ */ > +# endif /* __sparc__, __arm32__, __alpha__ */ > +# endif /* __arm__ */ > > extern unsigned long ldq_u(unsigned long *); > extern unsigned long ldl_u(unsigned int *); > @@ -889,7 +891,7 @@ > # define mem_barrier() /* XXX: nop for now */ > # define write_mem_barrier() /* XXX: nop for now */ > > -# elif defined(__mips__) || defined(__arm32__) > +# elif defined(__mips__) || (defined(__arm32__) && !defined(__linux__)) > #ifdef __arm32__ > #define PORT_SIZE long > #else > @@ -1285,6 +1287,55 @@ > # define mem_barrier() eieio() > # define write_mem_barrier() eieio() > > +#elif defined(__arm__) && defined(__linux__) > + > +#define ldq_u(p) (*((unsigned long *)(p))) > +#define ldl_u(p) (*((unsigned int *)(p))) > +#define ldw_u(p) (*((unsigned short *)(p))) > +#define stq_u(v,p) (*(unsigned long *)(p)) = (v) > +#define stl_u(v,p) (*(unsigned int *)(p)) = (v) > +#define stw_u(v,p) (*(unsigned short *)(p)) = (v) > +#define mem_barrier() /* NOP */ > +#define write_mem_barrier() /* NOP */ > + > +/* for Linux on ARM, we use the LIBC inx/outx routines */ > +/* note that the appropriate setup via "ioperm" needs to be done */ > +/* *before* any inx/outx is done. */ > + > +#include <sys/io.h> > + > +static __inline__ void > +xf_outb(unsigned short port, unsigned char val) > +{ > + outb(val, port); > +} > + > +static __inline__ void > +xf_outw(unsigned short port, unsigned short val) > +{ > + outw(val, port); > +} > + > +static __inline__ void > +xf_outl(unsigned short port, unsigned int val) > +{ > + outl(val, port); > +} > + > +#define outb xf_outb > +#define outw xf_outw > +#define outl xf_outl > + > +#define arm_flush_cache(addr) \ > +do { \ > + register unsigned long _beg __asm ("a1") = (unsigned long) (addr); \ > + register unsigned long _end __asm ("a2") = (unsigned long) (addr) + 4;\ > + register unsigned long _flg __asm ("a3") = 0; \ > + __asm __volatile ("swi 0x9f0002 @ sys_cacheflush" \ > + : "=r" (_beg) \ > + : "0" (_beg), "r" (_end), "r" (_flg)); \ > +} while (0) > + > # else /* ix86 */ > > # define ldq_u(p) (*((unsigned long *)(p))) > ------------------------------------------------------------------------- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to share your > opinions on IT & business topics through brief surveys - and earn cash > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > _______________________________________________ Xf4vnc-devel mailing list Xf4...@li... https://lists.sourceforge.net/lists/listinfo/xf4vnc-devel |