From c422fa651a90a2e6cb19654d229c02bb1174f3f1 Mon Sep 17 00:00:00 2001 From: Andy Ross Date: Fri, 28 Jun 2019 11:16:50 -0700 Subject: [PATCH 01/19] kernel: Add new uniform time unit conversion API Zephyr has always had an ad hoc collection of time unit macros and conversion routines in a selection of different units, precisions, rounding modes and naming conventions. This adds a single optimized generator to produce any such conversion, and enumerates it to produce a collection of 48 utilities in all useful combinations as a single supported kernel API going forward. Signed-off-by: Andy Ross --- include/time_units.h | 859 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 859 insertions(+) create mode 100644 include/time_units.h diff --git a/include/time_units.h b/include/time_units.h new file mode 100644 index 0000000000000..4637eb47f66c6 --- /dev/null +++ b/include/time_units.h @@ -0,0 +1,859 @@ +/* + * Copyright (c) 2019 Intel Corporation + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#ifndef ZEPHYR_INCLUDE_TIME_UNITS_H_ +#define ZEPHYR_INCLUDE_TIME_UNITS_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +/* Exhaustively enumerated, highly optimized time unit conversion API */ + +#if defined(CONFIG_TIMER_READS_ITS_FREQUENCY_AT_RUNTIME) +__syscall int z_clock_hw_cycles_per_sec_runtime_get(void); + +static inline int z_impl_z_clock_hw_cycles_per_sec_runtime_get(void) +{ + extern int z_clock_hw_cycles_per_sec; + + return z_clock_hw_cycles_per_sec; +} +#endif /* CONFIG_TIMER_READS_ITS_FREQUENCY_AT_RUNTIME */ + +static inline int sys_clock_hw_cycles_per_sec(void) +{ +#if defined(CONFIG_TIMER_READS_ITS_FREQUENCY_AT_RUNTIME) + return z_clock_hw_cycles_per_sec_runtime_get(); +#else + return CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC; +#endif +} + +/* Time converter generator gadget. Selects from one of three + * conversion algorithms: ones that take advantage when the + * frequencies are an integer ratio (in either direction), or a full + * precision conversion. Clever use of extra arguments causes all the + * selection logic to be optimized out, and the generated code even + * reduces to 32 bit only if a ratio conversion is available and the + * result is 32 bits. + * + * This isn't intended to be used directly, instead being wrapped + * appropriately in a user-facing API. The boolean arguments are: + * + * const_hz - The hz arguments are known to be compile-time + * constants (because otherwise the modulus test would + * have to be done at runtime) + * result32 - The result will be truncated to 32 bits on use + * round_up - Return the ceiling of the resulting fraction + * round_off - Return the nearest value to the resulting fraction + * (pass both round_up/off as false to get "round_down") + */ +static ALWAYS_INLINE u64_t z_tmcvt(u64_t t, u32_t from_hz, u32_t to_hz, + bool const_hz, bool result32, + bool round_up, bool round_off) +{ + bool mul_ratio = const_hz && + (to_hz > from_hz) && ((to_hz % from_hz) == 0); + bool div_ratio = const_hz && + (from_hz > to_hz) && ((from_hz % to_hz) == 0); + + if (from_hz == to_hz) { + return result32 ? ((u32_t)t) : t; + } + + u64_t off = 0; + if (!mul_ratio) { + u32_t rdivisor = div_ratio ? (from_hz / to_hz) : from_hz; + + if (round_up) { + off = rdivisor - 1; + } else if (round_off) { + off = rdivisor / 2; + } + } + + /* Select (at build time!) between three different expressions for + * the same mathematical relationship, each expressed with and + * without truncation to 32 bits (I couldn't find a way to make + * the compiler correctly guess at the 32 bit result otherwise). + */ + if (div_ratio) { + t += off; + if (result32) { + return ((u32_t)t) / (from_hz / to_hz); + } else { + return t / (from_hz / to_hz); + } + } else if (mul_ratio) { + if (result32) { + return ((u32_t)t) * (to_hz / from_hz); + } else { + return t * (to_hz / from_hz); + } + } else { + if (result32) { + return (u32_t)((t * to_hz + off) / from_hz); + } else { + return (t * to_hz + off) / from_hz; + } + } +} + +/* The following code is programmatically generated using this perl + * code, which enumerates all possible combinations of units, rounding + * modes and precision. Do not edit directly. + * + * Note that no "microsecond" conversions are defined with anything + * but 64 bit precision. This unit was added to Zephyr after the + * introduction of 64 bit timeout support, so there is no backward + * compatibility requirement. And doing 32 bit math with units that + * small microseconds has precision traps that we probably don't want + * to support in an official API. + * + * #!/usr/bin/perl -w + * use strict; + * + * my %human = ("ms" => "milliseconds", + * "us" => "microseconds", + * "cyc" => "hardware cycles", + * "ticks" => "ticks"); + * + * for my $from_unit ("ms", "us", "cyc", "ticks") { + * for my $to_unit ("ms", "us", "cyc", "ticks") { + * next if $from_unit eq $to_unit; + * next if $from_unit eq "us" and $to_unit eq "ms"; + * next if $from_unit eq "ms" and $to_unit eq "us"; + * for my $round ("floor", "near", "ceil") { + * for(my $big=0; $big <= 1; $big++) { + * next if !$big && ($from_unit eq "us" || $to_unit eq "us"); + * my $sz = $big ? 64 : 32; + * my $sym = "k_${from_unit}_to_${to_unit}_$round$sz"; + * my $type = "u${sz}_t"; + * my $const_hz = ($from_unit eq "cyc" || $to_unit eq "cyc") + * ? "Z_CCYC" : "true"; + * my $ret32 = $big ? "false" : "true"; + * my $rup = $round eq "ceil" ? "true" : "false"; + * my $roff = $round eq "near" ? "true" : "false"; + * + * my $hfrom = $human{$from_unit}; + * my $hto = $human{$to_unit}; + * print "/", "** \@brief Convert $hfrom to $hto\n"; + * print " *\n"; + * print " * Converts time values in $hfrom to $hto.\n"; + * print " * Computes result in $sz bit precision.\n"; + * if ($round eq "ceil") { + * print " * Rounds up to the next highest output unit.\n"; + * } elsif ($round eq "near") { + * print " * Rounds to the nearest output unit.\n"; + * } else { + * print " * Truncates to the next lowest output unit.\n"; + * } + * print " *\n"; + * print " * \@return The converted time value\n"; + * print " *", "/\n"; + * + * print "static inline $type $sym($type t)\n{\n\t"; + * print "/", "* Generated. Do not edit. See above. *", "/\n\t"; + * print "return z_tmcvt(t, Z_HZ_$from_unit, Z_HZ_$to_unit,"; + * print " $const_hz, $ret32, $rup, $roff);\n"; + * print "}\n\n"; + * } + * } + * } + * } + */ + +/* Some more concise declarations to simplify the generator script and + * save bytes below + */ +#define Z_HZ_ms 1000 +#define Z_HZ_us 1000000 +#define Z_HZ_cyc sys_clock_hw_cycles_per_sec() +#define Z_HZ_ticks CONFIG_SYS_CLOCK_TICKS_PER_SEC +#define Z_CCYC (!IS_ENABLED(CONFIG_TIMER_READS_ITS_FREQUENCY_AT_RUNTIME)) + +/** @brief Convert milliseconds to hardware cycles + * + * Converts time values in milliseconds to hardware cycles. + * Computes result in 32 bit precision. + * Truncates to the next lowest output unit. + * + * @return The converted time value + */ +static inline u32_t k_ms_to_cyc_floor32(u32_t t) +{ + /* Generated. Do not edit. See above. */ + return z_tmcvt(t, Z_HZ_ms, Z_HZ_cyc, Z_CCYC, true, false, false); +} + +/** @brief Convert milliseconds to hardware cycles + * + * Converts time values in milliseconds to hardware cycles. + * Computes result in 64 bit precision. + * Truncates to the next lowest output unit. + * + * @return The converted time value + */ +static inline u64_t k_ms_to_cyc_floor64(u64_t t) +{ + /* Generated. Do not edit. See above. */ + return z_tmcvt(t, Z_HZ_ms, Z_HZ_cyc, Z_CCYC, false, false, false); +} + +/** @brief Convert milliseconds to hardware cycles + * + * Converts time values in milliseconds to hardware cycles. + * Computes result in 32 bit precision. + * Rounds to the nearest output unit. + * + * @return The converted time value + */ +static inline u32_t k_ms_to_cyc_near32(u32_t t) +{ + /* Generated. Do not edit. See above. */ + return z_tmcvt(t, Z_HZ_ms, Z_HZ_cyc, Z_CCYC, true, false, true); +} + +/** @brief Convert milliseconds to hardware cycles + * + * Converts time values in milliseconds to hardware cycles. + * Computes result in 64 bit precision. + * Rounds to the nearest output unit. + * + * @return The converted time value + */ +static inline u64_t k_ms_to_cyc_near64(u64_t t) +{ + /* Generated. Do not edit. See above. */ + return z_tmcvt(t, Z_HZ_ms, Z_HZ_cyc, Z_CCYC, false, false, true); +} + +/** @brief Convert milliseconds to hardware cycles + * + * Converts time values in milliseconds to hardware cycles. + * Computes result in 32 bit precision. + * Rounds up to the next highest output unit. + * + * @return The converted time value + */ +static inline u32_t k_ms_to_cyc_ceil32(u32_t t) +{ + /* Generated. Do not edit. See above. */ + return z_tmcvt(t, Z_HZ_ms, Z_HZ_cyc, Z_CCYC, true, true, false); +} + +/** @brief Convert milliseconds to hardware cycles + * + * Converts time values in milliseconds to hardware cycles. + * Computes result in 64 bit precision. + * Rounds up to the next highest output unit. + * + * @return The converted time value + */ +static inline u64_t k_ms_to_cyc_ceil64(u64_t t) +{ + /* Generated. Do not edit. See above. */ + return z_tmcvt(t, Z_HZ_ms, Z_HZ_cyc, Z_CCYC, false, true, false); +} + +/** @brief Convert milliseconds to ticks + * + * Converts time values in milliseconds to ticks. + * Computes result in 32 bit precision. + * Truncates to the next lowest output unit. + * + * @return The converted time value + */ +static inline u32_t k_ms_to_ticks_floor32(u32_t t) +{ + /* Generated. Do not edit. See above. */ + return z_tmcvt(t, Z_HZ_ms, Z_HZ_ticks, true, true, false, false); +} + +/** @brief Convert milliseconds to ticks + * + * Converts time values in milliseconds to ticks. + * Computes result in 64 bit precision. + * Truncates to the next lowest output unit. + * + * @return The converted time value + */ +static inline u64_t k_ms_to_ticks_floor64(u64_t t) +{ + /* Generated. Do not edit. See above. */ + return z_tmcvt(t, Z_HZ_ms, Z_HZ_ticks, true, false, false, false); +} + +/** @brief Convert milliseconds to ticks + * + * Converts time values in milliseconds to ticks. + * Computes result in 32 bit precision. + * Rounds to the nearest output unit. + * + * @return The converted time value + */ +static inline u32_t k_ms_to_ticks_near32(u32_t t) +{ + /* Generated. Do not edit. See above. */ + return z_tmcvt(t, Z_HZ_ms, Z_HZ_ticks, true, true, false, true); +} + +/** @brief Convert milliseconds to ticks + * + * Converts time values in milliseconds to ticks. + * Computes result in 64 bit precision. + * Rounds to the nearest output unit. + * + * @return The converted time value + */ +static inline u64_t k_ms_to_ticks_near64(u64_t t) +{ + /* Generated. Do not edit. See above. */ + return z_tmcvt(t, Z_HZ_ms, Z_HZ_ticks, true, false, false, true); +} + +/** @brief Convert milliseconds to ticks + * + * Converts time values in milliseconds to ticks. + * Computes result in 32 bit precision. + * Rounds up to the next highest output unit. + * + * @return The converted time value + */ +static inline u32_t k_ms_to_ticks_ceil32(u32_t t) +{ + /* Generated. Do not edit. See above. */ + return z_tmcvt(t, Z_HZ_ms, Z_HZ_ticks, true, true, true, false); +} + +/** @brief Convert milliseconds to ticks + * + * Converts time values in milliseconds to ticks. + * Computes result in 64 bit precision. + * Rounds up to the next highest output unit. + * + * @return The converted time value + */ +static inline u64_t k_ms_to_ticks_ceil64(u64_t t) +{ + /* Generated. Do not edit. See above. */ + return z_tmcvt(t, Z_HZ_ms, Z_HZ_ticks, true, false, true, false); +} + +/** @brief Convert microseconds to hardware cycles + * + * Converts time values in microseconds to hardware cycles. + * Computes result in 64 bit precision. + * Truncates to the next lowest output unit. + * + * @return The converted time value + */ +static inline u64_t k_us_to_cyc_floor64(u64_t t) +{ + /* Generated. Do not edit. See above. */ + return z_tmcvt(t, Z_HZ_us, Z_HZ_cyc, Z_CCYC, false, false, false); +} + +/** @brief Convert microseconds to hardware cycles + * + * Converts time values in microseconds to hardware cycles. + * Computes result in 64 bit precision. + * Rounds to the nearest output unit. + * + * @return The converted time value + */ +static inline u64_t k_us_to_cyc_near64(u64_t t) +{ + /* Generated. Do not edit. See above. */ + return z_tmcvt(t, Z_HZ_us, Z_HZ_cyc, Z_CCYC, false, false, true); +} + +/** @brief Convert microseconds to hardware cycles + * + * Converts time values in microseconds to hardware cycles. + * Computes result in 64 bit precision. + * Rounds up to the next highest output unit. + * + * @return The converted time value + */ +static inline u64_t k_us_to_cyc_ceil64(u64_t t) +{ + /* Generated. Do not edit. See above. */ + return z_tmcvt(t, Z_HZ_us, Z_HZ_cyc, Z_CCYC, false, true, false); +} + +/** @brief Convert microseconds to ticks + * + * Converts time values in microseconds to ticks. + * Computes result in 64 bit precision. + * Truncates to the next lowest output unit. + * + * @return The converted time value + */ +static inline u64_t k_us_to_ticks_floor64(u64_t t) +{ + /* Generated. Do not edit. See above. */ + return z_tmcvt(t, Z_HZ_us, Z_HZ_ticks, true, false, false, false); +} + +/** @brief Convert microseconds to ticks + * + * Converts time values in microseconds to ticks. + * Computes result in 64 bit precision. + * Rounds to the nearest output unit. + * + * @return The converted time value + */ +static inline u64_t k_us_to_ticks_near64(u64_t t) +{ + /* Generated. Do not edit. See above. */ + return z_tmcvt(t, Z_HZ_us, Z_HZ_ticks, true, false, false, true); +} + +/** @brief Convert microseconds to ticks + * + * Converts time values in microseconds to ticks. + * Computes result in 64 bit precision. + * Rounds up to the next highest output unit. + * + * @return The converted time value + */ +static inline u64_t k_us_to_ticks_ceil64(u64_t t) +{ + /* Generated. Do not edit. See above. */ + return z_tmcvt(t, Z_HZ_us, Z_HZ_ticks, true, false, true, false); +} + +/** @brief Convert hardware cycles to milliseconds + * + * Converts time values in hardware cycles to milliseconds. + * Computes result in 32 bit precision. + * Truncates to the next lowest output unit. + * + * @return The converted time value + */ +static inline u32_t k_cyc_to_ms_floor32(u32_t t) +{ + /* Generated. Do not edit. See above. */ + return z_tmcvt(t, Z_HZ_cyc, Z_HZ_ms, Z_CCYC, true, false, false); +} + +/** @brief Convert hardware cycles to milliseconds + * + * Converts time values in hardware cycles to milliseconds. + * Computes result in 64 bit precision. + * Truncates to the next lowest output unit. + * + * @return The converted time value + */ +static inline u64_t k_cyc_to_ms_floor64(u64_t t) +{ + /* Generated. Do not edit. See above. */ + return z_tmcvt(t, Z_HZ_cyc, Z_HZ_ms, Z_CCYC, false, false, false); +} + +/** @brief Convert hardware cycles to milliseconds + * + * Converts time values in hardware cycles to milliseconds. + * Computes result in 32 bit precision. + * Rounds to the nearest output unit. + * + * @return The converted time value + */ +static inline u32_t k_cyc_to_ms_near32(u32_t t) +{ + /* Generated. Do not edit. See above. */ + return z_tmcvt(t, Z_HZ_cyc, Z_HZ_ms, Z_CCYC, true, false, true); +} + +/** @brief Convert hardware cycles to milliseconds + * + * Converts time values in hardware cycles to milliseconds. + * Computes result in 64 bit precision. + * Rounds to the nearest output unit. + * + * @return The converted time value + */ +static inline u64_t k_cyc_to_ms_near64(u64_t t) +{ + /* Generated. Do not edit. See above. */ + return z_tmcvt(t, Z_HZ_cyc, Z_HZ_ms, Z_CCYC, false, false, true); +} + +/** @brief Convert hardware cycles to milliseconds + * + * Converts time values in hardware cycles to milliseconds. + * Computes result in 32 bit precision. + * Rounds up to the next highest output unit. + * + * @return The converted time value + */ +static inline u32_t k_cyc_to_ms_ceil32(u32_t t) +{ + /* Generated. Do not edit. See above. */ + return z_tmcvt(t, Z_HZ_cyc, Z_HZ_ms, Z_CCYC, true, true, false); +} + +/** @brief Convert hardware cycles to milliseconds + * + * Converts time values in hardware cycles to milliseconds. + * Computes result in 64 bit precision. + * Rounds up to the next highest output unit. + * + * @return The converted time value + */ +static inline u64_t k_cyc_to_ms_ceil64(u64_t t) +{ + /* Generated. Do not edit. See above. */ + return z_tmcvt(t, Z_HZ_cyc, Z_HZ_ms, Z_CCYC, false, true, false); +} + +/** @brief Convert hardware cycles to microseconds + * + * Converts time values in hardware cycles to microseconds. + * Computes result in 64 bit precision. + * Truncates to the next lowest output unit. + * + * @return The converted time value + */ +static inline u64_t k_cyc_to_us_floor64(u64_t t) +{ + /* Generated. Do not edit. See above. */ + return z_tmcvt(t, Z_HZ_cyc, Z_HZ_us, Z_CCYC, false, false, false); +} + +/** @brief Convert hardware cycles to microseconds + * + * Converts time values in hardware cycles to microseconds. + * Computes result in 64 bit precision. + * Rounds to the nearest output unit. + * + * @return The converted time value + */ +static inline u64_t k_cyc_to_us_near64(u64_t t) +{ + /* Generated. Do not edit. See above. */ + return z_tmcvt(t, Z_HZ_cyc, Z_HZ_us, Z_CCYC, false, false, true); +} + +/** @brief Convert hardware cycles to microseconds + * + * Converts time values in hardware cycles to microseconds. + * Computes result in 64 bit precision. + * Rounds up to the next highest output unit. + * + * @return The converted time value + */ +static inline u64_t k_cyc_to_us_ceil64(u64_t t) +{ + /* Generated. Do not edit. See above. */ + return z_tmcvt(t, Z_HZ_cyc, Z_HZ_us, Z_CCYC, false, true, false); +} + +/** @brief Convert hardware cycles to ticks + * + * Converts time values in hardware cycles to ticks. + * Computes result in 32 bit precision. + * Truncates to the next lowest output unit. + * + * @return The converted time value + */ +static inline u32_t k_cyc_to_ticks_floor32(u32_t t) +{ + /* Generated. Do not edit. See above. */ + return z_tmcvt(t, Z_HZ_cyc, Z_HZ_ticks, Z_CCYC, true, false, false); +} + +/** @brief Convert hardware cycles to ticks + * + * Converts time values in hardware cycles to ticks. + * Computes result in 64 bit precision. + * Truncates to the next lowest output unit. + * + * @return The converted time value + */ +static inline u64_t k_cyc_to_ticks_floor64(u64_t t) +{ + /* Generated. Do not edit. See above. */ + return z_tmcvt(t, Z_HZ_cyc, Z_HZ_ticks, Z_CCYC, false, false, false); +} + +/** @brief Convert hardware cycles to ticks + * + * Converts time values in hardware cycles to ticks. + * Computes result in 32 bit precision. + * Rounds to the nearest output unit. + * + * @return The converted time value + */ +static inline u32_t k_cyc_to_ticks_near32(u32_t t) +{ + /* Generated. Do not edit. See above. */ + return z_tmcvt(t, Z_HZ_cyc, Z_HZ_ticks, Z_CCYC, true, false, true); +} + +/** @brief Convert hardware cycles to ticks + * + * Converts time values in hardware cycles to ticks. + * Computes result in 64 bit precision. + * Rounds to the nearest output unit. + * + * @return The converted time value + */ +static inline u64_t k_cyc_to_ticks_near64(u64_t t) +{ + /* Generated. Do not edit. See above. */ + return z_tmcvt(t, Z_HZ_cyc, Z_HZ_ticks, Z_CCYC, false, false, true); +} + +/** @brief Convert hardware cycles to ticks + * + * Converts time values in hardware cycles to ticks. + * Computes result in 32 bit precision. + * Rounds up to the next highest output unit. + * + * @return The converted time value + */ +static inline u32_t k_cyc_to_ticks_ceil32(u32_t t) +{ + /* Generated. Do not edit. See above. */ + return z_tmcvt(t, Z_HZ_cyc, Z_HZ_ticks, Z_CCYC, true, true, false); +} + +/** @brief Convert hardware cycles to ticks + * + * Converts time values in hardware cycles to ticks. + * Computes result in 64 bit precision. + * Rounds up to the next highest output unit. + * + * @return The converted time value + */ +static inline u64_t k_cyc_to_ticks_ceil64(u64_t t) +{ + /* Generated. Do not edit. See above. */ + return z_tmcvt(t, Z_HZ_cyc, Z_HZ_ticks, Z_CCYC, false, true, false); +} + +/** @brief Convert ticks to milliseconds + * + * Converts time values in ticks to milliseconds. + * Computes result in 32 bit precision. + * Truncates to the next lowest output unit. + * + * @return The converted time value + */ +static inline u32_t k_ticks_to_ms_floor32(u32_t t) +{ + /* Generated. Do not edit. See above. */ + return z_tmcvt(t, Z_HZ_ticks, Z_HZ_ms, true, true, false, false); +} + +/** @brief Convert ticks to milliseconds + * + * Converts time values in ticks to milliseconds. + * Computes result in 64 bit precision. + * Truncates to the next lowest output unit. + * + * @return The converted time value + */ +static inline u64_t k_ticks_to_ms_floor64(u64_t t) +{ + /* Generated. Do not edit. See above. */ + return z_tmcvt(t, Z_HZ_ticks, Z_HZ_ms, true, false, false, false); +} + +/** @brief Convert ticks to milliseconds + * + * Converts time values in ticks to milliseconds. + * Computes result in 32 bit precision. + * Rounds to the nearest output unit. + * + * @return The converted time value + */ +static inline u32_t k_ticks_to_ms_near32(u32_t t) +{ + /* Generated. Do not edit. See above. */ + return z_tmcvt(t, Z_HZ_ticks, Z_HZ_ms, true, true, false, true); +} + +/** @brief Convert ticks to milliseconds + * + * Converts time values in ticks to milliseconds. + * Computes result in 64 bit precision. + * Rounds to the nearest output unit. + * + * @return The converted time value + */ +static inline u64_t k_ticks_to_ms_near64(u64_t t) +{ + /* Generated. Do not edit. See above. */ + return z_tmcvt(t, Z_HZ_ticks, Z_HZ_ms, true, false, false, true); +} + +/** @brief Convert ticks to milliseconds + * + * Converts time values in ticks to milliseconds. + * Computes result in 32 bit precision. + * Rounds up to the next highest output unit. + * + * @return The converted time value + */ +static inline u32_t k_ticks_to_ms_ceil32(u32_t t) +{ + /* Generated. Do not edit. See above. */ + return z_tmcvt(t, Z_HZ_ticks, Z_HZ_ms, true, true, true, false); +} + +/** @brief Convert ticks to milliseconds + * + * Converts time values in ticks to milliseconds. + * Computes result in 64 bit precision. + * Rounds up to the next highest output unit. + * + * @return The converted time value + */ +static inline u64_t k_ticks_to_ms_ceil64(u64_t t) +{ + /* Generated. Do not edit. See above. */ + return z_tmcvt(t, Z_HZ_ticks, Z_HZ_ms, true, false, true, false); +} + +/** @brief Convert ticks to microseconds + * + * Converts time values in ticks to microseconds. + * Computes result in 64 bit precision. + * Truncates to the next lowest output unit. + * + * @return The converted time value + */ +static inline u64_t k_ticks_to_us_floor64(u64_t t) +{ + /* Generated. Do not edit. See above. */ + return z_tmcvt(t, Z_HZ_ticks, Z_HZ_us, true, false, false, false); +} + +/** @brief Convert ticks to microseconds + * + * Converts time values in ticks to microseconds. + * Computes result in 64 bit precision. + * Rounds to the nearest output unit. + * + * @return The converted time value + */ +static inline u64_t k_ticks_to_us_near64(u64_t t) +{ + /* Generated. Do not edit. See above. */ + return z_tmcvt(t, Z_HZ_ticks, Z_HZ_us, true, false, false, true); +} + +/** @brief Convert ticks to microseconds + * + * Converts time values in ticks to microseconds. + * Computes result in 64 bit precision. + * Rounds up to the next highest output unit. + * + * @return The converted time value + */ +static inline u64_t k_ticks_to_us_ceil64(u64_t t) +{ + /* Generated. Do not edit. See above. */ + return z_tmcvt(t, Z_HZ_ticks, Z_HZ_us, true, false, true, false); +} + +/** @brief Convert ticks to hardware cycles + * + * Converts time values in ticks to hardware cycles. + * Computes result in 32 bit precision. + * Truncates to the next lowest output unit. + * + * @return The converted time value + */ +static inline u32_t k_ticks_to_cyc_floor32(u32_t t) +{ + /* Generated. Do not edit. See above. */ + return z_tmcvt(t, Z_HZ_ticks, Z_HZ_cyc, Z_CCYC, true, false, false); +} + +/** @brief Convert ticks to hardware cycles + * + * Converts time values in ticks to hardware cycles. + * Computes result in 64 bit precision. + * Truncates to the next lowest output unit. + * + * @return The converted time value + */ +static inline u64_t k_ticks_to_cyc_floor64(u64_t t) +{ + /* Generated. Do not edit. See above. */ + return z_tmcvt(t, Z_HZ_ticks, Z_HZ_cyc, Z_CCYC, false, false, false); +} + +/** @brief Convert ticks to hardware cycles + * + * Converts time values in ticks to hardware cycles. + * Computes result in 32 bit precision. + * Rounds to the nearest output unit. + * + * @return The converted time value + */ +static inline u32_t k_ticks_to_cyc_near32(u32_t t) +{ + /* Generated. Do not edit. See above. */ + return z_tmcvt(t, Z_HZ_ticks, Z_HZ_cyc, Z_CCYC, true, false, true); +} + +/** @brief Convert ticks to hardware cycles + * + * Converts time values in ticks to hardware cycles. + * Computes result in 64 bit precision. + * Rounds to the nearest output unit. + * + * @return The converted time value + */ +static inline u64_t k_ticks_to_cyc_near64(u64_t t) +{ + /* Generated. Do not edit. See above. */ + return z_tmcvt(t, Z_HZ_ticks, Z_HZ_cyc, Z_CCYC, false, false, true); +} + +/** @brief Convert ticks to hardware cycles + * + * Converts time values in ticks to hardware cycles. + * Computes result in 32 bit precision. + * Rounds up to the next highest output unit. + * + * @return The converted time value + */ +static inline u32_t k_ticks_to_cyc_ceil32(u32_t t) +{ + /* Generated. Do not edit. See above. */ + return z_tmcvt(t, Z_HZ_ticks, Z_HZ_cyc, Z_CCYC, true, true, false); +} + +/** @brief Convert ticks to hardware cycles + * + * Converts time values in ticks to hardware cycles. + * Computes result in 64 bit precision. + * Rounds up to the next highest output unit. + * + * @return The converted time value + */ +static inline u64_t k_ticks_to_cyc_ceil64(u64_t t) +{ + /* Generated. Do not edit. See above. */ + return z_tmcvt(t, Z_HZ_ticks, Z_HZ_cyc, Z_CCYC, false, true, false); +} + +#if defined(CONFIG_TIMER_READS_ITS_FREQUENCY_AT_RUNTIME) +#include +#endif + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /* ZEPHYR_INCLUDE_TIME_UNITS_H_ */ From e5a43a7b19da506e09bcadcd99f1ff650ac4afa0 Mon Sep 17 00:00:00 2001 From: Andy Ross Date: Fri, 28 Jun 2019 12:33:57 -0700 Subject: [PATCH 02/19] kernel: Timer API rework - arbitrary units This patch changes the "timeout" values passed all blocking kernel calls from a 32 bit count of milliseconds to an opaque type which can be configured to be 64 bit. The legacy API still remains via a kconfig for applications which require source-level compatibility with Zephyr 1.14. Implications to note: 1. Timeouts need to be initialized via the K_TIMEOUT_{MS,US,CYC,TICKS}() macros. Raw numbers won't work anymore because the kernel doesn't know the units. 2. K_NO_WAIT and K_FOREVER are now k_timeout_t objects and can be passed directly to blocking APIs. 3. But... K_NO_WAIT and K_FOREVER are now structs, so cannot be tested for equality because C doesn't do that. There is a K_TIMEOUT_EQ() predicate you can use for that. Signed-off-by: Andy Ross --- CMakeLists.txt | 5 + drivers/timer/arcv2_timer0.c | 6 +- drivers/timer/cortex_m_systick.c | 3 +- drivers/timer/hpet.c | 4 +- drivers/timer/native_posix_timer.c | 2 +- drivers/timer/nrf_rtc_timer.c | 2 +- drivers/timer/riscv_machine_timer.c | 2 +- drivers/timer/xtensa_sys_timer.c | 2 +- include/kernel.h | 285 ++++++++++------- include/sys/mutex.h | 8 +- include/sys/sem.h | 8 +- include/sys_clock.h | 338 +++++++++----------- kernel/Kconfig | 25 ++ kernel/futex.c | 5 +- kernel/include/ksched.h | 9 +- kernel/include/timeout_q.h | 24 +- kernel/mailbox.c | 12 +- kernel/mem_slab.c | 4 +- kernel/mempool.c | 26 +- kernel/msg_q.c | 18 +- kernel/mutex.c | 6 +- kernel/pipes.c | 18 +- kernel/poll.c | 10 +- kernel/queue.c | 23 +- kernel/sched.c | 39 ++- kernel/sem.c | 9 +- kernel/stack.c | 7 +- kernel/thread.c | 28 +- kernel/timeout.c | 101 +++++- kernel/timer.c | 50 +-- kernel/work_q.c | 9 +- lib/os/mutex.c | 4 +- lib/os/sem.c | 4 +- lib/posix/pthread_common.c | 2 +- subsys/logging/log_msg.c | 5 +- subsys/power/policy/policy_residency.c | 4 +- subsys/shell/shell.c | 2 +- subsys/shell/shell_log_backend.c | 2 +- subsys/shell/shell_uart.c | 3 +- subsys/testsuite/ztest/src/ztest.c | 2 +- tests/kernel/common/src/errno.c | 2 +- tests/kernel/common/src/timeout_order.c | 5 +- tests/kernel/pending/src/main.c | 12 +- tests/kernel/semaphore/semaphore/src/main.c | 3 +- 44 files changed, 660 insertions(+), 478 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6fbd2f38dd82a..74e68cd156e86 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -579,6 +579,10 @@ add_custom_command( DEPENDS ${syscalls_subdirs_trigger} ${PARSE_SYSCALLS_HEADER_DEPENDS} ) +if(CONFIG_SYS_TIMEOUT_64BIT) + set(GEN_SYSCALLS_EXTRA_ARGS --split-type k_timeout_t) +endif() + add_custom_target(${SYSCALL_LIST_H_TARGET} DEPENDS ${syscall_list_h}) add_custom_command(OUTPUT include/generated/syscall_dispatch.c ${syscall_list_h} # Also, some files are written to include/generated/syscalls/ @@ -589,6 +593,7 @@ add_custom_command(OUTPUT include/generated/syscall_dispatch.c ${syscall_list_h} --base-output include/generated/syscalls # Write to this dir --syscall-dispatch include/generated/syscall_dispatch.c # Write this file --syscall-list ${syscall_list_h} + ${GEN_SYSCALLS_EXTRA_ARGS} WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} DEPENDS ${syscalls_json} ) diff --git a/drivers/timer/arcv2_timer0.c b/drivers/timer/arcv2_timer0.c index bcbe4f919ad55..e2dc750eae11e 100644 --- a/drivers/timer/arcv2_timer0.c +++ b/drivers/timer/arcv2_timer0.c @@ -235,7 +235,8 @@ void z_clock_set_timeout(s32_t ticks, bool idle) * that interrupts are already disabled) */ #ifdef CONFIG_SMP - if (IS_ENABLED(CONFIG_TICKLESS_IDLE) && idle && ticks == K_FOREVER) { + if (IS_ENABLED(CONFIG_TICKLESS_IDLE) && idle + && ticks == K_FOREVER_TICKS) { timer0_control_register_set(0); timer0_count_register_set(0); timer0_limit_register_set(0); @@ -261,7 +262,8 @@ void z_clock_set_timeout(s32_t ticks, bool idle) z_arch_irq_unlock(key); #endif #else - if (IS_ENABLED(CONFIG_TICKLESS_IDLE) && idle && ticks == K_FOREVER) { + if (IS_ENABLED(CONFIG_TICKLESS_IDLE) && idle + && ticks == K_FOREVER_TICKS) { timer0_control_register_set(0); timer0_count_register_set(0); timer0_limit_register_set(0); diff --git a/drivers/timer/cortex_m_systick.c b/drivers/timer/cortex_m_systick.c index 5c80c4c2c2038..b2491dfd27c04 100644 --- a/drivers/timer/cortex_m_systick.c +++ b/drivers/timer/cortex_m_systick.c @@ -120,7 +120,8 @@ void z_clock_set_timeout(s32_t ticks, bool idle) * the counter. (Note: we can assume if idle==true that * interrupts are already disabled) */ - if (IS_ENABLED(CONFIG_TICKLESS_IDLE) && idle && ticks == K_FOREVER) { + if (IS_ENABLED(CONFIG_TICKLESS_IDLE) + && idle && ticks == K_FOREVER_TICKS) { SysTick->CTRL &= ~SysTick_CTRL_ENABLE_Msk; last_load = TIMER_STOPPED; return; diff --git a/drivers/timer/hpet.c b/drivers/timer/hpet.c index 2626cccc533f8..8858dc404acfc 100644 --- a/drivers/timer/hpet.c +++ b/drivers/timer/hpet.c @@ -126,12 +126,12 @@ void z_clock_set_timeout(s32_t ticks, bool idle) ARG_UNUSED(idle); #if defined(CONFIG_TICKLESS_KERNEL) && !defined(CONFIG_QEMU_TICKLESS_WORKAROUND) - if (ticks == K_FOREVER && idle) { + if (ticks == K_FOREVER_TICKS && idle) { GENERAL_CONF_REG &= ~GCONF_ENABLE; return; } - ticks = ticks == K_FOREVER ? max_ticks : ticks; + ticks = ticks == K_FOREVER_TICKS ? max_ticks : ticks; ticks = MAX(MIN(ticks - 1, (s32_t)max_ticks), 0); k_spinlock_key_t key = k_spin_lock(&lock); diff --git a/drivers/timer/native_posix_timer.c b/drivers/timer/native_posix_timer.c index e730c114be8bb..9a2df2d66e8d9 100644 --- a/drivers/timer/native_posix_timer.c +++ b/drivers/timer/native_posix_timer.c @@ -90,7 +90,7 @@ void z_clock_set_timeout(s32_t ticks, bool idle) /* Note that we treat INT_MAX literally as anyhow the maximum amount of * ticks we can report with z_clock_announce() is INT_MAX */ - if (ticks == K_FOREVER) { + if (ticks == K_FOREVER_TICKS) { silent_ticks = INT64_MAX; } else if (ticks > 0) { silent_ticks = ticks - 1; diff --git a/drivers/timer/nrf_rtc_timer.c b/drivers/timer/nrf_rtc_timer.c index fe8c34a5198f9..772ff0476cba7 100644 --- a/drivers/timer/nrf_rtc_timer.c +++ b/drivers/timer/nrf_rtc_timer.c @@ -114,7 +114,7 @@ void z_clock_set_timeout(s32_t ticks, bool idle) ARG_UNUSED(idle); #ifdef CONFIG_TICKLESS_KERNEL - ticks = (ticks == K_FOREVER) ? MAX_TICKS : ticks; + ticks = (ticks == K_FOREVER_TICKS) ? MAX_TICKS : ticks; ticks = MAX(MIN(ticks - 1, (s32_t)MAX_TICKS), 0); k_spinlock_key_t key = k_spin_lock(&lock); diff --git a/drivers/timer/riscv_machine_timer.c b/drivers/timer/riscv_machine_timer.c index 93a5d2ac34e41..faf16eb31abd5 100644 --- a/drivers/timer/riscv_machine_timer.c +++ b/drivers/timer/riscv_machine_timer.c @@ -94,7 +94,7 @@ void z_clock_set_timeout(s32_t ticks, bool idle) return; } - ticks = ticks == K_FOREVER ? MAX_TICKS : ticks; + ticks = ticks == K_FOREVER_TICKS ? MAX_TICKS : ticks; ticks = MAX(MIN(ticks - 1, (s32_t)MAX_TICKS), 0); k_spinlock_key_t key = k_spin_lock(&lock); diff --git a/drivers/timer/xtensa_sys_timer.c b/drivers/timer/xtensa_sys_timer.c index b0fe417faf9fc..e68afe7b41559 100644 --- a/drivers/timer/xtensa_sys_timer.c +++ b/drivers/timer/xtensa_sys_timer.c @@ -70,7 +70,7 @@ void z_clock_set_timeout(s32_t ticks, bool idle) ARG_UNUSED(idle); #if defined(CONFIG_TICKLESS_KERNEL) && !defined(CONFIG_QEMU_TICKLESS_WORKAROUND) - ticks = ticks == K_FOREVER ? MAX_TICKS : ticks; + ticks = ticks == K_FOREVER_TICKS ? MAX_TICKS : ticks; ticks = MAX(MIN(ticks - 1, (s32_t)MAX_TICKS), 0); k_spinlock_key_t key = k_spin_lock(&lock); diff --git a/include/kernel.h b/include/kernel.h index 8ff4cd61b00ef..fa9be7a5d609b 100644 --- a/include/kernel.h +++ b/include/kernel.h @@ -722,7 +722,7 @@ __syscall k_tid_t k_thread_create(struct k_thread *new_thread, size_t stack_size, k_thread_entry_t entry, void *p1, void *p2, void *p3, - int prio, u32_t options, s32_t delay); + int prio, u32_t options, k_timeout_t delay); /** * @brief Drop a thread's privileges permanently to user mode @@ -1165,6 +1165,40 @@ __syscall void k_thread_suspend(k_tid_t thread); */ __syscall void k_thread_resume(k_tid_t thread); +/** @brief Return thread timeout expiration uptime + * + * This routine returns the system uptime count that will expire + * before the thread is scheduled to wake up (from whatever timeout or + * sleep it has pended on). If the thread is not sleeping, it returns + * the current time. If the thread is suspended indefinitely, it + * returns K_FOREVER_TICKS. + */ +__syscall k_ticks_t k_thread_timeout_end_ticks(k_tid_t thread); + +static inline k_ticks_t z_impl_k_thread_timeout_end_ticks(k_tid_t thread) +{ + extern k_ticks_t z_thread_end(k_tid_t thread); + + return z_thread_end(thread); +} + +/** @brief Return thread timeout remaining time + * + * This routine returns the number of ticks that will elapse before + * the thread is scheduled to wake up (from whatever timeout, creation + * delay or sleep it has pended on). If the thread is not sleeping, + * it returns zero. If the thread is suspended indefinitely or not + * yet started, it returns K_FOREVER_TICKS. + */ +__syscall k_ticks_t k_thread_timeout_remaining_ticks(k_tid_t thread); + +static inline k_ticks_t z_impl_k_thread_timeout_remaining_ticks(k_tid_t thread) +{ + extern k_ticks_t z_thread_remaining(k_tid_t thread); + + return z_thread_remaining(thread); +} + /** * @brief Set time-slicing period and scope. * @@ -1353,78 +1387,6 @@ const char *k_thread_state_str(k_tid_t thread_id); * @} */ -/** - * @addtogroup clock_apis - * @{ - */ - -/** - * @brief Generate null timeout delay. - * - * This macro generates a timeout delay that that instructs a kernel API - * not to wait if the requested operation cannot be performed immediately. - * - * @return Timeout delay value. - */ -#define K_NO_WAIT 0 - -/** - * @brief Generate timeout delay from milliseconds. - * - * This macro generates a timeout delay that that instructs a kernel API - * to wait up to @a ms milliseconds to perform the requested operation. - * - * @param ms Duration in milliseconds. - * - * @return Timeout delay value. - */ -#define K_MSEC(ms) (ms) - -/** - * @brief Generate timeout delay from seconds. - * - * This macro generates a timeout delay that that instructs a kernel API - * to wait up to @a s seconds to perform the requested operation. - * - * @param s Duration in seconds. - * - * @return Timeout delay value. - */ -#define K_SECONDS(s) K_MSEC((s) * MSEC_PER_SEC) - -/** - * @brief Generate timeout delay from minutes. - * - * This macro generates a timeout delay that that instructs a kernel API - * to wait up to @a m minutes to perform the requested operation. - * - * @param m Duration in minutes. - * - * @return Timeout delay value. - */ -#define K_MINUTES(m) K_SECONDS((m) * 60) - -/** - * @brief Generate timeout delay from hours. - * - * This macro generates a timeout delay that that instructs a kernel API - * to wait up to @a h hours to perform the requested operation. - * - * @param h Duration in hours. - * - * @return Timeout delay value. - */ -#define K_HOURS(h) K_MINUTES((h) * 60) - -/** - * @brief Generate infinite timeout delay. - * - * This macro generates a timeout delay that that instructs a kernel API - * to wait as long as necessary to perform the requested operation. - * - * @return Timeout delay value. - */ -#define K_FOREVER (-1) /** * @} @@ -1452,7 +1414,7 @@ struct k_timer { void (*stop_fn)(struct k_timer *timer); /* timer period */ - s32_t period; + k_timeout_t period; /* timer status */ u32_t status; @@ -1561,13 +1523,14 @@ extern void k_timer_init(struct k_timer *timer, * using the new duration and period values. * * @param timer Address of timer. - * @param duration Initial timer duration (in milliseconds). - * @param period Timer period (in milliseconds). + * @param duration Initial timer duration, initialized with one of the + * K_TIMEOUT_*() macros, or K_NO_WAIT. + * @param period Timer period (likewise). * * @return N/A */ __syscall void k_timer_start(struct k_timer *timer, - s32_t duration, s32_t period); + k_timeout_t duration, k_timeout_t period); /** * @brief Stop a timer. @@ -1620,24 +1583,55 @@ __syscall u32_t k_timer_status_get(struct k_timer *timer); */ __syscall u32_t k_timer_status_sync(struct k_timer *timer); -extern s32_t z_timeout_remaining(struct _timeout *timeout); +extern k_ticks_t z_timeout_end(struct _timeout *timeout); +extern k_ticks_t z_timeout_remaining(struct _timeout *timeout); + +/** + * @brief Get uptime expiration of a timer + * + * This routine returns the value of the system uptime counter at + * which point a running timer will expire. If the timer is not + * running, it returns K_FOREVER_TICKS. + * + * @param timer Address of timer. + * + * @return Uptime (in ticks). + */ +__syscall k_ticks_t k_timer_end_ticks(struct k_timer *timer); + +static inline k_ticks_t z_impl_k_timer_end_ticks(struct k_timer *timer) +{ + return z_timeout_end(&timer->timeout); +} /** * @brief Get time remaining before a timer next expires. * - * This routine computes the (approximate) time remaining before a running - * timer next expires. If the timer is not running, it returns zero. + * This routine returns the number of system ticks that will elapse + * before a running timer next expires (that is, the time until + * expiration is at least as long as the return value). If the timer + * is not running, it returns K_FOREVER_TICKS. * * @param timer Address of timer. * - * @return Remaining time (in milliseconds). + * @return Remaining time (in ticks). */ -__syscall u32_t k_timer_remaining_get(struct k_timer *timer); +__syscall k_ticks_t k_timer_remaining_ticks(struct k_timer *timer); -static inline u32_t z_impl_k_timer_remaining_get(struct k_timer *timer) +static inline k_ticks_t z_impl_k_timer_remaining_ticks(struct k_timer *timer) { - const s32_t ticks = z_timeout_remaining(&timer->timeout); - return (ticks > 0) ? (u32_t)__ticks_to_ms(ticks) : 0U; + return z_timeout_remaining(&timer->timeout); +} + +/* Legacy, to be deprecated, use k_timer_remaining_ticks() */ +static inline u32_t k_timer_remaining_get(struct k_timer *timer) +{ + u32_t ticks = k_timer_remaining_ticks(timer); + + if (ticks == (u32_t)K_FOREVER_TICKS) { + return 0; + } + return (u32_t)k_ticks_to_ms_floor32(ticks); } /** @@ -1686,6 +1680,17 @@ static inline void *z_impl_k_timer_user_data_get(struct k_timer *timer) * @{ */ +/* + * @brief Get system uptime in ticks + * + * This routine returns the system uptime as measured by the system + * core timekeeping unit. It is intended for use in applications + * which need careful attention to timing granularity. The values may + * be converted to real time and cycle units with the k_ticks_to_*() + * APIs. + */ +__syscall u64_t k_uptime_ticks(void); + /** * @brief Get system uptime. * @@ -1701,7 +1706,10 @@ static inline void *z_impl_k_timer_user_data_get(struct k_timer *timer) * * @return Current uptime in milliseconds. */ -__syscall s64_t k_uptime_get(void); +static inline s64_t k_uptime_get(void) +{ + return k_ticks_to_ms_floor64(k_uptime_ticks()); +} /** * @brief Enable clock always on in tickless kernel @@ -2023,7 +2031,7 @@ extern void k_queue_merge_slist(struct k_queue *queue, sys_slist_t *list); * @return Address of the data item if successful; NULL if returned * without waiting, or waiting period timed out. */ -__syscall void *k_queue_get(struct k_queue *queue, s32_t timeout); +__syscall void *k_queue_get(struct k_queue *queue, k_timeout_t timeout); /** * @brief Remove an element from a queue. @@ -2195,7 +2203,8 @@ struct z_futex_data { * should check the futex's value on wakeup to determine if it needs * to block again. */ -__syscall int k_futex_wait(struct k_futex *futex, int expected, s32_t timeout); +__syscall int k_futex_wait(struct k_futex *futex, int expected, + k_timeout_t timeout); /** * @brief Wake one/all threads pending on a futex @@ -2658,7 +2667,7 @@ __syscall void k_stack_push(struct k_stack *stack, stack_data_t data); * @retval -EAGAIN Waiting period timed out. * @req K-STACK-001 */ -__syscall int k_stack_pop(struct k_stack *stack, stack_data_t *data, s32_t timeout); +__syscall int k_stack_pop(struct k_stack *stack, stack_data_t *data, k_timeout_t timeout); /** * @brief Statically define and initialize a stack @@ -2944,7 +2953,7 @@ extern void k_delayed_work_init(struct k_delayed_work *work, * * @param work_q Address of workqueue. * @param work Address of delayed work item. - * @param delay Delay before submitting the work item (in milliseconds). + * @param delay Delay timeout before submitting the work item * * @retval 0 Work item countdown started. * @retval -EINVAL Work item is being processed or has completed its work. @@ -2953,7 +2962,7 @@ extern void k_delayed_work_init(struct k_delayed_work *work, */ extern int k_delayed_work_submit_to_queue(struct k_work_q *work_q, struct k_delayed_work *work, - s32_t delay); + k_timeout_t delay); /** * @brief Cancel a delayed work item. @@ -2976,6 +2985,57 @@ extern int k_delayed_work_submit_to_queue(struct k_work_q *work_q, */ extern int k_delayed_work_cancel(struct k_delayed_work *work); +/** + * @brief Get uptime expiration of a delayed_work + * + * This routine returns the value of the system uptime counter at + * which point a scheduled delayed work item will execute. If the + * delayed_work is not scheduled, it returns the current time. + * + * @param delayed_work Address of delayed work item + * + * @return Uptime (in ticks). + */ +__syscall k_ticks_t k_delayed_work_end_ticks(struct k_delayed_work *dw); + +static inline +k_ticks_t z_impl_k_delayed_work_end_ticks(struct k_delayed_work *dw) +{ + return z_timeout_end(&dw->timeout); +} + +/** + * @brief Get time remaining before a k_delayed_work next expires. + * + * This routine returns the number of system ticks that will elapse + * before a scheduled k_delayed_work item runs (that is, the time + * until execution is at least as long as the return value). If the + * delayed_work is not running, it returns K_FOREVER_TICKS. + * + * @param delayed_work Address of delayed work item. + * + * @return Remaining time (in ticks). + */ +__syscall k_ticks_t k_delayed_work_remaining_ticks(struct k_delayed_work *dw); + +static inline k_ticks_t +z_impl_k_delayed_work_remaining_ticks(struct k_delayed_work *dw) +{ + return z_timeout_remaining(&dw->timeout); +} + +/* Legacy, to be deprecated, use k_delayed_work_remaining_ticks() */ +static inline u32_t k_delayed_work_remaining_get(struct k_delayed_work *dw) +{ + k_ticks_t t = k_delayed_work_remaining_ticks(dw); + + if (t == K_FOREVER_TICKS) { + return 0; + } + + return (u32_t)k_ticks_to_ms_floor32(t); +} + /** * @brief Submit a work item to the system workqueue. * @@ -3036,28 +3096,11 @@ static inline void k_work_submit(struct k_work *work) * @req K-DWORK-001 */ static inline int k_delayed_work_submit(struct k_delayed_work *work, - s32_t delay) + k_timeout_t delay) { return k_delayed_work_submit_to_queue(&k_sys_work_q, work, delay); } -/** - * @brief Get time remaining before a delayed work gets scheduled. - * - * This routine computes the (approximate) time remaining before a - * delayed work gets executed. If the delayed work is not waiting to be - * scheduled, it returns zero. - * - * @param work Delayed work item. - * - * @return Remaining time (in milliseconds). - * @req K-DWORK-001 - */ -static inline s32_t k_delayed_work_remaining_get(struct k_delayed_work *work) -{ - return __ticks_to_ms(z_timeout_remaining(&work->timeout)); -} - /** @} */ /** * @defgroup mutex_apis Mutex APIs @@ -3144,7 +3187,7 @@ __syscall void k_mutex_init(struct k_mutex *mutex); * @retval -EAGAIN Waiting period timed out. * @req K-MUTEX-002 */ -__syscall int k_mutex_lock(struct k_mutex *mutex, s32_t timeout); +__syscall int k_mutex_lock(struct k_mutex *mutex, k_timeout_t timeout); /** * @brief Unlock a mutex. @@ -3238,7 +3281,7 @@ __syscall void k_sem_init(struct k_sem *sem, unsigned int initial_count, * @retval -EAGAIN Waiting period timed out. * @req K-SEM-001 */ -__syscall int k_sem_take(struct k_sem *sem, s32_t timeout); +__syscall int k_sem_take(struct k_sem *sem, k_timeout_t timeout); /** * @brief Give a semaphore. @@ -3466,7 +3509,7 @@ void k_msgq_cleanup(struct k_msgq *q); * @retval -EAGAIN Waiting period timed out. * @req K-MSGQ-002 */ -__syscall int k_msgq_put(struct k_msgq *q, void *data, s32_t timeout); +__syscall int k_msgq_put(struct k_msgq *q, void *data, k_timeout_t timeout); /** * @brief Receive a message from a message queue. @@ -3486,7 +3529,7 @@ __syscall int k_msgq_put(struct k_msgq *q, void *data, s32_t timeout); * @retval -EAGAIN Waiting period timed out. * @req K-MSGQ-002 */ -__syscall int k_msgq_get(struct k_msgq *q, void *data, s32_t timeout); +__syscall int k_msgq_get(struct k_msgq *q, void *data, k_timeout_t timeout); /** * @brief Peek/read a message from a message queue. @@ -3696,7 +3739,7 @@ extern void k_mbox_init(struct k_mbox *mbox); * @req K-MBOX-002 */ extern int k_mbox_put(struct k_mbox *mbox, struct k_mbox_msg *tx_msg, - s32_t timeout); + k_timeout_t timeout); /** * @brief Send a mailbox message in an asynchronous manner. @@ -3737,7 +3780,7 @@ extern void k_mbox_async_put(struct k_mbox *mbox, struct k_mbox_msg *tx_msg, * @req K-MBOX-002 */ extern int k_mbox_get(struct k_mbox *mbox, struct k_mbox_msg *rx_msg, - void *buffer, s32_t timeout); + void *buffer, k_timeout_t timeout); /** * @brief Retrieve mailbox message data into a buffer. @@ -3790,7 +3833,7 @@ extern void k_mbox_data_get(struct k_mbox_msg *rx_msg, void *buffer); */ extern int k_mbox_data_block_get(struct k_mbox_msg *rx_msg, struct k_mem_pool *pool, - struct k_mem_block *block, s32_t timeout); + struct k_mem_block *block, k_timeout_t timeout); /** @} */ @@ -3933,7 +3976,7 @@ __syscall int k_pipe_alloc_init(struct k_pipe *pipe, size_t size); */ __syscall int k_pipe_put(struct k_pipe *pipe, void *data, size_t bytes_to_write, size_t *bytes_written, - size_t min_xfer, s32_t timeout); + size_t min_xfer, k_timeout_t timeout); /** * @brief Read data from a pipe. @@ -3957,7 +4000,7 @@ __syscall int k_pipe_put(struct k_pipe *pipe, void *data, */ __syscall int k_pipe_get(struct k_pipe *pipe, void *data, size_t bytes_to_read, size_t *bytes_read, - size_t min_xfer, s32_t timeout); + size_t min_xfer, k_timeout_t timeout); /** * @brief Write memory block to a pipe. @@ -4087,7 +4130,7 @@ extern void k_mem_slab_init(struct k_mem_slab *slab, void *buffer, * @req K-MSLAB-002 */ extern int k_mem_slab_alloc(struct k_mem_slab *slab, void **mem, - s32_t timeout); + k_timeout_t timeout); /** * @brief Free memory allocated from a memory slab. @@ -4210,7 +4253,7 @@ struct k_mem_pool { * @req K-MPOOL-002 */ extern int k_mem_pool_alloc(struct k_mem_pool *pool, struct k_mem_block *block, - size_t size, s32_t timeout); + size_t size, k_timeout_t timeout); /** * @brief Allocate memory from a memory pool with malloc() semantics @@ -4543,7 +4586,7 @@ extern void k_poll_event_init(struct k_poll_event *event, u32_t type, */ __syscall int k_poll(struct k_poll_event *events, int num_events, - s32_t timeout); + k_timeout_t timeout); /** * @brief Initialize a poll signal object. diff --git a/include/sys/mutex.h b/include/sys/mutex.h index 9d97a4199031f..7c700600c41f4 100644 --- a/include/sys/mutex.h +++ b/include/sys/mutex.h @@ -54,7 +54,8 @@ static inline void sys_mutex_init(struct sys_mutex *mutex) */ } -__syscall int z_sys_mutex_kernel_lock(struct sys_mutex *mutex, s32_t timeout); +__syscall int z_sys_mutex_kernel_lock(struct sys_mutex *mutex, + k_timeout_t timeout); __syscall int z_sys_mutex_kernel_unlock(struct sys_mutex *mutex); @@ -78,7 +79,8 @@ __syscall int z_sys_mutex_kernel_unlock(struct sys_mutex *mutex); * @retval -EACCESS Caller has no access to provided mutex address * @retval -EINVAL Provided mutex not recognized by the kernel */ -static inline int sys_mutex_lock(struct sys_mutex *mutex, s32_t timeout) +static inline int sys_mutex_lock(struct sys_mutex *mutex, + k_timeout_t timeout) { /* For now, make the syscall unconditionally */ return z_sys_mutex_kernel_lock(mutex, timeout); @@ -126,7 +128,7 @@ static inline void sys_mutex_init(struct sys_mutex *mutex) k_mutex_init(&mutex->kernel_mutex); } -static inline int sys_mutex_lock(struct sys_mutex *mutex, s32_t timeout) +static inline int sys_mutex_lock(struct sys_mutex *mutex, k_timeout_t timeout) { return k_mutex_lock(&mutex->kernel_mutex, timeout); } diff --git a/include/sys/sem.h b/include/sys/sem.h index 1e02a1f0a60ab..d6b9086bd8ea9 100644 --- a/include/sys/sem.h +++ b/include/sys/sem.h @@ -110,15 +110,17 @@ int sys_sem_give(struct sys_sem *sem); * This routine takes @a sem. * * @param sem Address of the sys_sem. - * @param timeout Waiting period to take the sys_sem (in milliseconds), - * or one of the special values K_NO_WAIT and K_FOREVER. + * @param timeout Waiting period to take the sys_sem, should be + * initialized with one of the K_TIMEOUT_*() macros, or + * be one of the special values K_NO_WAIT and + * K_FOREVER. * * @retval 0 sys_sem taken. * @retval -EINVAL Parameter address not recognized. * @retval -ETIMEDOUT Waiting period timed out. * @retval -EACCES Caller does not have enough access. */ -int sys_sem_take(struct sys_sem *sem, s32_t timeout); +int sys_sem_take(struct sys_sem *sem, k_timeout_t timeout); /** * @brief Get sys_sem's value diff --git a/include/sys_clock.h b/include/sys_clock.h index fa95409afb45b..094132b8b978f 100644 --- a/include/sys_clock.h +++ b/include/sys_clock.h @@ -1,248 +1,216 @@ /* * Copyright (c) 2014-2015 Wind River Systems, Inc. + * Copyright (c) 2019 Intel Corporation * * SPDX-License-Identifier: Apache-2.0 */ -/** - * @file - * @brief Variables needed needed for system clock - * - * - * Declare variables used by both system timer device driver and kernel - * components that use timer functionality. - */ - #ifndef ZEPHYR_INCLUDE_SYS_CLOCK_H_ #define ZEPHYR_INCLUDE_SYS_CLOCK_H_ #include #include - #include #include +#include #ifdef __cplusplus extern "C" { #endif -#ifdef CONFIG_TICKLESS_KERNEL -extern int _sys_clock_always_on; -extern void z_enable_sys_clock(void); -#endif - -#if defined(CONFIG_TIMER_READS_ITS_FREQUENCY_AT_RUNTIME) -__syscall int z_clock_hw_cycles_per_sec_runtime_get(void); - -static inline int z_impl_z_clock_hw_cycles_per_sec_runtime_get(void) -{ - extern int z_clock_hw_cycles_per_sec; - - return z_clock_hw_cycles_per_sec; -} -#endif /* CONFIG_TIMER_READS_ITS_FREQUENCY_AT_RUNTIME */ - -static inline int sys_clock_hw_cycles_per_sec(void) -{ -#if defined(CONFIG_TIMER_READS_ITS_FREQUENCY_AT_RUNTIME) - return z_clock_hw_cycles_per_sec_runtime_get(); +#ifdef CONFIG_SYS_TIMEOUT_64BIT +typedef u64_t k_ticks_t; #else - return CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC; +typedef u32_t k_ticks_t; #endif -} -/* Note that some systems with comparatively slow cycle counters - * experience precision loss when doing math like this. In the - * general case it is not correct that "cycles" are much faster than - * "ticks". +/* Putting the docs at the top allows the macros to be defined below + * more cleanly. They vary with configuration. */ -static inline int sys_clock_hw_cycles_per_tick(void) -{ -#ifdef CONFIG_SYS_CLOCK_EXISTS - return sys_clock_hw_cycles_per_sec() / CONFIG_SYS_CLOCK_TICKS_PER_SEC; -#else - return 1; /* Just to avoid a division by zero */ -#endif -} - -#if defined(CONFIG_SYS_CLOCK_EXISTS) && \ - (CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC == 0) -#error "SYS_CLOCK_HW_CYCLES_PER_SEC must be non-zero!" -#endif - -/* number of nsec per usec */ -#define NSEC_PER_USEC 1000U - -/* number of microseconds per millisecond */ -#define USEC_PER_MSEC 1000U - -/* number of milliseconds per second */ -#define MSEC_PER_SEC 1000U - -/* number of microseconds per second */ -#define USEC_PER_SEC ((USEC_PER_MSEC) * (MSEC_PER_SEC)) - -/* number of nanoseconds per second */ -#define NSEC_PER_SEC ((NSEC_PER_USEC) * (USEC_PER_MSEC) * (MSEC_PER_SEC)) - - -/* kernel clocks */ -/* - * We default to using 64-bit intermediates in timescale conversions, - * but if the HW timer cycles/sec, ticks/sec and ms/sec are all known - * to be nicely related, then we can cheat with 32 bits instead. +/** \def K_TIMEOUT_TICKS(t) + * @brief Initializes a k_timeout_t object with ticks + * + * Evaluates to a k_timeout_t object representing an API timeout that + * will expire at least @a t ticks in the future. + * + * @param t Timeout in ticks */ -#ifdef CONFIG_SYS_CLOCK_EXISTS - -#if defined(CONFIG_TIMER_READS_ITS_FREQUENCY_AT_RUNTIME) || \ - (MSEC_PER_SEC % CONFIG_SYS_CLOCK_TICKS_PER_SEC) || \ - (CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC % CONFIG_SYS_CLOCK_TICKS_PER_SEC) -#define _NEED_PRECISE_TICK_MS_CONVERSION -#endif - -#endif - -static ALWAYS_INLINE s32_t z_ms_to_ticks(s32_t ms) -{ -#ifdef CONFIG_SYS_CLOCK_EXISTS - -#ifdef _NEED_PRECISE_TICK_MS_CONVERSION - int cyc = sys_clock_hw_cycles_per_sec(); - - /* use 64-bit math to keep precision */ - return (s32_t)ceiling_fraction((s64_t)ms * cyc, - ((s64_t)MSEC_PER_SEC * cyc) / CONFIG_SYS_CLOCK_TICKS_PER_SEC); -#else - /* simple division keeps precision */ - s32_t ms_per_tick = MSEC_PER_SEC / CONFIG_SYS_CLOCK_TICKS_PER_SEC; - - return (s32_t)ceiling_fraction(ms, ms_per_tick); -#endif - -#else - __ASSERT(ms == 0, "ms not zero"); - return 0; -#endif -} - -static inline u64_t __ticks_to_ms(s64_t ticks) -{ -#ifdef CONFIG_SYS_CLOCK_EXISTS - return (u64_t)ticks * MSEC_PER_SEC / - (u64_t)CONFIG_SYS_CLOCK_TICKS_PER_SEC; -#else - __ASSERT(ticks == 0, "ticks not zero"); - return 0ULL; -#endif -} - -/* - * These are only currently used by k_usleep(), but they are - * defined here for parity with their ms analogs above. Note: - * we don't bother trying the 32-bit intermediate shortcuts - * possible with ms, because of the magnitudes involved. +/** \def K_TIMEOUT_MS(t) + * @brief Initializes a k_timeout_t object with milliseconds + * + * Evaluates to a k_timeout_t object representing an API timeout that + * will expire at least @a t milliseconds in the future. + * + * @param t Timeout in milliseconds */ -static inline s32_t z_us_to_ticks(s32_t us) -{ -#ifdef CONFIG_SYS_CLOCK_EXISTS - return (s32_t) ceiling_fraction( - (s64_t)us * sys_clock_hw_cycles_per_sec(), - ((s64_t)USEC_PER_SEC * sys_clock_hw_cycles_per_sec()) / - CONFIG_SYS_CLOCK_TICKS_PER_SEC); -#else - __ASSERT(us == 0, "us not zero"); - return 0; -#endif -} - -static inline s32_t __ticks_to_us(s32_t ticks) -{ -#ifdef CONFIG_SYS_CLOCK_EXISTS - return (s32_t) ((s64_t)ticks * USEC_PER_SEC / - (s64_t)CONFIG_SYS_CLOCK_TICKS_PER_SEC); -#else - __ASSERT(ticks == 0, "ticks not zero"); - return 0; -#endif -} - -/* added tick needed to account for tick in progress */ -#define _TICK_ALIGN 1 - -/* SYS_CLOCK_HW_CYCLES_TO_NS64 converts CPU clock cycles to nanoseconds */ -#define SYS_CLOCK_HW_CYCLES_TO_NS64(X) \ - (((u64_t)(X) * NSEC_PER_SEC) / sys_clock_hw_cycles_per_sec()) - -/* - * SYS_CLOCK_HW_CYCLES_TO_NS_AVG converts CPU clock cycles to nanoseconds - * and calculates the average cycle time +/** \def K_TIMEOUT_US(t) + * @brief Initializes a k_timeout_t object with microseconds + * + * Evaluates to a k_timeout_t object representing an API timeout that + * will expire at least @a t microseconds in the future. + * + * @param t Timeout in microseconds */ -#define SYS_CLOCK_HW_CYCLES_TO_NS_AVG(X, NCYCLES) \ - (u32_t)(SYS_CLOCK_HW_CYCLES_TO_NS64(X) / NCYCLES) -/** - * @defgroup clock_apis Kernel Clock APIs - * @ingroup kernel_apis - * @{ +/** \def K_TIMEOUT_CYC(t) + * @brief Initializes a k_timeout_t object with hardware cycles + * + * Evaluates to a k_timeout_t object representing an API timeout that + * will expire at least @a t hardware cycles in the future. + * + * @param t Timeout in hardware cycles */ -/** - * @brief Compute nanoseconds from hardware clock cycles. +/** \def K_TIMEOUT_ABSOLUTE_TICKS(t) + * @brief Initializes a k_timeout_t object with uptime in ticks * - * This macro converts a time duration expressed in hardware clock cycles - * to the equivalent duration expressed in nanoseconds. + * Evaluates to a k_timeout_t object representing an API timeout that + * will expire after the system uptime reaches @a t ticks * - * @param X Duration in hardware clock cycles. - * - * @return Duration in nanoseconds. + * @param t Timeout in ticks */ -#define SYS_CLOCK_HW_CYCLES_TO_NS(X) (u32_t)(SYS_CLOCK_HW_CYCLES_TO_NS64(X)) -/** - * @} end defgroup clock_apis +/** \def K_TIMEOUT_ABSOLUTE_MS(t) + * @brief Initializes a k_timeout_t object with uptime in milliseconds + * + * Evaluates to a k_timeout_t object representing an API timeout that + * will expire after the system uptime reaches @a t milliseconds + * + * @param t Timeout in milliseconds */ -/** +/** \def K_TIMEOUT_ABSOLUTE_US(t) + * @brief Initializes a k_timeout_t object with uptime in microseconds * - * @brief Return the lower part of the current system tick count + * Evaluates to a k_timeout_t object representing an API timeout that + * will expire after the system uptime reaches @a t microseconds + * + * @param t Timeout in microseconds + */ + +/** \def K_TIMEOUT_ABSOLUTE_CYC(t) + * @brief Initializes a k_timeout_t object with uptime in hardware cycles * - * @return the current system tick count + * Evaluates to a k_timeout_t object representing an API timeout that + * will expire after the system uptime reaches @a t hardware cycles * + * @param t Timeout in hardware cycles */ -u32_t z_tick_get_32(void); -/** +/** \def K_TIMEOUT_GET(t) + * @brief Returns the ticks expiration from a k_timeout_t * - * @brief Return the current system tick count + * Evaluates to the integer number of ticks stored in the k_timeout_t + * argument, or K_FOREVER_TICKS. * - * @return the current system tick count + * @param t A k_timeout_t object + */ + +/** \def K_NO_WAIT + * @brief Constant k_timeout_t representing immediate expiration * + * Evaluates to a k_timeout_t object representing an API timeout that + * will expire immediately (i.e. it produces a synchronous return) + */ + +/** \def K_FOREVER + * @brief Constaint k_timeout_t object representing "never expires" + * + * Evaluates to a k_timeout_t object representing an API timeout that + * will never expire (such a call will wait forever). */ -s64_t z_tick_get(void); -#ifndef CONFIG_SYS_CLOCK_EXISTS -#define z_tick_get() (0) -#define z_tick_get_32() (0) +/** @brief k_ticks_t value representing no expiration + * + * The internal ticks value of a k_timeout_t used to represent "no + * expiration, wait forever". + */ +#define K_FOREVER_TICKS ((k_ticks_t) -1) + +#ifdef CONFIG_SYS_TIMEOUT_LEGACY_API +/* Fallback API where timeouts are still 32 bit millisecond counts */ +typedef k_ticks_t k_timeout_t; +#define K_TIMEOUT_MS(t) (t) +#define K_TIMEOUT_TICKS(t) K_TIMEOUT_MS(k_ticks_to_ms_ceil32(t)) +#define K_TIMEOUT_US(t) K_TIMEOUT_MS(((t) + 999) / 1000) +#define K_TIMEOUT_CYC(t) K_TIMEOUT_MS(k_cyc_to_ms_ceil32(t)) +#define K_TIMEOUT_GET(t) (t) +#define K_NO_WAIT 0 +#define K_FOREVER K_FOREVER_TICKS +#else +/* New API going forward: k_timeout_t is an opaque struct */ +typedef struct { k_ticks_t ticks; } k_timeout_t; +#define K_TIMEOUT_TICKS(t) ((k_timeout_t){ (k_ticks_t)t }) +#define K_TIMEOUT_GET(t) ((t).ticks) +#define K_NO_WAIT K_TIMEOUT_TICKS(0) +#define K_FOREVER K_TIMEOUT_TICKS(K_FOREVER_TICKS) #endif -/* timeouts */ +#define K_TIMEOUT_EQ(a, b) (K_TIMEOUT_GET(a) == K_TIMEOUT_GET(b)) struct _timeout; typedef void (*_timeout_func_t)(struct _timeout *t); struct _timeout { sys_dnode_t node; - s32_t dticks; + k_ticks_t dticks; _timeout_func_t fn; }; +#ifndef CONFIG_SYS_TIMEOUT_LEGACY_API +# ifdef CONFIG_SYS_TIMEOUT_64BIT +# define K_TIMEOUT_MS(t) K_TIMEOUT_TICKS(k_ms_to_ticks_ceil64(t)) +# define K_TIMEOUT_US(t) K_TIMEOUT_TICKS(k_us_to_ticks_ceil64(t)) +# define K_TIMEOUT_CYC(t) K_TIMEOUT_TICKS(k_cyc_to_ticks_ceil64(t)) +# else +# define K_TIMEOUT_MS(t) K_TIMEOUT_TICKS(k_ms_to_ticks_ceil32(t)) +# define K_TIMEOUT_US(t) K_TIMEOUT_TICKS(k_us_to_ticks_ceil32(t)) +# define K_TIMEOUT_CYC(t) K_TIMEOUT_TICKS(k_cyc_to_ticks_ceil32(t)) +# endif +#endif + +#if defined(CONFIG_SYS_TIMEOUT_64BIT) && !defined(CONFIG_SYS_TIMEOUT_LEGACY_API) +#define K_TIMEOUT_ABSOLUTE_TICKS(t) \ + K_TIMEOUT_TICKS((k_ticks_t)(K_FOREVER_TICKS - (t + 1))) +#define K_TIMEOUT_ABSOLUTE_MS(t) K_TIMEOUT_ABSOLUTE_TICKS(k_ms_to_ticks_ceil64(t)) +#define K_TIMEOUT_ABSOLUTE_US(t) K_TIMEOUT_ABSOLUTE_TICKS(k_us_to_ticks_ceil64(t)) +#define K_TIMEOUT_ABSOLUTE_CYC(t) K_TIMEOUT_ABSOLUTE_TICKS(k_cyc_to_ticks_ceil64(t)) +#endif + +s64_t z_tick_get(void); +u32_t z_tick_get_32(void); + +/* Legacy timer conversion APIs. Soon to be deprecated. + */ + +#define __ticks_to_ms(t) k_ticks_to_ms_floor64(t) +#define z_ms_to_ticks(t) k_ms_to_ticks_ceil32(t) +#define __ticks_to_us(t) k_ticks_to_us_floor64(t) +#define z_us_to_ticks(t) k_us_to_ticks_ceil64(t) +#define sys_clock_hw_cycles_per_tick() k_ticks_to_cyc_floor32(1) +#define SYS_CLOCK_HW_CYCLES_TO_NS64(t) (1000 * k_cyc_to_us_floor64(t)) +#define SYS_CLOCK_HW_CYCLES_TO_NS(t) ((u32_t)(1000 * k_cyc_to_us_floor64(t))) +#define SYS_CLOCK_HW_CYCLES_TO_NS_AVG(x, cyc) \ + ((u32_t)(SYS_CLOCK_HW_CYCLES_TO_NS64(x) / cyc)) + +#define MSEC_PER_SEC 1000 +#define USEC_PER_MSEC 1000 +#define USEC_PER_SEC 1000000 +#define NSEC_PER_USEC 1000 +#define NSEC_PER_SEC 1000000000 + +#define K_MSEC(ms) K_TIMEOUT_MS(ms) +#define K_SECONDS(s) K_MSEC((s) * MSEC_PER_SEC) +#define K_MINUTES(m) K_SECONDS((m) * 60) +#define K_HOURS(h) K_MINUTES((h) * 60) + +#define _TICK_ALIGN 1 + #ifdef __cplusplus } #endif -#include - #endif /* ZEPHYR_INCLUDE_SYS_CLOCK_H_ */ diff --git a/kernel/Kconfig b/kernel/Kconfig index d09164a93e245..1fa9313bfc3dd 100644 --- a/kernel/Kconfig +++ b/kernel/Kconfig @@ -577,6 +577,31 @@ config SYS_CLOCK_EXISTS this is disabled. Obviously timeout-related APIs will not work. +config SYS_TIMEOUT_64BIT + bool "Use 64 bit values for kernel timeouts" + help + When enabled, kernel timeout values are uniformly 64 bits, + allowing for effectively arbitrary length timeouts and + unlimited precision in unit conversion without fear of + rollover (a signed microsecond rollover after 63 bits is + almost 300k years). This obviously comes at the expense of + code size and runtime performance on some systems. This + feature is required for some API features, like + absolute-valued timeouts. + +config SYS_TIMEOUT_LEGACY_API + bool "Enable old millisecond timeout API" + depends on !SYS_TIMEOUT_64BIT + default y + help + When enabled, k_timeout_t values passed to kernel APIs are + 32 bit couts of milliseconds. This allows source-level + compatibility with Zephyr versions 1.14 and below, but is + incompatible with newer features (specifically + SYS_TIMEOUT_64BIT and absolute/uptime-valued timeouts). + This API typing convention is considered deprecated and will + be going away at some point after Zephyr 2.0. + config XIP bool "Execute in place" help diff --git a/kernel/futex.c b/kernel/futex.c index 23336192f62d8..9e355a89755aa 100644 --- a/kernel/futex.c +++ b/kernel/futex.c @@ -62,7 +62,8 @@ static inline int z_vrfy_k_futex_wake(struct k_futex *futex, bool wake_all) } #include -int z_impl_k_futex_wait(struct k_futex *futex, int expected, s32_t timeout) +int z_impl_k_futex_wait(struct k_futex *futex, int expected, + k_timeout_t timeout) { int ret; k_spinlock_key_t key; @@ -90,7 +91,7 @@ int z_impl_k_futex_wait(struct k_futex *futex, int expected, s32_t timeout) } static inline int z_vrfy_k_futex_wait(struct k_futex *futex, int expected, - s32_t timeout) + k_timeout_t timeout) { if (Z_SYSCALL_MEMORY_WRITE(futex, sizeof(struct k_futex)) != 0) { return -EACCES; diff --git a/kernel/include/ksched.h b/kernel/include/ksched.h index 48eb70cd229d4..971bf889b1809 100644 --- a/kernel/include/ksched.h +++ b/kernel/include/ksched.h @@ -43,9 +43,10 @@ void z_remove_thread_from_ready_q(struct k_thread *thread); int z_is_thread_time_slicing(struct k_thread *thread); void z_unpend_thread_no_timeout(struct k_thread *thread); int z_pend_curr(struct k_spinlock *lock, k_spinlock_key_t key, - _wait_q_t *wait_q, s32_t timeout); -int z_pend_curr_irqlock(u32_t key, _wait_q_t *wait_q, s32_t timeout); -void z_pend_thread(struct k_thread *thread, _wait_q_t *wait_q, s32_t timeout); + _wait_q_t *wait_q, k_timeout_t timeout); +int z_pend_curr_irqlock(u32_t key, _wait_q_t *wait_q, k_timeout_t timeout); +void z_pend_thread(struct k_thread *thread, _wait_q_t *wait_q, + k_timeout_t timeout); void z_reschedule(struct k_spinlock *lock, k_spinlock_key_t key); void z_reschedule_irqlock(u32_t key); struct k_thread *z_unpend_first_thread(_wait_q_t *wait_q); @@ -62,7 +63,7 @@ void z_reset_time_slice(void); void z_sched_abort(struct k_thread *thread); void z_sched_ipi(void); -static inline void z_pend_curr_unlocked(_wait_q_t *wait_q, s32_t timeout) +static inline void z_pend_curr_unlocked(_wait_q_t *wait_q, k_timeout_t timeout) { (void) z_pend_curr_irqlock(z_arch_irq_lock(), wait_q, timeout); } diff --git a/kernel/include/timeout_q.h b/kernel/include/timeout_q.h index 25185f8ba67d8..7bde3698812d6 100644 --- a/kernel/include/timeout_q.h +++ b/kernel/include/timeout_q.h @@ -27,7 +27,8 @@ static inline void z_init_timeout(struct _timeout *t) sys_dnode_init(&t->node); } -void z_add_timeout(struct _timeout *to, _timeout_func_t fn, s32_t ticks); +void z_add_timeout(struct _timeout *to, _timeout_func_t fn, + k_timeout_t expires); int z_abort_timeout(struct _timeout *to); @@ -43,9 +44,10 @@ static inline void z_init_thread_timeout(struct _thread_base *thread_base) extern void z_thread_timeout(struct _timeout *to); -static inline void z_add_thread_timeout(struct k_thread *th, s32_t ticks) +static inline void z_add_thread_timeout(struct k_thread *th, + k_timeout_t expires) { - z_add_timeout(&th->base.timeout, z_thread_timeout, ticks); + z_add_timeout(&th->base.timeout, z_thread_timeout, expires); } static inline int z_abort_thread_timeout(struct k_thread *thread) @@ -53,22 +55,28 @@ static inline int z_abort_thread_timeout(struct k_thread *thread) return z_abort_timeout(&thread->base.timeout); } -s32_t z_get_next_timeout_expiry(void); +k_ticks_t z_get_next_timeout_expiry(void); -void z_set_timeout_expiry(s32_t ticks, bool idle); +void z_set_timeout_expiry(k_ticks_t ticks, bool idle); -s32_t z_timeout_remaining(struct _timeout *timeout); +k_ticks_t z_timeout_end(struct _timeout *timeout); +k_ticks_t z_timeout_remaining(struct _timeout *timeout); #else /* Stubs when !CONFIG_SYS_CLOCK_EXISTS */ #define z_init_thread_timeout(t) do {} while (false) -#define z_add_thread_timeout(th, to) do {} while (false && (void *)to && (void *)th) #define z_abort_thread_timeout(t) (0) #define z_is_inactive_timeout(t) 0 -#define z_get_next_timeout_expiry() (K_FOREVER) +#define z_get_next_timeout_expiry() (K_FOREVER_TICKS) #define z_set_timeout_expiry(t, i) do {} while (false) +static inline void z_add_thread_timeout(struct k_thread *th, + k_timeout_t expires) +{ + ARG_UNUSED(th); + ARG_UNUSED(expires); +} #endif #ifdef __cplusplus diff --git a/kernel/mailbox.c b/kernel/mailbox.c index 5bc6ebe65bd09..7252ea12a07c2 100644 --- a/kernel/mailbox.c +++ b/kernel/mailbox.c @@ -232,7 +232,7 @@ static void mbox_message_dispose(struct k_mbox_msg *rx_msg) * @return 0 if successful, -ENOMSG if failed immediately, -EAGAIN if timed out */ static int mbox_message_put(struct k_mbox *mbox, struct k_mbox_msg *tx_msg, - s32_t timeout) + k_timeout_t timeout) { struct k_thread *sending_thread; struct k_thread *receiving_thread; @@ -285,7 +285,7 @@ static int mbox_message_put(struct k_mbox *mbox, struct k_mbox_msg *tx_msg, } /* didn't find a matching receiver: don't wait for one */ - if (timeout == K_NO_WAIT) { + if (K_TIMEOUT_EQ(timeout, K_NO_WAIT)) { k_spin_unlock(&mbox->lock, key); return -ENOMSG; } @@ -303,7 +303,7 @@ static int mbox_message_put(struct k_mbox *mbox, struct k_mbox_msg *tx_msg, return z_pend_curr(&mbox->lock, key, &mbox->tx_msg_queue, timeout); } -int k_mbox_put(struct k_mbox *mbox, struct k_mbox_msg *tx_msg, s32_t timeout) +int k_mbox_put(struct k_mbox *mbox, struct k_mbox_msg *tx_msg, k_timeout_t timeout) { /* configure things for a synchronous send, then send the message */ tx_msg->_syncing_thread = _current; @@ -350,7 +350,7 @@ void k_mbox_data_get(struct k_mbox_msg *rx_msg, void *buffer) } int k_mbox_data_block_get(struct k_mbox_msg *rx_msg, struct k_mem_pool *pool, - struct k_mem_block *block, s32_t timeout) + struct k_mem_block *block, k_timeout_t timeout) { int result; @@ -415,7 +415,7 @@ static int mbox_message_data_check(struct k_mbox_msg *rx_msg, void *buffer) } int k_mbox_get(struct k_mbox *mbox, struct k_mbox_msg *rx_msg, void *buffer, - s32_t timeout) + k_timeout_t timeout) { struct k_thread *sending_thread; struct k_mbox_msg *tx_msg; @@ -444,7 +444,7 @@ int k_mbox_get(struct k_mbox *mbox, struct k_mbox_msg *rx_msg, void *buffer, /* didn't find a matching sender */ - if (timeout == K_NO_WAIT) { + if (K_TIMEOUT_EQ(timeout, K_NO_WAIT)) { /* don't wait for a matching sender to appear */ k_spin_unlock(&mbox->lock, key); return -ENOMSG; diff --git a/kernel/mem_slab.c b/kernel/mem_slab.c index f22a04f8ca0e5..24f76b5c985fb 100644 --- a/kernel/mem_slab.c +++ b/kernel/mem_slab.c @@ -84,7 +84,7 @@ void k_mem_slab_init(struct k_mem_slab *slab, void *buffer, z_object_init(slab); } -int k_mem_slab_alloc(struct k_mem_slab *slab, void **mem, s32_t timeout) +int k_mem_slab_alloc(struct k_mem_slab *slab, void **mem, k_timeout_t timeout) { k_spinlock_key_t key = k_spin_lock(&lock); int result; @@ -95,7 +95,7 @@ int k_mem_slab_alloc(struct k_mem_slab *slab, void **mem, s32_t timeout) slab->free_list = *(char **)(slab->free_list); slab->num_used++; result = 0; - } else if (timeout == K_NO_WAIT) { + } else if (K_TIMEOUT_EQ(timeout, K_NO_WAIT)) { /* don't wait for a free block to become available */ *mem = NULL; result = -ENOMEM; diff --git a/kernel/mempool.c b/kernel/mempool.c index a5ede59f737d6..09304e2002e63 100644 --- a/kernel/mempool.c +++ b/kernel/mempool.c @@ -47,15 +47,22 @@ int init_static_pools(struct device *unused) SYS_INIT(init_static_pools, PRE_KERNEL_1, CONFIG_KERNEL_INIT_PRIORITY_OBJECTS); int k_mem_pool_alloc(struct k_mem_pool *p, struct k_mem_block *block, - size_t size, s32_t timeout) + size_t size, k_timeout_t to_rec) { int ret; s64_t end = 0; + bool nowait = K_TIMEOUT_EQ(to_rec, K_NO_WAIT); +#ifdef CONFIG_SYS_TIMEOUT_LEGACY_API + k_ticks_t timeout = (to_rec == K_FOREVER) ? INT_MAX + : k_ms_to_ticks_ceil32(to_rec); +#else + k_ticks_t timeout = to_rec.ticks; +#endif - __ASSERT(!(z_arch_is_in_isr() && timeout != K_NO_WAIT), ""); + __ASSERT(!z_arch_is_in_isr() || nowait, ""); if (timeout > 0) { - end = k_uptime_get() + timeout; + end = z_tick_get() + timeout; } while (true) { @@ -85,18 +92,19 @@ int k_mem_pool_alloc(struct k_mem_pool *p, struct k_mem_block *block, block->id.level = level_num; block->id.block = block_num; - if (ret == 0 || timeout == K_NO_WAIT || - ret != -ENOMEM) { + if (ret == 0 || nowait || ret != -ENOMEM) { return ret; } - z_pend_curr_unlocked(&p->wait_q, timeout); + z_pend_curr_unlocked(&p->wait_q, K_TIMEOUT_TICKS(timeout)); + + if (timeout != K_FOREVER_TICKS) { + s64_t now = z_tick_get(); - if (timeout != K_FOREVER) { - timeout = end - k_uptime_get(); - if (timeout <= 0) { + if (now >= end) { break; } + timeout = end - now; } } diff --git a/kernel/msg_q.c b/kernel/msg_q.c index f46655b533bcf..367a545bf32a3 100644 --- a/kernel/msg_q.c +++ b/kernel/msg_q.c @@ -108,9 +108,9 @@ void k_msgq_cleanup(struct k_msgq *msgq) } -int z_impl_k_msgq_put(struct k_msgq *msgq, void *data, s32_t timeout) +int z_impl_k_msgq_put(struct k_msgq *msgq, void *data, k_timeout_t timeout) { - __ASSERT(!z_arch_is_in_isr() || timeout == K_NO_WAIT, ""); + __ASSERT(!z_arch_is_in_isr() || K_TIMEOUT_EQ(timeout, K_NO_WAIT), ""); struct k_thread *pending_thread; k_spinlock_key_t key; @@ -140,7 +140,7 @@ int z_impl_k_msgq_put(struct k_msgq *msgq, void *data, s32_t timeout) msgq->used_msgs++; } result = 0; - } else if (timeout == K_NO_WAIT) { + } else if (K_TIMEOUT_EQ(timeout, K_NO_WAIT)) { /* don't wait for message space to become available */ result = -ENOMSG; } else { @@ -155,7 +155,8 @@ int z_impl_k_msgq_put(struct k_msgq *msgq, void *data, s32_t timeout) } #ifdef CONFIG_USERSPACE -static inline int z_vrfy_k_msgq_put(struct k_msgq *q, void *data, s32_t timeout) +static inline int z_vrfy_k_msgq_put(struct k_msgq *q, void *data, + k_timeout_t timeout) { Z_OOPS(Z_SYSCALL_OBJ(q, K_OBJ_MSGQ)); Z_OOPS(Z_SYSCALL_MEMORY_READ(data, q->msg_size)); @@ -183,9 +184,9 @@ static inline void z_vrfy_k_msgq_get_attrs(struct k_msgq *q, #include #endif -int z_impl_k_msgq_get(struct k_msgq *msgq, void *data, s32_t timeout) +int z_impl_k_msgq_get(struct k_msgq *msgq, void *data, k_timeout_t timeout) { - __ASSERT(!z_arch_is_in_isr() || timeout == K_NO_WAIT, ""); + __ASSERT(!z_arch_is_in_isr() || K_TIMEOUT_EQ(timeout, K_NO_WAIT), ""); k_spinlock_key_t key; struct k_thread *pending_thread; @@ -221,7 +222,7 @@ int z_impl_k_msgq_get(struct k_msgq *msgq, void *data, s32_t timeout) return 0; } result = 0; - } else if (timeout == K_NO_WAIT) { + } else if (K_TIMEOUT_EQ(timeout, K_NO_WAIT)) { /* don't wait for a message to become available */ result = -ENOMSG; } else { @@ -236,7 +237,8 @@ int z_impl_k_msgq_get(struct k_msgq *msgq, void *data, s32_t timeout) } #ifdef CONFIG_USERSPACE -static inline int z_vrfy_k_msgq_get(struct k_msgq *q, void *data, s32_t timeout) +static inline int z_vrfy_k_msgq_get(struct k_msgq *q, void *data, + k_timeout_t timeout) { Z_OOPS(Z_SYSCALL_OBJ(q, K_OBJ_MSGQ)); Z_OOPS(Z_SYSCALL_MEMORY_WRITE(data, q->msg_size)); diff --git a/kernel/mutex.c b/kernel/mutex.c index cd9f76eb120c3..831faa8cb9d1a 100644 --- a/kernel/mutex.c +++ b/kernel/mutex.c @@ -112,7 +112,7 @@ static bool adjust_owner_prio(struct k_mutex *mutex, s32_t new_prio) return false; } -int z_impl_k_mutex_lock(struct k_mutex *mutex, s32_t timeout) +int z_impl_k_mutex_lock(struct k_mutex *mutex, k_timeout_t timeout) { int new_prio; k_spinlock_key_t key; @@ -140,7 +140,7 @@ int z_impl_k_mutex_lock(struct k_mutex *mutex, s32_t timeout) return 0; } - if (unlikely(timeout == (s32_t)K_NO_WAIT)) { + if (unlikely(K_TIMEOUT_EQ(timeout, K_NO_WAIT))) { k_spin_unlock(&lock, key); sys_trace_end_call(SYS_TRACE_ID_MUTEX_LOCK); return -EBUSY; @@ -195,7 +195,7 @@ int z_impl_k_mutex_lock(struct k_mutex *mutex, s32_t timeout) } #ifdef CONFIG_USERSPACE -static inline int z_vrfy_k_mutex_lock(struct k_mutex *mutex, s32_t timeout) +static inline int z_vrfy_k_mutex_lock(struct k_mutex *mutex, k_timeout_t timeout) { Z_OOPS(Z_SYSCALL_OBJ(mutex, K_OBJ_MUTEX)); return z_impl_k_mutex_lock(mutex, timeout); diff --git a/kernel/pipes.c b/kernel/pipes.c index e48fa9b1450c5..2c3117685f7aa 100644 --- a/kernel/pipes.c +++ b/kernel/pipes.c @@ -314,13 +314,13 @@ static bool pipe_xfer_prepare(sys_dlist_t *xfer_list, size_t pipe_space, size_t bytes_to_xfer, size_t min_xfer, - s32_t timeout) + k_timeout_t timeout) { struct k_thread *thread; struct k_pipe_desc *desc; size_t num_bytes = 0; - if (timeout == K_NO_WAIT) { + if (K_TIMEOUT_EQ(timeout, K_NO_WAIT)) { _WAIT_Q_FOR_EACH(wait_q, thread) { desc = (struct k_pipe_desc *)thread->base.swap_data; @@ -425,7 +425,7 @@ static void pipe_thread_ready(struct k_thread *thread) int z_pipe_put_internal(struct k_pipe *pipe, struct k_pipe_async *async_desc, unsigned char *data, size_t bytes_to_write, size_t *bytes_written, size_t min_xfer, - s32_t timeout) + k_timeout_t timeout) { struct k_thread *reader; struct k_pipe_desc *desc; @@ -547,7 +547,7 @@ int z_pipe_put_internal(struct k_pipe *pipe, struct k_pipe_async *async_desc, pipe_desc.buffer = data + num_bytes_written; pipe_desc.bytes_to_xfer = bytes_to_write - num_bytes_written; - if (timeout != K_NO_WAIT) { + if (!K_TIMEOUT_EQ(timeout, K_NO_WAIT)) { _current->base.swap_data = &pipe_desc; /* * Lock interrupts and unlock the scheduler before @@ -568,7 +568,7 @@ int z_pipe_put_internal(struct k_pipe *pipe, struct k_pipe_async *async_desc, } int z_impl_k_pipe_get(struct k_pipe *pipe, void *data, size_t bytes_to_read, - size_t *bytes_read, size_t min_xfer, s32_t timeout) + size_t *bytes_read, size_t min_xfer, k_timeout_t timeout) { struct k_thread *writer; struct k_pipe_desc *desc; @@ -693,7 +693,7 @@ int z_impl_k_pipe_get(struct k_pipe *pipe, void *data, size_t bytes_to_read, pipe_desc.buffer = (u8_t *)data + num_bytes_read; pipe_desc.bytes_to_xfer = bytes_to_read - num_bytes_read; - if (timeout != K_NO_WAIT) { + if (!K_TIMEOUT_EQ(timeout, K_NO_WAIT)) { _current->base.swap_data = &pipe_desc; k_spinlock_key_t key = k_spin_lock(&pipe->lock); @@ -712,7 +712,7 @@ int z_impl_k_pipe_get(struct k_pipe *pipe, void *data, size_t bytes_to_read, #ifdef CONFIG_USERSPACE int z_vrfy_k_pipe_get(struct k_pipe *pipe, void *data, size_t bytes_to_read, - size_t *bytes_read, size_t min_xfer, s32_t timeout) + size_t *bytes_read, size_t min_xfer, k_timeout_t timeout) { Z_OOPS(Z_SYSCALL_OBJ(pipe, K_OBJ_PIPE)); Z_OOPS(Z_SYSCALL_MEMORY_WRITE(bytes_read, sizeof(*bytes_read))); @@ -727,7 +727,7 @@ int z_vrfy_k_pipe_get(struct k_pipe *pipe, void *data, size_t bytes_to_read, #endif int z_impl_k_pipe_put(struct k_pipe *pipe, void *data, size_t bytes_to_write, - size_t *bytes_written, size_t min_xfer, s32_t timeout) + size_t *bytes_written, size_t min_xfer, k_timeout_t timeout) { __ASSERT(min_xfer <= bytes_to_write, ""); __ASSERT(bytes_written != NULL, ""); @@ -739,7 +739,7 @@ int z_impl_k_pipe_put(struct k_pipe *pipe, void *data, size_t bytes_to_write, #ifdef CONFIG_USERSPACE int z_vrfy_k_pipe_put(struct k_pipe *pipe, void *data, size_t bytes_to_write, - size_t *bytes_written, size_t min_xfer, s32_t timeout) + size_t *bytes_written, size_t min_xfer, k_timeout_t timeout) { Z_OOPS(Z_SYSCALL_OBJ(pipe, K_OBJ_PIPE)); Z_OOPS(Z_SYSCALL_MEMORY_WRITE(bytes_written, sizeof(*bytes_written))); diff --git a/kernel/poll.c b/kernel/poll.c index 025584aa2424a..ee269ccd1dc44 100644 --- a/kernel/poll.c +++ b/kernel/poll.c @@ -188,7 +188,8 @@ static inline void set_event_ready(struct k_poll_event *event, u32_t state) event->state |= state; } -int z_impl_k_poll(struct k_poll_event *events, int num_events, s32_t timeout) +int z_impl_k_poll(struct k_poll_event *events, int num_events, + k_timeout_t timeout) { __ASSERT(!z_arch_is_in_isr(), ""); __ASSERT(events != NULL, "NULL events\n"); @@ -207,7 +208,8 @@ int z_impl_k_poll(struct k_poll_event *events, int num_events, s32_t timeout) if (is_condition_met(&events[ii], &state)) { set_event_ready(&events[ii], state); poller.is_polling = false; - } else if (timeout != K_NO_WAIT && poller.is_polling) { + } else if (!K_TIMEOUT_EQ(timeout, K_NO_WAIT) + && poller.is_polling) { rc = register_event(&events[ii], &poller); if (rc == 0) { ++last_registered; @@ -233,7 +235,7 @@ int z_impl_k_poll(struct k_poll_event *events, int num_events, s32_t timeout) poller.is_polling = false; - if (timeout == K_NO_WAIT) { + if (K_TIMEOUT_EQ(timeout, K_NO_WAIT)) { k_spin_unlock(&lock, key); return -EAGAIN; } @@ -260,7 +262,7 @@ int z_impl_k_poll(struct k_poll_event *events, int num_events, s32_t timeout) #ifdef CONFIG_USERSPACE static inline int z_vrfy_k_poll(struct k_poll_event *events, - int num_events, s32_t timeout) + int num_events, k_timeout_t timeout) { int ret; k_spinlock_key_t key; diff --git a/kernel/queue.c b/kernel/queue.c index 0b384d96b0d18..6c60bd2154314 100644 --- a/kernel/queue.c +++ b/kernel/queue.c @@ -277,7 +277,7 @@ void k_queue_merge_slist(struct k_queue *queue, sys_slist_t *list) } #if defined(CONFIG_POLL) -static void *k_queue_poll(struct k_queue *queue, s32_t timeout) +static void *k_queue_poll(struct k_queue *queue, k_timeout_t timeout) { struct k_poll_event event; int err, elapsed = 0, done = 0; @@ -288,14 +288,20 @@ static void *k_queue_poll(struct k_queue *queue, s32_t timeout) k_poll_event_init(&event, K_POLL_TYPE_FIFO_DATA_AVAILABLE, K_POLL_MODE_NOTIFY_ONLY, queue); - if (timeout != K_FOREVER) { + if (!K_TIMEOUT_EQ(timeout, K_FOREVER)) { start = k_uptime_get_32(); } do { event.state = K_POLL_STATE_NOT_READY; - err = k_poll(&event, 1, timeout - elapsed); +#ifdef CONFIG_SYS_TIMEOUT_LEGACY_API + k_ticks_t to_ms = timeout; +#else + k_ticks_t to_ms = k_ticks_to_ms_ceil32(timeout.ticks); +#endif + + err = k_poll(&event, 1, K_TIMEOUT_MS(to_ms - elapsed)); if (err && err != -EAGAIN) { return NULL; @@ -305,9 +311,9 @@ static void *k_queue_poll(struct k_queue *queue, s32_t timeout) val = z_queue_node_peek(sys_sflist_get(&queue->data_q), true); k_spin_unlock(&queue->lock, key); - if ((val == NULL) && (timeout != K_FOREVER)) { + if ((val == NULL) && !K_TIMEOUT_EQ(timeout, K_FOREVER)) { elapsed = k_uptime_get_32() - start; - done = elapsed > timeout; + done = elapsed > to_ms; } } while (!val && !done); @@ -315,7 +321,7 @@ static void *k_queue_poll(struct k_queue *queue, s32_t timeout) } #endif /* CONFIG_POLL */ -void *z_impl_k_queue_get(struct k_queue *queue, s32_t timeout) +void *z_impl_k_queue_get(struct k_queue *queue, k_timeout_t timeout) { k_spinlock_key_t key = k_spin_lock(&queue->lock); void *data; @@ -329,7 +335,7 @@ void *z_impl_k_queue_get(struct k_queue *queue, s32_t timeout) return data; } - if (timeout == K_NO_WAIT) { + if (K_TIMEOUT_EQ(timeout, K_NO_WAIT)) { k_spin_unlock(&queue->lock, key); return NULL; } @@ -347,7 +353,8 @@ void *z_impl_k_queue_get(struct k_queue *queue, s32_t timeout) } #ifdef CONFIG_USERSPACE -static inline void *z_vrfy_k_queue_get(struct k_queue *queue, s32_t timeout) +static inline void *z_vrfy_k_queue_get(struct k_queue *queue, + k_timeout_t timeout) { Z_OOPS(Z_SYSCALL_OBJ(queue, K_OBJ_QUEUE)); return z_impl_k_queue_get(queue, timeout); diff --git a/kernel/sched.c b/kernel/sched.c index cadd391db41f8..a081c621c8de4 100644 --- a/kernel/sched.c +++ b/kernel/sched.c @@ -357,7 +357,8 @@ void z_remove_thread_from_ready_q(struct k_thread *thread) } } -static void pend(struct k_thread *thread, _wait_q_t *wait_q, s32_t timeout) +static void pend(struct k_thread *thread, _wait_q_t *wait_q, + k_timeout_t timeout) { z_remove_thread_from_ready_q(thread); z_mark_thread_as_pending(thread); @@ -367,16 +368,15 @@ static void pend(struct k_thread *thread, _wait_q_t *wait_q, s32_t timeout) z_priq_wait_add(&wait_q->waitq, thread); } - if (timeout != K_FOREVER) { - s32_t ticks = _TICK_ALIGN + z_ms_to_ticks(timeout); - - z_add_thread_timeout(thread, ticks); + if (!K_TIMEOUT_EQ(timeout, K_FOREVER)) { + z_add_thread_timeout(thread, timeout); } sys_trace_thread_pend(thread); } -void z_pend_thread(struct k_thread *thread, _wait_q_t *wait_q, s32_t timeout) +void z_pend_thread(struct k_thread *thread, _wait_q_t *wait_q, + k_timeout_t timeout) { __ASSERT_NO_MSG(thread == _current || is_thread_dummy(thread)); pend(thread, wait_q, timeout); @@ -428,7 +428,7 @@ void z_thread_timeout(struct _timeout *to) } #endif -int z_pend_curr_irqlock(u32_t key, _wait_q_t *wait_q, s32_t timeout) +int z_pend_curr_irqlock(u32_t key, _wait_q_t *wait_q, k_timeout_t timeout) { pend(_current, wait_q, timeout); @@ -448,7 +448,7 @@ int z_pend_curr_irqlock(u32_t key, _wait_q_t *wait_q, s32_t timeout) } int z_pend_curr(struct k_spinlock *lock, k_spinlock_key_t key, - _wait_q_t *wait_q, s32_t timeout) + _wait_q_t *wait_q, k_timeout_t timeout) { #if defined(CONFIG_TIMESLICING) && defined(CONFIG_SWAP_NONATOMIC) pending_current = _current; @@ -941,7 +941,6 @@ static s32_t z_tick_sleep(s32_t ticks) return 0; } - ticks += _TICK_ALIGN; expected_wakeup_time = ticks + z_tick_get_32(); /* Spinlock purely for local interrupt locking to prevent us @@ -955,7 +954,7 @@ static s32_t z_tick_sleep(s32_t ticks) pending_current = _current; #endif z_remove_thread_from_ready_q(_current); - z_add_thread_timeout(_current, ticks); + z_add_thread_timeout(_current, K_TIMEOUT_TICKS(ticks)); z_mark_thread_as_suspended(_current); (void)z_swap(&local_lock, key); @@ -971,6 +970,26 @@ static s32_t z_tick_sleep(s32_t ticks) return 0; } +k_ticks_t z_thread_end(k_tid_t thread) +{ + k_ticks_t ret = 0; +#ifdef CONFIG_SYS_CLOCK_EXISTS + LOCKED(&sched_spinlock) { + if (!z_is_thread_prevented_from_running(thread)) { + ret = K_FOREVER_TICKS; + } else { + ret = z_timeout_end(&thread->base.timeout); + } + } +#endif + return ret; +} + +k_ticks_t z_thread_remaining(k_tid_t thread) +{ + return z_thread_end(thread) - (k_ticks_t) z_tick_get(); +} + s32_t z_impl_k_sleep(int ms) { s32_t ticks; diff --git a/kernel/sem.c b/kernel/sem.c index 249b6e83527ba..9e1a49165e701 100644 --- a/kernel/sem.c +++ b/kernel/sem.c @@ -136,9 +136,10 @@ static inline void z_vrfy_k_sem_give(struct k_sem *sem) #include #endif -int z_impl_k_sem_take(struct k_sem *sem, s32_t timeout) +int z_impl_k_sem_take(struct k_sem *sem, k_timeout_t timeout) { - __ASSERT(((z_arch_is_in_isr() == false) || (timeout == K_NO_WAIT)), ""); + __ASSERT(((z_arch_is_in_isr() == false) + || K_TIMEOUT_EQ(timeout, K_NO_WAIT)), ""); sys_trace_void(SYS_TRACE_ID_SEMA_TAKE); k_spinlock_key_t key = k_spin_lock(&lock); @@ -150,7 +151,7 @@ int z_impl_k_sem_take(struct k_sem *sem, s32_t timeout) return 0; } - if (timeout == K_NO_WAIT) { + if (K_TIMEOUT_EQ(timeout, K_NO_WAIT)) { k_spin_unlock(&lock, key); sys_trace_end_call(SYS_TRACE_ID_SEMA_TAKE); return -EBUSY; @@ -163,7 +164,7 @@ int z_impl_k_sem_take(struct k_sem *sem, s32_t timeout) } #ifdef CONFIG_USERSPACE -static inline int z_vrfy_k_sem_take(struct k_sem *sem, s32_t timeout) +static inline int z_vrfy_k_sem_take(struct k_sem *sem, k_timeout_t timeout) { Z_OOPS(Z_SYSCALL_OBJ(sem, K_OBJ_SEM)); return z_impl_k_sem_take((struct k_sem *)sem, timeout); diff --git a/kernel/stack.c b/kernel/stack.c index 4a4cb4ee93c27..890eee7dba3dc 100644 --- a/kernel/stack.c +++ b/kernel/stack.c @@ -129,7 +129,8 @@ static inline void z_vrfy_k_stack_push(struct k_stack *stack, stack_data_t data) #include #endif -int z_impl_k_stack_pop(struct k_stack *stack, stack_data_t *data, s32_t timeout) +int z_impl_k_stack_pop(struct k_stack *stack, stack_data_t *data, + k_timeout_t timeout) { k_spinlock_key_t key; int result; @@ -143,7 +144,7 @@ int z_impl_k_stack_pop(struct k_stack *stack, stack_data_t *data, s32_t timeout) return 0; } - if (timeout == K_NO_WAIT) { + if (K_TIMEOUT_EQ(timeout, K_NO_WAIT)) { k_spin_unlock(&stack->lock, key); return -EBUSY; } @@ -159,7 +160,7 @@ int z_impl_k_stack_pop(struct k_stack *stack, stack_data_t *data, s32_t timeout) #ifdef CONFIG_USERSPACE static inline int z_vrfy_k_stack_pop(struct k_stack *stack, - stack_data_t *data, s32_t timeout) + stack_data_t *data, k_timeout_t timeout) { Z_OOPS(Z_SYSCALL_OBJ(stack, K_OBJ_STACK)); Z_OOPS(Z_SYSCALL_MEMORY_WRITE(data, sizeof(stack_data_t))); diff --git a/kernel/thread.c b/kernel/thread.c index 6dd34f44d7ce0..2d9a4b7d82744 100644 --- a/kernel/thread.c +++ b/kernel/thread.c @@ -377,15 +377,13 @@ static inline void z_vrfy_k_thread_start(struct k_thread *thread) #endif #ifdef CONFIG_MULTITHREADING -static void schedule_new_thread(struct k_thread *thread, s32_t delay) +static void schedule_new_thread(struct k_thread *thread, k_timeout_t delay) { #ifdef CONFIG_SYS_CLOCK_EXISTS - if (delay == 0) { + if (K_TIMEOUT_EQ(delay, K_NO_WAIT)) { k_thread_start(thread); } else { - s32_t ticks = _TICK_ALIGN + z_ms_to_ticks(delay); - - z_add_thread_timeout(thread, ticks); + z_add_thread_timeout(thread, delay); } #else ARG_UNUSED(delay); @@ -529,7 +527,7 @@ k_tid_t z_impl_k_thread_create(struct k_thread *new_thread, k_thread_stack_t *stack, size_t stack_size, k_thread_entry_t entry, void *p1, void *p2, void *p3, - int prio, u32_t options, s32_t delay) + int prio, u32_t options, k_timeout_t delay) { __ASSERT(!z_arch_is_in_isr(), "Threads may not be created in ISRs"); @@ -543,7 +541,7 @@ k_tid_t z_impl_k_thread_create(struct k_thread *new_thread, z_setup_new_thread(new_thread, stack, stack_size, entry, p1, p2, p3, prio, options, NULL); - if (delay != K_FOREVER) { + if (!K_TIMEOUT_EQ(delay, K_FOREVER)) { schedule_new_thread(new_thread, delay); } @@ -556,7 +554,7 @@ k_tid_t z_vrfy_k_thread_create(struct k_thread *new_thread, k_thread_stack_t *stack, size_t stack_size, k_thread_entry_t entry, void *p1, void *p2, void *p3, - int prio, u32_t options, s32_t delay) + int prio, u32_t options, k_timeout_t delay) { u32_t total_size; struct _k_object *stack_object; @@ -601,7 +599,7 @@ k_tid_t z_vrfy_k_thread_create(struct k_thread *new_thread, z_setup_new_thread(new_thread, stack, stack_size, entry, p1, p2, p3, prio, options, NULL); - if (delay != K_FOREVER) { + if (!K_TIMEOUT_EQ(delay, K_FOREVER)) { schedule_new_thread(new_thread, delay); } @@ -754,9 +752,15 @@ void z_init_static_threads(void) */ k_sched_lock(); _FOREACH_STATIC_THREAD(thread_data) { - if (thread_data->init_delay != K_FOREVER) { - schedule_new_thread(thread_data->init_thread, - thread_data->init_delay); + /* Note that init_delay is stored as a 32 bit quantity + * in MS. We can't easily convert to a timeout_t for + * use in static data + */ + if (!K_TIMEOUT_EQ(K_TIMEOUT_TICKS(thread_data->init_delay), + K_FOREVER)) { + k_timeout_t to = K_TIMEOUT_MS(thread_data->init_delay); + + schedule_new_thread(thread_data->init_thread, to); } } k_sched_unlock(); diff --git a/kernel/timeout.c b/kernel/timeout.c index 12e4c48483a73..4b0f42d0849a3 100644 --- a/kernel/timeout.c +++ b/kernel/timeout.c @@ -15,6 +15,12 @@ __i.key == 0; \ k_spin_unlock(lck, __key), __i.key = 1) +#ifdef CONFIG_SYS_TIMEOUT_LEGACY_API +#define FOREVER_TICKS K_FOREVER +#else +#define FOREVER_TICKS (K_FOREVER.ticks) +#endif + static u64_t curr_tick; static sys_dlist_t timeout_list = SYS_DLIST_STATIC_INIT(&timeout_list); @@ -22,11 +28,13 @@ static sys_dlist_t timeout_list = SYS_DLIST_STATIC_INIT(&timeout_list); static struct k_spinlock timeout_lock; #define MAX_WAIT (IS_ENABLED(CONFIG_SYSTEM_CLOCK_SLOPPY_IDLE) \ - ? K_FOREVER : INT_MAX) + ? K_FOREVER_TICKS : INT_MAX) /* Cycles left to process in the currently-executing z_clock_announce() */ static int announce_remaining; +static bool announcing; + #if defined(CONFIG_TIMER_READS_ITS_FREQUENCY_AT_RUNTIME) int z_clock_hw_cycles_per_sec = CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC; @@ -81,15 +89,54 @@ static s32_t next_timeout(void) return ret; } -void z_add_timeout(struct _timeout *to, _timeout_func_t fn, s32_t ticks) +static bool is_absolute(k_ticks_t t) +{ +#ifdef K_TIMEOUT_ABSOLUTE_TICKS + return ((s64_t)t) < ((s64_t)K_FOREVER_TICKS); +#else + return false; +#endif +} + +void z_add_timeout(struct _timeout *to, _timeout_func_t fn, + k_timeout_t expires) { +#ifdef CONFIG_SYS_TIMEOUT_LEGACY_API + k_ticks_t ticks = k_ms_to_ticks_ceil32(expires); +#else + k_ticks_t ticks = expires.ticks; +#endif + __ASSERT(!sys_dnode_is_linked(&to->node), ""); + + if (!is_absolute(ticks)) { + /* In the ISR, we can assume we're perfectly aligned + * to the start of the current tick, so new timeouts + * can use exact tick counts. At other, arbitrary + * times, we need to wait for the next tick to start + * counting so we don't expire too soon. + */ + if (!announcing) { + ticks += 1; + } + + ticks = MAX(1, ticks); + } + to->fn = fn; - ticks = MAX(1, ticks); LOCKED(&timeout_lock) { struct _timeout *t; +#ifdef K_TIMEOUT_ABSOLUTE_TICKS + /* Handle absolute expirations */ + if (is_absolute(ticks)) { + s64_t abs = K_FOREVER_TICKS - 1 - ticks; + + ticks = MAX(0, abs - curr_tick - z_clock_elapsed()); + } +#endif + to->dticks = ticks + elapsed(); for (t = first(); t != NULL; t = next(t)) { __ASSERT(t->dticks >= 0, ""); @@ -126,15 +173,17 @@ int z_abort_timeout(struct _timeout *to) return ret; } -s32_t z_timeout_remaining(struct _timeout *timeout) +k_ticks_t z_timeout_end(struct _timeout *timeout) { - s32_t ticks = 0; + k_ticks_t ticks = 0; if (z_is_inactive_timeout(timeout)) { - return 0; + return K_FOREVER_TICKS; } LOCKED(&timeout_lock) { + ticks = (k_ticks_t) curr_tick; + for (struct _timeout *t = first(); t != NULL; t = next(t)) { ticks += t->dticks; if (timeout == t) { @@ -143,12 +192,28 @@ s32_t z_timeout_remaining(struct _timeout *timeout) } } - return ticks - elapsed(); + return ticks; +} + +k_ticks_t z_timeout_remaining(struct _timeout *timeout) +{ + if (z_is_inactive_timeout(timeout)) { + return K_FOREVER_TICKS; + } + + k_ticks_t rem = z_timeout_end(timeout) - ((k_ticks_t)curr_tick + elapsed()); + + /* Note: also handles the case where z_timeout_end() returns FOREVER */ + if (rem < 0) { + return K_FOREVER_TICKS; + } + + return rem; } -s32_t z_get_next_timeout_expiry(void) +k_ticks_t z_get_next_timeout_expiry(void) { - s32_t ret = K_FOREVER; + k_ticks_t ret = FOREVER_TICKS; LOCKED(&timeout_lock) { ret = next_timeout(); @@ -156,11 +221,11 @@ s32_t z_get_next_timeout_expiry(void) return ret; } -void z_set_timeout_expiry(s32_t ticks, bool idle) +void z_set_timeout_expiry(k_ticks_t ticks, bool idle) { LOCKED(&timeout_lock) { - int next = next_timeout(); - bool sooner = (next == K_FOREVER) || (ticks < next); + k_ticks_t next = next_timeout(); + bool sooner = (next == FOREVER_TICKS) || (ticks < next); bool imminent = next <= 1; /* Only set new timeouts when they are sooner than @@ -188,6 +253,7 @@ void z_clock_announce(s32_t ticks) k_spinlock_key_t key = k_spin_lock(&timeout_lock); announce_remaining = ticks; + announcing = true; while (first() != NULL && first()->dticks <= announce_remaining) { struct _timeout *t = first(); @@ -209,6 +275,7 @@ void z_clock_announce(s32_t ticks) curr_tick += announce_remaining; announce_remaining = 0; + announcing = false; z_clock_set_timeout(next_timeout(), false); @@ -234,15 +301,15 @@ u32_t z_tick_get_32(void) #endif } -s64_t z_impl_k_uptime_get(void) +u64_t z_impl_k_uptime_ticks(void) { - return __ticks_to_ms(z_tick_get()); + return z_tick_get(); } #ifdef CONFIG_USERSPACE -static inline s64_t z_vrfy_k_uptime_get(void) +static inline u64_t z_vrfy_k_uptime_ticks(void) { - return z_impl_k_uptime_get(); + return z_impl_k_uptime_ticks(); } -#include +#include #endif diff --git a/kernel/timer.c b/kernel/timer.c index 997cbc2d10d96..e19f11ac8177e 100644 --- a/kernel/timer.c +++ b/kernel/timer.c @@ -48,12 +48,11 @@ void z_timer_expiration_handler(struct _timeout *t) struct k_thread *thread; /* - * if the timer is periodic, start it again; don't add _TICK_ALIGN - * since we're already aligned to a tick boundary + * if the timer is periodic, start it again */ - if (timer->period > 0) { + if (!K_TIMEOUT_EQ(timer->period, K_FOREVER)) { z_add_timeout(&timer->timeout, z_timer_expiration_handler, - timer->period); + timer->period); } /* update timer's status */ @@ -104,29 +103,33 @@ void k_timer_init(struct k_timer *timer, } -void z_impl_k_timer_start(struct k_timer *timer, s32_t duration, s32_t period) +void z_impl_k_timer_start(struct k_timer *timer, k_timeout_t duration, + k_timeout_t period) { - __ASSERT(duration >= 0 && period >= 0 && - (duration != 0 || period != 0), "invalid parameters\n"); - - volatile s32_t period_in_ticks, duration_in_ticks; - - period_in_ticks = z_ms_to_ticks(period); - duration_in_ticks = z_ms_to_ticks(duration); + if (K_TIMEOUT_EQ(period, K_NO_WAIT)) { + /* The API has always treated a period of zero as + * "aperiodic/one-shot", which is sort of a weird + * choice but preserved here for compatibility. + */ + period = K_FOREVER; + } (void)z_abort_timeout(&timer->timeout); - timer->period = period_in_ticks; + timer->period = period; timer->status = 0U; z_add_timeout(&timer->timeout, z_timer_expiration_handler, - duration_in_ticks); + duration); } #ifdef CONFIG_USERSPACE static inline void z_vrfy_k_timer_start(struct k_timer *timer, - s32_t duration, s32_t period) + k_timeout_t duration, + k_timeout_t period) { - Z_OOPS(Z_SYSCALL_VERIFY(duration >= 0 && period >= 0 && - (duration != 0 || period != 0))); + Z_OOPS(Z_SYSCALL_VERIFY(K_TIMEOUT_GET(duration) >= 0 + && K_TIMEOUT_GET(period) >= 0 && + (K_TIMEOUT_GET(duration) != 0 + || K_TIMEOUT_GET(period) != 0))); Z_OOPS(Z_SYSCALL_OBJ(timer, K_OBJ_TIMER)); z_impl_k_timer_start(timer, duration, period); } @@ -218,12 +221,12 @@ static inline u32_t z_vrfy_k_timer_status_sync(struct k_timer *timer) } #include -static inline u32_t z_vrfy_k_timer_remaining_get(struct k_timer *timer) +static inline k_ticks_t z_vrfy_k_timer_remaining_ticks(struct k_timer *timer) { Z_OOPS(Z_SYSCALL_OBJ(timer, K_OBJ_TIMER)); - return z_impl_k_timer_remaining_get(timer); + return z_impl_k_timer_remaining_ticks(timer); } -#include +#include static inline void *z_vrfy_k_timer_user_data_get(struct k_timer *timer) { @@ -240,4 +243,11 @@ static inline void z_vrfy_k_timer_user_data_set(struct k_timer *timer, } #include +static inline k_ticks_t z_vrfy_k_timer_end_ticks(struct k_timer *timer) +{ + Z_OOPS(Z_SYSCALL_OBJ(timer, K_OBJ_TIMER)); + return z_impl_k_timer_end_ticks(timer); +} +#include + #endif diff --git a/kernel/work_q.c b/kernel/work_q.c index 3122477bf2341..b304d857ab53b 100644 --- a/kernel/work_q.c +++ b/kernel/work_q.c @@ -30,7 +30,7 @@ void k_work_q_start(struct k_work_q *work_q, k_thread_stack_t *stack, { k_queue_init(&work_q->queue); (void)k_thread_create(&work_q->thread, stack, stack_size, z_work_q_main, - work_q, NULL, NULL, prio, 0, 0); + work_q, NULL, NULL, prio, 0, K_NO_WAIT); k_thread_name_set(&work_q->thread, WORKQUEUE_THREAD_NAME); } @@ -75,7 +75,7 @@ static int work_cancel(struct k_delayed_work *work) int k_delayed_work_submit_to_queue(struct k_work_q *work_q, struct k_delayed_work *work, - s32_t delay) + k_timeout_t delay) { k_spinlock_key_t key = k_spin_lock(&lock); int err = 0; @@ -100,15 +100,14 @@ int k_delayed_work_submit_to_queue(struct k_work_q *work_q, /* Submit work directly if no delay. Note that this is a * blocking operation, so release the lock first. */ - if (delay == 0) { + if (K_TIMEOUT_EQ(delay, K_NO_WAIT)) { k_spin_unlock(&lock, key); k_work_submit_to_queue(work_q, &work->work); return 0; } /* Add timeout */ - z_add_timeout(&work->timeout, work_timeout, - _TICK_ALIGN + z_ms_to_ticks(delay)); + z_add_timeout(&work->timeout, work_timeout, delay); done: k_spin_unlock(&lock, key); diff --git a/lib/os/mutex.c b/lib/os/mutex.c index 4f9811c4aa60a..036ccc747ef7b 100644 --- a/lib/os/mutex.c +++ b/lib/os/mutex.c @@ -30,7 +30,7 @@ static bool check_sys_mutex_addr(u32_t addr) return Z_SYSCALL_MEMORY_WRITE(addr, sizeof(struct sys_mutex)); } -int z_impl_z_sys_mutex_kernel_lock(struct sys_mutex *mutex, s32_t timeout) +int z_impl_z_sys_mutex_kernel_lock(struct sys_mutex *mutex, k_timeout_t timeout) { struct k_mutex *kernel_mutex = get_k_mutex(mutex); @@ -42,7 +42,7 @@ int z_impl_z_sys_mutex_kernel_lock(struct sys_mutex *mutex, s32_t timeout) } static inline int z_vrfy_z_sys_mutex_kernel_lock(struct sys_mutex *mutex, - s32_t timeout) + k_timeout_t timeout) { if (check_sys_mutex_addr((u32_t) mutex)) { return -EACCES; diff --git a/lib/os/sem.c b/lib/os/sem.c index c5e7b2795704d..e516fc7df1033 100644 --- a/lib/os/sem.c +++ b/lib/os/sem.c @@ -79,7 +79,7 @@ int sys_sem_give(struct sys_sem *sem) return ret; } -int sys_sem_take(struct sys_sem *sem, s32_t timeout) +int sys_sem_take(struct sys_sem *sem, k_timeout_t timeout) { int ret = 0; atomic_t old_value; @@ -120,7 +120,7 @@ int sys_sem_give(struct sys_sem *sem) return 0; } -int sys_sem_take(struct sys_sem *sem, s32_t timeout) +int sys_sem_take(struct sys_sem *sem, k_timeout_t timeout) { int ret_value = 0; diff --git a/lib/posix/pthread_common.c b/lib/posix/pthread_common.c index e128d46192fe3..16580b12549ab 100644 --- a/lib/posix/pthread_common.c +++ b/lib/posix/pthread_common.c @@ -23,7 +23,7 @@ s64_t timespec_to_timeoutms(const struct timespec *abstime) nsecs = abstime->tv_nsec - curtime.tv_nsec; if (secs < 0 || (secs == 0 && nsecs < NSEC_PER_MSEC)) { - milli_secs = K_NO_WAIT; + milli_secs = 0; } else { milli_secs = secs * MSEC_PER_SEC + nsecs / NSEC_PER_MSEC; } diff --git a/subsys/logging/log_msg.c b/subsys/logging/log_msg.c index 541a976f54428..7ae63f98bae89 100644 --- a/subsys/logging/log_msg.c +++ b/subsys/logging/log_msg.c @@ -75,8 +75,9 @@ union log_msg_chunk *log_msg_chunk_alloc(void) { union log_msg_chunk *msg = NULL; int err = k_mem_slab_alloc(&log_msg_pool, (void **)&msg, - block_on_alloc() ? - CONFIG_LOG_BLOCK_IN_THREAD_TIMEOUT_MS : K_NO_WAIT); + block_on_alloc() + ? K_TIMEOUT_MS(CONFIG_LOG_BLOCK_IN_THREAD_TIMEOUT_MS) + : K_NO_WAIT); if (err != 0) { msg = log_msg_no_space_handle(); diff --git a/subsys/power/policy/policy_residency.c b/subsys/power/policy/policy_residency.c index ec2c39395205a..a0c34313420c7 100644 --- a/subsys/power/policy/policy_residency.c +++ b/subsys/power/policy/policy_residency.c @@ -49,7 +49,7 @@ enum power_states sys_pm_policy_next_state(s32_t ticks) { int i; - if ((ticks != K_FOREVER) && (ticks < pm_min_residency[0])) { + if ((ticks != K_FOREVER_TICKS) && (ticks < pm_min_residency[0])) { LOG_DBG("Not enough time for PM operations: %d", ticks); return SYS_POWER_STATE_ACTIVE; } @@ -60,7 +60,7 @@ enum power_states sys_pm_policy_next_state(s32_t ticks) continue; } #endif - if ((ticks == K_FOREVER) || + if ((ticks == K_FOREVER_TICKS) || (ticks >= pm_min_residency[i])) { LOG_DBG("Selected power state %d " "(ticks: %d, min_residency: %u)", diff --git a/subsys/shell/shell.c b/subsys/shell/shell.c index 0bf5fd177fc3c..857effb6a5358 100644 --- a/subsys/shell/shell.c +++ b/subsys/shell/shell.c @@ -1056,7 +1056,7 @@ static void shell_log_process(const struct shell *shell) * readable and can be used to enter further commands. */ if (shell->ctx->cmd_buff_len) { - k_sleep(K_MSEC(15)); + k_sleep(15); } k_poll_signal_check(signal, &signaled, &result); diff --git a/subsys/shell/shell_log_backend.c b/subsys/shell/shell_log_backend.c index 9e8ba9358dc04..842ec2b3add5a 100644 --- a/subsys/shell/shell_log_backend.c +++ b/subsys/shell/shell_log_backend.c @@ -91,7 +91,7 @@ static void msg_to_fifo(const struct shell *shell, }; err = k_msgq_put(shell->log_backend->msgq, &t_msg, - shell->log_backend->timeout); + K_TIMEOUT_MS(shell->log_backend->timeout)); switch (err) { case 0: diff --git a/subsys/shell/shell_uart.c b/subsys/shell/shell_uart.c index 6203ed8d3c66e..b4a28fcc46fd9 100644 --- a/subsys/shell/shell_uart.c +++ b/subsys/shell/shell_uart.c @@ -173,7 +173,8 @@ static int init(const struct shell_transport *transport, } else { k_timer_init(sh_uart->timer, timer_handler, NULL); k_timer_user_data_set(sh_uart->timer, (void *)sh_uart); - k_timer_start(sh_uart->timer, RX_POLL_PERIOD, RX_POLL_PERIOD); + k_timer_start(sh_uart->timer, K_TIMEOUT_MS(RX_POLL_PERIOD), + K_TIMEOUT_MS(RX_POLL_PERIOD)); } return 0; diff --git a/subsys/testsuite/ztest/src/ztest.c b/subsys/testsuite/ztest/src/ztest.c index 51ddd55bdf4f4..6a3212646581d 100644 --- a/subsys/testsuite/ztest/src/ztest.c +++ b/subsys/testsuite/ztest/src/ztest.c @@ -283,7 +283,7 @@ static int run_test(struct unit_test *test) K_THREAD_STACK_SIZEOF(ztest_thread_stack), (k_thread_entry_t) test_cb, (struct unit_test *)test, NULL, NULL, CONFIG_ZTEST_THREAD_PRIORITY, - test->thread_options | K_INHERIT_PERMS, 0); + test->thread_options | K_INHERIT_PERMS, K_NO_WAIT); /* * There is an implicit expectation here that the thread that was * spawned is still higher priority than the current thread. diff --git a/tests/kernel/common/src/errno.c b/tests/kernel/common/src/errno.c index 236d0ebc44d49..bf78a8e8b4f67 100644 --- a/tests/kernel/common/src/errno.c +++ b/tests/kernel/common/src/errno.c @@ -86,7 +86,7 @@ void test_thread_context(void) } for (int ii = 0; ii < N_THREADS; ii++) { - struct result *p = k_fifo_get(&fifo, 100); + struct result *p = k_fifo_get(&fifo, K_TIMEOUT_MS(100)); if (!p || !p->pass) { rv = TC_FAIL; diff --git a/tests/kernel/common/src/timeout_order.c b/tests/kernel/common/src/timeout_order.c index d5ac467dfd152..e77b2b69f7ec9 100644 --- a/tests/kernel/common/src/timeout_order.c +++ b/tests/kernel/common/src/timeout_order.c @@ -56,7 +56,7 @@ void test_timeout_order(void) for (ii = 0; ii < NUM_TIMEOUTS; ii++) { (void)k_thread_create(&threads[ii], stacks[ii], STACKSIZE, thread, INT_TO_POINTER(ii), 0, 0, - prio, 0, 0); + prio, 0, K_TIMEOUT_MS(0)); k_timer_init(&timer[ii], 0, 0); k_sem_init(&sem[ii], 0, 1); results[ii] = -1; @@ -86,7 +86,8 @@ void test_timeout_order(void) /* drop prio to get all poll events together */ k_thread_priority_set(k_current_get(), prio + 1); - zassert_equal(k_poll(poll_events, NUM_TIMEOUTS, 2000), 0, ""); + zassert_equal(k_poll(poll_events, NUM_TIMEOUTS, + K_TIMEOUT_MS(2000)), 0, ""); k_thread_priority_set(k_current_get(), prio - 1); diff --git a/tests/kernel/pending/src/main.c b/tests/kernel/pending/src/main.c index bdb2ca17bbb9a..d091394138dff 100644 --- a/tests/kernel/pending/src/main.c +++ b/tests/kernel/pending/src/main.c @@ -81,12 +81,12 @@ static int __noinit task_low_state; static int __noinit counter; -static inline void *my_fifo_get(struct k_fifo *fifo, s32_t timeout) +static inline void *my_fifo_get(struct k_fifo *fifo, k_timeout_t timeout) { return k_fifo_get(fifo, timeout); } -static inline void *my_lifo_get(struct k_lifo *lifo, s32_t timeout) +static inline void *my_lifo_get(struct k_lifo *lifo, k_timeout_t timeout) { return k_lifo_get(lifo, timeout); } @@ -115,8 +115,8 @@ static void sync_threads(struct k_work *work) } static void fifo_tests(s32_t timeout, volatile int *state, - void *(*get)(struct k_fifo *, s32_t), - int (*sem_take)(struct k_sem *, s32_t)) + void *(*get)(struct k_fifo *, k_timeout_t), + int (*sem_take)(struct k_sem *, k_timeout_t)) { struct fifo_data *data; @@ -153,8 +153,8 @@ static void fifo_tests(s32_t timeout, volatile int *state, } static void lifo_tests(s32_t timeout, volatile int *state, - void *(*get)(struct k_lifo *, s32_t), - int (*sem_take)(struct k_sem *, s32_t)) + void *(*get)(struct k_lifo *, k_timeout_t), + int (*sem_take)(struct k_sem *, k_timeout_t)) { struct lifo_data *data; diff --git a/tests/kernel/semaphore/semaphore/src/main.c b/tests/kernel/semaphore/semaphore/src/main.c index b949963ee048e..80cea174c6c46 100644 --- a/tests/kernel/semaphore/semaphore/src/main.c +++ b/tests/kernel/semaphore/semaphore/src/main.c @@ -749,7 +749,8 @@ void test_sem_multi_take_timeout_diff_sem(void) K_FOREVER); - zassert_true(retrieved_info.timeout == K_SECONDS(i + 1), + zassert_true(K_TIMEOUT_EQ(retrieved_info.timeout, + K_SECONDS(i + 1)), "timeout didn't occur properly"); } From b8d5fc6c981cb5a4c7d141eab6e6221f91db0276 Mon Sep 17 00:00:00 2001 From: Andy Ross Date: Fri, 26 Jul 2019 09:47:35 -0700 Subject: [PATCH 03/19] tests/kernel/{fifo,lifo}: Correct tick slop These tests had what appeared to be a hard-coded one tick slop added to the timeout for a fifo to handle the addition of a full tick (vs. proper rounding) in k_sleep() (which is a separate bug). But the timeout side has been tightened with the recent change and doesn't wait as long as an equivalent sleep anymore (which is a feature), so the sides don't match. And it's wrong anyway, as there are two sleeps being accounted for (the fifo timeout and the sleep in the other thread doing the put), both of which can misalign. Do this with the proper tick conversion API, and use two ticks, not one. Signed-off-by: Andy Ross --- tests/kernel/fifo/fifo_timeout/src/main.c | 4 ++-- tests/kernel/lifo/lifo_usage/src/main.c | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/tests/kernel/fifo/fifo_timeout/src/main.c b/tests/kernel/fifo/fifo_timeout/src/main.c index d8ec1e1318cb6..aa56d2c220291 100644 --- a/tests/kernel/fifo/fifo_timeout/src/main.c +++ b/tests/kernel/fifo/fifo_timeout/src/main.c @@ -367,7 +367,8 @@ static void test_timeout_fifo_thread(void) &timeout, NULL, FIFO_THREAD_PRIO, K_INHERIT_PERMS, 0); - packet = k_fifo_get(&fifo_timeout[0], timeout + 10); + packet = k_fifo_get(&fifo_timeout[0], timeout + + k_ticks_to_ms_ceil32(2)); zassert_true(packet != NULL, NULL); zassert_true(is_timeout_in_range(start_time, timeout), NULL); put_scratch_packet(packet); @@ -382,7 +383,6 @@ static void test_timeout_fifo_thread(void) test_thread_timeout_reply_values, &reply_packet, NULL, NULL, FIFO_THREAD_PRIO, K_INHERIT_PERMS, 0); - k_yield(); packet = k_fifo_get(&timeout_order_fifo, K_NO_WAIT); zassert_true(packet != NULL, NULL); diff --git a/tests/kernel/lifo/lifo_usage/src/main.c b/tests/kernel/lifo/lifo_usage/src/main.c index ac685e3be70c2..430fbd58a6b6e 100644 --- a/tests/kernel/lifo/lifo_usage/src/main.c +++ b/tests/kernel/lifo/lifo_usage/src/main.c @@ -324,7 +324,8 @@ static void test_timeout_lifo_thread(void) &timeout, NULL, LIFO_THREAD_PRIO, K_INHERIT_PERMS, 0); - packet = k_lifo_get(&lifo_timeout[0], timeout + 10); + packet = k_lifo_get(&lifo_timeout[0], timeout + + k_ticks_to_ms_ceil32(2)); zassert_true(packet != NULL, NULL); zassert_true(is_timeout_in_range(start_time, timeout), NULL); put_scratch_packet(packet); From 096f3eb921828267194623b7940743ea35a3878d Mon Sep 17 00:00:00 2001 From: Andy Ross Date: Fri, 26 Jul 2019 10:19:50 -0700 Subject: [PATCH 04/19] kernel/queue: Fix incorrect spinning when in poll mode In the "POLL" implementation of k_queue_get(), if it ever happened that the elapsed time exactly equalled the time we were supposed to wait, the k_poll() call would be called (correctly) with a timeout of zero, and return synchronously. But the "done" flag would not be set because of an off by one error, so we would have to spin for the next tick needlessly. Even worse: on native_posix, nothing in this loop returns control to the main loop so in fact there we spin forever! (Which is how this got discovered.) Signed-off-by: Andy Ross --- kernel/queue.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/queue.c b/kernel/queue.c index 6c60bd2154314..80e680ff521ba 100644 --- a/kernel/queue.c +++ b/kernel/queue.c @@ -313,7 +313,7 @@ static void *k_queue_poll(struct k_queue *queue, k_timeout_t timeout) if ((val == NULL) && !K_TIMEOUT_EQ(timeout, K_FOREVER)) { elapsed = k_uptime_get_32() - start; - done = elapsed > to_ms; + done = elapsed >= to_ms; } } while (!val && !done); From 5b8619d635fb7c52b39039a004cd2909896fd58a Mon Sep 17 00:00:00 2001 From: Andy Ross Date: Fri, 26 Jul 2019 11:30:17 -0700 Subject: [PATCH 05/19] tests/kernel: Port all tests to new timer API conventions The timer API now requires an opaque/typesafe timeout value, so all the integers being passed to delays need to be appropriately wrapped with generator macros, and constants zeros need to be K_NO_WAIT (which technically they always should have been). Lots of code churn, but no semantic difference. Signed-off-by: Andy Ross --- include/kernel.h | 1 - kernel/Kconfig | 1 - tests/kernel/common/src/timeout_order.c | 2 +- tests/kernel/context/src/main.c | 28 +++++----- tests/kernel/critical/src/main.c | 8 +-- tests/kernel/early_sleep/src/main.c | 2 +- tests/kernel/fatal/src/main.c | 2 +- .../fifo/fifo_api/src/test_fifo_cancel.c | 4 +- .../fifo/fifo_api/src/test_fifo_contexts.c | 2 +- .../kernel/fifo/fifo_api/src/test_fifo_fail.c | 2 +- .../kernel/fifo/fifo_api/src/test_fifo_loop.c | 2 +- tests/kernel/fifo/fifo_timeout/src/main.c | 25 ++++----- tests/kernel/fifo/fifo_usage/src/main.c | 6 +-- tests/kernel/interrupt/src/nested_irq.c | 6 +-- .../lifo/lifo_api/src/test_lifo_contexts.c | 2 +- .../kernel/lifo/lifo_api/src/test_lifo_fail.c | 2 +- .../kernel/lifo/lifo_api/src/test_lifo_loop.c | 2 +- tests/kernel/lifo/lifo_usage/src/main.c | 23 ++++---- .../kernel/mbox/mbox_api/src/test_mbox_api.c | 7 +-- tests/kernel/mbox/mbox_usage/src/main.c | 17 +++--- tests/kernel/mem_pool/mem_pool/src/main.c | 10 ++-- .../mem_pool_api/src/test_mpool_api.c | 3 +- .../mem_pool_concept/src/test_mpool.h | 2 +- .../src/test_mpool_alloc_wait.c | 6 +-- .../src/test_mpool_merge_fail_diff_size.c | 2 +- .../mem_pool/mem_pool_threadsafe/src/main.c | 4 +- tests/kernel/mem_protect/sys_sem/src/main.c | 4 +- tests/kernel/mem_slab/mslab/src/main.c | 6 +-- .../mem_slab/mslab_api/src/test_mslab.h | 2 +- .../mem_slab/mslab_api/src/test_mslab_api.c | 2 +- .../mem_slab/mslab_concept/src/test_mslab.h | 2 +- .../mslab_concept/src/test_mslab_alloc_wait.c | 6 +-- .../src/test_mslab_threadsafe.c | 4 +- tests/kernel/msgq/msgq_api/src/test_msgq.h | 2 +- .../msgq/msgq_api/src/test_msgq_contexts.c | 8 +-- .../msgq/msgq_api/src/test_msgq_purge.c | 4 +- .../mutex/mutex_api/src/test_mutex_apis.c | 12 +++-- tests/kernel/mutex/sys_mutex/src/main.c | 40 +++++++------- tests/kernel/mutex/sys_mutex/src/thread_12.c | 2 +- tests/kernel/obj_tracing/src/main.c | 2 +- tests/kernel/pending/src/main.c | 20 +++---- tests/kernel/pipe/pipe/src/test_pipe.c | 10 ++-- .../pipe/pipe_api/src/test_pipe_contexts.c | 29 +++++----- .../kernel/pipe/pipe_api/src/test_pipe_fail.c | 2 +- tests/kernel/poll/src/test_poll.c | 54 ++++++++++--------- tests/kernel/queue/src/test_queue_contexts.c | 6 +-- tests/kernel/queue/src/test_queue_fail.c | 2 +- tests/kernel/queue/src/test_queue_loop.c | 2 +- tests/kernel/queue/src/test_queue_user.c | 2 +- tests/kernel/sched/deadline/src/main.c | 2 +- tests/kernel/sched/preempt/src/main.c | 4 +- .../src/test_priority_scheduling.c | 3 +- .../src/test_sched_is_preempt_thread.c | 4 +- .../schedule_api/src/test_sched_priority.c | 6 +-- .../src/test_sched_timeslice_and_lock.c | 11 ++-- .../src/test_sched_timeslice_reset.c | 3 +- .../schedule_api/src/test_slice_scheduling.c | 3 +- .../kernel/sched/schedule_api/src/user_api.c | 8 +-- tests/kernel/semaphore/sema_api/src/main.c | 4 +- tests/kernel/semaphore/semaphore/src/main.c | 53 +++++++++--------- tests/kernel/sleep/src/main.c | 4 +- tests/kernel/smp/src/main.c | 3 +- .../stack/stack_api/src/test_stack_contexts.c | 5 +- .../stack/stack_api/src/test_stack_fail.c | 2 +- tests/kernel/stack/stack_usage/src/main.c | 6 +-- .../kernel/threads/dynamic_thread/src/main.c | 4 +- tests/kernel/threads/thread_apis/src/main.c | 8 +-- .../thread_apis/src/test_essential_thread.c | 3 +- .../thread_apis/src/test_kthread_for_each.c | 2 +- .../src/test_threads_cancel_abort.c | 16 +++--- .../src/test_threads_set_priority.c | 3 +- .../thread_apis/src/test_threads_spawn.c | 6 +-- .../src/test_threads_suspend_resume.c | 2 +- tests/kernel/threads/thread_init/src/main.c | 8 +-- .../tickless/tickless_concept/src/main.c | 5 +- tests/kernel/timer/timer_api/src/main.c | 36 ++++++++----- tests/kernel/workq/work_queue/src/main.c | 26 ++++----- tests/kernel/workq/work_queue_api/src/main.c | 32 ++++++----- 78 files changed, 353 insertions(+), 313 deletions(-) diff --git a/include/kernel.h b/include/kernel.h index fa9be7a5d609b..033dbf22ee7da 100644 --- a/include/kernel.h +++ b/include/kernel.h @@ -1435,7 +1435,6 @@ struct k_timer { .wait_q = Z_WAIT_Q_INIT(&obj.wait_q), \ .expiry_fn = expiry, \ .stop_fn = stop, \ - .period = 0, \ .status = 0, \ .user_data = 0, \ _OBJECT_TRACING_INIT \ diff --git a/kernel/Kconfig b/kernel/Kconfig index 1fa9313bfc3dd..ec0fa00f41f56 100644 --- a/kernel/Kconfig +++ b/kernel/Kconfig @@ -592,7 +592,6 @@ config SYS_TIMEOUT_64BIT config SYS_TIMEOUT_LEGACY_API bool "Enable old millisecond timeout API" depends on !SYS_TIMEOUT_64BIT - default y help When enabled, k_timeout_t values passed to kernel APIs are 32 bit couts of milliseconds. This allows source-level diff --git a/tests/kernel/common/src/timeout_order.c b/tests/kernel/common/src/timeout_order.c index e77b2b69f7ec9..08f78ef422ff9 100644 --- a/tests/kernel/common/src/timeout_order.c +++ b/tests/kernel/common/src/timeout_order.c @@ -73,7 +73,7 @@ void test_timeout_order(void) } for (ii = 0; ii < NUM_TIMEOUTS; ii++) { - k_timer_start(&timer[ii], 100, 0); + k_timer_start(&timer[ii], K_TIMEOUT_MS(100), K_NO_WAIT); } struct k_poll_event poll_events[NUM_TIMEOUTS]; diff --git a/tests/kernel/context/src/main.c b/tests/kernel/context/src/main.c index f76da596894f7..3f232ff31c3c8 100644 --- a/tests/kernel/context/src/main.c +++ b/tests/kernel/context/src/main.c @@ -579,7 +579,7 @@ static void k_yield_entry(void *arg0, void *arg1, void *arg2) k_thread_create(&thread_data2, thread_stack2, THREAD_STACKSIZE, thread_helper, NULL, NULL, NULL, - K_PRIO_COOP(THREAD_PRIORITY - 1), 0, 0); + K_PRIO_COOP(THREAD_PRIORITY - 1), 0, K_NO_WAIT); zassert_equal(thread_evidence, 0, "Helper created at higher priority ran prematurely."); @@ -740,9 +740,9 @@ static void test_busy_wait(void) k_thread_create(&timeout_threads[0], timeout_stacks[0], THREAD_STACKSIZE2, busy_wait_thread, INT_TO_POINTER(timeout), NULL, - NULL, K_PRIO_COOP(THREAD_PRIORITY), 0, 0); + NULL, K_PRIO_COOP(THREAD_PRIORITY), 0, K_NO_WAIT); - rv = k_sem_take(&reply_timeout, timeout * 2); + rv = k_sem_take(&reply_timeout, K_TIMEOUT_MS(timeout * 2)); zassert_false(rv, " *** thread timed out waiting for " "k_busy_wait()"); } @@ -767,9 +767,9 @@ static void test_k_sleep(void) k_thread_create(&timeout_threads[0], timeout_stacks[0], THREAD_STACKSIZE2, thread_sleep, INT_TO_POINTER(timeout), NULL, - NULL, K_PRIO_COOP(THREAD_PRIORITY), 0, 0); + NULL, K_PRIO_COOP(THREAD_PRIORITY), 0, K_NO_WAIT); - rv = k_sem_take(&reply_timeout, timeout * 2); + rv = k_sem_take(&reply_timeout, K_TIMEOUT_MS(timeout * 2)); zassert_equal(rv, 0, " *** thread timed out waiting for thread on " "k_sleep()."); @@ -781,10 +781,11 @@ static void test_k_sleep(void) THREAD_STACKSIZE2, delayed_thread, INT_TO_POINTER(i), NULL, NULL, - K_PRIO_COOP(5), 0, timeouts[i].timeout); + K_PRIO_COOP(5), 0, + K_TIMEOUT_MS(timeouts[i].timeout)); } for (i = 0; i < NUM_TIMEOUT_THREADS; i++) { - data = k_fifo_get(&timeout_order_fifo, 750); + data = k_fifo_get(&timeout_order_fifo, K_TIMEOUT_MS(750)); zassert_not_null(data, " *** timeout while waiting for" " delayed thread"); @@ -797,7 +798,7 @@ static void test_k_sleep(void) } /* ensure no more thread fire */ - data = k_fifo_get(&timeout_order_fifo, 750); + data = k_fifo_get(&timeout_order_fifo, K_TIMEOUT_MS(750)); zassert_false(data, " *** got something unexpected in the fifo"); @@ -816,7 +817,8 @@ static void test_k_sleep(void) id = k_thread_create(&timeout_threads[i], timeout_stacks[i], THREAD_STACKSIZE2, delayed_thread, INT_TO_POINTER(i), NULL, NULL, - K_PRIO_COOP(5), 0, timeouts[i].timeout); + K_PRIO_COOP(5), 0, + K_TIMEOUT_MS(timeouts[i].timeout)); delayed_threads[i] = id; } @@ -842,7 +844,7 @@ static void test_k_sleep(void) } } - data = k_fifo_get(&timeout_order_fifo, 2750); + data = k_fifo_get(&timeout_order_fifo, K_TIMEOUT_MS(2750)); zassert_not_null(data, " *** timeout while waiting for" " delayed thread"); @@ -861,7 +863,7 @@ static void test_k_sleep(void) "got %d\n", num_cancellations, next_cancellation); /* ensure no more thread fire */ - data = k_fifo_get(&timeout_order_fifo, 750); + data = k_fifo_get(&timeout_order_fifo, K_TIMEOUT_MS(750)); zassert_false(data, " *** got something unexpected in the fifo"); } @@ -888,7 +890,7 @@ void test_k_yield(void) k_thread_create(&thread_data1, thread_stack1, THREAD_STACKSIZE, k_yield_entry, NULL, NULL, - NULL, K_PRIO_COOP(THREAD_PRIORITY), 0, 0); + NULL, K_PRIO_COOP(THREAD_PRIORITY), 0, K_NO_WAIT); zassert_equal(thread_evidence, 1, "Thread did not execute as expected!: %d", thread_evidence); @@ -910,7 +912,7 @@ void test_kernel_thread(void) k_thread_create(&thread_data3, thread_stack3, THREAD_STACKSIZE, kernel_thread_entry, NULL, NULL, - NULL, K_PRIO_COOP(THREAD_PRIORITY), 0, 0); + NULL, K_PRIO_COOP(THREAD_PRIORITY), 0, K_NO_WAIT); } diff --git a/tests/kernel/critical/src/main.c b/tests/kernel/critical/src/main.c index 3fa7ffcacb2a5..66046b87cb3d5 100644 --- a/tests/kernel/critical/src/main.c +++ b/tests/kernel/critical/src/main.c @@ -33,7 +33,7 @@ #include #define NUM_MILLISECONDS 5000 -#define TEST_TIMEOUT 20000 +#define TEST_TIMEOUT K_TIMEOUT_MS(20000) static u32_t critical_var; static u32_t alt_thread_iterations; @@ -196,11 +196,11 @@ static void start_threads(void) { k_thread_create(&thread1, stack1, STACK_SIZE, alternate_thread, NULL, NULL, NULL, - K_PRIO_PREEMPT(12), 0, 0); + K_PRIO_PREEMPT(12), 0, K_NO_WAIT); k_thread_create(&thread2, stack2, STACK_SIZE, regression_thread, NULL, NULL, NULL, - K_PRIO_PREEMPT(12), 0, 0); + K_PRIO_PREEMPT(12), 0, K_NO_WAIT); } /** @@ -216,7 +216,7 @@ void test_critical(void) init_objects(); start_threads(); - zassert_true(k_sem_take(&TEST_SEM, TEST_TIMEOUT * 2) == 0, + zassert_true(k_sem_take(&TEST_SEM, TEST_TIMEOUT) == 0, "Timed out waiting for TEST_SEM"); } diff --git a/tests/kernel/early_sleep/src/main.c b/tests/kernel/early_sleep/src/main.c index c44a72a5d4890..7db8befb773ac 100644 --- a/tests/kernel/early_sleep/src/main.c +++ b/tests/kernel/early_sleep/src/main.c @@ -112,7 +112,7 @@ static void test_early_sleep(void) helper_tstack, THREAD_STACK, helper_thread, NULL, NULL, NULL, k_thread_priority_get(k_current_get()) + 1, - K_INHERIT_PERMS, 0); + K_INHERIT_PERMS, K_NO_WAIT); TC_PRINT("k_sleep() ticks at POST_KERNEL level: %d\n", actual_post_kernel_sleep_ticks); diff --git a/tests/kernel/fatal/src/main.c b/tests/kernel/fatal/src/main.c index b6f6922c70c0f..eddcf568c1826 100644 --- a/tests/kernel/fatal/src/main.c +++ b/tests/kernel/fatal/src/main.c @@ -175,7 +175,7 @@ void stack_sentinel_timer(void) blow_up_stack(); k_timer_init(&timer, NULL, NULL); - k_timer_start(&timer, 1, 0); + k_timer_start(&timer, K_TIMEOUT_MS(1), K_NO_WAIT); while (true) { } } diff --git a/tests/kernel/fifo/fifo_api/src/test_fifo_cancel.c b/tests/kernel/fifo/fifo_api/src/test_fifo_cancel.c index ead5996320401..12c8430ca5317 100644 --- a/tests/kernel/fifo/fifo_api/src/test_fifo_cancel.c +++ b/tests/kernel/fifo/fifo_api/src/test_fifo_cancel.c @@ -26,9 +26,9 @@ static void tfifo_thread_thread(struct k_fifo *pfifo) { k_tid_t tid = k_thread_create(&thread, tstack, STACK_SIZE, t_cancel_wait_entry, pfifo, NULL, NULL, - K_PRIO_PREEMPT(0), 0, 0); + K_PRIO_PREEMPT(0), 0, K_NO_WAIT); u32_t start_t = k_uptime_get_32(); - void *ret = k_fifo_get(pfifo, 500); + void *ret = k_fifo_get(pfifo, K_TIMEOUT_MS(500)); u32_t dur = k_uptime_get_32() - start_t; /* While we observed the side effect of the last statement diff --git a/tests/kernel/fifo/fifo_api/src/test_fifo_contexts.c b/tests/kernel/fifo/fifo_api/src/test_fifo_contexts.c index 44d1419b60a8c..e87eefafb9671 100644 --- a/tests/kernel/fifo/fifo_api/src/test_fifo_contexts.c +++ b/tests/kernel/fifo/fifo_api/src/test_fifo_contexts.c @@ -90,7 +90,7 @@ static void tfifo_thread_thread(struct k_fifo *pfifo) /**TESTPOINT: thread-thread data passing via fifo*/ k_tid_t tid = k_thread_create(&tdata, tstack, STACK_SIZE, tThread_entry, pfifo, NULL, NULL, - K_PRIO_PREEMPT(0), 0, 0); + K_PRIO_PREEMPT(0), 0, K_NO_WAIT); tfifo_put(pfifo); k_sem_take(&end_sema, K_FOREVER); k_thread_abort(tid); diff --git a/tests/kernel/fifo/fifo_api/src/test_fifo_fail.c b/tests/kernel/fifo/fifo_api/src/test_fifo_fail.c index f69c728bbcaa6..514137c304f0a 100644 --- a/tests/kernel/fifo/fifo_api/src/test_fifo_fail.c +++ b/tests/kernel/fifo/fifo_api/src/test_fifo_fail.c @@ -6,7 +6,7 @@ #include "test_fifo.h" -#define TIMEOUT 100 +#define TIMEOUT K_TIMEOUT_MS(100) /** * @addtogroup kernel_fifo_tests diff --git a/tests/kernel/fifo/fifo_api/src/test_fifo_loop.c b/tests/kernel/fifo/fifo_api/src/test_fifo_loop.c index 85af447299363..d0e09980f5cc8 100644 --- a/tests/kernel/fifo/fifo_api/src/test_fifo_loop.c +++ b/tests/kernel/fifo/fifo_api/src/test_fifo_loop.c @@ -62,7 +62,7 @@ static void tfifo_read_write(struct k_fifo *pfifo) /**TESTPOINT: thread-isr-thread data passing via fifo*/ k_tid_t tid = k_thread_create(&tdata, tstack, STACK_SIZE, tThread_entry, pfifo, NULL, NULL, - K_PRIO_PREEMPT(0), 0, 0); + K_PRIO_PREEMPT(0), 0, K_NO_WAIT); TC_PRINT("main fifo put ---> "); tfifo_put(pfifo); diff --git a/tests/kernel/fifo/fifo_timeout/src/main.c b/tests/kernel/fifo/fifo_timeout/src/main.c index aa56d2c220291..d1bd9e22ed022 100644 --- a/tests/kernel/fifo/fifo_timeout/src/main.c +++ b/tests/kernel/fifo/fifo_timeout/src/main.c @@ -127,7 +127,7 @@ static void test_thread_pend_and_timeout(void *p1, void *p2, void *p3) k_sleep(1); /* Align to ticks */ start_time = k_cycle_get_32(); - packet = k_fifo_get(d->fifo, d->timeout); + packet = k_fifo_get(d->fifo, K_TIMEOUT_MS(d->timeout)); zassert_true(packet == NULL, NULL); zassert_true(is_timeout_in_range(start_time, d->timeout), NULL); @@ -144,7 +144,7 @@ static int test_multiple_threads_pending(struct timeout_order_data *test_data, tid[ii] = k_thread_create(&ttdata[ii], ttstack[ii], TSTACK_SIZE, test_thread_pend_and_timeout, &test_data[ii], NULL, NULL, - FIFO_THREAD_PRIO, K_INHERIT_PERMS, 0); + FIFO_THREAD_PRIO, K_INHERIT_PERMS, K_NO_WAIT); } /* In general, there is no guarantee of wakeup order when multiple @@ -200,7 +200,7 @@ static void test_thread_pend_and_get_data(void *p1, void *p2, void *p3) struct timeout_order_data *d = (struct timeout_order_data *)p1; void *packet; - packet = k_fifo_get(d->fifo, d->timeout); + packet = k_fifo_get(d->fifo, K_TIMEOUT_MS(d->timeout)); zassert_true(packet != NULL, NULL); put_scratch_packet(packet); @@ -218,13 +218,13 @@ static int test_multiple_threads_get_data(struct timeout_order_data *test_data, tid[ii] = k_thread_create(&ttdata[ii], ttstack[ii], TSTACK_SIZE, test_thread_pend_and_get_data, &test_data[ii], NULL, NULL, - K_PRIO_PREEMPT(0), K_INHERIT_PERMS, 0); + K_PRIO_PREEMPT(0), K_INHERIT_PERMS, K_NO_WAIT); } tid[ii] = k_thread_create(&ttdata[ii], ttstack[ii], TSTACK_SIZE, test_thread_pend_and_timeout, &test_data[ii], NULL, NULL, - K_PRIO_PREEMPT(0), K_INHERIT_PERMS, 0); + K_PRIO_PREEMPT(0), K_INHERIT_PERMS, K_NO_WAIT); for (ii = 0; ii < test_data_size-1; ii++) { k_fifo_put(test_data[ii].fifo, get_scratch_packet()); @@ -305,7 +305,7 @@ static void test_timeout_empty_fifo(void) /* Test empty fifo with timeout */ timeout = 10U; start_time = k_cycle_get_32(); - packet = k_fifo_get(&fifo_timeout[0], timeout); + packet = k_fifo_get(&fifo_timeout[0], K_TIMEOUT_MS(timeout)); zassert_true(packet == NULL, NULL); zassert_true(is_timeout_in_range(start_time, timeout), NULL); @@ -365,10 +365,11 @@ static void test_timeout_fifo_thread(void) tid[0] = k_thread_create(&ttdata[0], ttstack[0], TSTACK_SIZE, test_thread_put_timeout, &fifo_timeout[0], &timeout, NULL, - FIFO_THREAD_PRIO, K_INHERIT_PERMS, 0); + FIFO_THREAD_PRIO, K_INHERIT_PERMS, K_NO_WAIT); - packet = k_fifo_get(&fifo_timeout[0], timeout - + k_ticks_to_ms_ceil32(2)); + packet = k_fifo_get(&fifo_timeout[0], + K_TIMEOUT_MS(timeout + + k_ticks_to_ms_ceil32(2))); zassert_true(packet != NULL, NULL); zassert_true(is_timeout_in_range(start_time, timeout), NULL); put_scratch_packet(packet); @@ -382,7 +383,7 @@ static void test_timeout_fifo_thread(void) tid[0] = k_thread_create(&ttdata[0], ttstack[0], TSTACK_SIZE, test_thread_timeout_reply_values, &reply_packet, NULL, NULL, - FIFO_THREAD_PRIO, K_INHERIT_PERMS, 0); + FIFO_THREAD_PRIO, K_INHERIT_PERMS, K_NO_WAIT); k_yield(); packet = k_fifo_get(&timeout_order_fifo, K_NO_WAIT); zassert_true(packet != NULL, NULL); @@ -400,7 +401,7 @@ static void test_timeout_fifo_thread(void) tid[0] = k_thread_create(&ttdata[0], ttstack[0], TSTACK_SIZE, test_thread_timeout_reply_values, &reply_packet, NULL, NULL, - FIFO_THREAD_PRIO, K_INHERIT_PERMS, 0); + FIFO_THREAD_PRIO, K_INHERIT_PERMS, K_NO_WAIT); k_yield(); packet = k_fifo_get(&timeout_order_fifo, K_NO_WAIT); @@ -420,7 +421,7 @@ static void test_timeout_fifo_thread(void) tid[0] = k_thread_create(&ttdata[0], ttstack[0], TSTACK_SIZE, test_thread_timeout_reply_values_wfe, &reply_packet, NULL, NULL, - FIFO_THREAD_PRIO, K_INHERIT_PERMS, 0); + FIFO_THREAD_PRIO, K_INHERIT_PERMS, K_NO_WAIT); packet = k_fifo_get(&timeout_order_fifo, K_FOREVER); zassert_true(packet != NULL, NULL); diff --git a/tests/kernel/fifo/fifo_usage/src/main.c b/tests/kernel/fifo/fifo_usage/src/main.c index 8b0d3d31a8159..fed48b64d2838 100644 --- a/tests/kernel/fifo/fifo_usage/src/main.c +++ b/tests/kernel/fifo/fifo_usage/src/main.c @@ -156,7 +156,7 @@ static void test_single_fifo_play(void) k_tid_t tid = k_thread_create(&tdata, tstack, STACK_SIZE, thread_entry_fn_single, &fifo1, NULL, NULL, - K_PRIO_PREEMPT(0), K_INHERIT_PERMS, 0); + K_PRIO_PREEMPT(0), K_INHERIT_PERMS, K_NO_WAIT); /* Let the child thread run */ k_sem_take(&end_sema, K_FOREVER); @@ -187,7 +187,7 @@ static void test_dual_fifo_play(void) k_tid_t tid = k_thread_create(&tdata, tstack, STACK_SIZE, thread_entry_fn_dual, &fifo1, &fifo2, NULL, - K_PRIO_PREEMPT(0), K_INHERIT_PERMS, 0); + K_PRIO_PREEMPT(0), K_INHERIT_PERMS, K_NO_WAIT); for (i = 0U; i < LIST_LEN; i++) { /* Put item into fifo */ @@ -219,7 +219,7 @@ static void test_isr_fifo_play(void) k_tid_t tid = k_thread_create(&tdata, tstack, STACK_SIZE, thread_entry_fn_isr, &fifo1, &fifo2, NULL, - K_PRIO_PREEMPT(0), K_INHERIT_PERMS, 0); + K_PRIO_PREEMPT(0), K_INHERIT_PERMS, K_NO_WAIT); /* Put item into fifo */ diff --git a/tests/kernel/interrupt/src/nested_irq.c b/tests/kernel/interrupt/src/nested_irq.c index 3ef6e997ac8c4..8f539b4b658aa 100644 --- a/tests/kernel/interrupt/src/nested_irq.c +++ b/tests/kernel/interrupt/src/nested_irq.c @@ -33,7 +33,7 @@ u32_t irq_line_1; #define ISR1_PRIO 0 #endif /* CONFIG_ARM */ -#define MS_TO_US(ms) (K_MSEC(ms) * USEC_PER_MSEC) +#define MS_TO_US(ms) ((ms) * USEC_PER_MSEC) volatile u32_t new_val; u32_t old_val = 0xDEAD; volatile u32_t check_lock_new; @@ -100,7 +100,7 @@ void test_nested_isr(void) #endif /* CONFIG_ARM */ k_timer_init(&timer, handler, NULL); - k_timer_start(&timer, DURATION, 0); + k_timer_start(&timer, K_TIMEOUT_MS(DURATION), K_NO_WAIT); #if defined(CONFIG_ARM) irq_enable(irq_line_0); @@ -131,7 +131,7 @@ static void offload_function(void *param) zassert_true(k_is_in_isr(), "Not in IRQ context!"); k_timer_init(&timer, timer_handler, NULL); k_busy_wait(MS_TO_US(1)); - k_timer_start(&timer, DURATION, 0); + k_timer_start(&timer, K_TIMEOUT_MS(DURATION), K_NO_WAIT); zassert_not_equal(check_lock_new, check_lock_old, "Interrupt locking didn't work properly"); } diff --git a/tests/kernel/lifo/lifo_api/src/test_lifo_contexts.c b/tests/kernel/lifo/lifo_api/src/test_lifo_contexts.c index 1eae1d202b9b1..9bad4cf120dfe 100644 --- a/tests/kernel/lifo/lifo_api/src/test_lifo_contexts.c +++ b/tests/kernel/lifo/lifo_api/src/test_lifo_contexts.c @@ -61,7 +61,7 @@ static void tlifo_thread_thread(struct k_lifo *plifo) /**TESTPOINT: thread-thread data passing via lifo*/ k_tid_t tid = k_thread_create(&tdata, tstack, STACK_SIZE, tThread_entry, plifo, NULL, NULL, - K_PRIO_PREEMPT(0), 0, 0); + K_PRIO_PREEMPT(0), 0, K_NO_WAIT); tlifo_put(plifo); k_sem_take(&end_sema, K_FOREVER); k_thread_abort(tid); diff --git a/tests/kernel/lifo/lifo_api/src/test_lifo_fail.c b/tests/kernel/lifo/lifo_api/src/test_lifo_fail.c index 6245dc949a793..7242c3b200416 100644 --- a/tests/kernel/lifo/lifo_api/src/test_lifo_fail.c +++ b/tests/kernel/lifo/lifo_api/src/test_lifo_fail.c @@ -6,7 +6,7 @@ #include "test_lifo.h" -#define TIMEOUT 100 +#define TIMEOUT K_TIMEOUT_MS(100) /*test cases*/ /** diff --git a/tests/kernel/lifo/lifo_api/src/test_lifo_loop.c b/tests/kernel/lifo/lifo_api/src/test_lifo_loop.c index 47c340ecf9c9a..229deff048125 100644 --- a/tests/kernel/lifo/lifo_api/src/test_lifo_loop.c +++ b/tests/kernel/lifo/lifo_api/src/test_lifo_loop.c @@ -62,7 +62,7 @@ static void tlifo_read_write(struct k_lifo *plifo) /**TESTPOINT: thread-isr-thread data passing via lifo*/ k_tid_t tid = k_thread_create(&tdata, tstack, STACK_SIZE, tThread_entry, plifo, NULL, NULL, - K_PRIO_PREEMPT(0), 0, 0); + K_PRIO_PREEMPT(0), 0, K_NO_WAIT); TC_PRINT("main lifo put ---> "); tlifo_put(plifo); diff --git a/tests/kernel/lifo/lifo_usage/src/main.c b/tests/kernel/lifo/lifo_usage/src/main.c index 430fbd58a6b6e..1bddc9b119818 100644 --- a/tests/kernel/lifo/lifo_usage/src/main.c +++ b/tests/kernel/lifo/lifo_usage/src/main.c @@ -125,7 +125,7 @@ static int test_multiple_threads_pending(struct timeout_order_data *test_data, tid[ii] = k_thread_create(&ttdata[ii], ttstack[ii], TSTACK_SIZE, test_thread_pend_and_timeout, &test_data[ii], NULL, NULL, - LIFO_THREAD_PRIO, K_INHERIT_PERMS, 0); + LIFO_THREAD_PRIO, K_INHERIT_PERMS, K_NO_WAIT); } for (ii = 0; ii < test_data_size; ii++) { @@ -218,7 +218,7 @@ static void test_lifo_nowait(void) k_tid_t tid = k_thread_create(&tdata, tstack, STACK_SIZE, thread_entry_nowait, &lifo, NULL, NULL, - K_PRIO_PREEMPT(0), 0, 0); + K_PRIO_PREEMPT(0), 0, K_NO_WAIT); k_lifo_put(&lifo, (void *)&data[1]); @@ -240,7 +240,7 @@ static void test_lifo_wait(void) k_tid_t tid = k_thread_create(&tdata1, tstack1, STACK_SIZE, thread_entry_wait, &plifo, NULL, NULL, - K_PRIO_PREEMPT(0), 0, 0); + K_PRIO_PREEMPT(0), 0, K_NO_WAIT); ret = k_lifo_get(&plifo, K_FOREVER); @@ -269,7 +269,7 @@ static void test_timeout_empty_lifo(void) start_time = k_cycle_get_32(); - packet = k_lifo_get(&lifo_timeout[0], timeout); + packet = k_lifo_get(&lifo_timeout[0], K_TIMEOUT_MS(timeout)); zassert_equal(packet, NULL, NULL); @@ -322,10 +322,11 @@ static void test_timeout_lifo_thread(void) tid[0] = k_thread_create(&ttdata[0], ttstack[0], TSTACK_SIZE, test_thread_put_timeout, &lifo_timeout[0], &timeout, NULL, - LIFO_THREAD_PRIO, K_INHERIT_PERMS, 0); + LIFO_THREAD_PRIO, K_INHERIT_PERMS, K_NO_WAIT); - packet = k_lifo_get(&lifo_timeout[0], timeout - + k_ticks_to_ms_ceil32(2)); + packet = k_lifo_get(&lifo_timeout[0], + K_TIMEOUT_MS(timeout + + k_ticks_to_ms_ceil32(2))); zassert_true(packet != NULL, NULL); zassert_true(is_timeout_in_range(start_time, timeout), NULL); put_scratch_packet(packet); @@ -339,7 +340,7 @@ static void test_timeout_lifo_thread(void) tid[0] = k_thread_create(&ttdata[0], ttstack[0], TSTACK_SIZE, test_thread_timeout_reply_values, &reply_packet, NULL, NULL, - LIFO_THREAD_PRIO, K_INHERIT_PERMS, 0); + LIFO_THREAD_PRIO, K_INHERIT_PERMS, K_NO_WAIT); k_yield(); packet = k_lifo_get(&timeout_order_lifo, K_NO_WAIT); @@ -358,7 +359,7 @@ static void test_timeout_lifo_thread(void) tid[0] = k_thread_create(&ttdata[0], ttstack[0], TSTACK_SIZE, test_thread_timeout_reply_values, &reply_packet, NULL, NULL, - LIFO_THREAD_PRIO, K_INHERIT_PERMS, 0); + LIFO_THREAD_PRIO, K_INHERIT_PERMS, K_NO_WAIT); k_yield(); packet = k_lifo_get(&timeout_order_lifo, K_NO_WAIT); @@ -378,7 +379,7 @@ static void test_timeout_lifo_thread(void) tid[0] = k_thread_create(&ttdata[0], ttstack[0], TSTACK_SIZE, test_thread_timeout_reply_values_wfe, &reply_packet, NULL, NULL, - LIFO_THREAD_PRIO, K_INHERIT_PERMS, 0); + LIFO_THREAD_PRIO, K_INHERIT_PERMS, K_NO_WAIT); packet = k_lifo_get(&timeout_order_lifo, K_FOREVER); zassert_true(packet != NULL, NULL); @@ -397,7 +398,7 @@ void test_thread_pend_and_timeout(void *p1, void *p2, void *p3) void *packet; start_time = k_cycle_get_32(); - packet = k_lifo_get(d->klifo, d->timeout); + packet = k_lifo_get(d->klifo, K_TIMEOUT_MS(d->timeout)); zassert_true(packet == NULL, NULL); zassert_true(is_timeout_in_range(start_time, d->timeout), NULL); diff --git a/tests/kernel/mbox/mbox_api/src/test_mbox_api.c b/tests/kernel/mbox/mbox_api/src/test_mbox_api.c index 7f9cc2e0a214a..c322875fe8f74 100644 --- a/tests/kernel/mbox/mbox_api/src/test_mbox_api.c +++ b/tests/kernel/mbox/mbox_api/src/test_mbox_api.c @@ -6,7 +6,7 @@ #include -#define TIMEOUT 100 +#define TIMEOUT K_TIMEOUT_MS(100) #if !defined(CONFIG_BOARD_QEMU_X86) #define STACK_SIZE (512 + CONFIG_TEST_EXTRA_STACKSIZE) #else @@ -419,7 +419,8 @@ static void tmbox_get(struct k_mbox *pmbox) NULL); zassert_true(k_mbox_data_block_get - (&mmsg, &mpoolrx, &rxblock, 1) == -EAGAIN, NULL); + (&mmsg, &mpoolrx, &rxblock, + K_TIMEOUT_MS(1)) == -EAGAIN, NULL); /* Now dispose of the block since the test case finished */ k_mbox_data_get(&mmsg, NULL); @@ -537,7 +538,7 @@ static void tmbox(struct k_mbox *pmbox) sender_tid = k_current_get(); receiver_tid = k_thread_create(&tdata, tstack, STACK_SIZE, tmbox_entry, pmbox, NULL, NULL, - K_PRIO_PREEMPT(0), 0, 0); + K_PRIO_PREEMPT(0), 0, K_NO_WAIT); tmbox_put(pmbox); k_sem_take(&end_sema, K_FOREVER); diff --git a/tests/kernel/mbox/mbox_usage/src/main.c b/tests/kernel/mbox/mbox_usage/src/main.c index 47d484ddacd99..a0ad8499cb7b3 100644 --- a/tests/kernel/mbox/mbox_usage/src/main.c +++ b/tests/kernel/mbox/mbox_usage/src/main.c @@ -28,7 +28,7 @@ static enum mmsg_type { TARGET_SOURCE } info_type; -static void msg_sender(struct k_mbox *pmbox, s32_t timeout) +static void msg_sender(struct k_mbox *pmbox, k_timeout_t timeout) { struct k_mbox_msg mmsg; @@ -40,9 +40,9 @@ static void msg_sender(struct k_mbox *pmbox, s32_t timeout) mmsg.info = PUT_GET_NULL; mmsg.size = 0; mmsg.tx_data = NULL; - if (timeout == K_FOREVER) { + if (K_TIMEOUT_EQ(timeout, K_FOREVER)) { k_mbox_put(pmbox, &mmsg, K_FOREVER); - } else if (timeout == K_NO_WAIT) { + } else if (K_TIMEOUT_EQ(timeout, K_NO_WAIT)) { k_mbox_put(pmbox, &mmsg, K_NO_WAIT); } else { k_mbox_put(pmbox, &mmsg, timeout); @@ -53,7 +53,8 @@ static void msg_sender(struct k_mbox *pmbox, s32_t timeout) } } -static void msg_receiver(struct k_mbox *pmbox, k_tid_t thd_id, s32_t timeout) +static void msg_receiver(struct k_mbox *pmbox, k_tid_t thd_id, + k_timeout_t timeout) { struct k_mbox_msg mmsg; char rxdata[MAIL_LEN]; @@ -62,15 +63,15 @@ static void msg_receiver(struct k_mbox *pmbox, k_tid_t thd_id, s32_t timeout) case PUT_GET_NULL: mmsg.size = sizeof(rxdata); mmsg.rx_source_thread = thd_id; - if (timeout == K_FOREVER) { + if (K_TIMEOUT_EQ(timeout, K_FOREVER)) { zassert_true(k_mbox_get(pmbox, &mmsg, rxdata, K_FOREVER) == 0, NULL); - } else if (timeout == K_NO_WAIT) { + } else if (K_TIMEOUT_EQ(timeout, K_NO_WAIT)) { zassert_false(k_mbox_get(pmbox, &mmsg, rxdata, K_NO_WAIT) == 0, NULL); } else { zassert_true(k_mbox_get(pmbox, &mmsg, - rxdata, timeout) == 0, NULL); + rxdata, timeout) == 0, NULL); } break; default: @@ -102,7 +103,7 @@ void test_msg_receiver(void) test_send, &mbox, NULL, NULL, K_PRIO_PREEMPT(0), 0, K_NO_WAIT); - msg_receiver(&mbox, K_ANY, 2); + msg_receiver(&mbox, K_ANY, K_TIMEOUT_MS(2)); k_thread_abort(tid); } diff --git a/tests/kernel/mem_pool/mem_pool/src/main.c b/tests/kernel/mem_pool/mem_pool/src/main.c index 117914ef038ab..69699d527ea66 100644 --- a/tests/kernel/mem_pool/mem_pool/src/main.c +++ b/tests/kernel/mem_pool/mem_pool/src/main.c @@ -107,7 +107,7 @@ static int pool_block_get_func(struct k_mem_block *block, struct k_mem_pool *poo static int pool_block_get_wt_func(struct k_mem_block *block, struct k_mem_pool *pool, int size, s32_t timeout) { - return k_mem_pool_alloc(pool, block, size, timeout); + return k_mem_pool_alloc(pool, block, size, K_TIMEOUT_MS(timeout)); } /** @@ -204,7 +204,7 @@ static void test_pool_block_get_timeout(void) free_blocks(getwt_set, ARRAY_SIZE(getwt_set)); } - rv = k_mem_pool_alloc(&POOL_ID, &helper_block, 3148, 5); + rv = k_mem_pool_alloc(&POOL_ID, &helper_block, 3148, K_TIMEOUT_MS(5)); zassert_true(rv == 0, "Failed to get size 3148 byte block from POOL_ID"); @@ -213,7 +213,7 @@ static void test_pool_block_get_timeout(void) "byte block from POOL_ID"); k_sem_give(&HELPER_SEM); /* Activate helper_task */ - rv = k_mem_pool_alloc(&POOL_ID, &block, 3148, 20); + rv = k_mem_pool_alloc(&POOL_ID, &block, 3148, K_TIMEOUT_MS(20)); zassert_true(rv == 0, "Failed to get size 3148 byte block from POOL_ID"); rv = k_sem_take(®RESS_SEM, K_NO_WAIT); @@ -337,10 +337,10 @@ static void test_pool_malloc(void) } K_THREAD_DEFINE(t_alternate, STACKSIZE, alternate_task, NULL, NULL, NULL, - 6, 0, K_NO_WAIT); + 6, 0, 0); K_THREAD_DEFINE(t_helper, STACKSIZE, helper_task, NULL, NULL, NULL, - 7, 0, K_NO_WAIT); + 7, 0, 0); void test_main(void) { diff --git a/tests/kernel/mem_pool/mem_pool_api/src/test_mpool_api.c b/tests/kernel/mem_pool/mem_pool_api/src/test_mpool_api.c index 1bd002d33b25c..6676a8be21143 100644 --- a/tests/kernel/mem_pool/mem_pool_api/src/test_mpool_api.c +++ b/tests/kernel/mem_pool/mem_pool_api/src/test_mpool_api.c @@ -158,7 +158,8 @@ void test_mpool_alloc_timeout(void) K_NO_WAIT), -ENOMEM, NULL); /** TESTPOINT: @retval -EAGAIN Waiting period timed out*/ tms = k_uptime_get(); - zassert_equal(k_mem_pool_alloc(&kmpool, &fblock, BLK_SIZE_MIN, TIMEOUT), + zassert_equal(k_mem_pool_alloc(&kmpool, &fblock, BLK_SIZE_MIN, + K_TIMEOUT_MS(TIMEOUT)), -EAGAIN, NULL); /** * TESTPOINT: Maximum time to wait for operation to complete (in diff --git a/tests/kernel/mem_pool/mem_pool_concept/src/test_mpool.h b/tests/kernel/mem_pool/mem_pool_concept/src/test_mpool.h index cad8e687399a9..06b5178c2f440 100644 --- a/tests/kernel/mem_pool/mem_pool_concept/src/test_mpool.h +++ b/tests/kernel/mem_pool/mem_pool_concept/src/test_mpool.h @@ -4,7 +4,7 @@ * SPDX-License-Identifier: Apache-2.0 */ -#define TIMEOUT 2000 +#define TIMEOUT K_TIMEOUT_MS(2000) #ifdef CONFIG_RISCV #define STACK_SIZE (1024 + CONFIG_TEST_EXTRA_STACKSIZE) #else diff --git a/tests/kernel/mem_pool/mem_pool_concept/src/test_mpool_alloc_wait.c b/tests/kernel/mem_pool/mem_pool_concept/src/test_mpool_alloc_wait.c index 2b0ceb55d0f0a..387dab13d77a9 100644 --- a/tests/kernel/mem_pool/mem_pool_concept/src/test_mpool_alloc_wait.c +++ b/tests/kernel/mem_pool/mem_pool_concept/src/test_mpool_alloc_wait.c @@ -70,15 +70,15 @@ void test_mpool_alloc_wait_prio(void) /*the low-priority thread*/ tid[0] = k_thread_create(&tdata[0], tstack[0], STACK_SIZE, tmpool_alloc_wait_timeout, NULL, NULL, NULL, - K_PRIO_PREEMPT(1), 0, 0); + K_PRIO_PREEMPT(1), 0, K_NO_WAIT); /*the highest-priority thread that has waited the longest*/ tid[1] = k_thread_create(&tdata[1], tstack[1], STACK_SIZE, tmpool_alloc_wait_ok, NULL, NULL, NULL, - K_PRIO_PREEMPT(0), 0, 10); + K_PRIO_PREEMPT(0), 0, K_TIMEOUT_MS(10)); /*the highest-priority thread that has waited shorter*/ tid[2] = k_thread_create(&tdata[2], tstack[2], STACK_SIZE, tmpool_alloc_wait_timeout, NULL, NULL, NULL, - K_PRIO_PREEMPT(0), 0, 20); + K_PRIO_PREEMPT(0), 0, K_TIMEOUT_MS(20)); /*relinquish CPU for above threads to start */ k_sleep(30); /*free one block, expected to unblock thread "tid[1]"*/ diff --git a/tests/kernel/mem_pool/mem_pool_concept/src/test_mpool_merge_fail_diff_size.c b/tests/kernel/mem_pool/mem_pool_concept/src/test_mpool_merge_fail_diff_size.c index dfea2bbd7020c..6432261b625b5 100644 --- a/tests/kernel/mem_pool/mem_pool_concept/src/test_mpool_merge_fail_diff_size.c +++ b/tests/kernel/mem_pool/mem_pool_concept/src/test_mpool_merge_fail_diff_size.c @@ -5,7 +5,7 @@ */ #include -#define TIMEOUT 2000 +#define TIMEOUT K_TIMEOUT_MS(2000) #define BLK_SIZE_MIN 16 #define BLK_SIZE_MID 32 #define BLK_SIZE_MAX 256 diff --git a/tests/kernel/mem_pool/mem_pool_threadsafe/src/main.c b/tests/kernel/mem_pool/mem_pool_threadsafe/src/main.c index 0b5bbbc697bd6..894c80e9b12f2 100644 --- a/tests/kernel/mem_pool/mem_pool_threadsafe/src/main.c +++ b/tests/kernel/mem_pool/mem_pool_threadsafe/src/main.c @@ -10,7 +10,7 @@ #define STACK_SIZE (512 + CONFIG_TEST_EXTRA_STACKSIZE) #define POOL_NUM 2 #define LOOPS 10 -#define TIMEOUT 200 +#define TIMEOUT K_TIMEOUT_MS(200) #define BLK_SIZE_MIN 8 #define BLK_SIZE_MAX 32 #define BLK_NUM_MIN 8 @@ -74,7 +74,7 @@ void test_mpool_threadsafe(void) for (int i = 0; i < THREAD_NUM; i++) { tid[i] = k_thread_create(&tdata[i], tstack[i], STACK_SIZE, tmpool_api, NULL, NULL, NULL, - K_PRIO_PREEMPT(1), 0, 0); + K_PRIO_PREEMPT(1), 0, K_NO_WAIT); } /* TESTPOINT: all threads complete and exit the entry function*/ for (int i = 0; i < THREAD_NUM; i++) { diff --git a/tests/kernel/mem_protect/sys_sem/src/main.c b/tests/kernel/mem_protect/sys_sem/src/main.c index 0b4b94bf47277..3e9d0b10fc9c7 100644 --- a/tests/kernel/mem_protect/sys_sem/src/main.c +++ b/tests/kernel/mem_protect/sys_sem/src/main.c @@ -11,7 +11,7 @@ /* Macro declarations */ #define SEM_INIT_VAL (0U) #define SEM_MAX_VAL (10U) -#define SEM_TIMEOUT (K_MSEC(100)) +#define SEM_TIMEOUT K_TIMEOUT_MS(100) #define STACK_SIZE (512 + CONFIG_TEST_EXTRA_STACKSIZE) #define TOTAL_THREADS_WAITING (3) @@ -60,7 +60,7 @@ void sem_give_task(void *p1, void *p2, void *p3) void sem_take_timeout_forever_helper(void *p1, void *p2, void *p3) { - k_sleep(K_MSEC(100)); + k_sleep(100); sys_sem_give(&simple_sem); } diff --git a/tests/kernel/mem_slab/mslab/src/main.c b/tests/kernel/mem_slab/mslab/src/main.c index f3bc28cede13f..503b6313535a8 100644 --- a/tests/kernel/mem_slab/mslab/src/main.c +++ b/tests/kernel/mem_slab/mslab/src/main.c @@ -243,13 +243,13 @@ void test_mslab(void) TC_PRINT("(3) - Further allocation results in timeout " "in <%s>\n", __func__); - ret_value = k_mem_slab_alloc(&map_lgblks, &b, 20); + ret_value = k_mem_slab_alloc(&map_lgblks, &b, K_TIMEOUT_MS(20)); zassert_equal(-EAGAIN, ret_value, "Failed k_mem_slab_alloc, retValue %d\n", ret_value); TC_PRINT("%s: start to wait for block\n", __func__); k_sem_give(&SEM_REGRESSDONE); /* Allow helper thread to run part 4 */ - ret_value = k_mem_slab_alloc(&map_lgblks, &b, 50); + ret_value = k_mem_slab_alloc(&map_lgblks, &b, K_TIMEOUT_MS(50)); zassert_equal(0, ret_value, "Failed k_mem_slab_alloc, ret_value %d\n", ret_value); @@ -275,7 +275,7 @@ void test_mslab(void) } K_THREAD_DEFINE(HELPER, STACKSIZE, helper_thread, NULL, NULL, NULL, - 7, 0, K_NO_WAIT); + 7, 0, 0); /*test case main entry*/ void test_main(void) diff --git a/tests/kernel/mem_slab/mslab_api/src/test_mslab.h b/tests/kernel/mem_slab/mslab_api/src/test_mslab.h index e400c2c570296..a359db3c92d32 100644 --- a/tests/kernel/mem_slab/mslab_api/src/test_mslab.h +++ b/tests/kernel/mem_slab/mslab_api/src/test_mslab.h @@ -7,7 +7,7 @@ #ifndef __TEST_MSLAB_H__ #define __TEST_MSLAB_H__ -#define TIMEOUT 2000 +#define TIMEOUT K_TIMEOUT_MS(2000) #define BLK_NUM 3 #define BLK_ALIGN 8 #define BLK_SIZE 16 diff --git a/tests/kernel/mem_slab/mslab_api/src/test_mslab_api.c b/tests/kernel/mem_slab/mslab_api/src/test_mslab_api.c index e2bc267f26977..3ca05237423a2 100644 --- a/tests/kernel/mem_slab/mslab_api/src/test_mslab_api.c +++ b/tests/kernel/mem_slab/mslab_api/src/test_mslab_api.c @@ -81,7 +81,7 @@ static void tmslab_alloc_timeout(void *data) * TESTPOINT: timeout Maximum time to wait for operation to * complete (in milliseconds) */ - zassert_true(k_uptime_delta(&tms) >= TIMEOUT, NULL); + zassert_true(k_uptime_delta(&tms) >= K_TIMEOUT_GET(TIMEOUT), NULL); for (int i = 0; i < BLK_NUM; i++) { k_mem_slab_free(pslab, &block[i]); diff --git a/tests/kernel/mem_slab/mslab_concept/src/test_mslab.h b/tests/kernel/mem_slab/mslab_concept/src/test_mslab.h index 9b5cc26146cb3..9f4317edaf196 100644 --- a/tests/kernel/mem_slab/mslab_concept/src/test_mslab.h +++ b/tests/kernel/mem_slab/mslab_concept/src/test_mslab.h @@ -7,7 +7,7 @@ #ifndef __TEST_MSLAB_H__ #define __TEST_MSLAB_H__ -#define TIMEOUT 2000 +#define TIMEOUT K_TIMEOUT_MS(2000) #define BLK_NUM 3 #define BLK_ALIGN 8 #define BLK_SIZE 16 diff --git a/tests/kernel/mem_slab/mslab_concept/src/test_mslab_alloc_wait.c b/tests/kernel/mem_slab/mslab_concept/src/test_mslab_alloc_wait.c index cf278f9ffc6f1..2008351f201c5 100644 --- a/tests/kernel/mem_slab/mslab_concept/src/test_mslab_alloc_wait.c +++ b/tests/kernel/mem_slab/mslab_concept/src/test_mslab_alloc_wait.c @@ -72,15 +72,15 @@ void test_mslab_alloc_wait_prio(void) /*the low-priority thread*/ tid[0] = k_thread_create(&tdata[0], tstack[0], STACK_SIZE, tmslab_alloc_wait_timeout, NULL, NULL, NULL, - K_PRIO_PREEMPT(1), 0, 0); + K_PRIO_PREEMPT(1), 0, K_NO_WAIT); /*the highest-priority thread that has waited the longest*/ tid[1] = k_thread_create(&tdata[1], tstack[1], STACK_SIZE, tmslab_alloc_wait_ok, NULL, NULL, NULL, - K_PRIO_PREEMPT(0), 0, 10); + K_PRIO_PREEMPT(0), 0, K_TIMEOUT_MS(10)); /*the highest-priority thread that has waited shorter*/ tid[2] = k_thread_create(&tdata[2], tstack[2], STACK_SIZE, tmslab_alloc_wait_timeout, NULL, NULL, NULL, - K_PRIO_PREEMPT(0), 0, 20); + K_PRIO_PREEMPT(0), 0, K_TIMEOUT_MS(20)); /*relinquish CPU for above threads to start */ k_sleep(30); /*free one block, expected to unblock thread "tid[1]"*/ diff --git a/tests/kernel/mem_slab/mslab_threadsafe/src/test_mslab_threadsafe.c b/tests/kernel/mem_slab/mslab_threadsafe/src/test_mslab_threadsafe.c index 2145413d689a8..a26fd79cb4e47 100644 --- a/tests/kernel/mem_slab/mslab_threadsafe/src/test_mslab_threadsafe.c +++ b/tests/kernel/mem_slab/mslab_threadsafe/src/test_mslab_threadsafe.c @@ -10,7 +10,7 @@ #define STACK_SIZE (512 + CONFIG_TEST_EXTRA_STACKSIZE) #define THREAD_NUM 4 #define SLAB_NUM 2 -#define TIMEOUT 200 +#define TIMEOUT K_TIMEOUT_MS(200) #define BLK_NUM 3 #define BLK_ALIGN 8 #define BLK_SIZE1 16 @@ -81,7 +81,7 @@ void test_mslab_threadsafe(void) for (int i = 0; i < THREAD_NUM; i++) { tid[i] = k_thread_create(&tdata[i], tstack[i], STACK_SIZE, tmslab_api, NULL, NULL, NULL, - K_PRIO_PREEMPT(1), 0, 0); + K_PRIO_PREEMPT(1), 0, K_NO_WAIT); } /* TESTPOINT: all threads complete and exit the entry function*/ for (int i = 0; i < THREAD_NUM; i++) { diff --git a/tests/kernel/msgq/msgq_api/src/test_msgq.h b/tests/kernel/msgq/msgq_api/src/test_msgq.h index 8d11dfbe2e00a..5b5c2a6ae4094 100644 --- a/tests/kernel/msgq/msgq_api/src/test_msgq.h +++ b/tests/kernel/msgq/msgq_api/src/test_msgq.h @@ -12,7 +12,7 @@ #include #include -#define TIMEOUT 100 +#define TIMEOUT K_TIMEOUT_MS(100) #define STACK_SIZE (512 + CONFIG_TEST_EXTRA_STACKSIZE) #define MSG_SIZE 4 #define MSGQ_LEN 2 diff --git a/tests/kernel/msgq/msgq_api/src/test_msgq_contexts.c b/tests/kernel/msgq/msgq_api/src/test_msgq_contexts.c index 8362e1d6f61a4..2f4a341382d7c 100644 --- a/tests/kernel/msgq/msgq_api/src/test_msgq_contexts.c +++ b/tests/kernel/msgq/msgq_api/src/test_msgq_contexts.c @@ -96,7 +96,7 @@ static void msgq_thread(struct k_msgq *pmsgq) k_tid_t tid = k_thread_create(&tdata, tstack, STACK_SIZE, thread_entry, pmsgq, NULL, NULL, K_PRIO_PREEMPT(0), - K_USER | K_INHERIT_PERMS, 0); + K_USER | K_INHERIT_PERMS, K_NO_WAIT); put_msgq(pmsgq); k_sem_take(&end_sema, K_FOREVER); k_thread_abort(tid); @@ -134,7 +134,7 @@ static void msgq_thread_overflow(struct k_msgq *pmsgq) k_tid_t tid = k_thread_create(&tdata, tstack, STACK_SIZE, thread_entry_overflow, pmsgq, NULL, NULL, K_PRIO_PREEMPT(0), - K_USER | K_INHERIT_PERMS, 0); + K_USER | K_INHERIT_PERMS, K_NO_WAIT); ret = k_msgq_put(pmsgq, (void *)&data[1], K_FOREVER); @@ -184,11 +184,11 @@ static void msgq_thread_data_passing(struct k_msgq *pmsgq) k_tid_t tid = k_thread_create(&tdata2, tstack2, STACK_SIZE, pend_thread_entry, pmsgq, NULL, - NULL, K_PRIO_PREEMPT(0), 0, 0); + NULL, K_PRIO_PREEMPT(0), 0, K_NO_WAIT); k_tid_t tid1 = k_thread_create(&tdata1, tstack1, STACK_SIZE, thread_entry_get_data, pmsgq, NULL, - NULL, K_PRIO_PREEMPT(1), 0, 0); + NULL, K_PRIO_PREEMPT(1), 0, K_NO_WAIT); k_sem_take(&end_sema, K_FOREVER); k_thread_abort(tid); diff --git a/tests/kernel/msgq/msgq_api/src/test_msgq_purge.c b/tests/kernel/msgq/msgq_api/src/test_msgq_purge.c index 6de6bfc4f450f..444c0b032fd46 100644 --- a/tests/kernel/msgq/msgq_api/src/test_msgq_purge.c +++ b/tests/kernel/msgq/msgq_api/src/test_msgq_purge.c @@ -31,8 +31,8 @@ static void purge_when_put(struct k_msgq *q) /*create another thread waiting to put msg*/ k_thread_create(&tdata, tstack, STACK_SIZE, tThread_entry, q, NULL, NULL, - K_PRIO_PREEMPT(0), K_USER | K_INHERIT_PERMS, 0); - k_sleep(TIMEOUT >> 1); + K_PRIO_PREEMPT(0), K_USER | K_INHERIT_PERMS, K_NO_WAIT); + k_sleep(K_TIMEOUT_GET(TIMEOUT) >> 1); /**TESTPOINT: msgq purge while another thread waiting to put msg*/ k_msgq_purge(q); diff --git a/tests/kernel/mutex/mutex_api/src/test_mutex_apis.c b/tests/kernel/mutex/mutex_api/src/test_mutex_apis.c index f344995b46a00..00813b76a60fd 100644 --- a/tests/kernel/mutex/mutex_api/src/test_mutex_apis.c +++ b/tests/kernel/mutex/mutex_api/src/test_mutex_apis.c @@ -30,13 +30,15 @@ static void tThread_entry_lock_no_wait(void *p1, void *p2, void *p3) static void tThread_entry_lock_timeout_fail(void *p1, void *p2, void *p3) { - zassert_true(k_mutex_lock((struct k_mutex *)p1, TIMEOUT - 100) != 0, NULL); + zassert_true(k_mutex_lock((struct k_mutex *)p1, + K_TIMEOUT_MS(TIMEOUT - 100)) != 0, NULL); TC_PRINT("bypass locked resource from spawn thread\n"); } static void tThread_entry_lock_timeout_pass(void *p1, void *p2, void *p3) { - zassert_true(k_mutex_lock((struct k_mutex *)p1, TIMEOUT + 100) == 0, NULL); + zassert_true(k_mutex_lock((struct k_mutex *)p1, + K_TIMEOUT_MS(TIMEOUT + 100)) == 0, NULL); TC_PRINT("access resource from spawn thread\n"); k_mutex_unlock((struct k_mutex *)p1); } @@ -48,7 +50,7 @@ static void tmutex_test_lock(struct k_mutex *pmutex, k_thread_create(&tdata, tstack, STACK_SIZE, entry_fn, pmutex, NULL, NULL, K_PRIO_PREEMPT(0), - K_USER | K_INHERIT_PERMS, 0); + K_USER | K_INHERIT_PERMS, K_NO_WAIT); k_mutex_lock(pmutex, K_FOREVER); TC_PRINT("access resource from main thread\n"); @@ -64,7 +66,7 @@ static void tmutex_test_lock_timeout(struct k_mutex *pmutex, k_thread_create(&tdata, tstack, STACK_SIZE, entry_fn, pmutex, NULL, NULL, K_PRIO_PREEMPT(0), - K_USER | K_INHERIT_PERMS, 0); + K_USER | K_INHERIT_PERMS, K_NO_WAIT); k_mutex_lock(pmutex, K_FOREVER); TC_PRINT("access resource from main thread\n"); @@ -84,7 +86,7 @@ static void tmutex_test_lock_unlock(struct k_mutex *pmutex) zassert_true(k_mutex_lock(pmutex, K_NO_WAIT) == 0, "fail to lock K_NO_WAIT"); k_mutex_unlock(pmutex); - zassert_true(k_mutex_lock(pmutex, TIMEOUT) == 0, + zassert_true(k_mutex_lock(pmutex, K_TIMEOUT_MS(TIMEOUT)) == 0, "fail to lock TIMEOUT"); k_mutex_unlock(pmutex); } diff --git a/tests/kernel/mutex/sys_mutex/src/main.c b/tests/kernel/mutex/sys_mutex/src/main.c index e35876849068c..1bd2f96b02103 100644 --- a/tests/kernel/mutex/sys_mutex/src/main.c +++ b/tests/kernel/mutex/sys_mutex/src/main.c @@ -79,10 +79,10 @@ void thread_05(void) { int rv; - k_sleep(K_MSEC(3500)); + k_sleep(3500); /* Wait and boost owner priority to 5 */ - rv = sys_mutex_lock(&mutex_4, K_SECONDS(1)); + rv = sys_mutex_lock(&mutex_4, K_TIMEOUT_MS(1000)); if (rv != -EAGAIN) { tc_rc = TC_FAIL; TC_ERROR("Failed to timeout on mutex %p\n", &mutex_4); @@ -102,7 +102,7 @@ void thread_06(void) { int rv; - k_sleep(K_MSEC(3750)); + k_sleep(3750); /* * Wait for the mutex. There is a higher priority level thread waiting @@ -113,7 +113,7 @@ void thread_06(void) * drop back to 7, but will instead drop to 6. */ - rv = sys_mutex_lock(&mutex_4, K_SECONDS(2)); + rv = sys_mutex_lock(&mutex_4, K_TIMEOUT_MS(2000)); if (rv != 0) { tc_rc = TC_FAIL; TC_ERROR("Failed to take mutex %p\n", &mutex_4); @@ -134,7 +134,7 @@ void thread_07(void) { int rv; - k_sleep(K_MSEC(2500)); + k_sleep(2500); /* * Wait and boost owner priority to 7. While waiting, another thread of @@ -144,7 +144,7 @@ void thread_07(void) * priority of the owning main thread will drop to 8. */ - rv = sys_mutex_lock(&mutex_3, K_SECONDS(3)); + rv = sys_mutex_lock(&mutex_3, K_TIMEOUT_MS(3000)); if (rv != -EAGAIN) { tc_rc = TC_FAIL; TC_ERROR("Failed to timeout on mutex %p\n", &mutex_3); @@ -164,7 +164,7 @@ void thread_08(void) { int rv; - k_sleep(K_MSEC(1500)); + k_sleep(1500); /* Wait and boost owner priority to 8 */ rv = sys_mutex_lock(&mutex_2, K_FOREVER); @@ -188,7 +188,7 @@ void thread_09(void) { int rv; - k_sleep(K_MSEC(500)); /* Allow lower priority thread to run */ + k_sleep(500); /* Allow lower priority thread to run */ /* is already locked. */ rv = sys_mutex_lock(&mutex_1, K_NO_WAIT); @@ -221,7 +221,7 @@ void thread_11(void) { int rv; - k_sleep(K_MSEC(3500)); + k_sleep(3500); rv = sys_mutex_lock(&mutex_3, K_FOREVER); if (rv != 0) { tc_rc = TC_FAIL; @@ -282,7 +282,7 @@ void test_mutex(void) for (i = 0; i < 4; i++) { rv = sys_mutex_lock(mutexes[i], K_NO_WAIT); zassert_equal(rv, 0, "Failed to lock mutex %p\n", mutexes[i]); - k_sleep(K_SECONDS(1)); + k_sleep(1000); rv = k_thread_priority_get(k_current_get()); zassert_equal(rv, priority[i], "expected priority %d, not %d\n", @@ -297,7 +297,7 @@ void test_mutex(void) TC_PRINT("Done LOCKING! Current priority = %d\n", k_thread_priority_get(k_current_get())); - k_sleep(K_SECONDS(1)); /* thread_05 should time out */ + k_sleep(1000); /* thread_05 should time out */ /* ~ 5 seconds have passed */ @@ -311,7 +311,7 @@ void test_mutex(void) zassert_equal(rv, 7, "Gave %s and priority should drop.\n", "mutex_4"); zassert_equal(rv, 7, "Expected priority %d, not %d\n", 7, rv); - k_sleep(K_SECONDS(1)); /* thread_07 should time out */ + k_sleep(1000); /* thread_07 should time out */ /* ~ 6 seconds have passed */ @@ -327,7 +327,7 @@ void test_mutex(void) rv = k_thread_priority_get(k_current_get()); zassert_equal(rv, 10, "Expected priority %d, not %d\n", 10, rv); - k_sleep(K_SECONDS(1)); /* Give thread_11 time to run */ + k_sleep(1000); /* Give thread_11 time to run */ zassert_equal(tc_rc, TC_PASS, NULL); @@ -353,7 +353,7 @@ void test_mutex(void) rv = sys_mutex_lock(&private_mutex, K_NO_WAIT); zassert_equal(rv, -EBUSY, "Unexpectedly got lock on private mutex"); - rv = sys_mutex_lock(&private_mutex, K_SECONDS(1)); + rv = sys_mutex_lock(&private_mutex, K_TIMEOUT_MS(1000)); zassert_equal(rv, 0, "Failed to re-obtain lock on private mutex"); sys_mutex_unlock(&private_mutex); @@ -398,22 +398,22 @@ void test_user_access(void) } K_THREAD_DEFINE(THREAD_05, STACKSIZE, thread_05, NULL, NULL, NULL, - 5, K_USER, K_NO_WAIT); + 5, K_USER, 0); K_THREAD_DEFINE(THREAD_06, STACKSIZE, thread_06, NULL, NULL, NULL, - 6, K_USER, K_NO_WAIT); + 6, K_USER, 0); K_THREAD_DEFINE(THREAD_07, STACKSIZE, thread_07, NULL, NULL, NULL, - 7, K_USER, K_NO_WAIT); + 7, K_USER, 0); K_THREAD_DEFINE(THREAD_08, STACKSIZE, thread_08, NULL, NULL, NULL, - 8, K_USER, K_NO_WAIT); + 8, K_USER, 0); K_THREAD_DEFINE(THREAD_09, STACKSIZE, thread_09, NULL, NULL, NULL, - 9, K_USER, K_NO_WAIT); + 9, K_USER, 0); K_THREAD_DEFINE(THREAD_11, STACKSIZE, thread_11, NULL, NULL, NULL, - 11, K_USER, K_NO_WAIT); + 11, K_USER, 0); /*test case main entry*/ void test_main(void) diff --git a/tests/kernel/mutex/sys_mutex/src/thread_12.c b/tests/kernel/mutex/sys_mutex/src/thread_12.c index 184352acf5fad..991626f8bd8a4 100644 --- a/tests/kernel/mutex/sys_mutex/src/thread_12.c +++ b/tests/kernel/mutex/sys_mutex/src/thread_12.c @@ -45,7 +45,7 @@ void thread_12(void) /* Wait a bit, then release the mutex */ - k_sleep(K_MSEC(500)); + k_sleep(500); sys_mutex_unlock(&private_mutex); } diff --git a/tests/kernel/obj_tracing/src/main.c b/tests/kernel/obj_tracing/src/main.c index 9311371f72123..66372f7272768 100644 --- a/tests/kernel/obj_tracing/src/main.c +++ b/tests/kernel/obj_tracing/src/main.c @@ -95,7 +95,7 @@ static void object_monitor(void) void *obj_list = NULL; - k_sem_take(&f3, 0); + k_sem_take(&f3, K_NO_WAIT); /* ztest use one semaphore so use one count less than expected to pass * test */ diff --git a/tests/kernel/pending/src/main.c b/tests/kernel/pending/src/main.c index d091394138dff..724d0eb4840d1 100644 --- a/tests/kernel/pending/src/main.c +++ b/tests/kernel/pending/src/main.c @@ -124,7 +124,7 @@ static void fifo_tests(s32_t timeout, volatile int *state, *state = FIFO_TEST_START; /* Expect this to time out */ - data = get(&fifo, timeout); + data = get(&fifo, K_TIMEOUT_MS(timeout)); if (data != NULL) { TC_ERROR("**** Unexpected data on FIFO get\n"); return; @@ -136,7 +136,7 @@ static void fifo_tests(s32_t timeout, volatile int *state, /* Expect this to receive data from the fifo */ *state = FIFO_TEST_END; - data = get(&fifo, timeout); + data = get(&fifo, K_TIMEOUT_MS(timeout)); if (data == NULL) { TC_ERROR("**** No data on FIFO get\n"); return; @@ -162,7 +162,7 @@ static void lifo_tests(s32_t timeout, volatile int *state, *state = LIFO_TEST_START; /* Expect this to time out */ - data = get(&lifo, timeout); + data = get(&lifo, K_TIMEOUT_MS(timeout)); if (data != NULL) { TC_ERROR("**** Unexpected data on LIFO get\n"); return; @@ -174,7 +174,7 @@ static void lifo_tests(s32_t timeout, volatile int *state, /* Expect this to receive data from the lifo */ *state = LIFO_TEST_END; - data = get(&lifo, timeout); + data = get(&lifo, K_TIMEOUT_MS(timeout)); if (data == NULL) { TC_ERROR("**** No data on LIFO get\n"); return; @@ -196,7 +196,7 @@ static void timer_tests(void) timer_start_tick = k_uptime_get_32(); - k_timer_start(&timer, NUM_SECONDS(1), 0); + k_timer_start(&timer, K_TIMEOUT_MS(1000), K_NO_WAIT); if (k_timer_status_sync(&timer)) { timer_data = timer.user_data; @@ -249,10 +249,12 @@ void task_high(void) counter = SEM_TEST_START; k_thread_create(&coop_thread[0], coop_stack[0], COOP_STACKSIZE, - coop_high, NULL, NULL, NULL, K_PRIO_COOP(3), 0, 0); + coop_high, NULL, NULL, NULL, K_PRIO_COOP(3), 0, + K_NO_WAIT); k_thread_create(&coop_thread[1], coop_stack[1], COOP_STACKSIZE, - coop_low, NULL, NULL, NULL, K_PRIO_COOP(7), 0, 0); + coop_low, NULL, NULL, NULL, K_PRIO_COOP(7), 0, + K_NO_WAIT); counter = FIFO_TEST_START; fifo_tests(THIRD_SECOND, &task_high_state, my_fifo_get, k_sem_take); @@ -443,8 +445,8 @@ void test_main(void) } K_THREAD_DEFINE(TASK_LOW, PREEM_STACKSIZE, task_low, NULL, NULL, NULL, - 7, 0, K_NO_WAIT); + 7, 0, 0); K_THREAD_DEFINE(TASK_HIGH, PREEM_STACKSIZE, task_high, NULL, NULL, NULL, - 5, 0, K_NO_WAIT); + 5, 0, 0); diff --git a/tests/kernel/pipe/pipe/src/test_pipe.c b/tests/kernel/pipe/pipe/src/test_pipe.c index 1b9efe7bca773..6eceb8598920b 100644 --- a/tests/kernel/pipe/pipe/src/test_pipe.c +++ b/tests/kernel/pipe/pipe/src/test_pipe.c @@ -701,7 +701,7 @@ void test_pipe_on_single_elements(void) k_thread_create(&get_single_tid, stack_1, STACK_SIZE, pipe_get_single, NULL, NULL, NULL, - K_PRIO_PREEMPT(0), K_INHERIT_PERMS | K_USER, 0); + K_PRIO_PREEMPT(0), K_INHERIT_PERMS | K_USER, K_NO_WAIT); pipe_put_single(); k_sem_take(&sync_sem, K_FOREVER); @@ -718,7 +718,7 @@ void test_pipe_on_multiple_elements(void) { k_thread_create(&get_single_tid, stack_1, STACK_SIZE, pipe_get_multiple, NULL, NULL, NULL, - K_PRIO_PREEMPT(0), K_INHERIT_PERMS | K_USER, 0); + K_PRIO_PREEMPT(0), K_INHERIT_PERMS | K_USER, K_NO_WAIT); pipe_put_multiple(); k_sem_take(&sync_sem, K_FOREVER); @@ -735,7 +735,7 @@ void test_pipe_forever_wait(void) { k_thread_create(&get_single_tid, stack_1, STACK_SIZE, pipe_get_forever_wait, NULL, NULL, NULL, - K_PRIO_PREEMPT(0), K_INHERIT_PERMS | K_USER, 0); + K_PRIO_PREEMPT(0), K_INHERIT_PERMS | K_USER, K_NO_WAIT); pipe_put_forever_wait(); k_sem_take(&sync_sem, K_FOREVER); @@ -752,7 +752,7 @@ void test_pipe_timeout(void) { k_thread_create(&get_single_tid, stack_1, STACK_SIZE, pipe_get_timeout, NULL, NULL, NULL, - K_PRIO_PREEMPT(0), K_INHERIT_PERMS | K_USER, 0); + K_PRIO_PREEMPT(0), K_INHERIT_PERMS | K_USER, K_NO_WAIT); pipe_put_timeout(); k_sem_take(&sync_sem, K_FOREVER); @@ -784,7 +784,7 @@ void test_pipe_forever_timeout(void) k_thread_create(&get_single_tid, stack_1, STACK_SIZE, pipe_get_forever_timeout, NULL, NULL, NULL, - K_PRIO_PREEMPT(0), K_INHERIT_PERMS | K_USER, 0); + K_PRIO_PREEMPT(0), K_INHERIT_PERMS | K_USER, K_NO_WAIT); pipe_put_forever_timeout(); k_sem_take(&sync_sem, K_FOREVER); diff --git a/tests/kernel/pipe/pipe_api/src/test_pipe_contexts.c b/tests/kernel/pipe/pipe_api/src/test_pipe_contexts.c index 0d1cb0f5bd6a2..d643ed5603498 100644 --- a/tests/kernel/pipe/pipe_api/src/test_pipe_contexts.c +++ b/tests/kernel/pipe/pipe_api/src/test_pipe_contexts.c @@ -34,7 +34,7 @@ K_SEM_DEFINE(end_sema, 0, 1); */ K_MEM_POOL_DEFINE(test_pool, 128, 128, 4, 4); -static void tpipe_put(struct k_pipe *ppipe, int timeout) +static void tpipe_put(struct k_pipe *ppipe, k_timeout_t timeout) { size_t to_wt, wt_byte = 0; @@ -49,14 +49,15 @@ static void tpipe_put(struct k_pipe *ppipe, int timeout) } static void tpipe_block_put(struct k_pipe *ppipe, struct k_sem *sema, - int timeout) + k_timeout_t timeout) { struct k_mem_block block; for (int i = 0; i < PIPE_LEN; i += BYTES_TO_WRITE) { /**TESTPOINT: pipe block put*/ zassert_equal(k_mem_pool_alloc(&mpool, &block, BYTES_TO_WRITE, - timeout), 0, NULL); + timeout), + 0, NULL); memcpy(block.data, &data[i], BYTES_TO_WRITE); k_pipe_block_put(ppipe, &block, BYTES_TO_WRITE, sema); if (sema) { @@ -66,7 +67,7 @@ static void tpipe_block_put(struct k_pipe *ppipe, struct k_sem *sema, } } -static void tpipe_get(struct k_pipe *ppipe, int timeout) +static void tpipe_get(struct k_pipe *ppipe, k_timeout_t timeout) { unsigned char rx_data[PIPE_LEN]; size_t to_rd, rd_byte = 0; @@ -106,7 +107,7 @@ static void tpipe_thread_thread(struct k_pipe *ppipe) k_tid_t tid = k_thread_create(&tdata, tstack, STACK_SIZE, tThread_entry, ppipe, NULL, NULL, K_PRIO_PREEMPT(0), - K_INHERIT_PERMS | K_USER, 0); + K_INHERIT_PERMS | K_USER, K_NO_WAIT); tpipe_put(ppipe, K_NO_WAIT); k_sem_take(&end_sema, K_FOREVER); @@ -123,7 +124,7 @@ static void tpipe_kthread_to_kthread(struct k_pipe *ppipe) /**TESTPOINT: thread-thread data passing via pipe*/ k_tid_t tid = k_thread_create(&tdata, tstack, STACK_SIZE, tThread_entry, ppipe, NULL, NULL, - K_PRIO_PREEMPT(0), 0, 0); + K_PRIO_PREEMPT(0), 0, K_NO_WAIT); tpipe_put(ppipe, K_NO_WAIT); k_sem_take(&end_sema, K_FOREVER); @@ -210,7 +211,7 @@ void test_pipe_block_put(void) /**TESTPOINT: test k_pipe_block_put without semaphore*/ k_tid_t tid = k_thread_create(&tdata, tstack, STACK_SIZE, tThread_block_put, &kpipe, NULL, NULL, - K_PRIO_PREEMPT(0), 0, 0); + K_PRIO_PREEMPT(0), 0, K_NO_WAIT); k_sleep(10); tpipe_get(&kpipe, K_FOREVER); @@ -231,7 +232,7 @@ void test_pipe_block_put_sema(void) /**TESTPOINT: test k_pipe_block_put with semaphore*/ k_tid_t tid = k_thread_create(&tdata, tstack, STACK_SIZE, tThread_block_put, &pipe, &sync_sema, - NULL, K_PRIO_PREEMPT(0), 0, 0); + NULL, K_PRIO_PREEMPT(0), 0, K_NO_WAIT); k_sleep(10); tpipe_get(&pipe, K_FOREVER); k_sem_take(&end_sema, K_FOREVER); @@ -248,7 +249,7 @@ void test_pipe_get_put(void) /**TESTPOINT: test API sequence: [get, put]*/ k_tid_t tid = k_thread_create(&tdata, tstack, STACK_SIZE, tThread_block_put, &kpipe, NULL, NULL, - K_PRIO_PREEMPT(0), 0, 0); + K_PRIO_PREEMPT(0), 0, K_NO_WAIT); /*get will be executed previous to put*/ tpipe_get(&kpipe, K_FOREVER); @@ -291,7 +292,7 @@ void test_half_pipe_get_put(void) k_tid_t tid = k_thread_create(&tdata, tstack, STACK_SIZE, tThread_half_pipe_put, &khalfpipe, NULL, NULL, K_PRIO_PREEMPT(0), - K_INHERIT_PERMS | K_USER, 0); + K_INHERIT_PERMS | K_USER, K_NO_WAIT); tpipe_get(&khalfpipe, K_FOREVER); @@ -313,7 +314,7 @@ void test_half_pipe_block_put_sema(void) k_tid_t tid = k_thread_create(&tdata, tstack, STACK_SIZE, tThread_half_pipe_block_put, &khalfpipe, &sync_sema, NULL, - K_PRIO_PREEMPT(0), 0, 0); + K_PRIO_PREEMPT(0), 0, K_NO_WAIT); k_sleep(10); tpipe_get(&khalfpipe, K_FOREVER); @@ -352,7 +353,7 @@ void test_pipe_reader_wait(void) /**TESTPOINT: test k_pipe_block_put with semaphore*/ k_tid_t tid = k_thread_create(&tdata, tstack, STACK_SIZE, thread_handler, &kpipe1, NULL, NULL, - K_PRIO_PREEMPT(0), 0, 0); + K_PRIO_PREEMPT(0), 0, K_NO_WAIT); tpipe_get(&kpipe1, K_FOREVER); k_sem_take(&end_sema, K_FOREVER); @@ -381,12 +382,12 @@ void test_pipe_block_writer_wait(void) k_tid_t tid = k_thread_create(&tdata, tstack, STACK_SIZE, thread_for_block_put, &kpipe1, &s_sema, NULL, K_PRIO_PREEMPT(main_low_prio - 1), - 0, 0); + 0, K_NO_WAIT); k_tid_t tid1 = k_thread_create(&tdata1, tstack1, STACK_SIZE, thread_for_block_put, &kpipe1, &s_sema1, NULL, K_PRIO_PREEMPT(main_low_prio - 1), - 0, 0); + 0, K_NO_WAIT); tpipe_get(&kpipe1, K_FOREVER); k_thread_priority_set(k_current_get(), old_prio); diff --git a/tests/kernel/pipe/pipe_api/src/test_pipe_fail.c b/tests/kernel/pipe/pipe_api/src/test_pipe_fail.c index ce4f0628ce1b1..72326548d17be 100644 --- a/tests/kernel/pipe/pipe_api/src/test_pipe_fail.c +++ b/tests/kernel/pipe/pipe_api/src/test_pipe_fail.c @@ -7,7 +7,7 @@ #include -#define TIMEOUT 100 +#define TIMEOUT K_TIMEOUT_MS(100) #define PIPE_LEN 8 static ZTEST_DMEM unsigned char __aligned(4) data[] = "abcd1234"; diff --git a/tests/kernel/poll/src/test_poll.c b/tests/kernel/poll/src/test_poll.c index fb26d306c6c05..2eebdb5f79d69 100644 --- a/tests/kernel/poll/src/test_poll.c +++ b/tests/kernel/poll/src/test_poll.c @@ -78,16 +78,17 @@ void test_poll_no_wait(void) * implementation */ - zassert_equal(k_poll(events, 0, 0), -EINVAL, NULL); - zassert_equal(k_poll(events, INT_MAX, 0), -EINVAL, NULL); - zassert_equal(k_poll(events, 4096, 0), -ENOMEM, NULL); + zassert_equal(k_poll(events, 0, K_NO_WAIT), -EINVAL, NULL); + zassert_equal(k_poll(events, INT_MAX, K_NO_WAIT), -EINVAL, NULL); + zassert_equal(k_poll(events, 4096, K_NO_WAIT), -ENOMEM, NULL); struct k_poll_event bad_events[] = { K_POLL_EVENT_INITIALIZER(K_POLL_TYPE_SEM_AVAILABLE, K_POLL_NUM_MODES, &no_wait_sem), }; - zassert_equal(k_poll(bad_events, ARRAY_SIZE(bad_events), 0), -EINVAL, + zassert_equal(k_poll(bad_events, ARRAY_SIZE(bad_events), K_NO_WAIT), + -EINVAL, NULL); struct k_poll_event bad_events2[] = { @@ -95,7 +96,8 @@ void test_poll_no_wait(void) K_POLL_MODE_NOTIFY_ONLY, &no_wait_sem), }; - zassert_equal(k_poll(bad_events2, ARRAY_SIZE(bad_events), 0), -EINVAL, + zassert_equal(k_poll(bad_events2, ARRAY_SIZE(bad_events), K_NO_WAIT), + -EINVAL, NULL); #endif /* CONFIG_USERSPACE */ @@ -103,13 +105,13 @@ void test_poll_no_wait(void) zassert_false(k_fifo_alloc_put(&no_wait_fifo, &msg), NULL); k_poll_signal_raise(&no_wait_signal, SIGNAL_RESULT); - zassert_equal(k_poll(events, ARRAY_SIZE(events), 0), 0, ""); + zassert_equal(k_poll(events, ARRAY_SIZE(events), K_NO_WAIT), 0, ""); zassert_equal(events[0].state, K_POLL_STATE_SEM_AVAILABLE, ""); - zassert_equal(k_sem_take(&no_wait_sem, 0), 0, ""); + zassert_equal(k_sem_take(&no_wait_sem, K_NO_WAIT), 0, ""); zassert_equal(events[1].state, K_POLL_STATE_FIFO_DATA_AVAILABLE, ""); - msg_ptr = k_fifo_get(&no_wait_fifo, 0); + msg_ptr = k_fifo_get(&no_wait_fifo, K_NO_WAIT); zassert_not_null(msg_ptr, ""); zassert_equal(msg_ptr, &msg, ""); zassert_equal(msg_ptr->msg, FIFO_MSG_VALUE, ""); @@ -128,14 +130,15 @@ void test_poll_no_wait(void) events[3].state = K_POLL_STATE_NOT_READY; k_poll_signal_reset(&no_wait_signal); - zassert_equal(k_poll(events, ARRAY_SIZE(events), 0), -EAGAIN, ""); + zassert_equal(k_poll(events, ARRAY_SIZE(events), K_NO_WAIT), + -EAGAIN, ""); zassert_equal(events[0].state, K_POLL_STATE_NOT_READY, ""); zassert_equal(events[1].state, K_POLL_STATE_NOT_READY, ""); zassert_equal(events[2].state, K_POLL_STATE_NOT_READY, ""); zassert_equal(events[3].state, K_POLL_STATE_NOT_READY, ""); - zassert_not_equal(k_sem_take(&no_wait_sem, 0), 0, ""); - zassert_is_null(k_fifo_get(&no_wait_fifo, 0), ""); + zassert_not_equal(k_sem_take(&no_wait_sem, K_NO_WAIT), 0, ""); + zassert_is_null(k_fifo_get(&no_wait_fifo, K_NO_WAIT), ""); } /* verify k_poll() that has to wait */ @@ -207,7 +210,7 @@ void test_poll_wait(void) k_thread_create(&test_thread, test_stack, K_THREAD_STACK_SIZEOF(test_stack), poll_wait_helper, (void *)1, 0, 0, - main_low_prio - 1, K_USER | K_INHERIT_PERMS, 0); + main_low_prio - 1, K_USER | K_INHERIT_PERMS, K_NO_WAIT); rc = k_poll(wait_events, ARRAY_SIZE(wait_events), K_SECONDS(1)); @@ -216,12 +219,12 @@ void test_poll_wait(void) zassert_equal(rc, 0, ""); zassert_equal(wait_events[0].state, K_POLL_STATE_SEM_AVAILABLE, ""); - zassert_equal(k_sem_take(&wait_sem, 0), 0, ""); + zassert_equal(k_sem_take(&wait_sem, K_NO_WAIT), 0, ""); zassert_equal(wait_events[0].tag, TAG_0, ""); zassert_equal(wait_events[1].state, K_POLL_STATE_FIFO_DATA_AVAILABLE, ""); - msg_ptr = k_fifo_get(&wait_fifo, 0); + msg_ptr = k_fifo_get(&wait_fifo, K_NO_WAIT); zassert_not_null(msg_ptr, ""); zassert_equal(msg_ptr, &wait_msg, ""); zassert_equal(msg_ptr->msg, FIFO_MSG_VALUE, ""); @@ -263,7 +266,7 @@ void test_poll_wait(void) k_thread_create(&test_thread, test_stack, K_THREAD_STACK_SIZEOF(test_stack), poll_wait_helper, - 0, 0, 0, main_low_prio - 1, 0, 0); + 0, 0, 0, main_low_prio - 1, 0, K_NO_WAIT); rc = k_poll(wait_events, ARRAY_SIZE(wait_events), K_SECONDS(1)); @@ -272,7 +275,7 @@ void test_poll_wait(void) zassert_equal(rc, 0, ""); zassert_equal(wait_events[0].state, K_POLL_STATE_SEM_AVAILABLE, ""); - zassert_equal(k_sem_take(&wait_sem, 0), 0, ""); + zassert_equal(k_sem_take(&wait_sem, K_NO_WAIT), 0, ""); zassert_equal(wait_events[0].tag, TAG_0, ""); zassert_equal(wait_events[1].state, K_POLL_STATE_NOT_READY, ""); @@ -299,7 +302,7 @@ void test_poll_wait(void) K_THREAD_STACK_SIZEOF(test_stack), poll_wait_helper, (void *)1, 0, 0, old_prio + 1, - K_USER | K_INHERIT_PERMS, 0); + K_USER | K_INHERIT_PERMS, K_NO_WAIT); /* semaphore */ rc = k_poll(wait_events, ARRAY_SIZE(wait_events), K_SECONDS(1)); @@ -307,7 +310,7 @@ void test_poll_wait(void) zassert_equal(rc, 0, ""); zassert_equal(wait_events[0].state, K_POLL_STATE_SEM_AVAILABLE, ""); - zassert_equal(k_sem_take(&wait_sem, 0), 0, ""); + zassert_equal(k_sem_take(&wait_sem, K_NO_WAIT), 0, ""); zassert_equal(wait_events[0].tag, TAG_0, ""); zassert_equal(wait_events[1].state, K_POLL_STATE_NOT_READY, ""); @@ -326,7 +329,7 @@ void test_poll_wait(void) zassert_equal(rc, 0, ""); zassert_equal(wait_events[0].state, K_POLL_STATE_NOT_READY, ""); - zassert_equal(k_sem_take(&wait_sem, 0), -EBUSY, ""); + zassert_equal(k_sem_take(&wait_sem, K_NO_WAIT), -EBUSY, ""); zassert_equal(wait_events[0].tag, TAG_0, ""); zassert_equal(wait_events[1].state, @@ -346,7 +349,7 @@ void test_poll_wait(void) zassert_equal(rc, 0, ""); zassert_equal(wait_events[0].state, K_POLL_STATE_NOT_READY, ""); - zassert_equal(k_sem_take(&wait_sem, 0), -EBUSY, ""); + zassert_equal(k_sem_take(&wait_sem, K_NO_WAIT), -EBUSY, ""); zassert_equal(wait_events[0].tag, TAG_0, ""); zassert_equal(wait_events[1].state, K_POLL_STATE_NOT_READY, ""); @@ -416,7 +419,7 @@ void test_poll_cancel(bool is_main_low_prio) k_thread_create(&test_thread, test_stack, K_THREAD_STACK_SIZEOF(test_stack), poll_cancel_helper, (void *)1, 0, 0, - main_low_prio - 1, K_USER | K_INHERIT_PERMS, 0); + main_low_prio - 1, K_USER | K_INHERIT_PERMS, K_NO_WAIT); rc = k_poll(cancel_events, ARRAY_SIZE(cancel_events), K_SECONDS(1)); @@ -516,7 +519,7 @@ void test_poll_multi(void) k_thread_create(&test_thread, test_stack, K_THREAD_STACK_SIZEOF(test_stack), multi, 0, 0, 0, main_low_prio - 1, - K_USER | K_INHERIT_PERMS, 0); + K_USER | K_INHERIT_PERMS, K_NO_WAIT); /* * create additional thread to add multiple(more than one) pending threads @@ -525,7 +528,7 @@ void test_poll_multi(void) k_thread_create(&test_loprio_thread, test_loprio_stack, K_THREAD_STACK_SIZEOF(test_loprio_stack), multi_lowprio, 0, 0, 0, main_low_prio + 1, - K_USER | K_INHERIT_PERMS, 0); + K_USER | K_INHERIT_PERMS, K_NO_WAIT); /* Allow lower priority thread to add poll event in the list */ k_sleep(250); @@ -538,7 +541,7 @@ void test_poll_multi(void) /* free polling threads, ensuring it awoken from k_poll() and got the sem */ k_sem_give(&multi_sem); k_sem_give(&multi_sem); - rc = k_sem_take(&multi_reply, K_SECONDS(1)); + rc = k_sem_take(&multi_reply, K_TIMEOUT_MS(1000)); zassert_equal(rc, 0, ""); @@ -593,7 +596,8 @@ void test_poll_threadstate(void) k_thread_create(&test_thread, test_stack, K_THREAD_STACK_SIZEOF(test_stack), threadstate, - ztest_tid, 0, 0, main_low_prio - 1, K_INHERIT_PERMS, 0); + ztest_tid, 0, 0, main_low_prio - 1, K_INHERIT_PERMS, + K_NO_WAIT); /* wait for spawn thread to take action */ zassert_equal(k_poll(&event, 1, K_SECONDS(1)), 0, ""); diff --git a/tests/kernel/queue/src/test_queue_contexts.c b/tests/kernel/queue/src/test_queue_contexts.c index d32935773e74b..4252066aed153 100644 --- a/tests/kernel/queue/src/test_queue_contexts.c +++ b/tests/kernel/queue/src/test_queue_contexts.c @@ -111,7 +111,7 @@ static void tqueue_thread_thread(struct k_queue *pqueue) /**TESTPOINT: thread-thread data passing via queue*/ k_tid_t tid = k_thread_create(&tdata, tstack, STACK_SIZE, tThread_entry, pqueue, NULL, NULL, - K_PRIO_PREEMPT(0), 0, 0); + K_PRIO_PREEMPT(0), 0, K_NO_WAIT); tqueue_append(pqueue); k_sem_take(&end_sema, K_FOREVER); k_thread_abort(tid); @@ -192,11 +192,11 @@ static void tqueue_get_2threads(struct k_queue *pqueue) k_sem_init(&end_sema, 0, 1); k_tid_t tid = k_thread_create(&tdata, tstack, STACK_SIZE, tThread_get, pqueue, NULL, NULL, - K_PRIO_PREEMPT(0), 0, 0); + K_PRIO_PREEMPT(0), 0, K_NO_WAIT); k_tid_t tid1 = k_thread_create(&tdata1, tstack1, STACK_SIZE, tThread_get, pqueue, NULL, NULL, - K_PRIO_PREEMPT(0), 0, 0); + K_PRIO_PREEMPT(0), 0, K_NO_WAIT); /* Wait threads to initialize */ k_sleep(10); diff --git a/tests/kernel/queue/src/test_queue_fail.c b/tests/kernel/queue/src/test_queue_fail.c index 4f0dca9b406de..9b7f6c7c468dd 100644 --- a/tests/kernel/queue/src/test_queue_fail.c +++ b/tests/kernel/queue/src/test_queue_fail.c @@ -6,7 +6,7 @@ #include "test_queue.h" -#define TIMEOUT 100 +#define TIMEOUT K_TIMEOUT_MS(100) /*test cases*/ /** diff --git a/tests/kernel/queue/src/test_queue_loop.c b/tests/kernel/queue/src/test_queue_loop.c index dc864ea19e0ca..5ea0c9c465e62 100644 --- a/tests/kernel/queue/src/test_queue_loop.c +++ b/tests/kernel/queue/src/test_queue_loop.c @@ -94,7 +94,7 @@ static void tqueue_read_write(struct k_queue *pqueue) /**TESTPOINT: thread-isr-thread data passing via queue*/ k_tid_t tid = k_thread_create(&tdata, tstack, STACK_SIZE, tThread_entry, pqueue, NULL, NULL, - K_PRIO_PREEMPT(0), 0, 0); + K_PRIO_PREEMPT(0), 0, K_NO_WAIT); TC_PRINT("main queue append ---> "); tqueue_append(pqueue); diff --git a/tests/kernel/queue/src/test_queue_user.c b/tests/kernel/queue/src/test_queue_user.c index ea29bd67a0f85..02bd74a24b23f 100644 --- a/tests/kernel/queue/src/test_queue_user.c +++ b/tests/kernel/queue/src/test_queue_user.c @@ -100,7 +100,7 @@ void test_queue_supv_to_user(void) k_thread_create(&child_thread, child_stack, STACK_SIZE, child_thread_get, q, sem, NULL, K_HIGHEST_THREAD_PRIO, - K_USER | K_INHERIT_PERMS, 0); + K_USER | K_INHERIT_PERMS, K_NO_WAIT); k_yield(); diff --git a/tests/kernel/sched/deadline/src/main.c b/tests/kernel/sched/deadline/src/main.c index 2369e2197258e..dcd710ecb11d1 100644 --- a/tests/kernel/sched/deadline/src/main.c +++ b/tests/kernel/sched/deadline/src/main.c @@ -56,7 +56,7 @@ void test_deadline(void) worker_stacks[i], STACK_SIZE, worker, INT_TO_POINTER(i), NULL, NULL, K_LOWEST_APPLICATION_THREAD_PRIO, - 0, 0); + 0, K_NO_WAIT); /* Positive-definite number with the bottom 8 bits * masked off to prevent aliasing where "very close" diff --git a/tests/kernel/sched/preempt/src/main.c b/tests/kernel/sched/preempt/src/main.c index df65df964d6c2..76f9725a62227 100644 --- a/tests/kernel/sched/preempt/src/main.c +++ b/tests/kernel/sched/preempt/src/main.c @@ -330,12 +330,12 @@ void test_preempt(void) k_thread_create(&worker_threads[i], worker_stacks[i], STACK_SIZE, worker, INT_TO_POINTER(i), NULL, NULL, - priority, 0, 0); + priority, 0, K_NO_WAIT); } k_thread_create(&manager_thread, manager_stack, STACK_SIZE, manager, NULL, NULL, NULL, - K_LOWEST_APPLICATION_THREAD_PRIO, 0, 0); + K_LOWEST_APPLICATION_THREAD_PRIO, 0, K_NO_WAIT); /* We don't control the priority of this thread so can't make * it part of the test. Just get out of the way until the diff --git a/tests/kernel/sched/schedule_api/src/test_priority_scheduling.c b/tests/kernel/sched/schedule_api/src/test_priority_scheduling.c index 2e4a01f8d3012..27b6aec29982b 100644 --- a/tests/kernel/sched/schedule_api/src/test_priority_scheduling.c +++ b/tests/kernel/sched/schedule_api/src/test_priority_scheduling.c @@ -80,7 +80,8 @@ void test_priority_scheduling(void) for (int i = 0; i < NUM_THREAD; i++) { tid[i] = k_thread_create(&t[i], tstacks[i], STACK_SIZE, thread_tslice, INT_TO_POINTER(i), NULL, NULL, - K_PRIO_PREEMPT(BASE_PRIORITY + i), 0, 0); + K_PRIO_PREEMPT(BASE_PRIORITY + i), 0, + K_NO_WAIT); } while (count < ITRERATION_COUNT) { diff --git a/tests/kernel/sched/schedule_api/src/test_sched_is_preempt_thread.c b/tests/kernel/sched/schedule_api/src/test_sched_is_preempt_thread.c index 1178d313db165..58087517f2567 100644 --- a/tests/kernel/sched/schedule_api/src/test_sched_is_preempt_thread.c +++ b/tests/kernel/sched/schedule_api/src/test_sched_is_preempt_thread.c @@ -72,14 +72,14 @@ void test_sched_is_preempt_thread(void) /*create preempt thread*/ k_tid_t tid = k_thread_create(&tdata, tstack, STACK_SIZE, tpreempt_ctx, NULL, NULL, NULL, - K_PRIO_PREEMPT(1), 0, 0); + K_PRIO_PREEMPT(1), 0, K_NO_WAIT); k_sem_take(&end_sema, K_FOREVER); k_thread_abort(tid); /*create coop thread*/ tid = k_thread_create(&tdata, tstack, STACK_SIZE, tcoop_ctx, NULL, NULL, NULL, - K_PRIO_COOP(1), 0, 0); + K_PRIO_COOP(1), 0, K_NO_WAIT); k_sem_take(&end_sema, K_FOREVER); k_thread_abort(tid); diff --git a/tests/kernel/sched/schedule_api/src/test_sched_priority.c b/tests/kernel/sched/schedule_api/src/test_sched_priority.c index 4d0dc9183f76e..bf4334b8c5498 100644 --- a/tests/kernel/sched/schedule_api/src/test_sched_priority.c +++ b/tests/kernel/sched/schedule_api/src/test_sched_priority.c @@ -41,7 +41,7 @@ void test_priority_cooperative(void) k_tid_t tid = k_thread_create(&tdata, tstack, STACK_SIZE, thread_entry, NULL, NULL, NULL, - spawn_prio, 0, 0); + spawn_prio, 0, K_NO_WAIT); /* checkpoint: current thread shouldn't preempted by higher thread */ zassert_true(last_prio == k_thread_priority_get(k_current_get()), NULL); k_sleep(100); @@ -76,7 +76,7 @@ void test_priority_preemptible(void) k_tid_t tid = k_thread_create(&tdata, tstack, STACK_SIZE, thread_entry, NULL, NULL, NULL, - spawn_prio, 0, 0); + spawn_prio, 0, K_NO_WAIT); /* checkpoint: thread is preempted by higher thread */ zassert_true(last_prio == spawn_prio, NULL); @@ -86,7 +86,7 @@ void test_priority_preemptible(void) spawn_prio = last_prio + 1; tid = k_thread_create(&tdata, tstack, STACK_SIZE, thread_entry, NULL, NULL, NULL, - spawn_prio, 0, 0); + spawn_prio, 0, K_NO_WAIT); /* checkpoint: thread is not preempted by lower thread */ zassert_false(last_prio == spawn_prio, NULL); k_thread_abort(tid); diff --git a/tests/kernel/sched/schedule_api/src/test_sched_timeslice_and_lock.c b/tests/kernel/sched/schedule_api/src/test_sched_timeslice_and_lock.c index f0193dba08dc9..415d734d75e27 100644 --- a/tests/kernel/sched/schedule_api/src/test_sched_timeslice_and_lock.c +++ b/tests/kernel/sched/schedule_api/src/test_sched_timeslice_and_lock.c @@ -59,7 +59,8 @@ static void spawn_threads(int sleep_sec) STACK_SIZE, thread_entry, INT_TO_POINTER(i), INT_TO_POINTER(sleep_sec), - NULL, tdata[i].priority, 0, 0); + NULL, tdata[i].priority, 0, + K_NO_WAIT); } } @@ -80,7 +81,7 @@ static void timer_handler(struct k_timer *timer) static void thread_handler(void *p1, void *p2, void *p3) { k_timer_init(&timer, timer_handler, NULL); - k_timer_start(&timer, DURATION, 0); + k_timer_start(&timer, K_TIMEOUT_MS(DURATION), K_NO_WAIT); } /*test cases*/ @@ -188,7 +189,7 @@ void test_sleep_wakeup_preemptible(void) static int executed; static void coop_thread(void *p1, void *p2, void *p3) { - k_sem_take(&pend_sema, 100); + k_sem_take(&pend_sema, K_TIMEOUT_MS(100)); executed = 1; } @@ -212,7 +213,7 @@ void test_pending_thread_wakeup(void) k_tid_t tid = k_thread_create(&t, tstack, STACK_SIZE, (k_thread_entry_t)coop_thread, NULL, NULL, NULL, - K_PRIO_COOP(1), 0, 0); + K_PRIO_COOP(1), 0, K_NO_WAIT); zassert_false(executed == 1, "The thread didn't wait" " for semaphore acquisition"); @@ -434,7 +435,7 @@ void test_wakeup_expired_timer_thread(void) { k_tid_t tid = k_thread_create(&tthread[0], tstack, STACK_SIZE, thread_handler, NULL, NULL, NULL, - K_PRIO_PREEMPT(0), 0, 0); + K_PRIO_PREEMPT(0), 0, K_NO_WAIT); k_sem_take(&timer_sema, K_FOREVER); /* wakeup a thread if the timer is expired */ k_wakeup(tid); diff --git a/tests/kernel/sched/schedule_api/src/test_sched_timeslice_reset.c b/tests/kernel/sched/schedule_api/src/test_sched_timeslice_reset.c index 102d9e885fc70..aaa29a0422db7 100644 --- a/tests/kernel/sched/schedule_api/src/test_sched_timeslice_reset.c +++ b/tests/kernel/sched/schedule_api/src/test_sched_timeslice_reset.c @@ -124,7 +124,8 @@ void test_slice_reset(void) for (int i = 0; i < NUM_THREAD; i++) { tid[i] = k_thread_create(&t[i], tstacks[i], STACK_SIZE, thread_time_slice, NULL, NULL, NULL, - K_PRIO_PREEMPT(j), 0, 0); + K_PRIO_PREEMPT(j), 0, + K_NO_WAIT); } /* enable time slice*/ k_sched_time_slice_set(SLICE_SIZE, K_PRIO_PREEMPT(0)); diff --git a/tests/kernel/sched/schedule_api/src/test_slice_scheduling.c b/tests/kernel/sched/schedule_api/src/test_slice_scheduling.c index f03bf4eecc844..50429991159cd 100644 --- a/tests/kernel/sched/schedule_api/src/test_slice_scheduling.c +++ b/tests/kernel/sched/schedule_api/src/test_slice_scheduling.c @@ -101,7 +101,8 @@ void test_slice_scheduling(void) tid[i] = k_thread_create(&t[i], tstacks[i], STACK_SIZE, thread_tslice, INT_TO_POINTER(i), NULL, NULL, - K_PRIO_PREEMPT(BASE_PRIORITY), 0, 0); + K_PRIO_PREEMPT(BASE_PRIORITY), 0, + K_NO_WAIT); } /* enable time slice*/ diff --git a/tests/kernel/sched/schedule_api/src/user_api.c b/tests/kernel/sched/schedule_api/src/user_api.c index 53abe613d3111..bbace80bf231c 100644 --- a/tests/kernel/sched/schedule_api/src/user_api.c +++ b/tests/kernel/sched/schedule_api/src/user_api.c @@ -19,7 +19,7 @@ static void sleepy_thread(void *p1, void *p2, void *p3) ARG_UNUSED(p2); ARG_UNUSED(p3); - k_sleep(K_FOREVER); + k_sleep(INT_MAX); k_sem_give(&user_sem); } @@ -28,7 +28,7 @@ void test_user_k_wakeup(void) k_thread_create(&user_thread, ustack, STACK_SIZE, sleepy_thread, NULL, NULL, NULL, k_thread_priority_get(k_current_get()), - K_USER | K_INHERIT_PERMS, 0); + K_USER | K_INHERIT_PERMS, K_NO_WAIT); k_yield(); /* Let thread run and start sleeping forever */ k_wakeup(&user_thread); @@ -62,7 +62,7 @@ void test_user_k_is_preempt(void) k_thread_create(&user_thread, ustack, STACK_SIZE, preempt_test_thread, NULL, NULL, NULL, k_thread_priority_get(k_current_get()), - K_USER | K_INHERIT_PERMS, 0); + K_USER | K_INHERIT_PERMS, K_NO_WAIT); k_sem_take(&user_sem, K_FOREVER); @@ -72,7 +72,7 @@ void test_user_k_is_preempt(void) k_thread_create(&user_thread, ustack, STACK_SIZE, preempt_test_thread, NULL, NULL, NULL, K_PRIO_PREEMPT(1), - K_USER | K_INHERIT_PERMS, 0); + K_USER | K_INHERIT_PERMS, K_NO_WAIT); k_sem_take(&user_sem, K_FOREVER); diff --git a/tests/kernel/semaphore/sema_api/src/main.c b/tests/kernel/semaphore/sema_api/src/main.c index a7538d5cc33f7..cb7dae7500a68 100644 --- a/tests/kernel/semaphore/sema_api/src/main.c +++ b/tests/kernel/semaphore/sema_api/src/main.c @@ -7,7 +7,7 @@ #include #include -#define TIMEOUT 100 +#define TIMEOUT K_TIMEOUT_MS(100) #define STACK_SIZE 512 #define SEM_INITIAL 0 #define SEM_LIMIT 2 @@ -34,7 +34,7 @@ static void tsema_thread_thread(struct k_sem *psem) k_tid_t tid = k_thread_create(&tdata, tstack, STACK_SIZE, thread_entry, psem, NULL, NULL, K_PRIO_PREEMPT(0), - K_USER | K_INHERIT_PERMS, 0); + K_USER | K_INHERIT_PERMS, K_NO_WAIT); zassert_false(k_sem_take(psem, K_FOREVER), NULL); /*clean the spawn thread avoid side effect in next TC*/ diff --git a/tests/kernel/semaphore/semaphore/src/main.c b/tests/kernel/semaphore/semaphore/src/main.c index 80cea174c6c46..04d0ce855be22 100644 --- a/tests/kernel/semaphore/semaphore/src/main.c +++ b/tests/kernel/semaphore/semaphore/src/main.c @@ -14,7 +14,7 @@ #define sem_give_from_isr(sema) irq_offload(isr_sem_give, sema) #define sem_take_from_isr(sema) irq_offload(isr_sem_take, sema) -#define SEM_TIMEOUT (K_MSEC(100)) +#define SEM_TIMEOUT K_TIMEOUT_MS(100) #define STACK_SIZE (1024 + CONFIG_TEST_EXTRA_STACKSIZE) #define TOTAL_THREADS_WAITING (5) @@ -60,7 +60,7 @@ void sem_give_task(void *p1, void *p2, void *p3) void sem_take_timeout_forever_helper(void *p1, void *p2, void *p3) { - k_sleep(K_MSEC(100)); + k_sleep(100); k_sem_give(&simple_sem); } @@ -363,17 +363,17 @@ void test_sem_take_multiple(void) /* time for those 3 threads to complete */ - k_sleep(K_MSEC(20)); + k_sleep(20); /* Let these threads proceed to take the multiple_sem */ k_sem_give(&high_prio_sem); k_sem_give(&mid_prio_sem); k_sem_give(&low_prio_sem); - k_sleep(K_MSEC(200)); + k_sleep(200); /* enable the higher priority thread to run. */ k_sem_give(&multiple_thread_sem); - k_sleep(K_MSEC(200)); + k_sleep(200); /* check which threads completed. */ signal_count = k_sem_count_get(&high_prio_sem); zassert_true(signal_count == 1U, @@ -389,7 +389,7 @@ void test_sem_take_multiple(void) /* enable the Medium priority thread to run. */ k_sem_give(&multiple_thread_sem); - k_sleep(K_MSEC(200)); + k_sleep(200); /* check which threads completed. */ signal_count = k_sem_count_get(&high_prio_sem); zassert_true(signal_count == 1U, @@ -405,7 +405,7 @@ void test_sem_take_multiple(void) /* enable the low priority thread to run. */ k_sem_give(&multiple_thread_sem); - k_sleep(K_MSEC(200)); + k_sleep(200); /* check which threads completed. */ signal_count = k_sem_count_get(&high_prio_sem); zassert_true(signal_count == 1U, @@ -492,7 +492,7 @@ void test_sem_multiple_threads_wait(void) } /* giving time for the other threads to execute */ - k_sleep(K_MSEC(500)); + k_sleep(500); /* Give the semaphores */ for (int i = 0; i < TOTAL_THREADS_WAITING; i++) { @@ -500,7 +500,7 @@ void test_sem_multiple_threads_wait(void) } /* giving time for the other threads to execute */ - k_sleep(K_MSEC(500)); + k_sleep(500); /* check if all the threads are done. */ for (int i = 0; i < TOTAL_THREADS_WAITING; i++) { @@ -542,21 +542,21 @@ void test_sem_measure_timeouts(void) /* With timeout of 1 sec */ start_ticks = k_uptime_get(); - ret_value = k_sem_take(&simple_sem, K_SECONDS(1)); + ret_value = k_sem_take(&simple_sem, K_TIMEOUT_MS(1000)); end_ticks = k_uptime_get(); zassert_true(ret_value == -EAGAIN, "k_sem_take failed when its shouldn't have"); - zassert_true((end_ticks - start_ticks >= K_SECONDS(1)), + zassert_true((end_ticks - start_ticks >= 1000), "time missmatch expected %d, got %d\n", - K_SECONDS(1), end_ticks - start_ticks); + 1000, end_ticks - start_ticks); /* With 0 as the timeout */ start_ticks = k_uptime_get(); - ret_value = k_sem_take(&simple_sem, 0); + ret_value = k_sem_take(&simple_sem, K_NO_WAIT); end_ticks = k_uptime_get(); @@ -606,16 +606,16 @@ void test_sem_measure_timeout_from_thread(void) /* With timeout of 1 sec */ start_ticks = k_uptime_get(); - ret_value = k_sem_take(&multiple_thread_sem, K_SECONDS(1)); + ret_value = k_sem_take(&multiple_thread_sem, K_TIMEOUT_MS(1000)); end_ticks = k_uptime_get(); zassert_true(ret_value == 0, "k_sem_take failed when its shouldn't have"); - zassert_true((end_ticks - start_ticks <= K_SECONDS(1)), + zassert_true((end_ticks - start_ticks <= 1000), "time missmatch. expected less than%d ,got %d\n", - K_SECONDS(1), end_ticks - start_ticks); + 1000, end_ticks - start_ticks); } @@ -627,7 +627,7 @@ void test_sem_multiple_take_and_timeouts_helper(void *p1, void *p2, void *p3) start_ticks = k_uptime_get(); - k_sem_take(&simple_sem, timeout); + k_sem_take(&simple_sem, K_TIMEOUT_MS(timeout)); end_ticks = k_uptime_get(); @@ -660,14 +660,14 @@ void test_sem_multiple_take_and_timeouts(void) k_thread_create(&multiple_tid[i], multiple_stack[i], STACK_SIZE, test_sem_multiple_take_and_timeouts_helper, - INT_TO_POINTER(K_SECONDS(i + 1)), NULL, NULL, + INT_TO_POINTER(1000 * (i + 1)), NULL, NULL, K_PRIO_PREEMPT(1), 0, K_NO_WAIT); } for (int i = 0; i < TOTAL_THREADS_WAITING; i++) { k_pipe_get(&timeout_info_pipe, &timeout, sizeof(int), &bytes_read, sizeof(int), K_FOREVER); - zassert_true(timeout == K_SECONDS(i + 1), + zassert_true(timeout == (1000 * (i + 1)), "timeout didn't occur properly"); } @@ -692,7 +692,7 @@ void test_sem_multi_take_timeout_diff_sem_helper(void *p1, void *p2, void *p3) start_ticks = k_uptime_get(); - ret_value = k_sem_take(sema, timeout); + ret_value = k_sem_take(sema, K_TIMEOUT_MS(timeout)); end_ticks = k_uptime_get(); @@ -715,11 +715,11 @@ void test_sem_multi_take_timeout_diff_sem(void) { size_t bytes_read; struct timeout_info seq_info[] = { - { K_SECONDS(2), &simple_sem }, - { K_SECONDS(1), &multiple_thread_sem }, - { K_SECONDS(3), &simple_sem }, - { K_SECONDS(5), &multiple_thread_sem }, - { K_SECONDS(4), &simple_sem }, + { 2000, &simple_sem }, + { 1000, &multiple_thread_sem }, + { 3000, &simple_sem }, + { 5000, &multiple_thread_sem }, + { 4000, &simple_sem }, }; struct timeout_info retrieved_info; @@ -749,8 +749,7 @@ void test_sem_multi_take_timeout_diff_sem(void) K_FOREVER); - zassert_true(K_TIMEOUT_EQ(retrieved_info.timeout, - K_SECONDS(i + 1)), + zassert_true(retrieved_info.timeout == (1000 * (i + 1)), "timeout didn't occur properly"); } diff --git a/tests/kernel/sleep/src/main.c b/tests/kernel/sleep/src/main.c index c10029131c897..09de55fa9caf5 100644 --- a/tests/kernel/sleep/src/main.c +++ b/tests/kernel/sleep/src/main.c @@ -198,7 +198,7 @@ void test_sleep(void) THREAD_STACK, (k_thread_entry_t) test_thread, 0, 0, NULL, TEST_THREAD_PRIORITY, - 0, 0); + 0, K_NO_WAIT); TC_PRINT("Test thread started: id = %p\n", test_thread_id); @@ -206,7 +206,7 @@ void test_sleep(void) helper_thread_stack, THREAD_STACK, (k_thread_entry_t) helper_thread, 0, 0, NULL, HELPER_THREAD_PRIORITY, - 0, 0); + 0, K_NO_WAIT); TC_PRINT("Helper thread started: id = %p\n", helper_thread_id); diff --git a/tests/kernel/smp/src/main.c b/tests/kernel/smp/src/main.c index 215706647c67a..57856a00cfbd7 100644 --- a/tests/kernel/smp/src/main.c +++ b/tests/kernel/smp/src/main.c @@ -198,7 +198,8 @@ static void spawn_threads(int prio, int thread_num, tinfo[i].tid = k_thread_create(&tthread[i], tstack[i], STACK_SIZE, thread_entry, (void *)i, NULL, NULL, - tinfo[i].priority, 0, delay); + tinfo[i].priority, 0, + K_TIMEOUT_MS(delay)); if (delay) { /* Increase delay for each thread */ delay = delay + 10; diff --git a/tests/kernel/stack/stack_api/src/test_stack_contexts.c b/tests/kernel/stack/stack_api/src/test_stack_contexts.c index 15c149a3fd416..f69f765beb2e2 100644 --- a/tests/kernel/stack/stack_api/src/test_stack_contexts.c +++ b/tests/kernel/stack/stack_api/src/test_stack_contexts.c @@ -64,7 +64,7 @@ static void tstack_thread_thread(struct k_stack *pstack) k_tid_t tid = k_thread_create(&thread_data, threadstack, STACK_SIZE, tThread_entry, pstack, NULL, NULL, K_PRIO_PREEMPT(0), K_USER | - K_INHERIT_PERMS, 0); + K_INHERIT_PERMS, K_NO_WAIT); tstack_push(pstack); k_sem_take(&end_sema, K_FOREVER); @@ -150,7 +150,8 @@ void test_stack_alloc_thread2thread(void) /**TESTPOINT: thread-thread data passing via stack*/ k_tid_t tid = k_thread_create(&thread_data, threadstack, STACK_SIZE, tThread_entry, &kstack_test_alloc, - NULL, NULL, K_PRIO_PREEMPT(0), 0, 0); + NULL, NULL, K_PRIO_PREEMPT(0), 0, + K_NO_WAIT); tstack_push(&kstack_test_alloc); k_sem_take(&end_sema, K_FOREVER); diff --git a/tests/kernel/stack/stack_api/src/test_stack_fail.c b/tests/kernel/stack/stack_api/src/test_stack_fail.c index b387fc040308f..e42c7ff7767df 100644 --- a/tests/kernel/stack/stack_api/src/test_stack_fail.c +++ b/tests/kernel/stack/stack_api/src/test_stack_fail.c @@ -7,7 +7,7 @@ #include #include -#define TIMEOUT 100 +#define TIMEOUT K_TIMEOUT_MS(100) #define STACK_LEN 2 static ZTEST_BMEM stack_data_t data[STACK_LEN]; diff --git a/tests/kernel/stack/stack_usage/src/main.c b/tests/kernel/stack/stack_usage/src/main.c index aad30d6f984f6..4333aec69ee63 100644 --- a/tests/kernel/stack/stack_usage/src/main.c +++ b/tests/kernel/stack/stack_usage/src/main.c @@ -157,7 +157,7 @@ static void test_single_stack_play(void) k_tid_t tid = k_thread_create(&thread_data, threadstack, TSTACK_SIZE, thread_entry_fn_single, &stack1, NULL, NULL, K_PRIO_PREEMPT(0), K_USER | - K_INHERIT_PERMS, 0); + K_INHERIT_PERMS, K_NO_WAIT); /* Let the child thread run */ k_sem_take(&end_sema, K_FOREVER); @@ -186,7 +186,7 @@ static void test_dual_stack_play(void) k_tid_t tid = k_thread_create(&thread_data, threadstack, TSTACK_SIZE, thread_entry_fn_dual, &stack1, &stack2, NULL, K_PRIO_PREEMPT(0), K_USER | - K_INHERIT_PERMS, 0); + K_INHERIT_PERMS, K_NO_WAIT); for (i = 0U; i < STACK_LEN; i++) { /* Push items to stack2 */ @@ -215,7 +215,7 @@ static void test_isr_stack_play(void) k_tid_t tid = k_thread_create(&thread_data, threadstack, TSTACK_SIZE, thread_entry_fn_isr, &stack1, &stack2, NULL, K_PRIO_PREEMPT(0), - K_INHERIT_PERMS, 0); + K_INHERIT_PERMS, K_NO_WAIT); /* Push items to stack2 */ diff --git a/tests/kernel/threads/dynamic_thread/src/main.c b/tests/kernel/threads/dynamic_thread/src/main.c index ce2e5adedcf80..8c5863e477f79 100644 --- a/tests/kernel/threads/dynamic_thread/src/main.c +++ b/tests/kernel/threads/dynamic_thread/src/main.c @@ -50,7 +50,7 @@ static void create_dynamic_thread(void) tid = k_thread_create(dyn_thread, dyn_thread_stack, STACKSIZE, dyn_thread_entry, NULL, NULL, NULL, - K_PRIO_PREEMPT(0), K_USER, 0); + K_PRIO_PREEMPT(0), K_USER, K_NO_WAIT); k_object_access_grant(&start_sem, tid); k_object_access_grant(&end_sem, tid); @@ -76,7 +76,7 @@ static void permission_test(void) tid = k_thread_create(dyn_thread, dyn_thread_stack, STACKSIZE, dyn_thread_entry, NULL, NULL, NULL, - K_PRIO_PREEMPT(0), K_USER, 0); + K_PRIO_PREEMPT(0), K_USER, K_NO_WAIT); k_object_access_grant(&start_sem, tid); diff --git a/tests/kernel/threads/thread_apis/src/main.c b/tests/kernel/threads/thread_apis/src/main.c index 940c30f06990a..64d29544a1524 100644 --- a/tests/kernel/threads/thread_apis/src/main.c +++ b/tests/kernel/threads/thread_apis/src/main.c @@ -95,7 +95,7 @@ void test_customdata_get_set_coop(void) { k_tid_t tid = k_thread_create(&tdata_custom, tstack_custom, STACK_SIZE, customdata_entry, NULL, NULL, NULL, - K_PRIO_COOP(1), 0, 0); + K_PRIO_COOP(1), 0, K_NO_WAIT); k_sleep(500); @@ -130,7 +130,7 @@ void test_thread_name_get_set(void) /* Set and get child thread's name */ k_tid_t tid = k_thread_create(&tdata_name, tstack_name, STACK_SIZE, thread_name_entry, NULL, NULL, NULL, - K_PRIO_PREEMPT(1), 0, 0); + K_PRIO_PREEMPT(1), 0, K_NO_WAIT); ret = k_thread_name_set(tid, "customdata"); zassert_equal(ret, 0, "k_thread_name_set() failed"); @@ -198,7 +198,7 @@ void test_thread_name_user_get_set(void) /* Set and get child thread's name */ k_tid_t tid = k_thread_create(&tdata_name, tstack_name, STACK_SIZE, thread_name_entry, NULL, NULL, NULL, - K_PRIO_PREEMPT(1), K_USER, 0); + K_PRIO_PREEMPT(1), K_USER, K_NO_WAIT); ret = k_thread_name_set(tid, "customdata"); zassert_equal(ret, 0, "k_thread_name_set() failed"); ret = k_thread_name_copy(tid, thread_name, sizeof(thread_name)); @@ -223,7 +223,7 @@ void test_customdata_get_set_preempt(void) /** TESTPOINT: custom data of preempt thread */ k_tid_t tid = k_thread_create(&tdata_custom, tstack_custom, STACK_SIZE, customdata_entry, NULL, NULL, NULL, - K_PRIO_PREEMPT(0), K_USER, 0); + K_PRIO_PREEMPT(0), K_USER, K_NO_WAIT); k_sleep(500); diff --git a/tests/kernel/threads/thread_apis/src/test_essential_thread.c b/tests/kernel/threads/thread_apis/src/test_essential_thread.c index 3c22251865e17..7a0bc07b0de64 100644 --- a/tests/kernel/threads/thread_apis/src/test_essential_thread.c +++ b/tests/kernel/threads/thread_apis/src/test_essential_thread.c @@ -41,7 +41,8 @@ void test_essential_thread_operation(void) { k_tid_t tid = k_thread_create(&kthread_thread, kthread_stack, STACKSIZE, (k_thread_entry_t)thread_entry, NULL, - NULL, NULL, K_PRIO_PREEMPT(0), 0, 0); + NULL, NULL, K_PRIO_PREEMPT(0), 0, + K_NO_WAIT); k_sem_take(&sync_sem, K_FOREVER); k_thread_abort(tid); diff --git a/tests/kernel/threads/thread_apis/src/test_kthread_for_each.c b/tests/kernel/threads/thread_apis/src/test_kthread_for_each.c index a13fc8f8363ba..def0dd52b409a 100644 --- a/tests/kernel/threads/thread_apis/src/test_kthread_for_each.c +++ b/tests/kernel/threads/thread_apis/src/test_kthread_for_each.c @@ -62,7 +62,7 @@ void test_k_thread_foreach(void) /* Create new thread which should add a new entry to the thread list */ k_tid_t tid = k_thread_create(&tdata, tstack, STACK_SIZE, (k_thread_entry_t)thread_entry, NULL, - NULL, NULL, K_PRIO_PREEMPT(0), 0, 0); + NULL, NULL, K_PRIO_PREEMPT(0), 0, K_NO_WAIT); k_sleep(1); /* Call k_thread_foreach() and check diff --git a/tests/kernel/threads/thread_apis/src/test_threads_cancel_abort.c b/tests/kernel/threads/thread_apis/src/test_threads_cancel_abort.c index 181e8dec91645..7ba75a882ab37 100644 --- a/tests/kernel/threads/thread_apis/src/test_threads_cancel_abort.c +++ b/tests/kernel/threads/thread_apis/src/test_threads_cancel_abort.c @@ -43,7 +43,7 @@ void test_threads_abort_self(void) { execute_flag = 0; k_thread_create(&tdata, tstack, STACK_SIZE, thread_entry_abort, - NULL, NULL, NULL, 0, K_USER, 0); + NULL, NULL, NULL, 0, K_USER, K_NO_WAIT); k_sleep(100); /**TESTPOINT: spawned thread executed but abort itself*/ zassert_true(execute_flag == 1, NULL); @@ -64,7 +64,7 @@ void test_threads_abort_others(void) execute_flag = 0; k_tid_t tid = k_thread_create(&tdata, tstack, STACK_SIZE, thread_entry, NULL, NULL, NULL, - 0, K_USER, 0); + 0, K_USER, K_NO_WAIT); k_thread_abort(tid); k_sleep(100); @@ -73,7 +73,7 @@ void test_threads_abort_others(void) tid = k_thread_create(&tdata, tstack, STACK_SIZE, thread_entry, NULL, NULL, NULL, - 0, K_USER, 0); + 0, K_USER, K_NO_WAIT); k_sleep(50); k_thread_abort(tid); /**TESTPOINT: check running thread is aborted*/ @@ -93,7 +93,7 @@ void test_threads_abort_repeat(void) execute_flag = 0; k_tid_t tid = k_thread_create(&tdata, tstack, STACK_SIZE, thread_entry, NULL, NULL, NULL, - 0, K_USER, 0); + 0, K_USER, K_NO_WAIT); k_thread_abort(tid); k_sleep(100); @@ -119,7 +119,7 @@ static void uthread_entry(void) block = k_malloc(BLOCK_SIZE); zassert_true(block != NULL, NULL); printk("Child thread is running\n"); - k_sleep(K_MSEC(2)); + k_sleep(2); } /** @@ -133,11 +133,11 @@ void test_abort_handler(void) { k_tid_t tid = k_thread_create(&tdata, tstack, STACK_SIZE, (k_thread_entry_t)uthread_entry, NULL, NULL, NULL, - 0, 0, 0); + 0, 0, K_NO_WAIT); tdata.fn_abort = &abort_function; - k_sleep(K_MSEC(1)); + k_sleep(1); abort_called = false; @@ -174,7 +174,7 @@ void test_delayed_thread_abort(void) */ k_tid_t tid = k_thread_create(&tdata, tstack, STACK_SIZE, (k_thread_entry_t)delayed_thread_entry, NULL, NULL, NULL, - K_PRIO_PREEMPT(1), 0, 100); + K_PRIO_PREEMPT(1), 0, K_TIMEOUT_MS(100)); /* Give up CPU */ k_sleep(50); diff --git a/tests/kernel/threads/thread_apis/src/test_threads_set_priority.c b/tests/kernel/threads/thread_apis/src/test_threads_set_priority.c index f45168ed2d832..10b2240d44f12 100644 --- a/tests/kernel/threads/thread_apis/src/test_threads_set_priority.c +++ b/tests/kernel/threads/thread_apis/src/test_threads_set_priority.c @@ -73,7 +73,8 @@ void test_threads_priority_set(void) k_tid_t thread2_id = k_thread_create(&tdata, tstack, STACK_SIZE, (k_thread_entry_t)thread2_set_prio_test, - NULL, NULL, NULL, thread2_prio, 0, 0); + NULL, NULL, NULL, thread2_prio, 0, + K_NO_WAIT); /* Lower the priority of thread2 */ k_thread_priority_set(thread2_id, thread2_prio + 2); diff --git a/tests/kernel/threads/thread_apis/src/test_threads_spawn.c b/tests/kernel/threads/thread_apis/src/test_threads_spawn.c index 63f51439e5194..99063c159022d 100644 --- a/tests/kernel/threads/thread_apis/src/test_threads_spawn.c +++ b/tests/kernel/threads/thread_apis/src/test_threads_spawn.c @@ -49,7 +49,7 @@ void test_threads_spawn_params(void) { k_thread_create(&tdata, tstack, STACK_SIZE, thread_entry_params, tp1, INT_TO_POINTER(tp2), tp3, 0, - K_USER, 0); + K_USER, K_NO_WAIT); k_sleep(100); } @@ -67,7 +67,7 @@ void test_threads_spawn_priority(void) /* spawn thread with higher priority */ spawn_prio = k_thread_priority_get(k_current_get()) - 1; k_thread_create(&tdata, tstack, STACK_SIZE, thread_entry_priority, - NULL, NULL, NULL, spawn_prio, K_USER, 0); + NULL, NULL, NULL, spawn_prio, K_USER, K_NO_WAIT); k_sleep(100); } @@ -85,7 +85,7 @@ void test_threads_spawn_delay(void) /* spawn thread with higher priority */ tp2 = 10; k_thread_create(&tdata, tstack, STACK_SIZE, thread_entry_delay, - NULL, NULL, NULL, 0, K_USER, 120); + NULL, NULL, NULL, 0, K_USER, K_TIMEOUT_MS(120)); /* 100 < 120 ensure spawn thread not start */ k_sleep(100); /* checkpoint: check spawn thread not execute */ diff --git a/tests/kernel/threads/thread_apis/src/test_threads_suspend_resume.c b/tests/kernel/threads/thread_apis/src/test_threads_suspend_resume.c index fe1c6f730fe19..2e309dae57270 100644 --- a/tests/kernel/threads/thread_apis/src/test_threads_suspend_resume.c +++ b/tests/kernel/threads/thread_apis/src/test_threads_suspend_resume.c @@ -26,7 +26,7 @@ static void threads_suspend_resume(int prio) k_tid_t tid = k_thread_create(&tdata, tstack, STACK_SIZE, thread_entry, NULL, NULL, NULL, - create_prio, K_USER, 0); + create_prio, K_USER, K_NO_WAIT); /* checkpoint: suspend current thread */ k_thread_suspend(tid); k_sleep(100); diff --git a/tests/kernel/threads/thread_init/src/main.c b/tests/kernel/threads/thread_init/src/main.c index 75184d8c65f7a..243f2469acbf2 100644 --- a/tests/kernel/threads/thread_init/src/main.c +++ b/tests/kernel/threads/thread_init/src/main.c @@ -20,7 +20,7 @@ #define INIT_PREEMPT_P2 ((void *)6) #define INIT_PREEMPT_P3 ((void *)7) #define INIT_PREEMPT_OPTION (K_USER | K_INHERIT_PERMS) -#define INIT_PREEMPT_DELAY K_NO_WAIT +#define INIT_PREEMPT_DELAY 0 static void thread_entry(void *p1, void *p2, void *p3); @@ -144,7 +144,8 @@ void test_kinit_preempt_thread(void) k_tid_t pthread = k_thread_create(&thread_preempt, stack_preempt, INIT_PREEMPT_STACK_SIZE, thread_entry, INIT_PREEMPT_P1, INIT_PREEMPT_P2, INIT_PREEMPT_P3, INIT_PREEMPT_PRIO, - INIT_PREEMPT_OPTION, INIT_PREEMPT_DELAY); + INIT_PREEMPT_OPTION, + K_TIMEOUT_MS(INIT_PREEMPT_DELAY)); /*record time stamp of thread creation*/ t_create = k_uptime_get(); @@ -177,7 +178,8 @@ void test_kinit_coop_thread(void) k_tid_t pthread = k_thread_create(&thread_coop, stack_coop, INIT_COOP_STACK_SIZE, thread_entry, INIT_COOP_P1, INIT_COOP_P2, INIT_COOP_P3, INIT_COOP_PRIO, - INIT_COOP_OPTION, INIT_COOP_DELAY); + INIT_COOP_OPTION, + K_TIMEOUT_MS(INIT_COOP_DELAY)); /*record time stamp of thread creation*/ t_create = k_uptime_get(); diff --git a/tests/kernel/tickless/tickless_concept/src/main.c b/tests/kernel/tickless/tickless_concept/src/main.c index 0bef530cf3a58..924a8dd8c3e91 100644 --- a/tests/kernel/tickless/tickless_concept/src/main.c +++ b/tests/kernel/tickless/tickless_concept/src/main.c @@ -87,7 +87,7 @@ void test_tickless_sysclock(void) ALIGN_MS_BOUNDARY(); t0 = k_uptime_get_32(); - k_sem_take(&sema, SLEEP_TICKFUL); + k_sem_take(&sema, K_TIMEOUT_MS(SLEEP_TICKFUL)); t1 = k_uptime_get_32(); TC_PRINT("time %d, %d\n", t0, t1); /**TESTPOINT: verify system clock recovery after exiting tickful idle*/ @@ -112,7 +112,8 @@ void test_tickless_slice(void) for (int i = 0; i < NUM_THREAD; i++) { tid[i] = k_thread_create(&tdata[i], tstack[i], STACK_SIZE, thread_tslice, NULL, NULL, NULL, - K_PRIO_PREEMPT(0), 0, SLICE_SIZE); + K_PRIO_PREEMPT(0), 0, + K_TIMEOUT_MS(SLICE_SIZE)); } k_uptime_delta(&elapsed_slice); /*relinquish CPU and wait for each thread to complete*/ diff --git a/tests/kernel/timer/timer_api/src/main.c b/tests/kernel/timer/timer_api/src/main.c index e6ded0170f18d..2c44061174f5b 100644 --- a/tests/kernel/timer/timer_api/src/main.c +++ b/tests/kernel/timer/timer_api/src/main.c @@ -129,7 +129,8 @@ void test_timer_duration_period(void) { init_timer_data(); /** TESTPOINT: init timer via k_timer_init */ - k_timer_start(&duration_timer, DURATION, PERIOD); + k_timer_start(&duration_timer, K_TIMEOUT_MS(DURATION), + K_TIMEOUT_MS(PERIOD)); tdata.timestamp = k_uptime_get(); busy_wait_ms(DURATION + PERIOD * EXPIRE_TIMES + PERIOD / 2); /** TESTPOINT: check expire and stop times */ @@ -159,9 +160,9 @@ void test_timer_period_0(void) { init_timer_data(); /** TESTPOINT: set period 0 */ - k_timer_start(&period0_timer, DURATION, 0); + k_timer_start(&period0_timer, K_TIMEOUT_MS(DURATION), K_NO_WAIT); tdata.timestamp = k_uptime_get(); - busy_wait_ms(DURATION + 1); + busy_wait_ms(DURATION + k_ticks_to_ms_ceil32(1)); /** TESTPOINT: ensure it is one-short timer */ TIMER_ASSERT(tdata.expire_cnt == 1, &period0_timer); @@ -190,7 +191,8 @@ void test_timer_expirefn_null(void) { init_timer_data(); /** TESTPOINT: expire function NULL */ - k_timer_start(&expire_timer, DURATION, PERIOD); + k_timer_start(&expire_timer, K_TIMEOUT_MS(DURATION), + K_TIMEOUT_MS(PERIOD)); busy_wait_ms(DURATION + PERIOD * EXPIRE_TIMES + PERIOD / 2); k_timer_stop(&expire_timer); @@ -208,7 +210,7 @@ void test_timer_expirefn_null(void) */ static void tick_sync(void) { - k_timer_start(&sync_timer, 0, 1); + k_timer_start(&sync_timer, K_NO_WAIT, K_TIMEOUT_MS(1)); k_timer_status_sync(&sync_timer); k_timer_stop(&sync_timer); } @@ -242,7 +244,7 @@ void test_timer_periodicity(void) init_timer_data(); /** TESTPOINT: set duration 0 */ - k_timer_start(&periodicity_timer, 0, PERIOD); + k_timer_start(&periodicity_timer, K_NO_WAIT, K_TIMEOUT_MS(PERIOD)); /* clear the expiration that would have happened due to * whatever duration that was set. Since timer is likely @@ -296,7 +298,8 @@ void test_timer_periodicity(void) void test_timer_status_get(void) { init_timer_data(); - k_timer_start(&status_timer, DURATION, PERIOD); + k_timer_start(&status_timer, K_TIMEOUT_MS(DURATION), + K_TIMEOUT_MS(PERIOD)); /** TESTPOINT: status get upon timer starts */ TIMER_ASSERT(k_timer_status_get(&status_timer) == 0, &status_timer); /** TESTPOINT: remaining get upon timer starts */ @@ -325,7 +328,8 @@ void test_timer_status_get(void) void test_timer_status_get_anytime(void) { init_timer_data(); - k_timer_start(&status_anytime_timer, DURATION, PERIOD); + k_timer_start(&status_anytime_timer, K_TIMEOUT_MS(DURATION), + K_TIMEOUT_MS(PERIOD)); busy_wait_ms(DURATION + PERIOD * (EXPIRE_TIMES - 1) + PERIOD / 2); /** TESTPOINT: status get at any time */ @@ -355,7 +359,8 @@ void test_timer_status_get_anytime(void) void test_timer_status_sync(void) { init_timer_data(); - k_timer_start(&status_sync_timer, DURATION, PERIOD); + k_timer_start(&status_sync_timer, K_TIMEOUT_MS(DURATION), + K_TIMEOUT_MS(PERIOD)); for (int i = 0; i < EXPIRE_TIMES; i++) { /** TESTPOINT: check timer not expire */ @@ -390,7 +395,8 @@ void test_timer_k_define(void) { init_timer_data(); /** TESTPOINT: init timer via k_timer_init */ - k_timer_start(&ktimer, DURATION, PERIOD); + k_timer_start(&ktimer, K_TIMEOUT_MS(DURATION), + K_TIMEOUT_MS(PERIOD)); tdata.timestamp = k_uptime_get(); busy_wait_ms(DURATION + PERIOD * EXPIRE_TIMES + PERIOD / 2); @@ -403,14 +409,15 @@ void test_timer_k_define(void) init_timer_data(); /** TESTPOINT: init timer via k_timer_init */ - k_timer_start(&ktimer, DURATION, PERIOD); + k_timer_start(&ktimer, K_TIMEOUT_MS(DURATION), + K_TIMEOUT_MS(PERIOD)); /* Call the k_timer_start() again to make sure that * the initial timeout request gets cancelled and new * one will get added. */ busy_wait_ms(DURATION / 2); - k_timer_start(&ktimer, DURATION, PERIOD); + k_timer_start(&ktimer, K_TIMEOUT_MS(DURATION), K_TIMEOUT_MS(PERIOD)); tdata.timestamp = k_uptime_get(); busy_wait_ms(DURATION + PERIOD * EXPIRE_TIMES + PERIOD / 2); @@ -485,7 +492,8 @@ void test_timer_user_data(void) } for (ii = 0; ii < 5; ii++) { - k_timer_start(user_data_timer[ii], 50 + ii * 50, 0); + k_timer_start(user_data_timer[ii], K_TIMEOUT_MS(50 + ii * 50), + K_NO_WAIT); } k_sleep(50 * ii + 50); @@ -519,7 +527,7 @@ void test_timer_remaining_get(void) u32_t remaining; init_timer_data(); - k_timer_start(&remain_timer, DURATION, 0); + k_timer_start(&remain_timer, K_TIMEOUT_MS(DURATION), K_NO_WAIT); busy_wait_ms(DURATION / 2); remaining = k_timer_remaining_get(&remain_timer); k_timer_stop(&remain_timer); diff --git a/tests/kernel/workq/work_queue/src/main.c b/tests/kernel/workq/work_queue/src/main.c index 1fb6d922afc76..e9a7f66eae860 100644 --- a/tests/kernel/workq/work_queue/src/main.c +++ b/tests/kernel/workq/work_queue/src/main.c @@ -107,7 +107,7 @@ static void test_items_submit(void) k_thread_create(&co_op_data, co_op_stack, STACK_SIZE, (k_thread_entry_t)coop_work_main, - NULL, NULL, NULL, K_PRIO_COOP(10), 0, 0); + NULL, NULL, NULL, K_PRIO_COOP(10), 0, K_NO_WAIT); for (i = 0; i < NUM_TEST_ITEMS; i += 2) { TC_PRINT(" - Submitting work %d from preempt thread\n", i + 1); @@ -236,7 +236,7 @@ static void coop_delayed_work_main(int arg1, int arg2) TC_PRINT(" - Submitting delayed work %d from" " coop thread\n", i + 1); k_delayed_work_submit(&tests[i].work, - (i + 1) * WORK_ITEM_WAIT); + K_TIMEOUT_MS((i + 1) * WORK_ITEM_WAIT)); } } @@ -253,13 +253,15 @@ static void test_delayed_submit(void) k_thread_create(&co_op_data, co_op_stack, STACK_SIZE, (k_thread_entry_t)coop_delayed_work_main, - NULL, NULL, NULL, K_PRIO_COOP(10), 0, 0); + NULL, NULL, NULL, K_PRIO_COOP(10), 0, K_NO_WAIT); for (i = 0; i < NUM_TEST_ITEMS; i += 2) { + k_timeout_t timeout = K_TIMEOUT_MS((i + 1) * WORK_ITEM_WAIT); + TC_PRINT(" - Submitting delayed work %d from" " preempt thread\n", i + 1); zassert_true(k_delayed_work_submit(&tests[i].work, - (i + 1) * WORK_ITEM_WAIT) == 0, NULL); + timeout) == 0, NULL); } } @@ -269,13 +271,13 @@ static void coop_delayed_work_cancel_main(int arg1, int arg2) ARG_UNUSED(arg1); ARG_UNUSED(arg2); - k_delayed_work_submit(&tests[1].work, WORK_ITEM_WAIT); + k_delayed_work_submit(&tests[1].work, K_TIMEOUT_MS(WORK_ITEM_WAIT)); TC_PRINT(" - Cancel delayed work from coop thread\n"); k_delayed_work_cancel(&tests[1].work); #if defined(CONFIG_POLL) - k_delayed_work_submit(&tests[2].work, 0 /* Submit immediately */); + k_delayed_work_submit(&tests[2].work, K_NO_WAIT); TC_PRINT(" - Cancel pending delayed work from coop thread\n"); k_delayed_work_cancel(&tests[2].work); @@ -294,14 +296,14 @@ static void test_delayed_cancel(void) { TC_PRINT("Starting delayed cancel test\n"); - k_delayed_work_submit(&tests[0].work, WORK_ITEM_WAIT); + k_delayed_work_submit(&tests[0].work, K_TIMEOUT_MS(WORK_ITEM_WAIT)); TC_PRINT(" - Cancel delayed work from preempt thread\n"); k_delayed_work_cancel(&tests[0].work); k_thread_create(&co_op_data, co_op_stack, STACK_SIZE, (k_thread_entry_t)coop_delayed_work_cancel_main, - NULL, NULL, NULL, K_HIGHEST_THREAD_PRIO, 0, 0); + NULL, NULL, NULL, K_HIGHEST_THREAD_PRIO, 0, K_NO_WAIT); TC_PRINT(" - Waiting for work to finish\n"); k_sleep(WORK_ITEM_WAIT_ALIGNED); @@ -319,7 +321,7 @@ static void delayed_resubmit_work_handler(struct k_work *work) if (ti->key < NUM_TEST_ITEMS) { ti->key++; TC_PRINT(" - Resubmitting delayed work\n"); - k_delayed_work_submit(&ti->work, WORK_ITEM_WAIT); + k_delayed_work_submit(&ti->work, K_TIMEOUT_MS(WORK_ITEM_WAIT)); } } @@ -338,7 +340,7 @@ static void test_delayed_resubmit(void) k_delayed_work_init(&tests[0].work, delayed_resubmit_work_handler); TC_PRINT(" - Submitting delayed work\n"); - k_delayed_work_submit(&tests[0].work, WORK_ITEM_WAIT); + k_delayed_work_submit(&tests[0].work, K_TIMEOUT_MS(WORK_ITEM_WAIT)); TC_PRINT(" - Waiting for work to finish\n"); k_sleep(CHECK_WAIT); @@ -354,7 +356,7 @@ static void coop_delayed_work_resubmit(void) for (i = 0; i < NUM_TEST_ITEMS; i++) { TC_PRINT(" - Resubmitting delayed work with 1 ms\n"); - k_delayed_work_submit(&tests[0].work, 1); + k_delayed_work_submit(&tests[0].work, K_TIMEOUT_MS(1)); /* Busy wait 1 ms to force a clash with workqueue */ #if defined(CONFIG_ARCH_POSIX) @@ -385,7 +387,7 @@ static void test_delayed_resubmit_thread(void) k_thread_create(&co_op_data, co_op_stack, STACK_SIZE, (k_thread_entry_t)coop_delayed_work_resubmit, - NULL, NULL, NULL, K_PRIO_COOP(10), 0, 0); + NULL, NULL, NULL, K_PRIO_COOP(10), 0, K_NO_WAIT); TC_PRINT(" - Waiting for work to finish\n"); k_sleep(WORK_ITEM_WAIT_ALIGNED); diff --git a/tests/kernel/workq/work_queue_api/src/main.c b/tests/kernel/workq/work_queue_api/src/main.c index 660e4fb75a210..ab89af246bd89 100644 --- a/tests/kernel/workq/work_queue_api/src/main.c +++ b/tests/kernel/workq/work_queue_api/src/main.c @@ -76,9 +76,9 @@ static void twork_submit_multipleq(void *data) /**TESTPOINT: init via k_work_init*/ k_delayed_work_init(&new_work, new_work_handler); - k_delayed_work_submit_to_queue(work_q, &new_work, TIMEOUT); + k_delayed_work_submit_to_queue(work_q, &new_work, K_TIMEOUT_MS(TIMEOUT)); - zassert_equal(k_delayed_work_submit(&new_work, TIMEOUT), + zassert_equal(k_delayed_work_submit(&new_work, K_TIMEOUT_MS(TIMEOUT)), -EADDRINUSE, NULL); k_sem_give(&sync_sema); @@ -91,7 +91,7 @@ static void twork_resubmit(void *data) /**TESTPOINT: init via k_work_init*/ k_delayed_work_init(&new_work, new_work_handler); - k_delayed_work_submit_to_queue(work_q, &new_work, 0); + k_delayed_work_submit_to_queue(work_q, &new_work, K_NO_WAIT); /* This is done to test a neagtive case when k_delayed_work_cancel() * fails in k_delayed_work_submit_to_queue API. Removing work from it @@ -100,7 +100,8 @@ static void twork_resubmit(void *data) */ k_queue_remove(&(new_work.work_q->queue), &(new_work.work)); - zassert_equal(k_delayed_work_submit_to_queue(work_q, &new_work, 0), + zassert_equal(k_delayed_work_submit_to_queue(work_q, &new_work, + K_NO_WAIT), -EINVAL, NULL); k_sem_give(&sync_sema); @@ -124,11 +125,12 @@ static void tdelayed_work_submit(void *data) if (work_q) { /**TESTPOINT: delayed work submit to queue*/ zassert_true(k_delayed_work_submit_to_queue(work_q, - &delayed_work[i], TIMEOUT) == 0, NULL); + &delayed_work[i], K_TIMEOUT_MS(TIMEOUT)) == 0, NULL); } else { /**TESTPOINT: delayed work submit to system queue*/ zassert_true(k_delayed_work_submit(&delayed_work[i], - TIMEOUT) == 0, NULL); + K_TIMEOUT_MS(TIMEOUT)) + == 0, NULL); } time_remaining = k_delayed_work_remaining_get(&delayed_work[i]); @@ -156,16 +158,20 @@ static void tdelayed_work_cancel(void *data) if (work_q) { ret = k_delayed_work_submit_to_queue(work_q, - &delayed_work_sleepy, TIMEOUT); + &delayed_work_sleepy, + K_TIMEOUT_MS(TIMEOUT)); ret |= k_delayed_work_submit_to_queue(work_q, &delayed_work[0], - TIMEOUT); + K_TIMEOUT_MS(TIMEOUT)); ret |= k_delayed_work_submit_to_queue(work_q, &delayed_work[1], - TIMEOUT); + K_TIMEOUT_MS(TIMEOUT)); } else { - ret = k_delayed_work_submit(&delayed_work_sleepy, TIMEOUT); - ret |= k_delayed_work_submit(&delayed_work[0], TIMEOUT); - ret |= k_delayed_work_submit(&delayed_work[1], TIMEOUT); - } + ret = k_delayed_work_submit(&delayed_work_sleepy, + K_TIMEOUT_MS(TIMEOUT)); + ret |= k_delayed_work_submit(&delayed_work[0], + K_TIMEOUT_MS(TIMEOUT)); + ret |= k_delayed_work_submit(&delayed_work[1], + K_TIMEOUT_MS(TIMEOUT)); +} /* * t0: delayed submit three work items, all with delay=TIMEOUT * >t0: cancel delayed_work[0], expected cancellation success From 83bd6ffed4c90990ceadd60cd1d3199202c0b0fb Mon Sep 17 00:00:00 2001 From: Andy Ross Date: Sun, 28 Jul 2019 06:34:02 -0700 Subject: [PATCH 06/19] tests/kernel/interrupt: Correct timing usage This tests hard codes a 100 Hz tick rate, but it sets a k_timer for a DURATION value of 5ms, which cannot be done with a precision, then checks it against an unrelated k_busy_wait() time of exactly 10ms, which is right at the boundary of what is possible. Playing with timer stuff can push this over the edge easily. Correct DURATION to reflect "one tick", and spin for that value, plus exactly one tick of slop before testing to see whether the timer ISR ran. Signed-off-by: Andy Ross --- tests/kernel/interrupt/src/nested_irq.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/kernel/interrupt/src/nested_irq.c b/tests/kernel/interrupt/src/nested_irq.c index 8f539b4b658aa..323682978f805 100644 --- a/tests/kernel/interrupt/src/nested_irq.c +++ b/tests/kernel/interrupt/src/nested_irq.c @@ -5,7 +5,7 @@ */ #include "interrupt.h" -#define DURATION 5 +#define DURATION 10 struct k_timer timer; /* This tests uses two IRQ lines, selected within the range of IRQ lines @@ -74,7 +74,7 @@ void isr0(void *param) { ARG_UNUSED(param); printk("%s running !!\n", __func__); - k_busy_wait(MS_TO_US(10)); + k_busy_wait(DURATION * 1000 + (int)k_ticks_to_us_ceil64(1)); printk("%s execution completed !!\n", __func__); zassert_equal(new_val, old_val, "Nested interrupt is not working\n"); } From cba24b29e39333a611bfdb59561670531cbe413b Mon Sep 17 00:00:00 2001 From: Andy Ross Date: Sun, 28 Jul 2019 07:33:22 -0700 Subject: [PATCH 07/19] tests/kernel/fatal: Fix clobbered k_timer The tests all share a stack, so by putting the k_timer on the stack we're potentially allowing it to be clobbered by a following test before it expires. Make it static. Oddly this "worked" when written, becuase it initialized the timer after the stack clobber, even though the rest of the stack was already garbage, and because the timing just happened to expire before the next test got to it. Mucking around with timeout expirations exposed the bug. Signed-off-by: Andy Ross --- tests/kernel/fatal/src/main.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/kernel/fatal/src/main.c b/tests/kernel/fatal/src/main.c index eddcf568c1826..b0fef5b68620d 100644 --- a/tests/kernel/fatal/src/main.c +++ b/tests/kernel/fatal/src/main.c @@ -169,7 +169,9 @@ void stack_sentinel_timer(void) { /* We need to guarantee that we receive an interrupt, so set a * k_timer and spin until we die. Spinning alone won't work - * on a tickless kernel. + * on a tickless kernel. Note static: we can't place it on + * our stack, because it can be clobbered by the next test + * before it expires! */ static struct k_timer timer; From 513c04992e77aacbdf407b61d37a4a1d4145b47c Mon Sep 17 00:00:00 2001 From: Andy Ross Date: Mon, 29 Jul 2019 10:51:30 -0700 Subject: [PATCH 08/19] tests/kernel/timer/timer_api: Use CONFIG_SYS_TIMEOUT_64BIT At least one test should be running in this mode for coverage reasons (semantic coverage, not line coverage -- there are no lines that change between the two modes, just type sizes). This is the one with the greatest breadth of timeout API usage. Signed-off-by: Andy Ross --- tests/kernel/timer/timer_api/prj.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/kernel/timer/timer_api/prj.conf b/tests/kernel/timer/timer_api/prj.conf index 45f8b25f05b60..c9ed9649823ed 100644 --- a/tests/kernel/timer/timer_api/prj.conf +++ b/tests/kernel/timer/timer_api/prj.conf @@ -1,5 +1,5 @@ CONFIG_ZTEST=y CONFIG_QEMU_TICKLESS_WORKAROUND=y CONFIG_TEST_USERSPACE=y - CONFIG_MP_NUM_CPUS=1 +CONFIG_SYS_TIMEOUT_64BIT=y From 256e0b01f9086b5ee8d1fd3d0d997a7abdb2bb3d Mon Sep 17 00:00:00 2001 From: Andy Ross Date: Mon, 29 Jul 2019 12:58:44 -0700 Subject: [PATCH 09/19] tests: samples: Mark non-kernel tests with CONFIG_SYS_TIMEOUT_LEGACY_API The kernel tests all use the new API conventions (with typesafe timeout/delay arguments supporting multiple units). Let's leave the auxilliary ones on the legacy API (integer millisecond delays) for a release so we have good coverage of both modes. Signed-off-by: Andy Ross --- include/sys/mutex.h | 1 + samples/basic/threads/prj.conf | 1 + samples/bluetooth/beacon/prj.conf | 1 + samples/bluetooth/central/prj.conf | 1 + samples/bluetooth/eddystone/prj.conf | 1 + samples/bluetooth/handsfree/prj.conf | 1 + samples/bluetooth/peripheral/prj.conf | 1 + samples/bluetooth/peripheral_csc/prj.conf | 1 + samples/bluetooth/peripheral_dis/prj.conf | 1 + samples/bluetooth/peripheral_esp/prj.conf | 1 + samples/bluetooth/peripheral_hids/prj.conf | 1 + samples/bluetooth/peripheral_hr/prj.conf | 1 + samples/bluetooth/peripheral_ht/prj.conf | 1 + samples/bluetooth/peripheral_sc_only/prj.conf | 1 + samples/bluetooth/scan_adv/prj.conf | 1 + samples/boards/96b_argonkey/microphone/prj.conf | 1 + samples/boards/arc_secure_services/prj.conf | 1 + samples/boards/bbc_microbit/display/prj.conf | 1 + samples/boards/bbc_microbit/sound/prj.conf | 1 + samples/boards/nrf52/power_mgr/prj.conf | 1 + samples/boards/nrf52/power_mgr/prj_tickless.conf | 1 + samples/boards/up_squared/gpio_counter/prj.conf | 1 + samples/cpp_synchronization/prj.conf | 1 + samples/drivers/CAN/prj.conf | 1 + samples/drivers/counter/alarm/prj.conf | 1 + samples/drivers/flash_shell/prj.conf | 1 + samples/drivers/gpio/prj.conf | 1 + samples/drivers/ht16k33/prj.conf | 1 + samples/drivers/led_apa102/prj.conf | 1 + samples/drivers/led_lp3943/prj.conf | 1 + samples/drivers/led_lp5562/prj.conf | 1 + samples/drivers/led_lpd8806/prj.conf | 1 + samples/drivers/led_pca9633/prj.conf | 1 + samples/drivers/led_ws2812/prj.conf | 1 + samples/net/dhcpv4_client/overlay-e1000.conf | 1 + samples/net/dhcpv4_client/prj.conf | 1 + samples/net/dns_resolve/prj.conf | 1 + samples/net/eth_native_posix/net_setup_host.conf | 1 + samples/net/eth_native_posix/prj.conf | 1 + samples/net/gptp/prj.conf | 1 + samples/net/ipv4_autoconf/prj.conf | 1 + samples/net/lldp/prj.conf | 1 + samples/net/nats/prj.conf | 1 + samples/net/promiscuous_mode/prj.conf | 1 + samples/net/sockets/echo/prj.conf | 1 + samples/net/sockets/echo_server/overlay-802154.conf | 1 + samples/net/sockets/echo_server/overlay-bt.conf | 1 + samples/net/sockets/echo_server/overlay-cc2520.conf | 1 + samples/net/sockets/echo_server/overlay-e1000.conf | 1 + samples/net/sockets/echo_server/overlay-netusb.conf | 1 + samples/net/sockets/echo_server/overlay-ot.conf | 2 ++ samples/net/sockets/echo_server/overlay-qemu_802154.conf | 1 + .../net/sockets/echo_server/overlay-qemu_cortex_m3_eth.conf | 1 + samples/net/sockets/echo_server/overlay-smsc911x.conf | 1 + samples/net/sockets/echo_server/overlay-tls.conf | 1 + samples/net/sockets/echo_server/overlay-vlan.conf | 1 + samples/net/sockets/echo_server/prj.conf | 2 ++ samples/net/sockets/net_mgmt/prj.conf | 1 + samples/net/sockets/packet/prj.conf | 1 + samples/net/stats/prj.conf | 1 + samples/net/syslog_net/prj.conf | 1 + samples/net/telnet/prj.conf | 1 + samples/net/vlan/prj.conf | 1 + samples/portability/cmsis_rtos_v1/philosophers/prj.conf | 1 + .../portability/cmsis_rtos_v1/timer_synchronization/prj.conf | 2 ++ samples/portability/cmsis_rtos_v2/philosophers/prj.conf | 1 + .../portability/cmsis_rtos_v2/timer_synchronization/prj.conf | 1 + samples/sensor/fxas21002/prj.conf | 1 + samples/sensor/fxos8700-hid/prj.conf | 1 + samples/sensor/fxos8700/overlay-motion.conf | 1 + samples/sensor/fxos8700/prj.conf | 1 + samples/sensor/fxos8700/prj_accel.conf | 1 + samples/sensor/grove_light/prj.conf | 1 + samples/sensor/grove_temperature/prj.conf | 1 + samples/sensor/ti_hdc/prj.conf | 1 + samples/subsys/console/echo/prj.conf | 1 + samples/subsys/console/getchar/prj.conf | 1 + samples/subsys/fs/fat_fs/prj.conf | 1 + samples/subsys/fs/fat_fs/prj_mimxrt1050_evk.conf | 1 + samples/subsys/ipc/openamp/prj.conf | 1 + samples/subsys/ipc/openamp/remote/src/main.c | 2 +- samples/subsys/shell/shell_module/prj.conf | 1 + samples/subsys/shell/shell_module/prj_minimal.conf | 1 + samples/subsys/shell/shell_module/prj_minimal_rtt.conf | 1 + samples/subsys/usb/cdc_acm/overlay-composite-cdc-dfu.conf | 2 ++ samples/subsys/usb/cdc_acm/overlay-composite-cdc-msc.conf | 2 ++ samples/subsys/usb/cdc_acm/prj.conf | 2 ++ samples/subsys/usb/cdc_acm_composite/prj.conf | 1 + samples/subsys/usb/console/prj.conf | 1 + samples/subsys/usb/hid-cdc/prj.conf | 1 + samples/subsys/usb/hid-mouse/prj.conf | 1 + samples/subsys/usb/hid/prj.conf | 2 ++ samples/subsys/usb/mass/overlay-flash-disk.conf | 1 + samples/subsys/usb/mass/overlay-ram-disk.conf | 1 + samples/subsys/usb/mass/prj.conf | 1 + samples/subsys/usb/mass/prj_nrf52840_pca10056.conf | 1 + samples/subsys/usb/testusb/prj.conf | 1 + samples/subsys/usb/webusb/prj.conf | 1 + samples/synchronization/prj.conf | 1 + subsys/net/Kconfig | 1 + tests/application_development/cpp/prj.conf | 1 + tests/arch/arm/arm_runtime_nmi/prj.conf | 2 +- tests/benchmarks/app_kernel/prj.conf | 1 + tests/benchmarks/app_kernel/prj_fp.conf | 1 + tests/benchmarks/latency_measure/prj.conf | 1 + tests/benchmarks/sys_kernel/prj.conf | 1 + tests/benchmarks/timing_info/prj.conf | 1 + tests/benchmarks/timing_info/prj_userspace.conf | 1 + tests/bluetooth/at/prj.conf | 1 + tests/bluetooth/bluetooth/prj.conf | 1 + tests/bluetooth/gatt/prj.conf | 1 + tests/bluetooth/hci_prop_evt/prj.conf | 1 + tests/bluetooth/init/prj.conf | 1 + tests/bluetooth/init/prj_0.conf | 1 + tests/bluetooth/init/prj_1.conf | 1 + tests/bluetooth/init/prj_10.conf | 1 + tests/bluetooth/init/prj_11.conf | 1 + tests/bluetooth/init/prj_12.conf | 1 + tests/bluetooth/init/prj_13.conf | 1 + tests/bluetooth/init/prj_14.conf | 1 + tests/bluetooth/init/prj_15.conf | 1 + tests/bluetooth/init/prj_16.conf | 1 + tests/bluetooth/init/prj_17.conf | 1 + tests/bluetooth/init/prj_18.conf | 1 + tests/bluetooth/init/prj_19.conf | 1 + tests/bluetooth/init/prj_2.conf | 1 + tests/bluetooth/init/prj_20.conf | 1 + tests/bluetooth/init/prj_21.conf | 1 + tests/bluetooth/init/prj_22.conf | 1 + tests/bluetooth/init/prj_3.conf | 1 + tests/bluetooth/init/prj_4.conf | 1 + tests/bluetooth/init/prj_5.conf | 1 + tests/bluetooth/init/prj_6.conf | 1 + tests/bluetooth/init/prj_7.conf | 1 + tests/bluetooth/init/prj_8.conf | 1 + tests/bluetooth/init/prj_9.conf | 1 + tests/bluetooth/init/prj_controller.conf | 1 + tests/bluetooth/init/prj_controller_4_0.conf | 1 + tests/bluetooth/init/prj_controller_4_0_ll_sw_split.conf | 1 + tests/bluetooth/init/prj_controller_dbg.conf | 1 + tests/bluetooth/init/prj_controller_dbg_ll_sw_split.conf | 1 + tests/bluetooth/init/prj_controller_ll_sw_split.conf | 1 + tests/bluetooth/init/prj_controller_tiny.conf | 1 + tests/bluetooth/init/prj_controller_tiny_ll_sw_split.conf | 1 + tests/bluetooth/init/prj_h5.conf | 1 + tests/bluetooth/init/prj_h5_dbg.conf | 1 + tests/bluetooth/l2cap/prj.conf | 1 + tests/bluetooth/mesh_shell/prj.conf | 1 + tests/bluetooth/shell/mesh.conf | 1 + tests/bluetooth/shell/prj.conf | 1 + tests/bluetooth/shell/prj_br.conf | 1 + tests/bluetooth/uuid/prj.conf | 1 + tests/drivers/adc/adc_api/prj.conf | 1 + tests/drivers/build_all/drivers.conf | 5 +++++ tests/drivers/build_all/ethernet.conf | 5 +++++ tests/drivers/build_all/gpio.conf | 5 +++++ tests/drivers/build_all/prj.conf | 5 +++++ tests/drivers/build_all/sensors_a_h.conf | 5 +++++ tests/drivers/build_all/sensors_i_z.conf | 5 +++++ tests/drivers/build_all/sensors_stmemsc.conf | 5 +++++ tests/drivers/build_all/sensors_stmemsc_trigger.conf | 5 +++++ tests/drivers/build_all/sensors_trigger_a_h.conf | 5 +++++ tests/drivers/build_all/sensors_trigger_i_z.conf | 5 +++++ tests/drivers/can/api/prj.conf | 1 + tests/drivers/can/stm32/prj.conf | 1 + tests/drivers/ipm/prj.conf | 1 + tests/drivers/spi/spi_loopback/prj.conf | 1 + tests/drivers/uart/uart_async_api/prj.conf | 1 + tests/drivers/uart/uart_basic_api/prj.conf | 1 + tests/drivers/uart/uart_basic_api/prj_poll.conf | 1 + tests/drivers/uart/uart_basic_api/prj_shell.conf | 1 + tests/lib/fdtable/prj.conf | 1 + tests/misc/test_build/debug.conf | 1 + tests/misc/test_build/src/main.c | 2 +- tests/net/6lo/prj.conf | 1 + tests/net/arp/prj.conf | 1 + tests/net/buf/prj.conf | 1 + tests/net/checksum_offload/prj.conf | 1 + tests/net/context/prj.conf | 1 + tests/net/dhcpv4/prj.conf | 1 + tests/net/ethernet_mgmt/prj.conf | 1 + tests/net/icmpv6/prj.conf | 1 + tests/net/iface/prj.conf | 1 + tests/net/ip-addr/prj.conf | 1 + tests/net/ipv6/prj.conf | 1 + tests/net/ipv6_fragment/prj.conf | 1 + tests/net/lib/coap/prj.conf | 1 + tests/net/lib/dns_addremove/prj.conf | 1 + tests/net/lib/dns_packet/prj.conf | 1 + tests/net/lib/dns_resolve/prj-no-ipv6.conf | 1 + tests/net/lib/dns_resolve/prj.conf | 1 + tests/net/lib/http_header_fields/prj.conf | 1 + tests/net/lib/mqtt_packet/prj.conf | 1 + tests/net/lib/mqtt_publisher/prj.conf | 1 + tests/net/lib/mqtt_publisher/prj_tls.conf | 1 + tests/net/lib/mqtt_pubsub/prj.conf | 1 + tests/net/lib/mqtt_subscriber/prj.conf | 1 + tests/net/lib/tls_credentials/prj.conf | 1 + tests/net/mgmt/prj.conf | 1 + tests/net/mld/prj.conf | 1 + tests/net/neighbor/prj.conf | 1 + tests/net/net_pkt/prj.conf | 1 + tests/net/promiscuous/prj.conf | 1 + tests/net/ptp/clock/prj.conf | 1 + tests/net/route/prj.conf | 1 + tests/net/socket/getaddrinfo/prj.conf | 1 + tests/net/socket/getnameinfo/prj.conf | 1 + tests/net/socket/misc/prj.conf | 1 + tests/net/socket/net_mgmt/prj.conf | 1 + tests/net/socket/poll/prj.conf | 2 ++ tests/net/socket/register/prj.conf | 1 + tests/net/socket/select/prj.conf | 1 + tests/net/socket/tcp/prj.conf | 1 + tests/net/socket/udp/prj.conf | 1 + tests/net/tcp/prj.conf | 1 + tests/net/traffic_class/prj.conf | 1 + tests/net/trickle/prj.conf | 1 + tests/net/tx_timestamp/prj.conf | 1 + tests/net/udp/prj.conf | 1 + tests/net/utils/prj.conf | 1 + tests/net/vlan/prj.conf | 1 + tests/portability/cmsis_rtos_v1/prj.conf | 1 + tests/portability/cmsis_rtos_v2/prj.conf | 1 + tests/posix/common/prj.conf | 1 + tests/posix/fs/prj.conf | 1 + tests/shell/prj.conf | 1 + tests/subsys/fs/littlefs/prj.conf | 1 + tests/subsys/jwt/prj.conf | 1 + tests/subsys/shell/shell_history/prj.conf | 1 + tests/subsys/usb/bos/prj.conf | 1 + tests/subsys/usb/desc_sections/prj.conf | 1 + tests/subsys/usb/device/prj.conf | 1 + tests/subsys/usb/os_desc/prj.conf | 1 + 233 files changed, 281 insertions(+), 3 deletions(-) diff --git a/include/sys/mutex.h b/include/sys/mutex.h index 7c700600c41f4..5222980b3f0f0 100644 --- a/include/sys/mutex.h +++ b/include/sys/mutex.h @@ -19,6 +19,7 @@ #ifdef CONFIG_USERSPACE #include #include +#include struct sys_mutex { /* Currently unused, but will be used to store state for fast mutexes diff --git a/samples/basic/threads/prj.conf b/samples/basic/threads/prj.conf index 1848bb85d7fa1..f7902a91f7162 100644 --- a/samples/basic/threads/prj.conf +++ b/samples/basic/threads/prj.conf @@ -2,3 +2,4 @@ CONFIG_PRINTK=y CONFIG_HEAP_MEM_POOL_SIZE=256 CONFIG_ASSERT=y CONFIG_GPIO=y +CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/samples/bluetooth/beacon/prj.conf b/samples/bluetooth/beacon/prj.conf index 1d6745c7942bb..325c40c069d67 100644 --- a/samples/bluetooth/beacon/prj.conf +++ b/samples/bluetooth/beacon/prj.conf @@ -1,3 +1,4 @@ CONFIG_BT=y CONFIG_BT_DEBUG_LOG=y CONFIG_BT_DEVICE_NAME="Test beacon" +CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/samples/bluetooth/central/prj.conf b/samples/bluetooth/central/prj.conf index 3e36a9993858f..a076b8b950c40 100644 --- a/samples/bluetooth/central/prj.conf +++ b/samples/bluetooth/central/prj.conf @@ -1,2 +1,3 @@ CONFIG_BT=y CONFIG_BT_CENTRAL=y +CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/samples/bluetooth/eddystone/prj.conf b/samples/bluetooth/eddystone/prj.conf index 2ae4f32a0f20b..e9a8dbd826978 100644 --- a/samples/bluetooth/eddystone/prj.conf +++ b/samples/bluetooth/eddystone/prj.conf @@ -2,3 +2,4 @@ CONFIG_BT=y CONFIG_BT_DEBUG_LOG=y CONFIG_BT_PERIPHERAL=y CONFIG_BT_DEVICE_NAME="Zephyr Eddystone" +CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/samples/bluetooth/handsfree/prj.conf b/samples/bluetooth/handsfree/prj.conf index ce7e742f10b89..0d19d79bb78e4 100644 --- a/samples/bluetooth/handsfree/prj.conf +++ b/samples/bluetooth/handsfree/prj.conf @@ -4,3 +4,4 @@ CONFIG_BT_RFCOMM=y CONFIG_BT_HFP_HF=y CONFIG_BT_PERIPHERAL=y CONFIG_BT_DEVICE_NAME="test-Handsfree" +CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/samples/bluetooth/peripheral/prj.conf b/samples/bluetooth/peripheral/prj.conf index 9c3d5385ea355..1d9a6c4056975 100644 --- a/samples/bluetooth/peripheral/prj.conf +++ b/samples/bluetooth/peripheral/prj.conf @@ -23,3 +23,4 @@ CONFIG_FLASH_MAP=y CONFIG_FCB=y CONFIG_SETTINGS=y CONFIG_SETTINGS_FCB=y +CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/samples/bluetooth/peripheral_csc/prj.conf b/samples/bluetooth/peripheral_csc/prj.conf index aa6ca4a3af5ae..602d5a2cbb37f 100644 --- a/samples/bluetooth/peripheral_csc/prj.conf +++ b/samples/bluetooth/peripheral_csc/prj.conf @@ -7,3 +7,4 @@ CONFIG_BT_GATT_DIS_PNP=n CONFIG_BT_GATT_BAS=y CONFIG_BT_DEVICE_NAME="CSC peripheral" CONFIG_BT_DEVICE_APPEARANCE=1157 +CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/samples/bluetooth/peripheral_dis/prj.conf b/samples/bluetooth/peripheral_dis/prj.conf index 137471d8f9723..57779b81a9c92 100644 --- a/samples/bluetooth/peripheral_dis/prj.conf +++ b/samples/bluetooth/peripheral_dis/prj.conf @@ -24,3 +24,4 @@ CONFIG_BT_SETTINGS=y CONFIG_BT_GATT_DIS_SETTINGS=y CONFIG_BT_GATT_DIS_STR_MAX=21 +CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/samples/bluetooth/peripheral_esp/prj.conf b/samples/bluetooth/peripheral_esp/prj.conf index 4c0306c3d2e2f..23bda186a8d9d 100644 --- a/samples/bluetooth/peripheral_esp/prj.conf +++ b/samples/bluetooth/peripheral_esp/prj.conf @@ -7,3 +7,4 @@ CONFIG_BT_GATT_DIS=y CONFIG_BT_GATT_DIS_PNP=n CONFIG_BT_GATT_BAS=y CONFIG_BT_DEVICE_APPEARANCE=768 +CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/samples/bluetooth/peripheral_hids/prj.conf b/samples/bluetooth/peripheral_hids/prj.conf index b158bb8b2fea4..3b3519b850260 100644 --- a/samples/bluetooth/peripheral_hids/prj.conf +++ b/samples/bluetooth/peripheral_hids/prj.conf @@ -17,3 +17,4 @@ CONFIG_FLASH_MAP=y CONFIG_FCB=y CONFIG_SETTINGS=y CONFIG_SETTINGS_FCB=y +CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/samples/bluetooth/peripheral_hr/prj.conf b/samples/bluetooth/peripheral_hr/prj.conf index 3dfa8796b8cc8..f8e01dad8bf40 100644 --- a/samples/bluetooth/peripheral_hr/prj.conf +++ b/samples/bluetooth/peripheral_hr/prj.conf @@ -8,3 +8,4 @@ CONFIG_BT_GATT_BAS=y CONFIG_BT_GATT_HRS=y CONFIG_BT_DEVICE_NAME="Zephyr Heartrate Sensor" CONFIG_BT_DEVICE_APPEARANCE=833 +CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/samples/bluetooth/peripheral_ht/prj.conf b/samples/bluetooth/peripheral_ht/prj.conf index 3e6cdfeafad92..7f23bcd53081e 100644 --- a/samples/bluetooth/peripheral_ht/prj.conf +++ b/samples/bluetooth/peripheral_ht/prj.conf @@ -8,3 +8,4 @@ CONFIG_BT_GATT_BAS=y CONFIG_BT_DEVICE_NAME="Zephyr Health Thermometer" CONFIG_BT_DEVICE_APPEARANCE=768 CONFIG_BT_ATT_ENFORCE_FLOW=n +CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/samples/bluetooth/peripheral_sc_only/prj.conf b/samples/bluetooth/peripheral_sc_only/prj.conf index 166454b23f218..4f6865afc8ad9 100644 --- a/samples/bluetooth/peripheral_sc_only/prj.conf +++ b/samples/bluetooth/peripheral_sc_only/prj.conf @@ -10,3 +10,4 @@ CONFIG_BT_SMP_SC_ONLY=y CONFIG_BT_TINYCRYPT_ECC=y CONFIG_BT_MAX_PAIRED=2 CONFIG_BT_DEVICE_NAME="SC only peripheral" +CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/samples/bluetooth/scan_adv/prj.conf b/samples/bluetooth/scan_adv/prj.conf index 26db96e63345d..d2d944610ebb8 100644 --- a/samples/bluetooth/scan_adv/prj.conf +++ b/samples/bluetooth/scan_adv/prj.conf @@ -2,3 +2,4 @@ CONFIG_BT=y CONFIG_BT_BROADCASTER=y CONFIG_BT_OBSERVER=y CONFIG_BT_DEBUG_LOG=y +CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/samples/boards/96b_argonkey/microphone/prj.conf b/samples/boards/96b_argonkey/microphone/prj.conf index d41b64e7af115..f13f50cdd9b72 100644 --- a/samples/boards/96b_argonkey/microphone/prj.conf +++ b/samples/boards/96b_argonkey/microphone/prj.conf @@ -14,3 +14,4 @@ CONFIG_AUDIO_MPXXDTYY=y CONFIG_DMA=y CONFIG_DMA_0_IRQ_PRI=0 +CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/samples/boards/arc_secure_services/prj.conf b/samples/boards/arc_secure_services/prj.conf index e69de29bb2d1d..57df03ddd94c3 100644 --- a/samples/boards/arc_secure_services/prj.conf +++ b/samples/boards/arc_secure_services/prj.conf @@ -0,0 +1 @@ +CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/samples/boards/bbc_microbit/display/prj.conf b/samples/boards/bbc_microbit/display/prj.conf index 76f2b8952b504..711bafb9184a6 100644 --- a/samples/boards/bbc_microbit/display/prj.conf +++ b/samples/boards/bbc_microbit/display/prj.conf @@ -2,3 +2,4 @@ CONFIG_GPIO=y CONFIG_DISPLAY=y CONFIG_MICROBIT_DISPLAY=y +CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/samples/boards/bbc_microbit/sound/prj.conf b/samples/boards/bbc_microbit/sound/prj.conf index 2bce0fda2c3ed..2c045fb281c42 100644 --- a/samples/boards/bbc_microbit/sound/prj.conf +++ b/samples/boards/bbc_microbit/sound/prj.conf @@ -3,3 +3,4 @@ CONFIG_DISPLAY=y CONFIG_MICROBIT_DISPLAY=y CONFIG_PWM=y CONFIG_PWM_NRF5_SW=y +CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/samples/boards/nrf52/power_mgr/prj.conf b/samples/boards/nrf52/power_mgr/prj.conf index 1c395979a814f..0ba0c3c0171cd 100644 --- a/samples/boards/nrf52/power_mgr/prj.conf +++ b/samples/boards/nrf52/power_mgr/prj.conf @@ -8,3 +8,4 @@ CONFIG_SYS_PM_STATE_LOCK=y CONFIG_SYS_PM_MIN_RESIDENCY_SLEEP_1=5000 CONFIG_SYS_PM_MIN_RESIDENCY_SLEEP_2=15000 CONFIG_GPIO=y +CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/samples/boards/nrf52/power_mgr/prj_tickless.conf b/samples/boards/nrf52/power_mgr/prj_tickless.conf index 5186d5ad52977..2998bb68e543d 100644 --- a/samples/boards/nrf52/power_mgr/prj_tickless.conf +++ b/samples/boards/nrf52/power_mgr/prj_tickless.conf @@ -10,3 +10,4 @@ CONFIG_PM_CONTROL_STATE_LOCK=y CONFIG_PM_LPS_1_MIN_RES=5 CONFIG_PM_LPS_2_MIN_RES=15 CONFIG_GPIO=y +CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/samples/boards/up_squared/gpio_counter/prj.conf b/samples/boards/up_squared/gpio_counter/prj.conf index 91c3c15b37d1e..03e18ec4c078e 100644 --- a/samples/boards/up_squared/gpio_counter/prj.conf +++ b/samples/boards/up_squared/gpio_counter/prj.conf @@ -1 +1,2 @@ CONFIG_GPIO=y +CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/samples/cpp_synchronization/prj.conf b/samples/cpp_synchronization/prj.conf index fa7da8057923e..3f53e0fdc61d7 100644 --- a/samples/cpp_synchronization/prj.conf +++ b/samples/cpp_synchronization/prj.conf @@ -1 +1,2 @@ CONFIG_CPLUSPLUS=y +CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/samples/drivers/CAN/prj.conf b/samples/drivers/CAN/prj.conf index 448dfc2c010cf..e8c78a92ae845 100644 --- a/samples/drivers/CAN/prj.conf +++ b/samples/drivers/CAN/prj.conf @@ -5,3 +5,4 @@ CONFIG_CAN_MAX_FILTER=5 CONFIG_SHELL=y CONFIG_CAN_SHELL=y CONFIG_DEVICE_SHELL=y +CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/samples/drivers/counter/alarm/prj.conf b/samples/drivers/counter/alarm/prj.conf index 9d51e5fcdb38f..8d4b77bfa5811 100644 --- a/samples/drivers/counter/alarm/prj.conf +++ b/samples/drivers/counter/alarm/prj.conf @@ -1,2 +1,3 @@ CONFIG_PRINTK=y CONFIG_COUNTER=y +CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/samples/drivers/flash_shell/prj.conf b/samples/drivers/flash_shell/prj.conf index 1c70335b3f760..dd0c6ccfbe237 100644 --- a/samples/drivers/flash_shell/prj.conf +++ b/samples/drivers/flash_shell/prj.conf @@ -8,3 +8,4 @@ CONFIG_FLASH=y # it here. # CONFIG_FLASH_PAGE_LAYOUT=y CONFIG_MPU_ALLOW_FLASH_WRITE=y +CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/samples/drivers/gpio/prj.conf b/samples/drivers/gpio/prj.conf index 91c3c15b37d1e..03e18ec4c078e 100644 --- a/samples/drivers/gpio/prj.conf +++ b/samples/drivers/gpio/prj.conf @@ -1 +1,2 @@ CONFIG_GPIO=y +CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/samples/drivers/ht16k33/prj.conf b/samples/drivers/ht16k33/prj.conf index ff3d92b65c3a8..c296a8e3a75fa 100644 --- a/samples/drivers/ht16k33/prj.conf +++ b/samples/drivers/ht16k33/prj.conf @@ -4,3 +4,4 @@ CONFIG_GPIO=y CONFIG_LED=y CONFIG_HT16K33=y CONFIG_HT16K33_KEYSCAN=y +CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/samples/drivers/led_apa102/prj.conf b/samples/drivers/led_apa102/prj.conf index fe87e26daddb0..f23f800229741 100644 --- a/samples/drivers/led_apa102/prj.conf +++ b/samples/drivers/led_apa102/prj.conf @@ -2,3 +2,4 @@ CONFIG_LOG=y CONFIG_LED_STRIP=y +CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/samples/drivers/led_lp3943/prj.conf b/samples/drivers/led_lp3943/prj.conf index 6f7d4aa2515fb..050f380f875be 100644 --- a/samples/drivers/led_lp3943/prj.conf +++ b/samples/drivers/led_lp3943/prj.conf @@ -2,3 +2,4 @@ CONFIG_LOG=y CONFIG_I2C=y CONFIG_LED=y CONFIG_LP3943=y +CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/samples/drivers/led_lp5562/prj.conf b/samples/drivers/led_lp5562/prj.conf index 51a70f113a86f..4be6493019fd3 100644 --- a/samples/drivers/led_lp5562/prj.conf +++ b/samples/drivers/led_lp5562/prj.conf @@ -2,3 +2,4 @@ CONFIG_LOG=y CONFIG_I2C=y CONFIG_LED=y CONFIG_LP5562=y +CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/samples/drivers/led_lpd8806/prj.conf b/samples/drivers/led_lpd8806/prj.conf index 08909b52d2087..ceee9c6f092c9 100644 --- a/samples/drivers/led_lpd8806/prj.conf +++ b/samples/drivers/led_lpd8806/prj.conf @@ -8,3 +8,4 @@ CONFIG_SPI=y CONFIG_LED_STRIP=y CONFIG_LPD880X_STRIP=y +CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/samples/drivers/led_pca9633/prj.conf b/samples/drivers/led_pca9633/prj.conf index e3396b01a4824..35bb4deb66eca 100644 --- a/samples/drivers/led_pca9633/prj.conf +++ b/samples/drivers/led_pca9633/prj.conf @@ -4,3 +4,4 @@ CONFIG_I2C=y CONFIG_LED=y CONFIG_PCA9633=y +CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/samples/drivers/led_ws2812/prj.conf b/samples/drivers/led_ws2812/prj.conf index fe87e26daddb0..f23f800229741 100644 --- a/samples/drivers/led_ws2812/prj.conf +++ b/samples/drivers/led_ws2812/prj.conf @@ -2,3 +2,4 @@ CONFIG_LOG=y CONFIG_LED_STRIP=y +CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/samples/net/dhcpv4_client/overlay-e1000.conf b/samples/net/dhcpv4_client/overlay-e1000.conf index faaf64fb3df9c..3d022bd4b0fa2 100644 --- a/samples/net/dhcpv4_client/overlay-e1000.conf +++ b/samples/net/dhcpv4_client/overlay-e1000.conf @@ -6,3 +6,4 @@ CONFIG_ETH_E1000=y CONFIG_PCIE=y #CONFIG_ETHERNET_LOG_LEVEL_DBG=y +CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/samples/net/dhcpv4_client/prj.conf b/samples/net/dhcpv4_client/prj.conf index 1be69e9abd36f..d2a8df5999c82 100644 --- a/samples/net/dhcpv4_client/prj.conf +++ b/samples/net/dhcpv4_client/prj.conf @@ -17,3 +17,4 @@ CONFIG_LOG=y CONFIG_SLIP_STATISTICS=n CONFIG_NET_SHELL=y +CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/samples/net/dns_resolve/prj.conf b/samples/net/dns_resolve/prj.conf index 95d6d0ed0bc19..56828897fa1df 100644 --- a/samples/net/dns_resolve/prj.conf +++ b/samples/net/dns_resolve/prj.conf @@ -54,3 +54,4 @@ CONFIG_NET_CONFIG_MY_IPV4_ADDR="192.0.2.1" CONFIG_NET_CONFIG_PEER_IPV4_ADDR="192.0.2.2" CONFIG_MAIN_STACK_SIZE=1504 +CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/samples/net/eth_native_posix/net_setup_host.conf b/samples/net/eth_native_posix/net_setup_host.conf index 4e6ab7a557410..44b981c1ee61a 100644 --- a/samples/net/eth_native_posix/net_setup_host.conf +++ b/samples/net/eth_native_posix/net_setup_host.conf @@ -9,3 +9,4 @@ IPV6_ROUTE_1="2001:db8::/64" IPV4_ADDR_1="192.0.2.2" IPV4_ROUTE_1="192.0.2.0/24" +CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/samples/net/eth_native_posix/prj.conf b/samples/net/eth_native_posix/prj.conf index dedd8e86bfc60..55933e207acb8 100644 --- a/samples/net/eth_native_posix/prj.conf +++ b/samples/net/eth_native_posix/prj.conf @@ -38,3 +38,4 @@ CONFIG_NET_L2_ETHERNET=y CONFIG_ETH_NATIVE_POSIX=y CONFIG_ETH_NATIVE_POSIX_RANDOM_MAC=y #CONFIG_ETH_NATIVE_POSIX_MAC_ADDR="00:00:5e:00:53:2a" +CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/samples/net/gptp/prj.conf b/samples/net/gptp/prj.conf index 5513677d59245..c69e4f7976220 100644 --- a/samples/net/gptp/prj.conf +++ b/samples/net/gptp/prj.conf @@ -75,3 +75,4 @@ CONFIG_NET_TC_RX_COUNT=4 # Enable priority support in net_context CONFIG_NET_CONTEXT_PRIORITY=y +CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/samples/net/ipv4_autoconf/prj.conf b/samples/net/ipv4_autoconf/prj.conf index fc0cd2997c1cc..5150c0cda1309 100644 --- a/samples/net/ipv4_autoconf/prj.conf +++ b/samples/net/ipv4_autoconf/prj.conf @@ -22,3 +22,4 @@ CONFIG_NET_LOG=y CONFIG_LOG=y CONFIG_NET_SHELL=y +CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/samples/net/lldp/prj.conf b/samples/net/lldp/prj.conf index 07b5c1b601612..d9004c0a7c3bb 100644 --- a/samples/net/lldp/prj.conf +++ b/samples/net/lldp/prj.conf @@ -77,3 +77,4 @@ CONFIG_NET_LLDP_TX_INTERVAL=30 # How many traffic classes to enable CONFIG_NET_TC_TX_COUNT=6 CONFIG_NET_TC_RX_COUNT=4 +CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/samples/net/nats/prj.conf b/samples/net/nats/prj.conf index a261719d77372..c2b4c768e1c3e 100644 --- a/samples/net/nats/prj.conf +++ b/samples/net/nats/prj.conf @@ -21,3 +21,4 @@ CONFIG_NET_CONFIG_PEER_IPV6_ADDR="2001:db8::2" CONFIG_TEST_RANDOM_GENERATOR=y CONFIG_JSON_LIBRARY=y +CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/samples/net/promiscuous_mode/prj.conf b/samples/net/promiscuous_mode/prj.conf index 5690ffbb56081..9ee8b59cda439 100644 --- a/samples/net/promiscuous_mode/prj.conf +++ b/samples/net/promiscuous_mode/prj.conf @@ -42,3 +42,4 @@ CONFIG_NET_CONFIG_MY_IPV6_ADDR="2001:db8::1" CONFIG_NET_CONFIG_PEER_IPV6_ADDR="2001:db8::2" CONFIG_NET_CONFIG_MY_IPV4_ADDR="192.0.2.1" CONFIG_NET_CONFIG_PEER_IPV4_ADDR="192.0.2.2" +CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/samples/net/sockets/echo/prj.conf b/samples/net/sockets/echo/prj.conf index fd132f8e58661..034e438aab3fc 100644 --- a/samples/net/sockets/echo/prj.conf +++ b/samples/net/sockets/echo/prj.conf @@ -17,3 +17,4 @@ CONFIG_NET_CONFIG_SETTINGS=y CONFIG_NET_CONFIG_NEED_IPV4=y CONFIG_NET_CONFIG_MY_IPV4_ADDR="192.0.2.1" CONFIG_NET_CONFIG_PEER_IPV4_ADDR="192.0.2.2" +CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/samples/net/sockets/echo_server/overlay-802154.conf b/samples/net/sockets/echo_server/overlay-802154.conf index fa9e68002772b..743847e4c3b2f 100644 --- a/samples/net/sockets/echo_server/overlay-802154.conf +++ b/samples/net/sockets/echo_server/overlay-802154.conf @@ -14,3 +14,4 @@ CONFIG_NET_L2_IEEE802154_SHELL=y CONFIG_NET_L2_IEEE802154_LOG_LEVEL_INF=y CONFIG_NET_CONFIG_IEEE802154_CHANNEL=26 +CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/samples/net/sockets/echo_server/overlay-bt.conf b/samples/net/sockets/echo_server/overlay-bt.conf index e4ba34cb52371..b6f2e26ade55d 100644 --- a/samples/net/sockets/echo_server/overlay-bt.conf +++ b/samples/net/sockets/echo_server/overlay-bt.conf @@ -13,3 +13,4 @@ CONFIG_NET_CONFIG_NEED_IPV6=y CONFIG_NET_CONFIG_NEED_IPV4=n CONFIG_NET_CONFIG_MY_IPV4_ADDR="" CONFIG_NET_CONFIG_PEER_IPV4_ADDR="" +CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/samples/net/sockets/echo_server/overlay-cc2520.conf b/samples/net/sockets/echo_server/overlay-cc2520.conf index 6ce826bda54d1..82fbc0450ad1c 100644 --- a/samples/net/sockets/echo_server/overlay-cc2520.conf +++ b/samples/net/sockets/echo_server/overlay-cc2520.conf @@ -4,3 +4,4 @@ CONFIG_IEEE802154_CC2520=y CONFIG_NET_CONFIG_MY_IPV6_ADDR="2001:db8::2" CONFIG_NET_CONFIG_IEEE802154_DEV_NAME="cc2520" +CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/samples/net/sockets/echo_server/overlay-e1000.conf b/samples/net/sockets/echo_server/overlay-e1000.conf index faaf64fb3df9c..3d022bd4b0fa2 100644 --- a/samples/net/sockets/echo_server/overlay-e1000.conf +++ b/samples/net/sockets/echo_server/overlay-e1000.conf @@ -6,3 +6,4 @@ CONFIG_ETH_E1000=y CONFIG_PCIE=y #CONFIG_ETHERNET_LOG_LEVEL_DBG=y +CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/samples/net/sockets/echo_server/overlay-netusb.conf b/samples/net/sockets/echo_server/overlay-netusb.conf index 18192d8db9c63..186650e652b43 100644 --- a/samples/net/sockets/echo_server/overlay-netusb.conf +++ b/samples/net/sockets/echo_server/overlay-netusb.conf @@ -12,3 +12,4 @@ CONFIG_INIT_STACKS=n # Disable shell built-in commands to reduce ROM footprint CONFIG_SHELL_CMDS=n +CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/samples/net/sockets/echo_server/overlay-ot.conf b/samples/net/sockets/echo_server/overlay-ot.conf index a7da39076f02a..bee3b3ffba6e2 100644 --- a/samples/net/sockets/echo_server/overlay-ot.conf +++ b/samples/net/sockets/echo_server/overlay-ot.conf @@ -46,3 +46,5 @@ CONFIG_MBEDTLS_SSL_MAX_CONTENT_LEN=768 # A sample configuration to enable Thread Commissioner, uncomment if needed #CONFIG_OPENTHREAD_COMMISSIONER=y #CONFIG_MBEDTLS_HEAP_SIZE=8192 + +CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/samples/net/sockets/echo_server/overlay-qemu_802154.conf b/samples/net/sockets/echo_server/overlay-qemu_802154.conf index 2d336394850df..30b5cb60588ed 100644 --- a/samples/net/sockets/echo_server/overlay-qemu_802154.conf +++ b/samples/net/sockets/echo_server/overlay-qemu_802154.conf @@ -20,3 +20,4 @@ CONFIG_NET_L2_IEEE802154_SHELL=y CONFIG_NET_L2_IEEE802154_LOG_LEVEL_INF=y CONFIG_NET_CONFIG_IEEE802154_CHANNEL=26 +CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/samples/net/sockets/echo_server/overlay-qemu_cortex_m3_eth.conf b/samples/net/sockets/echo_server/overlay-qemu_cortex_m3_eth.conf index a77bf5bcad772..8a5af9d5aa134 100644 --- a/samples/net/sockets/echo_server/overlay-qemu_cortex_m3_eth.conf +++ b/samples/net/sockets/echo_server/overlay-qemu_cortex_m3_eth.conf @@ -5,3 +5,4 @@ CONFIG_ETH_STELLARIS=y CONFIG_NET_SLIP_TAP=n CONFIG_SLIP=n +CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/samples/net/sockets/echo_server/overlay-smsc911x.conf b/samples/net/sockets/echo_server/overlay-smsc911x.conf index 1120ab522e783..7e511395c14d5 100644 --- a/samples/net/sockets/echo_server/overlay-smsc911x.conf +++ b/samples/net/sockets/echo_server/overlay-smsc911x.conf @@ -4,3 +4,4 @@ CONFIG_NET_QEMU_ETHERNET=y CONFIG_ETH_SMSC911X=y #CONFIG_ETHERNET_LOG_LEVEL_DBG=y +CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/samples/net/sockets/echo_server/overlay-tls.conf b/samples/net/sockets/echo_server/overlay-tls.conf index a438dd5f23bb7..2220eebd47240 100644 --- a/samples/net/sockets/echo_server/overlay-tls.conf +++ b/samples/net/sockets/echo_server/overlay-tls.conf @@ -13,3 +13,4 @@ CONFIG_NET_SOCKETS_SOCKOPT_TLS=y CONFIG_NET_SOCKETS_TLS_MAX_CONTEXTS=6 CONFIG_NET_SOCKETS_ENABLE_DTLS=y CONFIG_NET_SOCKETS_DTLS_TIMEOUT=30000 +CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/samples/net/sockets/echo_server/overlay-vlan.conf b/samples/net/sockets/echo_server/overlay-vlan.conf index 014523b7fd5cc..03ad7d5043513 100644 --- a/samples/net/sockets/echo_server/overlay-vlan.conf +++ b/samples/net/sockets/echo_server/overlay-vlan.conf @@ -24,3 +24,4 @@ CONFIG_NET_SAMPLE_IFACE3_MY_IPV6_ADDR="2001:db8:200::1" CONFIG_NET_SAMPLE_IFACE3_MY_IPV4_ADDR="203.0.113.1" # VLAN tag for the second interface CONFIG_NET_SAMPLE_IFACE3_VLAN_TAG=200 +CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/samples/net/sockets/echo_server/prj.conf b/samples/net/sockets/echo_server/prj.conf index a39c36f4cfec3..76966f1ce7981 100644 --- a/samples/net/sockets/echo_server/prj.conf +++ b/samples/net/sockets/echo_server/prj.conf @@ -48,3 +48,5 @@ CONFIG_POSIX_MAX_FDS=12 # How many client can connect to echo-server simultaneously CONFIG_NET_SAMPLE_NUM_HANDLERS=1 + +CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/samples/net/sockets/net_mgmt/prj.conf b/samples/net/sockets/net_mgmt/prj.conf index 4c9720313c85a..afbdfb0e64efa 100644 --- a/samples/net/sockets/net_mgmt/prj.conf +++ b/samples/net/sockets/net_mgmt/prj.conf @@ -40,3 +40,4 @@ CONFIG_NET_CONFIG_AUTO_INIT=n # Set the userspace support by default as that was the purpose # of the sample application. CONFIG_USERSPACE=y +CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/samples/net/sockets/packet/prj.conf b/samples/net/sockets/packet/prj.conf index a5d4e6794610f..f4bae90a32fc6 100644 --- a/samples/net/sockets/packet/prj.conf +++ b/samples/net/sockets/packet/prj.conf @@ -41,3 +41,4 @@ CONFIG_NET_IF_LOG_LEVEL_DBG=n CONFIG_NET_L2_ETHERNET_LOG_LEVEL_DBG=n CONFIG_ETHERNET_LOG_LEVEL_DBG=n CONFIG_NET_PKT_LOG_LEVEL_ERR=n +CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/samples/net/stats/prj.conf b/samples/net/stats/prj.conf index 0a9998791b75d..ffa243747833a 100644 --- a/samples/net/stats/prj.conf +++ b/samples/net/stats/prj.conf @@ -44,3 +44,4 @@ CONFIG_NET_CONFIG_MY_IPV6_ADDR="2001:db8::1" # Logging CONFIG_LOG=y +CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/samples/net/syslog_net/prj.conf b/samples/net/syslog_net/prj.conf index ce3681d204281..89ddd97c8fc67 100644 --- a/samples/net/syslog_net/prj.conf +++ b/samples/net/syslog_net/prj.conf @@ -35,3 +35,4 @@ CONFIG_LOG_BACKEND_NET_SERVER="[2001:db8::2]:514" # Get newlib by default as it has proper time function support CONFIG_NEWLIB_LIBC=y +CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/samples/net/telnet/prj.conf b/samples/net/telnet/prj.conf index 8e00513e22fed..d5a5a6bcd7a5a 100644 --- a/samples/net/telnet/prj.conf +++ b/samples/net/telnet/prj.conf @@ -29,3 +29,4 @@ CONFIG_NET_CONFIG_MY_IPV4_ADDR="192.0.2.1" CONFIG_NET_SHELL=y CONFIG_KERNEL_SHELL=y CONFIG_SHELL_BACKEND_TELNET=y +CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/samples/net/vlan/prj.conf b/samples/net/vlan/prj.conf index 30cbbd7b4e045..0d2d0df10e201 100644 --- a/samples/net/vlan/prj.conf +++ b/samples/net/vlan/prj.conf @@ -54,3 +54,4 @@ CONFIG_NET_VLAN_COUNT=2 # Settings for native_posix ethernet driver (if compiled for that board) CONFIG_ETH_NATIVE_POSIX=y +CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/samples/portability/cmsis_rtos_v1/philosophers/prj.conf b/samples/portability/cmsis_rtos_v1/philosophers/prj.conf index 2b8481640ea14..b3761879f7f92 100644 --- a/samples/portability/cmsis_rtos_v1/philosophers/prj.conf +++ b/samples/portability/cmsis_rtos_v1/philosophers/prj.conf @@ -11,3 +11,4 @@ CONFIG_POLL=y CONFIG_SCHED_SCALABLE=y CONFIG_THREAD_CUSTOM_DATA=y +CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/samples/portability/cmsis_rtos_v1/timer_synchronization/prj.conf b/samples/portability/cmsis_rtos_v1/timer_synchronization/prj.conf index d3b7e6e36211f..161be19d77f20 100644 --- a/samples/portability/cmsis_rtos_v1/timer_synchronization/prj.conf +++ b/samples/portability/cmsis_rtos_v1/timer_synchronization/prj.conf @@ -10,3 +10,5 @@ CONFIG_INIT_STACKS=y CONFIG_POLL=y CONFIG_SCHED_SCALABLE=y CONFIG_THREAD_CUSTOM_DATA=y +CONFIG_SMP=n +CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/samples/portability/cmsis_rtos_v2/philosophers/prj.conf b/samples/portability/cmsis_rtos_v2/philosophers/prj.conf index 7bf7415a2a66f..e8d8bcd91d34f 100644 --- a/samples/portability/cmsis_rtos_v2/philosophers/prj.conf +++ b/samples/portability/cmsis_rtos_v2/philosophers/prj.conf @@ -10,3 +10,4 @@ CONFIG_INIT_STACKS=y CONFIG_POLL=y CONFIG_SCHED_SCALABLE=y CONFIG_SYS_CLOCK_TICKS_PER_SEC=1000 +CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/samples/portability/cmsis_rtos_v2/timer_synchronization/prj.conf b/samples/portability/cmsis_rtos_v2/timer_synchronization/prj.conf index 0df8dbb81166d..fe0df4e25e4ad 100644 --- a/samples/portability/cmsis_rtos_v2/timer_synchronization/prj.conf +++ b/samples/portability/cmsis_rtos_v2/timer_synchronization/prj.conf @@ -12,3 +12,4 @@ CONFIG_SCHED_SCALABLE=y CONFIG_QEMU_TICKLESS_WORKAROUND=y # The Zephyr CMSIS v2 emulation assumes that ticks are ms, currently CONFIG_SYS_CLOCK_TICKS_PER_SEC=1000 +CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/samples/sensor/fxas21002/prj.conf b/samples/sensor/fxas21002/prj.conf index b6065b89119a5..28dc94f5410f0 100644 --- a/samples/sensor/fxas21002/prj.conf +++ b/samples/sensor/fxas21002/prj.conf @@ -5,3 +5,4 @@ CONFIG_SENSOR=y CONFIG_FXAS21002=y CONFIG_SENSOR_LOG_LEVEL_DBG=y CONFIG_FXAS21002_TRIGGER_OWN_THREAD=y +CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/samples/sensor/fxos8700-hid/prj.conf b/samples/sensor/fxos8700-hid/prj.conf index c69772c998b25..840971f8608e5 100644 --- a/samples/sensor/fxos8700-hid/prj.conf +++ b/samples/sensor/fxos8700-hid/prj.conf @@ -16,3 +16,4 @@ CONFIG_FXOS8700_TRIGGER_OWN_THREAD=y CONFIG_SENSOR_LOG_LEVEL_DBG=y CONFIG_GPIO=y +CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/samples/sensor/fxos8700/overlay-motion.conf b/samples/sensor/fxos8700/overlay-motion.conf index 85fdafaaa1fc1..092d2bfc96b7b 100644 --- a/samples/sensor/fxos8700/overlay-motion.conf +++ b/samples/sensor/fxos8700/overlay-motion.conf @@ -1,2 +1,3 @@ CONFIG_FXOS8700_MOTION=y CONFIG_FXOS8700_PM_LOW_POWER=y +CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/samples/sensor/fxos8700/prj.conf b/samples/sensor/fxos8700/prj.conf index f266690c7c01f..8b0e221c3b2de 100644 --- a/samples/sensor/fxos8700/prj.conf +++ b/samples/sensor/fxos8700/prj.conf @@ -7,3 +7,4 @@ CONFIG_SENSOR_LOG_LEVEL_DBG=y CONFIG_FXOS8700_MODE_HYBRID=y CONFIG_FXOS8700_TEMP=y CONFIG_FXOS8700_TRIGGER_OWN_THREAD=y +CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/samples/sensor/fxos8700/prj_accel.conf b/samples/sensor/fxos8700/prj_accel.conf index d64c1732dc390..8652ea828a847 100644 --- a/samples/sensor/fxos8700/prj_accel.conf +++ b/samples/sensor/fxos8700/prj_accel.conf @@ -6,3 +6,4 @@ CONFIG_FXOS8700=y CONFIG_SENSOR_LOG_LEVEL_DBG=y CONFIG_FXOS8700_MODE_ACCEL=y CONFIG_FXOS8700_TRIGGER_OWN_THREAD=y +CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/samples/sensor/grove_light/prj.conf b/samples/sensor/grove_light/prj.conf index 2bff9641d57ff..de6536521747f 100644 --- a/samples/sensor/grove_light/prj.conf +++ b/samples/sensor/grove_light/prj.conf @@ -3,3 +3,4 @@ CONFIG_GROVE_LIGHT_SENSOR=y CONFIG_SENSOR=y CONFIG_NEWLIB_LIBC=y CONFIG_STDOUT_CONSOLE=y +CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/samples/sensor/grove_temperature/prj.conf b/samples/sensor/grove_temperature/prj.conf index c06e93f385e9e..5299ce7585cb1 100644 --- a/samples/sensor/grove_temperature/prj.conf +++ b/samples/sensor/grove_temperature/prj.conf @@ -7,3 +7,4 @@ CONFIG_GROVE_TEMPERATURE_SENSOR_ADC_CHANNEL=10 CONFIG_GROVE_TEMPERATURE_SENSOR=y CONFIG_GROVE_TEMPERATURE_SENSOR_V1_X=y CONFIG_GROVE_LCD_RGB=y +CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/samples/sensor/ti_hdc/prj.conf b/samples/sensor/ti_hdc/prj.conf index 456d5328aa5a3..d23a2ef0cc64b 100644 --- a/samples/sensor/ti_hdc/prj.conf +++ b/samples/sensor/ti_hdc/prj.conf @@ -3,3 +3,4 @@ CONFIG_I2C=y CONFIG_GPIO=y CONFIG_SENSOR=y CONFIG_TI_HDC=y +CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/samples/subsys/console/echo/prj.conf b/samples/subsys/console/echo/prj.conf index 4dd0a714cff28..82efd1466fb50 100644 --- a/samples/subsys/console/echo/prj.conf +++ b/samples/subsys/console/echo/prj.conf @@ -2,3 +2,4 @@ CONFIG_CONSOLE_SUBSYS=y CONFIG_CONSOLE_GETCHAR=y CONFIG_CONSOLE_GETCHAR_BUFSIZE=64 CONFIG_CONSOLE_PUTCHAR_BUFSIZE=512 +CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/samples/subsys/console/getchar/prj.conf b/samples/subsys/console/getchar/prj.conf index 74e42c5877648..eb8291dc1216b 100644 --- a/samples/subsys/console/getchar/prj.conf +++ b/samples/subsys/console/getchar/prj.conf @@ -1,2 +1,3 @@ CONFIG_CONSOLE_SUBSYS=y CONFIG_CONSOLE_GETCHAR=y +CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/samples/subsys/fs/fat_fs/prj.conf b/samples/subsys/fs/fat_fs/prj.conf index 34c2ef042101a..8c90eaf042e06 100644 --- a/samples/subsys/fs/fat_fs/prj.conf +++ b/samples/subsys/fs/fat_fs/prj.conf @@ -8,3 +8,4 @@ CONFIG_LOG=y CONFIG_FILE_SYSTEM=y CONFIG_FAT_FILESYSTEM_ELM=y CONFIG_PRINTK=y +CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/samples/subsys/fs/fat_fs/prj_mimxrt1050_evk.conf b/samples/subsys/fs/fat_fs/prj_mimxrt1050_evk.conf index afd105a700c84..45b89cb245ce9 100644 --- a/samples/subsys/fs/fat_fs/prj_mimxrt1050_evk.conf +++ b/samples/subsys/fs/fat_fs/prj_mimxrt1050_evk.conf @@ -9,3 +9,4 @@ CONFIG_LOG=y CONFIG_FILE_SYSTEM=y CONFIG_FAT_FILESYSTEM_ELM=y CONFIG_PRINTK=y +CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/samples/subsys/ipc/openamp/prj.conf b/samples/subsys/ipc/openamp/prj.conf index a9b5cad7d290b..ff29597b4c81d 100644 --- a/samples/subsys/ipc/openamp/prj.conf +++ b/samples/subsys/ipc/openamp/prj.conf @@ -7,3 +7,4 @@ CONFIG_TIMESLICE_SIZE=1 CONFIG_MAIN_STACK_SIZE=2048 CONFIG_HEAP_MEM_POOL_SIZE=4096 CONFIG_OPENAMP=y +CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/samples/subsys/ipc/openamp/remote/src/main.c b/samples/subsys/ipc/openamp/remote/src/main.c index 95139a43f83c6..0f24b3f0a460f 100644 --- a/samples/subsys/ipc/openamp/remote/src/main.c +++ b/samples/subsys/ipc/openamp/remote/src/main.c @@ -252,5 +252,5 @@ void main(void) printk("Starting application thread!\n"); k_thread_create(&thread_data, thread_stack, APP_TASK_STACK_SIZE, (k_thread_entry_t)app_task, - NULL, NULL, NULL, K_PRIO_COOP(7), 0, 0); + NULL, NULL, NULL, K_PRIO_COOP(7), 0, K_NO_WAIT); } diff --git a/samples/subsys/shell/shell_module/prj.conf b/samples/subsys/shell/shell_module/prj.conf index 29bd82becf0a7..643edf1d62c02 100644 --- a/samples/subsys/shell/shell_module/prj.conf +++ b/samples/subsys/shell/shell_module/prj.conf @@ -7,3 +7,4 @@ CONFIG_INIT_STACKS=y CONFIG_BOOT_BANNER=n CONFIG_THREAD_NAME=y CONFIG_DEVICE_SHELL=y +CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/samples/subsys/shell/shell_module/prj_minimal.conf b/samples/subsys/shell/shell_module/prj_minimal.conf index 3fe1e3fc79045..0aa836f36c3dc 100644 --- a/samples/subsys/shell/shell_module/prj_minimal.conf +++ b/samples/subsys/shell/shell_module/prj_minimal.conf @@ -17,3 +17,4 @@ CONFIG_SHELL_VT100_COLORS=n CONFIG_SHELL_HELP_ON_WRONG_ARGUMENT_COUNT=n CONFIG_SHELL_STATS=n CONFIG_SHELL_CMDS=n +CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/samples/subsys/shell/shell_module/prj_minimal_rtt.conf b/samples/subsys/shell/shell_module/prj_minimal_rtt.conf index f5c278dbf0c12..40948e85cdcb4 100644 --- a/samples/subsys/shell/shell_module/prj_minimal_rtt.conf +++ b/samples/subsys/shell/shell_module/prj_minimal_rtt.conf @@ -22,3 +22,4 @@ CONFIG_CONSOLE=y #enable RTT shell CONFIG_USE_SEGGER_RTT=y CONFIG_SHELL_BACKEND_RTT=y +CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/samples/subsys/usb/cdc_acm/overlay-composite-cdc-dfu.conf b/samples/subsys/usb/cdc_acm/overlay-composite-cdc-dfu.conf index 24a640cbeb170..a37377c8e80ba 100644 --- a/samples/subsys/usb/cdc_acm/overlay-composite-cdc-dfu.conf +++ b/samples/subsys/usb/cdc_acm/overlay-composite-cdc-dfu.conf @@ -8,3 +8,5 @@ CONFIG_FLASH=y CONFIG_IMG_MANAGER=y CONFIG_FLASH_PAGE_LAYOUT=y CONFIG_BOOTLOADER_MCUBOOT=y +CONFIG_SYS_TIMEOUT_LEGACY_API=y +CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/samples/subsys/usb/cdc_acm/overlay-composite-cdc-msc.conf b/samples/subsys/usb/cdc_acm/overlay-composite-cdc-msc.conf index f6f109cece68b..539dd5822c2dc 100644 --- a/samples/subsys/usb/cdc_acm/overlay-composite-cdc-msc.conf +++ b/samples/subsys/usb/cdc_acm/overlay-composite-cdc-msc.conf @@ -8,3 +8,5 @@ CONFIG_USB_MASS_STORAGE_LOG_LEVEL_ERR=y #RAM DISK CONFIG_DISK_ACCESS_RAM=y +CONFIG_SYS_TIMEOUT_LEGACY_API=y +CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/samples/subsys/usb/cdc_acm/prj.conf b/samples/subsys/usb/cdc_acm/prj.conf index 54d59b80bd2d7..bf847f1b6a389 100644 --- a/samples/subsys/usb/cdc_acm/prj.conf +++ b/samples/subsys/usb/cdc_acm/prj.conf @@ -10,3 +10,5 @@ CONFIG_USB_DEVICE_LOG_LEVEL_ERR=y CONFIG_SERIAL=y CONFIG_UART_INTERRUPT_DRIVEN=y CONFIG_UART_LINE_CTRL=y +CONFIG_SYS_TIMEOUT_LEGACY_API=y +CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/samples/subsys/usb/cdc_acm_composite/prj.conf b/samples/subsys/usb/cdc_acm_composite/prj.conf index 6da8a1745979f..ab1dd9de76202 100644 --- a/samples/subsys/usb/cdc_acm_composite/prj.conf +++ b/samples/subsys/usb/cdc_acm_composite/prj.conf @@ -15,3 +15,4 @@ CONFIG_USB_CDC_ACM_RINGBUF_SIZE=512 CONFIG_USB_DEVICE_LOG_LEVEL_ERR=y CONFIG_USB_DRIVER_LOG_LEVEL_ERR=y +CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/samples/subsys/usb/console/prj.conf b/samples/subsys/usb/console/prj.conf index 0961ff44878f8..3b90e3c9b5e1e 100644 --- a/samples/subsys/usb/console/prj.conf +++ b/samples/subsys/usb/console/prj.conf @@ -10,3 +10,4 @@ CONFIG_UART_LINE_CTRL=y CONFIG_UART_CONSOLE_ON_DEV_NAME="CDC_ACM_0" CONFIG_USB_UART_DTR_WAIT=y +CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/samples/subsys/usb/hid-cdc/prj.conf b/samples/subsys/usb/hid-cdc/prj.conf index 5a2085c98f57f..cb7293941fc1d 100644 --- a/samples/subsys/usb/hid-cdc/prj.conf +++ b/samples/subsys/usb/hid-cdc/prj.conf @@ -20,3 +20,4 @@ CONFIG_UART_INTERRUPT_DRIVEN=y CONFIG_UART_LINE_CTRL=y CONFIG_GPIO=y +CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/samples/subsys/usb/hid-mouse/prj.conf b/samples/subsys/usb/hid-mouse/prj.conf index 071214c294132..acd174db65297 100644 --- a/samples/subsys/usb/hid-mouse/prj.conf +++ b/samples/subsys/usb/hid-mouse/prj.conf @@ -8,3 +8,4 @@ CONFIG_USB_DRIVER_LOG_LEVEL_ERR=y CONFIG_USB_DEVICE_LOG_LEVEL_ERR=y CONFIG_GPIO=y +CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/samples/subsys/usb/hid/prj.conf b/samples/subsys/usb/hid/prj.conf index 638dba457c06b..6f5faa6ae963b 100644 --- a/samples/subsys/usb/hid/prj.conf +++ b/samples/subsys/usb/hid/prj.conf @@ -7,3 +7,5 @@ CONFIG_USB_HID_BOOT_PROTOCOL=y CONFIG_LOG=y CONFIG_USB_DRIVER_LOG_LEVEL_ERR=y CONFIG_USB_DEVICE_LOG_LEVEL_ERR=y +CONFIG_SYS_TIMEOUT_LEGACY_API=y +CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/samples/subsys/usb/mass/overlay-flash-disk.conf b/samples/subsys/usb/mass/overlay-flash-disk.conf index d95ffc833825a..bba574a113cf8 100644 --- a/samples/subsys/usb/mass/overlay-flash-disk.conf +++ b/samples/subsys/usb/mass/overlay-flash-disk.conf @@ -2,3 +2,4 @@ CONFIG_DISK_ACCESS_FLASH=y CONFIG_MASS_STORAGE_DISK_NAME="NAND" CONFIG_SPI=y +CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/samples/subsys/usb/mass/overlay-ram-disk.conf b/samples/subsys/usb/mass/overlay-ram-disk.conf index 0f9c0ad690641..f9dd984531907 100644 --- a/samples/subsys/usb/mass/overlay-ram-disk.conf +++ b/samples/subsys/usb/mass/overlay-ram-disk.conf @@ -1,3 +1,4 @@ # config to disk access over RAM CONFIG_DISK_ACCESS_RAM=y CONFIG_MASS_STORAGE_DISK_NAME="RAM" +CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/samples/subsys/usb/mass/prj.conf b/samples/subsys/usb/mass/prj.conf index 6428d785f5f7e..dccf65a85e1d3 100644 --- a/samples/subsys/usb/mass/prj.conf +++ b/samples/subsys/usb/mass/prj.conf @@ -14,3 +14,4 @@ CONFIG_USB_MASS_STORAGE_LOG_LEVEL_ERR=y # If the target's code needs to do file operations, enable target's # FAT FS code. (Without this only the host can access the fs contents) #CONFIG_FILE_SYSTEM=y +CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/samples/subsys/usb/mass/prj_nrf52840_pca10056.conf b/samples/subsys/usb/mass/prj_nrf52840_pca10056.conf index 2a053f32ec6b8..6979d07443ead 100644 --- a/samples/subsys/usb/mass/prj_nrf52840_pca10056.conf +++ b/samples/subsys/usb/mass/prj_nrf52840_pca10056.conf @@ -24,3 +24,4 @@ CONFIG_DISK_VOLUME_SIZE=0x10000 CONFIG_FILE_SYSTEM=y CONFIG_FAT_FILESYSTEM_ELM=y CONFIG_MPU_ALLOW_FLASH_WRITE=y +CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/samples/subsys/usb/testusb/prj.conf b/samples/subsys/usb/testusb/prj.conf index c191bbc29e573..83ce98ce67ad4 100644 --- a/samples/subsys/usb/testusb/prj.conf +++ b/samples/subsys/usb/testusb/prj.conf @@ -8,3 +8,4 @@ CONFIG_LOG=y CONFIG_USB_DRIVER_LOG_LEVEL_ERR=y CONFIG_USB_DEVICE_LOOPBACK=y CONFIG_USB_DEVICE_LOG_LEVEL_ERR=y +CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/samples/subsys/usb/webusb/prj.conf b/samples/subsys/usb/webusb/prj.conf index 872e7f6286907..170bc4e1a64de 100644 --- a/samples/subsys/usb/webusb/prj.conf +++ b/samples/subsys/usb/webusb/prj.conf @@ -10,3 +10,4 @@ CONFIG_UART_LINE_CTRL=y CONFIG_LOG=y CONFIG_USB_DRIVER_LOG_LEVEL_ERR=y CONFIG_USB_DEVICE_LOG_LEVEL_ERR=y +CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/samples/synchronization/prj.conf b/samples/synchronization/prj.conf index fb9f4cdb23f48..397505c1f87e5 100644 --- a/samples/synchronization/prj.conf +++ b/samples/synchronization/prj.conf @@ -1,3 +1,4 @@ CONFIG_STDOUT_CONSOLE=y # enable to use thread names #CONFIG_THREAD_NAME=y +CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/subsys/net/Kconfig b/subsys/net/Kconfig index 66882532cde14..f6b43301f4266 100644 --- a/subsys/net/Kconfig +++ b/subsys/net/Kconfig @@ -10,6 +10,7 @@ menu "Networking" config NET_BUF bool "Network buffer support" + select SYS_TIMEOUT_LEGACY_API help This option enables support for generic network protocol buffers. diff --git a/tests/application_development/cpp/prj.conf b/tests/application_development/cpp/prj.conf index 5162a7aea2bd5..a76c3977d960c 100644 --- a/tests/application_development/cpp/prj.conf +++ b/tests/application_development/cpp/prj.conf @@ -2,3 +2,4 @@ CONFIG_CPLUSPLUS=y CONFIG_NET_BUF=y CONFIG_ZTEST=y CONFIG_ZTEST_STACKSIZE=2048 +CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/arch/arm/arm_runtime_nmi/prj.conf b/tests/arch/arm/arm_runtime_nmi/prj.conf index e5c468604abec..f113d1dd4bdc3 100644 --- a/tests/arch/arm/arm_runtime_nmi/prj.conf +++ b/tests/arch/arm/arm_runtime_nmi/prj.conf @@ -1,2 +1,2 @@ -CONFIG_RUNTIME_NMI=y CONFIG_ZTEST=y +CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/benchmarks/app_kernel/prj.conf b/tests/benchmarks/app_kernel/prj.conf index 95c251efacf21..982ed5da1bab7 100644 --- a/tests/benchmarks/app_kernel/prj.conf +++ b/tests/benchmarks/app_kernel/prj.conf @@ -11,3 +11,4 @@ CONFIG_FORCE_NO_ASSERT=y #Disable Userspace CONFIG_TEST_HW_STACK_PROTECTION=n +CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/benchmarks/app_kernel/prj_fp.conf b/tests/benchmarks/app_kernel/prj_fp.conf index a1ca04e620069..995a848111eea 100644 --- a/tests/benchmarks/app_kernel/prj_fp.conf +++ b/tests/benchmarks/app_kernel/prj_fp.conf @@ -16,3 +16,4 @@ CONFIG_FORCE_NO_ASSERT=y #Disable Userspace CONFIG_TEST_HW_STACK_PROTECTION=n +CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/benchmarks/latency_measure/prj.conf b/tests/benchmarks/latency_measure/prj.conf index 9d350c1ad12e9..b205f82287f47 100644 --- a/tests/benchmarks/latency_measure/prj.conf +++ b/tests/benchmarks/latency_measure/prj.conf @@ -15,3 +15,4 @@ CONFIG_FORCE_NO_ASSERT=y CONFIG_TEST_HW_STACK_PROTECTION=n CONFIG_COVERAGE=n +CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/benchmarks/sys_kernel/prj.conf b/tests/benchmarks/sys_kernel/prj.conf index 05152f924389b..484c11d6e5bec 100644 --- a/tests/benchmarks/sys_kernel/prj.conf +++ b/tests/benchmarks/sys_kernel/prj.conf @@ -10,3 +10,4 @@ CONFIG_MAIN_STACK_SIZE=16384 CONFIG_FORCE_NO_ASSERT=y CONFIG_TEST_HW_STACK_PROTECTION=n +CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/benchmarks/timing_info/prj.conf b/tests/benchmarks/timing_info/prj.conf index 6ed0ec4856450..87e5115e0b3e2 100644 --- a/tests/benchmarks/timing_info/prj.conf +++ b/tests/benchmarks/timing_info/prj.conf @@ -6,3 +6,4 @@ CONFIG_MAIN_STACK_SIZE=2048 CONFIG_FORCE_NO_ASSERT=y CONFIG_TEST_HW_STACK_PROTECTION=n CONFIG_MP_NUM_CPUS=1 +CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/benchmarks/timing_info/prj_userspace.conf b/tests/benchmarks/timing_info/prj_userspace.conf index 2ac7275683681..93559f22cc915 100644 --- a/tests/benchmarks/timing_info/prj_userspace.conf +++ b/tests/benchmarks/timing_info/prj_userspace.conf @@ -6,3 +6,4 @@ CONFIG_MAIN_STACK_SIZE=2048 CONFIG_FORCE_NO_ASSERT=y CONFIG_APPLICATION_DEFINED_SYSCALL=y CONFIG_TEST_USERSPACE=y +CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/bluetooth/at/prj.conf b/tests/bluetooth/at/prj.conf index 42737f3052ba8..d76653ced8521 100644 --- a/tests/bluetooth/at/prj.conf +++ b/tests/bluetooth/at/prj.conf @@ -4,3 +4,4 @@ CONFIG_BT_HFP_HF=y CONFIG_NET_BUF=y CONFIG_ZTEST=y CONFIG_SERIAL=y +CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/bluetooth/bluetooth/prj.conf b/tests/bluetooth/bluetooth/prj.conf index f43d042a8fbb4..32bb78ba986a3 100644 --- a/tests/bluetooth/bluetooth/prj.conf +++ b/tests/bluetooth/bluetooth/prj.conf @@ -4,3 +4,4 @@ CONFIG_BT_NO_DRIVER=y CONFIG_BT_DEBUG_LOG=y CONFIG_UART_INTERRUPT_DRIVEN=n CONFIG_ZTEST=y +CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/bluetooth/gatt/prj.conf b/tests/bluetooth/gatt/prj.conf index 35c557eb8bdb6..80f22c26cba9c 100644 --- a/tests/bluetooth/gatt/prj.conf +++ b/tests/bluetooth/gatt/prj.conf @@ -8,3 +8,4 @@ CONFIG_BT_NO_DRIVER=y CONFIG_BT_DEBUG_LOG=y CONFIG_BT_PERIPHERAL=y CONFIG_BT_GATT_DYNAMIC_DB=y +CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/bluetooth/hci_prop_evt/prj.conf b/tests/bluetooth/hci_prop_evt/prj.conf index 0f6d72f0e51cf..8b4238a1133ef 100644 --- a/tests/bluetooth/hci_prop_evt/prj.conf +++ b/tests/bluetooth/hci_prop_evt/prj.conf @@ -12,3 +12,4 @@ CONFIG_BT_DEBUG_HCI_CORE=y CONFIG_BT_DEBUG_HCI_DRIVER=y CONFIG_HEAP_MEM_POOL_SIZE=2048 +CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/bluetooth/init/prj.conf b/tests/bluetooth/init/prj.conf index 4467fc0b66d83..f927efa82eb31 100644 --- a/tests/bluetooth/init/prj.conf +++ b/tests/bluetooth/init/prj.conf @@ -2,3 +2,4 @@ CONFIG_BT=y CONFIG_BT_DEBUG_LOG=y CONFIG_ZTEST=y +CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/bluetooth/init/prj_0.conf b/tests/bluetooth/init/prj_0.conf index 6cf1e6d31986b..f6714112db2c6 100644 --- a/tests/bluetooth/init/prj_0.conf +++ b/tests/bluetooth/init/prj_0.conf @@ -1,3 +1,4 @@ CONFIG_BT=y CONFIG_ZTEST=y +CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/bluetooth/init/prj_1.conf b/tests/bluetooth/init/prj_1.conf index 009be0089521a..efd8d1fb92a53 100644 --- a/tests/bluetooth/init/prj_1.conf +++ b/tests/bluetooth/init/prj_1.conf @@ -2,3 +2,4 @@ CONFIG_BT=y CONFIG_BT_PERIPHERAL=y CONFIG_ZTEST=y +CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/bluetooth/init/prj_10.conf b/tests/bluetooth/init/prj_10.conf index c3024a1bed850..458ac24721583 100644 --- a/tests/bluetooth/init/prj_10.conf +++ b/tests/bluetooth/init/prj_10.conf @@ -8,3 +8,4 @@ CONFIG_BT_TINYCRYPT_ECC=y CONFIG_BT_USE_DEBUG_KEYS=y CONFIG_ZTEST=y +CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/bluetooth/init/prj_11.conf b/tests/bluetooth/init/prj_11.conf index 67a3e1e47cc83..aa9d5d994b245 100644 --- a/tests/bluetooth/init/prj_11.conf +++ b/tests/bluetooth/init/prj_11.conf @@ -10,3 +10,4 @@ CONFIG_BT_L2CAP_DYNAMIC_CHANNEL=y CONFIG_BT_GATT_CLIENT=y CONFIG_ZTEST=y +CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/bluetooth/init/prj_12.conf b/tests/bluetooth/init/prj_12.conf index d267932666726..b11e600cb340b 100644 --- a/tests/bluetooth/init/prj_12.conf +++ b/tests/bluetooth/init/prj_12.conf @@ -9,3 +9,4 @@ CONFIG_BT_L2CAP_DYNAMIC_CHANNEL=y CONFIG_BT_GATT_CLIENT=y CONFIG_ZTEST=y +CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/bluetooth/init/prj_13.conf b/tests/bluetooth/init/prj_13.conf index ea893a3aab156..614f9bc9c56ad 100644 --- a/tests/bluetooth/init/prj_13.conf +++ b/tests/bluetooth/init/prj_13.conf @@ -9,3 +9,4 @@ CONFIG_BT_L2CAP_DYNAMIC_CHANNEL=y CONFIG_BT_GATT_CLIENT=y CONFIG_ZTEST=y +CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/bluetooth/init/prj_14.conf b/tests/bluetooth/init/prj_14.conf index 688672764031b..99802fd23c248 100644 --- a/tests/bluetooth/init/prj_14.conf +++ b/tests/bluetooth/init/prj_14.conf @@ -6,3 +6,4 @@ CONFIG_BT_SIGNING=y CONFIG_BT_TINYCRYPT_ECC=y CONFIG_ZTEST=y +CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/bluetooth/init/prj_15.conf b/tests/bluetooth/init/prj_15.conf index d4b2a0d13a6e5..07033c39a465d 100644 --- a/tests/bluetooth/init/prj_15.conf +++ b/tests/bluetooth/init/prj_15.conf @@ -6,3 +6,4 @@ CONFIG_BT_SMP_SC_ONLY=y CONFIG_BT_TINYCRYPT_ECC=y CONFIG_ZTEST=y +CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/bluetooth/init/prj_16.conf b/tests/bluetooth/init/prj_16.conf index d68f68883c3d5..73902b2b4a444 100644 --- a/tests/bluetooth/init/prj_16.conf +++ b/tests/bluetooth/init/prj_16.conf @@ -6,3 +6,4 @@ CONFIG_BT_L2CAP_DYNAMIC_CHANNEL=y CONFIG_BT_GATT_CLIENT=y CONFIG_ZTEST=y +CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/bluetooth/init/prj_17.conf b/tests/bluetooth/init/prj_17.conf index b4f33a6c28728..b0fc9e12ed164 100644 --- a/tests/bluetooth/init/prj_17.conf +++ b/tests/bluetooth/init/prj_17.conf @@ -21,3 +21,4 @@ CONFIG_BT_DEBUG_GATT=y CONFIG_BT_BREDR=y CONFIG_ZTEST=y +CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/bluetooth/init/prj_18.conf b/tests/bluetooth/init/prj_18.conf index 474265ca0f75f..b7993da578ab0 100644 --- a/tests/bluetooth/init/prj_18.conf +++ b/tests/bluetooth/init/prj_18.conf @@ -3,3 +3,4 @@ CONFIG_BT_PERIPHERAL=y CONFIG_BT_BREDR=y CONFIG_ZTEST=y +CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/bluetooth/init/prj_19.conf b/tests/bluetooth/init/prj_19.conf index deaf3a3bbe5b1..7b34f4a58ecda 100644 --- a/tests/bluetooth/init/prj_19.conf +++ b/tests/bluetooth/init/prj_19.conf @@ -3,3 +3,4 @@ CONFIG_BT_CENTRAL=y CONFIG_BT_BREDR=y CONFIG_ZTEST=y +CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/bluetooth/init/prj_2.conf b/tests/bluetooth/init/prj_2.conf index 3802a5144f0ad..9c29db35ce6f2 100644 --- a/tests/bluetooth/init/prj_2.conf +++ b/tests/bluetooth/init/prj_2.conf @@ -2,3 +2,4 @@ CONFIG_BT=y CONFIG_BT_CENTRAL=y CONFIG_ZTEST=y +CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/bluetooth/init/prj_20.conf b/tests/bluetooth/init/prj_20.conf index c0d6ca845e7a5..472464a999649 100644 --- a/tests/bluetooth/init/prj_20.conf +++ b/tests/bluetooth/init/prj_20.conf @@ -28,3 +28,4 @@ CONFIG_BT_HFP_HF=y CONFIG_BT_DEBUG_HFP_HF=y CONFIG_ZTEST=y +CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/bluetooth/init/prj_21.conf b/tests/bluetooth/init/prj_21.conf index d6b506fae2d96..c6c10f4870dc1 100644 --- a/tests/bluetooth/init/prj_21.conf +++ b/tests/bluetooth/init/prj_21.conf @@ -21,3 +21,4 @@ CONFIG_BT_DEBUG_GATT=y CONFIG_BT_BREDR=y CONFIG_ZTEST=y +CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/bluetooth/init/prj_22.conf b/tests/bluetooth/init/prj_22.conf index 332779c0d5c21..e6e9f45aa3cc6 100644 --- a/tests/bluetooth/init/prj_22.conf +++ b/tests/bluetooth/init/prj_22.conf @@ -4,3 +4,4 @@ CONFIG_BT_PERIPHERAL=y CONFIG_BT_SMP=y CONFIG_ZTEST=y +CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/bluetooth/init/prj_3.conf b/tests/bluetooth/init/prj_3.conf index d1c6005e11710..d8e93174ff10b 100644 --- a/tests/bluetooth/init/prj_3.conf +++ b/tests/bluetooth/init/prj_3.conf @@ -3,3 +3,4 @@ CONFIG_BT_PERIPHERAL=y CONFIG_BT_CENTRAL=y CONFIG_ZTEST=y +CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/bluetooth/init/prj_4.conf b/tests/bluetooth/init/prj_4.conf index 7f197e3398c07..30ddcb88ef8fd 100644 --- a/tests/bluetooth/init/prj_4.conf +++ b/tests/bluetooth/init/prj_4.conf @@ -3,3 +3,4 @@ CONFIG_BT_PERIPHERAL=y CONFIG_BT_SMP=y CONFIG_ZTEST=y +CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/bluetooth/init/prj_5.conf b/tests/bluetooth/init/prj_5.conf index b621316fd2e23..084ccffe83166 100644 --- a/tests/bluetooth/init/prj_5.conf +++ b/tests/bluetooth/init/prj_5.conf @@ -3,3 +3,4 @@ CONFIG_BT_CENTRAL=y CONFIG_BT_SMP=y CONFIG_ZTEST=y +CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/bluetooth/init/prj_6.conf b/tests/bluetooth/init/prj_6.conf index 30e5049b45ecb..7948b3cca29f5 100644 --- a/tests/bluetooth/init/prj_6.conf +++ b/tests/bluetooth/init/prj_6.conf @@ -4,3 +4,4 @@ CONFIG_BT_CENTRAL=y CONFIG_BT_SMP=y CONFIG_ZTEST=y +CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/bluetooth/init/prj_7.conf b/tests/bluetooth/init/prj_7.conf index ba8453c9ffb71..67055d75a727f 100644 --- a/tests/bluetooth/init/prj_7.conf +++ b/tests/bluetooth/init/prj_7.conf @@ -5,3 +5,4 @@ CONFIG_BT_SMP=y CONFIG_BT_SIGNING=y CONFIG_ZTEST=y +CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/bluetooth/init/prj_8.conf b/tests/bluetooth/init/prj_8.conf index 697a34db2eda8..b6d4ad8f2bd72 100644 --- a/tests/bluetooth/init/prj_8.conf +++ b/tests/bluetooth/init/prj_8.conf @@ -6,3 +6,4 @@ CONFIG_BT_SIGNING=y CONFIG_BT_SMP_SC_ONLY=y CONFIG_ZTEST=y +CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/bluetooth/init/prj_9.conf b/tests/bluetooth/init/prj_9.conf index 039d017620bd8..8752a1166a4a9 100644 --- a/tests/bluetooth/init/prj_9.conf +++ b/tests/bluetooth/init/prj_9.conf @@ -7,3 +7,4 @@ CONFIG_BT_SMP_SC_ONLY=y CONFIG_BT_TINYCRYPT_ECC=y CONFIG_ZTEST=y +CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/bluetooth/init/prj_controller.conf b/tests/bluetooth/init/prj_controller.conf index 1a9cd700ad336..29d3e7481b873 100644 --- a/tests/bluetooth/init/prj_controller.conf +++ b/tests/bluetooth/init/prj_controller.conf @@ -15,3 +15,4 @@ CONFIG_FLASH=y CONFIG_SOC_FLASH_NRF_RADIO_SYNC=y CONFIG_ZTEST=y +CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/bluetooth/init/prj_controller_4_0.conf b/tests/bluetooth/init/prj_controller_4_0.conf index bb336fe9ba977..386b8194accbf 100644 --- a/tests/bluetooth/init/prj_controller_4_0.conf +++ b/tests/bluetooth/init/prj_controller_4_0.conf @@ -41,3 +41,4 @@ CONFIG_FLASH=y CONFIG_SOC_FLASH_NRF_RADIO_SYNC=y CONFIG_ZTEST=y +CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/bluetooth/init/prj_controller_4_0_ll_sw_split.conf b/tests/bluetooth/init/prj_controller_4_0_ll_sw_split.conf index d5e4d0b5b7254..dd55f01e6776e 100644 --- a/tests/bluetooth/init/prj_controller_4_0_ll_sw_split.conf +++ b/tests/bluetooth/init/prj_controller_4_0_ll_sw_split.conf @@ -41,3 +41,4 @@ CONFIG_FLASH=y CONFIG_SOC_FLASH_NRF_RADIO_SYNC=y CONFIG_ZTEST=y +CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/bluetooth/init/prj_controller_dbg.conf b/tests/bluetooth/init/prj_controller_dbg.conf index f89520fbfef4c..181faeea478a1 100644 --- a/tests/bluetooth/init/prj_controller_dbg.conf +++ b/tests/bluetooth/init/prj_controller_dbg.conf @@ -61,3 +61,4 @@ CONFIG_DEBUG=y CONFIG_FLASH=y CONFIG_SOC_FLASH_NRF_RADIO_SYNC=n CONFIG_ZTEST=y +CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/bluetooth/init/prj_controller_dbg_ll_sw_split.conf b/tests/bluetooth/init/prj_controller_dbg_ll_sw_split.conf index 68ca7a6688259..2c00a78378627 100644 --- a/tests/bluetooth/init/prj_controller_dbg_ll_sw_split.conf +++ b/tests/bluetooth/init/prj_controller_dbg_ll_sw_split.conf @@ -61,3 +61,4 @@ CONFIG_DEBUG=y CONFIG_FLASH=y CONFIG_SOC_FLASH_NRF_RADIO_SYNC=n CONFIG_ZTEST=y +CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/bluetooth/init/prj_controller_ll_sw_split.conf b/tests/bluetooth/init/prj_controller_ll_sw_split.conf index 1abff9811e930..0c68086c735d7 100644 --- a/tests/bluetooth/init/prj_controller_ll_sw_split.conf +++ b/tests/bluetooth/init/prj_controller_ll_sw_split.conf @@ -15,3 +15,4 @@ CONFIG_FLASH=y CONFIG_SOC_FLASH_NRF_RADIO_SYNC=y CONFIG_ZTEST=y +CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/bluetooth/init/prj_controller_tiny.conf b/tests/bluetooth/init/prj_controller_tiny.conf index 1691ef666b186..d97b0acd1047a 100644 --- a/tests/bluetooth/init/prj_controller_tiny.conf +++ b/tests/bluetooth/init/prj_controller_tiny.conf @@ -46,3 +46,4 @@ CONFIG_FLASH=y CONFIG_SOC_FLASH_NRF_RADIO_SYNC=y CONFIG_ZTEST=y +CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/bluetooth/init/prj_controller_tiny_ll_sw_split.conf b/tests/bluetooth/init/prj_controller_tiny_ll_sw_split.conf index 80df497752a05..527db1460c08d 100644 --- a/tests/bluetooth/init/prj_controller_tiny_ll_sw_split.conf +++ b/tests/bluetooth/init/prj_controller_tiny_ll_sw_split.conf @@ -46,3 +46,4 @@ CONFIG_FLASH=y CONFIG_SOC_FLASH_NRF_RADIO_SYNC=y CONFIG_ZTEST=y +CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/bluetooth/init/prj_h5.conf b/tests/bluetooth/init/prj_h5.conf index 8fc87b3bfd91e..bb2ac83fcd1e5 100644 --- a/tests/bluetooth/init/prj_h5.conf +++ b/tests/bluetooth/init/prj_h5.conf @@ -2,3 +2,4 @@ CONFIG_BT=y CONFIG_BT_H5=y CONFIG_ZTEST=y +CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/bluetooth/init/prj_h5_dbg.conf b/tests/bluetooth/init/prj_h5_dbg.conf index f18bd6e6c4616..23550031d5360 100644 --- a/tests/bluetooth/init/prj_h5_dbg.conf +++ b/tests/bluetooth/init/prj_h5_dbg.conf @@ -4,3 +4,4 @@ CONFIG_BT_DEBUG_LOG=y CONFIG_BT_DEBUG_HCI_DRIVER=y CONFIG_ZTEST=y +CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/bluetooth/l2cap/prj.conf b/tests/bluetooth/l2cap/prj.conf index 33a932ebb4829..e876a3178e470 100644 --- a/tests/bluetooth/l2cap/prj.conf +++ b/tests/bluetooth/l2cap/prj.conf @@ -9,3 +9,4 @@ CONFIG_BT_DEBUG_LOG=y CONFIG_BT_PERIPHERAL=y CONFIG_BT_SMP=y CONFIG_BT_L2CAP_DYNAMIC_CHANNEL=y +CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/bluetooth/mesh_shell/prj.conf b/tests/bluetooth/mesh_shell/prj.conf index d82148d3f9359..77df2f3b81459 100644 --- a/tests/bluetooth/mesh_shell/prj.conf +++ b/tests/bluetooth/mesh_shell/prj.conf @@ -73,3 +73,4 @@ CONFIG_BT_DEBUG_LOG=y CONFIG_BT_MESH_IV_UPDATE_TEST=y CONFIG_BT_MESH_DEBUG=y +CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/bluetooth/shell/mesh.conf b/tests/bluetooth/shell/mesh.conf index 4161f2ee50b5b..4d2e701c50cde 100644 --- a/tests/bluetooth/shell/mesh.conf +++ b/tests/bluetooth/shell/mesh.conf @@ -46,3 +46,4 @@ CONFIG_BT_MESH_MODEL_GROUP_COUNT=2 CONFIG_BT_MESH_IV_UPDATE_TEST=y CONFIG_BT_MESH_DEBUG=y +CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/bluetooth/shell/prj.conf b/tests/bluetooth/shell/prj.conf index 029a64ff456de..2e39c0bbad740 100644 --- a/tests/bluetooth/shell/prj.conf +++ b/tests/bluetooth/shell/prj.conf @@ -33,3 +33,4 @@ CONFIG_FCB=y CONFIG_SETTINGS=y CONFIG_SETTINGS_FCB=y +CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/bluetooth/shell/prj_br.conf b/tests/bluetooth/shell/prj_br.conf index 42f663e28378e..3e928af32a52a 100644 --- a/tests/bluetooth/shell/prj_br.conf +++ b/tests/bluetooth/shell/prj_br.conf @@ -16,3 +16,4 @@ CONFIG_BT_GATT_HRS=y CONFIG_BT_L2CAP_DYNAMIC_CHANNEL=y CONFIG_BT_TINYCRYPT_ECC=y CONFIG_BT_DEVICE_NAME="test shell" +CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/bluetooth/uuid/prj.conf b/tests/bluetooth/uuid/prj.conf index fec5098eecffe..5521412ab5b68 100644 --- a/tests/bluetooth/uuid/prj.conf +++ b/tests/bluetooth/uuid/prj.conf @@ -4,3 +4,4 @@ CONFIG_ZTEST=y CONFIG_BT=y CONFIG_BT_CTLR=n CONFIG_BT_NO_DRIVER=y +CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/drivers/adc/adc_api/prj.conf b/tests/drivers/adc/adc_api/prj.conf index c307b998b93be..beea391af3741 100644 --- a/tests/drivers/adc/adc_api/prj.conf +++ b/tests/drivers/adc/adc_api/prj.conf @@ -8,3 +8,4 @@ CONFIG_ADC_LOG_LEVEL_INF=y CONFIG_LOG_IMMEDIATE=y CONFIG_HEAP_MEM_POOL_SIZE=1024 CONFIG_TEST_USERSPACE=y +CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/drivers/build_all/drivers.conf b/tests/drivers/build_all/drivers.conf index 2e271d7c00512..acc62566bdd89 100644 --- a/tests/drivers/build_all/drivers.conf +++ b/tests/drivers/build_all/drivers.conf @@ -12,3 +12,8 @@ CONFIG_SPI=y CONFIG_WATCHDOG=y CONFIG_X86_KERNEL_OOPS=n CONFIG_TEST_USERSPACE=y +CONFIG_SYS_TIMEOUT_LEGACY_API=y +CONFIG_SYS_TIMEOUT_LEGACY_API=y +CONFIG_SYS_TIMEOUT_LEGACY_API=y +CONFIG_SYS_TIMEOUT_LEGACY_API=y +CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/drivers/build_all/ethernet.conf b/tests/drivers/build_all/ethernet.conf index 2849f8e4dfe18..d1acdbe0736cc 100644 --- a/tests/drivers/build_all/ethernet.conf +++ b/tests/drivers/build_all/ethernet.conf @@ -11,3 +11,8 @@ CONFIG_TEST_USERSPACE=y CONFIG_SPI=y CONFIG_ETH_ENC28J60=y CONFIG_ETH_ENC28J60_0=y +CONFIG_SYS_TIMEOUT_LEGACY_API=y +CONFIG_SYS_TIMEOUT_LEGACY_API=y +CONFIG_SYS_TIMEOUT_LEGACY_API=y +CONFIG_SYS_TIMEOUT_LEGACY_API=y +CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/drivers/build_all/gpio.conf b/tests/drivers/build_all/gpio.conf index dfb1ed6861c17..fe3b6d9091080 100644 --- a/tests/drivers/build_all/gpio.conf +++ b/tests/drivers/build_all/gpio.conf @@ -3,3 +3,8 @@ CONFIG_GPIO=y CONFIG_TEST_USERSPACE=y CONFIG_I2C=y CONFIG_GPIO_SX1509B=y +CONFIG_SYS_TIMEOUT_LEGACY_API=y +CONFIG_SYS_TIMEOUT_LEGACY_API=y +CONFIG_SYS_TIMEOUT_LEGACY_API=y +CONFIG_SYS_TIMEOUT_LEGACY_API=y +CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/drivers/build_all/prj.conf b/tests/drivers/build_all/prj.conf index 901353030a129..aae20b3266729 100644 --- a/tests/drivers/build_all/prj.conf +++ b/tests/drivers/build_all/prj.conf @@ -1,2 +1,7 @@ CONFIG_TEST=y CONFIG_TEST_USERSPACE=y +CONFIG_SYS_TIMEOUT_LEGACY_API=y +CONFIG_SYS_TIMEOUT_LEGACY_API=y +CONFIG_SYS_TIMEOUT_LEGACY_API=y +CONFIG_SYS_TIMEOUT_LEGACY_API=y +CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/drivers/build_all/sensors_a_h.conf b/tests/drivers/build_all/sensors_a_h.conf index 4cb9706053258..50157ea2d8d17 100644 --- a/tests/drivers/build_all/sensors_a_h.conf +++ b/tests/drivers/build_all/sensors_a_h.conf @@ -28,3 +28,8 @@ CONFIG_FXOS8700=y CONFIG_HMC5883L=y CONFIG_HP206C=y CONFIG_HTS221=y +CONFIG_SYS_TIMEOUT_LEGACY_API=y +CONFIG_SYS_TIMEOUT_LEGACY_API=y +CONFIG_SYS_TIMEOUT_LEGACY_API=y +CONFIG_SYS_TIMEOUT_LEGACY_API=y +CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/drivers/build_all/sensors_i_z.conf b/tests/drivers/build_all/sensors_i_z.conf index a37cbae0e05bf..23de240d9bd0a 100644 --- a/tests/drivers/build_all/sensors_i_z.conf +++ b/tests/drivers/build_all/sensors_i_z.conf @@ -33,3 +33,8 @@ CONFIG_TI_HDC=y CONFIG_TMP007=y CONFIG_TMP112=y CONFIG_VL53L0X=y +CONFIG_SYS_TIMEOUT_LEGACY_API=y +CONFIG_SYS_TIMEOUT_LEGACY_API=y +CONFIG_SYS_TIMEOUT_LEGACY_API=y +CONFIG_SYS_TIMEOUT_LEGACY_API=y +CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/drivers/build_all/sensors_stmemsc.conf b/tests/drivers/build_all/sensors_stmemsc.conf index b2f81d4405ae3..a850baa5e8fe9 100644 --- a/tests/drivers/build_all/sensors_stmemsc.conf +++ b/tests/drivers/build_all/sensors_stmemsc.conf @@ -6,3 +6,8 @@ CONFIG_GPIO=y CONFIG_SPI=y CONFIG_SENSOR=y CONFIG_LIS2DW12=y +CONFIG_SYS_TIMEOUT_LEGACY_API=y +CONFIG_SYS_TIMEOUT_LEGACY_API=y +CONFIG_SYS_TIMEOUT_LEGACY_API=y +CONFIG_SYS_TIMEOUT_LEGACY_API=y +CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/drivers/build_all/sensors_stmemsc_trigger.conf b/tests/drivers/build_all/sensors_stmemsc_trigger.conf index 65cafc94f4a7a..e1b2cbee03edf 100644 --- a/tests/drivers/build_all/sensors_stmemsc_trigger.conf +++ b/tests/drivers/build_all/sensors_stmemsc_trigger.conf @@ -7,3 +7,8 @@ CONFIG_SPI=y CONFIG_SENSOR=y CONFIG_LIS2DW12=y CONFIG_LIS2DW12_TRIGGER_OWN_THREAD=y +CONFIG_SYS_TIMEOUT_LEGACY_API=y +CONFIG_SYS_TIMEOUT_LEGACY_API=y +CONFIG_SYS_TIMEOUT_LEGACY_API=y +CONFIG_SYS_TIMEOUT_LEGACY_API=y +CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/drivers/build_all/sensors_trigger_a_h.conf b/tests/drivers/build_all/sensors_trigger_a_h.conf index 12bf5a5aa6a16..652645419000a 100644 --- a/tests/drivers/build_all/sensors_trigger_a_h.conf +++ b/tests/drivers/build_all/sensors_trigger_a_h.conf @@ -32,3 +32,8 @@ CONFIG_HMC5883L=y CONFIG_HMC5883L_TRIGGER_OWN_THREAD=y CONFIG_HTS221=y CONFIG_HTS221_TRIGGER_OWN_THREAD=y +CONFIG_SYS_TIMEOUT_LEGACY_API=y +CONFIG_SYS_TIMEOUT_LEGACY_API=y +CONFIG_SYS_TIMEOUT_LEGACY_API=y +CONFIG_SYS_TIMEOUT_LEGACY_API=y +CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/drivers/build_all/sensors_trigger_i_z.conf b/tests/drivers/build_all/sensors_trigger_i_z.conf index 6b62220fe3c7e..c36b5af56dedf 100644 --- a/tests/drivers/build_all/sensors_trigger_i_z.conf +++ b/tests/drivers/build_all/sensors_trigger_i_z.conf @@ -32,3 +32,8 @@ CONFIG_SX9500=y CONFIG_SX9500_TRIGGER_OWN_THREAD=y CONFIG_TMP007=y CONFIG_TMP007_TRIGGER_OWN_THREAD=y +CONFIG_SYS_TIMEOUT_LEGACY_API=y +CONFIG_SYS_TIMEOUT_LEGACY_API=y +CONFIG_SYS_TIMEOUT_LEGACY_API=y +CONFIG_SYS_TIMEOUT_LEGACY_API=y +CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/drivers/can/api/prj.conf b/tests/drivers/can/api/prj.conf index f9126d9886309..921ed18529e94 100644 --- a/tests/drivers/can/api/prj.conf +++ b/tests/drivers/can/api/prj.conf @@ -1,2 +1,3 @@ CONFIG_CAN=y CONFIG_ZTEST=y +CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/drivers/can/stm32/prj.conf b/tests/drivers/can/stm32/prj.conf index f9126d9886309..921ed18529e94 100644 --- a/tests/drivers/can/stm32/prj.conf +++ b/tests/drivers/can/stm32/prj.conf @@ -1,2 +1,3 @@ CONFIG_CAN=y CONFIG_ZTEST=y +CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/drivers/ipm/prj.conf b/tests/drivers/ipm/prj.conf index c003e22202a43..7d423e8802633 100644 --- a/tests/drivers/ipm/prj.conf +++ b/tests/drivers/ipm/prj.conf @@ -6,3 +6,4 @@ CONFIG_IPM_CONSOLE_RECEIVER=y CONFIG_IPM_CONSOLE_SENDER=y CONFIG_IRQ_OFFLOAD=y CONFIG_MP_NUM_CPUS=1 +CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/drivers/spi/spi_loopback/prj.conf b/tests/drivers/spi/spi_loopback/prj.conf index 44d2eeb866411..d13d3ba67966e 100644 --- a/tests/drivers/spi/spi_loopback/prj.conf +++ b/tests/drivers/spi/spi_loopback/prj.conf @@ -6,3 +6,4 @@ CONFIG_SPI_ASYNC=y CONFIG_SPI_LOG_LEVEL_INF=y CONFIG_LOG_IMMEDIATE=y CONFIG_ZTEST=y +CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/drivers/uart/uart_async_api/prj.conf b/tests/drivers/uart/uart_async_api/prj.conf index e2dae2ee1a365..728a4f9553bf3 100644 --- a/tests/drivers/uart/uart_async_api/prj.conf +++ b/tests/drivers/uart/uart_async_api/prj.conf @@ -1,3 +1,4 @@ CONFIG_SERIAL=y CONFIG_UART_ASYNC_API=y CONFIG_ZTEST=y +CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/drivers/uart/uart_basic_api/prj.conf b/tests/drivers/uart/uart_basic_api/prj.conf index d12c995df0941..173a6fa42fe22 100644 --- a/tests/drivers/uart/uart_basic_api/prj.conf +++ b/tests/drivers/uart/uart_basic_api/prj.conf @@ -2,3 +2,4 @@ CONFIG_SERIAL=y CONFIG_UART_INTERRUPT_DRIVEN=y CONFIG_ZTEST=y CONFIG_NATIVE_UART_0_ON_STDINOUT=y +CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/drivers/uart/uart_basic_api/prj_poll.conf b/tests/drivers/uart/uart_basic_api/prj_poll.conf index 772072f1c4d34..8735eb238c31f 100644 --- a/tests/drivers/uart/uart_basic_api/prj_poll.conf +++ b/tests/drivers/uart/uart_basic_api/prj_poll.conf @@ -1,3 +1,4 @@ CONFIG_SERIAL=y CONFIG_ZTEST=y CONFIG_NATIVE_UART_0_ON_STDINOUT=y +CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/drivers/uart/uart_basic_api/prj_shell.conf b/tests/drivers/uart/uart_basic_api/prj_shell.conf index 6ecbf8931a495..5880c35882b1e 100644 --- a/tests/drivers/uart/uart_basic_api/prj_shell.conf +++ b/tests/drivers/uart/uart_basic_api/prj_shell.conf @@ -4,3 +4,4 @@ CONFIG_ZTEST=y CONFIG_SHELL_CMD_BUFF_SIZE=90 CONFIG_SHELL=y CONFIG_NATIVE_UART_0_ON_STDINOUT=y +CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/lib/fdtable/prj.conf b/tests/lib/fdtable/prj.conf index 39eb3bf1b0a66..4096602b11a49 100644 --- a/tests/lib/fdtable/prj.conf +++ b/tests/lib/fdtable/prj.conf @@ -1,2 +1,3 @@ CONFIG_ZTEST=y CONFIG_POSIX_API=y +CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/misc/test_build/debug.conf b/tests/misc/test_build/debug.conf index aede3729cbb9e..e37d00e3fca4e 100644 --- a/tests/misc/test_build/debug.conf +++ b/tests/misc/test_build/debug.conf @@ -3,3 +3,4 @@ CONFIG_DEBUG=y CONFIG_STDOUT_CONSOLE=y CONFIG_KERNEL_DEBUG=y CONFIG_ASSERT=y +CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/misc/test_build/src/main.c b/tests/misc/test_build/src/main.c index 1d28987b92e12..e090edd40e2b8 100644 --- a/tests/misc/test_build/src/main.c +++ b/tests/misc/test_build/src/main.c @@ -87,4 +87,4 @@ void threadA(void *dummy1, void *dummy2, void *dummy3) } K_THREAD_DEFINE(threadA_id, STACKSIZE, threadA, NULL, NULL, NULL, - PRIORITY, 0, K_NO_WAIT); + PRIORITY, 0, 0); diff --git a/tests/net/6lo/prj.conf b/tests/net/6lo/prj.conf index 87cdfc6a0939b..546cb094502e2 100644 --- a/tests/net/6lo/prj.conf +++ b/tests/net/6lo/prj.conf @@ -20,3 +20,4 @@ CONFIG_NET_6LO_CONTEXT=y #Before modifying this value, add respective code in src/main.c CONFIG_NET_MAX_6LO_CONTEXTS=2 CONFIG_ZTEST=y +CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/net/arp/prj.conf b/tests/net/arp/prj.conf index a45a27fe3a68b..bf96a8597e9b0 100644 --- a/tests/net/arp/prj.conf +++ b/tests/net/arp/prj.conf @@ -15,3 +15,4 @@ CONFIG_TEST_RANDOM_GENERATOR=y CONFIG_NET_IF_UNICAST_IPV4_ADDR_COUNT=3 CONFIG_NET_IPV6=n CONFIG_ZTEST=y +CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/net/buf/prj.conf b/tests/net/buf/prj.conf index 47e462402b35a..8ded729467004 100644 --- a/tests/net/buf/prj.conf +++ b/tests/net/buf/prj.conf @@ -4,3 +4,4 @@ CONFIG_HEAP_MEM_POOL_SIZE=4096 #CONFIG_NET_BUF_LOG=y #CONFIG_NET_BUF_LOG_LEVEL_DBG=y CONFIG_ZTEST=y +CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/net/checksum_offload/prj.conf b/tests/net/checksum_offload/prj.conf index 0453b6b13ae6f..b860ba7f033c1 100644 --- a/tests/net/checksum_offload/prj.conf +++ b/tests/net/checksum_offload/prj.conf @@ -31,3 +31,4 @@ CONFIG_ETH_MCUX=n CONFIG_ETH_SAM_GMAC=n CONFIG_ETH_ENC28J60=n CONFIG_ETH_STM32_HAL=n +CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/net/context/prj.conf b/tests/net/context/prj.conf index 2b759c7e0088c..0096bc9a8af06 100644 --- a/tests/net/context/prj.conf +++ b/tests/net/context/prj.conf @@ -20,3 +20,4 @@ CONFIG_NET_PKT_RX_COUNT=5 CONFIG_NET_BUF_RX_COUNT=10 CONFIG_NET_BUF_TX_COUNT=10 CONFIG_ZTEST=y +CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/net/dhcpv4/prj.conf b/tests/net/dhcpv4/prj.conf index 60d161aafdc04..0412b9c607177 100644 --- a/tests/net/dhcpv4/prj.conf +++ b/tests/net/dhcpv4/prj.conf @@ -27,3 +27,4 @@ CONFIG_NET_UDP_CHECKSUM=n CONFIG_MAIN_STACK_SIZE=3072 CONFIG_ZTEST=y CONFIG_NET_DHCPV4_INITIAL_DELAY_MAX=2 +CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/net/ethernet_mgmt/prj.conf b/tests/net/ethernet_mgmt/prj.conf index ee65bc9327eb8..72c8195d16b78 100644 --- a/tests/net/ethernet_mgmt/prj.conf +++ b/tests/net/ethernet_mgmt/prj.conf @@ -16,3 +16,4 @@ CONFIG_NET_IPV6_DAD=n CONFIG_NET_IPV6_MLD=n CONFIG_NET_IPV6_NBR_CACHE=n CONFIG_TEST_RANDOM_GENERATOR=y +CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/net/icmpv6/prj.conf b/tests/net/icmpv6/prj.conf index 8fd3358b8690d..c6a78467a08c7 100644 --- a/tests/net/icmpv6/prj.conf +++ b/tests/net/icmpv6/prj.conf @@ -14,3 +14,4 @@ CONFIG_TEST_RANDOM_GENERATOR=y CONFIG_ZTEST=y CONFIG_MAIN_STACK_SIZE=1280 +CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/net/iface/prj.conf b/tests/net/iface/prj.conf index dc3825c1c0650..4e24cf41839b7 100644 --- a/tests/net/iface/prj.conf +++ b/tests/net/iface/prj.conf @@ -28,3 +28,4 @@ CONFIG_NET_IF_MAX_IPV4_COUNT=4 CONFIG_NET_IF_MAX_IPV6_COUNT=4 CONFIG_TEST_USERSPACE=y CONFIG_NET_IF_USERSPACE_ACCESS=y +CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/net/ip-addr/prj.conf b/tests/net/ip-addr/prj.conf index 648b6ef4cc4cc..59a3f5f7d26b3 100644 --- a/tests/net/ip-addr/prj.conf +++ b/tests/net/ip-addr/prj.conf @@ -18,3 +18,4 @@ CONFIG_NET_IF_UNICAST_IPV4_ADDR_COUNT=2 CONFIG_NET_IF_MCAST_IPV4_ADDR_COUNT=3 CONFIG_NET_L2_DUMMY=y CONFIG_ZTEST=y +CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/net/ipv6/prj.conf b/tests/net/ipv6/prj.conf index 48fe041d84ffd..b76a8400c6124 100644 --- a/tests/net/ipv6/prj.conf +++ b/tests/net/ipv6/prj.conf @@ -24,3 +24,4 @@ CONFIG_NET_IF_UNICAST_IPV6_ADDR_COUNT=9 CONFIG_NET_IF_MCAST_IPV6_ADDR_COUNT=7 CONFIG_NET_IF_IPV6_PREFIX_COUNT=3 CONFIG_NET_UDP_CHECKSUM=n +CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/net/ipv6_fragment/prj.conf b/tests/net/ipv6_fragment/prj.conf index aaa6723967942..111f84bd5b42e 100644 --- a/tests/net/ipv6_fragment/prj.conf +++ b/tests/net/ipv6_fragment/prj.conf @@ -28,3 +28,4 @@ CONFIG_ZTEST=y CONFIG_INIT_STACKS=y CONFIG_PRINTK=y CONFIG_NET_STATISTICS=n +CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/net/lib/coap/prj.conf b/tests/net/lib/coap/prj.conf index 5ea00b6a224b4..1d14ca631dcb5 100644 --- a/tests/net/lib/coap/prj.conf +++ b/tests/net/lib/coap/prj.conf @@ -28,3 +28,4 @@ CONFIG_COAP_LOG_LEVEL_DBG=y CONFIG_MAIN_STACK_SIZE=2048 CONFIG_HEAP_MEM_POOL_SIZE=2048 +CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/net/lib/dns_addremove/prj.conf b/tests/net/lib/dns_addremove/prj.conf index 5d0330c022aed..520afb2d102de 100644 --- a/tests/net/lib/dns_addremove/prj.conf +++ b/tests/net/lib/dns_addremove/prj.conf @@ -17,3 +17,4 @@ CONFIG_NET_ARP=n CONFIG_PRINTK=y CONFIG_ZTEST=y CONFIG_MAIN_STACK_SIZE=1024 +CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/net/lib/dns_packet/prj.conf b/tests/net/lib/dns_packet/prj.conf index 1a627899c0afb..c67f1ed51f071 100644 --- a/tests/net/lib/dns_packet/prj.conf +++ b/tests/net/lib/dns_packet/prj.conf @@ -12,3 +12,4 @@ CONFIG_PRINTK=y CONFIG_ZTEST=y CONFIG_MAIN_STACK_SIZE=1280 +CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/net/lib/dns_resolve/prj-no-ipv6.conf b/tests/net/lib/dns_resolve/prj-no-ipv6.conf index 8fc1f5d908740..f2a7993492215 100644 --- a/tests/net/lib/dns_resolve/prj-no-ipv6.conf +++ b/tests/net/lib/dns_resolve/prj-no-ipv6.conf @@ -26,3 +26,4 @@ CONFIG_PRINTK=y CONFIG_ZTEST=y CONFIG_MAIN_STACK_SIZE=1344 +CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/net/lib/dns_resolve/prj.conf b/tests/net/lib/dns_resolve/prj.conf index 0ce99bfad13b1..9da85cace6772 100644 --- a/tests/net/lib/dns_resolve/prj.conf +++ b/tests/net/lib/dns_resolve/prj.conf @@ -28,3 +28,4 @@ CONFIG_PRINTK=y CONFIG_ZTEST=y CONFIG_MAIN_STACK_SIZE=1344 +CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/net/lib/http_header_fields/prj.conf b/tests/net/lib/http_header_fields/prj.conf index 8323faf5bc10b..3dc1ae181e192 100644 --- a/tests/net/lib/http_header_fields/prj.conf +++ b/tests/net/lib/http_header_fields/prj.conf @@ -8,3 +8,4 @@ CONFIG_ZTEST=y CONFIG_MAIN_STACK_SIZE=1280 # Enable strict parser by uncommenting the following line # CONFIG_HTTP_PARSER_STRICT=y +CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/net/lib/mqtt_packet/prj.conf b/tests/net/lib/mqtt_packet/prj.conf index 1c4a907a1558e..2161cfe29ec85 100644 --- a/tests/net/lib/mqtt_packet/prj.conf +++ b/tests/net/lib/mqtt_packet/prj.conf @@ -11,3 +11,4 @@ CONFIG_MQTT_LIB=y CONFIG_ZTEST=y CONFIG_TEST_USERSPACE=y CONFIG_MAIN_STACK_SIZE=1280 +CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/net/lib/mqtt_publisher/prj.conf b/tests/net/lib/mqtt_publisher/prj.conf index c9342459893e6..0f243343a743c 100644 --- a/tests/net/lib/mqtt_publisher/prj.conf +++ b/tests/net/lib/mqtt_publisher/prj.conf @@ -32,3 +32,4 @@ CONFIG_MAIN_STACK_SIZE=2048 CONFIG_NET_BUF_DATA_SIZE=256 CONFIG_ZTEST=y +CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/net/lib/mqtt_publisher/prj_tls.conf b/tests/net/lib/mqtt_publisher/prj_tls.conf index 2cae009847229..76f7d8a00931f 100644 --- a/tests/net/lib/mqtt_publisher/prj_tls.conf +++ b/tests/net/lib/mqtt_publisher/prj_tls.conf @@ -48,3 +48,4 @@ CONFIG_MBEDTLS_HEAP_SIZE=30000 # for tls_entropy_func CONFIG_TEST_RANDOM_GENERATOR=y CONFIG_ZTEST=y +CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/net/lib/mqtt_pubsub/prj.conf b/tests/net/lib/mqtt_pubsub/prj.conf index 368a9c283ddb3..2c8792aaa32bc 100644 --- a/tests/net/lib/mqtt_pubsub/prj.conf +++ b/tests/net/lib/mqtt_pubsub/prj.conf @@ -32,3 +32,4 @@ CONFIG_MAIN_STACK_SIZE=2048 CONFIG_NET_BUF_DATA_SIZE=256 CONFIG_ZTEST=y +CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/net/lib/mqtt_subscriber/prj.conf b/tests/net/lib/mqtt_subscriber/prj.conf index 368a9c283ddb3..2c8792aaa32bc 100644 --- a/tests/net/lib/mqtt_subscriber/prj.conf +++ b/tests/net/lib/mqtt_subscriber/prj.conf @@ -32,3 +32,4 @@ CONFIG_MAIN_STACK_SIZE=2048 CONFIG_NET_BUF_DATA_SIZE=256 CONFIG_ZTEST=y +CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/net/lib/tls_credentials/prj.conf b/tests/net/lib/tls_credentials/prj.conf index 10d4559adb8cc..3a1ce35d58824 100644 --- a/tests/net/lib/tls_credentials/prj.conf +++ b/tests/net/lib/tls_credentials/prj.conf @@ -4,3 +4,4 @@ CONFIG_NETWORKING=y CONFIG_TEST_RANDOM_GENERATOR=y CONFIG_TLS_CREDENTIALS=y CONFIG_TLS_MAX_CREDENTIALS_NUMBER=4 +CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/net/mgmt/prj.conf b/tests/net/mgmt/prj.conf index 9a924c059e99a..00f72be77d079 100644 --- a/tests/net/mgmt/prj.conf +++ b/tests/net/mgmt/prj.conf @@ -17,3 +17,4 @@ CONFIG_NET_MGMT_EVENT_INFO=y CONFIG_NET_IPV6=y CONFIG_NET_L2_DUMMY=y CONFIG_ZTEST=y +CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/net/mld/prj.conf b/tests/net/mld/prj.conf index a99599b160ab0..883fadd05cbcf 100644 --- a/tests/net/mld/prj.conf +++ b/tests/net/mld/prj.conf @@ -21,3 +21,4 @@ CONFIG_NET_MGMT=y CONFIG_NET_MGMT_EVENT=y CONFIG_NET_IF_UNICAST_IPV6_ADDR_COUNT=4 CONFIG_NET_IF_MCAST_IPV6_ADDR_COUNT=4 +CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/net/neighbor/prj.conf b/tests/net/neighbor/prj.conf index 9b0844ee27d90..70001fe9800be 100644 --- a/tests/net/neighbor/prj.conf +++ b/tests/net/neighbor/prj.conf @@ -14,3 +14,4 @@ CONFIG_TEST_RANDOM_GENERATOR=y CONFIG_NET_IF_UNICAST_IPV4_ADDR_COUNT=3 CONFIG_NET_IPV6_MAX_NEIGHBORS=4 CONFIG_ZTEST=y +CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/net/net_pkt/prj.conf b/tests/net/net_pkt/prj.conf index 764d86554af08..cd1b773c1ad5d 100644 --- a/tests/net/net_pkt/prj.conf +++ b/tests/net/net_pkt/prj.conf @@ -12,3 +12,4 @@ CONFIG_NET_LOG=y CONFIG_ENTROPY_GENERATOR=y CONFIG_TEST_RANDOM_GENERATOR=y +CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/net/promiscuous/prj.conf b/tests/net/promiscuous/prj.conf index 5f56de6e98e81..a8c453014867f 100644 --- a/tests/net/promiscuous/prj.conf +++ b/tests/net/promiscuous/prj.conf @@ -22,3 +22,4 @@ CONFIG_NET_IF_UNICAST_IPV6_ADDR_COUNT=6 CONFIG_NET_IPV6_MAX_NEIGHBORS=1 CONFIG_NET_IPV6_ND=n CONFIG_ZTEST=y +CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/net/ptp/clock/prj.conf b/tests/net/ptp/clock/prj.conf index 364cd61141a44..ca22479bc24e6 100644 --- a/tests/net/ptp/clock/prj.conf +++ b/tests/net/ptp/clock/prj.conf @@ -26,3 +26,4 @@ CONFIG_ETH_NATIVE_POSIX=n CONFIG_COVERAGE=n CONFIG_TEST_USERSPACE=y CONFIG_HEAP_MEM_POOL_SIZE=128 +CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/net/route/prj.conf b/tests/net/route/prj.conf index c78b9dbc85f1c..c0fcd1e646874 100644 --- a/tests/net/route/prj.conf +++ b/tests/net/route/prj.conf @@ -20,3 +20,4 @@ CONFIG_NET_MAX_ROUTES=4 CONFIG_NET_MAX_NEXTHOPS=8 CONFIG_NET_IPV6_MAX_NEIGHBORS=8 CONFIG_ZTEST=y +CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/net/socket/getaddrinfo/prj.conf b/tests/net/socket/getaddrinfo/prj.conf index 24c960fa1ecfc..c75a18760f186 100644 --- a/tests/net/socket/getaddrinfo/prj.conf +++ b/tests/net/socket/getaddrinfo/prj.conf @@ -38,3 +38,4 @@ CONFIG_NEWLIB_LIBC_ALIGNED_HEAP_SIZE=256 CONFIG_NET_IPV6_DAD=n CONFIG_NET_IPV6_ND=n CONFIG_NET_IPV6_MLD=n +CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/net/socket/getnameinfo/prj.conf b/tests/net/socket/getnameinfo/prj.conf index 4a1c4ed644097..3e910b31b43eb 100644 --- a/tests/net/socket/getnameinfo/prj.conf +++ b/tests/net/socket/getnameinfo/prj.conf @@ -32,3 +32,4 @@ CONFIG_ZTEST=y # User mode requirements CONFIG_TEST_USERSPACE=y CONFIG_HEAP_MEM_POOL_SIZE=128 +CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/net/socket/misc/prj.conf b/tests/net/socket/misc/prj.conf index cd4831e5eacd7..d63951b244d40 100644 --- a/tests/net/socket/misc/prj.conf +++ b/tests/net/socket/misc/prj.conf @@ -27,3 +27,4 @@ CONFIG_ZTEST=y # User mode requirements CONFIG_TEST_USERSPACE=y CONFIG_HEAP_MEM_POOL_SIZE=128 +CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/net/socket/net_mgmt/prj.conf b/tests/net/socket/net_mgmt/prj.conf index 82e5d8aa69c77..8e3519feed821 100644 --- a/tests/net/socket/net_mgmt/prj.conf +++ b/tests/net/socket/net_mgmt/prj.conf @@ -37,3 +37,4 @@ CONFIG_NET_IPV6_ND=n CONFIG_NET_IPV6_MLD=n CONFIG_NET_SOCKETS_LOG_LEVEL_DBG=y +CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/net/socket/poll/prj.conf b/tests/net/socket/poll/prj.conf index 84c5a2f17c6f5..a45883fb7d225 100644 --- a/tests/net/socket/poll/prj.conf +++ b/tests/net/socket/poll/prj.conf @@ -26,3 +26,5 @@ CONFIG_QEMU_TICKLESS_WORKAROUND=y CONFIG_NET_TEST=y CONFIG_NET_LOOPBACK=y + +CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/net/socket/register/prj.conf b/tests/net/socket/register/prj.conf index 3d66ea421b47e..d9572206d89a2 100644 --- a/tests/net/socket/register/prj.conf +++ b/tests/net/socket/register/prj.conf @@ -14,3 +14,4 @@ CONFIG_NET_SOCKETS=y CONFIG_NET_SOCKETS_POSIX_NAMES=y CONFIG_TEST_RANDOM_GENERATOR=y CONFIG_NET_MAX_CONTEXTS=10 +CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/net/socket/select/prj.conf b/tests/net/socket/select/prj.conf index b600de000ffcd..cdee8c4c1e43a 100644 --- a/tests/net/socket/select/prj.conf +++ b/tests/net/socket/select/prj.conf @@ -28,3 +28,4 @@ CONFIG_TEST_USERSPACE=y CONFIG_HEAP_MEM_POOL_SIZE=128 CONFIG_QEMU_TICKLESS_WORKAROUND=y +CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/net/socket/tcp/prj.conf b/tests/net/socket/tcp/prj.conf index 0a62fcb432da7..d5d31e03f6ad6 100644 --- a/tests/net/socket/tcp/prj.conf +++ b/tests/net/socket/tcp/prj.conf @@ -32,3 +32,4 @@ CONFIG_NET_PKT_TX_COUNT=24 CONFIG_ZTEST=y CONFIG_ZTEST_STACKSIZE=2048 +CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/net/socket/udp/prj.conf b/tests/net/socket/udp/prj.conf index c9d6ec7a49e22..a3dd3fda02c47 100644 --- a/tests/net/socket/udp/prj.conf +++ b/tests/net/socket/udp/prj.conf @@ -31,3 +31,4 @@ CONFIG_TEST_USERSPACE=y CONFIG_NET_CONTEXT_PRIORITY=y CONFIG_NET_CONTEXT_TXTIME=y +CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/net/tcp/prj.conf b/tests/net/tcp/prj.conf index d1ab0efae84d6..e6cc06cdbc963 100644 --- a/tests/net/tcp/prj.conf +++ b/tests/net/tcp/prj.conf @@ -27,3 +27,4 @@ CONFIG_NET_IPV6_DAD=n CONFIG_NET_IPV6_NBR_CACHE=n CONFIG_NET_IPV6_MLD=n CONFIG_NET_TCP_CHECKSUM=n +CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/net/traffic_class/prj.conf b/tests/net/traffic_class/prj.conf index 2e0620228949a..ebc07b6a9adb0 100644 --- a/tests/net/traffic_class/prj.conf +++ b/tests/net/traffic_class/prj.conf @@ -30,3 +30,4 @@ CONFIG_NET_TC_RX_COUNT=8 CONFIG_ZTEST=y CONFIG_NET_CONFIG_SETTINGS=n CONFIG_NET_SHELL=n +CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/net/trickle/prj.conf b/tests/net/trickle/prj.conf index d2ff49ce18310..9416d61fb64ac 100644 --- a/tests/net/trickle/prj.conf +++ b/tests/net/trickle/prj.conf @@ -18,3 +18,4 @@ CONFIG_ZTEST=y CONFIG_ZTEST_STACKSIZE=1024 CONFIG_NET_LOOPBACK=y CONFIG_NET_IPV6_MLD=n +CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/net/tx_timestamp/prj.conf b/tests/net/tx_timestamp/prj.conf index 6f1fb715dee58..2351bad068ae0 100644 --- a/tests/net/tx_timestamp/prj.conf +++ b/tests/net/tx_timestamp/prj.conf @@ -24,3 +24,4 @@ CONFIG_NET_SHELL=n CONFIG_NET_CONTEXT_TIMESTAMP=y CONFIG_NET_PKT_TIMESTAMP=y CONFIG_NET_PKT_TIMESTAMP_THREAD=y +CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/net/udp/prj.conf b/tests/net/udp/prj.conf index 42f43a32b046c..5de7544c56d42 100644 --- a/tests/net/udp/prj.conf +++ b/tests/net/udp/prj.conf @@ -22,3 +22,4 @@ CONFIG_NET_IF_UNICAST_IPV4_ADDR_COUNT=2 # Turn off UDP checksum checking as the test fails otherwise. CONFIG_NET_UDP_CHECKSUM=n CONFIG_ZTEST=y +CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/net/utils/prj.conf b/tests/net/utils/prj.conf index 91db600fe330b..a4ce7a04f76e8 100644 --- a/tests/net/utils/prj.conf +++ b/tests/net/utils/prj.conf @@ -17,3 +17,4 @@ CONFIG_NET_UDP=y CONFIG_ZTEST=y CONFIG_MAIN_STACK_SIZE=1280 CONFIG_TEST_USERSPACE=y +CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/net/vlan/prj.conf b/tests/net/vlan/prj.conf index 19b908bcd65ad..5b3333368c740 100644 --- a/tests/net/vlan/prj.conf +++ b/tests/net/vlan/prj.conf @@ -33,3 +33,4 @@ CONFIG_ETH_MCUX=n CONFIG_ETH_SAM_GMAC=n CONFIG_ETH_ENC28J60=n CONFIG_ETH_STM32_HAL=n +CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/portability/cmsis_rtos_v1/prj.conf b/tests/portability/cmsis_rtos_v1/prj.conf index 7ec7331cea0f7..b5a9eef782655 100644 --- a/tests/portability/cmsis_rtos_v1/prj.conf +++ b/tests/portability/cmsis_rtos_v1/prj.conf @@ -6,3 +6,4 @@ CONFIG_MAX_THREAD_BYTES=4 CONFIG_IRQ_OFFLOAD=y CONFIG_SMP=n +CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/portability/cmsis_rtos_v2/prj.conf b/tests/portability/cmsis_rtos_v2/prj.conf index ab8d18fcfd6e5..1a82048079260 100644 --- a/tests/portability/cmsis_rtos_v2/prj.conf +++ b/tests/portability/cmsis_rtos_v2/prj.conf @@ -16,3 +16,4 @@ CONFIG_CMSIS_V2_THREAD_DYNAMIC_MAX_COUNT=10 # The Zephyr CMSIS emulation assumes that ticks are ms, currently CONFIG_SYS_CLOCK_TICKS_PER_SEC=1000 +CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/posix/common/prj.conf b/tests/posix/common/prj.conf index 4f6a845b21c84..9e7cff2a9982e 100644 --- a/tests/posix/common/prj.conf +++ b/tests/posix/common/prj.conf @@ -8,3 +8,4 @@ CONFIG_HEAP_MEM_POOL_SIZE=4096 CONFIG_MAX_THREAD_BYTES=4 CONFIG_SMP=n +CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/posix/fs/prj.conf b/tests/posix/fs/prj.conf index 8bc3ff809b361..62a66f47aa648 100644 --- a/tests/posix/fs/prj.conf +++ b/tests/posix/fs/prj.conf @@ -7,3 +7,4 @@ CONFIG_POSIX_API=y CONFIG_POSIX_FS=y CONFIG_ZTEST=y CONFIG_MAIN_STACK_SIZE=4096 +CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/shell/prj.conf b/tests/shell/prj.conf index 93c5dadeee4fd..8b8a09262d5d8 100644 --- a/tests/shell/prj.conf +++ b/tests/shell/prj.conf @@ -7,3 +7,4 @@ CONFIG_SHELL_PRINTF_BUFF_SIZE=15 CONFIG_SHELL_METAKEYS=n CONFIG_LOG=n CONFIG_ZTEST=y +CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/subsys/fs/littlefs/prj.conf b/tests/subsys/fs/littlefs/prj.conf index 3458e1fb9ba66..e8465c96b2f46 100644 --- a/tests/subsys/fs/littlefs/prj.conf +++ b/tests/subsys/fs/littlefs/prj.conf @@ -20,3 +20,4 @@ CONFIG_FLASH_PAGE_LAYOUT=y CONFIG_ZTEST=y CONFIG_ZTEST_STACKSIZE=4096 +CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/subsys/jwt/prj.conf b/tests/subsys/jwt/prj.conf index 93412f96d2ff0..b1e2ab4e0d5c7 100644 --- a/tests/subsys/jwt/prj.conf +++ b/tests/subsys/jwt/prj.conf @@ -20,3 +20,4 @@ CONFIG_NET_SOCKETS=y CONFIG_NEWLIB_LIBC=y +CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/subsys/shell/shell_history/prj.conf b/tests/subsys/shell/shell_history/prj.conf index dd6a985d9bcbb..dc98df2885091 100644 --- a/tests/subsys/shell/shell_history/prj.conf +++ b/tests/subsys/shell/shell_history/prj.conf @@ -7,3 +7,4 @@ CONFIG_SHELL_METAKEYS=n CONFIG_SHELL_HISTORY=y CONFIG_LOG=n CONFIG_ZTEST=y +CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/subsys/usb/bos/prj.conf b/tests/subsys/usb/bos/prj.conf index 6eebace19fcf8..b4d52cd60e662 100644 --- a/tests/subsys/usb/bos/prj.conf +++ b/tests/subsys/usb/bos/prj.conf @@ -2,3 +2,4 @@ CONFIG_ZTEST=y CONFIG_USB=y CONFIG_USB_DEVICE_STACK=y CONFIG_USB_DEVICE_BOS=y +CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/subsys/usb/desc_sections/prj.conf b/tests/subsys/usb/desc_sections/prj.conf index 6783a8d375298..fa04ac40a7fb1 100644 --- a/tests/subsys/usb/desc_sections/prj.conf +++ b/tests/subsys/usb/desc_sections/prj.conf @@ -6,3 +6,4 @@ CONFIG_USB_DEVICE_LOG_LEVEL_DBG=y CONFIG_LOG=y CONFIG_LOG_BUFFER_SIZE=4096 +CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/subsys/usb/device/prj.conf b/tests/subsys/usb/device/prj.conf index 43821143dcf89..9fb144e46a25f 100644 --- a/tests/subsys/usb/device/prj.conf +++ b/tests/subsys/usb/device/prj.conf @@ -6,3 +6,4 @@ CONFIG_USB_DRIVER_LOG_LEVEL_DBG=y CONFIG_USB=y CONFIG_USB_DEVICE_STACK=y +CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/subsys/usb/os_desc/prj.conf b/tests/subsys/usb/os_desc/prj.conf index d1fea08a75f4a..3687c981fd166 100644 --- a/tests/subsys/usb/os_desc/prj.conf +++ b/tests/subsys/usb/os_desc/prj.conf @@ -2,3 +2,4 @@ CONFIG_ZTEST=y CONFIG_USB=y CONFIG_USB_DEVICE_STACK=y CONFIG_USB_DEVICE_OS_DESC=y +CONFIG_SYS_TIMEOUT_LEGACY_API=y From 474a5a63b3d6370cae630f479393133a24469735 Mon Sep 17 00:00:00 2001 From: Andy Ross Date: Thu, 25 Jul 2019 10:49:49 -0700 Subject: [PATCH 10/19] tests/kernel/mem_protect/futex: Use new timeout API This crossed with the timeout API rework so needs to be ported separately. Timeouts are now opaque types and can't be used as integers. Signed-off-by: Andy Ross --- tests/kernel/mem_protect/futex/src/main.c | 54 ++++++++--------------- 1 file changed, 18 insertions(+), 36 deletions(-) diff --git a/tests/kernel/mem_protect/futex/src/main.c b/tests/kernel/mem_protect/futex/src/main.c index f7e2143bf9c08..262e1033662a5 100644 --- a/tests/kernel/mem_protect/futex/src/main.c +++ b/tests/kernel/mem_protect/futex/src/main.c @@ -24,7 +24,7 @@ K_THREAD_STACK_ARRAY_DEFINE(multiple_wake_stack, TOTAL_THREADS_WAITING, STACK_SIZE); ZTEST_BMEM int woken; -ZTEST_BMEM int timeout; +ZTEST_BMEM k_timeout_t timeout; ZTEST_BMEM int index[TOTAL_THREADS_WAITING]; ZTEST_BMEM struct k_futex simple_futex; ZTEST_BMEM struct k_futex multiple_futex[TOTAL_THREADS_WAITING]; @@ -53,30 +53,20 @@ void futex_wake_from_isr(struct k_futex *futex) void futex_wait_task(void *p1, void *p2, void *p3) { s32_t ret_value; - int time_val = *(int *)p1; - - zassert_true(time_val >= K_FOREVER, "invalid timeout parameter"); + k_timeout_t time_val = *(k_timeout_t *)p1; ret_value = k_futex_wait(&simple_futex, atomic_get(&simple_futex.val), time_val); - switch (time_val) { - case K_FOREVER: + if (K_TIMEOUT_EQ(time_val, K_FOREVER)) { zassert_true(ret_value == 0, - "k_futex_wait failed when it shouldn't have"); + "k_futex_wait failed when it shouldn't have"); zassert_false(ret_value == 0, - "futex wait task wakeup when it shouldn't have"); - break; - case K_NO_WAIT: + "futex wait task wakeup when it shouldn't have"); + } else { zassert_true(ret_value == -ETIMEDOUT, - "k_futex_wait failed when it shouldn't have"); + "k_futex_wait failed when it shouldn't have"); atomic_sub(&simple_futex.val, 1); - break; - default: - zassert_true(ret_value == -ETIMEDOUT, - "k_futex_wait failed when it shouldn't have"); - atomic_sub(&simple_futex.val, 1); - break; } } @@ -94,26 +84,17 @@ void futex_wake_task(void *p1, void *p2, void *p3) void futex_wait_wake_task(void *p1, void *p2, void *p3) { s32_t ret_value; - int time_val = *(int *)p1; - - zassert_true(time_val >= K_FOREVER, "invalid timeout parameter"); + k_timeout_t time_val = *(k_timeout_t *)p1; ret_value = k_futex_wait(&simple_futex, atomic_get(&simple_futex.val), time_val); - switch (time_val) { - case K_FOREVER: - zassert_true(ret_value == 0, - "k_futex_wait failed when it shouldn't have"); - break; - case K_NO_WAIT: + if (K_TIMEOUT_EQ(time_val, K_NO_WAIT)) { zassert_true(ret_value == -ETIMEDOUT, "k_futex_wait failed when it shouldn't have"); - break; - default: + } else { zassert_true(ret_value == 0, "k_futex_wait failed when it shouldn't have"); - break; } atomic_sub(&simple_futex.val, 1); @@ -136,10 +117,11 @@ void futex_multiple_wake_task(void *p1, void *p2, void *p3) void futex_multiple_wait_wake_task(void *p1, void *p2, void *p3) { s32_t ret_value; - int time_val = *(int *)p1; + k_timeout_t time_val = *(k_timeout_t *)p1; int idx = *(int *)p2; - zassert_true(time_val == K_FOREVER, "invalid timeout parameter"); + zassert_true(K_TIMEOUT_EQ(time_val, K_FOREVER), + "invalid timeout parameter"); ret_value = k_futex_wait(&multiple_futex[idx], atomic_get(&(multiple_futex[idx].val)), time_val); @@ -179,7 +161,7 @@ void test_futex_wait_forever(void) void test_futex_wait_timeout(void) { - timeout = K_MSEC(50); + timeout = K_TIMEOUT_MS(50); atomic_set(&simple_futex.val, 1); @@ -189,7 +171,7 @@ void test_futex_wait_timeout(void) K_NO_WAIT); /* giving time for the futex_wait_task to execute */ - k_sleep(K_MSEC(100)); + k_sleep(100); zassert_true(atomic_get(&simple_futex.val) == 0, "wait timeout doesn't timeout"); @@ -209,7 +191,7 @@ void test_futex_wait_nowait(void) K_NO_WAIT); /* giving time for the futex_wait_task to execute */ - k_sleep(K_MSEC(100)); + k_sleep(100); zassert_true(atomic_get(&simple_futex.val) == 0, "wait nowait fail"); @@ -255,7 +237,7 @@ void test_futex_wait_forever_wake(void) void test_futex_wait_timeout_wake(void) { woken = 1; - timeout = K_MSEC(100); + timeout = K_TIMEOUT_MS(100); atomic_set(&simple_futex.val, 1); @@ -298,7 +280,7 @@ void test_futex_wait_nowait_wake(void) K_NO_WAIT); /* giving time for the futex_wait_wake_task to execute */ - k_sleep(K_MSEC(100)); + k_sleep(100); k_thread_create(&futex_wake_tid, futex_wake_stack, STACK_SIZE, futex_wake_task, &woken, NULL, NULL, From 0c2b35aa543f23eda007db28d6fe752f8fb91613 Mon Sep 17 00:00:00 2001 From: Andy Ross Date: Fri, 26 Jul 2019 13:25:08 -0700 Subject: [PATCH 11/19] tests/kernel/timer/timer_api: Add tests for the new conversion routines The new conversion API has a ton of generated utilities. Test it via enumerating each one of them and throwing a selection of both hand-picked and random numbers at it. Works by using slightly different math to compute the expected result and assuming that we don't have symmetric bugs in both. Signed-off-by: Andy Ross --- tests/kernel/timer/timer_api/prj.conf | 1 + .../kernel/timer/timer_api/prj_tickless.conf | 1 + tests/kernel/timer/timer_api/src/main.c | 3 + .../timer/timer_api/src/timer_convert.c | 165 ++++++++++++++++++ 4 files changed, 170 insertions(+) create mode 100644 tests/kernel/timer/timer_api/src/timer_convert.c diff --git a/tests/kernel/timer/timer_api/prj.conf b/tests/kernel/timer/timer_api/prj.conf index c9ed9649823ed..8a0f28ace316c 100644 --- a/tests/kernel/timer/timer_api/prj.conf +++ b/tests/kernel/timer/timer_api/prj.conf @@ -3,3 +3,4 @@ CONFIG_QEMU_TICKLESS_WORKAROUND=y CONFIG_TEST_USERSPACE=y CONFIG_MP_NUM_CPUS=1 CONFIG_SYS_TIMEOUT_64BIT=y +CONFIG_TEST_RANDOM_GENERATOR=y diff --git a/tests/kernel/timer/timer_api/prj_tickless.conf b/tests/kernel/timer/timer_api/prj_tickless.conf index e1f4414b42d8c..05a3837ea2663 100644 --- a/tests/kernel/timer/timer_api/prj_tickless.conf +++ b/tests/kernel/timer/timer_api/prj_tickless.conf @@ -2,3 +2,4 @@ CONFIG_ZTEST=y CONFIG_SYS_POWER_MANAGEMENT=y CONFIG_TICKLESS_KERNEL=y CONFIG_MP_NUM_CPUS=1 +CONFIG_TEST_RANDOM_GENERATOR=y diff --git a/tests/kernel/timer/timer_api/src/main.c b/tests/kernel/timer/timer_api/src/main.c index 2c44061174f5b..19aeec6c64cf8 100644 --- a/tests/kernel/timer/timer_api/src/main.c +++ b/tests/kernel/timer/timer_api/src/main.c @@ -37,6 +37,8 @@ static struct k_timer remain_timer; static ZTEST_BMEM struct timer_data tdata; +extern void test_time_conversions(void); + #define TIMER_ASSERT(exp, tmr) \ do { \ if (!(exp)) { \ @@ -564,6 +566,7 @@ void test_main(void) &timer2, &timer3, &timer4); ztest_test_suite(timer_api, + ztest_unit_test(test_time_conversions), ztest_user_unit_test(test_timer_duration_period), ztest_user_unit_test(test_timer_period_0), ztest_user_unit_test(test_timer_expirefn_null), diff --git a/tests/kernel/timer/timer_api/src/timer_convert.c b/tests/kernel/timer/timer_api/src/timer_convert.c new file mode 100644 index 0000000000000..b9cee0103c706 --- /dev/null +++ b/tests/kernel/timer/timer_api/src/timer_convert.c @@ -0,0 +1,165 @@ +/* + * Copyright (c) 2019 Intel Corporation + * + * SPDX-License-Identifier: Apache-2.0 + */ +#include +#include +#include + +#define NUM_RANDOM 100 + +enum units { UNIT_ticks, UNIT_cyc, UNIT_ms, UNIT_us }; + +enum round { ROUND_floor, ROUND_ceil, ROUND_near }; + +struct test_rec { + enum units src; + enum units dst; + int precision; /* 32 or 64 */ + enum round round; + void *func; +}; + +#define TESTREC(src, dst, round, prec) { \ + UNIT_##src, UNIT_##dst, prec, ROUND_##round, \ + (void *)k_##src##_to_##dst##_##round##prec \ + } \ + +static struct test_rec tests[] = { + TESTREC(ms, cyc, floor, 32), + TESTREC(ms, cyc, floor, 64), + TESTREC(ms, cyc, near, 32), + TESTREC(ms, cyc, near, 64), + TESTREC(ms, cyc, ceil, 32), + TESTREC(ms, cyc, ceil, 64), + TESTREC(ms, ticks, floor, 32), + TESTREC(ms, ticks, floor, 64), + TESTREC(ms, ticks, near, 32), + TESTREC(ms, ticks, near, 64), + TESTREC(ms, ticks, ceil, 32), + TESTREC(ms, ticks, ceil, 64), + TESTREC(us, cyc, floor, 64), + TESTREC(us, cyc, near, 64), + TESTREC(us, cyc, ceil, 64), + TESTREC(us, ticks, floor, 64), + TESTREC(us, ticks, near, 64), + TESTREC(us, ticks, ceil, 64), + TESTREC(cyc, ms, floor, 32), + TESTREC(cyc, ms, floor, 64), + TESTREC(cyc, ms, near, 32), + TESTREC(cyc, ms, near, 64), + TESTREC(cyc, ms, ceil, 32), + TESTREC(cyc, ms, ceil, 64), + TESTREC(cyc, us, floor, 64), + TESTREC(cyc, us, near, 64), + TESTREC(cyc, us, ceil, 64), + TESTREC(cyc, ticks, floor, 32), + TESTREC(cyc, ticks, floor, 64), + TESTREC(cyc, ticks, near, 32), + TESTREC(cyc, ticks, near, 64), + TESTREC(cyc, ticks, ceil, 32), + TESTREC(cyc, ticks, ceil, 64), + TESTREC(ticks, ms, floor, 32), + TESTREC(ticks, ms, floor, 64), + TESTREC(ticks, ms, near, 32), + TESTREC(ticks, ms, near, 64), + TESTREC(ticks, ms, ceil, 32), + TESTREC(ticks, ms, ceil, 64), + TESTREC(ticks, us, floor, 64), + TESTREC(ticks, us, near, 64), + TESTREC(ticks, us, ceil, 64), + TESTREC(ticks, cyc, floor, 32), + TESTREC(ticks, cyc, floor, 64), + TESTREC(ticks, cyc, near, 32), + TESTREC(ticks, cyc, near, 64), + TESTREC(ticks, cyc, ceil, 32), + TESTREC(ticks, cyc, ceil, 64), + }; + +u32_t get_hz(enum units u) +{ + if (u == UNIT_ticks) { + return CONFIG_SYS_CLOCK_TICKS_PER_SEC; + } else if (u == UNIT_cyc) { + return sys_clock_hw_cycles_per_sec(); + } else if (u == UNIT_ms) { + return 1000; + } else if (u == UNIT_us) { + return 1000000; + } + __ASSERT(0, ""); + return 0; +} + +void test_conversion(struct test_rec *t, u64_t val) +{ + u32_t from_hz = get_hz(t->src), to_hz = get_hz(t->dst); + u64_t result; + + if (t->precision == 32) { + u32_t (*convert)(u32_t) = (u32_t (*)(u32_t)) t->func; + + result = convert((u32_t) val); + + /* If the input value legitimately overflows, then + * there is nothing to test + */ + if ((val * to_hz) >= ((((u64_t)from_hz) << 32))) { + return; + } + } else { + u64_t (*convert)(u64_t) = (u64_t (*)(u64_t)) t->func; + + result = convert(val); + } + + /* We expect the ideal result to be equal to "val * to_hz / + * from_hz", but that division is the source of precision + * issues. So reexpress our equation as: + * + * val * to_hz ==? result * from_hz + * 0 ==? val * to_hz - result * from_hz + * + * The difference is allowed to be in the range [0:from_hz) if + * we are rounding down, from (-from_hz:0] if we are rounding + * up, or [-from_hz/2:from_hz/2] if we are rounding to the + * nearest. + */ + s64_t diff = (s64_t)(val * to_hz - result * from_hz); + s64_t maxdiff, mindiff; + + if (t->round == ROUND_floor) { + maxdiff = from_hz - 1; + mindiff = 0; + } else if (t->round == ROUND_ceil) { + maxdiff = 0; + mindiff = -(s64_t)(from_hz-1); + } else { + maxdiff = from_hz/2; + mindiff = -(s64_t)(from_hz/2); + } + + zassert_true(diff <= maxdiff && diff >= mindiff, + "Convert %lld from %lldhz to %lldhz (= %lld) failed. " + "diff %lld should be in [%lld:%lld]", + val, from_hz, to_hz, result, diff, mindiff, maxdiff); +} + +void test_time_conversions(void) +{ + for (int i = 0; i < ARRAY_SIZE(tests); i++) { + test_conversion(&tests[i], 0); + test_conversion(&tests[i], 1); + test_conversion(&tests[i], 0x7fffffff); + test_conversion(&tests[i], 0x80000000); + if (tests[i].precision == 64) { + test_conversion(&tests[i], 0xffffffff); + test_conversion(&tests[i], 0x100000000ULL); + } + + for (int j = 0; j < NUM_RANDOM; j++) { + test_conversion(&tests[i], sys_rand32_get()); + } + } +} From 7de1c86fe8be78313b790dc32082d53ae423324e Mon Sep 17 00:00:00 2001 From: Andy Ross Date: Wed, 7 Aug 2019 15:35:44 -0700 Subject: [PATCH 12/19] tests/kernel: Add cases for new timer APIs Add some test coverage for the newer timer API calls for _end_ticks() and _remaining_ticks() on k_delayed_work and k_timer objects. These are simple wrappers around existing low level primitives that are already well covered, so this doesn't need to be elaborate. We just want to make sure they work. Signed-off-by: Andy Ross --- tests/kernel/sleep/src/main.c | 7 ++++++ tests/kernel/timer/timer_api/src/main.c | 32 ++++++++++++++++++++++++ tests/kernel/workq/work_queue/src/main.c | 16 +++++++++++- 3 files changed, 54 insertions(+), 1 deletion(-) diff --git a/tests/kernel/sleep/src/main.c b/tests/kernel/sleep/src/main.c index 09de55fa9caf5..f6f833e40ad24 100644 --- a/tests/kernel/sleep/src/main.c +++ b/tests/kernel/sleep/src/main.c @@ -10,6 +10,7 @@ #include #include #include +#include #if defined(CONFIG_ASSERT) && defined(CONFIG_DEBUG) #define THREAD_STACK (512 + CONFIG_TEST_EXTRA_STACKSIZE) @@ -166,6 +167,12 @@ static void helper_thread(int arg1, int arg2) { k_sem_take(&helper_thread_sem, K_FOREVER); + + s32_t dt = k_thread_timeout_remaining_ticks(&test_thread_data); + + zassert_true(abs(dt - k_ms_to_ticks_ceil32(ONE_SECOND)) <= 2, + "thread timeout incorrect"); + /* Wake the test thread */ k_wakeup(test_thread_id); k_sem_take(&helper_thread_sem, K_FOREVER); diff --git a/tests/kernel/timer/timer_api/src/main.c b/tests/kernel/timer/timer_api/src/main.c index 19aeec6c64cf8..ba298e747b9ff 100644 --- a/tests/kernel/timer/timer_api/src/main.c +++ b/tests/kernel/timer/timer_api/src/main.c @@ -4,8 +4,10 @@ * SPDX-License-Identifier: Apache-2.0 */ +#include #include #include +#include struct timer_data { int expire_cnt; @@ -143,6 +145,26 @@ void test_timer_duration_period(void) k_timer_stop(&duration_timer); } +void test_timer_absolute(void) +{ +#ifdef K_TIMEOUT_ABSOLUTE_TICKS + u64_t start, end, now; + k_timeout_t timeout; + + start = k_uptime_ticks(); + end = start + DURATION; + timeout = K_TIMEOUT_ABSOLUTE_TICKS(end); + + k_timer_start(&duration_timer, timeout, K_FOREVER); + k_timer_status_sync(&duration_timer); + + now = k_uptime_ticks(); + zassert_true((now - end) == 0 || (now - end) == 1, + "Absolute timeout expected at %lld, got %lld", + end, now); +#endif +} + /** * @brief Test Timer with zero period value * @@ -529,7 +551,16 @@ void test_timer_remaining_get(void) u32_t remaining; init_timer_data(); + + u64_t start = k_uptime_ticks(); + k_timer_start(&remain_timer, K_TIMEOUT_MS(DURATION), K_NO_WAIT); + + s32_t end = k_timer_end_ticks(&remain_timer); + + zassert_true(abs(end - start - k_ms_to_ticks_ceil32(DURATION)) <= 2, + "k_timer end time incorrect"); + busy_wait_ms(DURATION / 2); remaining = k_timer_remaining_get(&remain_timer); k_timer_stop(&remain_timer); @@ -568,6 +599,7 @@ void test_main(void) ztest_test_suite(timer_api, ztest_unit_test(test_time_conversions), ztest_user_unit_test(test_timer_duration_period), + ztest_user_unit_test(test_timer_absolute), ztest_user_unit_test(test_timer_period_0), ztest_user_unit_test(test_timer_expirefn_null), ztest_user_unit_test(test_timer_periodicity), diff --git a/tests/kernel/workq/work_queue/src/main.c b/tests/kernel/workq/work_queue/src/main.c index e9a7f66eae860..694b0f9ec36f0 100644 --- a/tests/kernel/workq/work_queue/src/main.c +++ b/tests/kernel/workq/work_queue/src/main.c @@ -5,6 +5,7 @@ */ #include +#include #include #include @@ -256,12 +257,25 @@ static void test_delayed_submit(void) NULL, NULL, NULL, K_PRIO_COOP(10), 0, K_NO_WAIT); for (i = 0; i < NUM_TEST_ITEMS; i += 2) { - k_timeout_t timeout = K_TIMEOUT_MS((i + 1) * WORK_ITEM_WAIT); + u32_t ms = (i + 1) * WORK_ITEM_WAIT; + k_timeout_t timeout = K_TIMEOUT_MS(ms); TC_PRINT(" - Submitting delayed work %d from" " preempt thread\n", i + 1); + u64_t start = k_uptime_ticks(); zassert_true(k_delayed_work_submit(&tests[i].work, timeout) == 0, NULL); + + s32_t dt = k_delayed_work_remaining_ticks(&tests[i].work); + s32_t delay = k_ms_to_ticks_ceil32(ms); + + zassert_true(abs(delay - dt) <= 2, + "wrong ticks dt %d ticks %d", dt, delay); + + dt = k_delayed_work_end_ticks(&tests[i].work) - start; + zassert_true(abs(delay - dt) <= 2, + "wrong ticks (absolute) dt %d ticks %d", + dt, delay); } } From 575ba551090d0e22c3de04dfe8b3a0f6b6425eee Mon Sep 17 00:00:00 2001 From: Andy Ross Date: Thu, 19 Sep 2019 10:44:54 -0700 Subject: [PATCH 13/19] kernel/timeout: Make K_TIMEOUT_ABSOLUTE_*() macros internal There's still some discussion about this API, so rename the macros to live within the Z_* namespace for the first version. (Ideally this should be squashed with the original commit, but subsequent commits are using this API and it would require hand-editting of patch files that are likely to delay review.) Signed-off-by: Andy Ross --- include/sys_clock.h | 16 ++++++++-------- kernel/timeout.c | 4 ++-- tests/kernel/timer/timer_api/src/main.c | 4 ++-- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/include/sys_clock.h b/include/sys_clock.h index 094132b8b978f..e9573198a06e2 100644 --- a/include/sys_clock.h +++ b/include/sys_clock.h @@ -64,7 +64,7 @@ typedef u32_t k_ticks_t; * @param t Timeout in hardware cycles */ -/** \def K_TIMEOUT_ABSOLUTE_TICKS(t) +/** \def Z_TIMEOUT_ABSOLUTE_TICKS(t) * @brief Initializes a k_timeout_t object with uptime in ticks * * Evaluates to a k_timeout_t object representing an API timeout that @@ -73,7 +73,7 @@ typedef u32_t k_ticks_t; * @param t Timeout in ticks */ -/** \def K_TIMEOUT_ABSOLUTE_MS(t) +/** \def Z_TIMEOUT_ABSOLUTE_MS(t) * @brief Initializes a k_timeout_t object with uptime in milliseconds * * Evaluates to a k_timeout_t object representing an API timeout that @@ -82,7 +82,7 @@ typedef u32_t k_ticks_t; * @param t Timeout in milliseconds */ -/** \def K_TIMEOUT_ABSOLUTE_US(t) +/** \def Z_TIMEOUT_ABSOLUTE_US(t) * @brief Initializes a k_timeout_t object with uptime in microseconds * * Evaluates to a k_timeout_t object representing an API timeout that @@ -91,7 +91,7 @@ typedef u32_t k_ticks_t; * @param t Timeout in microseconds */ -/** \def K_TIMEOUT_ABSOLUTE_CYC(t) +/** \def Z_TIMEOUT_ABSOLUTE_CYC(t) * @brief Initializes a k_timeout_t object with uptime in hardware cycles * * Evaluates to a k_timeout_t object representing an API timeout that @@ -173,11 +173,11 @@ struct _timeout { #endif #if defined(CONFIG_SYS_TIMEOUT_64BIT) && !defined(CONFIG_SYS_TIMEOUT_LEGACY_API) -#define K_TIMEOUT_ABSOLUTE_TICKS(t) \ +#define Z_TIMEOUT_ABSOLUTE_TICKS(t) \ K_TIMEOUT_TICKS((k_ticks_t)(K_FOREVER_TICKS - (t + 1))) -#define K_TIMEOUT_ABSOLUTE_MS(t) K_TIMEOUT_ABSOLUTE_TICKS(k_ms_to_ticks_ceil64(t)) -#define K_TIMEOUT_ABSOLUTE_US(t) K_TIMEOUT_ABSOLUTE_TICKS(k_us_to_ticks_ceil64(t)) -#define K_TIMEOUT_ABSOLUTE_CYC(t) K_TIMEOUT_ABSOLUTE_TICKS(k_cyc_to_ticks_ceil64(t)) +#define Z_TIMEOUT_ABSOLUTE_MS(t) Z_TIMEOUT_ABSOLUTE_TICKS(k_ms_to_ticks_ceil64(t)) +#define Z_TIMEOUT_ABSOLUTE_US(t) Z_TIMEOUT_ABSOLUTE_TICKS(k_us_to_ticks_ceil64(t)) +#define Z_TIMEOUT_ABSOLUTE_CYC(t) Z_TIMEOUT_ABSOLUTE_TICKS(k_cyc_to_ticks_ceil64(t)) #endif s64_t z_tick_get(void); diff --git a/kernel/timeout.c b/kernel/timeout.c index 4b0f42d0849a3..ed60f62d82d77 100644 --- a/kernel/timeout.c +++ b/kernel/timeout.c @@ -91,7 +91,7 @@ static s32_t next_timeout(void) static bool is_absolute(k_ticks_t t) { -#ifdef K_TIMEOUT_ABSOLUTE_TICKS +#ifdef Z_TIMEOUT_ABSOLUTE_TICKS return ((s64_t)t) < ((s64_t)K_FOREVER_TICKS); #else return false; @@ -128,7 +128,7 @@ void z_add_timeout(struct _timeout *to, _timeout_func_t fn, LOCKED(&timeout_lock) { struct _timeout *t; -#ifdef K_TIMEOUT_ABSOLUTE_TICKS +#ifdef Z_TIMEOUT_ABSOLUTE_TICKS /* Handle absolute expirations */ if (is_absolute(ticks)) { s64_t abs = K_FOREVER_TICKS - 1 - ticks; diff --git a/tests/kernel/timer/timer_api/src/main.c b/tests/kernel/timer/timer_api/src/main.c index ba298e747b9ff..8cd5e52eb7755 100644 --- a/tests/kernel/timer/timer_api/src/main.c +++ b/tests/kernel/timer/timer_api/src/main.c @@ -147,13 +147,13 @@ void test_timer_duration_period(void) void test_timer_absolute(void) { -#ifdef K_TIMEOUT_ABSOLUTE_TICKS +#ifdef Z_TIMEOUT_ABSOLUTE_TICKS u64_t start, end, now; k_timeout_t timeout; start = k_uptime_ticks(); end = start + DURATION; - timeout = K_TIMEOUT_ABSOLUTE_TICKS(end); + timeout = Z_TIMEOUT_ABSOLUTE_TICKS(end); k_timer_start(&duration_timer, timeout, K_FOREVER); k_timer_status_sync(&duration_timer); From b1cd7149507c531abae42866134182c470d04f63 Mon Sep 17 00:00:00 2001 From: Andy Ross Date: Fri, 20 Sep 2019 08:50:27 -0700 Subject: [PATCH 14/19] kernel/timeout: Clean up documentation warnings More recent CI tests were flagging the argument name mismatch between the declaration and documentation in two functions, and didn't like the fact that the absolute timeout macros were documented even in kconfig situations where the macros were not defined. Signed-off-by: Andy Ross --- include/kernel.h | 4 +-- include/sys_clock.h | 71 ++++++++++++++++++++++----------------------- 2 files changed, 37 insertions(+), 38 deletions(-) diff --git a/include/kernel.h b/include/kernel.h index 033dbf22ee7da..1a0b2465e022e 100644 --- a/include/kernel.h +++ b/include/kernel.h @@ -2991,7 +2991,7 @@ extern int k_delayed_work_cancel(struct k_delayed_work *work); * which point a scheduled delayed work item will execute. If the * delayed_work is not scheduled, it returns the current time. * - * @param delayed_work Address of delayed work item + * @param dw Address of delayed work item * * @return Uptime (in ticks). */ @@ -3011,7 +3011,7 @@ k_ticks_t z_impl_k_delayed_work_end_ticks(struct k_delayed_work *dw) * until execution is at least as long as the return value). If the * delayed_work is not running, it returns K_FOREVER_TICKS. * - * @param delayed_work Address of delayed work item. + * @param dw Address of delayed work item. * * @return Remaining time (in ticks). */ diff --git a/include/sys_clock.h b/include/sys_clock.h index e9573198a06e2..bd2d0750c1c72 100644 --- a/include/sys_clock.h +++ b/include/sys_clock.h @@ -64,42 +64,6 @@ typedef u32_t k_ticks_t; * @param t Timeout in hardware cycles */ -/** \def Z_TIMEOUT_ABSOLUTE_TICKS(t) - * @brief Initializes a k_timeout_t object with uptime in ticks - * - * Evaluates to a k_timeout_t object representing an API timeout that - * will expire after the system uptime reaches @a t ticks - * - * @param t Timeout in ticks - */ - -/** \def Z_TIMEOUT_ABSOLUTE_MS(t) - * @brief Initializes a k_timeout_t object with uptime in milliseconds - * - * Evaluates to a k_timeout_t object representing an API timeout that - * will expire after the system uptime reaches @a t milliseconds - * - * @param t Timeout in milliseconds - */ - -/** \def Z_TIMEOUT_ABSOLUTE_US(t) - * @brief Initializes a k_timeout_t object with uptime in microseconds - * - * Evaluates to a k_timeout_t object representing an API timeout that - * will expire after the system uptime reaches @a t microseconds - * - * @param t Timeout in microseconds - */ - -/** \def Z_TIMEOUT_ABSOLUTE_CYC(t) - * @brief Initializes a k_timeout_t object with uptime in hardware cycles - * - * Evaluates to a k_timeout_t object representing an API timeout that - * will expire after the system uptime reaches @a t hardware cycles - * - * @param t Timeout in hardware cycles - */ - /** \def K_TIMEOUT_GET(t) * @brief Returns the ticks expiration from a k_timeout_t * @@ -173,10 +137,45 @@ struct _timeout { #endif #if defined(CONFIG_SYS_TIMEOUT_64BIT) && !defined(CONFIG_SYS_TIMEOUT_LEGACY_API) +/** \def Z_TIMEOUT_ABSOLUTE_TICKS(t) + * @brief Initializes a k_timeout_t object with uptime in ticks + * + * Evaluates to a k_timeout_t object representing an API timeout that + * will expire after the system uptime reaches @a t ticks + * + * @param t Timeout in ticks + */ #define Z_TIMEOUT_ABSOLUTE_TICKS(t) \ K_TIMEOUT_TICKS((k_ticks_t)(K_FOREVER_TICKS - (t + 1))) + +/** \def Z_TIMEOUT_ABSOLUTE_MS(t) + * @brief Initializes a k_timeout_t object with uptime in milliseconds + * + * Evaluates to a k_timeout_t object representing an API timeout that + * will expire after the system uptime reaches @a t milliseconds + * + * @param t Timeout in milliseconds + */ #define Z_TIMEOUT_ABSOLUTE_MS(t) Z_TIMEOUT_ABSOLUTE_TICKS(k_ms_to_ticks_ceil64(t)) + +/** \def Z_TIMEOUT_ABSOLUTE_US(t) + * @brief Initializes a k_timeout_t object with uptime in microseconds + * + * Evaluates to a k_timeout_t object representing an API timeout that + * will expire after the system uptime reaches @a t microseconds + * + * @param t Timeout in microseconds + */ #define Z_TIMEOUT_ABSOLUTE_US(t) Z_TIMEOUT_ABSOLUTE_TICKS(k_us_to_ticks_ceil64(t)) + +/** \def Z_TIMEOUT_ABSOLUTE_CYC(t) + * @brief Initializes a k_timeout_t object with uptime in hardware cycles + * + * Evaluates to a k_timeout_t object representing an API timeout that + * will expire after the system uptime reaches @a t hardware cycles + * + * @param t Timeout in hardware cycles + */ #define Z_TIMEOUT_ABSOLUTE_CYC(t) Z_TIMEOUT_ABSOLUTE_TICKS(k_cyc_to_ticks_ceil64(t)) #endif From cd689b0791d1238e2e5339350e643b238072fff8 Mon Sep 17 00:00:00 2001 From: Andy Ross Date: Mon, 23 Sep 2019 13:56:50 -0700 Subject: [PATCH 15/19] kernel/timeout: Correct macro precedence in K_TIMEOUT_TICKS The case needs to be of the parenthesized expression if the argument is itself a compount expression. Signed-off-by: Andy Ross --- include/sys_clock.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/sys_clock.h b/include/sys_clock.h index bd2d0750c1c72..2495b6b387a77 100644 --- a/include/sys_clock.h +++ b/include/sys_clock.h @@ -107,7 +107,7 @@ typedef k_ticks_t k_timeout_t; #else /* New API going forward: k_timeout_t is an opaque struct */ typedef struct { k_ticks_t ticks; } k_timeout_t; -#define K_TIMEOUT_TICKS(t) ((k_timeout_t){ (k_ticks_t)t }) +#define K_TIMEOUT_TICKS(t) ((k_timeout_t){ (k_ticks_t)(t) }) #define K_TIMEOUT_GET(t) ((t).ticks) #define K_NO_WAIT K_TIMEOUT_TICKS(0) #define K_FOREVER K_TIMEOUT_TICKS(K_FOREVER_TICKS) From a127fc06ac906e6b36d4faa4faa31e2ef2b8bf78 Mon Sep 17 00:00:00 2001 From: Andy Ross Date: Wed, 25 Sep 2019 08:12:53 -0700 Subject: [PATCH 16/19] include/kernel.h: Clarify docs for k_timer_start() The documentation didn't say explicitly how one-shot mode works, by passing K_NO_WAIT or K_FOREVER as the period parameter. Signed-off-by: Andy Ross --- include/kernel.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/include/kernel.h b/include/kernel.h index 1a0b2465e022e..9c622aa65bf1a 100644 --- a/include/kernel.h +++ b/include/kernel.h @@ -1524,7 +1524,10 @@ extern void k_timer_init(struct k_timer *timer, * @param timer Address of timer. * @param duration Initial timer duration, initialized with one of the * K_TIMEOUT_*() macros, or K_NO_WAIT. - * @param period Timer period (likewise). + * @param period Timer period (likewise). Specifying K_NO_WAIT or + * K_FOREVER indicates that the timer is a one-shot and + * the callback will not be invoked again after the + * duration expires. * * @return N/A */ From d725cc2098048af04fa6f72bbefa95a0766dc17d Mon Sep 17 00:00:00 2001 From: Andy Ross Date: Wed, 25 Sep 2019 09:00:31 -0700 Subject: [PATCH 17/19] kernel/sched: k_sleep() should take a timeout parameter Upgrade the argument to k_sleep() from a 32 bit millisecond count to a proper k_timeout_t to symmetrize it with the other timeout parameters and make it possible to sleep in any time unit and until absolute timeout events without using a k_timer. Also add a k_msleep() API with the earlier semantics for the benefit of simple code that doesn't want to deal with timeouts. This is implemented as a trivial wrapper around the new k_sleep(), as is k_usleep(). Signed-off-by: Andy Ross --- boards/arm/nrf52_pca20020/board.c | 2 +- boards/arm/nrf9160_pca10090/nrf52840_reset.c | 2 +- drivers/bluetooth/hci/h5.c | 4 +- drivers/bluetooth/hci/spi.c | 2 +- drivers/console/native_posix_console.c | 2 +- drivers/console/rtt_console.c | 2 +- drivers/display/display_ili9340.c | 8 +-- drivers/display/display_ili9340_seeed_tftv2.c | 4 +- drivers/display/display_st7789v.c | 10 +-- drivers/display/ssd1306.c | 4 +- drivers/display/ssd16xx.c | 6 +- drivers/ethernet/eth_enc424j600.c | 6 +- drivers/ethernet/eth_mcux.c | 2 +- drivers/ethernet/eth_smsc911x.c | 10 +-- drivers/ethernet/eth_stm32_hal.c | 2 +- drivers/ethernet/phy_sam_gmac.c | 6 +- drivers/i2s/i2s_ll_stm32.c | 2 +- drivers/led/ht16k33.c | 2 +- drivers/led/lp5562.c | 2 +- drivers/modem/ublox-sara-r4.c | 6 +- drivers/pwm/pwm_imx.c | 2 +- drivers/sensor/adxl362/adxl362.c | 2 +- drivers/sensor/adxl372/adxl372.c | 2 +- drivers/sensor/ams_iAQcore/iAQcore.c | 2 +- drivers/sensor/apds9960/apds9960.c | 2 +- drivers/sensor/ccs811/ccs811.c | 6 +- drivers/sensor/ens210/ens210.c | 4 +- drivers/sensor/hts221/hts221.c | 2 +- drivers/sensor/lsm6dsl/lsm6dsl_shub.c | 8 +-- drivers/sensor/lsm6dso/lsm6dso_shub.c | 8 +-- drivers/sensor/ms5837/ms5837.c | 2 +- drivers/sensor/ti_hdc/ti_hdc.c | 2 +- drivers/sensor/vl53l0x/vl53l0x.c | 2 +- drivers/sensor/vl53l0x/vl53l0x_platform.c | 2 +- drivers/serial/uart_miv.c | 2 +- .../usb/device/usb_dc_native_posix_adapt.c | 6 +- drivers/wifi/eswifi/eswifi_bus_spi.c | 4 +- drivers/wifi/eswifi/eswifi_core.c | 4 +- include/kernel.h | 36 ++++++++-- include/sys_clock.h | 2 +- kernel/sched.c | 66 ++++++++----------- lib/cmsis_rtos_v1/cmsis_wait.c | 2 +- lib/cmsis_rtos_v2/kernel.c | 4 +- lib/posix/sleep.c | 2 +- samples/basic/blink_led/src/main.c | 2 +- samples/basic/blinky/src/main.c | 2 +- samples/basic/button/src/main.c | 2 +- samples/basic/disco/src/main.c | 2 +- samples/basic/fade_led/src/main.c | 2 +- samples/basic/rgb_led/src/main.c | 2 +- samples/basic/servo_motor/src/main.c | 2 +- samples/basic/threads/src/main.c | 2 +- samples/bluetooth/mesh_demo/src/microbit.c | 2 +- samples/bluetooth/peripheral/src/main.c | 2 +- samples/bluetooth/peripheral_csc/src/main.c | 2 +- samples/bluetooth/peripheral_esp/src/main.c | 2 +- samples/bluetooth/peripheral_hr/src/main.c | 2 +- samples/bluetooth/peripheral_ht/src/main.c | 2 +- .../boards/96b_argonkey/microphone/src/main.c | 4 +- .../boards/96b_argonkey/sensors/src/main.c | 8 +-- samples/boards/altera_max10/pio/src/main.c | 4 +- samples/boards/arc_secure_services/src/main.c | 2 +- .../boards/bbc_microbit/display/src/main.c | 4 +- samples/boards/bbc_microbit/sound/src/main.c | 2 +- .../intel_s1000_crb/dmic/src/dmic_sample.c | 2 +- samples/boards/sensortile_box/src/main.c | 4 +- samples/display/cfb/src/main.c | 2 +- samples/display/grove_display/src/main.c | 2 +- samples/display/ili9340/src/main.c | 2 +- samples/display/st7789v/src/main.c | 2 +- samples/drivers/CAN/src/main.c | 4 +- samples/drivers/entropy/src/main.c | 2 +- samples/drivers/espi/src/main.c | 2 +- samples/drivers/ht16k33/src/main.c | 6 +- samples/drivers/lcd_hd44780/src/main.c | 30 ++++----- samples/drivers/led_apa102/src/main.c | 2 +- .../drivers/led_apa102c_bitbang/src/main.c | 2 +- samples/drivers/led_lp3943/src/main.c | 4 +- samples/drivers/led_lp5562/src/main.c | 8 +-- samples/drivers/led_lpd8806/src/main.c | 2 +- samples/drivers/led_pca9633/src/main.c | 14 ++-- samples/drivers/led_ws2812/src/main.c | 2 +- samples/drivers/ps2/src/main.c | 64 +++++++++--------- samples/drivers/watchdog/src/main.c | 2 +- samples/gui/lvgl/src/main.c | 2 +- samples/net/google_iot_mqtt/src/protocol.c | 6 +- samples/net/mqtt_publisher/src/main.c | 4 +- samples/net/sockets/can/src/main.c | 2 +- samples/net/syslog_net/src/main.c | 4 +- samples/nfc/nfc_hello/src/main.c | 2 +- samples/philosophers/src/main.c | 6 +- .../cmsis_rtos_v2/philosophers/src/main.c | 2 +- samples/sensor/adt7420/src/main.c | 2 +- samples/sensor/adxl362/src/main.c | 2 +- samples/sensor/adxl372/src/main.c | 2 +- samples/sensor/amg88xx/src/main.c | 2 +- samples/sensor/ams_iAQcore/src/main.c | 2 +- samples/sensor/apds9960/src/main.c | 4 +- samples/sensor/bme280/src/main.c | 2 +- samples/sensor/bme680/src/main.c | 2 +- samples/sensor/bmg160/src/main.c | 6 +- samples/sensor/bmm150/src/main.c | 2 +- samples/sensor/ccs811/src/main.c | 2 +- samples/sensor/ens210/src/main.c | 2 +- samples/sensor/grove_light/src/main.c | 2 +- samples/sensor/grove_temperature/src/main.c | 2 +- samples/sensor/hts221/src/main.c | 2 +- samples/sensor/lsm303dlhc/src/main.c | 2 +- samples/sensor/lsm6dsl/src/main.c | 2 +- samples/sensor/magn_polling/src/main.c | 2 +- samples/sensor/max30101/src/main.c | 2 +- samples/sensor/max44009/src/main.c | 2 +- samples/sensor/mcp9808/src/main.c | 2 +- samples/sensor/ms5837/src/main.c | 2 +- samples/sensor/sht3xd/src/main.c | 2 +- samples/sensor/sx9500/src/main.c | 4 +- samples/sensor/th02/src/main.c | 2 +- samples/sensor/thermometer/src/main.c | 2 +- samples/sensor/tmp112/src/main.c | 2 +- samples/sensor/vl53l0x/src/main.c | 2 +- samples/shields/x_nucleo_iks01a1/src/main.c | 2 +- samples/shields/x_nucleo_iks01a2/src/main.c | 2 +- .../x_nucleo_iks01a3/sensorhub/src/main.c | 2 +- .../x_nucleo_iks01a3/standard/src/main.c | 2 +- samples/subsys/fs/fat_fs/src/main.c | 2 +- samples/subsys/logging/logger/src/main.c | 4 +- samples/subsys/mgmt/mcumgr/smp_svr/src/main.c | 2 +- samples/subsys/nvs/src/main.c | 2 +- samples/subsys/usb/cdc_acm/src/main.c | 2 +- .../subsys/usb/cdc_acm_composite/src/main.c | 4 +- samples/synchronization/src/main.c | 2 +- samples/userspace/shared_mem/src/main.c | 6 +- soc/arm/st_stm32/common/stm32cube_hal.c | 2 +- subsys/console/tty.c | 2 +- subsys/disk/disk_access_sdhc.h | 4 +- subsys/logging/log_backend_rtt.c | 2 +- subsys/logging/log_core.c | 2 +- subsys/net/ip/net_shell.c | 4 +- subsys/net/l2/ieee802154/ieee802154_mgmt.c | 2 +- subsys/net/lib/lwm2m/lwm2m_engine.c | 6 +- subsys/shell/shell.c | 2 +- subsys/testsuite/include/timestamp.h | 2 +- subsys/usb/class/usb_dfu.c | 2 +- .../arm/arm_runtime_nmi/src/arm_runtime_nmi.c | 2 +- tests/benchmarks/boot_time/src/main.c | 2 +- tests/benchmarks/sched/src/main.c | 2 +- tests/benchmarks/sys_kernel/src/syskernel.c | 2 +- .../timing_info/src/msg_passing_bench.c | 8 +-- .../timing_info/src/semaphore_bench.c | 4 +- .../benchmarks/timing_info/src/thread_bench.c | 4 +- .../benchmarks/timing_info/src/yield_bench.c | 4 +- .../bsim_bt/bsim_test_app/src/test_connect1.c | 2 +- .../bsim_bt/bsim_test_app/src/test_connect2.c | 2 +- .../bsim_bt/bsim_test_app/src/test_empty.c | 2 +- tests/bluetooth/shell/src/main.c | 2 +- tests/boards/intel_s1000_crb/src/dma_test.c | 8 +-- tests/boards/intel_s1000_crb/src/gpio_test.c | 2 +- tests/boards/intel_s1000_crb/src/i2c_test.c | 2 +- tests/boards/intel_s1000_crb/src/i2s_test.c | 2 +- .../native_posix/native_tasks/src/main.c | 2 +- tests/boards/native_posix/rtc/src/main.c | 4 +- .../counter_basic_api/src/test_counter.c | 2 +- tests/drivers/counter/counter_cmos/src/main.c | 2 +- .../dma/chan_blen_transfer/src/test_dma.c | 2 +- tests/drivers/dma/loop_transfer/src/dma.c | 2 +- .../gpio_basic_api/src/test_callback_manage.c | 8 +-- .../src/test_callback_trigger.c | 4 +- .../gpio/gpio_basic_api/src/test_pin_rw.c | 2 +- tests/drivers/i2c/i2c_api/src/test_i2c.c | 4 +- .../i2s/i2s_api/src/test_i2s_loopback.c | 12 ++-- .../drivers/i2s/i2s_api/src/test_i2s_states.c | 4 +- .../pinmux/pinmux_basic_api/src/pinmux_gpio.c | 2 +- tests/drivers/pwm/pwm_api/src/test_pwm.c | 16 ++--- .../uart/uart_basic_api/src/test_uart_fifo.c | 2 +- .../watchdog/wdt_basic_api/src/test_wdt.c | 2 +- tests/kernel/common/src/errno.c | 2 +- tests/kernel/context/src/main.c | 4 +- tests/kernel/early_sleep/src/main.c | 2 +- .../fifo/fifo_api/src/test_fifo_cancel.c | 2 +- tests/kernel/fifo/fifo_timeout/src/main.c | 8 +-- tests/kernel/fp_sharing/generic/src/main.c | 4 +- tests/kernel/fp_sharing/generic/src/pi.c | 2 +- tests/kernel/lifo/lifo_usage/src/main.c | 2 +- .../src/test_mpool_alloc_wait.c | 2 +- tests/kernel/mem_protect/futex/src/main.c | 6 +- tests/kernel/mem_protect/sys_sem/src/main.c | 2 +- tests/kernel/mem_protect/userspace/src/main.c | 16 ++--- .../mslab_concept/src/test_mslab_alloc_wait.c | 2 +- tests/kernel/msgq/msgq_api/src/test_msgq.h | 2 +- .../msgq/msgq_api/src/test_msgq_contexts.c | 2 +- .../kernel/msgq/msgq_api/src/test_msgq_fail.c | 4 +- .../msgq/msgq_api/src/test_msgq_purge.c | 5 +- .../mutex/mutex_api/src/test_mutex_apis.c | 6 +- tests/kernel/mutex/sys_mutex/src/main.c | 22 +++---- tests/kernel/mutex/sys_mutex/src/thread_12.c | 2 +- tests/kernel/obj_tracing/src/main.c | 2 +- tests/kernel/pending/src/main.c | 6 +- .../pipe/pipe_api/src/test_pipe_contexts.c | 6 +- tests/kernel/poll/src/test_poll.c | 10 +-- .../kernel/profiling/profiling_api/src/main.c | 2 +- tests/kernel/queue/src/test_queue_contexts.c | 2 +- tests/kernel/sched/deadline/src/main.c | 4 +- tests/kernel/sched/preempt/src/main.c | 2 +- .../src/test_priority_scheduling.c | 2 +- .../schedule_api/src/test_sched_priority.c | 4 +- .../src/test_sched_timeslice_and_lock.c | 6 +- .../kernel/sched/schedule_api/src/user_api.c | 2 +- tests/kernel/semaphore/semaphore/src/main.c | 16 ++--- tests/kernel/sleep/src/main.c | 14 ++-- tests/kernel/smp/src/main.c | 8 +-- tests/kernel/threads/thread_apis/src/main.c | 8 +-- .../thread_apis/src/test_kthread_for_each.c | 4 +- .../src/test_threads_cancel_abort.c | 20 +++--- .../thread_apis/src/test_threads_spawn.c | 8 +-- .../src/test_threads_suspend_resume.c | 4 +- tests/kernel/tickless/tickless/src/main.c | 10 +-- .../kernel/tickless/tickless/src/timestamps.c | 4 +- .../tickless/tickless_concept/src/main.c | 2 +- tests/kernel/timer/timer_api/src/main.c | 2 +- tests/kernel/timer/timer_monotonic/src/main.c | 2 +- tests/kernel/workq/work_queue/src/main.c | 24 +++---- tests/kernel/workq/work_queue_api/src/main.c | 6 +- tests/misc/test_build/src/main.c | 2 +- tests/net/context/src/main.c | 4 +- tests/net/ipv6/src/main.c | 2 +- .../mqtt_publisher/src/test_mqtt_publish.c | 2 +- .../lib/mqtt_pubsub/src/test_mqtt_pubsub.c | 2 +- .../mqtt_subscriber/src/test_mqtt_subscribe.c | 2 +- tests/net/mgmt/src/mgmt.c | 2 +- tests/net/mld/src/main.c | 2 +- tests/net/socket/tcp/src/main.c | 18 ++--- tests/posix/common/src/mutex.c | 4 +- .../fcb_init/src/settings_test_fcb_init.c | 2 +- 233 files changed, 540 insertions(+), 521 deletions(-) diff --git a/boards/arm/nrf52_pca20020/board.c b/boards/arm/nrf52_pca20020/board.c index 4de76762c5048..b84cf8a920883 100644 --- a/boards/arm/nrf52_pca20020/board.c +++ b/boards/arm/nrf52_pca20020/board.c @@ -30,7 +30,7 @@ static int pwr_ctrl_init(struct device *dev) gpio_pin_configure(gpio, cfg->pin, GPIO_DIR_OUT); gpio_pin_write(gpio, cfg->pin, 1); - k_sleep(1); /* Wait for the rail to come up and stabilize */ + k_msleep(1); /* Wait for the rail to come up and stabilize */ return 0; } diff --git a/boards/arm/nrf9160_pca10090/nrf52840_reset.c b/boards/arm/nrf9160_pca10090/nrf52840_reset.c index dd7ded9f0e64b..c784cf171ed09 100644 --- a/boards/arm/nrf9160_pca10090/nrf52840_reset.c +++ b/boards/arm/nrf9160_pca10090/nrf52840_reset.c @@ -55,7 +55,7 @@ int bt_hci_transport_setup(struct device *h4) * It is critical (!) to wait here, so that all bytes * on the lines are received and drained correctly. */ - k_sleep(1); + k_msleep(1); /* Drain bytes */ while (uart_fifo_read(h4, &c, 1)) { diff --git a/drivers/bluetooth/hci/h5.c b/drivers/bluetooth/hci/h5.c index 3633ef5b385b3..c638732664045 100644 --- a/drivers/bluetooth/hci/h5.c +++ b/drivers/bluetooth/hci/h5.c @@ -608,11 +608,11 @@ static void tx_thread(void) switch (h5.link_state) { case UNINIT: /* FIXME: send sync */ - k_sleep(100); + k_msleep(100); break; case INIT: /* FIXME: send conf */ - k_sleep(100); + k_msleep(100); break; case ACTIVE: buf = net_buf_get(&h5.tx_queue, K_FOREVER); diff --git a/drivers/bluetooth/hci/spi.c b/drivers/bluetooth/hci/spi.c index e92dc890b1091..e5a9329cf8584 100644 --- a/drivers/bluetooth/hci/spi.c +++ b/drivers/bluetooth/hci/spi.c @@ -407,7 +407,7 @@ static int bt_spi_send(struct net_buf *buf) if (!pending) { break; } - k_sleep(1); + k_msleep(1); } k_sem_take(&sem_busy, K_FOREVER); diff --git a/drivers/console/native_posix_console.c b/drivers/console/native_posix_console.c index 02d80060bb7e3..67a7367ff7d67 100644 --- a/drivers/console/native_posix_console.c +++ b/drivers/console/native_posix_console.c @@ -251,7 +251,7 @@ static void native_stdio_runner(void *p1, void *p2, void *p3) while (1) { s32_t wait_time = attempt_read_from_stdin(); - k_sleep(wait_time); + k_msleep(wait_time); } } #endif /* CONFIG_NATIVE_POSIX_STDIN_CONSOLE */ diff --git a/drivers/console/rtt_console.c b/drivers/console/rtt_console.c index fe2d57ac749e0..555aac130c076 100644 --- a/drivers/console/rtt_console.c +++ b/drivers/console/rtt_console.c @@ -30,7 +30,7 @@ static void wait(void) k_busy_wait(1000*CONFIG_RTT_TX_RETRY_DELAY_MS); } } else { - k_sleep(CONFIG_RTT_TX_RETRY_DELAY_MS); + k_msleep(CONFIG_RTT_TX_RETRY_DELAY_MS); } } diff --git a/drivers/display/display_ili9340.c b/drivers/display/display_ili9340.c index 973f8eca1ff28..50d00fe469e79 100644 --- a/drivers/display/display_ili9340.c +++ b/drivers/display/display_ili9340.c @@ -42,7 +42,7 @@ struct ili9340_data { static void ili9340_exit_sleep(struct ili9340_data *data) { ili9340_transmit(data, ILI9340_CMD_EXIT_SLEEP, NULL, 0); - k_sleep(120); + k_msleep(120); } static int ili9340_init(struct device *dev) @@ -96,11 +96,11 @@ static int ili9340_init(struct device *dev) #ifdef DT_INST_0_ILITEK_ILI9340_RESET_GPIOS_CONTROLLER LOG_DBG("Resetting display driver"); gpio_pin_write(data->reset_gpio, DT_INST_0_ILITEK_ILI9340_RESET_GPIOS_PIN, 1); - k_sleep(1); + k_msleep(1); gpio_pin_write(data->reset_gpio, DT_INST_0_ILITEK_ILI9340_RESET_GPIOS_PIN, 0); - k_sleep(1); + k_msleep(1); gpio_pin_write(data->reset_gpio, DT_INST_0_ILITEK_ILI9340_RESET_GPIOS_PIN, 1); - k_sleep(5); + k_msleep(5); #endif LOG_DBG("Initializing LCD"); diff --git a/drivers/display/display_ili9340_seeed_tftv2.c b/drivers/display/display_ili9340_seeed_tftv2.c index 329e5646ce40d..66e2f2ff02872 100644 --- a/drivers/display/display_ili9340_seeed_tftv2.c +++ b/drivers/display/display_ili9340_seeed_tftv2.c @@ -22,7 +22,7 @@ void ili9340_lcd_init(struct ili9340_data *p_ili9340) cmd = ILI9340_CMD_SOFTWARE_RESET; ili9340_transmit(p_ili9340, cmd, NULL, 0); - k_sleep(5); + k_msleep(5); cmd = ILI9341_CMD_POWER_CTRL_B; data[0] = 0x00U; @@ -166,7 +166,7 @@ void ili9340_lcd_init(struct ili9340_data *p_ili9340) cmd = ILI9340_CMD_EXIT_SLEEP; ili9340_transmit(p_ili9340, cmd, NULL, 0); - k_sleep(120); + k_msleep(120); /* Display Off */ cmd = ILI9340_CMD_DISPLAY_OFF; diff --git a/drivers/display/display_st7789v.c b/drivers/display/display_st7789v.c index c652a6139352d..74ebba44c6a5c 100644 --- a/drivers/display/display_st7789v.c +++ b/drivers/display/display_st7789v.c @@ -81,7 +81,7 @@ void st7789v_transmit(struct st7789v_data *data, u8_t cmd, static void st7789v_exit_sleep(struct st7789v_data *data) { st7789v_transmit(data, ST7789V_CMD_SLEEP_OUT, NULL, 0); - k_sleep(120); + k_msleep(120); } static void st7789v_reset_display(struct st7789v_data *data) @@ -89,14 +89,14 @@ static void st7789v_reset_display(struct st7789v_data *data) LOG_DBG("Resetting display"); #ifdef DT_INST_0_SITRONIX_ST7789V_RESET_GPIOS_CONTROLLER gpio_pin_write(data->reset_gpio, ST7789V_RESET_PIN, 1); - k_sleep(1); + k_msleep(1); gpio_pin_write(data->reset_gpio, ST7789V_RESET_PIN, 0); - k_sleep(6); + k_msleep(6); gpio_pin_write(data->reset_gpio, ST7789V_RESET_PIN, 1); - k_sleep(20); + k_msleep(20); #else st7789v_transmit(p_st7789v, ST7789V_CMD_SW_RESET, NULL, 0); - k_sleep(5); + k_msleep(5); #endif } diff --git a/drivers/display/ssd1306.c b/drivers/display/ssd1306.c index 5c7a226dde8fc..668d1b8811ad3 100644 --- a/drivers/display/ssd1306.c +++ b/drivers/display/ssd1306.c @@ -386,10 +386,10 @@ static int ssd1306_init_device(struct device *dev) #ifdef DT_INST_0_SOLOMON_SSD1306FB_RESET_GPIOS_CONTROLLER gpio_pin_write(driver->reset, DT_INST_0_SOLOMON_SSD1306FB_RESET_GPIOS_PIN, 1); - k_sleep(SSD1306_RESET_DELAY); + k_msleep(SSD1306_RESET_DELAY); gpio_pin_write(driver->reset, DT_INST_0_SOLOMON_SSD1306FB_RESET_GPIOS_PIN, 0); - k_sleep(SSD1306_RESET_DELAY); + k_msleep(SSD1306_RESET_DELAY); gpio_pin_write(driver->reset, DT_INST_0_SOLOMON_SSD1306FB_RESET_GPIOS_PIN, 1); #endif diff --git a/drivers/display/ssd16xx.c b/drivers/display/ssd16xx.c index 8eee723dc2ace..b6e91339c69e3 100644 --- a/drivers/display/ssd16xx.c +++ b/drivers/display/ssd16xx.c @@ -110,7 +110,7 @@ static inline void ssd16xx_busy_wait(struct ssd16xx_data *driver) gpio_pin_read(driver->busy, SSD16XX_BUSY_PIN, &val); while (val) { - k_sleep(SSD16XX_BUSY_DELAY); + k_msleep(SSD16XX_BUSY_DELAY); gpio_pin_read(driver->busy, SSD16XX_BUSY_PIN, &val); } } @@ -449,9 +449,9 @@ static int ssd16xx_controller_init(struct device *dev) LOG_DBG(""); gpio_pin_write(driver->reset, SSD16XX_RESET_PIN, 0); - k_sleep(SSD16XX_RESET_DELAY); + k_msleep(SSD16XX_RESET_DELAY); gpio_pin_write(driver->reset, SSD16XX_RESET_PIN, 1); - k_sleep(SSD16XX_RESET_DELAY); + k_msleep(SSD16XX_RESET_DELAY); ssd16xx_busy_wait(driver); err = ssd16xx_write_cmd(driver, SSD16XX_CMD_SW_RESET, NULL, 0); diff --git a/drivers/ethernet/eth_enc424j600.c b/drivers/ethernet/eth_enc424j600.c index baf21d2fd0df9..2e3b2f89d9628 100644 --- a/drivers/ethernet/eth_enc424j600.c +++ b/drivers/ethernet/eth_enc424j600.c @@ -325,7 +325,7 @@ static int enc424j600_tx(struct device *dev, struct net_pkt *pkt) enc424j600_write_sbc(dev, ENC424J600_1BC_SETTXRTS); do { - k_sleep(1); + k_msleep(1); enc424j600_read_sfru(dev, ENC424J600_SFRX_ECON1L, &tmp); } while (tmp & ENC424J600_ECON1_TXRTS); @@ -545,12 +545,12 @@ static int enc424j600_stop_device(struct device *dev) ENC424J600_ECON1_RXEN); do { - k_sleep(10U); + k_msleep(10U); enc424j600_read_sfru(dev, ENC424J600_SFRX_ESTATL, &tmp); } while (tmp & ENC424J600_ESTAT_RXBUSY); do { - k_sleep(10U); + k_msleep(10U); enc424j600_read_sfru(dev, ENC424J600_SFRX_ECON1L, &tmp); } while (tmp & ENC424J600_ECON1_TXRTS); diff --git a/drivers/ethernet/eth_mcux.c b/drivers/ethernet/eth_mcux.c index 36f6ebabbe53f..fbb70851bcd0e 100644 --- a/drivers/ethernet/eth_mcux.c +++ b/drivers/ethernet/eth_mcux.c @@ -335,7 +335,7 @@ static void eth_mcux_phy_event(struct eth_context *context) context->link_up = link_up; context->phy_state = eth_mcux_phy_state_read_duplex; net_eth_carrier_on(context->iface); - k_sleep(USEC_PER_MSEC); + k_msleep(USEC_PER_MSEC); } else if (!link_up && context->link_up) { LOG_INF("Link down"); context->link_up = link_up; diff --git a/drivers/ethernet/eth_smsc911x.c b/drivers/ethernet/eth_smsc911x.c index 2c96861652901..cda97106092cc 100644 --- a/drivers/ethernet/eth_smsc911x.c +++ b/drivers/ethernet/eth_smsc911x.c @@ -106,7 +106,7 @@ int smsc_phy_regread(u8_t regoffset, u32_t *data) val = 0U; do { - k_sleep(1); + k_msleep(1); time_out--; if (smsc_mac_regread(SMSC9220_MAC_MII_ACC, &val)) { return -1; @@ -152,7 +152,7 @@ int smsc_phy_regwrite(u8_t regoffset, u32_t data) } do { - k_sleep(1); + k_msleep(1); time_out--; if (smsc_mac_regread(SMSC9220_MAC_MII_ACC, &phycmd)) { return -1; @@ -222,7 +222,7 @@ static int smsc_soft_reset(void) SMSC9220->HW_CFG |= HW_CFG_SRST; do { - k_sleep(1); + k_msleep(1); time_out--; } while (time_out != 0U && (SMSC9220->HW_CFG & HW_CFG_SRST)); @@ -375,7 +375,7 @@ int smsc_init(void) return -1; } - k_sleep(PHY_RESET_TIMEOUT); + k_msleep(PHY_RESET_TIMEOUT); /* Checking whether phy reset completed successfully.*/ if (smsc_phy_regread(SMSC9220_PHY_BCONTROL, &phyreset)) { return 1; @@ -402,7 +402,7 @@ int smsc_init(void) SMSC9220->FIFO_INT &= ~(0xFF); /* Clear 2 bottom nibbles */ /* This sleep is compulsory otherwise txmit/receive will fail. */ - k_sleep(2000); + k_msleep(2000); return 0; } diff --git a/drivers/ethernet/eth_stm32_hal.c b/drivers/ethernet/eth_stm32_hal.c index 5f40a7508ebf2..9b98dfab50b3e 100644 --- a/drivers/ethernet/eth_stm32_hal.c +++ b/drivers/ethernet/eth_stm32_hal.c @@ -87,7 +87,7 @@ static inline void disable_mcast_filter(ETH_HandleTypeDef *heth) * at least four TX_CLK/RX_CLK clock cycles */ tmp = heth->Instance->MACFFR; - k_sleep(1); + k_msleep(1); heth->Instance->MACFFR = tmp; } diff --git a/drivers/ethernet/phy_sam_gmac.c b/drivers/ethernet/phy_sam_gmac.c index 3c36478c6bd6a..bdb1bf4e90ad0 100644 --- a/drivers/ethernet/phy_sam_gmac.c +++ b/drivers/ethernet/phy_sam_gmac.c @@ -47,7 +47,7 @@ static int mdio_bus_wait(Gmac *gmac) return -ETIMEDOUT; } - k_sleep(10); + k_msleep(10); } return 0; @@ -127,7 +127,7 @@ static int phy_soft_reset(const struct phy_sam_gmac_dev *phy) return -ETIMEDOUT; } - k_sleep(50); + k_msleep(50); retval = phy_read(phy, MII_BMCR, &phy_reg); if (retval < 0) { @@ -228,7 +228,7 @@ int phy_sam_gmac_auto_negotiate(const struct phy_sam_gmac_dev *phy, goto auto_negotiate_exit; } - k_sleep(100); + k_msleep(100); retval = phy_read(phy, MII_BMSR, &val); if (retval < 0) { diff --git a/drivers/i2s/i2s_ll_stm32.c b/drivers/i2s/i2s_ll_stm32.c index 43be4e340b9cd..b512becabd58d 100644 --- a/drivers/i2s/i2s_ll_stm32.c +++ b/drivers/i2s/i2s_ll_stm32.c @@ -140,7 +140,7 @@ static int i2s_stm32_set_clock(struct device *dev, u32_t bit_clk_freq) } /* wait 1 ms */ - k_sleep(1); + k_msleep(1); } LOG_DBG("PLLI2S is locked"); diff --git a/drivers/led/ht16k33.c b/drivers/led/ht16k33.c index 886eda1636fee..18f58105fc3de 100644 --- a/drivers/led/ht16k33.c +++ b/drivers/led/ht16k33.c @@ -270,7 +270,7 @@ static void ht16k33_irq_thread(struct device *dev) do { k_sem_reset(&data->irq_sem); pressed = ht16k33_process_keyscan_data(dev); - k_sleep(CONFIG_HT16K33_KEYSCAN_DEBOUNCE_MSEC); + k_msleep(CONFIG_HT16K33_KEYSCAN_DEBOUNCE_MSEC); } while (pressed); } } diff --git a/drivers/led/lp5562.c b/drivers/led/lp5562.c index 650e8c9a9fef0..659302276ee5c 100644 --- a/drivers/led/lp5562.c +++ b/drivers/led/lp5562.c @@ -489,7 +489,7 @@ static inline int lp5562_set_engine_exec_state(struct device *dev, * Delay between consecutive I2C writes to * ENABLE register (00h) need to be longer than 488μs (typ.). */ - k_sleep(1); + k_msleep(1); return ret; } diff --git a/drivers/modem/ublox-sara-r4.c b/drivers/modem/ublox-sara-r4.c index 7b739d3fc1dbc..56e9c373357ac 100644 --- a/drivers/modem/ublox-sara-r4.c +++ b/drivers/modem/ublox-sara-r4.c @@ -266,7 +266,7 @@ static int send_socket_data(struct modem_socket *sock, } /* slight pause per spec so that @ prompt is received */ - k_sleep(MDM_PROMPT_CMD_DELAY); + k_msleep(MDM_PROMPT_CMD_DELAY); #if defined(CONFIG_MODEM_UBLOX_SARA_R4) /* * HACK: Apparently, enabling HEX transmit mode also @@ -830,7 +830,7 @@ static void modem_reset(void) /* query modem RSSI */ modem_rssi_query_work(NULL); - k_sleep(MDM_WAIT_FOR_RSSI_DELAY); + k_msleep(MDM_WAIT_FOR_RSSI_DELAY); counter = 0; /* wait for RSSI < 0 and > -1000 */ @@ -838,7 +838,7 @@ static void modem_reset(void) (mctx.data_rssi >= 0 || mctx.data_rssi <= -1000)) { modem_rssi_query_work(NULL); - k_sleep(MDM_WAIT_FOR_RSSI_DELAY); + k_msleep(MDM_WAIT_FOR_RSSI_DELAY); } if (mctx.data_rssi >= 0 || mctx.data_rssi <= -1000) { diff --git a/drivers/pwm/pwm_imx.c b/drivers/pwm/pwm_imx.c index 10b88fcfafcbe..f7b6310178689 100644 --- a/drivers/pwm/pwm_imx.c +++ b/drivers/pwm/pwm_imx.c @@ -96,7 +96,7 @@ static int imx_pwm_pin_set(struct device *dev, u32_t pwm, } else { PWM_PWMCR_REG(base) = PWM_PWMCR_SWR(1); do { - k_sleep(1); + k_msleep(1); cr = PWM_PWMCR_REG(base); } while ((PWM_PWMCR_SWR(cr)) && (++wait_count < CONFIG_PWM_PWMSWR_LOOP)); diff --git a/drivers/sensor/adxl362/adxl362.c b/drivers/sensor/adxl362/adxl362.c index dd561bcb08e77..bd247d1a3dfbf 100644 --- a/drivers/sensor/adxl362/adxl362.c +++ b/drivers/sensor/adxl362/adxl362.c @@ -755,7 +755,7 @@ static int adxl362_init(struct device *dev) return -ENODEV; } - k_sleep(5); + k_msleep(5); adxl362_get_reg(dev, &value, ADXL362_REG_PARTID, 1); if (value != ADXL362_PART_ID) { diff --git a/drivers/sensor/adxl372/adxl372.c b/drivers/sensor/adxl372/adxl372.c index 171c26f8cbda3..aedd32d31988a 100644 --- a/drivers/sensor/adxl372/adxl372.c +++ b/drivers/sensor/adxl372/adxl372.c @@ -502,7 +502,7 @@ static int adxl372_reset(struct device *dev) } /* Writing code 0x52 resets the device */ ret = adxl372_reg_write(dev, ADXL372_RESET, ADXL372_RESET_CODE); - k_sleep(1000); + k_msleep(1000); return ret; } diff --git a/drivers/sensor/ams_iAQcore/iAQcore.c b/drivers/sensor/ams_iAQcore/iAQcore.c index 07036ecc420c1..9a37cfc363a3a 100644 --- a/drivers/sensor/ams_iAQcore/iAQcore.c +++ b/drivers/sensor/ams_iAQcore/iAQcore.c @@ -51,7 +51,7 @@ static int iaqcore_sample_fetch(struct device *dev, enum sensor_channel chan) return 0; } - k_sleep(100); + k_msleep(100); } if (drv_data->status == 0x01) { diff --git a/drivers/sensor/apds9960/apds9960.c b/drivers/sensor/apds9960/apds9960.c index ef99413c237dd..d070d4b9f45bd 100644 --- a/drivers/sensor/apds9960/apds9960.c +++ b/drivers/sensor/apds9960/apds9960.c @@ -447,7 +447,7 @@ static int apds9960_init(struct device *dev) struct apds9960_data *data = dev->driver_data; /* Initialize time 5.7ms */ - k_sleep(6); + k_msleep(6); data->i2c = device_get_binding(config->i2c_name); if (data->i2c == NULL) { diff --git a/drivers/sensor/ccs811/ccs811.c b/drivers/sensor/ccs811/ccs811.c index 14770a3ffdaac..2d49718f884a0 100644 --- a/drivers/sensor/ccs811/ccs811.c +++ b/drivers/sensor/ccs811/ccs811.c @@ -38,7 +38,7 @@ static int ccs811_sample_fetch(struct device *dev, enum sensor_channel chan) break; } - k_sleep(100); + k_msleep(100); } if (!(status & CCS811_STATUS_DATA_READY)) { @@ -180,7 +180,7 @@ int ccs811_init(struct device *dev) GPIO_DIR_OUT); gpio_pin_write(drv_data->gpio, CONFIG_CCS811_GPIO_RESET_PIN_NUM, 1); - k_sleep(1); + k_msleep(1); #endif /* @@ -192,7 +192,7 @@ int ccs811_init(struct device *dev) GPIO_DIR_OUT); gpio_pin_write(drv_data->gpio, CONFIG_CCS811_GPIO_WAKEUP_PIN_NUM, 0); - k_sleep(1); + k_msleep(1); #endif /* Switch device to application mode */ diff --git a/drivers/sensor/ens210/ens210.c b/drivers/sensor/ens210/ens210.c index 656f1c35ec609..45c8e8e997f0c 100644 --- a/drivers/sensor/ens210/ens210.c +++ b/drivers/sensor/ens210/ens210.c @@ -162,7 +162,7 @@ static int ens210_wait_boot(struct device *i2c_dev) (u8_t *)&sys_stat); if (ret < 0) { - k_sleep(1); + k_msleep(1); continue; } @@ -176,7 +176,7 @@ static int ens210_wait_boot(struct device *i2c_dev) ens210_sys_enable(i2c_dev); - k_sleep(2); + k_msleep(2); } if (ret < 0) { diff --git a/drivers/sensor/hts221/hts221.c b/drivers/sensor/hts221/hts221.c index 98a8e133e0c54..6e17180b5a6bf 100644 --- a/drivers/sensor/hts221/hts221.c +++ b/drivers/sensor/hts221/hts221.c @@ -158,7 +158,7 @@ int hts221_init(struct device *dev) * the device requires about 2.2 ms to download the flash content * into the volatile mem */ - k_sleep(3); + k_msleep(3); if (hts221_read_conversion_data(drv_data) < 0) { LOG_ERR("Failed to read conversion data."); diff --git a/drivers/sensor/lsm6dsl/lsm6dsl_shub.c b/drivers/sensor/lsm6dsl/lsm6dsl_shub.c index 3b728b476caa0..be409f3170e67 100644 --- a/drivers/sensor/lsm6dsl/lsm6dsl_shub.c +++ b/drivers/sensor/lsm6dsl/lsm6dsl_shub.c @@ -65,7 +65,7 @@ static int lsm6dsl_lis2mdl_init(struct lsm6dsl_data *data, u8_t i2c_addr) lsm6dsl_shub_write_slave_reg(data, i2c_addr, LIS2MDL_CFG_REG_A, mag_cfg, 1); - k_sleep(10); /* turn-on time in ms */ + k_msleep(10); /* turn-on time in ms */ /* configure mag */ mag_cfg[0] = LIS2MDL_ODR_10HZ; @@ -99,7 +99,7 @@ static int lsm6dsl_lps22hb_init(struct lsm6dsl_data *data, u8_t i2c_addr) lsm6dsl_shub_write_slave_reg(data, i2c_addr, LPS22HB_CTRL_REG2, baro_cfg, 1); - k_sleep(1); /* turn-on time in ms */ + k_msleep(1); /* turn-on time in ms */ /* configure device */ baro_cfg[0] = LPS22HB_ODR_10HZ | LPS22HB_LPF_EN | LPS22HB_BDU_EN; @@ -151,7 +151,7 @@ static inline void lsm6dsl_shub_wait_completed(struct lsm6dsl_data *data) u16_t freq; freq = (data->accel_freq == 0U) ? 26 : data->accel_freq; - k_sleep((2000U / freq) + 1); + k_msleep((2000U / freq) + 1); } static inline void lsm6dsl_shub_embedded_en(struct lsm6dsl_data *data, bool on) @@ -162,7 +162,7 @@ static inline void lsm6dsl_shub_embedded_en(struct lsm6dsl_data *data, bool on) LSM6DSL_MASK_FUNC_CFG_EN, func_en << LSM6DSL_SHIFT_FUNC_CFG_EN); - k_sleep(1); + k_msleep(1); } #ifdef LSM6DSL_DEBUG diff --git a/drivers/sensor/lsm6dso/lsm6dso_shub.c b/drivers/sensor/lsm6dso/lsm6dso_shub.c index 91ec61cf465e9..09540a540ea64 100644 --- a/drivers/sensor/lsm6dso/lsm6dso_shub.c +++ b/drivers/sensor/lsm6dso/lsm6dso_shub.c @@ -83,7 +83,7 @@ static int lsm6dso_lis2mdl_init(struct lsm6dso_data *data, u8_t i2c_addr) lsm6dso_shub_write_slave_reg(data, i2c_addr, LIS2MDL_CFG_REG_A, mag_cfg, 1); - k_sleep(10); /* turn-on time in ms */ + k_msleep(10); /* turn-on time in ms */ /* configure mag */ mag_cfg[0] = LIS2MDL_ODR_10HZ; @@ -254,7 +254,7 @@ static int lsm6dso_lps22hb_init(struct lsm6dso_data *data, u8_t i2c_addr) lsm6dso_shub_write_slave_reg(data, i2c_addr, LPS22HB_CTRL_REG2, baro_cfg, 1); - k_sleep(1); /* turn-on time in ms */ + k_msleep(1); /* turn-on time in ms */ /* configure device */ baro_cfg[0] = LPS22HB_ODR_10HZ | LPS22HB_LPF_EN | LPS22HB_BDU_EN; @@ -288,7 +288,7 @@ static int lsm6dso_lps22hh_init(struct lsm6dso_data *data, u8_t i2c_addr) lsm6dso_shub_write_slave_reg(data, i2c_addr, LPS22HH_CTRL_REG2, baro_cfg, 1); - k_sleep(100); /* turn-on time in ms */ + k_msleep(100); /* turn-on time in ms */ /* configure device */ baro_cfg[0] = LPS22HH_IF_ADD_INC; @@ -421,7 +421,7 @@ static inline void lsm6dso_shub_wait_completed(struct lsm6dso_data *data) u16_t freq; freq = (data->accel_freq == 0) ? 26 : data->accel_freq; - k_sleep((2000U / freq) + 1); + k_msleep((2000U / freq) + 1); } static inline void lsm6dso_shub_embedded_en(struct lsm6dso_data *data, bool on) diff --git a/drivers/sensor/ms5837/ms5837.c b/drivers/sensor/ms5837/ms5837.c index a474763588fe2..dcd63a291a939 100644 --- a/drivers/sensor/ms5837/ms5837.c +++ b/drivers/sensor/ms5837/ms5837.c @@ -31,7 +31,7 @@ static int ms5837_get_measurement(struct device *i2c_master, return err; } - k_sleep(delay); + k_msleep(delay); err = i2c_burst_read(i2c_master, i2c_address, adc_read_cmd, ((u8_t *)val) + 1, 3); diff --git a/drivers/sensor/ti_hdc/ti_hdc.c b/drivers/sensor/ti_hdc/ti_hdc.c index 0f7bf079ce802..d3d1d247e2bd8 100644 --- a/drivers/sensor/ti_hdc/ti_hdc.c +++ b/drivers/sensor/ti_hdc/ti_hdc.c @@ -54,7 +54,7 @@ static int ti_hdc_sample_fetch(struct device *dev, enum sensor_channel chan) k_sem_take(&drv_data->data_sem, K_FOREVER); #else /* wait for the conversion to finish */ - k_sleep(HDC_CONVERSION_TIME); + k_msleep(HDC_CONVERSION_TIME); #endif if (i2c_read(drv_data->i2c, buf, 4, DT_INST_0_TI_HDC_BASE_ADDRESS) < 0) { diff --git a/drivers/sensor/vl53l0x/vl53l0x.c b/drivers/sensor/vl53l0x/vl53l0x.c index b57f9f85c07d0..6492fa6357c02 100644 --- a/drivers/sensor/vl53l0x/vl53l0x.c +++ b/drivers/sensor/vl53l0x/vl53l0x.c @@ -224,7 +224,7 @@ static int vl53l0x_init(struct device *dev) } gpio_pin_write(gpio, CONFIG_VL53L0X_XSHUT_GPIO_PIN_NUM, 1); - k_sleep(100); + k_msleep(100); #endif drv_data->i2c = device_get_binding(DT_INST_0_ST_VL53L0X_BUS_NAME); diff --git a/drivers/sensor/vl53l0x/vl53l0x_platform.c b/drivers/sensor/vl53l0x/vl53l0x_platform.c index f88dbd093017c..8db68b8dfaaf4 100644 --- a/drivers/sensor/vl53l0x/vl53l0x_platform.c +++ b/drivers/sensor/vl53l0x/vl53l0x_platform.c @@ -190,7 +190,7 @@ VL53L0X_Error VL53L0X_RdDWord(VL53L0X_DEV Dev, uint8_t index, uint32_t *data) VL53L0X_Error VL53L0X_PollingDelay(VL53L0X_DEV Dev) { - k_sleep(2); + k_msleep(2); return VL53L0X_ERROR_NONE; } diff --git a/drivers/serial/uart_miv.c b/drivers/serial/uart_miv.c index 9cf323f0cd0c0..b00a721bcfbc8 100644 --- a/drivers/serial/uart_miv.c +++ b/drivers/serial/uart_miv.c @@ -322,7 +322,7 @@ void uart_miv_rx_thread(void *arg1, void *arg2, void *arg3) if (uart->status & STATUS_RXFULL_MASK) { uart_miv_irq_handler(dev); } - k_sleep(delay); + k_msleep(delay); } } diff --git a/drivers/usb/device/usb_dc_native_posix_adapt.c b/drivers/usb/device/usb_dc_native_posix_adapt.c index 144d8abe0999b..950071cbdf7dd 100644 --- a/drivers/usb/device/usb_dc_native_posix_adapt.c +++ b/drivers/usb/device/usb_dc_native_posix_adapt.c @@ -318,7 +318,7 @@ void usbip_start(void) if (connfd < 0) { if (errno == EAGAIN || errno == EWOULDBLOCK) { /* Non-blocking accept */ - k_sleep(100); + k_msleep(100); continue; } @@ -347,7 +347,7 @@ void usbip_start(void) if (errno == EAGAIN || errno == EWOULDBLOCK) { /* Non-blocking accept */ - k_sleep(100); + k_msleep(100); continue; } @@ -389,7 +389,7 @@ void usbip_start(void) if (read < 0) { if (errno == EAGAIN || errno == EWOULDBLOCK) { /* Non-blocking accept */ - k_sleep(100); + k_msleep(100); continue; } diff --git a/drivers/wifi/eswifi/eswifi_bus_spi.c b/drivers/wifi/eswifi/eswifi_bus_spi.c index 723539576c21c..d5f0efda69942 100644 --- a/drivers/wifi/eswifi/eswifi_bus_spi.c +++ b/drivers/wifi/eswifi/eswifi_bus_spi.c @@ -48,7 +48,7 @@ static int eswifi_spi_wait_cmddata_ready(struct eswifi_spi_data *spi) do { /* allow other threads to be scheduled */ - k_sleep(1); + k_msleep(1); } while (!eswifi_spi_cmddata_ready(spi) && --max_retries); return max_retries ? 0 : -ETIMEDOUT; @@ -169,7 +169,7 @@ static int eswifi_spi_request(struct eswifi_dev *eswifi, char *cmd, size_t clen, /* Flush remaining data if receiving buffer not large enough */ while (eswifi_spi_cmddata_ready(spi)) { eswifi_spi_read(eswifi, tmp, 2); - k_sleep(1); + k_msleep(1); } /* Our device is flagged with SPI_HOLD_ON_CS|SPI_LOCK_ON, release */ diff --git a/drivers/wifi/eswifi/eswifi_core.c b/drivers/wifi/eswifi/eswifi_core.c index 96795cddd1830..05d2fdfe026e1 100644 --- a/drivers/wifi/eswifi/eswifi_core.c +++ b/drivers/wifi/eswifi/eswifi_core.c @@ -39,10 +39,10 @@ static struct eswifi_dev eswifi0; /* static instance */ static int eswifi_reset(struct eswifi_dev *eswifi) { gpio_pin_write(eswifi->resetn.dev, eswifi->resetn.pin, 0); - k_sleep(10); + k_msleep(10); gpio_pin_write(eswifi->resetn.dev, eswifi->resetn.pin, 1); gpio_pin_write(eswifi->wakeup.dev, eswifi->wakeup.pin, 1); - k_sleep(500); + k_msleep(500); /* fetch the cursor */ return eswifi_request(eswifi, NULL, 0, eswifi->buf, diff --git a/include/kernel.h b/include/kernel.h index 9c622aa65bf1a..b7a33273757fd 100644 --- a/include/kernel.h +++ b/include/kernel.h @@ -795,14 +795,37 @@ void k_thread_system_pool_assign(struct k_thread *thread); /** * @brief Put the current thread to sleep. * - * This routine puts the current thread to sleep for @a duration milliseconds. + * This routine puts the current thread to sleep for @a duration. * - * @param ms Number of milliseconds to sleep. + * @param ms Duration of sleep, specified via a k_timeout_t + * initialized via one of the K_TIMEOUT_*() macros. + * + * @return Zero if the requested time has elapsed or the number of + * system ticks left to sleep, if thread was woken up by \ref k_wakeup + * call. + */ +__syscall k_ticks_t k_sleep(k_timeout_t ms); + +/** + * @brief Sleep for ms timeout. + * + * This routine puts the current thread to sleep for @a duration + * milliseconds. Simple wrapper around k_sleep(). Note that + * milliseconds may not match the rate of the internal tick counter + * and so this API can suffer from accidental precision loss where the + * k_timeout_t provides more control over units. + * + * @param ms Duration of sleep, specified in milliseconds * * @return Zero if the requested time has elapsed or the number of milliseconds * left to sleep, if thread was woken up by \ref k_wakeup call. */ -__syscall s32_t k_sleep(s32_t ms); +static inline k_ticks_t k_msleep(s32_t ms) +{ + k_ticks_t ticks = k_sleep(K_TIMEOUT_MS(ms)); + + return (k_ticks_t)k_ticks_to_ms_floor64(ticks); +} /** * @brief Put the current thread to sleep with microsecond resolution. @@ -818,7 +841,12 @@ __syscall s32_t k_sleep(s32_t ms); * @return Zero if the requested time has elapsed or the number of microseconds * left to sleep, if thread was woken up by \ref k_wakeup call. */ -__syscall s32_t k_usleep(s32_t us); +static inline k_ticks_t k_usleep(s32_t us) +{ + k_ticks_t ticks = k_sleep(K_TIMEOUT_US(us)); + + return (k_ticks_t)k_ticks_to_us_floor64(ticks); +} /** * @brief Cause the current thread to busy wait. diff --git a/include/sys_clock.h b/include/sys_clock.h index 2495b6b387a77..c70e9939d46ea 100644 --- a/include/sys_clock.h +++ b/include/sys_clock.h @@ -131,7 +131,7 @@ struct _timeout { # define K_TIMEOUT_CYC(t) K_TIMEOUT_TICKS(k_cyc_to_ticks_ceil64(t)) # else # define K_TIMEOUT_MS(t) K_TIMEOUT_TICKS(k_ms_to_ticks_ceil32(t)) -# define K_TIMEOUT_US(t) K_TIMEOUT_TICKS(k_us_to_ticks_ceil32(t)) +# define K_TIMEOUT_US(t) K_TIMEOUT_TICKS(k_us_to_ticks_ceil64(t)) # define K_TIMEOUT_CYC(t) K_TIMEOUT_TICKS(k_cyc_to_ticks_ceil32(t)) # endif #endif diff --git a/kernel/sched.c b/kernel/sched.c index a081c621c8de4..e432ccc2bf682 100644 --- a/kernel/sched.c +++ b/kernel/sched.c @@ -926,23 +926,19 @@ static inline void z_vrfy_k_yield(void) #include #endif -static s32_t z_tick_sleep(s32_t ticks) +static k_ticks_t z_sleep(k_timeout_t timeout) { #ifdef CONFIG_MULTITHREADING - u32_t expected_wakeup_time; + k_ticks_t start, end, ticks, expires; __ASSERT(!z_arch_is_in_isr(), ""); - K_DEBUG("thread %p for %d ticks\n", _current, ticks); - - /* wait of 0 ms is treated as a 'yield' */ - if (ticks == 0) { + /* historical API convention: zero sleep means "yield" */ + if (K_TIMEOUT_EQ(timeout, K_NO_WAIT)) { k_yield(); return 0; } - expected_wakeup_time = ticks + z_tick_get_32(); - /* Spinlock purely for local interrupt locking to prevent us * from being interrupted while _current is in an intermediate * state. Should unify this implementation with pend(). @@ -950,23 +946,38 @@ static s32_t z_tick_sleep(s32_t ticks) struct k_spinlock local_lock = {}; k_spinlock_key_t key = k_spin_lock(&local_lock); + start = z_tick_get(); #if defined(CONFIG_TIMESLICING) && defined(CONFIG_SWAP_NONATOMIC) pending_current = _current; #endif z_remove_thread_from_ready_q(_current); - z_add_thread_timeout(_current, K_TIMEOUT_TICKS(ticks)); + z_add_thread_timeout(_current, timeout); z_mark_thread_as_suspended(_current); (void)z_swap(&local_lock, key); + end = z_tick_get(); __ASSERT(!z_is_thread_state_set(_current, _THREAD_SUSPENDED), ""); - ticks = expected_wakeup_time - z_tick_get_32(); - if (ticks > 0) { - return ticks; + /* Return value is zero if the timeout expired, otherwise the + * time remaining. + */ + ticks = K_TIMEOUT_GET(timeout); + if (IS_ENABLED(CONFIG_SYS_TIMEOUT_LEGACY_API)) { + ticks = (k_ticks_t)k_ms_to_ticks_ceil64(ticks); } -#endif + expires = start + ticks; + if (IS_ENABLED(CONFIG_SYS_TIMEOUT_64BIT) + && K_TIMEOUT_GET(timeout) < K_FOREVER_TICKS) { + /* Absolute timeout */ + expires = K_FOREVER_TICKS - 1 - K_TIMEOUT_GET(timeout); + } + + if (end < expires) { + return expires - end; + } +#endif return 0; } @@ -990,40 +1001,19 @@ k_ticks_t z_thread_remaining(k_tid_t thread) return z_thread_end(thread) - (k_ticks_t) z_tick_get(); } -s32_t z_impl_k_sleep(int ms) +k_ticks_t z_impl_k_sleep(k_timeout_t timeout) { - s32_t ticks; - - ticks = z_ms_to_ticks(ms); - ticks = z_tick_sleep(ticks); - return __ticks_to_ms(ticks); + return z_sleep(timeout); } #ifdef CONFIG_USERSPACE -static inline s32_t z_vrfy_k_sleep(int ms) +static inline k_ticks_t z_vrfy_k_sleep(k_timeout_t t) { - return z_impl_k_sleep(ms); + return z_impl_k_sleep(t); } #include #endif -s32_t z_impl_k_usleep(int us) -{ - s32_t ticks; - - ticks = z_us_to_ticks(us); - ticks = z_tick_sleep(ticks); - return __ticks_to_us(ticks); -} - -#ifdef CONFIG_USERSPACE -static inline s32_t z_vrfy_k_usleep(int us) -{ - return z_impl_k_usleep(us); -} -#include -#endif - void z_impl_k_wakeup(k_tid_t thread) { if (z_is_thread_pending(thread)) { diff --git a/lib/cmsis_rtos_v1/cmsis_wait.c b/lib/cmsis_rtos_v1/cmsis_wait.c index 45de33e3d1285..03e64b59bfc29 100644 --- a/lib/cmsis_rtos_v1/cmsis_wait.c +++ b/lib/cmsis_rtos_v1/cmsis_wait.c @@ -16,6 +16,6 @@ osStatus osDelay(uint32_t delay_ms) return osErrorISR; } - k_sleep(delay_ms); + k_msleep(delay_ms); return osEventTimeout; } diff --git a/lib/cmsis_rtos_v2/kernel.c b/lib/cmsis_rtos_v2/kernel.c index dad2b177f5696..39ab508bf2d25 100644 --- a/lib/cmsis_rtos_v2/kernel.c +++ b/lib/cmsis_rtos_v2/kernel.c @@ -133,7 +133,7 @@ osStatus_t osDelay(uint32_t ticks) return osErrorISR; } - k_sleep(__ticks_to_ms(ticks)); + k_msleep(__ticks_to_ms(ticks)); return osOK; } @@ -150,7 +150,7 @@ osStatus_t osDelayUntil(uint32_t ticks) } ticks_elapsed = osKernelGetTickCount(); - k_sleep(__ticks_to_ms(ticks - ticks_elapsed)); + k_msleep(__ticks_to_ms(ticks - ticks_elapsed)); return osOK; } diff --git a/lib/posix/sleep.c b/lib/posix/sleep.c index cf5bc171b8c12..b40aa4fc1de7a 100644 --- a/lib/posix/sleep.c +++ b/lib/posix/sleep.c @@ -27,7 +27,7 @@ int usleep(useconds_t useconds) if (useconds < USEC_PER_MSEC) { k_busy_wait(useconds); } else { - k_sleep(useconds / USEC_PER_MSEC); + k_msleep(useconds / USEC_PER_MSEC); } return 0; diff --git a/samples/basic/blink_led/src/main.c b/samples/basic/blink_led/src/main.c index ee38f84897f9c..c1df968179184 100644 --- a/samples/basic/blink_led/src/main.c +++ b/samples/basic/blink_led/src/main.c @@ -67,6 +67,6 @@ void main(void) } } - k_sleep(MSEC_PER_SEC * 4U); + k_msleep(MSEC_PER_SEC * 4U); } } diff --git a/samples/basic/blinky/src/main.c b/samples/basic/blinky/src/main.c index d5e99bbd7e926..bf185dc0d77d8 100644 --- a/samples/basic/blinky/src/main.c +++ b/samples/basic/blinky/src/main.c @@ -27,6 +27,6 @@ void main(void) /* Set pin to HIGH/LOW every 1 second */ gpio_pin_write(dev, LED, cnt % 2); cnt++; - k_sleep(SLEEP_TIME); + k_msleep(SLEEP_TIME); } } diff --git a/samples/basic/button/src/main.c b/samples/basic/button/src/main.c index d55147c171a78..87b689a0dbdc5 100644 --- a/samples/basic/button/src/main.c +++ b/samples/basic/button/src/main.c @@ -84,6 +84,6 @@ void main(void) u32_t val = 0U; gpio_pin_read(gpiob, PIN, &val); - k_sleep(SLEEP_TIME); + k_msleep(SLEEP_TIME); } } diff --git a/samples/basic/disco/src/main.c b/samples/basic/disco/src/main.c index 7f58794936e3c..67a62821c9bd8 100644 --- a/samples/basic/disco/src/main.c +++ b/samples/basic/disco/src/main.c @@ -30,7 +30,7 @@ void main(void) while (1) { gpio_pin_write(gpio0, LED0, cnt % 2); gpio_pin_write(gpio1, LED1, (cnt + 1) % 2); - k_sleep(SLEEP_TIME); + k_msleep(SLEEP_TIME); cnt++; } } diff --git a/samples/basic/fade_led/src/main.c b/samples/basic/fade_led/src/main.c index 4d1bd12e1f378..72b270cb58152 100644 --- a/samples/basic/fade_led/src/main.c +++ b/samples/basic/fade_led/src/main.c @@ -69,6 +69,6 @@ void main(void) } } - k_sleep(MSEC_PER_SEC); + k_msleep(MSEC_PER_SEC); } } diff --git a/samples/basic/rgb_led/src/main.c b/samples/basic/rgb_led/src/main.c index e9f37f457d23d..be8addfe23b2e 100644 --- a/samples/basic/rgb_led/src/main.c +++ b/samples/basic/rgb_led/src/main.c @@ -88,7 +88,7 @@ void main(void) printk("pin 2 write fails!\n"); return; } - k_sleep(MSEC_PER_SEC); + k_msleep(MSEC_PER_SEC); } } } diff --git a/samples/basic/servo_motor/src/main.c b/samples/basic/servo_motor/src/main.c index 37506f8e6401a..779431fad3251 100644 --- a/samples/basic/servo_motor/src/main.c +++ b/samples/basic/servo_motor/src/main.c @@ -66,6 +66,6 @@ void main(void) } } - k_sleep(MSEC_PER_SEC); + k_msleep(MSEC_PER_SEC); } } diff --git a/samples/basic/threads/src/main.c b/samples/basic/threads/src/main.c index d25fea93c195c..da86f7847cf61 100644 --- a/samples/basic/threads/src/main.c +++ b/samples/basic/threads/src/main.c @@ -64,7 +64,7 @@ void blink(const char *port, u32_t sleep_ms, u32_t led, u32_t id) k_fifo_put(&printk_fifo, mem_ptr); - k_sleep(sleep_ms); + k_msleep(sleep_ms); cnt++; } } diff --git a/samples/bluetooth/mesh_demo/src/microbit.c b/samples/bluetooth/mesh_demo/src/microbit.c index 370a79926c3ae..4d57a216d9b97 100644 --- a/samples/bluetooth/mesh_demo/src/microbit.c +++ b/samples/bluetooth/mesh_demo/src/microbit.c @@ -129,7 +129,7 @@ void board_play_tune(const char *str) pwm_pin_set_usec(pwm, BUZZER_PIN, period, period / 2U); } - k_sleep(duration); + k_msleep(duration); /* Disable the PWM */ pwm_pin_set_usec(pwm, BUZZER_PIN, 0, 0); diff --git a/samples/bluetooth/peripheral/src/main.c b/samples/bluetooth/peripheral/src/main.c index 1b2d1eed46ac0..0e1b2caf237e7 100644 --- a/samples/bluetooth/peripheral/src/main.c +++ b/samples/bluetooth/peripheral/src/main.c @@ -336,7 +336,7 @@ void main(void) * of starting delayed work so we do it here */ while (1) { - k_sleep(MSEC_PER_SEC); + k_msleep(MSEC_PER_SEC); /* Current Time Service updates only when time is changed */ cts_notify(); diff --git a/samples/bluetooth/peripheral_csc/src/main.c b/samples/bluetooth/peripheral_csc/src/main.c index 4122ff2269195..97e383697868c 100644 --- a/samples/bluetooth/peripheral_csc/src/main.c +++ b/samples/bluetooth/peripheral_csc/src/main.c @@ -409,7 +409,7 @@ void main(void) bt_conn_cb_register(&conn_callbacks); while (1) { - k_sleep(MSEC_PER_SEC); + k_msleep(MSEC_PER_SEC); /* CSC simulation */ if (csc_simulate) { diff --git a/samples/bluetooth/peripheral_esp/src/main.c b/samples/bluetooth/peripheral_esp/src/main.c index 3a5bfd71b3d71..a971a197ec77e 100644 --- a/samples/bluetooth/peripheral_esp/src/main.c +++ b/samples/bluetooth/peripheral_esp/src/main.c @@ -447,7 +447,7 @@ void main(void) bt_conn_auth_cb_register(&auth_cb_display); while (1) { - k_sleep(MSEC_PER_SEC); + k_msleep(MSEC_PER_SEC); /* Temperature simulation */ if (simulate_temp) { diff --git a/samples/bluetooth/peripheral_hr/src/main.c b/samples/bluetooth/peripheral_hr/src/main.c index 143bb6c640efc..16bb172a971e4 100644 --- a/samples/bluetooth/peripheral_hr/src/main.c +++ b/samples/bluetooth/peripheral_hr/src/main.c @@ -128,7 +128,7 @@ void main(void) * of starting delayed work so we do it here */ while (1) { - k_sleep(MSEC_PER_SEC); + k_msleep(MSEC_PER_SEC); /* Heartrate measurements simulation */ hrs_notify(); diff --git a/samples/bluetooth/peripheral_ht/src/main.c b/samples/bluetooth/peripheral_ht/src/main.c index 2107641823fb5..32fab84007cc9 100644 --- a/samples/bluetooth/peripheral_ht/src/main.c +++ b/samples/bluetooth/peripheral_ht/src/main.c @@ -121,7 +121,7 @@ void main(void) * of starting delayed work so we do it here */ while (1) { - k_sleep(MSEC_PER_SEC); + k_msleep(MSEC_PER_SEC); /* Temperature measurements simulation */ hts_indicate(); diff --git a/samples/boards/96b_argonkey/microphone/src/main.c b/samples/boards/96b_argonkey/microphone/src/main.c index 5ef83a56c6ae4..e88d8fceb0f29 100644 --- a/samples/boards/96b_argonkey/microphone/src/main.c +++ b/samples/boards/96b_argonkey/microphone/src/main.c @@ -106,13 +106,13 @@ void main(void) /* turn all leds on */ for (i = 0; i < NUM_LEDS; i++) { led_on(ledc, i); - k_sleep(DELAY_TIME); + k_msleep(DELAY_TIME); } /* turn all leds off */ for (i = 0; i < NUM_LEDS; i++) { led_off(ledc, i); - k_sleep(DELAY_TIME); + k_msleep(DELAY_TIME); } #endif diff --git a/samples/boards/96b_argonkey/sensors/src/main.c b/samples/boards/96b_argonkey/sensors/src/main.c index 44f3ce8520c0f..33f213f98372f 100644 --- a/samples/boards/96b_argonkey/sensors/src/main.c +++ b/samples/boards/96b_argonkey/sensors/src/main.c @@ -123,13 +123,13 @@ void main(void) /* turn all leds on */ for (i = 0; i < NUM_LEDS; i++) { led_on(ledc, i); - k_sleep(DELAY_TIME); + k_msleep(DELAY_TIME); } /* turn all leds off */ for (i = 0; i < NUM_LEDS; i++) { led_off(ledc, i); - k_sleep(DELAY_TIME); + k_msleep(DELAY_TIME); } #endif @@ -142,7 +142,7 @@ void main(void) for (i = 0; i < 5; i++) { gpio_pin_write(led1, DT_ALIAS_LED1_GPIOS_PIN, on); - k_sleep(200); + k_msleep(200); on = (on == 1) ? 0 : 1; } @@ -350,7 +350,7 @@ void main(void) #endif /* CONFIG_LSM6DSL */ printk("- (%d) (trig_cnt: %d)\n\n", ++cnt, lsm6dsl_trig_cnt); - k_sleep(2000); + k_msleep(2000); } } diff --git a/samples/boards/altera_max10/pio/src/main.c b/samples/boards/altera_max10/pio/src/main.c index 98b56f29b3be4..73aabb9b1f605 100644 --- a/samples/boards/altera_max10/pio/src/main.c +++ b/samples/boards/altera_max10/pio/src/main.c @@ -59,7 +59,7 @@ void main(void) if (ret) { printk("Error set GPIO port\n"); } - k_sleep(MSEC_PER_SEC * 5U); + k_msleep(MSEC_PER_SEC * 5U); for (i = 0; i < LED_PINS_WIRED; i++) { printk("Turn On LED[%d]\n", i); @@ -68,7 +68,7 @@ void main(void) printk("Error writing led pin\n"); } - k_sleep(MSEC_PER_SEC * 5U); + k_msleep(MSEC_PER_SEC * 5U); ret = gpio_pin_write(gpio_dev, i, 1); if (ret) { printk("Error writing led pin\n"); diff --git a/samples/boards/arc_secure_services/src/main.c b/samples/boards/arc_secure_services/src/main.c index 8e7a7be238c2e..e0f5d67a89305 100644 --- a/samples/boards/arc_secure_services/src/main.c +++ b/samples/boards/arc_secure_services/src/main.c @@ -54,6 +54,6 @@ void main(void) while (1) { printk("I am the %s thread in secure world: %d\n", __func__, i++); - k_sleep(SLEEPTIME); + k_msleep(SLEEPTIME); } } diff --git a/samples/boards/bbc_microbit/display/src/main.c b/samples/boards/bbc_microbit/display/src/main.c index 2258e8f450de0..740f0ceb296ef 100644 --- a/samples/boards/bbc_microbit/display/src/main.c +++ b/samples/boards/bbc_microbit/display/src/main.c @@ -94,12 +94,12 @@ void main(void) /* Show a short scrolling animation */ mb_display_image(disp, MB_DISPLAY_MODE_SCROLL, K_SECONDS(1), scroll, ARRAY_SIZE(scroll)); - k_sleep(K_SECONDS(1) * (ARRAY_SIZE(scroll) + 2)); + k_sleep(K_SECONDS(ARRAY_SIZE(scroll) + 2)); /* Show a sequential animation */ mb_display_image(disp, MB_DISPLAY_MODE_DEFAULT | MB_DISPLAY_FLAG_LOOP, K_MSEC(150), animation, ARRAY_SIZE(animation)); - k_sleep(K_MSEC(150) * ARRAY_SIZE(animation) * 5); + k_sleep(K_MSEC(150 * ARRAY_SIZE(animation) * 5)); /* Show some scrolling text ("Hello Zephyr!") */ mb_display_print(disp, MB_DISPLAY_MODE_DEFAULT | MB_DISPLAY_FLAG_LOOP, diff --git a/samples/boards/bbc_microbit/sound/src/main.c b/samples/boards/bbc_microbit/sound/src/main.c index 7a098b43527e0..75d5ce726ed54 100644 --- a/samples/boards/bbc_microbit/sound/src/main.c +++ b/samples/boards/bbc_microbit/sound/src/main.c @@ -35,7 +35,7 @@ static void beep(struct k_work *work) * should result in the maximum sound volume. */ pwm_pin_set_usec(pwm, BUZZER_PIN, period, period / 2U); - k_sleep(BEEP_DURATION); + k_msleep(BEEP_DURATION); /* Disable the PWM */ pwm_pin_set_usec(pwm, BUZZER_PIN, 0, 0); diff --git a/samples/boards/intel_s1000_crb/dmic/src/dmic_sample.c b/samples/boards/intel_s1000_crb/dmic/src/dmic_sample.c index 745278cb47704..68be3d61be01f 100644 --- a/samples/boards/intel_s1000_crb/dmic/src/dmic_sample.c +++ b/samples/boards/intel_s1000_crb/dmic/src/dmic_sample.c @@ -133,7 +133,7 @@ static void dmic_sample_app(void *p1, void *p2, void *p3) dmic_start(); dmic_receive(); dmic_stop(); - k_sleep(DELAY_BTW_ITERATIONS); + k_msleep(DELAY_BTW_ITERATIONS); LOG_INF("Iteration %d/%d complete, %d audio frames received.", loop_count, NUM_ITERATIONS, FRAMES_PER_ITERATION); diff --git a/samples/boards/sensortile_box/src/main.c b/samples/boards/sensortile_box/src/main.c index d9525099040b7..1ce44fb92db73 100644 --- a/samples/boards/sensortile_box/src/main.c +++ b/samples/boards/sensortile_box/src/main.c @@ -260,7 +260,7 @@ void main(void) for (i = 0; i < 6; i++) { gpio_pin_write(led0, DT_ALIAS_LED0_GPIOS_PIN, on); gpio_pin_write(led1, DT_ALIAS_LED1_GPIOS_PIN, !on); - k_sleep(100); + k_msleep(100); on = (on == 1) ? 0 : 1; } @@ -441,7 +441,7 @@ void main(void) printk("%d:: iis3dhhc trig %d\n", cnt, iis3dhhc_trig_cnt); #endif - k_sleep(2000); + k_msleep(2000); } } diff --git a/samples/display/cfb/src/main.c b/samples/display/cfb/src/main.c index cf632eeecfc7d..e9bd35f2cddd5 100644 --- a/samples/display/cfb/src/main.c +++ b/samples/display/cfb/src/main.c @@ -83,7 +83,7 @@ void main(void) cfb_framebuffer_finalize(dev); #if defined(CONFIG_ARCH_POSIX) - k_sleep(100); + k_msleep(100); #endif } } diff --git a/samples/display/grove_display/src/main.c b/samples/display/grove_display/src/main.c index 518e412b872eb..d27168792b146 100644 --- a/samples/display/grove_display/src/main.c +++ b/samples/display/grove_display/src/main.c @@ -122,6 +122,6 @@ void main(void) } /* wait a while */ - k_sleep(SLEEPTIME); + k_msleep(SLEEPTIME); } } diff --git a/samples/display/ili9340/src/main.c b/samples/display/ili9340/src/main.c index ac1092a658d52..145dba5062b85 100644 --- a/samples/display/ili9340/src/main.c +++ b/samples/display/ili9340/src/main.c @@ -138,6 +138,6 @@ void main(void) if (color > 2) { color = 0; } - k_sleep(500); + k_msleep(500); } } diff --git a/samples/display/st7789v/src/main.c b/samples/display/st7789v/src/main.c index cdf3aa090a2e8..fc6bcedbcb3e5 100644 --- a/samples/display/st7789v/src/main.c +++ b/samples/display/st7789v/src/main.c @@ -167,6 +167,6 @@ void main(void) break; } ++cnt; - k_sleep(100); + k_msleep(100); } } diff --git a/samples/drivers/CAN/src/main.c b/samples/drivers/CAN/src/main.c index ab3efb15b2b8a..b2d6b926a7d82 100644 --- a/samples/drivers/CAN/src/main.c +++ b/samples/drivers/CAN/src/main.c @@ -175,13 +175,13 @@ void main(void) /* This sending call is none blocking. */ can_send(can_dev, &change_led_frame, K_FOREVER, tx_irq_callback, "LED change"); - k_sleep(SLEEP_TIME); + k_msleep(SLEEP_TIME); UNALIGNED_PUT(sys_cpu_to_be16(counter), (u16_t *)&counter_frame.data[0]); counter++; /* This sending call is blocking until the message is sent. */ can_send(can_dev, &counter_frame, K_MSEC(100), NULL, NULL); - k_sleep(SLEEP_TIME); + k_msleep(SLEEP_TIME); } } diff --git a/samples/drivers/entropy/src/main.c b/samples/drivers/entropy/src/main.c index 5872776a26306..f6cbaa4a3ced1 100644 --- a/samples/drivers/entropy/src/main.c +++ b/samples/drivers/entropy/src/main.c @@ -50,6 +50,6 @@ void main(void) printf("\n"); - k_sleep(1000); + k_msleep(1000); } } diff --git a/samples/drivers/espi/src/main.c b/samples/drivers/espi/src/main.c index 47fb0da2c7a88..0ebb92f18bee8 100644 --- a/samples/drivers/espi/src/main.c +++ b/samples/drivers/espi/src/main.c @@ -222,7 +222,7 @@ void main(void) { int ret; - k_sleep(500); + k_msleep(500); #ifdef CONFIG_ESPI_GPIO_DEV_NEEDED gpio_dev0 = device_get_binding(CONFIG_ESPI_GPIO_DEV0); diff --git a/samples/drivers/ht16k33/src/main.c b/samples/drivers/ht16k33/src/main.c index dd767251cfd55..5faf567e2fccc 100644 --- a/samples/drivers/ht16k33/src/main.c +++ b/samples/drivers/ht16k33/src/main.c @@ -68,20 +68,20 @@ void main(void) "one-by-one"); for (i = 0; i < 128; i++) { led_on(led_dev, i); - k_sleep(100); + k_msleep(100); } for (i = 500; i <= 2000; i *= 2) { LOG_INF("Blinking LEDs with a period of %d ms", i); led_blink(led_dev, 0, i / 2, i / 2); - k_sleep(10 * i); + k_msleep(10 * i); } led_blink(led_dev, 0, 0, 0); for (i = 100; i >= 0; i -= 10) { LOG_INF("Setting LED brightness to %d%%", i); led_set_brightness(led_dev, 0, i); - k_sleep(1000); + k_msleep(1000); } LOG_INF("Turning all LEDs off and restoring 100%% brightness"); diff --git a/samples/drivers/lcd_hd44780/src/main.c b/samples/drivers/lcd_hd44780/src/main.c index c4156672acf47..252554c832c7b 100644 --- a/samples/drivers/lcd_hd44780/src/main.c +++ b/samples/drivers/lcd_hd44780/src/main.c @@ -183,11 +183,11 @@ void _set_row_offsets(s8_t row0, s8_t row1, s8_t row2, s8_t row3) void _pi_lcd_toggle_enable(struct device *gpio_dev) { GPIO_PIN_WR(gpio_dev, GPIO_PIN_PC25_E, LOW); - k_sleep(ENABLE_DELAY); + k_msleep(ENABLE_DELAY); GPIO_PIN_WR(gpio_dev, GPIO_PIN_PC25_E, HIGH); - k_sleep(ENABLE_DELAY); + k_msleep(ENABLE_DELAY); GPIO_PIN_WR(gpio_dev, GPIO_PIN_PC25_E, LOW); - k_sleep(ENABLE_DELAY); + k_msleep(ENABLE_DELAY); } @@ -309,7 +309,7 @@ void _pi_lcd_write(struct device *gpio_dev, u8_t bits) void pi_lcd_home(struct device *gpio_dev) { _pi_lcd_command(gpio_dev, LCD_RETURN_HOME); - k_sleep(2); /* wait for 2ms */ + k_msleep(2); /* wait for 2ms */ } /** Set curson position */ @@ -332,7 +332,7 @@ void pi_lcd_set_cursor(struct device *gpio_dev, u8_t col, u8_t row) void pi_lcd_clear(struct device *gpio_dev) { _pi_lcd_command(gpio_dev, LCD_CLEAR_DISPLAY); - k_sleep(2); /* wait for 2ms */ + k_msleep(2); /* wait for 2ms */ } @@ -470,7 +470,7 @@ void pi_lcd_init(struct device *gpio_dev, u8_t cols, u8_t rows, u8_t dotsize) * above 2.7V before sending commands. Arduino can turn on way * before 4.5V so we'll wait 50 */ - k_sleep(50); + k_msleep(50); /* this is according to the hitachi HD44780 datasheet * figure 23/24, pg 45/46 try to set 4/8 bits mode @@ -478,30 +478,30 @@ void pi_lcd_init(struct device *gpio_dev, u8_t cols, u8_t rows, u8_t dotsize) if (lcd_data.disp_func & LCD_8BIT_MODE) { /* 1st try */ _pi_lcd_command(gpio_dev, 0x30); - k_sleep(5); /* wait for 5ms */ + k_msleep(5); /* wait for 5ms */ /* 2nd try */ _pi_lcd_command(gpio_dev, 0x30); - k_sleep(5); /* wait for 5ms */ + k_msleep(5); /* wait for 5ms */ /* 3rd try */ _pi_lcd_command(gpio_dev, 0x30); - k_sleep(1); /* wait for 1ms */ + k_msleep(1); /* wait for 1ms */ /* Set 4bit interface */ _pi_lcd_command(gpio_dev, 0x30); } else { /* 1st try */ _pi_lcd_command(gpio_dev, 0x03); - k_sleep(5); /* wait for 5ms */ + k_msleep(5); /* wait for 5ms */ /* 2nd try */ _pi_lcd_command(gpio_dev, 0x03); - k_sleep(5); /* wait for 5ms */ + k_msleep(5); /* wait for 5ms */ /* 3rd try */ _pi_lcd_command(gpio_dev, 0x03); - k_sleep(1); /* wait for 1ms */ + k_msleep(1); /* wait for 1ms */ /* Set 4bit interface */ _pi_lcd_command(gpio_dev, 0x02); @@ -563,7 +563,7 @@ void main(void) pi_lcd_set_cursor(gpio_dev, 19, 3); pi_lcd_left_to_right(gpio_dev); pi_lcd_string(gpio_dev, "********************"); - k_sleep(MSEC_PER_SEC * 3U); + k_msleep(MSEC_PER_SEC * 3U); /* Clear display */ pi_lcd_clear(gpio_dev); @@ -579,7 +579,7 @@ void main(void) pi_lcd_string(gpio_dev, "My super RTOS"); pi_lcd_set_cursor(gpio_dev, 0, 3); pi_lcd_string(gpio_dev, "-------------------"); - k_sleep(MSEC_PER_SEC * 3U); + k_msleep(MSEC_PER_SEC * 3U); /* Clear display */ pi_lcd_clear(gpio_dev); @@ -594,7 +594,7 @@ void main(void) pi_lcd_string(gpio_dev, "I am home!"); pi_lcd_set_cursor(gpio_dev, 0, 2); pi_lcd_string(gpio_dev, ""); - k_sleep(MSEC_PER_SEC * 3U); + k_msleep(MSEC_PER_SEC * 3U); /* Clear display */ pi_lcd_clear(gpio_dev); diff --git a/samples/drivers/led_apa102/src/main.c b/samples/drivers/led_apa102/src/main.c index 336c8253bc615..915a38a81d19f 100644 --- a/samples/drivers/led_apa102/src/main.c +++ b/samples/drivers/led_apa102/src/main.c @@ -78,7 +78,7 @@ void main(void) sizeof(strip_colors[i])); } led_strip_update_rgb(strip, strip_colors, STRIP_NUM_LEDS); - k_sleep(DELAY_TIME); + k_msleep(DELAY_TIME); time++; } } diff --git a/samples/drivers/led_apa102c_bitbang/src/main.c b/samples/drivers/led_apa102c_bitbang/src/main.c index 748b84982baf3..af2aef85cc1cd 100644 --- a/samples/drivers/led_apa102c_bitbang/src/main.c +++ b/samples/drivers/led_apa102c_bitbang/src/main.c @@ -107,6 +107,6 @@ void main(void) idx = 0; } - k_sleep(SLEEPTIME); + k_msleep(SLEEPTIME); } } diff --git a/samples/drivers/led_lp3943/src/main.c b/samples/drivers/led_lp3943/src/main.c index 26bf51d1bbb04..8b1e14b43e29c 100644 --- a/samples/drivers/led_lp3943/src/main.c +++ b/samples/drivers/led_lp3943/src/main.c @@ -47,7 +47,7 @@ void main(void) return; } - k_sleep(DELAY_TIME); + k_msleep(DELAY_TIME); } /* Turn off LEDs one by one */ @@ -57,7 +57,7 @@ void main(void) return; } - k_sleep(DELAY_TIME); + k_msleep(DELAY_TIME); } } } diff --git a/samples/drivers/led_lp5562/src/main.c b/samples/drivers/led_lp5562/src/main.c index 95f53e8a612ea..1b07d9eccec15 100644 --- a/samples/drivers/led_lp5562/src/main.c +++ b/samples/drivers/led_lp5562/src/main.c @@ -188,7 +188,7 @@ void main(void) return; } - k_sleep(DELAY_TIME); + k_msleep(DELAY_TIME); } ret = turn_off_all_leds(dev); @@ -204,7 +204,7 @@ void main(void) } /* Wait a few blinking before turning off the LEDs */ - k_sleep(DELAY_TIME * 2); + k_msleep(DELAY_TIME * 2); /* Change the color of the LEDs while keeping blinking. */ for (i = 0; i < COLORS_TO_SHOW; i++) { @@ -216,7 +216,7 @@ void main(void) return; } - k_sleep(DELAY_TIME * 2); + k_msleep(DELAY_TIME * 2); } ret = turn_off_all_leds(dev); @@ -224,6 +224,6 @@ void main(void) return; } - k_sleep(DELAY_TIME); + k_msleep(DELAY_TIME); } } diff --git a/samples/drivers/led_lpd8806/src/main.c b/samples/drivers/led_lpd8806/src/main.c index 54104298ad8c8..0d99cea06cfdb 100644 --- a/samples/drivers/led_lpd8806/src/main.c +++ b/samples/drivers/led_lpd8806/src/main.c @@ -76,7 +76,7 @@ void main(void) sizeof(strip_colors[i])); } led_strip_update_rgb(strip, strip_colors, STRIP_NUM_LEDS); - k_sleep(DELAY_TIME); + k_msleep(DELAY_TIME); time++; } } diff --git a/samples/drivers/led_pca9633/src/main.c b/samples/drivers/led_pca9633/src/main.c index b9e21cacce757..f129251813c3c 100644 --- a/samples/drivers/led_pca9633/src/main.c +++ b/samples/drivers/led_pca9633/src/main.c @@ -45,7 +45,7 @@ void main(void) return; } - k_sleep(DELAY_TIME); + k_msleep(DELAY_TIME); } /* Turn off LEDs one by one */ @@ -55,7 +55,7 @@ void main(void) return; } - k_sleep(DELAY_TIME); + k_msleep(DELAY_TIME); } /* Set the brightness to half max of LEDs one by one */ @@ -65,7 +65,7 @@ void main(void) return; } - k_sleep(DELAY_TIME); + k_msleep(DELAY_TIME); } /* Turn off LEDs one by one */ @@ -75,7 +75,7 @@ void main(void) return; } - k_sleep(DELAY_TIME); + k_msleep(DELAY_TIME); } /* Test the blinking of LEDs one by one */ @@ -86,11 +86,11 @@ void main(void) return; } - k_sleep(DELAY_TIME); + k_msleep(DELAY_TIME); } /* Wait a few blinking before turning off the LEDs */ - k_sleep(DELAY_TIME * 10); + k_msleep(DELAY_TIME * 10); /* Turn off LEDs one by one */ for (i = 0; i < NUM_LEDS; i++) { @@ -99,7 +99,7 @@ void main(void) return; } - k_sleep(DELAY_TIME); + k_msleep(DELAY_TIME); } } diff --git a/samples/drivers/led_ws2812/src/main.c b/samples/drivers/led_ws2812/src/main.c index f3543df8a324b..976cb5dc56eb0 100644 --- a/samples/drivers/led_ws2812/src/main.c +++ b/samples/drivers/led_ws2812/src/main.c @@ -83,7 +83,7 @@ void main(void) sizeof(strip_colors[i])); } led_strip_update_rgb(strip, strip_colors, STRIP_NUM_LEDS); - k_sleep(DELAY_TIME); + k_msleep(DELAY_TIME); time++; } } diff --git a/samples/drivers/ps2/src/main.c b/samples/drivers/ps2/src/main.c index 2f75176bc1f78..ee80029870bae 100644 --- a/samples/drivers/ps2/src/main.c +++ b/samples/drivers/ps2/src/main.c @@ -40,7 +40,7 @@ static void saturate_ps2(struct k_timer *timer) LOG_DBG("block host\n"); host_blocked = true; ps2_disable_callback(ps2_0_dev); - k_sleep(500); + k_msleep(500); host_blocked = false; ps2_enable_callback(ps2_0_dev); } @@ -74,103 +74,103 @@ void initialize_mouse(void) { LOG_DBG("mouse->f4\n"); ps2_write(ps2_0_dev, 0xf4); - k_sleep(MS_BETWEEN_REGULAR_CALLS); + k_msleep(MS_BETWEEN_REGULAR_CALLS); LOG_DBG("Reset mouse->ff\n"); ps2_write(ps2_0_dev, 0xff); - k_sleep(MS_BETWEEN_RESET_CALLS); + k_msleep(MS_BETWEEN_RESET_CALLS); LOG_DBG("Reset mouse->ff\n"); ps2_write(ps2_0_dev, 0xff); - k_sleep(MS_BETWEEN_RESET_CALLS); + k_msleep(MS_BETWEEN_RESET_CALLS); LOG_DBG("Read ID mouse->f2\n"); ps2_write(ps2_0_dev, 0xf2); - k_sleep(MS_BETWEEN_REGULAR_CALLS); + k_msleep(MS_BETWEEN_REGULAR_CALLS); LOG_DBG("Set resolution mouse->e8\n"); ps2_write(ps2_0_dev, 0xe8); - k_sleep(MS_BETWEEN_REGULAR_CALLS); + k_msleep(MS_BETWEEN_REGULAR_CALLS); LOG_DBG("mouse->00\n"); ps2_write(ps2_0_dev, 0x00); - k_sleep(MS_BETWEEN_REGULAR_CALLS); + k_msleep(MS_BETWEEN_REGULAR_CALLS); LOG_DBG("Set scaling 1:1 mouse->e6\n"); ps2_write(ps2_0_dev, 0xe6); - k_sleep(MS_BETWEEN_REGULAR_CALLS); + k_msleep(MS_BETWEEN_REGULAR_CALLS); LOG_DBG("Set scaling 1:1 mouse->e6\n"); ps2_write(ps2_0_dev, 0xe6); - k_sleep(MS_BETWEEN_REGULAR_CALLS); + k_msleep(MS_BETWEEN_REGULAR_CALLS); LOG_DBG("Set scaling 1:1 mouse->e6\n"); ps2_write(ps2_0_dev, 0xe6); - k_sleep(MS_BETWEEN_REGULAR_CALLS); + k_msleep(MS_BETWEEN_REGULAR_CALLS); LOG_DBG("mouse->e9\n"); ps2_write(ps2_0_dev, 0xe9); - k_sleep(MS_BETWEEN_REGULAR_CALLS); + k_msleep(MS_BETWEEN_REGULAR_CALLS); LOG_DBG("Set resolution mouse->e8\n"); ps2_write(ps2_0_dev, 0xe8); - k_sleep(MS_BETWEEN_REGULAR_CALLS); + k_msleep(MS_BETWEEN_REGULAR_CALLS); LOG_DBG("8 Counts/mm mouse->0x03\n"); ps2_write(ps2_0_dev, 0x03); - k_sleep(MS_BETWEEN_REGULAR_CALLS); + k_msleep(MS_BETWEEN_REGULAR_CALLS); LOG_DBG("Set sample rate mouse->0xF3\n"); ps2_write(ps2_0_dev, 0xf3); - k_sleep(MS_BETWEEN_REGULAR_CALLS); + k_msleep(MS_BETWEEN_REGULAR_CALLS); LOG_DBG("decimal 200 ->0xc8\n"); ps2_write(ps2_0_dev, 0xc8); - k_sleep(MS_BETWEEN_REGULAR_CALLS); + k_msleep(MS_BETWEEN_REGULAR_CALLS); LOG_DBG("Set sample rate mouse->0xF3\n"); ps2_write(ps2_0_dev, 0xf3); - k_sleep(MS_BETWEEN_REGULAR_CALLS); + k_msleep(MS_BETWEEN_REGULAR_CALLS); LOG_DBG("decimal 100 ->0x64\n"); ps2_write(ps2_0_dev, 0x64); LOG_DBG("Set sample rate mouse->0xF3\n"); ps2_write(ps2_0_dev, 0xf3); - k_sleep(MS_BETWEEN_REGULAR_CALLS); + k_msleep(MS_BETWEEN_REGULAR_CALLS); LOG_DBG("decimal 80 ->0x50\n"); ps2_write(ps2_0_dev, 0x50); - k_sleep(MS_BETWEEN_REGULAR_CALLS); + k_msleep(MS_BETWEEN_REGULAR_CALLS); LOG_DBG("Read device type->0xf2\n"); ps2_write(ps2_0_dev, 0xf2); - k_sleep(MS_BETWEEN_REGULAR_CALLS); + k_msleep(MS_BETWEEN_REGULAR_CALLS); LOG_DBG("Set sample rate mouse->0xF3\n"); ps2_write(ps2_0_dev, 0xf3); - k_sleep(MS_BETWEEN_REGULAR_CALLS); + k_msleep(MS_BETWEEN_REGULAR_CALLS); LOG_DBG("decimal 200 ->0xc8\n"); ps2_write(ps2_0_dev, 0xc8); - k_sleep(MS_BETWEEN_REGULAR_CALLS); + k_msleep(MS_BETWEEN_REGULAR_CALLS); LOG_DBG("Set sample rate mouse->0xF3\n"); ps2_write(ps2_0_dev, 0xf3); - k_sleep(MS_BETWEEN_REGULAR_CALLS); + k_msleep(MS_BETWEEN_REGULAR_CALLS); LOG_DBG("decimal 200 ->0xc8\n"); ps2_write(ps2_0_dev, 0xc8); - k_sleep(MS_BETWEEN_REGULAR_CALLS); + k_msleep(MS_BETWEEN_REGULAR_CALLS); LOG_DBG("Set sample rate mouse->0xF3\n"); ps2_write(ps2_0_dev, 0xf3); - k_sleep(MS_BETWEEN_REGULAR_CALLS); + k_msleep(MS_BETWEEN_REGULAR_CALLS); LOG_DBG("decimal 80 ->0x50\n"); ps2_write(ps2_0_dev, 0x50); - k_sleep(MS_BETWEEN_REGULAR_CALLS); + k_msleep(MS_BETWEEN_REGULAR_CALLS); LOG_DBG("Read device type->0xf2\n"); ps2_write(ps2_0_dev, 0xf2); - k_sleep(MS_BETWEEN_REGULAR_CALLS); + k_msleep(MS_BETWEEN_REGULAR_CALLS); LOG_DBG("Set sample rate mouse->0xF3\n"); ps2_write(ps2_0_dev, 0xf3); - k_sleep(MS_BETWEEN_REGULAR_CALLS); + k_msleep(MS_BETWEEN_REGULAR_CALLS); LOG_DBG("decimal 100 ->0x64\n"); ps2_write(ps2_0_dev, 0x64); - k_sleep(MS_BETWEEN_REGULAR_CALLS); + k_msleep(MS_BETWEEN_REGULAR_CALLS); LOG_DBG("Set resolution mouse->e8\n"); ps2_write(ps2_0_dev, 0xe8); - k_sleep(MS_BETWEEN_REGULAR_CALLS); + k_msleep(MS_BETWEEN_REGULAR_CALLS); LOG_DBG("8 Counts/mm mouse->0x03\n"); ps2_write(ps2_0_dev, 0x03); - k_sleep(MS_BETWEEN_REGULAR_CALLS); + k_msleep(MS_BETWEEN_REGULAR_CALLS); LOG_DBG("mouse->f4\n"); ps2_write(ps2_0_dev, 0xf4); - k_sleep(MS_BETWEEN_REGULAR_CALLS); + k_msleep(MS_BETWEEN_REGULAR_CALLS); } void main(void) { printk("PS/2 test with mouse\n"); /* Wait for the PS/2 BAT to finish */ - k_sleep(MS_BETWEEN_RESET_CALLS); + k_msleep(MS_BETWEEN_RESET_CALLS); /* The ps2 blocks are generic, therefore, it is allowed to swap * keybaord and mouse as deired diff --git a/samples/drivers/watchdog/src/main.c b/samples/drivers/watchdog/src/main.c index 0c4d69a6830e0..eb8b37f2d5afe 100644 --- a/samples/drivers/watchdog/src/main.c +++ b/samples/drivers/watchdog/src/main.c @@ -86,7 +86,7 @@ void main(void) for (int i = 0; i < WDT_FEED_TRIES; ++i) { printk("Feeding watchdog...\n"); wdt_feed(wdt, wdt_channel_id); - k_sleep(50); + k_msleep(50); } /* Waiting for the SoC reset. */ diff --git a/samples/gui/lvgl/src/main.c b/samples/gui/lvgl/src/main.c index 447483147063e..30af9bcfdd66e 100644 --- a/samples/gui/lvgl/src/main.c +++ b/samples/gui/lvgl/src/main.c @@ -45,7 +45,7 @@ void main(void) lv_label_set_text(count_label, count_str); } lv_task_handler(); - k_sleep(10); + k_msleep(10); ++count; } } diff --git a/samples/net/google_iot_mqtt/src/protocol.c b/samples/net/google_iot_mqtt/src/protocol.c index e6cdca32b2f47..e53fa3a4d9e2f 100644 --- a/samples/net/google_iot_mqtt/src/protocol.c +++ b/samples/net/google_iot_mqtt/src/protocol.c @@ -316,7 +316,7 @@ void mqtt_startup(char *hostname, int port) LOG_ERR("could not connect, error %d", err); mqtt_disconnect(client); retries--; - k_sleep(ALIVE_TIME); + k_msleep(ALIVE_TIME); continue; } @@ -326,7 +326,7 @@ void mqtt_startup(char *hostname, int port) LOG_ERR("failed to connect to mqtt_broker"); mqtt_disconnect(client); retries--; - k_sleep(ALIVE_TIME); + k_msleep(ALIVE_TIME); continue; } else { break; @@ -335,7 +335,7 @@ void mqtt_startup(char *hostname, int port) LOG_ERR("failed to connect to mqtt broker"); mqtt_disconnect(client); retries--; - k_sleep(ALIVE_TIME); + k_msleep(ALIVE_TIME); continue; } } diff --git a/samples/net/mqtt_publisher/src/main.c b/samples/net/mqtt_publisher/src/main.c index 59ab7f6334e94..17f909278941a 100644 --- a/samples/net/mqtt_publisher/src/main.c +++ b/samples/net/mqtt_publisher/src/main.c @@ -331,7 +331,7 @@ static int try_to_connect(struct mqtt_client *client) rc = mqtt_connect(client); if (rc != 0) { PRINT_RESULT("mqtt_connect", rc); - k_sleep(APP_SLEEP_MSECS); + k_msleep(APP_SLEEP_MSECS); continue; } @@ -443,6 +443,6 @@ void main(void) while (1) { publisher(); - k_sleep(5000); + k_msleep(5000); } } diff --git a/samples/net/sockets/can/src/main.c b/samples/net/sockets/can/src/main.c index 6749466e16227..8e50016696af5 100644 --- a/samples/net/sockets/can/src/main.c +++ b/samples/net/sockets/can/src/main.c @@ -65,7 +65,7 @@ static void tx(int *can_fd) LOG_ERR("Cannot send CAN message (%d)", -errno); } - k_sleep(SLEEP_PERIOD); + k_msleep(SLEEP_PERIOD); } } diff --git a/samples/net/syslog_net/src/main.c b/samples/net/syslog_net/src/main.c index be0915c9e3845..c2050df207e52 100644 --- a/samples/net/syslog_net/src/main.c +++ b/samples/net/syslog_net/src/main.c @@ -19,7 +19,7 @@ void main(void) int count = K_SECONDS(60) / SLEEP_BETWEEN_PRINTS; /* Allow some setup time before starting to send data */ - k_sleep(SLEEP_BETWEEN_PRINTS); + k_msleep(SLEEP_BETWEEN_PRINTS); LOG_DBG("Starting"); @@ -29,7 +29,7 @@ void main(void) LOG_INF("Info message"); LOG_DBG("Debug message"); - k_sleep(SLEEP_BETWEEN_PRINTS); + k_msleep(SLEEP_BETWEEN_PRINTS); } while (count--); diff --git a/samples/nfc/nfc_hello/src/main.c b/samples/nfc/nfc_hello/src/main.c index e6666827a205d..17f7bfccbd8e7 100644 --- a/samples/nfc/nfc_hello/src/main.c +++ b/samples/nfc/nfc_hello/src/main.c @@ -69,6 +69,6 @@ void main(void) uart_fifo_fill(uart1_dev, tx_buf, sizeof(u32_t) + sizeof(nci_reset)); while (1) { - k_sleep(SLEEP_TIME); + k_msleep(SLEEP_TIME); } } diff --git a/samples/philosophers/src/main.c b/samples/philosophers/src/main.c index d6161cd23e5d9..dce871f665cbe 100644 --- a/samples/philosophers/src/main.c +++ b/samples/philosophers/src/main.c @@ -166,7 +166,7 @@ void philosopher(void *id, void *unused1, void *unused2) delay = get_random_delay(my_id, 25); print_phil_state(my_id, " EATING [ %s%d ms ] ", delay); - k_sleep(delay); + k_msleep(delay); drop(fork2); print_phil_state(my_id, " DROPPED ONE FORK ", 0); @@ -174,7 +174,7 @@ void philosopher(void *id, void *unused1, void *unused2) delay = get_random_delay(my_id, 25); print_phil_state(my_id, " THINKING [ %s%d ms ] ", delay); - k_sleep(delay); + k_msleep(delay); } } @@ -258,6 +258,6 @@ void main(void) /* Wait a few seconds before main() exit, giving the sample the * opportunity to dump some output before coverage data gets emitted */ - k_sleep(5000); + k_msleep(5000); #endif } diff --git a/samples/portability/cmsis_rtos_v2/philosophers/src/main.c b/samples/portability/cmsis_rtos_v2/philosophers/src/main.c index 8c3031e2f12ee..798b1dae0d6d9 100644 --- a/samples/portability/cmsis_rtos_v2/philosophers/src/main.c +++ b/samples/portability/cmsis_rtos_v2/philosophers/src/main.c @@ -257,6 +257,6 @@ void main(void) /* Wait a few seconds before main() exit, giving the sample the * opportunity to dump some output before coverage data gets emitted */ - k_sleep(5000); + k_msleep(5000); #endif } diff --git a/samples/sensor/adt7420/src/main.c b/samples/sensor/adt7420/src/main.c index 10194ccc57b90..8e76df0fecac2 100644 --- a/samples/sensor/adt7420/src/main.c +++ b/samples/sensor/adt7420/src/main.c @@ -84,7 +84,7 @@ static void process(struct device *dev) sensor_value_to_double(&temp_val)); if (!IS_ENABLED(CONFIG_ADT7420_TRIGGER)) { - k_sleep(1000); + k_msleep(1000); } } } diff --git a/samples/sensor/adxl362/src/main.c b/samples/sensor/adxl362/src/main.c index 746ba634e70b2..34ab7123cee0e 100644 --- a/samples/sensor/adxl362/src/main.c +++ b/samples/sensor/adxl362/src/main.c @@ -58,7 +58,7 @@ void main(void) if (IS_ENABLED(CONFIG_ADXL362_TRIGGER)) { k_sem_take(&sem, K_FOREVER); } else { - k_sleep(1000); + k_msleep(1000); if (sensor_sample_fetch(dev) < 0) { printf("Sample fetch error\n"); return; diff --git a/samples/sensor/adxl372/src/main.c b/samples/sensor/adxl372/src/main.c index 74cad1ea7176d..6058e79457da2 100644 --- a/samples/sensor/adxl372/src/main.c +++ b/samples/sensor/adxl372/src/main.c @@ -104,7 +104,7 @@ void main(void) } if (!IS_ENABLED(CONFIG_ADXL372_TRIGGER)) { - k_sleep(2000); + k_msleep(2000); } } } diff --git a/samples/sensor/amg88xx/src/main.c b/samples/sensor/amg88xx/src/main.c index 9c7ad8e97db88..d46538151b484 100644 --- a/samples/sensor/amg88xx/src/main.c +++ b/samples/sensor/amg88xx/src/main.c @@ -105,6 +105,6 @@ void main(void) printk("new sample:\n"); print_buffer(temp_value, ARRAY_SIZE(temp_value)); - k_sleep(1000); + k_msleep(1000); } } diff --git a/samples/sensor/ams_iAQcore/src/main.c b/samples/sensor/ams_iAQcore/src/main.c index b0fcc749718ad..76d04283e9b59 100644 --- a/samples/sensor/ams_iAQcore/src/main.c +++ b/samples/sensor/ams_iAQcore/src/main.c @@ -30,6 +30,6 @@ void main(void) co2.val1, co2.val2, voc.val1, voc.val2); - k_sleep(1000); + k_msleep(1000); } } diff --git a/samples/sensor/apds9960/src/main.c b/samples/sensor/apds9960/src/main.c index a8aae0c93176b..f2c2ba6171df7 100644 --- a/samples/sensor/apds9960/src/main.c +++ b/samples/sensor/apds9960/src/main.c @@ -63,7 +63,7 @@ void main(void) printk("Waiting for a threshold event\n"); k_sem_take(&sem, K_FOREVER); #else - k_sleep(5000); + k_msleep(5000); #endif if (sensor_sample_fetch(dev)) { printk("sensor_sample fetch failed\n"); @@ -81,7 +81,7 @@ void main(void) p_state = DEVICE_PM_LOW_POWER_STATE; device_set_power_state(dev, p_state, NULL, NULL); printk("set low power state for 2s\n"); - k_sleep(2000); + k_msleep(2000); p_state = DEVICE_PM_ACTIVE_STATE; device_set_power_state(dev, p_state, NULL, NULL); #endif diff --git a/samples/sensor/bme280/src/main.c b/samples/sensor/bme280/src/main.c index 09adec7db258a..753854e352337 100644 --- a/samples/sensor/bme280/src/main.c +++ b/samples/sensor/bme280/src/main.c @@ -31,6 +31,6 @@ void main(void) temp.val1, temp.val2, press.val1, press.val2, humidity.val1, humidity.val2); - k_sleep(1000); + k_msleep(1000); } } diff --git a/samples/sensor/bme680/src/main.c b/samples/sensor/bme680/src/main.c index ac0582811ce1c..01d34f34cc9e9 100644 --- a/samples/sensor/bme680/src/main.c +++ b/samples/sensor/bme680/src/main.c @@ -17,7 +17,7 @@ void main(void) printf("Device %p name is %s\n", dev, dev->config->name); while (1) { - k_sleep(3000); + k_msleep(3000); sensor_sample_fetch(dev); sensor_channel_get(dev, SENSOR_CHAN_AMBIENT_TEMP, &temp); diff --git a/samples/sensor/bmg160/src/main.c b/samples/sensor/bmg160/src/main.c index d1a460327cff1..de458723c452c 100644 --- a/samples/sensor/bmg160/src/main.c +++ b/samples/sensor/bmg160/src/main.c @@ -59,7 +59,7 @@ static void test_polling_mode(struct device *bmg160) print_temp_data(bmg160); /* wait a while */ - k_sleep(SLEEPTIME); + k_msleep(SLEEPTIME); remaining_test_time -= SLEEPTIME; } while (remaining_test_time > 0); @@ -120,7 +120,7 @@ static void test_trigger_mode(struct device *bmg160) printf("Gyro: rotate the device and wait for events.\n"); do { - k_sleep(SLEEPTIME); + k_msleep(SLEEPTIME); remaining_test_time -= SLEEPTIME; } while (remaining_test_time > 0); @@ -153,7 +153,7 @@ static void test_trigger_mode(struct device *bmg160) remaining_test_time = MAX_TEST_TIME; do { - k_sleep(SLEEPTIME); + k_msleep(SLEEPTIME); remaining_test_time -= SLEEPTIME; } while (remaining_test_time > 0); diff --git a/samples/sensor/bmm150/src/main.c b/samples/sensor/bmm150/src/main.c index b18b94f8eb946..4d47849935e8d 100644 --- a/samples/sensor/bmm150/src/main.c +++ b/samples/sensor/bmm150/src/main.c @@ -31,7 +31,7 @@ void do_main(struct device *dev) sensor_value_to_double(&y), sensor_value_to_double(&z)); - k_sleep(500); + k_msleep(500); } } diff --git a/samples/sensor/ccs811/src/main.c b/samples/sensor/ccs811/src/main.c index 0ff19b924fed0..fc61fc8feb61b 100644 --- a/samples/sensor/ccs811/src/main.c +++ b/samples/sensor/ccs811/src/main.c @@ -25,7 +25,7 @@ static void do_main(struct device *dev) printk("Voltage: %d.%06dV; Current: %d.%06dA\n\n", voltage.val1, voltage.val2, current.val1, current.val2); - k_sleep(1000); + k_msleep(1000); } } diff --git a/samples/sensor/ens210/src/main.c b/samples/sensor/ens210/src/main.c index 4a9fb1a4a24bc..b1c907017877c 100644 --- a/samples/sensor/ens210/src/main.c +++ b/samples/sensor/ens210/src/main.c @@ -30,6 +30,6 @@ void main(void) temperature.val1, temperature.val2, humidity.val1, humidity.val2); - k_sleep(1000); + k_msleep(1000); } } diff --git a/samples/sensor/grove_light/src/main.c b/samples/sensor/grove_light/src/main.c index 94ca31e4dea30..7523de7c7e154 100644 --- a/samples/sensor/grove_light/src/main.c +++ b/samples/sensor/grove_light/src/main.c @@ -37,6 +37,6 @@ void main(void) #else printk("lux: %d\n", lux.val1); #endif - k_sleep(SLEEP_TIME); + k_msleep(SLEEP_TIME); } } diff --git a/samples/sensor/grove_temperature/src/main.c b/samples/sensor/grove_temperature/src/main.c index e411dd96ca95e..a6f82bbda6224 100644 --- a/samples/sensor/grove_temperature/src/main.c +++ b/samples/sensor/grove_temperature/src/main.c @@ -79,6 +79,6 @@ void main(void) #else printk("Temperature: %d\n", temp.val1); #endif - k_sleep(SLEEP_TIME); + k_msleep(SLEEP_TIME); } } diff --git a/samples/sensor/hts221/src/main.c b/samples/sensor/hts221/src/main.c index 770572d467724..9bb421289f7e9 100644 --- a/samples/sensor/hts221/src/main.c +++ b/samples/sensor/hts221/src/main.c @@ -68,7 +68,7 @@ void main(void) while (!IS_ENABLED(CONFIG_HTS221_TRIGGER)) { process_sample(dev); - k_sleep(2000); + k_msleep(2000); } k_sleep(K_FOREVER); } diff --git a/samples/sensor/lsm303dlhc/src/main.c b/samples/sensor/lsm303dlhc/src/main.c index c65dbf5a1ab55..e352bfce11196 100644 --- a/samples/sensor/lsm303dlhc/src/main.c +++ b/samples/sensor/lsm303dlhc/src/main.c @@ -65,6 +65,6 @@ void main(void) printf("Failed to read accelerometer data\n"); } - k_sleep(2000); + k_msleep(2000); } } diff --git a/samples/sensor/lsm6dsl/src/main.c b/samples/sensor/lsm6dsl/src/main.c index fd1e0936544e7..fdf3ff36bae34 100644 --- a/samples/sensor/lsm6dsl/src/main.c +++ b/samples/sensor/lsm6dsl/src/main.c @@ -174,6 +174,6 @@ void main(void) printk("- (%d) (trig_cnt: %d)\n\n", ++cnt, lsm6dsl_trig_cnt); print_samples = 1; - k_sleep(2000); + k_msleep(2000); } } diff --git a/samples/sensor/magn_polling/src/main.c b/samples/sensor/magn_polling/src/main.c index a4f3b7ceb859a..0d80f3a0327b5 100644 --- a/samples/sensor/magn_polling/src/main.c +++ b/samples/sensor/magn_polling/src/main.c @@ -30,7 +30,7 @@ static void do_main(struct device *dev) sensor_value_to_double(&value_y), sensor_value_to_double(&value_z)); - k_sleep(500); + k_msleep(500); } } diff --git a/samples/sensor/max30101/src/main.c b/samples/sensor/max30101/src/main.c index ba11edf3896a6..0f2a2e1f7ce58 100644 --- a/samples/sensor/max30101/src/main.c +++ b/samples/sensor/max30101/src/main.c @@ -25,6 +25,6 @@ void main(void) /* Print green LED data*/ printf("GREEN=%d\n", green.val1); - k_sleep(20); + k_msleep(20); } } diff --git a/samples/sensor/max44009/src/main.c b/samples/sensor/max44009/src/main.c index 483bb301fad59..7f17f2bfcee76 100644 --- a/samples/sensor/max44009/src/main.c +++ b/samples/sensor/max44009/src/main.c @@ -43,6 +43,6 @@ void main(void) lum = val.val1; printk("sensor: lum reading: %d\n", lum); - k_sleep(4000); + k_msleep(4000); } } diff --git a/samples/sensor/mcp9808/src/main.c b/samples/sensor/mcp9808/src/main.c index 24912c3d32bea..1834fcc3a7f58 100644 --- a/samples/sensor/mcp9808/src/main.c +++ b/samples/sensor/mcp9808/src/main.c @@ -72,6 +72,6 @@ void main(void) printf("temp: %d.%06d\n", temp.val1, temp.val2); - k_sleep(2000); + k_msleep(2000); } } diff --git a/samples/sensor/ms5837/src/main.c b/samples/sensor/ms5837/src/main.c index da79e89d914b1..f685cf62c0d93 100644 --- a/samples/sensor/ms5837/src/main.c +++ b/samples/sensor/ms5837/src/main.c @@ -41,6 +41,6 @@ void main(void) printf("Temperature: %d.%06d, Pressure: %d.%06d\n", temp.val1, temp.val2, press.val1, press.val2); - k_sleep(10000); + k_msleep(10000); } } diff --git a/samples/sensor/sht3xd/src/main.c b/samples/sensor/sht3xd/src/main.c index cd06df301aa5d..c1b4de05ce955 100644 --- a/samples/sensor/sht3xd/src/main.c +++ b/samples/sensor/sht3xd/src/main.c @@ -84,6 +84,6 @@ void main(void) sensor_value_to_double(&temp), sensor_value_to_double(&hum)); - k_sleep(2000); + k_msleep(2000); } } diff --git a/samples/sensor/sx9500/src/main.c b/samples/sensor/sx9500/src/main.c index 090f3f4d19618..34f4c387fb8ad 100644 --- a/samples/sensor/sx9500/src/main.c +++ b/samples/sensor/sx9500/src/main.c @@ -44,7 +44,7 @@ void do_main(struct device *dev) setup_trigger(dev); while (1) { - k_sleep(1000); + k_msleep(1000); } } @@ -65,7 +65,7 @@ static void do_main(struct device *dev) ret = sensor_channel_get(dev, SENSOR_CHAN_PROX, &prox_value); printk("prox is %d\n", prox_value.val1); - k_sleep(1000); + k_msleep(1000); } } diff --git a/samples/sensor/th02/src/main.c b/samples/sensor/th02/src/main.c index e5ad9185537a2..82ba48d8b3ff2 100644 --- a/samples/sensor/th02/src/main.c +++ b/samples/sensor/th02/src/main.c @@ -101,6 +101,6 @@ void main(void) #endif - k_sleep(2000); + k_msleep(2000); } } diff --git a/samples/sensor/thermometer/src/main.c b/samples/sensor/thermometer/src/main.c index 2b3cc38e6db9f..c0c2d3116a20d 100644 --- a/samples/sensor/thermometer/src/main.c +++ b/samples/sensor/thermometer/src/main.c @@ -43,6 +43,6 @@ void main(void) printf("Temperature is %gC\n", sensor_value_to_double(&temp_value)); - k_sleep(1000); + k_msleep(1000); } } diff --git a/samples/sensor/tmp112/src/main.c b/samples/sensor/tmp112/src/main.c index 6c1bbb8425b26..3b28b258e7cc9 100644 --- a/samples/sensor/tmp112/src/main.c +++ b/samples/sensor/tmp112/src/main.c @@ -50,7 +50,7 @@ static void do_main(struct device *dev) printk("temp is %d (%d micro)\n", temp_value.val1, temp_value.val2); - k_sleep(1000); + k_msleep(1000); } } diff --git a/samples/sensor/vl53l0x/src/main.c b/samples/sensor/vl53l0x/src/main.c index 586efd7479954..33dc8f20fd243 100644 --- a/samples/sensor/vl53l0x/src/main.c +++ b/samples/sensor/vl53l0x/src/main.c @@ -36,6 +36,6 @@ void main(void) &value); printf("distance is %.3fm\n", sensor_value_to_double(&value)); - k_sleep(1000); + k_msleep(1000); } } diff --git a/samples/shields/x_nucleo_iks01a1/src/main.c b/samples/shields/x_nucleo_iks01a1/src/main.c index 1d23b3b860a02..addfb288fec81 100644 --- a/samples/shields/x_nucleo_iks01a1/src/main.c +++ b/samples/shields/x_nucleo_iks01a1/src/main.c @@ -98,6 +98,6 @@ void main(void) sensor_value_to_double(&accel_xyz[1]), sensor_value_to_double(&accel_xyz[2])); - k_sleep(2000); + k_msleep(2000); } } diff --git a/samples/shields/x_nucleo_iks01a2/src/main.c b/samples/shields/x_nucleo_iks01a2/src/main.c index 2b028023e63e1..7b3f8065e16f7 100644 --- a/samples/shields/x_nucleo_iks01a2/src/main.c +++ b/samples/shields/x_nucleo_iks01a2/src/main.c @@ -146,6 +146,6 @@ void main(void) sensor_value_to_double(&magn[1]), sensor_value_to_double(&magn[2])); - k_sleep(2000); + k_msleep(2000); } } diff --git a/samples/shields/x_nucleo_iks01a3/sensorhub/src/main.c b/samples/shields/x_nucleo_iks01a3/sensorhub/src/main.c index 70ab1348b1ba7..3f34dcf9f3feb 100644 --- a/samples/shields/x_nucleo_iks01a3/sensorhub/src/main.c +++ b/samples/shields/x_nucleo_iks01a3/sensorhub/src/main.c @@ -290,6 +290,6 @@ void main(void) #endif cnt++; - k_sleep(2000); + k_msleep(2000); } } diff --git a/samples/shields/x_nucleo_iks01a3/standard/src/main.c b/samples/shields/x_nucleo_iks01a3/standard/src/main.c index 2653ba57d6b85..aaf2da340fa06 100644 --- a/samples/shields/x_nucleo_iks01a3/standard/src/main.c +++ b/samples/shields/x_nucleo_iks01a3/standard/src/main.c @@ -421,6 +421,6 @@ void main(void) #endif cnt++; - k_sleep(2000); + k_msleep(2000); } } diff --git a/samples/subsys/fs/fat_fs/src/main.c b/samples/subsys/fs/fat_fs/src/main.c index b5076039993f2..d31a8ff25e6c9 100644 --- a/samples/subsys/fs/fat_fs/src/main.c +++ b/samples/subsys/fs/fat_fs/src/main.c @@ -74,7 +74,7 @@ void main(void) } while (1) { - k_sleep(1000); + k_msleep(1000); } } diff --git a/samples/subsys/logging/logger/src/main.c b/samples/subsys/logging/logger/src/main.c index 9668b6860253f..24c8ce3343b3b 100644 --- a/samples/subsys/logging/logger/src/main.c +++ b/samples/subsys/logging/logger/src/main.c @@ -243,7 +243,7 @@ static void external_log_system_showcase(void) static void wait_on_log_flushed(void) { while (log_buffered_cnt()) { - k_sleep(5); + k_msleep(5); } } @@ -251,7 +251,7 @@ static void log_demo_thread(void *p1, void *p2, void *p3) { bool usermode = _is_user_context(); - k_sleep(100); + k_msleep(100); printk("\n\t---=< RUNNING LOGGER DEMO FROM %s THREAD >=---\n\n", (usermode) ? "USER" : "KERNEL"); diff --git a/samples/subsys/mgmt/mcumgr/smp_svr/src/main.c b/samples/subsys/mgmt/mcumgr/smp_svr/src/main.c index 6f737b018a286..612c84d9d4ba5 100644 --- a/samples/subsys/mgmt/mcumgr/smp_svr/src/main.c +++ b/samples/subsys/mgmt/mcumgr/smp_svr/src/main.c @@ -167,7 +167,7 @@ void main(void) * main thread idle while the mcumgr server runs. */ while (1) { - k_sleep(1000); + k_msleep(1000); STATS_INC(smp_svr_stats, ticks); } } diff --git a/samples/subsys/nvs/src/main.c b/samples/subsys/nvs/src/main.c index 5a152bba695ba..955948669ba67 100644 --- a/samples/subsys/nvs/src/main.c +++ b/samples/subsys/nvs/src/main.c @@ -182,7 +182,7 @@ void main(void) cnt = 5; while (1) { - k_sleep(SLEEP_TIME); + k_msleep(SLEEP_TIME); if (reboot_counter < MAX_REBOOT) { if (cnt == 5) { /* print some history information about diff --git a/samples/subsys/usb/cdc_acm/src/main.c b/samples/subsys/usb/cdc_acm/src/main.c index ce4a6472a72f3..315c53439fe66 100644 --- a/samples/subsys/usb/cdc_acm/src/main.c +++ b/samples/subsys/usb/cdc_acm/src/main.c @@ -91,7 +91,7 @@ void main(void) break; } else { /* Give CPU resources to low priority threads. */ - k_sleep(100); + k_msleep(100); } } diff --git a/samples/subsys/usb/cdc_acm_composite/src/main.c b/samples/subsys/usb/cdc_acm_composite/src/main.c index aaeccbebaf151..4e80536bc9244 100644 --- a/samples/subsys/usb/cdc_acm_composite/src/main.c +++ b/samples/subsys/usb/cdc_acm_composite/src/main.c @@ -136,7 +136,7 @@ void main(void) break; } - k_sleep(100); + k_msleep(100); } while (1) { @@ -145,7 +145,7 @@ void main(void) break; } - k_sleep(100); + k_msleep(100); } LOG_INF("DTR set, start test"); diff --git a/samples/synchronization/src/main.c b/samples/synchronization/src/main.c index 3c86b6182399b..5af81549da086 100644 --- a/samples/synchronization/src/main.c +++ b/samples/synchronization/src/main.c @@ -52,7 +52,7 @@ void helloLoop(const char *my_name, } /* wait a while, then let other thread have a turn */ - k_sleep(SLEEPTIME); + k_msleep(SLEEPTIME); k_sem_give(other_sem); } } diff --git a/samples/userspace/shared_mem/src/main.c b/samples/userspace/shared_mem/src/main.c index 0c19f3535481f..737c91a11407b 100644 --- a/samples/userspace/shared_mem/src/main.c +++ b/samples/userspace/shared_mem/src/main.c @@ -207,7 +207,7 @@ void enc(void) } /* test for CT flag */ while (fBUFOUT != 0) { - k_sleep(100); + k_msleep(100); } /* ct thread has cleared the buffer */ memcpy(&BUFOUT, &enc_ct, SAMP_BLOCKSIZE); @@ -226,7 +226,7 @@ void enc(void) void pt(void) { - k_sleep(2000); + k_msleep(2000); while (1) { k_sem_take(&allforone, K_FOREVER); if (fBUFIN == 0) { /* send message to encode */ @@ -245,7 +245,7 @@ void pt(void) fBUFIN = 1; } k_sem_give(&allforone); - k_sleep(5000); + k_msleep(5000); } } diff --git a/soc/arm/st_stm32/common/stm32cube_hal.c b/soc/arm/st_stm32/common/stm32cube_hal.c index 4a7c643755d6a..9a71b7e754162 100644 --- a/soc/arm/st_stm32/common/stm32cube_hal.c +++ b/soc/arm/st_stm32/common/stm32cube_hal.c @@ -33,5 +33,5 @@ uint32_t HAL_GetTick(void) */ void HAL_Delay(__IO uint32_t Delay) { - k_sleep(Delay); + k_msleep(Delay); } diff --git a/subsys/console/tty.c b/subsys/console/tty.c index 4451bfc234ef7..b9c7ca8dd232c 100644 --- a/subsys/console/tty.c +++ b/subsys/console/tty.c @@ -194,7 +194,7 @@ static ssize_t tty_read_unbuf(struct tty_serial *tty, void *buf, size_t size) * of data without extra delays. */ if (res == -1) { - k_sleep(1); + k_msleep(1); } } diff --git a/subsys/disk/disk_access_sdhc.h b/subsys/disk/disk_access_sdhc.h index 3ce7d7a767d3f..94303d1bf4e0e 100644 --- a/subsys/disk/disk_access_sdhc.h +++ b/subsys/disk/disk_access_sdhc.h @@ -568,7 +568,7 @@ static inline bool sdhc_retry_ok(struct sdhc_retry *retry) if (retry->tries < SDHC_MIN_TRIES) { retry->tries++; if (retry->sleep != 0U) { - k_sleep(retry->sleep); + k_msleep(retry->sleep); } return true; @@ -576,7 +576,7 @@ static inline bool sdhc_retry_ok(struct sdhc_retry *retry) if (remain >= 0) { if (retry->sleep > 0) { - k_sleep(retry->sleep); + k_msleep(retry->sleep); } else { k_yield(); } diff --git a/subsys/logging/log_backend_rtt.c b/subsys/logging/log_backend_rtt.c index 9be653a200bad..b570818887996 100644 --- a/subsys/logging/log_backend_rtt.c +++ b/subsys/logging/log_backend_rtt.c @@ -165,7 +165,7 @@ static void on_failed_write(int retry_cnt) k_busy_wait(USEC_PER_MSEC * CONFIG_LOG_BACKEND_RTT_RETRY_DELAY_MS); } else { - k_sleep(CONFIG_LOG_BACKEND_RTT_RETRY_DELAY_MS); + k_msleep(CONFIG_LOG_BACKEND_RTT_RETRY_DELAY_MS); } } diff --git a/subsys/logging/log_core.c b/subsys/logging/log_core.c index a7d661d7a9cc0..e0632266737e8 100644 --- a/subsys/logging/log_core.c +++ b/subsys/logging/log_core.c @@ -1144,7 +1144,7 @@ static void log_process_thread_func(void *dummy1, void *dummy2, void *dummy3) while (true) { if (log_process(false) == false) { - k_sleep(CONFIG_LOG_PROCESS_THREAD_SLEEP_MS); + k_msleep(CONFIG_LOG_PROCESS_THREAD_SLEEP_MS); } } } diff --git a/subsys/net/ip/net_shell.c b/subsys/net/ip/net_shell.c index f377c79a1ce39..678646989b29e 100644 --- a/subsys/net/ip/net_shell.c +++ b/subsys/net/ip/net_shell.c @@ -2888,7 +2888,7 @@ static int ping_ipv6(const struct shell *shell, break; } - k_sleep(interval); + k_msleep(interval); } remove_ipv6_ping_handler(); @@ -2993,7 +2993,7 @@ static int ping_ipv4(const struct shell *shell, break; } - k_sleep(interval); + k_msleep(interval); } remove_ipv4_ping_handler(); diff --git a/subsys/net/l2/ieee802154/ieee802154_mgmt.c b/subsys/net/l2/ieee802154/ieee802154_mgmt.c index 61c45f2eab479..2797c6401249f 100644 --- a/subsys/net/l2/ieee802154/ieee802154_mgmt.c +++ b/subsys/net/l2/ieee802154/ieee802154_mgmt.c @@ -152,7 +152,7 @@ static int ieee802154_scan(u32_t mgmt_request, struct net_if *iface, } /* Context aware sleep */ - k_sleep(scan->duration); + k_msleep(scan->duration); if (!ctx->scan_ctx) { NET_DBG("Scan request cancelled"); diff --git a/subsys/net/lib/lwm2m/lwm2m_engine.c b/subsys/net/lib/lwm2m/lwm2m_engine.c index 95b92551a2039..0abe07020dcec 100644 --- a/subsys/net/lib/lwm2m/lwm2m_engine.c +++ b/subsys/net/lib/lwm2m/lwm2m_engine.c @@ -4045,7 +4045,7 @@ static void socket_receive_loop(void) while (1) { /* wait for sockets */ if (sock_nfds < 1) { - k_sleep(lwm2m_engine_service()); + k_msleep(lwm2m_engine_service()); continue; } @@ -4056,14 +4056,14 @@ static void socket_receive_loop(void) if (poll(sock_fds, sock_nfds, lwm2m_engine_service()) < 0) { LOG_ERR("Error in poll:%d", errno); errno = 0; - k_sleep(ENGINE_UPDATE_INTERVAL); + k_msleep(ENGINE_UPDATE_INTERVAL); continue; } for (i = 0; i < sock_nfds; i++) { if (sock_fds[i].revents & POLLERR) { LOG_ERR("Error in poll.. waiting a moment."); - k_sleep(ENGINE_UPDATE_INTERVAL); + k_msleep(ENGINE_UPDATE_INTERVAL); continue; } diff --git a/subsys/shell/shell.c b/subsys/shell/shell.c index 857effb6a5358..443d5c67e98d7 100644 --- a/subsys/shell/shell.c +++ b/subsys/shell/shell.c @@ -1056,7 +1056,7 @@ static void shell_log_process(const struct shell *shell) * readable and can be used to enter further commands. */ if (shell->ctx->cmd_buff_len) { - k_sleep(15); + k_msleep(15); } k_poll_signal_check(signal, &signaled, &result); diff --git a/subsys/testsuite/include/timestamp.h b/subsys/testsuite/include/timestamp.h index dd9e64bf8c1b4..3e6767ec70440 100644 --- a/subsys/testsuite/include/timestamp.h +++ b/subsys/testsuite/include/timestamp.h @@ -23,7 +23,7 @@ #endif -#define TICK_SYNCH() k_sleep(1) +#define TICK_SYNCH() k_msleep(1) #define OS_GET_TIME() k_cycle_get_32() diff --git a/subsys/usb/class/usb_dfu.c b/subsys/usb/class/usb_dfu.c index cf41e90cff20c..19c09e667167a 100644 --- a/subsys/usb/class/usb_dfu.c +++ b/subsys/usb/class/usb_dfu.c @@ -813,7 +813,7 @@ void wait_for_usb_dfu(void) break; } - k_sleep(INTERMITTENT_CHECK_DELAY); + k_msleep(INTERMITTENT_CHECK_DELAY); } } diff --git a/tests/arch/arm/arm_runtime_nmi/src/arm_runtime_nmi.c b/tests/arch/arm/arm_runtime_nmi/src/arm_runtime_nmi.c index eef08ba6c533c..451c585d60737 100644 --- a/tests/arch/arm/arm_runtime_nmi/src/arm_runtime_nmi.c +++ b/tests/arch/arm/arm_runtime_nmi/src/arm_runtime_nmi.c @@ -55,7 +55,7 @@ void test_arm_runtime_nmi(void) for (i = 0U; i < 10; i++) { printk("Trigger NMI in 10s: %d s\n", i); - k_sleep(1000); + k_msleep(1000); } /* Trigger NMI: Should fire immediately */ diff --git a/tests/benchmarks/boot_time/src/main.c b/tests/benchmarks/boot_time/src/main.c index f85a2956bf7f2..722cbce05c743 100644 --- a/tests/benchmarks/boot_time/src/main.c +++ b/tests/benchmarks/boot_time/src/main.c @@ -31,7 +31,7 @@ void main(void) /* * Go to sleep for 1 tick in order to timestamp when idle thread halts. */ - k_sleep(1); + k_msleep(1); int freq = sys_clock_hw_cycles_per_sec() / 1000000; diff --git a/tests/benchmarks/sched/src/main.c b/tests/benchmarks/sched/src/main.c index b9684f7c221b6..b147002b6d1e9 100644 --- a/tests/benchmarks/sched/src/main.c +++ b/tests/benchmarks/sched/src/main.c @@ -108,7 +108,7 @@ void main(void) partner_prio, 0, 0); /* Let it start running and pend */ - k_sleep(100); + k_msleep(100); u64_t tot = 0U; u32_t runs = 0U; diff --git a/tests/benchmarks/sys_kernel/src/syskernel.c b/tests/benchmarks/sys_kernel/src/syskernel.c index 9e06f37e50f8a..fc24bc9328899 100644 --- a/tests/benchmarks/sys_kernel/src/syskernel.c +++ b/tests/benchmarks/sys_kernel/src/syskernel.c @@ -149,7 +149,7 @@ void main(void) */ u64_t time_stamp = z_tick_get(); - k_sleep(1); + k_msleep(1); u64_t time_stamp_2 = z_tick_get(); diff --git a/tests/benchmarks/timing_info/src/msg_passing_bench.c b/tests/benchmarks/timing_info/src/msg_passing_bench.c index a11e08a38d542..6ec8f7b7d6845 100644 --- a/tests/benchmarks/timing_info/src/msg_passing_bench.c +++ b/tests/benchmarks/timing_info/src/msg_passing_bench.c @@ -158,7 +158,7 @@ void msg_passing_bench(void) thread_consumer_get_msgq_w_cxt_switch, NULL, NULL, NULL, 2 /*priority*/, 0, 50); - k_sleep(2000); /* make the main thread sleep */ + k_msleep(2000); /* make the main thread sleep */ k_thread_abort(producer_get_w_cxt_switch_tid); __msg_q_get_w_cxt_end_time = (z_arch_timing_value_swap_common); @@ -193,7 +193,7 @@ void msg_passing_bench(void) thread_mbox_sync_put_receive, NULL, NULL, NULL, 1 /*priority*/, 0, 0); - k_sleep(1000); /* make the main thread sleep */ + k_msleep(1000); /* make the main thread sleep */ mbox_sync_put_end_time = (z_arch_timing_value_swap_common); /*******************************************************************/ @@ -211,7 +211,7 @@ void msg_passing_bench(void) STACK_SIZE, thread_mbox_sync_get_receive, NULL, NULL, NULL, 2 /*priority*/, 0, 0); - k_sleep(1000); /* make the main thread sleep */ + k_msleep(1000); /* make the main thread sleep */ mbox_sync_get_end_time = (z_arch_timing_value_swap_common); /*******************************************************************/ @@ -230,7 +230,7 @@ void msg_passing_bench(void) thread_mbox_async_put_receive, NULL, NULL, NULL, 3 /*priority*/, 0, 0); - k_sleep(1000); /* make the main thread sleep */ + k_msleep(1000); /* make the main thread sleep */ /*******************************************************************/ int single_element_buffer = 0, status; diff --git a/tests/benchmarks/timing_info/src/semaphore_bench.c b/tests/benchmarks/timing_info/src/semaphore_bench.c index 3bae7b8c73631..bbb51d3a21beb 100644 --- a/tests/benchmarks/timing_info/src/semaphore_bench.c +++ b/tests/benchmarks/timing_info/src/semaphore_bench.c @@ -60,7 +60,7 @@ void semaphore_bench(void) NULL, NULL, NULL, 2 /*priority*/, 0, 0); - k_sleep(1000); + k_msleep(1000); /* u64_t test_time1 = z_tsc_read(); */ @@ -76,7 +76,7 @@ void semaphore_bench(void) NULL, NULL, NULL, 2 /*priority*/, 0, 0); - k_sleep(1000); + k_msleep(1000); sem_give_end_time = (z_arch_timing_value_swap_common); u32_t sem_give_cycles = sem_give_end_time - sem_give_start_time; diff --git a/tests/benchmarks/timing_info/src/thread_bench.c b/tests/benchmarks/timing_info/src/thread_bench.c index 2f323cd027712..28d1401b8173c 100644 --- a/tests/benchmarks/timing_info/src/thread_bench.c +++ b/tests/benchmarks/timing_info/src/thread_bench.c @@ -141,7 +141,7 @@ void system_thread_bench(void) NULL, NULL, NULL, -1 /*priority*/, 0, 0); - k_sleep(1); + k_msleep(1); thread_abort_end_time = (z_arch_timing_value_swap_common); z_arch_timing_swap_end = z_arch_timing_value_swap_common; #if defined(CONFIG_X86) || defined(CONFIG_X86_64) @@ -290,7 +290,7 @@ void heap_malloc_free_bench(void) u32_t sum_malloc = 0U; u32_t sum_free = 0U; - k_sleep(10); + k_msleep(10); while (count++ != 100) { TIMING_INFO_PRE_READ(); heap_malloc_start_time = TIMING_INFO_OS_GET_TIME(); diff --git a/tests/benchmarks/timing_info/src/yield_bench.c b/tests/benchmarks/timing_info/src/yield_bench.c index 4f284b2663361..d80b1ee051ff4 100644 --- a/tests/benchmarks/timing_info/src/yield_bench.c +++ b/tests/benchmarks/timing_info/src/yield_bench.c @@ -34,7 +34,7 @@ k_tid_t yield1_tid; void yield_bench(void) { /* Thread yield*/ - k_sleep(10); + k_msleep(10); yield0_tid = k_thread_create(&my_thread, my_stack_area, STACK_SIZE, thread_yield0_test, @@ -52,7 +52,7 @@ void yield_bench(void) TIMING_INFO_PRE_READ(); thread_sleep_start_time = TIMING_INFO_OS_GET_TIME(); - k_sleep(1000); + k_msleep(1000); thread_sleep_end_time = ((u32_t)z_arch_timing_value_swap_common); u32_t yield_cycles = (thread_end_time - thread_start_time) / 2000U; diff --git a/tests/bluetooth/bsim_bt/bsim_test_app/src/test_connect1.c b/tests/bluetooth/bsim_bt/bsim_test_app/src/test_connect1.c index 262bf2016094d..19fb9a1f8b799 100644 --- a/tests/bluetooth/bsim_bt/bsim_test_app/src/test_connect1.c +++ b/tests/bluetooth/bsim_bt/bsim_test_app/src/test_connect1.c @@ -223,7 +223,7 @@ static void connected(struct bt_conn *conn, u8_t conn_err) } if (encrypt_link) { - k_sleep(500); + k_msleep(500); bt_conn_auth_cb_register(&auth_cb_success); err = bt_conn_set_security(conn, BT_SECURITY_L2); if (err) { diff --git a/tests/bluetooth/bsim_bt/bsim_test_app/src/test_connect2.c b/tests/bluetooth/bsim_bt/bsim_test_app/src/test_connect2.c index fff8d593f07f9..c61224deb8884 100644 --- a/tests/bluetooth/bsim_bt/bsim_test_app/src/test_connect2.c +++ b/tests/bluetooth/bsim_bt/bsim_test_app/src/test_connect2.c @@ -160,7 +160,7 @@ static void test_con2_main(void) * of starting delayed work so we do it here */ while (1) { - k_sleep(MSEC_PER_SEC); + k_msleep(MSEC_PER_SEC); /* Heartrate measurements simulation */ hrs_notify(); diff --git a/tests/bluetooth/bsim_bt/bsim_test_app/src/test_empty.c b/tests/bluetooth/bsim_bt/bsim_test_app/src/test_empty.c index f83a6a069cca1..c53c2aa430898 100644 --- a/tests/bluetooth/bsim_bt/bsim_test_app/src/test_empty.c +++ b/tests/bluetooth/bsim_bt/bsim_test_app/src/test_empty.c @@ -36,7 +36,7 @@ static void test_empty_thread(void *p1, void *p2, void *p3) while (1) { printk("A silly demo thread. Iteration %i\n", i++); - k_sleep(100); + k_msleep(100); } } diff --git a/tests/bluetooth/shell/src/main.c b/tests/bluetooth/shell/src/main.c index e02a34e2a04ae..de28489c9a1cb 100644 --- a/tests/bluetooth/shell/src/main.c +++ b/tests/bluetooth/shell/src/main.c @@ -100,7 +100,7 @@ void main(void) " the stack.\n"); while (1) { - k_sleep(MSEC_PER_SEC); + k_msleep(MSEC_PER_SEC); #if defined(CONFIG_BT_GATT_HRS) /* Heartrate measurements simulation */ diff --git a/tests/boards/intel_s1000_crb/src/dma_test.c b/tests/boards/intel_s1000_crb/src/dma_test.c index 036124d7f338a..6e41bffa473f0 100644 --- a/tests/boards/intel_s1000_crb/src/dma_test.c +++ b/tests/boards/intel_s1000_crb/src/dma_test.c @@ -241,7 +241,7 @@ void dma_thread(void) printk("DMA Failed\n"); } k_sem_give(&thread_sem); - k_sleep(SLEEPTIME); + k_msleep(SLEEPTIME); k_sem_take(&thread_sem, K_FOREVER); if (test_task(1, 8, 3) == 0) { @@ -250,7 +250,7 @@ void dma_thread(void) printk("DMA Failed\n"); } k_sem_give(&thread_sem); - k_sleep(SLEEPTIME); + k_msleep(SLEEPTIME); k_sem_take(&thread_sem, K_FOREVER); if (test_task(0, 16, 4) == 0) { @@ -259,7 +259,7 @@ void dma_thread(void) printk("DMA Failed\n"); } k_sem_give(&thread_sem); - k_sleep(SLEEPTIME); + k_msleep(SLEEPTIME); k_sem_take(&thread_sem, K_FOREVER); if (test_task(1, 16, 1) == 0) { @@ -268,7 +268,7 @@ void dma_thread(void) printk("DMA Failed\n"); } k_sem_give(&thread_sem); - k_sleep(SLEEPTIME); + k_msleep(SLEEPTIME); } } diff --git a/tests/boards/intel_s1000_crb/src/gpio_test.c b/tests/boards/intel_s1000_crb/src/gpio_test.c index 73337c22ac5a1..18d4c268bea03 100644 --- a/tests/boards/intel_s1000_crb/src/gpio_test.c +++ b/tests/boards/intel_s1000_crb/src/gpio_test.c @@ -134,7 +134,7 @@ void gpio_thread(void *dummy1, void *dummy2, void *dummy3) k_sem_give(&thread_sem); /* wait a while */ - k_sleep(SLEEPTIME); + k_msleep(SLEEPTIME); } } diff --git a/tests/boards/intel_s1000_crb/src/i2c_test.c b/tests/boards/intel_s1000_crb/src/i2c_test.c index d2962d987f194..2cbbdaadff960 100644 --- a/tests/boards/intel_s1000_crb/src/i2c_test.c +++ b/tests/boards/intel_s1000_crb/src/i2c_test.c @@ -167,7 +167,7 @@ void i2c_thread(void *dummy1, void *dummy2, void *dummy3) k_sem_give(&thread_sem); /* wait a while */ - k_sleep(SLEEPTIME); + k_msleep(SLEEPTIME); } } diff --git a/tests/boards/intel_s1000_crb/src/i2s_test.c b/tests/boards/intel_s1000_crb/src/i2s_test.c index 077b1bb24659a..415da1efc0c9a 100644 --- a/tests/boards/intel_s1000_crb/src/i2s_test.c +++ b/tests/boards/intel_s1000_crb/src/i2s_test.c @@ -177,7 +177,7 @@ void i2s_thread(void *dummy1, void *dummy2, void *dummy3) k_sem_give(&thread_sem); /* wait a while */ - k_sleep(SLEEPTIME); + k_msleep(SLEEPTIME); } } diff --git a/tests/boards/native_posix/native_tasks/src/main.c b/tests/boards/native_posix/native_tasks/src/main.c index 242295d3c0776..202738e879880 100644 --- a/tests/boards/native_posix/native_tasks/src/main.c +++ b/tests/boards/native_posix/native_tasks/src/main.c @@ -64,6 +64,6 @@ NATIVE_TASK(test_hook7, ON_EXIT, 310); void main(void) { - k_sleep(100); + k_msleep(100); posix_exit(0); } diff --git a/tests/boards/native_posix/rtc/src/main.c b/tests/boards/native_posix/rtc/src/main.c index 4153a3117050d..5dbe6e37d35d4 100644 --- a/tests/boards/native_posix/rtc/src/main.c +++ b/tests/boards/native_posix/rtc/src/main.c @@ -69,7 +69,7 @@ static void test_realtime(void) hwtimer_set_rt_ratio(1.0); /*Let's wait >=1 tick to ensure everything is settled*/ - k_sleep(TICK_MS); + k_msleep(TICK_MS); start_time = get_host_us_time(); start_rtc_time[2] = native_rtc_gettime_us(RTC_CLOCK_PSEUDOHOSTREALTIME); @@ -81,7 +81,7 @@ static void test_realtime(void) acc_ratio *= time_ratios[i]; /* k_sleep waits 1 tick more than asked */ - k_sleep(WAIT_TIME - TICK_MS); + k_msleep(WAIT_TIME - TICK_MS); /* * Check that during the sleep, the correct amount of real time diff --git a/tests/drivers/counter/counter_basic_api/src/test_counter.c b/tests/drivers/counter/counter_basic_api/src/test_counter.c index 3030e737c67b5..9b1012316fd40 100644 --- a/tests/drivers/counter/counter_basic_api/src/test_counter.c +++ b/tests/drivers/counter/counter_basic_api/src/test_counter.c @@ -110,7 +110,7 @@ static void test_all_instances(counter_test_func_t func) func(devices[i]); counter_tear_down_instance(devices[i]); /* Allow logs to be printed. */ - k_sleep(100); + k_msleep(100); } } diff --git a/tests/drivers/counter/counter_cmos/src/main.c b/tests/drivers/counter/counter_cmos/src/main.c index 56c00fd30d1db..65d4eee5ca3c4 100644 --- a/tests/drivers/counter/counter_cmos/src/main.c +++ b/tests/drivers/counter/counter_cmos/src/main.c @@ -24,7 +24,7 @@ void test_cmos_rate(void) zassert_true(cmos != NULL, "can't find CMOS counter device"); start = counter_read(cmos); - k_sleep(DELAY_MS); + k_msleep(DELAY_MS); elapsed = counter_read(cmos) - start; zassert_true(elapsed >= MIN_BOUND, "busted minimum bound"); diff --git a/tests/drivers/dma/chan_blen_transfer/src/test_dma.c b/tests/drivers/dma/chan_blen_transfer/src/test_dma.c index 43173cdc4b02b..d0db5a7821ec5 100644 --- a/tests/drivers/dma/chan_blen_transfer/src/test_dma.c +++ b/tests/drivers/dma/chan_blen_transfer/src/test_dma.c @@ -78,7 +78,7 @@ static int test_task(u32_t chan_id, u32_t blen) TC_PRINT("ERROR: transfer\n"); return TC_FAIL; } - k_sleep(2000); + k_msleep(2000); TC_PRINT("%s\n", rx_data); if (strcmp(tx_data, rx_data) != 0) return TC_FAIL; diff --git a/tests/drivers/dma/loop_transfer/src/dma.c b/tests/drivers/dma/loop_transfer/src/dma.c index dc5e9787773ae..c99f70a8b7ca7 100644 --- a/tests/drivers/dma/loop_transfer/src/dma.c +++ b/tests/drivers/dma/loop_transfer/src/dma.c @@ -103,7 +103,7 @@ void main(void) return; } - k_sleep(SLEEPTIME); + k_msleep(SLEEPTIME); if (transfer_count < TRANSFER_LOOPS) { transfer_count = TRANSFER_LOOPS; diff --git a/tests/drivers/gpio/gpio_basic_api/src/test_callback_manage.c b/tests/drivers/gpio/gpio_basic_api/src/test_callback_manage.c index f7ecdc59aaa9f..60167190186a0 100644 --- a/tests/drivers/gpio/gpio_basic_api/src/test_callback_manage.c +++ b/tests/drivers/gpio/gpio_basic_api/src/test_callback_manage.c @@ -65,7 +65,7 @@ static void init_callback(struct device *dev, static void trigger_callback(struct device *dev, int enable_cb) { gpio_pin_write(dev, PIN_OUT, 0); - k_sleep(100); + k_msleep(100); cb_cnt[0] = 0; cb_cnt[1] = 0; @@ -74,9 +74,9 @@ static void trigger_callback(struct device *dev, int enable_cb) } else { gpio_pin_disable_callback(dev, PIN_IN); } - k_sleep(100); + k_msleep(100); gpio_pin_write(dev, PIN_OUT, 1); - k_sleep(1000); + k_msleep(1000); } static int test_callback_add_remove(void) @@ -129,7 +129,7 @@ static int test_callback_self_remove(void) init_callback(dev, callback_1, callback_remove_self); gpio_pin_write(dev, PIN_OUT, 0); - k_sleep(100); + k_msleep(100); cb_data[0].aux = INT_MAX; cb_data[1].aux = INT_MAX; diff --git a/tests/drivers/gpio/gpio_basic_api/src/test_callback_trigger.c b/tests/drivers/gpio/gpio_basic_api/src/test_callback_trigger.c index 28c01d941d850..5786d7ec4803d 100644 --- a/tests/drivers/gpio/gpio_basic_api/src/test_callback_trigger.c +++ b/tests/drivers/gpio/gpio_basic_api/src/test_callback_trigger.c @@ -79,9 +79,9 @@ static int test_callback(int mode) /* 3. enable callback, trigger PIN_IN interrupt by operate PIN_OUT */ cb_cnt = 0; gpio_pin_enable_callback(dev, PIN_IN); - k_sleep(100); + k_msleep(100); gpio_pin_write(dev, PIN_OUT, (mode & GPIO_INT_ACTIVE_HIGH) ? 1 : 0); - k_sleep(1000); + k_msleep(1000); /*= checkpoint: check callback is triggered =*/ TC_PRINT("check enabled callback\n"); diff --git a/tests/drivers/gpio/gpio_basic_api/src/test_pin_rw.c b/tests/drivers/gpio/gpio_basic_api/src/test_pin_rw.c index f6b2b0ee91c75..68ce8493eae68 100644 --- a/tests/drivers/gpio/gpio_basic_api/src/test_pin_rw.c +++ b/tests/drivers/gpio/gpio_basic_api/src/test_pin_rw.c @@ -35,7 +35,7 @@ void test_gpio_pin_read_write(void) zassert_true(gpio_pin_write(dev, PIN_OUT, val_write) == 0, "write data fail"); TC_PRINT("write: %" PRIu32 "\n", val_write); - k_sleep(100); + k_msleep(100); zassert_true(gpio_pin_read(dev, PIN_IN, &val_read) == 0, "read data fail"); TC_PRINT("read: %" PRIu32 "\n", val_read); diff --git a/tests/drivers/i2c/i2c_api/src/test_i2c.c b/tests/drivers/i2c/i2c_api/src/test_i2c.c index ac71ee2d5453f..deff1e4f2732f 100644 --- a/tests/drivers/i2c/i2c_api/src/test_i2c.c +++ b/tests/drivers/i2c/i2c_api/src/test_i2c.c @@ -60,7 +60,7 @@ static int test_gy271(void) return TC_FAIL; } - k_sleep(1); + k_msleep(1); datas[0] = 0x03; if (i2c_write(i2c_dev, datas, 1, 0x1E)) { @@ -110,7 +110,7 @@ static int test_burst_gy271(void) return TC_FAIL; } - k_sleep(1); + k_msleep(1); (void)memset(datas, 0, sizeof(datas)); diff --git a/tests/drivers/i2s/i2s_api/src/test_i2s_loopback.c b/tests/drivers/i2s/i2s_api/src/test_i2s_loopback.c index b5103e51080d8..2acb9cac8762e 100644 --- a/tests/drivers/i2s/i2s_api/src/test_i2s_loopback.c +++ b/tests/drivers/i2s/i2s_api/src/test_i2s_loopback.c @@ -319,7 +319,7 @@ void test_i2s_transfer_restart(void) TC_PRINT("Stop transmission\n"); /* Keep interface inactive */ - k_sleep(TEST_I2S_TRANSFER_RESTART_PAUSE_LENGTH_US); + k_msleep(TEST_I2S_TRANSFER_RESTART_PAUSE_LENGTH_US); TC_PRINT("Start transmission\n"); @@ -396,7 +396,7 @@ void test_i2s_transfer_rx_overrun(void) zassert_equal(ret, 0, "TX DRAIN trigger failed"); /* Wait for transmission to finish */ - k_sleep(TEST_I2S_TRANSFER_RX_OVERRUN_PAUSE_LENGTH_US); + k_msleep(TEST_I2S_TRANSFER_RX_OVERRUN_PAUSE_LENGTH_US); /* Read all available data blocks in RX queue */ for (int i = 0; i < NUM_RX_BLOCKS; i++) { @@ -426,7 +426,7 @@ void test_i2s_transfer_rx_overrun(void) ret = rx_block_read(dev_i2s, 0); zassert_equal(ret, TC_PASS, NULL); - k_sleep(200); + k_msleep(200); } /** @brief TX buffer underrun. @@ -463,7 +463,7 @@ void test_i2s_transfer_tx_underrun(void) ret = rx_block_read(dev_i2s, 0); zassert_equal(ret, TC_PASS, NULL); - k_sleep(200); + k_msleep(200); /* Write one more TX data block, expect an error */ ret = tx_block_write(dev_i2s, 2, -EIO); @@ -472,7 +472,7 @@ void test_i2s_transfer_tx_underrun(void) ret = i2s_trigger(dev_i2s, I2S_DIR_TX, I2S_TRIGGER_PREPARE); zassert_equal(ret, 0, "TX PREPARE trigger failed"); - k_sleep(200); + k_msleep(200); /* Transmit and receive two more data blocks */ ret = tx_block_write(dev_i2s, 1, 0); @@ -492,5 +492,5 @@ void test_i2s_transfer_tx_underrun(void) ret = rx_block_read(dev_i2s, 1); zassert_equal(ret, TC_PASS, NULL); - k_sleep(200); + k_msleep(200); } diff --git a/tests/drivers/i2s/i2s_api/src/test_i2s_states.c b/tests/drivers/i2s/i2s_api/src/test_i2s_states.c index 987748c1a2488..6b590d5aec4ae 100644 --- a/tests/drivers/i2s/i2s_api/src/test_i2s_states.c +++ b/tests/drivers/i2s/i2s_api/src/test_i2s_states.c @@ -363,7 +363,7 @@ void test_i2s_state_error_neg(void) } /* Wait for transmission to finish */ - k_sleep(TEST_I2S_STATE_ERROR_NEG_PAUSE_LENGTH_US); + k_msleep(TEST_I2S_STATE_ERROR_NEG_PAUSE_LENGTH_US); /* Read all available data blocks in RX queue */ for (int i = 0; i < NUM_RX_BLOCKS; i++) { @@ -417,5 +417,5 @@ void test_i2s_state_error_neg(void) ret = rx_block_read(dev_i2s, 0); zassert_equal(ret, TC_PASS, NULL); - k_sleep(200); + k_msleep(200); } diff --git a/tests/drivers/pinmux/pinmux_basic_api/src/pinmux_gpio.c b/tests/drivers/pinmux/pinmux_basic_api/src/pinmux_gpio.c index fbf0badd6a6f4..46eb7d8144e4a 100644 --- a/tests/drivers/pinmux/pinmux_basic_api/src/pinmux_gpio.c +++ b/tests/drivers/pinmux/pinmux_basic_api/src/pinmux_gpio.c @@ -112,7 +112,7 @@ static int test_gpio(u32_t pin, u32_t func) return TC_FAIL; } - k_sleep(1000); + k_msleep(1000); if (cb_triggered) { TC_PRINT("GPIO callback is triggered\n"); diff --git a/tests/drivers/pwm/pwm_api/src/test_pwm.c b/tests/drivers/pwm/pwm_api/src/test_pwm.c index 410701f1a678b..2ab57c6d7dabf 100644 --- a/tests/drivers/pwm/pwm_api/src/test_pwm.c +++ b/tests/drivers/pwm/pwm_api/src/test_pwm.c @@ -110,17 +110,17 @@ void test_pwm_usec(void) /* Period : Pulse (2000 : 1000), unit (usec). Voltage : 1.65V */ zassert_true(test_task(DEFAULT_PWM_PORT, DEFAULT_PERIOD_USEC, DEFAULT_PULSE_USEC, UNIT_USECS) == TC_PASS, NULL); - k_sleep(1000); + k_msleep(1000); /* Period : Pulse (2000 : 2000), unit (usec). Voltage : 3.3V */ zassert_true(test_task(DEFAULT_PWM_PORT, DEFAULT_PERIOD_USEC, DEFAULT_PERIOD_USEC, UNIT_USECS) == TC_PASS, NULL); - k_sleep(1000); + k_msleep(1000); /* Period : Pulse (2000 : 0), unit (usec). Voltage : 0V */ zassert_true(test_task(DEFAULT_PWM_PORT, DEFAULT_PERIOD_USEC, 0, UNIT_USECS) == TC_PASS, NULL); - k_sleep(1000); + k_msleep(1000); } void test_pwm_nsec(void) @@ -128,17 +128,17 @@ void test_pwm_nsec(void) /* Period : Pulse (2000000 : 1000000), unit (nsec). Voltage : 1.65V */ zassert_true(test_task(DEFAULT_PWM_PORT, DEFAULT_PERIOD_NSEC, DEFAULT_PULSE_NSEC, UNIT_NSECS) == TC_PASS, NULL); - k_sleep(1000); + k_msleep(1000); /* Period : Pulse (2000000 : 2000000), unit (nsec). Voltage : 3.3V */ zassert_true(test_task(DEFAULT_PWM_PORT, DEFAULT_PERIOD_NSEC, DEFAULT_PERIOD_NSEC, UNIT_NSECS) == TC_PASS, NULL); - k_sleep(1000); + k_msleep(1000); /* Period : Pulse (2000000 : 0), unit (nsec). Voltage : 0V */ zassert_true(test_task(DEFAULT_PWM_PORT, DEFAULT_PERIOD_NSEC, 0, UNIT_NSECS) == TC_PASS, NULL); - k_sleep(1000); + k_msleep(1000); } void test_pwm_cycle(void) @@ -146,12 +146,12 @@ void test_pwm_cycle(void) /* Period : Pulse (64000 : 32000), unit (cycle). Voltage : 1.65V */ zassert_true(test_task(DEFAULT_PWM_PORT, DEFAULT_PERIOD_CYCLE, DEFAULT_PULSE_CYCLE, UNIT_CYCLES) == TC_PASS, NULL); - k_sleep(1000); + k_msleep(1000); /* Period : Pulse (64000 : 64000), unit (cycle). Voltage : 3.3V */ zassert_true(test_task(DEFAULT_PWM_PORT, DEFAULT_PERIOD_CYCLE, DEFAULT_PERIOD_CYCLE, UNIT_CYCLES) == TC_PASS, NULL); - k_sleep(1000); + k_msleep(1000); /* Period : Pulse (64000 : 0), unit (cycle). Voltage : 0V */ zassert_true(test_task(DEFAULT_PWM_PORT, DEFAULT_PERIOD_CYCLE, diff --git a/tests/drivers/uart/uart_basic_api/src/test_uart_fifo.c b/tests/drivers/uart/uart_basic_api/src/test_uart_fifo.c index 04c8e6f0b114e..4a38adde0af8c 100644 --- a/tests/drivers/uart/uart_basic_api/src/test_uart_fifo.c +++ b/tests/drivers/uart/uart_basic_api/src/test_uart_fifo.c @@ -124,7 +124,7 @@ static int test_fifo_fill(void) /* Verify uart_irq_tx_enable() */ uart_irq_tx_enable(uart_dev); - k_sleep(500); + k_msleep(500); /* Verify uart_irq_tx_disable() */ uart_irq_tx_disable(uart_dev); diff --git a/tests/drivers/watchdog/wdt_basic_api/src/test_wdt.c b/tests/drivers/watchdog/wdt_basic_api/src/test_wdt.c index 1b4fd79eded70..180fbba322f83 100644 --- a/tests/drivers/watchdog/wdt_basic_api/src/test_wdt.c +++ b/tests/drivers/watchdog/wdt_basic_api/src/test_wdt.c @@ -274,7 +274,7 @@ static int test_wdt_callback_2(void) while (1) { wdt_feed(wdt, 0); - k_sleep(100); + k_msleep(100); }; } #endif diff --git a/tests/kernel/common/src/errno.c b/tests/kernel/common/src/errno.c index bf78a8e8b4f67..b600e326b8690 100644 --- a/tests/kernel/common/src/errno.c +++ b/tests/kernel/common/src/errno.c @@ -46,7 +46,7 @@ static void errno_thread(void *_n, void *_my_errno, void *_unused) errno = my_errno; - k_sleep(30 - (n * 10)); + k_msleep(30 - (n * 10)); if (errno == my_errno) { result[n].pass = 1; } diff --git a/tests/kernel/context/src/main.c b/tests/kernel/context/src/main.c index 3f232ff31c3c8..7889758eb11a1 100644 --- a/tests/kernel/context/src/main.c +++ b/tests/kernel/context/src/main.c @@ -695,7 +695,7 @@ static void thread_sleep(void *delta, void *arg2, void *arg3) TC_PRINT(" thread sleeping for %d milliseconds\n", timeout); timestamp = k_uptime_get(); - k_sleep(timeout); + k_msleep(timeout); timestamp = k_uptime_get() - timestamp; TC_PRINT(" thread back from sleep\n"); @@ -771,7 +771,7 @@ static void test_k_sleep(void) rv = k_sem_take(&reply_timeout, K_TIMEOUT_MS(timeout * 2)); zassert_equal(rv, 0, " *** thread timed out waiting for thread on " - "k_sleep()."); + "k_msleep()."); /* test k_thread_create() without cancellation */ TC_PRINT("Testing k_thread_create() without cancellation\n"); diff --git a/tests/kernel/early_sleep/src/main.c b/tests/kernel/early_sleep/src/main.c index 7db8befb773ac..624d9d26ac2ea 100644 --- a/tests/kernel/early_sleep/src/main.c +++ b/tests/kernel/early_sleep/src/main.c @@ -58,7 +58,7 @@ static int ticks_to_sleep(int ticks) u32_t stop_time; start_time = k_cycle_get_32(); - k_sleep(__ticks_to_ms(ticks)); + k_msleep(__ticks_to_ms(ticks)); stop_time = k_cycle_get_32(); return (stop_time - start_time) / sys_clock_hw_cycles_per_tick(); diff --git a/tests/kernel/fifo/fifo_api/src/test_fifo_cancel.c b/tests/kernel/fifo/fifo_api/src/test_fifo_cancel.c index 12c8430ca5317..92a7642f35898 100644 --- a/tests/kernel/fifo/fifo_api/src/test_fifo_cancel.c +++ b/tests/kernel/fifo/fifo_api/src/test_fifo_cancel.c @@ -18,7 +18,7 @@ static struct k_thread thread; static void t_cancel_wait_entry(void *p1, void *p2, void *p3) { - k_sleep(50); + k_msleep(50); k_fifo_cancel_wait((struct k_fifo *)p1); } diff --git a/tests/kernel/fifo/fifo_timeout/src/main.c b/tests/kernel/fifo/fifo_timeout/src/main.c index d1bd9e22ed022..6d2fd6b468357 100644 --- a/tests/kernel/fifo/fifo_timeout/src/main.c +++ b/tests/kernel/fifo/fifo_timeout/src/main.c @@ -113,7 +113,7 @@ static void test_thread_put_timeout(void *p1, void *p2, void *p3) { u32_t timeout = *((u32_t *)p2); - k_sleep(timeout); + k_msleep(timeout); k_fifo_put((struct k_fifo *)p1, get_scratch_packet()); } @@ -124,7 +124,7 @@ static void test_thread_pend_and_timeout(void *p1, void *p2, void *p3) u32_t start_time; void *packet; - k_sleep(1); /* Align to ticks */ + k_msleep(1); /* Align to ticks */ start_time = k_cycle_get_32(); packet = k_fifo_get(d->fifo, K_TIMEOUT_MS(d->timeout)); @@ -300,7 +300,7 @@ static void test_timeout_empty_fifo(void) void *packet; u32_t start_time, timeout; - k_sleep(1); /* Align to ticks */ + k_msleep(1); /* Align to ticks */ /* Test empty fifo with timeout */ timeout = 10U; @@ -353,7 +353,7 @@ static void test_timeout_fifo_thread(void) struct reply_packet reply_packet; u32_t start_time, timeout; - k_sleep(1); /* Align to ticks */ + k_msleep(1); /* Align to ticks */ /* * Test fifo with some timeout and child thread that puts diff --git a/tests/kernel/fp_sharing/generic/src/main.c b/tests/kernel/fp_sharing/generic/src/main.c index 62ad3dab27ea9..fc2fbac348865 100644 --- a/tests/kernel/fp_sharing/generic/src/main.c +++ b/tests/kernel/fp_sharing/generic/src/main.c @@ -331,7 +331,7 @@ void load_store_high(void) * once the sleep ends. */ - k_sleep(1); + k_msleep(1); /* periodically issue progress report */ @@ -380,6 +380,6 @@ void main(void *p1, void *p2, void *p3) * gcov manually later when the test completes. */ while (true) { - k_sleep(1000); + k_msleep(1000); } } diff --git a/tests/kernel/fp_sharing/generic/src/pi.c b/tests/kernel/fp_sharing/generic/src/pi.c index 65f07864b1612..02e1aadd22679 100644 --- a/tests/kernel/fp_sharing/generic/src/pi.c +++ b/tests/kernel/fp_sharing/generic/src/pi.c @@ -134,7 +134,7 @@ void calculate_pi_high(void) * once the sleep ends. */ - k_sleep(10); + k_msleep(10); pi *= 4; diff --git a/tests/kernel/lifo/lifo_usage/src/main.c b/tests/kernel/lifo/lifo_usage/src/main.c index 1bddc9b119818..d90cd94c50135 100644 --- a/tests/kernel/lifo/lifo_usage/src/main.c +++ b/tests/kernel/lifo/lifo_usage/src/main.c @@ -199,7 +199,7 @@ static void test_thread_put_timeout(void *p1, void *p2, void *p3) { u32_t timeout = *((u32_t *)p2); - k_sleep(timeout); + k_msleep(timeout); k_lifo_put((struct k_lifo *)p1, get_scratch_packet()); } diff --git a/tests/kernel/mem_pool/mem_pool_concept/src/test_mpool_alloc_wait.c b/tests/kernel/mem_pool/mem_pool_concept/src/test_mpool_alloc_wait.c index 387dab13d77a9..3b8a1611e0be5 100644 --- a/tests/kernel/mem_pool/mem_pool_concept/src/test_mpool_alloc_wait.c +++ b/tests/kernel/mem_pool/mem_pool_concept/src/test_mpool_alloc_wait.c @@ -80,7 +80,7 @@ void test_mpool_alloc_wait_prio(void) tmpool_alloc_wait_timeout, NULL, NULL, NULL, K_PRIO_PREEMPT(0), 0, K_TIMEOUT_MS(20)); /*relinquish CPU for above threads to start */ - k_sleep(30); + k_msleep(30); /*free one block, expected to unblock thread "tid[1]"*/ k_mem_pool_free(&block[0]); /*wait for all threads exit*/ diff --git a/tests/kernel/mem_protect/futex/src/main.c b/tests/kernel/mem_protect/futex/src/main.c index 262e1033662a5..6e21d3d72f623 100644 --- a/tests/kernel/mem_protect/futex/src/main.c +++ b/tests/kernel/mem_protect/futex/src/main.c @@ -171,7 +171,7 @@ void test_futex_wait_timeout(void) K_NO_WAIT); /* giving time for the futex_wait_task to execute */ - k_sleep(100); + k_msleep(100); zassert_true(atomic_get(&simple_futex.val) == 0, "wait timeout doesn't timeout"); @@ -191,7 +191,7 @@ void test_futex_wait_nowait(void) K_NO_WAIT); /* giving time for the futex_wait_task to execute */ - k_sleep(100); + k_msleep(100); zassert_true(atomic_get(&simple_futex.val) == 0, "wait nowait fail"); @@ -280,7 +280,7 @@ void test_futex_wait_nowait_wake(void) K_NO_WAIT); /* giving time for the futex_wait_wake_task to execute */ - k_sleep(100); + k_msleep(100); k_thread_create(&futex_wake_tid, futex_wake_stack, STACK_SIZE, futex_wake_task, &woken, NULL, NULL, diff --git a/tests/kernel/mem_protect/sys_sem/src/main.c b/tests/kernel/mem_protect/sys_sem/src/main.c index 3e9d0b10fc9c7..ee85bf3cc815a 100644 --- a/tests/kernel/mem_protect/sys_sem/src/main.c +++ b/tests/kernel/mem_protect/sys_sem/src/main.c @@ -60,7 +60,7 @@ void sem_give_task(void *p1, void *p2, void *p3) void sem_take_timeout_forever_helper(void *p1, void *p2, void *p3) { - k_sleep(100); + k_msleep(100); sys_sem_give(&simple_sem); } diff --git a/tests/kernel/mem_protect/userspace/src/main.c b/tests/kernel/mem_protect/userspace/src/main.c index 5ec692bfd0791..60312e4e21d04 100644 --- a/tests/kernel/mem_protect/userspace/src/main.c +++ b/tests/kernel/mem_protect/userspace/src/main.c @@ -696,7 +696,7 @@ static void domain_add_thread_drop_to_user(void) k_mem_domain_init(&add_thread_drop_dom, ARRAY_SIZE(parts), parts); k_mem_domain_remove_thread(k_current_get()); - k_sleep(1); + k_msleep(1); k_mem_domain_add_thread(&add_thread_drop_dom, k_current_get()); k_thread_user_mode_enter(user_half, NULL, NULL, NULL); @@ -716,7 +716,7 @@ static void domain_add_part_drop_to_user(void) k_mem_domain_remove_thread(k_current_get()); k_mem_domain_add_thread(&add_part_drop_dom, k_current_get()); - k_sleep(1); + k_msleep(1); k_mem_domain_add_partition(&add_part_drop_dom, &access_part); k_thread_user_mode_enter(user_half, NULL, NULL, NULL); @@ -738,7 +738,7 @@ static void domain_remove_thread_drop_to_user(void) k_mem_domain_remove_thread(k_current_get()); k_mem_domain_add_thread(&remove_thread_drop_dom, k_current_get()); - k_sleep(1); + k_msleep(1); k_mem_domain_remove_thread(k_current_get()); k_thread_user_mode_enter(user_half, NULL, NULL, NULL); @@ -761,7 +761,7 @@ static void domain_remove_part_drop_to_user(void) k_mem_domain_remove_thread(k_current_get()); k_mem_domain_add_thread(&remove_part_drop_dom, k_current_get()); - k_sleep(1); + k_msleep(1); k_mem_domain_remove_partition(&remove_part_drop_dom, &access_part); k_thread_user_mode_enter(user_half, NULL, NULL, NULL); @@ -804,7 +804,7 @@ static void domain_add_thread_context_switch(void) k_mem_domain_init(&add_thread_ctx_dom, ARRAY_SIZE(parts), parts); k_mem_domain_remove_thread(k_current_get()); - k_sleep(1); + k_msleep(1); k_mem_domain_add_thread(&add_thread_ctx_dom, k_current_get()); spawn_user(); @@ -824,7 +824,7 @@ static void domain_add_part_context_switch(void) k_mem_domain_remove_thread(k_current_get()); k_mem_domain_add_thread(&add_part_ctx_dom, k_current_get()); - k_sleep(1); + k_msleep(1); k_mem_domain_add_partition(&add_part_ctx_dom, &access_part); spawn_user(); @@ -846,7 +846,7 @@ static void domain_remove_thread_context_switch(void) k_mem_domain_remove_thread(k_current_get()); k_mem_domain_add_thread(&remove_thread_ctx_dom, k_current_get()); - k_sleep(1); + k_msleep(1); k_mem_domain_remove_thread(k_current_get()); spawn_user(); @@ -870,7 +870,7 @@ static void domain_remove_part_context_switch(void) k_mem_domain_remove_thread(k_current_get()); k_mem_domain_add_thread(&remove_part_ctx_dom, k_current_get()); - k_sleep(1); + k_msleep(1); k_mem_domain_remove_partition(&remove_part_ctx_dom, &access_part); spawn_user(); diff --git a/tests/kernel/mem_slab/mslab_concept/src/test_mslab_alloc_wait.c b/tests/kernel/mem_slab/mslab_concept/src/test_mslab_alloc_wait.c index 2008351f201c5..526a4c915f169 100644 --- a/tests/kernel/mem_slab/mslab_concept/src/test_mslab_alloc_wait.c +++ b/tests/kernel/mem_slab/mslab_concept/src/test_mslab_alloc_wait.c @@ -82,7 +82,7 @@ void test_mslab_alloc_wait_prio(void) tmslab_alloc_wait_timeout, NULL, NULL, NULL, K_PRIO_PREEMPT(0), 0, K_TIMEOUT_MS(20)); /*relinquish CPU for above threads to start */ - k_sleep(30); + k_msleep(30); /*free one block, expected to unblock thread "tid[1]"*/ k_mem_slab_free(&mslab1, &block[0]); /*wait for all threads exit*/ diff --git a/tests/kernel/msgq/msgq_api/src/test_msgq.h b/tests/kernel/msgq/msgq_api/src/test_msgq.h index 5b5c2a6ae4094..8d11dfbe2e00a 100644 --- a/tests/kernel/msgq/msgq_api/src/test_msgq.h +++ b/tests/kernel/msgq/msgq_api/src/test_msgq.h @@ -12,7 +12,7 @@ #include #include -#define TIMEOUT K_TIMEOUT_MS(100) +#define TIMEOUT 100 #define STACK_SIZE (512 + CONFIG_TEST_EXTRA_STACKSIZE) #define MSG_SIZE 4 #define MSGQ_LEN 2 diff --git a/tests/kernel/msgq/msgq_api/src/test_msgq_contexts.c b/tests/kernel/msgq/msgq_api/src/test_msgq_contexts.c index 2f4a341382d7c..62e90e5fdc608 100644 --- a/tests/kernel/msgq/msgq_api/src/test_msgq_contexts.c +++ b/tests/kernel/msgq/msgq_api/src/test_msgq_contexts.c @@ -173,7 +173,7 @@ static void pend_thread_entry(void *p1, void *p2, void *p3) { int ret; - ret = k_msgq_put(p1, &data[1], TIMEOUT); + ret = k_msgq_put(p1, &data[1], K_TIMEOUT_MS(TIMEOUT)); zassert_equal(ret, 0, NULL); } diff --git a/tests/kernel/msgq/msgq_api/src/test_msgq_fail.c b/tests/kernel/msgq/msgq_api/src/test_msgq_fail.c index b6df4f5a33b1f..2209790ef44d1 100644 --- a/tests/kernel/msgq/msgq_api/src/test_msgq_fail.c +++ b/tests/kernel/msgq/msgq_api/src/test_msgq_fail.c @@ -20,7 +20,7 @@ static void put_fail(struct k_msgq *q) ret = k_msgq_put(q, (void *)&data[1], K_NO_WAIT); zassert_equal(ret, -ENOMSG, NULL); /**TESTPOINT: msgq put returns -EAGAIN*/ - ret = k_msgq_put(q, (void *)&data[0], TIMEOUT); + ret = k_msgq_put(q, (void *)&data[0], K_TIMEOUT_MS(TIMEOUT)); zassert_equal(ret, -EAGAIN, NULL); k_msgq_purge(q); @@ -35,7 +35,7 @@ static void get_fail(struct k_msgq *q) zassert_equal(ret, -ENOMSG, NULL); /**TESTPOINT: msgq get returns -EAGAIN*/ - ret = k_msgq_get(q, &rx_data, TIMEOUT); + ret = k_msgq_get(q, &rx_data, K_TIMEOUT_MS(TIMEOUT)); zassert_equal(ret, -EAGAIN, NULL); } diff --git a/tests/kernel/msgq/msgq_api/src/test_msgq_purge.c b/tests/kernel/msgq/msgq_api/src/test_msgq_purge.c index 444c0b032fd46..b0d837b87a986 100644 --- a/tests/kernel/msgq/msgq_api/src/test_msgq_purge.c +++ b/tests/kernel/msgq/msgq_api/src/test_msgq_purge.c @@ -14,7 +14,8 @@ static ZTEST_DMEM u32_t data[MSGQ_LEN] = { MSG0, MSG1 }; static void tThread_entry(void *p1, void *p2, void *p3) { - int ret = k_msgq_put((struct k_msgq *)p1, (void *)&data[0], TIMEOUT); + int ret = k_msgq_put((struct k_msgq *)p1, (void *)&data[0], + K_TIMEOUT_MS(TIMEOUT)); zassert_equal(ret, -ENOMSG, NULL); } @@ -32,7 +33,7 @@ static void purge_when_put(struct k_msgq *q) k_thread_create(&tdata, tstack, STACK_SIZE, tThread_entry, q, NULL, NULL, K_PRIO_PREEMPT(0), K_USER | K_INHERIT_PERMS, K_NO_WAIT); - k_sleep(K_TIMEOUT_GET(TIMEOUT) >> 1); + k_msleep(TIMEOUT >> 1); /**TESTPOINT: msgq purge while another thread waiting to put msg*/ k_msgq_purge(q); diff --git a/tests/kernel/mutex/mutex_api/src/test_mutex_apis.c b/tests/kernel/mutex/mutex_api/src/test_mutex_apis.c index 00813b76a60fd..44789316ff5f3 100644 --- a/tests/kernel/mutex/mutex_api/src/test_mutex_apis.c +++ b/tests/kernel/mutex/mutex_api/src/test_mutex_apis.c @@ -55,7 +55,7 @@ static void tmutex_test_lock(struct k_mutex *pmutex, TC_PRINT("access resource from main thread\n"); /* wait for spawn thread to take action */ - k_sleep(TIMEOUT); + k_msleep(TIMEOUT); } static void tmutex_test_lock_timeout(struct k_mutex *pmutex, @@ -71,9 +71,9 @@ static void tmutex_test_lock_timeout(struct k_mutex *pmutex, TC_PRINT("access resource from main thread\n"); /* wait for spawn thread to take action */ - k_sleep(TIMEOUT); + k_msleep(TIMEOUT); k_mutex_unlock(pmutex); - k_sleep(TIMEOUT); + k_msleep(TIMEOUT); } diff --git a/tests/kernel/mutex/sys_mutex/src/main.c b/tests/kernel/mutex/sys_mutex/src/main.c index 1bd2f96b02103..16f2d4084dc84 100644 --- a/tests/kernel/mutex/sys_mutex/src/main.c +++ b/tests/kernel/mutex/sys_mutex/src/main.c @@ -79,7 +79,7 @@ void thread_05(void) { int rv; - k_sleep(3500); + k_msleep(3500); /* Wait and boost owner priority to 5 */ rv = sys_mutex_lock(&mutex_4, K_TIMEOUT_MS(1000)); @@ -102,7 +102,7 @@ void thread_06(void) { int rv; - k_sleep(3750); + k_msleep(3750); /* * Wait for the mutex. There is a higher priority level thread waiting @@ -134,7 +134,7 @@ void thread_07(void) { int rv; - k_sleep(2500); + k_msleep(2500); /* * Wait and boost owner priority to 7. While waiting, another thread of @@ -164,7 +164,7 @@ void thread_08(void) { int rv; - k_sleep(1500); + k_msleep(1500); /* Wait and boost owner priority to 8 */ rv = sys_mutex_lock(&mutex_2, K_FOREVER); @@ -188,7 +188,7 @@ void thread_09(void) { int rv; - k_sleep(500); /* Allow lower priority thread to run */ + k_msleep(500); /* Allow lower priority thread to run */ /* is already locked. */ rv = sys_mutex_lock(&mutex_1, K_NO_WAIT); @@ -221,7 +221,7 @@ void thread_11(void) { int rv; - k_sleep(3500); + k_msleep(3500); rv = sys_mutex_lock(&mutex_3, K_FOREVER); if (rv != 0) { tc_rc = TC_FAIL; @@ -282,7 +282,7 @@ void test_mutex(void) for (i = 0; i < 4; i++) { rv = sys_mutex_lock(mutexes[i], K_NO_WAIT); zassert_equal(rv, 0, "Failed to lock mutex %p\n", mutexes[i]); - k_sleep(1000); + k_msleep(1000); rv = k_thread_priority_get(k_current_get()); zassert_equal(rv, priority[i], "expected priority %d, not %d\n", @@ -297,7 +297,7 @@ void test_mutex(void) TC_PRINT("Done LOCKING! Current priority = %d\n", k_thread_priority_get(k_current_get())); - k_sleep(1000); /* thread_05 should time out */ + k_msleep(1000); /* thread_05 should time out */ /* ~ 5 seconds have passed */ @@ -311,7 +311,7 @@ void test_mutex(void) zassert_equal(rv, 7, "Gave %s and priority should drop.\n", "mutex_4"); zassert_equal(rv, 7, "Expected priority %d, not %d\n", 7, rv); - k_sleep(1000); /* thread_07 should time out */ + k_msleep(1000); /* thread_07 should time out */ /* ~ 6 seconds have passed */ @@ -327,7 +327,7 @@ void test_mutex(void) rv = k_thread_priority_get(k_current_get()); zassert_equal(rv, 10, "Expected priority %d, not %d\n", 10, rv); - k_sleep(1000); /* Give thread_11 time to run */ + k_msleep(1000); /* Give thread_11 time to run */ zassert_equal(tc_rc, TC_PASS, NULL); @@ -345,7 +345,7 @@ void test_mutex(void) k_thread_create(&thread_12_thread_data, thread_12_stack_area, STACKSIZE, (k_thread_entry_t)thread_12, NULL, NULL, NULL, K_PRIO_PREEMPT(12), thread_flags, K_NO_WAIT); - k_sleep(1); /* Give thread_12 a chance to block on the mutex */ + k_msleep(1); /* Give thread_12 a chance to block on the mutex */ sys_mutex_unlock(&private_mutex); sys_mutex_unlock(&private_mutex); /* thread_12 should now have lock */ diff --git a/tests/kernel/mutex/sys_mutex/src/thread_12.c b/tests/kernel/mutex/sys_mutex/src/thread_12.c index 991626f8bd8a4..916761509896f 100644 --- a/tests/kernel/mutex/sys_mutex/src/thread_12.c +++ b/tests/kernel/mutex/sys_mutex/src/thread_12.c @@ -45,7 +45,7 @@ void thread_12(void) /* Wait a bit, then release the mutex */ - k_sleep(500); + k_msleep(500); sys_mutex_unlock(&private_mutex); } diff --git a/tests/kernel/obj_tracing/src/main.c b/tests/kernel/obj_tracing/src/main.c index 66372f7272768..b2b075acf1dcb 100644 --- a/tests/kernel/obj_tracing/src/main.c +++ b/tests/kernel/obj_tracing/src/main.c @@ -25,7 +25,7 @@ extern void test_obj_tracing(void); #define TAKE(x) k_sem_take(x, K_FOREVER) #define GIVE(x) k_sem_give(x) -#define RANDDELAY(x) k_sleep(10 * (x) + 1) +#define RANDDELAY(x) k_msleep(10 * (x) + 1) /* 1 IPM console thread if enabled */ #if defined(CONFIG_IPM_CONSOLE_RECEIVER) && defined(CONFIG_PRINTK) diff --git a/tests/kernel/pending/src/main.c b/tests/kernel/pending/src/main.c index 724d0eb4840d1..b7cfd3c4d783d 100644 --- a/tests/kernel/pending/src/main.c +++ b/tests/kernel/pending/src/main.c @@ -315,7 +315,7 @@ void test_pending(void) (task_low_state != FIFO_TEST_START), NULL); /* Give waiting threads time to time-out */ - k_sleep(NUM_SECONDS(2)); + k_msleep(NUM_SECONDS(2)); /* * Verify that the cooperative and preemptible threads timed-out in @@ -373,7 +373,7 @@ void test_pending(void) (task_low_state != LIFO_TEST_START), NULL); /* Give waiting threads time to time-out */ - k_sleep(NUM_SECONDS(2)); + k_msleep(NUM_SECONDS(2)); TC_PRINT("Testing lifos time-out in correct order ...\n"); zassert_false((task_low_state != LIFO_TEST_START + 1) || @@ -423,7 +423,7 @@ void test_pending(void) zassert_equal(timer_end_tick, 0, "Task did not pend on timer"); /* Let the timer expire */ - k_sleep(NUM_SECONDS(2)); + k_msleep(NUM_SECONDS(2)); zassert_false((timer_end_tick < timer_start_tick + NUM_SECONDS(1)), "Task waiting on timer error"); diff --git a/tests/kernel/pipe/pipe_api/src/test_pipe_contexts.c b/tests/kernel/pipe/pipe_api/src/test_pipe_contexts.c index d643ed5603498..e93706b030a80 100644 --- a/tests/kernel/pipe/pipe_api/src/test_pipe_contexts.c +++ b/tests/kernel/pipe/pipe_api/src/test_pipe_contexts.c @@ -213,7 +213,7 @@ void test_pipe_block_put(void) tThread_block_put, &kpipe, NULL, NULL, K_PRIO_PREEMPT(0), 0, K_NO_WAIT); - k_sleep(10); + k_msleep(10); tpipe_get(&kpipe, K_FOREVER); k_sem_take(&end_sema, K_FOREVER); @@ -233,7 +233,7 @@ void test_pipe_block_put_sema(void) k_tid_t tid = k_thread_create(&tdata, tstack, STACK_SIZE, tThread_block_put, &pipe, &sync_sema, NULL, K_PRIO_PREEMPT(0), 0, K_NO_WAIT); - k_sleep(10); + k_msleep(10); tpipe_get(&pipe, K_FOREVER); k_sem_take(&end_sema, K_FOREVER); @@ -316,7 +316,7 @@ void test_half_pipe_block_put_sema(void) &khalfpipe, &sync_sema, NULL, K_PRIO_PREEMPT(0), 0, K_NO_WAIT); - k_sleep(10); + k_msleep(10); tpipe_get(&khalfpipe, K_FOREVER); k_thread_abort(tid); diff --git a/tests/kernel/poll/src/test_poll.c b/tests/kernel/poll/src/test_poll.c index 2eebdb5f79d69..eb87d62322f00 100644 --- a/tests/kernel/poll/src/test_poll.c +++ b/tests/kernel/poll/src/test_poll.c @@ -173,7 +173,7 @@ static void poll_wait_helper(void *use_fifo, void *p2, void *p3) { (void)p2; (void)p3; - k_sleep(250); + k_msleep(250); k_sem_give(&wait_sem); @@ -377,7 +377,7 @@ static void poll_cancel_helper(void *p1, void *p2, void *p3) static struct fifo_msg msg; - k_sleep(100); + k_msleep(100); k_fifo_cancel_wait(&cancel_fifo); @@ -531,7 +531,7 @@ void test_poll_multi(void) K_USER | K_INHERIT_PERMS, K_NO_WAIT); /* Allow lower priority thread to add poll event in the list */ - k_sleep(250); + k_msleep(250); rc = k_poll(events, ARRAY_SIZE(events), K_SECONDS(1)); zassert_equal(rc, 0, ""); @@ -547,7 +547,7 @@ void test_poll_multi(void) /* wait for polling threads to complete execution */ k_thread_priority_set(k_current_get(), old_prio); - k_sleep(250); + k_msleep(250); } static struct k_poll_signal signal; @@ -556,7 +556,7 @@ static void threadstate(void *p1, void *p2, void *p3) { (void)p2; (void)p3; - k_sleep(250); + k_msleep(250); /* Update polling thread state explicitly to improve code coverage */ k_thread_suspend(p1); /* Enable polling thread by signalling */ diff --git a/tests/kernel/profiling/profiling_api/src/main.c b/tests/kernel/profiling/profiling_api/src/main.c index 6046d70040b32..096ee347752cb 100644 --- a/tests/kernel/profiling/profiling_api/src/main.c +++ b/tests/kernel/profiling/profiling_api/src/main.c @@ -100,7 +100,7 @@ void test_call_stacks_analyze_main(void) void test_call_stacks_analyze_idle(void) { TC_PRINT("from idle thread:\n"); - k_sleep(SLEEP_MS); + k_msleep(SLEEP_MS); } /** diff --git a/tests/kernel/queue/src/test_queue_contexts.c b/tests/kernel/queue/src/test_queue_contexts.c index 4252066aed153..14621c90fba2f 100644 --- a/tests/kernel/queue/src/test_queue_contexts.c +++ b/tests/kernel/queue/src/test_queue_contexts.c @@ -199,7 +199,7 @@ static void tqueue_get_2threads(struct k_queue *pqueue) K_PRIO_PREEMPT(0), 0, K_NO_WAIT); /* Wait threads to initialize */ - k_sleep(10); + k_msleep(10); k_queue_append(pqueue, (void *)&data[0]); k_queue_append(pqueue, (void *)&data[1]); diff --git a/tests/kernel/sched/deadline/src/main.c b/tests/kernel/sched/deadline/src/main.c index dcd710ecb11d1..7b5c8c8b33895 100644 --- a/tests/kernel/sched/deadline/src/main.c +++ b/tests/kernel/sched/deadline/src/main.c @@ -39,7 +39,7 @@ void worker(void *p1, void *p2, void *p3) * with the scheduling. */ while (1) { - k_sleep(1000000); + k_msleep(1000000); } } @@ -78,7 +78,7 @@ void test_deadline(void) zassert_true(n_exec == 0, "threads ran too soon"); - k_sleep(100); + k_msleep(100); zassert_true(n_exec == NUM_THREADS, "not enough threads ran"); diff --git a/tests/kernel/sched/preempt/src/main.c b/tests/kernel/sched/preempt/src/main.c index 76f9725a62227..a22643b612ceb 100644 --- a/tests/kernel/sched/preempt/src/main.c +++ b/tests/kernel/sched/preempt/src/main.c @@ -291,7 +291,7 @@ void worker(void *p1, void *p2, void *p3) if (do_sleep) { u64_t start = k_uptime_get(); - k_sleep(1); + k_msleep(1); zassert_true(k_uptime_get() - start > 0, "didn't sleep"); diff --git a/tests/kernel/sched/schedule_api/src/test_priority_scheduling.c b/tests/kernel/sched/schedule_api/src/test_priority_scheduling.c index 27b6aec29982b..89a71b87e4bb7 100644 --- a/tests/kernel/sched/schedule_api/src/test_priority_scheduling.c +++ b/tests/kernel/sched/schedule_api/src/test_priority_scheduling.c @@ -91,7 +91,7 @@ void test_priority_scheduling(void) k_sem_take(&sema2, K_FOREVER); } /* Delay to give chance to last thread to run */ - k_sleep(1); + k_msleep(1); /* Giving Chance to other threads to run */ for (int i = 0; i < NUM_THREAD; i++) { diff --git a/tests/kernel/sched/schedule_api/src/test_sched_priority.c b/tests/kernel/sched/schedule_api/src/test_sched_priority.c index bf4334b8c5498..d1295f2c7bd34 100644 --- a/tests/kernel/sched/schedule_api/src/test_sched_priority.c +++ b/tests/kernel/sched/schedule_api/src/test_sched_priority.c @@ -44,7 +44,7 @@ void test_priority_cooperative(void) spawn_prio, 0, K_NO_WAIT); /* checkpoint: current thread shouldn't preempted by higher thread */ zassert_true(last_prio == k_thread_priority_get(k_current_get()), NULL); - k_sleep(100); + k_msleep(100); /* checkpoint: spawned thread get executed */ zassert_true(last_prio == spawn_prio, NULL); k_thread_abort(tid); @@ -80,7 +80,7 @@ void test_priority_preemptible(void) /* checkpoint: thread is preempted by higher thread */ zassert_true(last_prio == spawn_prio, NULL); - k_sleep(100); + k_msleep(100); k_thread_abort(tid); spawn_prio = last_prio + 1; diff --git a/tests/kernel/sched/schedule_api/src/test_sched_timeslice_and_lock.c b/tests/kernel/sched/schedule_api/src/test_sched_timeslice_and_lock.c index 415d734d75e27..53b61956021f0 100644 --- a/tests/kernel/sched/schedule_api/src/test_sched_timeslice_and_lock.c +++ b/tests/kernel/sched/schedule_api/src/test_sched_timeslice_and_lock.c @@ -25,7 +25,7 @@ static void thread_entry(void *p1, void *p2, void *p3) int sleep_ms = POINTER_TO_INT(p2); if (sleep_ms > 0) { - k_sleep(sleep_ms); + k_msleep(sleep_ms); } int tnum = POINTER_TO_INT(p1); @@ -131,7 +131,7 @@ void test_sleep_cooperative(void) spawn_threads(0); /* checkpoint: all ready threads get executed when k_sleep */ - k_sleep(100); + k_msleep(100); for (int i = 0; i < THREADS_NUM; i++) { zassert_true(tdata[i].executed == 1, NULL); } @@ -325,7 +325,7 @@ void test_lock_preemptible(void) zassert_true(tdata[i].executed == 0, NULL); } /* make current thread unready */ - k_sleep(100); + k_msleep(100); /* checkpoint: all other threads get executed */ for (int i = 0; i < THREADS_NUM; i++) { zassert_true(tdata[i].executed == 1, NULL); diff --git a/tests/kernel/sched/schedule_api/src/user_api.c b/tests/kernel/sched/schedule_api/src/user_api.c index bbace80bf231c..9633e59c5b57e 100644 --- a/tests/kernel/sched/schedule_api/src/user_api.c +++ b/tests/kernel/sched/schedule_api/src/user_api.c @@ -19,7 +19,7 @@ static void sleepy_thread(void *p1, void *p2, void *p3) ARG_UNUSED(p2); ARG_UNUSED(p3); - k_sleep(INT_MAX); + k_msleep(INT_MAX); k_sem_give(&user_sem); } diff --git a/tests/kernel/semaphore/semaphore/src/main.c b/tests/kernel/semaphore/semaphore/src/main.c index 04d0ce855be22..44b6114be34a1 100644 --- a/tests/kernel/semaphore/semaphore/src/main.c +++ b/tests/kernel/semaphore/semaphore/src/main.c @@ -60,7 +60,7 @@ void sem_give_task(void *p1, void *p2, void *p3) void sem_take_timeout_forever_helper(void *p1, void *p2, void *p3) { - k_sleep(100); + k_msleep(100); k_sem_give(&simple_sem); } @@ -363,17 +363,17 @@ void test_sem_take_multiple(void) /* time for those 3 threads to complete */ - k_sleep(20); + k_msleep(20); /* Let these threads proceed to take the multiple_sem */ k_sem_give(&high_prio_sem); k_sem_give(&mid_prio_sem); k_sem_give(&low_prio_sem); - k_sleep(200); + k_msleep(200); /* enable the higher priority thread to run. */ k_sem_give(&multiple_thread_sem); - k_sleep(200); + k_msleep(200); /* check which threads completed. */ signal_count = k_sem_count_get(&high_prio_sem); zassert_true(signal_count == 1U, @@ -389,7 +389,7 @@ void test_sem_take_multiple(void) /* enable the Medium priority thread to run. */ k_sem_give(&multiple_thread_sem); - k_sleep(200); + k_msleep(200); /* check which threads completed. */ signal_count = k_sem_count_get(&high_prio_sem); zassert_true(signal_count == 1U, @@ -405,7 +405,7 @@ void test_sem_take_multiple(void) /* enable the low priority thread to run. */ k_sem_give(&multiple_thread_sem); - k_sleep(200); + k_msleep(200); /* check which threads completed. */ signal_count = k_sem_count_get(&high_prio_sem); zassert_true(signal_count == 1U, @@ -492,7 +492,7 @@ void test_sem_multiple_threads_wait(void) } /* giving time for the other threads to execute */ - k_sleep(500); + k_msleep(500); /* Give the semaphores */ for (int i = 0; i < TOTAL_THREADS_WAITING; i++) { @@ -500,7 +500,7 @@ void test_sem_multiple_threads_wait(void) } /* giving time for the other threads to execute */ - k_sleep(500); + k_msleep(500); /* check if all the threads are done. */ for (int i = 0; i < TOTAL_THREADS_WAITING; i++) { diff --git a/tests/kernel/sleep/src/main.c b/tests/kernel/sleep/src/main.c index f6f833e40ad24..3394ddf7dfdd2 100644 --- a/tests/kernel/sleep/src/main.c +++ b/tests/kernel/sleep/src/main.c @@ -99,11 +99,11 @@ static void test_thread(int arg1, int arg2) k_sem_take(&test_thread_sem, K_FOREVER); - TC_PRINT("Testing normal expiration of k_sleep()\n"); + TC_PRINT("Testing normal expiration of k_msleep()\n"); align_to_tick_boundary(); start_tick = k_uptime_get_32(); - k_sleep(ONE_SECOND); + k_msleep(ONE_SECOND); end_tick = k_uptime_get_32(); if (!sleep_time_valid(start_tick, end_tick, ONE_SECOND_ALIGNED)) { @@ -118,7 +118,7 @@ static void test_thread(int arg1, int arg2) align_to_tick_boundary(); start_tick = k_uptime_get_32(); - k_sleep(ONE_SECOND); + k_msleep(ONE_SECOND); end_tick = k_uptime_get_32(); if (end_tick - start_tick > 1) { @@ -132,7 +132,7 @@ static void test_thread(int arg1, int arg2) align_to_tick_boundary(); start_tick = k_uptime_get_32(); - k_sleep(ONE_SECOND); + k_msleep(ONE_SECOND); end_tick = k_uptime_get_32(); if (end_tick - start_tick > 1) { @@ -146,7 +146,7 @@ static void test_thread(int arg1, int arg2) align_to_tick_boundary(); start_tick = k_uptime_get_32(); - k_sleep(ONE_SECOND); /* Task will execute */ + k_msleep(ONE_SECOND); /* Task will execute */ end_tick = k_uptime_get_32(); if (end_tick - start_tick > 1) { @@ -228,10 +228,10 @@ void test_sleep(void) zassert_false(test_failure, "test failure"); - TC_PRINT("Testing kernel k_sleep()\n"); + TC_PRINT("Testing kernel k_msleep()\n"); align_to_tick_boundary(); start_tick = k_uptime_get_32(); - k_sleep(ONE_SECOND); + k_msleep(ONE_SECOND); end_tick = k_uptime_get_32(); zassert_true(sleep_time_valid(start_tick, end_tick, ONE_SECOND_ALIGNED), "k_sleep() slept for %d ticks, not %d\n", diff --git a/tests/kernel/smp/src/main.c b/tests/kernel/smp/src/main.c index 57856a00cfbd7..386af0c883864 100644 --- a/tests/kernel/smp/src/main.c +++ b/tests/kernel/smp/src/main.c @@ -138,7 +138,7 @@ static void child_fn(void *p1, void *p2, void *p3) void test_cpu_id_threads(void) { /* Make sure idle thread runs on each core */ - k_sleep(1000); + k_msleep(1000); int parent_cpu_id = z_arch_curr_cpu()->id; @@ -339,7 +339,7 @@ void test_sleep_threads(void) spawn_threads(K_PRIO_COOP(10), THREADS_NUM, !EQUAL_PRIORITY, &thread_entry, !THREAD_DELAY); - k_sleep(TIMEOUT); + k_msleep(TIMEOUT); for (int i = 0; i < THREADS_NUM; i++) { zassert_true(tinfo[i].executed == 1, @@ -358,7 +358,7 @@ static void thread_wakeup_entry(void *p1, void *p2, void *p3) thread_started[thread_num] = 1; - k_sleep(DELAY_US * 1000); + k_msleep(DELAY_US * 1000); tinfo[thread_num].executed = 1; } @@ -437,7 +437,7 @@ void test_main(void) * thread from which they can exit correctly to run the main * test. */ - k_sleep(1000); + k_msleep(1000); ztest_test_suite(smp, ztest_unit_test(test_smp_coop_threads), diff --git a/tests/kernel/threads/thread_apis/src/main.c b/tests/kernel/threads/thread_apis/src/main.c index 64d29544a1524..ad12ba89f6a91 100644 --- a/tests/kernel/threads/thread_apis/src/main.c +++ b/tests/kernel/threads/thread_apis/src/main.c @@ -64,7 +64,7 @@ void test_systhreads_main(void) */ void test_systhreads_idle(void) { - k_sleep(100); + k_msleep(100); /** TESTPOINT: check working thread priority should */ zassert_true(k_thread_priority_get(k_current_get()) < K_IDLE_PRIO, NULL); @@ -78,7 +78,7 @@ static void customdata_entry(void *p1, void *p2, void *p3) while (1) { k_thread_custom_data_set((void *)data); /* relinguish cpu for a while */ - k_sleep(50); + k_msleep(50); /** TESTPOINT: custom data comparison */ zassert_equal(data, (long)k_thread_custom_data_get(), NULL); data++; @@ -97,7 +97,7 @@ void test_customdata_get_set_coop(void) customdata_entry, NULL, NULL, NULL, K_PRIO_COOP(1), 0, K_NO_WAIT); - k_sleep(500); + k_msleep(500); /* cleanup environment */ k_thread_abort(tid); @@ -225,7 +225,7 @@ void test_customdata_get_set_preempt(void) customdata_entry, NULL, NULL, NULL, K_PRIO_PREEMPT(0), K_USER, K_NO_WAIT); - k_sleep(500); + k_msleep(500); /* cleanup environment */ k_thread_abort(tid); diff --git a/tests/kernel/threads/thread_apis/src/test_kthread_for_each.c b/tests/kernel/threads/thread_apis/src/test_kthread_for_each.c index def0dd52b409a..fc46a228c0675 100644 --- a/tests/kernel/threads/thread_apis/src/test_kthread_for_each.c +++ b/tests/kernel/threads/thread_apis/src/test_kthread_for_each.c @@ -18,7 +18,7 @@ static bool thread_flag; static void thread_entry(void *p1, void *p2, void *p3) { - k_sleep(SLEEP_MS); + k_msleep(SLEEP_MS); } static void thread_callback(const struct k_thread *thread, void *user_data) @@ -63,7 +63,7 @@ void test_k_thread_foreach(void) k_tid_t tid = k_thread_create(&tdata, tstack, STACK_SIZE, (k_thread_entry_t)thread_entry, NULL, NULL, NULL, K_PRIO_PREEMPT(0), 0, K_NO_WAIT); - k_sleep(1); + k_msleep(1); /* Call k_thread_foreach() and check * thread_callback is getting called for diff --git a/tests/kernel/threads/thread_apis/src/test_threads_cancel_abort.c b/tests/kernel/threads/thread_apis/src/test_threads_cancel_abort.c index 7ba75a882ab37..358753ea08f0e 100644 --- a/tests/kernel/threads/thread_apis/src/test_threads_cancel_abort.c +++ b/tests/kernel/threads/thread_apis/src/test_threads_cancel_abort.c @@ -16,7 +16,7 @@ K_SEM_DEFINE(sync_sema, 0, 1); static void thread_entry(void *p1, void *p2, void *p3) { execute_flag = 1; - k_sleep(100); + k_msleep(100); execute_flag = 2; } @@ -44,7 +44,7 @@ void test_threads_abort_self(void) execute_flag = 0; k_thread_create(&tdata, tstack, STACK_SIZE, thread_entry_abort, NULL, NULL, NULL, 0, K_USER, K_NO_WAIT); - k_sleep(100); + k_msleep(100); /**TESTPOINT: spawned thread executed but abort itself*/ zassert_true(execute_flag == 1, NULL); } @@ -67,18 +67,18 @@ void test_threads_abort_others(void) 0, K_USER, K_NO_WAIT); k_thread_abort(tid); - k_sleep(100); + k_msleep(100); /**TESTPOINT: check not-started thread is aborted*/ zassert_true(execute_flag == 0, NULL); tid = k_thread_create(&tdata, tstack, STACK_SIZE, thread_entry, NULL, NULL, NULL, 0, K_USER, K_NO_WAIT); - k_sleep(50); + k_msleep(50); k_thread_abort(tid); /**TESTPOINT: check running thread is aborted*/ zassert_true(execute_flag == 1, NULL); - k_sleep(1000); + k_msleep(1000); zassert_true(execute_flag == 1, NULL); } @@ -96,9 +96,9 @@ void test_threads_abort_repeat(void) 0, K_USER, K_NO_WAIT); k_thread_abort(tid); - k_sleep(100); + k_msleep(100); k_thread_abort(tid); - k_sleep(100); + k_msleep(100); k_thread_abort(tid); /* If no fault occurred till now. The test case passed. */ ztest_test_pass(); @@ -119,7 +119,7 @@ static void uthread_entry(void) block = k_malloc(BLOCK_SIZE); zassert_true(block != NULL, NULL); printk("Child thread is running\n"); - k_sleep(2); + k_msleep(2); } /** @@ -137,7 +137,7 @@ void test_abort_handler(void) tdata.fn_abort = &abort_function; - k_sleep(1); + k_msleep(1); abort_called = false; @@ -177,7 +177,7 @@ void test_delayed_thread_abort(void) K_PRIO_PREEMPT(1), 0, K_TIMEOUT_MS(100)); /* Give up CPU */ - k_sleep(50); + k_msleep(50); /* Test point: check if thread delayed for 100ms has not started*/ zassert_true(execute_flag == 0, "Delayed thread created is not" diff --git a/tests/kernel/threads/thread_apis/src/test_threads_spawn.c b/tests/kernel/threads/thread_apis/src/test_threads_spawn.c index 99063c159022d..99da826820b7e 100644 --- a/tests/kernel/threads/thread_apis/src/test_threads_spawn.c +++ b/tests/kernel/threads/thread_apis/src/test_threads_spawn.c @@ -50,7 +50,7 @@ void test_threads_spawn_params(void) k_thread_create(&tdata, tstack, STACK_SIZE, thread_entry_params, tp1, INT_TO_POINTER(tp2), tp3, 0, K_USER, K_NO_WAIT); - k_sleep(100); + k_msleep(100); } /** @@ -68,7 +68,7 @@ void test_threads_spawn_priority(void) spawn_prio = k_thread_priority_get(k_current_get()) - 1; k_thread_create(&tdata, tstack, STACK_SIZE, thread_entry_priority, NULL, NULL, NULL, spawn_prio, K_USER, K_NO_WAIT); - k_sleep(100); + k_msleep(100); } /** @@ -87,11 +87,11 @@ void test_threads_spawn_delay(void) k_thread_create(&tdata, tstack, STACK_SIZE, thread_entry_delay, NULL, NULL, NULL, 0, K_USER, K_TIMEOUT_MS(120)); /* 100 < 120 ensure spawn thread not start */ - k_sleep(100); + k_msleep(100); /* checkpoint: check spawn thread not execute */ zassert_true(tp2 == 10, NULL); /* checkpoint: check spawn thread executed */ - k_sleep(100); + k_msleep(100); zassert_true(tp2 == 100, NULL); } diff --git a/tests/kernel/threads/thread_apis/src/test_threads_suspend_resume.c b/tests/kernel/threads/thread_apis/src/test_threads_suspend_resume.c index 2e309dae57270..b70e7cf8de1b6 100644 --- a/tests/kernel/threads/thread_apis/src/test_threads_suspend_resume.c +++ b/tests/kernel/threads/thread_apis/src/test_threads_suspend_resume.c @@ -29,11 +29,11 @@ static void threads_suspend_resume(int prio) create_prio, K_USER, K_NO_WAIT); /* checkpoint: suspend current thread */ k_thread_suspend(tid); - k_sleep(100); + k_msleep(100); /* checkpoint: created thread shouldn't be executed after suspend */ zassert_false(last_prio == create_prio, NULL); k_thread_resume(tid); - k_sleep(100); + k_msleep(100); /* checkpoint: created thread should be executed after resume */ zassert_true(last_prio == create_prio, NULL); } diff --git a/tests/kernel/tickless/tickless/src/main.c b/tests/kernel/tickless/tickless/src/main.c index 03e3fad9b6a73..c70b27e1e38cd 100644 --- a/tests/kernel/tickless/tickless/src/main.c +++ b/tests/kernel/tickless/tickless/src/main.c @@ -120,13 +120,13 @@ void ticklessTestThread(void) * Do a single tick sleep to get us as close to a tick boundary * as we can. */ - k_sleep(TICKS_TO_MS); + k_msleep(TICKS_TO_MS); start_time = k_uptime_get_32(); start_tsc = _TIMESTAMP_READ(); /* FIXME: one tick less to account for * one extra tick for _TICK_ALIGN in k_sleep */ - k_sleep((SLEEP_TICKS - 1) * TICKS_TO_MS); + k_msleep((SLEEP_TICKS - 1) * TICKS_TO_MS); end_tsc = _TIMESTAMP_READ(); end_time = k_uptime_get_32(); cal_tsc += end_tsc - start_tsc; @@ -155,13 +155,13 @@ void ticklessTestThread(void) * Do a single tick sleep to get us as close to a tick boundary * as we can. */ - k_sleep(TICKS_TO_MS); + k_msleep(TICKS_TO_MS); start_time = k_uptime_get_32(); start_tsc = _TIMESTAMP_READ(); /* FIXME: one tick less to account for * one extra tick for _TICK_ALIGN in k_sleep */ - k_sleep((SLEEP_TICKS - 1) * TICKS_TO_MS); + k_msleep((SLEEP_TICKS - 1) * TICKS_TO_MS); end_tsc = _TIMESTAMP_READ(); end_time = k_uptime_get_32(); diff_tsc += end_tsc - start_tsc; @@ -231,7 +231,7 @@ void test_tickless(void) (k_thread_entry_t) ticklessTestThread, NULL, NULL, NULL, PRIORITY, 0, K_NO_WAIT); - k_sleep(4000); + k_msleep(4000); } /** diff --git a/tests/kernel/tickless/tickless/src/timestamps.c b/tests/kernel/tickless/tickless/src/timestamps.c index db1509a65307e..4152f39bc75fa 100644 --- a/tests/kernel/tickless/tickless/src/timestamps.c +++ b/tests/kernel/tickless/tickless/src/timestamps.c @@ -68,7 +68,7 @@ void _timestamp_open(void) _CLKGATECTRL |= _CLKGATECTRL_TIMESTAMP_EN; /* minimum 3 clk delay is required before timer register access */ - k_sleep(3 * TICKS_TO_MS); + k_msleep(3 * TICKS_TO_MS); _TIMESTAMP_CTRL = 0x0; /* disable/reset timer */ _TIMESTAMP_CFG = 0x0; /* 32-bit timer */ @@ -186,7 +186,7 @@ void _timestamp_open(void) _TIMESTAMP_IMASK = 0x0; /* mask all timer interrupts */ /* minimum 0.3 sec delay required for oscillator stabilization */ - k_sleep(0.3 * MSEC_PER_SEC); + k_msleep(0.3 * MSEC_PER_SEC); /* clear invalid time flag in status register */ _TIMESTAMP_VAL = 0x0; diff --git a/tests/kernel/tickless/tickless_concept/src/main.c b/tests/kernel/tickless/tickless_concept/src/main.c index 924a8dd8c3e91..c45d4e8e71921 100644 --- a/tests/kernel/tickless/tickless_concept/src/main.c +++ b/tests/kernel/tickless/tickless_concept/src/main.c @@ -79,7 +79,7 @@ void test_tickless_sysclock(void) ALIGN_MS_BOUNDARY(); t0 = k_uptime_get_32(); - k_sleep(SLEEP_TICKLESS); + k_msleep(SLEEP_TICKLESS); t1 = k_uptime_get_32(); TC_PRINT("time %d, %d\n", t0, t1); /**TESTPOINT: verify system clock recovery after exiting tickless idle*/ diff --git a/tests/kernel/timer/timer_api/src/main.c b/tests/kernel/timer/timer_api/src/main.c index 8cd5e52eb7755..563a2e5209cce 100644 --- a/tests/kernel/timer/timer_api/src/main.c +++ b/tests/kernel/timer/timer_api/src/main.c @@ -520,7 +520,7 @@ void test_timer_user_data(void) K_NO_WAIT); } - k_sleep(50 * ii + 50); + k_msleep(50 * ii + 50); for (ii = 0; ii < 5; ii++) { k_timer_stop(user_data_timer[ii]); diff --git a/tests/kernel/timer/timer_monotonic/src/main.c b/tests/kernel/timer/timer_monotonic/src/main.c index c7f95dbde7ea7..0ebe67dda4872 100644 --- a/tests/kernel/timer/timer_monotonic/src/main.c +++ b/tests/kernel/timer/timer_monotonic/src/main.c @@ -15,7 +15,7 @@ int test_frequency(void) TC_PRINT("Testing system tick frequency\n"); start = k_cycle_get_32(); - k_sleep(1000); + k_msleep(1000); end = k_cycle_get_32(); delta = end - start; diff --git a/tests/kernel/workq/work_queue/src/main.c b/tests/kernel/workq/work_queue/src/main.c index 694b0f9ec36f0..bce648470dc68 100644 --- a/tests/kernel/workq/work_queue/src/main.c +++ b/tests/kernel/workq/work_queue/src/main.c @@ -51,7 +51,7 @@ static void work_handler(struct k_work *work) struct test_item *ti = CONTAINER_OF(work, struct test_item, work); TC_PRINT(" - Running test item %d\n", ti->key); - k_sleep(WORK_ITEM_WAIT); + k_msleep(WORK_ITEM_WAIT); results[num_results++] = ti->key; } @@ -89,12 +89,12 @@ static void coop_work_main(int arg1, int arg2) ARG_UNUSED(arg2); /* Let the preempt thread submit the first work item. */ - k_sleep(SUBMIT_WAIT / 2); + k_msleep(SUBMIT_WAIT / 2); for (i = 1; i < NUM_TEST_ITEMS; i += 2) { TC_PRINT(" - Submitting work %d from coop thread\n", i + 1); k_work_submit(&tests[i].work.work); - k_sleep(SUBMIT_WAIT); + k_msleep(SUBMIT_WAIT); } } @@ -113,7 +113,7 @@ static void test_items_submit(void) for (i = 0; i < NUM_TEST_ITEMS; i += 2) { TC_PRINT(" - Submitting work %d from preempt thread\n", i + 1); k_work_submit(&tests[i].work.work); - k_sleep(SUBMIT_WAIT); + k_msleep(SUBMIT_WAIT); } } @@ -150,7 +150,7 @@ static void test_sequence(void) test_items_submit(); TC_PRINT(" - Waiting for work to finish\n"); - k_sleep(CHECK_WAIT); + k_msleep(CHECK_WAIT); check_results(NUM_TEST_ITEMS); reset_results(); @@ -162,7 +162,7 @@ static void resubmit_work_handler(struct k_work *work) { struct test_item *ti = CONTAINER_OF(work, struct test_item, work); - k_sleep(WORK_ITEM_WAIT); + k_msleep(WORK_ITEM_WAIT); results[num_results++] = ti->key; @@ -190,7 +190,7 @@ static void test_resubmit(void) k_work_submit(&tests[0].work.work); TC_PRINT(" - Waiting for work to finish\n"); - k_sleep(CHECK_WAIT); + k_msleep(CHECK_WAIT); TC_PRINT(" - Checking results\n"); check_results(NUM_TEST_ITEMS); @@ -231,7 +231,7 @@ static void coop_delayed_work_main(int arg1, int arg2) ARG_UNUSED(arg2); /* Let the preempt thread submit the first work item. */ - k_sleep(SUBMIT_WAIT / 2); + k_msleep(SUBMIT_WAIT / 2); for (i = 1; i < NUM_TEST_ITEMS; i += 2) { TC_PRINT(" - Submitting delayed work %d from" @@ -320,7 +320,7 @@ static void test_delayed_cancel(void) NULL, NULL, NULL, K_HIGHEST_THREAD_PRIO, 0, K_NO_WAIT); TC_PRINT(" - Waiting for work to finish\n"); - k_sleep(WORK_ITEM_WAIT_ALIGNED); + k_msleep(WORK_ITEM_WAIT_ALIGNED); TC_PRINT(" - Checking results\n"); check_results(0); @@ -357,7 +357,7 @@ static void test_delayed_resubmit(void) k_delayed_work_submit(&tests[0].work, K_TIMEOUT_MS(WORK_ITEM_WAIT)); TC_PRINT(" - Waiting for work to finish\n"); - k_sleep(CHECK_WAIT); + k_msleep(CHECK_WAIT); TC_PRINT(" - Checking results\n"); check_results(NUM_TEST_ITEMS); @@ -404,7 +404,7 @@ static void test_delayed_resubmit_thread(void) NULL, NULL, NULL, K_PRIO_COOP(10), 0, K_NO_WAIT); TC_PRINT(" - Waiting for work to finish\n"); - k_sleep(WORK_ITEM_WAIT_ALIGNED); + k_msleep(WORK_ITEM_WAIT_ALIGNED); TC_PRINT(" - Checking results\n"); check_results(1); @@ -429,7 +429,7 @@ static void test_delayed(void) test_delayed_submit(); TC_PRINT(" - Waiting for delayed work to finish\n"); - k_sleep(CHECK_WAIT); + k_msleep(CHECK_WAIT); TC_PRINT(" - Checking results\n"); check_results(NUM_TEST_ITEMS); diff --git a/tests/kernel/workq/work_queue_api/src/main.c b/tests/kernel/workq/work_queue_api/src/main.c index ab89af246bd89..487196dbbe0e5 100644 --- a/tests/kernel/workq/work_queue_api/src/main.c +++ b/tests/kernel/workq/work_queue_api/src/main.c @@ -32,7 +32,7 @@ static struct k_thread *main_thread; static void work_sleepy(struct k_work *w) { - k_sleep(TIMEOUT); + k_msleep(TIMEOUT); k_sem_give(&sync_sema); } @@ -190,7 +190,7 @@ static void tdelayed_work_cancel(void *data) zassert_false(k_work_pending((struct k_work *)&delayed_work[0]), NULL); if (!k_is_in_isr()) { /*wait for handling work_sleepy*/ - k_sleep(TIMEOUT); + k_msleep(TIMEOUT); /**TESTPOINT: check pending when work pending*/ zassert_true(k_work_pending((struct k_work *)&delayed_work[1]), NULL); @@ -199,7 +199,7 @@ static void tdelayed_work_cancel(void *data) zassert_equal(ret, 0, NULL); k_sem_give(&sync_sema); /*wait for completed work_sleepy and delayed_work[1]*/ - k_sleep(TIMEOUT); + k_msleep(TIMEOUT); /**TESTPOINT: check pending when work completed*/ zassert_false(k_work_pending( (struct k_work *)&delayed_work_sleepy), NULL); diff --git a/tests/misc/test_build/src/main.c b/tests/misc/test_build/src/main.c index e090edd40e2b8..7a0e11e8e7fd6 100644 --- a/tests/misc/test_build/src/main.c +++ b/tests/misc/test_build/src/main.c @@ -43,7 +43,7 @@ void helloLoop(const char *my_name, printk("%s: Hello World from %s!\n", my_name, CONFIG_ARCH); /* wait a while, then let other thread have a turn */ - k_sleep(SLEEPTIME); + k_msleep(SLEEPTIME); k_sem_give(other_sem); } } diff --git a/tests/net/context/src/main.c b/tests/net/context/src/main.c index 9b62f208bea79..d29a4f5259ae5 100644 --- a/tests/net/context/src/main.c +++ b/tests/net/context/src/main.c @@ -784,7 +784,7 @@ static void net_ctx_recv_v6_timeout_forever(void) tid = start_timeout_v6_thread(K_FOREVER); /* Wait a bit so that we see if recv waited or not */ - k_sleep(WAIT_TIME); + k_msleep(WAIT_TIME); net_ctx_send_v6(); @@ -810,7 +810,7 @@ static void net_ctx_recv_v4_timeout_forever(void) tid = start_timeout_v4_thread(K_FOREVER); /* Wait a bit so that we see if recv waited or not */ - k_sleep(WAIT_TIME); + k_msleep(WAIT_TIME); net_ctx_send_v4(); diff --git a/tests/net/ipv6/src/main.c b/tests/net/ipv6/src/main.c index 29c9818d2111a..612c2fc5ff4d0 100644 --- a/tests/net/ipv6/src/main.c +++ b/tests/net/ipv6/src/main.c @@ -538,7 +538,7 @@ static void test_prefix_timeout(void) net_if_ipv6_prefix_set_lf(prefix, false); net_if_ipv6_prefix_set_timer(prefix, lifetime); - k_sleep((lifetime * 2U) * MSEC_PER_SEC); + k_msleep((lifetime * 2U) * MSEC_PER_SEC); prefix = net_if_ipv6_prefix_lookup(net_if_get_default(), &addr, len); diff --git a/tests/net/lib/mqtt_publisher/src/test_mqtt_publish.c b/tests/net/lib/mqtt_publisher/src/test_mqtt_publish.c index aa5b00a52b7df..f2e24c080e8e2 100644 --- a/tests/net/lib/mqtt_publisher/src/test_mqtt_publish.c +++ b/tests/net/lib/mqtt_publisher/src/test_mqtt_publish.c @@ -209,7 +209,7 @@ static int try_to_connect(struct mqtt_client *client) rc = mqtt_connect(client); if (rc != 0) { - k_sleep(APP_SLEEP_MSECS); + k_msleep(APP_SLEEP_MSECS); continue; } diff --git a/tests/net/lib/mqtt_pubsub/src/test_mqtt_pubsub.c b/tests/net/lib/mqtt_pubsub/src/test_mqtt_pubsub.c index 90fdd0bcc8347..b8ee7676e1f90 100644 --- a/tests/net/lib/mqtt_pubsub/src/test_mqtt_pubsub.c +++ b/tests/net/lib/mqtt_pubsub/src/test_mqtt_pubsub.c @@ -280,7 +280,7 @@ static int try_to_connect(struct mqtt_client *client) rc = mqtt_connect(client); if (rc != 0) { - k_sleep(APP_SLEEP_MSECS); + k_msleep(APP_SLEEP_MSECS); continue; } diff --git a/tests/net/lib/mqtt_subscriber/src/test_mqtt_subscribe.c b/tests/net/lib/mqtt_subscriber/src/test_mqtt_subscribe.c index b44645cf34ab6..3b99641a4f0b2 100644 --- a/tests/net/lib/mqtt_subscriber/src/test_mqtt_subscribe.c +++ b/tests/net/lib/mqtt_subscriber/src/test_mqtt_subscribe.c @@ -206,7 +206,7 @@ static int try_to_connect(struct mqtt_client *client) rc = mqtt_connect(client); if (rc != 0) { - k_sleep(APP_SLEEP_MSECS); + k_msleep(APP_SLEEP_MSECS); continue; } diff --git a/tests/net/mgmt/src/mgmt.c b/tests/net/mgmt/src/mgmt.c index 89165a944b5fc..7f89bff225ad2 100644 --- a/tests/net/mgmt/src/mgmt.c +++ b/tests/net/mgmt/src/mgmt.c @@ -112,7 +112,7 @@ static void thrower_thread(void) event2throw, throw_times); for (; throw_times; throw_times--) { - k_sleep(throw_sleep); + k_msleep(throw_sleep); if (with_info) { net_mgmt_event_notify_with_info( diff --git a/tests/net/mld/src/main.c b/tests/net/mld/src/main.c index f4ba03d16c4ab..21278b1fcb374 100644 --- a/tests/net/mld/src/main.c +++ b/tests/net/mld/src/main.c @@ -461,7 +461,7 @@ static void test_allnodes(void) net_ipv6_addr_create_ll_allnodes_mcast(&addr); /* Let the DAD succeed so that the multicast address will be there */ - k_sleep(DAD_TIMEOUT); + k_msleep(DAD_TIMEOUT); ifmaddr = net_if_ipv6_maddr_lookup(&addr, &iface); diff --git a/tests/net/socket/tcp/src/main.c b/tests/net/socket/tcp/src/main.c index 72903cb0ee966..92a6ac6a068a8 100644 --- a/tests/net/socket/tcp/src/main.c +++ b/tests/net/socket/tcp/src/main.c @@ -142,7 +142,7 @@ static void test_eof(int sock) zassert_equal(recved, 0, ""); /* Calling when TCP connection is fully torn down should be still OK. */ - k_sleep(TCP_TEARDOWN_TIMEOUT); + k_msleep(TCP_TEARDOWN_TIMEOUT); recved = recv(sock, rx_buf, sizeof(rx_buf), 0); zassert_equal(recved, 0, ""); } @@ -181,7 +181,7 @@ void test_v4_send_recv(void) test_close(new_sock); test_close(s_sock); - k_sleep(TCP_TEARDOWN_TIMEOUT); + k_msleep(TCP_TEARDOWN_TIMEOUT); } void test_v6_send_recv(void) @@ -218,7 +218,7 @@ void test_v6_send_recv(void) test_close(new_sock); test_close(s_sock); - k_sleep(TCP_TEARDOWN_TIMEOUT); + k_msleep(TCP_TEARDOWN_TIMEOUT); } void test_v4_sendto_recvfrom(void) @@ -256,7 +256,7 @@ void test_v4_sendto_recvfrom(void) test_close(s_sock); test_close(c_sock); - k_sleep(TCP_TEARDOWN_TIMEOUT); + k_msleep(TCP_TEARDOWN_TIMEOUT); } void test_v6_sendto_recvfrom(void) @@ -295,7 +295,7 @@ void test_v6_sendto_recvfrom(void) test_close(s_sock); test_close(c_sock); - k_sleep(TCP_TEARDOWN_TIMEOUT); + k_msleep(TCP_TEARDOWN_TIMEOUT); } void test_v4_sendto_recvfrom_null_dest(void) @@ -330,7 +330,7 @@ void test_v4_sendto_recvfrom_null_dest(void) test_close(s_sock); test_close(c_sock); - k_sleep(TCP_TEARDOWN_TIMEOUT); + k_msleep(TCP_TEARDOWN_TIMEOUT); } void test_v6_sendto_recvfrom_null_dest(void) @@ -365,7 +365,7 @@ void test_v6_sendto_recvfrom_null_dest(void) test_close(s_sock); test_close(c_sock); - k_sleep(TCP_TEARDOWN_TIMEOUT); + k_msleep(TCP_TEARDOWN_TIMEOUT); } static void calc_net_context(struct net_context *context, void *user_data) @@ -416,7 +416,7 @@ void test_open_close_immediately(void) "net_context still in use (before %d vs after %d)", count_before - 1, count_after); - k_sleep(TCP_TEARDOWN_TIMEOUT); + k_msleep(TCP_TEARDOWN_TIMEOUT); } void test_v4_accept_timeout(void) @@ -443,7 +443,7 @@ void test_v4_accept_timeout(void) test_close(s_sock); - k_sleep(TCP_TEARDOWN_TIMEOUT); + k_msleep(TCP_TEARDOWN_TIMEOUT); } void test_main(void) diff --git a/tests/posix/common/src/mutex.c b/tests/posix/common/src/mutex.c index 1a96139603a1d..534814164f3c4 100644 --- a/tests/posix/common/src/mutex.c +++ b/tests/posix/common/src/mutex.c @@ -28,7 +28,7 @@ void *normal_mutex_entry(void *p1) if (rc == 0) { break; } - k_sleep(SLEEP_MS); + k_msleep(SLEEP_MS); } zassert_false(rc, "try lock failed"); @@ -102,7 +102,7 @@ void test_posix_normal_mutex(void) if (ret) { TC_PRINT("Thread1 creation failed %d", ret); } - k_sleep(SLEEP_MS); + k_msleep(SLEEP_MS); pthread_mutex_unlock(&mutex1); pthread_join(thread_1, NULL); diff --git a/tests/subsys/settings/fcb_init/src/settings_test_fcb_init.c b/tests/subsys/settings/fcb_init/src/settings_test_fcb_init.c index 43a28c6525892..d6396c65d2003 100644 --- a/tests/subsys/settings/fcb_init/src/settings_test_fcb_init.c +++ b/tests/subsys/settings/fcb_init/src/settings_test_fcb_init.c @@ -136,7 +136,7 @@ void test_init_setup(void) val32 = 1U; err = settings_save(); zassert_true(err == 0, "can't save settings"); - k_sleep(250); + k_msleep(250); sys_reboot(SYS_REBOOT_COLD); } } From 573bfbab7729fe2b7d9a18b84727edd0280e6b3a Mon Sep 17 00:00:00 2001 From: Andy Ross Date: Wed, 25 Sep 2019 13:19:09 -0700 Subject: [PATCH 18/19] kernel/timeout: Make CONFIG_SYS_TIMEOUT_LEGACY_API default There is desire that the legacy mode of the timeout API be the default configuration, so change that value and swap the variable in all the existing tests. Note that no test configuration is changing in this commit, just the default sense of the variable. Signed-off-by: Andy Ross --- kernel/Kconfig | 1 + samples/application_development/code_relocation/prj.conf | 2 ++ samples/application_development/external_lib/prj.conf | 1 + samples/basic/blinky/prj.conf | 2 ++ samples/basic/button/prj.conf | 2 ++ samples/basic/disco/prj.conf | 2 ++ samples/basic/minimal/arm.conf | 2 ++ samples/basic/minimal/common.conf | 2 ++ samples/basic/minimal/mt.conf | 2 ++ samples/basic/minimal/no-mt.conf | 2 ++ samples/basic/minimal/no-preempt.conf | 2 ++ samples/basic/minimal/no-timers.conf | 2 ++ samples/basic/minimal/x86.conf | 2 ++ samples/basic/threads/prj.conf | 1 - samples/bluetooth/beacon/prj.conf | 1 - samples/bluetooth/central/prj.conf | 1 - samples/bluetooth/eddystone/prj.conf | 1 - samples/bluetooth/handsfree/prj.conf | 1 - samples/bluetooth/peripheral/prj.conf | 1 - samples/bluetooth/peripheral_csc/prj.conf | 1 - samples/bluetooth/peripheral_dis/prj.conf | 1 - samples/bluetooth/peripheral_esp/prj.conf | 1 - samples/bluetooth/peripheral_hids/prj.conf | 1 - samples/bluetooth/peripheral_hr/prj.conf | 1 - samples/bluetooth/peripheral_ht/prj.conf | 1 - samples/bluetooth/peripheral_sc_only/prj.conf | 1 - samples/bluetooth/scan_adv/prj.conf | 1 - samples/boards/96b_argonkey/microphone/prj.conf | 1 - samples/boards/96b_argonkey/sensors/prj.conf | 2 ++ samples/boards/altera_max10/pio/prj.conf | 2 ++ samples/boards/arc_secure_services/prj.conf | 1 - samples/boards/bbc_microbit/display/prj.conf | 1 - samples/boards/bbc_microbit/line_follower_robot/prj.conf | 2 ++ samples/boards/bbc_microbit/sound/prj.conf | 1 - samples/boards/nrf52/power_mgr/prj.conf | 1 - samples/boards/nrf52/power_mgr/prj_tickless.conf | 1 - samples/boards/olimex_stm32_e407/ccm/prj.conf | 2 ++ samples/boards/sensortile_box/prj.conf | 2 ++ samples/boards/up_squared/gpio_counter/prj.conf | 1 - samples/cpp_synchronization/prj.conf | 1 - samples/display/cfb/prj.conf | 2 ++ samples/display/cfb_custom_font/prj.conf | 2 ++ samples/display/cfb_shell/prj.conf | 2 ++ samples/display/grove_display/prj.conf | 2 ++ samples/display/ili9340/prj.conf | 2 ++ samples/display/st7789v/prj.conf | 2 ++ samples/drivers/CAN/prj.conf | 1 - samples/drivers/counter/alarm/prj.conf | 1 - samples/drivers/crypto/prj.conf | 1 + samples/drivers/crypto/prj_mtls_shim.conf | 1 + samples/drivers/current_sensing/prj.conf | 2 ++ samples/drivers/entropy/prj.conf | 1 + samples/drivers/flash_shell/prj.conf | 1 - samples/drivers/gpio/prj.conf | 1 - samples/drivers/ht16k33/prj.conf | 1 - samples/drivers/i2c_fujitsu_fram/prj.conf | 2 ++ samples/drivers/i2c_scanner/overlay-nrf52.conf | 2 ++ samples/drivers/i2c_scanner/prj.conf | 2 ++ samples/drivers/lcd_hd44780/prj.conf | 2 ++ samples/drivers/led_apa102/prj.conf | 1 - samples/drivers/led_lp3943/prj.conf | 1 - samples/drivers/led_lp5562/prj.conf | 1 - samples/drivers/led_lpd8806/prj.conf | 1 - samples/drivers/led_pca9633/prj.conf | 1 - samples/drivers/led_ws2812/prj.conf | 1 - samples/drivers/soc_flash_nrf/prj.conf | 2 ++ samples/drivers/spi_fujitsu_fram/prj.conf | 2 ++ samples/drivers/watchdog/nucleo_l496zg.conf | 2 ++ samples/drivers/watchdog/prj.conf | 2 ++ samples/gui/lvgl/prj.conf | 2 ++ samples/hello_world/prj.conf | 1 + samples/mpu/mpu_test/prj.conf | 2 ++ samples/mpu/mpu_test/prj_single.conf | 2 ++ samples/net/dhcpv4_client/overlay-e1000.conf | 1 - samples/net/dhcpv4_client/prj.conf | 1 - samples/net/dns_resolve/prj.conf | 1 - samples/net/eth_native_posix/net_setup_host.conf | 1 - samples/net/eth_native_posix/prj.conf | 1 - samples/net/gptp/prj.conf | 1 - samples/net/ipv4_autoconf/prj.conf | 1 - samples/net/lldp/prj.conf | 1 - samples/net/nats/prj.conf | 1 - samples/net/promiscuous_mode/prj.conf | 1 - samples/net/sockets/echo/prj.conf | 1 - samples/net/sockets/echo_server/overlay-802154.conf | 1 - samples/net/sockets/echo_server/overlay-bt.conf | 1 - samples/net/sockets/echo_server/overlay-cc2520.conf | 1 - samples/net/sockets/echo_server/overlay-e1000.conf | 1 - samples/net/sockets/echo_server/overlay-netusb.conf | 1 - samples/net/sockets/echo_server/overlay-ot.conf | 1 - samples/net/sockets/echo_server/overlay-qemu_802154.conf | 1 - .../net/sockets/echo_server/overlay-qemu_cortex_m3_eth.conf | 1 - samples/net/sockets/echo_server/overlay-smsc911x.conf | 1 - samples/net/sockets/echo_server/overlay-tls.conf | 1 - samples/net/sockets/echo_server/overlay-vlan.conf | 1 - samples/net/sockets/echo_server/prj.conf | 2 -- samples/net/sockets/net_mgmt/prj.conf | 1 - samples/net/sockets/packet/prj.conf | 1 - samples/net/stats/prj.conf | 1 - samples/net/syslog_net/prj.conf | 1 - samples/net/telnet/prj.conf | 1 - samples/net/vlan/prj.conf | 1 - samples/nfc/nfc_hello/prj.conf | 2 ++ samples/philosophers/prj.conf | 1 + samples/philosophers/prj_tickless.conf | 2 +- samples/portability/cmsis_rtos_v1/philosophers/prj.conf | 1 - .../portability/cmsis_rtos_v1/timer_synchronization/prj.conf | 1 - samples/portability/cmsis_rtos_v2/philosophers/prj.conf | 1 - .../portability/cmsis_rtos_v2/timer_synchronization/prj.conf | 1 - samples/sensor/adt7420/prj.conf | 2 ++ samples/sensor/adxl372/prj.conf | 2 ++ samples/sensor/adxl372/prj_i2c.conf | 2 ++ samples/sensor/amg88xx/prj.conf | 2 ++ samples/sensor/ams_iAQcore/prj.conf | 2 ++ samples/sensor/apds9960/prj.conf | 2 ++ samples/sensor/bmg160/prj.conf | 2 ++ samples/sensor/bmm150/prj.conf | 2 ++ samples/sensor/ccs811/prj.conf | 2 ++ samples/sensor/ens210/prj.conf | 2 ++ samples/sensor/fxas21002/prj.conf | 1 - samples/sensor/fxos8700-hid/prj.conf | 1 - samples/sensor/fxos8700/overlay-motion.conf | 1 - samples/sensor/fxos8700/prj.conf | 1 - samples/sensor/fxos8700/prj_accel.conf | 1 - samples/sensor/grove_light/prj.conf | 1 - samples/sensor/grove_temperature/prj.conf | 1 - samples/sensor/magn_polling/prj.conf | 2 ++ samples/sensor/max30101/prj.conf | 2 ++ samples/sensor/max44009/prj.conf | 2 ++ samples/sensor/mcp9808/prj.conf | 2 ++ samples/sensor/ms5837/prj.conf | 2 ++ samples/sensor/sht3xd/prj.conf | 2 ++ samples/sensor/sht3xd/trigger.conf | 2 ++ samples/sensor/sx9500/prj.conf | 2 ++ samples/sensor/th02/prj.conf | 2 ++ samples/sensor/thermometer/prj.conf | 1 + samples/sensor/ti_hdc/prj.conf | 1 - samples/sensor/tmp112/prj.conf | 2 ++ samples/shields/x_nucleo_iks01a1/prj.conf | 2 ++ samples/shields/x_nucleo_iks01a2/prj.conf | 2 ++ samples/shields/x_nucleo_iks01a3/sensorhub/shub.conf | 2 ++ samples/shields/x_nucleo_iks01a3/standard/prj.conf | 2 ++ samples/subsys/console/echo/prj.conf | 1 - samples/subsys/console/getchar/prj.conf | 1 - samples/subsys/console/getline/prj.conf | 2 ++ samples/subsys/fs/fat_fs/prj.conf | 1 - samples/subsys/fs/fat_fs/prj_mimxrt1050_evk.conf | 1 - samples/subsys/fs/littlefs/prj.conf | 2 ++ samples/subsys/ipc/ipm_mhu_dual_core/prj.conf | 2 ++ samples/subsys/ipc/openamp/prj.conf | 1 - samples/subsys/logging/logger/prj.conf | 1 + samples/subsys/nvs/prj.conf | 2 ++ samples/subsys/power/device_pm/prj.conf | 2 ++ samples/subsys/shell/fs/prj.conf | 2 ++ samples/subsys/shell/shell_module/prj.conf | 1 - samples/subsys/shell/shell_module/prj_minimal.conf | 1 - samples/subsys/shell/shell_module/prj_minimal_rtt.conf | 1 - samples/subsys/usb/cdc_acm/overlay-composite-cdc-dfu.conf | 2 -- samples/subsys/usb/cdc_acm/overlay-composite-cdc-msc.conf | 2 -- samples/subsys/usb/cdc_acm/prj.conf | 2 -- samples/subsys/usb/cdc_acm_composite/prj.conf | 1 - samples/subsys/usb/console/prj.conf | 1 - samples/subsys/usb/dfu/prj.conf | 2 ++ samples/subsys/usb/hid-cdc/prj.conf | 1 - samples/subsys/usb/hid-mouse/prj.conf | 1 - samples/subsys/usb/hid/prj.conf | 2 -- samples/subsys/usb/mass/overlay-flash-disk.conf | 1 - samples/subsys/usb/mass/overlay-ram-disk.conf | 1 - samples/subsys/usb/mass/prj.conf | 1 - samples/subsys/usb/mass/prj_nrf52840_pca10056.conf | 1 - samples/subsys/usb/testusb/prj.conf | 1 - samples/subsys/usb/webusb/prj.conf | 1 - samples/synchronization/prj.conf | 1 - samples/testing/integration/prj.conf | 1 + samples/userspace/shared_mem/prj.conf | 2 ++ tests/application_development/cpp/prj.conf | 1 - tests/application_development/gen_inc_file/prj.conf | 1 + tests/application_development/libcxx/prj.conf | 2 ++ tests/arch/arm/arm_irq_vector_table/prj.conf | 2 ++ tests/arch/arm/arm_ramfunc/prj.conf | 2 ++ tests/arch/arm/arm_runtime_nmi/prj.conf | 2 +- tests/arch/arm/arm_thread_swap/prj.conf | 2 ++ tests/arch/arm/arm_zero_latency_irqs/prj.conf | 2 ++ tests/arch/x86/static_idt/prj.conf | 2 ++ tests/benchmarks/app_kernel/prj.conf | 1 - tests/benchmarks/app_kernel/prj_fp.conf | 1 - tests/benchmarks/boot_time/prj.conf | 1 + tests/benchmarks/latency_measure/prj.conf | 1 - tests/benchmarks/mbedtls/prj.conf | 2 ++ tests/benchmarks/sys_kernel/prj.conf | 1 - tests/benchmarks/timing_info/prj_userspace.conf | 1 - tests/bluetooth/at/prj.conf | 1 - tests/bluetooth/bluetooth/prj.conf | 1 - tests/bluetooth/ctrl_user_ext/prj.conf | 2 ++ tests/bluetooth/gatt/prj.conf | 1 - tests/bluetooth/hci_prop_evt/prj.conf | 1 - tests/bluetooth/init/prj.conf | 1 - tests/bluetooth/init/prj_0.conf | 1 - tests/bluetooth/init/prj_1.conf | 1 - tests/bluetooth/init/prj_10.conf | 1 - tests/bluetooth/init/prj_11.conf | 1 - tests/bluetooth/init/prj_12.conf | 1 - tests/bluetooth/init/prj_13.conf | 1 - tests/bluetooth/init/prj_14.conf | 1 - tests/bluetooth/init/prj_15.conf | 1 - tests/bluetooth/init/prj_16.conf | 1 - tests/bluetooth/init/prj_17.conf | 1 - tests/bluetooth/init/prj_18.conf | 1 - tests/bluetooth/init/prj_19.conf | 1 - tests/bluetooth/init/prj_2.conf | 1 - tests/bluetooth/init/prj_20.conf | 1 - tests/bluetooth/init/prj_21.conf | 1 - tests/bluetooth/init/prj_22.conf | 1 - tests/bluetooth/init/prj_3.conf | 1 - tests/bluetooth/init/prj_4.conf | 1 - tests/bluetooth/init/prj_5.conf | 1 - tests/bluetooth/init/prj_6.conf | 1 - tests/bluetooth/init/prj_7.conf | 1 - tests/bluetooth/init/prj_8.conf | 1 - tests/bluetooth/init/prj_9.conf | 1 - tests/bluetooth/init/prj_controller.conf | 1 - tests/bluetooth/init/prj_controller_4_0.conf | 1 - tests/bluetooth/init/prj_controller_4_0_ll_sw_split.conf | 1 - tests/bluetooth/init/prj_controller_dbg.conf | 1 - tests/bluetooth/init/prj_controller_dbg_ll_sw_split.conf | 1 - tests/bluetooth/init/prj_controller_ll_sw_split.conf | 1 - tests/bluetooth/init/prj_controller_tiny.conf | 1 - tests/bluetooth/init/prj_controller_tiny_ll_sw_split.conf | 1 - tests/bluetooth/init/prj_h5.conf | 1 - tests/bluetooth/init/prj_h5_dbg.conf | 1 - tests/bluetooth/l2cap/prj.conf | 1 - tests/bluetooth/ll_settings/prj.conf | 2 ++ tests/bluetooth/mesh_shell/prj.conf | 1 - tests/bluetooth/shell/mesh.conf | 1 - tests/bluetooth/shell/prj.conf | 1 - tests/bluetooth/shell/prj_br.conf | 1 - tests/bluetooth/uuid/prj.conf | 1 - tests/boards/altera_max10/i2c_master/prj.conf | 2 ++ tests/boards/altera_max10/msgdma/prj.conf | 2 ++ tests/boards/altera_max10/qspi/prj.conf | 2 ++ tests/boards/altera_max10/sysid/prj.conf | 2 ++ tests/boards/native_posix/native_tasks/prj.conf | 1 + tests/crypto/mbedtls/prj.conf | 1 + tests/crypto/rand32/prj.conf | 1 + tests/crypto/rand32/prj_hw_random_xoroshiro.conf | 1 + tests/crypto/rand32/prj_sw_random_systimer.conf | 1 + tests/crypto/tinycrypt/prj.conf | 1 + tests/crypto/tinycrypt_hmac_prng/prj.conf | 1 + tests/drivers/adc/adc_api/prj.conf | 1 - tests/drivers/build_all/drivers.conf | 5 ----- tests/drivers/build_all/ethernet.conf | 5 ----- tests/drivers/build_all/gpio.conf | 5 ----- tests/drivers/build_all/prj.conf | 5 ----- tests/drivers/build_all/sensors_a_h.conf | 5 ----- tests/drivers/build_all/sensors_i_z.conf | 5 ----- tests/drivers/build_all/sensors_stmemsc.conf | 5 ----- tests/drivers/build_all/sensors_stmemsc_trigger.conf | 5 ----- tests/drivers/build_all/sensors_trigger_a_h.conf | 5 ----- tests/drivers/build_all/sensors_trigger_i_z.conf | 5 ----- tests/drivers/can/api/prj.conf | 1 - tests/drivers/can/stm32/prj.conf | 1 - tests/drivers/counter/counter_basic_api/prj.conf | 2 ++ tests/drivers/counter/counter_cmos/prj.conf | 2 ++ tests/drivers/entropy/api/prj.conf | 1 + tests/drivers/flash_simulator/prj.conf | 2 ++ tests/drivers/hwinfo/api/prj.conf | 2 ++ tests/drivers/i2c/i2c_api/prj.conf | 2 ++ tests/drivers/i2c/i2c_slave_api/prj.conf | 2 ++ tests/drivers/ipm/prj.conf | 1 - tests/drivers/pwm/pwm_api/prj.conf | 2 ++ tests/drivers/spi/spi_loopback/prj.conf | 1 - tests/drivers/uart/uart_async_api/prj.conf | 1 - tests/drivers/uart/uart_basic_api/prj.conf | 1 - tests/drivers/uart/uart_basic_api/prj_poll.conf | 1 - tests/drivers/uart/uart_basic_api/prj_shell.conf | 1 - tests/drivers/watchdog/wdt_basic_api/nucleo_l496zg.conf | 2 ++ tests/drivers/watchdog/wdt_basic_api/prj.conf | 2 ++ tests/kernel/boot_page_table/prj.conf | 2 ++ tests/kernel/common/prj.conf | 1 + tests/kernel/context/prj.conf | 1 + tests/kernel/critical/prj.conf | 1 + tests/kernel/device/prj.conf | 1 + tests/kernel/early_sleep/prj.conf | 1 + tests/kernel/fatal/prj.conf | 1 + tests/kernel/fatal/prj_arm_fp_sharing.conf | 1 + tests/kernel/fatal/prj_armv8m_mpu_stack_guard.conf | 1 + tests/kernel/fatal/protection_no_userspace.conf | 1 + tests/kernel/fatal/sentinel.conf | 1 + tests/kernel/fifo/fifo_api/prj.conf | 1 + tests/kernel/fifo/fifo_api/prj_poll.conf | 1 + tests/kernel/fifo/fifo_timeout/prj.conf | 1 + tests/kernel/fifo/fifo_timeout/prj_poll.conf | 1 + tests/kernel/fifo/fifo_usage/prj.conf | 1 + tests/kernel/fifo/fifo_usage/prj_poll.conf | 1 + tests/kernel/fp_sharing/float_disable/prj.conf | 2 ++ tests/kernel/fp_sharing/float_disable/prj_x86.conf | 2 ++ tests/kernel/gen_isr_table/prj.conf | 2 ++ tests/kernel/interrupt/prj.conf | 1 + tests/kernel/lifo/lifo_api/prj.conf | 1 + tests/kernel/lifo/lifo_usage/prj.conf | 1 + tests/kernel/mbox/mbox_api/prj.conf | 1 + tests/kernel/mbox/mbox_usage/prj.conf | 1 + tests/kernel/mem_heap/mheap_api_concept/prj.conf | 1 + tests/kernel/mem_pool/mem_pool/prj.conf | 1 + tests/kernel/mem_pool/mem_pool_api/prj.conf | 1 + tests/kernel/mem_pool/mem_pool_concept/prj.conf | 1 + tests/kernel/mem_pool/mem_pool_threadsafe/prj.conf | 1 + tests/kernel/mem_pool/sys_mem_pool/prj.conf | 1 + tests/kernel/mem_protect/futex/prj.conf | 2 ++ tests/kernel/mem_protect/mem_protect/prj.conf | 2 ++ tests/kernel/mem_protect/obj_validation/prj.conf | 2 ++ tests/kernel/mem_protect/protection/prj.conf | 2 ++ tests/kernel/mem_protect/stack_random/prj.conf | 1 + tests/kernel/mem_protect/stackprot/prj.conf | 2 ++ tests/kernel/mem_protect/sys_sem/prj.conf | 1 + tests/kernel/mem_protect/syscalls/prj.conf | 2 ++ tests/kernel/mem_protect/userspace/prj.conf | 2 ++ tests/kernel/mem_protect/x86_mmu_api/prj.conf | 2 ++ tests/kernel/mem_slab/mslab/prj.conf | 1 + tests/kernel/mem_slab/mslab_api/prj.conf | 1 + tests/kernel/mem_slab/mslab_concept/prj.conf | 1 + tests/kernel/mem_slab/mslab_threadsafe/prj.conf | 1 + tests/kernel/mp/prj.conf | 1 + tests/kernel/msgq/msgq_api/prj.conf | 1 + tests/kernel/mutex/mutex_api/prj.conf | 1 + tests/kernel/mutex/sys_mutex/prj.conf | 1 + tests/kernel/obj_tracing/prj.conf | 1 + tests/kernel/pending/prj.conf | 1 + tests/kernel/pipe/pipe/prj.conf | 1 + tests/kernel/pipe/pipe_api/prj.conf | 1 + tests/kernel/poll/prj.conf | 1 + tests/kernel/profiling/profiling_api/prj.conf | 1 + tests/kernel/queue/prj.conf | 1 + tests/kernel/queue/prj_poll.conf | 1 + tests/kernel/sched/deadline/prj.conf | 1 + tests/kernel/sched/preempt/prj.conf | 1 + tests/kernel/sched/schedule_api/prj.conf | 1 + tests/kernel/sched/schedule_api/prj_multiq.conf | 1 + tests/kernel/semaphore/sema_api/prj.conf | 1 + tests/kernel/semaphore/semaphore/prj.conf | 1 + tests/kernel/sleep/prj.conf | 3 ++- tests/kernel/smp/prj.conf | 2 ++ tests/kernel/spinlock/prj.conf | 1 + tests/kernel/stack/stack_api/prj.conf | 1 + tests/kernel/stack/stack_usage/prj.conf | 1 + tests/kernel/threads/dynamic_thread/prj.conf | 2 ++ tests/kernel/threads/no-multithreading/prj.conf | 1 + tests/kernel/threads/thread_apis/prj.conf | 1 + tests/kernel/threads/thread_init/prj.conf | 1 + tests/kernel/tickless/tickless/prj.conf | 3 ++- tests/kernel/tickless/tickless_concept/prj.conf | 1 + tests/kernel/timer/timer_api/prj.conf | 2 ++ tests/kernel/timer/timer_api/prj_tickless.conf | 2 ++ tests/kernel/timer/timer_monotonic/prj.conf | 1 + tests/kernel/workq/work_queue/prj.conf | 1 + tests/kernel/workq/work_queue_api/prj.conf | 1 + tests/kernel/xip/prj.conf | 2 ++ tests/lib/c_lib/prj.conf | 3 ++- tests/lib/fdtable/prj.conf | 1 - tests/lib/gui/lvgl/prj.conf | 1 + tests/lib/json/prj.conf | 1 + tests/lib/mem_alloc/prj.conf | 2 ++ tests/lib/mem_alloc/prj_newlib.conf | 2 ++ tests/lib/mem_alloc/prj_newlibnano.conf | 2 ++ tests/lib/ringbuffer/prj.conf | 1 + tests/lib/sprintf/prj.conf | 1 + tests/lib/timeutil/prj.conf | 1 + tests/misc/test_build/debug.conf | 1 - tests/misc/test_build/prj.conf | 1 + tests/net/6lo/prj.conf | 1 - tests/net/arp/prj.conf | 1 - tests/net/buf/prj.conf | 1 - tests/net/checksum_offload/prj.conf | 1 - tests/net/context/prj.conf | 1 - tests/net/dhcpv4/prj.conf | 1 - tests/net/ethernet_mgmt/prj.conf | 1 - tests/net/icmpv6/prj.conf | 1 - tests/net/iface/prj.conf | 1 - tests/net/ip-addr/prj.conf | 1 - tests/net/ipv6/prj.conf | 1 - tests/net/ipv6_fragment/prj.conf | 1 - tests/net/lib/coap/prj.conf | 1 - tests/net/lib/dns_addremove/prj.conf | 1 - tests/net/lib/dns_packet/prj.conf | 1 - tests/net/lib/dns_resolve/prj-no-ipv6.conf | 1 - tests/net/lib/dns_resolve/prj.conf | 1 - tests/net/lib/http_header_fields/prj.conf | 1 - tests/net/lib/mqtt_packet/prj.conf | 1 - tests/net/lib/mqtt_publisher/prj.conf | 1 - tests/net/lib/mqtt_publisher/prj_tls.conf | 1 - tests/net/lib/mqtt_pubsub/prj.conf | 1 - tests/net/lib/mqtt_subscriber/prj.conf | 1 - tests/net/lib/tls_credentials/prj.conf | 1 - tests/net/mgmt/prj.conf | 1 - tests/net/mld/prj.conf | 1 - tests/net/neighbor/prj.conf | 1 - tests/net/net_pkt/prj.conf | 1 - tests/net/promiscuous/prj.conf | 1 - tests/net/ptp/clock/prj.conf | 1 - tests/net/route/prj.conf | 1 - tests/net/socket/getaddrinfo/prj.conf | 1 - tests/net/socket/getnameinfo/prj.conf | 1 - tests/net/socket/misc/prj.conf | 1 - tests/net/socket/net_mgmt/prj.conf | 1 - tests/net/socket/poll/prj.conf | 1 - tests/net/socket/register/prj.conf | 1 - tests/net/socket/select/prj.conf | 1 - tests/net/socket/tcp/prj.conf | 1 - tests/net/socket/udp/prj.conf | 1 - tests/net/tcp/prj.conf | 1 - tests/net/traffic_class/prj.conf | 1 - tests/net/trickle/prj.conf | 1 - tests/net/tx_timestamp/prj.conf | 1 - tests/net/udp/prj.conf | 1 - tests/net/utils/prj.conf | 1 - tests/net/vlan/prj.conf | 1 - tests/portability/cmsis_rtos_v1/prj.conf | 1 - tests/portability/cmsis_rtos_v2/prj.conf | 1 - tests/posix/common/prj.conf | 1 - tests/posix/fs/prj.conf | 1 - tests/shell/prj.conf | 1 - tests/subsys/can/frame/prj.conf | 1 + tests/subsys/dfu/img_util/prj.conf | 1 + tests/subsys/dfu/img_util/prj_native_posix.conf | 1 + tests/subsys/dfu/img_util/prj_native_posix_64.conf | 1 + tests/subsys/dfu/mcuboot/prj.conf | 1 + tests/subsys/dfu/mcuboot/prj_native_posix.conf | 1 + tests/subsys/dfu/mcuboot/prj_native_posix_64.conf | 1 + tests/subsys/fs/fat_fs_api/prj.conf | 1 + tests/subsys/fs/fat_fs_api/prj_native_posix.conf | 1 + tests/subsys/fs/fat_fs_api/prj_native_posix_64.conf | 1 + tests/subsys/fs/fat_fs_dual_drive/prj.conf | 2 ++ tests/subsys/fs/fcb/prj.conf | 1 + tests/subsys/fs/fcb/prj_native_posix.conf | 1 + tests/subsys/fs/fcb/prj_native_posix_64.conf | 1 + tests/subsys/fs/littlefs/prj.conf | 1 - tests/subsys/fs/multi-fs/prj.conf | 2 ++ tests/subsys/fs/multi-fs/prj_fs_shell.conf | 2 ++ tests/subsys/fs/nffs_fs_api/basic/nrf5x.conf | 2 ++ tests/subsys/fs/nffs_fs_api/basic/prj.conf | 2 ++ tests/subsys/fs/nffs_fs_api/cache/nrf5x.conf | 2 ++ tests/subsys/fs/nffs_fs_api/cache/prj.conf | 2 ++ tests/subsys/fs/nffs_fs_api/large/nrf5x.conf | 2 ++ tests/subsys/fs/nffs_fs_api/large/prj.conf | 2 ++ tests/subsys/fs/nffs_fs_api/performance/nrf5x.conf | 2 ++ tests/subsys/fs/nffs_fs_api/performance/prj.conf | 2 ++ tests/subsys/fs/nvs/prj.conf | 2 ++ tests/subsys/jwt/prj.conf | 1 - tests/subsys/logging/log_core/prj.conf | 2 ++ tests/subsys/logging/log_list/prj.conf | 1 + tests/subsys/logging/log_msg/prj.conf | 1 + tests/subsys/logging/log_output/prj.conf | 1 + tests/subsys/settings/fcb/base64/prj.conf | 1 + tests/subsys/settings/fcb/base64/prj_native_posix.conf | 1 + tests/subsys/settings/fcb/base64/prj_native_posix_64.conf | 1 + tests/subsys/settings/fcb/raw/prj.conf | 1 + tests/subsys/settings/fcb/raw/prj_native_posix.conf | 1 + tests/subsys/settings/fcb/raw/prj_native_posix_64.conf | 1 + tests/subsys/settings/fcb_init/prj.conf | 2 ++ tests/subsys/settings/functional/fcb/prj.conf | 1 + tests/subsys/settings/functional/fcb/prj_native_posix.conf | 1 + .../subsys/settings/functional/fcb/prj_native_posix_64.conf | 1 + tests/subsys/settings/functional/fcb/prj_qemu_x86.conf | 1 + tests/subsys/settings/functional/nvs/prj.conf | 2 ++ tests/subsys/settings/functional/nvs/prj_qemu_x86.conf | 2 ++ tests/subsys/settings/nffs/base64/prj.conf | 1 + tests/subsys/settings/nffs/base64/prj_native_posix.conf | 1 + tests/subsys/settings/nffs/base64/prj_native_posix_64.conf | 1 + tests/subsys/settings/nffs/raw/prj.conf | 1 + tests/subsys/settings/nffs/raw/prj_native_posix.conf | 1 + tests/subsys/settings/nffs/raw/prj_native_posix_64.conf | 1 + tests/subsys/shell/shell_history/prj.conf | 1 - tests/subsys/storage/flash_map/overlay-mpu.conf | 1 + tests/subsys/storage/flash_map/prj.conf | 1 + tests/subsys/storage/flash_map/prj_native_posix.conf | 1 + tests/subsys/storage/flash_map/prj_native_posix_64.conf | 1 + tests/subsys/usb/bos/prj.conf | 1 - tests/subsys/usb/desc_sections/prj.conf | 1 - tests/subsys/usb/device/prj.conf | 1 - tests/subsys/usb/os_desc/prj.conf | 1 - tests/ztest/base/prj_verbose_0.conf | 1 + tests/ztest/base/prj_verbose_1.conf | 1 + tests/ztest/base/prj_verbose_2.conf | 1 + tests/ztest/custom_output/prj.conf | 1 + tests/ztest/custom_output/prj_customized_output.conf | 1 + tests/ztest/mock/prj.conf | 1 + 486 files changed, 387 insertions(+), 277 deletions(-) create mode 100644 tests/misc/test_build/prj.conf diff --git a/kernel/Kconfig b/kernel/Kconfig index ec0fa00f41f56..5666c214318b6 100644 --- a/kernel/Kconfig +++ b/kernel/Kconfig @@ -591,6 +591,7 @@ config SYS_TIMEOUT_64BIT config SYS_TIMEOUT_LEGACY_API bool "Enable old millisecond timeout API" + default y depends on !SYS_TIMEOUT_64BIT help When enabled, k_timeout_t values passed to kernel APIs are diff --git a/samples/application_development/code_relocation/prj.conf b/samples/application_development/code_relocation/prj.conf index 0c2e455f30c64..082a98c215d4d 100644 --- a/samples/application_development/code_relocation/prj.conf +++ b/samples/application_development/code_relocation/prj.conf @@ -2,3 +2,5 @@ CONFIG_CODE_DATA_RELOCATION=y CONFIG_HAVE_CUSTOM_LINKER_SCRIPT=y CONFIG_CUSTOM_LINKER_SCRIPT="linker_arm_sram2.ld" CONFIG_COVERAGE=n + +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/samples/application_development/external_lib/prj.conf b/samples/application_development/external_lib/prj.conf index 8b042db540686..1067d295ab3a0 100644 --- a/samples/application_development/external_lib/prj.conf +++ b/samples/application_development/external_lib/prj.conf @@ -1 +1,2 @@ CONFIG_STDOUT_CONSOLE=y +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/samples/basic/blinky/prj.conf b/samples/basic/blinky/prj.conf index 7bbd5afcc29c4..2636408f24c44 100644 --- a/samples/basic/blinky/prj.conf +++ b/samples/basic/blinky/prj.conf @@ -1,2 +1,4 @@ CONFIG_GPIO=y CONFIG_SERIAL=n + +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/samples/basic/button/prj.conf b/samples/basic/button/prj.conf index 91c3c15b37d1e..4be8a418c4e02 100644 --- a/samples/basic/button/prj.conf +++ b/samples/basic/button/prj.conf @@ -1 +1,3 @@ CONFIG_GPIO=y + +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/samples/basic/disco/prj.conf b/samples/basic/disco/prj.conf index 91c3c15b37d1e..4be8a418c4e02 100644 --- a/samples/basic/disco/prj.conf +++ b/samples/basic/disco/prj.conf @@ -1 +1,3 @@ CONFIG_GPIO=y + +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/samples/basic/minimal/arm.conf b/samples/basic/minimal/arm.conf index b695c18ab28d5..81d82e01dd777 100644 --- a/samples/basic/minimal/arm.conf +++ b/samples/basic/minimal/arm.conf @@ -1 +1,3 @@ CONFIG_ARM_MPU=n + +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/samples/basic/minimal/common.conf b/samples/basic/minimal/common.conf index 7473dc4579979..d75f73b5bd348 100644 --- a/samples/basic/minimal/common.conf +++ b/samples/basic/minimal/common.conf @@ -33,3 +33,5 @@ CONFIG_EARLY_CONSOLE=n # Build CONFIG_SIZE_OPTIMIZATIONS=y + +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/samples/basic/minimal/mt.conf b/samples/basic/minimal/mt.conf index d9cea53036598..5a8bebcf0b4e9 100644 --- a/samples/basic/minimal/mt.conf +++ b/samples/basic/minimal/mt.conf @@ -6,3 +6,5 @@ CONFIG_ERRNO=n CONFIG_SCHED_DUMB=y CONFIG_WAITQ_DUMB=y + +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/samples/basic/minimal/no-mt.conf b/samples/basic/minimal/no-mt.conf index 312b3906c8de8..533d0a41f9c35 100644 --- a/samples/basic/minimal/no-mt.conf +++ b/samples/basic/minimal/no-mt.conf @@ -1,3 +1,5 @@ # Single-threaded, no timer support in the kernel CONFIG_MULTITHREADING=n + +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/samples/basic/minimal/no-preempt.conf b/samples/basic/minimal/no-preempt.conf index 4319a2a8ba4cc..6656193340445 100644 --- a/samples/basic/minimal/no-preempt.conf +++ b/samples/basic/minimal/no-preempt.conf @@ -1 +1,3 @@ CONFIG_NUM_PREEMPT_PRIORITIES=0 + +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/samples/basic/minimal/no-timers.conf b/samples/basic/minimal/no-timers.conf index 961178ee05c70..275c1d8d32d12 100644 --- a/samples/basic/minimal/no-timers.conf +++ b/samples/basic/minimal/no-timers.conf @@ -1,2 +1,4 @@ # No timer support in the kernel CONFIG_SYS_CLOCK_EXISTS=n + +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/samples/basic/minimal/x86.conf b/samples/basic/minimal/x86.conf index 9f31dfe6c42d4..daebeb11defec 100644 --- a/samples/basic/minimal/x86.conf +++ b/samples/basic/minimal/x86.conf @@ -1 +1,3 @@ CONFIG_X86_MMU=n + +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/samples/basic/threads/prj.conf b/samples/basic/threads/prj.conf index f7902a91f7162..1848bb85d7fa1 100644 --- a/samples/basic/threads/prj.conf +++ b/samples/basic/threads/prj.conf @@ -2,4 +2,3 @@ CONFIG_PRINTK=y CONFIG_HEAP_MEM_POOL_SIZE=256 CONFIG_ASSERT=y CONFIG_GPIO=y -CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/samples/bluetooth/beacon/prj.conf b/samples/bluetooth/beacon/prj.conf index 325c40c069d67..1d6745c7942bb 100644 --- a/samples/bluetooth/beacon/prj.conf +++ b/samples/bluetooth/beacon/prj.conf @@ -1,4 +1,3 @@ CONFIG_BT=y CONFIG_BT_DEBUG_LOG=y CONFIG_BT_DEVICE_NAME="Test beacon" -CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/samples/bluetooth/central/prj.conf b/samples/bluetooth/central/prj.conf index a076b8b950c40..3e36a9993858f 100644 --- a/samples/bluetooth/central/prj.conf +++ b/samples/bluetooth/central/prj.conf @@ -1,3 +1,2 @@ CONFIG_BT=y CONFIG_BT_CENTRAL=y -CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/samples/bluetooth/eddystone/prj.conf b/samples/bluetooth/eddystone/prj.conf index e9a8dbd826978..2ae4f32a0f20b 100644 --- a/samples/bluetooth/eddystone/prj.conf +++ b/samples/bluetooth/eddystone/prj.conf @@ -2,4 +2,3 @@ CONFIG_BT=y CONFIG_BT_DEBUG_LOG=y CONFIG_BT_PERIPHERAL=y CONFIG_BT_DEVICE_NAME="Zephyr Eddystone" -CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/samples/bluetooth/handsfree/prj.conf b/samples/bluetooth/handsfree/prj.conf index 0d19d79bb78e4..ce7e742f10b89 100644 --- a/samples/bluetooth/handsfree/prj.conf +++ b/samples/bluetooth/handsfree/prj.conf @@ -4,4 +4,3 @@ CONFIG_BT_RFCOMM=y CONFIG_BT_HFP_HF=y CONFIG_BT_PERIPHERAL=y CONFIG_BT_DEVICE_NAME="test-Handsfree" -CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/samples/bluetooth/peripheral/prj.conf b/samples/bluetooth/peripheral/prj.conf index 1d9a6c4056975..9c3d5385ea355 100644 --- a/samples/bluetooth/peripheral/prj.conf +++ b/samples/bluetooth/peripheral/prj.conf @@ -23,4 +23,3 @@ CONFIG_FLASH_MAP=y CONFIG_FCB=y CONFIG_SETTINGS=y CONFIG_SETTINGS_FCB=y -CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/samples/bluetooth/peripheral_csc/prj.conf b/samples/bluetooth/peripheral_csc/prj.conf index 602d5a2cbb37f..aa6ca4a3af5ae 100644 --- a/samples/bluetooth/peripheral_csc/prj.conf +++ b/samples/bluetooth/peripheral_csc/prj.conf @@ -7,4 +7,3 @@ CONFIG_BT_GATT_DIS_PNP=n CONFIG_BT_GATT_BAS=y CONFIG_BT_DEVICE_NAME="CSC peripheral" CONFIG_BT_DEVICE_APPEARANCE=1157 -CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/samples/bluetooth/peripheral_dis/prj.conf b/samples/bluetooth/peripheral_dis/prj.conf index 57779b81a9c92..137471d8f9723 100644 --- a/samples/bluetooth/peripheral_dis/prj.conf +++ b/samples/bluetooth/peripheral_dis/prj.conf @@ -24,4 +24,3 @@ CONFIG_BT_SETTINGS=y CONFIG_BT_GATT_DIS_SETTINGS=y CONFIG_BT_GATT_DIS_STR_MAX=21 -CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/samples/bluetooth/peripheral_esp/prj.conf b/samples/bluetooth/peripheral_esp/prj.conf index 23bda186a8d9d..4c0306c3d2e2f 100644 --- a/samples/bluetooth/peripheral_esp/prj.conf +++ b/samples/bluetooth/peripheral_esp/prj.conf @@ -7,4 +7,3 @@ CONFIG_BT_GATT_DIS=y CONFIG_BT_GATT_DIS_PNP=n CONFIG_BT_GATT_BAS=y CONFIG_BT_DEVICE_APPEARANCE=768 -CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/samples/bluetooth/peripheral_hids/prj.conf b/samples/bluetooth/peripheral_hids/prj.conf index 3b3519b850260..b158bb8b2fea4 100644 --- a/samples/bluetooth/peripheral_hids/prj.conf +++ b/samples/bluetooth/peripheral_hids/prj.conf @@ -17,4 +17,3 @@ CONFIG_FLASH_MAP=y CONFIG_FCB=y CONFIG_SETTINGS=y CONFIG_SETTINGS_FCB=y -CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/samples/bluetooth/peripheral_hr/prj.conf b/samples/bluetooth/peripheral_hr/prj.conf index f8e01dad8bf40..3dfa8796b8cc8 100644 --- a/samples/bluetooth/peripheral_hr/prj.conf +++ b/samples/bluetooth/peripheral_hr/prj.conf @@ -8,4 +8,3 @@ CONFIG_BT_GATT_BAS=y CONFIG_BT_GATT_HRS=y CONFIG_BT_DEVICE_NAME="Zephyr Heartrate Sensor" CONFIG_BT_DEVICE_APPEARANCE=833 -CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/samples/bluetooth/peripheral_ht/prj.conf b/samples/bluetooth/peripheral_ht/prj.conf index 7f23bcd53081e..3e6cdfeafad92 100644 --- a/samples/bluetooth/peripheral_ht/prj.conf +++ b/samples/bluetooth/peripheral_ht/prj.conf @@ -8,4 +8,3 @@ CONFIG_BT_GATT_BAS=y CONFIG_BT_DEVICE_NAME="Zephyr Health Thermometer" CONFIG_BT_DEVICE_APPEARANCE=768 CONFIG_BT_ATT_ENFORCE_FLOW=n -CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/samples/bluetooth/peripheral_sc_only/prj.conf b/samples/bluetooth/peripheral_sc_only/prj.conf index 4f6865afc8ad9..166454b23f218 100644 --- a/samples/bluetooth/peripheral_sc_only/prj.conf +++ b/samples/bluetooth/peripheral_sc_only/prj.conf @@ -10,4 +10,3 @@ CONFIG_BT_SMP_SC_ONLY=y CONFIG_BT_TINYCRYPT_ECC=y CONFIG_BT_MAX_PAIRED=2 CONFIG_BT_DEVICE_NAME="SC only peripheral" -CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/samples/bluetooth/scan_adv/prj.conf b/samples/bluetooth/scan_adv/prj.conf index d2d944610ebb8..26db96e63345d 100644 --- a/samples/bluetooth/scan_adv/prj.conf +++ b/samples/bluetooth/scan_adv/prj.conf @@ -2,4 +2,3 @@ CONFIG_BT=y CONFIG_BT_BROADCASTER=y CONFIG_BT_OBSERVER=y CONFIG_BT_DEBUG_LOG=y -CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/samples/boards/96b_argonkey/microphone/prj.conf b/samples/boards/96b_argonkey/microphone/prj.conf index f13f50cdd9b72..d41b64e7af115 100644 --- a/samples/boards/96b_argonkey/microphone/prj.conf +++ b/samples/boards/96b_argonkey/microphone/prj.conf @@ -14,4 +14,3 @@ CONFIG_AUDIO_MPXXDTYY=y CONFIG_DMA=y CONFIG_DMA_0_IRQ_PRI=0 -CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/samples/boards/96b_argonkey/sensors/prj.conf b/samples/boards/96b_argonkey/sensors/prj.conf index e7f762ec57792..110dfb8e54ee3 100644 --- a/samples/boards/96b_argonkey/sensors/prj.conf +++ b/samples/boards/96b_argonkey/sensors/prj.conf @@ -10,3 +10,5 @@ CONFIG_LPS22HB=y CONFIG_VL53L0X=y CONFIG_LSM6DSL=y CONFIG_LP3943=y + +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/samples/boards/altera_max10/pio/prj.conf b/samples/boards/altera_max10/pio/prj.conf index bce1caff0e19c..17e32787e4533 100644 --- a/samples/boards/altera_max10/pio/prj.conf +++ b/samples/boards/altera_max10/pio/prj.conf @@ -2,3 +2,5 @@ CONFIG_GPIO=y CONFIG_GPIO_ALTERA_NIOS2=y CONFIG_GPIO_ALTERA_NIOS2_OUTPUT=y CONFIG_GPIO_ALTERA_NIOS2_OUTPUT_DEV_NAME="PIO_OUTPUT" + +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/samples/boards/arc_secure_services/prj.conf b/samples/boards/arc_secure_services/prj.conf index 57df03ddd94c3..e69de29bb2d1d 100644 --- a/samples/boards/arc_secure_services/prj.conf +++ b/samples/boards/arc_secure_services/prj.conf @@ -1 +0,0 @@ -CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/samples/boards/bbc_microbit/display/prj.conf b/samples/boards/bbc_microbit/display/prj.conf index 711bafb9184a6..76f2b8952b504 100644 --- a/samples/boards/bbc_microbit/display/prj.conf +++ b/samples/boards/bbc_microbit/display/prj.conf @@ -2,4 +2,3 @@ CONFIG_GPIO=y CONFIG_DISPLAY=y CONFIG_MICROBIT_DISPLAY=y -CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/samples/boards/bbc_microbit/line_follower_robot/prj.conf b/samples/boards/bbc_microbit/line_follower_robot/prj.conf index 357f36b6b9bc1..e4a4b430ed3cb 100644 --- a/samples/boards/bbc_microbit/line_follower_robot/prj.conf +++ b/samples/boards/bbc_microbit/line_follower_robot/prj.conf @@ -1,3 +1,5 @@ CONFIG_GPIO=y CONFIG_I2C=y CONFIG_PRINTK=y + +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/samples/boards/bbc_microbit/sound/prj.conf b/samples/boards/bbc_microbit/sound/prj.conf index 2c045fb281c42..2bce0fda2c3ed 100644 --- a/samples/boards/bbc_microbit/sound/prj.conf +++ b/samples/boards/bbc_microbit/sound/prj.conf @@ -3,4 +3,3 @@ CONFIG_DISPLAY=y CONFIG_MICROBIT_DISPLAY=y CONFIG_PWM=y CONFIG_PWM_NRF5_SW=y -CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/samples/boards/nrf52/power_mgr/prj.conf b/samples/boards/nrf52/power_mgr/prj.conf index 0ba0c3c0171cd..1c395979a814f 100644 --- a/samples/boards/nrf52/power_mgr/prj.conf +++ b/samples/boards/nrf52/power_mgr/prj.conf @@ -8,4 +8,3 @@ CONFIG_SYS_PM_STATE_LOCK=y CONFIG_SYS_PM_MIN_RESIDENCY_SLEEP_1=5000 CONFIG_SYS_PM_MIN_RESIDENCY_SLEEP_2=15000 CONFIG_GPIO=y -CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/samples/boards/nrf52/power_mgr/prj_tickless.conf b/samples/boards/nrf52/power_mgr/prj_tickless.conf index 2998bb68e543d..5186d5ad52977 100644 --- a/samples/boards/nrf52/power_mgr/prj_tickless.conf +++ b/samples/boards/nrf52/power_mgr/prj_tickless.conf @@ -10,4 +10,3 @@ CONFIG_PM_CONTROL_STATE_LOCK=y CONFIG_PM_LPS_1_MIN_RES=5 CONFIG_PM_LPS_2_MIN_RES=15 CONFIG_GPIO=y -CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/samples/boards/olimex_stm32_e407/ccm/prj.conf b/samples/boards/olimex_stm32_e407/ccm/prj.conf index 4dbff538157b6..056521f429340 100644 --- a/samples/boards/olimex_stm32_e407/ccm/prj.conf +++ b/samples/boards/olimex_stm32_e407/ccm/prj.conf @@ -11,3 +11,5 @@ CONFIG_PRINTK=y CONFIG_STDOUT_CONSOLE=y CONFIG_EARLY_CONSOLE=y CONFIG_LOG=y + +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/samples/boards/sensortile_box/prj.conf b/samples/boards/sensortile_box/prj.conf index 45167e925ec52..32ded47178df0 100644 --- a/samples/boards/sensortile_box/prj.conf +++ b/samples/boards/sensortile_box/prj.conf @@ -34,3 +34,5 @@ CONFIG_UART_INTERRUPT_DRIVEN=y CONFIG_UART_LINE_CTRL=y CONFIG_UART_CONSOLE_ON_DEV_NAME="CDC_ACM_0" CONFIG_USB_UART_DTR_WAIT=y + +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/samples/boards/up_squared/gpio_counter/prj.conf b/samples/boards/up_squared/gpio_counter/prj.conf index 03e18ec4c078e..91c3c15b37d1e 100644 --- a/samples/boards/up_squared/gpio_counter/prj.conf +++ b/samples/boards/up_squared/gpio_counter/prj.conf @@ -1,2 +1 @@ CONFIG_GPIO=y -CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/samples/cpp_synchronization/prj.conf b/samples/cpp_synchronization/prj.conf index 3f53e0fdc61d7..fa7da8057923e 100644 --- a/samples/cpp_synchronization/prj.conf +++ b/samples/cpp_synchronization/prj.conf @@ -1,2 +1 @@ CONFIG_CPLUSPLUS=y -CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/samples/display/cfb/prj.conf b/samples/display/cfb/prj.conf index 79d9eef37359d..84e4459980ffb 100644 --- a/samples/display/cfb/prj.conf +++ b/samples/display/cfb/prj.conf @@ -8,3 +8,5 @@ CONFIG_LOG=y CONFIG_CFB_LOG_LEVEL_DBG=y CONFIG_CHARACTER_FRAMEBUFFER=y + +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/samples/display/cfb_custom_font/prj.conf b/samples/display/cfb_custom_font/prj.conf index f4bf0b3664753..46f20982794d1 100644 --- a/samples/display/cfb_custom_font/prj.conf +++ b/samples/display/cfb_custom_font/prj.conf @@ -4,3 +4,5 @@ CONFIG_DISPLAY=y CONFIG_CHARACTER_FRAMEBUFFER=y CONFIG_CHARACTER_FRAMEBUFFER_USE_DEFAULT_FONTS=n + +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/samples/display/cfb_shell/prj.conf b/samples/display/cfb_shell/prj.conf index ee143187cc8c9..58635434bf1f2 100644 --- a/samples/display/cfb_shell/prj.conf +++ b/samples/display/cfb_shell/prj.conf @@ -4,3 +4,5 @@ CONFIG_DISPLAY=y CONFIG_CHARACTER_FRAMEBUFFER=y CONFIG_SHELL=y CONFIG_CHARACTER_FRAMEBUFFER_SHELL=y + +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/samples/display/grove_display/prj.conf b/samples/display/grove_display/prj.conf index 3bdd8a81fb3c7..30e52fe7ad5e1 100644 --- a/samples/display/grove_display/prj.conf +++ b/samples/display/grove_display/prj.conf @@ -5,3 +5,5 @@ CONFIG_I2C=y CONFIG_DISPLAY=y CONFIG_GROVE_LCD_RGB=y + +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/samples/display/ili9340/prj.conf b/samples/display/ili9340/prj.conf index ed3d714558076..d415ee6114407 100644 --- a/samples/display/ili9340/prj.conf +++ b/samples/display/ili9340/prj.conf @@ -10,3 +10,5 @@ CONFIG_DISPLAY_LOG_LEVEL_DBG=y CONFIG_LOG=y + +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/samples/display/st7789v/prj.conf b/samples/display/st7789v/prj.conf index ba0d9d4d91dda..3f33fa7e1a8e8 100644 --- a/samples/display/st7789v/prj.conf +++ b/samples/display/st7789v/prj.conf @@ -13,3 +13,5 @@ CONFIG_ST7789V_RGB565=y CONFIG_DISPLAY_LOG_LEVEL_DBG=y CONFIG_LOG=y + +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/samples/drivers/CAN/prj.conf b/samples/drivers/CAN/prj.conf index e8c78a92ae845..448dfc2c010cf 100644 --- a/samples/drivers/CAN/prj.conf +++ b/samples/drivers/CAN/prj.conf @@ -5,4 +5,3 @@ CONFIG_CAN_MAX_FILTER=5 CONFIG_SHELL=y CONFIG_CAN_SHELL=y CONFIG_DEVICE_SHELL=y -CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/samples/drivers/counter/alarm/prj.conf b/samples/drivers/counter/alarm/prj.conf index 8d4b77bfa5811..9d51e5fcdb38f 100644 --- a/samples/drivers/counter/alarm/prj.conf +++ b/samples/drivers/counter/alarm/prj.conf @@ -1,3 +1,2 @@ CONFIG_PRINTK=y CONFIG_COUNTER=y -CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/samples/drivers/crypto/prj.conf b/samples/drivers/crypto/prj.conf index d8e263cb53b1f..cd1f12231866c 100644 --- a/samples/drivers/crypto/prj.conf +++ b/samples/drivers/crypto/prj.conf @@ -7,3 +7,4 @@ CONFIG_CRYPTO=y CONFIG_CRYPTO_TINYCRYPT_SHIM=y CONFIG_CRYPTO_LOG_LEVEL_DBG=y CONFIG_LOG=y +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/samples/drivers/crypto/prj_mtls_shim.conf b/samples/drivers/crypto/prj_mtls_shim.conf index 57de734ace33c..7926894e1da05 100644 --- a/samples/drivers/crypto/prj_mtls_shim.conf +++ b/samples/drivers/crypto/prj_mtls_shim.conf @@ -9,3 +9,4 @@ CONFIG_MAIN_STACK_SIZE=4096 CONFIG_CRYPTO=y CONFIG_CRYPTO_MBEDTLS_SHIM=y CONFIG_CRYPTO_LOG_LEVEL_DBG=y +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/samples/drivers/current_sensing/prj.conf b/samples/drivers/current_sensing/prj.conf index 9332f6ef8631c..338cb6c39fbb3 100644 --- a/samples/drivers/current_sensing/prj.conf +++ b/samples/drivers/current_sensing/prj.conf @@ -1,3 +1,5 @@ CONFIG_STDOUT_CONSOLE=y CONFIG_PRINTK=y CONFIG_I2C=y + +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/samples/drivers/entropy/prj.conf b/samples/drivers/entropy/prj.conf index b28851c98f527..8b24b9f1e0866 100644 --- a/samples/drivers/entropy/prj.conf +++ b/samples/drivers/entropy/prj.conf @@ -1,2 +1,3 @@ CONFIG_ENTROPY_GENERATOR=y CONFIG_STDOUT_CONSOLE=y +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/samples/drivers/flash_shell/prj.conf b/samples/drivers/flash_shell/prj.conf index dd0c6ccfbe237..1c70335b3f760 100644 --- a/samples/drivers/flash_shell/prj.conf +++ b/samples/drivers/flash_shell/prj.conf @@ -8,4 +8,3 @@ CONFIG_FLASH=y # it here. # CONFIG_FLASH_PAGE_LAYOUT=y CONFIG_MPU_ALLOW_FLASH_WRITE=y -CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/samples/drivers/gpio/prj.conf b/samples/drivers/gpio/prj.conf index 03e18ec4c078e..91c3c15b37d1e 100644 --- a/samples/drivers/gpio/prj.conf +++ b/samples/drivers/gpio/prj.conf @@ -1,2 +1 @@ CONFIG_GPIO=y -CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/samples/drivers/ht16k33/prj.conf b/samples/drivers/ht16k33/prj.conf index c296a8e3a75fa..ff3d92b65c3a8 100644 --- a/samples/drivers/ht16k33/prj.conf +++ b/samples/drivers/ht16k33/prj.conf @@ -4,4 +4,3 @@ CONFIG_GPIO=y CONFIG_LED=y CONFIG_HT16K33=y CONFIG_HT16K33_KEYSCAN=y -CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/samples/drivers/i2c_fujitsu_fram/prj.conf b/samples/drivers/i2c_fujitsu_fram/prj.conf index f9659582c98c6..78aed7a18b85c 100644 --- a/samples/drivers/i2c_fujitsu_fram/prj.conf +++ b/samples/drivers/i2c_fujitsu_fram/prj.conf @@ -2,3 +2,5 @@ CONFIG_STDOUT_CONSOLE=y CONFIG_PRINTK=y CONFIG_I2C=y + +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/samples/drivers/i2c_scanner/overlay-nrf52.conf b/samples/drivers/i2c_scanner/overlay-nrf52.conf index 822d475140f2e..9b8a10716f6e8 100644 --- a/samples/drivers/i2c_scanner/overlay-nrf52.conf +++ b/samples/drivers/i2c_scanner/overlay-nrf52.conf @@ -1,2 +1,4 @@ CONFIG_I2C_NRFX=y CONFIG_I2C_0=y + +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/samples/drivers/i2c_scanner/prj.conf b/samples/drivers/i2c_scanner/prj.conf index cc1b04cdb7d07..11bc25227b55f 100644 --- a/samples/drivers/i2c_scanner/prj.conf +++ b/samples/drivers/i2c_scanner/prj.conf @@ -1,2 +1,4 @@ CONFIG_PRINTK=y CONFIG_I2C=y + +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/samples/drivers/lcd_hd44780/prj.conf b/samples/drivers/lcd_hd44780/prj.conf index 91c3c15b37d1e..4be8a418c4e02 100644 --- a/samples/drivers/lcd_hd44780/prj.conf +++ b/samples/drivers/lcd_hd44780/prj.conf @@ -1 +1,3 @@ CONFIG_GPIO=y + +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/samples/drivers/led_apa102/prj.conf b/samples/drivers/led_apa102/prj.conf index f23f800229741..fe87e26daddb0 100644 --- a/samples/drivers/led_apa102/prj.conf +++ b/samples/drivers/led_apa102/prj.conf @@ -2,4 +2,3 @@ CONFIG_LOG=y CONFIG_LED_STRIP=y -CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/samples/drivers/led_lp3943/prj.conf b/samples/drivers/led_lp3943/prj.conf index 050f380f875be..6f7d4aa2515fb 100644 --- a/samples/drivers/led_lp3943/prj.conf +++ b/samples/drivers/led_lp3943/prj.conf @@ -2,4 +2,3 @@ CONFIG_LOG=y CONFIG_I2C=y CONFIG_LED=y CONFIG_LP3943=y -CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/samples/drivers/led_lp5562/prj.conf b/samples/drivers/led_lp5562/prj.conf index 4be6493019fd3..51a70f113a86f 100644 --- a/samples/drivers/led_lp5562/prj.conf +++ b/samples/drivers/led_lp5562/prj.conf @@ -2,4 +2,3 @@ CONFIG_LOG=y CONFIG_I2C=y CONFIG_LED=y CONFIG_LP5562=y -CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/samples/drivers/led_lpd8806/prj.conf b/samples/drivers/led_lpd8806/prj.conf index ceee9c6f092c9..08909b52d2087 100644 --- a/samples/drivers/led_lpd8806/prj.conf +++ b/samples/drivers/led_lpd8806/prj.conf @@ -8,4 +8,3 @@ CONFIG_SPI=y CONFIG_LED_STRIP=y CONFIG_LPD880X_STRIP=y -CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/samples/drivers/led_pca9633/prj.conf b/samples/drivers/led_pca9633/prj.conf index 35bb4deb66eca..e3396b01a4824 100644 --- a/samples/drivers/led_pca9633/prj.conf +++ b/samples/drivers/led_pca9633/prj.conf @@ -4,4 +4,3 @@ CONFIG_I2C=y CONFIG_LED=y CONFIG_PCA9633=y -CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/samples/drivers/led_ws2812/prj.conf b/samples/drivers/led_ws2812/prj.conf index f23f800229741..fe87e26daddb0 100644 --- a/samples/drivers/led_ws2812/prj.conf +++ b/samples/drivers/led_ws2812/prj.conf @@ -2,4 +2,3 @@ CONFIG_LOG=y CONFIG_LED_STRIP=y -CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/samples/drivers/soc_flash_nrf/prj.conf b/samples/drivers/soc_flash_nrf/prj.conf index 1739d7c3b35fa..30b7612111ef8 100644 --- a/samples/drivers/soc_flash_nrf/prj.conf +++ b/samples/drivers/soc_flash_nrf/prj.conf @@ -2,3 +2,5 @@ CONFIG_STDOUT_CONSOLE=y CONFIG_FLASH=y CONFIG_FLASH_PAGE_LAYOUT=y CONFIG_MPU_ALLOW_FLASH_WRITE=y + +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/samples/drivers/spi_fujitsu_fram/prj.conf b/samples/drivers/spi_fujitsu_fram/prj.conf index 3520ad0edc322..3c24206b6fc5f 100644 --- a/samples/drivers/spi_fujitsu_fram/prj.conf +++ b/samples/drivers/spi_fujitsu_fram/prj.conf @@ -3,3 +3,5 @@ CONFIG_PRINTK=y CONFIG_SPI=y CONFIG_GPIO=y + +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/samples/drivers/watchdog/nucleo_l496zg.conf b/samples/drivers/watchdog/nucleo_l496zg.conf index cacad7364ce53..e6e8c20fcc662 100644 --- a/samples/drivers/watchdog/nucleo_l496zg.conf +++ b/samples/drivers/watchdog/nucleo_l496zg.conf @@ -9,3 +9,5 @@ CONFIG_CLOCK_STM32_MSI_RANGE=5 CONFIG_CLOCK_STM32_AHB_PRESCALER=1 CONFIG_CLOCK_STM32_APB1_PRESCALER=1 CONFIG_CLOCK_STM32_APB2_PRESCALER=1 + +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/samples/drivers/watchdog/prj.conf b/samples/drivers/watchdog/prj.conf index 21db5b1cc8da5..753fa7209ea03 100644 --- a/samples/drivers/watchdog/prj.conf +++ b/samples/drivers/watchdog/prj.conf @@ -1,3 +1,5 @@ CONFIG_LOG=y CONFIG_WDT_LOG_LEVEL_DBG=y CONFIG_WATCHDOG=y + +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/samples/gui/lvgl/prj.conf b/samples/gui/lvgl/prj.conf index 64efb35cb77b5..d1911adecaaad 100644 --- a/samples/gui/lvgl/prj.conf +++ b/samples/gui/lvgl/prj.conf @@ -7,3 +7,5 @@ CONFIG_LOG=y CONFIG_LVGL=y CONFIG_LVGL_OBJ_LABEL=y + +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/samples/hello_world/prj.conf b/samples/hello_world/prj.conf index b2a4ba591044e..93de364ae1184 100644 --- a/samples/hello_world/prj.conf +++ b/samples/hello_world/prj.conf @@ -1 +1,2 @@ # nothing here +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/samples/mpu/mpu_test/prj.conf b/samples/mpu/mpu_test/prj.conf index ff29e6c8c7d77..a00bd31dcd564 100644 --- a/samples/mpu/mpu_test/prj.conf +++ b/samples/mpu/mpu_test/prj.conf @@ -13,3 +13,5 @@ CONFIG_LOG=y ### These can be uncommented to enable the flash device on the ### STM32F4X devices. # CONFIG_SOC_FLASH_STM32=y + +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/samples/mpu/mpu_test/prj_single.conf b/samples/mpu/mpu_test/prj_single.conf index 3a9c5da2197b3..5332b4b0d1834 100644 --- a/samples/mpu/mpu_test/prj_single.conf +++ b/samples/mpu/mpu_test/prj_single.conf @@ -1,3 +1,5 @@ CONFIG_MULTITHREADING=n CONFIG_SHELL=y CONFIG_LOG=y + +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/samples/net/dhcpv4_client/overlay-e1000.conf b/samples/net/dhcpv4_client/overlay-e1000.conf index 3d022bd4b0fa2..faaf64fb3df9c 100644 --- a/samples/net/dhcpv4_client/overlay-e1000.conf +++ b/samples/net/dhcpv4_client/overlay-e1000.conf @@ -6,4 +6,3 @@ CONFIG_ETH_E1000=y CONFIG_PCIE=y #CONFIG_ETHERNET_LOG_LEVEL_DBG=y -CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/samples/net/dhcpv4_client/prj.conf b/samples/net/dhcpv4_client/prj.conf index d2a8df5999c82..1be69e9abd36f 100644 --- a/samples/net/dhcpv4_client/prj.conf +++ b/samples/net/dhcpv4_client/prj.conf @@ -17,4 +17,3 @@ CONFIG_LOG=y CONFIG_SLIP_STATISTICS=n CONFIG_NET_SHELL=y -CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/samples/net/dns_resolve/prj.conf b/samples/net/dns_resolve/prj.conf index 56828897fa1df..95d6d0ed0bc19 100644 --- a/samples/net/dns_resolve/prj.conf +++ b/samples/net/dns_resolve/prj.conf @@ -54,4 +54,3 @@ CONFIG_NET_CONFIG_MY_IPV4_ADDR="192.0.2.1" CONFIG_NET_CONFIG_PEER_IPV4_ADDR="192.0.2.2" CONFIG_MAIN_STACK_SIZE=1504 -CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/samples/net/eth_native_posix/net_setup_host.conf b/samples/net/eth_native_posix/net_setup_host.conf index 44b981c1ee61a..4e6ab7a557410 100644 --- a/samples/net/eth_native_posix/net_setup_host.conf +++ b/samples/net/eth_native_posix/net_setup_host.conf @@ -9,4 +9,3 @@ IPV6_ROUTE_1="2001:db8::/64" IPV4_ADDR_1="192.0.2.2" IPV4_ROUTE_1="192.0.2.0/24" -CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/samples/net/eth_native_posix/prj.conf b/samples/net/eth_native_posix/prj.conf index 55933e207acb8..dedd8e86bfc60 100644 --- a/samples/net/eth_native_posix/prj.conf +++ b/samples/net/eth_native_posix/prj.conf @@ -38,4 +38,3 @@ CONFIG_NET_L2_ETHERNET=y CONFIG_ETH_NATIVE_POSIX=y CONFIG_ETH_NATIVE_POSIX_RANDOM_MAC=y #CONFIG_ETH_NATIVE_POSIX_MAC_ADDR="00:00:5e:00:53:2a" -CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/samples/net/gptp/prj.conf b/samples/net/gptp/prj.conf index c69e4f7976220..5513677d59245 100644 --- a/samples/net/gptp/prj.conf +++ b/samples/net/gptp/prj.conf @@ -75,4 +75,3 @@ CONFIG_NET_TC_RX_COUNT=4 # Enable priority support in net_context CONFIG_NET_CONTEXT_PRIORITY=y -CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/samples/net/ipv4_autoconf/prj.conf b/samples/net/ipv4_autoconf/prj.conf index 5150c0cda1309..fc0cd2997c1cc 100644 --- a/samples/net/ipv4_autoconf/prj.conf +++ b/samples/net/ipv4_autoconf/prj.conf @@ -22,4 +22,3 @@ CONFIG_NET_LOG=y CONFIG_LOG=y CONFIG_NET_SHELL=y -CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/samples/net/lldp/prj.conf b/samples/net/lldp/prj.conf index d9004c0a7c3bb..07b5c1b601612 100644 --- a/samples/net/lldp/prj.conf +++ b/samples/net/lldp/prj.conf @@ -77,4 +77,3 @@ CONFIG_NET_LLDP_TX_INTERVAL=30 # How many traffic classes to enable CONFIG_NET_TC_TX_COUNT=6 CONFIG_NET_TC_RX_COUNT=4 -CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/samples/net/nats/prj.conf b/samples/net/nats/prj.conf index c2b4c768e1c3e..a261719d77372 100644 --- a/samples/net/nats/prj.conf +++ b/samples/net/nats/prj.conf @@ -21,4 +21,3 @@ CONFIG_NET_CONFIG_PEER_IPV6_ADDR="2001:db8::2" CONFIG_TEST_RANDOM_GENERATOR=y CONFIG_JSON_LIBRARY=y -CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/samples/net/promiscuous_mode/prj.conf b/samples/net/promiscuous_mode/prj.conf index 9ee8b59cda439..5690ffbb56081 100644 --- a/samples/net/promiscuous_mode/prj.conf +++ b/samples/net/promiscuous_mode/prj.conf @@ -42,4 +42,3 @@ CONFIG_NET_CONFIG_MY_IPV6_ADDR="2001:db8::1" CONFIG_NET_CONFIG_PEER_IPV6_ADDR="2001:db8::2" CONFIG_NET_CONFIG_MY_IPV4_ADDR="192.0.2.1" CONFIG_NET_CONFIG_PEER_IPV4_ADDR="192.0.2.2" -CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/samples/net/sockets/echo/prj.conf b/samples/net/sockets/echo/prj.conf index 034e438aab3fc..fd132f8e58661 100644 --- a/samples/net/sockets/echo/prj.conf +++ b/samples/net/sockets/echo/prj.conf @@ -17,4 +17,3 @@ CONFIG_NET_CONFIG_SETTINGS=y CONFIG_NET_CONFIG_NEED_IPV4=y CONFIG_NET_CONFIG_MY_IPV4_ADDR="192.0.2.1" CONFIG_NET_CONFIG_PEER_IPV4_ADDR="192.0.2.2" -CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/samples/net/sockets/echo_server/overlay-802154.conf b/samples/net/sockets/echo_server/overlay-802154.conf index 743847e4c3b2f..fa9e68002772b 100644 --- a/samples/net/sockets/echo_server/overlay-802154.conf +++ b/samples/net/sockets/echo_server/overlay-802154.conf @@ -14,4 +14,3 @@ CONFIG_NET_L2_IEEE802154_SHELL=y CONFIG_NET_L2_IEEE802154_LOG_LEVEL_INF=y CONFIG_NET_CONFIG_IEEE802154_CHANNEL=26 -CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/samples/net/sockets/echo_server/overlay-bt.conf b/samples/net/sockets/echo_server/overlay-bt.conf index b6f2e26ade55d..e4ba34cb52371 100644 --- a/samples/net/sockets/echo_server/overlay-bt.conf +++ b/samples/net/sockets/echo_server/overlay-bt.conf @@ -13,4 +13,3 @@ CONFIG_NET_CONFIG_NEED_IPV6=y CONFIG_NET_CONFIG_NEED_IPV4=n CONFIG_NET_CONFIG_MY_IPV4_ADDR="" CONFIG_NET_CONFIG_PEER_IPV4_ADDR="" -CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/samples/net/sockets/echo_server/overlay-cc2520.conf b/samples/net/sockets/echo_server/overlay-cc2520.conf index 82fbc0450ad1c..6ce826bda54d1 100644 --- a/samples/net/sockets/echo_server/overlay-cc2520.conf +++ b/samples/net/sockets/echo_server/overlay-cc2520.conf @@ -4,4 +4,3 @@ CONFIG_IEEE802154_CC2520=y CONFIG_NET_CONFIG_MY_IPV6_ADDR="2001:db8::2" CONFIG_NET_CONFIG_IEEE802154_DEV_NAME="cc2520" -CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/samples/net/sockets/echo_server/overlay-e1000.conf b/samples/net/sockets/echo_server/overlay-e1000.conf index 3d022bd4b0fa2..faaf64fb3df9c 100644 --- a/samples/net/sockets/echo_server/overlay-e1000.conf +++ b/samples/net/sockets/echo_server/overlay-e1000.conf @@ -6,4 +6,3 @@ CONFIG_ETH_E1000=y CONFIG_PCIE=y #CONFIG_ETHERNET_LOG_LEVEL_DBG=y -CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/samples/net/sockets/echo_server/overlay-netusb.conf b/samples/net/sockets/echo_server/overlay-netusb.conf index 186650e652b43..18192d8db9c63 100644 --- a/samples/net/sockets/echo_server/overlay-netusb.conf +++ b/samples/net/sockets/echo_server/overlay-netusb.conf @@ -12,4 +12,3 @@ CONFIG_INIT_STACKS=n # Disable shell built-in commands to reduce ROM footprint CONFIG_SHELL_CMDS=n -CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/samples/net/sockets/echo_server/overlay-ot.conf b/samples/net/sockets/echo_server/overlay-ot.conf index bee3b3ffba6e2..5f82e684fc622 100644 --- a/samples/net/sockets/echo_server/overlay-ot.conf +++ b/samples/net/sockets/echo_server/overlay-ot.conf @@ -47,4 +47,3 @@ CONFIG_MBEDTLS_SSL_MAX_CONTENT_LEN=768 #CONFIG_OPENTHREAD_COMMISSIONER=y #CONFIG_MBEDTLS_HEAP_SIZE=8192 -CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/samples/net/sockets/echo_server/overlay-qemu_802154.conf b/samples/net/sockets/echo_server/overlay-qemu_802154.conf index 30b5cb60588ed..2d336394850df 100644 --- a/samples/net/sockets/echo_server/overlay-qemu_802154.conf +++ b/samples/net/sockets/echo_server/overlay-qemu_802154.conf @@ -20,4 +20,3 @@ CONFIG_NET_L2_IEEE802154_SHELL=y CONFIG_NET_L2_IEEE802154_LOG_LEVEL_INF=y CONFIG_NET_CONFIG_IEEE802154_CHANNEL=26 -CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/samples/net/sockets/echo_server/overlay-qemu_cortex_m3_eth.conf b/samples/net/sockets/echo_server/overlay-qemu_cortex_m3_eth.conf index 8a5af9d5aa134..a77bf5bcad772 100644 --- a/samples/net/sockets/echo_server/overlay-qemu_cortex_m3_eth.conf +++ b/samples/net/sockets/echo_server/overlay-qemu_cortex_m3_eth.conf @@ -5,4 +5,3 @@ CONFIG_ETH_STELLARIS=y CONFIG_NET_SLIP_TAP=n CONFIG_SLIP=n -CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/samples/net/sockets/echo_server/overlay-smsc911x.conf b/samples/net/sockets/echo_server/overlay-smsc911x.conf index 7e511395c14d5..1120ab522e783 100644 --- a/samples/net/sockets/echo_server/overlay-smsc911x.conf +++ b/samples/net/sockets/echo_server/overlay-smsc911x.conf @@ -4,4 +4,3 @@ CONFIG_NET_QEMU_ETHERNET=y CONFIG_ETH_SMSC911X=y #CONFIG_ETHERNET_LOG_LEVEL_DBG=y -CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/samples/net/sockets/echo_server/overlay-tls.conf b/samples/net/sockets/echo_server/overlay-tls.conf index 2220eebd47240..a438dd5f23bb7 100644 --- a/samples/net/sockets/echo_server/overlay-tls.conf +++ b/samples/net/sockets/echo_server/overlay-tls.conf @@ -13,4 +13,3 @@ CONFIG_NET_SOCKETS_SOCKOPT_TLS=y CONFIG_NET_SOCKETS_TLS_MAX_CONTEXTS=6 CONFIG_NET_SOCKETS_ENABLE_DTLS=y CONFIG_NET_SOCKETS_DTLS_TIMEOUT=30000 -CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/samples/net/sockets/echo_server/overlay-vlan.conf b/samples/net/sockets/echo_server/overlay-vlan.conf index 03ad7d5043513..014523b7fd5cc 100644 --- a/samples/net/sockets/echo_server/overlay-vlan.conf +++ b/samples/net/sockets/echo_server/overlay-vlan.conf @@ -24,4 +24,3 @@ CONFIG_NET_SAMPLE_IFACE3_MY_IPV6_ADDR="2001:db8:200::1" CONFIG_NET_SAMPLE_IFACE3_MY_IPV4_ADDR="203.0.113.1" # VLAN tag for the second interface CONFIG_NET_SAMPLE_IFACE3_VLAN_TAG=200 -CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/samples/net/sockets/echo_server/prj.conf b/samples/net/sockets/echo_server/prj.conf index 76966f1ce7981..a39c36f4cfec3 100644 --- a/samples/net/sockets/echo_server/prj.conf +++ b/samples/net/sockets/echo_server/prj.conf @@ -48,5 +48,3 @@ CONFIG_POSIX_MAX_FDS=12 # How many client can connect to echo-server simultaneously CONFIG_NET_SAMPLE_NUM_HANDLERS=1 - -CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/samples/net/sockets/net_mgmt/prj.conf b/samples/net/sockets/net_mgmt/prj.conf index afbdfb0e64efa..4c9720313c85a 100644 --- a/samples/net/sockets/net_mgmt/prj.conf +++ b/samples/net/sockets/net_mgmt/prj.conf @@ -40,4 +40,3 @@ CONFIG_NET_CONFIG_AUTO_INIT=n # Set the userspace support by default as that was the purpose # of the sample application. CONFIG_USERSPACE=y -CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/samples/net/sockets/packet/prj.conf b/samples/net/sockets/packet/prj.conf index f4bae90a32fc6..a5d4e6794610f 100644 --- a/samples/net/sockets/packet/prj.conf +++ b/samples/net/sockets/packet/prj.conf @@ -41,4 +41,3 @@ CONFIG_NET_IF_LOG_LEVEL_DBG=n CONFIG_NET_L2_ETHERNET_LOG_LEVEL_DBG=n CONFIG_ETHERNET_LOG_LEVEL_DBG=n CONFIG_NET_PKT_LOG_LEVEL_ERR=n -CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/samples/net/stats/prj.conf b/samples/net/stats/prj.conf index ffa243747833a..0a9998791b75d 100644 --- a/samples/net/stats/prj.conf +++ b/samples/net/stats/prj.conf @@ -44,4 +44,3 @@ CONFIG_NET_CONFIG_MY_IPV6_ADDR="2001:db8::1" # Logging CONFIG_LOG=y -CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/samples/net/syslog_net/prj.conf b/samples/net/syslog_net/prj.conf index 89ddd97c8fc67..ce3681d204281 100644 --- a/samples/net/syslog_net/prj.conf +++ b/samples/net/syslog_net/prj.conf @@ -35,4 +35,3 @@ CONFIG_LOG_BACKEND_NET_SERVER="[2001:db8::2]:514" # Get newlib by default as it has proper time function support CONFIG_NEWLIB_LIBC=y -CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/samples/net/telnet/prj.conf b/samples/net/telnet/prj.conf index d5a5a6bcd7a5a..8e00513e22fed 100644 --- a/samples/net/telnet/prj.conf +++ b/samples/net/telnet/prj.conf @@ -29,4 +29,3 @@ CONFIG_NET_CONFIG_MY_IPV4_ADDR="192.0.2.1" CONFIG_NET_SHELL=y CONFIG_KERNEL_SHELL=y CONFIG_SHELL_BACKEND_TELNET=y -CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/samples/net/vlan/prj.conf b/samples/net/vlan/prj.conf index 0d2d0df10e201..30cbbd7b4e045 100644 --- a/samples/net/vlan/prj.conf +++ b/samples/net/vlan/prj.conf @@ -54,4 +54,3 @@ CONFIG_NET_VLAN_COUNT=2 # Settings for native_posix ethernet driver (if compiled for that board) CONFIG_ETH_NATIVE_POSIX=y -CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/samples/nfc/nfc_hello/prj.conf b/samples/nfc/nfc_hello/prj.conf index 3b920dae77985..172f2cda301fa 100644 --- a/samples/nfc/nfc_hello/prj.conf +++ b/samples/nfc/nfc_hello/prj.conf @@ -1,3 +1,5 @@ CONFIG_SERIAL=y CONFIG_STDOUT_CONSOLE=y CONFIG_UART_INTERRUPT_DRIVEN=y + +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/samples/philosophers/prj.conf b/samples/philosophers/prj.conf index 667391194cd7f..4637ac2aa9abd 100644 --- a/samples/philosophers/prj.conf +++ b/samples/philosophers/prj.conf @@ -5,3 +5,4 @@ CONFIG_NUM_COOP_PRIORITIES=29 CONFIG_NUM_PREEMPT_PRIORITIES=40 CONFIG_SCHED_SCALABLE=y CONFIG_MP_NUM_CPUS=1 +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/samples/philosophers/prj_tickless.conf b/samples/philosophers/prj_tickless.conf index 0b448a8d9f6bf..a13edbec8b2b6 100644 --- a/samples/philosophers/prj_tickless.conf +++ b/samples/philosophers/prj_tickless.conf @@ -5,5 +5,5 @@ CONFIG_NUM_COOP_PRIORITIES=29 CONFIG_NUM_PREEMPT_PRIORITIES=40 CONFIG_SYS_POWER_MANAGEMENT=y CONFIG_TICKLESS_KERNEL=y - CONFIG_MP_NUM_CPUS=1 +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/samples/portability/cmsis_rtos_v1/philosophers/prj.conf b/samples/portability/cmsis_rtos_v1/philosophers/prj.conf index b3761879f7f92..2b8481640ea14 100644 --- a/samples/portability/cmsis_rtos_v1/philosophers/prj.conf +++ b/samples/portability/cmsis_rtos_v1/philosophers/prj.conf @@ -11,4 +11,3 @@ CONFIG_POLL=y CONFIG_SCHED_SCALABLE=y CONFIG_THREAD_CUSTOM_DATA=y -CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/samples/portability/cmsis_rtos_v1/timer_synchronization/prj.conf b/samples/portability/cmsis_rtos_v1/timer_synchronization/prj.conf index 161be19d77f20..26e412ac7c11a 100644 --- a/samples/portability/cmsis_rtos_v1/timer_synchronization/prj.conf +++ b/samples/portability/cmsis_rtos_v1/timer_synchronization/prj.conf @@ -11,4 +11,3 @@ CONFIG_POLL=y CONFIG_SCHED_SCALABLE=y CONFIG_THREAD_CUSTOM_DATA=y CONFIG_SMP=n -CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/samples/portability/cmsis_rtos_v2/philosophers/prj.conf b/samples/portability/cmsis_rtos_v2/philosophers/prj.conf index e8d8bcd91d34f..7bf7415a2a66f 100644 --- a/samples/portability/cmsis_rtos_v2/philosophers/prj.conf +++ b/samples/portability/cmsis_rtos_v2/philosophers/prj.conf @@ -10,4 +10,3 @@ CONFIG_INIT_STACKS=y CONFIG_POLL=y CONFIG_SCHED_SCALABLE=y CONFIG_SYS_CLOCK_TICKS_PER_SEC=1000 -CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/samples/portability/cmsis_rtos_v2/timer_synchronization/prj.conf b/samples/portability/cmsis_rtos_v2/timer_synchronization/prj.conf index fe0df4e25e4ad..0df8dbb81166d 100644 --- a/samples/portability/cmsis_rtos_v2/timer_synchronization/prj.conf +++ b/samples/portability/cmsis_rtos_v2/timer_synchronization/prj.conf @@ -12,4 +12,3 @@ CONFIG_SCHED_SCALABLE=y CONFIG_QEMU_TICKLESS_WORKAROUND=y # The Zephyr CMSIS v2 emulation assumes that ticks are ms, currently CONFIG_SYS_CLOCK_TICKS_PER_SEC=1000 -CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/samples/sensor/adt7420/prj.conf b/samples/sensor/adt7420/prj.conf index d233238f33862..51eb88a0329ad 100644 --- a/samples/sensor/adt7420/prj.conf +++ b/samples/sensor/adt7420/prj.conf @@ -2,3 +2,5 @@ CONFIG_STDOUT_CONSOLE=y CONFIG_I2C=y CONFIG_SENSOR=y CONFIG_ADT7420=y + +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/samples/sensor/adxl372/prj.conf b/samples/sensor/adxl372/prj.conf index 780f68da34a3a..f4e29492e35e0 100644 --- a/samples/sensor/adxl372/prj.conf +++ b/samples/sensor/adxl372/prj.conf @@ -6,3 +6,5 @@ CONFIG_ADXL372=y CONFIG_ADXL372_SPI=y CONFIG_SENSOR_LOG_LEVEL_WRN=y + +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/samples/sensor/adxl372/prj_i2c.conf b/samples/sensor/adxl372/prj_i2c.conf index da27a521e0524..11d5237f174cb 100644 --- a/samples/sensor/adxl372/prj_i2c.conf +++ b/samples/sensor/adxl372/prj_i2c.conf @@ -6,3 +6,5 @@ CONFIG_ADXL372=y CONFIG_ADXL372_I2C=y CONFIG_SENSOR_LOG_LEVEL_WRN=y + +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/samples/sensor/amg88xx/prj.conf b/samples/sensor/amg88xx/prj.conf index e99836864c2b5..d931b1c3a8f8d 100644 --- a/samples/sensor/amg88xx/prj.conf +++ b/samples/sensor/amg88xx/prj.conf @@ -7,3 +7,5 @@ CONFIG_AMG88XX=y #CONFIG_AMG88XX_TRIGGER_GLOBAL_THREAD=y #CONFIG_AMG88XX_TRIGGER_OWN_THREAD=y + +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/samples/sensor/ams_iAQcore/prj.conf b/samples/sensor/ams_iAQcore/prj.conf index 70fc8b66364a9..91acbcfcb25fb 100644 --- a/samples/sensor/ams_iAQcore/prj.conf +++ b/samples/sensor/ams_iAQcore/prj.conf @@ -1,3 +1,5 @@ CONFIG_I2C=y CONFIG_SENSOR=y CONFIG_AMS_IAQ_CORE=y + +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/samples/sensor/apds9960/prj.conf b/samples/sensor/apds9960/prj.conf index 98cca5cebc2c3..7c1358efffadc 100644 --- a/samples/sensor/apds9960/prj.conf +++ b/samples/sensor/apds9960/prj.conf @@ -11,3 +11,5 @@ CONFIG_I2C_LOG_LEVEL_INF=y CONFIG_APDS9960=y CONFIG_APDS9960_TRIGGER_GLOBAL_THREAD=n CONFIG_DEVICE_POWER_MANAGEMENT=n + +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/samples/sensor/bmg160/prj.conf b/samples/sensor/bmg160/prj.conf index f1618a8104bb1..b5eec01f76fb4 100644 --- a/samples/sensor/bmg160/prj.conf +++ b/samples/sensor/bmg160/prj.conf @@ -3,3 +3,5 @@ CONFIG_GPIO=y CONFIG_I2C=y CONFIG_SENSOR=y CONFIG_BMG160=y + +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/samples/sensor/bmm150/prj.conf b/samples/sensor/bmm150/prj.conf index cb5556597e668..95147d10c42cd 100644 --- a/samples/sensor/bmm150/prj.conf +++ b/samples/sensor/bmm150/prj.conf @@ -5,3 +5,5 @@ CONFIG_GPIO=y CONFIG_SENSOR=y CONFIG_BMM150=y CONFIG_BMM150_SAMPLING_RATE_RUNTIME=y + +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/samples/sensor/ccs811/prj.conf b/samples/sensor/ccs811/prj.conf index bf9e0c4b8c839..378f10fbcc239 100644 --- a/samples/sensor/ccs811/prj.conf +++ b/samples/sensor/ccs811/prj.conf @@ -2,3 +2,5 @@ CONFIG_STDOUT_CONSOLE=y CONFIG_I2C=y CONFIG_SENSOR=y CONFIG_CCS811=y + +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/samples/sensor/ens210/prj.conf b/samples/sensor/ens210/prj.conf index 6842996e3de72..6901b60d7f467 100644 --- a/samples/sensor/ens210/prj.conf +++ b/samples/sensor/ens210/prj.conf @@ -1,3 +1,5 @@ CONFIG_I2C=y CONFIG_SENSOR=y CONFIG_ENS210=y + +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/samples/sensor/fxas21002/prj.conf b/samples/sensor/fxas21002/prj.conf index 28dc94f5410f0..b6065b89119a5 100644 --- a/samples/sensor/fxas21002/prj.conf +++ b/samples/sensor/fxas21002/prj.conf @@ -5,4 +5,3 @@ CONFIG_SENSOR=y CONFIG_FXAS21002=y CONFIG_SENSOR_LOG_LEVEL_DBG=y CONFIG_FXAS21002_TRIGGER_OWN_THREAD=y -CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/samples/sensor/fxos8700-hid/prj.conf b/samples/sensor/fxos8700-hid/prj.conf index 840971f8608e5..c69772c998b25 100644 --- a/samples/sensor/fxos8700-hid/prj.conf +++ b/samples/sensor/fxos8700-hid/prj.conf @@ -16,4 +16,3 @@ CONFIG_FXOS8700_TRIGGER_OWN_THREAD=y CONFIG_SENSOR_LOG_LEVEL_DBG=y CONFIG_GPIO=y -CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/samples/sensor/fxos8700/overlay-motion.conf b/samples/sensor/fxos8700/overlay-motion.conf index 092d2bfc96b7b..85fdafaaa1fc1 100644 --- a/samples/sensor/fxos8700/overlay-motion.conf +++ b/samples/sensor/fxos8700/overlay-motion.conf @@ -1,3 +1,2 @@ CONFIG_FXOS8700_MOTION=y CONFIG_FXOS8700_PM_LOW_POWER=y -CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/samples/sensor/fxos8700/prj.conf b/samples/sensor/fxos8700/prj.conf index 8b0e221c3b2de..f266690c7c01f 100644 --- a/samples/sensor/fxos8700/prj.conf +++ b/samples/sensor/fxos8700/prj.conf @@ -7,4 +7,3 @@ CONFIG_SENSOR_LOG_LEVEL_DBG=y CONFIG_FXOS8700_MODE_HYBRID=y CONFIG_FXOS8700_TEMP=y CONFIG_FXOS8700_TRIGGER_OWN_THREAD=y -CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/samples/sensor/fxos8700/prj_accel.conf b/samples/sensor/fxos8700/prj_accel.conf index 8652ea828a847..d64c1732dc390 100644 --- a/samples/sensor/fxos8700/prj_accel.conf +++ b/samples/sensor/fxos8700/prj_accel.conf @@ -6,4 +6,3 @@ CONFIG_FXOS8700=y CONFIG_SENSOR_LOG_LEVEL_DBG=y CONFIG_FXOS8700_MODE_ACCEL=y CONFIG_FXOS8700_TRIGGER_OWN_THREAD=y -CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/samples/sensor/grove_light/prj.conf b/samples/sensor/grove_light/prj.conf index de6536521747f..2bff9641d57ff 100644 --- a/samples/sensor/grove_light/prj.conf +++ b/samples/sensor/grove_light/prj.conf @@ -3,4 +3,3 @@ CONFIG_GROVE_LIGHT_SENSOR=y CONFIG_SENSOR=y CONFIG_NEWLIB_LIBC=y CONFIG_STDOUT_CONSOLE=y -CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/samples/sensor/grove_temperature/prj.conf b/samples/sensor/grove_temperature/prj.conf index 5299ce7585cb1..c06e93f385e9e 100644 --- a/samples/sensor/grove_temperature/prj.conf +++ b/samples/sensor/grove_temperature/prj.conf @@ -7,4 +7,3 @@ CONFIG_GROVE_TEMPERATURE_SENSOR_ADC_CHANNEL=10 CONFIG_GROVE_TEMPERATURE_SENSOR=y CONFIG_GROVE_TEMPERATURE_SENSOR_V1_X=y CONFIG_GROVE_LCD_RGB=y -CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/samples/sensor/magn_polling/prj.conf b/samples/sensor/magn_polling/prj.conf index 5f3fd1913f991..4fbabac001fc3 100644 --- a/samples/sensor/magn_polling/prj.conf +++ b/samples/sensor/magn_polling/prj.conf @@ -3,3 +3,5 @@ CONFIG_I2C=y CONFIG_GPIO=y CONFIG_SENSOR=y CONFIG_BMC150_MAGN=y + +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/samples/sensor/max30101/prj.conf b/samples/sensor/max30101/prj.conf index 466f00ed4fa84..b7b8b5445877b 100644 --- a/samples/sensor/max30101/prj.conf +++ b/samples/sensor/max30101/prj.conf @@ -4,3 +4,5 @@ CONFIG_I2C=y CONFIG_SENSOR=y CONFIG_SENSOR_LOG_LEVEL_DBG=y CONFIG_MAX30101=y + +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/samples/sensor/max44009/prj.conf b/samples/sensor/max44009/prj.conf index b79e52cd594d1..3475a931c9240 100644 --- a/samples/sensor/max44009/prj.conf +++ b/samples/sensor/max44009/prj.conf @@ -3,3 +3,5 @@ CONFIG_I2C=y CONFIG_SENSOR=y CONFIG_MAX44009=y + +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/samples/sensor/mcp9808/prj.conf b/samples/sensor/mcp9808/prj.conf index 03c6d388cc359..2b8c8fc8c7665 100644 --- a/samples/sensor/mcp9808/prj.conf +++ b/samples/sensor/mcp9808/prj.conf @@ -4,3 +4,5 @@ CONFIG_GPIO=y CONFIG_SENSOR=y CONFIG_MCP9808=y CONFIG_MCP9808_TRIGGER_GLOBAL_THREAD=y + +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/samples/sensor/ms5837/prj.conf b/samples/sensor/ms5837/prj.conf index ec58fad27b43a..d232c0b67c426 100644 --- a/samples/sensor/ms5837/prj.conf +++ b/samples/sensor/ms5837/prj.conf @@ -10,3 +10,5 @@ CONFIG_I2C_1=y CONFIG_SENSOR=y CONFIG_MS5837=y + +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/samples/sensor/sht3xd/prj.conf b/samples/sensor/sht3xd/prj.conf index 539970dd5defd..fbacfb9026e9f 100644 --- a/samples/sensor/sht3xd/prj.conf +++ b/samples/sensor/sht3xd/prj.conf @@ -8,3 +8,5 @@ CONFIG_STDOUT_CONSOLE=y CONFIG_I2C=y CONFIG_SENSOR=y CONFIG_SHT3XD=y + +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/samples/sensor/sht3xd/trigger.conf b/samples/sensor/sht3xd/trigger.conf index f0f06d981c91a..09d8f540f2a06 100644 --- a/samples/sensor/sht3xd/trigger.conf +++ b/samples/sensor/sht3xd/trigger.conf @@ -10,3 +10,5 @@ CONFIG_SENSOR=y CONFIG_SHT3XD=y CONFIG_SHT3XD_TRIGGER=y CONFIG_SHT3XD_TRIGGER_GLOBAL_THREAD=y + +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/samples/sensor/sx9500/prj.conf b/samples/sensor/sx9500/prj.conf index 03f6cb6cf5e81..ff43f28632f57 100644 --- a/samples/sensor/sx9500/prj.conf +++ b/samples/sensor/sx9500/prj.conf @@ -2,3 +2,5 @@ CONFIG_I2C=y CONFIG_GPIO=y CONFIG_SENSOR=y CONFIG_SX9500=y + +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/samples/sensor/th02/prj.conf b/samples/sensor/th02/prj.conf index 45d648eae4bf7..cf7ba795063d5 100644 --- a/samples/sensor/th02/prj.conf +++ b/samples/sensor/th02/prj.conf @@ -6,3 +6,5 @@ CONFIG_LOG=n CONFIG_SENSOR_LOG_LEVEL_DBG=y CONFIG_GROVE_LCD_RGB=y CONFIG_DISPLAY=y + +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/samples/sensor/thermometer/prj.conf b/samples/sensor/thermometer/prj.conf index 2ee2ffb6e8013..1169a993699ae 100644 --- a/samples/sensor/thermometer/prj.conf +++ b/samples/sensor/thermometer/prj.conf @@ -1,2 +1,3 @@ CONFIG_SENSOR=y CONFIG_STDOUT_CONSOLE=y +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/samples/sensor/ti_hdc/prj.conf b/samples/sensor/ti_hdc/prj.conf index d23a2ef0cc64b..456d5328aa5a3 100644 --- a/samples/sensor/ti_hdc/prj.conf +++ b/samples/sensor/ti_hdc/prj.conf @@ -3,4 +3,3 @@ CONFIG_I2C=y CONFIG_GPIO=y CONFIG_SENSOR=y CONFIG_TI_HDC=y -CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/samples/sensor/tmp112/prj.conf b/samples/sensor/tmp112/prj.conf index f720f45087c10..f2c18c29c5100 100644 --- a/samples/sensor/tmp112/prj.conf +++ b/samples/sensor/tmp112/prj.conf @@ -2,3 +2,5 @@ CONFIG_STDOUT_CONSOLE=y CONFIG_I2C=y CONFIG_SENSOR=y CONFIG_TMP112=y + +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/samples/shields/x_nucleo_iks01a1/prj.conf b/samples/shields/x_nucleo_iks01a1/prj.conf index c164f74a04c63..cdc401636fa58 100644 --- a/samples/shields/x_nucleo_iks01a1/prj.conf +++ b/samples/shields/x_nucleo_iks01a1/prj.conf @@ -8,3 +8,5 @@ CONFIG_LSM6DS0=y CONFIG_LIS3MDL=y CONFIG_HTS221_TRIGGER_NONE=y CONFIG_LIS3MDL_TRIGGER_NONE=y + +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/samples/shields/x_nucleo_iks01a2/prj.conf b/samples/shields/x_nucleo_iks01a2/prj.conf index 9aacdc0d79aaf..04a40449ed448 100644 --- a/samples/shields/x_nucleo_iks01a2/prj.conf +++ b/samples/shields/x_nucleo_iks01a2/prj.conf @@ -9,3 +9,5 @@ CONFIG_LIS2DH=y CONFIG_LIS2MDL=y CONFIG_HTS221_TRIGGER_NONE=y CONFIG_LIS2MDL_TRIGGER_NONE=y + +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/samples/shields/x_nucleo_iks01a3/sensorhub/shub.conf b/samples/shields/x_nucleo_iks01a3/sensorhub/shub.conf index 83e7a1d7e02b6..73dce057042e7 100644 --- a/samples/shields/x_nucleo_iks01a3/sensorhub/shub.conf +++ b/samples/shields/x_nucleo_iks01a3/sensorhub/shub.conf @@ -14,3 +14,5 @@ CONFIG_LSM6DSO_SENSORHUB=y CONFIG_LSM6DSO_EXT_LIS2MDL=y CONFIG_LSM6DSO_EXT_LPS22HH=y CONFIG_LSM6DSO_EXT_HTS221=n + +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/samples/shields/x_nucleo_iks01a3/standard/prj.conf b/samples/shields/x_nucleo_iks01a3/standard/prj.conf index 5ba26dcfa1274..9c4f1ce0ba48e 100644 --- a/samples/shields/x_nucleo_iks01a3/standard/prj.conf +++ b/samples/shields/x_nucleo_iks01a3/standard/prj.conf @@ -18,3 +18,5 @@ CONFIG_LSM6DSO=y CONFIG_LSM6DSO_ENABLE_TEMP=n CONFIG_LSM6DSO_INT_PIN_1=y CONFIG_LSM6DSO_TRIGGER_OWN_THREAD=y + +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/samples/subsys/console/echo/prj.conf b/samples/subsys/console/echo/prj.conf index 82efd1466fb50..4dd0a714cff28 100644 --- a/samples/subsys/console/echo/prj.conf +++ b/samples/subsys/console/echo/prj.conf @@ -2,4 +2,3 @@ CONFIG_CONSOLE_SUBSYS=y CONFIG_CONSOLE_GETCHAR=y CONFIG_CONSOLE_GETCHAR_BUFSIZE=64 CONFIG_CONSOLE_PUTCHAR_BUFSIZE=512 -CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/samples/subsys/console/getchar/prj.conf b/samples/subsys/console/getchar/prj.conf index eb8291dc1216b..74e42c5877648 100644 --- a/samples/subsys/console/getchar/prj.conf +++ b/samples/subsys/console/getchar/prj.conf @@ -1,3 +1,2 @@ CONFIG_CONSOLE_SUBSYS=y CONFIG_CONSOLE_GETCHAR=y -CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/samples/subsys/console/getline/prj.conf b/samples/subsys/console/getline/prj.conf index 013a5d1be39c7..682886236468c 100644 --- a/samples/subsys/console/getline/prj.conf +++ b/samples/subsys/console/getline/prj.conf @@ -1,2 +1,4 @@ CONFIG_CONSOLE_SUBSYS=y CONFIG_CONSOLE_GETLINE=y + +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/samples/subsys/fs/fat_fs/prj.conf b/samples/subsys/fs/fat_fs/prj.conf index 8c90eaf042e06..34c2ef042101a 100644 --- a/samples/subsys/fs/fat_fs/prj.conf +++ b/samples/subsys/fs/fat_fs/prj.conf @@ -8,4 +8,3 @@ CONFIG_LOG=y CONFIG_FILE_SYSTEM=y CONFIG_FAT_FILESYSTEM_ELM=y CONFIG_PRINTK=y -CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/samples/subsys/fs/fat_fs/prj_mimxrt1050_evk.conf b/samples/subsys/fs/fat_fs/prj_mimxrt1050_evk.conf index 45b89cb245ce9..afd105a700c84 100644 --- a/samples/subsys/fs/fat_fs/prj_mimxrt1050_evk.conf +++ b/samples/subsys/fs/fat_fs/prj_mimxrt1050_evk.conf @@ -9,4 +9,3 @@ CONFIG_LOG=y CONFIG_FILE_SYSTEM=y CONFIG_FAT_FILESYSTEM_ELM=y CONFIG_PRINTK=y -CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/samples/subsys/fs/littlefs/prj.conf b/samples/subsys/fs/littlefs/prj.conf index 833d700fefb80..032169fb29553 100644 --- a/samples/subsys/fs/littlefs/prj.conf +++ b/samples/subsys/fs/littlefs/prj.conf @@ -21,3 +21,5 @@ CONFIG_FLASH_PAGE_LAYOUT=y CONFIG_FILE_SYSTEM=y CONFIG_FILE_SYSTEM_LITTLEFS=y + +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/samples/subsys/ipc/ipm_mhu_dual_core/prj.conf b/samples/subsys/ipc/ipm_mhu_dual_core/prj.conf index 08b417d7cce08..590514df217e5 100644 --- a/samples/subsys/ipc/ipm_mhu_dual_core/prj.conf +++ b/samples/subsys/ipc/ipm_mhu_dual_core/prj.conf @@ -1,2 +1,4 @@ CONFIG_IPM=y CONFIG_IPM_MHU=y + +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/samples/subsys/ipc/openamp/prj.conf b/samples/subsys/ipc/openamp/prj.conf index ff29597b4c81d..a9b5cad7d290b 100644 --- a/samples/subsys/ipc/openamp/prj.conf +++ b/samples/subsys/ipc/openamp/prj.conf @@ -7,4 +7,3 @@ CONFIG_TIMESLICE_SIZE=1 CONFIG_MAIN_STACK_SIZE=2048 CONFIG_HEAP_MEM_POOL_SIZE=4096 CONFIG_OPENAMP=y -CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/samples/subsys/logging/logger/prj.conf b/samples/subsys/logging/logger/prj.conf index 900df40fc8e6b..f5210abb984f9 100644 --- a/samples/subsys/logging/logger/prj.conf +++ b/samples/subsys/logging/logger/prj.conf @@ -4,3 +4,4 @@ CONFIG_LOG_BUFFER_SIZE=2048 CONFIG_LOG_PRINTK=y CONFIG_LOG_PROCESS_TRIGGER_THRESHOLD=0 CONFIG_COVERAGE=n +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/samples/subsys/nvs/prj.conf b/samples/subsys/nvs/prj.conf index 2cf7ed9535f97..dd5d8f56646cb 100644 --- a/samples/subsys/nvs/prj.conf +++ b/samples/subsys/nvs/prj.conf @@ -6,3 +6,5 @@ CONFIG_LOG=y CONFIG_NVS_LOG_LEVEL_DBG=y CONFIG_REBOOT=y CONFIG_MPU_ALLOW_FLASH_WRITE=y + +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/samples/subsys/power/device_pm/prj.conf b/samples/subsys/power/device_pm/prj.conf index 98088b4d50dbd..66929541e744d 100644 --- a/samples/subsys/power/device_pm/prj.conf +++ b/samples/subsys/power/device_pm/prj.conf @@ -1,3 +1,5 @@ CONFIG_SYS_POWER_MANAGEMENT=y CONFIG_DEVICE_POWER_MANAGEMENT=y CONFIG_DEVICE_IDLE_PM=y + +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/samples/subsys/shell/fs/prj.conf b/samples/subsys/shell/fs/prj.conf index 784e8fbdac096..9b6bfe02cd19c 100644 --- a/samples/subsys/shell/fs/prj.conf +++ b/samples/subsys/shell/fs/prj.conf @@ -16,3 +16,5 @@ CONFIG_FILE_SYSTEM_NFFS=y CONFIG_FILE_SYSTEM_LITTLEFS=y CONFIG_FLASH_MAP=y CONFIG_FLASH_PAGE_LAYOUT=y + +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/samples/subsys/shell/shell_module/prj.conf b/samples/subsys/shell/shell_module/prj.conf index 643edf1d62c02..29bd82becf0a7 100644 --- a/samples/subsys/shell/shell_module/prj.conf +++ b/samples/subsys/shell/shell_module/prj.conf @@ -7,4 +7,3 @@ CONFIG_INIT_STACKS=y CONFIG_BOOT_BANNER=n CONFIG_THREAD_NAME=y CONFIG_DEVICE_SHELL=y -CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/samples/subsys/shell/shell_module/prj_minimal.conf b/samples/subsys/shell/shell_module/prj_minimal.conf index 0aa836f36c3dc..3fe1e3fc79045 100644 --- a/samples/subsys/shell/shell_module/prj_minimal.conf +++ b/samples/subsys/shell/shell_module/prj_minimal.conf @@ -17,4 +17,3 @@ CONFIG_SHELL_VT100_COLORS=n CONFIG_SHELL_HELP_ON_WRONG_ARGUMENT_COUNT=n CONFIG_SHELL_STATS=n CONFIG_SHELL_CMDS=n -CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/samples/subsys/shell/shell_module/prj_minimal_rtt.conf b/samples/subsys/shell/shell_module/prj_minimal_rtt.conf index 40948e85cdcb4..f5c278dbf0c12 100644 --- a/samples/subsys/shell/shell_module/prj_minimal_rtt.conf +++ b/samples/subsys/shell/shell_module/prj_minimal_rtt.conf @@ -22,4 +22,3 @@ CONFIG_CONSOLE=y #enable RTT shell CONFIG_USE_SEGGER_RTT=y CONFIG_SHELL_BACKEND_RTT=y -CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/samples/subsys/usb/cdc_acm/overlay-composite-cdc-dfu.conf b/samples/subsys/usb/cdc_acm/overlay-composite-cdc-dfu.conf index a37377c8e80ba..24a640cbeb170 100644 --- a/samples/subsys/usb/cdc_acm/overlay-composite-cdc-dfu.conf +++ b/samples/subsys/usb/cdc_acm/overlay-composite-cdc-dfu.conf @@ -8,5 +8,3 @@ CONFIG_FLASH=y CONFIG_IMG_MANAGER=y CONFIG_FLASH_PAGE_LAYOUT=y CONFIG_BOOTLOADER_MCUBOOT=y -CONFIG_SYS_TIMEOUT_LEGACY_API=y -CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/samples/subsys/usb/cdc_acm/overlay-composite-cdc-msc.conf b/samples/subsys/usb/cdc_acm/overlay-composite-cdc-msc.conf index 539dd5822c2dc..f6f109cece68b 100644 --- a/samples/subsys/usb/cdc_acm/overlay-composite-cdc-msc.conf +++ b/samples/subsys/usb/cdc_acm/overlay-composite-cdc-msc.conf @@ -8,5 +8,3 @@ CONFIG_USB_MASS_STORAGE_LOG_LEVEL_ERR=y #RAM DISK CONFIG_DISK_ACCESS_RAM=y -CONFIG_SYS_TIMEOUT_LEGACY_API=y -CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/samples/subsys/usb/cdc_acm/prj.conf b/samples/subsys/usb/cdc_acm/prj.conf index bf847f1b6a389..54d59b80bd2d7 100644 --- a/samples/subsys/usb/cdc_acm/prj.conf +++ b/samples/subsys/usb/cdc_acm/prj.conf @@ -10,5 +10,3 @@ CONFIG_USB_DEVICE_LOG_LEVEL_ERR=y CONFIG_SERIAL=y CONFIG_UART_INTERRUPT_DRIVEN=y CONFIG_UART_LINE_CTRL=y -CONFIG_SYS_TIMEOUT_LEGACY_API=y -CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/samples/subsys/usb/cdc_acm_composite/prj.conf b/samples/subsys/usb/cdc_acm_composite/prj.conf index ab1dd9de76202..6da8a1745979f 100644 --- a/samples/subsys/usb/cdc_acm_composite/prj.conf +++ b/samples/subsys/usb/cdc_acm_composite/prj.conf @@ -15,4 +15,3 @@ CONFIG_USB_CDC_ACM_RINGBUF_SIZE=512 CONFIG_USB_DEVICE_LOG_LEVEL_ERR=y CONFIG_USB_DRIVER_LOG_LEVEL_ERR=y -CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/samples/subsys/usb/console/prj.conf b/samples/subsys/usb/console/prj.conf index 3b90e3c9b5e1e..0961ff44878f8 100644 --- a/samples/subsys/usb/console/prj.conf +++ b/samples/subsys/usb/console/prj.conf @@ -10,4 +10,3 @@ CONFIG_UART_LINE_CTRL=y CONFIG_UART_CONSOLE_ON_DEV_NAME="CDC_ACM_0" CONFIG_USB_UART_DTR_WAIT=y -CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/samples/subsys/usb/dfu/prj.conf b/samples/subsys/usb/dfu/prj.conf index ffc1e9080bfc7..339e6e17b7ad6 100644 --- a/samples/subsys/usb/dfu/prj.conf +++ b/samples/subsys/usb/dfu/prj.conf @@ -11,3 +11,5 @@ CONFIG_LOG=y CONFIG_USB_DRIVER_LOG_LEVEL_ERR=y CONFIG_USB_DEVICE_LOG_LEVEL_ERR=y CONFIG_BOOTLOADER_MCUBOOT=y + +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/samples/subsys/usb/hid-cdc/prj.conf b/samples/subsys/usb/hid-cdc/prj.conf index cb7293941fc1d..5a2085c98f57f 100644 --- a/samples/subsys/usb/hid-cdc/prj.conf +++ b/samples/subsys/usb/hid-cdc/prj.conf @@ -20,4 +20,3 @@ CONFIG_UART_INTERRUPT_DRIVEN=y CONFIG_UART_LINE_CTRL=y CONFIG_GPIO=y -CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/samples/subsys/usb/hid-mouse/prj.conf b/samples/subsys/usb/hid-mouse/prj.conf index acd174db65297..071214c294132 100644 --- a/samples/subsys/usb/hid-mouse/prj.conf +++ b/samples/subsys/usb/hid-mouse/prj.conf @@ -8,4 +8,3 @@ CONFIG_USB_DRIVER_LOG_LEVEL_ERR=y CONFIG_USB_DEVICE_LOG_LEVEL_ERR=y CONFIG_GPIO=y -CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/samples/subsys/usb/hid/prj.conf b/samples/subsys/usb/hid/prj.conf index 6f5faa6ae963b..638dba457c06b 100644 --- a/samples/subsys/usb/hid/prj.conf +++ b/samples/subsys/usb/hid/prj.conf @@ -7,5 +7,3 @@ CONFIG_USB_HID_BOOT_PROTOCOL=y CONFIG_LOG=y CONFIG_USB_DRIVER_LOG_LEVEL_ERR=y CONFIG_USB_DEVICE_LOG_LEVEL_ERR=y -CONFIG_SYS_TIMEOUT_LEGACY_API=y -CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/samples/subsys/usb/mass/overlay-flash-disk.conf b/samples/subsys/usb/mass/overlay-flash-disk.conf index bba574a113cf8..d95ffc833825a 100644 --- a/samples/subsys/usb/mass/overlay-flash-disk.conf +++ b/samples/subsys/usb/mass/overlay-flash-disk.conf @@ -2,4 +2,3 @@ CONFIG_DISK_ACCESS_FLASH=y CONFIG_MASS_STORAGE_DISK_NAME="NAND" CONFIG_SPI=y -CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/samples/subsys/usb/mass/overlay-ram-disk.conf b/samples/subsys/usb/mass/overlay-ram-disk.conf index f9dd984531907..0f9c0ad690641 100644 --- a/samples/subsys/usb/mass/overlay-ram-disk.conf +++ b/samples/subsys/usb/mass/overlay-ram-disk.conf @@ -1,4 +1,3 @@ # config to disk access over RAM CONFIG_DISK_ACCESS_RAM=y CONFIG_MASS_STORAGE_DISK_NAME="RAM" -CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/samples/subsys/usb/mass/prj.conf b/samples/subsys/usb/mass/prj.conf index dccf65a85e1d3..6428d785f5f7e 100644 --- a/samples/subsys/usb/mass/prj.conf +++ b/samples/subsys/usb/mass/prj.conf @@ -14,4 +14,3 @@ CONFIG_USB_MASS_STORAGE_LOG_LEVEL_ERR=y # If the target's code needs to do file operations, enable target's # FAT FS code. (Without this only the host can access the fs contents) #CONFIG_FILE_SYSTEM=y -CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/samples/subsys/usb/mass/prj_nrf52840_pca10056.conf b/samples/subsys/usb/mass/prj_nrf52840_pca10056.conf index 6979d07443ead..2a053f32ec6b8 100644 --- a/samples/subsys/usb/mass/prj_nrf52840_pca10056.conf +++ b/samples/subsys/usb/mass/prj_nrf52840_pca10056.conf @@ -24,4 +24,3 @@ CONFIG_DISK_VOLUME_SIZE=0x10000 CONFIG_FILE_SYSTEM=y CONFIG_FAT_FILESYSTEM_ELM=y CONFIG_MPU_ALLOW_FLASH_WRITE=y -CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/samples/subsys/usb/testusb/prj.conf b/samples/subsys/usb/testusb/prj.conf index 83ce98ce67ad4..c191bbc29e573 100644 --- a/samples/subsys/usb/testusb/prj.conf +++ b/samples/subsys/usb/testusb/prj.conf @@ -8,4 +8,3 @@ CONFIG_LOG=y CONFIG_USB_DRIVER_LOG_LEVEL_ERR=y CONFIG_USB_DEVICE_LOOPBACK=y CONFIG_USB_DEVICE_LOG_LEVEL_ERR=y -CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/samples/subsys/usb/webusb/prj.conf b/samples/subsys/usb/webusb/prj.conf index 170bc4e1a64de..872e7f6286907 100644 --- a/samples/subsys/usb/webusb/prj.conf +++ b/samples/subsys/usb/webusb/prj.conf @@ -10,4 +10,3 @@ CONFIG_UART_LINE_CTRL=y CONFIG_LOG=y CONFIG_USB_DRIVER_LOG_LEVEL_ERR=y CONFIG_USB_DEVICE_LOG_LEVEL_ERR=y -CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/samples/synchronization/prj.conf b/samples/synchronization/prj.conf index 397505c1f87e5..fb9f4cdb23f48 100644 --- a/samples/synchronization/prj.conf +++ b/samples/synchronization/prj.conf @@ -1,4 +1,3 @@ CONFIG_STDOUT_CONSOLE=y # enable to use thread names #CONFIG_THREAD_NAME=y -CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/samples/testing/integration/prj.conf b/samples/testing/integration/prj.conf index 9467c2926896d..7049cf0e1675f 100644 --- a/samples/testing/integration/prj.conf +++ b/samples/testing/integration/prj.conf @@ -1 +1,2 @@ CONFIG_ZTEST=y +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/samples/userspace/shared_mem/prj.conf b/samples/userspace/shared_mem/prj.conf index 90b88349b6f52..9993c70f3e1bf 100644 --- a/samples/userspace/shared_mem/prj.conf +++ b/samples/userspace/shared_mem/prj.conf @@ -1 +1,3 @@ CONFIG_USERSPACE=y + +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/tests/application_development/cpp/prj.conf b/tests/application_development/cpp/prj.conf index a76c3977d960c..5162a7aea2bd5 100644 --- a/tests/application_development/cpp/prj.conf +++ b/tests/application_development/cpp/prj.conf @@ -2,4 +2,3 @@ CONFIG_CPLUSPLUS=y CONFIG_NET_BUF=y CONFIG_ZTEST=y CONFIG_ZTEST_STACKSIZE=2048 -CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/application_development/gen_inc_file/prj.conf b/tests/application_development/gen_inc_file/prj.conf index ee99453b0bd5c..766d267540f0f 100644 --- a/tests/application_development/gen_inc_file/prj.conf +++ b/tests/application_development/gen_inc_file/prj.conf @@ -1,2 +1,3 @@ CONFIG_ZTEST=y CONFIG_ZTEST_STACKSIZE=2048 +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/tests/application_development/libcxx/prj.conf b/tests/application_development/libcxx/prj.conf index aade1fafb7d70..6a08c3bead392 100644 --- a/tests/application_development/libcxx/prj.conf +++ b/tests/application_development/libcxx/prj.conf @@ -5,3 +5,5 @@ CONFIG_STD_CPP17=y CONFIG_HEAP_MEM_POOL_SIZE=1024 CONFIG_ZTEST=y CONFIG_ZTEST_STACKSIZE=2048 + +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/tests/arch/arm/arm_irq_vector_table/prj.conf b/tests/arch/arm/arm_irq_vector_table/prj.conf index 74a22e9196a4b..37ca96b0d973d 100644 --- a/tests/arch/arm/arm_irq_vector_table/prj.conf +++ b/tests/arch/arm/arm_irq_vector_table/prj.conf @@ -3,3 +3,5 @@ CONFIG_GEN_ISR_TABLES=n CONFIG_NUM_IRQS=3 # Force Bluetooth disable (required by platforms that enable Bluetooth by default) CONFIG_BT=n + +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/tests/arch/arm/arm_ramfunc/prj.conf b/tests/arch/arm/arm_ramfunc/prj.conf index e39776e7067ab..5a0680df77f94 100644 --- a/tests/arch/arm/arm_ramfunc/prj.conf +++ b/tests/arch/arm/arm_ramfunc/prj.conf @@ -1,2 +1,4 @@ CONFIG_ZTEST=y CONFIG_TEST_USERSPACE=y + +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/tests/arch/arm/arm_runtime_nmi/prj.conf b/tests/arch/arm/arm_runtime_nmi/prj.conf index f113d1dd4bdc3..7049cf0e1675f 100644 --- a/tests/arch/arm/arm_runtime_nmi/prj.conf +++ b/tests/arch/arm/arm_runtime_nmi/prj.conf @@ -1,2 +1,2 @@ CONFIG_ZTEST=y -CONFIG_SYS_TIMEOUT_LEGACY_API=y +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/tests/arch/arm/arm_thread_swap/prj.conf b/tests/arch/arm/arm_thread_swap/prj.conf index f3c13ff7d138e..db7a03e514a69 100644 --- a/tests/arch/arm/arm_thread_swap/prj.conf +++ b/tests/arch/arm/arm_thread_swap/prj.conf @@ -1,3 +1,5 @@ CONFIG_ZTEST=y CONFIG_TEST_USERSPACE=y CONFIG_MAIN_STACK_SIZE=1024 + +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/tests/arch/arm/arm_zero_latency_irqs/prj.conf b/tests/arch/arm/arm_zero_latency_irqs/prj.conf index cb585d8f1bc97..3fa90b15955fe 100644 --- a/tests/arch/arm/arm_zero_latency_irqs/prj.conf +++ b/tests/arch/arm/arm_zero_latency_irqs/prj.conf @@ -1,3 +1,5 @@ CONFIG_ZTEST=y CONFIG_DYNAMIC_INTERRUPTS=y CONFIG_ZERO_LATENCY_IRQS=y + +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/tests/arch/x86/static_idt/prj.conf b/tests/arch/x86/static_idt/prj.conf index 246e254ad1cb5..4a06ed52d5dda 100644 --- a/tests/arch/x86/static_idt/prj.conf +++ b/tests/arch/x86/static_idt/prj.conf @@ -1,3 +1,5 @@ CONFIG_EXCEPTION_DEBUG=n CONFIG_MAIN_THREAD_PRIORITY=6 CONFIG_ZTEST=y + +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/tests/benchmarks/app_kernel/prj.conf b/tests/benchmarks/app_kernel/prj.conf index 982ed5da1bab7..95c251efacf21 100644 --- a/tests/benchmarks/app_kernel/prj.conf +++ b/tests/benchmarks/app_kernel/prj.conf @@ -11,4 +11,3 @@ CONFIG_FORCE_NO_ASSERT=y #Disable Userspace CONFIG_TEST_HW_STACK_PROTECTION=n -CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/benchmarks/app_kernel/prj_fp.conf b/tests/benchmarks/app_kernel/prj_fp.conf index 995a848111eea..a1ca04e620069 100644 --- a/tests/benchmarks/app_kernel/prj_fp.conf +++ b/tests/benchmarks/app_kernel/prj_fp.conf @@ -16,4 +16,3 @@ CONFIG_FORCE_NO_ASSERT=y #Disable Userspace CONFIG_TEST_HW_STACK_PROTECTION=n -CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/benchmarks/boot_time/prj.conf b/tests/benchmarks/boot_time/prj.conf index 8eab36956cf20..360f06ce67d07 100644 --- a/tests/benchmarks/boot_time/prj.conf +++ b/tests/benchmarks/boot_time/prj.conf @@ -3,3 +3,4 @@ CONFIG_BOOT_TIME_MEASUREMENT=y CONFIG_TEST_RANDOM_GENERATOR=y CONFIG_FORCE_NO_ASSERT=y CONFIG_TEST_HW_STACK_PROTECTION=n +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/tests/benchmarks/latency_measure/prj.conf b/tests/benchmarks/latency_measure/prj.conf index b205f82287f47..9d350c1ad12e9 100644 --- a/tests/benchmarks/latency_measure/prj.conf +++ b/tests/benchmarks/latency_measure/prj.conf @@ -15,4 +15,3 @@ CONFIG_FORCE_NO_ASSERT=y CONFIG_TEST_HW_STACK_PROTECTION=n CONFIG_COVERAGE=n -CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/benchmarks/mbedtls/prj.conf b/tests/benchmarks/mbedtls/prj.conf index a930c945879c2..73d830afeec92 100644 --- a/tests/benchmarks/mbedtls/prj.conf +++ b/tests/benchmarks/mbedtls/prj.conf @@ -22,3 +22,5 @@ CONFIG_MBEDTLS_ECP_ALL_ENABLED=y CONFIG_MBEDTLS_MAC_ALL_ENABLED=y CONFIG_MBEDTLS_GENPRIME_ENABLED=y CONFIG_MBEDTLS_HMAC_DRBG_ENABLED=y + +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/tests/benchmarks/sys_kernel/prj.conf b/tests/benchmarks/sys_kernel/prj.conf index 484c11d6e5bec..05152f924389b 100644 --- a/tests/benchmarks/sys_kernel/prj.conf +++ b/tests/benchmarks/sys_kernel/prj.conf @@ -10,4 +10,3 @@ CONFIG_MAIN_STACK_SIZE=16384 CONFIG_FORCE_NO_ASSERT=y CONFIG_TEST_HW_STACK_PROTECTION=n -CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/benchmarks/timing_info/prj_userspace.conf b/tests/benchmarks/timing_info/prj_userspace.conf index 93559f22cc915..2ac7275683681 100644 --- a/tests/benchmarks/timing_info/prj_userspace.conf +++ b/tests/benchmarks/timing_info/prj_userspace.conf @@ -6,4 +6,3 @@ CONFIG_MAIN_STACK_SIZE=2048 CONFIG_FORCE_NO_ASSERT=y CONFIG_APPLICATION_DEFINED_SYSCALL=y CONFIG_TEST_USERSPACE=y -CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/bluetooth/at/prj.conf b/tests/bluetooth/at/prj.conf index d76653ced8521..42737f3052ba8 100644 --- a/tests/bluetooth/at/prj.conf +++ b/tests/bluetooth/at/prj.conf @@ -4,4 +4,3 @@ CONFIG_BT_HFP_HF=y CONFIG_NET_BUF=y CONFIG_ZTEST=y CONFIG_SERIAL=y -CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/bluetooth/bluetooth/prj.conf b/tests/bluetooth/bluetooth/prj.conf index 32bb78ba986a3..f43d042a8fbb4 100644 --- a/tests/bluetooth/bluetooth/prj.conf +++ b/tests/bluetooth/bluetooth/prj.conf @@ -4,4 +4,3 @@ CONFIG_BT_NO_DRIVER=y CONFIG_BT_DEBUG_LOG=y CONFIG_UART_INTERRUPT_DRIVEN=n CONFIG_ZTEST=y -CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/bluetooth/ctrl_user_ext/prj.conf b/tests/bluetooth/ctrl_user_ext/prj.conf index 0844fe772ec7e..a9320df957f66 100644 --- a/tests/bluetooth/ctrl_user_ext/prj.conf +++ b/tests/bluetooth/ctrl_user_ext/prj.conf @@ -8,3 +8,5 @@ CONFIG_BT_CTLR_ADVANCED_FEATURES=y CONFIG_BT_CTLR_USER_EXT=y CONFIG_BT_CTLR_USER_EVT_RANGE=10 CONFIG_BT_RX_USER_PDU_LEN=7 + +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/tests/bluetooth/gatt/prj.conf b/tests/bluetooth/gatt/prj.conf index 80f22c26cba9c..35c557eb8bdb6 100644 --- a/tests/bluetooth/gatt/prj.conf +++ b/tests/bluetooth/gatt/prj.conf @@ -8,4 +8,3 @@ CONFIG_BT_NO_DRIVER=y CONFIG_BT_DEBUG_LOG=y CONFIG_BT_PERIPHERAL=y CONFIG_BT_GATT_DYNAMIC_DB=y -CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/bluetooth/hci_prop_evt/prj.conf b/tests/bluetooth/hci_prop_evt/prj.conf index 8b4238a1133ef..0f6d72f0e51cf 100644 --- a/tests/bluetooth/hci_prop_evt/prj.conf +++ b/tests/bluetooth/hci_prop_evt/prj.conf @@ -12,4 +12,3 @@ CONFIG_BT_DEBUG_HCI_CORE=y CONFIG_BT_DEBUG_HCI_DRIVER=y CONFIG_HEAP_MEM_POOL_SIZE=2048 -CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/bluetooth/init/prj.conf b/tests/bluetooth/init/prj.conf index f927efa82eb31..4467fc0b66d83 100644 --- a/tests/bluetooth/init/prj.conf +++ b/tests/bluetooth/init/prj.conf @@ -2,4 +2,3 @@ CONFIG_BT=y CONFIG_BT_DEBUG_LOG=y CONFIG_ZTEST=y -CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/bluetooth/init/prj_0.conf b/tests/bluetooth/init/prj_0.conf index f6714112db2c6..6cf1e6d31986b 100644 --- a/tests/bluetooth/init/prj_0.conf +++ b/tests/bluetooth/init/prj_0.conf @@ -1,4 +1,3 @@ CONFIG_BT=y CONFIG_ZTEST=y -CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/bluetooth/init/prj_1.conf b/tests/bluetooth/init/prj_1.conf index efd8d1fb92a53..009be0089521a 100644 --- a/tests/bluetooth/init/prj_1.conf +++ b/tests/bluetooth/init/prj_1.conf @@ -2,4 +2,3 @@ CONFIG_BT=y CONFIG_BT_PERIPHERAL=y CONFIG_ZTEST=y -CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/bluetooth/init/prj_10.conf b/tests/bluetooth/init/prj_10.conf index 458ac24721583..c3024a1bed850 100644 --- a/tests/bluetooth/init/prj_10.conf +++ b/tests/bluetooth/init/prj_10.conf @@ -8,4 +8,3 @@ CONFIG_BT_TINYCRYPT_ECC=y CONFIG_BT_USE_DEBUG_KEYS=y CONFIG_ZTEST=y -CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/bluetooth/init/prj_11.conf b/tests/bluetooth/init/prj_11.conf index aa9d5d994b245..67a3e1e47cc83 100644 --- a/tests/bluetooth/init/prj_11.conf +++ b/tests/bluetooth/init/prj_11.conf @@ -10,4 +10,3 @@ CONFIG_BT_L2CAP_DYNAMIC_CHANNEL=y CONFIG_BT_GATT_CLIENT=y CONFIG_ZTEST=y -CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/bluetooth/init/prj_12.conf b/tests/bluetooth/init/prj_12.conf index b11e600cb340b..d267932666726 100644 --- a/tests/bluetooth/init/prj_12.conf +++ b/tests/bluetooth/init/prj_12.conf @@ -9,4 +9,3 @@ CONFIG_BT_L2CAP_DYNAMIC_CHANNEL=y CONFIG_BT_GATT_CLIENT=y CONFIG_ZTEST=y -CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/bluetooth/init/prj_13.conf b/tests/bluetooth/init/prj_13.conf index 614f9bc9c56ad..ea893a3aab156 100644 --- a/tests/bluetooth/init/prj_13.conf +++ b/tests/bluetooth/init/prj_13.conf @@ -9,4 +9,3 @@ CONFIG_BT_L2CAP_DYNAMIC_CHANNEL=y CONFIG_BT_GATT_CLIENT=y CONFIG_ZTEST=y -CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/bluetooth/init/prj_14.conf b/tests/bluetooth/init/prj_14.conf index 99802fd23c248..688672764031b 100644 --- a/tests/bluetooth/init/prj_14.conf +++ b/tests/bluetooth/init/prj_14.conf @@ -6,4 +6,3 @@ CONFIG_BT_SIGNING=y CONFIG_BT_TINYCRYPT_ECC=y CONFIG_ZTEST=y -CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/bluetooth/init/prj_15.conf b/tests/bluetooth/init/prj_15.conf index 07033c39a465d..d4b2a0d13a6e5 100644 --- a/tests/bluetooth/init/prj_15.conf +++ b/tests/bluetooth/init/prj_15.conf @@ -6,4 +6,3 @@ CONFIG_BT_SMP_SC_ONLY=y CONFIG_BT_TINYCRYPT_ECC=y CONFIG_ZTEST=y -CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/bluetooth/init/prj_16.conf b/tests/bluetooth/init/prj_16.conf index 73902b2b4a444..d68f68883c3d5 100644 --- a/tests/bluetooth/init/prj_16.conf +++ b/tests/bluetooth/init/prj_16.conf @@ -6,4 +6,3 @@ CONFIG_BT_L2CAP_DYNAMIC_CHANNEL=y CONFIG_BT_GATT_CLIENT=y CONFIG_ZTEST=y -CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/bluetooth/init/prj_17.conf b/tests/bluetooth/init/prj_17.conf index b0fc9e12ed164..b4f33a6c28728 100644 --- a/tests/bluetooth/init/prj_17.conf +++ b/tests/bluetooth/init/prj_17.conf @@ -21,4 +21,3 @@ CONFIG_BT_DEBUG_GATT=y CONFIG_BT_BREDR=y CONFIG_ZTEST=y -CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/bluetooth/init/prj_18.conf b/tests/bluetooth/init/prj_18.conf index b7993da578ab0..474265ca0f75f 100644 --- a/tests/bluetooth/init/prj_18.conf +++ b/tests/bluetooth/init/prj_18.conf @@ -3,4 +3,3 @@ CONFIG_BT_PERIPHERAL=y CONFIG_BT_BREDR=y CONFIG_ZTEST=y -CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/bluetooth/init/prj_19.conf b/tests/bluetooth/init/prj_19.conf index 7b34f4a58ecda..deaf3a3bbe5b1 100644 --- a/tests/bluetooth/init/prj_19.conf +++ b/tests/bluetooth/init/prj_19.conf @@ -3,4 +3,3 @@ CONFIG_BT_CENTRAL=y CONFIG_BT_BREDR=y CONFIG_ZTEST=y -CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/bluetooth/init/prj_2.conf b/tests/bluetooth/init/prj_2.conf index 9c29db35ce6f2..3802a5144f0ad 100644 --- a/tests/bluetooth/init/prj_2.conf +++ b/tests/bluetooth/init/prj_2.conf @@ -2,4 +2,3 @@ CONFIG_BT=y CONFIG_BT_CENTRAL=y CONFIG_ZTEST=y -CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/bluetooth/init/prj_20.conf b/tests/bluetooth/init/prj_20.conf index 472464a999649..c0d6ca845e7a5 100644 --- a/tests/bluetooth/init/prj_20.conf +++ b/tests/bluetooth/init/prj_20.conf @@ -28,4 +28,3 @@ CONFIG_BT_HFP_HF=y CONFIG_BT_DEBUG_HFP_HF=y CONFIG_ZTEST=y -CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/bluetooth/init/prj_21.conf b/tests/bluetooth/init/prj_21.conf index c6c10f4870dc1..d6b506fae2d96 100644 --- a/tests/bluetooth/init/prj_21.conf +++ b/tests/bluetooth/init/prj_21.conf @@ -21,4 +21,3 @@ CONFIG_BT_DEBUG_GATT=y CONFIG_BT_BREDR=y CONFIG_ZTEST=y -CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/bluetooth/init/prj_22.conf b/tests/bluetooth/init/prj_22.conf index e6e9f45aa3cc6..332779c0d5c21 100644 --- a/tests/bluetooth/init/prj_22.conf +++ b/tests/bluetooth/init/prj_22.conf @@ -4,4 +4,3 @@ CONFIG_BT_PERIPHERAL=y CONFIG_BT_SMP=y CONFIG_ZTEST=y -CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/bluetooth/init/prj_3.conf b/tests/bluetooth/init/prj_3.conf index d8e93174ff10b..d1c6005e11710 100644 --- a/tests/bluetooth/init/prj_3.conf +++ b/tests/bluetooth/init/prj_3.conf @@ -3,4 +3,3 @@ CONFIG_BT_PERIPHERAL=y CONFIG_BT_CENTRAL=y CONFIG_ZTEST=y -CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/bluetooth/init/prj_4.conf b/tests/bluetooth/init/prj_4.conf index 30ddcb88ef8fd..7f197e3398c07 100644 --- a/tests/bluetooth/init/prj_4.conf +++ b/tests/bluetooth/init/prj_4.conf @@ -3,4 +3,3 @@ CONFIG_BT_PERIPHERAL=y CONFIG_BT_SMP=y CONFIG_ZTEST=y -CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/bluetooth/init/prj_5.conf b/tests/bluetooth/init/prj_5.conf index 084ccffe83166..b621316fd2e23 100644 --- a/tests/bluetooth/init/prj_5.conf +++ b/tests/bluetooth/init/prj_5.conf @@ -3,4 +3,3 @@ CONFIG_BT_CENTRAL=y CONFIG_BT_SMP=y CONFIG_ZTEST=y -CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/bluetooth/init/prj_6.conf b/tests/bluetooth/init/prj_6.conf index 7948b3cca29f5..30e5049b45ecb 100644 --- a/tests/bluetooth/init/prj_6.conf +++ b/tests/bluetooth/init/prj_6.conf @@ -4,4 +4,3 @@ CONFIG_BT_CENTRAL=y CONFIG_BT_SMP=y CONFIG_ZTEST=y -CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/bluetooth/init/prj_7.conf b/tests/bluetooth/init/prj_7.conf index 67055d75a727f..ba8453c9ffb71 100644 --- a/tests/bluetooth/init/prj_7.conf +++ b/tests/bluetooth/init/prj_7.conf @@ -5,4 +5,3 @@ CONFIG_BT_SMP=y CONFIG_BT_SIGNING=y CONFIG_ZTEST=y -CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/bluetooth/init/prj_8.conf b/tests/bluetooth/init/prj_8.conf index b6d4ad8f2bd72..697a34db2eda8 100644 --- a/tests/bluetooth/init/prj_8.conf +++ b/tests/bluetooth/init/prj_8.conf @@ -6,4 +6,3 @@ CONFIG_BT_SIGNING=y CONFIG_BT_SMP_SC_ONLY=y CONFIG_ZTEST=y -CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/bluetooth/init/prj_9.conf b/tests/bluetooth/init/prj_9.conf index 8752a1166a4a9..039d017620bd8 100644 --- a/tests/bluetooth/init/prj_9.conf +++ b/tests/bluetooth/init/prj_9.conf @@ -7,4 +7,3 @@ CONFIG_BT_SMP_SC_ONLY=y CONFIG_BT_TINYCRYPT_ECC=y CONFIG_ZTEST=y -CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/bluetooth/init/prj_controller.conf b/tests/bluetooth/init/prj_controller.conf index 29d3e7481b873..1a9cd700ad336 100644 --- a/tests/bluetooth/init/prj_controller.conf +++ b/tests/bluetooth/init/prj_controller.conf @@ -15,4 +15,3 @@ CONFIG_FLASH=y CONFIG_SOC_FLASH_NRF_RADIO_SYNC=y CONFIG_ZTEST=y -CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/bluetooth/init/prj_controller_4_0.conf b/tests/bluetooth/init/prj_controller_4_0.conf index 386b8194accbf..bb336fe9ba977 100644 --- a/tests/bluetooth/init/prj_controller_4_0.conf +++ b/tests/bluetooth/init/prj_controller_4_0.conf @@ -41,4 +41,3 @@ CONFIG_FLASH=y CONFIG_SOC_FLASH_NRF_RADIO_SYNC=y CONFIG_ZTEST=y -CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/bluetooth/init/prj_controller_4_0_ll_sw_split.conf b/tests/bluetooth/init/prj_controller_4_0_ll_sw_split.conf index dd55f01e6776e..d5e4d0b5b7254 100644 --- a/tests/bluetooth/init/prj_controller_4_0_ll_sw_split.conf +++ b/tests/bluetooth/init/prj_controller_4_0_ll_sw_split.conf @@ -41,4 +41,3 @@ CONFIG_FLASH=y CONFIG_SOC_FLASH_NRF_RADIO_SYNC=y CONFIG_ZTEST=y -CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/bluetooth/init/prj_controller_dbg.conf b/tests/bluetooth/init/prj_controller_dbg.conf index 181faeea478a1..f89520fbfef4c 100644 --- a/tests/bluetooth/init/prj_controller_dbg.conf +++ b/tests/bluetooth/init/prj_controller_dbg.conf @@ -61,4 +61,3 @@ CONFIG_DEBUG=y CONFIG_FLASH=y CONFIG_SOC_FLASH_NRF_RADIO_SYNC=n CONFIG_ZTEST=y -CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/bluetooth/init/prj_controller_dbg_ll_sw_split.conf b/tests/bluetooth/init/prj_controller_dbg_ll_sw_split.conf index 2c00a78378627..68ca7a6688259 100644 --- a/tests/bluetooth/init/prj_controller_dbg_ll_sw_split.conf +++ b/tests/bluetooth/init/prj_controller_dbg_ll_sw_split.conf @@ -61,4 +61,3 @@ CONFIG_DEBUG=y CONFIG_FLASH=y CONFIG_SOC_FLASH_NRF_RADIO_SYNC=n CONFIG_ZTEST=y -CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/bluetooth/init/prj_controller_ll_sw_split.conf b/tests/bluetooth/init/prj_controller_ll_sw_split.conf index 0c68086c735d7..1abff9811e930 100644 --- a/tests/bluetooth/init/prj_controller_ll_sw_split.conf +++ b/tests/bluetooth/init/prj_controller_ll_sw_split.conf @@ -15,4 +15,3 @@ CONFIG_FLASH=y CONFIG_SOC_FLASH_NRF_RADIO_SYNC=y CONFIG_ZTEST=y -CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/bluetooth/init/prj_controller_tiny.conf b/tests/bluetooth/init/prj_controller_tiny.conf index d97b0acd1047a..1691ef666b186 100644 --- a/tests/bluetooth/init/prj_controller_tiny.conf +++ b/tests/bluetooth/init/prj_controller_tiny.conf @@ -46,4 +46,3 @@ CONFIG_FLASH=y CONFIG_SOC_FLASH_NRF_RADIO_SYNC=y CONFIG_ZTEST=y -CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/bluetooth/init/prj_controller_tiny_ll_sw_split.conf b/tests/bluetooth/init/prj_controller_tiny_ll_sw_split.conf index 527db1460c08d..80df497752a05 100644 --- a/tests/bluetooth/init/prj_controller_tiny_ll_sw_split.conf +++ b/tests/bluetooth/init/prj_controller_tiny_ll_sw_split.conf @@ -46,4 +46,3 @@ CONFIG_FLASH=y CONFIG_SOC_FLASH_NRF_RADIO_SYNC=y CONFIG_ZTEST=y -CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/bluetooth/init/prj_h5.conf b/tests/bluetooth/init/prj_h5.conf index bb2ac83fcd1e5..8fc87b3bfd91e 100644 --- a/tests/bluetooth/init/prj_h5.conf +++ b/tests/bluetooth/init/prj_h5.conf @@ -2,4 +2,3 @@ CONFIG_BT=y CONFIG_BT_H5=y CONFIG_ZTEST=y -CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/bluetooth/init/prj_h5_dbg.conf b/tests/bluetooth/init/prj_h5_dbg.conf index 23550031d5360..f18bd6e6c4616 100644 --- a/tests/bluetooth/init/prj_h5_dbg.conf +++ b/tests/bluetooth/init/prj_h5_dbg.conf @@ -4,4 +4,3 @@ CONFIG_BT_DEBUG_LOG=y CONFIG_BT_DEBUG_HCI_DRIVER=y CONFIG_ZTEST=y -CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/bluetooth/l2cap/prj.conf b/tests/bluetooth/l2cap/prj.conf index e876a3178e470..33a932ebb4829 100644 --- a/tests/bluetooth/l2cap/prj.conf +++ b/tests/bluetooth/l2cap/prj.conf @@ -9,4 +9,3 @@ CONFIG_BT_DEBUG_LOG=y CONFIG_BT_PERIPHERAL=y CONFIG_BT_SMP=y CONFIG_BT_L2CAP_DYNAMIC_CHANNEL=y -CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/bluetooth/ll_settings/prj.conf b/tests/bluetooth/ll_settings/prj.conf index f75db53dcd888..95fc8737d8821 100644 --- a/tests/bluetooth/ll_settings/prj.conf +++ b/tests/bluetooth/ll_settings/prj.conf @@ -13,3 +13,5 @@ CONFIG_BT_CTLR_SETTINGS=y CONFIG_BT_CTLR_VERSION_SETTINGS=y CONFIG_BT_CTLR_COMPANY_ID=0x5F1 CONFIG_BT_CTLR_SUBVERSION_NUMBER=0xFFFF + +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/tests/bluetooth/mesh_shell/prj.conf b/tests/bluetooth/mesh_shell/prj.conf index 77df2f3b81459..d82148d3f9359 100644 --- a/tests/bluetooth/mesh_shell/prj.conf +++ b/tests/bluetooth/mesh_shell/prj.conf @@ -73,4 +73,3 @@ CONFIG_BT_DEBUG_LOG=y CONFIG_BT_MESH_IV_UPDATE_TEST=y CONFIG_BT_MESH_DEBUG=y -CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/bluetooth/shell/mesh.conf b/tests/bluetooth/shell/mesh.conf index 4d2e701c50cde..4161f2ee50b5b 100644 --- a/tests/bluetooth/shell/mesh.conf +++ b/tests/bluetooth/shell/mesh.conf @@ -46,4 +46,3 @@ CONFIG_BT_MESH_MODEL_GROUP_COUNT=2 CONFIG_BT_MESH_IV_UPDATE_TEST=y CONFIG_BT_MESH_DEBUG=y -CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/bluetooth/shell/prj.conf b/tests/bluetooth/shell/prj.conf index 2e39c0bbad740..029a64ff456de 100644 --- a/tests/bluetooth/shell/prj.conf +++ b/tests/bluetooth/shell/prj.conf @@ -33,4 +33,3 @@ CONFIG_FCB=y CONFIG_SETTINGS=y CONFIG_SETTINGS_FCB=y -CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/bluetooth/shell/prj_br.conf b/tests/bluetooth/shell/prj_br.conf index 3e928af32a52a..42f663e28378e 100644 --- a/tests/bluetooth/shell/prj_br.conf +++ b/tests/bluetooth/shell/prj_br.conf @@ -16,4 +16,3 @@ CONFIG_BT_GATT_HRS=y CONFIG_BT_L2CAP_DYNAMIC_CHANNEL=y CONFIG_BT_TINYCRYPT_ECC=y CONFIG_BT_DEVICE_NAME="test shell" -CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/bluetooth/uuid/prj.conf b/tests/bluetooth/uuid/prj.conf index 5521412ab5b68..fec5098eecffe 100644 --- a/tests/bluetooth/uuid/prj.conf +++ b/tests/bluetooth/uuid/prj.conf @@ -4,4 +4,3 @@ CONFIG_ZTEST=y CONFIG_BT=y CONFIG_BT_CTLR=n CONFIG_BT_NO_DRIVER=y -CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/boards/altera_max10/i2c_master/prj.conf b/tests/boards/altera_max10/i2c_master/prj.conf index ca26743c38cc4..132acda2e2bed 100644 --- a/tests/boards/altera_max10/i2c_master/prj.conf +++ b/tests/boards/altera_max10/i2c_master/prj.conf @@ -6,3 +6,5 @@ CONFIG_I2C_0_NAME="I2C_0" CONFIG_I2C_0_DEFAULT_CFG=0x0 CONFIG_I2C_0_IRQ_PRI=10 CONFIG_ZTEST=y + +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/tests/boards/altera_max10/msgdma/prj.conf b/tests/boards/altera_max10/msgdma/prj.conf index 77f7aa544686c..c000f05210d63 100644 --- a/tests/boards/altera_max10/msgdma/prj.conf +++ b/tests/boards/altera_max10/msgdma/prj.conf @@ -1,3 +1,5 @@ CONFIG_DMA=y CONFIG_DMA_NIOS2_MSGDMA=y CONFIG_ZTEST=y + +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/tests/boards/altera_max10/qspi/prj.conf b/tests/boards/altera_max10/qspi/prj.conf index 0af618b8d17cc..6e7ad99715572 100644 --- a/tests/boards/altera_max10/qspi/prj.conf +++ b/tests/boards/altera_max10/qspi/prj.conf @@ -3,3 +3,5 @@ CONFIG_FLASH=y CONFIG_SOC_FLASH_NIOS2_QSPI=y CONFIG_SOC_FLASH_NIOS2_QSPI_DEV_NAME="NIOS2_QSPI_FLASH" CONFIG_ZTEST=y + +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/tests/boards/altera_max10/sysid/prj.conf b/tests/boards/altera_max10/sysid/prj.conf index 9467c2926896d..0a4cda92971d2 100644 --- a/tests/boards/altera_max10/sysid/prj.conf +++ b/tests/boards/altera_max10/sysid/prj.conf @@ -1 +1,3 @@ CONFIG_ZTEST=y + +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/tests/boards/native_posix/native_tasks/prj.conf b/tests/boards/native_posix/native_tasks/prj.conf index c8682c2712235..47cc5e3addf93 100644 --- a/tests/boards/native_posix/native_tasks/prj.conf +++ b/tests/boards/native_posix/native_tasks/prj.conf @@ -1 +1,2 @@ # Deliberately empty +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/tests/crypto/mbedtls/prj.conf b/tests/crypto/mbedtls/prj.conf index ed8ee9816435b..039485e421d9c 100644 --- a/tests/crypto/mbedtls/prj.conf +++ b/tests/crypto/mbedtls/prj.conf @@ -5,3 +5,4 @@ CONFIG_MBEDTLS_CFG_FILE="config-tls-generic.h" CONFIG_MBEDTLS_TEST=y CONFIG_ZTEST=y CONFIG_TEST_USERSPACE=y +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/tests/crypto/rand32/prj.conf b/tests/crypto/rand32/prj.conf index 420e89ab17f2c..31a29dcc72936 100644 --- a/tests/crypto/rand32/prj.conf +++ b/tests/crypto/rand32/prj.conf @@ -2,3 +2,4 @@ CONFIG_ZTEST=y CONFIG_LOG=y CONFIG_ENTROPY_GENERATOR=y CONFIG_TEST_RANDOM_GENERATOR=y +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/tests/crypto/rand32/prj_hw_random_xoroshiro.conf b/tests/crypto/rand32/prj_hw_random_xoroshiro.conf index 4d3d326225363..b725393ba0f65 100644 --- a/tests/crypto/rand32/prj_hw_random_xoroshiro.conf +++ b/tests/crypto/rand32/prj_hw_random_xoroshiro.conf @@ -2,3 +2,4 @@ CONFIG_ZTEST=y CONFIG_LOG=y CONFIG_ENTROPY_GENERATOR=y CONFIG_XOROSHIRO_RANDOM_GENERATOR=y +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/tests/crypto/rand32/prj_sw_random_systimer.conf b/tests/crypto/rand32/prj_sw_random_systimer.conf index 6a6c996b86bef..a1d8e3bfc0091 100644 --- a/tests/crypto/rand32/prj_sw_random_systimer.conf +++ b/tests/crypto/rand32/prj_sw_random_systimer.conf @@ -3,3 +3,4 @@ CONFIG_LOG=y CONFIG_ENTROPY_GENERATOR=y CONFIG_TEST_RANDOM_GENERATOR=y CONFIG_TIMER_RANDOM_GENERATOR=y +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/tests/crypto/tinycrypt/prj.conf b/tests/crypto/tinycrypt/prj.conf index 1025b9910e322..0890381881aef 100644 --- a/tests/crypto/tinycrypt/prj.conf +++ b/tests/crypto/tinycrypt/prj.conf @@ -13,3 +13,4 @@ CONFIG_TINYCRYPT_ECC_DH=y CONFIG_TINYCRYPT_ECC_DSA=y CONFIG_ZTEST_STACKSIZE=5120 CONFIG_ZTEST=y +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/tests/crypto/tinycrypt_hmac_prng/prj.conf b/tests/crypto/tinycrypt_hmac_prng/prj.conf index 0830938dc3dd3..1160071ec5914 100644 --- a/tests/crypto/tinycrypt_hmac_prng/prj.conf +++ b/tests/crypto/tinycrypt_hmac_prng/prj.conf @@ -4,3 +4,4 @@ CONFIG_TINYCRYPT_SHA256=y CONFIG_TINYCRYPT_SHA256_HMAC=y CONFIG_TINYCRYPT_SHA256_HMAC_PRNG=y CONFIG_ZTEST=y +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/tests/drivers/adc/adc_api/prj.conf b/tests/drivers/adc/adc_api/prj.conf index beea391af3741..c307b998b93be 100644 --- a/tests/drivers/adc/adc_api/prj.conf +++ b/tests/drivers/adc/adc_api/prj.conf @@ -8,4 +8,3 @@ CONFIG_ADC_LOG_LEVEL_INF=y CONFIG_LOG_IMMEDIATE=y CONFIG_HEAP_MEM_POOL_SIZE=1024 CONFIG_TEST_USERSPACE=y -CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/drivers/build_all/drivers.conf b/tests/drivers/build_all/drivers.conf index acc62566bdd89..2e271d7c00512 100644 --- a/tests/drivers/build_all/drivers.conf +++ b/tests/drivers/build_all/drivers.conf @@ -12,8 +12,3 @@ CONFIG_SPI=y CONFIG_WATCHDOG=y CONFIG_X86_KERNEL_OOPS=n CONFIG_TEST_USERSPACE=y -CONFIG_SYS_TIMEOUT_LEGACY_API=y -CONFIG_SYS_TIMEOUT_LEGACY_API=y -CONFIG_SYS_TIMEOUT_LEGACY_API=y -CONFIG_SYS_TIMEOUT_LEGACY_API=y -CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/drivers/build_all/ethernet.conf b/tests/drivers/build_all/ethernet.conf index d1acdbe0736cc..2849f8e4dfe18 100644 --- a/tests/drivers/build_all/ethernet.conf +++ b/tests/drivers/build_all/ethernet.conf @@ -11,8 +11,3 @@ CONFIG_TEST_USERSPACE=y CONFIG_SPI=y CONFIG_ETH_ENC28J60=y CONFIG_ETH_ENC28J60_0=y -CONFIG_SYS_TIMEOUT_LEGACY_API=y -CONFIG_SYS_TIMEOUT_LEGACY_API=y -CONFIG_SYS_TIMEOUT_LEGACY_API=y -CONFIG_SYS_TIMEOUT_LEGACY_API=y -CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/drivers/build_all/gpio.conf b/tests/drivers/build_all/gpio.conf index fe3b6d9091080..dfb1ed6861c17 100644 --- a/tests/drivers/build_all/gpio.conf +++ b/tests/drivers/build_all/gpio.conf @@ -3,8 +3,3 @@ CONFIG_GPIO=y CONFIG_TEST_USERSPACE=y CONFIG_I2C=y CONFIG_GPIO_SX1509B=y -CONFIG_SYS_TIMEOUT_LEGACY_API=y -CONFIG_SYS_TIMEOUT_LEGACY_API=y -CONFIG_SYS_TIMEOUT_LEGACY_API=y -CONFIG_SYS_TIMEOUT_LEGACY_API=y -CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/drivers/build_all/prj.conf b/tests/drivers/build_all/prj.conf index aae20b3266729..901353030a129 100644 --- a/tests/drivers/build_all/prj.conf +++ b/tests/drivers/build_all/prj.conf @@ -1,7 +1,2 @@ CONFIG_TEST=y CONFIG_TEST_USERSPACE=y -CONFIG_SYS_TIMEOUT_LEGACY_API=y -CONFIG_SYS_TIMEOUT_LEGACY_API=y -CONFIG_SYS_TIMEOUT_LEGACY_API=y -CONFIG_SYS_TIMEOUT_LEGACY_API=y -CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/drivers/build_all/sensors_a_h.conf b/tests/drivers/build_all/sensors_a_h.conf index 50157ea2d8d17..4cb9706053258 100644 --- a/tests/drivers/build_all/sensors_a_h.conf +++ b/tests/drivers/build_all/sensors_a_h.conf @@ -28,8 +28,3 @@ CONFIG_FXOS8700=y CONFIG_HMC5883L=y CONFIG_HP206C=y CONFIG_HTS221=y -CONFIG_SYS_TIMEOUT_LEGACY_API=y -CONFIG_SYS_TIMEOUT_LEGACY_API=y -CONFIG_SYS_TIMEOUT_LEGACY_API=y -CONFIG_SYS_TIMEOUT_LEGACY_API=y -CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/drivers/build_all/sensors_i_z.conf b/tests/drivers/build_all/sensors_i_z.conf index 23de240d9bd0a..a37cbae0e05bf 100644 --- a/tests/drivers/build_all/sensors_i_z.conf +++ b/tests/drivers/build_all/sensors_i_z.conf @@ -33,8 +33,3 @@ CONFIG_TI_HDC=y CONFIG_TMP007=y CONFIG_TMP112=y CONFIG_VL53L0X=y -CONFIG_SYS_TIMEOUT_LEGACY_API=y -CONFIG_SYS_TIMEOUT_LEGACY_API=y -CONFIG_SYS_TIMEOUT_LEGACY_API=y -CONFIG_SYS_TIMEOUT_LEGACY_API=y -CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/drivers/build_all/sensors_stmemsc.conf b/tests/drivers/build_all/sensors_stmemsc.conf index a850baa5e8fe9..b2f81d4405ae3 100644 --- a/tests/drivers/build_all/sensors_stmemsc.conf +++ b/tests/drivers/build_all/sensors_stmemsc.conf @@ -6,8 +6,3 @@ CONFIG_GPIO=y CONFIG_SPI=y CONFIG_SENSOR=y CONFIG_LIS2DW12=y -CONFIG_SYS_TIMEOUT_LEGACY_API=y -CONFIG_SYS_TIMEOUT_LEGACY_API=y -CONFIG_SYS_TIMEOUT_LEGACY_API=y -CONFIG_SYS_TIMEOUT_LEGACY_API=y -CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/drivers/build_all/sensors_stmemsc_trigger.conf b/tests/drivers/build_all/sensors_stmemsc_trigger.conf index e1b2cbee03edf..65cafc94f4a7a 100644 --- a/tests/drivers/build_all/sensors_stmemsc_trigger.conf +++ b/tests/drivers/build_all/sensors_stmemsc_trigger.conf @@ -7,8 +7,3 @@ CONFIG_SPI=y CONFIG_SENSOR=y CONFIG_LIS2DW12=y CONFIG_LIS2DW12_TRIGGER_OWN_THREAD=y -CONFIG_SYS_TIMEOUT_LEGACY_API=y -CONFIG_SYS_TIMEOUT_LEGACY_API=y -CONFIG_SYS_TIMEOUT_LEGACY_API=y -CONFIG_SYS_TIMEOUT_LEGACY_API=y -CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/drivers/build_all/sensors_trigger_a_h.conf b/tests/drivers/build_all/sensors_trigger_a_h.conf index 652645419000a..12bf5a5aa6a16 100644 --- a/tests/drivers/build_all/sensors_trigger_a_h.conf +++ b/tests/drivers/build_all/sensors_trigger_a_h.conf @@ -32,8 +32,3 @@ CONFIG_HMC5883L=y CONFIG_HMC5883L_TRIGGER_OWN_THREAD=y CONFIG_HTS221=y CONFIG_HTS221_TRIGGER_OWN_THREAD=y -CONFIG_SYS_TIMEOUT_LEGACY_API=y -CONFIG_SYS_TIMEOUT_LEGACY_API=y -CONFIG_SYS_TIMEOUT_LEGACY_API=y -CONFIG_SYS_TIMEOUT_LEGACY_API=y -CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/drivers/build_all/sensors_trigger_i_z.conf b/tests/drivers/build_all/sensors_trigger_i_z.conf index c36b5af56dedf..6b62220fe3c7e 100644 --- a/tests/drivers/build_all/sensors_trigger_i_z.conf +++ b/tests/drivers/build_all/sensors_trigger_i_z.conf @@ -32,8 +32,3 @@ CONFIG_SX9500=y CONFIG_SX9500_TRIGGER_OWN_THREAD=y CONFIG_TMP007=y CONFIG_TMP007_TRIGGER_OWN_THREAD=y -CONFIG_SYS_TIMEOUT_LEGACY_API=y -CONFIG_SYS_TIMEOUT_LEGACY_API=y -CONFIG_SYS_TIMEOUT_LEGACY_API=y -CONFIG_SYS_TIMEOUT_LEGACY_API=y -CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/drivers/can/api/prj.conf b/tests/drivers/can/api/prj.conf index 921ed18529e94..f9126d9886309 100644 --- a/tests/drivers/can/api/prj.conf +++ b/tests/drivers/can/api/prj.conf @@ -1,3 +1,2 @@ CONFIG_CAN=y CONFIG_ZTEST=y -CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/drivers/can/stm32/prj.conf b/tests/drivers/can/stm32/prj.conf index 921ed18529e94..f9126d9886309 100644 --- a/tests/drivers/can/stm32/prj.conf +++ b/tests/drivers/can/stm32/prj.conf @@ -1,3 +1,2 @@ CONFIG_CAN=y CONFIG_ZTEST=y -CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/drivers/counter/counter_basic_api/prj.conf b/tests/drivers/counter/counter_basic_api/prj.conf index db3f9d6ea6814..d4a5cdfc13d88 100644 --- a/tests/drivers/counter/counter_basic_api/prj.conf +++ b/tests/drivers/counter/counter_basic_api/prj.conf @@ -3,3 +3,5 @@ CONFIG_BT=n CONFIG_ZTEST=y CONFIG_LOG=y CONFIG_COUNTER_LOG_LEVEL=4 + +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/tests/drivers/counter/counter_cmos/prj.conf b/tests/drivers/counter/counter_cmos/prj.conf index 0181863ff2883..72c3cd2fdc352 100644 --- a/tests/drivers/counter/counter_cmos/prj.conf +++ b/tests/drivers/counter/counter_cmos/prj.conf @@ -1,3 +1,5 @@ CONFIG_COUNTER=y CONFIG_ZTEST=y CONFIG_COUNTER_CMOS=y + +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/tests/drivers/entropy/api/prj.conf b/tests/drivers/entropy/api/prj.conf index a33b10382d4fe..a95a1832268e2 100644 --- a/tests/drivers/entropy/api/prj.conf +++ b/tests/drivers/entropy/api/prj.conf @@ -1,2 +1,3 @@ CONFIG_ENTROPY_GENERATOR=y CONFIG_ZTEST=y +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/tests/drivers/flash_simulator/prj.conf b/tests/drivers/flash_simulator/prj.conf index 15a2f5b8442cd..59893821163db 100644 --- a/tests/drivers/flash_simulator/prj.conf +++ b/tests/drivers/flash_simulator/prj.conf @@ -4,3 +4,5 @@ CONFIG_FLASH_SIMULATOR=y CONFIG_FLASH_SIMULATOR_DOUBLE_WRITES=n CONFIG_FLASH_SIMULATOR_ERASE_PROTECT=y CONFIG_FLASH_SIMULATOR_UNALIGNED_READ=n + +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/tests/drivers/hwinfo/api/prj.conf b/tests/drivers/hwinfo/api/prj.conf index 616a826fabba5..a8f6865c73269 100644 --- a/tests/drivers/hwinfo/api/prj.conf +++ b/tests/drivers/hwinfo/api/prj.conf @@ -1,2 +1,4 @@ CONFIG_HWINFO=y CONFIG_ZTEST=y + +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/tests/drivers/i2c/i2c_api/prj.conf b/tests/drivers/i2c/i2c_api/prj.conf index 4b19609ecfbd1..4c399a6b4d639 100644 --- a/tests/drivers/i2c/i2c_api/prj.conf +++ b/tests/drivers/i2c/i2c_api/prj.conf @@ -1,2 +1,4 @@ CONFIG_I2C=y CONFIG_ZTEST=y + +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/tests/drivers/i2c/i2c_slave_api/prj.conf b/tests/drivers/i2c/i2c_slave_api/prj.conf index 97e42ee9d9b59..7b4c51bd1555e 100644 --- a/tests/drivers/i2c/i2c_slave_api/prj.conf +++ b/tests/drivers/i2c/i2c_slave_api/prj.conf @@ -8,3 +8,5 @@ CONFIG_I2C_EEPROM_SLAVE=y CONFIG_I2C_EEPROM_SLAVE_0=y CONFIG_I2C_EEPROM_SLAVE_1=y CONFIG_I2C_VIRTUAL=y + +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/tests/drivers/ipm/prj.conf b/tests/drivers/ipm/prj.conf index 7d423e8802633..c003e22202a43 100644 --- a/tests/drivers/ipm/prj.conf +++ b/tests/drivers/ipm/prj.conf @@ -6,4 +6,3 @@ CONFIG_IPM_CONSOLE_RECEIVER=y CONFIG_IPM_CONSOLE_SENDER=y CONFIG_IRQ_OFFLOAD=y CONFIG_MP_NUM_CPUS=1 -CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/drivers/pwm/pwm_api/prj.conf b/tests/drivers/pwm/pwm_api/prj.conf index f98ca9b0d1663..21fa5a2e92b20 100644 --- a/tests/drivers/pwm/pwm_api/prj.conf +++ b/tests/drivers/pwm/pwm_api/prj.conf @@ -1,2 +1,4 @@ CONFIG_PWM=y CONFIG_ZTEST=y + +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/tests/drivers/spi/spi_loopback/prj.conf b/tests/drivers/spi/spi_loopback/prj.conf index d13d3ba67966e..44d2eeb866411 100644 --- a/tests/drivers/spi/spi_loopback/prj.conf +++ b/tests/drivers/spi/spi_loopback/prj.conf @@ -6,4 +6,3 @@ CONFIG_SPI_ASYNC=y CONFIG_SPI_LOG_LEVEL_INF=y CONFIG_LOG_IMMEDIATE=y CONFIG_ZTEST=y -CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/drivers/uart/uart_async_api/prj.conf b/tests/drivers/uart/uart_async_api/prj.conf index 728a4f9553bf3..e2dae2ee1a365 100644 --- a/tests/drivers/uart/uart_async_api/prj.conf +++ b/tests/drivers/uart/uart_async_api/prj.conf @@ -1,4 +1,3 @@ CONFIG_SERIAL=y CONFIG_UART_ASYNC_API=y CONFIG_ZTEST=y -CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/drivers/uart/uart_basic_api/prj.conf b/tests/drivers/uart/uart_basic_api/prj.conf index 173a6fa42fe22..d12c995df0941 100644 --- a/tests/drivers/uart/uart_basic_api/prj.conf +++ b/tests/drivers/uart/uart_basic_api/prj.conf @@ -2,4 +2,3 @@ CONFIG_SERIAL=y CONFIG_UART_INTERRUPT_DRIVEN=y CONFIG_ZTEST=y CONFIG_NATIVE_UART_0_ON_STDINOUT=y -CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/drivers/uart/uart_basic_api/prj_poll.conf b/tests/drivers/uart/uart_basic_api/prj_poll.conf index 8735eb238c31f..772072f1c4d34 100644 --- a/tests/drivers/uart/uart_basic_api/prj_poll.conf +++ b/tests/drivers/uart/uart_basic_api/prj_poll.conf @@ -1,4 +1,3 @@ CONFIG_SERIAL=y CONFIG_ZTEST=y CONFIG_NATIVE_UART_0_ON_STDINOUT=y -CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/drivers/uart/uart_basic_api/prj_shell.conf b/tests/drivers/uart/uart_basic_api/prj_shell.conf index 5880c35882b1e..6ecbf8931a495 100644 --- a/tests/drivers/uart/uart_basic_api/prj_shell.conf +++ b/tests/drivers/uart/uart_basic_api/prj_shell.conf @@ -4,4 +4,3 @@ CONFIG_ZTEST=y CONFIG_SHELL_CMD_BUFF_SIZE=90 CONFIG_SHELL=y CONFIG_NATIVE_UART_0_ON_STDINOUT=y -CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/drivers/watchdog/wdt_basic_api/nucleo_l496zg.conf b/tests/drivers/watchdog/wdt_basic_api/nucleo_l496zg.conf index cacad7364ce53..e6e8c20fcc662 100644 --- a/tests/drivers/watchdog/wdt_basic_api/nucleo_l496zg.conf +++ b/tests/drivers/watchdog/wdt_basic_api/nucleo_l496zg.conf @@ -9,3 +9,5 @@ CONFIG_CLOCK_STM32_MSI_RANGE=5 CONFIG_CLOCK_STM32_AHB_PRESCALER=1 CONFIG_CLOCK_STM32_APB1_PRESCALER=1 CONFIG_CLOCK_STM32_APB2_PRESCALER=1 + +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/tests/drivers/watchdog/wdt_basic_api/prj.conf b/tests/drivers/watchdog/wdt_basic_api/prj.conf index fb5643761f1d5..d3719bc032774 100644 --- a/tests/drivers/watchdog/wdt_basic_api/prj.conf +++ b/tests/drivers/watchdog/wdt_basic_api/prj.conf @@ -1,3 +1,5 @@ CONFIG_WATCHDOG=y CONFIG_ZTEST=y CONFIG_BOOT_BANNER=n + +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/tests/kernel/boot_page_table/prj.conf b/tests/kernel/boot_page_table/prj.conf index 9467c2926896d..0a4cda92971d2 100644 --- a/tests/kernel/boot_page_table/prj.conf +++ b/tests/kernel/boot_page_table/prj.conf @@ -1 +1,3 @@ CONFIG_ZTEST=y + +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/tests/kernel/common/prj.conf b/tests/kernel/common/prj.conf index 6fcf546723cdb..82d0e2b15d91d 100644 --- a/tests/kernel/common/prj.conf +++ b/tests/kernel/common/prj.conf @@ -7,3 +7,4 @@ CONFIG_BOOT_DELAY=500 CONFIG_IRQ_OFFLOAD=y CONFIG_TEST_USERSPACE=y CONFIG_BOUNDS_CHECK_BYPASS_MITIGATION=y +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/tests/kernel/context/prj.conf b/tests/kernel/context/prj.conf index 150a5a1abc91a..ec4bb33b8bcc9 100644 --- a/tests/kernel/context/prj.conf +++ b/tests/kernel/context/prj.conf @@ -4,3 +4,4 @@ CONFIG_ZTEST=y #CONFIG_ZTEST_STACKSIZE=2048 #CONFIG_IDLE_STACK_SIZE=512 CONFIG_MP_NUM_CPUS=1 +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/tests/kernel/critical/prj.conf b/tests/kernel/critical/prj.conf index c2adf7ce0128a..0ebd08323024e 100644 --- a/tests/kernel/critical/prj.conf +++ b/tests/kernel/critical/prj.conf @@ -1,2 +1,3 @@ CONFIG_ZTEST=y CONFIG_MP_NUM_CPUS=1 +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/tests/kernel/device/prj.conf b/tests/kernel/device/prj.conf index e39776e7067ab..46dc962cf9380 100644 --- a/tests/kernel/device/prj.conf +++ b/tests/kernel/device/prj.conf @@ -1,2 +1,3 @@ CONFIG_ZTEST=y CONFIG_TEST_USERSPACE=y +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/tests/kernel/early_sleep/prj.conf b/tests/kernel/early_sleep/prj.conf index 1e591cf978acb..6e29cb1754d0f 100644 --- a/tests/kernel/early_sleep/prj.conf +++ b/tests/kernel/early_sleep/prj.conf @@ -1,3 +1,4 @@ CONFIG_IRQ_OFFLOAD=y CONFIG_ZTEST=y CONFIG_MP_NUM_CPUS=1 +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/tests/kernel/fatal/prj.conf b/tests/kernel/fatal/prj.conf index 799e49c5fce14..699bfb05aa74c 100644 --- a/tests/kernel/fatal/prj.conf +++ b/tests/kernel/fatal/prj.conf @@ -3,3 +3,4 @@ CONFIG_COVERAGE=n CONFIG_TEST_USERSPACE=y CONFIG_APPLICATION_DEFINED_SYSCALL=y CONFIG_MP_NUM_CPUS=1 +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/tests/kernel/fatal/prj_arm_fp_sharing.conf b/tests/kernel/fatal/prj_arm_fp_sharing.conf index 1752b7a5bd46f..727235b3b2526 100644 --- a/tests/kernel/fatal/prj_arm_fp_sharing.conf +++ b/tests/kernel/fatal/prj_arm_fp_sharing.conf @@ -4,3 +4,4 @@ CONFIG_ZTEST=y CONFIG_COVERAGE=n CONFIG_TEST_USERSPACE=y CONFIG_APPLICATION_DEFINED_SYSCALL=y +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/tests/kernel/fatal/prj_armv8m_mpu_stack_guard.conf b/tests/kernel/fatal/prj_armv8m_mpu_stack_guard.conf index c8b61ce52f6bd..6058f32134724 100644 --- a/tests/kernel/fatal/prj_armv8m_mpu_stack_guard.conf +++ b/tests/kernel/fatal/prj_armv8m_mpu_stack_guard.conf @@ -4,3 +4,4 @@ CONFIG_TEST_USERSPACE=y CONFIG_APPLICATION_DEFINED_SYSCALL=y CONFIG_BUILTIN_STACK_GUARD=n CONFIG_MPU_STACK_GUARD=y +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/tests/kernel/fatal/protection_no_userspace.conf b/tests/kernel/fatal/protection_no_userspace.conf index ef423fc99dab3..f8ecf598a7eab 100644 --- a/tests/kernel/fatal/protection_no_userspace.conf +++ b/tests/kernel/fatal/protection_no_userspace.conf @@ -1,3 +1,4 @@ CONFIG_ZTEST=y CONFIG_COVERAGE=n CONFIG_TEST_USERSPACE=n +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/tests/kernel/fatal/sentinel.conf b/tests/kernel/fatal/sentinel.conf index 78274192c175f..7d203ec1dc69b 100644 --- a/tests/kernel/fatal/sentinel.conf +++ b/tests/kernel/fatal/sentinel.conf @@ -4,3 +4,4 @@ CONFIG_ZTEST=y CONFIG_COVERAGE=n CONFIG_TICKLESS_KERNEL=n CONFIG_MP_NUM_CPUS=1 +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/tests/kernel/fifo/fifo_api/prj.conf b/tests/kernel/fifo/fifo_api/prj.conf index 9a75212e89d0e..b7bb020e80017 100644 --- a/tests/kernel/fifo/fifo_api/prj.conf +++ b/tests/kernel/fifo/fifo_api/prj.conf @@ -1,2 +1,3 @@ CONFIG_ZTEST=y CONFIG_IRQ_OFFLOAD=y +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/tests/kernel/fifo/fifo_api/prj_poll.conf b/tests/kernel/fifo/fifo_api/prj_poll.conf index ff5574c46a5c7..9dd437d4ab491 100644 --- a/tests/kernel/fifo/fifo_api/prj_poll.conf +++ b/tests/kernel/fifo/fifo_api/prj_poll.conf @@ -1,3 +1,4 @@ CONFIG_ZTEST=y CONFIG_IRQ_OFFLOAD=y CONFIG_POLL=y +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/tests/kernel/fifo/fifo_timeout/prj.conf b/tests/kernel/fifo/fifo_timeout/prj.conf index 19b7ff845de60..86eb369877d63 100644 --- a/tests/kernel/fifo/fifo_timeout/prj.conf +++ b/tests/kernel/fifo/fifo_timeout/prj.conf @@ -1,3 +1,4 @@ CONFIG_ZTEST=y CONFIG_IRQ_OFFLOAD=y CONFIG_MP_NUM_CPUS=1 +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/tests/kernel/fifo/fifo_timeout/prj_poll.conf b/tests/kernel/fifo/fifo_timeout/prj_poll.conf index 8c6fda268d8f6..c81e805038a67 100644 --- a/tests/kernel/fifo/fifo_timeout/prj_poll.conf +++ b/tests/kernel/fifo/fifo_timeout/prj_poll.conf @@ -2,3 +2,4 @@ CONFIG_ZTEST=y CONFIG_IRQ_OFFLOAD=y CONFIG_POLL=y CONFIG_MP_NUM_CPUS=1 +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/tests/kernel/fifo/fifo_usage/prj.conf b/tests/kernel/fifo/fifo_usage/prj.conf index 19b7ff845de60..86eb369877d63 100644 --- a/tests/kernel/fifo/fifo_usage/prj.conf +++ b/tests/kernel/fifo/fifo_usage/prj.conf @@ -1,3 +1,4 @@ CONFIG_ZTEST=y CONFIG_IRQ_OFFLOAD=y CONFIG_MP_NUM_CPUS=1 +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/tests/kernel/fifo/fifo_usage/prj_poll.conf b/tests/kernel/fifo/fifo_usage/prj_poll.conf index 8c6fda268d8f6..c81e805038a67 100644 --- a/tests/kernel/fifo/fifo_usage/prj_poll.conf +++ b/tests/kernel/fifo/fifo_usage/prj_poll.conf @@ -2,3 +2,4 @@ CONFIG_ZTEST=y CONFIG_IRQ_OFFLOAD=y CONFIG_POLL=y CONFIG_MP_NUM_CPUS=1 +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/tests/kernel/fp_sharing/float_disable/prj.conf b/tests/kernel/fp_sharing/float_disable/prj.conf index a159922b46452..0fd7d560db7f7 100644 --- a/tests/kernel/fp_sharing/float_disable/prj.conf +++ b/tests/kernel/fp_sharing/float_disable/prj.conf @@ -2,3 +2,5 @@ CONFIG_ZTEST=y CONFIG_TEST_USERSPACE=y CONFIG_FLOAT=y CONFIG_FP_SHARING=y + +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/tests/kernel/fp_sharing/float_disable/prj_x86.conf b/tests/kernel/fp_sharing/float_disable/prj_x86.conf index e318808f86ae0..363a73d709bc6 100644 --- a/tests/kernel/fp_sharing/float_disable/prj_x86.conf +++ b/tests/kernel/fp_sharing/float_disable/prj_x86.conf @@ -4,3 +4,5 @@ CONFIG_FLOAT=y CONFIG_FP_SHARING=y CONFIG_SSE=y CONFIG_SSE_FP_MATH=y + +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/tests/kernel/gen_isr_table/prj.conf b/tests/kernel/gen_isr_table/prj.conf index 36330a6b590cb..f6b814d99a5a7 100644 --- a/tests/kernel/gen_isr_table/prj.conf +++ b/tests/kernel/gen_isr_table/prj.conf @@ -1,2 +1,4 @@ CONFIG_TEST=y CONFIG_DYNAMIC_INTERRUPTS=y + +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/tests/kernel/interrupt/prj.conf b/tests/kernel/interrupt/prj.conf index c8656e42213a5..f94f2fb6a4eb5 100644 --- a/tests/kernel/interrupt/prj.conf +++ b/tests/kernel/interrupt/prj.conf @@ -1,3 +1,4 @@ CONFIG_ZTEST=y CONFIG_IRQ_OFFLOAD=y CONFIG_DYNAMIC_INTERRUPTS=y +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/tests/kernel/lifo/lifo_api/prj.conf b/tests/kernel/lifo/lifo_api/prj.conf index 9a75212e89d0e..b7bb020e80017 100644 --- a/tests/kernel/lifo/lifo_api/prj.conf +++ b/tests/kernel/lifo/lifo_api/prj.conf @@ -1,2 +1,3 @@ CONFIG_ZTEST=y CONFIG_IRQ_OFFLOAD=y +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/tests/kernel/lifo/lifo_usage/prj.conf b/tests/kernel/lifo/lifo_usage/prj.conf index 9467c2926896d..7049cf0e1675f 100644 --- a/tests/kernel/lifo/lifo_usage/prj.conf +++ b/tests/kernel/lifo/lifo_usage/prj.conf @@ -1 +1,2 @@ CONFIG_ZTEST=y +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/tests/kernel/mbox/mbox_api/prj.conf b/tests/kernel/mbox/mbox_api/prj.conf index 7bf9240088ac4..79065d034f568 100644 --- a/tests/kernel/mbox/mbox_api/prj.conf +++ b/tests/kernel/mbox/mbox_api/prj.conf @@ -2,3 +2,4 @@ CONFIG_ZTEST=y CONFIG_NUM_MBOX_ASYNC_MSGS=5 CONFIG_OBJECT_TRACING=y CONFIG_MP_NUM_CPUS=1 +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/tests/kernel/mbox/mbox_usage/prj.conf b/tests/kernel/mbox/mbox_usage/prj.conf index 9467c2926896d..7049cf0e1675f 100644 --- a/tests/kernel/mbox/mbox_usage/prj.conf +++ b/tests/kernel/mbox/mbox_usage/prj.conf @@ -1 +1,2 @@ CONFIG_ZTEST=y +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/tests/kernel/mem_heap/mheap_api_concept/prj.conf b/tests/kernel/mem_heap/mheap_api_concept/prj.conf index 9491650b184db..4fad9e35a41e3 100644 --- a/tests/kernel/mem_heap/mheap_api_concept/prj.conf +++ b/tests/kernel/mem_heap/mheap_api_concept/prj.conf @@ -1,2 +1,3 @@ CONFIG_ZTEST=y CONFIG_HEAP_MEM_POOL_SIZE=256 +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/tests/kernel/mem_pool/mem_pool/prj.conf b/tests/kernel/mem_pool/mem_pool/prj.conf index ff0c17a5c012a..61d2451a0bc06 100644 --- a/tests/kernel/mem_pool/mem_pool/prj.conf +++ b/tests/kernel/mem_pool/mem_pool/prj.conf @@ -1,3 +1,4 @@ CONFIG_HEAP_MEM_POOL_SIZE=256 CONFIG_ZTEST=y CONFIG_MP_NUM_CPUS=1 +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/tests/kernel/mem_pool/mem_pool_api/prj.conf b/tests/kernel/mem_pool/mem_pool_api/prj.conf index d3e3c1571b73c..36546669d26d9 100644 --- a/tests/kernel/mem_pool/mem_pool_api/prj.conf +++ b/tests/kernel/mem_pool/mem_pool_api/prj.conf @@ -1,3 +1,4 @@ CONFIG_ZTEST=y CONFIG_IRQ_OFFLOAD=y CONFIG_HEAP_MEM_POOL_SIZE=128 +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/tests/kernel/mem_pool/mem_pool_concept/prj.conf b/tests/kernel/mem_pool/mem_pool_concept/prj.conf index 9467c2926896d..7049cf0e1675f 100644 --- a/tests/kernel/mem_pool/mem_pool_concept/prj.conf +++ b/tests/kernel/mem_pool/mem_pool_concept/prj.conf @@ -1 +1,2 @@ CONFIG_ZTEST=y +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/tests/kernel/mem_pool/mem_pool_threadsafe/prj.conf b/tests/kernel/mem_pool/mem_pool_threadsafe/prj.conf index 1fff0b72567e1..5f15bdd0991b3 100644 --- a/tests/kernel/mem_pool/mem_pool_threadsafe/prj.conf +++ b/tests/kernel/mem_pool/mem_pool_threadsafe/prj.conf @@ -1,2 +1,3 @@ CONFIG_ZTEST=y CONFIG_TIMESLICE_SIZE=1 +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/tests/kernel/mem_pool/sys_mem_pool/prj.conf b/tests/kernel/mem_pool/sys_mem_pool/prj.conf index d27bf81d53ce5..d6d1cdccd30cd 100644 --- a/tests/kernel/mem_pool/sys_mem_pool/prj.conf +++ b/tests/kernel/mem_pool/sys_mem_pool/prj.conf @@ -1,3 +1,4 @@ CONFIG_ZTEST=y CONFIG_TEST_USERSPACE=y CONFIG_HEAP_MEM_POOL_SIZE=256 +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/tests/kernel/mem_protect/futex/prj.conf b/tests/kernel/mem_protect/futex/prj.conf index 29f2d64944eda..7d8d0af82324b 100644 --- a/tests/kernel/mem_protect/futex/prj.conf +++ b/tests/kernel/mem_protect/futex/prj.conf @@ -1,3 +1,5 @@ CONFIG_ZTEST=y CONFIG_IRQ_OFFLOAD=y CONFIG_TEST_USERSPACE=y + +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/tests/kernel/mem_protect/mem_protect/prj.conf b/tests/kernel/mem_protect/mem_protect/prj.conf index c916dd0ad59c9..adf76b520e7bc 100644 --- a/tests/kernel/mem_protect/mem_protect/prj.conf +++ b/tests/kernel/mem_protect/mem_protect/prj.conf @@ -3,3 +3,5 @@ CONFIG_ZTEST=y CONFIG_ZTEST_STACKSIZE=2048 CONFIG_MAX_THREAD_BYTES=4 CONFIG_USERSPACE=y + +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/tests/kernel/mem_protect/obj_validation/prj.conf b/tests/kernel/mem_protect/obj_validation/prj.conf index cb297c820e664..147cabffbc8a3 100644 --- a/tests/kernel/mem_protect/obj_validation/prj.conf +++ b/tests/kernel/mem_protect/obj_validation/prj.conf @@ -2,3 +2,5 @@ CONFIG_ZTEST=y CONFIG_TEST_USERSPACE=y CONFIG_DYNAMIC_OBJECTS=y CONFIG_HEAP_MEM_POOL_SIZE=8192 + +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/tests/kernel/mem_protect/protection/prj.conf b/tests/kernel/mem_protect/protection/prj.conf index a3b3b01065cf3..f620a745aadb2 100644 --- a/tests/kernel/mem_protect/protection/prj.conf +++ b/tests/kernel/mem_protect/protection/prj.conf @@ -1,2 +1,4 @@ CONFIG_HEAP_MEM_POOL_SIZE=256 CONFIG_ZTEST=y + +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/tests/kernel/mem_protect/stack_random/prj.conf b/tests/kernel/mem_protect/stack_random/prj.conf index ff20000218520..283d190110faf 100644 --- a/tests/kernel/mem_protect/stack_random/prj.conf +++ b/tests/kernel/mem_protect/stack_random/prj.conf @@ -2,6 +2,7 @@ CONFIG_ZTEST=y CONFIG_STACK_POINTER_RANDOM=64 CONFIG_ENTROPY_GENERATOR=y CONFIG_TEST_RANDOM_GENERATOR=y +CONFIG_SYS_TIMEOUT_LEGACY_API=n # The action of the only case in this test is to spawn higher priority # threads and assume that they have run synchronously. It can't diff --git a/tests/kernel/mem_protect/stackprot/prj.conf b/tests/kernel/mem_protect/stackprot/prj.conf index 3b06bf4dd5844..79451160d95b6 100644 --- a/tests/kernel/mem_protect/stackprot/prj.conf +++ b/tests/kernel/mem_protect/stackprot/prj.conf @@ -3,3 +3,5 @@ CONFIG_STACK_CANARIES=y CONFIG_ENTROPY_GENERATOR=y CONFIG_TEST_RANDOM_GENERATOR=y CONFIG_TEST_USERSPACE=y + +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/tests/kernel/mem_protect/sys_sem/prj.conf b/tests/kernel/mem_protect/sys_sem/prj.conf index 29f2d64944eda..50febd952af05 100644 --- a/tests/kernel/mem_protect/sys_sem/prj.conf +++ b/tests/kernel/mem_protect/sys_sem/prj.conf @@ -1,3 +1,4 @@ CONFIG_ZTEST=y CONFIG_IRQ_OFFLOAD=y CONFIG_TEST_USERSPACE=y +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/tests/kernel/mem_protect/syscalls/prj.conf b/tests/kernel/mem_protect/syscalls/prj.conf index 6f61be1eff591..12a9fe5332877 100644 --- a/tests/kernel/mem_protect/syscalls/prj.conf +++ b/tests/kernel/mem_protect/syscalls/prj.conf @@ -1,3 +1,5 @@ CONFIG_ZTEST=y CONFIG_TEST_USERSPACE=y CONFIG_APPLICATION_DEFINED_SYSCALL=y + +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/tests/kernel/mem_protect/userspace/prj.conf b/tests/kernel/mem_protect/userspace/prj.conf index 86930d834d19d..5ba89c2f86fb1 100644 --- a/tests/kernel/mem_protect/userspace/prj.conf +++ b/tests/kernel/mem_protect/userspace/prj.conf @@ -4,3 +4,5 @@ CONFIG_INIT_STACKS=y CONFIG_APPLICATION_DEFINED_SYSCALL=y CONFIG_THREAD_USERSPACE_LOCAL_DATA=y CONFIG_TEST_USERSPACE=y + +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/tests/kernel/mem_protect/x86_mmu_api/prj.conf b/tests/kernel/mem_protect/x86_mmu_api/prj.conf index 1680b21810182..51b14da63ba2f 100644 --- a/tests/kernel/mem_protect/x86_mmu_api/prj.conf +++ b/tests/kernel/mem_protect/x86_mmu_api/prj.conf @@ -1,2 +1,4 @@ CONFIG_ZTEST=y CONFIG_X86_MMU=y + +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/tests/kernel/mem_slab/mslab/prj.conf b/tests/kernel/mem_slab/mslab/prj.conf index 267d88a070cae..ed0acd7ab7a3b 100644 --- a/tests/kernel/mem_slab/mslab/prj.conf +++ b/tests/kernel/mem_slab/mslab/prj.conf @@ -2,3 +2,4 @@ CONFIG_BT=n CONFIG_MAIN_THREAD_PRIORITY=5 CONFIG_ZTEST=y CONFIG_MP_NUM_CPUS=1 +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/tests/kernel/mem_slab/mslab_api/prj.conf b/tests/kernel/mem_slab/mslab_api/prj.conf index 19b7ff845de60..86eb369877d63 100644 --- a/tests/kernel/mem_slab/mslab_api/prj.conf +++ b/tests/kernel/mem_slab/mslab_api/prj.conf @@ -1,3 +1,4 @@ CONFIG_ZTEST=y CONFIG_IRQ_OFFLOAD=y CONFIG_MP_NUM_CPUS=1 +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/tests/kernel/mem_slab/mslab_concept/prj.conf b/tests/kernel/mem_slab/mslab_concept/prj.conf index 9467c2926896d..7049cf0e1675f 100644 --- a/tests/kernel/mem_slab/mslab_concept/prj.conf +++ b/tests/kernel/mem_slab/mslab_concept/prj.conf @@ -1 +1,2 @@ CONFIG_ZTEST=y +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/tests/kernel/mem_slab/mslab_threadsafe/prj.conf b/tests/kernel/mem_slab/mslab_threadsafe/prj.conf index 1753d62e895d2..80f04fd81269c 100644 --- a/tests/kernel/mem_slab/mslab_threadsafe/prj.conf +++ b/tests/kernel/mem_slab/mslab_threadsafe/prj.conf @@ -3,3 +3,4 @@ CONFIG_SYS_CLOCK_TICKS_PER_SEC=1000 # 1 millisecond CONFIG_TIMESLICE_SIZE=1 CONFIG_MP_NUM_CPUS=1 +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/tests/kernel/mp/prj.conf b/tests/kernel/mp/prj.conf index 9467c2926896d..7049cf0e1675f 100644 --- a/tests/kernel/mp/prj.conf +++ b/tests/kernel/mp/prj.conf @@ -1 +1,2 @@ CONFIG_ZTEST=y +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/tests/kernel/msgq/msgq_api/prj.conf b/tests/kernel/msgq/msgq_api/prj.conf index af4c2c15ab209..7dd19a0109c01 100644 --- a/tests/kernel/msgq/msgq_api/prj.conf +++ b/tests/kernel/msgq/msgq_api/prj.conf @@ -2,3 +2,4 @@ CONFIG_ZTEST=y CONFIG_IRQ_OFFLOAD=y CONFIG_TEST_USERSPACE=y CONFIG_MP_NUM_CPUS=1 +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/tests/kernel/mutex/mutex_api/prj.conf b/tests/kernel/mutex/mutex_api/prj.conf index af4c2c15ab209..7dd19a0109c01 100644 --- a/tests/kernel/mutex/mutex_api/prj.conf +++ b/tests/kernel/mutex/mutex_api/prj.conf @@ -2,3 +2,4 @@ CONFIG_ZTEST=y CONFIG_IRQ_OFFLOAD=y CONFIG_TEST_USERSPACE=y CONFIG_MP_NUM_CPUS=1 +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/tests/kernel/mutex/sys_mutex/prj.conf b/tests/kernel/mutex/sys_mutex/prj.conf index 2e7d4939652f0..da67583ff32d4 100644 --- a/tests/kernel/mutex/sys_mutex/prj.conf +++ b/tests/kernel/mutex/sys_mutex/prj.conf @@ -3,3 +3,4 @@ CONFIG_ZTEST=y CONFIG_ZTEST_STACKSIZE=512 CONFIG_TEST_USERSPACE=y CONFIG_MP_NUM_CPUS=1 +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/tests/kernel/obj_tracing/prj.conf b/tests/kernel/obj_tracing/prj.conf index 88c4c181ba7b7..7f697f853dc03 100644 --- a/tests/kernel/obj_tracing/prj.conf +++ b/tests/kernel/obj_tracing/prj.conf @@ -3,3 +3,4 @@ CONFIG_THREAD_MONITOR=y CONFIG_ZTEST=y CONFIG_BT=n CONFIG_MP_NUM_CPUS=1 +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/tests/kernel/pending/prj.conf b/tests/kernel/pending/prj.conf index c2adf7ce0128a..0ebd08323024e 100644 --- a/tests/kernel/pending/prj.conf +++ b/tests/kernel/pending/prj.conf @@ -1,2 +1,3 @@ CONFIG_ZTEST=y CONFIG_MP_NUM_CPUS=1 +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/tests/kernel/pipe/pipe/prj.conf b/tests/kernel/pipe/pipe/prj.conf index b1f5f03f8a120..ae40223f030d0 100644 --- a/tests/kernel/pipe/pipe/prj.conf +++ b/tests/kernel/pipe/pipe/prj.conf @@ -1,3 +1,4 @@ CONFIG_ZTEST=y CONFIG_TEST_USERSPACE=y CONFIG_MP_NUM_CPUS=1 +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/tests/kernel/pipe/pipe_api/prj.conf b/tests/kernel/pipe/pipe_api/prj.conf index c9db396e6679f..421cd959e2d81 100644 --- a/tests/kernel/pipe/pipe_api/prj.conf +++ b/tests/kernel/pipe/pipe_api/prj.conf @@ -3,3 +3,4 @@ CONFIG_IRQ_OFFLOAD=y CONFIG_TEST_USERSPACE=y CONFIG_DYNAMIC_OBJECTS=y CONFIG_MP_NUM_CPUS=1 +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/tests/kernel/poll/prj.conf b/tests/kernel/poll/prj.conf index a8022c08c605e..d2def8a54e071 100644 --- a/tests/kernel/poll/prj.conf +++ b/tests/kernel/poll/prj.conf @@ -3,3 +3,4 @@ CONFIG_POLL=y CONFIG_DYNAMIC_OBJECTS=y CONFIG_TEST_USERSPACE=y CONFIG_MP_NUM_CPUS=1 +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/tests/kernel/profiling/profiling_api/prj.conf b/tests/kernel/profiling/profiling_api/prj.conf index f6ebb2f776d8c..a9920c98b51bb 100644 --- a/tests/kernel/profiling/profiling_api/prj.conf +++ b/tests/kernel/profiling/profiling_api/prj.conf @@ -11,3 +11,4 @@ CONFIG_SYS_PM_POLICY_APP=y CONFIG_IDLE_STACK_SIZE=2048 # to check isr CONFIG_IRQ_OFFLOAD=y +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/tests/kernel/queue/prj.conf b/tests/kernel/queue/prj.conf index 29f2d64944eda..50febd952af05 100644 --- a/tests/kernel/queue/prj.conf +++ b/tests/kernel/queue/prj.conf @@ -1,3 +1,4 @@ CONFIG_ZTEST=y CONFIG_IRQ_OFFLOAD=y CONFIG_TEST_USERSPACE=y +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/tests/kernel/queue/prj_poll.conf b/tests/kernel/queue/prj_poll.conf index 72ba574fc553c..4ba63e6fb31fe 100644 --- a/tests/kernel/queue/prj_poll.conf +++ b/tests/kernel/queue/prj_poll.conf @@ -2,3 +2,4 @@ CONFIG_ZTEST=y CONFIG_IRQ_OFFLOAD=y CONFIG_POLL=y CONFIG_TEST_USERSPACE=y +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/tests/kernel/sched/deadline/prj.conf b/tests/kernel/sched/deadline/prj.conf index 56429422280f0..3ab5a6105f524 100644 --- a/tests/kernel/sched/deadline/prj.conf +++ b/tests/kernel/sched/deadline/prj.conf @@ -9,3 +9,4 @@ CONFIG_BT=n CONFIG_SCHED_DUMB=y +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/tests/kernel/sched/preempt/prj.conf b/tests/kernel/sched/preempt/prj.conf index 7a3e5084084ab..cbc2559cfcce3 100644 --- a/tests/kernel/sched/preempt/prj.conf +++ b/tests/kernel/sched/preempt/prj.conf @@ -2,3 +2,4 @@ CONFIG_ZTEST=y CONFIG_MP_NUM_CPUS=1 CONFIG_NUM_METAIRQ_PRIORITIES=1 CONFIG_IRQ_OFFLOAD=y +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/tests/kernel/sched/schedule_api/prj.conf b/tests/kernel/sched/schedule_api/prj.conf index 2a71faa38ea61..d40b8761a8321 100644 --- a/tests/kernel/sched/schedule_api/prj.conf +++ b/tests/kernel/sched/schedule_api/prj.conf @@ -6,3 +6,4 @@ CONFIG_QEMU_TICKLESS_WORKAROUND=y CONFIG_MAX_THREAD_BYTES=4 CONFIG_TEST_USERSPACE=y CONFIG_MP_NUM_CPUS=1 +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/tests/kernel/sched/schedule_api/prj_multiq.conf b/tests/kernel/sched/schedule_api/prj_multiq.conf index 870b5389ab0cd..71a2d3884f56e 100644 --- a/tests/kernel/sched/schedule_api/prj_multiq.conf +++ b/tests/kernel/sched/schedule_api/prj_multiq.conf @@ -5,3 +5,4 @@ CONFIG_SCHED_MULTIQ=y CONFIG_QEMU_TICKLESS_WORKAROUND=y CONFIG_MAX_THREAD_BYTES=4 CONFIG_MP_NUM_CPUS=1 +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/tests/kernel/semaphore/sema_api/prj.conf b/tests/kernel/semaphore/sema_api/prj.conf index af4c2c15ab209..7dd19a0109c01 100644 --- a/tests/kernel/semaphore/sema_api/prj.conf +++ b/tests/kernel/semaphore/sema_api/prj.conf @@ -2,3 +2,4 @@ CONFIG_ZTEST=y CONFIG_IRQ_OFFLOAD=y CONFIG_TEST_USERSPACE=y CONFIG_MP_NUM_CPUS=1 +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/tests/kernel/semaphore/semaphore/prj.conf b/tests/kernel/semaphore/semaphore/prj.conf index af4c2c15ab209..7dd19a0109c01 100644 --- a/tests/kernel/semaphore/semaphore/prj.conf +++ b/tests/kernel/semaphore/semaphore/prj.conf @@ -2,3 +2,4 @@ CONFIG_ZTEST=y CONFIG_IRQ_OFFLOAD=y CONFIG_TEST_USERSPACE=y CONFIG_MP_NUM_CPUS=1 +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/tests/kernel/sleep/prj.conf b/tests/kernel/sleep/prj.conf index 47d9849b6b1a2..c8631ca588083 100644 --- a/tests/kernel/sleep/prj.conf +++ b/tests/kernel/sleep/prj.conf @@ -2,4 +2,5 @@ CONFIG_IRQ_OFFLOAD=y CONFIG_ZTEST=y CONFIG_QEMU_TICKLESS_WORKAROUND=y CONFIG_TEST_USERSPACE=y -CONFIG_MP_NUM_CPUS=1 \ No newline at end of file +CONFIG_MP_NUM_CPUS=1 +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/tests/kernel/smp/prj.conf b/tests/kernel/smp/prj.conf index 26542e0a35cba..fc5bd70dc2b06 100644 --- a/tests/kernel/smp/prj.conf +++ b/tests/kernel/smp/prj.conf @@ -1,2 +1,4 @@ CONFIG_ZTEST=y CONFIG_SMP=y + +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/tests/kernel/spinlock/prj.conf b/tests/kernel/spinlock/prj.conf index 26542e0a35cba..51fd0da557eae 100644 --- a/tests/kernel/spinlock/prj.conf +++ b/tests/kernel/spinlock/prj.conf @@ -1,2 +1,3 @@ CONFIG_ZTEST=y CONFIG_SMP=y +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/tests/kernel/stack/stack_api/prj.conf b/tests/kernel/stack/stack_api/prj.conf index af4c2c15ab209..7dd19a0109c01 100644 --- a/tests/kernel/stack/stack_api/prj.conf +++ b/tests/kernel/stack/stack_api/prj.conf @@ -2,3 +2,4 @@ CONFIG_ZTEST=y CONFIG_IRQ_OFFLOAD=y CONFIG_TEST_USERSPACE=y CONFIG_MP_NUM_CPUS=1 +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/tests/kernel/stack/stack_usage/prj.conf b/tests/kernel/stack/stack_usage/prj.conf index 29f2d64944eda..50febd952af05 100644 --- a/tests/kernel/stack/stack_usage/prj.conf +++ b/tests/kernel/stack/stack_usage/prj.conf @@ -1,3 +1,4 @@ CONFIG_ZTEST=y CONFIG_IRQ_OFFLOAD=y CONFIG_TEST_USERSPACE=y +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/tests/kernel/threads/dynamic_thread/prj.conf b/tests/kernel/threads/dynamic_thread/prj.conf index 804af8ea9a889..42a0af1ea0501 100644 --- a/tests/kernel/threads/dynamic_thread/prj.conf +++ b/tests/kernel/threads/dynamic_thread/prj.conf @@ -1,3 +1,5 @@ CONFIG_ZTEST=y CONFIG_TEST_USERSPACE=y CONFIG_HEAP_MEM_POOL_SIZE=4096 + +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/tests/kernel/threads/no-multithreading/prj.conf b/tests/kernel/threads/no-multithreading/prj.conf index 030c9730b8cae..d59a85fda3ead 100644 --- a/tests/kernel/threads/no-multithreading/prj.conf +++ b/tests/kernel/threads/no-multithreading/prj.conf @@ -2,3 +2,4 @@ CONFIG_ZTEST=y CONFIG_MULTITHREADING=n CONFIG_BT=n CONFIG_USB=n +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/tests/kernel/threads/thread_apis/prj.conf b/tests/kernel/threads/thread_apis/prj.conf index 68e3255997d78..0dabcc8602590 100644 --- a/tests/kernel/threads/thread_apis/prj.conf +++ b/tests/kernel/threads/thread_apis/prj.conf @@ -7,3 +7,4 @@ CONFIG_HEAP_MEM_POOL_SIZE=256 CONFIG_SCHED_CPU_MASK=y CONFIG_TEST_USERSPACE=y CONFIG_MP_NUM_CPUS=1 +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/tests/kernel/threads/thread_init/prj.conf b/tests/kernel/threads/thread_init/prj.conf index e39776e7067ab..46dc962cf9380 100644 --- a/tests/kernel/threads/thread_init/prj.conf +++ b/tests/kernel/threads/thread_init/prj.conf @@ -1,2 +1,3 @@ CONFIG_ZTEST=y CONFIG_TEST_USERSPACE=y +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/tests/kernel/tickless/tickless/prj.conf b/tests/kernel/tickless/tickless/prj.conf index 221188ede02b4..baff978f73dc8 100644 --- a/tests/kernel/tickless/tickless/prj.conf +++ b/tests/kernel/tickless/tickless/prj.conf @@ -2,4 +2,5 @@ CONFIG_SYS_POWER_MANAGEMENT=y CONFIG_ZTEST=y # The code is written to assume a slow tick rate -CONFIG_SYS_CLOCK_TICKS_PER_SEC=100 \ No newline at end of file +CONFIG_SYS_CLOCK_TICKS_PER_SEC=100 +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/tests/kernel/tickless/tickless_concept/prj.conf b/tests/kernel/tickless/tickless_concept/prj.conf index 736f2d1fea216..9c18d76a6ad21 100644 --- a/tests/kernel/tickless/tickless_concept/prj.conf +++ b/tests/kernel/tickless/tickless_concept/prj.conf @@ -3,3 +3,4 @@ CONFIG_SYS_POWER_MANAGEMENT=y CONFIG_TICKLESS_IDLE_THRESH=20 CONFIG_SYS_CLOCK_TICKS_PER_SEC=100 CONFIG_MP_NUM_CPUS=1 +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/tests/kernel/timer/timer_api/prj.conf b/tests/kernel/timer/timer_api/prj.conf index 8a0f28ace316c..556a409fde8ad 100644 --- a/tests/kernel/timer/timer_api/prj.conf +++ b/tests/kernel/timer/timer_api/prj.conf @@ -4,3 +4,5 @@ CONFIG_TEST_USERSPACE=y CONFIG_MP_NUM_CPUS=1 CONFIG_SYS_TIMEOUT_64BIT=y CONFIG_TEST_RANDOM_GENERATOR=y + +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/tests/kernel/timer/timer_api/prj_tickless.conf b/tests/kernel/timer/timer_api/prj_tickless.conf index 05a3837ea2663..f6a92258bf2b3 100644 --- a/tests/kernel/timer/timer_api/prj_tickless.conf +++ b/tests/kernel/timer/timer_api/prj_tickless.conf @@ -3,3 +3,5 @@ CONFIG_SYS_POWER_MANAGEMENT=y CONFIG_TICKLESS_KERNEL=y CONFIG_MP_NUM_CPUS=1 CONFIG_TEST_RANDOM_GENERATOR=y + +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/tests/kernel/timer/timer_monotonic/prj.conf b/tests/kernel/timer/timer_monotonic/prj.conf index 06ed7ead2b9eb..1068c3f9d5015 100644 --- a/tests/kernel/timer/timer_monotonic/prj.conf +++ b/tests/kernel/timer/timer_monotonic/prj.conf @@ -1,3 +1,4 @@ CONFIG_ZTEST=y +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/tests/kernel/workq/work_queue/prj.conf b/tests/kernel/workq/work_queue/prj.conf index 3b3d21d73d2e2..0384f837d0363 100644 --- a/tests/kernel/workq/work_queue/prj.conf +++ b/tests/kernel/workq/work_queue/prj.conf @@ -1,5 +1,6 @@ CONFIG_ZTEST=y CONFIG_QEMU_TICKLESS_WORKAROUND=y +CONFIG_SYS_TIMEOUT_LEGACY_API=n # Not a single test case here is SMP-safe. Save the cycles needed for # all the ztest_1cpu spinning. diff --git a/tests/kernel/workq/work_queue_api/prj.conf b/tests/kernel/workq/work_queue_api/prj.conf index 4b951000804b7..f597fa95be6e0 100644 --- a/tests/kernel/workq/work_queue_api/prj.conf +++ b/tests/kernel/workq/work_queue_api/prj.conf @@ -4,3 +4,4 @@ CONFIG_HEAP_MEM_POOL_SIZE=1024 CONFIG_THREAD_NAME=y CONFIG_TEST_USERSPACE=y CONFIG_MP_NUM_CPUS=1 +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/tests/kernel/xip/prj.conf b/tests/kernel/xip/prj.conf index 9467c2926896d..0a4cda92971d2 100644 --- a/tests/kernel/xip/prj.conf +++ b/tests/kernel/xip/prj.conf @@ -1 +1,3 @@ CONFIG_ZTEST=y + +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/tests/lib/c_lib/prj.conf b/tests/lib/c_lib/prj.conf index 0fdb4325efbc6..7049cf0e1675f 100644 --- a/tests/lib/c_lib/prj.conf +++ b/tests/lib/c_lib/prj.conf @@ -1 +1,2 @@ -CONFIG_ZTEST=y \ No newline at end of file +CONFIG_ZTEST=y +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/tests/lib/fdtable/prj.conf b/tests/lib/fdtable/prj.conf index 4096602b11a49..39eb3bf1b0a66 100644 --- a/tests/lib/fdtable/prj.conf +++ b/tests/lib/fdtable/prj.conf @@ -1,3 +1,2 @@ CONFIG_ZTEST=y CONFIG_POSIX_API=y -CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/lib/gui/lvgl/prj.conf b/tests/lib/gui/lvgl/prj.conf index 379baffde0933..a7679e1cd0b18 100644 --- a/tests/lib/gui/lvgl/prj.conf +++ b/tests/lib/gui/lvgl/prj.conf @@ -79,3 +79,4 @@ CONFIG_LVGL_BUILD_IN_FONT_ROBOTO_16=y CONFIG_LVGL_BUILD_IN_FONT_ROBOTO_22=y CONFIG_LVGL_BUILD_IN_FONT_ROBOTO_28=y CONFIG_LVGL_BUILD_IN_FONT_UNSCII_8=y +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/tests/lib/json/prj.conf b/tests/lib/json/prj.conf index 923b38d771da4..a0d8ef3155236 100644 --- a/tests/lib/json/prj.conf +++ b/tests/lib/json/prj.conf @@ -1,3 +1,4 @@ CONFIG_JSON_LIBRARY=y CONFIG_ZTEST=y CONFIG_ZTEST_STACKSIZE=2048 +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/tests/lib/mem_alloc/prj.conf b/tests/lib/mem_alloc/prj.conf index 87969fc03ff9c..1b914788bb87d 100644 --- a/tests/lib/mem_alloc/prj.conf +++ b/tests/lib/mem_alloc/prj.conf @@ -1,3 +1,5 @@ CONFIG_ZTEST=y CONFIG_MINIMAL_LIBC_MALLOC_ARENA_SIZE=2048 CONFIG_TEST_USERSPACE=y + +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/tests/lib/mem_alloc/prj_newlib.conf b/tests/lib/mem_alloc/prj_newlib.conf index dabdfd5997038..c405f5a1451f2 100644 --- a/tests/lib/mem_alloc/prj_newlib.conf +++ b/tests/lib/mem_alloc/prj_newlib.conf @@ -2,3 +2,5 @@ CONFIG_ZTEST=y CONFIG_NEWLIB_LIBC=y CONFIG_NEWLIB_LIBC_ALIGNED_HEAP_SIZE=512 CONFIG_TEST_USERSPACE=y + +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/tests/lib/mem_alloc/prj_newlibnano.conf b/tests/lib/mem_alloc/prj_newlibnano.conf index 2f301e7ae4b79..eef8fa89d996f 100644 --- a/tests/lib/mem_alloc/prj_newlibnano.conf +++ b/tests/lib/mem_alloc/prj_newlibnano.conf @@ -1,3 +1,5 @@ CONFIG_ZTEST=y CONFIG_NEWLIB_LIBC=y CONFIG_NEWLIB_LIBC_NANO=y + +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/tests/lib/ringbuffer/prj.conf b/tests/lib/ringbuffer/prj.conf index ca9eb30324e0e..07d0b625e97d4 100644 --- a/tests/lib/ringbuffer/prj.conf +++ b/tests/lib/ringbuffer/prj.conf @@ -1,3 +1,4 @@ CONFIG_ZTEST=y CONFIG_IRQ_OFFLOAD=y CONFIG_RING_BUFFER=y +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/tests/lib/sprintf/prj.conf b/tests/lib/sprintf/prj.conf index 2bd9d6137b631..407797f990567 100644 --- a/tests/lib/sprintf/prj.conf +++ b/tests/lib/sprintf/prj.conf @@ -1,2 +1,3 @@ CONFIG_ZTEST=y CONFIG_FLOAT=y +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/tests/lib/timeutil/prj.conf b/tests/lib/timeutil/prj.conf index 9467c2926896d..7049cf0e1675f 100644 --- a/tests/lib/timeutil/prj.conf +++ b/tests/lib/timeutil/prj.conf @@ -1 +1,2 @@ CONFIG_ZTEST=y +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/tests/misc/test_build/debug.conf b/tests/misc/test_build/debug.conf index e37d00e3fca4e..aede3729cbb9e 100644 --- a/tests/misc/test_build/debug.conf +++ b/tests/misc/test_build/debug.conf @@ -3,4 +3,3 @@ CONFIG_DEBUG=y CONFIG_STDOUT_CONSOLE=y CONFIG_KERNEL_DEBUG=y CONFIG_ASSERT=y -CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/misc/test_build/prj.conf b/tests/misc/test_build/prj.conf new file mode 100644 index 0000000000000..675a4a2d8517e --- /dev/null +++ b/tests/misc/test_build/prj.conf @@ -0,0 +1 @@ +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/tests/net/6lo/prj.conf b/tests/net/6lo/prj.conf index 546cb094502e2..87cdfc6a0939b 100644 --- a/tests/net/6lo/prj.conf +++ b/tests/net/6lo/prj.conf @@ -20,4 +20,3 @@ CONFIG_NET_6LO_CONTEXT=y #Before modifying this value, add respective code in src/main.c CONFIG_NET_MAX_6LO_CONTEXTS=2 CONFIG_ZTEST=y -CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/net/arp/prj.conf b/tests/net/arp/prj.conf index bf96a8597e9b0..a45a27fe3a68b 100644 --- a/tests/net/arp/prj.conf +++ b/tests/net/arp/prj.conf @@ -15,4 +15,3 @@ CONFIG_TEST_RANDOM_GENERATOR=y CONFIG_NET_IF_UNICAST_IPV4_ADDR_COUNT=3 CONFIG_NET_IPV6=n CONFIG_ZTEST=y -CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/net/buf/prj.conf b/tests/net/buf/prj.conf index 8ded729467004..47e462402b35a 100644 --- a/tests/net/buf/prj.conf +++ b/tests/net/buf/prj.conf @@ -4,4 +4,3 @@ CONFIG_HEAP_MEM_POOL_SIZE=4096 #CONFIG_NET_BUF_LOG=y #CONFIG_NET_BUF_LOG_LEVEL_DBG=y CONFIG_ZTEST=y -CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/net/checksum_offload/prj.conf b/tests/net/checksum_offload/prj.conf index b860ba7f033c1..0453b6b13ae6f 100644 --- a/tests/net/checksum_offload/prj.conf +++ b/tests/net/checksum_offload/prj.conf @@ -31,4 +31,3 @@ CONFIG_ETH_MCUX=n CONFIG_ETH_SAM_GMAC=n CONFIG_ETH_ENC28J60=n CONFIG_ETH_STM32_HAL=n -CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/net/context/prj.conf b/tests/net/context/prj.conf index 0096bc9a8af06..2b759c7e0088c 100644 --- a/tests/net/context/prj.conf +++ b/tests/net/context/prj.conf @@ -20,4 +20,3 @@ CONFIG_NET_PKT_RX_COUNT=5 CONFIG_NET_BUF_RX_COUNT=10 CONFIG_NET_BUF_TX_COUNT=10 CONFIG_ZTEST=y -CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/net/dhcpv4/prj.conf b/tests/net/dhcpv4/prj.conf index 0412b9c607177..60d161aafdc04 100644 --- a/tests/net/dhcpv4/prj.conf +++ b/tests/net/dhcpv4/prj.conf @@ -27,4 +27,3 @@ CONFIG_NET_UDP_CHECKSUM=n CONFIG_MAIN_STACK_SIZE=3072 CONFIG_ZTEST=y CONFIG_NET_DHCPV4_INITIAL_DELAY_MAX=2 -CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/net/ethernet_mgmt/prj.conf b/tests/net/ethernet_mgmt/prj.conf index 72c8195d16b78..ee65bc9327eb8 100644 --- a/tests/net/ethernet_mgmt/prj.conf +++ b/tests/net/ethernet_mgmt/prj.conf @@ -16,4 +16,3 @@ CONFIG_NET_IPV6_DAD=n CONFIG_NET_IPV6_MLD=n CONFIG_NET_IPV6_NBR_CACHE=n CONFIG_TEST_RANDOM_GENERATOR=y -CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/net/icmpv6/prj.conf b/tests/net/icmpv6/prj.conf index c6a78467a08c7..8fd3358b8690d 100644 --- a/tests/net/icmpv6/prj.conf +++ b/tests/net/icmpv6/prj.conf @@ -14,4 +14,3 @@ CONFIG_TEST_RANDOM_GENERATOR=y CONFIG_ZTEST=y CONFIG_MAIN_STACK_SIZE=1280 -CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/net/iface/prj.conf b/tests/net/iface/prj.conf index 4e24cf41839b7..dc3825c1c0650 100644 --- a/tests/net/iface/prj.conf +++ b/tests/net/iface/prj.conf @@ -28,4 +28,3 @@ CONFIG_NET_IF_MAX_IPV4_COUNT=4 CONFIG_NET_IF_MAX_IPV6_COUNT=4 CONFIG_TEST_USERSPACE=y CONFIG_NET_IF_USERSPACE_ACCESS=y -CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/net/ip-addr/prj.conf b/tests/net/ip-addr/prj.conf index 59a3f5f7d26b3..648b6ef4cc4cc 100644 --- a/tests/net/ip-addr/prj.conf +++ b/tests/net/ip-addr/prj.conf @@ -18,4 +18,3 @@ CONFIG_NET_IF_UNICAST_IPV4_ADDR_COUNT=2 CONFIG_NET_IF_MCAST_IPV4_ADDR_COUNT=3 CONFIG_NET_L2_DUMMY=y CONFIG_ZTEST=y -CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/net/ipv6/prj.conf b/tests/net/ipv6/prj.conf index b76a8400c6124..48fe041d84ffd 100644 --- a/tests/net/ipv6/prj.conf +++ b/tests/net/ipv6/prj.conf @@ -24,4 +24,3 @@ CONFIG_NET_IF_UNICAST_IPV6_ADDR_COUNT=9 CONFIG_NET_IF_MCAST_IPV6_ADDR_COUNT=7 CONFIG_NET_IF_IPV6_PREFIX_COUNT=3 CONFIG_NET_UDP_CHECKSUM=n -CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/net/ipv6_fragment/prj.conf b/tests/net/ipv6_fragment/prj.conf index 111f84bd5b42e..aaa6723967942 100644 --- a/tests/net/ipv6_fragment/prj.conf +++ b/tests/net/ipv6_fragment/prj.conf @@ -28,4 +28,3 @@ CONFIG_ZTEST=y CONFIG_INIT_STACKS=y CONFIG_PRINTK=y CONFIG_NET_STATISTICS=n -CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/net/lib/coap/prj.conf b/tests/net/lib/coap/prj.conf index 1d14ca631dcb5..5ea00b6a224b4 100644 --- a/tests/net/lib/coap/prj.conf +++ b/tests/net/lib/coap/prj.conf @@ -28,4 +28,3 @@ CONFIG_COAP_LOG_LEVEL_DBG=y CONFIG_MAIN_STACK_SIZE=2048 CONFIG_HEAP_MEM_POOL_SIZE=2048 -CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/net/lib/dns_addremove/prj.conf b/tests/net/lib/dns_addremove/prj.conf index 520afb2d102de..5d0330c022aed 100644 --- a/tests/net/lib/dns_addremove/prj.conf +++ b/tests/net/lib/dns_addremove/prj.conf @@ -17,4 +17,3 @@ CONFIG_NET_ARP=n CONFIG_PRINTK=y CONFIG_ZTEST=y CONFIG_MAIN_STACK_SIZE=1024 -CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/net/lib/dns_packet/prj.conf b/tests/net/lib/dns_packet/prj.conf index c67f1ed51f071..1a627899c0afb 100644 --- a/tests/net/lib/dns_packet/prj.conf +++ b/tests/net/lib/dns_packet/prj.conf @@ -12,4 +12,3 @@ CONFIG_PRINTK=y CONFIG_ZTEST=y CONFIG_MAIN_STACK_SIZE=1280 -CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/net/lib/dns_resolve/prj-no-ipv6.conf b/tests/net/lib/dns_resolve/prj-no-ipv6.conf index f2a7993492215..8fc1f5d908740 100644 --- a/tests/net/lib/dns_resolve/prj-no-ipv6.conf +++ b/tests/net/lib/dns_resolve/prj-no-ipv6.conf @@ -26,4 +26,3 @@ CONFIG_PRINTK=y CONFIG_ZTEST=y CONFIG_MAIN_STACK_SIZE=1344 -CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/net/lib/dns_resolve/prj.conf b/tests/net/lib/dns_resolve/prj.conf index 9da85cace6772..0ce99bfad13b1 100644 --- a/tests/net/lib/dns_resolve/prj.conf +++ b/tests/net/lib/dns_resolve/prj.conf @@ -28,4 +28,3 @@ CONFIG_PRINTK=y CONFIG_ZTEST=y CONFIG_MAIN_STACK_SIZE=1344 -CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/net/lib/http_header_fields/prj.conf b/tests/net/lib/http_header_fields/prj.conf index 3dc1ae181e192..8323faf5bc10b 100644 --- a/tests/net/lib/http_header_fields/prj.conf +++ b/tests/net/lib/http_header_fields/prj.conf @@ -8,4 +8,3 @@ CONFIG_ZTEST=y CONFIG_MAIN_STACK_SIZE=1280 # Enable strict parser by uncommenting the following line # CONFIG_HTTP_PARSER_STRICT=y -CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/net/lib/mqtt_packet/prj.conf b/tests/net/lib/mqtt_packet/prj.conf index 2161cfe29ec85..1c4a907a1558e 100644 --- a/tests/net/lib/mqtt_packet/prj.conf +++ b/tests/net/lib/mqtt_packet/prj.conf @@ -11,4 +11,3 @@ CONFIG_MQTT_LIB=y CONFIG_ZTEST=y CONFIG_TEST_USERSPACE=y CONFIG_MAIN_STACK_SIZE=1280 -CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/net/lib/mqtt_publisher/prj.conf b/tests/net/lib/mqtt_publisher/prj.conf index 0f243343a743c..c9342459893e6 100644 --- a/tests/net/lib/mqtt_publisher/prj.conf +++ b/tests/net/lib/mqtt_publisher/prj.conf @@ -32,4 +32,3 @@ CONFIG_MAIN_STACK_SIZE=2048 CONFIG_NET_BUF_DATA_SIZE=256 CONFIG_ZTEST=y -CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/net/lib/mqtt_publisher/prj_tls.conf b/tests/net/lib/mqtt_publisher/prj_tls.conf index 76f7d8a00931f..2cae009847229 100644 --- a/tests/net/lib/mqtt_publisher/prj_tls.conf +++ b/tests/net/lib/mqtt_publisher/prj_tls.conf @@ -48,4 +48,3 @@ CONFIG_MBEDTLS_HEAP_SIZE=30000 # for tls_entropy_func CONFIG_TEST_RANDOM_GENERATOR=y CONFIG_ZTEST=y -CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/net/lib/mqtt_pubsub/prj.conf b/tests/net/lib/mqtt_pubsub/prj.conf index 2c8792aaa32bc..368a9c283ddb3 100644 --- a/tests/net/lib/mqtt_pubsub/prj.conf +++ b/tests/net/lib/mqtt_pubsub/prj.conf @@ -32,4 +32,3 @@ CONFIG_MAIN_STACK_SIZE=2048 CONFIG_NET_BUF_DATA_SIZE=256 CONFIG_ZTEST=y -CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/net/lib/mqtt_subscriber/prj.conf b/tests/net/lib/mqtt_subscriber/prj.conf index 2c8792aaa32bc..368a9c283ddb3 100644 --- a/tests/net/lib/mqtt_subscriber/prj.conf +++ b/tests/net/lib/mqtt_subscriber/prj.conf @@ -32,4 +32,3 @@ CONFIG_MAIN_STACK_SIZE=2048 CONFIG_NET_BUF_DATA_SIZE=256 CONFIG_ZTEST=y -CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/net/lib/tls_credentials/prj.conf b/tests/net/lib/tls_credentials/prj.conf index 3a1ce35d58824..10d4559adb8cc 100644 --- a/tests/net/lib/tls_credentials/prj.conf +++ b/tests/net/lib/tls_credentials/prj.conf @@ -4,4 +4,3 @@ CONFIG_NETWORKING=y CONFIG_TEST_RANDOM_GENERATOR=y CONFIG_TLS_CREDENTIALS=y CONFIG_TLS_MAX_CREDENTIALS_NUMBER=4 -CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/net/mgmt/prj.conf b/tests/net/mgmt/prj.conf index 00f72be77d079..9a924c059e99a 100644 --- a/tests/net/mgmt/prj.conf +++ b/tests/net/mgmt/prj.conf @@ -17,4 +17,3 @@ CONFIG_NET_MGMT_EVENT_INFO=y CONFIG_NET_IPV6=y CONFIG_NET_L2_DUMMY=y CONFIG_ZTEST=y -CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/net/mld/prj.conf b/tests/net/mld/prj.conf index 883fadd05cbcf..a99599b160ab0 100644 --- a/tests/net/mld/prj.conf +++ b/tests/net/mld/prj.conf @@ -21,4 +21,3 @@ CONFIG_NET_MGMT=y CONFIG_NET_MGMT_EVENT=y CONFIG_NET_IF_UNICAST_IPV6_ADDR_COUNT=4 CONFIG_NET_IF_MCAST_IPV6_ADDR_COUNT=4 -CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/net/neighbor/prj.conf b/tests/net/neighbor/prj.conf index 70001fe9800be..9b0844ee27d90 100644 --- a/tests/net/neighbor/prj.conf +++ b/tests/net/neighbor/prj.conf @@ -14,4 +14,3 @@ CONFIG_TEST_RANDOM_GENERATOR=y CONFIG_NET_IF_UNICAST_IPV4_ADDR_COUNT=3 CONFIG_NET_IPV6_MAX_NEIGHBORS=4 CONFIG_ZTEST=y -CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/net/net_pkt/prj.conf b/tests/net/net_pkt/prj.conf index cd1b773c1ad5d..764d86554af08 100644 --- a/tests/net/net_pkt/prj.conf +++ b/tests/net/net_pkt/prj.conf @@ -12,4 +12,3 @@ CONFIG_NET_LOG=y CONFIG_ENTROPY_GENERATOR=y CONFIG_TEST_RANDOM_GENERATOR=y -CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/net/promiscuous/prj.conf b/tests/net/promiscuous/prj.conf index a8c453014867f..5f56de6e98e81 100644 --- a/tests/net/promiscuous/prj.conf +++ b/tests/net/promiscuous/prj.conf @@ -22,4 +22,3 @@ CONFIG_NET_IF_UNICAST_IPV6_ADDR_COUNT=6 CONFIG_NET_IPV6_MAX_NEIGHBORS=1 CONFIG_NET_IPV6_ND=n CONFIG_ZTEST=y -CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/net/ptp/clock/prj.conf b/tests/net/ptp/clock/prj.conf index ca22479bc24e6..364cd61141a44 100644 --- a/tests/net/ptp/clock/prj.conf +++ b/tests/net/ptp/clock/prj.conf @@ -26,4 +26,3 @@ CONFIG_ETH_NATIVE_POSIX=n CONFIG_COVERAGE=n CONFIG_TEST_USERSPACE=y CONFIG_HEAP_MEM_POOL_SIZE=128 -CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/net/route/prj.conf b/tests/net/route/prj.conf index c0fcd1e646874..c78b9dbc85f1c 100644 --- a/tests/net/route/prj.conf +++ b/tests/net/route/prj.conf @@ -20,4 +20,3 @@ CONFIG_NET_MAX_ROUTES=4 CONFIG_NET_MAX_NEXTHOPS=8 CONFIG_NET_IPV6_MAX_NEIGHBORS=8 CONFIG_ZTEST=y -CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/net/socket/getaddrinfo/prj.conf b/tests/net/socket/getaddrinfo/prj.conf index c75a18760f186..24c960fa1ecfc 100644 --- a/tests/net/socket/getaddrinfo/prj.conf +++ b/tests/net/socket/getaddrinfo/prj.conf @@ -38,4 +38,3 @@ CONFIG_NEWLIB_LIBC_ALIGNED_HEAP_SIZE=256 CONFIG_NET_IPV6_DAD=n CONFIG_NET_IPV6_ND=n CONFIG_NET_IPV6_MLD=n -CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/net/socket/getnameinfo/prj.conf b/tests/net/socket/getnameinfo/prj.conf index 3e910b31b43eb..4a1c4ed644097 100644 --- a/tests/net/socket/getnameinfo/prj.conf +++ b/tests/net/socket/getnameinfo/prj.conf @@ -32,4 +32,3 @@ CONFIG_ZTEST=y # User mode requirements CONFIG_TEST_USERSPACE=y CONFIG_HEAP_MEM_POOL_SIZE=128 -CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/net/socket/misc/prj.conf b/tests/net/socket/misc/prj.conf index d63951b244d40..cd4831e5eacd7 100644 --- a/tests/net/socket/misc/prj.conf +++ b/tests/net/socket/misc/prj.conf @@ -27,4 +27,3 @@ CONFIG_ZTEST=y # User mode requirements CONFIG_TEST_USERSPACE=y CONFIG_HEAP_MEM_POOL_SIZE=128 -CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/net/socket/net_mgmt/prj.conf b/tests/net/socket/net_mgmt/prj.conf index 8e3519feed821..82e5d8aa69c77 100644 --- a/tests/net/socket/net_mgmt/prj.conf +++ b/tests/net/socket/net_mgmt/prj.conf @@ -37,4 +37,3 @@ CONFIG_NET_IPV6_ND=n CONFIG_NET_IPV6_MLD=n CONFIG_NET_SOCKETS_LOG_LEVEL_DBG=y -CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/net/socket/poll/prj.conf b/tests/net/socket/poll/prj.conf index a45883fb7d225..c36b39835256a 100644 --- a/tests/net/socket/poll/prj.conf +++ b/tests/net/socket/poll/prj.conf @@ -27,4 +27,3 @@ CONFIG_QEMU_TICKLESS_WORKAROUND=y CONFIG_NET_TEST=y CONFIG_NET_LOOPBACK=y -CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/net/socket/register/prj.conf b/tests/net/socket/register/prj.conf index d9572206d89a2..3d66ea421b47e 100644 --- a/tests/net/socket/register/prj.conf +++ b/tests/net/socket/register/prj.conf @@ -14,4 +14,3 @@ CONFIG_NET_SOCKETS=y CONFIG_NET_SOCKETS_POSIX_NAMES=y CONFIG_TEST_RANDOM_GENERATOR=y CONFIG_NET_MAX_CONTEXTS=10 -CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/net/socket/select/prj.conf b/tests/net/socket/select/prj.conf index cdee8c4c1e43a..b600de000ffcd 100644 --- a/tests/net/socket/select/prj.conf +++ b/tests/net/socket/select/prj.conf @@ -28,4 +28,3 @@ CONFIG_TEST_USERSPACE=y CONFIG_HEAP_MEM_POOL_SIZE=128 CONFIG_QEMU_TICKLESS_WORKAROUND=y -CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/net/socket/tcp/prj.conf b/tests/net/socket/tcp/prj.conf index d5d31e03f6ad6..0a62fcb432da7 100644 --- a/tests/net/socket/tcp/prj.conf +++ b/tests/net/socket/tcp/prj.conf @@ -32,4 +32,3 @@ CONFIG_NET_PKT_TX_COUNT=24 CONFIG_ZTEST=y CONFIG_ZTEST_STACKSIZE=2048 -CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/net/socket/udp/prj.conf b/tests/net/socket/udp/prj.conf index a3dd3fda02c47..c9d6ec7a49e22 100644 --- a/tests/net/socket/udp/prj.conf +++ b/tests/net/socket/udp/prj.conf @@ -31,4 +31,3 @@ CONFIG_TEST_USERSPACE=y CONFIG_NET_CONTEXT_PRIORITY=y CONFIG_NET_CONTEXT_TXTIME=y -CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/net/tcp/prj.conf b/tests/net/tcp/prj.conf index e6cc06cdbc963..d1ab0efae84d6 100644 --- a/tests/net/tcp/prj.conf +++ b/tests/net/tcp/prj.conf @@ -27,4 +27,3 @@ CONFIG_NET_IPV6_DAD=n CONFIG_NET_IPV6_NBR_CACHE=n CONFIG_NET_IPV6_MLD=n CONFIG_NET_TCP_CHECKSUM=n -CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/net/traffic_class/prj.conf b/tests/net/traffic_class/prj.conf index ebc07b6a9adb0..2e0620228949a 100644 --- a/tests/net/traffic_class/prj.conf +++ b/tests/net/traffic_class/prj.conf @@ -30,4 +30,3 @@ CONFIG_NET_TC_RX_COUNT=8 CONFIG_ZTEST=y CONFIG_NET_CONFIG_SETTINGS=n CONFIG_NET_SHELL=n -CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/net/trickle/prj.conf b/tests/net/trickle/prj.conf index 9416d61fb64ac..d2ff49ce18310 100644 --- a/tests/net/trickle/prj.conf +++ b/tests/net/trickle/prj.conf @@ -18,4 +18,3 @@ CONFIG_ZTEST=y CONFIG_ZTEST_STACKSIZE=1024 CONFIG_NET_LOOPBACK=y CONFIG_NET_IPV6_MLD=n -CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/net/tx_timestamp/prj.conf b/tests/net/tx_timestamp/prj.conf index 2351bad068ae0..6f1fb715dee58 100644 --- a/tests/net/tx_timestamp/prj.conf +++ b/tests/net/tx_timestamp/prj.conf @@ -24,4 +24,3 @@ CONFIG_NET_SHELL=n CONFIG_NET_CONTEXT_TIMESTAMP=y CONFIG_NET_PKT_TIMESTAMP=y CONFIG_NET_PKT_TIMESTAMP_THREAD=y -CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/net/udp/prj.conf b/tests/net/udp/prj.conf index 5de7544c56d42..42f43a32b046c 100644 --- a/tests/net/udp/prj.conf +++ b/tests/net/udp/prj.conf @@ -22,4 +22,3 @@ CONFIG_NET_IF_UNICAST_IPV4_ADDR_COUNT=2 # Turn off UDP checksum checking as the test fails otherwise. CONFIG_NET_UDP_CHECKSUM=n CONFIG_ZTEST=y -CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/net/utils/prj.conf b/tests/net/utils/prj.conf index a4ce7a04f76e8..91db600fe330b 100644 --- a/tests/net/utils/prj.conf +++ b/tests/net/utils/prj.conf @@ -17,4 +17,3 @@ CONFIG_NET_UDP=y CONFIG_ZTEST=y CONFIG_MAIN_STACK_SIZE=1280 CONFIG_TEST_USERSPACE=y -CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/net/vlan/prj.conf b/tests/net/vlan/prj.conf index 5b3333368c740..19b908bcd65ad 100644 --- a/tests/net/vlan/prj.conf +++ b/tests/net/vlan/prj.conf @@ -33,4 +33,3 @@ CONFIG_ETH_MCUX=n CONFIG_ETH_SAM_GMAC=n CONFIG_ETH_ENC28J60=n CONFIG_ETH_STM32_HAL=n -CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/portability/cmsis_rtos_v1/prj.conf b/tests/portability/cmsis_rtos_v1/prj.conf index b5a9eef782655..7ec7331cea0f7 100644 --- a/tests/portability/cmsis_rtos_v1/prj.conf +++ b/tests/portability/cmsis_rtos_v1/prj.conf @@ -6,4 +6,3 @@ CONFIG_MAX_THREAD_BYTES=4 CONFIG_IRQ_OFFLOAD=y CONFIG_SMP=n -CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/portability/cmsis_rtos_v2/prj.conf b/tests/portability/cmsis_rtos_v2/prj.conf index 1a82048079260..ab8d18fcfd6e5 100644 --- a/tests/portability/cmsis_rtos_v2/prj.conf +++ b/tests/portability/cmsis_rtos_v2/prj.conf @@ -16,4 +16,3 @@ CONFIG_CMSIS_V2_THREAD_DYNAMIC_MAX_COUNT=10 # The Zephyr CMSIS emulation assumes that ticks are ms, currently CONFIG_SYS_CLOCK_TICKS_PER_SEC=1000 -CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/posix/common/prj.conf b/tests/posix/common/prj.conf index 9e7cff2a9982e..4f6a845b21c84 100644 --- a/tests/posix/common/prj.conf +++ b/tests/posix/common/prj.conf @@ -8,4 +8,3 @@ CONFIG_HEAP_MEM_POOL_SIZE=4096 CONFIG_MAX_THREAD_BYTES=4 CONFIG_SMP=n -CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/posix/fs/prj.conf b/tests/posix/fs/prj.conf index 62a66f47aa648..8bc3ff809b361 100644 --- a/tests/posix/fs/prj.conf +++ b/tests/posix/fs/prj.conf @@ -7,4 +7,3 @@ CONFIG_POSIX_API=y CONFIG_POSIX_FS=y CONFIG_ZTEST=y CONFIG_MAIN_STACK_SIZE=4096 -CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/shell/prj.conf b/tests/shell/prj.conf index 8b8a09262d5d8..93c5dadeee4fd 100644 --- a/tests/shell/prj.conf +++ b/tests/shell/prj.conf @@ -7,4 +7,3 @@ CONFIG_SHELL_PRINTF_BUFF_SIZE=15 CONFIG_SHELL_METAKEYS=n CONFIG_LOG=n CONFIG_ZTEST=y -CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/subsys/can/frame/prj.conf b/tests/subsys/can/frame/prj.conf index 46bc4c8f17f1f..ef6edaf54b3b3 100644 --- a/tests/subsys/can/frame/prj.conf +++ b/tests/subsys/can/frame/prj.conf @@ -1,3 +1,4 @@ CONFIG_ZTEST=y CONFIG_LOG=y CONFIG_LOG_IMMEDIATE=y +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/tests/subsys/dfu/img_util/prj.conf b/tests/subsys/dfu/img_util/prj.conf index 43b1b45dc4c77..43e93f4024d0e 100644 --- a/tests/subsys/dfu/img_util/prj.conf +++ b/tests/subsys/dfu/img_util/prj.conf @@ -5,3 +5,4 @@ CONFIG_IMG_MANAGER=y CONFIG_MCUBOOT_IMG_MANAGER=y CONFIG_IMG_BLOCK_BUF_SIZE=512 CONFIG_ARM_MPU=n +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/tests/subsys/dfu/img_util/prj_native_posix.conf b/tests/subsys/dfu/img_util/prj_native_posix.conf index 65ee9acbadd55..ef536b19f7808 100644 --- a/tests/subsys/dfu/img_util/prj_native_posix.conf +++ b/tests/subsys/dfu/img_util/prj_native_posix.conf @@ -4,3 +4,4 @@ CONFIG_FLASH=y CONFIG_IMG_MANAGER=y CONFIG_MCUBOOT_IMG_MANAGER=y CONFIG_IMG_BLOCK_BUF_SIZE=512 +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/tests/subsys/dfu/img_util/prj_native_posix_64.conf b/tests/subsys/dfu/img_util/prj_native_posix_64.conf index 65ee9acbadd55..ef536b19f7808 100644 --- a/tests/subsys/dfu/img_util/prj_native_posix_64.conf +++ b/tests/subsys/dfu/img_util/prj_native_posix_64.conf @@ -4,3 +4,4 @@ CONFIG_FLASH=y CONFIG_IMG_MANAGER=y CONFIG_MCUBOOT_IMG_MANAGER=y CONFIG_IMG_BLOCK_BUF_SIZE=512 +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/tests/subsys/dfu/mcuboot/prj.conf b/tests/subsys/dfu/mcuboot/prj.conf index 43b1b45dc4c77..43e93f4024d0e 100644 --- a/tests/subsys/dfu/mcuboot/prj.conf +++ b/tests/subsys/dfu/mcuboot/prj.conf @@ -5,3 +5,4 @@ CONFIG_IMG_MANAGER=y CONFIG_MCUBOOT_IMG_MANAGER=y CONFIG_IMG_BLOCK_BUF_SIZE=512 CONFIG_ARM_MPU=n +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/tests/subsys/dfu/mcuboot/prj_native_posix.conf b/tests/subsys/dfu/mcuboot/prj_native_posix.conf index 65ee9acbadd55..ef536b19f7808 100644 --- a/tests/subsys/dfu/mcuboot/prj_native_posix.conf +++ b/tests/subsys/dfu/mcuboot/prj_native_posix.conf @@ -4,3 +4,4 @@ CONFIG_FLASH=y CONFIG_IMG_MANAGER=y CONFIG_MCUBOOT_IMG_MANAGER=y CONFIG_IMG_BLOCK_BUF_SIZE=512 +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/tests/subsys/dfu/mcuboot/prj_native_posix_64.conf b/tests/subsys/dfu/mcuboot/prj_native_posix_64.conf index 65ee9acbadd55..ef536b19f7808 100644 --- a/tests/subsys/dfu/mcuboot/prj_native_posix_64.conf +++ b/tests/subsys/dfu/mcuboot/prj_native_posix_64.conf @@ -4,3 +4,4 @@ CONFIG_FLASH=y CONFIG_IMG_MANAGER=y CONFIG_MCUBOOT_IMG_MANAGER=y CONFIG_IMG_BLOCK_BUF_SIZE=512 +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/tests/subsys/fs/fat_fs_api/prj.conf b/tests/subsys/fs/fat_fs_api/prj.conf index 613389c9070a6..e249f76db1fcd 100644 --- a/tests/subsys/fs/fat_fs_api/prj.conf +++ b/tests/subsys/fs/fat_fs_api/prj.conf @@ -5,3 +5,4 @@ CONFIG_DISK_ACCESS_FLASH=y CONFIG_SPI=y CONFIG_GPIO=y CONFIG_ZTEST=y +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/tests/subsys/fs/fat_fs_api/prj_native_posix.conf b/tests/subsys/fs/fat_fs_api/prj_native_posix.conf index ee92434cb34f4..b573f7544aec4 100644 --- a/tests/subsys/fs/fat_fs_api/prj_native_posix.conf +++ b/tests/subsys/fs/fat_fs_api/prj_native_posix.conf @@ -9,3 +9,4 @@ CONFIG_DISK_ERASE_BLOCK_SIZE=0x1000 CONFIG_DISK_FLASH_ERASE_ALIGNMENT=0x1000 CONFIG_DISK_VOLUME_SIZE=0x200000 CONFIG_ZTEST=y +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/tests/subsys/fs/fat_fs_api/prj_native_posix_64.conf b/tests/subsys/fs/fat_fs_api/prj_native_posix_64.conf index ee92434cb34f4..b573f7544aec4 100644 --- a/tests/subsys/fs/fat_fs_api/prj_native_posix_64.conf +++ b/tests/subsys/fs/fat_fs_api/prj_native_posix_64.conf @@ -9,3 +9,4 @@ CONFIG_DISK_ERASE_BLOCK_SIZE=0x1000 CONFIG_DISK_FLASH_ERASE_ALIGNMENT=0x1000 CONFIG_DISK_VOLUME_SIZE=0x200000 CONFIG_ZTEST=y +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/tests/subsys/fs/fat_fs_dual_drive/prj.conf b/tests/subsys/fs/fat_fs_dual_drive/prj.conf index ad6084ff70cfb..7d483546fe759 100644 --- a/tests/subsys/fs/fat_fs_dual_drive/prj.conf +++ b/tests/subsys/fs/fat_fs_dual_drive/prj.conf @@ -5,3 +5,5 @@ CONFIG_FS_FATFS_NUM_FILES=8 CONFIG_FS_FATFS_NUM_DIRS=8 CONFIG_DISK_ACCESS_RAM=y CONFIG_ZTEST=y + +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/tests/subsys/fs/fcb/prj.conf b/tests/subsys/fs/fcb/prj.conf index eb26477f804b0..2e689d05fd887 100644 --- a/tests/subsys/fs/fcb/prj.conf +++ b/tests/subsys/fs/fcb/prj.conf @@ -5,3 +5,4 @@ CONFIG_FLASH_PAGE_LAYOUT=y CONFIG_FLASH_MAP=y CONFIG_ARM_MPU=n CONFIG_FCB=y +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/tests/subsys/fs/fcb/prj_native_posix.conf b/tests/subsys/fs/fcb/prj_native_posix.conf index 259f73e771974..3504138d4aef8 100644 --- a/tests/subsys/fs/fcb/prj_native_posix.conf +++ b/tests/subsys/fs/fcb/prj_native_posix.conf @@ -4,3 +4,4 @@ CONFIG_FLASH=y CONFIG_FLASH_PAGE_LAYOUT=y CONFIG_FLASH_MAP=y CONFIG_FCB=y +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/tests/subsys/fs/fcb/prj_native_posix_64.conf b/tests/subsys/fs/fcb/prj_native_posix_64.conf index 259f73e771974..3504138d4aef8 100644 --- a/tests/subsys/fs/fcb/prj_native_posix_64.conf +++ b/tests/subsys/fs/fcb/prj_native_posix_64.conf @@ -4,3 +4,4 @@ CONFIG_FLASH=y CONFIG_FLASH_PAGE_LAYOUT=y CONFIG_FLASH_MAP=y CONFIG_FCB=y +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/tests/subsys/fs/littlefs/prj.conf b/tests/subsys/fs/littlefs/prj.conf index e8465c96b2f46..3458e1fb9ba66 100644 --- a/tests/subsys/fs/littlefs/prj.conf +++ b/tests/subsys/fs/littlefs/prj.conf @@ -20,4 +20,3 @@ CONFIG_FLASH_PAGE_LAYOUT=y CONFIG_ZTEST=y CONFIG_ZTEST_STACKSIZE=4096 -CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/subsys/fs/multi-fs/prj.conf b/tests/subsys/fs/multi-fs/prj.conf index 0c2d3ab8e4548..76dd779785a90 100644 --- a/tests/subsys/fs/multi-fs/prj.conf +++ b/tests/subsys/fs/multi-fs/prj.conf @@ -18,3 +18,5 @@ CONFIG_MAIN_STACK_SIZE=1024 CONFIG_NFFS_FILESYSTEM_MAX_AREAS=12 CONFIG_ZTEST_STACKSIZE=2048 CONFIG_ZTEST=y + +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/tests/subsys/fs/multi-fs/prj_fs_shell.conf b/tests/subsys/fs/multi-fs/prj_fs_shell.conf index 84b128fe10aa1..dc86e73b559d5 100644 --- a/tests/subsys/fs/multi-fs/prj_fs_shell.conf +++ b/tests/subsys/fs/multi-fs/prj_fs_shell.conf @@ -23,3 +23,5 @@ CONFIG_MAIN_STACK_SIZE=1024 CONFIG_NFFS_FILESYSTEM_MAX_AREAS=12 CONFIG_ZTEST_STACKSIZE=2048 CONFIG_ZTEST=y + +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/tests/subsys/fs/nffs_fs_api/basic/nrf5x.conf b/tests/subsys/fs/nffs_fs_api/basic/nrf5x.conf index 311d49c0088ec..1fa79d34c3fce 100644 --- a/tests/subsys/fs/nffs_fs_api/basic/nrf5x.conf +++ b/tests/subsys/fs/nffs_fs_api/basic/nrf5x.conf @@ -19,3 +19,5 @@ CONFIG_FS_NFFS_NUM_CACHE_INODES=1 CONFIG_FS_NFFS_NUM_CACHE_BLOCKS=1 CONFIG_FILE_SYSTEM_NFFS=y CONFIG_NFFS_FILESYSTEM_MAX_AREAS=12 + +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/tests/subsys/fs/nffs_fs_api/basic/prj.conf b/tests/subsys/fs/nffs_fs_api/basic/prj.conf index abe1bf725fc74..8b70f40ba1124 100644 --- a/tests/subsys/fs/nffs_fs_api/basic/prj.conf +++ b/tests/subsys/fs/nffs_fs_api/basic/prj.conf @@ -17,3 +17,5 @@ CONFIG_NFFS_FILESYSTEM_MAX_AREAS=12 CONFIG_ZTEST_STACKSIZE=2048 CONFIG_ZTEST=y CONFIG_LOG=y + +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/tests/subsys/fs/nffs_fs_api/cache/nrf5x.conf b/tests/subsys/fs/nffs_fs_api/cache/nrf5x.conf index 311d49c0088ec..1fa79d34c3fce 100644 --- a/tests/subsys/fs/nffs_fs_api/cache/nrf5x.conf +++ b/tests/subsys/fs/nffs_fs_api/cache/nrf5x.conf @@ -19,3 +19,5 @@ CONFIG_FS_NFFS_NUM_CACHE_INODES=1 CONFIG_FS_NFFS_NUM_CACHE_BLOCKS=1 CONFIG_FILE_SYSTEM_NFFS=y CONFIG_NFFS_FILESYSTEM_MAX_AREAS=12 + +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/tests/subsys/fs/nffs_fs_api/cache/prj.conf b/tests/subsys/fs/nffs_fs_api/cache/prj.conf index b6a2d681ec9f1..e69ca87f8775e 100644 --- a/tests/subsys/fs/nffs_fs_api/cache/prj.conf +++ b/tests/subsys/fs/nffs_fs_api/cache/prj.conf @@ -16,3 +16,5 @@ CONFIG_MAIN_STACK_SIZE=1024 CONFIG_NFFS_FILESYSTEM_MAX_AREAS=12 CONFIG_ZTEST_STACKSIZE=2048 CONFIG_ZTEST=y + +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/tests/subsys/fs/nffs_fs_api/large/nrf5x.conf b/tests/subsys/fs/nffs_fs_api/large/nrf5x.conf index 0900b617f23b0..0fc1d5b1b67bb 100644 --- a/tests/subsys/fs/nffs_fs_api/large/nrf5x.conf +++ b/tests/subsys/fs/nffs_fs_api/large/nrf5x.conf @@ -20,3 +20,5 @@ CONFIG_FS_NFFS_NUM_CACHE_INODES=1 CONFIG_FS_NFFS_NUM_CACHE_BLOCKS=1 CONFIG_FILE_SYSTEM_NFFS=y CONFIG_NFFS_FILESYSTEM_MAX_AREAS=12 + +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/tests/subsys/fs/nffs_fs_api/large/prj.conf b/tests/subsys/fs/nffs_fs_api/large/prj.conf index b6a2d681ec9f1..e69ca87f8775e 100644 --- a/tests/subsys/fs/nffs_fs_api/large/prj.conf +++ b/tests/subsys/fs/nffs_fs_api/large/prj.conf @@ -16,3 +16,5 @@ CONFIG_MAIN_STACK_SIZE=1024 CONFIG_NFFS_FILESYSTEM_MAX_AREAS=12 CONFIG_ZTEST_STACKSIZE=2048 CONFIG_ZTEST=y + +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/tests/subsys/fs/nffs_fs_api/performance/nrf5x.conf b/tests/subsys/fs/nffs_fs_api/performance/nrf5x.conf index 311d49c0088ec..1fa79d34c3fce 100644 --- a/tests/subsys/fs/nffs_fs_api/performance/nrf5x.conf +++ b/tests/subsys/fs/nffs_fs_api/performance/nrf5x.conf @@ -19,3 +19,5 @@ CONFIG_FS_NFFS_NUM_CACHE_INODES=1 CONFIG_FS_NFFS_NUM_CACHE_BLOCKS=1 CONFIG_FILE_SYSTEM_NFFS=y CONFIG_NFFS_FILESYSTEM_MAX_AREAS=12 + +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/tests/subsys/fs/nffs_fs_api/performance/prj.conf b/tests/subsys/fs/nffs_fs_api/performance/prj.conf index b6a2d681ec9f1..e69ca87f8775e 100644 --- a/tests/subsys/fs/nffs_fs_api/performance/prj.conf +++ b/tests/subsys/fs/nffs_fs_api/performance/prj.conf @@ -16,3 +16,5 @@ CONFIG_MAIN_STACK_SIZE=1024 CONFIG_NFFS_FILESYSTEM_MAX_AREAS=12 CONFIG_ZTEST_STACKSIZE=2048 CONFIG_ZTEST=y + +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/tests/subsys/fs/nvs/prj.conf b/tests/subsys/fs/nvs/prj.conf index c321acbff188c..0d8cdc02daf40 100644 --- a/tests/subsys/fs/nvs/prj.conf +++ b/tests/subsys/fs/nvs/prj.conf @@ -9,3 +9,5 @@ CONFIG_FLASH_PAGE_LAYOUT=y CONFIG_NVS=y CONFIG_LOG=y CONFIG_NVS_LOG_LEVEL_DBG=y + +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/tests/subsys/jwt/prj.conf b/tests/subsys/jwt/prj.conf index b1e2ab4e0d5c7..93412f96d2ff0 100644 --- a/tests/subsys/jwt/prj.conf +++ b/tests/subsys/jwt/prj.conf @@ -20,4 +20,3 @@ CONFIG_NET_SOCKETS=y CONFIG_NEWLIB_LIBC=y -CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/subsys/logging/log_core/prj.conf b/tests/subsys/logging/log_core/prj.conf index ee4faf3c60219..8d063bfb4caac 100644 --- a/tests/subsys/logging/log_core/prj.conf +++ b/tests/subsys/logging/log_core/prj.conf @@ -14,3 +14,5 @@ CONFIG_ARCH_LOG_LEVEL_OFF=y CONFIG_LOG_FUNC_NAME_PREFIX_DBG=n CONFIG_LOG_PROCESS_THREAD=n CONFIG_ASSERT=n + +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/tests/subsys/logging/log_list/prj.conf b/tests/subsys/logging/log_list/prj.conf index 2bba192e20381..fdd906ce7e9e7 100644 --- a/tests/subsys/logging/log_list/prj.conf +++ b/tests/subsys/logging/log_list/prj.conf @@ -3,3 +3,4 @@ CONFIG_ZTEST=y CONFIG_TEST_LOGGING_DEFAULTS=n CONFIG_LOG=y CONFIG_LOG_PRINTK=n +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/tests/subsys/logging/log_msg/prj.conf b/tests/subsys/logging/log_msg/prj.conf index 9bed861f0e94e..e9f39d4421bfb 100644 --- a/tests/subsys/logging/log_msg/prj.conf +++ b/tests/subsys/logging/log_msg/prj.conf @@ -4,3 +4,4 @@ CONFIG_TEST_LOGGING_DEFAULTS=n CONFIG_LOG=y CONFIG_LOG_PRINTK=n CONFIG_LOG_IMMEDIATE=n +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/tests/subsys/logging/log_output/prj.conf b/tests/subsys/logging/log_output/prj.conf index 2bba192e20381..fdd906ce7e9e7 100644 --- a/tests/subsys/logging/log_output/prj.conf +++ b/tests/subsys/logging/log_output/prj.conf @@ -3,3 +3,4 @@ CONFIG_ZTEST=y CONFIG_TEST_LOGGING_DEFAULTS=n CONFIG_LOG=y CONFIG_LOG_PRINTK=n +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/tests/subsys/settings/fcb/base64/prj.conf b/tests/subsys/settings/fcb/base64/prj.conf index c328a2a3ed238..ae573b291d1a8 100644 --- a/tests/subsys/settings/fcb/base64/prj.conf +++ b/tests/subsys/settings/fcb/base64/prj.conf @@ -10,3 +10,4 @@ CONFIG_SETTINGS=y CONFIG_SETTINGS_RUNTIME=y CONFIG_SETTINGS_FCB=y CONFIG_SETTINGS_USE_BASE64=y +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/tests/subsys/settings/fcb/base64/prj_native_posix.conf b/tests/subsys/settings/fcb/base64/prj_native_posix.conf index 4c167fd63b839..96af8371877ec 100644 --- a/tests/subsys/settings/fcb/base64/prj_native_posix.conf +++ b/tests/subsys/settings/fcb/base64/prj_native_posix.conf @@ -9,3 +9,4 @@ CONFIG_SETTINGS=y CONFIG_SETTINGS_RUNTIME=y CONFIG_SETTINGS_FCB=y CONFIG_SETTINGS_USE_BASE64=y +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/tests/subsys/settings/fcb/base64/prj_native_posix_64.conf b/tests/subsys/settings/fcb/base64/prj_native_posix_64.conf index 4c167fd63b839..96af8371877ec 100644 --- a/tests/subsys/settings/fcb/base64/prj_native_posix_64.conf +++ b/tests/subsys/settings/fcb/base64/prj_native_posix_64.conf @@ -9,3 +9,4 @@ CONFIG_SETTINGS=y CONFIG_SETTINGS_RUNTIME=y CONFIG_SETTINGS_FCB=y CONFIG_SETTINGS_USE_BASE64=y +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/tests/subsys/settings/fcb/raw/prj.conf b/tests/subsys/settings/fcb/raw/prj.conf index 767305cd62145..453e16f7f2a5f 100644 --- a/tests/subsys/settings/fcb/raw/prj.conf +++ b/tests/subsys/settings/fcb/raw/prj.conf @@ -10,3 +10,4 @@ CONFIG_SETTINGS=y CONFIG_SETTINGS_RUNTIME=y CONFIG_SETTINGS_FCB=y CONFIG_SETTINGS_USE_BASE64=n +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/tests/subsys/settings/fcb/raw/prj_native_posix.conf b/tests/subsys/settings/fcb/raw/prj_native_posix.conf index 07595f0fd6e87..986af3ea26c41 100644 --- a/tests/subsys/settings/fcb/raw/prj_native_posix.conf +++ b/tests/subsys/settings/fcb/raw/prj_native_posix.conf @@ -9,3 +9,4 @@ CONFIG_SETTINGS=y CONFIG_SETTINGS_RUNTIME=y CONFIG_SETTINGS_FCB=y CONFIG_SETTINGS_USE_BASE64=n +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/tests/subsys/settings/fcb/raw/prj_native_posix_64.conf b/tests/subsys/settings/fcb/raw/prj_native_posix_64.conf index 07595f0fd6e87..986af3ea26c41 100644 --- a/tests/subsys/settings/fcb/raw/prj_native_posix_64.conf +++ b/tests/subsys/settings/fcb/raw/prj_native_posix_64.conf @@ -9,3 +9,4 @@ CONFIG_SETTINGS=y CONFIG_SETTINGS_RUNTIME=y CONFIG_SETTINGS_FCB=y CONFIG_SETTINGS_USE_BASE64=n +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/tests/subsys/settings/fcb_init/prj.conf b/tests/subsys/settings/fcb_init/prj.conf index 8209c44a576bb..30e5c57f824ce 100644 --- a/tests/subsys/settings/fcb_init/prj.conf +++ b/tests/subsys/settings/fcb_init/prj.conf @@ -11,3 +11,5 @@ CONFIG_SETTINGS_RUNTIME=y CONFIG_SETTINGS_FCB=y CONFIG_REBOOT=y + +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/tests/subsys/settings/functional/fcb/prj.conf b/tests/subsys/settings/functional/fcb/prj.conf index 767305cd62145..453e16f7f2a5f 100644 --- a/tests/subsys/settings/functional/fcb/prj.conf +++ b/tests/subsys/settings/functional/fcb/prj.conf @@ -10,3 +10,4 @@ CONFIG_SETTINGS=y CONFIG_SETTINGS_RUNTIME=y CONFIG_SETTINGS_FCB=y CONFIG_SETTINGS_USE_BASE64=n +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/tests/subsys/settings/functional/fcb/prj_native_posix.conf b/tests/subsys/settings/functional/fcb/prj_native_posix.conf index 07595f0fd6e87..986af3ea26c41 100644 --- a/tests/subsys/settings/functional/fcb/prj_native_posix.conf +++ b/tests/subsys/settings/functional/fcb/prj_native_posix.conf @@ -9,3 +9,4 @@ CONFIG_SETTINGS=y CONFIG_SETTINGS_RUNTIME=y CONFIG_SETTINGS_FCB=y CONFIG_SETTINGS_USE_BASE64=n +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/tests/subsys/settings/functional/fcb/prj_native_posix_64.conf b/tests/subsys/settings/functional/fcb/prj_native_posix_64.conf index 07595f0fd6e87..986af3ea26c41 100644 --- a/tests/subsys/settings/functional/fcb/prj_native_posix_64.conf +++ b/tests/subsys/settings/functional/fcb/prj_native_posix_64.conf @@ -9,3 +9,4 @@ CONFIG_SETTINGS=y CONFIG_SETTINGS_RUNTIME=y CONFIG_SETTINGS_FCB=y CONFIG_SETTINGS_USE_BASE64=n +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/tests/subsys/settings/functional/fcb/prj_qemu_x86.conf b/tests/subsys/settings/functional/fcb/prj_qemu_x86.conf index 07595f0fd6e87..986af3ea26c41 100644 --- a/tests/subsys/settings/functional/fcb/prj_qemu_x86.conf +++ b/tests/subsys/settings/functional/fcb/prj_qemu_x86.conf @@ -9,3 +9,4 @@ CONFIG_SETTINGS=y CONFIG_SETTINGS_RUNTIME=y CONFIG_SETTINGS_FCB=y CONFIG_SETTINGS_USE_BASE64=n +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/tests/subsys/settings/functional/nvs/prj.conf b/tests/subsys/settings/functional/nvs/prj.conf index e829f3c9932ad..fabec3a640ae0 100644 --- a/tests/subsys/settings/functional/nvs/prj.conf +++ b/tests/subsys/settings/functional/nvs/prj.conf @@ -9,3 +9,5 @@ CONFIG_SETTINGS=y CONFIG_SETTINGS_RUNTIME=y CONFIG_SETTINGS_NVS=y CONFIG_SETTINGS_USE_BASE64=n + +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/tests/subsys/settings/functional/nvs/prj_qemu_x86.conf b/tests/subsys/settings/functional/nvs/prj_qemu_x86.conf index e829f3c9932ad..fabec3a640ae0 100644 --- a/tests/subsys/settings/functional/nvs/prj_qemu_x86.conf +++ b/tests/subsys/settings/functional/nvs/prj_qemu_x86.conf @@ -9,3 +9,5 @@ CONFIG_SETTINGS=y CONFIG_SETTINGS_RUNTIME=y CONFIG_SETTINGS_NVS=y CONFIG_SETTINGS_USE_BASE64=n + +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/tests/subsys/settings/nffs/base64/prj.conf b/tests/subsys/settings/nffs/base64/prj.conf index c5a2d9c7f1e34..865558b3be2a9 100644 --- a/tests/subsys/settings/nffs/base64/prj.conf +++ b/tests/subsys/settings/nffs/base64/prj.conf @@ -26,3 +26,4 @@ CONFIG_SETTINGS=y CONFIG_SETTINGS_RUNTIME=y CONFIG_SETTINGS_FS=y CONFIG_SETTINGS_USE_BASE64=y +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/tests/subsys/settings/nffs/base64/prj_native_posix.conf b/tests/subsys/settings/nffs/base64/prj_native_posix.conf index eacbedf28f559..000ed53bfe3b8 100644 --- a/tests/subsys/settings/nffs/base64/prj_native_posix.conf +++ b/tests/subsys/settings/nffs/base64/prj_native_posix.conf @@ -25,3 +25,4 @@ CONFIG_SETTINGS=y CONFIG_SETTINGS_RUNTIME=y CONFIG_SETTINGS_FS=y CONFIG_SETTINGS_USE_BASE64=y +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/tests/subsys/settings/nffs/base64/prj_native_posix_64.conf b/tests/subsys/settings/nffs/base64/prj_native_posix_64.conf index eacbedf28f559..000ed53bfe3b8 100644 --- a/tests/subsys/settings/nffs/base64/prj_native_posix_64.conf +++ b/tests/subsys/settings/nffs/base64/prj_native_posix_64.conf @@ -25,3 +25,4 @@ CONFIG_SETTINGS=y CONFIG_SETTINGS_RUNTIME=y CONFIG_SETTINGS_FS=y CONFIG_SETTINGS_USE_BASE64=y +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/tests/subsys/settings/nffs/raw/prj.conf b/tests/subsys/settings/nffs/raw/prj.conf index 627da06fa6cbf..4ab5be36c02f7 100644 --- a/tests/subsys/settings/nffs/raw/prj.conf +++ b/tests/subsys/settings/nffs/raw/prj.conf @@ -25,3 +25,4 @@ CONFIG_SETTINGS=y CONFIG_SETTINGS_RUNTIME=y CONFIG_SETTINGS_FS=y CONFIG_SETTINGS_USE_BASE64=n +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/tests/subsys/settings/nffs/raw/prj_native_posix.conf b/tests/subsys/settings/nffs/raw/prj_native_posix.conf index dd7bd38593bfe..f2a418c226dbc 100644 --- a/tests/subsys/settings/nffs/raw/prj_native_posix.conf +++ b/tests/subsys/settings/nffs/raw/prj_native_posix.conf @@ -24,3 +24,4 @@ CONFIG_SETTINGS=y CONFIG_SETTINGS_RUNTIME=y CONFIG_SETTINGS_FS=y CONFIG_SETTINGS_USE_BASE64=n +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/tests/subsys/settings/nffs/raw/prj_native_posix_64.conf b/tests/subsys/settings/nffs/raw/prj_native_posix_64.conf index dd7bd38593bfe..f2a418c226dbc 100644 --- a/tests/subsys/settings/nffs/raw/prj_native_posix_64.conf +++ b/tests/subsys/settings/nffs/raw/prj_native_posix_64.conf @@ -24,3 +24,4 @@ CONFIG_SETTINGS=y CONFIG_SETTINGS_RUNTIME=y CONFIG_SETTINGS_FS=y CONFIG_SETTINGS_USE_BASE64=n +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/tests/subsys/shell/shell_history/prj.conf b/tests/subsys/shell/shell_history/prj.conf index dc98df2885091..dd6a985d9bcbb 100644 --- a/tests/subsys/shell/shell_history/prj.conf +++ b/tests/subsys/shell/shell_history/prj.conf @@ -7,4 +7,3 @@ CONFIG_SHELL_METAKEYS=n CONFIG_SHELL_HISTORY=y CONFIG_LOG=n CONFIG_ZTEST=y -CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/subsys/storage/flash_map/overlay-mpu.conf b/tests/subsys/storage/flash_map/overlay-mpu.conf index 6bafaa53f2976..5edd8f89b0a26 100644 --- a/tests/subsys/storage/flash_map/overlay-mpu.conf +++ b/tests/subsys/storage/flash_map/overlay-mpu.conf @@ -1 +1,2 @@ CONFIG_MPU_ALLOW_FLASH_WRITE=y +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/tests/subsys/storage/flash_map/prj.conf b/tests/subsys/storage/flash_map/prj.conf index 734d2d02c4cd2..58e7cdb61aad1 100644 --- a/tests/subsys/storage/flash_map/prj.conf +++ b/tests/subsys/storage/flash_map/prj.conf @@ -2,3 +2,4 @@ CONFIG_ZTEST=y CONFIG_FLASH=y CONFIG_FLASH_PAGE_LAYOUT=y CONFIG_FLASH_MAP=y +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/tests/subsys/storage/flash_map/prj_native_posix.conf b/tests/subsys/storage/flash_map/prj_native_posix.conf index 734d2d02c4cd2..58e7cdb61aad1 100644 --- a/tests/subsys/storage/flash_map/prj_native_posix.conf +++ b/tests/subsys/storage/flash_map/prj_native_posix.conf @@ -2,3 +2,4 @@ CONFIG_ZTEST=y CONFIG_FLASH=y CONFIG_FLASH_PAGE_LAYOUT=y CONFIG_FLASH_MAP=y +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/tests/subsys/storage/flash_map/prj_native_posix_64.conf b/tests/subsys/storage/flash_map/prj_native_posix_64.conf index 734d2d02c4cd2..58e7cdb61aad1 100644 --- a/tests/subsys/storage/flash_map/prj_native_posix_64.conf +++ b/tests/subsys/storage/flash_map/prj_native_posix_64.conf @@ -2,3 +2,4 @@ CONFIG_ZTEST=y CONFIG_FLASH=y CONFIG_FLASH_PAGE_LAYOUT=y CONFIG_FLASH_MAP=y +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/tests/subsys/usb/bos/prj.conf b/tests/subsys/usb/bos/prj.conf index b4d52cd60e662..6eebace19fcf8 100644 --- a/tests/subsys/usb/bos/prj.conf +++ b/tests/subsys/usb/bos/prj.conf @@ -2,4 +2,3 @@ CONFIG_ZTEST=y CONFIG_USB=y CONFIG_USB_DEVICE_STACK=y CONFIG_USB_DEVICE_BOS=y -CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/subsys/usb/desc_sections/prj.conf b/tests/subsys/usb/desc_sections/prj.conf index fa04ac40a7fb1..6783a8d375298 100644 --- a/tests/subsys/usb/desc_sections/prj.conf +++ b/tests/subsys/usb/desc_sections/prj.conf @@ -6,4 +6,3 @@ CONFIG_USB_DEVICE_LOG_LEVEL_DBG=y CONFIG_LOG=y CONFIG_LOG_BUFFER_SIZE=4096 -CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/subsys/usb/device/prj.conf b/tests/subsys/usb/device/prj.conf index 9fb144e46a25f..43821143dcf89 100644 --- a/tests/subsys/usb/device/prj.conf +++ b/tests/subsys/usb/device/prj.conf @@ -6,4 +6,3 @@ CONFIG_USB_DRIVER_LOG_LEVEL_DBG=y CONFIG_USB=y CONFIG_USB_DEVICE_STACK=y -CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/subsys/usb/os_desc/prj.conf b/tests/subsys/usb/os_desc/prj.conf index 3687c981fd166..d1fea08a75f4a 100644 --- a/tests/subsys/usb/os_desc/prj.conf +++ b/tests/subsys/usb/os_desc/prj.conf @@ -2,4 +2,3 @@ CONFIG_ZTEST=y CONFIG_USB=y CONFIG_USB_DEVICE_STACK=y CONFIG_USB_DEVICE_OS_DESC=y -CONFIG_SYS_TIMEOUT_LEGACY_API=y diff --git a/tests/ztest/base/prj_verbose_0.conf b/tests/ztest/base/prj_verbose_0.conf index c47f69824da80..da94e07e9b353 100644 --- a/tests/ztest/base/prj_verbose_0.conf +++ b/tests/ztest/base/prj_verbose_0.conf @@ -1,2 +1,3 @@ CONFIG_ZTEST=y CONFIG_ZTEST_ASSERT_VERBOSE=0 +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/tests/ztest/base/prj_verbose_1.conf b/tests/ztest/base/prj_verbose_1.conf index 79028c27963be..0fd4781a8f0be 100644 --- a/tests/ztest/base/prj_verbose_1.conf +++ b/tests/ztest/base/prj_verbose_1.conf @@ -1,2 +1,3 @@ CONFIG_ZTEST=y CONFIG_ZTEST_ASSERT_VERBOSE=1 +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/tests/ztest/base/prj_verbose_2.conf b/tests/ztest/base/prj_verbose_2.conf index 0bda78a5b4fe9..00d977c3e592a 100644 --- a/tests/ztest/base/prj_verbose_2.conf +++ b/tests/ztest/base/prj_verbose_2.conf @@ -1,2 +1,3 @@ CONFIG_ZTEST=y CONFIG_ZTEST_ASSERT_VERBOSE=2 +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/tests/ztest/custom_output/prj.conf b/tests/ztest/custom_output/prj.conf index 9467c2926896d..7049cf0e1675f 100644 --- a/tests/ztest/custom_output/prj.conf +++ b/tests/ztest/custom_output/prj.conf @@ -1 +1,2 @@ CONFIG_ZTEST=y +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/tests/ztest/custom_output/prj_customized_output.conf b/tests/ztest/custom_output/prj_customized_output.conf index 290d9378c561c..2e6b6af85bc72 100644 --- a/tests/ztest/custom_output/prj_customized_output.conf +++ b/tests/ztest/custom_output/prj_customized_output.conf @@ -1,2 +1,3 @@ CONFIG_ZTEST=y CONFIG_ZTEST_TC_UTIL_USER_OVERRIDE=y +CONFIG_SYS_TIMEOUT_LEGACY_API=n diff --git a/tests/ztest/mock/prj.conf b/tests/ztest/mock/prj.conf index 5534fce2c04e1..86260e4177a7f 100644 --- a/tests/ztest/mock/prj.conf +++ b/tests/ztest/mock/prj.conf @@ -2,3 +2,4 @@ CONFIG_ZTEST=y CONFIG_ZTEST_ASSERT_VERBOSE=1 CONFIG_ZTEST_MOCKING=y CONFIG_ZTEST_PARAMETER_COUNT=5 +CONFIG_SYS_TIMEOUT_LEGACY_API=n From f267e8fc9213afc39593bdc83a6e067e157c7ec6 Mon Sep 17 00:00:00 2001 From: Andy Ross Date: Thu, 26 Sep 2019 09:20:42 -0700 Subject: [PATCH 19/19] kernel/timeout: Misc. API updates These crossed in a rebase, where new code (or in the header's case old code included in new context) needs to honor the new timeout API conventions. Signed-off-by: Andy Ross --- drivers/adc/adc_context.h | 2 +- drivers/sensor/lis2mdl/lis2mdl_trigger.c | 2 +- drivers/timer/apic_timer.c | 2 +- drivers/timer/cc13x2_cc26x2_rtc_timer.c | 2 +- drivers/timer/mchp_xec_rtos_timer.c | 4 ++-- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/adc/adc_context.h b/drivers/adc/adc_context.h index 4cb52ee97ff37..a6a57475f84ae 100644 --- a/drivers/adc/adc_context.h +++ b/drivers/adc/adc_context.h @@ -95,7 +95,7 @@ static inline void adc_context_enable_timer(struct adc_context *ctx) u32_t interval_us = ctx->options.interval_us; u32_t interval_ms = ceiling_fraction(interval_us, 1000UL); - k_timer_start(&ctx->timer, 0, interval_ms); + k_timer_start(&ctx->timer, K_NO_WAIT, K_TIMEOUT_MS(interval_ms)); } static inline void adc_context_disable_timer(struct adc_context *ctx) diff --git a/drivers/sensor/lis2mdl/lis2mdl_trigger.c b/drivers/sensor/lis2mdl/lis2mdl_trigger.c index 5eb96e407c510..9064015a2728e 100644 --- a/drivers/sensor/lis2mdl/lis2mdl_trigger.c +++ b/drivers/sensor/lis2mdl/lis2mdl_trigger.c @@ -129,7 +129,7 @@ int lis2mdl_init_interrupt(struct device *dev) CONFIG_LIS2MDL_THREAD_STACK_SIZE, (k_thread_entry_t)lis2mdl_thread, dev, 0, NULL, K_PRIO_COOP(CONFIG_LIS2MDL_THREAD_PRIORITY), - 0, 0); + 0, K_NO_WAIT); #elif defined(CONFIG_LIS2MDL_TRIGGER_GLOBAL_THREAD) lis2mdl->work.handler = lis2mdl_work_cb; lis2mdl->dev = dev; diff --git a/drivers/timer/apic_timer.c b/drivers/timer/apic_timer.c index 736785287e159..18b2a963b9ddf 100644 --- a/drivers/timer/apic_timer.c +++ b/drivers/timer/apic_timer.c @@ -89,7 +89,7 @@ void z_clock_set_timeout(s32_t n, bool idle) if (n < 1) { full_ticks = 0; - } else if ((n == K_FOREVER) || (n > MAX_TICKS)) { + } else if ((n == K_FOREVER_TICKS) || (n > MAX_TICKS)) { full_ticks = MAX_TICKS - 1; } else { full_ticks = n - 1; diff --git a/drivers/timer/cc13x2_cc26x2_rtc_timer.c b/drivers/timer/cc13x2_cc26x2_rtc_timer.c index 91924e037129d..a258438093535 100644 --- a/drivers/timer/cc13x2_cc26x2_rtc_timer.c +++ b/drivers/timer/cc13x2_cc26x2_rtc_timer.c @@ -204,7 +204,7 @@ void z_clock_set_timeout(s32_t ticks, bool idle) #ifdef CONFIG_TICKLESS_KERNEL - ticks = (ticks == K_FOREVER) ? MAX_TICKS : ticks; + ticks = (ticks == K_FOREVER_TICKS) ? MAX_TICKS : ticks; ticks = MAX(MIN(ticks - 1, (s32_t) MAX_TICKS), 0); k_spinlock_key_t key = k_spin_lock(&lock); diff --git a/drivers/timer/mchp_xec_rtos_timer.c b/drivers/timer/mchp_xec_rtos_timer.c index 10489d0683cb8..9e10ae0062955 100644 --- a/drivers/timer/mchp_xec_rtos_timer.c +++ b/drivers/timer/mchp_xec_rtos_timer.c @@ -130,7 +130,7 @@ void z_clock_set_timeout(s32_t n, bool idle) u32_t full_cycles; /* full_ticks represented as cycles */ u32_t partial_cycles; /* number of cycles to first tick boundary */ - if (idle && (n == K_FOREVER)) { + if (idle && (n == K_FOREVER_TICKS)) { /* * We are not in a locked section. Are writes to two * global objects safe from pre-emption? @@ -142,7 +142,7 @@ void z_clock_set_timeout(s32_t n, bool idle) if (n < 1) { full_ticks = 0; - } else if ((n == K_FOREVER) || (n > MAX_TICKS)) { + } else if ((n == K_FOREVER_TICKS) || (n > MAX_TICKS)) { full_ticks = MAX_TICKS - 1; } else { full_ticks = n - 1;