Changeset b00fdde in mainline for arch/sparc64/include/mm/tlb.h


Ignore:
Timestamp:
2005-12-08T22:43:39Z (19 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
0d04024
Parents:
944b15c
Message:

sparc64 work.
Implement functions for reading IMMU and DMMU TLBs.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • arch/sparc64/include/mm/tlb.h

    r944b15c rb00fdde  
    3131
    3232#include <arch/mm/tte.h>
     33#include <arch/asm.h>
     34#include <arch/types.h>
     35#include <typedefs.h>
     36
     37#define ITLB_ENTRY_COUNT                64
     38#define DTLB_ENTRY_COUNT                64
    3339
    3440/** I-MMU ASIs. */
     
    7177typedef tte_data_t tlb_data_t;
    7278
    73 #define tlb_init_arch()
     79/** I-/D-TLB Data Access Address in Alternate Space. */
     80union tlb_data_access_addr {
     81        __u64 value;
     82        struct {
     83                __u64 : 55;
     84                unsigned tlb_entry : 6;
     85                unsigned : 3;
     86        } __attribute__ ((packed));
     87};
     88typedef union tlb_data_access_addr tlb_data_access_addr_t;
     89typedef union tlb_data_access_addr tlb_tag_read_addr_t;
     90
     91/** I-/D-TLB Tag Read Register. */
     92union tlb_tag_read_reg {
     93        __u64 value;
     94        struct {
     95                __u64 va : 51;          /**< Virtual Address. */
     96                unsigned context : 13;  /**< Context identifier. */
     97        } __attribute__ ((packed));
     98};
     99typedef union tlb_tag_read_reg tlb_tag_read_reg_t;
     100
     101/** Read IMMU TLB Data Access Register.
     102 *
     103 * @param entry TLB Entry index.
     104 *
     105 * @return Current value of specified IMMU TLB Data Access Register.
     106 */
     107static inline __u64 itlb_data_access_read(index_t entry)
     108{
     109        tlb_data_access_addr_t reg;
     110       
     111        reg.value = 0;
     112        reg.tlb_entry = entry;
     113        return asi_u64_read(ASI_ITLB_DATA_ACCESS_REG, reg.value);
     114}
     115
     116/** Read DMMU TLB Data Access Register.
     117 *
     118 * @param entry TLB Entry index.
     119 *
     120 * @return Current value of specified DMMU TLB Data Access Register.
     121 */
     122static inline __u64 dtlb_data_access_read(index_t entry)
     123{
     124        tlb_data_access_addr_t reg;
     125       
     126        reg.value = 0;
     127        reg.tlb_entry = entry;
     128        return asi_u64_read(ASI_DTLB_DATA_ACCESS_REG, reg.value);
     129}
     130
     131/** Read IMMU TLB Tag Read Register.
     132 *
     133 * @param entry TLB Entry index.
     134 *
     135 * @return Current value of specified IMMU TLB Tag Read Register.
     136 */
     137static inline __u64 itlb_tag_read(index_t entry)
     138{
     139        tlb_tag_read_addr_t tag;
     140
     141        tag.value = 0;
     142        tag.tlb_entry = entry;
     143        return asi_u64_read(ASI_ITLB_TAG_READ_REG, tag.value);
     144}
     145
     146/** Read DMMU TLB Tag Read Register.
     147 *
     148 * @param entry TLB Entry index.
     149 *
     150 * @return Current value of specified DMMU TLB Tag Read Register.
     151 */
     152static inline __u64 dtlb_tag_read(index_t entry)
     153{
     154        tlb_tag_read_addr_t tag;
     155
     156        tag.value = 0;
     157        tag.tlb_entry = entry;
     158        return asi_u64_read(ASI_DTLB_TAG_READ_REG, tag.value);
     159}
    74160
    75161#endif
Note: See TracChangeset for help on using the changeset viewer.