1bf215546Sopenharmony_ci/*
2bf215546Sopenharmony_ci * Copyright © 2019 Raspberry Pi Ltd
3bf215546Sopenharmony_ci * Copyright © 2014-2017 Broadcom
4bf215546Sopenharmony_ci * Copyright (C) 2012 Rob Clark <robclark@freedesktop.org>
5bf215546Sopenharmony_ci *
6bf215546Sopenharmony_ci * Permission is hereby granted, free of charge, to any person obtaining a
7bf215546Sopenharmony_ci * copy of this software and associated documentation files (the "Software"),
8bf215546Sopenharmony_ci * to deal in the Software without restriction, including without limitation
9bf215546Sopenharmony_ci * the rights to use, copy, modify, merge, publish, distribute, sublicense,
10bf215546Sopenharmony_ci * and/or sell copies of the Software, and to permit persons to whom the
11bf215546Sopenharmony_ci * Software is furnished to do so, subject to the following conditions:
12bf215546Sopenharmony_ci *
13bf215546Sopenharmony_ci * The above copyright notice and this permission notice (including the next
14bf215546Sopenharmony_ci * paragraph) shall be included in all copies or substantial portions of the
15bf215546Sopenharmony_ci * Software.
16bf215546Sopenharmony_ci *
17bf215546Sopenharmony_ci * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18bf215546Sopenharmony_ci * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19bf215546Sopenharmony_ci * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
20bf215546Sopenharmony_ci * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21bf215546Sopenharmony_ci * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
22bf215546Sopenharmony_ci * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
23bf215546Sopenharmony_ci * IN THE SOFTWARE.
24bf215546Sopenharmony_ci */
25bf215546Sopenharmony_ci
26bf215546Sopenharmony_ci#ifndef V3D_SIMULATOR_H
27bf215546Sopenharmony_ci#define V3D_SIMULATOR_H
28bf215546Sopenharmony_ci
29bf215546Sopenharmony_ci#ifdef V3D_VERSION
30bf215546Sopenharmony_ci#include "broadcom/common/v3d_macros.h"
31bf215546Sopenharmony_ci#endif
32bf215546Sopenharmony_ci
33bf215546Sopenharmony_ci#include <stdint.h>
34bf215546Sopenharmony_ci
35bf215546Sopenharmony_cistruct v3d_simulator_file;
36bf215546Sopenharmony_ci
37bf215546Sopenharmony_cistruct v3d_simulator_file* v3d_simulator_init(int fd);
38bf215546Sopenharmony_civoid v3d_simulator_destroy(struct v3d_simulator_file *sim_file);
39bf215546Sopenharmony_ciuint32_t v3d_simulator_get_spill(uint32_t spill_size);
40bf215546Sopenharmony_ciint v3d_simulator_ioctl(int fd, unsigned long request, void *arg);
41bf215546Sopenharmony_civoid v3d_simulator_open_from_handle(int fd, int handle, uint32_t size);
42bf215546Sopenharmony_ciuint32_t v3d_simulator_get_mem_size(void);
43bf215546Sopenharmony_ci
44bf215546Sopenharmony_ci#ifdef v3dX
45bf215546Sopenharmony_ci#  include "v3dx_simulator.h"
46bf215546Sopenharmony_ci#else
47bf215546Sopenharmony_ci#  define v3dX(x) v3d33_##x
48bf215546Sopenharmony_ci#  include "v3dx_simulator.h"
49bf215546Sopenharmony_ci#  undef v3dX
50bf215546Sopenharmony_ci
51bf215546Sopenharmony_ci#  define v3dX(x) v3d41_##x
52bf215546Sopenharmony_ci#  include "v3dx_simulator.h"
53bf215546Sopenharmony_ci#  undef v3dX
54bf215546Sopenharmony_ci#endif
55bf215546Sopenharmony_ci
56bf215546Sopenharmony_ci#endif
57