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

Annotation of sys/arch/sparc/include/reg.h, Revision 1.1

1.1     ! nbrk        1: /*     $OpenBSD: reg.h,v 1.3 2003/06/02 23:27:54 millert Exp $ */
        !             2: /*     $NetBSD: reg.h,v 1.4 1994/11/20 20:53:28 deraadt Exp $ */
        !             3:
        !             4: /*
        !             5:  * Copyright (c) 1992, 1993
        !             6:  *     The Regents of the University of California.  All rights reserved.
        !             7:  *
        !             8:  * This software was developed by the Computer Systems Engineering group
        !             9:  * at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and
        !            10:  * contributed to Berkeley.
        !            11:  *
        !            12:  * All advertising materials mentioning features or use of this software
        !            13:  * must display the following acknowledgement:
        !            14:  *     This product includes software developed by the University of
        !            15:  *     California, Lawrence Berkeley Laboratory.
        !            16:  *
        !            17:  * Redistribution and use in source and binary forms, with or without
        !            18:  * modification, are permitted provided that the following conditions
        !            19:  * are met:
        !            20:  * 1. Redistributions of source code must retain the above copyright
        !            21:  *    notice, this list of conditions and the following disclaimer.
        !            22:  * 2. Redistributions in binary form must reproduce the above copyright
        !            23:  *    notice, this list of conditions and the following disclaimer in the
        !            24:  *    documentation and/or other materials provided with the distribution.
        !            25:  * 3. Neither the name of the University nor the names of its contributors
        !            26:  *    may be used to endorse or promote products derived from this software
        !            27:  *    without specific prior written permission.
        !            28:  *
        !            29:  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
        !            30:  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
        !            31:  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
        !            32:  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
        !            33:  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
        !            34:  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
        !            35:  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
        !            36:  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
        !            37:  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
        !            38:  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
        !            39:  * SUCH DAMAGE.
        !            40:  *
        !            41:  *     @(#)reg.h       8.1 (Berkeley) 6/11/93
        !            42:  */
        !            43:
        !            44: #ifndef _MACHINE_REG_H_
        !            45: #define        _MACHINE_REG_H_
        !            46:
        !            47: /*
        !            48:  * Registers passed to trap/syscall/etc.
        !            49:  * This structure is known to occupy exactly 80 bytes (see locore.s).
        !            50:  * Note, tf_global[0] is not actually written (since g0 is always 0).
        !            51:  * (The slot tf_global[0] is used to send a copy of %wim to kernel gdb.
        !            52:  * This is known as `cheating'.)
        !            53:  */
        !            54: struct trapframe {
        !            55:        int     tf_psr;         /* psr */
        !            56:        int     tf_pc;          /* return pc */
        !            57:        int     tf_npc;         /* return npc */
        !            58:        int     tf_y;           /* %y register */
        !            59:        int     tf_global[8];   /* global registers in trap's caller */
        !            60:        int     tf_out[8];      /* output registers in trap's caller */
        !            61: };
        !            62:
        !            63: /*
        !            64:  * Register windows.  Each stack pointer (%o6 aka %sp) in each window
        !            65:  * must ALWAYS point to some place at which it is safe to scribble on
        !            66:  * 64 bytes.  (If not, your process gets mangled.)  Furthermore, each
        !            67:  * stack pointer should be aligned on an 8-byte boundary (the kernel
        !            68:  * as currently coded allows arbitrary alignment, but with a hefty
        !            69:  * performance penalty).
        !            70:  */
        !            71: struct rwindow {
        !            72:        int     rw_local[8];            /* %l0..%l7 */
        !            73:        int     rw_in[8];               /* %i0..%i7 */
        !            74: };
        !            75:
        !            76: /*
        !            77:  * Clone trapframe for now; this seems to be the more useful
        !            78:  * than the old struct reg above.
        !            79:  */
        !            80: struct reg {
        !            81:        int     r_psr;          /* psr */
        !            82:        int     r_pc;           /* return pc */
        !            83:        int     r_npc;          /* return npc */
        !            84:        int     r_y;            /* %y register */
        !            85:        int     r_global[8];    /* global registers in trap's caller */
        !            86:        int     r_out[8];       /* output registers in trap's caller */
        !            87: };
        !            88:
        !            89: #include <machine/fsr.h>
        !            90:
        !            91: /*
        !            92:  * FP coprocessor registers.
        !            93:  *
        !            94:  * FP_QSIZE is the maximum coprocessor instruction queue depth
        !            95:  * of any implementation on which the kernel will run.  David Hough:
        !            96:  * ``I'd suggest allowing 16 ... allowing an indeterminate variable
        !            97:  * size would be even better''.  Of course, we cannot do that; we
        !            98:  * need to malloc these.
        !            99:  */
        !           100: #define        FP_QSIZE        16
        !           101:
        !           102: struct fp_qentry {
        !           103:        int     *fq_addr;               /* the instruction's address */
        !           104:        int     fq_instr;               /* the instruction itself */
        !           105: };
        !           106: struct fpstate {
        !           107:        u_int   fs_regs[32];            /* our view is 32 32-bit registers */
        !           108:        int     fs_fsr;                 /* %fsr */
        !           109:        int     fs_qsize;               /* actual queue depth */
        !           110:        struct  fp_qentry fs_queue[FP_QSIZE];   /* queue contents */
        !           111: };
        !           112:
        !           113: /*
        !           114:  * Clone fpstate into an fpreg structure to satisfy <kern/sys_process.c>
        !           115:  */
        !           116: struct fpreg {
        !           117:        u_int   fr_regs[32];            /* our view is 32 32-bit registers */
        !           118:        int     fr_fsr;                 /* %fsr */
        !           119:        int     fr_qsize;               /* actual queue depth */
        !           120:        struct  fp_qentry fr_queue[FP_QSIZE];   /* queue contents */
        !           121: };
        !           122:
        !           123: #endif /* _MACHINE_REG_H_ */

CVSweb