|
@@ -27,14 +27,19 @@
|
|
|
|
|
|
#include "dmm_config.h"
|
|
|
|
|
|
+#ifndef LEON3
|
|
|
#include <stdint.h>
|
|
|
#include <stddef.h> /* For size_t support */
|
|
|
#include <stdbool.h>
|
|
|
+#else
|
|
|
+#include <sys/types.h>
|
|
|
+#endif
|
|
|
|
|
|
#ifdef HAVE_LOCKS
|
|
|
#include <pthread.h>
|
|
|
#endif /* HAVE_LOCKS */
|
|
|
|
|
|
+#ifdef WITH_KNOBS
|
|
|
/**
|
|
|
* A structure for knobs states (currently 5)
|
|
|
*
|
|
@@ -42,6 +47,7 @@
|
|
|
*
|
|
|
* */
|
|
|
typedef uint8_t knob_state_t;
|
|
|
+#endif /* WITH_KNOBS */
|
|
|
|
|
|
/** A structure to represent a maptable node. */
|
|
|
typedef struct maptable_node_s {
|
|
@@ -95,7 +101,11 @@ typedef struct heap_s {
|
|
|
void *free_list_head; /**< The head of the free list. */
|
|
|
void *used_blocks_head; /**< The head of the used blocks list. */
|
|
|
void *rov_ptr; /**< Roving pointer. */
|
|
|
+#ifndef LEON3
|
|
|
uint64_t num_objects; /**< Number of objects in the heap. */
|
|
|
+#else
|
|
|
+ unsigned long num_objects; /**< Number of objects in the heap. */
|
|
|
+#endif /* LEON3 */
|
|
|
#ifdef WITH_STATS
|
|
|
dmmstats_t dmm_stats; /**< Statistics of the heap. */
|
|
|
#endif /* WITH_STATS */
|
|
@@ -110,7 +120,11 @@ typedef struct heap_s {
|
|
|
/** The allocator structure of dmmlib. */
|
|
|
typedef struct allocator_s {
|
|
|
heap_t heaps[NUM_HEAPS]; /**< The heaps that the allocator manages. */
|
|
|
+#ifndef LEON3
|
|
|
bool initialized; /**< Initialization flag of the allocator. */
|
|
|
+#else
|
|
|
+ char initialized; /**< Initialization flag of the allocator. */
|
|
|
+#endif /* LEON3 */
|
|
|
void *border_ptr; /**< Border pointer of the allocator. */
|
|
|
#ifdef WITH_MEMORY_SPACE_AWARENESS
|
|
|
size_t remaining_size; /**< The size of the remaining free space which
|