Linux-kernel mailing list archive 2000-06,: Memory Started not at 0x00000000

# Memory Started not at 0x00000000

NIIBE Yutaka (gniibe@chroot.org)
Tue, 8 Feb 2000 10:50:31 +0900

- Messages sorted by: [ date ][ thread ][ subject ][ author ]
- Next message: Brion Vibber: "Re: Booting and Ultra-66"
- Previous message: Kanoj Sarcar: "Re: Memory Started not at 0x00000000"
- Next in thread: Kanoj Sarcar: "Re: Memory Started not at 0x00000000"
- Reply: Kanoj Sarcar: "Re: Memory Started not at 0x00000000"

Hello Ingo and Kanoj,

Here are proposal patches for the architecture which memory doesn't
start at 0x00000000, specifically for SuperH. Patches are against
2.3.43-pre1.

It changes init_bootmem API so that it can specify Page Frame Number
of the memory start address. The function init_bootmem records it
as start_pfn, which is later used at free_area_init.

Please consider about the issue and possibly apply the patches.

Regards,

    --
    Niibe Yutaka

    diff -urN linux-2.3.43-pre1/include/linux/bootmem.h linux-sh/include/linux/bootmem.h
    --- linux-2.3.43-pre1/include/linux/bootmem.h	Sat Jan 29 01:01:37 2000
    +++ linux-sh/include/linux/bootmem.h	Sat Feb  5 12:52:45 2000
    @@ -13,7 +13,7 @@
      *  simple boot-time physical memory area allocator.
      */

    -extern unsigned long max_low_pfn;
    +extern unsigned long start_pfn, max_low_pfn;

     /*
      * node_bootmem_map is a map pointer - the bits represent all physical
    @@ -28,7 +28,7 @@
     } bootmem_data_t;

     extern unsigned long __init bootmem_bootmap_pages (unsigned long);
    -extern unsigned long __init init_bootmem (unsigned long addr, unsigned long memend);
    +extern unsigned long __init init_bootmem (unsigned long addr, unsigned long memend, unsigned long mem_start);
     extern void __init reserve_bootmem (unsigned long addr, unsigned long size);
     extern void __init free_bootmem (unsigned long addr, unsigned long size);
     extern void * __init __alloc_bootmem (unsigned long size, unsigned long align, unsigned long goal);
    diff -urN linux-2.3.43-pre1/mm/bootmem.c linux-sh/mm/bootmem.c
    --- linux-2.3.43-pre1/mm/bootmem.c	Tue Dec 21 14:59:45 1999
    +++ linux-sh/mm/bootmem.c	Sun Jan  9 15:14:05 2000
    @@ -23,7 +23,7 @@
      * Access to this subsystem has to be serialized externally. (this is
      * true for the boot process anyway)
      */
    -unsigned long max_low_pfn;
    +unsigned long start_pfn, max_low_pfn;

     /* return the number of _pages_ that will be allocated for the boot bitmap */
     unsigned long __init bootmem_bootmap_pages (unsigned long pages)
    @@ -279,10 +279,12 @@
     	return(free_all_bootmem_core(nid, NODE_DATA(nid)->bdata));
     }

    -unsigned long __init init_bootmem (unsigned long start, unsigned long pages)
    +unsigned long __init init_bootmem (unsigned long start, unsigned long pages,
    +				   unsigned long mem_start)
     {
    +	start_pfn = mem_start;
     	max_low_pfn = pages;
    -	return(init_bootmem_core(NODE_DATA(0)->bdata, start, 0, pages));
    +	return(init_bootmem_core(NODE_DATA(0)->bdata, start, mem_start, pages));
     }

     void __init reserve_bootmem (unsigned long addr, unsigned long size)
    diff -urN linux-2.3.43-pre1/mm/page_alloc.c linux-sh/mm/page_alloc.c
    --- linux-2.3.43-pre1/mm/page_alloc.c	Thu Jan 27 06:19:15 2000
    +++ linux-sh/mm/page_alloc.c	Sun Jan 30 18:54:38 2000
    @@ -624,7 +624,7 @@

     void __init free_area_init(unsigned int *zones_size)
     {
    -	free_area_init_core(0, NODE_DATA(0), &mem_map, zones_size, 0);
    +	free_area_init_core(0, NODE_DATA(0), &mem_map, zones_size, start_pfn<<PAGE_SHIFT);
     }

     static int __init setup_mem_frac(char *str)

    --

    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.rutgers.edu
    Please read the FAQ at http://www.tux.org/lkml/

     Next message: Brion Vibber: "Re: Booting and Ultra-66"
     Previous message: Kanoj Sarcar: "Re: Memory Started not at 0x00000000"

     Next in thread: Kanoj Sarcar: "Re: Memory Started not at 0x00000000"
     Reply: Kanoj Sarcar: "Re: Memory Started not at 0x00000000"