Changeset 6de65f3 in mainline


Ignore:
Timestamp:
2019-04-19T11:50:54Z (6 years ago)
Author:
Petr Pavlu <setup@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
5773e82
Parents:
739bc43
git-author:
Petr Pavlu <setup@…> (2019-04-19 11:26:51)
git-committer:
Petr Pavlu <setup@…> (2019-04-19 11:50:54)
Message:

arm64: Simplify handling of the IRQ flag in ipl_t

Store the IRQ flag in ipl_t at the same position as it is present in the
DAIF system register. This avoids extra bit-shifting when translating
DAIF to ipl_t and vice versa.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/arch/arm64/src/interrupt.c

    r739bc43 r6de65f3  
    5353        DAIF_write(daif | DAIF_IRQ_FLAG);
    5454
    55         return (daif >> DAIF_IRQ_SHIFT) & 1;
     55        return daif & DAIF_IRQ_FLAG;
    5656}
    5757
     
    6666        DAIF_write(daif & ~DAIF_IRQ_FLAG);
    6767
    68         return (daif >> DAIF_IRQ_SHIFT) & 1;
     68        return daif & DAIF_IRQ_FLAG;
    6969}
    7070
     
    7777        uint64_t daif = DAIF_read();
    7878
    79         DAIF_write((daif & ~DAIF_IRQ_FLAG) |
    80             ((ipl & 1) << DAIF_IRQ_SHIFT));
     79        DAIF_write((daif & ~DAIF_IRQ_FLAG) | (ipl & DAIF_IRQ_FLAG));
    8180}
    8281
     
    8786ipl_t interrupts_read(void)
    8887{
    89         return (DAIF_read() >> DAIF_IRQ_SHIFT) & 1;
     88        return DAIF_read() & DAIF_IRQ_FLAG;
    9089}
    9190
Note: See TracChangeset for help on using the changeset viewer.