mirror of
https://github.com/switchbrew/libnx.git
synced 2025-06-22 13:02:38 +02:00
Binder codestyle fix
This commit is contained in:
parent
a63ce5d8bc
commit
10246ebdbc
@ -8,19 +8,19 @@ typedef struct {
|
|||||||
Handle nativeHandle;
|
Handle nativeHandle;
|
||||||
size_t ipcBufferSize;
|
size_t ipcBufferSize;
|
||||||
bool hasTransactAuto;
|
bool hasTransactAuto;
|
||||||
} binderSession;
|
} Binder;
|
||||||
|
|
||||||
// binderExitSession will not close the sessionHandle since it's user-specified via binderCreateSession and may be used elsewhere.
|
// binderExitSession will not close the sessionHandle since it's user-specified via binderCreateSession and may be used elsewhere.
|
||||||
void binderCreateSession(binderSession *session, Handle sessionHandle, s32 ID);
|
void binderCreateSession(Binder *session, Handle sessionHandle, s32 ID);
|
||||||
Result binderInitSession(binderSession *session, u32 unk0);
|
Result binderInitSession(Binder *session, u32 unk0);
|
||||||
void binderExitSession(binderSession *session);
|
void binderExitSession(Binder *session);
|
||||||
|
|
||||||
Result binderTransactParcel(
|
Result binderTransactParcel(
|
||||||
binderSession *session, u32 code,
|
Binder *session, u32 code,
|
||||||
void* parcel_data, size_t parcel_data_size,
|
void* parcel_data, size_t parcel_data_size,
|
||||||
void* parcel_reply, size_t parcel_reply_size,
|
void* parcel_reply, size_t parcel_reply_size,
|
||||||
u32 flags);
|
u32 flags);
|
||||||
|
|
||||||
Result binderAdjustRefcount(binderSession *session, s32 addval, s32 type);
|
Result binderAdjustRefcount(Binder *session, s32 addval, s32 type);
|
||||||
Result binderGetNativeHandle(binderSession *session, u32 unk0, Handle *handle_out);
|
Result binderGetNativeHandle(Binder *session, u32 unk0, Handle *handle_out);
|
||||||
|
|
||||||
|
@ -105,7 +105,7 @@ enum {
|
|||||||
//...
|
//...
|
||||||
};
|
};
|
||||||
|
|
||||||
Result bufferProducerInitialize(binderSession *session);
|
Result bufferProducerInitialize(Binder *session);
|
||||||
void bufferProducerExit();
|
void bufferProducerExit();
|
||||||
|
|
||||||
Result bufferProducerRequestBuffer(s32 bufferIdx, bufferProducerGraphicBuffer *buf);
|
Result bufferProducerRequestBuffer(s32 bufferIdx, bufferProducerGraphicBuffer *buf);
|
||||||
|
@ -12,7 +12,7 @@ typedef struct {
|
|||||||
} Parcel;
|
} Parcel;
|
||||||
|
|
||||||
void parcelInitialize(Parcel *ctx);
|
void parcelInitialize(Parcel *ctx);
|
||||||
Result parcelTransact(binderSession *session, u32 code, Parcel *in_parcel, Parcel *reply_parcel);
|
Result parcelTransact(Binder *session, u32 code, Parcel *in_parcel, Parcel *reply_parcel);
|
||||||
|
|
||||||
void* parcelWriteData(Parcel *ctx, void* data, size_t data_size);
|
void* parcelWriteData(Parcel *ctx, void* data, size_t data_size);
|
||||||
void* parcelReadData(Parcel *ctx, void* data, size_t data_size);
|
void* parcelReadData(Parcel *ctx, void* data, size_t data_size);
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <switch.h>
|
#include <switch.h>
|
||||||
|
|
||||||
void binderCreateSession(binderSession *session, Handle sessionHandle, s32 id)
|
void binderCreateSession(Binder *session, Handle sessionHandle, s32 id)
|
||||||
{
|
{
|
||||||
memset(session, 0, sizeof(binderSession));
|
memset(session, 0, sizeof(Binder));
|
||||||
session->created = 1;
|
session->created = 1;
|
||||||
session->sessionHandle = sessionHandle;
|
session->sessionHandle = sessionHandle;
|
||||||
session->id = id;
|
session->id = id;
|
||||||
@ -11,7 +11,7 @@ void binderCreateSession(binderSession *session, Handle sessionHandle, s32 id)
|
|||||||
session->hasTransactAuto = 0;
|
session->hasTransactAuto = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
Result binderInitSession(binderSession *session, u32 unk0)
|
Result binderInitSession(Binder *session, u32 unk0)
|
||||||
{
|
{
|
||||||
Result rc = 0;
|
Result rc = 0;
|
||||||
|
|
||||||
@ -38,7 +38,7 @@ Result binderInitSession(binderSession *session, u32 unk0)
|
|||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
// When the output nativeHandle is 0 the binderSession ID is probably invalid.
|
// When the output nativeHandle is 0 the Binder ID is probably invalid.
|
||||||
if(session->nativeHandle == 0) {
|
if(session->nativeHandle == 0) {
|
||||||
rc = binderAdjustRefcount(session, -1, 1);
|
rc = binderAdjustRefcount(session, -1, 1);
|
||||||
rc = binderAdjustRefcount(session, -1, 0);
|
rc = binderAdjustRefcount(session, -1, 0);
|
||||||
@ -61,7 +61,7 @@ Result binderInitSession(binderSession *session, u32 unk0)
|
|||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
void binderExitSession(binderSession *session)
|
void binderExitSession(Binder *session)
|
||||||
{
|
{
|
||||||
if (!session->created) return;
|
if (!session->created) return;
|
||||||
|
|
||||||
@ -83,7 +83,7 @@ void binderExitSession(binderSession *session)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static Result _binderTransactParcel(
|
static Result _binderTransactParcel(
|
||||||
binderSession *session, u32 code,
|
Binder *session, u32 code,
|
||||||
void* parcel_data, size_t parcel_data_size,
|
void* parcel_data, size_t parcel_data_size,
|
||||||
void* parcel_reply, size_t parcel_reply_size,
|
void* parcel_reply, size_t parcel_reply_size,
|
||||||
u32 flags)
|
u32 flags)
|
||||||
@ -129,7 +129,7 @@ static Result _binderTransactParcel(
|
|||||||
}
|
}
|
||||||
|
|
||||||
static Result _binderTransactParcelAuto(
|
static Result _binderTransactParcelAuto(
|
||||||
binderSession *session, u32 code,
|
Binder *session, u32 code,
|
||||||
void* parcel_data, size_t parcel_data_size,
|
void* parcel_data, size_t parcel_data_size,
|
||||||
void* parcel_reply, size_t parcel_reply_size,
|
void* parcel_reply, size_t parcel_reply_size,
|
||||||
u32 flags)
|
u32 flags)
|
||||||
@ -196,7 +196,7 @@ static Result _binderTransactParcelAuto(
|
|||||||
}
|
}
|
||||||
|
|
||||||
Result binderTransactParcel(
|
Result binderTransactParcel(
|
||||||
binderSession *session, u32 code,
|
Binder *session, u32 code,
|
||||||
void* parcel_data, size_t parcel_data_size,
|
void* parcel_data, size_t parcel_data_size,
|
||||||
void* parcel_reply, size_t parcel_reply_size,
|
void* parcel_reply, size_t parcel_reply_size,
|
||||||
u32 flags)
|
u32 flags)
|
||||||
@ -211,7 +211,7 @@ Result binderTransactParcel(
|
|||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
Result binderAdjustRefcount(binderSession *session, s32 addval, s32 type)
|
Result binderAdjustRefcount(Binder *session, s32 addval, s32 type)
|
||||||
{
|
{
|
||||||
if (!session->created) return MAKERESULT(MODULE_LIBNX, LIBNX_NOTINITIALIZED);
|
if (!session->created) return MAKERESULT(MODULE_LIBNX, LIBNX_NOTINITIALIZED);
|
||||||
|
|
||||||
@ -250,7 +250,7 @@ Result binderAdjustRefcount(binderSession *session, s32 addval, s32 type)
|
|||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
Result binderGetNativeHandle(binderSession *session, u32 inval, Handle *handle_out)
|
Result binderGetNativeHandle(Binder *session, u32 inval, Handle *handle_out)
|
||||||
{
|
{
|
||||||
if (!session->created) return MAKERESULT(MODULE_LIBNX, LIBNX_NOTINITIALIZED);
|
if (!session->created) return MAKERESULT(MODULE_LIBNX, LIBNX_NOTINITIALIZED);
|
||||||
|
|
||||||
|
@ -25,9 +25,9 @@ enum {
|
|||||||
|
|
||||||
static char g_bufferProducer_InterfaceDescriptor[] = "android.gui.IGraphicBufferProducer";
|
static char g_bufferProducer_InterfaceDescriptor[] = "android.gui.IGraphicBufferProducer";
|
||||||
|
|
||||||
static binderSession *g_bufferProducerBinderSession;
|
static Binder *g_bufferProducerBinderSession;
|
||||||
|
|
||||||
Result bufferProducerInitialize(binderSession *session)
|
Result bufferProducerInitialize(Binder *session)
|
||||||
{
|
{
|
||||||
g_bufferProducerBinderSession = session;
|
g_bufferProducerBinderSession = session;
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -8,7 +8,7 @@ static ViLayer g_gfxLayer;
|
|||||||
static u8 g_gfxNativeWindow[0x100];
|
static u8 g_gfxNativeWindow[0x100];
|
||||||
static u64 g_gfxNativeWindow_Size;
|
static u64 g_gfxNativeWindow_Size;
|
||||||
static s32 g_gfxNativeWindow_ID;
|
static s32 g_gfxNativeWindow_ID;
|
||||||
static binderSession g_gfxBinderSession;
|
static Binder g_gfxBinderSession;
|
||||||
static s32 g_gfxCurrentBuffer = 0;
|
static s32 g_gfxCurrentBuffer = 0;
|
||||||
static s32 g_gfxCurrentProducerBuffer = 0;
|
static s32 g_gfxCurrentProducerBuffer = 0;
|
||||||
static bool g_gfx_ProducerConnected = 0;
|
static bool g_gfx_ProducerConnected = 0;
|
||||||
|
@ -16,7 +16,7 @@ void parcelInitialize(Parcel *ctx)
|
|||||||
ctx->capacity = sizeof(ctx->payload);
|
ctx->capacity = sizeof(ctx->payload);
|
||||||
}
|
}
|
||||||
|
|
||||||
Result parcelTransact(binderSession *session, u32 code, Parcel *in_parcel, Parcel *parcel_reply)
|
Result parcelTransact(Binder *session, u32 code, Parcel *in_parcel, Parcel *parcel_reply)
|
||||||
{
|
{
|
||||||
Result rc=0;
|
Result rc=0;
|
||||||
u8 inparcel[0x400];
|
u8 inparcel[0x400];
|
||||||
|
Loading…
Reference in New Issue
Block a user