From: Roman Z. <zi...@fh...> - 2000-05-26 08:05:16
|
Hi, > Well, i handled the 2.2.10 tree up to now. I think we will have to wait until > we have the cvs tree up at sourceforge. will do it today, i think, so please > send me a patfch or something ... Ok, here is a patch for the bitkeeper source, it's quite small, most of the needed changes are already there and a few things might be missing from Jes' last patch (like kgdb). The Ariadne2 driver isn't working yet, but I hadn't enough time to look into this yesterday and some other things need to be cleaned up... bye, Roman diff -Nur -X apus_nodiff linuxppc_2_3/Makefile linux-apus/Makefile --- linuxppc_2_3/Makefile Wed May 24 08:36:35 2000 +++ linux-apus/Makefile Thu May 25 21:39:32 2000 @@ -5,7 +5,7 @@ KERNELRELEASE=$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION) -ARCH := $(shell uname -m | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ -e s/arm.*/arm/ -e s/sa110/arm/) +ARCH := ppc CONFIG_SHELL := $(shell if [ -x "$$BASH" ]; then echo $$BASH; \ else if [ -x /bin/bash ]; then echo /bin/bash; \ @@ -18,7 +18,7 @@ HOSTCC = gcc HOSTCFLAGS = -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer -CROSS_COMPILE = +CROSS_COMPILE = ppc-linux- # # Include the make variables (CC, etc...) diff -Nur -X apus_nodiff linuxppc_2_3/arch/ppc/amiga/chipram.c linux-apus/arch/ppc/amiga/chipram.c --- linuxppc_2_3/arch/ppc/amiga/chipram.c Wed Mar 1 21:31:02 2000 +++ linux-apus/arch/ppc/amiga/chipram.c Thu May 11 23:43:37 2000 @@ -72,7 +72,7 @@ #endif } -void *amiga_chip_alloc (long size) +void *amiga_chip_alloc (long size, const char *name) { /* last chunk */ struct chip_desc *dp; diff -Nur -X apus_nodiff linuxppc_2_3/arch/ppc/amiga/config.c linux-apus/arch/ppc/amiga/config.c --- linuxppc_2_3/arch/ppc/amiga/config.c Wed Mar 1 21:29:00 2000 +++ linux-apus/arch/ppc/amiga/config.c Thu May 25 21:49:01 2000 @@ -734,7 +734,7 @@ static void amiga_savekmsg_init(void) { - savekmsg = (struct savekmsg *)amiga_chip_alloc(SAVEKMSG_MAXMEM); + savekmsg = (struct savekmsg *)amiga_chip_alloc(SAVEKMSG_MAXMEM, "Debug"); savekmsg->magic1 = SAVEKMSG_MAGIC1; savekmsg->magic2 = SAVEKMSG_MAGIC2; savekmsg->magicptr = virt_to_phys(savekmsg); diff -Nur -X apus_nodiff linuxppc_2_3/arch/ppc/config.in linux-apus/arch/ppc/config.in --- linuxppc_2_3/arch/ppc/config.in Mon Apr 24 08:30:50 2000 +++ linux-apus/arch/ppc/config.in Tue May 16 20:30:00 2000 @@ -172,6 +172,9 @@ define_bool CONFIG_AMIGAMOUSE y define_bool CONFIG_ABSTRACT_CONSOLE y define_bool CONFIG_FB y + define_bool CONFIG_MOUSE y + define_bool CONFIG_BUSMOUSE y + define_bool CONFIG_APUS_FAST_EXCEPT y tristate 'Amiga builtin serial support' CONFIG_AMIGA_BUILTIN_SERIAL tristate 'Parallel printer support' CONFIG_M68K_PRINTER tristate 'GVP IO-Extender support' CONFIG_GVPIOEXT diff -Nur -X apus_nodiff linuxppc_2_3/arch/ppc/kernel/apus_setup.c linux-apus/arch/ppc/kernel/apus_setup.c --- linuxppc_2_3/arch/ppc/kernel/apus_setup.c Thu Apr 27 08:32:10 2000 +++ linux-apus/arch/ppc/kernel/apus_setup.c Thu May 25 22:05:09 2000 @@ -23,10 +23,6 @@ #include <linux/blk.h> #include <linux/pci.h> -#ifdef CONFIG_APUS -#include <asm/logging.h> -#endif - /* Needs INITSERIAL call in head.S! */ #undef APUS_DEBUG @@ -243,6 +239,9 @@ } } + memcpy(0xfff00000, KERNELBASE, 0x4000); + flush_icache_range(0xfff00000, 0xfff04000); + config_amiga(); #if 0 /* Enable for logging - also include logging.o in Makefile rule */ @@ -339,7 +338,7 @@ freq = 16500000; } else { printk ("APUS: Unable to determine bus speed (%d). " - "Defaulting to 50MHz", bus_speed); + "Defaulting to 50MHz\n", bus_speed); bus_speed = 50; freq = 12500000; speed_test_failed = 1; @@ -937,7 +936,7 @@ __apus int __debug_serinit( void ) -{ +{ unsigned long flags; save_flags (flags); diff -Nur -X apus_nodiff linuxppc_2_3/arch/ppc/kernel/head.S linux-apus/arch/ppc/kernel/head.S --- linuxppc_2_3/arch/ppc/kernel/head.S Sat May 20 08:34:36 2000 +++ linux-apus/arch/ppc/kernel/head.S Thu May 25 21:55:02 2000 @@ -145,10 +145,12 @@ mr r29,r5 mr r28,r6 mr r27,r7 + +#ifndef CONFIG_APUS li r24,0 /* cpu # */ bl prom_init -#ifdef CONFIG_APUS +#else /* CONFIG_APUS */ /* On APUS the __va/__pa constants need to be set to the correct * values before continuing. */ @@ -306,7 +308,7 @@ stw r1,0(r21); \ tovirt(r1,r21); /* set new kernel sp */ \ SAVE_4GPRS(3, r21); \ - SAVE_GPR(7, r21); + SAVE_GPR(7, r21) /* * Note: code which follows this uses cr0.eq (set if from kernel), * r21, r22 (SRR0), and r23 (SRR1). @@ -350,7 +352,15 @@ mfspr r3,DAR /* into the hash table */ rlwinm r4,r23,32-13,30,30 /* MSR_PR -> _PAGE_USER */ rlwimi r4,r20,32-23,29,29 /* DSISR_STORE -> _PAGE_RW */ +#ifndef CONFIG_APUS bl hash_page +#else + lis r2,hash_page@h + ori r2,r2,hash_page@l + tophys(r2,r2) + mtlr r2 + blrl +#endif 1: stw r20,_DSISR(r21) mr r5,r20 mfspr r4,DAR @@ -371,7 +381,15 @@ mr r3,r22 /* into the hash table */ rlwinm r4,r23,32-13,30,30 /* MSR_PR -> _PAGE_USER */ mr r20,r23 /* SRR1 has reason bits */ +#ifndef CONFIG_APUS bl hash_page +#else + lis r2,hash_page@h + ori r2,r2,hash_page@l + tophys(r2,r2) + mtlr r2 + blrl +#endif 1: addi r3,r1,STACK_FRAME_OVERHEAD mr r4,r22 mr r5,r23 @@ -384,7 +402,7 @@ /* External interrupt */ . = 0x500; HardwareInterrupt: - EXCEPTION_PROLOG; + EXCEPTION_PROLOG addi r3,r1,STACK_FRAME_OVERHEAD li r20,MSR_KERNEL #ifndef CONFIG_APUS @@ -1138,7 +1156,7 @@ * without cache intervention. Then disable interrupts and get * the current emulated m68k IPL value. */ - + mfmsr 20 xori r20,r20,MSR_DR sync @@ -1151,8 +1169,11 @@ stb r20,APUS_IPL_EMU@l(r4) eieio + /* Get emulated IPL value. [5-3:requested IPL][2-0:current IPL] */ lbz r3,APUS_IPL_EMU@l(r4) + /* Check for bad values (0 & 7) then update current IPL value + with the requested value */ li r2,IPLEMU_IPLMASK rlwinm. r20,r3,32-3,29,31 bne 2f @@ -1180,11 +1201,13 @@ mtmsr r20 sync - stw r3,(_CCR+4)(r21); + stw r3,(_MQ)(r21); addi r3,r1,STACK_FRAME_OVERHEAD; li r20,MSR_KERNEL; bl transfer_to_handler; + .globl do_IRQ_intercept +do_IRQ_intercept: .long do_IRQ; .long ret_from_except @@ -1403,7 +1426,7 @@ bl identify_machine bl MMU_init -#ifdef CONFIG_APUS +#ifdef _CONFIG_APUS /* Copy exception code to exception vector base on APUS. */ lis r4,KERNELBASE@h #ifdef CONFIG_APUS_FAST_EXCEPT diff -Nur -X apus_nodiff linuxppc_2_3/arch/ppc/kernel/ppc_ksyms.c linux-apus/arch/ppc/kernel/ppc_ksyms.c --- linuxppc_2_3/arch/ppc/kernel/ppc_ksyms.c Wed May 24 08:36:35 2000 +++ linux-apus/arch/ppc/kernel/ppc_ksyms.c Thu May 25 21:40:12 2000 @@ -82,7 +82,7 @@ EXPORT_SYMBOL(kernel_flag); #endif /* CONFIG_SMP */ -#if !defined(CONFIG_4xx) && !defined(CONFIG_8xx) +#if !defined(CONFIG_4xx) && !defined(CONFIG_8xx) && !defined(CONFIG_APUS) EXPORT_SYMBOL(isa_io_base); EXPORT_SYMBOL(isa_mem_base); EXPORT_SYMBOL(pci_dram_offset); @@ -273,6 +273,7 @@ #endif EXPORT_SYMBOL(down_read_failed); +#if defined(CONFIG_XMON) || defined(CONFIG_KGDB) extern void (*debugger)(struct pt_regs *regs); extern int (*debugger_bpt)(struct pt_regs *regs); extern int (*debugger_sstep)(struct pt_regs *regs); @@ -286,5 +287,6 @@ EXPORT_SYMBOL(debugger_iabr_match); EXPORT_SYMBOL(debugger_dabr_match); EXPORT_SYMBOL(debugger_fault_handler); +#endif EXPORT_SYMBOL(ret_to_user_hook); diff -Nur -X apus_nodiff linuxppc_2_3/arch/ppc/kernel/setup.c linux-apus/arch/ppc/kernel/setup.c --- linuxppc_2_3/arch/ppc/kernel/setup.c Wed May 17 08:35:45 2000 +++ linux-apus/arch/ppc/kernel/setup.c Thu May 25 21:56:00 2000 @@ -423,8 +423,9 @@ identify_machine(unsigned long r3, unsigned long r4, unsigned long r5, unsigned long r6, unsigned long r7) { +#ifndef CONFIG_APUS /*FIXME:APUS: proper integration */ parse_bootinfo(); - +#endif if ( ppc_md.progress ) ppc_md.progress("id mach(): start", 0x100); #if !defined(CONFIG_4xx) && !defined(CONFIG_8xx) && !defined(CONFIG_8260) @@ -583,6 +584,7 @@ return 0; } +#ifndef CONFIG_APUS int parse_bootinfo(void) { struct bi_record *rec; @@ -633,6 +635,7 @@ return 0; } +#endif /* Checks "l2cr=xxxx" command-line option */ void ppc_setup_l2cr(char *str, int *ints) diff -Nur -X apus_nodiff linuxppc_2_3/arch/ppc/mm/fault.c linux-apus/arch/ppc/mm/fault.c --- linuxppc_2_3/arch/ppc/mm/fault.c Tue May 16 08:40:29 2000 +++ linux-apus/arch/ppc/mm/fault.c Thu May 25 21:56:48 2000 @@ -125,7 +125,7 @@ /* Guarded storage error. */ goto bad_area; #endif /* CONFIG_8xx */ - + /* a write */ if (is_write) { if (!(vma->vm_flags & VM_WRITE)) diff -Nur -X apus_nodiff linuxppc_2_3/arch/ppc/mm/init.c linux-apus/arch/ppc/mm/init.c --- linuxppc_2_3/arch/ppc/mm/init.c Fri May 12 08:35:45 2000 +++ linux-apus/arch/ppc/mm/init.c Thu May 25 21:57:28 2000 @@ -421,6 +421,22 @@ v = (ioremap_bot -= size); } +#if 1 + /* FIXME: Temporary hack to allow ptov conversions. */ + { + extern unsigned long kmap_chunks[]; + extern int kmap_chunk_count; + + kmap_chunks[kmap_chunk_count++] = p; + kmap_chunks[kmap_chunk_count++] = size; + kmap_chunks[kmap_chunk_count++] = v; + +#if 0 + printk ("ioremap: %08lx (%08lx) -> %08lx\n", p, size, v); +#endif + } +#endif + if ((flags & _PAGE_PRESENT) == 0) flags |= pgprot_val(PAGE_KERNEL); if (flags & (_PAGE_NO_CACHE | _PAGE_WRITETHRU)) @@ -1075,8 +1091,11 @@ } start = PAGE_ALIGN(start); - boot_mapsize = init_bootmem(start >> PAGE_SHIFT, - __pa(end_of_DRAM) >> PAGE_SHIFT); + min_low_pfn = start >> PAGE_SHIFT; + max_low_pfn = (__pa(end_of_DRAM) - __pa(KERNELBASE)) >> PAGE_SHIFT; + boot_mapsize = init_bootmem_node(0, start >> PAGE_SHIFT, + __pa(KERNELBASE) >> PAGE_SHIFT, + __pa(end_of_DRAM) >> PAGE_SHIFT); /* remove the bootmem bitmap from the available memory */ mem_pieces_remove(&phys_avail, start, boot_mapsize, 1); diff -Nur -X apus_nodiff linuxppc_2_3/drivers/char/Makefile linux-apus/drivers/char/Makefile --- linuxppc_2_3/drivers/char/Makefile Wed May 24 08:36:38 2000 +++ linux-apus/drivers/char/Makefile Thu May 25 21:58:40 2000 @@ -96,6 +96,11 @@ SERIAL = endif +ifeq ($(CONFIG_APUS),y) + KEYBD = amikeyb.o + SERIAL = +endif + obj-$(CONFIG_VT) += vt.o vc_screen.o consolemap.o consolemap_deftbl.o $(CONSOLE) selection.o obj-$(CONFIG_SERIAL) += $(SERIAL) diff -Nur -X apus_nodiff linuxppc_2_3/drivers/char/amikeyb.c linux-apus/drivers/char/amikeyb.c --- linuxppc_2_3/drivers/char/amikeyb.c Wed Mar 1 21:31:14 2000 +++ linux-apus/drivers/char/amikeyb.c Thu May 11 23:59:50 2000 @@ -176,7 +176,7 @@ static unsigned char rep_scancode; static void amikeyb_rep(unsigned long ignore); -static struct timer_list amikeyb_rep_timer = {NULL, NULL, 0, 0, amikeyb_rep}; +static struct timer_list amikeyb_rep_timer; static void amikeyb_rep(unsigned long ignore) { @@ -187,7 +187,6 @@ kbd_pt_regs = NULL; amikeyb_rep_timer.expires = jiffies + key_repeat_rate; - amikeyb_rep_timer.prev = amikeyb_rep_timer.next = NULL; add_timer(&amikeyb_rep_timer); handle_scancode(rep_scancode, 1); @@ -255,7 +254,6 @@ del_timer(&amikeyb_rep_timer); rep_scancode = keycode; amikeyb_rep_timer.expires = jiffies + key_repeat_delay; - amikeyb_rep_timer.prev = amikeyb_rep_timer.next = NULL; add_timer(&amikeyb_rep_timer); } handle_scancode(keycode, !break_flag); @@ -300,6 +298,9 @@ { if (!AMIGAHW_PRESENT(AMI_KEYBOARD)) return -EIO; + + init_timer(&amikeyb_rep_timer); + amikeyb_rep_timer.function = amikeyb_rep; /* setup key map */ memcpy(key_maps[0], amiplain_map, sizeof(plain_map)); diff -Nur -X apus_nodiff linuxppc_2_3/drivers/ide/gayle.c linux-apus/drivers/ide/gayle.c --- linuxppc_2_3/drivers/ide/gayle.c Wed Apr 19 08:32:05 2000 +++ linux-apus/drivers/ide/gayle.c Thu May 11 22:54:17 2000 @@ -17,6 +17,7 @@ #include <linux/ide.h> #include <linux/init.h> +#include <asm/setup.h> #include <asm/amigahw.h> #include <asm/amigaints.h> @@ -106,7 +107,7 @@ * Probe for a Gayle IDE interface (and optionally for an IDE doubler) */ -void __init gayle_init(void) +void /*__init*/ gayle_init(void) { int a4000, i; diff -Nur -X apus_nodiff linuxppc_2_3/drivers/net/ariadne2.c linux-apus/drivers/net/ariadne2.c --- linuxppc_2_3/drivers/net/ariadne2.c Wed Mar 1 21:30:38 2000 +++ linux-apus/drivers/net/ariadne2.c Thu May 11 22:20:06 2000 @@ -273,8 +273,8 @@ /* This *shouldn't* happen. If it does, it's the last thing you'll see */ if (ei_status.dmaing) { printk("%s: DMAing conflict in ne_get_8390_hdr " - "[DMAstat:%d][irqlock:%d][intr:%ld].\n", dev->name, ei_status.dmaing, - ei_status.irqlock, dev->interrupt); + "[DMAstat:%d][irqlock:%d].\n", dev->name, ei_status.dmaing, + ei_status.irqlock); return; } @@ -314,9 +314,8 @@ /* This *shouldn't* happen. If it does, it's the last thing you'll see */ if (ei_status.dmaing) { printk("%s: DMAing conflict in ne_block_input " - "[DMAstat:%d][irqlock:%d][intr:%ld].\n", - dev->name, ei_status.dmaing, ei_status.irqlock, - dev->interrupt); + "[DMAstat:%d][irqlock:%d].\n", + dev->name, ei_status.dmaing, ei_status.irqlock); return; } ei_status.dmaing |= 0x01; @@ -355,8 +354,8 @@ /* This *shouldn't* happen. If it does, it's the last thing you'll see */ if (ei_status.dmaing) { printk("%s: DMAing conflict in ne_block_output." - "[DMAstat:%d][irqlock:%d][intr:%ld]\n", dev->name, ei_status.dmaing, - ei_status.irqlock, dev->interrupt); + "[DMAstat:%d][irqlock:%d]\n", dev->name, ei_status.dmaing, + ei_status.irqlock); return; } ei_status.dmaing |= 0x01; diff -Nur -X apus_nodiff linuxppc_2_3/drivers/video/amifb.c linux-apus/drivers/video/amifb.c --- linuxppc_2_3/drivers/video/amifb.c Wed Apr 19 08:32:10 2000 +++ linux-apus/drivers/video/amifb.c Sat May 20 00:36:39 2000 @@ -1791,7 +1791,7 @@ * access the videomem with writethrough cache */ videomemory_phys = (u_long)ZTWO_PADDR(videomemory); - videomemory = (u_long)ioremap_writethrough(videomemory_phys, videomemorysize); + //videomemory = (u_long)ioremap_writethrough(videomemory_phys, videomemorysize); if (!videomemory) { printk("amifb: WARNING! unable to map videomem cached writethrough\n"); videomemory = ZTWO_VADDR(videomemory_phys); @@ -1812,15 +1812,26 @@ ami_init_copper(); +#if 1 if (request_irq(IRQ_AMIGA_AUTO_3, amifb_interrupt, 0, "fb vertb handler", NULL)) { err = -EBUSY; goto amifb_error; } - amiga_intena_vals[IRQ_AMIGA_VERTB] = IF_COPER; - amiga_intena_vals[IRQ_AMIGA_COPPER] = 0; + { + extern unsigned short ami_intena_vals[]; + ami_intena_vals[IRQ_AMIGA_VERTB] = IF_COPER; + ami_intena_vals[IRQ_AMIGA_COPPER] = 0; custom.intena = IF_VERTB; custom.intena = IF_SETCLR | IF_COPER; + } +#else + if (request_irq(IRQ_AMIGA_VERTB, amifb_interrupt, 0, + "fb vertb handler", NULL)) { + err = -EBUSY; + goto amifb_error; + } +#endif amifb_set_var(&var, -1, &fb_info); diff -Nur -X apus_nodiff linuxppc_2_3/include/asm-ppc/bootinfo.h linux-apus/include/asm-ppc/bootinfo.h --- linuxppc_2_3/include/asm-ppc/bootinfo.h Wed Mar 1 21:27:37 2000 +++ linux-apus/include/asm-ppc/bootinfo.h Thu May 11 23:09:01 2000 @@ -13,6 +13,12 @@ #if defined(CONFIG_APUS) && !defined(__BOOTER__) #include <asm-m68k/bootinfo.h> + +#define BI_FIRST 0x1010 /* first record - marker */ +#define BI_CMD_LINE 0x1012 +#define BI_INITRD 0x1014 +#define BI_SYSMAP 0x1015 + #else struct bi_record { diff -Nur -X apus_nodiff linuxppc_2_3/include/asm-ppc/io.h linux-apus/include/asm-ppc/io.h --- linuxppc_2_3/include/asm-ppc/io.h Mon Apr 24 08:30:57 2000 +++ linux-apus/include/asm-ppc/io.h Thu May 25 22:04:49 2000 @@ -25,10 +25,9 @@ #include <asm/mpc8xx.h> #elif defined(CONFIG_8260) #include <asm/mpc8260.h> -#else -#ifdef CONFIG_APUS -#define _IO_BASE 0 -#define _ISA_MEM_BASE 0 +#elif defined(CONFIG_APUS) +#define _IO_BASE 0 +#define _ISA_MEM_BASE 0 #define PCI_DRAM_OFFSET 0 #else extern unsigned long isa_io_base; @@ -37,7 +36,6 @@ #define _IO_BASE isa_io_base #define _ISA_MEM_BASE isa_mem_base #define PCI_DRAM_OFFSET pci_dram_offset -#endif /* CONFIG_APUS */ #endif #define readb(addr) in_8((volatile u8 *)(addr)) @@ -125,10 +123,17 @@ unsigned long flags); extern void *ioremap(unsigned long address, unsigned long size); #define ioremap_nocache(addr, size) ioremap((addr), (size)) +#define ioremap_writethrough(addr, size) \ + __ioremap((addr), (size), _PAGE_WRITETHRU) extern void iounmap(void *addr); extern unsigned long iopa(unsigned long addr); #ifdef CONFIG_APUS extern unsigned long mm_ptov(unsigned long addr) __attribute__ ((const)); +/* Values for nocacheflag and cmode */ +#define IOMAP_FULL_CACHING 0 +#define IOMAP_NOCACHE_SER 1 +#define IOMAP_NOCACHE_NONSER 2 +#define IOMAP_WRITETHROUGH 3 #endif /* diff -Nur -X apus_nodiff linuxppc_2_3/include/asm-ppc/pgtable.h linux-apus/include/asm-ppc/pgtable.h --- linuxppc_2_3/include/asm-ppc/pgtable.h Thu Apr 27 08:32:20 2000 +++ linux-apus/include/asm-ppc/pgtable.h Thu May 25 22:04:49 2000 @@ -301,7 +301,7 @@ #define pte_none(pte) (!pte_val(pte)) #define pte_present(pte) (pte_val(pte) & _PAGE_PRESENT) #define pte_clear(ptep) do { pte_val(*(ptep)) = 0; } while (0) -#define pte_pagenr(x) ((unsigned long)((pte_val(x) >> PAGE_SHIFT))) +#define pte_pagenr(x) ((unsigned long)(((pte_val(x) - __pa(KERNELBASE)) >> PAGE_SHIFT))) #define pmd_none(pmd) (!pmd_val(pmd)) #define pmd_bad(pmd) ((pmd_val(pmd) & ~PAGE_MASK) != 0) @@ -395,7 +395,7 @@ #define mk_pte(page,pgprot) \ ({ \ pte_t pte; \ - pte_val(pte) = ((page - mem_map) << PAGE_SHIFT) | pgprot_val(pgprot); \ + pte_val(pte) = (__pa(page->virtual)) | pgprot_val(pgprot); \ pte; \ }) diff -Nur -X apus_nodiff linuxppc_2_3/mm/page_alloc.c linux-apus/mm/page_alloc.c --- linuxppc_2_3/mm/page_alloc.c Wed May 24 08:36:46 2000 +++ linux-apus/mm/page_alloc.c Thu May 25 21:42:05 2000 @@ -458,7 +458,7 @@ * - clear the memory bitmaps */ void __init free_area_init_core(int nid, pg_data_t *pgdat, struct page **gmap, - unsigned long *zones_size, unsigned long zone_start_paddr, + unsigned long *zones_size, unsigned long zone_start_vaddr, unsigned long *zholes_size) { struct page *p, *lmem_map; @@ -479,7 +479,7 @@ if (zholes_size) for (i = 0; i < MAX_NR_ZONES; i++) realtotalpages -= zholes_size[i]; - + printk("On node %d totalpages: %lu\n", nid, realtotalpages); /* @@ -512,7 +512,7 @@ MAP_ALIGN((unsigned long)lmem_map - PAGE_OFFSET)); *gmap = pgdat->node_mem_map = lmem_map; pgdat->node_size = totalpages; - pgdat->node_start_paddr = zone_start_paddr; + pgdat->node_start_paddr = __pa(zone_start_vaddr); pgdat->node_start_mapnr = (lmem_map - mem_map); /* @@ -560,14 +560,14 @@ zone->zone_wake_kswapd = 0; zone->zone_mem_map = mem_map + offset; zone->zone_start_mapnr = offset; - zone->zone_start_paddr = zone_start_paddr; + zone->zone_start_paddr = __pa(zone_start_vaddr); for (i = 0; i < size; i++) { struct page *page = mem_map + offset + i; page->zone = zone; if (j != ZONE_HIGHMEM) { - page->virtual = (unsigned long)(__va(zone_start_paddr)); - zone_start_paddr += PAGE_SIZE; + page->virtual = zone_start_vaddr; + zone_start_vaddr += PAGE_SIZE; } } @@ -591,7 +591,7 @@ void __init free_area_init(unsigned long *zones_size) { - free_area_init_core(0, NODE_DATA(0), &mem_map, zones_size, 0, 0); + free_area_init_core(0, NODE_DATA(0), &mem_map, zones_size, PAGE_OFFSET, 0); } static int __init setup_mem_frac(char *str) |