/[rtmk]/rtmk/i386/i386-locore.S
ViewVC logotype

Diff of /rtmk/i386/i386-locore.S

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.2 by jrydberg, Sun Dec 9 21:20:09 2001 UTC revision 1.3 by jrydberg, Mon Dec 10 22:26:59 2001 UTC
# Line 287  ENTRY(cpu_call_continuation) Line 287  ENTRY(cpu_call_continuation)
287          xorl    %ebp,%ebp          xorl    %ebp,%ebp
288          jmp     *%eax            jmp     *%eax  
289    
290  /* SMP STUFF! */  /* Copy from user address space.  ??? copyin (DST_KA, SRC_UA, COUNTER) */
291    
292    ENTRY(copyin)
293            pushl   %esi
294            pushl   %edi                    /* save registers */
295    
296            movl    8+8(%esp),%esi          /* get user start address */
297            movl    8+4(%esp),%edi          /* get kernel destination address */
298            movl    8+12(%esp),%edx         /* get count */
299    
300            movl    $USER_DS, %eax
301            movw    %ax, %gs
302            movl    $KERNEL_DS, %eax
303            movw    %ax, %es
304            
305            cld                             /* count up */
306            movl    %edx, %ecx
307            shrl    $2, %ecx
308            jz      0f
309            
310            rep
311            movsl   %gs:(%esi), %es:(%edi)
312    
313    0:
314            movl    %edx,%ecx               /* now move remaining bytes */
315            andl    $3,%ecx
316            rep
317            movsb   %gs:(%esi), %es:(%edi)
318    
319            movl    $KERNEL_DS, %eax
320            movw    %ax, %es
321            movw    %ax, %fs
322    
323            xorl    %eax,%eax               /* return 0 for success */
324    copy_ret_1:
325            popl    %edi                    /* restore registers */
326            popl    %esi
327            ret                             /* and return */
328    
329    copy_fail_1:
330            movl    $KERNEL_DS, %eax
331            movw    %ax, %es
332            movw    %ax, %fs
333    
334            movl    $1,%eax                 /* return 1 for failure */
335            jmp     copy_ret_1              /* pop frame and return */
336    
337    /* Copy to user address space. ??? copyout (DST_VA, SRC_KA, COUNT) */
338    ENTRY(copyout)
339            pushl   %esi
340            pushl   %edi                    /* save registers */
341    
342            movl    8+4(%esp),%esi          /* get user start address */
343            movl    8+8(%esp),%edi          /* get kernel destination address */
344            movl    8+12(%esp),%edx         /* get count */
345    
346            movl    $KERNEL_DS, %eax
347            movw    %ax, %gs
348            movl    $USER_DS, %eax
349            movw    %ax, %es
350            
351            cld                             /* count up */
352            movl    %edx, %ecx
353            shrl    $2, %ecx
354            jz      0f
355            
356            rep
357            movsl   %gs:(%esi), %es:(%edi)
358    
359    0:      movl    %edx,%ecx               /* now move remaining bytes */
360            andl    $3,%ecx
361            rep
362            movsb   %gs:(%esi), %es:(%edi)
363    
364            movl    $KERNEL_DS, %eax
365            movw    %ax, %es
366            movw    %ax, %fs
367    
368            xorl    %eax,%eax               /* return 0 for success */
369    copy_ret_2:
370            popl    %edi                    /* restore registers */
371            popl    %esi
372            ret                             /* and return */
373    
374    copy_fail_2:
375            movl    $KERNEL_DS, %eax
376            movw    %ax, %es
377            movw    %ax, %fs
378    
379    
380            movl    $1,%eax                 /* return 1 for failure */
381            jmp     copy_ret_2              /* pop frame and return */
382    
383                    
384            /* SMP STUFF! */
385  #if NCPUS > 1  #if NCPUS > 1
386    
387          .text          .text

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.3

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26