Paparazzi UAS v7.0_unstable
Paparazzi is a free software Unmanned Aircraft System.
Loading...
Searching...
No Matches
virt2phys.h
Go to the documentation of this file.
1#ifndef PARROT_VIRT2PHYS
2#define PARROT_VIRT2PHYS
3
4#include <sys/types.h>
5#include <unistd.h>
6
7struct physmem {
8 unsigned long paddr;
9 size_t size;
10};
11
12/* check_contiguity - Get information on physical memory associated with virtual
13 * address.
14 *
15 * @param[in] vaddr : the virtual address in the context of process pid
16 * @param[in] pid : a valid pid
17 * @param[in] *pmem : Valid only if fonction returns 0.
18 * pmem->paddr contains physical address of the first byte.
19 * pmem->size contains the number of contiguous bytes checked. If size is not zero, buffer is contiguous if pmem->size >= size.
20 * @param[in] size : if size>0 contiguity is checked as far as possible.
21 * : if size=0, check contiguity until at least size bytes had been checked as contiguous.
22 * @return 0 if vaddr can be converted in physical address and -1 otherwise.
23 */
24int check_contiguity(unsigned long vaddr, pid_t pid, struct physmem *pmem, size_t size);
25
26#endif // PARROT_VIRT2PHYS
uint16_t foo
Definition main_demo5.c:58
unsigned long paddr
Definition virt2phys.h:8
size_t size
Definition virt2phys.h:9
int check_contiguity(unsigned long vaddr, pid_t pid, struct physmem *pmem, size_t size)
Definition virt2phys.c:111