pager.c File Reference

Application pager. More...

#include "pager.h"
#include "dm-if.h"
#include "app.h"
#include <stdio.h>
#include <stdarg.h>
#include <string.h>
#include <l4/sys/types.h>
#include <l4/env/errno.h>
#include <l4/sys/ipc.h>
#include <l4/sys/syscalls.h>
#include <l4/sys/kernel.h>
#include <l4/sys/cache.h>
#include <l4/thread/thread.h>
#include <l4/rmgr/librmgr.h>
#include <l4/l4rm/l4rm.h>
#include <l4/util/l4_macros.h>
#include <l4/loader/loader-client.h>
#include <l4/generic_ts/generic_ts.h>
#include <l4/dm_phys/dm_phys.h>
#include <l4/sigma0/sigma0.h>
#include <l4/sigma0/kip.h>

Defines

#define dbg_pf(x...)
#define dbg_adap_pf(x...)
#define dbg_incoming(x...)

Functions

static int pf_in_app (l4_addr_t addr, app_t *app, app_area_t **app_area)
 Return <>0 if address lays inside an application area.
l4_addr_t fastcall addr_app_to_here (app_t *app, l4_addr_t addr)
 Translate app address into here address.
static void rmgr_memmap_error (const char *format,...)
 Handle failed rmgr requests.
static void forward_pf_rmgr (app_t *app, l4_umword_t *dw1, l4_umword_t *dw2, void **reply, unsigned int log2_size)
 Forward a pagefault to rmgr.
static void handle_extended_sigma0_request (app_t *app, l4_umword_t *dw1, l4_umword_t *dw2, void **reply)
 Forward an I/O pagefault to rmgr.
static void forward_pf_ds (app_t *app, app_area_t *aa, l4_umword_t *dw1, l4_umword_t *dw2, void **reply)
 Forward a pagefault to dataspace manager.
static int map_kernel_info_page (void)
 Map kernel info page from rmgr.
int is_fiasco (void)
static void app_pager_thread (void *data)
 Pager thread for the application.
int start_app_pager (void)
 Create the application's pager.

Variables

l4_threadid_t app_pager_id = L4_INVALID_ID
 pager thread.
static l4_addr_t pager_map_addr_4K = 0
 map addr for 4K pages.
static l4_addr_t pager_map_addr_4M = 0
 map addr for 4M pages.
static l4_kernel_info_t * kip
 address of KI page.
static l4_threadid_t _rmgr_pager_id
 thread id of roottask pager


Detailed Description

Application pager.

Should be moved to an own L4 server.

Date:
10/06/2001
Author:
Frank Mehnert <fm3@os.inf.tu-dresden.de>

Function Documentation

l4_addr_t fastcall addr_app_to_here ( app_t app,
l4_addr_t  addr 
)

Translate app address into here address.

static void app_pager_thread ( void *  data  )  [static]

Pager thread for the application.

Parameters:
data pointer to parameter struct

< don't page other regions

< don't page other regions

< forward pagefaults to ds

static void forward_pf_ds ( app_t app,
app_area_t aa,
l4_umword_t *  dw1,
l4_umword_t *  dw2,
void **  reply 
) [static]

Forward a pagefault to dataspace manager.

Parameters:
app application descriptor
aa application area descriptor
dw1 pagefault address
dw2 pagefault EIP
Return values:
reply type of reply message

< don't page superpages

static void forward_pf_rmgr ( app_t app,
l4_umword_t *  dw1,
l4_umword_t *  dw2,
void **  reply,
unsigned int  log2_size 
) [static]

Forward a pagefault to rmgr.

Parameters:
app application descriptor
dw1 pagefault address
dw2 pagefault EIP
Return values:
reply type of reply message
log2_size size of flexpage (4k or 4M)

static void handle_extended_sigma0_request ( app_t app,
l4_umword_t *  dw1,
l4_umword_t *  dw2,
void **  reply 
) [static]

Forward an I/O pagefault to rmgr.

Parameters:
app application descriptor
dw1 pagefault address
dw2 pagefault EIP
Return values:
reply type of reply message
skip_reply don't send a reply message
Parameters:
app application descriptor
dw1 extended sigma0 code
dw2 fpage
Return values:
reply type of reply message

static int map_kernel_info_page ( void   )  [static]

Map kernel info page from rmgr.

static int pf_in_app ( l4_addr_t  addr,
app_t app,
app_area_t **  app_area 
) [inline, static]

Return <>0 if address lays inside an application area.

Parameters:
addr address of the page fault occured where
app application descriptor
Return values:
app_area pointer to area the address is situated in

< entry is valid

static void rmgr_memmap_error ( const char *  format,
  ... 
) [static]

Handle failed rmgr requests.

int start_app_pager ( void   ) 

Create the application's pager.

Returns:
0 on success


Variable Documentation

l4_threadid_t app_pager_id = L4_INVALID_ID

pager thread.

l4_kernel_info_t* kip [static]

address of KI page.

l4_addr_t pager_map_addr_4K = 0 [static]

map addr for 4K pages.

l4_addr_t pager_map_addr_4M = 0 [static]

map addr for 4M pages.


L4 Loader Reference Manual, part of DROPS  © 2000-2003