Deleted Added
sdiff udiff text old ( 10037:5cac77888310 ) new ( 10324:f40134eb3f85 )
full compact
1/*
2 * Copyright (c) 2010-2013 ARM Limited
3 * All rights reserved
4 *
5 * The license below extends only to copyright in the software and shall
6 * not be construed as granting a license to any other intellectual
7 * property including but not limited to intellectual property relating
8 * to a hardware implementation of the functionality of the software
9 * licensed hereunder. You may use the software subject to the license
10 * terms below provided that you ensure that this notice is replicated

--- 346 unchanged lines hidden (view full) ---

357 /** This entry needs to be written back to memory */
358 bool dirty() const
359 {
360 return _dirty;
361 }
362
363 };
364
365 /** Long-descriptor format (LPAE) */
366 class LongDescriptor : public DescriptorBase {
367 public:
368 /** Descriptor type */
369 enum EntryType {
370 Invalid,
371 Table,
372 Block,

--- 31 unchanged lines hidden (view full) ---

404 {
405 assert(type() == Block || type() == Page);
406 return have_security && (currState->secureLookup && !bits(data, 5));
407 }
408
409 /** True if the current lookup is performed in AArch64 state */
410 bool aarch64;
411
412 /** True if the granule size is 64 KB (AArch64 only) */
413 bool largeGrain;
414
415 /** Width of the granule size in bits */
416 int grainSize;
417
418 /** Return the descriptor type */
419 EntryType type() const
420 {
421 switch (bits(data, 1, 0)) {
422 case 0x1:
423 // In AArch64 blocks are not allowed at L0 for the 4 KB granule
424 // and at L1 for the 64 KB granule
425 if (largeGrain)
426 return lookupLevel == L2 ? Block : Invalid;
427 return lookupLevel == L0 || lookupLevel == L3 ? Invalid : Block;
428 case 0x3:
429 return lookupLevel == L3 ? Page : Table;
430 default:
431 return Invalid;
432 }
433 }
434
435 /** Return the bit width of the page/block offset */
436 uint8_t offsetBits() const
437 {
438 assert(type() == Block || type() == Page);
439 if (largeGrain) {
440 if (type() == Block)
441 return 29 /* 512 MB */;
442 return 16 /* 64 KB */; // type() == Page
443 } else {
444 if (type() == Block)
445 return lookupLevel == L1 ? 30 /* 1 GB */ : 21 /* 2 MB */;
446 return 12 /* 4 KB */; // type() == Page
447 }
448 }
449
450 /** Return the physical frame, bits shifted right */
451 Addr pfn() const
452 {
453 if (aarch64)
454 return bits(data, 47, offsetBits());

--- 247 unchanged lines hidden (view full) ---

702 SCTLR sctlr;
703
704 /** Cached copy of the scr as it existed when translation began */
705 SCR scr;
706
707 /** Cached copy of the cpsr as it existed when translation began */
708 CPSR cpsr;
709
710 /** Cached copy of the ttbcr as it existed when translation began. */
711 TTBCR ttbcr;
712
713 /** Cached copy of the htcr as it existed when translation began. */
714 HTCR htcr;
715
716 /** Cached copy of the htcr as it existed when translation began. */
717 HCR hcr;
718
719 /** Cached copy of the vtcr as it existed when translation began. */

--- 243 unchanged lines hidden ---