boot cpio fs映射到用户态

This commit is contained in:
zhangzheng
2024-04-07 15:04:30 +00:00
parent a001a26bfe
commit b30ec9575d
17 changed files with 388 additions and 16 deletions

View File

@@ -86,6 +86,11 @@ int fd_map_get(int fd, fd_map_entry_t *new_entry)
int row_inx = fd / CONFIG_FD_MAP_ROW_CN;
int inx = fd % CONFIG_FD_MAP_ROW_CN;
if (fd_map.row[row_inx] == NULL)
{
return -1;
}
*new_entry = fd_map.row[row_inx]->entry[inx];
return 0;
}