From c25382c41b69a954289acf7925d72657aa62d19b Mon Sep 17 00:00:00 2001
From: patacongo
- 1The
-
-filename
must be the full, absolute path to the file to be executed unless CONFIG_BINFMT_EXEPATH
is defined.
- In that case, filename
may be a relative path;
- a set of candidate absolute paths will be generated using the PATH
environment variable and load_module()
will attempt to load each file that is found at those absolute paths.
-
+ 1The filename
must be the full, absolute path to the file to be executed unless CONFIG_BINFMT_EXEPATH
is defined.
+ In that case, filename
may be a relative path;
+ a set of candidate absolute paths will be generated using the PATH
environment variable and load_module()
will attempt to load each file that is found at those absolute paths.
+
Where the types binfmt_ctor_t
and binfmt_dtor_t
define the type of one C++ constructor or destructor:
diff --git a/Documentation/NuttxPortingGuide.html b/Documentation/NuttxPortingGuide.html
index 5361a28665..526892d3ef 100644
--- a/Documentation/NuttxPortingGuide.html
+++ b/Documentation/NuttxPortingGuide.html
@@ -12,7 +12,7 @@
Last Updated: December 17, 2012
+Last Updated: December 18, 2012
@@ -92,7 +92,8 @@ 4.1.17up_enable_irq()
up_prioritize_irq()
4.1.19 up_putc()
- 4.1.20 System Time and Clock
+ 4.1.20 System Time and Clockmake
.
is defined.
-Inputs:
+Input Parameters:
tcb
: The TCB of new task.
@@ -1658,7 +1659,7 @@ The system can be re-made subsequently by just typing make
.
is defined.
-Inputs:
+Input Parameters:
tcb
: The TCB of new task.
@@ -1694,7 +1695,7 @@ The system can be re-made subsequently by just typing make
.
function is called.
-Inputs: +
Input Parameters:
tcb
: Refers to the tcb to be unblocked. This tcb is
in one of the waiting tasks lists. It must be moved to
@@ -1715,7 +1716,7 @@ The system can be re-made subsequently by just typing make
.
logic. Interrupts will always be disabled when this
function is called.
-Inputs:
+Input Parameters:
tcb
: Refers to a task in the ready-to-run list (normally
the task at the head of the list). It most be
@@ -1771,7 +1772,7 @@ The system can be re-made subsequently by just typing make
.
function is called.
-Inputs:
+Input Parameters:
tcb
: The TCB of the task that has been reprioritized
@@ -2110,6 +2111,236 @@ else
To retrieve that variable use:
+
+ CPUs that support memory management units (MMUs) may provide address environments within which tasks and their child threads execute.
+ The configuration indicates the CPUs ability to support address environments by setting the configuration varabile CONFIG_ADDRENV=y
.
+ These address environments are created only when tasks are created via exec()
or exec_module()
(see include/nuttx/binfmt/binfmt.h
).
+
+ When CONFIG_ADDRENV=y
is set in the board configuration, the CPU-specific logic must provide a set of interfaces as defined in the header file include/nuttx/arch.h
.
+ These interfaces are listed below and described in detail in the following paragraphs.
+
+ The CPU-specific logic must provide two categories in interfaces: +
+
+ Binary Loader Support.
+ These are low-level interfaces used in binfmt/
to instantiate tasks with address environments.
+ These interfaces all operate on type task_addrenv_t
which is an abstract representation of a asks's address environment and must be defined in arch/arch.h if CONFIG_ADDRENVM
is defined.
+ These low-level interfaces include:
+
up_addrenv_create()
:
+ Create an address environment.
+ up_addrenv_vaddr()
:
+ Returns the virtual base address of the address environment.
+ up_addrenv_select()
:
+ Instantiate an address environment.
+ up_addrenv_restore()
:
+ Restore an address environment.
+ up_addrenv_destroy()
:
+ Destroy an address environment.
+ up_addrenv_assign()
:
+ Assign an address environment to a TCB.
+
+ Tasking Support.
+ Other interfaces must be provided to support higher-level interfaces used by the NuttX tasking logic.
+ These interfaces are* used by the functions in sched/
and all operate on the TCB which as been assigned an address environment by up_addrenv_assign()
.
+
up_addrenv_share()
:
+ Clone the address environment assigned to one TCB to another.
+ This operation is done when a pthread is created that share's the same address environment.
+ up_addrenv_release()
:
+ ARelease the TCBs reference to an address environment when a task/thread exits.
+ up_addrenv_create()
Prototype:
+int up_addrenv_create(size_t envsize, FAR task_addrenv_t *addrenv);
+Description:
+up_addrenv_create()
is essentially the allocator of the physical memory for the new task.
+Input Parameters:
+envsize
: The size (in bytes) of the address environment needed by the task.addrenv
: The location to return the representation of the task address environment.Returned Value:
+OK
) on success; a negated errno
value on failure.
+up_addrenv_vaddr()
Prototype:
+
int up_addrenv_vaddr(FAR task_addrenv_t addrenv, FAR void **vaddr);
+Description:
+Input Parameters:
+addrenv
: The representation of the task address environment previously returned by up_addrenv_create.vaddr
: The location to return the virtual address.Returned Value:
+OK
) on success; a negated errno
value on failure.
+up_addrenv_select()
Prototype:
+
int up_addrenv_select(task_addrenv_t addrenv, hw_addrenv_t *oldenv);
+Description:
+up_addrenv_create())
, this function may be called to to instantiate that address environment in the virtual address space.
+ This might be necessary, for example, to load the code for the task from a file or to access address environment private data.
+Input Parameters:
+addrenv
: The representation of the task address environment previously returned by up_addrenv_create.oldenv
:
+ The address environment that was in place before up_addrenv_select()
was called.
+ This may be used with up_addrenv_restore()
to restore the original address environment that was in place before up_addrenv_select()
was called.
+ Note that this may be a task agnostic, hardware representation that is different from task_addrenv_t
.
+ Returned Value:
+OK
) on success; a negated errno
value on failure.
+up_addrenv_restore()
Prototype:
+
int up_addrenv_restore(hw_addrenv_t oldenv);
+Description:
+up_addrenv_select
,
+ this function may be called to to restore the original address environment.
+Input Parameters:
+oldenv
: The hardware representation of the address environment previously returned by up_addrenv_select()
.Returned Value:
+OK
) on success; a negated errno
value on failure.
+up_addrenv_destroy()
Prototype:
+
int up_addrenv_destroy(task_addrenv_t addrenv);
+Description:
+up_addrenv_create()
.
+Input Parameters:
+addrenv
: The representation of the task address environment previously returned by up_addrenv_create.Returned Value:
+OK
) on success; a negated errno
value on failure.
+up_addrenv_assign()
Prototype:
+
int up_addrenv_assign(task_addrenv_t addrenv, FAR _TCB *tcb);
+Description:
+Input Parameters:
+addrenv
: The representation of the task address environment previously returned by up_addrenv_create.tcb
: The TCB of the task to receive the address environment.Returned Value:
+OK
) on success; a negated errno
value on failure.
+up_addrenv_share()
Prototype:
+
int up_addrenv_share(FAR const _TCB *ptcb, FAR _TCB *ctcb);
+Description:
+Input Parameters:
+ptcb
: The TCB of the parent task that has the address environment.ctcb
: The TCB of the child thread needing the address environment.Returned Value:
+OK
) on success; a negated errno
value on failure.
+up_addrenv_release()
Prototype:
+
int up_addrenv_release(FAR _TCB *tcb);
+Description:
+Input Parameters:
+tcb
: The TCB of the task or thread whose the address environment will be released.Returned Value:
+OK
) on success; a negated errno
value on failure.
+
These are standard interfaces that are exported by the OS
@@ -3470,7 +3701,7 @@ extern void up_ledoff(int led);
All PM interfaces are declared in the file include/nuttx/power/pm.h
.
pm_initialize()
Function Prototype:
#include <nuttx/power/pm.h> @@ -3487,7 +3718,7 @@ None None -6.4.2.2 pm_register()
+6.4.2.2
pm_register()
Function Prototype:
#include <nuttx/power/pm.h> @@ -3507,7 +3738,7 @@ int pm_register(FAR struct pm_callback_s *callbacks); Zero (OK
) on success; otherwise a negatererrno
value is returned. -6.4.2.3 pm_activity()
+6.4.2.3
pm_activity()
Function Prototype:
#include <nuttx/power/pm.h> @@ -3534,7 +3765,7 @@ void pm_activity(int priority); This function may be called from an interrupt handler (this is the ONLY PM function that may be called from an interrupt handler!). -6.4.2.4 pm_checkstate()
+6.4.2.4
pm_checkstate()
Function Prototype:
#include <nuttx/power/pm.h> @@ -3561,7 +3792,7 @@ enum pm_state_e pm_checkstate(void); The recommended power management state. -6.4.2.5 pm_changestate()
+6.4.2.5
pm_changestate()
Function Prototype:
#include <nuttx/power/pm.h> @@ -3596,7 +3827,7 @@ enum pm_state_e pm_checkstate(void); These callback functions can be used to provide power management information to the driver. -6.4.3.1 prepare()
+6.4.3.1
prepare()
Function Prototype:
int (*prepare)(FAR struct pm_callback_s *cb, enum pm_state_e pmstate); @@ -3624,7 +3855,7 @@ int (*prepare)(FAR struct pm_callback_s *cb, enum pm_state_e pmstate); consumption modes! -6.4.3.1 notify()
+6.4.3.1
notify()
Function Prototype:
#include <nuttx/power/pm.h>