Fix macro change in libctru
This commit is contained in:
parent
3b64e25402
commit
e2778a45cf
@ -53,7 +53,7 @@ struct KMutexLinkedList;
|
||||
struct KPreemptionTimer;
|
||||
|
||||
/* 12 */
|
||||
typedef struct ALIGN(4) KAutoObject
|
||||
typedef struct CTR_ALIGN(4) KAutoObject
|
||||
{
|
||||
struct Vtable__KAutoObject *vtable;
|
||||
u32 refCount;
|
||||
@ -96,7 +96,7 @@ typedef struct KMutexLinkedListNode
|
||||
} KMutexLinkedListNode;
|
||||
|
||||
/* 1 */
|
||||
typedef struct ALIGN(4) KMutex
|
||||
typedef struct CTR_ALIGN(4) KMutex
|
||||
{
|
||||
KSynchronizationObject syncObject;
|
||||
KMutexLinkedListNode mutexListNode;
|
||||
@ -153,7 +153,7 @@ typedef struct KClassToken
|
||||
} KClassToken;
|
||||
|
||||
/* 44 */
|
||||
typedef struct ALIGN(4) Vtable__KAutoObject
|
||||
typedef struct CTR_ALIGN(4) Vtable__KAutoObject
|
||||
{
|
||||
void *field_0;
|
||||
void *field_4;
|
||||
@ -174,7 +174,7 @@ typedef struct KBaseInterruptEvent
|
||||
} KBaseInterruptEvent;
|
||||
|
||||
/* 55 */
|
||||
typedef struct ALIGN(4) Vtable__KBaseInterruptEvent
|
||||
typedef struct CTR_ALIGN(4) Vtable__KBaseInterruptEvent
|
||||
{
|
||||
struct KSchedulableInterruptEvent *(*handleInterruptEvent)(KBaseInterruptEvent *, u32);
|
||||
} Vtable__KBaseInterruptEvent;
|
||||
@ -210,7 +210,7 @@ typedef struct KThreadLinkedListNode
|
||||
|
||||
|
||||
/* 93 */
|
||||
typedef struct ALIGN(4) KPreemptionTimer
|
||||
typedef struct CTR_ALIGN(4) KPreemptionTimer
|
||||
{
|
||||
u32 nLimitedTicks;
|
||||
u32 timer;
|
||||
@ -219,7 +219,7 @@ typedef struct ALIGN(4) KPreemptionTimer
|
||||
} KPreemptionTimer;
|
||||
|
||||
/* 15 */
|
||||
typedef struct PACKED ALIGN(4) KThread
|
||||
typedef struct CTR_PACKED CTR_ALIGN(4) KThread
|
||||
{
|
||||
KSynchronizationObject syncObject;
|
||||
KTimeableInterruptEvent timeableInterruptEvent;
|
||||
@ -277,7 +277,7 @@ typedef enum ProcessStatus
|
||||
} ProcessStatus;
|
||||
|
||||
/* 3 */
|
||||
typedef struct ALIGN(4) HandleDescriptor
|
||||
typedef struct CTR_ALIGN(4) HandleDescriptor
|
||||
{
|
||||
u32 info;
|
||||
KAutoObject *pointer;
|
||||
@ -297,7 +297,7 @@ typedef struct KProcessHandleTable
|
||||
} KProcessHandleTable;
|
||||
|
||||
/* 4 */
|
||||
typedef struct ALIGN(4) KDebugThread
|
||||
typedef struct CTR_ALIGN(4) KDebugThread
|
||||
{
|
||||
KThread *linkedThread;
|
||||
bool usedSvcBreak;
|
||||
@ -355,7 +355,7 @@ typedef enum {
|
||||
} ExceptionEventType;
|
||||
|
||||
/* 6 */
|
||||
typedef struct ALIGN(4) KDebug
|
||||
typedef struct CTR_ALIGN(4) KDebug
|
||||
{
|
||||
KSynchronizationObject syncObject;
|
||||
KSendableInterruptEvent sendableInterruptEvent;
|
||||
@ -422,7 +422,7 @@ typedef struct KCodeSetMemDescriptor
|
||||
} KCodeSetMemDescriptor;
|
||||
|
||||
/* 5 */
|
||||
typedef struct PACKED ALIGN(4) KCodeSet
|
||||
typedef struct CTR_PACKED CTR_ALIGN(4) KCodeSet
|
||||
{
|
||||
KAutoObject autoObject;
|
||||
KCodeSetMemDescriptor textSection;
|
||||
@ -497,7 +497,7 @@ typedef struct KUserBindableInterruptEvent
|
||||
} KUserBindableInterruptEvent;
|
||||
|
||||
/* 14 */
|
||||
typedef struct ALIGN(4) KEvent
|
||||
typedef struct CTR_ALIGN(4) KEvent
|
||||
{
|
||||
KSynchronizationObject syncObject;
|
||||
KUserBindableInterruptEvent userBindableInterruptEvent;
|
||||
@ -601,7 +601,7 @@ typedef struct KMemoryBlock
|
||||
} KMemoryBlock;
|
||||
|
||||
/* 28 */
|
||||
typedef struct ALIGN(4) KScheduler
|
||||
typedef struct CTR_ALIGN(4) KScheduler
|
||||
{
|
||||
KSchedulableInterruptEvent interruptEvent;
|
||||
u32 threadSwitchAttempts;
|
||||
@ -619,7 +619,7 @@ typedef struct ALIGN(4) KScheduler
|
||||
} KScheduler;
|
||||
|
||||
/* 46 */
|
||||
typedef struct PACKED CodeSetInfo
|
||||
typedef struct CTR_PACKED CodeSetInfo
|
||||
{
|
||||
char name[8];
|
||||
u16 unknown_1;
|
||||
@ -639,7 +639,7 @@ typedef struct PACKED CodeSetInfo
|
||||
} CodeSetInfo;
|
||||
|
||||
/* 53 */
|
||||
typedef struct ALIGN(4) InterruptData
|
||||
typedef struct CTR_ALIGN(4) InterruptData
|
||||
{
|
||||
KBaseInterruptEvent *interruptEvent;
|
||||
bool disableUponReceipt;
|
||||
@ -740,7 +740,7 @@ typedef enum ResetType
|
||||
} ResetType;
|
||||
|
||||
/* 81 */
|
||||
typedef struct PACKED ALIGN(4) KTimer
|
||||
typedef struct CTR_PACKED CTR_ALIGN(4) KTimer
|
||||
{
|
||||
KSynchronizationObject syncObject;
|
||||
KTimeableInterruptEvent timeableInterruptEvent;
|
||||
@ -768,7 +768,7 @@ typedef KSchedulableInterruptEvent KThreadTerminationInterruptEvent;
|
||||
typedef KSchedulableInterruptEvent KThreadExitInterruptEvent;
|
||||
|
||||
/* 89 */
|
||||
typedef struct ALIGN(4) KInterruptEventMailbox
|
||||
typedef struct CTR_ALIGN(4) KInterruptEventMailbox
|
||||
{
|
||||
u32 mailboxID;
|
||||
KSendableInterruptEvent *first;
|
||||
@ -795,7 +795,7 @@ typedef enum LimitableResource
|
||||
} LimitableResource;
|
||||
|
||||
/* 99 */
|
||||
typedef struct ALIGN(4) CpuRegisters
|
||||
typedef struct CTR_ALIGN(4) CpuRegisters
|
||||
{
|
||||
u32 r[13];
|
||||
u32 sp;
|
||||
@ -809,7 +809,7 @@ typedef struct FpuRegisters
|
||||
{
|
||||
union
|
||||
{
|
||||
struct PACKED { double d[16]; };
|
||||
struct CTR_PACKED { double d[16]; };
|
||||
float s[32];
|
||||
};
|
||||
u32 fpscr;
|
||||
@ -974,7 +974,7 @@ typedef struct KEventInfo
|
||||
};
|
||||
} KEventInfo;
|
||||
|
||||
typedef struct ALIGN(0x1000) KCoreObjectContext
|
||||
typedef struct CTR_ALIGN(0x1000) KCoreObjectContext
|
||||
{
|
||||
KThread *volatile currentThread;
|
||||
union KProcess *volatile currentProcess;
|
||||
@ -1004,7 +1004,7 @@ extern KCoreContext *coreCtxs;
|
||||
|
||||
#define DEFINE_CONSOLE_SPECIFIC_STRUCTS(console, nbCores)
|
||||
/* 60 */
|
||||
typedef struct ALIGN(4) KProcessHwInfoN3DS
|
||||
typedef struct CTR_ALIGN(4) KProcessHwInfoN3DS
|
||||
{
|
||||
KObjectMutex mutex;
|
||||
u32 processTLBEntriesNeedToBeFlushedOnCore[4];
|
||||
@ -1023,7 +1023,7 @@ typedef struct ALIGN(4) KProcessHwInfoN3DS
|
||||
u32 *mmuTableVA;
|
||||
} KProcessHwInfoN3DS;
|
||||
|
||||
typedef struct ALIGN(4) KProcessHwInfoO3DS8x
|
||||
typedef struct CTR_ALIGN(4) KProcessHwInfoO3DS8x
|
||||
{
|
||||
KObjectMutex mutex;
|
||||
u32 processTLBEntriesNeedToBeFlushedOnCore[2];
|
||||
@ -1042,7 +1042,7 @@ typedef struct ALIGN(4) KProcessHwInfoO3DS8x
|
||||
u32 *mmuTableVA;
|
||||
} KProcessHwInfoO3DS8x;
|
||||
|
||||
typedef struct ALIGN(4) KProcessHwInfoO3DSPre8x
|
||||
typedef struct CTR_ALIGN(4) KProcessHwInfoO3DSPre8x
|
||||
{
|
||||
KObjectMutex mutex;
|
||||
u32 processTLBEntriesNeedToBeFlushedOnCore[2];
|
||||
|
@ -69,11 +69,11 @@ typedef s32 Result; ///< Function result.
|
||||
#define BIT(n) (1U<<(n))
|
||||
|
||||
/// Aligns a struct (and other types?) to m, making sure that the size of the struct is a multiple of m.
|
||||
#define ALIGN(m) __attribute__((aligned(m)))
|
||||
#define CTR_ALIGN(m) __attribute__((aligned(m)))
|
||||
/// Packs a struct (and other types?) so it won't include padding bytes.
|
||||
#define PACKED __attribute__((packed))
|
||||
#define USED __attribute__((used))
|
||||
#define UNUSED __attribute__((unused))
|
||||
#define CTR_PACKED __attribute__((packed))
|
||||
#define CTR_USED __attribute__((used))
|
||||
#define CTR_UNUSED __attribute__((unused))
|
||||
/// Packs a system version from its components.
|
||||
#define SYSTEM_VERSION(major, minor, revision) \
|
||||
(((major)<<24)|((minor)<<16)|((revision)<<8))
|
||||
|
@ -31,7 +31,7 @@
|
||||
KRecursiveLock dbgParamsLock = { NULL };
|
||||
u32 dbgParamWatchpointId, dbgParamDVA, dbgParamWCR, dbgParamContextId;
|
||||
|
||||
KSchedulableInterruptEvent *enableMonitorModeDebugging(KBaseInterruptEvent *this UNUSED, u32 interruptID UNUSED)
|
||||
KSchedulableInterruptEvent *enableMonitorModeDebugging(KBaseInterruptEvent *this CTR_UNUSED, u32 interruptID CTR_UNUSED)
|
||||
{
|
||||
coreBarrier();
|
||||
|
||||
@ -76,7 +76,7 @@ static void disableWatchpoint1(void)
|
||||
__asm__ __volatile__("mcr p14, 0, %[val], c0, c5, 5" :: [val] "r" (control));
|
||||
}
|
||||
|
||||
KSchedulableInterruptEvent *disableWatchpoint(KBaseInterruptEvent *this UNUSED, u32 interruptID UNUSED)
|
||||
KSchedulableInterruptEvent *disableWatchpoint(KBaseInterruptEvent *this CTR_UNUSED, u32 interruptID CTR_UNUSED)
|
||||
{
|
||||
coreBarrier();
|
||||
|
||||
@ -131,7 +131,7 @@ static void setWatchpoint1WithContextId(u32 DVA, u32 WCR, u32 contextId)
|
||||
__asm__ __volatile__("mcr p15, 0, %[val], c7, c10, 5" :: [val] "r" (0) : "memory"); // DMB
|
||||
}
|
||||
|
||||
KSchedulableInterruptEvent *setWatchpointWithContextId(KBaseInterruptEvent *this UNUSED, u32 interruptID UNUSED)
|
||||
KSchedulableInterruptEvent *setWatchpointWithContextId(KBaseInterruptEvent *this CTR_UNUSED, u32 interruptID CTR_UNUSED)
|
||||
{
|
||||
coreBarrier();
|
||||
|
||||
|
@ -46,7 +46,7 @@ struct KExtParameters
|
||||
CfwInfo cfwInfo;
|
||||
} kExtParameters = { .basePA = 0x12345678 }; // place this in .data
|
||||
|
||||
static ALIGN(1024) u32 g_L2Table[256] = {0};
|
||||
static CTR_ALIGN(1024) u32 g_L2Table[256] = {0};
|
||||
|
||||
void relocateAndSetupMMU(u32 coreId, u32 *L1Table)
|
||||
{
|
||||
|
@ -26,7 +26,7 @@
|
||||
|
||||
#include "svc/SetGpuProt.h"
|
||||
|
||||
Result SetGpuProt(bool prot UNUSED)
|
||||
Result SetGpuProt(bool prot CTR_UNUSED)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
@ -128,7 +128,7 @@ static const ServiceManagerNotificationEntry notifications[] = {
|
||||
{ 0x000, NULL },
|
||||
};
|
||||
|
||||
static u8 ALIGN(4) staticBufferForHbldr[0x400];
|
||||
static u8 CTR_ALIGN(4) staticBufferForHbldr[0x400];
|
||||
static_assert(ARGVBUF_SIZE > 2 * PATH_MAX, "Wrong 3DSX argv buffer size");
|
||||
|
||||
int main(void)
|
||||
|
@ -16,9 +16,9 @@
|
||||
#include "luma.h"
|
||||
|
||||
static MyThread processMonitorThread, taskRunnerThread;
|
||||
static u8 ALIGN(8) processDataBuffer[0x40 * sizeof(ProcessData)] = {0};
|
||||
static u8 ALIGN(8) exheaderInfoBuffer[6 * sizeof(ExHeader_Info)] = {0};
|
||||
static u8 ALIGN(8) threadStacks[2][THREAD_STACK_SIZE] = {0};
|
||||
static u8 CTR_ALIGN(8) processDataBuffer[0x40 * sizeof(ProcessData)] = {0};
|
||||
static u8 CTR_ALIGN(8) exheaderInfoBuffer[6 * sizeof(ExHeader_Info)] = {0};
|
||||
static u8 CTR_ALIGN(8) threadStacks[2][THREAD_STACK_SIZE] = {0};
|
||||
|
||||
// this is called after main exits
|
||||
void __wrap_exit(int rc)
|
||||
|
@ -44,7 +44,7 @@ typedef struct SessionManager
|
||||
} SessionManager;
|
||||
|
||||
//Page alignment is mandatory there
|
||||
extern u32 ALIGN(0x1000) staticBuffers[NB_STATIC_BUFFERS][0x1000/4];
|
||||
extern u32 CTR_ALIGN(0x1000) staticBuffers[NB_STATIC_BUFFERS][0x1000/4];
|
||||
|
||||
extern Handle PXISyncInterrupt, PXITransferMutex;
|
||||
extern Handle terminationRequestedEvent;
|
||||
|
@ -38,7 +38,7 @@ const char *serviceNames[10] =
|
||||
|
||||
const u32 nbStaticBuffersByService[10] = {0, 2, 2, 2, 2, 1, 4, 4, 4, 0};
|
||||
|
||||
u32 ALIGN(0x1000) staticBuffers[NB_STATIC_BUFFERS][0x400] = {{0}};
|
||||
u32 CTR_ALIGN(0x1000) staticBuffers[NB_STATIC_BUFFERS][0x400] = {{0}};
|
||||
|
||||
static inline void initPXI(void)
|
||||
{
|
||||
@ -95,9 +95,9 @@ static inline void exitPXI(void)
|
||||
PXIReset();
|
||||
}
|
||||
|
||||
static u8 ALIGN(8) receiverStack[THREAD_STACK_SIZE];
|
||||
static u8 ALIGN(8) senderStack[THREAD_STACK_SIZE];
|
||||
static u8 ALIGN(8) PXISRV11HandlerStack[THREAD_STACK_SIZE];
|
||||
static u8 CTR_ALIGN(8) receiverStack[THREAD_STACK_SIZE];
|
||||
static u8 CTR_ALIGN(8) senderStack[THREAD_STACK_SIZE];
|
||||
static u8 CTR_ALIGN(8) PXISRV11HandlerStack[THREAD_STACK_SIZE];
|
||||
static MyThread receiverThread = {0}, senderThread = {0}, PXISRV11HandlerThread = {0};
|
||||
|
||||
Result __sync_init(void);
|
||||
|
@ -4,7 +4,7 @@
|
||||
|
||||
#define _3GX_MAGIC (0x3230303024584733) /* "3GX$0002" */
|
||||
|
||||
typedef struct PACKED
|
||||
typedef struct CTR_PACKED
|
||||
{
|
||||
u32 authorLen;
|
||||
const char* authorMsg;
|
||||
@ -28,20 +28,20 @@ typedef struct PACKED
|
||||
u32 builtInSwapSaveLoadArgs[4];
|
||||
} _3gx_Infos;
|
||||
|
||||
typedef struct PACKED
|
||||
typedef struct CTR_PACKED
|
||||
{
|
||||
u32 count;
|
||||
u32 * titles;
|
||||
} _3gx_Targets;
|
||||
|
||||
typedef struct PACKED
|
||||
typedef struct CTR_PACKED
|
||||
{
|
||||
u32 nbSymbols;
|
||||
u32 symbolsOffset;
|
||||
u32 nameTableOffset;
|
||||
} _3gx_Symtable;
|
||||
|
||||
typedef struct PACKED
|
||||
typedef struct CTR_PACKED
|
||||
{
|
||||
u32 codeOffset;
|
||||
u32 rodataOffset;
|
||||
@ -55,7 +55,7 @@ typedef struct PACKED
|
||||
u32 swapLoadFuncOffset; // NOP terminated
|
||||
} _3gx_Executable;
|
||||
|
||||
typedef struct PACKED
|
||||
typedef struct CTR_PACKED
|
||||
{
|
||||
u64 magic;
|
||||
u32 version;
|
||||
|
@ -33,7 +33,7 @@
|
||||
#ifdef BOOTDIAG_ENABLED
|
||||
|
||||
static MyThread bootdiagThread;
|
||||
static u8 ALIGN(0x1000) bootdiagThreadStack[0x1000];
|
||||
static u8 CTR_ALIGN(0x1000) bootdiagThreadStack[0x1000];
|
||||
|
||||
#define BOOTDIAG_WAIT_TIME (3500 * 1000 * 1000u) // 2 seconds
|
||||
#define BOOTDIAG_DUMP_PLIST 1
|
||||
|
@ -35,7 +35,7 @@
|
||||
extern Handle preTerminationEvent;
|
||||
|
||||
static MyThread errDispThread;
|
||||
static u8 ALIGN(8) errDispThreadStack[0xD00];
|
||||
static u8 CTR_ALIGN(8) errDispThreadStack[0xD00];
|
||||
|
||||
static char userString[0x100 + 1] = {0};
|
||||
static char staticBuf[sizeof(userString)] = {0};
|
||||
|
@ -85,7 +85,7 @@
|
||||
typedef u32 gdbhio_time_t;
|
||||
typedef int gdbhio_mode_t;
|
||||
|
||||
struct PACKED ALIGN(4) gdbhio_stat {
|
||||
struct CTR_PACKED CTR_ALIGN(4) gdbhio_stat {
|
||||
u32 gst_dev; /* device */
|
||||
u32 gst_ino; /* inode */
|
||||
gdbhio_mode_t gst_mode; /* protection */
|
||||
|
@ -39,7 +39,7 @@ bool inputRedirectionEnabled = false;
|
||||
Handle inputRedirectionThreadStartedEvent;
|
||||
|
||||
static MyThread inputRedirectionThread;
|
||||
static u8 ALIGN(8) inputRedirectionThreadStack[0x4000];
|
||||
static u8 CTR_ALIGN(8) inputRedirectionThreadStack[0x4000];
|
||||
|
||||
MyThread *inputRedirectionCreateThread(void)
|
||||
{
|
||||
|
@ -174,7 +174,7 @@ u32 waitCombo(void)
|
||||
}
|
||||
|
||||
static MyThread menuThread;
|
||||
static u8 ALIGN(8) menuThreadStack[0x3000];
|
||||
static u8 CTR_ALIGN(8) menuThreadStack[0x3000];
|
||||
|
||||
static float batteryPercentage;
|
||||
static float batteryVoltage;
|
||||
|
@ -48,8 +48,8 @@ Menu debuggerMenu = {
|
||||
|
||||
static MyThread debuggerSocketThread;
|
||||
static MyThread debuggerDebugThread;
|
||||
static u8 ALIGN(8) debuggerSocketThreadStack[0x5000];
|
||||
static u8 ALIGN(8) debuggerDebugThreadStack[0x3000];
|
||||
static u8 CTR_ALIGN(8) debuggerSocketThreadStack[0x5000];
|
||||
static u8 CTR_ALIGN(8) debuggerDebugThreadStack[0x3000];
|
||||
|
||||
GDBServer gdbServer = { 0 };
|
||||
|
||||
|
@ -5,7 +5,7 @@
|
||||
TaskRunner g_taskRunner;
|
||||
|
||||
static MyThread taskRunnerThread;
|
||||
static u8 ALIGN(8) taskRunnerThreadStack[0x1000];
|
||||
static u8 CTR_ALIGN(8) taskRunnerThreadStack[0x1000];
|
||||
|
||||
static void taskRunnerNoOpFunction(void *args)
|
||||
{
|
||||
|
@ -22,7 +22,7 @@ SessionDataList sessionDataWaitingPortReadyList = {NULL, NULL};
|
||||
static SessionData sessionDataPool[76];
|
||||
static ProcessData processDataPool[64];
|
||||
|
||||
static u8 ALIGN(4) serviceAccessListStaticBuffer[0x110];
|
||||
static u8 CTR_ALIGN(4) serviceAccessListStaticBuffer[0x110];
|
||||
|
||||
void __ctru_exit(int rc) { (void)rc; } // needed to avoid linking error
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user