Commit 3829ee6b authored by Andi Kleen's avatar Andi Kleen Committed by Linus Torvalds

[PATCH] x86_64: Small assembly improvements

Save a byte here and there.  Ultimatively useless, but these things always
catch my eyes when reading the code so just fix them for now.

Also I got at least one patch fixing of them already, which gives a good
excuse.
Signed-off-by: default avatarAndi Kleen <ak@suse.de>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 3ba80e75
...@@ -76,7 +76,7 @@ ...@@ -76,7 +76,7 @@
.macro FAKE_STACK_FRAME child_rip .macro FAKE_STACK_FRAME child_rip
/* push in order ss, rsp, eflags, cs, rip */ /* push in order ss, rsp, eflags, cs, rip */
xorq %rax, %rax xorl %eax, %eax
pushq %rax /* ss */ pushq %rax /* ss */
CFI_ADJUST_CFA_OFFSET 8 CFI_ADJUST_CFA_OFFSET 8
pushq %rax /* rsp */ pushq %rax /* rsp */
...@@ -423,7 +423,7 @@ ENTRY(stub_rt_sigreturn) ...@@ -423,7 +423,7 @@ ENTRY(stub_rt_sigreturn)
testl $3,CS(%rdi) testl $3,CS(%rdi)
je 1f je 1f
swapgs swapgs
1: addl $1,%gs:pda_irqcount # RED-PEN should check preempt count 1: incl %gs:pda_irqcount # RED-PEN should check preempt count
movq %gs:pda_irqstackptr,%rax movq %gs:pda_irqstackptr,%rax
cmoveq %rax,%rsp cmoveq %rax,%rsp
pushq %rdi # save old stack pushq %rdi # save old stack
...@@ -436,7 +436,7 @@ ENTRY(common_interrupt) ...@@ -436,7 +436,7 @@ ENTRY(common_interrupt)
ret_from_intr: ret_from_intr:
popq %rdi popq %rdi
cli cli
subl $1,%gs:pda_irqcount decl %gs:pda_irqcount
#ifdef CONFIG_DEBUG_INFO #ifdef CONFIG_DEBUG_INFO
movq RBP(%rdi),%rbp movq RBP(%rdi),%rbp
#endif #endif
...@@ -494,7 +494,7 @@ retint_signal: ...@@ -494,7 +494,7 @@ retint_signal:
sti sti
SAVE_REST SAVE_REST
movq $-1,ORIG_RAX(%rsp) movq $-1,ORIG_RAX(%rsp)
xorq %rsi,%rsi # oldset xorl %esi,%esi # oldset
movq %rsp,%rdi # &pt_regs movq %rsp,%rdi # &pt_regs
call do_notify_resume call do_notify_resume
RESTORE_REST RESTORE_REST
...@@ -752,7 +752,7 @@ child_rip: ...@@ -752,7 +752,7 @@ child_rip:
movq %rsi, %rdi movq %rsi, %rdi
call *%rax call *%rax
# exit # exit
xorq %rdi, %rdi xorl %edi, %edi
call do_exit call do_exit
/* /*
......
...@@ -137,14 +137,14 @@ startup_64: ...@@ -137,14 +137,14 @@ startup_64:
wrmsr wrmsr
/* Setup cr0 */ /* Setup cr0 */
xorq %rax, %rax #define CR0_PM 1 /* protected mode */
btsq $31, %rax /* Enable paging */ #define CR0_MP (1<<1)
btsq $0, %rax /* Enable protected mode */ #define CR0_ET (1<<4)
btsq $1, %rax /* Enable MP */ #define CR0_NE (1<<5)
btsq $4, %rax /* Enable ET */ #define CR0_WP (1<<16)
btsq $5, %rax /* Enable NE */ #define CR0_AM (1<<18)
btsq $16, %rax /* Enable WP */ #define CR0_PAGING (1<<31)
btsq $18, %rax /* Enable AM */ movl $CR0_PM|CR0_MP|CR0_ET|CR0_NE|CR0_WP|CR0_AM|CR0_PAGING,%eax
/* Make changes effective */ /* Make changes effective */
movq %rax, %cr0 movq %rax, %cr0
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment