Lines Matching refs:xiocb

29 int cfe_iocb_dispatch(struct cfe_xiocb *xiocb);
40 static int (*cfe_dispfunc) (intptr_t handle, intptr_t xiocb);
50 int cfe_iocb_dispatch(struct cfe_xiocb * xiocb) in cfe_iocb_dispatch() argument
54 return (*cfe_dispfunc) ((intptr_t) cfe_handle, (intptr_t) xiocb); in cfe_iocb_dispatch()
59 struct cfe_xiocb xiocb; in cfe_close() local
61 xiocb.xiocb_fcode = CFE_CMD_DEV_CLOSE; in cfe_close()
62 xiocb.xiocb_status = 0; in cfe_close()
63 xiocb.xiocb_handle = handle; in cfe_close()
64 xiocb.xiocb_flags = 0; in cfe_close()
65 xiocb.xiocb_psize = 0; in cfe_close()
67 cfe_iocb_dispatch(&xiocb); in cfe_close()
69 return xiocb.xiocb_status; in cfe_close()
75 struct cfe_xiocb xiocb; in cfe_cpu_start() local
77 xiocb.xiocb_fcode = CFE_CMD_FW_CPUCTL; in cfe_cpu_start()
78 xiocb.xiocb_status = 0; in cfe_cpu_start()
79 xiocb.xiocb_handle = 0; in cfe_cpu_start()
80 xiocb.xiocb_flags = 0; in cfe_cpu_start()
81 xiocb.xiocb_psize = sizeof(struct xiocb_cpuctl); in cfe_cpu_start()
82 xiocb.plist.xiocb_cpuctl.cpu_number = cpu; in cfe_cpu_start()
83 xiocb.plist.xiocb_cpuctl.cpu_command = CFE_CPU_CMD_START; in cfe_cpu_start()
84 xiocb.plist.xiocb_cpuctl.gp_val = gp; in cfe_cpu_start()
85 xiocb.plist.xiocb_cpuctl.sp_val = sp; in cfe_cpu_start()
86 xiocb.plist.xiocb_cpuctl.a1_val = a1; in cfe_cpu_start()
87 xiocb.plist.xiocb_cpuctl.start_addr = (long) fn; in cfe_cpu_start()
89 cfe_iocb_dispatch(&xiocb); in cfe_cpu_start()
91 return xiocb.xiocb_status; in cfe_cpu_start()
96 struct cfe_xiocb xiocb; in cfe_cpu_stop() local
98 xiocb.xiocb_fcode = CFE_CMD_FW_CPUCTL; in cfe_cpu_stop()
99 xiocb.xiocb_status = 0; in cfe_cpu_stop()
100 xiocb.xiocb_handle = 0; in cfe_cpu_stop()
101 xiocb.xiocb_flags = 0; in cfe_cpu_stop()
102 xiocb.xiocb_psize = sizeof(struct xiocb_cpuctl); in cfe_cpu_stop()
103 xiocb.plist.xiocb_cpuctl.cpu_number = cpu; in cfe_cpu_stop()
104 xiocb.plist.xiocb_cpuctl.cpu_command = CFE_CPU_CMD_STOP; in cfe_cpu_stop()
106 cfe_iocb_dispatch(&xiocb); in cfe_cpu_stop()
108 return xiocb.xiocb_status; in cfe_cpu_stop()
113 struct cfe_xiocb xiocb; in cfe_enumenv() local
115 xiocb.xiocb_fcode = CFE_CMD_ENV_SET; in cfe_enumenv()
116 xiocb.xiocb_status = 0; in cfe_enumenv()
117 xiocb.xiocb_handle = 0; in cfe_enumenv()
118 xiocb.xiocb_flags = 0; in cfe_enumenv()
119 xiocb.xiocb_psize = sizeof(struct xiocb_envbuf); in cfe_enumenv()
120 xiocb.plist.xiocb_envbuf.enum_idx = idx; in cfe_enumenv()
121 xiocb.plist.xiocb_envbuf.name_ptr = XPTR_FROM_NATIVE(name); in cfe_enumenv()
122 xiocb.plist.xiocb_envbuf.name_length = namelen; in cfe_enumenv()
123 xiocb.plist.xiocb_envbuf.val_ptr = XPTR_FROM_NATIVE(val); in cfe_enumenv()
124 xiocb.plist.xiocb_envbuf.val_length = vallen; in cfe_enumenv()
126 cfe_iocb_dispatch(&xiocb); in cfe_enumenv()
128 return xiocb.xiocb_status; in cfe_enumenv()
134 struct cfe_xiocb xiocb; in cfe_enummem() local
136 xiocb.xiocb_fcode = CFE_CMD_FW_MEMENUM; in cfe_enummem()
137 xiocb.xiocb_status = 0; in cfe_enummem()
138 xiocb.xiocb_handle = 0; in cfe_enummem()
139 xiocb.xiocb_flags = flags; in cfe_enummem()
140 xiocb.xiocb_psize = sizeof(struct xiocb_meminfo); in cfe_enummem()
141 xiocb.plist.xiocb_meminfo.mi_idx = idx; in cfe_enummem()
143 cfe_iocb_dispatch(&xiocb); in cfe_enummem()
145 if (xiocb.xiocb_status < 0) in cfe_enummem()
146 return xiocb.xiocb_status; in cfe_enummem()
148 *start = xiocb.plist.xiocb_meminfo.mi_addr; in cfe_enummem()
149 *length = xiocb.plist.xiocb_meminfo.mi_size; in cfe_enummem()
150 *type = xiocb.plist.xiocb_meminfo.mi_type; in cfe_enummem()
157 struct cfe_xiocb xiocb; in cfe_exit() local
159 xiocb.xiocb_fcode = CFE_CMD_FW_RESTART; in cfe_exit()
160 xiocb.xiocb_status = 0; in cfe_exit()
161 xiocb.xiocb_handle = 0; in cfe_exit()
162 xiocb.xiocb_flags = warm ? CFE_FLG_WARMSTART : 0; in cfe_exit()
163 xiocb.xiocb_psize = sizeof(struct xiocb_exitstat); in cfe_exit()
164 xiocb.plist.xiocb_exitstat.status = status; in cfe_exit()
166 cfe_iocb_dispatch(&xiocb); in cfe_exit()
168 return xiocb.xiocb_status; in cfe_exit()
173 struct cfe_xiocb xiocb; in cfe_flushcache() local
175 xiocb.xiocb_fcode = CFE_CMD_FW_FLUSHCACHE; in cfe_flushcache()
176 xiocb.xiocb_status = 0; in cfe_flushcache()
177 xiocb.xiocb_handle = 0; in cfe_flushcache()
178 xiocb.xiocb_flags = flg; in cfe_flushcache()
179 xiocb.xiocb_psize = 0; in cfe_flushcache()
181 cfe_iocb_dispatch(&xiocb); in cfe_flushcache()
183 return xiocb.xiocb_status; in cfe_flushcache()
188 struct cfe_xiocb xiocb; in cfe_getdevinfo() local
190 xiocb.xiocb_fcode = CFE_CMD_DEV_GETINFO; in cfe_getdevinfo()
191 xiocb.xiocb_status = 0; in cfe_getdevinfo()
192 xiocb.xiocb_handle = 0; in cfe_getdevinfo()
193 xiocb.xiocb_flags = 0; in cfe_getdevinfo()
194 xiocb.xiocb_psize = sizeof(struct xiocb_buffer); in cfe_getdevinfo()
195 xiocb.plist.xiocb_buffer.buf_offset = 0; in cfe_getdevinfo()
196 xiocb.plist.xiocb_buffer.buf_ptr = XPTR_FROM_NATIVE(name); in cfe_getdevinfo()
197 xiocb.plist.xiocb_buffer.buf_length = strlen(name); in cfe_getdevinfo()
199 cfe_iocb_dispatch(&xiocb); in cfe_getdevinfo()
201 if (xiocb.xiocb_status < 0) in cfe_getdevinfo()
202 return xiocb.xiocb_status; in cfe_getdevinfo()
203 return xiocb.plist.xiocb_buffer.buf_ioctlcmd; in cfe_getdevinfo()
208 struct cfe_xiocb xiocb; in cfe_getenv() local
212 xiocb.xiocb_fcode = CFE_CMD_ENV_GET; in cfe_getenv()
213 xiocb.xiocb_status = 0; in cfe_getenv()
214 xiocb.xiocb_handle = 0; in cfe_getenv()
215 xiocb.xiocb_flags = 0; in cfe_getenv()
216 xiocb.xiocb_psize = sizeof(struct xiocb_envbuf); in cfe_getenv()
217 xiocb.plist.xiocb_envbuf.enum_idx = 0; in cfe_getenv()
218 xiocb.plist.xiocb_envbuf.name_ptr = XPTR_FROM_NATIVE(name); in cfe_getenv()
219 xiocb.plist.xiocb_envbuf.name_length = strlen(name); in cfe_getenv()
220 xiocb.plist.xiocb_envbuf.val_ptr = XPTR_FROM_NATIVE(dest); in cfe_getenv()
221 xiocb.plist.xiocb_envbuf.val_length = destlen; in cfe_getenv()
223 cfe_iocb_dispatch(&xiocb); in cfe_getenv()
225 return xiocb.xiocb_status; in cfe_getenv()
230 struct cfe_xiocb xiocb; in cfe_getfwinfo() local
232 xiocb.xiocb_fcode = CFE_CMD_FW_GETINFO; in cfe_getfwinfo()
233 xiocb.xiocb_status = 0; in cfe_getfwinfo()
234 xiocb.xiocb_handle = 0; in cfe_getfwinfo()
235 xiocb.xiocb_flags = 0; in cfe_getfwinfo()
236 xiocb.xiocb_psize = sizeof(struct xiocb_fwinfo); in cfe_getfwinfo()
238 cfe_iocb_dispatch(&xiocb); in cfe_getfwinfo()
240 if (xiocb.xiocb_status < 0) in cfe_getfwinfo()
241 return xiocb.xiocb_status; in cfe_getfwinfo()
243 info->fwi_version = xiocb.plist.xiocb_fwinfo.fwi_version; in cfe_getfwinfo()
244 info->fwi_totalmem = xiocb.plist.xiocb_fwinfo.fwi_totalmem; in cfe_getfwinfo()
245 info->fwi_flags = xiocb.plist.xiocb_fwinfo.fwi_flags; in cfe_getfwinfo()
246 info->fwi_boardid = xiocb.plist.xiocb_fwinfo.fwi_boardid; in cfe_getfwinfo()
247 info->fwi_bootarea_va = xiocb.plist.xiocb_fwinfo.fwi_bootarea_va; in cfe_getfwinfo()
248 info->fwi_bootarea_pa = xiocb.plist.xiocb_fwinfo.fwi_bootarea_pa; in cfe_getfwinfo()
250 xiocb.plist.xiocb_fwinfo.fwi_bootarea_size; in cfe_getfwinfo()
257 struct cfe_xiocb xiocb; in cfe_getstdhandle() local
259 xiocb.xiocb_fcode = CFE_CMD_DEV_GETHANDLE; in cfe_getstdhandle()
260 xiocb.xiocb_status = 0; in cfe_getstdhandle()
261 xiocb.xiocb_handle = 0; in cfe_getstdhandle()
262 xiocb.xiocb_flags = flg; in cfe_getstdhandle()
263 xiocb.xiocb_psize = 0; in cfe_getstdhandle()
265 cfe_iocb_dispatch(&xiocb); in cfe_getstdhandle()
267 if (xiocb.xiocb_status < 0) in cfe_getstdhandle()
268 return xiocb.xiocb_status; in cfe_getstdhandle()
269 return xiocb.xiocb_handle; in cfe_getstdhandle()
275 struct cfe_xiocb xiocb; in cfe_getticks() local
277 xiocb.xiocb_fcode = CFE_CMD_FW_GETTIME; in cfe_getticks()
278 xiocb.xiocb_status = 0; in cfe_getticks()
279 xiocb.xiocb_handle = 0; in cfe_getticks()
280 xiocb.xiocb_flags = 0; in cfe_getticks()
281 xiocb.xiocb_psize = sizeof(struct xiocb_time); in cfe_getticks()
282 xiocb.plist.xiocb_time.ticks = 0; in cfe_getticks()
284 cfe_iocb_dispatch(&xiocb); in cfe_getticks()
286 return xiocb.plist.xiocb_time.ticks; in cfe_getticks()
292 struct cfe_xiocb xiocb; in cfe_inpstat() local
294 xiocb.xiocb_fcode = CFE_CMD_DEV_INPSTAT; in cfe_inpstat()
295 xiocb.xiocb_status = 0; in cfe_inpstat()
296 xiocb.xiocb_handle = handle; in cfe_inpstat()
297 xiocb.xiocb_flags = 0; in cfe_inpstat()
298 xiocb.xiocb_psize = sizeof(struct xiocb_inpstat); in cfe_inpstat()
299 xiocb.plist.xiocb_inpstat.inp_status = 0; in cfe_inpstat()
301 cfe_iocb_dispatch(&xiocb); in cfe_inpstat()
303 if (xiocb.xiocb_status < 0) in cfe_inpstat()
304 return xiocb.xiocb_status; in cfe_inpstat()
305 return xiocb.plist.xiocb_inpstat.inp_status; in cfe_inpstat()
312 struct cfe_xiocb xiocb; in cfe_ioctl() local
314 xiocb.xiocb_fcode = CFE_CMD_DEV_IOCTL; in cfe_ioctl()
315 xiocb.xiocb_status = 0; in cfe_ioctl()
316 xiocb.xiocb_handle = handle; in cfe_ioctl()
317 xiocb.xiocb_flags = 0; in cfe_ioctl()
318 xiocb.xiocb_psize = sizeof(struct xiocb_buffer); in cfe_ioctl()
319 xiocb.plist.xiocb_buffer.buf_offset = offset; in cfe_ioctl()
320 xiocb.plist.xiocb_buffer.buf_ioctlcmd = ioctlnum; in cfe_ioctl()
321 xiocb.plist.xiocb_buffer.buf_ptr = XPTR_FROM_NATIVE(buffer); in cfe_ioctl()
322 xiocb.plist.xiocb_buffer.buf_length = length; in cfe_ioctl()
324 cfe_iocb_dispatch(&xiocb); in cfe_ioctl()
327 *retlen = xiocb.plist.xiocb_buffer.buf_retlen; in cfe_ioctl()
328 return xiocb.xiocb_status; in cfe_ioctl()
333 struct cfe_xiocb xiocb; in cfe_open() local
335 xiocb.xiocb_fcode = CFE_CMD_DEV_OPEN; in cfe_open()
336 xiocb.xiocb_status = 0; in cfe_open()
337 xiocb.xiocb_handle = 0; in cfe_open()
338 xiocb.xiocb_flags = 0; in cfe_open()
339 xiocb.xiocb_psize = sizeof(struct xiocb_buffer); in cfe_open()
340 xiocb.plist.xiocb_buffer.buf_offset = 0; in cfe_open()
341 xiocb.plist.xiocb_buffer.buf_ptr = XPTR_FROM_NATIVE(name); in cfe_open()
342 xiocb.plist.xiocb_buffer.buf_length = strlen(name); in cfe_open()
344 cfe_iocb_dispatch(&xiocb); in cfe_open()
346 if (xiocb.xiocb_status < 0) in cfe_open()
347 return xiocb.xiocb_status; in cfe_open()
348 return xiocb.xiocb_handle; in cfe_open()
358 struct cfe_xiocb xiocb; in cfe_readblk() local
360 xiocb.xiocb_fcode = CFE_CMD_DEV_READ; in cfe_readblk()
361 xiocb.xiocb_status = 0; in cfe_readblk()
362 xiocb.xiocb_handle = handle; in cfe_readblk()
363 xiocb.xiocb_flags = 0; in cfe_readblk()
364 xiocb.xiocb_psize = sizeof(struct xiocb_buffer); in cfe_readblk()
365 xiocb.plist.xiocb_buffer.buf_offset = offset; in cfe_readblk()
366 xiocb.plist.xiocb_buffer.buf_ptr = XPTR_FROM_NATIVE(buffer); in cfe_readblk()
367 xiocb.plist.xiocb_buffer.buf_length = length; in cfe_readblk()
369 cfe_iocb_dispatch(&xiocb); in cfe_readblk()
371 if (xiocb.xiocb_status < 0) in cfe_readblk()
372 return xiocb.xiocb_status; in cfe_readblk()
373 return xiocb.plist.xiocb_buffer.buf_retlen; in cfe_readblk()
378 struct cfe_xiocb xiocb; in cfe_setenv() local
380 xiocb.xiocb_fcode = CFE_CMD_ENV_SET; in cfe_setenv()
381 xiocb.xiocb_status = 0; in cfe_setenv()
382 xiocb.xiocb_handle = 0; in cfe_setenv()
383 xiocb.xiocb_flags = 0; in cfe_setenv()
384 xiocb.xiocb_psize = sizeof(struct xiocb_envbuf); in cfe_setenv()
385 xiocb.plist.xiocb_envbuf.enum_idx = 0; in cfe_setenv()
386 xiocb.plist.xiocb_envbuf.name_ptr = XPTR_FROM_NATIVE(name); in cfe_setenv()
387 xiocb.plist.xiocb_envbuf.name_length = strlen(name); in cfe_setenv()
388 xiocb.plist.xiocb_envbuf.val_ptr = XPTR_FROM_NATIVE(val); in cfe_setenv()
389 xiocb.plist.xiocb_envbuf.val_length = strlen(val); in cfe_setenv()
391 cfe_iocb_dispatch(&xiocb); in cfe_setenv()
393 return xiocb.xiocb_status; in cfe_setenv()
403 struct cfe_xiocb xiocb; in cfe_writeblk() local
405 xiocb.xiocb_fcode = CFE_CMD_DEV_WRITE; in cfe_writeblk()
406 xiocb.xiocb_status = 0; in cfe_writeblk()
407 xiocb.xiocb_handle = handle; in cfe_writeblk()
408 xiocb.xiocb_flags = 0; in cfe_writeblk()
409 xiocb.xiocb_psize = sizeof(struct xiocb_buffer); in cfe_writeblk()
410 xiocb.plist.xiocb_buffer.buf_offset = offset; in cfe_writeblk()
411 xiocb.plist.xiocb_buffer.buf_ptr = XPTR_FROM_NATIVE(buffer); in cfe_writeblk()
412 xiocb.plist.xiocb_buffer.buf_length = length; in cfe_writeblk()
414 cfe_iocb_dispatch(&xiocb); in cfe_writeblk()
416 if (xiocb.xiocb_status < 0) in cfe_writeblk()
417 return xiocb.xiocb_status; in cfe_writeblk()
418 return xiocb.plist.xiocb_buffer.buf_retlen; in cfe_writeblk()