1// Copyright 2017 The Fuchsia Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#pragma once
6
7#include <zircon/syscalls.h>
8
9// This struct defines the first message that the child process gets.
10typedef struct {
11    __typeof(zx_handle_close)*      handle_close;
12    __typeof(zx_object_wait_one)*   object_wait_one;
13    __typeof(zx_object_signal)*     object_signal;
14    __typeof(zx_event_create)*      event_create;
15    __typeof(zx_channel_create)*    channel_create;
16    __typeof(zx_channel_read)*      channel_read;
17    __typeof(zx_channel_write)*     channel_write;
18    __typeof(zx_process_exit)*      process_exit;
19    __typeof(zx_object_get_info)*   object_get_info;
20} minip_ctx_t;
21
22// Subsequent messages and replies are of this format. The |what| parameter is
23// transaction friendly so the client can use zx_channel_call().
24typedef struct {
25    zx_txid_t what;
26    zx_status_t status;
27} minip_cmd_t;
28
29void minipr_thread_loop(zx_handle_t channel, uintptr_t fnptr);
30