The NetBSD Project

CVS log for src/sys/sys/module_hook.h

[BACK] Up to [cvs.NetBSD.org] / src / sys / sys

Request diff between arbitrary revisions


Keyword substitution: kv
Default branch: MAIN


Revision 1.7: download - view: text, markup, annotated - select for diffs
Sun May 12 10:38:03 2024 UTC (7 months ago) by rillig
Branches: MAIN
CVS tags: perseant-exfatfs-base-20240630, perseant-exfatfs-base, perseant-exfatfs, HEAD
Diff to: previous 1.6: preferred, colored
Changes since revision 1.6: +5 -5 lines
sys/module_hook.h: remove CONSTCOND comment from do-while-0 loop

Lint doesn't need this comment anymore, as there is nothing surprising
or unusual about this idiom.

Revision 1.3.4.3: download - view: text, markup, annotated - select for diffs
Wed Apr 8 14:09:03 2020 UTC (4 years, 8 months ago) by martin
Branches: phil-wifi
Diff to: previous 1.3.4.2: preferred, colored; branchpoint 1.3: preferred, colored; next MAIN 1.4: preferred, colored
Changes since revision 1.3.4.2: +33 -81 lines
Merge changes from current as of 20200406

Revision 1.6: download - view: text, markup, annotated - select for diffs
Thu Dec 12 22:55:20 2019 UTC (5 years ago) by pgoyette
Branches: MAIN
CVS tags: thorpej-ifq-base, thorpej-ifq, thorpej-i2c-spi-conf2-base, thorpej-i2c-spi-conf2, thorpej-i2c-spi-conf-base, thorpej-i2c-spi-conf, thorpej-futex2-base, thorpej-futex2, thorpej-futex-base, thorpej-futex, thorpej-cfargs2-base, thorpej-cfargs2, thorpej-cfargs-base, thorpej-cfargs, thorpej-altq-separation-base, thorpej-altq-separation, phil-wifi-20200421, phil-wifi-20200411, phil-wifi-20200406, netbsd-10-base, netbsd-10-0-RELEASE, netbsd-10-0-RC6, netbsd-10-0-RC5, netbsd-10-0-RC4, netbsd-10-0-RC3, netbsd-10-0-RC2, netbsd-10-0-RC1, netbsd-10, is-mlppp-base, is-mlppp, cjep_sun2x-base1, cjep_sun2x-base, cjep_sun2x, cjep_staticlib_x-base1, cjep_staticlib_x-base, cjep_staticlib_x, bouyer-xenpvh-base2, bouyer-xenpvh-base1, bouyer-xenpvh-base, bouyer-xenpvh, bouyer-sunxi-drm-base, bouyer-sunxi-drm, ad-namecache-base3, ad-namecache-base2, ad-namecache-base1, ad-namecache-base, ad-namecache
Diff to: previous 1.5: preferred, colored
Changes since revision 1.5: +21 -75 lines
Eliminate per-hook duplication of common code as suggested by
(and with major contributions from) riastradh@

Welcome to 9.99.23

Revision 1.5: download - view: text, markup, annotated - select for diffs
Thu Dec 12 02:15:43 2019 UTC (5 years ago) by pgoyette
Branches: MAIN
Diff to: previous 1.4: preferred, colored
Changes since revision 1.4: +17 -20 lines
Rather than keeping a separate mutex, condvar, and pserialize for each
module hook, we can share a common set of synchronization structures.
This cuts the amount of cacheline_aligned data for these structures by
50%.

Note that we still have a per-hook localcount, since we need to count
individual references.

As discussed with riastradh@

Welcome to 9.99.22 !

Revision 1.4: download - view: text, markup, annotated - select for diffs
Tue Dec 3 13:48:25 2019 UTC (5 years ago) by pgoyette
Branches: MAIN
Diff to: previous 1.3: preferred, colored
Changes since revision 1.3: +17 -8 lines
Adapt to use the new atomic_* operations.  As discussed with
riastradh@ in private Email.

Revision 1.3.4.2: download - view: text, markup, annotated - select for diffs
Mon Jun 10 22:09:57 2019 UTC (5 years, 6 months ago) by christos
Branches: phil-wifi
Diff to: previous 1.3.4.1: preferred, colored; branchpoint 1.3: preferred, colored
Changes since revision 1.3.4.1: +150 -0 lines
Sync with HEAD

Revision 1.3.4.1
Fri Mar 1 11:06:57 2019 UTC (5 years, 9 months ago) by christos
Branches: phil-wifi
FILE REMOVED
Changes since revision 1.3: +0 -150 lines
file module_hook.h was added on branch phil-wifi on 2019-06-10 22:09:57 +0000

