Skip to content

Commit

Permalink
userspace: Exclude nuttx/arch.h
Browse files Browse the repository at this point in the history
This patch fixed userspace headers conflict. Architecture-related definition and API should not be exposed to users.

Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>
  • Loading branch information
Fix-Point committed Oct 16, 2024
1 parent ff4b654 commit 4b37737
Show file tree
Hide file tree
Showing 65 changed files with 75 additions and 10 deletions.
1 change: 1 addition & 0 deletions arch/risc-v/src/bl602/bl602_oneshot_lowerhalf.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
#include <assert.h>
#include <debug.h>

#include <nuttx/arch.h>
#include <nuttx/irq.h>
#include <nuttx/kmalloc.h>
#include <nuttx/timers/oneshot.h>
Expand Down
1 change: 1 addition & 0 deletions arch/risc-v/src/bl602/bl602_os_hal.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
#include <syslog.h>

#include <nuttx/config.h>
#include <nuttx/arch.h>
#include <nuttx/irq.h>
#include <nuttx/kthread.h>
#include <nuttx/mqueue.h>
Expand Down
1 change: 1 addition & 0 deletions arch/risc-v/src/common/riscv_mtimer.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
* Included Files
****************************************************************************/

#include <nuttx/arch.h>
#include <nuttx/irq.h>
#include <nuttx/kmalloc.h>

Expand Down
1 change: 1 addition & 0 deletions arch/x86_64/src/intel64/intel64_oneshot.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
#include <nuttx/config.h>

#include <nuttx/compiler.h>
#include <nuttx/clock.h>

#include <intel64_hpet.h>

Expand Down
1 change: 1 addition & 0 deletions binfmt/binfmt_unloadmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
#include <debug.h>
#include <errno.h>

#include <nuttx/arch.h>
#include <nuttx/addrenv.h>
#include <nuttx/kmalloc.h>
#include <nuttx/binfmt/binfmt.h>
Expand Down
1 change: 1 addition & 0 deletions crypto/cryptosoft.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
#include <assert.h>
#include <errno.h>
#include <endian.h>
#include <strings.h>
#include <nuttx/kmalloc.h>
#include <crypto/bn.h>
#include <crypto/cryptodev.h>
Expand Down
1 change: 1 addition & 0 deletions drivers/input/goldfish_events.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@

#include <debug.h>

#include <nuttx/arch.h>
#include <nuttx/irq.h>
#include <nuttx/queue.h>
#include <nuttx/kmalloc.h>
Expand Down
1 change: 1 addition & 0 deletions drivers/input/mouse_upper.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
#include <poll.h>

#include <nuttx/input/mouse.h>
#include <nuttx/fs/fs.h>
#include <nuttx/kmalloc.h>
#include <nuttx/mutex.h>
#include <nuttx/list.h>
Expand Down
1 change: 1 addition & 0 deletions drivers/misc/goldfish_pipe.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
#include <fcntl.h>
#include <poll.h>

#include <nuttx/arch.h>
#include <nuttx/fs/fs.h>
#include <nuttx/irq.h>
#include <nuttx/kmalloc.h>
Expand Down
1 change: 1 addition & 0 deletions drivers/misc/mkrd.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@

#include <nuttx/config.h>

#include <errno.h>
#include <stdint.h>
#include <string.h>
#include <debug.h>
Expand Down
2 changes: 2 additions & 0 deletions drivers/misc/optee.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
#include <fcntl.h>
#include <netpacket/rpmsg.h>
#include <nuttx/drivers/optee.h>
#include <nuttx/fs/fs.h>
#include <nuttx/net/net.h>
#include <nuttx/kmalloc.h>
#include <nuttx/mutex.h>
#include <sys/mman.h>
Expand Down
1 change: 1 addition & 0 deletions drivers/mtd/rammtd.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
#include <errno.h>
#include <debug.h>

#include <nuttx/fs/fs.h>
#include <nuttx/kmalloc.h>
#include <nuttx/fs/ioctl.h>
#include <nuttx/mtd/mtd.h>
Expand Down
1 change: 1 addition & 0 deletions drivers/net/e1000.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
#include <debug.h>
#include <errno.h>

#include <nuttx/arch.h>
#include <nuttx/kmalloc.h>
#include <nuttx/wqueue.h>
#include <nuttx/addrenv.h>
Expand Down
1 change: 1 addition & 0 deletions drivers/net/igc.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
#include <debug.h>
#include <errno.h>

#include <nuttx/arch.h>
#include <nuttx/kmalloc.h>
#include <nuttx/wqueue.h>
#include <nuttx/addrenv.h>
Expand Down
1 change: 1 addition & 0 deletions drivers/pci/pci_ivshmem.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
#include <errno.h>
#include <debug.h>

