[OpenBIOS] static and global variable problem

Alexander Graf agraf at suse.de
Fri Dec 21 14:09:25 CET 2012


On 21.12.2012, at 10:55, Mark Cave-Ayland wrote:

> On 20/12/12 20:16, Programmingkid wrote:
> 
>> I was doing some debugging of an issue with the hash_page_32() function in the file ofmem.c, when I noticed a very odd problem. The static variable next_grab_slot never changes value. I tried declaring it as a global variable and its value still never changes. I used gdb to monitor its value. Local variables work just fine. Any body know a way to fix this problem? My guess is this is a gcc problem. What is your theory?
> 
> The first thing I would check is have you changed the CFLAGS from -Os to -O0 to disable optimisation? Otherwise gdb is missing information it needs to work correctly, and will start to do some strange things.
> 
> Also I note that when Alex did some work on this back in 2009, he made a minor change to PPC's OFMEM here: http://lists.openbios.org/pipermail/openbios/2009-July/003796.html. Alex - should the change to hash_page_32() be committed or is that another hack to work around something else?

I quite frankly don't remember what exactly I was trying to fix. I think the basic idea was that incrementing it by 3 we evict entries more fairly. But thinking about it again, I don't seem to understand why either myself :)


Alex




More information about the OpenBIOS mailing list