Add CTASSERT to verify __HAVE_CPU_DATA_FIRST is correct defined or undefined.

This commit is contained in:
matt 2010-12-22 02:43:23 +00:00
parent c831bbca8c
commit 86c8e7039d
1 changed files with 13 additions and 2 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: kern_cpu.c,v 1.44 2010/04/25 15:57:59 ad Exp $ */
/* $NetBSD: kern_cpu.c,v 1.45 2010/12/22 02:43:23 matt Exp $ */
/*-
* Copyright (c) 2007, 2008, 2009, 2010 The NetBSD Foundation, Inc.
@ -56,7 +56,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: kern_cpu.c,v 1.44 2010/04/25 15:57:59 ad Exp $");
__KERNEL_RCSID(0, "$NetBSD: kern_cpu.c,v 1.45 2010/12/22 02:43:23 matt Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -79,6 +79,17 @@ __KERNEL_RCSID(0, "$NetBSD: kern_cpu.c,v 1.44 2010/04/25 15:57:59 ad Exp $");
#include <uvm/uvm_extern.h>
/*
* If the port has state that cpu_data is the first thing in cpu_info,
* verify the claim is true. This will prevent the from getting out
* of sync.
*/
#ifdef __HAVE_CPU_DATA_FIRST
CTASSERT(offsetof(struct cpu_info, ci_data) == 0);
#else
CTASSERT(offsetof(struct cpu_info, ci_data) != 0);
#endif
void cpuctlattach(int);
static void cpu_xc_online(struct cpu_info *);