diff options
Diffstat (limited to 'include')
26 files changed, 121 insertions, 176 deletions
diff --git a/include/asm-mips/i8253.h b/include/asm-mips/i8253.h index affb32ce4af9..032ca73f181b 100644 --- a/include/asm-mips/i8253.h +++ b/include/asm-mips/i8253.h | |||
@@ -5,25 +5,14 @@ | |||
5 | #ifndef __ASM_I8253_H | 5 | #ifndef __ASM_I8253_H |
6 | #define __ASM_I8253_H | 6 | #define __ASM_I8253_H |
7 | 7 | ||
8 | #include <linux/spinlock.h> | ||
9 | |||
8 | /* i8253A PIT registers */ | 10 | /* i8253A PIT registers */ |
9 | #define PIT_MODE 0x43 | 11 | #define PIT_MODE 0x43 |
10 | #define PIT_CH0 0x40 | 12 | #define PIT_CH0 0x40 |
11 | #define PIT_CH2 0x42 | 13 | #define PIT_CH2 0x42 |
12 | 14 | ||
13 | /* i8259A PIC registers */ | 15 | extern spinlock_t i8253_lock; |
14 | #define PIC_MASTER_CMD 0x20 | ||
15 | #define PIC_MASTER_IMR 0x21 | ||
16 | #define PIC_MASTER_ISR PIC_MASTER_CMD | ||
17 | #define PIC_MASTER_POLL PIC_MASTER_ISR | ||
18 | #define PIC_MASTER_OCW3 PIC_MASTER_ISR | ||
19 | #define PIC_SLAVE_CMD 0xa0 | ||
20 | #define PIC_SLAVE_IMR 0xa1 | ||
21 | |||
22 | /* i8259A PIC related value */ | ||
23 | #define PIC_CASCADE_IR 2 | ||
24 | #define MASTER_ICW4_DEFAULT 0x01 | ||
25 | #define SLAVE_ICW4_DEFAULT 0x01 | ||
26 | #define PIC_ICW4_AEOI 2 | ||
27 | 16 | ||
28 | extern void setup_pit_timer(void); | 17 | extern void setup_pit_timer(void); |
29 | 18 | ||
diff --git a/include/asm-mips/mach-au1x00/timex.h b/include/asm-mips/mach-au1x00/timex.h deleted file mode 100644 index e3ada66cb636..000000000000 --- a/include/asm-mips/mach-au1x00/timex.h +++ /dev/null | |||
@@ -1,13 +0,0 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * Copyright (C) 2003 by Ralf Baechle | ||
7 | */ | ||
8 | #ifndef __ASM_MACH_AU1X00_TIMEX_H | ||
9 | #define __ASM_MACH_AU1X00_TIMEX_H | ||
10 | |||
11 | #define CLOCK_TICK_RATE ((HZ * 100000UL) / 2) | ||
12 | |||
13 | #endif /* __ASM_MACH_AU1X00_TIMEX_H */ | ||
diff --git a/include/asm-mips/mach-cobalt/irq.h b/include/asm-mips/mach-cobalt/irq.h index 179d0e850b59..57c8c9ac5851 100644 --- a/include/asm-mips/mach-cobalt/irq.h +++ b/include/asm-mips/mach-cobalt/irq.h | |||
@@ -35,7 +35,7 @@ | |||
35 | * 4 - ethernet | 35 | * 4 - ethernet |
36 | * 5 - 16550 UART | 36 | * 5 - 16550 UART |
37 | * 6 - cascade i8259 | 37 | * 6 - cascade i8259 |
38 | * 7 - CP0 counter (unused) | 38 | * 7 - CP0 counter |
39 | */ | 39 | */ |
40 | #define MIPS_CPU_IRQ_BASE 16 | 40 | #define MIPS_CPU_IRQ_BASE 16 |
41 | 41 | ||
@@ -48,7 +48,6 @@ | |||
48 | #define SCSI_IRQ (MIPS_CPU_IRQ_BASE + 5) | 48 | #define SCSI_IRQ (MIPS_CPU_IRQ_BASE + 5) |
49 | #define I8259_CASCADE_IRQ (MIPS_CPU_IRQ_BASE + 6) | 49 | #define I8259_CASCADE_IRQ (MIPS_CPU_IRQ_BASE + 6) |
50 | 50 | ||
51 | |||
52 | #define GT641XX_IRQ_BASE 24 | 51 | #define GT641XX_IRQ_BASE 24 |
53 | 52 | ||
54 | #include <asm/irq_gt641xx.h> | 53 | #include <asm/irq_gt641xx.h> |
diff --git a/include/asm-mips/mach-generic/timex.h b/include/asm-mips/mach-generic/timex.h deleted file mode 100644 index 48b4cfaa0d50..000000000000 --- a/include/asm-mips/mach-generic/timex.h +++ /dev/null | |||
@@ -1,13 +0,0 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * Copyright (C) 2003, 2005 by Ralf Baechle | ||
7 | */ | ||
8 | #ifndef __ASM_MACH_GENERIC_TIMEX_H | ||
9 | #define __ASM_MACH_GENERIC_TIMEX_H | ||
10 | |||
11 | #define CLOCK_TICK_RATE 500000 | ||
12 | |||
13 | #endif /* __ASM_MACH_GENERIC_TIMEX_H */ | ||
diff --git a/include/asm-mips/mach-jazz/timex.h b/include/asm-mips/mach-jazz/timex.h deleted file mode 100644 index 93affa33dfa8..000000000000 --- a/include/asm-mips/mach-jazz/timex.h +++ /dev/null | |||
@@ -1,16 +0,0 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * Copyright (C) 2003 by Ralf Baechle | ||
7 | */ | ||
8 | #ifndef __ASM_MACH_JAZZ_TIMEX_H | ||
9 | #define __ASM_MACH_JAZZ_TIMEX_H | ||
10 | |||
11 | /* | ||
12 | * Jazz is still using the R4030 100Hz counter | ||
13 | */ | ||
14 | #define CLOCK_TICK_RATE 100 | ||
15 | |||
16 | #endif /* __ASM_MACH_JAZZ_TIMEX_H */ | ||
diff --git a/include/asm-mips/mach-qemu/timex.h b/include/asm-mips/mach-qemu/timex.h deleted file mode 100644 index cd543693fb0a..000000000000 --- a/include/asm-mips/mach-qemu/timex.h +++ /dev/null | |||
@@ -1,16 +0,0 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * Copyright (C) 2005 Daniel Jacobowitz | ||
7 | */ | ||
8 | #ifndef __ASM_MACH_QEMU_TIMEX_H | ||
9 | #define __ASM_MACH_QEMU_TIMEX_H | ||
10 | |||
11 | /* | ||
12 | * We use a simulated i8254 PIC... | ||
13 | */ | ||
14 | #define CLOCK_TICK_RATE 1193182 | ||
15 | |||
16 | #endif /* __ASM_MACH_QEMU_TIMEX_H */ | ||
diff --git a/include/asm-mips/mach-rm/timex.h b/include/asm-mips/mach-rm/timex.h deleted file mode 100644 index 11ff6cb0f214..000000000000 --- a/include/asm-mips/mach-rm/timex.h +++ /dev/null | |||
@@ -1,13 +0,0 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * Copyright (C) 2003, 2005 by Ralf Baechle | ||
7 | */ | ||
8 | #ifndef __ASM_MACH_RM200_TIMEX_H | ||
9 | #define __ASM_MACH_RM200_TIMEX_H | ||
10 | |||
11 | #define CLOCK_TICK_RATE 1193182 | ||
12 | |||
13 | #endif /* __ASM_MACH_RM200_TIMEX_H */ | ||
diff --git a/include/asm-mips/time.h b/include/asm-mips/time.h index 0a6bc7dc158e..ee1663e64da1 100644 --- a/include/asm-mips/time.h +++ b/include/asm-mips/time.h | |||
@@ -10,15 +10,10 @@ | |||
10 | * under the terms of the GNU General Public License as published by the | 10 | * under the terms of the GNU General Public License as published by the |
11 | * Free Software Foundation; either version 2 of the License, or (at your | 11 | * Free Software Foundation; either version 2 of the License, or (at your |
12 | * option) any later version. | 12 | * option) any later version. |
13 | * | ||
14 | * Please refer to Documentation/mips/time.README. | ||
15 | */ | 13 | */ |
16 | #ifndef _ASM_TIME_H | 14 | #ifndef _ASM_TIME_H |
17 | #define _ASM_TIME_H | 15 | #define _ASM_TIME_H |
18 | 16 | ||
19 | #include <linux/interrupt.h> | ||
20 | #include <linux/linkage.h> | ||
21 | #include <linux/ptrace.h> | ||
22 | #include <linux/rtc.h> | 17 | #include <linux/rtc.h> |
23 | #include <linux/spinlock.h> | 18 | #include <linux/spinlock.h> |
24 | #include <linux/clockchips.h> | 19 | #include <linux/clockchips.h> |
@@ -38,25 +33,12 @@ extern int rtc_mips_set_mmss(unsigned long); | |||
38 | /* | 33 | /* |
39 | * Timer interrupt functions. | 34 | * Timer interrupt functions. |
40 | * mips_timer_state is needed for high precision timer calibration. | 35 | * mips_timer_state is needed for high precision timer calibration. |
41 | * mips_timer_ack may be NULL if the interrupt is self-recoverable. | ||
42 | */ | 36 | */ |
43 | extern int (*mips_timer_state)(void); | 37 | extern int (*mips_timer_state)(void); |
44 | 38 | ||
45 | /* | 39 | /* |
46 | * High precision timer clocksource. | ||
47 | * If .read is NULL, an R4k-compatible timer setup is attempted. | ||
48 | */ | ||
49 | extern struct clocksource clocksource_mips; | ||
50 | |||
51 | /* | ||
52 | * profiling and process accouting is done separately in local_timer_interrupt | ||
53 | */ | ||
54 | extern void local_timer_interrupt(int irq, void *dev_id); | ||
55 | |||
56 | /* | ||
57 | * board specific routines required by time_init(). | 40 | * board specific routines required by time_init(). |
58 | */ | 41 | */ |
59 | struct irqaction; | ||
60 | extern void plat_time_init(void); | 42 | extern void plat_time_init(void); |
61 | 43 | ||
62 | /* | 44 | /* |
diff --git a/include/asm-mips/timex.h b/include/asm-mips/timex.h index 87c68ae76ff8..5816ad1569d6 100644 --- a/include/asm-mips/timex.h +++ b/include/asm-mips/timex.h | |||
@@ -13,27 +13,12 @@ | |||
13 | #include <asm/mipsregs.h> | 13 | #include <asm/mipsregs.h> |
14 | 14 | ||
15 | /* | 15 | /* |
16 | * This is the frequency of the timer used for Linux's timer interrupt. | 16 | * This is the clock rate of the i8253 PIT. A MIPS system may not have |
17 | * The value should be defined as accurate as possible or under certain | 17 | * a PIT by the symbol is used all over the kernel including some APIs. |
18 | * circumstances Linux timekeeping might become inaccurate or fail. | 18 | * So keeping it defined to the number for the PIT is the only sane thing |
19 | * | 19 | * for now. |
20 | * For many system the exact clockrate of the timer isn't known but due to | ||
21 | * the way this value is used we can get away with a wrong value as long | ||
22 | * as this value is: | ||
23 | * | ||
24 | * - a multiple of HZ | ||
25 | * - a divisor of the actual rate | ||
26 | * | ||
27 | * 500000 is a good such cheat value. | ||
28 | * | ||
29 | * The obscure number 1193182 is the same as used by the original i8254 | ||
30 | * time in legacy PC hardware; the chip unfortunately also found in a | ||
31 | * bunch of MIPS systems. The last remaining user of the i8254 for the | ||
32 | * timer interrupt is the RM200; it's a very standard system so there is | ||
33 | * no reason to make this a separate architecture. | ||
34 | */ | 20 | */ |
35 | 21 | #define CLOCK_TICK_RATE 1193182 | |
36 | #include <timex.h> | ||
37 | 22 | ||
38 | /* | 23 | /* |
39 | * Standard way to access the cycle counter. | 24 | * Standard way to access the cycle counter. |
diff --git a/include/asm-sh/cache.h b/include/asm-sh/cache.h index 7a18649d1ccb..01e5cf51ba9b 100644 --- a/include/asm-sh/cache.h +++ b/include/asm-sh/cache.h | |||
@@ -18,9 +18,8 @@ | |||
18 | #define SH_CACHE_ASSOC 8 | 18 | #define SH_CACHE_ASSOC 8 |
19 | 19 | ||
20 | #define L1_CACHE_BYTES (1 << L1_CACHE_SHIFT) | 20 | #define L1_CACHE_BYTES (1 << L1_CACHE_SHIFT) |
21 | #define SMP_CACHE_BYTES L1_CACHE_BYTES | ||
22 | 21 | ||
23 | #define L1_CACHE_ALIGN(x) (((x)+(L1_CACHE_BYTES-1))&~(L1_CACHE_BYTES-1)) | 22 | #define __read_mostly __attribute__((__section__(".data.read_mostly"))) |
24 | 23 | ||
25 | #ifndef __ASSEMBLY__ | 24 | #ifndef __ASSEMBLY__ |
26 | struct cache_info { | 25 | struct cache_info { |
diff --git a/include/asm-sh/irq.h b/include/asm-sh/irq.h index c61d902b8bff..11850f65c922 100644 --- a/include/asm-sh/irq.h +++ b/include/asm-sh/irq.h | |||
@@ -41,7 +41,7 @@ static inline int generic_irq_demux(int irq) | |||
41 | #define irq_canonicalize(irq) (irq) | 41 | #define irq_canonicalize(irq) (irq) |
42 | #define irq_demux(irq) sh_mv.mv_irq_demux(irq) | 42 | #define irq_demux(irq) sh_mv.mv_irq_demux(irq) |
43 | 43 | ||
44 | #ifdef CONFIG_4KSTACKS | 44 | #ifdef CONFIG_IRQSTACKS |
45 | extern void irq_ctx_init(int cpu); | 45 | extern void irq_ctx_init(int cpu); |
46 | extern void irq_ctx_exit(int cpu); | 46 | extern void irq_ctx_exit(int cpu); |
47 | # define __ARCH_HAS_DO_SOFTIRQ | 47 | # define __ARCH_HAS_DO_SOFTIRQ |
diff --git a/include/asm-sh/page.h b/include/asm-sh/page.h index cb3d46c59eab..3aa8b07da47d 100644 --- a/include/asm-sh/page.h +++ b/include/asm-sh/page.h | |||
@@ -128,7 +128,6 @@ typedef struct { unsigned long pgd; } pgd_t; | |||
128 | #define __va(x) ((void *)((unsigned long)(x)+PAGE_OFFSET)) | 128 | #define __va(x) ((void *)((unsigned long)(x)+PAGE_OFFSET)) |
129 | #define pfn_to_kaddr(pfn) __va((pfn) << PAGE_SHIFT) | 129 | #define pfn_to_kaddr(pfn) __va((pfn) << PAGE_SHIFT) |
130 | 130 | ||
131 | #define phys_to_page(phys) (pfn_to_page(phys >> PAGE_SHIFT)) | ||
132 | #define page_to_phys(page) (page_to_pfn(page) << PAGE_SHIFT) | 131 | #define page_to_phys(page) (page_to_pfn(page) << PAGE_SHIFT) |
133 | 132 | ||
134 | /* PFN start number, because of __MEMORY_START */ | 133 | /* PFN start number, because of __MEMORY_START */ |
diff --git a/include/asm-sh/pgtable.h b/include/asm-sh/pgtable.h index cf0dd2b648c2..0b1d7c665659 100644 --- a/include/asm-sh/pgtable.h +++ b/include/asm-sh/pgtable.h | |||
@@ -399,7 +399,7 @@ static inline void set_pte(pte_t *ptep, pte_t pte) | |||
399 | #define pmd_bad(x) (pmd_val(x) & ~PAGE_MASK) | 399 | #define pmd_bad(x) (pmd_val(x) & ~PAGE_MASK) |
400 | 400 | ||
401 | #define pages_to_mb(x) ((x) >> (20-PAGE_SHIFT)) | 401 | #define pages_to_mb(x) ((x) >> (20-PAGE_SHIFT)) |
402 | #define pte_page(x) phys_to_page(pte_val(x)&PTE_PHYS_MASK) | 402 | #define pte_page(x) pfn_to_page(pte_pfn(x)) |
403 | 403 | ||
404 | /* | 404 | /* |
405 | * The following only work if pte_present() is true. | 405 | * The following only work if pte_present() is true. |
diff --git a/include/asm-sh/processor.h b/include/asm-sh/processor.h index 4f2922a1979c..ab0028db645a 100644 --- a/include/asm-sh/processor.h +++ b/include/asm-sh/processor.h | |||
@@ -71,7 +71,7 @@ struct sh_cpuinfo { | |||
71 | struct cache_info scache; /* Secondary cache */ | 71 | struct cache_info scache; /* Secondary cache */ |
72 | 72 | ||
73 | unsigned long flags; | 73 | unsigned long flags; |
74 | } __attribute__ ((aligned(SMP_CACHE_BYTES))); | 74 | } __attribute__ ((aligned(L1_CACHE_BYTES))); |
75 | 75 | ||
76 | extern struct sh_cpuinfo cpu_data[]; | 76 | extern struct sh_cpuinfo cpu_data[]; |
77 | #define boot_cpu_data cpu_data[0] | 77 | #define boot_cpu_data cpu_data[0] |
diff --git a/include/asm-sh/setup.h b/include/asm-sh/setup.h index 586a9711a75d..55a2bd328d99 100644 --- a/include/asm-sh/setup.h +++ b/include/asm-sh/setup.h | |||
@@ -5,6 +5,20 @@ | |||
5 | 5 | ||
6 | #ifdef __KERNEL__ | 6 | #ifdef __KERNEL__ |
7 | 7 | ||
8 | /* | ||
9 | * This is set up by the setup-routine at boot-time | ||
10 | */ | ||
11 | #define PARAM ((unsigned char *)empty_zero_page) | ||
12 | |||
13 | #define MOUNT_ROOT_RDONLY (*(unsigned long *) (PARAM+0x000)) | ||
14 | #define RAMDISK_FLAGS (*(unsigned long *) (PARAM+0x004)) | ||
15 | #define ORIG_ROOT_DEV (*(unsigned long *) (PARAM+0x008)) | ||
16 | #define LOADER_TYPE (*(unsigned long *) (PARAM+0x00c)) | ||
17 | #define INITRD_START (*(unsigned long *) (PARAM+0x010)) | ||
18 | #define INITRD_SIZE (*(unsigned long *) (PARAM+0x014)) | ||
19 | /* ... */ | ||
20 | #define COMMAND_LINE ((char *) (PARAM+0x100)) | ||
21 | |||
8 | int setup_early_printk(char *); | 22 | int setup_early_printk(char *); |
9 | void sh_mv_setup(void); | 23 | void sh_mv_setup(void); |
10 | 24 | ||
diff --git a/include/asm-sh64/dma-mapping.h b/include/asm-sh64/dma-mapping.h index 1438b763a5ea..18f8dd642ac5 100644 --- a/include/asm-sh64/dma-mapping.h +++ b/include/asm-sh64/dma-mapping.h | |||
@@ -42,8 +42,9 @@ static inline void dma_free_coherent(struct device *dev, size_t size, | |||
42 | static inline void dma_cache_sync(struct device *dev, void *vaddr, size_t size, | 42 | static inline void dma_cache_sync(struct device *dev, void *vaddr, size_t size, |
43 | enum dma_data_direction dir) | 43 | enum dma_data_direction dir) |
44 | { | 44 | { |
45 | unsigned long s = (unsigned long) vaddr & L1_CACHE_ALIGN_MASK; | 45 | unsigned long start = (unsigned long) vaddr; |
46 | unsigned long e = (vaddr + size) & L1_CACHE_ALIGN_MASK; | 46 | unsigned long s = start & L1_CACHE_ALIGN_MASK; |
47 | unsigned long e = (start + size) & L1_CACHE_ALIGN_MASK; | ||
47 | 48 | ||
48 | for (; s <= e; s += L1_CACHE_BYTES) | 49 | for (; s <= e; s += L1_CACHE_BYTES) |
49 | asm volatile ("ocbp %0, 0" : : "r" (s)); | 50 | asm volatile ("ocbp %0, 0" : : "r" (s)); |
diff --git a/include/asm-sh64/pci.h b/include/asm-sh64/pci.h index 57a67cf7a5c4..18055dbbb4b5 100644 --- a/include/asm-sh64/pci.h +++ b/include/asm-sh64/pci.h | |||
@@ -72,15 +72,6 @@ static inline void pcibios_penalize_isa_irq(int irq, int active) | |||
72 | #define pci_unmap_len_set(PTR, LEN_NAME, VAL) do { } while (0) | 72 | #define pci_unmap_len_set(PTR, LEN_NAME, VAL) do { } while (0) |
73 | #endif | 73 | #endif |
74 | 74 | ||
75 | /* These macros should be used after a pci_map_sg call has been done | ||
76 | * to get bus addresses of each of the SG entries and their lengths. | ||
77 | * You should only work with the number of sg entries pci_map_sg | ||
78 | * returns, or alternatively stop on the first sg_dma_len(sg) which | ||
79 | * is 0. | ||
80 | */ | ||
81 | #define sg_dma_address(sg) ((sg)->dma_address) | ||
82 | #define sg_dma_len(sg) ((sg)->length) | ||
83 | |||
84 | #ifdef CONFIG_PCI | 75 | #ifdef CONFIG_PCI |
85 | static inline void pci_dma_burst_advice(struct pci_dev *pdev, | 76 | static inline void pci_dma_burst_advice(struct pci_dev *pdev, |
86 | enum pci_dma_burst_strategy *strat, | 77 | enum pci_dma_burst_strategy *strat, |
diff --git a/include/asm-sh64/scatterlist.h b/include/asm-sh64/scatterlist.h index 5109251970e7..7f729bbfce43 100644 --- a/include/asm-sh64/scatterlist.h +++ b/include/asm-sh64/scatterlist.h | |||
@@ -23,6 +23,15 @@ struct scatterlist { | |||
23 | unsigned int length; | 23 | unsigned int length; |
24 | }; | 24 | }; |
25 | 25 | ||
26 | /* These macros should be used after a pci_map_sg call has been done | ||
27 | * to get bus addresses of each of the SG entries and their lengths. | ||
28 | * You should only work with the number of sg entries pci_map_sg | ||
29 | * returns, or alternatively stop on the first sg_dma_len(sg) which | ||
30 | * is 0. | ||
31 | */ | ||
32 | #define sg_dma_address(sg) ((sg)->dma_address) | ||
33 | #define sg_dma_len(sg) ((sg)->length) | ||
34 | |||
26 | #define ISA_DMA_THRESHOLD (0xffffffff) | 35 | #define ISA_DMA_THRESHOLD (0xffffffff) |
27 | 36 | ||
28 | #endif /* !__ASM_SH64_SCATTERLIST_H */ | 37 | #endif /* !__ASM_SH64_SCATTERLIST_H */ |
diff --git a/include/asm-x86/irqflags_32.h b/include/asm-x86/irqflags_32.h index d058b04e0083..4c7720089cb5 100644 --- a/include/asm-x86/irqflags_32.h +++ b/include/asm-x86/irqflags_32.h | |||
@@ -129,6 +129,27 @@ static inline int raw_irqs_disabled(void) | |||
129 | 129 | ||
130 | return raw_irqs_disabled_flags(flags); | 130 | return raw_irqs_disabled_flags(flags); |
131 | } | 131 | } |
132 | |||
133 | /* | ||
134 | * makes the traced hardirq state match with the machine state | ||
135 | * | ||
136 | * should be a rarely used function, only in places where its | ||
137 | * otherwise impossible to know the irq state, like in traps. | ||
138 | */ | ||
139 | static inline void trace_hardirqs_fixup_flags(unsigned long flags) | ||
140 | { | ||
141 | if (raw_irqs_disabled_flags(flags)) | ||
142 | trace_hardirqs_off(); | ||
143 | else | ||
144 | trace_hardirqs_on(); | ||
145 | } | ||
146 | |||
147 | static inline void trace_hardirqs_fixup(void) | ||
148 | { | ||
149 | unsigned long flags = __raw_local_save_flags(); | ||
150 | |||
151 | trace_hardirqs_fixup_flags(flags); | ||
152 | } | ||
132 | #endif /* __ASSEMBLY__ */ | 153 | #endif /* __ASSEMBLY__ */ |
133 | 154 | ||
134 | /* | 155 | /* |
diff --git a/include/asm-x86/irqflags_64.h b/include/asm-x86/irqflags_64.h index 5341ea1f815a..bb9163bb29d1 100644 --- a/include/asm-x86/irqflags_64.h +++ b/include/asm-x86/irqflags_64.h | |||
@@ -112,6 +112,26 @@ static inline int raw_irqs_disabled(void) | |||
112 | } | 112 | } |
113 | 113 | ||
114 | /* | 114 | /* |
115 | * makes the traced hardirq state match with the machine state | ||
116 | * | ||
117 | * should be a rarely used function, only in places where its | ||
118 | * otherwise impossible to know the irq state, like in traps. | ||
119 | */ | ||
120 | static inline void trace_hardirqs_fixup_flags(unsigned long flags) | ||
121 | { | ||
122 | if (raw_irqs_disabled_flags(flags)) | ||
123 | trace_hardirqs_off(); | ||
124 | else | ||
125 | trace_hardirqs_on(); | ||
126 | } | ||
127 | |||
128 | static inline void trace_hardirqs_fixup(void) | ||
129 | { | ||
130 | unsigned long flags = __raw_local_save_flags(); | ||
131 | |||
132 | trace_hardirqs_fixup_flags(flags); | ||
133 | } | ||
134 | /* | ||
115 | * Used in the idle loop; sti takes one instruction cycle | 135 | * Used in the idle loop; sti takes one instruction cycle |
116 | * to complete: | 136 | * to complete: |
117 | */ | 137 | */ |
diff --git a/include/linux/ata.h b/include/linux/ata.h index 128dc7ad4901..61535e72834d 100644 --- a/include/linux/ata.h +++ b/include/linux/ata.h | |||
@@ -43,6 +43,7 @@ enum { | |||
43 | ATA_MAX_SECTORS_128 = 128, | 43 | ATA_MAX_SECTORS_128 = 128, |
44 | ATA_MAX_SECTORS = 256, | 44 | ATA_MAX_SECTORS = 256, |
45 | ATA_MAX_SECTORS_LBA48 = 65535,/* TODO: 65536? */ | 45 | ATA_MAX_SECTORS_LBA48 = 65535,/* TODO: 65536? */ |
46 | ATA_MAX_SECTORS_TAPE = 65535, | ||
46 | 47 | ||
47 | ATA_ID_WORDS = 256, | 48 | ATA_ID_WORDS = 256, |
48 | ATA_ID_SERNO = 10, | 49 | ATA_ID_SERNO = 10, |
@@ -544,6 +545,11 @@ static inline int atapi_cdb_len(const u16 *dev_id) | |||
544 | } | 545 | } |
545 | } | 546 | } |
546 | 547 | ||
548 | static inline int atapi_command_packet_set(const u16 *dev_id) | ||
549 | { | ||
550 | return (dev_id[0] >> 8) & 0x1f; | ||
551 | } | ||
552 | |||
547 | static inline int is_atapi_taskfile(const struct ata_taskfile *tf) | 553 | static inline int is_atapi_taskfile(const struct ata_taskfile *tf) |
548 | { | 554 | { |
549 | return (tf->protocol == ATA_PROT_ATAPI) || | 555 | return (tf->protocol == ATA_PROT_ATAPI) || |
diff --git a/include/linux/input.h b/include/linux/input.h index 62268929856c..b45f240a8c45 100644 --- a/include/linux/input.h +++ b/include/linux/input.h | |||
@@ -527,6 +527,9 @@ struct input_absinfo { | |||
527 | #define KEY_SPELLCHECK 0x1b0 /* AL Spell Check */ | 527 | #define KEY_SPELLCHECK 0x1b0 /* AL Spell Check */ |
528 | #define KEY_LOGOFF 0x1b1 /* AL Logoff */ | 528 | #define KEY_LOGOFF 0x1b1 /* AL Logoff */ |
529 | 529 | ||
530 | #define KEY_DOLLAR 0x1b2 | ||
531 | #define KEY_EURO 0x1b3 | ||
532 | |||
530 | #define KEY_DEL_EOL 0x1c0 | 533 | #define KEY_DEL_EOL 0x1c0 |
531 | #define KEY_DEL_EOS 0x1c1 | 534 | #define KEY_DEL_EOS 0x1c1 |
532 | #define KEY_INS_LINE 0x1c2 | 535 | #define KEY_INS_LINE 0x1c2 |
diff --git a/include/linux/scatterlist.h b/include/linux/scatterlist.h index 32326c293d7b..259735044148 100644 --- a/include/linux/scatterlist.h +++ b/include/linux/scatterlist.h | |||
@@ -188,43 +188,23 @@ static inline void sg_chain(struct scatterlist *prv, unsigned int prv_nents, | |||
188 | 188 | ||
189 | /** | 189 | /** |
190 | * sg_mark_end - Mark the end of the scatterlist | 190 | * sg_mark_end - Mark the end of the scatterlist |
191 | * @sgl: Scatterlist | 191 | * @sg: SG entryScatterlist |
192 | * @nents: Number of entries in sgl | ||
193 | * | 192 | * |
194 | * Description: | 193 | * Description: |
195 | * Marks the last entry as the termination point for sg_next() | 194 | * Marks the passed in sg entry as the termination point for the sg |
195 | * table. A call to sg_next() on this entry will return NULL. | ||
196 | * | 196 | * |
197 | **/ | 197 | **/ |
198 | static inline void sg_mark_end(struct scatterlist *sgl, unsigned int nents) | 198 | static inline void sg_mark_end(struct scatterlist *sg) |
199 | { | 199 | { |
200 | sgl[nents - 1].page_link = 0x02; | ||
201 | } | ||
202 | |||
203 | static inline void __sg_mark_end(struct scatterlist *sg) | ||
204 | { | ||
205 | sg->page_link |= 0x02; | ||
206 | } | ||
207 | |||
208 | /** | ||
209 | * sg_init_one - Initialize a single entry sg list | ||
210 | * @sg: SG entry | ||
211 | * @buf: Virtual address for IO | ||
212 | * @buflen: IO length | ||
213 | * | ||
214 | * Notes: | ||
215 | * This should not be used on a single entry that is part of a larger | ||
216 | * table. Use sg_init_table() for that. | ||
217 | * | ||
218 | **/ | ||
219 | static inline void sg_init_one(struct scatterlist *sg, const void *buf, | ||
220 | unsigned int buflen) | ||
221 | { | ||
222 | memset(sg, 0, sizeof(*sg)); | ||
223 | #ifdef CONFIG_DEBUG_SG | 200 | #ifdef CONFIG_DEBUG_SG |
224 | sg->sg_magic = SG_MAGIC; | 201 | BUG_ON(sg->sg_magic != SG_MAGIC); |
225 | #endif | 202 | #endif |
226 | sg_mark_end(sg, 1); | 203 | /* |
227 | sg_set_buf(sg, buf, buflen); | 204 | * Set termination bit, clear potential chain bit |
205 | */ | ||
206 | sg->page_link |= 0x02; | ||
207 | sg->page_link &= ~0x01; | ||
228 | } | 208 | } |
229 | 209 | ||
230 | /** | 210 | /** |
@@ -240,7 +220,6 @@ static inline void sg_init_one(struct scatterlist *sg, const void *buf, | |||
240 | static inline void sg_init_table(struct scatterlist *sgl, unsigned int nents) | 220 | static inline void sg_init_table(struct scatterlist *sgl, unsigned int nents) |
241 | { | 221 | { |
242 | memset(sgl, 0, sizeof(*sgl) * nents); | 222 | memset(sgl, 0, sizeof(*sgl) * nents); |
243 | sg_mark_end(sgl, nents); | ||
244 | #ifdef CONFIG_DEBUG_SG | 223 | #ifdef CONFIG_DEBUG_SG |
245 | { | 224 | { |
246 | unsigned int i; | 225 | unsigned int i; |
@@ -248,6 +227,25 @@ static inline void sg_init_table(struct scatterlist *sgl, unsigned int nents) | |||
248 | sgl[i].sg_magic = SG_MAGIC; | 227 | sgl[i].sg_magic = SG_MAGIC; |
249 | } | 228 | } |
250 | #endif | 229 | #endif |
230 | sg_mark_end(&sgl[nents - 1]); | ||
231 | } | ||
232 | |||
233 | /** | ||
234 | * sg_init_one - Initialize a single entry sg list | ||
235 | * @sg: SG entry | ||
236 | * @buf: Virtual address for IO | ||
237 | * @buflen: IO length | ||
238 | * | ||
239 | * Notes: | ||
240 | * This should not be used on a single entry that is part of a larger | ||
241 | * table. Use sg_init_table() for that. | ||
242 | * | ||
243 | **/ | ||
244 | static inline void sg_init_one(struct scatterlist *sg, const void *buf, | ||
245 | unsigned int buflen) | ||
246 | { | ||
247 | sg_init_table(sg, 1); | ||
248 | sg_set_buf(sg, buf, buflen); | ||
251 | } | 249 | } |
252 | 250 | ||
253 | /** | 251 | /** |
diff --git a/include/net/esp.h b/include/net/esp.h index c1bc529809da..c05f529bff28 100644 --- a/include/net/esp.h +++ b/include/net/esp.h | |||
@@ -3,7 +3,7 @@ | |||
3 | 3 | ||
4 | #include <linux/crypto.h> | 4 | #include <linux/crypto.h> |
5 | #include <net/xfrm.h> | 5 | #include <net/xfrm.h> |
6 | #include <asm/scatterlist.h> | 6 | #include <linux/scatterlist.h> |
7 | 7 | ||
8 | #define ESP_NUM_FAST_SG 4 | 8 | #define ESP_NUM_FAST_SG 4 |
9 | 9 | ||
diff --git a/include/rdma/ib_verbs.h b/include/rdma/ib_verbs.h index 4bea182d7116..11f39606e7d9 100644 --- a/include/rdma/ib_verbs.h +++ b/include/rdma/ib_verbs.h | |||
@@ -48,9 +48,9 @@ | |||
48 | #include <linux/kref.h> | 48 | #include <linux/kref.h> |
49 | #include <linux/list.h> | 49 | #include <linux/list.h> |
50 | #include <linux/rwsem.h> | 50 | #include <linux/rwsem.h> |
51 | #include <linux/scatterlist.h> | ||
51 | 52 | ||
52 | #include <asm/atomic.h> | 53 | #include <asm/atomic.h> |
53 | #include <asm/scatterlist.h> | ||
54 | #include <asm/uaccess.h> | 54 | #include <asm/uaccess.h> |
55 | 55 | ||
56 | union ib_gid { | 56 | union ib_gid { |
diff --git a/include/scsi/libsas.h b/include/scsi/libsas.h index 8dda2d66b5b9..a466c2cb8955 100644 --- a/include/scsi/libsas.h +++ b/include/scsi/libsas.h | |||
@@ -36,7 +36,7 @@ | |||
36 | #include <scsi/scsi_device.h> | 36 | #include <scsi/scsi_device.h> |
37 | #include <scsi/scsi_cmnd.h> | 37 | #include <scsi/scsi_cmnd.h> |
38 | #include <scsi/scsi_transport_sas.h> | 38 | #include <scsi/scsi_transport_sas.h> |
39 | #include <asm/scatterlist.h> | 39 | #include <linux/scatterlist.h> |
40 | 40 | ||
41 | struct block_device; | 41 | struct block_device; |
42 | 42 | ||