ppc32
[Memory management]


Files

file  as.h
file  asid.h
file  frame.h
file  memory_init.h
file  page.h
file  tlb.h
file  as.c
file  frame.c
file  memory_init.c
file  page.c
file  tlb.c

Data Structures

struct  phte_t

Defines

#define KERNEL_ADDRESS_SPACE_SHADOWED_ARCH   0
#define KERNEL_ADDRESS_SPACE_START_ARCH   ((unsigned long) 0x80000000)
#define KERNEL_ADDRESS_SPACE_END_ARCH   ((unsigned long) 0xffffffff)
#define USER_ADDRESS_SPACE_START_ARCH   ((unsigned long) 0x00000000)
#define USER_ADDRESS_SPACE_END_ARCH   ((unsigned long) 0x7fffffff)
#define USTACK_ADDRESS_ARCH   (0x7fffffff-(PAGE_SIZE-1))
#define ASID_MAX_ARCH   4096
#define FRAME_WIDTH   12
#define FRAME_SIZE   (1 << FRAME_WIDTH)
#define PAGE_WIDTH   FRAME_WIDTH
#define PAGE_SIZE   FRAME_SIZE
#define PRINT_BAT(name, ureg, lreg)

Typedefs

typedef __u32 asid_t

Functions

void as_arch_init (void)
size_t get_memory_size (void)
void memory_print_map (void)
void pht_refill (int n, istate_t *istate)
bool pht_real_refill (int n, istate_t *istate) __attribute__((section("K_UNMAPPED_TEXT_START")))
void pht_init (void)
void as_install_arch (as_t *as)
void frame_arch_init (void)
void page_arch_init (void)
__address hw_map (__address physaddr, size_t size)
static pte_tfind_mapping_and_check (as_t *as, bool lock, __address badvaddr, int access, istate_t *istate, int *pfrc)
static void pht_refill_fail (__address badvaddr, istate_t *istate)
static void pht_insert (const __address vaddr, const pfn_t pfn)
static void pht_real_insert (const __address vaddr, const pfn_t pfn)
void tlb_arch_init (void)
void tlb_invalidate_all (void)
void tlb_invalidate_asid (asid_t asid)
void tlb_invalidate_pages (asid_t asid, __address page, count_t cnt)
void tlb_print (void)

Variables

__address last_frame = 0

Define Documentation

#define ASID_MAX_ARCH   4096
 

Definition at line 40 of file asid.h.

#define FRAME_SIZE   (1 << FRAME_WIDTH)
 

Definition at line 39 of file frame.h.

Referenced by anon_page_fault(), elf_frame_free(), elf_page_fault(), frame_arch_init(), hw_map(), phys_page_fault(), and sys_physmem_map().

#define FRAME_WIDTH   12
 

Definition at line 38 of file frame.h.

Referenced by ADDR2PFN(), PFN2ADDR(), and SIZE2FRAMES().

#define KERNEL_ADDRESS_SPACE_END_ARCH   ((unsigned long) 0xffffffff)
 

Definition at line 41 of file as.h.

Referenced by hw_map().

#define KERNEL_ADDRESS_SPACE_SHADOWED_ARCH   0
 

Definition at line 38 of file as.h.

#define KERNEL_ADDRESS_SPACE_START_ARCH   ((unsigned long) 0x80000000)
 

Definition at line 40 of file as.h.

#define PAGE_SIZE   FRAME_SIZE
 

Definition at line 41 of file page.h.

Referenced by anon_page_fault(), anon_share(), as_area_create(), as_area_destroy(), as_area_resize(), as_area_share(), as_get_size(), badness(), check_area_conflicts(), comp_objects(), ddi_physmem_map(), elf_frame_free(), elf_page_fault(), elf_share(), find_area_and_lock(), hw_map(), klog_init(), load_segment(), main_bsp(), map_structure(), phys_page_fault(), pic_init(), pt_mapping_insert(), ptl0_create(), slab_space_alloc(), sys_futex_sleep_timeout(), sys_futex_wakeup(), sys_io(), sys_physmem_map(), task_run_program(), used_space_insert(), and used_space_remove().

