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/03/30 01:22:03 UTC

[GitHub] ccollins476ad closed pull request #969: Add convenience header: os/mynewt.h

ccollins476ad closed pull request #969: Add convenience header: os/mynewt.h
URL: https://github.com/apache/mynewt-core/pull/969
 
 
   

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/apps/blecent/src/blecent.h b/apps/blecent/src/blecent.h
index 262b685a0..2d598644c 100644
--- a/apps/blecent/src/blecent.h
+++ b/apps/blecent/src/blecent.h
@@ -20,7 +20,7 @@
 #ifndef H_BLECENT_
 #define H_BLECENT_
 
-#include "os/queue.h"
+#include "os/mynewt.h"
 #include "log/log.h"
 #ifdef __cplusplus
 extern "C" {
diff --git a/apps/blecent/src/main.c b/apps/blecent/src/main.c
index 0516de416..ff44fbf95 100755
--- a/apps/blecent/src/main.c
+++ b/apps/blecent/src/main.c
@@ -19,10 +19,8 @@
 
 #include <assert.h>
 #include <string.h>
-#include "syscfg/syscfg.h"
-#include "sysinit/sysinit.h"
+#include "os/mynewt.h"
 #include "bsp/bsp.h"
-#include "os/os.h"
 
 /* BLE */
 #include "nimble/ble.h"
diff --git a/apps/blecsc/src/gatt_svr.c b/apps/blecsc/src/gatt_svr.c
index 2767787b9..e17a38ed2 100644
--- a/apps/blecsc/src/gatt_svr.c
+++ b/apps/blecsc/src/gatt_svr.c
@@ -20,10 +20,10 @@
 #include <assert.h>
 #include <stdio.h>
 #include <string.h>
+#include "os/mynewt.h"
 #include "host/ble_hs.h"
 #include "host/ble_uuid.h"
 #include "blecsc_sens.h"
-#include "os/endian.h"
 
 #define CSC_ERR_CCC_DESC_IMPROPERLY_CONFIGURED  0x81
 
diff --git a/apps/blecsc/src/main.c b/apps/blecsc/src/main.c
index 9d91eb9e4..de9c26003 100644
--- a/apps/blecsc/src/main.c
+++ b/apps/blecsc/src/main.c
@@ -22,8 +22,7 @@
 #include <stdio.h>
 #include <errno.h>
 
-#include "sysinit/sysinit.h"
-#include "os/os.h"
+#include "os/mynewt.h"
 #include "console/console.h"
 #include "config/config.h"
 #include "nimble/ble.h"
diff --git a/apps/blehci/src/main.c b/apps/blehci/src/main.c
index 04f4e880d..040c1572c 100755
--- a/apps/blehci/src/main.c
+++ b/apps/blehci/src/main.c
@@ -16,9 +16,9 @@
  * specific language governing permissions and limitations
  * under the License.
  */
+
 #include <assert.h>
-#include "sysinit/sysinit.h"
-#include "os/os.h"
+#include "os/mynewt.h"
 
 int
 main(void)
diff --git a/apps/blehr/src/main.c b/apps/blehr/src/main.c
index 276d3e5dc..e538beeb7 100644
--- a/apps/blehr/src/main.c
+++ b/apps/blehr/src/main.c
@@ -22,8 +22,7 @@
 #include <stdio.h>
 #include <errno.h>
 
-#include "sysinit/sysinit.h"
-#include "os/os.h"
+#include "os/mynewt.h"
 #include "console/console.h"
 #include "config/config.h"
 #include "nimble/ble.h"
diff --git a/apps/blemesh/src/main.c b/apps/blemesh/src/main.c
index 0d48ef193..e6b1a3c8c 100755
--- a/apps/blemesh/src/main.c
+++ b/apps/blemesh/src/main.c
@@ -16,9 +16,9 @@
  * specific language governing permissions and limitations
  * under the License.
  */
+
 #include <assert.h>
-#include "sysinit/sysinit.h"
-#include "os/os.h"
+#include "os/mynewt.h"
 #include "mesh/mesh.h"
 #include "console/console.h"
 #include "hal/hal_system.h"
diff --git a/apps/blemesh_shell/src/main.c b/apps/blemesh_shell/src/main.c
index 3b5c9c691..b8ba8a35e 100755
--- a/apps/blemesh_shell/src/main.c
+++ b/apps/blemesh_shell/src/main.c
@@ -16,9 +16,9 @@
  * specific language governing permissions and limitations
  * under the License.
  */
+
 #include <assert.h>
-#include "sysinit/sysinit.h"
-#include "os/os.h"
+#include "os/mynewt.h"
 #include "mesh/mesh.h"
 #include "console/console.h"
 #include "hal/hal_system.h"
diff --git a/apps/bleprph/src/main.c b/apps/bleprph/src/main.c
index 1b4b26fdd..61547ad79 100755
--- a/apps/bleprph/src/main.c
+++ b/apps/bleprph/src/main.c
@@ -21,9 +21,7 @@
 #include <string.h>
 #include <stdio.h>
 #include <errno.h>
-#include "sysinit/sysinit.h"
-#include "bsp/bsp.h"
-#include "os/os.h"
+#include "os/mynewt.h"
 #include "bsp/bsp.h"
 #include "hal/hal_gpio.h"
 #include "console/console.h"
diff --git a/apps/bleprph/src/phy.c b/apps/bleprph/src/phy.c
index 55c367ea3..c6fb2b351 100755
--- a/apps/bleprph/src/phy.c
+++ b/apps/bleprph/src/phy.c
@@ -17,11 +17,10 @@
  * under the License.
  */
 
+#include "os/mynewt.h"
 #include "bsp/bsp.h"
 #include "hal/hal_gpio.h"
 #include "host/ble_gap.h"
-#include "os/os_eventq.h"
-#include "syscfg/syscfg.h"
 #include "bleprph.h"
 
 #if MYNEWT_VAL(BLEPRPH_LE_PHY_SUPPORT)
diff --git a/apps/bleprph_oic/src/main.c b/apps/bleprph_oic/src/main.c
index 108a46049..e8a1fe3ce 100755
--- a/apps/bleprph_oic/src/main.c
+++ b/apps/bleprph_oic/src/main.c
@@ -21,9 +21,7 @@
 #include <string.h>
 #include <stdio.h>
 #include <errno.h>
-#include <sysinit/sysinit.h>
-#include <bsp/bsp.h>
-#include <os/os.h>
+#include "os/mynewt.h"
 #include <bsp/bsp.h>
 #include <hal/hal_gpio.h>
 #include <console/console.h>
diff --git a/apps/blesplit/src/main.c b/apps/blesplit/src/main.c
index ce0500b23..2cd7c25ac 100755
--- a/apps/blesplit/src/main.c
+++ b/apps/blesplit/src/main.c
@@ -21,9 +21,7 @@
 #include <string.h>
 #include <stdio.h>
 #include <errno.h>
-#include "sysinit/sysinit.h"
-#include "bsp/bsp.h"
-#include "os/os.h"
+#include "os/mynewt.h"
 #include "bsp/bsp.h"
 #include "hal/hal_gpio.h"
 #include "console/console.h"
diff --git a/apps/bletest/src/bletest_hci.c b/apps/bletest/src/bletest_hci.c
index 24c050713..047290bd5 100755
--- a/apps/bletest/src/bletest_hci.c
+++ b/apps/bletest/src/bletest_hci.c
@@ -19,9 +19,8 @@
 
 #include <assert.h>
 #include <string.h>
-#include "os/os.h"
+#include "os/mynewt.h"
 #include "bsp/bsp.h"
-#include "syscfg/syscfg.h"
 
 /* BLE */
 #include "nimble/ble.h"
diff --git a/apps/bletest/src/main.c b/apps/bletest/src/main.c
index 76502e212..da76e8b29 100755
--- a/apps/bletest/src/main.c
+++ b/apps/bletest/src/main.c
@@ -19,9 +19,7 @@
 
 #include <assert.h>
 #include <string.h>
-#include "sysinit/sysinit.h"
-#include "syscfg/syscfg.h"
-#include "os/os.h"
+#include "os/mynewt.h"
 #include "bsp/bsp.h"
 #include "hal/hal_bsp.h"
 #include "hal/hal_gpio.h"
diff --git a/apps/bletiny/src/bletiny.h b/apps/bletiny/src/bletiny.h
index e59779102..05f14ef12 100644
--- a/apps/bletiny/src/bletiny.h
+++ b/apps/bletiny/src/bletiny.h
@@ -21,10 +21,10 @@
 #define H_BLETINY_PRIV_
 
 #include <inttypes.h>
+#include "os/mynewt.h"
 #include "nimble/ble.h"
 #include "nimble/nimble_opt.h"
 #include "log/log.h"
-#include "os/queue.h"
 
 #include "host/ble_gatt.h"
 #include "host/ble_gap.h"
diff --git a/apps/bletiny/src/main.c b/apps/bletiny/src/main.c
index 25a346696..03c115a22 100755
--- a/apps/bletiny/src/main.c
+++ b/apps/bletiny/src/main.c
@@ -21,13 +21,10 @@
 #include <string.h>
 #include <stdio.h>
 #include <errno.h>
-#include "syscfg/syscfg.h"
-#include "sysinit/sysinit.h"
+#include "os/mynewt.h"
 #include "bsp/bsp.h"
 #include "log/log.h"
 #include "stats/stats.h"
-#include "os/os.h"
-#include "bsp/bsp.h"
 #include "hal/hal_gpio.h"
 #include "console/console.h"
 #include "shell/shell.h"
diff --git a/apps/bleuart/src/main.c b/apps/bleuart/src/main.c
index 4f15ff4b0..6817f02ba 100755
--- a/apps/bleuart/src/main.c
+++ b/apps/bleuart/src/main.c
@@ -21,9 +21,7 @@
 #include <string.h>
 #include <stdio.h>
 #include <errno.h>
-#include "sysinit/sysinit.h"
-#include "bsp/bsp.h"
-#include "os/os.h"
+#include "os/mynewt.h"
 #include "bsp/bsp.h"
 #include "hal/hal_gpio.h"
 #include <imgmgr/imgmgr.h>
diff --git a/apps/boot/src/boot.c b/apps/boot/src/boot.c
index d6f0325a7..22dded3ca 100755
--- a/apps/boot/src/boot.c
+++ b/apps/boot/src/boot.c
@@ -20,16 +20,12 @@
 #include <assert.h>
 #include <stddef.h>
 #include <inttypes.h>
-#include "syscfg/syscfg.h"
+#include "os/mynewt.h"
 #include <flash_map/flash_map.h>
-#include <os/os.h>
 
 #include <hal/hal_bsp.h>
 #include <hal/hal_system.h>
 #include <hal/hal_flash.h>
-#if MYNEWT_VAL(BOOT_SERIAL)
-#include <sysinit/sysinit.h>
-#endif
 #include <console/console.h>
 #include "bootutil/image.h"
 #include "bootutil/bootutil.h"
diff --git a/apps/bsncent/src/bsncent.h b/apps/bsncent/src/bsncent.h
index d15a31c12..5aa742d5a 100644
--- a/apps/bsncent/src/bsncent.h
+++ b/apps/bsncent/src/bsncent.h
@@ -20,7 +20,7 @@
 #ifndef H_BSNCENT_
 #define H_BSNCENT_
 
-#include "os/queue.h"
+#include "os/mynewt.h"
 #include "log/log.h"
 #ifdef __cplusplus
 extern "C" {
diff --git a/apps/bsncent/src/main.c b/apps/bsncent/src/main.c
index ed89946c6..029eebca3 100755
--- a/apps/bsncent/src/main.c
+++ b/apps/bsncent/src/main.c
@@ -19,10 +19,8 @@
 
 #include <assert.h>
 #include <string.h>
-#include "syscfg/syscfg.h"
-#include "sysinit/sysinit.h"
+#include "os/mynewt.h"
 #include "bsp/bsp.h"
-#include "os/os.h"
 
 /* BLE */
 #include "nimble/ble.h"
diff --git a/apps/bsnprph/src/main.c b/apps/bsnprph/src/main.c
index 23e8b5a0b..02bb43e9c 100755
--- a/apps/bsnprph/src/main.c
+++ b/apps/bsnprph/src/main.c
@@ -21,9 +21,7 @@
 #include <string.h>
 #include <stdio.h>
 #include <errno.h>
-#include "sysinit/sysinit.h"
-#include "bsp/bsp.h"
-#include "os/os.h"
+#include "os/mynewt.h"
 #include "bsp/bsp.h"
 #include "hal/hal_gpio.h"
 #include "console/console.h"
diff --git a/apps/btshell/src/btshell.h b/apps/btshell/src/btshell.h
index 0abf325fc..f4614c046 100644
--- a/apps/btshell/src/btshell.h
+++ b/apps/btshell/src/btshell.h
@@ -21,10 +21,10 @@
 #define H_BTSHELL_PRIV_
 
 #include <inttypes.h>
+#include "os/mynewt.h"
 #include "nimble/ble.h"
 #include "nimble/nimble_opt.h"
 #include "log/log.h"
-#include "os/queue.h"
 
 #include "host/ble_gatt.h"
 #include "host/ble_gap.h"
diff --git a/apps/btshell/src/cmd.c b/apps/btshell/src/cmd.c
index 86fc9cfef..209680dbe 100644
--- a/apps/btshell/src/cmd.c
+++ b/apps/btshell/src/cmd.c
@@ -17,12 +17,11 @@
  * under the License.
  */
 
-#include "syscfg/syscfg.h"
-
 #include <assert.h>
 #include <inttypes.h>
 #include <errno.h>
 #include <string.h>
+#include "os/mynewt.h"
 #include "bsp/bsp.h"
 
 #include "nimble/ble.h"
diff --git a/apps/btshell/src/main.c b/apps/btshell/src/main.c
index 415ab91ef..8bb46874b 100755
--- a/apps/btshell/src/main.c
+++ b/apps/btshell/src/main.c
@@ -21,12 +21,10 @@
 #include <string.h>
 #include <stdio.h>
 #include <errno.h>
-#include "syscfg/syscfg.h"
-#include "sysinit/sysinit.h"
+#include "os/mynewt.h"
 #include "bsp/bsp.h"
 #include "log/log.h"
 #include "stats/stats.h"
-#include "os/os.h"
 #include "bsp/bsp.h"
 #include "hal/hal_gpio.h"
 #include "console/console.h"
diff --git a/apps/ffs2native/src/main.c b/apps/ffs2native/src/main.c
index 72b058b44..2a7323c1d 100644
--- a/apps/ffs2native/src/main.c
+++ b/apps/ffs2native/src/main.c
@@ -24,18 +24,14 @@
 #include <unistd.h>
 #include <dirent.h>
 #include <string.h>
+#include "os/mynewt.h"
 #include "../src/nffs_priv.h"
-#include <os/queue.h>
 #include <fs/fs.h>
 #include <bsp/bsp.h>
 #include <nffs/nffs.h>
 #include <hal/hal_flash.h>
 #include <flash_map/flash_map.h>
 
-#include <sysinit/sysinit.h>
-#include <syscfg/syscfg.h>
-#include <sysflash/sysflash.h>
-
 #ifdef ARCH_sim
 #include <mcu/mcu_sim.h>
 #endif
diff --git a/apps/iptest/src/main.c b/apps/iptest/src/main.c
index 8eb295842..7407db937 100755
--- a/apps/iptest/src/main.c
+++ b/apps/iptest/src/main.c
@@ -17,11 +17,7 @@
  * under the License.
  */
 
-#include "syscfg/syscfg.h"
-#include "sysinit/sysinit.h"
-#include "sysflash/sysflash.h"
-
-#include <os/os.h>
+#include "os/mynewt.h"
 #include <bsp/bsp.h>
 
 #include <hal/hal_gpio.h>
@@ -41,7 +37,6 @@
 
 #include <assert.h>
 #include <string.h>
-#include <os/os_time.h>
 #include <id/id.h>
 
 #if MYNEWT_VAL(BUILD_WITH_OIC)
diff --git a/apps/lora_app_shell/src/las_cmd.c b/apps/lora_app_shell/src/las_cmd.c
index fafbbdacf..b68bbed4f 100644
--- a/apps/lora_app_shell/src/las_cmd.c
+++ b/apps/lora_app_shell/src/las_cmd.c
@@ -20,8 +20,7 @@
 #include <stdio.h>
 #include <string.h>
 #include <limits.h>
-#include "sysinit/sysinit.h"
-#include "syscfg/syscfg.h"
+#include "os/mynewt.h"
 #include "console/console.h"
 #include "shell/shell.h"
 #include "parse/parse.h"
diff --git a/apps/lora_app_shell/src/main.c b/apps/lora_app_shell/src/main.c
index 5595fd5d1..1afd2e98d 100644
--- a/apps/lora_app_shell/src/main.c
+++ b/apps/lora_app_shell/src/main.c
@@ -20,12 +20,10 @@
 #include <stdio.h>
 #include <string.h>
 #include <limits.h>
-#include "sysinit/sysinit.h"
-#include "syscfg/syscfg.h"
+#include "os/mynewt.h"
 #include "hal/hal_gpio.h"
 #include "hal/hal_spi.h"
 #include "bsp/bsp.h"
-#include "os/os.h"
 #include "console/console.h"
 #include "shell/shell.h"
 #include "parse/parse.h"
diff --git a/apps/loraping/src/main.c b/apps/loraping/src/main.c
index 24dc0e5b4..28ae43336 100644
--- a/apps/loraping/src/main.c
+++ b/apps/loraping/src/main.c
@@ -28,12 +28,10 @@ Description: Ping-Pong implementation.  Adapted to run in the MyNewt OS.
 */
 
 #include <string.h>
-#include "sysinit/sysinit.h"
-#include "syscfg/syscfg.h"
+#include "os/mynewt.h"
 #include "hal/hal_gpio.h"
 #include "hal/hal_spi.h"
 #include "bsp/bsp.h"
-#include "os/os.h"
 #include "radio/radio.h"
 #include "loraping.h"
 
diff --git a/apps/lorashell/src/main.c b/apps/lorashell/src/main.c
index 826f5b684..7069e2b21 100644
--- a/apps/lorashell/src/main.c
+++ b/apps/lorashell/src/main.c
@@ -59,12 +59,10 @@
 #include <stdio.h>
 #include <string.h>
 #include <limits.h>
-#include "sysinit/sysinit.h"
-#include "syscfg/syscfg.h"
+#include "os/mynewt.h"
 #include "hal/hal_gpio.h"
 #include "hal/hal_spi.h"
 #include "bsp/bsp.h"
-#include "os/os.h"
 #include "node/radio.h"
 #include "console/console.h"
 #include "shell/shell.h"
diff --git a/apps/ocf_sample/src/main.c b/apps/ocf_sample/src/main.c
index d82a4415a..3a3804e9c 100644
--- a/apps/ocf_sample/src/main.c
+++ b/apps/ocf_sample/src/main.c
@@ -17,9 +17,7 @@
  * under the License.
  */
 #include <assert.h>
-#include "sysinit/sysinit.h"
-#include <os/os.h>
-#include <sysinit/sysinit.h>
+#include "os/mynewt.h"
 #include <bsp/bsp.h>
 #include <log/log.h>
 #include <oic/oc_api.h>
diff --git a/apps/ocf_sample/src/ocf_ble.c b/apps/ocf_sample/src/ocf_ble.c
index 6324c5aa1..1a4ed9c95 100644
--- a/apps/ocf_sample/src/ocf_ble.c
+++ b/apps/ocf_sample/src/ocf_ble.c
@@ -17,7 +17,7 @@
  * under the License.
  */
 
-#include "syscfg/syscfg.h"
+#include "os/mynewt.h"
 
 #if MYNEWT_VAL(OC_TRANSPORT_GATT)
 
diff --git a/apps/pwm_test/src/main.c b/apps/pwm_test/src/main.c
index b57a437af..7db5668a7 100755
--- a/apps/pwm_test/src/main.c
+++ b/apps/pwm_test/src/main.c
@@ -16,9 +16,8 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-#include "syscfg/syscfg.h"
-#include "sysinit/sysinit.h"
-#include <os/os.h>
+
+#include "os/mynewt.h"
 #include <pwm/pwm.h>
 #include <bsp/bsp.h>
 #include <easing/easing.h>
diff --git a/apps/sensors_test/src/gatt_svr.c b/apps/sensors_test/src/gatt_svr.c
index 9a319bf92..db6e61b0b 100644
--- a/apps/sensors_test/src/gatt_svr.c
+++ b/apps/sensors_test/src/gatt_svr.c
@@ -16,7 +16,9 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-#include <syscfg/syscfg.h>
+
+#include "os/mynewt.h"
+
 #if MYNEWT_VAL(SENSOR_BLE)
 
 #include <assert.h>
diff --git a/apps/sensors_test/src/main.c b/apps/sensors_test/src/main.c
index fe4a862d8..87c08eb48 100755
--- a/apps/sensors_test/src/main.c
+++ b/apps/sensors_test/src/main.c
@@ -17,10 +17,7 @@
  * under the License.
  */
 
-#include "syscfg/syscfg.h"
-#include "sysinit/sysinit.h"
-#include "sysflash/sysflash.h"
-#include <os/os.h>
+#include "os/mynewt.h"
 #include <bsp/bsp.h>
 #include <hal/hal_gpio.h>
 #include <hal/hal_flash.h>
@@ -34,8 +31,6 @@
 #include <string.h>
 #include <reboot/log_reboot.h>
 #include <id/id.h>
-#include <os/os_time.h>
-#include <defs/error.h>
 
 #if MYNEWT_VAL(BNO055_CLI)
 #include <bno055/bno055.h>
diff --git a/apps/slinky/src/main.c b/apps/slinky/src/main.c
index e6dcb1cd8..5e8d18baf 100755
--- a/apps/slinky/src/main.c
+++ b/apps/slinky/src/main.c
@@ -17,10 +17,7 @@
  * under the License.
  */
 
-#include "syscfg/syscfg.h"
-#include "sysinit/sysinit.h"
-#include "sysflash/sysflash.h"
-#include <os/os.h>
+#include "os/mynewt.h"
 #include <bsp/bsp.h>
 #include <hal/hal_gpio.h>
 #include <hal/hal_flash.h>
@@ -41,7 +38,6 @@
 #include <assert.h>
 #include <string.h>
 #include <reboot/log_reboot.h>
-#include <os/os_time.h>
 #include <id/id.h>
 
 #ifdef ARCH_sim
diff --git a/apps/slinky_oic/src/main.c b/apps/slinky_oic/src/main.c
index d60629550..e02f4b2b0 100755
--- a/apps/slinky_oic/src/main.c
+++ b/apps/slinky_oic/src/main.c
@@ -17,10 +17,7 @@
  * under the License.
  */
 
-#include <syscfg/syscfg.h>
-#include <sysinit/sysinit.h>
-
-#include <os/os.h>
+#include "os/mynewt.h"
 #include <bsp/bsp.h>
 #include <hal/hal_gpio.h>
 #include <hal/hal_flash.h>
@@ -38,7 +35,6 @@
 #include <assert.h>
 #include <string.h>
 #include <reboot/log_reboot.h>
-#include <os/os_time.h>
 
 #ifdef ARCH_sim
 #include <mcu/mcu_sim.h>
diff --git a/apps/spitest/src/main.c b/apps/spitest/src/main.c
index 69d7da490..3374078fd 100755
--- a/apps/spitest/src/main.c
+++ b/apps/spitest/src/main.c
@@ -16,16 +16,15 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-#include "sysinit/sysinit.h"
-#include "os/os.h"
+
+#include <assert.h>
+#include <string.h>
+#include "os/mynewt.h"
 #include "bsp/bsp.h"
 #include "hal/hal_gpio.h"
 #include "hal/hal_spi.h"
 #include "stats/stats.h"
 #include "config/config.h"
-#include <os/os_dev.h>
-#include <assert.h>
-#include <string.h>
 #include <console/console.h>
 #ifdef ARCH_sim
 #include <mcu/mcu_sim.h>
diff --git a/apps/splitty/src/main.c b/apps/splitty/src/main.c
index 80bcd54df..485f168fa 100755
--- a/apps/splitty/src/main.c
+++ b/apps/splitty/src/main.c
@@ -16,8 +16,10 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-#include "sysinit/sysinit.h"
-#include <os/os.h>
+
+#include <assert.h>
+#include <string.h>
+#include "os/mynewt.h"
 #include <bsp/bsp.h>
 #include <hal/hal_gpio.h>
 #include <hal/hal_flash.h>
@@ -32,10 +34,7 @@
 #include <bootutil/image.h>
 #include <bootutil/bootutil.h>
 #include <imgmgr/imgmgr.h>
-#include <assert.h>
-#include <string.h>
 #include <reboot/log_reboot.h>
-#include <os/os_time.h>
 #include <id/id.h>
 
 #ifdef ARCH_sim
diff --git a/apps/testbench/src/tbb.c b/apps/testbench/src/tbb.c
index 39321beec..aa3279c1a 100644
--- a/apps/testbench/src/tbb.c
+++ b/apps/testbench/src/tbb.c
@@ -19,7 +19,7 @@
 
 /** tbb - test bench BLE. */
 
-#include "syscfg/syscfg.h"
+#include "os/mynewt.h"
 
 #if MYNEWT_VAL(TESTBENCH_BLE)
 
@@ -27,9 +27,7 @@
 #include <string.h>
 #include <stdio.h>
 #include <errno.h>
-#include "sysinit/sysinit.h"
 #include "bsp/bsp.h"
-#include "os/os.h"
 #include "bsp/bsp.h"
 #include "hal/hal_gpio.h"
 #include "console/console.h"
diff --git a/apps/testbench/src/tbb.h b/apps/testbench/src/tbb.h
index c15907785..3d59124d0 100644
--- a/apps/testbench/src/tbb.h
+++ b/apps/testbench/src/tbb.h
@@ -20,7 +20,7 @@
 #ifndef H_TBB_
 #define H_TBB_
 
-#include "syscfg/syscfg.h"
+#include "os/mynewt.h"
 
 #if MYNEWT_VAL(TESTBENCH_BLE)
 
diff --git a/apps/testbench/src/testbench.c b/apps/testbench/src/testbench.c
index 8a9c9dfc4..1f0e7ca79 100644
--- a/apps/testbench/src/testbench.c
+++ b/apps/testbench/src/testbench.c
@@ -16,11 +16,8 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-#include "syscfg/syscfg.h"
-#include "sysinit/sysinit.h"
-#include "sysflash/sysflash.h"
 
-#include <os/os.h>
+#include "os/mynewt.h"
 #include "bsp/bsp.h"
 #include <hal/hal_gpio.h>
 #include <hal/hal_flash.h>
@@ -43,9 +40,7 @@
 #include <string.h>
 #include <json/json.h>
 #include <reboot/log_reboot.h>
-#include <os/os_time.h>
 #include <id/id.h>
-#include <os/os_eventq.h>
 #include <oic/oc_api.h>
 #include <oic/oc_gatt.h>
 
@@ -62,7 +57,6 @@
 /*#include "../fcb/fcb_test.h"*/
 #endif /* FCB */
 
-#include "os/os_test.h"
 #include "bootutil/bootutil_test.h"
 
 #include <stddef.h>
diff --git a/apps/testbench/src/testbench.h b/apps/testbench/src/testbench.h
index 3729fcf4c..815c061d5 100644
--- a/apps/testbench/src/testbench.h
+++ b/apps/testbench/src/testbench.h
@@ -19,11 +19,8 @@
 #ifndef _H_TESTBENCH
 #define _H_TESTBENCH
 
-#include "syscfg/syscfg.h"
-#include "sysinit/sysinit.h"
-#include "sysflash/sysflash.h"
+#include "os/mynewt.h"
 
-#include <os/os.h>
 #include <bsp/bsp.h>
 #include <hal/hal_gpio.h>
 #include <hal/hal_flash.h>
@@ -46,7 +43,6 @@
 #include <string.h>
 #include <json/json.h>
 #include <reboot/log_reboot.h>
-#include <os/os_time.h>
 #include <id/id.h>
 
 #include "testutil/testutil.h"
@@ -60,7 +56,6 @@
 #include <fcb/fcb.h>
 #endif
 
-#include "os/os_test.h"
 #include "bootutil/bootutil_test.h"
 
 #include <stddef.h>
diff --git a/apps/testbench/src/testbench_json.c b/apps/testbench/src/testbench_json.c
index b750cd33e..b225b164e 100644
--- a/apps/testbench/src/testbench_json.c
+++ b/apps/testbench/src/testbench_json.c
@@ -18,9 +18,8 @@
  */
 #include <stdio.h>
 #include <string.h>
+#include "os/mynewt.h"
 #include "testutil/testutil.h"
-#include "os/os.h"
-
 #include "testbench.h"
 
 #ifndef JSON_BIGBUF_SIZE
diff --git a/apps/testbench/src/testbench_mempool.c b/apps/testbench/src/testbench_mempool.c
index b7fc1909d..89a6cbe6d 100644
--- a/apps/testbench/src/testbench_mempool.c
+++ b/apps/testbench/src/testbench_mempool.c
@@ -18,9 +18,8 @@
  */
 #include <stdio.h>
 #include <string.h>
+#include "os/mynewt.h"
 #include "testutil/testutil.h"
-#include "os/os.h"
-
 #include "testbench.h"
 
 /* Limit max blocks for testing */
diff --git a/apps/testbench/src/testbench_mutex.c b/apps/testbench/src/testbench_mutex.c
index 4998aebbc..9343c3850 100644
--- a/apps/testbench/src/testbench_mutex.c
+++ b/apps/testbench/src/testbench_mutex.c
@@ -20,10 +20,8 @@
 #include <string.h>
 #include <assert.h>
 #include <sys/time.h>
-#include "sysinit/sysinit.h"
+#include "os/mynewt.h"
 #include "testutil/testutil.h"
-#include "os/os.h"
-#include "os/os_test.h"
 
 #include "testbench.h"
 
diff --git a/apps/testbench/src/testbench_sem.c b/apps/testbench/src/testbench_sem.c
index e570da566..4f6e67a9e 100644
--- a/apps/testbench/src/testbench_sem.c
+++ b/apps/testbench/src/testbench_sem.c
@@ -16,11 +16,11 @@
  * specific language governing permissions and limitations
  * under the License.
  */
+
 #include <stdio.h>
 #include <string.h>
-#include "sysinit/sysinit.h"
+#include "os/mynewt.h"
 #include "testutil/testutil.h"
-#include "os/os.h"
 
 #include "testbench.h"
 
diff --git a/apps/timtest/src/main.c b/apps/timtest/src/main.c
index 29ad716b5..fe9d0be80 100755
--- a/apps/timtest/src/main.c
+++ b/apps/timtest/src/main.c
@@ -16,16 +16,15 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-#include "sysinit/sysinit.h"
-#include "os/os.h"
+
+#include <assert.h>
+#include <string.h>
+#include "os/mynewt.h"
 #include "bsp/bsp.h"
 #include "hal/hal_gpio.h"
 #include "hal/hal_timer.h"
 #include "stats/stats.h"
 #include "config/config.h"
-#include <os/os_dev.h>
-#include <assert.h>
-#include <string.h>
 
 /* Task 1 */
 #define TASK1_PRIO (1)
diff --git a/boot/boot_serial/src/boot_serial.c b/boot/boot_serial/src/boot_serial.c
index b6574d435..b8889870c 100644
--- a/boot/boot_serial/src/boot_serial.c
+++ b/boot/boot_serial/src/boot_serial.c
@@ -16,14 +16,14 @@
  * specific language governing permissions and limitations
  * under the License.
  */
+
 #include <assert.h>
 #include <stddef.h>
 #include <inttypes.h>
 #include <ctype.h>
 #include <stdio.h>
 
-#include "sysflash/sysflash.h"
-
+#include "os/mynewt.h"
 #include <bsp/bsp.h>
 
 #include <flash_map/flash_map.h>
@@ -32,11 +32,6 @@
 #include <hal/hal_gpio.h>
 #include <hal/hal_watchdog.h>
 
-#include <os/endian.h>
-#include <os/os.h>
-#include <os/os_malloc.h>
-#include <os/os_cputime.h>
-
 #include <tinycbor/cbor.h>
 #include <tinycbor/cbor_buf_reader.h>
 #include <base64/base64.h>
diff --git a/boot/boot_serial/src/boot_uart.c b/boot/boot_serial/src/boot_uart.c
index 5ae241d83..6ee151bf1 100644
--- a/boot/boot_serial/src/boot_uart.c
+++ b/boot/boot_serial/src/boot_uart.c
@@ -19,9 +19,7 @@
 #include <assert.h>
 #include <stddef.h>
 #include <inttypes.h>
-
-#include <syscfg/syscfg.h>
-
+#include "os/mynewt.h"
 #include <uart/uart.h>
 
 /*
diff --git a/boot/boot_serial/test/src/boot_test.c b/boot/boot_serial/test/src/boot_test.c
index c23931d4b..df46726e0 100644
--- a/boot/boot_serial/test/src/boot_test.c
+++ b/boot/boot_serial/test/src/boot_test.c
@@ -22,10 +22,7 @@
 #include <stdlib.h>
 #include <string.h>
 #include <inttypes.h>
-#include "sysinit/sysinit.h"
-#include "syscfg/syscfg.h"
-#include "sysflash/sysflash.h"
-#include "os/endian.h"
+#include "os/mynewt.h"
 #include "base64/base64.h"
 #include "crc/crc16.h"
 #include "testutil/testutil.h"
diff --git a/boot/boot_serial/test/src/boot_test.h b/boot/boot_serial/test/src/boot_test.h
index b517a04dc..84a0edfbe 100644
--- a/boot/boot_serial/test/src/boot_test.h
+++ b/boot/boot_serial/test/src/boot_test.h
@@ -25,9 +25,7 @@
 #include <stdlib.h>
 #include <string.h>
 #include <inttypes.h>
-#include "syscfg/syscfg.h"
-#include "sysflash/sysflash.h"
-#include "os/endian.h"
+#include "os/mynewt.h"
 #include "base64/base64.h"
 #include "crc/crc16.h"
 #include "testutil/testutil.h"
diff --git a/boot/bootutil/src/bootutil_misc.c b/boot/bootutil/src/bootutil_misc.c
index 2fe08e345..302910015 100644
--- a/boot/bootutil/src/bootutil_misc.c
+++ b/boot/bootutil/src/bootutil_misc.c
@@ -21,12 +21,10 @@
 #include <string.h>
 #include <inttypes.h>
 
-#include "syscfg/syscfg.h"
-#include "sysflash/sysflash.h"
+#include "os/mynewt.h"
 #include "hal/hal_bsp.h"
 #include "hal/hal_flash.h"
 #include "flash_map/flash_map.h"
-#include "os/os.h"
 #include "bootutil/image.h"
 #include "bootutil/bootutil.h"
 #include "bootutil_priv.h"
diff --git a/boot/bootutil/src/bootutil_priv.h b/boot/bootutil/src/bootutil_priv.h
index 79885ae2c..b3566aab8 100644
--- a/boot/bootutil/src/bootutil_priv.h
+++ b/boot/bootutil/src/bootutil_priv.h
@@ -20,7 +20,7 @@
 #ifndef H_BOOTUTIL_PRIV_
 #define H_BOOTUTIL_PRIV_
 
-#include "syscfg/syscfg.h"
+#include "os/mynewt.h"
 #include "bootutil/image.h"
 
 #ifdef __cplusplus
diff --git a/boot/bootutil/src/image_ec.c b/boot/bootutil/src/image_ec.c
index 34f67055a..1751db54e 100644
--- a/boot/bootutil/src/image_ec.c
+++ b/boot/bootutil/src/image_ec.c
@@ -19,7 +19,7 @@
 
 #include <string.h>
 
-#include "syscfg/syscfg.h"
+#include "os/mynewt.h"
 
 #if MYNEWT_VAL(BOOTUTIL_SIGN_EC)
 #include "bootutil/sign_key.h"
diff --git a/boot/bootutil/src/image_ec256.c b/boot/bootutil/src/image_ec256.c
index 6a79a275e..32207842b 100644
--- a/boot/bootutil/src/image_ec256.c
+++ b/boot/bootutil/src/image_ec256.c
@@ -19,7 +19,8 @@
 
 #include <string.h>
 
-#include "syscfg/syscfg.h"
+#include "os/mynewt.h"
+
 #if MYNEWT_VAL(BOOTUTIL_SIGN_EC256)
 #include "bootutil/sign_key.h"
 
diff --git a/boot/bootutil/src/image_rsa.c b/boot/bootutil/src/image_rsa.c
index 4890f46b7..97bcd15e0 100644
--- a/boot/bootutil/src/image_rsa.c
+++ b/boot/bootutil/src/image_rsa.c
@@ -19,7 +19,7 @@
 
 #include <string.h>
 
-#include "syscfg/syscfg.h"
+#include "os/mynewt.h"
 
 #if MYNEWT_VAL(BOOTUTIL_SIGN_RSA)
 #include "bootutil/sign_key.h"
diff --git a/boot/bootutil/src/image_validate.c b/boot/bootutil/src/image_validate.c
index 740616a75..5d50dd24e 100644
--- a/boot/bootutil/src/image_validate.c
+++ b/boot/bootutil/src/image_validate.c
@@ -22,7 +22,7 @@
 #include <inttypes.h>
 #include <string.h>
 
-#include "syscfg/syscfg.h"
+#include "os/mynewt.h"
 #include "hal/hal_flash.h"
 #include "hal/hal_watchdog.h"
 #include "flash_map/flash_map.h"
diff --git a/boot/bootutil/src/loader.c b/boot/bootutil/src/loader.c
index a7072de3e..91eb83c84 100644
--- a/boot/bootutil/src/loader.c
+++ b/boot/bootutil/src/loader.c
@@ -27,11 +27,10 @@
 #include <inttypes.h>
 #include <stdlib.h>
 #include <string.h>
-#include "sysflash/sysflash.h"
+#include "os/mynewt.h"
 #include "flash_map/flash_map.h"
 #include <hal/hal_flash.h>
 #include <hal/hal_watchdog.h>
-#include <os/os_malloc.h>
 #include "bootutil/bootutil.h"
 #include "bootutil/image.h"
 #include "bootutil_priv.h"
diff --git a/boot/bootutil/test/src/boot_test.c b/boot/bootutil/test/src/boot_test.c
index c3f2b7f76..7e9787983 100644
--- a/boot/bootutil/test/src/boot_test.c
+++ b/boot/bootutil/test/src/boot_test.c
@@ -23,9 +23,7 @@
 #include <stdlib.h>
 #include <string.h>
 #include <inttypes.h>
-#include "sysinit/sysinit.h"
-#include "syscfg/syscfg.h"
-#include "sysflash/sysflash.h"
+#include "os/mynewt.h"
 #include "testutil/testutil.h"
 #include "hal/hal_flash.h"
 #include "flash_map/flash_map.h"
diff --git a/boot/bootutil/test/src/boot_test.h b/boot/bootutil/test/src/boot_test.h
index d0c1319bc..9352f9797 100644
--- a/boot/bootutil/test/src/boot_test.h
+++ b/boot/bootutil/test/src/boot_test.h
@@ -25,8 +25,7 @@
 #include <stdlib.h>
 #include <string.h>
 #include <inttypes.h>
-#include "syscfg/syscfg.h"
-#include "sysflash/sysflash.h"
+#include "os/mynewt.h"
 #include "testutil/testutil.h"
 #include "hal/hal_flash.h"
 #include "flash_map/flash_map.h"
diff --git a/boot/split/src/split.c b/boot/split/src/split.c
index 3975fb973..5b9a29e45 100644
--- a/boot/split/src/split.c
+++ b/boot/split/src/split.c
@@ -18,8 +18,7 @@
  */
 
 #include <assert.h>
-#include "sysinit/sysinit.h"
-#include "defs/error.h"
+#include "os/mynewt.h"
 #include "bootutil/bootutil.h"
 #include "bootutil/image.h"
 #include "split/split.h"
diff --git a/boot/split_app/src/split_app.c b/boot/split_app/src/split_app.c
index 1f748ad0e..04f89c128 100644
--- a/boot/split_app/src/split_app.c
+++ b/boot/split_app/src/split_app.c
@@ -16,10 +16,9 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-#include <stdlib.h>
 
-#include <sysinit/sysinit.h>
-#include <os/os.h>
+#include <stdlib.h>
+#include "os/mynewt.h"
 
 extern int main(int argc, char **argv);
 
diff --git a/crypto/mbedtls/include/mbedtls/config_mynewt.h b/crypto/mbedtls/include/mbedtls/config_mynewt.h
index 0d18e3972..fff0fbad9 100644
--- a/crypto/mbedtls/include/mbedtls/config_mynewt.h
+++ b/crypto/mbedtls/include/mbedtls/config_mynewt.h
@@ -32,7 +32,7 @@
 extern "C" {
 #endif
 
-#include <syscfg/syscfg.h>
+#include "os/mynewt.h"
 
 #undef MBEDTLS_HAVE_TIME /* we have no time.h */
 #undef MBEDTLS_HAVE_TIME_DATE
diff --git a/crypto/mbedtls/test/src/mbedtls_test.c b/crypto/mbedtls/test/src/mbedtls_test.c
index 4efc52ef0..9a0d55c90 100644
--- a/crypto/mbedtls/test/src/mbedtls_test.c
+++ b/crypto/mbedtls/test/src/mbedtls_test.c
@@ -19,8 +19,7 @@
 #include <stdio.h>
 #include <string.h>
 
-#include "sysinit/sysinit.h"
-#include "syscfg/syscfg.h"
+#include "os/mynewt.h"
 #include "testutil/testutil.h"
 
 #include "mbedtls/mbedtls_test.h"
diff --git a/crypto/mbedtls/test/src/mbedtls_test.h b/crypto/mbedtls/test/src/mbedtls_test.h
index 49e0a1120..d277dbb1c 100644
--- a/crypto/mbedtls/test/src/mbedtls_test.h
+++ b/crypto/mbedtls/test/src/mbedtls_test.h
@@ -21,7 +21,7 @@
 #include <stdio.h>
 #include <string.h>
 
-#include "syscfg/syscfg.h"
+#include "os/mynewt.h"
 #include "testutil/testutil.h"
 
 #include "mbedtls/mbedtls_test.h"
diff --git a/encoding/base64/test/src/encoding_test.c b/encoding/base64/test/src/encoding_test.c
index e8af5401c..54559094c 100644
--- a/encoding/base64/test/src/encoding_test.c
+++ b/encoding/base64/test/src/encoding_test.c
@@ -18,8 +18,7 @@
  */
 #include <assert.h>
 #include <stddef.h>
-#include "sysinit/sysinit.h"
-#include "syscfg/syscfg.h"
+#include "os/mynewt.h"
 #include "testutil/testutil.h"
 #include "encoding_test_priv.h"
 
diff --git a/encoding/base64/test/src/encoding_test_priv.h b/encoding/base64/test/src/encoding_test_priv.h
index 2630e5cea..66d42c61c 100644
--- a/encoding/base64/test/src/encoding_test_priv.h
+++ b/encoding/base64/test/src/encoding_test_priv.h
@@ -21,7 +21,7 @@
 
 #include <assert.h>
 #include <stddef.h>
-#include "syscfg/syscfg.h"
+#include "os/mynewt.h"
 #include "base64/hex.h"
 #include "testutil/testutil.h"
 
diff --git a/encoding/cborattr/src/cborattr.c b/encoding/cborattr/src/cborattr.c
index 096414905..93a85f15d 100644
--- a/encoding/cborattr/src/cborattr.c
+++ b/encoding/cborattr/src/cborattr.c
@@ -17,7 +17,7 @@
  * under the License.
  */
 
-#include <syscfg/syscfg.h>
+#include "os/mynewt.h"
 #include <cborattr/cborattr.h>
 #include <tinycbor/cbor.h>
 #include <tinycbor/cbor_buf_reader.h>
diff --git a/encoding/cborattr/test/src/test_cborattr.c b/encoding/cborattr/test/src/test_cborattr.c
index 0a6403953..51793f14b 100644
--- a/encoding/cborattr/test/src/test_cborattr.c
+++ b/encoding/cborattr/test/src/test_cborattr.c
@@ -17,8 +17,7 @@
  * under the License.
  */
 
-#include "sysinit/sysinit.h"
-#include "syscfg/syscfg.h"
+#include "os/mynewt.h"
 #include "testutil/testutil.h"
 #include "test_cborattr.h"
 
diff --git a/encoding/json/test/src/test_json.c b/encoding/json/test/src/test_json.c
index 0cb22162d..faf5fc585 100644
--- a/encoding/json/test/src/test_json.c
+++ b/encoding/json/test/src/test_json.c
@@ -17,8 +17,7 @@
  * under the License.
  */
 
-#include "sysinit/sysinit.h"
-#include "syscfg/syscfg.h"
+#include "os/mynewt.h"
 #include "testutil/testutil.h"
 #include "test_json.h"
 
diff --git a/encoding/tinycbor/include/tinycbor/cbor_mbuf_reader.h b/encoding/tinycbor/include/tinycbor/cbor_mbuf_reader.h
index 03be2fc9d..fccc34a8b 100644
--- a/encoding/tinycbor/include/tinycbor/cbor_mbuf_reader.h
+++ b/encoding/tinycbor/include/tinycbor/cbor_mbuf_reader.h
@@ -20,8 +20,8 @@
 #ifndef CBOR_MBUF_READER_H
 #define CBOR_MBUF_READER_H
 
+#include "os/mynewt.h"
 #include <tinycbor/cbor.h>
-#include <os/os_mbuf.h>
 
 #ifdef __cplusplus
 extern "C" {
diff --git a/encoding/tinycbor/include/tinycbor/cbor_mbuf_writer.h b/encoding/tinycbor/include/tinycbor/cbor_mbuf_writer.h
index 8780cd0b9..02920d87e 100644
--- a/encoding/tinycbor/include/tinycbor/cbor_mbuf_writer.h
+++ b/encoding/tinycbor/include/tinycbor/cbor_mbuf_writer.h
@@ -20,8 +20,8 @@
 #ifndef CBOR_MBUF_WRITER_H
 #define CBOR_MBUF_WRITER_H
 
+#include "os/mynewt.h"
 #include <tinycbor/cbor.h>
-#include <os/os_mbuf.h>
 
 #ifdef __cplusplus
 extern "C" {
diff --git a/encoding/tinycbor/src/cbor_mbuf_reader.c b/encoding/tinycbor/src/cbor_mbuf_reader.c
index 03f9a66c5..07ecfc713 100644
--- a/encoding/tinycbor/src/cbor_mbuf_reader.c
+++ b/encoding/tinycbor/src/cbor_mbuf_reader.c
@@ -17,9 +17,9 @@
  * under the License.
  */
 
+#include "os/mynewt.h"
 #include <tinycbor/cbor_mbuf_reader.h>
 #include <tinycbor/compilersupport_p.h>
-#include <os/os_mbuf.h>
 
 static uint8_t
 cbor_mbuf_reader_get8(struct cbor_decoder_reader *d, int offset)
diff --git a/encoding/tinycbor/src/cbor_mbuf_writer.c b/encoding/tinycbor/src/cbor_mbuf_writer.c
index 862565b2f..2ff063c60 100644
--- a/encoding/tinycbor/src/cbor_mbuf_writer.c
+++ b/encoding/tinycbor/src/cbor_mbuf_writer.c
@@ -17,8 +17,8 @@
  * under the License.
  */
 
+#include "os/mynewt.h"
 #include <tinycbor/cbor.h>
-#include <os/os_mbuf.h>
 #include <tinycbor/cbor.h>
 #include <tinycbor/cbor_mbuf_writer.h>
 
diff --git a/fs/disk/include/disk/disk.h b/fs/disk/include/disk/disk.h
index a8695e8d9..cf2849629 100644
--- a/fs/disk/include/disk/disk.h
+++ b/fs/disk/include/disk/disk.h
@@ -22,7 +22,7 @@
 
 #include <stddef.h>
 #include <inttypes.h>
-#include <os/queue.h>
+#include "os/mynewt.h"
 
 #ifdef __cplusplus
 extern "C" {
diff --git a/fs/disk/src/disk.c b/fs/disk/src/disk.c
index 231f28421..93a2741fd 100644
--- a/fs/disk/src/disk.c
+++ b/fs/disk/src/disk.c
@@ -17,10 +17,10 @@
  * under the License.
  */
 
-#include <syscfg/syscfg.h>
-#include <disk/disk.h>
 #include <stdlib.h>
 #include <string.h>
+#include "os/mynewt.h"
+#include <disk/disk.h>
 
 struct disk_info {
     const char *disk_name;
diff --git a/fs/fatfs/src/mynewt_glue.c b/fs/fatfs/src/mynewt_glue.c
index 3208917e8..bc7e0a500 100644
--- a/fs/fatfs/src/mynewt_glue.c
+++ b/fs/fatfs/src/mynewt_glue.c
@@ -16,14 +16,15 @@
  * specific language governing permissions and limitations
  * under the License.
  */
+
 #include <assert.h>
-#include <sysinit/sysinit.h>
-#include <hal/hal_flash.h>
-#include <disk/disk.h>
-#include <flash_map/flash_map.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
+#include "os/mynewt.h"
+#include <hal/hal_flash.h>
+#include <disk/disk.h>
+#include <flash_map/flash_map.h>
 
 #include <fatfs/ff.h>
 #include <fatfs/diskio.h>
diff --git a/fs/fcb/include/fcb/fcb.h b/fs/fcb/include/fcb/fcb.h
index 76f557aae..3b8f65517 100644
--- a/fs/fcb/include/fcb/fcb.h
+++ b/fs/fcb/include/fcb/fcb.h
@@ -29,10 +29,9 @@ extern "C" {
 #include <inttypes.h>
 #include <limits.h>
 
+#include "os/mynewt.h"
 #include "flash_map/flash_map.h"
 
-#include "os/os_mutex.h"
-
 #define FCB_MAX_LEN	(CHAR_MAX | CHAR_MAX << 7) /* Max length of element */
 
 /*
diff --git a/fs/fcb/test/src/fcb_test.c b/fs/fcb/test/src/fcb_test.c
index efb83a9d7..c2bd84fb7 100644
--- a/fs/fcb/test/src/fcb_test.c
+++ b/fs/fcb/test/src/fcb_test.c
@@ -20,9 +20,7 @@
 #include <stdio.h>
 #include <string.h>
 
-#include "sysinit/sysinit.h"
-#include "syscfg/syscfg.h"
-#include "os/os.h"
+#include "os/mynewt.h"
 #include "testutil/testutil.h"
 
 #include "fcb/fcb.h"
diff --git a/fs/fcb/test/src/fcb_test.h b/fs/fcb/test/src/fcb_test.h
index 7d2a13758..521c8fd20 100644
--- a/fs/fcb/test/src/fcb_test.h
+++ b/fs/fcb/test/src/fcb_test.h
@@ -22,12 +22,11 @@
 #include <stdio.h>
 #include <string.h>
 
-#include "syscfg/syscfg.h"
-#include "os/os.h"
+#include "os/mynewt.h"
 #include "testutil/testutil.h"
 
 #include "fcb/fcb.h"
-#include "fcb/../../src/fcb_priv.h"
+#include "fcb_priv.h"
 
 #ifdef __cplusplus
 #extern "C" {
diff --git a/fs/fs/include/fs/fs_if.h b/fs/fs/include/fs/fs_if.h
index 5ce3d4e84..413a63bbf 100644
--- a/fs/fs/include/fs/fs_if.h
+++ b/fs/fs/include/fs/fs_if.h
@@ -24,7 +24,7 @@
 extern "C" {
 #endif
 
-#include <os/queue.h>
+#include "os/mynewt.h"
 
 /*
  * Common interface filesystem(s) provide.
diff --git a/fs/fs/src/fs_cli.c b/fs/fs/src/fs_cli.c
index 10ff22ded..257586093 100644
--- a/fs/fs/src/fs_cli.c
+++ b/fs/fs/src/fs_cli.c
@@ -17,7 +17,7 @@
  * under the License.
  */
 
-#include "syscfg/syscfg.h"
+#include "os/mynewt.h"
 
 #if MYNEWT_VAL(FS_CLI)
 
diff --git a/fs/fs/src/fs_mount.c b/fs/fs/src/fs_mount.c
index 3b8beb544..4fbee3925 100644
--- a/fs/fs/src/fs_mount.c
+++ b/fs/fs/src/fs_mount.c
@@ -17,7 +17,6 @@
  * under the License.
  */
 
-#include "syscfg/syscfg.h"
 #include "fs/fs.h"
 #include "fs/fs_if.h"
 #include "fs_priv.h"
diff --git a/fs/fs/src/fs_nmgr.c b/fs/fs/src/fs_nmgr.c
index 1332bdd13..84681de2d 100644
--- a/fs/fs/src/fs_nmgr.c
+++ b/fs/fs/src/fs_nmgr.c
@@ -17,7 +17,7 @@
  * under the License.
  */
 
-#include "syscfg/syscfg.h"
+#include "os/mynewt.h"
 
 #if MYNEWT_VAL(FS_NMGR)
 
@@ -26,8 +26,6 @@
 #include <string.h>
 #include <stdio.h>
 
-#include "os/os.h"
-#include "os/endian.h"
 #include "bootutil/image.h"
 #include "fs/fs.h"
 #include "cborattr/cborattr.h"
diff --git a/fs/fs/src/fs_priv.h b/fs/fs/src/fs_priv.h
index 80211dcd0..ed920a3bf 100644
--- a/fs/fs/src/fs_priv.h
+++ b/fs/fs/src/fs_priv.h
@@ -19,7 +19,7 @@
 #ifndef __FS_PRIV_H__
 #define __FS_PRIV_H__
 
-#include "syscfg/syscfg.h"
+#include "os/mynewt.h"
 
 #ifdef __cplusplus
 extern "C" {
diff --git a/fs/nffs/src/nffs.c b/fs/nffs/src/nffs.c
index ace91745c..cd48e4302 100644
--- a/fs/nffs/src/nffs.c
+++ b/fs/nffs/src/nffs.c
@@ -22,14 +22,10 @@
 #include <stdlib.h>
 #include <assert.h>
 
-#include "sysinit/sysinit.h"
-#include "sysflash/sysflash.h"
+#include "os/mynewt.h"
 #include "bsp/bsp.h"
 #include "hal/hal_flash.h"
 #include "flash_map/flash_map.h"
-#include "os/os_mempool.h"
-#include "os/os_mutex.h"
-#include "os/os_malloc.h"
 #include "stats/stats.h"
 #include "nffs_priv.h"
 #include "nffs/nffs.h"
diff --git a/fs/nffs/src/nffs_gc.c b/fs/nffs/src/nffs_gc.c
index 8af1d2ba6..4950e2c21 100644
--- a/fs/nffs/src/nffs_gc.c
+++ b/fs/nffs/src/nffs_gc.c
@@ -19,7 +19,7 @@
 
 #include <assert.h>
 #include <string.h>
-#include "os/os_malloc.h"
+#include "os/mynewt.h"
 #include "testutil/testutil.h"
 #include "nffs_priv.h"
 #include "nffs/nffs.h"
diff --git a/fs/nffs/src/nffs_inode.c b/fs/nffs/src/nffs_inode.c
index 90285ce44..69a2693e5 100644
--- a/fs/nffs/src/nffs_inode.c
+++ b/fs/nffs/src/nffs_inode.c
@@ -20,8 +20,8 @@
 #include <stddef.h>
 #include <string.h>
 #include <assert.h>
+#include "os/mynewt.h"
 #include "testutil/testutil.h"
-#include "os/os_mempool.h"
 #include "nffs/nffs.h"
 #include "nffs_priv.h"
 
diff --git a/fs/nffs/src/nffs_misc.c b/fs/nffs/src/nffs_misc.c
index f79d9df12..b6fc6f414 100644
--- a/fs/nffs/src/nffs_misc.c
+++ b/fs/nffs/src/nffs_misc.c
@@ -18,10 +18,10 @@
  */
 
 #include <assert.h>
+#include "os/mynewt.h"
 #include "flash_map/flash_map.h"
 #include "hal/hal_bsp.h"
 #include "hal/hal_flash_int.h"
-#include "os/os_malloc.h"
 #include "nffs/nffs.h"
 #include "nffs_priv.h"
 
diff --git a/fs/nffs/src/nffs_priv.h b/fs/nffs/src/nffs_priv.h
index 887850e20..2ca3b9c02 100644
--- a/fs/nffs/src/nffs_priv.h
+++ b/fs/nffs/src/nffs_priv.h
@@ -22,8 +22,7 @@
 
 #include <inttypes.h>
 #include "log/log.h"
-#include "os/queue.h"
-#include "os/os_mempool.h"
+#include "os/mynewt.h"
 #include "nffs/nffs.h"
 #include "fs/fs.h"
 #include "crc/crc16.h"
diff --git a/fs/nffs/src/nffs_restore.c b/fs/nffs/src/nffs_restore.c
index 0a3253ccb..46113ada6 100644
--- a/fs/nffs/src/nffs_restore.c
+++ b/fs/nffs/src/nffs_restore.c
@@ -20,9 +20,8 @@
 #include <assert.h>
 #include <stdio.h>
 #include <string.h>
+#include "os/mynewt.h"
 #include "hal/hal_flash.h"
-#include "os/os_mempool.h"
-#include "os/os_malloc.h"
 #include "nffs/nffs.h"
 #include "nffs_priv.h"
 
diff --git a/fs/nffs/test/src/nffs_test.c b/fs/nffs/test/src/nffs_test.c
index 369fc1c19..941b380e2 100644
--- a/fs/nffs/test/src/nffs_test.c
+++ b/fs/nffs/test/src/nffs_test.c
@@ -39,8 +39,7 @@
 #include <assert.h>
 #include <stdlib.h>
 #include <errno.h>
-#include "sysinit/sysinit.h"
-#include "syscfg/syscfg.h"
+#include "os/mynewt.h"
 #include "hal/hal_flash.h"
 #include "testutil/testutil.h"
 #include "fs/fs.h"
diff --git a/hw/bsp/ada_feather_nrf52/include/bsp/bsp.h b/hw/bsp/ada_feather_nrf52/include/bsp/bsp.h
index b05a2480c..a465e2712 100644
--- a/hw/bsp/ada_feather_nrf52/include/bsp/bsp.h
+++ b/hw/bsp/ada_feather_nrf52/include/bsp/bsp.h
@@ -22,7 +22,7 @@
 
 #include <inttypes.h>
 
-#include <syscfg/syscfg.h>
+#include "os/mynewt.h"
 
 #ifdef __cplusplus
 extern "C" {
diff --git a/hw/bsp/ada_feather_nrf52/src/hal_bsp.c b/hw/bsp/ada_feather_nrf52/src/hal_bsp.c
index 340abc3c2..aed066aa5 100644
--- a/hw/bsp/ada_feather_nrf52/src/hal_bsp.c
+++ b/hw/bsp/ada_feather_nrf52/src/hal_bsp.c
@@ -20,10 +20,8 @@
 #include <stdint.h>
 #include <stddef.h>
 #include <assert.h>
+#include "os/mynewt.h"
 #include <nrf52.h>
-#include "os/os_cputime.h"
-#include "syscfg/syscfg.h"
-#include "sysflash/sysflash.h"
 #include "flash_map/flash_map.h"
 #include "hal/hal_bsp.h"
 #include "hal/hal_system.h"
@@ -41,7 +39,6 @@
 #if MYNEWT_VAL(UART_1)
 #include "uart_bitbang/uart_bitbang.h"
 #endif
-#include "os/os_dev.h"
 #include "bsp.h"
 #if MYNEWT_VAL(ADC_0)
 #include <adc_nrf52/adc_nrf52.h>
diff --git a/hw/bsp/apollo2_evb/src/hal_bsp.c b/hw/bsp/apollo2_evb/src/hal_bsp.c
index bca4cbcf6..31fb10552 100644
--- a/hw/bsp/apollo2_evb/src/hal_bsp.c
+++ b/hw/bsp/apollo2_evb/src/hal_bsp.c
@@ -18,7 +18,7 @@
  */
 #include <assert.h>
 
-#include <syscfg/syscfg.h>
+#include "os/mynewt.h"
 
 #include <hal/hal_bsp.h>
 #include <bsp/bsp.h>
diff --git a/hw/bsp/arduino_primo_nrf52/src/hal_bsp.c b/hw/bsp/arduino_primo_nrf52/src/hal_bsp.c
index 4f55a3d1e..37b372b36 100644
--- a/hw/bsp/arduino_primo_nrf52/src/hal_bsp.c
+++ b/hw/bsp/arduino_primo_nrf52/src/hal_bsp.c
@@ -19,6 +19,7 @@
 #include <stdint.h>
 #include <stddef.h>
 #include <assert.h>
+#include "os/mynewt.h"
 #include "bsp/bsp.h"
 #include <nrf52.h>
 #include "hal/hal_bsp.h"
@@ -27,9 +28,6 @@
 #include "hal/hal_spi.h"
 #include "hal/hal_watchdog.h"
 #include "mcu/nrf52_hal.h"
-#include <os/os_dev.h>
-#include "os/os_cputime.h"
-#include "syscfg/syscfg.h"
 #include "flash_map/flash_map.h"
 #if MYNEWT_VAL(UART_0) || MYNEWT_VAL(UART_1)
 #include "uart/uart.h"
@@ -40,7 +38,6 @@
 #if MYNEWT_VAL(UART_1)
 #include "uart_bitbang/uart_bitbang.h"
 #endif
-#include "os/os_dev.h"
 #include "bsp.h"
 #if MYNEWT_VAL(ADC_0)
 #include <adc_nrf52/adc_nrf52.h>
diff --git a/hw/bsp/bbc_microbit/src/hal_bsp.c b/hw/bsp/bbc_microbit/src/hal_bsp.c
index 7cba8f363..26ebb6c41 100644
--- a/hw/bsp/bbc_microbit/src/hal_bsp.c
+++ b/hw/bsp/bbc_microbit/src/hal_bsp.c
@@ -20,17 +20,15 @@
 #include <stdint.h>
 #include <stddef.h>
 #include <assert.h>
+#include "os/mynewt.h"
 #include "hal/hal_system.h"
 #include "bsp/bsp.h"
 #include <nrf51.h>
 #include "mcu/nrf51_hal.h"
 #include "hal/hal_bsp.h"
-#include "os/os_cputime.h"
-#include "syscfg/syscfg.h"
 #include "flash_map/flash_map.h"
 #include "hal/hal_flash.h"
 #include "hal/hal_spi.h"
-#include "os/os_dev.h"
 
 #if MYNEWT_VAL(ADC_0)
 #include <adc_nrf51/adc_nrf51.h>
diff --git a/hw/bsp/ble400/src/hal_bsp.c b/hw/bsp/ble400/src/hal_bsp.c
index 45e944534..935ce6245 100644
--- a/hw/bsp/ble400/src/hal_bsp.c
+++ b/hw/bsp/ble400/src/hal_bsp.c
@@ -20,13 +20,11 @@
 #include <stdint.h>
 #include <stddef.h>
 #include <assert.h>
-#include "syscfg/syscfg.h"
+#include "os/mynewt.h"
 #include "hal/hal_bsp.h"
 #include "hal/hal_system.h"
 #include "mcu/nrf51_hal.h"
 #include "bsp/bsp.h"
-#include "os/os_dev.h"
-#include "os/os_cputime.h"
 #include "flash_map/flash_map.h"
 #include "hal/hal_flash.h"
 #include "hal/hal_spi.h"
diff --git a/hw/bsp/bmd200/src/hal_bsp.c b/hw/bsp/bmd200/src/hal_bsp.c
index edc892da5..76890c867 100644
--- a/hw/bsp/bmd200/src/hal_bsp.c
+++ b/hw/bsp/bmd200/src/hal_bsp.c
@@ -20,13 +20,11 @@
 #include <stdint.h>
 #include <stddef.h>
 #include <assert.h>
-#include "syscfg/syscfg.h"
+#include "os/mynewt.h"
 #include "hal/hal_bsp.h"
 #include "hal/hal_system.h"
 #include "mcu/nrf51_hal.h"
 #include "bsp/bsp.h"
-#include "os/os_dev.h"
-#include "os/os_cputime.h"
 #include "flash_map/flash_map.h"
 #include "hal/hal_flash.h"
 #include "hal/hal_spi.h"
diff --git a/hw/bsp/bmd300eval/src/hal_bsp.c b/hw/bsp/bmd300eval/src/hal_bsp.c
index 0d7ce4122..cb9550d21 100644
--- a/hw/bsp/bmd300eval/src/hal_bsp.c
+++ b/hw/bsp/bmd300eval/src/hal_bsp.c
@@ -21,8 +21,7 @@
 #include <stddef.h>
 #include <nrf52.h>
 #include <assert.h>
-#include "os/os_cputime.h"
-#include "syscfg/syscfg.h"
+#include "os/mynewt.h"
 #include "flash_map/flash_map.h"
 #include "hal/hal_bsp.h"
 #include "hal/hal_system.h"
@@ -38,7 +37,6 @@
 #if MYNEWT_VAL(UART_1)
 #include "uart_bitbang/uart_bitbang.h"
 #endif
-#include "os/os_dev.h"
 #include "bsp.h"
 #if MYNEWT_VAL(ADC_0)
 #include <adc_nrf52/adc_nrf52.h>
diff --git a/hw/bsp/calliope_mini/include/bsp/bsp.h b/hw/bsp/calliope_mini/include/bsp/bsp.h
index c065c9d50..473713969 100644
--- a/hw/bsp/calliope_mini/include/bsp/bsp.h
+++ b/hw/bsp/calliope_mini/include/bsp/bsp.h
@@ -24,8 +24,8 @@
 extern "C" {
 #endif
 
-#include "inttypes.h"
-#include <os/os_eventq.h>
+#include <inttypes.h>
+#include "os/mynewt.h"
 
 /* Define special stackos sections */
 #define sec_data_core   __attribute__((section(".data.core")))
diff --git a/hw/bsp/calliope_mini/src/hal_bsp.c b/hw/bsp/calliope_mini/src/hal_bsp.c
index d31719c17..0fc14a92c 100644
--- a/hw/bsp/calliope_mini/src/hal_bsp.c
+++ b/hw/bsp/calliope_mini/src/hal_bsp.c
@@ -20,6 +20,7 @@
 #include <stdint.h>
 #include <stddef.h>
 #include <assert.h>
+#include "os/mynewt.h"
 #include "hal/hal_system.h"
 #include "bsp/bsp.h"
 #include <nrf51.h>
@@ -27,12 +28,9 @@
 #include "hal/hal_bsp.h"
 #include "hal/hal_gpio.h"
 #include "hal/hal_i2c.h"
-#include "os/os_cputime.h"
-#include "syscfg/syscfg.h"
 #include "flash_map/flash_map.h"
 #include "hal/hal_flash.h"
 #include "hal/hal_spi.h"
-#include "os/os_dev.h"
 
 #if MYNEWT_VAL(ADC_0)
 #include <adc_nrf51/adc_nrf51.h>
diff --git a/hw/bsp/ci40/src/hal_bsp.c b/hw/bsp/ci40/src/hal_bsp.c
index a25f00d19..76fdf6ef0 100644
--- a/hw/bsp/ci40/src/hal_bsp.c
+++ b/hw/bsp/ci40/src/hal_bsp.c
@@ -16,9 +16,10 @@
  * specific language governing permissions and limitations
  * under the License.
  */
+
+#include "os/mynewt.h"
 #include "hal/hal_bsp.h"
 #include "bsp/bsp.h"
-#include "syscfg/syscfg.h"
 #include "uart/uart.h"
 #if MYNEWT_VAL(UART_0) || MYNEWT_VAL(UART_1)
 #include "uart_hal/uart_hal.h"
diff --git a/hw/bsp/dwm1001-dev/include/bsp/bsp.h b/hw/bsp/dwm1001-dev/include/bsp/bsp.h
index ee1b9c44b..b57e8c98c 100644
--- a/hw/bsp/dwm1001-dev/include/bsp/bsp.h
+++ b/hw/bsp/dwm1001-dev/include/bsp/bsp.h
@@ -22,7 +22,7 @@
 
 #include <inttypes.h>
 
-#include <syscfg/syscfg.h>
+#include "os/mynewt.h"
 
 #ifdef __cplusplus
 extern "C" {
diff --git a/hw/bsp/dwm1001-dev/src/hal_bsp.c b/hw/bsp/dwm1001-dev/src/hal_bsp.c
index 5181767a2..c9dd4d975 100644
--- a/hw/bsp/dwm1001-dev/src/hal_bsp.c
+++ b/hw/bsp/dwm1001-dev/src/hal_bsp.c
@@ -21,9 +21,7 @@
 #include <stddef.h>
 #include <assert.h>
 #include <nrf52.h>
-#include "os/os_cputime.h"
-#include "syscfg/syscfg.h"
-#include "sysflash/sysflash.h"
+#include "os/mynewt.h"
 #include "flash_map/flash_map.h"
 #include "hal/hal_bsp.h"
 #include "hal/hal_system.h"
@@ -41,7 +39,6 @@
 #if MYNEWT_VAL(UART_1)
 #include "uart_bitbang/uart_bitbang.h"
 #endif
-#include "os/os_dev.h"
 #include "bsp.h"
 #if MYNEWT_VAL(ADC_0)
 #include <adc_nrf52/adc_nrf52.h>
diff --git a/hw/bsp/embarc_emsk/include/bsp/bsp.h b/hw/bsp/embarc_emsk/include/bsp/bsp.h
index ec32214a6..b35a7711a 100644
--- a/hw/bsp/embarc_emsk/include/bsp/bsp.h
+++ b/hw/bsp/embarc_emsk/include/bsp/bsp.h
@@ -22,7 +22,7 @@
 
 #include <inttypes.h>
 
-#include <syscfg/syscfg.h>
+#include "os/mynewt.h"
 
 #ifdef __cplusplus
 extern "C" {
diff --git a/hw/bsp/embarc_emsk/src/hal_bsp.c b/hw/bsp/embarc_emsk/src/hal_bsp.c
index 80e59175b..b3bc9028f 100644
--- a/hw/bsp/embarc_emsk/src/hal_bsp.c
+++ b/hw/bsp/embarc_emsk/src/hal_bsp.c
@@ -20,9 +20,7 @@
 #include <stdint.h>
 #include <stddef.h>
 #include <assert.h>
-#include "os/os_cputime.h"
-#include "syscfg/syscfg.h"
-#include "sysflash/sysflash.h"
+#include "os/mynewt.h"
 #include "flash_map/flash_map.h"
 #include "hal/hal_bsp.h"
 #include "hal/hal_system.h"
@@ -39,7 +37,6 @@
 #if MYNEWT_VAL(UART_1)
 #include "uart_bitbang/uart_bitbang.h"
 #endif
-#include "os/os_dev.h"
 #include "bsp/bsp.h"
 
 /*
diff --git a/hw/bsp/frdm-k64f/src/hal_bsp.c b/hw/bsp/frdm-k64f/src/hal_bsp.c
index 8cda57b7a..a811a7953 100644
--- a/hw/bsp/frdm-k64f/src/hal_bsp.c
+++ b/hw/bsp/frdm-k64f/src/hal_bsp.c
@@ -22,8 +22,7 @@
 #include <errno.h>
 #include <sys/types.h>
 #include <stdio.h>
-#include "os/os_dev.h"
-#include "syscfg/syscfg.h"
+#include "os/mynewt.h"
 #include "bsp/bsp.h"
 #include "hal/hal_bsp.h"
 #include "hal/hal_flash_int.h"
diff --git a/hw/bsp/hifive1/src/hal_bsp.c b/hw/bsp/hifive1/src/hal_bsp.c
index 6fbb6ed1c..7904276cc 100644
--- a/hw/bsp/hifive1/src/hal_bsp.c
+++ b/hw/bsp/hifive1/src/hal_bsp.c
@@ -21,9 +21,7 @@
 #include <stddef.h>
 #include <assert.h>
 
-#include <os/os_cputime.h>
-#include <syscfg/syscfg.h>
-#include <sysflash/sysflash.h>
+#include "os/mynewt.h"
 #include <flash_map/flash_map.h>
 #include <hal/hal_bsp.h>
 #include <hal/hal_flash.h>
@@ -34,7 +32,6 @@
 #include <uart/uart.h>
 #include <uart_hal/uart_hal.h>
 #endif
-#include <os/os_dev.h>
 #include <bsp/bsp.h>
 #include <env/freedom-e300-hifive1/platform.h>
 
diff --git a/hw/bsp/native-armv7/src/hal_bsp.c b/hw/bsp/native-armv7/src/hal_bsp.c
index 0396dee50..f3034233a 100644
--- a/hw/bsp/native-armv7/src/hal_bsp.c
+++ b/hw/bsp/native-armv7/src/hal_bsp.c
@@ -21,16 +21,14 @@
 #include <assert.h>
 #include <string.h>
 #include <inttypes.h>
+#include "os/mynewt.h"
 #include <bsp/bsp.h>
-#include "sysflash/sysflash.h"
-#include "os/os.h"
 #include "hal/hal_flash_int.h"
 #include "flash_map/flash_map.h"
 #include "uart/uart.h"
 #include "uart_hal/uart_hal.h"
 #include "mcu/native_bsp.h"
 #include "mcu/mcu_hal.h"
-#include "syscfg/syscfg.h"
 
 #if MYNEWT_VAL(SIM_ACCEL_PRESENT)
 #include "sim/sim_accel.h"
diff --git a/hw/bsp/native-mips/src/hal_bsp.c b/hw/bsp/native-mips/src/hal_bsp.c
index 0396dee50..f3034233a 100644
--- a/hw/bsp/native-mips/src/hal_bsp.c
+++ b/hw/bsp/native-mips/src/hal_bsp.c
@@ -21,16 +21,14 @@
 #include <assert.h>
 #include <string.h>
 #include <inttypes.h>
+#include "os/mynewt.h"
 #include <bsp/bsp.h>
-#include "sysflash/sysflash.h"
-#include "os/os.h"
 #include "hal/hal_flash_int.h"
 #include "flash_map/flash_map.h"
 #include "uart/uart.h"
 #include "uart_hal/uart_hal.h"
 #include "mcu/native_bsp.h"
 #include "mcu/mcu_hal.h"
-#include "syscfg/syscfg.h"
 
 #if MYNEWT_VAL(SIM_ACCEL_PRESENT)
 #include "sim/sim_accel.h"
diff --git a/hw/bsp/native/src/hal_bsp.c b/hw/bsp/native/src/hal_bsp.c
index 0396dee50..f3034233a 100644
--- a/hw/bsp/native/src/hal_bsp.c
+++ b/hw/bsp/native/src/hal_bsp.c
@@ -21,16 +21,14 @@
 #include <assert.h>
 #include <string.h>
 #include <inttypes.h>
+#include "os/mynewt.h"
 #include <bsp/bsp.h>
-#include "sysflash/sysflash.h"
-#include "os/os.h"
 #include "hal/hal_flash_int.h"
 #include "flash_map/flash_map.h"
 #include "uart/uart.h"
 #include "uart_hal/uart_hal.h"
 #include "mcu/native_bsp.h"
 #include "mcu/mcu_hal.h"
-#include "syscfg/syscfg.h"
 
 #if MYNEWT_VAL(SIM_ACCEL_PRESENT)
 #include "sim/sim_accel.h"
diff --git a/hw/bsp/nina-b1/include/bsp/bsp.h b/hw/bsp/nina-b1/include/bsp/bsp.h
index 3391a65d5..10ae8c901 100644
--- a/hw/bsp/nina-b1/include/bsp/bsp.h
+++ b/hw/bsp/nina-b1/include/bsp/bsp.h
@@ -22,7 +22,7 @@
 
 #include <inttypes.h>
 
-#include <syscfg/syscfg.h>
+#include "os/mynewt.h"
 
 #ifdef __cplusplus
 extern "C" {
diff --git a/hw/bsp/nina-b1/src/hal_bsp.c b/hw/bsp/nina-b1/src/hal_bsp.c
index a97b04a06..1ba2a3c28 100644
--- a/hw/bsp/nina-b1/src/hal_bsp.c
+++ b/hw/bsp/nina-b1/src/hal_bsp.c
@@ -20,10 +20,8 @@
 #include <stdint.h>
 #include <stddef.h>
 #include <assert.h>
+#include "os/mynewt.h"
 #include <nrf52.h>
-#include "os/os_cputime.h"
-#include "syscfg/syscfg.h"
-#include "sysflash/sysflash.h"
 #include "flash_map/flash_map.h"
 #include "hal/hal_bsp.h"
 #include "hal/hal_system.h"
@@ -41,7 +39,6 @@
 #if MYNEWT_VAL(UART_1)
 #include "uart_bitbang/uart_bitbang.h"
 #endif
-#include "os/os_dev.h"
 #include "bsp.h"
 #if MYNEWT_VAL(ADC_0)
 #include <adc_nrf52/adc_nrf52.h>
diff --git a/hw/bsp/nrf51-arduino_101/src/hal_bsp.c b/hw/bsp/nrf51-arduino_101/src/hal_bsp.c
index 01d1cdb94..589ab8090 100644
--- a/hw/bsp/nrf51-arduino_101/src/hal_bsp.c
+++ b/hw/bsp/nrf51-arduino_101/src/hal_bsp.c
@@ -20,19 +20,17 @@
 #include <stdint.h>
 #include <stddef.h>
 #include <assert.h>
+#include "os/mynewt.h"
 #include <nrf51.h>
 #include <mcu/nrf51_hal.h>
 #include <hal/hal_bsp.h>
 #include "hal/hal_system.h"
 #include "bsp/bsp.h"
-#include "os/os_cputime.h"
-#include "syscfg/syscfg.h"
 #include "flash_map/flash_map.h"
 #include "hal/hal_flash.h"
 #include "mcu/cmsis_nvic.h"
 #include "nrf51_bitfields.h"
 #include "hal/hal_spi.h"
-#include "os/os_dev.h"
 
 #if MYNEWT_VAL(UART_0)
 #include "uart/uart.h"
diff --git a/hw/bsp/nrf51-blenano/src/hal_bsp.c b/hw/bsp/nrf51-blenano/src/hal_bsp.c
index 5b7f958f9..a6759e95d 100644
--- a/hw/bsp/nrf51-blenano/src/hal_bsp.c
+++ b/hw/bsp/nrf51-blenano/src/hal_bsp.c
@@ -20,17 +20,15 @@
 #include <stdint.h>
 #include <stddef.h>
 #include <assert.h>
+#include "os/mynewt.h"
 #include "hal/hal_system.h"
 #include "bsp/bsp.h"
 #include <nrf51.h>
 #include "mcu/nrf51_hal.h"
 #include "hal/hal_bsp.h"
-#include "os/os_cputime.h"
-#include "syscfg/syscfg.h"
 #include "flash_map/flash_map.h"
 #include "hal/hal_flash.h"
 #include "hal/hal_spi.h"
-#include "os/os_dev.h"
 
 #if MYNEWT_VAL(ADC_0)
 #include <adc_nrf51/adc_nrf51.h>
diff --git a/hw/bsp/nrf51dk-16kbram/src/hal_bsp.c b/hw/bsp/nrf51dk-16kbram/src/hal_bsp.c
index 5b17ec7ff..9ec1d8f88 100644
--- a/hw/bsp/nrf51dk-16kbram/src/hal_bsp.c
+++ b/hw/bsp/nrf51dk-16kbram/src/hal_bsp.c
@@ -20,13 +20,11 @@
 #include <stdint.h>
 #include <stddef.h>
 #include <assert.h>
-#include "syscfg/syscfg.h"
+#include "os/mynewt.h"
 #include "hal/hal_bsp.h"
 #include "hal/hal_system.h"
 #include "mcu/nrf51_hal.h"
 #include "bsp/bsp.h"
-#include "os/os_dev.h"
-#include "os/os_cputime.h"
 #include "flash_map/flash_map.h"
 #include "hal/hal_flash.h"
 #include "hal/hal_spi.h"
diff --git a/hw/bsp/nrf51dk/src/hal_bsp.c b/hw/bsp/nrf51dk/src/hal_bsp.c
index e45f81dfd..de14b6962 100644
--- a/hw/bsp/nrf51dk/src/hal_bsp.c
+++ b/hw/bsp/nrf51dk/src/hal_bsp.c
@@ -20,13 +20,11 @@
 #include <stdint.h>
 #include <stddef.h>
 #include <assert.h>
-#include "syscfg/syscfg.h"
+#include "os/mynewt.h"
 #include "hal/hal_bsp.h"
 #include "hal/hal_system.h"
 #include "mcu/nrf51_hal.h"
 #include "bsp/bsp.h"
-#include "os/os_dev.h"
-#include "os/os_cputime.h"
 #include "flash_map/flash_map.h"
 #include "hal/hal_flash.h"
 #include "hal/hal_spi.h"
diff --git a/hw/bsp/nrf52-thingy/include/bsp/bsp.h b/hw/bsp/nrf52-thingy/include/bsp/bsp.h
index 2f67051a0..0f56b3887 100644
--- a/hw/bsp/nrf52-thingy/include/bsp/bsp.h
+++ b/hw/bsp/nrf52-thingy/include/bsp/bsp.h
@@ -22,7 +22,7 @@
 
 #include <inttypes.h>
 
-#include <syscfg/syscfg.h>
+#include "os/mynewt.h"
 
 #ifdef __cplusplus
 extern "C" {
diff --git a/hw/bsp/nrf52-thingy/src/hal_bsp.c b/hw/bsp/nrf52-thingy/src/hal_bsp.c
index 48c8ca368..33bbf79af 100644
--- a/hw/bsp/nrf52-thingy/src/hal_bsp.c
+++ b/hw/bsp/nrf52-thingy/src/hal_bsp.c
@@ -21,11 +21,8 @@
 #include <stddef.h>
 #include <string.h>
 #include <assert.h>
-#include <sysinit/sysinit.h>
+#include "os/mynewt.h"
 #include <nrf52.h>
-#include "os/os_cputime.h"
-#include "syscfg/syscfg.h"
-#include "sysflash/sysflash.h"
 #include "flash_map/flash_map.h"
 #include "hal/hal_bsp.h"
 #include "hal/hal_system.h"
@@ -43,7 +40,6 @@
 #if MYNEWT_VAL(UART_1)
 #include "uart_bitbang/uart_bitbang.h"
 #endif
-#include "os/os_dev.h"
 #include "bsp.h"
 #if MYNEWT_VAL(ADC_0)
 #include <adc_nrf52/adc_nrf52.h>
diff --git a/hw/bsp/nrf52840pdk/src/hal_bsp.c b/hw/bsp/nrf52840pdk/src/hal_bsp.c
index 24903f5f6..b5d6dc369 100644
--- a/hw/bsp/nrf52840pdk/src/hal_bsp.c
+++ b/hw/bsp/nrf52840pdk/src/hal_bsp.c
@@ -21,9 +21,7 @@
 #include <stddef.h>
 #include <assert.h>
 #include <nrf52840.h>
-#include "os/os_cputime.h"
-#include "syscfg/syscfg.h"
-#include "sysflash/sysflash.h"
+#include "os/mynewt.h"
 #include "flash_map/flash_map.h"
 #include "hal/hal_bsp.h"
 #include "hal/hal_system.h"
@@ -41,7 +39,6 @@
 #if MYNEWT_VAL(UART_1)
 #include "uart_bitbang/uart_bitbang.h"
 #endif
-#include "os/os_dev.h"
 #include "bsp.h"
 #if MYNEWT_VAL(ADC_0)
 #include <adc_nrf52/adc_nrf52.h>
diff --git a/hw/bsp/nrf52dk/include/bsp/bsp.h b/hw/bsp/nrf52dk/include/bsp/bsp.h
index 76228fdfd..4339dd4f5 100644
--- a/hw/bsp/nrf52dk/include/bsp/bsp.h
+++ b/hw/bsp/nrf52dk/include/bsp/bsp.h
@@ -22,7 +22,7 @@
 
 #include <inttypes.h>
 
-#include <syscfg/syscfg.h>
+#include "os/mynewt.h"
 
 #ifdef __cplusplus
 extern "C" {
diff --git a/hw/bsp/nrf52dk/src/hal_bsp.c b/hw/bsp/nrf52dk/src/hal_bsp.c
index 7aa04a537..c88a1e825 100644
--- a/hw/bsp/nrf52dk/src/hal_bsp.c
+++ b/hw/bsp/nrf52dk/src/hal_bsp.c
@@ -21,9 +21,7 @@
 #include <stddef.h>
 #include <assert.h>
 #include <nrf52.h>
-#include "os/os_cputime.h"
-#include "syscfg/syscfg.h"
-#include "sysflash/sysflash.h"
+#include "os/mynewt.h"
 #include "flash_map/flash_map.h"
 #include "hal/hal_bsp.h"
 #include "hal/hal_system.h"
@@ -41,7 +39,6 @@
 #if MYNEWT_VAL(UART_1)
 #include "uart_bitbang/uart_bitbang.h"
 #endif
-#include "os/os_dev.h"
 #include "bsp.h"
 #if MYNEWT_VAL(ADC_0)
 #include <adc_nrf52/adc_nrf52.h>
diff --git a/hw/bsp/nucleo-f303k8/include/bsp/bsp.h b/hw/bsp/nucleo-f303k8/include/bsp/bsp.h
index 7111b7504..5964dd2f4 100644
--- a/hw/bsp/nucleo-f303k8/include/bsp/bsp.h
+++ b/hw/bsp/nucleo-f303k8/include/bsp/bsp.h
@@ -21,7 +21,7 @@
 
 #include <inttypes.h>
 #include <mcu/mcu.h>
-#include <syscfg/syscfg.h>
+#include "os/mynewt.h"
 
 #ifdef __cplusplus
 extern "C" {
diff --git a/hw/bsp/nucleo-f303k8/src/hal_bsp.c b/hw/bsp/nucleo-f303k8/src/hal_bsp.c
index 9213e995e..916d19ed3 100644
--- a/hw/bsp/nucleo-f303k8/src/hal_bsp.c
+++ b/hw/bsp/nucleo-f303k8/src/hal_bsp.c
@@ -18,7 +18,7 @@
  */
 #include <stddef.h>
 
-#include "os/os_dev.h"
+#include "os/mynewt.h"
 
 #if MYNEWT_VAL(UART_0) || MYNEWT_VAL(UART_1)
 /*
@@ -37,12 +37,10 @@
 #include "hal/hal_system.h"
 #include "mcu/mcu.h"
 #include "mcu/stm32f3_bsp.h"
-#include "os/os_cputime.h"
 #include "stm32f3xx.h"
 #include "stm32f3xx_hal.h"
 #include "stm32f3xx_hal_gpio.h"
 #include "stm32f3xx_hal_rcc.h"
-#include "syscfg/syscfg.h"
 
 #if MYNEWT_VAL(UART_0) || MYNEWT_VAL(UART_1)
 static struct uart_dev hal_uart[2];
diff --git a/hw/bsp/nucleo-f303re/include/bsp/bsp.h b/hw/bsp/nucleo-f303re/include/bsp/bsp.h
index 7e622f056..5a8bedda6 100644
--- a/hw/bsp/nucleo-f303re/include/bsp/bsp.h
+++ b/hw/bsp/nucleo-f303re/include/bsp/bsp.h
@@ -21,7 +21,7 @@
 
 #include <inttypes.h>
 #include <mcu/mcu.h>
-#include <syscfg/syscfg.h>
+#include "os/mynewt.h"
 
 #ifdef __cplusplus
 extern "C" {
diff --git a/hw/bsp/nucleo-f303re/src/hal_bsp.c b/hw/bsp/nucleo-f303re/src/hal_bsp.c
index 7a4d1c52a..dcd562f2f 100644
--- a/hw/bsp/nucleo-f303re/src/hal_bsp.c
+++ b/hw/bsp/nucleo-f303re/src/hal_bsp.c
@@ -18,7 +18,7 @@
  */
 #include <stddef.h>
 
-#include "os/os_dev.h"
+#include "os/mynewt.h"
 
 #if MYNEWT_VAL(UART_0) || MYNEWT_VAL(UART_1)
 /*
@@ -37,12 +37,10 @@
 #include "hal/hal_system.h"
 #include "mcu/mcu.h"
 #include "mcu/stm32f3_bsp.h"
-#include "os/os_cputime.h"
 #include "stm32f3xx.h"
 #include "stm32f3xx_hal.h"
 #include "stm32f3xx_hal_gpio.h"
 #include "stm32f3xx_hal_rcc.h"
-#include "syscfg/syscfg.h"
 
 #if MYNEWT_VAL(UART_0) || MYNEWT_VAL(UART_1)
 static struct uart_dev hal_uart[2];
diff --git a/hw/bsp/nucleo-f401re/src/hal_bsp.c b/hw/bsp/nucleo-f401re/src/hal_bsp.c
index 6d3e3d575..d86d7e7ed 100644
--- a/hw/bsp/nucleo-f401re/src/hal_bsp.c
+++ b/hw/bsp/nucleo-f401re/src/hal_bsp.c
@@ -16,9 +16,9 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-#include <syscfg/syscfg.h>
 
-#include <os/os_dev.h>
+#include "os/mynewt.h"
+
 #if MYNEWT_VAL(UART_0)
 #include <uart/uart.h>
 #include <uart_hal/uart_hal.h>
diff --git a/hw/bsp/nucleo-f413re/src/hal_bsp.c b/hw/bsp/nucleo-f413re/src/hal_bsp.c
index d8ff5ccbc..793892605 100644
--- a/hw/bsp/nucleo-f413re/src/hal_bsp.c
+++ b/hw/bsp/nucleo-f413re/src/hal_bsp.c
@@ -16,11 +16,11 @@
  * specific language governing permissions and limitations
  * under the License.
  */
+
 #include <assert.h>
 
-#include <syscfg/syscfg.h>
+#include "os/mynewt.h"
 
-#include <os/os_dev.h>
 #if MYNEWT_VAL(UART_0)
 #include <uart/uart.h>
 #include <uart_hal/uart_hal.h>
diff --git a/hw/bsp/nucleo-f413zh/src/hal_bsp.c b/hw/bsp/nucleo-f413zh/src/hal_bsp.c
index 96dcbcf86..d62af86ab 100644
--- a/hw/bsp/nucleo-f413zh/src/hal_bsp.c
+++ b/hw/bsp/nucleo-f413zh/src/hal_bsp.c
@@ -16,11 +16,11 @@
  * specific language governing permissions and limitations
  * under the License.
  */
+
 #include <assert.h>
 
-#include <syscfg/syscfg.h>
+#include "os/mynewt.h"
 
-#include <os/os_dev.h>
 #if MYNEWT_VAL(UART_0)
 #include <uart/uart.h>
 #include <uart_hal/uart_hal.h>
diff --git a/hw/bsp/olimex-p103/src/hal_bsp.c b/hw/bsp/olimex-p103/src/hal_bsp.c
index ca6e22675..f06eb7173 100644
--- a/hw/bsp/olimex-p103/src/hal_bsp.c
+++ b/hw/bsp/olimex-p103/src/hal_bsp.c
@@ -16,11 +16,11 @@
  * specific language governing permissions and limitations
  * under the License.
  */
+
 #include <assert.h>
 
-#include <syscfg/syscfg.h>
+#include "os/mynewt.h"
 
-#include <os/os_dev.h>
 #if MYNEWT_VAL(UART_0)
 #include <uart/uart.h>
 #include <uart_hal/uart_hal.h>
diff --git a/hw/bsp/olimex_stm32-e407_devboard/src/hal_bsp.c b/hw/bsp/olimex_stm32-e407_devboard/src/hal_bsp.c
index 2b9535fee..4170c6573 100644
--- a/hw/bsp/olimex_stm32-e407_devboard/src/hal_bsp.c
+++ b/hw/bsp/olimex_stm32-e407_devboard/src/hal_bsp.c
@@ -18,14 +18,13 @@
  */
 
 #include <assert.h>
-#include "syscfg/syscfg.h"
+#include "os/mynewt.h"
 #include "bsp/bsp.h"
 #include "stm32f407xx.h"
 #include "stm32f4xx_hal_gpio_ex.h"
 #include "stm32f4xx_hal_dma.h"
 #include "stm32f4xx_hal_adc.h"
 #include "flash_map/flash_map.h"
-#include "os/os_dev.h"
 #if MYNEWT_VAL(UART_0)
 #include "uart/uart.h"
 #include "uart_hal/uart_hal.h"
diff --git a/hw/bsp/pic32mx470_6lp_clicker/src/hal_bsp.c b/hw/bsp/pic32mx470_6lp_clicker/src/hal_bsp.c
index 42aebfd67..76584749a 100644
--- a/hw/bsp/pic32mx470_6lp_clicker/src/hal_bsp.c
+++ b/hw/bsp/pic32mx470_6lp_clicker/src/hal_bsp.c
@@ -16,10 +16,11 @@
  * specific language governing permissions and limitations
  * under the License.
  */
+
 #include <assert.h>
 
+#include "os/mynewt.h"
 #include <hal/hal_bsp.h>
-#include <syscfg/syscfg.h>
 #include <mcu/mcu.h>
 #include <mcu/mips_bsp.h>
 #include <mcu/mips_hal.h>
diff --git a/hw/bsp/pic32mz2048_wi-fire/src/hal_bsp.c b/hw/bsp/pic32mz2048_wi-fire/src/hal_bsp.c
index f8a0eb337..eff8462c6 100644
--- a/hw/bsp/pic32mz2048_wi-fire/src/hal_bsp.c
+++ b/hw/bsp/pic32mz2048_wi-fire/src/hal_bsp.c
@@ -18,7 +18,7 @@
  */
 #include <assert.h>
 
-#include <syscfg/syscfg.h>
+#include "os/mynewt.h"
 
 #include <hal/hal_bsp.h>
 #include <mcu/mips_bsp.h>
diff --git a/hw/bsp/puckjs/include/bsp/bsp.h b/hw/bsp/puckjs/include/bsp/bsp.h
index 63bb82ced..261e38df3 100644
--- a/hw/bsp/puckjs/include/bsp/bsp.h
+++ b/hw/bsp/puckjs/include/bsp/bsp.h
@@ -22,7 +22,7 @@
 
 #include <inttypes.h>
 
-#include <syscfg/syscfg.h>
+#include "os/mynewt.h"
 
 #ifdef __cplusplus
 extern "C" {
diff --git a/hw/bsp/puckjs/src/hal_bsp.c b/hw/bsp/puckjs/src/hal_bsp.c
index 340abc3c2..aed066aa5 100644
--- a/hw/bsp/puckjs/src/hal_bsp.c
+++ b/hw/bsp/puckjs/src/hal_bsp.c
@@ -20,10 +20,8 @@
 #include <stdint.h>
 #include <stddef.h>
 #include <assert.h>
+#include "os/mynewt.h"
 #include <nrf52.h>
-#include "os/os_cputime.h"
-#include "syscfg/syscfg.h"
-#include "sysflash/sysflash.h"
 #include "flash_map/flash_map.h"
 #include "hal/hal_bsp.h"
 #include "hal/hal_system.h"
@@ -41,7 +39,6 @@
 #if MYNEWT_VAL(UART_1)
 #include "uart_bitbang/uart_bitbang.h"
 #endif
-#include "os/os_dev.h"
 #include "bsp.h"
 #if MYNEWT_VAL(ADC_0)
 #include <adc_nrf52/adc_nrf52.h>
diff --git a/hw/bsp/rb-blend2/src/hal_bsp.c b/hw/bsp/rb-blend2/src/hal_bsp.c
index 884205ed8..da4b1badd 100644
--- a/hw/bsp/rb-blend2/src/hal_bsp.c
+++ b/hw/bsp/rb-blend2/src/hal_bsp.c
@@ -19,14 +19,12 @@
 #include <stdint.h>
 #include <stddef.h>
 #include <assert.h>
-#include "syscfg/syscfg.h"
+#include "os/mynewt.h"
 #include "bsp/bsp.h"
 #include "nrf52.h"
 #include "hal/hal_bsp.h"
 #include "hal/hal_system.h"
 #include "mcu/nrf52_hal.h"
-#include "os/os_cputime.h"
-#include "sysflash/sysflash.h"
 #include "flash_map/flash_map.h"
 #include "hal/hal_flash.h"
 #include "hal/hal_spi.h"
@@ -41,7 +39,6 @@
 #if MYNEWT_VAL(UART_1)
 #include "uart_bitbang/uart_bitbang.h"
 #endif
-#include "os/os_dev.h"
 #include "bsp.h"
 #if MYNEWT_VAL(ADC_0)
 #include <adc_nrf52/adc_nrf52.h>
diff --git a/hw/bsp/rb-nano2/src/hal_bsp.c b/hw/bsp/rb-nano2/src/hal_bsp.c
index 2883ec76c..599f40b4f 100644
--- a/hw/bsp/rb-nano2/src/hal_bsp.c
+++ b/hw/bsp/rb-nano2/src/hal_bsp.c
@@ -19,14 +19,12 @@
 #include <stdint.h>
 #include <stddef.h>
 #include <assert.h>
-#include "syscfg/syscfg.h"
+#include "os/mynewt.h"
 #include "bsp/bsp.h"
 #include "nrf52.h"
 #include "hal/hal_bsp.h"
 #include "hal/hal_system.h"
 #include "mcu/nrf52_hal.h"
-#include "os/os_cputime.h"
-#include "sysflash/sysflash.h"
 #include "flash_map/flash_map.h"
 #include "hal/hal_flash.h"
 #include "hal/hal_spi.h"
@@ -40,7 +38,6 @@
 #if MYNEWT_VAL(UART_1)
 #include "uart_bitbang/uart_bitbang.h"
 #endif
-#include "os/os_dev.h"
 #include "bsp.h"
 #if MYNEWT_VAL(ADC_0)
 #include <adc_nrf52/adc_nrf52.h>
diff --git a/hw/bsp/ruuvi_tag_revb2/include/bsp/bsp.h b/hw/bsp/ruuvi_tag_revb2/include/bsp/bsp.h
index 24174dd67..2e5c758c2 100644
--- a/hw/bsp/ruuvi_tag_revb2/include/bsp/bsp.h
+++ b/hw/bsp/ruuvi_tag_revb2/include/bsp/bsp.h
@@ -22,7 +22,7 @@
 
 #include <inttypes.h>
 
-#include <syscfg/syscfg.h>
+#include "os/mynewt.h"
 
 #ifdef __cplusplus
 extern "C" {
diff --git a/hw/bsp/ruuvi_tag_revb2/src/hal_bsp.c b/hw/bsp/ruuvi_tag_revb2/src/hal_bsp.c
index fce00a63d..52ca9da38 100644
--- a/hw/bsp/ruuvi_tag_revb2/src/hal_bsp.c
+++ b/hw/bsp/ruuvi_tag_revb2/src/hal_bsp.c
@@ -21,11 +21,8 @@
 #include <stddef.h>
 #include <string.h>
 #include <assert.h>
-#include <sysinit/sysinit.h>
+#include "os/mynewt.h"
 #include <nrf52.h>
-#include "os/os_cputime.h"
-#include "syscfg/syscfg.h"
-#include "sysflash/sysflash.h"
 #include "flash_map/flash_map.h"
 #include "hal/hal_bsp.h"
 #include "hal/hal_system.h"
@@ -34,7 +31,6 @@
 #include "hal/hal_watchdog.h"
 #include "hal/hal_i2c.h"
 #include "mcu/nrf52_hal.h"
-#include "defs/error.h"
 #if MYNEWT_VAL(UART_0) || MYNEWT_VAL(UART_1)
 #include "uart/uart.h"
 #endif
@@ -44,7 +40,6 @@
 #if MYNEWT_VAL(UART_1)
 #include "uart_bitbang/uart_bitbang.h"
 #endif
-#include "os/os_dev.h"
 #include "bsp.h"
 #if MYNEWT_VAL(ADC_0)
 #include <adc_nrf52/adc_nrf52.h>
diff --git a/hw/bsp/sensorhub/include/bsp/bsp.h b/hw/bsp/sensorhub/include/bsp/bsp.h
index 6dd38e457..38e927841 100644
--- a/hw/bsp/sensorhub/include/bsp/bsp.h
+++ b/hw/bsp/sensorhub/include/bsp/bsp.h
@@ -21,7 +21,7 @@
 
 #include <inttypes.h>
 #include <mcu/mcu.h>
-#include <syscfg/syscfg.h>
+#include "os/mynewt.h"
 
 #ifdef __cplusplus
 extern "C" {
diff --git a/hw/bsp/sensorhub/src/hal_bsp.c b/hw/bsp/sensorhub/src/hal_bsp.c
index 1e02c9061..f181851ea 100644
--- a/hw/bsp/sensorhub/src/hal_bsp.c
+++ b/hw/bsp/sensorhub/src/hal_bsp.c
@@ -17,8 +17,7 @@
  * under the License.
  */
 #include <assert.h>
-#include "syscfg/syscfg.h"
-#include "os/os_dev.h"
+#include "os/mynewt.h"
 #if MYNEWT_VAL(UART_0)
 #include <uart/uart.h>
 #include <uart_hal/uart_hal.h>
diff --git a/hw/bsp/stm32f3discovery/include/bsp/bsp.h b/hw/bsp/stm32f3discovery/include/bsp/bsp.h
index cb41dbb74..2744c6af5 100644
--- a/hw/bsp/stm32f3discovery/include/bsp/bsp.h
+++ b/hw/bsp/stm32f3discovery/include/bsp/bsp.h
@@ -21,7 +21,7 @@
 
 #include <inttypes.h>
 #include <mcu/mcu.h>
-#include <syscfg/syscfg.h>
+#include "os/mynewt.h"
 
 #ifdef __cplusplus
 extern "C" {
diff --git a/hw/bsp/stm32f3discovery/src/hal_bsp.c b/hw/bsp/stm32f3discovery/src/hal_bsp.c
index 2e4ecc3a4..95a3e87eb 100644
--- a/hw/bsp/stm32f3discovery/src/hal_bsp.c
+++ b/hw/bsp/stm32f3discovery/src/hal_bsp.c
@@ -17,11 +17,8 @@
  * under the License.
  */
 #include <stddef.h>
-
-#include <syscfg/syscfg.h>
-
-#include <os/os_dev.h>
 #include <assert.h>
+#include "os/mynewt.h"
 
 #if MYNEWT_VAL(UART_0)
 /*
@@ -36,7 +33,6 @@
 #include <hal/hal_flash_int.h>
 #include <hal/hal_gpio.h>
 #include <hal/hal_system.h>
-#include <os/os_cputime.h>
 
 #if MYNEWT_VAL(SPI_0_MASTER) || MYNEWT_VAL(SPI_0_SLAVE) || \
     MYNEWT_VAL(SPI_1_MASTER) || MYNEWT_VAL(SPI_1_SLAVE)
diff --git a/hw/bsp/stm32f429discovery/src/hal_bsp.c b/hw/bsp/stm32f429discovery/src/hal_bsp.c
index 34bbddaef..49eac7d22 100644
--- a/hw/bsp/stm32f429discovery/src/hal_bsp.c
+++ b/hw/bsp/stm32f429discovery/src/hal_bsp.c
@@ -18,11 +18,10 @@
  */
 #include <assert.h>
 
-#include <syscfg/syscfg.h>
+#include "os/mynewt.h"
 #include <bsp/bsp.h>
 #include <mcu/cmsis_nvic.h>
 #include <flash_map/flash_map.h>
-#include <os/os_dev.h>
 #include <stm32f429xx.h>
 #include <stm32f4xx_hal_gpio_ex.h>
 
@@ -40,8 +39,6 @@
 
 #include <mcu/stm32f4_bsp.h>
 
-
-
 #if MYNEWT_VAL(UART_0)
 static struct uart_dev hal_uart0;
 
diff --git a/hw/bsp/stm32f4discovery/src/hal_bsp.c b/hw/bsp/stm32f4discovery/src/hal_bsp.c
index 439451306..b783f9d74 100644
--- a/hw/bsp/stm32f4discovery/src/hal_bsp.c
+++ b/hw/bsp/stm32f4discovery/src/hal_bsp.c
@@ -18,9 +18,8 @@
  */
 #include <assert.h>
 
-#include <syscfg/syscfg.h>
+#include "os/mynewt.h"
 
-#include <os/os_dev.h>
 #if MYNEWT_VAL(UART_0)
 #include <uart/uart.h>
 #include <uart_hal/uart_hal.h>
diff --git a/hw/bsp/stm32f767-nucleo/src/hal_bsp.c b/hw/bsp/stm32f767-nucleo/src/hal_bsp.c
index 23e902dea..f79ec4d8a 100644
--- a/hw/bsp/stm32f767-nucleo/src/hal_bsp.c
+++ b/hw/bsp/stm32f767-nucleo/src/hal_bsp.c
@@ -18,10 +18,8 @@
  */
 #include <assert.h>
 
-#include <syscfg/syscfg.h>
+#include "os/mynewt.h"
 
-#include <os/os_dev.h>
-#include <os/os_cputime.h>
 #if MYNEWT_VAL(UART_0)
 #include <uart/uart.h>
 #include <uart_hal/uart_hal.h>
diff --git a/hw/bsp/stm32f7discovery/src/hal_bsp.c b/hw/bsp/stm32f7discovery/src/hal_bsp.c
index 0da7f5dcd..3e277c3ef 100644
--- a/hw/bsp/stm32f7discovery/src/hal_bsp.c
+++ b/hw/bsp/stm32f7discovery/src/hal_bsp.c
@@ -18,10 +18,8 @@
  */
 #include <assert.h>
 
-#include <syscfg/syscfg.h>
+#include "os/mynewt.h"
 
-#include <os/os_dev.h>
-#include <os/os_cputime.h>
 #if MYNEWT_VAL(UART_0)
 #include <uart/uart.h>
 #include <uart_hal/uart_hal.h>
diff --git a/hw/bsp/stm32l152discovery/src/hal_bsp.c b/hw/bsp/stm32l152discovery/src/hal_bsp.c
index 1b6563e4b..0e8d5216f 100644
--- a/hw/bsp/stm32l152discovery/src/hal_bsp.c
+++ b/hw/bsp/stm32l152discovery/src/hal_bsp.c
@@ -18,9 +18,8 @@
  */
 #include <assert.h>
 
-#include <syscfg/syscfg.h>
+#include "os/mynewt.h"
 
-#include <os/os_dev.h>
 #if MYNEWT_VAL(UART_0)
 #include <uart/uart.h>
 #include <uart_hal/uart_hal.h>
diff --git a/hw/bsp/telee02/include/bsp/bsp.h b/hw/bsp/telee02/include/bsp/bsp.h
index fa2c5c7e0..d2d14881e 100644
--- a/hw/bsp/telee02/include/bsp/bsp.h
+++ b/hw/bsp/telee02/include/bsp/bsp.h
@@ -22,7 +22,7 @@
 
 #include <inttypes.h>
 
-#include <syscfg/syscfg.h>
+#include "os/mynewt.h"
 
 #ifdef __cplusplus
 extern "C" {
diff --git a/hw/bsp/telee02/src/hal_bsp.c b/hw/bsp/telee02/src/hal_bsp.c
index 166eadac2..41f48e625 100644
--- a/hw/bsp/telee02/src/hal_bsp.c
+++ b/hw/bsp/telee02/src/hal_bsp.c
@@ -20,10 +20,8 @@
 #include <stdint.h>
 #include <stddef.h>
 #include <assert.h>
+#include "os/mynewt.h"
 #include <nrf52.h>
-#include "os/os_cputime.h"
-#include "syscfg/syscfg.h"
-#include "sysflash/sysflash.h"
 #include "flash_map/flash_map.h"
 #include "hal/hal_bsp.h"
 #include "hal/hal_system.h"
@@ -42,7 +40,6 @@
 #if MYNEWT_VAL(UART_1)
 #include "uart_bitbang/uart_bitbang.h"
 #endif
-#include "os/os_dev.h"
 #include "bsp.h"
 #if MYNEWT_VAL(ADC_0)
 #include <adc_nrf52/adc_nrf52.h>
diff --git a/hw/bsp/vbluno51/src/hal_bsp.c b/hw/bsp/vbluno51/src/hal_bsp.c
index 50c24c4a1..d5c5ff4a7 100644
--- a/hw/bsp/vbluno51/src/hal_bsp.c
+++ b/hw/bsp/vbluno51/src/hal_bsp.c
@@ -20,13 +20,11 @@
 #include <stdint.h>
 #include <stddef.h>
 #include <assert.h>
-#include "syscfg/syscfg.h"
+#include "os/mynewt.h"
 #include "hal/hal_bsp.h"
 #include "hal/hal_system.h"
 #include "mcu/nrf51_hal.h"
 #include "bsp/bsp.h"
-#include "os/os_dev.h"
-#include "os/os_cputime.h"
 #include "flash_map/flash_map.h"
 #include "hal/hal_flash.h"
 #include "hal/hal_spi.h"
diff --git a/hw/bsp/vbluno52/include/bsp/bsp.h b/hw/bsp/vbluno52/include/bsp/bsp.h
index 760ae1ba2..951c8f2e9 100644
--- a/hw/bsp/vbluno52/include/bsp/bsp.h
+++ b/hw/bsp/vbluno52/include/bsp/bsp.h
@@ -22,7 +22,7 @@
 
 #include <inttypes.h>
 
-#include <syscfg/syscfg.h>
+#include "os/mynewt.h"
 
 #ifdef __cplusplus
 extern "C" {
diff --git a/hw/bsp/vbluno52/src/hal_bsp.c b/hw/bsp/vbluno52/src/hal_bsp.c
index 5bf134c17..f4871cc36 100644
--- a/hw/bsp/vbluno52/src/hal_bsp.c
+++ b/hw/bsp/vbluno52/src/hal_bsp.c
@@ -20,10 +20,8 @@
 #include <stdint.h>
 #include <stddef.h>
 #include <assert.h>
+#include "os/mynewt.h"
 #include <nrf52.h>
-#include "os/os_cputime.h"
-#include "syscfg/syscfg.h"
-#include "sysflash/sysflash.h"
 #include "flash_map/flash_map.h"
 #include "hal/hal_bsp.h"
 #include "hal/hal_system.h"
@@ -41,7 +39,6 @@
 #if MYNEWT_VAL(UART_1)
 #include "uart_bitbang/uart_bitbang.h"
 #endif
-#include "os/os_dev.h"
 #include "bsp.h"
 #if MYNEWT_VAL(ADC_0)
 #include <adc_nrf52/adc_nrf52.h>
diff --git a/hw/charge-control/include/charge-control/charge_control.h b/hw/charge-control/include/charge-control/charge_control.h
index 9a8315c2d..85ee9c692 100644
--- a/hw/charge-control/include/charge-control/charge_control.h
+++ b/hw/charge-control/include/charge-control/charge_control.h
@@ -28,9 +28,7 @@
 #ifndef __CHARGE_CONTROL_H__
 #define __CHARGE_CONTROL_H__
 
-#include "os/os.h"
-#include "os/os_dev.h"
-#include "syscfg/syscfg.h"
+#include "os/mynewt.h"
 
 #ifdef __cplusplus
 extern "C" {
diff --git a/hw/charge-control/src/charge_control.c b/hw/charge-control/src/charge_control.c
index 4b153e88c..683e70130 100644
--- a/hw/charge-control/src/charge_control.c
+++ b/hw/charge-control/src/charge_control.c
@@ -19,11 +19,7 @@
 
 #include <string.h>
 
-#include "os/os.h"
-#include "os/os_dev.h"
-#include "defs/error.h"
-#include "syscfg/syscfg.h"
-#include "sysinit/sysinit.h"
+#include "os/mynewt.h"
 #include "charge-control/charge_control.h"
 #include "charge_control_priv.h"
 
diff --git a/hw/drivers/adc/adc_nrf51/src/adc_nrf51.c b/hw/drivers/adc/adc_nrf51/src/adc_nrf51.c
index 3b80615a1..e0610f743 100644
--- a/hw/drivers/adc/adc_nrf51/src/adc_nrf51.c
+++ b/hw/drivers/adc/adc_nrf51/src/adc_nrf51.c
@@ -16,17 +16,17 @@
  * specific language governing permissions and limitations
  * under the License.
  */
+
+#include <assert.h>
+#include "os/mynewt.h"
 #include <hal/hal_bsp.h>
 #include <adc/adc.h>
-#include <assert.h>
-#include <os/os.h>
 #include <mcu/cmsis_nvic.h>
 
 /* Nordic headers */
 #include <nrfx.h>
 #include <nrfx_adc.h>
 
-
 #include "adc_nrf51/adc_nrf51.h"
 
 /**
diff --git a/hw/drivers/adc/adc_nrf52/src/adc_nrf52.c b/hw/drivers/adc/adc_nrf52/src/adc_nrf52.c
index 1e16db1b1..045cffb72 100644
--- a/hw/drivers/adc/adc_nrf52/src/adc_nrf52.c
+++ b/hw/drivers/adc/adc_nrf52/src/adc_nrf52.c
@@ -17,11 +17,10 @@
  * under the License.
  */
 
-
+#include <assert.h>
+#include "os/mynewt.h"
 #include <hal/hal_bsp.h>
 #include <adc/adc.h>
-#include <assert.h>
-#include <os/os.h>
 #include <mcu/cmsis_nvic.h>
 
 /* Nordic headers */
diff --git a/hw/drivers/adc/adc_stm32f4/src/adc_stm32f4.c b/hw/drivers/adc/adc_stm32f4/src/adc_stm32f4.c
index c55e811a9..c49820fa6 100644
--- a/hw/drivers/adc/adc_stm32f4/src/adc_stm32f4.c
+++ b/hw/drivers/adc/adc_stm32f4/src/adc_stm32f4.c
@@ -20,7 +20,7 @@
 
 #include <hal/hal_bsp.h>
 #include <assert.h>
-#include <os/os.h>
+#include "os/mynewt.h"
 #include <mcu/cmsis_nvic.h>
 #include "stm32f4xx_hal_dma.h"
 #include "stm32f4xx_hal_adc.h"
@@ -30,7 +30,6 @@
 #include "adc_stm32f4/adc_stm32f4.h"
 #include "stm32f4xx_hal_dma.h"
 #include "mcu/stm32f4xx_mynewt_hal.h"
-#include "syscfg/syscfg.h"
 
 #if MYNEWT_VAL(ADC_1)||MYNEWT_VAL(ADC_2)||MYNEWT_VAL(ADC_3)
 #include <adc/adc.h>
diff --git a/hw/drivers/adc/include/adc/adc.h b/hw/drivers/adc/include/adc/adc.h
index 732c903c1..b9aff11ef 100644
--- a/hw/drivers/adc/include/adc/adc.h
+++ b/hw/drivers/adc/include/adc/adc.h
@@ -20,7 +20,7 @@
 #ifndef __ADC_H__
 #define __ADC_H__
 
-#include <os/os_dev.h>
+#include "os/mynewt.h"
 
 #ifdef __cplusplus
 extern "C" {
diff --git a/hw/drivers/chg_ctrl/bq24040/include/bq24040/bq24040.h b/hw/drivers/chg_ctrl/bq24040/include/bq24040/bq24040.h
index 1f0e5b7da..acb2552c8 100644
--- a/hw/drivers/chg_ctrl/bq24040/include/bq24040/bq24040.h
+++ b/hw/drivers/chg_ctrl/bq24040/include/bq24040/bq24040.h
@@ -20,7 +20,7 @@
 #ifndef __BQ24040_H__
 #define __BQ24040_H__
 
-#include "os/os.h"
+#include "os/mynewt.h"
 #include "hal/hal_gpio.h"
 #include "charge-control/charge_control.h"
 
diff --git a/hw/drivers/chg_ctrl/bq24040/src/bq24040.c b/hw/drivers/chg_ctrl/bq24040/src/bq24040.c
index c8eaa9e20..0ab1fc53f 100644
--- a/hw/drivers/chg_ctrl/bq24040/src/bq24040.c
+++ b/hw/drivers/chg_ctrl/bq24040/src/bq24040.c
@@ -20,7 +20,7 @@
 #include <assert.h>
 #include <string.h>
 
-#include "defs/error.h"
+#include "os/mynewt.h"
 #include "hal/hal_gpio.h"
 #include "bq24040/bq24040.h"
 #include "console/console.h"
diff --git a/hw/drivers/debounce/src/debounce.c b/hw/drivers/debounce/src/debounce.c
index b02bf55bf..76ad07970 100644
--- a/hw/drivers/debounce/src/debounce.c
+++ b/hw/drivers/debounce/src/debounce.c
@@ -17,9 +17,9 @@
  * under the License.
  */
 
-#include "debounce/debounce.h"
-#include "syscfg/syscfg.h"
 #include <string.h>
+#include "os/mynewt.h"
+#include "debounce/debounce.h"
 
 static void
 debounce_check(void *arg)
diff --git a/hw/drivers/drv2605/include/drv2605/drv2605.h b/hw/drivers/drv2605/include/drv2605/drv2605.h
index 2fb2a004f..a0485d606 100644
--- a/hw/drivers/drv2605/include/drv2605/drv2605.h
+++ b/hw/drivers/drv2605/include/drv2605/drv2605.h
@@ -20,8 +20,7 @@
 #ifndef __DRV2605_H__
 #define __DRV2605_H__
 
-#include <os/os.h>
-#include "os/os_dev.h"
+#include "os/mynewt.h"
 #include "sensor/sensor.h"
 
 #ifdef __cplusplus
diff --git a/hw/drivers/drv2605/src/drv2605.c b/hw/drivers/drv2605/src/drv2605.c
index 16e0616fd..cbee770f9 100644
--- a/hw/drivers/drv2605/src/drv2605.c
+++ b/hw/drivers/drv2605/src/drv2605.c
@@ -21,9 +21,7 @@
 #include <errno.h>
 #include <assert.h>
 
-#include "defs/error.h"
-#include "os/os.h"
-#include "sysinit/sysinit.h"
+#include "os/mynewt.h"
 #include "hal/hal_i2c.h"
 #include "hal/hal_gpio.h"
 #include "drv2605/drv2605.h"
diff --git a/hw/drivers/drv2605/src/drv2605_shell.c b/hw/drivers/drv2605/src/drv2605_shell.c
index d56f694ae..5b4b7c37c 100644
--- a/hw/drivers/drv2605/src/drv2605_shell.c
+++ b/hw/drivers/drv2605/src/drv2605_shell.c
@@ -19,7 +19,7 @@
 
 #include <string.h>
 #include <errno.h>
-#include "sysinit/sysinit.h"
+#include "os/mynewt.h"
 #include "console/console.h"
 #include "shell/shell.h"
 #include "drv2605_priv.h"
diff --git a/hw/drivers/flash/at45db/src/at45db.c b/hw/drivers/flash/at45db/src/at45db.c
index 664f430fb..baa4dd068 100644
--- a/hw/drivers/flash/at45db/src/at45db.c
+++ b/hw/drivers/flash/at45db/src/at45db.c
@@ -17,16 +17,15 @@
  * under the License.
  */
 
-#include <os/os.h>
+#include <string.h>
 
+#include "os/mynewt.h"
 #include <hal/hal_spi.h>
 #include <hal/hal_gpio.h>
 #include <hal/hal_flash.h>
 #include <hal/hal_flash_int.h>
 #include <at45db/at45db.h>
 
-#include <string.h>
-
 /**
  * Memory Architecture:
  *
diff --git a/hw/drivers/lora/sx1272/src/sx1272-board.c b/hw/drivers/lora/sx1272/src/sx1272-board.c
index 5a88b54c5..5edd53141 100644
--- a/hw/drivers/lora/sx1272/src/sx1272-board.c
+++ b/hw/drivers/lora/sx1272/src/sx1272-board.c
@@ -12,8 +12,9 @@ License: Revised BSD License, see LICENSE.TXT file include in the project
 
 Maintainer: Miguel Luis and Gregory Cristian
 */
+
 #include <assert.h>
-#include "os/os.h"
+#include "os/mynewt.h"
 #include "hal/hal_spi.h"
 #include "hal/hal_gpio.h"
 #include "bsp/bsp.h"
diff --git a/hw/drivers/lora/sx1272/src/sx1272.c b/hw/drivers/lora/sx1272/src/sx1272.c
index 28d6c08fd..7f3fe844f 100644
--- a/hw/drivers/lora/sx1272/src/sx1272.c
+++ b/hw/drivers/lora/sx1272/src/sx1272.c
@@ -15,13 +15,11 @@ Maintainer: Miguel Luis and Gregory Cristian
 #include <math.h>
 #include <string.h>
 #include <stdlib.h>
-#include "sysinit/sysinit.h"
-#include "syscfg/syscfg.h"
+#include "os/mynewt.h"
 #include "hal/hal_gpio.h"
 #include "hal/hal_spi.h"
 #include "hal/hal_timer.h"
 #include "bsp/bsp.h"
-#include "os/os.h"
 #include "radio/radio.h"
 #include "sx1272.h"
 #include "sx1272-board.h"
diff --git a/hw/drivers/lora/sx1276/src/sx1276.c b/hw/drivers/lora/sx1276/src/sx1276.c
index 967fef5c0..7ac9628b9 100644
--- a/hw/drivers/lora/sx1276/src/sx1276.c
+++ b/hw/drivers/lora/sx1276/src/sx1276.c
@@ -15,13 +15,11 @@ Maintainer: Miguel Luis, Gregory Cristian and Wael Guibene
 #include <assert.h>
 #include <math.h>
 #include <string.h>
-#include "sysinit/sysinit.h"
-#include "syscfg/syscfg.h"
+#include "os/mynewt.h"
 #include "hal/hal_gpio.h"
 #include "hal/hal_spi.h"
 #include "hal/hal_timer.h"
 #include "bsp/bsp.h"
-#include "os/os.h"
 #include "radio/radio.h"
 #include "sx1276.h"
 #include "sx1276-board.h"
diff --git a/hw/drivers/lp5523/src/lp5523.c b/hw/drivers/lp5523/src/lp5523.c
index e466919b3..55cccc930 100644
--- a/hw/drivers/lp5523/src/lp5523.c
+++ b/hw/drivers/lp5523/src/lp5523.c
@@ -17,8 +17,7 @@
  * under the License.
  */
 
-#include <defs/error.h>
-#include <sysinit/sysinit.h>
+#include "os/mynewt.h"
 #include <hal/hal_i2c.h>
 #include <log/log.h>
 #include <stats/stats.h>
diff --git a/hw/drivers/lp5523/src/lp5523_shell.c b/hw/drivers/lp5523/src/lp5523_shell.c
index 669a42e4b..991414a10 100644
--- a/hw/drivers/lp5523/src/lp5523_shell.c
+++ b/hw/drivers/lp5523/src/lp5523_shell.c
@@ -19,7 +19,7 @@
 
 #include <string.h>
 #include <errno.h>
-#include "sysinit/sysinit.h"
+#include "os/mynewt.h"
 #include "console/console.h"
 #include "sensor/sensor.h"
 #include "shell/shell.h"
diff --git a/hw/drivers/lwip/stm32_eth/src/stm32_eth.c b/hw/drivers/lwip/stm32_eth/src/stm32_eth.c
index b295b2340..44353d6b1 100755
--- a/hw/drivers/lwip/stm32_eth/src/stm32_eth.c
+++ b/hw/drivers/lwip/stm32_eth/src/stm32_eth.c
@@ -17,14 +17,12 @@
  * under the License.
  */
 
-#include <syscfg/syscfg.h>
+#include "os/mynewt.h"
 
 #include <hal/hal_gpio.h>
 #include <hal/hal_timer.h>
 #include <mcu/cmsis_nvic.h>
 
-#include <os/os_cputime.h>
-
 #if MYNEWT_VAL(MCU_STM32F4)
 #include <bsp/stm32f4xx_hal_conf.h>
 #include <mcu/stm32f4_bsp.h>
diff --git a/hw/drivers/mmc/include/mmc/mmc.h b/hw/drivers/mmc/include/mmc/mmc.h
index 4b14e27b3..9646a8a41 100644
--- a/hw/drivers/mmc/include/mmc/mmc.h
+++ b/hw/drivers/mmc/include/mmc/mmc.h
@@ -20,7 +20,7 @@
 #ifndef __MMC_H__
 #define __MMC_H__
 
-#include <os/os_dev.h>
+#include "os/mynewt.h"
 #include <disk/disk.h>
 
 #ifdef __cplusplus
diff --git a/hw/drivers/pwm/include/pwm/pwm.h b/hw/drivers/pwm/include/pwm/pwm.h
index 745702bef..d38633e6c 100644
--- a/hw/drivers/pwm/include/pwm/pwm.h
+++ b/hw/drivers/pwm/include/pwm/pwm.h
@@ -20,7 +20,7 @@
 #ifndef __PWM_H__
 #define __PWM_H__
 
-#include <os/os_dev.h>
+#include "os/mynewt.h"
 
 #ifdef __cplusplus
 extern "C" {
diff --git a/hw/drivers/pwm/pwm_nrf52/src/pwm_nrf52.c b/hw/drivers/pwm/pwm_nrf52/src/pwm_nrf52.c
index b74cacf1f..e36f446ab 100644
--- a/hw/drivers/pwm/pwm_nrf52/src/pwm_nrf52.c
+++ b/hw/drivers/pwm/pwm_nrf52/src/pwm_nrf52.c
@@ -17,13 +17,13 @@
  * under the License.
  */
 
-#include <bsp.h>
-#include <hal/hal_bsp.h>
 #include <assert.h>
-#include <os/os.h>
+#include <string.h>
 #include <errno.h>
+#include "os/mynewt.h"
+#include <bsp.h>
+#include <hal/hal_bsp.h>
 #include <pwm/pwm.h>
-#include <string.h>
 #include <mcu/cmsis_nvic.h>
 
 /* Nordic headers */
diff --git a/hw/drivers/pwm/soft_pwm/src/soft_pwm.c b/hw/drivers/pwm/soft_pwm/src/soft_pwm.c
index 6afb99c59..9908effb6 100644
--- a/hw/drivers/pwm/soft_pwm/src/soft_pwm.c
+++ b/hw/drivers/pwm/soft_pwm/src/soft_pwm.c
@@ -18,9 +18,9 @@
  */
 
 #include <assert.h>
-#include <os/os.h>
 #include <errno.h>
 #include <string.h>
+#include "os/mynewt.h"
 #include <pwm/pwm.h>
 #include <hal/hal_bsp.h>
 #include <hal/hal_gpio.h>
diff --git a/hw/drivers/rtt/include/rtt/SEGGER_RTT_Conf.h b/hw/drivers/rtt/include/rtt/SEGGER_RTT_Conf.h
index 8e2a59b12..b9d287a90 100644
--- a/hw/drivers/rtt/include/rtt/SEGGER_RTT_Conf.h
+++ b/hw/drivers/rtt/include/rtt/SEGGER_RTT_Conf.h
@@ -63,7 +63,7 @@ Revision: $Rev: 4351 $
 #ifndef SEGGER_RTT_CONF_H
 #define SEGGER_RTT_CONF_H
 
-#include "syscfg/syscfg.h"
+#include "os/mynewt.h"
 
 #ifdef __IAR_SYSTEMS_ICC__
   #include <intrinsics.h>
diff --git a/hw/drivers/rtt/include/rtt/SEGGER_RTT_Conf_Mynewt.h b/hw/drivers/rtt/include/rtt/SEGGER_RTT_Conf_Mynewt.h
index 4ec38ca57..b6aaee188 100644
--- a/hw/drivers/rtt/include/rtt/SEGGER_RTT_Conf_Mynewt.h
+++ b/hw/drivers/rtt/include/rtt/SEGGER_RTT_Conf_Mynewt.h
@@ -1,7 +1,7 @@
 #ifndef SEGGER_RTT_CONF_H
 #define SEGGER_RTT_CONF_H
 
-#include "os/os.h"
+#include "os/mynewt.h"
 
 #define SEGGER_RTT_LOCK()   {                       \
                             int sr;                 \
diff --git a/hw/drivers/rtt/src/SEGGER_RTT.c b/hw/drivers/rtt/src/SEGGER_RTT.c
index 4e5aeecaf..465fe7e53 100644
--- a/hw/drivers/rtt/src/SEGGER_RTT.c
+++ b/hw/drivers/rtt/src/SEGGER_RTT.c
@@ -79,10 +79,9 @@ Additional information:
 ----------------------------------------------------------------------
 */
 
-#include "rtt/SEGGER_RTT.h"
-#include "sysinit/sysinit.h"
-
 #include <string.h>                 // for memcpy
+#include "os/mynewt.h"
+#include "rtt/SEGGER_RTT.h"
 
 /*********************************************************************
 *
diff --git a/hw/drivers/sensors/adxl345/include/adxl345/adxl345.h b/hw/drivers/sensors/adxl345/include/adxl345/adxl345.h
index 39eb42d57..3dec16212 100644
--- a/hw/drivers/sensors/adxl345/include/adxl345/adxl345.h
+++ b/hw/drivers/sensors/adxl345/include/adxl345/adxl345.h
@@ -20,8 +20,7 @@
 #ifndef __SENSOR_ADXL345_H__
 #define __SENSOR_ADXL345_H__
 
-#include "os/os.h"
-#include "os/os_dev.h"
+#include "os/mynewt.h"
 #include "sensor/sensor.h"
 
 #ifdef __cplusplus
diff --git a/hw/drivers/sensors/adxl345/src/adxl345.c b/hw/drivers/sensors/adxl345/src/adxl345.c
index 1f3645078..dbe15a3af 100644
--- a/hw/drivers/sensors/adxl345/src/adxl345.c
+++ b/hw/drivers/sensors/adxl345/src/adxl345.c
@@ -22,9 +22,7 @@
 #include <assert.h>
 #include <math.h>
 
-#include "sysinit/sysinit.h"
-#include "defs/error.h"
-#include "os/os.h"
+#include "os/mynewt.h"
 #include "hal/hal_i2c.h"
 #include "hal/hal_spi.h"
 #include "hal/hal_gpio.h"
diff --git a/hw/drivers/sensors/adxl345/src/adxl345_shell.c b/hw/drivers/sensors/adxl345/src/adxl345_shell.c
index ff489aeed..9bc031922 100644
--- a/hw/drivers/sensors/adxl345/src/adxl345_shell.c
+++ b/hw/drivers/sensors/adxl345/src/adxl345_shell.c
@@ -19,7 +19,7 @@
 
 #include <string.h>
 #include <errno.h>
-#include "sysinit/sysinit.h"
+#include "os/mynewt.h"
 #include "console/console.h"
 #include "shell/shell.h"
 #include "sensor/accel.h"
diff --git a/hw/drivers/sensors/bma253/include/bma253/bma253.h b/hw/drivers/sensors/bma253/include/bma253/bma253.h
index d4eea662d..a5a37fb55 100644
--- a/hw/drivers/sensors/bma253/include/bma253/bma253.h
+++ b/hw/drivers/sensors/bma253/include/bma253/bma253.h
@@ -20,8 +20,7 @@
 #ifndef __BMA253_H__
 #define __BMA253_H__
 
-#include "os/os.h"
-#include "os/os_dev.h"
+#include "os/mynewt.h"
 #include "sensor/sensor.h"
 #include "sensor/accel.h"
 #include "sensor/temperature.h"
diff --git a/hw/drivers/sensors/bma253/src/bma253.c b/hw/drivers/sensors/bma253/src/bma253.c
index 76e23643b..94606e905 100644
--- a/hw/drivers/sensors/bma253/src/bma253.c
+++ b/hw/drivers/sensors/bma253/src/bma253.c
@@ -21,9 +21,9 @@
 #include <math.h>
 #include <string.h>
 
+#include "os/mynewt.h"
 #include "bma253/bma253.h"
 #include "bma253_priv.h"
-#include "defs/error.h"
 #include "hal/hal_gpio.h"
 #include "hal/hal_i2c.h"
 
diff --git a/hw/drivers/sensors/bma253/src/bma253_shell.c b/hw/drivers/sensors/bma253/src/bma253_shell.c
index 6a5ae9c4f..d5a07dec8 100644
--- a/hw/drivers/sensors/bma253/src/bma253_shell.c
+++ b/hw/drivers/sensors/bma253/src/bma253_shell.c
@@ -19,7 +19,7 @@
 
 #include <errno.h>
 
-#include "syscfg/syscfg.h"
+#include "os/mynewt.h"
 #include "bma253/bma253.h"
 #include "bma253_priv.h"
 #include "console/console.h"
diff --git a/hw/drivers/sensors/bme280/include/bme280/bme280.h b/hw/drivers/sensors/bme280/include/bme280/bme280.h
index 77e36391f..55c78896c 100644
--- a/hw/drivers/sensors/bme280/include/bme280/bme280.h
+++ b/hw/drivers/sensors/bme280/include/bme280/bme280.h
@@ -21,8 +21,7 @@
 #ifndef __BME280_H__
 #define __BME280_H__
 
-#include <os/os.h>
-#include "os/os_dev.h"
+#include "os/mynewt.h"
 #include "sensor/sensor.h"
 
 #define BME280_SPI_READ_CMD_BIT 0x80
diff --git a/hw/drivers/sensors/bme280/src/bme280.c b/hw/drivers/sensors/bme280/src/bme280.c
index 56107277f..53c23b485 100644
--- a/hw/drivers/sensors/bme280/src/bme280.c
+++ b/hw/drivers/sensors/bme280/src/bme280.c
@@ -22,9 +22,7 @@
 #include <errno.h>
 #include <string.h>
 
-#include "defs/error.h"
-#include "os/os.h"
-#include "sysinit/sysinit.h"
+#include "os/mynewt.h"
 #include "hal/hal_spi.h"
 #include "sensor/sensor.h"
 #include "bme280/bme280.h"
diff --git a/hw/drivers/sensors/bme280/src/bme280_shell.c b/hw/drivers/sensors/bme280/src/bme280_shell.c
index f9a836a17..5275e2d2d 100644
--- a/hw/drivers/sensors/bme280/src/bme280_shell.c
+++ b/hw/drivers/sensors/bme280/src/bme280_shell.c
@@ -19,7 +19,7 @@
 
 #include <string.h>
 #include <errno.h>
-#include "sysinit/sysinit.h"
+#include "os/mynewt.h"
 #include "console/console.h"
 #include "shell/shell.h"
 #include "hal/hal_gpio.h"
diff --git a/hw/drivers/sensors/bmp280/include/bmp280/bmp280.h b/hw/drivers/sensors/bmp280/include/bmp280/bmp280.h
index 9cab00b02..f1763703f 100644
--- a/hw/drivers/sensors/bmp280/include/bmp280/bmp280.h
+++ b/hw/drivers/sensors/bmp280/include/bmp280/bmp280.h
@@ -21,8 +21,7 @@
 #ifndef __bmp280_H__
 #define __bmp280_H__
 
-#include <os/os.h>
-#include "os/os_dev.h"
+#include "os/mynewt.h"
 #include "sensor/sensor.h"
 
 #define BMP280_SPI_READ_CMD_BIT 0x80
diff --git a/hw/drivers/sensors/bmp280/src/bmp280.c b/hw/drivers/sensors/bmp280/src/bmp280.c
index c3904a9af..76420ba1b 100644
--- a/hw/drivers/sensors/bmp280/src/bmp280.c
+++ b/hw/drivers/sensors/bmp280/src/bmp280.c
@@ -22,9 +22,7 @@
 #include <errno.h>
 #include <string.h>
 
-#include "defs/error.h"
-#include "os/os.h"
-#include "sysinit/sysinit.h"
+#include "os/mynewt.h"
 #include "hal/hal_spi.h"
 #include "hal/hal_i2c.h"
 #include "sensor/sensor.h"
diff --git a/hw/drivers/sensors/bmp280/src/bmp280_shell.c b/hw/drivers/sensors/bmp280/src/bmp280_shell.c
index 201d40ae6..df2d165be 100644
--- a/hw/drivers/sensors/bmp280/src/bmp280_shell.c
+++ b/hw/drivers/sensors/bmp280/src/bmp280_shell.c
@@ -19,7 +19,7 @@
 
 #include <string.h>
 #include <errno.h>
-#include "sysinit/sysinit.h"
+#include "os/mynewt.h"
 #include "console/console.h"
 #include "shell/shell.h"
 #include "hal/hal_gpio.h"
diff --git a/hw/drivers/sensors/bno055/include/bno055/bno055.h b/hw/drivers/sensors/bno055/include/bno055/bno055.h
index aa7691d7e..32d1eba4b 100644
--- a/hw/drivers/sensors/bno055/include/bno055/bno055.h
+++ b/hw/drivers/sensors/bno055/include/bno055/bno055.h
@@ -20,8 +20,7 @@
 #ifndef __BNO055_H__
 #define __BNO055_H__
 
-#include <os/os.h>
-#include "os/os_dev.h"
+#include "os/mynewt.h"
 #include "sensor/sensor.h"
 
 #ifdef __cplusplus
diff --git a/hw/drivers/sensors/bno055/src/bno055.c b/hw/drivers/sensors/bno055/src/bno055.c
index c34daeb04..f09c7cf90 100644
--- a/hw/drivers/sensors/bno055/src/bno055.c
+++ b/hw/drivers/sensors/bno055/src/bno055.c
@@ -21,9 +21,7 @@
 #include <errno.h>
 #include <assert.h>
 
-#include "defs/error.h"
-#include "os/os.h"
-#include "sysinit/sysinit.h"
+#include "os/mynewt.h"
 #include "hal/hal_i2c.h"
 #include "sensor/sensor.h"
 #include "sensor/accel.h"
diff --git a/hw/drivers/sensors/bno055/src/bno055_shell.c b/hw/drivers/sensors/bno055/src/bno055_shell.c
index 8495d090b..4206cffe2 100644
--- a/hw/drivers/sensors/bno055/src/bno055_shell.c
+++ b/hw/drivers/sensors/bno055/src/bno055_shell.c
@@ -19,7 +19,7 @@
 
 #include <string.h>
 #include <errno.h>
-#include "sysinit/sysinit.h"
+#include "os/mynewt.h"
 #include "console/console.h"
 #include "shell/shell.h"
 #include "hal/hal_gpio.h"
diff --git a/hw/drivers/sensors/lis2dh12/include/lis2dh12/lis2dh12.h b/hw/drivers/sensors/lis2dh12/include/lis2dh12/lis2dh12.h
index 08a1c7f02..82a1e1dd3 100644
--- a/hw/drivers/sensors/lis2dh12/include/lis2dh12/lis2dh12.h
+++ b/hw/drivers/sensors/lis2dh12/include/lis2dh12/lis2dh12.h
@@ -20,8 +20,7 @@
 #ifndef __LIS2DH12_H__
 #define __LIS2DH12_H__
 
-#include <os/os.h>
-#include "os/os_dev.h"
+#include "os/mynewt.h"
 #include "sensor/sensor.h"
 
 #ifdef __cplusplus
diff --git a/hw/drivers/sensors/lis2dh12/src/lis2dh12.c b/hw/drivers/sensors/lis2dh12/src/lis2dh12.c
index bb2640c61..e21663234 100644
--- a/hw/drivers/sensors/lis2dh12/src/lis2dh12.c
+++ b/hw/drivers/sensors/lis2dh12/src/lis2dh12.c
@@ -22,9 +22,7 @@
 #include <errno.h>
 #include <string.h>
 
-#include "sysinit/sysinit.h"
-#include "defs/error.h"
-#include "os/os.h"
+#include "os/mynewt.h"
 #include "hal/hal_spi.h"
 #include "hal/hal_i2c.h"
 #include "sensor/sensor.h"
diff --git a/hw/drivers/sensors/lis2dw12/include/lis2dw12/lis2dw12.h b/hw/drivers/sensors/lis2dw12/include/lis2dw12/lis2dw12.h
index 25b78292a..bd956d203 100644
--- a/hw/drivers/sensors/lis2dw12/include/lis2dw12/lis2dw12.h
+++ b/hw/drivers/sensors/lis2dw12/include/lis2dw12/lis2dw12.h
@@ -20,8 +20,7 @@
 #ifndef __LIS2DW12_H__
 #define __LIS2DW12_H__
 
-#include <os/os.h>
-#include "os/os_dev.h"
+#include "os/mynewt.h"
 #include "sensor/sensor.h"
 
 #ifdef __cplusplus
diff --git a/hw/drivers/sensors/lis2dw12/src/lis2dw12.c b/hw/drivers/sensors/lis2dw12/src/lis2dw12.c
index 2dd04e868..81b2e09e9 100644
--- a/hw/drivers/sensors/lis2dw12/src/lis2dw12.c
+++ b/hw/drivers/sensors/lis2dw12/src/lis2dw12.c
@@ -22,9 +22,7 @@
 #include <errno.h>
 #include <string.h>
 
-#include "sysinit/sysinit.h"
-#include "defs/error.h"
-#include "os/os.h"
+#include "os/mynewt.h"
 #include "hal/hal_spi.h"
 #include "hal/hal_i2c.h"
 #include "sensor/sensor.h"
diff --git a/hw/drivers/sensors/lis2dw12/src/lis2dw12_shell.c b/hw/drivers/sensors/lis2dw12/src/lis2dw12_shell.c
index c8a2f1618..3ebe98c5b 100644
--- a/hw/drivers/sensors/lis2dw12/src/lis2dw12_shell.c
+++ b/hw/drivers/sensors/lis2dw12/src/lis2dw12_shell.c
@@ -19,7 +19,7 @@
 
 #include <string.h>
 #include <errno.h>
-#include "sysinit/sysinit.h"
+#include "os/mynewt.h"
 #include "console/console.h"
 #include "shell/shell.h"
 #include "sensor/accel.h"
diff --git a/hw/drivers/sensors/lps33hw/include/lps33hw/lps33hw.h b/hw/drivers/sensors/lps33hw/include/lps33hw/lps33hw.h
index 8c92e723b..ae2ecea88 100644
--- a/hw/drivers/sensors/lps33hw/include/lps33hw/lps33hw.h
+++ b/hw/drivers/sensors/lps33hw/include/lps33hw/lps33hw.h
@@ -20,8 +20,7 @@
 #ifndef __SENSOR_LPS33HW_H__
 #define __SENSOR_LPS33HW_H__
 
-#include "os/os.h"
-#include "os/os_dev.h"
+#include "os/mynewt.h"
 #include "sensor/sensor.h"
 #include "hal/hal_gpio.h"
 
diff --git a/hw/drivers/sensors/lps33hw/src/lps33hw.c b/hw/drivers/sensors/lps33hw/src/lps33hw.c
index dffaf16e9..9955dfbef 100644
--- a/hw/drivers/sensors/lps33hw/src/lps33hw.c
+++ b/hw/drivers/sensors/lps33hw/src/lps33hw.c
@@ -22,9 +22,7 @@
 #include <assert.h>
 #include <math.h>
 
-#include "defs/error.h"
-#include "os/os.h"
-#include "sysinit/sysinit.h"
+#include "os/mynewt.h"
 #include "hal/hal_i2c.h"
 #include "sensor/sensor.h"
 #include "sensor/pressure.h"
diff --git a/hw/drivers/sensors/lps33hw/src/lps33hw_shell.c b/hw/drivers/sensors/lps33hw/src/lps33hw_shell.c
index 514e1d8be..8870557e9 100644
--- a/hw/drivers/sensors/lps33hw/src/lps33hw_shell.c
+++ b/hw/drivers/sensors/lps33hw/src/lps33hw_shell.c
@@ -19,7 +19,7 @@
 
 #include <string.h>
 #include <errno.h>
-#include "sysinit/sysinit.h"
+#include "os/mynewt.h"
 #include "console/console.h"
 #include "hal/hal_gpio.h"
 #include "lps33hw/lps33hw.h"
diff --git a/hw/drivers/sensors/lsm303dlhc/include/lsm303dlhc/lsm303dlhc.h b/hw/drivers/sensors/lsm303dlhc/include/lsm303dlhc/lsm303dlhc.h
index d90bc7d2a..bec2a2389 100644
--- a/hw/drivers/sensors/lsm303dlhc/include/lsm303dlhc/lsm303dlhc.h
+++ b/hw/drivers/sensors/lsm303dlhc/include/lsm303dlhc/lsm303dlhc.h
@@ -20,8 +20,7 @@
 #ifndef __SENSOR_LSM303DLHC_H__
 #define __SENSOR_LSM303DLHC_H__
 
-#include "os/os.h"
-#include "os/os_dev.h"
+#include "os/mynewt.h"
 #include "sensor/sensor.h"
 
 #ifdef __cplusplus
diff --git a/hw/drivers/sensors/lsm303dlhc/src/lsm303dlhc.c b/hw/drivers/sensors/lsm303dlhc/src/lsm303dlhc.c
index 69fbc33d6..00935fb58 100644
--- a/hw/drivers/sensors/lsm303dlhc/src/lsm303dlhc.c
+++ b/hw/drivers/sensors/lsm303dlhc/src/lsm303dlhc.c
@@ -21,9 +21,7 @@
 #include <errno.h>
 #include <assert.h>
 
-#include "defs/error.h"
-#include "os/os.h"
-#include "sysinit/sysinit.h"
+#include "os/mynewt.h"
 #include "hal/hal_i2c.h"
 #include "sensor/sensor.h"
 #include "sensor/accel.h"
diff --git a/hw/drivers/sensors/mpu6050/include/mpu6050/mpu6050.h b/hw/drivers/sensors/mpu6050/include/mpu6050/mpu6050.h
index 74d548d00..69ac7c26b 100644
--- a/hw/drivers/sensors/mpu6050/include/mpu6050/mpu6050.h
+++ b/hw/drivers/sensors/mpu6050/include/mpu6050/mpu6050.h
@@ -20,8 +20,7 @@
 #ifndef __SENSOR_MPU6050_H__
 #define __SENSOR_MPU6050_H__
 
-#include "os/os.h"
-#include "os/os_dev.h"
+#include "os/mynewt.h"
 #include "sensor/sensor.h"
 
 #ifdef __cplusplus
diff --git a/hw/drivers/sensors/mpu6050/src/mpu6050.c b/hw/drivers/sensors/mpu6050/src/mpu6050.c
index 2d15ba587..b241238fc 100644
--- a/hw/drivers/sensors/mpu6050/src/mpu6050.c
+++ b/hw/drivers/sensors/mpu6050/src/mpu6050.c
@@ -21,9 +21,7 @@
 #include <errno.h>
 #include <assert.h>
 
-#include "defs/error.h"
-#include "os/os.h"
-#include "sysinit/sysinit.h"
+#include "os/mynewt.h"
 #include "hal/hal_i2c.h"
 #include "sensor/sensor.h"
 #include "sensor/accel.h"
diff --git a/hw/drivers/sensors/ms5837/include/ms5837/ms5837.h b/hw/drivers/sensors/ms5837/include/ms5837/ms5837.h
index 3f1a4006a..d4bcbca02 100644
--- a/hw/drivers/sensors/ms5837/include/ms5837/ms5837.h
+++ b/hw/drivers/sensors/ms5837/include/ms5837/ms5837.h
@@ -21,8 +21,7 @@
 #ifndef __MS5837_H__
 #define __MS5837_H__
 
-#include <os/os.h>
-#include "os/os_dev.h"
+#include "os/mynewt.h"
 #include "sensor/sensor.h"
 
 #define MS5837_I2C_ADDRESS		0x76
diff --git a/hw/drivers/sensors/ms5837/src/ms5837.c b/hw/drivers/sensors/ms5837/src/ms5837.c
index 4e06461d9..2c4799f1a 100644
--- a/hw/drivers/sensors/ms5837/src/ms5837.c
+++ b/hw/drivers/sensors/ms5837/src/ms5837.c
@@ -22,16 +22,13 @@
 #include <errno.h>
 #include <string.h>
 
-#include "defs/error.h"
-#include "os/os.h"
-#include "sysinit/sysinit.h"
+#include "os/mynewt.h"
 #include "hal/hal_i2c.h"
 #include "sensor/sensor.h"
 #include "ms5837/ms5837.h"
 #include "sensor/temperature.h"
 #include "sensor/pressure.h"
 #include "ms5837_priv.h"
-#include "os/os_cputime.h"
 #include "console/console.h"
 #include "log/log.h"
 #include "stats/stats.h"
diff --git a/hw/drivers/sensors/sim/include/sim/sim_accel.h b/hw/drivers/sensors/sim/include/sim/sim_accel.h
index 1fa5a674d..f94557ffc 100644
--- a/hw/drivers/sensors/sim/include/sim/sim_accel.h
+++ b/hw/drivers/sensors/sim/include/sim/sim_accel.h
@@ -20,8 +20,7 @@
 #ifndef __SIM_ACCEL_H__
 #define __SIM_ACCEL_H__
 
-#include "os/os.h"
-#include "os/os_dev.h"
+#include "os/mynewt.h"
 #include "sensor/sensor.h"
 
 #ifdef __cplusplus
diff --git a/hw/drivers/sensors/sim/include/sim/sim_mag.h b/hw/drivers/sensors/sim/include/sim/sim_mag.h
index c28df97d8..3c5f07554 100644
--- a/hw/drivers/sensors/sim/include/sim/sim_mag.h
+++ b/hw/drivers/sensors/sim/include/sim/sim_mag.h
@@ -20,8 +20,7 @@
 #ifndef __SIM_MAG_H__
 #define __SIM_MAG_H__
 
-#include "os/os.h"
-#include "os/os_dev.h"
+#include "os/mynewt.h"
 
 #ifdef __cplusplus
 extern "C" {
diff --git a/hw/drivers/sensors/sim/src/generic_accel.c b/hw/drivers/sensors/sim/src/generic_accel.c
index 73d0081d2..e818a2a73 100644
--- a/hw/drivers/sensors/sim/src/generic_accel.c
+++ b/hw/drivers/sensors/sim/src/generic_accel.c
@@ -21,10 +21,7 @@
 #include <errno.h>
 #include <assert.h>
 
-#include "defs/error.h"
-
-#include "os/os.h"
-#include "sysinit/sysinit.h"
+#include "os/mynewt.h"
 
 #include "sensor/sensor.h"
 #include "sensor/accel.h"
diff --git a/hw/drivers/sensors/sim/src/generic_mag.c b/hw/drivers/sensors/sim/src/generic_mag.c
index 8f5fcbb50..d8568d314 100644
--- a/hw/drivers/sensors/sim/src/generic_mag.c
+++ b/hw/drivers/sensors/sim/src/generic_mag.c
@@ -21,10 +21,7 @@
 #include <errno.h>
 #include <assert.h>
 
-#include "defs/error.h"
-
-#include "os/os.h"
-#include "sysinit/sysinit.h"
+#include "os/mynewt.h"
 
 #include "sensor/sensor.h"
 #include "sensor/mag.h"
diff --git a/hw/drivers/sensors/tcs34725/include/tcs34725/tcs34725.h b/hw/drivers/sensors/tcs34725/include/tcs34725/tcs34725.h
index 05d6d8f4c..7499c3b5f 100644
--- a/hw/drivers/sensors/tcs34725/include/tcs34725/tcs34725.h
+++ b/hw/drivers/sensors/tcs34725/include/tcs34725/tcs34725.h
@@ -32,8 +32,7 @@
 #define TCS34725_GAIN_16X               0x02   /* 16x gain */
 #define TCS34725_GAIN_60X               0x03   /* 60x gain */
 
-#include <os/os.h>
-#include "os/os_dev.h"
+#include "os/mynewt.h"
 #include "sensor/sensor.h"
 
 #ifdef __cplusplus
diff --git a/hw/drivers/sensors/tcs34725/src/tcs34725.c b/hw/drivers/sensors/tcs34725/src/tcs34725.c
index 37b8e379e..b0a2f40a8 100644
--- a/hw/drivers/sensors/tcs34725/src/tcs34725.c
+++ b/hw/drivers/sensors/tcs34725/src/tcs34725.c
@@ -21,9 +21,7 @@
 #include <errno.h>
 #include <assert.h>
 
-#include "defs/error.h"
-#include "os/os.h"
-#include "sysinit/sysinit.h"
+#include "os/mynewt.h"
 #include "hal/hal_i2c.h"
 #include "sensor/sensor.h"
 #include "tcs34725/tcs34725.h"
diff --git a/hw/drivers/sensors/tcs34725/src/tcs34725_shell.c b/hw/drivers/sensors/tcs34725/src/tcs34725_shell.c
index 370773b09..90b614d79 100644
--- a/hw/drivers/sensors/tcs34725/src/tcs34725_shell.c
+++ b/hw/drivers/sensors/tcs34725/src/tcs34725_shell.c
@@ -18,13 +18,12 @@
  */
 
 #include <string.h>
-#include "sysinit/sysinit.h"
+#include "os/mynewt.h"
 #include "console/console.h"
 #include "shell/shell.h"
 #include "hal/hal_gpio.h"
 #include "tcs34725/tcs34725.h"
 #include "tcs34725_priv.h"
-#include "defs/error.h"
 #include "parse/parse.h"
 
 #if MYNEWT_VAL(TCS34725_CLI)
diff --git a/hw/drivers/sensors/tsl2561/include/tsl2561/tsl2561.h b/hw/drivers/sensors/tsl2561/include/tsl2561/tsl2561.h
index b57f5e600..6c13cdaa2 100644
--- a/hw/drivers/sensors/tsl2561/include/tsl2561/tsl2561.h
+++ b/hw/drivers/sensors/tsl2561/include/tsl2561/tsl2561.h
@@ -37,8 +37,7 @@
 #ifndef __ADAFRUIT_TSL2561_H__
 #define __ADAFRUIT_TSL2561_H__
 
-#include <os/os.h>
-#include "os/os_dev.h"
+#include "os/mynewt.h"
 #include "sensor/sensor.h"
 
 #ifdef __cplusplus
diff --git a/hw/drivers/sensors/tsl2561/src/tsl2561.c b/hw/drivers/sensors/tsl2561/src/tsl2561.c
index fc9fc684d..e8b9b4208 100644
--- a/hw/drivers/sensors/tsl2561/src/tsl2561.c
+++ b/hw/drivers/sensors/tsl2561/src/tsl2561.c
@@ -39,9 +39,7 @@
 #include <errno.h>
 #include <string.h>
 
-#include "defs/error.h"
-#include "os/os.h"
-#include "sysinit/sysinit.h"
+#include "os/mynewt.h"
 #include "hal/hal_i2c.h"
 #include "sensor/sensor.h"
 #include "sensor/light.h"
diff --git a/hw/drivers/sensors/tsl2561/src/tsl2561_shell.c b/hw/drivers/sensors/tsl2561/src/tsl2561_shell.c
index 1ea71230f..71201e663 100644
--- a/hw/drivers/sensors/tsl2561/src/tsl2561_shell.c
+++ b/hw/drivers/sensors/tsl2561/src/tsl2561_shell.c
@@ -36,7 +36,7 @@
 
 #include <string.h>
 #include <errno.h>
-#include "sysinit/sysinit.h"
+#include "os/mynewt.h"
 #include "console/console.h"
 #include "shell/shell.h"
 #include "hal/hal_gpio.h"
diff --git a/hw/drivers/uart/include/uart/uart.h b/hw/drivers/uart/include/uart/uart.h
index f0c26e0f8..6bd40a912 100644
--- a/hw/drivers/uart/include/uart/uart.h
+++ b/hw/drivers/uart/include/uart/uart.h
@@ -21,7 +21,7 @@
 #define __DRIVERS_UART_H_
 
 #include <inttypes.h>
-#include <os/os_dev.h>
+#include "os/mynewt.h"
 
 #ifdef __cplusplus
 extern "C" {
diff --git a/hw/drivers/uart/uart_bitbang/src/uart_bitbang.c b/hw/drivers/uart/uart_bitbang/src/uart_bitbang.c
index 0f856bcbf..0963c79ef 100644
--- a/hw/drivers/uart/uart_bitbang/src/uart_bitbang.c
+++ b/hw/drivers/uart/uart_bitbang/src/uart_bitbang.c
@@ -16,18 +16,17 @@
  * specific language governing permissions and limitations
  * under the License.
  */
+
 #include <inttypes.h>
 #include <string.h>
 #include <stdio.h>
 #include <assert.h>
 
+#include "os/mynewt.h"
 #include <hal/hal_gpio.h>
 #include <hal/hal_uart.h>
 #include <hal/hal_timer.h>
 
-#include <os/os.h>
-#include <os/os_dev.h>
-#include <os/os_cputime.h>
 #include <uart/uart.h>
 
 #include "uart_bitbang/uart_bitbang.h"
diff --git a/hw/drivers/uart/uart_hal/src/uart_hal.c b/hw/drivers/uart/uart_hal/src/uart_hal.c
index 2804264aa..609c473d7 100644
--- a/hw/drivers/uart/uart_hal/src/uart_hal.c
+++ b/hw/drivers/uart/uart_hal/src/uart_hal.c
@@ -21,8 +21,7 @@
 #include <assert.h>
 #include <string.h>
 
-#include <os/os.h>
-#include <os/os_dev.h>
+#include "os/mynewt.h"
 #include <hal/hal_uart.h>
 
 #include <uart/uart.h>
diff --git a/hw/hal/include/hal/hal_os_tick.h b/hw/hal/include/hal/hal_os_tick.h
index e981bacb5..c48069ad2 100644
--- a/hw/hal/include/hal/hal_os_tick.h
+++ b/hw/hal/include/hal/hal_os_tick.h
@@ -31,7 +31,7 @@
 extern "C" {
 #endif
 
-#include <os/os_time.h>
+#include "os/mynewt.h"
 
 /**
  * Set up the periodic timer to interrupt at a frequency of 'os_ticks_per_sec'.
diff --git a/hw/hal/include/hal/hal_timer.h b/hw/hal/include/hal/hal_timer.h
index 1d1d9ba57..90ccda581 100644
--- a/hw/hal/include/hal/hal_timer.h
+++ b/hw/hal/include/hal/hal_timer.h
@@ -29,16 +29,12 @@
 #define H_HAL_TIMER_
 
 #include <inttypes.h>
-#include "os/queue.h"
+#include "os/mynewt.h"
 
 #ifdef __cplusplus
 extern "C" {
 #endif
 
-#include <inttypes.h>
-
-#include "os/queue.h"
-
 /* HAL timer callback */
 typedef void (*hal_timer_cb)(void *arg);
 
diff --git a/hw/mcu/ambiq/apollo2/include/mcu/cortex_m4.h b/hw/mcu/ambiq/apollo2/include/mcu/cortex_m4.h
index 92c26ccd4..e07f1e1f2 100644
--- a/hw/mcu/ambiq/apollo2/include/mcu/cortex_m4.h
+++ b/hw/mcu/ambiq/apollo2/include/mcu/cortex_m4.h
@@ -20,7 +20,7 @@
 #ifndef __MCU_CORTEX_M4_H__
 #define __MCU_CORTEX_M4_H__
 
-#include "syscfg/syscfg.h"
+#include "os/mynewt.h"
 
 #include "mcu/apollo2.h"
 
diff --git a/hw/mcu/ambiq/apollo2/include/mcu/hal_apollo2.h b/hw/mcu/ambiq/apollo2/include/mcu/hal_apollo2.h
index 6aa0a5f89..15cc833a1 100644
--- a/hw/mcu/ambiq/apollo2/include/mcu/hal_apollo2.h
+++ b/hw/mcu/ambiq/apollo2/include/mcu/hal_apollo2.h
@@ -20,7 +20,7 @@
 #ifndef __HAL_APOLLO2_H_
 #define __HAL_APOLLO2_H__
 
-#include "syscfg/syscfg.h"
+#include "os/mynewt.h"
 
 #ifdef __cplusplus
 extern "C" {
diff --git a/hw/mcu/ambiq/apollo2/src/hal_flash.c b/hw/mcu/ambiq/apollo2/src/hal_flash.c
index 73c93ac01..bf0582b51 100644
--- a/hw/mcu/ambiq/apollo2/src/hal_flash.c
+++ b/hw/mcu/ambiq/apollo2/src/hal_flash.c
@@ -19,7 +19,7 @@
 
 #include <assert.h>
 #include <string.h>
-#include <os/os.h>
+#include "os/mynewt.h"
 #include <am_hal_flash.h>
 #include <hal/hal_flash_int.h>
 #include <hal/hal_flash.h>
diff --git a/hw/mcu/ambiq/apollo2/src/hal_gpio.c b/hw/mcu/ambiq/apollo2/src/hal_gpio.c
index 874ab8eb1..a4d8d83e6 100644
--- a/hw/mcu/ambiq/apollo2/src/hal_gpio.c
+++ b/hw/mcu/ambiq/apollo2/src/hal_gpio.c
@@ -18,12 +18,10 @@
  */
 
 #include <assert.h>
-#include <os/os.h>
+#include "os/mynewt.h"
 #include "hal/hal_gpio.h"
 #include "mcu/apollo2.h"
 #include "mcu/cmsis_nvic.h"
-#include "os/os_trace_api.h"
-#include "defs/error.h"
 #include "am_mcu_apollo.h"
 #include "am_hal_pin.h"
 #include "am_hal_gpio.h"
diff --git a/hw/mcu/ambiq/apollo2/src/hal_os_tick.c b/hw/mcu/ambiq/apollo2/src/hal_os_tick.c
index 1e988be6c..5f4196244 100644
--- a/hw/mcu/ambiq/apollo2/src/hal_os_tick.c
+++ b/hw/mcu/ambiq/apollo2/src/hal_os_tick.c
@@ -27,7 +27,7 @@
  */
 
 #include <assert.h>
-#include <os/os.h>
+#include "os/mynewt.h"
 #include "mcu/system_apollo2.h"
 #include "hal/hal_os_tick.h"
 #include "mcu/cmsis_nvic.h"
diff --git a/hw/mcu/ambiq/apollo2/src/hal_spi.c b/hw/mcu/ambiq/apollo2/src/hal_spi.c
index cf4edd76c..03ed2fcd7 100644
--- a/hw/mcu/ambiq/apollo2/src/hal_spi.c
+++ b/hw/mcu/ambiq/apollo2/src/hal_spi.c
@@ -20,11 +20,10 @@
 #include <errno.h>
 #include <assert.h>
 #include <stdbool.h>
-#include "syscfg/syscfg.h"
+#include "os/mynewt.h"
 #include "hal/hal_spi.h"
 #include "mcu/hal_apollo2.h"
 #include "mcu/cmsis_nvic.h"
-#include "defs/error.h"
 
 #include "am_mcu_apollo.h"
 
diff --git a/hw/mcu/ambiq/apollo2/src/hal_timer.c b/hw/mcu/ambiq/apollo2/src/hal_timer.c
index c953a50e0..ff82bb0a8 100644
--- a/hw/mcu/ambiq/apollo2/src/hal_timer.c
+++ b/hw/mcu/ambiq/apollo2/src/hal_timer.c
@@ -21,12 +21,10 @@
 #include <inttypes.h>
 #include <assert.h>
 
-#include "syscfg/syscfg.h"
-#include "os/os.h"
+#include "os/mynewt.h"
 #include "mcu/cmsis_nvic.h"
 #include "mcu/hal_apollo2.h"
 #include "hal/hal_timer.h"
-#include "defs/error.h"
 
 #include "am_mcu_apollo.h"
 
diff --git a/hw/mcu/ambiq/apollo2/src/hal_uart.c b/hw/mcu/ambiq/apollo2/src/hal_uart.c
index 84299adfb..8cd3392bf 100644
--- a/hw/mcu/ambiq/apollo2/src/hal_uart.c
+++ b/hw/mcu/ambiq/apollo2/src/hal_uart.c
@@ -19,12 +19,11 @@
 
 #include <assert.h>
 #include <inttypes.h>
+#include "os/mynewt.h"
 #include "mcu/hal_apollo2.h"
-#include "defs/error.h"
 #include "hal/hal_uart.h"
 #include "mcu/cmsis_nvic.h"
 #include "bsp/bsp.h"
-#include "os/os_trace_api.h"
 
 #include "am_mcu_apollo.h"
 
diff --git a/hw/mcu/arc/snps/include/mcu/mcu_arc.h b/hw/mcu/arc/snps/include/mcu/mcu_arc.h
index 97e8a5562..4bcd558d8 100644
--- a/hw/mcu/arc/snps/include/mcu/mcu_arc.h
+++ b/hw/mcu/arc/snps/include/mcu/mcu_arc.h
@@ -20,7 +20,7 @@
 #ifndef __MCU_ARC_H__
 #define __MCU_ARC_H__
 
-#include "syscfg/syscfg.h"
+#include "os/mynewt.h"
 
 #ifdef __cplusplus
 extern "C" {
diff --git a/hw/mcu/arc/snps/src/hal_os_tick.c b/hw/mcu/arc/snps/src/hal_os_tick.c
index c24ec50bd..f3e6be38b 100644
--- a/hw/mcu/arc/snps/src/hal_os_tick.c
+++ b/hw/mcu/arc/snps/src/hal_os_tick.c
@@ -17,9 +17,8 @@
  * under the License.
  */
 #include <assert.h>
-#include <os/os.h>
+#include "os/mynewt.h"
 #include "hal/hal_os_tick.h"
-#include "os/os_trace_api.h"
 #include "inc/arc/arc.h"
 #include "inc/arc/arc_exception.h"
 #include "inc/arc/arc_timer.h"
diff --git a/hw/mcu/microchip/pic32mx470f512h/src/hal_gpio.c b/hw/mcu/microchip/pic32mx470f512h/src/hal_gpio.c
index 0898d79d0..ec24eb3bc 100644
--- a/hw/mcu/microchip/pic32mx470f512h/src/hal_gpio.c
+++ b/hw/mcu/microchip/pic32mx470f512h/src/hal_gpio.c
@@ -17,7 +17,7 @@
  * under the License.
  */
 
-#include <os/os.h>
+#include "os/mynewt.h"
 #include <hal/hal_gpio.h>
 #include <mcu/mips_hal.h>
 #include <mcu/p32mx470f512h.h>
diff --git a/hw/mcu/microchip/pic32mx470f512h/src/hal_i2c.c b/hw/mcu/microchip/pic32mx470f512h/src/hal_i2c.c
index 12adf68a8..246992138 100644
--- a/hw/mcu/microchip/pic32mx470f512h/src/hal_i2c.c
+++ b/hw/mcu/microchip/pic32mx470f512h/src/hal_i2c.c
@@ -18,13 +18,12 @@
  */
 
 #include <xc.h>
-#include "syscfg/syscfg.h"
+#include "os/mynewt.h"
 #include "bsp/bsp.h"
 #include <hal/hal_gpio.h>
 #include <hal/hal_i2c.h>
 #include <mcu/p32mx470f512h.h>
 #include "mcu/mips_hal.h"
-#include <os/os_time.h>
 
 #define I2CxCON(I)              (base_address[I][0x00 / 0x04])
 #define I2CxCONCLR(I)           (base_address[I][0x04 / 0x04])
@@ -273,4 +272,4 @@ hal_i2c_master_probe(uint8_t i2c_num, uint8_t address,
     data.len = 0;
 
     return hal_i2c_master_read(i2c_num, &data, timeout, 1);
-}
\ No newline at end of file
+}
diff --git a/hw/mcu/microchip/pic32mx470f512h/src/hal_os_tick.c b/hw/mcu/microchip/pic32mx470f512h/src/hal_os_tick.c
index 8fc68d645..c4fd9d361 100644
--- a/hw/mcu/microchip/pic32mx470f512h/src/hal_os_tick.c
+++ b/hw/mcu/microchip/pic32mx470f512h/src/hal_os_tick.c
@@ -18,7 +18,7 @@
  */
 
 #include <assert.h>
-#include <os/os.h>
+#include "os/mynewt.h"
 #include <hal/hal_os_tick.h>
 
 /*
diff --git a/hw/mcu/microchip/pic32mx470f512h/src/hal_spi.c b/hw/mcu/microchip/pic32mx470f512h/src/hal_spi.c
index 2de982032..ebfa259ad 100644
--- a/hw/mcu/microchip/pic32mx470f512h/src/hal_spi.c
+++ b/hw/mcu/microchip/pic32mx470f512h/src/hal_spi.c
@@ -19,6 +19,7 @@
 
 #include <stdbool.h>
 #include <stddef.h>
+#include "os/mynewt.h"
 #include "bsp/bsp.h"
 #include "hal/hal_gpio.h"
 #include "hal/hal_spi.h"
@@ -26,7 +27,6 @@
 #include "mcu/mips_hal.h"
 #include "mcu/p32mx470f512h.h"
 #include "mcu/pps.h"
-#include "syscfg/syscfg.h"
 
 #define SPIxCON(P)          (base_address[P][0x0 / 0x4])
 #define SPIxCONCLR(P)       (base_address[P][0x4 / 0x4])
diff --git a/hw/mcu/microchip/pic32mx470f512h/src/hal_timer.c b/hw/mcu/microchip/pic32mx470f512h/src/hal_timer.c
index 274971f0b..3b3f4e9eb 100644
--- a/hw/mcu/microchip/pic32mx470f512h/src/hal_timer.c
+++ b/hw/mcu/microchip/pic32mx470f512h/src/hal_timer.c
@@ -17,9 +17,9 @@
  * under the License.
  */
 
-#include <os/os.h>
 #include <stdint.h>
 #include <string.h>
+#include "os/mynewt.h"
 #include <xc.h>
 #include "hal/hal_timer.h"
 #include "mcu/mips_hal.h"
@@ -461,4 +461,4 @@ hal_timer_stop(struct hal_timer *timer)
     __HAL_ENABLE_INTERRUPTS(ctx);
 
     return 0;
-}
\ No newline at end of file
+}
diff --git a/hw/mcu/microchip/pic32mx470f512h/src/hal_uart.c b/hw/mcu/microchip/pic32mx470f512h/src/hal_uart.c
index a97eb8d8f..c6da9000c 100644
--- a/hw/mcu/microchip/pic32mx470f512h/src/hal_uart.c
+++ b/hw/mcu/microchip/pic32mx470f512h/src/hal_uart.c
@@ -17,13 +17,13 @@
  * under the License.
  */
 
+#include <assert.h>
+#include <stdlib.h>
+#include "os/mynewt.h"
 #include "hal/hal_uart.h"
 #include "bsp/bsp.h"
-#include "syscfg/syscfg.h"
 #include "mcu/mips_hal.h"
 #include "mcu/pps.h"
-#include <assert.h>
-#include <stdlib.h>
 
 #include <xc.h>
 
diff --git a/hw/mcu/microchip/pic32mz2048efg100/src/hal_gpio.c b/hw/mcu/microchip/pic32mz2048efg100/src/hal_gpio.c
index 6e82f6e1c..6dc15f7f2 100644
--- a/hw/mcu/microchip/pic32mz2048efg100/src/hal_gpio.c
+++ b/hw/mcu/microchip/pic32mz2048efg100/src/hal_gpio.c
@@ -17,7 +17,7 @@
  * under the License.
  */
 
-#include <os/os.h>
+#include "os/mynewt.h"
 #include <hal/hal_gpio.h>
 #include <mcu/mips_hal.h>
 #include <mcu/p32mz2048efg100.h>
@@ -481,4 +481,4 @@ hal_gpio_irq_disable(int pin)
 
     CNENxCLR(port) = mask;
     CNNExCLR(port) = mask;
-}
\ No newline at end of file
+}
diff --git a/hw/mcu/microchip/pic32mz2048efg100/src/hal_i2c.c b/hw/mcu/microchip/pic32mz2048efg100/src/hal_i2c.c
index e00b676ef..0853b060a 100644
--- a/hw/mcu/microchip/pic32mz2048efg100/src/hal_i2c.c
+++ b/hw/mcu/microchip/pic32mz2048efg100/src/hal_i2c.c
@@ -18,13 +18,12 @@
  */
 
 #include <xc.h>
-#include "syscfg/syscfg.h"
+#include "os/mynewt.h"
 #include "bsp/bsp.h"
 #include <hal/hal_gpio.h>
 #include <hal/hal_i2c.h>
 #include <mcu/p32mz2048efg100.h>
 #include "mcu/mips_hal.h"
-#include <os/os_time.h>
 
 #define I2CxCON(I)              (base_address[I][0x00 / 0x04])
 #define I2CxCONCLR(I)           (base_address[I][0x04 / 0x04])
@@ -274,4 +273,4 @@ hal_i2c_master_probe(uint8_t i2c_num, uint8_t address,
     data.len = 0;
 
     return hal_i2c_master_read(i2c_num, &data, timeout, 1);
-}
\ No newline at end of file
+}
diff --git a/hw/mcu/microchip/pic32mz2048efg100/src/hal_os_tick.c b/hw/mcu/microchip/pic32mz2048efg100/src/hal_os_tick.c
index 8fc68d645..c4fd9d361 100644
--- a/hw/mcu/microchip/pic32mz2048efg100/src/hal_os_tick.c
+++ b/hw/mcu/microchip/pic32mz2048efg100/src/hal_os_tick.c
@@ -18,7 +18,7 @@
  */
 
 #include <assert.h>
-#include <os/os.h>
+#include "os/mynewt.h"
 #include <hal/hal_os_tick.h>
 
 /*
diff --git a/hw/mcu/microchip/pic32mz2048efg100/src/hal_spi.c b/hw/mcu/microchip/pic32mz2048efg100/src/hal_spi.c
index ad2c0c141..c1c418f76 100644
--- a/hw/mcu/microchip/pic32mz2048efg100/src/hal_spi.c
+++ b/hw/mcu/microchip/pic32mz2048efg100/src/hal_spi.c
@@ -19,6 +19,7 @@
 
 #include <stdbool.h>
 #include <stddef.h>
+#include "os/mynewt.h"
 #include "bsp/bsp.h"
 #include "hal/hal_gpio.h"
 #include "hal/hal_spi.h"
@@ -26,7 +27,6 @@
 #include "mcu/mips_hal.h"
 #include "mcu/p32mz2048efg100.h"
 #include "mcu/pps.h"
-#include "syscfg/syscfg.h"
 
 #define SPIxCON(P)          (base_address[P][0x0 / 0x4])
 #define SPIxCONCLR(P)       (base_address[P][0x4 / 0x4])
@@ -621,4 +621,4 @@ hal_spi_abort(int spi_num)
     SPIxCONSET(spi_num) = _SPI1CON_ON_MASK;
 
     return 0;
-}
\ No newline at end of file
+}
diff --git a/hw/mcu/microchip/pic32mz2048efg100/src/hal_timer.c b/hw/mcu/microchip/pic32mz2048efg100/src/hal_timer.c
index cfb862f46..a907b3c9a 100644
--- a/hw/mcu/microchip/pic32mz2048efg100/src/hal_timer.c
+++ b/hw/mcu/microchip/pic32mz2048efg100/src/hal_timer.c
@@ -17,9 +17,9 @@
  * under the License.
  */
 
-#include <os/os.h>
 #include <stdint.h>
 #include <string.h>
+#include "os/mynewt.h"
 #include <xc.h>
 #include "hal/hal_timer.h"
 #include "mcu/mips_hal.h"
@@ -543,4 +543,4 @@ hal_timer_stop(struct hal_timer *timer)
     __HAL_ENABLE_INTERRUPTS(ctx);
 
     return 0;
-}
\ No newline at end of file
+}
diff --git a/hw/mcu/microchip/pic32mz2048efg100/src/hal_uart.c b/hw/mcu/microchip/pic32mz2048efg100/src/hal_uart.c
index 8e7d9b827..a85fb2809 100644
--- a/hw/mcu/microchip/pic32mz2048efg100/src/hal_uart.c
+++ b/hw/mcu/microchip/pic32mz2048efg100/src/hal_uart.c
@@ -17,13 +17,13 @@
  * under the License.
  */
 
+#include <assert.h>
+#include <stdlib.h>
+#include "os/mynewt.h"
 #include "hal/hal_uart.h"
 #include "bsp/bsp.h"
-#include "syscfg/syscfg.h"
 #include "mcu/mips_hal.h"
 #include "mcu/pps.h"
-#include <assert.h>
-#include <stdlib.h>
 
 #include <xc.h>
 
diff --git a/hw/mcu/mips/danube/src/hal_os_tick.c b/hw/mcu/mips/danube/src/hal_os_tick.c
index 5f67dc82e..15a597e3b 100644
--- a/hw/mcu/mips/danube/src/hal_os_tick.c
+++ b/hw/mcu/mips/danube/src/hal_os_tick.c
@@ -18,7 +18,7 @@
  */
 
 #include <assert.h>
-#include <os/os.h>
+#include "os/mynewt.h"
 #include <hal/hal_os_tick.h>
 #include "mcu/gic.h"
 
diff --git a/hw/mcu/native/src/hal_flash.c b/hw/mcu/native/src/hal_flash.c
index 94c1c007f..41f8e0277 100644
--- a/hw/mcu/native/src/hal_flash.c
+++ b/hw/mcu/native/src/hal_flash.c
@@ -24,7 +24,7 @@
 #include <inttypes.h>
 #include <stdlib.h>
 
-#include <syscfg/syscfg.h>
+#include "os/mynewt.h"
 
 #include "hal/hal_flash_int.h"
 #include "mcu/mcu_sim.h"
diff --git a/hw/mcu/native/src/hal_system.c b/hw/mcu/native/src/hal_system.c
index 61c711360..9e9224845 100644
--- a/hw/mcu/native/src/hal_system.c
+++ b/hw/mcu/native/src/hal_system.c
@@ -23,15 +23,11 @@
 #include <assert.h>
 #include <getopt.h>
 
-#include "syscfg/syscfg.h"
+#include "os/mynewt.h"
 #include "hal/hal_system.h"
 #include "mcu/mcu_sim.h"
 #include "hal_native_priv.h"
 
-#if MYNEWT_VAL(OS_SCHEDULING)
-#include <os/os.h>
-#endif
-
 void
 hal_system_reset(void)
 {
diff --git a/hw/mcu/native/src/hal_timer.c b/hw/mcu/native/src/hal_timer.c
index 289817ef7..74c4c7712 100644
--- a/hw/mcu/native/src/hal_timer.c
+++ b/hw/mcu/native/src/hal_timer.c
@@ -18,7 +18,7 @@
  */
 #include <stdint.h>
 #include <assert.h>
-#include <os/os.h>
+#include "os/mynewt.h"
 
 #include "hal/hal_timer.h"
 
diff --git a/hw/mcu/native/src/hal_uart.c b/hw/mcu/native/src/hal_uart.c
index 13664db00..e95e7ed37 100644
--- a/hw/mcu/native/src/hal_uart.c
+++ b/hw/mcu/native/src/hal_uart.c
@@ -17,10 +17,7 @@
  * under the License.
  */
 
-#include <syscfg/syscfg.h>
-
-#include "defs/error.h"
-#include "os/os.h"
+#include "os/mynewt.h"
 #include "hal/hal_uart.h"
 #include "bsp/bsp.h"
 
diff --git a/hw/mcu/native/src/native_uart_cfg.c b/hw/mcu/native/src/native_uart_cfg.c
index 75c1c2287..dab746be4 100644
--- a/hw/mcu/native/src/native_uart_cfg.c
+++ b/hw/mcu/native/src/native_uart_cfg.c
@@ -24,7 +24,7 @@
 #include <inttypes.h>
 #include <termios.h>
 
-#include "defs/error.h"
+#include "os/mynewt.h"
 #include "native_uart_cfg_priv.h"
 
 /* uint64 is used here to accommodate speed_t, whatever that is. */
diff --git a/hw/mcu/nordic/include/nrfx_glue.h b/hw/mcu/nordic/include/nrfx_glue.h
index ef8dd8410..5a1f57be5 100644
--- a/hw/mcu/nordic/include/nrfx_glue.h
+++ b/hw/mcu/nordic/include/nrfx_glue.h
@@ -33,7 +33,7 @@
 #define NRFX_GLUE_H__
 
 #include <assert.h>
-#include <os/os.h>
+#include "os/mynewt.h"
 
 #ifdef __cplusplus
 extern "C" {
diff --git a/hw/mcu/nordic/nrf51xxx/src/hal_i2c.c b/hw/mcu/nordic/nrf51xxx/src/hal_i2c.c
index 29dddacc6..8f2ae150b 100644
--- a/hw/mcu/nordic/nrf51xxx/src/hal_i2c.c
+++ b/hw/mcu/nordic/nrf51xxx/src/hal_i2c.c
@@ -22,9 +22,7 @@
 #include <limits.h>
 #include <assert.h>
 
-#include <os/os_time.h>
-
-#include "syscfg/syscfg.h"
+#include "os/mynewt.h"
 #include <hal/hal_i2c.h>
 #include <hal/hal_gpio.h>
 #include <mcu/nrf51_hal.h>
diff --git a/hw/mcu/nordic/nrf51xxx/src/hal_os_tick.c b/hw/mcu/nordic/nrf51xxx/src/hal_os_tick.c
index 1e0752169..beb513546 100644
--- a/hw/mcu/nordic/nrf51xxx/src/hal_os_tick.c
+++ b/hw/mcu/nordic/nrf51xxx/src/hal_os_tick.c
@@ -17,8 +17,7 @@
  * under the License.
  */
 #include <assert.h>
-#include <os/os.h>
-#include "syscfg/syscfg.h"
+#include "os/mynewt.h"
 #include <hal/hal_os_tick.h>
 #include <hal/hal_system.h>
 #include <mcu/cmsis_nvic.h>
diff --git a/hw/mcu/nordic/nrf51xxx/src/hal_spi.c b/hw/mcu/nordic/nrf51xxx/src/hal_spi.c
index 45d675161..c93e5b873 100644
--- a/hw/mcu/nordic/nrf51xxx/src/hal_spi.c
+++ b/hw/mcu/nordic/nrf51xxx/src/hal_spi.c
@@ -17,11 +17,11 @@
  * under the License.
  */
 
-#include <hal/hal_spi.h>
-#include <syscfg/syscfg.h>
 #include <string.h>
 #include <errno.h>
 #include <assert.h>
+#include "os/mynewt.h"
+#include <hal/hal_spi.h>
 #include <hal/hal_spi.h>
 #include <mcu/cmsis_nvic.h>
 #include "mcu/nrf51_hal.h"
diff --git a/hw/mcu/nordic/nrf51xxx/src/hal_system.c b/hw/mcu/nordic/nrf51xxx/src/hal_system.c
index 9fa962319..83dd27320 100644
--- a/hw/mcu/nordic/nrf51xxx/src/hal_system.c
+++ b/hw/mcu/nordic/nrf51xxx/src/hal_system.c
@@ -17,8 +17,8 @@
  * under the License.
  */
 
+#include "os/mynewt.h"
 #include <mcu/cortex_m0.h>
-#include "syscfg/syscfg.h"
 #include "hal/hal_system.h"
 #include <nrf51.h>
 #include <nrf51_bitfields.h>
diff --git a/hw/mcu/nordic/nrf51xxx/src/hal_timer.c b/hw/mcu/nordic/nrf51xxx/src/hal_timer.c
index d6b7b33a0..2a5753e51 100644
--- a/hw/mcu/nordic/nrf51xxx/src/hal_timer.c
+++ b/hw/mcu/nordic/nrf51xxx/src/hal_timer.c
@@ -21,7 +21,7 @@
 #include <stdint.h>
 #include <assert.h>
 #include <errno.h>
-#include "syscfg/syscfg.h"
+#include "os/mynewt.h"
 #include "mcu/cmsis_nvic.h"
 #include "hal/hal_timer.h"
 #include "nrf51.h"
diff --git a/hw/mcu/nordic/nrf52xxx/include/mcu/cortex_m4.h b/hw/mcu/nordic/nrf52xxx/include/mcu/cortex_m4.h
index 31fae59b1..1dc47e429 100644
--- a/hw/mcu/nordic/nrf52xxx/include/mcu/cortex_m4.h
+++ b/hw/mcu/nordic/nrf52xxx/include/mcu/cortex_m4.h
@@ -20,7 +20,7 @@
 #ifndef __MCU_CORTEX_M4_H__
 #define __MCU_CORTEX_M4_H__
 
-#include "syscfg/syscfg.h"
+#include "os/mynewt.h"
 
 #ifdef NRF52840_XXAA
 #include "nrf52840.h"
diff --git a/hw/mcu/nordic/nrf52xxx/src/hal_gpio.c b/hw/mcu/nordic/nrf52xxx/src/hal_gpio.c
index 85416e268..6cf3bbe9f 100644
--- a/hw/mcu/nordic/nrf52xxx/src/hal_gpio.c
+++ b/hw/mcu/nordic/nrf52xxx/src/hal_gpio.c
@@ -17,12 +17,12 @@
  * under the License.
  */
 
+#include <stdlib.h>
+#include <assert.h>
+#include "os/mynewt.h"
 #include "hal/hal_gpio.h"
 #include "mcu/cmsis_nvic.h"
-#include "os/os_trace_api.h"
-#include <stdlib.h>
 #include "nrf.h"
-#include <assert.h>
 #include "mcu/nrf52_hal.h"
 
 /* XXX:
diff --git a/hw/mcu/nordic/nrf52xxx/src/hal_i2c.c b/hw/mcu/nordic/nrf52xxx/src/hal_i2c.c
index bc98afff6..6c56390bb 100644
--- a/hw/mcu/nordic/nrf52xxx/src/hal_i2c.c
+++ b/hw/mcu/nordic/nrf52xxx/src/hal_i2c.c
@@ -21,8 +21,7 @@
 #include <errno.h>
 #include <limits.h>
 #include <assert.h>
-#include <os/os_time.h>
-#include "syscfg/syscfg.h"
+#include "os/mynewt.h"
 #include <hal/hal_i2c.h>
 #include <hal/hal_gpio.h>
 #include <mcu/nrf52_hal.h>
diff --git a/hw/mcu/nordic/nrf52xxx/src/hal_os_tick.c b/hw/mcu/nordic/nrf52xxx/src/hal_os_tick.c
index 1be21e815..dd861722b 100644
--- a/hw/mcu/nordic/nrf52xxx/src/hal_os_tick.c
+++ b/hw/mcu/nordic/nrf52xxx/src/hal_os_tick.c
@@ -16,10 +16,9 @@
  * specific language governing permissions and limitations
  * under the License.
  */
+
 #include <assert.h>
-#include <os/os.h>
-#include <os/os_trace_api.h>
-#include "syscfg/syscfg.h"
+#include "os/mynewt.h"
 #include "hal/hal_os_tick.h"
 #include "nrf.h"
 #include "mcu/cmsis_nvic.h"
diff --git a/hw/mcu/nordic/nrf52xxx/src/hal_spi.c b/hw/mcu/nordic/nrf52xxx/src/hal_spi.c
index a72c5907a..6dd34cbc9 100644
--- a/hw/mcu/nordic/nrf52xxx/src/hal_spi.c
+++ b/hw/mcu/nordic/nrf52xxx/src/hal_spi.c
@@ -16,13 +16,13 @@
  * specific language governing permissions and limitations
  * under the License.
  */
+
 #include <string.h>
 #include <errno.h>
 #include <assert.h>
-#include <syscfg/syscfg.h>
+#include "os/mynewt.h"
 #include <mcu/cmsis_nvic.h>
 #include <hal/hal_spi.h>
-#include "os/os_trace_api.h"
 #include "mcu/nrf52_hal.h"
 #include "nrf.h"
 
diff --git a/hw/mcu/nordic/nrf52xxx/src/hal_timer.c b/hw/mcu/nordic/nrf52xxx/src/hal_timer.c
index 0fb926d23..7ac4d62a1 100644
--- a/hw/mcu/nordic/nrf52xxx/src/hal_timer.c
+++ b/hw/mcu/nordic/nrf52xxx/src/hal_timer.c
@@ -21,10 +21,9 @@
 #include <stdint.h>
 #include <assert.h>
 #include <errno.h>
-#include "syscfg/syscfg.h"
+#include "os/mynewt.h"
 #include "mcu/cmsis_nvic.h"
 #include "hal/hal_timer.h"
-#include "os/os_trace_api.h"
 #include "nrf.h"
 #include "mcu/nrf52_hal.h"
 
diff --git a/hw/mcu/nordic/nrf52xxx/src/hal_uart.c b/hw/mcu/nordic/nrf52xxx/src/hal_uart.c
index 688c17163..10f11b939 100644
--- a/hw/mcu/nordic/nrf52xxx/src/hal_uart.c
+++ b/hw/mcu/nordic/nrf52xxx/src/hal_uart.c
@@ -17,15 +17,16 @@
  * under the License.
  */
 
+#include <assert.h>
+
+#include "os/mynewt.h"
 #include "hal/hal_uart.h"
 #include "mcu/cmsis_nvic.h"
 #include "bsp/bsp.h"
 
 #include "nrf.h"
 #include "mcu/nrf52_hal.h"
-#include "os/os_trace_api.h"
 
-#include <assert.h>
 
 #define UARTE_INT_ENDTX		UARTE_INTEN_ENDTX_Msk
 #define UARTE_INT_ENDRX		UARTE_INTEN_ENDRX_Msk
diff --git a/hw/mcu/nordic/nrf52xxx/src/hal_watchdog.c b/hw/mcu/nordic/nrf52xxx/src/hal_watchdog.c
index 7dc373a8e..0a5cbf2a3 100644
--- a/hw/mcu/nordic/nrf52xxx/src/hal_watchdog.c
+++ b/hw/mcu/nordic/nrf52xxx/src/hal_watchdog.c
@@ -18,12 +18,11 @@
  */
 
 #include <assert.h>
+#include "os/mynewt.h"
 #include "hal/hal_watchdog.h"
 #include "mcu/cmsis_nvic.h"
-#include "os/os_trace_api.h"
 #include "nrf.h"
 
-
 static void
 nrf52_hal_wdt_default_handler(void)
 {
diff --git a/hw/mcu/nxp/MK64F12/src/hal_flash.c b/hw/mcu/nxp/MK64F12/src/hal_flash.c
index 9b3f9a058..083dc29ef 100644
--- a/hw/mcu/nxp/MK64F12/src/hal_flash.c
+++ b/hw/mcu/nxp/MK64F12/src/hal_flash.c
@@ -23,11 +23,12 @@
  * and is divided to 2k sectors throughout.
  * Programming is done 2 bytes at a time.
  */
+
 #include <string.h>
 #include <stdio.h>
 #include <assert.h>
+#include "os/mynewt.h"
 #include <hal/hal_flash_int.h>
-#include <os/os.h>
 
 #include "MK64F12.h"
 #include "fsl_flash.h"
diff --git a/hw/mcu/nxp/MK64F12/src/hal_os_tick.c b/hw/mcu/nxp/MK64F12/src/hal_os_tick.c
index 93b1ee6a3..0ee4f015c 100644
--- a/hw/mcu/nxp/MK64F12/src/hal_os_tick.c
+++ b/hw/mcu/nxp/MK64F12/src/hal_os_tick.c
@@ -19,7 +19,7 @@
 
 #include <assert.h>
 #include <stdio.h>
-#include <os/os.h>
+#include "os/mynewt.h"
 #include <hal/hal_os_tick.h>
 
 #include "mcu/cmsis_nvic.h"
diff --git a/hw/mcu/nxp/MK64F12/src/hal_uart.c b/hw/mcu/nxp/MK64F12/src/hal_uart.c
index a64a26cc7..f1fda1972 100644
--- a/hw/mcu/nxp/MK64F12/src/hal_uart.c
+++ b/hw/mcu/nxp/MK64F12/src/hal_uart.c
@@ -17,16 +17,15 @@
  * under the License.
  */
 
-#include "syscfg/syscfg.h"
+#include <assert.h>
+#include <stdlib.h>
+
+#include "os/mynewt.h"
 #include "hal/hal_uart.h"
 #include "hal/hal_gpio.h"
 #include "hal/hal_system.h"
 #include "mcu/cmsis_nvic.h"
 #include "bsp/bsp.h"
-#include "os/os.h"
-
-#include <assert.h>
-#include <stdlib.h>
 
 #include "mcu/frdm-k64f_hal.h"
 #include "MK64F12.h"
diff --git a/hw/mcu/nxp/mkw41z/src/hal_os_tick.c b/hw/mcu/nxp/mkw41z/src/hal_os_tick.c
index ff368bdb8..5788511b3 100644
--- a/hw/mcu/nxp/mkw41z/src/hal_os_tick.c
+++ b/hw/mcu/nxp/mkw41z/src/hal_os_tick.c
@@ -17,8 +17,7 @@
  * under the License.
  */
 #include <assert.h>
-#include <os/os.h>
-#include "syscfg/syscfg.h"
+#include "os/mynewt.h"
 #include <hal/hal_os_tick.h>
 #include <mcu/cmsis_nvic.h>
 //#include <mkw41z4.h>
diff --git a/hw/mcu/sifive/fe310/include/mcu/fe310.h b/hw/mcu/sifive/fe310/include/mcu/fe310.h
index cd71a6c65..3cf825b93 100644
--- a/hw/mcu/sifive/fe310/include/mcu/fe310.h
+++ b/hw/mcu/sifive/fe310/include/mcu/fe310.h
@@ -20,7 +20,7 @@
 #ifndef __MCU_FE310_H__
 #define __MCU_FE310_H__
 
-#include "syscfg/syscfg.h"
+#include "os/mynewt.h"
 
 #ifdef __cplusplus
 extern "C" {
diff --git a/hw/mcu/sifive/fe310/src/hal_os_tick.c b/hw/mcu/sifive/fe310/src/hal_os_tick.c
index fef6b6461..b04e5281c 100644
--- a/hw/mcu/sifive/fe310/src/hal_os_tick.c
+++ b/hw/mcu/sifive/fe310/src/hal_os_tick.c
@@ -17,8 +17,7 @@
  * under the License.
  */
 #include <assert.h>
-#include <os/os.h>
-#include "syscfg/syscfg.h"
+#include "os/mynewt.h"
 #include "hal/hal_os_tick.h"
 #include <env/encoding.h>
 #include <env/freedom-e300-hifive1/platform.h>
@@ -57,4 +56,4 @@ timer_interrupt_handler(void)
     set_mtimecmp(time + ticks_per_ostick);
 
     os_time_advance(ticks);
-}
\ No newline at end of file
+}
diff --git a/hw/mcu/sifive/fe310/src/hal_timer.c b/hw/mcu/sifive/fe310/src/hal_timer.c
index c1e5d46f4..3b59f2082 100644
--- a/hw/mcu/sifive/fe310/src/hal_timer.c
+++ b/hw/mcu/sifive/fe310/src/hal_timer.c
@@ -20,7 +20,7 @@
 #include <stdint.h>
 #include <errno.h>
 #include <stdbool.h>
-#include <syscfg/syscfg.h>
+#include "os/mynewt.h"
 #include <hal/hal_timer.h>
 #include <mcu/plic.h>
 #include <mcu/fe310_hal.h>
diff --git a/hw/mcu/sifive/fe310/src/init.c b/hw/mcu/sifive/fe310/src/init.c
index 2eee5de59..877d98db5 100644
--- a/hw/mcu/sifive/fe310/src/init.c
+++ b/hw/mcu/sifive/fe310/src/init.c
@@ -19,7 +19,7 @@
 
 #include <stdint.h>
 
-#include <syscfg/syscfg.h>
+#include "os/mynewt.h"
 
 #include <env/freedom-e300-hifive1/platform.h>
 #include <env/encoding.h>
diff --git a/hw/mcu/sifive/fe310/src/plic.c b/hw/mcu/sifive/fe310/src/plic.c
index 749ffc5b3..551fe6584 100644
--- a/hw/mcu/sifive/fe310/src/plic.c
+++ b/hw/mcu/sifive/fe310/src/plic.c
@@ -17,9 +17,9 @@
  * under the License.
  */
 
+#include "os/mynewt.h"
 #include <env/freedom-e300-hifive1/platform.h>
 #include <mcu/plic.h>
-#include <syscfg/syscfg.h>
 
 interrupt_handler_t plic_interrupts[PLIC_NUM_INTERRUPTS];
 
diff --git a/hw/mcu/sifive/fe310/src/sys_clock.c b/hw/mcu/sifive/fe310/src/sys_clock.c
index c6fc4db0a..2f408b346 100644
--- a/hw/mcu/sifive/fe310/src/sys_clock.c
+++ b/hw/mcu/sifive/fe310/src/sys_clock.c
@@ -18,11 +18,11 @@
  */
 
 #include <stdlib.h>
+#include "os/mynewt.h"
 #include <env/freedom-e300-hifive1/platform.h>
 #include <env/encoding.h>
 #include <mcu/plic.h>
 #include <mcu/sys_clock.h>
-#include <syscfg/syscfg.h>
 
 #define PLL_DIVR(r) ((r) - 1)
 #define PLL_MULF(f) ((f) / 2 - 1)
diff --git a/hw/mcu/stm/stm32_common/src/hal_os_tick.c b/hw/mcu/stm/stm32_common/src/hal_os_tick.c
index 46b935a74..d46d8e194 100644
--- a/hw/mcu/stm/stm32_common/src/hal_os_tick.c
+++ b/hw/mcu/stm/stm32_common/src/hal_os_tick.c
@@ -18,7 +18,7 @@
  */
 
 #include <assert.h>
-#include <os/os.h>
+#include "os/mynewt.h"
 #include <hal/hal_os_tick.h>
 
 /*
diff --git a/hw/mcu/stm/stm32_common/src/hal_spi.c b/hw/mcu/stm/stm32_common/src/hal_spi.c
index b04334da8..60a0acc1d 100644
--- a/hw/mcu/stm/stm32_common/src/hal_spi.c
+++ b/hw/mcu/stm/stm32_common/src/hal_spi.c
@@ -17,17 +17,12 @@
  * under the License.
  */
 
-#include <hal/hal_spi.h>
-#include <hal/hal_gpio.h>
-
 #include <string.h>
-
 #include <assert.h>
-
-#include <syscfg/syscfg.h>
-
+#include "os/mynewt.h"
+#include <hal/hal_spi.h>
+#include <hal/hal_gpio.h>
 #include "mcu/stm32_hal.h"
-
 #include "mcu/cmsis_nvic.h"
 
 #define SPI_0_ENABLED (MYNEWT_VAL(SPI_0_MASTER) || MYNEWT_VAL(SPI_0_SLAVE))
diff --git a/hw/mcu/stm/stm32_common/src/hal_system.c b/hw/mcu/stm/stm32_common/src/hal_system.c
index 57522dc2d..d5815d3f6 100644
--- a/hw/mcu/stm/stm32_common/src/hal_system.c
+++ b/hw/mcu/stm/stm32_common/src/hal_system.c
@@ -18,7 +18,7 @@
  */
 
 #include "mcu/stm32_hal.h"
-#include <os/os.h>
+#include "os/mynewt.h"
 #include "hal/hal_system.h"
 
 void
diff --git a/hw/mcu/stm/stm32_common/src/stm32_driver_mod_spi.c b/hw/mcu/stm/stm32_common/src/stm32_driver_mod_spi.c
index 0acb95e3d..dfb7d7d7c 100644
--- a/hw/mcu/stm/stm32_common/src/stm32_driver_mod_spi.c
+++ b/hw/mcu/stm/stm32_common/src/stm32_driver_mod_spi.c
@@ -24,8 +24,8 @@
   * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
   */
 
+#include "os/mynewt.h"
 #include "mcu/stm32_hal.h"
-#include <syscfg/syscfg.h>
 
 #define SPI_DEFAULT_TIMEOUT 100U
 
diff --git a/hw/mcu/stm/stm32f1xx/src/hal_i2c.c b/hw/mcu/stm/stm32f1xx/src/hal_i2c.c
index c46c03aa5..59dfc14de 100644
--- a/hw/mcu/stm/stm32f1xx/src/hal_i2c.c
+++ b/hw/mcu/stm/stm32f1xx/src/hal_i2c.c
@@ -21,7 +21,7 @@
 #include <stdlib.h>
 #include <assert.h>
 
-#include <syscfg/syscfg.h>
+#include "os/mynewt.h"
 
 #include <hal/hal_i2c.h>
 #include <hal/hal_gpio.h>
diff --git a/hw/mcu/stm/stm32f1xx/src/hal_timer.c b/hw/mcu/stm/stm32f1xx/src/hal_timer.c
index 1e79d0a46..c382d7897 100644
--- a/hw/mcu/stm/stm32f1xx/src/hal_timer.c
+++ b/hw/mcu/stm/stm32f1xx/src/hal_timer.c
@@ -21,10 +21,9 @@
 #include <inttypes.h>
 #include <assert.h>
 
-#include <syscfg/syscfg.h>
+#include "os/mynewt.h"
 
 #include <mcu/cmsis_nvic.h>
-#include <os/queue.h>
 #include <hal/hal_timer.h>
 
 #if 0
diff --git a/hw/mcu/stm/stm32f3xx/src/hal_timer.c b/hw/mcu/stm/stm32f3xx/src/hal_timer.c
index a1afa98ef..4f9768089 100644
--- a/hw/mcu/stm/stm32f3xx/src/hal_timer.c
+++ b/hw/mcu/stm/stm32f3xx/src/hal_timer.c
@@ -21,10 +21,9 @@
 #include <inttypes.h>
 #include <assert.h>
 
-#include <syscfg/syscfg.h>
+#include "os/mynewt.h"
 
 #include <mcu/cmsis_nvic.h>
-#include <os/queue.h>
 #include <hal/hal_timer.h>
 
 #include "stm32f3xx.h"
diff --git a/hw/mcu/stm/stm32f4xx/src/hal_i2c.c b/hw/mcu/stm/stm32f4xx/src/hal_i2c.c
index bcdb247a3..73c6a5c93 100644
--- a/hw/mcu/stm/stm32f4xx/src/hal_i2c.c
+++ b/hw/mcu/stm/stm32f4xx/src/hal_i2c.c
@@ -21,7 +21,7 @@
 #include <stdlib.h>
 #include <assert.h>
 
-#include <syscfg/syscfg.h>
+#include "os/mynewt.h"
 
 #include <hal/hal_i2c.h>
 #include <hal/hal_gpio.h>
diff --git a/hw/mcu/stm/stm32f4xx/src/hal_timer.c b/hw/mcu/stm/stm32f4xx/src/hal_timer.c
index 3fe70cb4c..8923a22bf 100644
--- a/hw/mcu/stm/stm32f4xx/src/hal_timer.c
+++ b/hw/mcu/stm/stm32f4xx/src/hal_timer.c
@@ -21,10 +21,9 @@
 #include <inttypes.h>
 #include <assert.h>
 
-#include <syscfg/syscfg.h>
+#include "os/mynewt.h"
 
 #include <mcu/cmsis_nvic.h>
-#include <os/queue.h>
 #include <hal/hal_timer.h>
 
 #include "stm32f4xx.h"
diff --git a/hw/mcu/stm/stm32f7xx/src/hal_i2c.c b/hw/mcu/stm/stm32f7xx/src/hal_i2c.c
index 80c004ac4..1eef619d5 100644
--- a/hw/mcu/stm/stm32f7xx/src/hal_i2c.c
+++ b/hw/mcu/stm/stm32f7xx/src/hal_i2c.c
@@ -21,7 +21,7 @@
 #include <stdlib.h>
 #include <assert.h>
 
-#include <syscfg/syscfg.h>
+#include "os/mynewt.h"
 
 #include <hal/hal_i2c.h>
 #include <hal/hal_gpio.h>
diff --git a/hw/mcu/stm/stm32f7xx/src/hal_timer.c b/hw/mcu/stm/stm32f7xx/src/hal_timer.c
index a47390c2e..458667b71 100644
--- a/hw/mcu/stm/stm32f7xx/src/hal_timer.c
+++ b/hw/mcu/stm/stm32f7xx/src/hal_timer.c
@@ -21,10 +21,9 @@
 #include <inttypes.h>
 #include <assert.h>
 
-#include <syscfg/syscfg.h>
+#include "os/mynewt.h"
 
 #include <mcu/cmsis_nvic.h>
-#include <os/queue.h>
 #include <hal/hal_timer.h>
 
 #include "stm32f7xx.h"
diff --git a/hw/mcu/stm/stm32l1xx/src/hal_i2c.c b/hw/mcu/stm/stm32l1xx/src/hal_i2c.c
index b49973082..939c3b3fd 100644
--- a/hw/mcu/stm/stm32l1xx/src/hal_i2c.c
+++ b/hw/mcu/stm/stm32l1xx/src/hal_i2c.c
@@ -21,7 +21,7 @@
 #include <stdlib.h>
 #include <assert.h>
 
-#include <syscfg/syscfg.h>
+#include "os/mynewt.h"
 
 #include <hal/hal_i2c.h>
 #include <hal/hal_gpio.h>
diff --git a/hw/mcu/stm/stm32l1xx/src/hal_timer.c b/hw/mcu/stm/stm32l1xx/src/hal_timer.c
index 54930c0b7..e5c4eb310 100644
--- a/hw/mcu/stm/stm32l1xx/src/hal_timer.c
+++ b/hw/mcu/stm/stm32l1xx/src/hal_timer.c
@@ -21,10 +21,9 @@
 #include <inttypes.h>
 #include <assert.h>
 
-#include <syscfg/syscfg.h>
+#include "os/mynewt.h"
 
 #include <mcu/cmsis_nvic.h>
-#include <os/queue.h>
 #include <hal/hal_timer.h>
 
 #include "stm32l1xx.h"
diff --git a/hw/sensor/creator/src/sensor_creator.c b/hw/sensor/creator/src/sensor_creator.c
index 40e393923..562d9266e 100644
--- a/hw/sensor/creator/src/sensor_creator.c
+++ b/hw/sensor/creator/src/sensor_creator.c
@@ -17,11 +17,9 @@
  * under the License.
  */
 
-#include <syscfg/syscfg.h>
-#include <os/os_dev.h>
 #include <assert.h>
-#include <defs/error.h>
 #include <string.h>
+#include "os/mynewt.h"
 
 #if MYNEWT_VAL(DRV2605_OFB)
 #include "hal/hal_gpio.h"
diff --git a/hw/sensor/include/sensor/accel.h b/hw/sensor/include/sensor/accel.h
index 564888b54..cebcad72b 100644
--- a/hw/sensor/include/sensor/accel.h
+++ b/hw/sensor/include/sensor/accel.h
@@ -20,8 +20,7 @@
 #ifndef __SENSOR_ACCEL_H__
 #define __SENSOR_ACCEL_H__
 
-#include "os/os.h"
-#include "os/os_dev.h"
+#include "os/mynewt.h"
 #include "sensor/sensor.h"
 
 #ifdef __cplusplus
diff --git a/hw/sensor/include/sensor/color.h b/hw/sensor/include/sensor/color.h
index 2cc40ca08..9c3319955 100644
--- a/hw/sensor/include/sensor/color.h
+++ b/hw/sensor/include/sensor/color.h
@@ -20,8 +20,7 @@
 #ifndef __SENSOR_COLOR_H__
 #define __SENSOR_COLOR_H__
 
-#include "os/os.h"
-#include "os/os_dev.h"
+#include "os/mynewt.h"
 #include "sensor/sensor.h"
 
 #ifdef __cplusplus
diff --git a/hw/sensor/include/sensor/euler.h b/hw/sensor/include/sensor/euler.h
index 0c95c560e..8cf866dcb 100644
--- a/hw/sensor/include/sensor/euler.h
+++ b/hw/sensor/include/sensor/euler.h
@@ -20,8 +20,7 @@
 #ifndef __SENSOR_EULER_H__
 #define __SENSOR_EULER_H__
 
-#include "os/os.h"
-#include "os/os_dev.h"
+#include "os/mynewt.h"
 #include "sensor/sensor.h"
 
 #ifdef __cplusplus
diff --git a/hw/sensor/include/sensor/gyro.h b/hw/sensor/include/sensor/gyro.h
index c0b892a78..20c27c702 100644
--- a/hw/sensor/include/sensor/gyro.h
+++ b/hw/sensor/include/sensor/gyro.h
@@ -20,8 +20,7 @@
 #ifndef __SENSOR_GYRO_H__
 #define __SENSOR_GYRO_H__
 
-#include "os/os.h"
-#include "os/os_dev.h"
+#include "os/mynewt.h"
 #include "sensor/sensor.h"
 
 #ifdef __cplusplus
diff --git a/hw/sensor/include/sensor/humidity.h b/hw/sensor/include/sensor/humidity.h
index 40f535073..ca29954c5 100644
--- a/hw/sensor/include/sensor/humidity.h
+++ b/hw/sensor/include/sensor/humidity.h
@@ -20,8 +20,7 @@
 #ifndef __SENSOR_HUMIDITY_H__
 #define __SENSOR_HUMIDITY_H__
 
-#include "os/os.h"
-#include "os/os_dev.h"
+#include "os/mynewt.h"
 #include "sensor/sensor.h"
 
 #ifdef __cplusplus
diff --git a/hw/sensor/include/sensor/light.h b/hw/sensor/include/sensor/light.h
index c9cdf9100..2c4f1186b 100644
--- a/hw/sensor/include/sensor/light.h
+++ b/hw/sensor/include/sensor/light.h
@@ -20,8 +20,7 @@
 #ifndef __SENSOR_LIGHT_H__
 #define __SENSOR_LIGHT_H__
 
-#include "os/os.h"
-#include "os/os_dev.h"
+#include "os/mynewt.h"
 #include "sensor/sensor.h"
 
 #ifdef __cplusplus
diff --git a/hw/sensor/include/sensor/mag.h b/hw/sensor/include/sensor/mag.h
index d43a28e6a..a0e302d71 100644
--- a/hw/sensor/include/sensor/mag.h
+++ b/hw/sensor/include/sensor/mag.h
@@ -20,8 +20,7 @@
 #ifndef __SENSOR_MAG_H__
 #define __SENSOR_MAG_H__
 
-#include "os/os.h"
-#include "os/os_dev.h"
+#include "os/mynewt.h"
 #include "sensor/sensor.h"
 
 #ifdef __cplusplus
diff --git a/hw/sensor/include/sensor/pressure.h b/hw/sensor/include/sensor/pressure.h
index 425fd9132..522207466 100644
--- a/hw/sensor/include/sensor/pressure.h
+++ b/hw/sensor/include/sensor/pressure.h
@@ -20,8 +20,7 @@
 #ifndef __SENSOR_PRESSURE_H__
 #define __SENSOR_PRESSURE_H__
 
-#include "os/os.h"
-#include "os/os_dev.h"
+#include "os/mynewt.h"
 #include "sensor/sensor.h"
 
 #ifdef __cplusplus
diff --git a/hw/sensor/include/sensor/quat.h b/hw/sensor/include/sensor/quat.h
index 5cfb454fc..be305ea4d 100644
--- a/hw/sensor/include/sensor/quat.h
+++ b/hw/sensor/include/sensor/quat.h
@@ -20,8 +20,7 @@
 #ifndef __SENSOR_QUAT_H__
 #define __SENSOR_QUAT_H__
 
-#include "os/os.h"
-#include "os/os_dev.h"
+#include "os/mynewt.h"
 #include "sensor/sensor.h"
 
 #ifdef __cplusplus
diff --git a/hw/sensor/include/sensor/sensor.h b/hw/sensor/include/sensor/sensor.h
index 7047099af..7bb2b6400 100644
--- a/hw/sensor/include/sensor/sensor.h
+++ b/hw/sensor/include/sensor/sensor.h
@@ -21,9 +21,7 @@
 #define __SENSOR_H__
 
 #include <string.h>
-#include "os/os.h"
-#include "os/os_dev.h"
-#include "syscfg/syscfg.h"
+#include "os/mynewt.h"
 
 #if MYNEWT_VAL(SENSOR_OIC)
 #include "oic/oc_ri.h"
diff --git a/hw/sensor/include/sensor/temperature.h b/hw/sensor/include/sensor/temperature.h
index 247631fc2..d71a0e78f 100644
--- a/hw/sensor/include/sensor/temperature.h
+++ b/hw/sensor/include/sensor/temperature.h
@@ -20,8 +20,7 @@
 #ifndef __SENSOR_TEMPERATURE_H__
 #define __SENSOR_TEMPERATURE_H__
 
-#include "os/os.h"
-#include "os/os_dev.h"
+#include "os/mynewt.h"
 #include "sensor/sensor.h"
 
 #ifdef __cplusplus
diff --git a/hw/sensor/src/sensor.c b/hw/sensor/src/sensor.c
index 6df4d0273..13ac10b91 100644
--- a/hw/sensor/src/sensor.c
+++ b/hw/sensor/src/sensor.c
@@ -20,17 +20,9 @@
 #include <string.h>
 #include <errno.h>
 #include <assert.h>
-
-#include "os/os.h"
-#include "sysinit/sysinit.h"
-
+#include "os/mynewt.h"
 #include "sensor/sensor.h"
-
 #include "sensor_priv.h"
-#include "os/os_time.h"
-#include "os/os_cputime.h"
-#include "defs/error.h"
-#include "syscfg/syscfg.h"
 #include "sensor/accel.h"
 #include "sensor/mag.h"
 #include "sensor/light.h"
diff --git a/hw/sensor/src/sensor_oic.c b/hw/sensor/src/sensor_oic.c
index 438d28522..4332c7a19 100644
--- a/hw/sensor/src/sensor_oic.c
+++ b/hw/sensor/src/sensor_oic.c
@@ -17,7 +17,7 @@
  * under the License.
  */
 
-#include "syscfg/syscfg.h"
+#include "os/mynewt.h"
 
 #if MYNEWT_VAL(SENSOR_OIC)
 
@@ -26,10 +26,6 @@
 #include <errno.h>
 #include <assert.h>
 
-#include "defs/error.h"
-
-#include "os/os.h"
-
 #include "sensor/sensor.h"
 #include "sensor/accel.h"
 #include "sensor/mag.h"
diff --git a/hw/sensor/src/sensor_priv.h b/hw/sensor/src/sensor_priv.h
index a15aa22f1..1aa0f1c11 100644
--- a/hw/sensor/src/sensor_priv.h
+++ b/hw/sensor/src/sensor_priv.h
@@ -20,7 +20,7 @@
 #ifndef __SENSOR_PRIV_H__
 #define __SENSOR_PRIV_H__
 
-#include "syscfg/syscfg.h"
+#include "os/mynewt.h"
 
 #if MYNEWT_VAL(SENSOR_CLI)
 int sensor_shell_register(void);
diff --git a/hw/sensor/src/sensor_shell.c b/hw/sensor/src/sensor_shell.c
index 18fbdca0d..bbb586810 100644
--- a/hw/sensor/src/sensor_shell.c
+++ b/hw/sensor/src/sensor_shell.c
@@ -17,7 +17,7 @@
  * under the License.
  */
 
-#include "syscfg/syscfg.h"
+#include "os/mynewt.h"
 
 #if MYNEWT_VAL(SENSOR_CLI)
 
@@ -26,10 +26,6 @@
 #include <errno.h>
 #include <assert.h>
 
-#include "defs/error.h"
-
-#include "os/os.h"
-
 #include "sensor/sensor.h"
 #include "sensor/accel.h"
 #include "sensor/mag.h"
@@ -44,7 +40,6 @@
 #include "console/console.h"
 #include "shell/shell.h"
 #include "hal/hal_i2c.h"
-#include "os/os_cputime.h"
 #include "parse/parse.h"
 
 static int sensor_cmd_exec(int, char **);
diff --git a/hw/util/button/include/button/button.h b/hw/util/button/include/button/button.h
index 3dd2be7fe..637f56e2d 100644
--- a/hw/util/button/include/button/button.h
+++ b/hw/util/button/include/button/button.h
@@ -2,7 +2,7 @@
 #define _BUTTON_H_
 
 #include <stdbool.h>
-#include <os/os.h>
+#include "os/mynewt.h"
 
 /**
  * This library generate events in the default queue to deal 
diff --git a/hw/util/button/src/button.c b/hw/util/button/src/button.c
index bdbdec939..cb7898b56 100644
--- a/hw/util/button/src/button.c
+++ b/hw/util/button/src/button.c
@@ -1,6 +1,24 @@
-#include <assert.h>
-#include <syscfg/syscfg.h>
+/*
+ * 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.
+ */
 
+#include <assert.h>
+#include "os/mynewt.h"
 #include "button/button.h"
 
 #define _BUTTON_FSM_INIT			0
diff --git a/kernel/os/include/os/mynewt.h b/kernel/os/include/os/mynewt.h
new file mode 100644
index 000000000..3f6943e17
--- /dev/null
+++ b/kernel/os/include/os/mynewt.h
@@ -0,0 +1,29 @@
+/*
+ * 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 H_OS_MYNEWT_
+#define H_OS_MYNEWT_
+
+#include "syscfg/syscfg.h"
+#include "sysinit/sysinit.h"
+#include "sysflash/sysflash.h"
+#include "os/os.h"
+#include "defs/error.h"
+
+#endif
diff --git a/kernel/os/include/os/os.h b/kernel/os/include/os/os.h
index 3bbfb1035..95f5c407b 100644
--- a/kernel/os/include/os/os.h
+++ b/kernel/os/include/os/os.h
@@ -108,14 +108,14 @@ void os_init(int (*fn)(int argc, char **argv));
 void os_start(void);
 
 #include "os/endian.h"
-#include "os/os_arch.h"
 #include "os/os_callout.h"
+#include "os/os_cfg.h"
 #include "os/os_cputime.h"
 #include "os/os_dev.h"
 #include "os/os_error.h"
 #include "os/os_eventq.h"
-#include "os/os_heap.h"
 #include "os/os_fault.h"
+#include "os/os_heap.h"
 #include "os/os_mbuf.h"
 #include "os/os_mempool.h"
 #include "os/os_mutex.h"
@@ -123,7 +123,10 @@ void os_start(void);
 #include "os/os_sched.h"
 #include "os/os_sem.h"
 #include "os/os_task.h"
+#include "os/os_test.h"
 #include "os/os_time.h"
+#include "os/os_trace_api.h"
+#include "os/queue.h"
 
 #ifdef __cplusplus
 }
diff --git a/kernel/os/include/os/os_task.h b/kernel/os/include/os/os_task.h
index cbbd357f0..ccb87d9dc 100644
--- a/kernel/os/include/os/os_task.h
+++ b/kernel/os/include/os/os_task.h
@@ -30,6 +30,7 @@
 
 #include "os/os.h"
 #include "os/os_sanity.h"
+#include "os/os_arch.h"
 #include "os/queue.h"
 
 #ifdef __cplusplus
diff --git a/kernel/os/src/arch/arc/os_arch_arc.c b/kernel/os/src/arch/arc/os_arch_arc.c
index 3ccdd0800..cba66f377 100755
--- a/kernel/os/src/arch/arc/os_arch_arc.c
+++ b/kernel/os/src/arch/arc/os_arch_arc.c
@@ -16,11 +16,11 @@
  * specific language governing permissions and limitations
  * under the License.
  */
+
 #include <string.h>
-#include "os/os.h"
+#include "os/mynewt.h"
 #include "inc/arc/arc_builtin.h"
 #include "inc/arc/arc_exception.h"
-#include "os/os_arch.h"
 #include <hal/hal_bsp.h>
 #include <hal/hal_os_tick.h>
 #include "os_priv.h"
diff --git a/kernel/os/src/arch/arc/os_fault.c b/kernel/os/src/arch/arc/os_fault.c
index 1142cf682..a5300eb61 100644
--- a/kernel/os/src/arch/arc/os_fault.c
+++ b/kernel/os/src/arch/arc/os_fault.c
@@ -17,10 +17,9 @@
  * under the License.
  */
 
-#include "syscfg/syscfg.h"
+#include "os/mynewt.h"
 #include "console/console.h"
 #include "hal/hal_system.h"
-#include "os/os.h"
 #include "os_priv.h"
 
 #if MYNEWT_VAL(OS_COREDUMP)
diff --git a/kernel/os/src/arch/cortex_m0/os_arch_arm.c b/kernel/os/src/arch/cortex_m0/os_arch_arm.c
index 29c231503..f18e8274e 100755
--- a/kernel/os/src/arch/cortex_m0/os_arch_arm.c
+++ b/kernel/os/src/arch/cortex_m0/os_arch_arm.c
@@ -17,8 +17,7 @@
  * under the License.
  */
 
-#include "os/os.h"
-#include "os/os_arch.h"
+#include "os/mynewt.h"
 #include <hal/hal_bsp.h>
 #include <hal/hal_os_tick.h>
 #include <mcu/cmsis_nvic.h>
diff --git a/kernel/os/src/arch/cortex_m0/os_fault.c b/kernel/os/src/arch/cortex_m0/os_fault.c
index 346ba9cc6..e066f21b6 100644
--- a/kernel/os/src/arch/cortex_m0/os_fault.c
+++ b/kernel/os/src/arch/cortex_m0/os_fault.c
@@ -20,13 +20,12 @@
 #include <stdint.h>
 #include <unistd.h>
 
-#include "syscfg/syscfg.h"
+#include "os/mynewt.h"
 #include "console/console.h"
 #include "hal/hal_system.h"
 #if MYNEWT_VAL(OS_COREDUMP)
 #include "coredump/coredump.h"
 #endif
-#include "os/os.h"
 #include "os_priv.h"
 
 struct exception_frame {
diff --git a/kernel/os/src/arch/cortex_m3/os_arch_arm.c b/kernel/os/src/arch/cortex_m3/os_arch_arm.c
index 088e57f7e..c498d9336 100755
--- a/kernel/os/src/arch/cortex_m3/os_arch_arm.c
+++ b/kernel/os/src/arch/cortex_m3/os_arch_arm.c
@@ -16,10 +16,8 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-#include <syscfg/syscfg.h>
 
-#include "os/os.h"
-#include "os/os_arch.h"
+#include "os/mynewt.h"
 #include <hal/hal_bsp.h>
 #include <hal/hal_os_tick.h>
 #include <mcu/cmsis_nvic.h>
diff --git a/kernel/os/src/arch/cortex_m3/os_fault.c b/kernel/os/src/arch/cortex_m3/os_fault.c
index 01476a576..c4bb03088 100644
--- a/kernel/os/src/arch/cortex_m3/os_fault.c
+++ b/kernel/os/src/arch/cortex_m3/os_fault.c
@@ -17,10 +17,9 @@
  * under the License.
  */
 
-#include "syscfg/syscfg.h"
+#include "os/mynewt.h"
 #include "console/console.h"
 #include "hal/hal_system.h"
-#include "os/os.h"
 #include "os_priv.h"
 
 #if MYNEWT_VAL(OS_COREDUMP)
diff --git a/kernel/os/src/arch/cortex_m4/os_arch_arm.c b/kernel/os/src/arch/cortex_m4/os_arch_arm.c
index 1ccb3a622..a208347e0 100755
--- a/kernel/os/src/arch/cortex_m4/os_arch_arm.c
+++ b/kernel/os/src/arch/cortex_m4/os_arch_arm.c
@@ -16,10 +16,8 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-#include <syscfg/syscfg.h>
 
-#include "os/os.h"
-#include "os/os_arch.h"
+#include "os/mynewt.h"
 #include <hal/hal_bsp.h>
 #include <hal/hal_os_tick.h>
 #include <mcu/cmsis_nvic.h>
diff --git a/kernel/os/src/arch/cortex_m4/os_fault.c b/kernel/os/src/arch/cortex_m4/os_fault.c
index 01476a576..c4bb03088 100644
--- a/kernel/os/src/arch/cortex_m4/os_fault.c
+++ b/kernel/os/src/arch/cortex_m4/os_fault.c
@@ -17,10 +17,9 @@
  * under the License.
  */
 
-#include "syscfg/syscfg.h"
+#include "os/mynewt.h"
 #include "console/console.h"
 #include "hal/hal_system.h"
-#include "os/os.h"
 #include "os_priv.h"
 
 #if MYNEWT_VAL(OS_COREDUMP)
diff --git a/kernel/os/src/arch/cortex_m7/os_arch_arm.c b/kernel/os/src/arch/cortex_m7/os_arch_arm.c
index 1ccb3a622..a208347e0 100755
--- a/kernel/os/src/arch/cortex_m7/os_arch_arm.c
+++ b/kernel/os/src/arch/cortex_m7/os_arch_arm.c
@@ -16,10 +16,8 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-#include <syscfg/syscfg.h>
 
-#include "os/os.h"
-#include "os/os_arch.h"
+#include "os/mynewt.h"
 #include <hal/hal_bsp.h>
 #include <hal/hal_os_tick.h>
 #include <mcu/cmsis_nvic.h>
diff --git a/kernel/os/src/arch/cortex_m7/os_fault.c b/kernel/os/src/arch/cortex_m7/os_fault.c
index 01476a576..c4bb03088 100644
--- a/kernel/os/src/arch/cortex_m7/os_fault.c
+++ b/kernel/os/src/arch/cortex_m7/os_fault.c
@@ -17,10 +17,9 @@
  * under the License.
  */
 
-#include "syscfg/syscfg.h"
+#include "os/mynewt.h"
 #include "console/console.h"
 #include "hal/hal_system.h"
-#include "os/os.h"
 #include "os_priv.h"
 
 #if MYNEWT_VAL(OS_COREDUMP)
diff --git a/kernel/os/src/arch/mips/os_arch_mips.c b/kernel/os/src/arch/mips/os_arch_mips.c
index 112be4d57..fbd33bc92 100644
--- a/kernel/os/src/arch/mips/os_arch_mips.c
+++ b/kernel/os/src/arch/mips/os_arch_mips.c
@@ -17,10 +17,7 @@
  * under the License.
  */
 
-
-#include "os/os.h"
-#include "os/os_arch.h"
-#include "syscfg/syscfg.h"
+#include "os/mynewt.h"
 #include <hal/hal_bsp.h>
 #include <hal/hal_os_tick.h>
 
diff --git a/kernel/os/src/arch/mips/os_fault.c b/kernel/os/src/arch/mips/os_fault.c
index aae8ff5de..a865a6ec2 100644
--- a/kernel/os/src/arch/mips/os_fault.c
+++ b/kernel/os/src/arch/mips/os_fault.c
@@ -18,7 +18,7 @@
  */
 
 #include <hal/hal_system.h>
-#include "os/os.h"
+#include "os/mynewt.h"
 #include "os_priv.h"
 
 void
diff --git a/kernel/os/src/arch/pic32/os_arch_pic32.c b/kernel/os/src/arch/pic32/os_arch_pic32.c
index 629194206..b3cb591a0 100644
--- a/kernel/os/src/arch/pic32/os_arch_pic32.c
+++ b/kernel/os/src/arch/pic32/os_arch_pic32.c
@@ -17,9 +17,7 @@
  * under the License.
  */
 
-#include "os/os.h"
-#include "os/os_arch.h"
-#include "syscfg/syscfg.h"
+#include "os/mynewt.h"
 #include <hal/hal_bsp.h>
 #include <hal/hal_os_tick.h>
 
diff --git a/kernel/os/src/arch/pic32/os_fault.c b/kernel/os/src/arch/pic32/os_fault.c
index 03c2ff90f..aa05ada7f 100644
--- a/kernel/os/src/arch/pic32/os_fault.c
+++ b/kernel/os/src/arch/pic32/os_fault.c
@@ -19,7 +19,7 @@
 
 #include <console/console.h>
 #include <hal/hal_system.h>
-#include "os/os.h"
+#include "os/mynewt.h"
 #include "os_priv.h"
 
 void
diff --git a/kernel/os/src/arch/rv32imac/os_arch_rv32imac.c b/kernel/os/src/arch/rv32imac/os_arch_rv32imac.c
index 11703bd74..39090073e 100644
--- a/kernel/os/src/arch/rv32imac/os_arch_rv32imac.c
+++ b/kernel/os/src/arch/rv32imac/os_arch_rv32imac.c
@@ -17,7 +17,7 @@
  * under the License.
  */
 
-#include "os/os.h"
+#include "os/mynewt.h"
 #include "os_priv.h"
 
 #include <hal/hal_bsp.h>
diff --git a/kernel/os/src/arch/rv32imac/os_fault.c b/kernel/os/src/arch/rv32imac/os_fault.c
index efcb118a1..4ab872f55 100644
--- a/kernel/os/src/arch/rv32imac/os_fault.c
+++ b/kernel/os/src/arch/rv32imac/os_fault.c
@@ -16,11 +16,12 @@
  * specific language governing permissions and limitations
  * under the License.
  */
+
 #include <stdio.h>
 #include <string.h>
 #include <unistd.h>
 
-#include "os/os.h"
+#include "os/mynewt.h"
 #include "os_priv.h"
 #include "hal/hal_system.h"
 
diff --git a/kernel/os/src/arch/sim-armv7/os_arch.c b/kernel/os/src/arch/sim-armv7/os_arch.c
index ebdbce1fa..1e9cd2c9e 100644
--- a/kernel/os/src/arch/sim-armv7/os_arch.c
+++ b/kernel/os/src/arch/sim-armv7/os_arch.c
@@ -17,7 +17,7 @@
  * under the License.
  */
 
-#include "os/os.h"
+#include "os/mynewt.h"
 #include "sim/sim.h"
 
 /*
diff --git a/kernel/os/src/arch/sim-mips/os_arch.c b/kernel/os/src/arch/sim-mips/os_arch.c
index 2be2a6175..0eaafcc4e 100644
--- a/kernel/os/src/arch/sim-mips/os_arch.c
+++ b/kernel/os/src/arch/sim-mips/os_arch.c
@@ -17,7 +17,7 @@
  * under the License.
  */
 
-#include "os/os.h"
+#include "os/mynewt.h"
 #include "sim/sim.h"
 
 /*
diff --git a/kernel/os/src/arch/sim/os_arch.c b/kernel/os/src/arch/sim/os_arch.c
index 2be2a6175..0eaafcc4e 100644
--- a/kernel/os/src/arch/sim/os_arch.c
+++ b/kernel/os/src/arch/sim/os_arch.c
@@ -17,7 +17,7 @@
  * under the License.
  */
 
-#include "os/os.h"
+#include "os/mynewt.h"
 #include "sim/sim.h"
 
 /*
diff --git a/kernel/os/src/endian.c b/kernel/os/src/endian.c
index 1311f43ef..2481513d3 100644
--- a/kernel/os/src/endian.c
+++ b/kernel/os/src/endian.c
@@ -17,7 +17,7 @@
  * under the License.
  */
 
-#include "os/endian.h"
+#include "os/mynewt.h"
 
 void
 put_le16(void *buf, uint16_t x)
diff --git a/kernel/os/src/os.c b/kernel/os/src/os.c
index 3f32bd9ea..423d5ad67 100644
--- a/kernel/os/src/os.c
+++ b/kernel/os/src/os.c
@@ -17,19 +17,15 @@
  * under the License.
  */
 
-#include "sysinit/sysinit.h"
-#include "os/os.h"
-#include "os/queue.h"
-#include "os/os_dev.h"
-#include "os/os_trace_api.h"
+#include <assert.h>
+
+#include "os/mynewt.h"
 #include "os_priv.h"
 
 #include "hal/hal_os_tick.h"
 #include "hal/hal_bsp.h"
 #include "hal/hal_watchdog.h"
 
-#include <assert.h>
-
 /**
  * @defgroup OSKernel Operating System Kernel
  * @brief This section contains documentation for the core operating system kernel
diff --git a/kernel/os/src/os_callout.c b/kernel/os/src/os_callout.c
index 61d7c89e5..eb2c59b21 100644
--- a/kernel/os/src/os_callout.c
+++ b/kernel/os/src/os_callout.c
@@ -20,7 +20,7 @@
 #include <assert.h>
 #include <string.h>
 
-#include "os/os.h"
+#include "os/mynewt.h"
 #include "os_priv.h"
 
 struct os_callout_list g_callout_list;
diff --git a/kernel/os/src/os_cputime.c b/kernel/os/src/os_cputime.c
index 6713ad5d1..e0476e365 100644
--- a/kernel/os/src/os_cputime.c
+++ b/kernel/os/src/os_cputime.c
@@ -20,8 +20,7 @@
 #include <string.h>
 #include <stdint.h>
 #include <assert.h>
-#include "os/os.h"
-#include "os/os_cputime.h"
+#include "os/mynewt.h"
 
 #if defined(OS_CPUTIME_FREQ_HIGH)
 struct os_cputime_data g_os_cputime;
diff --git a/kernel/os/src/os_cputime_1mhz.c b/kernel/os/src/os_cputime_1mhz.c
index 70e051278..61dd6fa9c 100644
--- a/kernel/os/src/os_cputime_1mhz.c
+++ b/kernel/os/src/os_cputime_1mhz.c
@@ -17,7 +17,7 @@
  * under the License.
  */
 
-#include "os/os_cputime.h"
+#include "os/mynewt.h"
 
 /**
  * This module implements cputime functionality for timers whose frequency is
diff --git a/kernel/os/src/os_cputime_high.c b/kernel/os/src/os_cputime_high.c
index 4a8746af3..3b9838eec 100644
--- a/kernel/os/src/os_cputime_high.c
+++ b/kernel/os/src/os_cputime_high.c
@@ -17,7 +17,7 @@
  * under the License.
  */
 
-#include "os/os_cputime.h"
+#include "os/mynewt.h"
 
 /**
  * This module implements cputime functionality for timers whose frequency is
diff --git a/kernel/os/src/os_cputime_pwr2.c b/kernel/os/src/os_cputime_pwr2.c
index 1567070ae..f5c5897b4 100644
--- a/kernel/os/src/os_cputime_pwr2.c
+++ b/kernel/os/src/os_cputime_pwr2.c
@@ -17,7 +17,7 @@
  * under the License.
  */
 
-#include "os/os_cputime.h"
+#include "os/mynewt.h"
 
 /**
  * This module implements cputime functionality for timers for which:
diff --git a/kernel/os/src/os_dev.c b/kernel/os/src/os_dev.c
index 96708ab62..0ec5ff8b9 100644
--- a/kernel/os/src/os_dev.c
+++ b/kernel/os/src/os_dev.c
@@ -17,12 +17,8 @@
  * under the License.
  */
 
-#include "os/os.h"
-#include "os/queue.h"
-#include "os/os_dev.h"
-
 #include <string.h>
-
+#include "os/mynewt.h"
 
 static STAILQ_HEAD(, os_dev) g_os_dev_list;
 
diff --git a/kernel/os/src/os_eventq.c b/kernel/os/src/os_eventq.c
index 3308eea13..604c160fa 100644
--- a/kernel/os/src/os_eventq.c
+++ b/kernel/os/src/os_eventq.c
@@ -19,9 +19,7 @@
 
 #include <assert.h>
 #include <string.h>
-#include "os/os_trace_api.h"
-
-#include "os/os.h"
+#include "os/mynewt.h"
 
 static struct os_eventq os_eventq_main;
 
diff --git a/kernel/os/src/os_heap.c b/kernel/os/src/os_heap.c
index d62c34b3c..41d6877f4 100644
--- a/kernel/os/src/os_heap.c
+++ b/kernel/os/src/os_heap.c
@@ -16,11 +16,9 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-#include "syscfg/syscfg.h"
 
 #include <assert.h>
-#include "os/os_mutex.h"
-#include "os/os_heap.h"
+#include "os/mynewt.h"
 
 #if MYNEWT_VAL(OS_SCHEDULING)
 static struct os_mutex os_malloc_mutex;
diff --git a/kernel/os/src/os_mbuf.c b/kernel/os/src/os_mbuf.c
index bb04062c4..b13423abf 100644
--- a/kernel/os/src/os_mbuf.c
+++ b/kernel/os/src/os_mbuf.c
@@ -33,11 +33,10 @@
  *
  */
 
-#include "os/os.h"
-
 #include <assert.h>
 #include <string.h>
 #include <limits.h>
+#include "os/mynewt.h"
 
 /**
  * @addtogroup OSKernel
diff --git a/kernel/os/src/os_mempool.c b/kernel/os/src/os_mempool.c
index d83697d3b..bc1cee8e3 100644
--- a/kernel/os/src/os_mempool.c
+++ b/kernel/os/src/os_mempool.c
@@ -17,11 +17,10 @@
  * under the License.
  */
 
-#include "os/os.h"
-
 #include <string.h>
 #include <assert.h>
 #include <stdbool.h>
+#include "os/mynewt.h"
 
 #define OS_MEM_TRUE_BLOCK_SIZE(bsize)   OS_ALIGN(bsize, OS_ALIGNMENT)
 #define OS_MEMPOOL_TRUE_BLOCK_SIZE(mp) OS_MEM_TRUE_BLOCK_SIZE(mp->mp_block_size)
diff --git a/kernel/os/src/os_msys_init.c b/kernel/os/src/os_msys_init.c
index 1f5e1c35c..59d571ce7 100644
--- a/kernel/os/src/os_msys_init.c
+++ b/kernel/os/src/os_msys_init.c
@@ -18,9 +18,7 @@
  */
 
 #include <assert.h>
-#include "sysinit/sysinit.h"
-#include "syscfg/syscfg.h"
-#include "os/os_mempool.h"
+#include "os/mynewt.h"
 #include "mem/mem.h"
 #include "os_priv.h"
 
diff --git a/kernel/os/src/os_mutex.c b/kernel/os/src/os_mutex.c
index b35807683..fbc78aa57 100644
--- a/kernel/os/src/os_mutex.c
+++ b/kernel/os/src/os_mutex.c
@@ -17,9 +17,8 @@
  * under the License.
  */
 
-#include "os/os.h"
-#include "os/os_trace_api.h"
 #include <assert.h>
+#include "os/mynewt.h"
 
 os_error_t
 os_mutex_init(struct os_mutex *mu)
diff --git a/kernel/os/src/os_priv.h b/kernel/os/src/os_priv.h
index 7bb5a746d..95371e011 100644
--- a/kernel/os/src/os_priv.h
+++ b/kernel/os/src/os_priv.h
@@ -20,8 +20,8 @@
 #ifndef H_OS_PRIV_
 #define H_OS_PRIV_
 
+#include "os/mynewt.h"
 #include "console/console.h"
-#include "os/queue.h"
 
 #ifdef __cplusplus
 extern "C" {
diff --git a/kernel/os/src/os_sanity.c b/kernel/os/src/os_sanity.c
index d696d1ee5..1bec7ff8d 100644
--- a/kernel/os/src/os_sanity.c
+++ b/kernel/os/src/os_sanity.c
@@ -19,8 +19,7 @@
 
 #include <assert.h>
 #include <string.h>
-
-#include "os/os.h"
+#include "os/mynewt.h"
 
 SLIST_HEAD(, os_sanity_check) g_os_sanity_check_list =
     SLIST_HEAD_INITIALIZER(os_sanity_check_list);
diff --git a/kernel/os/src/os_sched.c b/kernel/os/src/os_sched.c
index 682a55de6..f7937ec4f 100644
--- a/kernel/os/src/os_sched.c
+++ b/kernel/os/src/os_sched.c
@@ -17,12 +17,9 @@
  * under the License.
  */
 
-#include "os/os.h"
-#include "os/os_trace_api.h"
-#include "os/queue.h"
-#include "os_priv.h"
-
 #include <assert.h>
+#include "os/mynewt.h"
+#include "os_priv.h"
 
 struct os_task_list g_os_run_list = TAILQ_HEAD_INITIALIZER(g_os_run_list);
 struct os_task_list g_os_sleep_list = TAILQ_HEAD_INITIALIZER(g_os_sleep_list);
diff --git a/kernel/os/src/os_sem.c b/kernel/os/src/os_sem.c
index 767c9f20c..a2c4f0375 100644
--- a/kernel/os/src/os_sem.c
+++ b/kernel/os/src/os_sem.c
@@ -17,8 +17,8 @@
  * under the License.
  */
 
-#include "os/os.h"
 #include <assert.h>
+#include "os/mynewt.h"
 
 /* XXX:
  * 1) Should I check to see if we are within an ISR for some of these?
diff --git a/kernel/os/src/os_task.c b/kernel/os/src/os_task.c
index 9cc5e9ec5..466870de1 100644
--- a/kernel/os/src/os_task.c
+++ b/kernel/os/src/os_task.c
@@ -17,14 +17,10 @@
  * under the License.
  */
 
-
-#include "os/os.h"
-#include "os_priv.h"
-#include "os/os_trace_api.h"
-
 #include <assert.h>
 #include <string.h>
-
+#include "os/mynewt.h"
+#include "os_priv.h"
 
 uint8_t g_task_id;
 
diff --git a/kernel/os/src/os_time.c b/kernel/os/src/os_time.c
index 6a809b82b..df0d67844 100644
--- a/kernel/os/src/os_time.c
+++ b/kernel/os/src/os_time.c
@@ -16,13 +16,9 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-#include "syscfg/syscfg.h"
 
 #include <assert.h>
-
-#include "os/os.h"
-#include "os/queue.h"
-
+#include "os/mynewt.h"
 
 CTASSERT(sizeof(os_time_t) == 4);
 
diff --git a/kernel/os/test/src/callout_test.c b/kernel/os/test/src/callout_test.c
index d6ba9126f..1790c2857 100644
--- a/kernel/os/test/src/callout_test.c
+++ b/kernel/os/test/src/callout_test.c
@@ -16,9 +16,9 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-#include "sysinit/sysinit.h"
+
+#include "os/mynewt.h"
 #include "testutil/testutil.h"
-#include "os/os.h"
 #include "os_test_priv.h"
 
 /* Task 1 for sending */
diff --git a/kernel/os/test/src/callout_test.h b/kernel/os/test/src/callout_test.h
index 4a6de9ea1..1d3ba65fa 100644
--- a/kernel/os/test/src/callout_test.h
+++ b/kernel/os/test/src/callout_test.h
@@ -19,9 +19,8 @@
 #ifndef _CALLOUT_TEST_H
 #define _CALLOUT_TEST_H
 
-#include "sysinit/sysinit.h"
+#include "os/mynewt.h"
 #include "testutil/testutil.h"
-#include "os/os.h"
 #include "os_test_priv.h"
 
 #ifdef __cplusplus
diff --git a/kernel/os/test/src/eventq_test.c b/kernel/os/test/src/eventq_test.c
index b716bd645..03f164cff 100644
--- a/kernel/os/test/src/eventq_test.c
+++ b/kernel/os/test/src/eventq_test.c
@@ -18,11 +18,9 @@
  */
  
 #include <string.h>
-#include "sysinit/sysinit.h"
+#include "os/mynewt.h"
 #include "testutil/testutil.h"
-#include "os/os.h"
 #include "os_test_priv.h"
-#include "os/os_eventq.h"
 
 /* Task 1 sending task */
 /* Define task stack and task object */
diff --git a/kernel/os/test/src/eventq_test.h b/kernel/os/test/src/eventq_test.h
index 7fea3a21e..4480dda24 100644
--- a/kernel/os/test/src/eventq_test.h
+++ b/kernel/os/test/src/eventq_test.h
@@ -20,11 +20,9 @@
 #define _EVENTQ_TEST_H
  
 #include <string.h>
-#include "sysinit/sysinit.h"
+#include "os/mynewt.h"
 #include "testutil/testutil.h"
-#include "os/os.h"
 #include "os_test_priv.h"
-#include "os/os_eventq.h"
 
 #ifdef __cplusplus
 #extern "C" {
diff --git a/kernel/os/test/src/mbuf_test.c b/kernel/os/test/src/mbuf_test.c
index 1eb8dcad3..68642df62 100644
--- a/kernel/os/test/src/mbuf_test.c
+++ b/kernel/os/test/src/mbuf_test.c
@@ -17,12 +17,11 @@
  * under the License.
  */
 
+#include <string.h>
+#include "os/mynewt.h"
 #include "testutil/testutil.h"
-#include "os/os.h"
 #include "os_test_priv.h"
 
-#include <string.h>
-
 /* 
  * NOTE: currently, the buffer size cannot be changed as some tests are
  * hard-coded for this size.
diff --git a/kernel/os/test/src/mbuf_test.h b/kernel/os/test/src/mbuf_test.h
index eb396d0ae..9b0341b71 100644
--- a/kernel/os/test/src/mbuf_test.h
+++ b/kernel/os/test/src/mbuf_test.h
@@ -19,12 +19,11 @@
 #ifndef _MBUF_TEST_H
 #define _MBUF_TEST_H
 
+#include <string.h>
+#include "os/mynewt.h"
 #include "testutil/testutil.h"
-#include "os/os.h"
 #include "os_test_priv.h"
 
-#include <string.h>
-
 #ifdef __cplusplus
 #extern "C" {
 #endif
diff --git a/kernel/os/test/src/mempool_test.c b/kernel/os/test/src/mempool_test.c
index af17e88c1..23be30655 100644
--- a/kernel/os/test/src/mempool_test.c
+++ b/kernel/os/test/src/mempool_test.c
@@ -18,8 +18,8 @@
  */
 #include <stdio.h>
 #include <string.h>
+#include "os/mynewt.h"
 #include "testutil/testutil.h"
-#include "os/os.h"
 #include "os_test_priv.h"
 
 #if OS_CFG_ALIGNMENT == OS_CFG_ALIGN_4
diff --git a/kernel/os/test/src/mempool_test.h b/kernel/os/test/src/mempool_test.h
index 50010144b..9b9697134 100644
--- a/kernel/os/test/src/mempool_test.h
+++ b/kernel/os/test/src/mempool_test.h
@@ -21,8 +21,8 @@
 
 #include <stdio.h>
 #include <string.h>
+#include "os/mynewt.h"
 #include "testutil/testutil.h"
-#include "os/os.h"
 #include "os_test_priv.h"
 
 #ifdef __cplusplus
diff --git a/kernel/os/test/src/mutex_test.c b/kernel/os/test/src/mutex_test.c
index b0d9423fb..2b75d1749 100644
--- a/kernel/os/test/src/mutex_test.c
+++ b/kernel/os/test/src/mutex_test.c
@@ -16,14 +16,13 @@
  * specific language governing permissions and limitations
  * under the License.
  */
+
 #include <stdio.h>
 #include <string.h>
 #include <assert.h>
 #include <sys/time.h>
-#include "sysinit/sysinit.h"
+#include "os/mynewt.h"
 #include "testutil/testutil.h"
-#include "os/os.h"
-#include "os/os_test.h"
 #include "os_test_priv.h"
 
 #if MYNEWT_VAL(SELFTEST)
diff --git a/kernel/os/test/src/mutex_test.h b/kernel/os/test/src/mutex_test.h
index f32231c3e..7a625ea53 100644
--- a/kernel/os/test/src/mutex_test.h
+++ b/kernel/os/test/src/mutex_test.h
@@ -23,10 +23,8 @@
 #include <string.h>
 #include <assert.h>
 #include <sys/time.h>
-#include "sysinit/sysinit.h"
+#include "os/mynewt.h"
 #include "testutil/testutil.h"
-#include "os/os.h"
-#include "os/os_test.h"
 #include "os_test_priv.h"
 
 #ifdef __cplusplus
diff --git a/kernel/os/test/src/os_test.c b/kernel/os/test/src/os_test.c
index ea15f6160..3afcb49ea 100644
--- a/kernel/os/test/src/os_test.c
+++ b/kernel/os/test/src/os_test.c
@@ -16,20 +16,18 @@
  * specific language governing permissions and limitations
  * under the License.
  */
+
 #include <assert.h>
 #include <stddef.h>
-#include "sysinit/sysinit.h"
-#include "syscfg/syscfg.h"
-#include "testutil/testutil.h"
-#include "os/os_test.h"
-#include "os_test_priv.h"
-
 #include <stdio.h>
 #include <setjmp.h>
 #include <signal.h>
 #include <string.h>
 #include <sys/time.h>
-#include "os/os.h"
+
+#include "os/mynewt.h"
+#include "testutil/testutil.h"
+#include "os_test_priv.h"
 
 uint32_t stack1_size;
 uint32_t stack2_size;
diff --git a/kernel/os/test/src/os_test_priv.h b/kernel/os/test/src/os_test_priv.h
index e732c375c..e8a701b8e 100644
--- a/kernel/os/test/src/os_test_priv.h
+++ b/kernel/os/test/src/os_test_priv.h
@@ -20,9 +20,8 @@
 #ifndef H_OS_TEST_PRIV_
 #define H_OS_TEST_PRIV_
 
-#include "sysinit/sysinit.h"
+#include "os/mynewt.h"
 #include "testutil/testutil.h"
-#include "os/os.h"
 #include "os_test_priv.h"
 
 #include "callout_test.h"
diff --git a/kernel/os/test/src/sem_test.c b/kernel/os/test/src/sem_test.c
index 397fa18e0..457affd1d 100644
--- a/kernel/os/test/src/sem_test.c
+++ b/kernel/os/test/src/sem_test.c
@@ -16,11 +16,11 @@
  * specific language governing permissions and limitations
  * under the License.
  */
+
 #include <stdio.h>
 #include <string.h>
-#include "sysinit/sysinit.h"
+#include "os/mynewt.h"
 #include "testutil/testutil.h"
-#include "os/os.h"
 #include "os_test_priv.h"
 
 #if MYNEWT_VAL(SELFTEST)
diff --git a/kernel/os/test/src/sem_test.h b/kernel/os/test/src/sem_test.h
index 1d0bf091a..147a503ef 100644
--- a/kernel/os/test/src/sem_test.h
+++ b/kernel/os/test/src/sem_test.h
@@ -21,9 +21,8 @@
 
 #include <stdio.h>
 #include <string.h>
-#include "sysinit/sysinit.h"
+#include "os/mynewt.h"
 #include "testutil/testutil.h"
-#include "os/os.h"
 #include "os_test_priv.h"
 
 #ifdef __cplusplus
diff --git a/kernel/sim/include/sim/sim.h b/kernel/sim/include/sim/sim.h
index 0522c83c4..bba80530a 100644
--- a/kernel/sim/include/sim/sim.h
+++ b/kernel/sim/include/sim/sim.h
@@ -26,9 +26,7 @@ extern "C" {
 
 #include <stdio.h>
 #include <setjmp.h>
-#include "os/os_arch.h"
-#include "os/os_error.h"
-#include "os/os_time.h"
+#include "os/mynewt.h"
 struct os_task;
 struct stack_frame;
 
diff --git a/kernel/sim/src/sim_priv.h b/kernel/sim/src/sim_priv.h
index 09d580df9..575e50028 100644
--- a/kernel/sim/src/sim_priv.h
+++ b/kernel/sim/src/sim_priv.h
@@ -21,7 +21,7 @@
 #define H_SIM_PRIV_
 
 #include <sys/types.h>
-#include <os/os.h>
+#include "os/mynewt.h"
 
 #ifdef __cplusplus
 extern "C" {
diff --git a/kernel/sim/src/sim_sched_gen.c b/kernel/sim/src/sim_sched_gen.c
index 7614476b6..bcc029e09 100644
--- a/kernel/sim/src/sim_sched_gen.c
+++ b/kernel/sim/src/sim_sched_gen.c
@@ -22,7 +22,7 @@
  * and no-signals).
  */
 
-#include "os/os.h"
+#include "os/mynewt.h"
 
 #include <hal/hal_bsp.h>
 
diff --git a/kernel/sim/src/sim_sched_nosig.c b/kernel/sim/src/sim_sched_nosig.c
index 69b0c140e..fadb712ad 100644
--- a/kernel/sim/src/sim_sched_nosig.c
+++ b/kernel/sim/src/sim_sched_nosig.c
@@ -30,12 +30,10 @@
  * setting.
  */
 
-#include "syscfg/syscfg.h"
+#include "os/mynewt.h"
 
 #if !MYNEWT_VAL(MCU_NATIVE_USE_SIGNALS)
 
-#include "os/os.h"
-
 #include <hal/hal_bsp.h>
 
 #ifdef __APPLE__
diff --git a/kernel/sim/src/sim_sched_sig.c b/kernel/sim/src/sim_sched_sig.c
index 6281aac71..c1adeba54 100644
--- a/kernel/sim/src/sim_sched_sig.c
+++ b/kernel/sim/src/sim_sched_sig.c
@@ -29,11 +29,10 @@
  * setting.
  */
 
-#include "syscfg/syscfg.h"
+#include "os/mynewt.h"
 
 #if MYNEWT_VAL(MCU_NATIVE_USE_SIGNALS)
 
-#include "os/os.h"
 #include "sim_priv.h"
 
 #include <hal/hal_bsp.h>
diff --git a/libc/baselibc/include/assert.h b/libc/baselibc/include/assert.h
index 8a131b5b8..e291bb5af 100644
--- a/libc/baselibc/include/assert.h
+++ b/libc/baselibc/include/assert.h
@@ -5,7 +5,7 @@
 #ifndef _ASSERT_H
 #define _ASSERT_H
 
-#include "syscfg/syscfg.h"
+#include "os/mynewt.h"
 
 #ifdef __cplusplus
 extern "C" {
diff --git a/libc/baselibc/src/start.c b/libc/baselibc/src/start.c
index 7f6caacf3..606738784 100644
--- a/libc/baselibc/src/start.c
+++ b/libc/baselibc/src/start.c
@@ -16,10 +16,9 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-#include <stdlib.h>
 
-#include <sysinit/sysinit.h>
-#include <os/os.h>
+#include <stdlib.h>
+#include "os/mynewt.h"
 
 extern int main(int argc, char **argv);
 
diff --git a/libc/baselibc/src/tinyprintf.c b/libc/baselibc/src/tinyprintf.c
index 9ab3358da..2e8a844a2 100644
--- a/libc/baselibc/src/tinyprintf.c
+++ b/libc/baselibc/src/tinyprintf.c
@@ -65,7 +65,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 #include <stdio.h>
 #include <inttypes.h>
 
-#include "syscfg/syscfg.h"
+#include "os/mynewt.h"
 
 struct param {
     unsigned char width; /**< field width */
diff --git a/mgmt/imgmgr/src/imgmgr.c b/mgmt/imgmgr/src/imgmgr.c
index 62d73932f..39dd7722a 100644
--- a/mgmt/imgmgr/src/imgmgr.c
+++ b/mgmt/imgmgr/src/imgmgr.c
@@ -16,14 +16,12 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-#include <os/endian.h>
 
 #include <limits.h>
 #include <assert.h>
 #include <string.h>
 
-#include "sysinit/sysinit.h"
-#include "sysflash/sysflash.h"
+#include "os/mynewt.h"
 #include "hal/hal_bsp.h"
 #include "flash_map/flash_map.h"
 #include "cborattr/cborattr.h"
diff --git a/mgmt/imgmgr/src/imgmgr_cli.c b/mgmt/imgmgr/src/imgmgr_cli.c
index c2f3f5c5a..b583a842b 100644
--- a/mgmt/imgmgr/src/imgmgr_cli.c
+++ b/mgmt/imgmgr/src/imgmgr_cli.c
@@ -17,13 +17,12 @@
  * under the License.
  */
 
-#include "syscfg/syscfg.h"
+#include "os/mynewt.h"
 
 #if MYNEWT_VAL(IMGMGR_CLI)
 
 #include <string.h>
 
-#include <defs/error.h>
 #include <flash_map/flash_map.h>
 #include <hal/hal_bsp.h>
 
diff --git a/mgmt/imgmgr/src/imgmgr_coredump.c b/mgmt/imgmgr/src/imgmgr_coredump.c
index 091c9161e..858a1daaf 100644
--- a/mgmt/imgmgr/src/imgmgr_coredump.c
+++ b/mgmt/imgmgr/src/imgmgr_coredump.c
@@ -17,13 +17,12 @@
  * under the License.
  */
 
-#include "syscfg/syscfg.h"
+#include "os/mynewt.h"
 
 #if MYNEWT_VAL(IMGMGR_COREDUMP)
 
 #include <limits.h>
 
-#include "sysflash/sysflash.h"
 #include "flash_map/flash_map.h"
 #include "mgmt/mgmt.h"
 #include "coredump/coredump.h"
diff --git a/mgmt/imgmgr/src/imgmgr_priv.h b/mgmt/imgmgr/src/imgmgr_priv.h
index 11b73e2b7..2df5239fa 100644
--- a/mgmt/imgmgr/src/imgmgr_priv.h
+++ b/mgmt/imgmgr/src/imgmgr_priv.h
@@ -21,7 +21,7 @@
 #define __IMGMGR_PRIV_H_
 
 #include <stdint.h>
-#include "syscfg/syscfg.h"
+#include "os/mynewt.h"
 
 #ifdef __cplusplus
 extern "C" {
diff --git a/mgmt/mgmt/include/mgmt/mgmt.h b/mgmt/mgmt/include/mgmt/mgmt.h
index 3c402f271..bdadf6641 100644
--- a/mgmt/mgmt/include/mgmt/mgmt.h
+++ b/mgmt/mgmt/include/mgmt/mgmt.h
@@ -21,8 +21,7 @@
 #define _MGMT_MGMT_H_
 
 #include <inttypes.h>
-
-#include <os/queue.h>
+#include "os/mynewt.h"
 
 #ifdef __cplusplus
 extern "C" {
diff --git a/mgmt/mgmt/src/mgmt.c b/mgmt/mgmt/src/mgmt.c
index c1a2a1e46..f640f0985 100644
--- a/mgmt/mgmt/src/mgmt.c
+++ b/mgmt/mgmt/src/mgmt.c
@@ -18,7 +18,7 @@
  */
 #include <string.h>
 
-#include <os/os.h>
+#include "os/mynewt.h"
 #include <tinycbor/cbor.h>
 #include "mgmt/mgmt.h"
 
diff --git a/mgmt/newtmgr/include/newtmgr/newtmgr.h b/mgmt/newtmgr/include/newtmgr/newtmgr.h
index a55f5faa6..07013a6c8 100644
--- a/mgmt/newtmgr/include/newtmgr/newtmgr.h
+++ b/mgmt/newtmgr/include/newtmgr/newtmgr.h
@@ -22,8 +22,7 @@
 
 #include <tinycbor/cbor.h>
 #include <inttypes.h>
-#include <os/os.h>
-#include <os/endian.h>
+#include "os/mynewt.h"
 
 #ifdef __cplusplus
 extern "C" {
diff --git a/mgmt/newtmgr/nmgr_os/src/newtmgr_os.c b/mgmt/newtmgr/nmgr_os/src/newtmgr_os.c
index b2ebc378c..12075d4fb 100644
--- a/mgmt/newtmgr/nmgr_os/src/newtmgr_os.c
+++ b/mgmt/newtmgr/nmgr_os/src/newtmgr_os.c
@@ -16,14 +16,12 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-#include <syscfg/syscfg.h>
-
-#include <os/os.h>
-#include <os/endian.h>
 
 #include <assert.h>
 #include <string.h>
 
+#include "os/mynewt.h"
+
 #include <hal/hal_system.h>
 #include <hal/hal_watchdog.h>
 
diff --git a/mgmt/newtmgr/src/newtmgr.c b/mgmt/newtmgr/src/newtmgr.c
index 9e3bb6823..aa6afee55 100644
--- a/mgmt/newtmgr/src/newtmgr.c
+++ b/mgmt/newtmgr/src/newtmgr.c
@@ -20,10 +20,7 @@
 #include <assert.h>
 #include <string.h>
 
-#include "syscfg/syscfg.h"
-#include "sysinit/sysinit.h"
-#include "os/os.h"
-#include "os/endian.h"
+#include "os/mynewt.h"
 
 #include "mem/mem.h"
 
diff --git a/mgmt/newtmgr/transport/ble/src/newtmgr_ble.c b/mgmt/newtmgr/transport/ble/src/newtmgr_ble.c
index 907e1c74b..24af84dde 100644
--- a/mgmt/newtmgr/transport/ble/src/newtmgr_ble.c
+++ b/mgmt/newtmgr/transport/ble/src/newtmgr_ble.c
@@ -20,11 +20,10 @@
 #include <assert.h>
 #include <stdio.h>
 #include <string.h>
-#include "sysinit/sysinit.h"
+#include "os/mynewt.h"
 #include "host/ble_hs.h"
 #include "mgmt/mgmt.h"
 #include "newtmgr/newtmgr.h"
-#include "os/endian.h"
 #include "console/console.h"
 
 /* nmgr ble mqueue */
diff --git a/mgmt/newtmgr/transport/nmgr_shell/src/nmgr_shell.c b/mgmt/newtmgr/transport/nmgr_shell/src/nmgr_shell.c
index c57e9b182..45972be3a 100644
--- a/mgmt/newtmgr/transport/nmgr_shell/src/nmgr_shell.c
+++ b/mgmt/newtmgr/transport/nmgr_shell/src/nmgr_shell.c
@@ -16,10 +16,11 @@
  * specific language governing permissions and limitations
  * under the License.
  */
+
 #include <inttypes.h>
 #include <assert.h>
 
-#include <sysinit/sysinit.h>
+#include "os/mynewt.h"
 #include <shell/shell.h>
 #include <mgmt/mgmt.h>
 #include <newtmgr/newtmgr.h>
diff --git a/mgmt/newtmgr/transport/nmgr_uart/src/nmgr_uart.c b/mgmt/newtmgr/transport/nmgr_uart/src/nmgr_uart.c
index 4465079d6..1b7529338 100644
--- a/mgmt/newtmgr/transport/nmgr_uart/src/nmgr_uart.c
+++ b/mgmt/newtmgr/transport/nmgr_uart/src/nmgr_uart.c
@@ -19,11 +19,9 @@
 #include <inttypes.h>
 #include <assert.h>
 
-#include <syscfg/syscfg.h>
-#include <sysinit/sysinit.h>
+#include "os/mynewt.h"
 #include <bsp/bsp.h>
 
-#include <os/os.h>
 #include <mgmt/mgmt.h>
 #include <newtmgr/newtmgr.h>
 #include <uart/uart.h>
diff --git a/mgmt/oicmgr/src/oicmgr.c b/mgmt/oicmgr/src/oicmgr.c
index a1178760f..b268d7714 100644
--- a/mgmt/oicmgr/src/oicmgr.c
+++ b/mgmt/oicmgr/src/oicmgr.c
@@ -17,16 +17,11 @@
  * under the License.
  */
 
-#include <syscfg/syscfg.h>
-#include <sysinit/sysinit.h>
-
-#include <os/os.h>
-#include <os/endian.h>
-#include <defs/error.h>
-
 #include <assert.h>
 #include <string.h>
 
+#include "os/mynewt.h"
+
 #include <mgmt/mgmt.h>
 #include <nmgr_os/nmgr_os.h>
 
diff --git a/net/ip/include/arch/sys_arch.h b/net/ip/include/arch/sys_arch.h
index 74ddad22b..d598b939c 100644
--- a/net/ip/include/arch/sys_arch.h
+++ b/net/ip/include/arch/sys_arch.h
@@ -26,7 +26,7 @@ extern "C" {
 #endif
 
 #undef LITTLE_ENDIAN
-#include <os/os.h>
+#include "os/mynewt.h"
 #include <ip/os_queue.h>
 
 #define SYS_MBOX_NULL NULL
diff --git a/net/ip/inet_def_service/src/inet_def_service.c b/net/ip/inet_def_service/src/inet_def_service.c
index ff688daa2..e802cbbb4 100644
--- a/net/ip/inet_def_service/src/inet_def_service.c
+++ b/net/ip/inet_def_service/src/inet_def_service.c
@@ -19,8 +19,7 @@
 #include <assert.h>
 #include <string.h>
 
-#include <os/os.h>
-#include <os/endian.h>
+#include "os/mynewt.h"
 #include <mn_socket/mn_socket.h>
 #include <console/console.h>
 
diff --git a/net/ip/mn_socket/src/mn_socket.c b/net/ip/mn_socket/src/mn_socket.c
index d0070c370..6732e4582 100644
--- a/net/ip/mn_socket/src/mn_socket.c
+++ b/net/ip/mn_socket/src/mn_socket.c
@@ -21,7 +21,7 @@
 #include <assert.h>
 #include <string.h>
 
-#include <os/os.h>
+#include "os/mynewt.h"
 
 #include "mn_socket/mn_socket.h"
 #include "mn_socket/mn_socket_ops.h"
diff --git a/net/ip/mn_socket/src/mn_socket_aconv.c b/net/ip/mn_socket/src/mn_socket_aconv.c
index 3713f5cac..b7ce1e7a8 100644
--- a/net/ip/mn_socket/src/mn_socket_aconv.c
+++ b/net/ip/mn_socket/src/mn_socket_aconv.c
@@ -19,7 +19,7 @@
 #include <ctype.h>
 #include <stdio.h>
 #include <string.h>
-#include <os/endian.h>
+#include "os/mynewt.h"
 #include "mn_socket/mn_socket.h"
 
 int
diff --git a/net/ip/mn_socket/test/src/mn_sock_test.c b/net/ip/mn_socket/test/src/mn_sock_test.c
index 0d7885bf8..b3c7845bf 100644
--- a/net/ip/mn_socket/test/src/mn_sock_test.c
+++ b/net/ip/mn_socket/test/src/mn_sock_test.c
@@ -20,9 +20,7 @@
 #include <stdio.h>
 #include <string.h>
 
-#include "sysinit/sysinit.h"
-#include "syscfg/syscfg.h"
-#include "os/os.h"
+#include "os/mynewt.h"
 #include "testutil/testutil.h"
 
 #include "mn_socket/mn_socket.h"
diff --git a/net/ip/mn_socket/test/src/mn_sock_test.h b/net/ip/mn_socket/test/src/mn_sock_test.h
index 785aca909..d8c6df339 100644
--- a/net/ip/mn_socket/test/src/mn_sock_test.h
+++ b/net/ip/mn_socket/test/src/mn_sock_test.h
@@ -22,9 +22,7 @@
 #include <stdio.h>
 #include <string.h>
 
-#include "sysinit/sysinit.h"
-#include "syscfg/syscfg.h"
-#include "os/os.h"
+#include "os/mynewt.h"
 #include "testutil/testutil.h"
 
 #include "mn_socket/mn_socket.h"
diff --git a/net/ip/mn_socket/test/src/mn_sock_util.c b/net/ip/mn_socket/test/src/mn_sock_util.c
index 3c9e0396f..efc36dd8b 100644
--- a/net/ip/mn_socket/test/src/mn_sock_util.c
+++ b/net/ip/mn_socket/test/src/mn_sock_util.c
@@ -20,9 +20,7 @@
 #include <stdio.h>
 #include <string.h>
 
-#include "sysinit/sysinit.h"
-#include "syscfg/syscfg.h"
-#include "os/os.h"
+#include "os/mynewt.h"
 #include "testutil/testutil.h"
 
 #include "mn_socket/mn_socket.h"
diff --git a/net/ip/native_sockets/src/native_sock.c b/net/ip/native_sockets/src/native_sock.c
index 17c391d85..022c0400c 100644
--- a/net/ip/native_sockets/src/native_sock.c
+++ b/net/ip/native_sockets/src/native_sock.c
@@ -16,6 +16,7 @@
  * specific language governing permissions and limitations
  * under the License.
  */
+
 #include <sys/socket.h>
 #include <unistd.h>
 #include <errno.h>
@@ -28,9 +29,7 @@
 #include <sys/un.h>
 #include <stdio.h>
 
-#include <sysinit/sysinit.h>
-#include <os/os.h>
-#include <os/os_mbuf.h>
+#include "os/mynewt.h"
 #include "mn_socket/mn_socket.h"
 #include "mn_socket/mn_socket_ops.h"
 #include "native_sockets/native_sock.h"
diff --git a/net/ip/src/ip_init.c b/net/ip/src/ip_init.c
index c73df0234..af8b9579b 100644
--- a/net/ip/src/ip_init.c
+++ b/net/ip/src/ip_init.c
@@ -16,8 +16,8 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-#include "syscfg/syscfg.h"
 
+#include "os/mynewt.h"
 #include <lwip/tcpip.h>
 
 #include "ip_priv.h"
diff --git a/net/ip/src/lwip_cli.c b/net/ip/src/lwip_cli.c
index adfa2efb5..7200e2288 100644
--- a/net/ip/src/lwip_cli.c
+++ b/net/ip/src/lwip_cli.c
@@ -16,7 +16,8 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-#include <syscfg/syscfg.h>
+
+#include "os/mynewt.h"
 
 #if MYNEWT_VAL(LWIP_CLI)
 #include <string.h>
diff --git a/net/ip/src/lwip_if.c b/net/ip/src/lwip_if.c
index 41d6b2e2d..9bc08a836 100644
--- a/net/ip/src/lwip_if.c
+++ b/net/ip/src/lwip_if.c
@@ -19,8 +19,7 @@
 #include <limits.h>
 #include <string.h>
 
-#include <os/os.h>
-#include <os/os_mbuf.h>
+#include "os/mynewt.h"
 #include <mn_socket/mn_socket.h>
 
 #include <lwip/tcpip.h>
diff --git a/net/ip/src/lwip_socket.c b/net/ip/src/lwip_socket.c
index b000e3bd3..21d5ffc0e 100644
--- a/net/ip/src/lwip_socket.c
+++ b/net/ip/src/lwip_socket.c
@@ -18,8 +18,7 @@
  */
 #include <string.h>
 
-#include <os/os.h>
-#include <os/os_mbuf.h>
+#include "os/mynewt.h"
 
 #include <mn_socket/mn_socket.h>
 #include <mn_socket/mn_socket_ops.h>
diff --git a/net/ip/src/os_queue.c b/net/ip/src/os_queue.c
index 94d006e31..f7d0b467a 100644
--- a/net/ip/src/os_queue.c
+++ b/net/ip/src/os_queue.c
@@ -20,9 +20,9 @@
 #include <assert.h>
 #include <string.h>
 #include <stdio.h>
-
 #include <inttypes.h>
-#include <os/os.h>
+
+#include "os/mynewt.h"
 #include <ip/os_queue.h>
 
 /*
diff --git a/net/lora/node/include/node/lora.h b/net/lora/node/include/node/lora.h
index 4ca0d3a42..15ebfdf26 100644
--- a/net/lora/node/include/node/lora.h
+++ b/net/lora/node/include/node/lora.h
@@ -21,7 +21,7 @@
 #define H_LORA_
 
 #include "stats/stats.h"
-#include "syscfg/syscfg.h"
+#include "os/mynewt.h"
 #include "node/mac/LoRaMac.h"
 
 STATS_SECT_START(lora_mac_stats)
diff --git a/net/lora/node/include/node/lora_band.h b/net/lora/node/include/node/lora_band.h
index c8503726e..3dd4c33e0 100644
--- a/net/lora/node/include/node/lora_band.h
+++ b/net/lora/node/include/node/lora_band.h
@@ -20,7 +20,7 @@
 #ifndef H_LORA_BAND_
 #define H_LORA_BAND_
 
-#include "syscfg/syscfg.h"
+#include "os/mynewt.h"
 
 #if   MYNEWT_VAL(LORA_NODE_FREQ_BAND) == 433
 #define USE_BAND_433
diff --git a/net/lora/node/include/node/lora_priv.h b/net/lora/node/include/node/lora_priv.h
index 9238ed544..e4ca5c090 100644
--- a/net/lora/node/include/node/lora_priv.h
+++ b/net/lora/node/include/node/lora_priv.h
@@ -21,7 +21,7 @@
 #define H_LORA_PRIV_
 
 #include "node/mac/LoRaMac.h"
-#include "os/os.h"
+#include "os/mynewt.h"
 #include "node/lora.h"
 
 /*
diff --git a/net/lora/node/include/node/mac/LoRaMac.h b/net/lora/node/include/node/mac/LoRaMac.h
index a44780876..34b3ac71c 100644
--- a/net/lora/node/include/node/mac/LoRaMac.h
+++ b/net/lora/node/include/node/mac/LoRaMac.h
@@ -51,7 +51,7 @@
 // Includes board dependent definitions such as channels frequencies
 #include "node/mac/LoRaMac-definitions.h"
 #include "node/utilities.h"
-#include "os/os.h"
+#include "os/mynewt.h"
 
 struct lora_pkt_info;
 
diff --git a/net/lora/node/src/lora_app.c b/net/lora/node/src/lora_app.c
index 4a3959319..e5ec05797 100644
--- a/net/lora/node/src/lora_app.c
+++ b/net/lora/node/src/lora_app.c
@@ -16,9 +16,9 @@
  * specific language governing permissions and limitations
  * under the License.
  */
+
 #include <assert.h>
-#include "syscfg/syscfg.h"
-#include "os/os.h"
+#include "os/mynewt.h"
 #include "node/lora.h"
 #include "node/lora_priv.h"
 
diff --git a/net/lora/node/src/lora_cli.c b/net/lora/node/src/lora_cli.c
index 99156fbbf..3162c8055 100644
--- a/net/lora/node/src/lora_cli.c
+++ b/net/lora/node/src/lora_cli.c
@@ -17,14 +17,13 @@
  * under the License.
  */
 
-#include "syscfg/syscfg.h"
+#include "os/mynewt.h"
 
 #if MYNEWT_VAL(LORA_NODE_CLI)
 
 #include <inttypes.h>
 #include <string.h>
 
-#include "sysinit/sysinit.h"
 #include "shell/shell.h"
 #include "console/console.h"
 #include "node/radio.h"
diff --git a/net/lora/node/src/lora_node.c b/net/lora/node/src/lora_node.c
index 0b3fadcb8..9e7c3c1b6 100644
--- a/net/lora/node/src/lora_node.c
+++ b/net/lora/node/src/lora_node.c
@@ -16,9 +16,9 @@
  * specific language governing permissions and limitations
  * under the License.
  */
+
 #include <string.h>
-#include "sysinit/sysinit.h"
-#include "syscfg/syscfg.h"
+#include "os/mynewt.h"
 #include "node/lora_priv.h"
 
 STATS_SECT_DECL(lora_mac_stats) lora_mac_stats;
diff --git a/net/lora/node/src/mac/LoRaMac.c b/net/lora/node/src/mac/LoRaMac.c
index cbff9d1da..70d58d4b0 100644
--- a/net/lora/node/src/mac/LoRaMac.c
+++ b/net/lora/node/src/mac/LoRaMac.c
@@ -20,13 +20,13 @@ License: Revised BSD License, see LICENSE.TXT file include in the project
 
 #include <string.h>
 #include <assert.h>
+#include "os/mynewt.h"
 #include "node/lora.h"
 #include "radio/radio.h"
 #include "node/utilities.h"
 #include "node/mac/LoRaMacCrypto.h"
 #include "node/mac/LoRaMac.h"
 #include "node/mac/LoRaMacTest.h"
-#include "os/os.h"
 #include "hal/hal_timer.h"
 #include "node/lora_priv.h"
 
diff --git a/net/lora/node/src/utilities.c b/net/lora/node/src/utilities.c
index 308d66d3b..d5a0b83e8 100644
--- a/net/lora/node/src/utilities.c
+++ b/net/lora/node/src/utilities.c
@@ -19,8 +19,7 @@
 
 #include <stdlib.h>
 
-#include "syscfg/syscfg.h"
-#include "os/os.h"
+#include "os/mynewt.h"
 #include "node/utilities.h"
 #include "node/lora_priv.h"
 
diff --git a/net/oic/include/oic/messaging/coap/coap.h b/net/oic/include/oic/messaging/coap/coap.h
index d8ffea215..c3eda91e9 100644
--- a/net/oic/include/oic/messaging/coap/coap.h
+++ b/net/oic/include/oic/messaging/coap/coap.h
@@ -37,7 +37,7 @@
 #include <stddef.h> /* for size_t */
 #include <stdint.h>
 
-#include <syscfg/syscfg.h>
+#include "os/mynewt.h"
 
 #include <stats/stats.h>
 
diff --git a/net/oic/include/oic/port/mynewt/config.h b/net/oic/include/oic/port/mynewt/config.h
index 352bdf3cb..ee054b3a6 100644
--- a/net/oic/include/oic/port/mynewt/config.h
+++ b/net/oic/include/oic/port/mynewt/config.h
@@ -8,9 +8,8 @@ extern "C" {
 
 /* Time resolution */
 #include <inttypes.h>
-#include <syscfg/syscfg.h>
+#include "os/mynewt.h"
 
-#include <os/os.h>
 #include <log/log.h>
 
 /* rather than change all their source files, just translate the mynewt
diff --git a/net/oic/include/oic/port/mynewt/transport.h b/net/oic/include/oic/port/mynewt/transport.h
index 0fcc03bd4..64a3c1597 100644
--- a/net/oic/include/oic/port/mynewt/transport.h
+++ b/net/oic/include/oic/port/mynewt/transport.h
@@ -20,8 +20,7 @@
 #ifndef __MYNEWT_TRANSPORT_H_
 #define __MYNEWT_TRANSPORT_H_
 
-#include <os/queue.h>
-
+#include "os/mynewt.h"
 #include "oic/oc_ri.h"
 #include "oic/oc_ri_const.h"
 
diff --git a/net/oic/src/api/oc_buffer.c b/net/oic/src/api/oc_buffer.c
index f875a7a68..9d885c4e1 100644
--- a/net/oic/src/api/oc_buffer.c
+++ b/net/oic/src/api/oc_buffer.c
@@ -13,14 +13,11 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 */
+
 #include <stdint.h>
 #include <stdio.h>
 
-#include <syscfg/syscfg.h>
-
-#include <os/os_eventq.h>
-#include <os/os_mempool.h>
-#include <os/os_mbuf.h>
+#include "os/mynewt.h"
 
 #include "oic/port/mynewt/config.h"
 #include "messaging/coap/engine.h"
diff --git a/net/oic/src/api/oc_client_api.c b/net/oic/src/api/oc_client_api.c
index 789d699fa..bc6bc2df2 100644
--- a/net/oic/src/api/oc_client_api.c
+++ b/net/oic/src/api/oc_client_api.c
@@ -14,7 +14,7 @@
 // limitations under the License.
 */
 
-#include <syscfg/syscfg.h>
+#include "os/mynewt.h"
 
 #include "oic/port/mynewt/config.h"
 #include "oic/messaging/coap/coap.h"
diff --git a/net/oic/src/api/oc_core_res.c b/net/oic/src/api/oc_core_res.c
index f37dd3ade..fc9263696 100644
--- a/net/oic/src/api/oc_core_res.c
+++ b/net/oic/src/api/oc_core_res.c
@@ -14,9 +14,7 @@
  // limitations under the License.
  */
 
-#include <syscfg/syscfg.h>
-
-#include <os/os_mbuf.h>
+#include "os/mynewt.h"
 
 #include "oic/port/mynewt/config.h"
 #include "oic/oc_core_res.h"
diff --git a/net/oic/src/api/oc_discovery.c b/net/oic/src/api/oc_discovery.c
index fafb63db7..2bc46a45e 100644
--- a/net/oic/src/api/oc_discovery.c
+++ b/net/oic/src/api/oc_discovery.c
@@ -14,7 +14,7 @@
 // limitations under the License.
 */
 
-#include <syscfg/syscfg.h>
+#include "os/mynewt.h"
 
 #include "oic/port/mynewt/config.h"
 #ifdef OC_CLIENT
diff --git a/net/oic/src/api/oc_helpers.c b/net/oic/src/api/oc_helpers.c
index ac93dc5b0..2d889d86a 100644
--- a/net/oic/src/api/oc_helpers.c
+++ b/net/oic/src/api/oc_helpers.c
@@ -17,7 +17,7 @@
 #include <stdbool.h>
 #include <stdlib.h>
 
-#include <syscfg/syscfg.h>
+#include "os/mynewt.h"
 
 #include "oic/port/mynewt/config.h"
 #include "oic/oc_helpers.h"
diff --git a/net/oic/src/api/oc_main.c b/net/oic/src/api/oc_main.c
index 9ed238420..23d492087 100644
--- a/net/oic/src/api/oc_main.c
+++ b/net/oic/src/api/oc_main.c
@@ -17,7 +17,7 @@
 #include <stdint.h>
 #include <stdio.h>
 
-#include <syscfg/syscfg.h>
+#include "os/mynewt.h"
 
 #include "oic/port/mynewt/config.h"
 #include "port/oc_assert.h"
diff --git a/net/oic/src/api/oc_rep.c b/net/oic/src/api/oc_rep.c
index 85ac31aa0..04e87f88c 100644
--- a/net/oic/src/api/oc_rep.c
+++ b/net/oic/src/api/oc_rep.c
@@ -16,9 +16,7 @@
 
 #include <stddef.h>
 
-#include <os/os_mempool.h>
-
-#include <syscfg/syscfg.h>
+#include "os/mynewt.h"
 
 #include <tinycbor/cbor_mbuf_writer.h>
 #include <tinycbor/cbor_mbuf_reader.h>
diff --git a/net/oic/src/api/oc_ri.c b/net/oic/src/api/oc_ri.c
index a1211d658..d88f9e021 100644
--- a/net/oic/src/api/oc_ri.c
+++ b/net/oic/src/api/oc_ri.c
@@ -18,11 +18,7 @@
 #include <stddef.h>
 #include <strings.h>
 
-#include <syscfg/syscfg.h>
-
-#include <os/os_callout.h>
-#include <os/os_mempool.h>
-#include <os/queue.h>
+#include "os/mynewt.h"
 
 #include "oic/port/mynewt/config.h"
 
diff --git a/net/oic/src/api/oc_server_api.c b/net/oic/src/api/oc_server_api.c
index 00aaaab82..6e0080e9c 100644
--- a/net/oic/src/api/oc_server_api.c
+++ b/net/oic/src/api/oc_server_api.c
@@ -15,9 +15,7 @@
 */
 #include <stddef.h>
 
-#include <syscfg/syscfg.h>
-
-#include <os/os_callout.h>
+#include "os/mynewt.h"
 
 #include "oic/port/mynewt/config.h"
 #include "messaging/coap/engine.h"
diff --git a/net/oic/src/api/oc_uuid.c b/net/oic/src/api/oc_uuid.c
index 403a447c2..7e040bab9 100644
--- a/net/oic/src/api/oc_uuid.c
+++ b/net/oic/src/api/oc_uuid.c
@@ -19,7 +19,7 @@
 #include <stdio.h>
 #include <string.h>
 
-#include <syscfg/syscfg.h>
+#include "os/mynewt.h"
 
 #include <hal/hal_bsp.h>
 
diff --git a/net/oic/src/messaging/coap/coap.c b/net/oic/src/messaging/coap/coap.c
index c64f0a11a..4b185f936 100644
--- a/net/oic/src/messaging/coap/coap.c
+++ b/net/oic/src/messaging/coap/coap.c
@@ -35,7 +35,7 @@
 #include <string.h>
 #include <assert.h>
 
-#include <syscfg/syscfg.h>
+#include "os/mynewt.h"
 
 #include "oic/port/mynewt/config.h"
 #include "oic/messaging/coap/coap.h"
diff --git a/net/oic/src/messaging/coap/engine.c b/net/oic/src/messaging/coap/engine.c
index 56cf44a15..7c0442a58 100644
--- a/net/oic/src/messaging/coap/engine.c
+++ b/net/oic/src/messaging/coap/engine.c
@@ -35,7 +35,7 @@
 #include <stdlib.h>
 #include <string.h>
 
-#include <syscfg/syscfg.h>
+#include "os/mynewt.h"
 
 #include "oic/port/mynewt/config.h"
 /* OIC Stack headers */
diff --git a/net/oic/src/messaging/coap/observe.c b/net/oic/src/messaging/coap/observe.c
index b14eb8c41..b22daa321 100644
--- a/net/oic/src/messaging/coap/observe.c
+++ b/net/oic/src/messaging/coap/observe.c
@@ -34,10 +34,7 @@
 #include <stdio.h>
 #include <string.h>
 
-#include <syscfg/syscfg.h>
-
-#include <os/os_mempool.h>
-#include <os/queue.h>
+#include "os/mynewt.h"
 
 #include "oic/port/mynewt/config.h"
 
diff --git a/net/oic/src/messaging/coap/separate.c b/net/oic/src/messaging/coap/separate.c
index 9b1259a40..797f722c9 100644
--- a/net/oic/src/messaging/coap/separate.c
+++ b/net/oic/src/messaging/coap/separate.c
@@ -34,9 +34,7 @@
 #include <stdio.h>
 #include <string.h>
 
-#include <syscfg/syscfg.h>
-
-#include <os/os_mempool.h>
+#include "os/mynewt.h"
 
 #include "oic/port/mynewt/config.h"
 
diff --git a/net/oic/src/messaging/coap/transactions.c b/net/oic/src/messaging/coap/transactions.c
index 487dfe12e..b14e7d75d 100644
--- a/net/oic/src/messaging/coap/transactions.c
+++ b/net/oic/src/messaging/coap/transactions.c
@@ -30,13 +30,11 @@
  *
  * This file is part of the Contiki operating system.
  */
+
 #include <string.h>
 #include <stddef.h>
 
-#include <syscfg/syscfg.h>
-
-#include <os/os_callout.h>
-#include <os/os_mempool.h>
+#include "os/mynewt.h"
 
 #include "oic/port/mynewt/config.h"
 #include "oic/messaging/coap/transactions.h"
diff --git a/net/oic/src/port/mynewt/abort.c b/net/oic/src/port/mynewt/abort.c
index 3dbde93a7..edcc462cc 100644
--- a/net/oic/src/port/mynewt/abort.c
+++ b/net/oic/src/port/mynewt/abort.c
@@ -17,10 +17,9 @@
  * under the License.
  */
 
-#include <syscfg/syscfg.h>
-
 #include <assert.h>
 
+#include "os/mynewt.h"
 #include "port/oc_assert.h"
 
 #ifndef abort_impl
diff --git a/net/oic/src/port/mynewt/adaptor.c b/net/oic/src/port/mynewt/adaptor.c
index e589bfd41..f61c19fb9 100644
--- a/net/oic/src/port/mynewt/adaptor.c
+++ b/net/oic/src/port/mynewt/adaptor.c
@@ -16,12 +16,10 @@
  * specific language governing permissions and limitations
  * under the License.
  */
+
 #include <assert.h>
-#include <syscfg/syscfg.h>
-#include <sysinit/sysinit.h>
-#include <os/os.h>
-#include <os/endian.h>
 #include <string.h>
+#include "os/mynewt.h"
 #include <log/log.h>
 #include "oic/oc_log.h"
 #include "oic/oc_ri.h"
diff --git a/net/oic/src/port/mynewt/ble_adaptor.c b/net/oic/src/port/mynewt/ble_adaptor.c
index f66e82380..e0eafa3a9 100644
--- a/net/oic/src/port/mynewt/ble_adaptor.c
+++ b/net/oic/src/port/mynewt/ble_adaptor.c
@@ -21,9 +21,9 @@
 #include <string.h>
 #include <stdint.h>
 
-#include <syscfg/syscfg.h>
+#include "os/mynewt.h"
+
 #if (MYNEWT_VAL(OC_TRANSPORT_GATT) == 1)
-#include <os/os.h>
 
 #include <stats/stats.h>
 #include "oic/oc_gatt.h"
diff --git a/net/oic/src/port/mynewt/clock.c b/net/oic/src/port/mynewt/clock.c
index de9838739..be5ca110f 100644
--- a/net/oic/src/port/mynewt/clock.c
+++ b/net/oic/src/port/mynewt/clock.c
@@ -18,7 +18,7 @@
  */
 
 #include <stdint.h>
-#include <os/os.h>
+#include "os/mynewt.h"
 #include "../oc_clock.h"
 
 void oc_clock_init(void)
diff --git a/net/oic/src/port/mynewt/ip4_adaptor.c b/net/oic/src/port/mynewt/ip4_adaptor.c
index 11cf220e5..d949e42cb 100644
--- a/net/oic/src/port/mynewt/ip4_adaptor.c
+++ b/net/oic/src/port/mynewt/ip4_adaptor.c
@@ -21,12 +21,9 @@
 #include <string.h>
 #include <stdint.h>
 
-#include <syscfg/syscfg.h>
+#include "os/mynewt.h"
 
 #if (MYNEWT_VAL(OC_TRANSPORT_IP) == 1) && (MYNEWT_VAL(OC_TRANSPORT_IPV4) == 1)
-#include <os/os.h>
-#include <os/endian.h>
-
 #include <log/log.h>
 #include <mn_socket/mn_socket.h>
 #include <stats/stats.h>
diff --git a/net/oic/src/port/mynewt/ip_adaptor.c b/net/oic/src/port/mynewt/ip_adaptor.c
index e378d2234..847ca746d 100644
--- a/net/oic/src/port/mynewt/ip_adaptor.c
+++ b/net/oic/src/port/mynewt/ip_adaptor.c
@@ -21,13 +21,10 @@
 #include <string.h>
 #include <stdint.h>
 
-#include <syscfg/syscfg.h>
+#include "os/mynewt.h"
 
 #if (MYNEWT_VAL(OC_TRANSPORT_IP) == 1) && (MYNEWT_VAL(OC_TRANSPORT_IPV6) == 1)
 
-#include <os/os.h>
-#include <os/endian.h>
-
 #include <log/log.h>
 #include <mn_socket/mn_socket.h>
 #include <stats/stats.h>
diff --git a/net/oic/src/port/mynewt/lora_adaptor.c b/net/oic/src/port/mynewt/lora_adaptor.c
index f56ab5165..8f1bb8c8c 100644
--- a/net/oic/src/port/mynewt/lora_adaptor.c
+++ b/net/oic/src/port/mynewt/lora_adaptor.c
@@ -21,11 +21,9 @@
 #include <string.h>
 #include <stdint.h>
 
-#include <syscfg/syscfg.h>
-#if MYNEWT_VAL(OC_TRANSPORT_LORA)
+#include "os/mynewt.h"
 
-#include <os/os.h>
-#include <os/endian.h>
+#if MYNEWT_VAL(OC_TRANSPORT_LORA)
 
 #include <log/log.h>
 #include <stats/stats.h>
diff --git a/net/oic/src/port/mynewt/serial_adaptor.c b/net/oic/src/port/mynewt/serial_adaptor.c
index ec2f9bab3..0bb683222 100644
--- a/net/oic/src/port/mynewt/serial_adaptor.c
+++ b/net/oic/src/port/mynewt/serial_adaptor.c
@@ -20,10 +20,9 @@
 #include <assert.h>
 #include <stdint.h>
 
-#include <syscfg/syscfg.h>
-#if (MYNEWT_VAL(OC_TRANSPORT_SERIAL) == 1)
+#include "os/mynewt.h"
 
-#include <os/os.h>
+#if (MYNEWT_VAL(OC_TRANSPORT_SERIAL) == 1)
 
 #include <shell/shell.h>
 
diff --git a/net/oic/src/port/oc_clock.h b/net/oic/src/port/oc_clock.h
index 10f5b7557..e53582a7d 100644
--- a/net/oic/src/port/oc_clock.h
+++ b/net/oic/src/port/oc_clock.h
@@ -52,7 +52,7 @@
 
 #include <stdint.h>
 
-#include <syscfg/syscfg.h>
+#include "os/mynewt.h"
 
 #include "oic/port/mynewt/config.h"
 
diff --git a/net/oic/test/src/test_discovery.c b/net/oic/test/src/test_discovery.c
index 3923b8e30..acc32ee08 100644
--- a/net/oic/test/src/test_discovery.c
+++ b/net/oic/test/src/test_discovery.c
@@ -16,11 +16,11 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-#include "test_oic.h"
 
-#include <os/os.h>
+#include "os/mynewt.h"
 #include <oic/oc_api.h>
 #include <oic/port/mynewt/ip.h>
+#include "test_oic.h"
 
 static int test_discovery_state;
 static volatile int test_discovery_done;
diff --git a/net/oic/test/src/test_getset.c b/net/oic/test/src/test_getset.c
index ff596575a..6c6c1a195 100644
--- a/net/oic/test/src/test_getset.c
+++ b/net/oic/test/src/test_getset.c
@@ -16,10 +16,10 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-#include "test_oic.h"
 
-#include <os/os.h>
+#include "os/mynewt.h"
 #include <oic/oc_api.h>
+#include "test_oic.h"
 
 static int test_getset_state;
 static volatile int test_getset_done;
diff --git a/net/oic/test/src/test_observe.c b/net/oic/test/src/test_observe.c
index d6b29089c..e0a71ef46 100644
--- a/net/oic/test/src/test_observe.c
+++ b/net/oic/test/src/test_observe.c
@@ -16,12 +16,11 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-#include "test_oic.h"
 
-#include <os/os.h>
+#include "os/mynewt.h"
 #include <oic/oc_api.h>
-
 #include <cborattr/cborattr.h>
+#include "test_oic.h"
 
 static int test_observe_state;
 static volatile int test_observe_done;
diff --git a/net/oic/test/src/test_oic.c b/net/oic/test/src/test_oic.c
index 175ce86a0..cd485bfb4 100644
--- a/net/oic/test/src/test_oic.c
+++ b/net/oic/test/src/test_oic.c
@@ -17,8 +17,7 @@
  * under the License.
  */
 
-#include "sysinit/sysinit.h"
-#include "syscfg/syscfg.h"
+#include "os/mynewt.h"
 #include "testutil/testutil.h"
 #include "test_oic.h"
 
diff --git a/net/oic/test/src/testcases/oic_tests.c b/net/oic/test/src/testcases/oic_tests.c
index aefdb3eda..77d1bff38 100644
--- a/net/oic/test/src/testcases/oic_tests.c
+++ b/net/oic/test/src/testcases/oic_tests.c
@@ -16,12 +16,11 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-#include "test_oic.h"
 
-#include <os/os.h>
+#include "os/mynewt.h"
 #include <oic/oc_api.h>
-
 #include <mn_socket/mn_socket.h>
+#include "test_oic.h"
 
 #define OIC_TAPP_PRIO       9
 #define OIC_TAPP_STACK_SIZE OS_STACK_ALIGN(1024)
diff --git a/net/wifi/wifi_mgmt/include/wifi_mgmt/wifi_mgmt.h b/net/wifi/wifi_mgmt/include/wifi_mgmt/wifi_mgmt.h
index fe25d77b7..903bb5191 100644
--- a/net/wifi/wifi_mgmt/include/wifi_mgmt/wifi_mgmt.h
+++ b/net/wifi/wifi_mgmt/include/wifi_mgmt/wifi_mgmt.h
@@ -19,7 +19,7 @@
 #ifndef __WIFI_MGMT_H__
 #define __WIFI_MGMT_H__
 
-#include <os/os.h>
+#include "os/mynewt.h"
 
 #ifdef __cplusplus
 extern "C" {
diff --git a/net/wifi/wifi_mgmt/include/wifi_mgmt/wifi_mgmt_if.h b/net/wifi/wifi_mgmt/include/wifi_mgmt/wifi_mgmt_if.h
index 028376c3c..8f1d8ed23 100644
--- a/net/wifi/wifi_mgmt/include/wifi_mgmt/wifi_mgmt_if.h
+++ b/net/wifi/wifi_mgmt/include/wifi_mgmt/wifi_mgmt_if.h
@@ -19,7 +19,7 @@
 #ifndef __WIFI_MGMT_IF_H__
 #define __WIFI_MGMT_IF_H__
 
-#include <os/os.h>
+#include "os/mynewt.h"
 
 #ifdef __cplusplus
 extern "C" {
diff --git a/net/wifi/wifi_mgmt/src/wifi.c b/net/wifi/wifi_mgmt/src/wifi.c
index 75cdd6ae6..5f4f68971 100644
--- a/net/wifi/wifi_mgmt/src/wifi.c
+++ b/net/wifi/wifi_mgmt/src/wifi.c
@@ -16,11 +16,12 @@
  * specific language governing permissions and limitations
  * under the License.
  */
+
 #include <stddef.h>
 #include <string.h>
 #include <assert.h>
 
-#include <os/os.h>
+#include "os/mynewt.h"
 #include <bsp/bsp.h>
 #include <hal/hal_gpio.h>
 #include <shell/shell.h>
diff --git a/net/wifi/wifi_mgmt/src/wifi_cli.c b/net/wifi/wifi_mgmt/src/wifi_cli.c
index 56b2a706e..b56d316a1 100644
--- a/net/wifi/wifi_mgmt/src/wifi_cli.c
+++ b/net/wifi/wifi_mgmt/src/wifi_cli.c
@@ -17,7 +17,7 @@
  * under the License.
  */
 
-#include "syscfg/syscfg.h"
+#include "os/mynewt.h"
 
 #if MYNEWT_VAL(WIFI_MGMT_CLI)
 
diff --git a/net/wifi/wifi_mgmt/src/wifi_priv.h b/net/wifi/wifi_mgmt/src/wifi_priv.h
index c34060358..5e0f48022 100644
--- a/net/wifi/wifi_mgmt/src/wifi_priv.h
+++ b/net/wifi/wifi_mgmt/src/wifi_priv.h
@@ -20,7 +20,7 @@
 #ifndef __WIFI_PRIV_H__
 #define __WIFI_PRIV_H__
 
-#include "syscfg/syscfg.h"
+#include "os/mynewt.h"
 
 #ifdef __cplusplus
 extern "C" {
diff --git a/sys/config/include/config/config.h b/sys/config/include/config/config.h
index 31a759883..3d4beceda 100644
--- a/sys/config/include/config/config.h
+++ b/sys/config/include/config/config.h
@@ -19,8 +19,8 @@
 #ifndef __SYS_CONFIG_H_
 #define __SYS_CONFIG_H_
 
-#include <os/queue.h>
 #include <stdint.h>
+#include "os/mynewt.h"
 
 #ifdef __cplusplus
 extern "C" {
diff --git a/sys/config/src/config.c b/sys/config/src/config.c
index 67d4d2c06..0793dc464 100644
--- a/sys/config/src/config.c
+++ b/sys/config/src/config.c
@@ -20,9 +20,7 @@
 #include <string.h>
 #include <stdio.h>
 
-#include "sysinit/sysinit.h"
-#include "syscfg/syscfg.h"
-#include "os/os.h"
+#include "os/mynewt.h"
 #include "base64/base64.h"
 
 #include "config/config.h"
diff --git a/sys/config/src/config_cli.c b/sys/config/src/config_cli.c
index 6912de1b7..37b29e6f4 100644
--- a/sys/config/src/config_cli.c
+++ b/sys/config/src/config_cli.c
@@ -19,7 +19,7 @@
 
 #include <stddef.h>
 
-#include "syscfg/syscfg.h"
+#include "os/mynewt.h"
 #include "config/config.h"
 #include "config_priv.h"
 
diff --git a/sys/config/src/config_fcb.c b/sys/config/src/config_fcb.c
index 080ad450d..d2554d683 100644
--- a/sys/config/src/config_fcb.c
+++ b/sys/config/src/config_fcb.c
@@ -17,11 +17,10 @@
  * under the License.
  */
 
-#include "syscfg/syscfg.h"
+#include "os/mynewt.h"
 
 #if MYNEWT_VAL(CONFIG_FCB)
 
-#include <os/os.h>
 #include <fcb/fcb.h>
 #include <string.h>
 
diff --git a/sys/config/src/config_file.c b/sys/config/src/config_file.c
index 41cd21890..9841a8bbe 100644
--- a/sys/config/src/config_file.c
+++ b/sys/config/src/config_file.c
@@ -17,14 +17,13 @@
  * under the License.
  */
 
-#include "syscfg/syscfg.h"
+#include "os/mynewt.h"
 
 #if MYNEWT_VAL(CONFIG_NFFS)
 
 #include <string.h>
 #include <assert.h>
 
-#include <os/os.h>
 #include <fs/fs.h>
 
 #include "config/config.h"
diff --git a/sys/config/src/config_init.c b/sys/config/src/config_init.c
index 9af1d8407..3ae293d54 100644
--- a/sys/config/src/config_init.c
+++ b/sys/config/src/config_init.c
@@ -19,9 +19,7 @@
 
 #include <assert.h>
 
-#include "sysinit/sysinit.h"
-#include "syscfg/syscfg.h"
-#include "sysflash/sysflash.h"
+#include "os/mynewt.h"
 #include "bsp/bsp.h"
 
 #include "config/config.h"
diff --git a/sys/config/src/config_json_line.c b/sys/config/src/config_json_line.c
index 1d4c273a7..fe6e12d83 100644
--- a/sys/config/src/config_json_line.c
+++ b/sys/config/src/config_json_line.c
@@ -17,7 +17,7 @@
  * under the License.
  */
 
-#include "syscfg/syscfg.h"
+#include "os/mynewt.h"
 
 #if MYNEWT_VAL(CONFIG_NEWTMGR)
 
diff --git a/sys/config/src/config_nmgr.c b/sys/config/src/config_nmgr.c
index 0b42bc60a..464132c9c 100644
--- a/sys/config/src/config_nmgr.c
+++ b/sys/config/src/config_nmgr.c
@@ -17,7 +17,7 @@
  * under the License.
  */
 
-#include "syscfg/syscfg.h"
+#include "os/mynewt.h"
 
 #if MYNEWT_VAL(CONFIG_NEWTMGR)
 
diff --git a/sys/config/src/config_store.c b/sys/config/src/config_store.c
index 3501adf78..3e7d0842f 100644
--- a/sys/config/src/config_store.c
+++ b/sys/config/src/config_store.c
@@ -20,8 +20,7 @@
 #include <string.h>
 #include <stdio.h>
 
-#include <os/os.h>
-
+#include "os/mynewt.h"
 #include "config/config.h"
 #include "config_priv.h"
 
diff --git a/sys/config/test-fcb/src/conf_test_fcb.c b/sys/config/test-fcb/src/conf_test_fcb.c
index fabad344b..49afd6155 100644
--- a/sys/config/test-fcb/src/conf_test_fcb.c
+++ b/sys/config/test-fcb/src/conf_test_fcb.c
@@ -16,11 +16,11 @@
  * specific language governing permissions and limitations
  * under the License.
  */
+
 #include <stdio.h>
 #include <string.h>
 
-#include "sysinit/sysinit.h"
-#include <os/os.h>
+#include "os/mynewt.h"
 #include <flash_map/flash_map.h>
 #include <testutil/testutil.h>
 #include <fcb/fcb.h>
diff --git a/sys/config/test-fcb/src/conf_test_fcb.h b/sys/config/test-fcb/src/conf_test_fcb.h
index a5338ff0e..66cc7ce16 100644
--- a/sys/config/test-fcb/src/conf_test_fcb.h
+++ b/sys/config/test-fcb/src/conf_test_fcb.h
@@ -21,8 +21,7 @@
 
 #include <stdio.h>
 #include <string.h>
-#include <syscfg/syscfg.h>
-#include <os/os.h>
+#include "os/mynewt.h"
 #include <flash_map/flash_map.h>
 #include <testutil/testutil.h>
 #include <fcb/fcb.h>
diff --git a/sys/config/test-nffs/src/conf_test_nffs.c b/sys/config/test-nffs/src/conf_test_nffs.c
index 420f1ae0c..9f7e80cf5 100644
--- a/sys/config/test-nffs/src/conf_test_nffs.c
+++ b/sys/config/test-nffs/src/conf_test_nffs.c
@@ -16,11 +16,11 @@
  * specific language governing permissions and limitations
  * under the License.
  */
+
 #include <stdio.h>
 #include <string.h>
 
-#include "sysinit/sysinit.h"
-#include <os/os.h>
+#include "os/mynewt.h"
 #include <testutil/testutil.h>
 #include <nffs/nffs.h>
 #include <fs/fs.h>
diff --git a/sys/config/test-nffs/src/conf_test_nffs.h b/sys/config/test-nffs/src/conf_test_nffs.h
index 44ce61436..9a42190b9 100644
--- a/sys/config/test-nffs/src/conf_test_nffs.h
+++ b/sys/config/test-nffs/src/conf_test_nffs.h
@@ -22,9 +22,8 @@
 #include <stdio.h>
 #include <string.h>
 
-#include "syscfg/syscfg.h"
+#include "os/mynewt.h"
 
-#include <os/os.h>
 #include <testutil/testutil.h>
 #include <nffs/nffs.h>
 #include <fs/fs.h>
diff --git a/sys/console/full/include/console/console.h b/sys/console/full/include/console/console.h
index 533a7f6a4..9a32ed1b4 100644
--- a/sys/console/full/include/console/console.h
+++ b/sys/console/full/include/console/console.h
@@ -21,7 +21,7 @@
 #define __CONSOLE_H__
 
 #include <inttypes.h>
-#include "syscfg/syscfg.h"
+#include "os/mynewt.h"
 
 #ifdef __cplusplus
 extern "C" {
diff --git a/sys/console/full/src/ble_monitor_console.c b/sys/console/full/src/ble_monitor_console.c
index 06b8e5359..d25bfdbd1 100644
--- a/sys/console/full/src/ble_monitor_console.c
+++ b/sys/console/full/src/ble_monitor_console.c
@@ -17,7 +17,7 @@
  * under the License.
  */
 
-#include <syscfg/syscfg.h>
+#include "os/mynewt.h"
 
 #if MYNEWT_VAL(CONSOLE_BLE_MONITOR)
 
diff --git a/sys/console/full/src/console.c b/sys/console/full/src/console.c
index 44cd4c27d..d7a15bca6 100644
--- a/sys/console/full/src/console.c
+++ b/sys/console/full/src/console.c
@@ -24,9 +24,7 @@
 #include <stdio.h>
 #include <string.h>
 
-#include "syscfg/syscfg.h"
-#include "os/os.h"
-#include "sysinit/sysinit.h"
+#include "os/mynewt.h"
 #include "console/console.h"
 #include "console/ticks.h"
 #include "console_priv.h"
diff --git a/sys/console/full/src/console_fmt.c b/sys/console/full/src/console_fmt.c
index 32b68e302..89c624d1d 100644
--- a/sys/console/full/src/console_fmt.c
+++ b/sys/console/full/src/console_fmt.c
@@ -18,10 +18,9 @@
  */
 #include <stdarg.h>
 #include <stdio.h>
-#include "syscfg/syscfg.h"
+#include "os/mynewt.h"
 #include "console/console.h"
 #include "console/ticks.h"
-#include "os/os_time.h"
 
 #define CONS_OUTPUT_MAX_LINE    128
 
diff --git a/sys/console/full/src/rtt_console.c b/sys/console/full/src/rtt_console.c
index b676ffad8..b678e965b 100644
--- a/sys/console/full/src/rtt_console.c
+++ b/sys/console/full/src/rtt_console.c
@@ -17,13 +17,11 @@
  * under the License.
  */
 
-#include "syscfg/syscfg.h"
+#include "os/mynewt.h"
 
 #if MYNEWT_VAL(CONSOLE_RTT)
 #include <ctype.h>
 
-#include "os/os.h"
-#include "os/os_cputime.h"
 #include "rtt/SEGGER_RTT.h"
 #include "console/console.h"
 #include "console_priv.h"
diff --git a/sys/console/full/src/ticks.c b/sys/console/full/src/ticks.c
index 06d1c8f3c..3d59b94f1 100644
--- a/sys/console/full/src/ticks.c
+++ b/sys/console/full/src/ticks.c
@@ -17,8 +17,7 @@
  * under the License.
  */
 
-
-#include "syscfg/syscfg.h"
+#include "os/mynewt.h"
 #include "console/console.h"
 #include "console/prompt.h"
 
diff --git a/sys/console/full/src/uart_console.c b/sys/console/full/src/uart_console.c
index 5d708f140..629a885c5 100644
--- a/sys/console/full/src/uart_console.c
+++ b/sys/console/full/src/uart_console.c
@@ -17,13 +17,12 @@
  * under the License.
  */
 
-#include "syscfg/syscfg.h"
+#include "os/mynewt.h"
 
 #if MYNEWT_VAL(CONSOLE_UART)
 #include <ctype.h>
 #include <assert.h>
 
-#include "os/os.h"
 #include "uart/uart.h"
 #include "bsp/bsp.h"
 
diff --git a/sys/console/minimal/include/console/console.h b/sys/console/minimal/include/console/console.h
index ede72692e..433400819 100644
--- a/sys/console/minimal/include/console/console.h
+++ b/sys/console/minimal/include/console/console.h
@@ -21,7 +21,7 @@
 #define __CONSOLE_H__
 
 #include <inttypes.h>
-#include "syscfg/syscfg.h"
+#include "os/mynewt.h"
 
 #ifdef __cplusplus
 extern "C" {
diff --git a/sys/console/minimal/src/console.c b/sys/console/minimal/src/console.c
index 8fd0a176f..151faccd3 100644
--- a/sys/console/minimal/src/console.c
+++ b/sys/console/minimal/src/console.c
@@ -24,9 +24,7 @@
 #include <stdio.h>
 #include <string.h>
 
-#include "syscfg/syscfg.h"
-#include "os/os.h"
-#include "sysinit/sysinit.h"
+#include "os/mynewt.h"
 #include "console/console.h"
 #include "console_priv.h"
 
diff --git a/sys/console/minimal/src/rtt_console.c b/sys/console/minimal/src/rtt_console.c
index b676ffad8..b678e965b 100644
--- a/sys/console/minimal/src/rtt_console.c
+++ b/sys/console/minimal/src/rtt_console.c
@@ -17,13 +17,11 @@
  * under the License.
  */
 
-#include "syscfg/syscfg.h"
+#include "os/mynewt.h"
 
 #if MYNEWT_VAL(CONSOLE_RTT)
 #include <ctype.h>
 
-#include "os/os.h"
-#include "os/os_cputime.h"
 #include "rtt/SEGGER_RTT.h"
 #include "console/console.h"
 #include "console_priv.h"
diff --git a/sys/console/minimal/src/uart_console.c b/sys/console/minimal/src/uart_console.c
index df33cc7e3..7c3a72e5a 100644
--- a/sys/console/minimal/src/uart_console.c
+++ b/sys/console/minimal/src/uart_console.c
@@ -17,13 +17,12 @@
  * under the License.
  */
 
-#include "syscfg/syscfg.h"
+#include "os/mynewt.h"
 
 #if MYNEWT_VAL(CONSOLE_UART)
 #include <ctype.h>
 #include <assert.h>
 
-#include "os/os.h"
 #include "uart/uart.h"
 #include "bsp/bsp.h"
 
diff --git a/sys/coredump/src/coredump.c b/sys/coredump/src/coredump.c
index 88b35771f..057226650 100644
--- a/sys/coredump/src/coredump.c
+++ b/sys/coredump/src/coredump.c
@@ -19,8 +19,7 @@
 
 #include <stddef.h>
 #include <limits.h>
-#include "syscfg/syscfg.h"
-#include "sysflash/sysflash.h"
+#include "os/mynewt.h"
 #include "hal/hal_bsp.h"
 #include "flash_map/flash_map.h"
 #include "bootutil/image.h"
diff --git a/sys/flash_map/src/flash_map.c b/sys/flash_map/src/flash_map.c
index ddc702038..cea44d97d 100644
--- a/sys/flash_map/src/flash_map.c
+++ b/sys/flash_map/src/flash_map.c
@@ -21,11 +21,7 @@
 #include <string.h>
 #include <assert.h>
 
-#include <os/os.h>
-#include "syscfg/syscfg.h"
-#include "sysinit/sysinit.h"
-#include "sysflash/sysflash.h"
-#include "defs/error.h"
+#include "os/mynewt.h"
 #include "hal/hal_bsp.h"
 #include "hal/hal_flash.h"
 #include "hal/hal_flash_int.h"
diff --git a/sys/flash_map/test/src/flash_map_test.c b/sys/flash_map/test/src/flash_map_test.c
index c0c55afb7..cf2e8292e 100644
--- a/sys/flash_map/test/src/flash_map_test.c
+++ b/sys/flash_map/test/src/flash_map_test.c
@@ -16,13 +16,11 @@
  * specific language governing permissions and limitations
  * under the License.
  */
+
 #include <stdio.h>
 #include <string.h>
 
-#include "sysinit/sysinit.h"
-#include "syscfg/syscfg.h"
-#include "sysflash/sysflash.h"
-#include "os/os.h"
+#include "os/mynewt.h"
 #include "testutil/testutil.h"
 #include "flash_map/flash_map.h"
 #include "hal/hal_bsp.h"
diff --git a/sys/flash_map/test/src/flash_map_test.h b/sys/flash_map/test/src/flash_map_test.h
index afb650931..883327929 100644
--- a/sys/flash_map/test/src/flash_map_test.h
+++ b/sys/flash_map/test/src/flash_map_test.h
@@ -21,10 +21,7 @@
 #include <stdio.h>
 #include <string.h>
 
-#include "sysinit/sysinit.h"
-#include "syscfg/syscfg.h"
-#include "sysflash/sysflash.h"
-#include "os/os.h"
+#include "os/mynewt.h"
 #include "testutil/testutil.h"
 #include "flash_map/flash_map.h"
 #include "hal/hal_bsp.h"
diff --git a/sys/id/src/id.c b/sys/id/src/id.c
index 5548f5f68..34eb8f7f8 100644
--- a/sys/id/src/id.c
+++ b/sys/id/src/id.c
@@ -16,14 +16,14 @@
  * specific language governing permissions and limitations
  * under the License.
  */
+
 #include <inttypes.h>
 #include <string.h>
 #include <stdio.h>
 #include <assert.h>
 
-#include "sysinit/sysinit.h"
+#include "os/mynewt.h"
 #include "hal/hal_bsp.h"
-#include "os/os.h"
 #include "config/config.h"
 #include "base64/base64.h"
 #include "mfg/mfg.h"
diff --git a/sys/log/full/include/log/log.h b/sys/log/full/include/log/log.h
index 7bb5174e4..22464ce2b 100644
--- a/sys/log/full/include/log/log.h
+++ b/sys/log/full/include/log/log.h
@@ -19,12 +19,10 @@
 #ifndef __SYS_LOG_FULL_H__
 #define __SYS_LOG_FULL_H__
 
-#include "syscfg/syscfg.h"
+#include "os/mynewt.h"
 #include "log/ignore.h"
 #include "cbmem/cbmem.h"
 
-#include <os/queue.h>
-
 #ifdef __cplusplus
 extern "C" {
 #endif
diff --git a/sys/log/full/src/log.c b/sys/log/full/src/log.c
index 609972962..0b538f939 100644
--- a/sys/log/full/src/log.c
+++ b/sys/log/full/src/log.c
@@ -22,9 +22,7 @@
 #include <stdio.h>
 #include <stdarg.h>
 
-#include "sysinit/sysinit.h"
-#include "syscfg/syscfg.h"
-#include "os/os.h"
+#include "os/mynewt.h"
 #include "cbmem/cbmem.h"
 #include "log/log.h"
 
diff --git a/sys/log/full/src/log_cbmem.c b/sys/log/full/src/log_cbmem.c
index 982a4c94e..4c173ae2d 100644
--- a/sys/log/full/src/log_cbmem.c
+++ b/sys/log/full/src/log_cbmem.c
@@ -16,7 +16,8 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-#include <os/os.h>
+
+#include "os/mynewt.h"
 #include <cbmem/cbmem.h>
 #include "log/log.h"
 
diff --git a/sys/log/full/src/log_console.c b/sys/log/full/src/log_console.c
index 2fd1d972d..dc9070e71 100644
--- a/sys/log/full/src/log_console.c
+++ b/sys/log/full/src/log_console.c
@@ -17,11 +17,10 @@
  * under the License.
  */
 
-#include <syscfg/syscfg.h>
+#include "os/mynewt.h"
 
 #if MYNEWT_VAL(LOG_CONSOLE)
 
-#include <os/os.h>
 #include <cbmem/cbmem.h>
 #include <console/console.h>
 #include "log/log.h"
diff --git a/sys/log/full/src/log_fcb.c b/sys/log/full/src/log_fcb.c
index 91247b8bc..7e8e228cf 100644
--- a/sys/log/full/src/log_fcb.c
+++ b/sys/log/full/src/log_fcb.c
@@ -17,15 +17,12 @@
  * under the License.
  */
 
-#include "syscfg/syscfg.h"
-#include "sysflash/sysflash.h"
+#include "os/mynewt.h"
 
 #if MYNEWT_VAL(LOG_FCB)
 
 #include <string.h>
 
-#include "os/os.h"
-
 #include "flash_map/flash_map.h"
 #include "fcb/fcb.h"
 #include "log/log.h"
diff --git a/sys/log/full/src/log_nmgr.c b/sys/log/full/src/log_nmgr.c
index 8615fb7d7..e0f569227 100644
--- a/sys/log/full/src/log_nmgr.c
+++ b/sys/log/full/src/log_nmgr.c
@@ -17,11 +17,10 @@
  * under the License.
  */
 
-#include <os/os.h>
 #include <string.h>
 #include <stdio.h>
 
-#include "syscfg/syscfg.h"
+#include "os/mynewt.h"
 
 #if MYNEWT_VAL(LOG_NEWTMGR)
 
diff --git a/sys/log/full/src/log_shell.c b/sys/log/full/src/log_shell.c
index c8e41c7ae..87bc45b28 100644
--- a/sys/log/full/src/log_shell.c
+++ b/sys/log/full/src/log_shell.c
@@ -17,7 +17,7 @@
  * under the License.
  */
 
-#include "syscfg/syscfg.h"
+#include "os/mynewt.h"
 
 /* This whole file is conditionally compiled based on whether the
  * log package is configured to use the shell (MYNEWT_VAL(LOG_CLI)).
@@ -28,7 +28,6 @@
 #include <stdio.h>
 #include <string.h>
 
-#include "os/os.h"
 #include "cbmem/cbmem.h"
 #include "log/log.h"
 #include "shell/shell.h"
diff --git a/sys/log/full/test/src/log_test.c b/sys/log/full/test/src/log_test.c
index a3a6bf824..58eda1fbc 100644
--- a/sys/log/full/test/src/log_test.c
+++ b/sys/log/full/test/src/log_test.c
@@ -18,9 +18,7 @@
  */
 #include <string.h>
 
-#include "sysinit/sysinit.h"
-#include "syscfg/syscfg.h"
-#include "os/os.h"
+#include "os/mynewt.h"
 #include "testutil/testutil.h"
 #include "fcb/fcb.h"
 #include "log/log.h"
diff --git a/sys/log/full/test/src/log_test.h b/sys/log/full/test/src/log_test.h
index 9b7a5e01e..d935c4c37 100644
--- a/sys/log/full/test/src/log_test.h
+++ b/sys/log/full/test/src/log_test.h
@@ -20,8 +20,7 @@
 #define _LOG_TEST_H
 #include <string.h>
 
-#include "syscfg/syscfg.h"
-#include "os/os.h"
+#include "os/mynewt.h"
 #include "testutil/testutil.h"
 #include "fcb/fcb.h"
 #include "log/log.h"
diff --git a/sys/log/stub/include/log/log.h b/sys/log/stub/include/log/log.h
index ac4d7e7f1..c7756d987 100644
--- a/sys/log/stub/include/log/log.h
+++ b/sys/log/stub/include/log/log.h
@@ -20,7 +20,7 @@
 #define __SYS_LOG_STUB_H__
 
 #include <inttypes.h>
-#include "syscfg/syscfg.h"
+#include "os/mynewt.h"
 #include "log/ignore.h"
 
 #ifdef __cplusplus
diff --git a/sys/mfg/src/mfg.c b/sys/mfg/src/mfg.c
index 41059843e..568477623 100644
--- a/sys/mfg/src/mfg.c
+++ b/sys/mfg/src/mfg.c
@@ -18,11 +18,7 @@
  */
 
 #include <string.h>
-
-#include "sysinit/sysinit.h"
-#include "sysflash/sysflash.h"
-
-#include "os/os.h"
+#include "os/mynewt.h"
 #include "mfg/mfg.h"
 
 /**
diff --git a/sys/reboot/src/log_reboot.c b/sys/reboot/src/log_reboot.c
index c645338e4..106c84e67 100644
--- a/sys/reboot/src/log_reboot.c
+++ b/sys/reboot/src/log_reboot.c
@@ -19,10 +19,7 @@
 
 #include <string.h>
 #include <assert.h>
-#include "sysinit/sysinit.h"
-#include "syscfg/syscfg.h"
-#include "sysflash/sysflash.h"
-#include "os/os.h"
+#include "os/mynewt.h"
 #include "log/log.h"
 #include "bootutil/image.h"
 #include "bootutil/bootutil.h"
diff --git a/sys/shell/include/shell/shell.h b/sys/shell/include/shell/shell.h
index 065b7e458..859b9faad 100644
--- a/sys/shell/include/shell/shell.h
+++ b/sys/shell/include/shell/shell.h
@@ -24,7 +24,7 @@
 extern "C" {
 #endif
 
-#include "syscfg/syscfg.h"
+#include "os/mynewt.h"
 
 struct os_eventq;
 
diff --git a/sys/shell/src/shell.c b/sys/shell/src/shell.c
index a6943229d..09f199b61 100644
--- a/sys/shell/src/shell.c
+++ b/sys/shell/src/shell.c
@@ -21,10 +21,8 @@
 #include <string.h>
 #include <assert.h>
 
-#include "syscfg/syscfg.h"
-#include "os/os.h"
+#include "os/mynewt.h"
 #include "console/console.h"
-#include "sysinit/sysinit.h"
 #include "shell/shell.h"
 #include "shell_priv.h"
 
diff --git a/sys/shell/src/shell_nlip.c b/sys/shell/src/shell_nlip.c
index e967cd269..2cd2ae387 100644
--- a/sys/shell/src/shell_nlip.c
+++ b/sys/shell/src/shell_nlip.c
@@ -17,12 +17,10 @@
  * under the License.
  */
 
-#include "syscfg/syscfg.h"
+#include "os/mynewt.h"
 
 #if MYNEWT_VAL(SHELL_NEWTMGR)
 #include <stddef.h>
-#include "os/os.h"
-#include "os/endian.h"
 #include "base64/base64.h"
 #include "crc/crc16.h"
 #include "console/console.h"
diff --git a/sys/shell/src/shell_os.c b/sys/shell/src/shell_os.c
index 709b95216..a198da4ef 100644
--- a/sys/shell/src/shell_os.c
+++ b/sys/shell/src/shell_os.c
@@ -20,9 +20,7 @@
 #include <assert.h>
 #include <string.h>
 
-#include "syscfg/syscfg.h"
-#include "sysinit/sysinit.h"
-#include "os/os.h"
+#include "os/mynewt.h"
 #include "datetime/datetime.h"
 #include "console/console.h"
 
diff --git a/sys/shell/src/shell_prompt.c b/sys/shell/src/shell_prompt.c
index 1982e770d..0a88500df 100644
--- a/sys/shell/src/shell_prompt.c
+++ b/sys/shell/src/shell_prompt.c
@@ -20,8 +20,7 @@
 #include <stdio.h>
 #include <string.h>
 
-#include "syscfg/syscfg.h"
-#include "os/os.h"
+#include "os/mynewt.h"
 #include "console/console.h"
 #include "console/ticks.h"
 
diff --git a/sys/stats/full/include/stats/stats.h b/sys/stats/full/include/stats/stats.h
index 5de014292..b6a876c63 100644
--- a/sys/stats/full/include/stats/stats.h
+++ b/sys/stats/full/include/stats/stats.h
@@ -21,8 +21,7 @@
 
 #include <stddef.h>
 #include <stdint.h>
-#include "syscfg/syscfg.h"
-#include "os/queue.h"
+#include "os/mynewt.h"
 
 #ifdef __cplusplus
 extern "C" {
diff --git a/sys/stats/full/src/stats.c b/sys/stats/full/src/stats.c
index b2009f636..efff11e36 100644
--- a/sys/stats/full/src/stats.c
+++ b/sys/stats/full/src/stats.c
@@ -21,9 +21,7 @@
 #include <string.h>
 #include <stdio.h>
 
-#include "sysinit/sysinit.h"
-#include "syscfg/syscfg.h"
-#include "os/os.h"
+#include "os/mynewt.h"
 #include "stats/stats.h"
 
 /**
diff --git a/sys/stats/full/src/stats_nmgr.c b/sys/stats/full/src/stats_nmgr.c
index 0b28b25bc..0dbba3f13 100644
--- a/sys/stats/full/src/stats_nmgr.c
+++ b/sys/stats/full/src/stats_nmgr.c
@@ -20,11 +20,10 @@
 #include <string.h>
 #include <stdio.h>
 
-#include "syscfg/syscfg.h"
+#include "os/mynewt.h"
 
 #if MYNEWT_VAL(STATS_NEWTMGR)
 
-#include "os/os.h"
 #include "mgmt/mgmt.h"
 #include "cborattr/cborattr.h"
 #include "stats/stats.h"
diff --git a/sys/stats/full/src/stats_shell.c b/sys/stats/full/src/stats_shell.c
index 84b80ac34..983d9ae42 100644
--- a/sys/stats/full/src/stats_shell.c
+++ b/sys/stats/full/src/stats_shell.c
@@ -17,7 +17,7 @@
  * under the License.
  */
 
-#include "syscfg/syscfg.h"
+#include "os/mynewt.h"
 
 /* Source code is only included if the shell library is enabled.  Otherwise
  * this file is compiled out for code size.
@@ -27,7 +27,6 @@
 #include <string.h>
 #include "shell/shell.h"
 #include "console/console.h"
-#include "os/os.h"
 #include "stats/stats.h"
 
 static int shell_stats_display(int argc, char **argv);
diff --git a/sys/stats/stub/include/stats/stats.h b/sys/stats/stub/include/stats/stats.h
index ac2a182f1..af6603b5e 100644
--- a/sys/stats/stub/include/stats/stats.h
+++ b/sys/stats/stub/include/stats/stats.h
@@ -20,8 +20,7 @@
 #define __UTIL_STATS_H__
 
 #include <stdint.h>
-#include "syscfg/syscfg.h"
-#include "os/queue.h"
+#include "os/mynewt.h"
 
 #ifdef __cplusplus
 extern "C" {
diff --git a/sys/sysinit/include/sysinit/sysinit.h b/sys/sysinit/include/sysinit/sysinit.h
index 7694c428a..9c0a2bf5c 100644
--- a/sys/sysinit/include/sysinit/sysinit.h
+++ b/sys/sysinit/include/sysinit/sysinit.h
@@ -22,7 +22,7 @@
 
 #include <inttypes.h>
 #include <assert.h>
-#include "syscfg/syscfg.h"
+#include "os/mynewt.h"
 
 #if MYNEWT_VAL(SPLIT_APPLICATION)
 #include "split/split.h"
diff --git a/sys/sysinit/src/sysinit.c b/sys/sysinit/src/sysinit.c
index 393d1c54c..abc30eb38 100644
--- a/sys/sysinit/src/sysinit.c
+++ b/sys/sysinit/src/sysinit.c
@@ -20,9 +20,7 @@
 #include <stdio.h>
 #include <stddef.h>
 #include <limits.h>
-#include "os/os_fault.h"
-#include "syscfg/syscfg.h"
-#include "sysinit/sysinit.h"
+#include "os/mynewt.h"
 
 static void
 sysinit_dflt_panic_cb(const char *file, int line, const char *func,
diff --git a/sys/sysview/src/SEGGER_SYSVIEW_Mynewt.c b/sys/sysview/src/SEGGER_SYSVIEW_Mynewt.c
index 76a611034..08e73a988 100644
--- a/sys/sysview/src/SEGGER_SYSVIEW_Mynewt.c
+++ b/sys/sysview/src/SEGGER_SYSVIEW_Mynewt.c
@@ -20,8 +20,7 @@
 #include <ctype.h>
 #include <stdint.h>
 
-#include "os/os.h"
-#include "os/os_trace_api.h"
+#include "os/mynewt.h"
 
 #include "sysview/vendor/SEGGER_SYSVIEW.h"
 #include "sysview/vendor/Global.h"
diff --git a/sys/sysview/vendor/include/sysview/vendor/SEGGER_SYSVIEW_Conf.h b/sys/sysview/vendor/include/sysview/vendor/SEGGER_SYSVIEW_Conf.h
index fe07361b3..cd85a2f3d 100644
--- a/sys/sysview/vendor/include/sysview/vendor/SEGGER_SYSVIEW_Conf.h
+++ b/sys/sysview/vendor/include/sysview/vendor/SEGGER_SYSVIEW_Conf.h
@@ -65,7 +65,7 @@ Revision: $Rev: 5626 $
 #ifndef SEGGER_SYSVIEW_CONF_H
 #define SEGGER_SYSVIEW_CONF_H
 
-#include "syscfg/syscfg.h"
+#include "os/mynewt.h"
 
 /*********************************************************************
 *
diff --git a/test/crash_test/src/crash_cli.c b/test/crash_test/src/crash_cli.c
index e04c8a2f7..5b753e373 100644
--- a/test/crash_test/src/crash_cli.c
+++ b/test/crash_test/src/crash_cli.c
@@ -17,11 +17,10 @@
  * under the License.
  */
 
-#include "syscfg/syscfg.h"
+#include "os/mynewt.h"
 
 #if MYNEWT_VAL(CRASH_TEST_CLI)
 #include <inttypes.h>
-#include <os/os.h>
 #include <console/console.h>
 #include <shell/shell.h>
 #include <stdio.h>
diff --git a/test/crash_test/src/crash_nmgr.c b/test/crash_test/src/crash_nmgr.c
index b1b8eaaae..8fb2564d1 100644
--- a/test/crash_test/src/crash_nmgr.c
+++ b/test/crash_test/src/crash_nmgr.c
@@ -17,7 +17,7 @@
  * under the License.
  */
 
-#include "syscfg/syscfg.h"
+#include "os/mynewt.h"
 
 #if MYNEWT_VAL(CRASH_TEST_NEWTMGR)
 
diff --git a/test/crash_test/src/crash_test.c b/test/crash_test/src/crash_test.c
index 3b469b023..57adfc2da 100644
--- a/test/crash_test/src/crash_test.c
+++ b/test/crash_test/src/crash_test.c
@@ -21,9 +21,7 @@
 #include <string.h>
 #include <assert.h>
 
-#include "sysinit/sysinit.h"
-#include "syscfg/syscfg.h"
-#include "os/os.h"
+#include "os/mynewt.h"
 #include "console/console.h"
 
 #include "crash_test/crash_test.h"
diff --git a/test/flash_test/src/flash_test/flash_test.c b/test/flash_test/src/flash_test/flash_test.c
index 078e9ba63..d24035f8d 100644
--- a/test/flash_test/src/flash_test/flash_test.c
+++ b/test/flash_test/src/flash_test/flash_test.c
@@ -16,8 +16,9 @@
  * specific language governing permissions and limitations
  * under the License.
  */
+
 #include <inttypes.h>
-#include <os/os.h>
+#include "os/mynewt.h"
 #include <console/console.h>
 #include <hal/hal_bsp.h>
 #include <hal/hal_flash.h>
diff --git a/test/i2c_scan/src/i2c_scan.c b/test/i2c_scan/src/i2c_scan.c
index 4a98ac314..41428874c 100644
--- a/test/i2c_scan/src/i2c_scan.c
+++ b/test/i2c_scan/src/i2c_scan.c
@@ -16,9 +16,9 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-#include <inttypes.h>
-#include <os/os.h>
 
+#include <inttypes.h>
+#include "os/mynewt.h"
 #include <hal/hal_i2c.h>
 #include <shell/shell.h>
 #include <console/console.h>
diff --git a/test/runtest/src/runtest.c b/test/runtest/src/runtest.c
index 0f651001a..634b7f7ae 100644
--- a/test/runtest/src/runtest.c
+++ b/test/runtest/src/runtest.c
@@ -21,9 +21,7 @@
 #include <string.h>
 #include <assert.h>
 
-#include "sysinit/sysinit.h"
-#include "syscfg/syscfg.h"
-#include "os/os.h"
+#include "os/mynewt.h"
 #include "console/console.h"
 
 #include "runtest/runtest.h"
diff --git a/test/runtest/src/runtest_cli.c b/test/runtest/src/runtest_cli.c
index 739dc2ff4..160bf4a00 100644
--- a/test/runtest/src/runtest_cli.c
+++ b/test/runtest/src/runtest_cli.c
@@ -17,11 +17,10 @@
  * under the License.
  */
 
-#include "syscfg/syscfg.h"
+#include "os/mynewt.h"
 
 #if MYNEWT_VAL(RUNTEST_CLI)
 #include <inttypes.h>
-#include <os/os.h>
 #include <console/console.h>
 #include <shell/shell.h>
 #include <stdio.h>
diff --git a/test/runtest/src/runtest_nmgr.c b/test/runtest/src/runtest_nmgr.c
index ce282ce7e..956c14f02 100644
--- a/test/runtest/src/runtest_nmgr.c
+++ b/test/runtest/src/runtest_nmgr.c
@@ -17,7 +17,7 @@
  * under the License.
  */
 
-#include "syscfg/syscfg.h"
+#include "os/mynewt.h"
 
 #if MYNEWT_VAL(RUNTEST_NEWTMGR)
 #include <string.h>
@@ -25,7 +25,6 @@
 #include "mgmt/mgmt.h"
 #include "cborattr/cborattr.h"
 #include "console/console.h"
-#include "os/os_eventq.h"
 
 #include "testutil/testutil.h"
 
diff --git a/test/testutil/include/testutil/testutil.h b/test/testutil/include/testutil/testutil.h
index a2695602e..48e3db094 100644
--- a/test/testutil/include/testutil/testutil.h
+++ b/test/testutil/include/testutil/testutil.h
@@ -24,9 +24,7 @@
 #include <inttypes.h>
 #include <setjmp.h>
 
-#include "os/queue.h"
-
-#include "syscfg/syscfg.h"
+#include "os/mynewt.h"
 
 #ifdef __cplusplus
 extern "C" {
diff --git a/test/testutil/src/suite.c b/test/testutil/src/suite.c
index 91c21e787..454747c95 100644
--- a/test/testutil/src/suite.c
+++ b/test/testutil/src/suite.c
@@ -18,7 +18,7 @@
  */
 
 #include <assert.h>
-#include "os/os.h"
+#include "os/mynewt.h"
 #include "testutil/testutil.h"
 #include "testutil_priv.h"
 
diff --git a/test/testutil/src/testutil.c b/test/testutil/src/testutil.c
index 71fec3662..0358cca82 100644
--- a/test/testutil/src/testutil.c
+++ b/test/testutil/src/testutil.c
@@ -16,17 +16,16 @@
  * specific language governing permissions and limitations
  * under the License.
  */
+
 #include <assert.h>
-#include "sysinit/sysinit.h"
-#include "os/os.h"
+#include <errno.h>
+#include <unistd.h>
+#include "os/mynewt.h"
 #include "hal/hal_flash.h"
 #include "hal/hal_system.h"
 #include "testutil/testutil.h"
 #include "testutil_priv.h"
 
-#include <errno.h>
-#include <unistd.h>
-
 struct tc_config tc_config;
 struct tc_config *tc_current_config = &tc_config;
 
diff --git a/time/datetime/src/datetime.c b/time/datetime/src/datetime.c
index 5661506e8..bc569409b 100644
--- a/time/datetime/src/datetime.c
+++ b/time/datetime/src/datetime.c
@@ -57,12 +57,10 @@
  *    from: src/sys/i386/isa/clock.c,v 1.176 2001/09/04
  */
 
-#include <os/os_time.h>
-#include <os/os_error.h>
-
 #include <stdio.h>
 #include <ctype.h>
 #include <string.h>
+#include "os/mynewt.h"
 #include <datetime/datetime.h>
 
 #define days_in_year(y)     (leapyear(y) ? 366 : 365)
diff --git a/util/cbmem/include/cbmem/cbmem.h b/util/cbmem/include/cbmem/cbmem.h
index 580ddb094..aa74b6787 100644
--- a/util/cbmem/include/cbmem/cbmem.h
+++ b/util/cbmem/include/cbmem/cbmem.h
@@ -19,7 +19,7 @@
 #ifndef __UTIL_CBMEM_H__ 
 #define __UTIL_CBMEM_H__
 
-#include <os/os.h>
+#include "os/mynewt.h"
 
 #ifdef __cplusplus
 extern "C" {
diff --git a/util/cbmem/src/cbmem.c b/util/cbmem/src/cbmem.c
index 0aeef4de0..c0549a1b0 100644
--- a/util/cbmem/src/cbmem.c
+++ b/util/cbmem/src/cbmem.c
@@ -17,12 +17,10 @@
  * under the License.
  */
 
-#include <os/os.h>
 #include <string.h>
-
+#include "os/mynewt.h"
 #include "cbmem/cbmem.h"
 
-
 int
 cbmem_init(struct cbmem *cbmem, void *buf, uint32_t buf_len)
 {
diff --git a/util/cbmem/test/src/cbmem_test.c b/util/cbmem/test/src/cbmem_test.c
index 7c4d5853f..b486f43e2 100644
--- a/util/cbmem/test/src/cbmem_test.c
+++ b/util/cbmem/test/src/cbmem_test.c
@@ -16,12 +16,12 @@
  * specific language governing permissions and limitations
  * under the License.
  */
+
 #include <stdio.h>
 #include <string.h>
 #include <assert.h>
 #include <stddef.h>
-#include "sysinit/sysinit.h"
-#include "syscfg/syscfg.h"
+#include "os/mynewt.h"
 #include "testutil/testutil.h"
 #include "cbmem/cbmem.h"
 #include "cbmem_test.h"
diff --git a/util/cbmem/test/src/cbmem_test.h b/util/cbmem/test/src/cbmem_test.h
index 9d61dd366..ac794f22c 100644
--- a/util/cbmem/test/src/cbmem_test.h
+++ b/util/cbmem/test/src/cbmem_test.h
@@ -23,7 +23,7 @@
 #include <string.h>
 #include <assert.h>
 #include <stddef.h>
-#include "syscfg/syscfg.h"
+#include "os/mynewt.h"
 #include "testutil/testutil.h"
 #include "cbmem/cbmem.h"
 
diff --git a/util/mem/src/mem.c b/util/mem/src/mem.c
index 6b5739aae..f998529d1 100644
--- a/util/mem/src/mem.c
+++ b/util/mem/src/mem.c
@@ -17,7 +17,7 @@
  * under the License.
  */
 
-#include "os/os.h"
+#include "os/mynewt.h"
 #include "mem/mem.h"
 
 /**
diff --git a/util/parse/src/parse.c b/util/parse/src/parse.c
index 02391f82c..e2c013613 100644
--- a/util/parse/src/parse.c
+++ b/util/parse/src/parse.c
@@ -24,7 +24,7 @@
 #include <inttypes.h>
 #include <errno.h>
 #include <assert.h>
-#include "defs/error.h"
+#include "os/mynewt.h"
 
 /**
  * Determines which numeric base the specified string should be parsed with.


 

----------------------------------------------------------------
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