PERFORCE change 113296 for review

Todd Miller millert at FreeBSD.org
Sun Jan 21 22:47:07 UTC 2007


http://perforce.freebsd.org/chv.cgi?CH=113296

Change 113296 by millert at millert_macbook on 2007/01/21 22:44:51

	Fix the OSAddAtomic warnings by converting the inline
	functions that just call OSAddAtomic into macros and including
	libkern/OSAtomic.h as needed.
	
	This fixes a bunch of warnings in things that include
	devfsdefs.h like the MAC Framework and the sedarwin module.

Affected files ...

.. //depot/projects/trustedbsd/sedarwin8/darwin/xnu/bsd/miscfs/devfs/devfs_tree.c#9 edit
.. //depot/projects/trustedbsd/sedarwin8/darwin/xnu/bsd/miscfs/devfs/devfs_vfsops.c#5 edit
.. //depot/projects/trustedbsd/sedarwin8/darwin/xnu/bsd/miscfs/devfs/devfsdefs.h#5 edit

Differences ...

==== //depot/projects/trustedbsd/sedarwin8/darwin/xnu/bsd/miscfs/devfs/devfs_tree.c#9 (text+ko) ====

@@ -101,6 +101,8 @@
 #include <sys/vnode_internal.h>
 #include <stdarg.h>
 
+#include <libkern/OSAtomic.h>
+
 #include "devfs.h"
 #include "devfsdefs.h"
 

==== //depot/projects/trustedbsd/sedarwin8/darwin/xnu/bsd/miscfs/devfs/devfs_vfsops.c#5 (text+ko) ====

@@ -78,6 +78,8 @@
 #include <sys/mount_internal.h>
 #include <sys/malloc.h>
 
+#include <libkern/OSAtomic.h>
+
 #include "devfs.h"
 #include "devfsdefs.h"
 

==== //depot/projects/trustedbsd/sedarwin8/darwin/xnu/bsd/miscfs/devfs/devfsdefs.h#5 (text+ko) ====

@@ -204,62 +204,14 @@
 #define DEVFS_UNLOCK()	lck_mtx_unlock(&devfs_mutex)
 
 
-static __inline__ void DEVFS_INCR_ENTRIES(void);
-static __inline__ void DEVFS_DECR_ENTRIES(void);
-static __inline__ void DEVFS_INCR_NODES(void);
-static __inline__ void DEVFS_DECR_NODES(void);
-static __inline__ void DEVFS_INCR_MOUNTS(void);
-static __inline__ void DEVFS_DECR_MOUNTS(void);
-static __inline__ void DEVFS_INCR_STRINGSPACE(int);
-static __inline__ void DEVFS_DECR_STRINGSPACE(int);
-
-static __inline__ void
-DEVFS_INCR_ENTRIES()
-{
-    OSAddAtomic(1, &devfs_stats.entries);
-}
-
-static __inline__ void
-DEVFS_DECR_ENTRIES()
-{
-    OSAddAtomic(-1, &devfs_stats.entries);
-}
-
-static __inline__ void
-DEVFS_INCR_NODES()
-{
-    OSAddAtomic(1, &devfs_stats.nodes);
-}
-
-static __inline__ void
-DEVFS_DECR_NODES()
-{
-    OSAddAtomic(-1, &devfs_stats.nodes);
-}
-
-static __inline__ void
-DEVFS_INCR_MOUNTS()
-{
-    OSAddAtomic(1, &devfs_stats.mounts);
-}
-
-static __inline__ void
-DEVFS_DECR_MOUNTS()
-{
-    OSAddAtomic(-1, &devfs_stats.mounts);
-}
-
-static __inline__ void
-DEVFS_INCR_STRINGSPACE(int space)
-{
-    OSAddAtomic(space, &devfs_stats.stringspace);
-}
-
-static __inline__ void
-DEVFS_DECR_STRINGSPACE(int space)
-{
-    OSAddAtomic(-space, &devfs_stats.stringspace);
-}
+#define	DEVFS_INCR_ENTRIES()	OSAddAtomic(1, (SInt32 *)&devfs_stats.entries)
+#define	DEVFS_DECR_ENTRIES()	OSAddAtomic(-1, (SInt32 *)&devfs_stats.entries)
+#define	DEVFS_INCR_NODES()	OSAddAtomic(1, (SInt32 *)&devfs_stats.nodes)
+#define	DEVFS_DECR_NODES()	OSAddAtomic(-1, (SInt32 *)&devfs_stats.nodes)
+#define	DEVFS_INCR_MOUNTS()	OSAddAtomic(1, (SInt32 *)&devfs_stats.mounts)
+#define	DEVFS_DECR_MOUNTS()	OSAddAtomic(-1, (SInt32 *)&devfs_stats.mounts)
+#define	DEVFS_INCR_STRINGSPACE(x) OSAddAtomic(x, (SInt32 *)&devfs_stats.stringspace)
+#define	DEVFS_DECR_STRINGSPACE(x) OSAddAtomic(-x, (SInt32 *)&devfs_stats.stringspace)
 
 static __inline__ void
 dn_times(devnode_t * dnp, struct timeval *t1, struct timeval *t2, struct timeval *t3) 


More information about the trustedbsd-cvs mailing list