Revision 1.3: download - view: text, markup, annotated - select for diffs
Fri Mar 1 11:06:57 2019 UTC (5 years, 9 months ago) by pgoyette
Branches: MAIN
CVS tags: phil-wifi-20191119, phil-wifi-20190609, netbsd-9-base, netbsd-9-4-RELEASE, netbsd-9-3-RELEASE, netbsd-9-2-RELEASE, netbsd-9-1-RELEASE, netbsd-9-0-RELEASE, netbsd-9-0-RC2, netbsd-9-0-RC1, netbsd-9, isaki-audio2-base, isaki-audio2
Branch point for: phil-wifi
Diff to: previous 1.2: preferred, colored
Changes since revision 1.2: +5 -5 lines
Rename the MODULE_*_HOOK() macros to MODULE_HOOK_*() as briefly
discussed on irc.

NFCI intended.

Ride the earlier kernel bump - it;s getting crowded.

Revision 1.2: download - view: text, markup, annotated - select for diffs
Sun Jan 27 02:08:50 2019 UTC (5 years, 10 months ago) by pgoyette
Branches: MAIN
Diff to: previous 1.1: preferred, colored
Changes since revision 1.1: +150 -0 lines
Merge the [pgoyette-compat] branch

Revision 1.1.2.16: download - view: text, markup, annotated - select for diffs
Wed Jan 23 03:40:08 2019 UTC (5 years, 10 months ago) by pgoyette
Branches: pgoyette-compat
CVS tags: pgoyette-compat-merge-20190127
Diff to: previous 1.1.2.15: preferred, colored; branchpoint 1.1: preferred, colored; next MAIN 1.2: preferred, colored
Changes since revision 1.1.2.15: +5 -2 lines
Improve a comment

Revision 1.1.2.15: download - view: text, markup, annotated - select for diffs
Wed Jan 23 03:34:15 2019 UTC (5 years, 10 months ago) by pgoyette
Branches: pgoyette-compat
Diff to: previous 1.1.2.14: preferred, colored; branchpoint 1.1: preferred, colored
Changes since revision 1.1.2.14: +6 -10 lines
Convert the macros for setting and unsetting a hook to generate
in-line code rather than using an intermediary hook##set routine.
Hooks are set and unset only in one place, so the intermediary
routine provides no benefit.  IMHO using the macro at the point-
of-call is more readable than using it elsewhere in the code and
then calling the generated intermediary routine (for which you
won't even find its declaration or definition unless you remember
to search for the HOOK_SET macro instead).

NFC intended, will verify with a bulk build and an atf test run.

Revision 1.1.2.14: download - view: text, markup, annotated - select for diffs
Tue Jan 22 07:42:42 2019 UTC (5 years, 10 months ago) by pgoyette
Branches: pgoyette-compat
Diff to: previous 1.1.2.13: preferred, colored; branchpoint 1.1: preferred, colored
Changes since revision 1.1.2.13: +9 -19 lines
Convert the MODULE_{,VOID_}HOOK_CALL macros to do everything in-line
rather than defining an intermediate hook##call function.  Almost
all of the hooks are called only once, and although we lose the
ability of doing things like

	if (MODULE_HOOK_CALL(...) == 0) ...

we simplify things quite a bit.  With this change, we no longer need
to have both declaration and definition macros, and the definition
no longer needs to have both prototype argument list and a "real"
argument list.

FWIW, the above if now needs to written as

	int ret;

	MODULE_HOOK_CALL(..., ret);
	if (ret == 0) ...

with appropriate use of braces {}.

Revision 1.1.2.13: download - view: text, markup, annotated - select for diffs
Mon Jan 21 06:49:28 2019 UTC (5 years, 10 months ago) by pgoyette
Branches: pgoyette-compat
Diff to: previous 1.1.2.12: preferred, colored; branchpoint 1.1: preferred, colored
Changes since revision 1.1.2.12: +1 -5 lines
No need to declare the hook_call() function for void hooks.  So
remove and simplify.

Revision 1.1.2.12: download - view: text, markup, annotated - select for diffs
Fri Jan 18 00:01:02 2019 UTC (5 years, 10 months ago) by pgoyette
Branches: pgoyette-compat
Diff to: previous 1.1.2.11: preferred, colored; branchpoint 1.1: preferred, colored
Changes since revision 1.1.2.11: +7 -6 lines
Don't restrict hooks to having only int or void types.  Pass the hook's
type to the various macros, as needed.

Allows us to reduce diffs to original in at least one or two places (we
no longer have to provide an additional parameter to the hook routine
for returning a non-int return value).

Revision 1.1.2.11: download - view: text, markup, annotated - select for diffs
Thu Jan 17 21:32:42 2019 UTC (5 years, 10 months ago) by pgoyette
Branches: pgoyette-compat
Diff to: previous 1.1.2.10: preferred, colored; branchpoint 1.1: preferred, colored
Changes since revision 1.1.2.10: +5 -5 lines
The return value of a hook is not necessarily an error code, so
rename the variable appropriately.

NFCI

Revision 1.1.2.10: download - view: text, markup, annotated - select for diffs
Mon Jan 14 13:34:28 2019 UTC (5 years, 10 months ago) by pgoyette
Branches: pgoyette-compat
Diff to: previous 1.1.2.9: preferred, colored; branchpoint 1.1: preferred, colored
Changes since revision 1.1.2.9: +33 -5 lines
Create a variant of the HOOK macros that handles hook routines of
type void, and use them where appropriate.

