From: Tony Ibbs <tibs@tonyibbs.co.uk>
To: Linux-embedded <linux-embedded@vger.kernel.org>
Cc: Tibs at Kynesim <tibs@kynesim.co.uk>,
Richard Watts <rrw@kynesim.co.uk>,
Grant Likely <grant.likely@secretlab.ca>
Subject: [PATCH 3/5] Kconfig files and Makefile for KBUS
Date: Sun, 27 Feb 2011 18:11:46 +0000 [thread overview]
Message-ID: <97f70d8d0a9026658bb08d8bb4b054124553a0cb.1298829754.git.tibs@tonyibbs.co.uk> (raw)
In-Reply-To: <9d2ffc1567208d8890d7ef28f93f7a8914d753af.1298829754.git.tibs@tonyibbs.co.uk>
In-Reply-To: <cover.1298829754.git.tibs@tonyibbs.co.uk>
From: Tibs <tibs@tonyibbs.co.uk>
Amend the ipc Makefile.
Add an ipc Kconfig for KBUS.
Amend the init Kconfig appropriately.
Signed-off-by: Tony Ibbs <tibs@tonyibbs.co.uk>
---
init/Kconfig | 3 ++
ipc/Kconfig | 99 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
ipc/Makefile | 5 +++
3 files changed, 107 insertions(+), 0 deletions(-)
create mode 100644 ipc/Kconfig
diff --git a/init/Kconfig b/init/Kconfig
index c972899..a31a6fe 100644
--- a/init/Kconfig
+++ b/init/Kconfig
@@ -339,6 +339,8 @@ config AUDIT_TREE
depends on AUDITSYSCALL
select FSNOTIFY
+source "ipc/Kconfig"
+
source "kernel/irq/Kconfig"
menu "RCU Subsystem"
@@ -1305,3 +1307,4 @@ config PADATA
bool
source "kernel/Kconfig.locks"
+
diff --git a/ipc/Kconfig b/ipc/Kconfig
new file mode 100644
index 0000000..46ebcda
--- /dev/null
+++ b/ipc/Kconfig
@@ -0,0 +1,99 @@
+config KBUS
+ tristate "KBUS messaging system"
+ default m
+ ---help---
+ KBUS is a lightweight messaging system, particularly aimed
+ at embedded platforms. This option provides the kernel support
+ for mediating messages between client processes.
+
+ If you want KBUS support, you should say Y here.
+
+ This support can also be built as a module. If so, the module
+ will be called kbus.
+
+if KBUS
+
+config KBUS_DEBUG
+ bool "Make KBUS debugging messages available"
+ default y
+ ---help---
+ This is the master switch for KBUS debug kernel messages -
+ if turned off, all debug messages will be compiled out.
+
+ In order for debugging messages to be emitted, they must
+ be enabled per-device with the KBUS_IOC_VERBOSE ioctl,
+ or by default by CONFIG_KBUS_DEBUG_DEFAULT_VERBOSE.
+
+ If unsure, say Y.
+
+config KBUS_DEBUG_DEFAULT_VERBOSE
+ bool "Output KBUS debug messages by default"
+ depends on KBUS_DEBUG
+ default n
+ ---help---
+ This switch is the default setting for whether KBUS devices will
+ emit debugging messages. Note that debug messages may be turned
+ on and off per-device at runtime with the KBUS_IOC_VERBOSE ioctl.
+
+ If unsure, say N.
+
+config KBUS_DEF_NUM_DEVICES
+ int "Number of KBUS devices to auto-create"
+ default 1
+ range 1 KBUS_MAX_NUM_DEVICES
+ ---help---
+ This specifies the number of KBUS devices that will be automatically
+ created when the kbus subsystem initialises (when the module is
+ is loaded or the kernel booted, as appropriate).
+
+ If kbus is built as a module, this number may also be given as a
+ parameter, for example kbus_num_devices=5.
+
+config KBUS_MAX_NUM_DEVICES
+ int "Maximum number of KBUS devices"
+ default 256
+ range 1 2147483647
+ # We don't impose a limit on the max, so if you've got enough
+ # RAM the only practical limit will be the (int) minor count
+ # passed to __register_chrdev_region.
+ ---help---
+ Specify the maximum number of KBUS devices to support.
+ Note that this setting controls the size of an array of pointers
+ to in-kernel kbus structs; reducing it only saves a tiny amount
+ of RAM.
+
+config KBUS_DEF_MAX_MESSAGES
+ int "Default KBUS message queue size limit"
+ default 100
+ range 1 2147483647
+ ---help---
+ Specify the default recipient message queue size limit.
+ This default is applied to all recipients (clients) whenever they
+ open or reopen a KBUS device node.
+
+ Clients sending messages may specify their desired behaviour in
+ the event that any of the recipient(s)' message queues is full;
+ if a sender's own queue is full, it may not send a message
+ flagged as a Request. Refer to the documentation ("Queues filling
+ up") for details.
+
+ Clients may change their own queue size limits at any time with the
+ KBUS_IOC_MAXMSGS ioctl.
+
+config KBUS_MAX_UNSENT_UNBIND_MESSAGES
+ int "Maximum number of unsent KBUS unbind event messages"
+ default 1000
+ range 1 2147483647
+ ---help---
+ KBUS devices may request (by ioctl) that they want to receive
+ notifications when listeners unbind. If such a notification happens
+ at a time when the device's message queue is full, it is instead
+ saved internally and delivered later. This setting limits the number
+ of messages which may be queued internally in that way; if the
+ limit is reached, a special "there were more unbind events than
+ we were able to deliver" message is queued for that listener,
+ and no more internal events are sent to them until that message
+ has been delivered.
+
+endif # KBUS
+
diff --git a/ipc/Makefile b/ipc/Makefile
index 9075e17..3b330eb 100644
--- a/ipc/Makefile
+++ b/ipc/Makefile
@@ -2,6 +2,10 @@
# Makefile for the linux ipc.
#
+ifeq ($(CONFIG_KBUS_DEBUG),y)
+ CFLAGS_kbus.o = -DDEBUG
+endif
+
obj-$(CONFIG_SYSVIPC_COMPAT) += compat.o
obj-$(CONFIG_SYSVIPC) += util.o msgutil.o msg.o sem.o shm.o ipcns_notifier.o syscall.o
obj-$(CONFIG_SYSVIPC_SYSCTL) += ipc_sysctl.o
@@ -9,4 +13,5 @@ obj_mq-$(CONFIG_COMPAT) += compat_mq.o
obj-$(CONFIG_POSIX_MQUEUE) += mqueue.o msgutil.o $(obj_mq-y)
obj-$(CONFIG_IPC_NS) += namespace.o
obj-$(CONFIG_POSIX_MQUEUE_SYSCTL) += mq_sysctl.o
+obj-$(CONFIG_KBUS) += kbus.o
--
1.7.1
next prev parent reply other threads:[~2011-02-27 18:11 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-02-27 18:11 [PATCH 0/5] RFC: KBUS messaging subsystem Tony Ibbs
2011-02-27 18:11 ` [PATCH 1/5] Documentation for KBUS Tony Ibbs
2011-02-27 18:11 ` [PATCH 2/5] External header file " Tony Ibbs
2011-02-27 18:11 ` Tony Ibbs [this message]
2011-02-27 18:11 ` [PATCH 4/5] Internal " Tony Ibbs
2011-02-27 18:19 ` [PATCH 3/5] Kconfig files and Makefile " Randy Dunlap
2011-02-27 19:36 ` Tony Ibbs
2011-02-27 19:26 ` [PATCH 5/5] KBUS source file Tony Ibbs
2011-02-27 20:25 ` Randy Dunlap
2011-02-28 19:23 ` Sam Ravnborg
2011-02-28 22:25 ` Tony Ibbs
2011-03-01 5:42 ` Sam Ravnborg
2011-02-28 7:48 ` [PATCH 0/5] RFC: KBUS messaging subsystem Grant Likely
2011-02-28 7:52 ` Grant Likely
2011-02-28 19:13 ` Tony Ibbs
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=97f70d8d0a9026658bb08d8bb4b054124553a0cb.1298829754.git.tibs@tonyibbs.co.uk \
--to=tibs@tonyibbs.co.uk \
--cc=grant.likely@secretlab.ca \
--cc=linux-embedded@vger.kernel.org \
--cc=rrw@kynesim.co.uk \
--cc=tibs@kynesim.co.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).