You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by GitBox <gi...@apache.org> on 2018/11/05 13:36:36 UTC

[GitHub] andrzej-kaczmarek closed pull request #169: [linux] Cleanup npl layer in linux port.

andrzej-kaczmarek closed pull request #169: [linux] Cleanup npl layer in linux port.
URL: https://github.com/apache/mynewt-nimble/pull/169
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/porting/examples/linux/include/syscfg/syscfg.h b/porting/examples/linux/include/syscfg/syscfg.h
index 766d1333..da4dd524 100644
--- a/porting/examples/linux/include/syscfg/syscfg.h
+++ b/porting/examples/linux/include/syscfg/syscfg.h
@@ -598,7 +598,7 @@
 #endif
 
 #ifndef MYNEWT_VAL_BLE_L2CAP_COC_MAX_NUM
-#define MYNEWT_VAL_BLE_L2CAP_COC_MAX_NUM (0)
+#define MYNEWT_VAL_BLE_L2CAP_COC_MAX_NUM (1)
 #endif
 
 #ifndef MYNEWT_VAL_BLE_L2CAP_JOIN_RX_FRAGS
diff --git a/porting/nimble/Makefile.controller b/porting/nimble/Makefile.controller
index b6e2ce4e..8bc2c2a0 100644
--- a/porting/nimble/Makefile.controller
+++ b/porting/nimble/Makefile.controller
@@ -22,6 +22,7 @@ NIMBLE_INCLUDE += \
 	$(NIMBLE_ROOT)/nimble/transport/ram/include \
 	$(NIMBLE_ROOT)/nimble/controller/include \
 	$(NIMBLE_ROOT)/nimble/drivers/nrf52/include \
+	$(NULL)
 
 NIMBLE_SRC += \
 	$(NIMBLE_ROOT)/nimble/transport/ram/src/ble_hci_ram.c \
@@ -45,3 +46,4 @@ NIMBLE_SRC += \
 	$(NIMBLE_ROOT)/porting/nimble/src/os_cputime.c \
 	$(NIMBLE_ROOT)/porting/nimble/src/os_cputime_pwr2.c \
 	$(NIMBLE_ROOT)/porting/nimble/src/hal_timer.c \
+	$(NULL)
diff --git a/porting/nimble/Makefile.defs b/porting/nimble/Makefile.defs
index 87e1cc73..3e0f7be3 100644
--- a/porting/nimble/Makefile.defs
+++ b/porting/nimble/Makefile.defs
@@ -35,6 +35,7 @@ NIMBLE_INCLUDE := \
 	$(NIMBLE_ROOT)/nimble/host/store/ram/include \
 	$(NIMBLE_ROOT)/nimble/host/util/include \
 	$(NIMBLE_ROOT)/porting/nimble/include \
+	$(NULL)
 
 NIMBLE_SRC := \
 	$(NIMBLE_ROOT)/nimble/host/src/ble_att.c \
@@ -87,10 +88,13 @@ NIMBLE_SRC := \
 	$(NIMBLE_ROOT)/nimble/host/store/ram/src/ble_store_ram.c \
 	$(NIMBLE_ROOT)/nimble/host/util/src/addr.c \
 	$(NIMBLE_ROOT)/nimble/src/ble_util.c \
+	$(NIMBLE_ROOT)/nimble/src/hci_common.c \
+        $(NULL)
 
 # Few utils and data structures copied from Mynewt
 NIMBLE_SRC += \
 	$(NIMBLE_ROOT)/porting/nimble/src/nimble_port.c \
+	$(NULL)
 
 # Few utils and data structures copied from Mynewt
 NIMBLE_SRC += \
@@ -99,6 +103,7 @@ NIMBLE_SRC += \
 	$(NIMBLE_ROOT)/porting/nimble/src/os_mbuf.c \
 	$(NIMBLE_ROOT)/porting/nimble/src/os_mempool.c \
 	$(NIMBLE_ROOT)/porting/nimble/src/os_msys_init.c \
+	$(NULL)
 
 ifneq (,$(NIMBLE_CFG_CONTROLLER))
 include $(NIMBLE_ROOT)/porting/nimble/Makefile.controller
