diff --git a/arch/arm/src/armv7-a/arm_addrenv.c b/arch/arm/src/armv7-a/arm_addrenv.c index ed3a249fdc6..a9e68061923 100644 --- a/arch/arm/src/armv7-a/arm_addrenv.c +++ b/arch/arm/src/armv7-a/arm_addrenv.c @@ -48,11 +48,12 @@ * address environment * up_addrenv_select - Instantiate an address environment * up_addrenv_restore - Restore an address environment - * up_addrenv_assign - Assign an address environment to a group + * up_addrenv_clone - Copy an address environment from one location to + * another. * * Higher-level interfaces used by the tasking logic. These interfaces are * used by the functions in sched/ and all operate on the thread which whose - * group been assigned an address environment by up_addrenv_assign(). + * group been assigned an address environment by up_addrenv_clone(). * * up_addrenv_attach - Clone the address environment assigned to one TCB * to another. This operation is done when a pthread @@ -661,30 +662,31 @@ int up_addrenv_restore(FAR const save_addrenv_t *oldenv) } /**************************************************************************** - * Name: up_addrenv_assign + * Name: up_addrenv_clone * * Description: - * Assign an address environment to a new task group. + * Duplicate an address environment. This does not copy the underlying + * memory, only the representation that can be used to instantiate that + * memory as an address environment. * * Input Parameters: - * addrenv - The representation of the task address environment previously - * returned by up_addrenv_create(). - * group - The new task group to receive the address environment. + * src - The address environment to be copied. + * dest - The location to receive the copied address environment. * * Returned Value: * Zero (OK) on success; a negated errno value on failure. * ****************************************************************************/ -int up_addrenv_assign(FAR const group_addrenv_t *addrenv, - FAR struct task_group_s *group) +int up_addrenv_clone(FAR const group_addrenv_t *src, + FAR group_addrenv_t *dest) { - DEBUGASSERT(addrenv && group); - bvdbg("addrenv=%p group->addrenv=%p\n", addrenv, &group->addrenv); + bvdbg("src=%p dest=%p\n", src, dest); + DEBUGASSERT(src && dest); - /* Just copy the address environment into the group */ + /* Just copy the address environment from the source to the destination */ - memcpy(&group->addrenv, addrenv, sizeof(group_addrenv_t)); + memcpy(dest, src, sizeof(group_addrenv_t)); return OK; } diff --git a/arch/z80/src/z180/z180_mmu.c b/arch/z80/src/z180/z180_mmu.c index c86c57a62c9..3aeb6446880 100644 --- a/arch/z80/src/z180/z180_mmu.c +++ b/arch/z80/src/z180/z180_mmu.c @@ -192,11 +192,12 @@ return g_physhandle ? OK : -ENOMEM; * address environment * up_addrenv_select - Instantiate an address environment * up_addrenv_restore - Restore an address environment - * up_addrenv_assign - Assign an address environment to a group + * up_addrenv_clone - Copy an address environment from one location to + * another. * * Higher-level interfaces used by the tasking logic. These interfaces are * used by the functions in sched/ and all operate on the thread which whose - * group been assigned an address environment by up_addrenv_assign(). + * group been assigned an address environment by up_addrenv_clone(). * * up_addrenv_attach - Clone the address environment assigned to one TCB * to another. This operation is done when a pthread @@ -457,33 +458,32 @@ int up_addrenv_restore(FAR const save_addrenv_t *oldenv) } /**************************************************************************** - * Name: up_addrenv_assign + * Name: up_addrenv_clone * * Description: - * Assign an address environment to a task group. + * Duplicate an address environment. This does not copy the underlying + * memory, only the representation that can be used to instantiate that + * memory as an address environment. * * Input Parameters: - * addrenv - The representation of the task address environment previously - * returned by up_addrenv_create(). - * group - The task group to receive the address environment. + * src - The address environment to be copied. + * dest - The location to receive the copied address environment. * * Returned Value: * Zero (OK) on success; a negated errno value on failure. * ****************************************************************************/ -int up_addrenv_assign(FAR const group_addrenv_t *addrenv, - FAR struct task_group_s *group) +int up_addrenv_clone(FAR const group_addrenv_t *src, + FAR group_addrenv_t *dest); { - /* Make sure that there is no address environment in place on this TCB */ + DEBUGASSERT(src && dest); - DEBUGASSERT(addrenv && group->addrenv == NULL); - - /* Save the CBR structure in the group. This is an atomic operation so no - * special precautions should be needed. + /* Copy the CBR structure. This is an atomic operation so no special + * precautions should be needed. */ - group->addrenv = *addrenv; + *dest = *src; return OK; }