Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Exclusives Reservation Granule (ERG) on Apple's processors

Does anyone know what is ERG on Apple's A5, A5X, A6 and A6X processors?

We ran into an obscure bug with LDREX/STREX instructions and the behavior is different between A5's and A6's. The only explanation I have is that they have different ERG, but can't find anything on that. I also could not find a way to retrieve this value, the MRC instruction seems to be prohibited in the user mode on iOS.

Thank you!

like image 914
Moshe Kravchik Avatar asked Jan 24 '13 13:01

Moshe Kravchik


1 Answers

On OMAP 4460 (ARM Cortex-A9, same as Apple A5/A5X) ERG is 32 bytes (which is same as cache line size).

I don't know that those values are on A6/A6X (and there is no way to find out without loading your own driver, which you can not do on Apple devices), but my guestimate is that cache line size increased to 64 bytes, and so did ERG.

Alternatively, you may optimize the algorithm for the architectural maximum of 512 words (2K bytes).

like image 56
Marat Dukhan Avatar answered Oct 22 '22 18:10

Marat Dukhan