#include <nuttx/arch.h>
#include <nuttx/kmalloc.h>
#include <nuttx/list.h>
#include <nuttx/mutex.h>
Expand Down
1 change: 1 addition & 0 deletions drivers/pipes/pipe_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
#include <assert.h>
#include <debug.h>

#include <nuttx/arch.h>
#include <nuttx/kmalloc.h>
#include <nuttx/semaphore.h>
#include <nuttx/fs/fs.h>
Expand Down
4 changes: 3 additions & 1 deletion drivers/power/battery/goldfish_battery.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,10 @@
#include <stdint.h>
#include <errno.h>
#include <debug.h>
#include <nuttx/nuttx.h>

#include <nuttx/arch.h>
#include <nuttx/kmalloc.h>
#include <nuttx/nuttx.h>
#include <nuttx/power/battery_gauge.h>
#include <nuttx/power/battery_ioctl.h>

Expand Down
1 change: 1 addition & 0 deletions drivers/rc/lirc_dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
#include <poll.h>
#include <fcntl.h>

#include <nuttx/irq.h>
#include <nuttx/kmalloc.h>
#include <nuttx/mutex.h>
#include <nuttx/circbuf.h>
Expand Down
1 change: 1 addition & 0 deletions drivers/serial/uart_16550.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
#include <errno.h>
#include <debug.h>

#include <nuttx/spinlock.h>
#include <nuttx/irq.h>
#include <nuttx/arch.h>
#include <nuttx/clk/clk.h>
Expand Down
1 change: 1 addition & 0 deletions drivers/serial/uart_bth4.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
* Included Files
****************************************************************************/

#include <nuttx/irq.h>
#include <nuttx/fs/fs.h>
#include <nuttx/kmalloc.h>
#include <nuttx/mutex.h>
Expand Down
5 changes: 4 additions & 1 deletion drivers/timers/pl031.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,12 @@

#include <nuttx/config.h>

#include <stdio.h>

#include <nuttx/arch.h>
#include <nuttx/irq.h>
#include <nuttx/timers/rtc.h>
#include <nuttx/timers/pl031.h>
#include <stdio.h>

/****************************************************************************
* Pre-processor Definitions
Expand Down
1 change: 1 addition & 0 deletions drivers/usbdev/usbdev_fs.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
#include <poll.h>
#include <stdio.h>

#include <nuttx/irq.h>
#include <nuttx/nuttx.h>
#include <nuttx/kmalloc.h>
#include <nuttx/queue.h>
Expand Down
1 change: 1 addition & 0 deletions drivers/video/fb.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
#include <errno.h>
#include <poll.h>

#include <nuttx/irq.h>
#include <nuttx/kmalloc.h>
#include <nuttx/fs/fs.h>
#include <nuttx/fs/ioctl.h>
Expand Down
2 changes: 2 additions & 0 deletions drivers/video/mipidsi/mipi_dsi_host.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@

#include <nuttx/config.h>

#include <assert.h>
#include <errno.h>
#include <debug.h>

#include <nuttx/kmalloc.h>
Expand Down
1 change: 1 addition & 0 deletions drivers/video/v4l2_m2m.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
#include <fcntl.h>
#include <poll.h>

#include <nuttx/sched.h>
#include <nuttx/video/v4l2_m2m.h>
#include <nuttx/video/video.h>

Expand Down
1 change: 1 addition & 0 deletions drivers/virtio/virtio-mmio.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
#include <stdint.h>
#include <sys/param.h>

#include <nuttx/arch.h>
#include <nuttx/virtio/virtio.h>
#include <nuttx/virtio/virtio-mmio.h>

Expand Down
1 change: 1 addition & 0 deletions drivers/virtio/virtio-pci.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@

#ifdef CONFIG_DRIVERS_VIRTIO_PCI

#include <nuttx/arch.h>
#include <nuttx/pci/pci.h>
#include <nuttx/virtio/virtio.h>
#include <nuttx/wdog.h>
Expand Down
1 change: 1 addition & 0 deletions drivers/wireless/bluetooth/bt_bridge.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
#include <debug.h>
#include <string.h>

#include <nuttx/irq.h>
#include <nuttx/kmalloc.h>
#include <nuttx/atomic.h>
#include <nuttx/net/snoop.h>
Expand Down
2 changes: 2 additions & 0 deletions fs/fs_heap.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
* Included Files
****************************************************************************/

#include <assert.h>

#include "fs_heap.h"

#if defined(CONFIG_FS_HEAPSIZE) && CONFIG_FS_HEAPSIZE > 0
Expand Down
1 change: 1 addition & 0 deletions fs/mmap/fs_munmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
#include <assert.h>
#include <debug.h>

#include <nuttx/sched.h>
#include <nuttx/kmalloc.h>

#include "inode/inode.h"
Expand Down
1 change: 1 addition & 0 deletions fs/procfs/fs_procfscritmon.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
#include <nuttx/kmalloc.h>
#include <nuttx/fs/fs.h>
#include <nuttx/fs/procfs.h>
#include <nuttx/sched.h>

