Skip to content
This repository has been archived by the owner on Jan 7, 2023. It is now read-only.

Commit

Permalink
[SAOC Milestone 1, Task 2]
Browse files Browse the repository at this point in the history
+ Update README.
+ Document rtoslink.d hooks for the monitor implementation.
  • Loading branch information
hmmdyl committed Oct 15, 2021
1 parent f6a31d8 commit 67c8a84
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,13 @@ This is the light weight D runtime - it is a barebones runtime targeting ARM Cor
19. Static constructors and destructors (opt-in by version `LWDR_ModuleCtors`)
20. Shared static constructors and destructor (opt-in by version `LWDR_ModuleCtors`)
21. Module info (opt-in by version `LWDR_ModuleCtors`)
22. Object monitors (opt in by version `LWDR_Sync`)
23. Shared and sychronized (opt in by version `LWDR_Sync`)

### What doesn't work?
22. Exceptions and Throwables (experimental implementation was removed)
23. There is no GC implementation (primitive memory tracking is now available with `LWDR_TrackMem`, `RefCount!T` and `Unique!T` are now available)
24. Associative arrays
25. Object monitors (Milestone 1, Task 2)
26. Shared/synchronised (Milestone 1, Task 2)
24. Exceptions and Throwables (experimental implementation was removed)
25. There is no GC implementation (primitive memory tracking is now available with `LWDR_TrackMem`, `RefCount!T` and `Unique!T` are now available)
26. Associative arrays

### Which compilers can be used?
LDC works the best. DMD is not compatible. GDC will work but points 18-21 inclusive aren't supported.
Expand Down
7 changes: 7 additions & 0 deletions source/rtoslink.d
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,19 @@ these hooks depending on what is requested of the runtime by user code.

version(LWDR_Sync)
{
/// Called when LWDR wants to create a mutex.
void* rtosbackend_mutexInit();
/// Called when LWDR wants to destroy a mutex.
void rtosbackend_mutexDestroy(void*);
/// LWDR wants to lock a mutex (eg, via synchronized).
void rtosbackend_mutexLock(void*);
/// LWDR wants to unlock a mutex (eg, via synchronized).
void rtosbackend_mutexUnlock(void*);
/// Attempt to lock a mutex. Returns 0 if couldn't, 1 if locked.
int rtosbackend_mutexTryLock(void*);
/// LWDR stores a single, global mutex for its own implementation. This function creates it. Called on runtime start.
void* rtosbackend_globalMutexInit();
/// Destroy LWDR's global mutex. Called on runtime shutdown.
void rtosbackend_globalMutexDestroy(void*);
}
}

0 comments on commit 67c8a84

Please sign in to comment.