Changeset View
Changeset View
Standalone View
Standalone View
head/sys/arm/arm/machdep.c
Show First 20 Lines • Show All 592 Lines • ▼ Show 20 Lines | |||||
int | int | ||||
set_dbregs(struct thread *td, struct dbreg *regs) | set_dbregs(struct thread *td, struct dbreg *regs) | ||||
{ | { | ||||
return (0); | return (0); | ||||
} | } | ||||
static int | static int | ||||
ptrace_read_int(struct thread *td, vm_offset_t addr, u_int32_t *v) | ptrace_read_int(struct thread *td, vm_offset_t addr, uint32_t *v) | ||||
{ | { | ||||
struct iovec iov; | |||||
struct uio uio; | |||||
PROC_LOCK_ASSERT(td->td_proc, MA_NOTOWNED); | if (proc_readmem(td, td->td_proc, addr, v, sizeof(*v)) != sizeof(*v)) | ||||
iov.iov_base = (caddr_t) v; | return (ENOMEM); | ||||
iov.iov_len = sizeof(u_int32_t); | return (0); | ||||
uio.uio_iov = &iov; | |||||
uio.uio_iovcnt = 1; | |||||
uio.uio_offset = (off_t)addr; | |||||
uio.uio_resid = sizeof(u_int32_t); | |||||
uio.uio_segflg = UIO_SYSSPACE; | |||||
uio.uio_rw = UIO_READ; | |||||
uio.uio_td = td; | |||||
return proc_rwmem(td->td_proc, &uio); | |||||
} | } | ||||
static int | static int | ||||
ptrace_write_int(struct thread *td, vm_offset_t addr, u_int32_t v) | ptrace_write_int(struct thread *td, vm_offset_t addr, uint32_t v) | ||||
{ | { | ||||
struct iovec iov; | |||||
struct uio uio; | |||||
PROC_LOCK_ASSERT(td->td_proc, MA_NOTOWNED); | if (proc_writemem(td, td->td_proc, addr, &v, sizeof(v)) != sizeof(v)) | ||||
iov.iov_base = (caddr_t) &v; | return (ENOMEM); | ||||
iov.iov_len = sizeof(u_int32_t); | return (0); | ||||
uio.uio_iov = &iov; | |||||
uio.uio_iovcnt = 1; | |||||
uio.uio_offset = (off_t)addr; | |||||
uio.uio_resid = sizeof(u_int32_t); | |||||
uio.uio_segflg = UIO_SYSSPACE; | |||||
uio.uio_rw = UIO_WRITE; | |||||
uio.uio_td = td; | |||||
return proc_rwmem(td->td_proc, &uio); | |||||
} | } | ||||
static u_int | static u_int | ||||
ptrace_get_usr_reg(void *cookie, int reg) | ptrace_get_usr_reg(void *cookie, int reg) | ||||
{ | { | ||||
int ret; | int ret; | ||||
struct thread *td = cookie; | struct thread *td = cookie; | ||||
▲ Show 20 Lines • Show All 1,287 Lines • Show Last 20 Lines |