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


Default branch: MAIN


Revision 1.3.4.3 / (download) - annotate - [select for diffs], Wed Apr 8 14:09:03 2020 UTC (4 years ago) by martin
Branch: phil-wifi
Changes since 1.3.4.2: +33 -81 lines
Diff to previous 1.3.4.2 (colored) to branchpoint 1.3 (colored) next main 1.4 (colored)

Merge changes from current as of 20200406

Revision 1.6 / (download) - annotate - [select for diffs], Thu Dec 12 22:55:20 2019 UTC (4 years, 4 months ago) by pgoyette
Branch: 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, HEAD
Changes since 1.5: +21 -75 lines
Diff to previous 1.5 (colored)

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) - annotate - [select for diffs], Thu Dec 12 02:15:43 2019 UTC (4 years, 4 months ago) by pgoyette
Branch: MAIN
Changes since 1.4: +17 -20 lines
Diff to previous 1.4 (colored)

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) - annotate - [select for diffs], Tue Dec 3 13:48:25 2019 UTC (4 years, 4 months ago) by pgoyette
Branch: MAIN
Changes since 1.3: +17 -8 lines
Diff to previous 1.3 (colored)

Adapt to use the new atomic_* operations.  As discussed with
riastradh@ in private Email.

Revision 1.3.4.2 / (download) - annotate - [select for diffs], Mon Jun 10 22:09:57 2019 UTC (4 years, 10 months ago) by christos
Branch: phil-wifi
Changes since 1.3.4.1: +150 -0 lines
Diff to previous 1.3.4.1 (colored) to branchpoint 1.3 (colored)

Sync with HEAD

Revision 1.3.4.1, Fri Mar 1 11:06:57 2019 UTC (5 years, 1 month ago) by christos
Branch: phil-wifi
Changes since 1.3: +0 -150 lines
FILE REMOVED

file module_hook.h was added on branch phil-wifi on 2019-06-10 22:09:57 +0000

Revision 1.3 / (download) - annotate - [select for diffs], Fri Mar 1 11:06:57 2019 UTC (5 years, 1 month ago) by pgoyette
Branch: MAIN
CVS Tags: phil-wifi-20191119, phil-wifi-20190609, netbsd-9-base, 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
Changes since 1.2: +5 -5 lines
Diff to previous 1.2 (colored)

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) - annotate - [select for diffs], Sun Jan 27 02:08:50 2019 UTC (5 years, 2 months ago) by pgoyette
Branch: MAIN
Changes since 1.1: +150 -0 lines
Diff to previous 1.1 (colored)

Merge the [pgoyette-compat] branch

Revision 1.1.2.16 / (download) - annotate - [select for diffs], Wed Jan 23 03:40:08 2019 UTC (5 years, 2 months ago) by pgoyette
Branch: pgoyette-compat
CVS Tags: pgoyette-compat-merge-20190127
Changes since 1.1.2.15: +5 -2 lines
Diff to previous 1.1.2.15 (colored) to branchpoint 1.1 (colored) next main 1.2 (colored)

Improve a comment

Revision 1.1.2.15 / (download) - annotate - [select for diffs], Wed Jan 23 03:34:15 2019 UTC (5 years, 2 months ago) by pgoyette
Branch: pgoyette-compat
Changes since 1.1.2.14: +6 -10 lines
Diff to previous 1.1.2.14 (colored) to branchpoint 1.1 (colored)

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) - annotate - [select for diffs], Tue Jan 22 07:42:42 2019 UTC (5 years, 2 months ago) by pgoyette
Branch: pgoyette-compat
Changes since 1.1.2.13: +9 -19 lines
Diff to previous 1.1.2.13 (colored) to branchpoint 1.1 (colored)

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) - annotate - [select for diffs], Mon Jan 21 06:49:28 2019 UTC (5 years, 2 months ago) by pgoyette
Branch: pgoyette-compat
Changes since 1.1.2.12: +1 -5 lines
Diff to previous 1.1.2.12 (colored) to branchpoint 1.1 (colored)

No need to declare the hook_call() function for void hooks.  So
remove and simplify.