diff --git a/porting/nimble/Makefile.mesh b/porting/nimble/Makefile.mesh
index e4a8d479..2f47a781 100644
--- a/porting/nimble/Makefile.mesh
+++ b/porting/nimble/Makefile.mesh
@@ -17,6 +17,7 @@
 
 NIMBLE_INCLUDE += \
 	$(NIMBLE_ROOT)/nimble/host/mesh/include \
+	$(NULL)
 
 NIMBLE_SRC += \
 	$(NIMBLE_ROOT)/nimble/host/mesh/src/access.c \
@@ -40,3 +41,4 @@ NIMBLE_SRC += \
 	$(NIMBLE_ROOT)/nimble/host/mesh/src/shell.c \
 	$(NIMBLE_ROOT)/nimble/host/mesh/src/testing.c \
 	$(NIMBLE_ROOT)/nimble/host/mesh/src/transport.c \
+	$(NULL)
diff --git a/porting/nimble/Makefile.tinycrypt b/porting/nimble/Makefile.tinycrypt
index c9ae0298..ab6b9e2c 100644
--- a/porting/nimble/Makefile.tinycrypt
+++ b/porting/nimble/Makefile.tinycrypt
@@ -17,6 +17,7 @@
 
 NIMBLE_INCLUDE += \
 	$(NIMBLE_ROOT)/ext/tinycrypt/include \
+	$(NULL)
 
 NIMBLE_SRC += \
 	$(NIMBLE_ROOT)/ext/tinycrypt/src/aes_decrypt.c \
@@ -25,3 +26,4 @@ NIMBLE_SRC += \
 	$(NIMBLE_ROOT)/ext/tinycrypt/src/ecc.c \
 	$(NIMBLE_ROOT)/ext/tinycrypt/src/ecc_dh.c \
 	$(NIMBLE_ROOT)/ext/tinycrypt/src/utils.c \
+	$(NULL)
diff --git a/porting/npl/linux/include/nimble/nimble_npl_os.h b/porting/npl/linux/include/nimble/nimble_npl_os.h
index 15f7820a..bdd39886 100644
--- a/porting/npl/linux/include/nimble/nimble_npl_os.h
+++ b/porting/npl/linux/include/nimble/nimble_npl_os.h
@@ -24,7 +24,7 @@
 #include <stdint.h>
 #include <string.h>
 
-#include "npl_osal.h"
+#include "os_types.h"
 
 #ifdef __cplusplus
 extern "C" {
@@ -34,10 +34,6 @@ extern "C" {
 
 #define BLE_NPL_TIME_FOREVER    INT32_MAX
 
-/* This should be compatible with TickType_t */
-typedef uint32_t ble_npl_time_t;
-typedef int32_t ble_npl_stime_t;
-
 #define SYSINIT_PANIC_MSG(msg) __assert_fail(msg, __FILE__, __LINE__, __func__)
 
 #define SYSINIT_PANIC_ASSERT_MSG(rc, msg) do \
diff --git a/porting/npl/linux/src/npl_osal.h b/porting/npl/linux/src/npl_osal.h
deleted file mode 100644
index 2d6efed7..00000000
--- a/porting/npl/linux/src/npl_osal.h
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *  http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#ifndef _NPL_OSAL_H
-#define _NPL_OSAL_H
-
-#include "os_types.h"
-
-#include "nimble/nimble_npl.h"
-
-#include "os/os.h"
-
-#endif // _NPL_OSAL_H
\ No newline at end of file
diff --git a/porting/npl/linux/src/os_atomic.c b/porting/npl/linux/src/os_atomic.c
index 5704707e..3aaec08a 100644
--- a/porting/npl/linux/src/os_atomic.c
+++ b/porting/npl/linux/src/os_atomic.c
@@ -20,7 +20,7 @@
 #include <stdint.h>
 #include <pthread.h>
 
-#include "npl_osal.h"
+#include "nimble/nimble_npl.h"
 
 static pthread_mutex_t s_mutex = PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP;
 
diff --git a/porting/npl/linux/src/os_callout.c b/porting/npl/linux/src/os_callout.c
index ead7ff1d..18047059 100644
--- a/porting/npl/linux/src/os_callout.c
+++ b/porting/npl/linux/src/os_callout.c
@@ -25,7 +25,7 @@
 #include <time.h>
 #include <signal.h>
 
-#include "npl_osal.h"
+#include "nimble/nimble_npl.h"
 
 static void
 ble_npl_callout_timer_cb(union sigval sv)
@@ -40,7 +40,6 @@ ble_npl_callout_timer_cb(union sigval sv)
     }
 }
 
