📄 bsp.t
字号:
@c@c COPYRIGHT (c) 1988-2002.@c On-Line Applications Research Corporation (OAR).@c All rights reserved.@c@c $Id: bsp.t,v 1.9 2002/01/17 21:47:47 joel Exp $@c@chapter Board Support Packages@section IntroductionAn RTEMS Board Support Package (BSP) must be designedto support a particular processor and target board combination.This chapter presents a discussion of SPARC specific BSP issues.For more information on developing a BSP, refer to the chaptertitled Board Support Packages in the RTEMSApplications User's Guide.@section System ResetAn RTEMS based application is initiated orre-initiated when the SPARC processor is reset. When the SPARCis reset, the processor performs the following actions:@itemize @bullet@item the enable trap (ET) of the psr is set to 0 to disabletraps,@item the supervisor bit (S) of the psr is set to 1 to entersupervisor mode, and@item the PC is set 0 and the nPC is set to 4.@end itemizeThe processor then begins to execute the code atlocation 0. It is important to note that all fields in the psrare not explicitly set by the above steps and all otherregisters retain their value from the previous execution mode.This is true even of the Trap Base Register (TBR) whose contentsreflect the last trap which occurred before the reset.@section Processor InitializationIt is the responsibility of the application'sinitialization code to initialize the TBR and install traphandlers for at least the register window overflow and registerwindow underflow conditions. Traps should be enabled beforeinvoking any subroutines to allow for register windowmanagement. However, interrupts should be disabled by settingthe Processor Interrupt Level (pil) field of the psr to 15.RTEMS installs it's own Trap Table as part of initializationwhich is initialized with the contents of the Trap Table inplace when the @code{rtems_initialize_executive} directive was invoked.Upon completion of executive initialization, interrupts areenabled.If this SPARC implementation supports on-chip cachingand this is to be utilized, then it should be enabled during thereset application initialization code.In addition to the requirements described in theBoard Support Packages chapter of the @value{LANGUAGE}Applications User's Manual for the reset codewhich is executed before the call to@code{rtems_initialize_executive}, the SPARC version has the followingspecific requirements:@itemize @bullet@item Must leave the S bit of the status register set so thatthe SPARC remains in the supervisor state.@item Must set stack pointer (sp) such that a minimum stacksize of MINIMUM_STACK_SIZE bytes is provided for the@code{rtems_initialize_executive} directive.@item Must disable all external interrupts (i.e. set the pilto 15).@item Must enable traps so window overflow and underflowconditions can be properly handled.@item Must initialize the SPARC's initial trap table with atleast trap handlers for register window overflow and registerwindow underflow.@end itemize
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -