diff options
Diffstat (limited to 'include')
186 files changed, 3312 insertions, 1078 deletions
diff --git a/include/asm-alpha/pgtable.h b/include/asm-alpha/pgtable.h index 8393bf374b2b..a985cd29b6db 100644 --- a/include/asm-alpha/pgtable.h +++ b/include/asm-alpha/pgtable.h | |||
@@ -17,6 +17,9 @@ | |||
17 | #include <asm/processor.h> /* For TASK_SIZE */ | 17 | #include <asm/processor.h> /* For TASK_SIZE */ |
18 | #include <asm/machvec.h> | 18 | #include <asm/machvec.h> |
19 | 19 | ||
20 | struct mm_struct; | ||
21 | struct vm_area_struct; | ||
22 | |||
20 | /* Certain architectures need to do special things when PTEs | 23 | /* Certain architectures need to do special things when PTEs |
21 | * within a page table are directly modified. Thus, the following | 24 | * within a page table are directly modified. Thus, the following |
22 | * hook is made available. | 25 | * hook is made available. |
diff --git a/include/asm-alpha/ptrace.h b/include/asm-alpha/ptrace.h index d462c5e14c13..072375c135b4 100644 --- a/include/asm-alpha/ptrace.h +++ b/include/asm-alpha/ptrace.h | |||
@@ -67,6 +67,9 @@ struct switch_stack { | |||
67 | }; | 67 | }; |
68 | 68 | ||
69 | #ifdef __KERNEL__ | 69 | #ifdef __KERNEL__ |
70 | |||
71 | #define __ARCH_SYS_PTRACE 1 | ||
72 | |||
70 | #define user_mode(regs) (((regs)->ps & 8) != 0) | 73 | #define user_mode(regs) (((regs)->ps & 8) != 0) |
71 | #define instruction_pointer(regs) ((regs)->pc) | 74 | #define instruction_pointer(regs) ((regs)->pc) |
72 | #define profile_pc(regs) instruction_pointer(regs) | 75 | #define profile_pc(regs) instruction_pointer(regs) |
diff --git a/include/asm-cris/arch-v10/byteorder.h b/include/asm-cris/arch-v10/byteorder.h index e24465d1f40d..255b646b7fa8 100644 --- a/include/asm-cris/arch-v10/byteorder.h +++ b/include/asm-cris/arch-v10/byteorder.h | |||
@@ -9,14 +9,14 @@ | |||
9 | * them together into ntohl etc. | 9 | * them together into ntohl etc. |
10 | */ | 10 | */ |
11 | 11 | ||
12 | extern __inline__ __attribute_const__ __u32 ___arch__swab32(__u32 x) | 12 | static inline __attribute_const__ __u32 ___arch__swab32(__u32 x) |
13 | { | 13 | { |
14 | __asm__ ("swapwb %0" : "=r" (x) : "0" (x)); | 14 | __asm__ ("swapwb %0" : "=r" (x) : "0" (x)); |
15 | 15 | ||
16 | return(x); | 16 | return(x); |
17 | } | 17 | } |
18 | 18 | ||
19 | extern __inline__ __attribute_const__ __u16 ___arch__swab16(__u16 x) | 19 | static inline __attribute_const__ __u16 ___arch__swab16(__u16 x) |
20 | { | 20 | { |
21 | __asm__ ("swapb %0" : "=r" (x) : "0" (x)); | 21 | __asm__ ("swapb %0" : "=r" (x) : "0" (x)); |
22 | 22 | ||
diff --git a/include/asm-cris/arch-v10/checksum.h b/include/asm-cris/arch-v10/checksum.h index fde1d00aaa90..633f234f336b 100644 --- a/include/asm-cris/arch-v10/checksum.h +++ b/include/asm-cris/arch-v10/checksum.h | |||
@@ -8,7 +8,7 @@ | |||
8 | * to split all of those into 16-bit components, then add. | 8 | * to split all of those into 16-bit components, then add. |
9 | */ | 9 | */ |
10 | 10 | ||
11 | extern inline unsigned int | 11 | static inline unsigned int |
12 | csum_tcpudp_nofold(unsigned long saddr, unsigned long daddr, unsigned short len, | 12 | csum_tcpudp_nofold(unsigned long saddr, unsigned long daddr, unsigned short len, |
13 | unsigned short proto, unsigned int sum) | 13 | unsigned short proto, unsigned int sum) |
14 | { | 14 | { |
diff --git a/include/asm-cris/arch-v10/delay.h b/include/asm-cris/arch-v10/delay.h index cfedae0d2f53..39481f6e0c30 100644 --- a/include/asm-cris/arch-v10/delay.h +++ b/include/asm-cris/arch-v10/delay.h | |||
@@ -1,7 +1,7 @@ | |||
1 | #ifndef _CRIS_ARCH_DELAY_H | 1 | #ifndef _CRIS_ARCH_DELAY_H |
2 | #define _CRIS_ARCH_DELAY_H | 2 | #define _CRIS_ARCH_DELAY_H |
3 | 3 | ||
4 | extern __inline__ void __delay(int loops) | 4 | static inline void __delay(int loops) |
5 | { | 5 | { |
6 | __asm__ __volatile__ ( | 6 | __asm__ __volatile__ ( |
7 | "move.d %0,$r9\n\t" | 7 | "move.d %0,$r9\n\t" |
diff --git a/include/asm-cris/arch-v10/ide.h b/include/asm-cris/arch-v10/ide.h index 8cf2d7cb22ac..78b301ed7b12 100644 --- a/include/asm-cris/arch-v10/ide.h +++ b/include/asm-cris/arch-v10/ide.h | |||
@@ -25,7 +25,7 @@ | |||
25 | 25 | ||
26 | #define MAX_HWIFS 4 | 26 | #define MAX_HWIFS 4 |
27 | 27 | ||
28 | extern __inline__ int ide_default_irq(unsigned long base) | 28 | static inline int ide_default_irq(unsigned long base) |
29 | { | 29 | { |
30 | /* all IDE busses share the same IRQ, number 4. | 30 | /* all IDE busses share the same IRQ, number 4. |
31 | * this has the side-effect that ide-probe.c will cluster our 4 interfaces | 31 | * this has the side-effect that ide-probe.c will cluster our 4 interfaces |
@@ -35,7 +35,7 @@ extern __inline__ int ide_default_irq(unsigned long base) | |||
35 | return 4; | 35 | return 4; |
36 | } | 36 | } |
37 | 37 | ||
38 | extern __inline__ unsigned long ide_default_io_base(int index) | 38 | static inline unsigned long ide_default_io_base(int index) |
39 | { | 39 | { |
40 | /* we have no real I/O base address per interface, since all go through the | 40 | /* we have no real I/O base address per interface, since all go through the |
41 | * same register. but in a bitfield in that register, we have the i/f number. | 41 | * same register. but in a bitfield in that register, we have the i/f number. |
@@ -54,7 +54,7 @@ extern __inline__ unsigned long ide_default_io_base(int index) | |||
54 | * of the ide_default_io_base call above. ctrl_port will be 0, but that is don't care for us. | 54 | * of the ide_default_io_base call above. ctrl_port will be 0, but that is don't care for us. |
55 | */ | 55 | */ |
56 | 56 | ||
57 | extern __inline__ void ide_init_hwif_ports(hw_regs_t *hw, unsigned long data_port, unsigned long ctrl_port, int *irq) | 57 | static inline void ide_init_hwif_ports(hw_regs_t *hw, unsigned long data_port, unsigned long ctrl_port, int *irq) |
58 | { | 58 | { |
59 | int i; | 59 | int i; |
60 | 60 | ||
@@ -77,7 +77,7 @@ extern __inline__ void ide_init_hwif_ports(hw_regs_t *hw, unsigned long data_por | |||
77 | hw->io_ports[IDE_IRQ_OFFSET] = 0; | 77 | hw->io_ports[IDE_IRQ_OFFSET] = 0; |
78 | } | 78 | } |
79 | 79 | ||
80 | extern __inline__ void ide_init_default_hwifs(void) | 80 | static inline void ide_init_default_hwifs(void) |
81 | { | 81 | { |
82 | hw_regs_t hw; | 82 | hw_regs_t hw; |
83 | int index; | 83 | int index; |
diff --git a/include/asm-cris/arch-v10/system.h b/include/asm-cris/arch-v10/system.h index 6cc35642b8ab..1ac7b639b1b0 100644 --- a/include/asm-cris/arch-v10/system.h +++ b/include/asm-cris/arch-v10/system.h | |||
@@ -5,7 +5,7 @@ | |||
5 | 5 | ||
6 | /* read the CPU version register */ | 6 | /* read the CPU version register */ |
7 | 7 | ||
8 | extern inline unsigned long rdvr(void) { | 8 | static inline unsigned long rdvr(void) { |
9 | unsigned char vr; | 9 | unsigned char vr; |
10 | __asm__ volatile ("move $vr,%0" : "=rm" (vr)); | 10 | __asm__ volatile ("move $vr,%0" : "=rm" (vr)); |
11 | return vr; | 11 | return vr; |
@@ -15,7 +15,7 @@ extern inline unsigned long rdvr(void) { | |||
15 | 15 | ||
16 | /* read/write the user-mode stackpointer */ | 16 | /* read/write the user-mode stackpointer */ |
17 | 17 | ||
18 | extern inline unsigned long rdusp(void) { | 18 | static inline unsigned long rdusp(void) { |
19 | unsigned long usp; | 19 | unsigned long usp; |
20 | __asm__ __volatile__("move $usp,%0" : "=rm" (usp)); | 20 | __asm__ __volatile__("move $usp,%0" : "=rm" (usp)); |
21 | return usp; | 21 | return usp; |
@@ -26,13 +26,13 @@ extern inline unsigned long rdusp(void) { | |||
26 | 26 | ||
27 | /* read the current stackpointer */ | 27 | /* read the current stackpointer */ |
28 | 28 | ||
29 | extern inline unsigned long rdsp(void) { | 29 | static inline unsigned long rdsp(void) { |
30 | unsigned long sp; | 30 | unsigned long sp; |
31 | __asm__ __volatile__("move.d $sp,%0" : "=rm" (sp)); | 31 | __asm__ __volatile__("move.d $sp,%0" : "=rm" (sp)); |
32 | return sp; | 32 | return sp; |
33 | } | 33 | } |
34 | 34 | ||
35 | extern inline unsigned long _get_base(char * addr) | 35 | static inline unsigned long _get_base(char * addr) |
36 | { | 36 | { |
37 | return 0; | 37 | return 0; |
38 | } | 38 | } |
diff --git a/include/asm-cris/arch-v10/thread_info.h b/include/asm-cris/arch-v10/thread_info.h index 357f5df0c907..218f4152d3e5 100644 --- a/include/asm-cris/arch-v10/thread_info.h +++ b/include/asm-cris/arch-v10/thread_info.h | |||
@@ -2,7 +2,7 @@ | |||
2 | #define _ASM_ARCH_THREAD_INFO_H | 2 | #define _ASM_ARCH_THREAD_INFO_H |
3 | 3 | ||
4 | /* how to get the thread information struct from C */ | 4 | /* how to get the thread information struct from C */ |
5 | extern inline struct thread_info *current_thread_info(void) | 5 | static inline struct thread_info *current_thread_info(void) |
6 | { | 6 | { |
7 | struct thread_info *ti; | 7 | struct thread_info *ti; |
8 | __asm__("and.d $sp,%0; ":"=r" (ti) : "0" (~8191UL)); | 8 | __asm__("and.d $sp,%0; ":"=r" (ti) : "0" (~8191UL)); |
diff --git a/include/asm-cris/arch-v10/timex.h b/include/asm-cris/arch-v10/timex.h index ecfc553c06a5..e48447d94faf 100644 --- a/include/asm-cris/arch-v10/timex.h +++ b/include/asm-cris/arch-v10/timex.h | |||
@@ -22,7 +22,7 @@ | |||
22 | 22 | ||
23 | unsigned long get_ns_in_jiffie(void); | 23 | unsigned long get_ns_in_jiffie(void); |
24 | 24 | ||
25 | extern inline unsigned long get_us_in_jiffie_highres(void) | 25 | static inline unsigned long get_us_in_jiffie_highres(void) |
26 | { | 26 | { |
27 | return get_ns_in_jiffie()/1000; | 27 | return get_ns_in_jiffie()/1000; |
28 | } | 28 | } |
diff --git a/include/asm-cris/arch-v10/uaccess.h b/include/asm-cris/arch-v10/uaccess.h index 787d2e60c83c..65b02d9b605a 100644 --- a/include/asm-cris/arch-v10/uaccess.h +++ b/include/asm-cris/arch-v10/uaccess.h | |||
@@ -87,7 +87,7 @@ | |||
87 | * bytes copied if we hit a null byte | 87 | * bytes copied if we hit a null byte |
88 | * (without the null byte) | 88 | * (without the null byte) |
89 | */ | 89 | */ |
90 | extern inline long | 90 | static inline long |
91 | __do_strncpy_from_user(char *dst, const char *src, long count) | 91 | __do_strncpy_from_user(char *dst, const char *src, long count) |
92 | { | 92 | { |
93 | long res; | 93 | long res; |
@@ -602,7 +602,7 @@ __do_strncpy_from_user(char *dst, const char *src, long count) | |||
602 | * or 0 for error. Return a value greater than N if too long. | 602 | * or 0 for error. Return a value greater than N if too long. |
603 | */ | 603 | */ |
604 | 604 | ||
605 | extern inline long | 605 | static inline long |
606 | strnlen_user(const char *s, long n) | 606 | strnlen_user(const char *s, long n) |
607 | { | 607 | { |
608 | long res, tmp1; | 608 | long res, tmp1; |
diff --git a/include/asm-cris/arch-v32/bitops.h b/include/asm-cris/arch-v32/bitops.h index e40a58d3b862..147689d6b624 100644 --- a/include/asm-cris/arch-v32/bitops.h +++ b/include/asm-cris/arch-v32/bitops.h | |||
@@ -8,7 +8,7 @@ | |||
8 | * inverts all bits in the input. | 8 | * inverts all bits in the input. |
9 | */ | 9 | */ |
10 | 10 | ||
11 | extern inline unsigned long | 11 | static inline unsigned long |
12 | cris_swapnwbrlz(unsigned long w) | 12 | cris_swapnwbrlz(unsigned long w) |
13 | { | 13 | { |
14 | unsigned long res; | 14 | unsigned long res; |
@@ -20,7 +20,7 @@ cris_swapnwbrlz(unsigned long w) | |||
20 | return res; | 20 | return res; |
21 | } | 21 | } |
22 | 22 | ||
23 | extern inline unsigned long | 23 | static inline unsigned long |
24 | cris_swapwbrlz(unsigned long w) | 24 | cris_swapwbrlz(unsigned long w) |
25 | { | 25 | { |
26 | unsigned long res; | 26 | unsigned long res; |
@@ -36,7 +36,7 @@ cris_swapwbrlz(unsigned long w) | |||
36 | * Find First Zero in word. Undefined if no zero exist, so the caller should | 36 | * Find First Zero in word. Undefined if no zero exist, so the caller should |
37 | * check against ~0 first. | 37 | * check against ~0 first. |
38 | */ | 38 | */ |
39 | extern inline unsigned long | 39 | static inline unsigned long |
40 | ffz(unsigned long w) | 40 | ffz(unsigned long w) |
41 | { | 41 | { |
42 | return cris_swapnwbrlz(w); | 42 | return cris_swapnwbrlz(w); |
@@ -46,7 +46,7 @@ ffz(unsigned long w) | |||
46 | * Find First Set bit in word. Undefined if no 1 exist, so the caller | 46 | * Find First Set bit in word. Undefined if no 1 exist, so the caller |
47 | * should check against 0 first. | 47 | * should check against 0 first. |
48 | */ | 48 | */ |
49 | extern inline unsigned long | 49 | static inline unsigned long |
50 | __ffs(unsigned long w) | 50 | __ffs(unsigned long w) |
51 | { | 51 | { |
52 | return cris_swapnwbrlz(~w); | 52 | return cris_swapnwbrlz(~w); |
@@ -55,7 +55,7 @@ __ffs(unsigned long w) | |||
55 | /* | 55 | /* |
56 | * Find First Bit that is set. | 56 | * Find First Bit that is set. |
57 | */ | 57 | */ |
58 | extern inline unsigned long | 58 | static inline unsigned long |
59 | kernel_ffs(unsigned long w) | 59 | kernel_ffs(unsigned long w) |
60 | { | 60 | { |
61 | return w ? cris_swapwbrlz (w) + 1 : 0; | 61 | return w ? cris_swapwbrlz (w) + 1 : 0; |
diff --git a/include/asm-cris/arch-v32/byteorder.h b/include/asm-cris/arch-v32/byteorder.h index 74846ee6cf99..6ef8fb4a35f2 100644 --- a/include/asm-cris/arch-v32/byteorder.h +++ b/include/asm-cris/arch-v32/byteorder.h | |||
@@ -3,14 +3,14 @@ | |||
3 | 3 | ||
4 | #include <asm/types.h> | 4 | #include <asm/types.h> |
5 | 5 | ||
6 | extern __inline__ __const__ __u32 | 6 | static inline __const__ __u32 |
7 | ___arch__swab32(__u32 x) | 7 | ___arch__swab32(__u32 x) |
8 | { | 8 | { |
9 | __asm__ __volatile__ ("swapwb %0" : "=r" (x) : "0" (x)); | 9 | __asm__ __volatile__ ("swapwb %0" : "=r" (x) : "0" (x)); |
10 | return (x); | 10 | return (x); |
11 | } | 11 | } |
12 | 12 | ||
13 | extern __inline__ __const__ __u16 | 13 | static inline __const__ __u16 |
14 | ___arch__swab16(__u16 x) | 14 | ___arch__swab16(__u16 x) |
15 | { | 15 | { |
16 | __asm__ __volatile__ ("swapb %0" : "=r" (x) : "0" (x)); | 16 | __asm__ __volatile__ ("swapb %0" : "=r" (x) : "0" (x)); |
diff --git a/include/asm-cris/arch-v32/checksum.h b/include/asm-cris/arch-v32/checksum.h index a1d6b2a6cc44..97ef89efea62 100644 --- a/include/asm-cris/arch-v32/checksum.h +++ b/include/asm-cris/arch-v32/checksum.h | |||
@@ -9,7 +9,7 @@ | |||
9 | * checksum. Which means it would be necessary to split all those into | 9 | * checksum. Which means it would be necessary to split all those into |
10 | * 16-bit components and then add. | 10 | * 16-bit components and then add. |
11 | */ | 11 | */ |
12 | extern inline unsigned int | 12 | static inline unsigned int |
13 | csum_tcpudp_nofold(unsigned long saddr, unsigned long daddr, | 13 | csum_tcpudp_nofold(unsigned long saddr, unsigned long daddr, |
14 | unsigned short len, unsigned short proto, unsigned int sum) | 14 | unsigned short len, unsigned short proto, unsigned int sum) |
15 | { | 15 | { |
diff --git a/include/asm-cris/arch-v32/delay.h b/include/asm-cris/arch-v32/delay.h index f36f7f760e89..b6e941e637de 100644 --- a/include/asm-cris/arch-v32/delay.h +++ b/include/asm-cris/arch-v32/delay.h | |||
@@ -1,7 +1,7 @@ | |||
1 | #ifndef _ASM_CRIS_ARCH_DELAY_H | 1 | #ifndef _ASM_CRIS_ARCH_DELAY_H |
2 | #define _ASM_CRIS_ARCH_DELAY_H | 2 | #define _ASM_CRIS_ARCH_DELAY_H |
3 | 3 | ||
4 | extern __inline__ void | 4 | static inline void |
5 | __delay(int loops) | 5 | __delay(int loops) |
6 | { | 6 | { |
7 | __asm__ __volatile__ ( | 7 | __asm__ __volatile__ ( |
diff --git a/include/asm-cris/arch-v32/ide.h b/include/asm-cris/arch-v32/ide.h index 24f5604f566a..6590f657500d 100644 --- a/include/asm-cris/arch-v32/ide.h +++ b/include/asm-cris/arch-v32/ide.h | |||
@@ -26,7 +26,7 @@ | |||
26 | 26 | ||
27 | #define MAX_HWIFS 4 | 27 | #define MAX_HWIFS 4 |
28 | 28 | ||
29 | extern __inline__ int ide_default_irq(unsigned long base) | 29 | static inline int ide_default_irq(unsigned long base) |
30 | { | 30 | { |
31 | /* all IDE busses share the same IRQ, | 31 | /* all IDE busses share the same IRQ, |
32 | * this has the side-effect that ide-probe.c will cluster our 4 interfaces | 32 | * this has the side-effect that ide-probe.c will cluster our 4 interfaces |
@@ -36,7 +36,7 @@ extern __inline__ int ide_default_irq(unsigned long base) | |||
36 | return ATA_INTR_VECT; | 36 | return ATA_INTR_VECT; |
37 | } | 37 | } |
38 | 38 | ||
39 | extern __inline__ unsigned long ide_default_io_base(int index) | 39 | static inline unsigned long ide_default_io_base(int index) |
40 | { | 40 | { |
41 | reg_ata_rw_ctrl2 ctrl2 = {.sel = index}; | 41 | reg_ata_rw_ctrl2 ctrl2 = {.sel = index}; |
42 | /* we have no real I/O base address per interface, since all go through the | 42 | /* we have no real I/O base address per interface, since all go through the |
diff --git a/include/asm-cris/arch-v32/io.h b/include/asm-cris/arch-v32/io.h index 4c80263ec634..043c9ce5294e 100644 --- a/include/asm-cris/arch-v32/io.h +++ b/include/asm-cris/arch-v32/io.h | |||
@@ -35,7 +35,7 @@ extern struct crisv32_iopin crisv32_led2_red; | |||
35 | extern struct crisv32_iopin crisv32_led3_green; | 35 | extern struct crisv32_iopin crisv32_led3_green; |
36 | extern struct crisv32_iopin crisv32_led3_red; | 36 | extern struct crisv32_iopin crisv32_led3_red; |
37 | 37 | ||
38 | extern inline void crisv32_io_set(struct crisv32_iopin* iopin, | 38 | static inline void crisv32_io_set(struct crisv32_iopin* iopin, |
39 | int val) | 39 | int val) |
40 | { | 40 | { |
41 | if (val) | 41 | if (val) |
@@ -44,7 +44,7 @@ extern inline void crisv32_io_set(struct crisv32_iopin* iopin, | |||
44 | *iopin->port->data &= ~iopin->bit; | 44 | *iopin->port->data &= ~iopin->bit; |
45 | } | 45 | } |
46 | 46 | ||
47 | extern inline void crisv32_io_set_dir(struct crisv32_iopin* iopin, | 47 | static inline void crisv32_io_set_dir(struct crisv32_iopin* iopin, |
48 | enum crisv32_io_dir dir) | 48 | enum crisv32_io_dir dir) |
49 | { | 49 | { |
50 | if (dir == crisv32_io_dir_in) | 50 | if (dir == crisv32_io_dir_in) |
@@ -53,7 +53,7 @@ extern inline void crisv32_io_set_dir(struct crisv32_iopin* iopin, | |||
53 | *iopin->port->oe |= iopin->bit; | 53 | *iopin->port->oe |= iopin->bit; |
54 | } | 54 | } |
55 | 55 | ||
56 | extern inline int crisv32_io_rd(struct crisv32_iopin* iopin) | 56 | static inline int crisv32_io_rd(struct crisv32_iopin* iopin) |
57 | { | 57 | { |
58 | return ((*iopin->port->data_in & iopin->bit) ? 1 : 0); | 58 | return ((*iopin->port->data_in & iopin->bit) ? 1 : 0); |
59 | } | 59 | } |
diff --git a/include/asm-cris/arch-v32/system.h b/include/asm-cris/arch-v32/system.h index b9afbb95e0bb..a3d75d581e2f 100644 --- a/include/asm-cris/arch-v32/system.h +++ b/include/asm-cris/arch-v32/system.h | |||
@@ -4,7 +4,7 @@ | |||
4 | #include <linux/config.h> | 4 | #include <linux/config.h> |
5 | 5 | ||
6 | /* Read the CPU version register. */ | 6 | /* Read the CPU version register. */ |
7 | extern inline unsigned long rdvr(void) | 7 | static inline unsigned long rdvr(void) |
8 | { | 8 | { |
9 | unsigned char vr; | 9 | unsigned char vr; |
10 | 10 | ||
@@ -15,7 +15,7 @@ extern inline unsigned long rdvr(void) | |||
15 | #define cris_machine_name "crisv32" | 15 | #define cris_machine_name "crisv32" |
16 | 16 | ||
17 | /* Read the user-mode stack pointer. */ | 17 | /* Read the user-mode stack pointer. */ |
18 | extern inline unsigned long rdusp(void) | 18 | static inline unsigned long rdusp(void) |
19 | { | 19 | { |
20 | unsigned long usp; | 20 | unsigned long usp; |
21 | 21 | ||
@@ -24,7 +24,7 @@ extern inline unsigned long rdusp(void) | |||
24 | } | 24 | } |
25 | 25 | ||
26 | /* Read the current stack pointer. */ | 26 | /* Read the current stack pointer. */ |
27 | extern inline unsigned long rdsp(void) | 27 | static inline unsigned long rdsp(void) |
28 | { | 28 | { |
29 | unsigned long sp; | 29 | unsigned long sp; |
30 | 30 | ||
diff --git a/include/asm-cris/arch-v32/thread_info.h b/include/asm-cris/arch-v32/thread_info.h index a7a182307da0..d6936956a3c6 100644 --- a/include/asm-cris/arch-v32/thread_info.h +++ b/include/asm-cris/arch-v32/thread_info.h | |||
@@ -2,7 +2,7 @@ | |||
2 | #define _ASM_CRIS_ARCH_THREAD_INFO_H | 2 | #define _ASM_CRIS_ARCH_THREAD_INFO_H |
3 | 3 | ||
4 | /* Return a thread_info struct. */ | 4 | /* Return a thread_info struct. */ |
5 | extern inline struct thread_info *current_thread_info(void) | 5 | static inline struct thread_info *current_thread_info(void) |
6 | { | 6 | { |
7 | struct thread_info *ti; | 7 | struct thread_info *ti; |
8 | 8 | ||
diff --git a/include/asm-cris/arch-v32/timex.h b/include/asm-cris/arch-v32/timex.h index 4d0fd23b21e9..5a4aa285d5fd 100644 --- a/include/asm-cris/arch-v32/timex.h +++ b/include/asm-cris/arch-v32/timex.h | |||
@@ -22,7 +22,7 @@ | |||
22 | 22 | ||
23 | extern unsigned long get_ns_in_jiffie(void); | 23 | extern unsigned long get_ns_in_jiffie(void); |
24 | 24 | ||
25 | extern inline unsigned long get_us_in_jiffie_highres(void) | 25 | static inline unsigned long get_us_in_jiffie_highres(void) |
26 | { | 26 | { |
27 | return get_ns_in_jiffie() / 1000; | 27 | return get_ns_in_jiffie() / 1000; |
28 | } | 28 | } |
diff --git a/include/asm-cris/arch-v32/uaccess.h b/include/asm-cris/arch-v32/uaccess.h index 055a0bdbe835..6b207f1b6622 100644 --- a/include/asm-cris/arch-v32/uaccess.h +++ b/include/asm-cris/arch-v32/uaccess.h | |||
@@ -93,7 +93,7 @@ | |||
93 | * bytes copied if we hit a null byte | 93 | * bytes copied if we hit a null byte |
94 | * (without the null byte) | 94 | * (without the null byte) |
95 | */ | 95 | */ |
96 | extern inline long | 96 | static inline long |
97 | __do_strncpy_from_user(char *dst, const char *src, long count) | 97 | __do_strncpy_from_user(char *dst, const char *src, long count) |
98 | { | 98 | { |
99 | long res; | 99 | long res; |
@@ -695,7 +695,7 @@ __do_strncpy_from_user(char *dst, const char *src, long count) | |||
695 | * or 0 for error. Return a value greater than N if too long. | 695 | * or 0 for error. Return a value greater than N if too long. |
696 | */ | 696 | */ |
697 | 697 | ||
698 | extern inline long | 698 | static inline long |
699 | strnlen_user(const char *s, long n) | 699 | strnlen_user(const char *s, long n) |
700 | { | 700 | { |
701 | long res, tmp1; | 701 | long res, tmp1; |
diff --git a/include/asm-cris/atomic.h b/include/asm-cris/atomic.h index 70605b09e8b7..8c2e78304523 100644 --- a/include/asm-cris/atomic.h +++ b/include/asm-cris/atomic.h | |||
@@ -20,7 +20,7 @@ typedef struct { volatile int counter; } atomic_t; | |||
20 | 20 | ||
21 | /* These should be written in asm but we do it in C for now. */ | 21 | /* These should be written in asm but we do it in C for now. */ |
22 | 22 | ||
23 | extern __inline__ void atomic_add(int i, volatile atomic_t *v) | 23 | static inline void atomic_add(int i, volatile atomic_t *v) |
24 | { | 24 | { |
25 | unsigned long flags; | 25 | unsigned long flags; |
26 | cris_atomic_save(v, flags); | 26 | cris_atomic_save(v, flags); |
@@ -28,7 +28,7 @@ extern __inline__ void atomic_add(int i, volatile atomic_t *v) | |||
28 | cris_atomic_restore(v, flags); | 28 | cris_atomic_restore(v, flags); |
29 | } | 29 | } |
30 | 30 | ||
31 | extern __inline__ void atomic_sub(int i, volatile atomic_t *v) | 31 | static inline void atomic_sub(int i, volatile atomic_t *v) |
32 | { | 32 | { |
33 | unsigned long flags; | 33 | unsigned long flags; |
34 | cris_atomic_save(v, flags); | 34 | cris_atomic_save(v, flags); |
@@ -36,7 +36,7 @@ extern __inline__ void atomic_sub(int i, volatile atomic_t *v) | |||
36 | cris_atomic_restore(v, flags); | 36 | cris_atomic_restore(v, flags); |
37 | } | 37 | } |
38 | 38 | ||
39 | extern __inline__ int atomic_add_return(int i, volatile atomic_t *v) | 39 | static inline int atomic_add_return(int i, volatile atomic_t *v) |
40 | { | 40 | { |
41 | unsigned long flags; | 41 | unsigned long flags; |
42 | int retval; | 42 | int retval; |
@@ -48,7 +48,7 @@ extern __inline__ int atomic_add_return(int i, volatile atomic_t *v) | |||
48 | 48 | ||
49 | #define atomic_add_negative(a, v) (atomic_add_return((a), (v)) < 0) | 49 | #define atomic_add_negative(a, v) (atomic_add_return((a), (v)) < 0) |
50 | 50 | ||
51 | extern __inline__ int atomic_sub_return(int i, volatile atomic_t *v) | 51 | static inline int atomic_sub_return(int i, volatile atomic_t *v) |
52 | { | 52 | { |
53 | unsigned long flags; | 53 | unsigned long flags; |
54 | int retval; | 54 | int retval; |
@@ -58,7 +58,7 @@ extern __inline__ int atomic_sub_return(int i, volatile atomic_t *v) | |||
58 | return retval; | 58 | return retval; |
59 | } | 59 | } |
60 | 60 | ||
61 | extern __inline__ int atomic_sub_and_test(int i, volatile atomic_t *v) | 61 | static inline int atomic_sub_and_test(int i, volatile atomic_t *v) |
62 | { | 62 | { |
63 | int retval; | 63 | int retval; |
64 | unsigned long flags; | 64 | unsigned long flags; |
@@ -68,7 +68,7 @@ extern __inline__ int atomic_sub_and_test(int i, volatile atomic_t *v) | |||
68 | return retval; | 68 | return retval; |
69 | } | 69 | } |
70 | 70 | ||
71 | extern __inline__ void atomic_inc(volatile atomic_t *v) | 71 | static inline void atomic_inc(volatile atomic_t *v) |
72 | { | 72 | { |
73 | unsigned long flags; | 73 | unsigned long flags; |
74 | cris_atomic_save(v, flags); | 74 | cris_atomic_save(v, flags); |
@@ -76,7 +76,7 @@ extern __inline__ void atomic_inc(volatile atomic_t *v) | |||
76 | cris_atomic_restore(v, flags); | 76 | cris_atomic_restore(v, flags); |
77 | } | 77 | } |
78 | 78 | ||
79 | extern __inline__ void atomic_dec(volatile atomic_t *v) | 79 | static inline void atomic_dec(volatile atomic_t *v) |
80 | { | 80 | { |
81 | unsigned long flags; | 81 | unsigned long flags; |
82 | cris_atomic_save(v, flags); | 82 | cris_atomic_save(v, flags); |
@@ -84,7 +84,7 @@ extern __inline__ void atomic_dec(volatile atomic_t *v) | |||
84 | cris_atomic_restore(v, flags); | 84 | cris_atomic_restore(v, flags); |
85 | } | 85 | } |
86 | 86 | ||
87 | extern __inline__ int atomic_inc_return(volatile atomic_t *v) | 87 | static inline int atomic_inc_return(volatile atomic_t *v) |
88 | { | 88 | { |
89 | unsigned long flags; | 89 | unsigned long flags; |
90 | int retval; | 90 | int retval; |
@@ -94,7 +94,7 @@ extern __inline__ int atomic_inc_return(volatile atomic_t *v) | |||
94 | return retval; | 94 | return retval; |
95 | } | 95 | } |
96 | 96 | ||
97 | extern __inline__ int atomic_dec_return(volatile atomic_t *v) | 97 | static inline int atomic_dec_return(volatile atomic_t *v) |
98 | { | 98 | { |
99 | unsigned long flags; | 99 | unsigned long flags; |
100 | int retval; | 100 | int retval; |
@@ -103,7 +103,7 @@ extern __inline__ int atomic_dec_return(volatile atomic_t *v) | |||
103 | cris_atomic_restore(v, flags); | 103 | cris_atomic_restore(v, flags); |
104 | return retval; | 104 | return retval; |
105 | } | 105 | } |
106 | extern __inline__ int atomic_dec_and_test(volatile atomic_t *v) | 106 | static inline int atomic_dec_and_test(volatile atomic_t *v) |
107 | { | 107 | { |
108 | int retval; | 108 | int retval; |
109 | unsigned long flags; | 109 | unsigned long flags; |
@@ -113,7 +113,7 @@ extern __inline__ int atomic_dec_and_test(volatile atomic_t *v) | |||
113 | return retval; | 113 | return retval; |
114 | } | 114 | } |
115 | 115 | ||
116 | extern __inline__ int atomic_inc_and_test(volatile atomic_t *v) | 116 | static inline int atomic_inc_and_test(volatile atomic_t *v) |
117 | { | 117 | { |
118 | int retval; | 118 | int retval; |
119 | unsigned long flags; | 119 | unsigned long flags; |
diff --git a/include/asm-cris/bitops.h b/include/asm-cris/bitops.h index e3da57f97964..1bddb3f3a289 100644 --- a/include/asm-cris/bitops.h +++ b/include/asm-cris/bitops.h | |||
@@ -89,7 +89,7 @@ struct __dummy { unsigned long a[100]; }; | |||
89 | * It also implies a memory barrier. | 89 | * It also implies a memory barrier. |
90 | */ | 90 | */ |
91 | 91 | ||
92 | extern inline int test_and_set_bit(int nr, volatile unsigned long *addr) | 92 | static inline int test_and_set_bit(int nr, volatile unsigned long *addr) |
93 | { | 93 | { |
94 | unsigned int mask, retval; | 94 | unsigned int mask, retval; |
95 | unsigned long flags; | 95 | unsigned long flags; |
@@ -105,7 +105,7 @@ extern inline int test_and_set_bit(int nr, volatile unsigned long *addr) | |||
105 | return retval; | 105 | return retval; |
106 | } | 106 | } |
107 | 107 | ||
108 | extern inline int __test_and_set_bit(int nr, volatile unsigned long *addr) | 108 | static inline int __test_and_set_bit(int nr, volatile unsigned long *addr) |
109 | { | 109 | { |
110 | unsigned int mask, retval; | 110 | unsigned int mask, retval; |
111 | unsigned int *adr = (unsigned int *)addr; | 111 | unsigned int *adr = (unsigned int *)addr; |
@@ -132,7 +132,7 @@ extern inline int __test_and_set_bit(int nr, volatile unsigned long *addr) | |||
132 | * It also implies a memory barrier. | 132 | * It also implies a memory barrier. |
133 | */ | 133 | */ |
134 | 134 | ||
135 | extern inline int test_and_clear_bit(int nr, volatile unsigned long *addr) | 135 | static inline int test_and_clear_bit(int nr, volatile unsigned long *addr) |
136 | { | 136 | { |
137 | unsigned int mask, retval; | 137 | unsigned int mask, retval; |
138 | unsigned long flags; | 138 | unsigned long flags; |
@@ -157,7 +157,7 @@ extern inline int test_and_clear_bit(int nr, volatile unsigned long *addr) | |||
157 | * but actually fail. You must protect multiple accesses with a lock. | 157 | * but actually fail. You must protect multiple accesses with a lock. |
158 | */ | 158 | */ |
159 | 159 | ||
160 | extern inline int __test_and_clear_bit(int nr, volatile unsigned long *addr) | 160 | static inline int __test_and_clear_bit(int nr, volatile unsigned long *addr) |
161 | { | 161 | { |
162 | unsigned int mask, retval; | 162 | unsigned int mask, retval; |
163 | unsigned int *adr = (unsigned int *)addr; | 163 | unsigned int *adr = (unsigned int *)addr; |
@@ -177,7 +177,7 @@ extern inline int __test_and_clear_bit(int nr, volatile unsigned long *addr) | |||
177 | * It also implies a memory barrier. | 177 | * It also implies a memory barrier. |
178 | */ | 178 | */ |
179 | 179 | ||
180 | extern inline int test_and_change_bit(int nr, volatile unsigned long *addr) | 180 | static inline int test_and_change_bit(int nr, volatile unsigned long *addr) |
181 | { | 181 | { |
182 | unsigned int mask, retval; | 182 | unsigned int mask, retval; |
183 | unsigned long flags; | 183 | unsigned long flags; |
@@ -193,7 +193,7 @@ extern inline int test_and_change_bit(int nr, volatile unsigned long *addr) | |||
193 | 193 | ||
194 | /* WARNING: non atomic and it can be reordered! */ | 194 | /* WARNING: non atomic and it can be reordered! */ |
195 | 195 | ||
196 | extern inline int __test_and_change_bit(int nr, volatile unsigned long *addr) | 196 | static inline int __test_and_change_bit(int nr, volatile unsigned long *addr) |
197 | { | 197 | { |
198 | unsigned int mask, retval; | 198 | unsigned int mask, retval; |
199 | unsigned int *adr = (unsigned int *)addr; | 199 | unsigned int *adr = (unsigned int *)addr; |
@@ -214,7 +214,7 @@ extern inline int __test_and_change_bit(int nr, volatile unsigned long *addr) | |||
214 | * This routine doesn't need to be atomic. | 214 | * This routine doesn't need to be atomic. |
215 | */ | 215 | */ |
216 | 216 | ||
217 | extern inline int test_bit(int nr, const volatile unsigned long *addr) | 217 | static inline int test_bit(int nr, const volatile unsigned long *addr) |
218 | { | 218 | { |
219 | unsigned int mask; | 219 | unsigned int mask; |
220 | unsigned int *adr = (unsigned int *)addr; | 220 | unsigned int *adr = (unsigned int *)addr; |
@@ -258,7 +258,7 @@ extern inline int test_bit(int nr, const volatile unsigned long *addr) | |||
258 | * @offset: The bitnumber to start searching at | 258 | * @offset: The bitnumber to start searching at |
259 | * @size: The maximum size to search | 259 | * @size: The maximum size to search |
260 | */ | 260 | */ |
261 | extern inline int find_next_zero_bit (const unsigned long * addr, int size, int offset) | 261 | static inline int find_next_zero_bit (const unsigned long * addr, int size, int offset) |
262 | { | 262 | { |
263 | unsigned long *p = ((unsigned long *) addr) + (offset >> 5); | 263 | unsigned long *p = ((unsigned long *) addr) + (offset >> 5); |
264 | unsigned long result = offset & ~31UL; | 264 | unsigned long result = offset & ~31UL; |
@@ -366,7 +366,7 @@ found_middle: | |||
366 | #define minix_test_bit(nr,addr) test_bit(nr,addr) | 366 | #define minix_test_bit(nr,addr) test_bit(nr,addr) |
367 | #define minix_find_first_zero_bit(addr,size) find_first_zero_bit(addr,size) | 367 | #define minix_find_first_zero_bit(addr,size) find_first_zero_bit(addr,size) |
368 | 368 | ||
369 | extern inline int sched_find_first_bit(const unsigned long *b) | 369 | static inline int sched_find_first_bit(const unsigned long *b) |
370 | { | 370 | { |
371 | if (unlikely(b[0])) | 371 | if (unlikely(b[0])) |
372 | return __ffs(b[0]); | 372 | return __ffs(b[0]); |
diff --git a/include/asm-cris/checksum.h b/include/asm-cris/checksum.h index 15ca8aec5c63..26a7719bbb84 100644 --- a/include/asm-cris/checksum.h +++ b/include/asm-cris/checksum.h | |||
@@ -34,7 +34,7 @@ unsigned int csum_partial_copy_nocheck(const char *src, char *dst, | |||
34 | * Fold a partial checksum into a word | 34 | * Fold a partial checksum into a word |
35 | */ | 35 | */ |
36 | 36 | ||
37 | extern inline unsigned int csum_fold(unsigned int sum) | 37 | static inline unsigned int csum_fold(unsigned int sum) |
38 | { | 38 | { |
39 | /* the while loop is unnecessary really, it's always enough with two | 39 | /* the while loop is unnecessary really, it's always enough with two |
40 | iterations */ | 40 | iterations */ |
@@ -55,7 +55,7 @@ extern unsigned int csum_partial_copy_from_user(const char *src, char *dst, | |||
55 | * | 55 | * |
56 | */ | 56 | */ |
57 | 57 | ||
58 | extern inline unsigned short ip_fast_csum(unsigned char * iph, | 58 | static inline unsigned short ip_fast_csum(unsigned char * iph, |
59 | unsigned int ihl) | 59 | unsigned int ihl) |
60 | { | 60 | { |
61 | return csum_fold(csum_partial(iph, ihl * 4, 0)); | 61 | return csum_fold(csum_partial(iph, ihl * 4, 0)); |
@@ -66,7 +66,7 @@ extern inline unsigned short ip_fast_csum(unsigned char * iph, | |||
66 | * returns a 16-bit checksum, already complemented | 66 | * returns a 16-bit checksum, already complemented |
67 | */ | 67 | */ |
68 | 68 | ||
69 | extern inline unsigned short int csum_tcpudp_magic(unsigned long saddr, | 69 | static inline unsigned short int csum_tcpudp_magic(unsigned long saddr, |
70 | unsigned long daddr, | 70 | unsigned long daddr, |
71 | unsigned short len, | 71 | unsigned short len, |
72 | unsigned short proto, | 72 | unsigned short proto, |
@@ -80,7 +80,7 @@ extern inline unsigned short int csum_tcpudp_magic(unsigned long saddr, | |||
80 | * in icmp.c | 80 | * in icmp.c |
81 | */ | 81 | */ |
82 | 82 | ||
83 | extern inline unsigned short ip_compute_csum(unsigned char * buff, int len) { | 83 | static inline unsigned short ip_compute_csum(unsigned char * buff, int len) { |
84 | return csum_fold (csum_partial(buff, len, 0)); | 84 | return csum_fold (csum_partial(buff, len, 0)); |
85 | } | 85 | } |
86 | 86 | ||
diff --git a/include/asm-cris/current.h b/include/asm-cris/current.h index dce69c99da39..5f5c0efd00be 100644 --- a/include/asm-cris/current.h +++ b/include/asm-cris/current.h | |||
@@ -5,7 +5,7 @@ | |||
5 | 5 | ||
6 | struct task_struct; | 6 | struct task_struct; |
7 | 7 | ||
8 | extern inline struct task_struct * get_current(void) | 8 | static inline struct task_struct * get_current(void) |
9 | { | 9 | { |
10 | return current_thread_info()->task; | 10 | return current_thread_info()->task; |
11 | } | 11 | } |
diff --git a/include/asm-cris/delay.h b/include/asm-cris/delay.h index efc41aad4845..d3a397803719 100644 --- a/include/asm-cris/delay.h +++ b/include/asm-cris/delay.h | |||
@@ -13,7 +13,7 @@ | |||
13 | 13 | ||
14 | extern unsigned long loops_per_usec; /* arch/cris/mm/init.c */ | 14 | extern unsigned long loops_per_usec; /* arch/cris/mm/init.c */ |
15 | 15 | ||
16 | extern __inline__ void udelay(unsigned long usecs) | 16 | static inline void udelay(unsigned long usecs) |
17 | { | 17 | { |
18 | __delay(usecs * loops_per_usec); | 18 | __delay(usecs * loops_per_usec); |
19 | } | 19 | } |
diff --git a/include/asm-cris/io.h b/include/asm-cris/io.h index 16e791b3c721..716c69bc58f8 100644 --- a/include/asm-cris/io.h +++ b/include/asm-cris/io.h | |||
@@ -23,12 +23,12 @@ extern struct cris_io_operations *cris_iops; | |||
23 | * Change virtual addresses to physical addresses and vv. | 23 | * Change virtual addresses to physical addresses and vv. |
24 | */ | 24 | */ |
25 | 25 | ||
26 | extern inline unsigned long virt_to_phys(volatile void * address) | 26 | static inline unsigned long virt_to_phys(volatile void * address) |
27 | { | 27 | { |
28 | return __pa(address); | 28 | return __pa(address); |
29 | } | 29 | } |
30 | 30 | ||
31 | extern inline void * phys_to_virt(unsigned long address) | 31 | static inline void * phys_to_virt(unsigned long address) |
32 | { | 32 | { |
33 | return __va(address); | 33 | return __va(address); |
34 | } | 34 | } |
@@ -36,7 +36,7 @@ extern inline void * phys_to_virt(unsigned long address) | |||
36 | extern void __iomem * __ioremap(unsigned long offset, unsigned long size, unsigned long flags); | 36 | extern void __iomem * __ioremap(unsigned long offset, unsigned long size, unsigned long flags); |
37 | extern void __iomem * __ioremap_prot(unsigned long phys_addr, unsigned long size, pgprot_t prot); | 37 | extern void __iomem * __ioremap_prot(unsigned long phys_addr, unsigned long size, pgprot_t prot); |
38 | 38 | ||
39 | extern inline void __iomem * ioremap (unsigned long offset, unsigned long size) | 39 | static inline void __iomem * ioremap (unsigned long offset, unsigned long size) |
40 | { | 40 | { |
41 | return __ioremap(offset, size, 0); | 41 | return __ioremap(offset, size, 0); |
42 | } | 42 | } |
diff --git a/include/asm-cris/irq.h b/include/asm-cris/irq.h index 4fab5c3b2e15..4b338792218b 100644 --- a/include/asm-cris/irq.h +++ b/include/asm-cris/irq.h | |||
@@ -8,7 +8,7 @@ | |||
8 | 8 | ||
9 | #include <asm/arch/irq.h> | 9 | #include <asm/arch/irq.h> |
10 | 10 | ||
11 | extern __inline__ int irq_canonicalize(int irq) | 11 | static inline int irq_canonicalize(int irq) |
12 | { | 12 | { |
13 | return irq; | 13 | return irq; |
14 | } | 14 | } |
diff --git a/include/asm-cris/pgalloc.h b/include/asm-cris/pgalloc.h index a131776edf41..deaddfe79bbc 100644 --- a/include/asm-cris/pgalloc.h +++ b/include/asm-cris/pgalloc.h | |||
@@ -11,35 +11,35 @@ | |||
11 | * Allocate and free page tables. | 11 | * Allocate and free page tables. |
12 | */ | 12 | */ |
13 | 13 | ||
14 | extern inline pgd_t *pgd_alloc (struct mm_struct *mm) | 14 | static inline pgd_t *pgd_alloc (struct mm_struct *mm) |
15 | { | 15 | { |
16 | return (pgd_t *)get_zeroed_page(GFP_KERNEL); | 16 | return (pgd_t *)get_zeroed_page(GFP_KERNEL); |
17 | } | 17 | } |
18 | 18 | ||
19 | extern inline void pgd_free (pgd_t *pgd) | 19 | static inline void pgd_free (pgd_t *pgd) |
20 | { | 20 | { |
21 | free_page((unsigned long)pgd); | 21 | free_page((unsigned long)pgd); |
22 | } | 22 | } |
23 | 23 | ||
24 | extern inline pte_t *pte_alloc_one_kernel(struct mm_struct *mm, unsigned long address) | 24 | static inline pte_t *pte_alloc_one_kernel(struct mm_struct *mm, unsigned long address) |
25 | { | 25 | { |
26 | pte_t *pte = (pte_t *)__get_free_page(GFP_KERNEL|__GFP_REPEAT|__GFP_ZERO); | 26 | pte_t *pte = (pte_t *)__get_free_page(GFP_KERNEL|__GFP_REPEAT|__GFP_ZERO); |
27 | return pte; | 27 | return pte; |
28 | } | 28 | } |
29 | 29 | ||
30 | extern inline struct page *pte_alloc_one(struct mm_struct *mm, unsigned long address) | 30 | static inline struct page *pte_alloc_one(struct mm_struct *mm, unsigned long address) |
31 | { | 31 | { |
32 | struct page *pte; | 32 | struct page *pte; |
33 | pte = alloc_pages(GFP_KERNEL|__GFP_REPEAT|__GFP_ZERO, 0); | 33 | pte = alloc_pages(GFP_KERNEL|__GFP_REPEAT|__GFP_ZERO, 0); |
34 | return pte; | 34 | return pte; |
35 | } | 35 | } |
36 | 36 | ||
37 | extern inline void pte_free_kernel(pte_t *pte) | 37 | static inline void pte_free_kernel(pte_t *pte) |
38 | { | 38 | { |
39 | free_page((unsigned long)pte); | 39 | free_page((unsigned long)pte); |
40 | } | 40 | } |
41 | 41 | ||
42 | extern inline void pte_free(struct page *pte) | 42 | static inline void pte_free(struct page *pte) |
43 | { | 43 | { |
44 | __free_page(pte); | 44 | __free_page(pte); |
45 | } | 45 | } |
diff --git a/include/asm-cris/pgtable.h b/include/asm-cris/pgtable.h index a9143bed99db..70a832514f62 100644 --- a/include/asm-cris/pgtable.h +++ b/include/asm-cris/pgtable.h | |||
@@ -112,44 +112,44 @@ extern unsigned long empty_zero_page; | |||
112 | * Undefined behaviour if not.. | 112 | * Undefined behaviour if not.. |
113 | */ | 113 | */ |
114 | 114 | ||
115 | extern inline int pte_read(pte_t pte) { return pte_val(pte) & _PAGE_READ; } | 115 | static inline int pte_read(pte_t pte) { return pte_val(pte) & _PAGE_READ; } |
116 | extern inline int pte_write(pte_t pte) { return pte_val(pte) & _PAGE_WRITE; } | 116 | static inline int pte_write(pte_t pte) { return pte_val(pte) & _PAGE_WRITE; } |
117 | extern inline int pte_exec(pte_t pte) { return pte_val(pte) & _PAGE_READ; } | 117 | static inline int pte_exec(pte_t pte) { return pte_val(pte) & _PAGE_READ; } |
118 | extern inline int pte_dirty(pte_t pte) { return pte_val(pte) & _PAGE_MODIFIED; } | 118 | static inline int pte_dirty(pte_t pte) { return pte_val(pte) & _PAGE_MODIFIED; } |
119 | extern inline int pte_young(pte_t pte) { return pte_val(pte) & _PAGE_ACCESSED; } | 119 | static inline int pte_young(pte_t pte) { return pte_val(pte) & _PAGE_ACCESSED; } |
120 | extern inline int pte_file(pte_t pte) { return pte_val(pte) & _PAGE_FILE; } | 120 | static inline int pte_file(pte_t pte) { return pte_val(pte) & _PAGE_FILE; } |
121 | 121 | ||
122 | extern inline pte_t pte_wrprotect(pte_t pte) | 122 | static inline pte_t pte_wrprotect(pte_t pte) |
123 | { | 123 | { |
124 | pte_val(pte) &= ~(_PAGE_WRITE | _PAGE_SILENT_WRITE); | 124 | pte_val(pte) &= ~(_PAGE_WRITE | _PAGE_SILENT_WRITE); |
125 | return pte; | 125 | return pte; |
126 | } | 126 | } |
127 | 127 | ||
128 | extern inline pte_t pte_rdprotect(pte_t pte) | 128 | static inline pte_t pte_rdprotect(pte_t pte) |
129 | { | 129 | { |
130 | pte_val(pte) &= ~(_PAGE_READ | _PAGE_SILENT_READ); | 130 | pte_val(pte) &= ~(_PAGE_READ | _PAGE_SILENT_READ); |
131 | return pte; | 131 | return pte; |
132 | } | 132 | } |
133 | 133 | ||
134 | extern inline pte_t pte_exprotect(pte_t pte) | 134 | static inline pte_t pte_exprotect(pte_t pte) |
135 | { | 135 | { |
136 | pte_val(pte) &= ~(_PAGE_READ | _PAGE_SILENT_READ); | 136 | pte_val(pte) &= ~(_PAGE_READ | _PAGE_SILENT_READ); |
137 | return pte; | 137 | return pte; |
138 | } | 138 | } |
139 | 139 | ||
140 | extern inline pte_t pte_mkclean(pte_t pte) | 140 | static inline pte_t pte_mkclean(pte_t pte) |
141 | { | 141 | { |
142 | pte_val(pte) &= ~(_PAGE_MODIFIED | _PAGE_SILENT_WRITE); | 142 | pte_val(pte) &= ~(_PAGE_MODIFIED | _PAGE_SILENT_WRITE); |
143 | return pte; | 143 | return pte; |
144 | } | 144 | } |
145 | 145 | ||
146 | extern inline pte_t pte_mkold(pte_t pte) | 146 | static inline pte_t pte_mkold(pte_t pte) |
147 | { | 147 | { |
148 | pte_val(pte) &= ~(_PAGE_ACCESSED | _PAGE_SILENT_READ); | 148 | pte_val(pte) &= ~(_PAGE_ACCESSED | _PAGE_SILENT_READ); |
149 | return pte; | 149 | return pte; |
150 | } | 150 | } |
151 | 151 | ||
152 | extern inline pte_t pte_mkwrite(pte_t pte) | 152 | static inline pte_t pte_mkwrite(pte_t pte) |
153 | { | 153 | { |
154 | pte_val(pte) |= _PAGE_WRITE; | 154 | pte_val(pte) |= _PAGE_WRITE; |
155 | if (pte_val(pte) & _PAGE_MODIFIED) | 155 | if (pte_val(pte) & _PAGE_MODIFIED) |
@@ -157,7 +157,7 @@ extern inline pte_t pte_mkwrite(pte_t pte) | |||
157 | return pte; | 157 | return pte; |
158 | } | 158 | } |
159 | 159 | ||
160 | extern inline pte_t pte_mkread(pte_t pte) | 160 | static inline pte_t pte_mkread(pte_t pte) |
161 | { | 161 | { |
162 | pte_val(pte) |= _PAGE_READ; | 162 | pte_val(pte) |= _PAGE_READ; |
163 | if (pte_val(pte) & _PAGE_ACCESSED) | 163 | if (pte_val(pte) & _PAGE_ACCESSED) |
@@ -165,7 +165,7 @@ extern inline pte_t pte_mkread(pte_t pte) | |||
165 | return pte; | 165 | return pte; |
166 | } | 166 | } |
167 | 167 | ||
168 | extern inline pte_t pte_mkexec(pte_t pte) | 168 | static inline pte_t pte_mkexec(pte_t pte) |
169 | { | 169 | { |
170 | pte_val(pte) |= _PAGE_READ; | 170 | pte_val(pte) |= _PAGE_READ; |
171 | if (pte_val(pte) & _PAGE_ACCESSED) | 171 | if (pte_val(pte) & _PAGE_ACCESSED) |
@@ -173,7 +173,7 @@ extern inline pte_t pte_mkexec(pte_t pte) | |||
173 | return pte; | 173 | return pte; |
174 | } | 174 | } |
175 | 175 | ||
176 | extern inline pte_t pte_mkdirty(pte_t pte) | 176 | static inline pte_t pte_mkdirty(pte_t pte) |
177 | { | 177 | { |
178 | pte_val(pte) |= _PAGE_MODIFIED; | 178 | pte_val(pte) |= _PAGE_MODIFIED; |
179 | if (pte_val(pte) & _PAGE_WRITE) | 179 | if (pte_val(pte) & _PAGE_WRITE) |
@@ -181,7 +181,7 @@ extern inline pte_t pte_mkdirty(pte_t pte) | |||
181 | return pte; | 181 | return pte; |
182 | } | 182 | } |
183 | 183 | ||
184 | extern inline pte_t pte_mkyoung(pte_t pte) | 184 | static inline pte_t pte_mkyoung(pte_t pte) |
185 | { | 185 | { |
186 | pte_val(pte) |= _PAGE_ACCESSED; | 186 | pte_val(pte) |= _PAGE_ACCESSED; |
187 | if (pte_val(pte) & _PAGE_READ) | 187 | if (pte_val(pte) & _PAGE_READ) |
@@ -205,7 +205,7 @@ extern inline pte_t pte_mkyoung(pte_t pte) | |||
205 | * addresses (the 0xc0xxxxxx's) goes as void *'s. | 205 | * addresses (the 0xc0xxxxxx's) goes as void *'s. |
206 | */ | 206 | */ |
207 | 207 | ||
208 | extern inline pte_t __mk_pte(void * page, pgprot_t pgprot) | 208 | static inline pte_t __mk_pte(void * page, pgprot_t pgprot) |
209 | { | 209 | { |
210 | pte_t pte; | 210 | pte_t pte; |
211 | /* the PTE needs a physical address */ | 211 | /* the PTE needs a physical address */ |
@@ -223,7 +223,7 @@ extern inline pte_t __mk_pte(void * page, pgprot_t pgprot) | |||
223 | __pte; \ | 223 | __pte; \ |
224 | }) | 224 | }) |
225 | 225 | ||
226 | extern inline pte_t pte_modify(pte_t pte, pgprot_t newprot) | 226 | static inline pte_t pte_modify(pte_t pte, pgprot_t newprot) |
227 | { pte_val(pte) = (pte_val(pte) & _PAGE_CHG_MASK) | pgprot_val(newprot); return pte; } | 227 | { pte_val(pte) = (pte_val(pte) & _PAGE_CHG_MASK) | pgprot_val(newprot); return pte; } |
228 | 228 | ||
229 | 229 | ||
@@ -232,7 +232,7 @@ extern inline pte_t pte_modify(pte_t pte, pgprot_t newprot) | |||
232 | * pte_pagenr refers to the page-number counted starting from the virtual DRAM start | 232 | * pte_pagenr refers to the page-number counted starting from the virtual DRAM start |
233 | */ | 233 | */ |
234 | 234 | ||
235 | extern inline unsigned long __pte_page(pte_t pte) | 235 | static inline unsigned long __pte_page(pte_t pte) |
236 | { | 236 | { |
237 | /* the PTE contains a physical address */ | 237 | /* the PTE contains a physical address */ |
238 | return (unsigned long)__va(pte_val(pte) & PAGE_MASK); | 238 | return (unsigned long)__va(pte_val(pte) & PAGE_MASK); |
@@ -250,7 +250,7 @@ extern inline unsigned long __pte_page(pte_t pte) | |||
250 | * don't need the __pa and __va transformations. | 250 | * don't need the __pa and __va transformations. |
251 | */ | 251 | */ |
252 | 252 | ||
253 | extern inline void pmd_set(pmd_t * pmdp, pte_t * ptep) | 253 | static inline void pmd_set(pmd_t * pmdp, pte_t * ptep) |
254 | { pmd_val(*pmdp) = _PAGE_TABLE | (unsigned long) ptep; } | 254 | { pmd_val(*pmdp) = _PAGE_TABLE | (unsigned long) ptep; } |
255 | 255 | ||
256 | #define pmd_page(pmd) (pfn_to_page(pmd_val(pmd) >> PAGE_SHIFT)) | 256 | #define pmd_page(pmd) (pfn_to_page(pmd_val(pmd) >> PAGE_SHIFT)) |
@@ -260,7 +260,7 @@ extern inline void pmd_set(pmd_t * pmdp, pte_t * ptep) | |||
260 | #define pgd_index(address) (((address) >> PGDIR_SHIFT) & (PTRS_PER_PGD-1)) | 260 | #define pgd_index(address) (((address) >> PGDIR_SHIFT) & (PTRS_PER_PGD-1)) |
261 | 261 | ||
262 | /* to find an entry in a page-table-directory */ | 262 | /* to find an entry in a page-table-directory */ |
263 | extern inline pgd_t * pgd_offset(struct mm_struct * mm, unsigned long address) | 263 | static inline pgd_t * pgd_offset(struct mm_struct * mm, unsigned long address) |
264 | { | 264 | { |
265 | return mm->pgd + pgd_index(address); | 265 | return mm->pgd + pgd_index(address); |
266 | } | 266 | } |
@@ -296,7 +296,7 @@ extern pgd_t swapper_pg_dir[PTRS_PER_PGD]; /* defined in head.S */ | |||
296 | * | 296 | * |
297 | * Actually I am not sure on what this could be used for. | 297 | * Actually I am not sure on what this could be used for. |
298 | */ | 298 | */ |
299 | extern inline void update_mmu_cache(struct vm_area_struct * vma, | 299 | static inline void update_mmu_cache(struct vm_area_struct * vma, |
300 | unsigned long address, pte_t pte) | 300 | unsigned long address, pte_t pte) |
301 | { | 301 | { |
302 | } | 302 | } |
diff --git a/include/asm-cris/processor.h b/include/asm-cris/processor.h index 0dc218117bd8..dce41009eeb0 100644 --- a/include/asm-cris/processor.h +++ b/include/asm-cris/processor.h | |||
@@ -16,6 +16,8 @@ | |||
16 | #include <asm/ptrace.h> | 16 | #include <asm/ptrace.h> |
17 | #include <asm/arch/processor.h> | 17 | #include <asm/arch/processor.h> |
18 | 18 | ||
19 | struct task_struct; | ||
20 | |||
19 | /* This decides where the kernel will search for a free chunk of vm | 21 | /* This decides where the kernel will search for a free chunk of vm |
20 | * space during mmap's. | 22 | * space during mmap's. |
21 | */ | 23 | */ |
@@ -45,7 +47,7 @@ | |||
45 | 47 | ||
46 | #define current_regs() user_regs(current->thread_info) | 48 | #define current_regs() user_regs(current->thread_info) |
47 | 49 | ||
48 | extern inline void prepare_to_copy(struct task_struct *tsk) | 50 | static inline void prepare_to_copy(struct task_struct *tsk) |
49 | { | 51 | { |
50 | } | 52 | } |
51 | 53 | ||
@@ -58,7 +60,7 @@ unsigned long get_wchan(struct task_struct *p); | |||
58 | extern unsigned long thread_saved_pc(struct task_struct *tsk); | 60 | extern unsigned long thread_saved_pc(struct task_struct *tsk); |
59 | 61 | ||
60 | /* Free all resources held by a thread. */ | 62 | /* Free all resources held by a thread. */ |
61 | extern inline void release_thread(struct task_struct *dead_task) | 63 | static inline void release_thread(struct task_struct *dead_task) |
62 | { | 64 | { |
63 | /* Nothing needs to be done. */ | 65 | /* Nothing needs to be done. */ |
64 | } | 66 | } |
diff --git a/include/asm-cris/semaphore.h b/include/asm-cris/semaphore.h index 39faf69bcf76..53f548b791c1 100644 --- a/include/asm-cris/semaphore.h +++ b/include/asm-cris/semaphore.h | |||
@@ -18,8 +18,6 @@ | |||
18 | * CRIS semaphores, implemented in C-only so far. | 18 | * CRIS semaphores, implemented in C-only so far. |
19 | */ | 19 | */ |
20 | 20 | ||
21 | int printk(const char *fmt, ...); | ||
22 | |||
23 | struct semaphore { | 21 | struct semaphore { |
24 | atomic_t count; | 22 | atomic_t count; |
25 | atomic_t waking; | 23 | atomic_t waking; |
@@ -39,17 +37,17 @@ struct semaphore { | |||
39 | #define DECLARE_MUTEX(name) __DECLARE_SEMAPHORE_GENERIC(name,1) | 37 | #define DECLARE_MUTEX(name) __DECLARE_SEMAPHORE_GENERIC(name,1) |
40 | #define DECLARE_MUTEX_LOCKED(name) __DECLARE_SEMAPHORE_GENERIC(name,0) | 38 | #define DECLARE_MUTEX_LOCKED(name) __DECLARE_SEMAPHORE_GENERIC(name,0) |
41 | 39 | ||
42 | extern inline void sema_init(struct semaphore *sem, int val) | 40 | static inline void sema_init(struct semaphore *sem, int val) |
43 | { | 41 | { |
44 | *sem = (struct semaphore)__SEMAPHORE_INITIALIZER((*sem),val); | 42 | *sem = (struct semaphore)__SEMAPHORE_INITIALIZER((*sem),val); |
45 | } | 43 | } |
46 | 44 | ||
47 | extern inline void init_MUTEX (struct semaphore *sem) | 45 | static inline void init_MUTEX (struct semaphore *sem) |
48 | { | 46 | { |
49 | sema_init(sem, 1); | 47 | sema_init(sem, 1); |
50 | } | 48 | } |
51 | 49 | ||
52 | extern inline void init_MUTEX_LOCKED (struct semaphore *sem) | 50 | static inline void init_MUTEX_LOCKED (struct semaphore *sem) |
53 | { | 51 | { |
54 | sema_init(sem, 0); | 52 | sema_init(sem, 0); |
55 | } | 53 | } |
@@ -61,7 +59,7 @@ extern void __up(struct semaphore * sem); | |||
61 | 59 | ||
62 | /* notice - we probably can do cli/sti here instead of saving */ | 60 | /* notice - we probably can do cli/sti here instead of saving */ |
63 | 61 | ||
64 | extern inline void down(struct semaphore * sem) | 62 | static inline void down(struct semaphore * sem) |
65 | { | 63 | { |
66 | unsigned long flags; | 64 | unsigned long flags; |
67 | int failed; | 65 | int failed; |
@@ -83,7 +81,7 @@ extern inline void down(struct semaphore * sem) | |||
83 | * returns negative for signalled and zero for semaphore acquired. | 81 | * returns negative for signalled and zero for semaphore acquired. |
84 | */ | 82 | */ |
85 | 83 | ||
86 | extern inline int down_interruptible(struct semaphore * sem) | 84 | static inline int down_interruptible(struct semaphore * sem) |
87 | { | 85 | { |
88 | unsigned long flags; | 86 | unsigned long flags; |
89 | int failed; | 87 | int failed; |
@@ -99,7 +97,7 @@ extern inline int down_interruptible(struct semaphore * sem) | |||
99 | return(failed); | 97 | return(failed); |
100 | } | 98 | } |
101 | 99 | ||
102 | extern inline int down_trylock(struct semaphore * sem) | 100 | static inline int down_trylock(struct semaphore * sem) |
103 | { | 101 | { |
104 | unsigned long flags; | 102 | unsigned long flags; |
105 | int failed; | 103 | int failed; |
@@ -119,7 +117,7 @@ extern inline int down_trylock(struct semaphore * sem) | |||
119 | * The default case (no contention) will result in NO | 117 | * The default case (no contention) will result in NO |
120 | * jumps for both down() and up(). | 118 | * jumps for both down() and up(). |
121 | */ | 119 | */ |
122 | extern inline void up(struct semaphore * sem) | 120 | static inline void up(struct semaphore * sem) |
123 | { | 121 | { |
124 | unsigned long flags; | 122 | unsigned long flags; |
125 | int wakeup; | 123 | int wakeup; |
diff --git a/include/asm-cris/system.h b/include/asm-cris/system.h index e06739806d4e..d48670107a85 100644 --- a/include/asm-cris/system.h +++ b/include/asm-cris/system.h | |||
@@ -41,7 +41,7 @@ extern struct task_struct *resume(struct task_struct *prev, struct task_struct * | |||
41 | void disable_hlt(void); | 41 | void disable_hlt(void); |
42 | void enable_hlt(void); | 42 | void enable_hlt(void); |
43 | 43 | ||
44 | extern inline unsigned long __xchg(unsigned long x, volatile void * ptr, int size) | 44 | static inline unsigned long __xchg(unsigned long x, volatile void * ptr, int size) |
45 | { | 45 | { |
46 | /* since Etrax doesn't have any atomic xchg instructions, we need to disable | 46 | /* since Etrax doesn't have any atomic xchg instructions, we need to disable |
47 | irq's (if enabled) and do it with move.d's */ | 47 | irq's (if enabled) and do it with move.d's */ |
diff --git a/include/asm-cris/timex.h b/include/asm-cris/timex.h index 3fb069a37717..b92e0e80fe86 100644 --- a/include/asm-cris/timex.h +++ b/include/asm-cris/timex.h | |||
@@ -16,7 +16,7 @@ | |||
16 | 16 | ||
17 | typedef unsigned long long cycles_t; | 17 | typedef unsigned long long cycles_t; |
18 | 18 | ||
19 | extern inline cycles_t get_cycles(void) | 19 | static inline cycles_t get_cycles(void) |
20 | { | 20 | { |
21 | return 0; | 21 | return 0; |
22 | } | 22 | } |
diff --git a/include/asm-cris/tlbflush.h b/include/asm-cris/tlbflush.h index 6ed7d9ae90db..c52238005b55 100644 --- a/include/asm-cris/tlbflush.h +++ b/include/asm-cris/tlbflush.h | |||
@@ -39,14 +39,14 @@ static inline void flush_tlb_range(struct vm_area_struct * vma, unsigned long st | |||
39 | flush_tlb_mm(vma->vm_mm); | 39 | flush_tlb_mm(vma->vm_mm); |
40 | } | 40 | } |
41 | 41 | ||
42 | extern inline void flush_tlb_pgtables(struct mm_struct *mm, | 42 | static inline void flush_tlb_pgtables(struct mm_struct *mm, |
43 | unsigned long start, unsigned long end) | 43 | unsigned long start, unsigned long end) |
44 | { | 44 | { |
45 | /* CRIS does not keep any page table caches in TLB */ | 45 | /* CRIS does not keep any page table caches in TLB */ |
46 | } | 46 | } |
47 | 47 | ||
48 | 48 | ||
49 | extern inline void flush_tlb(void) | 49 | static inline void flush_tlb(void) |
50 | { | 50 | { |
51 | flush_tlb_mm(current->mm); | 51 | flush_tlb_mm(current->mm); |
52 | } | 52 | } |
diff --git a/include/asm-cris/uaccess.h b/include/asm-cris/uaccess.h index 7d50086eb5ea..69d48a2dc8e1 100644 --- a/include/asm-cris/uaccess.h +++ b/include/asm-cris/uaccess.h | |||
@@ -213,7 +213,7 @@ extern unsigned long __copy_user(void *to, const void *from, unsigned long n); | |||
213 | extern unsigned long __copy_user_zeroing(void *to, const void *from, unsigned long n); | 213 | extern unsigned long __copy_user_zeroing(void *to, const void *from, unsigned long n); |
214 | extern unsigned long __do_clear_user(void *to, unsigned long n); | 214 | extern unsigned long __do_clear_user(void *to, unsigned long n); |
215 | 215 | ||
216 | extern inline unsigned long | 216 | static inline unsigned long |
217 | __generic_copy_to_user(void __user *to, const void *from, unsigned long n) | 217 | __generic_copy_to_user(void __user *to, const void *from, unsigned long n) |
218 | { | 218 | { |
219 | if (access_ok(VERIFY_WRITE, to, n)) | 219 | if (access_ok(VERIFY_WRITE, to, n)) |
@@ -221,7 +221,7 @@ __generic_copy_to_user(void __user *to, const void *from, unsigned long n) | |||
221 | return n; | 221 | return n; |
222 | } | 222 | } |
223 | 223 | ||
224 | extern inline unsigned long | 224 | static inline unsigned long |
225 | __generic_copy_from_user(void *to, const void __user *from, unsigned long n) | 225 | __generic_copy_from_user(void *to, const void __user *from, unsigned long n) |
226 | { | 226 | { |
227 | if (access_ok(VERIFY_READ, from, n)) | 227 | if (access_ok(VERIFY_READ, from, n)) |
@@ -229,7 +229,7 @@ __generic_copy_from_user(void *to, const void __user *from, unsigned long n) | |||
229 | return n; | 229 | return n; |
230 | } | 230 | } |
231 | 231 | ||
232 | extern inline unsigned long | 232 | static inline unsigned long |
233 | __generic_clear_user(void __user *to, unsigned long n) | 233 | __generic_clear_user(void __user *to, unsigned long n) |
234 | { | 234 | { |
235 | if (access_ok(VERIFY_WRITE, to, n)) | 235 | if (access_ok(VERIFY_WRITE, to, n)) |
@@ -237,13 +237,13 @@ __generic_clear_user(void __user *to, unsigned long n) | |||
237 | return n; | 237 | return n; |
238 | } | 238 | } |
239 | 239 | ||
240 | extern inline long | 240 | static inline long |
241 | __strncpy_from_user(char *dst, const char __user *src, long count) | 241 | __strncpy_from_user(char *dst, const char __user *src, long count) |
242 | { | 242 | { |
243 | return __do_strncpy_from_user(dst, src, count); | 243 | return __do_strncpy_from_user(dst, src, count); |
244 | } | 244 | } |
245 | 245 | ||
246 | extern inline long | 246 | static inline long |
247 | strncpy_from_user(char *dst, const char __user *src, long count) | 247 | strncpy_from_user(char *dst, const char __user *src, long count) |
248 | { | 248 | { |
249 | long res = -EFAULT; | 249 | long res = -EFAULT; |
@@ -256,7 +256,7 @@ strncpy_from_user(char *dst, const char __user *src, long count) | |||
256 | /* Note that if these expand awfully if made into switch constructs, so | 256 | /* Note that if these expand awfully if made into switch constructs, so |
257 | don't do that. */ | 257 | don't do that. */ |
258 | 258 | ||
259 | extern inline unsigned long | 259 | static inline unsigned long |
260 | __constant_copy_from_user(void *to, const void __user *from, unsigned long n) | 260 | __constant_copy_from_user(void *to, const void __user *from, unsigned long n) |
261 | { | 261 | { |
262 | unsigned long ret = 0; | 262 | unsigned long ret = 0; |
@@ -306,7 +306,7 @@ __constant_copy_from_user(void *to, const void __user *from, unsigned long n) | |||
306 | 306 | ||
307 | /* Ditto, don't make a switch out of this. */ | 307 | /* Ditto, don't make a switch out of this. */ |
308 | 308 | ||
309 | extern inline unsigned long | 309 | static inline unsigned long |
310 | __constant_copy_to_user(void __user *to, const void *from, unsigned long n) | 310 | __constant_copy_to_user(void __user *to, const void *from, unsigned long n) |
311 | { | 311 | { |
312 | unsigned long ret = 0; | 312 | unsigned long ret = 0; |
@@ -356,7 +356,7 @@ __constant_copy_to_user(void __user *to, const void *from, unsigned long n) | |||
356 | 356 | ||
357 | /* No switch, please. */ | 357 | /* No switch, please. */ |
358 | 358 | ||
359 | extern inline unsigned long | 359 | static inline unsigned long |
360 | __constant_clear_user(void __user *to, unsigned long n) | 360 | __constant_clear_user(void __user *to, unsigned long n) |
361 | { | 361 | { |
362 | unsigned long ret = 0; | 362 | unsigned long ret = 0; |
@@ -406,19 +406,19 @@ __constant_clear_user(void __user *to, unsigned long n) | |||
406 | * used in fast paths and have only a small space overhead. | 406 | * used in fast paths and have only a small space overhead. |
407 | */ | 407 | */ |
408 | 408 | ||
409 | extern inline unsigned long | 409 | static inline unsigned long |
410 | __generic_copy_from_user_nocheck(void *to, const void *from, unsigned long n) | 410 | __generic_copy_from_user_nocheck(void *to, const void *from, unsigned long n) |
411 | { | 411 | { |
412 | return __copy_user_zeroing(to,from,n); | 412 | return __copy_user_zeroing(to,from,n); |
413 | } | 413 | } |
414 | 414 | ||
415 | extern inline unsigned long | 415 | static inline unsigned long |
416 | __generic_copy_to_user_nocheck(void *to, const void *from, unsigned long n) | 416 | __generic_copy_to_user_nocheck(void *to, const void *from, unsigned long n) |
417 | { | 417 | { |
418 | return __copy_user(to,from,n); | 418 | return __copy_user(to,from,n); |
419 | } | 419 | } |
420 | 420 | ||
421 | extern inline unsigned long | 421 | static inline unsigned long |
422 | __generic_clear_user_nocheck(void *to, unsigned long n) | 422 | __generic_clear_user_nocheck(void *to, unsigned long n) |
423 | { | 423 | { |
424 | return __do_clear_user(to,n); | 424 | return __do_clear_user(to,n); |
diff --git a/include/asm-cris/unistd.h b/include/asm-cris/unistd.h index 156a34bfc583..2627bbdf8a11 100644 --- a/include/asm-cris/unistd.h +++ b/include/asm-cris/unistd.h | |||
@@ -343,14 +343,14 @@ | |||
343 | * some others too. | 343 | * some others too. |
344 | */ | 344 | */ |
345 | #define __NR__exit __NR_exit | 345 | #define __NR__exit __NR_exit |
346 | extern inline _syscall0(pid_t,setsid) | 346 | static inline _syscall0(pid_t,setsid) |
347 | extern inline _syscall3(int,write,int,fd,const char *,buf,off_t,count) | 347 | static inline _syscall3(int,write,int,fd,const char *,buf,off_t,count) |
348 | extern inline _syscall3(int,read,int,fd,char *,buf,off_t,count) | 348 | static inline _syscall3(int,read,int,fd,char *,buf,off_t,count) |
349 | extern inline _syscall3(off_t,lseek,int,fd,off_t,offset,int,count) | 349 | static inline _syscall3(off_t,lseek,int,fd,off_t,offset,int,count) |
350 | extern inline _syscall1(int,dup,int,fd) | 350 | static inline _syscall1(int,dup,int,fd) |
351 | extern inline _syscall3(int,execve,const char *,file,char **,argv,char **,envp) | 351 | static inline _syscall3(int,execve,const char *,file,char **,argv,char **,envp) |
352 | extern inline _syscall3(int,open,const char *,file,int,flag,int,mode) | 352 | static inline _syscall3(int,open,const char *,file,int,flag,int,mode) |
353 | extern inline _syscall1(int,close,int,fd) | 353 | static inline _syscall1(int,close,int,fd) |
354 | 354 | ||
355 | struct pt_regs; | 355 | struct pt_regs; |
356 | asmlinkage long sys_mmap2( | 356 | asmlinkage long sys_mmap2( |
@@ -382,8 +382,8 @@ asmlinkage long sys_rt_sigaction(int sig, | |||
382 | #ifdef __KERNEL__ | 382 | #ifdef __KERNEL__ |
383 | #define _exit kernel_syscall_exit | 383 | #define _exit kernel_syscall_exit |
384 | #endif | 384 | #endif |
385 | extern inline _syscall1(int,_exit,int,exitcode) | 385 | static inline _syscall1(int,_exit,int,exitcode) |
386 | extern inline _syscall3(pid_t,waitpid,pid_t,pid,int *,wait_stat,int,options) | 386 | static inline _syscall3(pid_t,waitpid,pid_t,pid,int *,wait_stat,int,options) |
387 | #endif | 387 | #endif |
388 | 388 | ||
389 | 389 | ||
diff --git a/include/asm-frv/pgtable.h b/include/asm-frv/pgtable.h index b247e99dff49..844666377dcb 100644 --- a/include/asm-frv/pgtable.h +++ b/include/asm-frv/pgtable.h | |||
@@ -26,6 +26,8 @@ | |||
26 | #include <linux/slab.h> | 26 | #include <linux/slab.h> |
27 | #include <linux/list.h> | 27 | #include <linux/list.h> |
28 | #include <linux/spinlock.h> | 28 | #include <linux/spinlock.h> |
29 | struct mm_struct; | ||
30 | struct vm_area_struct; | ||
29 | #endif | 31 | #endif |
30 | 32 | ||
31 | #ifndef __ASSEMBLY__ | 33 | #ifndef __ASSEMBLY__ |
diff --git a/include/asm-generic/pgtable.h b/include/asm-generic/pgtable.h index 7dca30a26c53..358e4d309ceb 100644 --- a/include/asm-generic/pgtable.h +++ b/include/asm-generic/pgtable.h | |||
@@ -128,6 +128,7 @@ do { \ | |||
128 | #endif | 128 | #endif |
129 | 129 | ||
130 | #ifndef __HAVE_ARCH_PTEP_SET_WRPROTECT | 130 | #ifndef __HAVE_ARCH_PTEP_SET_WRPROTECT |
131 | struct mm_struct; | ||
131 | static inline void ptep_set_wrprotect(struct mm_struct *mm, unsigned long address, pte_t *ptep) | 132 | static inline void ptep_set_wrprotect(struct mm_struct *mm, unsigned long address, pte_t *ptep) |
132 | { | 133 | { |
133 | pte_t old_pte = *ptep; | 134 | pte_t old_pte = *ptep; |
diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h index a9c55490fb82..094d4917c1a9 100644 --- a/include/asm-generic/vmlinux.lds.h +++ b/include/asm-generic/vmlinux.lds.h | |||
@@ -35,6 +35,13 @@ | |||
35 | VMLINUX_SYMBOL(__end_pci_fixups_enable) = .; \ | 35 | VMLINUX_SYMBOL(__end_pci_fixups_enable) = .; \ |
36 | } \ | 36 | } \ |
37 | \ | 37 | \ |
38 | /* RapidIO route ops */ \ | ||
39 | .rio_route : AT(ADDR(.rio_route) - LOAD_OFFSET) { \ | ||
40 | VMLINUX_SYMBOL(__start_rio_route_ops) = .; \ | ||
41 | *(.rio_route_ops) \ | ||
42 | VMLINUX_SYMBOL(__end_rio_route_ops) = .; \ | ||
43 | } \ | ||
44 | \ | ||
38 | /* Kernel symbol table: Normal symbols */ \ | 45 | /* Kernel symbol table: Normal symbols */ \ |
39 | __ksymtab : AT(ADDR(__ksymtab) - LOAD_OFFSET) { \ | 46 | __ksymtab : AT(ADDR(__ksymtab) - LOAD_OFFSET) { \ |
40 | VMLINUX_SYMBOL(__start___ksymtab) = .; \ | 47 | VMLINUX_SYMBOL(__start___ksymtab) = .; \ |
diff --git a/include/asm-i386/elf.h b/include/asm-i386/elf.h index fa11117d3cfa..4153d80e4d2b 100644 --- a/include/asm-i386/elf.h +++ b/include/asm-i386/elf.h | |||
@@ -119,6 +119,8 @@ typedef struct user_fxsr_struct elf_fpxregset_t; | |||
119 | */ | 119 | */ |
120 | #define elf_read_implies_exec(ex, executable_stack) (executable_stack != EXSTACK_DISABLE_X) | 120 | #define elf_read_implies_exec(ex, executable_stack) (executable_stack != EXSTACK_DISABLE_X) |
121 | 121 | ||
122 | struct task_struct; | ||
123 | |||
122 | extern int dump_task_regs (struct task_struct *, elf_gregset_t *); | 124 | extern int dump_task_regs (struct task_struct *, elf_gregset_t *); |
123 | extern int dump_task_fpu (struct task_struct *, elf_fpregset_t *); | 125 | extern int dump_task_fpu (struct task_struct *, elf_fpregset_t *); |
124 | extern int dump_task_extended_fpu (struct task_struct *, struct user_fxsr_struct *); | 126 | extern int dump_task_extended_fpu (struct task_struct *, struct user_fxsr_struct *); |
diff --git a/include/asm-i386/kprobes.h b/include/asm-i386/kprobes.h index 8b6d3a90cd78..ca916a892877 100644 --- a/include/asm-i386/kprobes.h +++ b/include/asm-i386/kprobes.h | |||
@@ -49,6 +49,23 @@ struct arch_specific_insn { | |||
49 | kprobe_opcode_t insn[MAX_INSN_SIZE]; | 49 | kprobe_opcode_t insn[MAX_INSN_SIZE]; |
50 | }; | 50 | }; |
51 | 51 | ||
52 | struct prev_kprobe { | ||
53 | struct kprobe *kp; | ||
54 | unsigned long status; | ||
55 | unsigned long old_eflags; | ||
56 | unsigned long saved_eflags; | ||
57 | }; | ||
58 | |||
59 | /* per-cpu kprobe control block */ | ||
60 | struct kprobe_ctlblk { | ||
61 | unsigned long kprobe_status; | ||
62 | unsigned long kprobe_old_eflags; | ||
63 | unsigned long kprobe_saved_eflags; | ||
64 | long *jprobe_saved_esp; | ||
65 | struct pt_regs jprobe_saved_regs; | ||
66 | kprobe_opcode_t jprobes_stack[MAX_STACK_SIZE]; | ||
67 | struct prev_kprobe prev_kprobe; | ||
68 | }; | ||
52 | 69 | ||
53 | /* trap3/1 are intr gates for kprobes. So, restore the status of IF, | 70 | /* trap3/1 are intr gates for kprobes. So, restore the status of IF, |
54 | * if necessary, before executing the original int3/1 (trap) handler. | 71 | * if necessary, before executing the original int3/1 (trap) handler. |
diff --git a/include/asm-i386/pgtable.h b/include/asm-i386/pgtable.h index 03f3c8ac6383..088a945bf26b 100644 --- a/include/asm-i386/pgtable.h +++ b/include/asm-i386/pgtable.h | |||
@@ -25,6 +25,9 @@ | |||
25 | #include <linux/list.h> | 25 | #include <linux/list.h> |
26 | #include <linux/spinlock.h> | 26 | #include <linux/spinlock.h> |
27 | 27 | ||
28 | struct mm_struct; | ||
29 | struct vm_area_struct; | ||
30 | |||
28 | /* | 31 | /* |
29 | * ZERO_PAGE is a global shared page that is always zero: used | 32 | * ZERO_PAGE is a global shared page that is always zero: used |
30 | * for zero-mapped memory areas etc.. | 33 | * for zero-mapped memory areas etc.. |
diff --git a/include/asm-i386/processor.h b/include/asm-i386/processor.h index 0a4ec764377c..8c02b0318703 100644 --- a/include/asm-i386/processor.h +++ b/include/asm-i386/processor.h | |||
@@ -718,4 +718,10 @@ extern void mtrr_bp_init(void); | |||
718 | #define mtrr_bp_init() do {} while (0) | 718 | #define mtrr_bp_init() do {} while (0) |
719 | #endif | 719 | #endif |
720 | 720 | ||
721 | #ifdef CONFIG_X86_MCE | ||
722 | extern void mcheck_init(struct cpuinfo_x86 *c); | ||
723 | #else | ||
724 | #define mcheck_init(c) do {} while(0) | ||
725 | #endif | ||
726 | |||
721 | #endif /* __ASM_I386_PROCESSOR_H */ | 727 | #endif /* __ASM_I386_PROCESSOR_H */ |
diff --git a/include/asm-ia64/dma-mapping.h b/include/asm-ia64/dma-mapping.h index 6347c9845642..df67d40801de 100644 --- a/include/asm-ia64/dma-mapping.h +++ b/include/asm-ia64/dma-mapping.h | |||
@@ -48,12 +48,7 @@ dma_set_mask (struct device *dev, u64 mask) | |||
48 | return 0; | 48 | return 0; |
49 | } | 49 | } |
50 | 50 | ||
51 | static inline int | 51 | extern int dma_get_cache_alignment(void); |
52 | dma_get_cache_alignment (void) | ||
53 | { | ||
54 | extern int ia64_max_cacheline_size; | ||
55 | return ia64_max_cacheline_size; | ||
56 | } | ||
57 | 52 | ||
58 | static inline void | 53 | static inline void |
59 | dma_cache_sync (void *vaddr, size_t size, enum dma_data_direction dir) | 54 | dma_cache_sync (void *vaddr, size_t size, enum dma_data_direction dir) |
diff --git a/include/asm-ia64/kprobes.h b/include/asm-ia64/kprobes.h index 573a3574a24f..592abb000e29 100644 --- a/include/asm-ia64/kprobes.h +++ b/include/asm-ia64/kprobes.h | |||
@@ -26,6 +26,7 @@ | |||
26 | */ | 26 | */ |
27 | #include <linux/types.h> | 27 | #include <linux/types.h> |
28 | #include <linux/ptrace.h> | 28 | #include <linux/ptrace.h> |
29 | #include <linux/percpu.h> | ||
29 | #include <asm/break.h> | 30 | #include <asm/break.h> |
30 | 31 | ||
31 | #define MAX_INSN_SIZE 16 | 32 | #define MAX_INSN_SIZE 16 |
@@ -62,6 +63,18 @@ typedef struct _bundle { | |||
62 | } quad1; | 63 | } quad1; |
63 | } __attribute__((__aligned__(16))) bundle_t; | 64 | } __attribute__((__aligned__(16))) bundle_t; |
64 | 65 | ||
66 | struct prev_kprobe { | ||
67 | struct kprobe *kp; | ||
68 | unsigned long status; | ||
69 | }; | ||
70 | |||
71 | /* per-cpu kprobe control block */ | ||
72 | struct kprobe_ctlblk { | ||
73 | unsigned long kprobe_status; | ||
74 | struct pt_regs jprobe_saved_regs; | ||
75 | struct prev_kprobe prev_kprobe; | ||
76 | }; | ||
77 | |||
65 | #define JPROBE_ENTRY(pentry) (kprobe_opcode_t *)pentry | 78 | #define JPROBE_ENTRY(pentry) (kprobe_opcode_t *)pentry |
66 | 79 | ||
67 | #define ARCH_SUPPORTS_KRETPROBES | 80 | #define ARCH_SUPPORTS_KRETPROBES |
diff --git a/include/asm-ia64/pgtable.h b/include/asm-ia64/pgtable.h index 21e32a06bc82..c34ba80c1c31 100644 --- a/include/asm-ia64/pgtable.h +++ b/include/asm-ia64/pgtable.h | |||
@@ -127,6 +127,7 @@ | |||
127 | 127 | ||
128 | # ifndef __ASSEMBLY__ | 128 | # ifndef __ASSEMBLY__ |
129 | 129 | ||
130 | #include <linux/sched.h> /* for mm_struct */ | ||
130 | #include <asm/bitops.h> | 131 | #include <asm/bitops.h> |
131 | #include <asm/cacheflush.h> | 132 | #include <asm/cacheflush.h> |
132 | #include <asm/mmu_context.h> | 133 | #include <asm/mmu_context.h> |
diff --git a/include/asm-ia64/ptrace.h b/include/asm-ia64/ptrace.h index a79d1a7ecc77..2c703d6e0c86 100644 --- a/include/asm-ia64/ptrace.h +++ b/include/asm-ia64/ptrace.h | |||
@@ -229,6 +229,9 @@ struct switch_stack { | |||
229 | }; | 229 | }; |
230 | 230 | ||
231 | #ifdef __KERNEL__ | 231 | #ifdef __KERNEL__ |
232 | |||
233 | #define __ARCH_SYS_PTRACE 1 | ||
234 | |||
232 | /* | 235 | /* |
233 | * We use the ia64_psr(regs)->ri to determine which of the three | 236 | * We use the ia64_psr(regs)->ri to determine which of the three |
234 | * instructions in bundle (16 bytes) took the sample. Generate | 237 | * instructions in bundle (16 bytes) took the sample. Generate |
diff --git a/include/asm-m32r/pgtable.h b/include/asm-m32r/pgtable.h index 1cd5fd4a5b2c..75740debcd01 100644 --- a/include/asm-m32r/pgtable.h +++ b/include/asm-m32r/pgtable.h | |||
@@ -27,6 +27,9 @@ | |||
27 | #include <asm/bitops.h> | 27 | #include <asm/bitops.h> |
28 | #include <asm/page.h> | 28 | #include <asm/page.h> |
29 | 29 | ||
30 | struct mm_struct; | ||
31 | struct vm_area_struct; | ||
32 | |||
30 | extern pgd_t swapper_pg_dir[1024]; | 33 | extern pgd_t swapper_pg_dir[1024]; |
31 | extern void paging_init(void); | 34 | extern void paging_init(void); |
32 | 35 | ||
diff --git a/include/asm-m32r/ptrace.h b/include/asm-m32r/ptrace.h index 976417126b2d..55cd7ecfde43 100644 --- a/include/asm-m32r/ptrace.h +++ b/include/asm-m32r/ptrace.h | |||
@@ -145,6 +145,9 @@ struct pt_regs { | |||
145 | #define PTRACE_O_TRACESYSGOOD 0x00000001 | 145 | #define PTRACE_O_TRACESYSGOOD 0x00000001 |
146 | 146 | ||
147 | #ifdef __KERNEL__ | 147 | #ifdef __KERNEL__ |
148 | |||
149 | #define __ARCH_SYS_PTRACE 1 | ||
150 | |||
148 | #if defined(CONFIG_ISA_M32R2) || defined(CONFIG_CHIP_VDEC2) | 151 | #if defined(CONFIG_ISA_M32R2) || defined(CONFIG_CHIP_VDEC2) |
149 | #define user_mode(regs) ((M32R_PSW_BPM & (regs)->psw) != 0) | 152 | #define user_mode(regs) ((M32R_PSW_BPM & (regs)->psw) != 0) |
150 | #elif defined(CONFIG_ISA_M32R) | 153 | #elif defined(CONFIG_ISA_M32R) |
diff --git a/include/asm-m68knommu/cacheflush.h b/include/asm-m68knommu/cacheflush.h index 026bbc9565b4..49925e91e89c 100644 --- a/include/asm-m68knommu/cacheflush.h +++ b/include/asm-m68knommu/cacheflush.h | |||
@@ -25,7 +25,7 @@ | |||
25 | #define copy_from_user_page(vma, page, vaddr, dst, src, len) \ | 25 | #define copy_from_user_page(vma, page, vaddr, dst, src, len) \ |
26 | memcpy(dst, src, len) | 26 | memcpy(dst, src, len) |
27 | 27 | ||
28 | extern inline void __flush_cache_all(void) | 28 | static inline void __flush_cache_all(void) |
29 | { | 29 | { |
30 | #ifdef CONFIG_M5407 | 30 | #ifdef CONFIG_M5407 |
31 | /* | 31 | /* |
@@ -64,7 +64,7 @@ extern inline void __flush_cache_all(void) | |||
64 | "nop\n\t" | 64 | "nop\n\t" |
65 | : : : "d0" ); | 65 | : : : "d0" ); |
66 | #endif /* CONFIG_M5272 */ | 66 | #endif /* CONFIG_M5272 */ |
67 | #if CONFIG_M5249 | 67 | #ifdef CONFIG_M5249 |
68 | __asm__ __volatile__ ( | 68 | __asm__ __volatile__ ( |
69 | "movel #0xa1000200, %%d0\n\t" | 69 | "movel #0xa1000200, %%d0\n\t" |
70 | "movec %%d0, %%CACR\n\t" | 70 | "movec %%d0, %%CACR\n\t" |
diff --git a/include/asm-m68knommu/irq.h b/include/asm-m68knommu/irq.h index 208ccd969e4b..a08fa9b958da 100644 --- a/include/asm-m68knommu/irq.h +++ b/include/asm-m68knommu/irq.h | |||
@@ -2,7 +2,6 @@ | |||
2 | #define _M68K_IRQ_H_ | 2 | #define _M68K_IRQ_H_ |
3 | 3 | ||
4 | #include <linux/config.h> | 4 | #include <linux/config.h> |
5 | #include <linux/interrupt.h> | ||
6 | #include <asm/ptrace.h> | 5 | #include <asm/ptrace.h> |
7 | 6 | ||
8 | #ifdef CONFIG_COLDFIRE | 7 | #ifdef CONFIG_COLDFIRE |
@@ -83,36 +82,6 @@ extern void (*mach_disable_irq)(unsigned int); | |||
83 | #endif /* CONFIG_M68360 */ | 82 | #endif /* CONFIG_M68360 */ |
84 | 83 | ||
85 | /* | 84 | /* |
86 | * This structure is used to chain together the ISRs for a particular | ||
87 | * interrupt source (if it supports chaining). | ||
88 | */ | ||
89 | typedef struct irq_node { | ||
90 | irqreturn_t (*handler)(int, void *, struct pt_regs *); | ||
91 | unsigned long flags; | ||
92 | void *dev_id; | ||
93 | const char *devname; | ||
94 | struct irq_node *next; | ||
95 | } irq_node_t; | ||
96 | |||
97 | /* | ||
98 | * This structure has only 4 elements for speed reasons | ||
99 | */ | ||
100 | typedef struct irq_handler { | ||
101 | irqreturn_t (*handler)(int, void *, struct pt_regs *); | ||
102 | unsigned long flags; | ||
103 | void *dev_id; | ||
104 | const char *devname; | ||
105 | } irq_handler_t; | ||
106 | |||
107 | /* count of spurious interrupts */ | ||
108 | extern volatile unsigned int num_spurious; | ||
109 | |||
110 | /* | ||
111 | * This function returns a new irq_node_t | ||
112 | */ | ||
113 | extern irq_node_t *new_irq_node(void); | ||
114 | |||
115 | /* | ||
116 | * Some drivers want these entry points | 85 | * Some drivers want these entry points |
117 | */ | 86 | */ |
118 | #define enable_irq(x) (mach_enable_irq ? (*mach_enable_irq)(x) : 0) | 87 | #define enable_irq(x) (mach_enable_irq ? (*mach_enable_irq)(x) : 0) |
diff --git a/include/asm-m68knommu/irqnode.h b/include/asm-m68knommu/irqnode.h new file mode 100644 index 000000000000..a2503dfc554c --- /dev/null +++ b/include/asm-m68knommu/irqnode.h | |||
@@ -0,0 +1,36 @@ | |||
1 | #ifndef _M68K_IRQNODE_H_ | ||
2 | #define _M68K_IRQNODE_H_ | ||
3 | |||
4 | #include <linux/interrupt.h> | ||
5 | |||
6 | /* | ||
7 | * This structure is used to chain together the ISRs for a particular | ||
8 | * interrupt source (if it supports chaining). | ||
9 | */ | ||
10 | typedef struct irq_node { | ||
11 | irqreturn_t (*handler)(int, void *, struct pt_regs *); | ||
12 | unsigned long flags; | ||
13 | void *dev_id; | ||
14 | const char *devname; | ||
15 | struct irq_node *next; | ||
16 | } irq_node_t; | ||
17 | |||
18 | /* | ||
19 | * This structure has only 4 elements for speed reasons | ||
20 | */ | ||
21 | typedef struct irq_handler { | ||
22 | irqreturn_t (*handler)(int, void *, struct pt_regs *); | ||
23 | unsigned long flags; | ||
24 | void *dev_id; | ||
25 | const char *devname; | ||
26 | } irq_handler_t; | ||
27 | |||
28 | /* count of spurious interrupts */ | ||
29 | extern volatile unsigned int num_spurious; | ||
30 | |||
31 | /* | ||
32 | * This function returns a new irq_node_t | ||
33 | */ | ||
34 | extern irq_node_t *new_irq_node(void); | ||
35 | |||
36 | #endif /* _M68K_IRQNODE_H_ */ | ||
diff --git a/include/asm-mips/.gitignore b/include/asm-mips/.gitignore new file mode 100644 index 000000000000..4ec57ad5bc3c --- /dev/null +++ b/include/asm-mips/.gitignore | |||
@@ -0,0 +1 @@ | |||
asm_offsets.h | |||
diff --git a/include/asm-mips/delay.h b/include/asm-mips/delay.h index 85435a8d4e52..48d00cccdafa 100644 --- a/include/asm-mips/delay.h +++ b/include/asm-mips/delay.h | |||
@@ -84,4 +84,13 @@ static inline void __udelay(unsigned long usecs, unsigned long lpj) | |||
84 | 84 | ||
85 | #define udelay(usecs) __udelay((usecs),__udelay_val) | 85 | #define udelay(usecs) __udelay((usecs),__udelay_val) |
86 | 86 | ||
87 | /* make sure "usecs *= ..." in udelay do not overflow. */ | ||
88 | #if HZ >= 1000 | ||
89 | #define MAX_UDELAY_MS 1 | ||
90 | #elif HZ <= 200 | ||
91 | #define MAX_UDELAY_MS 5 | ||
92 | #else | ||
93 | #define MAX_UDELAY_MS (1000 / HZ) | ||
94 | #endif | ||
95 | |||
87 | #endif /* _ASM_DELAY_H */ | 96 | #endif /* _ASM_DELAY_H */ |
diff --git a/include/asm-mips/elf.h b/include/asm-mips/elf.h index 7420f12742bb..d2c9a25f8459 100644 --- a/include/asm-mips/elf.h +++ b/include/asm-mips/elf.h | |||
@@ -275,6 +275,8 @@ do { \ | |||
275 | 275 | ||
276 | #endif /* CONFIG_64BIT */ | 276 | #endif /* CONFIG_64BIT */ |
277 | 277 | ||
278 | struct task_struct; | ||
279 | |||
278 | extern void dump_regs(elf_greg_t *, struct pt_regs *regs); | 280 | extern void dump_regs(elf_greg_t *, struct pt_regs *regs); |
279 | extern int dump_task_regs (struct task_struct *, elf_gregset_t *); | 281 | extern int dump_task_regs (struct task_struct *, elf_gregset_t *); |
280 | extern int dump_task_fpu(struct task_struct *, elf_fpregset_t *); | 282 | extern int dump_task_fpu(struct task_struct *, elf_fpregset_t *); |
diff --git a/include/asm-mips/errno.h b/include/asm-mips/errno.h index 9d3e6e7cdb92..3c0d840e4577 100644 --- a/include/asm-mips/errno.h +++ b/include/asm-mips/errno.h | |||
@@ -119,10 +119,6 @@ | |||
119 | #define EOWNERDEAD 165 /* Owner died */ | 119 | #define EOWNERDEAD 165 /* Owner died */ |
120 | #define ENOTRECOVERABLE 166 /* State not recoverable */ | 120 | #define ENOTRECOVERABLE 166 /* State not recoverable */ |
121 | 121 | ||
122 | /* for robust mutexes */ | ||
123 | #define EOWNERDEAD 165 /* Owner died */ | ||
124 | #define ENOTRECOVERABLE 166 /* State not recoverable */ | ||
125 | |||
126 | #define EDQUOT 1133 /* Quota exceeded */ | 122 | #define EDQUOT 1133 /* Quota exceeded */ |
127 | 123 | ||
128 | #ifdef __KERNEL__ | 124 | #ifdef __KERNEL__ |
diff --git a/include/asm-mips/ip32/mace.h b/include/asm-mips/ip32/mace.h index 432011b16c26..5bdc51d85b6c 100644 --- a/include/asm-mips/ip32/mace.h +++ b/include/asm-mips/ip32/mace.h | |||
@@ -147,6 +147,29 @@ struct mace_audio { | |||
147 | } chan[3]; | 147 | } chan[3]; |
148 | }; | 148 | }; |
149 | 149 | ||
150 | |||
151 | /* register definitions for parallel port DMA */ | ||
152 | struct mace_parport { | ||
153 | /* 0 - do nothing, 1 - pulse terminal count to the device after buffer is drained */ | ||
154 | #define MACEPAR_CONTEXT_LASTFLAG BIT(63) | ||
155 | /* Should not cross 4K page boundary */ | ||
156 | #define MACEPAR_CONTEXT_DATALEN_MASK 0xfff00000000 | ||
157 | /* Can be arbitrarily aligned on any byte boundary on output, 64 byte aligned on input */ | ||
158 | #define MACEPAR_CONTEXT_BASEADDR_MASK 0xffffffff | ||
159 | volatile u64 context_a; | ||
160 | volatile u64 context_b; | ||
161 | #define MACEPAR_CTLSTAT_DIRECTION BIT(0) /* 0 - mem->device, 1 - device->mem */ | ||
162 | #define MACEPAR_CTLSTAT_ENABLE BIT(1) /* 0 - channel frozen, 1 - channel enabled */ | ||
163 | #define MACEPAR_CTLSTAT_RESET BIT(2) /* 0 - channel active, 1 - complete channel reset */ | ||
164 | #define MACEPAR_CTLSTAT_CTXB_VALID BIT(3) | ||
165 | #define MACEPAR_CTLSTAT_CTXA_VALID BIT(4) | ||
166 | volatile u64 cntlstat; /* Control/Status register */ | ||
167 | #define MACEPAR_DIAG_CTXINUSE BIT(1) | ||
168 | #define MACEPAR_DIAG_DMACTIVE BIT(2) /* 1 - Dma engine is enabled and processing something */ | ||
169 | #define MACEPAR_DIAG_CTRMASK 0x3ffc /* Counter of bytes left */ | ||
170 | volatile u64 diagnostic; /* RO: diagnostic register */ | ||
171 | }; | ||
172 | |||
150 | /* ISA Control and DMA registers */ | 173 | /* ISA Control and DMA registers */ |
151 | struct mace_isactrl { | 174 | struct mace_isactrl { |
152 | volatile unsigned long ringbase; | 175 | volatile unsigned long ringbase; |
@@ -199,6 +222,7 @@ struct mace_isactrl { | |||
199 | volatile unsigned long _pad[0x2000/8 - 4]; | 222 | volatile unsigned long _pad[0x2000/8 - 4]; |
200 | 223 | ||
201 | volatile unsigned long dp_ram[0x400]; | 224 | volatile unsigned long dp_ram[0x400]; |
225 | struct mace_parport parport; | ||
202 | }; | 226 | }; |
203 | 227 | ||
204 | /* Keyboard & Mouse registers | 228 | /* Keyboard & Mouse registers |
@@ -277,7 +301,7 @@ struct mace_perif { | |||
277 | */ | 301 | */ |
278 | 302 | ||
279 | /* Parallel port */ | 303 | /* Parallel port */ |
280 | struct mace_parallel { /* later... */ | 304 | struct mace_parallel { |
281 | }; | 305 | }; |
282 | 306 | ||
283 | struct mace_ecp1284 { /* later... */ | 307 | struct mace_ecp1284 { /* later... */ |
diff --git a/include/asm-mips/mach-generic/ide.h b/include/asm-mips/mach-generic/ide.h index 961006948c7c..550979a9ea9d 100644 --- a/include/asm-mips/mach-generic/ide.h +++ b/include/asm-mips/mach-generic/ide.h | |||
@@ -168,8 +168,12 @@ static inline void __ide_mm_outsl(void __iomem * port, void *addr, u32 count) | |||
168 | /* ide_insw calls insw, not __ide_insw. Why? */ | 168 | /* ide_insw calls insw, not __ide_insw. Why? */ |
169 | #undef insw | 169 | #undef insw |
170 | #undef insl | 170 | #undef insl |
171 | #undef outsw | ||
172 | #undef outsl | ||
171 | #define insw(port, addr, count) __ide_insw(port, addr, count) | 173 | #define insw(port, addr, count) __ide_insw(port, addr, count) |
172 | #define insl(port, addr, count) __ide_insl(port, addr, count) | 174 | #define insl(port, addr, count) __ide_insl(port, addr, count) |
175 | #define outsw(port, addr, count) __ide_outsw(port, addr, count) | ||
176 | #define outsl(port, addr, count) __ide_outsl(port, addr, count) | ||
173 | 177 | ||
174 | #endif /* __KERNEL__ */ | 178 | #endif /* __KERNEL__ */ |
175 | 179 | ||
diff --git a/include/asm-mips/mc146818-time.h b/include/asm-mips/mc146818-time.h index a2c2d2c24303..47214861093b 100644 --- a/include/asm-mips/mc146818-time.h +++ b/include/asm-mips/mc146818-time.h | |||
@@ -33,7 +33,9 @@ static inline int mc146818_set_rtc_mmss(unsigned long nowtime) | |||
33 | int real_seconds, real_minutes, cmos_minutes; | 33 | int real_seconds, real_minutes, cmos_minutes; |
34 | unsigned char save_control, save_freq_select; | 34 | unsigned char save_control, save_freq_select; |
35 | int retval = 0; | 35 | int retval = 0; |
36 | unsigned long flags; | ||
36 | 37 | ||
38 | spin_lock_irqsave(&rtc_lock, flags); | ||
37 | save_control = CMOS_READ(RTC_CONTROL); /* tell the clock it's being set */ | 39 | save_control = CMOS_READ(RTC_CONTROL); /* tell the clock it's being set */ |
38 | CMOS_WRITE((save_control|RTC_SET), RTC_CONTROL); | 40 | CMOS_WRITE((save_control|RTC_SET), RTC_CONTROL); |
39 | 41 | ||
@@ -79,14 +81,30 @@ static inline int mc146818_set_rtc_mmss(unsigned long nowtime) | |||
79 | */ | 81 | */ |
80 | CMOS_WRITE(save_control, RTC_CONTROL); | 82 | CMOS_WRITE(save_control, RTC_CONTROL); |
81 | CMOS_WRITE(save_freq_select, RTC_FREQ_SELECT); | 83 | CMOS_WRITE(save_freq_select, RTC_FREQ_SELECT); |
84 | spin_unlock_irqrestore(&rtc_lock, flags); | ||
82 | 85 | ||
83 | return retval; | 86 | return retval; |
84 | } | 87 | } |
85 | 88 | ||
89 | /* | ||
90 | * Returns true if a clock update is in progress | ||
91 | */ | ||
92 | static inline unsigned char rtc_is_updating(void) | ||
93 | { | ||
94 | unsigned char uip; | ||
95 | unsigned long flags; | ||
96 | |||
97 | spin_lock_irqsave(&rtc_lock, flags); | ||
98 | uip = (CMOS_READ(RTC_FREQ_SELECT) & RTC_UIP); | ||
99 | spin_unlock_irqrestore(&rtc_lock, flags); | ||
100 | return uip; | ||
101 | } | ||
102 | |||
86 | static inline unsigned long mc146818_get_cmos_time(void) | 103 | static inline unsigned long mc146818_get_cmos_time(void) |
87 | { | 104 | { |
88 | unsigned int year, mon, day, hour, min, sec; | 105 | unsigned int year, mon, day, hour, min, sec; |
89 | int i; | 106 | int i; |
107 | unsigned long flags; | ||
90 | 108 | ||
91 | /* | 109 | /* |
92 | * The Linux interpretation of the CMOS clock register contents: | 110 | * The Linux interpretation of the CMOS clock register contents: |
@@ -97,12 +115,13 @@ static inline unsigned long mc146818_get_cmos_time(void) | |||
97 | 115 | ||
98 | /* read RTC exactly on falling edge of update flag */ | 116 | /* read RTC exactly on falling edge of update flag */ |
99 | for (i = 0 ; i < 1000000 ; i++) /* may take up to 1 second... */ | 117 | for (i = 0 ; i < 1000000 ; i++) /* may take up to 1 second... */ |
100 | if (CMOS_READ(RTC_FREQ_SELECT) & RTC_UIP) | 118 | if (rtc_is_updating()) |
101 | break; | 119 | break; |
102 | for (i = 0 ; i < 1000000 ; i++) /* must try at least 2.228 ms */ | 120 | for (i = 0 ; i < 1000000 ; i++) /* must try at least 2.228 ms */ |
103 | if (!(CMOS_READ(RTC_FREQ_SELECT) & RTC_UIP)) | 121 | if (!rtc_is_updating()) |
104 | break; | 122 | break; |
105 | 123 | ||
124 | spin_lock_irqsave(&rtc_lock, flags); | ||
106 | do { /* Isn't this overkill ? UIP above should guarantee consistency */ | 125 | do { /* Isn't this overkill ? UIP above should guarantee consistency */ |
107 | sec = CMOS_READ(RTC_SECONDS); | 126 | sec = CMOS_READ(RTC_SECONDS); |
108 | min = CMOS_READ(RTC_MINUTES); | 127 | min = CMOS_READ(RTC_MINUTES); |
@@ -120,6 +139,7 @@ static inline unsigned long mc146818_get_cmos_time(void) | |||
120 | BCD_TO_BIN(mon); | 139 | BCD_TO_BIN(mon); |
121 | BCD_TO_BIN(year); | 140 | BCD_TO_BIN(year); |
122 | } | 141 | } |
142 | spin_unlock_irqrestore(&rtc_lock, flags); | ||
123 | year = mc146818_decode_year(year); | 143 | year = mc146818_decode_year(year); |
124 | 144 | ||
125 | return mktime(year, mon, day, hour, min, sec); | 145 | return mktime(year, mon, day, hour, min, sec); |
diff --git a/include/asm-mips/module.h b/include/asm-mips/module.h index 2be399311eec..2af496c78c12 100644 --- a/include/asm-mips/module.h +++ b/include/asm-mips/module.h | |||
@@ -76,43 +76,43 @@ search_module_dbetables(unsigned long addr) | |||
76 | #endif | 76 | #endif |
77 | 77 | ||
78 | #ifdef CONFIG_CPU_MIPS32_R1 | 78 | #ifdef CONFIG_CPU_MIPS32_R1 |
79 | #define MODULE_PROC_FAMILY "MIPS32_R1" | 79 | #define MODULE_PROC_FAMILY "MIPS32_R1 " |
80 | #elif defined CONFIG_CPU_MIPS32_R2 | 80 | #elif defined CONFIG_CPU_MIPS32_R2 |
81 | #define MODULE_PROC_FAMILY "MIPS32_R2" | 81 | #define MODULE_PROC_FAMILY "MIPS32_R2 " |
82 | #elif defined CONFIG_CPU_MIPS64_R1 | 82 | #elif defined CONFIG_CPU_MIPS64_R1 |
83 | #define MODULE_PROC_FAMILY "MIPS64_R1" | 83 | #define MODULE_PROC_FAMILY "MIPS64_R1 " |
84 | #elif defined CONFIG_CPU_MIPS64_R2 | 84 | #elif defined CONFIG_CPU_MIPS64_R2 |
85 | #define MODULE_PROC_FAMILY "MIPS64_R2" | 85 | #define MODULE_PROC_FAMILY "MIPS64_R2 " |
86 | #elif defined CONFIG_CPU_R3000 | 86 | #elif defined CONFIG_CPU_R3000 |
87 | #define MODULE_PROC_FAMILY "R3000" | 87 | #define MODULE_PROC_FAMILY "R3000 " |
88 | #elif defined CONFIG_CPU_TX39XX | 88 | #elif defined CONFIG_CPU_TX39XX |
89 | #define MODULE_PROC_FAMILY "TX39XX" | 89 | #define MODULE_PROC_FAMILY "TX39XX " |
90 | #elif defined CONFIG_CPU_VR41XX | 90 | #elif defined CONFIG_CPU_VR41XX |
91 | #define MODULE_PROC_FAMILY "VR41XX" | 91 | #define MODULE_PROC_FAMILY "VR41XX " |
92 | #elif defined CONFIG_CPU_R4300 | 92 | #elif defined CONFIG_CPU_R4300 |
93 | #define MODULE_PROC_FAMILY "R4300" | 93 | #define MODULE_PROC_FAMILY "R4300 " |
94 | #elif defined CONFIG_CPU_R4X00 | 94 | #elif defined CONFIG_CPU_R4X00 |
95 | #define MODULE_PROC_FAMILY "R4X00" | 95 | #define MODULE_PROC_FAMILY "R4X00 " |
96 | #elif defined CONFIG_CPU_TX49XX | 96 | #elif defined CONFIG_CPU_TX49XX |
97 | #define MODULE_PROC_FAMILY "TX49XX" | 97 | #define MODULE_PROC_FAMILY "TX49XX " |
98 | #elif defined CONFIG_CPU_R5000 | 98 | #elif defined CONFIG_CPU_R5000 |
99 | #define MODULE_PROC_FAMILY "R5000" | 99 | #define MODULE_PROC_FAMILY "R5000 " |
100 | #elif defined CONFIG_CPU_R5432 | 100 | #elif defined CONFIG_CPU_R5432 |
101 | #define MODULE_PROC_FAMILY "R5432" | 101 | #define MODULE_PROC_FAMILY "R5432 " |
102 | #elif defined CONFIG_CPU_R6000 | 102 | #elif defined CONFIG_CPU_R6000 |
103 | #define MODULE_PROC_FAMILY "R6000" | 103 | #define MODULE_PROC_FAMILY "R6000 " |
104 | #elif defined CONFIG_CPU_NEVADA | 104 | #elif defined CONFIG_CPU_NEVADA |
105 | #define MODULE_PROC_FAMILY "NEVADA" | 105 | #define MODULE_PROC_FAMILY "NEVADA " |
106 | #elif defined CONFIG_CPU_R8000 | 106 | #elif defined CONFIG_CPU_R8000 |
107 | #define MODULE_PROC_FAMILY "R8000" | 107 | #define MODULE_PROC_FAMILY "R8000 " |
108 | #elif defined CONFIG_CPU_R10000 | 108 | #elif defined CONFIG_CPU_R10000 |
109 | #define MODULE_PROC_FAMILY "R10000" | 109 | #define MODULE_PROC_FAMILY "R10000 " |
110 | #elif defined CONFIG_CPU_RM7000 | 110 | #elif defined CONFIG_CPU_RM7000 |
111 | #define MODULE_PROC_FAMILY "RM7000" | 111 | #define MODULE_PROC_FAMILY "RM7000 " |
112 | #elif defined CONFIG_CPU_RM9000 | 112 | #elif defined CONFIG_CPU_RM9000 |
113 | #define MODULE_PROC_FAMILY "RM9000" | 113 | #define MODULE_PROC_FAMILY "RM9000 " |
114 | #elif defined CONFIG_CPU_SB1 | 114 | #elif defined CONFIG_CPU_SB1 |
115 | #define MODULE_PROC_FAMILY "SB1" | 115 | #define MODULE_PROC_FAMILY "SB1 " |
116 | #else | 116 | #else |
117 | #error MODULE_PROC_FAMILY undefined for your processor configuration | 117 | #error MODULE_PROC_FAMILY undefined for your processor configuration |
118 | #endif | 118 | #endif |
diff --git a/include/asm-mips/pgtable.h b/include/asm-mips/pgtable.h index 34facd996503..702a28fa7a34 100644 --- a/include/asm-mips/pgtable.h +++ b/include/asm-mips/pgtable.h | |||
@@ -19,6 +19,9 @@ | |||
19 | #include <asm/io.h> | 19 | #include <asm/io.h> |
20 | #include <asm/pgtable-bits.h> | 20 | #include <asm/pgtable-bits.h> |
21 | 21 | ||
22 | struct mm_struct; | ||
23 | struct vm_area_struct; | ||
24 | |||
22 | #define PAGE_NONE __pgprot(_PAGE_PRESENT | _CACHE_CACHABLE_NONCOHERENT) | 25 | #define PAGE_NONE __pgprot(_PAGE_PRESENT | _CACHE_CACHABLE_NONCOHERENT) |
23 | #define PAGE_SHARED __pgprot(_PAGE_PRESENT | _PAGE_READ | _PAGE_WRITE | \ | 26 | #define PAGE_SHARED __pgprot(_PAGE_PRESENT | _PAGE_READ | _PAGE_WRITE | \ |
24 | PAGE_CACHABLE_DEFAULT) | 27 | PAGE_CACHABLE_DEFAULT) |
diff --git a/include/asm-mips/rtc.h b/include/asm-mips/rtc.h index a60e0dc7c9b9..a2abc4572b63 100644 --- a/include/asm-mips/rtc.h +++ b/include/asm-mips/rtc.h | |||
@@ -14,7 +14,6 @@ | |||
14 | 14 | ||
15 | #ifdef __KERNEL__ | 15 | #ifdef __KERNEL__ |
16 | 16 | ||
17 | #include <linux/spinlock.h> | ||
18 | #include <linux/rtc.h> | 17 | #include <linux/rtc.h> |
19 | #include <asm/time.h> | 18 | #include <asm/time.h> |
20 | 19 | ||
@@ -29,17 +28,13 @@ | |||
29 | #define RTC_24H 0x02 /* 24 hour mode - else hours bit 7 means pm */ | 28 | #define RTC_24H 0x02 /* 24 hour mode - else hours bit 7 means pm */ |
30 | #define RTC_DST_EN 0x01 /* auto switch DST - works f. USA only */ | 29 | #define RTC_DST_EN 0x01 /* auto switch DST - works f. USA only */ |
31 | 30 | ||
32 | static DEFINE_SPINLOCK(mips_rtc_lock); | ||
33 | |||
34 | static inline unsigned int get_rtc_time(struct rtc_time *time) | 31 | static inline unsigned int get_rtc_time(struct rtc_time *time) |
35 | { | 32 | { |
36 | unsigned long nowtime; | 33 | unsigned long nowtime; |
37 | 34 | ||
38 | spin_lock(&mips_rtc_lock); | ||
39 | nowtime = rtc_get_time(); | 35 | nowtime = rtc_get_time(); |
40 | to_tm(nowtime, time); | 36 | to_tm(nowtime, time); |
41 | time->tm_year -= 1900; | 37 | time->tm_year -= 1900; |
42 | spin_unlock(&mips_rtc_lock); | ||
43 | 38 | ||
44 | return RTC_24H; | 39 | return RTC_24H; |
45 | } | 40 | } |
@@ -49,12 +44,10 @@ static inline int set_rtc_time(struct rtc_time *time) | |||
49 | unsigned long nowtime; | 44 | unsigned long nowtime; |
50 | int ret; | 45 | int ret; |
51 | 46 | ||
52 | spin_lock(&mips_rtc_lock); | ||
53 | nowtime = mktime(time->tm_year+1900, time->tm_mon+1, | 47 | nowtime = mktime(time->tm_year+1900, time->tm_mon+1, |
54 | time->tm_mday, time->tm_hour, time->tm_min, | 48 | time->tm_mday, time->tm_hour, time->tm_min, |
55 | time->tm_sec); | 49 | time->tm_sec); |
56 | ret = rtc_set_time(nowtime); | 50 | ret = rtc_set_time(nowtime); |
57 | spin_unlock(&mips_rtc_lock); | ||
58 | 51 | ||
59 | return ret; | 52 | return ret; |
60 | } | 53 | } |
diff --git a/include/asm-mips/rtlx.h b/include/asm-mips/rtlx.h index 83cdf6ab0d1f..1298c3fdf6c9 100644 --- a/include/asm-mips/rtlx.h +++ b/include/asm-mips/rtlx.h | |||
@@ -16,21 +16,19 @@ | |||
16 | #define RTLX_ID (RTLX_xID | RTLX_VERSION) | 16 | #define RTLX_ID (RTLX_xID | RTLX_VERSION) |
17 | #define RTLX_CHANNELS 8 | 17 | #define RTLX_CHANNELS 8 |
18 | 18 | ||
19 | enum rtlx_state { | ||
20 | RTLX_STATE_UNUSED = 0, | ||
21 | RTLX_STATE_INITIALISED, | ||
22 | RTLX_STATE_REMOTE_READY, | ||
23 | RTLX_STATE_OPENED | ||
24 | }; | ||
25 | |||
26 | #define RTLX_BUFFER_SIZE 1024 | 19 | #define RTLX_BUFFER_SIZE 1024 |
20 | |||
21 | /* | ||
22 | * lx_state bits | ||
23 | */ | ||
24 | #define RTLX_STATE_OPENED 1UL | ||
25 | |||
27 | /* each channel supports read and write. | 26 | /* each channel supports read and write. |
28 | linux (vpe0) reads lx_buffer and writes rt_buffer | 27 | linux (vpe0) reads lx_buffer and writes rt_buffer |
29 | SP (vpe1) reads rt_buffer and writes lx_buffer | 28 | SP (vpe1) reads rt_buffer and writes lx_buffer |
30 | */ | 29 | */ |
31 | typedef struct rtlx_channel { | 30 | struct rtlx_channel { |
32 | enum rtlx_state rt_state; | 31 | unsigned long lx_state; |
33 | enum rtlx_state lx_state; | ||
34 | 32 | ||
35 | int buffer_size; | 33 | int buffer_size; |
36 | 34 | ||
@@ -43,14 +41,12 @@ typedef struct rtlx_channel { | |||
43 | 41 | ||
44 | void *queues; | 42 | void *queues; |
45 | 43 | ||
46 | } rtlx_channel_t; | 44 | }; |
47 | 45 | ||
48 | typedef struct rtlx_info { | 46 | struct rtlx_info { |
49 | unsigned long id; | 47 | unsigned long id; |
50 | enum rtlx_state state; | ||
51 | 48 | ||
52 | struct rtlx_channel channel[RTLX_CHANNELS]; | 49 | struct rtlx_channel channel[RTLX_CHANNELS]; |
50 | }; | ||
53 | 51 | ||
54 | } rtlx_info_t; | 52 | #endif /* _RTLX_H_ */ |
55 | |||
56 | #endif | ||
diff --git a/include/asm-mips/time.h b/include/asm-mips/time.h index e22a20665871..9cc3564cc2c9 100644 --- a/include/asm-mips/time.h +++ b/include/asm-mips/time.h | |||
@@ -20,6 +20,9 @@ | |||
20 | #include <linux/linkage.h> | 20 | #include <linux/linkage.h> |
21 | #include <linux/ptrace.h> | 21 | #include <linux/ptrace.h> |
22 | #include <linux/rtc.h> | 22 | #include <linux/rtc.h> |
23 | #include <linux/spinlock.h> | ||
24 | |||
25 | extern spinlock_t rtc_lock; | ||
23 | 26 | ||
24 | /* | 27 | /* |
25 | * RTC ops. By default, they point to no-RTC functions. | 28 | * RTC ops. By default, they point to no-RTC functions. |
diff --git a/include/asm-parisc/pgtable.h b/include/asm-parisc/pgtable.h index c28fb6f48c6c..b4554711c3e7 100644 --- a/include/asm-parisc/pgtable.h +++ b/include/asm-parisc/pgtable.h | |||
@@ -12,6 +12,7 @@ | |||
12 | */ | 12 | */ |
13 | 13 | ||
14 | #include <linux/spinlock.h> | 14 | #include <linux/spinlock.h> |
15 | #include <linux/mm.h> /* for vm_area_struct */ | ||
15 | #include <asm/processor.h> | 16 | #include <asm/processor.h> |
16 | #include <asm/cache.h> | 17 | #include <asm/cache.h> |
17 | #include <asm/bitops.h> | 18 | #include <asm/bitops.h> |
@@ -418,7 +419,6 @@ extern void paging_init (void); | |||
418 | 419 | ||
419 | #define PG_dcache_dirty PG_arch_1 | 420 | #define PG_dcache_dirty PG_arch_1 |
420 | 421 | ||
421 | struct vm_area_struct; /* forward declaration (include/linux/mm.h) */ | ||
422 | extern void update_mmu_cache(struct vm_area_struct *, unsigned long, pte_t); | 422 | extern void update_mmu_cache(struct vm_area_struct *, unsigned long, pte_t); |
423 | 423 | ||
424 | /* Encode and de-code a swap entry */ | 424 | /* Encode and de-code a swap entry */ |
@@ -464,6 +464,7 @@ static inline int ptep_test_and_clear_dirty(struct vm_area_struct *vma, unsigned | |||
464 | 464 | ||
465 | extern spinlock_t pa_dbit_lock; | 465 | extern spinlock_t pa_dbit_lock; |
466 | 466 | ||
467 | struct mm_struct; | ||
467 | static inline pte_t ptep_get_and_clear(struct mm_struct *mm, unsigned long addr, pte_t *ptep) | 468 | static inline pte_t ptep_get_and_clear(struct mm_struct *mm, unsigned long addr, pte_t *ptep) |
468 | { | 469 | { |
469 | pte_t old_pte; | 470 | pte_t old_pte; |
diff --git a/include/asm-powerpc/elf.h b/include/asm-powerpc/elf.h index d140577d0a05..feac3458d71f 100644 --- a/include/asm-powerpc/elf.h +++ b/include/asm-powerpc/elf.h | |||
@@ -1,11 +1,13 @@ | |||
1 | #ifndef _ASM_POWERPC_ELF_H | 1 | #ifndef _ASM_POWERPC_ELF_H |
2 | #define _ASM_POWERPC_ELF_H | 2 | #define _ASM_POWERPC_ELF_H |
3 | 3 | ||
4 | #include <linux/sched.h> /* for task_struct */ | ||
4 | #include <asm/types.h> | 5 | #include <asm/types.h> |
5 | #include <asm/ptrace.h> | 6 | #include <asm/ptrace.h> |
6 | #include <asm/cputable.h> | 7 | #include <asm/cputable.h> |
7 | #include <asm/auxvec.h> | 8 | #include <asm/auxvec.h> |
8 | #include <asm/page.h> | 9 | #include <asm/page.h> |
10 | #include <asm/string.h> | ||
9 | 11 | ||
10 | /* PowerPC relocations defined by the ABIs */ | 12 | /* PowerPC relocations defined by the ABIs */ |
11 | #define R_PPC_NONE 0 | 13 | #define R_PPC_NONE 0 |
diff --git a/include/asm-powerpc/kprobes.h b/include/asm-powerpc/kprobes.h index b2f09f17fbe0..6cd0a3bfa280 100644 --- a/include/asm-powerpc/kprobes.h +++ b/include/asm-powerpc/kprobes.h | |||
@@ -27,6 +27,7 @@ | |||
27 | */ | 27 | */ |
28 | #include <linux/types.h> | 28 | #include <linux/types.h> |
29 | #include <linux/ptrace.h> | 29 | #include <linux/ptrace.h> |
30 | #include <linux/percpu.h> | ||
30 | 31 | ||
31 | struct pt_regs; | 32 | struct pt_regs; |
32 | 33 | ||
@@ -53,6 +54,20 @@ struct arch_specific_insn { | |||
53 | kprobe_opcode_t *insn; | 54 | kprobe_opcode_t *insn; |
54 | }; | 55 | }; |
55 | 56 | ||
57 | struct prev_kprobe { | ||
58 | struct kprobe *kp; | ||
59 | unsigned long status; | ||
60 | unsigned long saved_msr; | ||
61 | }; | ||
62 | |||
63 | /* per-cpu kprobe control block */ | ||
64 | struct kprobe_ctlblk { | ||
65 | unsigned long kprobe_status; | ||
66 | unsigned long kprobe_saved_msr; | ||
67 | struct pt_regs jprobe_saved_regs; | ||
68 | struct prev_kprobe prev_kprobe; | ||
69 | }; | ||
70 | |||
56 | #ifdef CONFIG_KPROBES | 71 | #ifdef CONFIG_KPROBES |
57 | extern int kprobe_exceptions_notify(struct notifier_block *self, | 72 | extern int kprobe_exceptions_notify(struct notifier_block *self, |
58 | unsigned long val, void *data); | 73 | unsigned long val, void *data); |
diff --git a/include/asm-ppc/ibm44x.h b/include/asm-ppc/ibm44x.h index e5374be86aef..f835066fb3ca 100644 --- a/include/asm-ppc/ibm44x.h +++ b/include/asm-ppc/ibm44x.h | |||
@@ -34,12 +34,20 @@ | |||
34 | /* Lowest TLB slot consumed by the default pinned TLBs */ | 34 | /* Lowest TLB slot consumed by the default pinned TLBs */ |
35 | #define PPC44x_LOW_SLOT 63 | 35 | #define PPC44x_LOW_SLOT 63 |
36 | 36 | ||
37 | /* LS 32-bits of UART0 physical address location for early serial text debug */ | 37 | /* |
38 | * Least significant 32-bits and extended real page number (ERPN) of | ||
39 | * UART0 physical address location for early serial text debug | ||
40 | */ | ||
38 | #if defined(CONFIG_440SP) | 41 | #if defined(CONFIG_440SP) |
42 | #define UART0_PHYS_ERPN 1 | ||
43 | #define UART0_PHYS_IO_BASE 0xf0000200 | ||
44 | #elif defined(CONFIG_440SPE) | ||
45 | #define UART0_PHYS_ERPN 4 | ||
39 | #define UART0_PHYS_IO_BASE 0xf0000200 | 46 | #define UART0_PHYS_IO_BASE 0xf0000200 |
40 | #elif defined(CONFIG_440EP) | 47 | #elif defined(CONFIG_440EP) |
41 | #define UART0_PHYS_IO_BASE 0xe0000000 | 48 | #define UART0_PHYS_IO_BASE 0xe0000000 |
42 | #else | 49 | #else |
50 | #define UART0_PHYS_ERPN 1 | ||
43 | #define UART0_PHYS_IO_BASE 0x40000200 | 51 | #define UART0_PHYS_IO_BASE 0x40000200 |
44 | #endif | 52 | #endif |
45 | 53 | ||
@@ -56,6 +64,11 @@ | |||
56 | #define PPC44x_PCICFG_PAGE 0x0000000900000000ULL | 64 | #define PPC44x_PCICFG_PAGE 0x0000000900000000ULL |
57 | #define PPC44x_PCIIO_PAGE PPC44x_PCICFG_PAGE | 65 | #define PPC44x_PCIIO_PAGE PPC44x_PCICFG_PAGE |
58 | #define PPC44x_PCIMEM_PAGE 0x0000000a00000000ULL | 66 | #define PPC44x_PCIMEM_PAGE 0x0000000a00000000ULL |
67 | #elif defined(CONFIG_440SPE) | ||
68 | #define PPC44x_IO_PAGE 0x0000000400000000ULL | ||
69 | #define PPC44x_PCICFG_PAGE 0x0000000c00000000ULL | ||
70 | #define PPC44x_PCIIO_PAGE PPC44x_PCICFG_PAGE | ||
71 | #define PPC44x_PCIMEM_PAGE 0x0000000d00000000ULL | ||
59 | #elif defined(CONFIG_440EP) | 72 | #elif defined(CONFIG_440EP) |
60 | #define PPC44x_IO_PAGE 0x0000000000000000ULL | 73 | #define PPC44x_IO_PAGE 0x0000000000000000ULL |
61 | #define PPC44x_PCICFG_PAGE 0x0000000000000000ULL | 74 | #define PPC44x_PCICFG_PAGE 0x0000000000000000ULL |
@@ -71,7 +84,7 @@ | |||
71 | /* | 84 | /* |
72 | * 36-bit trap ranges | 85 | * 36-bit trap ranges |
73 | */ | 86 | */ |
74 | #if defined(CONFIG_440SP) | 87 | #if defined(CONFIG_440SP) || defined(CONFIG_440SPE) |
75 | #define PPC44x_IO_LO 0xf0000000UL | 88 | #define PPC44x_IO_LO 0xf0000000UL |
76 | #define PPC44x_IO_HI 0xf0000fffUL | 89 | #define PPC44x_IO_HI 0xf0000fffUL |
77 | #define PPC44x_PCI0CFG_LO 0x0ec00000UL | 90 | #define PPC44x_PCI0CFG_LO 0x0ec00000UL |
@@ -109,7 +122,7 @@ | |||
109 | */ | 122 | */ |
110 | 123 | ||
111 | 124 | ||
112 | /* CPRs (440GX and 440SP) */ | 125 | /* CPRs (440GX and 440SP/440SPe) */ |
113 | #define DCRN_CPR_CONFIG_ADDR 0xc | 126 | #define DCRN_CPR_CONFIG_ADDR 0xc |
114 | #define DCRN_CPR_CONFIG_DATA 0xd | 127 | #define DCRN_CPR_CONFIG_DATA 0xd |
115 | 128 | ||
@@ -130,7 +143,7 @@ | |||
130 | mtdcr(DCRN_CPR_CONFIG_ADDR, offset); \ | 143 | mtdcr(DCRN_CPR_CONFIG_ADDR, offset); \ |
131 | mtdcr(DCRN_CPR_CONFIG_DATA, data);}) | 144 | mtdcr(DCRN_CPR_CONFIG_DATA, data);}) |
132 | 145 | ||
133 | /* SDRs (440GX and 440SP) */ | 146 | /* SDRs (440GX and 440SP/440SPe) */ |
134 | #define DCRN_SDR_CONFIG_ADDR 0xe | 147 | #define DCRN_SDR_CONFIG_ADDR 0xe |
135 | #define DCRN_SDR_CONFIG_DATA 0xf | 148 | #define DCRN_SDR_CONFIG_DATA 0xf |
136 | #define DCRN_SDR_PFC0 0x4100 | 149 | #define DCRN_SDR_PFC0 0x4100 |
@@ -180,7 +193,7 @@ | |||
180 | mtdcr(DCRN_SDR_CONFIG_ADDR, offset); \ | 193 | mtdcr(DCRN_SDR_CONFIG_ADDR, offset); \ |
181 | mtdcr(DCRN_SDR_CONFIG_DATA,data);}) | 194 | mtdcr(DCRN_SDR_CONFIG_DATA,data);}) |
182 | 195 | ||
183 | /* DMA (excluding 440SP) */ | 196 | /* DMA (excluding 440SP/440SPe) */ |
184 | #define DCRN_DMA0_BASE 0x100 | 197 | #define DCRN_DMA0_BASE 0x100 |
185 | #define DCRN_DMA1_BASE 0x108 | 198 | #define DCRN_DMA1_BASE 0x108 |
186 | #define DCRN_DMA2_BASE 0x110 | 199 | #define DCRN_DMA2_BASE 0x110 |
@@ -200,12 +213,20 @@ | |||
200 | /* UIC */ | 213 | /* UIC */ |
201 | #define DCRN_UIC0_BASE 0xc0 | 214 | #define DCRN_UIC0_BASE 0xc0 |
202 | #define DCRN_UIC1_BASE 0xd0 | 215 | #define DCRN_UIC1_BASE 0xd0 |
203 | #define DCRN_UIC2_BASE 0x210 | ||
204 | #define DCRN_UICB_BASE 0x200 | ||
205 | #define UIC0 DCRN_UIC0_BASE | 216 | #define UIC0 DCRN_UIC0_BASE |
206 | #define UIC1 DCRN_UIC1_BASE | 217 | #define UIC1 DCRN_UIC1_BASE |
218 | |||
219 | #ifdef CONFIG_440SPE | ||
220 | #define DCRN_UIC2_BASE 0xe0 | ||
221 | #define DCRN_UIC3_BASE 0xf0 | ||
222 | #define UIC2 DCRN_UIC2_BASE | ||
223 | #define UIC3 DCRN_UIC3_BASE | ||
224 | #else | ||
225 | #define DCRN_UIC2_BASE 0x210 | ||
226 | #define DCRN_UICB_BASE 0x200 | ||
207 | #define UIC2 DCRN_UIC2_BASE | 227 | #define UIC2 DCRN_UIC2_BASE |
208 | #define UICB DCRN_UICB_BASE | 228 | #define UICB DCRN_UICB_BASE |
229 | #endif | ||
209 | 230 | ||
210 | #define DCRN_UIC_SR(base) (base + 0x0) | 231 | #define DCRN_UIC_SR(base) (base + 0x0) |
211 | #define DCRN_UIC_ER(base) (base + 0x2) | 232 | #define DCRN_UIC_ER(base) (base + 0x2) |
@@ -218,6 +239,12 @@ | |||
218 | 239 | ||
219 | #define UIC0_UIC1NC 0x00000002 | 240 | #define UIC0_UIC1NC 0x00000002 |
220 | 241 | ||
242 | #ifdef CONFIG_440SPE | ||
243 | #define UIC0_UIC1NC 0x00000002 | ||
244 | #define UIC0_UIC2NC 0x00200000 | ||
245 | #define UIC0_UIC3NC 0x00008000 | ||
246 | #endif | ||
247 | |||
221 | #define UICB_UIC0NC 0x40000000 | 248 | #define UICB_UIC0NC 0x40000000 |
222 | #define UICB_UIC1NC 0x10000000 | 249 | #define UICB_UIC1NC 0x10000000 |
223 | #define UICB_UIC2NC 0x04000000 | 250 | #define UICB_UIC2NC 0x04000000 |
@@ -297,6 +324,23 @@ | |||
297 | #define MALOBISR_CH0 0x80000000 /* EOB channel 1 bit */ | 324 | #define MALOBISR_CH0 0x80000000 /* EOB channel 1 bit */ |
298 | #define MALOBISR_CH2 0x40000000 /* EOB channel 2 bit */ | 325 | #define MALOBISR_CH2 0x40000000 /* EOB channel 2 bit */ |
299 | 326 | ||
327 | #if defined(CONFIG_440SP) || defined(CONFIG_440SPE) | ||
328 | /* 440SP/440SPe PLB Arbiter DCRs */ | ||
329 | #define DCRN_PLB_REVID 0x080 /* PLB Revision ID */ | ||
330 | #define DCRN_PLB_CCR 0x088 /* PLB Crossbar Control */ | ||
331 | |||
332 | #define DCRN_PLB0_ACR 0x081 /* PLB Arbiter Control */ | ||
333 | #define DCRN_PLB0_BESRL 0x082 /* PLB Error Status */ | ||
334 | #define DCRN_PLB0_BESRH 0x083 /* PLB Error Status */ | ||
335 | #define DCRN_PLB0_BEARL 0x084 /* PLB Error Address Low */ | ||
336 | #define DCRN_PLB0_BEARH 0x085 /* PLB Error Address High */ | ||
337 | |||
338 | #define DCRN_PLB1_ACR 0x089 /* PLB Arbiter Control */ | ||
339 | #define DCRN_PLB1_BESRL 0x08a /* PLB Error Status */ | ||
340 | #define DCRN_PLB1_BESRH 0x08b /* PLB Error Status */ | ||
341 | #define DCRN_PLB1_BEARL 0x08c /* PLB Error Address Low */ | ||
342 | #define DCRN_PLB1_BEARH 0x08d /* PLB Error Address High */ | ||
343 | #else | ||
300 | /* 440GP/GX PLB Arbiter DCRs */ | 344 | /* 440GP/GX PLB Arbiter DCRs */ |
301 | #define DCRN_PLB0_REVID 0x082 /* PLB Arbiter Revision ID */ | 345 | #define DCRN_PLB0_REVID 0x082 /* PLB Arbiter Revision ID */ |
302 | #define DCRN_PLB0_ACR 0x083 /* PLB Arbiter Control */ | 346 | #define DCRN_PLB0_ACR 0x083 /* PLB Arbiter Control */ |
@@ -304,6 +348,7 @@ | |||
304 | #define DCRN_PLB0_BEARL 0x086 /* PLB Error Address Low */ | 348 | #define DCRN_PLB0_BEARL 0x086 /* PLB Error Address Low */ |
305 | #define DCRN_PLB0_BEAR DCRN_PLB0_BEARL /* 40x compatibility */ | 349 | #define DCRN_PLB0_BEAR DCRN_PLB0_BEARL /* 40x compatibility */ |
306 | #define DCRN_PLB0_BEARH 0x087 /* PLB Error Address High */ | 350 | #define DCRN_PLB0_BEARH 0x087 /* PLB Error Address High */ |
351 | #endif | ||
307 | 352 | ||
308 | /* 440GP/GX PLB to OPB bridge DCRs */ | 353 | /* 440GP/GX PLB to OPB bridge DCRs */ |
309 | #define DCRN_POB0_BESR0 0x090 | 354 | #define DCRN_POB0_BESR0 0x090 |
@@ -407,9 +452,13 @@ | |||
407 | #define PPC44x_MEM_SIZE_1G 0x40000000 | 452 | #define PPC44x_MEM_SIZE_1G 0x40000000 |
408 | #define PPC44x_MEM_SIZE_2G 0x80000000 | 453 | #define PPC44x_MEM_SIZE_2G 0x80000000 |
409 | 454 | ||
410 | /* 440SP memory controller DCRs */ | 455 | /* 440SP/440SPe memory controller DCRs */ |
411 | #define DCRN_MQ0_BS0BAS 0x40 | 456 | #define DCRN_MQ0_BS0BAS 0x40 |
412 | #define DCRN_MQ0_BS1BAS 0x41 | 457 | #if defined(CONFIG_440SP) |
458 | #define MQ0_NUM_BANKS 2 | ||
459 | #elif defined(CONFIG_440SPE) | ||
460 | #define MQ0_NUM_BANKS 4 | ||
461 | #endif | ||
413 | 462 | ||
414 | #define MQ0_CONFIG_SIZE_MASK 0x0000fff0 | 463 | #define MQ0_CONFIG_SIZE_MASK 0x0000fff0 |
415 | #define MQ0_CONFIG_SIZE_8M 0x0000ffc0 | 464 | #define MQ0_CONFIG_SIZE_8M 0x0000ffc0 |
@@ -421,8 +470,9 @@ | |||
421 | #define MQ0_CONFIG_SIZE_512M 0x0000f000 | 470 | #define MQ0_CONFIG_SIZE_512M 0x0000f000 |
422 | #define MQ0_CONFIG_SIZE_1G 0x0000e000 | 471 | #define MQ0_CONFIG_SIZE_1G 0x0000e000 |
423 | #define MQ0_CONFIG_SIZE_2G 0x0000c000 | 472 | #define MQ0_CONFIG_SIZE_2G 0x0000c000 |
473 | #define MQ0_CONFIG_SIZE_4G 0x00008000 | ||
424 | 474 | ||
425 | /* Internal SRAM Controller 440GX/440SP */ | 475 | /* Internal SRAM Controller 440GX/440SP/440SPe */ |
426 | #define DCRN_SRAM0_BASE 0x000 | 476 | #define DCRN_SRAM0_BASE 0x000 |
427 | 477 | ||
428 | #define DCRN_SRAM0_SB0CR (DCRN_SRAM0_BASE + 0x020) | 478 | #define DCRN_SRAM0_SB0CR (DCRN_SRAM0_BASE + 0x020) |
@@ -446,7 +496,7 @@ | |||
446 | #define DCRN_SRAM0_DPC (DCRN_SRAM0_BASE + 0x02a) | 496 | #define DCRN_SRAM0_DPC (DCRN_SRAM0_BASE + 0x02a) |
447 | #define SRAM_DPC_ENABLE 0x80000000 | 497 | #define SRAM_DPC_ENABLE 0x80000000 |
448 | 498 | ||
449 | /* L2 Cache Controller 440GX/440SP */ | 499 | /* L2 Cache Controller 440GX/440SP/440SPe */ |
450 | #define DCRN_L2C0_CFG 0x030 | 500 | #define DCRN_L2C0_CFG 0x030 |
451 | #define L2C_CFG_L2M 0x80000000 | 501 | #define L2C_CFG_L2M 0x80000000 |
452 | #define L2C_CFG_ICU 0x40000000 | 502 | #define L2C_CFG_ICU 0x40000000 |
@@ -610,8 +660,10 @@ | |||
610 | #define IIC_CLOCK 50 | 660 | #define IIC_CLOCK 50 |
611 | 661 | ||
612 | #undef NR_UICS | 662 | #undef NR_UICS |
613 | #ifdef CONFIG_440GX | 663 | #if defined(CONFIG_440GX) |
614 | #define NR_UICS 3 | 664 | #define NR_UICS 3 |
665 | #elif defined(CONFIG_440SPE) | ||
666 | #define NR_UICS 4 | ||
615 | #else | 667 | #else |
616 | #define NR_UICS 2 | 668 | #define NR_UICS 2 |
617 | #endif | 669 | #endif |
diff --git a/include/asm-ppc/ibm4xx.h b/include/asm-ppc/ibm4xx.h index e992369cb8e9..6c28ae7807f4 100644 --- a/include/asm-ppc/ibm4xx.h +++ b/include/asm-ppc/ibm4xx.h | |||
@@ -97,6 +97,10 @@ void ppc4xx_init(unsigned long r3, unsigned long r4, unsigned long r5, | |||
97 | #include <platforms/4xx/luan.h> | 97 | #include <platforms/4xx/luan.h> |
98 | #endif | 98 | #endif |
99 | 99 | ||
100 | #if defined(CONFIG_YUCCA) | ||
101 | #include <platforms/4xx/yucca.h> | ||
102 | #endif | ||
103 | |||
100 | #if defined(CONFIG_OCOTEA) | 104 | #if defined(CONFIG_OCOTEA) |
101 | #include <platforms/4xx/ocotea.h> | 105 | #include <platforms/4xx/ocotea.h> |
102 | #endif | 106 | #endif |
diff --git a/include/asm-ppc/ibm_ocp.h b/include/asm-ppc/ibm_ocp.h index 6f10a25bd628..9c21de1ff4ed 100644 --- a/include/asm-ppc/ibm_ocp.h +++ b/include/asm-ppc/ibm_ocp.h | |||
@@ -131,9 +131,22 @@ static inline void ibm_ocp_set_emac(int start, int end) | |||
131 | /* Copy MAC addresses to EMAC additions */ | 131 | /* Copy MAC addresses to EMAC additions */ |
132 | for (i=start; i<=end; i++) { | 132 | for (i=start; i<=end; i++) { |
133 | def = ocp_get_one_device(OCP_VENDOR_IBM, OCP_FUNC_EMAC, i); | 133 | def = ocp_get_one_device(OCP_VENDOR_IBM, OCP_FUNC_EMAC, i); |
134 | memcpy(((struct ocp_func_emac_data *)def->additions)->mac_addr, | 134 | if (i == 0) |
135 | &__res.bi_enetaddr[i], | 135 | memcpy(((struct ocp_func_emac_data *)def->additions)->mac_addr, |
136 | 6); | 136 | __res.bi_enetaddr, 6); |
137 | #if defined(CONFIG_405EP) || defined(CONFIG_44x) | ||
138 | else if (i == 1) | ||
139 | memcpy(((struct ocp_func_emac_data *)def->additions)->mac_addr, | ||
140 | __res.bi_enet1addr, 6); | ||
141 | #endif | ||
142 | #if defined(CONFIG_440GX) | ||
143 | else if (i == 2) | ||
144 | memcpy(((struct ocp_func_emac_data *)def->additions)->mac_addr, | ||
145 | __res.bi_enet2addr, 6); | ||
146 | else if (i == 3) | ||
147 | memcpy(((struct ocp_func_emac_data *)def->additions)->mac_addr, | ||
148 | __res.bi_enet3addr, 6); | ||
149 | #endif | ||
137 | } | 150 | } |
138 | } | 151 | } |
139 | #endif | 152 | #endif |
diff --git a/include/asm-ppc/pgtable.h b/include/asm-ppc/pgtable.h index b28a713ba862..6d1c39e8a6af 100644 --- a/include/asm-ppc/pgtable.h +++ b/include/asm-ppc/pgtable.h | |||
@@ -12,6 +12,7 @@ | |||
12 | #include <asm/processor.h> /* For TASK_SIZE */ | 12 | #include <asm/processor.h> /* For TASK_SIZE */ |
13 | #include <asm/mmu.h> | 13 | #include <asm/mmu.h> |
14 | #include <asm/page.h> | 14 | #include <asm/page.h> |
15 | struct mm_struct; | ||
15 | 16 | ||
16 | extern unsigned long va_to_phys(unsigned long address); | 17 | extern unsigned long va_to_phys(unsigned long address); |
17 | extern pte_t *va_to_pte(unsigned long address); | 18 | extern pte_t *va_to_pte(unsigned long address); |
diff --git a/include/asm-ppc/ppcboot.h b/include/asm-ppc/ppcboot.h index fe24e4520208..6b7b63f71daa 100644 --- a/include/asm-ppc/ppcboot.h +++ b/include/asm-ppc/ppcboot.h | |||
@@ -73,8 +73,8 @@ typedef struct bd_info { | |||
73 | #if defined(CONFIG_HYMOD) | 73 | #if defined(CONFIG_HYMOD) |
74 | hymod_conf_t bi_hymod_conf; /* hymod configuration information */ | 74 | hymod_conf_t bi_hymod_conf; /* hymod configuration information */ |
75 | #endif | 75 | #endif |
76 | #if defined(CONFIG_EVB64260) || defined(CONFIG_44x) || defined(CONFIG_85xx) ||\ | 76 | #if defined(CONFIG_EVB64260) || defined(CONFIG_405EP) || defined(CONFIG_44x) || \ |
77 | defined(CONFIG_83xx) | 77 | defined(CONFIG_85xx) || defined(CONFIG_83xx) |
78 | /* second onboard ethernet port */ | 78 | /* second onboard ethernet port */ |
79 | unsigned char bi_enet1addr[6]; | 79 | unsigned char bi_enet1addr[6]; |
80 | #endif | 80 | #endif |
@@ -96,5 +96,7 @@ typedef struct bd_info { | |||
96 | #endif | 96 | #endif |
97 | } bd_t; | 97 | } bd_t; |
98 | 98 | ||
99 | #define bi_tbfreq bi_intfreq | ||
100 | |||
99 | #endif /* __ASSEMBLY__ */ | 101 | #endif /* __ASSEMBLY__ */ |
100 | #endif /* __ASM_PPCBOOT_H__ */ | 102 | #endif /* __ASM_PPCBOOT_H__ */ |
diff --git a/include/asm-ppc/rio.h b/include/asm-ppc/rio.h new file mode 100644 index 000000000000..0018bf80cb25 --- /dev/null +++ b/include/asm-ppc/rio.h | |||
@@ -0,0 +1,18 @@ | |||
1 | /* | ||
2 | * RapidIO architecture support | ||
3 | * | ||
4 | * Copyright 2005 MontaVista Software, Inc. | ||
5 | * Matt Porter <mporter@kernel.crashing.org> | ||
6 | * | ||
7 | * This program is free software; you can redistribute it and/or modify it | ||
8 | * under the terms of the GNU General Public License as published by the | ||
9 | * Free Software Foundation; either version 2 of the License, or (at your | ||
10 | * option) any later version. | ||
11 | */ | ||
12 | |||
13 | #ifndef ASM_PPC_RIO_H | ||
14 | #define ASM_PPC_RIO_H | ||
15 | |||
16 | extern void platform_rio_init(void); | ||
17 | |||
18 | #endif /* ASM_PPC_RIO_H */ | ||
diff --git a/include/asm-ppc64/pgtable-4k.h b/include/asm-ppc64/pgtable-4k.h index c883a2748558..e9590c06ad92 100644 --- a/include/asm-ppc64/pgtable-4k.h +++ b/include/asm-ppc64/pgtable-4k.h | |||
@@ -23,6 +23,9 @@ | |||
23 | #define PMD_SIZE (1UL << PMD_SHIFT) | 23 | #define PMD_SIZE (1UL << PMD_SHIFT) |
24 | #define PMD_MASK (~(PMD_SIZE-1)) | 24 | #define PMD_MASK (~(PMD_SIZE-1)) |
25 | 25 | ||
26 | /* With 4k base page size, hugepage PTEs go at the PMD level */ | ||
27 | #define MIN_HUGEPTE_SHIFT PMD_SHIFT | ||
28 | |||
26 | /* PUD_SHIFT determines what a third-level page table entry can map */ | 29 | /* PUD_SHIFT determines what a third-level page table entry can map */ |
27 | #define PUD_SHIFT (PMD_SHIFT + PMD_INDEX_SIZE) | 30 | #define PUD_SHIFT (PMD_SHIFT + PMD_INDEX_SIZE) |
28 | #define PUD_SIZE (1UL << PUD_SHIFT) | 31 | #define PUD_SIZE (1UL << PUD_SHIFT) |
diff --git a/include/asm-ppc64/pgtable-64k.h b/include/asm-ppc64/pgtable-64k.h index c5f437c86b3c..154f1840ece4 100644 --- a/include/asm-ppc64/pgtable-64k.h +++ b/include/asm-ppc64/pgtable-64k.h | |||
@@ -14,6 +14,9 @@ | |||
14 | #define PTRS_PER_PMD (1 << PMD_INDEX_SIZE) | 14 | #define PTRS_PER_PMD (1 << PMD_INDEX_SIZE) |
15 | #define PTRS_PER_PGD (1 << PGD_INDEX_SIZE) | 15 | #define PTRS_PER_PGD (1 << PGD_INDEX_SIZE) |
16 | 16 | ||
17 | /* With 4k base page size, hugepage PTEs go at the PMD level */ | ||
18 | #define MIN_HUGEPTE_SHIFT PAGE_SHIFT | ||
19 | |||
17 | /* PMD_SHIFT determines what a second-level page table entry can map */ | 20 | /* PMD_SHIFT determines what a second-level page table entry can map */ |
18 | #define PMD_SHIFT (PAGE_SHIFT + PTE_INDEX_SIZE) | 21 | #define PMD_SHIFT (PAGE_SHIFT + PTE_INDEX_SIZE) |
19 | #define PMD_SIZE (1UL << PMD_SHIFT) | 22 | #define PMD_SIZE (1UL << PMD_SHIFT) |
diff --git a/include/asm-ppc64/pgtable.h b/include/asm-ppc64/pgtable.h index fde93ec36abc..a9783ba7fe98 100644 --- a/include/asm-ppc64/pgtable.h +++ b/include/asm-ppc64/pgtable.h | |||
@@ -13,6 +13,7 @@ | |||
13 | #include <asm/mmu.h> | 13 | #include <asm/mmu.h> |
14 | #include <asm/page.h> | 14 | #include <asm/page.h> |
15 | #include <asm/tlbflush.h> | 15 | #include <asm/tlbflush.h> |
16 | struct mm_struct; | ||
16 | #endif /* __ASSEMBLY__ */ | 17 | #endif /* __ASSEMBLY__ */ |
17 | 18 | ||
18 | #ifdef CONFIG_PPC_64K_PAGES | 19 | #ifdef CONFIG_PPC_64K_PAGES |
diff --git a/include/asm-s390/bitops.h b/include/asm-s390/bitops.h index 8651524217fd..b07c578b22ea 100644 --- a/include/asm-s390/bitops.h +++ b/include/asm-s390/bitops.h | |||
@@ -518,8 +518,8 @@ static inline int __test_bit(unsigned long nr, const volatile unsigned long *ptr | |||
518 | 518 | ||
519 | static inline int | 519 | static inline int |
520 | __constant_test_bit(unsigned long nr, const volatile unsigned long *addr) { | 520 | __constant_test_bit(unsigned long nr, const volatile unsigned long *addr) { |
521 | return (((volatile char *) addr) | 521 | return ((((volatile char *) addr) |
522 | [(nr^(__BITOPS_WORDSIZE-8))>>3] & (1<<(nr&7))); | 522 | [(nr^(__BITOPS_WORDSIZE-8))>>3] & (1<<(nr&7)))) != 0; |
523 | } | 523 | } |
524 | 524 | ||
525 | #define test_bit(nr,addr) \ | 525 | #define test_bit(nr,addr) \ |
diff --git a/include/asm-s390/elf.h b/include/asm-s390/elf.h index 3b8bd46832a1..372d51cccd53 100644 --- a/include/asm-s390/elf.h +++ b/include/asm-s390/elf.h | |||
@@ -96,6 +96,7 @@ | |||
96 | * ELF register definitions.. | 96 | * ELF register definitions.. |
97 | */ | 97 | */ |
98 | 98 | ||
99 | #include <linux/sched.h> /* for task_struct */ | ||
99 | #include <asm/ptrace.h> | 100 | #include <asm/ptrace.h> |
100 | #include <asm/user.h> | 101 | #include <asm/user.h> |
101 | #include <asm/system.h> /* for save_access_regs */ | 102 | #include <asm/system.h> /* for save_access_regs */ |
diff --git a/include/asm-s390/pgtable.h b/include/asm-s390/pgtable.h index df94f89038cc..9be741bb1496 100644 --- a/include/asm-s390/pgtable.h +++ b/include/asm-s390/pgtable.h | |||
@@ -36,6 +36,7 @@ | |||
36 | #include <linux/threads.h> | 36 | #include <linux/threads.h> |
37 | 37 | ||
38 | struct vm_area_struct; /* forward declaration (include/linux/mm.h) */ | 38 | struct vm_area_struct; /* forward declaration (include/linux/mm.h) */ |
39 | struct mm_struct; | ||
39 | 40 | ||
40 | extern pgd_t swapper_pg_dir[] __attribute__ ((aligned (4096))); | 41 | extern pgd_t swapper_pg_dir[] __attribute__ ((aligned (4096))); |
41 | extern void paging_init(void); | 42 | extern void paging_init(void); |
diff --git a/include/asm-s390/ptrace.h b/include/asm-s390/ptrace.h index fc7c96edc697..a949cc077cc7 100644 --- a/include/asm-s390/ptrace.h +++ b/include/asm-s390/ptrace.h | |||
@@ -468,6 +468,8 @@ struct user_regs_struct | |||
468 | }; | 468 | }; |
469 | 469 | ||
470 | #ifdef __KERNEL__ | 470 | #ifdef __KERNEL__ |
471 | #define __ARCH_SYS_PTRACE 1 | ||
472 | |||
471 | #define user_mode(regs) (((regs)->psw.mask & PSW_MASK_PSTATE) != 0) | 473 | #define user_mode(regs) (((regs)->psw.mask & PSW_MASK_PSTATE) != 0) |
472 | #define instruction_pointer(regs) ((regs)->psw.addr & PSW_ADDR_INSN) | 474 | #define instruction_pointer(regs) ((regs)->psw.addr & PSW_ADDR_INSN) |
473 | #define profile_pc(regs) instruction_pointer(regs) | 475 | #define profile_pc(regs) instruction_pointer(regs) |
diff --git a/include/asm-s390/uaccess.h b/include/asm-s390/uaccess.h index 38a5cf8ab9e3..10a619da4761 100644 --- a/include/asm-s390/uaccess.h +++ b/include/asm-s390/uaccess.h | |||
@@ -200,21 +200,37 @@ extern int __put_user_bad(void) __attribute__((noreturn)); | |||
200 | 200 | ||
201 | #define __get_user(x, ptr) \ | 201 | #define __get_user(x, ptr) \ |
202 | ({ \ | 202 | ({ \ |
203 | __typeof__(*(ptr)) __x; \ | ||
204 | int __gu_err; \ | 203 | int __gu_err; \ |
205 | __chk_user_ptr(ptr); \ | 204 | __chk_user_ptr(ptr); \ |
206 | switch (sizeof(*(ptr))) { \ | 205 | switch (sizeof(*(ptr))) { \ |
207 | case 1: \ | 206 | case 1: { \ |
208 | case 2: \ | 207 | unsigned char __x; \ |
209 | case 4: \ | 208 | __get_user_asm(__x, ptr, __gu_err); \ |
210 | case 8: \ | 209 | (x) = (__typeof__(*(ptr))) __x; \ |
210 | break; \ | ||
211 | }; \ | ||
212 | case 2: { \ | ||
213 | unsigned short __x; \ | ||
214 | __get_user_asm(__x, ptr, __gu_err); \ | ||
215 | (x) = (__typeof__(*(ptr))) __x; \ | ||
216 | break; \ | ||
217 | }; \ | ||
218 | case 4: { \ | ||
219 | unsigned int __x; \ | ||
220 | __get_user_asm(__x, ptr, __gu_err); \ | ||
221 | (x) = (__typeof__(*(ptr))) __x; \ | ||
222 | break; \ | ||
223 | }; \ | ||
224 | case 8: { \ | ||
225 | unsigned long long __x; \ | ||
211 | __get_user_asm(__x, ptr, __gu_err); \ | 226 | __get_user_asm(__x, ptr, __gu_err); \ |
227 | (x) = (__typeof__(*(ptr))) __x; \ | ||
212 | break; \ | 228 | break; \ |
229 | }; \ | ||
213 | default: \ | 230 | default: \ |
214 | __get_user_bad(); \ | 231 | __get_user_bad(); \ |
215 | break; \ | 232 | break; \ |
216 | } \ | 233 | } \ |
217 | (x) = __x; \ | ||
218 | __gu_err; \ | 234 | __gu_err; \ |
219 | }) | 235 | }) |
220 | 236 | ||
diff --git a/include/asm-s390/vtoc.h b/include/asm-s390/vtoc.h index a14e34e80b88..41d369f38b0e 100644 --- a/include/asm-s390/vtoc.h +++ b/include/asm-s390/vtoc.h | |||
@@ -1,372 +1,179 @@ | |||
1 | #ifndef __KERNEL__ | 1 | /* |
2 | #include <string.h> | 2 | * include/asm-s390/vtoc.h |
3 | #include <stdlib.h> | 3 | * |
4 | #include <stdio.h> | 4 | * This file contains volume label definitions for DASD devices. |
5 | #include <errno.h> | 5 | * |
6 | #include <ctype.h> | 6 | * (C) Copyright IBM Corp. 2005 |
7 | #include <time.h> | 7 | * |
8 | #include <fcntl.h> | 8 | * Author(s): Volker Sameske <sameske@de.ibm.com> |
9 | #include <unistd.h> | 9 | * |
10 | */ | ||
11 | |||
12 | #ifndef _ASM_S390_VTOC_H | ||
13 | #define _ASM_S390_VTOC_H | ||
10 | 14 | ||
11 | #include <sys/stat.h> | ||
12 | #include <sys/ioctl.h> | ||
13 | |||
14 | #include <linux/fs.h> | ||
15 | #include <linux/types.h> | 15 | #include <linux/types.h> |
16 | #include <linux/hdreg.h> | ||
17 | #include <asm/dasd.h> | ||
18 | #endif | ||
19 | |||
20 | |||
21 | #define LINE_LENGTH 80 | ||
22 | #define VTOC_START_CC 0x0 | ||
23 | #define VTOC_START_HH 0x1 | ||
24 | #define FIRST_USABLE_CYL 1 | ||
25 | #define FIRST_USABLE_TRK 2 | ||
26 | |||
27 | #define DASD_3380_TYPE 13148 | ||
28 | #define DASD_3390_TYPE 13200 | ||
29 | #define DASD_9345_TYPE 37701 | ||
30 | |||
31 | #define DASD_3380_VALUE 0xbb60 | ||
32 | #define DASD_3390_VALUE 0xe5a2 | ||
33 | #define DASD_9345_VALUE 0xbc98 | ||
34 | |||
35 | #define VOLSER_LENGTH 6 | ||
36 | #define BIG_DISK_SIZE 0x10000 | ||
37 | |||
38 | #define VTOC_ERROR "VTOC error:" | ||
39 | |||
40 | 16 | ||
41 | typedef struct ttr | 17 | struct vtoc_ttr |
42 | { | 18 | { |
43 | __u16 tt; | 19 | __u16 tt; |
44 | __u8 r; | 20 | __u8 r; |
45 | } __attribute__ ((packed)) ttr_t; | 21 | } __attribute__ ((packed)); |
46 | 22 | ||
47 | typedef struct cchhb | 23 | struct vtoc_cchhb |
48 | { | 24 | { |
49 | __u16 cc; | 25 | __u16 cc; |
50 | __u16 hh; | 26 | __u16 hh; |
51 | __u8 b; | 27 | __u8 b; |
52 | } __attribute__ ((packed)) cchhb_t; | 28 | } __attribute__ ((packed)); |
53 | 29 | ||
54 | typedef struct cchh | 30 | struct vtoc_cchh |
55 | { | 31 | { |
56 | __u16 cc; | 32 | __u16 cc; |
57 | __u16 hh; | 33 | __u16 hh; |
58 | } __attribute__ ((packed)) cchh_t; | 34 | } __attribute__ ((packed)); |
59 | 35 | ||
60 | typedef struct labeldate | 36 | struct vtoc_labeldate |
61 | { | 37 | { |
62 | __u8 year; | 38 | __u8 year; |
63 | __u16 day; | 39 | __u16 day; |
64 | } __attribute__ ((packed)) labeldate_t; | 40 | } __attribute__ ((packed)); |
65 | 41 | ||
66 | 42 | struct vtoc_volume_label | |
67 | typedef struct volume_label | ||
68 | { | 43 | { |
69 | char volkey[4]; /* volume key = volume label */ | 44 | char volkey[4]; /* volume key = volume label */ |
70 | char vollbl[4]; /* volume label */ | 45 | char vollbl[4]; /* volume label */ |
71 | char volid[6]; /* volume identifier */ | 46 | char volid[6]; /* volume identifier */ |
72 | __u8 security; /* security byte */ | 47 | __u8 security; /* security byte */ |
73 | cchhb_t vtoc; /* VTOC address */ | 48 | struct vtoc_cchhb vtoc; /* VTOC address */ |
74 | char res1[5]; /* reserved */ | 49 | char res1[5]; /* reserved */ |
75 | char cisize[4]; /* CI-size for FBA,... */ | 50 | char cisize[4]; /* CI-size for FBA,... */ |
76 | /* ...blanks for CKD */ | 51 | /* ...blanks for CKD */ |
77 | char blkperci[4]; /* no of blocks per CI (FBA), blanks for CKD */ | 52 | char blkperci[4]; /* no of blocks per CI (FBA), blanks for CKD */ |
78 | char labperci[4]; /* no of labels per CI (FBA), blanks for CKD */ | 53 | char labperci[4]; /* no of labels per CI (FBA), blanks for CKD */ |
79 | char res2[4]; /* reserved */ | 54 | char res2[4]; /* reserved */ |
80 | char lvtoc[14]; /* owner code for LVTOC */ | 55 | char lvtoc[14]; /* owner code for LVTOC */ |
81 | char res3[29]; /* reserved */ | 56 | char res3[29]; /* reserved */ |
82 | } __attribute__ ((packed)) volume_label_t; | 57 | } __attribute__ ((packed)); |
83 | 58 | ||
84 | 59 | struct vtoc_extent | |
85 | typedef struct extent | ||
86 | { | 60 | { |
87 | __u8 typeind; /* extent type indicator */ | 61 | __u8 typeind; /* extent type indicator */ |
88 | __u8 seqno; /* extent sequence number */ | 62 | __u8 seqno; /* extent sequence number */ |
89 | cchh_t llimit; /* starting point of this extent */ | 63 | struct vtoc_cchh llimit; /* starting point of this extent */ |
90 | cchh_t ulimit; /* ending point of this extent */ | 64 | struct vtoc_cchh ulimit; /* ending point of this extent */ |
91 | } __attribute__ ((packed)) extent_t; | 65 | } __attribute__ ((packed)); |
92 | |||
93 | 66 | ||
94 | typedef struct dev_const | 67 | struct vtoc_dev_const |
95 | { | 68 | { |
96 | __u16 DS4DSCYL; /* number of logical cyls */ | 69 | __u16 DS4DSCYL; /* number of logical cyls */ |
97 | __u16 DS4DSTRK; /* number of tracks in a logical cylinder */ | 70 | __u16 DS4DSTRK; /* number of tracks in a logical cylinder */ |
98 | __u16 DS4DEVTK; /* device track length */ | 71 | __u16 DS4DEVTK; /* device track length */ |
99 | __u8 DS4DEVI; /* non-last keyed record overhead */ | 72 | __u8 DS4DEVI; /* non-last keyed record overhead */ |
100 | __u8 DS4DEVL; /* last keyed record overhead */ | 73 | __u8 DS4DEVL; /* last keyed record overhead */ |
101 | __u8 DS4DEVK; /* non-keyed record overhead differential */ | 74 | __u8 DS4DEVK; /* non-keyed record overhead differential */ |
102 | __u8 DS4DEVFG; /* flag byte */ | 75 | __u8 DS4DEVFG; /* flag byte */ |
103 | __u16 DS4DEVTL; /* device tolerance */ | 76 | __u16 DS4DEVTL; /* device tolerance */ |
104 | __u8 DS4DEVDT; /* number of DSCB's per track */ | 77 | __u8 DS4DEVDT; /* number of DSCB's per track */ |
105 | __u8 DS4DEVDB; /* number of directory blocks per track */ | 78 | __u8 DS4DEVDB; /* number of directory blocks per track */ |
106 | } __attribute__ ((packed)) dev_const_t; | 79 | } __attribute__ ((packed)); |
107 | 80 | ||
108 | 81 | struct vtoc_format1_label | |
109 | typedef struct format1_label | ||
110 | { | 82 | { |
111 | char DS1DSNAM[44]; /* data set name */ | 83 | char DS1DSNAM[44]; /* data set name */ |
112 | __u8 DS1FMTID; /* format identifier */ | 84 | __u8 DS1FMTID; /* format identifier */ |
113 | char DS1DSSN[6]; /* data set serial number */ | 85 | char DS1DSSN[6]; /* data set serial number */ |
114 | __u16 DS1VOLSQ; /* volume sequence number */ | 86 | __u16 DS1VOLSQ; /* volume sequence number */ |
115 | labeldate_t DS1CREDT; /* creation date: ydd */ | 87 | struct vtoc_labeldate DS1CREDT; /* creation date: ydd */ |
116 | labeldate_t DS1EXPDT; /* expiration date */ | 88 | struct vtoc_labeldate DS1EXPDT; /* expiration date */ |
117 | __u8 DS1NOEPV; /* number of extents on volume */ | 89 | __u8 DS1NOEPV; /* number of extents on volume */ |
118 | __u8 DS1NOBDB; /* no. of bytes used in last direction blk */ | 90 | __u8 DS1NOBDB; /* no. of bytes used in last direction blk */ |
119 | __u8 DS1FLAG1; /* flag 1 */ | 91 | __u8 DS1FLAG1; /* flag 1 */ |
120 | char DS1SYSCD[13]; /* system code */ | 92 | char DS1SYSCD[13]; /* system code */ |
121 | labeldate_t DS1REFD; /* date last referenced */ | 93 | struct vtoc_labeldate DS1REFD; /* date last referenced */ |
122 | __u8 DS1SMSFG; /* system managed storage indicators */ | 94 | __u8 DS1SMSFG; /* system managed storage indicators */ |
123 | __u8 DS1SCXTF; /* sec. space extension flag byte */ | 95 | __u8 DS1SCXTF; /* sec. space extension flag byte */ |
124 | __u16 DS1SCXTV; /* secondary space extension value */ | 96 | __u16 DS1SCXTV; /* secondary space extension value */ |
125 | __u8 DS1DSRG1; /* data set organisation byte 1 */ | 97 | __u8 DS1DSRG1; /* data set organisation byte 1 */ |
126 | __u8 DS1DSRG2; /* data set organisation byte 2 */ | 98 | __u8 DS1DSRG2; /* data set organisation byte 2 */ |
127 | __u8 DS1RECFM; /* record format */ | 99 | __u8 DS1RECFM; /* record format */ |
128 | __u8 DS1OPTCD; /* option code */ | 100 | __u8 DS1OPTCD; /* option code */ |
129 | __u16 DS1BLKL; /* block length */ | 101 | __u16 DS1BLKL; /* block length */ |
130 | __u16 DS1LRECL; /* record length */ | 102 | __u16 DS1LRECL; /* record length */ |
131 | __u8 DS1KEYL; /* key length */ | 103 | __u8 DS1KEYL; /* key length */ |
132 | __u16 DS1RKP; /* relative key position */ | 104 | __u16 DS1RKP; /* relative key position */ |
133 | __u8 DS1DSIND; /* data set indicators */ | 105 | __u8 DS1DSIND; /* data set indicators */ |
134 | __u8 DS1SCAL1; /* secondary allocation flag byte */ | 106 | __u8 DS1SCAL1; /* secondary allocation flag byte */ |
135 | char DS1SCAL3[3]; /* secondary allocation quantity */ | 107 | char DS1SCAL3[3]; /* secondary allocation quantity */ |
136 | ttr_t DS1LSTAR; /* last used track and block on track */ | 108 | struct vtoc_ttr DS1LSTAR; /* last used track and block on track */ |
137 | __u16 DS1TRBAL; /* space remaining on last used track */ | 109 | __u16 DS1TRBAL; /* space remaining on last used track */ |
138 | __u16 res1; /* reserved */ | 110 | __u16 res1; /* reserved */ |
139 | extent_t DS1EXT1; /* first extent description */ | 111 | struct vtoc_extent DS1EXT1; /* first extent description */ |
140 | extent_t DS1EXT2; /* second extent description */ | 112 | struct vtoc_extent DS1EXT2; /* second extent description */ |
141 | extent_t DS1EXT3; /* third extent description */ | 113 | struct vtoc_extent DS1EXT3; /* third extent description */ |
142 | cchhb_t DS1PTRDS; /* possible pointer to f2 or f3 DSCB */ | 114 | struct vtoc_cchhb DS1PTRDS; /* possible pointer to f2 or f3 DSCB */ |
143 | } __attribute__ ((packed)) format1_label_t; | 115 | } __attribute__ ((packed)); |
144 | 116 | ||
145 | 117 | struct vtoc_format4_label | |
146 | typedef struct format4_label | ||
147 | { | 118 | { |
148 | char DS4KEYCD[44]; /* key code for VTOC labels: 44 times 0x04 */ | 119 | char DS4KEYCD[44]; /* key code for VTOC labels: 44 times 0x04 */ |
149 | __u8 DS4IDFMT; /* format identifier */ | 120 | __u8 DS4IDFMT; /* format identifier */ |
150 | cchhb_t DS4HPCHR; /* highest address of a format 1 DSCB */ | 121 | struct vtoc_cchhb DS4HPCHR; /* highest address of a format 1 DSCB */ |
151 | __u16 DS4DSREC; /* number of available DSCB's */ | 122 | __u16 DS4DSREC; /* number of available DSCB's */ |
152 | cchh_t DS4HCCHH; /* CCHH of next available alternate track */ | 123 | struct vtoc_cchh DS4HCCHH; /* CCHH of next available alternate track */ |
153 | __u16 DS4NOATK; /* number of remaining alternate tracks */ | 124 | __u16 DS4NOATK; /* number of remaining alternate tracks */ |
154 | __u8 DS4VTOCI; /* VTOC indicators */ | 125 | __u8 DS4VTOCI; /* VTOC indicators */ |
155 | __u8 DS4NOEXT; /* number of extents in VTOC */ | 126 | __u8 DS4NOEXT; /* number of extents in VTOC */ |
156 | __u8 DS4SMSFG; /* system managed storage indicators */ | 127 | __u8 DS4SMSFG; /* system managed storage indicators */ |
157 | __u8 DS4DEVAC; /* number of alternate cylinders. | 128 | __u8 DS4DEVAC; /* number of alternate cylinders. |
158 | Subtract from first two bytes of | 129 | * Subtract from first two bytes of |
159 | DS4DEVSZ to get number of usable | 130 | * DS4DEVSZ to get number of usable |
160 | cylinders. can be zero. valid | 131 | * cylinders. can be zero. valid |
161 | only if DS4DEVAV on. */ | 132 | * only if DS4DEVAV on. */ |
162 | dev_const_t DS4DEVCT; /* device constants */ | 133 | struct vtoc_dev_const DS4DEVCT; /* device constants */ |
163 | char DS4AMTIM[8]; /* VSAM time stamp */ | 134 | char DS4AMTIM[8]; /* VSAM time stamp */ |
164 | char DS4AMCAT[3]; /* VSAM catalog indicator */ | 135 | char DS4AMCAT[3]; /* VSAM catalog indicator */ |
165 | char DS4R2TIM[8]; /* VSAM volume/catalog match time stamp */ | 136 | char DS4R2TIM[8]; /* VSAM volume/catalog match time stamp */ |
166 | char res1[5]; /* reserved */ | 137 | char res1[5]; /* reserved */ |
167 | char DS4F6PTR[5]; /* pointer to first format 6 DSCB */ | 138 | char DS4F6PTR[5]; /* pointer to first format 6 DSCB */ |
168 | extent_t DS4VTOCE; /* VTOC extent description */ | 139 | struct vtoc_extent DS4VTOCE; /* VTOC extent description */ |
169 | char res2[10]; /* reserved */ | 140 | char res2[10]; /* reserved */ |
170 | __u8 DS4EFLVL; /* extended free-space management level */ | 141 | __u8 DS4EFLVL; /* extended free-space management level */ |
171 | cchhb_t DS4EFPTR; /* pointer to extended free-space info */ | 142 | struct vtoc_cchhb DS4EFPTR; /* pointer to extended free-space info */ |
172 | char res3[9]; /* reserved */ | 143 | char res3[9]; /* reserved */ |
173 | } __attribute__ ((packed)) format4_label_t; | 144 | } __attribute__ ((packed)); |
174 | 145 | ||
175 | 146 | struct vtoc_ds5ext | |
176 | typedef struct ds5ext | ||
177 | { | 147 | { |
178 | __u16 t; /* RTA of the first track of free extent */ | 148 | __u16 t; /* RTA of the first track of free extent */ |
179 | __u16 fc; /* number of whole cylinders in free ext. */ | 149 | __u16 fc; /* number of whole cylinders in free ext. */ |
180 | __u8 ft; /* number of remaining free tracks */ | 150 | __u8 ft; /* number of remaining free tracks */ |
181 | } __attribute__ ((packed)) ds5ext_t; | 151 | } __attribute__ ((packed)); |
182 | |||
183 | 152 | ||
184 | typedef struct format5_label | 153 | struct vtoc_format5_label |
185 | { | 154 | { |
186 | char DS5KEYID[4]; /* key identifier */ | 155 | char DS5KEYID[4]; /* key identifier */ |
187 | ds5ext_t DS5AVEXT; /* first available (free-space) extent. */ | 156 | struct vtoc_ds5ext DS5AVEXT; /* first available (free-space) extent. */ |
188 | ds5ext_t DS5EXTAV[7]; /* seven available extents */ | 157 | struct vtoc_ds5ext DS5EXTAV[7]; /* seven available extents */ |
189 | __u8 DS5FMTID; /* format identifier */ | 158 | __u8 DS5FMTID; /* format identifier */ |
190 | ds5ext_t DS5MAVET[18]; /* eighteen available extents */ | 159 | struct vtoc_ds5ext DS5MAVET[18]; /* eighteen available extents */ |
191 | cchhb_t DS5PTRDS; /* pointer to next format5 DSCB */ | 160 | struct vtoc_cchhb DS5PTRDS; /* pointer to next format5 DSCB */ |
192 | } __attribute__ ((packed)) format5_label_t; | 161 | } __attribute__ ((packed)); |
193 | 162 | ||
194 | 163 | struct vtoc_ds7ext | |
195 | typedef struct ds7ext | ||
196 | { | 164 | { |
197 | __u32 a; /* starting RTA value */ | 165 | __u32 a; /* starting RTA value */ |
198 | __u32 b; /* ending RTA value + 1 */ | 166 | __u32 b; /* ending RTA value + 1 */ |
199 | } __attribute__ ((packed)) ds7ext_t; | 167 | } __attribute__ ((packed)); |
200 | 168 | ||
201 | 169 | struct vtoc_format7_label | |
202 | typedef struct format7_label | ||
203 | { | 170 | { |
204 | char DS7KEYID[4]; /* key identifier */ | 171 | char DS7KEYID[4]; /* key identifier */ |
205 | ds7ext_t DS7EXTNT[5]; /* space for 5 extent descriptions */ | 172 | struct vtoc_ds7ext DS7EXTNT[5]; /* space for 5 extent descriptions */ |
206 | __u8 DS7FMTID; /* format identifier */ | 173 | __u8 DS7FMTID; /* format identifier */ |
207 | ds7ext_t DS7ADEXT[11]; /* space for 11 extent descriptions */ | 174 | struct vtoc_ds7ext DS7ADEXT[11]; /* space for 11 extent descriptions */ |
208 | char res1[2]; /* reserved */ | 175 | char res1[2]; /* reserved */ |
209 | cchhb_t DS7PTRDS; /* pointer to next FMT7 DSCB */ | 176 | struct vtoc_cchhb DS7PTRDS; /* pointer to next FMT7 DSCB */ |
210 | } __attribute__ ((packed)) format7_label_t; | 177 | } __attribute__ ((packed)); |
211 | 178 | ||
212 | 179 | #endif /* _ASM_S390_VTOC_H */ | |
213 | char * vtoc_ebcdic_enc ( | ||
214 | unsigned char source[LINE_LENGTH], | ||
215 | unsigned char target[LINE_LENGTH], | ||
216 | int l); | ||
217 | char * vtoc_ebcdic_dec ( | ||
218 | unsigned char source[LINE_LENGTH], | ||
219 | unsigned char target[LINE_LENGTH], | ||
220 | int l); | ||
221 | void vtoc_set_extent ( | ||
222 | extent_t * ext, | ||
223 | __u8 typeind, | ||
224 | __u8 seqno, | ||
225 | cchh_t * lower, | ||
226 | cchh_t * upper); | ||
227 | void vtoc_set_cchh ( | ||
228 | cchh_t * addr, | ||
229 | __u16 cc, | ||
230 | __u16 hh); | ||
231 | void vtoc_set_cchhb ( | ||
232 | cchhb_t * addr, | ||
233 | __u16 cc, | ||
234 | __u16 hh, | ||
235 | __u8 b); | ||
236 | void vtoc_set_date ( | ||
237 | labeldate_t * d, | ||
238 | __u8 year, | ||
239 | __u16 day); | ||
240 | |||
241 | void vtoc_volume_label_init ( | ||
242 | volume_label_t *vlabel); | ||
243 | |||
244 | int vtoc_read_volume_label ( | ||
245 | char * device, | ||
246 | unsigned long vlabel_start, | ||
247 | volume_label_t * vlabel); | ||
248 | |||
249 | int vtoc_write_volume_label ( | ||
250 | char *device, | ||
251 | unsigned long vlabel_start, | ||
252 | volume_label_t *vlabel); | ||
253 | |||
254 | void vtoc_volume_label_set_volser ( | ||
255 | volume_label_t *vlabel, | ||
256 | char *volser); | ||
257 | |||
258 | char *vtoc_volume_label_get_volser ( | ||
259 | volume_label_t *vlabel, | ||
260 | char *volser); | ||
261 | |||
262 | void vtoc_volume_label_set_key ( | ||
263 | volume_label_t *vlabel, | ||
264 | char *key); | ||
265 | |||
266 | void vtoc_volume_label_set_label ( | ||
267 | volume_label_t *vlabel, | ||
268 | char *lbl); | ||
269 | |||
270 | char *vtoc_volume_label_get_label ( | ||
271 | volume_label_t *vlabel, | ||
272 | char *lbl); | ||
273 | |||
274 | void vtoc_read_label ( | ||
275 | char *device, | ||
276 | unsigned long position, | ||
277 | format1_label_t *f1, | ||
278 | format4_label_t *f4, | ||
279 | format5_label_t *f5, | ||
280 | format7_label_t *f7); | ||
281 | |||
282 | void vtoc_write_label ( | ||
283 | char *device, | ||
284 | unsigned long position, | ||
285 | format1_label_t *f1, | ||
286 | format4_label_t *f4, | ||
287 | format5_label_t *f5, | ||
288 | format7_label_t *f7); | ||
289 | |||
290 | |||
291 | void vtoc_init_format1_label ( | ||
292 | char *volid, | ||
293 | unsigned int blksize, | ||
294 | extent_t *part_extent, | ||
295 | format1_label_t *f1); | ||
296 | |||
297 | |||
298 | void vtoc_init_format4_label ( | ||
299 | format4_label_t *f4lbl, | ||
300 | unsigned int usable_partitions, | ||
301 | unsigned int cylinders, | ||
302 | unsigned int tracks, | ||
303 | unsigned int blocks, | ||
304 | unsigned int blksize, | ||
305 | __u16 dev_type); | ||
306 | |||
307 | void vtoc_update_format4_label ( | ||
308 | format4_label_t *f4, | ||
309 | cchhb_t *highest_f1, | ||
310 | __u16 unused_update); | ||
311 | |||
312 | |||
313 | void vtoc_init_format5_label ( | ||
314 | format5_label_t *f5); | ||
315 | |||
316 | void vtoc_update_format5_label_add ( | ||
317 | format5_label_t *f5, | ||
318 | int verbose, | ||
319 | int cyl, | ||
320 | int trk, | ||
321 | __u16 a, | ||
322 | __u16 b, | ||
323 | __u8 c); | ||
324 | |||
325 | void vtoc_update_format5_label_del ( | ||
326 | format5_label_t *f5, | ||
327 | int verbose, | ||
328 | int cyl, | ||
329 | int trk, | ||
330 | __u16 a, | ||
331 | __u16 b, | ||
332 | __u8 c); | ||
333 | |||
334 | |||
335 | void vtoc_init_format7_label ( | ||
336 | format7_label_t *f7); | ||
337 | |||
338 | void vtoc_update_format7_label_add ( | ||
339 | format7_label_t *f7, | ||
340 | int verbose, | ||
341 | __u32 a, | ||
342 | __u32 b); | ||
343 | |||
344 | void vtoc_update_format7_label_del ( | ||
345 | format7_label_t *f7, | ||
346 | int verbose, | ||
347 | __u32 a, | ||
348 | __u32 b); | ||
349 | |||
350 | |||
351 | void vtoc_set_freespace( | ||
352 | format4_label_t *f4, | ||
353 | format5_label_t *f5, | ||
354 | format7_label_t *f7, | ||
355 | char ch, | ||
356 | int verbose, | ||
357 | __u32 start, | ||
358 | __u32 stop, | ||
359 | int cyl, | ||
360 | int trk); | ||
361 | |||
362 | |||
363 | |||
364 | |||
365 | |||
366 | |||
367 | |||
368 | |||
369 | |||
370 | |||
371 | |||
372 | |||
diff --git a/include/asm-sh/elf.h b/include/asm-sh/elf.h index 8fe00a1981ce..1b63dfeea4f2 100644 --- a/include/asm-sh/elf.h +++ b/include/asm-sh/elf.h | |||
@@ -111,6 +111,7 @@ typedef struct user_fpu_struct elf_fpregset_t; | |||
111 | 111 | ||
112 | #ifdef __KERNEL__ | 112 | #ifdef __KERNEL__ |
113 | #define SET_PERSONALITY(ex, ibcs2) set_personality(PER_LINUX_32BIT) | 113 | #define SET_PERSONALITY(ex, ibcs2) set_personality(PER_LINUX_32BIT) |
114 | struct task_struct; | ||
114 | extern int dump_task_regs (struct task_struct *, elf_gregset_t *); | 115 | extern int dump_task_regs (struct task_struct *, elf_gregset_t *); |
115 | extern int dump_task_fpu (struct task_struct *, elf_fpregset_t *); | 116 | extern int dump_task_fpu (struct task_struct *, elf_fpregset_t *); |
116 | 117 | ||
diff --git a/include/asm-sh/mmzone.h b/include/asm-sh/mmzone.h deleted file mode 100644 index 0e7406601fdf..000000000000 --- a/include/asm-sh/mmzone.h +++ /dev/null | |||
@@ -1,61 +0,0 @@ | |||
1 | /* | ||
2 | * linux/include/asm-sh/mmzone.h | ||
3 | * | ||
4 | * This program is free software; you can redistribute it and/or modify | ||
5 | * it under the terms of the GNU General Public License version 2 as | ||
6 | * published by the Free Software Foundation. | ||
7 | */ | ||
8 | #ifndef __ASM_SH_MMZONE_H | ||
9 | #define __ASM_SH_MMZONE_H | ||
10 | |||
11 | #include <linux/config.h> | ||
12 | |||
13 | #ifdef CONFIG_DISCONTIGMEM | ||
14 | |||
15 | /* Currently, just for HP690 */ | ||
16 | #define PHYSADDR_TO_NID(phys) ((((phys) - __MEMORY_START) >= 0x01000000)?1:0) | ||
17 | |||
18 | extern pg_data_t discontig_page_data[MAX_NUMNODES]; | ||
19 | extern bootmem_data_t discontig_node_bdata[MAX_NUMNODES]; | ||
20 | |||
21 | /* | ||
22 | * Following are macros that each numa implmentation must define. | ||
23 | */ | ||
24 | |||
25 | /* | ||
26 | * Given a kernel address, find the home node of the underlying memory. | ||
27 | */ | ||
28 | #define KVADDR_TO_NID(kaddr) PHYSADDR_TO_NID(__pa(kaddr)) | ||
29 | |||
30 | /* | ||
31 | * Return a pointer to the node data for node n. | ||
32 | */ | ||
33 | #define NODE_DATA(nid) (&discontig_page_data[nid]) | ||
34 | |||
35 | /* | ||
36 | * NODE_MEM_MAP gives the kaddr for the mem_map of the node. | ||
37 | */ | ||
38 | #define NODE_MEM_MAP(nid) (NODE_DATA(nid)->node_mem_map) | ||
39 | |||
40 | #define phys_to_page(phys) \ | ||
41 | ({ unsigned int node = PHYSADDR_TO_NID(phys); \ | ||
42 | NODE_MEM_MAP(node) \ | ||
43 | + (((phys) - NODE_DATA(node)->node_start_paddr) >> PAGE_SHIFT); }) | ||
44 | |||
45 | static inline int is_valid_page(struct page *page) | ||
46 | { | ||
47 | unsigned int i; | ||
48 | |||
49 | for (i = 0; i < MAX_NUMNODES; i++) { | ||
50 | if (page >= NODE_MEM_MAP(i) && | ||
51 | page < NODE_MEM_MAP(i) + NODE_DATA(i)->node_size) | ||
52 | return 1; | ||
53 | } | ||
54 | return 0; | ||
55 | } | ||
56 | |||
57 | #define VALID_PAGE(page) is_valid_page(page) | ||
58 | #define page_to_phys(page) PHYSADDR(page_address(page)) | ||
59 | |||
60 | #endif /* CONFIG_DISCONTIGMEM */ | ||
61 | #endif | ||
diff --git a/include/asm-sh/page.h b/include/asm-sh/page.h index 324e6cc5ecf7..972c3f655b2a 100644 --- a/include/asm-sh/page.h +++ b/include/asm-sh/page.h | |||
@@ -93,11 +93,6 @@ typedef struct { unsigned long pgprot; } pgprot_t; | |||
93 | 93 | ||
94 | #define __MEMORY_START CONFIG_MEMORY_START | 94 | #define __MEMORY_START CONFIG_MEMORY_START |
95 | #define __MEMORY_SIZE CONFIG_MEMORY_SIZE | 95 | #define __MEMORY_SIZE CONFIG_MEMORY_SIZE |
96 | #ifdef CONFIG_DISCONTIGMEM | ||
97 | /* Just for HP690, for now.. */ | ||
98 | #define __MEMORY_START_2ND (__MEMORY_START+0x02000000) | ||
99 | #define __MEMORY_SIZE_2ND 0x001000000 /* 16MB */ | ||
100 | #endif | ||
101 | 96 | ||
102 | #define PAGE_OFFSET (0x80000000UL) | 97 | #define PAGE_OFFSET (0x80000000UL) |
103 | #define __pa(x) ((unsigned long)(x)-PAGE_OFFSET) | 98 | #define __pa(x) ((unsigned long)(x)-PAGE_OFFSET) |
@@ -105,10 +100,8 @@ typedef struct { unsigned long pgprot; } pgprot_t; | |||
105 | 100 | ||
106 | #define MAP_NR(addr) (((unsigned long)(addr)-PAGE_OFFSET) >> PAGE_SHIFT) | 101 | #define MAP_NR(addr) (((unsigned long)(addr)-PAGE_OFFSET) >> PAGE_SHIFT) |
107 | 102 | ||
108 | #ifndef CONFIG_DISCONTIGMEM | ||
109 | #define phys_to_page(phys) (mem_map + (((phys)-__MEMORY_START) >> PAGE_SHIFT)) | 103 | #define phys_to_page(phys) (mem_map + (((phys)-__MEMORY_START) >> PAGE_SHIFT)) |
110 | #define page_to_phys(page) (((page - mem_map) << PAGE_SHIFT) + __MEMORY_START) | 104 | #define page_to_phys(page) (((page - mem_map) << PAGE_SHIFT) + __MEMORY_START) |
111 | #endif | ||
112 | 105 | ||
113 | /* PFN start number, because of __MEMORY_START */ | 106 | /* PFN start number, because of __MEMORY_START */ |
114 | #define PFN_START (__MEMORY_START >> PAGE_SHIFT) | 107 | #define PFN_START (__MEMORY_START >> PAGE_SHIFT) |
diff --git a/include/asm-sh/pgtable.h b/include/asm-sh/pgtable.h index aef8ae43de13..bb0efb31a8cb 100644 --- a/include/asm-sh/pgtable.h +++ b/include/asm-sh/pgtable.h | |||
@@ -196,7 +196,9 @@ static inline pte_t pte_mkexec(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) | _ | |||
196 | static inline pte_t pte_mkdirty(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) | _PAGE_DIRTY)); return pte; } | 196 | static inline pte_t pte_mkdirty(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) | _PAGE_DIRTY)); return pte; } |
197 | static inline pte_t pte_mkyoung(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) | _PAGE_ACCESSED)); return pte; } | 197 | static inline pte_t pte_mkyoung(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) | _PAGE_ACCESSED)); return pte; } |
198 | static inline pte_t pte_mkwrite(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) | _PAGE_RW)); return pte; } | 198 | static inline pte_t pte_mkwrite(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) | _PAGE_RW)); return pte; } |
199 | #ifdef CONFIG_HUGETLB_PAGE | ||
199 | static inline pte_t pte_mkhuge(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) | _PAGE_SZHUGE)); return pte; } | 200 | static inline pte_t pte_mkhuge(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) | _PAGE_SZHUGE)); return pte; } |
201 | #endif | ||
200 | 202 | ||
201 | /* | 203 | /* |
202 | * Macro and implementation to make a page protection as uncachable. | 204 | * Macro and implementation to make a page protection as uncachable. |
@@ -282,6 +284,8 @@ typedef pte_t *pte_addr_t; | |||
282 | #define GET_IOSPACE(pfn) 0 | 284 | #define GET_IOSPACE(pfn) 0 |
283 | #define GET_PFN(pfn) (pfn) | 285 | #define GET_PFN(pfn) (pfn) |
284 | 286 | ||
287 | struct mm_struct; | ||
288 | |||
285 | /* | 289 | /* |
286 | * No page table caches to initialise | 290 | * No page table caches to initialise |
287 | */ | 291 | */ |
diff --git a/include/asm-sh64/pgtable.h b/include/asm-sh64/pgtable.h index 51b05818e4eb..a1906a772df9 100644 --- a/include/asm-sh64/pgtable.h +++ b/include/asm-sh64/pgtable.h | |||
@@ -24,6 +24,8 @@ | |||
24 | #include <linux/threads.h> | 24 | #include <linux/threads.h> |
25 | #include <linux/config.h> | 25 | #include <linux/config.h> |
26 | 26 | ||
27 | struct vm_area_struct; | ||
28 | |||
27 | extern void paging_init(void); | 29 | extern void paging_init(void); |
28 | 30 | ||
29 | /* We provide our own get_unmapped_area to avoid cache synonym issue */ | 31 | /* We provide our own get_unmapped_area to avoid cache synonym issue */ |
diff --git a/include/asm-sparc/ptrace.h b/include/asm-sparc/ptrace.h index a8ecb2d6977a..714497099a42 100644 --- a/include/asm-sparc/ptrace.h +++ b/include/asm-sparc/ptrace.h | |||
@@ -60,6 +60,9 @@ struct sparc_stackf { | |||
60 | #define STACKFRAME_SZ sizeof(struct sparc_stackf) | 60 | #define STACKFRAME_SZ sizeof(struct sparc_stackf) |
61 | 61 | ||
62 | #ifdef __KERNEL__ | 62 | #ifdef __KERNEL__ |
63 | |||
64 | #define __ARCH_SYS_PTRACE 1 | ||
65 | |||
63 | #define user_mode(regs) (!((regs)->psr & PSR_PS)) | 66 | #define user_mode(regs) (!((regs)->psr & PSR_PS)) |
64 | #define instruction_pointer(regs) ((regs)->pc) | 67 | #define instruction_pointer(regs) ((regs)->pc) |
65 | unsigned long profile_pc(struct pt_regs *); | 68 | unsigned long profile_pc(struct pt_regs *); |
diff --git a/include/asm-sparc64/kprobes.h b/include/asm-sparc64/kprobes.h index a8d326a598f0..7ba845320f5c 100644 --- a/include/asm-sparc64/kprobes.h +++ b/include/asm-sparc64/kprobes.h | |||
@@ -3,6 +3,7 @@ | |||
3 | 3 | ||
4 | #include <linux/config.h> | 4 | #include <linux/config.h> |
5 | #include <linux/types.h> | 5 | #include <linux/types.h> |
6 | #include <linux/percpu.h> | ||
6 | 7 | ||
7 | typedef u32 kprobe_opcode_t; | 8 | typedef u32 kprobe_opcode_t; |
8 | 9 | ||
@@ -18,6 +19,25 @@ struct arch_specific_insn { | |||
18 | kprobe_opcode_t insn[MAX_INSN_SIZE]; | 19 | kprobe_opcode_t insn[MAX_INSN_SIZE]; |
19 | }; | 20 | }; |
20 | 21 | ||
22 | struct prev_kprobe { | ||
23 | struct kprobe *kp; | ||
24 | unsigned int status; | ||
25 | unsigned long orig_tnpc; | ||
26 | unsigned long orig_tstate_pil; | ||
27 | }; | ||
28 | |||
29 | /* per-cpu kprobe control block */ | ||
30 | struct kprobe_ctlblk { | ||
31 | unsigned long kprobe_status; | ||
32 | unsigned long kprobe_orig_tnpc; | ||
33 | unsigned long kprobe_orig_tstate_pil; | ||
34 | long *jprobe_saved_esp; | ||
35 | struct pt_regs jprobe_saved_regs; | ||
36 | struct pt_regs *jprobe_saved_regs_location; | ||
37 | struct sparc_stackf jprobe_saved_stack; | ||
38 | struct prev_kprobe prev_kprobe; | ||
39 | }; | ||
40 | |||
21 | #ifdef CONFIG_KPROBES | 41 | #ifdef CONFIG_KPROBES |
22 | extern int kprobe_exceptions_notify(struct notifier_block *self, | 42 | extern int kprobe_exceptions_notify(struct notifier_block *self, |
23 | unsigned long val, void *data); | 43 | unsigned long val, void *data); |
diff --git a/include/asm-sparc64/ptrace.h b/include/asm-sparc64/ptrace.h index 6194f771e9fc..7eba90c6c753 100644 --- a/include/asm-sparc64/ptrace.h +++ b/include/asm-sparc64/ptrace.h | |||
@@ -94,6 +94,9 @@ struct sparc_trapf { | |||
94 | #define STACKFRAME32_SZ sizeof(struct sparc_stackf32) | 94 | #define STACKFRAME32_SZ sizeof(struct sparc_stackf32) |
95 | 95 | ||
96 | #ifdef __KERNEL__ | 96 | #ifdef __KERNEL__ |
97 | |||
98 | #define __ARCH_SYS_PTRACE 1 | ||
99 | |||
97 | #define force_successful_syscall_return() \ | 100 | #define force_successful_syscall_return() \ |
98 | do { current_thread_info()->syscall_noerror = 1; \ | 101 | do { current_thread_info()->syscall_noerror = 1; \ |
99 | } while (0) | 102 | } while (0) |
diff --git a/include/asm-um/ldt-i386.h b/include/asm-um/ldt-i386.h new file mode 100644 index 000000000000..b42662929b6c --- /dev/null +++ b/include/asm-um/ldt-i386.h | |||
@@ -0,0 +1,69 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2004 Fujitsu Siemens Computers GmbH | ||
3 | * Licensed under the GPL | ||
4 | * | ||
5 | * Author: Bodo Stroesser <bstroesser@fujitsu-siemens.com> | ||
6 | */ | ||
7 | |||
8 | #ifndef __ASM_LDT_I386_H | ||
9 | #define __ASM_LDT_I386_H | ||
10 | |||
11 | #include "asm/semaphore.h" | ||
12 | #include "asm/arch/ldt.h" | ||
13 | |||
14 | struct mmu_context_skas; | ||
15 | extern void ldt_host_info(void); | ||
16 | extern long init_new_ldt(struct mmu_context_skas * to_mm, | ||
17 | struct mmu_context_skas * from_mm); | ||
18 | extern void free_ldt(struct mmu_context_skas * mm); | ||
19 | |||
20 | #define LDT_PAGES_MAX \ | ||
21 | ((LDT_ENTRIES * LDT_ENTRY_SIZE)/PAGE_SIZE) | ||
22 | #define LDT_ENTRIES_PER_PAGE \ | ||
23 | (PAGE_SIZE/LDT_ENTRY_SIZE) | ||
24 | #define LDT_DIRECT_ENTRIES \ | ||
25 | ((LDT_PAGES_MAX*sizeof(void *))/LDT_ENTRY_SIZE) | ||
26 | |||
27 | struct ldt_entry { | ||
28 | __u32 a; | ||
29 | __u32 b; | ||
30 | }; | ||
31 | |||
32 | typedef struct uml_ldt { | ||
33 | int entry_count; | ||
34 | struct semaphore semaphore; | ||
35 | union { | ||
36 | struct ldt_entry * pages[LDT_PAGES_MAX]; | ||
37 | struct ldt_entry entries[LDT_DIRECT_ENTRIES]; | ||
38 | }; | ||
39 | } uml_ldt_t; | ||
40 | |||
41 | /* | ||
42 | * macros stolen from include/asm-i386/desc.h | ||
43 | */ | ||
44 | #define LDT_entry_a(info) \ | ||
45 | ((((info)->base_addr & 0x0000ffff) << 16) | ((info)->limit & 0x0ffff)) | ||
46 | |||
47 | #define LDT_entry_b(info) \ | ||
48 | (((info)->base_addr & 0xff000000) | \ | ||
49 | (((info)->base_addr & 0x00ff0000) >> 16) | \ | ||
50 | ((info)->limit & 0xf0000) | \ | ||
51 | (((info)->read_exec_only ^ 1) << 9) | \ | ||
52 | ((info)->contents << 10) | \ | ||
53 | (((info)->seg_not_present ^ 1) << 15) | \ | ||
54 | ((info)->seg_32bit << 22) | \ | ||
55 | ((info)->limit_in_pages << 23) | \ | ||
56 | ((info)->useable << 20) | \ | ||
57 | 0x7000) | ||
58 | |||
59 | #define LDT_empty(info) (\ | ||
60 | (info)->base_addr == 0 && \ | ||
61 | (info)->limit == 0 && \ | ||
62 | (info)->contents == 0 && \ | ||
63 | (info)->read_exec_only == 1 && \ | ||
64 | (info)->seg_32bit == 0 && \ | ||
65 | (info)->limit_in_pages == 0 && \ | ||
66 | (info)->seg_not_present == 1 && \ | ||
67 | (info)->useable == 0 ) | ||
68 | |||
69 | #endif | ||
diff --git a/include/asm-um/ldt.h b/include/asm-um/ldt.h index e908439d338a..4466ff6de0fd 100644 --- a/include/asm-um/ldt.h +++ b/include/asm-um/ldt.h | |||
@@ -1,3 +1,72 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2004 Fujitsu Siemens Computers GmbH | ||
3 | * Licensed under the GPL | ||
4 | * | ||
5 | * Author: Bodo Stroesser <bstroesser@fujitsu-siemens.com> | ||
6 | */ | ||
7 | |||
8 | #ifndef __ASM_LDT_I386_H | ||
9 | #define __ASM_LDT_I386_H | ||
10 | |||
11 | #include "asm/semaphore.h" | ||
12 | #include "asm/arch/ldt.h" | ||
13 | |||
14 | struct mmu_context_skas; | ||
15 | extern void ldt_host_info(void); | ||
16 | extern long init_new_ldt(struct mmu_context_skas * to_mm, | ||
17 | struct mmu_context_skas * from_mm); | ||
18 | extern void free_ldt(struct mmu_context_skas * mm); | ||
19 | |||
20 | #define LDT_PAGES_MAX \ | ||
21 | ((LDT_ENTRIES * LDT_ENTRY_SIZE)/PAGE_SIZE) | ||
22 | #define LDT_ENTRIES_PER_PAGE \ | ||
23 | (PAGE_SIZE/LDT_ENTRY_SIZE) | ||
24 | #define LDT_DIRECT_ENTRIES \ | ||
25 | ((LDT_PAGES_MAX*sizeof(void *))/LDT_ENTRY_SIZE) | ||
26 | |||
27 | struct ldt_entry { | ||
28 | __u32 a; | ||
29 | __u32 b; | ||
30 | }; | ||
31 | |||
32 | typedef struct uml_ldt { | ||
33 | int entry_count; | ||
34 | struct semaphore semaphore; | ||
35 | union { | ||
36 | struct ldt_entry * pages[LDT_PAGES_MAX]; | ||
37 | struct ldt_entry entries[LDT_DIRECT_ENTRIES]; | ||
38 | }; | ||
39 | } uml_ldt_t; | ||
40 | |||
41 | /* | ||
42 | * macros stolen from include/asm-i386/desc.h | ||
43 | */ | ||
44 | #define LDT_entry_a(info) \ | ||
45 | ((((info)->base_addr & 0x0000ffff) << 16) | ((info)->limit & 0x0ffff)) | ||
46 | |||
47 | #define LDT_entry_b(info) \ | ||
48 | (((info)->base_addr & 0xff000000) | \ | ||
49 | (((info)->base_addr & 0x00ff0000) >> 16) | \ | ||
50 | ((info)->limit & 0xf0000) | \ | ||
51 | (((info)->read_exec_only ^ 1) << 9) | \ | ||
52 | ((info)->contents << 10) | \ | ||
53 | (((info)->seg_not_present ^ 1) << 15) | \ | ||
54 | ((info)->seg_32bit << 22) | \ | ||
55 | ((info)->limit_in_pages << 23) | \ | ||
56 | ((info)->useable << 20) | \ | ||
57 | 0x7000) | ||
58 | |||
59 | #define LDT_empty(info) (\ | ||
60 | (info)->base_addr == 0 && \ | ||
61 | (info)->limit == 0 && \ | ||
62 | (info)->contents == 0 && \ | ||
63 | (info)->read_exec_only == 1 && \ | ||
64 | (info)->seg_32bit == 0 && \ | ||
65 | (info)->limit_in_pages == 0 && \ | ||
66 | (info)->seg_not_present == 1 && \ | ||
67 | (info)->useable == 0 ) | ||
68 | |||
69 | #endif | ||
1 | #ifndef __UM_LDT_H | 70 | #ifndef __UM_LDT_H |
2 | #define __UM_LDT_H | 71 | #define __UM_LDT_H |
3 | 72 | ||
diff --git a/include/asm-um/mmu_context.h b/include/asm-um/mmu_context.h index 2edb4f1f789c..9a0e48eb542e 100644 --- a/include/asm-um/mmu_context.h +++ b/include/asm-um/mmu_context.h | |||
@@ -29,7 +29,8 @@ static inline void activate_mm(struct mm_struct *old, struct mm_struct *new) | |||
29 | * possible. | 29 | * possible. |
30 | */ | 30 | */ |
31 | if (old != new && (current->flags & PF_BORROWED_MM)) | 31 | if (old != new && (current->flags & PF_BORROWED_MM)) |
32 | force_flush_all(); | 32 | CHOOSE_MODE(force_flush_all(), |
33 | switch_mm_skas(&new->context.skas.id)); | ||
33 | } | 34 | } |
34 | 35 | ||
35 | static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next, | 36 | static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next, |
diff --git a/include/asm-v850/atomic.h b/include/asm-v850/atomic.h index 8284aa7363f2..395268a8c0de 100644 --- a/include/asm-v850/atomic.h +++ b/include/asm-v850/atomic.h | |||
@@ -31,7 +31,7 @@ typedef struct { int counter; } atomic_t; | |||
31 | #define atomic_read(v) ((v)->counter) | 31 | #define atomic_read(v) ((v)->counter) |
32 | #define atomic_set(v,i) (((v)->counter) = (i)) | 32 | #define atomic_set(v,i) (((v)->counter) = (i)) |
33 | 33 | ||
34 | extern __inline__ int atomic_add_return (int i, volatile atomic_t *v) | 34 | static inline int atomic_add_return (int i, volatile atomic_t *v) |
35 | { | 35 | { |
36 | unsigned long flags; | 36 | unsigned long flags; |
37 | int res; | 37 | int res; |
diff --git a/include/asm-v850/bitops.h b/include/asm-v850/bitops.h index 0e5c2f210872..b91e799763fd 100644 --- a/include/asm-v850/bitops.h +++ b/include/asm-v850/bitops.h | |||
@@ -30,7 +30,7 @@ | |||
30 | * ffz = Find First Zero in word. Undefined if no zero exists, | 30 | * ffz = Find First Zero in word. Undefined if no zero exists, |
31 | * so code should check against ~0UL first.. | 31 | * so code should check against ~0UL first.. |
32 | */ | 32 | */ |
33 | extern __inline__ unsigned long ffz (unsigned long word) | 33 | static inline unsigned long ffz (unsigned long word) |
34 | { | 34 | { |
35 | unsigned long result = 0; | 35 | unsigned long result = 0; |
36 | 36 | ||
@@ -135,7 +135,7 @@ extern __inline__ unsigned long ffz (unsigned long word) | |||
135 | "m" (*((const char *)(addr) + ((nr) >> 3)))); \ | 135 | "m" (*((const char *)(addr) + ((nr) >> 3)))); \ |
136 | __test_bit_res; \ | 136 | __test_bit_res; \ |
137 | }) | 137 | }) |
138 | extern __inline__ int __test_bit (int nr, const void *addr) | 138 | static inline int __test_bit (int nr, const void *addr) |
139 | { | 139 | { |
140 | int res; | 140 | int res; |
141 | __asm__ __volatile__ ("tst1 %1, [%2]; setf nz, %0" | 141 | __asm__ __volatile__ ("tst1 %1, [%2]; setf nz, %0" |
@@ -157,7 +157,7 @@ extern __inline__ int __test_bit (int nr, const void *addr) | |||
157 | #define find_first_zero_bit(addr, size) \ | 157 | #define find_first_zero_bit(addr, size) \ |
158 | find_next_zero_bit ((addr), (size), 0) | 158 | find_next_zero_bit ((addr), (size), 0) |
159 | 159 | ||
160 | extern __inline__ int find_next_zero_bit(const void *addr, int size, int offset) | 160 | static inline int find_next_zero_bit(const void *addr, int size, int offset) |
161 | { | 161 | { |
162 | unsigned long *p = ((unsigned long *) addr) + (offset >> 5); | 162 | unsigned long *p = ((unsigned long *) addr) + (offset >> 5); |
163 | unsigned long result = offset & ~31UL; | 163 | unsigned long result = offset & ~31UL; |
diff --git a/include/asm-v850/delay.h b/include/asm-v850/delay.h index 1ce65d48a7c5..6d028e6b2354 100644 --- a/include/asm-v850/delay.h +++ b/include/asm-v850/delay.h | |||
@@ -16,7 +16,7 @@ | |||
16 | 16 | ||
17 | #include <asm/param.h> | 17 | #include <asm/param.h> |
18 | 18 | ||
19 | extern __inline__ void __delay(unsigned long loops) | 19 | static inline void __delay(unsigned long loops) |
20 | { | 20 | { |
21 | if (loops) | 21 | if (loops) |
22 | __asm__ __volatile__ ("1: add -1, %0; bnz 1b" | 22 | __asm__ __volatile__ ("1: add -1, %0; bnz 1b" |
@@ -33,7 +33,7 @@ extern __inline__ void __delay(unsigned long loops) | |||
33 | 33 | ||
34 | extern unsigned long loops_per_jiffy; | 34 | extern unsigned long loops_per_jiffy; |
35 | 35 | ||
36 | extern __inline__ void udelay(unsigned long usecs) | 36 | static inline void udelay(unsigned long usecs) |
37 | { | 37 | { |
38 | register unsigned long full_loops, part_loops; | 38 | register unsigned long full_loops, part_loops; |
39 | 39 | ||
diff --git a/include/asm-v850/hw_irq.h b/include/asm-v850/hw_irq.h index 4bdc98edb9f8..a8aab4342712 100644 --- a/include/asm-v850/hw_irq.h +++ b/include/asm-v850/hw_irq.h | |||
@@ -1,7 +1,7 @@ | |||
1 | #ifndef __V850_HW_IRQ_H__ | 1 | #ifndef __V850_HW_IRQ_H__ |
2 | #define __V850_HW_IRQ_H__ | 2 | #define __V850_HW_IRQ_H__ |
3 | 3 | ||
4 | extern inline void hw_resend_irq (struct hw_interrupt_type *h, unsigned int i) | 4 | static inline void hw_resend_irq (struct hw_interrupt_type *h, unsigned int i) |
5 | { | 5 | { |
6 | } | 6 | } |
7 | 7 | ||
diff --git a/include/asm-v850/processor.h b/include/asm-v850/processor.h index d41f925f5182..98f929427d3d 100644 --- a/include/asm-v850/processor.h +++ b/include/asm-v850/processor.h | |||
@@ -59,7 +59,7 @@ struct thread_struct { | |||
59 | 59 | ||
60 | 60 | ||
61 | /* Do necessary setup to start up a newly executed thread. */ | 61 | /* Do necessary setup to start up a newly executed thread. */ |
62 | extern inline void start_thread (struct pt_regs *regs, | 62 | static inline void start_thread (struct pt_regs *regs, |
63 | unsigned long pc, unsigned long usp) | 63 | unsigned long pc, unsigned long usp) |
64 | { | 64 | { |
65 | regs->pc = pc; | 65 | regs->pc = pc; |
@@ -68,7 +68,7 @@ extern inline void start_thread (struct pt_regs *regs, | |||
68 | } | 68 | } |
69 | 69 | ||
70 | /* Free all resources held by a thread. */ | 70 | /* Free all resources held by a thread. */ |
71 | extern inline void release_thread (struct task_struct *dead_task) | 71 | static inline void release_thread (struct task_struct *dead_task) |
72 | { | 72 | { |
73 | } | 73 | } |
74 | 74 | ||
diff --git a/include/asm-v850/semaphore.h b/include/asm-v850/semaphore.h index df6cdecf6c1f..735baaf3a16e 100644 --- a/include/asm-v850/semaphore.h +++ b/include/asm-v850/semaphore.h | |||
@@ -24,7 +24,7 @@ struct semaphore { | |||
24 | #define DECLARE_MUTEX(name) __DECLARE_SEMAPHORE_GENERIC (name,1) | 24 | #define DECLARE_MUTEX(name) __DECLARE_SEMAPHORE_GENERIC (name,1) |
25 | #define DECLARE_MUTEX_LOCKED(name) __DECLARE_SEMAPHORE_GENERIC (name,0) | 25 | #define DECLARE_MUTEX_LOCKED(name) __DECLARE_SEMAPHORE_GENERIC (name,0) |
26 | 26 | ||
27 | extern inline void sema_init (struct semaphore *sem, int val) | 27 | static inline void sema_init (struct semaphore *sem, int val) |
28 | { | 28 | { |
29 | *sem = (struct semaphore)__SEMAPHORE_INITIALIZER((*sem),val); | 29 | *sem = (struct semaphore)__SEMAPHORE_INITIALIZER((*sem),val); |
30 | } | 30 | } |
@@ -52,14 +52,14 @@ extern int __down_interruptible (struct semaphore * sem); | |||
52 | extern int __down_trylock (struct semaphore * sem); | 52 | extern int __down_trylock (struct semaphore * sem); |
53 | extern void __up (struct semaphore * sem); | 53 | extern void __up (struct semaphore * sem); |
54 | 54 | ||
55 | extern inline void down (struct semaphore * sem) | 55 | static inline void down (struct semaphore * sem) |
56 | { | 56 | { |
57 | might_sleep(); | 57 | might_sleep(); |
58 | if (atomic_dec_return (&sem->count) < 0) | 58 | if (atomic_dec_return (&sem->count) < 0) |
59 | __down (sem); | 59 | __down (sem); |
60 | } | 60 | } |
61 | 61 | ||
62 | extern inline int down_interruptible (struct semaphore * sem) | 62 | static inline int down_interruptible (struct semaphore * sem) |
63 | { | 63 | { |
64 | int ret = 0; | 64 | int ret = 0; |
65 | might_sleep(); | 65 | might_sleep(); |
@@ -68,7 +68,7 @@ extern inline int down_interruptible (struct semaphore * sem) | |||
68 | return ret; | 68 | return ret; |
69 | } | 69 | } |
70 | 70 | ||
71 | extern inline int down_trylock (struct semaphore *sem) | 71 | static inline int down_trylock (struct semaphore *sem) |
72 | { | 72 | { |
73 | int ret = 0; | 73 | int ret = 0; |
74 | if (atomic_dec_return (&sem->count) < 0) | 74 | if (atomic_dec_return (&sem->count) < 0) |
@@ -76,7 +76,7 @@ extern inline int down_trylock (struct semaphore *sem) | |||
76 | return ret; | 76 | return ret; |
77 | } | 77 | } |
78 | 78 | ||
79 | extern inline void up (struct semaphore * sem) | 79 | static inline void up (struct semaphore * sem) |
80 | { | 80 | { |
81 | if (atomic_inc_return (&sem->count) <= 0) | 81 | if (atomic_inc_return (&sem->count) <= 0) |
82 | __up (sem); | 82 | __up (sem); |
diff --git a/include/asm-v850/system.h b/include/asm-v850/system.h index 20f4c738c04e..107decbd6e6c 100644 --- a/include/asm-v850/system.h +++ b/include/asm-v850/system.h | |||
@@ -81,7 +81,7 @@ static inline int irqs_disabled (void) | |||
81 | ((__typeof__ (*(ptr)))__xchg ((unsigned long)(with), (ptr), sizeof (*(ptr)))) | 81 | ((__typeof__ (*(ptr)))__xchg ((unsigned long)(with), (ptr), sizeof (*(ptr)))) |
82 | #define tas(ptr) (xchg ((ptr), 1)) | 82 | #define tas(ptr) (xchg ((ptr), 1)) |
83 | 83 | ||
84 | extern inline unsigned long __xchg (unsigned long with, | 84 | static inline unsigned long __xchg (unsigned long with, |
85 | __volatile__ void *ptr, int size) | 85 | __volatile__ void *ptr, int size) |
86 | { | 86 | { |
87 | unsigned long tmp, flags; | 87 | unsigned long tmp, flags; |
diff --git a/include/asm-v850/tlbflush.h b/include/asm-v850/tlbflush.h index 501e4498172c..5f2f85f636ea 100644 --- a/include/asm-v850/tlbflush.h +++ b/include/asm-v850/tlbflush.h | |||
@@ -56,12 +56,12 @@ static inline void flush_tlb_range(struct vm_area_struct *vma, | |||
56 | BUG (); | 56 | BUG (); |
57 | } | 57 | } |
58 | 58 | ||
59 | extern inline void flush_tlb_kernel_page(unsigned long addr) | 59 | static inline void flush_tlb_kernel_page(unsigned long addr) |
60 | { | 60 | { |
61 | BUG (); | 61 | BUG (); |
62 | } | 62 | } |
63 | 63 | ||
64 | extern inline void flush_tlb_pgtables(struct mm_struct *mm, | 64 | static inline void flush_tlb_pgtables(struct mm_struct *mm, |
65 | unsigned long start, unsigned long end) | 65 | unsigned long start, unsigned long end) |
66 | { | 66 | { |
67 | BUG (); | 67 | BUG (); |
diff --git a/include/asm-v850/uaccess.h b/include/asm-v850/uaccess.h index 188b28597cf1..64563c409bb2 100644 --- a/include/asm-v850/uaccess.h +++ b/include/asm-v850/uaccess.h | |||
@@ -14,7 +14,7 @@ | |||
14 | #define VERIFY_READ 0 | 14 | #define VERIFY_READ 0 |
15 | #define VERIFY_WRITE 1 | 15 | #define VERIFY_WRITE 1 |
16 | 16 | ||
17 | extern inline int access_ok (int type, const void *addr, unsigned long size) | 17 | static inline int access_ok (int type, const void *addr, unsigned long size) |
18 | { | 18 | { |
19 | /* XXX I guess we should check against real ram bounds at least, and | 19 | /* XXX I guess we should check against real ram bounds at least, and |
20 | possibly make sure ADDR is not within the kernel. | 20 | possibly make sure ADDR is not within the kernel. |
diff --git a/include/asm-v850/unaligned.h b/include/asm-v850/unaligned.h index 65e38362142b..e30b18653a94 100644 --- a/include/asm-v850/unaligned.h +++ b/include/asm-v850/unaligned.h | |||
@@ -82,19 +82,19 @@ extern int __bug_unaligned_x(void *ptr); | |||
82 | }) | 82 | }) |
83 | 83 | ||
84 | 84 | ||
85 | extern inline void __put_unaligned_2(__u32 __v, register __u8 *__p) | 85 | static inline void __put_unaligned_2(__u32 __v, register __u8 *__p) |
86 | { | 86 | { |
87 | *__p++ = __v; | 87 | *__p++ = __v; |
88 | *__p++ = __v >> 8; | 88 | *__p++ = __v >> 8; |
89 | } | 89 | } |
90 | 90 | ||
91 | extern inline void __put_unaligned_4(__u32 __v, register __u8 *__p) | 91 | static inline void __put_unaligned_4(__u32 __v, register __u8 *__p) |
92 | { | 92 | { |
93 | __put_unaligned_2(__v >> 16, __p + 2); | 93 | __put_unaligned_2(__v >> 16, __p + 2); |
94 | __put_unaligned_2(__v, __p); | 94 | __put_unaligned_2(__v, __p); |
95 | } | 95 | } |
96 | 96 | ||
97 | extern inline void __put_unaligned_8(const unsigned long long __v, register __u8 *__p) | 97 | static inline void __put_unaligned_8(const unsigned long long __v, register __u8 *__p) |
98 | { | 98 | { |
99 | /* | 99 | /* |
100 | * tradeoff: 8 bytes of stack for all unaligned puts (2 | 100 | * tradeoff: 8 bytes of stack for all unaligned puts (2 |
diff --git a/include/asm-x86_64/elf.h b/include/asm-x86_64/elf.h index a60a35e79222..43862cd6a569 100644 --- a/include/asm-x86_64/elf.h +++ b/include/asm-x86_64/elf.h | |||
@@ -149,6 +149,8 @@ extern void set_personality_64bit(void); | |||
149 | */ | 149 | */ |
150 | #define elf_read_implies_exec(ex, executable_stack) (executable_stack != EXSTACK_DISABLE_X) | 150 | #define elf_read_implies_exec(ex, executable_stack) (executable_stack != EXSTACK_DISABLE_X) |
151 | 151 | ||
152 | struct task_struct; | ||
153 | |||
152 | extern int dump_task_regs (struct task_struct *, elf_gregset_t *); | 154 | extern int dump_task_regs (struct task_struct *, elf_gregset_t *); |
153 | extern int dump_task_fpu (struct task_struct *, elf_fpregset_t *); | 155 | extern int dump_task_fpu (struct task_struct *, elf_fpregset_t *); |
154 | 156 | ||
diff --git a/include/asm-x86_64/kprobes.h b/include/asm-x86_64/kprobes.h index 6d6d883fdf6d..4dd7a7e148d4 100644 --- a/include/asm-x86_64/kprobes.h +++ b/include/asm-x86_64/kprobes.h | |||
@@ -25,6 +25,7 @@ | |||
25 | */ | 25 | */ |
26 | #include <linux/types.h> | 26 | #include <linux/types.h> |
27 | #include <linux/ptrace.h> | 27 | #include <linux/ptrace.h> |
28 | #include <linux/percpu.h> | ||
28 | 29 | ||
29 | struct pt_regs; | 30 | struct pt_regs; |
30 | 31 | ||
@@ -48,6 +49,24 @@ struct arch_specific_insn { | |||
48 | kprobe_opcode_t *insn; | 49 | kprobe_opcode_t *insn; |
49 | }; | 50 | }; |
50 | 51 | ||
52 | struct prev_kprobe { | ||
53 | struct kprobe *kp; | ||
54 | unsigned long status; | ||
55 | unsigned long old_rflags; | ||
56 | unsigned long saved_rflags; | ||
57 | }; | ||
58 | |||
59 | /* per-cpu kprobe control block */ | ||
60 | struct kprobe_ctlblk { | ||
61 | unsigned long kprobe_status; | ||
62 | unsigned long kprobe_old_rflags; | ||
63 | unsigned long kprobe_saved_rflags; | ||
64 | long *jprobe_saved_rsp; | ||
65 | struct pt_regs jprobe_saved_regs; | ||
66 | kprobe_opcode_t jprobes_stack[MAX_STACK_SIZE]; | ||
67 | struct prev_kprobe prev_kprobe; | ||
68 | }; | ||
69 | |||
51 | /* trap3/1 are intr gates for kprobes. So, restore the status of IF, | 70 | /* trap3/1 are intr gates for kprobes. So, restore the status of IF, |
52 | * if necessary, before executing the original int3/1 (trap) handler. | 71 | * if necessary, before executing the original int3/1 (trap) handler. |
53 | */ | 72 | */ |
diff --git a/include/asm-x86_64/pgtable.h b/include/asm-x86_64/pgtable.h index 7a07196a7202..7309fffeec9a 100644 --- a/include/asm-x86_64/pgtable.h +++ b/include/asm-x86_64/pgtable.h | |||
@@ -105,6 +105,8 @@ static inline void pgd_clear (pgd_t * pgd) | |||
105 | 105 | ||
106 | #define ptep_get_and_clear(mm,addr,xp) __pte(xchg(&(xp)->pte, 0)) | 106 | #define ptep_get_and_clear(mm,addr,xp) __pte(xchg(&(xp)->pte, 0)) |
107 | 107 | ||
108 | struct mm_struct; | ||
109 | |||
108 | static inline pte_t ptep_get_and_clear_full(struct mm_struct *mm, unsigned long addr, pte_t *ptep, int full) | 110 | static inline pte_t ptep_get_and_clear_full(struct mm_struct *mm, unsigned long addr, pte_t *ptep, int full) |
109 | { | 111 | { |
110 | pte_t pte; | 112 | pte_t pte; |
diff --git a/include/asm-xtensa/elf.h b/include/asm-xtensa/elf.h index 64f1f53874fe..de0667453b2e 100644 --- a/include/asm-xtensa/elf.h +++ b/include/asm-xtensa/elf.h | |||
@@ -209,6 +209,8 @@ extern void xtensa_elf_core_copy_regs (xtensa_gregset_t *, struct pt_regs *); | |||
209 | 209 | ||
210 | #define SET_PERSONALITY(ex, ibcs2) set_personality(PER_LINUX_32BIT) | 210 | #define SET_PERSONALITY(ex, ibcs2) set_personality(PER_LINUX_32BIT) |
211 | 211 | ||
212 | struct task_struct; | ||
213 | |||
212 | extern void do_copy_regs (xtensa_gregset_t*, struct pt_regs*, | 214 | extern void do_copy_regs (xtensa_gregset_t*, struct pt_regs*, |
213 | struct task_struct*); | 215 | struct task_struct*); |
214 | extern void do_restore_regs (xtensa_gregset_t*, struct pt_regs*, | 216 | extern void do_restore_regs (xtensa_gregset_t*, struct pt_regs*, |
diff --git a/include/asm-xtensa/pgtable.h b/include/asm-xtensa/pgtable.h index 987e3b802313..7b15afb70c56 100644 --- a/include/asm-xtensa/pgtable.h +++ b/include/asm-xtensa/pgtable.h | |||
@@ -278,6 +278,8 @@ static inline void update_pte(pte_t *ptep, pte_t pteval) | |||
278 | #endif | 278 | #endif |
279 | } | 279 | } |
280 | 280 | ||
281 | struct mm_struct; | ||
282 | |||
281 | static inline void | 283 | static inline void |
282 | set_pte_at(struct mm_struct *mm, unsigned long addr, pte_t *ptep, pte_t pteval) | 284 | set_pte_at(struct mm_struct *mm, unsigned long addr, pte_t *ptep, pte_t pteval) |
283 | { | 285 | { |
@@ -294,6 +296,7 @@ set_pmd(pmd_t *pmdp, pmd_t pmdval) | |||
294 | #endif | 296 | #endif |
295 | } | 297 | } |
296 | 298 | ||
299 | struct vm_area_struct; | ||
297 | 300 | ||
298 | static inline int | 301 | static inline int |
299 | ptep_test_and_clear_young(struct vm_area_struct *vma, unsigned long addr, | 302 | ptep_test_and_clear_young(struct vm_area_struct *vma, unsigned long addr, |
diff --git a/include/asm-xtensa/semaphore.h b/include/asm-xtensa/semaphore.h index 2a10e193b929..f10c3487cd4c 100644 --- a/include/asm-xtensa/semaphore.h +++ b/include/asm-xtensa/semaphore.h | |||
@@ -38,6 +38,7 @@ struct semaphore { | |||
38 | static inline void sema_init (struct semaphore *sem, int val) | 38 | static inline void sema_init (struct semaphore *sem, int val) |
39 | { | 39 | { |
40 | atomic_set(&sem->count, val); | 40 | atomic_set(&sem->count, val); |
41 | sem->sleepers = 0; | ||
41 | init_waitqueue_head(&sem->wait); | 42 | init_waitqueue_head(&sem->wait); |
42 | } | 43 | } |
43 | 44 | ||
diff --git a/include/linux/aio.h b/include/linux/aio.h index 0decf66117c1..403d71dcb7c8 100644 --- a/include/linux/aio.h +++ b/include/linux/aio.h | |||
@@ -183,6 +183,7 @@ struct kioctx { | |||
183 | struct list_head active_reqs; /* used for cancellation */ | 183 | struct list_head active_reqs; /* used for cancellation */ |
184 | struct list_head run_list; /* used for kicked reqs */ | 184 | struct list_head run_list; /* used for kicked reqs */ |
185 | 185 | ||
186 | /* sys_io_setup currently limits this to an unsigned int */ | ||
186 | unsigned max_reqs; | 187 | unsigned max_reqs; |
187 | 188 | ||
188 | struct aio_ring_info ring_info; | 189 | struct aio_ring_info ring_info; |
@@ -234,7 +235,7 @@ static inline struct kiocb *list_kiocb(struct list_head *h) | |||
234 | } | 235 | } |
235 | 236 | ||
236 | /* for sysctl: */ | 237 | /* for sysctl: */ |
237 | extern atomic_t aio_nr; | 238 | extern unsigned long aio_nr; |
238 | extern unsigned aio_max_nr; | 239 | extern unsigned long aio_max_nr; |
239 | 240 | ||
240 | #endif /* __LINUX__AIO_H */ | 241 | #endif /* __LINUX__AIO_H */ |
diff --git a/include/linux/cn_proc.h b/include/linux/cn_proc.h new file mode 100644 index 000000000000..70ab56317380 --- /dev/null +++ b/include/linux/cn_proc.h | |||
@@ -0,0 +1,127 @@ | |||
1 | /* | ||
2 | * cn_proc.h - process events connector | ||
3 | * | ||
4 | * Copyright (C) Matt Helsley, IBM Corp. 2005 | ||
5 | * Based on cn_fork.h by Nguyen Anh Quynh and Guillaume Thouvenin | ||
6 | * Original copyright notice follows: | ||
7 | * Copyright (C) 2005 Nguyen Anh Quynh <aquynh@gmail.com> | ||
8 | * Copyright (C) 2005 Guillaume Thouvenin <guillaume.thouvenin@bull.net> | ||
9 | * | ||
10 | * This program is free software; you can redistribute it and/or modify | ||
11 | * it under the terms of the GNU General Public License as published by | ||
12 | * the Free Software Foundation; either version 2 of the License, or | ||
13 | * (at your option) any later version. | ||
14 | * | ||
15 | * This program is distributed in the hope that it will be useful, | ||
16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
18 | * GNU General Public License for more details. | ||
19 | * | ||
20 | * You should have received a copy of the GNU General Public License | ||
21 | * along with this program; if not, write to the Free Software | ||
22 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
23 | */ | ||
24 | |||
25 | #ifndef CN_PROC_H | ||
26 | #define CN_PROC_H | ||
27 | |||
28 | #include <linux/types.h> | ||
29 | #include <linux/connector.h> | ||
30 | |||
31 | /* | ||
32 | * Userspace sends this enum to register with the kernel that it is listening | ||
33 | * for events on the connector. | ||
34 | */ | ||
35 | enum proc_cn_mcast_op { | ||
36 | PROC_CN_MCAST_LISTEN = 1, | ||
37 | PROC_CN_MCAST_IGNORE = 2 | ||
38 | }; | ||
39 | |||
40 | /* | ||
41 | * From the user's point of view, the process | ||
42 | * ID is the thread group ID and thread ID is the internal | ||
43 | * kernel "pid". So, fields are assigned as follow: | ||
44 | * | ||
45 | * In user space - In kernel space | ||
46 | * | ||
47 | * parent process ID = parent->tgid | ||
48 | * parent thread ID = parent->pid | ||
49 | * child process ID = child->tgid | ||
50 | * child thread ID = child->pid | ||
51 | */ | ||
52 | |||
53 | struct proc_event { | ||
54 | enum what { | ||
55 | /* Use successive bits so the enums can be used to record | ||
56 | * sets of events as well | ||
57 | */ | ||
58 | PROC_EVENT_NONE = 0x00000000, | ||
59 | PROC_EVENT_FORK = 0x00000001, | ||
60 | PROC_EVENT_EXEC = 0x00000002, | ||
61 | PROC_EVENT_UID = 0x00000004, | ||
62 | PROC_EVENT_GID = 0x00000040, | ||
63 | /* "next" should be 0x00000400 */ | ||
64 | /* "last" is the last process event: exit */ | ||
65 | PROC_EVENT_EXIT = 0x80000000 | ||
66 | } what; | ||
67 | __u32 cpu; | ||
68 | union { /* must be last field of proc_event struct */ | ||
69 | struct { | ||
70 | __u32 err; | ||
71 | } ack; | ||
72 | |||
73 | struct fork_proc_event { | ||
74 | pid_t parent_pid; | ||
75 | pid_t parent_tgid; | ||
76 | pid_t child_pid; | ||
77 | pid_t child_tgid; | ||
78 | } fork; | ||
79 | |||
80 | struct exec_proc_event { | ||
81 | pid_t process_pid; | ||
82 | pid_t process_tgid; | ||
83 | } exec; | ||
84 | |||
85 | struct id_proc_event { | ||
86 | pid_t process_pid; | ||
87 | pid_t process_tgid; | ||
88 | union { | ||
89 | uid_t ruid; /* current->uid */ | ||
90 | gid_t rgid; /* current->gid */ | ||
91 | } r; | ||
92 | union { | ||
93 | uid_t euid; | ||
94 | gid_t egid; | ||
95 | } e; | ||
96 | } id; | ||
97 | |||
98 | struct exit_proc_event { | ||
99 | pid_t process_pid; | ||
100 | pid_t process_tgid; | ||
101 | __u32 exit_code, exit_signal; | ||
102 | } exit; | ||
103 | } event_data; | ||
104 | }; | ||
105 | |||
106 | #ifdef __KERNEL__ | ||
107 | #ifdef CONFIG_PROC_EVENTS | ||
108 | void proc_fork_connector(struct task_struct *task); | ||
109 | void proc_exec_connector(struct task_struct *task); | ||
110 | void proc_id_connector(struct task_struct *task, int which_id); | ||
111 | void proc_exit_connector(struct task_struct *task); | ||
112 | #else | ||
113 | static inline void proc_fork_connector(struct task_struct *task) | ||
114 | {} | ||
115 | |||
116 | static inline void proc_exec_connector(struct task_struct *task) | ||
117 | {} | ||
118 | |||
119 | static inline void proc_id_connector(struct task_struct *task, | ||
120 | int which_id) | ||
121 | {} | ||
122 | |||
123 | static inline void proc_exit_connector(struct task_struct *task) | ||
124 | {} | ||
125 | #endif /* CONFIG_PROC_EVENTS */ | ||
126 | #endif /* __KERNEL__ */ | ||
127 | #endif /* CN_PROC_H */ | ||
diff --git a/include/linux/connector.h b/include/linux/connector.h index 95952cc1f525..c5769c6585f4 100644 --- a/include/linux/connector.h +++ b/include/linux/connector.h | |||
@@ -27,6 +27,12 @@ | |||
27 | #define CN_IDX_CONNECTOR 0xffffffff | 27 | #define CN_IDX_CONNECTOR 0xffffffff |
28 | #define CN_VAL_CONNECTOR 0xffffffff | 28 | #define CN_VAL_CONNECTOR 0xffffffff |
29 | 29 | ||
30 | /* | ||
31 | * Process Events connector unique ids -- used for message routing | ||
32 | */ | ||
33 | #define CN_IDX_PROC 0x1 | ||
34 | #define CN_VAL_PROC 0x1 | ||
35 | |||
30 | #define CN_NETLINK_USERS 1 | 36 | #define CN_NETLINK_USERS 1 |
31 | 37 | ||
32 | /* | 38 | /* |
diff --git a/include/linux/console_struct.h b/include/linux/console_struct.h index 725be90ef55e..f8e5587a0f92 100644 --- a/include/linux/console_struct.h +++ b/include/linux/console_struct.h | |||
@@ -9,6 +9,8 @@ | |||
9 | * to achieve effects such as fast scrolling by changing the origin. | 9 | * to achieve effects such as fast scrolling by changing the origin. |
10 | */ | 10 | */ |
11 | 11 | ||
12 | #include <linux/vt.h> | ||
13 | |||
12 | struct vt_struct; | 14 | struct vt_struct; |
13 | 15 | ||
14 | #define NPAR 16 | 16 | #define NPAR 16 |
diff --git a/include/linux/ethtool.h b/include/linux/ethtool.h index d2c390eff1b2..93535f093216 100644 --- a/include/linux/ethtool.h +++ b/include/linux/ethtool.h | |||
@@ -453,10 +453,11 @@ struct ethtool_ops { | |||
453 | * it was foced up into this mode or autonegotiated. | 453 | * it was foced up into this mode or autonegotiated. |
454 | */ | 454 | */ |
455 | 455 | ||
456 | /* The forced speed, 10Mb, 100Mb, gigabit, 10GbE. */ | 456 | /* The forced speed, 10Mb, 100Mb, gigabit, 2.5Gb, 10GbE. */ |
457 | #define SPEED_10 10 | 457 | #define SPEED_10 10 |
458 | #define SPEED_100 100 | 458 | #define SPEED_100 100 |
459 | #define SPEED_1000 1000 | 459 | #define SPEED_1000 1000 |
460 | #define SPEED_2500 2500 | ||
460 | #define SPEED_10000 10000 | 461 | #define SPEED_10000 10000 |
461 | 462 | ||
462 | /* Duplex, half or full. */ | 463 | /* Duplex, half or full. */ |
diff --git a/include/linux/fb.h b/include/linux/fb.h index c698055266d0..e7ff98e395f6 100644 --- a/include/linux/fb.h +++ b/include/linux/fb.h | |||
@@ -810,7 +810,6 @@ struct fb_info { | |||
810 | extern int fb_set_var(struct fb_info *info, struct fb_var_screeninfo *var); | 810 | extern int fb_set_var(struct fb_info *info, struct fb_var_screeninfo *var); |
811 | extern int fb_pan_display(struct fb_info *info, struct fb_var_screeninfo *var); | 811 | extern int fb_pan_display(struct fb_info *info, struct fb_var_screeninfo *var); |
812 | extern int fb_blank(struct fb_info *info, int blank); | 812 | extern int fb_blank(struct fb_info *info, int blank); |
813 | extern int soft_cursor(struct fb_info *info, struct fb_cursor *cursor); | ||
814 | extern void cfb_fillrect(struct fb_info *info, const struct fb_fillrect *rect); | 813 | extern void cfb_fillrect(struct fb_info *info, const struct fb_fillrect *rect); |
815 | extern void cfb_copyarea(struct fb_info *info, const struct fb_copyarea *area); | 814 | extern void cfb_copyarea(struct fb_info *info, const struct fb_copyarea *area); |
816 | extern void cfb_imageblit(struct fb_info *info, const struct fb_image *image); | 815 | extern void cfb_imageblit(struct fb_info *info, const struct fb_image *image); |
@@ -898,11 +897,13 @@ extern struct fb_videomode *fb_match_mode(struct fb_var_screeninfo *var, | |||
898 | struct list_head *head); | 897 | struct list_head *head); |
899 | extern struct fb_videomode *fb_find_best_mode(struct fb_var_screeninfo *var, | 898 | extern struct fb_videomode *fb_find_best_mode(struct fb_var_screeninfo *var, |
900 | struct list_head *head); | 899 | struct list_head *head); |
901 | extern struct fb_videomode *fb_find_nearest_mode(struct fb_var_screeninfo *var, | 900 | extern struct fb_videomode *fb_find_nearest_mode(struct fb_videomode *mode, |
902 | struct list_head *head); | 901 | struct list_head *head); |
903 | extern void fb_destroy_modelist(struct list_head *head); | 902 | extern void fb_destroy_modelist(struct list_head *head); |
904 | extern void fb_videomode_to_modelist(struct fb_videomode *modedb, int num, | 903 | extern void fb_videomode_to_modelist(struct fb_videomode *modedb, int num, |
905 | struct list_head *head); | 904 | struct list_head *head); |
905 | extern struct fb_videomode *fb_find_best_display(struct fb_monspecs *specs, | ||
906 | struct list_head *head); | ||
906 | 907 | ||
907 | /* drivers/video/fbcmap.c */ | 908 | /* drivers/video/fbcmap.c */ |
908 | extern int fb_alloc_cmap(struct fb_cmap *cmap, int len, int transp); | 909 | extern int fb_alloc_cmap(struct fb_cmap *cmap, int len, int transp); |
diff --git a/include/linux/file.h b/include/linux/file.h index f5bbd4c508b3..d3b1a15d5f21 100644 --- a/include/linux/file.h +++ b/include/linux/file.h | |||
@@ -59,9 +59,9 @@ extern void FASTCALL(set_close_on_exec(unsigned int fd, int flag)); | |||
59 | extern void put_filp(struct file *); | 59 | extern void put_filp(struct file *); |
60 | extern int get_unused_fd(void); | 60 | extern int get_unused_fd(void); |
61 | extern void FASTCALL(put_unused_fd(unsigned int fd)); | 61 | extern void FASTCALL(put_unused_fd(unsigned int fd)); |
62 | struct kmem_cache_s; | 62 | struct kmem_cache; |
63 | extern void filp_ctor(void * objp, struct kmem_cache_s *cachep, unsigned long cflags); | 63 | extern void filp_ctor(void * objp, struct kmem_cache *cachep, unsigned long cflags); |
64 | extern void filp_dtor(void * objp, struct kmem_cache_s *cachep, unsigned long dflags); | 64 | extern void filp_dtor(void * objp, struct kmem_cache *cachep, unsigned long dflags); |
65 | 65 | ||
66 | extern struct file ** alloc_fd_array(int); | 66 | extern struct file ** alloc_fd_array(int); |
67 | extern void free_fd_array(struct file **, int); | 67 | extern void free_fd_array(struct file **, int); |
diff --git a/include/linux/font.h b/include/linux/font.h index 53b129f07f6f..8aac48c37f3d 100644 --- a/include/linux/font.h +++ b/include/linux/font.h | |||
@@ -31,6 +31,7 @@ struct font_desc { | |||
31 | #define SUN12x22_IDX 7 | 31 | #define SUN12x22_IDX 7 |
32 | #define ACORN8x8_IDX 8 | 32 | #define ACORN8x8_IDX 8 |
33 | #define MINI4x6_IDX 9 | 33 | #define MINI4x6_IDX 9 |
34 | #define RL_IDX 10 | ||
34 | 35 | ||
35 | extern const struct font_desc font_vga_8x8, | 36 | extern const struct font_desc font_vga_8x8, |
36 | font_vga_8x16, | 37 | font_vga_8x16, |
@@ -41,6 +42,7 @@ extern const struct font_desc font_vga_8x8, | |||
41 | font_sun_8x16, | 42 | font_sun_8x16, |
42 | font_sun_12x22, | 43 | font_sun_12x22, |
43 | font_acorn_8x8, | 44 | font_acorn_8x8, |
45 | font_rl, | ||
44 | font_mini_4x6; | 46 | font_mini_4x6; |
45 | 47 | ||
46 | /* Find a font with a specific name */ | 48 | /* Find a font with a specific name */ |
diff --git a/include/linux/fs.h b/include/linux/fs.h index 6d6226732c93..9a593ef262ef 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h | |||
@@ -264,6 +264,7 @@ typedef void (dio_iodone_t)(struct kiocb *iocb, loff_t offset, | |||
264 | #define ATTR_ATTR_FLAG 1024 | 264 | #define ATTR_ATTR_FLAG 1024 |
265 | #define ATTR_KILL_SUID 2048 | 265 | #define ATTR_KILL_SUID 2048 |
266 | #define ATTR_KILL_SGID 4096 | 266 | #define ATTR_KILL_SGID 4096 |
267 | #define ATTR_FILE 8192 | ||
267 | 268 | ||
268 | /* | 269 | /* |
269 | * This is the Inode Attributes structure, used for notify_change(). It | 270 | * This is the Inode Attributes structure, used for notify_change(). It |
@@ -283,6 +284,13 @@ struct iattr { | |||
283 | struct timespec ia_atime; | 284 | struct timespec ia_atime; |
284 | struct timespec ia_mtime; | 285 | struct timespec ia_mtime; |
285 | struct timespec ia_ctime; | 286 | struct timespec ia_ctime; |
287 | |||
288 | /* | ||
289 | * Not an attribute, but an auxilary info for filesystems wanting to | ||
290 | * implement an ftruncate() like method. NOTE: filesystem should | ||
291 | * check for (ia_valid & ATTR_FILE), and not for (ia_file != NULL). | ||
292 | */ | ||
293 | struct file *ia_file; | ||
286 | }; | 294 | }; |
287 | 295 | ||
288 | /* | 296 | /* |
@@ -1088,6 +1096,8 @@ int sync_inode(struct inode *inode, struct writeback_control *wbc); | |||
1088 | * @get_name: find the name for a given inode in a given directory | 1096 | * @get_name: find the name for a given inode in a given directory |
1089 | * @get_parent: find the parent of a given directory | 1097 | * @get_parent: find the parent of a given directory |
1090 | * @get_dentry: find a dentry for the inode given a file handle sub-fragment | 1098 | * @get_dentry: find a dentry for the inode given a file handle sub-fragment |
1099 | * @find_exported_dentry: | ||
1100 | * set by the exporting module to a standard helper function. | ||
1091 | * | 1101 | * |
1092 | * Description: | 1102 | * Description: |
1093 | * The export_operations structure provides a means for nfsd to communicate | 1103 | * The export_operations structure provides a means for nfsd to communicate |
@@ -1288,7 +1298,7 @@ static inline int break_lease(struct inode *inode, unsigned int mode) | |||
1288 | 1298 | ||
1289 | /* fs/open.c */ | 1299 | /* fs/open.c */ |
1290 | 1300 | ||
1291 | extern int do_truncate(struct dentry *, loff_t start); | 1301 | extern int do_truncate(struct dentry *, loff_t start, struct file *filp); |
1292 | extern long do_sys_open(const char __user *filename, int flags, int mode); | 1302 | extern long do_sys_open(const char __user *filename, int flags, int mode); |
1293 | extern struct file *filp_open(const char *, int, int); | 1303 | extern struct file *filp_open(const char *, int, int); |
1294 | extern struct file * dentry_open(struct dentry *, struct vfsmount *, int); | 1304 | extern struct file * dentry_open(struct dentry *, struct vfsmount *, int); |
diff --git a/include/linux/fuse.h b/include/linux/fuse.h index f98854c2abd7..b76b558b03d4 100644 --- a/include/linux/fuse.h +++ b/include/linux/fuse.h | |||
@@ -14,7 +14,7 @@ | |||
14 | #define FUSE_KERNEL_VERSION 7 | 14 | #define FUSE_KERNEL_VERSION 7 |
15 | 15 | ||
16 | /** Minor version number of this interface */ | 16 | /** Minor version number of this interface */ |
17 | #define FUSE_KERNEL_MINOR_VERSION 2 | 17 | #define FUSE_KERNEL_MINOR_VERSION 3 |
18 | 18 | ||
19 | /** The node ID of the root inode */ | 19 | /** The node ID of the root inode */ |
20 | #define FUSE_ROOT_ID 1 | 20 | #define FUSE_ROOT_ID 1 |
@@ -61,6 +61,7 @@ struct fuse_kstatfs { | |||
61 | #define FATTR_SIZE (1 << 3) | 61 | #define FATTR_SIZE (1 << 3) |
62 | #define FATTR_ATIME (1 << 4) | 62 | #define FATTR_ATIME (1 << 4) |
63 | #define FATTR_MTIME (1 << 5) | 63 | #define FATTR_MTIME (1 << 5) |
64 | #define FATTR_FH (1 << 6) | ||
64 | 65 | ||
65 | /** | 66 | /** |
66 | * Flags returned by the OPEN request | 67 | * Flags returned by the OPEN request |
@@ -99,7 +100,9 @@ enum fuse_opcode { | |||
99 | FUSE_OPENDIR = 27, | 100 | FUSE_OPENDIR = 27, |
100 | FUSE_READDIR = 28, | 101 | FUSE_READDIR = 28, |
101 | FUSE_RELEASEDIR = 29, | 102 | FUSE_RELEASEDIR = 29, |
102 | FUSE_FSYNCDIR = 30 | 103 | FUSE_FSYNCDIR = 30, |
104 | FUSE_ACCESS = 34, | ||
105 | FUSE_CREATE = 35 | ||
103 | }; | 106 | }; |
104 | 107 | ||
105 | /* Conservative buffer size for the client */ | 108 | /* Conservative buffer size for the client */ |
@@ -152,12 +155,25 @@ struct fuse_link_in { | |||
152 | struct fuse_setattr_in { | 155 | struct fuse_setattr_in { |
153 | __u32 valid; | 156 | __u32 valid; |
154 | __u32 padding; | 157 | __u32 padding; |
155 | struct fuse_attr attr; | 158 | __u64 fh; |
159 | __u64 size; | ||
160 | __u64 unused1; | ||
161 | __u64 atime; | ||
162 | __u64 mtime; | ||
163 | __u64 unused2; | ||
164 | __u32 atimensec; | ||
165 | __u32 mtimensec; | ||
166 | __u32 unused3; | ||
167 | __u32 mode; | ||
168 | __u32 unused4; | ||
169 | __u32 uid; | ||
170 | __u32 gid; | ||
171 | __u32 unused5; | ||
156 | }; | 172 | }; |
157 | 173 | ||
158 | struct fuse_open_in { | 174 | struct fuse_open_in { |
159 | __u32 flags; | 175 | __u32 flags; |
160 | __u32 padding; | 176 | __u32 mode; |
161 | }; | 177 | }; |
162 | 178 | ||
163 | struct fuse_open_out { | 179 | struct fuse_open_out { |
@@ -222,6 +238,11 @@ struct fuse_getxattr_out { | |||
222 | __u32 padding; | 238 | __u32 padding; |
223 | }; | 239 | }; |
224 | 240 | ||
241 | struct fuse_access_in { | ||
242 | __u32 mask; | ||
243 | __u32 padding; | ||
244 | }; | ||
245 | |||
225 | struct fuse_init_in_out { | 246 | struct fuse_init_in_out { |
226 | __u32 major; | 247 | __u32 major; |
227 | __u32 minor; | 248 | __u32 minor; |
diff --git a/include/linux/input.h b/include/linux/input.h index f623c745c21c..3c5823368ddb 100644 --- a/include/linux/input.h +++ b/include/linux/input.h | |||
@@ -1007,7 +1007,7 @@ static inline void input_put_device(struct input_dev *dev) | |||
1007 | class_device_put(&dev->cdev); | 1007 | class_device_put(&dev->cdev); |
1008 | } | 1008 | } |
1009 | 1009 | ||
1010 | void input_register_device(struct input_dev *); | 1010 | int input_register_device(struct input_dev *); |
1011 | void input_unregister_device(struct input_dev *); | 1011 | void input_unregister_device(struct input_dev *); |
1012 | 1012 | ||
1013 | void input_register_handler(struct input_handler *); | 1013 | void input_register_handler(struct input_handler *); |
diff --git a/include/linux/ioport.h b/include/linux/ioport.h index 18d010bee635..cd6bd001ba4e 100644 --- a/include/linux/ioport.h +++ b/include/linux/ioport.h | |||
@@ -94,7 +94,7 @@ extern struct resource iomem_resource; | |||
94 | extern int request_resource(struct resource *root, struct resource *new); | 94 | extern int request_resource(struct resource *root, struct resource *new); |
95 | extern struct resource * ____request_resource(struct resource *root, struct resource *new); | 95 | extern struct resource * ____request_resource(struct resource *root, struct resource *new); |
96 | extern int release_resource(struct resource *new); | 96 | extern int release_resource(struct resource *new); |
97 | extern int insert_resource(struct resource *parent, struct resource *new); | 97 | extern __deprecated_for_modules int insert_resource(struct resource *parent, struct resource *new); |
98 | extern int allocate_resource(struct resource *root, struct resource *new, | 98 | extern int allocate_resource(struct resource *root, struct resource *new, |
99 | unsigned long size, | 99 | unsigned long size, |
100 | unsigned long min, unsigned long max, | 100 | unsigned long min, unsigned long max, |
diff --git a/include/linux/ipmi.h b/include/linux/ipmi.h index 938d55b813a5..d6276e60b3bf 100644 --- a/include/linux/ipmi.h +++ b/include/linux/ipmi.h | |||
@@ -256,10 +256,7 @@ struct ipmi_recv_msg | |||
256 | }; | 256 | }; |
257 | 257 | ||
258 | /* Allocate and free the receive message. */ | 258 | /* Allocate and free the receive message. */ |
259 | static inline void ipmi_free_recv_msg(struct ipmi_recv_msg *msg) | 259 | void ipmi_free_recv_msg(struct ipmi_recv_msg *msg); |
260 | { | ||
261 | msg->done(msg); | ||
262 | } | ||
263 | 260 | ||
264 | struct ipmi_user_hndl | 261 | struct ipmi_user_hndl |
265 | { | 262 | { |
diff --git a/include/linux/irq.h b/include/linux/irq.h index 69681c3b1f05..c516382fbec2 100644 --- a/include/linux/irq.h +++ b/include/linux/irq.h | |||
@@ -10,6 +10,7 @@ | |||
10 | */ | 10 | */ |
11 | 11 | ||
12 | #include <linux/config.h> | 12 | #include <linux/config.h> |
13 | #include <asm/smp.h> /* cpu_online_map */ | ||
13 | 14 | ||
14 | #if !defined(CONFIG_ARCH_S390) | 15 | #if !defined(CONFIG_ARCH_S390) |
15 | 16 | ||
diff --git a/include/linux/jbd.h b/include/linux/jbd.h index be197eb90077..aa56172c6fed 100644 --- a/include/linux/jbd.h +++ b/include/linux/jbd.h | |||
@@ -611,6 +611,9 @@ struct transaction_s | |||
611 | * @j_revoke: The revoke table - maintains the list of revoked blocks in the | 611 | * @j_revoke: The revoke table - maintains the list of revoked blocks in the |
612 | * current transaction. | 612 | * current transaction. |
613 | * @j_revoke_table: alternate revoke tables for j_revoke | 613 | * @j_revoke_table: alternate revoke tables for j_revoke |
614 | * @j_wbuf: array of buffer_heads for journal_commit_transaction | ||
615 | * @j_wbufsize: maximum number of buffer_heads allowed in j_wbuf, the | ||
616 | * number that will fit in j_blocksize | ||
614 | * @j_private: An opaque pointer to fs-private information. | 617 | * @j_private: An opaque pointer to fs-private information. |
615 | */ | 618 | */ |
616 | 619 | ||
diff --git a/include/linux/jffs2.h b/include/linux/jffs2.h index 419fc953ac16..cf792bb3c726 100644 --- a/include/linux/jffs2.h +++ b/include/linux/jffs2.h | |||
@@ -5,10 +5,10 @@ | |||
5 | * | 5 | * |
6 | * Created by David Woodhouse <dwmw2@infradead.org> | 6 | * Created by David Woodhouse <dwmw2@infradead.org> |
7 | * | 7 | * |
8 | * For licensing information, see the file 'LICENCE' in the | 8 | * For licensing information, see the file 'LICENCE' in the |
9 | * jffs2 directory. | 9 | * jffs2 directory. |
10 | * | 10 | * |
11 | * $Id: jffs2.h,v 1.34 2004/11/16 20:36:14 dwmw2 Exp $ | 11 | * $Id: jffs2.h,v 1.38 2005/09/26 11:37:23 havasi Exp $ |
12 | * | 12 | * |
13 | */ | 13 | */ |
14 | 14 | ||
@@ -28,6 +28,9 @@ | |||
28 | #define JFFS2_EMPTY_BITMASK 0xffff | 28 | #define JFFS2_EMPTY_BITMASK 0xffff |
29 | #define JFFS2_DIRTY_BITMASK 0x0000 | 29 | #define JFFS2_DIRTY_BITMASK 0x0000 |
30 | 30 | ||
31 | /* Summary node MAGIC marker */ | ||
32 | #define JFFS2_SUM_MAGIC 0x02851885 | ||
33 | |||
31 | /* We only allow a single char for length, and 0xFF is empty flash so | 34 | /* We only allow a single char for length, and 0xFF is empty flash so |
32 | we don't want it confused with a real length. Hence max 254. | 35 | we don't want it confused with a real length. Hence max 254. |
33 | */ | 36 | */ |
@@ -43,8 +46,6 @@ | |||
43 | #define JFFS2_COMPR_COPY 0x04 | 46 | #define JFFS2_COMPR_COPY 0x04 |
44 | #define JFFS2_COMPR_DYNRUBIN 0x05 | 47 | #define JFFS2_COMPR_DYNRUBIN 0x05 |
45 | #define JFFS2_COMPR_ZLIB 0x06 | 48 | #define JFFS2_COMPR_ZLIB 0x06 |
46 | #define JFFS2_COMPR_LZO 0x07 | ||
47 | #define JFFS2_COMPR_LZARI 0x08 | ||
48 | /* Compatibility flags. */ | 49 | /* Compatibility flags. */ |
49 | #define JFFS2_COMPAT_MASK 0xc000 /* What do to if an unknown nodetype is found */ | 50 | #define JFFS2_COMPAT_MASK 0xc000 /* What do to if an unknown nodetype is found */ |
50 | #define JFFS2_NODE_ACCURATE 0x2000 | 51 | #define JFFS2_NODE_ACCURATE 0x2000 |
@@ -62,15 +63,17 @@ | |||
62 | #define JFFS2_NODETYPE_CLEANMARKER (JFFS2_FEATURE_RWCOMPAT_DELETE | JFFS2_NODE_ACCURATE | 3) | 63 | #define JFFS2_NODETYPE_CLEANMARKER (JFFS2_FEATURE_RWCOMPAT_DELETE | JFFS2_NODE_ACCURATE | 3) |
63 | #define JFFS2_NODETYPE_PADDING (JFFS2_FEATURE_RWCOMPAT_DELETE | JFFS2_NODE_ACCURATE | 4) | 64 | #define JFFS2_NODETYPE_PADDING (JFFS2_FEATURE_RWCOMPAT_DELETE | JFFS2_NODE_ACCURATE | 4) |
64 | 65 | ||
66 | #define JFFS2_NODETYPE_SUMMARY (JFFS2_FEATURE_RWCOMPAT_DELETE | JFFS2_NODE_ACCURATE | 6) | ||
67 | |||
65 | // Maybe later... | 68 | // Maybe later... |
66 | //#define JFFS2_NODETYPE_CHECKPOINT (JFFS2_FEATURE_RWCOMPAT_DELETE | JFFS2_NODE_ACCURATE | 3) | 69 | //#define JFFS2_NODETYPE_CHECKPOINT (JFFS2_FEATURE_RWCOMPAT_DELETE | JFFS2_NODE_ACCURATE | 3) |
67 | //#define JFFS2_NODETYPE_OPTIONS (JFFS2_FEATURE_RWCOMPAT_COPY | JFFS2_NODE_ACCURATE | 4) | 70 | //#define JFFS2_NODETYPE_OPTIONS (JFFS2_FEATURE_RWCOMPAT_COPY | JFFS2_NODE_ACCURATE | 4) |
68 | 71 | ||
69 | 72 | ||
70 | #define JFFS2_INO_FLAG_PREREAD 1 /* Do read_inode() for this one at | 73 | #define JFFS2_INO_FLAG_PREREAD 1 /* Do read_inode() for this one at |
71 | mount time, don't wait for it to | 74 | mount time, don't wait for it to |
72 | happen later */ | 75 | happen later */ |
73 | #define JFFS2_INO_FLAG_USERCOMPR 2 /* User has requested a specific | 76 | #define JFFS2_INO_FLAG_USERCOMPR 2 /* User has requested a specific |
74 | compression type */ | 77 | compression type */ |
75 | 78 | ||
76 | 79 | ||
@@ -101,7 +104,7 @@ struct jffs2_unknown_node | |||
101 | struct jffs2_raw_dirent | 104 | struct jffs2_raw_dirent |
102 | { | 105 | { |
103 | jint16_t magic; | 106 | jint16_t magic; |
104 | jint16_t nodetype; /* == JFFS_NODETYPE_DIRENT */ | 107 | jint16_t nodetype; /* == JFFS2_NODETYPE_DIRENT */ |
105 | jint32_t totlen; | 108 | jint32_t totlen; |
106 | jint32_t hdr_crc; | 109 | jint32_t hdr_crc; |
107 | jint32_t pino; | 110 | jint32_t pino; |
@@ -117,7 +120,7 @@ struct jffs2_raw_dirent | |||
117 | } __attribute__((packed)); | 120 | } __attribute__((packed)); |
118 | 121 | ||
119 | /* The JFFS2 raw inode structure: Used for storage on physical media. */ | 122 | /* The JFFS2 raw inode structure: Used for storage on physical media. */ |
120 | /* The uid, gid, atime, mtime and ctime members could be longer, but | 123 | /* The uid, gid, atime, mtime and ctime members could be longer, but |
121 | are left like this for space efficiency. If and when people decide | 124 | are left like this for space efficiency. If and when people decide |
122 | they really need them extended, it's simple enough to add support for | 125 | they really need them extended, it's simple enough to add support for |
123 | a new type of raw node. | 126 | a new type of raw node. |
@@ -125,7 +128,7 @@ struct jffs2_raw_dirent | |||
125 | struct jffs2_raw_inode | 128 | struct jffs2_raw_inode |
126 | { | 129 | { |
127 | jint16_t magic; /* A constant magic number. */ | 130 | jint16_t magic; /* A constant magic number. */ |
128 | jint16_t nodetype; /* == JFFS_NODETYPE_INODE */ | 131 | jint16_t nodetype; /* == JFFS2_NODETYPE_INODE */ |
129 | jint32_t totlen; /* Total length of this node (inc data, etc.) */ | 132 | jint32_t totlen; /* Total length of this node (inc data, etc.) */ |
130 | jint32_t hdr_crc; | 133 | jint32_t hdr_crc; |
131 | jint32_t ino; /* Inode number. */ | 134 | jint32_t ino; /* Inode number. */ |
@@ -148,9 +151,25 @@ struct jffs2_raw_inode | |||
148 | uint8_t data[0]; | 151 | uint8_t data[0]; |
149 | } __attribute__((packed)); | 152 | } __attribute__((packed)); |
150 | 153 | ||
151 | union jffs2_node_union { | 154 | struct jffs2_raw_summary |
155 | { | ||
156 | jint16_t magic; | ||
157 | jint16_t nodetype; /* = JFFS2_NODETYPE_SUMMARY */ | ||
158 | jint32_t totlen; | ||
159 | jint32_t hdr_crc; | ||
160 | jint32_t sum_num; /* number of sum entries*/ | ||
161 | jint32_t cln_mkr; /* clean marker size, 0 = no cleanmarker */ | ||
162 | jint32_t padded; /* sum of the size of padding nodes */ | ||
163 | jint32_t sum_crc; /* summary information crc */ | ||
164 | jint32_t node_crc; /* node crc */ | ||
165 | jint32_t sum[0]; /* inode summary info */ | ||
166 | } __attribute__((packed)); | ||
167 | |||
168 | union jffs2_node_union | ||
169 | { | ||
152 | struct jffs2_raw_inode i; | 170 | struct jffs2_raw_inode i; |
153 | struct jffs2_raw_dirent d; | 171 | struct jffs2_raw_dirent d; |
172 | struct jffs2_raw_summary s; | ||
154 | struct jffs2_unknown_node u; | 173 | struct jffs2_unknown_node u; |
155 | }; | 174 | }; |
156 | 175 | ||
diff --git a/include/linux/jffs2_fs_i.h b/include/linux/jffs2_fs_i.h index 6dbb1cce6646..ef85ab56302b 100644 --- a/include/linux/jffs2_fs_i.h +++ b/include/linux/jffs2_fs_i.h | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $Id: jffs2_fs_i.h,v 1.17 2004/11/11 23:51:27 dwmw2 Exp $ */ | 1 | /* $Id: jffs2_fs_i.h,v 1.19 2005/11/07 11:14:52 gleixner Exp $ */ |
2 | 2 | ||
3 | #ifndef _JFFS2_FS_I | 3 | #ifndef _JFFS2_FS_I |
4 | #define _JFFS2_FS_I | 4 | #define _JFFS2_FS_I |
@@ -25,13 +25,16 @@ struct jffs2_inode_info { | |||
25 | /* There may be one datanode which isn't referenced by any of the | 25 | /* There may be one datanode which isn't referenced by any of the |
26 | above fragments, if it contains a metadata update but no actual | 26 | above fragments, if it contains a metadata update but no actual |
27 | data - or if this is a directory inode */ | 27 | data - or if this is a directory inode */ |
28 | /* This also holds the _only_ dnode for symlinks/device nodes, | 28 | /* This also holds the _only_ dnode for symlinks/device nodes, |
29 | etc. */ | 29 | etc. */ |
30 | struct jffs2_full_dnode *metadata; | 30 | struct jffs2_full_dnode *metadata; |
31 | 31 | ||
32 | /* Directory entries */ | 32 | /* Directory entries */ |
33 | struct jffs2_full_dirent *dents; | 33 | struct jffs2_full_dirent *dents; |
34 | 34 | ||
35 | /* The target path if this is the inode of a symlink */ | ||
36 | unsigned char *target; | ||
37 | |||
35 | /* Some stuff we just have to keep in-core at all times, for each inode. */ | 38 | /* Some stuff we just have to keep in-core at all times, for each inode. */ |
36 | struct jffs2_inode_cache *inocache; | 39 | struct jffs2_inode_cache *inocache; |
37 | 40 | ||
diff --git a/include/linux/jffs2_fs_sb.h b/include/linux/jffs2_fs_sb.h index 1e21546622de..4bcfb5570221 100644 --- a/include/linux/jffs2_fs_sb.h +++ b/include/linux/jffs2_fs_sb.h | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $Id: jffs2_fs_sb.h,v 1.52 2005/05/19 16:12:17 gleixner Exp $ */ | 1 | /* $Id: jffs2_fs_sb.h,v 1.54 2005/09/21 13:37:34 dedekind Exp $ */ |
2 | 2 | ||
3 | #ifndef _JFFS2_FS_SB | 3 | #ifndef _JFFS2_FS_SB |
4 | #define _JFFS2_FS_SB | 4 | #define _JFFS2_FS_SB |
@@ -20,7 +20,7 @@ | |||
20 | struct jffs2_inodirty; | 20 | struct jffs2_inodirty; |
21 | 21 | ||
22 | /* A struct for the overall file system control. Pointers to | 22 | /* A struct for the overall file system control. Pointers to |
23 | jffs2_sb_info structs are named `c' in the source code. | 23 | jffs2_sb_info structs are named `c' in the source code. |
24 | Nee jffs_control | 24 | Nee jffs_control |
25 | */ | 25 | */ |
26 | struct jffs2_sb_info { | 26 | struct jffs2_sb_info { |
@@ -35,7 +35,7 @@ struct jffs2_sb_info { | |||
35 | struct completion gc_thread_start; /* GC thread start completion */ | 35 | struct completion gc_thread_start; /* GC thread start completion */ |
36 | struct completion gc_thread_exit; /* GC thread exit completion port */ | 36 | struct completion gc_thread_exit; /* GC thread exit completion port */ |
37 | 37 | ||
38 | struct semaphore alloc_sem; /* Used to protect all the following | 38 | struct semaphore alloc_sem; /* Used to protect all the following |
39 | fields, and also to protect against | 39 | fields, and also to protect against |
40 | out-of-order writing of nodes. And GC. */ | 40 | out-of-order writing of nodes. And GC. */ |
41 | uint32_t cleanmarker_size; /* Size of an _inline_ CLEANMARKER | 41 | uint32_t cleanmarker_size; /* Size of an _inline_ CLEANMARKER |
@@ -64,7 +64,7 @@ struct jffs2_sb_info { | |||
64 | uint32_t nospc_dirty_size; | 64 | uint32_t nospc_dirty_size; |
65 | 65 | ||
66 | uint32_t nr_blocks; | 66 | uint32_t nr_blocks; |
67 | struct jffs2_eraseblock *blocks; /* The whole array of blocks. Used for getting blocks | 67 | struct jffs2_eraseblock *blocks; /* The whole array of blocks. Used for getting blocks |
68 | * from the offset (blocks[ofs / sector_size]) */ | 68 | * from the offset (blocks[ofs / sector_size]) */ |
69 | struct jffs2_eraseblock *nextblock; /* The block we're currently filling */ | 69 | struct jffs2_eraseblock *nextblock; /* The block we're currently filling */ |
70 | 70 | ||
@@ -82,25 +82,26 @@ struct jffs2_sb_info { | |||
82 | struct list_head bad_list; /* Bad blocks. */ | 82 | struct list_head bad_list; /* Bad blocks. */ |
83 | struct list_head bad_used_list; /* Bad blocks with valid data in. */ | 83 | struct list_head bad_used_list; /* Bad blocks with valid data in. */ |
84 | 84 | ||
85 | spinlock_t erase_completion_lock; /* Protect free_list and erasing_list | 85 | spinlock_t erase_completion_lock; /* Protect free_list and erasing_list |
86 | against erase completion handler */ | 86 | against erase completion handler */ |
87 | wait_queue_head_t erase_wait; /* For waiting for erases to complete */ | 87 | wait_queue_head_t erase_wait; /* For waiting for erases to complete */ |
88 | 88 | ||
89 | wait_queue_head_t inocache_wq; | 89 | wait_queue_head_t inocache_wq; |
90 | struct jffs2_inode_cache **inocache_list; | 90 | struct jffs2_inode_cache **inocache_list; |
91 | spinlock_t inocache_lock; | 91 | spinlock_t inocache_lock; |
92 | 92 | ||
93 | /* Sem to allow jffs2_garbage_collect_deletion_dirent to | 93 | /* Sem to allow jffs2_garbage_collect_deletion_dirent to |
94 | drop the erase_completion_lock while it's holding a pointer | 94 | drop the erase_completion_lock while it's holding a pointer |
95 | to an obsoleted node. I don't like this. Alternatives welcomed. */ | 95 | to an obsoleted node. I don't like this. Alternatives welcomed. */ |
96 | struct semaphore erase_free_sem; | 96 | struct semaphore erase_free_sem; |
97 | 97 | ||
98 | uint32_t wbuf_pagesize; /* 0 for NOR and other flashes with no wbuf */ | ||
99 | |||
98 | #ifdef CONFIG_JFFS2_FS_WRITEBUFFER | 100 | #ifdef CONFIG_JFFS2_FS_WRITEBUFFER |
99 | /* Write-behind buffer for NAND flash */ | 101 | /* Write-behind buffer for NAND flash */ |
100 | unsigned char *wbuf; | 102 | unsigned char *wbuf; |
101 | uint32_t wbuf_ofs; | 103 | uint32_t wbuf_ofs; |
102 | uint32_t wbuf_len; | 104 | uint32_t wbuf_len; |
103 | uint32_t wbuf_pagesize; | ||
104 | struct jffs2_inodirty *wbuf_inodes; | 105 | struct jffs2_inodirty *wbuf_inodes; |
105 | 106 | ||
106 | struct rw_semaphore wbuf_sem; /* Protects the write buffer */ | 107 | struct rw_semaphore wbuf_sem; /* Protects the write buffer */ |
@@ -112,6 +113,8 @@ struct jffs2_sb_info { | |||
112 | uint32_t fsdata_len; | 113 | uint32_t fsdata_len; |
113 | #endif | 114 | #endif |
114 | 115 | ||
116 | struct jffs2_summary *summary; /* Summary information */ | ||
117 | |||
115 | /* OS-private pointer for getting back to master superblock info */ | 118 | /* OS-private pointer for getting back to master superblock info */ |
116 | void *os_priv; | 119 | void *os_priv; |
117 | }; | 120 | }; |
diff --git a/include/linux/kernel.h b/include/linux/kernel.h index f1925ccc9fe1..b1e407a4fbda 100644 --- a/include/linux/kernel.h +++ b/include/linux/kernel.h | |||
@@ -168,7 +168,7 @@ static inline void console_verbose(void) | |||
168 | 168 | ||
169 | extern void bust_spinlocks(int yes); | 169 | extern void bust_spinlocks(int yes); |
170 | extern int oops_in_progress; /* If set, an oops, panic(), BUG() or die() is in progress */ | 170 | extern int oops_in_progress; /* If set, an oops, panic(), BUG() or die() is in progress */ |
171 | extern int panic_timeout; | 171 | extern __deprecated_for_modules int panic_timeout; |
172 | extern int panic_on_oops; | 172 | extern int panic_on_oops; |
173 | extern int tainted; | 173 | extern int tainted; |
174 | extern const char *print_tainted(void); | 174 | extern const char *print_tainted(void); |
@@ -266,7 +266,6 @@ extern void dump_stack(void); | |||
266 | 266 | ||
267 | /** | 267 | /** |
268 | * container_of - cast a member of a structure out to the containing structure | 268 | * container_of - cast a member of a structure out to the containing structure |
269 | * | ||
270 | * @ptr: the pointer to the member. | 269 | * @ptr: the pointer to the member. |
271 | * @type: the type of the container struct this is embedded in. | 270 | * @type: the type of the container struct this is embedded in. |
272 | * @member: the name of the member within the struct. | 271 | * @member: the name of the member within the struct. |
diff --git a/include/linux/kernel_stat.h b/include/linux/kernel_stat.h index dba27749b428..a484572c302e 100644 --- a/include/linux/kernel_stat.h +++ b/include/linux/kernel_stat.h | |||
@@ -6,6 +6,7 @@ | |||
6 | #include <linux/smp.h> | 6 | #include <linux/smp.h> |
7 | #include <linux/threads.h> | 7 | #include <linux/threads.h> |
8 | #include <linux/percpu.h> | 8 | #include <linux/percpu.h> |
9 | #include <linux/cpumask.h> | ||
9 | #include <asm/cputime.h> | 10 | #include <asm/cputime.h> |
10 | 11 | ||
11 | /* | 12 | /* |
@@ -43,11 +44,10 @@ extern unsigned long long nr_context_switches(void); | |||
43 | */ | 44 | */ |
44 | static inline int kstat_irqs(int irq) | 45 | static inline int kstat_irqs(int irq) |
45 | { | 46 | { |
46 | int i, sum=0; | 47 | int cpu, sum = 0; |
47 | 48 | ||
48 | for (i = 0; i < NR_CPUS; i++) | 49 | for_each_cpu(cpu) |
49 | if (cpu_possible(i)) | 50 | sum += kstat_cpu(cpu).irqs[irq]; |
50 | sum += kstat_cpu(i).irqs[irq]; | ||
51 | 51 | ||
52 | return sum; | 52 | return sum; |
53 | } | 53 | } |
diff --git a/include/linux/kprobes.h b/include/linux/kprobes.h index e30afdca7917..e373c4a9de53 100644 --- a/include/linux/kprobes.h +++ b/include/linux/kprobes.h | |||
@@ -33,6 +33,9 @@ | |||
33 | #include <linux/list.h> | 33 | #include <linux/list.h> |
34 | #include <linux/notifier.h> | 34 | #include <linux/notifier.h> |
35 | #include <linux/smp.h> | 35 | #include <linux/smp.h> |
36 | #include <linux/percpu.h> | ||
37 | #include <linux/spinlock.h> | ||
38 | #include <linux/rcupdate.h> | ||
36 | 39 | ||
37 | #include <asm/kprobes.h> | 40 | #include <asm/kprobes.h> |
38 | 41 | ||
@@ -106,6 +109,9 @@ struct jprobe { | |||
106 | kprobe_opcode_t *entry; /* probe handling code to jump to */ | 109 | kprobe_opcode_t *entry; /* probe handling code to jump to */ |
107 | }; | 110 | }; |
108 | 111 | ||
112 | DECLARE_PER_CPU(struct kprobe *, current_kprobe); | ||
113 | DECLARE_PER_CPU(struct kprobe_ctlblk, kprobe_ctlblk); | ||
114 | |||
109 | #ifdef ARCH_SUPPORTS_KRETPROBES | 115 | #ifdef ARCH_SUPPORTS_KRETPROBES |
110 | extern void arch_prepare_kretprobe(struct kretprobe *rp, struct pt_regs *regs); | 116 | extern void arch_prepare_kretprobe(struct kretprobe *rp, struct pt_regs *regs); |
111 | #else /* ARCH_SUPPORTS_KRETPROBES */ | 117 | #else /* ARCH_SUPPORTS_KRETPROBES */ |
@@ -142,17 +148,7 @@ struct kretprobe_instance { | |||
142 | }; | 148 | }; |
143 | 149 | ||
144 | #ifdef CONFIG_KPROBES | 150 | #ifdef CONFIG_KPROBES |
145 | /* Locks kprobe: irq must be disabled */ | 151 | extern spinlock_t kretprobe_lock; |
146 | void lock_kprobes(void); | ||
147 | void unlock_kprobes(void); | ||
148 | |||
149 | /* kprobe running now on this CPU? */ | ||
150 | static inline int kprobe_running(void) | ||
151 | { | ||
152 | extern unsigned int kprobe_cpu; | ||
153 | return kprobe_cpu == smp_processor_id(); | ||
154 | } | ||
155 | |||
156 | extern int arch_prepare_kprobe(struct kprobe *p); | 152 | extern int arch_prepare_kprobe(struct kprobe *p); |
157 | extern void arch_copy_kprobe(struct kprobe *p); | 153 | extern void arch_copy_kprobe(struct kprobe *p); |
158 | extern void arch_arm_kprobe(struct kprobe *p); | 154 | extern void arch_arm_kprobe(struct kprobe *p); |
@@ -163,10 +159,26 @@ extern void show_registers(struct pt_regs *regs); | |||
163 | extern kprobe_opcode_t *get_insn_slot(void); | 159 | extern kprobe_opcode_t *get_insn_slot(void); |
164 | extern void free_insn_slot(kprobe_opcode_t *slot); | 160 | extern void free_insn_slot(kprobe_opcode_t *slot); |
165 | 161 | ||
166 | /* Get the kprobe at this addr (if any). Must have called lock_kprobes */ | 162 | /* Get the kprobe at this addr (if any) - called with preemption disabled */ |
167 | struct kprobe *get_kprobe(void *addr); | 163 | struct kprobe *get_kprobe(void *addr); |
168 | struct hlist_head * kretprobe_inst_table_head(struct task_struct *tsk); | 164 | struct hlist_head * kretprobe_inst_table_head(struct task_struct *tsk); |
169 | 165 | ||
166 | /* kprobe_running() will just return the current_kprobe on this CPU */ | ||
167 | static inline struct kprobe *kprobe_running(void) | ||
168 | { | ||
169 | return (__get_cpu_var(current_kprobe)); | ||
170 | } | ||
171 | |||
172 | static inline void reset_current_kprobe(void) | ||
173 | { | ||
174 | __get_cpu_var(current_kprobe) = NULL; | ||
175 | } | ||
176 | |||
177 | static inline struct kprobe_ctlblk *get_kprobe_ctlblk(void) | ||
178 | { | ||
179 | return (&__get_cpu_var(kprobe_ctlblk)); | ||
180 | } | ||
181 | |||
170 | int register_kprobe(struct kprobe *p); | 182 | int register_kprobe(struct kprobe *p); |
171 | void unregister_kprobe(struct kprobe *p); | 183 | void unregister_kprobe(struct kprobe *p); |
172 | int setjmp_pre_handler(struct kprobe *, struct pt_regs *); | 184 | int setjmp_pre_handler(struct kprobe *, struct pt_regs *); |
@@ -183,9 +195,9 @@ void add_rp_inst(struct kretprobe_instance *ri); | |||
183 | void kprobe_flush_task(struct task_struct *tk); | 195 | void kprobe_flush_task(struct task_struct *tk); |
184 | void recycle_rp_inst(struct kretprobe_instance *ri); | 196 | void recycle_rp_inst(struct kretprobe_instance *ri); |
185 | #else /* CONFIG_KPROBES */ | 197 | #else /* CONFIG_KPROBES */ |
186 | static inline int kprobe_running(void) | 198 | static inline struct kprobe *kprobe_running(void) |
187 | { | 199 | { |
188 | return 0; | 200 | return NULL; |
189 | } | 201 | } |
190 | static inline int register_kprobe(struct kprobe *p) | 202 | static inline int register_kprobe(struct kprobe *p) |
191 | { | 203 | { |
diff --git a/include/linux/list.h b/include/linux/list.h index 084971f333fe..fbfca73355a3 100644 --- a/include/linux/list.h +++ b/include/linux/list.h | |||
@@ -601,7 +601,7 @@ static inline void hlist_add_head(struct hlist_node *n, struct hlist_head *h) | |||
601 | * or hlist_del_rcu(), running on this same list. | 601 | * or hlist_del_rcu(), running on this same list. |
602 | * However, it is perfectly legal to run concurrently with | 602 | * However, it is perfectly legal to run concurrently with |
603 | * the _rcu list-traversal primitives, such as | 603 | * the _rcu list-traversal primitives, such as |
604 | * hlist_for_each_rcu(), used to prevent memory-consistency | 604 | * hlist_for_each_entry_rcu(), used to prevent memory-consistency |
605 | * problems on Alpha CPUs. Regardless of the type of CPU, the | 605 | * problems on Alpha CPUs. Regardless of the type of CPU, the |
606 | * list-traversal primitive must be guarded by rcu_read_lock(). | 606 | * list-traversal primitive must be guarded by rcu_read_lock(). |
607 | */ | 607 | */ |
@@ -650,7 +650,7 @@ static inline void hlist_add_after(struct hlist_node *n, | |||
650 | * or hlist_del_rcu(), running on this same list. | 650 | * or hlist_del_rcu(), running on this same list. |
651 | * However, it is perfectly legal to run concurrently with | 651 | * However, it is perfectly legal to run concurrently with |
652 | * the _rcu list-traversal primitives, such as | 652 | * the _rcu list-traversal primitives, such as |
653 | * hlist_for_each_rcu(), used to prevent memory-consistency | 653 | * hlist_for_each_entry_rcu(), used to prevent memory-consistency |
654 | * problems on Alpha CPUs. | 654 | * problems on Alpha CPUs. |
655 | */ | 655 | */ |
656 | static inline void hlist_add_before_rcu(struct hlist_node *n, | 656 | static inline void hlist_add_before_rcu(struct hlist_node *n, |
@@ -675,7 +675,7 @@ static inline void hlist_add_before_rcu(struct hlist_node *n, | |||
675 | * or hlist_del_rcu(), running on this same list. | 675 | * or hlist_del_rcu(), running on this same list. |
676 | * However, it is perfectly legal to run concurrently with | 676 | * However, it is perfectly legal to run concurrently with |
677 | * the _rcu list-traversal primitives, such as | 677 | * the _rcu list-traversal primitives, such as |
678 | * hlist_for_each_rcu(), used to prevent memory-consistency | 678 | * hlist_for_each_entry_rcu(), used to prevent memory-consistency |
679 | * problems on Alpha CPUs. | 679 | * problems on Alpha CPUs. |
680 | */ | 680 | */ |
681 | static inline void hlist_add_after_rcu(struct hlist_node *prev, | 681 | static inline void hlist_add_after_rcu(struct hlist_node *prev, |
@@ -699,11 +699,6 @@ static inline void hlist_add_after_rcu(struct hlist_node *prev, | |||
699 | for (pos = (head)->first; pos && ({ n = pos->next; 1; }); \ | 699 | for (pos = (head)->first; pos && ({ n = pos->next; 1; }); \ |
700 | pos = n) | 700 | pos = n) |
701 | 701 | ||
702 | #define hlist_for_each_rcu(pos, head) \ | ||
703 | for ((pos) = (head)->first; \ | ||
704 | rcu_dereference((pos)) && ({ prefetch((pos)->next); 1; }); \ | ||
705 | (pos) = (pos)->next) | ||
706 | |||
707 | /** | 702 | /** |
708 | * hlist_for_each_entry - iterate over list of given type | 703 | * hlist_for_each_entry - iterate over list of given type |
709 | * @tpos: the type * to use as a loop counter. | 704 | * @tpos: the type * to use as a loop counter. |
@@ -756,7 +751,7 @@ static inline void hlist_add_after_rcu(struct hlist_node *prev, | |||
756 | 751 | ||
757 | /** | 752 | /** |
758 | * hlist_for_each_entry_rcu - iterate over rcu list of given type | 753 | * hlist_for_each_entry_rcu - iterate over rcu list of given type |
759 | * @pos: the type * to use as a loop counter. | 754 | * @tpos: the type * to use as a loop counter. |
760 | * @pos: the &struct hlist_node to use as a loop counter. | 755 | * @pos: the &struct hlist_node to use as a loop counter. |
761 | * @head: the head for your list. | 756 | * @head: the head for your list. |
762 | * @member: the name of the hlist_node within the struct. | 757 | * @member: the name of the hlist_node within the struct. |
diff --git a/include/linux/memory.h b/include/linux/memory.h index 0def328ab5cf..9a424383e6c6 100644 --- a/include/linux/memory.h +++ b/include/linux/memory.h | |||
@@ -54,6 +54,9 @@ struct memory_block { | |||
54 | */ | 54 | */ |
55 | #define MEM_MAPPING_INVALID (1<<3) | 55 | #define MEM_MAPPING_INVALID (1<<3) |
56 | 56 | ||
57 | struct notifier_block; | ||
58 | struct mem_section; | ||
59 | |||
57 | #ifndef CONFIG_MEMORY_HOTPLUG | 60 | #ifndef CONFIG_MEMORY_HOTPLUG |
58 | static inline int memory_dev_init(void) | 61 | static inline int memory_dev_init(void) |
59 | { | 62 | { |
diff --git a/include/linux/mm.h b/include/linux/mm.h index 5c1fb0a2e806..7b115feca4df 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h | |||
@@ -932,13 +932,13 @@ int write_one_page(struct page *page, int wait); | |||
932 | * turning readahead off */ | 932 | * turning readahead off */ |
933 | 933 | ||
934 | int do_page_cache_readahead(struct address_space *mapping, struct file *filp, | 934 | int do_page_cache_readahead(struct address_space *mapping, struct file *filp, |
935 | unsigned long offset, unsigned long nr_to_read); | 935 | pgoff_t offset, unsigned long nr_to_read); |
936 | int force_page_cache_readahead(struct address_space *mapping, struct file *filp, | 936 | int force_page_cache_readahead(struct address_space *mapping, struct file *filp, |
937 | unsigned long offset, unsigned long nr_to_read); | 937 | pgoff_t offset, unsigned long nr_to_read); |
938 | unsigned long page_cache_readahead(struct address_space *mapping, | 938 | unsigned long page_cache_readahead(struct address_space *mapping, |
939 | struct file_ra_state *ra, | 939 | struct file_ra_state *ra, |
940 | struct file *filp, | 940 | struct file *filp, |
941 | unsigned long offset, | 941 | pgoff_t offset, |
942 | unsigned long size); | 942 | unsigned long size); |
943 | void handle_ra_miss(struct address_space *mapping, | 943 | void handle_ra_miss(struct address_space *mapping, |
944 | struct file_ra_state *ra, pgoff_t offset); | 944 | struct file_ra_state *ra, pgoff_t offset); |
diff --git a/include/linux/mtd/bbm.h b/include/linux/mtd/bbm.h new file mode 100644 index 000000000000..7a7fbe87fef0 --- /dev/null +++ b/include/linux/mtd/bbm.h | |||
@@ -0,0 +1,122 @@ | |||
1 | /* | ||
2 | * linux/include/linux/mtd/bbm.h | ||
3 | * | ||
4 | * NAND family Bad Block Management (BBM) header file | ||
5 | * - Bad Block Table (BBT) implementation | ||
6 | * | ||
7 | * Copyright (c) 2005 Samsung Electronics | ||
8 | * Kyungmin Park <kyungmin.park@samsung.com> | ||
9 | * | ||
10 | * Copyright (c) 2000-2005 | ||
11 | * Thomas Gleixner <tglx@linuxtronix.de> | ||
12 | * | ||
13 | */ | ||
14 | #ifndef __LINUX_MTD_BBM_H | ||
15 | #define __LINUX_MTD_BBM_H | ||
16 | |||
17 | /* The maximum number of NAND chips in an array */ | ||
18 | #define NAND_MAX_CHIPS 8 | ||
19 | |||
20 | /** | ||
21 | * struct nand_bbt_descr - bad block table descriptor | ||
22 | * @param options options for this descriptor | ||
23 | * @param pages the page(s) where we find the bbt, used with | ||
24 | * option BBT_ABSPAGE when bbt is searched, | ||
25 | * then we store the found bbts pages here. | ||
26 | * Its an array and supports up to 8 chips now | ||
27 | * @param offs offset of the pattern in the oob area of the page | ||
28 | * @param veroffs offset of the bbt version counter in the oob are of the page | ||
29 | * @param version version read from the bbt page during scan | ||
30 | * @param len length of the pattern, if 0 no pattern check is performed | ||
31 | * @param maxblocks maximum number of blocks to search for a bbt. This number of | ||
32 | * blocks is reserved at the end of the device | ||
33 | * where the tables are written. | ||
34 | * @param reserved_block_code if non-0, this pattern denotes a reserved | ||
35 | * (rather than bad) block in the stored bbt | ||
36 | * @param pattern pattern to identify bad block table or factory marked | ||
37 | * good / bad blocks, can be NULL, if len = 0 | ||
38 | * | ||
39 | * Descriptor for the bad block table marker and the descriptor for the | ||
40 | * pattern which identifies good and bad blocks. The assumption is made | ||
41 | * that the pattern and the version count are always located in the oob area | ||
42 | * of the first block. | ||
43 | */ | ||
44 | struct nand_bbt_descr { | ||
45 | int options; | ||
46 | int pages[NAND_MAX_CHIPS]; | ||
47 | int offs; | ||
48 | int veroffs; | ||
49 | uint8_t version[NAND_MAX_CHIPS]; | ||
50 | int len; | ||
51 | int maxblocks; | ||
52 | int reserved_block_code; | ||
53 | uint8_t *pattern; | ||
54 | }; | ||
55 | |||
56 | /* Options for the bad block table descriptors */ | ||
57 | |||
58 | /* The number of bits used per block in the bbt on the device */ | ||
59 | #define NAND_BBT_NRBITS_MSK 0x0000000F | ||
60 | #define NAND_BBT_1BIT 0x00000001 | ||
61 | #define NAND_BBT_2BIT 0x00000002 | ||
62 | #define NAND_BBT_4BIT 0x00000004 | ||
63 | #define NAND_BBT_8BIT 0x00000008 | ||
64 | /* The bad block table is in the last good block of the device */ | ||
65 | #define NAND_BBT_LASTBLOCK 0x00000010 | ||
66 | /* The bbt is at the given page, else we must scan for the bbt */ | ||
67 | #define NAND_BBT_ABSPAGE 0x00000020 | ||
68 | /* The bbt is at the given page, else we must scan for the bbt */ | ||
69 | #define NAND_BBT_SEARCH 0x00000040 | ||
70 | /* bbt is stored per chip on multichip devices */ | ||
71 | #define NAND_BBT_PERCHIP 0x00000080 | ||
72 | /* bbt has a version counter at offset veroffs */ | ||
73 | #define NAND_BBT_VERSION 0x00000100 | ||
74 | /* Create a bbt if none axists */ | ||
75 | #define NAND_BBT_CREATE 0x00000200 | ||
76 | /* Search good / bad pattern through all pages of a block */ | ||
77 | #define NAND_BBT_SCANALLPAGES 0x00000400 | ||
78 | /* Scan block empty during good / bad block scan */ | ||
79 | #define NAND_BBT_SCANEMPTY 0x00000800 | ||
80 | /* Write bbt if neccecary */ | ||
81 | #define NAND_BBT_WRITE 0x00001000 | ||
82 | /* Read and write back block contents when writing bbt */ | ||
83 | #define NAND_BBT_SAVECONTENT 0x00002000 | ||
84 | /* Search good / bad pattern on the first and the second page */ | ||
85 | #define NAND_BBT_SCAN2NDPAGE 0x00004000 | ||
86 | |||
87 | /* The maximum number of blocks to scan for a bbt */ | ||
88 | #define NAND_BBT_SCAN_MAXBLOCKS 4 | ||
89 | |||
90 | /* | ||
91 | * Constants for oob configuration | ||
92 | */ | ||
93 | #define ONENAND_BADBLOCK_POS 0 | ||
94 | |||
95 | /** | ||
96 | * struct bbt_info - [GENERIC] Bad Block Table data structure | ||
97 | * @param bbt_erase_shift [INTERN] number of address bits in a bbt entry | ||
98 | * @param badblockpos [INTERN] position of the bad block marker in the oob area | ||
99 | * @param bbt [INTERN] bad block table pointer | ||
100 | * @param badblock_pattern [REPLACEABLE] bad block scan pattern used for initial bad block scan | ||
101 | * @param priv [OPTIONAL] pointer to private bbm date | ||
102 | */ | ||
103 | struct bbm_info { | ||
104 | int bbt_erase_shift; | ||
105 | int badblockpos; | ||
106 | int options; | ||
107 | |||
108 | uint8_t *bbt; | ||
109 | |||
110 | int (*isbad_bbt)(struct mtd_info *mtd, loff_t ofs, int allowbbt); | ||
111 | |||
112 | /* TODO Add more NAND specific fileds */ | ||
113 | struct nand_bbt_descr *badblock_pattern; | ||
114 | |||
115 | void *priv; | ||
116 | }; | ||
117 | |||
118 | /* OneNAND BBT interface */ | ||
119 | extern int onenand_scan_bbt(struct mtd_info *mtd, struct nand_bbt_descr *bd); | ||
120 | extern int onenand_default_bbt(struct mtd_info *mtd); | ||
121 | |||
122 | #endif /* __LINUX_MTD_BBM_H */ | ||
diff --git a/include/linux/mtd/blktrans.h b/include/linux/mtd/blktrans.h index 4ebc2e5a16e2..f46afec6fbf8 100644 --- a/include/linux/mtd/blktrans.h +++ b/include/linux/mtd/blktrans.h | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * $Id: blktrans.h,v 1.5 2003/06/23 12:00:08 dwmw2 Exp $ | 2 | * $Id: blktrans.h,v 1.6 2005/11/07 11:14:54 gleixner Exp $ |
3 | * | 3 | * |
4 | * (C) 2003 David Woodhouse <dwmw2@infradead.org> | 4 | * (C) 2003 David Woodhouse <dwmw2@infradead.org> |
5 | * | 5 | * |
@@ -67,6 +67,6 @@ extern int register_mtd_blktrans(struct mtd_blktrans_ops *tr); | |||
67 | extern int deregister_mtd_blktrans(struct mtd_blktrans_ops *tr); | 67 | extern int deregister_mtd_blktrans(struct mtd_blktrans_ops *tr); |
68 | extern int add_mtd_blktrans_dev(struct mtd_blktrans_dev *dev); | 68 | extern int add_mtd_blktrans_dev(struct mtd_blktrans_dev *dev); |
69 | extern int del_mtd_blktrans_dev(struct mtd_blktrans_dev *dev); | 69 | extern int del_mtd_blktrans_dev(struct mtd_blktrans_dev *dev); |
70 | 70 | ||
71 | 71 | ||
72 | #endif /* __MTD_TRANS_H__ */ | 72 | #endif /* __MTD_TRANS_H__ */ |
diff --git a/include/linux/mtd/cfi.h b/include/linux/mtd/cfi.h index e6b6a1c66bd5..39f1430bd6d5 100644 --- a/include/linux/mtd/cfi.h +++ b/include/linux/mtd/cfi.h | |||
@@ -1,7 +1,7 @@ | |||
1 | 1 | ||
2 | /* Common Flash Interface structures | 2 | /* Common Flash Interface structures |
3 | * See http://support.intel.com/design/flash/technote/index.htm | 3 | * See http://support.intel.com/design/flash/technote/index.htm |
4 | * $Id: cfi.h,v 1.54 2005/06/06 23:04:36 tpoynor Exp $ | 4 | * $Id: cfi.h,v 1.56 2005/11/07 11:14:54 gleixner Exp $ |
5 | */ | 5 | */ |
6 | 6 | ||
7 | #ifndef __MTD_CFI_H__ | 7 | #ifndef __MTD_CFI_H__ |
@@ -82,8 +82,8 @@ static inline int cfi_interleave_supported(int i) | |||
82 | } | 82 | } |
83 | 83 | ||
84 | 84 | ||
85 | /* NB: these values must represents the number of bytes needed to meet the | 85 | /* NB: these values must represents the number of bytes needed to meet the |
86 | * device type (x8, x16, x32). Eg. a 32 bit device is 4 x 8 bytes. | 86 | * device type (x8, x16, x32). Eg. a 32 bit device is 4 x 8 bytes. |
87 | * These numbers are used in calculations. | 87 | * These numbers are used in calculations. |
88 | */ | 88 | */ |
89 | #define CFI_DEVICETYPE_X8 (8 / 8) | 89 | #define CFI_DEVICETYPE_X8 (8 / 8) |
@@ -173,6 +173,15 @@ struct cfi_intelext_regioninfo { | |||
173 | struct cfi_intelext_blockinfo BlockTypes[1]; | 173 | struct cfi_intelext_blockinfo BlockTypes[1]; |
174 | } __attribute__((packed)); | 174 | } __attribute__((packed)); |
175 | 175 | ||
176 | struct cfi_intelext_programming_regioninfo { | ||
177 | uint8_t ProgRegShift; | ||
178 | uint8_t Reserved1; | ||
179 | uint8_t ControlValid; | ||
180 | uint8_t Reserved2; | ||
181 | uint8_t ControlInvalid; | ||
182 | uint8_t Reserved3; | ||
183 | } __attribute__((packed)); | ||
184 | |||
176 | /* Vendor-Specific PRI for AMD/Fujitsu Extended Command Set (0x0002) */ | 185 | /* Vendor-Specific PRI for AMD/Fujitsu Extended Command Set (0x0002) */ |
177 | 186 | ||
178 | struct cfi_pri_amdstd { | 187 | struct cfi_pri_amdstd { |
@@ -250,7 +259,7 @@ static inline uint32_t cfi_build_cmd_addr(uint32_t cmd_ofs, int interleave, int | |||
250 | /* | 259 | /* |
251 | * Transforms the CFI command for the given geometry (bus width & interleave). | 260 | * Transforms the CFI command for the given geometry (bus width & interleave). |
252 | * It looks too long to be inline, but in the common case it should almost all | 261 | * It looks too long to be inline, but in the common case it should almost all |
253 | * get optimised away. | 262 | * get optimised away. |
254 | */ | 263 | */ |
255 | static inline map_word cfi_build_cmd(u_long cmd, struct map_info *map, struct cfi_private *cfi) | 264 | static inline map_word cfi_build_cmd(u_long cmd, struct map_info *map, struct cfi_private *cfi) |
256 | { | 265 | { |
@@ -259,7 +268,7 @@ static inline map_word cfi_build_cmd(u_long cmd, struct map_info *map, struct cf | |||
259 | unsigned long onecmd; | 268 | unsigned long onecmd; |
260 | int i; | 269 | int i; |
261 | 270 | ||
262 | /* We do it this way to give the compiler a fighting chance | 271 | /* We do it this way to give the compiler a fighting chance |
263 | of optimising away all the crap for 'bankwidth' larger than | 272 | of optimising away all the crap for 'bankwidth' larger than |
264 | an unsigned long, in the common case where that support is | 273 | an unsigned long, in the common case where that support is |
265 | disabled */ | 274 | disabled */ |
@@ -270,7 +279,7 @@ static inline map_word cfi_build_cmd(u_long cmd, struct map_info *map, struct cf | |||
270 | wordwidth = map_bankwidth(map); | 279 | wordwidth = map_bankwidth(map); |
271 | words_per_bus = 1; | 280 | words_per_bus = 1; |
272 | } | 281 | } |
273 | 282 | ||
274 | chip_mode = map_bankwidth(map) / cfi_interleave(cfi); | 283 | chip_mode = map_bankwidth(map) / cfi_interleave(cfi); |
275 | chips_per_word = wordwidth * cfi_interleave(cfi) / map_bankwidth(map); | 284 | chips_per_word = wordwidth * cfi_interleave(cfi) / map_bankwidth(map); |
276 | 285 | ||
@@ -289,7 +298,7 @@ static inline map_word cfi_build_cmd(u_long cmd, struct map_info *map, struct cf | |||
289 | break; | 298 | break; |
290 | } | 299 | } |
291 | 300 | ||
292 | /* Now replicate it across the size of an unsigned long, or | 301 | /* Now replicate it across the size of an unsigned long, or |
293 | just to the bus width as appropriate */ | 302 | just to the bus width as appropriate */ |
294 | switch (chips_per_word) { | 303 | switch (chips_per_word) { |
295 | default: BUG(); | 304 | default: BUG(); |
@@ -305,7 +314,7 @@ static inline map_word cfi_build_cmd(u_long cmd, struct map_info *map, struct cf | |||
305 | ; | 314 | ; |
306 | } | 315 | } |
307 | 316 | ||
308 | /* And finally, for the multi-word case, replicate it | 317 | /* And finally, for the multi-word case, replicate it |
309 | in all words in the structure */ | 318 | in all words in the structure */ |
310 | for (i=0; i < words_per_bus; i++) { | 319 | for (i=0; i < words_per_bus; i++) { |
311 | val.x[i] = onecmd; | 320 | val.x[i] = onecmd; |
@@ -316,14 +325,14 @@ static inline map_word cfi_build_cmd(u_long cmd, struct map_info *map, struct cf | |||
316 | #define CMD(x) cfi_build_cmd((x), map, cfi) | 325 | #define CMD(x) cfi_build_cmd((x), map, cfi) |
317 | 326 | ||
318 | 327 | ||
319 | static inline unsigned char cfi_merge_status(map_word val, struct map_info *map, | 328 | static inline unsigned long cfi_merge_status(map_word val, struct map_info *map, |
320 | struct cfi_private *cfi) | 329 | struct cfi_private *cfi) |
321 | { | 330 | { |
322 | int wordwidth, words_per_bus, chip_mode, chips_per_word; | 331 | int wordwidth, words_per_bus, chip_mode, chips_per_word; |
323 | unsigned long onestat, res = 0; | 332 | unsigned long onestat, res = 0; |
324 | int i; | 333 | int i; |
325 | 334 | ||
326 | /* We do it this way to give the compiler a fighting chance | 335 | /* We do it this way to give the compiler a fighting chance |
327 | of optimising away all the crap for 'bankwidth' larger than | 336 | of optimising away all the crap for 'bankwidth' larger than |
328 | an unsigned long, in the common case where that support is | 337 | an unsigned long, in the common case where that support is |
329 | disabled */ | 338 | disabled */ |
@@ -334,7 +343,7 @@ static inline unsigned char cfi_merge_status(map_word val, struct map_info *map, | |||
334 | wordwidth = map_bankwidth(map); | 343 | wordwidth = map_bankwidth(map); |
335 | words_per_bus = 1; | 344 | words_per_bus = 1; |
336 | } | 345 | } |
337 | 346 | ||
338 | chip_mode = map_bankwidth(map) / cfi_interleave(cfi); | 347 | chip_mode = map_bankwidth(map) / cfi_interleave(cfi); |
339 | chips_per_word = wordwidth * cfi_interleave(cfi) / map_bankwidth(map); | 348 | chips_per_word = wordwidth * cfi_interleave(cfi) / map_bankwidth(map); |
340 | 349 | ||
diff --git a/include/linux/mtd/doc2000.h b/include/linux/mtd/doc2000.h index 953e64fb8ac5..386a52cf8b1b 100644 --- a/include/linux/mtd/doc2000.h +++ b/include/linux/mtd/doc2000.h | |||
@@ -1,12 +1,12 @@ | |||
1 | /* | 1 | /* |
2 | * Linux driver for Disk-On-Chip devices | 2 | * Linux driver for Disk-On-Chip devices |
3 | * | 3 | * |
4 | * Copyright (C) 1999 Machine Vision Holdings, Inc. | 4 | * Copyright (C) 1999 Machine Vision Holdings, Inc. |
5 | * Copyright (C) 2001-2003 David Woodhouse <dwmw2@infradead.org> | 5 | * Copyright (C) 2001-2003 David Woodhouse <dwmw2@infradead.org> |
6 | * Copyright (C) 2002-2003 Greg Ungerer <gerg@snapgear.com> | 6 | * Copyright (C) 2002-2003 Greg Ungerer <gerg@snapgear.com> |
7 | * Copyright (C) 2002-2003 SnapGear Inc | 7 | * Copyright (C) 2002-2003 SnapGear Inc |
8 | * | 8 | * |
9 | * $Id: doc2000.h,v 1.24 2005/01/05 12:40:38 dwmw2 Exp $ | 9 | * $Id: doc2000.h,v 1.25 2005/11/07 11:14:54 gleixner Exp $ |
10 | * | 10 | * |
11 | * Released under GPL | 11 | * Released under GPL |
12 | */ | 12 | */ |
@@ -75,10 +75,10 @@ | |||
75 | #define DoC_Mplus_CtrlConfirm 0x1076 | 75 | #define DoC_Mplus_CtrlConfirm 0x1076 |
76 | #define DoC_Mplus_Power 0x1fff | 76 | #define DoC_Mplus_Power 0x1fff |
77 | 77 | ||
78 | /* How to access the device? | 78 | /* How to access the device? |
79 | * On ARM, it'll be mmap'd directly with 32-bit wide accesses. | 79 | * On ARM, it'll be mmap'd directly with 32-bit wide accesses. |
80 | * On PPC, it's mmap'd and 16-bit wide. | 80 | * On PPC, it's mmap'd and 16-bit wide. |
81 | * Others use readb/writeb | 81 | * Others use readb/writeb |
82 | */ | 82 | */ |
83 | #if defined(__arm__) | 83 | #if defined(__arm__) |
84 | #define ReadDOC_(adr, reg) ((unsigned char)(*(volatile __u32 *)(((unsigned long)adr)+((reg)<<2)))) | 84 | #define ReadDOC_(adr, reg) ((unsigned char)(*(volatile __u32 *)(((unsigned long)adr)+((reg)<<2)))) |
@@ -172,7 +172,7 @@ struct DiskOnChip { | |||
172 | unsigned long totlen; | 172 | unsigned long totlen; |
173 | unsigned char ChipID; /* Type of DiskOnChip */ | 173 | unsigned char ChipID; /* Type of DiskOnChip */ |
174 | int ioreg; | 174 | int ioreg; |
175 | 175 | ||
176 | unsigned long mfr; /* Flash IDs - only one type of flash per device */ | 176 | unsigned long mfr; /* Flash IDs - only one type of flash per device */ |
177 | unsigned long id; | 177 | unsigned long id; |
178 | int chipshift; | 178 | int chipshift; |
@@ -180,10 +180,10 @@ struct DiskOnChip { | |||
180 | char pageadrlen; | 180 | char pageadrlen; |
181 | char interleave; /* Internal interleaving - Millennium Plus style */ | 181 | char interleave; /* Internal interleaving - Millennium Plus style */ |
182 | unsigned long erasesize; | 182 | unsigned long erasesize; |
183 | 183 | ||
184 | int curfloor; | 184 | int curfloor; |
185 | int curchip; | 185 | int curchip; |
186 | 186 | ||
187 | int numchips; | 187 | int numchips; |
188 | struct Nand *chips; | 188 | struct Nand *chips; |
189 | struct mtd_info *nextdoc; | 189 | struct mtd_info *nextdoc; |
diff --git a/include/linux/mtd/flashchip.h b/include/linux/mtd/flashchip.h index 675776fa3e27..a293a3b78e05 100644 --- a/include/linux/mtd/flashchip.h +++ b/include/linux/mtd/flashchip.h | |||
@@ -1,12 +1,12 @@ | |||
1 | 1 | ||
2 | /* | 2 | /* |
3 | * struct flchip definition | 3 | * struct flchip definition |
4 | * | 4 | * |
5 | * Contains information about the location and state of a given flash device | 5 | * Contains information about the location and state of a given flash device |
6 | * | 6 | * |
7 | * (C) 2000 Red Hat. GPLd. | 7 | * (C) 2000 Red Hat. GPLd. |
8 | * | 8 | * |
9 | * $Id: flashchip.h,v 1.17 2005/03/14 18:27:15 bjd Exp $ | 9 | * $Id: flashchip.h,v 1.18 2005/11/07 11:14:54 gleixner Exp $ |
10 | * | 10 | * |
11 | */ | 11 | */ |
12 | 12 | ||
@@ -15,11 +15,11 @@ | |||
15 | 15 | ||
16 | /* For spinlocks. sched.h includes spinlock.h from whichever directory it | 16 | /* For spinlocks. sched.h includes spinlock.h from whichever directory it |
17 | * happens to be in - so we don't have to care whether we're on 2.2, which | 17 | * happens to be in - so we don't have to care whether we're on 2.2, which |
18 | * has asm/spinlock.h, or 2.4, which has linux/spinlock.h | 18 | * has asm/spinlock.h, or 2.4, which has linux/spinlock.h |
19 | */ | 19 | */ |
20 | #include <linux/sched.h> | 20 | #include <linux/sched.h> |
21 | 21 | ||
22 | typedef enum { | 22 | typedef enum { |
23 | FL_READY, | 23 | FL_READY, |
24 | FL_STATUS, | 24 | FL_STATUS, |
25 | FL_CFI_QUERY, | 25 | FL_CFI_QUERY, |
@@ -45,7 +45,7 @@ typedef enum { | |||
45 | 45 | ||
46 | 46 | ||
47 | 47 | ||
48 | /* NOTE: confusingly, this can be used to refer to more than one chip at a time, | 48 | /* NOTE: confusingly, this can be used to refer to more than one chip at a time, |
49 | if they're interleaved. This can even refer to individual partitions on | 49 | if they're interleaved. This can even refer to individual partitions on |
50 | the same physical chip when present. */ | 50 | the same physical chip when present. */ |
51 | 51 | ||
diff --git a/include/linux/mtd/ftl.h b/include/linux/mtd/ftl.h index 3678459b4535..d99609113307 100644 --- a/include/linux/mtd/ftl.h +++ b/include/linux/mtd/ftl.h | |||
@@ -1,6 +1,6 @@ | |||
1 | /* | 1 | /* |
2 | * $Id: ftl.h,v 1.6 2003/01/24 13:20:04 dwmw2 Exp $ | 2 | * $Id: ftl.h,v 1.7 2005/11/07 11:14:54 gleixner Exp $ |
3 | * | 3 | * |
4 | * Derived from (and probably identical to): | 4 | * Derived from (and probably identical to): |
5 | * ftl.h 1.7 1999/10/25 20:23:17 | 5 | * ftl.h 1.7 1999/10/25 20:23:17 |
6 | * | 6 | * |
@@ -12,7 +12,7 @@ | |||
12 | * Software distributed under the License is distributed on an "AS IS" | 12 | * Software distributed under the License is distributed on an "AS IS" |
13 | * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See | 13 | * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See |
14 | * the License for the specific language governing rights and | 14 | * the License for the specific language governing rights and |
15 | * limitations under the License. | 15 | * limitations under the License. |
16 | * | 16 | * |
17 | * The initial developer of the original code is David A. Hinds | 17 | * The initial developer of the original code is David A. Hinds |
18 | * <dahinds@users.sourceforge.net>. Portions created by David A. Hinds | 18 | * <dahinds@users.sourceforge.net>. Portions created by David A. Hinds |
diff --git a/include/linux/mtd/gen_probe.h b/include/linux/mtd/gen_probe.h index 3d7bdec14f97..256e7342ed1e 100644 --- a/include/linux/mtd/gen_probe.h +++ b/include/linux/mtd/gen_probe.h | |||
@@ -1,14 +1,14 @@ | |||
1 | /* | 1 | /* |
2 | * (C) 2001, 2001 Red Hat, Inc. | 2 | * (C) 2001, 2001 Red Hat, Inc. |
3 | * GPL'd | 3 | * GPL'd |
4 | * $Id: gen_probe.h,v 1.3 2004/10/20 22:10:33 dwmw2 Exp $ | 4 | * $Id: gen_probe.h,v 1.4 2005/11/07 11:14:54 gleixner Exp $ |
5 | */ | 5 | */ |
6 | 6 | ||
7 | #ifndef __LINUX_MTD_GEN_PROBE_H__ | 7 | #ifndef __LINUX_MTD_GEN_PROBE_H__ |
8 | #define __LINUX_MTD_GEN_PROBE_H__ | 8 | #define __LINUX_MTD_GEN_PROBE_H__ |
9 | 9 | ||
10 | #include <linux/mtd/flashchip.h> | 10 | #include <linux/mtd/flashchip.h> |
11 | #include <linux/mtd/map.h> | 11 | #include <linux/mtd/map.h> |
12 | #include <linux/mtd/cfi.h> | 12 | #include <linux/mtd/cfi.h> |
13 | #include <linux/bitops.h> | 13 | #include <linux/bitops.h> |
14 | 14 | ||
diff --git a/include/linux/mtd/jedec.h b/include/linux/mtd/jedec.h index 2ba0f700ddbc..9006feb218b9 100644 --- a/include/linux/mtd/jedec.h +++ b/include/linux/mtd/jedec.h | |||
@@ -1,13 +1,13 @@ | |||
1 | 1 | ||
2 | /* JEDEC Flash Interface. | 2 | /* JEDEC Flash Interface. |
3 | * This is an older type of interface for self programming flash. It is | 3 | * This is an older type of interface for self programming flash. It is |
4 | * commonly use in older AMD chips and is obsolete compared with CFI. | 4 | * commonly use in older AMD chips and is obsolete compared with CFI. |
5 | * It is called JEDEC because the JEDEC association distributes the ID codes | 5 | * It is called JEDEC because the JEDEC association distributes the ID codes |
6 | * for the chips. | 6 | * for the chips. |
7 | * | 7 | * |
8 | * See the AMD flash databook for information on how to operate the interface. | 8 | * See the AMD flash databook for information on how to operate the interface. |
9 | * | 9 | * |
10 | * $Id: jedec.h,v 1.3 2003/05/21 11:51:01 dwmw2 Exp $ | 10 | * $Id: jedec.h,v 1.4 2005/11/07 11:14:54 gleixner Exp $ |
11 | */ | 11 | */ |
12 | 12 | ||
13 | #ifndef __LINUX_MTD_JEDEC_H__ | 13 | #ifndef __LINUX_MTD_JEDEC_H__ |
@@ -33,16 +33,16 @@ struct jedec_flash_chip | |||
33 | __u16 jedec; | 33 | __u16 jedec; |
34 | unsigned long size; | 34 | unsigned long size; |
35 | unsigned long sectorsize; | 35 | unsigned long sectorsize; |
36 | 36 | ||
37 | // *(__u8*)(base + (adder << addrshift)) = data << datashift | 37 | // *(__u8*)(base + (adder << addrshift)) = data << datashift |
38 | // Address size = size << addrshift | 38 | // Address size = size << addrshift |
39 | unsigned long base; // Byte 0 of the flash, will be unaligned | 39 | unsigned long base; // Byte 0 of the flash, will be unaligned |
40 | unsigned int datashift; // Useful for 32bit/16bit accesses | 40 | unsigned int datashift; // Useful for 32bit/16bit accesses |
41 | unsigned int addrshift; | 41 | unsigned int addrshift; |
42 | unsigned long offset; // linerized start. base==offset for unbanked, uninterleaved flash | 42 | unsigned long offset; // linerized start. base==offset for unbanked, uninterleaved flash |
43 | 43 | ||
44 | __u32 capabilities; | 44 | __u32 capabilities; |
45 | 45 | ||
46 | // These markers are filled in by the flash_chip_scan function | 46 | // These markers are filled in by the flash_chip_scan function |
47 | unsigned long start; | 47 | unsigned long start; |
48 | unsigned long length; | 48 | unsigned long length; |
@@ -51,16 +51,16 @@ struct jedec_flash_chip | |||
51 | struct jedec_private | 51 | struct jedec_private |
52 | { | 52 | { |
53 | unsigned long size; // Total size of all the devices | 53 | unsigned long size; // Total size of all the devices |
54 | 54 | ||
55 | /* Bank handling. If sum(bank_fill) == size then this is linear flash. | 55 | /* Bank handling. If sum(bank_fill) == size then this is linear flash. |
56 | Otherwise the mapping has holes in it. bank_fill may be used to | 56 | Otherwise the mapping has holes in it. bank_fill may be used to |
57 | find the holes, but in the common symetric case | 57 | find the holes, but in the common symetric case |
58 | bank_fill[0] == bank_fill[*], thus addresses may be computed | 58 | bank_fill[0] == bank_fill[*], thus addresses may be computed |
59 | mathmatically. bank_fill must be powers of two */ | 59 | mathmatically. bank_fill must be powers of two */ |
60 | unsigned is_banked; | 60 | unsigned is_banked; |
61 | unsigned long bank_fill[MAX_JEDEC_CHIPS]; | 61 | unsigned long bank_fill[MAX_JEDEC_CHIPS]; |
62 | 62 | ||
63 | struct jedec_flash_chip chips[MAX_JEDEC_CHIPS]; | 63 | struct jedec_flash_chip chips[MAX_JEDEC_CHIPS]; |
64 | }; | 64 | }; |
65 | 65 | ||
66 | #endif | 66 | #endif |
diff --git a/include/linux/mtd/map.h b/include/linux/mtd/map.h index fc28841f3409..fedfbc8a287f 100644 --- a/include/linux/mtd/map.h +++ b/include/linux/mtd/map.h | |||
@@ -1,6 +1,6 @@ | |||
1 | 1 | ||
2 | /* Overhauled routines for dealing with different mmap regions of flash */ | 2 | /* Overhauled routines for dealing with different mmap regions of flash */ |
3 | /* $Id: map.h,v 1.52 2005/05/25 10:29:41 gleixner Exp $ */ | 3 | /* $Id: map.h,v 1.54 2005/11/07 11:14:54 gleixner Exp $ */ |
4 | 4 | ||
5 | #ifndef __LINUX_MTD_MAP_H__ | 5 | #ifndef __LINUX_MTD_MAP_H__ |
6 | #define __LINUX_MTD_MAP_H__ | 6 | #define __LINUX_MTD_MAP_H__ |
@@ -170,14 +170,14 @@ typedef union { | |||
170 | to a chip probe routine -- either JEDEC or CFI probe or both -- via | 170 | to a chip probe routine -- either JEDEC or CFI probe or both -- via |
171 | do_map_probe(). If a chip is recognised, the probe code will invoke the | 171 | do_map_probe(). If a chip is recognised, the probe code will invoke the |
172 | appropriate chip driver (if present) and return a struct mtd_info. | 172 | appropriate chip driver (if present) and return a struct mtd_info. |
173 | At which point, you fill in the mtd->module with your own module | 173 | At which point, you fill in the mtd->module with your own module |
174 | address, and register it with the MTD core code. Or you could partition | 174 | address, and register it with the MTD core code. Or you could partition |
175 | it and register the partitions instead, or keep it for your own private | 175 | it and register the partitions instead, or keep it for your own private |
176 | use; whatever. | 176 | use; whatever. |
177 | 177 | ||
178 | The mtd->priv field will point to the struct map_info, and any further | 178 | The mtd->priv field will point to the struct map_info, and any further |
179 | private data required by the chip driver is linked from the | 179 | private data required by the chip driver is linked from the |
180 | mtd->priv->fldrv_priv field. This allows the map driver to get at | 180 | mtd->priv->fldrv_priv field. This allows the map driver to get at |
181 | the destructor function map->fldrv_destroy() when it's tired | 181 | the destructor function map->fldrv_destroy() when it's tired |
182 | of living. | 182 | of living. |
183 | */ | 183 | */ |
@@ -214,7 +214,7 @@ struct map_info { | |||
214 | If there is no cache to care about this can be set to NULL. */ | 214 | If there is no cache to care about this can be set to NULL. */ |
215 | void (*inval_cache)(struct map_info *, unsigned long, ssize_t); | 215 | void (*inval_cache)(struct map_info *, unsigned long, ssize_t); |
216 | 216 | ||
217 | /* set_vpp() must handle being reentered -- enable, enable, disable | 217 | /* set_vpp() must handle being reentered -- enable, enable, disable |
218 | must leave it enabled. */ | 218 | must leave it enabled. */ |
219 | void (*set_vpp)(struct map_info *, int); | 219 | void (*set_vpp)(struct map_info *, int); |
220 | 220 | ||
@@ -353,7 +353,7 @@ static inline map_word map_word_ff(struct map_info *map) | |||
353 | { | 353 | { |
354 | map_word r; | 354 | map_word r; |
355 | int i; | 355 | int i; |
356 | 356 | ||
357 | if (map_bankwidth(map) < MAP_FF_LIMIT) { | 357 | if (map_bankwidth(map) < MAP_FF_LIMIT) { |
358 | int bw = 8 * map_bankwidth(map); | 358 | int bw = 8 * map_bankwidth(map); |
359 | r.x[0] = (1 << bw) - 1; | 359 | r.x[0] = (1 << bw) - 1; |
diff --git a/include/linux/mtd/mtd.h b/include/linux/mtd/mtd.h index c50c3f3927d9..e95d0463a3e5 100644 --- a/include/linux/mtd/mtd.h +++ b/include/linux/mtd/mtd.h | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * $Id: mtd.h,v 1.59 2005/04/11 10:19:02 gleixner Exp $ | 2 | * $Id: mtd.h,v 1.61 2005/11/07 11:14:54 gleixner Exp $ |
3 | * | 3 | * |
4 | * Copyright (C) 1999-2003 David Woodhouse <dwmw2@infradead.org> et al. | 4 | * Copyright (C) 1999-2003 David Woodhouse <dwmw2@infradead.org> et al. |
5 | * | 5 | * |
@@ -72,7 +72,17 @@ struct mtd_info { | |||
72 | u_int32_t oobsize; // Amount of OOB data per block (e.g. 16) | 72 | u_int32_t oobsize; // Amount of OOB data per block (e.g. 16) |
73 | u_int32_t ecctype; | 73 | u_int32_t ecctype; |
74 | u_int32_t eccsize; | 74 | u_int32_t eccsize; |
75 | 75 | ||
76 | /* | ||
77 | * Reuse some of the above unused fields in the case of NOR flash | ||
78 | * with configurable programming regions to avoid modifying the | ||
79 | * user visible structure layout/size. Only valid when the | ||
80 | * MTD_PROGRAM_REGIONS flag is set. | ||
81 | * (Maybe we should have an union for those?) | ||
82 | */ | ||
83 | #define MTD_PROGREGION_SIZE(mtd) (mtd)->oobblock | ||
84 | #define MTD_PROGREGION_CTRLMODE_VALID(mtd) (mtd)->oobsize | ||
85 | #define MTD_PROGREGION_CTRLMODE_INVALID(mtd) (mtd)->ecctype | ||
76 | 86 | ||
77 | // Kernel-only stuff starts here. | 87 | // Kernel-only stuff starts here. |
78 | char *name; | 88 | char *name; |
@@ -80,13 +90,13 @@ struct mtd_info { | |||
80 | 90 | ||
81 | // oobinfo is a nand_oobinfo structure, which can be set by iotcl (MEMSETOOBINFO) | 91 | // oobinfo is a nand_oobinfo structure, which can be set by iotcl (MEMSETOOBINFO) |
82 | struct nand_oobinfo oobinfo; | 92 | struct nand_oobinfo oobinfo; |
83 | u_int32_t oobavail; // Number of bytes in OOB area available for fs | 93 | u_int32_t oobavail; // Number of bytes in OOB area available for fs |
84 | 94 | ||
85 | /* Data for variable erase regions. If numeraseregions is zero, | 95 | /* Data for variable erase regions. If numeraseregions is zero, |
86 | * it means that the whole device has erasesize as given above. | 96 | * it means that the whole device has erasesize as given above. |
87 | */ | 97 | */ |
88 | int numeraseregions; | 98 | int numeraseregions; |
89 | struct mtd_erase_region_info *eraseregions; | 99 | struct mtd_erase_region_info *eraseregions; |
90 | 100 | ||
91 | /* This really shouldn't be here. It can go away in 2.5 */ | 101 | /* This really shouldn't be here. It can go away in 2.5 */ |
92 | u_int32_t bank_size; | 102 | u_int32_t bank_size; |
@@ -109,10 +119,10 @@ struct mtd_info { | |||
109 | int (*read_oob) (struct mtd_info *mtd, loff_t from, size_t len, size_t *retlen, u_char *buf); | 119 | int (*read_oob) (struct mtd_info *mtd, loff_t from, size_t len, size_t *retlen, u_char *buf); |
110 | int (*write_oob) (struct mtd_info *mtd, loff_t to, size_t len, size_t *retlen, const u_char *buf); | 120 | int (*write_oob) (struct mtd_info *mtd, loff_t to, size_t len, size_t *retlen, const u_char *buf); |
111 | 121 | ||
112 | /* | 122 | /* |
113 | * Methods to access the protection register area, present in some | 123 | * Methods to access the protection register area, present in some |
114 | * flash devices. The user data is one time programmable but the | 124 | * flash devices. The user data is one time programmable but the |
115 | * factory data is read only. | 125 | * factory data is read only. |
116 | */ | 126 | */ |
117 | int (*get_fact_prot_info) (struct mtd_info *mtd, struct otp_info *buf, size_t len); | 127 | int (*get_fact_prot_info) (struct mtd_info *mtd, struct otp_info *buf, size_t len); |
118 | int (*read_fact_prot_reg) (struct mtd_info *mtd, loff_t from, size_t len, size_t *retlen, u_char *buf); | 128 | int (*read_fact_prot_reg) (struct mtd_info *mtd, loff_t from, size_t len, size_t *retlen, u_char *buf); |
@@ -123,14 +133,14 @@ struct mtd_info { | |||
123 | 133 | ||
124 | /* kvec-based read/write methods. We need these especially for NAND flash, | 134 | /* kvec-based read/write methods. We need these especially for NAND flash, |
125 | with its limited number of write cycles per erase. | 135 | with its limited number of write cycles per erase. |
126 | NB: The 'count' parameter is the number of _vectors_, each of | 136 | NB: The 'count' parameter is the number of _vectors_, each of |
127 | which contains an (ofs, len) tuple. | 137 | which contains an (ofs, len) tuple. |
128 | */ | 138 | */ |
129 | int (*readv) (struct mtd_info *mtd, struct kvec *vecs, unsigned long count, loff_t from, size_t *retlen); | 139 | int (*readv) (struct mtd_info *mtd, struct kvec *vecs, unsigned long count, loff_t from, size_t *retlen); |
130 | int (*readv_ecc) (struct mtd_info *mtd, struct kvec *vecs, unsigned long count, loff_t from, | 140 | int (*readv_ecc) (struct mtd_info *mtd, struct kvec *vecs, unsigned long count, loff_t from, |
131 | size_t *retlen, u_char *eccbuf, struct nand_oobinfo *oobsel); | 141 | size_t *retlen, u_char *eccbuf, struct nand_oobinfo *oobsel); |
132 | int (*writev) (struct mtd_info *mtd, const struct kvec *vecs, unsigned long count, loff_t to, size_t *retlen); | 142 | int (*writev) (struct mtd_info *mtd, const struct kvec *vecs, unsigned long count, loff_t to, size_t *retlen); |
133 | int (*writev_ecc) (struct mtd_info *mtd, const struct kvec *vecs, unsigned long count, loff_t to, | 143 | int (*writev_ecc) (struct mtd_info *mtd, const struct kvec *vecs, unsigned long count, loff_t to, |
134 | size_t *retlen, u_char *eccbuf, struct nand_oobinfo *oobsel); | 144 | size_t *retlen, u_char *eccbuf, struct nand_oobinfo *oobsel); |
135 | 145 | ||
136 | /* Sync */ | 146 | /* Sync */ |
@@ -194,7 +204,7 @@ int default_mtd_readv(struct mtd_info *mtd, struct kvec *vecs, | |||
194 | #define MTD_WRITEECC(mtd, args...) (*(mtd->write_ecc))(mtd, args) | 204 | #define MTD_WRITEECC(mtd, args...) (*(mtd->write_ecc))(mtd, args) |
195 | #define MTD_READOOB(mtd, args...) (*(mtd->read_oob))(mtd, args) | 205 | #define MTD_READOOB(mtd, args...) (*(mtd->read_oob))(mtd, args) |
196 | #define MTD_WRITEOOB(mtd, args...) (*(mtd->write_oob))(mtd, args) | 206 | #define MTD_WRITEOOB(mtd, args...) (*(mtd->write_oob))(mtd, args) |
197 | #define MTD_SYNC(mtd) do { if (mtd->sync) (*(mtd->sync))(mtd); } while (0) | 207 | #define MTD_SYNC(mtd) do { if (mtd->sync) (*(mtd->sync))(mtd); } while (0) |
198 | 208 | ||
199 | 209 | ||
200 | #ifdef CONFIG_MTD_PARTITIONS | 210 | #ifdef CONFIG_MTD_PARTITIONS |
diff --git a/include/linux/mtd/nand.h b/include/linux/mtd/nand.h index 9b5b76217584..da5e67b3fc70 100644 --- a/include/linux/mtd/nand.h +++ b/include/linux/mtd/nand.h | |||
@@ -5,7 +5,7 @@ | |||
5 | * Steven J. Hill <sjhill@realitydiluted.com> | 5 | * Steven J. Hill <sjhill@realitydiluted.com> |
6 | * Thomas Gleixner <tglx@linutronix.de> | 6 | * Thomas Gleixner <tglx@linutronix.de> |
7 | * | 7 | * |
8 | * $Id: nand.h,v 1.73 2005/05/31 19:39:17 gleixner Exp $ | 8 | * $Id: nand.h,v 1.74 2005/09/15 13:58:50 vwool Exp $ |
9 | * | 9 | * |
10 | * This program is free software; you can redistribute it and/or modify | 10 | * This program is free software; you can redistribute it and/or modify |
11 | * it under the terms of the GNU General Public License version 2 as | 11 | * it under the terms of the GNU General Public License version 2 as |
@@ -24,7 +24,7 @@ | |||
24 | * bat later if I did something naughty. | 24 | * bat later if I did something naughty. |
25 | * 10-11-2000 SJH Added private NAND flash structure for driver | 25 | * 10-11-2000 SJH Added private NAND flash structure for driver |
26 | * 10-24-2000 SJH Added prototype for 'nand_scan' function | 26 | * 10-24-2000 SJH Added prototype for 'nand_scan' function |
27 | * 10-29-2001 TG changed nand_chip structure to support | 27 | * 10-29-2001 TG changed nand_chip structure to support |
28 | * hardwarespecific function for accessing control lines | 28 | * hardwarespecific function for accessing control lines |
29 | * 02-21-2002 TG added support for different read/write adress and | 29 | * 02-21-2002 TG added support for different read/write adress and |
30 | * ready/busy line access function | 30 | * ready/busy line access function |
@@ -36,21 +36,21 @@ | |||
36 | * CONFIG_MTD_NAND_ECC_JFFS2 is not set | 36 | * CONFIG_MTD_NAND_ECC_JFFS2 is not set |
37 | * 08-10-2002 TG extensions to nand_chip structure to support HW-ECC | 37 | * 08-10-2002 TG extensions to nand_chip structure to support HW-ECC |
38 | * | 38 | * |
39 | * 08-29-2002 tglx nand_chip structure: data_poi for selecting | 39 | * 08-29-2002 tglx nand_chip structure: data_poi for selecting |
40 | * internal / fs-driver buffer | 40 | * internal / fs-driver buffer |
41 | * support for 6byte/512byte hardware ECC | 41 | * support for 6byte/512byte hardware ECC |
42 | * read_ecc, write_ecc extended for different oob-layout | 42 | * read_ecc, write_ecc extended for different oob-layout |
43 | * oob layout selections: NAND_NONE_OOB, NAND_JFFS2_OOB, | 43 | * oob layout selections: NAND_NONE_OOB, NAND_JFFS2_OOB, |
44 | * NAND_YAFFS_OOB | 44 | * NAND_YAFFS_OOB |
45 | * 11-25-2002 tglx Added Manufacturer code FUJITSU, NATIONAL | 45 | * 11-25-2002 tglx Added Manufacturer code FUJITSU, NATIONAL |
46 | * Split manufacturer and device ID structures | 46 | * Split manufacturer and device ID structures |
47 | * | 47 | * |
48 | * 02-08-2004 tglx added option field to nand structure for chip anomalities | 48 | * 02-08-2004 tglx added option field to nand structure for chip anomalities |
49 | * 05-25-2004 tglx added bad block table support, ST-MICRO manufacturer id | 49 | * 05-25-2004 tglx added bad block table support, ST-MICRO manufacturer id |
50 | * update of nand_chip structure description | 50 | * update of nand_chip structure description |
51 | * 01-17-2005 dmarlin added extended commands for AG-AND device and added option | 51 | * 01-17-2005 dmarlin added extended commands for AG-AND device and added option |
52 | * for BBT_AUTO_REFRESH. | 52 | * for BBT_AUTO_REFRESH. |
53 | * 01-20-2005 dmarlin added optional pointer to hardware specific callback for | 53 | * 01-20-2005 dmarlin added optional pointer to hardware specific callback for |
54 | * extra error status checks. | 54 | * extra error status checks. |
55 | */ | 55 | */ |
56 | #ifndef __LINUX_MTD_NAND_H | 56 | #ifndef __LINUX_MTD_NAND_H |
@@ -120,8 +120,8 @@ extern int nand_read_raw (struct mtd_info *mtd, uint8_t *buf, loff_t from, size_ | |||
120 | #define NAND_CMD_CACHEDPROG 0x15 | 120 | #define NAND_CMD_CACHEDPROG 0x15 |
121 | 121 | ||
122 | /* Extended commands for AG-AND device */ | 122 | /* Extended commands for AG-AND device */ |
123 | /* | 123 | /* |
124 | * Note: the command for NAND_CMD_DEPLETE1 is really 0x00 but | 124 | * Note: the command for NAND_CMD_DEPLETE1 is really 0x00 but |
125 | * there is no way to distinguish that from NAND_CMD_READ0 | 125 | * there is no way to distinguish that from NAND_CMD_READ0 |
126 | * until the remaining sequence of commands has been completed | 126 | * until the remaining sequence of commands has been completed |
127 | * so add a high order bit and mask it off in the command. | 127 | * so add a high order bit and mask it off in the command. |
@@ -145,7 +145,7 @@ extern int nand_read_raw (struct mtd_info *mtd, uint8_t *buf, loff_t from, size_ | |||
145 | #define NAND_STATUS_READY 0x40 | 145 | #define NAND_STATUS_READY 0x40 |
146 | #define NAND_STATUS_WP 0x80 | 146 | #define NAND_STATUS_WP 0x80 |
147 | 147 | ||
148 | /* | 148 | /* |
149 | * Constants for ECC_MODES | 149 | * Constants for ECC_MODES |
150 | */ | 150 | */ |
151 | 151 | ||
@@ -191,12 +191,12 @@ extern int nand_read_raw (struct mtd_info *mtd, uint8_t *buf, loff_t from, size_ | |||
191 | #define NAND_CACHEPRG 0x00000008 | 191 | #define NAND_CACHEPRG 0x00000008 |
192 | /* Chip has copy back function */ | 192 | /* Chip has copy back function */ |
193 | #define NAND_COPYBACK 0x00000010 | 193 | #define NAND_COPYBACK 0x00000010 |
194 | /* AND Chip which has 4 banks and a confusing page / block | 194 | /* AND Chip which has 4 banks and a confusing page / block |
195 | * assignment. See Renesas datasheet for further information */ | 195 | * assignment. See Renesas datasheet for further information */ |
196 | #define NAND_IS_AND 0x00000020 | 196 | #define NAND_IS_AND 0x00000020 |
197 | /* Chip has a array of 4 pages which can be read without | 197 | /* Chip has a array of 4 pages which can be read without |
198 | * additional ready /busy waits */ | 198 | * additional ready /busy waits */ |
199 | #define NAND_4PAGE_ARRAY 0x00000040 | 199 | #define NAND_4PAGE_ARRAY 0x00000040 |
200 | /* Chip requires that BBT is periodically rewritten to prevent | 200 | /* Chip requires that BBT is periodically rewritten to prevent |
201 | * bits from adjacent blocks from 'leaking' in altering data. | 201 | * bits from adjacent blocks from 'leaking' in altering data. |
202 | * This happens with the Renesas AG-AND chips, possibly others. */ | 202 | * This happens with the Renesas AG-AND chips, possibly others. */ |
@@ -219,8 +219,8 @@ extern int nand_read_raw (struct mtd_info *mtd, uint8_t *buf, loff_t from, size_ | |||
219 | /* Use a flash based bad block table. This option is passed to the | 219 | /* Use a flash based bad block table. This option is passed to the |
220 | * default bad block table function. */ | 220 | * default bad block table function. */ |
221 | #define NAND_USE_FLASH_BBT 0x00010000 | 221 | #define NAND_USE_FLASH_BBT 0x00010000 |
222 | /* The hw ecc generator provides a syndrome instead a ecc value on read | 222 | /* The hw ecc generator provides a syndrome instead a ecc value on read |
223 | * This can only work if we have the ecc bytes directly behind the | 223 | * This can only work if we have the ecc bytes directly behind the |
224 | * data bytes. Applies for DOC and AG-AND Renesas HW Reed Solomon generators */ | 224 | * data bytes. Applies for DOC and AG-AND Renesas HW Reed Solomon generators */ |
225 | #define NAND_HWECC_SYNDROME 0x00020000 | 225 | #define NAND_HWECC_SYNDROME 0x00020000 |
226 | /* This option skips the bbt scan during initialization. */ | 226 | /* This option skips the bbt scan during initialization. */ |
@@ -244,6 +244,7 @@ typedef enum { | |||
244 | FL_ERASING, | 244 | FL_ERASING, |
245 | FL_SYNCING, | 245 | FL_SYNCING, |
246 | FL_CACHEDPRG, | 246 | FL_CACHEDPRG, |
247 | FL_PM_SUSPENDED, | ||
247 | } nand_state_t; | 248 | } nand_state_t; |
248 | 249 | ||
249 | /* Keep gcc happy */ | 250 | /* Keep gcc happy */ |
@@ -251,7 +252,7 @@ struct nand_chip; | |||
251 | 252 | ||
252 | /** | 253 | /** |
253 | * struct nand_hw_control - Control structure for hardware controller (e.g ECC generator) shared among independend devices | 254 | * struct nand_hw_control - Control structure for hardware controller (e.g ECC generator) shared among independend devices |
254 | * @lock: protection lock | 255 | * @lock: protection lock |
255 | * @active: the mtd device which holds the controller currently | 256 | * @active: the mtd device which holds the controller currently |
256 | * @wq: wait queue to sleep on if a NAND operation is in progress | 257 | * @wq: wait queue to sleep on if a NAND operation is in progress |
257 | * used instead of the per chip wait queue when a hw controller is available | 258 | * used instead of the per chip wait queue when a hw controller is available |
@@ -264,8 +265,8 @@ struct nand_hw_control { | |||
264 | 265 | ||
265 | /** | 266 | /** |
266 | * struct nand_chip - NAND Private Flash Chip Data | 267 | * struct nand_chip - NAND Private Flash Chip Data |
267 | * @IO_ADDR_R: [BOARDSPECIFIC] address to read the 8 I/O lines of the flash device | 268 | * @IO_ADDR_R: [BOARDSPECIFIC] address to read the 8 I/O lines of the flash device |
268 | * @IO_ADDR_W: [BOARDSPECIFIC] address to write the 8 I/O lines of the flash device | 269 | * @IO_ADDR_W: [BOARDSPECIFIC] address to write the 8 I/O lines of the flash device |
269 | * @read_byte: [REPLACEABLE] read one byte from the chip | 270 | * @read_byte: [REPLACEABLE] read one byte from the chip |
270 | * @write_byte: [REPLACEABLE] write one byte to the chip | 271 | * @write_byte: [REPLACEABLE] write one byte to the chip |
271 | * @read_word: [REPLACEABLE] read one word from the chip | 272 | * @read_word: [REPLACEABLE] read one word from the chip |
@@ -288,7 +289,7 @@ struct nand_hw_control { | |||
288 | * be provided if a hardware ECC is available | 289 | * be provided if a hardware ECC is available |
289 | * @erase_cmd: [INTERN] erase command write function, selectable due to AND support | 290 | * @erase_cmd: [INTERN] erase command write function, selectable due to AND support |
290 | * @scan_bbt: [REPLACEABLE] function to scan bad block table | 291 | * @scan_bbt: [REPLACEABLE] function to scan bad block table |
291 | * @eccmode: [BOARDSPECIFIC] mode of ecc, see defines | 292 | * @eccmode: [BOARDSPECIFIC] mode of ecc, see defines |
292 | * @eccsize: [INTERN] databytes used per ecc-calculation | 293 | * @eccsize: [INTERN] databytes used per ecc-calculation |
293 | * @eccbytes: [INTERN] number of ecc bytes per ecc-calculation step | 294 | * @eccbytes: [INTERN] number of ecc bytes per ecc-calculation step |
294 | * @eccsteps: [INTERN] number of ecc calculation steps per page | 295 | * @eccsteps: [INTERN] number of ecc calculation steps per page |
@@ -300,7 +301,7 @@ struct nand_hw_control { | |||
300 | * @phys_erase_shift: [INTERN] number of address bits in a physical eraseblock | 301 | * @phys_erase_shift: [INTERN] number of address bits in a physical eraseblock |
301 | * @bbt_erase_shift: [INTERN] number of address bits in a bbt entry | 302 | * @bbt_erase_shift: [INTERN] number of address bits in a bbt entry |
302 | * @chip_shift: [INTERN] number of address bits in one chip | 303 | * @chip_shift: [INTERN] number of address bits in one chip |
303 | * @data_buf: [INTERN] internal buffer for one page + oob | 304 | * @data_buf: [INTERN] internal buffer for one page + oob |
304 | * @oob_buf: [INTERN] oob buffer for one eraseblock | 305 | * @oob_buf: [INTERN] oob buffer for one eraseblock |
305 | * @oobdirty: [INTERN] indicates that oob_buf must be reinitialized | 306 | * @oobdirty: [INTERN] indicates that oob_buf must be reinitialized |
306 | * @data_poi: [INTERN] pointer to a data buffer | 307 | * @data_poi: [INTERN] pointer to a data buffer |
@@ -315,22 +316,22 @@ struct nand_hw_control { | |||
315 | * @bbt: [INTERN] bad block table pointer | 316 | * @bbt: [INTERN] bad block table pointer |
316 | * @bbt_td: [REPLACEABLE] bad block table descriptor for flash lookup | 317 | * @bbt_td: [REPLACEABLE] bad block table descriptor for flash lookup |
317 | * @bbt_md: [REPLACEABLE] bad block table mirror descriptor | 318 | * @bbt_md: [REPLACEABLE] bad block table mirror descriptor |
318 | * @badblock_pattern: [REPLACEABLE] bad block scan pattern used for initial bad block scan | 319 | * @badblock_pattern: [REPLACEABLE] bad block scan pattern used for initial bad block scan |
319 | * @controller: [OPTIONAL] a pointer to a hardware controller structure which is shared among multiple independend devices | 320 | * @controller: [OPTIONAL] a pointer to a hardware controller structure which is shared among multiple independend devices |
320 | * @priv: [OPTIONAL] pointer to private chip date | 321 | * @priv: [OPTIONAL] pointer to private chip date |
321 | * @errstat: [OPTIONAL] hardware specific function to perform additional error status checks | 322 | * @errstat: [OPTIONAL] hardware specific function to perform additional error status checks |
322 | * (determine if errors are correctable) | 323 | * (determine if errors are correctable) |
323 | */ | 324 | */ |
324 | 325 | ||
325 | struct nand_chip { | 326 | struct nand_chip { |
326 | void __iomem *IO_ADDR_R; | 327 | void __iomem *IO_ADDR_R; |
327 | void __iomem *IO_ADDR_W; | 328 | void __iomem *IO_ADDR_W; |
328 | 329 | ||
329 | u_char (*read_byte)(struct mtd_info *mtd); | 330 | u_char (*read_byte)(struct mtd_info *mtd); |
330 | void (*write_byte)(struct mtd_info *mtd, u_char byte); | 331 | void (*write_byte)(struct mtd_info *mtd, u_char byte); |
331 | u16 (*read_word)(struct mtd_info *mtd); | 332 | u16 (*read_word)(struct mtd_info *mtd); |
332 | void (*write_word)(struct mtd_info *mtd, u16 word); | 333 | void (*write_word)(struct mtd_info *mtd, u16 word); |
333 | 334 | ||
334 | void (*write_buf)(struct mtd_info *mtd, const u_char *buf, int len); | 335 | void (*write_buf)(struct mtd_info *mtd, const u_char *buf, int len); |
335 | void (*read_buf)(struct mtd_info *mtd, u_char *buf, int len); | 336 | void (*read_buf)(struct mtd_info *mtd, u_char *buf, int len); |
336 | int (*verify_buf)(struct mtd_info *mtd, const u_char *buf, int len); | 337 | int (*verify_buf)(struct mtd_info *mtd, const u_char *buf, int len); |
@@ -395,7 +396,7 @@ struct nand_chip { | |||
395 | * @name: Identify the device type | 396 | * @name: Identify the device type |
396 | * @id: device ID code | 397 | * @id: device ID code |
397 | * @pagesize: Pagesize in bytes. Either 256 or 512 or 0 | 398 | * @pagesize: Pagesize in bytes. Either 256 or 512 or 0 |
398 | * If the pagesize is 0, then the real pagesize | 399 | * If the pagesize is 0, then the real pagesize |
399 | * and the eraseize are determined from the | 400 | * and the eraseize are determined from the |
400 | * extended id bytes in the chip | 401 | * extended id bytes in the chip |
401 | * @erasesize: Size of an erase block in the flash device. | 402 | * @erasesize: Size of an erase block in the flash device. |
@@ -424,7 +425,7 @@ struct nand_manufacturers { | |||
424 | extern struct nand_flash_dev nand_flash_ids[]; | 425 | extern struct nand_flash_dev nand_flash_ids[]; |
425 | extern struct nand_manufacturers nand_manuf_ids[]; | 426 | extern struct nand_manufacturers nand_manuf_ids[]; |
426 | 427 | ||
427 | /** | 428 | /** |
428 | * struct nand_bbt_descr - bad block table descriptor | 429 | * struct nand_bbt_descr - bad block table descriptor |
429 | * @options: options for this descriptor | 430 | * @options: options for this descriptor |
430 | * @pages: the page(s) where we find the bbt, used with option BBT_ABSPAGE | 431 | * @pages: the page(s) where we find the bbt, used with option BBT_ABSPAGE |
@@ -435,14 +436,14 @@ extern struct nand_manufacturers nand_manuf_ids[]; | |||
435 | * @version: version read from the bbt page during scan | 436 | * @version: version read from the bbt page during scan |
436 | * @len: length of the pattern, if 0 no pattern check is performed | 437 | * @len: length of the pattern, if 0 no pattern check is performed |
437 | * @maxblocks: maximum number of blocks to search for a bbt. This number of | 438 | * @maxblocks: maximum number of blocks to search for a bbt. This number of |
438 | * blocks is reserved at the end of the device where the tables are | 439 | * blocks is reserved at the end of the device where the tables are |
439 | * written. | 440 | * written. |
440 | * @reserved_block_code: if non-0, this pattern denotes a reserved (rather than | 441 | * @reserved_block_code: if non-0, this pattern denotes a reserved (rather than |
441 | * bad) block in the stored bbt | 442 | * bad) block in the stored bbt |
442 | * @pattern: pattern to identify bad block table or factory marked good / | 443 | * @pattern: pattern to identify bad block table or factory marked good / |
443 | * bad blocks, can be NULL, if len = 0 | 444 | * bad blocks, can be NULL, if len = 0 |
444 | * | 445 | * |
445 | * Descriptor for the bad block table marker and the descriptor for the | 446 | * Descriptor for the bad block table marker and the descriptor for the |
446 | * pattern which identifies good and bad blocks. The assumption is made | 447 | * pattern which identifies good and bad blocks. The assumption is made |
447 | * that the pattern and the version count are always located in the oob area | 448 | * that the pattern and the version count are always located in the oob area |
448 | * of the first block. | 449 | * of the first block. |
diff --git a/include/linux/mtd/onenand.h b/include/linux/mtd/onenand.h new file mode 100644 index 000000000000..f1fd4215686a --- /dev/null +++ b/include/linux/mtd/onenand.h | |||
@@ -0,0 +1,155 @@ | |||
1 | /* | ||
2 | * linux/include/linux/mtd/onenand.h | ||
3 | * | ||
4 | * Copyright (C) 2005 Samsung Electronics | ||
5 | * Kyungmin Park <kyungmin.park@samsung.com> | ||
6 | * | ||
7 | * This program is free software; you can redistribute it and/or modify | ||
8 | * it under the terms of the GNU General Public License version 2 as | ||
9 | * published by the Free Software Foundation. | ||
10 | */ | ||
11 | |||
12 | #ifndef __LINUX_MTD_ONENAND_H | ||
13 | #define __LINUX_MTD_ONENAND_H | ||
14 | |||
15 | #include <linux/spinlock.h> | ||
16 | #include <linux/mtd/onenand_regs.h> | ||
17 | #include <linux/mtd/bbm.h> | ||
18 | |||
19 | #define MAX_BUFFERRAM 2 | ||
20 | #define MAX_ONENAND_PAGESIZE (2048 + 64) | ||
21 | |||
22 | /* Scan and identify a OneNAND device */ | ||
23 | extern int onenand_scan(struct mtd_info *mtd, int max_chips); | ||
24 | /* Free resources held by the OneNAND device */ | ||
25 | extern void onenand_release(struct mtd_info *mtd); | ||
26 | |||
27 | /** | ||
28 | * onenand_state_t - chip states | ||
29 | * Enumeration for OneNAND flash chip state | ||
30 | */ | ||
31 | typedef enum { | ||
32 | FL_READY, | ||
33 | FL_READING, | ||
34 | FL_WRITING, | ||
35 | FL_ERASING, | ||
36 | FL_SYNCING, | ||
37 | FL_UNLOCKING, | ||
38 | FL_LOCKING, | ||
39 | FL_PM_SUSPENDED, | ||
40 | } onenand_state_t; | ||
41 | |||
42 | /** | ||
43 | * struct onenand_bufferram - OneNAND BufferRAM Data | ||
44 | * @param block block address in BufferRAM | ||
45 | * @param page page address in BufferRAM | ||
46 | * @param valid valid flag | ||
47 | */ | ||
48 | struct onenand_bufferram { | ||
49 | int block; | ||
50 | int page; | ||
51 | int valid; | ||
52 | }; | ||
53 | |||
54 | /** | ||
55 | * struct onenand_chip - OneNAND Private Flash Chip Data | ||
56 | * @param base [BOARDSPECIFIC] address to access OneNAND | ||
57 | * @param chipsize [INTERN] the size of one chip for multichip arrays | ||
58 | * @param device_id [INTERN] device ID | ||
59 | * @param verstion_id [INTERN] version ID | ||
60 | * @param options [BOARDSPECIFIC] various chip options. They can partly be set to inform onenand_scan about | ||
61 | * @param erase_shift [INTERN] number of address bits in a block | ||
62 | * @param page_shift [INTERN] number of address bits in a page | ||
63 | * @param ppb_shift [INTERN] number of address bits in a pages per block | ||
64 | * @param page_mask [INTERN] a page per block mask | ||
65 | * @param bufferam_index [INTERN] BufferRAM index | ||
66 | * @param bufferam [INTERN] BufferRAM info | ||
67 | * @param readw [REPLACEABLE] hardware specific function for read short | ||
68 | * @param writew [REPLACEABLE] hardware specific function for write short | ||
69 | * @param command [REPLACEABLE] hardware specific function for writing commands to the chip | ||
70 | * @param wait [REPLACEABLE] hardware specific function for wait on ready | ||
71 | * @param read_bufferram [REPLACEABLE] hardware specific function for BufferRAM Area | ||
72 | * @param write_bufferram [REPLACEABLE] hardware specific function for BufferRAM Area | ||
73 | * @param read_word [REPLACEABLE] hardware specific function for read register of OneNAND | ||
74 | * @param write_word [REPLACEABLE] hardware specific function for write register of OneNAND | ||
75 | * @param scan_bbt [REPLACEALBE] hardware specific function for scaning Bad block Table | ||
76 | * @param chip_lock [INTERN] spinlock used to protect access to this structure and the chip | ||
77 | * @param wq [INTERN] wait queue to sleep on if a OneNAND operation is in progress | ||
78 | * @param state [INTERN] the current state of the OneNAND device | ||
79 | * @param autooob [REPLACEABLE] the default (auto)placement scheme | ||
80 | * @param bbm [REPLACEABLE] pointer to Bad Block Management | ||
81 | * @param priv [OPTIONAL] pointer to private chip date | ||
82 | */ | ||
83 | struct onenand_chip { | ||
84 | void __iomem *base; | ||
85 | unsigned int chipsize; | ||
86 | unsigned int device_id; | ||
87 | unsigned int density_mask; | ||
88 | unsigned int options; | ||
89 | |||
90 | unsigned int erase_shift; | ||
91 | unsigned int page_shift; | ||
92 | unsigned int ppb_shift; /* Pages per block shift */ | ||
93 | unsigned int page_mask; | ||
94 | |||
95 | unsigned int bufferram_index; | ||
96 | struct onenand_bufferram bufferram[MAX_BUFFERRAM]; | ||
97 | |||
98 | int (*command)(struct mtd_info *mtd, int cmd, loff_t address, size_t len); | ||
99 | int (*wait)(struct mtd_info *mtd, int state); | ||
100 | int (*read_bufferram)(struct mtd_info *mtd, int area, | ||
101 | unsigned char *buffer, int offset, size_t count); | ||
102 | int (*write_bufferram)(struct mtd_info *mtd, int area, | ||
103 | const unsigned char *buffer, int offset, size_t count); | ||
104 | unsigned short (*read_word)(void __iomem *addr); | ||
105 | void (*write_word)(unsigned short value, void __iomem *addr); | ||
106 | void (*mmcontrol)(struct mtd_info *mtd, int sync_read); | ||
107 | int (*block_markbad)(struct mtd_info *mtd, loff_t ofs); | ||
108 | int (*scan_bbt)(struct mtd_info *mtd); | ||
109 | |||
110 | spinlock_t chip_lock; | ||
111 | wait_queue_head_t wq; | ||
112 | onenand_state_t state; | ||
113 | |||
114 | struct nand_oobinfo *autooob; | ||
115 | |||
116 | void *bbm; | ||
117 | |||
118 | void *priv; | ||
119 | }; | ||
120 | |||
121 | /* | ||
122 | * Helper macros | ||
123 | */ | ||
124 | #define ONENAND_CURRENT_BUFFERRAM(this) (this->bufferram_index) | ||
125 | #define ONENAND_NEXT_BUFFERRAM(this) (this->bufferram_index ^ 1) | ||
126 | #define ONENAND_SET_NEXT_BUFFERRAM(this) (this->bufferram_index ^= 1) | ||
127 | |||
128 | #define ONENAND_GET_SYS_CFG1(this) \ | ||
129 | (this->read_word(this->base + ONENAND_REG_SYS_CFG1)) | ||
130 | #define ONENAND_SET_SYS_CFG1(v, this) \ | ||
131 | (this->write_word(v, this->base + ONENAND_REG_SYS_CFG1)) | ||
132 | |||
133 | /* | ||
134 | * Options bits | ||
135 | */ | ||
136 | #define ONENAND_CONT_LOCK (0x0001) | ||
137 | |||
138 | |||
139 | /* | ||
140 | * OneNAND Flash Manufacturer ID Codes | ||
141 | */ | ||
142 | #define ONENAND_MFR_SAMSUNG 0xec | ||
143 | #define ONENAND_MFR_UNKNOWN 0x00 | ||
144 | |||
145 | /** | ||
146 | * struct nand_manufacturers - NAND Flash Manufacturer ID Structure | ||
147 | * @param name: Manufacturer name | ||
148 | * @param id: manufacturer ID code of device. | ||
149 | */ | ||
150 | struct onenand_manufacturers { | ||
151 | int id; | ||
152 | char *name; | ||
153 | }; | ||
154 | |||
155 | #endif /* __LINUX_MTD_ONENAND_H */ | ||
diff --git a/include/linux/mtd/onenand_regs.h b/include/linux/mtd/onenand_regs.h new file mode 100644 index 000000000000..d7832ef8ed63 --- /dev/null +++ b/include/linux/mtd/onenand_regs.h | |||
@@ -0,0 +1,180 @@ | |||
1 | /* | ||
2 | * linux/include/linux/mtd/onenand_regs.h | ||
3 | * | ||
4 | * OneNAND Register header file | ||
5 | * | ||
6 | * Copyright (C) 2005 Samsung Electronics | ||
7 | * | ||
8 | * This program is free software; you can redistribute it and/or modify | ||
9 | * it under the terms of the GNU General Public License version 2 as | ||
10 | * published by the Free Software Foundation. | ||
11 | */ | ||
12 | |||
13 | #ifndef __ONENAND_REG_H | ||
14 | #define __ONENAND_REG_H | ||
15 | |||
16 | /* Memory Address Map Translation (Word order) */ | ||
17 | #define ONENAND_MEMORY_MAP(x) ((x) << 1) | ||
18 | |||
19 | /* | ||
20 | * External BufferRAM area | ||
21 | */ | ||
22 | #define ONENAND_BOOTRAM ONENAND_MEMORY_MAP(0x0000) | ||
23 | #define ONENAND_DATARAM ONENAND_MEMORY_MAP(0x0200) | ||
24 | #define ONENAND_SPARERAM ONENAND_MEMORY_MAP(0x8010) | ||
25 | |||
26 | /* | ||
27 | * OneNAND Registers | ||
28 | */ | ||
29 | #define ONENAND_REG_MANUFACTURER_ID ONENAND_MEMORY_MAP(0xF000) | ||
30 | #define ONENAND_REG_DEVICE_ID ONENAND_MEMORY_MAP(0xF001) | ||
31 | #define ONENAND_REG_VERSION_ID ONENAND_MEMORY_MAP(0xF002) | ||
32 | #define ONENAND_REG_DATA_BUFFER_SIZE ONENAND_MEMORY_MAP(0xF003) | ||
33 | #define ONENAND_REG_BOOT_BUFFER_SIZE ONENAND_MEMORY_MAP(0xF004) | ||
34 | #define ONENAND_REG_NUM_BUFFERS ONENAND_MEMORY_MAP(0xF005) | ||
35 | #define ONENAND_REG_TECHNOLOGY ONENAND_MEMORY_MAP(0xF006) | ||
36 | |||
37 | #define ONENAND_REG_START_ADDRESS1 ONENAND_MEMORY_MAP(0xF100) | ||
38 | #define ONENAND_REG_START_ADDRESS2 ONENAND_MEMORY_MAP(0xF101) | ||
39 | #define ONENAND_REG_START_ADDRESS3 ONENAND_MEMORY_MAP(0xF102) | ||
40 | #define ONENAND_REG_START_ADDRESS4 ONENAND_MEMORY_MAP(0xF103) | ||
41 | #define ONENAND_REG_START_ADDRESS5 ONENAND_MEMORY_MAP(0xF104) | ||
42 | #define ONENAND_REG_START_ADDRESS6 ONENAND_MEMORY_MAP(0xF105) | ||
43 | #define ONENAND_REG_START_ADDRESS7 ONENAND_MEMORY_MAP(0xF106) | ||
44 | #define ONENAND_REG_START_ADDRESS8 ONENAND_MEMORY_MAP(0xF107) | ||
45 | |||
46 | #define ONENAND_REG_START_BUFFER ONENAND_MEMORY_MAP(0xF200) | ||
47 | #define ONENAND_REG_COMMAND ONENAND_MEMORY_MAP(0xF220) | ||
48 | #define ONENAND_REG_SYS_CFG1 ONENAND_MEMORY_MAP(0xF221) | ||
49 | #define ONENAND_REG_SYS_CFG2 ONENAND_MEMORY_MAP(0xF222) | ||
50 | #define ONENAND_REG_CTRL_STATUS ONENAND_MEMORY_MAP(0xF240) | ||
51 | #define ONENAND_REG_INTERRUPT ONENAND_MEMORY_MAP(0xF241) | ||
52 | #define ONENAND_REG_START_BLOCK_ADDRESS ONENAND_MEMORY_MAP(0xF24C) | ||
53 | #define ONENAND_REG_END_BLOCK_ADDRESS ONENAND_MEMORY_MAP(0xF24D) | ||
54 | #define ONENAND_REG_WP_STATUS ONENAND_MEMORY_MAP(0xF24E) | ||
55 | |||
56 | #define ONENAND_REG_ECC_STATUS ONENAND_MEMORY_MAP(0xFF00) | ||
57 | #define ONENAND_REG_ECC_M0 ONENAND_MEMORY_MAP(0xFF01) | ||
58 | #define ONENAND_REG_ECC_S0 ONENAND_MEMORY_MAP(0xFF02) | ||
59 | #define ONENAND_REG_ECC_M1 ONENAND_MEMORY_MAP(0xFF03) | ||
60 | #define ONENAND_REG_ECC_S1 ONENAND_MEMORY_MAP(0xFF04) | ||
61 | #define ONENAND_REG_ECC_M2 ONENAND_MEMORY_MAP(0xFF05) | ||
62 | #define ONENAND_REG_ECC_S2 ONENAND_MEMORY_MAP(0xFF06) | ||
63 | #define ONENAND_REG_ECC_M3 ONENAND_MEMORY_MAP(0xFF07) | ||
64 | #define ONENAND_REG_ECC_S3 ONENAND_MEMORY_MAP(0xFF08) | ||
65 | |||
66 | /* | ||
67 | * Device ID Register F001h (R) | ||
68 | */ | ||
69 | #define ONENAND_DEVICE_DENSITY_SHIFT (4) | ||
70 | #define ONENAND_DEVICE_IS_DDP (1 << 3) | ||
71 | #define ONENAND_DEVICE_IS_DEMUX (1 << 2) | ||
72 | #define ONENAND_DEVICE_VCC_MASK (0x3) | ||
73 | |||
74 | #define ONENAND_DEVICE_DENSITY_512Mb (0x002) | ||
75 | |||
76 | /* | ||
77 | * Version ID Register F002h (R) | ||
78 | */ | ||
79 | #define ONENAND_VERSION_PROCESS_SHIFT (8) | ||
80 | |||
81 | /* | ||
82 | * Start Address 1 F100h (R/W) | ||
83 | */ | ||
84 | #define ONENAND_DDP_SHIFT (15) | ||
85 | |||
86 | /* | ||
87 | * Start Address 8 F107h (R/W) | ||
88 | */ | ||
89 | #define ONENAND_FPA_MASK (0x3f) | ||
90 | #define ONENAND_FPA_SHIFT (2) | ||
91 | #define ONENAND_FSA_MASK (0x03) | ||
92 | |||
93 | /* | ||
94 | * Start Buffer Register F200h (R/W) | ||
95 | */ | ||
96 | #define ONENAND_BSA_MASK (0x03) | ||
97 | #define ONENAND_BSA_SHIFT (8) | ||
98 | #define ONENAND_BSA_BOOTRAM (0 << 2) | ||
99 | #define ONENAND_BSA_DATARAM0 (2 << 2) | ||
100 | #define ONENAND_BSA_DATARAM1 (3 << 2) | ||
101 | #define ONENAND_BSC_MASK (0x03) | ||
102 | |||
103 | /* | ||
104 | * Command Register F220h (R/W) | ||
105 | */ | ||
106 | #define ONENAND_CMD_READ (0x00) | ||
107 | #define ONENAND_CMD_READOOB (0x13) | ||
108 | #define ONENAND_CMD_PROG (0x80) | ||
109 | #define ONENAND_CMD_PROGOOB (0x1A) | ||
110 | #define ONENAND_CMD_UNLOCK (0x23) | ||
111 | #define ONENAND_CMD_LOCK (0x2A) | ||
112 | #define ONENAND_CMD_LOCK_TIGHT (0x2C) | ||
113 | #define ONENAND_CMD_ERASE (0x94) | ||
114 | #define ONENAND_CMD_RESET (0xF0) | ||
115 | #define ONENAND_CMD_READID (0x90) | ||
116 | |||
117 | /* NOTE: Those are not *REAL* commands */ | ||
118 | #define ONENAND_CMD_BUFFERRAM (0x1978) | ||
119 | |||
120 | /* | ||
121 | * System Configuration 1 Register F221h (R, R/W) | ||
122 | */ | ||
123 | #define ONENAND_SYS_CFG1_SYNC_READ (1 << 15) | ||
124 | #define ONENAND_SYS_CFG1_BRL_7 (7 << 12) | ||
125 | #define ONENAND_SYS_CFG1_BRL_6 (6 << 12) | ||
126 | #define ONENAND_SYS_CFG1_BRL_5 (5 << 12) | ||
127 | #define ONENAND_SYS_CFG1_BRL_4 (4 << 12) | ||
128 | #define ONENAND_SYS_CFG1_BRL_3 (3 << 12) | ||
129 | #define ONENAND_SYS_CFG1_BRL_10 (2 << 12) | ||
130 | #define ONENAND_SYS_CFG1_BRL_9 (1 << 12) | ||
131 | #define ONENAND_SYS_CFG1_BRL_8 (0 << 12) | ||
132 | #define ONENAND_SYS_CFG1_BRL_SHIFT (12) | ||
133 | #define ONENAND_SYS_CFG1_BL_32 (4 << 9) | ||
134 | #define ONENAND_SYS_CFG1_BL_16 (3 << 9) | ||
135 | #define ONENAND_SYS_CFG1_BL_8 (2 << 9) | ||
136 | #define ONENAND_SYS_CFG1_BL_4 (1 << 9) | ||
137 | #define ONENAND_SYS_CFG1_BL_CONT (0 << 9) | ||
138 | #define ONENAND_SYS_CFG1_BL_SHIFT (9) | ||
139 | #define ONENAND_SYS_CFG1_NO_ECC (1 << 8) | ||
140 | #define ONENAND_SYS_CFG1_RDY (1 << 7) | ||
141 | #define ONENAND_SYS_CFG1_INT (1 << 6) | ||
142 | #define ONENAND_SYS_CFG1_IOBE (1 << 5) | ||
143 | #define ONENAND_SYS_CFG1_RDY_CONF (1 << 4) | ||
144 | |||
145 | /* | ||
146 | * Controller Status Register F240h (R) | ||
147 | */ | ||
148 | #define ONENAND_CTRL_ONGO (1 << 15) | ||
149 | #define ONENAND_CTRL_LOCK (1 << 14) | ||
150 | #define ONENAND_CTRL_LOAD (1 << 13) | ||
151 | #define ONENAND_CTRL_PROGRAM (1 << 12) | ||
152 | #define ONENAND_CTRL_ERASE (1 << 11) | ||
153 | #define ONENAND_CTRL_ERROR (1 << 10) | ||
154 | #define ONENAND_CTRL_RSTB (1 << 7) | ||
155 | |||
156 | /* | ||
157 | * Interrupt Status Register F241h (R) | ||
158 | */ | ||
159 | #define ONENAND_INT_MASTER (1 << 15) | ||
160 | #define ONENAND_INT_READ (1 << 7) | ||
161 | #define ONENAND_INT_WRITE (1 << 6) | ||
162 | #define ONENAND_INT_ERASE (1 << 5) | ||
163 | #define ONENAND_INT_RESET (1 << 4) | ||
164 | #define ONENAND_INT_CLEAR (0 << 0) | ||
165 | |||
166 | /* | ||
167 | * NAND Flash Write Protection Status Register F24Eh (R) | ||
168 | */ | ||
169 | #define ONENAND_WP_US (1 << 2) | ||
170 | #define ONENAND_WP_LS (1 << 1) | ||
171 | #define ONENAND_WP_LTS (1 << 0) | ||
172 | |||
173 | /* | ||
174 | * ECC Status Reigser FF00h (R) | ||
175 | */ | ||
176 | #define ONENAND_ECC_1BIT (1 << 0) | ||
177 | #define ONENAND_ECC_2BIT (1 << 1) | ||
178 | #define ONENAND_ECC_2BIT_ALL (0xAAAA) | ||
179 | |||
180 | #endif /* __ONENAND_REG_H */ | ||
diff --git a/include/linux/mtd/partitions.h b/include/linux/mtd/partitions.h index 50b2edfc8f11..b03f512d51b9 100644 --- a/include/linux/mtd/partitions.h +++ b/include/linux/mtd/partitions.h | |||
@@ -5,7 +5,7 @@ | |||
5 | * | 5 | * |
6 | * This code is GPL | 6 | * This code is GPL |
7 | * | 7 | * |
8 | * $Id: partitions.h,v 1.16 2004/11/16 18:34:40 dwmw2 Exp $ | 8 | * $Id: partitions.h,v 1.17 2005/11/07 11:14:55 gleixner Exp $ |
9 | */ | 9 | */ |
10 | 10 | ||
11 | #ifndef MTD_PARTITIONS_H | 11 | #ifndef MTD_PARTITIONS_H |
@@ -16,25 +16,25 @@ | |||
16 | 16 | ||
17 | /* | 17 | /* |
18 | * Partition definition structure: | 18 | * Partition definition structure: |
19 | * | 19 | * |
20 | * An array of struct partition is passed along with a MTD object to | 20 | * An array of struct partition is passed along with a MTD object to |
21 | * add_mtd_partitions() to create them. | 21 | * add_mtd_partitions() to create them. |
22 | * | 22 | * |
23 | * For each partition, these fields are available: | 23 | * For each partition, these fields are available: |
24 | * name: string that will be used to label the partition's MTD device. | 24 | * name: string that will be used to label the partition's MTD device. |
25 | * size: the partition size; if defined as MTDPART_SIZ_FULL, the partition | 25 | * size: the partition size; if defined as MTDPART_SIZ_FULL, the partition |
26 | * will extend to the end of the master MTD device. | 26 | * will extend to the end of the master MTD device. |
27 | * offset: absolute starting position within the master MTD device; if | 27 | * offset: absolute starting position within the master MTD device; if |
28 | * defined as MTDPART_OFS_APPEND, the partition will start where the | 28 | * defined as MTDPART_OFS_APPEND, the partition will start where the |
29 | * previous one ended; if MTDPART_OFS_NXTBLK, at the next erase block. | 29 | * previous one ended; if MTDPART_OFS_NXTBLK, at the next erase block. |
30 | * mask_flags: contains flags that have to be masked (removed) from the | 30 | * mask_flags: contains flags that have to be masked (removed) from the |
31 | * master MTD flag set for the corresponding MTD partition. | 31 | * master MTD flag set for the corresponding MTD partition. |
32 | * For example, to force a read-only partition, simply adding | 32 | * For example, to force a read-only partition, simply adding |
33 | * MTD_WRITEABLE to the mask_flags will do the trick. | 33 | * MTD_WRITEABLE to the mask_flags will do the trick. |
34 | * | 34 | * |
35 | * Note: writeable partitions require their size and offset be | 35 | * Note: writeable partitions require their size and offset be |
36 | * erasesize aligned (e.g. use MTDPART_OFS_NEXTBLK). | 36 | * erasesize aligned (e.g. use MTDPART_OFS_NEXTBLK). |
37 | */ | 37 | */ |
38 | 38 | ||
39 | struct mtd_partition { | 39 | struct mtd_partition { |
40 | char *name; /* identifier string */ | 40 | char *name; /* identifier string */ |
@@ -66,7 +66,7 @@ struct mtd_part_parser { | |||
66 | 66 | ||
67 | extern int register_mtd_parser(struct mtd_part_parser *parser); | 67 | extern int register_mtd_parser(struct mtd_part_parser *parser); |
68 | extern int deregister_mtd_parser(struct mtd_part_parser *parser); | 68 | extern int deregister_mtd_parser(struct mtd_part_parser *parser); |
69 | extern int parse_mtd_partitions(struct mtd_info *master, const char **types, | 69 | extern int parse_mtd_partitions(struct mtd_info *master, const char **types, |
70 | struct mtd_partition **pparts, unsigned long origin); | 70 | struct mtd_partition **pparts, unsigned long origin); |
71 | 71 | ||
72 | #define put_partition_parser(p) do { module_put((p)->owner); } while(0) | 72 | #define put_partition_parser(p) do { module_put((p)->owner); } while(0) |
diff --git a/include/linux/mtd/physmap.h b/include/linux/mtd/physmap.h index 05aa4970677f..c7b8bcdef013 100644 --- a/include/linux/mtd/physmap.h +++ b/include/linux/mtd/physmap.h | |||
@@ -1,8 +1,8 @@ | |||
1 | /* | 1 | /* |
2 | * For boards with physically mapped flash and using | 2 | * For boards with physically mapped flash and using |
3 | * drivers/mtd/maps/physmap.c mapping driver. | 3 | * drivers/mtd/maps/physmap.c mapping driver. |
4 | * | 4 | * |
5 | * $Id: physmap.h,v 1.3 2004/07/21 00:16:15 jwboyer Exp $ | 5 | * $Id: physmap.h,v 1.4 2005/11/07 11:14:55 gleixner Exp $ |
6 | * | 6 | * |
7 | * Copyright (C) 2003 MontaVista Software Inc. | 7 | * Copyright (C) 2003 MontaVista Software Inc. |
8 | * Author: Jun Sun, jsun@mvista.com or jsun@junsun.net | 8 | * Author: Jun Sun, jsun@mvista.com or jsun@junsun.net |
@@ -18,7 +18,7 @@ | |||
18 | 18 | ||
19 | #include <linux/config.h> | 19 | #include <linux/config.h> |
20 | 20 | ||
21 | #if defined(CONFIG_MTD_PHYSMAP) | 21 | #if defined(CONFIG_MTD_PHYSMAP) |
22 | 22 | ||
23 | #include <linux/mtd/mtd.h> | 23 | #include <linux/mtd/mtd.h> |
24 | #include <linux/mtd/map.h> | 24 | #include <linux/mtd/map.h> |
@@ -44,12 +44,12 @@ static inline void physmap_configure(unsigned long addr, unsigned long size, int | |||
44 | #if defined(CONFIG_MTD_PARTITIONS) | 44 | #if defined(CONFIG_MTD_PARTITIONS) |
45 | 45 | ||
46 | /* | 46 | /* |
47 | * Machines that wish to do flash partition may want to call this function in | 47 | * Machines that wish to do flash partition may want to call this function in |
48 | * their setup routine. | 48 | * their setup routine. |
49 | * | 49 | * |
50 | * physmap_set_partitions(mypartitions, num_parts); | 50 | * physmap_set_partitions(mypartitions, num_parts); |
51 | * | 51 | * |
52 | * Note that one can always override this hard-coded partition with | 52 | * Note that one can always override this hard-coded partition with |
53 | * command line partition (you need to enable CONFIG_MTD_CMDLINE_PARTS). | 53 | * command line partition (you need to enable CONFIG_MTD_CMDLINE_PARTS). |
54 | */ | 54 | */ |
55 | void physmap_set_partitions(struct mtd_partition *parts, int num_parts); | 55 | void physmap_set_partitions(struct mtd_partition *parts, int num_parts); |
diff --git a/include/linux/mtd/pmc551.h b/include/linux/mtd/pmc551.h index 113e3087f68a..a7f6d20ad407 100644 --- a/include/linux/mtd/pmc551.h +++ b/include/linux/mtd/pmc551.h | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * $Id: pmc551.h,v 1.5 2003/01/24 16:49:53 dwmw2 Exp $ | 2 | * $Id: pmc551.h,v 1.6 2005/11/07 11:14:55 gleixner Exp $ |
3 | * | 3 | * |
4 | * PMC551 PCI Mezzanine Ram Device | 4 | * PMC551 PCI Mezzanine Ram Device |
5 | * | 5 | * |
@@ -7,7 +7,7 @@ | |||
7 | * Mark Ferrell | 7 | * Mark Ferrell |
8 | * Copyright 1999,2000 Nortel Networks | 8 | * Copyright 1999,2000 Nortel Networks |
9 | * | 9 | * |
10 | * License: | 10 | * License: |
11 | * As part of this driver was derrived from the slram.c driver it falls | 11 | * As part of this driver was derrived from the slram.c driver it falls |
12 | * under the same license, which is GNU General Public License v2 | 12 | * under the same license, which is GNU General Public License v2 |
13 | */ | 13 | */ |
@@ -17,7 +17,7 @@ | |||
17 | 17 | ||
18 | #include <linux/mtd/mtd.h> | 18 | #include <linux/mtd/mtd.h> |
19 | 19 | ||
20 | #define PMC551_VERSION "$Id: pmc551.h,v 1.5 2003/01/24 16:49:53 dwmw2 Exp $\n"\ | 20 | #define PMC551_VERSION "$Id: pmc551.h,v 1.6 2005/11/07 11:14:55 gleixner Exp $\n"\ |
21 | "Ramix PMC551 PCI Mezzanine Ram Driver. (C) 1999,2000 Nortel Networks.\n" | 21 | "Ramix PMC551 PCI Mezzanine Ram Driver. (C) 1999,2000 Nortel Networks.\n" |
22 | 22 | ||
23 | /* | 23 | /* |
@@ -30,7 +30,7 @@ struct mypriv { | |||
30 | u32 curr_map0; | 30 | u32 curr_map0; |
31 | u32 asize; | 31 | u32 asize; |
32 | struct mtd_info *nextpmc551; | 32 | struct mtd_info *nextpmc551; |
33 | }; | 33 | }; |
34 | 34 | ||
35 | /* | 35 | /* |
36 | * Function Prototypes | 36 | * Function Prototypes |
@@ -39,7 +39,7 @@ static int pmc551_erase(struct mtd_info *, struct erase_info *); | |||
39 | static void pmc551_unpoint(struct mtd_info *, u_char *, loff_t, size_t); | 39 | static void pmc551_unpoint(struct mtd_info *, u_char *, loff_t, size_t); |
40 | static int pmc551_point (struct mtd_info *mtd, loff_t from, size_t len, size_t *retlen, u_char **mtdbuf); | 40 | static int pmc551_point (struct mtd_info *mtd, loff_t from, size_t len, size_t *retlen, u_char **mtdbuf); |
41 | static int pmc551_read(struct mtd_info *, loff_t, size_t, size_t *, u_char *); | 41 | static int pmc551_read(struct mtd_info *, loff_t, size_t, size_t *, u_char *); |
42 | static int pmc551_write(struct mtd_info *, loff_t, size_t, size_t *, const u_char *); | 42 | static int pmc551_write(struct mtd_info *, loff_t, size_t, size_t *, const u_char *); |
43 | 43 | ||
44 | 44 | ||
45 | /* | 45 | /* |
@@ -50,7 +50,7 @@ static int pmc551_write(struct mtd_info *, loff_t, size_t, size_t *, const u_cha | |||
50 | #endif | 50 | #endif |
51 | 51 | ||
52 | #ifndef PCI_DEVICE_ID_V3_SEMI_V370PDC | 52 | #ifndef PCI_DEVICE_ID_V3_SEMI_V370PDC |
53 | #define PCI_DEVICE_ID_V3_SEMI_V370PDC 0x0200 | 53 | #define PCI_DEVICE_ID_V3_SEMI_V370PDC 0x0200 |
54 | #endif | 54 | #endif |
55 | 55 | ||
56 | 56 | ||
diff --git a/include/linux/mtd/xip.h b/include/linux/mtd/xip.h index 7b7deef6b180..220d50bb71cd 100644 --- a/include/linux/mtd/xip.h +++ b/include/linux/mtd/xip.h | |||
@@ -12,7 +12,7 @@ | |||
12 | * it under the terms of the GNU General Public License version 2 as | 12 | * it under the terms of the GNU General Public License version 2 as |
13 | * published by the Free Software Foundation. | 13 | * published by the Free Software Foundation. |
14 | * | 14 | * |
15 | * $Id: xip.h,v 1.2 2004/12/01 15:49:10 nico Exp $ | 15 | * $Id: xip.h,v 1.5 2005/11/07 11:14:55 gleixner Exp $ |
16 | */ | 16 | */ |
17 | 17 | ||
18 | #ifndef __LINUX_MTD_XIP_H__ | 18 | #ifndef __LINUX_MTD_XIP_H__ |
@@ -23,19 +23,19 @@ | |||
23 | #ifdef CONFIG_MTD_XIP | 23 | #ifdef CONFIG_MTD_XIP |
24 | 24 | ||
25 | /* | 25 | /* |
26 | * Function that are modifying the flash state away from array mode must | ||
27 | * obviously not be running from flash. The __xipram is therefore marking | ||
28 | * those functions so they get relocated to ram. | ||
29 | */ | ||
30 | #define __xipram __attribute__ ((__section__ (".data"))) | ||
31 | |||
32 | /* | ||
33 | * We really don't want gcc to guess anything. | 26 | * We really don't want gcc to guess anything. |
34 | * We absolutely _need_ proper inlining. | 27 | * We absolutely _need_ proper inlining. |
35 | */ | 28 | */ |
36 | #include <linux/compiler.h> | 29 | #include <linux/compiler.h> |
37 | 30 | ||
38 | /* | 31 | /* |
32 | * Function that are modifying the flash state away from array mode must | ||
33 | * obviously not be running from flash. The __xipram is therefore marking | ||
34 | * those functions so they get relocated to ram. | ||
35 | */ | ||
36 | #define __xipram noinline __attribute__ ((__section__ (".data"))) | ||
37 | |||
38 | /* | ||
39 | * Each architecture has to provide the following macros. They must access | 39 | * Each architecture has to provide the following macros. They must access |
40 | * the hardware directly and not rely on any other (XIP) functions since they | 40 | * the hardware directly and not rely on any other (XIP) functions since they |
41 | * won't be available when used (flash not in array mode). | 41 | * won't be available when used (flash not in array mode). |
@@ -60,9 +60,9 @@ | |||
60 | * overflowing. | 60 | * overflowing. |
61 | * | 61 | * |
62 | * xip_iprefetch() | 62 | * xip_iprefetch() |
63 | * | 63 | * |
64 | * Macro to fill instruction prefetch | 64 | * Macro to fill instruction prefetch |
65 | * e.g. a series of nops: asm volatile (".rep 8; nop; .endr"); | 65 | * e.g. a series of nops: asm volatile (".rep 8; nop; .endr"); |
66 | */ | 66 | */ |
67 | 67 | ||
68 | #include <asm/mtd-xip.h> | 68 | #include <asm/mtd-xip.h> |
diff --git a/include/linux/net.h b/include/linux/net.h index 4e981585a89a..d6a41e6577f6 100644 --- a/include/linux/net.h +++ b/include/linux/net.h | |||
@@ -71,6 +71,7 @@ typedef enum { | |||
71 | * @SOCK_RAW: raw socket | 71 | * @SOCK_RAW: raw socket |
72 | * @SOCK_RDM: reliably-delivered message | 72 | * @SOCK_RDM: reliably-delivered message |
73 | * @SOCK_SEQPACKET: sequential packet socket | 73 | * @SOCK_SEQPACKET: sequential packet socket |
74 | * @SOCK_DCCP: Datagram Congestion Control Protocol socket | ||
74 | * @SOCK_PACKET: linux specific way of getting packets at the dev level. | 75 | * @SOCK_PACKET: linux specific way of getting packets at the dev level. |
75 | * For writing rarp and other similar things on the user level. | 76 | * For writing rarp and other similar things on the user level. |
76 | * | 77 | * |
diff --git a/include/linux/nfsd/nfsd.h b/include/linux/nfsd/nfsd.h index 6d5a24f3fc6d..51c231a1e5a6 100644 --- a/include/linux/nfsd/nfsd.h +++ b/include/linux/nfsd/nfsd.h | |||
@@ -60,7 +60,7 @@ typedef int (*nfsd_dirop_t)(struct inode *, struct dentry *, int, int); | |||
60 | extern struct svc_program nfsd_program; | 60 | extern struct svc_program nfsd_program; |
61 | extern struct svc_version nfsd_version2, nfsd_version3, | 61 | extern struct svc_version nfsd_version2, nfsd_version3, |
62 | nfsd_version4; | 62 | nfsd_version4; |
63 | 63 | extern struct svc_serv *nfsd_serv; | |
64 | /* | 64 | /* |
65 | * Function prototypes. | 65 | * Function prototypes. |
66 | */ | 66 | */ |
diff --git a/include/linux/nfsd/syscall.h b/include/linux/nfsd/syscall.h index e65c9db6d13f..781efbf94ed3 100644 --- a/include/linux/nfsd/syscall.h +++ b/include/linux/nfsd/syscall.h | |||
@@ -39,6 +39,21 @@ | |||
39 | #define NFSCTL_GETFD 7 /* get an fh by path (used by mountd) */ | 39 | #define NFSCTL_GETFD 7 /* get an fh by path (used by mountd) */ |
40 | #define NFSCTL_GETFS 8 /* get an fh by path with max FH len */ | 40 | #define NFSCTL_GETFS 8 /* get an fh by path with max FH len */ |
41 | 41 | ||
42 | /* | ||
43 | * Macros used to set version | ||
44 | */ | ||
45 | #define NFSCTL_VERSET(_cltbits, _v) ((_cltbits) |= (1 << (_v))) | ||
46 | #define NFSCTL_VERUNSET(_cltbits, _v) ((_cltbits) &= ~(1 << (_v))) | ||
47 | #define NFSCTL_VERISSET(_cltbits, _v) ((_cltbits) & (1 << (_v))) | ||
48 | |||
49 | #if defined(CONFIG_NFSD_V4) | ||
50 | #define NFSCTL_VERALL (0x1c /* 0b011100 */) | ||
51 | #elif defined(CONFIG_NFSD_V3) | ||
52 | #define NFSCTL_VERALL (0x0c /* 0b001100 */) | ||
53 | #else | ||
54 | #define NFSCTL_VERALL (0x04 /* 0b000100 */) | ||
55 | #endif | ||
56 | |||
42 | /* SVC */ | 57 | /* SVC */ |
43 | struct nfsctl_svc { | 58 | struct nfsctl_svc { |
44 | unsigned short svc_port; | 59 | unsigned short svc_port; |
@@ -120,6 +135,8 @@ extern int exp_delclient(struct nfsctl_client *ncp); | |||
120 | extern int exp_export(struct nfsctl_export *nxp); | 135 | extern int exp_export(struct nfsctl_export *nxp); |
121 | extern int exp_unexport(struct nfsctl_export *nxp); | 136 | extern int exp_unexport(struct nfsctl_export *nxp); |
122 | 137 | ||
138 | extern unsigned int nfsd_versbits; | ||
139 | |||
123 | #endif /* __KERNEL__ */ | 140 | #endif /* __KERNEL__ */ |
124 | 141 | ||
125 | #endif /* NFSD_SYSCALL_H */ | 142 | #endif /* NFSD_SYSCALL_H */ |
diff --git a/include/linux/nfsd/xdr3.h b/include/linux/nfsd/xdr3.h index 21e18ce7ca63..3c2a71b43bac 100644 --- a/include/linux/nfsd/xdr3.h +++ b/include/linux/nfsd/xdr3.h | |||
@@ -42,7 +42,7 @@ struct nfsd3_writeargs { | |||
42 | __u64 offset; | 42 | __u64 offset; |
43 | __u32 count; | 43 | __u32 count; |
44 | int stable; | 44 | int stable; |
45 | int len; | 45 | __u32 len; |
46 | struct kvec vec[RPCSVC_MAXPAGES]; | 46 | struct kvec vec[RPCSVC_MAXPAGES]; |
47 | int vlen; | 47 | int vlen; |
48 | }; | 48 | }; |
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h index 88de3f8ce1a2..9a96f0588393 100644 --- a/include/linux/pci_ids.h +++ b/include/linux/pci_ids.h | |||
@@ -519,6 +519,7 @@ | |||
519 | #define PCI_DEVICE_ID_MATROX_MIL 0x0519 | 519 | #define PCI_DEVICE_ID_MATROX_MIL 0x0519 |
520 | #define PCI_DEVICE_ID_MATROX_MYS 0x051A | 520 | #define PCI_DEVICE_ID_MATROX_MYS 0x051A |
521 | #define PCI_DEVICE_ID_MATROX_MIL_2 0x051b | 521 | #define PCI_DEVICE_ID_MATROX_MIL_2 0x051b |
522 | #define PCI_DEVICE_ID_MATROX_MYS_AGP 0x051e | ||
522 | #define PCI_DEVICE_ID_MATROX_MIL_2_AGP 0x051f | 523 | #define PCI_DEVICE_ID_MATROX_MIL_2_AGP 0x051f |
523 | #define PCI_DEVICE_ID_MATROX_MGA_IMP 0x0d10 | 524 | #define PCI_DEVICE_ID_MATROX_MGA_IMP 0x0d10 |
524 | #define PCI_DEVICE_ID_MATROX_G100_MM 0x1000 | 525 | #define PCI_DEVICE_ID_MATROX_G100_MM 0x1000 |
@@ -1785,6 +1786,7 @@ | |||
1785 | #define PCI_DEVICE_ID_TIGON3_5704 0x1648 | 1786 | #define PCI_DEVICE_ID_TIGON3_5704 0x1648 |
1786 | #define PCI_DEVICE_ID_TIGON3_5704S_2 0x1649 | 1787 | #define PCI_DEVICE_ID_TIGON3_5704S_2 0x1649 |
1787 | #define PCI_DEVICE_ID_NX2_5706 0x164a | 1788 | #define PCI_DEVICE_ID_NX2_5706 0x164a |
1789 | #define PCI_DEVICE_ID_NX2_5708 0x164c | ||
1788 | #define PCI_DEVICE_ID_TIGON3_5702FE 0x164d | 1790 | #define PCI_DEVICE_ID_TIGON3_5702FE 0x164d |
1789 | #define PCI_DEVICE_ID_TIGON3_5705 0x1653 | 1791 | #define PCI_DEVICE_ID_TIGON3_5705 0x1653 |
1790 | #define PCI_DEVICE_ID_TIGON3_5705_2 0x1654 | 1792 | #define PCI_DEVICE_ID_TIGON3_5705_2 0x1654 |
@@ -1809,6 +1811,7 @@ | |||
1809 | #define PCI_DEVICE_ID_TIGON3_5703X 0x16a7 | 1811 | #define PCI_DEVICE_ID_TIGON3_5703X 0x16a7 |
1810 | #define PCI_DEVICE_ID_TIGON3_5704S 0x16a8 | 1812 | #define PCI_DEVICE_ID_TIGON3_5704S 0x16a8 |
1811 | #define PCI_DEVICE_ID_NX2_5706S 0x16aa | 1813 | #define PCI_DEVICE_ID_NX2_5706S 0x16aa |
1814 | #define PCI_DEVICE_ID_NX2_5708S 0x16ac | ||
1812 | #define PCI_DEVICE_ID_TIGON3_5702A3 0x16c6 | 1815 | #define PCI_DEVICE_ID_TIGON3_5702A3 0x16c6 |
1813 | #define PCI_DEVICE_ID_TIGON3_5703A3 0x16c7 | 1816 | #define PCI_DEVICE_ID_TIGON3_5703A3 0x16c7 |
1814 | #define PCI_DEVICE_ID_TIGON3_5781 0x16dd | 1817 | #define PCI_DEVICE_ID_TIGON3_5781 0x16dd |
diff --git a/include/linux/pkt_sched.h b/include/linux/pkt_sched.h index 60ffcb9c5791..e87b233615b3 100644 --- a/include/linux/pkt_sched.h +++ b/include/linux/pkt_sched.h | |||
@@ -93,6 +93,7 @@ struct tc_fifo_qopt | |||
93 | /* PRIO section */ | 93 | /* PRIO section */ |
94 | 94 | ||
95 | #define TCQ_PRIO_BANDS 16 | 95 | #define TCQ_PRIO_BANDS 16 |
96 | #define TCQ_MIN_PRIO_BANDS 2 | ||
96 | 97 | ||
97 | struct tc_prio_qopt | 98 | struct tc_prio_qopt |
98 | { | 99 | { |
@@ -169,6 +170,7 @@ struct tc_red_qopt | |||
169 | unsigned char Scell_log; /* cell size for idle damping */ | 170 | unsigned char Scell_log; /* cell size for idle damping */ |
170 | unsigned char flags; | 171 | unsigned char flags; |
171 | #define TC_RED_ECN 1 | 172 | #define TC_RED_ECN 1 |
173 | #define TC_RED_HARDDROP 2 | ||
172 | }; | 174 | }; |
173 | 175 | ||
174 | struct tc_red_xstats | 176 | struct tc_red_xstats |
@@ -194,38 +196,34 @@ enum | |||
194 | 196 | ||
195 | #define TCA_GRED_MAX (__TCA_GRED_MAX - 1) | 197 | #define TCA_GRED_MAX (__TCA_GRED_MAX - 1) |
196 | 198 | ||
197 | #define TCA_SET_OFF TCA_GRED_PARMS | ||
198 | struct tc_gred_qopt | 199 | struct tc_gred_qopt |
199 | { | 200 | { |
200 | __u32 limit; /* HARD maximal queue length (bytes) | 201 | __u32 limit; /* HARD maximal queue length (bytes) */ |
201 | */ | 202 | __u32 qth_min; /* Min average length threshold (bytes) */ |
202 | __u32 qth_min; /* Min average length threshold (bytes) | 203 | __u32 qth_max; /* Max average length threshold (bytes) */ |
203 | */ | 204 | __u32 DP; /* upto 2^32 DPs */ |
204 | __u32 qth_max; /* Max average length threshold (bytes) | 205 | __u32 backlog; |
205 | */ | 206 | __u32 qave; |
206 | __u32 DP; /* upto 2^32 DPs */ | 207 | __u32 forced; |
207 | __u32 backlog; | 208 | __u32 early; |
208 | __u32 qave; | 209 | __u32 other; |
209 | __u32 forced; | 210 | __u32 pdrop; |
210 | __u32 early; | 211 | __u8 Wlog; /* log(W) */ |
211 | __u32 other; | 212 | __u8 Plog; /* log(P_max/(qth_max-qth_min)) */ |
212 | __u32 pdrop; | 213 | __u8 Scell_log; /* cell size for idle damping */ |
213 | 214 | __u8 prio; /* prio of this VQ */ | |
214 | unsigned char Wlog; /* log(W) */ | 215 | __u32 packets; |
215 | unsigned char Plog; /* log(P_max/(qth_max-qth_min)) */ | 216 | __u32 bytesin; |
216 | unsigned char Scell_log; /* cell size for idle damping */ | ||
217 | __u8 prio; /* prio of this VQ */ | ||
218 | __u32 packets; | ||
219 | __u32 bytesin; | ||
220 | }; | 217 | }; |
218 | |||
221 | /* gred setup */ | 219 | /* gred setup */ |
222 | struct tc_gred_sopt | 220 | struct tc_gred_sopt |
223 | { | 221 | { |
224 | __u32 DPs; | 222 | __u32 DPs; |
225 | __u32 def_DP; | 223 | __u32 def_DP; |
226 | __u8 grio; | 224 | __u8 grio; |
227 | __u8 pad1; | 225 | __u8 flags; |
228 | __u16 pad2; | 226 | __u16 pad1; |
229 | }; | 227 | }; |
230 | 228 | ||
231 | /* HTB section */ | 229 | /* HTB section */ |
diff --git a/include/linux/pnp.h b/include/linux/pnp.h index aadbac29103c..584d57cb393a 100644 --- a/include/linux/pnp.h +++ b/include/linux/pnp.h | |||
@@ -353,7 +353,6 @@ struct pnp_protocol { | |||
353 | int pnp_register_protocol(struct pnp_protocol *protocol); | 353 | int pnp_register_protocol(struct pnp_protocol *protocol); |
354 | void pnp_unregister_protocol(struct pnp_protocol *protocol); | 354 | void pnp_unregister_protocol(struct pnp_protocol *protocol); |
355 | int pnp_add_device(struct pnp_dev *dev); | 355 | int pnp_add_device(struct pnp_dev *dev); |
356 | void pnp_remove_device(struct pnp_dev *dev); | ||
357 | int pnp_device_attach(struct pnp_dev *pnp_dev); | 356 | int pnp_device_attach(struct pnp_dev *pnp_dev); |
358 | void pnp_device_detach(struct pnp_dev *pnp_dev); | 357 | void pnp_device_detach(struct pnp_dev *pnp_dev); |
359 | extern struct list_head pnp_global; | 358 | extern struct list_head pnp_global; |
@@ -399,7 +398,6 @@ static inline int pnp_register_protocol(struct pnp_protocol *protocol) { return | |||
399 | static inline void pnp_unregister_protocol(struct pnp_protocol *protocol) { } | 398 | static inline void pnp_unregister_protocol(struct pnp_protocol *protocol) { } |
400 | static inline int pnp_init_device(struct pnp_dev *dev) { return -ENODEV; } | 399 | static inline int pnp_init_device(struct pnp_dev *dev) { return -ENODEV; } |
401 | static inline int pnp_add_device(struct pnp_dev *dev) { return -ENODEV; } | 400 | static inline int pnp_add_device(struct pnp_dev *dev) { return -ENODEV; } |
402 | static inline void pnp_remove_device(struct pnp_dev *dev) { } | ||
403 | static inline int pnp_device_attach(struct pnp_dev *pnp_dev) { return -ENODEV; } | 401 | static inline int pnp_device_attach(struct pnp_dev *pnp_dev) { return -ENODEV; } |
404 | static inline void pnp_device_detach(struct pnp_dev *pnp_dev) { ; } | 402 | static inline void pnp_device_detach(struct pnp_dev *pnp_dev) { ; } |
405 | 403 | ||
diff --git a/include/linux/ptrace.h b/include/linux/ptrace.h index dc6f3647bfbc..b2b3dba1298d 100644 --- a/include/linux/ptrace.h +++ b/include/linux/ptrace.h | |||
@@ -78,6 +78,8 @@ | |||
78 | #include <linux/compiler.h> /* For unlikely. */ | 78 | #include <linux/compiler.h> /* For unlikely. */ |
79 | #include <linux/sched.h> /* For struct task_struct. */ | 79 | #include <linux/sched.h> /* For struct task_struct. */ |
80 | 80 | ||
81 | |||
82 | extern long arch_ptrace(struct task_struct *child, long request, long addr, long data); | ||
81 | extern int ptrace_readdata(struct task_struct *tsk, unsigned long src, char __user *dst, int len); | 83 | extern int ptrace_readdata(struct task_struct *tsk, unsigned long src, char __user *dst, int len); |
82 | extern int ptrace_writedata(struct task_struct *tsk, char __user *src, unsigned long dst, int len); | 84 | extern int ptrace_writedata(struct task_struct *tsk, char __user *src, unsigned long dst, int len); |
83 | extern int ptrace_attach(struct task_struct *tsk); | 85 | extern int ptrace_attach(struct task_struct *tsk); |
diff --git a/include/linux/quotaops.h b/include/linux/quotaops.h index d211507ab246..4f34d3d60f2e 100644 --- a/include/linux/quotaops.h +++ b/include/linux/quotaops.h | |||
@@ -198,38 +198,38 @@ static __inline__ int DQUOT_OFF(struct super_block *sb) | |||
198 | #define DQUOT_SYNC(sb) do { } while(0) | 198 | #define DQUOT_SYNC(sb) do { } while(0) |
199 | #define DQUOT_OFF(sb) do { } while(0) | 199 | #define DQUOT_OFF(sb) do { } while(0) |
200 | #define DQUOT_TRANSFER(inode, iattr) (0) | 200 | #define DQUOT_TRANSFER(inode, iattr) (0) |
201 | extern __inline__ int DQUOT_PREALLOC_SPACE_NODIRTY(struct inode *inode, qsize_t nr) | 201 | static inline int DQUOT_PREALLOC_SPACE_NODIRTY(struct inode *inode, qsize_t nr) |
202 | { | 202 | { |
203 | inode_add_bytes(inode, nr); | 203 | inode_add_bytes(inode, nr); |
204 | return 0; | 204 | return 0; |
205 | } | 205 | } |
206 | 206 | ||
207 | extern __inline__ int DQUOT_PREALLOC_SPACE(struct inode *inode, qsize_t nr) | 207 | static inline int DQUOT_PREALLOC_SPACE(struct inode *inode, qsize_t nr) |
208 | { | 208 | { |
209 | DQUOT_PREALLOC_SPACE_NODIRTY(inode, nr); | 209 | DQUOT_PREALLOC_SPACE_NODIRTY(inode, nr); |
210 | mark_inode_dirty(inode); | 210 | mark_inode_dirty(inode); |
211 | return 0; | 211 | return 0; |
212 | } | 212 | } |
213 | 213 | ||
214 | extern __inline__ int DQUOT_ALLOC_SPACE_NODIRTY(struct inode *inode, qsize_t nr) | 214 | static inline int DQUOT_ALLOC_SPACE_NODIRTY(struct inode *inode, qsize_t nr) |
215 | { | 215 | { |
216 | inode_add_bytes(inode, nr); | 216 | inode_add_bytes(inode, nr); |
217 | return 0; | 217 | return 0; |
218 | } | 218 | } |
219 | 219 | ||
220 | extern __inline__ int DQUOT_ALLOC_SPACE(struct inode *inode, qsize_t nr) | 220 | static inline int DQUOT_ALLOC_SPACE(struct inode *inode, qsize_t nr) |
221 | { | 221 | { |
222 | DQUOT_ALLOC_SPACE_NODIRTY(inode, nr); | 222 | DQUOT_ALLOC_SPACE_NODIRTY(inode, nr); |
223 | mark_inode_dirty(inode); | 223 | mark_inode_dirty(inode); |
224 | return 0; | 224 | return 0; |
225 | } | 225 | } |
226 | 226 | ||
227 | extern __inline__ void DQUOT_FREE_SPACE_NODIRTY(struct inode *inode, qsize_t nr) | 227 | static inline void DQUOT_FREE_SPACE_NODIRTY(struct inode *inode, qsize_t nr) |
228 | { | 228 | { |
229 | inode_sub_bytes(inode, nr); | 229 | inode_sub_bytes(inode, nr); |
230 | } | 230 | } |
231 | 231 | ||
232 | extern __inline__ void DQUOT_FREE_SPACE(struct inode *inode, qsize_t nr) | 232 | static inline void DQUOT_FREE_SPACE(struct inode *inode, qsize_t nr) |
233 | { | 233 | { |
234 | DQUOT_FREE_SPACE_NODIRTY(inode, nr); | 234 | DQUOT_FREE_SPACE_NODIRTY(inode, nr); |
235 | mark_inode_dirty(inode); | 235 | mark_inode_dirty(inode); |
diff --git a/include/linux/radix-tree.h b/include/linux/radix-tree.h index 9f0f9281f42a..36e5d269612f 100644 --- a/include/linux/radix-tree.h +++ b/include/linux/radix-tree.h | |||
@@ -46,6 +46,7 @@ do { \ | |||
46 | 46 | ||
47 | int radix_tree_insert(struct radix_tree_root *, unsigned long, void *); | 47 | int radix_tree_insert(struct radix_tree_root *, unsigned long, void *); |
48 | void *radix_tree_lookup(struct radix_tree_root *, unsigned long); | 48 | void *radix_tree_lookup(struct radix_tree_root *, unsigned long); |
49 | void **radix_tree_lookup_slot(struct radix_tree_root *, unsigned long); | ||
49 | void *radix_tree_delete(struct radix_tree_root *, unsigned long); | 50 | void *radix_tree_delete(struct radix_tree_root *, unsigned long); |
50 | unsigned int | 51 | unsigned int |
51 | radix_tree_gang_lookup(struct radix_tree_root *root, void **results, | 52 | radix_tree_gang_lookup(struct radix_tree_root *root, void **results, |
diff --git a/include/linux/rio.h b/include/linux/rio.h new file mode 100644 index 000000000000..c7e907faae9c --- /dev/null +++ b/include/linux/rio.h | |||
@@ -0,0 +1,325 @@ | |||
1 | /* | ||
2 | * RapidIO interconnect services | ||
3 | * (RapidIO Interconnect Specification, http://www.rapidio.org) | ||
4 | * | ||
5 | * Copyright 2005 MontaVista Software, Inc. | ||
6 | * Matt Porter <mporter@kernel.crashing.org> | ||
7 | * | ||
8 | * This program is free software; you can redistribute it and/or modify it | ||
9 | * under the terms of the GNU General Public License as published by the | ||
10 | * Free Software Foundation; either version 2 of the License, or (at your | ||
11 | * option) any later version. | ||
12 | */ | ||
13 | |||
14 | #ifndef LINUX_RIO_H | ||
15 | #define LINUX_RIO_H | ||
16 | |||
17 | #ifdef __KERNEL__ | ||
18 | |||
19 | #include <linux/types.h> | ||
20 | #include <linux/config.h> | ||
21 | #include <linux/ioport.h> | ||
22 | #include <linux/list.h> | ||
23 | #include <linux/errno.h> | ||
24 | #include <linux/device.h> | ||
25 | #include <linux/rio_regs.h> | ||
26 | |||
27 | #define RIO_ANY_DESTID 0xff | ||
28 | #define RIO_NO_HOPCOUNT -1 | ||
29 | |||
30 | #define RIO_MAX_MPORT_RESOURCES 16 | ||
31 | #define RIO_MAX_DEV_RESOURCES 16 | ||
32 | |||
33 | #define RIO_GLOBAL_TABLE 0xff /* Indicates access of a switch's | ||
34 | global routing table if it | ||
35 | has multiple (or per port) | ||
36 | tables */ | ||
37 | |||
38 | #define RIO_INVALID_ROUTE 0xff /* Indicates that a route table | ||
39 | entry is invalid (no route | ||
40 | exists for the device ID) */ | ||
41 | |||
42 | #ifdef CONFIG_RAPIDIO_8_BIT_TRANSPORT | ||
43 | #define RIO_MAX_ROUTE_ENTRIES (1 << 8) | ||
44 | #else | ||
45 | #define RIO_MAX_ROUTE_ENTRIES (1 << 16) | ||
46 | #endif | ||
47 | |||
48 | #define RIO_MAX_MBOX 4 | ||
49 | #define RIO_MAX_MSG_SIZE 0x1000 | ||
50 | |||
51 | /* | ||
52 | * Error values that may be returned by RIO functions. | ||
53 | */ | ||
54 | #define RIO_SUCCESSFUL 0x00 | ||
55 | #define RIO_BAD_SIZE 0x81 | ||
56 | |||
57 | /* | ||
58 | * For RIO devices, the region numbers are assigned this way: | ||
59 | * | ||
60 | * 0 RapidIO outbound doorbells | ||
61 | * 1-15 RapidIO memory regions | ||
62 | * | ||
63 | * For RIO master ports, the region number are assigned this way: | ||
64 | * | ||
65 | * 0 RapidIO inbound doorbells | ||
66 | * 1 RapidIO inbound mailboxes | ||
67 | * 1 RapidIO outbound mailboxes | ||
68 | */ | ||
69 | #define RIO_DOORBELL_RESOURCE 0 | ||
70 | #define RIO_INB_MBOX_RESOURCE 1 | ||
71 | #define RIO_OUTB_MBOX_RESOURCE 2 | ||
72 | |||
73 | extern struct bus_type rio_bus_type; | ||
74 | extern struct list_head rio_devices; /* list of all devices */ | ||
75 | |||
76 | struct rio_mport; | ||
77 | |||
78 | /** | ||
79 | * struct rio_dev - RIO device info | ||
80 | * @global_list: Node in list of all RIO devices | ||
81 | * @net_list: Node in list of RIO devices in a network | ||
82 | * @net: Network this device is a part of | ||
83 | * @did: Device ID | ||
84 | * @vid: Vendor ID | ||
85 | * @device_rev: Device revision | ||
86 | * @asm_did: Assembly device ID | ||
87 | * @asm_vid: Assembly vendor ID | ||
88 | * @asm_rev: Assembly revision | ||
89 | * @efptr: Extended feature pointer | ||
90 | * @pef: Processing element features | ||
91 | * @swpinfo: Switch port info | ||
92 | * @src_ops: Source operation capabilities | ||
93 | * @dst_ops: Destination operation capabilities | ||
94 | * @dma_mask: Mask of bits of RIO address this device implements | ||
95 | * @rswitch: Pointer to &struct rio_switch if valid for this device | ||
96 | * @driver: Driver claiming this device | ||
97 | * @dev: Device model device | ||
98 | * @riores: RIO resources this device owns | ||
99 | * @destid: Network destination ID | ||
100 | */ | ||
101 | struct rio_dev { | ||
102 | struct list_head global_list; /* node in list of all RIO devices */ | ||
103 | struct list_head net_list; /* node in per net list */ | ||
104 | struct rio_net *net; /* RIO net this device resides in */ | ||
105 | u16 did; | ||
106 | u16 vid; | ||
107 | u32 device_rev; | ||
108 | u16 asm_did; | ||
109 | u16 asm_vid; | ||
110 | u16 asm_rev; | ||
111 | u16 efptr; | ||
112 | u32 pef; | ||
113 | u32 swpinfo; /* Only used for switches */ | ||
114 | u32 src_ops; | ||
115 | u32 dst_ops; | ||
116 | u64 dma_mask; | ||
117 | struct rio_switch *rswitch; /* RIO switch info */ | ||
118 | struct rio_driver *driver; /* RIO driver claiming this device */ | ||
119 | struct device dev; /* LDM device structure */ | ||
120 | struct resource riores[RIO_MAX_DEV_RESOURCES]; | ||
121 | u16 destid; | ||
122 | }; | ||
123 | |||
124 | #define rio_dev_g(n) list_entry(n, struct rio_dev, global_list) | ||
125 | #define rio_dev_f(n) list_entry(n, struct rio_dev, net_list) | ||
126 | #define to_rio_dev(n) container_of(n, struct rio_dev, dev) | ||
127 | |||
128 | /** | ||
129 | * struct rio_msg - RIO message event | ||
130 | * @res: Mailbox resource | ||
131 | * @mcback: Message event callback | ||
132 | */ | ||
133 | struct rio_msg { | ||
134 | struct resource *res; | ||
135 | void (*mcback) (struct rio_mport * mport, void *dev_id, int mbox, int slot); | ||
136 | }; | ||
137 | |||
138 | /** | ||
139 | * struct rio_dbell - RIO doorbell event | ||
140 | * @node: Node in list of doorbell events | ||
141 | * @res: Doorbell resource | ||
142 | * @dinb: Doorbell event callback | ||
143 | * @dev_id: Device specific pointer to pass on event | ||
144 | */ | ||
145 | struct rio_dbell { | ||
146 | struct list_head node; | ||
147 | struct resource *res; | ||
148 | void (*dinb) (struct rio_mport *mport, void *dev_id, u16 src, u16 dst, u16 info); | ||
149 | void *dev_id; | ||
150 | }; | ||
151 | |||
152 | /** | ||
153 | * struct rio_mport - RIO master port info | ||
154 | * @dbells: List of doorbell events | ||
155 | * @node: Node in global list of master ports | ||
156 | * @nnode: Node in network list of master ports | ||
157 | * @iores: I/O mem resource that this master port interface owns | ||
158 | * @riores: RIO resources that this master port interfaces owns | ||
159 | * @inb_msg: RIO inbound message event descriptors | ||
160 | * @outb_msg: RIO outbound message event descriptors | ||
161 | * @host_deviceid: Host device ID associated with this master port | ||
162 | * @ops: configuration space functions | ||
163 | * @id: Port ID, unique among all ports | ||
164 | * @index: Port index, unique among all port interfaces of the same type | ||
165 | * @name: Port name string | ||
166 | */ | ||
167 | struct rio_mport { | ||
168 | struct list_head dbells; /* list of doorbell events */ | ||
169 | struct list_head node; /* node in global list of ports */ | ||
170 | struct list_head nnode; /* node in net list of ports */ | ||
171 | struct resource iores; | ||
172 | struct resource riores[RIO_MAX_MPORT_RESOURCES]; | ||
173 | struct rio_msg inb_msg[RIO_MAX_MBOX]; | ||
174 | struct rio_msg outb_msg[RIO_MAX_MBOX]; | ||
175 | int host_deviceid; /* Host device ID */ | ||
176 | struct rio_ops *ops; /* maintenance transaction functions */ | ||
177 | unsigned char id; /* port ID, unique among all ports */ | ||
178 | unsigned char index; /* port index, unique among all port | ||
179 | interfaces of the same type */ | ||
180 | unsigned char name[40]; | ||
181 | }; | ||
182 | |||
183 | /** | ||
184 | * struct rio_net - RIO network info | ||
185 | * @node: Node in global list of RIO networks | ||
186 | * @devices: List of devices in this network | ||
187 | * @mports: List of master ports accessing this network | ||
188 | * @hport: Default port for accessing this network | ||
189 | * @id: RIO network ID | ||
190 | */ | ||
191 | struct rio_net { | ||
192 | struct list_head node; /* node in list of networks */ | ||
193 | struct list_head devices; /* list of devices in this net */ | ||
194 | struct list_head mports; /* list of ports accessing net */ | ||
195 | struct rio_mport *hport; /* primary port for accessing net */ | ||
196 | unsigned char id; /* RIO network ID */ | ||
197 | }; | ||
198 | |||
199 | /** | ||
200 | * struct rio_switch - RIO switch info | ||
201 | * @node: Node in global list of switches | ||
202 | * @switchid: Switch ID that is unique across a network | ||
203 | * @hopcount: Hopcount to this switch | ||
204 | * @destid: Associated destid in the path | ||
205 | * @route_table: Copy of switch routing table | ||
206 | * @add_entry: Callback for switch-specific route add function | ||
207 | * @get_entry: Callback for switch-specific route get function | ||
208 | */ | ||
209 | struct rio_switch { | ||
210 | struct list_head node; | ||
211 | u16 switchid; | ||
212 | u16 hopcount; | ||
213 | u16 destid; | ||
214 | u8 route_table[RIO_MAX_ROUTE_ENTRIES]; | ||
215 | int (*add_entry) (struct rio_mport * mport, u16 destid, u8 hopcount, | ||
216 | u16 table, u16 route_destid, u8 route_port); | ||
217 | int (*get_entry) (struct rio_mport * mport, u16 destid, u8 hopcount, | ||
218 | u16 table, u16 route_destid, u8 * route_port); | ||
219 | }; | ||
220 | |||
221 | /* Low-level architecture-dependent routines */ | ||
222 | |||
223 | /** | ||
224 | * struct rio_ops - Low-level RIO configuration space operations | ||
225 | * @lcread: Callback to perform local (master port) read of config space. | ||
226 | * @lcwrite: Callback to perform local (master port) write of config space. | ||
227 | * @cread: Callback to perform network read of config space. | ||
228 | * @cwrite: Callback to perform network write of config space. | ||
229 | * @dsend: Callback to send a doorbell message. | ||
230 | */ | ||
231 | struct rio_ops { | ||
232 | int (*lcread) (int index, u32 offset, int len, u32 * data); | ||
233 | int (*lcwrite) (int index, u32 offset, int len, u32 data); | ||
234 | int (*cread) (int index, u16 destid, u8 hopcount, u32 offset, int len, | ||
235 | u32 * data); | ||
236 | int (*cwrite) (int index, u16 destid, u8 hopcount, u32 offset, int len, | ||
237 | u32 data); | ||
238 | int (*dsend) (int index, u16 destid, u16 data); | ||
239 | }; | ||
240 | |||
241 | #define RIO_RESOURCE_MEM 0x00000100 | ||
242 | #define RIO_RESOURCE_DOORBELL 0x00000200 | ||
243 | #define RIO_RESOURCE_MAILBOX 0x00000400 | ||
244 | |||
245 | #define RIO_RESOURCE_CACHEABLE 0x00010000 | ||
246 | #define RIO_RESOURCE_PCI 0x00020000 | ||
247 | |||
248 | #define RIO_RESOURCE_BUSY 0x80000000 | ||
249 | |||
250 | /** | ||
251 | * struct rio_driver - RIO driver info | ||
252 | * @node: Node in list of drivers | ||
253 | * @name: RIO driver name | ||
254 | * @id_table: RIO device ids to be associated with this driver | ||
255 | * @probe: RIO device inserted | ||
256 | * @remove: RIO device removed | ||
257 | * @suspend: RIO device suspended | ||
258 | * @resume: RIO device awakened | ||
259 | * @enable_wake: RIO device enable wake event | ||
260 | * @driver: LDM driver struct | ||
261 | * | ||
262 | * Provides info on a RIO device driver for insertion/removal and | ||
263 | * power management purposes. | ||
264 | */ | ||
265 | struct rio_driver { | ||
266 | struct list_head node; | ||
267 | char *name; | ||
268 | const struct rio_device_id *id_table; | ||
269 | int (*probe) (struct rio_dev * dev, const struct rio_device_id * id); | ||
270 | void (*remove) (struct rio_dev * dev); | ||
271 | int (*suspend) (struct rio_dev * dev, u32 state); | ||
272 | int (*resume) (struct rio_dev * dev); | ||
273 | int (*enable_wake) (struct rio_dev * dev, u32 state, int enable); | ||
274 | struct device_driver driver; | ||
275 | }; | ||
276 | |||
277 | #define to_rio_driver(drv) container_of(drv,struct rio_driver, driver) | ||
278 | |||
279 | /** | ||
280 | * struct rio_device_id - RIO device identifier | ||
281 | * @did: RIO device ID | ||
282 | * @vid: RIO vendor ID | ||
283 | * @asm_did: RIO assembly device ID | ||
284 | * @asm_vid: RIO assembly vendor ID | ||
285 | * | ||
286 | * Identifies a RIO device based on both the device/vendor IDs and | ||
287 | * the assembly device/vendor IDs. | ||
288 | */ | ||
289 | struct rio_device_id { | ||
290 | u16 did, vid; | ||
291 | u16 asm_did, asm_vid; | ||
292 | }; | ||
293 | |||
294 | /** | ||
295 | * struct rio_route_ops - Per-switch route operations | ||
296 | * @vid: RIO vendor ID | ||
297 | * @did: RIO device ID | ||
298 | * @add_hook: Callback that adds a route entry | ||
299 | * @get_hook: Callback that gets a route entry | ||
300 | * | ||
301 | * Defines the operations that are necessary to manipulate the route | ||
302 | * tables for a particular RIO switch device. | ||
303 | */ | ||
304 | struct rio_route_ops { | ||
305 | u16 vid, did; | ||
306 | int (*add_hook) (struct rio_mport * mport, u16 destid, u8 hopcount, | ||
307 | u16 table, u16 route_destid, u8 route_port); | ||
308 | int (*get_hook) (struct rio_mport * mport, u16 destid, u8 hopcount, | ||
309 | u16 table, u16 route_destid, u8 * route_port); | ||
310 | }; | ||
311 | |||
312 | /* Architecture and hardware-specific functions */ | ||
313 | extern int rio_init_mports(void); | ||
314 | extern void rio_register_mport(struct rio_mport *); | ||
315 | extern int rio_hw_add_outb_message(struct rio_mport *, struct rio_dev *, int, | ||
316 | void *, size_t); | ||
317 | extern int rio_hw_add_inb_buffer(struct rio_mport *, int, void *); | ||
318 | extern void *rio_hw_get_inb_message(struct rio_mport *, int); | ||
319 | extern int rio_open_inb_mbox(struct rio_mport *, void *, int, int); | ||
320 | extern void rio_close_inb_mbox(struct rio_mport *, int); | ||
321 | extern int rio_open_outb_mbox(struct rio_mport *, void *, int, int); | ||
322 | extern void rio_close_outb_mbox(struct rio_mport *, int); | ||
323 | |||
324 | #endif /* __KERNEL__ */ | ||
325 | #endif /* LINUX_RIO_H */ | ||
diff --git a/include/linux/rio_drv.h b/include/linux/rio_drv.h new file mode 100644 index 000000000000..3bd7cce19e26 --- /dev/null +++ b/include/linux/rio_drv.h | |||
@@ -0,0 +1,469 @@ | |||
1 | /* | ||
2 | * RapidIO driver services | ||
3 | * | ||
4 | * Copyright 2005 MontaVista Software, Inc. | ||
5 | * Matt Porter <mporter@kernel.crashing.org> | ||
6 | * | ||
7 | * This program is free software; you can redistribute it and/or modify it | ||
8 | * under the terms of the GNU General Public License as published by the | ||
9 | * Free Software Foundation; either version 2 of the License, or (at your | ||
10 | * option) any later version. | ||
11 | */ | ||
12 | |||
13 | #ifndef LINUX_RIO_DRV_H | ||
14 | #define LINUX_RIO_DRV_H | ||
15 | |||
16 | #ifdef __KERNEL__ | ||
17 | |||
18 | #include <linux/types.h> | ||
19 | #include <linux/config.h> | ||
20 | #include <linux/ioport.h> | ||
21 | #include <linux/list.h> | ||
22 | #include <linux/errno.h> | ||
23 | #include <linux/device.h> | ||
24 | #include <linux/rio.h> | ||
25 | |||
26 | extern int __rio_local_read_config_32(struct rio_mport *port, u32 offset, | ||
27 | u32 * data); | ||
28 | extern int __rio_local_write_config_32(struct rio_mport *port, u32 offset, | ||
29 | u32 data); | ||
30 | extern int __rio_local_read_config_16(struct rio_mport *port, u32 offset, | ||
31 | u16 * data); | ||
32 | extern int __rio_local_write_config_16(struct rio_mport *port, u32 offset, | ||
33 | u16 data); | ||
34 | extern int __rio_local_read_config_8(struct rio_mport *port, u32 offset, | ||
35 | u8 * data); | ||
36 | extern int __rio_local_write_config_8(struct rio_mport *port, u32 offset, | ||
37 | u8 data); | ||
38 | |||
39 | extern int rio_mport_read_config_32(struct rio_mport *port, u16 destid, | ||
40 | u8 hopcount, u32 offset, u32 * data); | ||
41 | extern int rio_mport_write_config_32(struct rio_mport *port, u16 destid, | ||
42 | u8 hopcount, u32 offset, u32 data); | ||
43 | extern int rio_mport_read_config_16(struct rio_mport *port, u16 destid, | ||
44 | u8 hopcount, u32 offset, u16 * data); | ||
45 | extern int rio_mport_write_config_16(struct rio_mport *port, u16 destid, | ||
46 | u8 hopcount, u32 offset, u16 data); | ||
47 | extern int rio_mport_read_config_8(struct rio_mport *port, u16 destid, | ||
48 | u8 hopcount, u32 offset, u8 * data); | ||
49 | extern int rio_mport_write_config_8(struct rio_mport *port, u16 destid, | ||
50 | u8 hopcount, u32 offset, u8 data); | ||
51 | |||
52 | /** | ||
53 | * rio_local_read_config_32 - Read 32 bits from local configuration space | ||
54 | * @port: Master port | ||
55 | * @offset: Offset into local configuration space | ||
56 | * @data: Pointer to read data into | ||
57 | * | ||
58 | * Reads 32 bits of data from the specified offset within the local | ||
59 | * device's configuration space. | ||
60 | */ | ||
61 | static inline int rio_local_read_config_32(struct rio_mport *port, u32 offset, | ||
62 | u32 * data) | ||
63 | { | ||
64 | return __rio_local_read_config_32(port, offset, data); | ||
65 | } | ||
66 | |||
67 | /** | ||
68 | * rio_local_write_config_32 - Write 32 bits to local configuration space | ||
69 | * @port: Master port | ||
70 | * @offset: Offset into local configuration space | ||
71 | * @data: Data to be written | ||
72 | * | ||
73 | * Writes 32 bits of data to the specified offset within the local | ||
74 | * device's configuration space. | ||
75 | */ | ||
76 | static inline int rio_local_write_config_32(struct rio_mport *port, u32 offset, | ||
77 | u32 data) | ||
78 | { | ||
79 | return __rio_local_write_config_32(port, offset, data); | ||
80 | } | ||
81 | |||
82 | /** | ||
83 | * rio_local_read_config_16 - Read 16 bits from local configuration space | ||
84 | * @port: Master port | ||
85 | * @offset: Offset into local configuration space | ||
86 | * @data: Pointer to read data into | ||
87 | * | ||
88 | * Reads 16 bits of data from the specified offset within the local | ||
89 | * device's configuration space. | ||
90 | */ | ||
91 | static inline int rio_local_read_config_16(struct rio_mport *port, u32 offset, | ||
92 | u16 * data) | ||
93 | { | ||
94 | return __rio_local_read_config_16(port, offset, data); | ||
95 | } | ||
96 | |||
97 | /** | ||
98 | * rio_local_write_config_16 - Write 16 bits to local configuration space | ||
99 | * @port: Master port | ||
100 | * @offset: Offset into local configuration space | ||
101 | * @data: Data to be written | ||
102 | * | ||
103 | * Writes 16 bits of data to the specified offset within the local | ||
104 | * device's configuration space. | ||
105 | */ | ||
106 | |||
107 | static inline int rio_local_write_config_16(struct rio_mport *port, u32 offset, | ||
108 | u16 data) | ||
109 | { | ||
110 | return __rio_local_write_config_16(port, offset, data); | ||
111 | } | ||
112 | |||
113 | /** | ||
114 | * rio_local_read_config_8 - Read 8 bits from local configuration space | ||
115 | * @port: Master port | ||
116 | * @offset: Offset into local configuration space | ||
117 | * @data: Pointer to read data into | ||
118 | * | ||
119 | * Reads 8 bits of data from the specified offset within the local | ||
120 | * device's configuration space. | ||
121 | */ | ||
122 | static inline int rio_local_read_config_8(struct rio_mport *port, u32 offset, | ||
123 | u8 * data) | ||
124 | { | ||
125 | return __rio_local_read_config_8(port, offset, data); | ||
126 | } | ||
127 | |||
128 | /** | ||
129 | * rio_local_write_config_8 - Write 8 bits to local configuration space | ||
130 | * @port: Master port | ||
131 | * @offset: Offset into local configuration space | ||
132 | * @data: Data to be written | ||
133 | * | ||
134 | * Writes 8 bits of data to the specified offset within the local | ||
135 | * device's configuration space. | ||
136 | */ | ||
137 | static inline int rio_local_write_config_8(struct rio_mport *port, u32 offset, | ||
138 | u8 data) | ||
139 | { | ||
140 | return __rio_local_write_config_8(port, offset, data); | ||
141 | } | ||
142 | |||
143 | /** | ||
144 | * rio_read_config_32 - Read 32 bits from configuration space | ||
145 | * @rdev: RIO device | ||
146 | * @offset: Offset into device configuration space | ||
147 | * @data: Pointer to read data into | ||
148 | * | ||
149 | * Reads 32 bits of data from the specified offset within the | ||
150 | * RIO device's configuration space. | ||
151 | */ | ||
152 | static inline int rio_read_config_32(struct rio_dev *rdev, u32 offset, | ||
153 | u32 * data) | ||
154 | { | ||
155 | u8 hopcount = 0xff; | ||
156 | u16 destid = rdev->destid; | ||
157 | |||
158 | if (rdev->rswitch) { | ||
159 | destid = rdev->rswitch->destid; | ||
160 | hopcount = rdev->rswitch->hopcount; | ||
161 | } | ||
162 | |||
163 | return rio_mport_read_config_32(rdev->net->hport, destid, hopcount, | ||
164 | offset, data); | ||
165 | }; | ||
166 | |||
167 | /** | ||
168 | * rio_write_config_32 - Write 32 bits to configuration space | ||
169 | * @rdev: RIO device | ||
170 | * @offset: Offset into device configuration space | ||
171 | * @data: Data to be written | ||
172 | * | ||
173 | * Writes 32 bits of data to the specified offset within the | ||
174 | * RIO device's configuration space. | ||
175 | */ | ||
176 | static inline int rio_write_config_32(struct rio_dev *rdev, u32 offset, | ||
177 | u32 data) | ||
178 | { | ||
179 | u8 hopcount = 0xff; | ||
180 | u16 destid = rdev->destid; | ||
181 | |||
182 | if (rdev->rswitch) { | ||
183 | destid = rdev->rswitch->destid; | ||
184 | hopcount = rdev->rswitch->hopcount; | ||
185 | } | ||
186 | |||
187 | return rio_mport_write_config_32(rdev->net->hport, destid, hopcount, | ||
188 | offset, data); | ||
189 | }; | ||
190 | |||
191 | /** | ||
192 | * rio_read_config_16 - Read 16 bits from configuration space | ||
193 | * @rdev: RIO device | ||
194 | * @offset: Offset into device configuration space | ||
195 | * @data: Pointer to read data into | ||
196 | * | ||
197 | * Reads 16 bits of data from the specified offset within the | ||
198 | * RIO device's configuration space. | ||
199 | */ | ||
200 | static inline int rio_read_config_16(struct rio_dev *rdev, u32 offset, | ||
201 | u16 * data) | ||
202 | { | ||
203 | u8 hopcount = 0xff; | ||
204 | u16 destid = rdev->destid; | ||
205 | |||
206 | if (rdev->rswitch) { | ||
207 | destid = rdev->rswitch->destid; | ||
208 | hopcount = rdev->rswitch->hopcount; | ||
209 | } | ||
210 | |||
211 | return rio_mport_read_config_16(rdev->net->hport, destid, hopcount, | ||
212 | offset, data); | ||
213 | }; | ||
214 | |||
215 | /** | ||
216 | * rio_write_config_16 - Write 16 bits to configuration space | ||
217 | * @rdev: RIO device | ||
218 | * @offset: Offset into device configuration space | ||
219 | * @data: Data to be written | ||
220 | * | ||
221 | * Writes 16 bits of data to the specified offset within the | ||
222 | * RIO device's configuration space. | ||
223 | */ | ||
224 | static inline int rio_write_config_16(struct rio_dev *rdev, u32 offset, | ||
225 | u16 data) | ||
226 | { | ||
227 | u8 hopcount = 0xff; | ||
228 | u16 destid = rdev->destid; | ||
229 | |||
230 | if (rdev->rswitch) { | ||
231 | destid = rdev->rswitch->destid; | ||
232 | hopcount = rdev->rswitch->hopcount; | ||
233 | } | ||
234 | |||
235 | return rio_mport_write_config_16(rdev->net->hport, destid, hopcount, | ||
236 | offset, data); | ||
237 | }; | ||
238 | |||
239 | /** | ||
240 | * rio_read_config_8 - Read 8 bits from configuration space | ||
241 | * @rdev: RIO device | ||
242 | * @offset: Offset into device configuration space | ||
243 | * @data: Pointer to read data into | ||
244 | * | ||
245 | * Reads 8 bits of data from the specified offset within the | ||
246 | * RIO device's configuration space. | ||
247 | */ | ||
248 | static inline int rio_read_config_8(struct rio_dev *rdev, u32 offset, u8 * data) | ||
249 | { | ||
250 | u8 hopcount = 0xff; | ||
251 | u16 destid = rdev->destid; | ||
252 | |||
253 | if (rdev->rswitch) { | ||
254 | destid = rdev->rswitch->destid; | ||
255 | hopcount = rdev->rswitch->hopcount; | ||
256 | } | ||
257 | |||
258 | return rio_mport_read_config_8(rdev->net->hport, destid, hopcount, | ||
259 | offset, data); | ||
260 | }; | ||
261 | |||
262 | /** | ||
263 | * rio_write_config_8 - Write 8 bits to configuration space | ||
264 | * @rdev: RIO device | ||
265 | * @offset: Offset into device configuration space | ||
266 | * @data: Data to be written | ||
267 | * | ||
268 | * Writes 8 bits of data to the specified offset within the | ||
269 | * RIO device's configuration space. | ||
270 | */ | ||
271 | static inline int rio_write_config_8(struct rio_dev *rdev, u32 offset, u8 data) | ||
272 | { | ||
273 | u8 hopcount = 0xff; | ||
274 | u16 destid = rdev->destid; | ||
275 | |||
276 | if (rdev->rswitch) { | ||
277 | destid = rdev->rswitch->destid; | ||
278 | hopcount = rdev->rswitch->hopcount; | ||
279 | } | ||
280 | |||
281 | return rio_mport_write_config_8(rdev->net->hport, destid, hopcount, | ||
282 | offset, data); | ||
283 | }; | ||
284 | |||
285 | extern int rio_mport_send_doorbell(struct rio_mport *mport, u16 destid, | ||
286 | u16 data); | ||
287 | |||
288 | /** | ||
289 | * rio_send_doorbell - Send a doorbell message to a device | ||
290 | * @rdev: RIO device | ||
291 | * @data: Doorbell message data | ||
292 | * | ||
293 | * Send a doorbell message to a RIO device. The doorbell message | ||
294 | * has a 16-bit info field provided by the @data argument. | ||
295 | */ | ||
296 | static inline int rio_send_doorbell(struct rio_dev *rdev, u16 data) | ||
297 | { | ||
298 | return rio_mport_send_doorbell(rdev->net->hport, rdev->destid, data); | ||
299 | }; | ||
300 | |||
301 | /** | ||
302 | * rio_init_mbox_res - Initialize a RIO mailbox resource | ||
303 | * @res: resource struct | ||
304 | * @start: start of mailbox range | ||
305 | * @end: end of mailbox range | ||
306 | * | ||
307 | * This function is used to initialize the fields of a resource | ||
308 | * for use as a mailbox resource. It initializes a range of | ||
309 | * mailboxes using the start and end arguments. | ||
310 | */ | ||
311 | static inline void rio_init_mbox_res(struct resource *res, int start, int end) | ||
312 | { | ||
313 | memset(res, 0, sizeof(struct resource)); | ||
314 | res->start = start; | ||
315 | res->end = end; | ||
316 | res->flags = RIO_RESOURCE_MAILBOX; | ||
317 | } | ||
318 | |||
319 | /** | ||
320 | * rio_init_dbell_res - Initialize a RIO doorbell resource | ||
321 | * @res: resource struct | ||
322 | * @start: start of doorbell range | ||
323 | * @end: end of doorbell range | ||
324 | * | ||
325 | * This function is used to initialize the fields of a resource | ||
326 | * for use as a doorbell resource. It initializes a range of | ||
327 | * doorbell messages using the start and end arguments. | ||
328 | */ | ||
329 | static inline void rio_init_dbell_res(struct resource *res, u16 start, u16 end) | ||
330 | { | ||
331 | memset(res, 0, sizeof(struct resource)); | ||
332 | res->start = start; | ||
333 | res->end = end; | ||
334 | res->flags = RIO_RESOURCE_DOORBELL; | ||
335 | } | ||
336 | |||
337 | /** | ||
338 | * RIO_DEVICE - macro used to describe a specific RIO device | ||
339 | * @vid: the 16 bit RIO vendor ID | ||
340 | * @did: the 16 bit RIO device ID | ||
341 | * | ||
342 | * This macro is used to create a struct rio_device_id that matches a | ||
343 | * specific device. The assembly vendor and assembly device fields | ||
344 | * will be set to %RIO_ANY_ID. | ||
345 | */ | ||
346 | #define RIO_DEVICE(dev,ven) \ | ||
347 | .did = (dev), .vid = (ven), \ | ||
348 | .asm_did = RIO_ANY_ID, .asm_vid = RIO_ANY_ID | ||
349 | |||
350 | /* Mailbox management */ | ||
351 | extern int rio_request_outb_mbox(struct rio_mport *, void *, int, int, | ||
352 | void (*)(struct rio_mport *, void *,int, int)); | ||
353 | extern int rio_release_outb_mbox(struct rio_mport *, int); | ||
354 | |||
355 | /** | ||
356 | * rio_add_outb_message - Add RIO message to an outbound mailbox queue | ||
357 | * @mport: RIO master port containing the outbound queue | ||
358 | * @rdev: RIO device the message is be sent to | ||
359 | * @mbox: The outbound mailbox queue | ||
360 | * @buffer: Pointer to the message buffer | ||
361 | * @len: Length of the message buffer | ||
362 | * | ||
363 | * Adds a RIO message buffer to an outbound mailbox queue for | ||
364 | * transmission. Returns 0 on success. | ||
365 | */ | ||
366 | static inline int rio_add_outb_message(struct rio_mport *mport, | ||
367 | struct rio_dev *rdev, int mbox, | ||
368 | void *buffer, size_t len) | ||
369 | { | ||
370 | return rio_hw_add_outb_message(mport, rdev, mbox, buffer, len); | ||
371 | } | ||
372 | |||
373 | extern int rio_request_inb_mbox(struct rio_mport *, void *, int, int, | ||
374 | void (*)(struct rio_mport *, void *, int, int)); | ||
375 | extern int rio_release_inb_mbox(struct rio_mport *, int); | ||
376 | |||
377 | /** | ||
378 | * rio_add_inb_buffer - Add buffer to an inbound mailbox queue | ||
379 | * @mport: Master port containing the inbound mailbox | ||
380 | * @mbox: The inbound mailbox number | ||
381 | * @buffer: Pointer to the message buffer | ||
382 | * | ||
383 | * Adds a buffer to an inbound mailbox queue for reception. Returns | ||
384 | * 0 on success. | ||
385 | */ | ||
386 | static inline int rio_add_inb_buffer(struct rio_mport *mport, int mbox, | ||
387 | void *buffer) | ||
388 | { | ||
389 | return rio_hw_add_inb_buffer(mport, mbox, buffer); | ||
390 | } | ||
391 | |||
392 | /** | ||
393 | * rio_get_inb_message - Get A RIO message from an inbound mailbox queue | ||
394 | * @mport: Master port containing the inbound mailbox | ||
395 | * @mbox: The inbound mailbox number | ||
396 | * @buffer: Pointer to the message buffer | ||
397 | * | ||
398 | * Get a RIO message from an inbound mailbox queue. Returns 0 on success. | ||
399 | */ | ||
400 | static inline void *rio_get_inb_message(struct rio_mport *mport, int mbox) | ||
401 | { | ||
402 | return rio_hw_get_inb_message(mport, mbox); | ||
403 | } | ||
404 | |||
405 | /* Doorbell management */ | ||
406 | extern int rio_request_inb_dbell(struct rio_mport *, void *, u16, u16, | ||
407 | void (*)(struct rio_mport *, void *, u16, u16, u16)); | ||
408 | extern int rio_release_inb_dbell(struct rio_mport *, u16, u16); | ||
409 | extern struct resource *rio_request_outb_dbell(struct rio_dev *, u16, u16); | ||
410 | extern int rio_release_outb_dbell(struct rio_dev *, struct resource *); | ||
411 | |||
412 | /* Memory region management */ | ||
413 | int rio_claim_resource(struct rio_dev *, int); | ||
414 | int rio_request_regions(struct rio_dev *, char *); | ||
415 | void rio_release_regions(struct rio_dev *); | ||
416 | int rio_request_region(struct rio_dev *, int, char *); | ||
417 | void rio_release_region(struct rio_dev *, int); | ||
418 | |||
419 | /* LDM support */ | ||
420 | int rio_register_driver(struct rio_driver *); | ||
421 | void rio_unregister_driver(struct rio_driver *); | ||
422 | struct rio_dev *rio_dev_get(struct rio_dev *); | ||
423 | void rio_dev_put(struct rio_dev *); | ||
424 | |||
425 | /** | ||
426 | * rio_name - Get the unique RIO device identifier | ||
427 | * @rdev: RIO device | ||
428 | * | ||
429 | * Get the unique RIO device identifier. Returns the device | ||
430 | * identifier string. | ||
431 | */ | ||
432 | static inline char *rio_name(struct rio_dev *rdev) | ||
433 | { | ||
434 | return rdev->dev.bus_id; | ||
435 | } | ||
436 | |||
437 | /** | ||
438 | * rio_get_drvdata - Get RIO driver specific data | ||
439 | * @rdev: RIO device | ||
440 | * | ||
441 | * Get RIO driver specific data. Returns a pointer to the | ||
442 | * driver specific data. | ||
443 | */ | ||
444 | static inline void *rio_get_drvdata(struct rio_dev *rdev) | ||
445 | { | ||
446 | return dev_get_drvdata(&rdev->dev); | ||
447 | } | ||
448 | |||
449 | /** | ||
450 | * rio_set_drvdata - Set RIO driver specific data | ||
451 | * @rdev: RIO device | ||
452 | * @data: Pointer to driver specific data | ||
453 | * | ||
454 | * Set RIO driver specific data. device struct driver data pointer | ||
455 | * is set to the @data argument. | ||
456 | */ | ||
457 | static inline void rio_set_drvdata(struct rio_dev *rdev, void *data) | ||
458 | { | ||
459 | dev_set_drvdata(&rdev->dev, data); | ||
460 | } | ||
461 | |||
462 | /* Misc driver helpers */ | ||
463 | extern u16 rio_local_get_device_id(struct rio_mport *port); | ||
464 | extern struct rio_dev *rio_get_device(u16 vid, u16 did, struct rio_dev *from); | ||
465 | extern struct rio_dev *rio_get_asm(u16 vid, u16 did, u16 asm_vid, u16 asm_did, | ||
466 | struct rio_dev *from); | ||
467 | |||
468 | #endif /* __KERNEL__ */ | ||
469 | #endif /* LINUX_RIO_DRV_H */ | ||
diff --git a/include/linux/rio_ids.h b/include/linux/rio_ids.h new file mode 100644 index 000000000000..919d4e07d54e --- /dev/null +++ b/include/linux/rio_ids.h | |||
@@ -0,0 +1,24 @@ | |||
1 | /* | ||
2 | * RapidIO devices | ||
3 | * | ||
4 | * Copyright 2005 MontaVista Software, Inc. | ||
5 | * Matt Porter <mporter@kernel.crashing.org> | ||
6 | * | ||
7 | * This program is free software; you can redistribute it and/or modify it | ||
8 | * under the terms of the GNU General Public License as published by the | ||
9 | * Free Software Foundation; either version 2 of the License, or (at your | ||
10 | * option) any later version. | ||
11 | */ | ||
12 | |||
13 | #ifndef LINUX_RIO_IDS_H | ||
14 | #define LINUX_RIO_IDS_H | ||
15 | |||
16 | #define RIO_ANY_ID 0xffff | ||
17 | |||
18 | #define RIO_VID_FREESCALE 0x0002 | ||
19 | #define RIO_DID_MPC8560 0x0003 | ||
20 | |||
21 | #define RIO_VID_TUNDRA 0x000d | ||
22 | #define RIO_DID_TSI500 0x0500 | ||
23 | |||
24 | #endif /* LINUX_RIO_IDS_H */ | ||
diff --git a/include/linux/rio_regs.h b/include/linux/rio_regs.h new file mode 100644 index 000000000000..326540f9b54e --- /dev/null +++ b/include/linux/rio_regs.h | |||
@@ -0,0 +1,215 @@ | |||
1 | /* | ||
2 | * RapidIO register definitions | ||
3 | * | ||
4 | * Copyright 2005 MontaVista Software, Inc. | ||
5 | * Matt Porter <mporter@kernel.crashing.org> | ||
6 | * | ||
7 | * This program is free software; you can redistribute it and/or modify it | ||
8 | * under the terms of the GNU General Public License as published by the | ||
9 | * Free Software Foundation; either version 2 of the License, or (at your | ||
10 | * option) any later version. | ||
11 | */ | ||
12 | |||
13 | #ifndef LINUX_RIO_REGS_H | ||
14 | #define LINUX_RIO_REGS_H | ||
15 | |||
16 | /* | ||
17 | * In RapidIO, each device has a 2MB configuration space that is | ||
18 | * accessed via maintenance transactions. Portions of configuration | ||
19 | * space are standardized and/or reserved. | ||
20 | */ | ||
21 | #define RIO_DEV_ID_CAR 0x00 /* [I] Device Identity CAR */ | ||
22 | #define RIO_DEV_INFO_CAR 0x04 /* [I] Device Information CAR */ | ||
23 | #define RIO_ASM_ID_CAR 0x08 /* [I] Assembly Identity CAR */ | ||
24 | #define RIO_ASM_ID_MASK 0xffff0000 /* [I] Asm ID Mask */ | ||
25 | #define RIO_ASM_VEN_ID_MASK 0x0000ffff /* [I] Asm Vend Mask */ | ||
26 | |||
27 | #define RIO_ASM_INFO_CAR 0x0c /* [I] Assembly Information CAR */ | ||
28 | #define RIO_ASM_REV_MASK 0xffff0000 /* [I] Asm Rev Mask */ | ||
29 | #define RIO_EXT_FTR_PTR_MASK 0x0000ffff /* [I] EF_PTR Mask */ | ||
30 | |||
31 | #define RIO_PEF_CAR 0x10 /* [I] Processing Element Features CAR */ | ||
32 | #define RIO_PEF_BRIDGE 0x80000000 /* [I] Bridge */ | ||
33 | #define RIO_PEF_MEMORY 0x40000000 /* [I] MMIO */ | ||
34 | #define RIO_PEF_PROCESSOR 0x20000000 /* [I] Processor */ | ||
35 | #define RIO_PEF_SWITCH 0x10000000 /* [I] Switch */ | ||
36 | #define RIO_PEF_INB_MBOX 0x00f00000 /* [II] Mailboxes */ | ||
37 | #define RIO_PEF_INB_MBOX0 0x00800000 /* [II] Mailbox 0 */ | ||
38 | #define RIO_PEF_INB_MBOX1 0x00400000 /* [II] Mailbox 1 */ | ||
39 | #define RIO_PEF_INB_MBOX2 0x00200000 /* [II] Mailbox 2 */ | ||
40 | #define RIO_PEF_INB_MBOX3 0x00100000 /* [II] Mailbox 3 */ | ||
41 | #define RIO_PEF_INB_DOORBELL 0x00080000 /* [II] Doorbells */ | ||
42 | #define RIO_PEF_CTLS 0x00000010 /* [III] CTLS */ | ||
43 | #define RIO_PEF_EXT_FEATURES 0x00000008 /* [I] EFT_PTR valid */ | ||
44 | #define RIO_PEF_ADDR_66 0x00000004 /* [I] 66 bits */ | ||
45 | #define RIO_PEF_ADDR_50 0x00000002 /* [I] 50 bits */ | ||
46 | #define RIO_PEF_ADDR_34 0x00000001 /* [I] 34 bits */ | ||
47 | |||
48 | #define RIO_SWP_INFO_CAR 0x14 /* [I] Switch Port Information CAR */ | ||
49 | #define RIO_SWP_INFO_PORT_TOTAL_MASK 0x0000ff00 /* [I] Total number of ports */ | ||
50 | #define RIO_SWP_INFO_PORT_NUM_MASK 0x000000ff /* [I] Maintenance transaction port number */ | ||
51 | #define RIO_GET_TOTAL_PORTS(x) ((x & RIO_SWP_INFO_PORT_TOTAL_MASK) >> 8) | ||
52 | |||
53 | #define RIO_SRC_OPS_CAR 0x18 /* [I] Source Operations CAR */ | ||
54 | #define RIO_SRC_OPS_READ 0x00008000 /* [I] Read op */ | ||
55 | #define RIO_SRC_OPS_WRITE 0x00004000 /* [I] Write op */ | ||
56 | #define RIO_SRC_OPS_STREAM_WRITE 0x00002000 /* [I] Str-write op */ | ||
57 | #define RIO_SRC_OPS_WRITE_RESPONSE 0x00001000 /* [I] Write/resp op */ | ||
58 | #define RIO_SRC_OPS_DATA_MSG 0x00000800 /* [II] Data msg op */ | ||
59 | #define RIO_SRC_OPS_DOORBELL 0x00000400 /* [II] Doorbell op */ | ||
60 | #define RIO_SRC_OPS_ATOMIC_TST_SWP 0x00000100 /* [I] Atomic TAS op */ | ||
61 | #define RIO_SRC_OPS_ATOMIC_INC 0x00000080 /* [I] Atomic inc op */ | ||
62 | #define RIO_SRC_OPS_ATOMIC_DEC 0x00000040 /* [I] Atomic dec op */ | ||
63 | #define RIO_SRC_OPS_ATOMIC_SET 0x00000020 /* [I] Atomic set op */ | ||
64 | #define RIO_SRC_OPS_ATOMIC_CLR 0x00000010 /* [I] Atomic clr op */ | ||
65 | #define RIO_SRC_OPS_PORT_WRITE 0x00000004 /* [I] Port-write op */ | ||
66 | |||
67 | #define RIO_DST_OPS_CAR 0x1c /* Destination Operations CAR */ | ||
68 | #define RIO_DST_OPS_READ 0x00008000 /* [I] Read op */ | ||
69 | #define RIO_DST_OPS_WRITE 0x00004000 /* [I] Write op */ | ||
70 | #define RIO_DST_OPS_STREAM_WRITE 0x00002000 /* [I] Str-write op */ | ||
71 | #define RIO_DST_OPS_WRITE_RESPONSE 0x00001000 /* [I] Write/resp op */ | ||
72 | #define RIO_DST_OPS_DATA_MSG 0x00000800 /* [II] Data msg op */ | ||
73 | #define RIO_DST_OPS_DOORBELL 0x00000400 /* [II] Doorbell op */ | ||
74 | #define RIO_DST_OPS_ATOMIC_TST_SWP 0x00000100 /* [I] Atomic TAS op */ | ||
75 | #define RIO_DST_OPS_ATOMIC_INC 0x00000080 /* [I] Atomic inc op */ | ||
76 | #define RIO_DST_OPS_ATOMIC_DEC 0x00000040 /* [I] Atomic dec op */ | ||
77 | #define RIO_DST_OPS_ATOMIC_SET 0x00000020 /* [I] Atomic set op */ | ||
78 | #define RIO_DST_OPS_ATOMIC_CLR 0x00000010 /* [I] Atomic clr op */ | ||
79 | #define RIO_DST_OPS_PORT_WRITE 0x00000004 /* [I] Port-write op */ | ||
80 | |||
81 | #define RIO_OPS_READ 0x00008000 /* [I] Read op */ | ||
82 | #define RIO_OPS_WRITE 0x00004000 /* [I] Write op */ | ||
83 | #define RIO_OPS_STREAM_WRITE 0x00002000 /* [I] Str-write op */ | ||
84 | #define RIO_OPS_WRITE_RESPONSE 0x00001000 /* [I] Write/resp op */ | ||
85 | #define RIO_OPS_DATA_MSG 0x00000800 /* [II] Data msg op */ | ||
86 | #define RIO_OPS_DOORBELL 0x00000400 /* [II] Doorbell op */ | ||
87 | #define RIO_OPS_ATOMIC_TST_SWP 0x00000100 /* [I] Atomic TAS op */ | ||
88 | #define RIO_OPS_ATOMIC_INC 0x00000080 /* [I] Atomic inc op */ | ||
89 | #define RIO_OPS_ATOMIC_DEC 0x00000040 /* [I] Atomic dec op */ | ||
90 | #define RIO_OPS_ATOMIC_SET 0x00000020 /* [I] Atomic set op */ | ||
91 | #define RIO_OPS_ATOMIC_CLR 0x00000010 /* [I] Atomic clr op */ | ||
92 | #define RIO_OPS_PORT_WRITE 0x00000004 /* [I] Port-write op */ | ||
93 | |||
94 | /* 0x20-0x3c *//* Reserved */ | ||
95 | |||
96 | #define RIO_MBOX_CSR 0x40 /* [II] Mailbox CSR */ | ||
97 | #define RIO_MBOX0_AVAIL 0x80000000 /* [II] Mbox 0 avail */ | ||
98 | #define RIO_MBOX0_FULL 0x40000000 /* [II] Mbox 0 full */ | ||
99 | #define RIO_MBOX0_EMPTY 0x20000000 /* [II] Mbox 0 empty */ | ||
100 | #define RIO_MBOX0_BUSY 0x10000000 /* [II] Mbox 0 busy */ | ||
101 | #define RIO_MBOX0_FAIL 0x08000000 /* [II] Mbox 0 fail */ | ||
102 | #define RIO_MBOX0_ERROR 0x04000000 /* [II] Mbox 0 error */ | ||
103 | #define RIO_MBOX1_AVAIL 0x00800000 /* [II] Mbox 1 avail */ | ||
104 | #define RIO_MBOX1_FULL 0x00200000 /* [II] Mbox 1 full */ | ||
105 | #define RIO_MBOX1_EMPTY 0x00200000 /* [II] Mbox 1 empty */ | ||
106 | #define RIO_MBOX1_BUSY 0x00100000 /* [II] Mbox 1 busy */ | ||
107 | #define RIO_MBOX1_FAIL 0x00080000 /* [II] Mbox 1 fail */ | ||
108 | #define RIO_MBOX1_ERROR 0x00040000 /* [II] Mbox 1 error */ | ||
109 | #define RIO_MBOX2_AVAIL 0x00008000 /* [II] Mbox 2 avail */ | ||
110 | #define RIO_MBOX2_FULL 0x00004000 /* [II] Mbox 2 full */ | ||
111 | #define RIO_MBOX2_EMPTY 0x00002000 /* [II] Mbox 2 empty */ | ||
112 | #define RIO_MBOX2_BUSY 0x00001000 /* [II] Mbox 2 busy */ | ||
113 | #define RIO_MBOX2_FAIL 0x00000800 /* [II] Mbox 2 fail */ | ||
114 | #define RIO_MBOX2_ERROR 0x00000400 /* [II] Mbox 2 error */ | ||
115 | #define RIO_MBOX3_AVAIL 0x00000080 /* [II] Mbox 3 avail */ | ||
116 | #define RIO_MBOX3_FULL 0x00000040 /* [II] Mbox 3 full */ | ||
117 | #define RIO_MBOX3_EMPTY 0x00000020 /* [II] Mbox 3 empty */ | ||
118 | #define RIO_MBOX3_BUSY 0x00000010 /* [II] Mbox 3 busy */ | ||
119 | #define RIO_MBOX3_FAIL 0x00000008 /* [II] Mbox 3 fail */ | ||
120 | #define RIO_MBOX3_ERROR 0x00000004 /* [II] Mbox 3 error */ | ||
121 | |||
122 | #define RIO_WRITE_PORT_CSR 0x44 /* [I] Write Port CSR */ | ||
123 | #define RIO_DOORBELL_CSR 0x44 /* [II] Doorbell CSR */ | ||
124 | #define RIO_DOORBELL_AVAIL 0x80000000 /* [II] Doorbell avail */ | ||
125 | #define RIO_DOORBELL_FULL 0x40000000 /* [II] Doorbell full */ | ||
126 | #define RIO_DOORBELL_EMPTY 0x20000000 /* [II] Doorbell empty */ | ||
127 | #define RIO_DOORBELL_BUSY 0x10000000 /* [II] Doorbell busy */ | ||
128 | #define RIO_DOORBELL_FAILED 0x08000000 /* [II] Doorbell failed */ | ||
129 | #define RIO_DOORBELL_ERROR 0x04000000 /* [II] Doorbell error */ | ||
130 | #define RIO_WRITE_PORT_AVAILABLE 0x00000080 /* [I] Write Port Available */ | ||
131 | #define RIO_WRITE_PORT_FULL 0x00000040 /* [I] Write Port Full */ | ||
132 | #define RIO_WRITE_PORT_EMPTY 0x00000020 /* [I] Write Port Empty */ | ||
133 | #define RIO_WRITE_PORT_BUSY 0x00000010 /* [I] Write Port Busy */ | ||
134 | #define RIO_WRITE_PORT_FAILED 0x00000008 /* [I] Write Port Failed */ | ||
135 | #define RIO_WRITE_PORT_ERROR 0x00000004 /* [I] Write Port Error */ | ||
136 | |||
137 | /* 0x48 *//* Reserved */ | ||
138 | |||
139 | #define RIO_PELL_CTRL_CSR 0x4c /* [I] PE Logical Layer Control CSR */ | ||
140 | #define RIO_PELL_ADDR_66 0x00000004 /* [I] 66-bit addr */ | ||
141 | #define RIO_PELL_ADDR_50 0x00000002 /* [I] 50-bit addr */ | ||
142 | #define RIO_PELL_ADDR_34 0x00000001 /* [I] 34-bit addr */ | ||
143 | |||
144 | /* 0x50-0x54 *//* Reserved */ | ||
145 | |||
146 | #define RIO_LCSH_BA 0x58 /* [I] LCS High Base Address */ | ||
147 | #define RIO_LCSL_BA 0x5c /* [I] LCS Base Address */ | ||
148 | |||
149 | #define RIO_DID_CSR 0x60 /* [III] Base Device ID CSR */ | ||
150 | |||
151 | /* 0x64 *//* Reserved */ | ||
152 | |||
153 | #define RIO_HOST_DID_LOCK_CSR 0x68 /* [III] Host Base Device ID Lock CSR */ | ||
154 | #define RIO_COMPONENT_TAG_CSR 0x6c /* [III] Component Tag CSR */ | ||
155 | |||
156 | /* 0x70-0xf8 *//* Reserved */ | ||
157 | /* 0x100-0xfff8 *//* [I] Extended Features Space */ | ||
158 | /* 0x10000-0xfffff8 *//* [I] Implementation-defined Space */ | ||
159 | |||
160 | /* | ||
161 | * Extended Features Space is a configuration space area where | ||
162 | * functionality is mapped into extended feature blocks via a | ||
163 | * singly linked list of extended feature pointers (EFT_PTR). | ||
164 | * | ||
165 | * Each extended feature block can be identified/located in | ||
166 | * Extended Features Space by walking the extended feature | ||
167 | * list starting with the Extended Feature Pointer located | ||
168 | * in the Assembly Information CAR. | ||
169 | * | ||
170 | * Extended Feature Blocks (EFBs) are identified with an assigned | ||
171 | * EFB ID. Extended feature block offsets in the definitions are | ||
172 | * relative to the offset of the EFB within the Extended Features | ||
173 | * Space. | ||
174 | */ | ||
175 | |||
176 | /* Helper macros to parse the Extended Feature Block header */ | ||
177 | #define RIO_EFB_PTR_MASK 0xffff0000 | ||
178 | #define RIO_EFB_ID_MASK 0x0000ffff | ||
179 | #define RIO_GET_BLOCK_PTR(x) ((x & RIO_EFB_PTR_MASK) >> 16) | ||
180 | #define RIO_GET_BLOCK_ID(x) (x & RIO_EFB_ID_MASK) | ||
181 | |||
182 | /* Extended Feature Block IDs */ | ||
183 | #define RIO_EFB_PAR_EP_ID 0x0001 /* [IV] LP/LVDS EP Devices */ | ||
184 | #define RIO_EFB_PAR_EP_REC_ID 0x0002 /* [IV] LP/LVDS EP Recovery Devices */ | ||
185 | #define RIO_EFB_PAR_EP_FREE_ID 0x0003 /* [IV] LP/LVDS EP Free Devices */ | ||
186 | #define RIO_EFB_SER_EP_ID 0x0004 /* [VI] LP/Serial EP Devices */ | ||
187 | #define RIO_EFB_SER_EP_REC_ID 0x0005 /* [VI] LP/Serial EP Recovery Devices */ | ||
188 | #define RIO_EFB_SER_EP_FREE_ID 0x0006 /* [VI] LP/Serial EP Free Devices */ | ||
189 | |||
190 | /* | ||
191 | * Physical 8/16 LP-LVDS | ||
192 | * ID=0x0001, Generic End Point Devices | ||
193 | * ID=0x0002, Generic End Point Devices, software assisted recovery option | ||
194 | * ID=0x0003, Generic End Point Free Devices | ||
195 | * | ||
196 | * Physical LP-Serial | ||
197 | * ID=0x0004, Generic End Point Devices | ||
198 | * ID=0x0005, Generic End Point Devices, software assisted recovery option | ||
199 | * ID=0x0006, Generic End Point Free Devices | ||
200 | */ | ||
201 | #define RIO_PORT_MNT_HEADER 0x0000 | ||
202 | #define RIO_PORT_REQ_CTL_CSR 0x0020 | ||
203 | #define RIO_PORT_RSP_CTL_CSR 0x0024 /* 0x0001/0x0002 */ | ||
204 | #define RIO_PORT_GEN_CTL_CSR 0x003c | ||
205 | #define RIO_PORT_GEN_HOST 0x80000000 | ||
206 | #define RIO_PORT_GEN_MASTER 0x40000000 | ||
207 | #define RIO_PORT_GEN_DISCOVERED 0x20000000 | ||
208 | #define RIO_PORT_N_MNT_REQ_CSR(x) (0x0040 + x*0x20) /* 0x0002 */ | ||
209 | #define RIO_PORT_N_MNT_RSP_CSR(x) (0x0044 + x*0x20) /* 0x0002 */ | ||
210 | #define RIO_PORT_N_ACK_STS_CSR(x) (0x0048 + x*0x20) /* 0x0002 */ | ||
211 | #define RIO_PORT_N_ERR_STS_CSR(x) (0x58 + x*0x20) | ||
212 | #define PORT_N_ERR_STS_PORT_OK 0x00000002 | ||
213 | #define RIO_PORT_N_CTL_CSR(x) (0x5c + x*0x20) | ||
214 | |||
215 | #endif /* LINUX_RIO_REGS_H */ | ||
diff --git a/include/linux/rslib.h b/include/linux/rslib.h index 980c8f74d8dc..ace25acfdc97 100644 --- a/include/linux/rslib.h +++ b/include/linux/rslib.h | |||
@@ -1,15 +1,15 @@ | |||
1 | /* | 1 | /* |
2 | * include/linux/rslib.h | 2 | * include/linux/rslib.h |
3 | * | 3 | * |
4 | * Overview: | 4 | * Overview: |
5 | * Generic Reed Solomon encoder / decoder library | 5 | * Generic Reed Solomon encoder / decoder library |
6 | * | 6 | * |
7 | * Copyright (C) 2004 Thomas Gleixner (tglx@linutronix.de) | 7 | * Copyright (C) 2004 Thomas Gleixner (tglx@linutronix.de) |
8 | * | 8 | * |
9 | * RS code lifted from reed solomon library written by Phil Karn | 9 | * RS code lifted from reed solomon library written by Phil Karn |
10 | * Copyright 2002 Phil Karn, KA9Q | 10 | * Copyright 2002 Phil Karn, KA9Q |
11 | * | 11 | * |
12 | * $Id: rslib.h,v 1.3 2004/10/05 22:08:22 gleixner Exp $ | 12 | * $Id: rslib.h,v 1.4 2005/11/07 11:14:52 gleixner Exp $ |
13 | * | 13 | * |
14 | * This program is free software; you can redistribute it and/or modify | 14 | * This program is free software; you can redistribute it and/or modify |
15 | * it under the terms of the GNU General Public License version 2 as | 15 | * it under the terms of the GNU General Public License version 2 as |
@@ -21,20 +21,20 @@ | |||
21 | 21 | ||
22 | #include <linux/list.h> | 22 | #include <linux/list.h> |
23 | 23 | ||
24 | /** | 24 | /** |
25 | * struct rs_control - rs control structure | 25 | * struct rs_control - rs control structure |
26 | * | 26 | * |
27 | * @mm: Bits per symbol | 27 | * @mm: Bits per symbol |
28 | * @nn: Symbols per block (= (1<<mm)-1) | 28 | * @nn: Symbols per block (= (1<<mm)-1) |
29 | * @alpha_to: log lookup table | 29 | * @alpha_to: log lookup table |
30 | * @index_of: Antilog lookup table | 30 | * @index_of: Antilog lookup table |
31 | * @genpoly: Generator polynomial | 31 | * @genpoly: Generator polynomial |
32 | * @nroots: Number of generator roots = number of parity symbols | 32 | * @nroots: Number of generator roots = number of parity symbols |
33 | * @fcr: First consecutive root, index form | 33 | * @fcr: First consecutive root, index form |
34 | * @prim: Primitive element, index form | 34 | * @prim: Primitive element, index form |
35 | * @iprim: prim-th root of 1, index form | 35 | * @iprim: prim-th root of 1, index form |
36 | * @gfpoly: The primitive generator polynominal | 36 | * @gfpoly: The primitive generator polynominal |
37 | * @users: Users of this structure | 37 | * @users: Users of this structure |
38 | * @list: List entry for the rs control list | 38 | * @list: List entry for the rs control list |
39 | */ | 39 | */ |
40 | struct rs_control { | 40 | struct rs_control { |
@@ -58,7 +58,7 @@ int encode_rs8(struct rs_control *rs, uint8_t *data, int len, uint16_t *par, | |||
58 | uint16_t invmsk); | 58 | uint16_t invmsk); |
59 | #endif | 59 | #endif |
60 | #ifdef CONFIG_REED_SOLOMON_DEC8 | 60 | #ifdef CONFIG_REED_SOLOMON_DEC8 |
61 | int decode_rs8(struct rs_control *rs, uint8_t *data, uint16_t *par, int len, | 61 | int decode_rs8(struct rs_control *rs, uint8_t *data, uint16_t *par, int len, |
62 | uint16_t *s, int no_eras, int *eras_pos, uint16_t invmsk, | 62 | uint16_t *s, int no_eras, int *eras_pos, uint16_t invmsk, |
63 | uint16_t *corr); | 63 | uint16_t *corr); |
64 | #endif | 64 | #endif |
@@ -75,7 +75,7 @@ int decode_rs16(struct rs_control *rs, uint16_t *data, uint16_t *par, int len, | |||
75 | #endif | 75 | #endif |
76 | 76 | ||
77 | /* Create or get a matching rs control structure */ | 77 | /* Create or get a matching rs control structure */ |
78 | struct rs_control *init_rs(int symsize, int gfpoly, int fcr, int prim, | 78 | struct rs_control *init_rs(int symsize, int gfpoly, int fcr, int prim, |
79 | int nroots); | 79 | int nroots); |
80 | 80 | ||
81 | /* Release a rs control structure */ | 81 | /* Release a rs control structure */ |
@@ -87,9 +87,9 @@ void free_rs(struct rs_control *rs); | |||
87 | * @x: the value to reduce | 87 | * @x: the value to reduce |
88 | * | 88 | * |
89 | * where | 89 | * where |
90 | * rs->mm = number of bits per symbol | 90 | * rs->mm = number of bits per symbol |
91 | * rs->nn = (2^rs->mm) - 1 | 91 | * rs->nn = (2^rs->mm) - 1 |
92 | * | 92 | * |
93 | * Simple arithmetic modulo would return a wrong result for values | 93 | * Simple arithmetic modulo would return a wrong result for values |
94 | * >= 3 * rs->nn | 94 | * >= 3 * rs->nn |
95 | */ | 95 | */ |
diff --git a/include/linux/sem.h b/include/linux/sem.h index 106f9757339a..3c1f1120fe88 100644 --- a/include/linux/sem.h +++ b/include/linux/sem.h | |||
@@ -79,6 +79,8 @@ struct seminfo { | |||
79 | 79 | ||
80 | #ifdef __KERNEL__ | 80 | #ifdef __KERNEL__ |
81 | 81 | ||
82 | struct task_struct; | ||
83 | |||
82 | /* One semaphore structure for each semaphore in the system. */ | 84 | /* One semaphore structure for each semaphore in the system. */ |
83 | struct sem { | 85 | struct sem { |
84 | int semval; /* current value */ | 86 | int semval; /* current value */ |
diff --git a/include/linux/shm.h b/include/linux/shm.h index 80113a1f60bc..a2c896ad0bef 100644 --- a/include/linux/shm.h +++ b/include/linux/shm.h | |||
@@ -92,6 +92,7 @@ struct shmid_kernel /* private to the kernel */ | |||
92 | #define SHM_DEST 01000 /* segment will be destroyed on last detach */ | 92 | #define SHM_DEST 01000 /* segment will be destroyed on last detach */ |
93 | #define SHM_LOCKED 02000 /* segment will not be swapped */ | 93 | #define SHM_LOCKED 02000 /* segment will not be swapped */ |
94 | #define SHM_HUGETLB 04000 /* segment will use huge TLB pages */ | 94 | #define SHM_HUGETLB 04000 /* segment will use huge TLB pages */ |
95 | #define SHM_NORESERVE 010000 /* don't check for reservations */ | ||
95 | 96 | ||
96 | #ifdef CONFIG_SYSVIPC | 97 | #ifdef CONFIG_SYSVIPC |
97 | long do_shmat(int shmid, char __user *shmaddr, int shmflg, unsigned long *addr); | 98 | long do_shmat(int shmid, char __user *shmaddr, int shmflg, unsigned long *addr); |
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index 4286d832166f..fdfb8fe8c38c 100644 --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h | |||
@@ -603,23 +603,23 @@ static inline void skb_queue_head_init(struct sk_buff_head *list) | |||
603 | */ | 603 | */ |
604 | 604 | ||
605 | /** | 605 | /** |
606 | * __skb_queue_head - queue a buffer at the list head | 606 | * __skb_queue_after - queue a buffer at the list head |
607 | * @list: list to use | 607 | * @list: list to use |
608 | * @prev: place after this buffer | ||
608 | * @newsk: buffer to queue | 609 | * @newsk: buffer to queue |
609 | * | 610 | * |
610 | * Queue a buffer at the start of a list. This function takes no locks | 611 | * Queue a buffer int the middle of a list. This function takes no locks |
611 | * and you must therefore hold required locks before calling it. | 612 | * and you must therefore hold required locks before calling it. |
612 | * | 613 | * |
613 | * A buffer cannot be placed on two lists at the same time. | 614 | * A buffer cannot be placed on two lists at the same time. |
614 | */ | 615 | */ |
615 | extern void skb_queue_head(struct sk_buff_head *list, struct sk_buff *newsk); | 616 | static inline void __skb_queue_after(struct sk_buff_head *list, |
616 | static inline void __skb_queue_head(struct sk_buff_head *list, | 617 | struct sk_buff *prev, |
617 | struct sk_buff *newsk) | 618 | struct sk_buff *newsk) |
618 | { | 619 | { |
619 | struct sk_buff *prev, *next; | 620 | struct sk_buff *next; |
620 | |||
621 | list->qlen++; | 621 | list->qlen++; |
622 | prev = (struct sk_buff *)list; | 622 | |
623 | next = prev->next; | 623 | next = prev->next; |
624 | newsk->next = next; | 624 | newsk->next = next; |
625 | newsk->prev = prev; | 625 | newsk->prev = prev; |
@@ -627,6 +627,23 @@ static inline void __skb_queue_head(struct sk_buff_head *list, | |||
627 | } | 627 | } |
628 | 628 | ||
629 | /** | 629 | /** |
630 | * __skb_queue_head - queue a buffer at the list head | ||
631 | * @list: list to use | ||
632 | * @newsk: buffer to queue | ||
633 | * | ||
634 | * Queue a buffer at the start of a list. This function takes no locks | ||
635 | * and you must therefore hold required locks before calling it. | ||
636 | * | ||
637 | * A buffer cannot be placed on two lists at the same time. | ||
638 | */ | ||
639 | extern void skb_queue_head(struct sk_buff_head *list, struct sk_buff *newsk); | ||
640 | static inline void __skb_queue_head(struct sk_buff_head *list, | ||
641 | struct sk_buff *newsk) | ||
642 | { | ||
643 | __skb_queue_after(list, (struct sk_buff *)list, newsk); | ||
644 | } | ||
645 | |||
646 | /** | ||
630 | * __skb_queue_tail - queue a buffer at the list tail | 647 | * __skb_queue_tail - queue a buffer at the list tail |
631 | * @list: list to use | 648 | * @list: list to use |
632 | * @newsk: buffer to queue | 649 | * @newsk: buffer to queue |
@@ -1203,6 +1220,11 @@ static inline void kunmap_skb_frag(void *vaddr) | |||
1203 | prefetch(skb->next), (skb != (struct sk_buff *)(queue)); \ | 1220 | prefetch(skb->next), (skb != (struct sk_buff *)(queue)); \ |
1204 | skb = skb->next) | 1221 | skb = skb->next) |
1205 | 1222 | ||
1223 | #define skb_queue_reverse_walk(queue, skb) \ | ||
1224 | for (skb = (queue)->prev; \ | ||
1225 | prefetch(skb->prev), (skb != (struct sk_buff *)(queue)); \ | ||
1226 | skb = skb->prev) | ||
1227 | |||
1206 | 1228 | ||
1207 | extern struct sk_buff *skb_recv_datagram(struct sock *sk, unsigned flags, | 1229 | extern struct sk_buff *skb_recv_datagram(struct sock *sk, unsigned flags, |
1208 | int noblock, int *err); | 1230 | int noblock, int *err); |
diff --git a/include/linux/slab.h b/include/linux/slab.h index 09b9aa60063d..d1ea4051b996 100644 --- a/include/linux/slab.h +++ b/include/linux/slab.h | |||
@@ -9,7 +9,7 @@ | |||
9 | 9 | ||
10 | #if defined(__KERNEL__) | 10 | #if defined(__KERNEL__) |
11 | 11 | ||
12 | typedef struct kmem_cache_s kmem_cache_t; | 12 | typedef struct kmem_cache kmem_cache_t; |
13 | 13 | ||
14 | #include <linux/config.h> /* kmalloc_sizes.h needs CONFIG_ options */ | 14 | #include <linux/config.h> /* kmalloc_sizes.h needs CONFIG_ options */ |
15 | #include <linux/gfp.h> | 15 | #include <linux/gfp.h> |
diff --git a/include/linux/sunrpc/svc.h b/include/linux/sunrpc/svc.h index 5af8800e0ce3..e4086ec8b952 100644 --- a/include/linux/sunrpc/svc.h +++ b/include/linux/sunrpc/svc.h | |||
@@ -171,7 +171,8 @@ xdr_argsize_check(struct svc_rqst *rqstp, u32 *p) | |||
171 | { | 171 | { |
172 | char *cp = (char *)p; | 172 | char *cp = (char *)p; |
173 | struct kvec *vec = &rqstp->rq_arg.head[0]; | 173 | struct kvec *vec = &rqstp->rq_arg.head[0]; |
174 | return cp - (char*)vec->iov_base <= vec->iov_len; | 174 | return cp >= (char*)vec->iov_base |
175 | && cp <= (char*)vec->iov_base + vec->iov_len; | ||
175 | } | 176 | } |
176 | 177 | ||
177 | static inline int | 178 | static inline int |
diff --git a/include/linux/superhyway.h b/include/linux/superhyway.h index c906c5a0aaef..17ea468fa362 100644 --- a/include/linux/superhyway.h +++ b/include/linux/superhyway.h | |||
@@ -19,7 +19,7 @@ | |||
19 | */ | 19 | */ |
20 | #define SUPERHYWAY_DEVICE_ID_SH5_DMAC 0x0183 | 20 | #define SUPERHYWAY_DEVICE_ID_SH5_DMAC 0x0183 |
21 | 21 | ||
22 | struct vcr_info { | 22 | struct superhyway_vcr_info { |
23 | u8 perr_flags; /* P-port Error flags */ | 23 | u8 perr_flags; /* P-port Error flags */ |
24 | u8 merr_flags; /* Module Error flags */ | 24 | u8 merr_flags; /* Module Error flags */ |
25 | u16 mod_vers; /* Module Version */ | 25 | u16 mod_vers; /* Module Version */ |
@@ -28,6 +28,17 @@ struct vcr_info { | |||
28 | u8 top_mb; /* Top Memory block */ | 28 | u8 top_mb; /* Top Memory block */ |
29 | }; | 29 | }; |
30 | 30 | ||
31 | struct superhyway_ops { | ||
32 | int (*read_vcr)(unsigned long base, struct superhyway_vcr_info *vcr); | ||
33 | int (*write_vcr)(unsigned long base, struct superhyway_vcr_info vcr); | ||
34 | }; | ||
35 | |||
36 | struct superhyway_bus { | ||
37 | struct superhyway_ops *ops; | ||
38 | }; | ||
39 | |||
40 | extern struct superhyway_bus superhyway_channels[]; | ||
41 | |||
31 | struct superhyway_device_id { | 42 | struct superhyway_device_id { |
32 | unsigned int id; | 43 | unsigned int id; |
33 | unsigned long driver_data; | 44 | unsigned long driver_data; |
@@ -55,9 +66,11 @@ struct superhyway_device { | |||
55 | 66 | ||
56 | struct superhyway_device_id id; | 67 | struct superhyway_device_id id; |
57 | struct superhyway_driver *drv; | 68 | struct superhyway_driver *drv; |
69 | struct superhyway_bus *bus; | ||
58 | 70 | ||
59 | struct resource resource; | 71 | int num_resources; |
60 | struct vcr_info vcr; | 72 | struct resource *resource; |
73 | struct superhyway_vcr_info vcr; | ||
61 | }; | 74 | }; |
62 | 75 | ||
63 | #define to_superhyway_device(d) container_of((d), struct superhyway_device, dev) | 76 | #define to_superhyway_device(d) container_of((d), struct superhyway_device, dev) |
@@ -65,12 +78,27 @@ struct superhyway_device { | |||
65 | #define superhyway_get_drvdata(d) dev_get_drvdata(&(d)->dev) | 78 | #define superhyway_get_drvdata(d) dev_get_drvdata(&(d)->dev) |
66 | #define superhyway_set_drvdata(d,p) dev_set_drvdata(&(d)->dev, (p)) | 79 | #define superhyway_set_drvdata(d,p) dev_set_drvdata(&(d)->dev, (p)) |
67 | 80 | ||
68 | extern int superhyway_scan_bus(void); | 81 | static inline int |
82 | superhyway_read_vcr(struct superhyway_device *dev, unsigned long base, | ||
83 | struct superhyway_vcr_info *vcr) | ||
84 | { | ||
85 | return dev->bus->ops->read_vcr(base, vcr); | ||
86 | } | ||
87 | |||
88 | static inline int | ||
89 | superhyway_write_vcr(struct superhyway_device *dev, unsigned long base, | ||
90 | struct superhyway_vcr_info vcr) | ||
91 | { | ||
92 | return dev->bus->ops->write_vcr(base, vcr); | ||
93 | } | ||
94 | |||
95 | extern int superhyway_scan_bus(struct superhyway_bus *); | ||
69 | 96 | ||
70 | /* drivers/sh/superhyway/superhyway.c */ | 97 | /* drivers/sh/superhyway/superhyway.c */ |
71 | int superhyway_register_driver(struct superhyway_driver *); | 98 | int superhyway_register_driver(struct superhyway_driver *); |
72 | void superhyway_unregister_driver(struct superhyway_driver *); | 99 | void superhyway_unregister_driver(struct superhyway_driver *); |
73 | int superhyway_add_device(unsigned int, unsigned long, unsigned long long); | 100 | int superhyway_add_device(unsigned long base, struct superhyway_device *, struct superhyway_bus *); |
101 | int superhyway_add_devices(struct superhyway_bus *bus, struct superhyway_device **devices, int nr_devices); | ||
74 | 102 | ||
75 | /* drivers/sh/superhyway/superhyway-sysfs.c */ | 103 | /* drivers/sh/superhyway/superhyway-sysfs.c */ |
76 | extern struct device_attribute superhyway_dev_attrs[]; | 104 | extern struct device_attribute superhyway_dev_attrs[]; |
diff --git a/include/linux/wait.h b/include/linux/wait.h index d38c9fecdc36..d28518236b62 100644 --- a/include/linux/wait.h +++ b/include/linux/wait.h | |||
@@ -54,6 +54,7 @@ struct __wait_queue_head { | |||
54 | }; | 54 | }; |
55 | typedef struct __wait_queue_head wait_queue_head_t; | 55 | typedef struct __wait_queue_head wait_queue_head_t; |
56 | 56 | ||
57 | struct task_struct; | ||
57 | 58 | ||
58 | /* | 59 | /* |
59 | * Macros for declaration and initialisaton of the datatypes | 60 | * Macros for declaration and initialisaton of the datatypes |
diff --git a/include/mtd/inftl-user.h b/include/mtd/inftl-user.h index bda4f2c8f728..9b1e2526b45e 100644 --- a/include/mtd/inftl-user.h +++ b/include/mtd/inftl-user.h | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * $Id: inftl-user.h,v 1.1 2004/05/05 15:17:00 dwmw2 Exp $ | 2 | * $Id: inftl-user.h,v 1.2 2005/11/07 11:14:56 gleixner Exp $ |
3 | * | 3 | * |
4 | * Parts of INFTL headers shared with userspace | 4 | * Parts of INFTL headers shared with userspace |
5 | * | 5 | * |
6 | */ | 6 | */ |
7 | 7 | ||
diff --git a/include/mtd/mtd-abi.h b/include/mtd/mtd-abi.h index 428d9122940b..b5994ea56a5a 100644 --- a/include/mtd/mtd-abi.h +++ b/include/mtd/mtd-abi.h | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * $Id: mtd-abi.h,v 1.11 2005/05/19 16:08:58 gleixner Exp $ | 2 | * $Id: mtd-abi.h,v 1.13 2005/11/07 11:14:56 gleixner Exp $ |
3 | * | 3 | * |
4 | * Portions of MTD ABI definition which are shared by kernel and user space | 4 | * Portions of MTD ABI definition which are shared by kernel and user space |
5 | */ | 5 | */ |
6 | 6 | ||
7 | #ifndef __MTD_ABI_H__ | 7 | #ifndef __MTD_ABI_H__ |
@@ -42,6 +42,7 @@ struct mtd_oob_buf { | |||
42 | #define MTD_OOB 64 // Out-of-band data (NAND flash) | 42 | #define MTD_OOB 64 // Out-of-band data (NAND flash) |
43 | #define MTD_ECC 128 // Device capable of automatic ECC | 43 | #define MTD_ECC 128 // Device capable of automatic ECC |
44 | #define MTD_NO_VIRTBLOCKS 256 // Virtual blocks not allowed | 44 | #define MTD_NO_VIRTBLOCKS 256 // Virtual blocks not allowed |
45 | #define MTD_PROGRAM_REGIONS 512 // Configurable Programming Regions | ||
45 | 46 | ||
46 | // Some common devices / combinations of capabilities | 47 | // Some common devices / combinations of capabilities |
47 | #define MTD_CAP_ROM 0 | 48 | #define MTD_CAP_ROM 0 |
@@ -80,7 +81,7 @@ struct mtd_info_user { | |||
80 | }; | 81 | }; |
81 | 82 | ||
82 | struct region_info_user { | 83 | struct region_info_user { |
83 | uint32_t offset; /* At which this region starts, | 84 | uint32_t offset; /* At which this region starts, |
84 | * from the beginning of the MTD */ | 85 | * from the beginning of the MTD */ |
85 | uint32_t erasesize; /* For this region */ | 86 | uint32_t erasesize; /* For this region */ |
86 | uint32_t numblocks; /* Number of blocks in this region */ | 87 | uint32_t numblocks; /* Number of blocks in this region */ |
diff --git a/include/mtd/nftl-user.h b/include/mtd/nftl-user.h index 924ec0459e9c..b2bca18e7311 100644 --- a/include/mtd/nftl-user.h +++ b/include/mtd/nftl-user.h | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * $Id: nftl-user.h,v 1.1 2004/05/05 14:44:57 dwmw2 Exp $ | 2 | * $Id: nftl-user.h,v 1.2 2005/11/07 11:14:56 gleixner Exp $ |
3 | * | 3 | * |
4 | * Parts of NFTL headers shared with userspace | 4 | * Parts of NFTL headers shared with userspace |
5 | * | 5 | * |
6 | */ | 6 | */ |
7 | 7 | ||
diff --git a/include/net/inet_ecn.h b/include/net/inet_ecn.h index f87845e2e965..b0c47e2eccf1 100644 --- a/include/net/inet_ecn.h +++ b/include/net/inet_ecn.h | |||
@@ -2,6 +2,7 @@ | |||
2 | #define _INET_ECN_H_ | 2 | #define _INET_ECN_H_ |
3 | 3 | ||
4 | #include <linux/ip.h> | 4 | #include <linux/ip.h> |
5 | #include <linux/skbuff.h> | ||
5 | #include <net/dsfield.h> | 6 | #include <net/dsfield.h> |
6 | 7 | ||
7 | enum { | 8 | enum { |
@@ -48,7 +49,7 @@ static inline __u8 INET_ECN_encapsulate(__u8 outer, __u8 inner) | |||
48 | (label) |= __constant_htons(INET_ECN_ECT_0 << 4); \ | 49 | (label) |= __constant_htons(INET_ECN_ECT_0 << 4); \ |
49 | } while (0) | 50 | } while (0) |
50 | 51 | ||
51 | static inline void IP_ECN_set_ce(struct iphdr *iph) | 52 | static inline int IP_ECN_set_ce(struct iphdr *iph) |
52 | { | 53 | { |
53 | u32 check = iph->check; | 54 | u32 check = iph->check; |
54 | u32 ecn = (iph->tos + 1) & INET_ECN_MASK; | 55 | u32 ecn = (iph->tos + 1) & INET_ECN_MASK; |
@@ -61,7 +62,7 @@ static inline void IP_ECN_set_ce(struct iphdr *iph) | |||
61 | * INET_ECN_CE => 00 | 62 | * INET_ECN_CE => 00 |
62 | */ | 63 | */ |
63 | if (!(ecn & 2)) | 64 | if (!(ecn & 2)) |
64 | return; | 65 | return !ecn; |
65 | 66 | ||
66 | /* | 67 | /* |
67 | * The following gives us: | 68 | * The following gives us: |
@@ -72,6 +73,7 @@ static inline void IP_ECN_set_ce(struct iphdr *iph) | |||
72 | 73 | ||
73 | iph->check = check + (check>=0xFFFF); | 74 | iph->check = check + (check>=0xFFFF); |
74 | iph->tos |= INET_ECN_CE; | 75 | iph->tos |= INET_ECN_CE; |
76 | return 1; | ||
75 | } | 77 | } |
76 | 78 | ||
77 | static inline void IP_ECN_clear(struct iphdr *iph) | 79 | static inline void IP_ECN_clear(struct iphdr *iph) |
@@ -87,11 +89,12 @@ static inline void ipv4_copy_dscp(struct iphdr *outer, struct iphdr *inner) | |||
87 | 89 | ||
88 | struct ipv6hdr; | 90 | struct ipv6hdr; |
89 | 91 | ||
90 | static inline void IP6_ECN_set_ce(struct ipv6hdr *iph) | 92 | static inline int IP6_ECN_set_ce(struct ipv6hdr *iph) |
91 | { | 93 | { |
92 | if (INET_ECN_is_not_ect(ipv6_get_dsfield(iph))) | 94 | if (INET_ECN_is_not_ect(ipv6_get_dsfield(iph))) |
93 | return; | 95 | return 0; |
94 | *(u32*)iph |= htonl(INET_ECN_CE << 20); | 96 | *(u32*)iph |= htonl(INET_ECN_CE << 20); |
97 | return 1; | ||
95 | } | 98 | } |
96 | 99 | ||
97 | static inline void IP6_ECN_clear(struct ipv6hdr *iph) | 100 | static inline void IP6_ECN_clear(struct ipv6hdr *iph) |
@@ -105,4 +108,21 @@ static inline void ipv6_copy_dscp(struct ipv6hdr *outer, struct ipv6hdr *inner) | |||
105 | ipv6_change_dsfield(inner, INET_ECN_MASK, dscp); | 108 | ipv6_change_dsfield(inner, INET_ECN_MASK, dscp); |
106 | } | 109 | } |
107 | 110 | ||
111 | static inline int INET_ECN_set_ce(struct sk_buff *skb) | ||
112 | { | ||
113 | switch (skb->protocol) { | ||
114 | case __constant_htons(ETH_P_IP): | ||
115 | if (skb->nh.raw + sizeof(struct iphdr) <= skb->tail) | ||
116 | return IP_ECN_set_ce(skb->nh.iph); | ||
117 | break; | ||
118 | |||
119 | case __constant_htons(ETH_P_IPV6): | ||
120 | if (skb->nh.raw + sizeof(struct ipv6hdr) <= skb->tail) | ||
121 | return IP6_ECN_set_ce(skb->nh.ipv6h); | ||
122 | break; | ||
123 | } | ||
124 | |||
125 | return 0; | ||
126 | } | ||
127 | |||
108 | #endif | 128 | #endif |
diff --git a/include/net/inet_hashtables.h b/include/net/inet_hashtables.h index f50f95968340..07840baa9341 100644 --- a/include/net/inet_hashtables.h +++ b/include/net/inet_hashtables.h | |||
@@ -125,9 +125,7 @@ struct inet_hashinfo { | |||
125 | rwlock_t lhash_lock ____cacheline_aligned; | 125 | rwlock_t lhash_lock ____cacheline_aligned; |
126 | atomic_t lhash_users; | 126 | atomic_t lhash_users; |
127 | wait_queue_head_t lhash_wait; | 127 | wait_queue_head_t lhash_wait; |
128 | spinlock_t portalloc_lock; | ||
129 | kmem_cache_t *bind_bucket_cachep; | 128 | kmem_cache_t *bind_bucket_cachep; |
130 | int port_rover; | ||
131 | }; | 129 | }; |
132 | 130 | ||
133 | static inline unsigned int inet_ehashfn(const __u32 laddr, const __u16 lport, | 131 | static inline unsigned int inet_ehashfn(const __u32 laddr, const __u16 lport, |
diff --git a/include/net/red.h b/include/net/red.h new file mode 100644 index 000000000000..2ed4358e3295 --- /dev/null +++ b/include/net/red.h | |||
@@ -0,0 +1,325 @@ | |||
1 | #ifndef __NET_SCHED_RED_H | ||
2 | #define __NET_SCHED_RED_H | ||
3 | |||
4 | #include <linux/config.h> | ||
5 | #include <linux/types.h> | ||
6 | #include <net/pkt_sched.h> | ||
7 | #include <net/inet_ecn.h> | ||
8 | #include <net/dsfield.h> | ||
9 | |||
10 | /* Random Early Detection (RED) algorithm. | ||
11 | ======================================= | ||
12 | |||
13 | Source: Sally Floyd and Van Jacobson, "Random Early Detection Gateways | ||
14 | for Congestion Avoidance", 1993, IEEE/ACM Transactions on Networking. | ||
15 | |||
16 | This file codes a "divisionless" version of RED algorithm | ||
17 | as written down in Fig.17 of the paper. | ||
18 | |||
19 | Short description. | ||
20 | ------------------ | ||
21 | |||
22 | When a new packet arrives we calculate the average queue length: | ||
23 | |||
24 | avg = (1-W)*avg + W*current_queue_len, | ||
25 | |||
26 | W is the filter time constant (chosen as 2^(-Wlog)), it controls | ||
27 | the inertia of the algorithm. To allow larger bursts, W should be | ||
28 | decreased. | ||
29 | |||
30 | if (avg > th_max) -> packet marked (dropped). | ||
31 | if (avg < th_min) -> packet passes. | ||
32 | if (th_min < avg < th_max) we calculate probability: | ||
33 | |||
34 | Pb = max_P * (avg - th_min)/(th_max-th_min) | ||
35 | |||
36 | and mark (drop) packet with this probability. | ||
37 | Pb changes from 0 (at avg==th_min) to max_P (avg==th_max). | ||
38 | max_P should be small (not 1), usually 0.01..0.02 is good value. | ||
39 | |||
40 | max_P is chosen as a number, so that max_P/(th_max-th_min) | ||
41 | is a negative power of two in order arithmetics to contain | ||
42 | only shifts. | ||
43 | |||
44 | |||
45 | Parameters, settable by user: | ||
46 | ----------------------------- | ||
47 | |||
48 | qth_min - bytes (should be < qth_max/2) | ||
49 | qth_max - bytes (should be at least 2*qth_min and less limit) | ||
50 | Wlog - bits (<32) log(1/W). | ||
51 | Plog - bits (<32) | ||
52 | |||
53 | Plog is related to max_P by formula: | ||
54 | |||
55 | max_P = (qth_max-qth_min)/2^Plog; | ||
56 | |||
57 | F.e. if qth_max=128K and qth_min=32K, then Plog=22 | ||
58 | corresponds to max_P=0.02 | ||
59 | |||
60 | Scell_log | ||
61 | Stab | ||
62 | |||
63 | Lookup table for log((1-W)^(t/t_ave). | ||
64 | |||
65 | |||
66 | NOTES: | ||
67 | |||
68 | Upper bound on W. | ||
69 | ----------------- | ||
70 | |||
71 | If you want to allow bursts of L packets of size S, | ||
72 | you should choose W: | ||
73 | |||
74 | L + 1 - th_min/S < (1-(1-W)^L)/W | ||
75 | |||
76 | th_min/S = 32 th_min/S = 4 | ||
77 | |||
78 | log(W) L | ||
79 | -1 33 | ||
80 | -2 35 | ||
81 | -3 39 | ||
82 | -4 46 | ||
83 | -5 57 | ||
84 | -6 75 | ||
85 | -7 101 | ||
86 | -8 135 | ||
87 | -9 190 | ||
88 | etc. | ||
89 | */ | ||
90 | |||
91 | #define RED_STAB_SIZE 256 | ||
92 | #define RED_STAB_MASK (RED_STAB_SIZE - 1) | ||
93 | |||
94 | struct red_stats | ||
95 | { | ||
96 | u32 prob_drop; /* Early probability drops */ | ||
97 | u32 prob_mark; /* Early probability marks */ | ||
98 | u32 forced_drop; /* Forced drops, qavg > max_thresh */ | ||
99 | u32 forced_mark; /* Forced marks, qavg > max_thresh */ | ||
100 | u32 pdrop; /* Drops due to queue limits */ | ||
101 | u32 other; /* Drops due to drop() calls */ | ||
102 | u32 backlog; | ||
103 | }; | ||
104 | |||
105 | struct red_parms | ||
106 | { | ||
107 | /* Parameters */ | ||
108 | u32 qth_min; /* Min avg length threshold: A scaled */ | ||
109 | u32 qth_max; /* Max avg length threshold: A scaled */ | ||
110 | u32 Scell_max; | ||
111 | u32 Rmask; /* Cached random mask, see red_rmask */ | ||
112 | u8 Scell_log; | ||
113 | u8 Wlog; /* log(W) */ | ||
114 | u8 Plog; /* random number bits */ | ||
115 | u8 Stab[RED_STAB_SIZE]; | ||
116 | |||
117 | /* Variables */ | ||
118 | int qcount; /* Number of packets since last random | ||
119 | number generation */ | ||
120 | u32 qR; /* Cached random number */ | ||
121 | |||
122 | unsigned long qavg; /* Average queue length: A scaled */ | ||
123 | psched_time_t qidlestart; /* Start of current idle period */ | ||
124 | }; | ||
125 | |||
126 | static inline u32 red_rmask(u8 Plog) | ||
127 | { | ||
128 | return Plog < 32 ? ((1 << Plog) - 1) : ~0UL; | ||
129 | } | ||
130 | |||
131 | static inline void red_set_parms(struct red_parms *p, | ||
132 | u32 qth_min, u32 qth_max, u8 Wlog, u8 Plog, | ||
133 | u8 Scell_log, u8 *stab) | ||
134 | { | ||
135 | /* Reset average queue length, the value is strictly bound | ||
136 | * to the parameters below, reseting hurts a bit but leaving | ||
137 | * it might result in an unreasonable qavg for a while. --TGR | ||
138 | */ | ||
139 | p->qavg = 0; | ||
140 | |||
141 | p->qcount = -1; | ||
142 | p->qth_min = qth_min << Wlog; | ||
143 | p->qth_max = qth_max << Wlog; | ||
144 | p->Wlog = Wlog; | ||
145 | p->Plog = Plog; | ||
146 | p->Rmask = red_rmask(Plog); | ||
147 | p->Scell_log = Scell_log; | ||
148 | p->Scell_max = (255 << Scell_log); | ||
149 | |||
150 | memcpy(p->Stab, stab, sizeof(p->Stab)); | ||
151 | } | ||
152 | |||
153 | static inline int red_is_idling(struct red_parms *p) | ||
154 | { | ||
155 | return !PSCHED_IS_PASTPERFECT(p->qidlestart); | ||
156 | } | ||
157 | |||
158 | static inline void red_start_of_idle_period(struct red_parms *p) | ||
159 | { | ||
160 | PSCHED_GET_TIME(p->qidlestart); | ||
161 | } | ||
162 | |||
163 | static inline void red_end_of_idle_period(struct red_parms *p) | ||
164 | { | ||
165 | PSCHED_SET_PASTPERFECT(p->qidlestart); | ||
166 | } | ||
167 | |||
168 | static inline void red_restart(struct red_parms *p) | ||
169 | { | ||
170 | red_end_of_idle_period(p); | ||
171 | p->qavg = 0; | ||
172 | p->qcount = -1; | ||
173 | } | ||
174 | |||
175 | static inline unsigned long red_calc_qavg_from_idle_time(struct red_parms *p) | ||
176 | { | ||
177 | psched_time_t now; | ||
178 | long us_idle; | ||
179 | int shift; | ||
180 | |||
181 | PSCHED_GET_TIME(now); | ||
182 | us_idle = PSCHED_TDIFF_SAFE(now, p->qidlestart, p->Scell_max); | ||
183 | |||
184 | /* | ||
185 | * The problem: ideally, average length queue recalcultion should | ||
186 | * be done over constant clock intervals. This is too expensive, so | ||
187 | * that the calculation is driven by outgoing packets. | ||
188 | * When the queue is idle we have to model this clock by hand. | ||
189 | * | ||
190 | * SF+VJ proposed to "generate": | ||
191 | * | ||
192 | * m = idletime / (average_pkt_size / bandwidth) | ||
193 | * | ||
194 | * dummy packets as a burst after idle time, i.e. | ||
195 | * | ||
196 | * p->qavg *= (1-W)^m | ||
197 | * | ||
198 | * This is an apparently overcomplicated solution (f.e. we have to | ||
199 | * precompute a table to make this calculation in reasonable time) | ||
200 | * I believe that a simpler model may be used here, | ||
201 | * but it is field for experiments. | ||
202 | */ | ||
203 | |||
204 | shift = p->Stab[(us_idle >> p->Scell_log) & RED_STAB_MASK]; | ||
205 | |||
206 | if (shift) | ||
207 | return p->qavg >> shift; | ||
208 | else { | ||
209 | /* Approximate initial part of exponent with linear function: | ||
210 | * | ||
211 | * (1-W)^m ~= 1-mW + ... | ||
212 | * | ||
213 | * Seems, it is the best solution to | ||
214 | * problem of too coarse exponent tabulation. | ||
215 | */ | ||
216 | us_idle = (p->qavg * us_idle) >> p->Scell_log; | ||
217 | |||
218 | if (us_idle < (p->qavg >> 1)) | ||
219 | return p->qavg - us_idle; | ||
220 | else | ||
221 | return p->qavg >> 1; | ||
222 | } | ||
223 | } | ||
224 | |||
225 | static inline unsigned long red_calc_qavg_no_idle_time(struct red_parms *p, | ||
226 | unsigned int backlog) | ||
227 | { | ||
228 | /* | ||
229 | * NOTE: p->qavg is fixed point number with point at Wlog. | ||
230 | * The formula below is equvalent to floating point | ||
231 | * version: | ||
232 | * | ||
233 | * qavg = qavg*(1-W) + backlog*W; | ||
234 | * | ||
235 | * --ANK (980924) | ||
236 | */ | ||
237 | return p->qavg + (backlog - (p->qavg >> p->Wlog)); | ||
238 | } | ||
239 | |||
240 | static inline unsigned long red_calc_qavg(struct red_parms *p, | ||
241 | unsigned int backlog) | ||
242 | { | ||
243 | if (!red_is_idling(p)) | ||
244 | return red_calc_qavg_no_idle_time(p, backlog); | ||
245 | else | ||
246 | return red_calc_qavg_from_idle_time(p); | ||
247 | } | ||
248 | |||
249 | static inline u32 red_random(struct red_parms *p) | ||
250 | { | ||
251 | return net_random() & p->Rmask; | ||
252 | } | ||
253 | |||
254 | static inline int red_mark_probability(struct red_parms *p, unsigned long qavg) | ||
255 | { | ||
256 | /* The formula used below causes questions. | ||
257 | |||
258 | OK. qR is random number in the interval 0..Rmask | ||
259 | i.e. 0..(2^Plog). If we used floating point | ||
260 | arithmetics, it would be: (2^Plog)*rnd_num, | ||
261 | where rnd_num is less 1. | ||
262 | |||
263 | Taking into account, that qavg have fixed | ||
264 | point at Wlog, and Plog is related to max_P by | ||
265 | max_P = (qth_max-qth_min)/2^Plog; two lines | ||
266 | below have the following floating point equivalent: | ||
267 | |||
268 | max_P*(qavg - qth_min)/(qth_max-qth_min) < rnd/qcount | ||
269 | |||
270 | Any questions? --ANK (980924) | ||
271 | */ | ||
272 | return !(((qavg - p->qth_min) >> p->Wlog) * p->qcount < p->qR); | ||
273 | } | ||
274 | |||
275 | enum { | ||
276 | RED_BELOW_MIN_THRESH, | ||
277 | RED_BETWEEN_TRESH, | ||
278 | RED_ABOVE_MAX_TRESH, | ||
279 | }; | ||
280 | |||
281 | static inline int red_cmp_thresh(struct red_parms *p, unsigned long qavg) | ||
282 | { | ||
283 | if (qavg < p->qth_min) | ||
284 | return RED_BELOW_MIN_THRESH; | ||
285 | else if (qavg >= p->qth_max) | ||
286 | return RED_ABOVE_MAX_TRESH; | ||
287 | else | ||
288 | return RED_BETWEEN_TRESH; | ||
289 | } | ||
290 | |||
291 | enum { | ||
292 | RED_DONT_MARK, | ||
293 | RED_PROB_MARK, | ||
294 | RED_HARD_MARK, | ||
295 | }; | ||
296 | |||
297 | static inline int red_action(struct red_parms *p, unsigned long qavg) | ||
298 | { | ||
299 | switch (red_cmp_thresh(p, qavg)) { | ||
300 | case RED_BELOW_MIN_THRESH: | ||
301 | p->qcount = -1; | ||
302 | return RED_DONT_MARK; | ||
303 | |||
304 | case RED_BETWEEN_TRESH: | ||
305 | if (++p->qcount) { | ||
306 | if (red_mark_probability(p, qavg)) { | ||
307 | p->qcount = 0; | ||
308 | p->qR = red_random(p); | ||
309 | return RED_PROB_MARK; | ||
310 | } | ||
311 | } else | ||
312 | p->qR = red_random(p); | ||
313 | |||
314 | return RED_DONT_MARK; | ||
315 | |||
316 | case RED_ABOVE_MAX_TRESH: | ||
317 | p->qcount = -1; | ||
318 | return RED_HARD_MARK; | ||
319 | } | ||
320 | |||
321 | BUG(); | ||
322 | return RED_DONT_MARK; | ||
323 | } | ||
324 | |||
325 | #endif | ||
diff --git a/include/sound/ac97_codec.h b/include/sound/ac97_codec.h index d11f34832a97..7f0ca79d6c98 100644 --- a/include/sound/ac97_codec.h +++ b/include/sound/ac97_codec.h | |||
@@ -387,15 +387,6 @@ | |||
387 | #define AC97_RATES_MIC_ADC 4 | 387 | #define AC97_RATES_MIC_ADC 4 |
388 | #define AC97_RATES_SPDIF 5 | 388 | #define AC97_RATES_SPDIF 5 |
389 | 389 | ||
390 | /* shared controllers */ | ||
391 | enum { | ||
392 | AC97_SHARED_TYPE_NONE, | ||
393 | AC97_SHARED_TYPE_ICH, | ||
394 | AC97_SHARED_TYPE_ATIIXP, | ||
395 | AC97_SHARED_TYPE_VIA, | ||
396 | AC97_SHARED_TYPES | ||
397 | }; | ||
398 | |||
399 | /* | 390 | /* |
400 | * | 391 | * |
401 | */ | 392 | */ |
@@ -468,7 +459,6 @@ struct _snd_ac97_bus { | |||
468 | unsigned short used_slots[2][4]; /* actually used PCM slots */ | 459 | unsigned short used_slots[2][4]; /* actually used PCM slots */ |
469 | unsigned short pcms_count; /* count of PCMs */ | 460 | unsigned short pcms_count; /* count of PCMs */ |
470 | struct ac97_pcm *pcms; | 461 | struct ac97_pcm *pcms; |
471 | unsigned int shared_type; /* type of shared controller betwen audio and modem */ | ||
472 | ac97_t *codec[4]; | 462 | ac97_t *codec[4]; |
473 | snd_info_entry_t *proc; | 463 | snd_info_entry_t *proc; |
474 | }; | 464 | }; |
diff --git a/include/sound/core.h b/include/sound/core.h index 6d971a4c4ca0..2be65ad2fd83 100644 --- a/include/sound/core.h +++ b/include/sound/core.h | |||
@@ -29,7 +29,6 @@ | |||
29 | #include <linux/pm.h> /* pm_message_t */ | 29 | #include <linux/pm.h> /* pm_message_t */ |
30 | 30 | ||
31 | /* Typedef's */ | 31 | /* Typedef's */ |
32 | typedef struct timespec snd_timestamp_t; | ||
33 | typedef struct sndrv_interval snd_interval_t; | 32 | typedef struct sndrv_interval snd_interval_t; |
34 | typedef enum sndrv_card_type snd_card_type; | 33 | typedef enum sndrv_card_type snd_card_type; |
35 | typedef struct sndrv_xferi snd_xferi_t; | 34 | typedef struct sndrv_xferi snd_xferi_t; |
@@ -256,6 +255,7 @@ typedef struct _snd_minor snd_minor_t; | |||
256 | 255 | ||
257 | /* sound.c */ | 256 | /* sound.c */ |
258 | 257 | ||
258 | extern int snd_major; | ||
259 | extern int snd_ecards_limit; | 259 | extern int snd_ecards_limit; |
260 | 260 | ||
261 | void snd_request_card(int card); | 261 | void snd_request_card(int card); |
@@ -285,39 +285,6 @@ int snd_oss_init_module(void); | |||
285 | 285 | ||
286 | /* memory.c */ | 286 | /* memory.c */ |
287 | 287 | ||
288 | #ifdef CONFIG_SND_DEBUG_MEMORY | ||
289 | void snd_memory_init(void); | ||
290 | void snd_memory_done(void); | ||
291 | int snd_memory_info_init(void); | ||
292 | int snd_memory_info_done(void); | ||
293 | void *snd_hidden_kmalloc(size_t size, gfp_t flags); | ||
294 | void *snd_hidden_kzalloc(size_t size, gfp_t flags); | ||
295 | void *snd_hidden_kcalloc(size_t n, size_t size, gfp_t flags); | ||
296 | void snd_hidden_kfree(const void *obj); | ||
297 | void *snd_hidden_vmalloc(unsigned long size); | ||
298 | void snd_hidden_vfree(void *obj); | ||
299 | char *snd_hidden_kstrdup(const char *s, gfp_t flags); | ||
300 | #define kmalloc(size, flags) snd_hidden_kmalloc(size, flags) | ||
301 | #define kzalloc(size, flags) snd_hidden_kzalloc(size, flags) | ||
302 | #define kcalloc(n, size, flags) snd_hidden_kcalloc(n, size, flags) | ||
303 | #define kfree(obj) snd_hidden_kfree(obj) | ||
304 | #define vmalloc(size) snd_hidden_vmalloc(size) | ||
305 | #define vfree(obj) snd_hidden_vfree(obj) | ||
306 | #define kmalloc_nocheck(size, flags) snd_wrapper_kmalloc(size, flags) | ||
307 | #define vmalloc_nocheck(size) snd_wrapper_vmalloc(size) | ||
308 | #define kfree_nocheck(obj) snd_wrapper_kfree(obj) | ||
309 | #define vfree_nocheck(obj) snd_wrapper_vfree(obj) | ||
310 | #define kstrdup(s, flags) snd_hidden_kstrdup(s, flags) | ||
311 | #else | ||
312 | #define snd_memory_init() /*NOP*/ | ||
313 | #define snd_memory_done() /*NOP*/ | ||
314 | #define snd_memory_info_init() /*NOP*/ | ||
315 | #define snd_memory_info_done() /*NOP*/ | ||
316 | #define kmalloc_nocheck(size, flags) kmalloc(size, flags) | ||
317 | #define vmalloc_nocheck(size) vmalloc(size) | ||
318 | #define kfree_nocheck(obj) kfree(obj) | ||
319 | #define vfree_nocheck(obj) vfree(obj) | ||
320 | #endif | ||
321 | int copy_to_user_fromio(void __user *dst, const volatile void __iomem *src, size_t count); | 288 | int copy_to_user_fromio(void __user *dst, const volatile void __iomem *src, size_t count); |
322 | int copy_from_user_toio(volatile void __iomem *dst, const void __user *src, size_t count); | 289 | int copy_from_user_toio(volatile void __iomem *dst, const void __user *src, size_t count); |
323 | 290 | ||
@@ -373,8 +340,9 @@ unsigned int snd_dma_pointer(unsigned long dma, unsigned int size); | |||
373 | #endif | 340 | #endif |
374 | 341 | ||
375 | /* misc.c */ | 342 | /* misc.c */ |
343 | struct resource; | ||
344 | void release_and_free_resource(struct resource *res); | ||
376 | 345 | ||
377 | int snd_task_name(struct task_struct *task, char *name, size_t size); | ||
378 | #ifdef CONFIG_SND_VERBOSE_PRINTK | 346 | #ifdef CONFIG_SND_VERBOSE_PRINTK |
379 | void snd_verbose_printk(const char *file, int line, const char *format, ...) | 347 | void snd_verbose_printk(const char *file, int line, const char *format, ...) |
380 | __attribute__ ((format (printf, 3, 4))); | 348 | __attribute__ ((format (printf, 3, 4))); |
@@ -429,34 +397,24 @@ void snd_verbose_printd(const char *file, int line, const char *format, ...) | |||
429 | * When CONFIG_SND_DEBUG is not set, the expression is executed but | 397 | * When CONFIG_SND_DEBUG is not set, the expression is executed but |
430 | * not checked. | 398 | * not checked. |
431 | */ | 399 | */ |
432 | #define snd_assert(expr, args...) do {\ | 400 | #define snd_assert(expr, args...) do { \ |
433 | if (unlikely(!(expr))) { \ | 401 | if (unlikely(!(expr))) { \ |
434 | snd_printk(KERN_ERR "BUG? (%s) (called from %p)\n", __ASTRING__(expr), __builtin_return_address(0));\ | 402 | snd_printk(KERN_ERR "BUG? (%s)\n", __ASTRING__(expr)); \ |
435 | args;\ | 403 | dump_stack(); \ |
436 | }\ | 404 | args; \ |
405 | } \ | ||
437 | } while (0) | 406 | } while (0) |
438 | /** | 407 | |
439 | * snd_runtime_check - run-time assertion macro | 408 | #define snd_BUG() do { \ |
440 | * @expr: expression | 409 | snd_printk(KERN_ERR "BUG?\n"); \ |
441 | * @args...: the action | 410 | dump_stack(); \ |
442 | * | ||
443 | * This macro checks the expression in run-time and invokes the commands | ||
444 | * given in the rest arguments if the assertion is failed. | ||
445 | * Unlike snd_assert(), the action commands are executed even if | ||
446 | * CONFIG_SND_DEBUG is not set but without any error messages. | ||
447 | */ | ||
448 | #define snd_runtime_check(expr, args...) do {\ | ||
449 | if (unlikely(!(expr))) { \ | ||
450 | snd_printk(KERN_ERR "ERROR (%s) (called from %p)\n", __ASTRING__(expr), __builtin_return_address(0));\ | ||
451 | args;\ | ||
452 | }\ | ||
453 | } while (0) | 411 | } while (0) |
454 | 412 | ||
455 | #else /* !CONFIG_SND_DEBUG */ | 413 | #else /* !CONFIG_SND_DEBUG */ |
456 | 414 | ||
457 | #define snd_printd(fmt, args...) /* nothing */ | 415 | #define snd_printd(fmt, args...) /* nothing */ |
458 | #define snd_assert(expr, args...) (void)(expr) | 416 | #define snd_assert(expr, args...) (void)(expr) |
459 | #define snd_runtime_check(expr, args...) do { if (!(expr)) { args; } } while (0) | 417 | #define snd_BUG() /* nothing */ |
460 | 418 | ||
461 | #endif /* CONFIG_SND_DEBUG */ | 419 | #endif /* CONFIG_SND_DEBUG */ |
462 | 420 | ||
@@ -473,30 +431,6 @@ void snd_verbose_printd(const char *file, int line, const char *format, ...) | |||
473 | #define snd_printdd(format, args...) /* nothing */ | 431 | #define snd_printdd(format, args...) /* nothing */ |
474 | #endif | 432 | #endif |
475 | 433 | ||
476 | #define snd_BUG() snd_assert(0, ) | ||
477 | |||
478 | |||
479 | static inline void snd_timestamp_now(struct timespec *tstamp, int timespec) | ||
480 | { | ||
481 | struct timeval val; | ||
482 | /* FIXME: use a linear time source */ | ||
483 | do_gettimeofday(&val); | ||
484 | tstamp->tv_sec = val.tv_sec; | ||
485 | tstamp->tv_nsec = val.tv_usec; | ||
486 | if (timespec) | ||
487 | tstamp->tv_nsec *= 1000L; | ||
488 | } | ||
489 | |||
490 | static inline void snd_timestamp_zero(struct timespec *tstamp) | ||
491 | { | ||
492 | tstamp->tv_sec = 0; | ||
493 | tstamp->tv_nsec = 0; | ||
494 | } | ||
495 | |||
496 | static inline int snd_timestamp_null(struct timespec *tstamp) | ||
497 | { | ||
498 | return tstamp->tv_sec == 0 && tstamp->tv_nsec == 0; | ||
499 | } | ||
500 | 434 | ||
501 | #define SNDRV_OSS_VERSION ((3<<16)|(8<<8)|(1<<4)|(0)) /* 3.8.1a */ | 435 | #define SNDRV_OSS_VERSION ((3<<16)|(8<<8)|(1<<4)|(0)) /* 3.8.1a */ |
502 | 436 | ||
diff --git a/include/sound/driver.h b/include/sound/driver.h index 1ec2fae050a6..3f0416ac24d9 100644 --- a/include/sound/driver.h +++ b/include/sound/driver.h | |||
@@ -44,21 +44,4 @@ | |||
44 | 44 | ||
45 | #include <linux/module.h> | 45 | #include <linux/module.h> |
46 | 46 | ||
47 | /* | ||
48 | * ========================================================================== | ||
49 | */ | ||
50 | |||
51 | #ifdef CONFIG_SND_DEBUG_MEMORY | ||
52 | #include <linux/slab.h> | ||
53 | #include <linux/vmalloc.h> | ||
54 | void *snd_wrapper_kmalloc(size_t, gfp_t); | ||
55 | #undef kmalloc | ||
56 | void snd_wrapper_kfree(const void *); | ||
57 | #undef kfree | ||
58 | void *snd_wrapper_vmalloc(size_t); | ||
59 | #undef vmalloc | ||
60 | void snd_wrapper_vfree(void *); | ||
61 | #undef vfree | ||
62 | #endif | ||
63 | |||
64 | #endif /* __SOUND_DRIVER_H */ | 47 | #endif /* __SOUND_DRIVER_H */ |
diff --git a/include/sound/emu10k1.h b/include/sound/emu10k1.h index 46e3c0bf3c94..8411c7ef6f11 100644 --- a/include/sound/emu10k1.h +++ b/include/sound/emu10k1.h | |||
@@ -48,7 +48,8 @@ | |||
48 | 48 | ||
49 | /* FIXME? - according to the OSS driver the EMU10K1 needs a 29 bit DMA mask */ | 49 | /* FIXME? - according to the OSS driver the EMU10K1 needs a 29 bit DMA mask */ |
50 | #define EMU10K1_DMA_MASK 0x7fffffffUL /* 31bit */ | 50 | #define EMU10K1_DMA_MASK 0x7fffffffUL /* 31bit */ |
51 | #define AUDIGY_DMA_MASK 0xffffffffUL /* 32bit */ | 51 | #define AUDIGY_DMA_MASK 0x7fffffffUL /* 31bit FIXME - 32 should work? */ |
52 | /* See ALSA bug #1276 - rlrevell */ | ||
52 | 53 | ||
53 | #define TMEMSIZE 256*1024 | 54 | #define TMEMSIZE 256*1024 |
54 | #define TMEMSIZEREG 4 | 55 | #define TMEMSIZEREG 4 |
diff --git a/include/sound/minors.h b/include/sound/minors.h index b7b0d8309449..a17b5c9961bb 100644 --- a/include/sound/minors.h +++ b/include/sound/minors.h | |||
@@ -27,8 +27,9 @@ | |||
27 | #define SNDRV_MINOR(card, dev) (((card) << 5) | (dev)) | 27 | #define SNDRV_MINOR(card, dev) (((card) << 5) | (dev)) |
28 | 28 | ||
29 | #define SNDRV_MINOR_CONTROL 0 /* 0 - 0 */ | 29 | #define SNDRV_MINOR_CONTROL 0 /* 0 - 0 */ |
30 | #define SNDRV_MINOR_SEQUENCER 1 | 30 | #define SNDRV_MINOR_GLOBAL 1 /* 1 */ |
31 | #define SNDRV_MINOR_TIMER (1+32) | 31 | #define SNDRV_MINOR_SEQUENCER (SNDRV_MINOR_GLOBAL + 0 * 32) |
32 | #define SNDRV_MINOR_TIMER (SNDRV_MINOR_GLOBAL + 1 * 32) | ||
32 | #define SNDRV_MINOR_HWDEP 4 /* 4 - 7 */ | 33 | #define SNDRV_MINOR_HWDEP 4 /* 4 - 7 */ |
33 | #define SNDRV_MINOR_HWDEPS 4 | 34 | #define SNDRV_MINOR_HWDEPS 4 |
34 | #define SNDRV_MINOR_RAWMIDI 8 /* 8 - 15 */ | 35 | #define SNDRV_MINOR_RAWMIDI 8 /* 8 - 15 */ |
@@ -39,12 +40,9 @@ | |||
39 | 40 | ||
40 | #define SNDRV_DEVICE_TYPE_CONTROL SNDRV_MINOR_CONTROL | 41 | #define SNDRV_DEVICE_TYPE_CONTROL SNDRV_MINOR_CONTROL |
41 | #define SNDRV_DEVICE_TYPE_HWDEP SNDRV_MINOR_HWDEP | 42 | #define SNDRV_DEVICE_TYPE_HWDEP SNDRV_MINOR_HWDEP |
42 | #define SNDRV_DEVICE_TYPE_MIXER SNDRV_MINOR_MIXER | ||
43 | #define SNDRV_DEVICE_TYPE_RAWMIDI SNDRV_MINOR_RAWMIDI | 43 | #define SNDRV_DEVICE_TYPE_RAWMIDI SNDRV_MINOR_RAWMIDI |
44 | #define SNDRV_DEVICE_TYPE_PCM_PLAYBACK SNDRV_MINOR_PCM_PLAYBACK | 44 | #define SNDRV_DEVICE_TYPE_PCM_PLAYBACK SNDRV_MINOR_PCM_PLAYBACK |
45 | #define SNDRV_DEVICE_TYPE_PCM_PLOOP SNDRV_MINOR_PCM_PLOOP | ||
46 | #define SNDRV_DEVICE_TYPE_PCM_CAPTURE SNDRV_MINOR_PCM_CAPTURE | 45 | #define SNDRV_DEVICE_TYPE_PCM_CAPTURE SNDRV_MINOR_PCM_CAPTURE |
47 | #define SNDRV_DEVICE_TYPE_PCM_CLOOP SNDRV_MINOR_PCM_CLOOP | ||
48 | #define SNDRV_DEVICE_TYPE_SEQUENCER SNDRV_MINOR_SEQUENCER | 46 | #define SNDRV_DEVICE_TYPE_SEQUENCER SNDRV_MINOR_SEQUENCER |
49 | #define SNDRV_DEVICE_TYPE_TIMER SNDRV_MINOR_TIMER | 47 | #define SNDRV_DEVICE_TYPE_TIMER SNDRV_MINOR_TIMER |
50 | 48 | ||
diff --git a/include/sound/pcm.h b/include/sound/pcm.h index 2b23a5967071..acc4fa9d5abe 100644 --- a/include/sound/pcm.h +++ b/include/sound/pcm.h | |||
@@ -281,7 +281,7 @@ typedef struct { | |||
281 | struct _snd_pcm_runtime { | 281 | struct _snd_pcm_runtime { |
282 | /* -- Status -- */ | 282 | /* -- Status -- */ |
283 | snd_pcm_substream_t *trigger_master; | 283 | snd_pcm_substream_t *trigger_master; |
284 | snd_timestamp_t trigger_tstamp; /* trigger timestamp */ | 284 | struct timespec trigger_tstamp; /* trigger timestamp */ |
285 | int overrange; | 285 | int overrange; |
286 | snd_pcm_uframes_t avail_max; | 286 | snd_pcm_uframes_t avail_max; |
287 | snd_pcm_uframes_t hw_ptr_base; /* Position at buffer restart */ | 287 | snd_pcm_uframes_t hw_ptr_base; /* Position at buffer restart */ |
@@ -306,7 +306,6 @@ struct _snd_pcm_runtime { | |||
306 | unsigned int rate_den; | 306 | unsigned int rate_den; |
307 | 307 | ||
308 | /* -- SW params -- */ | 308 | /* -- SW params -- */ |
309 | int tstamp_timespec; /* use timeval (0) or timespec (1) */ | ||
310 | snd_pcm_tstamp_t tstamp_mode; /* mmap timestamp is updated */ | 309 | snd_pcm_tstamp_t tstamp_mode; /* mmap timestamp is updated */ |
311 | unsigned int period_step; | 310 | unsigned int period_step; |
312 | unsigned int sleep_min; /* min ticks to sleep */ | 311 | unsigned int sleep_min; /* min ticks to sleep */ |
diff --git a/include/sound/timer.h b/include/sound/timer.h index 1898511a0f38..b55f38ae56e1 100644 --- a/include/sound/timer.h +++ b/include/sound/timer.h | |||
@@ -88,6 +88,7 @@ struct _snd_timer_hardware { | |||
88 | struct _snd_timer { | 88 | struct _snd_timer { |
89 | snd_timer_class_t tmr_class; | 89 | snd_timer_class_t tmr_class; |
90 | snd_card_t *card; | 90 | snd_card_t *card; |
91 | struct module *module; | ||
91 | int tmr_device; | 92 | int tmr_device; |
92 | int tmr_subdevice; | 93 | int tmr_subdevice; |
93 | char id[64]; | 94 | char id[64]; |
diff --git a/include/sound/version.h b/include/sound/version.h index ee32af20dba9..d1bd3b723967 100644 --- a/include/sound/version.h +++ b/include/sound/version.h | |||
@@ -1,3 +1,3 @@ | |||
1 | /* include/version.h. Generated by configure. */ | 1 | /* include/version.h. Generated by configure. */ |
2 | #define CONFIG_SND_VERSION "1.0.10rc1" | 2 | #define CONFIG_SND_VERSION "1.0.10rc3" |
3 | #define CONFIG_SND_DATE " (Mon Sep 12 08:13:09 2005 UTC)" | 3 | #define CONFIG_SND_DATE " (Mon Nov 07 13:30:21 2005 UTC)" |