1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
|
/* -*- mode: C; c-basic-offset: 3; -*- */
/*
This file is part of drd, a thread error detector.
Copyright (C) 2006-2009 Bart Van Assche <bart.vanassche@gmail.com>.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307, USA.
The GNU General Public License is contained in the file COPYING.
*/
#ifndef __DRD_BITMAP_H
#define __DRD_BITMAP_H
#include "pub_drd_bitmap.h"
#include "pub_tool_basics.h"
#include "pub_tool_oset.h"
#include "pub_tool_libcbase.h"
/* Bitmap representation. A bitmap is a data structure in which two bits are
* reserved per 32 bit address: one bit that indicates that the data at the
* specified address has been read, and one bit that indicates that the data
* has been written to.
*/
/* Client addresses are split into bitfields as follows:
* ------------------------------------------------------
* | Address MSB | Address LSB | Ignored bits |
* ------------------------------------------------------
* | Address MSB | UWord MSB | UWord LSB | Ignored bits |
* ------------------------------------------------------
*/
/* Address MSB / LSB split. */
/** Number of least significant address bits that are ignored. */
#define ADDR_IGNORED_BITS 0
#define ADDR_IGNORED_MASK ((1U << ADDR_IGNORED_BITS) - 1U)
#define ADDR_GRANULARITY (1U << ADDR_IGNORED_BITS)
/**
* Round argument a up to a multiple of (1 << ADDR_GRANULARITY), and next
* shift it right ADDR_GRANULARITY bits. The expression below is optimized
* for the case where a is a constant.
*/
#define SCALED_SIZE(a) \
(((((a) - 1U) | ADDR_IGNORED_MASK) + 1U) >> ADDR_IGNORED_BITS)
/**
* Number of bits assigned to the least significant component of an address.
*/
#define ADDR_LSB_BITS 12
/**
* Mask that has to be applied to an address of type Addr in order to
* compute the least significant part of an address split, after having
* shifted the address bits ADDR_GRANULARITY to the right.
*/
#define ADDR_LSB_MASK (((UWord)1 << ADDR_LSB_BITS) - 1U)
/** Compute least significant bits of an address of type Addr. */
static __inline__
UWord address_lsb(const Addr a)
{ return (a >> ADDR_IGNORED_BITS) & ADDR_LSB_MASK; }
/**
* Compute the first address for which address_lsb() is equal to
* address_lsb(a).
*/
static __inline__
Addr first_address_with_same_lsb(const Addr a)
{
return ((a | ADDR_IGNORED_MASK) ^ ADDR_IGNORED_MASK);
}
/**
* Compute the first address for which address_lsb() is greater than
* address_lsb(a).
*/
static __inline__
Addr first_address_with_higher_lsb(const Addr a)
{
return ((a | ADDR_IGNORED_MASK) + 1U);
}
/** Compute most significant bits of an address of type Addr. */
static __inline__
UWord address_msb(const Addr a)
{ return a >> (ADDR_LSB_BITS + ADDR_IGNORED_BITS); }
static __inline__
Addr first_address_with_higher_msb(const Addr a)
{
return ((a | ((ADDR_LSB_MASK << ADDR_IGNORED_BITS) | ADDR_IGNORED_MASK))
+ 1U);
}
/**
* Convert LSB and MSB back into an address.
*
* @note It is assumed that sizeof(Addr) == sizeof(UWord).
*/
static __inline__
Addr make_address(const UWord a1, const UWord a0)
{
return ((a1 << (ADDR_LSB_BITS + ADDR_IGNORED_BITS))
| (a0 << ADDR_IGNORED_BITS));
}
/** Number of bits that fit in a variable of type UWord. */
#define BITS_PER_UWORD (8U * sizeof(UWord))
/** Log2 of BITS_PER_UWORD. */
#if defined(VGA_x86) || defined(VGA_ppc32) || defined(VGA_arm)
#define BITS_PER_BITS_PER_UWORD 5
#elif defined(VGA_amd64) || defined(VGA_ppc64)
#define BITS_PER_BITS_PER_UWORD 6
#else
#error Unknown platform.
#endif
/** Number of UWord's needed to store one bit per address LSB. */
#define BITMAP1_UWORD_COUNT (1U << (ADDR_LSB_BITS - BITS_PER_BITS_PER_UWORD))
/**
* Mask that has to be applied to an (Addr >> ADDR_IGNORED_BITS) expression
* in order to compute the least significant part of an UWord.
*/
#define UWORD_LSB_MASK (((UWord)1 << BITS_PER_BITS_PER_UWORD) - 1)
/**
* Compute index into bm0[] array.
*
* @param a Address shifted right ADDR_IGNORED_BITS bits.
*/
static __inline__
UWord uword_msb(const UWord a)
{
#ifdef ENABLE_DRD_CONSISTENCY_CHECKS
tl_assert(a < (1U << ADDR_LSB_BITS));
#endif
return a >> BITS_PER_BITS_PER_UWORD;
}
/**
* Return the least significant bits.
*
* @param a Address shifted right ADDR_IGNORED_BITS bits.
*/
static __inline__
UWord uword_lsb(const UWord a)
{
#ifdef ENABLE_DRD_CONSISTENCY_CHECKS
tl_assert(a < (1U << ADDR_LSB_BITS));
#endif
return a & UWORD_LSB_MASK;
}
/**
* Compute the highest address lower than a for which
* uword_lsb(address_lsb(a)) == 0.
*
* @param a Address.
*/
static __inline__
Addr first_address_with_same_uword_lsb(const Addr a)
{
return (a & (~UWORD_LSB_MASK << ADDR_IGNORED_BITS));
}
/**
* First address that will go in the UWord past the one 'a' goes in.
*
* @param a Address.
*/
static __inline__
Addr first_address_with_higher_uword_msb(const Addr a)
{
return ((a | ((UWORD_LSB_MASK << ADDR_IGNORED_BITS) | ADDR_IGNORED_MASK))
+ 1);
}
/* Local variables. */
static ULong s_bitmap2_creation_count;
/*********************************************************************/
/* Functions for manipulating a struct bitmap1. */
/*********************************************************************/
/* Lowest level, corresponding to the lowest ADDR_LSB_BITS of an address. */
struct bitmap1
{
UWord bm0_r[BITMAP1_UWORD_COUNT];
UWord bm0_w[BITMAP1_UWORD_COUNT];
};
static __inline__ UWord bm0_mask(const UWord a)
{
#ifdef ENABLE_DRD_CONSISTENCY_CHECKS
tl_assert(address_msb(make_address(0, a)) == 0);
#endif
return ((UWord)1 << uword_lsb(a));
}
/** Set the bit corresponding to address a in bitmap bm0. */
static __inline__ void bm0_set(UWord* bm0, const UWord a)
{
#ifdef ENABLE_DRD_CONSISTENCY_CHECKS
tl_assert(address_msb(make_address(0, a)) == 0);
#endif
bm0[uword_msb(a)] |= (UWord)1 << uword_lsb(a);
}
/**
* Set the bits corresponding to all of the addresses in range
* [ a << ADDR_IGNORED_BITS .. (a + size) << ADDR_IGNORED_BITS [
* in bitmap bm0.
*/
static __inline__ void bm0_set_range(UWord* bm0,
const UWord a, const SizeT size)
{
#ifdef ENABLE_DRD_CONSISTENCY_CHECKS
tl_assert(size > 0);
tl_assert(address_msb(make_address(0, a)) == 0);
tl_assert(address_msb(make_address(0, a + size - 1)) == 0);
tl_assert(uword_msb(a) == uword_msb(a + size - 1));
#endif
bm0[uword_msb(a)]
|= (((UWord)1 << size) - 1) << uword_lsb(a);
}
/** Clear the bit corresponding to address a in bitmap bm0. */
static __inline__ void bm0_clear(UWord* bm0, const UWord a)
{
#ifdef ENABLE_DRD_CONSISTENCY_CHECKS
tl_assert(address_msb(make_address(0, a)) == 0);
#endif
bm0[uword_msb(a)] &= ~((UWord)1 << uword_lsb(a));
}
/**
* Clear all of the addresses in range
* [ a << ADDR_IGNORED_BITS .. (a + size) << ADDR_IGNORED_BITS [
* in bitmap bm0.
*/
static __inline__ void bm0_clear_range(UWord* bm0,
const UWord a, const SizeT size)
{
#ifdef ENABLE_DRD_CONSISTENCY_CHECKS
tl_assert(address_msb(make_address(0, a)) == 0);
tl_assert(size == 0 || address_msb(make_address(0, a + size - 1)) == 0);
tl_assert(size == 0 || uword_msb(a) == uword_msb(a + size - 1));
#endif
/*
* Note: although the expression below yields a correct result even if
* size == 0, do not touch bm0[] if size == 0 because this might otherwise
* cause an access of memory just past the end of the bm0[] array.
*/
if (size > 0)
{
bm0[uword_msb(a)]
&= ~((((UWord)1 << size) - 1) << uword_lsb(a));
}
}
/** Test whether the bit corresponding to address a is set in bitmap bm0. */
static __inline__ UWord bm0_is_set(const UWord* bm0, const UWord a)
{
#ifdef ENABLE_DRD_CONSISTENCY_CHECKS
tl_assert(address_msb(make_address(0, a)) == 0);
#endif
return (bm0[uword_msb(a)] & ((UWord)1 << uword_lsb(a)));
}
/**
* Return true if a bit corresponding to any of the addresses in range
* [ a << ADDR_IGNORED_BITS .. (a + size) << ADDR_IGNORED_BITS [
* is set in bm0.
*/
static __inline__ UWord bm0_is_any_set(const UWord* bm0,
const Addr a, const SizeT size)
{
#ifdef ENABLE_DRD_CONSISTENCY_CHECKS
tl_assert(size > 0);
tl_assert(address_msb(make_address(0, a)) == 0);
tl_assert(address_msb(make_address(0, a + size - 1)) == 0);
tl_assert(uword_msb(a) == uword_msb(a + size - 1));
#endif
return (bm0[uword_msb(a)] & ((((UWord)1 << size) - 1) << uword_lsb(a)));
}
/*********************************************************************/
/* Functions for manipulating a struct bitmap. */
/*********************************************************************/
/* Second level bitmap. */
struct bitmap2
{
Addr addr; ///< address_msb(...)
Bool recalc;
struct bitmap1 bm1;
};
static void bm2_clear(struct bitmap2* const bm2);
static __inline__
struct bitmap2* bm2_insert(struct bitmap* const bm, const UWord a1);
/**
* Rotate elements cache[0..n-1] such that the element at position n-1 is
* moved to position 0. This allows to speed up future cache lookups.
*/
static __inline__
void bm_cache_rotate(struct bm_cache_elem cache[], const int n)
{
#if 0
struct bm_cache_elem t;
tl_assert(2 <= n && n <= 8);
t = cache[0];
if (n > 1)
cache[0] = cache[1];
if (n > 2)
cache[1] = cache[2];
if (n > 3)
cache[2] = cache[3];
if (n > 4)
cache[3] = cache[4];
if (n > 5)
cache[4] = cache[5];
if (n > 6)
cache[5] = cache[6];
if (n > 7)
cache[6] = cache[7];
cache[n - 1] = t;
#endif
}
static __inline__
Bool bm_cache_lookup(struct bitmap* const bm, const UWord a1,
struct bitmap2** bm2)
{
#ifdef ENABLE_DRD_CONSISTENCY_CHECKS
tl_assert(bm);
tl_assert(bm2);
#endif
#if DRD_BITMAP_N_CACHE_ELEM > 8
#error Please update the code below.
#endif
#if DRD_BITMAP_N_CACHE_ELEM >= 1
if (a1 == bm->cache[0].a1)
{
*bm2 = bm->cache[0].bm2;
return True;
}
#endif
#if DRD_BITMAP_N_CACHE_ELEM >= 2
if (a1 == bm->cache[1].a1)
{
*bm2 = bm->cache[1].bm2;
return True;
}
#endif
#if DRD_BITMAP_N_CACHE_ELEM >= 3
if (a1 == bm->cache[2].a1)
{
*bm2 = bm->cache[2].bm2;
bm_cache_rotate(bm->cache, 3);
return True;
}
#endif
#if DRD_BITMAP_N_CACHE_ELEM >= 4
if (a1 == bm->cache[3].a1)
{
*bm2 = bm->cache[3].bm2;
bm_cache_rotate(bm->cache, 4);
return True;
}
#endif
#if DRD_BITMAP_N_CACHE_ELEM >= 5
if (a1 == bm->cache[4].a1)
{
*bm2 = bm->cache[4].bm2;
bm_cache_rotate(bm->cache, 5);
return True;
}
#endif
#if DRD_BITMAP_N_CACHE_ELEM >= 6
if (a1 == bm->cache[5].a1)
{
*bm2 = bm->cache[5].bm2;
bm_cache_rotate(bm->cache, 6);
return True;
}
#endif
#if DRD_BITMAP_N_CACHE_ELEM >= 7
if (a1 == bm->cache[6].a1)
{
*bm2 = bm->cache[6].bm2;
bm_cache_rotate(bm->cache, 7);
return True;
}
#endif
#if DRD_BITMAP_N_CACHE_ELEM >= 8
if (a1 == bm->cache[7].a1)
{
*bm2 = bm->cache[7].bm2;
bm_cache_rotate(bm->cache, 8);
return True;
}
#endif
*bm2 = 0;
return False;
}
static __inline__
void bm_update_cache(struct bitmap* const bm,
const UWord a1,
struct bitmap2* const bm2)
{
#ifdef ENABLE_DRD_CONSISTENCY_CHECKS
tl_assert(bm);
#endif
#if DRD_BITMAP_N_CACHE_ELEM > 8
#error Please update the code below.
#endif
#if DRD_BITMAP_N_CACHE_ELEM >= 8
bm->cache[7] = bm->cache[6];
#endif
#if DRD_BITMAP_N_CACHE_ELEM >= 7
bm->cache[6] = bm->cache[5];
#endif
#if DRD_BITMAP_N_CACHE_ELEM >= 6
bm->cache[5] = bm->cache[4];
#endif
#if DRD_BITMAP_N_CACHE_ELEM >= 5
bm->cache[4] = bm->cache[3];
#endif
#if DRD_BITMAP_N_CACHE_ELEM >= 4
bm->cache[3] = bm->cache[2];
#endif
#if DRD_BITMAP_N_CACHE_ELEM >= 3
bm->cache[2] = bm->cache[1];
#endif
#if DRD_BITMAP_N_CACHE_ELEM >= 2
bm->cache[1] = bm->cache[0];
#endif
bm->cache[0].a1 = a1;
bm->cache[0].bm2 = bm2;
}
/**
* Look up the address a1 in bitmap bm and return a pointer to a potentially
* shared second level bitmap. The bitmap where the returned pointer points
* at may not be modified by the caller.
*
* @param a1 client address shifted right by ADDR_LSB_BITS.
* @param bm bitmap pointer.
*/
static __inline__
const struct bitmap2* bm2_lookup(struct bitmap* const bm, const UWord a1)
{
struct bitmap2* bm2;
#ifdef ENABLE_DRD_CONSISTENCY_CHECKS
tl_assert(bm);
#endif
if (! bm_cache_lookup(bm, a1, &bm2))
{
bm2 = VG_(OSetGen_Lookup)(bm->oset, &a1);
bm_update_cache(bm, a1, bm2);
}
return bm2;
}
/**
* Look up the address a1 in bitmap bm and return a pointer to a second
* level bitmap that is not shared and hence may be modified.
*
* @param a1 client address shifted right by ADDR_LSB_BITS.
* @param bm bitmap pointer.
*/
static __inline__
struct bitmap2*
bm2_lookup_exclusive(struct bitmap* const bm, const UWord a1)
{
struct bitmap2* bm2;
#ifdef ENABLE_DRD_CONSISTENCY_CHECKS
tl_assert(bm);
#endif
if (! bm_cache_lookup(bm, a1, &bm2))
{
bm2 = VG_(OSetGen_Lookup)(bm->oset, &a1);
}
return bm2;
}
/** Clear the content of the second-level bitmap. */
static __inline__
void bm2_clear(struct bitmap2* const bm2)
{
#ifdef ENABLE_DRD_CONSISTENCY_CHECKS
tl_assert(bm2);
#endif
VG_(memset)(&bm2->bm1, 0, sizeof(bm2->bm1));
}
/**
* Insert an uninitialized second level bitmap for the address a1.
*
* @param bm bitmap pointer.
* @param a1 client address shifted right by ADDR_LSB_BITS.
*
* @note bitmap2::recalc isn't initialized here on purpose.
*/
static __inline__
struct bitmap2* bm2_insert(struct bitmap* const bm, const UWord a1)
{
struct bitmap2* bm2;
#ifdef ENABLE_DRD_CONSISTENCY_CHECKS
tl_assert(bm);
#endif
s_bitmap2_creation_count++;
bm2 = VG_(OSetGen_AllocNode)(bm->oset, sizeof(*bm2));
bm2->addr = a1;
VG_(OSetGen_Insert)(bm->oset, bm2);
bm_update_cache(bm, a1, bm2);
return bm2;
}
static __inline__
struct bitmap2* bm2_insert_copy(struct bitmap* const bm,
struct bitmap2* const bm2)
{
struct bitmap2* bm2_copy;
bm2_copy = bm2_insert(bm, bm2->addr);
VG_(memcpy)(&bm2_copy->bm1, &bm2->bm1, sizeof(bm2->bm1));
return bm2_copy;
}
/**
* Look up the address a1 in bitmap bm, and insert it if not found.
* The returned second level bitmap may not be modified.
*
* @param bm bitmap pointer.
* @param a1 client address shifted right by ADDR_LSB_BITS.
*/
static __inline__
struct bitmap2* bm2_lookup_or_insert(struct bitmap* const bm, const UWord a1)
{
struct bitmap2* bm2;
#ifdef ENABLE_DRD_CONSISTENCY_CHECKS
tl_assert(bm);
#endif
if (bm_cache_lookup(bm, a1, &bm2))
{
if (bm2 == 0)
{
bm2 = bm2_insert(bm, a1);
bm2_clear(bm2);
}
}
else
{
bm2 = VG_(OSetGen_Lookup)(bm->oset, &a1);
if (! bm2)
{
bm2 = bm2_insert(bm, a1);
bm2_clear(bm2);
}
bm_update_cache(bm, a1, bm2);
}
return bm2;
}
/**
* Look up the address a1 in bitmap bm, and insert it if not found.
* The returned second level bitmap may be modified.
*
* @param a1 client address shifted right by ADDR_LSB_BITS.
* @param bm bitmap pointer.
*/
static __inline__
struct bitmap2* bm2_lookup_or_insert_exclusive(struct bitmap* const bm,
const UWord a1)
{
return bm2_lookup_or_insert(bm, a1);
}
static __inline__
void bm2_remove(struct bitmap* const bm, const UWord a1)
{
struct bitmap2* bm2;
#ifdef ENABLE_DRD_CONSISTENCY_CHECKS
tl_assert(bm);
#endif
bm2 = VG_(OSetGen_Remove)(bm->oset, &a1);
VG_(OSetGen_FreeNode)(bm->oset, bm2);
bm_update_cache(bm, a1, NULL);
}
static __inline__
void bm_access_aligned_load(struct bitmap* const bm,
const Addr a1, const SizeT size)
{
struct bitmap2* bm2;
#ifdef ENABLE_DRD_CONSISTENCY_CHECKS
tl_assert(bm);
#endif
bm2 = bm2_lookup_or_insert_exclusive(bm, address_msb(a1));
bm0_set_range(bm2->bm1.bm0_r,
(a1 >> ADDR_IGNORED_BITS) & ADDR_LSB_MASK,
SCALED_SIZE(size));
}
static __inline__
void bm_access_aligned_store(struct bitmap* const bm,
const Addr a1, const SizeT size)
{
struct bitmap2* bm2;
#ifdef ENABLE_DRD_CONSISTENCY_CHECKS
tl_assert(bm);
#endif
bm2 = bm2_lookup_or_insert_exclusive(bm, address_msb(a1));
bm0_set_range(bm2->bm1.bm0_w,
(a1 >> ADDR_IGNORED_BITS) & ADDR_LSB_MASK,
SCALED_SIZE(size));
}
static __inline__
Bool bm_aligned_load_has_conflict_with(struct bitmap* const bm,
const Addr a, const SizeT size)
{
const struct bitmap2* bm2;
#ifdef ENABLE_DRD_CONSISTENCY_CHECKS
tl_assert(bm);
#endif
bm2 = bm2_lookup(bm, address_msb(a));
return (bm2
&& bm0_is_any_set(bm2->bm1.bm0_w,
address_lsb(a),
SCALED_SIZE(size)));
}
static __inline__
Bool bm_aligned_store_has_conflict_with(struct bitmap* const bm,
const Addr a, const SizeT size)
{
const struct bitmap2* bm2;
#ifdef ENABLE_DRD_CONSISTENCY_CHECKS
tl_assert(bm);
#endif
bm2 = bm2_lookup(bm, address_msb(a));
if (bm2)
{
if (bm0_is_any_set(bm2->bm1.bm0_r, address_lsb(a), SCALED_SIZE(size))
| bm0_is_any_set(bm2->bm1.bm0_w, address_lsb(a), SCALED_SIZE(size)))
{
return True;
}
}
return False;
}
#endif /* __DRD_BITMAP_H */
|