From 533d396761b630e372166f6f0522ba1c2d128d70 Mon Sep 17 00:00:00 2001 From: Michael Sevakis Date: Thu, 24 Apr 2014 04:09:18 -0400 Subject: Add multi-reader, single-writer locks to kernel. Any number of readers may be in the critical section at a time and writers are mutually exclusive to all other threads. They are a better choice when data is rarely modified but often read and multiple threads can safely access it for reading. Priority inheritance is fully implemented along with other changes to the kernel to fully support it on multiowner objects. This also cleans up priority code in the kernel and updates some associated structures in existing objects to the cleaner form. Currently doesn't add the mrsw_lock.[ch] files since they're not yet needed by anything but the supporting improvements are still useful. This includes a typed bitarray API (bitarray.h) which is pretty basic for now. Change-Id: Idbe43dcd9170358e06d48d00f1c69728ff45b0e3 Reviewed-on: http://gerrit.rockbox.org/801 Reviewed-by: Michael Sevakis Tested: Michael Sevakis --- firmware/kernel/include/queue.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'firmware/kernel/include/queue.h') diff --git a/firmware/kernel/include/queue.h b/firmware/kernel/include/queue.h index 1b404f8297..3f24598d5b 100644 --- a/firmware/kernel/include/queue.h +++ b/firmware/kernel/include/queue.h @@ -143,6 +143,8 @@ extern bool queue_peek(struct event_queue *q, struct queue_event *ev); #define QPEEK_FILTER_COUNT_MASK (0xffu) /* 0x00=1 filter, 0xff=256 filters */ #define QPEEK_FILTER_HEAD_ONLY (1u << 8) /* Ignored if no filters */ #define QPEEK_REMOVE_EVENTS (1u << 9) /* Remove or discard events */ +#define QPEEK_FILTER1(a) QPEEK_FILTER2((a), (a)) +#define QPEEK_FILTER2(a, b) (&(const long [2]){ (a), (b) }) extern bool queue_peek_ex(struct event_queue *q, struct queue_event *ev, unsigned int flags, -- cgit v1.2.3