[rtems-libbsd commit] Make the domain allocation size global to allow it to set in tests.

Chris Johns chrisj at rtems.org
Mon Jun 27 03:48:07 UTC 2016


Module:    rtems-libbsd
Branch:    master
Commit:    130fa3534f5cc10ea34053246916046ab1b0f006
Changeset: http://git.rtems.org/rtems-libbsd/commit/?id=130fa3534f5cc10ea34053246916046ab1b0f006

Author:    Chris Johns <chrisj at rtems.org>
Date:      Mon Jun 27 13:09:04 2016 +1000

Make the domain allocation size global to allow it to set in tests.

Some BSPs with multiple NIC locked in the tests due to not enough
memory. This provides a simple per BSP way to increase the memory
size.

---

 rtemsbsd/include/rtems/bsd/bsd.h                     | 7 +++++++
 rtemsbsd/rtems/rtems-bsd-get-allocator-domain-size.c | 4 +++-
 2 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/rtemsbsd/include/rtems/bsd/bsd.h b/rtemsbsd/include/rtems/bsd/bsd.h
index 8ab0fda..1583dc9 100644
--- a/rtemsbsd/include/rtems/bsd/bsd.h
+++ b/rtemsbsd/include/rtems/bsd/bsd.h
@@ -112,6 +112,13 @@ typedef enum {
 } rtems_bsd_allocator_domain;
 
 /**
+ * @brief The size for the page/mbufs default allocator domain.
+ *
+ * Applications may set this value to change the value returned by the default.
+ */
+extern uintptr_t rtems_bsd_allocator_domain_page_mbuf_size;
+
+/**
  * @brief Returns the size for a specific allocator domain.
  *
  * Applications may provide their own implementation of this function.  For
diff --git a/rtemsbsd/rtems/rtems-bsd-get-allocator-domain-size.c b/rtemsbsd/rtems/rtems-bsd-get-allocator-domain-size.c
index 6471911..a52ee50 100644
--- a/rtemsbsd/rtems/rtems-bsd-get-allocator-domain-size.c
+++ b/rtemsbsd/rtems/rtems-bsd-get-allocator-domain-size.c
@@ -39,6 +39,8 @@
 
 #include <rtems/bsd/bsd.h>
 
+uintptr_t rtems_bsd_allocator_domain_page_mbuf_size = 8 * 1024 * 1024;
+
 uintptr_t
 rtems_bsd_get_allocator_domain_size(rtems_bsd_allocator_domain domain)
 {
@@ -47,7 +49,7 @@ rtems_bsd_get_allocator_domain_size(rtems_bsd_allocator_domain domain)
 	switch (domain) {
 		case RTEMS_BSD_ALLOCATOR_DOMAIN_PAGE:
 		case RTEMS_BSD_ALLOCATOR_DOMAIN_MBUF:
-			size = 8 * 1024 * 1024;
+			size = rtems_bsd_allocator_domain_page_mbuf_size;
 			break;
 		default:
 			size = 0;



More information about the vc mailing list