www.delorie.com/djgpp/bugs/show.cgi | search |
Inlines declared in /DJ2/include/inlines/pc.h optimize inportb()'s, etc., inside of a loop. Therefore, a loop dependant on the value taken from the port changing will loop forever, since inportb() will only be called once, outside the loop. Will adding the volatile keyword to the functions fix this? Example: while((inportb(0x226)&0x80)!=0); compiles to: movw $0x226, %dx inb %dx, %al movzbl %al, %ecx L15: testb %cl, %cl jl L15
I changed all __asm__() to __asm__ __volatile__ (). Note that sys/farptr.h had the same problem, and was also fixed.
webmaster | delorie software privacy |
Copyright © 2010 by DJ Delorie | Updated Jul 2010 |