Hello, Covering for earlier incomplete work left.. I've compiled a bit of information related to how the lpc24xx BSP is organized. The details can also be found here https://docs.google.com/document/d/1W9DMnpocXUKXiQMxHbbp0aG-ecuh94P-3N7hxEJmcgs/edit.
I've tried to cover as much as files as possible. Since the aim here is to note how a unified way for a BSP implementaion should be, therefore the rules will cover those modules of BSP that are present or should be present in every BSP. Please have a look & tell if I've missed any common file that is common across all BSPs or I've included something extra that is only present in lpc24xx. The following structure & rules need to be accepted by the community & improved, so that I can automate checking of these rules. So that the following info is also present on the list & everyone can review it, I'm posting it below : /* Startup Files*/ File : startup/bspstart.c bsp_start() // Performs BSP specific initializations bsp_pretasking_hook() // Empty fo routines using shared framework initialize_console() // (Static function, used in bsp_start()) File : startup/bspstarthooks.c bsp_start_hook_0() bsp_start_hook_1() File : startup/bspreset.c bsp_reset() // Reset /* Interrupt related files*/ File : irq/irq.c bsp_interrupt_vector_enable() // Enable interrupt bsp_interrupt_vector_disable() // Disable interrupt bsp_interrupt_facility_initialize() // Initialize Interrupt Controller , Do other BSP specific initialization. bspxx_irq_get_priority() // Set priority for a vector bspxx_irq_is_valid() // Returns true or false depending on whether a vector is valid or not. I think the inline function bsp_interrupt_is_valid_vector() present in irq-generic.h should be used instead of this. Since, the latter function checks both the lower & upper bounds. File : irq/irq-dispatch.c bsp_interrupt_dispatch() // Reads vector number & calls bsp_interrupt_handler_dispatch() , so as to service the interrupt with the appropriate handler. /* Miscellaneous*/ File : misc/timer.c benchmark_timer_initialize() // Initialize benchmark timer benchmark_timer_read() // Returns benchmark time units benchmark_timer_disable_subtracting_average_overhead() File : misc/restart.c bsp_restart() // Restart File : misc/system-clocks.c bspxx_timer_initialize() // Initialize standard timer /* These above files should be moved to a more proper location, rather than keeping in a miscellaneous folder */ /* Real time clock */ File : 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. /* As per BSP Device Driver Development Guide, the names of above function should be setRealTimeToRTEMS() and setRealTimeFromRTEMS(). I think so.. */ /***********************************************************************************************************/ /* Generic interrupt framework source files*/ File : libbsp/shared/src/irq-default-handler.c// Contains default interrupt handler File : libbsp/shared/src/irq-generic.c// Generic BSP interrupt support implementation File : libbsp/shared/src/irq-info.c//Generic BSP interrupt information implementation File : libbsp/shared/src/irq-legacy.c// Generic BSP interrupt support legacy implementation File : libbsp/shared/src/irq-server.c// Generic BSP interrupt server implementation File : libbsp/shared/src/irq-shell.c// Generic BSP interrupt shell implementation /* Standard Source files that need to be compiledfor all BSPs (hopefully all..) */ File : libbsp/shared/bootcard.c File : libbsp/shared/bspclean.c File : libbsp/shared/bspgetworkarea.c File : libbsp/shared/bsplibc.c File : libbsp/shared/bsppost.c File : libbsp/shared/bsppredriverhook.c File : libbsp/shared/gnatinstallhandler.c File : libbsp/shared/sbrk.c File : libbsp/shared/src/stackalloc.c /*************************************************************************************************************/ /*Header files being installed according to Makefile.am*/ /*BSP specific Header files( Should be named the same across all BSPs) : All BSP specific header files like irq.h , bsp.h etc should be present in the bsp/include folder only. */ File : include/bsp.h// Global Definitions File : include/bspopts.h File : include/irq.h // Interrupt Definitions File : include/system-clocks.h// Declarations for standard timer in system clock File : include/lpc24xx.h // Register Definitions File : include/start-config.h// BSP start configuration File : include/lpc-clock-config.h // Clock driver configuration /* The list of installed headers from above can be more, depending on what extra support a BSP offers. The above present list can be said as a must-install list of bsp specific headers */ /*Generic Interrupt related header files*/ File : libbsp/shared/shared/include/irq-generic.h// Generic BSP interrupt support API File : libbsp/shared/include/irq-info.h// Generic BSP interrupt information API. /*Standard Header Files*/ File : libbsp/shared/include/bootcard.h// Standard system startup. 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/stackalloc.h// Task stack initialization, allocation and free functions File : libbsp/shared/tod.h // Real Time Clock Declrations File : libbsp/shared/include/tm27.h// Timing test Hoping to hear your views & suggestions... Regards Vipul Nayyar
_______________________________________________ rtems-devel mailing list rtems-devel@rtems.org http://www.rtems.org/mailman/listinfo/rtems-devel