Revision 1.1.2.9: download - view: text, markup, annotated - select for diffs
Sun Jan 13 10:49:51 2019 UTC (5 years, 10 months ago) by pgoyette
Branches: pgoyette-compat
Diff to: previous 1.1.2.8: preferred, colored; branchpoint 1.1: preferred, colored
Changes since revision 1.1.2.8: +7 -68 lines
Remove the HOOK2 versions of the MODULE_HOOK macros.  There were
only a few uses, and using them led to some lack of clarity in the
code.  Instead, we now use two separate hooks, with names that
make it clear(er) what we're doing.

This also positions us to start unraveling some of the rtsock_50
mess, which will need (at least) five hooks.

Revision 1.1.2.8: download - view: text, markup, annotated - select for diffs
Fri Jan 11 06:18:17 2019 UTC (5 years, 11 months ago) by pgoyette
Branches: pgoyette-compat
Diff to: previous 1.1.2.7: preferred, colored; branchpoint 1.1: preferred, colored
Changes since revision 1.1.2.7: +3 -3 lines
Separate macro arguments with <comma><space> for readability.

Revision 1.1.2.7: download - view: text, markup, annotated - select for diffs
Fri Oct 12 10:28:29 2018 UTC (6 years, 2 months ago) by pgoyette
Branches: pgoyette-compat
Diff to: previous 1.1.2.6: preferred, colored; branchpoint 1.1: preferred, colored
Changes since revision 1.1.2.6: +5 -5 lines
Use private-namespace variable ``__hooked'' instead of ``hooked''

Revision 1.1.2.6: download - view: text, markup, annotated - select for diffs
Thu Oct 4 02:24:26 2018 UTC (6 years, 2 months ago) by pgoyette
Branches: pgoyette-compat
Diff to: previous 1.1.2.5: preferred, colored; branchpoint 1.1: preferred, colored
Changes since revision 1.1.2.5: +3 -1 lines
Also in the UNSET_HOOK2 case, release the mutex before destroying it.

Revision 1.1.2.5: download - view: text, markup, annotated - select for diffs
Thu Oct 4 01:56:03 2018 UTC (6 years, 2 months ago) by pgoyette
Branches: pgoyette-compat
Diff to: previous 1.1.2.4: preferred, colored; branchpoint 1.1: preferred, colored
Changes since revision 1.1.2.4: +4 -1 lines
Grab the mutex for UNSET_HOOK2 (fixed previously for UNSET_HOOK)

Revision 1.1.2.4: download - view: text, markup, annotated - select for diffs
Sat Sep 29 21:36:15 2018 UTC (6 years, 2 months ago) by pgoyette
Branches: pgoyette-compat
Diff to: previous 1.1.2.3: preferred, colored; branchpoint 1.1: preferred, colored
Changes since revision 1.1.2.3: +2 -2 lines
In MODULE_HOOK_CALL_DECL we don't need to provide the actual argument
list for calling the hook function, nor do we need to provide the
default value (for when the hook has not been set).

Revision 1.1.2.3: download - view: text, markup, annotated - select for diffs
Sun Sep 23 10:41:01 2018 UTC (6 years, 2 months ago) by pgoyette
Branches: pgoyette-compat
Diff to: previous 1.1.2.2: preferred, colored; branchpoint 1.1: preferred, colored
Changes since revision 1.1.2.2: +7 -7 lines
Use restricted namespace identifiers for variables within the code
generated by macro expansion.

Revision 1.1.2.2: download - view: text, markup, annotated - select for diffs
Wed Sep 19 06:26:13 2018 UTC (6 years, 2 months ago) by pgoyette
Branches: pgoyette-compat
Diff to: previous 1.1.2.1: preferred, colored; branchpoint 1.1: preferred, colored
Changes since revision 1.1.2.1: +6 -1 lines
Ooops - we need to grab the mutex before we can drain the localcount!

Revision 1.1.2.1: download - view: text, markup, annotated - select for diffs
Tue Sep 18 21:38:08 2018 UTC (6 years, 2 months ago) by pgoyette
Branches: pgoyette-compat
Diff to: previous 1.1: preferred, colored
Changes since revision 1.1: +187 -0 lines
Rename sys/compat_hook.h --> sys/module_hook.h to more accurately
state its intended usage

Revision 1.1
Tue Sep 18 21:38:08 2018 UTC (6 years, 2 months ago) by pgoyette
Branches: MAIN
CVS tags: pgoyette-compat-20190127, pgoyette-compat-20190118, pgoyette-compat-1226, pgoyette-compat-1126, pgoyette-compat-1020, pgoyette-compat-0930
Branch point for: pgoyette-compat
FILE REMOVED
file module_hook.h was initially added on branch pgoyette-compat.

Diff request

This form allows you to request diffs between any two revisions of a file. You may select a symbolic revision name using the selection box or you may type in a numeric name using the type-in text box.

Log view options

CVSweb <webmaster@jp.NetBSD.org>