#
331722 |
|
29-Mar-2018 |
eadler |
Revert r330897:
This was intended to be a non-functional change. It wasn't. The commit message was thus wrong. In addition it broke arm, and merged crypto related code.
Revert with prejudice.
This revert skips files touched in r316370 since that commit was since MFCed. This revert also skips files that require $FreeBSD$ property changes.
Thank you to those who helped me get out of this mess including but not limited to gonzo, kevans, rgrimes.
Requested by: gjb (re)
|
#
330897 |
|
14-Mar-2018 |
eadler |
Partial merge of the SPDX changes
These changes are incomplete but are making it difficult to determine what other changes can/should be merged.
No objections from: pfg
|
#
318274 |
|
14-May-2017 |
marius |
MFC: r317982
- Also outside of the KOBJOPLOOKUP macro - which in turn is used by the code auto-generated for *.m - kobj_lookup_method(9) is useful; for example in back-ends or base class device drivers in order to determine whether a default method has been overridden. Thus, allow for the kobj_method_t pointer argument - used by KOBJOPLOOKUP in order to update the cache entry - of kobj_lookup_method(9), to be NULL. Actually, that pointer is redundant as it's just set to the same kobj_method_t that the kobj_lookup_method(9) function returns in the first place, but probably it serves to reduce the number of instructions generated for KOBJOPLOOKUP. - For the same reason, move updating kobj_lookup_{hits,misses} (if KOBJ_STATS is defined) from kobj_lookup_method(9) to KOBJOPLOOKUP. As a side-effect, this gets rid of the convoluted approach of always incrementing kobj_lookup_hits in KOBJOPLOOKUP and then in case of a cache miss, decrementing it in kobj_lookup_method(9) again.
|
#
302408 |
|
07-Jul-2016 |
gjb |
Copy head@r302406 to stable/11 as part of the 11.0-RELEASE cycle. Prune svn:mergeinfo from the new branch, as nothing has been merged here.
Additional commits post-branch will follow.
Approved by: re (implicit) Sponsored by: The FreeBSD Foundation |
#
300443 |
|
23-May-2016 |
adrian |
[bhnd] Fix DEFINE_CLASS_(2|3) multiple inheritance support.
This diff updates DEFINE_CLASS_2/_3 to support the specification of class name separately from the class variable name, bringing them into sync with their API documentation, as well as the behavior of DEFINE_CLASS_0/_1.
Nothing in the tree currently uses the _2/_3 variants, and I can't find any references to the API outside of commits to the kobj.h header itself; given the limitation that currently exists, I'd be surprised if they've ever been used.
Submitted by: Landon Fuller <landonf@landonf.org> Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D6491
|
#
227537 |
|
15-Nov-2011 |
marius |
As it turns out, r186347 actually is insufficient to avoid the use of the curthread-accessing part of mtx_{,un}lock(9) when using a r210623-style curthread implementation on sparc64, crashing the kernel in its early cycles as PCPU isn't set up, yet (and can't be set up as OFW is one of the things we need for that, which leads to a chicken-and-egg problem). What happens is that due to the fact that the idea of r210623 actually is to allow the compiler to cache invocations of curthread, it factors out obtaining curthread needed for both mtx_lock(9) and mtx_unlock(9) to before the branch based on kobj_mutex_inited when compiling the kernel without the debugging options. So change kobj_class_compile_static(9) to just never acquire kobj_mtx, effectively restricting it to its documented use, and add a kobj_init_static(9) for initializing objects using a class compiled with the former and that also avoids using mutex(9) (and malloc(9)). Also assert in both of these functions that they are used in their intended way only. While at it, inline kobj_register_method() and kobj_unregister_method() as there wasn't much point for factoring them out in the first place and so that a reader of the code has to figure out the locking for fewer functions missing a KOBJ_ASSERT. Tested on powerpc{,64} by andreast.
Reviewed by: nwhitehorn (earlier version), jhb MFC after: 3 days
|
#
227384 |
|
09-Nov-2011 |
ed |
Simplify the code emitted by makeobjops.awk slightly.
Just place the default kobj_method inside the kobjop_desc structure. There's no need to give these kobj_methods their own symbol. This shaves off 10 KB of a GENERIC kernel binary.
|
#
227343 |
|
08-Nov-2011 |
ed |
Make kobj_methods constant.
These structures hold no information that is modified during runtime. By marking this constant, we see approximately 600 symbols become read-only (amd64 GENERIC). While there, also mark the kobj_method structures generated by makeobjops.awk static. They are only referenced by the kobjop_desc structures within the same file.
Before:
$ ls -l kernel -rwxr-xr-x 1 ed wheel 15937309 Nov 8 16:29 kernel* $ size kernel text data bss dec hex filename 12260854 1358468 2848832 16468154 fb48ba kernel $ nm kernel | fgrep -c ' r ' 8240
After:
$ ls -l kernel -rwxr-xr-x 1 ed wheel 15922469 Nov 8 16:25 kernel* $ size kernel text data bss dec hex filename 12302869 1302660 2848704 16454233 fb1259 kernel $ nm kernel | fgrep -c ' r ' 8838
|
#
194049 |
|
12-Jun-2009 |
avg |
KOBJMETHOD: throw the switch on kobj method signature checking
It seems that current code should pass the check. This commit should not lead to any changes in compiled code. From now on a warning shall be produced if kobj method implementation function has a mismatching signature.
Verified by: md5 Reviewed by: imp Approved by: jhb (mentor)
|
#
194028 |
|
11-Jun-2009 |
avg |
KOBJMETHOD: use better construct in the checking version of the macro
Big thanks to Christoph Mallon for the idea/code! This construct has benefit of sticking much stricter to C standard and thus keeping more compilers happy as Clang doesn't like the current construct because it doesn't treat FUNC != NULL as a compile-time constant.
The checking version is still under 'notyet'.
Pointed out by: ed Submitted by: Christoph Mallon <christoph.mallon@gmx.de> Clang help by: rdivacky Reviewed by: imp Approved by: jhb
|
#
188475 |
|
11-Feb-2009 |
imp |
o Introduce KOBJMETHOD_END for the end of the kobj list. o Fix a minor indentation problem. o Put in the extra-strict KOBJMETHOD define, but commented out since the tree isn't yet ready.
Reviewed by: (1) was posted to arch@ without objection (and 1 go for it)
|
#
188040 |
|
02-Feb-2009 |
imp |
Use NULL in preference to 0 for pointers.
|
#
186347 |
|
19-Dec-2008 |
nwhitehorn |
Modularize the Open Firmware client interface to allow run-time switching of OFW access semantics, in order to allow future support for real-mode OF access and flattened device frees. OF client interface modules are implemented using KOBJ, in a similar way to the PPC PMAP modules.
Because we need Open Firmware to be available before mutexes can be used on sparc64, changes are also included to allow KOBJ to be used very early in the boot process by only using the mutex once we know it has been initialized.
Reviewed by: marius, grehan
|
#
161587 |
|
24-Aug-2006 |
rik |
Fix typo in a comment: DEFINE_CLASSx => DEFINE_CLASS_x.
MFC after: 1 week
|
#
148811 |
|
07-Aug-2005 |
grehan |
Export a routine, kobj_machdep_init(), that allows platforms to use the kobj subsystem as soon at mutex_init() has been called instead of having to wait for the SI_SUB_LOCK sysinit.
Reviewed by: dfr
|
#
121129 |
|
16-Oct-2003 |
dfr |
* Add multiple inheritance to kobj. Each class can have zero or more base classes and if a method is not found in a given class, its base classes are searched (in the order they were declared). This search is recursive, i.e. a method may be define in a base class of a base class. * Change the kobj method lookup algorithm to one which is SMP-safe. This relies only on the constraint that an observer of a sequence of writes of pointer-sized values will see exactly one of those values, not a mixture of two or more values. This assumption holds for all processors which FreeBSD supports. * Add locking to kobj class initialisation. * Add a simpler form of 'inheritance' for devclasses. Each devclass can have a parent devclass. Searches for drivers continue up the chain of devclasses until either a matching driver is found or a devclass is reached which has no parent. This can allow, for instance, pci drivers to match cardbus devices (assuming that cardbus declares pci as its parent devclass). * Increment __FreeBSD_version.
This preserves the driver API entirely except for one minor feature used by the ISA compatibility shims. A workaround for ISA compatibility will be committed separately. The kobj and newbus ABI has changed - all modules must be recompiled.
|
#
120343 |
|
22-Sep-2003 |
peter |
Simplify the KOBJOPLOOKUP macro for the non-debug case so that gcc's heuristics do not overestimate the code size quite so much.
|
#
98105 |
|
10-Jun-2002 |
kbyanc |
Convert hit and miss counters to unsigned values. Surely negative values for either does not make sense.
PR: (one small part of) 19720
|
#
72180 |
|
08-Feb-2001 |
asmodai |
Fix typos: initalise -> initialise.
Initalise is not an english word.
|
#
65173 |
|
28-Aug-2000 |
dfr |
Add kobj_class_compile_static() to allow classes to be initialised statically (i.e. without calling malloc). This allows kobj to be used very early in the boot sequence.
|
#
60396 |
|
11-May-2000 |
bde |
Fixed a syntax error (a stray semicolon caused by a bogus #define).
|
#
59820 |
|
01-May-2000 |
dfr |
* Move the driver_t::refs field to kobj_t to replace kobj_t::instances. * Back out a couple of workarounds for the confusion between kobj_t::instances and driver_t::refs.
|
#
59602 |
|
24-Apr-2000 |
dfr |
Remove a debugging define which I left by mistake.
|
#
59093 |
|
08-Apr-2000 |
dfr |
* Factor out the object system from new-bus so that it can be used by non-device code. * Re-implement the method dispatch to improve efficiency. The new system takes about 40ns for a method dispatch on a 300Mhz PII which is only 10ns slower than a direct function call on the same hardware.
This changes the new-bus ABI slightly so make sure you re-compile any driver modules which you use.
|