Subversion Repositories HelenOS

Compare Revisions

Ignore whitespace Rev 2088 → Rev 2089

/trunk/kernel/arch/mips32/include/mm/page.h
43,11 → 43,11
#define PAGE_COLOR_BITS 0 /* dummy */
 
#ifndef __ASM__
# define KA2PA(x) (((uintptr_t) (x)) - 0x80000000)
# define PA2KA(x) (((uintptr_t) (x)) + 0x80000000)
# define KA2PA(x) (((uintptr_t) (x)) - 0x80000000)
# define PA2KA(x) (((uintptr_t) (x)) + 0x80000000)
#else
# define KA2PA(x) ((x) - 0x80000000)
# define PA2KA(x) ((x) + 0x80000000)
# define KA2PA(x) ((x) - 0x80000000)
# define PA2KA(x) ((x) + 0x80000000)
#endif
 
#ifdef KERNEL
109,10 → 109,8
 
#ifndef __ASM__
 
#include <arch/mm/tlb.h>
#include <mm/page.h>
#include <arch/mm/frame.h>
#include <arch/types.h>
#include <mm/mm.h>
#include <arch/exception.h>
 
static inline int get_pt_flags(pte_t *pt, index_t i)
{
/trunk/kernel/arch/mips32/include/mm/tlb.h
36,7 → 36,6
#define KERN_mips32_TLB_H_
 
#include <arch/exception.h>
#include <typedefs.h>
 
#ifdef TLBCNT
# define TLB_ENTRY_COUNT TLBCNT
52,12 → 51,7
#define PAGE_UNCACHED 2
#define PAGE_CACHEABLE_EXC_WRITE 5
 
typedef union entry_lo entry_lo_t;
typedef union entry_hi entry_hi_t;
typedef union page_mask page_mask_t;
typedef union index tlb_index_t;
 
union entry_lo {
typedef union {
struct {
#ifdef BIG_ENDIAN
unsigned : 2; /* zero */
76,22 → 70,9
#endif
} __attribute__ ((packed));
uint32_t value;
};
} entry_lo_t;
 
/** Page Table Entry. */
struct pte {
unsigned g : 1; /**< Global bit. */
unsigned p : 1; /**< Present bit. */
unsigned d : 1; /**< Dirty bit. */
unsigned cacheable : 1; /**< Cacheable bit. */
unsigned : 1; /**< Unused. */
unsigned soft_valid : 1; /**< Valid content even if not present. */
unsigned pfn : 24; /**< Physical frame number. */
unsigned w : 1; /**< Page writable bit. */
unsigned a : 1; /**< Accessed bit. */
};
 
union entry_hi {
typedef union {
struct {
#ifdef BIG_ENDIAN
unsigned vpn2 : 19;
104,9 → 85,9
#endif
} __attribute__ ((packed));
uint32_t value;
};
} entry_hi_t;
 
union page_mask {
typedef union {
struct {
#ifdef BIG_ENDIAN
unsigned : 7;
119,9 → 100,9
#endif
} __attribute__ ((packed));
uint32_t value;
};
} page_mask_t;
 
union index {
typedef union {
struct {
#ifdef BIG_ENDIAN
unsigned p : 1;
134,7 → 115,7
#endif
} __attribute__ ((packed));
uint32_t value;
};
} tlb_index_t;
 
/** Probe TLB for Matching Entry
*
/trunk/kernel/arch/mips32/include/mm/as.h
42,11 → 42,13
#define USER_ADDRESS_SPACE_START_ARCH (unsigned long) 0x00000000
#define USER_ADDRESS_SPACE_END_ARCH (unsigned long) 0x7fffffff
 
#define USTACK_ADDRESS_ARCH (0x80000000-PAGE_SIZE)
#define USTACK_ADDRESS_ARCH (0x80000000 - PAGE_SIZE)
 
typedef struct {
} as_arch_t;
 
#include <genarch/mm/as_pt.h>
 
#define as_constructor_arch(as, flags) (as != as)
#define as_destructor_arch(as) (as != as)
#define as_create_arch(as, flags) (as != as)