Changeset bc950e87 in rtems
- Timestamp:
- 11/19/98 16:02:06 (25 years ago)
- Branches:
- 4.10, 4.11, 4.8, 4.9, 5, master
- Children:
- d82f3e81
- Parents:
- 06fee20
- Location:
- doc
- Files:
-
- 30 edited
Legend:
- Unmodified
- Added
- Removed
-
doc/bsp_howto/Makefile
r06fee20 rbc950e87 45 45 $(PROJECT).dvi: $(FILES) 46 46 $(TEXI2DVI) $(PROJECT).texi 47 $(TEXI2DVI)$(PROJECT).texi47 texi2dvi $(PROJECT).texi 48 48 49 49 html: dirs $(FILES) … … 56 56 rm -f *.dvi *.ps *.log *.aux *.cp *.fn *.ky *.pg *.toc *.tp *.vr $(BASE) 57 57 rm -f $(PROJECT) $(PROJECT)-* $(GENERATED_FILES) 58 rm -f *.fixed _* 58 rm -f *.fixed _* network.t 59 60 # 61 # Grab the chapter on writing a network device driver. 62 # 63 network.t: 64 ln -s ../networking/driver.t network.t 65 59 66 60 67 # … … 80 87 $(BMENU) -p "Makefiles Creating a New BSP Make Customization File" \ 81 88 -u "Top" \ 82 -n " Required Support Routines" ${*}.t89 -n "Miscellaneous Support Files" ${*}.t 83 90 84 91 support.texi: support.t Makefile -
doc/bsp_howto/analog.t
r06fee20 rbc950e87 9 9 @chapter Analog Driver 10 10 11 XXX FILL ME IN 11 The Analog driver is responsible for providing an 12 interface to Digital to Analog Converters (DACs) and 13 Analog to Digital Converters (ADCs). The capabilities provided 14 by this class of device driver are: 12 15 16 @itemize @bullet 17 @item Initialize an Analog Board 18 @item Open a Particular Analog 19 @item Close a Particular Analog 20 @item Read from a Particular Analog 21 @item Write to a Particular Analog 22 @item Reset DACs 23 @item Reinitialize DACS 24 @end itemize 25 26 Most analog devices are found on I/O cards that support multiple 27 DACs or ADCs on a single card. 28 29 There are currently no analog device drivers included in the 30 RTEMS source tree. The information provided in this chapter 31 is based on drivers developed by OAR Corporation personnel 32 for applications using RTEMS. It is hoped that this 33 driver model information can form the basis for a standard 34 analog driver model that can be supported in future RTEMS 35 distribution. 36 37 @section Major and Minor Numbers 38 39 The @b{major} number of a device driver is its index in the 40 RTEMS Device Address Table. 41 42 A @b{minor} number is associated with each device instance 43 managed by a particular device driver. An RTEMS minor number 44 is an @code{unsigned32} entity. Convention calls 45 dividing the bits in the minor number down into categories 46 like the following: 47 48 @itemize @bullet 49 50 @item @b{board} - indicates the board a particular device is located on 51 @item @b{port} - indicates the particular device on a board. 52 53 @end itemize 54 55 From the above, it should be clear that a single device driver 56 can support multiple copies of the same board in a single system. 57 The minor number is used to distinguish the devices. 58 59 @section Analog Driver Configuration 60 61 There is not a standard analog driver configuration table but some 62 fields are common across different drivers. The analog driver 63 configuration table is typically an array of structures with each 64 structure containing the information for a particular board. 65 The following is a list of the type of information normally required 66 to configure an analog board: 67 68 @table @b 69 @item board_offset 70 is the base address of a board. 71 72 @item DAC_initial_values 73 is an array of the voltages that should be written to each DAC 74 during initialization. This allows the driver to start the board 75 in a known state. 76 77 @end table 78 79 @section Initialize an Analog Board 80 81 At system initialization, the analog driver's initialization entry point 82 will be invoked. As part of initialization, the driver will perform 83 whatever board initializatin is required and then set all 84 outputs to their configured initial state. 85 86 The analog driver may register a device name for each DAC and ADC in 87 the system. 88 89 @section Open a Particular Analog 90 91 This is the driver open call. Usually this call does nothing other than 92 validate the minor number. 93 94 With some drivers, it may be necessary to allocate memory when a particular 95 device is opened. If that is the case, then this is often the place 96 to do this operation. 97 98 @section Close a Particular Analog 99 100 This is the driver close call. Usually this call does nothing. 101 102 With some drivers, it may be necessary to allocate memory when a particular 103 device is opened. If that is the case, then this is the place 104 where that memory should be deallocated. 105 106 @section Read from a Particular Analog 107 108 This corresponds to the driver read call. After validating the minor 109 number and arguments, this call reads the indicated device. Most analog 110 devices store the last value written to a DAC. Since DACs are output 111 only devices, saving the last written value gives the appearance that 112 DACs can be read from also. If the device is an ADC, then it is sampled. 113 114 @b{NOTE:} Many boards have multiple analog inputs but only one ADC. On 115 these boards, it will be necessary to provide some type of mutual exclusion 116 during reads. On these boards, there is a MUX which must be switched 117 before sampling the ADC. After the MUX is switched, the driver must 118 delay some short period of time (usually microseconds) before the 119 signal is stable and can be sampled. To make matters worse, some ADCs 120 cannot respond to wide voltage swings in a single sample. On these 121 ADCs, one must do two samples when the voltage swing is too large. 122 On a practical basis, this means that the driver usually ends up 123 double sampling the ADC on these systems. 124 125 The value returned is a single precision floating point number 126 representing the voltage read. This value is stored in the 127 @code{argument_block} passed in to the call. By returning the 128 voltage, the caller is freed from having to know the number of 129 bits in the analog and board dependent conversion algorithm. 130 131 @section Write to a Particular Analog 132 133 This corresponds to the driver write call. After validating the minor 134 number and arguments, this call writes the indicated device. If the 135 specified device is an ADC, then an error is usually returned. 136 137 The value written is a single precision floating point number 138 representing the voltage to be written to the specified DAC. 139 This value is stored in the @code{argument_block} passed in to the 140 call. By passing the voltage to the device driver, the caller is 141 freed from having to know the number of bits in the analog 142 and board dependent conversion algorithm. 143 144 @section Reset DACs 145 146 This is one of the IOCTL functions supported by the I/O control 147 device driver entry point. When this IOCTL function is invoked, 148 all of the DACs are written to 0.0 volts. 149 150 @section Reinitialize DACS 151 152 This is one of the IOCTL functions supported by the I/O control 153 device driver entry point. When this IOCTL function is invoked, 154 all of the DACs are written with the initial value configured 155 for this device. 156 157 @section Get Last Written Values 158 159 This is one of the IOCTL functions supported by the I/O control 160 device driver entry point. When this IOCTL function is invoked, 161 the last value written to the specified output word along with 162 a timestamp of when the last write was performed. 163 -
doc/bsp_howto/bsp_howto.texi
r06fee20 rbc950e87 90 90 * Makefiles:: 91 91 * Linker Script:: 92 * Required Support Routines::92 * Miscellaneous Support Files:: 93 93 * Initialization Code:: 94 94 * Console Driver:: -
doc/bsp_howto/clock.t
r06fee20 rbc950e87 11 11 @section Introduction 12 12 13 The clock driver aims at giving a steady time basis to the kernel, so that 14 the RTEMS primitives that need a clock tick work properly. <insert a link 15 to the Clock Driver defs> 13 The purpose of the clock driver is to provide a steady time 14 basis to the kernel, so that the RTEMS primitives that need 15 a clock tick work properly. See the @code{Clock Manager} chapter 16 of the @b{RTEMS Application C User's Guide} for more details. 16 17 17 The clock driver is located in the clockdirectory of the BSP.18 The clock driver is located in the @code{clock} directory of the BSP. 18 19 19 @section Primitives20 @section Clock Driver Global Variables 20 21 21 @subsection Initialization22 @subsection Major and Minor Number 22 23 23 The major and minor numbers of the clock driver can be made available to24 the others, such as the Shared Memory Driver.24 The major and minor numbers of the clock driver are made available via 25 the following variables. 25 26 26 Then you have to program your integrated processor periodic interval timer 27 so that an interrupt is generated every m microseconds, where m = 28 BSP_Configuration.microseconds_per_tick. Sometimes the periodic interval 27 @itemize @bullet 28 @item rtems_device_major_number rtems_clock_major; 29 @item rtems_device_minor_number rtems_clock_minor; 30 @end itemize 31 32 The clock device driver is responsible for declaring and 33 initializing these variables. These variables are used 34 by other RTEMS components -- notably the Shared Memory Driver. 35 36 @b{NOTE:} In a future RTEMS version, these variables may be replaced 37 with the clock device driver registering @b{/dev/clock}. 38 39 @subsection Ticks Counter 40 41 Most of the clock device drivers provide a global variable 42 that is simply a count of the number of clock driver interrupt service 43 routines that have occured. This information is valuable when debugging 44 a system. This variable is declared as follows: 45 46 @example 47 volatile rtems_unsigned32 Clock_driver_ticks; 48 @end example 49 50 @section Initialization 51 52 The initialization routine is responsible for 53 programming the hardware that will periodically 54 generate an interrupt. A programmable interval timer is commonly 55 used as the source of the clock tick. 56 57 The device should be programmed such that an interrupt is generated 58 every @i{m} microseconds, where @i{m} is equal to 59 @code{BSP_Configuration.microseconds_per_tick}. Sometimes the periodic interval 29 60 timer can use a prescaler so you have to look carefully at your user's 30 61 manual to determine the correct value. 31 62 32 You must use the RTEMS primitive to put your clock interrupt routine in33 the VBR: 63 You must use the RTEMS primitive @code{rtems_interrupt_catch} to install 64 your clock interrupt service routine: 34 65 35 66 @example 36 rtems_interrupt_catch ( InterruptHandler, CONSOLE_VECTOR, &old_handler);67 rtems_interrupt_catch (Clock_ISR, CLOCK_VECTOR, &old_handler); 37 68 @end example 38 69 39 @subsection The Clock Interrupt Subroutine 70 Since there is currently not a driver entry point invoked at system 71 shutdown, many clock device drivers use the @code{atexit} routine 72 to schedule their @code{Clock_exit} routine to execute when the 73 system is shutdown. 74 75 By convention, many of the clock drivers do not install the clock 76 tick if the @code{ticks_per_timeslice} field of the Configuration 77 Table is 0. 78 79 @section System shutdown 80 81 Many drivers provide the routine @code{Clock_exit} that is scheduled 82 to be run during system shutdown via the @code{atexit} routine. 83 The @code{Clock_exit} routine will disable the clock tick source 84 if it was enabled. This can be used to prevent clock ticks after the 85 system is shutdown. 86 87 @section Clock Interrupt Subroutine 40 88 41 89 It only has to inform the kernel that a ticker has elapsed, so call : 42 90 43 91 @example 44 rtems_clock_tick(); 92 @group 93 rtems_isr Clock_isr( rtems_vector_number vector ) 94 @{ 95 invoke the rtems_clock_tick() directive to announce the tick 96 if necessary for this hardware 97 reload the programmable timer 98 @} 99 @end group 45 100 @end example 46 101 102 @section IO Control 103 104 The clock driver must supply a handler for the IO control device driver 105 entry point. This functionality is used by other components -- notably 106 the Shared Memory Driver to install a wrapper for the clock interrupt 107 service routine. The following shows the functionality required: 108 109 @example 110 @group 111 rtems_device_driver Clock_control( 112 rtems_device_major_number major, 113 rtems_device_minor_number minor, 114 void *pargp 115 ) 116 @{ 117 error check the argument pointer parameter 118 119 if the command is "ISR" 120 invoke the clock interrupt service routine 121 else if the command is "NEW" 122 install the requested handler 123 @} 124 @end group 125 @end example 126 127 128 129 -
doc/bsp_howto/console.t
r06fee20 rbc950e87 11 11 @section Introduction 12 12 13 This chapter describes how to do a console driver using RTEMS Termios 14 support. 15 16 The serial driver is called as soon as printf/scanf or read/write kind of 17 input/output are needed. There are two main functioning modes: 13 This chapter describes the operation of a console driver using 14 the RTEMS POSIX Termios support. Traditionally RTEMS has referred 15 to all serial device drivers as console device drivers. A 16 console driver can be used to do raw data processing in addition 17 to the "normal" standard input and output device functions required 18 of a console. 19 20 The serial driver may be called as the consequence of a C Library 21 call such as @code{printf} or @code{scanf} or directly via the 22 @code{read} or @code{write} system calls. 23 There are two main functioning modes: 18 24 19 25 @itemize @bullet 20 26 21 27 @item console: formatted input/output, with special characters (end of 22 line, tabulations, etc. ..) recognition and processing,28 line, tabulations, etc.) recognition and processing, 23 29 24 30 @item raw: permits raw data processing. … … 31 37 @section Termios 32 38 33 Termios is a standard for terminal management, included in several Unix 34 versions. Termios is good because: 35 36 @itemize @bullet 37 38 @item from the user's side: primitives to access the terminal and change 39 configuration settings are the same under Unix and Rtems. 40 41 @item from the BSP developer's side: it frees you from dealing with buffer 42 states and mutual exclusions on them. 39 Termios is a standard for terminal management, included in the POSIX 1003.1b 40 standard. It is commonly provided on UNIX implementations. 41 Having RTEMS support for Termios is beneficial: 42 43 @itemize @bullet 44 45 @item from the user's side because it provides standard primitive operations 46 to access the terminal and change configuration settings. These operations 47 are the same under Unix and Rtems. 48 49 @item from the BSP developer's side because it frees the 50 developer from dealing with buffer states and mutual exclusions on them. 51 Early RTEMS console device drivers also did their own special 52 character processing. 43 53 44 54 @end itemize … … 55 65 @end itemize 56 66 57 For more information on Termios, type man termios in your Unix box or go 58 to http://www.freebsd.org/cgi/man.cgi. 67 At this time, RTEMS documentation does not include a thorough discussion 68 of the Termios functionality. For more information on Termios, 69 type @code{man termios} on a Unix box or point a web browser 70 at 71 @ifset use-html 72 @href{http://www.freebsd.org/cgi/man.cgi,,,http://www.freebsd.org/cgi/man.cgi}. 73 @end ifset 74 @ifclear use-html 75 @code{http://www.freebsd.org/cgi/man.cgi}. 76 @end ifclear 59 77 60 78 @section Driver Functioning Modes … … 65 83 @itemize @bullet 66 84 67 @item polling mode: the processor blocks on sending/receiving characters. 68 This mode is not powerful, but is necessary when one wants to print an 69 error message when the board hung. This is also the most simple mode to 70 program, 71 72 @item interrupt mode: the processor doesn't block on sending/receiving 73 characters. Two buffers (one for the in-going characters, the others for 74 the characters to be sent) are used. An interrupt is raised as soon as a 75 character is in the UART. Then the int errupt subroutine insert the 76 character at the input buffer queue. When a character is asked for input, 77 this at the head of the buffer is returned. When characters have to be 78 sent, one have to put the first characters (the number depends on the 79 UART) in th e UART. Then an interrupt is raised when all the characters 80 have been emitted. The interrupt subroutine has to send the characters 81 remaining in the output buffer the same way. 82 83 @end itemize 85 @item polled mode 86 @item interrupt driven mode 87 88 @end itemize 89 90 In polled mode, the processor blocks on sending/receiving characters. 91 This mode is not the most efficient way to utilize the UART. But 92 polled mode is usually necessary when one wants to print an 93 error message in the event of a fatal error such as al fatal error 94 in the BSP. This is also the simplest mode to 95 program. Polled mode is generally preferred if the serial port is 96 to be used primarily as a debug console. In a simple polled driver, 97 the software will continuously check the status of the UART when 98 it is reading or writing to the UART. Termios improves on this 99 by delaying the caller for 1 clock tick between successive checks 100 of the UART on a read operation. 101 102 In interrupt driven mode, the processor does not block on sending/receiving 103 characters. Data is buffered between the interrupt service routine 104 and application code. Two buffers are used to insulate the application 105 from the relative slowness of the serial device. One of the buffers is 106 used for incoming characters, while the other is used for outgoing characters. 107 108 An interrupt is raised when a character is received by the UART. 109 The interrupt subroutine places the incoming character at the end 110 of the input buffer. When an application asks for input, 111 the characters at the front of the buffer are returned. 112 113 When the application prints to the serial device, the outgoing characters 114 are placed at the end of the output buffer. The driver will place 115 one or more characters in the UART (the exact number depends on the UART) 116 An interrupt will be raised when all the characters have been transmitted. 117 The interrupt service routine has to send the characters 118 remaining in the output buffer the same way. When the transmitting side 119 of the UART is idle, it is typically necessary to prime the transmitter 120 before the first interrupt will occur. 84 121 85 122 @section Serial Driver Functioning Overview 86 123 87 Figure 5 is an attempt of showing how a Termios driven serial driver works : 124 The following Figure shows how a Termios driven serial driver works: 125 126 @example 127 This figure needs to be inserted in this document. 128 @end example 129 130 The following list describes the basic flow. 88 131 89 132 @itemize @bullet … … 92 135 scanf, read, write, etc.), 93 136 94 @item C library (in fact that's Cygnus Newlib) calls RTEMS procedure: glue95 is made in newlib*.c files which can be found under 96 $RTEMS_ROOT/c/src/lib/libc directory, 97 98 @item Glue code calls yourserial driver entry routines.137 @item C library (in fact that's Cygnus Newlib) calls RTEMS 138 system call interface. This code can be found in the 139 @code{c/src/lib/libc} directory. 140 141 @item Glue code calls the serial driver entry routines. 99 142 100 143 @end itemize … … 102 145 @subsection Termios and Polled I/O 103 146 104 You have to point Termios out which functions are used for simple 105 character input/output: 106 107 108 Function 109 110 Description 111 112 @example 147 The following functions are provided by the driver and invoked by 148 Termios for simple character input/output. The specific names of 149 these routines are not important as Termios invokes them indirectly 150 via function pointers. 151 152 @subsubsection pollWrite 153 154 The @code{pollWrite} routine is responsible for writing @code{len} characters 155 from @code{buf} to the serial device specified by @code{minor}. 156 157 @example 158 @group 113 159 int pollWrite (int minor, const char *buf, int len) 114 115 for (i=0; i<len; i++) @{160 @{ 161 for (i=0; i<len; i++) @{ 116 162 put buf[i] into the UART channel minor 117 163 wait for the character to be transmitted 118 164 on the serial line 165 @} 119 166 @} 120 int pollread(int minor) 121 @end example 122 123 wait for a character to be available in the UART channel minor, then return it. 167 @end group 168 @end example 169 170 @subsubsection pollRead 171 172 The @code{pollRead} routine is responsible for reading a single character 173 from the serial device specified by @code{minor}. If no character is 174 available, then the routine should return -1. 175 176 @example 177 @group 178 int pollRead(int minor) 179 @{ 180 read status of UART 181 if status indicates a character is available 182 return character 183 return -1 184 @} 185 @end group 186 @end example 124 187 125 188 @subsection Termios and Interrupt Driven I/O … … 127 190 The UART generally generates interrupts when it is ready to accept or to 128 191 emit a number of characters. In this mode, the interrupt subroutine is the 129 core of the driver: 130 131 @example 192 core of the driver. 193 194 @subsubsection InterruptHandler 195 196 The @code{InterruptHandler} is responsible for processing asynchronous 197 interrupts from the UART. There may be multiple interrupt handlers for 198 a single UART. Some UARTs can generate a unique interrupt vector for 199 each interrupt source such as a character has been received or the 200 transmitter is ready for another character. 201 202 In the simplest case, the @code{InterruptHandler} will have to check 203 the status of the UART and determine what caused the interrupt. 204 The following describes the operation of an @code{InterruptHandler} 205 which has to do this: 206 207 @example 208 @group 132 209 rtems_isr InterruptHandler (rtems_vector_number v) 133 @end example 134 135 check whether there was an error 136 137 if some characters were received: 138 ask Termios to put them on his input buffer 139 140 if some characters have been transmitted (i.e. the UART output buffer is empty) 141 tell TERMIOS that the characters have been 142 transmitted. The TERMIOS routine will call 143 the InterruptWrite function with the number 144 of characters not transmitted yet if it is 145 not zero. 210 @{ 211 check whether there was an error 212 213 if some characters were received: 214 Ask Termios to put them on his input buffer 215 216 if some characters have been transmitted 217 (i.e. the UART output buffer is empty) 218 Tell TERMIOS that the characters have been 219 transmitted. The TERMIOS routine will call 220 the InterruptWrite function with the number 221 of characters not transmitted yet if it is 222 not zero. 223 @} 224 @end group 225 @end example 226 227 @subsubsection InterruptWrite 228 229 The @code{InterruptWrite} is responsible for telling the UART 230 that the @code{len} characters at @code{buf} are to be transmitted. 146 231 147 232 @example 148 233 static int InterruptWrite(int minor, const char *buf, int len) 149 @end example 150 151 you have to put the n first buf characters in the UART channel minor 152 buffer (n is the UART channel size, n=1 on the MC68640). Generally, an 153 interrupt is raised after these n characters being transmitted. So you may 154 have to enable the UART interrupts after having put the characters in the 234 @{ 235 tell the UART to transmit len characters from buf 236 @} 237 @end example 238 239 The driver has to put the @i{n} first buf characters in the UART channel minor 240 buffer (@i{n} is the UART channel size, @i{n}=1 on the MC68640). Generally, an 241 interrupt is raised after these @i{n} characters being transmitted. So 242 UART interrupts may have to be enabled after putting the characters in the 155 243 UART. 156 244 157 245 158 Figure 5: general TERMIOS driven serial driver functioning159 160 246 @subsection Initialization 161 247 162 The driver initialization is called once during RTEMS initialization248 The driver initialization is called once during the RTEMS initialization 163 249 process. 164 250 165 The console_initialize function has to : 166 167 @itemize @bullet 168 169 @item initialize Termios support: call rtems_termios_initialize(), 170 171 @item initialize your integrated processor's UART: the operation is 172 normally described in your user's manual and you must follow these 173 instructions but it usually consists in: 174 175 @item reinitialize the UART channels, 176 177 @item set the channels configuration to Termios default one, i.e.: 9600 178 bauds, no parity, 1 stop bit, 8 bits per character, 179 180 @item register your console interrupt routine to RTEMS: 251 The @code{console_initialize} function has to: 252 253 @itemize @bullet 254 255 @item initialize Termios support: call @code{rtems_termios_initialize()}. If 256 Termios has already been initialized by another device driver, then 257 this call will have no effect. 258 259 @item Initialize the UART: This procedure should 260 be described in the UART manual. This procedure @b{MUST} be 261 followed precisely. This procedure varies but 262 usually consists of: 263 264 @itemize @bullet 265 @item reinitialize the UART channels 266 267 @item set the channels configuration to the Termios default: 268 9600 bauds, no parity, 1 stop bit, and 8 bits per character 269 @end itemize 270 271 @item If interrupt driven, register the console interrupt routine to RTEMS: 181 272 182 273 @example … … 184 275 @end example 185 276 186 @item enable the UART channels ,187 188 @item register yourdevice name: in order to use the console (i.e. being189 able to do printf/scanf on stdin, stdout, and stderr), you have to190 register the "/dev/console" device: 277 @item enable the UART channels. 278 279 @item register the device name: in order to use the console (i.e. being 280 able to do printf/scanf on stdin, stdout, and stderr), some device 281 must be registered as "/dev/console": 191 282 192 283 @example … … 198 289 @subsection Opening a serial device 199 290 200 The console device is opened during RTEMS initialization but the 201 console_open function is called when a new device is opened. For instance, 202 if you register the "/dev/tty1" device for the UART channel 2, the 203 console_open will be called with a fopen("/dev/t ty", mode) in your 291 The @code{console_open} function is called whenever a serial 292 device is opened. The device registered as @code{"/dev/console"} 293 is opened automatically during RTEMS initialization. 294 For instance, if UART channel 2 is registered as "/dev/tty1", 295 the @code{console_open} entry point will be called as 296 the result of an @code{fopen("/dev/tty1", mode)} in the 204 297 application. 205 298 206 The console_open function has to inform Termios of your low-level function 207 for serial line support; the "callbacks". 208 209 The gen68340 BSP defines two kinds of callbacks: 210 211 @itemize @bullet 212 213 @item functions to use with polled input/output, 214 215 @item functions to use with interrupt input/output. 216 217 @end itemize 299 The @code{console_open} function has to inform Termios of the low-level 300 functions for serial line support; the "callbacks". 301 302 The gen68340 BSP defines two sets of callback tables: 303 304 @itemize @bullet 305 306 @item one with functions for polled input/output 307 308 @item another with functions for interrupt driven input/output 309 310 @end itemize 311 312 This code can be found in the file @code{$BSPROOT/console/console.c}. 218 313 219 314 @subsubsection Polled I/O 220 315 221 You have to point Termios out which functions are used for simple 222 character input/output, i.e. pointers to pollWrite and pollRead functions 223 defined in 8.4.1. 316 Termios must be told the addresses of the functions that are to be 317 used for simple character input/output, i.e. pointers to the 318 @code{pollWrite} and @code{pollRead} functions 319 defined earlier in @ref{Console Driver Termios and Polled I/O}. 224 320 225 321 @subsubsection Interrupt Driven I/O 226 322 227 Driver functioning is quite different in this mode. You can see there's no 228 read function passed to Termios. Indeed a console_read call returns the 229 content of Termios input buffer. This buffer is filled in the driver 230 interrupt subroutine (cf. 8.4.2). 231 232 But you actually have to provide a pointer to the InterruptWrite function. 233 234 @subsection Closing a serial device 235 236 The driver entry point is: console_close. 237 238 You just have to notify Termios that the serial device was closed, with a 239 call to rtems_termios_close. 240 241 @subsection Reading characters from the serial device 242 243 The driver entry point is: console_read. 244 245 You just have to return the content of the Termios input buffer. 246 247 Call rtems_termios_read. 248 249 @subsection Writing characters to the serial device 250 251 The driver entry point is: console_write. 252 253 You just have to add the characters at the end of the Termios output 323 Driver functioning is quite different in this mode. There is no 324 device driver read function to be passed to Termios. Indeed a 325 @code{console_read} call returns the contents of Termios input buffer. 326 This buffer is filled in the driver interrupt subroutine 327 (see @ref{Console Driver Termios and Interrupt Driven I/O}). 328 329 The driver is responsible for providing a pointer to the 330 @code{InterruptWrite} function. 331 332 @subsection Closing a Serial Device 333 334 The @code{console_close} is invoked when the serial device is to 335 be closed. This entry point corresponds to the device driver 336 close entry point. 337 338 This routine is responsible for notifying Termios that the serial 339 device was closed. This is done with a call to @code{rtems_termios_close}. 340 341 @subsection Reading Characters From a Serial Device 342 343 The @code{console_read} is invoked when the serial device is to 344 be read from. This entry point corresponds to the device driver 345 read entry point. 346 347 This routine is responsible for returning the content of the 348 Termios input buffer. This is done by invoking the 349 @code{rtems_termios_read} routine. 350 351 @subsection Writing Characters to a Serial Device 352 353 The @code{console_write} is invoked when the serial device is to 354 be written to. This entry point corresponds to the device driver 355 write entry point. 356 357 This routine is responsible for adding the requested characters to 358 the Termios output queue for this device. This is done by 359 calling the routine @code{rtems_termios_write} 360 to add the characters at the end of the Termios output 254 361 buffer. 255 362 256 Call rtems_termios_write. 257 258 @subsection Changing serial line parameters 259 260 The driver entry point is: console_control. 363 @subsection Changing Serial Line Parameters 364 365 The @code{console_control} is invoked when the line parameters 366 for a particular serial device are to be changed. 367 This entry point corresponds to the device driver 368 io_control entry point. 261 369 262 370 The application write is able to control the serial line configuration 263 with Termios calls (such as the ioctl command, see Termios man page for 264 more details). If you want to support dynamic configuration, you have to 265 write the console_control piece of code . Look at the gen68340 BSP for an 266 example of how it is done. Basically ioctl commands call console_control 267 with the serial line configuration in a Termios structure. You just have 268 to reinitialize the UART with the correct settings. 269 371 with Termios calls (such as the @code{ioctl} command, see 372 the Termios documentation for 373 more details). If the driver is to support dynamic configuration, then 374 is must have the @code{console_control} piece of code. Refer to the gen68340 375 BSP for an example of how it is done. Basically @code{ioctl} 376 commands call @code{console_control} with the serial line 377 configuration in a Termios defined data structure. The driver 378 is responsible for reinitializing the UART with the correct settings. 379 -
doc/bsp_howto/discrete.t
r06fee20 rbc950e87 9 9 @chapter Discrete Driver 10 10 11 XXX FILL ME IN 11 The Discrete driver is responsible for providing an 12 interface to Discrete Input/Outputs. The capabilities provided 13 by this class of device driver are: 12 14 15 @itemize @bullet 16 @item Initialize a Discrete I/O Board 17 @item Open a Particular Discrete Bitfield 18 @item Close a Particular Discrete Bitfield 19 @item Read from a Particular Discrete Bitfield 20 @item Write to a Particular Discrete Bitfield 21 @item Reset DACs 22 @item Reinitialize DACS 23 @end itemize 24 25 Most discrete I/O devices are found on I/O cards that support many 26 bits of discrete I/O on a single card. This driver model is centered 27 on the notion of reading bitfields from the card. 28 29 There are currently no discrete I/O device drivers included in the 30 RTEMS source tree. The information provided in this chapter 31 is based on drivers developed by OAR Corporation personnel 32 for applications using RTEMS. It is hoped that this 33 driver model information can form the basis for a standard 34 discrete I/O driver model that can be supported in future RTEMS 35 distribution. 36 37 @section Major and Minor Numbers 38 39 The @b{major} number of a device driver is its index in the 40 RTEMS Device Address Table. 41 42 A @b{minor} number is associated with each device instance 43 managed by a particular device driver. An RTEMS minor number 44 is an @code{unsigned32} entity. Convention calls for 45 dividing the bits in the minor number down into categories 46 that specify a particular bitfield. This results in categories 47 like the following: 48 49 @itemize @bullet 50 51 @item @b{board} - indicates the board a particular bitfield is located on 52 @item @b{word} - indicates the particular word of discrete bits the 53 bitfield is located within 54 @item @b{start} - indicates the starting bit of the bitfield 55 @item @b{width} - indicates the width of the bitfield 56 57 @end itemize 58 59 From the above, it should be clear that a single device driver 60 can support multiple copies of the same board in a single system. 61 The minor number is used to distinguish the devices. 62 63 By providing a way to easily access a particular bitfield from 64 the device driver, the application is insulated with knowing how 65 to mask fields in and out of a discrete I/O. 66 67 @section Discrete I/O Driver Configuration 68 69 There is not a standard discrete I/O driver configuration table but some 70 fields are common across different drivers. The discrete I/O driver 71 configuration table is typically an array of structures with each 72 structure containing the information for a particular board. 73 The following is a list of the type of information normally required 74 to configure an discrete I/O board: 75 76 @table @b 77 @item board_offset 78 is the base address of a board. 79 80 @item relay_initial_values 81 is an array of the values that should be written to each output 82 word on the board during initialization. This allows the driver 83 to start with the board's output in a known state. 84 85 @end table 86 87 @section Initialize a Discrete I/O Board 88 89 At system initialization, the discrete I/O driver's initialization entry point 90 will be invoked. As part of initialization, the driver will perform 91 whatever board initializatin is required and then set all 92 outputs to their configured initial state. 93 94 The discrete I/O driver may register a device name for bitfields of 95 particular interest to the system. Normally this will be restricted 96 to the names of each word and, if the driver supports it, an "all words". 97 98 @section Open a Particular Discrete Bitfield 99 100 This is the driver open call. Usually this call does nothing other than 101 validate the minor number. 102 103 With some drivers, it may be necessary to allocate memory when a particular 104 device is opened. If that is the case, then this is often the place 105 to do this operation. 106 107 @section Close a Particular Discrete Bitfield 108 109 This is the driver close call. Usually this call does nothing. 110 111 With some drivers, it may be necessary to allocate memory when a particular 112 device is opened. If that is the case, then this is the place 113 where that memory should be deallocated. 114 115 @section Read from a Particular Discrete Bitfield 116 117 This corresponds to the driver read call. After validating the minor 118 number and arguments, this call reads the indicated bitfield. A 119 discrete I/O devices may have to store the last value written to 120 a discrete output. If the bitfield is output only, saving the last 121 written value gives the appearance that it can be read from also. 122 If the bitfield is input, then it is sampled. 123 124 @b{NOTE:} Many discrete inputs have a tendency to bounce. The application 125 may have to take account for bounces. 126 127 The value returned is an @code{unsigned32} number 128 representing the bitfield read. This value is stored in the 129 @code{argument_block} passed in to the call. 130 131 @b{NOTE:} Some discrete I/O drivers have a special minor number 132 used to access all discrete I/O bits on the board. If this special 133 minor is used, then the area pointed to by @code{argument_block} must 134 be the correct size. 135 136 @section Write to a Particular Discrete Bitfield 137 138 This corresponds to the driver write call. After validating the minor 139 number and arguments, this call writes the indicated device. If the 140 specified device is an ADC, then an error is usually returned. 141 142 The value written is an @code{unsigned32} number 143 representing the value to be written to the specified 144 bitfield. This value is stored in the 145 @code{argument_block} passed in to the call. 146 147 @b{NOTE:} Some discrete I/O drivers have a special minor number 148 used to access all discrete I/O bits on the board. If this special 149 minor is used, then the area pointed to by @code{argument_block} must 150 be the correct size. 151 152 @section Disable Discrete Outputs 153 154 This is one of the IOCTL functions supported by the I/O control 155 device driver entry point. When this IOCTL function is invoked, 156 the discrete outputs are disabled. 157 158 @b{NOTE:} It may not be possible to disable/enable discrete output on all 159 discrete I/O boards. 160 161 @section Enable Discrete Outputs 162 163 This is one of the IOCTL functions supported by the I/O control 164 device driver entry point. When this IOCTL function is invoked, 165 the discrete outputs are enabled. 166 167 @b{NOTE:} It may not be possible to disable/enable discrete output on all 168 discrete I/O boards. 169 170 @section Reinitialize Outputs 171 172 This is one of the IOCTL functions supported by the I/O control 173 device driver entry point. When this IOCTL function is invoked, 174 the discrete outputs are rewritten with the configured initial 175 output values. 176 177 @section Get Last Written Values 178 179 This is one of the IOCTL functions supported by the I/O control 180 device driver entry point. When this IOCTL function is invoked, 181 the last value written to the specified output word along with 182 a timestamp of when the last write was performed. 183 -
doc/bsp_howto/init.t
r06fee20 rbc950e87 22 22 initialization code. Like most BSPs, the initialization for this 23 23 BSP is divided into two subdirectories under the BSP source directory. 24 The gen68340 BSP source code in the following directory: 25 26 @example 27 c/src/lib/libbsp/m68k/gen68340: 28 @end example 24 The gen68340 BSP source code is in the following directory: 25 26 @example 27 c/src/lib/libbsp/m68k/gen68340 28 @end example 29 30 The following source code files are in this subdirectory. 29 31 30 32 @itemize @bullet … … 46 48 contains initialization for a 68349 based board as well. 47 49 50 @section Required Global Variables 51 52 Although not strictly part of initialization, there are a few global 53 variables assumed to exist by many support components. These 54 global variables are usually declared in the file @code{startup/bspstart.c} 55 that provides most of the BSP specific initialization. The following is 56 a list of these global variables: 57 58 @itemize @bullet 59 @item @code{BSP_Configuration} is the BSP's writable copy of the RTEMS 60 Configuration Table. 61 62 @item @code{Cpu_table} is the RTEMS CPU Dependent Information Table. 63 64 @item @code{bsp_isr_level} is the interrupt level that is set at 65 system startup. It will be restored when the executive returns 66 control to the BSP. 67 68 @end itemize 69 48 70 @section Board Initialization 49 71 … … 77 99 78 100 The @code{boot_card()} is the first C code invoked. Most of the BSPs 79 use the sam sshared version of @code{boot_card()} which is located in101 use the same shared version of @code{boot_card()} which is located in 80 102 the following file: 81 103 … … 129 151 This routine is also responsible for overriding the default settings 130 152 in the CPU Configuration Table and setting port specific entries 131 in this table. This routine will typically install routines 132 for one or more of the following initialization hooks: 153 in this table. This may include increasing the maximum number 154 of some types of RTEMS system objects to reflect the needs of 155 the BSP and the base set of device drivers. This routine will 156 typically also install routines for one or more of the following 157 initialization hooks: 133 158 134 159 @itemize @bullet … … 173 198 174 199 In addition to the implicit invocation of @code{__main}, this 175 routine performs some expli tit initialization. This routine200 routine performs some explicit initialization. This routine 176 201 sets the variable @code{rtems_progname} and initiates 177 202 multitasking via a call to the RTEMS directive … … 180 205 RTEMS directive @code{rtems_shutdown_executive} is invoked. 181 206 207 The RTEMS initialization procedure is described in the @b{Initialization 208 Manager} chapter of the @b{RTEMS Application C User's Guide}. 209 Please refer to that manual for more information. 210 182 211 @subsection RTEMS Pretasking Callback 183 212 184 213 The @code{pretasking_hook} entry in the RTEMS CPU Configuration 185 214 Table may be the address of a user provided routine that is 186 invoked once RTEMS initialization is complete but before interrupts215 invoked once RTEMS API initialization is complete but before interrupts 187 216 and tasking are enabled. No tasks -- not even the IDLE task -- have 188 217 been created when this hook is invoked. The pretasking hook is optional. … … 198 227 The @code{bsp_pretasking_hook()} routine is the appropriate place to 199 228 initialize any support components which depend on the RTEMS APIs. 200 Most BSPs initialize the RTEMS C Library support in their 229 Most BSPs set the debug level for the system and initialize the 230 RTEMS C Library support in their 201 231 implementation of @code{bsp_pretasking_hook()}. This initialization 202 includes the application heap as well as the reentrancy support 203 for the C Library. 232 includes the application heap used by the @code{malloc} family 233 of routines as well as the reentrancy support for the C Library. 234 235 The routine @code{bsp_libc_init} routine invoked from the 236 @code{bsp_pretasking_hook()} routine is passed the starting 237 address, length, and growth amount passed to @code{sbrk}. 238 This "sbrk amount" is only used if the heap runs out of 239 memory. In this case, the RTEMS malloc implementation will 240 invoked @code{sbrk} to obtain more memory. See 241 @ref{Miscellaneous Support Files sbrk() Implementation} for more details. 204 242 205 243 @subsection RTEMS Predriver Callback 206 244 207 XXX is the address of the user provided 208 routine which is invoked with tasking enabled immediately before 209 the MPCI and device drivers are initialized. RTEMS 210 initialization is complete, interrupts and tasking are enabled, 211 but no device drivers are initialized. This field may be NULL to 212 indicate that the hook is not utilized. 245 The @code{predriver_hook} entry in the RTEMS CPU Configuration 246 Table may be the address of a user provided routine that is 247 is invoked immediately before the the device drivers and MPCI 248 are initialized. RTEMS 249 initialization is complete but interrupts and tasking are disabled. 250 This field may be NULL to indicate that the hook is not utilized. 251 252 Most BSPs do not use this callback. 213 253 214 254 @subsection Device Driver Initialization … … 216 256 At this point in the initialization sequence, the initialization 217 257 routines for all of the device drivers specified in the Device 218 Driver Table are invoked. 258 Driver Table are invoked. The initialization routines are invoked 259 in the order they appear in the Device Driver Table. 260 261 The Driver Address Table is part of the RTEMS Configuration Table. It 262 defines device drivers entry points (initialization, open, close, read, 263 write, and control). For more information about this table, please 264 refer to the @b{Configuring a System} chapter in the 265 @b{RTEMS Application C User's Guide}. 266 267 The RTEMS initialization procedure calls the initialization function for 268 every driver defined in the RTEMS Configuration Table (this allows 269 one to include only the drivers needed by the application). 270 271 All these primitives have a major and a minor number as arguments: 272 273 @itemize @bullet 274 275 @item the major number refers to the driver type, 276 277 @item the minor number is used to control two peripherals with the same 278 driver (for instance, we define only one major number for the serial 279 driver, but two minor numbers for channel A and B if there are two 280 channels in the UART). 281 282 @end itemize 219 283 220 284 @subsection RTEMS Postdriver Callback 221 285 222 XXX is the address of the user provided 223 routine which is invoked with tasking enabled immediately after 224 the MPCI and device drivers are initialized. RTEMS 225 initialization is complete, interrupts and tasking are enabled, 226 and the device drivers are initialized. This field may be NULL 227 to indicate that the hook is not utilized. 228 229 230 @section The Interrupts Vector Table 231 232 233 234 After the entry label starts a code section in which some room is 235 allocated for the table of interrupts vectors. They are assigned to the 236 address of the __uhoh label. 237 238 At __uhoh label you can find the default interrupt handler routine. This 239 routine is only called when an unexpected interrupts is raised. You can 240 add your own routine there (in that case there's a call to a routine - 241 $BSP_ROOT/startup/dumpanic.c - that pri nts which address caused the 242 interrupt and the contents of the registers, stack...), but this should 286 The @code{postdriver_hook} entry in the RTEMS CPU Configuration 287 Table may be the address of a user provided routine that is 288 invoked immediately after the the device drivers and MPCI are initialized. 289 Interrupts and tasking are disabled. The postdriver hook is optional. 290 291 Although optional, most of the RTEMS BSPs provide a postdriver hook 292 callback. This routine is usually called @code{bsp_postdriver_hook} 293 and is found in the file: 294 295 @example 296 c/src/lib/libbsp/CPU/BSP/startup/bsppost.c 297 @end example 298 299 The @code{bsp_postdriver_hook()} routine is the appropriate place to 300 perform initialization that must be performed before the first task 301 executes but requires that a device driver be initialized. The 302 shared implementation of the postdriver hook opens the default 303 standard in, out, and error files and associates them with 304 @code{/dev/console}. 305 306 @section The Interrupt Vector Table 307 308 The Interrupt Vector Table is called different things on different 309 processor families but the basic functionality is the same. Each 310 entry in the Table corresponds to the handler routine for a particular 311 interrupt source. When an interrupt from that source occurs, the 312 specified handler routine is invoked. Some context information is 313 saved by the processor automatically when this happens. RTEMS saves 314 enough context information so that an interrupt service routine 315 can be implemented in a high level language. 316 317 On some processors, the Interrupt Vector Table is at a fixed address. If 318 this address is in RAM, then usually the BSP only has to initialize 319 it to contain pointers to default handlers. If the table is in ROM, 320 then the application developer will have to take special steps to 321 fill in the table. 322 323 If the base address of the Interrupt Vector Table can be dynamically 324 changed to an arbitrary address, then the RTEMS port to that processor 325 family will usually allocate its own table and install it. For example, 326 on some members of the Motorola MC68xxx family, the Vector Base Register 327 (@code{vbr}) contains this base address. 328 329 @subsection Interrupt Vector Table on the gen68340 BSP 330 331 The gen68340 BSP provides a default Interrupt Vector Table in the 332 file @code{$BSP_ROOT/start340/start340.s}. After the @code{entry} 333 label is the definition of space reserved for the table of 334 interrupts vectors. This space is assigned the symbolic name 335 of @code{__uhoh} in the @code{gen68340} BSP. 336 337 At @code{__uhoh} label is the default interrupt handler routine. This 338 routine is only called when an unexpected interrupts is raised. One can 339 add their own routine there (in that case there's a call to a routine - 340 $BSP_ROOT/startup/dumpanic.c - that prints which address caused the 341 interrupt and the contents of the registers, stack, etc.), but this should 243 342 not return. 244 343 … … 246 345 247 346 When the microprocessor accesses a memory area, address decoding is 248 handled by an address decoder (!), so that the microprocessor knows which 249 memory chip to access. 250 251 Figure 4 : address decoding 252 253 You have to program your Chip Select registers in order that they match 254 the linkcmds settings. In this BSP ROM and RAM addresses can be found in 255 both the linkcmds and initialization code, but this is not a great way to 256 do, better use some shared variables . 257 258 @section Integrated processor registers initialization 259 260 There are always some specific integrated processor registers 261 initialization to do. Integrated processors' user manuals often detail 262 them. 263 264 @section Data section recopy 347 handled by an address decoder, so that the microprocessor knows which 348 memory chip(s) to access. The following figure illustrates this: 349 350 @example 351 @group 352 +-------------------+ 353 ------------| | 354 ------------| |------------ 355 ------------| Address |------------ 356 ------------| Decoder |------------ 357 ------------| |------------ 358 ------------| | 359 +-------------------+ 360 CPU Bus Chip Select 361 @end group 362 @end example 363 364 365 The Chip Select registers must be programmed such that they match 366 the @code{linkcmds} settings. In the gen68340 BSP, ROM and RAM 367 addresses can be found in both the @code{linkcmds} and initialization 368 code, but this is not a great way to do this. It is better to 369 define addresses in the linker script. 370 371 @section Integrated Processor Registers Initialization 372 373 The CPUs used in many embedded systems are highly complex devices 374 with multiple peripherals on the CPU itself. For these devices, 375 there are always some specific integrated processor registers 376 that must be initialized. Refer to the processors' manuals for 377 details on these registers and be VERY careful programming them. 378 379 @section Data Section Recopy 265 380 266 381 The next initialization part can be found in 267 $BSP340_ROOT/start340/init68340.c. First the Interrupt Vector Table is 268 copied into RAM, then the data section recopy is initiated269 (_CopyDataClearBSSAndStart in $BSP340_ROOT/start340/startfor340only.s).382 @code{$BSP340_ROOT/start340/init68340.c}. First the Interrupt 383 Vector Table is copied into RAM, then the data section recopy is initiated 384 (_CopyDataClearBSSAndStart in @code{$BSP340_ROOT/start340/startfor340only.s}). 270 385 271 386 This code performs the following actions: … … 274 389 275 390 @item copies the .data section from ROM to its location reserved in RAM 276 (see 5.2 for more details about this copy), 277 278 @item clear .bss section (all the non-initialized data will take value 0). 279 280 @end itemize 281 282 Then control is passed to the RTEMS-specific initialization code. 391 (see @ref{Linker Script Initialized Data} for more details about this copy), 392 393 @item clear @code{.bss} section (all the non-initialized 394 data will take value 0). 395 396 @end itemize 283 397 284 398 @section RTEMS-Specific Initialization … … 291 405 structures. 292 406 293 The RTEMS configuration table is application dependant, which means that 294 one has to provide one per application. It's usually an header file 295 included in the main module of the application. 296 297 The BSP_Configuration label points on this table. 298 299 For more information on the RTEMS configuration table, refer to C user's 300 guide, chapter 23 <insert a link here>. 301 302 @section RTEMS initialization procedure 303 304 The RTEMS initialization procedure is described in the 3rd chapter of the 305 C user's manual <insert a link here>. Please read it carefully. 306 307 There are a few BSP specific functions called from the initialization 308 manager. They can be found in the startup directory of the BSP. 309 310 @table @b 311 312 @item bspstart.c 313 314 It starts the application. It includes application, board, and monitor 315 specific initialization and configuration. 316 317 @item bspstart.c 318 319 @table @b 320 @item bsp_pretasking_hook 321 322 It starts libc support (needed to allocate some memory using C primitive 323 malloc for example). Heap size must be passed in argument, this is the one 324 which is defined in the linkcmds (cf. 5.) 325 326 327 @end table 328 329 @item bspclean.c 330 331 @table @b 332 333 @item bsp_cleanup 334 335 Return control to the monitor. 336 337 @end table 338 339 @end table 340 341 @section Drivers initialization 342 343 The Driver Address Table is part of the RTEMS configuration table. It 344 defines RTEMS drivers entry points (initialization, open, close, read, 345 write, and control). For more information about this table, check C User's 346 manual chapter 21 section 6 <insert a l ink here>. 347 348 The RTEMS initialization procedure calls the initialization function for 349 every driver defined in the RTEMS Configuration Table (this permits to add 350 only the drivers needed by the application). 351 352 All these primitives have a major and a minor number as arguments: 353 354 @itemize @bullet 355 356 @item the major number refers to the driver type, 357 358 @item the minor number is used to control two peripherals with the same 359 driver (for instance, we define only one major number for the serial 360 driver, but two minor numbers for channel A and B if there are two 361 channels in the UART). 362 363 @end itemize 364 407 The RTEMS configuration table is application dependent, which means that 408 one has to provide one per application. It is usually defined 409 by defining macros and including the header file @code{<confdefs.h>}. 410 In simple applications such as the tests provided with RTEMS, it is 411 commonly found in the main module of the application. For more complex 412 applications, it may be in a file by itself. 413 414 The header file @code{<confdefs.h>} defines a constant table named 415 @code{Configuration}. It is common practice for the BSP to copy 416 this table into a modifiable copy named @code{BSP_Configuration}. 417 This copy of the table is modified to define the base address of the 418 RTEMS Executive Workspace as well as to reflect any BSP and 419 device driver requirements not automatically handled by the application. 420 421 For more information on the RTEMS Configuration Table, refer to the 422 @b{RTEMS Application C User's Guide}. 423 -
doc/bsp_howto/network.t
r06fee20 rbc950e87 1 @c2 @c COPYRIGHT (c) 1988-1998.3 @c On-Line Applications Research Corporation (OAR).4 @c All rights reserved.5 @c6 @c $Id$7 @c8 9 @chapter Networking Driver10 11 XXX FILL ME IN12 -
doc/bsp_howto/nvmem.t
r06fee20 rbc950e87 9 9 @chapter Non-Volatile Memory Driver 10 10 11 XXX FILL ME IN 12 11 The Non-Volatile driver is responsible for providing an 12 interface to various types of non-volatile memory. These 13 types of memory include, but are not limited to, Flash, EEPROM, 14 and battery backed RAM. The capabilities provided 15 by this class of device driver are: 16 17 @itemize @bullet 18 @item Initialize the Non-Volatile Memory Driver 19 @item Optional Disable Read and Write Handlers 20 @item Open a Particular Memory Partition 21 @item Close a Particular Memory Partition 22 @item Read from a Particular Memory Partition 23 @item Write to a Particular Memory Partition 24 @item Erase the Non-Volatile Memory Area 25 @end itemize 26 27 There is currently only one non-volatile device driver included in the 28 RTEMS source tree and it does not adhere to this device driver model. 29 The information provided in this chapter is based on drivers developed 30 by OAR Corporation personnel for applications using RTEMS. It is 31 hoped that this driver model information can form the basis for a standard 32 non-volatile memory driver model that can be supported in future RTEMS 33 distribution. 34 35 @section Major and Minor Numbers 36 37 The @b{major} number of a device driver is its index in the 38 RTEMS Device Address Table. 39 40 A @b{minor} number is associated with each device instance 41 managed by a particular device driver. An RTEMS minor number 42 is an @code{unsigned32} entity. Convention calls 43 dividing the bits in the minor number down into categories 44 that specify an area of non-volatile memory and a partition 45 with that area. This results in categories 46 like the following: 47 48 @itemize @bullet 49 50 @item @b{area} - indicates a block of non-volatile memory 51 @item @b{partition} - indicates a particular address range with an area 52 53 @end itemize 54 55 From the above, it should be clear that a single device driver 56 can support multiple types of non-volatile memory in a single system. 57 The minor number is used to distinguish the types of memory and 58 blocks of memory used for different purposes. 59 60 @section Non-Volatile Memory Driver Configuration 61 62 There is not a standard non-volatile driver configuration table but some 63 fields are common across different drivers. The non-volatile memory driver 64 configuration table is typically an array of structures with each 65 structure containing the information for a particular area of 66 non-volatile memory. 67 The following is a list of the type of information normally required 68 to configure each area of non-volatile memory 69 70 @table @b 71 @item memory_type 72 is the type of memory device in this area. Choices are battery backed RAM, 73 EEPROM, Flash, or an optional user-supplied type. If the user-supplied type 74 is configured, then the user is responsible for providing a set of 75 routines to program the memory. 76 77 @item memory 78 is the base address of this memory area. 79 80 @item attributes 81 is a pointer to a memory type specific attribute block. Some of 82 the fields commonly contained in this memory type specific attribute 83 structure area: 84 85 @table @b 86 @item use_protection_algorithm 87 is set to TRUE to indicate that the protection (i.e. locking) algorithm 88 should be used for this area of non-volatile memory. A particular 89 type of non-volatile memory may not have a protection algorithm. 90 91 @item access 92 is an enumerated type to indicate the organization of the memory 93 devices in this memory area. The following is a list of the 94 access types supported by the current driver implementation: 95 96 @itemize @bullet 97 @item simple unsigned8 98 @item simple unsigned16 99 @item simple unsigned32 100 @item simple unsigned64 101 @item single unsigned8 at offset 0 in an unsigned16 102 @item single unsigned8 at offset 1 in an unsigned16 103 @item single unsigned8 at offset 0 in an unsigned32 104 @item single unsigned8 at offset 1 in an unsigned32 105 @item single unsigned8 at offset 2 in an unsigned32 106 @item single unsigned8 at offset 3 in an unsigned32 107 @end itemize 108 109 @item depth 110 is the depth of the progamming FIFO on this particular chip. Some 111 chips, particularly EEPROMs, have the same programming algorithm but 112 vary in the depth of the amount of data that can be programmed in a single 113 block. 114 115 @end table 116 117 @item number_of_partitions 118 is the number of logical partitions within this area. 119 120 @item Partitions 121 is the address of table that contains an entry to describe each 122 partition in this area. Fields within each element of this 123 table are defined as follows: 124 125 @table @b 126 127 @item offset 128 is the offset of this partition from the base address of this area. 129 130 @item length 131 is the length of this partition. 132 133 @end table 134 @end table 135 136 By dividing an area of memory into multiple partitions, it is possible 137 to easily divide the non-volatile memory for different purposes. 138 139 @section Initialize the Non-Volatile Memory Driver 140 141 At system initialization, the non-volatile memory driver's 142 initialization entry point will be invoked. As part of 143 initialization, the driver will perform 144 whatever initializatin is required on each non-volatile memory area. 145 146 The discrete I/O driver may register devices name for memory 147 partitions of particular interest to the system. Normally this 148 will be restricted to the device "/dev/nv_memory" to indicate 149 the entire device driver. 150 151 @section Disable Read and Write Handlers 152 153 Depending on the target's non-volatile memory configuration, it may be 154 possible to write to a status register and make the memory area completely 155 inaccessible. This is target dependent and beyond the standard capabilities 156 of any memory type. The user has the optional capability to provide 157 handlers to disable and enable access to a partiticular memory area. 158 159 @section Open a Particular Memory Partition 160 161 This is the driver open call. Usually this call does nothing other than 162 validate the minor number. 163 164 With some drivers, it may be necessary to allocate memory when a particular 165 device is opened. If that is the case, then this is often the place 166 to do this operation. 167 168 @section Close a Particular Memory Partition 169 170 This is the driver close call. Usually this call does nothing. 171 172 With some drivers, it may be necessary to allocate memory when a particular 173 device is opened. If that is the case, then this is the place 174 where that memory should be deallocated. 175 176 @section Read from a Particular Memory Partition 177 178 This corresponds to the driver read call. After validating the minor 179 number and arguments, this call enables reads from the specified 180 memory area by invoking the user supplied "enable reads handler" 181 and then reads the indicated memory area. When 182 invoked the @code{argument_block} is actually a pointer to the following 183 structure type: 184 185 @example 186 @group 187 typedef struct @{ 188 rtems_unsigned32 offset; 189 void *buffer; 190 rtems_unsigned32 length; 191 rtems_unsigned32 status; 192 @} Non_volatile_memory_Driver_arguments; 193 @end group 194 @end example 195 196 The driver reads @code{length} bytes starting at @code{offset} into 197 the partition and places them at @code{buffer}. The result is returned 198 in @code{status}. 199 200 After the read operation is complete, the user supplied "disable reads handler" 201 is invoked to protect the memory area again. 202 203 @section Write to a Particular Memory Partition 204 205 This corresponds to the driver write call. After validating the minor 206 number and arguments, this call enables writes to the specified 207 memory area by invoking the "enable writes handler", then unprotecting 208 the memory area, and finally actually writing to the indicated memory 209 area. When invoked the @code{argument_block} is actually a pointer to 210 the following structure type: 211 212 @example 213 @group 214 typedef struct @{ 215 rtems_unsigned32 offset; 216 void *buffer; 217 rtems_unsigned32 length; 218 rtems_unsigned32 status; 219 @} Non_volatile_memory_Driver_arguments; 220 @end group 221 @end example 222 223 The driver writes @code{length} bytes from @code{buffer} and 224 writes them to the non-volatile memory starting at @code{offset} into 225 the partition. The result is returned in @code{status}. 226 227 After the write operation is complete, the "disable writes handler" 228 is invoked to protect the memory area again. 229 230 @section Erase the Non-Volatile Memory Area 231 232 This is one of the IOCTL functions supported by the I/O control 233 device driver entry point. When this IOCTL function is invoked, 234 the specified area of non-volatile memory is erased. 235 -
doc/bsp_howto/rtc.t
r06fee20 rbc950e87 9 9 @chapter Real-Time Clock Driver 10 10 11 XXX FILL ME IN 11 @section Introduction 12 12 13 The Real-Time Clock (@b{RTC}) driver is responsible for providing an 14 interface to an @b{RTC} device. [NOTE: In this chapter, the abbreviation 15 @b{TOD} is used for @b{Time of Day}.] The capabilities provided by this 16 driver are: 17 18 @itemize @bullet 19 @item Set the RTC TOD to RTEMS TOD 20 @item Set the RTEMS TOD to the RTC TOD 21 @item Get the RTC TOD 22 @item Set the RTC TOD to the Specified TOD 23 @item Get the Difference Between the RTEMS and RTC TOD 24 @end itemize 25 26 The reference implementation for a real-time clock driver can 27 be found in @code{c/src/lib/libbsp/shared/tod.c}. This driver 28 is based on the libchip concept and can be easily configured 29 to work with any of the RTC chips supported by the RTC 30 chip drivers in the directory @code{c/src/lib/lib/libchip/rtc}. 31 There is a README file in this directory for each supported 32 RTC chip. Each of these README explains how to configure the 33 shared libchip implementation of the RTC driver for that particular 34 RTC chip. 35 36 The DY-4 DMV177 BSP uses the shared libchip implementation of the RTC 37 driver. Its @code{RTC_Table} configuration table can be found in 38 @code{c/src/lib/libbsp/powerpc/dmv177/tod/config.c}. 39 40 @section Initialization 41 42 The @code{rtc_initialize} routine is responsible for initializing the 43 RTC chip so it can be used. The shared libchip implementation of this 44 driver supports multiple RTCs and bases its initialization order on 45 the order the chips are defined in the @code{RTC_Table}. Each chip 46 defined in the table may or may not be present on this particular board. 47 It is the responsibility of the @code{deviceProbe} to indicate the 48 presence of a particular RTC chip. The first RTC found to be present 49 is considered the preferred RTC. 50 51 In the shared libchip based implementation 52 of the driver, the following actions are performed: 53 54 @example 55 @group 56 rtems_device_driver rtc_initialize( 57 rtems_device_major_number major, 58 rtems_device_minor_number minor_arg, 59 void *arg 60 ) 61 @{ 62 for each RTC configured in RTC_Table 63 if the deviceProbe for this RTC indicates it is present 64 set RTC_Minor to this device 65 set RTC_Present to TRUE 66 break out of this loop 67 68 if RTC_Present is not TRUE 69 return RTEMS_INVALID_NUMBER to indicate that no RTC is present 70 71 register this minor number as the "/dev/rtc" 72 73 perform the deviceInitialize routine for the preferred RTC chip 74 75 for RTCs past this one in the RTC_Table 76 if the deviceProbe for this RTC indicates it is present 77 perform the deviceInitialize routine for this RTC chip 78 register the configured name for this RTC 79 @} 80 @end group 81 @end example 82 83 The @code{deviceProbe} routine returns TRUE if the device 84 configured by this entry in the @code{RTC_Table} is present. 85 This configuration scheme allows one to support multiple versions 86 of the same board with a single BSP. For example, if the first 87 generation of a board had Vendor A's RTC chip and the second 88 generation had Vendor B's RTC chip, RTC_Table could contain 89 information for both. The @code{deviceProbe} configured 90 for Vendor A's RTC chip would need to return TRUE if the 91 board was a first generation one. The @code{deviceProbe} 92 routines are very board dependent. 93 94 @section setRealTimeToRTEMS 95 96 The @code{setRealTimeToRTEMS} routine sets the current RTEMS TOD to that 97 of the preferred RTC. 98 99 @example 100 @group 101 void setRealTimeToRTEMS(void) 102 @{ 103 if no RTCs are present 104 return 105 106 invoke the deviceGetTime routine for the preferred RTC 107 set the RTEMS TOD using rtems_clock_set 108 @} 109 @end group 110 @end example 111 112 @section setRealTimeFromRTEMS 113 114 The @code{setRealTimeFromRTEMS} routine sets the preferred RTC TOD to the 115 current RTEMS TOD. 116 117 @example 118 @group 119 void setRealTimeFromRTEMS(void) 120 @{ 121 if no RTCs are present 122 return 123 124 obtain the RTEMS TOD using rtems_clock_get 125 invoke the deviceSetTime routine for the preferred RTC 126 @} 127 @end group 128 @end example 129 130 @section getRealTime 131 132 The @code{getRealTime} returns the preferred RTC TOD to the 133 caller. 134 135 @example 136 @group 137 void getRealTime( rtems_time_of_day *tod ) 138 @{ 139 if no RTCs are present 140 return 141 142 invoke the deviceGetTime routine for the preferred RTC 143 @} 144 @end group 145 @end example 146 147 @section setRealTime 148 149 The @code{setRealTime} routine sets the preferred RTC TOD to the 150 TOD specified by the caller. 151 152 @example 153 @group 154 void setRealTime( rtems_time_of_day *tod ) 155 @{ 156 if no RTCs are present 157 return 158 159 invoke the deviceSetTime routine for the preferred RTC 160 @} 161 @end group 162 @end example 163 164 @section checkRealTime 165 166 The @code{checkRealTime} routine returns the number of seconds 167 difference between the RTC TOD and the current RTEMS TOD. 168 169 @example 170 @group 171 int checkRealTime( void ) 172 @{ 173 if no RTCs are present 174 return -1 175 176 177 obtain the RTEMS TOD using rtems_clock_get 178 get the TOD from the preferred RTC using the deviceGetTime routine 179 180 convert the RTEMS TOD to seconds 181 convert the RTC TOD to seconds 182 183 return the RTEMS TOD in seconds - RTC TOD in seconds 184 @} 185 @end group 186 @end example 187 -
doc/bsp_howto/shmsupp.t
r06fee20 rbc950e87 9 9 @chapter Shared Memory Support Driver 10 10 11 XXX FILL ME IN 12 11 The Shared Memory Support Driver is responsible for providing glue 12 routines and configuration information required by the Shared 13 Memory Multiprocessor Communications Interface (MPCI). The 14 Shared Memory Support Driver tailors the portable Shared 15 Memory Driver to a particular target platform. 16 17 This driver is only required in shared memory multiprocessing 18 systems that use the RTEMS mulitprocessing support. For more 19 information on RTEMS multiprocessing capabilities and the 20 MPCI, refer to the @b{Multiprocessing Manager} chapter 21 of the @b{RTEMS Application C User's Guide}. 22 23 @section Shared Memory Configuration Table 24 25 The Shared Memory Configuration Table is defined in the following 26 structure: 27 28 @example 29 @group 30 typedef volatile rtems_unsigned32 vol_u32; 31 32 typedef struct @{ 33 vol_u32 *address; /* write here for interrupt */ 34 vol_u32 value; /* this value causes interrupt */ 35 vol_u32 length; /* for this length (0,1,2,4) */ 36 @} Shm_Interrupt_information; 37 38 struct shm_config_info @{ 39 vol_u32 *base; /* base address of SHM */ 40 vol_u32 length; /* length (in bytes) of SHM */ 41 vol_u32 format; /* SHM is big or little endian */ 42 vol_u32 (*convert)(); /* neutral conversion routine */ 43 vol_u32 poll_intr; /* POLLED or INTR driven mode */ 44 void (*cause_intr)( rtems_unsigned32 ); 45 Shm_Interrupt_information Intr; /* cause intr information */ 46 @}; 47 48 typedef struct shm_config_info shm_config_table; 49 @end group 50 @end example 51 52 where the fields are defined as follows: 53 54 @table @b 55 @item base 56 is the base address of the shared memory buffer used to pass 57 messages between the nodes in the system. 58 59 @item length 60 is the length (in bytes) of the shared memory buffer used to pass 61 messages between the nodes in the system. 62 63 @item format 64 is either SHM_BIG or SHM_LITTLE to indicate that the neutral format 65 of the shared memory area is big or little endian. The format 66 of the memory should be chosen to match most of the inter-node traffic. 67 68 @item convert 69 is the address of a routine which converts from native format to 70 neutral format. Ideally, the neutral format is the same as the 71 native format so this routine is quite simple. 72 73 @item poll_intr 74 is either INTR_MODE or POLLED_MODE to indicate how the node will be 75 informed of incoming messages. 76 77 @item cause_intr 78 79 @item Intr 80 is the information required to cause an interrupt on a node. This 81 structure contains the following fields: 82 @table @b 83 @item address 84 is the address to write at to cause an interrupt on that node. 85 For a polled node, this should be NULL. 86 87 @item value 88 is the value to write to cause an interrupt. 89 90 @item length 91 is the length of the entity to write on the node to cause an interrupt. 92 This can be 0 to indicate polled operation, 1 to write a byte, 2 to 93 write a sixteen-bit entity, and 4 to write a thirty-two bit entity. 94 @end table 95 @end table 96 97 @section Primitives 98 99 @subsection Convert Address 100 101 The @code{Shm_Convert_address} is responsible for converting an address 102 of an entity in the shared memory area into the address that should be 103 used from this node. Most targets will simply return the address 104 passed to this routine. However, some target boards will have a special 105 window onto the shared memory. For example, some VMEbus boards have 106 special address windows to access addresses that are normally reserved 107 in the CPU's address space. 108 109 @example 110 @group 111 void *Shm_Convert_address( void *address ) 112 @{ 113 return the local address version of this bus address 114 @} 115 @end group 116 @end example 117 118 @subsection Get Configuration 119 120 The @code{Shm_Get_configuration} routine is responsible for filling in the 121 Shared Memory Configuration Table passed to it. 122 123 @example 124 @group 125 void Shm_Get_configuration( 126 rtems_unsigned32 localnode, 127 shm_config_table **shmcfg 128 ) 129 @{ 130 fill in the Shared Memory Configuration Table 131 @} 132 @end group 133 @end example 134 135 @subsection Locking Primitives 136 137 This is a collection of routines that are invoked by the portable 138 part of the Shared Memory Driver to manage locks in the shared 139 memory buffer area. Accesses to the shared memory must be 140 atomic. Two nodes in a multiprocessor system must not be manipulating 141 the shared data structures simultaneously. The locking primitives 142 are used to insure this. 143 144 To avoid deadlock, local processor interrupts should be disabled the entire 145 time the locked queue is locked. 146 147 The locking primitives operate on the lock 148 @code{field} of the @code{Shm_Locked_queue_Control} 149 data structure. This structure is defined as follows: 150 151 @example 152 @group 153 typedef struct @{ 154 vol_u32 lock; /* lock field for this queue */ 155 vol_u32 front; /* first envelope on queue */ 156 vol_u32 rear; /* last envelope on queue */ 157 vol_u32 owner; /* receiving (i.e. owning) node */ 158 @} Shm_Locked_queue_Control; 159 @end group 160 @end example 161 162 where each field is defined as follows: 163 164 @table @b 165 @item lock 166 is the lock field. Every node in the system must agree on how this 167 field will be used. Many processor families provide an atomic 168 "test and set" instruction that is used to manage this field. 169 170 @item front 171 is the index of the first message on this locked queue. 172 173 @item rear 174 is the index of the last message on this locked queue. 175 176 @item owner 177 is the node number of the node that currently has this structure locked. 178 179 @end table 180 181 @subsubsection Initializing a Shared Lock 182 183 The @code{Shm_Initialize_lock} routine is responsible for 184 initializing the lock field. This routines usually is implemented 185 as follows: 186 187 @example 188 @group 189 void Shm_Initialize_lock( 190 Shm_Locked_queue_Control *lq_cb 191 ) 192 @{ 193 lq_cb->lock = LQ_UNLOCKED; 194 @} 195 @end group 196 @end example 197 198 @subsubsection Acquiring a Shared Lock 199 200 The @code{Shm_Lock} routine is responsible for 201 acquiring the lock field. Interrupts should be 202 disabled while that lock is acquired. If the lock 203 is currently unavailble, then the locking routine 204 should delay a few microseconds to allow the other 205 node to release the lock. Doing this reduces bus contention 206 for the lock. This routines usually is implemented as follows: 207 208 @example 209 @group 210 void Shm_Lock( 211 Shm_Locked_queue_Control *lq_cb 212 ) 213 @{ 214 disable processor interrupts 215 set Shm_isrstat to previous interrupt disable level 216 217 while ( TRUE ) @{ 218 atomically attempt to acquire the lock 219 if the lock was acquired 220 return 221 delay some small period of time 222 @} 223 @} 224 @end group 225 @end example 226 227 @subsubsection Releasing a Shared Lock 228 229 The @code{Shm_Unlock} routine is responsible for 230 releasing the lock field and reenabling processor 231 interrupts. This routines usually is implemented as follows: 232 233 @example 234 @group 235 void Shm_Unlock( 236 Shm_Locked_queue_Control *lq_cb 237 ) 238 @{ 239 set the lock to the unlocked value 240 reenable processor interrupts to their level prior 241 to the lock being acquired. This value was saved 242 in the global variable Shm_isrstat 243 @} 244 @end group 245 @end example 246 247 @section Installing the MPCI ISR 248 249 The @code{Shm_setvec} is invoked by the portable portion 250 of the shared memory to install the interrupt service routine 251 that is invoked when an incoming message is announced. Some 252 target boards support an interprocessor interrupt or mailbox 253 scheme and this is where the ISR for that interrupt would be 254 installed. 255 256 On an interrupt driven node, this routine would be implemented 257 as follows: 258 259 @example 260 @group 261 void Shm_setvec( void ) 262 @{ 263 install the interprocessor communications ISR 264 @} 265 @end group 266 @end example 267 268 On a polled node, this routine would be empty. 269 -
doc/bsp_howto/support.t
r06fee20 rbc950e87 7 7 @c 8 8 9 @chapter Required Support Routines 10 11 XXX FILL ME IN 12 9 @chapter Miscellaneous Support Files 10 11 @section GCC Compiler Specifications File 12 13 The file @code{bsp_specs} defines the start files and libraries 14 that are always used with this BSP. The format of this file 15 is admittedly cryptic and this document will make no attempt 16 to explain it completely. Below is the @code{bsp_specs} 17 file from the PowerPC psim BSP: 18 19 @example 20 @group 21 %rename cpp old_cpp 22 %rename lib old_lib 23 %rename endfile old_endfile 24 %rename startfile old_startfile 25 %rename link old_link 26 27 *cpp: 28 %(old_cpp) %@{qrtems: -D__embedded__@} -Asystem(embedded) 29 30 *lib: 31 %@{!qrtems: %(old_lib)@} %@{qrtems: --start-group \ 32 %@{!qrtems_debug: -lrtemsall@} %@{qrtems_debug: -lrtemsall_g@} \ 33 -lc -lgcc --end-group ecrtn%O%s \ 34 %@{!qnolinkcmds: -T linkcmds%s@}@} 35 36 *startfile: 37 %@{!qrtems: %(old_startfile)@} %@{qrtems: ecrti%O%s \ 38 %@{!qrtems_debug: startsim.o%s@} \ 39 %@{qrtems_debug: startsim_g.o%s@}@} 40 41 *link: 42 %@{!qrtems: %(old_link)@} %@{qrtems: -Qy -dp -Bstatic \ 43 -T linkcmds%s -e _start -u __vectors@} 44 @end group 45 @end example 46 47 The first section of this file renames the built-in definition of 48 some specification variables so they can be augmented without 49 embedded their original definition. The subsequent sections 50 specify what behavior is expected when the @code{-qrtems} or 51 @code{-qrtems_debug} option is specified. 52 53 The @code{*cpp} definition specifies that when @code{-qrtems} 54 is specified, predefine the preprocessor symbol @code{__embedded__}. 55 56 The @code{*lib} section insures that the RTEMS library, BSP specific 57 linker script, gcc support library, and the EABI specific @code{ecrtn} 58 file are used. 59 60 The @code{*startfile} section specifies that the BSP specific file 61 @code{startsim.o} will be used instead of @code{crt0.o}. In addition, 62 the EABI specific file @code{ecrti.o} will be linked in with the 63 executable. 64 65 The @code{*link} section specifies the arguments that will be passed to 66 the linker. 67 68 The format of this file is specific to the GNU Compiler Suite. The 69 argument used to override and extend the compiler built-in specifications 70 is relatively new to the toolset. The @code{-specs} option is present 71 in all @code{egcs} distributions and @code{gcc} distributions starting 72 with version 2.8.0. 73 74 @section README Files 75 76 Most BSPs provide one or more @code{README} files. Generally, there 77 is a @code{README} file at the top of the BSP source. This file 78 describes the board and its hardware configuration, provides vendor 79 information, local configuration information, information on downloading 80 code to the board, debugging, etc.. The intent of this 81 file is to help someone begin to use the BSP faster. 82 83 A @code{README} file in a BSP subdirectory typically explains something 84 about the contents of that subdirectory in greater detail. For example, 85 it may list the documentation available for a particular peripheral 86 controller and how to obtain that documentation. It may also explain some 87 particularly cryptic part of the software in that directory or provide 88 rationale on the implementation. 89 90 @section times 91 92 This file contains the results of the RTEMS Timing Test Suite. It is 93 in a standard format so that results from one BSP can be easily compared 94 with those of another target board. 95 96 If a BSP supports multiple variants, then there may be multiple @code{times} 97 files. Usually these are named @code{times.VARIANTn}. 98 99 @section Tools Subdirectory 100 101 Some BSPs provide additional tools that aid in using the target board. 102 These tools run on the development host and are built as part of building 103 the BSP. Most common is a script to automate running the RTEMS Test Suites 104 on the BSP. Examples of this include: 105 106 @itemize @bullet 107 108 @item @code{powerpc/psim} includes scripts to ease use of the simulator 109 110 @item @code{m68k/mvme162} includes a utility to download across the 111 VMEbus into target memory if the host is a VMEbus board in the same 112 chasis. 113 114 @item @code{unix/posix} includes scripts to run the tests automatically 115 on this BSP. 116 117 @end itemize 118 119 @section bsp.h Include File 120 121 The file @code{include/bsp.h} contains prototypes and definitions 122 specific to this board. Every BSP is required to provide a @code{bsp.h}. 123 The best approach to writing a @code{bsp.h} is copying an existing one 124 as a starting point. 125 126 Many @code{bsp.h} files provide prototypes of variables defined 127 in the linker script (@code{linkcmds}). 128 129 There are a number of fields in this file that are used only by the 130 RTEMS Test Suites. The following is a list of these: 131 132 @itemize @bullet 133 @item @code{MAX_LONG_TEST_DURATION} - the longest length of time a 134 "long running" test should run. 135 136 @item @code{MAX_SHORT_TEST_DURATION} - the longest length of time a 137 "short running" test should run. 138 139 @item @code{MUST_WAIT_FOR_INTERRUPT} - modifies behavior of @code{tm27}. 140 141 @item @code{Install_tm27_vector} - installs the interrupt service 142 routine for the Interrupt Benchmark Test (@code{tm27}). 143 144 @item @code{Cause_tm27_intr} - generates the interrupt source 145 used in the Interrupt Benchmark Test (@code{tm27}). 146 147 @item @code{Clear_tm27_intr} - clears the interrupt source 148 used in the Interrupt Benchmark Test (@code{tm27}). 149 150 @item @code{Lower_tm27_intr} - lowers the interrupt mask so the 151 interrupt source used in the Interrupt Benchmark Test (@code{tm27}) 152 can generate a nested interrupt. 153 154 @end itemize 155 156 @section Calling Overhead File 157 158 The file @code{include/coverhd.h} contains the overhead associated 159 with invoking each directive. This overhead consists of the execution 160 time required to package the parameters as well as to execute the "jump to 161 subroutine" and "return from subroutine" sequence. The intent of this 162 file is to help separate the calling overhead from the actual execution 163 time of a directive. This file is only used by the tests in the 164 RTEMS Timing Test Suite. 165 166 The numbers in this file are obtained by running the "Timer Overhead" 167 @code{tmoverhd} test. The numbers in this file may be 0 and no 168 overhead is subtracted from the directive execution times reported by 169 the Timing Suite. 170 171 @section sbrk() Implementation 172 173 If the BSP wants to dynamically extend the heap used by the 174 C Library memory allocation routines (i.e. @code{malloc} family), 175 then this routine must be functional. The following is the 176 prototype for this routine: 177 178 @example 179 void * sbrk(size_t increment) 180 @end example 181 182 The @code{increment} amount is based upon the @code{sbrk_amount} 183 parameter passed to the @code{RTEMS_Malloc_Initialize} during system 184 initialization. 185 See @ref{Initialization Code RTEMS Pretasking Callback} for more 186 information. 187 188 There is a default implementation which returns an error to indicate 189 that the heap can not be extended. This implementation can be 190 found in @code{c/src/lib/libbsp/shared/sbrk.c}. Many of the BSPs 191 use this shared implementation. In order to use this implementation, 192 the file @code{Makefile.in} in the BSP's @code{startup} directory 193 must be modified so that the @code{$VPATH} variable searches 194 both the @code{startup} directory and the shared directory. The following 195 illustates the @code{VPATH} setting in the PowerPC psim BSP's 196 @code{startup/Makefile.in}: 197 198 @example 199 VPATH = @@srcdir@@:@@srcdir@@/../../../shared 200 @end example 201 202 This instructs make to look in all of the directories in the @code{VPATH} 203 for the source files. The directories will be examined in the order 204 they are specified. 205 206 @section bsp_cleanup() - Cleanup the Hardware 207 208 The @code{bsp_cleanup()} is the last C code invoked. Most of the BSPs 209 use the same shared version of @code{bsp_cleanup()} that does nothing. 210 This implementation is located in the following file: 211 212 @example 213 c/src/lib/libbsp/shared/bspclean.c 214 @end example 215 216 The @code{bsp_cleanup()} routine can be used to return to a ROM monitor, 217 insure that interrupt sources are disabled, etc.. This routine is the 218 last place to insure a clean shutdown of the hardware. 219 220 @section set_vector() - Install an Interrupt Vector 221 222 The @code{set_vector} routine is responsible for installing an interrupt 223 vector. It invokes the support routines necessary to install an 224 interrupt handler as either a "raw" or an RTEMS interrupt handler. Raw 225 handlers bypass the RTEMS interrupt structure and are responsible for 226 saving and restoring all their own registers. Raw handlers are useful 227 for handling traps, debug vectors, etc.. 228 229 The @code{set_vector} routine is a central place to perform 230 interrupt controller manipulation and encapsulate that information. 231 It is usually implemented as follows: 232 233 @example 234 @group 235 rtems_isr_entry set_vector( /* returns old vector */ 236 rtems_isr_entry handler, /* isr routine */ 237 rtems_vector_number vector, /* vector number */ 238 int type /* RTEMS or RAW intr */ 239 ) 240 @{ 241 if the type is RAW 242 install the raw vector 243 else 244 use rtems_interrupt_catch to install the vector 245 246 perform any interrupt controller necessary to unmask 247 the interrupt source 248 249 return the previous handler 250 @} 251 @end group 252 @end example 253 254 255 @b{NOTE:} @code{set_vector} is provided by the majority of BSPs but 256 not all. In particular, the i386 BSPs use a different scheme. 257 -
doc/bsp_howto/timer.t
r06fee20 rbc950e87 9 9 @chapter Timer Driver 10 10 11 You can program the timer driver for your own needs, but here are two uses 12 of it: 11 The timer driver is primarily used by the RTEMS Timing Tests. 12 This driver provides as accurate a benchmark timer as possible. 13 It typically reports its time in microseconds, CPU cycles, or 14 bus cycles. This information can be very useful for determining 15 precisely what pieces of code require optimization and to measure the 16 impact of specific minor changes. 13 17 14 @section UART'S FIFO Full Mode 18 The gen68340 BSP also uses the TImer Driver to support a high performance 19 mode of the on-CPU UART. 20 21 @section Benchmark Timer 22 23 The RTEMS Timing Test Suite requires a benchmark timer. The 24 RTEMS Timing Test Suite is very helpful for determining 25 the performance of target hardware and comparing its performance 26 to that of other RTEMS targets. 27 28 This section describes the routines which are assumed to exist by 29 the RTEMS Timing Test Suite. The names used are @b{EXACTLY} what 30 is used in the RTEMS Timing Test Suite so follow the naming convention. 31 32 @subsection Timer_initialize 33 34 Initialize the timer source. 35 36 @example 37 void Timer_initialize(void) 38 @{ 39 initialize the benchmark timer 40 @} 41 @end example 42 43 @subsection Read_timer 44 45 The @code{Read_timer} routine 46 returns the number of benchmark time units (typically microseconds) 47 that have elapsed since the last call to @code{Timer_initialize}. 48 49 @example 50 int Read_timer(void) 51 @{ 52 stop time = read the hardware timer 53 if the subtract overhead feature is enabled 54 subtract overhead from stop time 55 return the stop time 56 @} 57 @end example 58 59 Many implementations of this routine subtract the overhead required 60 to initialize and read the benchmark timer. This makes the times reported 61 more accurate. 62 63 Some implementations report 0 if the harware timer value change is 64 sufficiently small. This is intended to indicate that the execution time 65 is below the resolution of the timer. 66 67 @subsection An Empty Function 68 69 This routine is invoked by the RTEMS Timing Test Suite to measure 70 the cost of invoking a subroutine. 71 72 @example 73 rtems_status_code Empty_function (void) 74 @{ 75 return RTEMS_SUCCESSFUL; 76 @} 77 @end example 78 79 @subsection Set_find_average_overhead 80 81 This routine is invoked by the "Check Timer" (@code{tmck}) test in the 82 RTEMS Timing Test Suite. It makes the @code{Read_timer} 83 routine NOT subtract the overhead required 84 to initialize and read the benchmark timer. This is used 85 by the @code{tmoverhd} test to determine the overhead 86 required to initialize and read the timer. 87 88 @example 89 void Set_find_average_overhead(rtems_boolean find_flag) 90 @{ 91 disable the subtract overhead feature 92 @} 93 @end example 94 95 The @code{Timer_driver_Find_average_overhead} variable is usually 96 used to indicate the state of the "subtract overhead feature". 97 98 @section gen68340 UART FIFO Full Mode 15 99 16 100 The gen68340 BSP is an example of the use of the timer to support the UART 17 101 input FIFO full mode (FIFO means First In First Out and roughly means 18 102 buffer). This mode consists in the UART raising an interrupt when n 19 characters have been received ( n is the UART's FIFO length). It results103 characters have been received (@i{n} is the UART's FIFO length). It results 20 104 in a lower interrupt processing time, but the problem is that a scanf 21 primitive will block on a receipt of less than ncharacters. The solution105 primitive will block on a receipt of less than @i{n} characters. The solution 22 106 is to set a timer that will check whether there are some characters 23 waiting in th 107 waiting in the UART's input FIFO. The delay time has to be set carefully 24 108 otherwise high rates will be broken: 25 109 … … 29 113 entered, set a long delay, 30 114 31 @item otherwise set the delay to the delay needed for ncharacters115 @item otherwise set the delay to the delay needed for @i{n} characters 32 116 receipt. 33 117 34 118 @end itemize 35 119 36 @section Measuring RTEMS Primitives Time37 38 RTEMS Timing Test Suite needs a timer support. You have to provide two39 primitives:40 120 41 121 42 43 Function44 45 Description46 47 @example48 void Timer_initialize (void)49 @end example50 51 Initialize the timer to be a counter to the microsecond.52 53 @example54 int Read_timer (void)55 @end example56 57 Returns the number of microseconds elapsed since the last call to58 Timer_initialize.59 60 @example61 rtems_status_code Empty_function (void)62 63 return RTEMS_SUCCESSFUL;64 @end example65 66 @example67 void Set_find_average_overhead (rtems_boolean find_flag)68 @end example69 70 DOES NOTHING ??????????71 72 73 74 -
doc/networking/driver.t
r06fee20 rbc950e87 9 9 @c 10 10 11 @chapter Writing RTEMS Network Device Drivers11 @chapter Networking Driver 12 12 13 13 @section Introduction -
doc/new_chapters/Makefile
r06fee20 rbc950e87 24 24 io.texi key.texi memorymgmt.texi message.texi mutex.texi procenv.texi \ 25 25 process.texi sched.texi semaphores.texi signal.texi systemdb.texi \ 26 thread.texi 26 thread.texi \ 27 stackchk.texi rtmonuse.texi cpuuse.texi error.texi monitor.texi 27 28 28 29 FILES= posix_users.texi preface.texi \ … … 54 55 $(TEXI2WWW) $(TEXI2WWW_ARGS) -dir $(WWW_INSTALL)/$(PROJECT) \ 55 56 posix_users.texi 56 57 57 58 58 clean: … … 171 171 -n "" ${*}.t 172 172 173 stackchk.texi: stackchk.t Makefile 174 $(BMENU) -p "" \ 175 -u "Top" \ 176 -n "" ${*}.t 177 178 rtmonuse.texi: rtmonuse.t Makefile 179 $(BMENU) -p "" \ 180 -u "Top" \ 181 -n "" ${*}.t 182 183 cpuuse.texi: cpuuse.t Makefile 184 $(BMENU) -p "" \ 185 -u "Top" \ 186 -n "" ${*}.t 187 188 error.texi: error.t Makefile 189 $(BMENU) -p "" \ 190 -u "Top" \ 191 -n "" ${*}.t 192 193 monitor.texi: monitor.t Makefile 194 $(BMENU) -p "" \ 195 -u "Top" \ 196 -n "" ${*}.t -
doc/new_chapters/files.t
r06fee20 rbc950e87 29 29 @item @code{umask} - Sets a file creation mask 30 30 @item @code{link} - Creates a link to a file 31 @item @code{symlink} - Creates a symbolic link to a file 32 @item @code{readlink} - Obtain the name of the link destination 31 33 @item @code{mkdir} - Makes a directory 32 34 @item @code{mkfifo} - Makes a FIFO special file … … 742 744 743 745 @page 746 @subsection symlink - Creates a symbolic link to a file 747 748 @subheading CALLING SEQUENCE: 749 750 @ifset is-C 751 @example 752 #include <unistd.h> 753 754 int symlink( 755 const char *topath, 756 const char *frompath 757 ); 758 @end example 759 @end ifset 760 761 @ifset is-Ada 762 @end ifset 763 764 @subheading STATUS CODES: 765 766 @table @b 767 768 @item EACCES 769 Search permission is denied for a directory in a file's path prefix 770 771 @item EEXIST 772 The named file already exists. 773 774 @item ENAMETOOLONG 775 Length of a filename string exceeds PATH_MAX and _POSIX_NO_TRUNC is in 776 effect. 777 778 @item ENOENT 779 A file or directory does not exist. 780 781 @item ENOSPC 782 No space left on disk. 783 784 @item ENOTDIR 785 A component of the specified pathname was not a directory when a directory 786 was expected. 787 788 @item EPERM 789 Operation is not permitted. Process does not have the appropriate priviledges 790 or permissions to perform the requested operations. 791 792 @item EROFS 793 Read-only file system. 794 795 @end table 796 797 @subheading DESCRIPTION: 798 799 The @code{symlink()} function creates a symbolic link from the frombath to the 800 topath. The symbolic link will be interpreted at run-time. 801 802 If the @code{symlink()} function fails, no directories are modified. 803 804 The caller may (or may not) need permission to access the existing file. 805 806 @subheading NOTES: 807 808 NONE 809 810 @page 811 @subsection readlink - Obtain the name of a symbolic link destination 812 813 @subheading CALLING SEQUENCE: 814 815 @ifset is-C 816 @example 817 #include <unistd.h> 818 819 int readlink( 820 const char *path, 821 char *buf, 822 size_t bufsize 823 ); 824 825 @end example 826 @end ifset 827 828 @ifset is-Ada 829 @end ifset 830 831 @subheading STATUS CODES: 832 833 @table @b 834 835 @item EACCES 836 Search permission is denied for a directory in a file's path prefix 837 838 @item ENAMETOOLONG 839 Length of a filename string exceeds PATH_MAX and _POSIX_NO_TRUNC is in 840 effect. 841 842 @item ENOENT 843 A file or directory does not exist. 844 845 @item ENOTDIR 846 A component of the prefix pathname was not a directory when a directory 847 was expected. 848 849 @item ELOOP 850 Too many symbolic links were encountered in the pathname. 851 852 @item EINVAL 853 The pathname does not refer to a symbolic link 854 855 @item EFAULT 856 An invalid pointer was passed into the @code{readlink()} routine. 857 858 @end table 859 860 @subheading DESCRIPTION: 861 862 The @code{readlink()} function places the symbolic link destination into 863 @code{buf} argument and returns the number of characters copied. 864 865 If the symbolic link destination is longer than bufsize characters the 866 name will be truncated. 867 868 @subheading NOTES: 869 870 NONE 871 872 @page 744 873 @subsection mkdir - Makes a directory 745 874 -
doc/new_chapters/gen_section
r06fee20 rbc950e87 130 130 strpbrk strrchr strspn strstr strtok stlen" 131 131 ;; 132 misc_stackchk) 133 CHAPTER_CAPS="Stack Bounds Checker" 134 CHAPTER_LOWER="stack bounds checker" 135 ROUTINES="Stack_check_Initialize Stack_check_Dump_usage" 136 ;; 137 misc_rtmonuse) 138 CHAPTER_CAPS="Rate Monotonic Period Statistics" 139 CHAPTER_LOWER="rate monotonic period statistics" 140 ROUTINES="Period_usage_Initialize Period_usage_Reset \ 141 Period_usage_Update Period_usage_Dump" 142 ;; 143 misc_cpuuse) 144 CHAPTER_CAPS="CPU Usage Statistics" 145 CHAPTER_LOWER="CPU usage statistics" 146 ROUTINES="CPU_usage_Dump CPU_usage_Reset" 147 ;; 148 misc_error) 149 CHAPTER_CAPS="Error Reporting Support" 150 CHAPTER_LOWER="error reporting support" 151 ROUTINES="rtems_error rtems_panic" 152 ;; 153 misc_monitor) 154 CHAPTER_CAPS="Monitor Task" 155 CHAPTER_LOWER="monitor task" 156 ROUTINES="rtems_monitor_init rtems_monitor_wakeup" 157 ;; 132 158 *) 133 159 echo "Unknown chapter name" -
doc/new_chapters/posix_users.texi
r06fee20 rbc950e87 108 108 @include confspace.texi 109 109 @include adminiface.texi 110 @include stackchk.texi 111 @include rtmonuse.texi 112 @include cpuuse.texi 113 @include error.texi 114 @include monitor.texi 110 115 @ifinfo 111 116 @node Top, Preface, (dir), (dir) … … 138 143 * Configuration Space Manager:: 139 144 * Administration Interface Manager:: 145 * Stack Bounds Checker:: 146 * Rate Monotonic Period Statistics:: 147 * CPU Usage Statistics:: 148 * Error Reporting Support:: 149 * Monitor Task:: 140 150 * Command and Variable Index:: 141 151 * Concept Index:: -
doc/new_chapters/signal.t
r06fee20 rbc950e87 109 109 @subheading NOTES: 110 110 111 NONE 112 111 113 @page 112 114 @subsection sigdelset - Delete a Signal from a Signal Set -
doc/posix1003.1/Makefile
r06fee20 rbc950e87 46 46 $(PROJECT).dvi: $(FILES) 47 47 $(TEXI2DVI) -v $(PROJECT).texi 48 texi2dvi $(PROJECT).texi48 texi2dvi -v $(PROJECT).texi 49 49 50 50 ch01.texi: ch01.t -
doc/posix1003.1/ch06.t
r06fee20 rbc950e87 23 23 @example 24 24 dup(), Function, Implemented 25 dup2(), Function, Untested I mplementation25 dup2(), Function, Untested Iimplementation 26 26 @end example 27 27 -
doc/posix1003.1/ch14.t
r06fee20 rbc950e87 47 47 48 48 @example 49 timer_create(), Function, Implemented49 timer_create(), Function, Dummy Implementation 50 50 @end example 51 51 … … 53 53 54 54 @example 55 timer_delete(), Function, Implemented55 timer_delete(), Function, Dummy Implementation 56 56 @end example 57 57 … … 59 59 60 60 @example 61 timer_settime(), Function, Implemented62 timer_gettime(), Function, Implemented63 timer_getoverrun(), Function, Implemented61 timer_settime(), Function, Dummy Implementation 62 timer_gettime(), Function, Dummy Implementation 63 timer_getoverrun(), Function, Dummy Implementation 64 64 @end example 65 65 -
doc/started/Makefile
r06fee20 rbc950e87 42 42 # run texi2dvi twice to generate the xref's properly. 43 43 $(PROJECT).dvi: $(FILES) 44 $(TEXI2DVI) $(PROJECT).texi45 texi2dvi $(PROJECT).texi44 $(TEXI2DVI) -v $(PROJECT).texi 45 texi2dvi -v $(PROJECT).texi 46 46 47 47 intro.texi: intro.t versions.texi -
doc/supplements/hppa1_1/cputable.t
r06fee20 rbc950e87 48 48 @table @code 49 49 @item pretasking_hook 50 is the address of the 51 user provided routine which is invoked once RTEMS initialization 52 is complete but before interrupts and tasking are enabled. This 53 field may be NULL to indicate that the hook is not utilized.50 is the address of the user provided routine which is invoked 51 once RTEMS APIs are initialized. This routine will be invoked 52 before any system tasks are created. Interrupts are disabled. 53 This field may be NULL to indicate that the hook is not utilized. 54 54 55 55 @item predriver_hook 56 56 is the address of the user provided 57 routine which is invoked with tasking enabled immediately before 58 the MPCI and device drivers are initialized. RTEMS 59 initialization is complete, interrupts and tasking are enabled, 60 but no device drivers are initialized. This field may be NULL to 61 indicate that the hook is not utilized. 57 routine that is invoked immediately before the 58 the device drivers and MPCI are initialized. RTEMS 59 initialization is complete but interrupts and tasking are disabled. 60 This field may be NULL to indicate that the hook is not utilized. 62 61 63 62 @item postdriver_hook 64 63 is the address of the user provided 65 routine which is invoked with tasking enabled immediately after 66 the MPCI and device drivers are initialized. RTEMS 67 initialization is complete, interrupts and tasking are enabled, 68 and the device drivers are initialized. This field may be NULL 69 to indicate that the hook is not utilized. 64 routine that is invoked immediately after the 65 the device drivers and MPCI are initialized. RTEMS 66 initialization is complete but interrupts and tasking are disabled. 67 This field may be NULL to indicate that the hook is not utilized. 70 68 71 69 @item idle_task -
doc/supplements/i386/cputable.t
r06fee20 rbc950e87 47 47 @table @code 48 48 @item pretasking_hook 49 is the address of the 50 user provided routine which is invoked once RTEMS initialization 51 is complete but before interrupts and tasking are enabled. This 52 field may be NULL to indicate that the hook is not utilized.49 is the address of the user provided routine which is invoked 50 once RTEMS APIs are initialized. This routine will be invoked 51 before any system tasks are created. Interrupts are disabled. 52 This field may be NULL to indicate that the hook is not utilized. 53 53 54 54 @item predriver_hook 55 55 is the address of the user provided 56 routine which is invoked with tasking enabled immediately before 57 the MPCI and device drivers are initialized. RTEMS 58 initialization is complete, interrupts and tasking are enabled, 59 but no device drivers are initialized. This field may be NULL to 60 indicate that the hook is not utilized. 56 routine that is invoked immediately before the 57 the device drivers and MPCI are initialized. RTEMS 58 initialization is complete but interrupts and tasking are disabled. 59 This field may be NULL to indicate that the hook is not utilized. 61 60 62 61 @item postdriver_hook 63 62 is the address of the user provided 64 routine which is invoked with tasking enabled immediately after 65 the MPCI and device drivers are initialized. RTEMS 66 initialization is complete, interrupts and tasking are enabled, 67 and the device drivers are initialized. This field may be NULL 68 to indicate that the hook is not utilized. 63 routine that is invoked immediately after the 64 the device drivers and MPCI are initialized. RTEMS 65 initialization is complete but interrupts and tasking are disabled. 66 This field may be NULL to indicate that the hook is not utilized. 69 67 70 68 @item idle_task -
doc/supplements/i960/cputable.t
r06fee20 rbc950e87 55 55 @table @code 56 56 @item pretasking_hook 57 is the address of the 58 user provided routine which is invoked once RTEMS initialization 59 is complete but before interrupts and tasking are enabled. This 60 field may be NULL to indicate that the hook is not utilized.57 is the address of the user provided routine which is invoked 58 once RTEMS APIs are initialized. This routine will be invoked 59 before any system tasks are created. Interrupts are disabled. 60 This field may be NULL to indicate that the hook is not utilized. 61 61 62 62 @item predriver_hook 63 63 is the address of the user provided 64 routine which is invoked with tasking enabled immediately before 65 the MPCI and device drivers are initialized. RTEMS 66 initialization is complete, interrupts and tasking are enabled, 67 but no device drivers are initialized. This field may be NULL to 68 indicate that the hook is not utilized. 64 routine that is invoked immediately before the 65 the device drivers and MPCI are initialized. RTEMS 66 initialization is complete but interrupts and tasking are disabled. 67 This field may be NULL to indicate that the hook is not utilized. 69 68 70 69 @item postdriver_hook 71 70 is the address of the user provided 72 routine which is invoked with tasking enabled immediately after 73 the MPCI and device drivers are initialized. RTEMS 74 initialization is complete, interrupts and tasking are enabled, 75 and the device drivers are initialized. This field may be NULL 76 to indicate that the hook is not utilized. 71 routine that is invoked immediately after the 72 the device drivers and MPCI are initialized. RTEMS 73 initialization is complete but interrupts and tasking are disabled. 74 This field may be NULL to indicate that the hook is not utilized. 77 75 78 76 @item idle_task -
doc/supplements/m68k/cputable.t
r06fee20 rbc950e87 48 48 @table @code 49 49 @item pretasking_hook 50 is the address of the 51 user provided routine which is invoked once RTEMS initialization 52 is complete but before interrupts and tasking are enabled. This 53 field may be NULL to indicate that the hook is not utilized.50 is the address of the user provided routine which is invoked 51 once RTEMS APIs are initialized. This routine will be invoked 52 before any system tasks are created. Interrupts are disabled. 53 This field may be NULL to indicate that the hook is not utilized. 54 54 55 55 @item predriver_hook 56 56 is the address of the user provided 57 routine which is invoked with tasking enabled immediately before 58 the MPCI and device drivers are initialized. RTEMS 59 initialization is complete, interrupts and tasking are enabled, 60 but no device drivers are initialized. This field may be NULL to 61 indicate that the hook is not utilized. 57 routine that is invoked immediately before the 58 the device drivers and MPCI are initialized. RTEMS 59 initialization is complete but interrupts and tasking are disabled. 60 This field may be NULL to indicate that the hook is not utilized. 62 61 63 62 @item postdriver_hook 64 63 is the address of the user provided 65 routine which is invoked with tasking enabled immediately after 66 the MPCI and device drivers are initialized. RTEMS 67 initialization is complete, interrupts and tasking are enabled, 68 and the device drivers are initialized. This field may be NULL 69 to indicate that the hook is not utilized. 64 routine that is invoked immediately after the 65 the device drivers and MPCI are initialized. RTEMS 66 initialization is complete but interrupts and tasking are disabled. 67 This field may be NULL to indicate that the hook is not utilized. 70 68 71 69 @item idle_task -
doc/supplements/powerpc/cputable.t
r06fee20 rbc950e87 55 55 @table @code 56 56 @item pretasking_hook 57 is the address of the 58 user provided routine which is invoked once RTEMS initialization 59 is complete but before interrupts and tasking are enabled. This 60 field may be NULL to indicate that the hook is not utilized.57 is the address of the user provided routine which is invoked 58 once RTEMS APIs are initialized. This routine will be invoked 59 before any system tasks are created. Interrupts are disabled. 60 This field may be NULL to indicate that the hook is not utilized. 61 61 62 62 @item predriver_hook 63 63 is the address of the user provided 64 routine which is invoked with tasking enabled immediately before 65 the MPCI and device drivers are initialized. RTEMS 66 initialization is complete, interrupts and tasking are enabled, 67 but no device drivers are initialized. This field may be NULL to 68 indicate that the hook is not utilized. 64 routine that is invoked immediately before the 65 the device drivers and MPCI are initialized. RTEMS 66 initialization is complete but interrupts and tasking are disabled. 67 This field may be NULL to indicate that the hook is not utilized. 69 68 70 69 @item postdriver_hook 71 70 is the address of the user provided 72 routine which is invoked with tasking enabled immediately after 73 the MPCI and device drivers are initialized. RTEMS 74 initialization is complete, interrupts and tasking are enabled, 75 and the device drivers are initialized. This field may be NULL 76 to indicate that the hook is not utilized. 71 routine that is invoked immediately after the 72 the device drivers and MPCI are initialized. RTEMS 73 initialization is complete but interrupts and tasking are disabled. 74 This field may be NULL to indicate that the hook is not utilized. 77 75 78 76 @item idle_task -
doc/supplements/sparc/cputable.t
r06fee20 rbc950e87 44 44 @table @code 45 45 @item pretasking_hook 46 is the address of the 47 user provided routine which is invoked once RTEMS initialization 48 is complete but before interrupts and tasking are enabled. This 49 field may be NULL to indicate that the hook is not utilized.46 is the address of the user provided routine which is invoked 47 once RTEMS APIs are initialized. This routine will be invoked 48 before any system tasks are created. Interrupts are disabled. 49 This field may be NULL to indicate that the hook is not utilized. 50 50 51 51 @item predriver_hook 52 52 is the address of the user provided 53 routine which is invoked with tasking enabled immediately before 54 the MPCI and device drivers are initialized. RTEMS 55 initialization is complete, interrupts and tasking are enabled, 56 but no device drivers are initialized. This field may be NULL to 57 indicate that the hook is not utilized. 53 routine that is invoked immediately before the 54 the device drivers and MPCI are initialized. RTEMS 55 initialization is complete but interrupts and tasking are disabled. 56 This field may be NULL to indicate that the hook is not utilized. 58 57 59 58 @item postdriver_hook 60 59 is the address of the user provided 61 routine which is invoked with tasking enabled immediately after 62 the MPCI and device drivers are initialized. RTEMS 63 initialization is complete, interrupts and tasking are enabled, 64 and the device drivers are initialized. This field may be NULL 65 to indicate that the hook is not utilized. 60 routine that is invoked immediately after the 61 the device drivers and MPCI are initialized. RTEMS 62 initialization is complete but interrupts and tasking are disabled. 63 This field may be NULL to indicate that the hook is not utilized. 66 64 67 65 @item idle_task -
doc/supplements/template/cputable.t
r06fee20 rbc950e87 48 48 @table @code 49 49 @item pretasking_hook 50 is the address of the 51 user provided routine which is invoked once RTEMS initialization 52 is complete but before interrupts and tasking are enabled. This 53 field may be NULL to indicate that the hook is not utilized.50 is the address of the user provided routine which is invoked 51 once RTEMS APIs are initialized. This routine will be invoked 52 before any system tasks are created. Interrupts are disabled. 53 This field may be NULL to indicate that the hook is not utilized. 54 54 55 55 @item predriver_hook 56 56 is the address of the user provided 57 routine which is invoked with tasking enabled immediately before 58 the MPCI and device drivers are initialized. RTEMS 59 initialization is complete, interrupts and tasking are enabled, 60 but no device drivers are initialized. This field may be NULL to 61 indicate that the hook is not utilized. 57 routine that is invoked immediately before the 58 the device drivers and MPCI are initialized. RTEMS 59 initialization is complete but interrupts and tasking are disabled. 60 This field may be NULL to indicate that the hook is not utilized. 62 61 63 62 @item postdriver_hook 64 63 is the address of the user provided 65 routine which is invoked with tasking enabled immediately after 66 the MPCI and device drivers are initialized. RTEMS 67 initialization is complete, interrupts and tasking are enabled, 68 and the device drivers are initialized. This field may be NULL 69 to indicate that the hook is not utilized. 64 routine that is invoked immediately after the 65 the device drivers and MPCI are initialized. RTEMS 66 initialization is complete but interrupts and tasking are disabled. 67 This field may be NULL to indicate that the hook is not utilized. 70 68 71 69 @item idle_task
Note: See TracChangeset
for help on using the changeset viewer.