Lines Matching full:msb
115 static long long probe_syscall(int msb, int lsb) in probe_syscall() argument
123 long long nr = ((long long)msb << 32) | (unsigned int)lsb; in probe_syscall()
145 static const char *syscall_str(int msb, int start, int end) in syscall_str() argument
162 type, msb, lsb); in syscall_str()
165 type, msb, lsb, lsb + (end-start)); in syscall_str()
170 static unsigned int _check_for(int msb, int start, int end, long long expect, in _check_for() argument
180 long long ret = probe_syscall(msb, nr); in _check_for()
184 syscall_str(msb, nr, nr), in _check_for()
196 syscall_str(msb, start, end), in _check_for()
200 syscall_str(msb, start, end), expect_str); in _check_for()
208 #define check_for(msb,start,end,expect) \ argument
209 _check_for(msb,start,end,expect,#expect)
211 static bool check_zero(int msb, int nr) in check_zero() argument
213 return check_for(msb, nr, nr, 0); in check_zero()
216 static bool check_enosys(int msb, int nr) in check_enosys() argument
218 return check_for(msb, nr, nr, -ENOSYS); in check_enosys()
249 static void test_syscalls_common(int msb) in test_syscalls_common() argument
254 check_zero(msb, SYS_READ); in test_syscalls_common()
255 check_zero(msb, SYS_WRITE); in test_syscalls_common()
258 check_zero(msb, X64_READV); in test_syscalls_common()
259 check_zero(msb, X64_WRITEV); in test_syscalls_common()
262 check_for(msb, -64, -2, -ENOSYS); in test_syscalls_common()
264 check_for(msb, -1, -1, MODIFIED_BY_PTRACE); in test_syscalls_common()
266 check_for(msb, -1, -1, -ENOSYS); in test_syscalls_common()
267 check_for(msb, X32_BIT-64, X32_BIT-1, -ENOSYS); in test_syscalls_common()
268 check_for(msb, -64-X32_BIT, -1-X32_BIT, -ENOSYS); in test_syscalls_common()
269 check_for(msb, INT_MAX-64, INT_MAX-1, -ENOSYS); in test_syscalls_common()
272 static void test_syscalls_with_x32(int msb) in test_syscalls_with_x32() argument
281 check_for(msb, 512, 547, -ENOSYS); in test_syscalls_with_x32()
284 check_zero(msb, SYS_READ | X32_BIT); in test_syscalls_with_x32()
285 check_zero(msb, SYS_WRITE | X32_BIT); in test_syscalls_with_x32()
288 check_zero(msb, X32_READV | X32_BIT); in test_syscalls_with_x32()
289 check_zero(msb, X32_WRITEV | X32_BIT); in test_syscalls_with_x32()
292 check_enosys(msb, X64_IOCTL | X32_BIT); in test_syscalls_with_x32()
293 check_enosys(msb, X64_READV | X32_BIT); in test_syscalls_with_x32()
294 check_enosys(msb, X64_WRITEV | X32_BIT); in test_syscalls_with_x32()
297 static void test_syscalls_without_x32(int msb) in test_syscalls_without_x32() argument
300 check_for(msb, 0 | X32_BIT, 999 | X32_BIT, -ENOSYS); in test_syscalls_without_x32()
313 * The MSB is supposed to be ignored, so we loop over a few in test_syscall_numbering()
317 int msb = msbs[i]; in test_syscall_numbering() local
318 run("Checking system calls with msb = %d (0x%x)\n", in test_syscall_numbering()
319 msb, msb); in test_syscall_numbering()
323 test_syscalls_common(msb); in test_syscall_numbering()
325 test_syscalls_with_x32(msb); in test_syscall_numbering()
327 test_syscalls_without_x32(msb); in test_syscall_numbering()