]> Zhao Yanbai Git Server - minix.git/commitdiff
No need to use memcpy to copy a message of 36 bytes. The overhead just
authorTomas Hruby <tom@minix3.org>
Wed, 27 Jan 2010 09:34:47 +0000 (09:34 +0000)
committerTomas Hruby <tom@minix3.org>
Wed, 27 Jan 2010 09:34:47 +0000 (09:34 +0000)
to call memcpy is half of the inline copy (using gcc -O)

kernel/system.c

index 93ba522c0a5c7cdb7e84d96921a6657789fba512..a64980cb2a236a9c2f4a86d537512784320c7079 100644 (file)
@@ -115,7 +115,7 @@ PUBLIC void sys_task()
         */
         vmassert(RTS_ISSET(caller_ptr, RTS_VMREQUEST));
        vmassert(caller_ptr->p_vmrequest.type == VMSTYPE_KERNELCALL);
-       memcpy(&caller_ptr->p_vmrequest.saved.reqmsg, &m, sizeof(m));
+       caller_ptr->p_vmrequest.saved.reqmsg = m;
       } else if (result != EDONTREPLY) {
        /* Send a reply, unless inhibited by a handler function.
         * Use the kernel function lock_send() to prevent a system
@@ -564,7 +564,7 @@ PRIVATE struct proc *vmrestart_check(message *m)
 
        switch(type) {
                case VMSTYPE_KERNELCALL:
-                       memcpy(m, &restarting->p_vmrequest.saved.reqmsg, sizeof(*m));
+                       *m = restarting->p_vmrequest.saved.reqmsg;
                        restarting->p_vmrequest.saved.reqmsg.m_source = NONE;
                        vmassert(m->m_source == restarting->p_endpoint);
                        /* Original caller could've disappeared in the meantime. */