This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [Gcl-devel] Re: BFD relocations


On Thu, Jun 06, 2002 at 11:14:43PM -0400, Camm Maguire wrote:
> 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 don't believe this is portable, but I have no idea.

-- 
Daniel Jacobowitz                           Carnegie Mellon University
MontaVista Software                         Debian GNU/Linux Developer


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]