kern

annotate src/regs.S @ 83:4ef83db5f4cd

foo
author John Tsiombikas <nuclear@member.fsf.org>
date Tue, 06 Dec 2011 15:53:57 +0200
parents 6c9138a87e02
children
rev   line source
nuclear@13 1 .text
nuclear@13 2 .align 4
nuclear@13 3
nuclear@13 4 .globl get_regs
nuclear@13 5 get_regs:
nuclear@13 6 pushl %ebp
nuclear@13 7 movl %esp, %ebp
nuclear@13 8
nuclear@13 9 pushl %edx
nuclear@13 10 movl 8(%ebp), %edx
nuclear@13 11
nuclear@13 12 movl %eax, (%edx)
nuclear@13 13 movl %ebx, 4(%edx)
nuclear@13 14 movl %ecx, 8(%edx)
nuclear@13 15
nuclear@13 16 /* juggle edx */
nuclear@13 17 movl %edx, %eax
nuclear@13 18 popl %edx
nuclear@13 19 movl %edx, 12(%eax)
nuclear@13 20 pushl %edx
nuclear@13 21 movl %eax, %edx
nuclear@13 22
nuclear@13 23 /* those two are pointless in a function */
nuclear@13 24 movl %esp, 16(%edx)
nuclear@13 25 movl %ebp, 20(%edx)
nuclear@13 26
nuclear@13 27 movl %esi, 24(%edx)
nuclear@13 28 movl %edi, 28(%edx)
nuclear@13 29
nuclear@13 30 pushf
nuclear@13 31 popl %eax
nuclear@13 32 movl %eax, 32(%edx)
nuclear@13 33
nuclear@13 34 movw %cs, 36(%edx)
nuclear@13 35 movw %ss, 40(%edx)
nuclear@13 36 movw %ds, 44(%edx)
nuclear@13 37 movw %es, 48(%edx)
nuclear@13 38 movw %fs, 52(%edx)
nuclear@13 39 movw %gs, 56(%edx)
nuclear@13 40
nuclear@13 41 pushl %ebx
nuclear@13 42 movl %cr0, %ebx
nuclear@13 43 movl %ebx, 60(%edx)
nuclear@13 44 /*movl %cr1, %ebx
nuclear@13 45 movl %ebx, 64(%edx)*/
nuclear@14 46 movl %cr2, %ebx
nuclear@14 47 movl %ebx, 68(%edx)
nuclear@13 48 movl %cr3, %ebx
nuclear@13 49 movl %ebx, 72(%edx)
nuclear@13 50 popl %ebx
nuclear@13 51
nuclear@13 52 popl %edx
nuclear@13 53 popl %ebp
nuclear@13 54 ret