diff options
author | Gregory Nutt <gnutt@nuttx.org> | 2014-08-26 12:16:05 -0600 |
---|---|---|
committer | Gregory Nutt <gnutt@nuttx.org> | 2014-08-26 12:16:05 -0600 |
commit | b6ed8d1bed845fdba8ba207776dc1f7b83de57fd (patch) | |
tree | 7a50c9cc92745c0f80b8557354a836020275328f /nuttx/arch/z80 | |
parent | 690fb7b9fb8bc38f97c38cd5a36140bd8efe7bd7 (diff) | |
download | nuttx-b6ed8d1bed845fdba8ba207776dc1f7b83de57fd.tar.gz nuttx-b6ed8d1bed845fdba8ba207776dc1f7b83de57fd.tar.bz2 nuttx-b6ed8d1bed845fdba8ba207776dc1f7b83de57fd.zip |
Rename up_addrenv_assign() to up_addrenv_clone() and generalize its arguments so that can be used for other purposes
Diffstat (limited to 'nuttx/arch/z80')
-rw-r--r-- | nuttx/arch/z80/src/z180/z180_mmu.c | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/nuttx/arch/z80/src/z180/z180_mmu.c b/nuttx/arch/z80/src/z180/z180_mmu.c index c86c57a62..3aeb64468 100644 --- a/nuttx/arch/z80/src/z180/z180_mmu.c +++ b/nuttx/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(addrenv && group->addrenv == NULL); + DEBUGASSERT(src && dest); - /* 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; } |