diff --git a/demos/ARM7-LPC214x-GCC-minimal/chconf.h b/demos/ARM7-LPC214x-GCC-minimal/chconf.h
index 11081acc4..7db7c3618 100644
--- a/demos/ARM7-LPC214x-GCC-minimal/chconf.h
+++ b/demos/ARM7-LPC214x-GCC-minimal/chconf.h
@@ -107,6 +107,11 @@
* @note requires \p CH_USE_VIRTUAL_TIMERS.*/
//#define CH_USE_MESSAGES_EVENT
+/** Configuration option: If enabled then the threads have an option to serve
+ * messages by priority instead of FIFO order.
+ * @note requires \p CH_USE_MESSAGES.*/
+//#define CH_USE_MESSAGES_PRIORITY
+
/** Configuration option: if specified then the
* \p chThdGetExitEventSource() function is included in the kernel.
* @note requires \p CH_USE_MESSAGES.
diff --git a/demos/ARM7-LPC214x-GCC/chconf.h b/demos/ARM7-LPC214x-GCC/chconf.h
index 28db4b351..4889fb590 100644
--- a/demos/ARM7-LPC214x-GCC/chconf.h
+++ b/demos/ARM7-LPC214x-GCC/chconf.h
@@ -107,6 +107,11 @@
* @note requires \p CH_USE_VIRTUAL_TIMERS.*/
#define CH_USE_MESSAGES_EVENT
+/** Configuration option: If enabled then the threads have an option to serve
+ * messages by priority instead of FIFO order.
+ * @note requires \p CH_USE_MESSAGES.*/
+#define CH_USE_MESSAGES_PRIORITY
+
/** Configuration option: if specified then the
* \p chThdGetExitEventSource() function is included in the kernel.
* @note requires \p CH_USE_MESSAGES.
diff --git a/demos/AVR-AT90CANx-GCC/chconf.h b/demos/AVR-AT90CANx-GCC/chconf.h
index b4ddeeb05..d3f4491b2 100644
--- a/demos/AVR-AT90CANx-GCC/chconf.h
+++ b/demos/AVR-AT90CANx-GCC/chconf.h
@@ -108,6 +108,11 @@
* @note requires \p CH_USE_VIRTUAL_TIMERS.*/
#define CH_USE_MESSAGES_EVENT
+/** Configuration option: If enabled then the threads have an option to serve
+ * messages by priority instead of FIFO order.
+ * @note requires \p CH_USE_MESSAGES.*/
+#define CH_USE_MESSAGES_PRIORITY
+
/** Configuration option: if specified then the
* \p chThdGetExitEventSource() function is included in the kernel.
* @note requires \p CH_USE_MESSAGES.
diff --git a/demos/Win32-MSVS/chconf.h b/demos/Win32-MSVS/chconf.h
index 037e3d8a0..e4710e575 100644
--- a/demos/Win32-MSVS/chconf.h
+++ b/demos/Win32-MSVS/chconf.h
@@ -112,6 +112,11 @@
* @note requires \p CH_USE_VIRTUAL_TIMERS.*/
#define CH_USE_MESSAGES_EVENT
+/** Configuration option: If enabled then the threads have an option to serve
+ * messages by priority instead of FIFO order.
+ * @note requires \p CH_USE_MESSAGES.*/
+#define CH_USE_MESSAGES_PRIORITY
+
/** Configuration option: if specified then the
* \p chThdGetExitEventSource() function is included in the kernel.
* @note requires \p CH_USE_MESSAGES.
diff --git a/demos/Win32-MinGW/chconf.h b/demos/Win32-MinGW/chconf.h
index 3e741bb8c..115db4325 100644
--- a/demos/Win32-MinGW/chconf.h
+++ b/demos/Win32-MinGW/chconf.h
@@ -112,6 +112,11 @@
* @note requires \p CH_USE_VIRTUAL_TIMERS.*/
#define CH_USE_MESSAGES_EVENT
+/** Configuration option: If enabled then the threads have an option to serve
+ * messages by priority instead of FIFO order.
+ * @note requires \p CH_USE_MESSAGES.*/
+#define CH_USE_MESSAGES_PRIORITY
+
/** Configuration option: if specified then the
* \p chThdGetExitEventSource() function is included in the kernel.
* @note requires \p CH_USE_MESSAGES.
diff --git a/docs/Doxyfile b/docs/Doxyfile
index 24ab33ea9..1672eaa7c 100644
--- a/docs/Doxyfile
+++ b/docs/Doxyfile
@@ -4,7 +4,7 @@
# Project related configuration options
#---------------------------------------------------------------------------
PROJECT_NAME = ChibiOS/RT
-PROJECT_NUMBER = "0.5.0 beta"
+PROJECT_NUMBER = "0.5.1 beta"
OUTPUT_DIRECTORY = .
CREATE_SUBDIRS = NO
OUTPUT_LANGUAGE = English
@@ -243,6 +243,7 @@ PREDEFINED = __JUST_STUBS__ \
CH_USE_MESSAGES \
CH_USE_MESSAGES_TIMEOUT \
CH_USE_MESSAGES_EVENT \
+ CH_USE_MESSAGES_PRIORITY \
CH_USE_SEMSW \
CH_USE_DEBUG \
CH_USE_TRACE
diff --git a/docs/ch.txt b/docs/ch.txt
index 48995a155..257d3d89e 100644
--- a/docs/ch.txt
+++ b/docs/ch.txt
@@ -305,7 +305,10 @@
* be carryed in both directions. Data is not copyed between the client and
* server threads but just a pointer passed so the exchange is very time
* efficient.
- * Messages are always processed in FIFO order.
+ * Messages are usually processed in FIFO order but it is possible to process
+ * them in priority order by specifying \p P_MSGBYPRIO when creating a server
+ * thread, \p CH_USE_MESSAGES_PRIORITY must also be specified in \p chconf.h
+ * in order to enable the feature.
* Threads do not need to allocate space for message queues, the mechanism
* just requires two extra pointers in the \p Thread structure (the message
* queue header).
diff --git a/docs/index.html b/docs/index.html
index a4d9e32c2..ae0284cae 100644
--- a/docs/index.html
+++ b/docs/index.html
@@ -13,7 +13,7 @@ Homepage