diff options
author | Andi Kleen <ak@suse.de> | 2005-07-29 00:15:48 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2005-07-29 00:46:02 -0400 |
commit | 3829ee6b1be03d5aa3005fe7d19f30088b539836 (patch) | |
tree | be7a9f93c38662905509f1033ef935436d8b02a3 /arch/x86_64 | |
parent | 3ba80e7595f3e308e5e7135445b513779fc0ba3b (diff) |
[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: Andi Kleen <ak@suse.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'arch/x86_64')
-rw-r--r-- | arch/x86_64/kernel/entry.S | 10 | ||||
-rw-r--r-- | arch/x86_64/kernel/head.S | 16 |
2 files changed, 13 insertions, 13 deletions
diff --git a/arch/x86_64/kernel/entry.S b/arch/x86_64/kernel/entry.S index 28817490fdc6..0696e025dce5 100644 --- a/arch/x86_64/kernel/entry.S +++ b/arch/x86_64/kernel/entry.S | |||
@@ -76,7 +76,7 @@ | |||
76 | 76 | ||
77 | .macro FAKE_STACK_FRAME child_rip | 77 | .macro FAKE_STACK_FRAME child_rip |
78 | /* push in order ss, rsp, eflags, cs, rip */ | 78 | /* push in order ss, rsp, eflags, cs, rip */ |
79 | xorq %rax, %rax | 79 | xorl %eax, %eax |
80 | pushq %rax /* ss */ | 80 | pushq %rax /* ss */ |
81 | CFI_ADJUST_CFA_OFFSET 8 | 81 | CFI_ADJUST_CFA_OFFSET 8 |
82 | pushq %rax /* rsp */ | 82 | pushq %rax /* rsp */ |
@@ -423,7 +423,7 @@ ENTRY(stub_rt_sigreturn) | |||
423 | testl $3,CS(%rdi) | 423 | testl $3,CS(%rdi) |
424 | je 1f | 424 | je 1f |
425 | swapgs | 425 | swapgs |
426 | 1: addl $1,%gs:pda_irqcount # RED-PEN should check preempt count | 426 | 1: incl %gs:pda_irqcount # RED-PEN should check preempt count |
427 | movq %gs:pda_irqstackptr,%rax | 427 | movq %gs:pda_irqstackptr,%rax |
428 | cmoveq %rax,%rsp | 428 | cmoveq %rax,%rsp |
429 | pushq %rdi # save old stack | 429 | pushq %rdi # save old stack |
@@ -436,7 +436,7 @@ ENTRY(common_interrupt) | |||
436 | ret_from_intr: | 436 | ret_from_intr: |
437 | popq %rdi | 437 | popq %rdi |
438 | cli | 438 | cli |
439 | subl $1,%gs:pda_irqcount | 439 | decl %gs:pda_irqcount |
440 | #ifdef CONFIG_DEBUG_INFO | 440 | #ifdef CONFIG_DEBUG_INFO |
441 | movq RBP(%rdi),%rbp | 441 | movq RBP(%rdi),%rbp |
442 | #endif | 442 | #endif |
@@ -494,7 +494,7 @@ retint_signal: | |||
494 | sti | 494 | sti |
495 | SAVE_REST | 495 | SAVE_REST |
496 | movq $-1,ORIG_RAX(%rsp) | 496 | movq $-1,ORIG_RAX(%rsp) |
497 | xorq %rsi,%rsi # oldset | 497 | xorl %esi,%esi # oldset |
498 | movq %rsp,%rdi # &pt_regs | 498 | movq %rsp,%rdi # &pt_regs |
499 | call do_notify_resume | 499 | call do_notify_resume |
500 | RESTORE_REST | 500 | RESTORE_REST |
@@ -752,7 +752,7 @@ child_rip: | |||
752 | movq %rsi, %rdi | 752 | movq %rsi, %rdi |
753 | call *%rax | 753 | call *%rax |
754 | # exit | 754 | # exit |
755 | xorq %rdi, %rdi | 755 | xorl %edi, %edi |
756 | call do_exit | 756 | call do_exit |
757 | 757 | ||
758 | /* | 758 | /* |
diff --git a/arch/x86_64/kernel/head.S b/arch/x86_64/kernel/head.S index 8d765aa77a26..98ff5eb32b9a 100644 --- a/arch/x86_64/kernel/head.S +++ b/arch/x86_64/kernel/head.S | |||
@@ -137,14 +137,14 @@ startup_64: | |||
137 | wrmsr | 137 | wrmsr |
138 | 138 | ||
139 | /* Setup cr0 */ | 139 | /* Setup cr0 */ |
140 | xorq %rax, %rax | 140 | #define CR0_PM 1 /* protected mode */ |
141 | btsq $31, %rax /* Enable paging */ | 141 | #define CR0_MP (1<<1) |
142 | btsq $0, %rax /* Enable protected mode */ | 142 | #define CR0_ET (1<<4) |
143 | btsq $1, %rax /* Enable MP */ | 143 | #define CR0_NE (1<<5) |
144 | btsq $4, %rax /* Enable ET */ | 144 | #define CR0_WP (1<<16) |
145 | btsq $5, %rax /* Enable NE */ | 145 | #define CR0_AM (1<<18) |
146 | btsq $16, %rax /* Enable WP */ | 146 | #define CR0_PAGING (1<<31) |
147 | btsq $18, %rax /* Enable AM */ | 147 | movl $CR0_PM|CR0_MP|CR0_ET|CR0_NE|CR0_WP|CR0_AM|CR0_PAGING,%eax |
148 | /* Make changes effective */ | 148 | /* Make changes effective */ |
149 | movq %rax, %cr0 | 149 | movq %rax, %cr0 |
150 | 150 | ||