Squashed backup commit (no shallow-clone history issues) of xiaomi-mt6833-dev/kernel_xiaomi_mt6833 (lineage-23.2 branch, upstream commit 9eece662e) plus all fixes applied to get everpal_defconfig building clean against a modern (GCC 15.2.0) toolchain -- see the previous commit message on the lineage-23.2 branch (also in this repo history is not available here since this is a squashed snapshot; full incremental history lives in the local DL380 checkout and the upstream GitHub remote). Upstream: https://github.com/xiaomi-mt6833-dev/kernel_xiaomi_mt6833 (lineage-23.2)
41 lines
631 B
Bash
Executable File
41 lines
631 B
Bash
Executable File
#!/bin/sh
|
|
# SPDX-License-Identifier: GPL-2.0
|
|
|
|
in="$1"
|
|
arch="$2"
|
|
|
|
syscall_macro() {
|
|
nr="$1"
|
|
name="$2"
|
|
|
|
echo " [$nr] = \"$name\","
|
|
}
|
|
|
|
emit() {
|
|
nr="$1"
|
|
entry="$2"
|
|
|
|
syscall_macro "$nr" "$entry"
|
|
}
|
|
|
|
echo "static const char *syscalltbl_${arch}[] = {"
|
|
|
|
sorted_table=$(mktemp /tmp/syscalltbl.XXXXXX)
|
|
grep '^[0-9]' "$in" | sort -n > $sorted_table
|
|
|
|
max_nr=0
|
|
while read nr abi name entry compat; do
|
|
if [ $nr -ge 512 ] ; then # discard compat sycalls
|
|
break
|
|
fi
|
|
|
|
emit "$nr" "$name"
|
|
max_nr=$nr
|
|
done < $sorted_table
|
|
|
|
rm -f $sorted_table
|
|
|
|
echo "};"
|
|
|
|
echo "#define SYSCALLTBL_${arch}_MAX_ID ${max_nr}"
|