<!-- Copyright (C) 2003 Red Hat, Inc. -->
|
<!-- Copyright (C) 2003 Red Hat, Inc. -->
|
<!-- This material may be distributed only subject to the terms -->
|
<!-- This material may be distributed only subject to the terms -->
|
<!-- and conditions set forth in the Open Publication License, v1.0 -->
|
<!-- and conditions set forth in the Open Publication License, v1.0 -->
|
<!-- or later (the latest version is presently available at -->
|
<!-- or later (the latest version is presently available at -->
|
<!-- http://www.opencontent.org/openpub/). -->
|
<!-- http://www.opencontent.org/openpub/). -->
|
<!-- Distribution of the work or derivative of the work in any -->
|
<!-- Distribution of the work or derivative of the work in any -->
|
<!-- standard (paper) book form is prohibited unless prior -->
|
<!-- standard (paper) book form is prohibited unless prior -->
|
<!-- permission is obtained from the copyright holder. -->
|
<!-- permission is obtained from the copyright holder. -->
|
<HTML
|
<HTML
|
><HEAD
|
><HEAD
|
><TITLE
|
><TITLE
|
>Default Synchronous Exception Handling</TITLE
|
>Default Synchronous Exception Handling</TITLE
|
><meta name="MSSmartTagsPreventParsing" content="TRUE">
|
><meta name="MSSmartTagsPreventParsing" content="TRUE">
|
<META
|
<META
|
NAME="GENERATOR"
|
NAME="GENERATOR"
|
CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
|
CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
|
"><LINK
|
"><LINK
|
REL="HOME"
|
REL="HOME"
|
TITLE="eCos Reference Manual"
|
TITLE="eCos Reference Manual"
|
HREF="ecos-ref.html"><LINK
|
HREF="ecos-ref.html"><LINK
|
REL="UP"
|
REL="UP"
|
TITLE="Exception Handling"
|
TITLE="Exception Handling"
|
HREF="hal-exception-handling.html"><LINK
|
HREF="hal-exception-handling.html"><LINK
|
REL="PREVIOUS"
|
REL="PREVIOUS"
|
TITLE="Vectors and VSRs"
|
TITLE="Vectors and VSRs"
|
HREF="hal-vectors-and-vsrs.html"><LINK
|
HREF="hal-vectors-and-vsrs.html"><LINK
|
REL="NEXT"
|
REL="NEXT"
|
TITLE="Default Interrupt Handling"
|
TITLE="Default Interrupt Handling"
|
HREF="hal-default-interrupt-handling.html"></HEAD
|
HREF="hal-default-interrupt-handling.html"></HEAD
|
><BODY
|
><BODY
|
CLASS="SECTION"
|
CLASS="SECTION"
|
BGCOLOR="#FFFFFF"
|
BGCOLOR="#FFFFFF"
|
TEXT="#000000"
|
TEXT="#000000"
|
LINK="#0000FF"
|
LINK="#0000FF"
|
VLINK="#840084"
|
VLINK="#840084"
|
ALINK="#0000FF"
|
ALINK="#0000FF"
|
><DIV
|
><DIV
|
CLASS="NAVHEADER"
|
CLASS="NAVHEADER"
|
><TABLE
|
><TABLE
|
SUMMARY="Header navigation table"
|
SUMMARY="Header navigation table"
|
WIDTH="100%"
|
WIDTH="100%"
|
BORDER="0"
|
BORDER="0"
|
CELLPADDING="0"
|
CELLPADDING="0"
|
CELLSPACING="0"
|
CELLSPACING="0"
|
><TR
|
><TR
|
><TH
|
><TH
|
COLSPAN="3"
|
COLSPAN="3"
|
ALIGN="center"
|
ALIGN="center"
|
>eCos Reference Manual</TH
|
>eCos Reference Manual</TH
|
></TR
|
></TR
|
><TR
|
><TR
|
><TD
|
><TD
|
WIDTH="10%"
|
WIDTH="10%"
|
ALIGN="left"
|
ALIGN="left"
|
VALIGN="bottom"
|
VALIGN="bottom"
|
><A
|
><A
|
HREF="hal-vectors-and-vsrs.html"
|
HREF="hal-vectors-and-vsrs.html"
|
ACCESSKEY="P"
|
ACCESSKEY="P"
|
>Prev</A
|
>Prev</A
|
></TD
|
></TD
|
><TD
|
><TD
|
WIDTH="80%"
|
WIDTH="80%"
|
ALIGN="center"
|
ALIGN="center"
|
VALIGN="bottom"
|
VALIGN="bottom"
|
>Chapter 10. Exception Handling</TD
|
>Chapter 10. Exception Handling</TD
|
><TD
|
><TD
|
WIDTH="10%"
|
WIDTH="10%"
|
ALIGN="right"
|
ALIGN="right"
|
VALIGN="bottom"
|
VALIGN="bottom"
|
><A
|
><A
|
HREF="hal-default-interrupt-handling.html"
|
HREF="hal-default-interrupt-handling.html"
|
ACCESSKEY="N"
|
ACCESSKEY="N"
|
>Next</A
|
>Next</A
|
></TD
|
></TD
|
></TR
|
></TR
|
></TABLE
|
></TABLE
|
><HR
|
><HR
|
ALIGN="LEFT"
|
ALIGN="LEFT"
|
WIDTH="100%"></DIV
|
WIDTH="100%"></DIV
|
><DIV
|
><DIV
|
CLASS="SECTION"
|
CLASS="SECTION"
|
><H1
|
><H1
|
CLASS="SECTION"
|
CLASS="SECTION"
|
><A
|
><A
|
NAME="HAL-DEFAULT-SYNCHRONOUS-EXCEPTION-HANDLING">Default Synchronous Exception Handling</H1
|
NAME="HAL-DEFAULT-SYNCHRONOUS-EXCEPTION-HANDLING">Default Synchronous Exception Handling</H1
|
><P
|
><P
|
>Most synchronous exception VSR table entries will point to a default
|
>Most synchronous exception VSR table entries will point to a default
|
exception VSR which is responsible for handling all exceptions in a
|
exception VSR which is responsible for handling all exceptions in a
|
generic manner. The default VSR simply saves the CPU state, makes any
|
generic manner. The default VSR simply saves the CPU state, makes any
|
adjustments to the CPU state that is necessary, and calls
|
adjustments to the CPU state that is necessary, and calls
|
<TT
|
<TT
|
CLASS="FUNCTION"
|
CLASS="FUNCTION"
|
>cyg_hal_exception_handler()</TT
|
>cyg_hal_exception_handler()</TT
|
>.</P
|
>.</P
|
><P
|
><P
|
><TT
|
><TT
|
CLASS="FUNCTION"
|
CLASS="FUNCTION"
|
>cyg_hal_exception_handler()</TT
|
>cyg_hal_exception_handler()</TT
|
> needs to pass the
|
> needs to pass the
|
exception on to some handling code. There are two basic destinations:
|
exception on to some handling code. There are two basic destinations:
|
enter GDB or pass the exception up to eCos. Exactly which
|
enter GDB or pass the exception up to eCos. Exactly which
|
destination is taken depends on the configuration. When the GDB stubs are
|
destination is taken depends on the configuration. When the GDB stubs are
|
included then the exception is passed to them, otherwise it is passed
|
included then the exception is passed to them, otherwise it is passed
|
to eCos.</P
|
to eCos.</P
|
><P
|
><P
|
>If an eCos application has been loaded by RedBoot then the VSR table
|
>If an eCos application has been loaded by RedBoot then the VSR table
|
entries will all point into RedBoot's exception VSR, and will
|
entries will all point into RedBoot's exception VSR, and will
|
therefore enter GDB if an exception occurs. If the eCos application
|
therefore enter GDB if an exception occurs. If the eCos application
|
wants to handle an exception itself, it needs to replace the the VSR
|
wants to handle an exception itself, it needs to replace the the VSR
|
table entry with one pointing to its own VSR. It can do this with the
|
table entry with one pointing to its own VSR. It can do this with the
|
<TT
|
<TT
|
CLASS="FUNCTION"
|
CLASS="FUNCTION"
|
>HAL_VSR_SET_TO_ECOS_HANDLER()</TT
|
>HAL_VSR_SET_TO_ECOS_HANDLER()</TT
|
> macro.</P
|
> macro.</P
|
></DIV
|
></DIV
|
><DIV
|
><DIV
|
CLASS="NAVFOOTER"
|
CLASS="NAVFOOTER"
|
><HR
|
><HR
|
ALIGN="LEFT"
|
ALIGN="LEFT"
|
WIDTH="100%"><TABLE
|
WIDTH="100%"><TABLE
|
SUMMARY="Footer navigation table"
|
SUMMARY="Footer navigation table"
|
WIDTH="100%"
|
WIDTH="100%"
|
BORDER="0"
|
BORDER="0"
|
CELLPADDING="0"
|
CELLPADDING="0"
|
CELLSPACING="0"
|
CELLSPACING="0"
|
><TR
|
><TR
|
><TD
|
><TD
|
WIDTH="33%"
|
WIDTH="33%"
|
ALIGN="left"
|
ALIGN="left"
|
VALIGN="top"
|
VALIGN="top"
|
><A
|
><A
|
HREF="hal-vectors-and-vsrs.html"
|
HREF="hal-vectors-and-vsrs.html"
|
ACCESSKEY="P"
|
ACCESSKEY="P"
|
>Prev</A
|
>Prev</A
|
></TD
|
></TD
|
><TD
|
><TD
|
WIDTH="34%"
|
WIDTH="34%"
|
ALIGN="center"
|
ALIGN="center"
|
VALIGN="top"
|
VALIGN="top"
|
><A
|
><A
|
HREF="ecos-ref.html"
|
HREF="ecos-ref.html"
|
ACCESSKEY="H"
|
ACCESSKEY="H"
|
>Home</A
|
>Home</A
|
></TD
|
></TD
|
><TD
|
><TD
|
WIDTH="33%"
|
WIDTH="33%"
|
ALIGN="right"
|
ALIGN="right"
|
VALIGN="top"
|
VALIGN="top"
|
><A
|
><A
|
HREF="hal-default-interrupt-handling.html"
|
HREF="hal-default-interrupt-handling.html"
|
ACCESSKEY="N"
|
ACCESSKEY="N"
|
>Next</A
|
>Next</A
|
></TD
|
></TD
|
></TR
|
></TR
|
><TR
|
><TR
|
><TD
|
><TD
|
WIDTH="33%"
|
WIDTH="33%"
|
ALIGN="left"
|
ALIGN="left"
|
VALIGN="top"
|
VALIGN="top"
|
>Vectors and VSRs</TD
|
>Vectors and VSRs</TD
|
><TD
|
><TD
|
WIDTH="34%"
|
WIDTH="34%"
|
ALIGN="center"
|
ALIGN="center"
|
VALIGN="top"
|
VALIGN="top"
|
><A
|
><A
|
HREF="hal-exception-handling.html"
|
HREF="hal-exception-handling.html"
|
ACCESSKEY="U"
|
ACCESSKEY="U"
|
>Up</A
|
>Up</A
|
></TD
|
></TD
|
><TD
|
><TD
|
WIDTH="33%"
|
WIDTH="33%"
|
ALIGN="right"
|
ALIGN="right"
|
VALIGN="top"
|
VALIGN="top"
|
>Default Interrupt Handling</TD
|
>Default Interrupt Handling</TD
|
></TR
|
></TR
|
></TABLE
|
></TABLE
|
></DIV
|
></DIV
|
></BODY
|
></BODY
|
></HTML
|
></HTML
|
|
|