From 18d5378f4c46db9ced2a4258e9f301739a15ca60 Mon Sep 17 00:00:00 2001 From: Richard Braun Date: Wed, 4 Oct 2017 21:32:26 +0200 Subject: Fix some header inclusions --- kern/console.c | 1 + kern/init.c | 1 + kern/printf.c | 2 ++ kern/sref.c | 1 + kern/work.c | 1 + 5 files changed, 6 insertions(+) (limited to 'kern') diff --git a/kern/console.c b/kern/console.c index 0b5c4f86..0ed54b5e 100644 --- a/kern/console.c +++ b/kern/console.c @@ -18,6 +18,7 @@ #include #include #include +#include #include #include diff --git a/kern/init.c b/kern/init.c index 6bd48380..da106acd 100644 --- a/kern/init.c +++ b/kern/init.c @@ -26,6 +26,7 @@ #include #include #include +#include #include #include diff --git a/kern/printf.c b/kern/printf.c index 68cf4ba9..29267a6e 100644 --- a/kern/printf.c +++ b/kern/printf.c @@ -15,6 +15,8 @@ * along with this program. If not, see . */ +#include + #include #include #include diff --git a/kern/sref.c b/kern/sref.c index 7775a5c9..051fe4c1 100644 --- a/kern/sref.c +++ b/kern/sref.c @@ -44,6 +44,7 @@ #include #include #include +#include #include #include diff --git a/kern/work.c b/kern/work.c index a841d38d..c1bdede1 100644 --- a/kern/work.c +++ b/kern/work.c @@ -18,6 +18,7 @@ #include #include #include +#include #include #include -- cgit v1.2.3 From 16f7ce961099a55c64db92baabb9424e08d437d9 Mon Sep 17 00:00:00 2001 From: Remy Noel Date: Sun, 15 Oct 2017 18:03:46 +0200 Subject: kern/macros: new __fallthrough macro --- kern/macros.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'kern') diff --git a/kern/macros.h b/kern/macros.h index d09eca40..23ad4d22 100644 --- a/kern/macros.h +++ b/kern/macros.h @@ -106,4 +106,13 @@ moo_print(const char *s) #define __used __attribute__((used)) #endif +#ifndef __fallthrough +#if __GNUC__ >= 7 +#define __fallthrough __attribute__((fallthrough)) +#else +/* TODO: clang 6 might add support for -Wimplicit-fallthrough */ +#define __fallthrough +#endif +#endif + #endif /* _KERN_MACROS_H */ -- cgit v1.2.3 From e42fa19bf1cfeac9a46b95ef996c8858dfe4e347 Mon Sep 17 00:00:00 2001 From: Remy Noel Date: Sun, 15 Oct 2017 18:03:46 +0200 Subject: kern/fmt: silence implicit fallthrough warnings --- kern/fmt.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'kern') diff --git a/kern/fmt.c b/kern/fmt.c index 03ababe4..1ba77cb0 100644 --- a/kern/fmt.c +++ b/kern/fmt.c @@ -326,6 +326,7 @@ fmt_sprintf_state_consume_modifier(struct fmt_sprintf_state *state) break; case 'z': state->modifier = FMT_MODIFIER_SIZE; + __fallthrough; case 't': state->modifier = FMT_MODIFIER_PTRDIFF; break; @@ -347,6 +348,7 @@ fmt_sprintf_state_consume_specifier(struct fmt_sprintf_state *state) case 'd': case 'i': state->flags |= FMT_FORMAT_CONV_SIGNED; + __fallthrough; case 'u': state->base = 10; state->specifier = FMT_SPECIFIER_INT; @@ -358,8 +360,10 @@ fmt_sprintf_state_consume_specifier(struct fmt_sprintf_state *state) case 'p': state->flags |= FMT_FORMAT_ALT_FORM; state->modifier = FMT_MODIFIER_PTR; + __fallthrough; case 'x': state->flags |= FMT_FORMAT_LOWER; + __fallthrough; case 'X': state->base = 16; state->specifier = FMT_SPECIFIER_INT; @@ -1011,6 +1015,7 @@ fmt_sscanf_state_consume_specifier(struct fmt_sscanf_state *state) break; case 'd': state->flags |= FMT_FORMAT_CONV_SIGNED; + __fallthrough; case 'u': state->base = 10; state->specifier = FMT_SPECIFIER_INT; @@ -1021,6 +1026,7 @@ fmt_sscanf_state_consume_specifier(struct fmt_sscanf_state *state) break; case 'p': state->modifier = FMT_MODIFIER_PTR; + __fallthrough; case 'x': case 'X': state->base = 16; -- cgit v1.2.3 From 42a3454c9dd9622c21bf7748f4d6edc1d7f6f8c6 Mon Sep 17 00:00:00 2001 From: Richard Braun Date: Sun, 15 Oct 2017 20:21:20 +0200 Subject: kern/sleepq: replace tab character with spaces --- kern/sleepq.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'kern') diff --git a/kern/sleepq.c b/kern/sleepq.c index 294ad7ca..77bcd021 100644 --- a/kern/sleepq.c +++ b/kern/sleepq.c @@ -450,7 +450,7 @@ sleepq_wait_common(struct sleepq *sleepq, const char *wchan, sleepq_waiter_init(&waiter, thread); sleepq_add_waiter(sleepq, &waiter); - do { + do { if (!timed) { thread_sleep(&sleepq->bucket->lock, sleepq->sync_obj, wchan); error = 0; -- cgit v1.2.3 From b5c668a0b8fdc6e9c3b60765b1a7f321916b49c8 Mon Sep 17 00:00:00 2001 From: Richard Braun Date: Tue, 31 Oct 2017 00:52:05 +0100 Subject: Rename CONFIG_MULTIPROCESSOR to CONFIG_SMP Machine-independent code assumes SMP, and the name is shorter. --- kern/Kconfig | 10 +++++----- tools/build_configs.py | 6 +++--- 2 files changed, 8 insertions(+), 8 deletions(-) (limited to 'kern') diff --git a/kern/Kconfig b/kern/Kconfig index df0cbacb..7c718d4c 100644 --- a/kern/Kconfig +++ b/kern/Kconfig @@ -1,16 +1,16 @@ menu "General setup" -config MULTIPROCESSOR +config SMP bool "Multiprocessor support" default y ---help--- Enable support for machines with multiple processors. config MAX_CPUS - int "Maximum number of supported CPUs" if MULTIPROCESSOR - range 2 512 if MULTIPROCESSOR - default "1" if !MULTIPROCESSOR - default "128" if MULTIPROCESSOR + int "Maximum number of supported CPUs" if SMP + range 2 512 if SMP + default "1" if !SMP + default "128" if SMP ---help--- Maximum number of supported processors. diff --git a/tools/build_configs.py b/tools/build_configs.py index 96d1fbbe..00d05921 100755 --- a/tools/build_configs.py +++ b/tools/build_configs.py @@ -78,7 +78,7 @@ all_cc_options_dict = { small_options_dict = { 'CONFIG_CC_OPTIONS' : gen_cc_options_list(all_cc_options_dict), - 'CONFIG_MULTIPROCESSOR' : ['y', 'n'], + 'CONFIG_SMP' : ['y', 'n'], 'CONFIG_MAX_CPUS' : ['1', '128'], 'CONFIG_ASSERT' : ['y', 'n'], } @@ -113,11 +113,11 @@ all_filters_list = [ 'CONFIG_CC_OPTIONS' : [True, re.compile('-flto')], }, { - 'CONFIG_MULTIPROCESSOR' : [True, 'y'], + 'CONFIG_SMP' : [True, 'y'], 'CONFIG_MAX_CPUS' : [True, '1'], }, { - 'CONFIG_MULTIPROCESSOR' : [True, 'n'], + 'CONFIG_SMP' : [True, 'n'], 'CONFIG_MAX_CPUS' : [False, '1'], }, { -- cgit v1.2.3