#include "fs_heap.h"

Expand Down
1 change: 1 addition & 0 deletions fs/procfs/fs_procfsproc.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
# include <time.h>
#endif

#include <nuttx/arch.h>
#include <nuttx/nuttx.h>
#include <nuttx/irq.h>
#include <nuttx/tls.h>
Expand Down
1 change: 1 addition & 0 deletions fs/procfs/fs_procfstcbinfo.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
#include <errno.h>
#include <debug.h>

#include <nuttx/sched.h>
#include <nuttx/kmalloc.h>
#include <nuttx/fs/fs.h>
#include <nuttx/fs/procfs.h>
Expand Down
3 changes: 0 additions & 3 deletions fs/shm/shmfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,9 @@

#include <nuttx/fs/ioctl.h>
#include <nuttx/mm/map.h>

#if defined (CONFIG_BUILD_KERNEL)
#include <nuttx/arch.h>
#include <nuttx/pgalloc.h>
#include <nuttx/sched.h>
#endif

#include "shm/shmfs.h"
#include "inode/inode.h"
Expand Down
1 change: 1 addition & 0 deletions fs/tmpfs/fs_tmpfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
#include <assert.h>
#include <debug.h>

#include <nuttx/sched.h>
#include <nuttx/kmalloc.h>
#include <nuttx/fs/fs.h>
#include <nuttx/fs/ioctl.h>
Expand Down
1 change: 1 addition & 0 deletions fs/vfs/fs_fstat.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@

#include <nuttx/fs/fs.h>
#include <nuttx/mtd/mtd.h>
#include <nuttx/net/net.h>
#include "inode/inode.h"

/****************************************************************************
Expand Down
1 change: 1 addition & 0 deletions fs/vfs/fs_open.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
#include <assert.h>
#include <stdarg.h>

#include <nuttx/sched.h>
#include <nuttx/cancelpt.h>
#include <nuttx/fs/fs.h>

Expand Down
1 change: 1 addition & 0 deletions fs/vfs/fs_pseudofile.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
#include <fcntl.h>
#include <sys/param.h>

#include <nuttx/sched.h>
#include <nuttx/kmalloc.h>
#include <nuttx/fs/fs.h>
#include <nuttx/fs/ioctl.h>
Expand Down
1 change: 1 addition & 0 deletions fs/vfs/fs_sendfile.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
#include <errno.h>
#include <debug.h>

#include <nuttx/fs/fs.h>
#include <nuttx/kmalloc.h>
#include <nuttx/net/net.h>
#include "fs_heap.h"
Expand Down
1 change: 1 addition & 0 deletions fs/vfs/fs_timerfd.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@

#include <debug.h>

#include <nuttx/irq.h>
#include <nuttx/wdog.h>
#include <nuttx/mutex.h>

Expand Down
5 changes: 4 additions & 1 deletion include/nuttx/kmalloc.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,10 @@
#include <stdlib.h>

#include <nuttx/mm/mm.h>
#include <nuttx/userspace.h>

#ifdef CONFIG_MM_KERNEL_HEAP
#include <nuttx/sched.h>
#endif

/****************************************************************************
* Public Types
Expand Down
1 change: 1 addition & 0 deletions include/nuttx/net/snoop.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@

#include <stdint.h>

#include <nuttx/fs/fs.h>
#include <nuttx/mutex.h>
#include <nuttx/wqueue.h>

Expand Down
1 change: 1 addition & 0 deletions include/nuttx/notifier.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
#include <nuttx/config.h>
#include <nuttx/irq.h>
#include <nuttx/mutex.h>
#include <nuttx/spinlock.h>

#include <debug.h>
#include <errno.h>
Expand Down
1 change: 1 addition & 0 deletions include/nuttx/pci/pci_ivshmem.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@

#ifdef CONFIG_PCI_IVSHMEM

#include <nuttx/irq.h>
#include <nuttx/list.h>

/****************************************************************************
Expand Down
2 changes: 0 additions & 2 deletions include/nuttx/userspace.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@
#include <signal.h>
#include <pthread.h>

#include <nuttx/arch.h>

#ifdef CONFIG_BUILD_PROTECTED

/****************************************************************************
Expand Down
1 change: 1 addition & 0 deletions include/syslog.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@

#include <nuttx/config.h>
#include <nuttx/compiler.h>

#ifdef CONFIG_SYSLOG_TO_SCHED_NOTE
#include <nuttx/sched_note.h>
#endif
Expand Down
1 change: 1 addition & 0 deletions libs/libc/misc/lib_cxx_initialize.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
****************************************************************************/

#include <nuttx/config.h>
#include <nuttx/arch.h>

#include <assert.h>
#include <debug.h>
Expand Down
Loading

0 comments on commit 4b37737

Please sign in to comment.