thread.h File Reference

#include <libc.h>

Go to the source code of this file.

Defines

#define __CONVEN_THREAD_H__   1
#define THREADOPT_SCHED   (1<<0u)
#define THREADOPT_SERVICE   (1<<1u)
#define THREADOPT_REALTIME   (1<<2u)
#define THREADOPT_KERNEL   (1<<3u)
#define THREADOPT_TRACED   (1<<4u)
#define THREADOPT_HEAPSTK   (1<<5u)
#define THREADOPT_FIXEDSEL   (1<<6u)
#define THREADOPT_NOSTK   (1<<7u)
#define THREADOPT_COPYTSS   (1<<8u)
#define THREADOPT_DONTSIMCALL   (1<<9u)
#define THREADOPT_IOMAP   (1<<10u)
#define THREADOPT_DONTRUN   (1<<11u)
#define THREADOPT_VERBOSE   (1<<16u)

Enumerations

enum  t_thread_status {
  THREAD_EZERO = 0, THREAD_PRSV_TCB = 100, THREAD_KRSV_TCB, THREAD_WIRE_TCB,
  THREAD_TCBREG, THREAD_PRSV_STK, THREAD_VRSV_STK, THREAD_MAP_STK,
  THREAD_BAD_PL, THREAD_RUN, THREAD_ASCREATE, THREAD_ASATTACH_FAILED,
  THREAD_INVALID_CLASS, THREAD_COPY_PARAMS, THREAD_COPY_EIPZERO, THREAD_EBP_NOT_ZERO,
  THREAD_NO_CLASS, THREAD_LCLASS = 200, THREAD_LNAME, THREAD_LSTATUS,
  THREAD_LTSS, THREAD_LTRACE, THREAD_LEP
}

Functions

int param_gen (char **argv, int argc, char **params, int *paramlen)
t_thread_status thread_create (char *name, asid_t asid, u_int32_t eip, int nbstkpgs, int for_cpu, u_int sel, u_int32_t threadopts, char *parambuf, int paramlen, struct s_tcb_export *tcb)


Define Documentation

#define __CONVEN_THREAD_H__   1
 

#define THREADOPT_COPYTSS   (1<<8u)
 

Copy TSS from provided tcb

#define THREADOPT_DONTRUN   (1<<11u)
 

Dont call setrunq2(2)

#define THREADOPT_DONTSIMCALL   (1<<9u)
 

Dont simulate an asm "call"

#define THREADOPT_FIXEDSEL   (1<<6u)
 

Use a fixed selector

#define THREADOPT_HEAPSTK   (1<<5u)
 

Stack is allocated in heap

#define THREADOPT_IOMAP   (1<<10u)
 

Thread will use ioports

#define THREADOPT_KERNEL   (1<<3u)
 

Thread class is TCBC_KERNEL

#define THREADOPT_NOSTK   (1<<7u)
 

Don't allocate any stack

#define THREADOPT_REALTIME   (1<<2u)
 

Thread class is TCBC_REALTIME

#define THREADOPT_SCHED   (1<<0u)
 

Thread creation options Thread class is TCBC_SCHED

#define THREADOPT_SERVICE   (1<<1u)
 

Thread class is TCBC_SERVICE

#define THREADOPT_TRACED   (1<<4u)
 

Thread is traced

#define THREADOPT_VERBOSE   (1<<16u)
 

Verbose mode


Enumeration Type Documentation

enum t_thread_status
 

Enumerator:
THREAD_EZERO  No error
THREAD_PRSV_TCB  Pb rsving phys mem for tcb
THREAD_KRSV_TCB  Pb rsving kern mem for tcb
THREAD_WIRE_TCB  Pb wiring tcb in kernel
THREAD_TCBREG  Pb registering process
THREAD_PRSV_STK  Pb rsving phys mem for stack
THREAD_VRSV_STK  Pb rsving user mem for stack
THREAD_MAP_STK  Pb mapping stack
THREAD_BAD_PL  Bad priority level
THREAD_RUN  Pb running task
THREAD_ASCREATE  Pb creating address space
THREAD_ASATTACH_FAILED  Pb attaching to address space
THREAD_INVALID_CLASS  Invalid task class specified
THREAD_COPY_PARAMS  Pb copying params to task space
THREAD_COPY_EIPZERO  Pb copying eip zero
THREAD_EBP_NOT_ZERO  Ebp should be set to 0
THREAD_NO_CLASS  No class specified
THREAD_LCLASS  Pb loading tcb class
THREAD_LNAME  Pb loading tcb name
THREAD_LSTATUS  Pb loading tcb status
THREAD_LTSS  Pb loading tcb tss
THREAD_LTRACE  Pb loading trace state
THREAD_LEP  Pb loading entry points


Function Documentation

int param_gen char **  argv,
int  argc,
char **  params,
int *  paramlen
 

generate params fitable for thread_create(3)

t_thread_status thread_create char *  name,
asid_t  asid,
u_int32_t  eip,
int  nbstkpgs,
int  for_cpu,
u_int  sel,
u_int32_t  threadopts,
char *  parambuf,
int  paramlen,
struct s_tcb_export tcb
 

Macro used internally to throw errors

Parameters:
name  Name of the thread
asid  Address space to use
eip  Entry point
nbstkpgs  Nb of stack pages
for_cpu  Cpu for thread to run or CPU_ANY
sel  Selector or ring
threadopts  Options
parambuf  Param buf to copy on stack
paramlen  Param len to copy on stack
tcb  Tcb input/output struct


Generated on Wed May 24 23:05:54 2006 for LSE/OS by  doxygen 1.4.6