--- zzzz-none-000/linux-2.4.17/include/asm-mips/processor.h 2001-10-05 19:11:05.000000000 +0000 +++ sangam-fb-401/linux-2.4.17/include/asm-mips/processor.h 2005-11-23 14:38:38.000000000 +0000 @@ -12,7 +12,7 @@ #define _ASM_PROCESSOR_H #include - +#include #include /* @@ -28,31 +28,31 @@ #include #include -struct mips_cpuinfo { +struct cpuinfo_mips { unsigned long udelay_val; unsigned long *pgd_quick; unsigned long *pte_quick; unsigned long pgtable_cache_sz; -}; + unsigned long asid_cache; +} __attribute__((__aligned__(SMP_CACHE_BYTES))); /* * System setup and hardware flags.. - * XXX: Should go into mips_cpuinfo. */ -extern void (*cpu_wait)(void); /* only available on R4[26]00 and R3081 */ +extern void (*cpu_wait)(void); extern void r3081_wait(void); +extern void r39xx_wait(void); extern void r4k_wait(void); -extern char cyclecounter_available; /* only available from R4000 upwards. */ +extern void r4k_wait_idle(void); +extern void sr7100_wait(void); -extern struct mips_cpuinfo boot_cpu_data; +extern struct cpuinfo_mips cpu_data[]; extern unsigned int vced_count, vcei_count; #ifdef CONFIG_SMP -extern struct mips_cpuinfo cpu_data[]; #define current_cpu_data cpu_data[smp_processor_id()] #else -#define cpu_data &boot_cpu_data -#define current_cpu_data boot_cpu_data +#define current_cpu_data cpu_data[0] #endif /* @@ -151,21 +151,6 @@ mm_segment_t current_ds; unsigned long irix_trampoline; /* Wheee... */ unsigned long irix_oldctx; - - /* - * These are really only needed if the full FPU emulator is configured. - * Would be made conditional on MIPS_FPU_EMULATOR if it weren't for the - * fact that having offset.h rebuilt differently for different config - * options would be asking for trouble. - * - * Saved EPC during delay-slot emulation (see math-emu/cp1emu.c) - */ - unsigned long dsemul_epc; - - /* - * Pointer to instruction used to induce address error - */ - unsigned long dsemul_aerpc; }; #endif /* !defined (_LANGUAGE_ASSEMBLY) */ @@ -191,17 +176,41 @@ /* \ * For now the default is to fix address errors \ */ \ - MF_FIXADE, { 0 }, 0, 0, \ - /* \ - * dsemul_epc and dsemul_aerpc should never be used uninitialized, \ - * but... \ - */ \ - 0 ,0 \ + MF_FIXADE, { 0 }, 0, 0 \ } #ifdef __KERNEL__ +/*--- #define KSTK_SHIFT 2 ---*/ + +/* + * Changes made for stacksize change: + * + * - init_task_struct must be align to KERNEL_STACK_SIZE + * this is done at end of arch/mips/kernel/head.S + * with ".align XX" + * - sizeof (union task_union) (include/linux/sched.h) + * must be KERNEL_STACK_SIZE, we define INIT_TASK_SIZE here + * - In include/asm-mips/stackframe.h macro SAVE_SOME the + * value of "gp" (reg28) is calculate by masking "sp" value + * We use KSTK_MASK for this. + * + * 2005-09-13, calle@avm.de + */ + +#if CONFIG_KERNEL_STACK_SIZE_SHIFT == 1 #define KERNEL_STACK_SIZE 8192 +#endif +#if CONFIG_KERNEL_STACK_SIZE_SHIFT == 2 +#define KERNEL_STACK_SIZE 16384 +#endif +#if CONFIG_KERNEL_STACK_SIZE_SHIFT == 3 +#define KERNEL_STACK_SIZE 32768 +#endif + +#define KSTK_MASK (KERNEL_STACK_SIZE-1) + +#define INIT_TASK_SIZE KERNEL_STACK_SIZE #if !defined (_LANGUAGE_ASSEMBLY) @@ -217,7 +226,7 @@ /* * Return saved PC of a blocked thread. */ -extern inline unsigned long thread_saved_pc(struct thread_struct *t) +static inline unsigned long thread_saved_pc(struct thread_struct *t) { extern void ret_from_fork(void); @@ -232,8 +241,8 @@ * Do necessary setup to start up a newly executed thread. */ #define start_thread(regs, new_pc, new_sp) do { \ - /* New thread looses kernel privileges. */ \ - regs->cp0_status = (regs->cp0_status & ~(ST0_CU0|ST0_KSU)) | KU_USER;\ + /* New thread loses kernel and FPU privileges. */ \ + regs->cp0_status = (regs->cp0_status & ~(ST0_CU0|ST0_KSU|ST0_CU1)) | KU_USER;\ regs->cp0_epc = new_pc; \ regs->regs[29] = new_sp; \ current->thread.current_ds = USER_DS; \ @@ -250,10 +259,10 @@ /* * NOTE! The task struct and the stack go together */ -#define THREAD_SIZE (2*PAGE_SIZE) +#define THREAD_SIZE (KERNEL_STACK_SIZE) #define alloc_task_struct() \ - ((struct task_struct *) __get_free_pages(GFP_KERNEL,1)) -#define free_task_struct(p) free_pages((unsigned long)(p),1) + ((struct task_struct *) __get_free_pages(GFP_KERNEL,CONFIG_KERNEL_STACK_SIZE_SHIFT)) +#define free_task_struct(p) free_pages((unsigned long)(p),CONFIG_KERNEL_STACK_SIZE_SHIFT) #define get_task_struct(tsk) atomic_inc(&virt_to_page(tsk)->count) #define init_task (init_task_union.task)