Changeset e3c762cd in mainline for arch/amd64/src/asm_utils.S
- Timestamp:
- 2006-05-05T11:59:19Z (19 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- de07bcf
- Parents:
- 22cf454d
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
arch/amd64/src/asm_utils.S
r22cf454d re3c762cd 61 61 jmp printf 62 62 63 .global memcpy64 memcpy:65 jmp _memcpy66 67 63 .global cpuid 68 64 .global has_cpuid … … 70 66 .global read_efer_flag 71 67 .global set_efer_flag 72 68 .global memcpy 69 .global memcpy_from_uspace 70 .global memcpy_to_uspace 71 .global memcpy_from_uspace_failover_address 72 .global memcpy_to_uspace_failover_address 73 74 #define MEMCPY_DST %rdi 75 #define MEMCPY_SRC %rsi 76 #define MEMCPY_SIZE %rdx 77 78 /** 79 * Copy memory from/to userspace. 80 * 81 * This is almost conventional memcpy(). 82 * The difference is that there is a failover part 83 * to where control is returned from a page fault if 84 * the page fault occurs during copy_from_uspace() 85 * or copy_to_uspace(). 86 * 87 * @param MEMCPY_DST Destination address. 88 * @param MEMCPY_SRC Source address. 89 * @param MEMCPY_SIZE Number of bytes to copy. 90 * 91 * @retrun MEMCPY_SRC on success, 0 on failure. 92 */ 93 memcpy: 94 memcpy_from_uspace: 95 memcpy_to_uspace: 96 movq MEMCPY_SRC, %rax 97 98 movq MEMCPY_SIZE, %rcx 99 shrq $3, %rcx /* size / 8 */ 100 101 rep movsq /* copy as much as possible word by word */ 102 103 movq MEMCPY_SIZE, %rcx 104 andq $7, %rcx /* size % 8 */ 105 jz 0f 106 107 rep movsb /* copy the rest byte by byte */ 108 109 0: 110 ret /* return MEMCPY_SRC, success */ 111 112 memcpy_from_uspace_failover_address: 113 memcpy_to_uspace_failover_address: 114 xorq %rax, %rax /* return 0, failure */ 115 ret 116 73 117 ## Determine CPUID support 74 118 #
Note:
See TracChangeset
for help on using the changeset viewer.