Ignore:
Timestamp:
2016-01-07T13:41:38Z (8 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
f4582c6
Parents:
7254df6
Message:

sparc64: TSB needs to be naturally aligned

The ITSB and DTSB on sun4u and the TSB on sun4v are mapped by a single
64K page, so they need to be aligned to 64K. Moreover, the TSB pointer
contruction demands the natural alignment: 32K for ITSB/DTSB on sun4u
and 64K for the unified TSB on sun4v.

The code was also streamlined and made more beautiful.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/arch/sparc64/include/arch/mm/sun4u/tsb.h

    r7254df6 re08162b  
    4343 * in TLBs - only one TLB entry will do.
    4444 */
    45 #define TSB_SIZE                        2       /* when changing this, change
    46                                                  * as.c as well */
    47 #define ITSB_ENTRY_COUNT                (512 * (1 << TSB_SIZE))
    48 #define DTSB_ENTRY_COUNT                (512 * (1 << TSB_SIZE))
     45#define TSB_BASE_REG_SIZE       2       /* keep in sync with as.c */
     46#define ITSB_ENTRY_COUNT        (512 * (1 << TSB_BASE_REG_SIZE))
     47#define DTSB_ENTRY_COUNT        (512 * (1 << TSB_BASE_REG_SIZE))
     48
     49#define ITSB_ENTRY_MASK         (ITSB_ENTRY_COUNT - 1)
     50#define DTSB_ENTRY_MASK         (DTSB_ENTRY_COUNT - 1)
     51
     52#define TSB_ENTRY_COUNT         (ITSB_ENTRY_COUNT + DTSB_ENTRY_COUNT)
     53#define TSB_SIZE                (TSB_ENTRY_COUNT * sizeof(tsb_entry_t))
     54#define TSB_FRAMES              SIZE2FRAMES(TSB_SIZE)
    4955
    5056#define TSB_TAG_TARGET_CONTEXT_SHIFT    48
Note: See TracChangeset for help on using the changeset viewer.