On Wed, 2002-05-01 at 00:43, Jos� Fonseca wrote:
>
> I attached a complete diff that should do the right thing. I believe this
> is the only way to do this in a portable fashion, even if results in some
> redundant work being done on bigendian machines.
Don't worry about that, as I said, at least PPC has special instructions
to handle this.
> I also avoided to increment the pointer inside the macros, just in case the
> le32_to_cpu macro reuses it's argument.
Certainly can't hurt...
> +#define MACH64_WRITE(reg,val) writel(val, MACH64_ADDR(reg))
^^^
...neither can braces here...
> @@ -535,17 +536,21 @@
> reg = MMSELECT( reg );
>
> while ( count && used ) {
> + u32 data;
> +
> if ( !fifo ) {
> if ( mach64_do_wait_for_fifo(
>dev_priv, 16 ) < 0 )
> return;
>
> fifo = 16;
> }
> -
> --fifo;
> - /* data is already little-endian */
> - MACH64_DEREF(reg) = *p++;
> +
> + data = le32_to_cpu(*p);
> + p++;
> used--;
> +
> + MACH64_WRITE(reg, data);
>
> reg += 4;
> count--;
This looks overly complicated though. I'd just do this:
@@ -544,7 +545,8 @@
--fifo;
/* data is already
little-endian */
- MACH64_DEREF(reg) =
*p++;
+ MACH64_WRITE(reg,
le32_to_cpu(*p));
+ p++;
used--;
reg += 4;
(sorry, my mailer probably wraps some lines)
--
Earthling Michel D�nzer (MrCooper)/ Debian GNU/Linux (powerpc) developer
XFree86 and DRI project member / CS student, Free Software enthusiast
_______________________________________________________________
Have big pipes? SourceForge.net is looking for download mirrors. We supply
the hardware. You get the recognition. Email Us:
[EMAIL PROTECTED]
Dri-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/dri-devel