-
 void ble_npl_callout_init(struct ble_npl_callout *c, 
                           struct ble_npl_eventq *evq,
                           ble_npl_event_fn *ev_cb, 
diff --git a/porting/npl/linux/src/os_eventq.cc b/porting/npl/linux/src/os_eventq.cc
index a1459bdf..04158369 100644
--- a/porting/npl/linux/src/os_eventq.cc
+++ b/porting/npl/linux/src/os_eventq.cc
@@ -21,7 +21,7 @@
 #include <stdint.h>
 #include <string.h>
 
-#include "npl_osal.h"
+#include "nimble/nimble_npl.h"
 #include "wqueue.h"
 
 extern "C" {
diff --git a/porting/npl/linux/src/os_mutex.c b/porting/npl/linux/src/os_mutex.c
index f4bcf654..bdc254c9 100644
--- a/porting/npl/linux/src/os_mutex.c
+++ b/porting/npl/linux/src/os_mutex.c
@@ -21,6 +21,7 @@
 #include <stdint.h>
 #include <string.h>
 #include "os/os.h"
+#include "nimble/nimble_npl.h"
 
 #include <pthread.h>
 
diff --git a/porting/npl/linux/src/os_sem.c b/porting/npl/linux/src/os_sem.c
index 46701acc..bec0039f 100644
--- a/porting/npl/linux/src/os_sem.c
+++ b/porting/npl/linux/src/os_sem.c
@@ -21,6 +21,7 @@
 #include <stdint.h>
 #include <string.h>
 #include "os/os.h"
+#include "nimble/nimble_npl.h"
 
 #include <errno.h>
 #include <pthread.h>
diff --git a/porting/npl/linux/src/os_task.c b/porting/npl/linux/src/os_task.c
index 959ab0ed..2ba7432f 100644
--- a/porting/npl/linux/src/os_task.c
+++ b/porting/npl/linux/src/os_task.c
@@ -18,6 +18,7 @@
  */
 
 #include "os/os.h"
+#include "nimble/nimble_npl.h"
 
 #ifdef __cplusplus
 extern "C" {
@@ -105,6 +106,11 @@ bool ble_npl_os_started(void)
     return true;
 }
 
+void ble_npl_task_yield(void)
+{
+    pthread_yield();
+}
+
 #ifdef __cplusplus
 }
 #endif
diff --git a/porting/npl/linux/src/os_time.c b/porting/npl/linux/src/os_time.c
index 55cbb61a..613e299f 100644
--- a/porting/npl/linux/src/os_time.c
+++ b/porting/npl/linux/src/os_time.c
@@ -21,6 +21,7 @@
 #include <stdint.h>
 #include <string.h>
 #include "os/os.h"
+#include "nimble/nimble_npl.h"
 
 #include <time.h>
 
diff --git a/porting/npl/linux/src/os_types.h b/porting/npl/linux/src/os_types.h
index 5b978af6..c88a3e85 100644
--- a/porting/npl/linux/src/os_types.h
+++ b/porting/npl/linux/src/os_types.h
@@ -38,8 +38,6 @@ typedef int32_t ble_npl_stime_t;
 //typedef int os_sr_t;
 typedef int ble_npl_stack_t;
 
-struct ble_npl_event;
-typedef void ble_npl_event_fn(struct ble_npl_event *ev);
 
 struct ble_npl_event {
     uint8_t                 ev_queued;
@@ -82,4 +80,6 @@ int ble_npl_task_remove(struct ble_npl_task *t);
 
 uint8_t ble_npl_task_count(void);
 
+void ble_npl_task_yield(void);
+
 #endif // _NPL_OS_TYPES_H


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services