src/kernel/proc.h File Reference

#include <minix/com.h>
#include <minix/portio.h>
#include "const.h"
#include "priv.h"

Go to the source code of this file.

Classes

struct  proc

Defines

#define VMSTYPE_SYS_NONE   0
#define VMSTYPE_KERNELCALL   1
#define VMSTYPE_DELIVERMSG   2
#define VMSTYPE_MAP   3
#define RTS_SLOT_FREE   0x01
#define RTS_PROC_STOP   0x02
#define RTS_SENDING   0x04
#define RTS_RECEIVING   0x08
#define RTS_SIGNALED   0x10
#define RTS_SIG_PENDING   0x20
#define RTS_P_STOP   0x40
#define RTS_NO_PRIV   0x80
#define RTS_NO_ENDPOINT   0x100
#define RTS_VMINHIBIT   0x200
#define RTS_PAGEFAULT   0x400
#define RTS_VMREQUEST   0x800
#define RTS_VMREQTARGET   0x1000
#define RTS_SYS_LOCK   0x2000
#define RTS_PREEMPTED   0x4000
#define RTS_NO_QUANTUM   0x8000
#define rts_f_is_runnable(flg)   ((flg) == 0)
#define proc_is_runnable(p)   (rts_f_is_runnable((p)->p_rts_flags))
#define proc_is_preempted(p)   ((p)->p_rts_flags & RTS_PREEMPTED)
#define proc_no_quantum(p)   ((p)->p_rts_flags & RTS_NO_QUANTUM)
#define RTS_ISSET(rp, f)   (((rp)->p_rts_flags & (f)) == (f))
#define RTS_SET(rp, f)
#define RTS_UNSET(rp, f)
#define RTS_LOCK_SET(rp, f)
#define RTS_LOCK_UNSET(rp, f)
#define RTS_LOCK_SETFLAGS(rp, f)
#define MF_REPLY_PEND   0x001
#define MF_VIRT_TIMER   0x002
#define MF_PROF_TIMER   0x004
#define MF_ASYNMSG   0x010
#define MF_FULLVM   0x020
#define MF_DELIVERMSG   0x040
#define MF_SIG_DELAY   0x080
#define MF_SC_ACTIVE   0x100
#define MF_SC_DEFER   0x200
#define MF_SC_TRACE   0x400
#define MF_USED_FPU   0x800
#define MF_FPU_INITIALIZED   0x1000
#define NR_SCHED_QUEUES   16
#define TASK_Q   0
#define MAX_USER_Q   0
#define USER_Q   (NR_SCHED_QUEUES / 2)
#define MIN_USER_Q   (NR_SCHED_QUEUES - 1)
#define BEG_PROC_ADDR   (&proc[0])
#define BEG_USER_ADDR   (&proc[NR_TASKS])
#define END_PROC_ADDR   (&proc[NR_TASKS + NR_PROCS])
#define NIL_PROC   ((struct proc *) 0)
#define NIL_SYS_PROC   ((struct proc *) 1)
#define cproc_addr(n)   (&(proc + NR_TASKS)[(n)])
#define proc_addr(n)   (&(proc[NR_TASKS + (n)]))
#define proc_nr(p)   ((p)->p_nr)
#define isokprocn(n)   ((unsigned) ((n) + NR_TASKS) < NR_PROCS + NR_TASKS)
#define isemptyn(n)   isemptyp(proc_addr(n))
#define isemptyp(p)   ((p)->p_rts_flags == RTS_SLOT_FREE)
#define iskernelp(p)   ((p) < BEG_USER_ADDR)
#define iskerneln(n)   ((n) < 0)
#define isuserp(p)   isusern((p) >= BEG_USER_ADDR)
#define isusern(n)   ((n) >= 0)
#define isrootsysn(n)   ((n) == ROOT_SYS_PROC_NR)

Variables

EXTERN struct proc proc [NR_TASKS+NR_PROCS]
EXTERN struct procrdy_head [NR_SCHED_QUEUES]
EXTERN struct procrdy_tail [NR_SCHED_QUEUES]


Define Documentation

#define BEG_PROC_ADDR   (&proc[0])

Definition at line 248 of file proc.h.

#define BEG_USER_ADDR   (&proc[NR_TASKS])

