Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 8 Dec 2005 19:25:44 GMT
From:      John Baldwin <jhb@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 87901 for review
Message-ID:  <200512081925.jB8JPip1008306@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=87901

Change 87901 by jhb@jhb_slimer on 2005/12/08 19:24:49

	Split up DB_SET.  DB_SET now just creates a linker_set entry for a
	command and can be used to setup aliases.  DB_FUNC() now does what
	DB_SET used to do which is to setup the linker_set entry and define
	a function without a body.

Affected files ...

.. //depot/projects/smpng/sys/ddb/ddb.h#17 edit
.. //depot/projects/smpng/sys/dev/aic7xxx/aic79xx_osm.c#21 edit
.. //depot/projects/smpng/sys/kern/kern_mutex.c#110 edit

Differences ...

==== //depot/projects/smpng/sys/ddb/ddb.h#17 (text+ko) ====

@@ -55,20 +55,23 @@
 typedef void db_page_calloutfcn_t(void *arg);
 
 #define DB_COMMAND(cmd_name, func_name) \
-	DB_SET(cmd_name, func_name, db_cmd_set, 0, NULL)
+	DB_FUNC(cmd_name, func_name, db_cmd_set, 0, NULL)
 #define DB_SHOW_COMMAND(cmd_name, func_name) \
-	DB_SET(cmd_name, func_name, db_show_cmd_set, 0, NULL)
+	DB_FUNC(cmd_name, func_name, db_show_cmd_set, 0, NULL)
 
-#define DB_SET(cmd_name, func_name, set, flag, more)		\
-static db_cmdfcn_t	func_name;				\
-								\
+#define	DB_SET(cmd_name, func_name, set, flag, more)		\
 static const struct command __CONCAT(func_name,_cmd) = {	\
 	__STRING(cmd_name),					\
 	func_name,						\
 	flag,							\
 	more							\
 };								\
-TEXT_SET(set, __CONCAT(func_name,_cmd));			\
+TEXT_SET(set, __CONCAT(func_name,_cmd))
+
+#define DB_FUNC(cmd_name, func_name, set, flag, more)		\
+static db_cmdfcn_t	func_name;				\
+								\
+DB_SET(cmd_name, func_name, set, flag, more);			\
 								\
 static void							\
 func_name(addr, have_addr, count, modif)			\

==== //depot/projects/smpng/sys/dev/aic7xxx/aic79xx_osm.c#21 (text+ko) ====

@@ -1629,7 +1629,7 @@
 	}
 }
 
-DB_SET(ahd_out, ahd_ddb_out, db_cmd_set, CS_MORE, NULL)
+DB_FUNC(ahd_out, ahd_ddb_out, db_cmd_set, CS_MORE, NULL)
 {
 	db_expr_t old_value;
 	db_expr_t new_value;

==== //depot/projects/smpng/sys/kern/kern_mutex.c#110 (text+ko) ====

@@ -980,12 +980,6 @@
 	}
 }
 
-/* Make 'show mtx' an alias for 'show mutex'.  Ugly. */
-static const struct command db_show_mutex_mtx = {
-	"mtx",
-	db_show_mutex,
-	0,
-	NULL
-};
-TEXT_SET(db_show_cmd_set, db_show_mutex_mtx);
+/* Make 'show mtx' an alias for 'show mutex'. */
+DB_SET(mtx, db_show_mutex, db_show_cmd_set, 0, NULL);
 #endif



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200512081925.jB8JPip1008306>