Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/rump/include/rump Add the ability to define compat struc...



details:   https://anonhg.NetBSD.org/src/rev/e6b0751b8c24
branches:  trunk
changeset: 783288:e6b0751b8c24
user:      pooka <pooka%NetBSD.org@localhost>
date:      Thu Dec 13 17:17:00 2012 +0000

description:
Add the ability to define compat structs and include a few.

diffstat:

 sys/rump/include/rump/makerumpdefs.sh |  22 +++++++++++++++++++++-
 1 files changed, 21 insertions(+), 1 deletions(-)

diffs (44 lines):

diff -r 5b0822d45e2e -r e6b0751b8c24 sys/rump/include/rump/makerumpdefs.sh
--- a/sys/rump/include/rump/makerumpdefs.sh     Thu Dec 13 15:51:17 2012 +0000
+++ b/sys/rump/include/rump/makerumpdefs.sh     Thu Dec 13 17:17:00 2012 +0000
@@ -8,7 +8,7 @@
 rm -f rumpdefs.h
 exec > rumpdefs.h
 
-printf '/*     $NetBSD: makerumpdefs.sh,v 1.12 2012/11/21 17:35:21 pooka Exp $ */\n\n'
+printf '/*     $NetBSD: makerumpdefs.sh,v 1.13 2012/12/13 17:17:00 pooka Exp $ */\n\n'
 printf '/*\n *\tAUTOMATICALLY GENERATED.  DO NOT EDIT.\n */\n\n'
 printf '#ifndef _RUMP_RUMPDEFS_H_\n'
 printf '#define _RUMP_RUMPDEFS_H_\n\n'
@@ -19,6 +19,20 @@
        sed -n '1{s/\$//gp;q;}' $1
 }
 
+# not perfect, but works well enough for the cases so far
+getstruct () {
+       sed -n '/struct[        ]*'"$2"'[       ]*{/{
+               a\
+struct rump_'"$2"' {
+               :loop
+               n
+               s/^}.*;$/};/p
+               t
+               /#define/!p
+               b loop
+       }' < $1
+}
+
 fromvers ../../../sys/fcntl.h
 sed -n '/#define       O_[A-Z]*        *0x/s/O_/RUMP_O_/gp' \
     < ../../../sys/fcntl.h
@@ -47,4 +61,10 @@
 sed -n '/#define[      ]*SOL_[A-Z]/s/SOL_/RUMP_&/gp' <../../../sys/socket.h \
     | sed 's,/\*.*$,,'
 
+fromvers ../../../sys/module.h
+getstruct ../../../sys/module.h modctl_load
+
+fromvers ../../../ufs/ufs/ufsmount.h
+getstruct ../../../ufs/ufs/ufsmount.h ufs_args
+
 printf '\n#endif /* _RUMP_RUMPDEFS_H_ */\n'



Home | Main Index | Thread Index | Old Index