1/* Scalar test for new shmsys syscall subcodes available on Solaris 11. */ 2 3#include "scalar.h" 4 5#include <sys/shm.h> 6#include <sys/shm_impl.h> 7 8__attribute__((noinline)) 9static void sys_shmsys(void) 10{ 11 GO(SYS_shmsys, "(SHMCTL,IPC_XSTAT64) 4s 1m"); 12 SY(SYS_shmsys, x0 + SHMCTL, x0, x0 + IPC_XSTAT64, x0 + 1); FAIL; 13} 14 15__attribute__((noinline)) 16static void sys_shmsys2(void) 17{ 18 GO(SYS_shmsys, "(SHMADV,SHM_ADV_GET) 4s 1m"); 19 SY(SYS_shmsys, x0 + SHMADV, x0, x0 + SHM_ADV_GET, x0 + 1); FAIL; 20} 21 22__attribute__((noinline)) 23static void sys_shmsys3(void) 24{ 25 GO(SYS_shmsys, "(SHMADV,SHM_ADV_SET) 4s 1m"); 26 SY(SYS_shmsys, x0 + SHMADV, x0, x0 + SHM_ADV_SET, x0 + 1); FAIL; 27} 28 29__attribute__((noinline)) 30static void sys_shmsys4(void) 31{ 32 GO(SYS_shmsys, "(SHMGET_OSM) 5s 0m"); 33 SY(SYS_shmsys, x0 + SHMGET_OSM, x0, x0, x0, x0); FAIL; 34} 35 36int main(void) 37{ 38 /* Uninitialised, but we know px[0] is 0x0. */ 39 long *px = malloc(sizeof(long)); 40 x0 = px[0]; 41 42 /* SYS_shmsys 52 */ 43 sys_shmsys(); 44 sys_shmsys2(); 45 sys_shmsys3(); 46 sys_shmsys4(); 47 48 return 0; 49} 50 51