revision 366:6fb0d05152d7
summary |
tree |
shortlog |
changelog |
graph |
changeset |
raw | bz2 | zip | gz changeset | 366:6fb0d05152d7 |
parent | 365:94cab5ad0ed8 |
child | 367:9c52dcbad3fb |
author | nkeynes |
date | Tue Sep 04 08:32:44 2007 +0000 (16 years ago) |
Add method to retrieve the size of a block, given the code pointer (useful
for eg disassembling the block)
for eg disassembling the block)
1.1 --- a/src/sh4/xltcache.c Tue Sep 04 08:32:10 2007 +00001.2 +++ b/src/sh4/xltcache.c Tue Sep 04 08:32:44 2007 +00001.3 @@ -1,5 +1,5 @@1.4 /**1.5 - * $Id: xltcache.c,v 1.1 2007-08-23 12:33:27 nkeynes Exp $1.6 + * $Id: xltcache.c,v 1.2 2007-09-04 08:32:44 nkeynes Exp $1.7 *1.8 * Translation cache management. This part is architecture independent.1.9 *1.10 @@ -128,6 +128,12 @@1.11 return page[XLAT_LUT_ENTRY(address)];1.12 }1.14 +uint32_t xlat_get_block_size( void *block )1.15 +{1.16 + xlat_cache_block_t xlt = (xlat_cache_block_t)(((char *)block)-sizeof(struct xlat_cache_block));1.17 + return xlt->size;1.18 +}1.19 +1.20 /**1.21 * Cut the specified block so that it has the given size, with the remaining data1.22 * forming a new free block. If the free block would be less than the minimum size,
2.1 --- a/src/sh4/xltcache.h Tue Sep 04 08:32:10 2007 +00002.2 +++ b/src/sh4/xltcache.h Tue Sep 04 08:32:44 2007 +00002.3 @@ -1,5 +1,5 @@2.4 /**2.5 - * $Id: xltcache.h,v 1.1 2007-08-23 12:33:27 nkeynes Exp $2.6 + * $Id: xltcache.h,v 1.2 2007-09-04 08:32:44 nkeynes Exp $2.7 *2.8 * Translation cache support (architecture independent)2.9 *2.10 @@ -60,6 +60,12 @@2.11 void *xlat_get_code( sh4addr_t address );2.13 /**2.14 + * Retrieve the size of the code block starting at the specified pointer. If the2.15 + * pointer is not a valid code block, the return value is undefined.2.16 + */2.17 +uint32_t xlat_get_block_size( void *ptr );2.18 +2.19 +/**2.20 * Flush the code cache for the page containing the given address2.21 */2.22 void xlat_flush_page( sh4addr_t address );
.