Changeset 70259a55 in mainline for kernel/arch/ia64/src/interrupt.c


Ignore:
Timestamp:
2018-09-11T21:01:08Z (6 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
e38ff16
Parents:
d2c91ab
Message:

ia64: Use appropriate imm21 operand with BREAK

This commit changes the imm21 used with the BREAK instruction to conform
to the IA-64 Software Conventions and Runtime Architecture Guide. This
is necessary to be able to distinguish syscalls from compiler-generated
calls to architected software interrupts (e.g. integer divide by zero).

In order to be able to test the used immediate in break_instruction(),
we extend istate_t to hold the CR.IIM register.

File:
1 edited

Legend:

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

    rd2c91ab r70259a55  
    195195}
    196196
     197
     198#define BREAK_IMM_SYSCALL       0x40000U
     199
    197200/** Handle syscall. */
    198201sysarg_t break_instruction(unsigned int n, istate_t *istate)
    199202{
    200203        sysarg_t ret;
     204
     205        if (istate->cr_iim != BREAK_IMM_SYSCALL) {
     206                fault_if_from_uspace(istate, "Unknown software interrupt: %x",
     207                    (uint32_t) istate->cr_iim);
     208                panic_badtrap(istate, n, "Interruption: %#hx (%s).",
     209                    (uint16_t) n, vector_to_string(n));
     210        }
    201211
    202212        /*
Note: See TracChangeset for help on using the changeset viewer.