diff --git a/Documentation/NuttxPortingGuide.html b/Documentation/NuttxPortingGuide.html index 57f1383884..04f122858c 100644 --- a/Documentation/NuttxPortingGuide.html +++ b/Documentation/NuttxPortingGuide.html @@ -12,7 +12,7 @@
Last Updated: September 28, 2013
+Last Updated: January 25, 2013
@@ -72,44 +72,45 @@ 4.0 Architecture APIsup_initialize()
up_idle()
up_initial_state()
up_create_stack()
up_use_stack()
up_stack_frame()
up_release_stack()
up_unblock_task()
up_block_task()
up_release_pending()
up_reprioritize_rtr()
_exit()
up_assert()
up_schedule_sigaction()
up_allocate_heap()
up_interrupt_context()
up_disable_irq()
up_enable_irq()
up_prioritize_irq()
- 4.1.20 up_putc()
- 4.1.21 System Time and Clockup_initialize()
up_idle()
up_initial_state()
up_create_stack()
up_use_stack()
up_stack_frame()
up_release_stack()
up_unblock_task()
up_block_task()
up_release_pending()
up_reprioritize_rtr()
_exit()
up_assert()
up_schedule_sigaction()
up_allocate_heap()
up_interrupt_context()
up_disable_irq()
up_enable_irq()
up_prioritize_irq()
+ 4.2.20 up_putc()
+ 4.2.21 System Time and Clockos_start()
sched_process_timer()
irq_dispatch()
+ 4.3.1 os_start()
sched_process_timer()
irq_dispatch()
make
.
other header files.
-up_initialize()
+ Common Microprocessor Interfaces.
+ Any interface that is common to all microprocessors should be prefixed with up_
and prototyped in include/nuttx/arch.h
.
+ The definitions in that header file provide the common interface between NuttX and the architecture-specific implementation in arch/
.
+
++up_
is supposed to stand for microprocessor; theu
is like the Greek letter micron: µ. So it would beµP
which is a common shortening of the word microprocessor. I don't like that name very much. I wish I would have used a more obvious prefix likearch_
instead -- then I would not have to answer this question so often. +
+ Microprocessor-Specific Interfaces.
+ An interface which is unique to a certain microprocessor should be prefixed with the name of the microprocessor, for example stm32_
, and be prototyped in some header file in the arch/
directories.
+
+ There is also a arch/
header file that can be used to communicate other microprocessor-specific information between the board logic and even application logic.
+ Application logic may, for example, need to know specific capabilities of the chip.
+ Prototypes in that chip.h
header file should follow the microprocessor-specific naming convention.
+
+ Common Board Interfaces.
+ Any interface that is common to all boards should be prefixed with board_
and should also be prototyped in include/nuttx/arch.h
.
+ These board_
definitions provide the interface between the board-level logic and the architecture-specific logic.
+
+ There is also a configs/
header file that can be used to communicate other board-specific information between the architecture logic and even application logic.
+ Any definitions which are common between a single architecture and several boards should go in this board.h
header file;
+ include/nuttx/arch.h
is reserved for board-related definitions common to all architectures.
+
+ Board-Specific Interfaces.
+ Any interface which is unique to a board should be prefixed with the board name, for example stm32f4discovery_
.
+ Sometimes the board name is too long so stm32_
would be okay too.
+ These should be prototyped in configs/
and should not be used outside of that directory since board-specific definitions have no meaning outside of the board directory.
+
up_initialize()
Prototype: void up_initialize(void);
make
.
services are available.
-up_idle()
up_idle()
Prototype: void up_idle(void);
Description.
@@ -1667,7 +1712,7 @@ The system can be re-made subsequently by just typing make
.
this is where power management operations might be performed.
up_initial_state()
up_initial_state()
Prototype: void up_initial_state(FAR struct tcb_s *tcb);
Description.
@@ -1690,7 +1735,7 @@ The system can be re-made subsequently by just typing make
.
then all threads should have kernel-mode privileges.
up_create_stack()
up_create_stack()
Prototype: STATUS up_create_stack(FAR struct tcb_s *tcb, size_t stack_size, uint8_t ttype);
Description.
@@ -1742,7 +1787,7 @@ The system can be re-made subsequently by just typing make
.
-
up_use_stack()
up_use_stack()
Prototype:
STATUS up_use_stack(FAR struct tcb_s *tcb, FAR void *stack, size_t stack_size);
make
.
-up_stack_frame()
up_stack_frame()
Prototype: FAR void *up_stack_frame(FAR struct tcb_s *tcb, size_t frame_size);
@@ -1831,7 +1876,7 @@ The system can be re-made subsequently by just typing make
.
The alignment of the returned value is the same as the alignment of the stack itself
up_release_stack()
up_release_stack()
Prototype: void up_release_stack(FAR struct tcb_s *dtcb);
Description.
@@ -1870,7 +1915,7 @@ The system can be re-made subsequently by just typing make
.
-
up_unblock_task()
up_unblock_task()
Prototype: void up_unblock_task(FAR struct tcb_s *tcb);
Description.
@@ -1893,7 +1938,7 @@ The system can be re-made subsequently by just typing make
.
-
up_block_task()
up_block_task()
Prototype: void up_block_task(FAR struct tcb_s *tcb, tstate_t task_state);
Description.
@@ -1919,7 +1964,7 @@ The system can be re-made subsequently by just typing make
.
-
up_release_pending()
up_release_pending()
Prototype: void up_release_pending(void);
Description.
@@ -1936,7 +1981,7 @@ The system can be re-made subsequently by just typing make
.
function is called.
up_reprioritize_rtr()
up_reprioritize_rtr()
Prototype: void up_reprioritize_rtr(FAR struct tcb_s *tcb, uint8_t priority);
Description.
@@ -1971,7 +2016,7 @@ The system can be re-made subsequently by just typing make
.
-
_exit()
_exit()
Prototype: void _exit(int status) noreturn_function;
Description.
@@ -1985,7 +2030,7 @@ The system can be re-made subsequently by just typing make
.
before performing scheduling operations.
up_assert()
up_assert()
Prototype:
void up_assert(FAR const uint8_t *filename, int linenum);
make
.
Assertions may be handled in an architecture-specific way.
-up_schedule_sigaction()
up_schedule_sigaction()
Prototype:
void up_schedule_sigaction(FAR struct tcb_s *tcb, sig_deliver_t sigdeliver);
make
.
is defined.
-up_allocate_heap()
up_allocate_heap()
Prototype: void up_allocate_heap(FAR void **heap_start, size_t *heap_size);
Description.
@@ -2052,14 +2097,14 @@ The system can be re-made subsequently by just typing make
.
If a protected kernel-space heap is provided, the kernel heap must be allocated (and protected) by an analogous up_allocate_kheap()
.
up_interrupt_context()
up_interrupt_context()
Prototype: bool up_interrupt_context(void)
Description. Return true if we are currently executing in the interrupt handler context.
-up_disable_irq()
up_disable_irq()
Prototype:
#ifndef CONFIG_ARCH_NOINTC @@ -2086,7 +2131,7 @@ The system can be re-made subsequently by just typingmake
. avoided in common implementations where possible. -4.1.18
+up_enable_irq()
4.2.18
up_enable_irq()
Prototype:
#ifndef CONFIG_ARCH_NOINTC @@ -2107,7 +2152,7 @@ The system can be re-made subsequently by just typingmake
. avoided in common implementations where possible. -4.1.19
+up_prioritize_irq()
4.2.19
up_prioritize_irq()
Prototype:
#ifdef CONFIG_ARCH_IRQPRIO @@ -2124,7 +2169,7 @@ The system can be re-made subsequently by just typingmake
. avoided in common implementations where possible. -4.1.20
+up_putc()
4.2.20
up_putc()
Prototype:
int up_putc(int ch);
Description. @@ -2132,9 +2177,9 @@ The system can be re-made subsequently by just typing
-make
. Output one character on the console4.1.21 System Time and Clock
+4.2.21 System Time and Clock
-4.1.21.1 Basic System Timer
+4.2.21.1 Basic System Timer
System Timer In most implementations, system time is provided by a timer interrupt. @@ -2217,7 +2262,7 @@ else In this way, the timer interval is controlled from interrupt-to-interrupt to produce an average frequency of exactly 100Hz.
-4.1.21.2 Hardware
+4.2.21.2 Hardware
To enable hardware module use the following configuration options:
@@ -2272,7 +2317,7 @@ else -
4.1.21.3 System Tick and Time
+4.2.21.3 System Tick and Time
The system tick is represented by::
@@ -2295,7 +2340,7 @@ else To retrieve that variable use: -4.1.22 Address Environments
+4.2.22 Address Environments
CPUs that support memory management units (MMUs) may provide address environments within which tasks and their child threads execute. @@ -2319,27 +2364,27 @@ else
up_addrenv_create()
:
+ 4.2.22.1 up_addrenv_create()
:
Create an address environment.
up_addrenv_vaddr()
:
+ 4.2.22.2 up_addrenv_vaddr()
:
Returns the virtual base address of the address environment.
up_addrenv_select()
:
+ 4.2.22.3 up_addrenv_select()
:
Instantiate an address environment.
up_addrenv_restore()
:
+ 4.2.22.4 up_addrenv_restore()
:
Restore an address environment.
up_addrenv_destroy()
:
+ 4.2.22.5 up_addrenv_destroy()
:
Destroy an address environment.
up_addrenv_assign()
:
+ 4.2.22.6 up_addrenv_assign()
:
Assign an address environment to a TCB.
up_addrenv_share()
:
+ 4.2.22.7 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()
:
+ 4.2.22.8 up_addrenv_release()
:
Release the TCB's reference to an address environment when a task/thread exits.
up_addrenv_create()
up_addrenv_create()
Prototype:
int up_addrenv_create(size_t envsize, FAR task_addrenv_t *addrenv);
@@ -2385,7 +2430,7 @@ else
Zero (OK
) on success; a negated errno
value on failure.
up_addrenv_vaddr()
up_addrenv_vaddr()
Prototype:
int up_addrenv_vaddr(FAR task_addrenv_t addrenv, FAR void **vaddr);
@@ -2405,7 +2450,7 @@ else
Zero (OK
) on success; a negated errno
value on failure.
up_addrenv_select()
up_addrenv_select()
Prototype:
int up_addrenv_select(task_addrenv_t addrenv, hw_addrenv_t *oldenv);
@@ -2429,7 +2474,7 @@ else
Zero (OK
) on success; a negated errno
value on failure.
up_addrenv_restore()
up_addrenv_restore()
Prototype:
int up_addrenv_restore(hw_addrenv_t oldenv);
@@ -2448,7 +2493,7 @@ else
Zero (OK
) on success; a negated errno
value on failure.
up_addrenv_destroy()
up_addrenv_destroy()
Prototype:
int up_addrenv_destroy(task_addrenv_t addrenv);
@@ -2466,7 +2511,7 @@ else
Zero (OK
) on success; a negated errno
value on failure.
up_addrenv_assign()
up_addrenv_assign()
Prototype:
int up_addrenv_assign(task_addrenv_t addrenv, FAR struct tcb_s *tcb);
@@ -2485,7 +2530,7 @@ else
Zero (OK
) on success; a negated errno
value on failure.
up_addrenv_share()
up_addrenv_share()
Prototype:
int up_addrenv_share(FAR const struct tcb_s *ptcb, FAR struct tcb_s *ctcb);
@@ -2505,7 +2550,7 @@ else
Zero (OK
) on success; a negated errno
value on failure.
up_addrenv_release()
up_addrenv_release()
Prototype:
int up_addrenv_release(FAR struct tcb_s *tcb);
@@ -2525,23 +2570,23 @@ else
Zero (OK
) on success; a negated errno
value on failure.
These are standard interfaces that are exported by the OS for use by the architecture specific logic.
-os_start()
os_start()
To be provided
-To be provided
-sched_process_timer()
sched_process_timer()
Prototype: void sched_process_timer(void);
Description.
@@ -2552,7 +2597,7 @@ else
MSEC_PER_TICK
.
irq_dispatch()
irq_dispatch()
Prototype: void irq_dispatch(int irq, FAR void *context);
Description. @@ -2561,7 +2606,7 @@ else the appropriate, registered handling logic.
-The NuttX On-Demand Paging feature permits embedded MCUs with some limited RAM space to execute large programs from some non-random access media. @@ -2571,7 +2616,7 @@ else Please see the NuttX Demand Paging design document for further information.
-A board architecture may or may not have LEDs. @@ -2581,7 +2626,7 @@ else However, the support provided by each architecture is sufficiently similar that it can be documented here.
-LED-related definitions are provided in two header files: @@ -2605,7 +2650,7 @@ else
-The implementation of LED support is very specific to a board architecture. @@ -2669,7 +2714,7 @@ else -
The <arch-name>/src/common/up_internal.h
probably has definitions
@@ -2679,9 +2724,9 @@ else
/* Defined in board/up_leds.c */
#ifdef CONFIG_ARCH_LEDS
-extern void board_led_initialize(void);
-extern void board_led_on(int led);
-extern void board_led_off(int led);
+void board_led_initialize(void);
+void board_led_on(int led);
+void board_led_off(int led);
#else
# define board_led_initialize()
# define board_led_on(led)
diff --git a/include/nuttx/arch.h b/include/nuttx/arch.h
index 8a9047e805..13336ae8ba 100644
--- a/include/nuttx/arch.h
+++ b/include/nuttx/arch.h
@@ -1,7 +1,7 @@
/****************************************************************************
* include/nuttx/arch.h
*
- * Copyright (C) 2007-2013 Gregory Nutt. All rights reserved.
+ * Copyright (C) 2007-2014 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt