summaryrefslogtreecommitdiff
path: root/arch/x86/entry/syscalls/syscalltbl.sh
blob: 167965ee742e076d80d1cb2a5c2c4341909f8e71 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/bin/sh

in="$1"
out="$2"

emit() {
    abi="$1"
    nr="$2"
    entry="$3"
    compat="$4"
    if [ -n "$compat" ]; then
	echo "__SYSCALL_${abi}($nr, $entry, $compat)"
    elif [ -n "$entry" ]; then
	echo "__SYSCALL_${abi}($nr, $entry, $entry)"
    fi
}

grep '^[0-9]' "$in" | sort -n | (
    while read nr abi name entry compat; do
	abi=`echo "$abi" | tr '[a-z]' '[A-Z]'`
	emit "$abi" "$nr" "$entry" "$compat"
    done
) > "$out"