home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 4 / Apprentice-Release4.iso / Source Code / C / Applications / Portable Patmos / usr / include / machine / frame.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-11-08  |  4.3 KB  |  160 lines  |  [TEXT/R*ch]

  1. /*
  2.  * Copyright (c) 1988 University of Utah.
  3.  * Copyright (c) 1982, 1990 The Regents of the University of California.
  4.  * All rights reserved.
  5.  *
  6.  * This code is derived from software contributed to Berkeley by
  7.  * the Systems Programming Group of the University of Utah Computer
  8.  * Science Department.
  9.  *
  10.  * Redistribution and use in source and binary forms, with or without
  11.  * modification, are permitted provided that the following conditions
  12.  * are met:
  13.  * 1. Redistributions of source code must retain the above copyright
  14.  *    notice, this list of conditions and the following disclaimer.
  15.  * 2. Redistributions in binary form must reproduce the above copyright
  16.  *    notice, this list of conditions and the following disclaimer in the
  17.  *    documentation and/or other materials provided with the distribution.
  18.  * 3. All advertising materials mentioning features or use of this software
  19.  *    must display the following acknowledgement:
  20.  *    This product includes software developed by the University of
  21.  *    California, Berkeley and its contributors.
  22.  * 4. Neither the name of the University nor the names of its contributors
  23.  *    may be used to endorse or promote products derived from this software
  24.  *    without specific prior written permission.
  25.  *
  26.  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
  27.  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  28.  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  29.  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
  30.  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  31.  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  32.  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  33.  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  34.  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  35.  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  36.  * SUCH DAMAGE.
  37.  */
  38. /*
  39.  * from: Utah $Hdr: frame.h 1.1 90/07/09$
  40.  *
  41.  *    from: @(#)frame.h    7.2 (Berkeley) 11/2/90
  42.  *    $Id: frame.h,v 1.2 1993/11/29 00:38:10 briggs Exp $
  43.  */
  44.  
  45. struct frame {
  46.     int    f_regs[16];
  47.     short    f_stackadj;
  48.     u_short    f_sr;
  49.     u_int    f_pc;
  50.     u_short    f_format:4,
  51.         f_vector:12;
  52.     union F_u {
  53.         struct fmt2 {
  54.             u_int    f_iaddr;
  55.         } F_fmt2;
  56.  
  57.         struct fmt9 {
  58.             u_int    f_iaddr;
  59.             u_short    f_iregs[4];
  60.         } F_fmt9;
  61.  
  62.         struct fmtA {
  63.             u_short    f_ir0;
  64.             u_short    f_ssw;
  65.             u_short    f_ipsc;
  66.             u_short    f_ipsb;
  67.             u_int    f_dcfa;
  68.             u_short    f_ir1, f_ir2;
  69.             u_int    f_dob;
  70.             u_short    f_ir3, f_ir4;
  71.         } F_fmtA;
  72.  
  73.         struct fmtB {
  74.             u_short    f_ir0;
  75.             u_short    f_ssw;
  76.             u_short    f_ipsc;
  77.             u_short    f_ipsb;
  78.             u_int    f_dcfa;
  79.             u_short    f_ir1, f_ir2;
  80.             u_int    f_dob;
  81.             u_short    f_ir3, f_ir4;
  82.             u_short    f_ir5, f_ir6;
  83.             u_int    f_sba;
  84.             u_short    f_ir7, f_ir8;
  85.             u_int    f_dib;
  86.             u_short    f_iregs[22];
  87.         } F_fmtB;
  88.     } F_u;
  89. };
  90.  
  91. #define    f_fmt2        F_u.F_fmt2
  92. #define    f_fmtA        F_u.F_fmtA
  93. #define    f_fmtB        F_u.F_fmtB
  94.  
  95. /* common frame size */
  96. #define    CFSIZE        (sizeof(struct frame) - sizeof(union F_u))
  97. #define    NFMTSIZE    8
  98.  
  99. #define    FMT0        0x0
  100. #define    FMT1        0x1
  101. #define    FMT2        0x2
  102. #define    FMT9        0x9
  103. #define    FMTA        0xA
  104. #define    FMTB        0xB
  105.  
  106. /* frame specific info sizes */
  107. #define    FMT0SIZE    0
  108. #define    FMT1SIZE    0
  109. #define    FMT2SIZE    sizeof(struct fmt2)
  110. #define    FMT9SIZE    sizeof(struct fmt9)
  111. #define    FMTASIZE    sizeof(struct fmtA)
  112. #define    FMTBSIZE    sizeof(struct fmtB)
  113.  
  114. #define    V_BUSERR    0x008
  115. #define    V_ADDRERR    0x00C
  116. #define    V_TRAP1        0x084
  117.  
  118. #define    SSW_RC        0x2000
  119. #define    SSW_RB        0x1000
  120. #define    SSW_DF        0x0100
  121. #define    SSW_RM        0x0080
  122. #define    SSW_RW        0x0040
  123. #define    SSW_FCMASK    0x0007
  124.  
  125. struct fpframe {
  126.     union FPF_u1 {
  127.         u_int    FPF_null;
  128.         struct {
  129.             u_char    FPF_version;
  130.             u_char    FPF_fsize;
  131.             u_short    FPF_res1;
  132.         } FPF_nonnull;
  133.     } FPF_u1;
  134.     union FPF_u2 {
  135.         struct fpidle {
  136.             u_short    fpf_ccr;
  137.             u_short    fpf_res2;
  138.             u_int    fpf_iregs1[8];
  139.             u_int    fpf_xops[3];
  140.             u_int    fpf_opreg;
  141.             u_int    fpf_biu;
  142.         } FPF_idle;
  143.  
  144.         struct fpbusy {
  145.             u_int    fpf_iregs[53];
  146.         } FPF_busy;
  147.     } FPF_u2;
  148.     u_int    fpf_regs[8*3];
  149.     u_int    fpf_fpcr;
  150.     u_int    fpf_fpsr;
  151.     u_int    fpf_fpiar;
  152. };
  153.  
  154. #define fpf_null    FPF_u1.FPF_null
  155. #define fpf_version    FPF_u1.FPF_nonnull.FPF_version
  156. #define fpf_fsize    FPF_u1.FPF_nonnull.FPF_fsize
  157. #define fpf_res1    FPF_u1.FPF_nonnull.FPF_res1
  158. #define fpf_idle    FPF_u2.FPF_idle
  159. #define fpf_busy    FPF_u2.FPF_busy
  160.