From: Randy Dunlap <rdunlap@xenotime.net>
To: David VomLehn <dvomlehn@cisco.com>
Cc: to@dvomlehn-lnx2.corp.sa.net, netdev@vger.kernel.org
Subject: Re: [PATCH][RFC] Infrastructure for out-of-band parameter passing
Date: Tue, 8 Jun 2010 08:31:20 -0700 [thread overview]
Message-ID: <20100608083120.e92a7739.rdunlap@xenotime.net> (raw)
In-Reply-To: <20100608003049.GA29350@dvomlehn-lnx2.corp.sa.net>
On Mon, 7 Jun 2010 17:30:49 -0700 David VomLehn wrote:
> Infrastructure to support out of band/indirect passing of data to functions.
>
> It is useful at times to be able to pass data from one function to another
> nested many stack frames more deeply than the passing function. Doing so
> allows the interfaces in the intervening functions to be simpler, though
> this "hidden" information passing risks increased complexity. In cases
> where this is justified, this simple infrastructure provides the
> functionality.
>
> Out of band data passing is implemented by adding, for each instance,
> an element to the task_struct that serves as the pointer to the top
> of a OOB parameter stack. Data is made available by being pushed
> on the OOB parameter stack by a function, and accessed via the top
> element of the OOB parameter stack.
>
> Signed-off-by: David VomLehn (dvomlehn@cisco.com)
> ---
> include/linux/oobparam.h | 89 ++++++++++++++++++++++++++++++++++++++++++++++
> 1 files changed, 89 insertions(+), 0 deletions(-)
>
> diff --git a/include/linux/oobparam.h b/include/linux/oobparam.h
> new file mode 100644
> index 0000000..6eaa04c
> --- /dev/null
> +++ b/include/linux/oobparam.h
> @@ -0,0 +1,89 @@
...
> +
> +/**
> + * oobparam_push - push an out of band parameter frame on the OOB param stack
> + * @head Pointer to the OOB parameter stack top, which must be in the
> + * task structure.
> + * @frame Pointer to the OOB parameter frame, generally embedded in
> + * another structure
Need a colon ':' after the parameter names for kernel-doc notation:
* @head:
* @frame:
See Documentation/kernel-doc-nano-HOWTO.txt for info or ask me if you have
problems or questions.
Thanks.
> + */
> +static inline void oobparam_push(struct oobparam *top, struct oobparam *frame)
> +{
> + frame->next = top;
> + /* We need to ensure that the pointer in the frame is set prior to
> + * the pointer to the top in case we handle an interrupt in between
> + * the two stores. */
> + wmb();
> + top->next = frame;
> +}
---
~Randy
*** Remember to use Documentation/SubmitChecklist when testing your code ***
next prev parent reply other threads:[~2010-06-08 15:31 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-06-08 0:30 [PATCH][RFC] Infrastructure for out-of-band parameter passing David VomLehn
2010-06-08 15:31 ` Randy Dunlap [this message]
2010-06-08 18:36 ` David VomLehn
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=20100608083120.e92a7739.rdunlap@xenotime.net \
--to=rdunlap@xenotime.net \
--cc=dvomlehn@cisco.com \
--cc=netdev@vger.kernel.org \
--cc=to@dvomlehn-lnx2.corp.sa.net \
/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