Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issues with xinterrupt_wrap #312

Open
aforster-mr opened this issue Sep 23, 2024 · 0 comments
Open

Issues with xinterrupt_wrap #312

aforster-mr opened this issue Sep 23, 2024 · 0 comments

Comments

@aforster-mr
Copy link

I am trying to adopt this example to implement a custom interrupt handler. The example works but I found two issues when modifying it for my use case.

  • According to the example, XINTR_IS_EDGE_TRIGGERED (defined as 3) should be passed as the TriggerType parameter to XGetEncodedIntrId to define an edge triggered interrupt. This is not one of the valid values given by the comment for XGetEncodedIntrId.

    #define XINTR_IS_EDGE_TRIGGERED 3U

    * @param : TriggerType Trigger type for targted interrupt ID (documented in
    * TRM of targeted SoC)
    * 1 = low-to-high edge triggered
    * 2 = high-to-low edge triggered
    * 4 = active high level-sensitive
    * 8 = active low level-sensitive

    This causes problems down the line. For example in XSetPriorityTriggerType where the value is compared against 1 and 2. A level trigger is selected when we wanted an edge trigger.

    void XSetPriorityTriggerType( u32 IntrId, u8 Priority, UINTPTR IntcParent)
    {
    #if defined (XPAR_SCUGIC)
    u8 Trigger = (((XGet_TriggerType(IntrId) == 1) ||
    (XGet_TriggerType(IntrId) == 2)) ? XINTR_IS_EDGE_TRIGGERED
    : XINTR_IS_LEVEL_TRIGGERED);

  • In the implementation of XGetEncodedIntrId, XINTC_INTR_TYPE_SHIFT is used directly as a bitmask when it should instead be used to shift a bit.

    } else if (IntrType == XPPI) {
    *IntrId -= 16;
    *IntrId |= XINTC_INTR_TYPE_SHIFT;
    } else if (IntrType == XSGI) {
    *IntrId |= (1 << XINTC_IS_SGI_INTR_SHIFT);

  • (also, there is a typo in the change data of the example file)

    * 5.2 mus 04/33/34 Use interrupt wrapper APIs in case of SDT flow.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant