diff --git a/nx/Makefile b/nx/Makefile index 928e6c38..8a94238c 100644 --- a/nx/Makefile +++ b/nx/Makefile @@ -85,7 +85,8 @@ export OFILES := $(addsuffix .o,$(BINFILES)) \ export INCLUDE := $(foreach dir,$(INCLUDES),-I$(CURDIR)/$(dir)) \ $(foreach dir,$(LIBDIRS),-I$(dir)/include) \ - -I. + -I. \ + -iquote$(CURDIR)/include/switch/ .PHONY: clean all diff --git a/nx/include/switch.h b/nx/include/switch.h index 7825f5d5..9520baa5 100644 --- a/nx/include/switch.h +++ b/nx/include/switch.h @@ -8,51 +8,51 @@ extern "C" { #endif -#include -#include +#include "switch/types.h" +#include "switch/result.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include "switch/kernel/svc.h" +#include "switch/kernel/tmem.h" +#include "switch/kernel/shmem.h" +#include "switch/kernel/mutex.h" +#include "switch/kernel/rwlock.h" +#include "switch/kernel/thread.h" +#include "switch/kernel/virtmem.h" +#include "switch/kernel/detect.h" +#include "switch/kernel/random.h" +#include "switch/kernel/jit.h" -#include -#include +#include "switch/arm.h" +#include "switch/ipc.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include "switch/services/sm.h" +#include "switch/services/fs.h" +#include "switch/services/acc.h" +#include "switch/services/apm.h" +#include "switch/services/applet.h" +#include "switch/services/bsd.h" +#include "switch/services/fatal.h" +#include "switch/services/usb.h" +#include "switch/services/hid.h" +#include "switch/services/vi.h" +#include "switch/services/nv.h" +#include "switch/services/pm.h" -#include -#include -#include -#include -#include -#include -#include +#include "switch/gfx/gfx.h" +#include "switch/gfx/binder.h" +#include "switch/gfx/parcel.h" +#include "switch/gfx/buffer_producer.h" +#include "switch/gfx/ioctl.h" +#include "switch/gfx/nvioctl.h" +#include "switch/gfx/nvgfx.h" -#include +#include "switch/runtime/env.h" -#include +#include "switch/runtime/util/utf.h" -#include -#include -#include +#include "switch/runtime/devices/console.h" +#include "switch/runtime/devices/usb_comms.h" +#include "switch/runtime/devices/fs_dev.h" #ifdef __cplusplus } diff --git a/nx/include/switch/arm.h b/nx/include/switch/arm.h index 723f9545..c1ac8451 100644 --- a/nx/include/switch/arm.h +++ b/nx/include/switch/arm.h @@ -1,5 +1,5 @@ #pragma once -#include +#include "types.h" static inline void* armGetTls(void) { void* ret; diff --git a/nx/include/switch/gfx/binder.h b/nx/include/switch/gfx/binder.h index 0137b2a4..9c427842 100644 --- a/nx/include/switch/gfx/binder.h +++ b/nx/include/switch/gfx/binder.h @@ -1,5 +1,5 @@ #pragma once -#include +#include "types.h" #define BINDER_FIRST_CALL_TRANSACTION 0x1 diff --git a/nx/include/switch/gfx/buffer_producer.h b/nx/include/switch/gfx/buffer_producer.h index 763fdf60..860b9bc5 100644 --- a/nx/include/switch/gfx/buffer_producer.h +++ b/nx/include/switch/gfx/buffer_producer.h @@ -1,5 +1,5 @@ #pragma once -#include +#include "gfx/nvioctl.h" typedef struct { u32 is_valid; diff --git a/nx/include/switch/gfx/gfx.h b/nx/include/switch/gfx/gfx.h index cd63e88c..1e8f3ae0 100644 --- a/nx/include/switch/gfx/gfx.h +++ b/nx/include/switch/gfx/gfx.h @@ -1,5 +1,5 @@ #pragma once -#include +#include "types.h" /// Converts red, green, blue, and alpha components to packed RGBA8. #define RGBA8(r,g,b,a) (((r)&0xff)|(((g)&0xff)<<8)|(((b)&0xff)<<16)|(((a)&0xff)<<24)) diff --git a/nx/include/switch/gfx/nvgfx.h b/nx/include/switch/gfx/nvgfx.h index f66dc2fb..971203b1 100644 --- a/nx/include/switch/gfx/nvgfx.h +++ b/nx/include/switch/gfx/nvgfx.h @@ -1,5 +1,5 @@ #pragma once -#include +#include "types.h" Result nvgfxInitialize(void); void nvgfxExit(void); diff --git a/nx/include/switch/gfx/nvioctl.h b/nx/include/switch/gfx/nvioctl.h index 85286173..5b128d33 100644 --- a/nx/include/switch/gfx/nvioctl.h +++ b/nx/include/switch/gfx/nvioctl.h @@ -1,5 +1,5 @@ #pragma once -#include +#include "types.h" typedef struct { u32 arch; // 0x120 (NVGPU_GPU_ARCH_GM200) diff --git a/nx/include/switch/gfx/parcel.h b/nx/include/switch/gfx/parcel.h index 2106f1a1..6c5a6cae 100644 --- a/nx/include/switch/gfx/parcel.h +++ b/nx/include/switch/gfx/parcel.h @@ -1,6 +1,6 @@ #pragma once -#include -#include +#include "result.h" +#include "gfx/binder.h" typedef struct { u8 payload[0x400]; diff --git a/nx/include/switch/ipc.h b/nx/include/switch/ipc.h index 2f385cf5..1be3a0f7 100644 --- a/nx/include/switch/ipc.h +++ b/nx/include/switch/ipc.h @@ -1,8 +1,8 @@ // Copyright 2017 plutoo #pragma once -#include -#include -#include +#include "arm.h" +#include "result.h" +#include "kernel/svc.h" #define SFCI_MAGIC 0x49434653 #define SFCO_MAGIC 0x4f434653 diff --git a/nx/include/switch/kernel/detect.h b/nx/include/switch/kernel/detect.h index aec31ec7..d8055327 100644 --- a/nx/include/switch/kernel/detect.h +++ b/nx/include/switch/kernel/detect.h @@ -1,6 +1,6 @@ // Copyright 2017 plutoo #pragma once -#include +#include "types.h" bool kernelAbove200(void); bool kernelAbove300(void); diff --git a/nx/include/switch/kernel/jit.h b/nx/include/switch/kernel/jit.h index eebd3e4f..f5753409 100644 --- a/nx/include/switch/kernel/jit.h +++ b/nx/include/switch/kernel/jit.h @@ -1,6 +1,6 @@ // Copyright 2018 plutoo #pragma once -#include +#include "types.h" typedef enum { JitType_CodeMemory, diff --git a/nx/include/switch/kernel/mutex.h b/nx/include/switch/kernel/mutex.h index 57f32783..4dde2c27 100644 --- a/nx/include/switch/kernel/mutex.h +++ b/nx/include/switch/kernel/mutex.h @@ -1,7 +1,7 @@ // Copyright 2017 plutoo #pragma once #include -#include // not needed in this file, still including it +#include "types.h" // not needed in this file, still including it typedef _LOCK_T Mutex; typedef _LOCK_RECURSIVE_T RMutex; diff --git a/nx/include/switch/kernel/random.h b/nx/include/switch/kernel/random.h index 6764454a..786d5365 100644 --- a/nx/include/switch/kernel/random.h +++ b/nx/include/switch/kernel/random.h @@ -1,6 +1,6 @@ // Copyright 2018 plutoo #pragma once -#include +#include "types.h" void randomGet(u8* buf, size_t len); u64 randomGet64(void); diff --git a/nx/include/switch/kernel/rwlock.h b/nx/include/switch/kernel/rwlock.h index bf9ef772..d889cf06 100644 --- a/nx/include/switch/kernel/rwlock.h +++ b/nx/include/switch/kernel/rwlock.h @@ -1,6 +1,6 @@ // Copyright 2018 plutoo #pragma once -#include +#include "kernel/mutex.h" typedef struct { RMutex r; diff --git a/nx/include/switch/kernel/shmem.h b/nx/include/switch/kernel/shmem.h index c4720c9d..733121d9 100644 --- a/nx/include/switch/kernel/shmem.h +++ b/nx/include/switch/kernel/shmem.h @@ -1,5 +1,5 @@ #pragma once -#include +#include "types.h" typedef struct { Handle handle; diff --git a/nx/include/switch/kernel/svc.h b/nx/include/switch/kernel/svc.h index 55562568..71c67066 100644 --- a/nx/include/switch/kernel/svc.h +++ b/nx/include/switch/kernel/svc.h @@ -3,7 +3,7 @@ * @brief Syscall wrappers. */ #pragma once -#include +#include "types.h" /// Pseudo handle for the current process #define CUR_PROCESS_HANDLE 0xFFFF8001 diff --git a/nx/include/switch/kernel/thread.h b/nx/include/switch/kernel/thread.h index 9ff44fa5..a05aa0f9 100644 --- a/nx/include/switch/kernel/thread.h +++ b/nx/include/switch/kernel/thread.h @@ -1,5 +1,5 @@ #pragma once -#include +#include "types.h" typedef struct { Handle handle; diff --git a/nx/include/switch/kernel/tmem.h b/nx/include/switch/kernel/tmem.h index ace5ff72..5836b926 100644 --- a/nx/include/switch/kernel/tmem.h +++ b/nx/include/switch/kernel/tmem.h @@ -1,5 +1,5 @@ #pragma once -#include +#include "types.h" typedef struct { Handle handle; diff --git a/nx/include/switch/kernel/virtmem.h b/nx/include/switch/kernel/virtmem.h index 14339ecf..d52e75a7 100644 --- a/nx/include/switch/kernel/virtmem.h +++ b/nx/include/switch/kernel/virtmem.h @@ -1,5 +1,5 @@ #pragma once -#include +#include "types.h" void* virtmemReserve(size_t size); void virtmemFree(void* addr, size_t size); diff --git a/nx/include/switch/result.h b/nx/include/switch/result.h index 64fc8cc4..3660bc3e 100644 --- a/nx/include/switch/result.h +++ b/nx/include/switch/result.h @@ -3,7 +3,7 @@ * @brief Switch result code tools */ #pragma once -#include +#include "types.h" /// Checks whether a result code indicates success. #define R_SUCCEEDED(res) ((res)==0) diff --git a/nx/include/switch/runtime/devices/console.h b/nx/include/switch/runtime/devices/console.h index e4254ab1..6b9982a8 100644 --- a/nx/include/switch/runtime/devices/console.h +++ b/nx/include/switch/runtime/devices/console.h @@ -15,7 +15,7 @@ * @endcode */ #pragma once -#include +#include "types.h" #define CONSOLE_ESC(x) "\x1b[" #x #define CONSOLE_RESET CONSOLE_ESC(0m) diff --git a/nx/include/switch/runtime/devices/fs_dev.h b/nx/include/switch/runtime/devices/fs_dev.h index 66c575db..9bba6ab9 100644 --- a/nx/include/switch/runtime/devices/fs_dev.h +++ b/nx/include/switch/runtime/devices/fs_dev.h @@ -3,7 +3,7 @@ * @brief FS driver. */ #pragma once -#include +#include "services/fs.h" //NOTE: This is currently not usable. diff --git a/nx/include/switch/runtime/devices/usb_comms.h b/nx/include/switch/runtime/devices/usb_comms.h index 75947694..8516f3eb 100644 --- a/nx/include/switch/runtime/devices/usb_comms.h +++ b/nx/include/switch/runtime/devices/usb_comms.h @@ -1,5 +1,5 @@ #pragma once -#include +#include "types.h" Result usbCommsInitialize(void); void usbCommsExit(void); diff --git a/nx/include/switch/runtime/env.h b/nx/include/switch/runtime/env.h index 98bbc6ea..309b089f 100644 --- a/nx/include/switch/runtime/env.h +++ b/nx/include/switch/runtime/env.h @@ -1,6 +1,6 @@ // Copyright 2018 plutoo #pragma once -#include +#include "types.h" typedef struct { u32 Key; diff --git a/nx/include/switch/runtime/util/utf.h b/nx/include/switch/runtime/util/utf.h index f5b94edb..b7591395 100644 --- a/nx/include/switch/runtime/util/utf.h +++ b/nx/include/switch/runtime/util/utf.h @@ -5,7 +5,7 @@ #pragma once #include -#include +#include "types.h" /** Convert a UTF-8 sequence into a UTF-32 codepoint * diff --git a/nx/include/switch/services/acc.h b/nx/include/switch/services/acc.h index 895d4931..9d2dbedb 100644 --- a/nx/include/switch/services/acc.h +++ b/nx/include/switch/services/acc.h @@ -1,5 +1,5 @@ #pragma once -#include +#include "types.h" Result accountInitialize(void); void accountExit(void); diff --git a/nx/include/switch/services/apm.h b/nx/include/switch/services/apm.h index 5fee8ad0..376855c8 100644 --- a/nx/include/switch/services/apm.h +++ b/nx/include/switch/services/apm.h @@ -1,5 +1,5 @@ #pragma once -#include +#include "types.h" /// These are used internally by applet. diff --git a/nx/include/switch/services/applet.h b/nx/include/switch/services/applet.h index 41a22f0e..8c515c73 100644 --- a/nx/include/switch/services/applet.h +++ b/nx/include/switch/services/applet.h @@ -1,5 +1,5 @@ #pragma once -#include +#include "types.h" typedef enum { AppletType_None = -2, diff --git a/nx/include/switch/services/bsd.h b/nx/include/switch/services/bsd.h index e3f79ad9..89fbb56d 100644 --- a/nx/include/switch/services/bsd.h +++ b/nx/include/switch/services/bsd.h @@ -1,6 +1,6 @@ #pragma once -#include -#include +#include "types.h" +#include "kernel/tmem.h" struct bsd_sockaddr_in { u8 sin_len; diff --git a/nx/include/switch/services/fatal.h b/nx/include/switch/services/fatal.h index c75004b2..3a092e18 100644 --- a/nx/include/switch/services/fatal.h +++ b/nx/include/switch/services/fatal.h @@ -1,4 +1,4 @@ #pragma once -#include +#include "types.h" __attribute__((noreturn)) void fatalSimple(Result err); diff --git a/nx/include/switch/services/fs.h b/nx/include/switch/services/fs.h index 664efdad..6aa2ebaa 100644 --- a/nx/include/switch/services/fs.h +++ b/nx/include/switch/services/fs.h @@ -1,7 +1,7 @@ // Copyright 2017 plutoo #pragma once -#include -#include +#include "types.h" +#include "services/sm.h" // We use wrapped handles for type safety. diff --git a/nx/include/switch/services/hid.h b/nx/include/switch/services/hid.h index 8f28c820..4a0c40c5 100644 --- a/nx/include/switch/services/hid.h +++ b/nx/include/switch/services/hid.h @@ -1,8 +1,8 @@ #pragma once #include -#include -#include +#include "types.h" +#include "services/sm.h" // Begin enums and output structs diff --git a/nx/include/switch/services/nv.h b/nx/include/switch/services/nv.h index 739c98b5..b17d7d51 100644 --- a/nx/include/switch/services/nv.h +++ b/nx/include/switch/services/nv.h @@ -1,5 +1,5 @@ #pragma once -#include +#include "types.h" typedef enum { NVSERVTYPE_Default = -1, diff --git a/nx/include/switch/services/pm.h b/nx/include/switch/services/pm.h index 36c7298a..a0972af2 100644 --- a/nx/include/switch/services/pm.h +++ b/nx/include/switch/services/pm.h @@ -1,5 +1,5 @@ #pragma once -#include +#include "types.h" // Copyright 2017 plutoo Result pmdmntInitialize(void); diff --git a/nx/include/switch/services/sm.h b/nx/include/switch/services/sm.h index 4e6bdf1f..ce85da62 100644 --- a/nx/include/switch/services/sm.h +++ b/nx/include/switch/services/sm.h @@ -1,7 +1,7 @@ #pragma once -#include -#include -#include +#include "types.h" +#include "kernel/svc.h" +#include "ipc.h" typedef enum { ServiceType_Uninitialized, diff --git a/nx/include/switch/services/usb.h b/nx/include/switch/services/usb.h index 57b6d133..936697d8 100644 --- a/nx/include/switch/services/usb.h +++ b/nx/include/switch/services/usb.h @@ -1,6 +1,6 @@ #pragma once -#include -#include +#include "types.h" +#include "services/sm.h" /// usb:ds Switch-as-device<>host USB comms, see also here: http://switchbrew.org/index.php?title=USB_services diff --git a/nx/include/switch/services/vi.h b/nx/include/switch/services/vi.h index 5ea72247..556d6565 100644 --- a/nx/include/switch/services/vi.h +++ b/nx/include/switch/services/vi.h @@ -1,6 +1,6 @@ #pragma once -#include -#include +#include "types.h" +#include "services/sm.h" typedef struct { u64 display_id; diff --git a/nx/source/gfx/binder.c b/nx/source/gfx/binder.c index 15ffa42c..6c98152e 100644 --- a/nx/source/gfx/binder.c +++ b/nx/source/gfx/binder.c @@ -1,9 +1,9 @@ #include -#include -#include -#include -#include -#include +#include "types.h" +#include "result.h" +#include "ipc.h" +#include "kernel/detect.h" +#include "gfx/binder.h" void binderCreateSession(Binder *session, Handle sessionHandle, s32 id) { diff --git a/nx/source/gfx/buffer_producer.c b/nx/source/gfx/buffer_producer.c index 793f3e89..94311d8a 100644 --- a/nx/source/gfx/buffer_producer.c +++ b/nx/source/gfx/buffer_producer.c @@ -1,8 +1,8 @@ #include -#include -#include -#include -#include +#include "types.h" +#include "result.h" +#include "gfx/parcel.h" +#include "gfx/buffer_producer.h" // This implements the version of Android IGraphicBufferProducer used by Switch. diff --git a/nx/source/gfx/gfx.c b/nx/source/gfx/gfx.c index 1889e186..0abdcd94 100644 --- a/nx/source/gfx/gfx.c +++ b/nx/source/gfx/gfx.c @@ -1,14 +1,14 @@ #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include "types.h" +#include "result.h" +#include "services/fatal.h" +#include "services/vi.h" +#include "services/applet.h" +#include "services/nv.h" +#include "gfx/binder.h" +#include "gfx/buffer_producer.h" +#include "gfx/nvgfx.h" +#include "gfx/gfx.h" static bool g_gfxInitialized = 0; static ViDisplay g_gfxDisplay; diff --git a/nx/source/gfx/ioctl/channel.c b/nx/source/gfx/ioctl/channel.c index 923b0182..7b9c7a21 100644 --- a/nx/source/gfx/ioctl/channel.c +++ b/nx/source/gfx/ioctl/channel.c @@ -1,9 +1,9 @@ #include -#include -#include -#include -#include -#include +#include "types.h" +#include "result.h" +#include "services/nv.h" +#include "gfx/ioctl.h" +#include "gfx/nvioctl.h" Result nvioctlChannel_SetNvmapFd(u32 fd, u32 nvmap_fd) { struct { diff --git a/nx/source/gfx/ioctl/nvhost-as-gpu.c b/nx/source/gfx/ioctl/nvhost-as-gpu.c index a6406ffe..e60574e4 100644 --- a/nx/source/gfx/ioctl/nvhost-as-gpu.c +++ b/nx/source/gfx/ioctl/nvhost-as-gpu.c @@ -1,9 +1,9 @@ #include -#include -#include -#include -#include -#include +#include "types.h" +#include "result.h" +#include "services/nv.h" +#include "gfx/ioctl.h" +#include "gfx/nvioctl.h" Result nvioctlNvhostAsGpu_BindChannel(u32 fd, u32 channel_fd) { struct { diff --git a/nx/source/gfx/ioctl/nvhost-ctrl-gpu.c b/nx/source/gfx/ioctl/nvhost-ctrl-gpu.c index 77a3b3b8..3f80cf40 100644 --- a/nx/source/gfx/ioctl/nvhost-ctrl-gpu.c +++ b/nx/source/gfx/ioctl/nvhost-ctrl-gpu.c @@ -1,9 +1,9 @@ #include -#include -#include -#include -#include -#include +#include "types.h" +#include "result.h" +#include "services/nv.h" +#include "gfx/ioctl.h" +#include "gfx/nvioctl.h" Result nvioctlNvhostCtrlGpu_ZCullGetCtxSize(u32 fd, u32 *out) { Result rc = 0; diff --git a/nx/source/gfx/ioctl/nvhost-ctrl.c b/nx/source/gfx/ioctl/nvhost-ctrl.c index 2883200a..e88b4d69 100644 --- a/nx/source/gfx/ioctl/nvhost-ctrl.c +++ b/nx/source/gfx/ioctl/nvhost-ctrl.c @@ -1,9 +1,9 @@ #include -#include -#include -#include -#include -#include +#include "types.h" +#include "result.h" +#include "services/nv.h" +#include "gfx/ioctl.h" +#include "gfx/nvioctl.h" Result nvioctlNvhostCtrl_EventSignal(u32 fd, u32 event_id) { struct { diff --git a/nx/source/gfx/ioctl/nvmap.c b/nx/source/gfx/ioctl/nvmap.c index 75a0b40f..4ac70979 100644 --- a/nx/source/gfx/ioctl/nvmap.c +++ b/nx/source/gfx/ioctl/nvmap.c @@ -1,9 +1,9 @@ #include -#include -#include -#include -#include -#include +#include "types.h" +#include "result.h" +#include "services/nv.h" +#include "gfx/ioctl.h" +#include "gfx/nvioctl.h" Result nvioctlNvmap_Create(u32 fd, u32 size, u32 *nvmap_handle) { Result rc=0; diff --git a/nx/source/gfx/nvgfx.c b/nx/source/gfx/nvgfx.c index e16df87d..1ac0eeb3 100644 --- a/nx/source/gfx/nvgfx.c +++ b/nx/source/gfx/nvgfx.c @@ -1,14 +1,14 @@ #include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include "types.h" +#include "arm.h" +#include "result.h" +#include "kernel/svc.h" +#include "services/nv.h" +#include "gfx/binder.h" +#include "gfx/buffer_producer.h" +#include "gfx/nvioctl.h" +#include "gfx/nvgfx.h" //#include "nvgfx_gpu_gpfifo_data0_bin.h" diff --git a/nx/source/gfx/parcel.c b/nx/source/gfx/parcel.c index bde4fc18..56e31866 100644 --- a/nx/source/gfx/parcel.c +++ b/nx/source/gfx/parcel.c @@ -1,6 +1,6 @@ #include -#include -#include +#include "result.h" +#include "gfx/parcel.h" //This implements Android Parcel, hence names etc here are based on Android Parcel.cpp. diff --git a/nx/source/internal.h b/nx/source/internal.h index aadcd668..2e38b99e 100644 --- a/nx/source/internal.h +++ b/nx/source/internal.h @@ -1,7 +1,7 @@ #pragma once -#include -#include -#include +#include "arm.h" +#include "types.h" +#include "kernel/thread.h" #define THREADVARS_MAGIC 0x21545624 // !TV$ diff --git a/nx/source/kernel/detect.c b/nx/source/kernel/detect.c index 9752782c..d0ff6074 100644 --- a/nx/source/kernel/detect.c +++ b/nx/source/kernel/detect.c @@ -1,7 +1,7 @@ // Copyright 2017 plutoo -#include -#include -#include +#include "types.h" +#include "kernel/detect.h" +#include "kernel/svc.h" static bool g_IsAbove200; static bool g_IsAbove300; diff --git a/nx/source/kernel/jit.c b/nx/source/kernel/jit.c index 0dc2b39d..69096705 100644 --- a/nx/source/kernel/jit.c +++ b/nx/source/kernel/jit.c @@ -1,13 +1,13 @@ // Copyright 2018 plutoo #include -#include -#include -#include -#include -#include -#include -#include +#include "types.h" +#include "result.h" +#include "runtime/env.h" +#include "kernel/svc.h" +#include "kernel/detect.h" +#include "kernel/virtmem.h" +#include "kernel/jit.h" Result jitCreate(Jit* j, size_t size) { diff --git a/nx/source/kernel/mutex.c b/nx/source/kernel/mutex.c index 43c3748f..95c22719 100644 --- a/nx/source/kernel/mutex.c +++ b/nx/source/kernel/mutex.c @@ -1,6 +1,6 @@ // Copyright 2017 plutoo -#include -#include +#include "kernel/svc.h" +#include "kernel/mutex.h" #include "../internal.h" #define HAS_LISTENERS 0x40000000 diff --git a/nx/source/kernel/random.c b/nx/source/kernel/random.c index 8387f1ec..2087d2e2 100644 --- a/nx/source/kernel/random.c +++ b/nx/source/kernel/random.c @@ -7,12 +7,12 @@ */ #include -#include -#include -#include -#include -#include -#include +#include "types.h" +#include "result.h" +#include "services/fatal.h" +#include "kernel/mutex.h" +#include "kernel/svc.h" +#include "kernel/random.h" #define ROTL32(x, n) (((x) << (n)) | ((x) >> (32-(n)))) diff --git a/nx/source/kernel/rwlock.c b/nx/source/kernel/rwlock.c index 91229f74..e0863716 100644 --- a/nx/source/kernel/rwlock.c +++ b/nx/source/kernel/rwlock.c @@ -1,6 +1,6 @@ // Copyright 2018 plutoo -#include -#include +#include "kernel/mutex.h" +#include "kernel/rwlock.h" void rwlockReadLock(RwLock* r) { rmutexLock(&r->r); diff --git a/nx/source/kernel/shmem.c b/nx/source/kernel/shmem.c index 40a36989..db25070e 100644 --- a/nx/source/kernel/shmem.c +++ b/nx/source/kernel/shmem.c @@ -1,10 +1,10 @@ // Copyright 2017 plutoo #include -#include -#include -#include -#include -#include +#include "types.h" +#include "result.h" +#include "kernel/svc.h" +#include "kernel/virtmem.h" +#include "kernel/shmem.h" Result shmemCreate(SharedMemory* s, size_t size, Permission local_perm, Permission remote_perm) { diff --git a/nx/source/kernel/thread.c b/nx/source/kernel/thread.c index b6d4c80e..d47ad21d 100644 --- a/nx/source/kernel/thread.c +++ b/nx/source/kernel/thread.c @@ -1,11 +1,11 @@ // Copyright 2017 plutoo #include #include -#include -#include -#include -#include -#include +#include "types.h" +#include "result.h" +#include "kernel/svc.h" +#include "kernel/virtmem.h" +#include "kernel/thread.h" #include "../internal.h" extern const u8 __tdata_lma[]; diff --git a/nx/source/kernel/tmem.c b/nx/source/kernel/tmem.c index 338e4cb5..24dc66a1 100644 --- a/nx/source/kernel/tmem.c +++ b/nx/source/kernel/tmem.c @@ -1,10 +1,10 @@ // Copyright 2017 plutoo #include -#include -#include -#include -#include -#include +#include "types.h" +#include "result.h" +#include "kernel/svc.h" +#include "kernel/tmem.h" +#include "kernel/virtmem.h" Result tmemCreate(TransferMemory* t, size_t size, Permission perm) { diff --git a/nx/source/kernel/virtmem.c b/nx/source/kernel/virtmem.c index d24349da..2c791332 100644 --- a/nx/source/kernel/virtmem.c +++ b/nx/source/kernel/virtmem.c @@ -1,10 +1,10 @@ -#include -#include -#include -#include -#include -#include -#include +#include "types.h" +#include "result.h" +#include "services/fatal.h" +#include "kernel/detect.h" +#include "kernel/mutex.h" +#include "kernel/svc.h" +#include "kernel/virtmem.h" typedef struct { u64 start; diff --git a/nx/source/runtime/argv.c b/nx/source/runtime/argv.c index 1c41c61a..67250003 100644 --- a/nx/source/runtime/argv.c +++ b/nx/source/runtime/argv.c @@ -1,7 +1,7 @@ #include #include -#include -#include +#include "result.h" +#include "kernel/svc.h" // System globals we define here int __system_argc; diff --git a/nx/source/runtime/devices/console.c b/nx/source/runtime/devices/console.c index 5ba2a70d..622518c1 100644 --- a/nx/source/runtime/devices/console.c +++ b/nx/source/runtime/devices/console.c @@ -1,9 +1,9 @@ #include #include #include -#include -#include -#include +#include "runtime/devices/console.h" +#include "kernel/svc.h" +#include "gfx/gfx.h" #include "default_font_bin.h" diff --git a/nx/source/runtime/devices/fs_dev.c b/nx/source/runtime/devices/fs_dev.c index c2458c02..f5e99590 100644 --- a/nx/source/runtime/devices/fs_dev.c +++ b/nx/source/runtime/devices/fs_dev.c @@ -8,9 +8,9 @@ #include #include -#include -#include -#include +#include "runtime/devices/fs_dev.h" +#include "runtime/util/utf.h" +#include "services/fs.h" /*! @internal diff --git a/nx/source/runtime/devices/usb_comms.c b/nx/source/runtime/devices/usb_comms.c index 0137cb87..409ee04b 100644 --- a/nx/source/runtime/devices/usb_comms.c +++ b/nx/source/runtime/devices/usb_comms.c @@ -1,10 +1,10 @@ #include #include -#include -#include -#include -#include -#include +#include "types.h" +#include "result.h" +#include "services/fatal.h" +#include "services/usb.h" +#include "runtime/devices/usb_comms.h" static bool g_usbCommsInitialized = false; diff --git a/nx/source/runtime/dynamic.c b/nx/source/runtime/dynamic.c index ff06e688..f0b4794b 100644 --- a/nx/source/runtime/dynamic.c +++ b/nx/source/runtime/dynamic.c @@ -1,5 +1,5 @@ -#include -#include +#include "result.h" +#include "services/fatal.h" #include void __nx_dynamic(uintptr_t base, const Elf64_Dyn* dyn) diff --git a/nx/source/runtime/env.c b/nx/source/runtime/env.c index e4c668d2..764dbdc8 100644 --- a/nx/source/runtime/env.c +++ b/nx/source/runtime/env.c @@ -1,8 +1,8 @@ // Copyright 2018 plutoo #include -#include -#include -#include +#include "runtime/env.h" +#include "services/sm.h" +#include "services/fatal.h" static bool g_isNso = false; static Handle g_mainThreadHandle = INVALID_HANDLE; diff --git a/nx/source/runtime/init.c b/nx/source/runtime/init.c index f727dfcd..e10dcded 100644 --- a/nx/source/runtime/init.c +++ b/nx/source/runtime/init.c @@ -1,10 +1,10 @@ -#include -#include -#include -#include -#include -#include -#include +#include "types.h" +#include "runtime/env.h" +#include "services/sm.h" +#include "services/fatal.h" +#include "services/fs.h" +#include "services/hid.h" +#include "services/applet.h" void __nx_exit(int rc); diff --git a/nx/source/runtime/newlib.c b/nx/source/runtime/newlib.c index ffa31d13..0ea46267 100644 --- a/nx/source/runtime/newlib.c +++ b/nx/source/runtime/newlib.c @@ -4,11 +4,11 @@ #include #include #include "../internal.h" -#include -#include -#include -#include -#include +#include "types.h" +#include "runtime/env.h" +#include "kernel/mutex.h" +#include "services/fatal.h" +#include "result.h" void __attribute__((weak)) NORETURN __libnx_exit(int rc); diff --git a/nx/source/runtime/util/utf/decode_utf16.c b/nx/source/runtime/util/utf/decode_utf16.c index 3d0b1940..5b92c963 100644 --- a/nx/source/runtime/util/utf/decode_utf16.c +++ b/nx/source/runtime/util/utf/decode_utf16.c @@ -1,4 +1,4 @@ -#include +#include "runtime/util/utf.h" ssize_t decode_utf16(uint32_t *out, diff --git a/nx/source/runtime/util/utf/decode_utf8.c b/nx/source/runtime/util/utf/decode_utf8.c index f9158673..62cad20f 100644 --- a/nx/source/runtime/util/utf/decode_utf8.c +++ b/nx/source/runtime/util/utf/decode_utf8.c @@ -1,4 +1,4 @@ -#include +#include "runtime/util/utf.h" ssize_t decode_utf8(uint32_t *out, diff --git a/nx/source/runtime/util/utf/encode_utf16.c b/nx/source/runtime/util/utf/encode_utf16.c index 91878686..fa6431fa 100644 --- a/nx/source/runtime/util/utf/encode_utf16.c +++ b/nx/source/runtime/util/utf/encode_utf16.c @@ -1,4 +1,4 @@ -#include +#include "runtime/util/utf.h" ssize_t encode_utf16(uint16_t *out, diff --git a/nx/source/runtime/util/utf/encode_utf8.c b/nx/source/runtime/util/utf/encode_utf8.c index 97dcccff..d8b7e040 100644 --- a/nx/source/runtime/util/utf/encode_utf8.c +++ b/nx/source/runtime/util/utf/encode_utf8.c @@ -1,4 +1,4 @@ -#include +#include "runtime/util/utf.h" ssize_t encode_utf8(uint8_t *out, diff --git a/nx/source/runtime/util/utf/utf16_to_utf32.c b/nx/source/runtime/util/utf/utf16_to_utf32.c index 2a864778..f262811f 100644 --- a/nx/source/runtime/util/utf/utf16_to_utf32.c +++ b/nx/source/runtime/util/utf/utf16_to_utf32.c @@ -1,4 +1,4 @@ -#include +#include "runtime/util/utf.h" ssize_t utf16_to_utf32(uint32_t *out, diff --git a/nx/source/runtime/util/utf/utf16_to_utf8.c b/nx/source/runtime/util/utf/utf16_to_utf8.c index 3b812baa..c8e04af9 100644 --- a/nx/source/runtime/util/utf/utf16_to_utf8.c +++ b/nx/source/runtime/util/utf/utf16_to_utf8.c @@ -1,4 +1,4 @@ -#include +#include "runtime/util/utf.h" ssize_t utf16_to_utf8(uint8_t *out, diff --git a/nx/source/runtime/util/utf/utf32_to_utf16.c b/nx/source/runtime/util/utf/utf32_to_utf16.c index 495dc6e4..fab3fdb0 100644 --- a/nx/source/runtime/util/utf/utf32_to_utf16.c +++ b/nx/source/runtime/util/utf/utf32_to_utf16.c @@ -1,4 +1,4 @@ -#include +#include "runtime/util/utf.h" ssize_t diff --git a/nx/source/runtime/util/utf/utf32_to_utf8.c b/nx/source/runtime/util/utf/utf32_to_utf8.c index 9520d314..c6c78d74 100644 --- a/nx/source/runtime/util/utf/utf32_to_utf8.c +++ b/nx/source/runtime/util/utf/utf32_to_utf8.c @@ -1,4 +1,4 @@ -#include +#include "runtime/util/utf.h" ssize_t utf32_to_utf8(uint8_t *out, diff --git a/nx/source/runtime/util/utf/utf8_to_utf16.c b/nx/source/runtime/util/utf/utf8_to_utf16.c index 54f2f36c..5a52d34f 100644 --- a/nx/source/runtime/util/utf/utf8_to_utf16.c +++ b/nx/source/runtime/util/utf/utf8_to_utf16.c @@ -1,4 +1,4 @@ -#include +#include "runtime/util/utf.h" ssize_t utf8_to_utf16(uint16_t *out, diff --git a/nx/source/runtime/util/utf/utf8_to_utf32.c b/nx/source/runtime/util/utf/utf8_to_utf32.c index 162dfb33..26ac9b68 100644 --- a/nx/source/runtime/util/utf/utf8_to_utf32.c +++ b/nx/source/runtime/util/utf/utf8_to_utf32.c @@ -1,4 +1,4 @@ -#include +#include "runtime/util/utf.h" ssize_t utf8_to_utf32(uint32_t *out, diff --git a/nx/source/services/acc.c b/nx/source/services/acc.c index 264d5316..7a7787c4 100644 --- a/nx/source/services/acc.c +++ b/nx/source/services/acc.c @@ -1,6 +1,6 @@ -#include -#include -#include +#include "types.h" +#include "services/acc.h" +#include "services/sm.h" static Service g_accSrv; diff --git a/nx/source/services/apm.c b/nx/source/services/apm.c index 74a47b38..8e3c6716 100644 --- a/nx/source/services/apm.c +++ b/nx/source/services/apm.c @@ -1,8 +1,8 @@ -#include -#include -#include -#include -#include +#include "types.h" +#include "result.h" +#include "ipc.h" +#include "services/apm.h" +#include "services/sm.h" static Service g_apmSrv; static Service g_apmISession; diff --git a/nx/source/services/applet.c b/nx/source/services/applet.c index 909e48dd..888d9c31 100644 --- a/nx/source/services/applet.c +++ b/nx/source/services/applet.c @@ -1,12 +1,12 @@ #include -#include -#include -#include -#include -#include -#include -#include -#include +#include "types.h" +#include "result.h" +#include "ipc.h" +#include "services/fatal.h" +#include "services/applet.h" +#include "services/apm.h" +#include "services/sm.h" +#include "kernel/detect.h" __attribute__((weak)) u32 __nx_applet_type = AppletType_Default; __attribute__((weak)) bool __nx_applet_auto_notifyrunning = true; diff --git a/nx/source/services/bsd.c b/nx/source/services/bsd.c index bf5d3bf1..374dce7c 100644 --- a/nx/source/services/bsd.c +++ b/nx/source/services/bsd.c @@ -1,11 +1,11 @@ // Copyright 2017 plutoo -#include -#include -#include -#include -#include -#include -#include +#include "types.h" +#include "result.h" +#include "ipc.h" +#include "services/bsd.h" +#include "services/sm.h" +#include "kernel/shmem.h" +#include "kernel/rwlock.h" static Service g_bsdSrv; static Service g_bsdMonitor; diff --git a/nx/source/services/fatal.c b/nx/source/services/fatal.c index a2090033..99dbc0cc 100644 --- a/nx/source/services/fatal.c +++ b/nx/source/services/fatal.c @@ -1,11 +1,11 @@ // Copyright 2017 plutoo -#include -#include -#include -#include -#include -#include -#include +#include "types.h" +#include "result.h" +#include "ipc.h" +#include "services/fatal.h" +#include "services/sm.h" +#include "kernel/detect.h" +#include "kernel/svc.h" void fatalSimple(Result err) { Result rc = 0; diff --git a/nx/source/services/fs.c b/nx/source/services/fs.c index ff73d628..f23ec654 100644 --- a/nx/source/services/fs.c +++ b/nx/source/services/fs.c @@ -1,10 +1,10 @@ // Copyright 2017 plutoo #include -#include -#include -#include -#include -#include +#include "types.h" +#include "result.h" +#include "ipc.h" +#include "services/fs.h" +#include "services/sm.h" static Service g_fsSrv; diff --git a/nx/source/services/hid.c b/nx/source/services/hid.c index 07cca889..d6bcda67 100644 --- a/nx/source/services/hid.c +++ b/nx/source/services/hid.c @@ -1,12 +1,12 @@ #include -#include -#include -#include -#include -#include -#include -#include -#include +#include "types.h" +#include "result.h" +#include "ipc.h" +#include "services/applet.h" +#include "services/hid.h" +#include "services/sm.h" +#include "kernel/shmem.h" +#include "kernel/rwlock.h" static Service g_hidSrv; static Service g_hidIAppletResource; diff --git a/nx/source/services/nv.c b/nx/source/services/nv.c index cf8a496c..f0fd7fb0 100644 --- a/nx/source/services/nv.c +++ b/nx/source/services/nv.c @@ -1,12 +1,12 @@ #include -#include -#include -#include -#include -#include -#include -#include -#include +#include "types.h" +#include "result.h" +#include "ipc.h" +#include "services/applet.h" +#include "gfx/ioctl.h" +#include "services/nv.h" +#include "services/sm.h" +#include "kernel/tmem.h" static Service g_nvSrv; static size_t g_nvIpcBufferSize = 0; diff --git a/nx/source/services/pm.c b/nx/source/services/pm.c index b183be5a..fe61ad40 100644 --- a/nx/source/services/pm.c +++ b/nx/source/services/pm.c @@ -1,9 +1,9 @@ // Copyright 2017 plutoo -#include -#include -#include -#include -#include +#include "types.h" +#include "result.h" +#include "ipc.h" +#include "services/pm.h" +#include "services/sm.h" static Service g_pmdmntSrv; diff --git a/nx/source/services/sm.c b/nx/source/services/sm.c index 1ec234a0..c232d968 100644 --- a/nx/source/services/sm.c +++ b/nx/source/services/sm.c @@ -1,9 +1,9 @@ // Copyright 2017 plutoo -#include -#include -#include -#include -#include +#include "types.h" +#include "result.h" +#include "ipc.h" +#include "services/fatal.h" +#include "services/sm.h" static Handle g_smHandle = INVALID_HANDLE; diff --git a/nx/source/services/usb.c b/nx/source/services/usb.c index 6719ecec..07ea78d4 100644 --- a/nx/source/services/usb.c +++ b/nx/source/services/usb.c @@ -1,10 +1,10 @@ #include -#include -#include -#include -#include -#include -#include +#include "types.h" +#include "result.h" +#include "ipc.h" +#include "kernel/detect.h" +#include "services/usb.h" +#include "services/sm.h" #define TOTAL_INTERFACES 4 #define TOTAL_ENDPOINTS 15*2 diff --git a/nx/source/services/vi.c b/nx/source/services/vi.c index a720e9c5..6802c946 100644 --- a/nx/source/services/vi.c +++ b/nx/source/services/vi.c @@ -1,10 +1,10 @@ #include -#include -#include -#include -#include -#include -#include +#include "types.h" +#include "result.h" +#include "ipc.h" +#include "services/applet.h" +#include "services/vi.h" +#include "kernel/detect.h" static Service g_viSrv;