[Ffmpeg-devel] [RFC] Addition of JIT accelerated scaler for ARM into libswscale

Reimar Doeffinger Reimar.Doeffinger
Wed Jan 24 18:08:44 CET 2007


Hello,
On Wed, Jan 24, 2007 at 12:31:16AM +0100, Michael Niedermayer wrote:
> On Wed, Jan 24, 2007 at 12:39:00AM +0200, Siarhei Siamashka wrote:
[...]
> > So all there mprotect calls in my code are done in order to ensure that cache
> > flushing works correctly. So we do:
> > * mmap some memory block with permission to execute code from it
> > * generate a simple code for function that should return 0
> > * call this code and check that it really returned 0
> > * do mprotect to disable and reenable code execution (and hope that it does
> > cache flush)
> > * generate a simple code  for function that should return 1
> > * call this code and check that it really returned 1 (without mprotect calls
> > it would still return 0)
> 
> i do not like this redundant mess, especially because a simple task switch
> at the right moment will make it look as if everything is ok

Wouldn't any even half-decent OS do the appropriate flush if you just
mmap it noexec but write and then mprotect it to not writable but
executable?

Greetings,
Reimar D?ffinger




More information about the ffmpeg-devel mailing list