@@ -83,36 +83,42 @@ __syscall struct vregion *vregion_get(struct vregion *vr);
8383__syscall struct vregion * vregion_put (struct vregion * vr );
8484
8585/**
86- * @brief Allocate memory from the specified virtual region.
86+ * @brief Allocate aligned memory from the specified virtual region.
87+ *
88+ * Allocate aligned memory from the specified virtual region using the
89+ * current allocation mode (lifetime or interim).
8790 *
8891 * @param[in] vr Pointer to the virtual region instance.
8992 * @param[in] size Size of memory to allocate in bytes.
93+ * @param[in] alignment Alignment of memory to allocate in bytes.
9094 * @return void* Pointer to the allocated memory, or NULL on failure.
9195 */
92- __syscall void * vregion_alloc (struct vregion * vr , size_t size );
96+ __syscall void * vregion_alloc_align (struct vregion * vr , size_t size , size_t alignment );
9397
9498/**
95- * @brief like vregion_alloc () but allocates coherent memory
99+ * @brief like vregion_alloc_align () but allocates coherent memory
96100 */
97- __syscall void * vregion_alloc_coherent (struct vregion * vr , size_t size );
101+ __syscall void * vregion_alloc_coherent_align (struct vregion * vr , size_t size , size_t alignment );
98102
99103/**
100- * @brief Allocate aligned memory from the specified virtual region.
101- *
102- * Allocate aligned memory from the specified virtual region using the
103- * current allocation mode (lifetime or interim).
104+ * @brief Allocate memory from the specified virtual region.
104105 *
105106 * @param[in] vr Pointer to the virtual region instance.
106107 * @param[in] size Size of memory to allocate in bytes.
107- * @param[in] alignment Alignment of memory to allocate in bytes.
108108 * @return void* Pointer to the allocated memory, or NULL on failure.
109109 */
110- __syscall void * vregion_alloc_align (struct vregion * vr , size_t size , size_t alignment );
110+ static inline void * vregion_alloc (struct vregion * vr , size_t size )
111+ {
112+ return vregion_alloc_align (vr , size , 0 );
113+ }
111114
112115/**
113- * @brief like vregion_alloc_align () but allocates coherent memory
116+ * @brief like vregion_alloc () but allocates coherent memory
114117 */
115- __syscall void * vregion_alloc_coherent_align (struct vregion * vr , size_t size , size_t alignment );
118+ static inline void * vregion_alloc_coherent (struct vregion * vr , size_t size )
119+ {
120+ return vregion_alloc_coherent_align (vr , size , 0 );
121+ }
116122
117123/**
118124 * @brief Free memory allocated from the specified virtual region.
0 commit comments