Zephyr Project API 3.7.0
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
generic.h File Reference

Go to the source code of this file.

Macros

#define XEN_PAGE_SIZE   4096
 
#define XEN_PAGE_SHIFT   12
 
#define XEN_PFN_UP(x)   (unsigned long)(((x) + XEN_PAGE_SIZE-1) >> XEN_PAGE_SHIFT)
 
#define XEN_PFN_DOWN(x)   (unsigned long)((x) >> XEN_PAGE_SHIFT)
 
#define XEN_PFN_PHYS(x)   ((unsigned long)(x) << XEN_PAGE_SHIFT)
 
#define XEN_PHYS_PFN(x)   (unsigned long)((x) >> XEN_PAGE_SHIFT)
 
#define xen_to_phys(x)   ((unsigned long) (x))
 
#define xen_to_virt(x)   ((void *) (x))
 
#define xen_virt_to_gfn(_virt)   (XEN_PFN_DOWN(xen_to_phys(_virt)))
 
#define xen_gfn_to_virt(_gfn)   (xen_to_virt(XEN_PFN_PHYS(_gfn)))
 
#define synch_cmpxchg(ptr, old, new)
 

Macro Definition Documentation

◆ synch_cmpxchg

#define synch_cmpxchg (   ptr,
  old,
  new 
)
Value:
({ __typeof__(*ptr) stored = old; \
__atomic_compare_exchange_n(ptr, &stored, new, 0, __ATOMIC_SEQ_CST, \
__ATOMIC_SEQ_CST) ? new : old; \
})
void * ptr
Definition printk.c:177

◆ xen_gfn_to_virt

#define xen_gfn_to_virt (   _gfn)    (xen_to_virt(XEN_PFN_PHYS(_gfn)))

◆ XEN_PAGE_SHIFT

#define XEN_PAGE_SHIFT   12

◆ XEN_PAGE_SIZE

#define XEN_PAGE_SIZE   4096

◆ XEN_PFN_DOWN

#define XEN_PFN_DOWN (   x)    (unsigned long)((x) >> XEN_PAGE_SHIFT)

◆ XEN_PFN_PHYS

#define XEN_PFN_PHYS (   x)    ((unsigned long)(x) << XEN_PAGE_SHIFT)

◆ XEN_PFN_UP

#define XEN_PFN_UP (   x)    (unsigned long)(((x) + XEN_PAGE_SIZE-1) >> XEN_PAGE_SHIFT)

◆ XEN_PHYS_PFN

#define XEN_PHYS_PFN (   x)    (unsigned long)((x) >> XEN_PAGE_SHIFT)

◆ xen_to_phys

#define xen_to_phys (   x)    ((unsigned long) (x))

◆ xen_to_virt

#define xen_to_virt (   x)    ((void *) (x))

◆ xen_virt_to_gfn

#define xen_virt_to_gfn (   _virt)    (XEN_PFN_DOWN(xen_to_phys(_virt)))