27 #include <nucleus/heap.h>
29 typedef struct xeno_resource_holder {
33 #define ppd2rholder(a) container_of(a, struct xeno_resource_holder, ppd)
49 extern xeno_rholder_t __native_global_rholder;
51 #ifdef CONFIG_XENO_OPT_PERVASIVE
53 extern int __native_muxid;
55 static inline xeno_rholder_t *xeno_get_rholder(
void)
60 return &__native_global_rholder;
62 return ppd2rholder(ppd);
65 #define __xeno_release_obj(obj) \
73 static inline xeno_rholder_t *xeno_get_rholder(
void)
75 return &__native_global_rholder;
78 #define __xeno_release_obj(obj) do { } while(0)
82 #if XENO_DEBUG(NATIVE)
83 #define __xeno_trace_release(__name, __obj, __err) \
84 xnprintf("native: cleaning up %s \"%s\" (ret=%d).\n", \
85 __name, (__obj)->name, __err)
87 #define __xeno_trace_release(__name, __obj, __err)
90 #define __xeno_flush_rq(__type, __rq, __name, __release) \
92 int rt_##__name##_delete(__type *); \
93 xnholder_t *holder, *nholder; \
97 xnlock_get_irqsave(&nklock, s); \
98 nholder = getheadq(__rq); \
99 while ((holder = nholder) != NULL) { \
100 nholder = nextq((__rq), holder); \
101 xnlock_put_irqrestore(&nklock, s); \
102 obj = rlink2##__name(holder); \
103 err = rt_##__name##_delete(obj); \
104 __xeno_trace_release(#__name, obj, err); \
105 if (unlikely(err)) { \
106 xnlock_get_irqsave(&nklock, s); \
107 if ((__rq) != &__native_global_rholder.__name##q) { \
108 nholder = popq((__rq), holder); \
109 appendq(&__native_global_rholder.__name##q, holder); \
110 obj->rqueue = &__native_global_rholder.__name##q; \
114 __xeno_release_obj(obj); \
115 xnlock_get_irqsave(&nklock, s); \
118 xnlock_put_irqrestore(&nklock, s); \
121 #define xeno_flush_rq(__type, __rq, __name) \
122 __xeno_flush_rq(__type, __rq, __name, 1)
124 #define xeno_flush_rq_norelease(__type, __rq, __name) \
125 __xeno_flush_rq(__type, __rq, __name, 0)
xnshadow_ppd_t * xnshadow_ppd_get(unsigned muxid)
Return the per-process data attached to the calling process.
Definition: shadow.c:3014
Real-time pod interface header.