diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 1999-03-03 20:58:28 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 1999-03-03 20:58:28 +0000 |
commit | b51f1b3483893b7ecb449aa87bb41e93969625c7 (patch) | |
tree | c2af4ce9cf46ba268046dd6d5851f20646191e30 /sys/kern | |
parent | d55c0aa5ef41272a7f511a8ead0ddba9c47090c6 (diff) |
not using inline functions saves about 120K
Diffstat (limited to 'sys/kern')
-rw-r--r-- | sys/kern/vnode_if.sh | 73 |
1 files changed, 32 insertions, 41 deletions
diff --git a/sys/kern/vnode_if.sh b/sys/kern/vnode_if.sh index e36b307c61e..855f5224fc8 100644 --- a/sys/kern/vnode_if.sh +++ b/sys/kern/vnode_if.sh @@ -33,7 +33,7 @@ copyright="\ * SUCH DAMAGE. */ " -SCRIPT_ID='$OpenBSD: vnode_if.sh,v 1.5 1999/03/03 14:23:19 deraadt Exp $' +SCRIPT_ID='$OpenBSD: vnode_if.sh,v 1.6 1999/03/03 20:58:27 deraadt Exp $' # SCRIPT_ID='$NetBSD: vnode_if.sh,v 1.9 1996/02/29 20:58:22 cgd Exp $' # Script to produce VFS front-end sugar. @@ -164,19 +164,6 @@ extern struct vnodeop_desc vop_default_desc; echo '#include "systm.h"' -echo '#ifdef VOP_NOT_INLINE' -echo '#define STATIC_INLINE' -echo '#else' -echo '#define STATIC_INLINE static __inline' -echo '#endif' - -echo '#ifdef INTERNAL_VOP_NOT_INLINE' -echo '#define FUNC_STATIC_INLINE' -echo '#else' -echo '#undef FUNC_STATIC_INLINE' -echo '#define FUNC_STATIC_INLINE static __inline' -echo '#endif' - # Body stuff # This awk program needs toupper() so define it if necessary. sed -e "$sed_prep" $src | $awk "$toupper"' @@ -190,7 +177,7 @@ function doit() { printf("};\n"); printf("extern struct vnodeop_desc %s_desc;\n", name); # Prototype it. - protoarg = sprintf("STATIC_INLINE int %s __P((", toupper(name)); + protoarg = sprintf("int %s __P((", toupper(name)); protolen = length(protoarg); printf("%s", protoarg); for (i=0; i<argc; i++) { @@ -206,30 +193,6 @@ function doit() { protolen += arglen; } printf("));\n"); - printf("#if !defined(VOP_NOT_INLINE) || defined(INTERNAL_VOP_NOT_INLINE)\n"); - # Define inline function. - printf("FUNC_STATIC_INLINE int %s(", toupper(name)); - for (i=0; i<argc; i++) { - printf("%s", argname[i]); - if (i < (argc-1)) printf(", "); - } - printf(")\n"); - for (i=0; i<argc; i++) { - printf("\t%s %s;\n", argtype[i], argname[i]); - } - printf("{\n\tstruct %s_args a;\n", name); - printf("\ta.a_desc = VDESC(%s);\n", name); - for (i=0; i<argc; i++) { - printf("\ta.a_%s = %s;\n", argname[i], argname[i]); - if (shouldbelocked[i]) { - printf ("#ifdef DIAGNOSTIC\n"); - printf ("\tif ((%s->v_flag & VLOCKSWORK) && !VOP_ISLOCKED(%s)) panic(\"%s: %s\");\n", argname[i], argname[i], name, argname[i]); - printf ("#endif\n"); - } - } - printf("\treturn (VCALL(%s%s, VOFFSET(%s), &a));\n}\n", - argname[0], arg0special, name); - printf("#endif /* !VOP_NOT_INLINE */"); } BEGIN { arg0special=""; @@ -264,7 +227,6 @@ echo -n "$warning" | sed -e 's/\$//g' echo "" echo -n "$copyright" echo ' -#define INTERNAL_VOP_NOT_INLINE #include <sys/param.h> #include <sys/mount.h> #include <sys/vnode.h> @@ -339,13 +301,42 @@ function doit() { do_offset("struct componentname *"); # transport layer information printf ("\tNULL,\n};\n"); + + # Define inline function. + printf("\nint %s(", toupper(name)); + for (i=0; i<argc; i++) { + printf("%s", argname[i]); + if (i < (argc-1)) printf(", "); + } + printf(")\n"); + for (i=0; i<argc; i++) { + printf("\t%s %s;\n", argtype[i], argname[i]); + } + printf("{\n\tstruct %s_args a;\n", name); + printf("\ta.a_desc = VDESC(%s);\n", name); + for (i=0; i<argc; i++) { + printf("\ta.a_%s = %s;\n", argname[i], argname[i]); + if (shouldbelocked[i]) { + printf ("#ifdef DIAGNOSTIC\n"); + printf ("\tif ((%s->v_flag & VLOCKSWORK) && !VOP_ISLOCKED(%s)) panic(\"%s: %s\");\n", argname[i], argname[i], name, argname[i]); + printf ("#endif\n"); + } + } + printf("\treturn (VCALL(%s%s, VOFFSET(%s), &a));\n}\n", + argname[0], arg0special, name); + +} +BEGIN { + arg0special=""; } END { printf("\n/* Special cases: */\n"); argc=1; - argdir[0]="IN"; argtype[0]="struct buf *"; + argdir[0]="IN"; argname[0]="bp"; + shouldbelocked[0] = 0; + arg0special="->b_vp"; willrele[0]=0; name="vop_strategy"; doit(); |