cxgbe/t4_tom: Read the chip's DDP page sizes and save them in a
[freebsd-src.git] / sys / powerpc / ps3 / ps3-hv-header.awk
blobd00571a62b4c9151ee9e656a918ee8a6e2360d2a
1 # This script generates the PS3 hypervisor call header from a hypervisor
2 # interface definition file. All lines that do not begin with HVCALL
3 # or a bare # for comments are copied to the output header so that
4 # enums, constant, C comments and the like can be passed through into the
5 # header.
7 # Invoke like so: awk -f ps3-hv-header.awk < ps3-hvcall.master > ps3-hv.h
10 # $FreeBSD$
12 !/HVCALL.*/ && (!/#.*/ || /#define.*/ || /#include.*/) {
13 print($0);
16 /HVCALL.*/ {
17 split($5, outs, ",")
18 if ($4 == "UNUSED")
19 split("", ins, ",")
20 else
21 split($4, ins, ",")
23 printf("int %s(",$3);
24 for (i = 1; i <= length(ins); i++) {
25 printf("uint64_t %s", ins[i]);
26 if (i < length(ins)) printf(", ");
29 if (length(outs) > 0 && length(ins) > 0)
30 printf(", ");
32 for (i = 1; i <= length(outs); i++) {
33 printf("uint64_t *%s", outs[i]);
34 if (i < length(outs)) printf(", ");
37 if (length(outs) == 0 && length(ins) == 0)
38 printf("void");
40 printf(");\n");