This repository has been archived on 2022-05-31. You can view files and clone it, but cannot push or open issues or pull requests.
Luma3DS-3GX/sysmodules/sm/source/common.h
2017-11-02 15:11:55 +01:00

52 lines
1.1 KiB
C

/*
common.h
(c) TuxSH, 2017
This is part of 3ds_sm, which is licensed under the MIT license (see LICENSE for details).
*/
#pragma once
#include <3ds.h>
#include "memory.h"
#define IS_PRE_7X (osGetFirmVersion() < SYSTEM_VERSION(2, 39, 4))
#define IS_PRE_93 (osGetFirmVersion() < SYSTEM_VERSION(2, 48, 3))
extern u32 nbSection0Modules;
extern Handle resumeGetServiceHandleOrPortRegisteredSemaphore;
struct SessionDataList;
typedef struct SessionData
{
struct SessionData *prev, *next;
struct SessionDataList *parent;
u32 pid;
u32 replayCmdbuf[4];
Handle busyClientPortHandle;
Handle handle;
bool isSrvPm;
} SessionData;
typedef struct SessionDataList
{
SessionData *first, *last;
} SessionDataList;
extern SessionDataList sessionDataInUseList, freeSessionDataList;
extern SessionDataList sessionDataWaitingForServiceOrPortRegisterList, sessionDataToWakeUpAfterServiceOrPortRegisterList;
extern SessionDataList sessionDataWaitingPortReadyList;
static inline void panic(void)
{
svcBreak(USERBREAK_PANIC);
for(;;) svcSleepThread(0);
}
static inline void assertSuccess(Result res)
{
if(R_FAILED(res))
panic();
}