Skip to content

Commit 66a2ed2

Browse files
Charles E. Youseandrewboie
Charles E. Youse
authored andcommitted
arch/x86: (Intel64) move RAX to volatile register set
This used to be part of the "restore always" set of registers because __swap was expected to return a value. No longer required, so RAX is moved to the volatile registers and we save a few cycles occasionally. Signed-off-by: Charles E. Youse <[email protected]>
1 parent 074ce88 commit 66a2ed2

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

arch/x86/core/intel64/locore.S

+1-1
Original file line numberDiff line numberDiff line change
@@ -222,12 +222,12 @@ __resume:
222222
movq _thread_offset_to_r13(%rdi), %r13
223223
movq _thread_offset_to_r14(%rdi), %r14
224224
movq _thread_offset_to_r15(%rdi), %r15
225-
movq _thread_offset_to_rax(%rdi), %rax
226225

227226
testb $X86_THREAD_FLAG_ALL, _thread_offset_to_flags(%rdi)
228227
jz 1f
229228

230229
fxrstor _thread_offset_to_sse(%rdi)
230+
movq _thread_offset_to_rax(%rdi), %rax
231231
movq _thread_offset_to_rcx(%rdi), %rcx
232232
movq _thread_offset_to_rdx(%rdi), %rdx
233233
movq _thread_offset_to_rsi(%rdi), %rsi

arch/x86/core/offsets/intel64_offsets.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ GEN_OFFSET_SYM(_callee_saved_t, r14);
1616
GEN_OFFSET_SYM(_callee_saved_t, r15);
1717
GEN_OFFSET_SYM(_callee_saved_t, rip);
1818
GEN_OFFSET_SYM(_callee_saved_t, rflags);
19-
GEN_OFFSET_SYM(_callee_saved_t, rax);
2019

20+
GEN_OFFSET_SYM(_thread_arch_t, rax);
2121
GEN_OFFSET_SYM(_thread_arch_t, rcx);
2222
GEN_OFFSET_SYM(_thread_arch_t, rdx);
2323
GEN_OFFSET_SYM(_thread_arch_t, rsi);

arch/x86/include/intel64/kernel_arch_thread.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,14 @@ struct _callee_saved {
3030
u64_t r15;
3131
u64_t rip;
3232
u64_t rflags;
33-
u64_t rax;
3433
};
3534

3635
typedef struct _callee_saved _callee_saved_t;
3736

3837
struct _thread_arch {
3938
u8_t flags;
4039

40+
u64_t rax;
4141
u64_t rcx;
4242
u64_t rdx;
4343
u64_t rsi;

arch/x86/include/intel64/offsets_short_arch.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
(___thread_t_callee_saved_OFFSET + ___callee_saved_t_rflags_OFFSET)
3737

3838
#define _thread_offset_to_rax \
39-
(___thread_t_callee_saved_OFFSET + ___callee_saved_t_rax_OFFSET)
39+
(___thread_t_arch_OFFSET + ___thread_arch_t_rax_OFFSET)
4040

4141
#define _thread_offset_to_rcx \
4242
(___thread_t_arch_OFFSET + ___thread_arch_t_rcx_OFFSET)

0 commit comments

Comments
 (0)