mirror of
https://git.hardenedbsd.org/hardenedbsd/HardenedBSD.git
synced 2024-11-23 21:21:05 +01:00
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.
This commit is contained in:
parent
5086c26a6c
commit
d09ebcec17
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=227384
@ -251,7 +251,7 @@ kobj_lookup_method(kobj_class_t cls,
|
||||
|
||||
ce = kobj_lookup_method_mi(cls, desc);
|
||||
if (!ce)
|
||||
ce = desc->deflt;
|
||||
ce = &desc->deflt;
|
||||
*cep = ce;
|
||||
return ce;
|
||||
}
|
||||
|
@ -86,7 +86,7 @@ struct kobj_ops {
|
||||
|
||||
struct kobjop_desc {
|
||||
unsigned int id; /* unique ID */
|
||||
kobj_method_t *deflt; /* default implementation */
|
||||
kobj_method_t deflt; /* default implementation */
|
||||
};
|
||||
|
||||
/*
|
||||
|
@ -306,13 +306,8 @@ function handle_method (static, doc)
|
||||
printh(format_line(prototype argument_list ");",
|
||||
line_width, length(prototype)));
|
||||
|
||||
# Print out the method desc
|
||||
printc("static const struct kobj_method " mname "_method_default = {");
|
||||
printc("\t&" mname "_desc, (kobjop_t) " default_function);
|
||||
printc("};\n");
|
||||
|
||||
printc("struct kobjop_desc " mname "_desc = {");
|
||||
printc("\t0, &" mname "_method_default");
|
||||
printc("\t0, { &" mname "_desc, (kobjop_t)" default_function " }");
|
||||
printc("};\n");
|
||||
|
||||
# Print out the method itself
|
||||
|
Loading…
Reference in New Issue
Block a user