1 kernel_ulong_t shuffle_scno(kernel_ulong_t scno)2shuffle_scno(kernel_ulong_t scno) 3 { 4 if (scno < ARM_FIRST_SHUFFLED_SYSCALL) 5 return scno; 6 7 /* __ARM_NR_cmpxchg? Swap with LAST_ORDINARY+1 */ 8 if (scno == ARM_FIRST_SHUFFLED_SYSCALL) 9 return 0x000ffff0; 10 if (scno == 0x000ffff0) 11 return ARM_FIRST_SHUFFLED_SYSCALL; 12 13 #define ARM_SECOND_SHUFFLED_SYSCALL (ARM_FIRST_SHUFFLED_SYSCALL + 1) 14 /* 15 * Is it ARM specific syscall? 16 * Swap [0x000f0000, 0x000f0000 + LAST_SPECIAL] range 17 * with [SECOND_SHUFFLED, SECOND_SHUFFLED + LAST_SPECIAL] range. 18 */ 19 if (scno >= 0x000f0000 && 20 scno <= 0x000f0000 + ARM_LAST_SPECIAL_SYSCALL) { 21 return scno - 0x000f0000 + ARM_SECOND_SHUFFLED_SYSCALL; 22 } 23 if (scno <= ARM_SECOND_SHUFFLED_SYSCALL + ARM_LAST_SPECIAL_SYSCALL) { 24 return scno + 0x000f0000 - ARM_SECOND_SHUFFLED_SYSCALL; 25 } 26 27 return scno; 28 } 29