1{
2  "description": "Schema for the list of Zircon syscalls",
3  "type": "object",
4  "properties": {
5    "syscalls": {
6      "description": "The Zircon syscall methods",
7      "type": "array",
8      "items": {
9        "$ref": "#/definitions/syscall"
10      }
11    }
12  },
13  "required": [
14    "syscalls"
15  ],
16  "additionalProperties": false,
17  "definitions": {
18    "syscall": {
19      "description": "A syscall method",
20      "type": "object",
21      "properties": {
22        "name": {
23          "description": "The method name, which is a valid C identifier",
24          "type": "string"
25        },
26        "attributes": {
27          "description": "Metadata about the method",
28          "type": "array",
29          "items": {
30            "$ref": "#/definitions/methodAttribute"
31          }
32        },
33        "arguments": {
34          "description": "The method's parameters",
35          "type": "array",
36          "items": {
37            "$ref": "#/definitions/argument"
38          }
39        },
40        "return_type": {
41          "description": "Return type of the method",
42          "$ref": "#/definitions/objectType"
43        }
44      },
45      "required": [
46        "name",
47        "attributes",
48        "arguments",
49        "return_type"
50      ],
51      "additionalProperties": false
52    },
53    "methodAttribute": {
54      "description": "A method attribute",
55      "type": "string",
56      "enum": [
57        "blocking",
58        "const",
59        "deprecated",
60        "internal",
61        "noreturn",
62        "test_category1",
63        "test_category2",
64        "vdsocall",
65        "*"
66      ]
67    },
68    "argument": {
69      "description": "A method parameter",
70      "type": "object",
71      "properties": {
72        "name": {
73          "description": "The parameter's name",
74          "type": "string"
75        },
76        "type": {
77          "description": "The object type of this parameter",
78          "$ref": "#/definitions/objectType"
79        },
80        "is_array": {
81          "description": "Whether the parameter is an array of objects",
82          "type": "boolean"
83        },
84        "array_multipliers": {
85          "description": "For an array, the parameters to multiply in order to compute the array's size",
86          "type": "array",
87          "items": {
88            "type": "string"
89          }
90        },
91        "array_count": {
92          "description": "An array's size",
93          "type": "integer"
94        },
95        "attributes": {
96          "description": "Some metadata about the parameter",
97          "type": "array",
98          "items": {
99            "$ref": "#/definitions/parameterAttribute"
100          }
101        }
102      },
103      "required": [
104        "name",
105        "type",
106        "is_array",
107        "attributes"
108      ],
109      "additionalProperties": false
110    },
111    "objectType": {
112      "description": "An object's type",
113      "type": "string",
114      "enum": [
115        "any",
116        "bool",
117        "char",
118        "int",
119        "int32_t",
120        "int64_t",
121        "size_t",
122        "uint16_t",
123        "uint32_t",
124        "uint64_t",
125        "uint8_t",
126        "uintptr_t",
127        "void",
128        "zx_channel_call_args_t",
129        "zx_duration_t",
130        "zx_futex_t",
131        "zx_handle_info_t",
132        "zx_handle_t",
133        "zx_paddr_t",
134        "zx_pci_bar_t",
135        "zx_pci_init_arg_t",
136        "zx_pcie_device_info_t",
137        "zx_port_packet_t",
138        "zx_profile_info_t",
139        "zx_rights_t",
140        "zx_signals_t",
141        "zx_status_t",
142        "zx_system_powerctl_arg_t",
143        "zx_time_t",
144        "zx_vaddr_t",
145        "zx_wait_item_t"
146      ]
147    },
148    "parameterAttribute": {
149      "description": "A parameter attribute",
150      "type": "string",
151      "enum": [
152        "features",
153        "handle_acquire",
154        "handle_release",
155        "handle_release_always",
156        "optional",
157        "IN",
158        "INOUT",
159        "OUT"
160      ]
161    }
162  }
163}
164