Now
MAIN commitmail json YAML
src/sys/arch/amd64/amd64/netbsd32_machdep.c@1.122
/
diff
/
nxr@1.122
src/sys/arch/amd64/include/netbsd32_machdep.h@1.23 / diff / nxr@1.23
src/sys/arch/amd64/include/ptrace.h@1.14 / diff / nxr@1.14
src/sys/compat/netbsd32/netbsd32_ptrace.c@1.7 / diff / nxr@1.7
src/sys/arch/amd64/include/netbsd32_machdep.h@1.23 / diff / nxr@1.23
src/sys/arch/amd64/include/ptrace.h@1.14 / diff / nxr@1.14
src/sys/compat/netbsd32/netbsd32_ptrace.c@1.7 / diff / nxr@1.7
compat32: Translate userland PT_* request values into kernel codes
Currently, the compat32 passes PT_* request values to kernel functions
without translation. This works fine for low PT_* requests that happen
to have the same values both on i386 and amd64. However, for requests
higher than PT_SETFPREGS, the value passed from userland (matching i386
const) does not match the correct kernel (amd64) request. As a result,
e.g. when compat32 process calls PT_GETDBREGS, kernel actually processes
it as PT_SETSTEP.
To resolve this, introduce support for compat32 PT_* request
translation. The interface is based on PTRACE_TRANSLATE_REQUEST32 macro
that is defined to a mapping function on architectures needing it.
In case of amd64, this function maps userland i386 PT_* values into
appropriate amd64 PT_* values.
For the time being, the two additional PT_GETXMMREGS and PT_SETXMMREGS
requests are unsupported due to lack of matching free amd64 constant.
Currently, the compat32 passes PT_* request values to kernel functions
without translation. This works fine for low PT_* requests that happen
to have the same values both on i386 and amd64. However, for requests
higher than PT_SETFPREGS, the value passed from userland (matching i386
const) does not match the correct kernel (amd64) request. As a result,
e.g. when compat32 process calls PT_GETDBREGS, kernel actually processes
it as PT_SETSTEP.
To resolve this, introduce support for compat32 PT_* request
translation. The interface is based on PTRACE_TRANSLATE_REQUEST32 macro
that is defined to a mapping function on architectures needing it.
In case of amd64, this function maps userland i386 PT_* values into
appropriate amd64 PT_* values.
For the time being, the two additional PT_GETXMMREGS and PT_SETXMMREGS
requests are unsupported due to lack of matching free amd64 constant.