hc
2024-12-19 9370bb92b2d16684ee45cf24e879c93c509162da
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
/* SPDX-License-Identifier: GPL-2.0+ */
 
#ifndef ZC_H
# define ZC_H
 
/* For zero copy */
int __cryptodev_get_userbuf(uint8_t __user *addr, uint32_t len, int write,
       unsigned int pgcount, struct page **pg, struct scatterlist *sg,
       struct task_struct *task, struct mm_struct *mm);
void cryptodev_release_user_pages(struct csession *ses);
 
int cryptodev_get_userbuf(struct csession *ses,
                void *__user src, unsigned int src_len,
                void *__user dst, unsigned int dst_len,
                struct task_struct *task, struct mm_struct *mm,
                struct scatterlist **src_sg,
                struct scatterlist **dst_sg);
 
/* buflen ? (last page - first page + 1) : 0 */
#define PAGECOUNT(buf, buflen) ((buflen) \
   ? ((((unsigned long)(buf + buflen - 1)) >> PAGE_SHIFT) - \
      (((unsigned long)(buf             )) >> PAGE_SHIFT) + 1) \
   : 0)
 
#define DEFAULT_PREALLOC_PAGES 32
 
#endif