app.h File Reference

application descriptor More...

#include <l4/sys/types.h>
#include <l4/l4rm/l4rm.h>
#include "cfg.h"
#include "debug.h"

Go to the source code of this file.

Data Structures

struct  app_addr_t
 Pair of addresses. More...
struct  app_area_t
 Application's area to page by our pager thread. More...
struct  app_t
 Application descriptor. More...

Defines

#define MAX_APP_AREA   28
 maximum entries for memory regions of an application
#define DEFAULT_PRIO   0x10
 default priority for new tasks
#define DEFAULT_MCP   0xff
 default mcp for new tasks
#define APP_AREA_VALID   0x0001
 entry is valid
#define APP_AREA_PAGE   0x0002
 forward pagefaults to ds
#define APP_AREA_MMIO   0x0004
 don't kill this area
#define APP_AREA_NOSUP   0x0008
 don't page superpages
#define APP_MODE_SIGMA0   0x00000001
 emulate sigma0 style application
#define APP_MODE_INTERP   0x00000004
 interpret using libld-l4.s.so
#define APP_DIRECTMAP   0x00000008
 map program sections one-by-one
#define APP_SYMBOLS   0x00000010
 load symbols
#define APP_LINES   0x00000020
 load lines information
#define APP_ALLOW_KILL   0x00000040
 killing other apps is allowed
#define APP_ALLOW_VGA   0x00000080
 access to VGA memory allowed
#define APP_NOSIGMA0   0x00000100
 don't page other regions
#define APP_ALLOW_CLI   0x00000200
 task may execute cli/sti
#define APP_SHOW_AREAS   0x00000400
 show app areas before start
#define APP_STOP   0x00000800
 stop app just before start
#define APP_CONT   0x00001000
 ensure that we cont only once
#define APP_NOSUPER   0x00002000
 don't page superpages
#define APP_ALL_WRITBLE   0x00004000
 all sections writable
#define APP_ALLOW_BIOS   0x00008000
 access to BIOS allowed
#define APP_MSG_IO   0x00010000
 internal pager flag
#define APP_HASH_BINARY   0x00020000
 hash sections of binary
#define HERE_TO_APP(addr, base)   (base).app + (((l4_addr_t)(addr) - (base).here))

Functions

app_ttask_to_app (l4_threadid_t tid)
 Return the address of the task struct.
int create_app_desc (app_t **new_app)
 Create a new app_t descriptor.
void app_msg (app_t *app, const char *format,...)
 Dump a message corresponding to an application.
void app_list_addr (app_t *app)
 Dump all app_areas for debugging purposes.
int app_boot (cfg_task_t *ct, l4_taskid_t owner)
int app_cont (app_t *app)
int app_kill (l4_taskid_t task_id, l4_taskid_t caller)
 Kill application.
int app_dump (unsigned long task_id)
 Dump application to standard output.
int app_info (unsigned long task_id, l4dm_dataspace_t *l4env_ds, l4_threadid_t client, char **fname)
 Deliver application info to flexpage.
void app_share_sections_with_client (app_t *app, l4_threadid_t client)
 Share all sections which are not exclusiv owned by the applications to the application.
int init_infopage (l4env_infopage_t *env)
 Initialize the application's environment infopage.
int app_attach_ds_to_pager (app_t *app, l4dm_dataspace_t *ds, l4_addr_t addr, l4_size_t size, l4_uint16_t type, l4_uint32_t rights, const char *dbg_name, app_area_t **aa)
 Attach dataspace to pager.


Detailed Description

application descriptor

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

Function Documentation

int app_attach_ds_to_pager ( app_t app,
l4dm_dataspace_t *  ds,
l4_addr_t  addr,
l4_size_t  size,
l4_uint16_t  type,
l4_uint32_t  rights,
const char *  dbg_name,
app_area_t **  aa 
)

Attach dataspace to pager.

Therefore it is accessible by the application.

Parameters:
app application
ds dataspace to attach
addr start address of dataspace inside application. If L4_MAX_ADDRESS, then do not make the dataspace accessible from the application but only register to allow smoothly shutdown of dataspace on exit of the application.
size size of dataspace
type type
rights rights for the pager
dbg_name name of application area for debugging purposes
Return values:
aa application area

< forward pagefaults to ds

int app_boot ( cfg_task_t *  ct,
l4_taskid_t  owner 
)

< stop app just before start

int app_cont ( app_t app  ) 

< ensure that we cont only once

< ensure that we cont only once

< emulate sigma0 style application

int app_dump ( unsigned long  task_id  ) 

Dump application to standard output.

Parameters:
task_id L4 task id or 0 to dump all tasks
Returns:
0 on success -L4_ENOTFOUND if no proper task was not found

int app_info ( unsigned long  task_id,
l4dm_dataspace_t *  l4env_ds,
l4_threadid_t  client,
char **  fname 
)

Deliver application info to flexpage.

Parameters:
task_id L4 task id
l4env_ds dataspace containing l4env infopage information
client Client to transfer the ownership to
Return values:
fname application name
Returns:
0 on success -L4_ENOTFOUND if no proper task was not found

int app_kill ( l4_taskid_t  task_id,
l4_taskid_t  caller 
)

Kill application.

Parameters:
task_id task to be killed
caller_id task which wants to kill task_id
Returns:
0 on success -L4_ENOTFOUND if no proper task was not found

< killing other apps is allowed

void app_list_addr ( app_t app  ) 

Dump all app_areas for debugging purposes.

void app_msg ( app_t app,
const char *  format,
  ... 
)

Dump a message corresponding to an application.

If the application has already an task number, print it in hashes after the name of the application.

void app_share_sections_with_client ( app_t app,
l4_threadid_t  client 
)

Share all sections which are not exclusiv owned by the applications to the application.

Modules have the L4_DSTYPE_APP_IS_OWNER bit set which means that their ownership is already transfered to the application

int create_app_desc ( app_t **  new_app  ) 

Create a new app_t descriptor.

Return values:
new_app pointer to new app descriptor
Returns:
0 on success -L4_ENOMEM if no descriptors available

int init_infopage ( l4env_infopage_t env  ) 

Initialize the application's environment infopage.

Parameters:
env pointer to L4env infopage
Returns:
0 on success

app_t* task_to_app ( l4_threadid_t  tid  ) 

Return the address of the task struct.

Parameters:
tid L4 thread ID
Returns:
task descriptor NULL if not found


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