: linux-2.5.42uc1 (MMU-less support)
PATCH 1/1 : linux-2.5.42uc1 (MMU-less support)
Hi All,
An updated uClinux patch is available at:
http://www.uclinux.org/pub/uClinux/uClinux-2.5.x/linux-2.5.42uc1.patch.gz
Changelog:
1. v850 update
2. cleaned up mm/page_alloc.c
Smaller specific patches:
. FEC ColdFire 5272 ethernet driver
http://www.uclinux.org/pub/uClinux/uClinux-2.5.x/linux-2.5.42uc1-fec.patch.gz
. m68k/ColdFire/v850 serial drivers
http://www.uclinux.org/pub/uClinux/uClinux-2.5.x/linux-2.5.42uc1-serial.patch.gz
. 68328 frame buffer
http://www.uclinux.org/pub/uClinux/uClinux-2.5.x/linux-2.5.42uc1-fb.patch.gz
. binfmt_flat loader
http://www.uclinux.org/pub/uClinux/uClinux-2.5.x/linux-2.5.42uc1-binflat.patch.gz
. m68knommu architecture
http://www.uclinux.org/pub/uClinux/uClinux-2.5.x/linux-2.5.42uc1-m68knommu.patch.gz
. v850 architecture
http://www.uclinux.org/pub/uClinux/uClinux-2.5.x/linux-2.5.42uc1-v850.patch.gz
. mm (MMU-less) only patch
http://www.uclinux.org/pub/uClinux/uClinux-2.5.x/linux-2.5.42uc1-mm.patch.gz
Regards
Greg
------------------------------------------------------------------------
Greg Ungerer -- Chief Software Wizard EMAIL: [email protected]
Snapgear Pty Ltd PHONE: +61 7 3279 1822
825 Stanley St, FAX: +61 7 3279 1820
Woolloongabba, QLD, 4102, Australia WEB: www.SnapGear.com
Quoted 9 lines · Greg Ungerer
Hi All,
An updated uClinux patch is available at:
http://www.uclinux.org/pub/uClinux/uClinux-2.5.x/linux-2.5.42uc1.patch.gz
Changelog:
1. v850 update
There are a bunch of CVS .#* files left from this one. v850_defs.h wants updating to the generic generate-asm-offsets.h mechanism (check the toplevel Makefile)
Please stop the ugly symlink hell with the linker scripts - we have vmlinux.lds.S for that.
it should read something like:
#include <linux/config.h>
#ifdef BOARD1
#include "board1.lds"
#else
...
#endif
for v850
Could you please explain the rootfs hacks in v850? I don't think we want those in mainline but rather generic initrd/initramfs.
Also please remove arch/v850/sim/* - that stuff doesn't belong into the kernel tree.
Quoted 1 line
2. cleaned up
mm/page_alloc.c
Why do you put set_page_refs into a header? Separating it out looks good to me, but IMHO it should stay in page_alloc.c. BTW, are you sure that you don't need to set the refs in the other caller of prep_new_page? To me it looks like you should and then you could merge it into prep_new_page.
Also, what is CONFIG_CONTIGUOUS_PAGE_ALLOC doing? It seems not fully implemented but adds lots of uglieness :) CONFIG_NO_MMU_LARGE_ALLOCS might want a saner name, btw (CONFIG_LARGE_ALLOCS?).
General commets:
- Config.in files have three-space, not two-space indentation
- I don't think you want to keep around the old binfmt_flat format when merghin into mainline
- MAX_SHARED_LIBS is never used
Hi Christoph,
Quoted 1 line · Christoph Hellwig
There are a bunch of CVS .#* files left from this one.
Cleaned out now.
Quoted 2 lines
v850_defs.hwants updating to the genericgenerate-asm-offsets.hmechanism (check the toplevelMakefile)
Miles cleaned this up.
Quoted 2 lines
Please stop the ugly symlink hell with the linker scripts - we have
vmlinux.lds.Sfor that.
Hmph. Hardly seems any better...
Quoted 6 lines
Could you please explain the rootfs hacks in v850? I don't think we want those in mainline but rather generic initrd/initramfs.
Also please remove
arch/v850/sim/*- that stuff doesn't belong into the kernel tree.
Done.
Quoted 3 lines
Quoted 1 line
2. cleaned up
mm/page_alloc.cWhy do you put
set_page_refsinto a header?
It looked might it might be usefull elsewhere.
(but currently isn't used for anything else).
Quoted 5 lines
Separating it out
looks good to me, but IMHO it should stay inpage_alloc.c. BTW, are you sure that you don't need to set the refs in the other caller ofprep_new_page? To me it looks like you should and then you could merge it intoprep_new_page.
No, you don't want that.
Quoted 2 lines
Also, what is
CONFIG_CONTIGUOUS_PAGE_ALLOCdoing? It seems not fully implemented but adds lots of uglieness :)
It was a second allocator that more cleverly allocated large memory chunks - not using the power of 2 allocator. I have not carried this into the 2.5 patches. Very nice to have, since you suffer much more from memory fragmentation without VM. But not strictly neccessary, and to minimize and simplify the current patch sets I left it out.
Cleanup out all references to it now.
Quoted 2 lines
CONFIG_NO_MMU_LARGE_ALLOCSmight want a saner name, btw (CONFIG_LARGE_ALLOCS?).
Yes, no doubt the NO_MMU name is universally disliked :-) Changed to COFNIG_LARGE_ALLOCS now.
Quoted 3 lines
General commets:
- Config.in files have three-space, not two-space indentation
Fixed.
Quoted 1 line
- I don't think you want to keep around the old
binfmt_flat
This isn't old. It is the primary format used on uClinux. ELF and a.out are not practical, since you would need to do the final link/locate on them at exec load time (you won't know what address in memory they will get loaded to until them). You don have the VM luxary of just locating it at a fixed address at compile time.
FLAT format is a light weight, mostly architecture independant way to carry around relocs, and to keep the program binaries small.
Quoted 2 lines
format when merghin into mainline
-MAX_SHARED_LIBSis never used
Another "feature" I have not carried into 2.5. Removed.
Thanks
Greg
Signature · 5 lines
------------------------------------------------------------------------ Greg Ungerer -- Chief Software Wizard EMAIL: [email protected] SnapGear Pty Ltd PHONE: +61 7 3435 2888 825 Stanley St, FAX: +61 7 3891 3630 Woolloongabba, QLD, 4102, Australia WEB: www.SnapGear.com
Quoted 9 lines
This isn't old. It is the primary format used on uClinux. ELF and a.out are not practical, since you would need to do the final link/locate on them at exec load time (you won't know what address in memory they will get loaded to until them). You don have the VM luxary of just locating it at a fixed address at compile time.
FLAT format is a light weight, mostly architecture independant way to carry around relocs, and to keep the program binaries small.
I don't meant binfmt_flat itself but the support for the old-style relocs that is still in the code.
BTW, does binfmt_flat for for any non-uClinux port?
Quoted 6 lines · Christoph Hellwig
Quoted 6 lines
This isn't old. It is the primary format used on uClinux. ELF and a.out are not practical, since you would need to do the final link/locate on them at exec load time (you won't know what address in memory they will get loaded to until them). You don have the VM luxary of just locating it at a fixed address at compile time.
Quoted 7 lines
Quoted 4 lines
FLAT format is a light weight, mostly architecture independant way to carry around relocs, and to keep the program binaries small.
I don't meant
binfmt_flatitself but the support for the old-style relocs that is still in the code.
OK, I'll have a look at that.
Quoted 1 line
BTW, does
binfmt_flatfor for any non-uClinux port?
Don't beleive so.
Regards
Greg
------------------------------------------------------------------------
Greg Ungerer -- Chief Software Wizard EMAIL: [email protected]
SnapGear Pty Ltd PHONE: +61 7 3435 2888
825 Stanley St, FAX: +61 7 3891 3630
Woolloongabba, QLD, 4102, Australia WEB: www.SnapGear.com
PATCH 1/1 Make some EXPORT_SYMBOLs dependent on CONFIG_MMU
In reply to Christoph Hellwig[I'm not sure who to send this to, so I'm guessing. Pointers appreciated!]
Hi,
A few symbols are only defined when CONFIG_MMU=y, but are exported (by kernel/ksyms.c) unconditionally. This patch makes them conditional.
Patch:
ksyms.c renamed from orig/linux-2.5.49-uc0/kernel/ksyms.c +4 -0
@@ -324,7 +324,9 @@/* for stackable file systems (lofs, wrapfs, cryptfs, etc.) */ EXPORT_SYMBOL (default_llseek);EXPORT_SYMBOL (dentry_open); +#ifdef CONFIG_MMU EXPORT_SYMBOL (filemap_nopage); +#endif EXPORT_SYMBOL (filemap_fdatawrite);EXPORT_SYMBOL (filemap_fdatawait);EXPORT_SYMBOL (lock_page);
@@ -525,7 +527,9 @@EXPORT_SYMBOL (single_release);/* Program loader interfaces */ +#ifdef CONFIG_MMU EXPORT_SYMBOL (setup_arg_pages); +#endif EXPORT_SYMBOL (copy_strings_kernel);EXPORT_SYMBOL (do_execve);EXPORT_SYMBOL (flush_old_exec);
Thanks,
-Miles
Signature · 2 lines
Love is a snowmobile racing across the tundra. Suddenly it flips over, pinning you underneath. At night the ice weasels come. --Nietzsche
PATCH 1/1 v850 additions to include/linux/elf.h
In reply to Christoph HellwigHi,
This patch adds more stuff to include/linux/elf.h for the v850 (used by the new module loader).
Patch:
linux/elf.h renamed from orig/linux-2.5.49-uc0/include/linux/elf.h +28 -0
@@ -92,6 +92,9 @@*/ #define EM_ALPHA 0x9026 +/* Bogus old v850 magic number, used by old tools. */ +#define EM_CYGNUS_V850 0x9080 +/* * This is the old interim value for S/390 architecture */
@@ -450,6 +453,31 @@/* Keep this the last entry. */ #define R_390_NUM 27 + +/* v850 relocations. */ +#define R_V850_NONE 0 +#define R_V850_9_PCREL 1 +#define R_V850_22_PCREL 2 +#define R_V850_HI16_S 3 +#define R_V850_HI16 4 +#define R_V850_LO16 5 +#define R_V850_32 6 +#define R_V850_16 7 +#define R_V850_8 8 +#define R_V850_SDA_16_16_OFFSET 9/* For ld.b, st.b, set1, clr1, +not1, tst1, movea, movhi */ +#define R_V850_SDA_15_16_OFFSET 10/* For ld.w, ld.h, ld.hu, st.w, st.h */ +#define R_V850_ZDA_16_16_OFFSET 11/* For ld.b, st.b, set1, clr1, +not1, tst1, movea, movhi */ +#define R_V850_ZDA_15_16_OFFSET 12/* For ld.w, ld.h, ld.hu, st.w, st.h */ +#define R_V850_TDA_6_8_OFFSET 13/* For sst.w, sld.w */ +#define R_V850_TDA_7_8_OFFSET 14/* For sst.h, sld.h */ +#define R_V850_TDA_7_7_OFFSET 15/* For sst.b, sld.b */ +#define R_V850_TDA_16_16_OFFSET 16/* For set1, clr1, not1, tst1, +movea, movhi */ +#define R_V850_NUM 17 + +/* Legal values for e_flags field of Elf64_Ehdr. */ #define EF_ALPHA_32BIT 1/* All addresses are below 2GB */
Thanks,
-Miles
Signature · 3 lines
[|nurgle|] ddt- demonic? so quake will have an evil kinda setting? one that
will make every christian in the world foamm at the mouth?
[iddt] nurg, that's the goal Re: [PATCH] v850 additions to include/linux/elf.h
Quoted 4 lines · Miles Bader
Hi,
This patch adds more stuff to
include/linux/elf.hfor the v850 (used by the new module loader).
To save cluttering a linux/*.h file couldnt the module loader for v850 include an asm/*.h file holding the extra info ?
Re: [PATCH] v850 additions to include/linux/elf.h
Quoted 5 lines · Alan Cox
Quoted 2 lines
This patch adds more stuff to
include/linux/elf.hfor the v850 (used by the new module loader).To save cluttering a linux/*.h file couldnt the module loader for v850 include an asm/*.h file holding the extra info ?
I suppose so, but the v850 is not exceptional in this regard. The various relocation type constants (R_...) in elf.h are completely unused in the kernel on _every_ architecture, except by the new module loader.
If tidying is needed, then it seems like the best thing would be to move all the arch-specific stuff into the corresponding <asm/elf.h> file for each architecture. I presume the reason this hasn't been done is simply convention -- userland elf.h files are also giant conglomerations of defines for every supported architecture ...
-Miles
Signature · 2 lines
Next to fried food, the South has suffered most from oratory. -- Walter Hines Page
Re: [PATCH] v850 additions to include/linux/elf.h
Quoted 5 lines · Miles Bader
If tidying is needed, then it seems like the best thing would be to move all the arch-specific stuff into the corresponding <
asm/elf.h> file for each architecture. I presume the reason this hasn't been done is simply convention -- userlandelf.hfiles are also giant conglomerations of defines for every supported architecture ...
I agree entirely. So lets start with v850 8)
Re: [PATCH] v850 additions to include/linux/elf.h
Quoted 5 lines · Alan Cox
Quoted 3 lines
If tidying is needed, then it seems like the best thing would be to move all the arch-specific stuff into the corresponding <
asm/elf.h> file for each architecture.I agree entirely. So lets start with v850 8)
Okay. I sent the previous patch to Linus and he doesn't seem to have taken it; perhaps your suggestion will fare better.
I'd like to remain consistent with other archs though -- does anyone want to make a patch (I guess just move all the R_... constants) for them?
-Miles
Signature · 1 line
Yo mama's so fat when she gets on an elevator it HAS to go down.
Hi,
Here's a v850 update for 2.5.42uc1.
I addressed two of Christoph Hellwig's concerns, (1) vmlinux.lds.S [barf] and (2) the asm-constant generation mechanism.
He also complained about using the MD driver &c instead of initrd, but I'm not sure what do about that -- it'd be nice to use a `standard' solution, but when I originally looked at the initrd stuff, it seemed very convoluted and confusing; since earlier lkml discussion had pointed to using MD as the nearest thing to the old blkmem device, that seemed like the way to go.
What's your opinion on this?
Patch:
v850/Makefile renamed from orig/linux-2.5.42uc1/arch/v850/Makefile +15 -39
@@ -23,32 +23,6 @@ CFLAGS += -D__linux__ -DUTS_SYSNAME=\"uClinux\" -# linker scripts -ifdef CONFIG_V850E_SIM -LINKER_SCRIPT = $(arch_dir)/sim.ld -endif -ifdef CONFIG_V850E2_SIM85E2C -LINKER_SCRIPT = $(arch_dir)/sim85e2c.ld -endif -ifdef CONFIG_V850E2_FPGA85E2C -LINKER_SCRIPT = $(arch_dir)/fpga85e2c.ld -endif -ifdef CONFIG_V850E2_ANNA -LINKER_SCRIPT = $(arch_dir)/anna.ld -endif -ifdef CONFIG_RTE_CB_MA1 -ifdef CONFIG_ROM_KERNEL -LINKER_SCRIPT = $(arch_dir)/rte_ma1_cb-rom.ld -else -ifdef CONFIG_RTE_CB_MA1_KSRAM -LINKER_SCRIPT = $(arch_dir)/rte_ma1_cb-ksram.ld -else -LINKER_SCRIPT = $(arch_dir)/rte_ma1_cb.ld -endif -endif -endif - - HEAD := $(arch_dir)/kernel/head.o $(arch_dir)/kernel/init_task.o core-y += $(arch_dir)/kernel/ libs-y += $(arch_dir)/lib/
@@ -73,17 +47,19 @@ endif -# Barf. -$(arch_dir)/vmlinux.lds.S: $(LINKER_SCRIPT) - cp $< $@ - - -archmrproper: - -archdep: +prepare: include/asm-$(ARCH)/asm-consts.h -archclean: - rm -f vmlinux - rm -f root_fs_image.o - rm -f $(arch_dir)/kernel/v850_defs.h $(arch_dir)/kernel/v850_defs.d - rm -f $(arch_dir)/vmlinux.lds.S $(arch_dir)/vmlinux.lds.s +# Generate constants from C code for use by asm files +arch/$(ARCH)/kernel/asm-consts.s: include/asm include/linux/version.h \ + include/config/MARKER +include/asm-$(ARCH)/asm-consts.h.tmp: arch/$(ARCH)/kernel/asm-consts.s + @$(generate-asm-offsets.h) < $< > $@ +include/asm-$(ARCH)/asm-consts.h: include/asm-$(ARCH)/asm-consts.h.tmp + @echo -n ' Generating $@' + @$(update-if-changed) + + +CLEAN_FILES += include/asm-$(ARCH)/asm-consts.h.tmp \ + include/asm-$(ARCH)/asm-consts.h \ + arch/$(ARCH)/kernel/asm-consts.s \ + root_fs_image.o
v850/kernel/Makefile renamed from orig/linux-2.5.42uc1/arch/v850/kernel/Makefile +0 -14
@@ -36,17 +36,3 @@ include $(TOPDIR)/Rules.make - - -$(obj)/head.o: $(src)/head.S $(obj)/v850_defs.h -$(obj)/entry.o: $(src)/entry.S $(obj)/v850_defs.h - --include $(obj)/v850_defs.d - -$(obj)/v850_defs.h: $(src)/v850_defs.c $(src)/v850_defs.head - rm -f $(obj)/v850_defs.d - SUNPRO_DEPENDENCIES="$(obj)/v850_defs.d $(obj)/v850_defs.h" \ - $(CC) $(filter-out -MD,$(CFLAGS)) -S -o $(obj)/v850_defs.s $(src)/v850_defs.c - cp $(src)/v850_defs.head $(src)/v850_defs.h - grep '^#define' $(obj)/v850_defs.s >> $(obj)/v850_defs.h - rm $(obj)/v850_defs.s
v850/kernel/asm-consts.c renamed from orig/linux-2.5.42uc1/arch/v850/kernel/asm-consts.c +60 -0
60 lines not on this page · raw message
v850/kernel/entry.S renamed from orig/linux-2.5.42uc1/arch/v850/kernel/entry.S +1 -1
@@ -22,7 +22,7 @@ #include <asm/irq.h> #include <asm/errno.h> -#include "v850_defs.h" +#include <asm/asm-consts.h> /* Make a slightly more convenient alias for C_SYMBOL_NAME. */
v850/kernel/v850_defs.c renamed from orig/linux-2.5.42uc1/arch/v850/kernel/v850_defs.c +0 -58
58 lines not on this page · raw message
v850/kernel/v850_defs.head renamed from orig/linux-2.5.42uc1/arch/v850/kernel/v850_defs.head +0 -5
@@ -1,5 +0,0 @@ -/* - * WARNING! This file is automatically generated - DO NOT EDIT! - */ - -#define TS_MAGICKEY 0x5a5a5a5a
v850/vmlinux.lds.S renamed from orig/linux-2.5.42uc1/arch/v850/vmlinux.lds.S +27 -0
@@ -0,0 +1,27 @@ +#include <linux/config.h> + +#ifdef CONFIG_V850E_SIM +#include "sim.ld" +#endif + +#ifdef CONFIG_V850E2_SIM85E2C +#include "sim85e2c.ld" +#endif + +#ifdef CONFIG_V850E2_FPGA85E2C +#include "fpga85e2c.ld" +#endif + +#ifdef CONFIG_V850E2_ANNA +#include "anna.ld" +#endif + +#ifdef CONFIG_RTE_CB_MA1 +# ifdef CONFIG_ROM_KERNEL +# include "rte_ma1_cb-rom.ld" +# elif CONFIG_RTE_CB_MA1_KSRAM +# include "rte_ma1_cb-ksram.ld" +# else /* !CONFIG_ROM_KERNEL && !CONFIG_RTE_CB_MA1_KSRAM */ +# include "rte_ma1_cb.ld" +# endif /* CONFIG_ROM_KERNEL */ +#endif /* CONFIG_RTE_CB_MA1 */
asm-v850/page.h renamed from orig/linux-2.5.42uc1/include/asm-v850/page.h +19 -8
@@ -21,6 +21,7 @@#define PAGE_SIZE (1UL << PAGE_SHIFT)#define PAGE_MASK (~(PAGE_SIZE-1)) +/* * PAGE_OFFSET -- the first address of the first page of memory. For archs with * no MMU this corresponds to the first free page in physical memory (aligned
@@ -30,11 +31,6 @@#define PAGE_OFFSET 0x0000000#endif -/* -* MAP_NR -- given an address, calculate the index of the page struct which -* points to the address's page. -*/ -#define MAP_NR (addr) (((unsigned long)(addr) - PAGE_OFFSET) >> PAGE_SHIFT)#ifdef __KERNEL__#ifndef __ASSEMBLY__
@@ -91,9 +87,11 @@#endif /* !__ASSEMBLY__ */ +/* to align the pointer to the (next) page boundary */ #define PAGE_ALIGN (addr) (((addr) + PAGE_SIZE - 1) & PAGE_MASK) +#ifndef __ASSEMBLY__extern void __bug (void ) __attribute__ ((noreturn));
@@ -116,18 +114,31 @@#endif /* !__ASSEMBLY__ */ -#define __pa (x) __virt_to_phys ((unsigned long)(x)) -#define __va (x) ((void *)__phys_to_virt ((unsigned long)(x)))/* No current v850 processor has virtual memory. */ #define __virt_to_phys (addr) (addr)#define __phys_to_virt (addr) (addr) -#define virt_to_page (kaddr) (mem_map + MAP_NR (kaddr)) +#define virt_to_pfn (kaddr) (__virt_to_phys (kaddr) >> PAGE_SHIFT) +#define pfn_to_virt (pfn) __phys_to_virt ((pfn) << PAGE_SHIFT) + +#define MAP_NR (kaddr) \ + (((unsigned long)(kaddr) - PAGE_OFFSET) >> PAGE_SHIFT) +#define virt_to_page (kaddr) (mem_map + MAP_NR (kaddr)) +#define page_to_virt (page) \ + ((((page) - mem_map) << PAGE_SHIFT) + PAGE_OFFSET) + +#define pfn_to_page (pfn) virt_to_page (pfn_to_virt (pfn)) +#define page_to_pfn (page) virt_to_pfn (page_to_virt (page)) +#define virt_addr_valid (kaddr) \ (((void *)(kaddr) >= (void *)PAGE_OFFSET) && MAP_NR (kaddr) < max_mapnr) +#define __pa (x) __virt_to_phys ((unsigned long)(x)) +#define __va (x) ((void *)__phys_to_virt ((unsigned long)(x))) + +#endif /* KERNEL */ #ifdef CONFIG_CONTIGUOUS_PAGE_ALLOC
Thanks,
-Miles
Signature · 1 line
Occam's razor split hairs so well, I bought the whole argument!
Hi Miles,
Quoted 1 line · Miles Bader
Here's a v850 update for 2.5.42uc1.
I have rolled this into, linux-2.5.43uc0.
I have also removed the gdb patches under arch/v850.
Quoted 9 lines
I addressed two of Christoph Hellwig's concerns, (1)
vmlinux.lds.S[barf] and (2) the asm-constant generation mechanism.He also complained about using the MD driver &c instead of initrd, but I'm not sure what do about that -- it'd be nice to use a `standard' solution, but when I originally looked at the initrd stuff, it seemed very convoluted and confusing; since earlier lkml discussion had pointed to using MD as the nearest thing to the old blkmem device, that seemed like the way to go.
I very much like using a specific MTD map driver. I haven't carried my initrd patches through to the 2.5 code yet. But it was pretty simple to do for 2.4...
Regards
Greg
------------------------------------------------------------------------
Greg Ungerer -- Chief Software Wizard EMAIL: [email protected]
SnapGear Pty Ltd PHONE: +61 7 3435 2888
825 Stanley St, FAX: +61 7 3891 3630
Woolloongabba, QLD, 4102, Australia WEB: www.SnapGear.com