diff options
Diffstat (limited to 'kern')
-rw-r--r-- | kern/Kconfig | 10 | ||||
-rw-r--r-- | kern/fmt.c | 6 | ||||
-rw-r--r-- | kern/macros.h | 9 | ||||
-rw-r--r-- | kern/sleepq.c | 2 |
4 files changed, 21 insertions, 6 deletions
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. @@ -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; 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 */ 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; |