[PATCH 3/6] libmm-libbsp-shared. Files shared between all target BSPs and low-level implementations for libmm. These shared files contain mm.h which is a link between high-level score api and low-level implemenation of libmm. mm.h contains function declarations which should be implemented by target BSP to support libmm. no_memorymanagement.c contains stubs for BSPs that do not support libmm.

Hesham AL-Matary heshamelmatary at gmail.com
Thu Sep 12 06:59:30 UTC 2013


---
 c/src/lib/libbsp/shared/include/mm.h              | 36 +++++++++++++++++++++++
 c/src/lib/libbsp/shared/src/no_memorymanagement.c | 21 +++++++++++++
 2 files changed, 57 insertions(+)
 create mode 100644 c/src/lib/libbsp/shared/include/mm.h
 create mode 100644 c/src/lib/libbsp/shared/src/no_memorymanagement.c

diff --git a/c/src/lib/libbsp/shared/include/mm.h b/c/src/lib/libbsp/shared/include/mm.h
new file mode 100644
index 0000000..f2ac71c
--- /dev/null
+++ b/c/src/lib/libbsp/shared/include/mm.h
@@ -0,0 +1,36 @@
+/*
+ * Copyright (c) 2013 Gedare Bloom.
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.rtems.com/license/LICENSE.
+ */
+
+#ifndef __LIBBSP_MM_H
+#define __LIBBSP_MM_H
+
+#include <stdint.h>
+#include <stdlib.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef struct {
+  uint32_t begin;
+  uint32_t end;
+  uint32_t flags;
+} mm_init_start_config;
+
+void bsp_memory_management_initialize(void);
+
+void bsp_memory_management_set_attributes(
+  uintptr_t base,
+  size_t size,
+  uint32_t attr
+);
+
+#ifdef __cplusplus
+}
+#endif
+#endif
diff --git a/c/src/lib/libbsp/shared/src/no_memorymanagement.c b/c/src/lib/libbsp/shared/src/no_memorymanagement.c
new file mode 100644
index 0000000..1a5fc63
--- /dev/null
+++ b/c/src/lib/libbsp/shared/src/no_memorymanagement.c
@@ -0,0 +1,21 @@
+/*
+ * Copyright (c) 2013 Hesham AL-Matary
+ * Copyright (c) 2013 Gedare Bloom.
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.rtems.com/license/LICENSE.
+ */
+
+#include <rtems.h>
+#include <libbsp/mm.h>
+
+void bsp_memory_management_initialize( void ) { }
+
+void bsp_memory_management_set_attributes(
+  uintptr_t base,
+  size_t size,
+  uint32_t flags 
+)
+{
+}
-- 
1.8.3.1




More information about the devel mailing list