Commit | Line | Data |
---|---|---|
0a4690cf | 1 | #!/bin/sh |
2874c5fd | 2 | # SPDX-License-Identifier: GPL-2.0-or-later |
0a4690cf SR |
3 | # |
4 | # Just process the CPP output from systbl_chk.c and complain | |
5 | # if anything is out of order. | |
6 | # | |
caa34c9e | 7 | # Copyright © 2008 IBM Corporation |
0a4690cf | 8 | # |
0a4690cf SR |
9 | |
10 | awk 'BEGIN { num = -1; } # Ignore the beginning of the file | |
11 | /^#/ { next; } | |
12 | /^[ \t]*$/ { next; } | |
13 | /^START_TABLE/ { num = 0; next; } | |
14 | /^END_TABLE/ { | |
15 | if (num != $2) { | |
53da14d0 | 16 | printf "Error: NR_syscalls (%s) is not one more than the last syscall (%s)\n", |
0a4690cf SR |
17 | $2, num - 1; |
18 | exit(1); | |
19 | } | |
20 | num = -1; # Ignore the rest of the file | |
21 | } | |
22 | { | |
23 | if (num == -1) next; | |
24 | if (($1 != -1) && ($1 != num)) { | |
53da14d0 | 25 | printf "Error: Syscall %s out of order (expected %s)\n", |
0a4690cf SR |
26 | $1, num; |
27 | exit(1); | |
28 | }; | |
29 | num++; | |
30 | }' "$1" |