diff --git a/servers/pm/dmp.c b/servers/pm/dmp.c index 2977cb55e..433bc1820 100644 --- a/servers/pm/dmp.c +++ b/servers/pm/dmp.c @@ -24,12 +24,21 @@ FORWARD _PROTOTYPE( void mproc_dmp, (void)); PUBLIC int do_fkey_pressed(void) { printf("Process Manager debug dump: "); - switch (m_in.FKEY_CODE) { +#if DEAD_CODE + switch (m_in.FKEY_NUM) { +#else + switch (m_in.NOTIFY_FLAGS) { +#endif case SF7: mproc_dmp(); break; default: +#if DEAD_CODE printf("PM: unhandled notification for Shift+F%d key.\n", m_in.FKEY_NUM); +#else + printf("PM: unhandled notification for Shift+F%d key.\n", + m_in.NOTIFY_FLAGS); +#endif } } diff --git a/servers/pm/exec.c b/servers/pm/exec.c index d0cdc7de3..7b6dfcaab 100644 --- a/servers/pm/exec.c +++ b/servers/pm/exec.c @@ -297,7 +297,6 @@ phys_bytes tot_bytes; /* total memory to allocate, including gap */ register struct mproc *rmp; vir_clicks text_clicks, data_clicks, gap_clicks, stack_clicks, tot_clicks; phys_clicks new_base; - static char zero[1024]; /* used to zero bss */ phys_bytes bytes, base, count, bss_offset; int s; @@ -372,7 +371,13 @@ phys_bytes tot_bytes; /* total memory to allocate, including gap */ base += bss_offset; bytes -= bss_offset; + if ((s=sys_physzero(base, bytes)) != OK) { + panic("new_mem can't zero", s); + } + +#if DEAD_CODE while (bytes > 0) { + static char zero[1024]; /* used to zero bss */ count = MIN(bytes, (phys_bytes) sizeof(zero)); if ((s=sys_physcopy(PM_PROC_NR, D, (phys_bytes) zero, NONE, PHYS_SEG, base, count)) != OK) { @@ -381,6 +386,8 @@ phys_bytes tot_bytes; /* total memory to allocate, including gap */ base += count; bytes -= count; } +#endif + return(OK); }