[Top][All Lists]

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

Re: [Gcl-devel] Re: BFD relocations

From: Paul Koning
Subject: Re: [Gcl-devel] Re: BFD relocations
Date: Fri, 7 Jun 2002 09:55:21 -0400

> Greetings!  I found an earlier cache flushing snippet for another
> arch:
> #define CLEAR_CACHE do { unsigned long ps = getpagesize(); \
>                        char *beg = (char *)((unsigned long 
> )(memory->cfd.cfd_start) & ~(ps-1)); \
>                        char *end =  ROUND_UP(memory->cfd.cfd_start + \
>                                         memory->cfd.cfd_size,ps); \
> mprotect(beg,end-beg,PROT_READ|PROT_WRITE|PROT_EXEC);} while(0)
> Can mprotect be used in this way to portably flush the data cache?

I very much doubt it.  I don't see any real connection between page
protection and the cache.  Some OS might decide that changing
protection is a reason to flush the cache; another might not.  For
some CPU targets this may be necessary or useful, for others it may be
entirely superfluous.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]