ppc32: Kill embedded system.map, use kallsyms
PATCH 1/1 ppc32: Kill embedded system.map, use kallsyms
Hi !
This patch kills the whole embedded System.map mecanism and the bootloader-passed System.map that was used to provide symbol resolution in xmon. Instead, xmon now uses kallsyms like ppc64 does.
Andrew: No hurry getting that in Linus tree, let it be tested in -mm for a while first and make sure it doesn't break various embedded configs.
Signed-off-by Benjamin Herrenschmidt <[email protected]>
arch/ppc64/xmon/xmon.c +8 -1
@@ -2247,7 +2247,14 @@ tmpstr[i] = c; } tmpstr[i++] =0 ; - *vp =kallsyms_lookup_name (tmpstr); + *vp =0 ; +if (setjmp (bus_error_jmp) ==0 ) { + catch_memory_errors =1 ; +sync (); + *vp =kallsyms_lookup_name (tmpstr); +sync (); + } + catch_memory_errors =0 ;if (!(*vp)) {printf ("unknown symbol '%s'\n" , tmpstr);return 0 ;
arch/ppc/xmon/xmon.c +72 -198
368 lines not on this page · raw message
arch/ppc/boot/ld.script +0 -3
@@ -58,9 +58,6 @@ *(.ramdisk) __ramdisk_end = .; . = ALIGN(4096); - __sysmap_begin = .; - *(.sysmap) - __sysmap_end = .; CONSTRUCTORS } _edata = .;
arch/ppc/boot/utils/addSystemMap.c deleted +0 -186
186 lines not on this page · raw message
arch/ppc/kernel/setup.c +0 -7
@@ -61,8 +61,6 @@extern boot_infos_t *boot_infos;struct ide_machdep_calls ppc_ide_md; -char *sysmap; -unsigned long sysmap_size;/* Used with the BI_MEMSIZE bootinfo parameter to store the memory size value reported by the boot loader. */
@@ -579,11 +577,6 @@case BI_CMD_LINE :strlcpy (cmd_line, (void *)data,sizeof (cmd_line));break ; -case BI_SYSMAP : - sysmap = (char *)((data[0 ] >= (KERNELBASE )) ? data[0 ] : - (data[0 ]+KERNELBASE )); - sysmap_size = data[1 ]; -break ;#ifdef CONFIG_BLK_DEV_INITRD case BI_INITRD : initrd_start = data[0 ] +KERNELBASE ;
arch/ppc/boot/simple/Makefile +2 -2
@@ -203,7 +203,7 @@ $(obj)/dummy.o $(obj)/image.o $(LD) $(LD_ARGS) -o $@ $(OBJS) $(obj)/image.o $(LIBS) $(OBJCOPY) $(OBJCOPY_ARGS) $@ $@ -R .comment -R .stab \ - -R .stabstr -R .ramdisk -R .sysmap + -R .stabstr -R .ramdisk $(obj)/zvmlinux.initrd: $(OBJS) $(LIBS) $(srctree)/$(boot)/ld.script \ $(images)/vmlinux.gz $(obj)/dummy.o
@@ -215,7 +215,7 @@ $(obj)/dummy.o $(obj)/image.o $(LD) $(LD_ARGS) -o $@ $(OBJS) $(obj)/image.o $(LIBS) $(OBJCOPY) $(OBJCOPY_ARGS) $@ $@ -R .comment -R .stab \ - -R .stabstr -R .sysmap + -R .stabstr # Sort-of dummy rules, that let us format the image we want. zImage: $(images)/$(zimage-y) $(obj)/zvmlinux
arch/ppc/boot/openfirmware/Makefile +1 -4
@@ -54,13 +54,10 @@ @echo ' RAM disk image must be provided separately' @/bin/false -objcpxmon-$(CONFIG_XMON) := --add-section=.sysmap=System.map \ - --set-section-flags=.sysmap=contents,alloc,load,readonly,data quiet_cmd_genimage = GEN $@ cmd_genimage = $(OBJCOPY) -R .comment \ --add-section=.image=$(images)/vmlinux.gz \ - --set-section-flags=.image=contents,alloc,load,readonly,data \ - $(objcpxmon-y) $< $@ + --set-section-flags=.image=contents,alloc,load,readonly,data $< $@ targets += image.o $(obj)/image.o: $(obj)/dummy.o $(images)/vmlinux.gz FORCE
arch/ppc/boot/openfirmware/common.c +0 -16
@@ -15,7 +15,6 @@#include <asm/page.h> /* Information from the linker */ -extern char __sysmap_begin, __sysmap_end;extern int strcmp (const char *s1,const char *s2);extern char *avail_ram, *avail_high;
@@ -116,14 +115,8 @@void make_bi_recs (unsigned long addr,char *name,unsigned int mach,unsigned long progend) { -unsigned long sysmap_size;struct bi_record *rec; -/* Figure out the size of a possible System.map we're going to -* pass along. -* */ - sysmap_size = (unsigned long )(&__sysmap_end) - - (unsigned long )(&__sysmap_begin);/* leave a 1MB gap then align to the next 1MB boundary */ addr =_ALIGN (addr+ (1 <<20 ) -1 , (1 <<20 ));
@@ -147,15 +140,6 @@ rec->size =sizeof (struct bi_record ) +2 *sizeof (unsigned long ); rec = (struct bi_record *)((unsigned long )rec + rec->size); -if (sysmap_size) { - rec->tag =BI_SYSMAP ; - rec->data[0 ] = (unsigned long )(&__sysmap_begin); - rec->data[1 ] = sysmap_size; - rec->size =sizeof (struct bi_record ) +2 * -sizeof (unsigned long ); - rec = (struct bi_record *)((unsigned long )rec + rec->size); - } - rec->tag =BI_LAST ; rec->size =sizeof (struct bi_record ); rec = (struct bi_record *)((unsigned long )rec + rec->size);
arch/ppc/mm/init.c +1 -15
@@ -96,9 +96,6 @@char *klimit = _end;struct mem_pieces phys_avail; -extern char *sysmap; -extern unsigned long sysmap_size; -/* * this tells the system to map all of ram with the segregs * (i.e. page tables) instead of the bats.
@@ -441,12 +438,6 @@if (agp_special_page)SetPageReserved (virt_to_page (agp_special_page));#endif -if ( sysmap ) -for (addr = (unsigned long )sysmap; - addr <PAGE_ALIGN ((unsigned long )sysmap+sysmap_size) ; - addr +=PAGE_SIZE ) -SetPageReserved (virt_to_page (addr)); -for (addr =PAGE_OFFSET ; addr < (unsigned long )high_memory; addr +=PAGE_SIZE ) {if (!PageReserved (virt_to_page (addr)))
@@ -482,9 +473,7 @@ codepages<< (PAGE_SHIFT -10 ), datapages<< (PAGE_SHIFT -10 ), initpages<< (PAGE_SHIFT -10 ), (unsigned long) (totalhigh_pages << (PAGE_SHIFT-10))); -if (sysmap) -printk ("System.map loaded at 0x%08x for debugger, size: %ld bytes\n" , - (unsigned int )sysmap, sysmap_size); +#ifdef CONFIG_PPC_PMAC if (agp_special_page)printk (KERN_INFO "AGP special page: 0x%08lx\n" , agp_special_page);
@@ -534,9 +523,6 @@if (rtas_data)mem_pieces_remove (&phys_avail, rtas_data, rtas_size,1 );#endif -/* remove the sysmap pages from the available memory */ -if (sysmap) -mem_pieces_remove (&phys_avail,__pa (sysmap), sysmap_size,1 );#ifdef CONFIG_PPC_PMAC /* Because of some uninorth weirdness, we need a page of * memory as high as possible (it must be outside of the