Writing a kernel callout
If your hardware platform isn't supported by the kernel callouts in the startup library, or by any of the available board-specific kernel callouts, you will need to write your own callout.
- Review your hardware documentation to understand what your callout needs to do to complete its tasks successfully on your hardware.
- Review and understand the callout information in this chapter,
particularly the information about the type of callout you need to write (see
Kernel callout categories
in this chapter). - Identify a kernel callout source file of the appropriate category that is close
to the callout you need, then make a copy of it with a new filename and modify
the source code in it (see
Kernel callout start and end macros
below).
The source file you start from should have C prototypes for the routines as comments, so you'll know what parameters are being passed in.
If the new routines you write will be useful on multiple boards, you might want to keep the source file in your own copy of the startup library. If the routines will be useful for your board only, you can just copy your file to the directory where you keep your other board-specific files.
For information on the locations and names of the source files, see
Kernel callout categories
in this chapter.