Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(528)

Unified Diff: tests/test_patching_input.S

Issue 8605003: Add logic for patching calls to the x86-64 vsyscall page (Closed) Base URL: https://seccompsandbox.googlecode.com/svn/trunk
Patch Set: Created 9 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tests/test_patching.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/test_patching_input.S
diff --git a/tests/test_patching_input.S b/tests/test_patching_input.S
index 3e7126d331b1611c792c1496728f0263c223b17b..e2406035d57c8f325c823a307e34c970851ec1b4 100644
--- a/tests/test_patching_input.S
+++ b/tests/test_patching_input.S
@@ -22,5 +22,43 @@ my_getpid:
ret
my_getpid_end:
+
+ // These routines call the vsyscall page, which is present on
+ // x86-64 only.
+
+#if defined(__x86_64__)
+
+ .global my_vgettimeofday
+ .global my_vgettimeofday_end
+my_vgettimeofday:
+ sub $8, %rsp // Align the stack
+ mov $0xffffffffff600000, %rax
+ call *%rax
+ add $8, %rsp
+ ret
+my_vgettimeofday_end:
+
+ .global my_vtime
+ .global my_vtime_end
+my_vtime:
+ sub $8, %rsp // Align the stack
+ mov $0xffffffffff600400, %rax
+ call *%rax
+ add $8, %rsp
+ ret
+my_vtime_end:
+
+ .global my_vgetcpu
+ .global my_vgetcpu_end
+my_vgetcpu:
+ sub $8, %rsp // Align the stack
+ mov $0xffffffffff600800, %rax
+ call *%rax
+ add $8, %rsp
+ ret
+my_vgetcpu_end:
+
+#endif
+
// Tell Linux not to disable no-execute protection for the process.
.section .note.GNU-stack,"",@progbits
« no previous file with comments | « tests/test_patching.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698