|
Zephyr API 3.6.99
|
Loading...
Searching...
No Matches
Go to the documentation of this file.
6#ifndef __XEN_GENERIC_H__
7#define __XEN_GENERIC_H__
11#define XEN_PAGE_SIZE 4096
12#define XEN_PAGE_SHIFT 12
14#define XEN_PFN_UP(x) (unsigned long)(((x) + XEN_PAGE_SIZE-1) >> XEN_PAGE_SHIFT)
15#define XEN_PFN_DOWN(x) (unsigned long)((x) >> XEN_PAGE_SHIFT)
16#define XEN_PFN_PHYS(x) ((unsigned long)(x) << XEN_PAGE_SHIFT)
17#define XEN_PHYS_PFN(x) (unsigned long)((x) >> XEN_PAGE_SHIFT)
19#define xen_to_phys(x) ((unsigned long) (x))
20#define xen_to_virt(x) ((void *) (x))
22#define xen_virt_to_gfn(_virt) (XEN_PFN_DOWN(xen_to_phys(_virt)))
23#define xen_gfn_to_virt(_gfn) (xen_to_virt(XEN_PFN_PHYS(_gfn)))
29#define synch_cmpxchg(ptr, old, new) \
30({ __typeof__(*ptr) stored = old; \
31 __atomic_compare_exchange_n(ptr, &stored, new, 0, __ATOMIC_SEQ_CST, \
32 __ATOMIC_SEQ_CST) ? new : old; \