Re: [AD] About inp & outp

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


Angelo Mottola <a.mottola@xxxxxxxxxx> writes:

> Here are the latest news: The problem is with inportb()
> only... outportb() works. This is for sure, as it worked nicely when
> I only exchanged inportb with inp, leaving outportb there. If
> inportb() is the problem, then the delay issue makes more sense, and
> it seems the way to go. But I didn't manage to make it to work, with
> several kind of tries; from Michael's patch, up to using rest() and
> other ways... The only case in which it works, is when I exchange
> inportb with inp.

Maybe this is due to gcc or binutils version, they might have changed
something in inline assembler handling or in standalone assembler.

Could you compile original sndscape.c with default Allegro
optimization options and send generated sndscape.o file to me
(bukinm@xxxxxxxxxx).  I'd like to compare it to the object file
generated by my gcc version.

Next step, try to replace my_inport and my_outportb in my patch with
the following.  We can try to see if it is timing issues or
incorrectly generated assembler.

static unsigned char
my_inportb (unsigned short port)
{
  unsigned char data;
  __asm__ __volatile__ ("inb (%%dx), %%al"
                        : "=a" (data) : "d" (port));
  return data;
}

static void
my_outportb (unsigned short port, unsigned char data)
{
  __asm__ __volatile__ ("outb %%al, (%%dx)"
                        : : "d" (port), "a" (data));
}

If it does not work too, could you send generated sndscape.o to me by
e-mail as well.

> Now, I have a K6-200; could it be related to the code generated with
> -Ox on my system? Is my DJGPP broken? I have the latest release, and
> I've just reinstalled it...

I don't think it can be related to your system architecture.  Broken
or buggy DJGPP or gcc is more likely to cause such problems.

-- 
Michael Bukin



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/