xref: /aosp_15_r20/external/crosvm/vm_memory/bindgen.sh (revision bb4ee6a4ae7042d18b07a98463b9c8b875e44b39)
1#!/usr/bin/env bash
2# Copyright 2022 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 virtio-gpu udmabuf bindgen bindings.
7
8set -euo pipefail
9cd "$(dirname "${BASH_SOURCE[0]}")/.."
10
11source tools/impl/bindgen-common.sh
12
13bindgen_generate \
14    --allowlist-type='udmabuf_.*' \
15    --allowlist-var="UDMABUF_.*" \
16    "${BINDGEN_LINUX}/include/uapi/linux/udmabuf.h" \
17    | replace_linux_int_types | rustfmt \
18    > vm_memory/src/udmabuf_bindings.rs
19