home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / mitsch75.zip / scheme-7_5_17-src.zip / scheme-7.5.17 / src / microcode / hppacach.h < prev    next >
C/C++ Source or Header  |  2000-12-05  |  3KB  |  134 lines

  1. /* -*-C-*-
  2.  
  3. $Id: hppacach.h,v 1.6 2000/12/05 21:23:44 cph Exp $
  4.  
  5. Copyright (c) 1990-2000 Massachusetts Institute of Technology
  6.  
  7. This program is free software; you can redistribute it and/or modify
  8. it under the terms of the GNU General Public License as published by
  9. the Free Software Foundation; either version 2 of the License, or (at
  10. your option) any later version.
  11.  
  12. This program is distributed in the hope that it will be useful, but
  13. WITHOUT ANY WARRANTY; without even the implied warranty of
  14. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  15. General Public License for more details.
  16.  
  17. You should have received a copy of the GNU General Public License
  18. along with this program; if not, write to the Free Software
  19. Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  20. */
  21.  
  22. #ifndef HPPACACHE_H        /* Prevent multiple inclusion */
  23. #define HPPACACHE_H
  24.  
  25. #define I_CACHE        1
  26. #define D_CACHE        2
  27.  
  28. #include <fcntl.h>
  29.  
  30. #ifdef __HPUX__
  31. #include <sys/utsname.h>
  32. #include <sys/types.h>
  33. #include <sys/param.h>
  34. #include <machine/cpu.h>
  35. #include <machine/pdc_rqsts.h>
  36. #endif /* __HPUX__ */
  37.  
  38. /* PDC_CACHE (processor dependent code cache information call)
  39.    return data destructuring.
  40.  
  41.    This is the same information as in machine/pdc_rqsts.h
  42.    pdc_cache_rtn_block, but with fields as defined in the PDC_CACHE
  43.    section of the I/O Architecture Manual.
  44.  
  45.    The main difference is the cache configuration field.
  46.    Which is correct?  */
  47.  
  48. union cache_conf
  49. {
  50.   unsigned long word;
  51.   struct
  52.   {
  53.     unsigned block:    8;
  54.     unsigned line:    3;
  55.     unsigned res1:    2;
  56.     unsigned wt:    1;
  57.     unsigned fsel:    2;
  58.     unsigned cst:    3;
  59.     unsigned res2:    11;
  60.     unsigned hv:    2;
  61.   } bits;
  62. };
  63.  
  64. struct cache_info
  65. {
  66.   unsigned long size;        /* in bytes */
  67.   union cache_conf conf;    /* format description */
  68.   unsigned long base;        /* start address */
  69.   unsigned long stride;        /* in bytes */
  70.   unsigned long count;        /* number of entries */
  71.   unsigned long loop;        /* set associativity */
  72. };
  73.  
  74. union tlb_conf
  75. {
  76.   unsigned long word;
  77.   struct
  78.   {
  79.     unsigned res1:    12;
  80.     unsigned psel:    2;
  81.     unsigned hv1:    1;
  82.     unsigned res2:    1;
  83.     unsigned cst:    3;
  84.     unsigned res3:    11;
  85.     unsigned hv2:    2;
  86.   } bits;
  87. };
  88.  
  89. struct tlb_info
  90. {
  91.   unsigned long size;        /* number of entries */
  92.   union tlb_conf conf;        /* format description */
  93.   unsigned long sp_base;    /* space parameters */
  94.   unsigned long sp_stride;
  95.   unsigned long sp_count;
  96.   unsigned long off_base;    /* offset parameters */
  97.   unsigned long off_stride;
  98.   unsigned long off_count;
  99.   unsigned long loop;        /* set associativity */
  100. };
  101.  
  102. struct pdc_cache_result
  103. {
  104.   struct cache_info I_info;
  105.   struct cache_info D_info;
  106.   struct tlb_info IT_info;
  107.   struct tlb_info DT_info;
  108. };
  109.  
  110. #ifdef __HPUX__
  111.  
  112. #  define HARDWARE_SIZE sizeof (utsname.machine)
  113.  
  114. #else /* not __HPUX__ */
  115. /* Presumably BSD */
  116.  
  117. #  define HARDWARE_SIZE 9
  118.  
  119. struct pdc_cache_rtn_block
  120. {
  121.   struct pdc_cache_result goodies;
  122.   int filler[2];
  123. };
  124.  
  125. #endif /* __HPUX__ */
  126.  
  127. struct pdc_cache_dump
  128. {
  129.   char hardware[HARDWARE_SIZE];
  130.   struct pdc_cache_rtn_block cache_format;
  131. };
  132.  
  133. #endif /* HPPACACHE_H */
  134.