Skip to content

Commit

Permalink
!vm: Add passing of map name in meminfo syscall
Browse files Browse the repository at this point in the history
JIRA: RTOS-754
  • Loading branch information
jmaksymowicz authored and Darchiv committed Sep 27, 2024
1 parent 74b869b commit 83ffd64
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions include/sysinfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ typedef struct {
addr_t vend;
size_t alloc;
size_t free;
char name[16];
} mapinfo_t;


Expand Down
9 changes: 9 additions & 0 deletions vm/map.c
Original file line number Diff line number Diff line change
Expand Up @@ -1125,6 +1125,7 @@ void vm_mapinfo(meminfo_t *info)
rbnode_t *n;
map_entry_t *e;
vm_map_t *map;
const syspage_map_t *spMap;
unsigned int size;
process_t *process;
int i;
Expand Down Expand Up @@ -1314,6 +1315,14 @@ void vm_mapinfo(meminfo_t *info)
info->maps.map[size].pend = (addr_t)map->pmap.end;
info->maps.map[size].vstart = (ptr_t)map->start;
info->maps.map[size].vend = (ptr_t)map->stop;
spMap = syspage_mapIdResolve(size);
if ((spMap != NULL) && (spMap->name != NULL)) {
hal_strncpy(info->maps.map[size].name, spMap->name, sizeof(info->maps.map[size].name));
info->maps.map[size].name[sizeof(info->maps.map[size].name) - 1] = '\0';
}
else {
info->maps.map[size].name[0] = '\0';
}
}
}

Expand Down

0 comments on commit 83ffd64

Please sign in to comment.