Saturday, 10 August 2013

Unified APIs Observations

The broad aim of Unified APIs project is to identify standard patterns of code implementation and file inclusion so that all BSPs follow the one true way in doing stuff and including proper components for it.

To identify this one true way, a specific BSP needs to rise and be recognised as a model for other BSPs by the RTEMS community. Hence, the arm lpc24xx is probably a good reference to start with. Do provide any feedback that you think might help improve this project.

Following are the specifications for the generic IRQ related & other important files that the arm lpc24xx includes based on, and this same pattern must be followed by the other BSPs supported by RTEMS :

Start Files

File : start.S
Location : bsp/start/start.S | libbsp/arch/shared/start/start.S
 _start //  Label associated with the starting address of the program

File : bspstart.c
Location : libbsp/shared/bspstart.c | libbsp/arch/shared/bspstart.c | bsp/startup/bspstart.c
 bsp_start() // Performs BSP specific initializations

File : bspreset.c
Location : libbsp/shared/bspreset.c | libbsp/arch/shared/bspreset.c | bsp/startup/bspreset.c

Standard files used for setting up environment

File : bootcard.c Location : libbsp/shared/bootcard.c Header : libbsp/shared/include/bootcard.h boot_card() // First C code invoked File : bspclean.c Location : libbsp/shared/bspclean.c | bsp/startup/bspclean.c bsp_fatal_extension() // Shutdown File : bspgetworkarea.c Location : libbsp/shared/bspgetworkarea.c | libbsp/arch/shared/bspgetworkarea.c | bsp/startup/bspgetworkarea.c bsp_work_area_initialize() // Initialize the RTEMS Workspace and the C Program Heap File : bsplibc.c Location : libbsp/shared/bsplibc.c bsp_libc_init() // Initialize the C Library File : bsppost.c Location : libbsp/shared/bsppost.c bsp_postdriver_hook() // BSP specific code for the initialization sequence File : bsppredriverhook.c Location : libbsp/shared/bsppredriverhook.c | libbsp/arch/shared/bsppredriverhook.c | bsp/startup/bsppredriverhook.c bsp_predriver_hook() File : gnatinstallhandler.c Location : libbsp/shared/gnatinstallhandler.c // No need to include this during compilation, seems empty !! File : sbrk.c Location : libbsp/shared/sbrk.c | libbsp/arch/shared/sbrk.c | bsp/startup/sbrk.c sbrk() File : stackalloc.c Location : libbsp/shared/src/stackalloc.c Header : libbsp/shared/include/stackalloc.h bsp_stack_allocate_init() // Initialize Heap bsp_stack_allocate() // Allocate Heap bsp_stack_free() // Free Heap

Interrupt Files

File : irq.c Location : bsp/irq/irq.c Header : bsp/include/irq.h bsp_interrupt_vector_enable() // Enable interrupt bsp_interrupt_vector_disable() // Disable interrupt bsp_interrupt_facility_initialize() // Initialize Interrupt Controller, do other BSP specific initialization. bsp_interrupt_dispatch() // Reads vector number & calls bsp_interrupt_handler_dispatch() to service the interrupt with the appropriate handler. File : irq-default-handler.c Location : libbsp/shared/src/irq-default-handler.c // Contains default interrupt handler File : irq-generic.c Location : libbsp/shared/src/irq-generic.c Header : libbsp/shared/include/irq-generic.h // Generic BSP interrupt support implementation File : irq-info.c Location : libbsp/shared/src/irq-info.c Header : libbsp/shared/include/irq-info.h //Generic BSP interrupt information implementation File : irq-legacy.c Location : libbsp/shared/src/irq-legacy.c // Generic BSP interrupt support legacy implementation File : irq-server.c Location : libbsp/shared/src/irq-server.c // Generic BSP interrupt server implementation File : irq-shell.c Location : libbsp/shared/src/irq-shell.c // Generic BSP interrupt shell implementation

Real Time Clock

File : rtc-config.c Location : rtc/rtc-config.c bspxx_rtc_initialize() // Initialize RTC chip bspxx_rtc_get_time() // Get time bspxx_rtc_set_time() // Set time bspxx_rtc_probe() // Returns true if device configured by this entry in the RTC_Table is present. File : tod.c Location : libbsp/shared/tod.c | bsp/tod/tod.c // Real Time Clock Driver Wrapper for Libchip

Benchmark Timers

File : benchmark_timer.c Location : bsp/benchmark_timer/benchmark_timer.c benchmark_timer_initialize() // Initialize benchmark timer benchmark_timer_read() // Returns benchmark time units benchmark_timer_disable_subtracting_average_overhead()

Other installed headers

File : include/bsp.h // Global Definitions File : include/bspopts.h File : include/irq.h // Interrupt Definitions File : libbsp/shared/include/coverhd.h // Defines to represent the overhead associated with calling a particular directive from C File : libbsp/shared/include/utility.h // Utility macros File : libbsp/shared/include/tm27.h // Timing test

No comments:

Post a Comment