📄 hal-porting-structure.html
字号:
><TD
ALIGN="LEFT"
VALIGN="TOP"
>Cache definitions and cache control macros.</TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
><TT
CLASS="FILENAME"
>include/hal_intr.h</TT
></TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
>Exception and interrupt definitions. Macros for configuring and
controlling interrupts. eCos real-time clock control macros.</TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
><TT
CLASS="FILENAME"
>include/hal_io.h</TT
></TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
>Macros for accessing IO devices.</TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
><TT
CLASS="FILENAME"
>include/<arch>_regs.h</TT
></TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
>Architecture register definitions.</TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
><TT
CLASS="FILENAME"
>include/<arch>_stub.h</TT
></TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
>Architecture stub definitions. In particular the register frame
layout used by GDB. This may differ from the one used by eCos.</TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
><TT
CLASS="FILENAME"
>include/<arch>.inc</TT
></TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
>Architecture convenience assembly macros.</TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
><TT
CLASS="FILENAME"
>src/<arch>.ld</TT
></TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
>Linker macros.</TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
><TT
CLASS="FILENAME"
>src/context.S</TT
></TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
>Functions handling context switching and setjmp/longjmp.</TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
><TT
CLASS="FILENAME"
>src/hal_misc.c</TT
></TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
>Exception and interrupt handlers in C. Various other utility
functions.</TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
><TT
CLASS="FILENAME"
>src/hal_mk_defs.c</TT
></TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
>Used to export definitions from C header files to assembler
header files.</TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
><TT
CLASS="FILENAME"
>src/hal_intr.c</TT
></TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
>Any necessary interrupt handling functions.</TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
><TT
CLASS="FILENAME"
>src/<arch>stub.c</TT
></TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
>Architecture stub code. Contains functions for translating eCos
exceptions to UNIX signals and functions for single-stepping.</TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
><TT
CLASS="FILENAME"
>src/vectors.S</TT
></TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
>Exception, interrupt and early initialization code.</TD
></TR
></TBODY
></TABLE
><P
></P
></DIV
></DIV
><DIV
CLASS="SECTION"
><H3
CLASS="SECTION"
><A
NAME="AEN8851">Variant HAL</H3
><P
>Some variant HALs may add extra files for variant specific serial
drivers, or for handling interrupts/exceptions if it makes sense.</P
><P
>Note that these files may be mostly empty if the CPU variant can be
controlled by the generic architecture macros. The definitions present
are only conditionally defined - if the equivalent platform headers
provide the definitions, those override the variant definitions.</P
><DIV
CLASS="INFORMALTABLE"
><A
NAME="AEN8855"><P
></P
><TABLE
BORDER="1"
CLASS="CALSTABLE"
><THEAD
><TR
><TH
ALIGN="LEFT"
VALIGN="TOP"
>File</TH
><TH
ALIGN="LEFT"
VALIGN="TOP"
>Description</TH
></TR
></THEAD
><TBODY
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
><TT
CLASS="FILENAME"
>include/var_arch.h</TT
></TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
>Saved register frame format, various thread, register and stack
related macros.</TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
><TT
CLASS="FILENAME"
>include/var_cache.h</TT
></TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
>Cache related macros.</TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
><TT
CLASS="FILENAME"
>include/var_intr.h</TT
></TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
>Interrupt related macros.</TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
><TT
CLASS="FILENAME"
>include/var_regs.h</TT
></TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
>Extra register definitions for the CPU variant.</TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
><TT
CLASS="FILENAME"
>include/variant.inc</TT
></TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
>Various assembly macros used during system initialization.</TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
><TT
CLASS="FILENAME"
>src/var_intr.c</TT
></TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
>Interrupt functions if necessary.</TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
><TT
CLASS="FILENAME"
>src/var_misc.c</TT
></TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
>hal_variant_init function and any necessary extra functions.</TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
><TT
CLASS="FILENAME"
>src/variant.S</TT
></TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
>Interrupt handler table definition.</TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
><TT
CLASS="FILENAME"
>src/<arch>_<variant>.ld</TT
></TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
>Linker macros.</TD
></TR
></TBODY
></TABLE
><P
></P
></DIV
></DIV
><DIV
CLASS="SECTION"
><H3
CLASS="SECTION"
><A
NAME="AEN8898">Platform HAL</H3
><P
>Extras files may be added for platform specific serial
drivers. Extra files for handling interrupts and exceptions will be
present if it makes sense.</P
><DIV
CLASS="INFORMALTABLE"
><A
NAME="AEN8901"><P
></P
><TABLE
BORDER="1"
CLASS="CALSTABLE"
><THEAD
><TR
><TH
ALIGN="LEFT"
VALIGN="TOP"
>File</TH
><TH
ALIGN="LEFT"
VALIGN="TOP"
>Description</TH
></TR
></THEAD
><TBODY
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
><TT
CLASS="FILENAME"
>include/hal_diag.h</TT
></TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
>Defines functions used for HAL diagnostics output. This would
normally be the ROM calling interface wrappers, but may also be the
low-level IO functions themselves, saving a little overhead.</TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
><TT
CLASS="FILENAME"
>include/platform.inc</TT
></TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
>Platform initialization code. This includes memory controller,
vectors, and monitor initialization. Depending on the architecture,
other things may need defining here as well: interrupt decoding,
status register initialization value, etc.</TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
><TT
CLASS="FILENAME"
>include/plf_cache.h</TT
></TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
>Platform specific cache handling.</TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
><TT
CLASS="FILENAME"
>include/plf_intr.h</TT
></TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
>Platform specific interrupt handling.</TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
><TT
CLASS="FILENAME"
>include/plf_io.h</TT
></TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
>PCI IO definitions and macros. May also be used to override
generic HAL IO macros if the platform endianness differs from that of
the CPU.</TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
><TT
CLASS="FILENAME"
>include/plf_stub.h</TT
></TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
>Defines stub initializer and board reset details.</TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
><TT
CLASS="FILENAME"
>src/hal_diag.c</TT
></TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
>May contain the low-level device drivers. But these may also
reside in plf_stub.c</TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
><TT
CLASS="FILENAME"
>src/platform.S</TT
></TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
>Memory controller setup macro, and if necessary interrupt
springboard code.</TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
><TT
CLASS="FILENAME"
>src/plf_misc.c</TT
></TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
>Platform initialization code.</TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
><TT
CLASS="FILENAME"
>src/plf_mk_defs.c</TT
></TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
>Used to export definitions from C header files to assembler
header files.</TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
><TT
CLASS="FILENAME"
>src/plf_stub.c</TT
></TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
>Platform specific stub initialization and possibly the low-level
device driver.</TD
></TR
></TBODY
></TABLE
><P
></P
></DIV
><P
>The platform HAL also contains files specifying the platform's
memory layout. These files are located in
<TT
CLASS="FILENAME"
>include/pkgconf</TT
>.</P
></DIV
><DIV
CLASS="SECTION"
><H3
CLASS="SECTION"
><A
NAME="AEN8954">Auxiliary HAL</H3
><P
>Auxiliary HALs contain whatever files are necessary to provide the
required functionality. There are no predefined set of files required
in an auxiliary HAL.</P
></DIV
></DIV
></DIV
><DIV
CLASS="NAVFOOTER"
><HR
ALIGN="LEFT"
WIDTH="100%"><TABLE
SUMMARY="Footer navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
><A
HREF="hal-porting-guide.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="ecos-ref.html"
ACCESSKEY="H"
>Home</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
><A
HREF="hal-calling-if.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
>Porting Guide</TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="hal-porting-guide.html"
ACCESSKEY="U"
>Up</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
>Virtual Vectors (eCos/ROM Monitor Calling Interface)</TD
></TR
></TABLE
></DIV
></BODY
></HTML
>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -