#include <acbdef.h>
#include <far_pointers.h>
#include <mtxdef.h>
#include <mutexdef.h>
#include <pcbdef.h>
#include <linux/spinlock.h>
Go to the source code of this file.
Functions | |
int | sch_add_cpu_cap (uint32 cpu_id, uint32 mask, UINT64_PQ prev_mask_p) |
add cpu capabilities - see 7.0 2.5 | |
int | sch_clear_affinity (uint32 cpu_mask, struct _ktb *ktb, uint32 flags, UINT64_PQ prev_mask_p) |
int | sch_clear_capability (struct _ktb *ktb, uint32 mask, uint32 cpu_id, uint32 flags, UINT64_PQ prev_mask_p) |
void | sch_wait_kernel_mode (void) |
void | sch_wait_proc (struct _ktb *wait_queue, struct _ktb *ktb) |
void | sch_resource_wait (struct _ktb *const ktb, const uint32 rsn) |
void | sch_resource_wait_ps (struct _ktb *const ktb, const uint32 rsn, const uint32 psl) |
int | sch_resource_wait_setup (struct _ktb *const ktb, const uint32 rsn) |
int | sch_remove_cpu_cap (uint32 cpu_id, uint32 mask, UINT64_PQ prev_mask_p) |
remove cpu capabilities - see 5.2 12.5.4 or 7.0 2.5 | |
int | sch_set_affinity (uint32 cpu_mask, struct _ktb *ktb, uint32 flags, UINT64_PQ prev_mask_p) |
int | sch_set_capability (struct _ktb *ktb, uint32 mask, uint32 cpu_id, uint32 flags, UINT64_PQ prev_mask_p) |
int | sch_acquire_implicit_affinity (struct _ktb *ktb, int obsolete, int cpu_id) |
int | sch_release_implicit_affinity (struct _ktb *ktb) |
int | sch_std_clrefr (int efn, struct _pcb *pcb) |
struct _mutex * | sch_std_iolockr (struct _pcb *pcb) |
struct _mutex * | sch_std_iolockw (struct _pcb *pcb) |
void | sch_std_iounlock (struct _pcb *pcb) |
void | sch_std_lockr (struct _mtx *mtx, struct _pcb *pcb) |
void | sch_std_lockr_quad (struct _mutex *mutex, struct _pcb *pcb) |
int | sch_std_lockrexec (struct _mtx *mtx) |
int | sch_std_lockrexec_quad (struct _mutex *mutex) |
void | sch_std_lockw (struct _mtx *mtx, struct _pcb *pcb) |
int | sch_std_lockwexec (struct _mtx *mtx) |
int | sch_std_lockwexec_quad (struct _mutex *mutex) |
int | sch_std_lockwnowait (struct _mtx *mtx, struct _pcb *pcb) |
int | sch_std_lockwnowait_quad (struct _mutex *mutex, struct _pcb *pcb) |
int | sch_std_postef (int ipid, int incpri, int efn, struct _pcb **pcb_p) |
int | sch_std_qast (int incpri, struct _acb *acb, struct _pcb **pcb_p) |
void | sch_std_ravail (int rsn) |
resource available | |
void | sch_std_unlock (struct _mtx *mtx, struct _pcb *pcb) |
void | sch_std_unlockexec (struct _mtx *mtx) |
void | sch_std_unlockexec_quad (struct _mutex *mutex) |
int | sch_std_wake (int ipid, struct _pcb **pcb_p) |
void | sch_rse (struct _pcb *p, unsigned char class, unsigned char event) |
void | sch_change_cur_priority (struct _pcb *p, unsigned char newpri) |
int | sch_wait (struct _pcb *p, struct _wqh *wq) |
int | sch_waitl (struct _pcb *p, struct _wqh *wq) |
void | sch_wake (unsigned long pid) |
set wake and report it - see 5.2 13.3.1 | |
void | sch_swpwake (void) |
int | sch_qast (unsigned long pid, int priclass, struct _acb *a) |
queuing an ast to a process - see 5.2 7.4 | |
void | sch_one_sec (void) |
run once in a sec | |
int | sch_postef (unsigned long ipid, unsigned long priclass, unsigned long efn) |
setting an event flag - see 5.2 9.7 | |
void | sch_newlvl (struct _pcb *p) |
void | sch_lockw (struct _mtx *m) |
mutex for writing - see 5.2 8.5.2 | |
void | sch_iolockw (void) |
void | sch_unlockw (struct _mtx *m) |
void | sch_unlock (struct _mtx *m) |
unlocking a mutex - see 5.2 8.5.4 | |
void | sch_iounlockw (void) |
void | sch_iounlock (void) |
void | sch_chsep (struct _pcb *p, unsigned char newpri) |
void | sch_chse (struct _pcb *p, unsigned char class) |
change pri state etc according to priclass etc - see 5.2 12.5.5 | |
void | sch_chsep2 (struct _pcb *p, unsigned char newpri) |
int | sch_calculate_affinity (int mask) |
int | sch_acquire_affinity (struct _pcb *pcb, int obsolete, int cpu_id) |
acquire affinity - see 5.2 12.5.4 or 7.0 2.5.4 | |
int | sch_release_affinity (struct _pcb *pcb) |
release (acquire in reverse) affinity - see 7.0 2.5.4 |
int sch_acquire_affinity | ( | struct _pcb * | pcb, | |
int | obsolete, | |||
int | cpu_id | |||
) |
acquire affinity - see 5.2 12.5.4 or 7.0 2.5.4
use affinity_skip from global (non-7.0 member) TODO check if used
note that pcb capability is not 7.0
set implicit affinity flag
store cpu_id in ktb bias_cell, probably pcb affinity, TODO both?
if current pcb
do resched interrupt or send one to other cpu
Definition at line 133 of file capability.c.
References CPU_M_RESCHED, ctl_gl_pcb, smp_send_work(), and SS__NORMAL.
Referenced by exe_set_implicit_affinity().
int sch_acquire_implicit_affinity | ( | struct _ktb * | ktb, | |
int | obsolete, | |||
int | cpu_id | |||
) |
add cpu capabilities - see 7.0 2.5
increase capability sequence
Definition at line 51 of file capability.c.
References sch_al_cpu_cap, sch_gl_capability_sequence, smp_gl_cpu_data, and SS__NORMAL.
Referenced by exe_cpu_capabilities(), and vms_init().
int sch_calculate_affinity | ( | int | mask | ) |
void sch_change_cur_priority | ( | struct _pcb * | p, | |
unsigned char | newpri | |||
) |
void sch_chse | ( | struct _pcb * | p, | |
unsigned char | class | |||
) |
change pri state etc according to priclass etc - see 5.2 12.5.5
do pri adjustments
Definition at line 285 of file rse.c.
References PRI__IOCOM, PRI__NULL, PRI__RESAVL, PRI__TICOM, PRI__TIMER, PRI__TOCOM, and sch_chsep().
Referenced by exe_creprc(), sch_rse(), sch_std_ravail(), and sch_unlock().
void sch_chsep | ( | struct _pcb * | p, | |
unsigned char | newpri | |||
) |
void sch_chsep2 | ( | struct _pcb * | p, | |
unsigned char | newpri | |||
) |
Definition at line 628 of file rse.c.
References _pcb, mycheckaddr(), sch_aq_comh, sch_aq_comt, sch_gl_comqs, SPIN_SCHED, and _spl::spl_l_spinlock.
Referenced by sch_chse2().
int sch_clear_capability | ( | struct _ktb * | ktb, | |
uint32 | mask, | |||
uint32 | cpu_id, | |||
uint32 | flags, | |||
UINT64_PQ | prev_mask_p | |||
) |
void sch_iolockw | ( | void | ) |
Definition at line 140 of file mutex.c.
References sch_lockw().
Referenced by exe_assign(), exe_crembx(), and exe_dassgn().
void sch_iounlock | ( | void | ) |
Definition at line 203 of file mutex.c.
References sch_unlockw().
Referenced by exe_assign(), and exe_dassgn().
void sch_iounlockw | ( | void | ) |
void sch_lockw | ( | struct _mtx * | m | ) |
mutex for writing - see 5.2 8.5.2
m | mutex |
spinlock sched
test and set mutex write flag
if set, no further readers or writers allowed, stall process
if no other owners
own it is done by incrementing owncnt and mtxcnt
if it is the first to be locked
then record current priorities in pcb
TODO check if saved right with regard to realtime
if not realtime process, boost priority
if other owners, stall
release spinlock
Definition at line 55 of file mutex.c.
References _pcb, ctl_gl_pcb, IPL__ASTDEL, IPL__SCHED, _mtx::mtx_w_owncnt, mutexwait(), sch_change_cur_priority(), and SPIN_SCHED.
Referenced by lnm_lock(), lnm_lockr(), lnm_lockw(), and sch_iolockw().
void sch_newlvl | ( | struct _pcb * | p | ) |
void sch_one_sec | ( | void | ) |
run once in a sec
mainly run pixscan
Definition at line 551 of file rse.c.
References sch_pixscan().
Referenced by exe_timeout().
int sch_postef | ( | unsigned long | ipid, | |
unsigned long | priclass, | |||
unsigned long | efn | |||
) |
setting an event flag - see 5.2 9.7
ipid | internal process id | |
priclass | at which priority class | |
efn | event flag number |
sched spinlock
does process still exist
test event flag legality
if non-common event flag
test if set
wait satisfied?
common event flag
locate ceb
wait satisfied?
unlock sched spinlock
Definition at line 86 of file postef.c.
References _pcb, _ceb::ceb_l_wqfl, efc, efcc, exe_ipid_to_pcb(), getefc(), getefcno(), getefcp(), IPL__SYNCH, SPIN_SCHED, SS__ILLEFC, SS__NONEXPR, SS__UNASEFC, SS__WASCLR, SS__WASSET, waitcheck(), and waitcheck2().
Referenced by bufpost(), exe_getdvi(), exe_getjpi(), exe_getsyi(), exe_qio(), exe_setef(), exe_swtimint(), ioc_iopost(), and lck_grant_lock().
int sch_qast | ( | unsigned long | pid, | |
int | priclass, | |||
struct _acb * | a | |||
) |
queuing an ast to a process - see 5.2 7.4
pid | the process id | |
priclass | priority class | |
a | ast control block |
spinlock sched
does the process exist
if nodelete clear deallocate - missing
scan the ast list
TODO: check if sort according to mode
insert ast in the queue
calculate astlvl
choose first and innermost level from queue - MISSING
handle current on same and other cpu - MISSING
handle outswapped - MISSING
unless current process, invoke sch_rse
otherwise make the process computable
TODO: check smp
release spinlock
Definition at line 75 of file astdel.c.
References _pcb, _acb::acb_b_rmod, _acb::acb_l_ast, _acb::acb_l_astqbl, _acb::acb_l_astqfl, _acb::acb_l_kast, _cpu::cpu_l_curpcb, CPU_M_UPDASTSR, ctl_gl_pcb, exe_ipid_to_pcb(), IPL__SYNCH, sch_rse(), smp_gl_cpu_data, smp_send_work(), SPIN_SCHED, SS__NONEXPR, and SS__NORMAL.
Referenced by bufpost(), exe_dclast(), exe_forcex(), exe_qioqxqppkt(), exe_swtimint(), fork_routine(), fork_routine2(), ioc_iopost(), lck_grant_lock(), lock_iosb_kast(), and maybe_blkast().
int sch_release_affinity | ( | struct _pcb * | pcb | ) |
release (acquire in reverse) affinity - see 7.0 2.5.4
note that pcb capability is not 7.0
clear implicit affinity flag
Definition at line 158 of file capability.c.
References SS__NORMAL.
Referenced by exe_set_implicit_affinity().
int sch_release_implicit_affinity | ( | struct _ktb * | ktb | ) |
int sch_remove_cpu_cap | ( | unsigned int | cpu_id, | |
unsigned int | mask, | |||
UINT64_PQ | prev_mask_p | |||
) |
remove cpu capabilities - see 5.2 12.5.4 or 7.0 2.5
as add, but in reverse maybe it has need for rescheduling too
clear cpu-data cpu capability bit
and clear the corresponding bit in cpu_cap table
increment capability sequence to indicate a change
get current pcb and compare its mask
do resched interrupt or send one to other cpu
Definition at line 96 of file capability.c.
References _pcb, CPU_M_RESCHED, ctl_gl_pcb, sch_al_cpu_cap, sch_gl_capability_sequence, smp_gl_cpu_data, smp_send_work(), and SS__NORMAL.
Referenced by exe_cpu_capabilities().
void sch_resource_wait | ( | struct _ktb *const | ktb, | |
const uint32 | rsn | |||
) |
int sch_resource_wait_setup | ( | struct _ktb *const | ktb, | |
const uint32 | rsn | |||
) |
void sch_rse | ( | struct _pcb * | p, | |
unsigned char | class, | |||
unsigned char | event | |||
) |
int sch_set_capability | ( | struct _ktb * | ktb, | |
uint32 | mask, | |||
uint32 | cpu_id, | |||
uint32 | flags, | |||
UINT64_PQ | prev_mask_p | |||
) |
int sch_std_clrefr | ( | int | efn, | |
struct _pcb * | pcb | |||
) |
struct _mutex* sch_std_iolockr | ( | struct _pcb * | pcb | ) | [read] |
struct _mutex* sch_std_iolockw | ( | struct _pcb * | pcb | ) | [read] |
void sch_std_iounlock | ( | struct _pcb * | pcb | ) |
void sch_std_lockr | ( | struct _mtx * | mtx, | |
struct _pcb * | pcb | |||
) |
void sch_std_lockr_quad | ( | struct _mutex * | mutex, | |
struct _pcb * | pcb | |||
) |
int sch_std_lockrexec | ( | struct _mtx * | mtx | ) |
int sch_std_lockrexec_quad | ( | struct _mutex * | mutex | ) |
void sch_std_lockw | ( | struct _mtx * | mtx, | |
struct _pcb * | pcb | |||
) |
int sch_std_lockwexec | ( | struct _mtx * | mtx | ) |
int sch_std_lockwexec_quad | ( | struct _mutex * | mutex | ) |
int sch_std_lockwnowait | ( | struct _mtx * | mtx, | |
struct _pcb * | pcb | |||
) |
int sch_std_lockwnowait_quad | ( | struct _mutex * | mutex, | |
struct _pcb * | pcb | |||
) |
int sch_std_postef | ( | int | ipid, | |
int | incpri, | |||
int | efn, | |||
struct _pcb ** | pcb_p | |||
) |
int sch_std_qast | ( | int | incpri, | |
struct _acb * | acb, | |||
struct _pcb ** | pcb_p | |||
) |
void sch_std_ravail | ( | int | rsn | ) |
resource available
Definition at line 212 of file mutex.c.
References _pcb, IPL__MAILBOX, sch_chse(), sch_gl_resmask, sch_gq_mwait, SPIN_SCHED, _wqh::wqh_l_wqcnt, and _wqh::wqh_l_wqfl.
Referenced by bufpost(), and create_fork_thread().
void sch_std_unlock | ( | struct _mtx * | mtx, | |
struct _pcb * | pcb | |||
) |
void sch_std_unlockexec | ( | struct _mtx * | mtx | ) |
void sch_std_unlockexec_quad | ( | struct _mutex * | mutex | ) |
int sch_std_wake | ( | int | ipid, | |
struct _pcb ** | pcb_p | |||
) |
void sch_swpwake | ( | void | ) |
void sch_unlock | ( | struct _mtx * | m | ) |
unlocking a mutex - see 5.2 8.5.4
m | mutex |
spinlock sched
decrement mtxcnt
if process does not own anymore, restore pris and change pri
TODO check if all saved are restore, and TODO check realtime
decrement owncnt
if no other owners
bbcci, test and clear write bit
if a writer had it
scan misc wait queue
search for those waiting for the now unlocked mutex
when found
decrease wqueue count
schedule that process
release spinlock
Definition at line 150 of file mutex.c.
References _pcb, ctl_gl_pcb, IPL__SCHED, _mtx::mtx_w_owncnt, sch_change_cur_priority(), sch_chse(), sch_gq_mwait, SPIN_SCHED, _wqh::wqh_l_wqcnt, and _wqh::wqh_l_wqfl.
Referenced by sch_unlockw().
void sch_unlockw | ( | struct _mtx * | m | ) |
Definition at line 194 of file mutex.c.
References sch_unlock().
Referenced by lnm_unlock(), lnm_unlockr(), lnm_unlockw(), sch_iounlock(), and sch_iounlockw().
int sch_wait | ( | struct _pcb * | p, | |
struct _wqh * | wq | |||
) |
Definition at line 623 of file rse.c.
References sch_waitk().
Referenced by exe_hiber(), exe_std_iorsnwait(), and exe_wait().
void sch_wait_kernel_mode | ( | void | ) |
void sch_wait_proc | ( | struct _ktb * | wait_queue, | |
struct _ktb * | ktb | |||
) |
int sch_waitl | ( | struct _pcb * | p, | |
struct _wqh * | wq | |||
) |
Definition at line 592 of file rse.c.
References sch_waitm().
Referenced by mutexwait(), and sch_waitk().
void sch_wake | ( | unsigned long | pid | ) |
set wake and report it - see 5.2 13.3.1
set pending wake flag
report wake scheduling event
Definition at line 318 of file rse.c.
References _pcb, exe_ipid_to_pcb(), and sch_rse().
Referenced by exe_qioacppkt(), exe_swtimint(), exe_wake(), and sch_swpwake().