KERNEL OBJECTS - PROCESSES
Processes are a virtual memory context that threads execute in.
The source file for processes is in oz_knl_process.c.
Each process has the following properties:
- unique id number
- reference count (process gets deleted when this goes zero)
- handle table
- list of threads
- job it belongs to
- list of images loaded in the process
- process logical name directory
- process logical name table
- page table list
- security attributes (who can do things to this process)
- name
- hardware context (like pagetable pointers, etc)
These methods are defined:
- uLong oz_knl_process_create (OZ_Job *job, int sysproc, int copyproc, int name_l, const char *name, OZ_Secattr *secattr, OZ_Process **process_r)
- create a process
- int oz_knl_process_cleanup (OZ_Process *process)
- clean up process (called after last thread has exited)
- Long oz_knl_process_increfc (OZ_Process *process, Long inc)
- increment/decrement process' reference count
- void oz_knl_process_setcur (OZ_Process *process)
- set process being mapped by the calling cpu
- OZ_Process *oz_knl_process_getcur (void)
- get process currently mapped by the calling cpu
- OZ_Thread **oz_knl_process_getthreadqp (OZ_Process *process, int ifnormal)
- get pointer to thread queue
- OZ_Job *oz_knl_process_getjob (OZ_Process *process)
- get job the process is in
- const char *oz_knl_process_getname (OZ_Process *process)
- get process name string
- OZ_Process *oz_knl_process_getnext (OZ_Process *lastprocess, OZ_Job *job)
- get first/next process in a job
- uLong oz_knl_process_count (OZ_Job *job)
- get number of processes in a job
- OZ_Processid oz_knl_process_getid (OZ_Process *process)
- get a process's id number
- OZ_Process *oz_knl_process_frompid (OZ_Processid pid)
- get a process pointer given its id number
- OZ_Logname *oz_knl_process_getlognamdir (OZ_Process *process)
- get process' logical name directory
- OZ_Logname *oz_knl_process_getlognamtbl (OZ_Process *process)
- get process' logical name table
- OZ_Secattr *oz_knl_process_getsecattr (OZ_Process *process)
- get process' security attributes
- OZ_Imagelist *oz_knl_process_getimagelist (OZ_Process *process)
- get process' image list
- void *oz_knl_process_gethwctx (OZ_Process *process)
- get process' hardware context block pointer
- OZ_Handletbl *oz_knl_process_gethandletbl (OZ_Process *process)
- get process' handle table pointer
- uLong oz_knl_process_createpagetable (OZ_Process *process,
OZ_Pagetable_expand expand,
OZ_Mempage maxpages,
OZ_Mempage vpage)
- create a pagetable in a process
- void oz_knl_process_deletepagetable (OZ_Mempage vpage)
- delete a pagetable from current process
- uLong oz_knl_process_mapsection (OZ_Section *section,
OZ_Mempage *npagem,
OZ_Mempage *svpage,
uLong mapsecflag,
OZ_Procmode ownermode,
OZ_Hw_pageprot pageprot)
- map a section to current process
- uLong oz_knl_process_mapsections (uLong mapsecflags,
int nsections,
OZ_Mapsecparam *mapsecparams)
- map a list of sections to current process
- uLong oz_knl_process_unmapsec (OZ_Mempage vpage)
- unmap a section from current process
- OZ_Mempage oz_knl_process_getsecfromvpage (OZ_Process *process,
OZ_Mempage vpage,
OZ_Section **section,
OZ_Mempage *pageoffs,
OZ_Hw_pageprot *pageprot,
OZ_Procmode *procmode,
uLong *mapsecflags)
- find out what section is mapped to the given process at the given virtual page number
- uLong oz_knl_process_lockpt (OZ_Process *process)
- lock a process' pagetables
- void oz_knl_process_unlkpt (OZ_Process *process, uLong pt)
- unlock a process' pagetables
- OZ_Seclock **oz_knl_process_seclocks (OZ_Process *process, OZ_Mempage npages, OZ_Mempage svpage)
- get listhead for sections locked at a given virtual address in a given process
- int oz_knl_process_nseclocks (OZ_Process *process, OZ_Mempage vpage, int inc)
- increment number of times a section has been locked to the given virtual page of the given process
- OZ_Seclkwz **oz_knl_process_seclkwzs (OZ_Process *process, OZ_Mempage vpage)
- get listhead for waiting-for-zero locks at a given virtual address in a given process
- int oz_knl_process_nseclkwzs (OZ_Process *process, OZ_Mempage vpage, int inc)
- increment number of times waiting-for-zero locks to the given virtual page of the given process
- uLong oz_knl_process_lockps (OZ_Process *process)
- lock a process' state data
- void oz_knl_process_unlkps (OZ_Process *process, uLong ps)
- unlock a process' state data