From b71832fae73d5c36b4074bbd9aa9bcf7ed7ad05a Mon Sep 17 00:00:00 2001 From: ouyangxiangzhen Date: Wed, 16 Oct 2024 10:49:33 +0800 Subject: [PATCH] userspace: Exclude nuttx/arch.h This patch fixed userspace headers conflict. Architecture-related definition and API should not be exposed to users. Signed-off-by: ouyangxiangzhen --- arch/risc-v/src/common/riscv_mtimer.c | 1 + arch/x86_64/src/intel64/intel64_oneshot.h | 1 + binfmt/binfmt_unloadmodule.c | 1 + crypto/cryptosoft.c | 1 + drivers/input/goldfish_events.c | 1 + drivers/input/mouse_upper.c | 1 + drivers/misc/goldfish_pipe.c | 1 + drivers/misc/mkrd.c | 1 + drivers/misc/optee.c | 2 ++ drivers/mtd/rammtd.c | 1 + drivers/net/e1000.c | 1 + drivers/net/igc.c | 1 + drivers/pci/pci_ivshmem.c | 1 + drivers/pipes/pipe_common.c | 1 + drivers/power/battery/goldfish_battery.c | 4 +++- drivers/rc/lirc_dev.c | 1 + drivers/serial/uart_16550.c | 1 + drivers/serial/uart_bth4.c | 1 + drivers/timers/pl031.c | 5 ++++- drivers/usbdev/usbdev_fs.c | 1 + drivers/video/fb.c | 1 + drivers/video/mipidsi/mipi_dsi_host.c | 2 ++ drivers/video/v4l2_m2m.c | 1 + drivers/virtio/virtio-mmio.c | 1 + drivers/virtio/virtio-pci.h | 1 + drivers/wireless/bluetooth/bt_bridge.c | 1 + fs/fs_heap.c | 2 ++ fs/mmap/fs_munmap.c | 1 + fs/procfs/fs_procfscritmon.c | 1 + fs/procfs/fs_procfsproc.c | 1 + fs/procfs/fs_procfstcbinfo.c | 1 + fs/shm/shmfs.c | 3 --- fs/tmpfs/fs_tmpfs.c | 1 + fs/vfs/fs_fstat.c | 1 + fs/vfs/fs_open.c | 1 + fs/vfs/fs_pseudofile.c | 1 + fs/vfs/fs_sendfile.c | 1 + fs/vfs/fs_timerfd.c | 1 + include/nuttx/kmalloc.h | 5 ++++- include/nuttx/net/snoop.h | 1 + include/nuttx/notifier.h | 1 + include/nuttx/pci/pci_ivshmem.h | 1 + include/nuttx/userspace.h | 2 -- include/syslog.h | 1 + libs/libc/misc/lib_cxx_initialize.c | 1 + libs/libc/modlib/modlib_bind.c | 1 + libs/libc/modlib/modlib_load.c | 1 + libs/libc/modlib/modlib_unload.c | 1 + libs/libc/stdio/lib_freopen.c | 1 + libs/libc/time/lib_localtime.c | 2 +- mm/umm_heap/umm_calloc.c | 1 + mm/umm_heap/umm_heap.h | 1 + mm/umm_heap/umm_initialize.c | 1 + mm/umm_heap/umm_sbrk.c | 1 + net/local/local_conn.c | 1 + net/netlink/netlink_sockif.c | 1 + net/socket/socket.h | 1 + net/socket/socketpair.c | 1 + net/utils/net_snoop.c | 2 +- sched/misc/reboot_notifier.c | 1 + sched/signal/sig_findaction.c | 2 ++ sched/signal/signal.h | 1 + sched/wqueue/kwork_notifier.c | 1 + 63 files changed, 73 insertions(+), 10 deletions(-) diff --git a/arch/risc-v/src/common/riscv_mtimer.c b/arch/risc-v/src/common/riscv_mtimer.c index b611c3dd99914..fd134425c987e 100644 --- a/arch/risc-v/src/common/riscv_mtimer.c +++ b/arch/risc-v/src/common/riscv_mtimer.c @@ -22,6 +22,7 @@ * Included Files ****************************************************************************/ +#include #include #include diff --git a/arch/x86_64/src/intel64/intel64_oneshot.h b/arch/x86_64/src/intel64/intel64_oneshot.h index db4b0859aa418..37072457eaacd 100644 --- a/arch/x86_64/src/intel64/intel64_oneshot.h +++ b/arch/x86_64/src/intel64/intel64_oneshot.h @@ -28,6 +28,7 @@ #include #include +#include #include diff --git a/binfmt/binfmt_unloadmodule.c b/binfmt/binfmt_unloadmodule.c index c8e51adb9435e..50eaf4294b1f2 100644 --- a/binfmt/binfmt_unloadmodule.c +++ b/binfmt/binfmt_unloadmodule.c @@ -32,6 +32,7 @@ #include #include +#include #include #include #include diff --git a/crypto/cryptosoft.c b/crypto/cryptosoft.c index f9aa1e53472bf..61fa4b34aaeb0 100644 --- a/crypto/cryptosoft.c +++ b/crypto/cryptosoft.c @@ -28,6 +28,7 @@ #include #include #include +#include #include #include #include diff --git a/drivers/input/goldfish_events.c b/drivers/input/goldfish_events.c index f7885a5bf1da0..f52503d5c82be 100644 --- a/drivers/input/goldfish_events.c +++ b/drivers/input/goldfish_events.c @@ -24,6 +24,7 @@ #include +#include #include #include #include diff --git a/drivers/input/mouse_upper.c b/drivers/input/mouse_upper.c index 22caee8702b75..dc1b61baef858 100644 --- a/drivers/input/mouse_upper.c +++ b/drivers/input/mouse_upper.c @@ -29,6 +29,7 @@ #include #include +#include #include #include #include diff --git a/drivers/misc/goldfish_pipe.c b/drivers/misc/goldfish_pipe.c index 7482b011a131c..5070c4bb388a0 100644 --- a/drivers/misc/goldfish_pipe.c +++ b/drivers/misc/goldfish_pipe.c @@ -43,6 +43,7 @@ #include #include +#include #include #include #include diff --git a/drivers/misc/mkrd.c b/drivers/misc/mkrd.c index d80cfd5970723..bf2f69ba30710 100644 --- a/drivers/misc/mkrd.c +++ b/drivers/misc/mkrd.c @@ -24,6 +24,7 @@ #include +#include #include #include #include diff --git a/drivers/misc/optee.c b/drivers/misc/optee.c index b934a2097d4d9..6eb13d43b51c4 100644 --- a/drivers/misc/optee.c +++ b/drivers/misc/optee.c @@ -27,6 +27,8 @@ #include #include #include +#include +#include #include #include #include diff --git a/drivers/mtd/rammtd.c b/drivers/mtd/rammtd.c index 264b340fc1c77..faae742a2344d 100644 --- a/drivers/mtd/rammtd.c +++ b/drivers/mtd/rammtd.c @@ -31,6 +31,7 @@ #include #include +#include #include #include #include diff --git a/drivers/net/e1000.c b/drivers/net/e1000.c index c0b9abaeced72..54da2c6cb0fa5 100644 --- a/drivers/net/e1000.c +++ b/drivers/net/e1000.c @@ -28,6 +28,7 @@ #include #include +#include #include #include #include diff --git a/drivers/net/igc.c b/drivers/net/igc.c index 86df007952459..1dbaec901ef56 100644 --- a/drivers/net/igc.c +++ b/drivers/net/igc.c @@ -28,6 +28,7 @@ #include #include +#include #include #include #include diff --git a/drivers/pci/pci_ivshmem.c b/drivers/pci/pci_ivshmem.c index e2d04d546eea2..2a0d7eb84e002 100644 --- a/drivers/pci/pci_ivshmem.c +++ b/drivers/pci/pci_ivshmem.c @@ -29,6 +29,7 @@ #include #include +#include #include #include #include diff --git a/drivers/pipes/pipe_common.c b/drivers/pipes/pipe_common.c index fd9a085b34775..f84b39711ef4f 100644 --- a/drivers/pipes/pipe_common.c +++ b/drivers/pipes/pipe_common.c @@ -38,6 +38,7 @@ #include #include +#include #include #include #include diff --git a/drivers/power/battery/goldfish_battery.c b/drivers/power/battery/goldfish_battery.c index fbec7bba24c4f..3b51ad9f7a4bb 100644 --- a/drivers/power/battery/goldfish_battery.c +++ b/drivers/power/battery/goldfish_battery.c @@ -25,8 +25,10 @@ #include #include #include -#include + +#include #include +#include #include #include diff --git a/drivers/rc/lirc_dev.c b/drivers/rc/lirc_dev.c index 1aae588932571..994f65349d297 100644 --- a/drivers/rc/lirc_dev.c +++ b/drivers/rc/lirc_dev.c @@ -32,6 +32,7 @@ #include #include +#include #include #include #include diff --git a/drivers/serial/uart_16550.c b/drivers/serial/uart_16550.c index 89d2cfa7763d6..12f13a67406fc 100644 --- a/drivers/serial/uart_16550.c +++ b/drivers/serial/uart_16550.c @@ -35,6 +35,7 @@ #include #include +#include #include #include #include diff --git a/drivers/serial/uart_bth4.c b/drivers/serial/uart_bth4.c index 88301a68d8bf0..13df068fc939f 100644 --- a/drivers/serial/uart_bth4.c +++ b/drivers/serial/uart_bth4.c @@ -22,6 +22,7 @@ * Included Files ****************************************************************************/ +#include #include #include #include diff --git a/drivers/timers/pl031.c b/drivers/timers/pl031.c index 58c58d8bb5e18..e2414540c5dad 100644 --- a/drivers/timers/pl031.c +++ b/drivers/timers/pl031.c @@ -24,9 +24,12 @@ #include +#include + +#include +#include #include #include -#include /**************************************************************************** * Pre-processor Definitions diff --git a/drivers/usbdev/usbdev_fs.c b/drivers/usbdev/usbdev_fs.c index c6b334213eda0..99646cab598de 100644 --- a/drivers/usbdev/usbdev_fs.c +++ b/drivers/usbdev/usbdev_fs.c @@ -29,6 +29,7 @@ #include #include +#include #include #include #include diff --git a/drivers/video/fb.c b/drivers/video/fb.c index d17c36eafefe6..94c63cb17112e 100644 --- a/drivers/video/fb.c +++ b/drivers/video/fb.c @@ -35,6 +35,7 @@ #include #include +#include #include #include #include diff --git a/drivers/video/mipidsi/mipi_dsi_host.c b/drivers/video/mipidsi/mipi_dsi_host.c index 547398852c13f..b443a1560f806 100644 --- a/drivers/video/mipidsi/mipi_dsi_host.c +++ b/drivers/video/mipidsi/mipi_dsi_host.c @@ -24,6 +24,8 @@ #include +#include +#include #include #include diff --git a/drivers/video/v4l2_m2m.c b/drivers/video/v4l2_m2m.c index f08f61cadf8c1..951cc4ca4e7e1 100644 --- a/drivers/video/v4l2_m2m.c +++ b/drivers/video/v4l2_m2m.c @@ -27,6 +27,7 @@ #include #include +#include #include #include diff --git a/drivers/virtio/virtio-mmio.c b/drivers/virtio/virtio-mmio.c index c5fb423f2808e..efa62e13fdb04 100644 --- a/drivers/virtio/virtio-mmio.c +++ b/drivers/virtio/virtio-mmio.c @@ -29,6 +29,7 @@ #include #include +#include #include #include diff --git a/drivers/virtio/virtio-pci.h b/drivers/virtio/virtio-pci.h index 67334f7b5e9a3..70d3c544e25f1 100644 --- a/drivers/virtio/virtio-pci.h +++ b/drivers/virtio/virtio-pci.h @@ -29,6 +29,7 @@ #ifdef CONFIG_DRIVERS_VIRTIO_PCI +#include #include #include #include diff --git a/drivers/wireless/bluetooth/bt_bridge.c b/drivers/wireless/bluetooth/bt_bridge.c index b82764c56270b..a0733201d2ac4 100644 --- a/drivers/wireless/bluetooth/bt_bridge.c +++ b/drivers/wireless/bluetooth/bt_bridge.c @@ -25,6 +25,7 @@ #include #include +#include #include #include #include diff --git a/fs/fs_heap.c b/fs/fs_heap.c index 78b0bcece02a2..5e4903bc2284f 100644 --- a/fs/fs_heap.c +++ b/fs/fs_heap.c @@ -22,6 +22,8 @@ * Included Files ****************************************************************************/ +#include + #include "fs_heap.h" #if defined(CONFIG_FS_HEAPSIZE) && CONFIG_FS_HEAPSIZE > 0 diff --git a/fs/mmap/fs_munmap.c b/fs/mmap/fs_munmap.c index 4d8b68bcd3de8..e07fdf4469c69 100644 --- a/fs/mmap/fs_munmap.c +++ b/fs/mmap/fs_munmap.c @@ -33,6 +33,7 @@ #include #include +#include #include #include "inode/inode.h" diff --git a/fs/procfs/fs_procfscritmon.c b/fs/procfs/fs_procfscritmon.c index 089738f5eae9e..741706797dd4a 100644 --- a/fs/procfs/fs_procfscritmon.c +++ b/fs/procfs/fs_procfscritmon.c @@ -42,6 +42,7 @@ #include #include #include +#include #include "fs_heap.h" diff --git a/fs/procfs/fs_procfsproc.c b/fs/procfs/fs_procfsproc.c index d1e2fd05285d1..f5dcabdc1151e 100644 --- a/fs/procfs/fs_procfsproc.c +++ b/fs/procfs/fs_procfsproc.c @@ -44,6 +44,7 @@ # include #endif +#include #include #include #include diff --git a/fs/procfs/fs_procfstcbinfo.c b/fs/procfs/fs_procfstcbinfo.c index 23cc918a3d7ff..e3253582733c6 100644 --- a/fs/procfs/fs_procfstcbinfo.c +++ b/fs/procfs/fs_procfstcbinfo.c @@ -36,6 +36,7 @@ #include #include +#include #include #include #include diff --git a/fs/shm/shmfs.c b/fs/shm/shmfs.c index f73dc35969837..18ce172359b3a 100644 --- a/fs/shm/shmfs.c +++ b/fs/shm/shmfs.c @@ -26,12 +26,9 @@ #include #include - -#if defined (CONFIG_BUILD_KERNEL) #include #include #include -#endif #include "shm/shmfs.h" #include "inode/inode.h" diff --git a/fs/tmpfs/fs_tmpfs.c b/fs/tmpfs/fs_tmpfs.c index 286bd2137241b..f08dea1c6cb6c 100644 --- a/fs/tmpfs/fs_tmpfs.c +++ b/fs/tmpfs/fs_tmpfs.c @@ -33,6 +33,7 @@ #include #include +#include #include #include #include diff --git a/fs/vfs/fs_fstat.c b/fs/vfs/fs_fstat.c index a3cb38df7b96d..09d8ed425d78b 100644 --- a/fs/vfs/fs_fstat.c +++ b/fs/vfs/fs_fstat.c @@ -32,6 +32,7 @@ #include #include +#include #include "inode/inode.h" /**************************************************************************** diff --git a/fs/vfs/fs_open.c b/fs/vfs/fs_open.c index a8f1f4691048b..c76d3f4c99f4e 100644 --- a/fs/vfs/fs_open.c +++ b/fs/vfs/fs_open.c @@ -33,6 +33,7 @@ #include #include +#include #include #include diff --git a/fs/vfs/fs_pseudofile.c b/fs/vfs/fs_pseudofile.c index a430b6dd2580f..1cfe0a9cf4705 100644 --- a/fs/vfs/fs_pseudofile.c +++ b/fs/vfs/fs_pseudofile.c @@ -31,6 +31,7 @@ #include #include +#include #include #include #include diff --git a/fs/vfs/fs_sendfile.c b/fs/vfs/fs_sendfile.c index ed283a7416a17..75eb1fe666671 100644 --- a/fs/vfs/fs_sendfile.c +++ b/fs/vfs/fs_sendfile.c @@ -29,6 +29,7 @@ #include #include +#include #include #include #include "fs_heap.h" diff --git a/fs/vfs/fs_timerfd.c b/fs/vfs/fs_timerfd.c index 42a5786208a91..f5252caf19a6e 100644 --- a/fs/vfs/fs_timerfd.c +++ b/fs/vfs/fs_timerfd.c @@ -31,6 +31,7 @@ #include +#include #include #include diff --git a/include/nuttx/kmalloc.h b/include/nuttx/kmalloc.h index 2eefa61c79184..0aca383d4ed61 100644 --- a/include/nuttx/kmalloc.h +++ b/include/nuttx/kmalloc.h @@ -34,7 +34,10 @@ #include #include -#include + +#ifdef CONFIG_MM_KERNEL_HEAP +#include +#endif /**************************************************************************** * Public Types diff --git a/include/nuttx/net/snoop.h b/include/nuttx/net/snoop.h index d579c126856b1..69d0025ff5fc8 100644 --- a/include/nuttx/net/snoop.h +++ b/include/nuttx/net/snoop.h @@ -29,6 +29,7 @@ #include +#include #include #include diff --git a/include/nuttx/notifier.h b/include/nuttx/notifier.h index eb67b37809056..87ebdb78abc5e 100644 --- a/include/nuttx/notifier.h +++ b/include/nuttx/notifier.h @@ -30,6 +30,7 @@ #include #include #include +#include #include #include diff --git a/include/nuttx/pci/pci_ivshmem.h b/include/nuttx/pci/pci_ivshmem.h index 07251a4c455f3..fad7a54a16abe 100644 --- a/include/nuttx/pci/pci_ivshmem.h +++ b/include/nuttx/pci/pci_ivshmem.h @@ -31,6 +31,7 @@ #ifdef CONFIG_PCI_IVSHMEM +#include #include /**************************************************************************** diff --git a/include/nuttx/userspace.h b/include/nuttx/userspace.h index 59285ac9605dc..2166c89e680e8 100644 --- a/include/nuttx/userspace.h +++ b/include/nuttx/userspace.h @@ -34,8 +34,6 @@ #include #include -#include - #ifdef CONFIG_BUILD_PROTECTED /**************************************************************************** diff --git a/include/syslog.h b/include/syslog.h index 37e4487c2fb5b..66936e034d7cb 100644 --- a/include/syslog.h +++ b/include/syslog.h @@ -29,6 +29,7 @@ #include #include + #ifdef CONFIG_SYSLOG_TO_SCHED_NOTE #include #endif diff --git a/libs/libc/misc/lib_cxx_initialize.c b/libs/libc/misc/lib_cxx_initialize.c index 0d7aaaaa080ba..4db113fcd10fd 100644 --- a/libs/libc/misc/lib_cxx_initialize.c +++ b/libs/libc/misc/lib_cxx_initialize.c @@ -25,6 +25,7 @@ ****************************************************************************/ #include +#include #include #include diff --git a/libs/libc/modlib/modlib_bind.c b/libs/libc/modlib/modlib_bind.c index c136ea3f53a32..eca81ee74531d 100644 --- a/libs/libc/modlib/modlib_bind.c +++ b/libs/libc/modlib/modlib_bind.c @@ -32,6 +32,7 @@ #include #include +#include #include #include diff --git a/libs/libc/modlib/modlib_load.c b/libs/libc/modlib/modlib_load.c index 63e12ab382a76..889c0c98b2c38 100644 --- a/libs/libc/modlib/modlib_load.c +++ b/libs/libc/modlib/modlib_load.c @@ -37,6 +37,7 @@ #include #include +#include #include #include "libc.h" diff --git a/libs/libc/modlib/modlib_unload.c b/libs/libc/modlib/modlib_unload.c index 5fde605d2b0a8..b5ac20ecae207 100644 --- a/libs/libc/modlib/modlib_unload.c +++ b/libs/libc/modlib/modlib_unload.c @@ -29,6 +29,7 @@ #include #include +#include #include #include "libc.h" diff --git a/libs/libc/stdio/lib_freopen.c b/libs/libc/stdio/lib_freopen.c index cefb5660e20be..2297bfbdc06fd 100644 --- a/libs/libc/stdio/lib_freopen.c +++ b/libs/libc/stdio/lib_freopen.c @@ -29,6 +29,7 @@ #include #include #include +#include #include "libc.h" diff --git a/libs/libc/time/lib_localtime.c b/libs/libc/time/lib_localtime.c index 8be9d17258be4..8dd6f5f3d277e 100644 --- a/libs/libc/time/lib_localtime.c +++ b/libs/libc/time/lib_localtime.c @@ -53,7 +53,7 @@ #include -#include +#include #include #include #include diff --git a/mm/umm_heap/umm_calloc.c b/mm/umm_heap/umm_calloc.c index 3c16fa56dbd72..7c782c979090d 100644 --- a/mm/umm_heap/umm_calloc.c +++ b/mm/umm_heap/umm_calloc.c @@ -26,6 +26,7 @@ #include +#include #include #include diff --git a/mm/umm_heap/umm_heap.h b/mm/umm_heap/umm_heap.h index 2e23941e8de9b..c2b5de12c18d6 100644 --- a/mm/umm_heap/umm_heap.h +++ b/mm/umm_heap/umm_heap.h @@ -29,6 +29,7 @@ #include +#include #include /**************************************************************************** diff --git a/mm/umm_heap/umm_initialize.c b/mm/umm_heap/umm_initialize.c index 9ddd8f8933930..f38db4a852c20 100644 --- a/mm/umm_heap/umm_initialize.c +++ b/mm/umm_heap/umm_initialize.c @@ -28,6 +28,7 @@ #include +#include #include #include "umm_heap/umm_heap.h" diff --git a/mm/umm_heap/umm_sbrk.c b/mm/umm_heap/umm_sbrk.c index 351e0e7761326..5d338b5f43177 100644 --- a/mm/umm_heap/umm_sbrk.c +++ b/mm/umm_heap/umm_sbrk.c @@ -32,6 +32,7 @@ #include #include +#include #include #include "umm_heap/umm_heap.h" diff --git a/net/local/local_conn.c b/net/local/local_conn.c index f6fcd8294dbe0..720d09083d6ae 100644 --- a/net/local/local_conn.c +++ b/net/local/local_conn.c @@ -32,6 +32,7 @@ #include #include +#include #include #include diff --git a/net/netlink/netlink_sockif.c b/net/netlink/netlink_sockif.c index f5d6b112dd659..5ce00c7586174 100644 --- a/net/netlink/netlink_sockif.c +++ b/net/netlink/netlink_sockif.c @@ -36,6 +36,7 @@ #include #include +#include #include #include #include diff --git a/net/socket/socket.h b/net/socket/socket.h index 89f15284b75f3..d05c66c83bec9 100644 --- a/net/socket/socket.h +++ b/net/socket/socket.h @@ -34,6 +34,7 @@ #include #include +#include #include #include diff --git a/net/socket/socketpair.c b/net/socket/socketpair.c index fb06d06daf5da..e167b53eba4f8 100644 --- a/net/socket/socketpair.c +++ b/net/socket/socketpair.c @@ -33,6 +33,7 @@ #include #include +#include #include #include diff --git a/net/utils/net_snoop.c b/net/utils/net_snoop.c index 38c16c9ff43da..2f494f3bd5916 100644 --- a/net/utils/net_snoop.c +++ b/net/utils/net_snoop.c @@ -34,7 +34,7 @@ #include -#include +#include #include /**************************************************************************** diff --git a/sched/misc/reboot_notifier.c b/sched/misc/reboot_notifier.c index 9f77a0088d3b4..e1f2cfab46d71 100644 --- a/sched/misc/reboot_notifier.c +++ b/sched/misc/reboot_notifier.c @@ -25,6 +25,7 @@ ****************************************************************************/ #include +#include #include #include diff --git a/sched/signal/sig_findaction.c b/sched/signal/sig_findaction.c index 42176fdc65688..f8c4391ed097f 100644 --- a/sched/signal/sig_findaction.c +++ b/sched/signal/sig_findaction.c @@ -26,7 +26,9 @@ #include +#include #include + #include "signal/signal.h" /**************************************************************************** diff --git a/sched/signal/signal.h b/sched/signal/signal.h index 7fef91d116d4c..c43c793c4aa79 100644 --- a/sched/signal/signal.h +++ b/sched/signal/signal.h @@ -33,6 +33,7 @@ #include #include +#include #include #include diff --git a/sched/wqueue/kwork_notifier.c b/sched/wqueue/kwork_notifier.c index 37bb6d16f10c5..f915cfa3e7267 100644 --- a/sched/wqueue/kwork_notifier.c +++ b/sched/wqueue/kwork_notifier.c @@ -34,6 +34,7 @@ #include #include +#include #include #include