[PATCH] Add support for Xtensa
Chris Zankel
chris at zankel.net
Sat Mar 23 18:08:38 UTC 2013
Hi Dmitry,
Thanks for your quick response.
On 03/22/2013 06:12 PM, Dmitry V. Levin wrote:
>
> + { MA, 0, printargs, "SYS_2" }, /* 2 */
> + { MA, 0, printargs, "SYS_3" }, /* 3 */
> + { MA, 0, printargs, "SYS_4" }, /* 4 */
> + { MA, 0, printargs, "SYS_5" }, /* 5 */
> + { MA, 0, printargs, "SYS_6" }, /* 6 */
> + { MA, 0, printargs, "SYS_7" }, /* 7 */
> In this and other similar places, please collapse blocks of undefined
> syscall entries using "[N1 ... N2] = {}" notation.
Will do.
> +#elif defined(XTENSA)
> + if (check_errno && is_negated_errno(xtensa_a2)) {
> + tcp->u_rval = -1;
> + u_error = -xtensa_a2;
> + }
> + else {
> + tcp->u_rval = xtensa_a2;
> + }
> #endif
> tcp->u_error = u_error;
> }
> Is there any reason to upeek one register at a time instead of fetching
> the whole set using PTRACE_GETREGS or PTRACE_GETREGSET?
We don't yet support GETREGSET and I noticed a flaw with GETREGS. Xtensa
is a configurable processor architecture with 'windowed' registers,
where the output registers of the caller become the input registers of
the callee. At any particular time, you can access 16 out of N
registers, where N is configurable to be 32 or 64 registers. GETREGS
returns a structure that includes all 32 or 64 registers, but no
information of how many there are. So, the syscall arguments could
either be in registers 30,31,32,33,34, etc. (for 64 registers), or they
wrap around at 32 and be in 30, 31, 0, 1, 2, etc.
Hopefully, we can fix that when supporting GETREGSET, but until then, we
probably have to use the slower upeek method.
I'll send an updated patch with the unused syscall entries removed and
others collapsed.
Thanks,
-Chris
More information about the Strace-devel
mailing list