public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Rusty Russell <rusty@rustcorp.com.au>
To: torvalds@transmeta.com
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH] Module parameters reimplementation 0/4
Date: Thu, 14 Nov 2002 15:23:00 +1100	[thread overview]
Message-ID: <20021114032456.3337E2C057@lists.samba.org> (raw)

I was going to feed this more slowly, to get feedback at every stage,
but I'm being mailbombed by angry developers 8(

Explanation: (Not that anyone read my previous ones, it seems)

1) MODULE_PARM() is not typesafe: it doesn't even check that the
   variable exists.  There are dozens of completely bogus uses in
   drivers.
2) Everyone who wants to implement module parameters *and* boot
   parameters had to implement MODULE_PARM() and __setup() and roll
   their own parsing.
3) MODULE_PARM() is not extensible.

This patch series introduces "PARAM(var, type, perm)".  This does
several things:
1) Checks the type of "var" matches "type".
2) If built-in, adds a boot parameter called <modulename>.var.
3) If modular, adds a module parameter called var.
4) The third arg is for exposure through sysfs once it stabilizes, 000
   means don't expose.

PARAM() is implemented in terms of PARAM_CALL(), similar to __setup()
except it (depending on the perm field) might be readable too.

Types "short", "ushort", "int", "ulong", "bool", "invbool" etc are
implemented pre-canned.  You can define your own, see linux/params.h
for how.

Finally, if you do not use your own types, PARAM() can be #defined
into a MODULE_PARM statement for 2.4 kernels (ie. backwards
compatible).  Patch 4/4 also translates old-style MODULE_PARM() into
PARAMs at load time, for existing modules.

Why now?
--------
This kind of change shows why you need an in-kernel linker: this kind
of change would break userspace with the current modutils.

Sorry for any inconvenience,
Rusty.
--
  Anyone who quotes me in their sig is an idiot. -- Rusty Russell.

             reply	other threads:[~2002-11-14  3:18 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-11-14  4:23 Rusty Russell [this message]
2002-11-14  4:16 ` [PATCH] Module parameters reimplementation 0/4 Jeff Garzik
2002-11-14  5:45   ` Rusty Russell
2002-11-14 15:03 ` Andrey Panin
2002-11-14 17:35   ` Rusty Russell
  -- strict thread matches above, loose matches on Subject: below --
2002-11-14 12:39 Matthew Wilcox
2002-11-14 17:33 ` Rusty Russell

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=20021114032456.3337E2C057@lists.samba.org \
    --to=rusty@rustcorp.com.au \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@transmeta.com \
    /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