Skip to content

Commit

Permalink
coredump: coredump_add_memory_region need use flags
Browse files Browse the repository at this point in the history
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
  • Loading branch information
anjiahao1 authored and xiaoxiang781216 committed Oct 24, 2024
1 parent f4d1f56 commit b33226d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
3 changes: 2 additions & 1 deletion include/nuttx/coredump.h
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,8 @@ int coredump_set_memory_region(FAR const struct memory_region_s *region);
*
****************************************************************************/

int coredump_add_memory_region(FAR const void *ptr, size_t size);
int coredump_add_memory_region(FAR const void *ptr, size_t size,
uint32_t flags);

/****************************************************************************
* Name: coredump
Expand Down
5 changes: 3 additions & 2 deletions sched/misc/coredump.c
Original file line number Diff line number Diff line change
Expand Up @@ -768,7 +768,8 @@ int coredump_set_memory_region(FAR const struct memory_region_s *region)
*
****************************************************************************/

int coredump_add_memory_region(FAR const void *ptr, size_t size)
int coredump_add_memory_region(FAR const void *ptr, size_t size,
uint32_t flags)
{
FAR struct memory_region_s *region;
size_t count = 1; /* 1 for end flag */
Expand Down Expand Up @@ -838,7 +839,7 @@ int coredump_add_memory_region(FAR const void *ptr, size_t size)

region[count - 1].start = (uintptr_t)ptr;
region[count - 1].end = (uintptr_t)ptr + size;
region[count - 1].flags = 0;
region[count - 1].flags = flags;
region[count].start = 0;
region[count].end = 0;
region[count].flags = 0;
Expand Down

0 comments on commit b33226d

Please sign in to comment.