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
  • uspace/lib/c/arch/ia64/src/syscall.S

    rd2c91ab r70259a55  
    2929#include <abi/asmtool.h>
    3030
    31 /**
    32  * Immediate operand for break instruction.
    33  * Be carefull about the value as Ski simulator
    34  * is somewhat sensitive to its value.
     31/*
     32 * IA-64 Software Conventions and Runtime Architecture Guide mandates that
     33 * the zero-extended imm21 operand of the BREAK instruction is used as follows:
    3534 *
    36  * 0 will be confused with Ski breakpoint.
    37  * And higher values will be confused with SSC's.
     35 * MSB | Purpose
     36 * ----+--------
     37 * 000 | Reserved for architected software interrupts
     38 * 001 | Available for application use as software interrupts
     39 * 01x | Reserved for debugger breakpoints
     40 * 1xx | Reserved for definition by each ABI
    3841 */
    39 #define SYSCALL_IMM     1
     42#define SYSCALL_IMM     0x40000
    4043
    4144FUNCTION_BEGIN(__syscall)
Note: See TracChangeset for help on using the changeset viewer.