MCPcopy Create free account
hub / github.com/F-Stack/f-stack / cvm_page_apply

Function cvm_page_apply

freebsd/opencrypto/criov.c:157–178  ·  view source on GitHub ↗

* Apply function f to the data in a vm_page_t list starting "off" bytes from * the beginning, continuing for "len" bytes. */

Source from the content-addressed store, hash-verified

155 * the beginning, continuing for "len" bytes.
156 */
157static int
158cvm_page_apply(vm_page_t *pages, int off, int len,
159 int (*f)(void *, const void *, u_int), void *arg)
160{
161 int processed = 0;
162 unsigned count;
163 int rval;
164
165 CVM_PAGE_SKIP();
166 while (len > 0) {
167 char *kaddr = (char *)PHYS_TO_DMAP(VM_PAGE_TO_PHYS(*pages));
168 count = min(PAGE_SIZE - off, len);
169 rval = (*f)(arg, kaddr + off, count);
170 if (rval)
171 return (rval);
172 len -= count;
173 processed += count;
174 off = 0;
175 pages++;
176 }
177 return (0);
178}
179
180static inline void *
181cvm_page_contiguous_segment(vm_page_t *pages, size_t skip, int len)

Callers 1

crypto_apply_bufFunction · 0.85

Calls 1

minFunction · 0.85

Tested by

no test coverage detected