From: Steven Rostedt <rostedt@goodmis.org>
To: linux-kernel@vger.kernel.org
Cc: Linus Torvalds <torvalds@linux-foundation.org>,
Andrew Morton <akpm@linux-foundation.org>,
Ingo Molnar <mingo@elte.hu>, Chris Wright <chrisw@sous-sol.org>,
Rusty Russell <rusty@rustcorp.com.au>, Andi Kleen <ak@muc.de>,
Glauber de Oliveira Costa <glommer@gmail.com>
Subject: [PATCH 00/18] Make common x86 arch area for i386 and x86_64 - Take 2
Date: Wed, 14 Mar 2007 01:08:19 -0400 [thread overview]
Message-ID: <20070314050819.536207642@goodmis.org> (raw)
[Hopefully fixed email client to make it to the list this time]
[This series has changed by using git-diff -M]
Recently I've been doing some work that will affect both the i386 and x86_64
architectures. So there will be common code for both, as well as code
that will be unique for the specific arch. So I was looking into a way
to do this cleanly, and found that there is no clean way to share code
between x86_64 and i386.
What we have currently is a bunch of hacks. Seems that people can't make
up their mind to what to do.
We have hack 1.
===============
Reference code from i386 in the x86_64 Makefiles.
Examples:
therm_throt-y += ../../i386/kernel/cpu/mcheck/therm_throt.o
bootflag-y += ../../i386/kernel/bootflag.o
[tabs screwed up, because the above can't be consistant on that either]
We have hack 2.
===============
Reference code from x86_64 in the i386 Makefiles.
Examples:
k8-y += ../../x86_64/kernel/k8.o
stacktrace-y += ../../x86_64/kernel/stacktrace.o
[again the tabs too are messed up]
[--ok I'm sure I mess up the tabs too in my code--]
Now my favorite hacks!
We have hack 3.
===============
Make a sole file with just an include pointer to the i386 code.
rostedt@bilbo:~/work/git/linus.git$ cat arch/x86_64/lib/msr-on-cpu.c
#include "../../i386/lib/msr-on-cpu.c"
rostedt@bilbo:~/work/git/linus.git$
We have hack 4.
===============
Make a sole file with just an include pointer to the x86_64 code.
rostedt@bilbo:~/work/git/linus.git$ cat arch/i386/kernel/early_printk.c
#include "../../x86_64/kernel/early_printk.c"
rostedt@bilbo:~/work/git/linus.git$
So I spent last night hacking up something to try to make a common ground
for all code that is shared between x86_64 and i386. I called this
arch/x86
Seems appropriate, but I really don't care what it's called. One thing about
this name, is that typing arch/x86<Tab> doesn't tab complete x86_64 anymore.
But if you can think of something better, I'd be happy to apply it.
So the following set of patches moves common code into the arch/x86 area
and updates the i386 and x86_64 files accordingly. I separated the
patches into files that hold just Makefile changes, Kconfig changes, and
the actual moves of files.
The moves are now represted in its own patch, with one big rename patch,
using the git-diff -M format.
So the moves are simply renames, with the slight exception
of files that hold the speedstep-lib.h file. This file was moved from the
arch/i386/kerne/cpu/cpufreq directory and put into the include/asm-i386
directory. This was due to the fact that some of the moved files included
it, and some files that were not moved also included it. Instead of using
the #include "../../x86/" hack again, I just simply moved it to the global
i386 include directory. Only the arch/x86 will use the include/asm-i386
change. But to make this change the move patches of the files that contain
this change also contain the changes to reference the change to locate this
file.
With this change of having a single repo that holds both the x86_64 files
as well as the i386 code, it becomes obvious of what files are being shared.
This way we don't have to worry about someone changing a file in either
x86_64 or i386 and having it break the other arch, because they didn't
realize it was being shared.
Note: I left out all the shared pci code. It seems that this code is placed
special in the Makefiles for linking order or what not, and I don't want to
spend the time sorting that out without knowing if these changes are acceptible
or not.
-- Steve
PS. Sorry for the spam. I need to figure out how to tame quilt mail!
--
next reply other threads:[~2007-03-14 5:13 UTC|newest]
Thread overview: 82+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-03-14 5:08 Steven Rostedt [this message]
2007-03-14 5:08 ` [PATCH 01/18] toplevel Kconfig changes Steven Rostedt
2007-03-14 5:08 ` [PATCH 02/18] x86 Makefile changes Steven Rostedt
2007-03-14 5:08 ` [PATCH 03/18] acpi Makefile updates Steven Rostedt
2007-03-14 5:08 ` [PATCH 04/18] make the cpu/cpufreq/Makefile Steven Rostedt
2007-03-14 5:08 ` [PATCH 05/18] mv kernel/cpu/cpufreq/p4-clockmod.c Steven Rostedt
2007-03-14 5:08 ` [PATCH 06/18] mv kernel/cpu/cpufreq/speedstep-lib.h Steven Rostedt
2007-03-14 5:08 ` [PATCH 07/18] mv kernel/cpu/cpufreq/speedstep-lib.c Steven Rostedt
2007-03-14 5:08 ` [PATCH 08/18] create x86/kernel/cpu/Makefile Steven Rostedt
2007-03-14 5:08 ` [PATCH 09/18] create x86/kernel/cpu/mcheck/Makefile Steven Rostedt
2007-03-14 5:08 ` [PATCH 10/18] make the kernel Makefile Steven Rostedt
2007-03-14 5:08 ` [PATCH 11/18] rm include pointer to x86_64 early_printk.c Steven Rostedt
2007-03-14 5:08 ` [PATCH 12/18] rm include pointer to x86_64 tsc_sync.c Steven Rostedt
2007-03-14 5:08 ` [PATCH 13/18] create x86/lib/Makefile Steven Rostedt
2007-03-14 5:08 ` [PATCH 14/18] rm include pointer to i386 msr-on-cpu.c file Steven Rostedt
2007-03-14 5:08 ` [PATCH 15/18] create x86/mm/Makefile Steven Rostedt
2007-03-14 5:08 ` [PATCH 16/18] kconfig for oprofile Steven Rostedt
2007-03-14 5:08 ` [PATCH 17/18] create x86/oprofile/Makefile Steven Rostedt
2007-03-14 5:08 ` [PATCH 18/18] Straight file moves Steven Rostedt
2007-03-14 15:44 ` Linus Torvalds
2007-03-14 16:11 ` Steven Rostedt
2007-03-14 8:00 ` [PATCH 00/18] Make common x86 arch area for i386 and x86_64 - Take 2 Jan Engelhardt
2007-03-14 16:52 ` Linus Torvalds
2007-03-14 10:36 ` Andi Kleen
2007-03-14 9:48 ` sujay g
2007-03-14 12:35 ` Steven Rostedt
2007-03-14 13:05 ` Andi Kleen
2007-03-14 13:36 ` Steven Rostedt
2007-03-14 18:47 ` Andi Kleen
2007-03-14 18:57 ` Jeremy Fitzhardinge
2007-03-14 12:53 ` Ingo Molnar
2007-03-14 13:33 ` Steven Rostedt
2007-03-14 13:41 ` Ingo Molnar
2007-03-14 14:46 ` Steven Rostedt
2007-03-14 16:33 ` Jan Engelhardt
2007-03-14 17:39 ` Steven Rostedt
2007-03-14 17:51 ` Linus Torvalds
2007-03-14 16:49 ` Linus Torvalds
2007-03-14 18:15 ` Ingo Molnar
2007-03-15 16:50 ` Nick Piggin
2007-03-15 17:26 ` Andi Kleen
2007-03-14 15:54 ` Linus Torvalds
2007-03-14 18:09 ` Ingo Molnar
2007-03-14 18:27 ` Linus Torvalds
2007-03-14 19:59 ` Ingo Molnar
2007-03-14 20:07 ` Andi Kleen
2007-03-14 20:19 ` Ingo Molnar
2007-03-14 20:34 ` Andi Kleen
2007-03-14 20:11 ` Ingo Molnar
2007-03-14 20:21 ` Andi Kleen
2007-03-14 21:34 ` Jan Engelhardt
2007-03-15 15:50 ` Martin Bligh
2007-03-15 15:59 ` Linus Torvalds
2007-03-15 16:06 ` Andi Kleen
2007-03-15 16:23 ` Linus Torvalds
2007-03-15 16:47 ` Steven Rostedt
2007-03-15 16:57 ` Steven Rostedt
2007-03-15 17:01 ` Andi Kleen
2007-03-15 17:21 ` Steven Rostedt
2007-03-16 4:28 ` Christoph Lameter
2007-03-16 11:44 ` Andi Kleen
2007-03-16 20:15 ` Christoph Lameter
2007-03-16 20:25 ` Martin Bligh
2007-03-16 20:48 ` Christoph Lameter
2007-03-16 20:53 ` David Miller
2007-03-16 20:56 ` Christoph Lameter
2007-03-16 20:58 ` David Miller
2007-03-16 20:59 ` Martin Bligh
2007-03-16 21:02 ` Christoph Lameter
2007-03-16 21:51 ` Linus Torvalds
2007-03-19 14:27 ` Andy Whitcroft
2007-03-16 20:47 ` David Miller
2007-03-16 20:52 ` Christoph Lameter
2007-03-16 20:55 ` David Miller
2007-03-16 20:59 ` Christoph Lameter
2007-03-16 20:59 ` Dave Hansen
2007-03-18 23:10 ` Linus Torvalds
2007-03-19 11:08 ` Andi Kleen
2007-03-15 20:02 ` Jan Engelhardt
2007-03-14 15:49 ` Linus Torvalds
2007-03-14 18:40 ` Adrian Bunk
2007-03-16 4:07 ` Kasper Sandberg
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=20070314050819.536207642@goodmis.org \
--to=rostedt@goodmis.org \
--cc=ak@muc.de \
--cc=akpm@linux-foundation.org \
--cc=chrisw@sous-sol.org \
--cc=glommer@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=rusty@rustcorp.com.au \
--cc=torvalds@linux-foundation.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