Subversion Repositories HelenOS

Compare Revisions

Ignore whitespace Rev 4128 → Rev 4129

/branches/sparc/kernel/arch/sparc64/include/sun4v/regdef.h
50,30 → 50,6
 
#define TSTATE_PEF_BIT (PSTATE_PEF_BIT << TSTATE_PSTATE_SHIFT)
 
/*
 
#define PSTATE_IE_BIT (1 << 1)
#define PSTATE_AM_BIT (1 << 3)
 
#define PSTATE_AG_BIT (1 << 0)
#define PSTATE_IG_BIT (1 << 11)
#define PSTATE_MG_BIT (1 << 10)
 
#define PSTATE_PRIV_BIT (1 << 2)
#define PSTATE_PEF_BIT (1 << 4)
 
#define TSTATE_PSTATE_SHIFT 8
#define TSTATE_PRIV_BIT (PSTATE_PRIV_BIT << TSTATE_PSTATE_SHIFT)
#define TSTATE_IE_BIT (PSTATE_IE_BIT << TSTATE_PSTATE_SHIFT)
#define TSTATE_PEF_BIT (PSTATE_PEF_BIT << TSTATE_PSTATE_SHIFT)
 
#define TSTATE_CWP_MASK 0x1f
 
#define WSTATE_NORMAL(n) (n)
#define WSTATE_OTHER(n) ((n) << 3)
 
*/
 
#endif
 
/** @}
/branches/sparc/kernel/arch/sparc64/include/mm/sun4v/page.h
37,17 → 37,9
 
#include <arch/mm/frame.h>
 
/*
* On the TLB and TSB level, we still use 8K pages, which are supported by the
* MMU.
*/
#define MMU_PAGE_WIDTH MMU_FRAME_WIDTH
#define MMU_PAGE_SIZE MMU_FRAME_SIZE
 
/*
* On the page table level, we use 16K pages. 16K pages are not supported by
* the MMU but we emulate them with pairs of 8K pages.
*/
#define PAGE_WIDTH FRAME_WIDTH
#define PAGE_SIZE FRAME_SIZE
 
/branches/sparc/kernel/arch/sparc64/include/mm/sun4v/tte.h
52,7 → 52,6
#include <arch/types.h>
 
/** Translation Table Entry - Data. */
/** SUN4V-OK */
union tte_data {
uint64_t value;
struct {
74,7 → 73,6
 
typedef union tte_data tte_data_t;
 
// TODO: probably remove once tsb.c exists for both sun4u and sun4v
#define VA_TAG_PAGE_SHIFT 22
 
#endif /* !def __ASM__ */
/branches/sparc/kernel/arch/sparc64/include/mm/sun4v/tlb.h
118,42 → 118,6
asi_u64_write(ASI_SECONDARY_CONTEXT_REG, VA_SECONDARY_CONTEXT_REG, v);
}
 
/** Perform IMMU TLB Demap Operation.
*
* @param type Selects between context and page demap (and entire MMU
* demap on US3).
* @param context_encoding Specifies which Context register has Context ID for
* demap.
* @param page Address which is on the page to be demapped.
*/
static inline void itlb_demap(int type, int context_encoding, uintptr_t page)
{
}
 
/** Perform DMMU TLB Demap Operation.
*
* @param type One of TLB_DEMAP_PAGE and TLB_DEMAP_CONTEXT. Selects
* between context and page demap.
* @param context_encoding Specifies which Context register has Context ID for
* demap.
* @param page Address which is on the page to be demapped.
*/
static inline void dtlb_demap(int type, int context_encoding, uintptr_t page)
{
#if 0
- this implementation is not correct!!!
if (type == TLB_DEMAP_PAGE) {
__hypercall_fast5(
MMU_DEMAP_PAGE, 0, 0,
page, context_encoding, MMU_FLAG_DTLB);
} else if (type == TLB_DEMAP_CONTEXT) {
__hypercall_fast4(
MMU_DEMAP_CTX, 0, 0,
context_encoding, MMU_FLAG_DTLB);
}
#endif
}
 
/**
* Demaps all mappings in a context.
*
164,10 → 128,29
__hypercall_fast4(MMU_DEMAP_CTX, 0, 0, context, mmu_flag);
}
 
/**
* Demaps given page.
*
* @param vaddr VA of the page to be demapped
* @param context number of the context
* @param mmu_flag MMU_FLAG_DTLB, MMU_FLAG_ITLB or a combination of both
*/
static inline void mmu_demap_page(uintptr_t vaddr, int context, int mmu_flag) {
__hypercall_fast5(MMU_DEMAP_PAGE, 0, 0, vaddr, context, mmu_flag);
}
 
/**
* Installs a locked TLB entry in kernel address space.
*
* @param vaddr VA of the page to be demapped
* @param ra real address the page is mapped to
* @param cacheable should the page be cacheble?
* @param privileged should the mapping be privileged?
* @param executable should the memory mapped be executable?
* @param writable should the memory mapped be writable?
* @param size code of the page size
* @param mmu_flag MMU_FLAG_DTLB, MMU_FLAG_ITLB or a combination of both
*/
static inline void mmu_map_perm_addr(uintptr_t vaddr, uintptr_t ra,
bool cacheable, bool privileged, bool executable,
bool writable, unsigned size, unsigned mmu_flags) {
192,7 → 175,7
 
extern void dtlb_insert_mapping(uintptr_t, uintptr_t, int, bool, bool);
 
extern void describe_mmu_fault(void);
extern void describe_dmmu_fault(void);
 
#endif /* !def __ASM__ */
 
/branches/sparc/kernel/arch/sparc64/include/mm/sun4v/as.h
60,8 → 60,7
typedef union tte_tag {
uint64_t value;
struct {
unsigned invalid : 1; /**< Invalidated by software. */
unsigned : 2;
unsigned : 3;
unsigned context : 13; /**< Software ASID. */
unsigned : 6;
uint64_t va_tag : 42; /**< Virtual address bits <63:22>. */
/branches/sparc/kernel/arch/sparc64/include/mm/sun4v/tsb.h
71,8 → 71,8
struct pte;
 
extern void tsb_invalidate(struct as *as, uintptr_t page, count_t pages);
extern void itsb_pte_copy(struct pte *t, index_t index);
extern void dtsb_pte_copy(struct pte *t, index_t index, bool ro);
extern void itsb_pte_copy(struct pte *t);
extern void dtsb_pte_copy(struct pte *t, bool ro);
 
#endif /* !def __ASM__ */