summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkib <kib@FreeBSD.org>2010-04-24 12:49:52 +0000
committerkib <kib@FreeBSD.org>2010-04-24 12:49:52 +0000
commite91c695f77327172ce0a6826362a20989822e97b (patch)
treef957490736ac9e2d4cf2744de79d181118b36d05
parent0b9b56e38ea79db375d5fe8e9d9be5e7a2b36127 (diff)
downloadFreeBSD-src-e91c695f77327172ce0a6826362a20989822e97b.zip
FreeBSD-src-e91c695f77327172ce0a6826362a20989822e97b.tar.gz
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
-rw-r--r--sys/amd64/include/proc.h3
-rw-r--r--sys/arm/include/proc.h2
-rw-r--r--sys/i386/include/proc.h2
-rw-r--r--sys/ia64/include/proc.h3
-rw-r--r--sys/kern/kern_proc.c3
-rw-r--r--sys/mips/include/proc.h6
-rw-r--r--sys/powerpc/include/proc.h2
-rw-r--r--sys/sparc64/include/proc.h2
-rw-r--r--sys/sun4v/include/proc.h2
-rw-r--r--sys/sys/user.h27
10 files changed, 27 insertions, 25 deletions
diff --git a/sys/amd64/include/proc.h b/sys/amd64/include/proc.h
index 33d5181..126412c 100644
--- a/sys/amd64/include/proc.h
+++ b/sys/amd64/include/proc.h
@@ -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. */
diff --git a/sys/arm/include/proc.h b/sys/arm/include/proc.h
index c7b2a4e..37051bf 100644
--- a/sys/arm/include/proc.h
+++ b/sys/arm/include/proc.h
@@ -60,4 +60,6 @@ struct mdproc {
void *md_sigtramp;
};
+#define KINFO_PROC_SIZE 792
+
#endif /* !_MACHINE_PROC_H_ */
diff --git a/sys/i386/include/proc.h b/sys/i386/include/proc.h
index 1e0b9f9..0b9fca2 100644
--- a/sys/i386/include/proc.h
+++ b/sys/i386/include/proc.h
@@ -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. */
diff --git a/sys/ia64/include/proc.h b/sys/ia64/include/proc.h
index 6bf9c78..81e2e4f 100644
--- a/sys/ia64/include/proc.h
+++ b/sys/ia64/include/proc.h
@@ -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_ */
diff --git a/sys/kern/kern_proc.c b/sys/kern/kern_proc.c
index d4943c0..5601ecf 100644
--- a/sys/kern/kern_proc.c
+++ b/sys/kern/kern_proc.c
@@ -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.
diff --git a/sys/mips/include/proc.h b/sys/mips/include/proc.h
index 0491b11..1479eda 100644
--- a/sys/mips/include/proc.h
+++ b/sys/mips/include/proc.h
@@ -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_ */
diff --git a/sys/powerpc/include/proc.h b/sys/powerpc/include/proc.h
index c958fb7..cbe6da9 100644
--- a/sys/powerpc/include/proc.h
+++ b/sys/powerpc/include/proc.h
@@ -46,4 +46,6 @@ struct mdthread {
struct mdproc {
};
+#define KINFO_PROC_SIZE 768
+
#endif /* !_MACHINE_PROC_H_ */
diff --git a/sys/sparc64/include/proc.h b/sys/sparc64/include/proc.h
index bfd1268..84eaed5 100644
--- a/sys/sparc64/include/proc.h
+++ b/sys/sparc64/include/proc.h
@@ -51,4 +51,6 @@ struct mdproc {
void *md_sigtramp;
};
+#define KINFO_PROC_SIZE 1088
+
#endif /* !_MACHINE_PROC_H_ */
diff --git a/sys/sun4v/include/proc.h b/sys/sun4v/include/proc.h
index bfd1268..84eaed5 100644
--- a/sys/sun4v/include/proc.h
+++ b/sys/sun4v/include/proc.h
@@ -51,4 +51,6 @@ struct mdproc {
void *md_sigtramp;
};
+#define KINFO_PROC_SIZE 1088
+
#endif /* !_MACHINE_PROC_H_ */
diff --git a/sys/sys/user.h b/sys/sys/user.h
index d5e46fe..34635e3 100644
--- a/sys/sys/user.h
+++ b/sys/sys/user.h
@@ -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 */
OpenPOWER on IntegriCloud