Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FdtNode<'static> is ... dangerous? #59

Open
efenniht opened this issue Sep 20, 2019 · 1 comment
Open

FdtNode<'static> is ... dangerous? #59

efenniht opened this issue Sep 20, 2019 · 1 comment

Comments

@efenniht
Copy link
Collaborator

fdt_handler::map 함수는 FdtNode<'static>를 리턴하는데 이것은 위험합니다. unmap을 하면 'static time에 해당 데이터를 접근할 수 없기 때문입니다. 더 리팩토링을 해서

  • FdtRootNode를 새로 만들기
  • 이것의 생성자가 현재의 fdt_handler::map 이 되도록 하기
  • 이것의 drop이 현재의 fdt_handler::unmap 이 되도록 하기
  • FdtRootNode::find_child() 와 같은 함수가 &'a [u8] 대신 &'self [u8] 을 리턴하도록 하기

이런 식으로 고쳐야 합니다.

@efenniht
Copy link
Collaborator Author

관련해서 장기적으로는(=못한다는 뜻) PageTable::identity_map 함수가 MappedPages 따위를 리턴하고 이거의 drop이 PageTable::unmap이 되어야 하지 않나 합니다...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant