From owner-svn-src-all@FreeBSD.ORG Sat Apr 24 12:49:53 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6C513106564A; Sat, 24 Apr 2010 12:49:53 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 59BD48FC12; Sat, 24 Apr 2010 12:49:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o3OCnrhL035715; Sat, 24 Apr 2010 12:49:53 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3OCnrXG035678; Sat, 24 Apr 2010 12:49:53 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201004241249.o3OCnrXG035678@svn.freebsd.org> From: Konstantin Belousov Date: Sat, 24 Apr 2010 12:49:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r207152 - in head/sys: amd64/include arm/include i386/include ia64/include kern mips/include powerpc/include sparc64/include sun4v/include sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Apr 2010 12:49:53 -0000 Author: kib Date: Sat Apr 24 12:49:52 2010 New Revision: 207152 URL: http://svn.freebsd.org/changeset/base/207152 Log: Move the constants specifying the size of struct kinfo_proc into machine-specific header files. Add KINFO_PROC32_SIZE for struct kinfo_proc32 for architectures providing COMPAT_FREEBSD32. Add CTASSERT for the size of struct kinfo_proc32. Submitted by: pluknet Reviewed by: imp, jhb, nwhitehorn MFC after: 2 weeks Modified: head/sys/amd64/include/proc.h head/sys/arm/include/proc.h head/sys/i386/include/proc.h head/sys/ia64/include/proc.h head/sys/kern/kern_proc.c head/sys/mips/include/proc.h head/sys/powerpc/include/proc.h head/sys/sparc64/include/proc.h head/sys/sun4v/include/proc.h head/sys/sys/user.h Modified: head/sys/amd64/include/proc.h ============================================================================== --- head/sys/amd64/include/proc.h Sat Apr 24 12:11:41 2010 (r207151) +++ head/sys/amd64/include/proc.h Sat Apr 24 12:49:52 2010 (r207152) @@ -53,6 +53,9 @@ struct mdproc { struct system_segment_descriptor md_ldt_sd; }; +#define KINFO_PROC_SIZE 1088 +#define KINFO_PROC32_SIZE 768 + #ifdef _KERNEL /* Get the current kernel thread stack usage. */ Modified: head/sys/arm/include/proc.h ============================================================================== --- head/sys/arm/include/proc.h Sat Apr 24 12:11:41 2010 (r207151) +++ head/sys/arm/include/proc.h Sat Apr 24 12:49:52 2010 (r207152) @@ -60,4 +60,6 @@ struct mdproc { void *md_sigtramp; }; +#define KINFO_PROC_SIZE 792 + #endif /* !_MACHINE_PROC_H_ */ Modified: head/sys/i386/include/proc.h ============================================================================== --- head/sys/i386/include/proc.h Sat Apr 24 12:11:41 2010 (r207151) +++ head/sys/i386/include/proc.h Sat Apr 24 12:49:52 2010 (r207152) @@ -57,6 +57,8 @@ struct mdproc { struct proc_ldt *md_ldt; /* (t) per-process ldt */ }; +#define KINFO_PROC_SIZE 768 + #ifdef _KERNEL /* Get the current kernel thread stack usage. */ Modified: head/sys/ia64/include/proc.h ============================================================================== --- head/sys/ia64/include/proc.h Sat Apr 24 12:11:41 2010 (r207151) +++ head/sys/ia64/include/proc.h Sat Apr 24 12:49:52 2010 (r207152) @@ -38,4 +38,7 @@ struct mdproc { int __dummy; /* Avoid having an empty struct. */ }; +#define KINFO_PROC_SIZE 1088 +#define KINFO_PROC32_SIZE 768 + #endif /* !_MACHINE_PROC_H_ */ Modified: head/sys/kern/kern_proc.c ============================================================================== --- head/sys/kern/kern_proc.c Sat Apr 24 12:11:41 2010 (r207151) +++ head/sys/kern/kern_proc.c Sat Apr 24 12:49:52 2010 (r207152) @@ -151,6 +151,9 @@ int kstack_pages = KSTACK_PAGES; SYSCTL_INT(_kern, OID_AUTO, kstack_pages, CTLFLAG_RD, &kstack_pages, 0, ""); CTASSERT(sizeof(struct kinfo_proc) == KINFO_PROC_SIZE); +#ifdef COMPAT_FREEBSD32 +CTASSERT(sizeof(struct kinfo_proc32) == KINFO_PROC32_SIZE); +#endif /* * Initialize global process hashing structures. Modified: head/sys/mips/include/proc.h ============================================================================== --- head/sys/mips/include/proc.h Sat Apr 24 12:11:41 2010 (r207151) +++ head/sys/mips/include/proc.h Sat Apr 24 12:49:52 2010 (r207152) @@ -68,4 +68,10 @@ struct thread; void mips_cpu_switch(struct thread *, struct thread *, struct mtx *); void mips_cpu_throw(struct thread *, struct thread *); +#ifdef __mips_n64 +#define KINFO_PROC_SIZE 1088 +#else +#define KINFO_PROC_SIZE 816 +#endif + #endif /* !_MACHINE_PROC_H_ */ Modified: head/sys/powerpc/include/proc.h ============================================================================== --- head/sys/powerpc/include/proc.h Sat Apr 24 12:11:41 2010 (r207151) +++ head/sys/powerpc/include/proc.h Sat Apr 24 12:49:52 2010 (r207152) @@ -46,4 +46,6 @@ struct mdthread { struct mdproc { }; +#define KINFO_PROC_SIZE 768 + #endif /* !_MACHINE_PROC_H_ */ Modified: head/sys/sparc64/include/proc.h ============================================================================== --- head/sys/sparc64/include/proc.h Sat Apr 24 12:11:41 2010 (r207151) +++ head/sys/sparc64/include/proc.h Sat Apr 24 12:49:52 2010 (r207152) @@ -51,4 +51,6 @@ struct mdproc { void *md_sigtramp; }; +#define KINFO_PROC_SIZE 1088 + #endif /* !_MACHINE_PROC_H_ */ Modified: head/sys/sun4v/include/proc.h ============================================================================== --- head/sys/sun4v/include/proc.h Sat Apr 24 12:11:41 2010 (r207151) +++ head/sys/sun4v/include/proc.h Sat Apr 24 12:49:52 2010 (r207152) @@ -51,4 +51,6 @@ struct mdproc { void *md_sigtramp; }; +#define KINFO_PROC_SIZE 1088 + #endif /* !_MACHINE_PROC_H_ */ Modified: head/sys/sys/user.h ============================================================================== --- head/sys/sys/user.h Sat Apr 24 12:11:41 2010 (r207151) +++ head/sys/sys/user.h Sat Apr 24 12:49:52 2010 (r207152) @@ -87,34 +87,11 @@ #define KI_NSPARE_LONG 12 #define KI_NSPARE_PTR 7 -#ifdef __amd64__ -#define KINFO_PROC_SIZE 1088 -#endif -#ifdef __arm__ -#define KINFO_PROC_SIZE 792 -#endif -#ifdef __ia64__ -#define KINFO_PROC_SIZE 1088 -#endif -#ifdef __i386__ -#define KINFO_PROC_SIZE 768 -#endif -#ifdef __mips__ -#ifdef __mips_n64 -#define KINFO_PROC_SIZE 1088 -#else -#define KINFO_PROC_SIZE 816 -#endif -#endif -#ifdef __powerpc__ -#define KINFO_PROC_SIZE 768 -#endif -#ifdef __sparc64__ -#define KINFO_PROC_SIZE 1088 -#endif +#ifndef _KERNEL #ifndef KINFO_PROC_SIZE #error "Unknown architecture" #endif +#endif /* !_KERNEL */ #define WMESGLEN 8 /* size of returned wchan message */ #define LOCKNAMELEN 8 /* size of returned lock name */