25 #include <nucleus/synch.h>
26 #include <nucleus/heap.h>
30 #define H_PRIO XNSYNCH_PRIO
31 #define H_FIFO XNSYNCH_FIFO
33 #define H_MAPPABLE 0x200
34 #define H_SINGLE 0x400
35 #define H_SHARED (H_MAPPABLE|H_SINGLE)
36 #define H_NONCACHED 0x800
37 #define H_DMA32 0x1000
55 char name[XNOBJECT_NAME_LEN];
57 unsigned long phys_addr;
61 typedef struct rt_heap_placeholder {
67 } RT_HEAP_PLACEHOLDER;
69 #if defined(__KERNEL__) || defined(__XENO_SIM__)
73 #define XENO_HEAP_MAGIC 0x55550808
75 typedef struct rt_heap {
91 char name[XNOBJECT_NAME_LEN];
93 #ifdef CONFIG_XENO_OPT_PERVASIVE
99 #define rlink2heap(ln) container_of(ln, RT_HEAP, rlink)
109 #ifdef CONFIG_XENO_OPT_NATIVE_HEAP
111 int __native_heap_pkg_init(
void);
113 void __native_heap_pkg_cleanup(
void);
115 static inline void __native_heap_flush_rq(xnqueue_t *rq)
117 xeno_flush_rq_norelease(RT_HEAP, rq, heap);
120 int rt_heap_delete_inner(RT_HEAP *heap,
121 void __user *mapaddr);
125 #define __native_heap_pkg_init() ({ 0; })
126 #define __native_heap_pkg_cleanup() do { } while(0)
127 #define __native_heap_flush_rq(rq) do { } while(0)
137 typedef RT_HEAP_PLACEHOLDER RT_HEAP;
Structure containing heap-information useful to users.
Definition: heap.h:43
int rt_heap_bind(RT_HEAP *heap, const char *name, RTIME timeout)
Bind to a mappable heap.
Definition: heap.c:70
int rt_heap_inquire(RT_HEAP *heap, RT_HEAP_INFO *info)
Inquire about a heap.
Definition: heap.c:122
int rt_heap_create(RT_HEAP *heap, const char *name, size_t heapsize, int mode)
Create a memory heap or a shared memory segment.
Definition: heap.c:49
int rt_heap_delete(RT_HEAP *heap)
Delete a real-time heap.
Definition: heap.c:95
int rt_heap_unbind(RT_HEAP *heap)
Unbind from a mappable heap.
Definition: heap.c:81
This file is part of the Xenomai project.
int rt_heap_free(RT_HEAP *heap, void *block)
Free a block.
Definition: heap.c:117
struct rt_heap_info RT_HEAP_INFO
Structure containing heap-information useful to users.
int rt_heap_alloc(RT_HEAP *heap, size_t size, RTIME timeout, void **blockp)
Allocate a block or return the single segment base.
Definition: heap.c:110
This file is part of the Xenomai project.