Revision 1.1.2.12 / (download) - annotate - [select for diffs], Fri Jan 18 00:01:02 2019 UTC (5 years, 2 months ago) by pgoyette
Branch: pgoyette-compat
Changes since 1.1.2.11: +7 -6 lines
Diff to previous 1.1.2.11 (colored) to branchpoint 1.1 (colored)

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) - annotate - [select for diffs], Thu Jan 17 21:32:42 2019 UTC (5 years, 2 months ago) by pgoyette
Branch: pgoyette-compat
Changes since 1.1.2.10: +5 -5 lines
Diff to previous 1.1.2.10 (colored) to branchpoint 1.1 (colored)

The return value of a hook is not necessarily an error code, so
rename the variable appropriately.

NFCI

Revision 1.1.2.10 / (download) - annotate - [select for diffs], Mon Jan 14 13:34:28 2019 UTC (5 years, 2 months ago) by pgoyette
Branch: pgoyette-compat
Changes since 1.1.2.9: +33 -5 lines
Diff to previous 1.1.2.9 (colored) to branchpoint 1.1 (colored)

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) - annotate - [select for diffs], Sun Jan 13 10:49:51 2019 UTC (5 years, 3 months ago) by pgoyette
Branch: pgoyette-compat
Changes since 1.1.2.8: +7 -68 lines
Diff to previous 1.1.2.8 (colored) to branchpoint 1.1 (colored)

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) - annotate - [select for diffs], Fri Jan 11 06:18:17 2019 UTC (5 years, 3 months ago) by pgoyette
Branch: pgoyette-compat
Changes since 1.1.2.7: +3 -3 lines
Diff to previous 1.1.2.7 (colored) to branchpoint 1.1 (colored)

Separate macro arguments with <comma><space> for readability.

Revision 1.1.2.7 / (download) - annotate - [select for diffs], Fri Oct 12 10:28:29 2018 UTC (5 years, 6 months ago) by pgoyette
Branch: pgoyette-compat
Changes since 1.1.2.6: +5 -5 lines
Diff to previous 1.1.2.6 (colored) to branchpoint 1.1 (colored)

Use private-namespace variable ``__hooked'' instead of ``hooked''

Revision 1.1.2.6 / (download) - annotate - [select for diffs], Thu Oct 4 02:24:26 2018 UTC (5 years, 6 months ago) by pgoyette
Branch: pgoyette-compat
Changes since 1.1.2.5: +3 -1 lines
Diff to previous 1.1.2.5 (colored) to branchpoint 1.1 (colored)

Also in the UNSET_HOOK2 case, release the mutex before destroying it.

Revision 1.1.2.5 / (download) - annotate - [select for diffs], Thu Oct 4 01:56:03 2018 UTC (5 years, 6 months ago) by pgoyette
Branch: pgoyette-compat
Changes since 1.1.2.4: +4 -1 lines
Diff to previous 1.1.2.4 (colored) to branchpoint 1.1 (colored)

Grab the mutex for UNSET_HOOK2 (fixed previously for UNSET_HOOK)

Revision 1.1.2.4 / (download) - annotate - [select for diffs], Sat Sep 29 21:36:15 2018 UTC (5 years, 6 months ago) by pgoyette
Branch: pgoyette-compat
Changes since 1.1.2.3: +2 -2 lines
Diff to previous 1.1.2.3 (colored) to branchpoint 1.1 (colored)

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) - annotate - [select for diffs], Sun Sep 23 10:41:01 2018 UTC (5 years, 6 months ago) by pgoyette
Branch: pgoyette-compat
Changes since 1.1.2.2: +7 -7 lines
Diff to previous 1.1.2.2 (colored) to branchpoint 1.1 (colored)

Use restricted namespace identifiers for variables within the code
generated by macro expansion.

Revision 1.1.2.2 / (download) - annotate - [select for diffs], Wed Sep 19 06:26:13 2018 UTC (5 years, 6 months ago) by pgoyette
Branch: pgoyette-compat
Changes since 1.1.2.1: +6 -1 lines
Diff to previous 1.1.2.1 (colored) to branchpoint 1.1 (colored)

Ooops - we need to grab the mutex before we can drain the localcount!

Revision 1.1.2.1 / (download) - annotate - [select for diffs], Tue Sep 18 21:38:08 2018 UTC (5 years, 6 months ago) by pgoyette
Branch: pgoyette-compat
Changes since 1.1: +187 -0 lines
Diff to previous 1.1 (colored)

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 (5 years, 6 months ago) by pgoyette
Branch: 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.

This form allows you to request diff's 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.




CVSweb <webmaster@jp.NetBSD.org>