dcache.c 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728
  1. /* Caching code for GDB, the GNU debugger.
  2. Copyright (C) 1992-2022 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. #include "gdbarch.h"
  22. /* Commands with a prefix of `{set,show} dcache'. */
  23. static struct cmd_list_element *dcache_set_list = NULL;
  24. static struct cmd_list_element *dcache_show_list = NULL;
  25. /* The data cache could lead to incorrect results because it doesn't
  26. know about volatile variables, thus making it impossible to debug
  27. functions which use memory mapped I/O devices. Set the nocache
  28. memory region attribute in those cases.
  29. In general the dcache speeds up performance. Some speed improvement
  30. comes from the actual caching mechanism, but the major gain is in
  31. the reduction of the remote protocol overhead; instead of reading
  32. or writing a large area of memory in 4 byte requests, the cache
  33. bundles up the requests into LINE_SIZE chunks, reducing overhead
  34. significantly. This is most useful when accessing a large amount
  35. of data, such as when performing a backtrace.
  36. The cache is a splay tree along with a linked list for replacement.
  37. Each block caches a LINE_SIZE area of memory. Within each line we
  38. remember the address of the line (which must be a multiple of
  39. LINE_SIZE) and the actual data block.
  40. Lines are only allocated as needed, so DCACHE_SIZE really specifies the
  41. *maximum* number of lines in the cache.
  42. At present, the cache is write-through rather than writeback: as soon
  43. as data is written to the cache, it is also immediately written to
  44. the target. Therefore, cache lines are never "dirty". Whether a given
  45. line is valid or not depends on where it is stored in the dcache_struct;
  46. there is no per-block valid flag. */
  47. /* NOTE: Interaction of dcache and memory region attributes
  48. As there is no requirement that memory region attributes be aligned
  49. to or be a multiple of the dcache page size, dcache_read_line() and
  50. dcache_write_line() must break up the page by memory region. If a
  51. chunk does not have the cache attribute set, an invalid memory type
  52. is set, etc., then the chunk is skipped. Those chunks are handled
  53. in target_xfer_memory() (or target_xfer_memory_partial()).
  54. This doesn't occur very often. The most common occurrence is when
  55. the last bit of the .text segment and the first bit of the .data
  56. segment fall within the same dcache page with a ro/cacheable memory
  57. region defined for the .text segment and a rw/non-cacheable memory
  58. region defined for the .data segment. */
  59. /* The maximum number of lines stored. The total size of the cache is
  60. equal to DCACHE_SIZE times LINE_SIZE. */
  61. #define DCACHE_DEFAULT_SIZE 4096
  62. static unsigned dcache_size = DCACHE_DEFAULT_SIZE;
  63. /* The default size of a cache line. Smaller values reduce the time taken to
  64. read a single byte and make the cache more granular, but increase
  65. overhead and reduce the effectiveness of the cache as a prefetcher. */
  66. #define DCACHE_DEFAULT_LINE_SIZE 64
  67. static unsigned dcache_line_size = DCACHE_DEFAULT_LINE_SIZE;
  68. /* Each cache block holds LINE_SIZE bytes of data
  69. starting at a multiple-of-LINE_SIZE address. */
  70. #define LINE_SIZE_MASK(dcache) ((dcache->line_size - 1))
  71. #define XFORM(dcache, x) ((x) & LINE_SIZE_MASK (dcache))
  72. #define MASK(dcache, x) ((x) & ~LINE_SIZE_MASK (dcache))
  73. struct dcache_block
  74. {
  75. /* For least-recently-allocated and free lists. */
  76. struct dcache_block *prev;
  77. struct dcache_block *next;
  78. CORE_ADDR addr; /* address of data */
  79. int refs; /* # hits */
  80. gdb_byte data[1]; /* line_size bytes at given address */
  81. };
  82. struct dcache_struct
  83. {
  84. splay_tree tree;
  85. struct dcache_block *oldest; /* least-recently-allocated list. */
  86. /* The free list is maintained identically to OLDEST to simplify
  87. the code: we only need one set of accessors. */
  88. struct dcache_block *freelist;
  89. /* The number of in-use lines in the cache. */
  90. int size;
  91. CORE_ADDR line_size; /* current line_size. */
  92. /* The ptid of last inferior to use cache or null_ptid. */
  93. ptid_t ptid;
  94. /* The process target of last inferior to use the cache or
  95. nullptr. */
  96. process_stratum_target *proc_target;
  97. };
  98. typedef void (block_func) (struct dcache_block *block, void *param);
  99. static struct dcache_block *dcache_hit (DCACHE *dcache, CORE_ADDR addr);
  100. static int dcache_read_line (DCACHE *dcache, struct dcache_block *db);
  101. static struct dcache_block *dcache_alloc (DCACHE *dcache, CORE_ADDR addr);
  102. static bool dcache_enabled_p = false; /* OBSOLETE */
  103. static void
  104. show_dcache_enabled_p (struct ui_file *file, int from_tty,
  105. struct cmd_list_element *c, const char *value)
  106. {
  107. gdb_printf (file, _("Deprecated remotecache flag is %s.\n"), value);
  108. }
  109. /* Add BLOCK to circular block list BLIST, behind the block at *BLIST.
  110. *BLIST is not updated (unless it was previously NULL of course).
  111. This is for the least-recently-allocated list's sake:
  112. BLIST points to the oldest block.
  113. ??? This makes for poor cache usage of the free list,
  114. but is it measurable? */
  115. static void
  116. append_block (struct dcache_block **blist, struct dcache_block *block)
  117. {
  118. if (*blist)
  119. {
  120. block->next = *blist;
  121. block->prev = (*blist)->prev;
  122. block->prev->next = block;
  123. (*blist)->prev = block;
  124. /* We don't update *BLIST here to maintain the invariant that for the
  125. least-recently-allocated list *BLIST points to the oldest block. */
  126. }
  127. else
  128. {
  129. block->next = block;
  130. block->prev = block;
  131. *blist = block;
  132. }
  133. }
  134. /* Remove BLOCK from circular block list BLIST. */
  135. static void
  136. remove_block (struct dcache_block **blist, struct dcache_block *block)
  137. {
  138. if (block->next == block)
  139. {
  140. *blist = NULL;
  141. }
  142. else
  143. {
  144. block->next->prev = block->prev;
  145. block->prev->next = block->next;
  146. /* If we removed the block *BLIST points to, shift it to the next block
  147. to maintain the invariant that for the least-recently-allocated list
  148. *BLIST points to the oldest block. */
  149. if (*blist == block)
  150. *blist = block->next;
  151. }
  152. }
  153. /* Iterate over all elements in BLIST, calling FUNC.
  154. PARAM is passed to FUNC.
  155. FUNC may remove the block it's passed, but only that block. */
  156. static void
  157. for_each_block (struct dcache_block **blist, block_func *func, void *param)
  158. {
  159. struct dcache_block *db;
  160. if (*blist == NULL)
  161. return;
  162. db = *blist;
  163. do
  164. {
  165. struct dcache_block *next = db->next;
  166. func (db, param);
  167. db = next;
  168. }
  169. while (*blist && db != *blist);
  170. }
  171. /* BLOCK_FUNC routine for dcache_free. */
  172. static void
  173. free_block (struct dcache_block *block, void *param)
  174. {
  175. xfree (block);
  176. }
  177. /* Free a data cache. */
  178. void
  179. dcache_free (DCACHE *dcache)
  180. {
  181. splay_tree_delete (dcache->tree);
  182. for_each_block (&dcache->oldest, free_block, NULL);
  183. for_each_block (&dcache->freelist, free_block, NULL);
  184. xfree (dcache);
  185. }
  186. /* BLOCK_FUNC function for dcache_invalidate.
  187. This doesn't remove the block from the oldest list on purpose.
  188. dcache_invalidate will do it later. */
  189. static void
  190. invalidate_block (struct dcache_block *block, void *param)
  191. {
  192. DCACHE *dcache = (DCACHE *) param;
  193. splay_tree_remove (dcache->tree, (splay_tree_key) block->addr);
  194. append_block (&dcache->freelist, block);
  195. }
  196. /* Free all the data cache blocks, thus discarding all cached data. */
  197. void
  198. dcache_invalidate (DCACHE *dcache)
  199. {
  200. for_each_block (&dcache->oldest, invalidate_block, dcache);
  201. dcache->oldest = NULL;
  202. dcache->size = 0;
  203. dcache->ptid = null_ptid;
  204. dcache->proc_target = nullptr;
  205. if (dcache->line_size != dcache_line_size)
  206. {
  207. /* We've been asked to use a different line size.
  208. All of our freelist blocks are now the wrong size, so free them. */
  209. for_each_block (&dcache->freelist, free_block, dcache);
  210. dcache->freelist = NULL;
  211. dcache->line_size = dcache_line_size;
  212. }
  213. }
  214. /* Invalidate the line associated with ADDR. */
  215. static void
  216. dcache_invalidate_line (DCACHE *dcache, CORE_ADDR addr)
  217. {
  218. struct dcache_block *db = dcache_hit (dcache, addr);
  219. if (db)
  220. {
  221. splay_tree_remove (dcache->tree, (splay_tree_key) db->addr);
  222. remove_block (&dcache->oldest, db);
  223. append_block (&dcache->freelist, db);
  224. --dcache->size;
  225. }
  226. }
  227. /* If addr is present in the dcache, return the address of the block
  228. containing it. Otherwise return NULL. */
  229. static struct dcache_block *
  230. dcache_hit (DCACHE *dcache, CORE_ADDR addr)
  231. {
  232. struct dcache_block *db;
  233. splay_tree_node node = splay_tree_lookup (dcache->tree,
  234. (splay_tree_key) MASK (dcache, addr));
  235. if (!node)
  236. return NULL;
  237. db = (struct dcache_block *) node->value;
  238. db->refs++;
  239. return db;
  240. }
  241. /* Fill a cache line from target memory.
  242. The result is 1 for success, 0 if the (entire) cache line
  243. wasn't readable. */
  244. static int
  245. dcache_read_line (DCACHE *dcache, struct dcache_block *db)
  246. {
  247. CORE_ADDR memaddr;
  248. gdb_byte *myaddr;
  249. int len;
  250. int res;
  251. int reg_len;
  252. struct mem_region *region;
  253. len = dcache->line_size;
  254. memaddr = db->addr;
  255. myaddr = db->data;
  256. while (len > 0)
  257. {
  258. /* Don't overrun if this block is right at the end of the region. */
  259. region = lookup_mem_region (memaddr);
  260. if (region->hi == 0 || memaddr + len < region->hi)
  261. reg_len = len;
  262. else
  263. reg_len = region->hi - memaddr;
  264. /* Skip non-readable regions. The cache attribute can be ignored,
  265. since we may be loading this for a stack access. */
  266. if (region->attrib.mode == MEM_WO)
  267. {
  268. memaddr += reg_len;
  269. myaddr += reg_len;
  270. len -= reg_len;
  271. continue;
  272. }
  273. res = target_read_raw_memory (memaddr, myaddr, reg_len);
  274. if (res != 0)
  275. return 0;
  276. memaddr += reg_len;
  277. myaddr += reg_len;
  278. len -= reg_len;
  279. }
  280. return 1;
  281. }
  282. /* Get a free cache block, put or keep it on the valid list,
  283. and return its address. */
  284. static struct dcache_block *
  285. dcache_alloc (DCACHE *dcache, CORE_ADDR addr)
  286. {
  287. struct dcache_block *db;
  288. if (dcache->size >= dcache_size)
  289. {
  290. /* Evict the least recently allocated line. */
  291. db = dcache->oldest;
  292. remove_block (&dcache->oldest, db);
  293. splay_tree_remove (dcache->tree, (splay_tree_key) db->addr);
  294. }
  295. else
  296. {
  297. db = dcache->freelist;
  298. if (db)
  299. remove_block (&dcache->freelist, db);
  300. else
  301. db = ((struct dcache_block *)
  302. xmalloc (offsetof (struct dcache_block, data)
  303. + dcache->line_size));
  304. dcache->size++;
  305. }
  306. db->addr = MASK (dcache, addr);
  307. db->refs = 0;
  308. /* Put DB at the end of the list, it's the newest. */
  309. append_block (&dcache->oldest, db);
  310. splay_tree_insert (dcache->tree, (splay_tree_key) db->addr,
  311. (splay_tree_value) db);
  312. return db;
  313. }
  314. /* Using the data cache DCACHE, store in *PTR the contents of the byte at
  315. address ADDR in the remote machine.
  316. Returns 1 for success, 0 for error. */
  317. static int
  318. dcache_peek_byte (DCACHE *dcache, CORE_ADDR addr, gdb_byte *ptr)
  319. {
  320. struct dcache_block *db = dcache_hit (dcache, addr);
  321. if (!db)
  322. {
  323. db = dcache_alloc (dcache, addr);
  324. if (!dcache_read_line (dcache, db))
  325. return 0;
  326. }
  327. *ptr = db->data[XFORM (dcache, addr)];
  328. return 1;
  329. }
  330. /* Write the byte at PTR into ADDR in the data cache.
  331. The caller should have written the data through to target memory
  332. already.
  333. If ADDR is not in cache, this function does nothing; writing to an
  334. area of memory which wasn't present in the cache doesn't cause it
  335. to be loaded in. */
  336. static void
  337. dcache_poke_byte (DCACHE *dcache, CORE_ADDR addr, const gdb_byte *ptr)
  338. {
  339. struct dcache_block *db = dcache_hit (dcache, addr);
  340. if (db)
  341. db->data[XFORM (dcache, addr)] = *ptr;
  342. }
  343. static int
  344. dcache_splay_tree_compare (splay_tree_key a, splay_tree_key b)
  345. {
  346. if (a > b)
  347. return 1;
  348. else if (a == b)
  349. return 0;
  350. else
  351. return -1;
  352. }
  353. /* Allocate and initialize a data cache. */
  354. DCACHE *
  355. dcache_init (void)
  356. {
  357. DCACHE *dcache = XNEW (DCACHE);
  358. dcache->tree = splay_tree_new (dcache_splay_tree_compare,
  359. NULL,
  360. NULL);
  361. dcache->oldest = NULL;
  362. dcache->freelist = NULL;
  363. dcache->size = 0;
  364. dcache->line_size = dcache_line_size;
  365. dcache->ptid = null_ptid;
  366. dcache->proc_target = nullptr;
  367. return dcache;
  368. }
  369. /* Read LEN bytes from dcache memory at MEMADDR, transferring to
  370. debugger address MYADDR. If the data is presently cached, this
  371. fills the cache. Arguments/return are like the target_xfer_partial
  372. interface. */
  373. enum target_xfer_status
  374. dcache_read_memory_partial (struct target_ops *ops, DCACHE *dcache,
  375. CORE_ADDR memaddr, gdb_byte *myaddr,
  376. ULONGEST len, ULONGEST *xfered_len)
  377. {
  378. ULONGEST i;
  379. /* If this is a different thread from what we've recorded, flush the
  380. cache. */
  381. process_stratum_target *proc_target = current_inferior ()->process_target ();
  382. if (proc_target != dcache->proc_target || inferior_ptid != dcache->ptid)
  383. {
  384. dcache_invalidate (dcache);
  385. dcache->ptid = inferior_ptid;
  386. dcache->proc_target = proc_target;
  387. }
  388. for (i = 0; i < len; i++)
  389. {
  390. if (!dcache_peek_byte (dcache, memaddr + i, myaddr + i))
  391. {
  392. /* That failed. Discard its cache line so we don't have a
  393. partially read line. */
  394. dcache_invalidate_line (dcache, memaddr + i);
  395. break;
  396. }
  397. }
  398. if (i == 0)
  399. {
  400. /* Even though reading the whole line failed, we may be able to
  401. read a piece starting where the caller wanted. */
  402. return raw_memory_xfer_partial (ops, myaddr, NULL, memaddr, len,
  403. xfered_len);
  404. }
  405. else
  406. {
  407. *xfered_len = i;
  408. return TARGET_XFER_OK;
  409. }
  410. }
  411. /* FIXME: There would be some benefit to making the cache write-back and
  412. moving the writeback operation to a higher layer, as it could occur
  413. after a sequence of smaller writes have been completed (as when a stack
  414. frame is constructed for an inferior function call). Note that only
  415. moving it up one level to target_xfer_memory[_partial]() is not
  416. sufficient since we want to coalesce memory transfers that are
  417. "logically" connected but not actually a single call to one of the
  418. memory transfer functions. */
  419. /* Just update any cache lines which are already present. This is
  420. called by the target_xfer_partial machinery when writing raw
  421. memory. */
  422. void
  423. dcache_update (DCACHE *dcache, enum target_xfer_status status,
  424. CORE_ADDR memaddr, const gdb_byte *myaddr,
  425. ULONGEST len)
  426. {
  427. ULONGEST i;
  428. for (i = 0; i < len; i++)
  429. if (status == TARGET_XFER_OK)
  430. dcache_poke_byte (dcache, memaddr + i, myaddr + i);
  431. else
  432. {
  433. /* Discard the whole cache line so we don't have a partially
  434. valid line. */
  435. dcache_invalidate_line (dcache, memaddr + i);
  436. }
  437. }
  438. /* Print DCACHE line INDEX. */
  439. static void
  440. dcache_print_line (DCACHE *dcache, int index)
  441. {
  442. splay_tree_node n;
  443. struct dcache_block *db;
  444. int i, j;
  445. if (dcache == NULL)
  446. {
  447. gdb_printf (_("No data cache available.\n"));
  448. return;
  449. }
  450. n = splay_tree_min (dcache->tree);
  451. for (i = index; i > 0; --i)
  452. {
  453. if (!n)
  454. break;
  455. n = splay_tree_successor (dcache->tree, n->key);
  456. }
  457. if (!n)
  458. {
  459. gdb_printf (_("No such cache line exists.\n"));
  460. return;
  461. }
  462. db = (struct dcache_block *) n->value;
  463. gdb_printf (_("Line %d: address %s [%d hits]\n"),
  464. index, paddress (target_gdbarch (), db->addr), db->refs);
  465. for (j = 0; j < dcache->line_size; j++)
  466. {
  467. gdb_printf ("%02x ", db->data[j]);
  468. /* Print a newline every 16 bytes (48 characters). */
  469. if ((j % 16 == 15) && (j != dcache->line_size - 1))
  470. gdb_printf ("\n");
  471. }
  472. gdb_printf ("\n");
  473. }
  474. /* Parse EXP and show the info about DCACHE. */
  475. static void
  476. dcache_info_1 (DCACHE *dcache, const char *exp)
  477. {
  478. splay_tree_node n;
  479. int i, refcount;
  480. if (exp)
  481. {
  482. char *linestart;
  483. i = strtol (exp, &linestart, 10);
  484. if (linestart == exp || i < 0)
  485. {
  486. gdb_printf (_("Usage: info dcache [LINENUMBER]\n"));
  487. return;
  488. }
  489. dcache_print_line (dcache, i);
  490. return;
  491. }
  492. gdb_printf (_("Dcache %u lines of %u bytes each.\n"),
  493. dcache_size,
  494. dcache ? (unsigned) dcache->line_size
  495. : dcache_line_size);
  496. if (dcache == NULL || dcache->ptid == null_ptid)
  497. {
  498. gdb_printf (_("No data cache available.\n"));
  499. return;
  500. }
  501. gdb_printf (_("Contains data for %s\n"),
  502. target_pid_to_str (dcache->ptid).c_str ());
  503. refcount = 0;
  504. n = splay_tree_min (dcache->tree);
  505. i = 0;
  506. while (n)
  507. {
  508. struct dcache_block *db = (struct dcache_block *) n->value;
  509. gdb_printf (_("Line %d: address %s [%d hits]\n"),
  510. i, paddress (target_gdbarch (), db->addr), db->refs);
  511. i++;
  512. refcount += db->refs;
  513. n = splay_tree_successor (dcache->tree, n->key);
  514. }
  515. gdb_printf (_("Cache state: %d active lines, %d hits\n"), i, refcount);
  516. }
  517. static void
  518. info_dcache_command (const char *exp, int tty)
  519. {
  520. dcache_info_1 (target_dcache_get (), exp);
  521. }
  522. static void
  523. set_dcache_size (const char *args, int from_tty,
  524. struct cmd_list_element *c)
  525. {
  526. if (dcache_size == 0)
  527. {
  528. dcache_size = DCACHE_DEFAULT_SIZE;
  529. error (_("Dcache size must be greater than 0."));
  530. }
  531. target_dcache_invalidate ();
  532. }
  533. static void
  534. set_dcache_line_size (const char *args, int from_tty,
  535. struct cmd_list_element *c)
  536. {
  537. if (dcache_line_size < 2
  538. || (dcache_line_size & (dcache_line_size - 1)) != 0)
  539. {
  540. unsigned d = dcache_line_size;
  541. dcache_line_size = DCACHE_DEFAULT_LINE_SIZE;
  542. error (_("Invalid dcache line size: %u (must be power of 2)."), d);
  543. }
  544. target_dcache_invalidate ();
  545. }
  546. void _initialize_dcache ();
  547. void
  548. _initialize_dcache ()
  549. {
  550. add_setshow_boolean_cmd ("remotecache", class_support,
  551. &dcache_enabled_p, _("\
  552. Set cache use for remote targets."), _("\
  553. Show cache use for remote targets."), _("\
  554. This used to enable the data cache for remote targets. The cache\n\
  555. functionality is now controlled by the memory region system and the\n\
  556. \"stack-cache\" flag; \"remotecache\" now does nothing and\n\
  557. exists only for compatibility reasons."),
  558. NULL,
  559. show_dcache_enabled_p,
  560. &setlist, &showlist);
  561. add_info ("dcache", info_dcache_command,
  562. _("\
  563. Print information on the dcache performance.\n\
  564. Usage: info dcache [LINENUMBER]\n\
  565. With no arguments, this command prints the cache configuration and a\n\
  566. summary of each line in the cache. With an argument, dump\"\n\
  567. the contents of the given line."));
  568. add_setshow_prefix_cmd ("dcache", class_obscure,
  569. _("\
  570. Use this command to set number of lines in dcache and line-size."),
  571. ("Show dcache settings."),
  572. &dcache_set_list, &dcache_show_list,
  573. &setlist, &showlist);
  574. add_setshow_zuinteger_cmd ("line-size", class_obscure,
  575. &dcache_line_size, _("\
  576. Set dcache line size in bytes (must be power of 2)."), _("\
  577. Show dcache line size."),
  578. NULL,
  579. set_dcache_line_size,
  580. NULL,
  581. &dcache_set_list, &dcache_show_list);
  582. add_setshow_zuinteger_cmd ("size", class_obscure,
  583. &dcache_size, _("\
  584. Set number of dcache lines."), _("\
  585. Show number of dcache lines."),
  586. NULL,
  587. set_dcache_size,
  588. NULL,
  589. &dcache_set_list, &dcache_show_list);
  590. }