mirror of
https://github.com/devkitPro/wut.git
synced 2026-05-06 13:25:37 -05:00
Add semaphore functions for gx2/dmae
This commit is contained in:
parent
2016e429c1
commit
aad202b56c
|
|
@ -1,5 +1,6 @@
|
|||
#pragma once
|
||||
#include <wut.h>
|
||||
#include <gx2/semaphore.h>
|
||||
|
||||
/**
|
||||
* \defgroup dmae_sync Synchronization
|
||||
|
|
@ -14,6 +15,12 @@ extern "C" {
|
|||
//! Timestamp for a DMAE operation.
|
||||
typedef uint64_t DMAETimeStamp;
|
||||
|
||||
DMAETimeStamp
|
||||
DMAEGetLastSubmittedTimeStamp(void);
|
||||
|
||||
DMAETimeStamp
|
||||
DMAEGetRetiredTimeStamp(void);
|
||||
|
||||
/**
|
||||
* Waits for a DMAE operation to complete.
|
||||
*
|
||||
|
|
@ -26,6 +33,16 @@ typedef uint64_t DMAETimeStamp;
|
|||
BOOL
|
||||
DMAEWaitDone(DMAETimeStamp timestamp);
|
||||
|
||||
uint32_t
|
||||
DMAEGetTimeout(void);
|
||||
|
||||
void
|
||||
DMAESetTimeout(uint32_t timeout);
|
||||
|
||||
void
|
||||
DMAESemaphore(GX2Semaphore *semaphore,
|
||||
GX2SemaphoreAction action);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -348,6 +348,12 @@ typedef enum GX2ScanTarget
|
|||
|
||||
WUT_ENUM_BITMASK_TYPE(GX2ScanTarget)
|
||||
|
||||
typedef enum GX2SemaphoreAction
|
||||
{
|
||||
GX2_SEMAPHORE_ACTION_WAIT = 0,
|
||||
GX2_SEMAPHORE_ACTION_SIGNAL = 1,
|
||||
} GX2SemaphoreAction;
|
||||
|
||||
typedef enum GX2ShaderMode
|
||||
{
|
||||
GX2_SHADER_MODE_UNIFORM_REGISTER = 0,
|
||||
|
|
|
|||
34
include/gx2/semaphore.h
Normal file
34
include/gx2/semaphore.h
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
#pragma once
|
||||
#include <wut.h>
|
||||
#include "enum.h"
|
||||
|
||||
/**
|
||||
* \defgroup gx2_semaphore Semaphore
|
||||
* \ingroup gx2
|
||||
* @{
|
||||
*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef uint64_t GX2Semaphore;
|
||||
|
||||
/**
|
||||
* Inserts a semaphore into the command stream.
|
||||
*
|
||||
* \param semaphore
|
||||
* Address of the semaphore. Must be aligned by \c 0x8.
|
||||
*
|
||||
* \param action
|
||||
* Semaphore operation to perform.
|
||||
*/
|
||||
void
|
||||
GX2SetSemaphore(GX2Semaphore *semaphore,
|
||||
GX2SemaphoreAction action);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
/** @} */
|
||||
Loading…
Reference in New Issue
Block a user