You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2021/06/01 14:29:15 UTC

[GitHub] [incubator-nuttx] xiaoxiang781216 edited a comment on pull request #3626: libc: Move pthread stuff to userspace

xiaoxiang781216 edited a comment on pull request #3626:
URL: https://github.com/apache/incubator-nuttx/pull/3626#issuecomment-852169591


   All entry point from kernel to userspace before this patch is defined in userspace_s:
   https://github.com/apache/incubator-nuttx/blob/a8a1308240b7f631e44d78c3ef1582562c507a8a/include/nuttx/userspace.h#L105-L120
   it make sense to expose pthread_exit through the same mechanism.
   
   > > ```
   > > 1. Move pthread_exit & pthread_create to USERSPACE to unify the convention that how to drop to userspace from kernel side like this:
   > >    `regs[REG_EPC]      = (uintptr_t)USERSPACE->pthread_startup`
   > >    `regs[REG_EPC]      = (uintptr_t)USERSPACE->pthread_exit`
   > > ```
   > 
   > This part I don't understand. That doesn't unify the designs, it makes them different: There is no USERSPACE in KERNEL mode. I don't understand why this is a good thing.
   > 
   
   Kernel mode should use userspace_s too, the different between protected and kernel mode is how to locate this structure.
   
   > This will also set bit 0 in the EPC. I don't think you want to do that, do you?
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org