Skip to content

Commit cbd31d7

Browse files
gmarullcarlescufi
authored andcommitted
lib: migrate includes to <zephyr/...>
In order to bring consistency in-tree, migrate all lib code to the new prefix <zephyr/...>. Note that the conversion has been scripted, refer to zephyrproject-rtos#45388 for more details. Signed-off-by: Gerard Marull-Paretas <[email protected]>
1 parent 741e838 commit cbd31d7

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

79 files changed

+199
-199
lines changed

lib/libc/arcmwdt/libc-hooks.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@
66
*/
77

88
#include <stdio.h>
9-
#include <sys/libc-hooks.h>
10-
#include <syscall_handler.h>
9+
#include <zephyr/sys/libc-hooks.h>
10+
#include <zephyr/syscall_handler.h>
1111
#include <string.h>
12-
#include <sys/errno_private.h>
12+
#include <zephyr/sys/errno_private.h>
1313
#include <unistd.h>
1414
#include <errno.h>
1515

lib/libc/arcmwdt/threading.c

+5-5
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@
66

77
#ifdef CONFIG_MULTITHREADING
88

9-
#include <init.h>
10-
#include <kernel.h>
11-
#include <sys/__assert.h>
12-
#include <sys/mutex.h>
13-
#include <logging/log.h>
9+
#include <zephyr/init.h>
10+
#include <zephyr/kernel.h>
11+
#include <zephyr/sys/__assert.h>
12+
#include <zephyr/sys/mutex.h>
13+
#include <zephyr/logging/log.h>
1414
#include <../lib/src/c/inc/internal/thread.h>
1515

1616
#ifndef CONFIG_USERSPACE

