X32 ptrace is a hybrid of 64bit ptrace and compat ptrace with 32bitaddress and longs. It use 64bit ptrace to access the full 64bitregisters. PTRACE_PEEKUSR and PTRACE_POKEUSR are only allowed to accesssegment and debug registers. PTRACE_PEEKUSR returns the lower 32bitsand PTRACE_POKEUSR zero-extends 32bit value to 64bit. It works sincethe upper 32bits of segment and debug registers of x32 process are alwayszero. GDB only uses PTRACE_PEEKUSR and PTRACE_POKEUSR to accesssegment and debug registers.

[ hpa: changed TIF_X32 test to use !is_ia32_task() instead, and moved the system call number to the now-unused 521 slot. ]