* Microblaze noMMU/MMU merge
@ 2009-04-21 7:45 Michal Simek
2009-04-21 7:57 ` Paul Mundt
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: Michal Simek @ 2009-04-21 7:45 UTC (permalink / raw)
To: Ingo Molnar, lkml, Andrew Morton, Arnd Bergmann,
Linux Kernel list
Hi All,
I would like to say your opinion about putting together Microblaze MMU
arch to noMMU version.
In C code will be #ifdef CONFIG_MMU ... #endif or #ifndef.
Here is proposal for headers. The similar style is used in m68k but I
would like to have the same code
for both archs in main file.
#ifndef _ASM_MICROBLAZE_PAGE_H
#define _ASM_MICROBLAZE_PAGE_H
code for noMMU and MMU which is the same for both.
#ifdef __uClinux__
#include "page_no.h" -> noMMU specific
#else
#include "page_mm.h"-> MMU specific
#endif
#endif /* _ASM_MICROBLAZE_PAGE_H */
Thanks for your suggestion,
Michal
--
Michal Simek, Ing. (M.Eng)
PetaLogix - Linux Solutions for a Reconfigurable World
w: www.petalogix.com p: +61-7-30090663,+42-0-721842854 f: +61-7-30090663
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: Microblaze noMMU/MMU merge
2009-04-21 7:45 Microblaze noMMU/MMU merge Michal Simek
@ 2009-04-21 7:57 ` Paul Mundt
2009-04-21 8:25 ` Sam Ravnborg
2009-04-21 11:06 ` Greg Ungerer
2 siblings, 0 replies; 5+ messages in thread
From: Paul Mundt @ 2009-04-21 7:57 UTC (permalink / raw)
To: Michal Simek
Cc: Ingo Molnar, lkml, Andrew Morton, Arnd Bergmann,
Linux Kernel list
On Tue, Apr 21, 2009 at 09:45:47AM +0200, Michal Simek wrote:
> I would like to say your opinion about putting together Microblaze MMU
> arch to noMMU version.
>
> In C code will be #ifdef CONFIG_MMU ... #endif or #ifndef.
>
> Here is proposal for headers. The similar style is used in m68k but I
> would like to have the same code
> for both archs in main file.
>
> #ifndef _ASM_MICROBLAZE_PAGE_H
> #define _ASM_MICROBLAZE_PAGE_H
>
> code for noMMU and MMU which is the same for both.
>
> #ifdef __uClinux__
> #include "page_no.h" -> noMMU specific
> #else
> #include "page_mm.h"-> MMU specific
> #endif
> #endif /* _ASM_MICROBLAZE_PAGE_H */
>
There's really not that much code that you need to change in order to
support nommu, as long as you designed your architecture port to be
fairly compartmentalized. Take a look at some of the other architectures
in-tree that support both in the same architecture backend. sh was the
first to support a configurable CONFIG_MMU during the 2.5 days, but there
are others now as well (though I don't know how actively the others are
maintained -- nommu people tend to be even worse (!) than general
embedded people at hanging around).
In addition to sh, at least frv, m32r, and arm support a configurable
CONFIG_MMU these days. xtensa seems to have just recently joined the
club, too.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Microblaze noMMU/MMU merge
2009-04-21 7:45 Microblaze noMMU/MMU merge Michal Simek
2009-04-21 7:57 ` Paul Mundt
@ 2009-04-21 8:25 ` Sam Ravnborg
2009-04-21 9:46 ` Michal Simek
2009-04-21 11:06 ` Greg Ungerer
2 siblings, 1 reply; 5+ messages in thread
From: Sam Ravnborg @ 2009-04-21 8:25 UTC (permalink / raw)
To: Michal Simek
Cc: Ingo Molnar, lkml, Andrew Morton, Arnd Bergmann,
Linux Kernel list
On Tue, Apr 21, 2009 at 09:45:47AM +0200, Michal Simek wrote:
> Hi All,
>
> I would like to say your opinion about putting together Microblaze MMU
> arch to noMMU version.
>
> In C code will be #ifdef CONFIG_MMU ... #endif or #ifndef.
>
> Here is proposal for headers. The similar style is used in m68k but I
> would like to have the same code
> for both archs in main file.
>
> #ifndef _ASM_MICROBLAZE_PAGE_H
> #define _ASM_MICROBLAZE_PAGE_H
>
> code for noMMU and MMU which is the same for both.
>
> #ifdef __uClinux__
> #include "page_no.h" -> noMMU specific
> #else
> #include "page_mm.h"-> MMU specific
> #endif
> #endif /* _ASM_MICROBLAZE_PAGE_H */
Use dedicated header files for nommu / mmu only when it is really necessary.
In headers that are _NOT_ exported you can use CONFIG_MMU to test
if you are building for MMU or not - which is more readable.
The reason why you cannot use CONFIG_MMU in exported headers
are that CONFIG_MMU is not valid in the userspace headers (not set/unset).
In the optimal case you have no conditionals in the exported haders
and then just use CONFIG_MMU all over.
Sam
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Microblaze noMMU/MMU merge
2009-04-21 8:25 ` Sam Ravnborg
@ 2009-04-21 9:46 ` Michal Simek
0 siblings, 0 replies; 5+ messages in thread
From: Michal Simek @ 2009-04-21 9:46 UTC (permalink / raw)
To: Sam Ravnborg
Cc: Ingo Molnar, lkml, Andrew Morton, Arnd Bergmann,
Linux Kernel list
Sam Ravnborg wrote:
> On Tue, Apr 21, 2009 at 09:45:47AM +0200, Michal Simek wrote:
>
>> Hi All,
>>
>> I would like to say your opinion about putting together Microblaze MMU
>> arch to noMMU version.
>>
>> In C code will be #ifdef CONFIG_MMU ... #endif or #ifndef.
>>
>> Here is proposal for headers. The similar style is used in m68k but I
>> would like to have the same code
>> for both archs in main file.
>>
>> #ifndef _ASM_MICROBLAZE_PAGE_H
>> #define _ASM_MICROBLAZE_PAGE_H
>>
>> code for noMMU and MMU which is the same for both.
>>
>> #ifdef __uClinux__
>> #include "page_no.h" -> noMMU specific
>> #else
>> #include "page_mm.h"-> MMU specific
>> #endif
>> #endif /* _ASM_MICROBLAZE_PAGE_H */
>>
>
> Use dedicated header files for nommu / mmu only when it is really necessary.
>
> In headers that are _NOT_ exported you can use CONFIG_MMU to test
> if you are building for MMU or not - which is more readable.
>
> The reason why you cannot use CONFIG_MMU in exported headers
> are that CONFIG_MMU is not valid in the userspace headers (not set/unset).
>
> In the optimal case you have no conditionals in the exported haders
> and then just use CONFIG_MMU all over.
>
ok. I'll create first proposal and you can look if is ok or not.
Thanks.
Michal
> Sam
>
>
--
Michal Simek, Ing. (M.Eng)
PetaLogix - Linux Solutions for a Reconfigurable World
w: www.petalogix.com p: +61-7-30090663,+42-0-721842854 f: +61-7-30090663
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Microblaze noMMU/MMU merge
2009-04-21 7:45 Microblaze noMMU/MMU merge Michal Simek
2009-04-21 7:57 ` Paul Mundt
2009-04-21 8:25 ` Sam Ravnborg
@ 2009-04-21 11:06 ` Greg Ungerer
2 siblings, 0 replies; 5+ messages in thread
From: Greg Ungerer @ 2009-04-21 11:06 UTC (permalink / raw)
To: michal.simek
Cc: Ingo Molnar, lkml, Andrew Morton, Arnd Bergmann,
Linux Kernel list
Hi Michal,
Michal Simek wrote:
> I would like to say your opinion about putting together Microblaze MMU
> arch to noMMU version.
>
> In C code will be #ifdef CONFIG_MMU ... #endif or #ifndef.
>
> Here is proposal for headers. The similar style is used in m68k but I
> would like to have the same code
> for both archs in main file.
>
> #ifndef _ASM_MICROBLAZE_PAGE_H
> #define _ASM_MICROBLAZE_PAGE_H
>
> code for noMMU and MMU which is the same for both.
>
> #ifdef __uClinux__
> #include "page_no.h" -> noMMU specific
> #else
> #include "page_mm.h"-> MMU specific
> #endif
> #endif /* _ASM_MICROBLAZE_PAGE_H */
Breaking up the files that way is really only temporary. They will
eventually all be merged back to single files (I have probably
reworked about 60% of them so far). There ends up being very little
difference.
I would keep single files if you could.
Regards
Greg
------------------------------------------------------------------------
Greg Ungerer -- Principal Engineer EMAIL: gerg@snapgear.com
SnapGear Group, McAfee PHONE: +61 7 3435 2888
825 Stanley St, FAX: +61 7 3891 3630
Woolloongabba, QLD, 4102, Australia WEB: http://www.SnapGear.com
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2009-04-21 11:06 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-04-21 7:45 Microblaze noMMU/MMU merge Michal Simek
2009-04-21 7:57 ` Paul Mundt
2009-04-21 8:25 ` Sam Ravnborg
2009-04-21 9:46 ` Michal Simek
2009-04-21 11:06 ` Greg Ungerer
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox