xref: /aosp_15_r20/external/crosvm/hypervisor/src/gunyah/gunyah_sys/bindgen.sh (revision bb4ee6a4ae7042d18b07a98463b9c8b875e44b39)
1#!/usr/bin/env bash
2# Copyright 2023 The ChromiumOS Authors
3# Use of this source code is governed by a BSD-style license that can be
4# found in the LICENSE file.
5
6# Regenerate gunyah_sys bindgen bindings.
7
8set -euo pipefail
9# assume in hypervisor/src/gunyah/gunyah_sys
10cd "$(dirname "${BASH_SOURCE[0]}")/../../../.."
11
12source tools/impl/bindgen-common.sh
13
14# use local copy until gunyah.h is available in chromium monorepo
15bindgen_generate \
16    --blocklist-item='__kernel.*' \
17    --blocklist-item='__BITS_PER_LONG' \
18    --blocklist-item='__FD_SETSIZE' \
19    --blocklist-item='_?IOC.*' \
20    "hypervisor/src/gunyah/gunyah_sys/gunyah.h" \
21    -- \
22    -isystem "${BINDGEN_LINUX_ARM64_HEADERS}/include" \
23    | replace_linux_int_types \
24    > hypervisor/src/gunyah/gunyah_sys/bindings.rs
25