Package: xfree86v3
Version: 3.3.6-44
Severity: serious

Hi,

while trying to build xfree 3.3.6-44 on arm for inclusion into
woody, I got some errors:

when making XF68_FBDev some problems happened: 

the error reports:
../../programs/Xserver/hw/xfree68/pm2/libpm2.a(pm2fbdev.o): In function `pm2fb_reinit':
/home/othmar/xfree86v3/xfree86v3-3.3.6/build-tree/xc/programs/Xserver/hw/xfree68/pm2/pm2fbdev.c:74:
 undefined reference to `rmb'

there were quite many of the above one, so grep for PM2_WAIT_IDLE
in the pm2/ directory or i can also post the whole thing but see
a explanation/solution to this at 1) (below).

/home/othmar/xfree86v3/xfree86v3-3.3.6/build-tree/xc/programs/Xserver/hw/xfree68/pm2/pm2im.c:142:
 undefined reference to `MemToBus'
/home/othmar/xfree86v3/xfree86v3-3.3.6/build-tree/xc/programs/Xserver/hw/xfree68/pm2/pm2im.c:296:
 undefined reference to `BusToMem'

these are the errors for 2) (below)


1) there are quite some undefined references to rmb() in
programs/Xserver/hw/xfree68/pm2/, the PM2_WAIT_IDLE() macro,
which is defined in pm2_accel.h, uses this. the problem here is,
at least my i386 system shows this in the headers, that asm/system.h has
the rmb() bits (which is actually a macro for mb() and which is
just a assembler command) are not within an #ifdef __KERNEL__
section, but when I look at the same header file on my arm system
the definitions are within that #ifdef, so, it wouldn't resolve
this reference. i talked to phil blundell and he said that one
should just make a definition, similar to the one in the
asm/system.h file, ok, i did this and the thing resolved finally.
see the attached patch. disclaimer: i don't know anything about
the X source or guidelines or whatever, feel free to adjust the
patch so that it follows your practices :).

note on the patch:
i used pm2_accel.h primarily for two reasons, first, it's a header file
in the pm2/ directory and second, this is the header file which
is included by all of the affected source files.

2) the other odd thing in programs/Xserver/hw/xfree68/pm2/ is
pm2im.c. At the beginning of the file, there is a #ifdef on
__powerpc__ which defines the function memcpy_double and the two
macros ALIGN_DEST_TO8 and DO_REST_ALIGNED which are used by
memcpy_double. and after the definition of the function two
macros are created named MemToBus and BusToMem which are, as it
seems, just aliases to memcpy_double.
the odd part now is, that further down in the same source file
the function pm2fbImageWrite() uses the MemToBus and BusToMem
macros, but this must fail for architectures which are not
powerpc, as i don't know anything about it, it would be nice to
get a solution for that :).

i hope i didn't miss something that might lead to a different
conclusion, so don't flame me if i am talking rubbish :).

TIA
Othmar
--- pm2_accel.h.orig    Fri Mar 22 20:21:05 2002
+++ pm2_accel.h Fri Mar 22 20:24:49 2002
@@ -7,6 +7,11 @@
 #include "glint_regs.h"
 #include "pm2im.h"
 
+#ifdef __arm__
+#define mb() __asm__ __volatile__ ("" : : : "memory")
+#define rmb() mb()
+#endif
+
 /* Synchronize with the Permedia2 (Wait until all its ops are finished) */
 #define PM2_WAIT_IDLE()        \
        GLINT_WAIT(2); \

Reply via email to