diff -urN -x .git RC13-current/arch/arm/mm/Kconfig linux-2.6/arch/arm/mm/Kconfig --- RC13-current/arch/arm/mm/Kconfig 2005-08-29 22:26:30.000000000 -0400 +++ linux-2.6/arch/arm/mm/Kconfig 2005-10-06 19:55:03.000000000 -0400 @@ -370,21 +370,21 @@ config CPU_ICACHE_DISABLE bool "Disable I-Cache" - depends on CPU_ARM920T || CPU_ARM922T || CPU_ARM925T || CPU_ARM926T || CPU_ARM1020 + depends on CPU_ARM920T || CPU_ARM922T || CPU_ARM925T || CPU_ARM926T || CPU_ARM1020 || CPU_V6 help Say Y here to disable the processor instruction cache. Unless you have a reason not to or are unsure, say N. config CPU_DCACHE_DISABLE bool "Disable D-Cache" - depends on CPU_ARM920T || CPU_ARM922T || CPU_ARM925T || CPU_ARM926T || CPU_ARM1020 + depends on CPU_ARM920T || CPU_ARM922T || CPU_ARM925T || CPU_ARM926T || CPU_ARM1020 || CPU_V6 help Say Y here to disable the processor data cache. Unless you have a reason not to or are unsure, say N. config CPU_DCACHE_WRITETHROUGH bool "Force write through D-cache" - depends on (CPU_ARM920T || CPU_ARM922T || CPU_ARM925T || CPU_ARM926T || CPU_ARM1020) && !CPU_DCACHE_DISABLE + depends on (CPU_ARM920T || CPU_ARM922T || CPU_ARM925T || CPU_ARM926T || CPU_ARM1020 || CPU_V6) && !CPU_DCACHE_DISABLE default y if CPU_ARM925T help Say Y here to use the data cache in writethrough mode. Unless you @@ -399,7 +399,7 @@ config CPU_BPREDICT_DISABLE bool "Disable branch prediction" - depends on CPU_ARM1020 + depends on CPU_ARM1020 || CPU_V6 help Say Y here to disable branch prediction. If unsure, say N. diff -urN -x .git RC13-current/arch/ia64/kernel/mca.c linux-2.6/arch/ia64/kernel/mca.c --- RC13-current/arch/ia64/kernel/mca.c 2005-09-12 04:31:51.000000000 -0400 +++ linux-2.6/arch/ia64/kernel/mca.c 2005-10-06 19:55:03.000000000 -0400 @@ -1016,6 +1016,11 @@ cmc_polling_enabled = 1; spin_unlock(&cmc_history_lock); + /* If we're being hit with CMC interrupts, we won't + * ever execute the schedule_work() below. Need to + * disable CMC interrupts on this processor now. + */ + ia64_mca_cmc_vector_disable(NULL); schedule_work(&cmc_disable_work); /* diff -urN -x .git RC13-current/arch/ppc/platforms/pmac_time.c linux-2.6/arch/ppc/platforms/pmac_time.c --- RC13-current/arch/ppc/platforms/pmac_time.c 2005-08-29 22:26:32.000000000 -0400 +++ linux-2.6/arch/ppc/platforms/pmac_time.c 2005-10-05 12:28:30.000000000 -0400 @@ -195,7 +195,7 @@ ; dend = get_dec(); - tb_ticks_per_jiffy = (dstart - dend) / (6 * (HZ/100)); + tb_ticks_per_jiffy = (dstart - dend) / ((6 * HZ)/100); tb_to_us = mulhwu_scale_factor(dstart - dend, 60000); printk(KERN_INFO "via_calibrate_decr: ticks per jiffy = %u (%u ticks)\n", diff -urN -x .git RC13-current/arch/sparc/Kconfig linux-2.6/arch/sparc/Kconfig --- RC13-current/arch/sparc/Kconfig 2005-09-08 10:05:16.000000000 -0400 +++ linux-2.6/arch/sparc/Kconfig 2005-10-06 19:55:03.000000000 -0400 @@ -25,62 +25,6 @@ menu "General machine setup" -config VT - bool - select INPUT - default y - ---help--- - If you say Y here, you will get support for terminal devices with - display and keyboard devices. These are called "virtual" because you - can run several virtual terminals (also called virtual consoles) on - one physical terminal. This is rather useful, for example one - virtual terminal can collect system messages and warnings, another - one can be used for a text-mode user session, and a third could run - an X session, all in parallel. Switching between virtual terminals - is done with certain key combinations, usually Alt-. - - The setterm command ("man setterm") can be used to change the - properties (such as colors or beeping) of a virtual terminal. The - man page console_codes(4) ("man console_codes") contains the special - character sequences that can be used to change those properties - directly. The fonts used on virtual terminals can be changed with - the setfont ("man setfont") command and the key bindings are defined - with the loadkeys ("man loadkeys") command. - - You need at least one virtual terminal device in order to make use - of your keyboard and monitor. Therefore, only people configuring an - embedded system would want to say N here in order to save some - memory; the only way to log into such a system is then via a serial - or network connection. - - If unsure, say Y, or else you won't be able to do much with your new - shiny Linux system :-) - -config VT_CONSOLE - bool - default y - ---help--- - The system console is the device which receives all kernel messages - and warnings and which allows logins in single user mode. If you - answer Y here, a virtual terminal (the device used to interact with - a physical terminal) can be used as system console. This is the most - common mode of operations, so you should say Y here unless you want - the kernel messages be output only to a serial port (in which case - you should say Y to "Console on serial port", below). - - If you do say Y here, by default the currently visible virtual - terminal (/dev/tty0) will be used as system console. You can change - that with a kernel command line option such as "console=tty3" which - would use the third virtual terminal as system console. (Try "man - bootparam" or see the documentation of your boot loader (lilo or - loadlin) about how to pass options to the kernel at boot time.) - - If unsure, say Y. - -config HW_CONSOLE - bool - default y - config SMP bool "Symmetric multi-processing support (does not work on sun4/sun4c)" depends on BROKEN diff -urN -x .git RC13-current/arch/sparc64/kernel/entry.S linux-2.6/arch/sparc64/kernel/entry.S --- RC13-current/arch/sparc64/kernel/entry.S 2005-09-28 13:49:58.000000000 -0400 +++ linux-2.6/arch/sparc64/kernel/entry.S 2005-10-06 19:55:03.000000000 -0400 @@ -97,8 +97,8 @@ faddd %f0, %f2, %f4 fmuld %f0, %f2, %f6 ldxa [%g3] ASI_DMMU, %g5 -cplus_fptrap_insn_1: - sethi %hi(0), %g2 + sethi %hi(sparc64_kern_sec_context), %g2 + ldx [%g2 + %lo(sparc64_kern_sec_context)], %g2 stxa %g2, [%g3] ASI_DMMU membar #Sync add %g6, TI_FPREGS + 0xc0, %g2 @@ -126,8 +126,8 @@ fzero %f34 ldxa [%g3] ASI_DMMU, %g5 add %g6, TI_FPREGS, %g1 -cplus_fptrap_insn_2: - sethi %hi(0), %g2 + sethi %hi(sparc64_kern_sec_context), %g2 + ldx [%g2 + %lo(sparc64_kern_sec_context)], %g2 stxa %g2, [%g3] ASI_DMMU membar #Sync add %g6, TI_FPREGS + 0x40, %g2 @@ -153,8 +153,8 @@ 3: mov SECONDARY_CONTEXT, %g3 add %g6, TI_FPREGS, %g1 ldxa [%g3] ASI_DMMU, %g5 -cplus_fptrap_insn_3: - sethi %hi(0), %g2 + sethi %hi(sparc64_kern_sec_context), %g2 + ldx [%g2 + %lo(sparc64_kern_sec_context)], %g2 stxa %g2, [%g3] ASI_DMMU membar #Sync mov 0x40, %g2 @@ -319,8 +319,8 @@ stx %g3, [%g6 + TI_GSR] mov SECONDARY_CONTEXT, %g3 ldxa [%g3] ASI_DMMU, %g5 -cplus_fptrap_insn_4: - sethi %hi(0), %g2 + sethi %hi(sparc64_kern_sec_context), %g2 + ldx [%g2 + %lo(sparc64_kern_sec_context)], %g2 stxa %g2, [%g3] ASI_DMMU membar #Sync add %g6, TI_FPREGS, %g2 @@ -341,33 +341,6 @@ ba,pt %xcc, etrap wr %g0, 0, %fprs -cplus_fptrap_1: - sethi %hi(CTX_CHEETAH_PLUS_CTX0), %g2 - - .globl cheetah_plus_patch_fpdis -cheetah_plus_patch_fpdis: - /* We configure the dTLB512_0 for 4MB pages and the - * dTLB512_1 for 8K pages when in context zero. - */ - sethi %hi(cplus_fptrap_1), %o0 - lduw [%o0 + %lo(cplus_fptrap_1)], %o1 - - set cplus_fptrap_insn_1, %o2 - stw %o1, [%o2] - flush %o2 - set cplus_fptrap_insn_2, %o2 - stw %o1, [%o2] - flush %o2 - set cplus_fptrap_insn_3, %o2 - stw %o1, [%o2] - flush %o2 - set cplus_fptrap_insn_4, %o2 - stw %o1, [%o2] - flush %o2 - - retl - nop - /* The registers for cross calls will be: * * DATA 0: [low 32-bits] Address of function to call, jmp to this diff -urN -x .git RC13-current/arch/sparc64/kernel/etrap.S linux-2.6/arch/sparc64/kernel/etrap.S --- RC13-current/arch/sparc64/kernel/etrap.S 2005-06-18 00:37:45.000000000 -0400 +++ linux-2.6/arch/sparc64/kernel/etrap.S 2005-10-06 19:55:03.000000000 -0400 @@ -68,12 +68,8 @@ wrpr %g3, 0, %otherwin wrpr %g2, 0, %wstate -cplus_etrap_insn_1: - sethi %hi(0), %g3 - sllx %g3, 32, %g3 -cplus_etrap_insn_2: - sethi %hi(0), %g2 - or %g3, %g2, %g3 + sethi %hi(sparc64_kern_pri_context), %g2 + ldx [%g2 + %lo(sparc64_kern_pri_context)], %g3 stxa %g3, [%l4] ASI_DMMU flush %l6 wr %g0, ASI_AIUS, %asi @@ -215,12 +211,8 @@ mov PRIMARY_CONTEXT, %l4 wrpr %g3, 0, %otherwin wrpr %g2, 0, %wstate -cplus_etrap_insn_3: - sethi %hi(0), %g3 - sllx %g3, 32, %g3 -cplus_etrap_insn_4: - sethi %hi(0), %g2 - or %g3, %g2, %g3 + sethi %hi(sparc64_kern_pri_context), %g2 + ldx [%g2 + %lo(sparc64_kern_pri_context)], %g3 stxa %g3, [%l4] ASI_DMMU flush %l6 @@ -264,38 +256,3 @@ #undef TASK_REGOFF #undef ETRAP_PSTATE1 - -cplus_einsn_1: - sethi %uhi(CTX_CHEETAH_PLUS_NUC), %g3 -cplus_einsn_2: - sethi %hi(CTX_CHEETAH_PLUS_CTX0), %g2 - - .globl cheetah_plus_patch_etrap -cheetah_plus_patch_etrap: - /* We configure the dTLB512_0 for 4MB pages and the - * dTLB512_1 for 8K pages when in context zero. - */ - sethi %hi(cplus_einsn_1), %o0 - sethi %hi(cplus_etrap_insn_1), %o2 - lduw [%o0 + %lo(cplus_einsn_1)], %o1 - or %o2, %lo(cplus_etrap_insn_1), %o2 - stw %o1, [%o2] - flush %o2 - sethi %hi(cplus_etrap_insn_3), %o2 - or %o2, %lo(cplus_etrap_insn_3), %o2 - stw %o1, [%o2] - flush %o2 - - sethi %hi(cplus_einsn_2), %o0 - sethi %hi(cplus_etrap_insn_2), %o2 - lduw [%o0 + %lo(cplus_einsn_2)], %o1 - or %o2, %lo(cplus_etrap_insn_2), %o2 - stw %o1, [%o2] - flush %o2 - sethi %hi(cplus_etrap_insn_4), %o2 - or %o2, %lo(cplus_etrap_insn_4), %o2 - stw %o1, [%o2] - flush %o2 - - retl - nop diff -urN -x .git RC13-current/arch/sparc64/kernel/head.S linux-2.6/arch/sparc64/kernel/head.S --- RC13-current/arch/sparc64/kernel/head.S 2005-10-04 02:45:18.000000000 -0400 +++ linux-2.6/arch/sparc64/kernel/head.S 2005-10-06 19:55:03.000000000 -0400 @@ -325,23 +325,7 @@ 1: sethi %hi(tlb_type), %g1 stw %g2, [%g1 + %lo(tlb_type)] - BRANCH_IF_CHEETAH_PLUS_OR_FOLLOWON(g1,g7,1f) - ba,pt %xcc, 2f - nop - -1: /* Patch context register writes to support nucleus page - * size correctly. - */ - call cheetah_plus_patch_etrap - nop - call cheetah_plus_patch_rtrap - nop - call cheetah_plus_patch_fpdis - nop - call cheetah_plus_patch_winfixup - nop - -2: /* Patch copy/page operations to cheetah optimized versions. */ + /* Patch copy/page operations to cheetah optimized versions. */ call cheetah_patch_copyops nop call cheetah_patch_copy_page @@ -484,20 +468,13 @@ call prom_set_trap_table sethi %hi(sparc64_ttable_tl0), %o0 - BRANCH_IF_CHEETAH_PLUS_OR_FOLLOWON(g2,g3,1f) - ba,pt %xcc, 2f - nop - -1: /* Start using proper page size encodings in ctx register. */ - sethi %uhi(CTX_CHEETAH_PLUS_NUC), %g3 + /* Start using proper page size encodings in ctx register. */ + sethi %hi(sparc64_kern_pri_context), %g3 + ldx [%g3 + %lo(sparc64_kern_pri_context)], %g2 mov PRIMARY_CONTEXT, %g1 - sllx %g3, 32, %g3 - sethi %hi(CTX_CHEETAH_PLUS_CTX0), %g2 - or %g3, %g2, %g3 - stxa %g3, [%g1] ASI_DMMU + stxa %g2, [%g1] ASI_DMMU membar #Sync -2: rdpr %pstate, %o1 or %o1, PSTATE_IE, %o1 wrpr %o1, 0, %pstate diff -urN -x .git RC13-current/arch/sparc64/kernel/rtrap.S linux-2.6/arch/sparc64/kernel/rtrap.S --- RC13-current/arch/sparc64/kernel/rtrap.S 2005-09-05 09:30:11.000000000 -0400 +++ linux-2.6/arch/sparc64/kernel/rtrap.S 2005-10-06 19:55:03.000000000 -0400 @@ -256,9 +256,8 @@ brnz,pn %l3, kern_rtt mov PRIMARY_CONTEXT, %l7 ldxa [%l7 + %l7] ASI_DMMU, %l0 -cplus_rtrap_insn_1: - sethi %hi(0), %l1 - sllx %l1, 32, %l1 + sethi %hi(sparc64_kern_pri_nuc_bits), %l1 + ldx [%l1 + %lo(sparc64_kern_pri_nuc_bits)], %l1 or %l0, %l1, %l0 stxa %l0, [%l7] ASI_DMMU flush %g6 @@ -345,21 +344,3 @@ wr %g0, FPRS_DU, %fprs ba,pt %xcc, rt_continue stb %l5, [%g6 + TI_FPDEPTH] - -cplus_rinsn_1: - sethi %uhi(CTX_CHEETAH_PLUS_NUC), %l1 - - .globl cheetah_plus_patch_rtrap -cheetah_plus_patch_rtrap: - /* We configure the dTLB512_0 for 4MB pages and the - * dTLB512_1 for 8K pages when in context zero. - */ - sethi %hi(cplus_rinsn_1), %o0 - sethi %hi(cplus_rtrap_insn_1), %o2 - lduw [%o0 + %lo(cplus_rinsn_1)], %o1 - or %o2, %lo(cplus_rtrap_insn_1), %o2 - stw %o1, [%o2] - flush %o2 - - retl - nop diff -urN -x .git RC13-current/arch/sparc64/kernel/setup.c linux-2.6/arch/sparc64/kernel/setup.c --- RC13-current/arch/sparc64/kernel/setup.c 2005-10-04 02:45:18.000000000 -0400 +++ linux-2.6/arch/sparc64/kernel/setup.c 2005-10-06 19:55:03.000000000 -0400 @@ -187,17 +187,13 @@ } if ((va >= KERNBASE) && (va < (KERNBASE + (4 * 1024 * 1024)))) { - unsigned long kernel_pctx = 0; - - if (tlb_type == cheetah_plus) - kernel_pctx |= (CTX_CHEETAH_PLUS_NUC | - CTX_CHEETAH_PLUS_CTX0); + extern unsigned long sparc64_kern_pri_context; /* Spitfire Errata #32 workaround */ __asm__ __volatile__("stxa %0, [%1] %2\n\t" "flush %%g6" : /* No outputs */ - : "r" (kernel_pctx), + : "r" (sparc64_kern_pri_context), "r" (PRIMARY_CONTEXT), "i" (ASI_DMMU)); diff -urN -x .git RC13-current/arch/sparc64/kernel/trampoline.S linux-2.6/arch/sparc64/kernel/trampoline.S --- RC13-current/arch/sparc64/kernel/trampoline.S 2005-09-28 13:49:58.000000000 -0400 +++ linux-2.6/arch/sparc64/kernel/trampoline.S 2005-10-06 19:55:03.000000000 -0400 @@ -336,20 +336,13 @@ call init_irqwork_curcpu nop - BRANCH_IF_CHEETAH_PLUS_OR_FOLLOWON(g2,g3,1f) - ba,pt %xcc, 2f - nop - -1: /* Start using proper page size encodings in ctx register. */ - sethi %uhi(CTX_CHEETAH_PLUS_NUC), %g3 + /* Start using proper page size encodings in ctx register. */ + sethi %hi(sparc64_kern_pri_context), %g3 + ldx [%g3 + %lo(sparc64_kern_pri_context)], %g2 mov PRIMARY_CONTEXT, %g1 - sllx %g3, 32, %g3 - sethi %hi(CTX_CHEETAH_PLUS_CTX0), %g2 - or %g3, %g2, %g3 - stxa %g3, [%g1] ASI_DMMU + stxa %g2, [%g1] ASI_DMMU membar #Sync -2: rdpr %pstate, %o1 or %o1, PSTATE_IE, %o1 wrpr %o1, 0, %pstate diff -urN -x .git RC13-current/arch/sparc64/kernel/winfixup.S linux-2.6/arch/sparc64/kernel/winfixup.S --- RC13-current/arch/sparc64/kernel/winfixup.S 2005-08-30 03:16:20.000000000 -0400 +++ linux-2.6/arch/sparc64/kernel/winfixup.S 2005-10-06 19:55:03.000000000 -0400 @@ -16,23 +16,14 @@ .text set_pcontext: -cplus_winfixup_insn_1: - sethi %hi(0), %l1 + sethi %hi(sparc64_kern_pri_context), %l1 + ldx [%l1 + %lo(sparc64_kern_pri_context)], %l1 mov PRIMARY_CONTEXT, %g1 - sllx %l1, 32, %l1 -cplus_winfixup_insn_2: - sethi %hi(0), %g2 - or %l1, %g2, %l1 stxa %l1, [%g1] ASI_DMMU flush %g6 retl nop -cplus_wfinsn_1: - sethi %uhi(CTX_CHEETAH_PLUS_NUC), %l1 -cplus_wfinsn_2: - sethi %hi(CTX_CHEETAH_PLUS_CTX0), %g2 - .align 32 /* Here are the rules, pay attention. @@ -395,23 +386,3 @@ add %sp, PTREGS_OFF, %o0 ba,pt %xcc, rtrap clr %l6 - - - .globl cheetah_plus_patch_winfixup -cheetah_plus_patch_winfixup: - sethi %hi(cplus_wfinsn_1), %o0 - sethi %hi(cplus_winfixup_insn_1), %o2 - lduw [%o0 + %lo(cplus_wfinsn_1)], %o1 - or %o2, %lo(cplus_winfixup_insn_1), %o2 - stw %o1, [%o2] - flush %o2 - - sethi %hi(cplus_wfinsn_2), %o0 - sethi %hi(cplus_winfixup_insn_2), %o2 - lduw [%o0 + %lo(cplus_wfinsn_2)], %o1 - or %o2, %lo(cplus_winfixup_insn_2), %o2 - stw %o1, [%o2] - flush %o2 - - retl - nop diff -urN -x .git RC13-current/arch/sparc64/mm/init.c linux-2.6/arch/sparc64/mm/init.c --- RC13-current/arch/sparc64/mm/init.c 2005-10-04 02:45:18.000000000 -0400 +++ linux-2.6/arch/sparc64/mm/init.c 2005-10-06 19:55:03.000000000 -0400 @@ -133,6 +133,12 @@ struct page *mem_map_zero __read_mostly; +unsigned int sparc64_highest_unlocked_tlb_ent __read_mostly; + +unsigned long sparc64_kern_pri_context __read_mostly; +unsigned long sparc64_kern_pri_nuc_bits __read_mostly; +unsigned long sparc64_kern_sec_context __read_mostly; + int bigkernel = 0; /* XXX Tune this... */ @@ -362,6 +368,7 @@ unsigned long data; }; static struct linux_prom_translation prom_trans[512] __initdata; +static unsigned int prom_trans_ents __initdata; extern unsigned long prom_boot_page; extern void prom_remap(unsigned long physpage, unsigned long virtpage, int mmu_ihandle); @@ -375,57 +382,7 @@ unsigned long prom_pmd_phys __read_mostly; unsigned int swapper_pgd_zero __read_mostly; -/* Allocate power-of-2 aligned chunks from the end of the - * kernel image. Return physical address. - */ -static inline unsigned long early_alloc_phys(unsigned long size) -{ - unsigned long base; - - BUILD_BUG_ON(size & (size - 1)); - - kern_size = (kern_size + (size - 1)) & ~(size - 1); - base = kern_base + kern_size; - kern_size += size; - - return base; -} - -static inline unsigned long load_phys32(unsigned long pa) -{ - unsigned long val; - - __asm__ __volatile__("lduwa [%1] %2, %0" - : "=&r" (val) - : "r" (pa), "i" (ASI_PHYS_USE_EC)); - - return val; -} - -static inline unsigned long load_phys64(unsigned long pa) -{ - unsigned long val; - - __asm__ __volatile__("ldxa [%1] %2, %0" - : "=&r" (val) - : "r" (pa), "i" (ASI_PHYS_USE_EC)); - - return val; -} - -static inline void store_phys32(unsigned long pa, unsigned long val) -{ - __asm__ __volatile__("stwa %0, [%1] %2" - : /* no outputs */ - : "r" (val), "r" (pa), "i" (ASI_PHYS_USE_EC)); -} - -static inline void store_phys64(unsigned long pa, unsigned long val) -{ - __asm__ __volatile__("stxa %0, [%1] %2" - : /* no outputs */ - : "r" (val), "r" (pa), "i" (ASI_PHYS_USE_EC)); -} +static pmd_t *prompmd __read_mostly; #define BASE_PAGE_SIZE 8192 @@ -435,34 +392,28 @@ */ unsigned long prom_virt_to_phys(unsigned long promva, int *error) { - unsigned long pmd_phys = (prom_pmd_phys + - ((promva >> 23) & 0x7ff) * sizeof(pmd_t)); - unsigned long pte_phys; - pmd_t pmd_ent; - pte_t pte_ent; + pmd_t *pmdp = prompmd + ((promva >> 23) & 0x7ff); + pte_t *ptep; unsigned long base; - pmd_val(pmd_ent) = load_phys32(pmd_phys); - if (pmd_none(pmd_ent)) { + if (pmd_none(*pmdp)) { if (error) *error = 1; return 0; } - - pte_phys = (unsigned long)pmd_val(pmd_ent) << 11UL; - pte_phys += ((promva >> 13) & 0x3ff) * sizeof(pte_t); - pte_val(pte_ent) = load_phys64(pte_phys); - if (!pte_present(pte_ent)) { + ptep = (pte_t *)__pmd_page(*pmdp) + ((promva >> 13) & 0x3ff); + if (!pte_present(*ptep)) { if (error) *error = 1; return 0; } if (error) { *error = 0; - return pte_val(pte_ent); + return pte_val(*ptep); } - base = pte_val(pte_ent) & _PAGE_PADDR; - return (base + (promva & (BASE_PAGE_SIZE - 1))); + base = pte_val(*ptep) & _PAGE_PADDR; + + return base + (promva & (BASE_PAGE_SIZE - 1)); } /* The obp translations are saved based on 8k pagesize, since obp can @@ -475,25 +426,20 @@ unsigned long vaddr; for (vaddr = start; vaddr < end; vaddr += BASE_PAGE_SIZE) { - unsigned long val, pte_phys, pmd_phys; - pmd_t pmd_ent; - int i; - - pmd_phys = (prom_pmd_phys + - (((vaddr >> 23) & 0x7ff) * sizeof(pmd_t))); - pmd_val(pmd_ent) = load_phys32(pmd_phys); - if (pmd_none(pmd_ent)) { - pte_phys = early_alloc_phys(BASE_PAGE_SIZE); - - for (i = 0; i < BASE_PAGE_SIZE / sizeof(pte_t); i++) - store_phys64(pte_phys+i*sizeof(pte_t),0); + unsigned long val; + pmd_t *pmd; + pte_t *pte; - pmd_val(pmd_ent) = pte_phys >> 11UL; - store_phys32(pmd_phys, pmd_val(pmd_ent)); + pmd = prompmd + ((vaddr >> 23) & 0x7ff); + if (pmd_none(*pmd)) { + pte = __alloc_bootmem(BASE_PAGE_SIZE, BASE_PAGE_SIZE, + PAGE_SIZE); + if (!pte) + prom_halt(); + memset(pte, 0, BASE_PAGE_SIZE); + pmd_set(pmd, pte); } - - pte_phys = (unsigned long)pmd_val(pmd_ent) << 11UL; - pte_phys += (((vaddr >> 13) & 0x3ff) * sizeof(pte_t)); + pte = (pte_t *) __pmd_page(*pmd) + ((vaddr >> 13) & 0x3ff); val = data; @@ -501,7 +447,8 @@ if (tlb_type == spitfire) val &= ~0x0003fe0000000000UL; - store_phys64(pte_phys, val | _PAGE_MODIFIED); + set_pte_at(&init_mm, vaddr, pte, + __pte(val | _PAGE_MODIFIED)); data += BASE_PAGE_SIZE; } @@ -514,13 +461,17 @@ } #define OBP_PMD_SIZE 2048 -static void __init build_obp_pgtable(int prom_trans_ents) +static void __init build_obp_pgtable(void) { unsigned long i; - prom_pmd_phys = early_alloc_phys(OBP_PMD_SIZE); - for (i = 0; i < OBP_PMD_SIZE; i += 4) - store_phys32(prom_pmd_phys + i, 0); + prompmd = __alloc_bootmem(OBP_PMD_SIZE, OBP_PMD_SIZE, PAGE_SIZE); + if (!prompmd) + prom_halt(); + + memset(prompmd, 0, OBP_PMD_SIZE); + + prom_pmd_phys = __pa(prompmd); for (i = 0; i < prom_trans_ents; i++) { unsigned long start, end; @@ -540,7 +491,7 @@ /* Read OBP translations property into 'prom_trans[]'. * Return the number of entries. */ -static int __init read_obp_translations(void) +static void __init read_obp_translations(void) { int n, node; @@ -561,8 +512,10 @@ prom_printf("prom_mappings: Couldn't get property.\n"); prom_halt(); } + n = n / sizeof(struct linux_prom_translation); - return n; + + prom_trans_ents = n; } static void __init remap_kernel(void) @@ -582,28 +535,38 @@ prom_dtlb_load(tlb_ent, tte_data, tte_vaddr); prom_itlb_load(tlb_ent, tte_data, tte_vaddr); if (bigkernel) { - prom_dtlb_load(tlb_ent - 1, + tlb_ent -= 1; + prom_dtlb_load(tlb_ent, tte_data + 0x400000, tte_vaddr + 0x400000); - prom_itlb_load(tlb_ent - 1, + prom_itlb_load(tlb_ent, tte_data + 0x400000, tte_vaddr + 0x400000); } + sparc64_highest_unlocked_tlb_ent = tlb_ent - 1; + if (tlb_type == cheetah_plus) { + sparc64_kern_pri_context = (CTX_CHEETAH_PLUS_CTX0 | + CTX_CHEETAH_PLUS_NUC); + sparc64_kern_pri_nuc_bits = CTX_CHEETAH_PLUS_NUC; + sparc64_kern_sec_context = CTX_CHEETAH_PLUS_CTX0; + } } -static void __init inherit_prom_mappings(void) -{ - int n; - n = read_obp_translations(); - build_obp_pgtable(n); +static void __init inherit_prom_mappings_pre(void) +{ + read_obp_translations(); /* Now fixup OBP's idea about where we really are mapped. */ prom_printf("Remapping the kernel... "); remap_kernel(); prom_printf("done.\n"); +} +static void __init inherit_prom_mappings_post(void) +{ + build_obp_pgtable(); register_prom_callbacks(); } @@ -788,8 +751,8 @@ } } if (tlb_type == spitfire) { - int high = SPITFIRE_HIGHEST_LOCKED_TLBENT - bigkernel; - for (i = 0; i < high; i++) { + int high = sparc64_highest_unlocked_tlb_ent; + for (i = 0; i <= high; i++) { unsigned long data; /* Spitfire Errata #32 workaround */ @@ -877,9 +840,9 @@ } } } else if (tlb_type == cheetah || tlb_type == cheetah_plus) { - int high = CHEETAH_HIGHEST_LOCKED_TLBENT - bigkernel; + int high = sparc64_highest_unlocked_tlb_ent; - for (i = 0; i < high; i++) { + for (i = 0; i <= high; i++) { unsigned long data; data = cheetah_get_ldtlb_data(i); @@ -1556,8 +1519,7 @@ swapper_pgd_zero = pgd_val(swapper_pg_dir[0]); - /* Inherit non-locked OBP mappings. */ - inherit_prom_mappings(); + inherit_prom_mappings_pre(); /* Ok, we can use our TLB miss and window trap handlers safely. * We need to do a quick peek here to see if we are on StarFire @@ -1568,15 +1530,23 @@ extern void setup_tba(int); setup_tba(this_is_starfire); } - - inherit_locked_prom_mappings(1); - __flush_tlb_all(); + /* Everything from this point forward, until we are done with + * inherit_prom_mappings_post(), must complete successfully + * without calling into the firmware. The firwmare page tables + * have not been built, but we are running on the Linux kernel's + * trap table. + */ + /* Setup bootmem... */ pages_avail = 0; last_valid_pfn = end_pfn = bootmem_init(&pages_avail); + inherit_prom_mappings_post(); + + inherit_locked_prom_mappings(1); + #ifdef CONFIG_DEBUG_PAGEALLOC kernel_physical_mapping_init(); #endif diff -urN -x .git RC13-current/drivers/atm/fore200e.c linux-2.6/drivers/atm/fore200e.c --- RC13-current/drivers/atm/fore200e.c 2005-08-30 03:16:20.000000000 -0400 +++ linux-2.6/drivers/atm/fore200e.c 2005-10-06 19:55:03.000000000 -0400 @@ -178,14 +178,12 @@ static void* -fore200e_kmalloc(int size, int flags) +fore200e_kmalloc(int size, unsigned int __nocast flags) { - void* chunk = kmalloc(size, flags); + void *chunk = kzalloc(size, flags); - if (chunk) - memset(chunk, 0x00, size); - else - printk(FORE200E "kmalloc() failed, requested size = %d, flags = 0x%x\n", size, flags); + if (!chunk) + printk(FORE200E "kmalloc() failed, requested size = %d, flags = 0x%x\n", size, flags); return chunk; } diff -urN -x .git RC13-current/drivers/char/drm/drm_stub.c linux-2.6/drivers/char/drm/drm_stub.c --- RC13-current/drivers/char/drm/drm_stub.c 2005-08-31 02:19:02.000000000 -0400 +++ linux-2.6/drivers/char/drm/drm_stub.c 2005-10-05 12:28:30.000000000 -0400 @@ -47,7 +47,7 @@ MODULE_PARM_DESC(debug, "Enable debug output"); module_param_named(cards_limit, drm_cards_limit, int, 0444); -module_param_named(debug, drm_debug, int, 0666); +module_param_named(debug, drm_debug, int, 0600); drm_head_t **drm_heads; struct drm_sysfs_class *drm_class; diff -urN -x .git RC13-current/drivers/connector/connector.c linux-2.6/drivers/connector/connector.c --- RC13-current/drivers/connector/connector.c 2005-09-28 13:49:58.000000000 -0400 +++ linux-2.6/drivers/connector/connector.c 2005-10-06 19:55:03.000000000 -0400 @@ -69,7 +69,8 @@ * a new message. * */ -int cn_netlink_send(struct cn_msg *msg, u32 __group, int gfp_mask) +int cn_netlink_send(struct cn_msg *msg, u32 __group, + unsigned int __nocast gfp_mask) { struct cn_callback_entry *__cbq; unsigned int size; diff -urN -x .git RC13-current/drivers/mfd/ucb1x00-core.c linux-2.6/drivers/mfd/ucb1x00-core.c --- RC13-current/drivers/mfd/ucb1x00-core.c 2005-09-12 04:31:51.000000000 -0400 +++ linux-2.6/drivers/mfd/ucb1x00-core.c 2005-10-06 19:55:03.000000000 -0400 @@ -642,8 +642,6 @@ module_init(ucb1x00_init); module_exit(ucb1x00_exit); -EXPORT_SYMBOL(ucb1x00_class); - EXPORT_SYMBOL(ucb1x00_io_set_dir); EXPORT_SYMBOL(ucb1x00_io_write); EXPORT_SYMBOL(ucb1x00_io_read); diff -urN -x .git RC13-current/drivers/mfd/ucb1x00.h linux-2.6/drivers/mfd/ucb1x00.h --- RC13-current/drivers/mfd/ucb1x00.h 2005-09-12 04:31:51.000000000 -0400 +++ linux-2.6/drivers/mfd/ucb1x00.h 2005-10-06 19:55:03.000000000 -0400 @@ -106,8 +106,6 @@ void (*fn)(int, void *); }; -extern struct class ucb1x00_class; - struct ucb1x00 { spinlock_t lock; struct mcp *mcp; diff -urN -x .git RC13-current/drivers/net/bonding/bond_main.c linux-2.6/drivers/net/bonding/bond_main.c --- RC13-current/drivers/net/bonding/bond_main.c 2005-10-05 01:52:33.000000000 -0400 +++ linux-2.6/drivers/net/bonding/bond_main.c 2005-10-06 19:55:03.000000000 -0400 @@ -1289,12 +1289,13 @@ /* * Copy all the Multicast addresses from src to the bonding device dst */ -static int bond_mc_list_copy(struct dev_mc_list *mc_list, struct bonding *bond, int gpf_flag) +static int bond_mc_list_copy(struct dev_mc_list *mc_list, struct bonding *bond, + unsigned int __nocast gfp_flag) { struct dev_mc_list *dmi, *new_dmi; for (dmi = mc_list; dmi; dmi = dmi->next) { - new_dmi = kmalloc(sizeof(struct dev_mc_list), gpf_flag); + new_dmi = kmalloc(sizeof(struct dev_mc_list), gfp_flag); if (!new_dmi) { /* FIXME: Potential memory leak !!! */ diff -urN -x .git RC13-current/drivers/net/wireless/orinoco.c linux-2.6/drivers/net/wireless/orinoco.c --- RC13-current/drivers/net/wireless/orinoco.c 2005-09-28 21:26:05.000000000 -0400 +++ linux-2.6/drivers/net/wireless/orinoco.c 2005-10-05 11:43:34.000000000 -0400 @@ -503,9 +503,14 @@ return 0; } - /* Length of the packet body */ - /* FIXME: what if the skb is smaller than this? */ - len = max_t(int,skb->len - ETH_HLEN, ETH_ZLEN - ETH_HLEN); + /* Check packet length, pad short packets, round up odd length */ + len = max_t(int, ALIGN(skb->len, 2), ETH_ZLEN); + if (skb->len < len) { + skb = skb_padto(skb, len); + if (skb == NULL) + goto fail; + } + len -= ETH_HLEN; eh = (struct ethhdr *)skb->data; @@ -557,8 +562,7 @@ p = skb->data; } - /* Round up for odd length packets */ - err = hermes_bap_pwrite(hw, USER_BAP, p, ALIGN(data_len, 2), + err = hermes_bap_pwrite(hw, USER_BAP, p, data_len, txfid, data_off); if (err) { printk(KERN_ERR "%s: Error %d writing packet to BAP\n", diff -urN -x .git RC13-current/include/asm-sparc/btfixup.h linux-2.6/include/asm-sparc/btfixup.h --- RC13-current/include/asm-sparc/btfixup.h 2005-10-05 01:52:33.000000000 -0400 +++ linux-2.6/include/asm-sparc/btfixup.h 2005-10-05 12:28:30.000000000 -0400 @@ -49,7 +49,7 @@ /* Put bottom 13bits into some register variable */ #define BTFIXUPDEF_SIMM13(__name) \ - extern unsigned int ___sf_##__name(void) __attribute_const__; \ + static inline unsigned int ___sf_##__name(void) __attribute_const__; \ extern unsigned ___ss_##__name[2]; \ static inline unsigned int ___sf_##__name(void) { \ unsigned int ret; \ @@ -57,7 +57,7 @@ return ret; \ } #define BTFIXUPDEF_SIMM13_INIT(__name,__val) \ - extern unsigned int ___sf_##__name(void) __attribute_const__; \ + static inline unsigned int ___sf_##__name(void) __attribute_const__; \ extern unsigned ___ss_##__name[2]; \ static inline unsigned int ___sf_##__name(void) { \ unsigned int ret; \ @@ -71,7 +71,7 @@ */ #define BTFIXUPDEF_HALF(__name) \ - extern unsigned int ___af_##__name(void) __attribute_const__; \ + static inline unsigned int ___af_##__name(void) __attribute_const__; \ extern unsigned ___as_##__name[2]; \ static inline unsigned int ___af_##__name(void) { \ unsigned int ret; \ @@ -79,7 +79,7 @@ return ret; \ } #define BTFIXUPDEF_HALF_INIT(__name,__val) \ - extern unsigned int ___af_##__name(void) __attribute_const__; \ + static inline unsigned int ___af_##__name(void) __attribute_const__; \ extern unsigned ___as_##__name[2]; \ static inline unsigned int ___af_##__name(void) { \ unsigned int ret; \ @@ -90,7 +90,7 @@ /* Put upper 22 bits into some register variable */ #define BTFIXUPDEF_SETHI(__name) \ - extern unsigned int ___hf_##__name(void) __attribute_const__; \ + static inline unsigned int ___hf_##__name(void) __attribute_const__; \ extern unsigned ___hs_##__name[2]; \ static inline unsigned int ___hf_##__name(void) { \ unsigned int ret; \ @@ -98,7 +98,7 @@ return ret; \ } #define BTFIXUPDEF_SETHI_INIT(__name,__val) \ - extern unsigned int ___hf_##__name(void) __attribute_const__; \ + static inline unsigned int ___hf_##__name(void) __attribute_const__; \ extern unsigned ___hs_##__name[2]; \ static inline unsigned int ___hf_##__name(void) { \ unsigned int ret; \ diff -urN -x .git RC13-current/include/asm-sparc/pgtable.h linux-2.6/include/asm-sparc/pgtable.h --- RC13-current/include/asm-sparc/pgtable.h 2005-10-05 01:52:33.000000000 -0400 +++ linux-2.6/include/asm-sparc/pgtable.h 2005-10-05 12:28:30.000000000 -0400 @@ -194,19 +194,19 @@ BTFIXUPDEF_HALF(pte_dirtyi) BTFIXUPDEF_HALF(pte_youngi) -extern int pte_write(pte_t pte) __attribute_const__; +static int pte_write(pte_t pte) __attribute_const__; static inline int pte_write(pte_t pte) { return pte_val(pte) & BTFIXUP_HALF(pte_writei); } -extern int pte_dirty(pte_t pte) __attribute_const__; +static int pte_dirty(pte_t pte) __attribute_const__; static inline int pte_dirty(pte_t pte) { return pte_val(pte) & BTFIXUP_HALF(pte_dirtyi); } -extern int pte_young(pte_t pte) __attribute_const__; +static int pte_young(pte_t pte) __attribute_const__; static inline int pte_young(pte_t pte) { return pte_val(pte) & BTFIXUP_HALF(pte_youngi); @@ -217,7 +217,7 @@ */ BTFIXUPDEF_HALF(pte_filei) -extern int pte_file(pte_t pte) __attribute_const__; +static int pte_file(pte_t pte) __attribute_const__; static inline int pte_file(pte_t pte) { return pte_val(pte) & BTFIXUP_HALF(pte_filei); @@ -229,19 +229,19 @@ BTFIXUPDEF_HALF(pte_mkcleani) BTFIXUPDEF_HALF(pte_mkoldi) -extern pte_t pte_wrprotect(pte_t pte) __attribute_const__; +static pte_t pte_wrprotect(pte_t pte) __attribute_const__; static inline pte_t pte_wrprotect(pte_t pte) { return __pte(pte_val(pte) & ~BTFIXUP_HALF(pte_wrprotecti)); } -extern pte_t pte_mkclean(pte_t pte) __attribute_const__; +static pte_t pte_mkclean(pte_t pte) __attribute_const__; static inline pte_t pte_mkclean(pte_t pte) { return __pte(pte_val(pte) & ~BTFIXUP_HALF(pte_mkcleani)); } -extern pte_t pte_mkold(pte_t pte) __attribute_const__; +static pte_t pte_mkold(pte_t pte) __attribute_const__; static inline pte_t pte_mkold(pte_t pte) { return __pte(pte_val(pte) & ~BTFIXUP_HALF(pte_mkoldi)); @@ -278,7 +278,7 @@ BTFIXUPDEF_INT(pte_modify_mask) -extern pte_t pte_modify(pte_t pte, pgprot_t newprot) __attribute_const__; +static pte_t pte_modify(pte_t pte, pgprot_t newprot) __attribute_const__; static inline pte_t pte_modify(pte_t pte, pgprot_t newprot) { return __pte((pte_val(pte) & BTFIXUP_INT(pte_modify_mask)) | diff -urN -x .git RC13-current/include/linux/atmdev.h linux-2.6/include/linux/atmdev.h --- RC13-current/include/linux/atmdev.h 2005-06-18 00:37:55.000000000 -0400 +++ linux-2.6/include/linux/atmdev.h 2005-10-06 19:55:03.000000000 -0400 @@ -457,7 +457,7 @@ int atm_charge(struct atm_vcc *vcc,int truesize); struct sk_buff *atm_alloc_charge(struct atm_vcc *vcc,int pdu_size, - int gfp_flags); + unsigned int __nocast gfp_flags); int atm_pcr_goal(struct atm_trafprm *tp); void vcc_release_async(struct atm_vcc *vcc, int reply); diff -urN -x .git RC13-current/include/linux/connector.h linux-2.6/include/linux/connector.h --- RC13-current/include/linux/connector.h 2005-09-28 13:49:58.000000000 -0400 +++ linux-2.6/include/linux/connector.h 2005-10-06 19:55:03.000000000 -0400 @@ -149,7 +149,7 @@ int cn_add_callback(struct cb_id *, char *, void (*callback) (void *)); void cn_del_callback(struct cb_id *); -int cn_netlink_send(struct cn_msg *, u32, int); +int cn_netlink_send(struct cn_msg *, u32, unsigned int __nocast); int cn_queue_add_callback(struct cn_queue_dev *dev, char *name, struct cb_id *id, void (*callback)(void *)); void cn_queue_del_callback(struct cn_queue_dev *dev, struct cb_id *id); diff -urN -x .git RC13-current/include/linux/textsearch.h linux-2.6/include/linux/textsearch.h --- RC13-current/include/linux/textsearch.h 2005-08-29 22:26:44.000000000 -0400 +++ linux-2.6/include/linux/textsearch.h 2005-10-06 19:55:03.000000000 -0400 @@ -158,7 +158,8 @@ #define TS_PRIV_ALIGNTO 8 #define TS_PRIV_ALIGN(len) (((len) + TS_PRIV_ALIGNTO-1) & ~(TS_PRIV_ALIGNTO-1)) -static inline struct ts_config *alloc_ts_config(size_t payload, int gfp_mask) +static inline struct ts_config *alloc_ts_config(size_t payload, + unsigned int __nocast gfp_mask) { struct ts_config *conf; diff -urN -x .git RC13-current/include/net/dn_nsp.h linux-2.6/include/net/dn_nsp.h --- RC13-current/include/net/dn_nsp.h 2004-12-25 01:04:36.000000000 -0500 +++ linux-2.6/include/net/dn_nsp.h 2005-10-06 19:55:03.000000000 -0400 @@ -19,9 +19,9 @@ extern void dn_nsp_send_oth_ack(struct sock *sk); extern void dn_nsp_delayed_ack(struct sock *sk); extern void dn_send_conn_ack(struct sock *sk); -extern void dn_send_conn_conf(struct sock *sk, int gfp); +extern void dn_send_conn_conf(struct sock *sk, unsigned int __nocast gfp); extern void dn_nsp_send_disc(struct sock *sk, unsigned char type, - unsigned short reason, int gfp); + unsigned short reason, unsigned int __nocast gfp); extern void dn_nsp_return_disc(struct sk_buff *skb, unsigned char type, unsigned short reason); extern void dn_nsp_send_link(struct sock *sk, unsigned char lsflags, char fcval); @@ -29,14 +29,14 @@ extern void dn_nsp_output(struct sock *sk); extern int dn_nsp_check_xmit_queue(struct sock *sk, struct sk_buff *skb, struct sk_buff_head *q, unsigned short acknum); -extern void dn_nsp_queue_xmit(struct sock *sk, struct sk_buff *skb, int gfp, int oob); +extern void dn_nsp_queue_xmit(struct sock *sk, struct sk_buff *skb, unsigned int __nocast gfp, int oob); extern unsigned long dn_nsp_persist(struct sock *sk); extern int dn_nsp_xmit_timeout(struct sock *sk); extern int dn_nsp_rx(struct sk_buff *); extern int dn_nsp_backlog_rcv(struct sock *sk, struct sk_buff *skb); -extern struct sk_buff *dn_alloc_skb(struct sock *sk, int size, int pri); +extern struct sk_buff *dn_alloc_skb(struct sock *sk, int size, unsigned int __nocast pri); extern struct sk_buff *dn_alloc_send_skb(struct sock *sk, size_t *size, int noblock, long timeo, int *err); #define NSP_REASON_OK 0 /* No error */ diff -urN -x .git RC13-current/include/net/dn_route.h linux-2.6/include/net/dn_route.h --- RC13-current/include/net/dn_route.h 2004-10-18 17:53:07.000000000 -0400 +++ linux-2.6/include/net/dn_route.h 2005-10-06 19:55:03.000000000 -0400 @@ -15,7 +15,7 @@ GNU General Public License for more details. *******************************************************************************/ -extern struct sk_buff *dn_alloc_skb(struct sock *sk, int size, int pri); +extern struct sk_buff *dn_alloc_skb(struct sock *sk, int size, unsigned int __nocast pri); extern int dn_route_output_sock(struct dst_entry **pprt, struct flowi *, struct sock *sk, int flags); extern int dn_cache_dump(struct sk_buff *skb, struct netlink_callback *cb); extern int dn_cache_getroute(struct sk_buff *skb, struct nlmsghdr *nlh, void *arg); diff -urN -x .git RC13-current/include/net/inet_hashtables.h linux-2.6/include/net/inet_hashtables.h --- RC13-current/include/net/inet_hashtables.h 2005-10-04 02:45:18.000000000 -0400 +++ linux-2.6/include/net/inet_hashtables.h 2005-10-06 19:55:03.000000000 -0400 @@ -40,7 +40,7 @@ struct inet_ehash_bucket { rwlock_t lock; struct hlist_head chain; -} __attribute__((__aligned__(8))); +}; /* There are a few simple rules, which allow for local port reuse by * an application. In essence: diff -urN -x .git RC13-current/include/net/ip_vs.h linux-2.6/include/net/ip_vs.h --- RC13-current/include/net/ip_vs.h 2005-09-19 00:08:11.000000000 -0400 +++ linux-2.6/include/net/ip_vs.h 2005-10-06 19:55:03.000000000 -0400 @@ -832,7 +832,7 @@ extern int ip_vs_app_pkt_out(struct ip_vs_conn *, struct sk_buff **pskb); extern int ip_vs_app_pkt_in(struct ip_vs_conn *, struct sk_buff **pskb); -extern int ip_vs_skb_replace(struct sk_buff *skb, int pri, +extern int ip_vs_skb_replace(struct sk_buff *skb, unsigned int __nocast pri, char *o_buf, int o_len, char *n_buf, int n_len); extern int ip_vs_app_init(void); extern void ip_vs_app_cleanup(void); diff -urN -x .git RC13-current/include/net/xfrm.h linux-2.6/include/net/xfrm.h --- RC13-current/include/net/xfrm.h 2005-08-30 03:16:20.000000000 -0400 +++ linux-2.6/include/net/xfrm.h 2005-10-06 19:55:03.000000000 -0400 @@ -875,7 +875,7 @@ } #endif -struct xfrm_policy *xfrm_policy_alloc(int gfp); +struct xfrm_policy *xfrm_policy_alloc(unsigned int __nocast gfp); extern int xfrm_policy_walk(int (*func)(struct xfrm_policy *, int, int, void*), void *); int xfrm_policy_insert(int dir, struct xfrm_policy *policy, int excl); struct xfrm_policy *xfrm_policy_bysel(int dir, struct xfrm_selector *sel, @@ -931,4 +931,9 @@ } } +static inline int xfrm_policy_id2dir(u32 index) +{ + return index & 7; +} + #endif /* _NET_XFRM_H */ diff -urN -x .git RC13-current/include/rxrpc/call.h linux-2.6/include/rxrpc/call.h --- RC13-current/include/rxrpc/call.h 2005-03-27 06:18:23.000000000 -0500 +++ linux-2.6/include/rxrpc/call.h 2005-10-06 19:55:03.000000000 -0400 @@ -203,7 +203,7 @@ size_t sioc, struct kvec *siov, uint8_t rxhdr_flags, - int alloc_flags, + unsigned int __nocast alloc_flags, int dup_data, size_t *size_sent); diff -urN -x .git RC13-current/include/rxrpc/message.h linux-2.6/include/rxrpc/message.h --- RC13-current/include/rxrpc/message.h 2004-10-18 17:53:45.000000000 -0400 +++ linux-2.6/include/rxrpc/message.h 2005-10-06 19:55:03.000000000 -0400 @@ -63,7 +63,7 @@ uint8_t type, int count, struct kvec *diov, - int alloc_flags, + unsigned int __nocast alloc_flags, struct rxrpc_message **_msg); extern int rxrpc_conn_sendmsg(struct rxrpc_connection *conn, struct rxrpc_message *msg); diff -urN -x .git RC13-current/lib/ts_bm.c linux-2.6/lib/ts_bm.c --- RC13-current/lib/ts_bm.c 2005-08-30 03:16:20.000000000 -0400 +++ linux-2.6/lib/ts_bm.c 2005-10-06 19:55:03.000000000 -0400 @@ -127,7 +127,7 @@ } static struct ts_config *bm_init(const void *pattern, unsigned int len, - int gfp_mask) + unsigned int __nocast gfp_mask) { struct ts_config *conf; struct ts_bm *bm; diff -urN -x .git RC13-current/lib/ts_fsm.c linux-2.6/lib/ts_fsm.c --- RC13-current/lib/ts_fsm.c 2005-08-29 22:26:44.000000000 -0400 +++ linux-2.6/lib/ts_fsm.c 2005-10-06 19:55:03.000000000 -0400 @@ -258,7 +258,7 @@ } static struct ts_config *fsm_init(const void *pattern, unsigned int len, - int gfp_mask) + unsigned int __nocast gfp_mask) { int i, err = -EINVAL; struct ts_config *conf; diff -urN -x .git RC13-current/lib/ts_kmp.c linux-2.6/lib/ts_kmp.c --- RC13-current/lib/ts_kmp.c 2005-08-29 22:26:44.000000000 -0400 +++ linux-2.6/lib/ts_kmp.c 2005-10-06 19:55:03.000000000 -0400 @@ -87,7 +87,7 @@ } static struct ts_config *kmp_init(const void *pattern, unsigned int len, - int gfp_mask) + unsigned int __nocast gfp_mask) { struct ts_config *conf; struct ts_kmp *kmp; diff -urN -x .git RC13-current/net/atm/atm_misc.c linux-2.6/net/atm/atm_misc.c --- RC13-current/net/atm/atm_misc.c 2005-06-18 00:37:56.000000000 -0400 +++ linux-2.6/net/atm/atm_misc.c 2005-10-06 19:55:03.000000000 -0400 @@ -25,7 +25,7 @@ struct sk_buff *atm_alloc_charge(struct atm_vcc *vcc,int pdu_size, - int gfp_flags) + unsigned int __nocast gfp_flags) { struct sock *sk = sk_atm(vcc); int guess = atm_guess_pdu2truesize(pdu_size); diff -urN -x .git RC13-current/net/ax25/ax25_in.c linux-2.6/net/ax25/ax25_in.c --- RC13-current/net/ax25/ax25_in.c 2005-08-30 03:16:20.000000000 -0400 +++ linux-2.6/net/ax25/ax25_in.c 2005-10-06 19:55:03.000000000 -0400 @@ -123,7 +123,7 @@ } skb_pull(skb, 1); /* Remove PID */ - skb->h.raw = skb->data; + skb->mac.raw = skb->nh.raw; skb->nh.raw = skb->data; skb->dev = ax25->ax25_dev->dev; skb->pkt_type = PACKET_HOST; diff -urN -x .git RC13-current/net/decnet/af_decnet.c linux-2.6/net/decnet/af_decnet.c --- RC13-current/net/decnet/af_decnet.c 2005-09-05 09:30:13.000000000 -0400 +++ linux-2.6/net/decnet/af_decnet.c 2005-10-06 19:55:03.000000000 -0400 @@ -452,7 +452,8 @@ .obj_size = sizeof(struct dn_sock), }; -static struct sock *dn_alloc_sock(struct socket *sock, int gfp) +static struct sock *dn_alloc_sock(struct socket *sock, + unsigned int __nocast gfp) { struct dn_scp *scp; struct sock *sk = sk_alloc(PF_DECnet, gfp, &dn_proto, 1); @@ -804,7 +805,8 @@ return rv; } -static int dn_confirm_accept(struct sock *sk, long *timeo, int allocation) +static int dn_confirm_accept(struct sock *sk, long *timeo, + unsigned int __nocast allocation) { struct dn_scp *scp = DN_SK(sk); DEFINE_WAIT(wait); diff -urN -x .git RC13-current/net/decnet/dn_nsp_out.c linux-2.6/net/decnet/dn_nsp_out.c --- RC13-current/net/decnet/dn_nsp_out.c 2005-09-05 09:30:13.000000000 -0400 +++ linux-2.6/net/decnet/dn_nsp_out.c 2005-10-06 19:55:03.000000000 -0400 @@ -117,7 +117,8 @@ * The eventual aim is for each socket to have a cached header size * for its outgoing packets, and to set hdr from this when sk != NULL. */ -struct sk_buff *dn_alloc_skb(struct sock *sk, int size, int pri) +struct sk_buff *dn_alloc_skb(struct sock *sk, int size, + unsigned int __nocast pri) { struct sk_buff *skb; int hdr = 64; @@ -210,7 +211,8 @@ * * Returns: The number of times the packet has been sent previously */ -static inline unsigned dn_nsp_clone_and_send(struct sk_buff *skb, int gfp) +static inline unsigned dn_nsp_clone_and_send(struct sk_buff *skb, + unsigned int __nocast gfp) { struct dn_skb_cb *cb = DN_SKB_CB(skb); struct sk_buff *skb2; @@ -350,7 +352,8 @@ return ptr; } -void dn_nsp_queue_xmit(struct sock *sk, struct sk_buff *skb, int gfp, int oth) +void dn_nsp_queue_xmit(struct sock *sk, struct sk_buff *skb, + unsigned int __nocast gfp, int oth) { struct dn_scp *scp = DN_SK(sk); struct dn_skb_cb *cb = DN_SKB_CB(skb); @@ -517,7 +520,7 @@ return 0; } -void dn_send_conn_conf(struct sock *sk, int gfp) +void dn_send_conn_conf(struct sock *sk, unsigned int __nocast gfp) { struct dn_scp *scp = DN_SK(sk); struct sk_buff *skb = NULL; @@ -549,7 +552,8 @@ static __inline__ void dn_nsp_do_disc(struct sock *sk, unsigned char msgflg, - unsigned short reason, int gfp, struct dst_entry *dst, + unsigned short reason, unsigned int __nocast gfp, + struct dst_entry *dst, int ddl, unsigned char *dd, __u16 rem, __u16 loc) { struct sk_buff *skb = NULL; @@ -591,7 +595,7 @@ void dn_nsp_send_disc(struct sock *sk, unsigned char msgflg, - unsigned short reason, int gfp) + unsigned short reason, unsigned int __nocast gfp) { struct dn_scp *scp = DN_SK(sk); int ddl = 0; @@ -612,7 +616,7 @@ { struct dn_skb_cb *cb = DN_SKB_CB(skb); int ddl = 0; - int gfp = GFP_ATOMIC; + unsigned int __nocast gfp = GFP_ATOMIC; dn_nsp_do_disc(NULL, msgflg, reason, gfp, skb->dst, ddl, NULL, cb->src_port, cb->dst_port); @@ -624,7 +628,7 @@ struct dn_scp *scp = DN_SK(sk); struct sk_buff *skb; unsigned char *ptr; - int gfp = GFP_ATOMIC; + unsigned int __nocast gfp = GFP_ATOMIC; if ((skb = dn_alloc_skb(sk, DN_MAX_NSP_DATA_HEADER + 2, gfp)) == NULL) return; @@ -659,7 +663,8 @@ unsigned char menuver; struct dn_skb_cb *cb; unsigned char type = 1; - int allocation = (msgflg == NSP_CI) ? sk->sk_allocation : GFP_ATOMIC; + unsigned int __nocast allocation = + (msgflg == NSP_CI) ? sk->sk_allocation : GFP_ATOMIC; struct sk_buff *skb = dn_alloc_skb(sk, 200, allocation); if (!skb) diff -urN -x .git RC13-current/net/ipv4/ipvs/ip_vs_app.c linux-2.6/net/ipv4/ipvs/ip_vs_app.c --- RC13-current/net/ipv4/ipvs/ip_vs_app.c 2005-08-30 03:16:21.000000000 -0400 +++ linux-2.6/net/ipv4/ipvs/ip_vs_app.c 2005-10-06 19:55:03.000000000 -0400 @@ -604,7 +604,7 @@ /* * Replace a segment of data with a new segment */ -int ip_vs_skb_replace(struct sk_buff *skb, int pri, +int ip_vs_skb_replace(struct sk_buff *skb, unsigned int __nocast pri, char *o_buf, int o_len, char *n_buf, int n_len) { struct iphdr *iph; diff -urN -x .git RC13-current/net/ipv4/netfilter/Kconfig linux-2.6/net/ipv4/netfilter/Kconfig --- RC13-current/net/ipv4/netfilter/Kconfig 2005-09-25 23:44:51.000000000 -0400 +++ linux-2.6/net/ipv4/netfilter/Kconfig 2005-10-06 19:55:03.000000000 -0400 @@ -141,7 +141,7 @@ tristate 'PPTP protocol support' help This module adds support for PPTP (Point to Point Tunnelling - Protocol, RFC2637) conncection tracking and NAT. + Protocol, RFC2637) connection tracking and NAT. If you are running PPTP sessions over a stateful firewall or NAT box, you may want to enable this feature. diff -urN -x .git RC13-current/net/ipv4/tcp_bic.c linux-2.6/net/ipv4/tcp_bic.c --- RC13-current/net/ipv4/tcp_bic.c 2005-08-30 03:16:21.000000000 -0400 +++ linux-2.6/net/ipv4/tcp_bic.c 2005-10-06 19:55:03.000000000 -0400 @@ -136,7 +136,7 @@ else if (cwnd < ca->last_max_cwnd + max_increment*(BICTCP_B-1)) /* slow start */ ca->cnt = (cwnd * (BICTCP_B-1)) - / cwnd-ca->last_max_cwnd; + / (cwnd - ca->last_max_cwnd); else /* linear increase */ ca->cnt = cwnd / max_increment; diff -urN -x .git RC13-current/net/ipv6/mcast.c linux-2.6/net/ipv6/mcast.c --- RC13-current/net/ipv6/mcast.c 2005-09-19 00:08:11.000000000 -0400 +++ linux-2.6/net/ipv6/mcast.c 2005-10-06 19:55:03.000000000 -0400 @@ -1393,7 +1393,7 @@ static int grec_size(struct ifmcaddr6 *pmc, int type, int gdel, int sdel) { - return sizeof(struct mld2_grec) + 4*mld_scount(pmc,type,gdel,sdel); + return sizeof(struct mld2_grec) + 16 * mld_scount(pmc,type,gdel,sdel); } static struct sk_buff *add_grhead(struct sk_buff *skb, struct ifmcaddr6 *pmc, diff -urN -x .git RC13-current/net/ipv6/ndisc.c linux-2.6/net/ipv6/ndisc.c --- RC13-current/net/ipv6/ndisc.c 2005-09-09 00:04:02.000000000 -0400 +++ linux-2.6/net/ipv6/ndisc.c 2005-10-06 19:55:03.000000000 -0400 @@ -1450,7 +1450,7 @@ static void pndisc_redo(struct sk_buff *skb) { - ndisc_rcv(skb); + ndisc_recv_ns(skb); kfree_skb(skb); } diff -urN -x .git RC13-current/net/key/af_key.c linux-2.6/net/key/af_key.c --- RC13-current/net/key/af_key.c 2005-08-29 22:26:45.000000000 -0400 +++ linux-2.6/net/key/af_key.c 2005-10-06 19:55:03.000000000 -0400 @@ -185,7 +185,7 @@ } static int pfkey_broadcast_one(struct sk_buff *skb, struct sk_buff **skb2, - int allocation, struct sock *sk) + unsigned int __nocast allocation, struct sock *sk) { int err = -ENOBUFS; @@ -217,7 +217,7 @@ #define BROADCAST_ONE 1 #define BROADCAST_REGISTERED 2 #define BROADCAST_PROMISC_ONLY 4 -static int pfkey_broadcast(struct sk_buff *skb, int allocation, +static int pfkey_broadcast(struct sk_buff *skb, unsigned int __nocast allocation, int broadcast_flags, struct sock *one_sk) { struct sock *sk; @@ -1416,7 +1416,8 @@ return 0; } -static struct sk_buff *compose_sadb_supported(struct sadb_msg *orig, int allocation) +static struct sk_buff *compose_sadb_supported(struct sadb_msg *orig, + unsigned int __nocast allocation) { struct sk_buff *skb; struct sadb_msg *hdr; @@ -2153,6 +2154,7 @@ static int pfkey_spdget(struct sock *sk, struct sk_buff *skb, struct sadb_msg *hdr, void **ext_hdrs) { + unsigned int dir; int err; struct sadb_x_policy *pol; struct xfrm_policy *xp; @@ -2161,7 +2163,11 @@ if ((pol = ext_hdrs[SADB_X_EXT_POLICY-1]) == NULL) return -EINVAL; - xp = xfrm_policy_byid(0, pol->sadb_x_policy_id, + dir = xfrm_policy_id2dir(pol->sadb_x_policy_id); + if (dir >= XFRM_POLICY_MAX) + return -EINVAL; + + xp = xfrm_policy_byid(dir, pol->sadb_x_policy_id, hdr->sadb_msg_type == SADB_X_SPDDELETE2); if (xp == NULL) return -ENOENT; @@ -2173,9 +2179,9 @@ if (hdr->sadb_msg_type == SADB_X_SPDDELETE2) { c.data.byid = 1; c.event = XFRM_MSG_DELPOLICY; - km_policy_notify(xp, pol->sadb_x_policy_dir-1, &c); + km_policy_notify(xp, dir, &c); } else { - err = key_pol_get_resp(sk, xp, hdr, pol->sadb_x_policy_dir-1); + err = key_pol_get_resp(sk, xp, hdr, dir); } xfrm_pol_put(xp); diff -urN -x .git RC13-current/net/netfilter/nfnetlink.c linux-2.6/net/netfilter/nfnetlink.c --- RC13-current/net/netfilter/nfnetlink.c 2005-09-06 10:16:22.000000000 -0400 +++ linux-2.6/net/netfilter/nfnetlink.c 2005-10-06 19:55:03.000000000 -0400 @@ -195,7 +195,8 @@ int nfnetlink_send(struct sk_buff *skb, u32 pid, unsigned group, int echo) { - int allocation = in_interrupt() ? GFP_ATOMIC : GFP_KERNEL; + unsigned int __nocast allocation = + in_interrupt() ? GFP_ATOMIC : GFP_KERNEL; int err = 0; NETLINK_CB(skb).dst_group = group; diff -urN -x .git RC13-current/net/netrom/nr_dev.c linux-2.6/net/netrom/nr_dev.c --- RC13-current/net/netrom/nr_dev.c 2005-09-13 12:52:18.000000000 -0400 +++ linux-2.6/net/netrom/nr_dev.c 2005-10-06 19:55:03.000000000 -0400 @@ -58,7 +58,7 @@ /* Spoof incoming device */ skb->dev = dev; - skb->h.raw = skb->data; + skb->mac.raw = skb->nh.raw; skb->nh.raw = skb->data; skb->pkt_type = PACKET_HOST; diff -urN -x .git RC13-current/net/rxrpc/call.c linux-2.6/net/rxrpc/call.c --- RC13-current/net/rxrpc/call.c 2005-03-27 06:18:25.000000000 -0500 +++ linux-2.6/net/rxrpc/call.c 2005-10-06 19:55:03.000000000 -0400 @@ -1923,7 +1923,7 @@ size_t sioc, struct kvec *siov, u8 rxhdr_flags, - int alloc_flags, + unsigned int __nocast alloc_flags, int dup_data, size_t *size_sent) { diff -urN -x .git RC13-current/net/rxrpc/connection.c linux-2.6/net/rxrpc/connection.c --- RC13-current/net/rxrpc/connection.c 2005-03-27 06:18:25.000000000 -0500 +++ linux-2.6/net/rxrpc/connection.c 2005-10-06 19:55:03.000000000 -0400 @@ -522,7 +522,7 @@ uint8_t type, int dcount, struct kvec diov[], - int alloc_flags, + unsigned int __nocast alloc_flags, struct rxrpc_message **_msg) { struct rxrpc_message *msg; diff -urN -x .git RC13-current/net/sunrpc/sched.c linux-2.6/net/sunrpc/sched.c --- RC13-current/net/sunrpc/sched.c 2005-08-30 03:16:21.000000000 -0400 +++ linux-2.6/net/sunrpc/sched.c 2005-10-06 19:55:03.000000000 -0400 @@ -719,7 +719,7 @@ void * rpc_malloc(struct rpc_task *task, size_t size) { - int gfp; + unsigned int __nocast gfp; if (task->tk_flags & RPC_TASK_SWAPPER) gfp = GFP_ATOMIC; diff -urN -x .git RC13-current/net/xfrm/xfrm_policy.c linux-2.6/net/xfrm/xfrm_policy.c --- RC13-current/net/xfrm/xfrm_policy.c 2005-09-09 00:04:02.000000000 -0400 +++ linux-2.6/net/xfrm/xfrm_policy.c 2005-10-06 19:55:03.000000000 -0400 @@ -163,7 +163,7 @@ if (xp->dead) goto out; - dir = xp->index & 7; + dir = xfrm_policy_id2dir(xp->index); if (xp->lft.hard_add_expires_seconds) { long tmo = xp->lft.hard_add_expires_seconds + @@ -225,7 +225,7 @@ * SPD calls. */ -struct xfrm_policy *xfrm_policy_alloc(int gfp) +struct xfrm_policy *xfrm_policy_alloc(unsigned int __nocast gfp) { struct xfrm_policy *policy; @@ -417,7 +417,7 @@ struct xfrm_policy *pol, **p; write_lock_bh(&xfrm_policy_lock); - for (p = &xfrm_policy_list[id & 7]; (pol=*p)!=NULL; p = &pol->next) { + for (p = &xfrm_policy_list[dir]; (pol=*p)!=NULL; p = &pol->next) { if (pol->index == id) { xfrm_pol_hold(pol); if (delete)