Xenomai  3.0.5
rtnet_iovec.h
1 /* rtnet_iovec.h
2  *
3  * RTnet - real-time networking subsystem
4  * Copyright (C) 1999,2000 Zentropic Computing, LLC
5  * 2002 Ulrich Marx <marx@kammer.uni-hannover.de>
6  *
7  * This program is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation; either version 2 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, write to the Free Software
19  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20  */
21 #ifndef __RTNET_IOVEC_H_
22 #define __RTNET_IOVEC_H_
23 
24 #ifdef __KERNEL__
25 
26 #include <linux/uio.h>
27 
28 
29 /***
30  * rt_iovec_len
31  */
32 static inline size_t rt_iovec_len(const struct iovec *iov, int iovlen)
33 {
34  int i;
35  size_t len = 0;
36 
37  for (i = 0; i < iovlen; i++)
38  len += iov[i].iov_len;
39 
40  return len;
41 }
42 
43 
44 extern void rt_memcpy_tokerneliovec(struct iovec *iov, unsigned char *kdata, int len);
45 extern void rt_memcpy_fromkerneliovec(unsigned char *kdata, struct iovec *iov, int len);
46 
47 
48 #endif /* __KERNEL__ */
49 
50 #endif /* __RTNET_IOVEC_H_ */