Date: Sun, 21 Jan 2007 22:44:52 GMT From: Todd Miller <millert@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 113296 for review Message-ID: <200701212244.l0LMiqV6066585@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=113296 Change 113296 by millert@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)
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200701212244.l0LMiqV6066585>