Definition at line 249 of file proc.h.

#define cproc_addr ( n   )     (&(proc + NR_TASKS)[(n)])

Definition at line 254 of file proc.h.

#define END_PROC_ADDR   (&proc[NR_TASKS + NR_PROCS])

Definition at line 250 of file proc.h.

#define isemptyn ( n   )     isemptyp(proc_addr(n))

Definition at line 259 of file proc.h.

#define isemptyp ( p   )     ((p)->p_rts_flags == RTS_SLOT_FREE)

Definition at line 260 of file proc.h.

#define iskerneln ( n   )     ((n) < 0)

Definition at line 262 of file proc.h.

#define iskernelp ( p   )     ((p) < BEG_USER_ADDR)

Definition at line 261 of file proc.h.

#define isokprocn ( n   )     ((unsigned) ((n) + NR_TASKS) < NR_PROCS + NR_TASKS)

Definition at line 258 of file proc.h.

#define isrootsysn ( n   )     ((n) == ROOT_SYS_PROC_NR)

Definition at line 265 of file proc.h.

#define isusern ( n   )     ((n) >= 0)

Definition at line 264 of file proc.h.

#define isuserp ( p   )     isusern((p) >= BEG_USER_ADDR)

Definition at line 263 of file proc.h.

#define MAX_USER_Q   0

Definition at line 241 of file proc.h.

#define MF_ASYNMSG   0x010

Definition at line 223 of file proc.h.

#define MF_DELIVERMSG   0x040

Definition at line 225 of file proc.h.

#define MF_FPU_INITIALIZED   0x1000

Definition at line 231 of file proc.h.

#define MF_FULLVM   0x020

Definition at line 224 of file proc.h.

#define MF_PROF_TIMER   0x004

Definition at line 222 of file proc.h.

#define MF_REPLY_PEND   0x001

Definition at line 220 of file proc.h.

#define MF_SC_ACTIVE   0x100

Definition at line 227 of file proc.h.

#define MF_SC_DEFER   0x200

Definition at line 228 of file proc.h.

#define MF_SC_TRACE   0x400

Definition at line 229 of file proc.h.

#define MF_SIG_DELAY   0x080

Definition at line 226 of file proc.h.

#define MF_USED_FPU   0x800

Definition at line 230 of file proc.h.

#define MF_VIRT_TIMER   0x002

Definition at line 221 of file proc.h.

#define MIN_USER_Q   (NR_SCHED_QUEUES - 1)

Definition at line 244 of file proc.h.

#define NIL_PROC   ((struct proc *) 0)

Definition at line 252 of file proc.h.

#define NIL_SYS_PROC   ((struct proc *) 1)

Definition at line 253 of file proc.h.

#define NR_SCHED_QUEUES   16

Definition at line 239 of file proc.h.

#define proc_addr ( n   )     (&(proc[NR_TASKS + (n)]))

Definition at line 255 of file proc.h.

#define proc_is_preempted ( p   )     ((p)->p_rts_flags & RTS_PREEMPTED)

Definition at line 155 of file proc.h.

#define proc_is_runnable ( p   )     (rts_f_is_runnable((p)->p_rts_flags))

Definition at line 153 of file proc.h.

#define proc_no_quantum ( p   )     ((p)->p_rts_flags & RTS_NO_QUANTUM)

Definition at line 156 of file proc.h.

#define proc_nr ( p   )     ((p)->p_nr)

Definition at line 256 of file proc.h.

#define rts_f_is_runnable ( flg   )     ((flg) == 0)

Definition at line 152 of file proc.h.

#define RTS_ISSET ( rp,
f   )     (((rp)->p_rts_flags & (f)) == (f))

Definition at line 160 of file proc.h.

#define RTS_LOCK_SET ( rp,
f   ) 

Value:

do {                                                            \
                int u = 0;                                              \
                if(!intr_disabled()) { u = 1; lock; }                   \
                if(proc_is_runnable(rp)) { dequeue(rp); }               \
                (rp)->p_rts_flags |=  (f);                              \
                if(u) { unlock; }                                       \
        } while(0)

Definition at line 186 of file proc.h.

#define RTS_LOCK_SETFLAGS ( rp,
f   ) 

