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/processes.h
2020-04-25 13:42:10 +01:00

49 lines
1.1 KiB
C

/*
processes.h
(c) TuxSH, 2017-2020
This is part of 3ds_sm, which is licensed under the MIT license (see LICENSE for details).
*/
#pragma once
#include "common.h"
struct ProcessDataList;
typedef struct ProcessData
{
struct ProcessData *prev, *next;
struct ProcessDataList *parent;
u32 pid;
Handle notificationSemaphore;
char (*serviceAccessList)[8];
u32 serviceAccessListSize;
bool notificationEnabled;
// Circular buffer
u16 receivedNotificationIndex;
u16 pendingNotificationIndex;
u16 nbPendingNotifications;
u32 pendingNotifications[16];
u16 nbSubscribed;
u32 subscribedNotifications[17];
} ProcessData;
typedef struct ProcessDataList
{
ProcessData *first, *last;
} ProcessDataList;
extern ProcessDataList processDataInUseList, freeProcessDataList;
ProcessData *findProcessData(u32 pid);
ProcessData *doRegisterProcess(u32 pid, char (*serviceAccessList)[8], u32 serviceAccessListSize);
Result RegisterProcess(u32 pid, char (*serviceAccessList)[8], u32 serviceAccessListSize);
Result UnregisterProcess(u32 pid);