diff options
-rw-r--r-- | sys/sys/pcpu.h | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/sys/sys/pcpu.h b/sys/sys/pcpu.h index a129997..df73985 100644 --- a/sys/sys/pcpu.h +++ b/sys/sys/pcpu.h @@ -81,7 +81,6 @@ struct pcpu { int pc_ktr_idx; /* Index into trace table */ char *pc_ktr_buf; #endif - PCPU_MD_FIELDS; struct vmmeter pc_cnt; /* VM stats counters */ long pc_cp_time[CPUSTATES]; /* statclock ticks */ struct device *pc_device; @@ -94,6 +93,17 @@ struct pcpu { */ struct rm_queue pc_rm_queue; + /* + * Keep MD fields last, so that CPU-specific variations on a + * single architecture don't result in offset variations of + * the machine-independent fields of the pcpu. Even though + * the pcpu structure is private to the kernel, some ports + * (e.g. lsof, part of gtop) define _KERNEL and include this + * header. While strictly speaking this is wrong, there's no + * reason not to keep the offsets of the MI fields contants. + * If only to make kernel debugging easier... + */ + PCPU_MD_FIELDS; }; SLIST_HEAD(cpuhead, pcpu); |