mirror of
https://github.com/facebookexperimental/reverie.git
synced 2025-01-23 05:06:23 +00:00
Reduce size of getcpu vdso
Summary: The `getcpu` VDSO was just returning 0 unconditionally. This was an old hack to determinize the getcpu syscall, but we don't need this anymore because we just intercept it and determinize it instead. Reducing the size of this vdso function will make it more compatible with various VDSO implementations. Reviewed By: wkhughes Differential Revision: D41506684 fbshipit-source-id: 3dacad93971ecc7969d725f8b7e984a189a0ebb4
This commit is contained in:
parent
debce82715
commit
c448d10586
1 changed files with 4 additions and 10 deletions
|
@ -28,7 +28,7 @@ mod vdso_syms {
|
|||
#![allow(non_upper_case_globals)]
|
||||
|
||||
pub const time: &[u8; 8] = &[
|
||||
0xb8, 0xc9, 0x0, 0x0, 0x0, // mov %SYS_time, %eax
|
||||
0xb8, 0xc9, 0x00, 0x00, 0x00, // mov %SYS_time, %eax
|
||||
0x0f, 0x05, // syscall
|
||||
0xc3, // retq
|
||||
];
|
||||
|
@ -39,16 +39,10 @@ mod vdso_syms {
|
|||
0xc3, // retq
|
||||
];
|
||||
|
||||
pub const getcpu: &[u8; 32] = &[
|
||||
0x48, 0x85, 0xff, // test %rdi, %rdi
|
||||
0x74, 0x06, // je ..
|
||||
0xc7, 0x07, 0x00, 0x00, 0x00, 0x00, // movl $0x0, (%rdi)
|
||||
0x48, 0x85, 0xf6, // test %rsi, %rsi
|
||||
0x74, 0x06, // je ..
|
||||
0xc7, 0x06, 0x00, 0x00, 0x00, 0x00, // movl $0x0, (%rsi)
|
||||
0x31, 0xc0, // xor %eax, %eax
|
||||
pub const getcpu: &[u8; 8] = &[
|
||||
0xb8, 0x35, 0x01, 0x00, 0x00, // mov SYS_getcpu, %eax
|
||||
0x0f, 0x05, // syscall
|
||||
0xc3, // retq
|
||||
0x0f, 0x1f, 0x80, 0x00, 0x00, 0x00, 0x00, // nopl 0x0(%rax)
|
||||
];
|
||||
|
||||
pub const gettimeofday: &[u8; 8] = &[
|
||||
|
|
Loading…
Reference in a new issue