Fixed some uninitialized problems.
phys_clicks old_base;
do {
+ prev_ptr = NIL_HOLE;
hp = hole_head;
while (hp != NIL_HOLE && hp->h_base < swap_base) {
if (hp->h_len >= clicks) {
}
/* Block to be returned does not go on front of hole list. */
+ prev_ptr = NIL_HOLE;
while (hp != NIL_HOLE && base > hp->h_base) {
prev_ptr = hp;
hp = hp->h_next;
*/
int i;
register struct hole *hp;
- phys_clicks base; /* base address of chunk */
- phys_clicks size; /* size of chunk */
- message mess;
/* Put all holes on the free list. */
for (hp = &hole[0]; hp < &hole[NR_HOLES]; hp++) hp->h_next = hp + 1;
size >>= CLICK_SHIFT;
if (size > swap_maxsize) size = swap_maxsize;
if (size > 0) free_mem(swap_base, (phys_clicks) size);
+ return(OK);
}
/*===========================================================================*
* the new map to the kernel. Zero the new core image's bss, gap and stack.
*/
- register struct mproc *rmp;
+ register struct mproc *rmp = mp;
vir_clicks text_clicks, data_clicks, gap_clicks, stack_clicks, tot_clicks;
phys_clicks new_base;
- phys_bytes bytes, base, count, bss_offset;
+ phys_bytes bytes, base, bss_offset;
int s;
/* No need to allocate text if it can be shared. */
/* The process pointed to by 'mp' has forked. Create a child process. */
register struct mproc *rmp; /* pointer to parent */
register struct mproc *rmc; /* pointer to child */
- int i, child_nr, t;
+ int child_nr, s;
phys_clicks prog_clicks, child_base;
phys_bytes prog_bytes, parent_abs, child_abs; /* Intel only */
pid_t new_pid;
/* Create a copy of the parent's core image for the child. */
child_abs = (phys_bytes) child_base << CLICK_SHIFT;
parent_abs = (phys_bytes) rmp->mp_seg[D].mem_phys << CLICK_SHIFT;
- i = sys_abscopy(parent_abs, child_abs, prog_bytes);
- if (i < 0) panic(__FILE__,"do_fork can't copy", i);
+ s = sys_abscopy(parent_abs, child_abs, prog_bytes);
+ if (s < 0) panic(__FILE__,"do_fork can't copy", s);
/* Find a slot in 'mproc' for the child process. A slot must exist. */
for (rmc = &mproc[0]; rmc < &mproc[NR_PROCS]; rmc++)
/*===========================================================================*
* main *
*===========================================================================*/
-PUBLIC void main()
+PUBLIC int main()
{
/* Main routine of the process manager. */
int result, s, proc_nr;
}
}
}
+ return(OK);
}
/*===========================================================================*
* array are struct hole, which, in addition to storage for a base and size in
* click units also contain space for a link, a pointer to another element.
*/
- int key, i, s;
+ int s;
static struct boot_image image[NR_BOOT_PROCS];
register struct boot_image *ip;
static char core_sigs[] = { SIGQUIT, SIGILL, SIGTRAP, SIGABRT,
_PROTOTYPE( int do_getset, (void) );
/* main.c */
-_PROTOTYPE( void main, (void) );
+_PROTOTYPE( int main, (void) );
/* misc.c */
_PROTOTYPE( int do_reboot, (void) );
{
/* Make a core dump on the file "core", if possible. */
- int s, fd, fake_fd, nr_written, seg, slot;
- char *buf;
+ int s, fd, seg, slot;
vir_bytes current_sp;
- phys_bytes left; /* careful; 64K might overflow vir_bytes */
- unsigned nr_to_write; /* unsigned for arg to write() but < INT_MAX */
long trace_data, trace_off;
slot = (int) (rmp - mproc);