diff --git a/porting/npl/linux/include/nimble/nimble_npl_os.h b/porting/npl/linux/include/nimble/nimble_npl_os.h index 15f7820a6..bdd398869 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 #include -#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 2d6efed7c..000000000 --- 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 5704707e5..3aaec08ad 100644 --- a/porting/npl/linux/src/os_atomic.c +++ b/porting/npl/linux/src/os_atomic.c @@ -20,7 +20,7 @@ #include #include -#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 ead7ff1dc..180470592 100644 --- a/porting/npl/linux/src/os_callout.c +++ b/porting/npl/linux/src/os_callout.c @@ -25,7 +25,7 @@ #include #include -#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 a1459bdf1..041583691 100644 --- a/porting/npl/linux/src/os_eventq.cc +++ b/porting/npl/linux/src/os_eventq.cc @@ -21,7 +21,7 @@ #include #include -#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 f4bcf654c..bdc254c9a 100644 --- a/porting/npl/linux/src/os_mutex.c +++ b/porting/npl/linux/src/os_mutex.c @@ -21,6 +21,7 @@ #include #include #include "os/os.h" +#include "nimble/nimble_npl.h" #include diff --git a/porting/npl/linux/src/os_sem.c b/porting/npl/linux/src/os_sem.c index 46701acc4..bec0039fa 100644 --- a/porting/npl/linux/src/os_sem.c +++ b/porting/npl/linux/src/os_sem.c @@ -21,6 +21,7 @@ #include #include #include "os/os.h" +#include "nimble/nimble_npl.h" #include #include diff --git a/porting/npl/linux/src/os_task.c b/porting/npl/linux/src/os_task.c index 959ab0ed8..2ba7432fc 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 55cbb61af..613e299f9 100644 --- a/porting/npl/linux/src/os_time.c +++ b/porting/npl/linux/src/os_time.c @@ -21,6 +21,7 @@ #include #include #include "os/os.h" +#include "nimble/nimble_npl.h" #include diff --git a/porting/npl/linux/src/os_types.h b/porting/npl/linux/src/os_types.h index 5b978af6d..c88a3e857 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