Changeset 45f7449 in mainline for kernel/arch/ia32/src/asm.S


Ignore:
Timestamp:
2013-03-31T19:46:19Z (12 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
a5057cc
Parents:
582f4d28
Message:

Revert to the state of mainline,1783.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/arch/ia32/src/asm.S

    r582f4d28 r45f7449  
    3838.global paging_on
    3939.global enable_l_apic_in_msr
    40 .global memset
    41 .global memcpy
    4240.global memcpy_from_uspace
    4341.global memcpy_from_uspace_failover_address
     
    4644.global early_putchar
    4745
    48 #define MEMSET_DST   4
    49 #define MEMSET_VAL   8
    50 #define MEMSET_SIZE  12
    51 
    5246#define MEMCPY_DST   4
    5347#define MEMCPY_SRC   8
    5448#define MEMCPY_SIZE  12
    55 
    56 /* Fill memory with byte pattern
    57  *
    58  * This is a conventional memset().
    59  *
    60  * @param MEMSET_DST(%esp)  Destination address.
    61  * @param MEMSET_VAL(%esp)  Value to fill.
    62  * @param MEMSET_SIZE(%esp) Size.
    63  *
    64  * @return MEMSET_DST(%esp).
    65  *
    66  */
    67 memset:
    68         movl %edi, %edx  /* save %edi */
    69        
    70         movl MEMSET_DST(%esp), %edi
    71         movl MEMSET_VAL(%esp), %ecx
    72        
    73         /* Create byte pattern */
    74         movb %cl, %ch
    75         movw %cx, %ax
    76         shll $16, %eax
    77         orw %cx, %ax
    78        
    79         movl MEMSET_SIZE(%esp), %ecx
    80         shrl $2, %ecx  /* size / 4 */
    81        
    82         /* Write whole words */
    83         rep stosl
    84        
    85         movl MEMSET_SIZE(%esp), %ecx
    86         andl $3, %ecx  /* size % 4 */
    87         jz 0f
    88        
    89         /* Copy the rest byte by byte */
    90         rep stosb
    91        
    92         0:
    93        
    94                 movl %edx, %edi
    95                
    96                 /* MEMSET_DST(%esp), success */
    97                 movl MEMSET_DST(%esp), %eax
    98                 ret
    9949
    10050/** Copy memory to/from userspace.
     
    11363 *
    11464 */
    115 memcpy:
    11665memcpy_from_uspace:
    11766memcpy_to_uspace:
Note: See TracChangeset for help on using the changeset viewer.