1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

Merge pull request #17652 from kaspar030/split_core_lib

core: split out library code
This commit is contained in:
Koen Zandberg 2022-03-10 20:17:07 +01:00 committed by GitHub
commit e59a6786a6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
37 changed files with 74 additions and 43 deletions

View File

@ -407,7 +407,10 @@ ifneq (,$(IOTLAB_NODE))
endif endif
# Add standard include directories # Add standard include directories
INCLUDES += -I$(RIOTBASE)/core/include -I$(RIOTBASE)/drivers/include -I$(RIOTBASE)/sys/include INCLUDES += -I$(RIOTBASE)/core/lib/include
INCLUDES += -I$(RIOTBASE)/core/include
INCLUDES += -I$(RIOTBASE)/drivers/include
INCLUDES += -I$(RIOTBASE)/sys/include
# process provided features # process provided features
include $(RIOTBASE)/Makefile.features include $(RIOTBASE)/Makefile.features

View File

@ -1,5 +1,6 @@
NATIVEINCLUDES += -DNATIVE_INCLUDES NATIVEINCLUDES += -DNATIVE_INCLUDES
NATIVEINCLUDES += -I$(RIOTBOARD)/native/include/ NATIVEINCLUDES += -I$(RIOTBOARD)/native/include/
NATIVEINCLUDES += -I$(RIOTBASE)/core/lib/include/
NATIVEINCLUDES += -I$(RIOTBASE)/core/include/ NATIVEINCLUDES += -I$(RIOTBASE)/core/include/
NATIVEINCLUDES += -I$(RIOTBASE)/drivers/include/ NATIVEINCLUDES += -I$(RIOTBASE)/drivers/include/

View File

@ -9,10 +9,17 @@ menuconfig MODULE_CORE
bool "RIOT Core" bool "RIOT Core"
default y default y
depends on TEST_KCONFIG depends on TEST_KCONFIG
depends on MODULE_CORE_LIB
help help
RIOT's core module. Only change this if you know what you are doing. If RIOT's core module. Only change this if you know what you are doing. If
unsure, say Y. unsure, say Y.
config MODULE_CORE_LIB
bool
default y
help
Select y to to include core libs
if MODULE_CORE if MODULE_CORE
config MODULE_CORE_IDLE_THREAD config MODULE_CORE_IDLE_THREAD

View File

@ -1,5 +1,5 @@
# exclude submodule sources from *.c wildcard source selection # exclude submodule sources from *.c wildcard source selection
SRC := $(filter-out init.c mbox.c msg.c msg_bus.c panic.c thread_flags.c,$(wildcard *.c)) SRC := $(filter-out mbox.c msg.c msg_bus.c thread_flags.c,$(wildcard *.c))
# enable submodules # enable submodules
SUBMODULES := 1 SUBMODULES := 1

12
core/lib/Makefile Normal file
View File

@ -0,0 +1,12 @@
MODULE = core_lib
# enable submodules
SUBMODULES := 1
# set this so the panic and init code is available as "core_panic" and "core_init"
# instead of "core_lib_..."
BASE_MODULE = core
# exclude submodule sources from *.c wildcard source selection
SRC := $(filter-out panic.c init.c,$(wildcard *.c))
include $(RIOTBASE)/Makefile.base

View File

