From: Michael Neuling <mikey@neuling.org>
To: Benjamin Herrenschmidt <benh@kernel.crashing.org>,
Kumar Gala <galak@kernel.crashing.org>
Cc: linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org
Subject: [RFC/PATCH 2/7] Rearrange include files to make struct call_single_data usable in more places
Date: Tue, 07 Dec 2010 10:40:45 +1100 [thread overview]
Message-ID: <20101206234049.880246100@neuling.org> (raw)
In-Reply-To: 20101206234043.083045003@neuling.org
We need to put struct call_single_data in the powerpc thread_struct,
but can't without this.
The thread_struct is in processor.h. To add a struct call_single_data
to the thread_struct asm/processor.h must include linux/smp.h. When
linux/smp.h is added to processor.h this creates an include loop via
with list.h via:
linux/list.h includes:
linux/prefetch.h includes:
asm/processor.h (for powerpc) includes:
linux/smp.h includes:
linux/list.h
This loops results in an "incomplete list type" compile when using
struct list_head as used in struct call_single_data.
This patch rearanges some include files to avoid this loop.
Signed-off-by: Michael Neuling <mikey@neuling.org>
---
include/linux/call_single_data.h | 14 ++++++++++++++
include/linux/list.h | 4 +++-
include/linux/smp.h | 8 +-------
3 files changed, 18 insertions(+), 8 deletions(-)
Index: linux-lazy/include/linux/call_single_data.h
===================================================================
--- /dev/null
+++ linux-lazy/include/linux/call_single_data.h
@@ -0,0 +1,14 @@
+#ifndef __LINUX_CALL_SINGLE_DATA_H
+#define __LINUX_CALL_SINGLE_DATA_H
+
+#include <linux/list.h>
+
+struct call_single_data {
+ struct list_head list;
+ void (*func) (void *info);
+ void *info;
+ u16 flags;
+ u16 priv;
+};
+
+#endif /* __LINUX_CALL_SINGLE_DATA_H */
Index: linux-lazy/include/linux/list.h
===================================================================
--- linux-lazy.orig/include/linux/list.h
+++ linux-lazy/include/linux/list.h
@@ -4,7 +4,6 @@
#include <linux/types.h>
#include <linux/stddef.h>
#include <linux/poison.h>
-#include <linux/prefetch.h>
/*
* Simple doubly linked list implementation.
@@ -16,6 +15,9 @@
* using the generic single-entry routines.
*/
+#include <linux/prefetch.h>
+#include <asm/system.h>
+
#define LIST_HEAD_INIT(name) { &(name), &(name) }
#define LIST_HEAD(name) \
Index: linux-lazy/include/linux/smp.h
===================================================================
--- linux-lazy.orig/include/linux/smp.h
+++ linux-lazy/include/linux/smp.h
@@ -9,18 +9,12 @@
#include <linux/errno.h>
#include <linux/types.h>
#include <linux/list.h>
+#include <linux/call_single_data.h>
#include <linux/cpumask.h>
extern void cpu_idle(void);
typedef void (*smp_call_func_t)(void *info);
-struct call_single_data {
- struct list_head list;
- smp_call_func_t func;
- void *info;
- u16 flags;
- u16 priv;
-};
/* total number of cpus in this system (may exceed NR_CPUS) */
extern unsigned int total_cpus;
next prev parent reply other threads:[~2010-12-06 23:40 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-12-06 23:40 [RFC/PATCH 0/7] powerpc: Implement lazy save of FP, VMX and VSX state in SMP Michael Neuling
2010-12-06 23:40 ` [RFC/PATCH 1/7] Add csd_locked function Michael Neuling
2010-12-06 23:40 ` Michael Neuling [this message]
2010-12-06 23:40 ` [RFC/PATCH 3/7] powerpc: Reorganise powerpc include files to make call_single_data Michael Neuling
2010-12-06 23:40 ` [RFC/PATCH 4/7] powerpc: Change fast_exception_return to restore r0, r7. r8, and CTR Michael Neuling
2010-12-06 23:40 ` [RFC/PATCH 5/7] powerpc: Enable lazy save VMX registers for SMP Michael Neuling
2010-12-06 23:40 ` [RFC/PATCH 6/7] powerpc: Enable lazy save FP " Michael Neuling
2010-12-06 23:40 ` [RFC/PATCH 7/7] powerpc: Enable lazy save VSX " Michael Neuling
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20101206234049.880246100@neuling.org \
--to=mikey@neuling.org \
--cc=benh@kernel.crashing.org \
--cc=galak@kernel.crashing.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).