From a641b354b744cc0478339e4616997aa960f5e19e Mon Sep 17 00:00:00 2001
From: Gregory Nutt Last Updated: August 22, 2014 Last Updated: August 24, 2014
NuttX RTOS Porting Guide
-
4.4.1
4.5 APIs Exported by NuttX to Architecture-Specific Logic
up_addrenv_create()
4.4.2 up_addrenv_destroy()
- 4.4.3 up_addrenv_vaddr()
- 4.4.4 up_addrenv_select()
- 4.4.5 up_addrenv_restore()
- 4.4.6 up_addrenv_assign()
- 4.4.7 up_addrenv_attach()
- 4.4.8 up_addrenv_detach()
+ 4.4.3 up_addrenv_vtext()
+ 4.4.4 up_addrenv_vdata()
+ 4.4.5 up_addrenv_select()
+ 4.4.6 up_addrenv_restore()
+ 4.4.7 up_addrenv_assign()
+ 4.4.8 up_addrenv_attach()
+ 4.4.9 up_addrenv_detach()
@@ -2943,19 +2944,23 @@ VxWorks provides the following comparable interface:
Destroy an address environment.
@@ -2968,12 +2973,12 @@ VxWorks provides the following comparable interface:
up_addrenv_vaddr()
:
- Returns the virtual base address of the address environment.
+ 4.4.3 up_addrenv_vtext()
:
+ Returns the virtual base address of the .text
address environment.
up_addrenv_select()
:
+ 4.4.4 up_addrenv_vdata()
:
+ Returns the virtual base address of the .bss
/.data
address environment.
+ up_addrenv_select()
:
Instantiate an address environment.
up_addrenv_restore()
:
+ 4.4.6 up_addrenv_restore()
:
Restore an address environment.
up_addrenv_assign()
:
+ 4.4.7 up_addrenv_assign()
:
Assign an address environment to a thread.
up_addrenv_attach()
:
+ 4.4.8 up_addrenv_attach()
:
Clone the group address environment assigned to a new thread.
This operation is done when a pthread is created that share's the same address environment.
up_addrenv_detach()
:
+ 4.4.9 up_addrenv_detach()
:
Release the thread's reference to a group address environment when a task/thread exits.
up_addrenv_create()
Function Prototype:
int up_addrenv_create(size_t envsize, FAR group_addrenv_t *addrenv);
+ int up_addrenv_create(size_t textsize, size_t datasize, FAR group_addrenv_t *addrenv);
Description:
Input Parameters:
envsize
: The size (in bytes) of the address environment needed by the task.textsize
: The size (in bytes) of the .text
address environment needed by the task. This region may be read/execute only.datasize
: The size (in bytes) of the .bss/.data
address environment needed by the task. This region may be read/write only.addrenv
: The location to return the representation of the task address environment.Returned Value:
@@ -3018,27 +3024,48 @@ VxWorks provides the following comparable interface: Zero (OK
) on success; a negated errno
value on failure.
-up_addrenv_vaddr()
up_addrenv_vtext()
Function Prototype:
int up_addrenv_vaddr(FAR group_addrenv_t addrenv, FAR void **vaddr);
+ int up_addrenv_vtext(FAR group_addrenv_t addrenv, FAR void **vtext);
Description:
.text
address associated with the newly create address environment.
This function is used by the binary loaders in order get an address that can be used to initialize the new task.
Input Parameters:
addrenv
: The representation of the task address environment previously returned by up_addrenv_create.vaddr
: The location to return the virtual address.vtext
: The location to return the virtual address.Returned Value:
OK
) on success; a negated errno
value on failure.
up_addrenv_select()
up_addrenv_vdata()
Function Prototype:
+
int up_addrenv_vdata(FAR group_addrenv_t addrenv, size_t textsize, FAR void **vdata);
+Description:
+.text
address associated with the newly create address environment.
+ This function is used by the binary loaders in order get an address that can be used to initialize the new task.
+Input Parameters:
+addrenv
: The representation of the task address environment previously returned by up_addrenv_create.textsize
: For some implementations, the text and data will be saved in the same memory region (read/write/execute) and, in this case, the virtual address of the data just lies at this offset into the common region.vdata
: The location to return the virtual address.Returned Value:
+OK
) on success; a negated errno
value on failure.
+up_addrenv_select()
Function Prototype:
int up_addrenv_select(group_addrenv_t addrenv, save_addrenv_t *oldenv);
@@ -3062,7 +3089,7 @@ VxWorks provides the following comparable interface:
Zero (OK
) on success; a negated errno
value on failure.
up_addrenv_restore()
up_addrenv_restore()
Function Prototype:
int up_addrenv_restore(save_addrenv_t oldenv);
@@ -3081,10 +3108,10 @@ VxWorks provides the following comparable interface:
Zero (OK
) on success; a negated errno
value on failure.
up_addrenv_assign()
up_addrenv_assign()
Function Prototype:
int up_addrenv_assign(group_addrenv_t addrenv, FAR struct task_group_s *group);
+ int up_addrenv_assign(FAR const group_addrenv_t *addrenv, FAR struct task_group_s *group);
Description:
OK
) on success; a negated errno
value on failure.
up_addrenv_attach()
up_addrenv_attach()
Function Prototype:
int up_addrenv_attach(FAR struct task_group_s *group, FAR struct tcb_s *tcb);
@@ -3126,7 +3153,7 @@ VxWorks provides the following comparable interface:
Zero (OK
) on success; a negated errno
value on failure.
up_addrenv_detach()
up_addrenv_detach()
Function Prototype:
int up_addrenv_detach(FAR struct task_group_s *group, FAR struct task_group_s *tcb);