From: Ben Gras Date: Wed, 1 Jun 2005 09:39:45 +0000 (+0000) Subject: exec now uses phys_zero system call to zero bss segments (instead of X-Git-Tag: v3.1.0~786 X-Git-Url: http://zhaoyanbai.com/repos/%22http:/www.isc.org/icons/doc/syslog.3.html?a=commitdiff_plain;h=447b9881544560d9fc22287999849a648e8c3bc3;p=minix.git exec now uses phys_zero system call to zero bss segments (instead of using phys_copy to copy zeroes there for every kb), which is a big optimisation in some cases fixed a bug that was introduced when function keys became notifies --- 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); }