Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
19 years ago

.section .exceptions.entry.label, "xa"

Dear all,

In file "alt_exception_entry.S", I find the following sentences, they make me dizzy, anyone help me interpre them?

.section .exceptions.entry.label, "xa"

.section .exceptions.entry, "xa"

.section .exceptions.notirq, "xa"

.section .exceptions.unknown

.section .exceptions.exit, "xa"

...

Thanks any help,

David

5 Replies

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Hi David,

    as you might have noticed already, the exception handler is spread over a couple of source files and these labels are used to identify specific blocks of the exception handler. You will find these labels and a lot more (like .exceptions.entry.user) in the generated.x file again.

    They give you the opportunity to replace the exception handler or add your own code to it without touching the original files.

    hope this helps,

    --wolfgang
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    So the following sentences in generated.x will determine the final memory layout of all the sections related to .exception

    KEEP (*(.exceptions.entry.label));

    KEEP (*(.exceptions.entry.user));

    KEEP (*(.exceptions.entry));

    KEEP (*(.exceptions.irqtest.user));

    KEEP (*(.exceptions.irqtest));

    KEEP (*(.exceptions.irqhandler.user));

    KEEP (*(.exceptions.irqhandler));

    KEEP (*(.exceptions.irqreturn.user));

    KEEP (*(.exceptions.irqreturn));

    KEEP (*(.exceptions.notirq.label));

    KEEP (*(.exceptions.notirq.user));

    KEEP (*(.exceptions.notirq));

    KEEP (*(.exceptions.unknown.user));

    KEEP (*(.exceptions.unknown));

    KEEP (*(.exceptions.soft.user));

    KEEP (*(.exceptions.soft));

    KEEP (*(.exceptions.exit.label));

    KEEP (*(.exceptions.exit.user));

    KEEP (*(.exceptions.exit));

    KEEP (*(.exceptions));

    Am I right?

    And if I define my own .exceptions.entry.user, how can it override the old .exceptions.entry?

    Thanks again,

    David
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Hi David,

    yes, you are right!

    And you can bypass the section .exception.entry by branching to one of the other sections from your own code or by just returning from the exception, if you have specified your own exception handler in the section .exception.entry.user (that's the way I did it).

    --wolfgang