On 23 July 2015 at 12:04, Andrew Jones <drjo...@redhat.com> wrote: > One more observation; to make this work for aarch64 you'll need to modify > your instruction modification. The add immediate can't be changed with > +-1 like it can for arm. Please make sure the code works for both, even > if you need to do > > #ifdef __arm__ > asm volatile(arm asm) > #else > asm volatile(aarch64 asm) > #endif
Yes I already did something like this on my original repo (ptr points to seg0), will update it: #ifdef ARCH_ARM (int *)seg0++; } else { (int *)seg0--; } #elif ARCH_AARCH64 *ptr |= 1 << 11; *ptr &= ~(1 << 10); } else { *ptr |= 1 << 10; *ptr &= ~(1 << 11); } #endif > Also, if you need a flip-flopping flag, why not use xor instead of > a counter mod 2? You are right xor is more straightforward. Best regards.