Search
lxdream.org :: lxdream/src/sh4/xltcache.c :: diff
lxdream 0.9.1
released Jun 29
Download Now
filename src/sh4/xltcache.c
changeset 366:6fb0d05152d7
prev359:c588dce7ebde
next376:8c7587af5a5d
author nkeynes
date Tue Sep 04 08:32:44 2007 +0000 (13 years ago)
permissions -rw-r--r--
last change Add method to retrieve the size of a block, given the code pointer (useful
for eg disassembling the block)
file annotate diff log raw
1.1 --- a/src/sh4/xltcache.c Thu Aug 23 12:33:27 2007 +0000
1.2 +++ b/src/sh4/xltcache.c Tue Sep 04 08:32:44 2007 +0000
1.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.13
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 data
1.22 * forming a new free block. If the free block would be less than the minimum size,
.