[BACK]Return to frame.h CVS log [TXT][DIR] Up to [local] / sys / arch / hppa / include

Annotation of sys/arch/hppa/include/frame.h, Revision 1.1.1.1

1.1       nbrk        1: /*     $OpenBSD: frame.h,v 1.16 2004/04/07 18:24:19 mickey Exp $       */
                      2:
                      3: /*
                      4:  * Copyright (c) 1999-2004 Michael Shalayeff
                      5:  * All rights reserved.
                      6:  *
                      7:  * Redistribution and use in source and binary forms, with or without
                      8:  * modification, are permitted provided that the following conditions
                      9:  * are met:
                     10:  * 1. Redistributions of source code must retain the above copyright
                     11:  *    notice, this list of conditions and the following disclaimer.
                     12:  * 2. Redistributions in binary form must reproduce the above copyright
                     13:  *    notice, this list of conditions and the following disclaimer in the
                     14:  *    documentation and/or other materials provided with the distribution.
                     15:  *
                     16:  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
                     17:  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
                     18:  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
                     19:  * IN NO EVENT SHALL THE AUTHOR OR HIS RELATIVES BE LIABLE FOR ANY DIRECT,
                     20:  * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
                     21:  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
                     22:  * SERVICES; LOSS OF MIND, USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
                     23:  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
                     24:  * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
                     25:  * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
                     26:  * THE POSSIBILITY OF SUCH DAMAGE.
                     27:  */
                     28:
                     29:
                     30: #ifndef _MACHINE_FRAME_H_
                     31: #define _MACHINE_FRAME_H_
                     32:
                     33: /*
                     34:  * Call frame definitions
                     35:  */
                     36: #define        HPPA_FRAME_NARGS        (12)
                     37: #define        HPPA_FRAME_MAXARGS      (HPPA_FRAME_NARGS * 4)
                     38: #define        HPPA_FRAME_ARG(n)       (-(32 + 4*((n) + 1)))
                     39: #define        HPPA_FRAME_CARG(n,sp)   ((register_t *)((sp) + HPPA_FRAME_ARG(n)))
                     40: #define        HPPA_FRAME_SIZE         (64)
                     41: #define        HPPA_FRAME_PSP          (-4)
                     42: #define        HPPA_FRAME_EP           (-8)
                     43: #define        HPPA_FRAME_CLUP         (-12)
                     44: #define        HPPA_FRAME_SL           (-16)
                     45: #define        HPPA_FRAME_CRP          (-20)
                     46: #define        HPPA_FRAME_ERP          (-24)
                     47: #define        HPPA_FRAME_ESR4         (-28)
                     48: #define        HPPA_FRAME_EDP          (-32)
                     49:
                     50: /*
                     51:  * Macros to decode processor status word.
                     52:  */
                     53: #define        HPPA_PC_PRIV_MASK    3
                     54: #define        HPPA_PC_PRIV_KERN    0
                     55: #define        HPPA_PC_PRIV_USER    3
                     56: #define        USERMODE(pc)    ((((register_t)pc) & HPPA_PC_PRIV_MASK) != HPPA_PC_PRIV_KERN)
                     57: #define        KERNMODE(pc)    (((register_t)pc) & ~HPPA_PC_PRIV_MASK)
                     58:
                     59: #ifndef _LOCORE
                     60: /*
                     61:  * the trapframe is divided into two parts:
                     62:  *     one is saved while we are in the physical mode (beginning of the trap),
                     63:  *     and should be kept as small as possible, since all the interrupts will
                     64:  *     be lost during this phase, also it must be 64-bytes aligned, per
                     65:  *     pa-risc stack conventions, and its dependencies in the code (;
                     66:  *     the other part is filled out when we are already in the virtual mode,
                     67:  *     are able to catch interrupts (they are kept pending) and perform
                     68:  *     other trap activities (like tlb misses).
                     69:  */
                     70: struct trapframe {
                     71:        /* the `physical' part of the trapframe */
                     72:        unsigned        tf_t1;          /* r22 */
                     73:        unsigned        tf_t2;          /* r21 */
                     74:        unsigned        tf_sp;          /* r30 */
                     75:        unsigned        tf_t3;          /* r20 */
                     76:        unsigned        tf_iisq_head;   /* cr17 */
                     77:        unsigned        tf_iisq_tail;
                     78:        unsigned        tf_iioq_head;   /* cr18 */
                     79:        unsigned        tf_iioq_tail;
                     80:        unsigned        tf_eiem;        /* cr15 */
                     81:        unsigned        tf_ipsw;        /* cr22 */
                     82:        unsigned        tf_sr3;
                     83:        unsigned        tf_pidr1;       /* cr8 */
                     84:        unsigned        tf_isr;         /* cr20 */
                     85:        unsigned        tf_ior;         /* cr21 */
                     86:        unsigned        tf_iir;         /* cr19 */
                     87:        unsigned        tf_flags;
                     88:
                     89:        /* here starts the `virtual' part */
                     90:        unsigned        tf_sar;         /* cr11 */
                     91:        unsigned        tf_r1;
                     92:        unsigned        tf_rp;          /* r2 */
                     93:        unsigned        tf_r3;          /* frame pointer when -g */
                     94:        unsigned        tf_r4;
                     95:        unsigned        tf_r5;
                     96:        unsigned        tf_r6;
                     97:        unsigned        tf_r7;
                     98:        unsigned        tf_r8;
                     99:        unsigned        tf_r9;
                    100:        unsigned        tf_r10;
                    101:        unsigned        tf_r11;
                    102:        unsigned        tf_r12;
                    103:        unsigned        tf_r13;
                    104:        unsigned        tf_r14;
                    105:        unsigned        tf_r15;
                    106:        unsigned        tf_r16;
                    107:        unsigned        tf_r17;
                    108:        unsigned        tf_r18;
                    109:        unsigned        tf_t4;          /* r19 */
                    110:        unsigned        tf_arg3;        /* r23 */
                    111:        unsigned        tf_arg2;        /* r24 */
                    112:        unsigned        tf_arg1;        /* r25 */
                    113:        unsigned        tf_arg0;        /* r26 */
                    114:        unsigned        tf_dp;          /* r27 */
                    115:        unsigned        tf_ret0;        /* r28 */
                    116:        unsigned        tf_ret1;        /* r29 */
                    117:        unsigned        tf_r31;
                    118:        unsigned        tf_sr0;
                    119:        unsigned        tf_sr1;
                    120:        unsigned        tf_sr2;
                    121:        unsigned        tf_sr4;
                    122:        unsigned        tf_sr5;
                    123:        unsigned        tf_sr6;
                    124:        unsigned        tf_sr7;
                    125:        unsigned        tf_pidr2;       /* cr9 */
                    126:        unsigned        tf_pidr3;       /* cr12 */
                    127:        unsigned        tf_pidr4;       /* cr13 */
                    128:        unsigned        tf_rctr;        /* cr0 */
                    129:        unsigned        tf_ccr;         /* cr10 */
                    130:        unsigned        tf_eirr;        /* cr23 - DDB */
                    131:        unsigned        tf_vtop;        /* cr25 - DDB */
                    132:        unsigned        tf_cr28;        /*      - DDB */
                    133:        unsigned        tf_cr30;        /* uaddr */
                    134:
                    135:        unsigned        tf_pad[4];      /* pad to 256 bytes */
                    136: };
                    137: #endif /* !_LOCORE */
                    138:
                    139: #endif /* !_MACHINE_FRAME_H_ */

CVSweb