@ -56,40 +56,40 @@ extern "C" {
* @{ * @{
*/ */
#ifndef BIT0 #ifndef BIT0
#define BIT0 0x00000001 #define BIT0 0x00000001 /**< Bit 0 set define */
#define BIT1 0x00000002 #define BIT1 0x00000002 /**< Bit 1 set define */
#define BIT2 0x00000004 #define BIT2 0x00000004 /**< Bit 2 set define */
#define BIT3 0x00000008 #define BIT3 0x00000008 /**< Bit 3 set define */
#define BIT4 0x00000010 #define BIT4 0x00000010 /**< Bit 4 set define */
#define BIT5 0x00000020 #define BIT5 0x00000020 /**< Bit 5 set define */
#define BIT6 0x00000040 #define BIT6 0x00000040 /**< Bit 6 set define */
#define BIT7 0x00000080 #define BIT7 0x00000080 /**< Bit 7 set define */
#define BIT8 0x00000100 #define BIT8 0x00000100 /**< Bit 8 set define */
#define BIT9 0x00000200 #define BIT9 0x00000200 /**< Bit 9 set define */
#define BIT10 0x00000400 #define BIT10 0x00000400 /**< Bit 10 set define */
#define BIT11 0x00000800 #define BIT11 0x00000800 /**< Bit 11 set define */
#define BIT12 0x00001000 #define BIT12 0x00001000 /**< Bit 12 set define */
#define BIT13 0x00002000 #define BIT13 0x00002000 /**< Bit 13 set define */
#define BIT14 0x00004000 #define BIT14 0x00004000 /**< Bit 14 set define */
#define BIT15 0x00008000 #define BIT15 0x00008000 /**< Bit 15 set define */
#endif #endif
#ifndef BIT16 #ifndef BIT16
#define BIT16 0x00010000 #define BIT16 0x00010000 /**< Bit 16 set define */
#define BIT17 0x00020000 #define BIT17 0x00020000 /**< Bit 17 set define */
#define BIT18 0x00040000 #define BIT18 0x00040000 /**< Bit 18 set define */
#define BIT19 0x00080000 #define BIT19 0x00080000 /**< Bit 19 set define */
#define BIT20 0x00100000 #define BIT20 0x00100000 /**< Bit 20 set define */
#define BIT21 0x00200000 #define BIT21 0x00200000 /**< Bit 21 set define */
#define BIT22 0x00400000 #define BIT22 0x00400000 /**< Bit 22 set define */
#define BIT23 0x00800000 #define BIT23 0x00800000 /**< Bit 23 set define */
#define BIT24 0x01000000 #define BIT24 0x01000000 /**< Bit 24 set define */
#define BIT25 0x02000000 #define BIT25 0x02000000 /**< Bit 25 set define */
#define BIT26 0x04000000 #define BIT26 0x04000000 /**< Bit 26 set define */
#define BIT27 0x08000000 #define BIT27 0x08000000 /**< Bit 27 set define */
#define BIT28 0x10000000 #define BIT28 0x10000000 /**< Bit 28 set define */
#define BIT29 0x20000000 #define BIT29 0x20000000 /**< Bit 29 set define */
#define BIT30 0x40000000 #define BIT30 0x40000000 /**< Bit 30 set define */
#define BIT31 0x80000000 #define BIT31 0x80000000 /**< Bit 31 set define */
#endif #endif
/** @} */ /** @} */

View File

@ -89,10 +89,10 @@ enum {
* @name Logging convenience defines * @name Logging convenience defines
* @{ * @{
*/ */
#define LOG_ERROR(...) LOG(LOG_ERROR, __VA_ARGS__) #define LOG_ERROR(...) LOG(LOG_ERROR, __VA_ARGS__) /**< log an error */
#define LOG_WARNING(...) LOG(LOG_WARNING, __VA_ARGS__) #define LOG_WARNING(...) LOG(LOG_WARNING, __VA_ARGS__) /**< log a warning */
#define LOG_INFO(...) LOG(LOG_INFO, __VA_ARGS__) #define LOG_INFO(...) LOG(LOG_INFO, __VA_ARGS__) /**< for the curious */
#define LOG_DEBUG(...) LOG(LOG_DEBUG, __VA_ARGS__) #define LOG_DEBUG(...) LOG(LOG_DEBUG, __VA_ARGS__) /**< teach some ignorance */
/** @} */ /** @} */
#ifdef MODULE_LOG #ifdef MODULE_LOG

View File

@ -31,8 +31,10 @@ extern "C" {
* @brief A macro to return the string respresentation of x * @brief A macro to return the string respresentation of x
*/ */
#ifndef XTSTR #ifndef XTSTR
#define _XTSTR(x) # x # ifndef DOXYGEN
#define XTSTR(x) _XTSTR(x) # define _XTSTR(x) # x
# endif /* DOXYGEN */
# define XTSTR(x) _XTSTR(x)
#endif /* XTSTR */ #endif /* XTSTR */
#ifdef __cplusplus #ifdef __cplusplus

View File

@ -15,7 +15,7 @@ ZEP_PORT_BASE ?= 17754
TOPOLOGY ?= network.topo TOPOLOGY ?= network.topo
GV_OUT ?= $(TOPOLOGY).gv GV_OUT ?= $(TOPOLOGY).gv
RIOT_INCLUDE += -I$(RIOTBASE)/core/include RIOT_INCLUDE += -I$(RIOTBASE)/core/lib/include
RIOT_INCLUDE += -I$(RIOTBASE)/cpu/native/include RIOT_INCLUDE += -I$(RIOTBASE)/cpu/native/include
RIOT_INCLUDE += -I$(RIOTBASE)/drivers/include RIOT_INCLUDE += -I$(RIOTBASE)/drivers/include
RIOT_INCLUDE += -I$(RIOTBASE)/sys/include RIOT_INCLUDE += -I$(RIOTBASE)/sys/include

View File

@ -1,7 +1,7 @@
MODULE = $(APPLICATION_MODULE) MODULE = $(APPLICATION_MODULE)
DIRS += $(RIOTCPU)/$(CPU) $(BOARDDIR) DIRS += $(RIOTCPU)/$(CPU) $(BOARDDIR)
DIRS += $(RIOTBASE)/core $(RIOTBASE)/drivers $(RIOTBASE)/sys DIRS += $(RIOTBASE)/core $(RIOTBASE)/core/lib $(RIOTBASE)/drivers $(RIOTBASE)/sys
# For regular modules, adding files to BLOBS to their Makefile is sufficient to # For regular modules, adding files to BLOBS to their Makefile is sufficient to
# create the corresponding headers. # create the corresponding headers.

View File

@ -1,4 +1,7 @@
DEFAULT_MODULE += board board_common_init cpu core core_init core_msg core_panic sys DEFAULT_MODULE += board board_common_init \
cpu \
core core_init core_lib core_msg core_panic \
sys
# Include potentially added default modules by the board # Include potentially added default modules by the board
-include $(BOARDDIR)/Makefile.default -include $(BOARDDIR)/Makefile.default

View File

@ -275,6 +275,9 @@ PSEUDOMODULES += ztimer64_%
## configuration header board.h. These can be found out by running tests/ztimer_overhead ## configuration header board.h. These can be found out by running tests/ztimer_overhead
PSEUDOMODULES += ztimer_auto_adjust PSEUDOMODULES += ztimer_auto_adjust
# core_lib is not a submodule
NO_PSEUDOMODULES += core_lib
# ztimer's main module is called "ztimer_core" # ztimer's main module is called "ztimer_core"
NO_PSEUDOMODULES += ztimer_core NO_PSEUDOMODULES += ztimer_core
NO_PSEUDOMODULES += netdev_ieee802154_submac NO_PSEUDOMODULES += netdev_ieee802154_submac