Created
August 18, 2014 00:07
-
-
Save wjk/2eceac5e063f44a56f0a to your computer and use it in GitHub Desktop.
cpu_data_realloc disassembly
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
_cpu_data_realloc: | |
pushq %rbp | |
movq %rsp, %rbp | |
pushq %rbx | |
subq $0x28, %rsp | |
leaq _kernel_map(%rip), %rbx | |
movq __framesize(%rbx), %rdi | |
leaq -0x10(%rbp), %rsi | |
movl $0x4000, %edx | |
callq _kmem_alloc | |
movl %eax, %ecx | |
testl %ecx, %ecx | |
je 0xffffff800030d9a7 | |
leaq 0x45be41(%rip), %rdi ; literal pool for C string | |
xorl %eax, %eax | |
movl %ecx, %esi | |
callq _panic | |
movq -0x10(%rbp), %rdi | |
movl $0x4000, %esi | |
callq _bzero | |
addq $0x4000, -0x10(%rbp) | |
movq __framesize(%rbx), %rdi | |
leaq -0x20(%rbp), %rsi | |
movl $0xa880, %edx | |
callq _kmem_alloc | |
movl %eax, %ecx | |
testl %ecx, %ecx | |
je 0xffffff800030d9e4 | |
leaq 0x45be69(%rip), %rdi ; literal pool for C string | |
xorl %eax, %eax | |
movl %ecx, %esi | |
callq _panic | |
movq _cpu_data_ptr(%rip), %rdi | |
movq -0x20(%rbp), %rsi | |
movl $0xa880, %edx | |
callq _bcopy | |
movq -0x20(%rbp), %rax | |
movq %rax, __framesize(%rax) | |
movq -0x10(%rbp), %rax | |
movq -0x20(%rbp), %rdi | |
movq %rax, 0x38(%rdi) | |
addq $0x68, %rdi | |
callq _timer_call_queue_init | |
movq __framesize(%rbx), %rdi | |
leaq -0x18(%rbp), %rsi | |
movl $0x1000, %edx | |
callq _kmem_alloc | |
movl %eax, %ecx | |
testl %ecx, %ecx | |
je 0xffffff800030da3c | |
leaq 0x45be79(%rip), %rdi ; literal pool for C string | |
xorl %eax, %eax | |
movl %ecx, %esi | |
callq _panic | |
movq -0x18(%rbp), %rdi | |
movl $0x1000, %esi | |
callq _bzero | |
addq $0x1000, -0x18(%rbp) | |
xorl %edi, %edi | |
callq _ml_set_interrupts_enabled | |
movl %eax, %esi | |
movq -0x20(%rbp), %rdx | |
movq %rdx, _cpu_data_ptr(%rip) | |
movq -0x18(%rbp), %rax | |
leaq _master_ktss64(%rip), %rcx | |
movq %rax, 0x2c(%rcx) | |
addq $-0x40, %rax | |
movq %rax, 0x24(%rcx) | |
movl %edx, %eax | |
shrq $0x20, %rdx | |
movl $0xc0000101, %ecx | |
wrmsr | |
movq -0x20(%rbp), %rdx | |
movl %edx, %eax | |
shrq $0x20, %rdx | |
movl $0xc0000102, %ecx | |
wrmsr | |
movl %esi, %edi | |
callq _ml_set_interrupts_enabled | |
movq -0x20(%rbp), %rsi | |
movq -0x10(%rbp), %rdx | |
movq -0x18(%rbp), %rcx | |
leaq 0x45be62(%rip), %rdi ; literal pool for C string | |
xorl %eax, %eax | |
callq _kprintf | |
movl $0xdeadbeef, %eax | |
movq %rax, -0x28(%rbp) | |
pushq %gs | |
popq -0x28(%rbp) | |
movq -0x28(%rbp), %rsi | |
leaq 0x45be89(%rip), %rdi ; literal pool for literal C string | |
xorl %eax, %eax | |
callq _kprintf | |
movl $0xc0000101, %ecx | |
rdmsr | |
shlq $0x20, %rdx | |
movl %eax, %esi | |
orq %rdx, %rsi | |
leaq 0x45be76(%rip), %rdi ; literal pool for literal C string | |
xorl %eax, %eax | |
callq _kprintf | |
addq $0x28, %rsp | |
popq %rbx | |
popq %rbp | |
ret |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment