summaryrefslogtreecommitdiffhomepage
path: root/test/syscalls/linux/rseq/rseq.cc
diff options
context:
space:
mode:
authorgVisor bot <gvisor-bot@google.com>2020-01-21 16:32:49 -0800
committergVisor bot <gvisor-bot@google.com>2020-01-21 16:32:49 -0800
commit45a8edbd5ae6c836317923dc7d2b5baac9feea98 (patch)
treec8e011c89c1808fe2e520ee41c9bcb2af7911cd0 /test/syscalls/linux/rseq/rseq.cc
parentb3405a719cbb33dac2deced192209a5584e5e3d6 (diff)
parent200cf245c4ed43d8e2a37484cdbc36f5fbfa1ac9 (diff)
Merge pull request #1492 from majek:err_typo_in_netstack_tests
PiperOrigin-RevId: 290840370
Diffstat (limited to 'test/syscalls/linux/rseq/rseq.cc')
-rw-r--r--test/syscalls/linux/rseq/rseq.cc50
1 files changed, 25 insertions, 25 deletions
diff --git a/test/syscalls/linux/rseq/rseq.cc b/test/syscalls/linux/rseq/rseq.cc
index f036db26d..4fe7c5ecf 100644
--- a/test/syscalls/linux/rseq/rseq.cc
+++ b/test/syscalls/linux/rseq/rseq.cc
@@ -49,7 +49,7 @@ int strcmp(const char* s1, const char* s2) {
return static_cast<int>(*p1) - static_cast<int>(*p2);
}
-int sys_rseq(struct rseq* rseq, uint32_t rseq_len, int flags, uint32_t sig) {
+int sys_rseq(struct rseq* rseq, uint32 rseq_len, int flags, uint32 sig) {
return raw_syscall(kRseqSyscall, rseq, rseq_len, flags, sig);
}
@@ -176,10 +176,10 @@ int TestAbort() {
struct rseq_cs cs = {};
cs.version = 0;
cs.flags = 0;
- cs.start_ip = reinterpret_cast<uint64_t>(&rseq_loop_start);
- cs.post_commit_offset = reinterpret_cast<uint64_t>(&rseq_loop_post_commit) -
- reinterpret_cast<uint64_t>(&rseq_loop_start);
- cs.abort_ip = reinterpret_cast<uint64_t>(&rseq_loop_abort);
+ cs.start_ip = reinterpret_cast<uint64>(&rseq_loop_start);
+ cs.post_commit_offset = reinterpret_cast<uint64>(&rseq_loop_post_commit) -
+ reinterpret_cast<uint64>(&rseq_loop_start);
+ cs.abort_ip = reinterpret_cast<uint64>(&rseq_loop_abort);
// Loops until abort. If this returns then abort occurred.
rseq_loop(&r, &cs);
@@ -198,10 +198,10 @@ int TestAbortBefore() {
struct rseq_cs cs = {};
cs.version = 0;
cs.flags = 0;
- cs.start_ip = reinterpret_cast<uint64_t>(&rseq_loop_start);
- cs.post_commit_offset = reinterpret_cast<uint64_t>(&rseq_loop_post_commit) -
- reinterpret_cast<uint64_t>(&rseq_loop_start);
- cs.abort_ip = reinterpret_cast<uint64_t>(&rseq_loop_early_abort);
+ cs.start_ip = reinterpret_cast<uint64>(&rseq_loop_start);
+ cs.post_commit_offset = reinterpret_cast<uint64>(&rseq_loop_post_commit) -
+ reinterpret_cast<uint64>(&rseq_loop_start);
+ cs.abort_ip = reinterpret_cast<uint64>(&rseq_loop_early_abort);
// Loops until abort. If this returns then abort occurred.
rseq_loop(&r, &cs);
@@ -220,10 +220,10 @@ int TestAbortSignature() {
struct rseq_cs cs = {};
cs.version = 0;
cs.flags = 0;
- cs.start_ip = reinterpret_cast<uint64_t>(&rseq_loop_start);
- cs.post_commit_offset = reinterpret_cast<uint64_t>(&rseq_loop_post_commit) -
- reinterpret_cast<uint64_t>(&rseq_loop_start);
- cs.abort_ip = reinterpret_cast<uint64_t>(&rseq_loop_abort);
+ cs.start_ip = reinterpret_cast<uint64>(&rseq_loop_start);
+ cs.post_commit_offset = reinterpret_cast<uint64>(&rseq_loop_post_commit) -
+ reinterpret_cast<uint64>(&rseq_loop_start);
+ cs.abort_ip = reinterpret_cast<uint64>(&rseq_loop_abort);
// Loops until abort. This should SIGSEGV on abort.
rseq_loop(&r, &cs);
@@ -242,10 +242,10 @@ int TestAbortPreCommit() {
struct rseq_cs cs = {};
cs.version = 0;
cs.flags = 0;
- cs.start_ip = reinterpret_cast<uint64_t>(&rseq_loop_start);
- cs.post_commit_offset = reinterpret_cast<uint64_t>(&rseq_loop_post_commit) -
- reinterpret_cast<uint64_t>(&rseq_loop_start);
- cs.abort_ip = reinterpret_cast<uint64_t>(&rseq_loop_pre_commit);
+ cs.start_ip = reinterpret_cast<uint64>(&rseq_loop_start);
+ cs.post_commit_offset = reinterpret_cast<uint64>(&rseq_loop_post_commit) -
+ reinterpret_cast<uint64>(&rseq_loop_start);
+ cs.abort_ip = reinterpret_cast<uint64>(&rseq_loop_pre_commit);
// Loops until abort. This should SIGSEGV on abort.
rseq_loop(&r, &cs);
@@ -264,10 +264,10 @@ int TestAbortClearsCS() {
struct rseq_cs cs = {};
cs.version = 0;
cs.flags = 0;
- cs.start_ip = reinterpret_cast<uint64_t>(&rseq_loop_start);
- cs.post_commit_offset = reinterpret_cast<uint64_t>(&rseq_loop_post_commit) -
- reinterpret_cast<uint64_t>(&rseq_loop_start);
- cs.abort_ip = reinterpret_cast<uint64_t>(&rseq_loop_abort);
+ cs.start_ip = reinterpret_cast<uint64>(&rseq_loop_start);
+ cs.post_commit_offset = reinterpret_cast<uint64>(&rseq_loop_post_commit) -
+ reinterpret_cast<uint64>(&rseq_loop_start);
+ cs.abort_ip = reinterpret_cast<uint64>(&rseq_loop_abort);
// Loops until abort. If this returns then abort occurred.
rseq_loop(&r, &cs);
@@ -290,10 +290,10 @@ int TestInvalidAbortClearsCS() {
struct rseq_cs cs = {};
cs.version = 0;
cs.flags = 0;
- cs.start_ip = reinterpret_cast<uint64_t>(&rseq_loop_start);
- cs.post_commit_offset = reinterpret_cast<uint64_t>(&rseq_loop_post_commit) -
- reinterpret_cast<uint64_t>(&rseq_loop_start);
- cs.abort_ip = reinterpret_cast<uint64_t>(&rseq_loop_abort);
+ cs.start_ip = reinterpret_cast<uint64>(&rseq_loop_start);
+ cs.post_commit_offset = reinterpret_cast<uint64>(&rseq_loop_post_commit) -
+ reinterpret_cast<uint64>(&rseq_loop_start);
+ cs.abort_ip = reinterpret_cast<uint64>(&rseq_loop_abort);
__atomic_store_n(&r.rseq_cs, &cs, __ATOMIC_RELAXED);