Classes | Defines | Functions | Variables

base/include/nul/program.h File Reference

#include "service/string.h"
#include "service/cpu.h"
#include "service/logging.h"
#include "sys/hip.h"
#include "sys/syscalls.h"
#include "region.h"
#include "baseprogram.h"
#include "config.h"
#include "capalloc.h"

Classes

class  NovaProgram
 Contains common code for nova programms. More...

Defines

#define ASMFUNCS(X, Y)
 Define the functions needed by asm.s.

Functions

void __attribute__ ((noreturn)) __attribute__((regparm(1))) idc_reply_and_wait_fast(unsigned long mtr)
unsigned alloc_cap_region (unsigned count, unsigned align_order)
void dealloc_cap_region (unsigned base, unsigned count)
asm volatile (".global __start;"".section .text.__start;""__start:;""mov $stack, %eax;""xchg %eax, %esp;""mov %eax, %edx;""sub $0x1000, %edx;""push %edx;""push $0;""push %edx;""pushl $0;""call start;""ud2a;"".section .bss.stack;"".align 0x1000;"".space 0x1000;""stack:;")
 The startup function and the initial stack.
asm volatile (".section .text.idc_reply_and_wait_fast;"".global idc_reply_and_wait_fast;""idc_reply_and_wait_fast:;""mov $1, %al;""lea -4(%esp), %ecx;""sysenter;")
 A fast reply to our client, called by a return to a portal function.

Variables

char __image_start
char __image_end
RegionList< 512 > _cap_region

Define Documentation

#define ASMFUNCS (   X,
  Y 
)
Value:
extern "C" void start(Hip *hip, Utcb *utcb) __attribute__((regparm(2))) __attribute__((noreturn)); \
  void start(Hip *hip, Utcb *utcb)                                      \
  {                                                                     \
    static X x;                                                         \
    x.run(utcb, hip);                                                   \
    do_exit("run returned");                                            \
  }                                                                     \
  void do_exit(const char *msg)                                         \
  {                                                                     \
    Y::exit(msg);                                                       \
    while (1)                                                           \
      asm volatile ("ud2a" : : "a"(msg));                               \
  }

Define the functions needed by asm.s.

Unfortunately this can not be a template.


Function Documentation

void __attribute__ ( (noreturn)   ) 
unsigned alloc_cap_region ( unsigned  count,
unsigned  align_order 
)
void dealloc_cap_region ( unsigned  base,
unsigned  count 
)
asm volatile ( ".global __start;"".section .text.__start;""__start:;""mov $  stack,
%eax;""xchg%  eax,
%esp;""mov%  eax,
%edx;""sub $  0x1000,
%edx;""push%edx;""push $0;""push%edx;""pushl $0;""call start;""ud2a;"".section.bss.stack;"".align 0x1000;"".space 0x1000;""stack:;"   
)

The startup function and the initial stack.

Called with the HIP in esp and the UTCB a page below the HIP.

asm volatile ( ".section .text.idc_reply_and_wait_fast;"".global idc_reply_and_wait_fast;""idc_reply_and_wait_fast:;""mov $  1,
%al;""lea-  4%esp,
%ecx;""sysenter;"   
)

A fast reply to our client, called by a return to a portal function.


Variable Documentation

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines