From 3c71e025e83f1684eec9517f64d0d8a7a0608191 Mon Sep 17 00:00:00 2001 From: Googler Date: Wed, 6 Feb 2019 16:59:32 -0800 Subject: Internal change. PiperOrigin-RevId: 232776481 Change-Id: Ic19d4aa6322fef71621bad0e9fb8bdedf6694114 --- test/syscalls/linux/exceptions.cc | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'test/syscalls/linux') diff --git a/test/syscalls/linux/exceptions.cc b/test/syscalls/linux/exceptions.cc index 72ab354e3..3f0aa8bf1 100644 --- a/test/syscalls/linux/exceptions.cc +++ b/test/syscalls/linux/exceptions.cc @@ -25,24 +25,28 @@ namespace testing { void inline Halt() { asm("hlt\r\n"); } void inline SetAlignmentCheck() { - asm("pushf\r\n" + asm("subq $128, %%rsp\r\n" // Avoid potential red zone clobber + "pushf\r\n" "pop %%rax\r\n" "or $0x40000, %%rax\r\n" "push %%rax\r\n" "popf\r\n" + "addq $128, %%rsp\r\n" : : : "ax"); } void inline ClearAlignmentCheck() { - asm("pushf\r\n" + asm("subq $128, %%rsp\r\n" // Avoid potential red zone clobber + "pushf\r\n" "pop %%rax\r\n" "mov $0x40000, %%rbx\r\n" "not %%rbx\r\n" "and %%rbx, %%rax\r\n" "push %%rax\r\n" "popf\r\n" + "addq $128, %%rsp\r\n" : : : "ax", "bx"); -- cgit v1.2.3