mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 10:41:38 -04:00
remoteproc: Introduce custom dump function for each remoteproc segment
Introduce custom dump function and private data per remoteproc dump segment. The dump function is responsible for filling the device memory segment associated with coredump Signed-off-by: Sibi Sankar <[email protected]> Signed-off-by: Bjorn Andersson <[email protected]>
This commit is contained in:
parent
c6aed238b7
commit
3952105df4
2 changed files with 17 additions and 7 deletions
|
|
@ -1508,14 +1508,18 @@ static void rproc_coredump(struct rproc *rproc)
|
|||
phdr->p_flags = PF_R | PF_W | PF_X;
|
||||
phdr->p_align = 0;
|
||||
|
||||
ptr = rproc_da_to_va(rproc, segment->da, segment->size);
|
||||
if (!ptr) {
|
||||
dev_err(&rproc->dev,
|
||||
"invalid coredump segment (%pad, %zu)\n",
|
||||
&segment->da, segment->size);
|
||||
memset(data + offset, 0xff, segment->size);
|
||||
if (segment->dump) {
|
||||
segment->dump(rproc, segment, data + offset);
|
||||
} else {
|
||||
memcpy(data + offset, ptr, segment->size);
|
||||
ptr = rproc_da_to_va(rproc, segment->da, segment->size);
|
||||
if (!ptr) {
|
||||
dev_err(&rproc->dev,
|
||||
"invalid coredump segment (%pad, %zu)\n",
|
||||
&segment->da, segment->size);
|
||||
memset(data + offset, 0xff, segment->size);
|
||||
} else {
|
||||
memcpy(data + offset, ptr, segment->size);
|
||||
}
|
||||
}
|
||||
|
||||
offset += phdr->p_filesz;
|
||||
|
|
|
|||
Loading…
Reference in a new issue