#include <libc.h>
#include <conven/queue.h>
#include <conven/bpt.h>
#include <area.h>
#include <core/main.h>
#include <core/suberrno.h>
#include <core/coresrv.h>
#include <core/core_tcb.h>
#include <core/core_mem.h>
#include <core/core_sig.h>
#include <core/core_cred.h>
#include <core/trap.h>
#include <core/pgflt.h>
#include <core/dblflt.h>
#include <core/stray.h>
#include <core/breakpoint.h>
#include <core/npx.h>
#include <core/syscall.h>
#include <core/syscallargs.h>
#include <core/vm86.h>
Go to the source code of this file.
Data Structures | |
struct | s_idt |
struct | s_core_info |
struct | s_runqop |
struct | s_memdef |
struct | s_as_export |
struct | rlimit |
struct | ptrace_io_desc |
struct | s_iomap |
struct | s_sigctx |
struct | s_usig |
struct | s_ucred |
struct | s_ustat |
struct | s_tcb_export |
struct | s_procdef |
union | wait |
struct | rusage |
Defines | |
#define | __LSEOS_CORE_H__ 1 |
#define | CR3_SELF ((u_int)-1) |
#define | CR3_SYSTEM ((u_int)-2) |
#define | RUNQOP_RUN 1 |
#define | RUNQOP_ASRELE 2 |
#define | RUNQOP_TCBRELE 3 |
#define | ASID_MINE -1LL |
#define | PRSV_ANY ((paddr_t)-1) |
#define | VRSV_ANY ((paddr_t)-1) |
#define | VRSV_ANYNOTFIRSTMEG ((paddr_t)-2) |
#define | MODE_UNDEF 0 |
#define | VMODE_RSV 4 |
#define | VMODE_VMAP 5 |
#define | KMODE_RSV 8 |
#define | PMODE_RSV 16 |
#define | PMODE_SHARED_RW 17 |
#define | PMODE_SHARED_RO 18 |
#define | VMODEOPT_PERSISTENT_MAP (1u<<0) |
#define | PMODEOPT_AGGREGATE (1u<<0) |
#define | PMODEOPT_PERSISTENT (1u<<1) |
#define | PMODEOPT_SYSTEM (1u<<2) |
#define | PMODEOPT_USER_READ (1u<<3) |
#define | PMODEOPT_USER_WRITE (1u<<4) |
#define | PMODEOPT_GROUP_READ (1u<<5) |
#define | PMODEOPT_GROUP_WRITE (1u<<6) |
#define | PMODEOPT_OTHER_READ (1u<<7) |
#define | PMODEOPT_OTHER_WRITE (1u<<8) |
#define | PMODEOPT_ALL_READ (PMODEOPT_USER_READ|PMODEOPT_GROUP_READ|PMODEOPT_OTHER_READ) |
#define | PMODEOPT_ALL_WRITE (PMODEOPT_USER_WRITE|PMODEOPT_GROUP_WRITE|PMODEOPT_OTHER_WRITE) |
#define | KTYPE_UNDEF 0 |
#define | KTYPE_REC 1 |
#define | KTYPE_ASPACE 2 |
#define | KTYPE_TCB 3 |
#define | KTYPE_MEM 4 |
#define | VUNMAP_NOALLOC (1<<0u) |
#define | PRELE_DONTCLEAN (1<<0u) |
#define | PRELE_NOALLOC (1<<1u) |
#define | PRELE_NOASIDCHECK (1<<2u) |
#define | PRELE_FORCE (1<<3u) |
#define | PRELE_AGGREGATE (1<<4u) |
#define | KRELE_NOALLOC (1<<0u) |
#define | KRELE_NOASIDCHECK (1<<1u) |
#define | VRELE_NOALLOC (1<<0u) |
#define | ASREG_BPT (1<<0u) |
#define | SPACE_SELF ((asid_t)-1) |
#define | SPACE_KERN ((asid_t)-2) |
#define | SPACE_PHYS ((asid_t)-3) |
#define | SPACE_SYS0 ((asid_t)-4) |
#define | SPACE_SYS1 ((asid_t)-5) |
#define | MEMDEF_RM_ONLY (1u<<0) |
#define | MEMDEF_VIRT_ONLY (1u<<1) |
#define | ASF_RUNQ (1<<0u) |
#define | ASF_PROTECTED (1<<1u) |
#define | AS_EXPORT |
#define | ASOP_ATTACH 0 |
#define | ASOP_DETACH 1 |
#define | ASOP_NDATTACH 2 |
#define | RLIMIT_CPU 0 |
#define | RLIMIT_FSIZE 1 |
#define | RLIMIT_DATA 2 |
#define | RLIMIT_STACK 3 |
#define | RLIMIT_CORE 4 |
#define | RLIMIT_RSS 5 |
#define | RLIMIT_MEMLOCK 6 |
#define | RLIMIT_NPROC 7 |
#define | RLIMIT_NOFILE 8 |
#define | RLIM_NLIMITS 9 |
#define | RLIM_INFINITY (~((u_quad_t)1 << 63)) |
#define | RLIM_SAVED_MAX RLIM_INFINITY |
#define | RLIM_SAVED_CUR RLIM_INFINITY |
#define | F_OK 0 |
#define | X_OK 0x01 |
#define | W_OK 0x02 |
#define | R_OK 0x04 |
#define | SEEK_SET 0 |
#define | SEEK_CUR 1 |
#define | SEEK_END 2 |
#define | PT_TRACE_ME 0 |
#define | PT_READ_I 1 |
#define | PT_READ_D 2 |
#define | PT_WRITE_I 4 |
#define | PT_WRITE_D 5 |
#define | PT_CONTINUE 7 |
#define | PT_KILL 8 |
#define | PT_ATTACH 9 |
#define | PT_DETACH 10 |
#define | PT_IO 11 |
#define | IO_SETSIZE 65536 |
#define | NBITS (sizeof (u_long) * NBBY) |
#define | IO_CLR(n, p) ((p)->masks[(n)/NBITS] &= ~(1 << ((n) % NBITS))) |
#define | IO_SET(n, p) ((p)->masks[(n)/NBITS] |= (1 << ((n) % NBITS))) |
#define | IO_ISSET(n, p) ((p)->masks[(n)/NBITS] & (1 << ((n) % NBITS))) |
#define | PRIORITY_DFLT 0 |
#define | SIGF_TRIGGERED (1<<1u) |
#define | SIGF_IGN (1<<2u) |
#define | SIGF_NODFL (1<<3u) |
#define | SIGCTX(Usig, Sig) ((Usig)->sigctxs[(Sig)-1]) |
#define | NGROUPS 16 |
#define | MAXTCBNAME 15 |
#define | OFF_CPU -1 |
#define | UNDEF_CPU -2 |
#define | CPU_ANY -1 |
#define | TCBS_IDLE 0 |
#define | TCBS_RUN 1 |
#define | TCBS_SLEEP 2 |
#define | TCBS_STOP 3 |
#define | TCBS_ZOMBIE 4 |
#define | TCBS_DEAD 5 |
#define | TCBC_UNDEF 0 |
#define | TCBC_SCHED 1 |
#define | TCBC_SERVICE 2 |
#define | TCBC_REALTIME 3 |
#define | TCBC_KERNEL 4 |
#define | TCBF_ONPROC (1<<0u) |
#define | TCBF_TRACED (1<<1u) |
#define | TCBF_SIGNALABLE (1<<2u) |
#define | TCBF_RUNQ (1<<3u) |
#define | TCBF_IOMAP (1<<4u) |
#define | TCBF_PAUSEMASK (1<<5u) |
#define | TCBF_WAITINFO (1<<6u) |
#define | TCBF_PTRACED (1<<7u) |
#define | TCBF_WAITDONE (1<<8u) |
#define | TCBF_COLLECTDONE (1<<9u) |
#define | TCB_EXPORT |
#define | BSTRAP_PID ((pid_t)0LL) |
#define | KERNEL_PID ((pid_t)1LL) |
#define | KERNEL_ASID ((asid_t)0LL) |
#define | NO_ASID ((asid_t)-1LL) |
#define | PROCDEF_ONGDT (1<<0u) |
#define | _W_INT(w) (*(int *)(void *)&(w)) |
#define | WCOREFLAG 0200 |
#define | _WSTATUS(x) (_W_INT(x) & 0177) |
#define | _WSTOPPED 0177 |
#define | WIFSTOPPED(x) (_WSTATUS(x) == _WSTOPPED) |
#define | WSTOPSIG(x) ((int)(((unsigned int)_W_INT(x)) >> 8) & 0xff) |
#define | WIFSIGNALED(x) (_WSTATUS(x) != _WSTOPPED && _WSTATUS(x) != 0) |
#define | WTERMSIG(x) (_WSTATUS(x)) |
#define | WIFEXITED(x) (_WSTATUS(x) == 0) |
#define | WEXITSTATUS(x) ((int)(((unsigned int)_W_INT(x)) >> 8) & 0xff) |
#define | WCOREDUMP(x) (_W_INT(x) & WCOREFLAG) |
#define | W_EXITCODE(ret, sig) ((ret) << 8 | (sig)) |
#define | W_STOPCODE(sig) ((sig) << 8 | _WSTOPPED) |
#define | WNOHANG 0x00000001 |
#define | WUNTRACED 0x00000002 |
#define | WALTSIG 0x00000004 |
#define | WALLSIG 0x00000008 |
#define | w_termsig w_T.w_Termsig |
#define | w_coredump w_T.w_Coredump |
#define | w_retcode w_T.w_Retcode |
#define | w_stopval w_S.w_Stopval |
#define | w_stopsig w_S.w_Stopsig |
#define | WSTOPPED _WSTOPPED |
#define | SET_SYS_RETURN(Tcb, Val, Errno, Suberrno) |
#define | SYS_RETURN(Tcb, Val, Errno, Suberrno) |
#define | SYS_ARG1(Tcb) ((Tcb)->tss.ebx) |
#define | SYS_ARG2(Tcb) ((Tcb)->tss.ecx) |
#define | SYS_ARG3(Tcb) ((Tcb)->tss.edx) |
#define | SYS_ARG4(Tcb) ((Tcb)->tss.esi) |
#define | SYS_ARG5(Tcb) ((Tcb)->tss.edi) |
Typedefs | |
typedef s_as_export | t_as |
typedef s_tcb_export | t_tcb |
Enumerations | |
enum | { SHARED_RW, SHARED_RO } |
|
|
|
|
|
|
|
|
|
Value: how many processes are on me |
|
security is activated |
|
space is in runq |
|
constant usable in (most of) all asid syscalls |
|
address space operations attach to address space |
|
detach from address space |
|
non-destructive attach |
|
asreg(2) options create aspace with BPT |
|
|
|
run on any cpu |
|
params of rcr3(2) return cr3 of caller |
|
return system cr3 |
|
access function test for existence of file |
|
|
|
|
|
|
|
|
|
|
|
|
|
area is reserved |
|
_krele(2) options only ring0 could use this |
|
only ring0 could use this |
|
area contains an address space |
|
area is simple memory |
|
area contains a memory record |
|
area contains a tcb |
|
kern area types undefined |
|
|
|
get only removable entries |
|
get only virtual (user) entries |
|
area modes and options undefined mode |
|
|
|
|
|
|
|
off cpu |
|
area is reserved |
|
shared read only |
|
area is shared |
|
defines an aggregate |
|
|
|
|
|
readable for group |
|
writable for group |
|
readable for world |
|
writable for world |
|
area is not removed after prele |
|
area will contain system info |
|
readable for user |
|
writable for user |
|
consider entire aggregate |
|
_prele(2) options don't clean physical page |
|
release persistent pages |
|
only ring0 could use this |
|
ignore asid param (root) |
|
|
|
proc is on gdt |
|
reserve memory anywhere |
|
attach to running process |
|
continue the child |
|
detach from running process |
|
do I/O to/from the stopped process |
|
kill the child process |
|
read word in child's D space |
|
read word in child's I space |
|
ptrace() values child declares it's being traced |
|
write word in child's D space |
|
write word in child's I space |
|
test for read permission |
|
no limit |
|
number of resource limits |
|
unrepresentable soft limit |
|
unrepresentable hard limit |
|
core file size |
|
Resource limits cpu time in milliseconds |
|
data size |
|
maximum file size |
|
locked-in-memory address space |
|
number of open files |
|
number of processes |
|
resident set size |
|
stack size |
|
destroy address space |
|
run specified selector |
|
destroy process |
|
set offset to current + offset |
|
set offset to EOF plus offset |
|
whence values for lseek(2) set offset to offset |
|
Value: do {\ (Tcb)->tss.eax = (Val);\ (Tcb)->tss.ebx = (Errno);\ (Tcb)->tss.ecx = (Suberrno);\ } while (/*CONSTCOND*/0) |
|
|
|
true if signal is ignored |
|
true if action is not default |
|
true if context is active |
|
kernel space |
|
physical space |
|
my virtual aspace |
|
sys0 physical space |
|
sys1 physical space |
|
|
|
|
|
|
|
|
|
|
|
Value: do {\ SET_SYS_RETURN((Tcb), (Val), (Errno), (Suberrno));\ return ;\ } while (/*CONSTCOND*/0) |
|
Value: statistics |
|
|
|
|
|
|
|
|
|
|
|
notify_mgr has collected |
|
a iomap follows |
|
task is on a processor |
|
restore pausemask |
|
task is ptraced |
|
task is in runq |
|
task is signalable |
|
task is traced |
|
parent has waited (if notify_mgr here) |
|
some info is present for wait(2) |
|
task is dead |
|
being created or not scheduled |
|
scheduled task |
|
process is paused |
|
process is stopped |
|
task is about do die |
|
cpu info not updated |
|
area is reserved |
|
area is mapped |
|
area isnt removed after vunmap |
|
_vrele(2) options only ring0 could use this |
|
reserve memory anywhere |
|
rsv memory anywhere above 1Mo |
|
_vunmap(2) options only ring0 could use this |
|
|
|
|
|
test for write permission |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
test for exec or srch perm |
|
|
|
|
|
|