Cleanup with gcc. Removed unused variables.
Fixed some uninitialized problems.
This commit is contained in:
parent
a238c1ba48
commit
46c8884e36
6 changed files with 13 additions and 15 deletions
|
@ -71,6 +71,7 @@ phys_clicks clicks; /* amount of memory requested */
|
||||||
phys_clicks old_base;
|
phys_clicks old_base;
|
||||||
|
|
||||||
do {
|
do {
|
||||||
|
prev_ptr = NIL_HOLE;
|
||||||
hp = hole_head;
|
hp = hole_head;
|
||||||
while (hp != NIL_HOLE && hp->h_base < swap_base) {
|
while (hp != NIL_HOLE && hp->h_base < swap_base) {
|
||||||
if (hp->h_len >= clicks) {
|
if (hp->h_len >= clicks) {
|
||||||
|
@ -128,6 +129,7 @@ phys_clicks clicks; /* number of clicks to free */
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Block to be returned does not go on front of hole list. */
|
/* Block to be returned does not go on front of hole list. */
|
||||||
|
prev_ptr = NIL_HOLE;
|
||||||
while (hp != NIL_HOLE && base > hp->h_base) {
|
while (hp != NIL_HOLE && base > hp->h_base) {
|
||||||
prev_ptr = hp;
|
prev_ptr = hp;
|
||||||
hp = hp->h_next;
|
hp = hp->h_next;
|
||||||
|
@ -212,9 +214,6 @@ phys_clicks *free; /* memory size summaries */
|
||||||
*/
|
*/
|
||||||
int i;
|
int i;
|
||||||
register struct hole *hp;
|
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. */
|
/* Put all holes on the free list. */
|
||||||
for (hp = &hole[0]; hp < &hole[NR_HOLES]; hp++) hp->h_next = hp + 1;
|
for (hp = &hole[0]; hp < &hole[NR_HOLES]; hp++) hp->h_next = hp + 1;
|
||||||
|
@ -262,6 +261,7 @@ u32_t offset, size; /* area on swap file to use */
|
||||||
size >>= CLICK_SHIFT;
|
size >>= CLICK_SHIFT;
|
||||||
if (size > swap_maxsize) size = swap_maxsize;
|
if (size > swap_maxsize) size = swap_maxsize;
|
||||||
if (size > 0) free_mem(swap_base, (phys_clicks) size);
|
if (size > 0) free_mem(swap_base, (phys_clicks) size);
|
||||||
|
return(OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*===========================================================================*
|
/*===========================================================================*
|
||||||
|
|
|
@ -299,10 +299,10 @@ phys_bytes tot_bytes; /* total memory to allocate, including gap */
|
||||||
* the new map to the kernel. Zero the new core image's bss, gap and stack.
|
* 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;
|
vir_clicks text_clicks, data_clicks, gap_clicks, stack_clicks, tot_clicks;
|
||||||
phys_clicks new_base;
|
phys_clicks new_base;
|
||||||
phys_bytes bytes, base, count, bss_offset;
|
phys_bytes bytes, base, bss_offset;
|
||||||
int s;
|
int s;
|
||||||
|
|
||||||
/* No need to allocate text if it can be shared. */
|
/* No need to allocate text if it can be shared. */
|
||||||
|
|
|
@ -33,7 +33,7 @@ PUBLIC int do_fork()
|
||||||
/* The process pointed to by 'mp' has forked. Create a child process. */
|
/* The process pointed to by 'mp' has forked. Create a child process. */
|
||||||
register struct mproc *rmp; /* pointer to parent */
|
register struct mproc *rmp; /* pointer to parent */
|
||||||
register struct mproc *rmc; /* pointer to child */
|
register struct mproc *rmc; /* pointer to child */
|
||||||
int i, child_nr, t;
|
int child_nr, s;
|
||||||
phys_clicks prog_clicks, child_base;
|
phys_clicks prog_clicks, child_base;
|
||||||
phys_bytes prog_bytes, parent_abs, child_abs; /* Intel only */
|
phys_bytes prog_bytes, parent_abs, child_abs; /* Intel only */
|
||||||
pid_t new_pid;
|
pid_t new_pid;
|
||||||
|
@ -60,8 +60,8 @@ PUBLIC int do_fork()
|
||||||
/* Create a copy of the parent's core image for the child. */
|
/* Create a copy of the parent's core image for the child. */
|
||||||
child_abs = (phys_bytes) child_base << CLICK_SHIFT;
|
child_abs = (phys_bytes) child_base << CLICK_SHIFT;
|
||||||
parent_abs = (phys_bytes) rmp->mp_seg[D].mem_phys << CLICK_SHIFT;
|
parent_abs = (phys_bytes) rmp->mp_seg[D].mem_phys << CLICK_SHIFT;
|
||||||
i = sys_abscopy(parent_abs, child_abs, prog_bytes);
|
s = sys_abscopy(parent_abs, child_abs, prog_bytes);
|
||||||
if (i < 0) panic(__FILE__,"do_fork can't copy", i);
|
if (s < 0) panic(__FILE__,"do_fork can't copy", s);
|
||||||
|
|
||||||
/* Find a slot in 'mproc' for the child process. A slot must exist. */
|
/* Find a slot in 'mproc' for the child process. A slot must exist. */
|
||||||
for (rmc = &mproc[0]; rmc < &mproc[NR_PROCS]; rmc++)
|
for (rmc = &mproc[0]; rmc < &mproc[NR_PROCS]; rmc++)
|
||||||
|
|
|
@ -39,7 +39,7 @@ FORWARD _PROTOTYPE( void patch_mem_chunks, (struct memory *mem_chunks,
|
||||||
/*===========================================================================*
|
/*===========================================================================*
|
||||||
* main *
|
* main *
|
||||||
*===========================================================================*/
|
*===========================================================================*/
|
||||||
PUBLIC void main()
|
PUBLIC int main()
|
||||||
{
|
{
|
||||||
/* Main routine of the process manager. */
|
/* Main routine of the process manager. */
|
||||||
int result, s, proc_nr;
|
int result, s, proc_nr;
|
||||||
|
@ -91,6 +91,7 @@ PUBLIC void main()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
return(OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*===========================================================================*
|
/*===========================================================================*
|
||||||
|
@ -147,7 +148,7 @@ PRIVATE void pm_init()
|
||||||
* array are struct hole, which, in addition to storage for a base and size in
|
* 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.
|
* 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];
|
static struct boot_image image[NR_BOOT_PROCS];
|
||||||
register struct boot_image *ip;
|
register struct boot_image *ip;
|
||||||
static char core_sigs[] = { SIGQUIT, SIGILL, SIGTRAP, SIGABRT,
|
static char core_sigs[] = { SIGQUIT, SIGILL, SIGTRAP, SIGABRT,
|
||||||
|
|
|
@ -52,7 +52,7 @@ _PROTOTYPE( void pm_exit, (struct mproc *rmp, int exit_status) );
|
||||||
_PROTOTYPE( int do_getset, (void) );
|
_PROTOTYPE( int do_getset, (void) );
|
||||||
|
|
||||||
/* main.c */
|
/* main.c */
|
||||||
_PROTOTYPE( void main, (void) );
|
_PROTOTYPE( int main, (void) );
|
||||||
|
|
||||||
/* misc.c */
|
/* misc.c */
|
||||||
_PROTOTYPE( int do_reboot, (void) );
|
_PROTOTYPE( int do_reboot, (void) );
|
||||||
|
|
|
@ -619,11 +619,8 @@ register struct mproc *rmp; /* whose core is to be dumped */
|
||||||
{
|
{
|
||||||
/* Make a core dump on the file "core", if possible. */
|
/* Make a core dump on the file "core", if possible. */
|
||||||
|
|
||||||
int s, fd, fake_fd, nr_written, seg, slot;
|
int s, fd, seg, slot;
|
||||||
char *buf;
|
|
||||||
vir_bytes current_sp;
|
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;
|
long trace_data, trace_off;
|
||||||
|
|
||||||
slot = (int) (rmp - mproc);
|
slot = (int) (rmp - mproc);
|
||||||
|
|
Loading…
Reference in a new issue