Date: Sat, 27 May 2006 05:22:35 GMT From: John Birrell <jb@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 97921 for review Message-ID: <200605270522.k4R5MZfj088661@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=97921 Change 97921 by jb@jb_freebsd2 on 2006/05/27 05:21:38 Start treating 'CPU' as though it means 'cpu id' rather than a pointer to the per-cpu structure. My previous hack was leading to an occasional NULL pointer reference. It's time to start cleaning up hacks like this so that the FreeBSD DTrace port will pass a code review. Affected files ... .. //depot/projects/dtrace/src/sys/cddl/dev/dtrace/dtrace_hacks.h#14 edit Differences ... ==== //depot/projects/dtrace/src/sys/cddl/dev/dtrace/dtrace_hacks.h#14 (text+ko) ==== @@ -1,13 +1,5 @@ -/* - * DTrace code routinely references CPU->cpu_id to get the cpu index - * to cpu_core[]. This would be better coded as a macro CPU_ID() - * which on FreeBSD would be defined as curthread->td_oncpu and on - * Solaris would be defined as curthread->t_cpu->cpu_id. - */ -#define CPU curthread -#define cpu_id td_oncpu - -#define CPU_ON_INTR(_t) (pcpu_find((_t)->td_oncpu)->pc_intr_actv) +#define CPU curcpu +#define CPU_ON_INTR(_a) (pcpu_find(_a)->pc_intr_actv) #define t_dtrace_start td_dtrace_start #define t_dtrace_vtime td_dtrace_vtime
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200605270522.k4R5MZfj088661>