[PATCH 00/11] RFC: KBUS messaging subsystem

March 18th, 2011 - 12:50 pm ET by Tony Ibbs | Report spam
KBUS is a lightweight, Linux kernel mediated messaging system,
particularly intended for use in embedded environments.

It is meant to be simple to use and understand. It is designed to
provide predictable message delivery, deterministic message ordering,
and a guaranteed reply for each request. It is especially aimed at
situations where existing solutions, such as DBUS, cannot be used,
typically because of system constraints.

We have various customers using KBUS in real life, and believe it to
be useful. I had a showcase table for KBUS at the ELCE in Cambridge,
October last year, and there seemed to be interest.

The KBUS project home page is at http://kbus-messaging.org/, from
which there are links to the original Google code repository, more
documentation, and various userspace libraries.

There is a working repository with these patches applied to
Linux 2.6.37, available via:

git pull git://github.com/crazyscot/linux-2.6-kbus.git kbus-2.6.37

These patches have been applied in branch apply-patchset-20110318

In order to keep the size of individual patches down, the main code
has been split over several patches (0004..0009). With luck this
should also make it easier to understand what KBUS is trying to do.

Tony Ibbs (11):
Documentation for KBUS
KBUS external header file.
KBUS internal header file
KBUS main source file, basic device support only
KBUS add support for messages
KBUS add ability to receive messages only once
KBUS add ability to add devices at runtime
KBUS add Replier Bind Events
KBUS Replier Bind Event set-aside lists
KBUS report state to userspace
KBUS configuration and Makefile

Documentation/Kbus.txt | 1222 ++++++++++++
include/linux/kbus_defns.h | 666 +++++++
init/Kconfig | 2 +
ipc/Kconfig | 117 ++
ipc/Makefile | 9 +
ipc/kbus_internal.h | 723 +++++++
ipc/kbus_main.c | 4690 ++++++++++++++++++++++++++++++++++++++++++++
ipc/kbus_report.c | 256 +++
8 files changed, 7685 insertions(+), 0 deletions(-)
create mode 100644 Documentation/Kbus.txt
create mode 100644 include/linux/kbus_defns.h
create mode 100644 ipc/Kconfig
create mode 100644 ipc/kbus_internal.h
create mode 100644 ipc/kbus_main.c
create mode 100644 ipc/kbus_report.c

1.7.4.1

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
email Follow the discussionReplies 8 repliesReplies Make a reply

Replies

#1 Tony Ibbs
March 18th, 2011 - 12:50 pm ET | Report spam
Users do not always know how many KBUS devices will be needed when
the system starts. This allows a normal user to request an extra
device.

Signed-off-by: Tony Ibbs

include/linux/kbus_defns.h | 12 +++++++++++-
ipc/kbus_main.c | 17 +++++++++++++++++
2 files changed, 28 insertions(+), 1 deletions(-)

diff --git a/include/linux/kbus_defns.h b/include/linux/kbus_defns.h
index 9da72e4..4d3fcd5 100644
a/include/linux/kbus_defns.h
+++ b/include/linux/kbus_defns.h
@@ -611,8 +611,18 @@ struct kbus_replier_bind_event_data {
*/
#define KBUS_IOC_VERBOSE _IOWR(KBUS_IOC_MAGIC, 15, char *)

+/*
+ * NEWDEVICE - request another KBUS device (/dev/kbus<n>).
+ *
+ * The next device number (up to a maximum of 255) will be allocated.
+ *
+ * arg(out): __u32, the new device number (<n>)
+ * retval: 0 for success, negative for failure
+ */
+#define KBUS_IOC_NEWDEVICE _IOR(KBUS_IOC_MAGIC, 16, char *)
+
/* If adding another IOCTL, remember to increment the next number! */
-#define KBUS_IOC_MAXNR 15
+#define KBUS_IOC_MAXNR 16

#if !__KERNEL__ && defined(__cplusplus)
}
diff --git a/ipc/kbus_main.c b/ipc/kbus_main.c
index a75d2e1..48ba4b2 100644
a/ipc/kbus_main.c
+++ b/ipc/kbus_main.c
@@ -3532,6 +3532,23 @@ static long kbus_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
retval = kbus_set_verbosity(priv, arg);
break;

+ case KBUS_IOC_NEWDEVICE:
+ /*
+ * Request a new device
+ *
+ * arg out: the new device number
+ * return: 0 means OK, otherwise not OK.
+ */
+ kbus_maybe_dbg(priv->dev, "%u NEWDEVICE %d",
+ id, kbus_num_devices);
+ retval = kbus_setup_new_device(kbus_num_devices);
+ if (retval > 0) {
+ kbus_num_devices++;
+ retval = __put_user(kbus_num_devices - 1,
+ (u32 __user *) arg);
+ }
+ break;
+
default:
/* *Should* be redundant, if we got our range checks right */
retval = -ENOTTY;
1.7.4.1

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

Similar topics