sched/Kconfig: Simplify some configurations. This adds configuration settings that control individual features, rather than long complex OR expressions that determines if an individual feature is required.
This commit is contained in:
parent
865cc85dfd
commit
4ca7b72a98
@ -637,8 +637,7 @@ struct tcb_s
|
||||
#endif
|
||||
uint16_t flags; /* Misc. general status flags */
|
||||
int16_t lockcount; /* 0=preemptable (not-locked) */
|
||||
#if defined(CONFIG_SMP) || defined(CONFIG_SCHED_CRITMONITOR) || \
|
||||
defined(CONFIG_SCHED_INSTRUMENTATION_CSECTION)
|
||||
#ifdef CONFIG_IRQCOUNT
|
||||
int16_t irqcount; /* 0=Not in critical section */
|
||||
#endif
|
||||
#ifdef CONFIG_CANCELLATION_POINTS
|
||||
@ -952,9 +951,7 @@ int group_exitinfo(pid_t pid, FAR struct binary_s *bininfo);
|
||||
*
|
||||
********************************************************************************/
|
||||
|
||||
#if CONFIG_RR_INTERVAL > 0 || defined(CONFIG_SCHED_SPORADIC) || \
|
||||
defined(CONFIG_SCHED_INSTRUMENTATION) || defined(CONFIG_SCHED_CRITMONITOR) || \
|
||||
defined(CONFIG_SMP)
|
||||
#if CONFIG_RR_INTERVAL > 0 || defined(CONFIG_SCHED_RESUMESCHEDULER)
|
||||
void sched_resume_scheduler(FAR struct tcb_s *tcb);
|
||||
#else
|
||||
# define sched_resume_scheduler(tcb)
|
||||
@ -976,8 +973,7 @@ void sched_resume_scheduler(FAR struct tcb_s *tcb);
|
||||
*
|
||||
********************************************************************************/
|
||||
|
||||
#if defined(CONFIG_SCHED_SPORADIC) || defined(CONFIG_SCHED_INSTRUMENTATION) || \
|
||||
defined(CONFIG_SCHED_CRITMONITOR)
|
||||
#ifdef CONFIG_SCHED_SUSPENDSCHEDULER
|
||||
void sched_suspend_scheduler(FAR struct tcb_s *tcb);
|
||||
#else
|
||||
# define sched_suspend_scheduler(tcb)
|
||||
|
@ -276,11 +276,17 @@ config PREALLOC_IRQCHAIN
|
||||
|
||||
endif # IRQCHAIN
|
||||
|
||||
config IRQCOUNT
|
||||
bool
|
||||
default n
|
||||
|
||||
config SMP
|
||||
bool "Symmetric Multi-Processing (SMP)"
|
||||
default n
|
||||
depends on ARCH_HAVE_MULTICPU
|
||||
select SPINLOCK
|
||||
select SCHED_RESUMESCHEDULER
|
||||
select IRQCOUNT
|
||||
---help---
|
||||
Enables support for Symmetric Multi-Processing (SMP) on a multi-CPU
|
||||
platform.
|
||||
@ -429,6 +435,8 @@ config RR_INTERVAL
|
||||
config SCHED_SPORADIC
|
||||
bool "Support sporadic scheduling"
|
||||
default n
|
||||
select SCHED_SUSPENDSCHEDULER
|
||||
select SCHED_RESUMESCHEDULER
|
||||
---help---
|
||||
Build in additional logic to support sporadic scheduling
|
||||
(SCHED_SPORADIC).
|
||||
@ -691,6 +699,14 @@ endmenu # Pthread Options
|
||||
|
||||
menu "Performance Monitoring"
|
||||
|
||||
config SCHED_SUSPENDSCHEDULER
|
||||
bool
|
||||
default n
|
||||
|
||||
config SCHED_RESUMESCHEDULER
|
||||
bool
|
||||
default n
|
||||
|
||||
config SCHED_IRQMONITOR
|
||||
bool "Enable IRQ monitoring"
|
||||
default n
|
||||
@ -704,6 +720,9 @@ config SCHED_CRITMONITOR
|
||||
bool "Enable Critical Section monitoring"
|
||||
default n
|
||||
depends on FS_PROCFS
|
||||
select SCHED_SUSPENDSCHEDULER
|
||||
select SCHED_RESUMESCHEDULER
|
||||
select IRQCOUNT
|
||||
---help---
|
||||
Enables logic that monitors the duration of time that a thread keeps
|
||||
interrupts or pre-emption disabled. These global locks can have
|
||||
@ -870,6 +889,9 @@ endif # SCHED_CPULOAD
|
||||
config SCHED_INSTRUMENTATION
|
||||
bool "System performance monitor hooks"
|
||||
default n
|
||||
select SCHED_SUSPENDSCHEDULER
|
||||
select SCHED_RESUMESCHEDULER
|
||||
select IRQCOUNT
|
||||
---help---
|
||||
Enables instrumentation in scheduler to monitor system performance.
|
||||
If enabled, then the board-specific logic must provide the following
|
||||
|
@ -42,9 +42,9 @@ ifeq ($(CONFIG_ARCH_GLOBAL_IRQDISABLE),y)
|
||||
CSRCS += irq_spinlock.c
|
||||
endif
|
||||
endif
|
||||
else ifeq ($(CONFIG_SCHED_INSTRUMENTATION_CSECTION),y)
|
||||
CSRCS += irq_csection.c
|
||||
else ifeq ($(CONFIG_SCHED_CRITMONITOR),y)
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_IRQCOUNT),y)
|
||||
CSRCS += irq_csection.c
|
||||
endif
|
||||
|
||||
|
@ -49,8 +49,7 @@
|
||||
#include "sched/sched.h"
|
||||
#include "irq/irq.h"
|
||||
|
||||
#if defined(CONFIG_SMP) || defined(CONFIG_SCHED_INSTRUMENTATION_CSECTION) || \
|
||||
defined(CONFIG_SCHED_CRITMONITOR)
|
||||
#ifdef CONFIG_IRQCOUNT
|
||||
|
||||
/****************************************************************************
|
||||
* Public Data
|
||||
@ -392,8 +391,9 @@ try_again:
|
||||
|
||||
return ret;
|
||||
}
|
||||
#else /* defined(CONFIG_SCHED_INSTRUMENTATION_CSECTION) || \
|
||||
* defined(CONFIG_SCHED_CRITMONITOR) */
|
||||
|
||||
#else
|
||||
|
||||
irqstate_t enter_critical_section(void)
|
||||
{
|
||||
irqstate_t ret;
|
||||
@ -585,8 +585,7 @@ void leave_critical_section(irqstate_t flags)
|
||||
up_irq_restore(flags);
|
||||
}
|
||||
|
||||
#else /* defined(CONFIG_SCHED_INSTRUMENTATION_CSECTION) ||
|
||||
* defined(CONFIG_SCHED_CRITMONITOR) */
|
||||
#else
|
||||
|
||||
void leave_critical_section(irqstate_t flags)
|
||||
{
|
||||
@ -704,5 +703,4 @@ bool irq_cpu_locked(int cpu)
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* CONFIG_SMP || CONFIG_SCHED_INSTRUMENTATION_CSECTION ||
|
||||
* CONFIG_SCHED_CRITMONITOR */
|
||||
#endif /* CONFIG_IRQCOUNT */
|
||||
|
@ -70,22 +70,16 @@ CSRCS += sched_roundrobin.c
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_SCHED_SPORADIC),y)
|
||||
CSRCS += sched_sporadic.c sched_suspendscheduler.c
|
||||
else ifeq ($(CONFIG_SCHED_INSTRUMENTATION),y)
|
||||
CSRCS += sched_suspendscheduler.c
|
||||
else ifeq ($(CONFIG_SCHED_CRITMONITOR),y)
|
||||
CSRCS += sched_sporadic.c
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_SCHED_SUSPENDSCHEDULER),y)
|
||||
CSRCS += sched_suspendscheduler.c
|
||||
endif
|
||||
|
||||
ifneq ($(CONFIG_RR_INTERVAL),0)
|
||||
CSRCS += sched_resumescheduler.c
|
||||
else ifeq ($(CONFIG_SCHED_SPORADIC),y)
|
||||
CSRCS += sched_resumescheduler.c
|
||||
else ifeq ($(CONFIG_SCHED_INSTRUMENTATION),y)
|
||||
CSRCS += sched_resumescheduler.c
|
||||
else ifeq ($(CONFIG_SCHED_CRITMONITOR),y)
|
||||
CSRCS += sched_resumescheduler.c
|
||||
else ifeq ($(CONFIG_SMP),y)
|
||||
else ifeq ($(CONFIG_SCHED_RESUMESCHEDULER),y)
|
||||
CSRCS += sched_resumescheduler.c
|
||||
endif
|
||||
|
||||
|
@ -48,9 +48,7 @@
|
||||
#include "irq/irq.h"
|
||||
#include "sched/sched.h"
|
||||
|
||||
#if CONFIG_RR_INTERVAL > 0 || defined(CONFIG_SCHED_SPORADIC) || \
|
||||
defined(CONFIG_SCHED_INSTRUMENTATION) || defined(CONFIG_SCHED_CRITMONITOR) || \
|
||||
defined(CONFIG_SMP)
|
||||
#if CONFIG_RR_INTERVAL > 0 || defined(CONFIG_SCHED_RESUMESCHEDULER)
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
@ -145,6 +143,4 @@ void sched_resume_scheduler(FAR struct tcb_s *tcb)
|
||||
|
||||
}
|
||||
|
||||
#endif /* CONFIG_RR_INTERVAL > 0 || CONFIG_SCHED_SPORADIC || \
|
||||
* CONFIG_SCHED_INSTRUMENTATION || CONFIG_SCHED_CRITMONITOR ||
|
||||
* CONFIG_SMP */
|
||||
#endif /* CONFIG_RR_INTERVAL > 0 || CONFIG_SCHED_RESUMESCHEDULER */
|
||||
|
@ -50,8 +50,7 @@
|
||||
#include "clock/clock.h"
|
||||
#include "sched/sched.h"
|
||||
|
||||
#if defined(CONFIG_SCHED_SPORADIC) || defined(CONFIG_SCHED_INSTRUMENTATION) || \
|
||||
defined(CONFIG_SCHED_CRITMONITOR)
|
||||
#ifdef CONFIG_SCHED_SUSPENDSCHEDULER
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
@ -94,5 +93,4 @@ void sched_suspend_scheduler(FAR struct tcb_s *tcb)
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif /* CONFIG_SCHED_SPORADIC || CONFIG_SCHED_INSTRUMENTATION ||
|
||||
* CONFIG_SCHED_CRITMONITOR */
|
||||
#endif /* CONFIG_SCHED_SUSPENDSCHEDULER */
|
||||
|
Loading…
Reference in New Issue
Block a user