lib/libc/armstdc/include/errno.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
* @{
4040
*/
4141

42-
#include <sys/errno_private.h>
42+
#include <zephyr/sys/errno_private.h>
4343

4444
#ifdef __cplusplus
4545
extern "C" {

lib/libc/armstdc/src/libc-hooks.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* SPDX-License-Identifier: Apache-2.0
55
*/
66

7-
#include <kernel.h>
7+
#include <zephyr/kernel.h>
88
#include <stdio.h>
99

1010
static int _stdout_hook_default(int c)

lib/libc/armstdc/src/threading_weak.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
* CONFIG_MULTITHREADING=n to ensure proper linking.
1818
*/
1919

20-
#include <kernel.h>
20+
#include <zephyr/kernel.h>
2121

2222
int __weak z_impl_k_mutex_init(struct k_mutex *mutex)
2323
{

lib/libc/minimal/include/assert.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
#ifndef ZEPHYR_LIB_LIBC_MINIMAL_INCLUDE_ASSERT_H_
99
#define ZEPHYR_LIB_LIBC_MINIMAL_INCLUDE_ASSERT_H_
1010

11-
#include <sys/__assert.h>
11+
#include <zephyr/sys/__assert.h>
1212

1313
#ifdef __cplusplus
1414
extern "C" {

lib/libc/minimal/include/errno.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
* @{
3030
*/
3131

32-
#include <sys/errno_private.h>
32+
#include <zephyr/sys/errno_private.h>
3333

3434
#ifdef __cplusplus
3535
extern "C" {

lib/libc/minimal/include/stdio.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
#ifndef ZEPHYR_LIB_LIBC_MINIMAL_INCLUDE_STDIO_H_
1010
#define ZEPHYR_LIB_LIBC_MINIMAL_INCLUDE_STDIO_H_
1111

12-
#include <toolchain.h>
12+
#include <zephyr/toolchain.h>
1313
#include <stdarg.h> /* Needed to get definition of va_list */
1414
#include <stddef.h>
1515

lib/libc/minimal/include/string.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
#define ZEPHYR_LIB_LIBC_MINIMAL_INCLUDE_STRING_H_
1111

1212
#include <stddef.h>
13-
#include <toolchain.h>
13+
#include <zephyr/toolchain.h>
1414

1515
#ifdef __cplusplus
1616
extern "C" {

lib/libc/minimal/include/time.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
#define ZEPHYR_LIB_LIBC_MINIMAL_INCLUDE_TIME_H_
1010

1111
#include <stdint.h>
12-
#include <toolchain.h>
12+
#include <zephyr/toolchain.h>
1313
#include <sys/_types.h>
1414
#include <sys/_timespec.h>
1515

lib/libc/minimal/source/stdlib/abort.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
*/
66

77
#include <stdlib.h>
8-
#include <zephyr.h>
8+
#include <zephyr/zephyr.h>
99

1010
void abort(void)
1111
{

lib/libc/minimal/source/stdlib/exit.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
*/
66

77
#include <stdlib.h>
8-
#include <zephyr.h>
8+
#include <zephyr/zephyr.h>
99

1010
void _exit(int status)
1111
{

lib/libc/minimal/source/stdlib/malloc.c

+7-7
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,18 @@
55
*/
66

77
#include <stdlib.h>
8-
#include <zephyr.h>
9-
#include <init.h>
8+
#include <zephyr/zephyr.h>
9+
#include <zephyr/init.h>
1010
#include <errno.h>
11-
#include <sys/math_extras.h>
11+
#include <zephyr/sys/math_extras.h>
1212
#include <string.h>
13-
#include <app_memory/app_memdomain.h>
14-
#include <sys/mutex.h>
15-
#include <sys/sys_heap.h>
13+
#include <zephyr/app_memory/app_memdomain.h>
14+
#include <zephyr/sys/mutex.h>
15+
#include <zephyr/sys/sys_heap.h>
1616
#include <zephyr/types.h>
1717

1818
#define LOG_LEVEL CONFIG_KERNEL_LOG_LEVEL
19-
#include <logging/log.h>
19+
#include <zephyr/logging/log.h>
2020
LOG_MODULE_DECLARE(os, CONFIG_KERNEL_LOG_LEVEL);
2121

2222
#ifdef CONFIG_MINIMAL_LIBC_MALLOC

lib/libc/minimal/source/stdlib/qsort.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
#include <stdint.h>
99
#include <stdlib.h>
1010
#include <sys/types.h>
11-
#include <sys/util.h>
11+
#include <zephyr/sys/util.h>
1212

1313
/*
1414
* Normally parent is defined parent(k) = floor((k-1) / 2) but we can avoid a

lib/libc/minimal/source/stdlib/rand.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
*/
66

77
#include <stdlib.h>
8-
#include <sys/libc-hooks.h>
9-
#include <app_memory/app_memdomain.h>
8+
#include <zephyr/sys/libc-hooks.h>
9+
#include <zephyr/app_memory/app_memdomain.h>
1010

1111
#define LIBC_DATA K_APP_DMEM(z_libc_partition)
1212

lib/libc/minimal/source/stdout/fprintf.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
#include <stdarg.h>
1010
#include <stdio.h>
11-
#include <sys/cbprintf.h>
11+
#include <zephyr/sys/cbprintf.h>
1212

1313
#define DESC(d) ((void *)d)
1414

lib/libc/minimal/source/stdout/sprintf.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
#include <stdarg.h>
1010
#include <stdio.h>
11-
#include <sys/cbprintf.h>
11+
#include <zephyr/sys/cbprintf.h>
1212

1313
struct emitter {
1414
char *ptr;

lib/libc/minimal/source/stdout/stdout_console.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
*/
88

99
#include <stdio.h>
10-
#include <sys/libc-hooks.h>
11-
#include <syscall_handler.h>
10+
#include <zephyr/sys/libc-hooks.h>
11+
#include <zephyr/syscall_handler.h>
1212
#include <string.h>
1313

1414
static int _stdout_hook_default(int c)

lib/libc/minimal/source/time/time.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
#include <time.h>
88

99
/* clock_gettime() prototype */
10-
#include <posix/time.h>
10+
#include <zephyr/posix/time.h>
1111

1212
time_t time(time_t *tloc)
1313
{

lib/libc/newlib/libc-hooks.c

+13-13
Original file line numberDiff line numberDiff line change
@@ -4,23 +4,23 @@
44
* SPDX-License-Identifier: Apache-2.0
55
*/
66

7-
#include <arch/cpu.h>
7+
#include <zephyr/arch/cpu.h>
88
#include <errno.h>
99
#include <stdio.h>
1010
#include <malloc.h>
11-
#include <sys/__assert.h>
11+
#include <zephyr/sys/__assert.h>
1212
#include <sys/stat.h>
13-
#include <linker/linker-defs.h>
14-
#include <sys/util.h>
15-
#include <sys/errno_private.h>
16-
#include <sys/heap_listener.h>
17-
#include <sys/libc-hooks.h>
18-
#include <syscall_handler.h>
19-
#include <app_memory/app_memdomain.h>
20-
#include <init.h>
21-
#include <sys/sem.h>
22-
#include <sys/mutex.h>
23-
#include <sys/mem_manage.h>
13+
#include <zephyr/linker/linker-defs.h>
14+
#include <zephyr/sys/util.h>
15+
#include <zephyr/sys/errno_private.h>
16+
#include <zephyr/sys/heap_listener.h>
17+
#include <zephyr/sys/libc-hooks.h>
18+
#include <zephyr/syscall_handler.h>
19+
#include <zephyr/app_memory/app_memdomain.h>
20+
#include <zephyr/init.h>
21+
#include <zephyr/sys/sem.h>
22+
#include <zephyr/sys/mutex.h>
23+
#include <zephyr/sys/mem_manage.h>
2424
#include <sys/time.h>
2525

2626
#define LIBC_BSS K_APP_BMEM(z_libc_partition)

lib/open-amp/resource_table.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
* https://github.com/OpenAMP/open-amp/wiki/OpenAMP-Life-Cycle-Management
2727
*/
2828

29-
#include <zephyr.h>
29+
#include <zephyr/zephyr.h>
3030
#include <resource_table.h>
3131

3232
extern char ram_console[];

lib/os/assert.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
* SPDX-License-Identifier: Apache-2.0
55
*/
66

7-
#include <sys/__assert.h>
8-
#include <sys/printk.h>
9-
#include <zephyr.h>
7+
#include <zephyr/sys/__assert.h>
8+
#include <zephyr/sys/printk.h>
9+
#include <zephyr/zephyr.h>
1010

1111

1212
/**

lib/os/base64.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424

2525
#include <stdint.h>
2626
#include <errno.h>
27-
#include <sys/base64.h>
27+
#include <zephyr/sys/base64.h>
2828

2929
static const uint8_t base64_enc_map[64] = {
3030
'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J',

lib/os/bitarray.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@
88
#include <stddef.h>
99
#include <stdbool.h>
1010
#include <stdio.h>
11-
#include <sys/bitarray.h>
12-
#include <sys/check.h>
13-
#include <sys/sys_io.h>
11+
#include <zephyr/sys/bitarray.h>
12+
#include <zephyr/sys/check.h>
13+
#include <zephyr/sys/sys_io.h>
1414

1515
/* Number of bits represented by one bundle */
1616
#define bundle_bitness(ba) (sizeof(ba->bundles[0]) * 8)

lib/os/cbprintf.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
#include <stdarg.h>
88
#include <stddef.h>
9-
#include <sys/cbprintf.h>
9+
#include <zephyr/sys/cbprintf.h>
1010

1111
int cbprintf(cbprintf_cb out, void *ctx, const char *format, ...)
1212
{

lib/os/cbprintf_complete.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@
1414
#include <stddef.h>
1515
#include <stdint.h>
1616
#include <string.h>
17-
#include <toolchain.h>
17+
#include <zephyr/toolchain.h>
1818
#include <sys/types.h>
19-
#include <sys/util.h>
20-
#include <sys/cbprintf.h>
19+
#include <zephyr/sys/util.h>
20+
#include <zephyr/sys/cbprintf.h>
2121

2222
/* newlib doesn't declare this function unless __POSIX_VISIBLE >= 200809. No
2323
* idea how to make that happen, so lets put it right here.

lib/os/cbprintf_nano.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@
99
#include <stdarg.h>
1010
#include <stdint.h>
1111
#include <string.h>
12-
#include <sys/cbprintf.h>
12+
#include <zephyr/sys/cbprintf.h>
1313
#include <sys/types.h>
14-
#include <sys/util.h>
14+
#include <zephyr/sys/util.h>
1515

1616
#ifdef CONFIG_CBPRINTF_FULL_INTEGRAL
1717
typedef intmax_t int_value_type;

lib/os/cbprintf_packaged.c

+4-4
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@
88
#include <stdarg.h>
99
#include <stdint.h>
1010
#include <string.h>
11-
#include <linker/utils.h>
12-
#include <sys/cbprintf.h>
11+
#include <zephyr/linker/utils.h>
12+
#include <zephyr/sys/cbprintf.h>
1313
#include <sys/types.h>
14-
#include <sys/util.h>
15-
#include <sys/__assert.h>
14+
#include <zephyr/sys/util.h>
15+
#include <zephyr/sys/__assert.h>
1616

1717

1818
/**

lib/os/crc16_sw.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* SPDX-License-Identifier: Apache-2.0
55
*/
66

7-
#include <sys/crc.h>
7+
#include <zephyr/sys/crc.h>
88

99
uint16_t crc16(uint16_t poly, uint16_t seed, const uint8_t *src, size_t len)
1010
{

lib/os/crc32_sw.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* SPDX-License-Identifier: Apache-2.0
55
*/
66

7-
#include <sys/crc.h>
7+
#include <zephyr/sys/crc.h>
88

99
uint32_t crc32_ieee(const uint8_t *data, size_t len)
1010
{

lib/os/crc32c_sw.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* SPDX-License-Identifier: Apache-2.0
55
*/
66

7-
#include <sys/crc.h>
7+
#include <zephyr/sys/crc.h>
88

99
/* crc table generated from polynomial 0x1EDC6F41UL (Castagnoli) */
1010
static const uint32_t crc32c_table[16] = {

lib/os/crc7_sw.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* SPDX-License-Identifier: Apache-2.0
55
*/
66

7-
#include <sys/crc.h>
7+
#include <zephyr/sys/crc.h>
88

99
uint8_t crc7_be(uint8_t seed, const uint8_t *src, size_t len)
1010
{

lib/os/crc8_sw.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* SPDX-License-Identifier: Apache-2.0
77
*/
88

9-
#include <sys/crc.h>
9+
#include <zephyr/sys/crc.h>
1010

1111
static const uint8_t crc8_ccitt_small_table[16] = {
1212
0x00, 0x07, 0x0e, 0x09, 0x1c, 0x1b, 0x12, 0x15,

lib/os/dec.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* SPDX-License-Identifier: Apache-2.0
55
*/
66

7-
#include <sys/util.h>
7+
#include <zephyr/sys/util.h>
88

99
uint8_t u8_to_dec(char *buf, uint8_t buflen, uint8_t value)
1010
{

0 commit comments

Comments
 (0)