Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
iorpc_mpipe.c
Go to the documentation of this file.
1 /*
2  * Copyright 2012 Tilera Corporation. All Rights Reserved.
3  *
4  * This program is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU General Public License
6  * as published by the Free Software Foundation, version 2.
7  *
8  * This program is distributed in the hope that it will be useful, but
9  * WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or
11  * NON INFRINGEMENT. See the GNU General Public License for
12  * more details.
13  */
14 
15 /* This file is machine-generated; DO NOT EDIT! */
16 #include "gxio/iorpc_mpipe.h"
17 
19  unsigned int count;
20  unsigned int first;
21  unsigned int flags;
22 };
23 
25  unsigned int count, unsigned int first,
26  unsigned int flags)
27 {
28  struct alloc_buffer_stacks_param temp;
30 
31  params->count = count;
32  params->first = first;
33  params->flags = flags;
34 
35  return hv_dev_pwrite(context->fd, 0, (HV_VirtAddr) params,
36  sizeof(*params),
38 }
39 
41 
44  unsigned int stack;
45  unsigned int buffer_size_enum;
46 };
47 
49  void *mem_va, size_t mem_size,
50  unsigned int mem_flags, unsigned int stack,
51  unsigned int buffer_size_enum)
52 {
53  int __result;
54  unsigned long long __cpa;
55  pte_t __pte;
56  struct init_buffer_stack_aux_param temp;
58 
59  __result = va_to_cpa_and_pte(mem_va, &__cpa, &__pte);
60  if (__result != 0)
61  return __result;
62  params->buffer.kernel.cpa = __cpa;
63  params->buffer.kernel.size = mem_size;
64  params->buffer.kernel.pte = __pte;
65  params->buffer.kernel.flags = mem_flags;
66  params->stack = stack;
68 
69  return hv_dev_pwrite(context->fd, 0, (HV_VirtAddr) params,
70  sizeof(*params),
72 }
73 
75 
76 
78  unsigned int count;
79  unsigned int first;
80  unsigned int flags;
81 };
82 
84  unsigned int count, unsigned int first,
85  unsigned int flags)
86 {
87  struct alloc_notif_rings_param temp;
89 
90  params->count = count;
91  params->first = first;
92  params->flags = flags;
93 
94  return hv_dev_pwrite(context->fd, 0, (HV_VirtAddr) params,
95  sizeof(*params), GXIO_MPIPE_OP_ALLOC_NOTIF_RINGS);
96 }
97 
99 
102  unsigned int ring;
103 };
104 
106  size_t mem_size, unsigned int mem_flags,
107  unsigned int ring)
108 {
109  int __result;
110  unsigned long long __cpa;
111  pte_t __pte;
112  struct init_notif_ring_aux_param temp;
114 
115  __result = va_to_cpa_and_pte(mem_va, &__cpa, &__pte);
116  if (__result != 0)
117  return __result;
118  params->buffer.kernel.cpa = __cpa;
119  params->buffer.kernel.size = mem_size;
120  params->buffer.kernel.pte = __pte;
121  params->buffer.kernel.flags = mem_flags;
122  params->ring = ring;
123 
124  return hv_dev_pwrite(context->fd, 0, (HV_VirtAddr) params,
125  sizeof(*params),
127 }
128 
130 
133  unsigned int ring;
134 };
135 
137  int inter_x, int inter_y,
138  int inter_ipi, int inter_event,
139  unsigned int ring)
140 {
143 
144  params->interrupt.kernel.x = inter_x;
145  params->interrupt.kernel.y = inter_y;
146  params->interrupt.kernel.ipi = inter_ipi;
147  params->interrupt.kernel.event = inter_event;
148  params->ring = ring;
149 
150  return hv_dev_pwrite(context->fd, 0, (HV_VirtAddr) params,
151  sizeof(*params),
153 }
154 
156 
158  unsigned int ring;
159 };
160 
162  unsigned int ring)
163 {
166 
167  params->ring = ring;
168 
169  return hv_dev_pwrite(context->fd, 0, (HV_VirtAddr) params,
170  sizeof(*params),
172 }
173 
175 
177  unsigned int count;
178  unsigned int first;
179  unsigned int flags;
180 };
181 
183  unsigned int count, unsigned int first,
184  unsigned int flags)
185 {
186  struct alloc_notif_groups_param temp;
188 
189  params->count = count;
190  params->first = first;
191  params->flags = flags;
192 
193  return hv_dev_pwrite(context->fd, 0, (HV_VirtAddr) params,
194  sizeof(*params), GXIO_MPIPE_OP_ALLOC_NOTIF_GROUPS);
195 }
196 
198 
200  unsigned int group;
202 };
203 
205  unsigned int group,
207 {
208  struct init_notif_group_param temp;
210 
211  params->group = group;
212  params->bits = bits;
213 
214  return hv_dev_pwrite(context->fd, 0, (HV_VirtAddr) params,
215  sizeof(*params), GXIO_MPIPE_OP_INIT_NOTIF_GROUP);
216 }
217 
219 
221  unsigned int count;
222  unsigned int first;
223  unsigned int flags;
224 };
225 
227  unsigned int first, unsigned int flags)
228 {
229  struct alloc_buckets_param temp;
230  struct alloc_buckets_param *params = &temp;
231 
232  params->count = count;
233  params->first = first;
234  params->flags = flags;
235 
236  return hv_dev_pwrite(context->fd, 0, (HV_VirtAddr) params,
237  sizeof(*params), GXIO_MPIPE_OP_ALLOC_BUCKETS);
238 }
239 
241 
243  unsigned int bucket;
245 };
246 
248  MPIPE_LBL_INIT_DAT_BSTS_TBL_t bucket_info)
249 {
250  struct init_bucket_param temp;
251  struct init_bucket_param *params = &temp;
252 
253  params->bucket = bucket;
254  params->bucket_info = bucket_info;
255 
256  return hv_dev_pwrite(context->fd, 0, (HV_VirtAddr) params,
257  sizeof(*params), GXIO_MPIPE_OP_INIT_BUCKET);
258 }
259 
261 
263  unsigned int count;
264  unsigned int first;
265  unsigned int flags;
266 };
267 
269  unsigned int count, unsigned int first,
270  unsigned int flags)
271 {
272  struct alloc_edma_rings_param temp;
274 
275  params->count = count;
276  params->first = first;
277  params->flags = flags;
278 
279  return hv_dev_pwrite(context->fd, 0, (HV_VirtAddr) params,
280  sizeof(*params), GXIO_MPIPE_OP_ALLOC_EDMA_RINGS);
281 }
282 
284 
287  unsigned int ring;
288  unsigned int channel;
289 };
290 
292  size_t mem_size, unsigned int mem_flags,
293  unsigned int ring, unsigned int channel)
294 {
295  int __result;
296  unsigned long long __cpa;
297  pte_t __pte;
298  struct init_edma_ring_aux_param temp;
300 
301  __result = va_to_cpa_and_pte(mem_va, &__cpa, &__pte);
302  if (__result != 0)
303  return __result;
304  params->buffer.kernel.cpa = __cpa;
305  params->buffer.kernel.size = mem_size;
306  params->buffer.kernel.pte = __pte;
307  params->buffer.kernel.flags = mem_flags;
308  params->ring = ring;
309  params->channel = channel;
310 
311  return hv_dev_pwrite(context->fd, 0, (HV_VirtAddr) params,
312  sizeof(*params), GXIO_MPIPE_OP_INIT_EDMA_RING_AUX);
313 }
314 
316 
317 
319  size_t blob_size)
320 {
321  const void *params = blob;
322 
323  return hv_dev_pwrite(context->fd, 0, (HV_VirtAddr) params, blob_size,
325 }
326 
328 
330  unsigned int iotlb;
332  unsigned int flags;
333 };
334 
336  unsigned int iotlb, HV_PTE pte,
337  unsigned int flags)
338 {
339  struct register_client_memory_param temp;
341 
342  params->iotlb = iotlb;
343  params->pte = pte;
344  params->flags = flags;
345 
346  return hv_dev_pwrite(context->fd, 0, (HV_VirtAddr) params,
347  sizeof(*params),
349 }
350 
352 
355  unsigned int flags;
356 };
357 
359  _gxio_mpipe_link_name_t name, unsigned int flags)
360 {
361  struct link_open_aux_param temp;
362  struct link_open_aux_param *params = &temp;
363 
364  params->name = name;
365  params->flags = flags;
366 
367  return hv_dev_pwrite(context->fd, 0, (HV_VirtAddr) params,
368  sizeof(*params), GXIO_MPIPE_OP_LINK_OPEN_AUX);
369 }
370 
372 
374  int mac;
375 };
376 
378 {
379  struct link_close_aux_param temp;
380  struct link_close_aux_param *params = &temp;
381 
382  params->mac = mac;
383 
384  return hv_dev_pwrite(context->fd, 0, (HV_VirtAddr) params,
385  sizeof(*params), GXIO_MPIPE_OP_LINK_CLOSE_AUX);
386 }
387 
389 
390 
395 };
396 
398  uint64_t * nsec, uint64_t * cycles)
399 {
400  int __result;
401  struct get_timestamp_aux_param temp;
403 
404  __result =
405  hv_dev_pread(context->fd, 0, (HV_VirtAddr) params, sizeof(*params),
407  *sec = params->sec;
408  *nsec = params->nsec;
409  *cycles = params->cycles;
410 
411  return __result;
412 }
413 
415 
420 };
421 
423  uint64_t nsec, uint64_t cycles)
424 {
425  struct set_timestamp_aux_param temp;
427 
428  params->sec = sec;
429  params->nsec = nsec;
430  params->cycles = cycles;
431 
432  return hv_dev_pwrite(context->fd, 0, (HV_VirtAddr) params,
433  sizeof(*params), GXIO_MPIPE_OP_SET_TIMESTAMP_AUX);
434 }
435 
437 
439  int64_t nsec;
440 };
441 
443  int64_t nsec)
444 {
445  struct adjust_timestamp_aux_param temp;
447 
448  params->nsec = nsec;
449 
450  return hv_dev_pwrite(context->fd, 0, (HV_VirtAddr) params,
451  sizeof(*params),
453 }
454 
456 
457 struct arm_pollfd_param {
458  union iorpc_pollfd pollfd;
459 };
460 
462 {
463  struct arm_pollfd_param temp;
464  struct arm_pollfd_param *params = &temp;
465 
466  params->pollfd.kernel.cookie = pollfd_cookie;
467 
468  return hv_dev_pwrite(context->fd, 0, (HV_VirtAddr) params,
469  sizeof(*params), GXIO_MPIPE_OP_ARM_POLLFD);
470 }
471 
473 
474 struct close_pollfd_param {
475  union iorpc_pollfd pollfd;
476 };
477 
479 {
480  struct close_pollfd_param temp;
481  struct close_pollfd_param *params = &temp;
482 
483  params->pollfd.kernel.cookie = pollfd_cookie;
484 
485  return hv_dev_pwrite(context->fd, 0, (HV_VirtAddr) params,
486  sizeof(*params), GXIO_MPIPE_OP_CLOSE_POLLFD);
487 }
488 
490 
491 struct get_mmio_base_param {
492  HV_PTE base;
493 };
494 
496 {
497  int __result;
498  struct get_mmio_base_param temp;
499  struct get_mmio_base_param *params = &temp;
500 
501  __result =
502  hv_dev_pread(context->fd, 0, (HV_VirtAddr) params, sizeof(*params),
504  *base = params->base;
505 
506  return __result;
507 }
508 
510 
512  unsigned long offset;
513  unsigned long size;
514 };
515 
517  unsigned long offset, unsigned long size)
518 {
519  struct check_mmio_offset_param temp;
521 
522  params->offset = offset;
523  params->size = size;
524 
525  return hv_dev_pwrite(context->fd, 0, (HV_VirtAddr) params,
526  sizeof(*params), GXIO_MPIPE_OP_CHECK_MMIO_OFFSET);
527 }
528