aboutsummaryrefslogtreecommitdiffstats
path: root/executor/executor_windows.cc
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2018-07-20 20:26:05 +0200
committerDmitry Vyukov <dvyukov@google.com>2018-07-24 12:04:27 +0200
commit9fe4bdc5f1037a409e82299f36117030114c7b94 (patch)
treed3d73c1f69ded8152436be47684a07baa0e7f6ec /executor/executor_windows.cc
parentdb7957bc09bf5715d33e4c56b8614579aa94000a (diff)
executor: overhaul
Make as much code as possible shared between all OSes. In particular main is now common across all OSes. Make more code shared between executor and csource (in particular, loop function and threaded execution logic). Also make loop and threaded logic shared across all OSes. Make more posix/unix code shared across OSes (e.g. signal handling, pthread creation, etc). Plus other changes along similar lines. Also support test OS in executor (based on portable posix) and add 4 arches that cover all execution modes (fork server/no fork server, shmem/no shmem). This change paves way for testing of executor code and allows to preserve consistency across OSes and executor/csource.
Diffstat (limited to 'executor/executor_windows.cc')
-rw-r--r--executor/executor_windows.cc83
1 files changed, 0 insertions, 83 deletions
diff --git a/executor/executor_windows.cc b/executor/executor_windows.cc
deleted file mode 100644
index 73477bb4f..000000000
--- a/executor/executor_windows.cc
+++ /dev/null
@@ -1,83 +0,0 @@
-// Copyright 2017 syzkaller project authors. All rights reserved.
-// Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file.
-
-// +build
-
-#include <io.h>
-
-#define SYZ_EXECUTOR
-#include "common_windows.h"
-
-#include "executor_windows.h"
-
-#include "syscalls_windows.h"
-
-#include "executor.h"
-
-uint32 output;
-
-int main(int argc, char** argv)
-{
- if (argc == 2 && strcmp(argv[1], "version") == 0) {
- puts(GOOS " " GOARCH " " SYZ_REVISION " " GIT_REVISION);
- return 0;
- }
-
- if (VirtualAlloc((void*)SYZ_DATA_OFFSET, SYZ_NUM_PAGES * SYZ_PAGE_SIZE,
- MEM_COMMIT | MEM_RESERVE, PAGE_EXECUTE_READWRITE) != (void*)SYZ_DATA_OFFSET)
- fail("mmap of data segment failed");
-
- main_init();
- execute_one();
- return 0;
-}
-
-long execute_syscall(const call_t* c, long a0, long a1, long a2, long a3, long a4, long a5, long a6, long a7, long a8)
-{
- __try {
- return c->call(a0, a1, a2, a3, a4, a5, a6, a7, a8);
- } __except (EXCEPTION_EXECUTE_HANDLER) {
- return -1;
- }
-}
-
-void cover_open()
-{
-}
-
-void cover_enable(thread_t* th)
-{
-}
-
-void cover_reset(thread_t* th)
-{
-}
-
-uint32 cover_read_size(thread_t* th)
-{
- return 0;
-}
-
-bool cover_check(uint32 pc)
-{
- return true;
-}
-
-bool cover_check(uint64 pc)
-{
- return true;
-}
-
-uint32* write_output(uint32 v)
-{
- return &output;
-}
-
-void write_completed(uint32 completed)
-{
-}
-
-bool kcov_comparison_t::ignore() const
-{
- return false;
-}