Changeset 901122b in mainline


Ignore:
Timestamp:
2006-03-09T17:40:30Z (19 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
a2a46ba
Parents:
b994a60
Message:

ia64 work.
Userspace is now working.
There is an unrelated show stopper, however.

Location:
arch/ia64
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • arch/ia64/include/interrupt.h

    rb994a60 r901122b  
    5858        cr_isr_t cr_isr;
    5959        __address cr_iipa;
    60         __u64 cr_ips;
     60        psr_t cr_ipsr;
    6161        __address cr_iip;
    6262        __u64 pr;
    6363        __address sp;
     64       
     65        /*
     66         * The following variables are defined only for break_instruction handler.
     67         */
     68        __u64 in0;
     69        __u64 in1;
     70        __u64 in2;
     71        __u64 in3;
    6472} __attribute__ ((packed));
    6573
     
    6775
    6876extern void general_exception(__u64 vector, struct exception_regdump *pstate);
    69 extern void break_instruction(__u64 vector, struct exception_regdump *pstate);
     77extern int break_instruction(__u64 vector, struct exception_regdump *pstate);
    7078extern void universal_handler(__u64 vector, struct exception_regdump *pstate);
    7179extern void external_interrupt(__u64 vector, struct exception_regdump *pstate);
  • arch/ia64/src/interrupt.c

    rb994a60 r901122b  
    4141#include <symtab.h>
    4242#include <debug.h>
     43#include <syscall/syscall.h>
     44#include <print.h>
    4345
    4446#define VECTORS_64_BUNDLE       20
     
    132134        printf("ar.rnat=%Q\tar.rsc=%Q\n", pstate->ar_rnat, pstate->ar_rsc);
    133135        printf("ar.ifs=%Q\tar.pfs=%Q\n", pstate->ar_ifs, pstate->ar_pfs);
    134         printf("cr.isr=%Q\tcr.ips=%Q\t\n", pstate->cr_isr.value, pstate->cr_ips);
     136        printf("cr.isr=%Q\tcr.ipsr=%Q\t\n", pstate->cr_isr.value, pstate->cr_ipsr);
    135137       
    136138        printf("cr.iip=%Q, #%d\t(%s)\n", pstate->cr_iip, pstate->cr_isr.ei ,iip ? iip : "?");
     
    172174}
    173175
    174 void break_instruction(__u64 vector, struct exception_regdump *pstate)
    175 {
    176         dump_interrupted_context(pstate);
    177         panic("Break Instruction\n");
     176/** Handle syscall. */
     177int break_instruction(__u64 vector, struct exception_regdump *pstate)
     178{
     179        /*
     180         * Move to next instruction after BREAK.
     181         */
     182        if (pstate->cr_ipsr.ri == 2) {
     183                pstate->cr_ipsr.ri = 0;
     184                pstate->cr_iip += 16;
     185        } else {
     186                pstate->cr_ipsr.ri++;
     187        }
     188
     189        if (pstate->in0 < SYSCALL_END)
     190                return syscall_table[pstate->in0](pstate->in1, pstate->in2, pstate->in3);
     191        else
     192                panic("Undefined syscall %d", pstate->in0);
     193               
     194        return -1;
    178195}
    179196
  • arch/ia64/src/ivt.S

    rb994a60 r901122b  
    3333#include <align.h>
    3434
    35 #define STACK_ITEMS             14
     35#define STACK_ITEMS             18
    3636#define STACK_FRAME_SIZE        ALIGN_UP((STACK_ITEMS*STACK_ITEM_SIZE) + STACK_SCRATCH_AREA_SIZE, STACK_ALIGNMENT)
    3737
     
    4646#define R_HANDLER       r17
    4747#define R_RET           r18
     48#define R_TMP           r19
    4849#define R_KSTACK_BSP    r22     /* keep in sync with before_thread_runs_arch() */
    4950#define R_KSTACK        r23     /* keep in sync with before_thread_runs_arch() */
     
    105106         * Set p4 to false if the stack register doesn't reference kernel address space.
    106107         */
    107         (p3) cmp.eq p3, p4 = VRN_KERNEL, r31 ;;
     108(p3)    cmp.eq p3, p4 = VRN_KERNEL, r31 ;;
    108109       
    109110        /*
     
    111112         */
    112113        mov r30 = r12
    113         (p4) mov r12 = R_KSTACK ;;
     114(p4)    mov r12 = R_KSTACK ;;
    114115       
    115116        add r31 = -STACK_FRAME_BIAS, r12 ;;
    116117        add r12 = -STACK_FRAME_SIZE, r12
    117118
    118     /* 4. save registers in bank 0 into memory stack */
     119    /* 4. save registers in bank 0 into memory stack */
     120
     121        /*
     122         * If this is break_instruction handler,
     123         * copy input parameters to stack.
     124         */
     125        mov R_TMP = 0x2c00 ;;
     126        cmp.eq p6,p5 = R_OFFS, R_TMP ;;
     127       
     128        /*
     129         * From now on, if this is break_instruction handler, p6 is true and p5 is false.
     130         * Otherwise p6 is false and p5 is true.
     131         * Note that p5 is a preserved predicate register and we make use of it.
     132         */
     133       
     134(p6)    st8 [r31] = r35, -8 ;;          /* save in3 */
     135(p6)    st8 [r31] = r34, -8 ;;          /* save in2 */
     136(p6)    st8 [r31] = r33, -8 ;;          /* save in1 */
     137(p6)    st8 [r31] = r32, -8 ;;          /* save in0 */
     138(p5)    add r31 = -32, r31 ;;
     139   
    119140        st8 [r31] = r30, -8 ;;          /* save old stack pointer */
    120141       
     
    147168         * Inspect BSPSTORE to figure out whether it is necessary to switch to kernel BSPSTORE.
    148169         */
    149         (p1) shr.u r30 = r28, VRN_SHIFT ;;
    150         (p1) cmp.eq p1, p2 = VRN_KERNEL, r30 ;;
     170(p1)    shr.u r30 = r28, VRN_SHIFT ;;
     171(p1)    cmp.eq p1, p2 = VRN_KERNEL, r30 ;;
    151172       
    152173        /*
    153174         * If BSPSTORE needs to be switched, p1 is false and p2 is true.
    154175         */
    155         (p1) mov r30 = r28
    156         (p2) mov r30 = R_KSTACK_BSP ;;
    157         (p2) mov ar.bspstore = r30 ;;
     176(p1)    mov r30 = r28
     177(p2)    mov r30 = R_KSTACK_BSP ;;
     178(p2)    mov ar.bspstore = r30 ;;
    158179       
    159180        mov r29 = ar.bsp
     
    269290        mov loc22 = r6
    270291        mov loc23 = r7
    271         mov loc24 = r8
     292(p5)    mov loc24 = r8          /* only if not in break_instruction handler */
    272293        mov loc25 = r9
    273294        mov loc26 = r10
     
    326347        mov r6 = loc22
    327348        mov r7 = loc23
    328         mov r8 = loc24
     349(p5)    mov r8 = loc24          /* only if not in break_instruction handler */
    329350        mov r9 = loc25
    330351        mov r10 = loc26
Note: See TracChangeset for help on using the changeset viewer.