/* Start the ball rolling. */
struct boot_image *ip; /* boot image pointer */
register struct proc *rp; /* process pointer */
- register struct priv *sp; /* privilege structure pointer */
register int i, j;
int hdrindex; /* index to array of a.out headers */
phys_clicks text_base;
DEBUGEXTRA(("main()\n"));
- /* Clear the process table. Anounce each slot as empty and set up mappings
- * for proc_addr() and proc_nr() macros. Do the same for the table with
- * privilege structures for the system processes.
- */
- for (rp = BEG_PROC_ADDR, i = -NR_TASKS; rp < END_PROC_ADDR; ++rp, ++i) {
- rp->p_rts_flags = RTS_SLOT_FREE; /* initialize free slot */
- rp->p_magic = PMAGIC;
- rp->p_nr = i; /* proc number from ptr */
- rp->p_endpoint = _ENDPOINT(0, rp->p_nr); /* generation no. 0 */
- rp->p_scheduler = NULL; /* no user space scheduler */
- rp->p_priority = 0; /* no priority */
- rp->p_quantum_size_ms = 0; /* no quantum size */
- }
- for (sp = BEG_PRIV_ADDR, i = 0; sp < END_PRIV_ADDR; ++sp, ++i) {
- sp->s_proc_nr = NONE; /* initialize as free */
- sp->s_id = (sys_id_t) i; /* priv structure index */
- ppriv_addr[i] = sp; /* priv ptr from number */
- sp->s_sig_mgr = NONE; /* clear signal managers */
- sp->s_bak_sig_mgr = NONE;
- }
+ proc_init();
/* Set up proc table entries for processes in boot image. The stacks of the
* kernel tasks are initialized to an array in data space. The stacks
break; \
}
+PUBLIC void proc_init(void)
+{
+ struct proc * rp;
+ struct priv *sp;
+ int i;
+
+ /* Clear the process table. Anounce each slot as empty and set up
+ * mappings for proc_addr() and proc_nr() macros. Do the same for the
+ * table with privilege structures for the system processes.
+ */
+ for (rp = BEG_PROC_ADDR, i = -NR_TASKS; rp < END_PROC_ADDR; ++rp, ++i) {
+ rp->p_rts_flags = RTS_SLOT_FREE;/* initialize free slot */
+ rp->p_magic = PMAGIC;
+ rp->p_nr = i; /* proc number from ptr */
+ rp->p_endpoint = _ENDPOINT(0, rp->p_nr); /* generation no. 0 */
+ rp->p_scheduler = NULL; /* no user space scheduler */
+ rp->p_priority = 0; /* no priority */
+ rp->p_quantum_size_ms = 0; /* no quantum size */
+ }
+ for (sp = BEG_PRIV_ADDR, i = 0; sp < END_PRIV_ADDR; ++sp, ++i) {
+ sp->s_proc_nr = NONE; /* initialize as free */
+ sp->s_id = (sys_id_t) i; /* priv structure index */
+ ppriv_addr[i] = sp; /* priv ptr from number */
+ sp->s_sig_mgr = NONE; /* clear signal managers */
+ sp->s_bak_sig_mgr = NONE;
+ }
+}
+
/*===========================================================================*
* idle *
*===========================================================================*/
/* proc.c */
_PROTOTYPE( int do_ipc, (reg_t r1, reg_t r2, reg_t r3) );
+_PROTOTYPE( void proc_init, (void) );
_PROTOTYPE( int mini_notify, (const struct proc *src, endpoint_t dst) );
_PROTOTYPE( void enqueue, (struct proc *rp) );
_PROTOTYPE( void dequeue, (const struct proc *rp) );