gdb/dcache.c - gdb

Global variables defined

Data types defined

Functions defined

Macros defined

Source code

  1. /* Caching code for GDB, the GNU debugger.

  2.    Copyright (C) 1992-2015 Free Software Foundation, Inc.

  3.    This file is part of GDB.

  4.    This program is free software; you can redistribute it and/or modify
  5.    it under the terms of the GNU General Public License as published by
  6.    the Free Software Foundation; either version 3 of the License, or
  7.    (at your option) any later version.

  8.    This program is distributed in the hope that it will be useful,
  9.    but WITHOUT ANY WARRANTY; without even the implied warranty of
  10.    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  11.    GNU General Public License for more details.

  12.    You should have received a copy of the GNU General Public License
  13.    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */

  14. #include "defs.h"
  15. #include "dcache.h"
  16. #include "gdbcmd.h"
  17. #include "gdbcore.h"
  18. #include "target-dcache.h"
  19. #include "inferior.h"
  20. #include "splay-tree.h"

  21. /* Commands with a prefix of `{set,show} dcache'.  */
  22. static struct cmd_list_element *dcache_set_list = NULL;
  23. static struct cmd_list_element *dcache_show_list = NULL;

  24. /* The data cache could lead to incorrect results because it doesn't
  25.    know about volatile variables, thus making it impossible to debug
  26.    functions which use memory mapped I/O devices.  Set the nocache
  27.    memory region attribute in those cases.

  28.    In general the dcache speeds up performance.  Some speed improvement
  29.    comes from the actual caching mechanism, but the major gain is in
  30.    the reduction of the remote protocol overhead; instead of reading
  31.    or writing a large area of memory in 4 byte requests, the cache
  32.    bundles up the requests into LINE_SIZE chunks, reducing overhead
  33.    significantly.  This is most useful when accessing a large amount
  34.    of data, such as when performing a backtrace.

  35.    The cache is a splay tree along with a linked list for replacement.
  36.    Each block caches a LINE_SIZE area of memory.  Within each line we
  37.    remember the address of the line (which must be a multiple of
  38.    LINE_SIZE) and the actual data block.

  39.    Lines are only allocated as needed, so DCACHE_SIZE really specifies the
  40.    *maximum* number of lines in the cache.

  41.    At present, the cache is write-through rather than writeback: as soon
  42.    as data is written to the cache, it is also immediately written to
  43.    the target.  Therefore, cache lines are never "dirty".  Whether a given
  44.    line is valid or not depends on where it is stored in the dcache_struct;
  45.    there is no per-block valid flag.  */

  46. /* NOTE: Interaction of dcache and memory region attributes

  47.    As there is no requirement that memory region attributes be aligned
  48.    to or be a multiple of the dcache page size, dcache_read_line() and
  49.    dcache_write_line() must break up the page by memory region.  If a
  50.    chunk does not have the cache attribute set, an invalid memory type
  51.    is set, etc., then the chunk is skipped.  Those chunks are handled
  52.    in target_xfer_memory() (or target_xfer_memory_partial()).

  53.    This doesn't occur very often.  The most common occurance is when
  54.    the last bit of the .text segment and the first bit of the .data
  55.    segment fall within the same dcache page with a ro/cacheable memory
  56.    region defined for the .text segment and a rw/non-cacheable memory
  57.    region defined for the .data segment.  */

  58. /* The maximum number of lines stored.  The total size of the cache is
  59.    equal to DCACHE_SIZE times LINE_SIZE.  */
  60. #define DCACHE_DEFAULT_SIZE 4096
  61. static unsigned dcache_size = DCACHE_DEFAULT_SIZE;

  62. /* The default size of a cache line.  Smaller values reduce the time taken to
  63.    read a single byte and make the cache more granular, but increase
  64.    overhead and reduce the effectiveness of the cache as a prefetcher.  */
  65. #define DCACHE_DEFAULT_LINE_SIZE 64
  66. static unsigned dcache_line_size = DCACHE_DEFAULT_LINE_SIZE;

  67. /* Each cache block holds LINE_SIZE bytes of data
  68.    starting at a multiple-of-LINE_SIZE address.  */

  69. #define LINE_SIZE_MASK(dcache)  ((dcache->line_size - 1))
  70. #define XFORM(dcache, x)         ((x) & LINE_SIZE_MASK (dcache))
  71. #define MASK(dcache, x)         ((x) & ~LINE_SIZE_MASK (dcache))

  72. struct dcache_block
  73. {
  74.   /* For least-recently-allocated and free lists.  */
  75.   struct dcache_block *prev;
  76.   struct dcache_block *next;

  77.   CORE_ADDR addr;                /* address of data */
  78.   int refs;                        /* # hits */
  79.   gdb_byte data[1];                /* line_size bytes at given address */
  80. };

  81. struct dcache_struct
  82. {
  83.   splay_tree tree;
  84.   struct dcache_block *oldest; /* least-recently-allocated list.  */

  85.   /* The free list is maintained identically to OLDEST to simplify
  86.      the code: we only need one set of accessors.  */
  87.   struct dcache_block *freelist;

  88.   /* The number of in-use lines in the cache.  */
  89.   int size;
  90.   CORE_ADDR line_size;  /* current line_size.  */

  91.   /* The ptid of last inferior to use cache or null_ptid.  */
  92.   ptid_t ptid;
  93. };

  94. typedef void (block_func) (struct dcache_block *block, void *param);

  95. static struct dcache_block *dcache_hit (DCACHE *dcache, CORE_ADDR addr);

  96. static int dcache_read_line (DCACHE *dcache, struct dcache_block *db);

  97. static struct dcache_block *dcache_alloc (DCACHE *dcache, CORE_ADDR addr);

  98. static void dcache_info (char *exp, int tty);

  99. void _initialize_dcache (void);

  100. static int dcache_enabled_p = 0; /* OBSOLETE */

  101. static void
  102. show_dcache_enabled_p (struct ui_file *file, int from_tty,
  103.                        struct cmd_list_element *c, const char *value)
  104. {
  105.   fprintf_filtered (file, _("Deprecated remotecache flag is %s.\n"), value);
  106. }

  107. /* Add BLOCK to circular block list BLIST, behind the block at *BLIST.
  108.    *BLIST is not updated (unless it was previously NULL of course).
  109.    This is for the least-recently-allocated list's sake:
  110.    BLIST points to the oldest block.
  111.    ??? This makes for poor cache usage of the free list,
  112.    but is it measurable?  */

  113. static void
  114. append_block (struct dcache_block **blist, struct dcache_block *block)
  115. {
  116.   if (*blist)
  117.     {
  118.       block->next = *blist;
  119.       block->prev = (*blist)->prev;
  120.       block->prev->next = block;
  121.       (*blist)->prev = block;
  122.       /* We don't update *BLIST here to maintain the invariant that for the
  123.          least-recently-allocated list *BLIST points to the oldest block.  */
  124.     }
  125.   else
  126.     {
  127.       block->next = block;
  128.       block->prev = block;
  129.       *blist = block;
  130.     }
  131. }

  132. /* Remove BLOCK from circular block list BLIST.  */

  133. static void
  134. remove_block (struct dcache_block **blist, struct dcache_block *block)
  135. {
  136.   if (block->next == block)
  137.     {
  138.       *blist = NULL;
  139.     }
  140.   else
  141.     {
  142.       block->next->prev = block->prev;
  143.       block->prev->next = block->next;
  144.       /* If we removed the block *BLIST points to, shift it to the next block
  145.          to maintain the invariant that for the least-recently-allocated list
  146.          *BLIST points to the oldest block.  */
  147.       if (*blist == block)
  148.         *blist = block->next;
  149.     }
  150. }

  151. /* Iterate over all elements in BLIST, calling FUNC.
  152.    PARAM is passed to FUNC.
  153.    FUNC may remove the block it's passed, but only that block.  */

  154. static void
  155. for_each_block (struct dcache_block **blist, block_func *func, void *param)
  156. {
  157.   struct dcache_block *db;

  158.   if (*blist == NULL)
  159.     return;

  160.   db = *blist;
  161.   do
  162.     {
  163.       struct dcache_block *next = db->next;

  164.       func (db, param);
  165.       db = next;
  166.     }
  167.   while (*blist && db != *blist);
  168. }

  169. /* BLOCK_FUNC routine for dcache_free.  */

  170. static void
  171. free_block (struct dcache_block *block, void *param)
  172. {
  173.   xfree (block);
  174. }

  175. /* Free a data cache.  */

  176. void
  177. dcache_free (DCACHE *dcache)
  178. {
  179.   splay_tree_delete (dcache->tree);
  180.   for_each_block (&dcache->oldest, free_block, NULL);
  181.   for_each_block (&dcache->freelist, free_block, NULL);
  182.   xfree (dcache);
  183. }


  184. /* BLOCK_FUNC function for dcache_invalidate.
  185.    This doesn't remove the block from the oldest list on purpose.
  186.    dcache_invalidate will do it later.  */

  187. static void
  188. invalidate_block (struct dcache_block *block, void *param)
  189. {
  190.   DCACHE *dcache = (DCACHE *) param;

  191.   splay_tree_remove (dcache->tree, (splay_tree_key) block->addr);
  192.   append_block (&dcache->freelist, block);
  193. }

  194. /* Free all the data cache blocks, thus discarding all cached data.  */

  195. void
  196. dcache_invalidate (DCACHE *dcache)
  197. {
  198.   for_each_block (&dcache->oldest, invalidate_block, dcache);

  199.   dcache->oldest = NULL;
  200.   dcache->size = 0;
  201.   dcache->ptid = null_ptid;

  202.   if (dcache->line_size != dcache_line_size)
  203.     {
  204.       /* We've been asked to use a different line size.
  205.          All of our freelist blocks are now the wrong size, so free them.  */

  206.       for_each_block (&dcache->freelist, free_block, dcache);
  207.       dcache->freelist = NULL;
  208.       dcache->line_size = dcache_line_size;
  209.     }
  210. }

  211. /* Invalidate the line associated with ADDR.  */

  212. static void
  213. dcache_invalidate_line (DCACHE *dcache, CORE_ADDR addr)
  214. {
  215.   struct dcache_block *db = dcache_hit (dcache, addr);

  216.   if (db)
  217.     {
  218.       splay_tree_remove (dcache->tree, (splay_tree_key) db->addr);
  219.       remove_block (&dcache->oldest, db);
  220.       append_block (&dcache->freelist, db);
  221.       --dcache->size;
  222.     }
  223. }

  224. /* If addr is present in the dcache, return the address of the block
  225.    containing it.  Otherwise return NULL.  */

  226. static struct dcache_block *
  227. dcache_hit (DCACHE *dcache, CORE_ADDR addr)
  228. {
  229.   struct dcache_block *db;

  230.   splay_tree_node node = splay_tree_lookup (dcache->tree,
  231.                                             (splay_tree_key) MASK (dcache, addr));

  232.   if (!node)
  233.     return NULL;

  234.   db = (struct dcache_block *) node->value;
  235.   db->refs++;
  236.   return db;
  237. }

  238. /* Fill a cache line from target memory.
  239.    The result is 1 for success, 0 if the (entire) cache line
  240.    wasn't readable.  */

  241. static int
  242. dcache_read_line (DCACHE *dcache, struct dcache_block *db)
  243. {
  244.   CORE_ADDR memaddr;
  245.   gdb_byte *myaddr;
  246.   int len;
  247.   int res;
  248.   int reg_len;
  249.   struct mem_region *region;

  250.   len = dcache->line_size;
  251.   memaddr = db->addr;
  252.   myaddr  = db->data;

  253.   while (len > 0)
  254.     {
  255.       /* Don't overrun if this block is right at the end of the region.  */
  256.       region = lookup_mem_region (memaddr);
  257.       if (region->hi == 0 || memaddr + len < region->hi)
  258.         reg_len = len;
  259.       else
  260.         reg_len = region->hi - memaddr;

  261.       /* Skip non-readable regions.  The cache attribute can be ignored,
  262.          since we may be loading this for a stack access.  */
  263.       if (region->attrib.mode == MEM_WO)
  264.         {
  265.           memaddr += reg_len;
  266.           myaddr  += reg_len;
  267.           len     -= reg_len;
  268.           continue;
  269.         }

  270.       res = target_read_raw_memory (memaddr, myaddr, reg_len);
  271.       if (res != 0)
  272.         return 0;

  273.       memaddr += reg_len;
  274.       myaddr += reg_len;
  275.       len -= reg_len;
  276.     }

  277.   return 1;
  278. }

  279. /* Get a free cache block, put or keep it on the valid list,
  280.    and return its address.  */

  281. static struct dcache_block *
  282. dcache_alloc (DCACHE *dcache, CORE_ADDR addr)
  283. {
  284.   struct dcache_block *db;

  285.   if (dcache->size >= dcache_size)
  286.     {
  287.       /* Evict the least recently allocated line.  */
  288.       db = dcache->oldest;
  289.       remove_block (&dcache->oldest, db);

  290.       splay_tree_remove (dcache->tree, (splay_tree_key) db->addr);
  291.     }
  292.   else
  293.     {
  294.       db = dcache->freelist;
  295.       if (db)
  296.         remove_block (&dcache->freelist, db);
  297.       else
  298.         db = xmalloc (offsetof (struct dcache_block, data) +
  299.                       dcache->line_size);

  300.       dcache->size++;
  301.     }

  302.   db->addr = MASK (dcache, addr);
  303.   db->refs = 0;

  304.   /* Put DB at the end of the list, it's the newest.  */
  305.   append_block (&dcache->oldest, db);

  306.   splay_tree_insert (dcache->tree, (splay_tree_key) db->addr,
  307.                      (splay_tree_value) db);

  308.   return db;
  309. }

  310. /* Using the data cache DCACHE, store in *PTR the contents of the byte at
  311.    address ADDR in the remote machine.

  312.    Returns 1 for success, 0 for error.  */

  313. static int
  314. dcache_peek_byte (DCACHE *dcache, CORE_ADDR addr, gdb_byte *ptr)
  315. {
  316.   struct dcache_block *db = dcache_hit (dcache, addr);

  317.   if (!db)
  318.     {
  319.       db = dcache_alloc (dcache, addr);

  320.       if (!dcache_read_line (dcache, db))
  321.          return 0;
  322.     }

  323.   *ptr = db->data[XFORM (dcache, addr)];
  324.   return 1;
  325. }

  326. /* Write the byte at PTR into ADDR in the data cache.

  327.    The caller should have written the data through to target memory
  328.    already.

  329.    If ADDR is not in cache, this function does nothing; writing to an
  330.    area of memory which wasn't present in the cache doesn't cause it
  331.    to be loaded in.  */

  332. static void
  333. dcache_poke_byte (DCACHE *dcache, CORE_ADDR addr, const gdb_byte *ptr)
  334. {
  335.   struct dcache_block *db = dcache_hit (dcache, addr);

  336.   if (db)
  337.     db->data[XFORM (dcache, addr)] = *ptr;
  338. }

  339. static int
  340. dcache_splay_tree_compare (splay_tree_key a, splay_tree_key b)
  341. {
  342.   if (a > b)
  343.     return 1;
  344.   else if (a == b)
  345.     return 0;
  346.   else
  347.     return -1;
  348. }

  349. /* Allocate and initialize a data cache.  */

  350. DCACHE *
  351. dcache_init (void)
  352. {
  353.   DCACHE *dcache;

  354.   dcache = (DCACHE *) xmalloc (sizeof (*dcache));

  355.   dcache->tree = splay_tree_new (dcache_splay_tree_compare,
  356.                                  NULL,
  357.                                  NULL);

  358.   dcache->oldest = NULL;
  359.   dcache->freelist = NULL;
  360.   dcache->size = 0;
  361.   dcache->line_size = dcache_line_size;
  362.   dcache->ptid = null_ptid;

  363.   return dcache;
  364. }


  365. /* Read LEN bytes from dcache memory at MEMADDR, transferring to
  366.    debugger address MYADDR.  If the data is presently cached, this
  367.    fills the cache.  Arguments/return are like the target_xfer_partial
  368.    interface.  */

  369. enum target_xfer_status
  370. dcache_read_memory_partial (struct target_ops *ops, DCACHE *dcache,
  371.                             CORE_ADDR memaddr, gdb_byte *myaddr,
  372.                             ULONGEST len, ULONGEST *xfered_len)
  373. {
  374.   ULONGEST i;

  375.   /* If this is a different inferior from what we've recorded,
  376.      flush the cache.  */

  377.   if (! ptid_equal (inferior_ptid, dcache->ptid))
  378.     {
  379.       dcache_invalidate (dcache);
  380.       dcache->ptid = inferior_ptid;
  381.     }

  382.   for (i = 0; i < len; i++)
  383.     {
  384.       if (!dcache_peek_byte (dcache, memaddr + i, myaddr + i))
  385.         {
  386.           /* That failed.  Discard its cache line so we don't have a
  387.              partially read line.  */
  388.           dcache_invalidate_line (dcache, memaddr + i);
  389.           break;
  390.         }
  391.     }

  392.   if (i == 0)
  393.     {
  394.       /* Even though reading the whole line failed, we may be able to
  395.          read a piece starting where the caller wanted.  */
  396.       return ops->to_xfer_partial (ops, TARGET_OBJECT_MEMORY, NULL,
  397.                                    myaddr, NULL, memaddr, len,
  398.                                    xfered_len);
  399.     }
  400.   else
  401.     {
  402.       *xfered_len = i;
  403.       return TARGET_XFER_OK;
  404.     }
  405. }

  406. /* FIXME: There would be some benefit to making the cache write-back and
  407.    moving the writeback operation to a higher layer, as it could occur
  408.    after a sequence of smaller writes have been completed (as when a stack
  409.    frame is constructed for an inferior function call).  Note that only
  410.    moving it up one level to target_xfer_memory[_partial]() is not
  411.    sufficient since we want to coalesce memory transfers that are
  412.    "logically" connected but not actually a single call to one of the
  413.    memory transfer functions.  */

  414. /* Just update any cache lines which are already present.  This is
  415.    called by the target_xfer_partial machinery when writing raw
  416.    memory.  */

  417. void
  418. dcache_update (DCACHE *dcache, enum target_xfer_status status,
  419.                CORE_ADDR memaddr, const gdb_byte *myaddr,
  420.                ULONGEST len)
  421. {
  422.   ULONGEST i;

  423.   for (i = 0; i < len; i++)
  424.     if (status == TARGET_XFER_OK)
  425.       dcache_poke_byte (dcache, memaddr + i, myaddr + i);
  426.     else
  427.       {
  428.         /* Discard the whole cache line so we don't have a partially
  429.            valid line.  */
  430.         dcache_invalidate_line (dcache, memaddr + i);
  431.       }
  432. }

  433. /* Print DCACHE line INDEX.  */

  434. static void
  435. dcache_print_line (DCACHE *dcache, int index)
  436. {
  437.   splay_tree_node n;
  438.   struct dcache_block *db;
  439.   int i, j;

  440.   if (dcache == NULL)
  441.     {
  442.       printf_filtered (_("No data cache available.\n"));
  443.       return;
  444.     }

  445.   n = splay_tree_min (dcache->tree);

  446.   for (i = index; i > 0; --i)
  447.     {
  448.       if (!n)
  449.         break;
  450.       n = splay_tree_successor (dcache->tree, n->key);
  451.     }

  452.   if (!n)
  453.     {
  454.       printf_filtered (_("No such cache line exists.\n"));
  455.       return;
  456.     }

  457.   db = (struct dcache_block *) n->value;

  458.   printf_filtered (_("Line %d: address %s [%d hits]\n"),
  459.                    index, paddress (target_gdbarch (), db->addr), db->refs);

  460.   for (j = 0; j < dcache->line_size; j++)
  461.     {
  462.       printf_filtered ("%02x ", db->data[j]);

  463.       /* Print a newline every 16 bytes (48 characters).  */
  464.       if ((j % 16 == 15) && (j != dcache->line_size - 1))
  465.         printf_filtered ("\n");
  466.     }
  467.   printf_filtered ("\n");
  468. }

  469. /* Parse EXP and show the info about DCACHE.  */

  470. static void
  471. dcache_info_1 (DCACHE *dcache, char *exp)
  472. {
  473.   splay_tree_node n;
  474.   int i, refcount;

  475.   if (exp)
  476.     {
  477.       char *linestart;

  478.       i = strtol (exp, &linestart, 10);
  479.       if (linestart == exp || i < 0)
  480.         {
  481.           printf_filtered (_("Usage: info dcache [linenumber]\n"));
  482.           return;
  483.         }

  484.       dcache_print_line (dcache, i);
  485.       return;
  486.     }

  487.   printf_filtered (_("Dcache %u lines of %u bytes each.\n"),
  488.                    dcache_size,
  489.                    dcache ? (unsigned) dcache->line_size
  490.                    : dcache_line_size);

  491.   if (dcache == NULL || ptid_equal (dcache->ptid, null_ptid))
  492.     {
  493.       printf_filtered (_("No data cache available.\n"));
  494.       return;
  495.     }

  496.   printf_filtered (_("Contains data for %s\n"),
  497.                    target_pid_to_str (dcache->ptid));

  498.   refcount = 0;

  499.   n = splay_tree_min (dcache->tree);
  500.   i = 0;

  501.   while (n)
  502.     {
  503.       struct dcache_block *db = (struct dcache_block *) n->value;

  504.       printf_filtered (_("Line %d: address %s [%d hits]\n"),
  505.                        i, paddress (target_gdbarch (), db->addr), db->refs);
  506.       i++;
  507.       refcount += db->refs;

  508.       n = splay_tree_successor (dcache->tree, n->key);
  509.     }

  510.   printf_filtered (_("Cache state: %d active lines, %d hits\n"), i, refcount);
  511. }

  512. static void
  513. dcache_info (char *exp, int tty)
  514. {
  515.   dcache_info_1 (target_dcache_get (), exp);
  516. }

  517. static void
  518. set_dcache_size (char *args, int from_tty,
  519.                  struct cmd_list_element *c)
  520. {
  521.   if (dcache_size == 0)
  522.     {
  523.       dcache_size = DCACHE_DEFAULT_SIZE;
  524.       error (_("Dcache size must be greater than 0."));
  525.     }
  526.   target_dcache_invalidate ();
  527. }

  528. static void
  529. set_dcache_line_size (char *args, int from_tty,
  530.                       struct cmd_list_element *c)
  531. {
  532.   if (dcache_line_size < 2
  533.       || (dcache_line_size & (dcache_line_size - 1)) != 0)
  534.     {
  535.       unsigned d = dcache_line_size;
  536.       dcache_line_size = DCACHE_DEFAULT_LINE_SIZE;
  537.       error (_("Invalid dcache line size: %u (must be power of 2)."), d);
  538.     }
  539.   target_dcache_invalidate ();
  540. }

  541. static void
  542. set_dcache_command (char *arg, int from_tty)
  543. {
  544.   printf_unfiltered (
  545.      "\"set dcache\" must be followed by the name of a subcommand.\n");
  546.   help_list (dcache_set_list, "set dcache ", all_commands, gdb_stdout);
  547. }

  548. static void
  549. show_dcache_command (char *args, int from_tty)
  550. {
  551.   cmd_show_list (dcache_show_list, from_tty, "");
  552. }

  553. void
  554. _initialize_dcache (void)
  555. {
  556.   add_setshow_boolean_cmd ("remotecache", class_support,
  557.                            &dcache_enabled_p, _("\
  558. Set cache use for remote targets."), _("\
  559. Show cache use for remote targets."), _("\
  560. This used to enable the data cache for remote targets.  The cache\n\
  561. functionality is now controlled by the memory region system and the\n\
  562. \"stack-cache\" flag; \"remotecache\" now does nothing and\n\
  563. exists only for compatibility reasons."),
  564.                            NULL,
  565.                            show_dcache_enabled_p,
  566.                            &setlist, &showlist);

  567.   add_info ("dcache", dcache_info,
  568.             _("\
  569. Print information on the dcache performance.\n\
  570. With no arguments, this command prints the cache configuration and a\n\
  571. summary of each line in the cache.  Use \"info dcache <lineno> to dump\"\n\
  572. the contents of a given line."));

  573.   add_prefix_cmd ("dcache", class_obscure, set_dcache_command, _("\
  574. Use this command to set number of lines in dcache and line-size."),
  575.                   &dcache_set_list, "set dcache ", /*allow_unknown*/0, &setlist);
  576.   add_prefix_cmd ("dcache", class_obscure, show_dcache_command, _("\
  577. Show dcachesettings."),
  578.                   &dcache_show_list, "show dcache ", /*allow_unknown*/0, &showlist);

  579.   add_setshow_zuinteger_cmd ("line-size", class_obscure,
  580.                              &dcache_line_size, _("\
  581. Set dcache line size in bytes (must be power of 2)."), _("\
  582. Show dcache line size."),
  583.                              NULL,
  584.                              set_dcache_line_size,
  585.                              NULL,
  586.                              &dcache_set_list, &dcache_show_list);
  587.   add_setshow_zuinteger_cmd ("size", class_obscure,
  588.                              &dcache_size, _("\
  589. Set number of dcache lines."), _("\
  590. Show number of dcache lines."),
  591.                              NULL,
  592.                              set_dcache_size,
  593.                              NULL,
  594.                              &dcache_set_list, &dcache_show_list);
  595. }