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 14656ce
Show file tree
Hide file tree
Showing 82 changed files with 92 additions and 26 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
2 changes: 1 addition & 1 deletion boards/arm/imxrt/imxrt1050-evk/kernel/imxrt_userspace.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

#include <stdlib.h>

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

Expand Down
2 changes: 1 addition & 1 deletion boards/arm/imxrt/imxrt1060-evk/kernel/imxrt_userspace.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

#include <stdlib.h>

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

Expand Down
2 changes: 1 addition & 1 deletion boards/arm/imxrt/imxrt1064-evk/kernel/imxrt_userspace.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

#include <stdlib.h>

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

Expand Down
2 changes: 1 addition & 1 deletion boards/arm/imxrt/imxrt1170-evk/kernel/imxrt_userspace.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

#include <stdlib.h>

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

Expand Down
2 changes: 1 addition & 1 deletion boards/arm/imxrt/teensy-4.x/kernel/imxrt_userspace.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

#include <stdlib.h>

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

#include <stdlib.h>

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

#include <stdlib.h>

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

#include <stdlib.h>

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

#include <stdlib.h>

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

Expand Down
2 changes: 1 addition & 1 deletion boards/arm/mps/mps2-an500/kernel/mps_userspace.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

#include <stdlib.h>

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

Expand Down
2 changes: 1 addition & 1 deletion boards/arm/s32k3xx/mr-canhubk3/kernel/s32k3xx_userspace.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

#include <stdlib.h>

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

Expand Down
2 changes: 1 addition & 1 deletion boards/arm/sam34/sam3u-ek/kernel/sam_userspace.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

#include <stdlib.h>

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

Expand Down
2 changes: 1 addition & 1 deletion boards/arm/samv7/same70-qmtech/kernel/sam_userspace.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

#include <stdlib.h>

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

Expand Down
2 changes: 1 addition & 1 deletion boards/arm/samv7/same70-xplained/kernel/sam_userspace.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

#include <stdlib.h>

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

Expand Down
2 changes: 1 addition & 1 deletion boards/arm/samv7/samv71-xult/kernel/sam_userspace.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

#include <stdlib.h>

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

Expand Down
2 changes: 1 addition & 1 deletion boards/arm/stm32/mikroe-stm32f4/kernel/stm32_userspace.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

#include <stdlib.h>

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

Expand Down
2 changes: 1 addition & 1 deletion boards/arm/stm32/stm3240g-eval/kernel/stm32_userspace.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

#include <stdlib.h>

#include <nuttx/userspace.h>
#include <nuttx/arch.h>
#include <nuttx/wqueue.h>
#include <nuttx/mm/mm.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
Loading

0 comments on commit 14656ce

Please sign in to comment.