Source-Changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: CVS commit: src/sys/arch/newsmips/newsmips



christos%astron.com@localhost (Christos Zoulas) writes:

> >I.e. the question is "doesn't gcc4 assume such static variables might
> >be changed in the interrupt context in the same source?"
> 
> This is what I meant; gcc does not know that this can happen. How could it?

In most of our code we should only be looking at such values after a
round of splfoo()/splx(), and we can arrange for gcc to not think it
can keep global values across those function calls. That's the normal
way for device drivers to communicate "things might change
asynchronously" to the compiler; for this case, where we know exactly
what code might synchronously trigger it and really want to force a
re-check, making the variable volatile (or perhaps using a *(volatile
int *)&badaddr_flag construct?) seems reasonable.

        - Nathan



Home | Main Index | Thread Index | Old Index