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 / hppanwca.c < prev    next >
C/C++ Source or Header  |  2000-12-05  |  4KB  |  128 lines

  1. /* -*-C-*-
  2.  
  3. $Id: hppanwca.c,v 1.5 2000/12/05 21:23:44 cph Exp $
  4.  
  5. Copyright (c) 1992-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. /* Program to convert ascii-format cache descriptions into the binary
  23.    form used by Scheme.
  24.  
  25.    To use, replace the structure labeled "written_data" below with the
  26.    new one (if not present in the data base), then recompile this program:
  27.      cc -Ae -O -o hppanewcache hppanewcache.c
  28.    and then type
  29.      ./hppanewcache >>HPPAmodels
  30.  */
  31.  
  32. #include <stdio.h>
  33. #define __HPUX__
  34. #include "hppacach.h"
  35.  
  36. struct pdc_cache_written
  37. {
  38.   char hardware[sizeof (utsname.machine)];
  39.   struct pdc_cache_result cache_format;
  40. };
  41.  
  42. static struct pdc_cache_written written_data =
  43. {
  44.   /* Cache description for amertume, an HP PA 9000/750 processor. */
  45.  
  46.   "9000/750",
  47.  
  48.   {
  49.     /*
  50.       I-cache information:
  51.     size        262144 bytes (256 K).
  52.     conf        0x01402000
  53.     base        0x0
  54.     stride        32 bytes.
  55.     count        8192 entries.
  56.     loop        1 association per entry.
  57.     block size    1 line.
  58.     line size    2 (16-byte units).
  59.       It is a read-only cache.
  60.       It issues coherent operations.
  61.       Both FDC and FIC must be used to flush.
  62.     */
  63.     { 262144, 0x01402000, 0x0, 32, 8192, 1 },
  64.     /*
  65.       D-cache information:
  66.     size        262144 bytes (256 K).
  67.     conf        0x01402000
  68.     base        0x0
  69.     stride        32 bytes.
  70.     count        8192 entries.
  71.     loop        1 association per entry.
  72.     block size    1 line.
  73.     line size    2 (16-byte units).
  74.       It is a write-to cache.
  75.       It issues coherent operations.
  76.       Both FDC and FIC must be used to flush.
  77.     */
  78.     { 262144, 0x01402000, 0x0, 32, 8192, 1 },
  79.     /*
  80.       I-TLB information:
  81.     size        96 entries (0 K).
  82.     conf        0x00012000
  83.     sp_base        0x0
  84.     sp_stride    0
  85.     sp_count    1
  86.     off_base    0x0
  87.     off_stride    0
  88.     off_count    1
  89.     loop        1 association per entry.
  90.       It issues coherent operations.
  91.       Both PDTLB and PITLB must be used to purge.
  92.     */
  93.     { 96, 0x00012000, 0x0, 0, 1, 0x0, 0, 1, 1 },
  94.     /*
  95.       D-TLB information:
  96.     size        96 entries (0 K).
  97.     conf        0x00002000
  98.     sp_base        0x0
  99.     sp_stride    0
  100.     sp_count    1
  101.     off_base    0x0
  102.     off_stride    0
  103.     off_count    1
  104.     loop        1 association per entry.
  105.       It issues coherent operations.
  106.       Both PDTLB and PITLB must be used to purge.
  107.     */
  108.     { 96, 0x00002000, 0x0, 0, 1, 0x0, 0, 1, 1 }
  109.   }};
  110.  
  111. #define INTMIN(x,y) (((y) > (x)) ? (y) : (x))
  112.  
  113. main ()
  114. {
  115.   struct pdc_cache_dump data_to_dump;
  116.  
  117.   memcpy (&data_to_dump.hardware, &written_data.hardware,
  118.       (INTMIN ((sizeof (data_to_dump.hardware)),
  119.            (sizeof (written_data.hardware)))));
  120.   memcpy (&data_to_dump.cache_format, &written_data.cache_format,
  121.       (INTMIN ((sizeof (data_to_dump.cache_format)),
  122.            (sizeof (written_data.cache_format)))));
  123.   fprintf (stderr, "Writing %d bytes...\n", (sizeof (data_to_dump)));
  124.   fflush (stderr);
  125.   write ((fileno (stdout)), &data_to_dump, (sizeof (data_to_dump)));
  126.   exit (0);
  127. }
  128.