hlekos: Fix for semaphore_t collision

This commit is contained in:
Stefanos Kornilios Mitsis Poiitidis
2025-05-07 10:18:05 +03:00
parent edeee9fd4f
commit e4814f3e51
3 changed files with 6 additions and 2 deletions

View File

@@ -24,7 +24,7 @@ void * maple_dev_status(maple_device*) {
maple_device_t * maple_enum_type(int n, uint32 func) {
return &dev;
}
namespace kos {
int sem_wait_timed(semaphore_t *sem, int timeout) {
auto count = sem->count.load();
@@ -54,6 +54,7 @@ int sem_signal(semaphore_t *sem) {
sem->count++;
return 0;
}
}
void sq_lock(void *dest) {

View File

@@ -32,6 +32,7 @@
\headerfile kos/sem.h
*/
namespace kos {
typedef struct semaphore {
std::atomic<int> initialized; /**< \brief Are we initialized? */
std::atomic<int> count; /**< \brief The semaphore count */
@@ -177,5 +178,7 @@ int sem_signal(semaphore_t *sem);
*/
int sem_count(semaphore_t *sem);
}
using namespace kos;
#endif /* __KOS_SEM_H */

View File

@@ -233,7 +233,7 @@ typedef struct {
/* Wait-ready semaphore: this will be signaled whenever the pvr_wait_ready()
call should be ready to return. */
semaphore_t ready_sem;
kos::semaphore_t ready_sem;
// Handle for the vblank interrupt
int vbl_handle;