Value:

do {                                                            \
                int u = 0;                                              \
                if(!intr_disabled()) { u = 1; lock; }                   \
                if(proc_is_runnable(rp) && (f)) { dequeue(rp); }                \
                (rp)->p_rts_flags = (f);                                \
                if(u) { unlock; }                                       \
        } while(0)

Definition at line 210 of file proc.h.

#define RTS_LOCK_UNSET ( rp,
f   ) 

Value:

do {                                                            \
                int rts;                                                \
                int u = 0;                                              \
                if(!intr_disabled()) { u = 1; lock; }                   \
                rts = (rp)->p_rts_flags;                                \
                (rp)->p_rts_flags &= ~(f);                              \
                if(!rts_f_is_runnable(rts) && proc_is_runnable(rp)) {   \
                        enqueue(rp);                                    \
                }                                                       \
                if(u) { unlock; }                                       \
        } while(0)

Definition at line 196 of file proc.h.

#define RTS_NO_ENDPOINT   0x100

Definition at line 133 of file proc.h.

#define RTS_NO_PRIV   0x80

Definition at line 132 of file proc.h.

#define RTS_NO_QUANTUM   0x8000

Definition at line 146 of file proc.h.

#define RTS_P_STOP   0x40

Definition at line 131 of file proc.h.

#define RTS_PAGEFAULT   0x400

Definition at line 135 of file proc.h.

#define RTS_PREEMPTED   0x4000

Definition at line 139 of file proc.h.

#define RTS_PROC_STOP   0x02

Definition at line 126 of file proc.h.

#define RTS_RECEIVING   0x08

Definition at line 128 of file proc.h.

#define RTS_SENDING   0x04

Definition at line 127 of file proc.h.

#define RTS_SET ( rp,
f   ) 

Value:

do {                                                            \
                vmassert(intr_disabled());                              \
                if(proc_is_runnable(rp)) { dequeue(rp); }               \
                (rp)->p_rts_flags |=  (f);                              \
                vmassert(intr_disabled());                              \
        } while(0)

Definition at line 164 of file proc.h.

#define RTS_SIG_PENDING   0x20

Definition at line 130 of file proc.h.

#define RTS_SIGNALED   0x10

Definition at line 129 of file proc.h.

#define RTS_SLOT_FREE   0x01

Definition at line 125 of file proc.h.

#define RTS_SYS_LOCK   0x2000

Definition at line 138 of file proc.h.

#define RTS_UNSET ( rp,
f   ) 

Value:

do {                                                            \
                int rts;                                                \
                vmassert(intr_disabled());                              \
                rts = (rp)->p_rts_flags;                                \
                (rp)->p_rts_flags &= ~(f);                              \
                if(!rts_f_is_runnable(rts) && proc_is_runnable(rp)) {   \
                        enqueue(rp);                                    \
                }                                                       \
                vmassert(intr_disabled());                              \
        } while(0)

Definition at line 173 of file proc.h.

#define RTS_VMINHIBIT   0x200

Definition at line 134 of file proc.h.

#define RTS_VMREQTARGET   0x1000

Definition at line 137 of file proc.h.

#define RTS_VMREQUEST   0x800

Definition at line 136 of file proc.h.

#define TASK_Q   0

Definition at line 240 of file proc.h.

#define USER_Q   (NR_SCHED_QUEUES / 2)

Definition at line 242 of file proc.h.

#define VMSTYPE_DELIVERMSG   2

Definition at line 72 of file proc.h.

#define VMSTYPE_KERNELCALL   1

Definition at line 71 of file proc.h.

#define VMSTYPE_MAP   3

Definition at line 73 of file proc.h.

#define VMSTYPE_SYS_NONE   0

Definition at line 70 of file proc.h.


Variable Documentation

EXTERN struct proc proc[NR_TASKS+NR_PROCS]

Definition at line 274 of file proc.h.

EXTERN struct proc* rdy_head[NR_SCHED_QUEUES]

Definition at line 275 of file proc.h.

EXTERN struct proc* rdy_tail[NR_SCHED_QUEUES]

Definition at line 276 of file proc.h.


Generated on Tue Mar 9 04:36:57 2010 for Minix by  doxygen 1.5.8