Remove support for command-line args
We no longer support passing string arguments to a VM. Any
customization needed can be done by having the host communicate with
the VM after it starts.
Also start adding a header to provide the entry-point prototype for
better safety.
Bug: 249064104
Bug: 243513572
Test: atest MicrodroidTests MicrodroidHostTestCases
Change-Id: I0a1775f3b6a0b11c71c4831f6c380d96bb637c00
diff --git a/microdroid/vm_payload/Android.bp b/microdroid/vm_payload/Android.bp
index a68595f..925928e 100644
--- a/microdroid/vm_payload/Android.bp
+++ b/microdroid/vm_payload/Android.bp
@@ -31,3 +31,8 @@
"libvm_payload",
],
}
+
+cc_library_headers {
+ name: "vm_payload_headers",
+ export_include_dirs: ["include"],
+}
diff --git a/microdroid/vm_payload/include/vm_main.h b/microdroid/vm_payload/include/vm_main.h
new file mode 100644
index 0000000..e351174
--- /dev/null
+++ b/microdroid/vm_payload/include/vm_main.h
@@ -0,0 +1,27 @@
+/*
+ * Copyright 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#pragma once
+
+#ifdef __cplusplus
+extern "C" {
+typedef int AVmPayload_main_t();
+AVmPayload_main_t AVmPayload_main;
+}
+#else
+typedef int AVmPayload_main_t(void);
+extern int AVmPayload_main(void);
+#endif
diff --git a/microdroid/vm_payload/include/vm_payload.h b/microdroid/vm_payload/include/vm_payload.h
index 05abdce..4ed07b8 100644
--- a/microdroid/vm_payload/include/vm_payload.h
+++ b/microdroid/vm_payload/include/vm_payload.h
@@ -19,6 +19,8 @@
#include <stdbool.h>
#include <stddef.h>
+#include "vm_main.h"
+
#ifdef __cplusplus
extern "C" {
#endif