Commit Graph

16 Commits

Author SHA1 Message Date
Philippe Gerum db712cc191 lib: rename evl_udelay() to evl_usleep()
evl_udelay() was an annoying misnomer for people with kernel
development background, as this relates to a busy wait loop, not to a
sleeping call, which evl_udelay() actually was.

Rename this call to evl_usleep(), converging to the glibc signature
for usleep(3) in the same move.
2020-01-21 14:52:21 +01:00
Philippe Gerum a7a084ea15 lib/sem: introduce compact creation calls
Zero-initialized semaphores timed on the monotonic clock is the
most common form used by applications. Allow people to write more
compact code by providing creation calls and static initializers aimed
at building these directly:

- evl_new_sem(), EVL_SEM_INITIALIZER() for zero-init semaphores
  timed on the monotonic clock.

- evl_new_sem_any() and EVL_SEM_ANY_INITIALIZER() usable for any
  initialization form, specifying the clock and init value.
2019-08-19 10:22:49 +02:00
Philippe Gerum bdc3aab501 lib/mutex: introduce compact creation calls
Normal (i.e. non-recursive) mutexes timed on the monotonic clock are
the most common form of locks used by applications. Allow people to
write more compact code by providing creation calls and static
initializers aimed at building these directly:

- evl_new_mutex(), EVL_MUTEX_INITIALIZER() for PI locks timed on the
  monotonic clock.

- evl_new_mutex_any() and EVL_MUTEX_ANY_INITIALIZER() for building any
  supported type of lock (normal/recursive), specifying the protocol
  (PI/PP) and the base clock.
2019-08-19 10:22:49 +02:00
Philippe Gerum a6044094db lib/mutex: add support for recursive type 2019-08-18 16:30:47 +02:00
Philippe Gerum f0d37f4730 treewide: API update
Improve consistency in naming and disambiguate some calls.
2019-06-13 10:31:04 +02:00
Philippe Gerum afe4355952 tests/helpers: fix assertion in new_thread() 2019-05-28 19:43:42 +02:00
Jorge Ramirez-Ortiz bad49d4470 lib, tests: access kernel elements and utilities via UAPI 2019-03-28 13:57:17 +01:00
Philippe Gerum eda7791f9b evl: rename evenless/ paths to evl/ 2019-03-10 16:25:02 +01:00
Philippe Gerum 0f2dbc68e8 lib/lock: rename as mutex for better description 2019-03-04 17:49:07 +01:00
Philippe Gerum 4736b427d3 lib/sem: convert wait states to using ungated monitors
At this chance, the API is simplified in the following ways:

- we don't provide pulse-mode semaphores anymore. Those should be
  provided by a higher level API as flags for instance (ungated
  monitors would support that easily by using the signedness bit of an
  event monitor value as such flag).

- threads now always wait by priority order. The rarely used FIFO wait
  mode was dropped.

Those changes make the @flags parameter to evl_new_sem() useless,
which allows to remove it from the signature.
2019-03-04 17:49:07 +01:00
Philippe Gerum 477ca7f58a lib/monitor: split lock/event interface headers 2019-03-04 17:49:07 +01:00
Philippe Gerum d7552edb62 lib/lock: disambiguate type for locking API 2019-03-04 17:49:07 +01:00
Philippe Gerum 38d9b8b68a lib/sem: give services basic names 2019-03-04 17:49:07 +01:00
Philippe Gerum f223f6f812 lib/monitor: give services basic names, clarify API 2019-03-04 17:49:07 +01:00
Philippe Gerum 19b9c84ddd lib/monitor, tests: provide specific init call for PP gate 2019-03-04 17:49:06 +01:00
Philippe Gerum 01a673ee1d tests: steal mutex from sleeper 2019-03-04 17:49:06 +01:00