#define PAGE_WIDTH   FRAME_WIDTH
 

Definition at line 40 of file page.h.

Referenced by as_area_resize(), elf_frame_free(), and elf_page_fault().

#define PRINT_BAT name,
ureg,
lreg   ) 
 

Value:

asm volatile ( \
                "mfspr %0," #ureg "\n" \
                "mfspr %1," #lreg "\n" \
                : "=r" (upper), "=r" (lower) \
        ); \
        mask = (upper & 0x1ffc) >> 2; \
        if (upper & 3) { \
                __u32 tmp = mask; \
                length = 128; \
                while (tmp) { \
                        if ((tmp & 1) == 0) { \
                                printf("ibat[0]: error in mask\n"); \
                                break; \
                        } \
                        length <<= 1; \
                        tmp >>= 1; \
                } \
        } else \
                length = 0; \
        printf(name ": page=%.*p frame=%.*p length=%d KB (mask=%#x)%s%s\n", sizeof(upper) * 2, upper & 0xffff0000, sizeof(lower) * 2, lower & 0xffff0000, length, mask, ((upper >> 1) & 1) ? " supervisor" : "", (upper & 1) ? " user" : "");

Definition at line 378 of file tlb.c.

#define USER_ADDRESS_SPACE_END_ARCH   ((unsigned long) 0x7fffffff)
 

Definition at line 43 of file as.h.

#define USER_ADDRESS_SPACE_START_ARCH   ((unsigned long) 0x00000000)
 

Definition at line 42 of file as.h.

#define USTACK_ADDRESS_ARCH   (0x7fffffff-(PAGE_SIZE-1))
 

Definition at line 45 of file as.h.


Typedef Documentation

typedef __u32 asid_t
 

Definition at line 42 of file asid.h.


Function Documentation

void as_arch_init void   ) 
 

Architecture dependent address space init.

Definition at line 41 of file as.c.

References as_operations, as_pt_operations, and asid_fifo_init().

Referenced by as_init().

Here is the call graph for this function:

void as_install_arch as_t as  ) 
 

Install address space.

Install ASID.

Parameters:
as Address space structure.

Definition at line 54 of file as.c.

References interrupts_disable(), and spinlock_lock.

Referenced by as_switch().

Here is the call graph for this function:

static pte_t* find_mapping_and_check as_t as,
bool  lock,
__address  badvaddr,
int  access,
istate_t istate,
int *  pfrc
[static]
 

Try to find PTE for faulting address

Try to find PTE for faulting address. The as->lock must be held on entry to this function if lock is true.

Parameters:
as Address space.
lock Lock/unlock the address space.
badvaddr Faulting virtual address.
access Access mode that caused the fault.
istate Pointer to interrupted state.
pfrc Pointer to variable where as_page_fault() return code will be stored.
Returns:
PTE on success, NULL otherwise.

Definition at line 59 of file tlb.c.

References as_page_fault(), ASSERT, NULL, pte_t::p, page_mapping_find(), page_table_lock(), page_table_unlock(), panic, and printf().

Referenced by pht_refill().

Here is the call graph for this function:

void frame_arch_init void   ) 
 

Definition at line 44 of file frame.c.

References ADDR2PFN(), ALIGN_DOWN, ALIGN_UP, bootinfo, memmap_t::count, FRAME_SIZE, last_frame, bootinfo_t::memmap, memzone_t::size, SIZE2FRAMES(), memzone_t::start, zone_create(), and memmap_t::zones.

Referenced by frame_init().

Here is the call graph for this function:

size_t get_memory_size void   ) 
 

Definition at line 41 of file memory_init.c.

References bootinfo, bootinfo_t::memmap, and memmap_t::total.

Referenced by main_bsp().

