···1515#include <asm/io.h> /* need byte IO */1616#include <linux/spinlock.h> /* And spinlocks */1717#include <linux/delay.h>1818-#include <asm/system.h>191820192120#ifdef HAVE_REALLY_SLOW_DMA_CONTROLLER
+17
arch/mips/include/asm/exec.h
···11+/*22+ * This file is subject to the terms and conditions of the GNU General Public33+ * License. See the file "COPYING" in the main directory of this archive44+ * for more details.55+ *66+ * Copyright (C) 1994, 95, 96, 97, 98, 99, 2003, 06 by Ralf Baechle77+ * Copyright (C) 1996 by Paul M. Antoine88+ * Copyright (C) 1999 Silicon Graphics99+ * Kevin D. Kissell, kevink@mips.org and Carsten Langgaard, carstenl@mips.com1010+ * Copyright (C) 2000 MIPS Technologies, Inc.1111+ */1212+#ifndef _ASM_EXEC_H1313+#define _ASM_EXEC_H1414+1515+extern unsigned long arch_align_stack(unsigned long sp);1616+1717+#endif /* _ASM_EXEC_H */
-1
arch/mips/include/asm/mach-au1x00/au1000_dma.h
···3333#include <linux/io.h> /* need byte IO */3434#include <linux/spinlock.h> /* And spinlocks */3535#include <linux/delay.h>3636-#include <asm/system.h>37363837#define NUM_AU1000_DMA_CHANNELS 83938
+6-1
arch/mips/include/asm/processor.h
···1919#include <asm/cpu-info.h>2020#include <asm/mipsregs.h>2121#include <asm/prefetch.h>2222-#include <asm/system.h>23222423/*2524 * Return current * instruction pointer ("program counter").···354355355356#define ARCH_HAS_PREFETCHW356357#define prefetchw(x) __builtin_prefetch((x), 1, 1)358358+359359+/*360360+ * See Documentation/scheduler/sched-arch.txt; prevents deadlock on SMP361361+ * systems.362362+ */363363+#define __ARCH_WANT_UNLOCKED_CTXSW357364358365#endif359366
+11
arch/mips/include/asm/setup.h
···5566#ifdef __KERNEL__77extern void setup_early_printk(void);88+99+extern void set_handler(unsigned long offset, void *addr, unsigned long len);1010+extern void set_uncached_handler(unsigned long offset, void *addr, unsigned long len);1111+1212+typedef void (*vi_handler_t)(void);1313+extern void *set_vi_handler(int n, vi_handler_t addr);1414+1515+extern void *set_except_vector(int n, void *addr);1616+extern unsigned long ebase;1717+extern void per_cpu_trap_init(void);1818+819#endif /* __KERNEL__ */9201021#endif /* __SETUP_H */
+85
arch/mips/include/asm/switch_to.h
···11+/*22+ * This file is subject to the terms and conditions of the GNU General Public33+ * License. See the file "COPYING" in the main directory of this archive44+ * for more details.55+ *66+ * Copyright (C) 1994, 95, 96, 97, 98, 99, 2003, 06 by Ralf Baechle77+ * Copyright (C) 1996 by Paul M. Antoine88+ * Copyright (C) 1999 Silicon Graphics99+ * Kevin D. Kissell, kevink@mips.org and Carsten Langgaard, carstenl@mips.com1010+ * Copyright (C) 2000 MIPS Technologies, Inc.1111+ */1212+#ifndef _ASM_SWITCH_TO_H1313+#define _ASM_SWITCH_TO_H1414+1515+#include <asm/cpu-features.h>1616+#include <asm/watch.h>1717+#include <asm/dsp.h>1818+1919+struct task_struct;2020+2121+/*2222+ * switch_to(n) should switch tasks to task nr n, first2323+ * checking that n isn't the current task, in which case it does nothing.2424+ */2525+extern asmlinkage void *resume(void *last, void *next, void *next_ti);2626+2727+extern unsigned int ll_bit;2828+extern struct task_struct *ll_task;2929+3030+#ifdef CONFIG_MIPS_MT_FPAFF3131+3232+/*3333+ * Handle the scheduler resume end of FPU affinity management. We do this3434+ * inline to try to keep the overhead down. If we have been forced to run on3535+ * a "CPU" with an FPU because of a previous high level of FP computation,3636+ * but did not actually use the FPU during the most recent time-slice (CU13737+ * isn't set), we undo the restriction on cpus_allowed.3838+ *3939+ * We're not calling set_cpus_allowed() here, because we have no need to4040+ * force prompt migration - we're already switching the current CPU to a4141+ * different thread.4242+ */4343+4444+#define __mips_mt_fpaff_switch_to(prev) \4545+do { \4646+ struct thread_info *__prev_ti = task_thread_info(prev); \4747+ \4848+ if (cpu_has_fpu && \4949+ test_ti_thread_flag(__prev_ti, TIF_FPUBOUND) && \5050+ (!(KSTK_STATUS(prev) & ST0_CU1))) { \5151+ clear_ti_thread_flag(__prev_ti, TIF_FPUBOUND); \5252+ prev->cpus_allowed = prev->thread.user_cpus_allowed; \5353+ } \5454+ next->thread.emulated_fp = 0; \5555+} while(0)5656+5757+#else5858+#define __mips_mt_fpaff_switch_to(prev) do { (void) (prev); } while (0)5959+#endif6060+6161+#define __clear_software_ll_bit() \6262+do { \6363+ if (!__builtin_constant_p(cpu_has_llsc) || !cpu_has_llsc) \6464+ ll_bit = 0; \6565+} while (0)6666+6767+#define switch_to(prev, next, last) \6868+do { \6969+ __mips_mt_fpaff_switch_to(prev); \7070+ if (cpu_has_dsp) \7171+ __save_dsp(prev); \7272+ __clear_software_ll_bit(); \7373+ (last) = resume(prev, next, task_thread_info(next)); \7474+} while (0)7575+7676+#define finish_arch_switch(prev) \7777+do { \7878+ if (cpu_has_dsp) \7979+ __restore_dsp(current); \8080+ if (cpu_has_userlocal) \8181+ write_c0_userlocal(current_thread_info()->tp_value); \8282+ __restore_watch(); \8383+} while (0)8484+8585+#endif /* _ASM_SWITCH_TO_H */
+3-233
arch/mips/include/asm/system.h
···11-/*22- * This file is subject to the terms and conditions of the GNU General Public33- * License. See the file "COPYING" in the main directory of this archive44- * for more details.55- *66- * Copyright (C) 1994, 95, 96, 97, 98, 99, 2003, 06 by Ralf Baechle77- * Copyright (C) 1996 by Paul M. Antoine88- * Copyright (C) 1999 Silicon Graphics99- * Kevin D. Kissell, kevink@mips.org and Carsten Langgaard, carstenl@mips.com1010- * Copyright (C) 2000 MIPS Technologies, Inc.1111- */1212-#ifndef _ASM_SYSTEM_H1313-#define _ASM_SYSTEM_H1414-1515-#include <linux/kernel.h>1616-#include <linux/types.h>1717-#include <linux/irqflags.h>1818-1919-#include <asm/addrspace.h>11+/* FILE TO BE DELETED. DO NOT ADD STUFF HERE! */202#include <asm/barrier.h>213#include <asm/cmpxchg.h>2222-#include <asm/cpu-features.h>2323-#include <asm/dsp.h>2424-#include <asm/watch.h>2525-#include <asm/war.h>2626-2727-2828-/*2929- * switch_to(n) should switch tasks to task nr n, first3030- * checking that n isn't the current task, in which case it does nothing.3131- */3232-extern asmlinkage void *resume(void *last, void *next, void *next_ti);3333-3434-struct task_struct;3535-3636-extern unsigned int ll_bit;3737-extern struct task_struct *ll_task;3838-3939-#ifdef CONFIG_MIPS_MT_FPAFF4040-4141-/*4242- * Handle the scheduler resume end of FPU affinity management. We do this4343- * inline to try to keep the overhead down. If we have been forced to run on4444- * a "CPU" with an FPU because of a previous high level of FP computation,4545- * but did not actually use the FPU during the most recent time-slice (CU14646- * isn't set), we undo the restriction on cpus_allowed.4747- *4848- * We're not calling set_cpus_allowed() here, because we have no need to4949- * force prompt migration - we're already switching the current CPU to a5050- * different thread.5151- */5252-5353-#define __mips_mt_fpaff_switch_to(prev) \5454-do { \5555- struct thread_info *__prev_ti = task_thread_info(prev); \5656- \5757- if (cpu_has_fpu && \5858- test_ti_thread_flag(__prev_ti, TIF_FPUBOUND) && \5959- (!(KSTK_STATUS(prev) & ST0_CU1))) { \6060- clear_ti_thread_flag(__prev_ti, TIF_FPUBOUND); \6161- prev->cpus_allowed = prev->thread.user_cpus_allowed; \6262- } \6363- next->thread.emulated_fp = 0; \6464-} while(0)6565-6666-#else6767-#define __mips_mt_fpaff_switch_to(prev) do { (void) (prev); } while (0)6868-#endif6969-7070-#define __clear_software_ll_bit() \7171-do { \7272- if (!__builtin_constant_p(cpu_has_llsc) || !cpu_has_llsc) \7373- ll_bit = 0; \7474-} while (0)7575-7676-#define switch_to(prev, next, last) \7777-do { \7878- __mips_mt_fpaff_switch_to(prev); \7979- if (cpu_has_dsp) \8080- __save_dsp(prev); \8181- __clear_software_ll_bit(); \8282- (last) = resume(prev, next, task_thread_info(next)); \8383-} while (0)8484-8585-#define finish_arch_switch(prev) \8686-do { \8787- if (cpu_has_dsp) \8888- __restore_dsp(current); \8989- if (cpu_has_userlocal) \9090- write_c0_userlocal(current_thread_info()->tp_value); \9191- __restore_watch(); \9292-} while (0)9393-9494-static inline unsigned long __xchg_u32(volatile int * m, unsigned int val)9595-{9696- __u32 retval;9797-9898- smp_mb__before_llsc();9999-100100- if (kernel_uses_llsc && R10000_LLSC_WAR) {101101- unsigned long dummy;102102-103103- __asm__ __volatile__(104104- " .set mips3 \n"105105- "1: ll %0, %3 # xchg_u32 \n"106106- " .set mips0 \n"107107- " move %2, %z4 \n"108108- " .set mips3 \n"109109- " sc %2, %1 \n"110110- " beqzl %2, 1b \n"111111- " .set mips0 \n"112112- : "=&r" (retval), "=m" (*m), "=&r" (dummy)113113- : "R" (*m), "Jr" (val)114114- : "memory");115115- } else if (kernel_uses_llsc) {116116- unsigned long dummy;117117-118118- do {119119- __asm__ __volatile__(120120- " .set mips3 \n"121121- " ll %0, %3 # xchg_u32 \n"122122- " .set mips0 \n"123123- " move %2, %z4 \n"124124- " .set mips3 \n"125125- " sc %2, %1 \n"126126- " .set mips0 \n"127127- : "=&r" (retval), "=m" (*m), "=&r" (dummy)128128- : "R" (*m), "Jr" (val)129129- : "memory");130130- } while (unlikely(!dummy));131131- } else {132132- unsigned long flags;133133-134134- raw_local_irq_save(flags);135135- retval = *m;136136- *m = val;137137- raw_local_irq_restore(flags); /* implies memory barrier */138138- }139139-140140- smp_llsc_mb();141141-142142- return retval;143143-}144144-145145-#ifdef CONFIG_64BIT146146-static inline __u64 __xchg_u64(volatile __u64 * m, __u64 val)147147-{148148- __u64 retval;149149-150150- smp_mb__before_llsc();151151-152152- if (kernel_uses_llsc && R10000_LLSC_WAR) {153153- unsigned long dummy;154154-155155- __asm__ __volatile__(156156- " .set mips3 \n"157157- "1: lld %0, %3 # xchg_u64 \n"158158- " move %2, %z4 \n"159159- " scd %2, %1 \n"160160- " beqzl %2, 1b \n"161161- " .set mips0 \n"162162- : "=&r" (retval), "=m" (*m), "=&r" (dummy)163163- : "R" (*m), "Jr" (val)164164- : "memory");165165- } else if (kernel_uses_llsc) {166166- unsigned long dummy;167167-168168- do {169169- __asm__ __volatile__(170170- " .set mips3 \n"171171- " lld %0, %3 # xchg_u64 \n"172172- " move %2, %z4 \n"173173- " scd %2, %1 \n"174174- " .set mips0 \n"175175- : "=&r" (retval), "=m" (*m), "=&r" (dummy)176176- : "R" (*m), "Jr" (val)177177- : "memory");178178- } while (unlikely(!dummy));179179- } else {180180- unsigned long flags;181181-182182- raw_local_irq_save(flags);183183- retval = *m;184184- *m = val;185185- raw_local_irq_restore(flags); /* implies memory barrier */186186- }187187-188188- smp_llsc_mb();189189-190190- return retval;191191-}192192-#else193193-extern __u64 __xchg_u64_unsupported_on_32bit_kernels(volatile __u64 * m, __u64 val);194194-#define __xchg_u64 __xchg_u64_unsupported_on_32bit_kernels195195-#endif196196-197197-static inline unsigned long __xchg(unsigned long x, volatile void * ptr, int size)198198-{199199- switch (size) {200200- case 4:201201- return __xchg_u32(ptr, x);202202- case 8:203203- return __xchg_u64(ptr, x);204204- }205205-206206- return x;207207-}208208-209209-#define xchg(ptr, x) \210210-({ \211211- BUILD_BUG_ON(sizeof(*(ptr)) & ~0xc); \212212- \213213- ((__typeof__(*(ptr))) \214214- __xchg((unsigned long)(x), (ptr), sizeof(*(ptr)))); \215215-})216216-217217-extern void set_handler(unsigned long offset, void *addr, unsigned long len);218218-extern void set_uncached_handler(unsigned long offset, void *addr, unsigned long len);219219-220220-typedef void (*vi_handler_t)(void);221221-extern void *set_vi_handler(int n, vi_handler_t addr);222222-223223-extern void *set_except_vector(int n, void *addr);224224-extern unsigned long ebase;225225-extern void per_cpu_trap_init(void);226226-227227-/*228228- * See include/asm-ia64/system.h; prevents deadlock on SMP229229- * systems.230230- */231231-#define __ARCH_WANT_UNLOCKED_CTXSW232232-233233-extern unsigned long arch_align_stack(unsigned long sp);234234-235235-#endif /* _ASM_SYSTEM_H */44+#include <asm/exec.h>55+#include <asm/switch_to.h>
···3737#include <asm/shmparam.h>3838#include <asm/sysmips.h>3939#include <asm/uaccess.h>4040+#include <asm/switch_to.h>40414142/*4243 * For historic reasons the pipe(2) syscall on MIPS has an unusual calling