Something went wrong. Try again.
Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
Something went wrong. Try again.
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263#!/bin/sh# SPDX-License-Identifier: GPL-2.0
ATOMICDIR=$(dirname $0)
. ${ATOMICDIR}/atomic-tbl.sh
#gen_proto_order_variant(meta, pfx, name, sfx, order, atomic, int, arg...)gen_proto_order_variant(){ local meta="$1"; shift local pfx="$1"; shift local name="$1"; shift local sfx="$1"; shift local order="$1"; shift local atomic="$1"; shift local int="$1"; shift
local atomicname="${atomic}_${pfx}${name}${sfx}${order}"
local ret="$(gen_ret_type "${meta}" "${int}")" local params="$(gen_params "${int}" "${atomic}" "$@")" local args="$(gen_args "$@")" local retstmt="$(gen_ret_stmt "${meta}")"
cat <<EOF__rust_helper ${ret}rust_helper_${atomicname}(${params}){ ${retstmt}${atomicname}(${args});}
EOF}
cat << EOF// SPDX-License-Identifier: GPL-2.0
// Generated by $0// DO NOT MODIFY THIS FILE DIRECTLY
/* * This file provides helpers for the various atomic functions for Rust. */#ifndef _RUST_ATOMIC_API_H#define _RUST_ATOMIC_API_H
#include <linux/atomic.h>
EOF
grep '^[a-z]' "$1" | while read name meta args; do gen_proto "${meta}" "${name}" "atomic" "int" ${args}done
grep '^[a-z]' "$1" | while read name meta args; do gen_proto "${meta}" "${name}" "atomic64" "s64" ${args}done
cat <<EOF#endif /* _RUST_ATOMIC_API_H */EOF