__address hw_map __address  physaddr,
size_t  size
 

Definition at line 48 of file page.c.

References ADDR2PFN(), ALIGN_UP, AS_KERNEL, FRAME_SIZE, KERNEL_ADDRESS_SPACE_END_ARCH, last_frame, page_mapping_insert(), PAGE_NOT_CACHEABLE, PAGE_SIZE, panic, and PFN2ADDR().

Referenced by cuda_init(), fb_init(), and pic_init().

Here is the call graph for this function:

void memory_print_map void   ) 
 

Definition at line 47 of file memory_init.c.

References bootinfo, memmap_t::count, bootinfo_t::memmap, printf(), memzone_t::size, memzone_t::start, and memmap_t::zones.

Referenced by arch_pre_smp_init().

Here is the call graph for this function:

void page_arch_init void   ) 
 

Definition at line 41 of file page.c.

References config, config_t::cpu_active, and pt_mapping_operations.

Referenced by page_init().

void pht_init void   ) 
 

static void pht_insert const __address  vaddr,
const pfn_t  pfn
[static]
 

Definition at line 120 of file tlb.c.

References sdr1.

Referenced by pht_refill().

static void pht_real_insert const __address  vaddr,
const pfn_t  pfn
[static]
 

Definition at line 187 of file tlb.c.

References sdr1.

Referenced by pht_real_refill().

bool pht_real_refill int  n,
istate_t istate
 

Process Instruction/Data Storage Interrupt in Real Mode

Parameters:
n Interrupt vector number.
istate Interrupted register context.

Definition at line 322 of file tlb.c.

References istate::pc, pht_real_insert(), and VECTOR_DATA_STORAGE.

Here is the call graph for this function:

void pht_refill int  n,
istate_t istate
 

Process Instruction/Data Storage Interrupt

Parameters:
n Interrupt vector number.
istate Interrupted register context.

Definition at line 260 of file tlb.c.

References pte_t::a, AS, AS_KERNEL, find_mapping_and_check(), NULL, page_table_lock(), page_table_unlock(), panic, istate::pc, PF_ACCESS_READ, pte_t::pfn, pht_insert(), pht_refill_fail(), and VECTOR_DATA_STORAGE.

Referenced by interrupt_init().

Here is the call graph for this function:

static void pht_refill_fail __address  badvaddr,
istate_t istate
[static]
 

Definition at line 105 of file tlb.c.

References get_symtab_entry(), istate::lr, panic, and istate::pc.

Referenced by pht_refill().

Here is the call graph for this function:

void tlb_arch_init void   ) 
 

Definition at line 349 of file tlb.c.

References tlb_invalidate_all().

Referenced by tlb_init().

Here is the call graph for this function:

void tlb_invalidate_all void   ) 
 

Definition at line 355 of file tlb.c.

Referenced by before_thread_runs_arch(), tlb_arch_init(), tlb_invalidate_asid(), tlb_invalidate_pages(), and tlb_shootdown_ipi_recv().

void tlb_invalidate_asid asid_t  asid  ) 
 

Definition at line 364 of file tlb.c.

References tlb_invalidate_all().

Referenced by asid_get(), and tlb_shootdown_ipi_recv().

Here is the call graph for this function:

void tlb_invalidate_pages asid_t  asid,
__address  page,
count_t  cnt
 

Definition at line 371 of file tlb.c.

References tlb_invalidate_all().

Referenced by tlb_shootdown_ipi_recv().

Here is the call graph for this function:

void tlb_print void   ) 
 

Definition at line 401 of file tlb.c.

References printf().

Referenced by cmd_tlb().

Here is the call graph for this function:


Variable Documentation

__address last_frame = 0
 

Definition at line 42 of file frame.c.

Referenced by frame_arch_init(), and hw_map().


Generated on Sun Jun 18 17:25:11 2006 for HelenOS Kernel (ppc32) by  doxygen 1.4.6