pussuw commented on code in PR #6193: URL: https://github.com/apache/incubator-nuttx/pull/6193#discussion_r863947997
########## include/nuttx/arch.h: ########## @@ -1185,6 +1185,44 @@ int up_addrenv_attach(FAR struct task_group_s *group, FAR struct tcb_s *tcb); int up_addrenv_detach(FAR struct task_group_s *group, FAR struct tcb_s *tcb); #endif +/**************************************************************************** + * Name: up_addrenv_text_enable_write + * + * Description: + * Temporarily enable write access to the .text section. This must be + * called prior to loading the process code into memory. + * + * Input Parameters: + * addrenv - The address environment to be modified. + * + * Returned Value: + * Zero (OK) on success; a negated errno value on failure. + * + ****************************************************************************/ + +#ifdef CONFIG_ARCH_ADDRENV +int up_addrenv_text_enable_write(FAR group_addrenv_t *addrenv); Review Comment: I thought of making a more generic API for modifying access rights but I currently only need to modify the .text region so to keep things simple I did only that. I can do the generalization later since it does make sense, but I don't have time to do it now. I thionk we will need it ourselves when mmap is taken into use. Basically the infrastructure is already here, just need to modify this prototype and declare generic "PROT_WR/RD/EX" flags in some common header, maybe even here. -- 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. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
