Module Name:    src
Committed By:   pooka
Date:           Thu Dec 13 17:17:00 UTC 2012

Modified Files:
        src/sys/rump/include/rump: makerumpdefs.sh

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


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/sys/rump/include/rump/makerumpdefs.sh

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/rump/include/rump/makerumpdefs.sh
diff -u src/sys/rump/include/rump/makerumpdefs.sh:1.12 src/sys/rump/include/rump/makerumpdefs.sh:1.13
--- src/sys/rump/include/rump/makerumpdefs.sh:1.12	Wed Nov 21 17:35:21 2012
+++ src/sys/rump/include/rump/makerumpdefs.sh	Thu Dec 13 17:17:00 2012
@@ -8,7 +8,7 @@ echo Generating rumpdefs.h
 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 @@ fromvers () {
 	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[ 	]*SO_[A-Z]/s/SO_/RUMP
 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'

Reply via email to