Subversion Repositories HelenOS-historic

Compare Revisions

Ignore whitespace Rev 714 → Rev 715

/kernel/trunk/arch/ia64/include/mm/frame.h
29,7 → 29,8
#ifndef __ia64_FRAME_H__
#define __ia64_FRAME_H__
 
#define FRAME_SIZE (16*1024)
#define FRAME_WIDTH 14
#define FRAME_SIZE (1<<FRAME_WIDTH)
 
extern void frame_arch_init(void);
 
/kernel/trunk/arch/ia64/include/mm/page.h
33,6 → 33,7
#include <arch/mm/frame.h>
 
#define PAGE_SIZE FRAME_SIZE
#define PAGE_WIDTH FRAME_WIDTH
 
#define KA2PA(x) ((__address) (x))
#define PA2KA(x) ((__address) (x))
48,6 → 49,15
#define HT_SET_NEXT_ARCH(t, s)
#define HT_SET_RECORD_ARCH(t, page, asid, frame, flags)
 
#define REGION_RID_MAIN 0
#define REGION_RID_FIRST_INVALID 16
#define REGION_REGISTERS 8
 
#define VHPT_WIDTH 16 /*64kB*/
#define VHPT_SIZE (1<<VHPT_WIDTH)
 
#define VHPT_BASE 0 /* Must be aligned to VHPT_SIZE */
 
struct VHPT_tag_info
{
unsigned long long tag :63;
86,7 → 96,7
union VHPT_tag tag; /*This data is here as union because I'm not sure if anybody nead access to areas ti and tag in VHPT entry*/
/* But I'm almost sure we nead access to whole word so there are both possibilities*/
/* Word 3 */
unsigned long long next :64;
unsigned long long next :64; /* This ignored field will be (in my hopes ;-) ) used as pointer in link list of entries with same hash value*/
}__attribute__ ((packed));
 
107,7 → 117,7
union VHPT_tag tag; /*This data is here as union because I'm not sure if anybody nead access to areas ti and tag in VHPT entry*/
/* But I'm almost sure we nead access to whole word so there are both possibilities*/
/* Word 3 */
unsigned long long next :64;
unsigned long long next :64; /* This ignored field will be (in my hopes ;-) ) used as pointer in link list of entries with same hash value*/
}__attribute__ ((packed));
 
119,4 → 129,39
 
extern void page_arch_init(void);
 
 
struct region_register_map
{
unsigned ve : 1;
unsigned r0 : 1;
unsigned ps : 6;
unsigned rid :24;
unsigned r1 :32;
}__attribute__ ((packed));
 
 
typedef union region_register
{
struct region_register_map map;
unsigned long long word;
}region_register;
 
struct PTA_register_map
{
unsigned ve : 1;
unsigned r0 : 1;
unsigned size : 6;
unsigned vf : 1;
unsigned r1 : 6;
unsigned long long base:49;
}__attribute__ ((packed));
 
 
typedef union PTA_register
{
struct PTA_register_map map;
unsigned long long word;
}PTA_register;
 
 
#endif
/kernel/trunk/arch/ia64/src/mm/page.c
32,7 → 32,64
#include <config.h>
#include <panic.h>
 
 
static void set_VHPT_environment(void)
{
/*
TODO:
*/
int i;
/* First set up REGION REGISTER 0 */
region_register rr;
rr.map.ve=0; /*Disable Walker*/
rr.map.ps=PAGE_WIDTH;
rr.map.rid=REGION_RID_MAIN;
asm
(
"mov rr[r0]=%0;;"
:
:"r"(rr.word)
);
/* And Invalidate the rest of REGION REGISTERS */
for(i=1;i<REGION_REGISTERS;i++)
{
rr.map.rid=REGION_RID_FIRST_INVALID+i-1;
asm
(
"mov r8=%1;;"
"mov rr[r8]=%0;;"
:
:"r"(rr.word),"r"(i)
:"r8"
);
};
 
PTA_register pta;
pta.map.ve=0; /*Disable Walker*/
pta.map.vf=1; /*Large entry format*/
pta.map.size=VHPT_WIDTH;
pta.map.base=VHPT_BASE;
/*Write PTA*/
asm
(
"mov cr8=%0;;"
:
:"r"(pta.word)
);
}
 
 
void page_arch_init(void)
{
page_operations = &page_ht_operations;
set_VHPT_environment();
}