diff options
Diffstat (limited to 'include')
273 files changed, 5098 insertions, 3368 deletions
diff --git a/include/asm-alpha/agp.h b/include/asm-alpha/agp.h index c99dbbb5bcb5..ef855a3bc0f5 100644 --- a/include/asm-alpha/agp.h +++ b/include/asm-alpha/agp.h | |||
@@ -10,4 +10,14 @@ | |||
10 | #define flush_agp_mappings() | 10 | #define flush_agp_mappings() |
11 | #define flush_agp_cache() mb() | 11 | #define flush_agp_cache() mb() |
12 | 12 | ||
13 | /* Convert a physical address to an address suitable for the GART. */ | ||
14 | #define phys_to_gart(x) (x) | ||
15 | #define gart_to_phys(x) (x) | ||
16 | |||
17 | /* GATT allocation. Returns/accepts GATT kernel virtual address. */ | ||
18 | #define alloc_gatt_pages(order) \ | ||
19 | ((char *)__get_free_pages(GFP_KERNEL, (order))) | ||
20 | #define free_gatt_pages(table, order) \ | ||
21 | free_pages((unsigned long)(table), (order)) | ||
22 | |||
13 | #endif | 23 | #endif |
diff --git a/include/asm-alpha/smp.h b/include/asm-alpha/smp.h index cbc173ae45aa..9950706abdf8 100644 --- a/include/asm-alpha/smp.h +++ b/include/asm-alpha/smp.h | |||
@@ -43,7 +43,7 @@ extern struct cpuinfo_alpha cpu_data[NR_CPUS]; | |||
43 | #define PROC_CHANGE_PENALTY 20 | 43 | #define PROC_CHANGE_PENALTY 20 |
44 | 44 | ||
45 | #define hard_smp_processor_id() __hard_smp_processor_id() | 45 | #define hard_smp_processor_id() __hard_smp_processor_id() |
46 | #define smp_processor_id() (current_thread_info()->cpu) | 46 | #define raw_smp_processor_id() (current_thread_info()->cpu) |
47 | 47 | ||
48 | extern cpumask_t cpu_present_mask; | 48 | extern cpumask_t cpu_present_mask; |
49 | extern cpumask_t cpu_online_map; | 49 | extern cpumask_t cpu_online_map; |
diff --git a/include/asm-arm/arch-aaec2000/aaec2000.h b/include/asm-arm/arch-aaec2000/aaec2000.h new file mode 100644 index 000000000000..0e9b7e18af05 --- /dev/null +++ b/include/asm-arm/arch-aaec2000/aaec2000.h | |||
@@ -0,0 +1,151 @@ | |||
1 | /* | ||
2 | * linux/include/asm-arm/arch-aaec2000/aaec2000.h | ||
3 | * | ||
4 | * AAEC-2000 registers definition | ||
5 | * | ||
6 | * Copyright (c) 2005 Nicolas Bellido Y Ortega | ||
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 __ASM_ARCH_AAEC2000_H | ||
14 | #define __ASM_ARCH_AAEC2000_H | ||
15 | |||
16 | #ifndef __ASM_ARCH_HARDWARE_H | ||
17 | #error You must include hardware.h not this file | ||
18 | #endif /* __ASM_ARCH_HARDWARE_H */ | ||
19 | |||
20 | /* Interrupt controller */ | ||
21 | #define IRQ_BASE __REG(0x80000500) | ||
22 | #define IRQ_INTSR __REG(0x80000500) /* Int Status Register */ | ||
23 | #define IRQ_INTRSR __REG(0x80000504) /* Int Raw (unmasked) Status */ | ||
24 | #define IRQ_INTENS __REG(0x80000508) /* Int Enable Set */ | ||
25 | #define IRQ_INTENC __REG(0x8000050c) /* Int Enable Clear */ | ||
26 | |||
27 | /* UART 1 */ | ||
28 | #define UART1_BASE __REG(0x80000600) | ||
29 | #define UART1_DR __REG(0x80000600) /* Data/FIFO Register */ | ||
30 | #define UART1_LCR __REG(0x80000604) /* Link Control Register */ | ||
31 | #define UART1_BRCR __REG(0x80000608) /* Baud Rate Control Register */ | ||
32 | #define UART1_CR __REG(0x8000060c) /* Control Register */ | ||
33 | #define UART1_SR __REG(0x80000610) /* Status Register */ | ||
34 | #define UART1_INT __REG(0x80000614) /* Interrupt Status Register */ | ||
35 | #define UART1_INTM __REG(0x80000618) /* Interrupt Mask Register */ | ||
36 | #define UART1_INTRES __REG(0x8000061c) /* Int Result (masked status) Register */ | ||
37 | |||
38 | /* UART 2 */ | ||
39 | #define UART2_BASE __REG(0x80000700) | ||
40 | #define UART2_DR __REG(0x80000700) /* Data/FIFO Register */ | ||
41 | #define UART2_LCR __REG(0x80000704) /* Link Control Register */ | ||
42 | #define UART2_BRCR __REG(0x80000708) /* Baud Rate Control Register */ | ||
43 | #define UART2_CR __REG(0x8000070c) /* Control Register */ | ||
44 | #define UART2_SR __REG(0x80000710) /* Status Register */ | ||
45 | #define UART2_INT __REG(0x80000714) /* Interrupt Status Register */ | ||
46 | #define UART2_INTM __REG(0x80000718) /* Interrupt Mask Register */ | ||
47 | #define UART2_INTRES __REG(0x8000071c) /* Int Result (masked status) Register */ | ||
48 | |||
49 | /* UART 3 */ | ||
50 | #define UART3_BASE __REG(0x80000800) | ||
51 | #define UART3_DR __REG(0x80000800) /* Data/FIFO Register */ | ||
52 | #define UART3_LCR __REG(0x80000804) /* Link Control Register */ | ||
53 | #define UART3_BRCR __REG(0x80000808) /* Baud Rate Control Register */ | ||
54 | #define UART3_CR __REG(0x8000080c) /* Control Register */ | ||
55 | #define UART3_SR __REG(0x80000810) /* Status Register */ | ||
56 | #define UART3_INT __REG(0x80000814) /* Interrupt Status Register */ | ||
57 | #define UART3_INTM __REG(0x80000818) /* Interrupt Mask Register */ | ||
58 | #define UART3_INTRES __REG(0x8000081c) /* Int Result (masked status) Register */ | ||
59 | |||
60 | /* These are used in some places */ | ||
61 | #define _UART1_BASE __PREG(UART1_BASE) | ||
62 | #define _UART2_BASE __PREG(UART2_BASE) | ||
63 | #define _UART3_BASE __PREG(UART3_BASE) | ||
64 | |||
65 | /* UART Registers Offsets */ | ||
66 | #define UART_DR 0x00 | ||
67 | #define UART_LCR 0x04 | ||
68 | #define UART_BRCR 0x08 | ||
69 | #define UART_CR 0x0c | ||
70 | #define UART_SR 0x10 | ||
71 | #define UART_INT 0x14 | ||
72 | #define UART_INTM 0x18 | ||
73 | #define UART_INTRES 0x1c | ||
74 | |||
75 | /* UART_LCR Bitmask */ | ||
76 | #define UART_LCR_BRK (1 << 0) /* Send Break */ | ||
77 | #define UART_LCR_PEN (1 << 1) /* Parity Enable */ | ||
78 | #define UART_LCR_EP (1 << 2) /* Even/Odd Parity */ | ||
79 | #define UART_LCR_S2 (1 << 3) /* One/Two Stop bits */ | ||
80 | #define UART_LCR_FIFO (1 << 4) /* FIFO Enable */ | ||
81 | #define UART_LCR_WL5 (0 << 5) /* Word Length - 5 bits */ | ||
82 | #define UART_LCR_WL6 (1 << 5) /* Word Length - 6 bits */ | ||
83 | #define UART_LCR_WL7 (1 << 6) /* Word Length - 7 bits */ | ||
84 | #define UART_LCR_WL8 (1 << 7) /* Word Length - 8 bits */ | ||
85 | |||
86 | /* UART_CR Bitmask */ | ||
87 | #define UART_CR_EN (1 << 0) /* UART Enable */ | ||
88 | #define UART_CR_SIR (1 << 1) /* IrDA SIR Enable */ | ||
89 | #define UART_CR_SIRLP (1 << 2) /* Low Power IrDA Enable */ | ||
90 | #define UART_CR_RXP (1 << 3) /* Receive Pin Polarity */ | ||
91 | #define UART_CR_TXP (1 << 4) /* Transmit Pin Polarity */ | ||
92 | #define UART_CR_MXP (1 << 5) /* Modem Pin Polarity */ | ||
93 | #define UART_CR_LOOP (1 << 6) /* Loopback Mode */ | ||
94 | |||
95 | /* UART_SR Bitmask */ | ||
96 | #define UART_SR_CTS (1 << 0) /* Clear To Send Status */ | ||
97 | #define UART_SR_DSR (1 << 1) /* Data Set Ready Status */ | ||
98 | #define UART_SR_DCD (1 << 2) /* Data Carrier Detect Status */ | ||
99 | #define UART_SR_TxBSY (1 << 3) /* Transmitter Busy Status */ | ||
100 | #define UART_SR_RxFE (1 << 4) /* Receive FIFO Empty Status */ | ||
101 | #define UART_SR_TxFF (1 << 5) /* Transmit FIFO Full Status */ | ||
102 | #define UART_SR_RxFF (1 << 6) /* Receive FIFO Full Status */ | ||
103 | #define UART_SR_TxFE (1 << 7) /* Transmit FIFO Empty Status */ | ||
104 | |||
105 | /* UART_INT Bitmask */ | ||
106 | #define UART_INT_RIS (1 << 0) /* Rx Interrupt */ | ||
107 | #define UART_INT_TIS (1 << 1) /* Tx Interrupt */ | ||
108 | #define UART_INT_MIS (1 << 2) /* Modem Interrupt */ | ||
109 | #define UART_INT_RTIS (1 << 3) /* Receive Timeout Interrupt */ | ||
110 | |||
111 | /* Timer 1 */ | ||
112 | #define TIMER1_BASE __REG(0x80000c00) | ||
113 | #define TIMER1_LOAD __REG(0x80000c00) /* Timer 1 Load Register */ | ||
114 | #define TIMER1_VAL __REG(0x80000c04) /* Timer 1 Value Register */ | ||
115 | #define TIMER1_CTRL __REG(0x80000c08) /* Timer 1 Control Register */ | ||
116 | #define TIMER1_CLEAR __REG(0x80000c0c) /* Timer 1 Clear Register */ | ||
117 | |||
118 | /* Timer 2 */ | ||
119 | #define TIMER2_BASE __REG(0x80000d00) | ||
120 | #define TIMER2_LOAD __REG(0x80000d00) /* Timer 2 Load Register */ | ||
121 | #define TIMER2_VAL __REG(0x80000d04) /* Timer 2 Value Register */ | ||
122 | #define TIMER2_CTRL __REG(0x80000d08) /* Timer 2 Control Register */ | ||
123 | #define TIMER2_CLEAR __REG(0x80000d0c) /* Timer 2 Clear Register */ | ||
124 | |||
125 | /* Timer 3 */ | ||
126 | #define TIMER3_BASE __REG(0x80000e00) | ||
127 | #define TIMER3_LOAD __REG(0x80000e00) /* Timer 3 Load Register */ | ||
128 | #define TIMER3_VAL __REG(0x80000e04) /* Timer 3 Value Register */ | ||
129 | #define TIMER3_CTRL __REG(0x80000e08) /* Timer 3 Control Register */ | ||
130 | #define TIMER3_CLEAR __REG(0x80000e0c) /* Timer 3 Clear Register */ | ||
131 | |||
132 | /* Timer Control register bits */ | ||
133 | #define TIMER_CTRL_ENABLE (1 << 7) /* Enable (Start° Timer */ | ||
134 | #define TIMER_CTRL_PERIODIC (1 << 6) /* Periodic Running Mode */ | ||
135 | #define TIMER_CTRL_FREE_RUNNING (0 << 6) /* Normal Running Mode */ | ||
136 | #define TIMER_CTRL_CLKSEL_508K (1 << 3) /* 508KHz Clock select (Timer 1, 2) */ | ||
137 | #define TIMER_CTRL_CLKSEL_2K (0 << 3) /* 2KHz Clock Select (Timer 1, 2)*/ | ||
138 | |||
139 | /* Power and State Control */ | ||
140 | #define POWER_BASE __REG(0x80000400) | ||
141 | #define POWER_PWRSR __REG(0x80000400) /* Power Status Register */ | ||
142 | #define POWER_PWRCNT __REG(0x80000404) /* Power/Clock control */ | ||
143 | #define POWER_HALT __REG(0x80000408) /* Power Idle Mode */ | ||
144 | #define POWER_STDBY __REG(0x8000040c) /* Power Standby Mode */ | ||
145 | #define POWER_BLEOI __REG(0x80000410) /* Battery Low End of Interrupt */ | ||
146 | #define POWER_MCEOI __REG(0x80000414) /* Media Changed EoI */ | ||
147 | #define POWER_TEOI __REG(0x80000418) /* Tick EoI */ | ||
148 | #define POWER_STFCLR __REG(0x8000041c) /* NbFlg, RSTFlg, PFFlg, CLDFlg Clear */ | ||
149 | #define POWER_CLKSET __REG(0x80000420) /* Clock Speed Control */ | ||
150 | |||
151 | #endif /* __ARM_ARCH_AAEC2000_H */ | ||
diff --git a/include/asm-arm/arch-aaec2000/debug-macro.S b/include/asm-arm/arch-aaec2000/debug-macro.S new file mode 100644 index 000000000000..e4f1fa539a74 --- /dev/null +++ b/include/asm-arm/arch-aaec2000/debug-macro.S | |||
@@ -0,0 +1,36 @@ | |||
1 | /* linux/include/asm-arm/arch-aaec2000/debug-macro.S | ||
2 | * | ||
3 | * Debugging macro include header | ||
4 | * | ||
5 | * Copyright (c) 2005 Nicolas Bellido Y Ortega | ||
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 | .macro addruart,rx | ||
13 | mrc p15, 0, \rx, c1, c0 | ||
14 | tst \rx, #1 @ MMU enabled? | ||
15 | moveq \rx, #0x80000000 @ physical | ||
16 | movne \rx, #io_p2v(0x80000000) @ virtual | ||
17 | orr \rx, \rx, #0x00000800 | ||
18 | .endm | ||
19 | |||
20 | .macro senduart,rd,rx | ||
21 | str \rd, [\rx, #0] | ||
22 | .endm | ||
23 | |||
24 | .macro busyuart,rd,rx | ||
25 | 1002: ldr \rd, [\rx, #0x10] | ||
26 | tst \rd, #(1 << 7) | ||
27 | beq 1002b | ||
28 | .endm | ||
29 | |||
30 | .macro waituart,rd,rx | ||
31 | #if 0 | ||
32 | 1001: ldr \rd, [\rx, #0x10] | ||
33 | tst \rd, #(1 << 5) | ||
34 | beq 1001b | ||
35 | #endif | ||
36 | .endm | ||
diff --git a/include/asm-arm/arch-aaec2000/dma.h b/include/asm-arm/arch-aaec2000/dma.h new file mode 100644 index 000000000000..28c890b4a1d3 --- /dev/null +++ b/include/asm-arm/arch-aaec2000/dma.h | |||
@@ -0,0 +1,17 @@ | |||
1 | /* | ||
2 | * linux/include/asm-arm/arch-aaec2000/dma.h | ||
3 | * | ||
4 | * Copyright (c) 2005 Nicolas Bellido Y Ortega | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU General Public License version 2 as | ||
8 | * published by the Free Software Foundation. | ||
9 | */ | ||
10 | |||
11 | #ifndef __ASM_ARCH_DMA_H | ||
12 | #define __ASM_ARCH_DMA_H | ||
13 | |||
14 | #define MAX_DMA_ADDRESS 0xffffffff | ||
15 | #define MAX_DMA_CHANNELS 0 | ||
16 | |||
17 | #endif | ||
diff --git a/include/asm-arm/arch-aaec2000/entry-macro.S b/include/asm-arm/arch-aaec2000/entry-macro.S new file mode 100644 index 000000000000..df31313ab07e --- /dev/null +++ b/include/asm-arm/arch-aaec2000/entry-macro.S | |||
@@ -0,0 +1,33 @@ | |||
1 | /* | ||
2 | * linux/include/asm-arm/arch-aaec2000/entry-macro.S | ||
3 | * | ||
4 | * Low-level IRQ helper for aaec-2000 based platforms | ||
5 | * | ||
6 | * Copyright (c) 2005 Nicolas Bellido Y Ortega | ||
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 | |||
14 | .macro disable_fiq | ||
15 | .endm | ||
16 | |||
17 | .macro get_irqnr_and_base, irqnr, irqstat, base, tmp | ||
18 | mov r4, #0xf8000000 | ||
19 | add r4, r4, #0x00000500 | ||
20 | mov \base, r4 | ||
21 | ldr \irqstat, [\base, #0] | ||
22 | cmp \irqstat, #0 | ||
23 | bne 1001f | ||
24 | ldr \irqnr, =NR_IRQS+1 | ||
25 | b 1003f | ||
26 | 1001: mov \irqnr, #0 | ||
27 | 1002: ands \tmp, \irqstat, #1 | ||
28 | mov \irqstat, \irqstat, LSR #1 | ||
29 | add \irqnr, \irqnr, #1 | ||
30 | beq 1002b | ||
31 | sub \irqnr, \irqnr, #1 | ||
32 | 1003: | ||
33 | .endm | ||
diff --git a/include/asm-arm/arch-aaec2000/hardware.h b/include/asm-arm/arch-aaec2000/hardware.h new file mode 100644 index 000000000000..4c37219e030e --- /dev/null +++ b/include/asm-arm/arch-aaec2000/hardware.h | |||
@@ -0,0 +1,49 @@ | |||
1 | /* | ||
2 | * linux/include/asm-arm/arch-aaec2000/hardware.h | ||
3 | * | ||
4 | * Copyright (c) 2005 Nicolas Bellido Y Ortega | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU General Public License version 2 as | ||
8 | * published by the Free Software Foundation. | ||
9 | */ | ||
10 | |||
11 | #ifndef __ASM_ARCH_HARDWARE_H | ||
12 | #define __ASM_ARCH_HARDWARE_H | ||
13 | |||
14 | #include <linux/config.h> | ||
15 | |||
16 | /* The kernel is loaded at physical address 0xf8000000. | ||
17 | * We map the IO space a bit after | ||
18 | */ | ||
19 | #define PIO_APB_BASE 0x80000000 | ||
20 | #define VIO_APB_BASE 0xf8000000 | ||
21 | #define IO_APB_LENGTH 0x2000 | ||
22 | #define PIO_AHB_BASE 0x80002000 | ||
23 | #define VIO_AHB_BASE 0xf8002000 | ||
24 | #define IO_AHB_LENGTH 0x2000 | ||
25 | |||
26 | #define VIO_BASE VIO_APB_BASE | ||
27 | #define PIO_BASE PIO_APB_BASE | ||
28 | |||
29 | #define io_p2v(x) ( (x) - PIO_BASE + VIO_BASE ) | ||
30 | #define io_v2p(x) ( (x) + PIO_BASE - VIO_BASE ) | ||
31 | |||
32 | #ifndef __ASSEMBLY__ | ||
33 | |||
34 | #include <asm/types.h> | ||
35 | |||
36 | /* FIXME: Is it needed to optimize this a la pxa ?? */ | ||
37 | #define __REG(x) (*((volatile u32 *)io_p2v(x))) | ||
38 | #define __PREG(x) (io_v2p((u32)&(x))) | ||
39 | |||
40 | #else /* __ASSEMBLY__ */ | ||
41 | |||
42 | #define __REG(x) io_p2v(x) | ||
43 | #define __PREG(x) io_v2p(x) | ||
44 | |||
45 | #endif | ||
46 | |||
47 | #include "aaec2000.h" | ||
48 | |||
49 | #endif /* __ASM_ARCH_HARDWARE_H */ | ||
diff --git a/include/asm-arm/arch-aaec2000/io.h b/include/asm-arm/arch-aaec2000/io.h new file mode 100644 index 000000000000..c58a8d10425a --- /dev/null +++ b/include/asm-arm/arch-aaec2000/io.h | |||
@@ -0,0 +1,19 @@ | |||
1 | /* | ||
2 | * linux/include/asm-arm/arch-aaec2000/io.h | ||
3 | * | ||
4 | * Copied from asm/arch/sa1100/io.h | ||
5 | */ | ||
6 | #ifndef __ASM_ARM_ARCH_IO_H | ||
7 | #define __ASM_ARM_ARCH_IO_H | ||
8 | |||
9 | #define IO_SPACE_LIMIT 0xffffffff | ||
10 | |||
11 | /* | ||
12 | * We don't actually have real ISA nor PCI buses, but there is so many | ||
13 | * drivers out there that might just work if we fake them... | ||
14 | */ | ||
15 | #define __io(a) ((void __iomem *)(a)) | ||
16 | #define __mem_pci(a) (a) | ||
17 | #define __mem_isa(a) (a) | ||
18 | |||
19 | #endif | ||
diff --git a/include/asm-arm/arch-aaec2000/irqs.h b/include/asm-arm/arch-aaec2000/irqs.h new file mode 100644 index 000000000000..de252220e806 --- /dev/null +++ b/include/asm-arm/arch-aaec2000/irqs.h | |||
@@ -0,0 +1,46 @@ | |||
1 | /* | ||
2 | * linux/include/asm-arm/arch-aaec2000/irqs.h | ||
3 | * | ||
4 | * Copyright (c) 2005 Nicolas Bellido Y Ortega | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU General Public License version 2 as | ||
8 | * published by the Free Software Foundation. | ||
9 | */ | ||
10 | |||
11 | #ifndef __ASM_ARCH_IRQS_H | ||
12 | #define __ASM_ARCH_IRQS_H | ||
13 | |||
14 | |||
15 | #define INT_GPIOF0_FIQ 0 /* External GPIO Port F O Fast Interrupt Input */ | ||
16 | #define INT_BL_FIQ 1 /* Battery Low Fast Interrupt */ | ||
17 | #define INT_WE_FIQ 2 /* Watchdog Expired Fast Interrupt */ | ||
18 | #define INT_MV_FIQ 3 /* Media Changed Interrupt */ | ||
19 | #define INT_SC 4 /* Sound Codec Interrupt */ | ||
20 | #define INT_GPIO1 5 /* GPIO Port F Configurable Int 1 */ | ||
21 | #define INT_GPIO2 6 /* GPIO Port F Configurable Int 2 */ | ||
22 | #define INT_GPIO3 7 /* GPIO Port F Configurable Int 3 */ | ||
23 | #define INT_TMR1_OFL 8 /* Timer 1 Overflow Interrupt */ | ||
24 | #define INT_TMR2_OFL 9 /* Timer 2 Overflow Interrupt */ | ||
25 | #define INT_RTC_CM 10 /* RTC Compare Match Interrupt */ | ||
26 | #define INT_TICK 11 /* 64Hz Tick Interrupt */ | ||
27 | #define INT_UART1 12 /* UART1 Interrupt */ | ||
28 | #define INT_UART2 13 /* UART2 & Modem State Changed Interrupt */ | ||
29 | #define INT_LCD 14 /* LCD Interrupt */ | ||
30 | #define INT_SSI 15 /* SSI End of Transfer Interrupt */ | ||
31 | #define INT_UART3 16 /* UART3 Interrupt */ | ||
32 | #define INT_SCI 17 /* SCI Interrupt */ | ||
33 | #define INT_AAC 18 /* Advanced Audio Codec Interrupt */ | ||
34 | #define INT_MMC 19 /* MMC Interrupt */ | ||
35 | #define INT_USB 20 /* USB Interrupt */ | ||
36 | #define INT_DMA 21 /* DMA Interrupt */ | ||
37 | #define INT_TMR3_UOFL 22 /* Timer 3 Underflow Interrupt */ | ||
38 | #define INT_GPIO4 23 /* GPIO Port F Configurable Int 4 */ | ||
39 | #define INT_GPIO5 24 /* GPIO Port F Configurable Int 4 */ | ||
40 | #define INT_GPIO6 25 /* GPIO Port F Configurable Int 4 */ | ||
41 | #define INT_GPIO7 26 /* GPIO Port F Configurable Int 4 */ | ||
42 | #define INT_BMI 27 /* BMI Interrupt */ | ||
43 | |||
44 | #define NR_IRQS (INT_BMI + 1) | ||
45 | |||
46 | #endif /* __ASM_ARCH_IRQS_H */ | ||
diff --git a/include/asm-arm/arch-aaec2000/memory.h b/include/asm-arm/arch-aaec2000/memory.h new file mode 100644 index 000000000000..681b6a6171a1 --- /dev/null +++ b/include/asm-arm/arch-aaec2000/memory.h | |||
@@ -0,0 +1,73 @@ | |||
1 | /* | ||
2 | * linux/include/asm-arm/arch-aaec2000/memory.h | ||
3 | * | ||
4 | * Copyright (c) 2005 Nicolas Bellido Y Ortega | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU General Public License version 2 as | ||
8 | * published by the Free Software Foundation. | ||
9 | */ | ||
10 | |||
11 | #ifndef __ASM_ARCH_MEMORY_H | ||
12 | #define __ASM_ARCH_MEMORY_H | ||
13 | |||
14 | #include <linux/config.h> | ||
15 | |||
16 | #define PHYS_OFFSET (0xf0000000UL) | ||
17 | |||
18 | #define __virt_to_bus(x) __virt_to_phys(x) | ||
19 | #define __bus_to_virt(x) __phys_to_virt(x) | ||
20 | |||
21 | #ifdef CONFIG_DISCONTIGMEM | ||
22 | |||
23 | /* | ||
24 | * The nodes are the followings: | ||
25 | * | ||
26 | * node 0: 0xf000.0000 - 0xf3ff.ffff | ||
27 | * node 1: 0xf400.0000 - 0xf7ff.ffff | ||
28 | * node 2: 0xf800.0000 - 0xfbff.ffff | ||
29 | * node 3: 0xfc00.0000 - 0xffff.ffff | ||
30 | */ | ||
31 | |||
32 | /* | ||
33 | * Given a kernel address, find the home node of the underlying memory. | ||
34 | */ | ||
35 | #define KVADDR_TO_NID(addr) \ | ||
36 | (((unsigned long)(addr) - PAGE_OFFSET) >> NODE_MAX_MEM_SHIFT) | ||
37 | |||
38 | /* | ||
39 | * Given a page frame number, convert it to a node id. | ||
40 | */ | ||
41 | #define PFN_TO_NID(pfn) \ | ||
42 | (((pfn) - PHYS_PFN_OFFSET) >> (NODE_MAX_MEM_SHIFT - PAGE_SHIFT)) | ||
43 | |||
44 | /* | ||
45 | * Given a kaddr, ADDR_TO_MAPBASE finds the owning node of the memory | ||
46 | * and return the mem_map of that node. | ||
47 | */ | ||
48 | #define ADDR_TO_MAPBASE(kaddr) NODE_MEM_MAP(KVADDR_TO_NID(kaddr)) | ||
49 | |||
50 | /* | ||
51 | * Given a page frame number, find the owning node of the memory | ||
52 | * and return the mem_map of that node. | ||
53 | */ | ||
54 | #define PFN_TO_MAPBASE(pfn) NODE_MEM_MAP(PFN_TO_NID(pfn)) | ||
55 | |||
56 | /* | ||
57 | * Given a kaddr, LOCAL_MEM_MAP finds the owning node of the memory | ||
58 | * and returns the index corresponding to the appropriate page in the | ||
59 | * node's mem_map. | ||
60 | */ | ||
61 | #define LOCAL_MAP_NR(addr) \ | ||
62 | (((unsigned long)(addr) & (NODE_MAX_MEM_SIZE - 1)) >> PAGE_SHIFT) | ||
63 | |||
64 | #define NODE_MAX_MEM_SHIFT 26 | ||
65 | #define NODE_MAX_MEM_SIZE (1 << NODE_MAX_MEM_SHIFT) | ||
66 | |||
67 | #else | ||
68 | |||
69 | #define PFN_TO_NID(addr) (0) | ||
70 | |||
71 | #endif /* CONFIG_DISCONTIGMEM */ | ||
72 | |||
73 | #endif /* __ASM_ARCH_MEMORY_H */ | ||
diff --git a/include/asm-arm/arch-aaec2000/param.h b/include/asm-arm/arch-aaec2000/param.h new file mode 100644 index 000000000000..139936c2faf2 --- /dev/null +++ b/include/asm-arm/arch-aaec2000/param.h | |||
@@ -0,0 +1,15 @@ | |||
1 | /* | ||
2 | * linux/include/asm-arm/arch-aaec2000/param.h | ||
3 | * | ||
4 | * Copyright (c) 2005 Nicolas Bellido Y Ortega | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU General Public License version 2 as | ||
8 | * published by the Free Software Foundation. | ||
9 | */ | ||
10 | |||
11 | #ifndef __ASM_ARCH_PARAM_H | ||
12 | #define __ASM_ARCH_PARAM_H | ||
13 | |||
14 | #endif /* __ASM_ARCH_PARAM_H */ | ||
15 | |||
diff --git a/include/asm-arm/arch-aaec2000/system.h b/include/asm-arm/arch-aaec2000/system.h new file mode 100644 index 000000000000..08de97b407a8 --- /dev/null +++ b/include/asm-arm/arch-aaec2000/system.h | |||
@@ -0,0 +1,24 @@ | |||
1 | /* | ||
2 | * linux/include/asm-arm/arch-aaed2000/system.h | ||
3 | * | ||
4 | * Copyright (c) 2005 Nicolas Bellido Y Ortega | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU General Public License version 2 as | ||
8 | * published by the Free Software Foundation. | ||
9 | */ | ||
10 | |||
11 | #ifndef __ASM_ARCH_SYSTEM_H | ||
12 | #define __ASM_ARCH_SYSTEM_H | ||
13 | |||
14 | static inline void arch_idle(void) | ||
15 | { | ||
16 | cpu_do_idle(); | ||
17 | } | ||
18 | |||
19 | static inline void arch_reset(char mode) | ||
20 | { | ||
21 | cpu_reset(0); | ||
22 | } | ||
23 | |||
24 | #endif /* __ASM_ARCH_SYSTEM_H */ | ||
diff --git a/include/asm-arm/arch-aaec2000/timex.h b/include/asm-arm/arch-aaec2000/timex.h new file mode 100644 index 000000000000..f5708b38fb7f --- /dev/null +++ b/include/asm-arm/arch-aaec2000/timex.h | |||
@@ -0,0 +1,18 @@ | |||
1 | /* | ||
2 | * linux/include/asm-arm/arch-aaec2000/timex.h | ||
3 | * | ||
4 | * AAEC-2000 Architecture timex specification | ||
5 | * | ||
6 | * Copyright (c) 2005 Nicolas Bellido Y Ortega | ||
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 __ASM_ARCH_TIMEX_H | ||
14 | #define __ASM_ARCH_TIMEX_H | ||
15 | |||
16 | #define CLOCK_TICK_RATE 508000 | ||
17 | |||
18 | #endif /* __ASM_ARCH_TIMEX_H */ | ||
diff --git a/include/asm-arm/arch-aaec2000/uncompress.h b/include/asm-arm/arch-aaec2000/uncompress.h new file mode 100644 index 000000000000..fff0c94b75c4 --- /dev/null +++ b/include/asm-arm/arch-aaec2000/uncompress.h | |||
@@ -0,0 +1,47 @@ | |||
1 | /* | ||
2 | * linux/include/asm-arm/arch-aaec2000/uncompress.h | ||
3 | * | ||
4 | * Copyright (c) 2005 Nicolas Bellido Y Ortega | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU General Public License version 2 as | ||
8 | * published by the Free Software Foundation. | ||
9 | */ | ||
10 | |||
11 | #ifndef __ASM_ARCH_UNCOMPRESS_H | ||
12 | #define __ASM_ARCH_UNCOMPRESS_H | ||
13 | |||
14 | #include "hardware.h" | ||
15 | |||
16 | #define UART(x) (*(volatile unsigned long *)(serial_port + (x))) | ||
17 | |||
18 | static void putstr( const char *s ) | ||
19 | { | ||
20 | unsigned long serial_port; | ||
21 | do { | ||
22 | serial_port = _UART3_BASE; | ||
23 | if (UART(UART_CR) & UART_CR_EN) break; | ||
24 | serial_port = _UART1_BASE; | ||
25 | if (UART(UART_CR) & UART_CR_EN) break; | ||
26 | serial_port = _UART2_BASE; | ||
27 | if (UART(UART_CR) & UART_CR_EN) break; | ||
28 | return; | ||
29 | } while (0); | ||
30 | |||
31 | for (; *s; s++) { | ||
32 | /* wait for space in the UART's transmitter */ | ||
33 | while ((UART(UART_SR) & UART_SR_TxFF)); | ||
34 | /* send the character out. */ | ||
35 | UART(UART_DR) = *s; | ||
36 | /* if a LF, also do CR... */ | ||
37 | if (*s == 10) { | ||
38 | while ((UART(UART_SR) & UART_SR_TxFF)); | ||
39 | UART(UART_DR) = 13; | ||
40 | } | ||
41 | } | ||
42 | } | ||
43 | |||
44 | #define arch_decomp_setup() | ||
45 | #define arch_decomp_wdog() | ||
46 | |||
47 | #endif /* __ASM_ARCH_UNCOMPRESS_H */ | ||
diff --git a/include/asm-arm/arch-aaec2000/vmalloc.h b/include/asm-arm/arch-aaec2000/vmalloc.h new file mode 100644 index 000000000000..ecb991e2e4ff --- /dev/null +++ b/include/asm-arm/arch-aaec2000/vmalloc.h | |||
@@ -0,0 +1,16 @@ | |||
1 | /* | ||
2 | * linux/include/asm-arm/arch-aaec2000/vmalloc.h | ||
3 | * | ||
4 | * Copyright (c) 2005 Nicolas Bellido Y Ortega | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU General Public License version 2 as | ||
8 | * published by the Free Software Foundation. | ||
9 | */ | ||
10 | |||
11 | #ifndef __ASM_ARCH_VMALLOC_H | ||
12 | #define __ASM_ARCH_VMALLOC_H | ||
13 | |||
14 | #define VMALLOC_END (PAGE_OFFSET + 0x10000000) | ||
15 | |||
16 | #endif /* __ASM_ARCH_VMALLOC_H */ | ||
diff --git a/include/asm-arm/arch-imx/imx-regs.h b/include/asm-arm/arch-imx/imx-regs.h index f32c203952cf..93b840e8fa60 100644 --- a/include/asm-arm/arch-imx/imx-regs.h +++ b/include/asm-arm/arch-imx/imx-regs.h | |||
@@ -228,6 +228,30 @@ | |||
228 | #define PD31_BIN_SPI2_TXD ( GPIO_PORTD | GPIO_BIN | 31 ) | 228 | #define PD31_BIN_SPI2_TXD ( GPIO_PORTD | GPIO_BIN | 31 ) |
229 | 229 | ||
230 | /* | 230 | /* |
231 | * PWM controller | ||
232 | */ | ||
233 | #define PWMC __REG(IMX_PWM_BASE + 0x00) /* PWM Control Register */ | ||
234 | #define PWMS __REG(IMX_PWM_BASE + 0x04) /* PWM Sample Register */ | ||
235 | #define PWMP __REG(IMX_PWM_BASE + 0x08) /* PWM Period Register */ | ||
236 | #define PWMCNT __REG(IMX_PWM_BASE + 0x0C) /* PWM Counter Register */ | ||
237 | |||
238 | #define PWMC_HCTR (0x01<<18) /* Halfword FIFO Data Swapping */ | ||
239 | #define PWMC_BCTR (0x01<<17) /* Byte FIFO Data Swapping */ | ||
240 | #define PWMC_SWR (0x01<<16) /* Software Reset */ | ||
241 | #define PWMC_CLKSRC (0x01<<15) /* Clock Source */ | ||
242 | #define PWMC_PRESCALER(x) (((x-1) & 0x7F) << 8) /* PRESCALER */ | ||
243 | #define PWMC_IRQ (0x01<< 7) /* Interrupt Request */ | ||
244 | #define PWMC_IRQEN (0x01<< 6) /* Interrupt Request Enable */ | ||
245 | #define PWMC_FIFOAV (0x01<< 5) /* FIFO Available */ | ||
246 | #define PWMC_EN (0x01<< 4) /* Enables/Disables the PWM */ | ||
247 | #define PWMC_REPEAT(x) (((x) & 0x03) << 2) /* Sample Repeats */ | ||
248 | #define PWMC_CLKSEL(x) (((x) & 0x03) << 0) /* Clock Selection */ | ||
249 | |||
250 | #define PWMS_SAMPLE(x) ((x) & 0xFFFF) /* Contains a two-sample word */ | ||
251 | #define PWMP_PERIOD(x) ((x) & 0xFFFF) /* Represents the PWM's period */ | ||
252 | #define PWMC_COUNTER(x) ((x) & 0xFFFF) /* Represents the current count value */ | ||
253 | |||
254 | /* | ||
231 | * DMA Controller | 255 | * DMA Controller |
232 | */ | 256 | */ |
233 | #define DCR __REG(IMX_DMAC_BASE +0x00) /* DMA Control Register */ | 257 | #define DCR __REG(IMX_DMAC_BASE +0x00) /* DMA Control Register */ |
diff --git a/include/asm-arm/arch-integrator/platform.h b/include/asm-arm/arch-integrator/platform.h index bd364f5a99bc..96ad3d2a66d1 100644 --- a/include/asm-arm/arch-integrator/platform.h +++ b/include/asm-arm/arch-integrator/platform.h | |||
@@ -293,7 +293,11 @@ | |||
293 | #define INTEGRATOR_DBG_SWITCH (INTEGRATOR_DBG_BASE + INTEGRATOR_DBG_SWITCH_OFFSET) | 293 | #define INTEGRATOR_DBG_SWITCH (INTEGRATOR_DBG_BASE + INTEGRATOR_DBG_SWITCH_OFFSET) |
294 | 294 | ||
295 | 295 | ||
296 | #if defined(CONFIG_ARCH_INTEGRATOR_AP) | ||
296 | #define INTEGRATOR_GPIO_BASE 0x1B000000 /* GPIO */ | 297 | #define INTEGRATOR_GPIO_BASE 0x1B000000 /* GPIO */ |
298 | #elif defined(CONFIG_ARCH_INTEGRATOR_CP) | ||
299 | #define INTEGRATOR_GPIO_BASE 0xC9000000 /* GPIO */ | ||
300 | #endif | ||
297 | 301 | ||
298 | /* ------------------------------------------------------------------------ | 302 | /* ------------------------------------------------------------------------ |
299 | * KMI keyboard/mouse definitions | 303 | * KMI keyboard/mouse definitions |
diff --git a/include/asm-arm/arch-integrator/smp.h b/include/asm-arm/arch-integrator/smp.h new file mode 100644 index 000000000000..0ec7093f7c37 --- /dev/null +++ b/include/asm-arm/arch-integrator/smp.h | |||
@@ -0,0 +1,19 @@ | |||
1 | #ifndef ASMARM_ARCH_SMP_H | ||
2 | #define ASMARM_ARCH_SMP_H | ||
3 | |||
4 | #include <linux/config.h> | ||
5 | |||
6 | #include <asm/arch/hardware.h> | ||
7 | #include <asm/io.h> | ||
8 | |||
9 | #define hard_smp_processor_id() \ | ||
10 | ({ \ | ||
11 | unsigned int cpunum; \ | ||
12 | __asm__("mrc p15, 0, %0, c0, c0, 5" \ | ||
13 | : "=r" (cpunum)); \ | ||
14 | cpunum &= 0x0F; \ | ||
15 | }) | ||
16 | |||
17 | extern void secondary_scan_irqs(void); | ||
18 | |||
19 | #endif | ||
diff --git a/include/asm-arm/arch-ixp2000/io.h b/include/asm-arm/arch-ixp2000/io.h index a8e3c2daefd6..083462668e18 100644 --- a/include/asm-arm/arch-ixp2000/io.h +++ b/include/asm-arm/arch-ixp2000/io.h | |||
@@ -75,8 +75,8 @@ static inline void insw(u32 ptr, void *buf, int length) | |||
75 | * Is this cycle meant for the CS8900? | 75 | * Is this cycle meant for the CS8900? |
76 | */ | 76 | */ |
77 | if ((machine_is_ixdp2401() || machine_is_ixdp2801()) && | 77 | if ((machine_is_ixdp2401() || machine_is_ixdp2801()) && |
78 | ((port >= IXDP2X01_CS8900_VIRT_BASE) && | 78 | (((u32)port >= (u32)IXDP2X01_CS8900_VIRT_BASE) && |
79 | (port <= IXDP2X01_CS8900_VIRT_END))) { | 79 | ((u32)port <= (u32)IXDP2X01_CS8900_VIRT_END))) { |
80 | u8 *buf8 = (u8*)buf; | 80 | u8 *buf8 = (u8*)buf; |
81 | register u32 tmp32; | 81 | register u32 tmp32; |
82 | 82 | ||
@@ -100,8 +100,8 @@ static inline void outsw(u32 ptr, void *buf, int length) | |||
100 | * Is this cycle meant for the CS8900? | 100 | * Is this cycle meant for the CS8900? |
101 | */ | 101 | */ |
102 | if ((machine_is_ixdp2401() || machine_is_ixdp2801()) && | 102 | if ((machine_is_ixdp2401() || machine_is_ixdp2801()) && |
103 | ((port >= IXDP2X01_CS8900_VIRT_BASE) && | 103 | (((u32)port >= (u32)IXDP2X01_CS8900_VIRT_BASE) && |
104 | (port <= IXDP2X01_CS8900_VIRT_END))) { | 104 | ((u32)port <= (u32)IXDP2X01_CS8900_VIRT_END))) { |
105 | register u32 tmp32; | 105 | register u32 tmp32; |
106 | u8 *buf8 = (u8*)buf; | 106 | u8 *buf8 = (u8*)buf; |
107 | do { | 107 | do { |
@@ -124,8 +124,8 @@ static inline u16 inw(u32 ptr) | |||
124 | * Is this cycle meant for the CS8900? | 124 | * Is this cycle meant for the CS8900? |
125 | */ | 125 | */ |
126 | if ((machine_is_ixdp2401() || machine_is_ixdp2801()) && | 126 | if ((machine_is_ixdp2401() || machine_is_ixdp2801()) && |
127 | ((port >= IXDP2X01_CS8900_VIRT_BASE) && | 127 | (((u32)port >= (u32)IXDP2X01_CS8900_VIRT_BASE) && |
128 | (port <= IXDP2X01_CS8900_VIRT_END))) { | 128 | ((u32)port <= (u32)IXDP2X01_CS8900_VIRT_END))) { |
129 | return (u16)(*port); | 129 | return (u16)(*port); |
130 | } | 130 | } |
131 | 131 | ||
@@ -137,8 +137,8 @@ static inline void outw(u16 value, u32 ptr) | |||
137 | register volatile u32 *port = (volatile u32 *)ptr; | 137 | register volatile u32 *port = (volatile u32 *)ptr; |
138 | 138 | ||
139 | if ((machine_is_ixdp2401() || machine_is_ixdp2801()) && | 139 | if ((machine_is_ixdp2401() || machine_is_ixdp2801()) && |
140 | ((port >= IXDP2X01_CS8900_VIRT_BASE) && | 140 | (((u32)port >= (u32)IXDP2X01_CS8900_VIRT_BASE) && |
141 | (port <= IXDP2X01_CS8900_VIRT_END))) { | 141 | ((u32)port <= (u32)IXDP2X01_CS8900_VIRT_END))) { |
142 | *port = value; | 142 | *port = value; |
143 | return; | 143 | return; |
144 | } | 144 | } |
diff --git a/include/asm-arm/arch-ixp2000/ixp2000-regs.h b/include/asm-arm/arch-ixp2000/ixp2000-regs.h index 6c56708d0ff0..a1d9e181b10f 100644 --- a/include/asm-arm/arch-ixp2000/ixp2000-regs.h +++ b/include/asm-arm/arch-ixp2000/ixp2000-regs.h | |||
@@ -363,6 +363,7 @@ | |||
363 | #define IXP2000_MIN_REV_MASK 0x0000000F | 363 | #define IXP2000_MIN_REV_MASK 0x0000000F |
364 | #define IXP2000_PROD_ID_MASK 0xFFFFFFFF | 364 | #define IXP2000_PROD_ID_MASK 0xFFFFFFFF |
365 | 365 | ||
366 | #define IXP2000_PRODUCT_ID GLOBAL_REG(0x00) | ||
366 | #define IXP2000_MISC_CONTROL GLOBAL_REG(0x04) | 367 | #define IXP2000_MISC_CONTROL GLOBAL_REG(0x04) |
367 | #define IXP2000_MSF_CLK_CNTRL GLOBAL_REG(0x08) | 368 | #define IXP2000_MSF_CLK_CNTRL GLOBAL_REG(0x08) |
368 | #define IXP2000_RESET0 GLOBAL_REG(0x0c) | 369 | #define IXP2000_RESET0 GLOBAL_REG(0x0c) |
diff --git a/include/asm-arm/arch-pxa/pxa-regs.h b/include/asm-arm/arch-pxa/pxa-regs.h index 39741d3c9a34..b5e54a9e9fa7 100644 --- a/include/asm-arm/arch-pxa/pxa-regs.h +++ b/include/asm-arm/arch-pxa/pxa-regs.h | |||
@@ -1296,6 +1296,7 @@ | |||
1296 | #define GPIO111_MMCDAT3 111 /* MMC DAT3 (PXA27x) */ | 1296 | #define GPIO111_MMCDAT3 111 /* MMC DAT3 (PXA27x) */ |
1297 | #define GPIO111_MMCCS1 111 /* MMC Chip Select 1 (PXA27x) */ | 1297 | #define GPIO111_MMCCS1 111 /* MMC Chip Select 1 (PXA27x) */ |
1298 | #define GPIO112_MMCCMD 112 /* MMC CMD (PXA27x) */ | 1298 | #define GPIO112_MMCCMD 112 /* MMC CMD (PXA27x) */ |
1299 | #define GPIO113_I2S_SYSCLK 113 /* I2S System Clock (PXA27x) */ | ||
1299 | #define GPIO113_AC97_RESET_N 113 /* AC97 NRESET on (PXA27x) */ | 1300 | #define GPIO113_AC97_RESET_N 113 /* AC97 NRESET on (PXA27x) */ |
1300 | 1301 | ||
1301 | /* GPIO alternate function mode & direction */ | 1302 | /* GPIO alternate function mode & direction */ |
@@ -1428,6 +1429,7 @@ | |||
1428 | #define GPIO111_MMCDAT3_MD (111 | GPIO_ALT_FN_1_OUT) | 1429 | #define GPIO111_MMCDAT3_MD (111 | GPIO_ALT_FN_1_OUT) |
1429 | #define GPIO110_MMCCS1_MD (111 | GPIO_ALT_FN_1_OUT) | 1430 | #define GPIO110_MMCCS1_MD (111 | GPIO_ALT_FN_1_OUT) |
1430 | #define GPIO112_MMCCMD_MD (112 | GPIO_ALT_FN_1_OUT) | 1431 | #define GPIO112_MMCCMD_MD (112 | GPIO_ALT_FN_1_OUT) |
1432 | #define GPIO113_I2S_SYSCLK_MD (113 | GPIO_ALT_FN_1_OUT) | ||
1431 | #define GPIO113_AC97_RESET_N_MD (113 | GPIO_ALT_FN_2_OUT) | 1433 | #define GPIO113_AC97_RESET_N_MD (113 | GPIO_ALT_FN_2_OUT) |
1432 | #define GPIO117_I2CSCL_MD (117 | GPIO_ALT_FN_1_OUT) | 1434 | #define GPIO117_I2CSCL_MD (117 | GPIO_ALT_FN_1_OUT) |
1433 | #define GPIO118_I2CSDA_MD (118 | GPIO_ALT_FN_1_IN) | 1435 | #define GPIO118_I2CSDA_MD (118 | GPIO_ALT_FN_1_IN) |
diff --git a/include/asm-arm/arch-s3c2410/regs-nand.h b/include/asm-arm/arch-s3c2410/regs-nand.h index c443ac834698..7cff235e667a 100644 --- a/include/asm-arm/arch-s3c2410/regs-nand.h +++ b/include/asm-arm/arch-s3c2410/regs-nand.h | |||
@@ -1,16 +1,17 @@ | |||
1 | /* linux/include/asm-arm/arch-s3c2410/regs-nand.h | 1 | /* linux/include/asm-arm/arch-s3c2410/regs-nand.h |
2 | * | 2 | * |
3 | * Copyright (c) 2004 Simtec Electronics <linux@simtec.co.uk> | 3 | * Copyright (c) 2004,2005 Simtec Electronics <linux@simtec.co.uk> |
4 | * http://www.simtec.co.uk/products/SWLINUX/ | 4 | * http://www.simtec.co.uk/products/SWLINUX/ |
5 | * | 5 | * |
6 | * This program is free software; you can redistribute it and/or modify | 6 | * This program is free software; you can redistribute it and/or modify |
7 | * it under the terms of the GNU General Public License version 2 as | 7 | * it under the terms of the GNU General Public License version 2 as |
8 | * published by the Free Software Foundation. | 8 | * published by the Free Software Foundation. |
9 | * | 9 | * |
10 | * S3C2410 clock register definitions | 10 | * S3C2410 NAND register definitions |
11 | * | 11 | * |
12 | * Changelog: | 12 | * Changelog: |
13 | * 18-Aug-2004 BJD Copied file from 2.4 and updated | 13 | * 18-Aug-2004 BJD Copied file from 2.4 and updated |
14 | * 01-May-2005 BJD Added definitions for s3c2440 controller | ||
14 | */ | 15 | */ |
15 | 16 | ||
16 | #ifndef __ASM_ARM_REGS_NAND | 17 | #ifndef __ASM_ARM_REGS_NAND |
@@ -26,6 +27,22 @@ | |||
26 | #define S3C2410_NFSTAT S3C2410_NFREG(0x10) | 27 | #define S3C2410_NFSTAT S3C2410_NFREG(0x10) |
27 | #define S3C2410_NFECC S3C2410_NFREG(0x14) | 28 | #define S3C2410_NFECC S3C2410_NFREG(0x14) |
28 | 29 | ||
30 | #define S3C2440_NFCONT S3C2410_NFREG(0x04) | ||
31 | #define S3C2440_NFCMD S3C2410_NFREG(0x08) | ||
32 | #define S3C2440_NFADDR S3C2410_NFREG(0x0C) | ||
33 | #define S3C2440_NFDATA S3C2410_NFREG(0x10) | ||
34 | #define S3C2440_NFECCD0 S3C2410_NFREG(0x14) | ||
35 | #define S3C2440_NFECCD1 S3C2410_NFREG(0x18) | ||
36 | #define S3C2440_NFECCD S3C2410_NFREG(0x1C) | ||
37 | #define S3C2440_NFSTAT S3C2410_NFREG(0x20) | ||
38 | #define S3C2440_NFESTAT0 S3C2410_NFREG(0x24) | ||
39 | #define S3C2440_NFESTAT1 S3C2410_NFREG(0x28) | ||
40 | #define S3C2440_NFMECC0 S3C2410_NFREG(0x2C) | ||
41 | #define S3C2440_NFMECC1 S3C2410_NFREG(0x30) | ||
42 | #define S3C2440_NFSECC S3C2410_NFREG(0x34) | ||
43 | #define S3C2440_NFSBLK S3C2410_NFREG(0x38) | ||
44 | #define S3C2440_NFEBLK S3C2410_NFREG(0x3C) | ||
45 | |||
29 | #define S3C2410_NFCONF_EN (1<<15) | 46 | #define S3C2410_NFCONF_EN (1<<15) |
30 | #define S3C2410_NFCONF_512BYTE (1<<14) | 47 | #define S3C2410_NFCONF_512BYTE (1<<14) |
31 | #define S3C2410_NFCONF_4STEP (1<<13) | 48 | #define S3C2410_NFCONF_4STEP (1<<13) |
@@ -37,7 +54,28 @@ | |||
37 | 54 | ||
38 | #define S3C2410_NFSTAT_BUSY (1<<0) | 55 | #define S3C2410_NFSTAT_BUSY (1<<0) |
39 | 56 | ||
40 | /* think ECC can only be 8bit read? */ | 57 | #define S3C2440_NFCONF_BUSWIDTH_8 (0<<0) |
58 | #define S3C2440_NFCONF_BUSWIDTH_16 (1<<0) | ||
59 | #define S3C2440_NFCONF_ADVFLASH (1<<3) | ||
60 | #define S3C2440_NFCONF_TACLS(x) ((x)<<12) | ||
61 | #define S3C2440_NFCONF_TWRPH0(x) ((x)<<8) | ||
62 | #define S3C2440_NFCONF_TWRPH1(x) ((x)<<4) | ||
63 | |||
64 | #define S3C2440_NFCONT_LOCKTIGHT (1<<13) | ||
65 | #define S3C2440_NFCONT_SOFTLOCK (1<<12) | ||
66 | #define S3C2440_NFCONT_ILLEGALACC_EN (1<<10) | ||
67 | #define S3C2440_NFCONT_RNBINT_EN (1<<9) | ||
68 | #define S3C2440_NFCONT_RN_FALLING (1<<8) | ||
69 | #define S3C2440_NFCONT_SPARE_ECCLOCK (1<<6) | ||
70 | #define S3C2440_NFCONT_MAIN_ECCLOCK (1<<5) | ||
71 | #define S3C2440_NFCONT_INITECC (1<<4) | ||
72 | #define S3C2440_NFCONT_nFCE (1<<1) | ||
73 | #define S3C2440_NFCONT_ENABLE (1<<0) | ||
74 | |||
75 | #define S3C2440_NFSTAT_READY (1<<0) | ||
76 | #define S3C2440_NFSTAT_nCE (1<<1) | ||
77 | #define S3C2440_NFSTAT_RnB_CHANGE (1<<2) | ||
78 | #define S3C2440_NFSTAT_ILLEGAL_ACCESS (1<<3) | ||
41 | 79 | ||
42 | #endif /* __ASM_ARM_REGS_NAND */ | 80 | #endif /* __ASM_ARM_REGS_NAND */ |
43 | 81 | ||
diff --git a/include/asm-arm/arch-versatile/hardware.h b/include/asm-arm/arch-versatile/hardware.h index d5fb4a251e7f..41c1bee342ad 100644 --- a/include/asm-arm/arch-versatile/hardware.h +++ b/include/asm-arm/arch-versatile/hardware.h | |||
@@ -25,19 +25,26 @@ | |||
25 | #include <asm/sizes.h> | 25 | #include <asm/sizes.h> |
26 | #include <asm/arch/platform.h> | 26 | #include <asm/arch/platform.h> |
27 | 27 | ||
28 | // FIXME = PCI settings need to be fixed!!!!! | ||
29 | |||
30 | /* | 28 | /* |
31 | * Similar to above, but for PCI addresses (memory, IO, Config and the | 29 | * PCI space virtual addresses |
32 | * V3 chip itself). WARNING: this has to mirror definitions in platform.h | ||
33 | */ | 30 | */ |
34 | #define PCI_MEMORY_VADDR 0xe8000000 | 31 | #define VERSATILE_PCI_VIRT_BASE 0xe8000000 |
35 | #define PCI_CONFIG_VADDR 0xec000000 | 32 | #define VERSATILE_PCI_CFG_VIRT_BASE 0xe9000000 |
36 | #define PCI_V3_VADDR 0xed000000 | 33 | |
37 | #define PCI_IO_VADDR 0xee000000 | 34 | #if 0 |
35 | #define VERSATILE_PCI_VIRT_MEM_BASE0 0xf4000000 | ||
36 | #define VERSATILE_PCI_VIRT_MEM_BASE1 0xf5000000 | ||
37 | #define VERSATILE_PCI_VIRT_MEM_BASE2 0xf6000000 | ||
38 | |||
39 | #define PCIO_BASE VERSATILE_PCI_VIRT_MEM_BASE0 | ||
40 | #define PCIMEM_BASE VERSATILE_PCI_VIRT_MEM_BASE1 | ||
41 | #endif | ||
42 | |||
43 | /* CIK guesswork */ | ||
44 | #define PCIBIOS_MIN_IO 0x44000000 | ||
45 | #define PCIBIOS_MIN_MEM 0x50000000 | ||
38 | 46 | ||
39 | #define PCIO_BASE PCI_IO_VADDR | 47 | #define pcibios_assign_all_busses() 1 |
40 | #define PCIMEM_BASE PCI_MEMORY_VADDR | ||
41 | 48 | ||
42 | /* macro to get at IO space when running virtually */ | 49 | /* macro to get at IO space when running virtually */ |
43 | #define IO_ADDRESS(x) (((x) & 0x0fffffff) + (((x) >> 4) & 0x0f000000) + 0xf0000000) | 50 | #define IO_ADDRESS(x) (((x) & 0x0fffffff) + (((x) >> 4) & 0x0f000000) + 0xf0000000) |
diff --git a/include/asm-arm/arch-versatile/io.h b/include/asm-arm/arch-versatile/io.h index dbb7158788fc..9f895bf61494 100644 --- a/include/asm-arm/arch-versatile/io.h +++ b/include/asm-arm/arch-versatile/io.h | |||
@@ -20,7 +20,7 @@ | |||
20 | #ifndef __ASM_ARM_ARCH_IO_H | 20 | #ifndef __ASM_ARM_ARCH_IO_H |
21 | #define __ASM_ARM_ARCH_IO_H | 21 | #define __ASM_ARM_ARCH_IO_H |
22 | 22 | ||
23 | #define IO_SPACE_LIMIT 0xffff | 23 | #define IO_SPACE_LIMIT 0xffffffff |
24 | 24 | ||
25 | #define __io(a) ((void __iomem *)(a)) | 25 | #define __io(a) ((void __iomem *)(a)) |
26 | #define __mem_pci(a) (a) | 26 | #define __mem_pci(a) (a) |
diff --git a/include/asm-arm/arch-versatile/platform.h b/include/asm-arm/arch-versatile/platform.h index 2598d1f08548..cbdd9fb96332 100644 --- a/include/asm-arm/arch-versatile/platform.h +++ b/include/asm-arm/arch-versatile/platform.h | |||
@@ -76,7 +76,7 @@ | |||
76 | #define VERSATILE_SYS_NVFLAGSSET_OFFSET 0x38 | 76 | #define VERSATILE_SYS_NVFLAGSSET_OFFSET 0x38 |
77 | #define VERSATILE_SYS_NVFLAGSCLR_OFFSET 0x3C | 77 | #define VERSATILE_SYS_NVFLAGSCLR_OFFSET 0x3C |
78 | #define VERSATILE_SYS_RESETCTL_OFFSET 0x40 | 78 | #define VERSATILE_SYS_RESETCTL_OFFSET 0x40 |
79 | #define VERSATILE_SYS_PICCTL_OFFSET 0x44 | 79 | #define VERSATILE_SYS_PCICTL_OFFSET 0x44 |
80 | #define VERSATILE_SYS_MCI_OFFSET 0x48 | 80 | #define VERSATILE_SYS_MCI_OFFSET 0x48 |
81 | #define VERSATILE_SYS_FLASH_OFFSET 0x4C | 81 | #define VERSATILE_SYS_FLASH_OFFSET 0x4C |
82 | #define VERSATILE_SYS_CLCD_OFFSET 0x50 | 82 | #define VERSATILE_SYS_CLCD_OFFSET 0x50 |
@@ -114,7 +114,7 @@ | |||
114 | #define VERSATILE_SYS_NVFLAGSSET (VERSATILE_SYS_BASE + VERSATILE_SYS_NVFLAGSSET_OFFSET) | 114 | #define VERSATILE_SYS_NVFLAGSSET (VERSATILE_SYS_BASE + VERSATILE_SYS_NVFLAGSSET_OFFSET) |
115 | #define VERSATILE_SYS_NVFLAGSCLR (VERSATILE_SYS_BASE + VERSATILE_SYS_NVFLAGSCLR_OFFSET) | 115 | #define VERSATILE_SYS_NVFLAGSCLR (VERSATILE_SYS_BASE + VERSATILE_SYS_NVFLAGSCLR_OFFSET) |
116 | #define VERSATILE_SYS_RESETCTL (VERSATILE_SYS_BASE + VERSATILE_SYS_RESETCTL_OFFSET) | 116 | #define VERSATILE_SYS_RESETCTL (VERSATILE_SYS_BASE + VERSATILE_SYS_RESETCTL_OFFSET) |
117 | #define VERSATILE_SYS_PICCTL (VERSATILE_SYS_BASE + VERSATILE_SYS_PICCTL_OFFSET) | 117 | #define VERSATILE_SYS_PCICTL (VERSATILE_SYS_BASE + VERSATILE_SYS_PCICTL_OFFSET) |
118 | #define VERSATILE_SYS_MCI (VERSATILE_SYS_BASE + VERSATILE_SYS_MCI_OFFSET) | 118 | #define VERSATILE_SYS_MCI (VERSATILE_SYS_BASE + VERSATILE_SYS_MCI_OFFSET) |
119 | #define VERSATILE_SYS_FLASH (VERSATILE_SYS_BASE + VERSATILE_SYS_FLASH_OFFSET) | 119 | #define VERSATILE_SYS_FLASH (VERSATILE_SYS_BASE + VERSATILE_SYS_FLASH_OFFSET) |
120 | #define VERSATILE_SYS_CLCD (VERSATILE_SYS_BASE + VERSATILE_SYS_CLCD_OFFSET) | 120 | #define VERSATILE_SYS_CLCD (VERSATILE_SYS_BASE + VERSATILE_SYS_CLCD_OFFSET) |
@@ -225,7 +225,20 @@ | |||
225 | #define VERSATILE_SSMC_BASE 0x20000000 /* SSMC */ | 225 | #define VERSATILE_SSMC_BASE 0x20000000 /* SSMC */ |
226 | #define VERSATILE_IB2_BASE 0x24000000 /* IB2 module */ | 226 | #define VERSATILE_IB2_BASE 0x24000000 /* IB2 module */ |
227 | #define VERSATILE_MBX_BASE 0x40000000 /* MBX */ | 227 | #define VERSATILE_MBX_BASE 0x40000000 /* MBX */ |
228 | |||
229 | /* PCI space */ | ||
228 | #define VERSATILE_PCI_BASE 0x41000000 /* PCI Interface */ | 230 | #define VERSATILE_PCI_BASE 0x41000000 /* PCI Interface */ |
231 | #define VERSATILE_PCI_CFG_BASE 0x42000000 | ||
232 | #define VERSATILE_PCI_MEM_BASE0 0x44000000 | ||
233 | #define VERSATILE_PCI_MEM_BASE1 0x50000000 | ||
234 | #define VERSATILE_PCI_MEM_BASE2 0x60000000 | ||
235 | /* Sizes of above maps */ | ||
236 | #define VERSATILE_PCI_BASE_SIZE 0x01000000 | ||
237 | #define VERSATILE_PCI_CFG_BASE_SIZE 0x02000000 | ||
238 | #define VERSATILE_PCI_MEM_BASE0_SIZE 0x0c000000 /* 32Mb */ | ||
239 | #define VERSATILE_PCI_MEM_BASE1_SIZE 0x10000000 /* 256Mb */ | ||
240 | #define VERSATILE_PCI_MEM_BASE2_SIZE 0x10000000 /* 256Mb */ | ||
241 | |||
229 | #define VERSATILE_SDRAM67_BASE 0x70000000 /* SDRAM banks 6 and 7 */ | 242 | #define VERSATILE_SDRAM67_BASE 0x70000000 /* SDRAM banks 6 and 7 */ |
230 | #define VERSATILE_LT_BASE 0x80000000 /* Logic Tile expansion */ | 243 | #define VERSATILE_LT_BASE 0x80000000 /* Logic Tile expansion */ |
231 | 244 | ||
@@ -498,11 +511,17 @@ | |||
498 | /* | 511 | /* |
499 | * IB2 Versatile/AB expansion board definitions | 512 | * IB2 Versatile/AB expansion board definitions |
500 | */ | 513 | */ |
501 | #define VERSATILE_IB2_CAMERA_BANK 0x24000000 | 514 | #define VERSATILE_IB2_CAMERA_BANK VERSATILE_IB2_BASE |
502 | #define VERSATILE_IB2_KBD_DATAREG 0x25000000 | 515 | #define VERSATILE_IB2_KBD_DATAREG (VERSATILE_IB2_BASE + 0x01000000) |
503 | #define VERSATILE_IB2_IER 0x26000000 /* for VICINTSOURCE27 */ | 516 | |
504 | #define VERSATILE_IB2_CTRL 0x27000000 | 517 | /* VICINTSOURCE27 */ |
505 | #define VERSATILE_IB2_STAT 0x27000004 | 518 | #define VERSATILE_IB2_INT_BASE (VERSATILE_IB2_BASE + 0x02000000) |
519 | #define VERSATILE_IB2_IER (VERSATILE_IB2_INT_BASE + 0) | ||
520 | #define VERSATILE_IB2_ISR (VERSATILE_IB2_INT_BASE + 4) | ||
521 | |||
522 | #define VERSATILE_IB2_CTL_BASE (VERSATILE_IB2_BASE + 0x03000000) | ||
523 | #define VERSATILE_IB2_CTRL (VERSATILE_IB2_CTL_BASE + 0) | ||
524 | #define VERSATILE_IB2_STAT (VERSATILE_IB2_CTL_BASE + 4) | ||
506 | #endif | 525 | #endif |
507 | 526 | ||
508 | #endif | 527 | #endif |
diff --git a/include/asm-arm/cacheflush.h b/include/asm-arm/cacheflush.h index 09ffeed507c2..035cdcff43d2 100644 --- a/include/asm-arm/cacheflush.h +++ b/include/asm-arm/cacheflush.h | |||
@@ -16,6 +16,9 @@ | |||
16 | 16 | ||
17 | #include <asm/mman.h> | 17 | #include <asm/mman.h> |
18 | #include <asm/glue.h> | 18 | #include <asm/glue.h> |
19 | #include <asm/shmparam.h> | ||
20 | |||
21 | #define CACHE_COLOUR(vaddr) ((vaddr & (SHMLBA - 1)) >> PAGE_SHIFT) | ||
19 | 22 | ||
20 | /* | 23 | /* |
21 | * Cache Model | 24 | * Cache Model |
diff --git a/include/asm-arm/elf.h b/include/asm-arm/elf.h index cbceacbe5afa..a1696ba238d3 100644 --- a/include/asm-arm/elf.h +++ b/include/asm-arm/elf.h | |||
@@ -38,9 +38,9 @@ typedef struct user_fp elf_fpregset_t; | |||
38 | */ | 38 | */ |
39 | #define ELF_CLASS ELFCLASS32 | 39 | #define ELF_CLASS ELFCLASS32 |
40 | #ifdef __ARMEB__ | 40 | #ifdef __ARMEB__ |
41 | #define ELF_DATA ELFDATA2MSB; | 41 | #define ELF_DATA ELFDATA2MSB |
42 | #else | 42 | #else |
43 | #define ELF_DATA ELFDATA2LSB; | 43 | #define ELF_DATA ELFDATA2LSB |
44 | #endif | 44 | #endif |
45 | #define ELF_ARCH EM_ARM | 45 | #define ELF_ARCH EM_ARM |
46 | 46 | ||
diff --git a/include/asm-arm/io.h b/include/asm-arm/io.h index 658ffa384fda..08a46302d265 100644 --- a/include/asm-arm/io.h +++ b/include/asm-arm/io.h | |||
@@ -273,6 +273,33 @@ extern void __iounmap(void __iomem *addr); | |||
273 | #endif | 273 | #endif |
274 | 274 | ||
275 | /* | 275 | /* |
276 | * io{read,write}{8,16,32} macros | ||
277 | */ | ||
278 | #define ioread8(p) ({ unsigned int __v = __raw_readb(p); __v; }) | ||
279 | #define ioread16(p) ({ unsigned int __v = le16_to_cpu(__raw_readw(p)); __v; }) | ||
280 | #define ioread32(p) ({ unsigned int __v = le32_to_cpu(__raw_readl(p)); __v; }) | ||
281 | |||
282 | #define iowrite8(v,p) __raw_writeb(v, p) | ||
283 | #define iowrite16(v,p) __raw_writew(cpu_to_le16(v), p) | ||
284 | #define iowrite32(v,p) __raw_writel(cpu_to_le32(v), p) | ||
285 | |||
286 | #define ioread8_rep(p,d,c) __raw_readsb(p,d,c) | ||
287 | #define ioread16_rep(p,d,c) __raw_readsw(p,d,c) | ||
288 | #define ioread32_rep(p,d,c) __raw_readsl(p,d,c) | ||
289 | |||
290 | #define iowrite8_rep(p,s,c) __raw_writesb(p,s,c) | ||
291 | #define iowrite16_rep(p,s,c) __raw_writesw(p,s,c) | ||
292 | #define iowrite32_rep(p,s,c) __raw_writesl(p,s,c) | ||
293 | |||
294 | extern void __iomem *ioport_map(unsigned long port, unsigned int nr); | ||
295 | extern void ioport_unmap(void __iomem *addr); | ||
296 | |||
297 | struct pci_dev; | ||
298 | |||
299 | extern void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long maxlen); | ||
300 | extern void pci_iounmap(struct pci_dev *dev, void __iomem *addr); | ||
301 | |||
302 | /* | ||
276 | * can the hardware map this into one segment or not, given no other | 303 | * can the hardware map this into one segment or not, given no other |
277 | * constraints. | 304 | * constraints. |
278 | */ | 305 | */ |
diff --git a/include/asm-arm/page.h b/include/asm-arm/page.h index 4ca3a8e9348f..019c45d75730 100644 --- a/include/asm-arm/page.h +++ b/include/asm-arm/page.h | |||
@@ -114,19 +114,8 @@ extern void __cpu_copy_user_page(void *to, const void *from, | |||
114 | unsigned long user); | 114 | unsigned long user); |
115 | #endif | 115 | #endif |
116 | 116 | ||
117 | #define clear_user_page(addr,vaddr,pg) \ | 117 | #define clear_user_page(addr,vaddr,pg) __cpu_clear_user_page(addr, vaddr) |
118 | do { \ | 118 | #define copy_user_page(to,from,vaddr,pg) __cpu_copy_user_page(to, from, vaddr) |
119 | preempt_disable(); \ | ||
120 | __cpu_clear_user_page(addr, vaddr); \ | ||
121 | preempt_enable(); \ | ||
122 | } while (0) | ||
123 | |||
124 | #define copy_user_page(to,from,vaddr,pg) \ | ||
125 | do { \ | ||
126 | preempt_disable(); \ | ||
127 | __cpu_copy_user_page(to, from, vaddr); \ | ||
128 | preempt_enable(); \ | ||
129 | } while (0) | ||
130 | 119 | ||
131 | #define clear_page(page) memzero((void *)(page), PAGE_SIZE) | 120 | #define clear_page(page) memzero((void *)(page), PAGE_SIZE) |
132 | extern void copy_page(void *to, const void *from); | 121 | extern void copy_page(void *to, const void *from); |
@@ -171,6 +160,9 @@ typedef unsigned long pgprot_t; | |||
171 | 160 | ||
172 | #endif /* STRICT_MM_TYPECHECKS */ | 161 | #endif /* STRICT_MM_TYPECHECKS */ |
173 | 162 | ||
163 | /* the upper-most page table pointer */ | ||
164 | extern pmd_t *top_pmd; | ||
165 | |||
174 | /* Pure 2^n version of get_order */ | 166 | /* Pure 2^n version of get_order */ |
175 | static inline int get_order(unsigned long size) | 167 | static inline int get_order(unsigned long size) |
176 | { | 168 | { |
diff --git a/include/asm-arm/smp.h b/include/asm-arm/smp.h index f21fd8f6bcdd..6c6c60adbbaa 100644 --- a/include/asm-arm/smp.h +++ b/include/asm-arm/smp.h | |||
@@ -21,7 +21,7 @@ | |||
21 | # error "<asm-arm/smp.h> included in non-SMP build" | 21 | # error "<asm-arm/smp.h> included in non-SMP build" |
22 | #endif | 22 | #endif |
23 | 23 | ||
24 | #define smp_processor_id() (current_thread_info()->cpu) | 24 | #define raw_smp_processor_id() (current_thread_info()->cpu) |
25 | 25 | ||
26 | extern cpumask_t cpu_present_mask; | 26 | extern cpumask_t cpu_present_mask; |
27 | #define cpu_possible_map cpu_present_mask | 27 | #define cpu_possible_map cpu_present_mask |
@@ -55,4 +55,18 @@ extern void smp_cross_call(cpumask_t callmap); | |||
55 | */ | 55 | */ |
56 | extern int boot_secondary(unsigned int cpu, struct task_struct *); | 56 | extern int boot_secondary(unsigned int cpu, struct task_struct *); |
57 | 57 | ||
58 | /* | ||
59 | * Perform platform specific initialisation of the specified CPU. | ||
60 | */ | ||
61 | extern void platform_secondary_init(unsigned int cpu); | ||
62 | |||
63 | /* | ||
64 | * Initial data for bringing up a secondary CPU. | ||
65 | */ | ||
66 | struct secondary_data { | ||
67 | unsigned long pgdir; | ||
68 | void *stack; | ||
69 | }; | ||
70 | extern struct secondary_data secondary_data; | ||
71 | |||
58 | #endif /* ifndef __ASM_ARM_SMP_H */ | 72 | #endif /* ifndef __ASM_ARM_SMP_H */ |
diff --git a/include/asm-arm/system.h b/include/asm-arm/system.h index b13a8da4847b..39dd7008013c 100644 --- a/include/asm-arm/system.h +++ b/include/asm-arm/system.h | |||
@@ -104,6 +104,7 @@ extern void show_pte(struct mm_struct *mm, unsigned long addr); | |||
104 | extern void __show_regs(struct pt_regs *); | 104 | extern void __show_regs(struct pt_regs *); |
105 | 105 | ||
106 | extern int cpu_architecture(void); | 106 | extern int cpu_architecture(void); |
107 | extern void cpu_init(void); | ||
107 | 108 | ||
108 | #define set_cr(x) \ | 109 | #define set_cr(x) \ |
109 | __asm__ __volatile__( \ | 110 | __asm__ __volatile__( \ |
@@ -307,7 +308,7 @@ do { \ | |||
307 | ({ \ | 308 | ({ \ |
308 | unsigned long flags; \ | 309 | unsigned long flags; \ |
309 | local_save_flags(flags); \ | 310 | local_save_flags(flags); \ |
310 | flags & PSR_I_BIT; \ | 311 | (int)(flags & PSR_I_BIT); \ |
311 | }) | 312 | }) |
312 | 313 | ||
313 | #ifdef CONFIG_SMP | 314 | #ifdef CONFIG_SMP |
diff --git a/include/asm-arm26/elf.h b/include/asm-arm26/elf.h index 8b149474db24..5a47fdb3015d 100644 --- a/include/asm-arm26/elf.h +++ b/include/asm-arm26/elf.h | |||
@@ -36,7 +36,7 @@ typedef struct { void *null; } elf_fpregset_t; | |||
36 | * These are used to set parameters in the core dumps. | 36 | * These are used to set parameters in the core dumps. |
37 | */ | 37 | */ |
38 | #define ELF_CLASS ELFCLASS32 | 38 | #define ELF_CLASS ELFCLASS32 |
39 | #define ELF_DATA ELFDATA2LSB; | 39 | #define ELF_DATA ELFDATA2LSB |
40 | #define ELF_ARCH EM_ARM | 40 | #define ELF_ARCH EM_ARM |
41 | 41 | ||
42 | #define USE_ELF_CORE_DUMP | 42 | #define USE_ELF_CORE_DUMP |
diff --git a/include/asm-arm26/signal.h b/include/asm-arm26/signal.h index dedb29280303..37ad25355591 100644 --- a/include/asm-arm26/signal.h +++ b/include/asm-arm26/signal.h | |||
@@ -166,9 +166,6 @@ typedef struct sigaltstack { | |||
166 | #include <asm/sigcontext.h> | 166 | #include <asm/sigcontext.h> |
167 | 167 | ||
168 | #define sigmask(sig) (1UL << ((sig) - 1)) | 168 | #define sigmask(sig) (1UL << ((sig) - 1)) |
169 | //FIXME!!! | ||
170 | //#define HAVE_ARCH_GET_SIGNAL_TO_DELIVER | ||
171 | |||
172 | #endif | 169 | #endif |
173 | 170 | ||
174 | 171 | ||
diff --git a/include/asm-generic/pgtable.h b/include/asm-generic/pgtable.h index 1f4ec7b70270..f40593565173 100644 --- a/include/asm-generic/pgtable.h +++ b/include/asm-generic/pgtable.h | |||
@@ -125,6 +125,9 @@ static inline void ptep_set_wrprotect(struct mm_struct *mm, unsigned long addres | |||
125 | 125 | ||
126 | #ifndef __HAVE_ARCH_PAGE_TEST_AND_CLEAR_DIRTY | 126 | #ifndef __HAVE_ARCH_PAGE_TEST_AND_CLEAR_DIRTY |
127 | #define page_test_and_clear_dirty(page) (0) | 127 | #define page_test_and_clear_dirty(page) (0) |
128 | #define pte_maybe_dirty(pte) pte_dirty(pte) | ||
129 | #else | ||
130 | #define pte_maybe_dirty(pte) (1) | ||
128 | #endif | 131 | #endif |
129 | 132 | ||
130 | #ifndef __HAVE_ARCH_PAGE_TEST_AND_CLEAR_YOUNG | 133 | #ifndef __HAVE_ARCH_PAGE_TEST_AND_CLEAR_YOUNG |
diff --git a/include/asm-h8300/kmap_types.h b/include/asm-h8300/kmap_types.h index 82431edeb2a1..1ec8a3427120 100644 --- a/include/asm-h8300/kmap_types.h +++ b/include/asm-h8300/kmap_types.h | |||
@@ -1,5 +1,5 @@ | |||
1 | #ifndef _ASM_KMAP_TYPES_H | 1 | #ifndef _ASM_H8300_KMAP_TYPES_H |
2 | #define _ASM_KMAP_TYPES_H | 2 | #define _ASM_H8300_KMAP_TYPES_H |
3 | 3 | ||
4 | enum km_type { | 4 | enum km_type { |
5 | KM_BOUNCE_READ, | 5 | KM_BOUNCE_READ, |
@@ -13,6 +13,8 @@ enum km_type { | |||
13 | KM_PTE1, | 13 | KM_PTE1, |
14 | KM_IRQ0, | 14 | KM_IRQ0, |
15 | KM_IRQ1, | 15 | KM_IRQ1, |
16 | KM_SOFTIRQ0, | ||
17 | KM_SOFTIRQ1, | ||
16 | KM_TYPE_NR | 18 | KM_TYPE_NR |
17 | }; | 19 | }; |
18 | 20 | ||
diff --git a/include/asm-h8300/mman.h b/include/asm-h8300/mman.h index abe08856c84f..63f727a59850 100644 --- a/include/asm-h8300/mman.h +++ b/include/asm-h8300/mman.h | |||
@@ -4,6 +4,7 @@ | |||
4 | #define PROT_READ 0x1 /* page can be read */ | 4 | #define PROT_READ 0x1 /* page can be read */ |
5 | #define PROT_WRITE 0x2 /* page can be written */ | 5 | #define PROT_WRITE 0x2 /* page can be written */ |
6 | #define PROT_EXEC 0x4 /* page can be executed */ | 6 | #define PROT_EXEC 0x4 /* page can be executed */ |
7 | #define PROT_SEM 0x8 /* page may be used for atomic ops */ | ||
7 | #define PROT_NONE 0x0 /* page can not be accessed */ | 8 | #define PROT_NONE 0x0 /* page can not be accessed */ |
8 | #define PROT_GROWSDOWN 0x01000000 /* mprotect flag: extend change to start of growsdown vma */ | 9 | #define PROT_GROWSDOWN 0x01000000 /* mprotect flag: extend change to start of growsdown vma */ |
9 | #define PROT_GROWSUP 0x02000000 /* mprotect flag: extend change to end of growsup vma */ | 10 | #define PROT_GROWSUP 0x02000000 /* mprotect flag: extend change to end of growsup vma */ |
@@ -19,6 +20,8 @@ | |||
19 | #define MAP_EXECUTABLE 0x1000 /* mark it as an executable */ | 20 | #define MAP_EXECUTABLE 0x1000 /* mark it as an executable */ |
20 | #define MAP_LOCKED 0x2000 /* pages are locked */ | 21 | #define MAP_LOCKED 0x2000 /* pages are locked */ |
21 | #define MAP_NORESERVE 0x4000 /* don't check for reservations */ | 22 | #define MAP_NORESERVE 0x4000 /* don't check for reservations */ |
23 | #define MAP_POPULATE 0x8000 /* populate (prefault) pagetables */ | ||
24 | #define MAP_NONBLOCK 0x10000 /* do not block on IO */ | ||
22 | 25 | ||
23 | #define MS_ASYNC 1 /* sync memory asynchronously */ | 26 | #define MS_ASYNC 1 /* sync memory asynchronously */ |
24 | #define MS_INVALIDATE 2 /* invalidate the caches */ | 27 | #define MS_INVALIDATE 2 /* invalidate the caches */ |
diff --git a/include/asm-i386/agp.h b/include/asm-i386/agp.h index a917ff50354f..b82f5f3ab887 100644 --- a/include/asm-i386/agp.h +++ b/include/asm-i386/agp.h | |||
@@ -21,4 +21,14 @@ int unmap_page_from_agp(struct page *page); | |||
21 | worth it. Would need a page for it. */ | 21 | worth it. Would need a page for it. */ |
22 | #define flush_agp_cache() asm volatile("wbinvd":::"memory") | 22 | #define flush_agp_cache() asm volatile("wbinvd":::"memory") |
23 | 23 | ||
24 | /* Convert a physical address to an address suitable for the GART. */ | ||
25 | #define phys_to_gart(x) (x) | ||
26 | #define gart_to_phys(x) (x) | ||
27 | |||
28 | /* GATT allocation. Returns/accepts GATT kernel virtual address. */ | ||
29 | #define alloc_gatt_pages(order) \ | ||
30 | ((char *)__get_free_pages(GFP_KERNEL, (order))) | ||
31 | #define free_gatt_pages(table, order) \ | ||
32 | free_pages((unsigned long)(table), (order)) | ||
33 | |||
24 | #endif | 34 | #endif |
diff --git a/include/asm-i386/linkage.h b/include/asm-i386/linkage.h index af3d8571c5c7..f4a6ebac0247 100644 --- a/include/asm-i386/linkage.h +++ b/include/asm-i386/linkage.h | |||
@@ -5,9 +5,7 @@ | |||
5 | #define FASTCALL(x) x __attribute__((regparm(3))) | 5 | #define FASTCALL(x) x __attribute__((regparm(3))) |
6 | #define fastcall __attribute__((regparm(3))) | 6 | #define fastcall __attribute__((regparm(3))) |
7 | 7 | ||
8 | #ifdef CONFIG_REGPARM | 8 | #define prevent_tail_call(ret) __asm__ ("" : "=r" (ret) : "0" (ret)) |
9 | # define prevent_tail_call(ret) __asm__ ("" : "=r" (ret) : "0" (ret)) | ||
10 | #endif | ||
11 | 9 | ||
12 | #ifdef CONFIG_X86_ALIGNMENT_16 | 10 | #ifdef CONFIG_X86_ALIGNMENT_16 |
13 | #define __ALIGN .align 16,0x90 | 11 | #define __ALIGN .align 16,0x90 |
diff --git a/include/asm-i386/mach-numaq/mach_ipi.h b/include/asm-i386/mach-numaq/mach_ipi.h index 1b46fd3f2ae3..c6044488e9e6 100644 --- a/include/asm-i386/mach-numaq/mach_ipi.h +++ b/include/asm-i386/mach-numaq/mach_ipi.h | |||
@@ -1,7 +1,7 @@ | |||
1 | #ifndef __ASM_MACH_IPI_H | 1 | #ifndef __ASM_MACH_IPI_H |
2 | #define __ASM_MACH_IPI_H | 2 | #define __ASM_MACH_IPI_H |
3 | 3 | ||
4 | inline void send_IPI_mask_sequence(cpumask_t, int vector); | 4 | void send_IPI_mask_sequence(cpumask_t, int vector); |
5 | 5 | ||
6 | static inline void send_IPI_mask(cpumask_t mask, int vector) | 6 | static inline void send_IPI_mask(cpumask_t mask, int vector) |
7 | { | 7 | { |
diff --git a/include/asm-i386/page.h b/include/asm-i386/page.h index ed13969fa2d6..41400d342d44 100644 --- a/include/asm-i386/page.h +++ b/include/asm-i386/page.h | |||
@@ -68,6 +68,7 @@ typedef struct { unsigned long pgprot; } pgprot_t; | |||
68 | #define HPAGE_MASK (~(HPAGE_SIZE - 1)) | 68 | #define HPAGE_MASK (~(HPAGE_SIZE - 1)) |
69 | #define HUGETLB_PAGE_ORDER (HPAGE_SHIFT - PAGE_SHIFT) | 69 | #define HUGETLB_PAGE_ORDER (HPAGE_SHIFT - PAGE_SHIFT) |
70 | #define HAVE_ARCH_HUGETLB_UNMAPPED_AREA | 70 | #define HAVE_ARCH_HUGETLB_UNMAPPED_AREA |
71 | #define ARCH_HAS_HUGETLB_CLEAN_STALE_PGTABLE | ||
71 | #endif | 72 | #endif |
72 | 73 | ||
73 | #define pgd_val(x) ((x).pgd) | 74 | #define pgd_val(x) ((x).pgd) |
diff --git a/include/asm-i386/pgtable.h b/include/asm-i386/pgtable.h index 8d60c2b4b003..e9efe148fdf7 100644 --- a/include/asm-i386/pgtable.h +++ b/include/asm-i386/pgtable.h | |||
@@ -236,6 +236,7 @@ static inline pte_t pte_mkexec(pte_t pte) { (pte).pte_low |= _PAGE_USER; return | |||
236 | static inline pte_t pte_mkdirty(pte_t pte) { (pte).pte_low |= _PAGE_DIRTY; return pte; } | 236 | static inline pte_t pte_mkdirty(pte_t pte) { (pte).pte_low |= _PAGE_DIRTY; return pte; } |
237 | static inline pte_t pte_mkyoung(pte_t pte) { (pte).pte_low |= _PAGE_ACCESSED; return pte; } | 237 | static inline pte_t pte_mkyoung(pte_t pte) { (pte).pte_low |= _PAGE_ACCESSED; return pte; } |
238 | static inline pte_t pte_mkwrite(pte_t pte) { (pte).pte_low |= _PAGE_RW; return pte; } | 238 | static inline pte_t pte_mkwrite(pte_t pte) { (pte).pte_low |= _PAGE_RW; return pte; } |
239 | static inline pte_t pte_mkhuge(pte_t pte) { (pte).pte_low |= _PAGE_PRESENT | _PAGE_PSE; return pte; } | ||
239 | 240 | ||
240 | #ifdef CONFIG_X86_PAE | 241 | #ifdef CONFIG_X86_PAE |
241 | # include <asm/pgtable-3level.h> | 242 | # include <asm/pgtable-3level.h> |
@@ -275,7 +276,6 @@ static inline void ptep_set_wrprotect(struct mm_struct *mm, unsigned long addr, | |||
275 | */ | 276 | */ |
276 | 277 | ||
277 | #define mk_pte(page, pgprot) pfn_pte(page_to_pfn(page), (pgprot)) | 278 | #define mk_pte(page, pgprot) pfn_pte(page_to_pfn(page), (pgprot)) |
278 | #define mk_pte_huge(entry) ((entry).pte_low |= _PAGE_PRESENT | _PAGE_PSE) | ||
279 | 279 | ||
280 | static inline pte_t pte_modify(pte_t pte, pgprot_t newprot) | 280 | static inline pte_t pte_modify(pte_t pte, pgprot_t newprot) |
281 | { | 281 | { |
diff --git a/include/asm-i386/smp.h b/include/asm-i386/smp.h index e03a206dfa36..55ef31f66bbe 100644 --- a/include/asm-i386/smp.h +++ b/include/asm-i386/smp.h | |||
@@ -51,7 +51,7 @@ extern u8 x86_cpu_to_apicid[]; | |||
51 | * from the initial startup. We map APIC_BASE very early in page_setup(), | 51 | * from the initial startup. We map APIC_BASE very early in page_setup(), |
52 | * so this is correct in the x86 case. | 52 | * so this is correct in the x86 case. |
53 | */ | 53 | */ |
54 | #define __smp_processor_id() (current_thread_info()->cpu) | 54 | #define raw_smp_processor_id() (current_thread_info()->cpu) |
55 | 55 | ||
56 | extern cpumask_t cpu_callout_map; | 56 | extern cpumask_t cpu_callout_map; |
57 | extern cpumask_t cpu_callin_map; | 57 | extern cpumask_t cpu_callin_map; |
diff --git a/include/asm-i386/timer.h b/include/asm-i386/timer.h index 40c54f69780e..c34709849839 100644 --- a/include/asm-i386/timer.h +++ b/include/asm-i386/timer.h | |||
@@ -53,6 +53,7 @@ extern struct init_timer_opts timer_cyclone_init; | |||
53 | 53 | ||
54 | extern unsigned long calibrate_tsc(void); | 54 | extern unsigned long calibrate_tsc(void); |
55 | extern void init_cpu_khz(void); | 55 | extern void init_cpu_khz(void); |
56 | extern int recalibrate_cpu_khz(void); | ||
56 | #ifdef CONFIG_HPET_TIMER | 57 | #ifdef CONFIG_HPET_TIMER |
57 | extern struct init_timer_opts timer_hpet_init; | 58 | extern struct init_timer_opts timer_hpet_init; |
58 | extern unsigned long calibrate_tsc_hpet(unsigned long *tsc_hpet_quotient_ptr); | 59 | extern unsigned long calibrate_tsc_hpet(unsigned long *tsc_hpet_quotient_ptr); |
diff --git a/include/asm-i386/unistd.h b/include/asm-i386/unistd.h index 61bcc1b1e3f4..176413fb9ae3 100644 --- a/include/asm-i386/unistd.h +++ b/include/asm-i386/unistd.h | |||
@@ -256,7 +256,7 @@ | |||
256 | #define __NR_io_submit 248 | 256 | #define __NR_io_submit 248 |
257 | #define __NR_io_cancel 249 | 257 | #define __NR_io_cancel 249 |
258 | #define __NR_fadvise64 250 | 258 | #define __NR_fadvise64 250 |
259 | 259 | #define __NR_set_zone_reclaim 251 | |
260 | #define __NR_exit_group 252 | 260 | #define __NR_exit_group 252 |
261 | #define __NR_lookup_dcookie 253 | 261 | #define __NR_lookup_dcookie 253 |
262 | #define __NR_epoll_create 254 | 262 | #define __NR_epoll_create 254 |
diff --git a/include/asm-ia64/agp.h b/include/asm-ia64/agp.h index d1316f1e6ee1..4e517f0e6afa 100644 --- a/include/asm-ia64/agp.h +++ b/include/asm-ia64/agp.h | |||
@@ -18,4 +18,14 @@ | |||
18 | #define flush_agp_mappings() /* nothing */ | 18 | #define flush_agp_mappings() /* nothing */ |
19 | #define flush_agp_cache() mb() | 19 | #define flush_agp_cache() mb() |
20 | 20 | ||
21 | /* Convert a physical address to an address suitable for the GART. */ | ||
22 | #define phys_to_gart(x) (x) | ||
23 | #define gart_to_phys(x) (x) | ||
24 | |||
25 | /* GATT allocation. Returns/accepts GATT kernel virtual address. */ | ||
26 | #define alloc_gatt_pages(order) \ | ||
27 | ((char *)__get_free_pages(GFP_KERNEL, (order))) | ||
28 | #define free_gatt_pages(table, order) \ | ||
29 | free_pages((unsigned long)(table), (order)) | ||
30 | |||
21 | #endif /* _ASM_IA64_AGP_H */ | 31 | #endif /* _ASM_IA64_AGP_H */ |
diff --git a/include/asm-ia64/ioctl32.h b/include/asm-ia64/ioctl32.h deleted file mode 100644 index d0d227f45e05..000000000000 --- a/include/asm-ia64/ioctl32.h +++ /dev/null | |||
@@ -1 +0,0 @@ | |||
1 | #include <linux/ioctl32.h> | ||
diff --git a/include/asm-ia64/mmzone.h b/include/asm-ia64/mmzone.h index 9491dacc89cf..83ca4043fc11 100644 --- a/include/asm-ia64/mmzone.h +++ b/include/asm-ia64/mmzone.h | |||
@@ -15,6 +15,20 @@ | |||
15 | #include <asm/page.h> | 15 | #include <asm/page.h> |
16 | #include <asm/meminit.h> | 16 | #include <asm/meminit.h> |
17 | 17 | ||
18 | static inline int pfn_to_nid(unsigned long pfn) | ||
19 | { | ||
20 | #ifdef CONFIG_NUMA | ||
21 | extern int paddr_to_nid(unsigned long); | ||
22 | int nid = paddr_to_nid(pfn << PAGE_SHIFT); | ||
23 | if (nid < 0) | ||
24 | return 0; | ||
25 | else | ||
26 | return nid; | ||
27 | #else | ||
28 | return 0; | ||
29 | #endif | ||
30 | } | ||
31 | |||
18 | #ifdef CONFIG_DISCONTIGMEM | 32 | #ifdef CONFIG_DISCONTIGMEM |
19 | 33 | ||
20 | #ifdef CONFIG_IA64_DIG /* DIG systems are small */ | 34 | #ifdef CONFIG_IA64_DIG /* DIG systems are small */ |
diff --git a/include/asm-ia64/perfmon.h b/include/asm-ia64/perfmon.h index ed5416c5b1ac..7f3333dd00e4 100644 --- a/include/asm-ia64/perfmon.h +++ b/include/asm-ia64/perfmon.h | |||
@@ -177,6 +177,10 @@ typedef union { | |||
177 | 177 | ||
178 | extern long perfmonctl(int fd, int cmd, void *arg, int narg); | 178 | extern long perfmonctl(int fd, int cmd, void *arg, int narg); |
179 | 179 | ||
180 | typedef struct { | ||
181 | void (*handler)(int irq, void *arg, struct pt_regs *regs); | ||
182 | } pfm_intr_handler_desc_t; | ||
183 | |||
180 | extern void pfm_save_regs (struct task_struct *); | 184 | extern void pfm_save_regs (struct task_struct *); |
181 | extern void pfm_load_regs (struct task_struct *); | 185 | extern void pfm_load_regs (struct task_struct *); |
182 | 186 | ||
@@ -187,6 +191,10 @@ extern void pfm_syst_wide_update_task(struct task_struct *, unsigned long info, | |||
187 | extern void pfm_inherit(struct task_struct *task, struct pt_regs *regs); | 191 | extern void pfm_inherit(struct task_struct *task, struct pt_regs *regs); |
188 | extern void pfm_init_percpu(void); | 192 | extern void pfm_init_percpu(void); |
189 | extern void pfm_handle_work(void); | 193 | extern void pfm_handle_work(void); |
194 | extern int pfm_install_alt_pmu_interrupt(pfm_intr_handler_desc_t *h); | ||
195 | extern int pfm_remove_alt_pmu_interrupt(pfm_intr_handler_desc_t *h); | ||
196 | |||
197 | |||
190 | 198 | ||
191 | /* | 199 | /* |
192 | * Reset PMD register flags | 200 | * Reset PMD register flags |
diff --git a/include/asm-ia64/pgtable.h b/include/asm-ia64/pgtable.h index ea121a002309..48586e08f432 100644 --- a/include/asm-ia64/pgtable.h +++ b/include/asm-ia64/pgtable.h | |||
@@ -8,7 +8,7 @@ | |||
8 | * This hopefully works with any (fixed) IA-64 page-size, as defined | 8 | * This hopefully works with any (fixed) IA-64 page-size, as defined |
9 | * in <asm/page.h>. | 9 | * in <asm/page.h>. |
10 | * | 10 | * |
11 | * Copyright (C) 1998-2004 Hewlett-Packard Co | 11 | * Copyright (C) 1998-2005 Hewlett-Packard Co |
12 | * David Mosberger-Tang <davidm@hpl.hp.com> | 12 | * David Mosberger-Tang <davidm@hpl.hp.com> |
13 | */ | 13 | */ |
14 | 14 | ||
@@ -283,6 +283,7 @@ ia64_phys_addr_valid (unsigned long addr) | |||
283 | #define pte_mkyoung(pte) (__pte(pte_val(pte) | _PAGE_A)) | 283 | #define pte_mkyoung(pte) (__pte(pte_val(pte) | _PAGE_A)) |
284 | #define pte_mkclean(pte) (__pte(pte_val(pte) & ~_PAGE_D)) | 284 | #define pte_mkclean(pte) (__pte(pte_val(pte) & ~_PAGE_D)) |
285 | #define pte_mkdirty(pte) (__pte(pte_val(pte) | _PAGE_D)) | 285 | #define pte_mkdirty(pte) (__pte(pte_val(pte) | _PAGE_D)) |
286 | #define pte_mkhuge(pte) (__pte(pte_val(pte) | _PAGE_P)) | ||
286 | 287 | ||
287 | /* | 288 | /* |
288 | * Macro to a page protection value as "uncacheable". Note that "protection" is really a | 289 | * Macro to a page protection value as "uncacheable". Note that "protection" is really a |
@@ -551,7 +552,11 @@ do { \ | |||
551 | 552 | ||
552 | /* These tell get_user_pages() that the first gate page is accessible from user-level. */ | 553 | /* These tell get_user_pages() that the first gate page is accessible from user-level. */ |
553 | #define FIXADDR_USER_START GATE_ADDR | 554 | #define FIXADDR_USER_START GATE_ADDR |
554 | #define FIXADDR_USER_END (GATE_ADDR + 2*PERCPU_PAGE_SIZE) | 555 | #ifdef HAVE_BUGGY_SEGREL |
556 | # define FIXADDR_USER_END (GATE_ADDR + 2*PAGE_SIZE) | ||
557 | #else | ||
558 | # define FIXADDR_USER_END (GATE_ADDR + 2*PERCPU_PAGE_SIZE) | ||
559 | #endif | ||
555 | 560 | ||
556 | #define __HAVE_ARCH_PTEP_TEST_AND_CLEAR_YOUNG | 561 | #define __HAVE_ARCH_PTEP_TEST_AND_CLEAR_YOUNG |
557 | #define __HAVE_ARCH_PTEP_TEST_AND_CLEAR_DIRTY | 562 | #define __HAVE_ARCH_PTEP_TEST_AND_CLEAR_DIRTY |
diff --git a/include/asm-ia64/processor.h b/include/asm-ia64/processor.h index 9e1ba8b7fb68..91bbd1f22461 100644 --- a/include/asm-ia64/processor.h +++ b/include/asm-ia64/processor.h | |||
@@ -403,7 +403,10 @@ extern void ia64_setreg_unknown_kr (void); | |||
403 | * task_struct at this point. | 403 | * task_struct at this point. |
404 | */ | 404 | */ |
405 | 405 | ||
406 | /* Return TRUE if task T owns the fph partition of the CPU we're running on. */ | 406 | /* |
407 | * Return TRUE if task T owns the fph partition of the CPU we're running on. | ||
408 | * Must be called from code that has preemption disabled. | ||
409 | */ | ||
407 | #define ia64_is_local_fpu_owner(t) \ | 410 | #define ia64_is_local_fpu_owner(t) \ |
408 | ({ \ | 411 | ({ \ |
409 | struct task_struct *__ia64_islfo_task = (t); \ | 412 | struct task_struct *__ia64_islfo_task = (t); \ |
@@ -411,7 +414,10 @@ extern void ia64_setreg_unknown_kr (void); | |||
411 | && __ia64_islfo_task == (struct task_struct *) ia64_get_kr(IA64_KR_FPU_OWNER)); \ | 414 | && __ia64_islfo_task == (struct task_struct *) ia64_get_kr(IA64_KR_FPU_OWNER)); \ |
412 | }) | 415 | }) |
413 | 416 | ||
414 | /* Mark task T as owning the fph partition of the CPU we're running on. */ | 417 | /* |
418 | * Mark task T as owning the fph partition of the CPU we're running on. | ||
419 | * Must be called from code that has preemption disabled. | ||
420 | */ | ||
415 | #define ia64_set_local_fpu_owner(t) do { \ | 421 | #define ia64_set_local_fpu_owner(t) do { \ |
416 | struct task_struct *__ia64_slfo_task = (t); \ | 422 | struct task_struct *__ia64_slfo_task = (t); \ |
417 | __ia64_slfo_task->thread.last_fph_cpu = smp_processor_id(); \ | 423 | __ia64_slfo_task->thread.last_fph_cpu = smp_processor_id(); \ |
diff --git a/include/asm-ia64/smp.h b/include/asm-ia64/smp.h index 3ba1a061e4ae..a3914352c995 100644 --- a/include/asm-ia64/smp.h +++ b/include/asm-ia64/smp.h | |||
@@ -46,7 +46,7 @@ ia64_get_lid (void) | |||
46 | #define SMP_IRQ_REDIRECTION (1 << 0) | 46 | #define SMP_IRQ_REDIRECTION (1 << 0) |
47 | #define SMP_IPI_REDIRECTION (1 << 1) | 47 | #define SMP_IPI_REDIRECTION (1 << 1) |
48 | 48 | ||
49 | #define smp_processor_id() (current_thread_info()->cpu) | 49 | #define raw_smp_processor_id() (current_thread_info()->cpu) |
50 | 50 | ||
51 | extern struct smp_boot_data { | 51 | extern struct smp_boot_data { |
52 | int cpu_count; | 52 | int cpu_count; |
diff --git a/include/asm-ia64/sn/mspec.h b/include/asm-ia64/sn/mspec.h new file mode 100644 index 000000000000..dbe13c6121a8 --- /dev/null +++ b/include/asm-ia64/sn/mspec.h | |||
@@ -0,0 +1,59 @@ | |||
1 | /* | ||
2 | * | ||
3 | * This file is subject to the terms and conditions of the GNU General Public | ||
4 | * License. See the file "COPYING" in the main directory of this archive | ||
5 | * for more details. | ||
6 | * | ||
7 | * Copyright (c) 2001-2004 Silicon Graphics, Inc. All rights reserved. | ||
8 | */ | ||
9 | |||
10 | #ifndef _ASM_IA64_SN_MSPEC_H | ||
11 | #define _ASM_IA64_SN_MSPEC_H | ||
12 | |||
13 | #define FETCHOP_VAR_SIZE 64 /* 64 byte per fetchop variable */ | ||
14 | |||
15 | #define FETCHOP_LOAD 0 | ||
16 | #define FETCHOP_INCREMENT 8 | ||
17 | #define FETCHOP_DECREMENT 16 | ||
18 | #define FETCHOP_CLEAR 24 | ||
19 | |||
20 | #define FETCHOP_STORE 0 | ||
21 | #define FETCHOP_AND 24 | ||
22 | #define FETCHOP_OR 32 | ||
23 | |||
24 | #define FETCHOP_CLEAR_CACHE 56 | ||
25 | |||
26 | #define FETCHOP_LOAD_OP(addr, op) ( \ | ||
27 | *(volatile long *)((char*) (addr) + (op))) | ||
28 | |||
29 | #define FETCHOP_STORE_OP(addr, op, x) ( \ | ||
30 | *(volatile long *)((char*) (addr) + (op)) = (long) (x)) | ||
31 | |||
32 | #ifdef __KERNEL__ | ||
33 | |||
34 | /* | ||
35 | * Each Atomic Memory Operation (AMO formerly known as fetchop) | ||
36 | * variable is 64 bytes long. The first 8 bytes are used. The | ||
37 | * remaining 56 bytes are unaddressable due to the operation taking | ||
38 | * that portion of the address. | ||
39 | * | ||
40 | * NOTE: The AMO_t _MUST_ be placed in either the first or second half | ||
41 | * of the cache line. The cache line _MUST NOT_ be used for anything | ||
42 | * other than additional AMO_t entries. This is because there are two | ||
43 | * addresses which reference the same physical cache line. One will | ||
44 | * be a cached entry with the memory type bits all set. This address | ||
45 | * may be loaded into processor cache. The AMO_t will be referenced | ||
46 | * uncached via the memory special memory type. If any portion of the | ||
47 | * cached cache-line is modified, when that line is flushed, it will | ||
48 | * overwrite the uncached value in physical memory and lead to | ||
49 | * inconsistency. | ||
50 | */ | ||
51 | typedef struct { | ||
52 | u64 variable; | ||
53 | u64 unused[7]; | ||
54 | } AMO_t; | ||
55 | |||
56 | |||
57 | #endif /* __KERNEL__ */ | ||
58 | |||
59 | #endif /* _ASM_IA64_SN_MSPEC_H */ | ||
diff --git a/include/asm-ia64/sn/sn_sal.h b/include/asm-ia64/sn/sn_sal.h index 56d74ca76b5d..eb0395ad0d6a 100644 --- a/include/asm-ia64/sn/sn_sal.h +++ b/include/asm-ia64/sn/sn_sal.h | |||
@@ -115,6 +115,13 @@ | |||
115 | #define SAL_IROUTER_INTR_XMIT SAL_CONSOLE_INTR_XMIT | 115 | #define SAL_IROUTER_INTR_XMIT SAL_CONSOLE_INTR_XMIT |
116 | #define SAL_IROUTER_INTR_RECV SAL_CONSOLE_INTR_RECV | 116 | #define SAL_IROUTER_INTR_RECV SAL_CONSOLE_INTR_RECV |
117 | 117 | ||
118 | /* | ||
119 | * Error Handling Features | ||
120 | */ | ||
121 | #define SAL_ERR_FEAT_MCA_SLV_TO_OS_INIT_SLV 0x1 | ||
122 | #define SAL_ERR_FEAT_LOG_SBES 0x2 | ||
123 | #define SAL_ERR_FEAT_MFR_OVERRIDE 0x4 | ||
124 | #define SAL_ERR_FEAT_SBE_THRESHOLD 0xffff0000 | ||
118 | 125 | ||
119 | /* | 126 | /* |
120 | * SAL Error Codes | 127 | * SAL Error Codes |
@@ -342,6 +349,25 @@ ia64_sn_plat_cpei_handler(void) | |||
342 | } | 349 | } |
343 | 350 | ||
344 | /* | 351 | /* |
352 | * Set Error Handling Features | ||
353 | */ | ||
354 | static inline u64 | ||
355 | ia64_sn_plat_set_error_handling_features(void) | ||
356 | { | ||
357 | struct ia64_sal_retval ret_stuff; | ||
358 | |||
359 | ret_stuff.status = 0; | ||
360 | ret_stuff.v0 = 0; | ||
361 | ret_stuff.v1 = 0; | ||
362 | ret_stuff.v2 = 0; | ||
363 | SAL_CALL_REENTRANT(ret_stuff, SN_SAL_SET_ERROR_HANDLING_FEATURES, | ||
364 | (SAL_ERR_FEAT_MCA_SLV_TO_OS_INIT_SLV | SAL_ERR_FEAT_LOG_SBES), | ||
365 | 0, 0, 0, 0, 0, 0); | ||
366 | |||
367 | return ret_stuff.status; | ||
368 | } | ||
369 | |||
370 | /* | ||
345 | * Checks for console input. | 371 | * Checks for console input. |
346 | */ | 372 | */ |
347 | static inline u64 | 373 | static inline u64 |
@@ -472,7 +498,7 @@ static inline u64 | |||
472 | ia64_sn_pod_mode(void) | 498 | ia64_sn_pod_mode(void) |
473 | { | 499 | { |
474 | struct ia64_sal_retval isrv; | 500 | struct ia64_sal_retval isrv; |
475 | SAL_CALL(isrv, SN_SAL_POD_MODE, 0, 0, 0, 0, 0, 0, 0); | 501 | SAL_CALL_REENTRANT(isrv, SN_SAL_POD_MODE, 0, 0, 0, 0, 0, 0, 0); |
476 | if (isrv.status) | 502 | if (isrv.status) |
477 | return 0; | 503 | return 0; |
478 | return isrv.v0; | 504 | return isrv.v0; |
diff --git a/include/asm-ia64/uncached.h b/include/asm-ia64/uncached.h new file mode 100644 index 000000000000..b82d923b73c1 --- /dev/null +++ b/include/asm-ia64/uncached.h | |||
@@ -0,0 +1,12 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2001-2005 Silicon Graphics, Inc. All rights reserved. | ||
3 | * | ||
4 | * This program is free software; you can redistribute it and/or modify it | ||
5 | * under the terms of version 2 of the GNU General Public License | ||
6 | * as published by the Free Software Foundation. | ||
7 | * | ||
8 | * Prototypes for the uncached page allocator | ||
9 | */ | ||
10 | |||
11 | extern unsigned long uncached_alloc_page(int nid); | ||
12 | extern void uncached_free_page(unsigned long); | ||
diff --git a/include/asm-ia64/unistd.h b/include/asm-ia64/unistd.h index 33e26c557c5c..f7f43ec2483a 100644 --- a/include/asm-ia64/unistd.h +++ b/include/asm-ia64/unistd.h | |||
@@ -263,6 +263,7 @@ | |||
263 | #define __NR_add_key 1271 | 263 | #define __NR_add_key 1271 |
264 | #define __NR_request_key 1272 | 264 | #define __NR_request_key 1272 |
265 | #define __NR_keyctl 1273 | 265 | #define __NR_keyctl 1273 |
266 | #define __NR_set_zone_reclaim 1276 | ||
266 | 267 | ||
267 | #ifdef __KERNEL__ | 268 | #ifdef __KERNEL__ |
268 | 269 | ||
diff --git a/include/asm-m32r/div64.h b/include/asm-m32r/div64.h index 417a51bd552d..6cd978cefb28 100644 --- a/include/asm-m32r/div64.h +++ b/include/asm-m32r/div64.h | |||
@@ -1,38 +1 @@ | |||
1 | #ifndef _ASM_M32R_DIV64 | #include <asm-generic/div64.h> | |
2 | #define _ASM_M32R_DIV64 | ||
3 | |||
4 | /* $Id$ */ | ||
5 | |||
6 | /* unsigned long long division. | ||
7 | * Input: | ||
8 | * unsigned long long n | ||
9 | * unsigned long base | ||
10 | * Output: | ||
11 | * n = n / base; | ||
12 | * return value = n % base; | ||
13 | */ | ||
14 | #define do_div(n, base) \ | ||
15 | ({ \ | ||
16 | unsigned long _res, _high, _mid, _low; \ | ||
17 | \ | ||
18 | _low = (n) & 0xffffffffUL; \ | ||
19 | _high = (n) >> 32; \ | ||
20 | if (_high) { \ | ||
21 | _mid = (_high % (unsigned long)(base)) << 16; \ | ||
22 | _high = _high / (unsigned long)(base); \ | ||
23 | _mid += _low >> 16; \ | ||
24 | _low &= 0x0000ffffUL; \ | ||
25 | _low += (_mid % (unsigned long)(base)) << 16; \ | ||
26 | _mid = _mid / (unsigned long)(base); \ | ||
27 | _res = _low % (unsigned long)(base); \ | ||
28 | _low = _low / (unsigned long)(base); \ | ||
29 | n = _low + ((long long)_mid << 16) + \ | ||
30 | ((long long)_high << 32); \ | ||
31 | } else { \ | ||
32 | _res = _low % (unsigned long)(base); \ | ||
33 | n = (_low / (unsigned long)(base)); \ | ||
34 | } \ | ||
35 | _res; \ | ||
36 | }) | ||
37 | |||
38 | #endif /* _ASM_M32R_DIV64 */ | ||
diff --git a/include/asm-m32r/ide.h b/include/asm-m32r/ide.h index be64f24e37ee..194393bd8beb 100644 --- a/include/asm-m32r/ide.h +++ b/include/asm-m32r/ide.h | |||
@@ -35,7 +35,7 @@ | |||
35 | static __inline__ int ide_default_irq(unsigned long base) | 35 | static __inline__ int ide_default_irq(unsigned long base) |
36 | { | 36 | { |
37 | switch (base) { | 37 | switch (base) { |
38 | #if defined(CONFIG_PLAT_M32700UT) || defined(CONFIG_PLAT_MAPPI2) | 38 | #if defined(CONFIG_PLAT_M32700UT) || defined(CONFIG_PLAT_MAPPI2) || defined(CONFIG_PLAT_MAPPI3) |
39 | case 0x1f0: return PLD_IRQ_CFIREQ; | 39 | case 0x1f0: return PLD_IRQ_CFIREQ; |
40 | default: | 40 | default: |
41 | return 0; | 41 | return 0; |
diff --git a/include/asm-m32r/m32102.h b/include/asm-m32r/m32102.h index b56034026bf8..cb98101f4f6e 100644 --- a/include/asm-m32r/m32102.h +++ b/include/asm-m32r/m32102.h | |||
@@ -175,6 +175,7 @@ | |||
175 | #define M32R_ICU_CR5_PORTL (0x210+M32R_ICU_OFFSET) /* INT4 */ | 175 | #define M32R_ICU_CR5_PORTL (0x210+M32R_ICU_OFFSET) /* INT4 */ |
176 | #define M32R_ICU_CR6_PORTL (0x214+M32R_ICU_OFFSET) /* INT5 */ | 176 | #define M32R_ICU_CR6_PORTL (0x214+M32R_ICU_OFFSET) /* INT5 */ |
177 | #define M32R_ICU_CR7_PORTL (0x218+M32R_ICU_OFFSET) /* INT6 */ | 177 | #define M32R_ICU_CR7_PORTL (0x218+M32R_ICU_OFFSET) /* INT6 */ |
178 | #define M32R_ICU_CR8_PORTL (0x219+M32R_ICU_OFFSET) /* INT7 */ | ||
178 | #define M32R_ICU_CR16_PORTL (0x23C+M32R_ICU_OFFSET) /* MFT0 */ | 179 | #define M32R_ICU_CR16_PORTL (0x23C+M32R_ICU_OFFSET) /* MFT0 */ |
179 | #define M32R_ICU_CR17_PORTL (0x240+M32R_ICU_OFFSET) /* MFT1 */ | 180 | #define M32R_ICU_CR17_PORTL (0x240+M32R_ICU_OFFSET) /* MFT1 */ |
180 | #define M32R_ICU_CR18_PORTL (0x244+M32R_ICU_OFFSET) /* MFT2 */ | 181 | #define M32R_ICU_CR18_PORTL (0x244+M32R_ICU_OFFSET) /* MFT2 */ |
diff --git a/include/asm-m32r/m32102peri.h b/include/asm-m32r/m32102peri.h deleted file mode 100644 index 3c12955ad0f0..000000000000 --- a/include/asm-m32r/m32102peri.h +++ /dev/null | |||
@@ -1,468 +0,0 @@ | |||
1 | /* $Id$ | ||
2 | * | ||
3 | * This file is subject to the terms and conditions of the GNU General Public | ||
4 | * License. See the file "COPYING" in the main directory of this archive | ||
5 | * for more details. | ||
6 | * | ||
7 | * Copyright (C) 2000,2001 by Hiroyuki Kondo | ||
8 | */ | ||
9 | |||
10 | #ifndef __ASSEMBLY__ | ||
11 | |||
12 | typedef void V; | ||
13 | typedef char B; | ||
14 | typedef short S; | ||
15 | typedef int W; | ||
16 | typedef long L; | ||
17 | typedef float F; | ||
18 | typedef double D; | ||
19 | typedef unsigned char UB; | ||
20 | typedef unsigned short US; | ||
21 | typedef unsigned int UW; | ||
22 | typedef unsigned long UL; | ||
23 | typedef const unsigned int CUW; | ||
24 | |||
25 | /********************************* | ||
26 | |||
27 | M32102 ICU | ||
28 | |||
29 | *********************************/ | ||
30 | #define ICUISTS (UW *)0xa0EFF004 | ||
31 | #define ICUIREQ0 (UW *)0xa0EFF008 | ||
32 | #define ICUIREQ1 (UW *)0xa0EFF00C | ||
33 | |||
34 | #define ICUSBICR (UW *)0xa0EFF018 | ||
35 | #define ICUIMASK (UW *)0xa0EFF01C | ||
36 | |||
37 | #define ICUCR1 (UW *)0xa0EFF200 /* INT0 */ | ||
38 | #define ICUCR2 (UW *)0xa0EFF204 /* INT1 */ | ||
39 | #define ICUCR3 (UW *)0xa0EFF208 /* INT2 */ | ||
40 | #define ICUCR4 (UW *)0xa0EFF20C /* INT3 */ | ||
41 | #define ICUCR5 (UW *)0xa0EFF210 /* INT4 */ | ||
42 | #define ICUCR6 (UW *)0xa0EFF214 /* INT5 */ | ||
43 | #define ICUCR7 (UW *)0xa0EFF218 /* INT6 */ | ||
44 | |||
45 | #define ICUCR16 (UW *)0xa0EFF23C /* MFT0 */ | ||
46 | #define ICUCR17 (UW *)0xa0EFF240 /* MFT1 */ | ||
47 | #define ICUCR18 (UW *)0xa0EFF244 /* MFT2 */ | ||
48 | #define ICUCR19 (UW *)0xa0EFF248 /* MFT3 */ | ||
49 | #define ICUCR20 (UW *)0xa0EFF24C /* MFT4 */ | ||
50 | #define ICUCR21 (UW *)0xa0EFF250 /* MFT5 */ | ||
51 | |||
52 | #define ICUCR32 (UW *)0xa0EFF27C /* DMA0 */ | ||
53 | #define ICUCR33 (UW *)0xa0EFF280 /* DMA1 */ | ||
54 | |||
55 | #define ICUCR48 (UW *)0xa0EFF2BC /* SIO0R */ | ||
56 | #define ICUCR49 (UW *)0xa0EFF2C0 /* SIO0S */ | ||
57 | #define ICUCR50 (UW *)0xa0EFF2C4 /* SIO1R */ | ||
58 | #define ICUCR51 (UW *)0xa0EFF2C8 /* SIO1S */ | ||
59 | #define ICUCR52 (UW *)0xa0EFF2CC /* SIO2R */ | ||
60 | #define ICUCR53 (UW *)0xa0EFF2D0 /* SIO2S */ | ||
61 | #define ICUCR54 (UW *)0xa0EFF2D4 /* SIO3R */ | ||
62 | #define ICUCR55 (UW *)0xa0EFF2D8 /* SIO3S */ | ||
63 | #define ICUCR56 (UW *)0xa0EFF2DC /* SIO4R */ | ||
64 | #define ICUCR57 (UW *)0xa0EFF2E0 /* SIO4S */ | ||
65 | |||
66 | /********************************* | ||
67 | |||
68 | M32102 MFT | ||
69 | |||
70 | *********************************/ | ||
71 | #define MFTCR (US *)0xa0EFC002 | ||
72 | #define MFTRPR (UB *)0xa0EFC006 | ||
73 | |||
74 | #define MFT0MOD (US *)0xa0EFC102 | ||
75 | #define MFT0BOS (US *)0xa0EFC106 | ||
76 | #define MFT0CUT (US *)0xa0EFC10A | ||
77 | #define MFT0RLD (US *)0xa0EFC10E | ||
78 | #define MFT0CRLD (US *)0xa0EFC112 | ||
79 | |||
80 | #define MFT1MOD (US *)0xa0EFC202 | ||
81 | #define MFT1BOS (US *)0xa0EFC206 | ||
82 | #define MFT1CUT (US *)0xa0EFC20A | ||
83 | #define MFT1RLD (US *)0xa0EFC20E | ||
84 | #define MFT1CRLD (US *)0xa0EFC212 | ||
85 | |||
86 | #define MFT2MOD (US *)0xa0EFC302 | ||
87 | #define MFT2BOS (US *)0xa0EFC306 | ||
88 | #define MFT2CUT (US *)0xa0EFC30A | ||
89 | #define MFT2RLD (US *)0xa0EFC30E | ||
90 | #define MFT2CRLD (US *)0xa0EFC312 | ||
91 | |||
92 | #define MFT3MOD (US *)0xa0EFC402 | ||
93 | #define MFT3CUT (US *)0xa0EFC40A | ||
94 | #define MFT3RLD (US *)0xa0EFC40E | ||
95 | #define MFT3CRLD (US *)0xa0EFC412 | ||
96 | |||
97 | #define MFT4MOD (US *)0xa0EFC502 | ||
98 | #define MFT4CUT (US *)0xa0EFC50A | ||
99 | #define MFT4RLD (US *)0xa0EFC50E | ||
100 | #define MFT4CRLD (US *)0xa0EFC512 | ||
101 | |||
102 | #define MFT5MOD (US *)0xa0EFC602 | ||
103 | #define MFT5CUT (US *)0xa0EFC60A | ||
104 | #define MFT5RLD (US *)0xa0EFC60E | ||
105 | #define MFT5CRLD (US *)0xa0EFC612 | ||
106 | |||
107 | /********************************* | ||
108 | |||
109 | M32102 SIO | ||
110 | |||
111 | *********************************/ | ||
112 | |||
113 | #define SIO0CR (volatile int *)0xa0efd000 | ||
114 | #define SIO0MOD0 (volatile int *)0xa0efd004 | ||
115 | #define SIO0MOD1 (volatile int *)0xa0efd008 | ||
116 | #define SIO0STS (volatile int *)0xa0efd00c | ||
117 | #define SIO0IMASK (volatile int *)0xa0efd010 | ||
118 | #define SIO0BAUR (volatile int *)0xa0efd014 | ||
119 | #define SIO0RBAUR (volatile int *)0xa0efd018 | ||
120 | #define SIO0TXB (volatile int *)0xa0efd01c | ||
121 | #define SIO0RXB (volatile int *)0xa0efd020 | ||
122 | |||
123 | #define SIO1CR (volatile int *)0xa0efd100 | ||
124 | #define SIO1MOD0 (volatile int *)0xa0efd104 | ||
125 | #define SIO1MOD1 (volatile int *)0xa0efd108 | ||
126 | #define SIO1STS (volatile int *)0xa0efd10c | ||
127 | #define SIO1IMASK (volatile int *)0xa0efd110 | ||
128 | #define SIO1BAUR (volatile int *)0xa0efd114 | ||
129 | #define SIO1RBAUR (volatile int *)0xa0efd118 | ||
130 | #define SIO1TXB (volatile int *)0xa0efd11c | ||
131 | #define SIO1RXB (volatile int *)0xa0efd120 | ||
132 | /********************************* | ||
133 | |||
134 | M32102 PORT | ||
135 | |||
136 | *********************************/ | ||
137 | #define PIEN (UB *)0xa0EF1003 /* input enable */ | ||
138 | |||
139 | #define P0DATA (UB *)0xa0EF1020 /* data */ | ||
140 | #define P1DATA (UB *)0xa0EF1021 | ||
141 | #define P2DATA (UB *)0xa0EF1022 | ||
142 | #define P3DATA (UB *)0xa0EF1023 | ||
143 | #define P4DATA (UB *)0xa0EF1024 | ||
144 | #define P5DATA (UB *)0xa0EF1025 | ||
145 | #define P6DATA (UB *)0xa0EF1026 | ||
146 | #define P7DATA (UB *)0xa0EF1027 | ||
147 | |||
148 | #define P0DIR (UB *)0xa0EF1040 /* direction */ | ||
149 | #define P1DIR (UB *)0xa0EF1041 | ||
150 | #define P2DIR (UB *)0xa0EF1042 | ||
151 | #define P3DIR (UB *)0xa0EF1043 | ||
152 | #define P4DIR (UB *)0xa0EF1044 | ||
153 | #define P5DIR (UB *)0xa0EF1045 | ||
154 | #define P6DIR (UB *)0xa0EF1046 | ||
155 | #define P7DIR (UB *)0xa0EF1047 | ||
156 | |||
157 | #define P0MOD (US *)0xa0EF1060 /* mode control */ | ||
158 | #define P1MOD (US *)0xa0EF1062 | ||
159 | #define P2MOD (US *)0xa0EF1064 | ||
160 | #define P3MOD (US *)0xa0EF1066 | ||
161 | #define P4MOD (US *)0xa0EF1068 | ||
162 | #define P5MOD (US *)0xa0EF106A | ||
163 | #define P6MOD (US *)0xa0EF106C | ||
164 | #define P7MOD (US *)0xa0EF106E | ||
165 | |||
166 | #define P0ODCR (UB *)0xa0EF1080 /* open-drain control */ | ||
167 | #define P1ODCR (UB *)0xa0EF1081 | ||
168 | #define P2ODCR (UB *)0xa0EF1082 | ||
169 | #define P3ODCR (UB *)0xa0EF1083 | ||
170 | #define P4ODCR (UB *)0xa0EF1084 | ||
171 | #define P5ODCR (UB *)0xa0EF1085 | ||
172 | #define P6ODCR (UB *)0xa0EF1086 | ||
173 | #define P7ODCR (UB *)0xa0EF1087 | ||
174 | |||
175 | /********************************* | ||
176 | |||
177 | M32102 Cache | ||
178 | |||
179 | ********************************/ | ||
180 | |||
181 | #define MCCR (US *)0xFFFFFFFE | ||
182 | |||
183 | |||
184 | #else /* __ASSEMBLY__ */ | ||
185 | |||
186 | ;; | ||
187 | ;; PIO 0x80ef1000 | ||
188 | ;; | ||
189 | |||
190 | #define PIEN 0xa0ef1000 | ||
191 | |||
192 | #define P0DATA 0xa0ef1020 | ||
193 | #define P1DATA 0xa0ef1021 | ||
194 | #define P2DATA 0xa0ef1022 | ||
195 | #define P3DATA 0xa0ef1023 | ||
196 | #define P4DATA 0xa0ef1024 | ||
197 | #define P5DATA 0xa0ef1025 | ||
198 | #define P6DATA 0xa0ef1026 | ||
199 | #define P7DATA 0xa0ef1027 | ||
200 | |||
201 | #define P0DIR 0xa0ef1040 | ||
202 | #define P1DIR 0xa0ef1041 | ||
203 | #define P2DIR 0xa0ef1042 | ||
204 | #define P3DIR 0xa0ef1043 | ||
205 | #define P4DIR 0xa0ef1044 | ||
206 | #define P5DIR 0xa0ef1045 | ||
207 | #define P6DIR 0xa0ef1046 | ||
208 | #define P7DIR 0xa0ef1047 | ||
209 | |||
210 | #define P0MOD 0xa0ef1060 | ||
211 | #define P1MOD 0xa0ef1062 | ||
212 | #define P2MOD 0xa0ef1064 | ||
213 | #define P3MOD 0xa0ef1066 | ||
214 | #define P4MOD 0xa0ef1068 | ||
215 | #define P5MOD 0xa0ef106a | ||
216 | #define P6MOD 0xa0ef106c | ||
217 | #define P7MOD 0xa0ef106e | ||
218 | ; | ||
219 | #define P0ODCR 0xa0ef1080 | ||
220 | #define P1ODCR 0xa0ef1081 | ||
221 | #define P2ODCR 0xa0ef1082 | ||
222 | #define P3ODCR 0xa0ef1083 | ||
223 | #define P4ODCR 0xa0ef1084 | ||
224 | #define P5ODCR 0xa0ef1085 | ||
225 | #define P6ODCR 0xa0ef1086 | ||
226 | #define P7ODCR 0xa0ef1087 | ||
227 | |||
228 | ;; | ||
229 | ;; WDT 0xa0ef2000 | ||
230 | ;; | ||
231 | |||
232 | #define WDTCR 0xa0ef2000 | ||
233 | |||
234 | |||
235 | ;; | ||
236 | ;; CLK 0xa0ef4000 | ||
237 | ;; | ||
238 | |||
239 | #define CPUCLKCR 0xa0ef4000 | ||
240 | #define CLKMOD 0xa0ef4004 | ||
241 | #define PLLCR 0xa0ef4008 | ||
242 | |||
243 | |||
244 | ;; | ||
245 | ;; BSEL 0xa0ef5000 | ||
246 | ;; | ||
247 | |||
248 | #define BSEL0CR 0xa0ef5000 | ||
249 | #define BSEL1CR 0xa0ef5004 | ||
250 | #define BSEL2CR 0xa0ef5008 | ||
251 | #define BSEL3CR 0xa0ef500c | ||
252 | #define BSEL4CR 0xa0ef5010 | ||
253 | #define BSEL5CR 0xa0ef5014 | ||
254 | |||
255 | |||
256 | ;; | ||
257 | ;; SDRAMC 0xa0ef6000 | ||
258 | ;; | ||
259 | |||
260 | #define SDRF0 0xa0ef6000 | ||
261 | #define SDRF1 0xa0ef6004 | ||
262 | #define SDIR0 0xa0ef6008 | ||
263 | #define SDIR1 0xa0ef600c | ||
264 | #define SDBR 0xa0ef6010 | ||
265 | |||
266 | ;; CH0 | ||
267 | #define SD0ADR 0xa0ef6020 | ||
268 | #define SD0SZ 0xa0ef6022 | ||
269 | #define SD0ER 0xa0ef6024 | ||
270 | #define SD0TR 0xa0ef6028 | ||
271 | #define SD0MOD 0xa0ef602c | ||
272 | |||
273 | ;; CH1 | ||
274 | #define SD1ADR 0xa0ef6040 | ||
275 | #define SD1SZ 0xa0ef6042 | ||
276 | #define SD1ER 0xa0ef6044 | ||
277 | #define SD1TR 0xa0ef6048 | ||
278 | #define SD1MOD 0xa0ef604c | ||
279 | |||
280 | |||
281 | ;; | ||
282 | ;; DMAC 0xa0ef8000 | ||
283 | ;; | ||
284 | |||
285 | #define DMAEN 0xa0ef8000 | ||
286 | #define DMAISTS 0xa0ef8004 | ||
287 | #define DMAEDET 0xa0ef8008 | ||
288 | #define DMAASTS 0xa0ef800c | ||
289 | |||
290 | ;; CH0 | ||
291 | #define DMA0CR0 0xa0ef8100 | ||
292 | #define DMA0CR1 0xa0ef8104 | ||
293 | #define DMA0CSA 0xa0ef8108 | ||
294 | #define DMA0RSA 0xa0ef810c | ||
295 | #define DMA0CDA 0xa0ef8110 | ||
296 | #define DMA0RDA 0xa0ef8114 | ||
297 | #define DMA0CBCUT 0xa0ef8118 | ||
298 | #define DMA0RBCUT 0xa0ef811c | ||
299 | |||
300 | ;; CH1 | ||
301 | #define DMA1CR0 0xa0ef8200 | ||
302 | #define DMA1CR1 0xa0ef8204 | ||
303 | #define DMA1CSA 0xa0ef8208 | ||
304 | #define DMA1RSA 0xa0ef820c | ||
305 | #define DMA1CDA 0xa0ef8210 | ||
306 | #define DMA1RDA 0xa0ef8214 | ||
307 | #define DMA1CBCUT 0xa0ef8218 | ||
308 | #define DMA1RBCUT 0xa0ef821c | ||
309 | |||
310 | |||
311 | ;; | ||
312 | ;; MFT 0xa0efc000 | ||
313 | ;; | ||
314 | |||
315 | #define MFTCR 0xa0efc000 | ||
316 | #define MFTRPR 0xa0efc004 | ||
317 | |||
318 | ;; CH0 | ||
319 | #define MFT0MOD 0xa0efc100 | ||
320 | #define MFT0BOS 0xa0efc104 | ||
321 | #define MFT0CUT 0xa0efc108 | ||
322 | #define MFT0RLD 0xa0efc10c | ||
323 | #define MFT0CMPRLD 0xa0efc110 | ||
324 | |||
325 | ;; CH1 | ||
326 | #define MFT1MOD 0xa0efc200 | ||
327 | #define MFT1BOS 0xa0efc204 | ||
328 | #define MFT1CUT 0xa0efc208 | ||
329 | #define MFT1RLD 0xa0efc20c | ||
330 | #define MFT1CMPRLD 0xa0efc210 | ||
331 | |||
332 | ;; CH2 | ||
333 | #define MFT2MOD 0xa0efc300 | ||
334 | #define MFT2BOS 0xa0efc304 | ||
335 | #define MFT2CUT 0xa0efc308 | ||
336 | #define MFT2RLD 0xa0efc30c | ||
337 | #define MFT2CMPRLD 0xa0efc310 | ||
338 | |||
339 | ;; CH3 | ||
340 | #define MFT3MOD 0xa0efc400 | ||
341 | #define MFT3BOS 0xa0efc404 | ||
342 | #define MFT3CUT 0xa0efc408 | ||
343 | #define MFT3RLD 0xa0efc40c | ||
344 | #define MFT3CMPRLD 0xa0efc410 | ||
345 | |||
346 | ;; CH4 | ||
347 | #define MFT4MOD 0xa0efc500 | ||
348 | #define MFT4BOS 0xa0efc504 | ||
349 | #define MFT4CUT 0xa0efc508 | ||
350 | #define MFT4RLD 0xa0efc50c | ||
351 | #define MFT4CMPRLD 0xa0efc510 | ||
352 | |||
353 | ;; CH5 | ||
354 | #define MFT5MOD 0xa0efc600 | ||
355 | #define MFT5BOS 0xa0efc604 | ||
356 | #define MFT5CUT 0xa0efc608 | ||
357 | #define MFT5RLD 0xa0efc60c | ||
358 | #define MFT5CMPRLD 0xa0efc610 | ||
359 | |||
360 | |||
361 | ;; | ||
362 | ;; SIO 0xa0efd000 | ||
363 | ;; | ||
364 | |||
365 | ;; CH0 | ||
366 | #define SIO0CR 0xa0efd000 | ||
367 | #define SIO0MOD0 0xa0efd004 | ||
368 | #define SIO0MOD1 0xa0efd008 | ||
369 | #define SIO0STS 0xa0efd00c | ||
370 | #define SIO0IMASK 0xa0efd010 | ||
371 | #define SIO0BAUR 0xa0efd014 | ||
372 | #define SIO0RBAUR 0xa0efd018 | ||
373 | #define SIO0TXB 0xa0efd01c | ||
374 | #define SIO0RXB 0xa0efd020 | ||
375 | |||
376 | ;; CH1 | ||
377 | #define SIO1CR 0xa0efd100 | ||
378 | #define SIO1MOD0 0xa0efd104 | ||
379 | #define SIO1MOD1 0xa0efd108 | ||
380 | #define SIO1STS 0xa0efd10c | ||
381 | #define SIO1IMASK 0xa0efd110 | ||
382 | #define SIO1BAUR 0xa0efd114 | ||
383 | #define SIO1RBAUR 0xa0efd118 | ||
384 | #define SIO1TXB 0xa0efd11c | ||
385 | #define SIO1RXB 0xa0efd120 | ||
386 | |||
387 | ;; CH2 | ||
388 | #define SIO2CR 0xa0efd200 | ||
389 | #define SIO2MOD0 0xa0efd204 | ||
390 | #define SIO2MOD1 0xa0efd208 | ||
391 | #define SIO2STS 0xa0efd20c | ||
392 | #define SIO2IMASK 0xa0efd210 | ||
393 | #define SIO2BAUR 0xa0efd214 | ||
394 | #define SIO2RBAUR 0xa0efd218 | ||
395 | #define SIO2TXB 0xa0efd21c | ||
396 | #define SIO2RXB 0xa0efd220 | ||
397 | |||
398 | ;; CH3 | ||
399 | #define SIO3CR 0xa0efd300 | ||
400 | #define SIO3MOD0 0xa0efd304 | ||
401 | #define SIO3MOD1 0xa0efd308 | ||
402 | #define SIO3STS 0xa0efd30c | ||
403 | #define SIO3IMASK 0xa0efd310 | ||
404 | #define SIO3BAUR 0xa0efd314 | ||
405 | #define SIO3RBAUR 0xa0efd318 | ||
406 | #define SIO3TXB 0xa0efd31c | ||
407 | #define SIO3RXB 0xa0efd320 | ||
408 | |||
409 | ;; CH4 | ||
410 | #define SIO4CR 0xa0efd400 | ||
411 | #define SIO4MOD0 0xa0efd404 | ||
412 | #define SIO4MOD1 0xa0efd408 | ||
413 | #define SIO4STS 0xa0efd40c | ||
414 | #define SIO4IMASK 0xa0efd410 | ||
415 | #define SIO4BAUR 0xa0efd414 | ||
416 | #define SIO4RBAUR 0xa0efd418 | ||
417 | #define SIO4TXB 0xa0efd41c | ||
418 | #define SIO4RXB 0xa0efd420 | ||
419 | |||
420 | |||
421 | ;; | ||
422 | ;; ICU 0xa0eff000 | ||
423 | ;; | ||
424 | |||
425 | #define ICUISTS 0xa0eff004 | ||
426 | #define ICUIREQ0 0xa0eff008 | ||
427 | #define ICUIREQ1 0xa0eff00c | ||
428 | |||
429 | #define ICUSBICR 0xa0eff018 | ||
430 | #define ICUIMASK 0xa0eff01c | ||
431 | |||
432 | #define ICUCR1 0xa0eff200 | ||
433 | #define ICUCR2 0xa0eff204 | ||
434 | #define ICUCR3 0xa0eff208 | ||
435 | #define ICUCR4 0xa0eff20c | ||
436 | #define ICUCR5 0xa0eff210 | ||
437 | #define ICUCR6 0xa0eff214 | ||
438 | #define ICUCR7 0xa0eff218 | ||
439 | |||
440 | #define ICUCR16 0xa0eff23c | ||
441 | #define ICUCR17 0xa0eff240 | ||
442 | #define ICUCR18 0xa0eff244 | ||
443 | #define ICUCR19 0xa0eff248 | ||
444 | #define ICUCR20 0xa0eff24c | ||
445 | #define ICUCR21 0xa0eff250 | ||
446 | |||
447 | #define ICUCR32 0xa0eff27c | ||
448 | #define ICUCR33 0xa0eff280 | ||
449 | |||
450 | #define ICUCR48 0xa0eff2bc | ||
451 | #define ICUCR49 0xa0eff2c0 | ||
452 | #define ICUCR50 0xa0eff2c4 | ||
453 | #define ICUCR51 0xa0eff2c8 | ||
454 | #define ICUCR52 0xa0eff2cc | ||
455 | #define ICUCR53 0xa0eff2d0 | ||
456 | #define ICUCR54 0xa0eff2d4 | ||
457 | #define ICUCR55 0xa0eff2d8 | ||
458 | #define ICUCR56 0xa0eff2dc | ||
459 | #define ICUCR57 0xa0eff2e0 | ||
460 | |||
461 | ;; | ||
462 | ;; CACHE | ||
463 | ;; | ||
464 | |||
465 | #define MCCR 0xfffffffc | ||
466 | |||
467 | |||
468 | #endif /* __ASSEMBLY__ */ | ||
diff --git a/include/asm-m32r/m32r.h b/include/asm-m32r/m32r.h index f116649bbef3..ec142be00862 100644 --- a/include/asm-m32r/m32r.h +++ b/include/asm-m32r/m32r.h | |||
@@ -16,7 +16,6 @@ | |||
16 | || defined(CONFIG_CHIP_M32700) || defined(CONFIG_CHIP_M32102) \ | 16 | || defined(CONFIG_CHIP_M32700) || defined(CONFIG_CHIP_M32102) \ |
17 | || defined(CONFIG_CHIP_OPSP) | 17 | || defined(CONFIG_CHIP_OPSP) |
18 | #include <asm/m32102.h> | 18 | #include <asm/m32102.h> |
19 | #include <asm/m32102peri.h> | ||
20 | #endif | 19 | #endif |
21 | 20 | ||
22 | /* Platform type */ | 21 | /* Platform type */ |
@@ -36,6 +35,10 @@ | |||
36 | #include <asm/mappi2/mappi2_pld.h> | 35 | #include <asm/mappi2/mappi2_pld.h> |
37 | #endif /* CONFIG_PLAT_MAPPI2 */ | 36 | #endif /* CONFIG_PLAT_MAPPI2 */ |
38 | 37 | ||
38 | #if defined(CONFIG_PLAT_MAPPI3) | ||
39 | #include <asm/mappi3/mappi3_pld.h> | ||
40 | #endif /* CONFIG_PLAT_MAPPI3 */ | ||
41 | |||
39 | #if defined(CONFIG_PLAT_USRV) | 42 | #if defined(CONFIG_PLAT_USRV) |
40 | #include <asm/m32700ut/m32700ut_pld.h> | 43 | #include <asm/m32700ut/m32700ut_pld.h> |
41 | #endif | 44 | #endif |
diff --git a/include/asm-m32r/mappi3/mappi3_pld.h b/include/asm-m32r/mappi3/mappi3_pld.h new file mode 100644 index 000000000000..3f1551f7f01f --- /dev/null +++ b/include/asm-m32r/mappi3/mappi3_pld.h | |||
@@ -0,0 +1,143 @@ | |||
1 | /* | ||
2 | * include/asm/mappi3/mappi3_pld.h | ||
3 | * | ||
4 | * Definitions for Extended IO Logic on MAPPI3 board. | ||
5 | * based on m32700ut_pld.h | ||
6 | * | ||
7 | * This file is subject to the terms and conditions of the GNU General | ||
8 | * Public License. See the file "COPYING" in the main directory of | ||
9 | * this archive for more details. | ||
10 | * | ||
11 | */ | ||
12 | |||
13 | #ifndef _MAPPI3_PLD_H | ||
14 | #define _MAPPI3_PLD_H | ||
15 | |||
16 | #ifndef __ASSEMBLY__ | ||
17 | /* FIXME: | ||
18 | * Some C functions use non-cache address, so can't define non-cache address. | ||
19 | */ | ||
20 | #define PLD_BASE (0x1c000000 /* + NONCACHE_OFFSET */) | ||
21 | #define __reg8 (volatile unsigned char *) | ||
22 | #define __reg16 (volatile unsigned short *) | ||
23 | #define __reg32 (volatile unsigned int *) | ||
24 | #else | ||
25 | #define PLD_BASE (0x1c000000 + NONCACHE_OFFSET) | ||
26 | #define __reg8 | ||
27 | #define __reg16 | ||
28 | #define __reg32 | ||
29 | #endif /* __ASSEMBLY__ */ | ||
30 | |||
31 | /* CFC */ | ||
32 | #define PLD_CFRSTCR __reg16(PLD_BASE + 0x0000) | ||
33 | #define PLD_CFSTS __reg16(PLD_BASE + 0x0002) | ||
34 | #define PLD_CFIMASK __reg16(PLD_BASE + 0x0004) | ||
35 | #define PLD_CFBUFCR __reg16(PLD_BASE + 0x0006) | ||
36 | #define PLD_CFCR0 __reg16(PLD_BASE + 0x000a) | ||
37 | #define PLD_CFCR1 __reg16(PLD_BASE + 0x000c) | ||
38 | |||
39 | /* MMC */ | ||
40 | #define PLD_MMCCR __reg16(PLD_BASE + 0x4000) | ||
41 | #define PLD_MMCMOD __reg16(PLD_BASE + 0x4002) | ||
42 | #define PLD_MMCSTS __reg16(PLD_BASE + 0x4006) | ||
43 | #define PLD_MMCBAUR __reg16(PLD_BASE + 0x400a) | ||
44 | #define PLD_MMCCMDBCUT __reg16(PLD_BASE + 0x400c) | ||
45 | #define PLD_MMCCDTBCUT __reg16(PLD_BASE + 0x400e) | ||
46 | #define PLD_MMCDET __reg16(PLD_BASE + 0x4010) | ||
47 | #define PLD_MMCWP __reg16(PLD_BASE + 0x4012) | ||
48 | #define PLD_MMCWDATA __reg16(PLD_BASE + 0x5000) | ||
49 | #define PLD_MMCRDATA __reg16(PLD_BASE + 0x6000) | ||
50 | #define PLD_MMCCMDDATA __reg16(PLD_BASE + 0x7000) | ||
51 | #define PLD_MMCRSPDATA __reg16(PLD_BASE + 0x7006) | ||
52 | |||
53 | /* Power Control of MMC and CF */ | ||
54 | #define PLD_CPCR __reg16(PLD_BASE + 0x14000) | ||
55 | |||
56 | |||
57 | /*==== ICU ====*/ | ||
58 | #define M32R_IRQ_PC104 (5) /* INT4(PC/104) */ | ||
59 | #define M32R_IRQ_I2C (28) /* I2C-BUS */ | ||
60 | #define PLD_IRQ_CFIREQ (6) /* INT5 CFC Card Interrupt */ | ||
61 | #define PLD_IRQ_CFC_INSERT (7) /* INT6 CFC Card Insert */ | ||
62 | #define PLD_IRQ_CFC_EJECT (8) /* INT7 CFC Card Eject */ | ||
63 | #define PLD_IRQ_MMCCARD (43) /* MMC Card Insert */ | ||
64 | #define PLD_IRQ_MMCIRQ (44) /* MMC Transfer Done */ | ||
65 | |||
66 | |||
67 | #if 0 | ||
68 | /* LED Control | ||
69 | * | ||
70 | * 1: DIP swich side | ||
71 | * 2: Reset switch side | ||
72 | */ | ||
73 | #define PLD_IOLEDCR __reg16(PLD_BASE + 0x14002) | ||
74 | #define PLD_IOLED_1_ON 0x001 | ||
75 | #define PLD_IOLED_1_OFF 0x000 | ||
76 | #define PLD_IOLED_2_ON 0x002 | ||
77 | #define PLD_IOLED_2_OFF 0x000 | ||
78 | |||
79 | /* DIP Switch | ||
80 | * 0: Write-protect of Flash Memory (0:protected, 1:non-protected) | ||
81 | * 1: - | ||
82 | * 2: - | ||
83 | * 3: - | ||
84 | */ | ||
85 | #define PLD_IOSWSTS __reg16(PLD_BASE + 0x14004) | ||
86 | #define PLD_IOSWSTS_IOSW2 0x0200 | ||
87 | #define PLD_IOSWSTS_IOSW1 0x0100 | ||
88 | #define PLD_IOSWSTS_IOWP0 0x0001 | ||
89 | |||
90 | #endif | ||
91 | |||
92 | /* CRC */ | ||
93 | #define PLD_CRC7DATA __reg16(PLD_BASE + 0x18000) | ||
94 | #define PLD_CRC7INDATA __reg16(PLD_BASE + 0x18002) | ||
95 | #define PLD_CRC16DATA __reg16(PLD_BASE + 0x18004) | ||
96 | #define PLD_CRC16INDATA __reg16(PLD_BASE + 0x18006) | ||
97 | #define PLD_CRC16ADATA __reg16(PLD_BASE + 0x18008) | ||
98 | #define PLD_CRC16AINDATA __reg16(PLD_BASE + 0x1800a) | ||
99 | |||
100 | |||
101 | #if 0 | ||
102 | /* RTC */ | ||
103 | #define PLD_RTCCR __reg16(PLD_BASE + 0x1c000) | ||
104 | #define PLD_RTCBAUR __reg16(PLD_BASE + 0x1c002) | ||
105 | #define PLD_RTCWRDATA __reg16(PLD_BASE + 0x1c004) | ||
106 | #define PLD_RTCRDDATA __reg16(PLD_BASE + 0x1c006) | ||
107 | #define PLD_RTCRSTODT __reg16(PLD_BASE + 0x1c008) | ||
108 | |||
109 | /* SIO0 */ | ||
110 | #define PLD_ESIO0CR __reg16(PLD_BASE + 0x20000) | ||
111 | #define PLD_ESIO0CR_TXEN 0x0001 | ||
112 | #define PLD_ESIO0CR_RXEN 0x0002 | ||
113 | #define PLD_ESIO0MOD0 __reg16(PLD_BASE + 0x20002) | ||
114 | #define PLD_ESIO0MOD0_CTSS 0x0040 | ||
115 | #define PLD_ESIO0MOD0_RTSS 0x0080 | ||
116 | #define PLD_ESIO0MOD1 __reg16(PLD_BASE + 0x20004) | ||
117 | #define PLD_ESIO0MOD1_LMFS 0x0010 | ||
118 | #define PLD_ESIO0STS __reg16(PLD_BASE + 0x20006) | ||
119 | #define PLD_ESIO0STS_TEMP 0x0001 | ||
120 | #define PLD_ESIO0STS_TXCP 0x0002 | ||
121 | #define PLD_ESIO0STS_RXCP 0x0004 | ||
122 | #define PLD_ESIO0STS_TXSC 0x0100 | ||
123 | #define PLD_ESIO0STS_RXSC 0x0200 | ||
124 | #define PLD_ESIO0STS_TXREADY (PLD_ESIO0STS_TXCP | PLD_ESIO0STS_TEMP) | ||
125 | #define PLD_ESIO0INTCR __reg16(PLD_BASE + 0x20008) | ||
126 | #define PLD_ESIO0INTCR_TXIEN 0x0002 | ||
127 | #define PLD_ESIO0INTCR_RXCEN 0x0004 | ||
128 | #define PLD_ESIO0BAUR __reg16(PLD_BASE + 0x2000a) | ||
129 | #define PLD_ESIO0TXB __reg16(PLD_BASE + 0x2000c) | ||
130 | #define PLD_ESIO0RXB __reg16(PLD_BASE + 0x2000e) | ||
131 | |||
132 | /* SIM Card */ | ||
133 | #define PLD_SCCR __reg16(PLD_BASE + 0x38000) | ||
134 | #define PLD_SCMOD __reg16(PLD_BASE + 0x38004) | ||
135 | #define PLD_SCSTS __reg16(PLD_BASE + 0x38006) | ||
136 | #define PLD_SCINTCR __reg16(PLD_BASE + 0x38008) | ||
137 | #define PLD_SCBAUR __reg16(PLD_BASE + 0x3800a) | ||
138 | #define PLD_SCTXB __reg16(PLD_BASE + 0x3800c) | ||
139 | #define PLD_SCRXB __reg16(PLD_BASE + 0x3800e) | ||
140 | |||
141 | #endif | ||
142 | |||
143 | #endif /* _MAPPI3_PLD.H */ | ||
diff --git a/include/asm-m32r/smp.h b/include/asm-m32r/smp.h index 8cd4d0da4be1..b9a20cdad65f 100644 --- a/include/asm-m32r/smp.h +++ b/include/asm-m32r/smp.h | |||
@@ -66,7 +66,7 @@ extern volatile int cpu_2_physid[NR_CPUS]; | |||
66 | #define physid_to_cpu(physid) physid_2_cpu[physid] | 66 | #define physid_to_cpu(physid) physid_2_cpu[physid] |
67 | #define cpu_to_physid(cpu_id) cpu_2_physid[cpu_id] | 67 | #define cpu_to_physid(cpu_id) cpu_2_physid[cpu_id] |
68 | 68 | ||
69 | #define smp_processor_id() (current_thread_info()->cpu) | 69 | #define raw_smp_processor_id() (current_thread_info()->cpu) |
70 | 70 | ||
71 | extern cpumask_t cpu_callout_map; | 71 | extern cpumask_t cpu_callout_map; |
72 | #define cpu_possible_map cpu_callout_map | 72 | #define cpu_possible_map cpu_callout_map |
diff --git a/include/asm-mips/smp.h b/include/asm-mips/smp.h index 8ba370ecfd4c..5618f1e12f40 100644 --- a/include/asm-mips/smp.h +++ b/include/asm-mips/smp.h | |||
@@ -21,7 +21,7 @@ | |||
21 | #include <linux/cpumask.h> | 21 | #include <linux/cpumask.h> |
22 | #include <asm/atomic.h> | 22 | #include <asm/atomic.h> |
23 | 23 | ||
24 | #define smp_processor_id() (current_thread_info()->cpu) | 24 | #define raw_smp_processor_id() (current_thread_info()->cpu) |
25 | 25 | ||
26 | /* Map from cpu id to sequential logical cpu number. This will only | 26 | /* Map from cpu id to sequential logical cpu number. This will only |
27 | not be idempotent when cpus failed to come on-line. */ | 27 | not be idempotent when cpus failed to come on-line. */ |
diff --git a/include/asm-mips/vr41xx/giu.h b/include/asm-mips/vr41xx/giu.h new file mode 100644 index 000000000000..8590885a7638 --- /dev/null +++ b/include/asm-mips/vr41xx/giu.h | |||
@@ -0,0 +1,69 @@ | |||
1 | /* | ||
2 | * Include file for NEC VR4100 series General-purpose I/O Unit. | ||
3 | * | ||
4 | * Copyright (C) 2005 Yoichi Yuasa <yuasa@hh.iij4u.or.jp> | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU General Public License as published by | ||
8 | * the Free Software Foundation; either version 2 of the License, or | ||
9 | * (at your option) any later version. | ||
10 | * | ||
11 | * This program is distributed in the hope that it will be useful, | ||
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
14 | * GNU General Public License for more details. | ||
15 | * | ||
16 | * You should have received a copy of the GNU General Public License | ||
17 | * along with this program; if not, write to the Free Software | ||
18 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
19 | */ | ||
20 | #ifndef __NEC_VR41XX_GIU_H | ||
21 | #define __NEC_VR41XX_GIU_H | ||
22 | |||
23 | typedef enum { | ||
24 | IRQ_TRIGGER_LEVEL, | ||
25 | IRQ_TRIGGER_EDGE, | ||
26 | IRQ_TRIGGER_EDGE_FALLING, | ||
27 | IRQ_TRIGGER_EDGE_RISING, | ||
28 | } irq_trigger_t; | ||
29 | |||
30 | typedef enum { | ||
31 | IRQ_SIGNAL_THROUGH, | ||
32 | IRQ_SIGNAL_HOLD, | ||
33 | } irq_signal_t; | ||
34 | |||
35 | extern void vr41xx_set_irq_trigger(unsigned int pin, irq_trigger_t trigger, irq_signal_t signal); | ||
36 | |||
37 | typedef enum { | ||
38 | IRQ_LEVEL_LOW, | ||
39 | IRQ_LEVEL_HIGH, | ||
40 | } irq_level_t; | ||
41 | |||
42 | extern void vr41xx_set_irq_level(unsigned int pin, irq_level_t level); | ||
43 | |||
44 | typedef enum { | ||
45 | GPIO_DATA_LOW, | ||
46 | GPIO_DATA_HIGH, | ||
47 | GPIO_DATA_INVAL, | ||
48 | } gpio_data_t; | ||
49 | |||
50 | extern gpio_data_t vr41xx_gpio_get_pin(unsigned int pin); | ||
51 | extern int vr41xx_gpio_set_pin(unsigned int pin, gpio_data_t data); | ||
52 | |||
53 | typedef enum { | ||
54 | GPIO_INPUT, | ||
55 | GPIO_OUTPUT, | ||
56 | GPIO_OUTPUT_DISABLE, | ||
57 | } gpio_direction_t; | ||
58 | |||
59 | extern int vr41xx_gpio_set_direction(unsigned int pin, gpio_direction_t dir); | ||
60 | |||
61 | typedef enum { | ||
62 | GPIO_PULL_DOWN, | ||
63 | GPIO_PULL_UP, | ||
64 | GPIO_PULL_DISABLE, | ||
65 | } gpio_pull_t; | ||
66 | |||
67 | extern int vr41xx_gpio_pullupdown(unsigned int pin, gpio_pull_t pull); | ||
68 | |||
69 | #endif /* __NEC_VR41XX_GIU_H */ | ||
diff --git a/include/asm-mips/vr41xx/vr41xx.h b/include/asm-mips/vr41xx/vr41xx.h index ad0d1ea144f0..7d41e44463f9 100644 --- a/include/asm-mips/vr41xx/vr41xx.h +++ b/include/asm-mips/vr41xx/vr41xx.h | |||
@@ -126,7 +126,6 @@ extern void vr41xx_mask_clock(vr41xx_clock_t clock); | |||
126 | #define GIU_IRQ_BASE 40 | 126 | #define GIU_IRQ_BASE 40 |
127 | #define GIU_IRQ(x) (GIU_IRQ_BASE + (x)) /* IRQ 40-71 */ | 127 | #define GIU_IRQ(x) (GIU_IRQ_BASE + (x)) /* IRQ 40-71 */ |
128 | #define GIU_IRQ_LAST GIU_IRQ(31) | 128 | #define GIU_IRQ_LAST GIU_IRQ(31) |
129 | #define GIU_IRQ_TO_PIN(x) ((x) - GIU_IRQ_BASE) /* Pin 0-31 */ | ||
130 | 129 | ||
131 | extern int vr41xx_set_intassign(unsigned int irq, unsigned char intassign); | 130 | extern int vr41xx_set_intassign(unsigned int irq, unsigned char intassign); |
132 | extern int vr41xx_cascade_irq(unsigned int irq, int (*get_irq_number)(int irq)); | 131 | extern int vr41xx_cascade_irq(unsigned int irq, int (*get_irq_number)(int irq)); |
@@ -197,38 +196,4 @@ extern void vr41xx_disable_csiint(uint16_t mask); | |||
197 | extern void vr41xx_enable_bcuint(void); | 196 | extern void vr41xx_enable_bcuint(void); |
198 | extern void vr41xx_disable_bcuint(void); | 197 | extern void vr41xx_disable_bcuint(void); |
199 | 198 | ||
200 | /* | ||
201 | * General-Purpose I/O Unit | ||
202 | */ | ||
203 | enum { | ||
204 | TRIGGER_LEVEL, | ||
205 | TRIGGER_EDGE, | ||
206 | TRIGGER_EDGE_FALLING, | ||
207 | TRIGGER_EDGE_RISING | ||
208 | }; | ||
209 | |||
210 | enum { | ||
211 | SIGNAL_THROUGH, | ||
212 | SIGNAL_HOLD | ||
213 | }; | ||
214 | |||
215 | extern void vr41xx_set_irq_trigger(int pin, int trigger, int hold); | ||
216 | |||
217 | enum { | ||
218 | LEVEL_LOW, | ||
219 | LEVEL_HIGH | ||
220 | }; | ||
221 | |||
222 | extern void vr41xx_set_irq_level(int pin, int level); | ||
223 | |||
224 | enum { | ||
225 | PIO_INPUT, | ||
226 | PIO_OUTPUT | ||
227 | }; | ||
228 | |||
229 | enum { | ||
230 | DATA_LOW, | ||
231 | DATA_HIGH | ||
232 | }; | ||
233 | |||
234 | #endif /* __NEC_VR41XX_H */ | 199 | #endif /* __NEC_VR41XX_H */ |
diff --git a/include/asm-parisc/smp.h b/include/asm-parisc/smp.h index fde77ac35463..9413f67a540b 100644 --- a/include/asm-parisc/smp.h +++ b/include/asm-parisc/smp.h | |||
@@ -51,7 +51,7 @@ extern void smp_send_reschedule(int cpu); | |||
51 | 51 | ||
52 | extern unsigned long cpu_present_mask; | 52 | extern unsigned long cpu_present_mask; |
53 | 53 | ||
54 | #define smp_processor_id() (current_thread_info()->cpu) | 54 | #define raw_smp_processor_id() (current_thread_info()->cpu) |
55 | 55 | ||
56 | #endif /* CONFIG_SMP */ | 56 | #endif /* CONFIG_SMP */ |
57 | 57 | ||
diff --git a/include/asm-ppc/agp.h b/include/asm-ppc/agp.h index be27cfa8c5b0..ca9e423307f4 100644 --- a/include/asm-ppc/agp.h +++ b/include/asm-ppc/agp.h | |||
@@ -10,4 +10,14 @@ | |||
10 | #define flush_agp_mappings() | 10 | #define flush_agp_mappings() |
11 | #define flush_agp_cache() mb() | 11 | #define flush_agp_cache() mb() |
12 | 12 | ||
13 | /* Convert a physical address to an address suitable for the GART. */ | ||
14 | #define phys_to_gart(x) (x) | ||
15 | #define gart_to_phys(x) (x) | ||
16 | |||
17 | /* GATT allocation. Returns/accepts GATT kernel virtual address. */ | ||
18 | #define alloc_gatt_pages(order) \ | ||
19 | ((char *)__get_free_pages(GFP_KERNEL, (order))) | ||
20 | #define free_gatt_pages(table, order) \ | ||
21 | free_pages((unsigned long)(table), (order)) | ||
22 | |||
13 | #endif | 23 | #endif |
diff --git a/include/asm-ppc/cpm2.h b/include/asm-ppc/cpm2.h index 42fd1068cf2a..c5883dbed63f 100644 --- a/include/asm-ppc/cpm2.h +++ b/include/asm-ppc/cpm2.h | |||
@@ -1039,6 +1039,52 @@ typedef struct im_idma { | |||
1039 | #define CMXSCR_TS4CS_CLK7 0x00000006 /* SCC4 Tx Clock Source is CLK7 */ | 1039 | #define CMXSCR_TS4CS_CLK7 0x00000006 /* SCC4 Tx Clock Source is CLK7 */ |
1040 | #define CMXSCR_TS4CS_CLK8 0x00000007 /* SCC4 Tx Clock Source is CLK8 */ | 1040 | #define CMXSCR_TS4CS_CLK8 0x00000007 /* SCC4 Tx Clock Source is CLK8 */ |
1041 | 1041 | ||
1042 | /*----------------------------------------------------------------------- | ||
1043 | * SIUMCR - SIU Module Configuration Register 4-31 | ||
1044 | */ | ||
1045 | #define SIUMCR_BBD 0x80000000 /* Bus Busy Disable */ | ||
1046 | #define SIUMCR_ESE 0x40000000 /* External Snoop Enable */ | ||
1047 | #define SIUMCR_PBSE 0x20000000 /* Parity Byte Select Enable */ | ||
1048 | #define SIUMCR_CDIS 0x10000000 /* Core Disable */ | ||
1049 | #define SIUMCR_DPPC00 0x00000000 /* Data Parity Pins Configuration*/ | ||
1050 | #define SIUMCR_DPPC01 0x04000000 /* - " - */ | ||
1051 | #define SIUMCR_DPPC10 0x08000000 /* - " - */ | ||
1052 | #define SIUMCR_DPPC11 0x0c000000 /* - " - */ | ||
1053 | #define SIUMCR_L2CPC00 0x00000000 /* L2 Cache Pins Configuration */ | ||
1054 | #define SIUMCR_L2CPC01 0x01000000 /* - " - */ | ||
1055 | #define SIUMCR_L2CPC10 0x02000000 /* - " - */ | ||
1056 | #define SIUMCR_L2CPC11 0x03000000 /* - " - */ | ||
1057 | #define SIUMCR_LBPC00 0x00000000 /* Local Bus Pins Configuration */ | ||
1058 | #define SIUMCR_LBPC01 0x00400000 /* - " - */ | ||
1059 | #define SIUMCR_LBPC10 0x00800000 /* - " - */ | ||
1060 | #define SIUMCR_LBPC11 0x00c00000 /* - " - */ | ||
1061 | #define SIUMCR_APPC00 0x00000000 /* Address Parity Pins Configuration*/ | ||
1062 | #define SIUMCR_APPC01 0x00100000 /* - " - */ | ||
1063 | #define SIUMCR_APPC10 0x00200000 /* - " - */ | ||
1064 | #define SIUMCR_APPC11 0x00300000 /* - " - */ | ||
1065 | #define SIUMCR_CS10PC00 0x00000000 /* CS10 Pin Configuration */ | ||
1066 | #define SIUMCR_CS10PC01 0x00040000 /* - " - */ | ||
1067 | #define SIUMCR_CS10PC10 0x00080000 /* - " - */ | ||
1068 | #define SIUMCR_CS10PC11 0x000c0000 /* - " - */ | ||
1069 | #define SIUMCR_BCTLC00 0x00000000 /* Buffer Control Configuration */ | ||
1070 | #define SIUMCR_BCTLC01 0x00010000 /* - " - */ | ||
1071 | #define SIUMCR_BCTLC10 0x00020000 /* - " - */ | ||
1072 | #define SIUMCR_BCTLC11 0x00030000 /* - " - */ | ||
1073 | #define SIUMCR_MMR00 0x00000000 /* Mask Masters Requests */ | ||
1074 | #define SIUMCR_MMR01 0x00004000 /* - " - */ | ||
1075 | #define SIUMCR_MMR10 0x00008000 /* - " - */ | ||
1076 | #define SIUMCR_MMR11 0x0000c000 /* - " - */ | ||
1077 | #define SIUMCR_LPBSE 0x00002000 /* LocalBus Parity Byte Select Enable*/ | ||
1078 | |||
1079 | /*----------------------------------------------------------------------- | ||
1080 | * SCCR - System Clock Control Register 9-8 | ||
1081 | */ | ||
1082 | #define SCCR_PCI_MODE 0x00000100 /* PCI Mode */ | ||
1083 | #define SCCR_PCI_MODCK 0x00000080 /* Value of PCI_MODCK pin */ | ||
1084 | #define SCCR_PCIDF_MSK 0x00000078 /* PCI division factor */ | ||
1085 | #define SCCR_PCIDF_SHIFT 3 | ||
1086 | |||
1087 | |||
1042 | #endif /* __CPM2__ */ | 1088 | #endif /* __CPM2__ */ |
1043 | #endif /* __KERNEL__ */ | 1089 | #endif /* __KERNEL__ */ |
1044 | 1090 | ||
diff --git a/include/asm-ppc/irq.h b/include/asm-ppc/irq.h index 06b86be61ed1..a9b33324f562 100644 --- a/include/asm-ppc/irq.h +++ b/include/asm-ppc/irq.h | |||
@@ -176,7 +176,7 @@ static __inline__ int irq_canonicalize(int irq) | |||
176 | */ | 176 | */ |
177 | #include <asm/mpc85xx.h> | 177 | #include <asm/mpc85xx.h> |
178 | 178 | ||
179 | /* The MPC8560 openpic has 32 internal interrupts and 12 external | 179 | /* The MPC8548 openpic has 48 internal interrupts and 12 external |
180 | * interrupts. | 180 | * interrupts. |
181 | * | 181 | * |
182 | * We are "flattening" the interrupt vectors of the cascaded CPM | 182 | * We are "flattening" the interrupt vectors of the cascaded CPM |
@@ -184,7 +184,7 @@ static __inline__ int irq_canonicalize(int irq) | |||
184 | * single integer. | 184 | * single integer. |
185 | */ | 185 | */ |
186 | #define NR_CPM_INTS 64 | 186 | #define NR_CPM_INTS 64 |
187 | #define NR_EPIC_INTS 44 | 187 | #define NR_EPIC_INTS 60 |
188 | #ifndef NR_8259_INTS | 188 | #ifndef NR_8259_INTS |
189 | #define NR_8259_INTS 0 | 189 | #define NR_8259_INTS 0 |
190 | #endif | 190 | #endif |
@@ -223,9 +223,15 @@ static __inline__ int irq_canonicalize(int irq) | |||
223 | #define MPC85xx_IRQ_RIO_RX (12 + MPC85xx_OPENPIC_IRQ_OFFSET) | 223 | #define MPC85xx_IRQ_RIO_RX (12 + MPC85xx_OPENPIC_IRQ_OFFSET) |
224 | #define MPC85xx_IRQ_TSEC1_TX (13 + MPC85xx_OPENPIC_IRQ_OFFSET) | 224 | #define MPC85xx_IRQ_TSEC1_TX (13 + MPC85xx_OPENPIC_IRQ_OFFSET) |
225 | #define MPC85xx_IRQ_TSEC1_RX (14 + MPC85xx_OPENPIC_IRQ_OFFSET) | 225 | #define MPC85xx_IRQ_TSEC1_RX (14 + MPC85xx_OPENPIC_IRQ_OFFSET) |
226 | #define MPC85xx_IRQ_TSEC3_TX (15 + MPC85xx_OPENPIC_IRQ_OFFSET) | ||
227 | #define MPC85xx_IRQ_TSEC3_RX (16 + MPC85xx_OPENPIC_IRQ_OFFSET) | ||
228 | #define MPC85xx_IRQ_TSEC3_ERROR (17 + MPC85xx_OPENPIC_IRQ_OFFSET) | ||
226 | #define MPC85xx_IRQ_TSEC1_ERROR (18 + MPC85xx_OPENPIC_IRQ_OFFSET) | 229 | #define MPC85xx_IRQ_TSEC1_ERROR (18 + MPC85xx_OPENPIC_IRQ_OFFSET) |
227 | #define MPC85xx_IRQ_TSEC2_TX (19 + MPC85xx_OPENPIC_IRQ_OFFSET) | 230 | #define MPC85xx_IRQ_TSEC2_TX (19 + MPC85xx_OPENPIC_IRQ_OFFSET) |
228 | #define MPC85xx_IRQ_TSEC2_RX (20 + MPC85xx_OPENPIC_IRQ_OFFSET) | 231 | #define MPC85xx_IRQ_TSEC2_RX (20 + MPC85xx_OPENPIC_IRQ_OFFSET) |
232 | #define MPC85xx_IRQ_TSEC4_TX (21 + MPC85xx_OPENPIC_IRQ_OFFSET) | ||
233 | #define MPC85xx_IRQ_TSEC4_RX (22 + MPC85xx_OPENPIC_IRQ_OFFSET) | ||
234 | #define MPC85xx_IRQ_TSEC4_ERROR (23 + MPC85xx_OPENPIC_IRQ_OFFSET) | ||
229 | #define MPC85xx_IRQ_TSEC2_ERROR (24 + MPC85xx_OPENPIC_IRQ_OFFSET) | 235 | #define MPC85xx_IRQ_TSEC2_ERROR (24 + MPC85xx_OPENPIC_IRQ_OFFSET) |
230 | #define MPC85xx_IRQ_FEC (25 + MPC85xx_OPENPIC_IRQ_OFFSET) | 236 | #define MPC85xx_IRQ_FEC (25 + MPC85xx_OPENPIC_IRQ_OFFSET) |
231 | #define MPC85xx_IRQ_DUART (26 + MPC85xx_OPENPIC_IRQ_OFFSET) | 237 | #define MPC85xx_IRQ_DUART (26 + MPC85xx_OPENPIC_IRQ_OFFSET) |
@@ -235,18 +241,18 @@ static __inline__ int irq_canonicalize(int irq) | |||
235 | #define MPC85xx_IRQ_CPM (30 + MPC85xx_OPENPIC_IRQ_OFFSET) | 241 | #define MPC85xx_IRQ_CPM (30 + MPC85xx_OPENPIC_IRQ_OFFSET) |
236 | 242 | ||
237 | /* The 12 external interrupt lines */ | 243 | /* The 12 external interrupt lines */ |
238 | #define MPC85xx_IRQ_EXT0 (32 + MPC85xx_OPENPIC_IRQ_OFFSET) | 244 | #define MPC85xx_IRQ_EXT0 (48 + MPC85xx_OPENPIC_IRQ_OFFSET) |
239 | #define MPC85xx_IRQ_EXT1 (33 + MPC85xx_OPENPIC_IRQ_OFFSET) | 245 | #define MPC85xx_IRQ_EXT1 (49 + MPC85xx_OPENPIC_IRQ_OFFSET) |
240 | #define MPC85xx_IRQ_EXT2 (34 + MPC85xx_OPENPIC_IRQ_OFFSET) | 246 | #define MPC85xx_IRQ_EXT2 (50 + MPC85xx_OPENPIC_IRQ_OFFSET) |
241 | #define MPC85xx_IRQ_EXT3 (35 + MPC85xx_OPENPIC_IRQ_OFFSET) | 247 | #define MPC85xx_IRQ_EXT3 (51 + MPC85xx_OPENPIC_IRQ_OFFSET) |
242 | #define MPC85xx_IRQ_EXT4 (36 + MPC85xx_OPENPIC_IRQ_OFFSET) | 248 | #define MPC85xx_IRQ_EXT4 (52 + MPC85xx_OPENPIC_IRQ_OFFSET) |
243 | #define MPC85xx_IRQ_EXT5 (37 + MPC85xx_OPENPIC_IRQ_OFFSET) | 249 | #define MPC85xx_IRQ_EXT5 (53 + MPC85xx_OPENPIC_IRQ_OFFSET) |
244 | #define MPC85xx_IRQ_EXT6 (38 + MPC85xx_OPENPIC_IRQ_OFFSET) | 250 | #define MPC85xx_IRQ_EXT6 (54 + MPC85xx_OPENPIC_IRQ_OFFSET) |
245 | #define MPC85xx_IRQ_EXT7 (39 + MPC85xx_OPENPIC_IRQ_OFFSET) | 251 | #define MPC85xx_IRQ_EXT7 (55 + MPC85xx_OPENPIC_IRQ_OFFSET) |
246 | #define MPC85xx_IRQ_EXT8 (40 + MPC85xx_OPENPIC_IRQ_OFFSET) | 252 | #define MPC85xx_IRQ_EXT8 (56 + MPC85xx_OPENPIC_IRQ_OFFSET) |
247 | #define MPC85xx_IRQ_EXT9 (41 + MPC85xx_OPENPIC_IRQ_OFFSET) | 253 | #define MPC85xx_IRQ_EXT9 (57 + MPC85xx_OPENPIC_IRQ_OFFSET) |
248 | #define MPC85xx_IRQ_EXT10 (42 + MPC85xx_OPENPIC_IRQ_OFFSET) | 254 | #define MPC85xx_IRQ_EXT10 (58 + MPC85xx_OPENPIC_IRQ_OFFSET) |
249 | #define MPC85xx_IRQ_EXT11 (43 + MPC85xx_OPENPIC_IRQ_OFFSET) | 255 | #define MPC85xx_IRQ_EXT11 (59 + MPC85xx_OPENPIC_IRQ_OFFSET) |
250 | 256 | ||
251 | /* CPM related interrupts */ | 257 | /* CPM related interrupts */ |
252 | #define SIU_INT_ERROR ((uint)0x00+CPM_IRQ_OFFSET) | 258 | #define SIU_INT_ERROR ((uint)0x00+CPM_IRQ_OFFSET) |
diff --git a/include/asm-ppc/m8260_pci.h b/include/asm-ppc/m8260_pci.h index 163a6b91d5b2..bf9e05dd54b5 100644 --- a/include/asm-ppc/m8260_pci.h +++ b/include/asm-ppc/m8260_pci.h | |||
@@ -19,6 +19,7 @@ | |||
19 | * Define the vendor/device ID for the MPC8265. | 19 | * Define the vendor/device ID for the MPC8265. |
20 | */ | 20 | */ |
21 | #define PCI_DEVICE_ID_MPC8265 ((0x18C0 << 16) | PCI_VENDOR_ID_MOTOROLA) | 21 | #define PCI_DEVICE_ID_MPC8265 ((0x18C0 << 16) | PCI_VENDOR_ID_MOTOROLA) |
22 | #define PCI_DEVICE_ID_MPC8272 ((0x18C1 << 16) | PCI_VENDOR_ID_MOTOROLA) | ||
22 | 23 | ||
23 | #define M8265_PCIBR0 0x101ac | 24 | #define M8265_PCIBR0 0x101ac |
24 | #define M8265_PCIBR1 0x101b0 | 25 | #define M8265_PCIBR1 0x101b0 |
diff --git a/include/asm-ppc/mpc10x.h b/include/asm-ppc/mpc10x.h index d8e7e2d6128e..f5196a4efbe0 100644 --- a/include/asm-ppc/mpc10x.h +++ b/include/asm-ppc/mpc10x.h | |||
@@ -159,6 +159,12 @@ extern unsigned long ioremap_base; | |||
159 | #define MPC10X_MAPA_EUMB_BASE (ioremap_base - MPC10X_EUMB_SIZE) | 159 | #define MPC10X_MAPA_EUMB_BASE (ioremap_base - MPC10X_EUMB_SIZE) |
160 | #define MPC10X_MAPB_EUMB_BASE MPC10X_MAPA_EUMB_BASE | 160 | #define MPC10X_MAPB_EUMB_BASE MPC10X_MAPA_EUMB_BASE |
161 | 161 | ||
162 | enum ppc_sys_devices { | ||
163 | MPC10X_IIC1, | ||
164 | MPC10X_DMA0, | ||
165 | MPC10X_DMA1, | ||
166 | MPC10X_DUART, | ||
167 | }; | ||
162 | 168 | ||
163 | int mpc10x_bridge_init(struct pci_controller *hose, | 169 | int mpc10x_bridge_init(struct pci_controller *hose, |
164 | uint current_map, | 170 | uint current_map, |
diff --git a/include/asm-ppc/mpc8260.h b/include/asm-ppc/mpc8260.h index d820894e5991..89eb8a2ac693 100644 --- a/include/asm-ppc/mpc8260.h +++ b/include/asm-ppc/mpc8260.h | |||
@@ -41,7 +41,7 @@ | |||
41 | #endif | 41 | #endif |
42 | 42 | ||
43 | #ifdef CONFIG_PCI_8260 | 43 | #ifdef CONFIG_PCI_8260 |
44 | #include <syslib/m8260_pci.h> | 44 | #include <syslib/m82xx_pci.h> |
45 | #endif | 45 | #endif |
46 | 46 | ||
47 | /* Make sure the memory translation stuff is there if PCI not used. | 47 | /* Make sure the memory translation stuff is there if PCI not used. |
diff --git a/include/asm-ppc/mpc85xx.h b/include/asm-ppc/mpc85xx.h index 22713e331585..516984ee14b5 100644 --- a/include/asm-ppc/mpc85xx.h +++ b/include/asm-ppc/mpc85xx.h | |||
@@ -25,7 +25,7 @@ | |||
25 | #ifdef CONFIG_MPC8540_ADS | 25 | #ifdef CONFIG_MPC8540_ADS |
26 | #include <platforms/85xx/mpc8540_ads.h> | 26 | #include <platforms/85xx/mpc8540_ads.h> |
27 | #endif | 27 | #endif |
28 | #ifdef CONFIG_MPC8555_CDS | 28 | #if defined(CONFIG_MPC8555_CDS) || defined(CONFIG_MPC8548_CDS) |
29 | #include <platforms/85xx/mpc8555_cds.h> | 29 | #include <platforms/85xx/mpc8555_cds.h> |
30 | #endif | 30 | #endif |
31 | #ifdef CONFIG_MPC8560_ADS | 31 | #ifdef CONFIG_MPC8560_ADS |
@@ -74,7 +74,7 @@ extern unsigned char __res[]; | |||
74 | #define MPC85xx_GUTS_OFFSET (0xe0000) | 74 | #define MPC85xx_GUTS_OFFSET (0xe0000) |
75 | #define MPC85xx_GUTS_SIZE (0x01000) | 75 | #define MPC85xx_GUTS_SIZE (0x01000) |
76 | #define MPC85xx_IIC1_OFFSET (0x03000) | 76 | #define MPC85xx_IIC1_OFFSET (0x03000) |
77 | #define MPC85xx_IIC1_SIZE (0x01000) | 77 | #define MPC85xx_IIC1_SIZE (0x00100) |
78 | #define MPC85xx_OPENPIC_OFFSET (0x40000) | 78 | #define MPC85xx_OPENPIC_OFFSET (0x40000) |
79 | #define MPC85xx_OPENPIC_SIZE (0x40000) | 79 | #define MPC85xx_OPENPIC_SIZE (0x40000) |
80 | #define MPC85xx_PCI1_OFFSET (0x08000) | 80 | #define MPC85xx_PCI1_OFFSET (0x08000) |
@@ -127,8 +127,64 @@ enum ppc_sys_devices { | |||
127 | MPC85xx_CPM_MCC2, | 127 | MPC85xx_CPM_MCC2, |
128 | MPC85xx_CPM_SMC1, | 128 | MPC85xx_CPM_SMC1, |
129 | MPC85xx_CPM_SMC2, | 129 | MPC85xx_CPM_SMC2, |
130 | MPC85xx_eTSEC1, | ||
131 | MPC85xx_eTSEC2, | ||
132 | MPC85xx_eTSEC3, | ||
133 | MPC85xx_eTSEC4, | ||
134 | MPC85xx_IIC2, | ||
130 | }; | 135 | }; |
131 | 136 | ||
137 | /* Internal interrupts are all Level Sensitive, and Positive Polarity */ | ||
138 | #define MPC85XX_INTERNAL_IRQ_SENSES \ | ||
139 | (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 0 */ \ | ||
140 | (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 1 */ \ | ||
141 | (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 2 */ \ | ||
142 | (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 3 */ \ | ||
143 | (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 4 */ \ | ||
144 | (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 5 */ \ | ||
145 | (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 6 */ \ | ||
146 | (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 7 */ \ | ||
147 | (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 8 */ \ | ||
148 | (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 9 */ \ | ||
149 | (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 10 */ \ | ||
150 | (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 11 */ \ | ||
151 | (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 12 */ \ | ||
152 | (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 13 */ \ | ||
153 | (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 14 */ \ | ||
154 | (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 15 */ \ | ||
155 | (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 16 */ \ | ||
156 | (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 17 */ \ | ||
157 | (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 18 */ \ | ||
158 | (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 19 */ \ | ||
159 | (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 20 */ \ | ||
160 | (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 21 */ \ | ||
161 | (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 22 */ \ | ||
162 | (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 23 */ \ | ||
163 | (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 24 */ \ | ||
164 | (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 25 */ \ | ||
165 | (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 26 */ \ | ||
166 | (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 27 */ \ | ||
167 | (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 28 */ \ | ||
168 | (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 29 */ \ | ||
169 | (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 30 */ \ | ||
170 | (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 31 */ \ | ||
171 | (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 32 */ \ | ||
172 | (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 33 */ \ | ||
173 | (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 34 */ \ | ||
174 | (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 35 */ \ | ||
175 | (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 36 */ \ | ||
176 | (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 37 */ \ | ||
177 | (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 38 */ \ | ||
178 | (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 39 */ \ | ||
179 | (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 40 */ \ | ||
180 | (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 41 */ \ | ||
181 | (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 42 */ \ | ||
182 | (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 43 */ \ | ||
183 | (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 44 */ \ | ||
184 | (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 45 */ \ | ||
185 | (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 46 */ \ | ||
186 | (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE) /* Internal 47 */ | ||
187 | |||
132 | #endif /* CONFIG_85xx */ | 188 | #endif /* CONFIG_85xx */ |
133 | #endif /* __ASM_MPC85xx_H__ */ | 189 | #endif /* __ASM_MPC85xx_H__ */ |
134 | #endif /* __KERNEL__ */ | 190 | #endif /* __KERNEL__ */ |
diff --git a/include/asm-ppc/ocp.h b/include/asm-ppc/ocp.h index b98db3cdae83..c726f1845190 100644 --- a/include/asm-ppc/ocp.h +++ b/include/asm-ppc/ocp.h | |||
@@ -189,7 +189,7 @@ extern void ocp_for_each_device(void(*callback)(struct ocp_device *, void *arg), | |||
189 | /* Sysfs support */ | 189 | /* Sysfs support */ |
190 | #define OCP_SYSFS_ADDTL(type, format, name, field) \ | 190 | #define OCP_SYSFS_ADDTL(type, format, name, field) \ |
191 | static ssize_t \ | 191 | static ssize_t \ |
192 | show_##name##_##field(struct device *dev, char *buf) \ | 192 | show_##name##_##field(struct device *dev, struct device_attribute *attr, char *buf) \ |
193 | { \ | 193 | { \ |
194 | struct ocp_device *odev = to_ocp_dev(dev); \ | 194 | struct ocp_device *odev = to_ocp_dev(dev); \ |
195 | type *add = odev->def->additions; \ | 195 | type *add = odev->def->additions; \ |
diff --git a/include/asm-ppc/pgtable.h b/include/asm-ppc/pgtable.h index a38606d15549..4d4b20c9de78 100644 --- a/include/asm-ppc/pgtable.h +++ b/include/asm-ppc/pgtable.h | |||
@@ -267,8 +267,6 @@ extern unsigned long ioremap_bot, ioremap_base; | |||
267 | #define _PMD_PRESENT_MASK (PAGE_MASK) | 267 | #define _PMD_PRESENT_MASK (PAGE_MASK) |
268 | #define _PMD_BAD (~PAGE_MASK) | 268 | #define _PMD_BAD (~PAGE_MASK) |
269 | 269 | ||
270 | #define NUM_TLBCAMS (16) | ||
271 | |||
272 | #elif defined(CONFIG_8xx) | 270 | #elif defined(CONFIG_8xx) |
273 | /* Definitions for 8xx embedded chips. */ | 271 | /* Definitions for 8xx embedded chips. */ |
274 | #define _PAGE_PRESENT 0x0001 /* Page is valid */ | 272 | #define _PAGE_PRESENT 0x0001 /* Page is valid */ |
diff --git a/include/asm-ppc/ppc_sys.h b/include/asm-ppc/ppc_sys.h index 24b991c42769..8ea624566231 100644 --- a/include/asm-ppc/ppc_sys.h +++ b/include/asm-ppc/ppc_sys.h | |||
@@ -27,6 +27,8 @@ | |||
27 | #include <asm/mpc85xx.h> | 27 | #include <asm/mpc85xx.h> |
28 | #elif defined(CONFIG_PPC_MPC52xx) | 28 | #elif defined(CONFIG_PPC_MPC52xx) |
29 | #include <asm/mpc52xx.h> | 29 | #include <asm/mpc52xx.h> |
30 | #elif defined(CONFIG_MPC10X_BRIDGE) | ||
31 | #include <asm/mpc10x.h> | ||
30 | #else | 32 | #else |
31 | #error "need definition of ppc_sys_devices" | 33 | #error "need definition of ppc_sys_devices" |
32 | #endif | 34 | #endif |
diff --git a/include/asm-ppc/seccomp.h b/include/asm-ppc/seccomp.h new file mode 100644 index 000000000000..666c4da96d87 --- /dev/null +++ b/include/asm-ppc/seccomp.h | |||
@@ -0,0 +1,10 @@ | |||
1 | #ifndef _ASM_SECCOMP_H | ||
2 | |||
3 | #include <linux/unistd.h> | ||
4 | |||
5 | #define __NR_seccomp_read __NR_read | ||
6 | #define __NR_seccomp_write __NR_write | ||
7 | #define __NR_seccomp_exit __NR_exit | ||
8 | #define __NR_seccomp_sigreturn __NR_rt_sigreturn | ||
9 | |||
10 | #endif /* _ASM_SECCOMP_H */ | ||
diff --git a/include/asm-ppc/sigcontext.h b/include/asm-ppc/sigcontext.h index f82dcccdee1e..b7a417e0a921 100644 --- a/include/asm-ppc/sigcontext.h +++ b/include/asm-ppc/sigcontext.h | |||
@@ -2,7 +2,7 @@ | |||
2 | #define _ASM_PPC_SIGCONTEXT_H | 2 | #define _ASM_PPC_SIGCONTEXT_H |
3 | 3 | ||
4 | #include <asm/ptrace.h> | 4 | #include <asm/ptrace.h> |
5 | 5 | #include <linux/compiler.h> | |
6 | 6 | ||
7 | struct sigcontext { | 7 | struct sigcontext { |
8 | unsigned long _unused[4]; | 8 | unsigned long _unused[4]; |
diff --git a/include/asm-ppc/smp.h b/include/asm-ppc/smp.h index ebfb614f55f6..17530c232c76 100644 --- a/include/asm-ppc/smp.h +++ b/include/asm-ppc/smp.h | |||
@@ -44,7 +44,7 @@ extern void smp_message_recv(int, struct pt_regs *); | |||
44 | #define NO_PROC_ID 0xFF /* No processor magic marker */ | 44 | #define NO_PROC_ID 0xFF /* No processor magic marker */ |
45 | #define PROC_CHANGE_PENALTY 20 | 45 | #define PROC_CHANGE_PENALTY 20 |
46 | 46 | ||
47 | #define smp_processor_id() (current_thread_info()->cpu) | 47 | #define raw_smp_processor_id() (current_thread_info()->cpu) |
48 | 48 | ||
49 | extern int __cpu_up(unsigned int cpu); | 49 | extern int __cpu_up(unsigned int cpu); |
50 | 50 | ||
diff --git a/include/asm-ppc/thread_info.h b/include/asm-ppc/thread_info.h index f7f01524e8a8..e3b5284a6f91 100644 --- a/include/asm-ppc/thread_info.h +++ b/include/asm-ppc/thread_info.h | |||
@@ -77,12 +77,19 @@ static inline struct thread_info *current_thread_info(void) | |||
77 | #define TIF_POLLING_NRFLAG 4 /* true if poll_idle() is polling | 77 | #define TIF_POLLING_NRFLAG 4 /* true if poll_idle() is polling |
78 | TIF_NEED_RESCHED */ | 78 | TIF_NEED_RESCHED */ |
79 | #define TIF_MEMDIE 5 | 79 | #define TIF_MEMDIE 5 |
80 | #define TIF_SYSCALL_AUDIT 6 /* syscall auditing active */ | ||
81 | #define TIF_SECCOMP 7 /* secure computing */ | ||
82 | |||
80 | /* as above, but as bit values */ | 83 | /* as above, but as bit values */ |
81 | #define _TIF_SYSCALL_TRACE (1<<TIF_SYSCALL_TRACE) | 84 | #define _TIF_SYSCALL_TRACE (1<<TIF_SYSCALL_TRACE) |
82 | #define _TIF_NOTIFY_RESUME (1<<TIF_NOTIFY_RESUME) | 85 | #define _TIF_NOTIFY_RESUME (1<<TIF_NOTIFY_RESUME) |
83 | #define _TIF_SIGPENDING (1<<TIF_SIGPENDING) | 86 | #define _TIF_SIGPENDING (1<<TIF_SIGPENDING) |
84 | #define _TIF_NEED_RESCHED (1<<TIF_NEED_RESCHED) | 87 | #define _TIF_NEED_RESCHED (1<<TIF_NEED_RESCHED) |
85 | #define _TIF_POLLING_NRFLAG (1<<TIF_POLLING_NRFLAG) | 88 | #define _TIF_POLLING_NRFLAG (1<<TIF_POLLING_NRFLAG) |
89 | #define _TIF_SYSCALL_AUDIT (1<<TIF_SYSCALL_AUDIT) | ||
90 | #define _TIF_SECCOMP (1<<TIF_SECCOMP) | ||
91 | |||
92 | #define _TIF_SYSCALL_T_OR_A (_TIF_SYSCALL_TRACE|_TIF_SYSCALL_AUDIT|_TIF_SECCOMP) | ||
86 | 93 | ||
87 | /* | 94 | /* |
88 | * Non racy (local) flags bit numbers | 95 | * Non racy (local) flags bit numbers |
diff --git a/include/asm-ppc64/agp.h b/include/asm-ppc64/agp.h index be27cfa8c5b0..ca9e423307f4 100644 --- a/include/asm-ppc64/agp.h +++ b/include/asm-ppc64/agp.h | |||
@@ -10,4 +10,14 @@ | |||
10 | #define flush_agp_mappings() | 10 | #define flush_agp_mappings() |
11 | #define flush_agp_cache() mb() | 11 | #define flush_agp_cache() mb() |
12 | 12 | ||
13 | /* Convert a physical address to an address suitable for the GART. */ | ||
14 | #define phys_to_gart(x) (x) | ||
15 | #define gart_to_phys(x) (x) | ||
16 | |||
17 | /* GATT allocation. Returns/accepts GATT kernel virtual address. */ | ||
18 | #define alloc_gatt_pages(order) \ | ||
19 | ((char *)__get_free_pages(GFP_KERNEL, (order))) | ||
20 | #define free_gatt_pages(table, order) \ | ||
21 | free_pages((unsigned long)(table), (order)) | ||
22 | |||
13 | #endif | 23 | #endif |
diff --git a/include/asm-ppc64/dma.h b/include/asm-ppc64/dma.h index d693b8026bc3..dfd1f69059ba 100644 --- a/include/asm-ppc64/dma.h +++ b/include/asm-ppc64/dma.h | |||
@@ -27,6 +27,8 @@ | |||
27 | /* Doesn't really apply... */ | 27 | /* Doesn't really apply... */ |
28 | #define MAX_DMA_ADDRESS (~0UL) | 28 | #define MAX_DMA_ADDRESS (~0UL) |
29 | 29 | ||
30 | #if !defined(CONFIG_PPC_ISERIES) || defined(CONFIG_PCI) | ||
31 | |||
30 | #define dma_outb outb | 32 | #define dma_outb outb |
31 | #define dma_inb inb | 33 | #define dma_inb inb |
32 | 34 | ||
@@ -323,4 +325,5 @@ extern int isa_dma_bridge_buggy; | |||
323 | #else | 325 | #else |
324 | #define isa_dma_bridge_buggy (0) | 326 | #define isa_dma_bridge_buggy (0) |
325 | #endif | 327 | #endif |
328 | #endif /* !defined(CONFIG_PPC_ISERIES) || defined(CONFIG_PCI) */ | ||
326 | #endif /* _ASM_DMA_H */ | 329 | #endif /* _ASM_DMA_H */ |
diff --git a/include/asm-ppc64/elf.h b/include/asm-ppc64/elf.h index 6c42d61bedd1..085eedb956fe 100644 --- a/include/asm-ppc64/elf.h +++ b/include/asm-ppc64/elf.h | |||
@@ -221,9 +221,7 @@ do { \ | |||
221 | set_thread_flag(TIF_ABI_PENDING); \ | 221 | set_thread_flag(TIF_ABI_PENDING); \ |
222 | else \ | 222 | else \ |
223 | clear_thread_flag(TIF_ABI_PENDING); \ | 223 | clear_thread_flag(TIF_ABI_PENDING); \ |
224 | if (ibcs2) \ | 224 | if (personality(current->personality) != PER_LINUX32) \ |
225 | set_personality(PER_SVR4); \ | ||
226 | else if (current->personality != PER_LINUX32) \ | ||
227 | set_personality(PER_LINUX); \ | 225 | set_personality(PER_LINUX); \ |
228 | } while (0) | 226 | } while (0) |
229 | 227 | ||
diff --git a/include/asm-ppc64/iSeries/HvCall.h b/include/asm-ppc64/iSeries/HvCall.h index d9a2e74e2399..c3f19475c0d9 100644 --- a/include/asm-ppc64/iSeries/HvCall.h +++ b/include/asm-ppc64/iSeries/HvCall.h | |||
@@ -1,84 +1,36 @@ | |||
1 | /* | 1 | /* |
2 | * HvCall.h | 2 | * HvCall.h |
3 | * Copyright (C) 2001 Mike Corrigan IBM Corporation | 3 | * Copyright (C) 2001 Mike Corrigan IBM Corporation |
4 | * | 4 | * |
5 | * This program is free software; you can redistribute it and/or modify | 5 | * This program is free software; you can redistribute it and/or modify |
6 | * it under the terms of the GNU General Public License as published by | 6 | * it under the terms of the GNU General Public License as published by |
7 | * the Free Software Foundation; either version 2 of the License, or | 7 | * the Free Software Foundation; either version 2 of the License, or |
8 | * (at your option) any later version. | 8 | * (at your option) any later version. |
9 | * | 9 | * |
10 | * This program is distributed in the hope that it will be useful, | 10 | * This program is distributed in the hope that it will be useful, |
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
13 | * GNU General Public License for more details. | 13 | * GNU General Public License for more details. |
14 | * | 14 | * |
15 | * You should have received a copy of the GNU General Public License | 15 | * You should have received a copy of the GNU General Public License |
16 | * along with this program; if not, write to the Free Software | 16 | * along with this program; if not, write to the Free Software |
17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | 17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
18 | */ | 18 | */ |
19 | 19 | /* | |
20 | //=========================================================================== | 20 | * This file contains the "hypervisor call" interface which is used to |
21 | // | 21 | * drive the hypervisor from the OS. |
22 | // This file contains the "hypervisor call" interface which is used to | 22 | */ |
23 | // drive the hypervisor from the OS. | ||
24 | // | ||
25 | //=========================================================================== | ||
26 | #ifndef _HVCALL_H | 23 | #ifndef _HVCALL_H |
27 | #define _HVCALL_H | 24 | #define _HVCALL_H |
28 | 25 | ||
29 | //------------------------------------------------------------------- | ||
30 | // Standard Includes | ||
31 | //------------------------------------------------------------------- | ||
32 | #include <asm/iSeries/HvCallSc.h> | 26 | #include <asm/iSeries/HvCallSc.h> |
33 | #include <asm/iSeries/HvTypes.h> | 27 | #include <asm/iSeries/HvTypes.h> |
34 | #include <asm/paca.h> | 28 | #include <asm/paca.h> |
35 | 29 | ||
36 | /* | ||
37 | enum HvCall_ReturnCode | ||
38 | { | ||
39 | HvCall_Good = 0, | ||
40 | HvCall_Partial = 1, | ||
41 | HvCall_NotOwned = 2, | ||
42 | HvCall_NotFreed = 3, | ||
43 | HvCall_UnspecifiedError = 4 | ||
44 | }; | ||
45 | |||
46 | enum HvCall_TypeOfSIT | ||
47 | { | ||
48 | HvCall_ReduceOnly = 0, | ||
49 | HvCall_Unconditional = 1 | ||
50 | }; | ||
51 | |||
52 | enum HvCall_TypeOfYield | ||
53 | { | ||
54 | HvCall_YieldTimed = 0, // Yield until specified time | ||
55 | HvCall_YieldToActive = 1, // Yield until all active procs have run | ||
56 | HvCall_YieldToProc = 2 // Yield until the specified processor has run | ||
57 | }; | ||
58 | |||
59 | enum HvCall_InterruptMasks | ||
60 | { | ||
61 | HvCall_MaskIPI = 0x00000001, | ||
62 | HvCall_MaskLpEvent = 0x00000002, | ||
63 | HvCall_MaskLpProd = 0x00000004, | ||
64 | HvCall_MaskTimeout = 0x00000008 | ||
65 | }; | ||
66 | |||
67 | enum HvCall_VaryOffChunkRc | ||
68 | { | ||
69 | HvCall_VaryOffSucceeded = 0, | ||
70 | HvCall_VaryOffWithdrawn = 1, | ||
71 | HvCall_ChunkInLoadArea = 2, | ||
72 | HvCall_ChunkInHPT = 3, | ||
73 | HvCall_ChunkNotAccessible = 4, | ||
74 | HvCall_ChunkInUse = 5 | ||
75 | }; | ||
76 | */ | ||
77 | |||
78 | /* Type of yield for HvCallBaseYieldProcessor */ | 30 | /* Type of yield for HvCallBaseYieldProcessor */ |
79 | #define HvCall_YieldTimed 0 // Yield until specified time (tb) | 31 | #define HvCall_YieldTimed 0 /* Yield until specified time (tb) */ |
80 | #define HvCall_YieldToActive 1 // Yield until all active procs have run | 32 | #define HvCall_YieldToActive 1 /* Yield until all active procs have run */ |
81 | #define HvCall_YieldToProc 2 // Yield until the specified processor has run | 33 | #define HvCall_YieldToProc 2 /* Yield until the specified processor has run */ |
82 | 34 | ||
83 | /* interrupt masks for setEnabledInterrupts */ | 35 | /* interrupt masks for setEnabledInterrupts */ |
84 | #define HvCall_MaskIPI 0x00000001 | 36 | #define HvCall_MaskIPI 0x00000001 |
@@ -86,7 +38,7 @@ enum HvCall_VaryOffChunkRc | |||
86 | #define HvCall_MaskLpProd 0x00000004 | 38 | #define HvCall_MaskLpProd 0x00000004 |
87 | #define HvCall_MaskTimeout 0x00000008 | 39 | #define HvCall_MaskTimeout 0x00000008 |
88 | 40 | ||
89 | /* Log buffer formats */ | 41 | /* Log buffer formats */ |
90 | #define HvCall_LogBuffer_ASCII 0 | 42 | #define HvCall_LogBuffer_ASCII 0 |
91 | #define HvCall_LogBuffer_EBCDIC 1 | 43 | #define HvCall_LogBuffer_EBCDIC 1 |
92 | 44 | ||
@@ -95,7 +47,7 @@ enum HvCall_VaryOffChunkRc | |||
95 | #define HvCallBaseGetHwPatch HvCallBase + 2 | 47 | #define HvCallBaseGetHwPatch HvCallBase + 2 |
96 | #define HvCallBaseReIplSpAttn HvCallBase + 3 | 48 | #define HvCallBaseReIplSpAttn HvCallBase + 3 |
97 | #define HvCallBaseSetASR HvCallBase + 4 | 49 | #define HvCallBaseSetASR HvCallBase + 4 |
98 | #define HvCallBaseSetASRAndRfi HvCallBase + 5 | 50 | #define HvCallBaseSetASRAndRfi HvCallBase + 5 |
99 | #define HvCallBaseSetIMR HvCallBase + 6 | 51 | #define HvCallBaseSetIMR HvCallBase + 6 |
100 | #define HvCallBaseSendIPI HvCallBase + 7 | 52 | #define HvCallBaseSendIPI HvCallBase + 7 |
101 | #define HvCallBaseTerminateMachine HvCallBase + 8 | 53 | #define HvCallBaseTerminateMachine HvCallBase + 8 |
@@ -115,91 +67,47 @@ enum HvCall_VaryOffChunkRc | |||
115 | #define HvCallBaseGetLogBufferCodePage HvCallBase + 22 | 67 | #define HvCallBaseGetLogBufferCodePage HvCallBase + 22 |
116 | #define HvCallBaseGetLogBufferFormat HvCallBase + 23 | 68 | #define HvCallBaseGetLogBufferFormat HvCallBase + 23 |
117 | #define HvCallBaseGetLogBufferLength HvCallBase + 24 | 69 | #define HvCallBaseGetLogBufferLength HvCallBase + 24 |
118 | #define HvCallBaseReadLogBuffer HvCallBase + 25 | 70 | #define HvCallBaseReadLogBuffer HvCallBase + 25 |
119 | #define HvCallBaseSetLogBufferFormatAndCodePage HvCallBase + 26 | 71 | #define HvCallBaseSetLogBufferFormatAndCodePage HvCallBase + 26 |
120 | #define HvCallBaseWriteLogBuffer HvCallBase + 27 | 72 | #define HvCallBaseWriteLogBuffer HvCallBase + 27 |
121 | #define HvCallBaseRouter28 HvCallBase + 28 | 73 | #define HvCallBaseRouter28 HvCallBase + 28 |
122 | #define HvCallBaseRouter29 HvCallBase + 29 | 74 | #define HvCallBaseRouter29 HvCallBase + 29 |
123 | #define HvCallBaseRouter30 HvCallBase + 30 | 75 | #define HvCallBaseRouter30 HvCallBase + 30 |
124 | #define HvCallBaseSetDebugBus HvCallBase + 31 | 76 | #define HvCallBaseSetDebugBus HvCallBase + 31 |
125 | 77 | ||
126 | #define HvCallCcSetDABR HvCallCc + 7 | 78 | #define HvCallCcSetDABR HvCallCc + 7 |
127 | 79 | ||
128 | //===================================================================================== | 80 | static inline void HvCall_setVirtualDecr(void) |
129 | static inline void HvCall_setVirtualDecr(void) | ||
130 | { | 81 | { |
131 | /* Ignore any error return codes - most likely means that the target value for the | 82 | /* |
132 | * LP has been increased and this vary off would bring us below the new target. */ | 83 | * Ignore any error return codes - most likely means that the |
84 | * target value for the LP has been increased and this vary off | ||
85 | * would bring us below the new target. | ||
86 | */ | ||
133 | HvCall0(HvCallBaseSetVirtualDecr); | 87 | HvCall0(HvCallBaseSetVirtualDecr); |
134 | } | 88 | } |
135 | //===================================================================== | ||
136 | static inline void HvCall_yieldProcessor(unsigned typeOfYield, u64 yieldParm) | ||
137 | { | ||
138 | HvCall2( HvCallBaseYieldProcessor, typeOfYield, yieldParm ); | ||
139 | } | ||
140 | //===================================================================== | ||
141 | static inline void HvCall_setEnabledInterrupts(u64 enabledInterrupts) | ||
142 | { | ||
143 | HvCall1(HvCallBaseSetEnabledInterrupts,enabledInterrupts); | ||
144 | } | ||
145 | |||
146 | //===================================================================== | ||
147 | static inline void HvCall_clearLogBuffer(HvLpIndex lpindex) | ||
148 | { | ||
149 | HvCall1(HvCallBaseClearLogBuffer,lpindex); | ||
150 | } | ||
151 | |||
152 | //===================================================================== | ||
153 | static inline u32 HvCall_getLogBufferCodePage(HvLpIndex lpindex) | ||
154 | { | ||
155 | u32 retVal = HvCall1(HvCallBaseGetLogBufferCodePage,lpindex); | ||
156 | return retVal; | ||
157 | } | ||
158 | |||
159 | //===================================================================== | ||
160 | static inline int HvCall_getLogBufferFormat(HvLpIndex lpindex) | ||
161 | { | ||
162 | int retVal = HvCall1(HvCallBaseGetLogBufferFormat,lpindex); | ||
163 | return retVal; | ||
164 | } | ||
165 | |||
166 | //===================================================================== | ||
167 | static inline u32 HvCall_getLogBufferLength(HvLpIndex lpindex) | ||
168 | { | ||
169 | u32 retVal = HvCall1(HvCallBaseGetLogBufferLength,lpindex); | ||
170 | return retVal; | ||
171 | } | ||
172 | 89 | ||
173 | //===================================================================== | 90 | static inline void HvCall_yieldProcessor(unsigned typeOfYield, u64 yieldParm) |
174 | static inline void HvCall_setLogBufferFormatAndCodepage(int format, u32 codePage) | ||
175 | { | 91 | { |
176 | HvCall2(HvCallBaseSetLogBufferFormatAndCodePage,format, codePage); | 92 | HvCall2(HvCallBaseYieldProcessor, typeOfYield, yieldParm); |
177 | } | 93 | } |
178 | 94 | ||
179 | //===================================================================== | 95 | static inline void HvCall_setEnabledInterrupts(u64 enabledInterrupts) |
180 | int HvCall_readLogBuffer(HvLpIndex lpindex, void *buffer, u64 bufLen); | ||
181 | void HvCall_writeLogBuffer(const void *buffer, u64 bufLen); | ||
182 | |||
183 | //===================================================================== | ||
184 | static inline void HvCall_sendIPI(struct paca_struct * targetPaca) | ||
185 | { | 96 | { |
186 | HvCall1( HvCallBaseSendIPI, targetPaca->paca_index ); | 97 | HvCall1(HvCallBaseSetEnabledInterrupts, enabledInterrupts); |
187 | } | 98 | } |
188 | 99 | ||
189 | //===================================================================== | 100 | static inline void HvCall_setLogBufferFormatAndCodepage(int format, |
190 | static inline void HvCall_terminateMachineSrc(void) | 101 | u32 codePage) |
191 | { | 102 | { |
192 | HvCall0( HvCallBaseTerminateMachineSrc ); | 103 | HvCall2(HvCallBaseSetLogBufferFormatAndCodePage, format, codePage); |
193 | } | 104 | } |
194 | 105 | ||
195 | static inline void HvCall_setDABR(unsigned long val) | 106 | extern void HvCall_writeLogBuffer(const void *buffer, u64 bufLen); |
196 | { | ||
197 | HvCall1(HvCallCcSetDABR, val); | ||
198 | } | ||
199 | 107 | ||
200 | static inline void HvCall_setDebugBus(unsigned long val) | 108 | static inline void HvCall_sendIPI(struct paca_struct *targetPaca) |
201 | { | 109 | { |
202 | HvCall1(HvCallBaseSetDebugBus, val); | 110 | HvCall1(HvCallBaseSendIPI, targetPaca->paca_index); |
203 | } | 111 | } |
204 | 112 | ||
205 | #endif /* _HVCALL_H */ | 113 | #endif /* _HVCALL_H */ |
diff --git a/include/asm-ppc64/iSeries/HvCallCfg.h b/include/asm-ppc64/iSeries/HvCallCfg.h deleted file mode 100644 index 9f40f16de533..000000000000 --- a/include/asm-ppc64/iSeries/HvCallCfg.h +++ /dev/null | |||
@@ -1,213 +0,0 @@ | |||
1 | /* | ||
2 | * HvCallCfg.h | ||
3 | * Copyright (C) 2001 Mike Corrigan IBM Corporation | ||
4 | * | ||
5 | * This program is free software; you can redistribute it and/or modify | ||
6 | * it under the terms of the GNU General Public License as published by | ||
7 | * the Free Software Foundation; either version 2 of the License, or | ||
8 | * (at your option) any later version. | ||
9 | * | ||
10 | * This program is distributed in the hope that it will be useful, | ||
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
13 | * GNU General Public License for more details. | ||
14 | * | ||
15 | * You should have received a copy of the GNU General Public License | ||
16 | * along with this program; if not, write to the Free Software | ||
17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
18 | */ | ||
19 | |||
20 | //===================================================================================== | ||
21 | // | ||
22 | // This file contains the "hypervisor call" interface which is used to | ||
23 | // drive the hypervisor from the OS. | ||
24 | // | ||
25 | //===================================================================================== | ||
26 | #ifndef _HVCALLCFG_H | ||
27 | #define _HVCALLCFG_H | ||
28 | |||
29 | //------------------------------------------------------------------- | ||
30 | // Standard Includes | ||
31 | //------------------------------------------------------------------- | ||
32 | #include <asm/iSeries/HvCallSc.h> | ||
33 | #include <asm/iSeries/HvTypes.h> | ||
34 | |||
35 | //------------------------------------------------------------------------------------- | ||
36 | // Constants | ||
37 | //------------------------------------------------------------------------------------- | ||
38 | |||
39 | enum HvCallCfg_ReqQual | ||
40 | { | ||
41 | HvCallCfg_Cur = 0, | ||
42 | HvCallCfg_Init = 1, | ||
43 | HvCallCfg_Max = 2, | ||
44 | HvCallCfg_Min = 3 | ||
45 | }; | ||
46 | |||
47 | #define HvCallCfgGetLps HvCallCfg + 0 | ||
48 | #define HvCallCfgGetActiveLpMap HvCallCfg + 1 | ||
49 | #define HvCallCfgGetLpVrmIndex HvCallCfg + 2 | ||
50 | #define HvCallCfgGetLpMinSupportedPlicVrmIndex HvCallCfg + 3 | ||
51 | #define HvCallCfgGetLpMinCompatablePlicVrmIndex HvCallCfg + 4 | ||
52 | #define HvCallCfgGetLpVrmName HvCallCfg + 5 | ||
53 | #define HvCallCfgGetSystemPhysicalProcessors HvCallCfg + 6 | ||
54 | #define HvCallCfgGetPhysicalProcessors HvCallCfg + 7 | ||
55 | #define HvCallCfgGetSystemMsChunks HvCallCfg + 8 | ||
56 | #define HvCallCfgGetMsChunks HvCallCfg + 9 | ||
57 | #define HvCallCfgGetInteractivePercentage HvCallCfg + 10 | ||
58 | #define HvCallCfgIsBusDedicated HvCallCfg + 11 | ||
59 | #define HvCallCfgGetBusOwner HvCallCfg + 12 | ||
60 | #define HvCallCfgGetBusAllocation HvCallCfg + 13 | ||
61 | #define HvCallCfgGetBusUnitOwner HvCallCfg + 14 | ||
62 | #define HvCallCfgGetBusUnitAllocation HvCallCfg + 15 | ||
63 | #define HvCallCfgGetVirtualBusPool HvCallCfg + 16 | ||
64 | #define HvCallCfgGetBusUnitInterruptProc HvCallCfg + 17 | ||
65 | #define HvCallCfgGetConfiguredBusUnitsForIntProc HvCallCfg + 18 | ||
66 | #define HvCallCfgGetRioSanBusPool HvCallCfg + 19 | ||
67 | #define HvCallCfgGetSharedPoolIndex HvCallCfg + 20 | ||
68 | #define HvCallCfgGetSharedProcUnits HvCallCfg + 21 | ||
69 | #define HvCallCfgGetNumProcsInSharedPool HvCallCfg + 22 | ||
70 | #define HvCallCfgRouter23 HvCallCfg + 23 | ||
71 | #define HvCallCfgRouter24 HvCallCfg + 24 | ||
72 | #define HvCallCfgRouter25 HvCallCfg + 25 | ||
73 | #define HvCallCfgRouter26 HvCallCfg + 26 | ||
74 | #define HvCallCfgRouter27 HvCallCfg + 27 | ||
75 | #define HvCallCfgGetMinRuntimeMsChunks HvCallCfg + 28 | ||
76 | #define HvCallCfgSetMinRuntimeMsChunks HvCallCfg + 29 | ||
77 | #define HvCallCfgGetVirtualLanIndexMap HvCallCfg + 30 | ||
78 | #define HvCallCfgGetLpExecutionMode HvCallCfg + 31 | ||
79 | #define HvCallCfgGetHostingLpIndex HvCallCfg + 32 | ||
80 | |||
81 | //==================================================================== | ||
82 | static inline HvLpIndex HvCallCfg_getLps(void) | ||
83 | { | ||
84 | HvLpIndex retVal = HvCall0(HvCallCfgGetLps); | ||
85 | // getPaca()->adjustHmtForNoOfSpinLocksHeld(); | ||
86 | return retVal; | ||
87 | } | ||
88 | //==================================================================== | ||
89 | static inline int HvCallCfg_isBusDedicated(u64 busIndex) | ||
90 | { | ||
91 | int retVal = HvCall1(HvCallCfgIsBusDedicated,busIndex); | ||
92 | // getPaca()->adjustHmtForNoOfSpinLocksHeld(); | ||
93 | return retVal; | ||
94 | } | ||
95 | //==================================================================== | ||
96 | static inline HvLpIndex HvCallCfg_getBusOwner(u64 busIndex) | ||
97 | { | ||
98 | HvLpIndex retVal = HvCall1(HvCallCfgGetBusOwner,busIndex); | ||
99 | // getPaca()->adjustHmtForNoOfSpinLocksHeld(); | ||
100 | return retVal; | ||
101 | } | ||
102 | //==================================================================== | ||
103 | static inline HvLpIndexMap HvCallCfg_getBusAllocation(u64 busIndex) | ||
104 | { | ||
105 | HvLpIndexMap retVal = HvCall1(HvCallCfgGetBusAllocation,busIndex); | ||
106 | // getPaca()->adjustHmtForNoOfSpinLocksHeld(); | ||
107 | return retVal; | ||
108 | } | ||
109 | //==================================================================== | ||
110 | static inline HvLpIndexMap HvCallCfg_getActiveLpMap(void) | ||
111 | { | ||
112 | HvLpIndexMap retVal = HvCall0(HvCallCfgGetActiveLpMap); | ||
113 | // getPaca()->adjustHmtForNoOfSpinLocksHeld(); | ||
114 | return retVal; | ||
115 | } | ||
116 | //==================================================================== | ||
117 | static inline HvLpVirtualLanIndexMap HvCallCfg_getVirtualLanIndexMap(HvLpIndex lp) | ||
118 | { | ||
119 | // This is a new function in V5R1 so calls to this on older | ||
120 | // hypervisors will return -1 | ||
121 | u64 retVal = HvCall1(HvCallCfgGetVirtualLanIndexMap, lp); | ||
122 | if(retVal == -1) | ||
123 | retVal = 0; | ||
124 | // getPaca()->adjustHmtForNoOfSpinLocksHeld(); | ||
125 | return retVal; | ||
126 | } | ||
127 | //=================================================================== | ||
128 | static inline u64 HvCallCfg_getSystemMsChunks(void) | ||
129 | { | ||
130 | u64 retVal = HvCall0(HvCallCfgGetSystemMsChunks); | ||
131 | // getPaca()->adjustHmtForNoOfSpinLocksHeld(); | ||
132 | return retVal; | ||
133 | } | ||
134 | //=================================================================== | ||
135 | static inline u64 HvCallCfg_getMsChunks(HvLpIndex lp,enum HvCallCfg_ReqQual qual) | ||
136 | { | ||
137 | u64 retVal = HvCall2(HvCallCfgGetMsChunks,lp,qual); | ||
138 | // getPaca()->adjustHmtForNoOfSpinLocksHeld(); | ||
139 | return retVal; | ||
140 | } | ||
141 | //=================================================================== | ||
142 | static inline u64 HvCallCfg_getMinRuntimeMsChunks(HvLpIndex lp) | ||
143 | { | ||
144 | // NOTE: This function was added in v5r1 so older hypervisors will return a -1 value | ||
145 | u64 retVal = HvCall1(HvCallCfgGetMinRuntimeMsChunks,lp); | ||
146 | // getPaca()->adjustHmtForNoOfSpinLocksHeld(); | ||
147 | return retVal; | ||
148 | } | ||
149 | //=================================================================== | ||
150 | static inline u64 HvCallCfg_setMinRuntimeMsChunks(u64 chunks) | ||
151 | { | ||
152 | u64 retVal = HvCall1(HvCallCfgSetMinRuntimeMsChunks,chunks); | ||
153 | // getPaca()->adjustHmtForNoOfSpinLocksHeld(); | ||
154 | return retVal; | ||
155 | } | ||
156 | //=================================================================== | ||
157 | static inline u64 HvCallCfg_getSystemPhysicalProcessors(void) | ||
158 | { | ||
159 | u64 retVal = HvCall0(HvCallCfgGetSystemPhysicalProcessors); | ||
160 | // getPaca()->adjustHmtForNoOfSpinLocksHeld(); | ||
161 | return retVal; | ||
162 | } | ||
163 | //=================================================================== | ||
164 | static inline u64 HvCallCfg_getPhysicalProcessors(HvLpIndex lp,enum HvCallCfg_ReqQual qual) | ||
165 | { | ||
166 | u64 retVal = HvCall2(HvCallCfgGetPhysicalProcessors,lp,qual); | ||
167 | // getPaca()->adjustHmtForNoOfSpinLocksHeld(); | ||
168 | return retVal; | ||
169 | } | ||
170 | //=================================================================== | ||
171 | static inline u64 HvCallCfg_getConfiguredBusUnitsForInterruptProc(HvLpIndex lp, | ||
172 | u16 hvLogicalProcIndex) | ||
173 | { | ||
174 | u64 retVal = HvCall2(HvCallCfgGetConfiguredBusUnitsForIntProc,lp,hvLogicalProcIndex); | ||
175 | // getPaca()->adjustHmtForNoOfSpinLocksHeld(); | ||
176 | return retVal; | ||
177 | |||
178 | } | ||
179 | //================================================================== | ||
180 | static inline HvLpSharedPoolIndex HvCallCfg_getSharedPoolIndex(HvLpIndex lp) | ||
181 | { | ||
182 | HvLpSharedPoolIndex retVal = | ||
183 | HvCall1(HvCallCfgGetSharedPoolIndex,lp); | ||
184 | // getPaca()->adjustHmtForNoOfSpinLocksHeld(); | ||
185 | return retVal; | ||
186 | |||
187 | } | ||
188 | //================================================================== | ||
189 | static inline u64 HvCallCfg_getSharedProcUnits(HvLpIndex lp,enum HvCallCfg_ReqQual qual) | ||
190 | { | ||
191 | u64 retVal = HvCall2(HvCallCfgGetSharedProcUnits,lp,qual); | ||
192 | // getPaca()->adjustHmtForNoOfSpinLocksHeld(); | ||
193 | return retVal; | ||
194 | |||
195 | } | ||
196 | //================================================================== | ||
197 | static inline u64 HvCallCfg_getNumProcsInSharedPool(HvLpSharedPoolIndex sPI) | ||
198 | { | ||
199 | u16 retVal = HvCall1(HvCallCfgGetNumProcsInSharedPool,sPI); | ||
200 | // getPaca()->adjustHmtForNoOfSpinLocksHeld(); | ||
201 | return retVal; | ||
202 | |||
203 | } | ||
204 | //================================================================== | ||
205 | static inline HvLpIndex HvCallCfg_getHostingLpIndex(HvLpIndex lp) | ||
206 | { | ||
207 | u64 retVal = HvCall1(HvCallCfgGetHostingLpIndex,lp); | ||
208 | // getPaca()->adjustHmtForNoOfSpinLocksHeld(); | ||
209 | return retVal; | ||
210 | |||
211 | } | ||
212 | |||
213 | #endif /* _HVCALLCFG_H */ | ||
diff --git a/include/asm-ppc64/iSeries/HvCallEvent.h b/include/asm-ppc64/iSeries/HvCallEvent.h index 191ddce0c2c6..5d9a327d0122 100644 --- a/include/asm-ppc64/iSeries/HvCallEvent.h +++ b/include/asm-ppc64/iSeries/HvCallEvent.h | |||
@@ -1,32 +1,28 @@ | |||
1 | /* | 1 | /* |
2 | * HvCallEvent.h | 2 | * HvCallEvent.h |
3 | * Copyright (C) 2001 Mike Corrigan IBM Corporation | 3 | * Copyright (C) 2001 Mike Corrigan IBM Corporation |
4 | * | 4 | * |
5 | * This program is free software; you can redistribute it and/or modify | 5 | * This program is free software; you can redistribute it and/or modify |
6 | * it under the terms of the GNU General Public License as published by | 6 | * it under the terms of the GNU General Public License as published by |
7 | * the Free Software Foundation; either version 2 of the License, or | 7 | * the Free Software Foundation; either version 2 of the License, or |
8 | * (at your option) any later version. | 8 | * (at your option) any later version. |
9 | * | 9 | * |
10 | * This program is distributed in the hope that it will be useful, | 10 | * This program is distributed in the hope that it will be useful, |
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
13 | * GNU General Public License for more details. | 13 | * GNU General Public License for more details. |
14 | * | 14 | * |
15 | * You should have received a copy of the GNU General Public License | 15 | * You should have received a copy of the GNU General Public License |
16 | * along with this program; if not, write to the Free Software | 16 | * along with this program; if not, write to the Free Software |
17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | 17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
18 | */ | 18 | */ |
19 | |||
20 | /* | 19 | /* |
21 | * This file contains the "hypervisor call" interface which is used to | 20 | * This file contains the "hypervisor call" interface which is used to |
22 | * drive the hypervisor from the OS. | 21 | * drive the hypervisor from the OS. |
23 | */ | 22 | */ |
24 | #ifndef _HVCALLEVENT_H | 23 | #ifndef _HVCALLEVENT_H |
25 | #define _HVCALLEVENT_H | 24 | #define _HVCALLEVENT_H |
26 | 25 | ||
27 | /* | ||
28 | * Standard Includes | ||
29 | */ | ||
30 | #include <asm/iSeries/HvCallSc.h> | 26 | #include <asm/iSeries/HvCallSc.h> |
31 | #include <asm/iSeries/HvTypes.h> | 27 | #include <asm/iSeries/HvTypes.h> |
32 | #include <asm/abs_addr.h> | 28 | #include <asm/abs_addr.h> |
@@ -71,7 +67,7 @@ typedef u64 HvLpDma_Rc; | |||
71 | #define HvCallEventCloseLpEventPath HvCallEvent + 2 | 67 | #define HvCallEventCloseLpEventPath HvCallEvent + 2 |
72 | #define HvCallEventDmaBufList HvCallEvent + 3 | 68 | #define HvCallEventDmaBufList HvCallEvent + 3 |
73 | #define HvCallEventDmaSingle HvCallEvent + 4 | 69 | #define HvCallEventDmaSingle HvCallEvent + 4 |
74 | #define HvCallEventDmaToSp HvCallEvent + 5 | 70 | #define HvCallEventDmaToSp HvCallEvent + 5 |
75 | #define HvCallEventGetOverflowLpEvents HvCallEvent + 6 | 71 | #define HvCallEventGetOverflowLpEvents HvCallEvent + 6 |
76 | #define HvCallEventGetSourceLpInstanceId HvCallEvent + 7 | 72 | #define HvCallEventGetSourceLpInstanceId HvCallEvent + 7 |
77 | #define HvCallEventGetTargetLpInstanceId HvCallEvent + 8 | 73 | #define HvCallEventGetTargetLpInstanceId HvCallEvent + 8 |
@@ -85,14 +81,12 @@ typedef u64 HvLpDma_Rc; | |||
85 | 81 | ||
86 | static inline void HvCallEvent_getOverflowLpEvents(u8 queueIndex) | 82 | static inline void HvCallEvent_getOverflowLpEvents(u8 queueIndex) |
87 | { | 83 | { |
88 | HvCall1(HvCallEventGetOverflowLpEvents,queueIndex); | 84 | HvCall1(HvCallEventGetOverflowLpEvents, queueIndex); |
89 | // getPaca()->adjustHmtForNoOfSpinLocksHeld(); | ||
90 | } | 85 | } |
91 | 86 | ||
92 | static inline void HvCallEvent_setInterLpQueueIndex(u8 queueIndex) | 87 | static inline void HvCallEvent_setInterLpQueueIndex(u8 queueIndex) |
93 | { | 88 | { |
94 | HvCall1(HvCallEventSetInterLpQueueIndex,queueIndex); | 89 | HvCall1(HvCallEventSetInterLpQueueIndex, queueIndex); |
95 | // getPaca()->adjustHmtForNoOfSpinLocksHeld(); | ||
96 | } | 90 | } |
97 | 91 | ||
98 | static inline void HvCallEvent_setLpEventStack(u8 queueIndex, | 92 | static inline void HvCallEvent_setLpEventStack(u8 queueIndex, |
@@ -103,7 +97,6 @@ static inline void HvCallEvent_setLpEventStack(u8 queueIndex, | |||
103 | abs_addr = virt_to_abs(eventStackAddr); | 97 | abs_addr = virt_to_abs(eventStackAddr); |
104 | HvCall3(HvCallEventSetLpEventStack, queueIndex, abs_addr, | 98 | HvCall3(HvCallEventSetLpEventStack, queueIndex, abs_addr, |
105 | eventStackSize); | 99 | eventStackSize); |
106 | // getPaca()->adjustHmtForNoOfSpinLocksHeld(); | ||
107 | } | 100 | } |
108 | 101 | ||
109 | static inline void HvCallEvent_setLpEventQueueInterruptProc(u8 queueIndex, | 102 | static inline void HvCallEvent_setLpEventQueueInterruptProc(u8 queueIndex, |
@@ -111,22 +104,18 @@ static inline void HvCallEvent_setLpEventQueueInterruptProc(u8 queueIndex, | |||
111 | { | 104 | { |
112 | HvCall2(HvCallEventSetLpEventQueueInterruptProc, queueIndex, | 105 | HvCall2(HvCallEventSetLpEventQueueInterruptProc, queueIndex, |
113 | lpLogicalProcIndex); | 106 | lpLogicalProcIndex); |
114 | // getPaca()->adjustHmtForNoOfSpinLocksHeld(); | ||
115 | } | 107 | } |
116 | 108 | ||
117 | static inline HvLpEvent_Rc HvCallEvent_signalLpEvent(struct HvLpEvent *event) | 109 | static inline HvLpEvent_Rc HvCallEvent_signalLpEvent(struct HvLpEvent *event) |
118 | { | 110 | { |
119 | u64 abs_addr; | 111 | u64 abs_addr; |
120 | HvLpEvent_Rc retVal; | ||
121 | 112 | ||
122 | #ifdef DEBUG_SENDEVENT | 113 | #ifdef DEBUG_SENDEVENT |
123 | printk("HvCallEvent_signalLpEvent: *event = %016lx\n ", | 114 | printk("HvCallEvent_signalLpEvent: *event = %016lx\n ", |
124 | (unsigned long)event); | 115 | (unsigned long)event); |
125 | #endif | 116 | #endif |
126 | abs_addr = virt_to_abs(event); | 117 | abs_addr = virt_to_abs(event); |
127 | retVal = (HvLpEvent_Rc)HvCall1(HvCallEventSignalLpEvent, abs_addr); | 118 | return HvCall1(HvCallEventSignalLpEvent, abs_addr); |
128 | // getPaca()->adjustHmtForNoOfSpinLocksHeld(); | ||
129 | return retVal; | ||
130 | } | 119 | } |
131 | 120 | ||
132 | static inline HvLpEvent_Rc HvCallEvent_signalLpEventFast(HvLpIndex targetLp, | 121 | static inline HvLpEvent_Rc HvCallEvent_signalLpEventFast(HvLpIndex targetLp, |
@@ -136,9 +125,7 @@ static inline HvLpEvent_Rc HvCallEvent_signalLpEventFast(HvLpIndex targetLp, | |||
136 | u64 eventData1, u64 eventData2, u64 eventData3, | 125 | u64 eventData1, u64 eventData2, u64 eventData3, |
137 | u64 eventData4, u64 eventData5) | 126 | u64 eventData4, u64 eventData5) |
138 | { | 127 | { |
139 | HvLpEvent_Rc retVal; | 128 | /* Pack the misc bits into a single Dword to pass to PLIC */ |
140 | |||
141 | // Pack the misc bits into a single Dword to pass to PLIC | ||
142 | union { | 129 | union { |
143 | struct HvCallEvent_PackedParms parms; | 130 | struct HvCallEvent_PackedParms parms; |
144 | u64 dword; | 131 | u64 dword; |
@@ -152,67 +139,49 @@ static inline HvLpEvent_Rc HvCallEvent_signalLpEventFast(HvLpIndex targetLp, | |||
152 | packed.parms.xSourceInstId = sourceInstanceId; | 139 | packed.parms.xSourceInstId = sourceInstanceId; |
153 | packed.parms.xTargetInstId = targetInstanceId; | 140 | packed.parms.xTargetInstId = targetInstanceId; |
154 | 141 | ||
155 | retVal = (HvLpEvent_Rc)HvCall7(HvCallEventSignalLpEventParms, | 142 | return HvCall7(HvCallEventSignalLpEventParms, packed.dword, |
156 | packed.dword, correlationToken, eventData1,eventData2, | 143 | correlationToken, eventData1, eventData2, |
157 | eventData3,eventData4, eventData5); | 144 | eventData3, eventData4, eventData5); |
158 | // getPaca()->adjustHmtForNoOfSpinLocksHeld(); | ||
159 | return retVal; | ||
160 | } | 145 | } |
161 | 146 | ||
162 | static inline HvLpEvent_Rc HvCallEvent_ackLpEvent(struct HvLpEvent *event) | 147 | static inline HvLpEvent_Rc HvCallEvent_ackLpEvent(struct HvLpEvent *event) |
163 | { | 148 | { |
164 | u64 abs_addr; | 149 | u64 abs_addr; |
165 | HvLpEvent_Rc retVal; | ||
166 | 150 | ||
167 | abs_addr = virt_to_abs(event); | 151 | abs_addr = virt_to_abs(event); |
168 | retVal = (HvLpEvent_Rc)HvCall1(HvCallEventAckLpEvent, abs_addr); | 152 | return HvCall1(HvCallEventAckLpEvent, abs_addr); |
169 | // getPaca()->adjustHmtForNoOfSpinLocksHeld(); | ||
170 | return retVal; | ||
171 | } | 153 | } |
172 | 154 | ||
173 | static inline HvLpEvent_Rc HvCallEvent_cancelLpEvent(struct HvLpEvent *event) | 155 | static inline HvLpEvent_Rc HvCallEvent_cancelLpEvent(struct HvLpEvent *event) |
174 | { | 156 | { |
175 | u64 abs_addr; | 157 | u64 abs_addr; |
176 | HvLpEvent_Rc retVal; | ||
177 | 158 | ||
178 | abs_addr = virt_to_abs(event); | 159 | abs_addr = virt_to_abs(event); |
179 | retVal = (HvLpEvent_Rc)HvCall1(HvCallEventCancelLpEvent, abs_addr); | 160 | return HvCall1(HvCallEventCancelLpEvent, abs_addr); |
180 | // getPaca()->adjustHmtForNoOfSpinLocksHeld(); | ||
181 | return retVal; | ||
182 | } | 161 | } |
183 | 162 | ||
184 | static inline HvLpInstanceId HvCallEvent_getSourceLpInstanceId( | 163 | static inline HvLpInstanceId HvCallEvent_getSourceLpInstanceId( |
185 | HvLpIndex targetLp, HvLpEvent_Type type) | 164 | HvLpIndex targetLp, HvLpEvent_Type type) |
186 | { | 165 | { |
187 | HvLpInstanceId retVal; | 166 | return HvCall2(HvCallEventGetSourceLpInstanceId, targetLp, type); |
188 | |||
189 | retVal = HvCall2(HvCallEventGetSourceLpInstanceId, targetLp, type); | ||
190 | // getPaca()->adjustHmtForNoOfSpinLocksHeld(); | ||
191 | return retVal; | ||
192 | } | 167 | } |
193 | 168 | ||
194 | static inline HvLpInstanceId HvCallEvent_getTargetLpInstanceId( | 169 | static inline HvLpInstanceId HvCallEvent_getTargetLpInstanceId( |
195 | HvLpIndex targetLp, HvLpEvent_Type type) | 170 | HvLpIndex targetLp, HvLpEvent_Type type) |
196 | { | 171 | { |
197 | HvLpInstanceId retVal; | 172 | return HvCall2(HvCallEventGetTargetLpInstanceId, targetLp, type); |
198 | |||
199 | retVal = HvCall2(HvCallEventGetTargetLpInstanceId, targetLp, type); | ||
200 | // getPaca()->adjustHmtForNoOfSpinLocksHeld(); | ||
201 | return retVal; | ||
202 | } | 173 | } |
203 | 174 | ||
204 | static inline void HvCallEvent_openLpEventPath(HvLpIndex targetLp, | 175 | static inline void HvCallEvent_openLpEventPath(HvLpIndex targetLp, |
205 | HvLpEvent_Type type) | 176 | HvLpEvent_Type type) |
206 | { | 177 | { |
207 | HvCall2(HvCallEventOpenLpEventPath, targetLp, type); | 178 | HvCall2(HvCallEventOpenLpEventPath, targetLp, type); |
208 | // getPaca()->adjustHmtForNoOfSpinLocksHeld(); | ||
209 | } | 179 | } |
210 | 180 | ||
211 | static inline void HvCallEvent_closeLpEventPath(HvLpIndex targetLp, | 181 | static inline void HvCallEvent_closeLpEventPath(HvLpIndex targetLp, |
212 | HvLpEvent_Type type) | 182 | HvLpEvent_Type type) |
213 | { | 183 | { |
214 | HvCall2(HvCallEventCloseLpEventPath, targetLp, type); | 184 | HvCall2(HvCallEventCloseLpEventPath, targetLp, type); |
215 | // getPaca()->adjustHmtForNoOfSpinLocksHeld(); | ||
216 | } | 185 | } |
217 | 186 | ||
218 | static inline HvLpDma_Rc HvCallEvent_dmaBufList(HvLpEvent_Type type, | 187 | static inline HvLpDma_Rc HvCallEvent_dmaBufList(HvLpEvent_Type type, |
@@ -224,8 +193,7 @@ static inline HvLpDma_Rc HvCallEvent_dmaBufList(HvLpEvent_Type type, | |||
224 | /* Do these need to be converted to absolute addresses? */ | 193 | /* Do these need to be converted to absolute addresses? */ |
225 | u64 localBufList, u64 remoteBufList, u32 transferLength) | 194 | u64 localBufList, u64 remoteBufList, u32 transferLength) |
226 | { | 195 | { |
227 | HvLpDma_Rc retVal; | 196 | /* Pack the misc bits into a single Dword to pass to PLIC */ |
228 | // Pack the misc bits into a single Dword to pass to PLIC | ||
229 | union { | 197 | union { |
230 | struct HvCallEvent_PackedDmaParms parms; | 198 | struct HvCallEvent_PackedDmaParms parms; |
231 | u64 dword; | 199 | u64 dword; |
@@ -241,11 +209,8 @@ static inline HvLpDma_Rc HvCallEvent_dmaBufList(HvLpEvent_Type type, | |||
241 | packed.parms.xLocalInstId = localInstanceId; | 209 | packed.parms.xLocalInstId = localInstanceId; |
242 | packed.parms.xRemoteInstId = remoteInstanceId; | 210 | packed.parms.xRemoteInstId = remoteInstanceId; |
243 | 211 | ||
244 | retVal = (HvLpDma_Rc)HvCall4(HvCallEventDmaBufList, | 212 | return HvCall4(HvCallEventDmaBufList, packed.dword, localBufList, |
245 | packed.dword, localBufList, remoteBufList, | 213 | remoteBufList, transferLength); |
246 | transferLength); | ||
247 | // getPaca()->adjustHmtForNoOfSpinLocksHeld(); | ||
248 | return retVal; | ||
249 | } | 214 | } |
250 | 215 | ||
251 | static inline HvLpDma_Rc HvCallEvent_dmaSingle(HvLpEvent_Type type, | 216 | static inline HvLpDma_Rc HvCallEvent_dmaSingle(HvLpEvent_Type type, |
@@ -256,8 +221,7 @@ static inline HvLpDma_Rc HvCallEvent_dmaSingle(HvLpEvent_Type type, | |||
256 | HvLpDma_AddressType remoteAddressType, | 221 | HvLpDma_AddressType remoteAddressType, |
257 | u64 localAddrOrTce, u64 remoteAddrOrTce, u32 transferLength) | 222 | u64 localAddrOrTce, u64 remoteAddrOrTce, u32 transferLength) |
258 | { | 223 | { |
259 | HvLpDma_Rc retVal; | 224 | /* Pack the misc bits into a single Dword to pass to PLIC */ |
260 | // Pack the misc bits into a single Dword to pass to PLIC | ||
261 | union { | 225 | union { |
262 | struct HvCallEvent_PackedDmaParms parms; | 226 | struct HvCallEvent_PackedDmaParms parms; |
263 | u64 dword; | 227 | u64 dword; |
@@ -273,25 +237,17 @@ static inline HvLpDma_Rc HvCallEvent_dmaSingle(HvLpEvent_Type type, | |||
273 | packed.parms.xLocalInstId = localInstanceId; | 237 | packed.parms.xLocalInstId = localInstanceId; |
274 | packed.parms.xRemoteInstId = remoteInstanceId; | 238 | packed.parms.xRemoteInstId = remoteInstanceId; |
275 | 239 | ||
276 | retVal = (HvLpDma_Rc)HvCall4(HvCallEventDmaSingle, | 240 | return (HvLpDma_Rc)HvCall4(HvCallEventDmaSingle, packed.dword, |
277 | packed.dword, localAddrOrTce, remoteAddrOrTce, | 241 | localAddrOrTce, remoteAddrOrTce, transferLength); |
278 | transferLength); | ||
279 | // getPaca()->adjustHmtForNoOfSpinLocksHeld(); | ||
280 | return retVal; | ||
281 | } | 242 | } |
282 | 243 | ||
283 | static inline HvLpDma_Rc HvCallEvent_dmaToSp(void* local, u32 remote, | 244 | static inline HvLpDma_Rc HvCallEvent_dmaToSp(void *local, u32 remote, |
284 | u32 length, HvLpDma_Direction dir) | 245 | u32 length, HvLpDma_Direction dir) |
285 | { | 246 | { |
286 | u64 abs_addr; | 247 | u64 abs_addr; |
287 | HvLpDma_Rc retVal; | ||
288 | 248 | ||
289 | abs_addr = virt_to_abs(local); | 249 | abs_addr = virt_to_abs(local); |
290 | retVal = (HvLpDma_Rc)HvCall4(HvCallEventDmaToSp, abs_addr, remote, | 250 | return HvCall4(HvCallEventDmaToSp, abs_addr, remote, length, dir); |
291 | length, dir); | ||
292 | // getPaca()->adjustHmtForNoOfSpinLocksHeld(); | ||
293 | return retVal; | ||
294 | } | 251 | } |
295 | 252 | ||
296 | |||
297 | #endif /* _HVCALLEVENT_H */ | 253 | #endif /* _HVCALLEVENT_H */ |
diff --git a/include/asm-ppc64/iSeries/HvCallHpt.h b/include/asm-ppc64/iSeries/HvCallHpt.h index da769873d18b..66f38222ff75 100644 --- a/include/asm-ppc64/iSeries/HvCallHpt.h +++ b/include/asm-ppc64/iSeries/HvCallHpt.h | |||
@@ -1,17 +1,17 @@ | |||
1 | /* | 1 | /* |
2 | * HvCallHpt.h | 2 | * HvCallHpt.h |
3 | * Copyright (C) 2001 Mike Corrigan IBM Corporation | 3 | * Copyright (C) 2001 Mike Corrigan IBM Corporation |
4 | * | 4 | * |
5 | * This program is free software; you can redistribute it and/or modify | 5 | * This program is free software; you can redistribute it and/or modify |
6 | * it under the terms of the GNU General Public License as published by | 6 | * it under the terms of the GNU General Public License as published by |
7 | * the Free Software Foundation; either version 2 of the License, or | 7 | * the Free Software Foundation; either version 2 of the License, or |
8 | * (at your option) any later version. | 8 | * (at your option) any later version. |
9 | * | 9 | * |
10 | * This program is distributed in the hope that it will be useful, | 10 | * This program is distributed in the hope that it will be useful, |
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
13 | * GNU General Public License for more details. | 13 | * GNU General Public License for more details. |
14 | * | 14 | * |
15 | * You should have received a copy of the GNU General Public License | 15 | * You should have received a copy of the GNU General Public License |
16 | * along with this program; if not, write to the Free Software | 16 | * along with this program; if not, write to the Free Software |
17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | 17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
@@ -19,21 +19,15 @@ | |||
19 | #ifndef _HVCALLHPT_H | 19 | #ifndef _HVCALLHPT_H |
20 | #define _HVCALLHPT_H | 20 | #define _HVCALLHPT_H |
21 | 21 | ||
22 | //============================================================================ | 22 | /* |
23 | // | 23 | * This file contains the "hypervisor call" interface which is used to |
24 | // This file contains the "hypervisor call" interface which is used to | 24 | * drive the hypervisor from the OS. |
25 | // drive the hypervisor from the OS. | 25 | */ |
26 | // | ||
27 | //============================================================================ | ||
28 | 26 | ||
29 | #include <asm/iSeries/HvCallSc.h> | 27 | #include <asm/iSeries/HvCallSc.h> |
30 | #include <asm/iSeries/HvTypes.h> | 28 | #include <asm/iSeries/HvTypes.h> |
31 | #include <asm/mmu.h> | 29 | #include <asm/mmu.h> |
32 | 30 | ||
33 | //----------------------------------------------------------------------------- | ||
34 | // Constants | ||
35 | //----------------------------------------------------------------------------- | ||
36 | |||
37 | #define HvCallHptGetHptAddress HvCallHpt + 0 | 31 | #define HvCallHptGetHptAddress HvCallHpt + 0 |
38 | #define HvCallHptGetHptPages HvCallHpt + 1 | 32 | #define HvCallHptGetHptPages HvCallHpt + 1 |
39 | #define HvCallHptSetPp HvCallHpt + 5 | 33 | #define HvCallHptSetPp HvCallHpt + 5 |
@@ -47,81 +41,63 @@ | |||
47 | #define HvCallHptInvalidateSetSwBitsGet HvCallHpt + 18 | 41 | #define HvCallHptInvalidateSetSwBitsGet HvCallHpt + 18 |
48 | 42 | ||
49 | 43 | ||
50 | //============================================================================ | 44 | static inline u64 HvCallHpt_getHptAddress(void) |
51 | static inline u64 HvCallHpt_getHptAddress(void) | ||
52 | { | 45 | { |
53 | u64 retval = HvCall0(HvCallHptGetHptAddress); | 46 | return HvCall0(HvCallHptGetHptAddress); |
54 | // getPaca()->adjustHmtForNoOfSpinLocksHeld(); | ||
55 | return retval; | ||
56 | } | 47 | } |
57 | //============================================================================ | 48 | |
58 | static inline u64 HvCallHpt_getHptPages(void) | 49 | static inline u64 HvCallHpt_getHptPages(void) |
59 | { | 50 | { |
60 | u64 retval = HvCall0(HvCallHptGetHptPages); | 51 | return HvCall0(HvCallHptGetHptPages); |
61 | // getPaca()->adjustHmtForNoOfSpinLocksHeld(); | ||
62 | return retval; | ||
63 | } | 52 | } |
64 | //============================================================================= | 53 | |
65 | static inline void HvCallHpt_setPp(u32 hpteIndex, u8 value) | 54 | static inline void HvCallHpt_setPp(u32 hpteIndex, u8 value) |
66 | { | 55 | { |
67 | HvCall2( HvCallHptSetPp, hpteIndex, value ); | 56 | HvCall2(HvCallHptSetPp, hpteIndex, value); |
68 | // getPaca()->adjustHmtForNoOfSpinLocksHeld(); | ||
69 | } | 57 | } |
70 | //============================================================================= | 58 | |
71 | static inline void HvCallHpt_setSwBits(u32 hpteIndex, u8 bitson, u8 bitsoff ) | 59 | static inline void HvCallHpt_setSwBits(u32 hpteIndex, u8 bitson, u8 bitsoff) |
72 | { | 60 | { |
73 | HvCall3( HvCallHptSetSwBits, hpteIndex, bitson, bitsoff ); | 61 | HvCall3(HvCallHptSetSwBits, hpteIndex, bitson, bitsoff); |
74 | // getPaca()->adjustHmtForNoOfSpinLocksHeld(); | ||
75 | } | 62 | } |
76 | //============================================================================= | 63 | |
77 | static inline void HvCallHpt_invalidateNoSyncICache(u32 hpteIndex) | 64 | static inline void HvCallHpt_invalidateNoSyncICache(u32 hpteIndex) |
78 | |||
79 | { | 65 | { |
80 | HvCall1( HvCallHptInvalidateNoSyncICache, hpteIndex ); | 66 | HvCall1(HvCallHptInvalidateNoSyncICache, hpteIndex); |
81 | // getPaca()->adjustHmtForNoOfSpinLocksHeld(); | ||
82 | } | 67 | } |
83 | //============================================================================= | 68 | |
84 | static inline u64 HvCallHpt_invalidateSetSwBitsGet(u32 hpteIndex, u8 bitson, u8 bitsoff ) | 69 | static inline u64 HvCallHpt_invalidateSetSwBitsGet(u32 hpteIndex, u8 bitson, |
85 | 70 | u8 bitsoff) | |
86 | { | 71 | { |
87 | u64 compressedStatus; | 72 | u64 compressedStatus; |
88 | compressedStatus = HvCall4( HvCallHptInvalidateSetSwBitsGet, hpteIndex, bitson, bitsoff, 1 ); | 73 | |
89 | HvCall1( HvCallHptInvalidateNoSyncICache, hpteIndex ); | 74 | compressedStatus = HvCall4(HvCallHptInvalidateSetSwBitsGet, |
90 | // getPaca()->adjustHmtForNoOfSpinLocksHeld(); | 75 | hpteIndex, bitson, bitsoff, 1); |
76 | HvCall1(HvCallHptInvalidateNoSyncICache, hpteIndex); | ||
91 | return compressedStatus; | 77 | return compressedStatus; |
92 | } | 78 | } |
93 | //============================================================================= | 79 | |
94 | static inline u64 HvCallHpt_findValid( HPTE *hpte, u64 vpn ) | 80 | static inline u64 HvCallHpt_findValid(HPTE *hpte, u64 vpn) |
95 | { | 81 | { |
96 | u64 retIndex = HvCall3Ret16( HvCallHptFindValid, hpte, vpn, 0, 0 ); | 82 | return HvCall3Ret16(HvCallHptFindValid, hpte, vpn, 0, 0); |
97 | // getPaca()->adjustHmtForNoOfSpinLocksHeld(); | ||
98 | return retIndex; | ||
99 | } | 83 | } |
100 | //============================================================================= | 84 | |
101 | static inline u64 HvCallHpt_findNextValid( HPTE *hpte, u32 hpteIndex, u8 bitson, u8 bitsoff ) | 85 | static inline u64 HvCallHpt_findNextValid(HPTE *hpte, u32 hpteIndex, |
86 | u8 bitson, u8 bitsoff) | ||
102 | { | 87 | { |
103 | u64 retIndex = HvCall3Ret16( HvCallHptFindNextValid, hpte, hpteIndex, bitson, bitsoff ); | 88 | return HvCall3Ret16(HvCallHptFindNextValid, hpte, hpteIndex, |
104 | // getPaca()->adjustHmtForNoOfSpinLocksHeld(); | 89 | bitson, bitsoff); |
105 | return retIndex; | ||
106 | } | 90 | } |
107 | //============================================================================= | 91 | |
108 | static inline void HvCallHpt_get( HPTE *hpte, u32 hpteIndex ) | 92 | static inline void HvCallHpt_get(HPTE *hpte, u32 hpteIndex) |
109 | { | 93 | { |
110 | HvCall2Ret16( HvCallHptGet, hpte, hpteIndex, 0 ); | 94 | HvCall2Ret16(HvCallHptGet, hpte, hpteIndex, 0); |
111 | // getPaca()->adjustHmtForNoOfSpinLocksHeld(); | ||
112 | } | 95 | } |
113 | //============================================================================ | 96 | |
114 | static inline void HvCallHpt_addValidate( u32 hpteIndex, | 97 | static inline void HvCallHpt_addValidate(u32 hpteIndex, u32 hBit, HPTE *hpte) |
115 | u32 hBit, | ||
116 | HPTE *hpte ) | ||
117 | |||
118 | { | 98 | { |
119 | HvCall4( HvCallHptAddValidate, hpteIndex, | 99 | HvCall4(HvCallHptAddValidate, hpteIndex, hBit, (*((u64 *)hpte)), |
120 | hBit, (*((u64 *)hpte)), (*(((u64 *)hpte)+1)) ); | 100 | (*(((u64 *)hpte)+1))); |
121 | // getPaca()->adjustHmtForNoOfSpinLocksHeld(); | ||
122 | } | 101 | } |
123 | 102 | ||
124 | |||
125 | //============================================================================= | ||
126 | |||
127 | #endif /* _HVCALLHPT_H */ | 103 | #endif /* _HVCALLHPT_H */ |
diff --git a/include/asm-ppc64/iSeries/HvCallPci.h b/include/asm-ppc64/iSeries/HvCallPci.h index 6887b619288e..c8d675c40f5e 100644 --- a/include/asm-ppc64/iSeries/HvCallPci.h +++ b/include/asm-ppc64/iSeries/HvCallPci.h | |||
@@ -1,26 +1,26 @@ | |||
1 | /************************************************************************/ | 1 | /* |
2 | /* Provides the Hypervisor PCI calls for iSeries Linux Parition. */ | 2 | * Provides the Hypervisor PCI calls for iSeries Linux Parition. |
3 | /* Copyright (C) 2001 <Wayne G Holm> <IBM Corporation> */ | 3 | * Copyright (C) 2001 <Wayne G Holm> <IBM Corporation> |
4 | /* */ | 4 | * |
5 | /* This program is free software; you can redistribute it and/or modify */ | 5 | * This program is free software; you can redistribute it and/or modify |
6 | /* it under the terms of the GNU General Public License as published by */ | 6 | * it under the terms of the GNU General Public License as published by |
7 | /* the Free Software Foundation; either version 2 of the License, or */ | 7 | * the Free Software Foundation; either version 2 of the License, or |
8 | /* (at your option) any later version. */ | 8 | * (at your option) any later version. |
9 | /* */ | 9 | * |
10 | /* This program is distributed in the hope that it will be useful, */ | 10 | * This program is distributed in the hope that it will be useful, |
11 | /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ | 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ | 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
13 | /* GNU General Public License for more details. */ | 13 | * GNU General Public License for more details. |
14 | /* */ | 14 | * |
15 | /* You should have received a copy of the GNU General Public License */ | 15 | * You should have received a copy of the GNU General Public License |
16 | /* along with this program; if not, write to the: */ | 16 | * along with this program; if not, write to the: |
17 | /* Free Software Foundation, Inc., */ | 17 | * Free Software Foundation, Inc., |
18 | /* 59 Temple Place, Suite 330, */ | 18 | * 59 Temple Place, Suite 330, |
19 | /* Boston, MA 02111-1307 USA */ | 19 | * Boston, MA 02111-1307 USA |
20 | /************************************************************************/ | 20 | * |
21 | /* Change Activity: */ | 21 | * Change Activity: |
22 | /* Created, Jan 9, 2001 */ | 22 | * Created, Jan 9, 2001 |
23 | /************************************************************************/ | 23 | */ |
24 | 24 | ||
25 | #ifndef _HVCALLPCI_H | 25 | #ifndef _HVCALLPCI_H |
26 | #define _HVCALLPCI_H | 26 | #define _HVCALLPCI_H |
@@ -34,8 +34,8 @@ | |||
34 | */ | 34 | */ |
35 | struct HvCallPci_DsaAddr { | 35 | struct HvCallPci_DsaAddr { |
36 | u16 busNumber; /* PHB index? */ | 36 | u16 busNumber; /* PHB index? */ |
37 | u8 subBusNumber; /* PCI bus number? */ | 37 | u8 subBusNumber; /* PCI bus number? */ |
38 | u8 deviceId; /* device and function? */ | 38 | u8 deviceId; /* device and function? */ |
39 | u8 barNumber; | 39 | u8 barNumber; |
40 | u8 reserved[3]; | 40 | u8 reserved[3]; |
41 | }; | 41 | }; |
@@ -52,34 +52,37 @@ struct HvCallPci_LoadReturn { | |||
52 | 52 | ||
53 | enum HvCallPci_DeviceType { | 53 | enum HvCallPci_DeviceType { |
54 | HvCallPci_NodeDevice = 1, | 54 | HvCallPci_NodeDevice = 1, |
55 | HvCallPci_SpDevice = 2, | 55 | HvCallPci_SpDevice = 2, |
56 | HvCallPci_IopDevice = 3, | 56 | HvCallPci_IopDevice = 3, |
57 | HvCallPci_BridgeDevice = 4, | 57 | HvCallPci_BridgeDevice = 4, |
58 | HvCallPci_MultiFunctionDevice = 5, | 58 | HvCallPci_MultiFunctionDevice = 5, |
59 | HvCallPci_IoaDevice = 6 | 59 | HvCallPci_IoaDevice = 6 |
60 | }; | 60 | }; |
61 | 61 | ||
62 | 62 | ||
63 | struct HvCallPci_DeviceInfo { | 63 | struct HvCallPci_DeviceInfo { |
64 | u32 deviceType; // See DeviceType enum for values | 64 | u32 deviceType; /* See DeviceType enum for values */ |
65 | }; | 65 | }; |
66 | 66 | ||
67 | struct HvCallPci_BusUnitInfo { | 67 | struct HvCallPci_BusUnitInfo { |
68 | u32 sizeReturned; // length of data returned | 68 | u32 sizeReturned; /* length of data returned */ |
69 | u32 deviceType; // see DeviceType enum for values | 69 | u32 deviceType; /* see DeviceType enum for values */ |
70 | }; | 70 | }; |
71 | 71 | ||
72 | struct HvCallPci_BridgeInfo { | 72 | struct HvCallPci_BridgeInfo { |
73 | struct HvCallPci_BusUnitInfo busUnitInfo; // Generic bus unit info | 73 | struct HvCallPci_BusUnitInfo busUnitInfo; /* Generic bus unit info */ |
74 | u8 subBusNumber; // Bus number of secondary bus | 74 | u8 subBusNumber; /* Bus number of secondary bus */ |
75 | u8 maxAgents; // Max idsels on secondary bus | 75 | u8 maxAgents; /* Max idsels on secondary bus */ |
76 | u8 maxSubBusNumber; // Max Sub Bus | 76 | u8 maxSubBusNumber; /* Max Sub Bus */ |
77 | u8 logicalSlotNumber; // Logical Slot Number for IOA | 77 | u8 logicalSlotNumber; /* Logical Slot Number for IOA */ |
78 | }; | 78 | }; |
79 | |||
80 | 79 | ||
81 | // Maximum BusUnitInfo buffer size. Provided for clients so they can allocate | 80 | |
82 | // a buffer big enough for any type of bus unit. Increase as needed. | 81 | /* |
82 | * Maximum BusUnitInfo buffer size. Provided for clients so | ||
83 | * they can allocate a buffer big enough for any type of bus | ||
84 | * unit. Increase as needed. | ||
85 | */ | ||
83 | enum {HvCallPci_MaxBusUnitInfoSize = 128}; | 86 | enum {HvCallPci_MaxBusUnitInfoSize = 128}; |
84 | 87 | ||
85 | struct HvCallPci_BarParms { | 88 | struct HvCallPci_BarParms { |
@@ -89,12 +92,12 @@ struct HvCallPci_BarParms { | |||
89 | u64 protectStart; | 92 | u64 protectStart; |
90 | u64 protectEnd; | 93 | u64 protectEnd; |
91 | u64 relocationOffset; | 94 | u64 relocationOffset; |
92 | u64 pciAddress; | 95 | u64 pciAddress; |
93 | u64 reserved[3]; | 96 | u64 reserved[3]; |
94 | }; | 97 | }; |
95 | 98 | ||
96 | enum HvCallPci_VpdType { | 99 | enum HvCallPci_VpdType { |
97 | HvCallPci_BusVpd = 1, | 100 | HvCallPci_BusVpd = 1, |
98 | HvCallPci_BusAdapterVpd = 2 | 101 | HvCallPci_BusAdapterVpd = 2 |
99 | }; | 102 | }; |
100 | 103 | ||
@@ -123,15 +126,13 @@ enum HvCallPci_VpdType { | |||
123 | #define HvCallPciUnmaskInterrupts HvCallPci + 49 | 126 | #define HvCallPciUnmaskInterrupts HvCallPci + 49 |
124 | #define HvCallPciGetBusUnitInfo HvCallPci + 50 | 127 | #define HvCallPciGetBusUnitInfo HvCallPci + 50 |
125 | 128 | ||
126 | //============================================================================ | ||
127 | static inline u64 HvCallPci_configLoad8(u16 busNumber, u8 subBusNumber, | 129 | static inline u64 HvCallPci_configLoad8(u16 busNumber, u8 subBusNumber, |
128 | u8 deviceId, u32 offset, | 130 | u8 deviceId, u32 offset, u8 *value) |
129 | u8 *value) | ||
130 | { | 131 | { |
131 | struct HvCallPci_DsaAddr dsa; | 132 | struct HvCallPci_DsaAddr dsa; |
132 | struct HvCallPci_LoadReturn retVal; | 133 | struct HvCallPci_LoadReturn retVal; |
133 | 134 | ||
134 | *((u64*)&dsa) = 0; | 135 | *((u64*)&dsa) = 0; |
135 | 136 | ||
136 | dsa.busNumber = busNumber; | 137 | dsa.busNumber = busNumber; |
137 | dsa.subBusNumber = subBusNumber; | 138 | dsa.subBusNumber = subBusNumber; |
@@ -139,21 +140,18 @@ static inline u64 HvCallPci_configLoad8(u16 busNumber, u8 subBusNumber, | |||
139 | 140 | ||
140 | HvCall3Ret16(HvCallPciConfigLoad8, &retVal, *(u64 *)&dsa, offset, 0); | 141 | HvCall3Ret16(HvCallPciConfigLoad8, &retVal, *(u64 *)&dsa, offset, 0); |
141 | 142 | ||
142 | // getPaca()->adjustHmtForNoOfSpinLocksHeld(); | ||
143 | |||
144 | *value = retVal.value; | 143 | *value = retVal.value; |
145 | 144 | ||
146 | return retVal.rc; | 145 | return retVal.rc; |
147 | } | 146 | } |
148 | //============================================================================ | 147 | |
149 | static inline u64 HvCallPci_configLoad16(u16 busNumber, u8 subBusNumber, | 148 | static inline u64 HvCallPci_configLoad16(u16 busNumber, u8 subBusNumber, |
150 | u8 deviceId, u32 offset, | 149 | u8 deviceId, u32 offset, u16 *value) |
151 | u16 *value) | ||
152 | { | 150 | { |
153 | struct HvCallPci_DsaAddr dsa; | 151 | struct HvCallPci_DsaAddr dsa; |
154 | struct HvCallPci_LoadReturn retVal; | 152 | struct HvCallPci_LoadReturn retVal; |
155 | 153 | ||
156 | *((u64*)&dsa) = 0; | 154 | *((u64*)&dsa) = 0; |
157 | 155 | ||
158 | dsa.busNumber = busNumber; | 156 | dsa.busNumber = busNumber; |
159 | dsa.subBusNumber = subBusNumber; | 157 | dsa.subBusNumber = subBusNumber; |
@@ -161,21 +159,18 @@ static inline u64 HvCallPci_configLoad16(u16 busNumber, u8 subBusNumber, | |||
161 | 159 | ||
162 | HvCall3Ret16(HvCallPciConfigLoad16, &retVal, *(u64 *)&dsa, offset, 0); | 160 | HvCall3Ret16(HvCallPciConfigLoad16, &retVal, *(u64 *)&dsa, offset, 0); |
163 | 161 | ||
164 | // getPaca()->adjustHmtForNoOfSpinLocksHeld(); | ||
165 | |||
166 | *value = retVal.value; | 162 | *value = retVal.value; |
167 | 163 | ||
168 | return retVal.rc; | 164 | return retVal.rc; |
169 | } | 165 | } |
170 | //============================================================================ | 166 | |
171 | static inline u64 HvCallPci_configLoad32(u16 busNumber, u8 subBusNumber, | 167 | static inline u64 HvCallPci_configLoad32(u16 busNumber, u8 subBusNumber, |
172 | u8 deviceId, u32 offset, | 168 | u8 deviceId, u32 offset, u32 *value) |
173 | u32 *value) | ||
174 | { | 169 | { |
175 | struct HvCallPci_DsaAddr dsa; | 170 | struct HvCallPci_DsaAddr dsa; |
176 | struct HvCallPci_LoadReturn retVal; | 171 | struct HvCallPci_LoadReturn retVal; |
177 | 172 | ||
178 | *((u64*)&dsa) = 0; | 173 | *((u64*)&dsa) = 0; |
179 | 174 | ||
180 | dsa.busNumber = busNumber; | 175 | dsa.busNumber = busNumber; |
181 | dsa.subBusNumber = subBusNumber; | 176 | dsa.subBusNumber = subBusNumber; |
@@ -183,84 +178,61 @@ static inline u64 HvCallPci_configLoad32(u16 busNumber, u8 subBusNumber, | |||
183 | 178 | ||
184 | HvCall3Ret16(HvCallPciConfigLoad32, &retVal, *(u64 *)&dsa, offset, 0); | 179 | HvCall3Ret16(HvCallPciConfigLoad32, &retVal, *(u64 *)&dsa, offset, 0); |
185 | 180 | ||
186 | // getPaca()->adjustHmtForNoOfSpinLocksHeld(); | ||
187 | |||
188 | *value = retVal.value; | 181 | *value = retVal.value; |
189 | 182 | ||
190 | return retVal.rc; | 183 | return retVal.rc; |
191 | } | 184 | } |
192 | //============================================================================ | 185 | |
193 | static inline u64 HvCallPci_configStore8(u16 busNumber, u8 subBusNumber, | 186 | static inline u64 HvCallPci_configStore8(u16 busNumber, u8 subBusNumber, |
194 | u8 deviceId, u32 offset, | 187 | u8 deviceId, u32 offset, u8 value) |
195 | u8 value) | ||
196 | { | 188 | { |
197 | struct HvCallPci_DsaAddr dsa; | 189 | struct HvCallPci_DsaAddr dsa; |
198 | u64 retVal; | ||
199 | 190 | ||
200 | *((u64*)&dsa) = 0; | 191 | *((u64*)&dsa) = 0; |
201 | 192 | ||
202 | dsa.busNumber = busNumber; | 193 | dsa.busNumber = busNumber; |
203 | dsa.subBusNumber = subBusNumber; | 194 | dsa.subBusNumber = subBusNumber; |
204 | dsa.deviceId = deviceId; | 195 | dsa.deviceId = deviceId; |
205 | 196 | ||
206 | retVal = HvCall4(HvCallPciConfigStore8, *(u64 *)&dsa, offset, value, 0); | 197 | return HvCall4(HvCallPciConfigStore8, *(u64 *)&dsa, offset, value, 0); |
207 | |||
208 | // getPaca()->adjustHmtForNoOfSpinLocksHeld(); | ||
209 | |||
210 | return retVal; | ||
211 | } | 198 | } |
212 | //============================================================================ | 199 | |
213 | static inline u64 HvCallPci_configStore16(u16 busNumber, u8 subBusNumber, | 200 | static inline u64 HvCallPci_configStore16(u16 busNumber, u8 subBusNumber, |
214 | u8 deviceId, u32 offset, | 201 | u8 deviceId, u32 offset, u16 value) |
215 | u16 value) | ||
216 | { | 202 | { |
217 | struct HvCallPci_DsaAddr dsa; | 203 | struct HvCallPci_DsaAddr dsa; |
218 | u64 retVal; | ||
219 | 204 | ||
220 | *((u64*)&dsa) = 0; | 205 | *((u64*)&dsa) = 0; |
221 | 206 | ||
222 | dsa.busNumber = busNumber; | 207 | dsa.busNumber = busNumber; |
223 | dsa.subBusNumber = subBusNumber; | 208 | dsa.subBusNumber = subBusNumber; |
224 | dsa.deviceId = deviceId; | 209 | dsa.deviceId = deviceId; |
225 | 210 | ||
226 | retVal = HvCall4(HvCallPciConfigStore16, *(u64 *)&dsa, offset, value, 0); | 211 | return HvCall4(HvCallPciConfigStore16, *(u64 *)&dsa, offset, value, 0); |
227 | |||
228 | // getPaca()->adjustHmtForNoOfSpinLocksHeld(); | ||
229 | |||
230 | return retVal; | ||
231 | } | 212 | } |
232 | //============================================================================ | 213 | |
233 | static inline u64 HvCallPci_configStore32(u16 busNumber, u8 subBusNumber, | 214 | static inline u64 HvCallPci_configStore32(u16 busNumber, u8 subBusNumber, |
234 | u8 deviceId, u32 offset, | 215 | u8 deviceId, u32 offset, u32 value) |
235 | u32 value) | ||
236 | { | 216 | { |
237 | struct HvCallPci_DsaAddr dsa; | 217 | struct HvCallPci_DsaAddr dsa; |
238 | u64 retVal; | ||
239 | 218 | ||
240 | *((u64*)&dsa) = 0; | 219 | *((u64*)&dsa) = 0; |
241 | 220 | ||
242 | dsa.busNumber = busNumber; | 221 | dsa.busNumber = busNumber; |
243 | dsa.subBusNumber = subBusNumber; | 222 | dsa.subBusNumber = subBusNumber; |
244 | dsa.deviceId = deviceId; | 223 | dsa.deviceId = deviceId; |
245 | 224 | ||
246 | retVal = HvCall4(HvCallPciConfigStore32, *(u64 *)&dsa, offset, value, 0); | 225 | return HvCall4(HvCallPciConfigStore32, *(u64 *)&dsa, offset, value, 0); |
247 | |||
248 | // getPaca()->adjustHmtForNoOfSpinLocksHeld(); | ||
249 | |||
250 | return retVal; | ||
251 | } | 226 | } |
252 | //============================================================================ | 227 | |
253 | static inline u64 HvCallPci_barLoad8(u16 busNumberParm, | 228 | static inline u64 HvCallPci_barLoad8(u16 busNumberParm, u8 subBusParm, |
254 | u8 subBusParm, | 229 | u8 deviceIdParm, u8 barNumberParm, u64 offsetParm, |
255 | u8 deviceIdParm, | 230 | u8 *valueParm) |
256 | u8 barNumberParm, | ||
257 | u64 offsetParm, | ||
258 | u8* valueParm) | ||
259 | { | 231 | { |
260 | struct HvCallPci_DsaAddr dsa; | 232 | struct HvCallPci_DsaAddr dsa; |
261 | struct HvCallPci_LoadReturn retVal; | 233 | struct HvCallPci_LoadReturn retVal; |
262 | 234 | ||
263 | *((u64*)&dsa) = 0; | 235 | *((u64*)&dsa) = 0; |
264 | 236 | ||
265 | dsa.busNumber = busNumberParm; | 237 | dsa.busNumber = busNumberParm; |
266 | dsa.subBusNumber = subBusParm; | 238 | dsa.subBusNumber = subBusParm; |
@@ -269,24 +241,19 @@ static inline u64 HvCallPci_barLoad8(u16 busNumberParm, | |||
269 | 241 | ||
270 | HvCall3Ret16(HvCallPciBarLoad8, &retVal, *(u64 *)&dsa, offsetParm, 0); | 242 | HvCall3Ret16(HvCallPciBarLoad8, &retVal, *(u64 *)&dsa, offsetParm, 0); |
271 | 243 | ||
272 | // getPaca()->adjustHmtForNoOfSpinLocksHeld(); | ||
273 | |||
274 | *valueParm = retVal.value; | 244 | *valueParm = retVal.value; |
275 | 245 | ||
276 | return retVal.rc; | 246 | return retVal.rc; |
277 | } | 247 | } |
278 | //============================================================================ | 248 | |
279 | static inline u64 HvCallPci_barLoad16(u16 busNumberParm, | 249 | static inline u64 HvCallPci_barLoad16(u16 busNumberParm, u8 subBusParm, |
280 | u8 subBusParm, | 250 | u8 deviceIdParm, u8 barNumberParm, u64 offsetParm, |
281 | u8 deviceIdParm, | 251 | u16 *valueParm) |
282 | u8 barNumberParm, | ||
283 | u64 offsetParm, | ||
284 | u16* valueParm) | ||
285 | { | 252 | { |
286 | struct HvCallPci_DsaAddr dsa; | 253 | struct HvCallPci_DsaAddr dsa; |
287 | struct HvCallPci_LoadReturn retVal; | 254 | struct HvCallPci_LoadReturn retVal; |
288 | 255 | ||
289 | *((u64*)&dsa) = 0; | 256 | *((u64*)&dsa) = 0; |
290 | 257 | ||
291 | dsa.busNumber = busNumberParm; | 258 | dsa.busNumber = busNumberParm; |
292 | dsa.subBusNumber = subBusParm; | 259 | dsa.subBusNumber = subBusParm; |
@@ -295,24 +262,19 @@ static inline u64 HvCallPci_barLoad16(u16 busNumberParm, | |||
295 | 262 | ||
296 | HvCall3Ret16(HvCallPciBarLoad16, &retVal, *(u64 *)&dsa, offsetParm, 0); | 263 | HvCall3Ret16(HvCallPciBarLoad16, &retVal, *(u64 *)&dsa, offsetParm, 0); |
297 | 264 | ||
298 | // getPaca()->adjustHmtForNoOfSpinLocksHeld(); | ||
299 | |||
300 | *valueParm = retVal.value; | 265 | *valueParm = retVal.value; |
301 | 266 | ||
302 | return retVal.rc; | 267 | return retVal.rc; |
303 | } | 268 | } |
304 | //============================================================================ | 269 | |
305 | static inline u64 HvCallPci_barLoad32(u16 busNumberParm, | 270 | static inline u64 HvCallPci_barLoad32(u16 busNumberParm, u8 subBusParm, |
306 | u8 subBusParm, | 271 | u8 deviceIdParm, u8 barNumberParm, u64 offsetParm, |
307 | u8 deviceIdParm, | 272 | u32 *valueParm) |
308 | u8 barNumberParm, | ||
309 | u64 offsetParm, | ||
310 | u32* valueParm) | ||
311 | { | 273 | { |
312 | struct HvCallPci_DsaAddr dsa; | 274 | struct HvCallPci_DsaAddr dsa; |
313 | struct HvCallPci_LoadReturn retVal; | 275 | struct HvCallPci_LoadReturn retVal; |
314 | 276 | ||
315 | *((u64*)&dsa) = 0; | 277 | *((u64*)&dsa) = 0; |
316 | 278 | ||
317 | dsa.busNumber = busNumberParm; | 279 | dsa.busNumber = busNumberParm; |
318 | dsa.subBusNumber = subBusParm; | 280 | dsa.subBusNumber = subBusParm; |
@@ -321,24 +283,19 @@ static inline u64 HvCallPci_barLoad32(u16 busNumberParm, | |||
321 | 283 | ||
322 | HvCall3Ret16(HvCallPciBarLoad32, &retVal, *(u64 *)&dsa, offsetParm, 0); | 284 | HvCall3Ret16(HvCallPciBarLoad32, &retVal, *(u64 *)&dsa, offsetParm, 0); |
323 | 285 | ||
324 | // getPaca()->adjustHmtForNoOfSpinLocksHeld(); | ||
325 | |||
326 | *valueParm = retVal.value; | 286 | *valueParm = retVal.value; |
327 | 287 | ||
328 | return retVal.rc; | 288 | return retVal.rc; |
329 | } | 289 | } |
330 | //============================================================================ | 290 | |
331 | static inline u64 HvCallPci_barLoad64(u16 busNumberParm, | 291 | static inline u64 HvCallPci_barLoad64(u16 busNumberParm, u8 subBusParm, |
332 | u8 subBusParm, | 292 | u8 deviceIdParm, u8 barNumberParm, u64 offsetParm, |
333 | u8 deviceIdParm, | 293 | u64 *valueParm) |
334 | u8 barNumberParm, | ||
335 | u64 offsetParm, | ||
336 | u64* valueParm) | ||
337 | { | 294 | { |
338 | struct HvCallPci_DsaAddr dsa; | 295 | struct HvCallPci_DsaAddr dsa; |
339 | struct HvCallPci_LoadReturn retVal; | 296 | struct HvCallPci_LoadReturn retVal; |
340 | 297 | ||
341 | *((u64*)&dsa) = 0; | 298 | *((u64*)&dsa) = 0; |
342 | 299 | ||
343 | dsa.busNumber = busNumberParm; | 300 | dsa.busNumber = busNumberParm; |
344 | dsa.subBusNumber = subBusParm; | 301 | dsa.subBusNumber = subBusParm; |
@@ -347,112 +304,81 @@ static inline u64 HvCallPci_barLoad64(u16 busNumberParm, | |||
347 | 304 | ||
348 | HvCall3Ret16(HvCallPciBarLoad64, &retVal, *(u64 *)&dsa, offsetParm, 0); | 305 | HvCall3Ret16(HvCallPciBarLoad64, &retVal, *(u64 *)&dsa, offsetParm, 0); |
349 | 306 | ||
350 | // getPaca()->adjustHmtForNoOfSpinLocksHeld(); | ||
351 | |||
352 | *valueParm = retVal.value; | 307 | *valueParm = retVal.value; |
353 | 308 | ||
354 | return retVal.rc; | 309 | return retVal.rc; |
355 | } | 310 | } |
356 | //============================================================================ | 311 | |
357 | static inline u64 HvCallPci_barStore8(u16 busNumberParm, | 312 | static inline u64 HvCallPci_barStore8(u16 busNumberParm, u8 subBusParm, |
358 | u8 subBusParm, | 313 | u8 deviceIdParm, u8 barNumberParm, u64 offsetParm, |
359 | u8 deviceIdParm, | 314 | u8 valueParm) |
360 | u8 barNumberParm, | ||
361 | u64 offsetParm, | ||
362 | u8 valueParm) | ||
363 | { | 315 | { |
364 | struct HvCallPci_DsaAddr dsa; | 316 | struct HvCallPci_DsaAddr dsa; |
365 | u64 retVal; | ||
366 | 317 | ||
367 | *((u64*)&dsa) = 0; | 318 | *((u64*)&dsa) = 0; |
368 | 319 | ||
369 | dsa.busNumber = busNumberParm; | 320 | dsa.busNumber = busNumberParm; |
370 | dsa.subBusNumber = subBusParm; | 321 | dsa.subBusNumber = subBusParm; |
371 | dsa.deviceId = deviceIdParm; | 322 | dsa.deviceId = deviceIdParm; |
372 | dsa.barNumber = barNumberParm; | 323 | dsa.barNumber = barNumberParm; |
373 | 324 | ||
374 | retVal = HvCall4(HvCallPciBarStore8, *(u64 *)&dsa, offsetParm, valueParm, 0); | 325 | return HvCall4(HvCallPciBarStore8, *(u64 *)&dsa, offsetParm, |
375 | 326 | valueParm, 0); | |
376 | // getPaca()->adjustHmtForNoOfSpinLocksHeld(); | ||
377 | |||
378 | return retVal; | ||
379 | } | 327 | } |
380 | //============================================================================ | 328 | |
381 | static inline u64 HvCallPci_barStore16(u16 busNumberParm, | 329 | static inline u64 HvCallPci_barStore16(u16 busNumberParm, u8 subBusParm, |
382 | u8 subBusParm, | 330 | u8 deviceIdParm, u8 barNumberParm, u64 offsetParm, |
383 | u8 deviceIdParm, | 331 | u16 valueParm) |
384 | u8 barNumberParm, | ||
385 | u64 offsetParm, | ||
386 | u16 valueParm) | ||
387 | { | 332 | { |
388 | struct HvCallPci_DsaAddr dsa; | 333 | struct HvCallPci_DsaAddr dsa; |
389 | u64 retVal; | ||
390 | 334 | ||
391 | *((u64*)&dsa) = 0; | 335 | *((u64*)&dsa) = 0; |
392 | 336 | ||
393 | dsa.busNumber = busNumberParm; | 337 | dsa.busNumber = busNumberParm; |
394 | dsa.subBusNumber = subBusParm; | 338 | dsa.subBusNumber = subBusParm; |
395 | dsa.deviceId = deviceIdParm; | 339 | dsa.deviceId = deviceIdParm; |
396 | dsa.barNumber = barNumberParm; | 340 | dsa.barNumber = barNumberParm; |
397 | 341 | ||
398 | retVal = HvCall4(HvCallPciBarStore16, *(u64 *)&dsa, offsetParm, valueParm, 0); | 342 | return HvCall4(HvCallPciBarStore16, *(u64 *)&dsa, offsetParm, |
399 | 343 | valueParm, 0); | |
400 | // getPaca()->adjustHmtForNoOfSpinLocksHeld(); | ||
401 | |||
402 | return retVal; | ||
403 | } | 344 | } |
404 | //============================================================================ | 345 | |
405 | static inline u64 HvCallPci_barStore32(u16 busNumberParm, | 346 | static inline u64 HvCallPci_barStore32(u16 busNumberParm, u8 subBusParm, |
406 | u8 subBusParm, | 347 | u8 deviceIdParm, u8 barNumberParm, u64 offsetParm, |
407 | u8 deviceIdParm, | 348 | u32 valueParm) |
408 | u8 barNumberParm, | ||
409 | u64 offsetParm, | ||
410 | u32 valueParm) | ||
411 | { | 349 | { |
412 | struct HvCallPci_DsaAddr dsa; | 350 | struct HvCallPci_DsaAddr dsa; |
413 | u64 retVal; | ||
414 | 351 | ||
415 | *((u64*)&dsa) = 0; | 352 | *((u64*)&dsa) = 0; |
416 | 353 | ||
417 | dsa.busNumber = busNumberParm; | 354 | dsa.busNumber = busNumberParm; |
418 | dsa.subBusNumber = subBusParm; | 355 | dsa.subBusNumber = subBusParm; |
419 | dsa.deviceId = deviceIdParm; | 356 | dsa.deviceId = deviceIdParm; |
420 | dsa.barNumber = barNumberParm; | 357 | dsa.barNumber = barNumberParm; |
421 | 358 | ||
422 | retVal = HvCall4(HvCallPciBarStore32, *(u64 *)&dsa, offsetParm, valueParm, 0); | 359 | return HvCall4(HvCallPciBarStore32, *(u64 *)&dsa, offsetParm, |
423 | 360 | valueParm, 0); | |
424 | // getPaca()->adjustHmtForNoOfSpinLocksHeld(); | ||
425 | |||
426 | return retVal; | ||
427 | } | 361 | } |
428 | //============================================================================ | 362 | |
429 | static inline u64 HvCallPci_barStore64(u16 busNumberParm, | 363 | static inline u64 HvCallPci_barStore64(u16 busNumberParm, u8 subBusParm, |
430 | u8 subBusParm, | 364 | u8 deviceIdParm, u8 barNumberParm, u64 offsetParm, |
431 | u8 deviceIdParm, | 365 | u64 valueParm) |
432 | u8 barNumberParm, | ||
433 | u64 offsetParm, | ||
434 | u64 valueParm) | ||
435 | { | 366 | { |
436 | struct HvCallPci_DsaAddr dsa; | 367 | struct HvCallPci_DsaAddr dsa; |
437 | u64 retVal; | ||
438 | 368 | ||
439 | *((u64*)&dsa) = 0; | 369 | *((u64*)&dsa) = 0; |
440 | 370 | ||
441 | dsa.busNumber = busNumberParm; | 371 | dsa.busNumber = busNumberParm; |
442 | dsa.subBusNumber = subBusParm; | 372 | dsa.subBusNumber = subBusParm; |
443 | dsa.deviceId = deviceIdParm; | 373 | dsa.deviceId = deviceIdParm; |
444 | dsa.barNumber = barNumberParm; | 374 | dsa.barNumber = barNumberParm; |
445 | 375 | ||
446 | retVal = HvCall4(HvCallPciBarStore64, *(u64 *)&dsa, offsetParm, valueParm, 0); | 376 | return HvCall4(HvCallPciBarStore64, *(u64 *)&dsa, offsetParm, |
447 | 377 | valueParm, 0); | |
448 | // getPaca()->adjustHmtForNoOfSpinLocksHeld(); | ||
449 | |||
450 | return retVal; | ||
451 | } | 378 | } |
452 | //============================================================================ | 379 | |
453 | static inline u64 HvCallPci_eoi(u16 busNumberParm, | 380 | static inline u64 HvCallPci_eoi(u16 busNumberParm, u8 subBusParm, |
454 | u8 subBusParm, | 381 | u8 deviceIdParm) |
455 | u8 deviceIdParm) | ||
456 | { | 382 | { |
457 | struct HvCallPci_DsaAddr dsa; | 383 | struct HvCallPci_DsaAddr dsa; |
458 | struct HvCallPci_LoadReturn retVal; | 384 | struct HvCallPci_LoadReturn retVal; |
@@ -465,20 +391,13 @@ static inline u64 HvCallPci_eoi(u16 busNumberParm, | |||
465 | 391 | ||
466 | HvCall1Ret16(HvCallPciEoi, &retVal, *(u64*)&dsa); | 392 | HvCall1Ret16(HvCallPciEoi, &retVal, *(u64*)&dsa); |
467 | 393 | ||
468 | // getPaca()->adjustHmtForNoOfSpinLocksHeld(); | ||
469 | |||
470 | return retVal.rc; | 394 | return retVal.rc; |
471 | } | 395 | } |
472 | //============================================================================ | 396 | |
473 | static inline u64 HvCallPci_getBarParms(u16 busNumberParm, | 397 | static inline u64 HvCallPci_getBarParms(u16 busNumberParm, u8 subBusParm, |
474 | u8 subBusParm, | 398 | u8 deviceIdParm, u8 barNumberParm, u64 parms, u32 sizeofParms) |
475 | u8 deviceIdParm, | ||
476 | u8 barNumberParm, | ||
477 | u64 parms, | ||
478 | u32 sizeofParms) | ||
479 | { | 399 | { |
480 | struct HvCallPci_DsaAddr dsa; | 400 | struct HvCallPci_DsaAddr dsa; |
481 | u64 retVal; | ||
482 | 401 | ||
483 | *((u64*)&dsa) = 0; | 402 | *((u64*)&dsa) = 0; |
484 | 403 | ||
@@ -487,62 +406,41 @@ static inline u64 HvCallPci_getBarParms(u16 busNumberParm, | |||
487 | dsa.deviceId = deviceIdParm; | 406 | dsa.deviceId = deviceIdParm; |
488 | dsa.barNumber = barNumberParm; | 407 | dsa.barNumber = barNumberParm; |
489 | 408 | ||
490 | retVal = HvCall3(HvCallPciGetBarParms, *(u64*)&dsa, parms, sizeofParms); | 409 | return HvCall3(HvCallPciGetBarParms, *(u64*)&dsa, parms, sizeofParms); |
491 | |||
492 | // getPaca()->adjustHmtForNoOfSpinLocksHeld(); | ||
493 | |||
494 | return retVal; | ||
495 | } | 410 | } |
496 | //============================================================================ | 411 | |
497 | static inline u64 HvCallPci_maskFisr(u16 busNumberParm, | 412 | static inline u64 HvCallPci_maskFisr(u16 busNumberParm, u8 subBusParm, |
498 | u8 subBusParm, | 413 | u8 deviceIdParm, u64 fisrMask) |
499 | u8 deviceIdParm, | ||
500 | u64 fisrMask) | ||
501 | { | 414 | { |
502 | struct HvCallPci_DsaAddr dsa; | 415 | struct HvCallPci_DsaAddr dsa; |
503 | u64 retVal; | ||
504 | 416 | ||
505 | *((u64*)&dsa) = 0; | 417 | *((u64*)&dsa) = 0; |
506 | 418 | ||
507 | dsa.busNumber = busNumberParm; | 419 | dsa.busNumber = busNumberParm; |
508 | dsa.subBusNumber = subBusParm; | 420 | dsa.subBusNumber = subBusParm; |
509 | dsa.deviceId = deviceIdParm; | 421 | dsa.deviceId = deviceIdParm; |
510 | 422 | ||
511 | retVal = HvCall2(HvCallPciMaskFisr, *(u64*)&dsa, fisrMask); | 423 | return HvCall2(HvCallPciMaskFisr, *(u64*)&dsa, fisrMask); |
512 | |||
513 | // getPaca()->adjustHmtForNoOfSpinLocksHeld(); | ||
514 | |||
515 | return retVal; | ||
516 | } | 424 | } |
517 | //============================================================================ | 425 | |
518 | static inline u64 HvCallPci_unmaskFisr(u16 busNumberParm, | 426 | static inline u64 HvCallPci_unmaskFisr(u16 busNumberParm, u8 subBusParm, |
519 | u8 subBusParm, | 427 | u8 deviceIdParm, u64 fisrMask) |
520 | u8 deviceIdParm, | ||
521 | u64 fisrMask) | ||
522 | { | 428 | { |
523 | struct HvCallPci_DsaAddr dsa; | 429 | struct HvCallPci_DsaAddr dsa; |
524 | u64 retVal; | ||
525 | 430 | ||
526 | *((u64*)&dsa) = 0; | 431 | *((u64*)&dsa) = 0; |
527 | 432 | ||
528 | dsa.busNumber = busNumberParm; | 433 | dsa.busNumber = busNumberParm; |
529 | dsa.subBusNumber = subBusParm; | 434 | dsa.subBusNumber = subBusParm; |
530 | dsa.deviceId = deviceIdParm; | 435 | dsa.deviceId = deviceIdParm; |
531 | 436 | ||
532 | retVal = HvCall2(HvCallPciUnmaskFisr, *(u64*)&dsa, fisrMask); | 437 | return HvCall2(HvCallPciUnmaskFisr, *(u64*)&dsa, fisrMask); |
533 | |||
534 | // getPaca()->adjustHmtForNoOfSpinLocksHeld(); | ||
535 | |||
536 | return retVal; | ||
537 | } | 438 | } |
538 | //============================================================================ | 439 | |
539 | static inline u64 HvCallPci_setSlotReset(u16 busNumberParm, | 440 | static inline u64 HvCallPci_setSlotReset(u16 busNumberParm, u8 subBusParm, |
540 | u8 subBusParm, | 441 | u8 deviceIdParm, u64 onNotOff) |
541 | u8 deviceIdParm, | ||
542 | u64 onNotOff) | ||
543 | { | 442 | { |
544 | struct HvCallPci_DsaAddr dsa; | 443 | struct HvCallPci_DsaAddr dsa; |
545 | u64 retVal; | ||
546 | 444 | ||
547 | *((u64*)&dsa) = 0; | 445 | *((u64*)&dsa) = 0; |
548 | 446 | ||
@@ -550,21 +448,13 @@ static inline u64 HvCallPci_setSlotReset(u16 busNumberParm, | |||
550 | dsa.subBusNumber = subBusParm; | 448 | dsa.subBusNumber = subBusParm; |
551 | dsa.deviceId = deviceIdParm; | 449 | dsa.deviceId = deviceIdParm; |
552 | 450 | ||
553 | retVal = HvCall2(HvCallPciSetSlotReset, *(u64*)&dsa, onNotOff); | 451 | return HvCall2(HvCallPciSetSlotReset, *(u64*)&dsa, onNotOff); |
554 | |||
555 | // getPaca()->adjustHmtForNoOfSpinLocksHeld(); | ||
556 | |||
557 | return retVal; | ||
558 | } | 452 | } |
559 | //============================================================================ | 453 | |
560 | static inline u64 HvCallPci_getDeviceInfo(u16 busNumberParm, | 454 | static inline u64 HvCallPci_getDeviceInfo(u16 busNumberParm, u8 subBusParm, |
561 | u8 subBusParm, | 455 | u8 deviceNumberParm, u64 parms, u32 sizeofParms) |
562 | u8 deviceNumberParm, | ||
563 | u64 parms, | ||
564 | u32 sizeofParms) | ||
565 | { | 456 | { |
566 | struct HvCallPci_DsaAddr dsa; | 457 | struct HvCallPci_DsaAddr dsa; |
567 | u64 retVal; | ||
568 | 458 | ||
569 | *((u64*)&dsa) = 0; | 459 | *((u64*)&dsa) = 0; |
570 | 460 | ||
@@ -572,102 +462,72 @@ static inline u64 HvCallPci_getDeviceInfo(u16 busNumberParm, | |||
572 | dsa.subBusNumber = subBusParm; | 462 | dsa.subBusNumber = subBusParm; |
573 | dsa.deviceId = deviceNumberParm << 4; | 463 | dsa.deviceId = deviceNumberParm << 4; |
574 | 464 | ||
575 | retVal = HvCall3(HvCallPciGetDeviceInfo, *(u64*)&dsa, parms, sizeofParms); | 465 | return HvCall3(HvCallPciGetDeviceInfo, *(u64*)&dsa, parms, sizeofParms); |
576 | |||
577 | // getPaca()->adjustHmtForNoOfSpinLocksHeld(); | ||
578 | |||
579 | return retVal; | ||
580 | } | 466 | } |
581 | //============================================================================ | 467 | |
582 | static inline u64 HvCallPci_maskInterrupts(u16 busNumberParm, | 468 | static inline u64 HvCallPci_maskInterrupts(u16 busNumberParm, u8 subBusParm, |
583 | u8 subBusParm, | 469 | u8 deviceIdParm, u64 interruptMask) |
584 | u8 deviceIdParm, | ||
585 | u64 interruptMask) | ||
586 | { | 470 | { |
587 | struct HvCallPci_DsaAddr dsa; | 471 | struct HvCallPci_DsaAddr dsa; |
588 | u64 retVal; | ||
589 | 472 | ||
590 | *((u64*)&dsa) = 0; | 473 | *((u64*)&dsa) = 0; |
591 | 474 | ||
592 | dsa.busNumber = busNumberParm; | 475 | dsa.busNumber = busNumberParm; |
593 | dsa.subBusNumber = subBusParm; | 476 | dsa.subBusNumber = subBusParm; |
594 | dsa.deviceId = deviceIdParm; | 477 | dsa.deviceId = deviceIdParm; |
595 | 478 | ||
596 | retVal = HvCall2(HvCallPciMaskInterrupts, *(u64*)&dsa, interruptMask); | 479 | return HvCall2(HvCallPciMaskInterrupts, *(u64*)&dsa, interruptMask); |
597 | |||
598 | // getPaca()->adjustHmtForNoOfSpinLocksHeld(); | ||
599 | |||
600 | return retVal; | ||
601 | } | 480 | } |
602 | //============================================================================ | 481 | |
603 | static inline u64 HvCallPci_unmaskInterrupts(u16 busNumberParm, | 482 | static inline u64 HvCallPci_unmaskInterrupts(u16 busNumberParm, u8 subBusParm, |
604 | u8 subBusParm, | 483 | u8 deviceIdParm, u64 interruptMask) |
605 | u8 deviceIdParm, | ||
606 | u64 interruptMask) | ||
607 | { | 484 | { |
608 | struct HvCallPci_DsaAddr dsa; | 485 | struct HvCallPci_DsaAddr dsa; |
609 | u64 retVal; | ||
610 | 486 | ||
611 | *((u64*)&dsa) = 0; | 487 | *((u64*)&dsa) = 0; |
612 | 488 | ||
613 | dsa.busNumber = busNumberParm; | 489 | dsa.busNumber = busNumberParm; |
614 | dsa.subBusNumber = subBusParm; | 490 | dsa.subBusNumber = subBusParm; |
615 | dsa.deviceId = deviceIdParm; | 491 | dsa.deviceId = deviceIdParm; |
616 | 492 | ||
617 | retVal = HvCall2(HvCallPciUnmaskInterrupts, *(u64*)&dsa, interruptMask); | 493 | return HvCall2(HvCallPciUnmaskInterrupts, *(u64*)&dsa, interruptMask); |
618 | |||
619 | // getPaca()->adjustHmtForNoOfSpinLocksHeld(); | ||
620 | |||
621 | return retVal; | ||
622 | } | 494 | } |
623 | //============================================================================ | ||
624 | 495 | ||
625 | static inline u64 HvCallPci_getBusUnitInfo(u16 busNumberParm, | 496 | static inline u64 HvCallPci_getBusUnitInfo(u16 busNumberParm, u8 subBusParm, |
626 | u8 subBusParm, | 497 | u8 deviceIdParm, u64 parms, u32 sizeofParms) |
627 | u8 deviceIdParm, | ||
628 | u64 parms, | ||
629 | u32 sizeofParms) | ||
630 | { | 498 | { |
631 | struct HvCallPci_DsaAddr dsa; | 499 | struct HvCallPci_DsaAddr dsa; |
632 | u64 retVal; | ||
633 | 500 | ||
634 | *((u64*)&dsa) = 0; | 501 | *((u64*)&dsa) = 0; |
635 | 502 | ||
636 | dsa.busNumber = busNumberParm; | 503 | dsa.busNumber = busNumberParm; |
637 | dsa.subBusNumber = subBusParm; | 504 | dsa.subBusNumber = subBusParm; |
638 | dsa.deviceId = deviceIdParm; | 505 | dsa.deviceId = deviceIdParm; |
639 | 506 | ||
640 | retVal = HvCall3(HvCallPciGetBusUnitInfo, *(u64*)&dsa, parms, sizeofParms); | 507 | return HvCall3(HvCallPciGetBusUnitInfo, *(u64*)&dsa, parms, |
641 | 508 | sizeofParms); | |
642 | // getPaca()->adjustHmtForNoOfSpinLocksHeld(); | ||
643 | |||
644 | return retVal; | ||
645 | } | 509 | } |
646 | //============================================================================ | ||
647 | 510 | ||
648 | static inline int HvCallPci_getBusVpd(u16 busNumParm, u64 destParm, u16 sizeParm) | 511 | static inline int HvCallPci_getBusVpd(u16 busNumParm, u64 destParm, |
512 | u16 sizeParm) | ||
649 | { | 513 | { |
650 | int xRetSize; | 514 | u64 xRc = HvCall4(HvCallPciGetCardVpd, busNumParm, destParm, |
651 | u64 xRc = HvCall4(HvCallPciGetCardVpd, busNumParm, destParm, sizeParm, HvCallPci_BusVpd); | 515 | sizeParm, HvCallPci_BusVpd); |
652 | // getPaca()->adjustHmtForNoOfSpinLocksHeld(); | ||
653 | if (xRc == -1) | 516 | if (xRc == -1) |
654 | xRetSize = -1; | 517 | return -1; |
655 | else | 518 | else |
656 | xRetSize = xRc & 0xFFFF; | 519 | return xRc & 0xFFFF; |
657 | return xRetSize; | ||
658 | } | 520 | } |
659 | //============================================================================ | ||
660 | 521 | ||
661 | static inline int HvCallPci_getBusAdapterVpd(u16 busNumParm, u64 destParm, u16 sizeParm) | 522 | static inline int HvCallPci_getBusAdapterVpd(u16 busNumParm, u64 destParm, |
523 | u16 sizeParm) | ||
662 | { | 524 | { |
663 | int xRetSize; | 525 | u64 xRc = HvCall4(HvCallPciGetCardVpd, busNumParm, destParm, |
664 | u64 xRc = HvCall4(HvCallPciGetCardVpd, busNumParm, destParm, sizeParm, HvCallPci_BusAdapterVpd); | 526 | sizeParm, HvCallPci_BusAdapterVpd); |
665 | // getPaca()->adjustHmtForNoOfSpinLocksHeld(); | ||
666 | if (xRc == -1) | 527 | if (xRc == -1) |
667 | xRetSize = -1; | 528 | return -1; |
668 | else | 529 | else |
669 | xRetSize = xRc & 0xFFFF; | 530 | return xRc & 0xFFFF; |
670 | return xRetSize; | ||
671 | } | 531 | } |
672 | //============================================================================ | 532 | |
673 | #endif /* _HVCALLPCI_H */ | 533 | #endif /* _HVCALLPCI_H */ |
diff --git a/include/asm-ppc64/iSeries/HvCallSc.h b/include/asm-ppc64/iSeries/HvCallSc.h index eea258447642..a62cef3822f9 100644 --- a/include/asm-ppc64/iSeries/HvCallSc.h +++ b/include/asm-ppc64/iSeries/HvCallSc.h | |||
@@ -1,17 +1,17 @@ | |||
1 | /* | 1 | /* |
2 | * HvCallSc.h | 2 | * HvCallSc.h |
3 | * Copyright (C) 2001 Mike Corrigan IBM Corporation | 3 | * Copyright (C) 2001 Mike Corrigan IBM Corporation |
4 | * | 4 | * |
5 | * This program is free software; you can redistribute it and/or modify | 5 | * This program is free software; you can redistribute it and/or modify |
6 | * it under the terms of the GNU General Public License as published by | 6 | * it under the terms of the GNU General Public License as published by |
7 | * the Free Software Foundation; either version 2 of the License, or | 7 | * the Free Software Foundation; either version 2 of the License, or |
8 | * (at your option) any later version. | 8 | * (at your option) any later version. |
9 | * | 9 | * |
10 | * This program is distributed in the hope that it will be useful, | 10 | * This program is distributed in the hope that it will be useful, |
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
13 | * GNU General Public License for more details. | 13 | * GNU General Public License for more details. |
14 | * | 14 | * |
15 | * You should have received a copy of the GNU General Public License | 15 | * You should have received a copy of the GNU General Public License |
16 | * along with this program; if not, write to the Free Software | 16 | * along with this program; if not, write to the Free Software |
17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | 17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
@@ -19,7 +19,7 @@ | |||
19 | #ifndef _HVCALLSC_H | 19 | #ifndef _HVCALLSC_H |
20 | #define _HVCALLSC_H | 20 | #define _HVCALLSC_H |
21 | 21 | ||
22 | #include <asm/iSeries/HvTypes.h> | 22 | #include <linux/types.h> |
23 | 23 | ||
24 | #define HvCallBase 0x8000000000000000ul | 24 | #define HvCallBase 0x8000000000000000ul |
25 | #define HvCallCc 0x8001000000000000ul | 25 | #define HvCallCc 0x8001000000000000ul |
@@ -30,22 +30,22 @@ | |||
30 | #define HvCallSm 0x8007000000000000ul | 30 | #define HvCallSm 0x8007000000000000ul |
31 | #define HvCallXm 0x8009000000000000ul | 31 | #define HvCallXm 0x8009000000000000ul |
32 | 32 | ||
33 | u64 HvCall0( u64 ); | 33 | extern u64 HvCall0(u64); |
34 | u64 HvCall1( u64, u64 ); | 34 | extern u64 HvCall1(u64, u64); |
35 | u64 HvCall2( u64, u64, u64 ); | 35 | extern u64 HvCall2(u64, u64, u64); |
36 | u64 HvCall3( u64, u64, u64, u64 ); | 36 | extern u64 HvCall3(u64, u64, u64, u64); |
37 | u64 HvCall4( u64, u64, u64, u64, u64 ); | 37 | extern u64 HvCall4(u64, u64, u64, u64, u64); |
38 | u64 HvCall5( u64, u64, u64, u64, u64, u64 ); | 38 | extern u64 HvCall5(u64, u64, u64, u64, u64, u64); |
39 | u64 HvCall6( u64, u64, u64, u64, u64, u64, u64 ); | 39 | extern u64 HvCall6(u64, u64, u64, u64, u64, u64, u64); |
40 | u64 HvCall7( u64, u64, u64, u64, u64, u64, u64, u64 ); | 40 | extern u64 HvCall7(u64, u64, u64, u64, u64, u64, u64, u64); |
41 | 41 | ||
42 | u64 HvCall0Ret16( u64, void * ); | 42 | extern u64 HvCall0Ret16(u64, void *); |
43 | u64 HvCall1Ret16( u64, void *, u64 ); | 43 | extern u64 HvCall1Ret16(u64, void *, u64); |
44 | u64 HvCall2Ret16( u64, void *, u64, u64 ); | 44 | extern u64 HvCall2Ret16(u64, void *, u64, u64); |
45 | u64 HvCall3Ret16( u64, void *, u64, u64, u64 ); | 45 | extern u64 HvCall3Ret16(u64, void *, u64, u64, u64); |
46 | u64 HvCall4Ret16( u64, void *, u64, u64, u64, u64 ); | 46 | extern u64 HvCall4Ret16(u64, void *, u64, u64, u64, u64); |
47 | u64 HvCall5Ret16( u64, void *, u64, u64, u64, u64, u64 ); | 47 | extern u64 HvCall5Ret16(u64, void *, u64, u64, u64, u64, u64); |
48 | u64 HvCall6Ret16( u64, void *, u64, u64, u64, u64, u64, u64 ); | 48 | extern u64 HvCall6Ret16(u64, void *, u64, u64, u64, u64, u64, u64); |
49 | u64 HvCall7Ret16( u64, void *, u64, u64 ,u64 ,u64 ,u64 ,u64 ,u64 ); | 49 | extern u64 HvCall7Ret16(u64, void *, u64, u64 ,u64 ,u64 ,u64 ,u64 ,u64); |
50 | 50 | ||
51 | #endif /* _HVCALLSC_H */ | 51 | #endif /* _HVCALLSC_H */ |
diff --git a/include/asm-ppc64/iSeries/HvCallSm.h b/include/asm-ppc64/iSeries/HvCallSm.h index 9050c94a529d..8a3dbb071a43 100644 --- a/include/asm-ppc64/iSeries/HvCallSm.h +++ b/include/asm-ppc64/iSeries/HvCallSm.h | |||
@@ -1,17 +1,17 @@ | |||
1 | /* | 1 | /* |
2 | * HvCallSm.h | 2 | * HvCallSm.h |
3 | * Copyright (C) 2001 Mike Corrigan IBM Corporation | 3 | * Copyright (C) 2001 Mike Corrigan IBM Corporation |
4 | * | 4 | * |
5 | * This program is free software; you can redistribute it and/or modify | 5 | * This program is free software; you can redistribute it and/or modify |
6 | * it under the terms of the GNU General Public License as published by | 6 | * it under the terms of the GNU General Public License as published by |
7 | * the Free Software Foundation; either version 2 of the License, or | 7 | * the Free Software Foundation; either version 2 of the License, or |
8 | * (at your option) any later version. | 8 | * (at your option) any later version. |
9 | * | 9 | * |
10 | * This program is distributed in the hope that it will be useful, | 10 | * This program is distributed in the hope that it will be useful, |
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
13 | * GNU General Public License for more details. | 13 | * GNU General Public License for more details. |
14 | * | 14 | * |
15 | * You should have received a copy of the GNU General Public License | 15 | * You should have received a copy of the GNU General Public License |
16 | * along with this program; if not, write to the Free Software | 16 | * along with this program; if not, write to the Free Software |
17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | 17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
@@ -19,34 +19,20 @@ | |||
19 | #ifndef _HVCALLSM_H | 19 | #ifndef _HVCALLSM_H |
20 | #define _HVCALLSM_H | 20 | #define _HVCALLSM_H |
21 | 21 | ||
22 | //============================================================================ | 22 | /* |
23 | // | 23 | * This file contains the "hypervisor call" interface which is used to |
24 | // This file contains the "hypervisor call" interface which is used to | 24 | * drive the hypervisor from the OS. |
25 | // drive the hypervisor from the OS. | 25 | */ |
26 | // | ||
27 | //============================================================================ | ||
28 | 26 | ||
29 | //------------------------------------------------------------------- | ||
30 | // Standard Includes | ||
31 | //------------------------------------------------------------------- | ||
32 | #include <asm/iSeries/HvCallSc.h> | 27 | #include <asm/iSeries/HvCallSc.h> |
33 | #include <asm/iSeries/HvTypes.h> | 28 | #include <asm/iSeries/HvTypes.h> |
34 | 29 | ||
35 | //----------------------------------------------------------------------------- | ||
36 | // Constants | ||
37 | //----------------------------------------------------------------------------- | ||
38 | |||
39 | #define HvCallSmGet64BitsOfAccessMap HvCallSm + 11 | 30 | #define HvCallSmGet64BitsOfAccessMap HvCallSm + 11 |
40 | 31 | ||
41 | 32 | static inline u64 HvCallSm_get64BitsOfAccessMap(HvLpIndex lpIndex, | |
42 | //============================================================================ | 33 | u64 indexIntoBitMap) |
43 | static inline u64 HvCallSm_get64BitsOfAccessMap( | ||
44 | HvLpIndex lpIndex, u64 indexIntoBitMap ) | ||
45 | { | 34 | { |
46 | u64 retval = HvCall2(HvCallSmGet64BitsOfAccessMap, lpIndex, | 35 | return HvCall2(HvCallSmGet64BitsOfAccessMap, lpIndex, indexIntoBitMap); |
47 | indexIntoBitMap ); | ||
48 | // getPaca()->adjustHmtForNoOfSpinLocksHeld(); | ||
49 | return retval; | ||
50 | } | 36 | } |
51 | //============================================================================ | 37 | |
52 | #endif /* _HVCALLSM_H */ | 38 | #endif /* _HVCALLSM_H */ |
diff --git a/include/asm-ppc64/iSeries/HvCallXm.h b/include/asm-ppc64/iSeries/HvCallXm.h index bfb898f4db8d..8b9ba608daaf 100644 --- a/include/asm-ppc64/iSeries/HvCallXm.h +++ b/include/asm-ppc64/iSeries/HvCallXm.h | |||
@@ -1,30 +1,13 @@ | |||
1 | //============================================================================ | 1 | /* |
2 | // Header File Id | 2 | * This file contains the "hypervisor call" interface which is used to |
3 | // Name______________: HvCallXm.H | 3 | * drive the hypervisor from SLIC. |
4 | // | 4 | */ |
5 | // Description_______: | ||
6 | // | ||
7 | // This file contains the "hypervisor call" interface which is used to | ||
8 | // drive the hypervisor from SLIC. | ||
9 | // | ||
10 | //============================================================================ | ||
11 | #ifndef _HVCALLXM_H | 5 | #ifndef _HVCALLXM_H |
12 | #define _HVCALLXM_H | 6 | #define _HVCALLXM_H |
13 | 7 | ||
14 | //------------------------------------------------------------------- | ||
15 | // Forward declarations | ||
16 | //------------------------------------------------------------------- | ||
17 | |||
18 | //------------------------------------------------------------------- | ||
19 | // Standard Includes | ||
20 | //------------------------------------------------------------------- | ||
21 | #include <asm/iSeries/HvCallSc.h> | 8 | #include <asm/iSeries/HvCallSc.h> |
22 | #include <asm/iSeries/HvTypes.h> | 9 | #include <asm/iSeries/HvTypes.h> |
23 | 10 | ||
24 | //----------------------------------------------------------------------------- | ||
25 | // Constants | ||
26 | //----------------------------------------------------------------------------- | ||
27 | |||
28 | #define HvCallXmGetTceTableParms HvCallXm + 0 | 11 | #define HvCallXmGetTceTableParms HvCallXm + 0 |
29 | #define HvCallXmTestBus HvCallXm + 1 | 12 | #define HvCallXmTestBus HvCallXm + 1 |
30 | #define HvCallXmConnectBusUnit HvCallXm + 2 | 13 | #define HvCallXmConnectBusUnit HvCallXm + 2 |
@@ -33,63 +16,63 @@ | |||
33 | #define HvCallXmSetTce HvCallXm + 11 | 16 | #define HvCallXmSetTce HvCallXm + 11 |
34 | #define HvCallXmSetTces HvCallXm + 13 | 17 | #define HvCallXmSetTces HvCallXm + 13 |
35 | 18 | ||
19 | /* | ||
20 | * Structure passed to HvCallXm_getTceTableParms | ||
21 | */ | ||
22 | struct iommu_table_cb { | ||
23 | unsigned long itc_busno; /* Bus number for this tce table */ | ||
24 | unsigned long itc_start; /* Will be NULL for secondary */ | ||
25 | unsigned long itc_totalsize; /* Size (in pages) of whole table */ | ||
26 | unsigned long itc_offset; /* Index into real tce table of the | ||
27 | start of our section */ | ||
28 | unsigned long itc_size; /* Size (in pages) of our section */ | ||
29 | unsigned long itc_index; /* Index of this tce table */ | ||
30 | unsigned short itc_maxtables; /* Max num of tables for partition */ | ||
31 | unsigned char itc_virtbus; /* Flag to indicate virtual bus */ | ||
32 | unsigned char itc_slotno; /* IOA Tce Slot Index */ | ||
33 | unsigned char itc_rsvd[4]; | ||
34 | }; | ||
36 | 35 | ||
37 | 36 | static inline void HvCallXm_getTceTableParms(u64 cb) | |
38 | //============================================================================ | ||
39 | static inline void HvCallXm_getTceTableParms(u64 cb) | ||
40 | { | 37 | { |
41 | HvCall1(HvCallXmGetTceTableParms, cb); | 38 | HvCall1(HvCallXmGetTceTableParms, cb); |
42 | // getPaca()->adjustHmtForNoOfSpinLocksHeld(); | ||
43 | } | 39 | } |
44 | //============================================================================ | 40 | |
45 | static inline u64 HvCallXm_setTce(u64 tceTableToken, u64 tceOffset, u64 tce) | 41 | static inline u64 HvCallXm_setTce(u64 tceTableToken, u64 tceOffset, u64 tce) |
46 | { | 42 | { |
47 | u64 retval = HvCall3(HvCallXmSetTce, tceTableToken, tceOffset, tce ); | 43 | return HvCall3(HvCallXmSetTce, tceTableToken, tceOffset, tce); |
48 | // getPaca()->adjustHmtForNoOfSpinLocksHeld(); | ||
49 | return retval; | ||
50 | } | ||
51 | //============================================================================ | ||
52 | static inline u64 HvCallXm_setTces(u64 tceTableToken, u64 tceOffset, u64 numTces, u64 tce1, u64 tce2, u64 tce3, u64 tce4) | ||
53 | { | ||
54 | u64 retval = HvCall7(HvCallXmSetTces, tceTableToken, tceOffset, numTces, | ||
55 | tce1, tce2, tce3, tce4 ); | ||
56 | // getPaca()->adjustHmtForNoOfSpinLocksHeld(); | ||
57 | return retval; | ||
58 | } | 44 | } |
59 | //============================================================================= | 45 | |
60 | static inline u64 HvCallXm_testBus(u16 busNumber) | 46 | static inline u64 HvCallXm_setTces(u64 tceTableToken, u64 tceOffset, |
47 | u64 numTces, u64 tce1, u64 tce2, u64 tce3, u64 tce4) | ||
61 | { | 48 | { |
62 | u64 retVal = HvCall1(HvCallXmTestBus, busNumber); | 49 | return HvCall7(HvCallXmSetTces, tceTableToken, tceOffset, numTces, |
63 | // getPaca()->adjustHmtForNoOfSpinLocksHeld(); | 50 | tce1, tce2, tce3, tce4); |
64 | return retVal; | ||
65 | } | 51 | } |
66 | //===================================================================================== | 52 | |
67 | static inline u64 HvCallXm_testBusUnit(u16 busNumber, u8 subBusNumber, u8 deviceId) | 53 | static inline u64 HvCallXm_testBus(u16 busNumber) |
68 | { | 54 | { |
69 | u64 busUnitNumber = (subBusNumber << 8) | deviceId; | 55 | return HvCall1(HvCallXmTestBus, busNumber); |
70 | u64 retVal = HvCall2(HvCallXmTestBusUnit, busNumber, busUnitNumber); | ||
71 | // getPaca()->adjustHmtForNoOfSpinLocksHeld(); | ||
72 | return retVal; | ||
73 | } | 56 | } |
74 | //===================================================================================== | 57 | |
75 | static inline u64 HvCallXm_connectBusUnit(u16 busNumber, u8 subBusNumber, u8 deviceId, | 58 | static inline u64 HvCallXm_testBusUnit(u16 busNumber, u8 subBusNumber, |
76 | u64 interruptToken) | 59 | u8 deviceId) |
77 | { | 60 | { |
78 | u64 busUnitNumber = (subBusNumber << 8) | deviceId; | 61 | return HvCall2(HvCallXmTestBusUnit, busNumber, |
79 | u64 queueIndex = 0; // HvLpConfig::mapDsaToQueueIndex(HvLpDSA(busNumber, xBoard, xCard)); | 62 | (subBusNumber << 8) | deviceId); |
63 | } | ||
80 | 64 | ||
81 | u64 retVal = HvCall5(HvCallXmConnectBusUnit, busNumber, busUnitNumber, | 65 | static inline u64 HvCallXm_connectBusUnit(u16 busNumber, u8 subBusNumber, |
82 | interruptToken, 0, queueIndex); | 66 | u8 deviceId, u64 interruptToken) |
83 | // getPaca()->adjustHmtForNoOfSpinLocksHeld(); | 67 | { |
84 | return retVal; | 68 | return HvCall5(HvCallXmConnectBusUnit, busNumber, |
69 | (subBusNumber << 8) | deviceId, interruptToken, 0, | ||
70 | 0 /* HvLpConfig::mapDsaToQueueIndex(HvLpDSA(busNumber, xBoard, xCard)) */); | ||
85 | } | 71 | } |
86 | //===================================================================================== | 72 | |
87 | static inline u64 HvCallXm_loadTod(void) | 73 | static inline u64 HvCallXm_loadTod(void) |
88 | { | 74 | { |
89 | u64 retVal = HvCall0(HvCallXmLoadTod); | 75 | return HvCall0(HvCallXmLoadTod); |
90 | // getPaca()->adjustHmtForNoOfSpinLocksHeld(); | ||
91 | return retVal; | ||
92 | } | 76 | } |
93 | //===================================================================================== | ||
94 | 77 | ||
95 | #endif /* _HVCALLXM_H */ | 78 | #endif /* _HVCALLXM_H */ |
diff --git a/include/asm-ppc64/iSeries/HvLpConfig.h b/include/asm-ppc64/iSeries/HvLpConfig.h index bdbd70f42c9d..f1cf1e70ca3c 100644 --- a/include/asm-ppc64/iSeries/HvLpConfig.h +++ b/include/asm-ppc64/iSeries/HvLpConfig.h | |||
@@ -1,17 +1,17 @@ | |||
1 | /* | 1 | /* |
2 | * HvLpConfig.h | 2 | * HvLpConfig.h |
3 | * Copyright (C) 2001 Mike Corrigan IBM Corporation | 3 | * Copyright (C) 2001 Mike Corrigan IBM Corporation |
4 | * | 4 | * |
5 | * This program is free software; you can redistribute it and/or modify | 5 | * This program is free software; you can redistribute it and/or modify |
6 | * it under the terms of the GNU General Public License as published by | 6 | * it under the terms of the GNU General Public License as published by |
7 | * the Free Software Foundation; either version 2 of the License, or | 7 | * the Free Software Foundation; either version 2 of the License, or |
8 | * (at your option) any later version. | 8 | * (at your option) any later version. |
9 | * | 9 | * |
10 | * This program is distributed in the hope that it will be useful, | 10 | * This program is distributed in the hope that it will be useful, |
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
13 | * GNU General Public License for more details. | 13 | * GNU General Public License for more details. |
14 | * | 14 | * |
15 | * You should have received a copy of the GNU General Public License | 15 | * You should have received a copy of the GNU General Public License |
16 | * along with this program; if not, write to the Free Software | 16 | * along with this program; if not, write to the Free Software |
17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | 17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
@@ -19,262 +19,120 @@ | |||
19 | #ifndef _HVLPCONFIG_H | 19 | #ifndef _HVLPCONFIG_H |
20 | #define _HVLPCONFIG_H | 20 | #define _HVLPCONFIG_H |
21 | 21 | ||
22 | //=========================================================================== | 22 | /* |
23 | // | 23 | * This file contains the interface to the LPAR configuration data |
24 | // This file contains the interface to the LPAR configuration data | 24 | * to determine which resources should be allocated to each partition. |
25 | // to determine which resources should be allocated to each partition. | 25 | */ |
26 | // | ||
27 | //=========================================================================== | ||
28 | 26 | ||
29 | #include <asm/iSeries/HvCallCfg.h> | 27 | #include <asm/iSeries/HvCallSc.h> |
30 | #include <asm/iSeries/HvTypes.h> | 28 | #include <asm/iSeries/HvTypes.h> |
31 | #include <asm/iSeries/ItLpNaca.h> | 29 | #include <asm/iSeries/ItLpNaca.h> |
32 | #include <asm/iSeries/LparData.h> | ||
33 | 30 | ||
34 | //------------------------------------------------------------------- | 31 | enum { |
35 | // Constants | 32 | HvCallCfg_Cur = 0, |
36 | //------------------------------------------------------------------- | 33 | HvCallCfg_Init = 1, |
34 | HvCallCfg_Max = 2, | ||
35 | HvCallCfg_Min = 3 | ||
36 | }; | ||
37 | |||
38 | #define HvCallCfgGetSystemPhysicalProcessors HvCallCfg + 6 | ||
39 | #define HvCallCfgGetPhysicalProcessors HvCallCfg + 7 | ||
40 | #define HvCallCfgGetMsChunks HvCallCfg + 9 | ||
41 | #define HvCallCfgGetSharedPoolIndex HvCallCfg + 20 | ||
42 | #define HvCallCfgGetSharedProcUnits HvCallCfg + 21 | ||
43 | #define HvCallCfgGetNumProcsInSharedPool HvCallCfg + 22 | ||
44 | #define HvCallCfgGetVirtualLanIndexMap HvCallCfg + 30 | ||
45 | #define HvCallCfgGetHostingLpIndex HvCallCfg + 32 | ||
37 | 46 | ||
38 | extern HvLpIndex HvLpConfig_getLpIndex_outline(void); | 47 | extern HvLpIndex HvLpConfig_getLpIndex_outline(void); |
39 | 48 | ||
40 | //=================================================================== | ||
41 | static inline HvLpIndex HvLpConfig_getLpIndex(void) | 49 | static inline HvLpIndex HvLpConfig_getLpIndex(void) |
42 | { | 50 | { |
43 | return itLpNaca.xLpIndex; | 51 | return itLpNaca.xLpIndex; |
44 | } | 52 | } |
45 | //=================================================================== | 53 | |
46 | static inline HvLpIndex HvLpConfig_getPrimaryLpIndex(void) | 54 | static inline HvLpIndex HvLpConfig_getPrimaryLpIndex(void) |
47 | { | 55 | { |
48 | return itLpNaca.xPrimaryLpIndex; | 56 | return itLpNaca.xPrimaryLpIndex; |
49 | } | 57 | } |
50 | //================================================================= | 58 | |
51 | static inline HvLpIndex HvLpConfig_getLps(void) | 59 | static inline u64 HvLpConfig_getMsChunks(void) |
52 | { | ||
53 | return HvCallCfg_getLps(); | ||
54 | } | ||
55 | //================================================================= | ||
56 | static inline HvLpIndexMap HvLpConfig_getActiveLpMap(void) | ||
57 | { | ||
58 | return HvCallCfg_getActiveLpMap(); | ||
59 | } | ||
60 | //================================================================= | ||
61 | static inline u64 HvLpConfig_getSystemMsMegs(void) | ||
62 | { | ||
63 | return HvCallCfg_getSystemMsChunks() / HVCHUNKSPERMEG; | ||
64 | } | ||
65 | //================================================================= | ||
66 | static inline u64 HvLpConfig_getSystemMsChunks(void) | ||
67 | { | ||
68 | return HvCallCfg_getSystemMsChunks(); | ||
69 | } | ||
70 | //================================================================= | ||
71 | static inline u64 HvLpConfig_getSystemMsPages(void) | ||
72 | { | ||
73 | return HvCallCfg_getSystemMsChunks() * HVPAGESPERCHUNK; | ||
74 | } | ||
75 | //================================================================ | ||
76 | static inline u64 HvLpConfig_getMsMegs(void) | ||
77 | { | ||
78 | return HvCallCfg_getMsChunks(HvLpConfig_getLpIndex(),HvCallCfg_Cur) / HVCHUNKSPERMEG; | ||
79 | } | ||
80 | //================================================================ | ||
81 | static inline u64 HvLpConfig_getMsChunks(void) | ||
82 | { | ||
83 | return HvCallCfg_getMsChunks(HvLpConfig_getLpIndex(),HvCallCfg_Cur); | ||
84 | } | ||
85 | //================================================================ | ||
86 | static inline u64 HvLpConfig_getMsPages(void) | ||
87 | { | ||
88 | return HvCallCfg_getMsChunks(HvLpConfig_getLpIndex(),HvCallCfg_Cur) * HVPAGESPERCHUNK; | ||
89 | } | ||
90 | //================================================================ | ||
91 | static inline u64 HvLpConfig_getMinMsMegs(void) | ||
92 | { | ||
93 | return HvCallCfg_getMsChunks(HvLpConfig_getLpIndex(),HvCallCfg_Min) / HVCHUNKSPERMEG; | ||
94 | } | ||
95 | //================================================================ | ||
96 | static inline u64 HvLpConfig_getMinMsChunks(void) | ||
97 | { | ||
98 | return HvCallCfg_getMsChunks(HvLpConfig_getLpIndex(),HvCallCfg_Min); | ||
99 | } | ||
100 | //================================================================ | ||
101 | static inline u64 HvLpConfig_getMinMsPages(void) | ||
102 | { | ||
103 | return HvCallCfg_getMsChunks(HvLpConfig_getLpIndex(),HvCallCfg_Min) * HVPAGESPERCHUNK; | ||
104 | } | ||
105 | //================================================================ | ||
106 | static inline u64 HvLpConfig_getMinRuntimeMsMegs(void) | ||
107 | { | ||
108 | return HvCallCfg_getMinRuntimeMsChunks(HvLpConfig_getLpIndex()) / HVCHUNKSPERMEG; | ||
109 | } | ||
110 | //=============================================================== | ||
111 | static inline u64 HvLpConfig_getMinRuntimeMsChunks(void) | ||
112 | { | ||
113 | return HvCallCfg_getMinRuntimeMsChunks(HvLpConfig_getLpIndex()); | ||
114 | } | ||
115 | //=============================================================== | ||
116 | static inline u64 HvLpConfig_getMinRuntimeMsPages(void) | ||
117 | { | ||
118 | return HvCallCfg_getMinRuntimeMsChunks(HvLpConfig_getLpIndex()) * HVPAGESPERCHUNK; | ||
119 | } | ||
120 | //=============================================================== | ||
121 | static inline u64 HvLpConfig_getMaxMsMegs(void) | ||
122 | { | ||
123 | return HvCallCfg_getMsChunks(HvLpConfig_getLpIndex(),HvCallCfg_Max) / HVCHUNKSPERMEG; | ||
124 | } | ||
125 | //=============================================================== | ||
126 | static inline u64 HvLpConfig_getMaxMsChunks(void) | ||
127 | { | ||
128 | return HvCallCfg_getMsChunks(HvLpConfig_getLpIndex(),HvCallCfg_Max); | ||
129 | } | ||
130 | //=============================================================== | ||
131 | static inline u64 HvLpConfig_getMaxMsPages(void) | ||
132 | { | ||
133 | return HvCallCfg_getMsChunks(HvLpConfig_getLpIndex(),HvCallCfg_Max) * HVPAGESPERCHUNK; | ||
134 | } | ||
135 | //=============================================================== | ||
136 | static inline u64 HvLpConfig_getInitMsMegs(void) | ||
137 | { | ||
138 | return HvCallCfg_getMsChunks(HvLpConfig_getLpIndex(),HvCallCfg_Init) / HVCHUNKSPERMEG; | ||
139 | } | ||
140 | //=============================================================== | ||
141 | static inline u64 HvLpConfig_getInitMsChunks(void) | ||
142 | { | ||
143 | return HvCallCfg_getMsChunks(HvLpConfig_getLpIndex(),HvCallCfg_Init); | ||
144 | } | ||
145 | //=============================================================== | ||
146 | static inline u64 HvLpConfig_getInitMsPages(void) | ||
147 | { return HvCallCfg_getMsChunks(HvLpConfig_getLpIndex(),HvCallCfg_Init) * HVPAGESPERCHUNK; | ||
148 | } | ||
149 | //=============================================================== | ||
150 | static inline u64 HvLpConfig_getSystemPhysicalProcessors(void) | ||
151 | { | ||
152 | return HvCallCfg_getSystemPhysicalProcessors(); | ||
153 | } | ||
154 | //=============================================================== | ||
155 | static inline u64 HvLpConfig_getSystemLogicalProcessors(void) | ||
156 | { | ||
157 | return HvCallCfg_getSystemPhysicalProcessors() * (/*getPaca()->getSecondaryThreadCount() +*/ 1); | ||
158 | } | ||
159 | //=============================================================== | ||
160 | static inline u64 HvLpConfig_getNumProcsInSharedPool(HvLpSharedPoolIndex sPI) | ||
161 | { | ||
162 | return HvCallCfg_getNumProcsInSharedPool(sPI); | ||
163 | } | ||
164 | //=============================================================== | ||
165 | static inline u64 HvLpConfig_getPhysicalProcessors(void) | ||
166 | { | ||
167 | return HvCallCfg_getPhysicalProcessors(HvLpConfig_getLpIndex(),HvCallCfg_Cur); | ||
168 | } | ||
169 | //=============================================================== | ||
170 | static inline u64 HvLpConfig_getLogicalProcessors(void) | ||
171 | { | ||
172 | return HvCallCfg_getPhysicalProcessors(HvLpConfig_getLpIndex(),HvCallCfg_Cur) * (/*getPaca()->getSecondaryThreadCount() +*/ 1); | ||
173 | } | ||
174 | //=============================================================== | ||
175 | static inline HvLpSharedPoolIndex HvLpConfig_getSharedPoolIndex(void) | ||
176 | { | ||
177 | return HvCallCfg_getSharedPoolIndex(HvLpConfig_getLpIndex()); | ||
178 | } | ||
179 | //=============================================================== | ||
180 | static inline u64 HvLpConfig_getSharedProcUnits(void) | ||
181 | { | ||
182 | return HvCallCfg_getSharedProcUnits(HvLpConfig_getLpIndex(),HvCallCfg_Cur); | ||
183 | } | ||
184 | //=============================================================== | ||
185 | static inline u64 HvLpConfig_getMinSharedProcUnits(void) | ||
186 | { | ||
187 | return HvCallCfg_getSharedProcUnits(HvLpConfig_getLpIndex(),HvCallCfg_Min); | ||
188 | } | ||
189 | //=============================================================== | ||
190 | static inline u64 HvLpConfig_getMaxSharedProcUnits(void) | ||
191 | { | ||
192 | return HvCallCfg_getSharedProcUnits(HvLpConfig_getLpIndex(),HvCallCfg_Max); | ||
193 | } | ||
194 | //=============================================================== | ||
195 | static inline u64 HvLpConfig_getMinPhysicalProcessors(void) | ||
196 | { | ||
197 | return HvCallCfg_getPhysicalProcessors(HvLpConfig_getLpIndex(),HvCallCfg_Min); | ||
198 | } | ||
199 | //=============================================================== | ||
200 | static inline u64 HvLpConfig_getMinLogicalProcessors(void) | ||
201 | { | ||
202 | return HvCallCfg_getPhysicalProcessors(HvLpConfig_getLpIndex(),HvCallCfg_Min) * (/*getPaca()->getSecondaryThreadCount() +*/ 1); | ||
203 | } | ||
204 | //=============================================================== | ||
205 | static inline u64 HvLpConfig_getMaxPhysicalProcessors(void) | ||
206 | { | ||
207 | return HvCallCfg_getPhysicalProcessors(HvLpConfig_getLpIndex(),HvCallCfg_Max); | ||
208 | } | ||
209 | //=============================================================== | ||
210 | static inline u64 HvLpConfig_getMaxLogicalProcessors(void) | ||
211 | { | ||
212 | return HvCallCfg_getPhysicalProcessors(HvLpConfig_getLpIndex(),HvCallCfg_Max) * (/*getPaca()->getSecondaryThreadCount() +*/ 1); | ||
213 | } | ||
214 | //=============================================================== | ||
215 | static inline u64 HvLpConfig_getInitPhysicalProcessors(void) | ||
216 | { | 60 | { |
217 | return HvCallCfg_getPhysicalProcessors(HvLpConfig_getLpIndex(),HvCallCfg_Init); | 61 | return HvCall2(HvCallCfgGetMsChunks, HvLpConfig_getLpIndex(), |
62 | HvCallCfg_Cur); | ||
218 | } | 63 | } |
219 | //=============================================================== | 64 | |
220 | static inline u64 HvLpConfig_getInitLogicalProcessors(void) | 65 | static inline u64 HvLpConfig_getSystemPhysicalProcessors(void) |
221 | { | 66 | { |
222 | return HvCallCfg_getPhysicalProcessors(HvLpConfig_getLpIndex(),HvCallCfg_Init) * (/*getPaca()->getSecondaryThreadCount() +*/ 1); | 67 | return HvCall0(HvCallCfgGetSystemPhysicalProcessors); |
223 | } | 68 | } |
224 | //================================================================ | 69 | |
225 | static inline HvLpVirtualLanIndexMap HvLpConfig_getVirtualLanIndexMap(void) | 70 | static inline u64 HvLpConfig_getNumProcsInSharedPool(HvLpSharedPoolIndex sPI) |
226 | { | 71 | { |
227 | return HvCallCfg_getVirtualLanIndexMap(HvLpConfig_getLpIndex_outline()); | 72 | return (u16)HvCall1(HvCallCfgGetNumProcsInSharedPool, sPI); |
228 | } | 73 | } |
229 | //=============================================================== | 74 | |
230 | static inline HvLpVirtualLanIndexMap HvLpConfig_getVirtualLanIndexMapForLp(HvLpIndex lp) | 75 | static inline u64 HvLpConfig_getPhysicalProcessors(void) |
231 | { | 76 | { |
232 | return HvCallCfg_getVirtualLanIndexMap(lp); | 77 | return HvCall2(HvCallCfgGetPhysicalProcessors, HvLpConfig_getLpIndex(), |
78 | HvCallCfg_Cur); | ||
233 | } | 79 | } |
234 | //================================================================ | 80 | |
235 | static inline HvLpIndex HvLpConfig_getBusOwner(HvBusNumber busNumber) | 81 | static inline HvLpSharedPoolIndex HvLpConfig_getSharedPoolIndex(void) |
236 | { | 82 | { |
237 | return HvCallCfg_getBusOwner(busNumber); | 83 | return HvCall1(HvCallCfgGetSharedPoolIndex, HvLpConfig_getLpIndex()); |
238 | } | 84 | } |
239 | //=============================================================== | 85 | |
240 | static inline int HvLpConfig_isBusDedicated(HvBusNumber busNumber) | 86 | static inline u64 HvLpConfig_getSharedProcUnits(void) |
241 | { | 87 | { |
242 | return HvCallCfg_isBusDedicated(busNumber); | 88 | return HvCall2(HvCallCfgGetSharedProcUnits, HvLpConfig_getLpIndex(), |
89 | HvCallCfg_Cur); | ||
243 | } | 90 | } |
244 | //================================================================ | 91 | |
245 | static inline HvLpIndexMap HvLpConfig_getBusAllocation(HvBusNumber busNumber) | 92 | static inline u64 HvLpConfig_getMaxSharedProcUnits(void) |
246 | { | 93 | { |
247 | return HvCallCfg_getBusAllocation(busNumber); | 94 | return HvCall2(HvCallCfgGetSharedProcUnits, HvLpConfig_getLpIndex(), |
95 | HvCallCfg_Max); | ||
248 | } | 96 | } |
249 | //================================================================ | 97 | |
250 | // returns the absolute real address of the load area | 98 | static inline u64 HvLpConfig_getMaxPhysicalProcessors(void) |
251 | static inline u64 HvLpConfig_getLoadAddress(void) | ||
252 | { | 99 | { |
253 | return itLpNaca.xLoadAreaAddr & 0x7fffffffffffffff; | 100 | return HvCall2(HvCallCfgGetPhysicalProcessors, HvLpConfig_getLpIndex(), |
101 | HvCallCfg_Max); | ||
254 | } | 102 | } |
255 | //================================================================ | 103 | |
256 | static inline u64 HvLpConfig_getLoadPages(void) | 104 | static inline HvLpVirtualLanIndexMap HvLpConfig_getVirtualLanIndexMapForLp( |
257 | { | 105 | HvLpIndex lp) |
258 | return itLpNaca.xLoadAreaChunks * HVPAGESPERCHUNK; | 106 | { |
107 | /* | ||
108 | * This is a new function in V5R1 so calls to this on older | ||
109 | * hypervisors will return -1 | ||
110 | */ | ||
111 | u64 retVal = HvCall1(HvCallCfgGetVirtualLanIndexMap, lp); | ||
112 | if (retVal == -1) | ||
113 | retVal = 0; | ||
114 | return retVal; | ||
259 | } | 115 | } |
260 | //================================================================ | 116 | |
261 | static inline int HvLpConfig_isBusOwnedByThisLp(HvBusNumber busNumber) | 117 | static inline HvLpVirtualLanIndexMap HvLpConfig_getVirtualLanIndexMap(void) |
262 | { | 118 | { |
263 | HvLpIndex busOwner = HvLpConfig_getBusOwner(busNumber); | 119 | return HvLpConfig_getVirtualLanIndexMapForLp( |
264 | return (busOwner == HvLpConfig_getLpIndex()); | 120 | HvLpConfig_getLpIndex_outline()); |
265 | } | 121 | } |
266 | //================================================================ | 122 | |
267 | static inline int HvLpConfig_doLpsCommunicateOnVirtualLan(HvLpIndex lp1, HvLpIndex lp2) | 123 | static inline int HvLpConfig_doLpsCommunicateOnVirtualLan(HvLpIndex lp1, |
124 | HvLpIndex lp2) | ||
268 | { | 125 | { |
269 | HvLpVirtualLanIndexMap virtualLanIndexMap1 = HvCallCfg_getVirtualLanIndexMap( lp1 ); | 126 | HvLpVirtualLanIndexMap virtualLanIndexMap1 = |
270 | HvLpVirtualLanIndexMap virtualLanIndexMap2 = HvCallCfg_getVirtualLanIndexMap( lp2 ); | 127 | HvLpConfig_getVirtualLanIndexMapForLp(lp1); |
128 | HvLpVirtualLanIndexMap virtualLanIndexMap2 = | ||
129 | HvLpConfig_getVirtualLanIndexMapForLp(lp2); | ||
271 | return ((virtualLanIndexMap1 & virtualLanIndexMap2) != 0); | 130 | return ((virtualLanIndexMap1 & virtualLanIndexMap2) != 0); |
272 | } | 131 | } |
273 | //================================================================ | 132 | |
274 | static inline HvLpIndex HvLpConfig_getHostingLpIndex(HvLpIndex lp) | 133 | static inline HvLpIndex HvLpConfig_getHostingLpIndex(HvLpIndex lp) |
275 | { | 134 | { |
276 | return HvCallCfg_getHostingLpIndex(lp); | 135 | return HvCall1(HvCallCfgGetHostingLpIndex, lp); |
277 | } | 136 | } |
278 | //================================================================ | ||
279 | 137 | ||
280 | #endif /* _HVLPCONFIG_H */ | 138 | #endif /* _HVLPCONFIG_H */ |
diff --git a/include/asm-ppc64/iSeries/HvLpEvent.h b/include/asm-ppc64/iSeries/HvLpEvent.h index 30936e433064..865000de79b6 100644 --- a/include/asm-ppc64/iSeries/HvLpEvent.h +++ b/include/asm-ppc64/iSeries/HvLpEvent.h | |||
@@ -1,27 +1,24 @@ | |||
1 | /* | 1 | /* |
2 | * HvLpEvent.h | 2 | * HvLpEvent.h |
3 | * Copyright (C) 2001 Mike Corrigan IBM Corporation | 3 | * Copyright (C) 2001 Mike Corrigan IBM Corporation |
4 | * | 4 | * |
5 | * This program is free software; you can redistribute it and/or modify | 5 | * This program is free software; you can redistribute it and/or modify |
6 | * it under the terms of the GNU General Public License as published by | 6 | * it under the terms of the GNU General Public License as published by |
7 | * the Free Software Foundation; either version 2 of the License, or | 7 | * the Free Software Foundation; either version 2 of the License, or |
8 | * (at your option) any later version. | 8 | * (at your option) any later version. |
9 | * | 9 | * |
10 | * This program is distributed in the hope that it will be useful, | 10 | * This program is distributed in the hope that it will be useful, |
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
13 | * GNU General Public License for more details. | 13 | * GNU General Public License for more details. |
14 | * | 14 | * |
15 | * You should have received a copy of the GNU General Public License | 15 | * You should have received a copy of the GNU General Public License |
16 | * along with this program; if not, write to the Free Software | 16 | * along with this program; if not, write to the Free Software |
17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | 17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
18 | */ | 18 | */ |
19 | 19 | ||
20 | //====================================================================== | 20 | /* This file contains the class for HV events in the system. */ |
21 | // | 21 | |
22 | // This file contains the class for HV events in the system. | ||
23 | // | ||
24 | //===================================================================== | ||
25 | #ifndef _HVLPEVENT_H | 22 | #ifndef _HVLPEVENT_H |
26 | #define _HVLPEVENT_H | 23 | #define _HVLPEVENT_H |
27 | 24 | ||
@@ -30,69 +27,70 @@ | |||
30 | #include <asm/iSeries/HvTypes.h> | 27 | #include <asm/iSeries/HvTypes.h> |
31 | #include <asm/iSeries/HvCallEvent.h> | 28 | #include <asm/iSeries/HvCallEvent.h> |
32 | 29 | ||
33 | //===================================================================== | 30 | /* |
34 | // | 31 | * HvLpEvent is the structure for Lp Event messages passed between |
35 | // HvLpEvent is the structure for Lp Event messages passed between | 32 | * partitions through PLIC. |
36 | // partitions through PLIC. | 33 | */ |
37 | // | 34 | |
38 | //===================================================================== | 35 | struct HvEventFlags { |
39 | 36 | u8 xValid:1; /* Indicates a valid request x00-x00 */ | |
40 | struct HvEventFlags | 37 | u8 xRsvd1:4; /* Reserved ... */ |
41 | { | 38 | u8 xAckType:1; /* Immediate or deferred ... */ |
42 | u8 xValid:1; // Indicates a valid request x00-x00 | 39 | u8 xAckInd:1; /* Indicates if ACK required ... */ |
43 | u8 xRsvd1:4; // Reserved ... | 40 | u8 xFunction:1; /* Interrupt or Acknowledge ... */ |
44 | u8 xAckType:1; // Immediate or deferred ... | ||
45 | u8 xAckInd:1; // Indicates if ACK required ... | ||
46 | u8 xFunction:1; // Interrupt or Acknowledge ... | ||
47 | }; | 41 | }; |
48 | 42 | ||
49 | 43 | ||
50 | struct HvLpEvent | 44 | struct HvLpEvent { |
51 | { | 45 | struct HvEventFlags xFlags; /* Event flags x00-x00 */ |
52 | struct HvEventFlags xFlags; // Event flags x00-x00 | 46 | u8 xType; /* Type of message x01-x01 */ |
53 | u8 xType; // Type of message x01-x01 | 47 | u16 xSubtype; /* Subtype for event x02-x03 */ |
54 | u16 xSubtype; // Subtype for event x02-x03 | 48 | u8 xSourceLp; /* Source LP x04-x04 */ |
55 | u8 xSourceLp; // Source LP x04-x04 | 49 | u8 xTargetLp; /* Target LP x05-x05 */ |
56 | u8 xTargetLp; // Target LP x05-x05 | 50 | u8 xSizeMinus1; /* Size of Derived class - 1 x06-x06 */ |
57 | u8 xSizeMinus1; // Size of Derived class - 1 x06-x06 | 51 | u8 xRc; /* RC for Ack flows x07-x07 */ |
58 | u8 xRc; // RC for Ack flows x07-x07 | 52 | u16 xSourceInstanceId; /* Source sides instance id x08-x09 */ |
59 | u16 xSourceInstanceId; // Source sides instance id x08-x09 | 53 | u16 xTargetInstanceId; /* Target sides instance id x0A-x0B */ |
60 | u16 xTargetInstanceId; // Target sides instance id x0A-x0B | ||
61 | union { | 54 | union { |
62 | u32 xSubtypeData; // Data usable by the subtype x0C-x0F | 55 | u32 xSubtypeData; /* Data usable by the subtype x0C-x0F */ |
63 | u16 xSubtypeDataShort[2]; // Data as 2 shorts | 56 | u16 xSubtypeDataShort[2]; /* Data as 2 shorts */ |
64 | u8 xSubtypeDataChar[4]; // Data as 4 chars | 57 | u8 xSubtypeDataChar[4]; /* Data as 4 chars */ |
65 | } x; | 58 | } x; |
66 | 59 | ||
67 | u64 xCorrelationToken; // Unique value for source/type x10-x17 | 60 | u64 xCorrelationToken; /* Unique value for source/type x10-x17 */ |
68 | }; | 61 | }; |
69 | 62 | ||
70 | // Lp Event handler function | ||
71 | typedef void (*LpEventHandler)(struct HvLpEvent *, struct pt_regs *); | 63 | typedef void (*LpEventHandler)(struct HvLpEvent *, struct pt_regs *); |
72 | 64 | ||
73 | // Register a handler for an event type | 65 | /* Register a handler for an event type - returns 0 on success */ |
74 | // returns 0 on success | 66 | extern int HvLpEvent_registerHandler(HvLpEvent_Type eventType, |
75 | extern int HvLpEvent_registerHandler( HvLpEvent_Type eventType, LpEventHandler hdlr); | 67 | LpEventHandler hdlr); |
76 | |||
77 | // Unregister a handler for an event type | ||
78 | // This call will sleep until the handler being removed is guaranteed to | ||
79 | // be no longer executing on any CPU. Do not call with locks held. | ||
80 | // | ||
81 | // returns 0 on success | ||
82 | // Unregister will fail if there are any paths open for the type | ||
83 | extern int HvLpEvent_unregisterHandler( HvLpEvent_Type eventType ); | ||
84 | 68 | ||
85 | // Open an Lp Event Path for an event type | 69 | /* |
86 | // returns 0 on success | 70 | * Unregister a handler for an event type |
87 | // openPath will fail if there is no handler registered for the event type. | 71 | * |
88 | // The lpIndex specified is the partition index for the target partition | 72 | * This call will sleep until the handler being removed is guaranteed to |
89 | // (for VirtualIo, VirtualLan and SessionMgr) other types specify zero) | 73 | * be no longer executing on any CPU. Do not call with locks held. |
90 | extern int HvLpEvent_openPath( HvLpEvent_Type eventType, HvLpIndex lpIndex ); | 74 | * |
75 | * returns 0 on success | ||
76 | * Unregister will fail if there are any paths open for the type | ||
77 | */ | ||
78 | extern int HvLpEvent_unregisterHandler(HvLpEvent_Type eventType); | ||
91 | 79 | ||
80 | /* | ||
81 | * Open an Lp Event Path for an event type | ||
82 | * returns 0 on success | ||
83 | * openPath will fail if there is no handler registered for the event type. | ||
84 | * The lpIndex specified is the partition index for the target partition | ||
85 | * (for VirtualIo, VirtualLan and SessionMgr) other types specify zero) | ||
86 | */ | ||
87 | extern int HvLpEvent_openPath(HvLpEvent_Type eventType, HvLpIndex lpIndex); | ||
92 | 88 | ||
93 | // Close an Lp Event Path for a type and partition | 89 | /* |
94 | // returns 0 on sucess | 90 | * Close an Lp Event Path for a type and partition |
95 | extern int HvLpEvent_closePath( HvLpEvent_Type eventType, HvLpIndex lpIndex ); | 91 | * returns 0 on sucess |
92 | */ | ||
93 | extern int HvLpEvent_closePath(HvLpEvent_Type eventType, HvLpIndex lpIndex); | ||
96 | 94 | ||
97 | #define HvLpEvent_Type_Hypervisor 0 | 95 | #define HvLpEvent_Type_Hypervisor 0 |
98 | #define HvLpEvent_Type_MachineFac 1 | 96 | #define HvLpEvent_Type_MachineFac 1 |
@@ -141,4 +139,4 @@ extern int HvLpEvent_closePath( HvLpEvent_Type eventType, HvLpIndex lpIndex ); | |||
141 | #define HvLpDma_Rc_InvalidAddress 4 | 139 | #define HvLpDma_Rc_InvalidAddress 4 |
142 | #define HvLpDma_Rc_InvalidLength 5 | 140 | #define HvLpDma_Rc_InvalidLength 5 |
143 | 141 | ||
144 | #endif // _HVLPEVENT_H | 142 | #endif /* _HVLPEVENT_H */ |
diff --git a/include/asm-ppc64/iSeries/HvReleaseData.h b/include/asm-ppc64/iSeries/HvReleaseData.h index 183e5e738c26..01a1f13ea4a0 100644 --- a/include/asm-ppc64/iSeries/HvReleaseData.h +++ b/include/asm-ppc64/iSeries/HvReleaseData.h | |||
@@ -1,17 +1,17 @@ | |||
1 | /* | 1 | /* |
2 | * HvReleaseData.h | 2 | * HvReleaseData.h |
3 | * Copyright (C) 2001 Mike Corrigan IBM Corporation | 3 | * Copyright (C) 2001 Mike Corrigan IBM Corporation |
4 | * | 4 | * |
5 | * This program is free software; you can redistribute it and/or modify | 5 | * This program is free software; you can redistribute it and/or modify |
6 | * it under the terms of the GNU General Public License as published by | 6 | * it under the terms of the GNU General Public License as published by |
7 | * the Free Software Foundation; either version 2 of the License, or | 7 | * the Free Software Foundation; either version 2 of the License, or |
8 | * (at your option) any later version. | 8 | * (at your option) any later version. |
9 | * | 9 | * |
10 | * This program is distributed in the hope that it will be useful, | 10 | * This program is distributed in the hope that it will be useful, |
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
13 | * GNU General Public License for more details. | 13 | * GNU General Public License for more details. |
14 | * | 14 | * |
15 | * You should have received a copy of the GNU General Public License | 15 | * You should have received a copy of the GNU General Public License |
16 | * along with this program; if not, write to the Free Software | 16 | * along with this program; if not, write to the Free Software |
17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | 17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
@@ -19,47 +19,45 @@ | |||
19 | #ifndef _HVRELEASEDATA_H | 19 | #ifndef _HVRELEASEDATA_H |
20 | #define _HVRELEASEDATA_H | 20 | #define _HVRELEASEDATA_H |
21 | 21 | ||
22 | //============================================================================= | 22 | /* |
23 | // | 23 | * This control block contains the critical information about the |
24 | // This control block contains the critical information about the | 24 | * release so that it can be changed in the future (ie, the virtual |
25 | // release so that it can be changed in the future (ie, the virtual | 25 | * address of the OS's NACA). |
26 | // address of the OS's NACA). | 26 | */ |
27 | // | ||
28 | #include <asm/types.h> | 27 | #include <asm/types.h> |
29 | #include <asm/naca.h> | 28 | #include <asm/naca.h> |
30 | 29 | ||
31 | //============================================================================= | 30 | /* |
32 | // | 31 | * When we IPL a secondary partition, we will check if if the |
33 | // When we IPL a secondary partition, we will check if if the | 32 | * secondary xMinPlicVrmIndex > the primary xVrmIndex. |
34 | // secondary xMinPlicVrmIndex > the primary xVrmIndex. | 33 | * If it is then this tells PLIC that this secondary is not |
35 | // If it is then this tells PLIC that this secondary is not | 34 | * supported running on this "old" of a level of PLIC. |
36 | // supported running on this "old" of a level of PLIC. | 35 | * |
37 | // | 36 | * Likewise, we will compare the primary xMinSlicVrmIndex to |
38 | // Likewise, we will compare the primary xMinSlicVrmIndex to | 37 | * the secondary xVrmIndex. |
39 | // the secondary xVrmIndex. | 38 | * If the primary xMinSlicVrmDelta > secondary xVrmDelta then we |
40 | // If the primary xMinSlicVrmDelta > secondary xVrmDelta then we | 39 | * know that this PLIC does not support running an OS "that old". |
41 | // know that this PLIC does not support running an OS "that old". | 40 | */ |
42 | // | ||
43 | //============================================================================= | ||
44 | 41 | ||
45 | struct HvReleaseData | 42 | struct HvReleaseData { |
46 | { | 43 | u32 xDesc; /* Descriptor "HvRD" ebcdic x00-x03 */ |
47 | u32 xDesc; // Descriptor "HvRD" ebcdic x00-x03 | 44 | u16 xSize; /* Size of this control block x04-x05 */ |
48 | u16 xSize; // Size of this control block x04-x05 | 45 | u16 xVpdAreasPtrOffset; /* Offset in NACA of ItVpdAreas x06-x07 */ |
49 | u16 xVpdAreasPtrOffset; // Offset in NACA of ItVpdAreas x06-x07 | 46 | struct naca_struct *xSlicNacaAddr; /* Virt addr of SLIC NACA x08-x0F */ |
50 | struct naca_struct * xSlicNacaAddr; // Virt addr of SLIC NACA x08-x0F | 47 | u32 xMsNucDataOffset; /* Offset of Linux Mapping Data x10-x13 */ |
51 | u32 xMsNucDataOffset; // Offset of Linux Mapping Data x10-x13 | 48 | u32 xRsvd1; /* Reserved x14-x17 */ |
52 | u32 xRsvd1; // Reserved x14-x17 | 49 | u16 xTagsMode:1; /* 0 == tags active, 1 == tags inactive */ |
53 | u16 xTagsMode:1; // 0 == tags active, 1 == tags inactive | 50 | u16 xAddressSize:1; /* 0 == 64-bit, 1 == 32-bit */ |
54 | u16 xAddressSize:1; // 0 == 64-bit, 1 == 32-bit | 51 | u16 xNoSharedProcs:1; /* 0 == shared procs, 1 == no shared */ |
55 | u16 xNoSharedProcs:1; // 0 == shared procs, 1 == no shared | 52 | u16 xNoHMT:1; /* 0 == allow HMT, 1 == no HMT */ |
56 | u16 xNoHMT:1; // 0 == allow HMT, 1 == no HMT | 53 | u16 xRsvd2:12; /* Reserved x18-x19 */ |
57 | u16 xRsvd2:12; // Reserved x18-x19 | 54 | u16 xVrmIndex; /* VRM Index of OS image x1A-x1B */ |
58 | u16 xVrmIndex; // VRM Index of OS image x1A-x1B | 55 | u16 xMinSupportedPlicVrmIndex; /* Min PLIC level (soft) x1C-x1D */ |
59 | u16 xMinSupportedPlicVrmIndex;// Min PLIC level (soft) x1C-x1D | 56 | u16 xMinCompatablePlicVrmIndex; /* Min PLIC levelP (hard) x1E-x1F */ |
60 | u16 xMinCompatablePlicVrmIndex;// Min PLIC levelP (hard) x1E-x1F | 57 | char xVrmName[12]; /* Displayable name x20-x2B */ |
61 | char xVrmName[12]; // Displayable name x20-x2B | 58 | char xRsvd3[20]; /* Reserved x2C-x3F */ |
62 | char xRsvd3[20]; // Reserved x2C-x3F | ||
63 | }; | 59 | }; |
64 | 60 | ||
61 | extern struct HvReleaseData hvReleaseData; | ||
62 | |||
65 | #endif /* _HVRELEASEDATA_H */ | 63 | #endif /* _HVRELEASEDATA_H */ |
diff --git a/include/asm-ppc64/iSeries/HvTypes.h b/include/asm-ppc64/iSeries/HvTypes.h index 3ec49c1aec32..b1ef2b4cb3e3 100644 --- a/include/asm-ppc64/iSeries/HvTypes.h +++ b/include/asm-ppc64/iSeries/HvTypes.h | |||
@@ -1,17 +1,17 @@ | |||
1 | /* | 1 | /* |
2 | * HvTypes.h | 2 | * HvTypes.h |
3 | * Copyright (C) 2001 Mike Corrigan IBM Corporation | 3 | * Copyright (C) 2001 Mike Corrigan IBM Corporation |
4 | * | 4 | * |
5 | * This program is free software; you can redistribute it and/or modify | 5 | * This program is free software; you can redistribute it and/or modify |
6 | * it under the terms of the GNU General Public License as published by | 6 | * it under the terms of the GNU General Public License as published by |
7 | * the Free Software Foundation; either version 2 of the License, or | 7 | * the Free Software Foundation; either version 2 of the License, or |
8 | * (at your option) any later version. | 8 | * (at your option) any later version. |
9 | * | 9 | * |
10 | * This program is distributed in the hope that it will be useful, | 10 | * This program is distributed in the hope that it will be useful, |
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
13 | * GNU General Public License for more details. | 13 | * GNU General Public License for more details. |
14 | * | 14 | * |
15 | * You should have received a copy of the GNU General Public License | 15 | * You should have received a copy of the GNU General Public License |
16 | * along with this program; if not, write to the Free Software | 16 | * along with this program; if not, write to the Free Software |
17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | 17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
@@ -19,74 +19,60 @@ | |||
19 | #ifndef _HVTYPES_H | 19 | #ifndef _HVTYPES_H |
20 | #define _HVTYPES_H | 20 | #define _HVTYPES_H |
21 | 21 | ||
22 | //=========================================================================== | 22 | /* |
23 | // Header File Id | 23 | * General typedefs for the hypervisor. |
24 | // Name______________: HvTypes.H | 24 | */ |
25 | // | ||
26 | // Description_______: | ||
27 | // | ||
28 | // General typedefs for the hypervisor. | ||
29 | // | ||
30 | // Declared Class(es): | ||
31 | // | ||
32 | //=========================================================================== | ||
33 | 25 | ||
34 | #include <asm/types.h> | 26 | #include <asm/types.h> |
35 | 27 | ||
36 | //------------------------------------------------------------------- | ||
37 | // Typedefs | ||
38 | //------------------------------------------------------------------- | ||
39 | typedef u8 HvLpIndex; | 28 | typedef u8 HvLpIndex; |
40 | typedef u16 HvLpInstanceId; | 29 | typedef u16 HvLpInstanceId; |
41 | typedef u64 HvLpTOD; | 30 | typedef u64 HvLpTOD; |
42 | typedef u64 HvLpSystemSerialNum; | 31 | typedef u64 HvLpSystemSerialNum; |
43 | typedef u8 HvLpDeviceSerialNum[12]; | 32 | typedef u8 HvLpDeviceSerialNum[12]; |
44 | typedef u16 HvLpSanHwSet; | 33 | typedef u16 HvLpSanHwSet; |
45 | typedef u16 HvLpBus; | 34 | typedef u16 HvLpBus; |
46 | typedef u16 HvLpBoard; | 35 | typedef u16 HvLpBoard; |
47 | typedef u16 HvLpCard; | 36 | typedef u16 HvLpCard; |
48 | typedef u8 HvLpDeviceType[4]; | 37 | typedef u8 HvLpDeviceType[4]; |
49 | typedef u8 HvLpDeviceModel[3]; | 38 | typedef u8 HvLpDeviceModel[3]; |
50 | typedef u64 HvIoToken; | 39 | typedef u64 HvIoToken; |
51 | typedef u8 HvLpName[8]; | 40 | typedef u8 HvLpName[8]; |
52 | typedef u32 HvIoId; | 41 | typedef u32 HvIoId; |
53 | typedef u64 HvRealMemoryIndex; | 42 | typedef u64 HvRealMemoryIndex; |
54 | typedef u32 HvLpIndexMap; // Must hold HvMaxArchitectedLps bits!!! | 43 | typedef u32 HvLpIndexMap; /* Must hold HVMAXARCHITECTEDLPS bits!!! */ |
55 | typedef u16 HvLpVrmIndex; | 44 | typedef u16 HvLpVrmIndex; |
56 | typedef u32 HvXmGenerationId; | 45 | typedef u32 HvXmGenerationId; |
57 | typedef u8 HvLpBusPool; | 46 | typedef u8 HvLpBusPool; |
58 | typedef u8 HvLpSharedPoolIndex; | 47 | typedef u8 HvLpSharedPoolIndex; |
59 | typedef u16 HvLpSharedProcUnitsX100; | 48 | typedef u16 HvLpSharedProcUnitsX100; |
60 | typedef u8 HvLpVirtualLanIndex; | 49 | typedef u8 HvLpVirtualLanIndex; |
61 | typedef u16 HvLpVirtualLanIndexMap; // Must hold HvMaxArchitectedVirtualLans bits!!! | 50 | typedef u16 HvLpVirtualLanIndexMap; /* Must hold HVMAXARCHITECTEDVIRTUALLANS bits!!! */ |
62 | typedef u16 HvBusNumber; // Hypervisor Bus Number | 51 | typedef u16 HvBusNumber; /* Hypervisor Bus Number */ |
63 | typedef u8 HvSubBusNumber; // Hypervisor SubBus Number | 52 | typedef u8 HvSubBusNumber; /* Hypervisor SubBus Number */ |
64 | typedef u8 HvAgentId; // Hypervisor DevFn | 53 | typedef u8 HvAgentId; /* Hypervisor DevFn */ |
54 | |||
65 | 55 | ||
56 | #define HVMAXARCHITECTEDLPS 32 | ||
57 | #define HVMAXARCHITECTEDVIRTUALLANS 16 | ||
58 | #define HVMAXARCHITECTEDVIRTUALDISKS 32 | ||
59 | #define HVMAXARCHITECTEDVIRTUALCDROMS 8 | ||
60 | #define HVMAXARCHITECTEDVIRTUALTAPES 8 | ||
61 | #define HVCHUNKSIZE (256 * 1024) | ||
62 | #define HVPAGESIZE (4 * 1024) | ||
63 | #define HVLPMINMEGSPRIMARY 256 | ||
64 | #define HVLPMINMEGSSECONDARY 64 | ||
65 | #define HVCHUNKSPERMEG 4 | ||
66 | #define HVPAGESPERMEG 256 | ||
67 | #define HVPAGESPERCHUNK 64 | ||
66 | 68 | ||
67 | #define HVMAXARCHITECTEDLPS 32 | ||
68 | #define HVMAXARCHITECTEDVIRTUALLANS 16 | ||
69 | #define HVMAXARCHITECTEDVIRTUALDISKS 32 | ||
70 | #define HVMAXARCHITECTEDVIRTUALCDROMS 8 | ||
71 | #define HVMAXARCHITECTEDVIRTUALTAPES 8 | ||
72 | #define HVCHUNKSIZE 256 * 1024 | ||
73 | #define HVPAGESIZE 4 * 1024 | ||
74 | #define HVLPMINMEGSPRIMARY 256 | ||
75 | #define HVLPMINMEGSSECONDARY 64 | ||
76 | #define HVCHUNKSPERMEG 4 | ||
77 | #define HVPAGESPERMEG 256 | ||
78 | #define HVPAGESPERCHUNK 64 | ||
79 | |||
80 | #define HvMaxArchitectedLps ((HvLpIndex)HVMAXARCHITECTEDLPS) | ||
81 | #define HvMaxArchitectedVirtualLans ((HvLpVirtualLanIndex)16) | ||
82 | #define HvLpIndexInvalid ((HvLpIndex)0xff) | 69 | #define HvLpIndexInvalid ((HvLpIndex)0xff) |
83 | 70 | ||
84 | //-------------------------------------------------------------------- | 71 | /* |
85 | // Enums for the sub-components under PLIC | 72 | * Enums for the sub-components under PLIC |
86 | // Used in HvCall and HvPrimaryCall | 73 | * Used in HvCall and HvPrimaryCall |
87 | //-------------------------------------------------------------------- | 74 | */ |
88 | enum HvCallCompIds | 75 | enum { |
89 | { | ||
90 | HvCallCompId = 0, | 76 | HvCallCompId = 0, |
91 | HvCallCpuCtlsCompId = 1, | 77 | HvCallCpuCtlsCompId = 1, |
92 | HvCallCfgCompId = 2, | 78 | HvCallCfgCompId = 2, |
@@ -97,18 +83,18 @@ enum HvCallCompIds | |||
97 | HvCallSmCompId = 7, | 83 | HvCallSmCompId = 7, |
98 | HvCallSpdCompId = 8, | 84 | HvCallSpdCompId = 8, |
99 | HvCallXmCompId = 9, | 85 | HvCallXmCompId = 9, |
100 | HvCallRioCompId = 10, | 86 | HvCallRioCompId = 10, |
101 | HvCallRsvd3CompId = 11, | 87 | HvCallRsvd3CompId = 11, |
102 | HvCallRsvd2CompId = 12, | 88 | HvCallRsvd2CompId = 12, |
103 | HvCallRsvd1CompId = 13, | 89 | HvCallRsvd1CompId = 13, |
104 | HvCallMaxCompId = 14, | 90 | HvCallMaxCompId = 14, |
105 | HvPrimaryCallCompId = 0, | 91 | HvPrimaryCallCompId = 0, |
106 | HvPrimaryCallCfgCompId = 1, | 92 | HvPrimaryCallCfgCompId = 1, |
107 | HvPrimaryCallPciCompId = 2, | 93 | HvPrimaryCallPciCompId = 2, |
108 | HvPrimaryCallSmCompId = 3, | 94 | HvPrimaryCallSmCompId = 3, |
109 | HvPrimaryCallSpdCompId = 4, | 95 | HvPrimaryCallSpdCompId = 4, |
110 | HvPrimaryCallXmCompId = 5, | 96 | HvPrimaryCallXmCompId = 5, |
111 | HvPrimaryCallRioCompId = 6, | 97 | HvPrimaryCallRioCompId = 6, |
112 | HvPrimaryCallRsvd7CompId = 7, | 98 | HvPrimaryCallRsvd7CompId = 7, |
113 | HvPrimaryCallRsvd6CompId = 8, | 99 | HvPrimaryCallRsvd6CompId = 8, |
114 | HvPrimaryCallRsvd5CompId = 9, | 100 | HvPrimaryCallRsvd5CompId = 9, |
@@ -116,7 +102,7 @@ enum HvCallCompIds | |||
116 | HvPrimaryCallRsvd3CompId = 11, | 102 | HvPrimaryCallRsvd3CompId = 11, |
117 | HvPrimaryCallRsvd2CompId = 12, | 103 | HvPrimaryCallRsvd2CompId = 12, |
118 | HvPrimaryCallRsvd1CompId = 13, | 104 | HvPrimaryCallRsvd1CompId = 13, |
119 | HvPrimaryCallMaxCompId = HvCallMaxCompId | 105 | HvPrimaryCallMaxCompId = HvCallMaxCompId |
120 | }; | 106 | }; |
121 | 107 | ||
122 | struct HvLpBufferList { | 108 | struct HvLpBufferList { |
diff --git a/include/asm-ppc64/iSeries/IoHriMainStore.h b/include/asm-ppc64/iSeries/IoHriMainStore.h index ff00e865f620..45ed3ea67d06 100644 --- a/include/asm-ppc64/iSeries/IoHriMainStore.h +++ b/include/asm-ppc64/iSeries/IoHriMainStore.h | |||
@@ -1,17 +1,17 @@ | |||
1 | /* | 1 | /* |
2 | * IoHriMainStore.h | 2 | * IoHriMainStore.h |
3 | * Copyright (C) 2001 Mike Corrigan IBM Corporation | 3 | * Copyright (C) 2001 Mike Corrigan IBM Corporation |
4 | * | 4 | * |
5 | * This program is free software; you can redistribute it and/or modify | 5 | * This program is free software; you can redistribute it and/or modify |
6 | * it under the terms of the GNU General Public License as published by | 6 | * it under the terms of the GNU General Public License as published by |
7 | * the Free Software Foundation; either version 2 of the License, or | 7 | * the Free Software Foundation; either version 2 of the License, or |
8 | * (at your option) any later version. | 8 | * (at your option) any later version. |
9 | * | 9 | * |
10 | * This program is distributed in the hope that it will be useful, | 10 | * This program is distributed in the hope that it will be useful, |
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
13 | * GNU General Public License for more details. | 13 | * GNU General Public License for more details. |
14 | * | 14 | * |
15 | * You should have received a copy of the GNU General Public License | 15 | * You should have received a copy of the GNU General Public License |
16 | * along with this program; if not, write to the Free Software | 16 | * along with this program; if not, write to the Free Software |
17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | 17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
@@ -21,7 +21,7 @@ | |||
21 | #define _IOHRIMAINSTORE_H | 21 | #define _IOHRIMAINSTORE_H |
22 | 22 | ||
23 | /* Main Store Vpd for Condor,iStar,sStar */ | 23 | /* Main Store Vpd for Condor,iStar,sStar */ |
24 | struct IoHriMainStoreSegment4 { | 24 | struct IoHriMainStoreSegment4 { |
25 | u8 msArea0Exists:1; | 25 | u8 msArea0Exists:1; |
26 | u8 msArea1Exists:1; | 26 | u8 msArea1Exists:1; |
27 | u8 msArea2Exists:1; | 27 | u8 msArea2Exists:1; |
@@ -51,7 +51,7 @@ struct IoHriMainStoreSegment4 { | |||
51 | u8 msArea1HasRiserVpd:1; | 51 | u8 msArea1HasRiserVpd:1; |
52 | u8 msArea2HasRiserVpd:1; | 52 | u8 msArea2HasRiserVpd:1; |
53 | u8 msArea3HasRiserVpd:1; | 53 | u8 msArea3HasRiserVpd:1; |
54 | u8 reserved5:4; | 54 | u8 reserved5:4; |
55 | u8 reserved6; | 55 | u8 reserved6; |
56 | u16 reserved7; | 56 | u16 reserved7; |
57 | 57 | ||
@@ -82,8 +82,8 @@ struct IoHriMainStoreVpdFruData { | |||
82 | }; | 82 | }; |
83 | 83 | ||
84 | struct IoHriMainStoreAdrRangeBlock { | 84 | struct IoHriMainStoreAdrRangeBlock { |
85 | void * blockStart __attribute((packed)); | 85 | void *blockStart __attribute((packed)); |
86 | void * blockEnd __attribute((packed)); | 86 | void *blockEnd __attribute((packed)); |
87 | u32 blockProcChipId __attribute((packed)); | 87 | u32 blockProcChipId __attribute((packed)); |
88 | }; | 88 | }; |
89 | 89 | ||
@@ -102,7 +102,7 @@ struct IoHriMainStoreArea4 { | |||
102 | u32 procNodeId __attribute((packed)); | 102 | u32 procNodeId __attribute((packed)); |
103 | 103 | ||
104 | u32 numAdrRangeBlocks __attribute((packed)); | 104 | u32 numAdrRangeBlocks __attribute((packed)); |
105 | struct IoHriMainStoreAdrRangeBlock xAdrRangeBlock[MaxAreaAdrRangeBlocks] __attribute((packed)); | 105 | struct IoHriMainStoreAdrRangeBlock xAdrRangeBlock[MaxAreaAdrRangeBlocks] __attribute((packed)); |
106 | 106 | ||
107 | struct IoHriMainStoreChipInfo1 chipInfo0 __attribute((packed)); | 107 | struct IoHriMainStoreChipInfo1 chipInfo0 __attribute((packed)); |
108 | struct IoHriMainStoreChipInfo1 chipInfo1 __attribute((packed)); | 108 | struct IoHriMainStoreChipInfo1 chipInfo1 __attribute((packed)); |
@@ -113,17 +113,17 @@ struct IoHriMainStoreArea4 { | |||
113 | struct IoHriMainStoreChipInfo1 chipInfo6 __attribute((packed)); | 113 | struct IoHriMainStoreChipInfo1 chipInfo6 __attribute((packed)); |
114 | struct IoHriMainStoreChipInfo1 chipInfo7 __attribute((packed)); | 114 | struct IoHriMainStoreChipInfo1 chipInfo7 __attribute((packed)); |
115 | 115 | ||
116 | void * msRamAreaArray __attribute((packed)); | 116 | void *msRamAreaArray __attribute((packed)); |
117 | u32 msRamAreaArrayNumEntries __attribute((packed)); | 117 | u32 msRamAreaArrayNumEntries __attribute((packed)); |
118 | u32 msRamAreaArrayEntrySize __attribute((packed)); | 118 | u32 msRamAreaArrayEntrySize __attribute((packed)); |
119 | 119 | ||
120 | u32 numaDimmExists __attribute((packed)); | 120 | u32 numaDimmExists __attribute((packed)); |
121 | u32 numaDimmFunctional __attribute((packed)); | 121 | u32 numaDimmFunctional __attribute((packed)); |
122 | void * numaDimmArray __attribute((packed)); | 122 | void *numaDimmArray __attribute((packed)); |
123 | u32 numaDimmArrayNumEntries __attribute((packed)); | 123 | u32 numaDimmArrayNumEntries __attribute((packed)); |
124 | u32 numaDimmArrayEntrySize __attribute((packed)); | 124 | u32 numaDimmArrayEntrySize __attribute((packed)); |
125 | 125 | ||
126 | struct IoHriMainStoreVpdIdData idData __attribute((packed)); | 126 | struct IoHriMainStoreVpdIdData idData __attribute((packed)); |
127 | 127 | ||
128 | u64 powerData __attribute((packed)); | 128 | u64 powerData __attribute((packed)); |
129 | u64 cardAssemblyPartNum __attribute((packed)); | 129 | u64 cardAssemblyPartNum __attribute((packed)); |
@@ -143,7 +143,7 @@ struct IoHriMainStoreArea4 { | |||
143 | }; | 143 | }; |
144 | 144 | ||
145 | 145 | ||
146 | struct IoHriMainStoreSegment5 { | 146 | struct IoHriMainStoreSegment5 { |
147 | u16 reserved1; | 147 | u16 reserved1; |
148 | u8 reserved2; | 148 | u8 reserved2; |
149 | u8 msVpdFormat; | 149 | u8 msVpdFormat; |
@@ -151,17 +151,16 @@ struct IoHriMainStoreSegment5 { | |||
151 | u32 totalMainStore; | 151 | u32 totalMainStore; |
152 | u64 maxConfiguredMsAdr; | 152 | u64 maxConfiguredMsAdr; |
153 | 153 | ||
154 | struct IoHriMainStoreArea4* msAreaArray; | 154 | struct IoHriMainStoreArea4 *msAreaArray; |
155 | u32 msAreaArrayNumEntries; | 155 | u32 msAreaArrayNumEntries; |
156 | u32 msAreaArrayEntrySize; | 156 | u32 msAreaArrayEntrySize; |
157 | 157 | ||
158 | u32 msAreaExists; | 158 | u32 msAreaExists; |
159 | u32 msAreaFunctional; | 159 | u32 msAreaFunctional; |
160 | 160 | ||
161 | u64 reserved3; | 161 | u64 reserved3; |
162 | }; | 162 | }; |
163 | 163 | ||
164 | extern u64 xMsVpd[]; | ||
164 | 165 | ||
165 | 166 | #endif /* _IOHRIMAINSTORE_H */ | |
166 | #endif // _IOHRIMAINSTORE_H | ||
167 | |||
diff --git a/include/asm-ppc64/iSeries/IoHriProcessorVpd.h b/include/asm-ppc64/iSeries/IoHriProcessorVpd.h index 965433888653..73b73d80b8b1 100644 --- a/include/asm-ppc64/iSeries/IoHriProcessorVpd.h +++ b/include/asm-ppc64/iSeries/IoHriProcessorVpd.h | |||
@@ -1,17 +1,17 @@ | |||
1 | /* | 1 | /* |
2 | * IoHriProcessorVpd.h | 2 | * IoHriProcessorVpd.h |
3 | * Copyright (C) 2001 Mike Corrigan IBM Corporation | 3 | * Copyright (C) 2001 Mike Corrigan IBM Corporation |
4 | * | 4 | * |
5 | * This program is free software; you can redistribute it and/or modify | 5 | * This program is free software; you can redistribute it and/or modify |
6 | * it under the terms of the GNU General Public License as published by | 6 | * it under the terms of the GNU General Public License as published by |
7 | * the Free Software Foundation; either version 2 of the License, or | 7 | * the Free Software Foundation; either version 2 of the License, or |
8 | * (at your option) any later version. | 8 | * (at your option) any later version. |
9 | * | 9 | * |
10 | * This program is distributed in the hope that it will be useful, | 10 | * This program is distributed in the hope that it will be useful, |
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
13 | * GNU General Public License for more details. | 13 | * GNU General Public License for more details. |
14 | * | 14 | * |
15 | * You should have received a copy of the GNU General Public License | 15 | * You should have received a copy of the GNU General Public License |
16 | * along with this program; if not, write to the Free Software | 16 | * along with this program; if not, write to the Free Software |
17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | 17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
@@ -19,16 +19,12 @@ | |||
19 | #ifndef _IOHRIPROCESSORVPD_H | 19 | #ifndef _IOHRIPROCESSORVPD_H |
20 | #define _IOHRIPROCESSORVPD_H | 20 | #define _IOHRIPROCESSORVPD_H |
21 | 21 | ||
22 | //=================================================================== | ||
23 | // | ||
24 | // This struct maps Processor Vpd that is DMAd to SLIC by CSP | ||
25 | // | ||
26 | |||
27 | #include <asm/types.h> | 22 | #include <asm/types.h> |
28 | 23 | ||
29 | struct IoHriProcessorVpd | 24 | /* |
30 | { | 25 | * This struct maps Processor Vpd that is DMAd to SLIC by CSP |
31 | 26 | */ | |
27 | struct IoHriProcessorVpd { | ||
32 | u8 xFormat; // VPD format indicator x00-x00 | 28 | u8 xFormat; // VPD format indicator x00-x00 |
33 | u8 xProcStatus:8; // Processor State x01-x01 | 29 | u8 xProcStatus:8; // Processor State x01-x01 |
34 | u8 xSecondaryThreadCount; // Secondary thread cnt x02-x02 | 30 | u8 xSecondaryThreadCount; // Secondary thread cnt x02-x02 |
@@ -40,12 +36,12 @@ struct IoHriProcessorVpd | |||
40 | u16 xRsvd2; // Reserved x06-x07 | 36 | u16 xRsvd2; // Reserved x06-x07 |
41 | u32 xHwNodeId; // Hardware node id x08-x0B | 37 | u32 xHwNodeId; // Hardware node id x08-x0B |
42 | u32 xHwProcId; // Hardware processor id x0C-x0F | 38 | u32 xHwProcId; // Hardware processor id x0C-x0F |
43 | 39 | ||
44 | u32 xTypeNum; // Card Type/CCIN number x10-x13 | 40 | u32 xTypeNum; // Card Type/CCIN number x10-x13 |
45 | u32 xModelNum; // Model/Feature number x14-x17 | 41 | u32 xModelNum; // Model/Feature number x14-x17 |
46 | u64 xSerialNum; // Serial number x18-x1F | 42 | u64 xSerialNum; // Serial number x18-x1F |
47 | char xPartNum[12]; // Book Part or FPU number x20-x2B | 43 | char xPartNum[12]; // Book Part or FPU number x20-x2B |
48 | char xMfgID[4]; // Manufacturing ID x2C-x2F | 44 | char xMfgID[4]; // Manufacturing ID x2C-x2F |
49 | 45 | ||
50 | u32 xProcFreq; // Processor Frequency x30-x33 | 46 | u32 xProcFreq; // Processor Frequency x30-x33 |
51 | u32 xTimeBaseFreq; // Time Base Frequency x34-x37 | 47 | u32 xTimeBaseFreq; // Time Base Frequency x34-x37 |
@@ -71,7 +67,7 @@ struct IoHriProcessorVpd | |||
71 | u32 xDataL3CacheSizeKB; // L3 data cache size in KB x80-x83 | 67 | u32 xDataL3CacheSizeKB; // L3 data cache size in KB x80-x83 |
72 | u32 xDataL3CacheLineSize; // L3 data cache block size x84-x87 | 68 | u32 xDataL3CacheLineSize; // L3 data cache block size x84-x87 |
73 | u64 xRsvd6; // Reserved x88-x8F | 69 | u64 xRsvd6; // Reserved x88-x8F |
74 | 70 | ||
75 | u64 xFruLabel; // Card Location Label x90-x97 | 71 | u64 xFruLabel; // Card Location Label x90-x97 |
76 | u8 xSlotsOnCard; // Slots on card (0=no slots) x98-x98 | 72 | u8 xSlotsOnCard; // Slots on card (0=no slots) x98-x98 |
77 | u8 xPartLocFlag; // Location flag (0-pluggable 1-imbedded) x99-x99 | 73 | u8 xPartLocFlag; // Location flag (0-pluggable 1-imbedded) x99-x99 |
@@ -79,10 +75,12 @@ struct IoHriProcessorVpd | |||
79 | u8 xSmartCardPortNo; // Smart card port number x9C-x9C | 75 | u8 xSmartCardPortNo; // Smart card port number x9C-x9C |
80 | u8 xRsvd7; // Reserved x9D-x9D | 76 | u8 xRsvd7; // Reserved x9D-x9D |
81 | u16 xFrameIdAndRackUnit; // Frame ID and rack unit adr x9E-x9F | 77 | u16 xFrameIdAndRackUnit; // Frame ID and rack unit adr x9E-x9F |
82 | 78 | ||
83 | u8 xRsvd8[24]; // Reserved xA0-xB7 | 79 | u8 xRsvd8[24]; // Reserved xA0-xB7 |
84 | 80 | ||
85 | char xProcSrc[72]; // CSP format SRC xB8-xFF | 81 | char xProcSrc[72]; // CSP format SRC xB8-xFF |
86 | }; | 82 | }; |
87 | 83 | ||
84 | extern struct IoHriProcessorVpd xIoHriProcessorVpd[]; | ||
85 | |||
88 | #endif /* _IOHRIPROCESSORVPD_H */ | 86 | #endif /* _IOHRIPROCESSORVPD_H */ |
diff --git a/include/asm-ppc64/iSeries/ItExtVpdPanel.h b/include/asm-ppc64/iSeries/ItExtVpdPanel.h index dee6b1273031..4c546a8802b4 100644 --- a/include/asm-ppc64/iSeries/ItExtVpdPanel.h +++ b/include/asm-ppc64/iSeries/ItExtVpdPanel.h | |||
@@ -1,17 +1,17 @@ | |||
1 | /* | 1 | /* |
2 | * ItExtVpdPanel.h | 2 | * ItExtVpdPanel.h |
3 | * Copyright (C) 2002 Dave Boutcher IBM Corporation | 3 | * Copyright (C) 2002 Dave Boutcher IBM Corporation |
4 | * | 4 | * |
5 | * This program is free software; you can redistribute it and/or modify | 5 | * This program is free software; you can redistribute it and/or modify |
6 | * it under the terms of the GNU General Public License as published by | 6 | * it under the terms of the GNU General Public License as published by |
7 | * the Free Software Foundation; either version 2 of the License, or | 7 | * the Free Software Foundation; either version 2 of the License, or |
8 | * (at your option) any later version. | 8 | * (at your option) any later version. |
9 | * | 9 | * |
10 | * This program is distributed in the hope that it will be useful, | 10 | * This program is distributed in the hope that it will be useful, |
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
13 | * GNU General Public License for more details. | 13 | * GNU General Public License for more details. |
14 | * | 14 | * |
15 | * You should have received a copy of the GNU General Public License | 15 | * You should have received a copy of the GNU General Public License |
16 | * along with this program; if not, write to the Free Software | 16 | * along with this program; if not, write to the Free Software |
17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | 17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
@@ -20,39 +20,33 @@ | |||
20 | #define _ITEXTVPDPANEL_H | 20 | #define _ITEXTVPDPANEL_H |
21 | 21 | ||
22 | /* | 22 | /* |
23 | * | 23 | * This struct maps the panel information |
24 | * This struct maps the panel information | ||
25 | * | 24 | * |
26 | * Warning: | 25 | * Warning: |
27 | * This data must match the architecture for the panel information | 26 | * This data must match the architecture for the panel information |
28 | * | ||
29 | */ | 27 | */ |
30 | 28 | ||
31 | |||
32 | /*------------------------------------------------------------------- | ||
33 | * Standard Includes | ||
34 | *------------------------------------------------------------------- | ||
35 | */ | ||
36 | #include <asm/types.h> | 29 | #include <asm/types.h> |
37 | 30 | ||
38 | struct ItExtVpdPanel | 31 | struct ItExtVpdPanel { |
39 | { | 32 | /* Definition of the Extended Vpd On Panel Data Area */ |
40 | // Definition of the Extended Vpd On Panel Data Area | 33 | char systemSerial[8]; |
41 | char systemSerial[8]; | 34 | char mfgID[4]; |
42 | char mfgID[4]; | 35 | char reserved1[24]; |
43 | char reserved1[24]; | 36 | char machineType[4]; |
44 | char machineType[4]; | 37 | char systemID[6]; |
45 | char systemID[6]; | 38 | char somUniqueCnt[4]; |
46 | char somUniqueCnt[4]; | 39 | char serialNumberCount; |
47 | char serialNumberCount; | 40 | char reserved2[7]; |
48 | char reserved2[7]; | 41 | u16 bbu3; |
49 | u16 bbu3; | 42 | u16 bbu2; |
50 | u16 bbu2; | 43 | u16 bbu1; |
51 | u16 bbu1; | 44 | char xLocationLabel[8]; |
52 | char xLocationLabel[8]; | 45 | u8 xRsvd1[6]; |
53 | u8 xRsvd1[6]; | 46 | u16 xFrameId; |
54 | u16 xFrameId; | 47 | u8 xRsvd2[48]; |
55 | u8 xRsvd2[48]; | ||
56 | }; | 48 | }; |
57 | 49 | ||
58 | #endif /* _ITEXTVPDPANEL_H */ | 50 | extern struct ItExtVpdPanel xItExtVpdPanel; |
51 | |||
52 | #endif /* _ITEXTVPDPANEL_H */ | ||
diff --git a/include/asm-ppc64/iSeries/ItIplParmsReal.h b/include/asm-ppc64/iSeries/ItIplParmsReal.h index 4d8b430ab12d..ae3417dc599e 100644 --- a/include/asm-ppc64/iSeries/ItIplParmsReal.h +++ b/include/asm-ppc64/iSeries/ItIplParmsReal.h | |||
@@ -1,17 +1,17 @@ | |||
1 | /* | 1 | /* |
2 | * ItIplParmsReal.h | 2 | * ItIplParmsReal.h |
3 | * Copyright (C) 2001 Mike Corrigan IBM Corporation | 3 | * Copyright (C) 2001 Mike Corrigan IBM Corporation |
4 | * | 4 | * |
5 | * This program is free software; you can redistribute it and/or modify | 5 | * This program is free software; you can redistribute it and/or modify |
6 | * it under the terms of the GNU General Public License as published by | 6 | * it under the terms of the GNU General Public License as published by |
7 | * the Free Software Foundation; either version 2 of the License, or | 7 | * the Free Software Foundation; either version 2 of the License, or |
8 | * (at your option) any later version. | 8 | * (at your option) any later version. |
9 | * | 9 | * |
10 | * This program is distributed in the hope that it will be useful, | 10 | * This program is distributed in the hope that it will be useful, |
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
13 | * GNU General Public License for more details. | 13 | * GNU General Public License for more details. |
14 | * | 14 | * |
15 | * You should have received a copy of the GNU General Public License | 15 | * You should have received a copy of the GNU General Public License |
16 | * along with this program; if not, write to the Free Software | 16 | * along with this program; if not, write to the Free Software |
17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | 17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
@@ -19,58 +19,53 @@ | |||
19 | #ifndef _ITIPLPARMSREAL_H | 19 | #ifndef _ITIPLPARMSREAL_H |
20 | #define _ITIPLPARMSREAL_H | 20 | #define _ITIPLPARMSREAL_H |
21 | 21 | ||
22 | //============================================================================== | 22 | /* |
23 | // | 23 | * This struct maps the IPL Parameters DMA'd from the SP. |
24 | // This struct maps the IPL Parameters DMA'd from the SP. | 24 | * |
25 | // | 25 | * Warning: |
26 | // Warning: | 26 | * This data must map in exactly 64 bytes and match the architecture for |
27 | // This data must map in exactly 64 bytes and match the architecture for | 27 | * the IPL parms |
28 | // the IPL parms | 28 | */ |
29 | // | ||
30 | //============================================================================= | ||
31 | |||
32 | 29 | ||
33 | //------------------------------------------------------------------- | ||
34 | // Standard Includes | ||
35 | //------------------------------------------------------------------- | ||
36 | #include <asm/types.h> | 30 | #include <asm/types.h> |
37 | 31 | ||
38 | struct ItIplParmsReal | 32 | struct ItIplParmsReal { |
39 | { | 33 | u8 xFormat; // Defines format of IplParms x00-x00 |
40 | u8 xFormat; // Defines format of IplParms x00-x00 | 34 | u8 xRsvd01:6; // Reserved x01-x01 |
41 | u8 xRsvd01:6; // Reserved x01-x01 | 35 | u8 xAlternateSearch:1; // Alternate search indicator ... |
42 | u8 xAlternateSearch:1; // Alternate search indicator ... | 36 | u8 xUaSupplied:1; // UA Supplied on programmed IPL... |
43 | u8 xUaSupplied:1; // UA Supplied on programmed IPL ... | 37 | u8 xLsUaFormat; // Format byte for UA x02-x02 |
44 | u8 xLsUaFormat; // Format byte for UA x02-x02 | 38 | u8 xRsvd02; // Reserved x03-x03 |
45 | u8 xRsvd02; // Reserved x03-x03 | 39 | u32 xLsUa; // LS UA x04-x07 |
46 | u32 xLsUa; // LS UA x04-x07 | 40 | u32 xUnusedLsLid; // First OS LID to load x08-x0B |
47 | u32 xUnusedLsLid; // First OS LID to load x08-x0B | 41 | u16 xLsBusNumber; // LS Bus Number x0C-x0D |
48 | u16 xLsBusNumber; // LS Bus Number x0C-x0D | 42 | u8 xLsCardAdr; // LS Card Address x0E-x0E |
49 | u8 xLsCardAdr; // LS Card Address x0E-x0E | 43 | u8 xLsBoardAdr; // LS Board Address x0F-x0F |
50 | u8 xLsBoardAdr; // LS Board Address x0F-x0F | 44 | u32 xRsvd03; // Reserved x10-x13 |
51 | u32 xRsvd03; // Reserved x10-x13 | 45 | u8 xSpcnPresent:1; // SPCN present x14-x14 |
52 | u8 xSpcnPresent:1; // SPCN present x14-x14 | 46 | u8 xCpmPresent:1; // CPM present ... |
53 | u8 xCpmPresent:1; // CPM present ... | 47 | u8 xRsvd04:6; // Reserved ... |
54 | u8 xRsvd04:6; // Reserved ... | 48 | u8 xRsvd05:4; // Reserved x15-x15 |
55 | u8 xRsvd05:4; // Reserved x15-x15 | 49 | u8 xKeyLock:4; // Keylock setting ... |
56 | u8 xKeyLock:4; // Keylock setting ... | 50 | u8 xRsvd06:6; // Reserved x16-x16 |
57 | u8 xRsvd06:6; // Reserved x16-x16 | 51 | u8 xIplMode:2; // Ipl mode (A|B|C|D) ... |
58 | u8 xIplMode:2; // Ipl mode (A|B|C|D) ... | 52 | u8 xHwIplType; // Fast v slow v slow EC HW IPL x17-x17 |
59 | u8 xHwIplType; // Fast v slow v slow EC HW IPL x17-x17 | 53 | u16 xCpmEnabledIpl:1; // CPM in effect when IPL initiatedx18-x19 |
60 | u16 xCpmEnabledIpl:1; // CPM in effect when IPL initiated x18-x19 | 54 | u16 xPowerOnResetIpl:1; // Indicate POR condition ... |
61 | u16 xPowerOnResetIpl:1; // Indicate POR condition ... | 55 | u16 xMainStorePreserved:1; // Main Storage is preserved ... |
62 | u16 xMainStorePreserved:1; // Main Storage is preserved ... | 56 | u16 xRsvd07:13; // Reserved ... |
63 | u16 xRsvd07:13; // Reserved ... | 57 | u16 xIplSource:16; // Ipl source x1A-x1B |
64 | u16 xIplSource:16; // Ipl source x1A-x1B | 58 | u8 xIplReason:8; // Reason for this IPL x1C-x1C |
65 | u8 xIplReason:8; // Reason for this IPL x1C-x1C | 59 | u8 xRsvd08; // Reserved x1D-x1D |
66 | u8 xRsvd08; // Reserved x1D-x1D | 60 | u16 xRsvd09; // Reserved x1E-x1F |
67 | u16 xRsvd09; // Reserved x1E-x1F | 61 | u16 xSysBoxType; // System Box Type x20-x21 |
68 | u16 xSysBoxType; // System Box Type x20-x21 | 62 | u16 xSysProcType; // System Processor Type x22-x23 |
69 | u16 xSysProcType; // System Processor Type x22-x23 | 63 | u32 xRsvd10; // Reserved x24-x27 |
70 | u32 xRsvd10; // Reserved x24-x27 | 64 | u64 xRsvd11; // Reserved x28-x2F |
71 | u64 xRsvd11; // Reserved x28-x2F | 65 | u64 xRsvd12; // Reserved x30-x37 |
72 | u64 xRsvd12; // Reserved x30-x37 | 66 | u64 xRsvd13; // Reserved x38-x3F |
73 | u64 xRsvd13; // Reserved x38-x3F | ||
74 | }; | 67 | }; |
75 | 68 | ||
69 | extern struct ItIplParmsReal xItIplParmsReal; | ||
70 | |||
76 | #endif /* _ITIPLPARMSREAL_H */ | 71 | #endif /* _ITIPLPARMSREAL_H */ |
diff --git a/include/asm-ppc64/iSeries/ItLpNaca.h b/include/asm-ppc64/iSeries/ItLpNaca.h index 5baffddfae1b..225d0176779d 100644 --- a/include/asm-ppc64/iSeries/ItLpNaca.h +++ b/include/asm-ppc64/iSeries/ItLpNaca.h | |||
@@ -1,17 +1,17 @@ | |||
1 | /* | 1 | /* |
2 | * ItLpNaca.h | 2 | * ItLpNaca.h |
3 | * Copyright (C) 2001 Mike Corrigan IBM Corporation | 3 | * Copyright (C) 2001 Mike Corrigan IBM Corporation |
4 | * | 4 | * |
5 | * This program is free software; you can redistribute it and/or modify | 5 | * This program is free software; you can redistribute it and/or modify |
6 | * it under the terms of the GNU General Public License as published by | 6 | * it under the terms of the GNU General Public License as published by |
7 | * the Free Software Foundation; either version 2 of the License, or | 7 | * the Free Software Foundation; either version 2 of the License, or |
8 | * (at your option) any later version. | 8 | * (at your option) any later version. |
9 | * | 9 | * |
10 | * This program is distributed in the hope that it will be useful, | 10 | * This program is distributed in the hope that it will be useful, |
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
13 | * GNU General Public License for more details. | 13 | * GNU General Public License for more details. |
14 | * | 14 | * |
15 | * You should have received a copy of the GNU General Public License | 15 | * You should have received a copy of the GNU General Public License |
16 | * along with this program; if not, write to the Free Software | 16 | * along with this program; if not, write to the Free Software |
17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | 17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
@@ -19,18 +19,15 @@ | |||
19 | #ifndef _ITLPNACA_H | 19 | #ifndef _ITLPNACA_H |
20 | #define _ITLPNACA_H | 20 | #define _ITLPNACA_H |
21 | 21 | ||
22 | //============================================================================= | 22 | #include <linux/types.h> |
23 | // | ||
24 | // This control block contains the data that is shared between the | ||
25 | // hypervisor (PLIC) and the OS. | ||
26 | // | ||
27 | //============================================================================= | ||
28 | 23 | ||
29 | struct ItLpNaca | 24 | /* |
30 | { | 25 | * This control block contains the data that is shared between the |
31 | //============================================================================= | 26 | * hypervisor (PLIC) and the OS. |
27 | */ | ||
28 | |||
29 | struct ItLpNaca { | ||
32 | // CACHE_LINE_1 0x0000 - 0x007F Contains read-only data | 30 | // CACHE_LINE_1 0x0000 - 0x007F Contains read-only data |
33 | //============================================================================= | ||
34 | u32 xDesc; // Eye catcher x00-x03 | 31 | u32 xDesc; // Eye catcher x00-x03 |
35 | u16 xSize; // Size of this class x04-x05 | 32 | u16 xSize; // Size of this class x04-x05 |
36 | u16 xIntHdlrOffset; // Offset to IntHdlr array x06-x07 | 33 | u16 xIntHdlrOffset; // Offset to IntHdlr array x06-x07 |
@@ -59,30 +56,25 @@ struct ItLpNaca | |||
59 | u64 xLoadAreaAddr; // ER address of load area x28-x2F | 56 | u64 xLoadAreaAddr; // ER address of load area x28-x2F |
60 | u32 xLoadAreaChunks; // Chunks for the load area x30-x33 | 57 | u32 xLoadAreaChunks; // Chunks for the load area x30-x33 |
61 | u32 xPaseSysCallCRMask; // Mask used to test CR before x34-x37 | 58 | u32 xPaseSysCallCRMask; // Mask used to test CR before x34-x37 |
62 | // doing an ASR switch on PASE | 59 | // doing an ASR switch on PASE |
63 | // system call. | 60 | // system call. |
64 | u64 xSlicSegmentTablePtr; // Pointer to Slic seg table. x38-x3f | 61 | u64 xSlicSegmentTablePtr; // Pointer to Slic seg table. x38-x3f |
65 | u8 xRsvd1_4[64]; // x40-x7F | 62 | u8 xRsvd1_4[64]; // x40-x7F |
66 | 63 | ||
67 | //============================================================================= | ||
68 | // CACHE_LINE_2 0x0080 - 0x00FF Contains local read-write data | 64 | // CACHE_LINE_2 0x0080 - 0x00FF Contains local read-write data |
69 | //============================================================================= | ||
70 | u8 xRsvd2_0[128]; // Reserved x00-x7F | 65 | u8 xRsvd2_0[128]; // Reserved x00-x7F |
71 | 66 | ||
72 | //============================================================================= | ||
73 | // CACHE_LINE_3-6 0x0100 - 0x02FF Contains LP Queue indicators | 67 | // CACHE_LINE_3-6 0x0100 - 0x02FF Contains LP Queue indicators |
74 | // NB: Padding required to keep xInterrruptHdlr at x300 which is required | 68 | // NB: Padding required to keep xInterrruptHdlr at x300 which is required |
75 | // for v4r4 PLIC. | 69 | // for v4r4 PLIC. |
76 | //============================================================================= | ||
77 | u8 xOldLpQueue[128]; // LP Queue needed for v4r4 100-17F | 70 | u8 xOldLpQueue[128]; // LP Queue needed for v4r4 100-17F |
78 | u8 xRsvd3_0[384]; // Reserved 180-2FF | 71 | u8 xRsvd3_0[384]; // Reserved 180-2FF |
79 | //============================================================================= | 72 | |
80 | // CACHE_LINE_7-8 0x0300 - 0x03FF Contains the address of the OS interrupt | 73 | // CACHE_LINE_7-8 0x0300 - 0x03FF Contains the address of the OS interrupt |
81 | // handlers | 74 | // handlers |
82 | //============================================================================= | ||
83 | u64 xInterruptHdlr[32]; // Interrupt handlers 300-x3FF | 75 | u64 xInterruptHdlr[32]; // Interrupt handlers 300-x3FF |
84 | }; | 76 | }; |
85 | 77 | ||
86 | //============================================================================= | 78 | extern struct ItLpNaca itLpNaca; |
87 | 79 | ||
88 | #endif /* _ITLPNACA_H */ | 80 | #endif /* _ITLPNACA_H */ |
diff --git a/include/asm-ppc64/iSeries/ItLpQueue.h b/include/asm-ppc64/iSeries/ItLpQueue.h index 4f4dde2a638d..393299e04d7f 100644 --- a/include/asm-ppc64/iSeries/ItLpQueue.h +++ b/include/asm-ppc64/iSeries/ItLpQueue.h | |||
@@ -1,17 +1,17 @@ | |||
1 | /* | 1 | /* |
2 | * ItLpQueue.h | 2 | * ItLpQueue.h |
3 | * Copyright (C) 2001 Mike Corrigan IBM Corporation | 3 | * Copyright (C) 2001 Mike Corrigan IBM Corporation |
4 | * | 4 | * |
5 | * This program is free software; you can redistribute it and/or modify | 5 | * This program is free software; you can redistribute it and/or modify |
6 | * it under the terms of the GNU General Public License as published by | 6 | * it under the terms of the GNU General Public License as published by |
7 | * the Free Software Foundation; either version 2 of the License, or | 7 | * the Free Software Foundation; either version 2 of the License, or |
8 | * (at your option) any later version. | 8 | * (at your option) any later version. |
9 | * | 9 | * |
10 | * This program is distributed in the hope that it will be useful, | 10 | * This program is distributed in the hope that it will be useful, |
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
13 | * GNU General Public License for more details. | 13 | * GNU General Public License for more details. |
14 | * | 14 | * |
15 | * You should have received a copy of the GNU General Public License | 15 | * You should have received a copy of the GNU General Public License |
16 | * along with this program; if not, write to the Free Software | 16 | * along with this program; if not, write to the Free Software |
17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | 17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
@@ -19,54 +19,54 @@ | |||
19 | #ifndef _ITLPQUEUE_H | 19 | #ifndef _ITLPQUEUE_H |
20 | #define _ITLPQUEUE_H | 20 | #define _ITLPQUEUE_H |
21 | 21 | ||
22 | //============================================================================= | 22 | /* |
23 | // | 23 | * This control block defines the simple LP queue structure that is |
24 | // This control block defines the simple LP queue structure that is | 24 | * shared between the hypervisor (PLIC) and the OS in order to send |
25 | // shared between the hypervisor (PLIC) and the OS in order to send | 25 | * events to an LP. |
26 | // events to an LP. | 26 | */ |
27 | // | ||
28 | 27 | ||
29 | #include <asm/types.h> | 28 | #include <asm/types.h> |
30 | #include <asm/ptrace.h> | 29 | #include <asm/ptrace.h> |
31 | 30 | ||
32 | struct HvLpEvent; | 31 | struct HvLpEvent; |
33 | 32 | ||
34 | #define ITMaxLpQueues 8 | 33 | #define ITMaxLpQueues 8 |
35 | 34 | ||
36 | #define NotUsed 0 // Queue will not be used by PLIC | 35 | #define NotUsed 0 // Queue will not be used by PLIC |
37 | #define DedicatedIo 1 // Queue dedicated to IO processor specified | 36 | #define DedicatedIo 1 // Queue dedicated to IO processor specified |
38 | #define DedicatedLp 2 // Queue dedicated to LP specified | 37 | #define DedicatedLp 2 // Queue dedicated to LP specified |
39 | #define Shared 3 // Queue shared for both IO and LP | 38 | #define Shared 3 // Queue shared for both IO and LP |
40 | 39 | ||
41 | #define LpEventStackSize 4096 | 40 | #define LpEventStackSize 4096 |
42 | #define LpEventMaxSize 256 | 41 | #define LpEventMaxSize 256 |
43 | #define LpEventAlign 64 | 42 | #define LpEventAlign 64 |
44 | 43 | ||
45 | struct ItLpQueue | 44 | struct ItLpQueue { |
46 | { | 45 | /* |
47 | // | 46 | * The xSlicCurEventPtr is the pointer to the next event stack entry |
48 | // The xSlicCurEventPtr is the pointer to the next event stack entry that will | 47 | * that will become valid. The OS must peek at this entry to determine |
49 | // become valid. The OS must peek at this entry to determine if it is valid. | 48 | * if it is valid. PLIC will set the valid indicator as the very last |
50 | // PLIC will set the valid indicator as the very last store into that entry. | 49 | * store into that entry. |
51 | // | 50 | * |
52 | // When the OS has completed processing of the event then it will mark the event | 51 | * When the OS has completed processing of the event then it will mark |
53 | // as invalid so that PLIC knows it can store into that event location again. | 52 | * the event as invalid so that PLIC knows it can store into that event |
54 | // | 53 | * location again. |
55 | // If the event stack fills and there are overflow events, then PLIC will set | 54 | * |
56 | // the xPlicOverflowIntPending flag in which case the OS will have to fetch the | 55 | * If the event stack fills and there are overflow events, then PLIC |
57 | // additional LP events once they have drained the event stack. | 56 | * will set the xPlicOverflowIntPending flag in which case the OS will |
58 | // | 57 | * have to fetch the additional LP events once they have drained the |
59 | // The first 16-bytes are known by both the OS and PLIC. The remainder of the | 58 | * event stack. |
60 | // cache line is for use by the OS. | 59 | * |
61 | // | 60 | * The first 16-bytes are known by both the OS and PLIC. The remainder |
62 | //============================================================================= | 61 | * of the cache line is for use by the OS. |
62 | */ | ||
63 | u8 xPlicOverflowIntPending;// 0x00 Overflow events are pending | 63 | u8 xPlicOverflowIntPending;// 0x00 Overflow events are pending |
64 | u8 xPlicStatus; // 0x01 DedicatedIo or DedicatedLp or NotUsed | 64 | u8 xPlicStatus; // 0x01 DedicatedIo or DedicatedLp or NotUsed |
65 | u16 xSlicLogicalProcIndex; // 0x02 Logical Proc Index for correlation | 65 | u16 xSlicLogicalProcIndex; // 0x02 Logical Proc Index for correlation |
66 | u8 xPlicRsvd[12]; // 0x04 | 66 | u8 xPlicRsvd[12]; // 0x04 |
67 | char* xSlicCurEventPtr; // 0x10 | 67 | char *xSlicCurEventPtr; // 0x10 |
68 | char* xSlicLastValidEventPtr; // 0x18 | 68 | char *xSlicLastValidEventPtr; // 0x18 |
69 | char* xSlicEventStackPtr; // 0x20 | 69 | char *xSlicEventStackPtr; // 0x20 |
70 | u8 xIndex; // 0x28 unique sequential index. | 70 | u8 xIndex; // 0x28 unique sequential index. |
71 | u8 xSlicRsvd[3]; // 0x29-2b | 71 | u8 xSlicRsvd[3]; // 0x29-2b |
72 | u32 xInUseWord; // 0x2C | 72 | u32 xInUseWord; // 0x2C |
@@ -76,17 +76,9 @@ struct ItLpQueue | |||
76 | 76 | ||
77 | extern struct ItLpQueue xItLpQueue; | 77 | extern struct ItLpQueue xItLpQueue; |
78 | 78 | ||
79 | extern struct HvLpEvent * ItLpQueue_getNextLpEvent( struct ItLpQueue * ); | 79 | extern struct HvLpEvent *ItLpQueue_getNextLpEvent(struct ItLpQueue *); |
80 | extern int ItLpQueue_isLpIntPending( struct ItLpQueue * ); | 80 | extern int ItLpQueue_isLpIntPending(struct ItLpQueue *); |
81 | extern unsigned ItLpQueue_process( struct ItLpQueue *, struct pt_regs * ); | 81 | extern unsigned ItLpQueue_process(struct ItLpQueue *, struct pt_regs *); |
82 | extern void ItLpQueue_clearValid( struct HvLpEvent * ); | 82 | extern void ItLpQueue_clearValid(struct HvLpEvent *); |
83 | |||
84 | static __inline__ void process_iSeries_events( void ) | ||
85 | { | ||
86 | __asm__ __volatile__ ( | ||
87 | " li 0,0x5555 \n\ | ||
88 | sc" | ||
89 | : : : "r0", "r3" ); | ||
90 | } | ||
91 | 83 | ||
92 | #endif /* _ITLPQUEUE_H */ | 84 | #endif /* _ITLPQUEUE_H */ |
diff --git a/include/asm-ppc64/iSeries/ItLpRegSave.h b/include/asm-ppc64/iSeries/ItLpRegSave.h index dafc4c813788..1b3087e76205 100644 --- a/include/asm-ppc64/iSeries/ItLpRegSave.h +++ b/include/asm-ppc64/iSeries/ItLpRegSave.h | |||
@@ -1,17 +1,17 @@ | |||
1 | /* | 1 | /* |
2 | * ItLpRegSave.h | 2 | * ItLpRegSave.h |
3 | * Copyright (C) 2001 Mike Corrigan IBM Corporation | 3 | * Copyright (C) 2001 Mike Corrigan IBM Corporation |
4 | * | 4 | * |
5 | * This program is free software; you can redistribute it and/or modify | 5 | * This program is free software; you can redistribute it and/or modify |
6 | * it under the terms of the GNU General Public License as published by | 6 | * it under the terms of the GNU General Public License as published by |
7 | * the Free Software Foundation; either version 2 of the License, or | 7 | * the Free Software Foundation; either version 2 of the License, or |
8 | * (at your option) any later version. | 8 | * (at your option) any later version. |
9 | * | 9 | * |
10 | * This program is distributed in the hope that it will be useful, | 10 | * This program is distributed in the hope that it will be useful, |
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
13 | * GNU General Public License for more details. | 13 | * GNU General Public License for more details. |
14 | * | 14 | * |
15 | * You should have received a copy of the GNU General Public License | 15 | * You should have received a copy of the GNU General Public License |
16 | * along with this program; if not, write to the Free Software | 16 | * along with this program; if not, write to the Free Software |
17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | 17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
@@ -19,33 +19,30 @@ | |||
19 | #ifndef _ITLPREGSAVE_H | 19 | #ifndef _ITLPREGSAVE_H |
20 | #define _ITLPREGSAVE_H | 20 | #define _ITLPREGSAVE_H |
21 | 21 | ||
22 | //===================================================================================== | 22 | /* |
23 | // | 23 | * This control block contains the data that is shared between PLIC |
24 | // This control block contains the data that is shared between PLIC | 24 | * and the OS |
25 | // and the OS | 25 | */ |
26 | // | ||
27 | // | ||
28 | 26 | ||
29 | struct ItLpRegSave | 27 | struct ItLpRegSave { |
30 | { | ||
31 | u32 xDesc; // Eye catcher "LpRS" ebcdic 000-003 | 28 | u32 xDesc; // Eye catcher "LpRS" ebcdic 000-003 |
32 | u16 xSize; // Size of this class 004-005 | 29 | u16 xSize; // Size of this class 004-005 |
33 | u8 xInUse; // Area is live 006-007 | 30 | u8 xInUse; // Area is live 006-007 |
34 | u8 xRsvd1[9]; // Reserved 007-00F | 31 | u8 xRsvd1[9]; // Reserved 007-00F |
35 | 32 | ||
36 | u8 xFixedRegSave[352]; // Fixed Register Save Area 010-16F | 33 | u8 xFixedRegSave[352]; // Fixed Register Save Area 010-16F |
37 | u32 xCTRL; // Control Register 170-173 | 34 | u32 xCTRL; // Control Register 170-173 |
38 | u32 xDEC; // Decrementer 174-177 | 35 | u32 xDEC; // Decrementer 174-177 |
39 | u32 xFPSCR; // FP Status and Control Reg 178-17B | 36 | u32 xFPSCR; // FP Status and Control Reg 178-17B |
40 | u32 xPVR; // Processor Version Number 17C-17F | 37 | u32 xPVR; // Processor Version Number 17C-17F |
41 | 38 | ||
42 | u64 xMMCR0; // Monitor Mode Control Reg 0 180-187 | 39 | u64 xMMCR0; // Monitor Mode Control Reg 0 180-187 |
43 | u32 xPMC1; // Perf Monitor Counter 1 188-18B | 40 | u32 xPMC1; // Perf Monitor Counter 1 188-18B |
44 | u32 xPMC2; // Perf Monitor Counter 2 18C-18F | 41 | u32 xPMC2; // Perf Monitor Counter 2 18C-18F |
45 | u32 xPMC3; // Perf Monitor Counter 3 190-193 | 42 | u32 xPMC3; // Perf Monitor Counter 3 190-193 |
46 | u32 xPMC4; // Perf Monitor Counter 4 194-197 | 43 | u32 xPMC4; // Perf Monitor Counter 4 194-197 |
47 | u32 xPIR; // Processor ID Reg 198-19B | 44 | u32 xPIR; // Processor ID Reg 198-19B |
48 | 45 | ||
49 | u32 xMMCR1; // Monitor Mode Control Reg 1 19C-19F | 46 | u32 xMMCR1; // Monitor Mode Control Reg 1 19C-19F |
50 | u32 xMMCRA; // Monitor Mode Control Reg A 1A0-1A3 | 47 | u32 xMMCRA; // Monitor Mode Control Reg A 1A0-1A3 |
51 | u32 xPMC5; // Perf Monitor Counter 5 1A4-1A7 | 48 | u32 xPMC5; // Perf Monitor Counter 5 1A4-1A7 |
@@ -57,17 +54,17 @@ struct ItLpRegSave | |||
57 | u32 xRsvd; // Reserved 1BC-1BF | 54 | u32 xRsvd; // Reserved 1BC-1BF |
58 | 55 | ||
59 | u64 xACCR; // Address Compare Control Reg 1C0-1C7 | 56 | u64 xACCR; // Address Compare Control Reg 1C0-1C7 |
60 | u64 xIMR; // Instruction Match Register 1C8-1CF | 57 | u64 xIMR; // Instruction Match Register 1C8-1CF |
61 | u64 xSDR1; // Storage Description Reg 1 1D0-1D7 | 58 | u64 xSDR1; // Storage Description Reg 1 1D0-1D7 |
62 | u64 xSPRG0; // Special Purpose Reg General0 1D8-1DF | 59 | u64 xSPRG0; // Special Purpose Reg General0 1D8-1DF |
63 | u64 xSPRG1; // Special Purpose Reg General1 1E0-1E7 | 60 | u64 xSPRG1; // Special Purpose Reg General1 1E0-1E7 |
64 | u64 xSPRG2; // Special Purpose Reg General2 1E8-1EF | 61 | u64 xSPRG2; // Special Purpose Reg General2 1E8-1EF |
65 | u64 xSPRG3; // Special Purpose Reg General3 1F0-1F7 | 62 | u64 xSPRG3; // Special Purpose Reg General3 1F0-1F7 |
66 | u64 xTB; // Time Base Register 1F8-1FF | 63 | u64 xTB; // Time Base Register 1F8-1FF |
67 | 64 | ||
68 | u64 xFPR[32]; // Floating Point Registers 200-2FF | 65 | u64 xFPR[32]; // Floating Point Registers 200-2FF |
69 | 66 | ||
70 | u64 xMSR; // Machine State Register 300-307 | 67 | u64 xMSR; // Machine State Register 300-307 |
71 | u64 xNIA; // Next Instruction Address 308-30F | 68 | u64 xNIA; // Next Instruction Address 308-30F |
72 | 69 | ||
73 | u64 xDABR; // Data Address Breakpoint Reg 310-317 | 70 | u64 xDABR; // Data Address Breakpoint Reg 310-317 |
@@ -76,8 +73,8 @@ struct ItLpRegSave | |||
76 | u64 xHID0; // HW Implementation Dependent0 320-327 | 73 | u64 xHID0; // HW Implementation Dependent0 320-327 |
77 | 74 | ||
78 | u64 xHID4; // HW Implementation Dependent4 328-32F | 75 | u64 xHID4; // HW Implementation Dependent4 328-32F |
79 | u64 xSCOMd; // SCON Data Reg (SPRG4) 330-337 | 76 | u64 xSCOMd; // SCON Data Reg (SPRG4) 330-337 |
80 | u64 xSCOMc; // SCON Command Reg (SPRG5) 338-33F | 77 | u64 xSCOMc; // SCON Command Reg (SPRG5) 338-33F |
81 | u64 xSDAR; // Sample Data Address Register 340-347 | 78 | u64 xSDAR; // Sample Data Address Register 340-347 |
82 | u64 xSIAR; // Sample Inst Address Register 348-34F | 79 | u64 xSIAR; // Sample Inst Address Register 348-34F |
83 | 80 | ||
diff --git a/include/asm-ppc64/iSeries/ItSpCommArea.h b/include/asm-ppc64/iSeries/ItSpCommArea.h index f1b56f9e11e2..5535f8271c9f 100644 --- a/include/asm-ppc64/iSeries/ItSpCommArea.h +++ b/include/asm-ppc64/iSeries/ItSpCommArea.h | |||
@@ -1,29 +1,27 @@ | |||
1 | /* | 1 | /* |
2 | * ItSpCommArea.h | 2 | * ItSpCommArea.h |
3 | * Copyright (C) 2001 Mike Corrigan IBM Corporation | 3 | * Copyright (C) 2001 Mike Corrigan IBM Corporation |
4 | * | 4 | * |
5 | * This program is free software; you can redistribute it and/or modify | 5 | * This program is free software; you can redistribute it and/or modify |
6 | * it under the terms of the GNU General Public License as published by | 6 | * it under the terms of the GNU General Public License as published by |
7 | * the Free Software Foundation; either version 2 of the License, or | 7 | * the Free Software Foundation; either version 2 of the License, or |
8 | * (at your option) any later version. | 8 | * (at your option) any later version. |
9 | * | 9 | * |
10 | * This program is distributed in the hope that it will be useful, | 10 | * This program is distributed in the hope that it will be useful, |
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
13 | * GNU General Public License for more details. | 13 | * GNU General Public License for more details. |
14 | * | 14 | * |
15 | * You should have received a copy of the GNU General Public License | 15 | * You should have received a copy of the GNU General Public License |
16 | * along with this program; if not, write to the Free Software | 16 | * along with this program; if not, write to the Free Software |
17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | 17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
18 | */ | 18 | */ |
19 | 19 | ||
20 | |||
21 | #ifndef _ITSPCOMMAREA_H | 20 | #ifndef _ITSPCOMMAREA_H |
22 | #define _ITSPCOMMAREA_H | 21 | #define _ITSPCOMMAREA_H |
23 | 22 | ||
24 | 23 | ||
25 | struct SpCommArea | 24 | struct SpCommArea { |
26 | { | ||
27 | u32 xDesc; // Descriptor (only in new formats) 000-003 | 25 | u32 xDesc; // Descriptor (only in new formats) 000-003 |
28 | u8 xFormat; // Format (only in new formats) 004-004 | 26 | u8 xFormat; // Format (only in new formats) 004-004 |
29 | u8 xRsvd1[11]; // Reserved 005-00F | 27 | u8 xRsvd1[11]; // Reserved 005-00F |
diff --git a/include/asm-ppc64/iSeries/ItVpdAreas.h b/include/asm-ppc64/iSeries/ItVpdAreas.h index d120439f30a5..71b3ad24f95a 100644 --- a/include/asm-ppc64/iSeries/ItVpdAreas.h +++ b/include/asm-ppc64/iSeries/ItVpdAreas.h | |||
@@ -1,17 +1,17 @@ | |||
1 | /* | 1 | /* |
2 | * ItVpdAreas.h | 2 | * ItVpdAreas.h |
3 | * Copyright (C) 2001 Mike Corrigan IBM Corporation | 3 | * Copyright (C) 2001 Mike Corrigan IBM Corporation |
4 | * | 4 | * |
5 | * This program is free software; you can redistribute it and/or modify | 5 | * This program is free software; you can redistribute it and/or modify |
6 | * it under the terms of the GNU General Public License as published by | 6 | * it under the terms of the GNU General Public License as published by |
7 | * the Free Software Foundation; either version 2 of the License, or | 7 | * the Free Software Foundation; either version 2 of the License, or |
8 | * (at your option) any later version. | 8 | * (at your option) any later version. |
9 | * | 9 | * |
10 | * This program is distributed in the hope that it will be useful, | 10 | * This program is distributed in the hope that it will be useful, |
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
13 | * GNU General Public License for more details. | 13 | * GNU General Public License for more details. |
14 | * | 14 | * |
15 | * You should have received a copy of the GNU General Public License | 15 | * You should have received a copy of the GNU General Public License |
16 | * along with this program; if not, write to the Free Software | 16 | * along with this program; if not, write to the Free Software |
17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | 17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
@@ -19,78 +19,71 @@ | |||
19 | #ifndef _ITVPDAREAS_H | 19 | #ifndef _ITVPDAREAS_H |
20 | #define _ITVPDAREAS_H | 20 | #define _ITVPDAREAS_H |
21 | 21 | ||
22 | //===================================================================================== | 22 | /* |
23 | // | 23 | * This file defines the address and length of all of the VPD area passed to |
24 | // This file defines the address and length of all of the VPD area passed to | 24 | * the OS from PLIC (most of which start from the SP). |
25 | // the OS from PLIC (most of which start from the SP). | 25 | */ |
26 | // | ||
27 | 26 | ||
28 | #include <asm/types.h> | 27 | #include <asm/types.h> |
29 | 28 | ||
30 | // VPD Entry index is carved in stone - cannot be changed (easily). | 29 | /* VPD Entry index is carved in stone - cannot be changed (easily). */ |
31 | #define ItVpdCecVpd 0 | 30 | #define ItVpdCecVpd 0 |
32 | #define ItVpdDynamicSpace 1 | 31 | #define ItVpdDynamicSpace 1 |
33 | #define ItVpdExtVpd 2 | 32 | #define ItVpdExtVpd 2 |
34 | #define ItVpdExtVpdOnPanel 3 | 33 | #define ItVpdExtVpdOnPanel 3 |
35 | #define ItVpdFirstPaca 4 | 34 | #define ItVpdFirstPaca 4 |
36 | #define ItVpdIoVpd 5 | 35 | #define ItVpdIoVpd 5 |
37 | #define ItVpdIplParms 6 | 36 | #define ItVpdIplParms 6 |
38 | #define ItVpdMsVpd 7 | 37 | #define ItVpdMsVpd 7 |
39 | #define ItVpdPanelVpd 8 | 38 | #define ItVpdPanelVpd 8 |
40 | #define ItVpdLpNaca 9 | 39 | #define ItVpdLpNaca 9 |
41 | #define ItVpdBackplaneAndMaybeClockCardVpd 10 | 40 | #define ItVpdBackplaneAndMaybeClockCardVpd 10 |
42 | #define ItVpdRecoveryLogBuffer 11 | 41 | #define ItVpdRecoveryLogBuffer 11 |
43 | #define ItVpdSpCommArea 12 | 42 | #define ItVpdSpCommArea 12 |
44 | #define ItVpdSpLogBuffer 13 | 43 | #define ItVpdSpLogBuffer 13 |
45 | #define ItVpdSpLogBufferSave 14 | 44 | #define ItVpdSpLogBufferSave 14 |
46 | #define ItVpdSpCardVpd 15 | 45 | #define ItVpdSpCardVpd 15 |
47 | #define ItVpdFirstProcVpd 16 | 46 | #define ItVpdFirstProcVpd 16 |
48 | #define ItVpdApModelVpd 17 | 47 | #define ItVpdApModelVpd 17 |
49 | #define ItVpdClockCardVpd 18 | 48 | #define ItVpdClockCardVpd 18 |
50 | #define ItVpdBusExtCardVpd 19 | 49 | #define ItVpdBusExtCardVpd 19 |
51 | #define ItVpdProcCapacityVpd 20 | 50 | #define ItVpdProcCapacityVpd 20 |
52 | #define ItVpdInteractiveCapacityVpd 21 | 51 | #define ItVpdInteractiveCapacityVpd 21 |
53 | #define ItVpdFirstSlotLabel 22 | 52 | #define ItVpdFirstSlotLabel 22 |
54 | #define ItVpdFirstLpQueue 23 | 53 | #define ItVpdFirstLpQueue 23 |
55 | #define ItVpdFirstL3CacheVpd 24 | 54 | #define ItVpdFirstL3CacheVpd 24 |
56 | #define ItVpdFirstProcFruVpd 25 | 55 | #define ItVpdFirstProcFruVpd 25 |
57 | |||
58 | #define ItVpdMaxEntries 26 | ||
59 | 56 | ||
57 | #define ItVpdMaxEntries 26 | ||
60 | 58 | ||
61 | #define ItDmaMaxEntries 10 | 59 | #define ItDmaMaxEntries 10 |
62 | 60 | ||
63 | #define ItVpdAreasMaxSlotLabels 192 | 61 | #define ItVpdAreasMaxSlotLabels 192 |
64 | 62 | ||
65 | 63 | ||
66 | struct SlicVpdAdrs { | 64 | struct ItVpdAreas { |
67 | u32 pad1; | 65 | u32 xSlicDesc; // Descriptor 000-003 |
68 | void * vpdAddr; | 66 | u16 xSlicSize; // Size of this control block 004-005 |
67 | u16 xPlicAdjustVpdLens:1; // Flag to indicate new interface006-007 | ||
68 | u16 xRsvd1:15; // Reserved bits ... | ||
69 | u16 xSlicVpdEntries; // Number of VPD entries 008-009 | ||
70 | u16 xSlicDmaEntries; // Number of DMA entries 00A-00B | ||
71 | u16 xSlicMaxLogicalProcs; // Maximum logical processors 00C-00D | ||
72 | u16 xSlicMaxPhysicalProcs; // Maximum physical processors 00E-00F | ||
73 | u16 xSlicDmaToksOffset; // Offset into this of array 010-011 | ||
74 | u16 xSlicVpdAdrsOffset; // Offset into this of array 012-013 | ||
75 | u16 xSlicDmaLensOffset; // Offset into this of array 014-015 | ||
76 | u16 xSlicVpdLensOffset; // Offset into this of array 016-017 | ||
77 | u16 xSlicMaxSlotLabels; // Maximum number of slot labels018-019 | ||
78 | u16 xSlicMaxLpQueues; // Maximum number of LP Queues 01A-01B | ||
79 | u8 xRsvd2[4]; // Reserved 01C-01F | ||
80 | u64 xRsvd3[12]; // Reserved 020-07F | ||
81 | u32 xPlicDmaLens[ItDmaMaxEntries];// Array of DMA lengths 080-0A7 | ||
82 | u32 xPlicDmaToks[ItDmaMaxEntries];// Array of DMA tokens 0A8-0CF | ||
83 | u32 xSlicVpdLens[ItVpdMaxEntries];// Array of VPD lengths 0D0-12F | ||
84 | void *xSlicVpdAdrs[ItVpdMaxEntries];// Array of VPD buffers 130-1EF | ||
69 | }; | 85 | }; |
70 | 86 | ||
71 | 87 | extern struct ItVpdAreas itVpdAreas; | |
72 | struct ItVpdAreas | ||
73 | { | ||
74 | u32 xSlicDesc; // Descriptor 000-003 | ||
75 | u16 xSlicSize; // Size of this control block 004-005 | ||
76 | u16 xPlicAdjustVpdLens:1; // Flag to indicate new interface 006-007 | ||
77 | u16 xRsvd1:15; // Reserved bits ... | ||
78 | u16 xSlicVpdEntries; // Number of VPD entries 008-009 | ||
79 | u16 xSlicDmaEntries; // Number of DMA entries 00A-00B | ||
80 | u16 xSlicMaxLogicalProcs; // Maximum logical processors 00C-00D | ||
81 | u16 xSlicMaxPhysicalProcs; // Maximum physical processors 00E-00F | ||
82 | u16 xSlicDmaToksOffset; // Offset into this of array 010-011 | ||
83 | u16 xSlicVpdAdrsOffset; // Offset into this of array 012-013 | ||
84 | u16 xSlicDmaLensOffset; // Offset into this of array 014-015 | ||
85 | u16 xSlicVpdLensOffset; // Offset into this of array 016-017 | ||
86 | u16 xSlicMaxSlotLabels; // Maximum number of slot labels 018-019 | ||
87 | u16 xSlicMaxLpQueues; // Maximum number of LP Queues 01A-01B | ||
88 | u8 xRsvd2[4]; // Reserved 01C-01F | ||
89 | u64 xRsvd3[12]; // Reserved 020-07F | ||
90 | u32 xPlicDmaLens[ItDmaMaxEntries];// Array of DMA lengths 080-0A7 | ||
91 | u32 xPlicDmaToks[ItDmaMaxEntries];// Array of DMA tokens 0A8-0CF | ||
92 | u32 xSlicVpdLens[ItVpdMaxEntries];// Array of VPD lengths 0D0-12F | ||
93 | void * xSlicVpdAdrs[ItVpdMaxEntries];// Array of VPD buffers 130-1EF | ||
94 | }; | ||
95 | 88 | ||
96 | #endif /* _ITVPDAREAS_H */ | 89 | #endif /* _ITVPDAREAS_H */ |
diff --git a/include/asm-ppc64/iSeries/LparData.h b/include/asm-ppc64/iSeries/LparData.h deleted file mode 100644 index e54f3b686e58..000000000000 --- a/include/asm-ppc64/iSeries/LparData.h +++ /dev/null | |||
@@ -1,49 +0,0 @@ | |||
1 | /* | ||
2 | * LparData.h | ||
3 | * Copyright (C) 2001 Mike Corrigan IBM Corporation | ||
4 | * | ||
5 | * This program is free software; you can redistribute it and/or modify | ||
6 | * it under the terms of the GNU General Public License as published by | ||
7 | * the Free Software Foundation; either version 2 of the License, or | ||
8 | * (at your option) any later version. | ||
9 | * | ||
10 | * This program is distributed in the hope that it will be useful, | ||
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
13 | * GNU General Public License for more details. | ||
14 | * | ||
15 | * You should have received a copy of the GNU General Public License | ||
16 | * along with this program; if not, write to the Free Software | ||
17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
18 | */ | ||
19 | |||
20 | #ifndef _LPARDATA_H | ||
21 | #define _LPARDATA_H | ||
22 | |||
23 | #include <asm/types.h> | ||
24 | #include <asm/page.h> | ||
25 | #include <asm/abs_addr.h> | ||
26 | |||
27 | #include <asm/iSeries/ItLpNaca.h> | ||
28 | #include <asm/iSeries/ItLpRegSave.h> | ||
29 | #include <asm/iSeries/HvReleaseData.h> | ||
30 | #include <asm/iSeries/LparMap.h> | ||
31 | #include <asm/iSeries/ItVpdAreas.h> | ||
32 | #include <asm/iSeries/ItIplParmsReal.h> | ||
33 | #include <asm/iSeries/ItExtVpdPanel.h> | ||
34 | #include <asm/iSeries/ItLpQueue.h> | ||
35 | #include <asm/iSeries/IoHriProcessorVpd.h> | ||
36 | |||
37 | extern struct LparMap xLparMap; | ||
38 | extern struct HvReleaseData hvReleaseData; | ||
39 | extern struct ItLpNaca itLpNaca; | ||
40 | extern struct ItIplParmsReal xItIplParmsReal; | ||
41 | extern struct ItExtVpdPanel xItExtVpdPanel; | ||
42 | extern struct IoHriProcessorVpd xIoHriProcessorVpd[]; | ||
43 | extern struct ItLpQueue xItLpQueue; | ||
44 | extern struct ItVpdAreas itVpdAreas; | ||
45 | extern u64 xMsVpd[]; | ||
46 | extern struct msChunks msChunks; | ||
47 | |||
48 | |||
49 | #endif /* _LPARDATA_H */ | ||
diff --git a/include/asm-ppc64/iSeries/LparMap.h b/include/asm-ppc64/iSeries/LparMap.h index 075205bb0f4a..038e5df7e9f8 100644 --- a/include/asm-ppc64/iSeries/LparMap.h +++ b/include/asm-ppc64/iSeries/LparMap.h | |||
@@ -1,17 +1,17 @@ | |||
1 | /* | 1 | /* |
2 | * LparMap.h | 2 | * LparMap.h |
3 | * Copyright (C) 2001 Mike Corrigan IBM Corporation | 3 | * Copyright (C) 2001 Mike Corrigan IBM Corporation |
4 | * | 4 | * |
5 | * This program is free software; you can redistribute it and/or modify | 5 | * This program is free software; you can redistribute it and/or modify |
6 | * it under the terms of the GNU General Public License as published by | 6 | * it under the terms of the GNU General Public License as published by |
7 | * the Free Software Foundation; either version 2 of the License, or | 7 | * the Free Software Foundation; either version 2 of the License, or |
8 | * (at your option) any later version. | 8 | * (at your option) any later version. |
9 | * | 9 | * |
10 | * This program is distributed in the hope that it will be useful, | 10 | * This program is distributed in the hope that it will be useful, |
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
13 | * GNU General Public License for more details. | 13 | * GNU General Public License for more details. |
14 | * | 14 | * |
15 | * You should have received a copy of the GNU General Public License | 15 | * You should have received a copy of the GNU General Public License |
16 | * along with this program; if not, write to the Free Software | 16 | * along with this program; if not, write to the Free Software |
17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | 17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
@@ -21,13 +21,14 @@ | |||
21 | 21 | ||
22 | #include <asm/types.h> | 22 | #include <asm/types.h> |
23 | 23 | ||
24 | /* The iSeries hypervisor will set up mapping for one or more | 24 | /* |
25 | * The iSeries hypervisor will set up mapping for one or more | ||
25 | * ESID/VSID pairs (in SLB/segment registers) and will set up | 26 | * ESID/VSID pairs (in SLB/segment registers) and will set up |
26 | * mappings of one or more ranges of pages to VAs. | 27 | * mappings of one or more ranges of pages to VAs. |
27 | * We will have the hypervisor set up the ESID->VSID mapping | 28 | * We will have the hypervisor set up the ESID->VSID mapping |
28 | * for the four kernel segments (C-F). With shared processors, | 29 | * for the four kernel segments (C-F). With shared processors, |
29 | * the hypervisor will clear all segment registers and reload | 30 | * the hypervisor will clear all segment registers and reload |
30 | * these four whenever the processor is switched from one | 31 | * these four whenever the processor is switched from one |
31 | * partition to another. | 32 | * partition to another. |
32 | */ | 33 | */ |
33 | 34 | ||
@@ -38,30 +39,31 @@ | |||
38 | * need to be located within the load area (if the total partition size | 39 | * need to be located within the load area (if the total partition size |
39 | * is 64 MB), but cannot be mapped. Typically, this should specify | 40 | * is 64 MB), but cannot be mapped. Typically, this should specify |
40 | * to map half (32 MB) of the load area. | 41 | * to map half (32 MB) of the load area. |
41 | * | 42 | * |
42 | * The hypervisor will set up page table entries for the number of | 43 | * The hypervisor will set up page table entries for the number of |
43 | * pages specified. | 44 | * pages specified. |
44 | * | 45 | * |
45 | * In 32-bit mode, the hypervisor will load all four of the | 46 | * In 32-bit mode, the hypervisor will load all four of the |
46 | * segment registers (identified by the low-order four bits of the | 47 | * segment registers (identified by the low-order four bits of the |
47 | * Esid field. In 64-bit mode, the hypervisor will load one SLB | 48 | * Esid field. In 64-bit mode, the hypervisor will load one SLB |
48 | * entry to map the Esid to the Vsid. | 49 | * entry to map the Esid to the Vsid. |
49 | */ | 50 | */ |
50 | 51 | ||
51 | // Hypervisor initially maps 32MB of the load area | 52 | /* Hypervisor initially maps 32MB of the load area */ |
52 | #define HvPagesToMap 8192 | 53 | #define HvPagesToMap 8192 |
53 | 54 | ||
54 | struct LparMap | 55 | struct LparMap { |
55 | { | 56 | u64 xNumberEsids; // Number of ESID/VSID pairs (1) |
56 | u64 xNumberEsids; // Number of ESID/VSID pairs (1) | 57 | u64 xNumberRanges; // Number of VA ranges to map (1) |
57 | u64 xNumberRanges; // Number of VA ranges to map (1) | 58 | u64 xSegmentTableOffs; // Page number within load area of seg table (0) |
58 | u64 xSegmentTableOffs; // Page number within load area of seg table (0) | 59 | u64 xRsvd[5]; |
59 | u64 xRsvd[5]; // Reserved (0) | 60 | u64 xKernelEsid; // Esid used to map kernel load (0x0C00000000) |
60 | u64 xKernelEsid; // Esid used to map kernel load (0x0C00000000) | 61 | u64 xKernelVsid; // Vsid used to map kernel load (0x0C00000000) |
61 | u64 xKernelVsid; // Vsid used to map kernel load (0x0C00000000) | 62 | u64 xPages; // Number of pages to be mapped (8192) |
62 | u64 xPages; // Number of pages to be mapped (8192) | 63 | u64 xOffset; // Offset from start of load area (0) |
63 | u64 xOffset; // Offset from start of load area (0) | 64 | u64 xVPN; // Virtual Page Number (0x000C000000000000) |
64 | u64 xVPN; // Virtual Page Number (0x000C000000000000) | ||
65 | }; | 65 | }; |
66 | 66 | ||
67 | extern struct LparMap xLparMap; | ||
68 | |||
67 | #endif /* _LPARMAP_H */ | 69 | #endif /* _LPARMAP_H */ |
diff --git a/include/asm-ppc64/iSeries/XmPciLpEvent.h b/include/asm-ppc64/iSeries/XmPciLpEvent.h deleted file mode 100644 index a3d27f116e49..000000000000 --- a/include/asm-ppc64/iSeries/XmPciLpEvent.h +++ /dev/null | |||
@@ -1,18 +0,0 @@ | |||
1 | |||
2 | #ifndef __XMPCILPEVENT_H__ | ||
3 | #define __XMPCILPEVENT_H__ | ||
4 | |||
5 | |||
6 | #ifdef __cplusplus | ||
7 | extern "C" { | ||
8 | #endif | ||
9 | |||
10 | int XmPciLpEvent_init(void); | ||
11 | void ppc_irq_dispatch_handler(struct pt_regs *regs, int irq); | ||
12 | |||
13 | |||
14 | #ifdef __cplusplus | ||
15 | } | ||
16 | #endif | ||
17 | |||
18 | #endif /* __XMPCILPEVENT_H__ */ | ||
diff --git a/include/asm-ppc64/iSeries/iSeries_io.h b/include/asm-ppc64/iSeries/iSeries_io.h index f52b7599b372..9f79413342b3 100644 --- a/include/asm-ppc64/iSeries/iSeries_io.h +++ b/include/asm-ppc64/iSeries/iSeries_io.h | |||
@@ -5,32 +5,33 @@ | |||
5 | 5 | ||
6 | #ifdef CONFIG_PPC_ISERIES | 6 | #ifdef CONFIG_PPC_ISERIES |
7 | #include <linux/types.h> | 7 | #include <linux/types.h> |
8 | /************************************************************************/ | 8 | /* |
9 | /* File iSeries_io.h created by Allan Trautman on Thu Dec 28 2000. */ | 9 | * File iSeries_io.h created by Allan Trautman on Thu Dec 28 2000. |
10 | /************************************************************************/ | 10 | * |
11 | /* Remaps the io.h for the iSeries Io */ | 11 | * Remaps the io.h for the iSeries Io |
12 | /* Copyright (C) 20yy Allan H Trautman, IBM Corporation */ | 12 | * Copyright (C) 2000 Allan H Trautman, IBM Corporation |
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 as published by */ | 15 | * it under the terms of the GNU General Public License as published by |
16 | /* the Free Software Foundation; either version 2 of the License, or */ | 16 | * the Free Software Foundation; either version 2 of the License, or |
17 | /* (at your option) any later version. */ | 17 | * (at your option) any later version. |
18 | /* */ | 18 | * |
19 | /* This program is distributed in the hope that it will be useful, */ | 19 | * This program is distributed in the hope that it will be useful, |
20 | /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ | 20 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
21 | /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ | 21 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
22 | /* GNU General Public License for more details. */ | 22 | * GNU General Public License for more details. |
23 | /* */ | 23 | * |
24 | /* You should have received a copy of the GNU General Public License */ | 24 | * You should have received a copy of the GNU General Public License |
25 | /* along with this program; if not, write to the: */ | 25 | * along with this program; if not, write to the: |
26 | /* Free Software Foundation, Inc., */ | 26 | * Free Software Foundation, Inc., |
27 | /* 59 Temple Place, Suite 330, */ | 27 | * 59 Temple Place, Suite 330, |
28 | /* Boston, MA 02111-1307 USA */ | 28 | * Boston, MA 02111-1307 USA |
29 | /************************************************************************/ | 29 | * |
30 | /* Change Activity: */ | 30 | * Change Activity: |
31 | /* Created December 28, 2000 */ | 31 | * Created December 28, 2000 |
32 | /* End Change Activity */ | 32 | * End Change Activity |
33 | /************************************************************************/ | 33 | */ |
34 | |||
34 | extern u8 iSeries_Read_Byte(const volatile void __iomem * IoAddress); | 35 | extern u8 iSeries_Read_Byte(const volatile void __iomem * IoAddress); |
35 | extern u16 iSeries_Read_Word(const volatile void __iomem * IoAddress); | 36 | extern u16 iSeries_Read_Word(const volatile void __iomem * IoAddress); |
36 | extern u32 iSeries_Read_Long(const volatile void __iomem * IoAddress); | 37 | extern u32 iSeries_Read_Long(const volatile void __iomem * IoAddress); |
@@ -39,8 +40,10 @@ extern void iSeries_Write_Word(u16 IoData, volatile void __iomem * IoAddress); | |||
39 | extern void iSeries_Write_Long(u32 IoData, volatile void __iomem * IoAddress); | 40 | extern void iSeries_Write_Long(u32 IoData, volatile void __iomem * IoAddress); |
40 | 41 | ||
41 | extern void iSeries_memset_io(volatile void __iomem *dest, char x, size_t n); | 42 | extern void iSeries_memset_io(volatile void __iomem *dest, char x, size_t n); |
42 | extern void iSeries_memcpy_toio(volatile void __iomem *dest, void *source, size_t n); | 43 | extern void iSeries_memcpy_toio(volatile void __iomem *dest, void *source, |
43 | extern void iSeries_memcpy_fromio(void *dest, const volatile void __iomem *source, size_t n); | 44 | size_t n); |
45 | extern void iSeries_memcpy_fromio(void *dest, | ||
46 | const volatile void __iomem *source, size_t n); | ||
44 | 47 | ||
45 | #endif /* CONFIG_PPC_ISERIES */ | 48 | #endif /* CONFIG_PPC_ISERIES */ |
46 | #endif /* _ISERIES_IO_H */ | 49 | #endif /* _ISERIES_IO_H */ |
diff --git a/include/asm-ppc64/iSeries/iSeries_irq.h b/include/asm-ppc64/iSeries/iSeries_irq.h index ff8ddede038c..6c9767ac1302 100644 --- a/include/asm-ppc64/iSeries/iSeries_irq.h +++ b/include/asm-ppc64/iSeries/iSeries_irq.h | |||
@@ -1,19 +1,8 @@ | |||
1 | #ifndef __ISERIES_IRQ_H__ | 1 | #ifndef __ISERIES_IRQ_H__ |
2 | #define __ISERIES_IRQ_H__ | 2 | #define __ISERIES_IRQ_H__ |
3 | 3 | ||
4 | #ifdef __cplusplus | 4 | extern void iSeries_init_IRQ(void); |
5 | extern "C" { | 5 | extern int iSeries_allocate_IRQ(HvBusNumber, HvSubBusNumber, HvAgentId); |
6 | #endif | 6 | extern void iSeries_activate_IRQs(void); |
7 | |||
8 | void iSeries_init_IRQ(void); | ||
9 | int iSeries_allocate_IRQ(HvBusNumber, HvSubBusNumber, HvAgentId); | ||
10 | int iSeries_assign_IRQ(int, HvBusNumber, HvSubBusNumber, HvAgentId); | ||
11 | void iSeries_activate_IRQs(void); | ||
12 | |||
13 | int XmPciLpEvent_init(void); | ||
14 | |||
15 | #ifdef __cplusplus | ||
16 | } | ||
17 | #endif | ||
18 | 7 | ||
19 | #endif /* __ISERIES_IRQ_H__ */ | 8 | #endif /* __ISERIES_IRQ_H__ */ |
diff --git a/include/asm-ppc64/iSeries/iSeries_pci.h b/include/asm-ppc64/iSeries/iSeries_pci.h index 5769cff4c00c..575f611f8b33 100644 --- a/include/asm-ppc64/iSeries/iSeries_pci.h +++ b/include/asm-ppc64/iSeries/iSeries_pci.h | |||
@@ -1,112 +1,88 @@ | |||
1 | #ifndef _ISERIES_64_PCI_H | 1 | #ifndef _ISERIES_64_PCI_H |
2 | #define _ISERIES_64_PCI_H | 2 | #define _ISERIES_64_PCI_H |
3 | 3 | ||
4 | /************************************************************************/ | 4 | /* |
5 | /* File iSeries_pci.h created by Allan Trautman on Tue Feb 20, 2001. */ | 5 | * File iSeries_pci.h created by Allan Trautman on Tue Feb 20, 2001. |
6 | /************************************************************************/ | 6 | * |
7 | /* Define some useful macros for the iSeries pci routines. */ | 7 | * Define some useful macros for the iSeries pci routines. |
8 | /* Copyright (C) 2001 Allan H Trautman, IBM Corporation */ | 8 | * Copyright (C) 2001 Allan H Trautman, IBM Corporation |
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 as published by */ | 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 */ | 12 | * the Free Software Foundation; either version 2 of the License, or |
13 | /* (at your option) any later version. */ | 13 | * (at your option) any later version. |
14 | /* */ | 14 | * |
15 | /* This program is distributed in the hope that it will be useful, */ | 15 | * This program is distributed in the hope that it will be useful, |
16 | /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ | 16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
17 | /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ | 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
18 | /* GNU General Public License for more details. */ | 18 | * GNU General Public License for more details. |
19 | /* */ | 19 | * |
20 | /* You should have received a copy of the GNU General Public License */ | 20 | * You should have received a copy of the GNU General Public License |
21 | /* along with this program; if not, write to the: */ | 21 | * along with this program; if not, write to the: |
22 | /* Free Software Foundation, Inc., */ | 22 | * Free Software Foundation, Inc., |
23 | /* 59 Temple Place, Suite 330, */ | 23 | * 59 Temple Place, Suite 330, |
24 | /* Boston, MA 02111-1307 USA */ | 24 | * Boston, MA 02111-1307 USA |
25 | /************************************************************************/ | 25 | * |
26 | /* Change Activity: */ | 26 | * Change Activity: |
27 | /* Created Feb 20, 2001 */ | 27 | * Created Feb 20, 2001 |
28 | /* Added device reset, March 22, 2001 */ | 28 | * Added device reset, March 22, 2001 |
29 | /* Ported to ppc64, May 25, 2001 */ | 29 | * Ported to ppc64, May 25, 2001 |
30 | /* End Change Activity */ | 30 | * End Change Activity |
31 | /************************************************************************/ | 31 | */ |
32 | 32 | ||
33 | #include <asm/iSeries/HvCallPci.h> | 33 | #include <asm/iSeries/HvCallPci.h> |
34 | #include <asm/abs_addr.h> | 34 | #include <asm/abs_addr.h> |
35 | 35 | ||
36 | struct pci_dev; /* For Forward Reference */ | 36 | struct pci_dev; /* For Forward Reference */ |
37 | struct iSeries_Device_Node; | 37 | struct iSeries_Device_Node; |
38 | 38 | ||
39 | /************************************************************************/ | 39 | /* |
40 | /* Gets iSeries Bus, SubBus, DevFn using iSeries_Device_Node structure */ | 40 | * Gets iSeries Bus, SubBus, DevFn using iSeries_Device_Node structure |
41 | /************************************************************************/ | 41 | */ |
42 | 42 | ||
43 | #define ISERIES_BUS(DevPtr) DevPtr->DsaAddr.Dsa.busNumber | 43 | #define ISERIES_BUS(DevPtr) DevPtr->DsaAddr.Dsa.busNumber |
44 | #define ISERIES_SUBBUS(DevPtr) DevPtr->DsaAddr.Dsa.subBusNumber | 44 | #define ISERIES_SUBBUS(DevPtr) DevPtr->DsaAddr.Dsa.subBusNumber |
45 | #define ISERIES_DEVICE(DevPtr) DevPtr->DsaAddr.Dsa.deviceId | 45 | #define ISERIES_DEVICE(DevPtr) DevPtr->DsaAddr.Dsa.deviceId |
46 | #define ISERIES_DSA(DevPtr) DevPtr->DsaAddr.DsaAddr | 46 | #define ISERIES_DSA(DevPtr) DevPtr->DsaAddr.DsaAddr |
47 | #define ISERIES_DEVFUN(DevPtr) DevPtr->DevFn | 47 | #define ISERIES_DEVNODE(PciDev) ((struct iSeries_Device_Node *)PciDev->sysdata) |
48 | #define ISERIES_DEVNODE(PciDev) ((struct iSeries_Device_Node*)PciDev->sysdata) | ||
49 | 48 | ||
50 | #define EADsMaxAgents 7 | 49 | #define EADsMaxAgents 7 |
51 | 50 | ||
52 | /************************************************************************/ | ||
53 | /* Decodes Linux DevFn to iSeries DevFn, bridge device, or function. */ | ||
54 | /* For Linux, see PCI_SLOT and PCI_FUNC in include/linux/pci.h */ | ||
55 | /************************************************************************/ | ||
56 | |||
57 | #define ISERIES_PCI_AGENTID(idsel,func) ((idsel & 0x0F) << 4) | (func & 0x07) | ||
58 | #define ISERIES_ENCODE_DEVICE(agentid) ((0x10) | ((agentid&0x20)>>2) | (agentid&07)) | ||
59 | |||
60 | #define ISERIES_GET_DEVICE_FROM_SUBBUS(subbus) ((subbus >> 5) & 0x7) | ||
61 | #define ISERIES_GET_FUNCTION_FROM_SUBBUS(subbus) ((subbus >> 2) & 0x7) | ||
62 | |||
63 | /* | 51 | /* |
64 | * N.B. the ISERIES_DECODE_* macros are not used anywhere, and I think | 52 | * Decodes Linux DevFn to iSeries DevFn, bridge device, or function. |
65 | * the 0x71 (at least) must be wrong - 0x78 maybe? -- paulus. | 53 | * For Linux, see PCI_SLOT and PCI_FUNC in include/linux/pci.h |
66 | */ | 54 | */ |
67 | #define ISERIES_DECODE_DEVFN(linuxdevfn) (((linuxdevfn & 0x71) << 1) | (linuxdevfn & 0x07)) | ||
68 | #define ISERIES_DECODE_DEVICE(linuxdevfn) (((linuxdevfn & 0x38) >> 3) |(((linuxdevfn & 0x40) >> 2) + 0x10)) | ||
69 | #define ISERIES_DECODE_FUNCTION(linuxdevfn) (linuxdevfn & 0x07) | ||
70 | 55 | ||
71 | /************************************************************************/ | 56 | #define ISERIES_PCI_AGENTID(idsel, func) \ |
72 | /* Converts Virtual Address to Real Address for Hypervisor calls */ | 57 | (((idsel & 0x0F) << 4) | (func & 0x07)) |
73 | /************************************************************************/ | 58 | #define ISERIES_ENCODE_DEVICE(agentid) \ |
59 | ((0x10) | ((agentid & 0x20) >> 2) | (agentid & 0x07)) | ||
74 | 60 | ||
75 | #define ISERIES_HV_ADDR(virtaddr) (0x8000000000000000 | virt_to_abs(virtaddr)) | 61 | #define ISERIES_GET_DEVICE_FROM_SUBBUS(subbus) ((subbus >> 5) & 0x7) |
62 | #define ISERIES_GET_FUNCTION_FROM_SUBBUS(subbus) ((subbus >> 2) & 0x7) | ||
76 | 63 | ||
77 | /************************************************************************/ | 64 | /* |
78 | /* iSeries Device Information */ | 65 | * Converts Virtual Address to Real Address for Hypervisor calls |
79 | /************************************************************************/ | 66 | */ |
67 | #define ISERIES_HV_ADDR(virtaddr) \ | ||
68 | (0x8000000000000000 | virt_to_abs(virtaddr)) | ||
80 | 69 | ||
70 | /* | ||
71 | * iSeries Device Information | ||
72 | */ | ||
81 | struct iSeries_Device_Node { | 73 | struct iSeries_Device_Node { |
82 | struct list_head Device_List; | 74 | struct list_head Device_List; |
83 | struct pci_dev* PciDev; /* Pointer to pci_dev structure*/ | 75 | struct pci_dev *PciDev; |
84 | union HvDsaMap DsaAddr; /* Direct Select Address */ | 76 | union HvDsaMap DsaAddr; /* Direct Select Address */ |
85 | /* busNumber,subBusNumber, */ | 77 | /* busNumber, subBusNumber, */ |
86 | /* deviceId, barNumber */ | 78 | /* deviceId, barNumber */ |
87 | HvAgentId AgentId; /* Hypervisor DevFn */ | 79 | int DevFn; /* Linux devfn */ |
88 | int DevFn; /* Linux devfn */ | 80 | int Irq; /* Assigned IRQ */ |
89 | int BarOffset; | 81 | int Flags; /* Possible flags(disable/bist)*/ |
90 | int Irq; /* Assigned IRQ */ | 82 | u8 LogicalSlot; /* Hv Slot Index for Tces */ |
91 | int ReturnCode; /* Return Code Holder */ | 83 | struct iommu_table *iommu_table;/* Device TCE Table */ |
92 | int IoRetry; /* Current Retry Count */ | ||
93 | int Flags; /* Possible flags(disable/bist)*/ | ||
94 | u16 Vendor; /* Vendor ID */ | ||
95 | u8 LogicalSlot; /* Hv Slot Index for Tces */ | ||
96 | struct iommu_table* iommu_table;/* Device TCE Table */ | ||
97 | u8 PhbId; /* Phb Card is on. */ | ||
98 | u16 Board; /* Board Number */ | ||
99 | u8 FrameId; /* iSeries spcn Frame Id */ | ||
100 | char CardLocation[4];/* Char format of planar vpd */ | ||
101 | char Location[20]; /* Frame 1, Card C10 */ | ||
102 | }; | 84 | }; |
103 | 85 | ||
104 | /************************************************************************/ | 86 | extern void iSeries_Device_Information(struct pci_dev*, int); |
105 | /* Functions */ | ||
106 | /************************************************************************/ | ||
107 | |||
108 | extern int iSeries_Device_Information(struct pci_dev*,char*, int); | ||
109 | extern void iSeries_Get_Location_Code(struct iSeries_Device_Node*); | ||
110 | extern int iSeries_Device_ToggleReset(struct pci_dev* PciDev, int AssertTime, int DelayTime); | ||
111 | 87 | ||
112 | #endif /* _ISERIES_64_PCI_H */ | 88 | #endif /* _ISERIES_64_PCI_H */ |
diff --git a/include/asm-ppc64/iSeries/iSeries_proc.h b/include/asm-ppc64/iSeries/iSeries_proc.h deleted file mode 100644 index adb6dc14dd4d..000000000000 --- a/include/asm-ppc64/iSeries/iSeries_proc.h +++ /dev/null | |||
@@ -1,24 +0,0 @@ | |||
1 | /* | ||
2 | * iSeries_proc.h | ||
3 | * Copyright (C) 2001 Kyle A. Lucke IBM Corporation | ||
4 | * | ||
5 | * This program is free software; you can redistribute it and/or modify | ||
6 | * it under the terms of the GNU General Public License as published by | ||
7 | * the Free Software Foundation; either version 2 of the License, or | ||
8 | * (at your option) any later version. | ||
9 | * | ||
10 | * This program is distributed in the hope that it will be useful, | ||
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
13 | * GNU General Public License for more details. | ||
14 | * | ||
15 | * You should have received a copy of the GNU General Public License | ||
16 | * along with this program; if not, write to the Free Software | ||
17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
18 | */ | ||
19 | #ifndef _ISERIES_PROC_H | ||
20 | #define _ISERIES_PROC_H | ||
21 | |||
22 | extern void iSeries_proc_early_init(void); | ||
23 | |||
24 | #endif /* _iSeries_PROC_H */ | ||
diff --git a/include/asm-ppc64/iSeries/mf.h b/include/asm-ppc64/iSeries/mf.h index 2e59a8e15a0b..7e6a0d936999 100644 --- a/include/asm-ppc64/iSeries/mf.h +++ b/include/asm-ppc64/iSeries/mf.h | |||
@@ -9,17 +9,16 @@ | |||
9 | * all partitions in the iSeries. It also provides miscellaneous low-level | 9 | * all partitions in the iSeries. It also provides miscellaneous low-level |
10 | * machine facility type operations. | 10 | * machine facility type operations. |
11 | * | 11 | * |
12 | * | ||
13 | * This program is free software; you can redistribute it and/or modify | 12 | * This program is free software; you can redistribute it and/or modify |
14 | * it under the terms of the GNU General Public License as published by | 13 | * it under the terms of the GNU General Public License as published by |
15 | * the Free Software Foundation; either version 2 of the License, or | 14 | * the Free Software Foundation; either version 2 of the License, or |
16 | * (at your option) any later version. | 15 | * (at your option) any later version. |
17 | * | 16 | * |
18 | * This program is distributed in the hope that it will be useful, | 17 | * This program is distributed in the hope that it will be useful, |
19 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | 18 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
20 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 19 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
21 | * GNU General Public License for more details. | 20 | * GNU General Public License for more details. |
22 | * | 21 | * |
23 | * You should have received a copy of the GNU General Public License | 22 | * You should have received a copy of the GNU General Public License |
24 | * along with this program; if not, write to the Free Software | 23 | * along with this program; if not, write to the Free Software |
25 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | 24 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
@@ -52,6 +51,7 @@ extern void mf_clear_src(void); | |||
52 | extern void mf_init(void); | 51 | extern void mf_init(void); |
53 | 52 | ||
54 | extern int mf_get_rtc(struct rtc_time *tm); | 53 | extern int mf_get_rtc(struct rtc_time *tm); |
54 | extern int mf_get_boot_rtc(struct rtc_time *tm); | ||
55 | extern int mf_set_rtc(struct rtc_time *tm); | 55 | extern int mf_set_rtc(struct rtc_time *tm); |
56 | 56 | ||
57 | #endif /* _ASM_PPC64_ISERIES_MF_H */ | 57 | #endif /* _ASM_PPC64_ISERIES_MF_H */ |
diff --git a/include/asm-ppc64/iSeries/vio.h b/include/asm-ppc64/iSeries/vio.h index 3e5766a849d6..6c05e6257f53 100644 --- a/include/asm-ppc64/iSeries/vio.h +++ b/include/asm-ppc64/iSeries/vio.h | |||
@@ -8,32 +8,32 @@ | |||
8 | * Colin Devilbiss <devilbis@us.ibm.com> | 8 | * Colin Devilbiss <devilbis@us.ibm.com> |
9 | * | 9 | * |
10 | * (C) Copyright 2000 IBM Corporation | 10 | * (C) Copyright 2000 IBM Corporation |
11 | * | 11 | * |
12 | * This header file is used by the iSeries virtual I/O device | 12 | * This header file is used by the iSeries virtual I/O device |
13 | * drivers. It defines the interfaces to the common functions | 13 | * drivers. It defines the interfaces to the common functions |
14 | * (implemented in drivers/char/viopath.h) as well as defining | 14 | * (implemented in drivers/char/viopath.h) as well as defining |
15 | * common functions and structures. Currently (at the time I | 15 | * common functions and structures. Currently (at the time I |
16 | * wrote this comment) the iSeries virtual I/O device drivers | 16 | * wrote this comment) the iSeries virtual I/O device drivers |
17 | * that use this are | 17 | * that use this are |
18 | * drivers/block/viodasd.c | 18 | * drivers/block/viodasd.c |
19 | * drivers/char/viocons.c | 19 | * drivers/char/viocons.c |
20 | * drivers/char/viotape.c | 20 | * drivers/char/viotape.c |
21 | * drivers/cdrom/viocd.c | 21 | * drivers/cdrom/viocd.c |
22 | * | 22 | * |
23 | * The iSeries virtual ethernet support (veth.c) uses a whole | 23 | * The iSeries virtual ethernet support (veth.c) uses a whole |
24 | * different set of functions. | 24 | * different set of functions. |
25 | * | 25 | * |
26 | * This program is free software; you can redistribute it and/or | 26 | * This program is free software; you can redistribute it and/or |
27 | * modify it under the terms of the GNU General Public License as | 27 | * modify it under the terms of the GNU General Public License as |
28 | * published by the Free Software Foundation; either version 2 of the | 28 | * published by the Free Software Foundation; either version 2 of the |
29 | * License, or (at your option) anyu later version. | 29 | * License, or (at your option) anyu later version. |
30 | * | 30 | * |
31 | * This program is distributed in the hope that it will be useful, but | 31 | * This program is distributed in the hope that it will be useful, but |
32 | * WITHOUT ANY WARRANTY; without even the implied warranty of | 32 | * WITHOUT ANY WARRANTY; without even the implied warranty of |
33 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 33 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
34 | * General Public License for more details. | 34 | * General Public License for more details. |
35 | * | 35 | * |
36 | * You should have received a copy of the GNU General Public License | 36 | * You should have received a copy of the GNU General Public License |
37 | * along with this program; if not, write to the Free Software Foundation, | 37 | * along with this program; if not, write to the Free Software Foundation, |
38 | * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | 38 | * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
39 | * | 39 | * |
@@ -44,39 +44,41 @@ | |||
44 | #include <asm/iSeries/HvTypes.h> | 44 | #include <asm/iSeries/HvTypes.h> |
45 | #include <asm/iSeries/HvLpEvent.h> | 45 | #include <asm/iSeries/HvLpEvent.h> |
46 | 46 | ||
47 | /* iSeries virtual I/O events use the subtype field in | 47 | /* |
48 | * iSeries virtual I/O events use the subtype field in | ||
48 | * HvLpEvent to figure out what kind of vio event is coming | 49 | * HvLpEvent to figure out what kind of vio event is coming |
49 | * in. We use a table to route these, and this defines | 50 | * in. We use a table to route these, and this defines |
50 | * the maximum number of distinct subtypes | 51 | * the maximum number of distinct subtypes |
51 | */ | 52 | */ |
52 | #define VIO_MAX_SUBTYPES 8 | 53 | #define VIO_MAX_SUBTYPES 8 |
53 | 54 | ||
54 | /* Each subtype can register a handler to process their events. | 55 | /* |
56 | * Each subtype can register a handler to process their events. | ||
55 | * The handler must have this interface. | 57 | * The handler must have this interface. |
56 | */ | 58 | */ |
57 | typedef void (vio_event_handler_t) (struct HvLpEvent * event); | 59 | typedef void (vio_event_handler_t) (struct HvLpEvent * event); |
58 | 60 | ||
59 | int viopath_open(HvLpIndex remoteLp, int subtype, int numReq); | 61 | extern int viopath_open(HvLpIndex remoteLp, int subtype, int numReq); |
60 | int viopath_close(HvLpIndex remoteLp, int subtype, int numReq); | 62 | extern int viopath_close(HvLpIndex remoteLp, int subtype, int numReq); |
61 | int vio_setHandler(int subtype, vio_event_handler_t * beh); | 63 | extern int vio_setHandler(int subtype, vio_event_handler_t * beh); |
62 | int vio_clearHandler(int subtype); | 64 | extern int vio_clearHandler(int subtype); |
63 | int viopath_isactive(HvLpIndex lp); | 65 | extern int viopath_isactive(HvLpIndex lp); |
64 | HvLpInstanceId viopath_sourceinst(HvLpIndex lp); | 66 | extern HvLpInstanceId viopath_sourceinst(HvLpIndex lp); |
65 | HvLpInstanceId viopath_targetinst(HvLpIndex lp); | 67 | extern HvLpInstanceId viopath_targetinst(HvLpIndex lp); |
66 | void vio_set_hostlp(void); | 68 | extern void vio_set_hostlp(void); |
67 | void *vio_get_event_buffer(int subtype); | 69 | extern void *vio_get_event_buffer(int subtype); |
68 | void vio_free_event_buffer(int subtype, void *buffer); | 70 | extern void vio_free_event_buffer(int subtype, void *buffer); |
69 | 71 | ||
70 | extern HvLpIndex viopath_hostLp; | 72 | extern HvLpIndex viopath_hostLp; |
71 | extern HvLpIndex viopath_ourLp; | 73 | extern HvLpIndex viopath_ourLp; |
72 | 74 | ||
73 | #define VIOCHAR_MAX_DATA 200 | 75 | #define VIOCHAR_MAX_DATA 200 |
74 | 76 | ||
75 | #define VIOMAJOR_SUBTYPE_MASK 0xff00 | 77 | #define VIOMAJOR_SUBTYPE_MASK 0xff00 |
76 | #define VIOMINOR_SUBTYPE_MASK 0x00ff | 78 | #define VIOMINOR_SUBTYPE_MASK 0x00ff |
77 | #define VIOMAJOR_SUBTYPE_SHIFT 8 | 79 | #define VIOMAJOR_SUBTYPE_SHIFT 8 |
78 | 80 | ||
79 | #define VIOVERSION 0x0101 | 81 | #define VIOVERSION 0x0101 |
80 | 82 | ||
81 | /* | 83 | /* |
82 | * This is the general structure for VIO errors; each module should have | 84 | * This is the general structure for VIO errors; each module should have |
@@ -89,8 +91,8 @@ struct vio_error_entry { | |||
89 | int errno; | 91 | int errno; |
90 | const char *msg; | 92 | const char *msg; |
91 | }; | 93 | }; |
92 | const struct vio_error_entry *vio_lookup_rc(const struct vio_error_entry | 94 | extern const struct vio_error_entry *vio_lookup_rc( |
93 | *local_table, u16 rc); | 95 | const struct vio_error_entry *local_table, u16 rc); |
94 | 96 | ||
95 | enum viosubtypes { | 97 | enum viosubtypes { |
96 | viomajorsubtype_monitor = 0x0100, | 98 | viomajorsubtype_monitor = 0x0100, |
@@ -102,7 +104,6 @@ enum viosubtypes { | |||
102 | viomajorsubtype_scsi = 0x0700 | 104 | viomajorsubtype_scsi = 0x0700 |
103 | }; | 105 | }; |
104 | 106 | ||
105 | |||
106 | enum vioconfigsubtype { | 107 | enum vioconfigsubtype { |
107 | vioconfigget = 0x0001, | 108 | vioconfigget = 0x0001, |
108 | }; | 109 | }; |
diff --git a/include/asm-ppc64/imalloc.h b/include/asm-ppc64/imalloc.h index 3a45e918bf16..e46ff68a6e41 100644 --- a/include/asm-ppc64/imalloc.h +++ b/include/asm-ppc64/imalloc.h | |||
@@ -4,9 +4,9 @@ | |||
4 | /* | 4 | /* |
5 | * Define the address range of the imalloc VM area. | 5 | * Define the address range of the imalloc VM area. |
6 | */ | 6 | */ |
7 | #define PHBS_IO_BASE IOREGIONBASE | 7 | #define PHBS_IO_BASE VMALLOC_END |
8 | #define IMALLOC_BASE (IOREGIONBASE + 0x80000000ul) /* Reserve 2 gigs for PHBs */ | 8 | #define IMALLOC_BASE (PHBS_IO_BASE + 0x80000000ul) /* Reserve 2 gigs for PHBs */ |
9 | #define IMALLOC_END (IOREGIONBASE + EADDR_MASK) | 9 | #define IMALLOC_END (VMALLOC_START + EADDR_MASK) |
10 | 10 | ||
11 | 11 | ||
12 | /* imalloc region types */ | 12 | /* imalloc region types */ |
@@ -18,7 +18,9 @@ | |||
18 | 18 | ||
19 | extern struct vm_struct * im_get_free_area(unsigned long size); | 19 | extern struct vm_struct * im_get_free_area(unsigned long size); |
20 | extern struct vm_struct * im_get_area(unsigned long v_addr, unsigned long size, | 20 | extern struct vm_struct * im_get_area(unsigned long v_addr, unsigned long size, |
21 | int region_type); | 21 | int region_type); |
22 | unsigned long im_free(void *addr); | 22 | extern void im_free(void *addr); |
23 | |||
24 | extern unsigned long ioremap_bot; | ||
23 | 25 | ||
24 | #endif /* _PPC64_IMALLOC_H */ | 26 | #endif /* _PPC64_IMALLOC_H */ |
diff --git a/include/asm-ppc64/iommu.h b/include/asm-ppc64/iommu.h index bd53ca4dcfa2..729de5cc21d9 100644 --- a/include/asm-ppc64/iommu.h +++ b/include/asm-ppc64/iommu.h | |||
@@ -82,24 +82,6 @@ struct iommu_table { | |||
82 | unsigned long *it_map; /* A simple allocation bitmap for now */ | 82 | unsigned long *it_map; /* A simple allocation bitmap for now */ |
83 | }; | 83 | }; |
84 | 84 | ||
85 | #ifdef CONFIG_PPC_ISERIES | ||
86 | struct iommu_table_cb { | ||
87 | unsigned long itc_busno; /* Bus number for this tce table */ | ||
88 | unsigned long itc_start; /* Will be NULL for secondary */ | ||
89 | unsigned long itc_totalsize; /* Size (in pages) of whole table */ | ||
90 | unsigned long itc_offset; /* Index into real tce table of the | ||
91 | start of our section */ | ||
92 | unsigned long itc_size; /* Size (in pages) of our section */ | ||
93 | unsigned long itc_index; /* Index of this tce table */ | ||
94 | unsigned short itc_maxtables; /* Max num of tables for partition */ | ||
95 | unsigned char itc_virtbus; /* Flag to indicate virtual bus */ | ||
96 | unsigned char itc_slotno; /* IOA Tce Slot Index */ | ||
97 | unsigned char itc_rsvd[4]; | ||
98 | }; | ||
99 | |||
100 | extern struct iommu_table vio_tce_table; /* Tce table for virtual bus */ | ||
101 | #endif /* CONFIG_PPC_ISERIES */ | ||
102 | |||
103 | struct scatterlist; | 85 | struct scatterlist; |
104 | 86 | ||
105 | #ifdef CONFIG_PPC_MULTIPLATFORM | 87 | #ifdef CONFIG_PPC_MULTIPLATFORM |
@@ -122,9 +104,6 @@ extern void iommu_devnode_init_pSeries(struct device_node *dn); | |||
122 | 104 | ||
123 | #ifdef CONFIG_PPC_ISERIES | 105 | #ifdef CONFIG_PPC_ISERIES |
124 | 106 | ||
125 | /* Walks all buses and creates iommu tables */ | ||
126 | extern void iommu_setup_iSeries(void); | ||
127 | |||
128 | /* Initializes tables for bio buses */ | 107 | /* Initializes tables for bio buses */ |
129 | extern void __init iommu_vio_init(void); | 108 | extern void __init iommu_vio_init(void); |
130 | 109 | ||
@@ -158,8 +137,12 @@ extern void iommu_init_early_pSeries(void); | |||
158 | extern void iommu_init_early_iSeries(void); | 137 | extern void iommu_init_early_iSeries(void); |
159 | extern void iommu_init_early_u3(void); | 138 | extern void iommu_init_early_u3(void); |
160 | 139 | ||
140 | #ifdef CONFIG_PCI | ||
161 | extern void pci_iommu_init(void); | 141 | extern void pci_iommu_init(void); |
162 | extern void pci_direct_iommu_init(void); | 142 | extern void pci_direct_iommu_init(void); |
143 | #else | ||
144 | static inline void pci_iommu_init(void) { } | ||
145 | #endif | ||
163 | 146 | ||
164 | extern void alloc_u3_dart_table(void); | 147 | extern void alloc_u3_dart_table(void); |
165 | 148 | ||
diff --git a/include/asm-ppc64/paca.h b/include/asm-ppc64/paca.h index 1a0223b5f3b8..ae76cae1483f 100644 --- a/include/asm-ppc64/paca.h +++ b/include/asm-ppc64/paca.h | |||
@@ -20,13 +20,13 @@ | |||
20 | #include <asm/types.h> | 20 | #include <asm/types.h> |
21 | #include <asm/lppaca.h> | 21 | #include <asm/lppaca.h> |
22 | #include <asm/iSeries/ItLpRegSave.h> | 22 | #include <asm/iSeries/ItLpRegSave.h> |
23 | #include <asm/iSeries/ItLpQueue.h> | ||
23 | #include <asm/mmu.h> | 24 | #include <asm/mmu.h> |
24 | 25 | ||
25 | register struct paca_struct *local_paca asm("r13"); | 26 | register struct paca_struct *local_paca asm("r13"); |
26 | #define get_paca() local_paca | 27 | #define get_paca() local_paca |
27 | 28 | ||
28 | struct task_struct; | 29 | struct task_struct; |
29 | struct ItLpQueue; | ||
30 | 30 | ||
31 | /* | 31 | /* |
32 | * Defines the layout of the paca. | 32 | * Defines the layout of the paca. |
diff --git a/include/asm-ppc64/page.h b/include/asm-ppc64/page.h index bcd21789d3b7..257d87eb7c34 100644 --- a/include/asm-ppc64/page.h +++ b/include/asm-ppc64/page.h | |||
@@ -202,9 +202,7 @@ extern u64 ppc64_pft_size; /* Log 2 of page table size */ | |||
202 | #define PAGE_OFFSET ASM_CONST(0xC000000000000000) | 202 | #define PAGE_OFFSET ASM_CONST(0xC000000000000000) |
203 | #define KERNELBASE PAGE_OFFSET | 203 | #define KERNELBASE PAGE_OFFSET |
204 | #define VMALLOCBASE ASM_CONST(0xD000000000000000) | 204 | #define VMALLOCBASE ASM_CONST(0xD000000000000000) |
205 | #define IOREGIONBASE ASM_CONST(0xE000000000000000) | ||
206 | 205 | ||
207 | #define IO_REGION_ID (IOREGIONBASE >> REGION_SHIFT) | ||
208 | #define VMALLOC_REGION_ID (VMALLOCBASE >> REGION_SHIFT) | 206 | #define VMALLOC_REGION_ID (VMALLOCBASE >> REGION_SHIFT) |
209 | #define KERNEL_REGION_ID (KERNELBASE >> REGION_SHIFT) | 207 | #define KERNEL_REGION_ID (KERNELBASE >> REGION_SHIFT) |
210 | #define USER_REGION_ID (0UL) | 208 | #define USER_REGION_ID (0UL) |
diff --git a/include/asm-ppc64/pgtable.h b/include/asm-ppc64/pgtable.h index 264c4f7993be..46cf61c2ff69 100644 --- a/include/asm-ppc64/pgtable.h +++ b/include/asm-ppc64/pgtable.h | |||
@@ -53,7 +53,8 @@ | |||
53 | * Define the address range of the vmalloc VM area. | 53 | * Define the address range of the vmalloc VM area. |
54 | */ | 54 | */ |
55 | #define VMALLOC_START (0xD000000000000000ul) | 55 | #define VMALLOC_START (0xD000000000000000ul) |
56 | #define VMALLOC_END (VMALLOC_START + EADDR_MASK) | 56 | #define VMALLOC_SIZE (0x10000000000UL) |
57 | #define VMALLOC_END (VMALLOC_START + VMALLOC_SIZE) | ||
57 | 58 | ||
58 | /* | 59 | /* |
59 | * Bits in a linux-style PTE. These match the bits in the | 60 | * Bits in a linux-style PTE. These match the bits in the |
@@ -239,9 +240,6 @@ static inline pte_t pfn_pte(unsigned long pfn, pgprot_t pgprot) | |||
239 | /* This now only contains the vmalloc pages */ | 240 | /* This now only contains the vmalloc pages */ |
240 | #define pgd_offset_k(address) pgd_offset(&init_mm, address) | 241 | #define pgd_offset_k(address) pgd_offset(&init_mm, address) |
241 | 242 | ||
242 | /* to find an entry in the ioremap page-table-directory */ | ||
243 | #define pgd_offset_i(address) (ioremap_pgd + pgd_index(address)) | ||
244 | |||
245 | /* | 243 | /* |
246 | * The following only work if pte_present() is true. | 244 | * The following only work if pte_present() is true. |
247 | * Undefined behaviour if not.. | 245 | * Undefined behaviour if not.. |
@@ -459,15 +457,12 @@ extern pgprot_t phys_mem_access_prot(struct file *file, unsigned long addr, | |||
459 | #define __HAVE_ARCH_PTE_SAME | 457 | #define __HAVE_ARCH_PTE_SAME |
460 | #define pte_same(A,B) (((pte_val(A) ^ pte_val(B)) & ~_PAGE_HPTEFLAGS) == 0) | 458 | #define pte_same(A,B) (((pte_val(A) ^ pte_val(B)) & ~_PAGE_HPTEFLAGS) == 0) |
461 | 459 | ||
462 | extern unsigned long ioremap_bot, ioremap_base; | ||
463 | |||
464 | #define pmd_ERROR(e) \ | 460 | #define pmd_ERROR(e) \ |
465 | printk("%s:%d: bad pmd %08x.\n", __FILE__, __LINE__, pmd_val(e)) | 461 | printk("%s:%d: bad pmd %08x.\n", __FILE__, __LINE__, pmd_val(e)) |
466 | #define pgd_ERROR(e) \ | 462 | #define pgd_ERROR(e) \ |
467 | printk("%s:%d: bad pgd %08x.\n", __FILE__, __LINE__, pgd_val(e)) | 463 | printk("%s:%d: bad pgd %08x.\n", __FILE__, __LINE__, pgd_val(e)) |
468 | 464 | ||
469 | extern pgd_t swapper_pg_dir[]; | 465 | extern pgd_t swapper_pg_dir[]; |
470 | extern pgd_t ioremap_dir[]; | ||
471 | 466 | ||
472 | extern void paging_init(void); | 467 | extern void paging_init(void); |
473 | 468 | ||
diff --git a/include/asm-ppc64/processor.h b/include/asm-ppc64/processor.h index 0035efe2db2b..3084099086a8 100644 --- a/include/asm-ppc64/processor.h +++ b/include/asm-ppc64/processor.h | |||
@@ -120,103 +120,18 @@ | |||
120 | 120 | ||
121 | /* Special Purpose Registers (SPRNs)*/ | 121 | /* Special Purpose Registers (SPRNs)*/ |
122 | 122 | ||
123 | #define SPRN_CDBCR 0x3D7 /* Cache Debug Control Register */ | ||
124 | #define SPRN_CTR 0x009 /* Count Register */ | 123 | #define SPRN_CTR 0x009 /* Count Register */ |
125 | #define SPRN_DABR 0x3F5 /* Data Address Breakpoint Register */ | 124 | #define SPRN_DABR 0x3F5 /* Data Address Breakpoint Register */ |
126 | #define SPRN_DAC1 0x3F6 /* Data Address Compare 1 */ | 125 | #define DABR_TRANSLATION (1UL << 2) |
127 | #define SPRN_DAC2 0x3F7 /* Data Address Compare 2 */ | ||
128 | #define SPRN_DAR 0x013 /* Data Address Register */ | 126 | #define SPRN_DAR 0x013 /* Data Address Register */ |
129 | #define SPRN_DBCR 0x3F2 /* Debug Control Regsiter */ | ||
130 | #define DBCR_EDM 0x80000000 | ||
131 | #define DBCR_IDM 0x40000000 | ||
132 | #define DBCR_RST(x) (((x) & 0x3) << 28) | ||
133 | #define DBCR_RST_NONE 0 | ||
134 | #define DBCR_RST_CORE 1 | ||
135 | #define DBCR_RST_CHIP 2 | ||
136 | #define DBCR_RST_SYSTEM 3 | ||
137 | #define DBCR_IC 0x08000000 /* Instruction Completion Debug Evnt */ | ||
138 | #define DBCR_BT 0x04000000 /* Branch Taken Debug Event */ | ||
139 | #define DBCR_EDE 0x02000000 /* Exception Debug Event */ | ||
140 | #define DBCR_TDE 0x01000000 /* TRAP Debug Event */ | ||
141 | #define DBCR_FER 0x00F80000 /* First Events Remaining Mask */ | ||
142 | #define DBCR_FT 0x00040000 /* Freeze Timers on Debug Event */ | ||
143 | #define DBCR_IA1 0x00020000 /* Instr. Addr. Compare 1 Enable */ | ||
144 | #define DBCR_IA2 0x00010000 /* Instr. Addr. Compare 2 Enable */ | ||
145 | #define DBCR_D1R 0x00008000 /* Data Addr. Compare 1 Read Enable */ | ||
146 | #define DBCR_D1W 0x00004000 /* Data Addr. Compare 1 Write Enable */ | ||
147 | #define DBCR_D1S(x) (((x) & 0x3) << 12) /* Data Adrr. Compare 1 Size */ | ||
148 | #define DAC_BYTE 0 | ||
149 | #define DAC_HALF 1 | ||
150 | #define DAC_WORD 2 | ||
151 | #define DAC_QUAD 3 | ||
152 | #define DBCR_D2R 0x00000800 /* Data Addr. Compare 2 Read Enable */ | ||
153 | #define DBCR_D2W 0x00000400 /* Data Addr. Compare 2 Write Enable */ | ||
154 | #define DBCR_D2S(x) (((x) & 0x3) << 8) /* Data Addr. Compare 2 Size */ | ||
155 | #define DBCR_SBT 0x00000040 /* Second Branch Taken Debug Event */ | ||
156 | #define DBCR_SED 0x00000020 /* Second Exception Debug Event */ | ||
157 | #define DBCR_STD 0x00000010 /* Second Trap Debug Event */ | ||
158 | #define DBCR_SIA 0x00000008 /* Second IAC Enable */ | ||
159 | #define DBCR_SDA 0x00000004 /* Second DAC Enable */ | ||
160 | #define DBCR_JOI 0x00000002 /* JTAG Serial Outbound Int. Enable */ | ||
161 | #define DBCR_JII 0x00000001 /* JTAG Serial Inbound Int. Enable */ | ||
162 | #define SPRN_DBCR0 0x3F2 /* Debug Control Register 0 */ | ||
163 | #define SPRN_DBCR1 0x3BD /* Debug Control Register 1 */ | ||
164 | #define SPRN_DBSR 0x3F0 /* Debug Status Register */ | ||
165 | #define SPRN_DCCR 0x3FA /* Data Cache Cacheability Register */ | ||
166 | #define DCCR_NOCACHE 0 /* Noncacheable */ | ||
167 | #define DCCR_CACHE 1 /* Cacheable */ | ||
168 | #define SPRN_DCMP 0x3D1 /* Data TLB Compare Register */ | ||
169 | #define SPRN_DCWR 0x3BA /* Data Cache Write-thru Register */ | ||
170 | #define DCWR_COPY 0 /* Copy-back */ | ||
171 | #define DCWR_WRITE 1 /* Write-through */ | ||
172 | #define SPRN_DEAR 0x3D5 /* Data Error Address Register */ | ||
173 | #define SPRN_DEC 0x016 /* Decrement Register */ | 127 | #define SPRN_DEC 0x016 /* Decrement Register */ |
174 | #define SPRN_DMISS 0x3D0 /* Data TLB Miss Register */ | ||
175 | #define SPRN_DSISR 0x012 /* Data Storage Interrupt Status Register */ | 128 | #define SPRN_DSISR 0x012 /* Data Storage Interrupt Status Register */ |
176 | #define DSISR_NOHPTE 0x40000000 /* no translation found */ | 129 | #define DSISR_NOHPTE 0x40000000 /* no translation found */ |
177 | #define DSISR_PROTFAULT 0x08000000 /* protection fault */ | 130 | #define DSISR_PROTFAULT 0x08000000 /* protection fault */ |
178 | #define DSISR_ISSTORE 0x02000000 /* access was a store */ | 131 | #define DSISR_ISSTORE 0x02000000 /* access was a store */ |
179 | #define DSISR_DABRMATCH 0x00400000 /* hit data breakpoint */ | 132 | #define DSISR_DABRMATCH 0x00400000 /* hit data breakpoint */ |
180 | #define DSISR_NOSEGMENT 0x00200000 /* STAB/SLB miss */ | 133 | #define DSISR_NOSEGMENT 0x00200000 /* STAB/SLB miss */ |
181 | #define SPRN_EAR 0x11A /* External Address Register */ | ||
182 | #define SPRN_ESR 0x3D4 /* Exception Syndrome Register */ | ||
183 | #define ESR_IMCP 0x80000000 /* Instr. Machine Check - Protection */ | ||
184 | #define ESR_IMCN 0x40000000 /* Instr. Machine Check - Non-config */ | ||
185 | #define ESR_IMCB 0x20000000 /* Instr. Machine Check - Bus error */ | ||
186 | #define ESR_IMCT 0x10000000 /* Instr. Machine Check - Timeout */ | ||
187 | #define ESR_PIL 0x08000000 /* Program Exception - Illegal */ | ||
188 | #define ESR_PPR 0x04000000 /* Program Exception - Priveleged */ | ||
189 | #define ESR_PTR 0x02000000 /* Program Exception - Trap */ | ||
190 | #define ESR_DST 0x00800000 /* Storage Exception - Data miss */ | ||
191 | #define ESR_DIZ 0x00400000 /* Storage Exception - Zone fault */ | ||
192 | #define SPRN_EVPR 0x3D6 /* Exception Vector Prefix Register */ | ||
193 | #define SPRN_HASH1 0x3D2 /* Primary Hash Address Register */ | ||
194 | #define SPRN_HASH2 0x3D3 /* Secondary Hash Address Resgister */ | ||
195 | #define SPRN_HID0 0x3F0 /* Hardware Implementation Register 0 */ | 134 | #define SPRN_HID0 0x3F0 /* Hardware Implementation Register 0 */ |
196 | #define HID0_EMCP (1<<31) /* Enable Machine Check pin */ | ||
197 | #define HID0_EBA (1<<29) /* Enable Bus Address Parity */ | ||
198 | #define HID0_EBD (1<<28) /* Enable Bus Data Parity */ | ||
199 | #define HID0_SBCLK (1<<27) | ||
200 | #define HID0_EICE (1<<26) | ||
201 | #define HID0_ECLK (1<<25) | ||
202 | #define HID0_PAR (1<<24) | ||
203 | #define HID0_DOZE (1<<23) | ||
204 | #define HID0_NAP (1<<22) | ||
205 | #define HID0_SLEEP (1<<21) | ||
206 | #define HID0_DPM (1<<20) | ||
207 | #define HID0_ICE (1<<15) /* Instruction Cache Enable */ | ||
208 | #define HID0_DCE (1<<14) /* Data Cache Enable */ | ||
209 | #define HID0_ILOCK (1<<13) /* Instruction Cache Lock */ | ||
210 | #define HID0_DLOCK (1<<12) /* Data Cache Lock */ | ||
211 | #define HID0_ICFI (1<<11) /* Instr. Cache Flash Invalidate */ | ||
212 | #define HID0_DCI (1<<10) /* Data Cache Invalidate */ | ||
213 | #define HID0_SPD (1<<9) /* Speculative disable */ | ||
214 | #define HID0_SGE (1<<7) /* Store Gathering Enable */ | ||
215 | #define HID0_SIED (1<<7) /* Serial Instr. Execution [Disable] */ | ||
216 | #define HID0_BTIC (1<<5) /* Branch Target Instruction Cache Enable */ | ||
217 | #define HID0_ABE (1<<3) /* Address Broadcast Enable */ | ||
218 | #define HID0_BHTE (1<<2) /* Branch History Table Enable */ | ||
219 | #define HID0_BTCD (1<<1) /* Branch target cache disable */ | ||
220 | #define SPRN_MSRDORM 0x3F1 /* Hardware Implementation Register 1 */ | 135 | #define SPRN_MSRDORM 0x3F1 /* Hardware Implementation Register 1 */ |
221 | #define SPRN_HID1 0x3F1 /* Hardware Implementation Register 1 */ | 136 | #define SPRN_HID1 0x3F1 /* Hardware Implementation Register 1 */ |
222 | #define SPRN_IABR 0x3F2 /* Instruction Address Breakpoint Register */ | 137 | #define SPRN_IABR 0x3F2 /* Instruction Address Breakpoint Register */ |
@@ -225,23 +140,8 @@ | |||
225 | #define SPRN_HID5 0x3F6 /* 970 HID5 */ | 140 | #define SPRN_HID5 0x3F6 /* 970 HID5 */ |
226 | #define SPRN_TSC 0x3FD /* Thread switch control */ | 141 | #define SPRN_TSC 0x3FD /* Thread switch control */ |
227 | #define SPRN_TST 0x3FC /* Thread switch timeout */ | 142 | #define SPRN_TST 0x3FC /* Thread switch timeout */ |
228 | #define SPRN_IAC1 0x3F4 /* Instruction Address Compare 1 */ | ||
229 | #define SPRN_IAC2 0x3F5 /* Instruction Address Compare 2 */ | ||
230 | #define SPRN_ICCR 0x3FB /* Instruction Cache Cacheability Register */ | ||
231 | #define ICCR_NOCACHE 0 /* Noncacheable */ | ||
232 | #define ICCR_CACHE 1 /* Cacheable */ | ||
233 | #define SPRN_ICDBDR 0x3D3 /* Instruction Cache Debug Data Register */ | ||
234 | #define SPRN_ICMP 0x3D5 /* Instruction TLB Compare Register */ | ||
235 | #define SPRN_ICTC 0x3FB /* Instruction Cache Throttling Control Reg */ | ||
236 | #define SPRN_IMISS 0x3D4 /* Instruction TLB Miss Register */ | ||
237 | #define SPRN_IMMR 0x27E /* Internal Memory Map Register */ | ||
238 | #define SPRN_L2CR 0x3F9 /* Level 2 Cache Control Regsiter */ | 143 | #define SPRN_L2CR 0x3F9 /* Level 2 Cache Control Regsiter */ |
239 | #define SPRN_LR 0x008 /* Link Register */ | 144 | #define SPRN_LR 0x008 /* Link Register */ |
240 | #define SPRN_PBL1 0x3FC /* Protection Bound Lower 1 */ | ||
241 | #define SPRN_PBL2 0x3FE /* Protection Bound Lower 2 */ | ||
242 | #define SPRN_PBU1 0x3FD /* Protection Bound Upper 1 */ | ||
243 | #define SPRN_PBU2 0x3FF /* Protection Bound Upper 2 */ | ||
244 | #define SPRN_PID 0x3B1 /* Process ID */ | ||
245 | #define SPRN_PIR 0x3FF /* Processor Identification Register */ | 145 | #define SPRN_PIR 0x3FF /* Processor Identification Register */ |
246 | #define SPRN_PIT 0x3DB /* Programmable Interval Timer */ | 146 | #define SPRN_PIT 0x3DB /* Programmable Interval Timer */ |
247 | #define SPRN_PURR 0x135 /* Processor Utilization of Resources Register */ | 147 | #define SPRN_PURR 0x135 /* Processor Utilization of Resources Register */ |
@@ -249,9 +149,6 @@ | |||
249 | #define SPRN_RPA 0x3D6 /* Required Physical Address Register */ | 149 | #define SPRN_RPA 0x3D6 /* Required Physical Address Register */ |
250 | #define SPRN_SDA 0x3BF /* Sampled Data Address Register */ | 150 | #define SPRN_SDA 0x3BF /* Sampled Data Address Register */ |
251 | #define SPRN_SDR1 0x019 /* MMU Hash Base Register */ | 151 | #define SPRN_SDR1 0x019 /* MMU Hash Base Register */ |
252 | #define SPRN_SGR 0x3B9 /* Storage Guarded Register */ | ||
253 | #define SGR_NORMAL 0 | ||
254 | #define SGR_GUARDED 1 | ||
255 | #define SPRN_SIA 0x3BB /* Sampled Instruction Address Register */ | 152 | #define SPRN_SIA 0x3BB /* Sampled Instruction Address Register */ |
256 | #define SPRN_SPRG0 0x110 /* Special Purpose Register General 0 */ | 153 | #define SPRN_SPRG0 0x110 /* Special Purpose Register General 0 */ |
257 | #define SPRN_SPRG1 0x111 /* Special Purpose Register General 1 */ | 154 | #define SPRN_SPRG1 0x111 /* Special Purpose Register General 1 */ |
@@ -264,50 +161,12 @@ | |||
264 | #define SPRN_TBWL 0x11C /* Time Base Lower Register (super, W/O) */ | 161 | #define SPRN_TBWL 0x11C /* Time Base Lower Register (super, W/O) */ |
265 | #define SPRN_TBWU 0x11D /* Time Base Write Upper Register (super, W/O) */ | 162 | #define SPRN_TBWU 0x11D /* Time Base Write Upper Register (super, W/O) */ |
266 | #define SPRN_HIOR 0x137 /* 970 Hypervisor interrupt offset */ | 163 | #define SPRN_HIOR 0x137 /* 970 Hypervisor interrupt offset */ |
267 | #define SPRN_TCR 0x3DA /* Timer Control Register */ | ||
268 | #define TCR_WP(x) (((x)&0x3)<<30) /* WDT Period */ | ||
269 | #define WP_2_17 0 /* 2^17 clocks */ | ||
270 | #define WP_2_21 1 /* 2^21 clocks */ | ||
271 | #define WP_2_25 2 /* 2^25 clocks */ | ||
272 | #define WP_2_29 3 /* 2^29 clocks */ | ||
273 | #define TCR_WRC(x) (((x)&0x3)<<28) /* WDT Reset Control */ | ||
274 | #define WRC_NONE 0 /* No reset will occur */ | ||
275 | #define WRC_CORE 1 /* Core reset will occur */ | ||
276 | #define WRC_CHIP 2 /* Chip reset will occur */ | ||
277 | #define WRC_SYSTEM 3 /* System reset will occur */ | ||
278 | #define TCR_WIE 0x08000000 /* WDT Interrupt Enable */ | ||
279 | #define TCR_PIE 0x04000000 /* PIT Interrupt Enable */ | ||
280 | #define TCR_FP(x) (((x)&0x3)<<24) /* FIT Period */ | ||
281 | #define FP_2_9 0 /* 2^9 clocks */ | ||
282 | #define FP_2_13 1 /* 2^13 clocks */ | ||
283 | #define FP_2_17 2 /* 2^17 clocks */ | ||
284 | #define FP_2_21 3 /* 2^21 clocks */ | ||
285 | #define TCR_FIE 0x00800000 /* FIT Interrupt Enable */ | ||
286 | #define TCR_ARE 0x00400000 /* Auto Reload Enable */ | ||
287 | #define SPRN_THRM1 0x3FC /* Thermal Management Register 1 */ | ||
288 | #define THRM1_TIN (1<<0) | ||
289 | #define THRM1_TIV (1<<1) | ||
290 | #define THRM1_THRES (0x7f<<2) | ||
291 | #define THRM1_TID (1<<29) | ||
292 | #define THRM1_TIE (1<<30) | ||
293 | #define THRM1_V (1<<31) | ||
294 | #define SPRN_THRM2 0x3FD /* Thermal Management Register 2 */ | ||
295 | #define SPRN_THRM3 0x3FE /* Thermal Management Register 3 */ | ||
296 | #define THRM3_E (1<<31) | ||
297 | #define SPRN_TSR 0x3D8 /* Timer Status Register */ | ||
298 | #define TSR_ENW 0x80000000 /* Enable Next Watchdog */ | ||
299 | #define TSR_WIS 0x40000000 /* WDT Interrupt Status */ | ||
300 | #define TSR_WRS(x) (((x)&0x3)<<28) /* WDT Reset Status */ | ||
301 | #define WRS_NONE 0 /* No WDT reset occurred */ | ||
302 | #define WRS_CORE 1 /* WDT forced core reset */ | ||
303 | #define WRS_CHIP 2 /* WDT forced chip reset */ | ||
304 | #define WRS_SYSTEM 3 /* WDT forced system reset */ | ||
305 | #define TSR_PIS 0x08000000 /* PIT Interrupt Status */ | ||
306 | #define TSR_FIS 0x04000000 /* FIT Interrupt Status */ | ||
307 | #define SPRN_USIA 0x3AB /* User Sampled Instruction Address Register */ | 164 | #define SPRN_USIA 0x3AB /* User Sampled Instruction Address Register */ |
308 | #define SPRN_XER 0x001 /* Fixed Point Exception Register */ | 165 | #define SPRN_XER 0x001 /* Fixed Point Exception Register */ |
309 | #define SPRN_ZPR 0x3B0 /* Zone Protection Register */ | ||
310 | #define SPRN_VRSAVE 0x100 /* Vector save */ | 166 | #define SPRN_VRSAVE 0x100 /* Vector save */ |
167 | #define SPRN_CTRLF 0x088 | ||
168 | #define SPRN_CTRLT 0x098 | ||
169 | #define CTRL_RUNLATCH 0x1 | ||
311 | 170 | ||
312 | /* Performance monitor SPRs */ | 171 | /* Performance monitor SPRs */ |
313 | #define SPRN_SIAR 780 | 172 | #define SPRN_SIAR 780 |
@@ -352,28 +211,19 @@ | |||
352 | #define CTR SPRN_CTR /* Counter Register */ | 211 | #define CTR SPRN_CTR /* Counter Register */ |
353 | #define DAR SPRN_DAR /* Data Address Register */ | 212 | #define DAR SPRN_DAR /* Data Address Register */ |
354 | #define DABR SPRN_DABR /* Data Address Breakpoint Register */ | 213 | #define DABR SPRN_DABR /* Data Address Breakpoint Register */ |
355 | #define DCMP SPRN_DCMP /* Data TLB Compare Register */ | ||
356 | #define DEC SPRN_DEC /* Decrement Register */ | 214 | #define DEC SPRN_DEC /* Decrement Register */ |
357 | #define DMISS SPRN_DMISS /* Data TLB Miss Register */ | ||
358 | #define DSISR SPRN_DSISR /* Data Storage Interrupt Status Register */ | 215 | #define DSISR SPRN_DSISR /* Data Storage Interrupt Status Register */ |
359 | #define EAR SPRN_EAR /* External Address Register */ | ||
360 | #define HASH1 SPRN_HASH1 /* Primary Hash Address Register */ | ||
361 | #define HASH2 SPRN_HASH2 /* Secondary Hash Address Register */ | ||
362 | #define HID0 SPRN_HID0 /* Hardware Implementation Register 0 */ | 216 | #define HID0 SPRN_HID0 /* Hardware Implementation Register 0 */ |
363 | #define MSRDORM SPRN_MSRDORM /* MSR Dormant Register */ | 217 | #define MSRDORM SPRN_MSRDORM /* MSR Dormant Register */ |
364 | #define NIADORM SPRN_NIADORM /* NIA Dormant Register */ | 218 | #define NIADORM SPRN_NIADORM /* NIA Dormant Register */ |
365 | #define TSC SPRN_TSC /* Thread switch control */ | 219 | #define TSC SPRN_TSC /* Thread switch control */ |
366 | #define TST SPRN_TST /* Thread switch timeout */ | 220 | #define TST SPRN_TST /* Thread switch timeout */ |
367 | #define IABR SPRN_IABR /* Instruction Address Breakpoint Register */ | 221 | #define IABR SPRN_IABR /* Instruction Address Breakpoint Register */ |
368 | #define ICMP SPRN_ICMP /* Instruction TLB Compare Register */ | ||
369 | #define IMISS SPRN_IMISS /* Instruction TLB Miss Register */ | ||
370 | #define IMMR SPRN_IMMR /* PPC 860/821 Internal Memory Map Register */ | ||
371 | #define L2CR SPRN_L2CR /* PPC 750 L2 control register */ | 222 | #define L2CR SPRN_L2CR /* PPC 750 L2 control register */ |
372 | #define __LR SPRN_LR | 223 | #define __LR SPRN_LR |
373 | #define PVR SPRN_PVR /* Processor Version */ | 224 | #define PVR SPRN_PVR /* Processor Version */ |
374 | #define PIR SPRN_PIR /* Processor ID */ | 225 | #define PIR SPRN_PIR /* Processor ID */ |
375 | #define PURR SPRN_PURR /* Processor Utilization of Resource Register */ | 226 | #define PURR SPRN_PURR /* Processor Utilization of Resource Register */ |
376 | //#define RPA SPRN_RPA /* Required Physical Address Register */ | ||
377 | #define SDR1 SPRN_SDR1 /* MMU hash base register */ | 227 | #define SDR1 SPRN_SDR1 /* MMU hash base register */ |
378 | #define SPR0 SPRN_SPRG0 /* Supervisor Private Registers */ | 228 | #define SPR0 SPRN_SPRG0 /* Supervisor Private Registers */ |
379 | #define SPR1 SPRN_SPRG1 | 229 | #define SPR1 SPRN_SPRG1 |
@@ -389,10 +239,6 @@ | |||
389 | #define TBRU SPRN_TBRU /* Time Base Read Upper Register */ | 239 | #define TBRU SPRN_TBRU /* Time Base Read Upper Register */ |
390 | #define TBWL SPRN_TBWL /* Time Base Write Lower Register */ | 240 | #define TBWL SPRN_TBWL /* Time Base Write Lower Register */ |
391 | #define TBWU SPRN_TBWU /* Time Base Write Upper Register */ | 241 | #define TBWU SPRN_TBWU /* Time Base Write Upper Register */ |
392 | #define ICTC 1019 | ||
393 | #define THRM1 SPRN_THRM1 /* Thermal Management Register 1 */ | ||
394 | #define THRM2 SPRN_THRM2 /* Thermal Management Register 2 */ | ||
395 | #define THRM3 SPRN_THRM3 /* Thermal Management Register 3 */ | ||
396 | #define XER SPRN_XER | 242 | #define XER SPRN_XER |
397 | 243 | ||
398 | /* Processor Version Register (PVR) field extraction */ | 244 | /* Processor Version Register (PVR) field extraction */ |
@@ -436,12 +282,6 @@ | |||
436 | #define XGLUE(a,b) a##b | 282 | #define XGLUE(a,b) a##b |
437 | #define GLUE(a,b) XGLUE(a,b) | 283 | #define GLUE(a,b) XGLUE(a,b) |
438 | 284 | ||
439 | /* iSeries CTRL register (for runlatch) */ | ||
440 | |||
441 | #define CTRLT 0x098 | ||
442 | #define CTRLF 0x088 | ||
443 | #define RUNLATCH 0x0001 | ||
444 | |||
445 | #ifdef __ASSEMBLY__ | 285 | #ifdef __ASSEMBLY__ |
446 | 286 | ||
447 | #define _GLOBAL(name) \ | 287 | #define _GLOBAL(name) \ |
@@ -590,16 +430,6 @@ struct thread_struct { | |||
590 | } | 430 | } |
591 | 431 | ||
592 | /* | 432 | /* |
593 | * Note: the vm_start and vm_end fields here should *not* | ||
594 | * be in kernel space. (Could vm_end == vm_start perhaps?) | ||
595 | */ | ||
596 | #define IOREMAP_MMAP { &ioremap_mm, 0, 0x1000, NULL, \ | ||
597 | PAGE_SHARED, VM_READ | VM_WRITE | VM_EXEC, \ | ||
598 | 1, NULL, NULL } | ||
599 | |||
600 | extern struct mm_struct ioremap_mm; | ||
601 | |||
602 | /* | ||
603 | * Return saved PC of a blocked thread. For now, this is the "user" PC | 433 | * Return saved PC of a blocked thread. For now, this is the "user" PC |
604 | */ | 434 | */ |
605 | #define thread_saved_pc(tsk) \ | 435 | #define thread_saved_pc(tsk) \ |
@@ -656,6 +486,24 @@ static inline void prefetchw(const void *x) | |||
656 | 486 | ||
657 | #define HAVE_ARCH_PICK_MMAP_LAYOUT | 487 | #define HAVE_ARCH_PICK_MMAP_LAYOUT |
658 | 488 | ||
489 | static inline void ppc64_runlatch_on(void) | ||
490 | { | ||
491 | unsigned long ctrl; | ||
492 | |||
493 | ctrl = mfspr(SPRN_CTRLF); | ||
494 | ctrl |= CTRL_RUNLATCH; | ||
495 | mtspr(SPRN_CTRLT, ctrl); | ||
496 | } | ||
497 | |||
498 | static inline void ppc64_runlatch_off(void) | ||
499 | { | ||
500 | unsigned long ctrl; | ||
501 | |||
502 | ctrl = mfspr(SPRN_CTRLF); | ||
503 | ctrl &= ~CTRL_RUNLATCH; | ||
504 | mtspr(SPRN_CTRLT, ctrl); | ||
505 | } | ||
506 | |||
659 | #endif /* __KERNEL__ */ | 507 | #endif /* __KERNEL__ */ |
660 | 508 | ||
661 | #endif /* __ASSEMBLY__ */ | 509 | #endif /* __ASSEMBLY__ */ |
diff --git a/include/asm-ppc64/prom.h b/include/asm-ppc64/prom.h index 2440a2c90ae9..04b1a84f7ca3 100644 --- a/include/asm-ppc64/prom.h +++ b/include/asm-ppc64/prom.h | |||
@@ -147,9 +147,7 @@ struct device_node { | |||
147 | struct device_node *sibling; | 147 | struct device_node *sibling; |
148 | struct device_node *next; /* next device of same type */ | 148 | struct device_node *next; /* next device of same type */ |
149 | struct device_node *allnext; /* next in list of all nodes */ | 149 | struct device_node *allnext; /* next in list of all nodes */ |
150 | struct proc_dir_entry *pde; /* this node's proc directory */ | 150 | struct proc_dir_entry *pde; /* this node's proc directory */ |
151 | struct proc_dir_entry *name_link; /* name symlink */ | ||
152 | struct proc_dir_entry *addr_link; /* addr symlink */ | ||
153 | struct kref kref; | 151 | struct kref kref; |
154 | unsigned long _flags; | 152 | unsigned long _flags; |
155 | }; | 153 | }; |
@@ -174,15 +172,6 @@ static inline void set_node_proc_entry(struct device_node *dn, struct proc_dir_e | |||
174 | dn->pde = de; | 172 | dn->pde = de; |
175 | } | 173 | } |
176 | 174 | ||
177 | static void inline set_node_name_link(struct device_node *dn, struct proc_dir_entry *de) | ||
178 | { | ||
179 | dn->name_link = de; | ||
180 | } | ||
181 | |||
182 | static void inline set_node_addr_link(struct device_node *dn, struct proc_dir_entry *de) | ||
183 | { | ||
184 | dn->addr_link = de; | ||
185 | } | ||
186 | 175 | ||
187 | /* OBSOLETE: Old stlye node lookup */ | 176 | /* OBSOLETE: Old stlye node lookup */ |
188 | extern struct device_node *find_devices(const char *name); | 177 | extern struct device_node *find_devices(const char *name); |
diff --git a/include/asm-ppc64/smp.h b/include/asm-ppc64/smp.h index c8646fa999c2..8115ecb8feee 100644 --- a/include/asm-ppc64/smp.h +++ b/include/asm-ppc64/smp.h | |||
@@ -45,7 +45,7 @@ void generic_cpu_die(unsigned int cpu); | |||
45 | void generic_mach_cpu_die(void); | 45 | void generic_mach_cpu_die(void); |
46 | #endif | 46 | #endif |
47 | 47 | ||
48 | #define __smp_processor_id() (get_paca()->paca_index) | 48 | #define raw_smp_processor_id() (get_paca()->paca_index) |
49 | #define hard_smp_processor_id() (get_paca()->hw_cpu_id) | 49 | #define hard_smp_processor_id() (get_paca()->hw_cpu_id) |
50 | 50 | ||
51 | extern cpumask_t cpu_sibling_map[NR_CPUS]; | 51 | extern cpumask_t cpu_sibling_map[NR_CPUS]; |
diff --git a/include/asm-ppc64/thread_info.h b/include/asm-ppc64/thread_info.h index 037b5e06083c..48b7900e90ec 100644 --- a/include/asm-ppc64/thread_info.h +++ b/include/asm-ppc64/thread_info.h | |||
@@ -96,7 +96,7 @@ static inline struct thread_info *current_thread_info(void) | |||
96 | #define TIF_POLLING_NRFLAG 4 /* true if poll_idle() is polling | 96 | #define TIF_POLLING_NRFLAG 4 /* true if poll_idle() is polling |
97 | TIF_NEED_RESCHED */ | 97 | TIF_NEED_RESCHED */ |
98 | #define TIF_32BIT 5 /* 32 bit binary */ | 98 | #define TIF_32BIT 5 /* 32 bit binary */ |
99 | #define TIF_RUN_LIGHT 6 /* iSeries run light */ | 99 | /* #define SPARE 6 */ |
100 | #define TIF_ABI_PENDING 7 /* 32/64 bit switch needed */ | 100 | #define TIF_ABI_PENDING 7 /* 32/64 bit switch needed */ |
101 | #define TIF_SYSCALL_AUDIT 8 /* syscall auditing active */ | 101 | #define TIF_SYSCALL_AUDIT 8 /* syscall auditing active */ |
102 | #define TIF_SINGLESTEP 9 /* singlestepping active */ | 102 | #define TIF_SINGLESTEP 9 /* singlestepping active */ |
@@ -110,7 +110,7 @@ static inline struct thread_info *current_thread_info(void) | |||
110 | #define _TIF_NEED_RESCHED (1<<TIF_NEED_RESCHED) | 110 | #define _TIF_NEED_RESCHED (1<<TIF_NEED_RESCHED) |
111 | #define _TIF_POLLING_NRFLAG (1<<TIF_POLLING_NRFLAG) | 111 | #define _TIF_POLLING_NRFLAG (1<<TIF_POLLING_NRFLAG) |
112 | #define _TIF_32BIT (1<<TIF_32BIT) | 112 | #define _TIF_32BIT (1<<TIF_32BIT) |
113 | #define _TIF_RUN_LIGHT (1<<TIF_RUN_LIGHT) | 113 | /* #define _SPARE (1<<SPARE) */ |
114 | #define _TIF_ABI_PENDING (1<<TIF_ABI_PENDING) | 114 | #define _TIF_ABI_PENDING (1<<TIF_ABI_PENDING) |
115 | #define _TIF_SYSCALL_AUDIT (1<<TIF_SYSCALL_AUDIT) | 115 | #define _TIF_SYSCALL_AUDIT (1<<TIF_SYSCALL_AUDIT) |
116 | #define _TIF_SINGLESTEP (1<<TIF_SINGLESTEP) | 116 | #define _TIF_SINGLESTEP (1<<TIF_SINGLESTEP) |
diff --git a/include/asm-s390/smp.h b/include/asm-s390/smp.h index 9473786387a3..dd50e57a928f 100644 --- a/include/asm-s390/smp.h +++ b/include/asm-s390/smp.h | |||
@@ -47,7 +47,7 @@ extern int smp_call_function_on(void (*func) (void *info), void *info, | |||
47 | 47 | ||
48 | #define PROC_CHANGE_PENALTY 20 /* Schedule penalty */ | 48 | #define PROC_CHANGE_PENALTY 20 /* Schedule penalty */ |
49 | 49 | ||
50 | #define smp_processor_id() (S390_lowcore.cpu_data.cpu_nr) | 50 | #define raw_smp_processor_id() (S390_lowcore.cpu_data.cpu_nr) |
51 | 51 | ||
52 | extern int smp_get_cpu(cpumask_t cpu_map); | 52 | extern int smp_get_cpu(cpumask_t cpu_map); |
53 | extern void smp_put_cpu(int cpu); | 53 | extern void smp_put_cpu(int cpu); |
diff --git a/include/asm-s390/user.h b/include/asm-s390/user.h index c64f8c181df3..1dc74baf03c4 100644 --- a/include/asm-s390/user.h +++ b/include/asm-s390/user.h | |||
@@ -10,7 +10,7 @@ | |||
10 | #define _S390_USER_H | 10 | #define _S390_USER_H |
11 | 11 | ||
12 | #include <asm/page.h> | 12 | #include <asm/page.h> |
13 | #include <linux/ptrace.h> | 13 | #include <asm/ptrace.h> |
14 | /* Core file format: The core file is written in such a way that gdb | 14 | /* Core file format: The core file is written in such a way that gdb |
15 | can understand it and provide useful information to the user (under | 15 | can understand it and provide useful information to the user (under |
16 | linux we use the 'trad-core' bfd). There are quite a number of | 16 | linux we use the 'trad-core' bfd). There are quite a number of |
diff --git a/include/asm-sh/page.h b/include/asm-sh/page.h index 4c6d129e7d91..180467be8e7b 100644 --- a/include/asm-sh/page.h +++ b/include/asm-sh/page.h | |||
@@ -31,6 +31,7 @@ | |||
31 | #define HPAGE_SIZE (1UL << HPAGE_SHIFT) | 31 | #define HPAGE_SIZE (1UL << HPAGE_SHIFT) |
32 | #define HPAGE_MASK (~(HPAGE_SIZE-1)) | 32 | #define HPAGE_MASK (~(HPAGE_SIZE-1)) |
33 | #define HUGETLB_PAGE_ORDER (HPAGE_SHIFT-PAGE_SHIFT) | 33 | #define HUGETLB_PAGE_ORDER (HPAGE_SHIFT-PAGE_SHIFT) |
34 | #define ARCH_HAS_SETCLEAR_HUGE_PTE | ||
34 | #endif | 35 | #endif |
35 | 36 | ||
36 | #ifdef __KERNEL__ | 37 | #ifdef __KERNEL__ |
diff --git a/include/asm-sh/pgtable.h b/include/asm-sh/pgtable.h index cd847a47a9aa..ecb909572d3f 100644 --- a/include/asm-sh/pgtable.h +++ b/include/asm-sh/pgtable.h | |||
@@ -196,6 +196,7 @@ 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 | static inline pte_t pte_mkhuge(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) | _PAGE_SZHUGE)); return pte; } | ||
199 | 200 | ||
200 | /* | 201 | /* |
201 | * Macro and implementation to make a page protection as uncachable. | 202 | * Macro and implementation to make a page protection as uncachable. |
diff --git a/include/asm-sh/smp.h b/include/asm-sh/smp.h index 38b54469d7d1..f19a8b3b69a6 100644 --- a/include/asm-sh/smp.h +++ b/include/asm-sh/smp.h | |||
@@ -25,7 +25,7 @@ extern cpumask_t cpu_possible_map; | |||
25 | 25 | ||
26 | #define cpu_online(cpu) cpu_isset(cpu, cpu_online_map) | 26 | #define cpu_online(cpu) cpu_isset(cpu, cpu_online_map) |
27 | 27 | ||
28 | #define smp_processor_id() (current_thread_info()->cpu) | 28 | #define raw_smp_processor_id() (current_thread_info()->cpu) |
29 | 29 | ||
30 | /* I've no idea what the real meaning of this is */ | 30 | /* I've no idea what the real meaning of this is */ |
31 | #define PROC_CHANGE_PENALTY 20 | 31 | #define PROC_CHANGE_PENALTY 20 |
diff --git a/include/asm-sh/thread_info.h b/include/asm-sh/thread_info.h index d82f883d8e6d..4bbbd9f3c37e 100644 --- a/include/asm-sh/thread_info.h +++ b/include/asm-sh/thread_info.h | |||
@@ -27,7 +27,7 @@ struct thread_info { | |||
27 | 27 | ||
28 | #endif | 28 | #endif |
29 | 29 | ||
30 | #define PREEMPT_ACTIVE 0x4000000 | 30 | #define PREEMPT_ACTIVE 0x10000000 |
31 | 31 | ||
32 | /* | 32 | /* |
33 | * macros/functions for gaining access to the thread information structure | 33 | * macros/functions for gaining access to the thread information structure |
diff --git a/include/asm-sh64/page.h b/include/asm-sh64/page.h index e1f7f5a41210..d6167f1c0e99 100644 --- a/include/asm-sh64/page.h +++ b/include/asm-sh64/page.h | |||
@@ -41,6 +41,7 @@ | |||
41 | #define HPAGE_SIZE (1UL << HPAGE_SHIFT) | 41 | #define HPAGE_SIZE (1UL << HPAGE_SHIFT) |
42 | #define HPAGE_MASK (~(HPAGE_SIZE-1)) | 42 | #define HPAGE_MASK (~(HPAGE_SIZE-1)) |
43 | #define HUGETLB_PAGE_ORDER (HPAGE_SHIFT-PAGE_SHIFT) | 43 | #define HUGETLB_PAGE_ORDER (HPAGE_SHIFT-PAGE_SHIFT) |
44 | #define ARCH_HAS_SETCLEAR_HUGE_PTE | ||
44 | #endif | 45 | #endif |
45 | 46 | ||
46 | #ifdef __KERNEL__ | 47 | #ifdef __KERNEL__ |
diff --git a/include/asm-sh64/pgtable.h b/include/asm-sh64/pgtable.h index 525e1523ef5f..78ac6be2d9ef 100644 --- a/include/asm-sh64/pgtable.h +++ b/include/asm-sh64/pgtable.h | |||
@@ -430,6 +430,8 @@ extern inline pte_t pte_mkwrite(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) | | |||
430 | extern inline pte_t pte_mkexec(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) | _PAGE_EXECUTE)); return pte; } | 430 | extern inline pte_t pte_mkexec(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) | _PAGE_EXECUTE)); return pte; } |
431 | extern inline pte_t pte_mkdirty(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) | _PAGE_DIRTY)); return pte; } | 431 | extern inline pte_t pte_mkdirty(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) | _PAGE_DIRTY)); return pte; } |
432 | extern inline pte_t pte_mkyoung(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) | _PAGE_ACCESSED)); return pte; } | 432 | extern inline pte_t pte_mkyoung(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) | _PAGE_ACCESSED)); return pte; } |
433 | extern inline pte_t pte_mkhuge(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) | _PAGE_SZHUGE)); return pte; } | ||
434 | |||
433 | 435 | ||
434 | /* | 436 | /* |
435 | * Conversion functions: convert a page and protection to a page entry. | 437 | * Conversion functions: convert a page and protection to a page entry. |
diff --git a/include/asm-sh64/thread_info.h b/include/asm-sh64/thread_info.h index e65f394da472..8a32d6bd0b79 100644 --- a/include/asm-sh64/thread_info.h +++ b/include/asm-sh64/thread_info.h | |||
@@ -73,7 +73,7 @@ static inline struct thread_info *current_thread_info(void) | |||
73 | 73 | ||
74 | #define THREAD_SIZE 8192 | 74 | #define THREAD_SIZE 8192 |
75 | 75 | ||
76 | #define PREEMPT_ACTIVE 0x4000000 | 76 | #define PREEMPT_ACTIVE 0x10000000 |
77 | 77 | ||
78 | /* thread information flags */ | 78 | /* thread information flags */ |
79 | #define TIF_SYSCALL_TRACE 0 /* syscall trace active */ | 79 | #define TIF_SYSCALL_TRACE 0 /* syscall trace active */ |
diff --git a/include/asm-sparc/smp.h b/include/asm-sparc/smp.h index f986c0d0922a..4f96d8333a12 100644 --- a/include/asm-sparc/smp.h +++ b/include/asm-sparc/smp.h | |||
@@ -148,7 +148,7 @@ extern __inline__ int hard_smp_processor_id(void) | |||
148 | } | 148 | } |
149 | #endif | 149 | #endif |
150 | 150 | ||
151 | #define smp_processor_id() (current_thread_info()->cpu) | 151 | #define raw_smp_processor_id() (current_thread_info()->cpu) |
152 | 152 | ||
153 | #define prof_multiplier(__cpu) cpu_data(__cpu).multiplier | 153 | #define prof_multiplier(__cpu) cpu_data(__cpu).multiplier |
154 | #define prof_counter(__cpu) cpu_data(__cpu).counter | 154 | #define prof_counter(__cpu) cpu_data(__cpu).counter |
diff --git a/include/asm-sparc/uaccess.h b/include/asm-sparc/uaccess.h index f461144067ee..0a780e84a12b 100644 --- a/include/asm-sparc/uaccess.h +++ b/include/asm-sparc/uaccess.h | |||
@@ -41,10 +41,11 @@ | |||
41 | * No one can read/write anything from userland in the kernel space by setting | 41 | * No one can read/write anything from userland in the kernel space by setting |
42 | * large size and address near to PAGE_OFFSET - a fault will break his intentions. | 42 | * large size and address near to PAGE_OFFSET - a fault will break his intentions. |
43 | */ | 43 | */ |
44 | #define __user_ok(addr,size) ((addr) < STACK_TOP) | 44 | #define __user_ok(addr, size) ({ (void)(size); (addr) < STACK_TOP; }) |
45 | #define __kernel_ok (segment_eq(get_fs(), KERNEL_DS)) | 45 | #define __kernel_ok (segment_eq(get_fs(), KERNEL_DS)) |
46 | #define __access_ok(addr,size) (__user_ok((addr) & get_fs().seg,(size))) | 46 | #define __access_ok(addr,size) (__user_ok((addr) & get_fs().seg,(size))) |
47 | #define access_ok(type,addr,size) __access_ok((unsigned long)(addr),(size)) | 47 | #define access_ok(type, addr, size) \ |
48 | ({ (void)(type); __access_ok((unsigned long)(addr), size); }) | ||
48 | 49 | ||
49 | /* this function will go away soon - use access_ok() instead */ | 50 | /* this function will go away soon - use access_ok() instead */ |
50 | static inline int __deprecated verify_area(int type, const void __user * addr, unsigned long size) | 51 | static inline int __deprecated verify_area(int type, const void __user * addr, unsigned long size) |
diff --git a/include/asm-sparc64/agp.h b/include/asm-sparc64/agp.h index ba05bdf9a211..58f8cb6ae767 100644 --- a/include/asm-sparc64/agp.h +++ b/include/asm-sparc64/agp.h | |||
@@ -8,4 +8,14 @@ | |||
8 | #define flush_agp_mappings() | 8 | #define flush_agp_mappings() |
9 | #define flush_agp_cache() mb() | 9 | #define flush_agp_cache() mb() |
10 | 10 | ||
11 | /* Convert a physical address to an address suitable for the GART. */ | ||
12 | #define phys_to_gart(x) (x) | ||
13 | #define gart_to_phys(x) (x) | ||
14 | |||
15 | /* GATT allocation. Returns/accepts GATT kernel virtual address. */ | ||
16 | #define alloc_gatt_pages(order) \ | ||
17 | ((char *)__get_free_pages(GFP_KERNEL, (order))) | ||
18 | #define free_gatt_pages(table, order) \ | ||
19 | free_pages((unsigned long)(table), (order)) | ||
20 | |||
11 | #endif | 21 | #endif |
diff --git a/include/asm-sparc64/iommu.h b/include/asm-sparc64/iommu.h index 5fd16e42a045..0de7a3da79cd 100644 --- a/include/asm-sparc64/iommu.h +++ b/include/asm-sparc64/iommu.h | |||
@@ -16,4 +16,6 @@ | |||
16 | #define IOPTE_CACHE 0x0000000000000010UL /* Cached (in UPA E-cache) */ | 16 | #define IOPTE_CACHE 0x0000000000000010UL /* Cached (in UPA E-cache) */ |
17 | #define IOPTE_WRITE 0x0000000000000002UL /* Writeable */ | 17 | #define IOPTE_WRITE 0x0000000000000002UL /* Writeable */ |
18 | 18 | ||
19 | #define IOMMU_NUM_CTXS 4096 | ||
20 | |||
19 | #endif /* !(_SPARC_IOMMU_H) */ | 21 | #endif /* !(_SPARC_IOMMU_H) */ |
diff --git a/include/asm-sparc64/page.h b/include/asm-sparc64/page.h index 219ea043a14a..b87dbbd64bc9 100644 --- a/include/asm-sparc64/page.h +++ b/include/asm-sparc64/page.h | |||
@@ -95,6 +95,8 @@ typedef unsigned long pgprot_t; | |||
95 | #define HPAGE_SIZE (_AC(1,UL) << HPAGE_SHIFT) | 95 | #define HPAGE_SIZE (_AC(1,UL) << HPAGE_SHIFT) |
96 | #define HPAGE_MASK (~(HPAGE_SIZE - 1UL)) | 96 | #define HPAGE_MASK (~(HPAGE_SIZE - 1UL)) |
97 | #define HUGETLB_PAGE_ORDER (HPAGE_SHIFT - PAGE_SHIFT) | 97 | #define HUGETLB_PAGE_ORDER (HPAGE_SHIFT - PAGE_SHIFT) |
98 | #define ARCH_HAS_SETCLEAR_HUGE_PTE | ||
99 | #define ARCH_HAS_HUGETLB_PREFAULT_HOOK | ||
98 | #endif | 100 | #endif |
99 | 101 | ||
100 | #define TASK_UNMAPPED_BASE (test_thread_flag(TIF_32BIT) ? \ | 102 | #define TASK_UNMAPPED_BASE (test_thread_flag(TIF_32BIT) ? \ |
diff --git a/include/asm-sparc64/pbm.h b/include/asm-sparc64/pbm.h index 92999631c819..4c15610a2bac 100644 --- a/include/asm-sparc64/pbm.h +++ b/include/asm-sparc64/pbm.h | |||
@@ -15,6 +15,7 @@ | |||
15 | #include <asm/io.h> | 15 | #include <asm/io.h> |
16 | #include <asm/page.h> | 16 | #include <asm/page.h> |
17 | #include <asm/oplib.h> | 17 | #include <asm/oplib.h> |
18 | #include <asm/iommu.h> | ||
18 | 19 | ||
19 | /* The abstraction used here is that there are PCI controllers, | 20 | /* The abstraction used here is that there are PCI controllers, |
20 | * each with one (Sabre) or two (PSYCHO/SCHIZO) PCI bus modules | 21 | * each with one (Sabre) or two (PSYCHO/SCHIZO) PCI bus modules |
@@ -40,9 +41,6 @@ struct pci_iommu { | |||
40 | */ | 41 | */ |
41 | spinlock_t lock; | 42 | spinlock_t lock; |
42 | 43 | ||
43 | /* Context allocator. */ | ||
44 | unsigned int iommu_cur_ctx; | ||
45 | |||
46 | /* IOMMU page table, a linear array of ioptes. */ | 44 | /* IOMMU page table, a linear array of ioptes. */ |
47 | iopte_t *page_table; /* The page table itself. */ | 45 | iopte_t *page_table; /* The page table itself. */ |
48 | int page_table_sz_bits; /* log2 of ow many pages does it map? */ | 46 | int page_table_sz_bits; /* log2 of ow many pages does it map? */ |
@@ -87,6 +85,10 @@ struct pci_iommu { | |||
87 | u16 flush; | 85 | u16 flush; |
88 | } alloc_info[PBM_NCLUSTERS]; | 86 | } alloc_info[PBM_NCLUSTERS]; |
89 | 87 | ||
88 | /* CTX allocation. */ | ||
89 | unsigned long ctx_lowest_free; | ||
90 | unsigned long ctx_bitmap[IOMMU_NUM_CTXS / (sizeof(unsigned long) * 8)]; | ||
91 | |||
90 | /* Here a PCI controller driver describes the areas of | 92 | /* Here a PCI controller driver describes the areas of |
91 | * PCI memory space where DMA to/from physical memory | 93 | * PCI memory space where DMA to/from physical memory |
92 | * are addressed. Drivers interrogate the PCI layer | 94 | * are addressed. Drivers interrogate the PCI layer |
diff --git a/include/asm-sparc64/pgtable.h b/include/asm-sparc64/pgtable.h index ae2cd5b09a7c..1ae00c5087f1 100644 --- a/include/asm-sparc64/pgtable.h +++ b/include/asm-sparc64/pgtable.h | |||
@@ -286,6 +286,7 @@ static inline pte_t pte_modify(pte_t orig_pte, pgprot_t new_prot) | |||
286 | #define pte_mkyoung(pte) (__pte(pte_val(pte) | _PAGE_ACCESSED | _PAGE_R)) | 286 | #define pte_mkyoung(pte) (__pte(pte_val(pte) | _PAGE_ACCESSED | _PAGE_R)) |
287 | #define pte_mkwrite(pte) (__pte(pte_val(pte) | _PAGE_WRITE)) | 287 | #define pte_mkwrite(pte) (__pte(pte_val(pte) | _PAGE_WRITE)) |
288 | #define pte_mkdirty(pte) (__pte(pte_val(pte) | _PAGE_MODIFIED | _PAGE_W)) | 288 | #define pte_mkdirty(pte) (__pte(pte_val(pte) | _PAGE_MODIFIED | _PAGE_W)) |
289 | #define pte_mkhuge(pte) (__pte(pte_val(pte) | _PAGE_SZHUGE)) | ||
289 | 290 | ||
290 | /* to find an entry in a page-table-directory. */ | 291 | /* to find an entry in a page-table-directory. */ |
291 | #define pgd_index(address) (((address) >> PGDIR_SHIFT) & (PTRS_PER_PGD - 1)) | 292 | #define pgd_index(address) (((address) >> PGDIR_SHIFT) & (PTRS_PER_PGD - 1)) |
diff --git a/include/asm-sparc64/processor.h b/include/asm-sparc64/processor.h index bc1445b904ef..d0bee2413560 100644 --- a/include/asm-sparc64/processor.h +++ b/include/asm-sparc64/processor.h | |||
@@ -192,6 +192,40 @@ extern unsigned long get_wchan(struct task_struct *task); | |||
192 | 192 | ||
193 | #define cpu_relax() barrier() | 193 | #define cpu_relax() barrier() |
194 | 194 | ||
195 | /* Prefetch support. This is tuned for UltraSPARC-III and later. | ||
196 | * UltraSPARC-I will treat these as nops, and UltraSPARC-II has | ||
197 | * a shallower prefetch queue than later chips. | ||
198 | */ | ||
199 | #define ARCH_HAS_PREFETCH | ||
200 | #define ARCH_HAS_PREFETCHW | ||
201 | #define ARCH_HAS_SPINLOCK_PREFETCH | ||
202 | |||
203 | static inline void prefetch(const void *x) | ||
204 | { | ||
205 | /* We do not use the read prefetch mnemonic because that | ||
206 | * prefetches into the prefetch-cache which only is accessible | ||
207 | * by floating point operations in UltraSPARC-III and later. | ||
208 | * By contrast, "#one_write" prefetches into the L2 cache | ||
209 | * in shared state. | ||
210 | */ | ||
211 | __asm__ __volatile__("prefetch [%0], #one_write" | ||
212 | : /* no outputs */ | ||
213 | : "r" (x)); | ||
214 | } | ||
215 | |||
216 | static inline void prefetchw(const void *x) | ||
217 | { | ||
218 | /* The most optimal prefetch to use for writes is | ||
219 | * "#n_writes". This brings the cacheline into the | ||
220 | * L2 cache in "owned" state. | ||
221 | */ | ||
222 | __asm__ __volatile__("prefetch [%0], #n_writes" | ||
223 | : /* no outputs */ | ||
224 | : "r" (x)); | ||
225 | } | ||
226 | |||
227 | #define spin_lock_prefetch(x) prefetchw(x) | ||
228 | |||
195 | #endif /* !(__ASSEMBLY__) */ | 229 | #endif /* !(__ASSEMBLY__) */ |
196 | 230 | ||
197 | #endif /* !(__ASM_SPARC64_PROCESSOR_H) */ | 231 | #endif /* !(__ASM_SPARC64_PROCESSOR_H) */ |
diff --git a/include/asm-sparc64/smp.h b/include/asm-sparc64/smp.h index 5e3e06d908fe..110a2de89123 100644 --- a/include/asm-sparc64/smp.h +++ b/include/asm-sparc64/smp.h | |||
@@ -64,7 +64,7 @@ static __inline__ int hard_smp_processor_id(void) | |||
64 | } | 64 | } |
65 | } | 65 | } |
66 | 66 | ||
67 | #define smp_processor_id() (current_thread_info()->cpu) | 67 | #define raw_smp_processor_id() (current_thread_info()->cpu) |
68 | 68 | ||
69 | #endif /* !(__ASSEMBLY__) */ | 69 | #endif /* !(__ASSEMBLY__) */ |
70 | 70 | ||
diff --git a/include/asm-sparc64/spitfire.h b/include/asm-sparc64/spitfire.h index ad78ce64d69e..9d7613eea812 100644 --- a/include/asm-sparc64/spitfire.h +++ b/include/asm-sparc64/spitfire.h | |||
@@ -48,6 +48,9 @@ enum ultra_tlb_layout { | |||
48 | 48 | ||
49 | extern enum ultra_tlb_layout tlb_type; | 49 | extern enum ultra_tlb_layout tlb_type; |
50 | 50 | ||
51 | extern int cheetah_pcache_forced_on; | ||
52 | extern void cheetah_enable_pcache(void); | ||
53 | |||
51 | #define sparc64_highest_locked_tlbent() \ | 54 | #define sparc64_highest_locked_tlbent() \ |
52 | (tlb_type == spitfire ? \ | 55 | (tlb_type == spitfire ? \ |
53 | SPITFIRE_HIGHEST_LOCKED_TLBENT : \ | 56 | SPITFIRE_HIGHEST_LOCKED_TLBENT : \ |
diff --git a/include/asm-um/arch-signal-i386.h b/include/asm-um/arch-signal-i386.h deleted file mode 100644 index e69de29bb2d1..000000000000 --- a/include/asm-um/arch-signal-i386.h +++ /dev/null | |||
diff --git a/include/asm-um/elf-i386.h b/include/asm-um/elf-i386.h index b72e23519e00..9bab712dc5c0 100644 --- a/include/asm-um/elf-i386.h +++ b/include/asm-um/elf-i386.h | |||
@@ -5,7 +5,7 @@ | |||
5 | #ifndef __UM_ELF_I386_H | 5 | #ifndef __UM_ELF_I386_H |
6 | #define __UM_ELF_I386_H | 6 | #define __UM_ELF_I386_H |
7 | 7 | ||
8 | #include "user.h" | 8 | #include <asm/user.h> |
9 | 9 | ||
10 | #define R_386_NONE 0 | 10 | #define R_386_NONE 0 |
11 | #define R_386_32 1 | 11 | #define R_386_32 1 |
diff --git a/include/asm-um/elf-x86_64.h b/include/asm-um/elf-x86_64.h index 19309d001aa0..8a8246d03936 100644 --- a/include/asm-um/elf-x86_64.h +++ b/include/asm-um/elf-x86_64.h | |||
@@ -8,6 +8,27 @@ | |||
8 | 8 | ||
9 | #include <asm/user.h> | 9 | #include <asm/user.h> |
10 | 10 | ||
11 | /* x86-64 relocation types, taken from asm-x86_64/elf.h */ | ||
12 | #define R_X86_64_NONE 0 /* No reloc */ | ||
13 | #define R_X86_64_64 1 /* Direct 64 bit */ | ||
14 | #define R_X86_64_PC32 2 /* PC relative 32 bit signed */ | ||
15 | #define R_X86_64_GOT32 3 /* 32 bit GOT entry */ | ||
16 | #define R_X86_64_PLT32 4 /* 32 bit PLT address */ | ||
17 | #define R_X86_64_COPY 5 /* Copy symbol at runtime */ | ||
18 | #define R_X86_64_GLOB_DAT 6 /* Create GOT entry */ | ||
19 | #define R_X86_64_JUMP_SLOT 7 /* Create PLT entry */ | ||
20 | #define R_X86_64_RELATIVE 8 /* Adjust by program base */ | ||
21 | #define R_X86_64_GOTPCREL 9 /* 32 bit signed pc relative | ||
22 | offset to GOT */ | ||
23 | #define R_X86_64_32 10 /* Direct 32 bit zero extended */ | ||
24 | #define R_X86_64_32S 11 /* Direct 32 bit sign extended */ | ||
25 | #define R_X86_64_16 12 /* Direct 16 bit zero extended */ | ||
26 | #define R_X86_64_PC16 13 /* 16 bit sign extended pc relative */ | ||
27 | #define R_X86_64_8 14 /* Direct 8 bit sign extended */ | ||
28 | #define R_X86_64_PC8 15 /* 8 bit sign extended pc relative */ | ||
29 | |||
30 | #define R_X86_64_NUM 16 | ||
31 | |||
11 | typedef unsigned long elf_greg_t; | 32 | typedef unsigned long elf_greg_t; |
12 | 33 | ||
13 | #define ELF_NGREG (sizeof (struct user_regs_struct) / sizeof(elf_greg_t)) | 34 | #define ELF_NGREG (sizeof (struct user_regs_struct) / sizeof(elf_greg_t)) |
@@ -44,7 +65,8 @@ typedef struct { } elf_fpregset_t; | |||
44 | } while (0) | 65 | } while (0) |
45 | 66 | ||
46 | #ifdef TIF_IA32 /* XXX */ | 67 | #ifdef TIF_IA32 /* XXX */ |
47 | clear_thread_flag(TIF_IA32); \ | 68 | #error XXX, indeed |
69 | clear_thread_flag(TIF_IA32); | ||
48 | #endif | 70 | #endif |
49 | 71 | ||
50 | #define USE_ELF_CORE_DUMP | 72 | #define USE_ELF_CORE_DUMP |
diff --git a/include/asm-um/elf.h b/include/asm-um/elf.h deleted file mode 100644 index e69de29bb2d1..000000000000 --- a/include/asm-um/elf.h +++ /dev/null | |||
diff --git a/include/asm-um/page.h b/include/asm-um/page.h index 504ea8e486b0..5afee8a8cdf3 100644 --- a/include/asm-um/page.h +++ b/include/asm-um/page.h | |||
@@ -98,7 +98,13 @@ extern unsigned long uml_physmem; | |||
98 | 98 | ||
99 | extern unsigned long to_phys(void *virt); | 99 | extern unsigned long to_phys(void *virt); |
100 | extern void *to_virt(unsigned long phys); | 100 | extern void *to_virt(unsigned long phys); |
101 | #define __pa(virt) to_phys((void *) virt) | 101 | |
102 | /* Cast to unsigned long before casting to void * to avoid a warning from | ||
103 | * mmap_kmem about cutting a long long down to a void *. Not sure that | ||
104 | * casting is the right thing, but 32-bit UML can't have 64-bit virtual | ||
105 | * addresses | ||
106 | */ | ||
107 | #define __pa(virt) to_phys((void *) (unsigned long) virt) | ||
102 | #define __va(phys) to_virt((unsigned long) phys) | 108 | #define __va(phys) to_virt((unsigned long) phys) |
103 | 109 | ||
104 | #define page_to_pfn(page) ((page) - mem_map) | 110 | #define page_to_pfn(page) ((page) - mem_map) |
diff --git a/include/asm-um/pgtable.h b/include/asm-um/pgtable.h index 510e513c7f88..a88040920311 100644 --- a/include/asm-um/pgtable.h +++ b/include/asm-um/pgtable.h | |||
@@ -114,17 +114,9 @@ extern unsigned long end_iomem; | |||
114 | extern unsigned long pg0[1024]; | 114 | extern unsigned long pg0[1024]; |
115 | 115 | ||
116 | /* | 116 | /* |
117 | * BAD_PAGETABLE is used when we need a bogus page-table, while | ||
118 | * BAD_PAGE is used for a bogus page. | ||
119 | * | ||
120 | * ZERO_PAGE is a global shared page that is always zero: used | 117 | * ZERO_PAGE is a global shared page that is always zero: used |
121 | * for zero-mapped memory areas etc.. | 118 | * for zero-mapped memory areas etc.. |
122 | */ | 119 | */ |
123 | extern pte_t __bad_page(void); | ||
124 | extern pte_t * __bad_pagetable(void); | ||
125 | |||
126 | #define BAD_PAGETABLE __bad_pagetable() | ||
127 | #define BAD_PAGE __bad_page() | ||
128 | 120 | ||
129 | #define ZERO_PAGE(vaddr) virt_to_page(empty_zero_page) | 121 | #define ZERO_PAGE(vaddr) virt_to_page(empty_zero_page) |
130 | 122 | ||
diff --git a/include/asm-um/smp.h b/include/asm-um/smp.h index 4412d5d9c26b..d879eba2b52c 100644 --- a/include/asm-um/smp.h +++ b/include/asm-um/smp.h | |||
@@ -8,7 +8,8 @@ | |||
8 | #include "asm/current.h" | 8 | #include "asm/current.h" |
9 | #include "linux/cpumask.h" | 9 | #include "linux/cpumask.h" |
10 | 10 | ||
11 | #define smp_processor_id() (current_thread->cpu) | 11 | #define raw_smp_processor_id() (current_thread->cpu) |
12 | |||
12 | #define cpu_logical_map(n) (n) | 13 | #define cpu_logical_map(n) (n) |
13 | #define cpu_number_map(n) (n) | 14 | #define cpu_number_map(n) (n) |
14 | #define PROC_CHANGE_PENALTY 15 /* Pick a number, any number */ | 15 | #define PROC_CHANGE_PENALTY 15 /* Pick a number, any number */ |
diff --git a/include/asm-um/thread_info.h b/include/asm-um/thread_info.h index a10ea155907e..1feaaf148ef1 100644 --- a/include/asm-um/thread_info.h +++ b/include/asm-um/thread_info.h | |||
@@ -41,18 +41,17 @@ struct thread_info { | |||
41 | #define init_thread_info (init_thread_union.thread_info) | 41 | #define init_thread_info (init_thread_union.thread_info) |
42 | #define init_stack (init_thread_union.stack) | 42 | #define init_stack (init_thread_union.stack) |
43 | 43 | ||
44 | #define THREAD_SIZE ((1 << CONFIG_KERNEL_STACK_ORDER) * PAGE_SIZE) | ||
44 | /* how to get the thread information struct from C */ | 45 | /* how to get the thread information struct from C */ |
45 | static inline struct thread_info *current_thread_info(void) | 46 | static inline struct thread_info *current_thread_info(void) |
46 | { | 47 | { |
47 | struct thread_info *ti; | 48 | struct thread_info *ti; |
48 | unsigned long mask = PAGE_SIZE * | 49 | unsigned long mask = THREAD_SIZE - 1; |
49 | (1 << CONFIG_KERNEL_STACK_ORDER) - 1; | 50 | ti = (struct thread_info *) (((unsigned long) &ti) & ~mask); |
50 | ti = (struct thread_info *) (((unsigned long) &ti) & ~mask); | ||
51 | return ti; | 51 | return ti; |
52 | } | 52 | } |
53 | 53 | ||
54 | /* thread information allocation */ | 54 | /* thread information allocation */ |
55 | #define THREAD_SIZE ((1 << CONFIG_KERNEL_STACK_ORDER) * PAGE_SIZE) | ||
56 | #define alloc_thread_info(tsk) \ | 55 | #define alloc_thread_info(tsk) \ |
57 | ((struct thread_info *) kmalloc(THREAD_SIZE, GFP_KERNEL)) | 56 | ((struct thread_info *) kmalloc(THREAD_SIZE, GFP_KERNEL)) |
58 | #define free_thread_info(ti) kfree(ti) | 57 | #define free_thread_info(ti) kfree(ti) |
@@ -62,7 +61,7 @@ static inline struct thread_info *current_thread_info(void) | |||
62 | 61 | ||
63 | #endif | 62 | #endif |
64 | 63 | ||
65 | #define PREEMPT_ACTIVE 0x4000000 | 64 | #define PREEMPT_ACTIVE 0x10000000 |
66 | 65 | ||
67 | #define TIF_SYSCALL_TRACE 0 /* syscall trace active */ | 66 | #define TIF_SYSCALL_TRACE 0 /* syscall trace active */ |
68 | #define TIF_SIGPENDING 1 /* signal pending */ | 67 | #define TIF_SIGPENDING 1 /* signal pending */ |
diff --git a/include/asm-x86_64/a.out.h b/include/asm-x86_64/a.out.h index 5952914f4121..7255cde06538 100644 --- a/include/asm-x86_64/a.out.h +++ b/include/asm-x86_64/a.out.h | |||
@@ -21,7 +21,7 @@ struct exec | |||
21 | 21 | ||
22 | #ifdef __KERNEL__ | 22 | #ifdef __KERNEL__ |
23 | #include <linux/thread_info.h> | 23 | #include <linux/thread_info.h> |
24 | #define STACK_TOP (test_thread_flag(TIF_IA32) ? IA32_PAGE_OFFSET : TASK_SIZE) | 24 | #define STACK_TOP TASK_SIZE |
25 | #endif | 25 | #endif |
26 | 26 | ||
27 | #endif /* __A_OUT_GNU_H__ */ | 27 | #endif /* __A_OUT_GNU_H__ */ |
diff --git a/include/asm-x86_64/agp.h b/include/asm-x86_64/agp.h index 0bb9019d58aa..06c52ee9c06b 100644 --- a/include/asm-x86_64/agp.h +++ b/include/asm-x86_64/agp.h | |||
@@ -19,4 +19,14 @@ int unmap_page_from_agp(struct page *page); | |||
19 | worth it. Would need a page for it. */ | 19 | worth it. Would need a page for it. */ |
20 | #define flush_agp_cache() asm volatile("wbinvd":::"memory") | 20 | #define flush_agp_cache() asm volatile("wbinvd":::"memory") |
21 | 21 | ||
22 | /* Convert a physical address to an address suitable for the GART. */ | ||
23 | #define phys_to_gart(x) (x) | ||
24 | #define gart_to_phys(x) (x) | ||
25 | |||
26 | /* GATT allocation. Returns/accepts GATT kernel virtual address. */ | ||
27 | #define alloc_gatt_pages(order) \ | ||
28 | ((char *)__get_free_pages(GFP_KERNEL, (order))) | ||
29 | #define free_gatt_pages(table, order) \ | ||
30 | free_pages((unsigned long)(table), (order)) | ||
31 | |||
22 | #endif | 32 | #endif |
diff --git a/include/asm-x86_64/apicdef.h b/include/asm-x86_64/apicdef.h index 3d7627ffe67d..bfebdb690654 100644 --- a/include/asm-x86_64/apicdef.h +++ b/include/asm-x86_64/apicdef.h | |||
@@ -112,7 +112,7 @@ | |||
112 | 112 | ||
113 | #define APIC_BASE (fix_to_virt(FIX_APIC_BASE)) | 113 | #define APIC_BASE (fix_to_virt(FIX_APIC_BASE)) |
114 | 114 | ||
115 | #define MAX_IO_APICS 32 | 115 | #define MAX_IO_APICS 128 |
116 | 116 | ||
117 | /* | 117 | /* |
118 | * All x86-64 systems are xAPIC compatible. | 118 | * All x86-64 systems are xAPIC compatible. |
diff --git a/include/asm-x86_64/bug.h b/include/asm-x86_64/bug.h index bdbf66eab6ee..3d2a666a5dd5 100644 --- a/include/asm-x86_64/bug.h +++ b/include/asm-x86_64/bug.h | |||
@@ -21,6 +21,8 @@ struct bug_frame { | |||
21 | asm volatile("ud2 ; .quad %c1 ; .short %c0" :: \ | 21 | asm volatile("ud2 ; .quad %c1 ; .short %c0" :: \ |
22 | "i"(__LINE__), "i" (__stringify(__FILE__))) | 22 | "i"(__LINE__), "i" (__stringify(__FILE__))) |
23 | void out_of_line_bug(void); | 23 | void out_of_line_bug(void); |
24 | #else | ||
25 | static inline void out_of_line_bug(void) { } | ||
24 | #endif | 26 | #endif |
25 | 27 | ||
26 | #include <asm-generic/bug.h> | 28 | #include <asm-generic/bug.h> |
diff --git a/include/asm-x86_64/io_apic.h b/include/asm-x86_64/io_apic.h index 7efc932e8f0b..32573749004c 100644 --- a/include/asm-x86_64/io_apic.h +++ b/include/asm-x86_64/io_apic.h | |||
@@ -202,7 +202,6 @@ extern int skip_ioapic_setup; | |||
202 | #define io_apic_assign_pci_irqs (mp_irq_entries && !skip_ioapic_setup && io_apic_irqs) | 202 | #define io_apic_assign_pci_irqs (mp_irq_entries && !skip_ioapic_setup && io_apic_irqs) |
203 | 203 | ||
204 | #ifdef CONFIG_ACPI_BOOT | 204 | #ifdef CONFIG_ACPI_BOOT |
205 | extern int io_apic_get_unique_id (int ioapic, int apic_id); | ||
206 | extern int io_apic_get_version (int ioapic); | 205 | extern int io_apic_get_version (int ioapic); |
207 | extern int io_apic_get_redir_entries (int ioapic); | 206 | extern int io_apic_get_redir_entries (int ioapic); |
208 | extern int io_apic_set_pci_routing (int ioapic, int pin, int irq, int, int); | 207 | extern int io_apic_set_pci_routing (int ioapic, int pin, int irq, int, int); |
diff --git a/include/asm-x86_64/ioctl32.h b/include/asm-x86_64/ioctl32.h deleted file mode 100644 index d0d227f45e05..000000000000 --- a/include/asm-x86_64/ioctl32.h +++ /dev/null | |||
@@ -1 +0,0 @@ | |||
1 | #include <linux/ioctl32.h> | ||
diff --git a/include/asm-x86_64/nmi.h b/include/asm-x86_64/nmi.h index 21d56b086b9d..d3abfc6a8fd5 100644 --- a/include/asm-x86_64/nmi.h +++ b/include/asm-x86_64/nmi.h | |||
@@ -53,5 +53,7 @@ extern void die_nmi(char *str, struct pt_regs *regs); | |||
53 | 53 | ||
54 | extern int panic_on_timeout; | 54 | extern int panic_on_timeout; |
55 | extern int unknown_nmi_panic; | 55 | extern int unknown_nmi_panic; |
56 | |||
57 | extern int check_nmi_watchdog(void); | ||
56 | 58 | ||
57 | #endif /* ASM_NMI_H */ | 59 | #endif /* ASM_NMI_H */ |
diff --git a/include/asm-x86_64/page.h b/include/asm-x86_64/page.h index f43048035a03..9ce338c3a71e 100644 --- a/include/asm-x86_64/page.h +++ b/include/asm-x86_64/page.h | |||
@@ -28,6 +28,7 @@ | |||
28 | #define HPAGE_SIZE ((1UL) << HPAGE_SHIFT) | 28 | #define HPAGE_SIZE ((1UL) << HPAGE_SHIFT) |
29 | #define HPAGE_MASK (~(HPAGE_SIZE - 1)) | 29 | #define HPAGE_MASK (~(HPAGE_SIZE - 1)) |
30 | #define HUGETLB_PAGE_ORDER (HPAGE_SHIFT - PAGE_SHIFT) | 30 | #define HUGETLB_PAGE_ORDER (HPAGE_SHIFT - PAGE_SHIFT) |
31 | #define ARCH_HAS_HUGETLB_CLEAN_STALE_PGTABLE | ||
31 | 32 | ||
32 | #ifdef __KERNEL__ | 33 | #ifdef __KERNEL__ |
33 | #ifndef __ASSEMBLY__ | 34 | #ifndef __ASSEMBLY__ |
diff --git a/include/asm-x86_64/pgtable.h b/include/asm-x86_64/pgtable.h index db2a0efbf573..4eec176c3c39 100644 --- a/include/asm-x86_64/pgtable.h +++ b/include/asm-x86_64/pgtable.h | |||
@@ -253,6 +253,7 @@ extern inline int pte_young(pte_t pte) { return pte_val(pte) & _PAGE_ACCESSED; | |||
253 | extern inline int pte_write(pte_t pte) { return pte_val(pte) & _PAGE_RW; } | 253 | extern inline int pte_write(pte_t pte) { return pte_val(pte) & _PAGE_RW; } |
254 | static inline int pte_file(pte_t pte) { return pte_val(pte) & _PAGE_FILE; } | 254 | static inline int pte_file(pte_t pte) { return pte_val(pte) & _PAGE_FILE; } |
255 | 255 | ||
256 | #define __LARGE_PTE (_PAGE_PSE|_PAGE_PRESENT) | ||
256 | extern inline pte_t pte_rdprotect(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) & ~_PAGE_USER)); return pte; } | 257 | extern inline pte_t pte_rdprotect(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) & ~_PAGE_USER)); return pte; } |
257 | extern inline pte_t pte_exprotect(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) & ~_PAGE_USER)); return pte; } | 258 | extern inline pte_t pte_exprotect(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) & ~_PAGE_USER)); return pte; } |
258 | extern inline pte_t pte_mkclean(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) & ~_PAGE_DIRTY)); return pte; } | 259 | extern inline pte_t pte_mkclean(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) & ~_PAGE_DIRTY)); return pte; } |
@@ -263,6 +264,7 @@ extern inline pte_t pte_mkexec(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) | _ | |||
263 | extern inline pte_t pte_mkdirty(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) | _PAGE_DIRTY)); return pte; } | 264 | extern inline pte_t pte_mkdirty(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) | _PAGE_DIRTY)); return pte; } |
264 | extern inline pte_t pte_mkyoung(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) | _PAGE_ACCESSED)); return pte; } | 265 | extern inline pte_t pte_mkyoung(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) | _PAGE_ACCESSED)); return pte; } |
265 | extern inline pte_t pte_mkwrite(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) | _PAGE_RW)); return pte; } | 266 | extern inline pte_t pte_mkwrite(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) | _PAGE_RW)); return pte; } |
267 | extern inline pte_t pte_mkhuge(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) | __LARGE_PTE)); return pte; } | ||
266 | 268 | ||
267 | struct vm_area_struct; | 269 | struct vm_area_struct; |
268 | 270 | ||
@@ -290,7 +292,6 @@ static inline void ptep_set_wrprotect(struct mm_struct *mm, unsigned long addr, | |||
290 | */ | 292 | */ |
291 | #define pgprot_noncached(prot) (__pgprot(pgprot_val(prot) | _PAGE_PCD | _PAGE_PWT)) | 293 | #define pgprot_noncached(prot) (__pgprot(pgprot_val(prot) | _PAGE_PCD | _PAGE_PWT)) |
292 | 294 | ||
293 | #define __LARGE_PTE (_PAGE_PSE|_PAGE_PRESENT) | ||
294 | static inline int pmd_large(pmd_t pte) { | 295 | static inline int pmd_large(pmd_t pte) { |
295 | return (pmd_val(pte) & __LARGE_PTE) == __LARGE_PTE; | 296 | return (pmd_val(pte) & __LARGE_PTE) == __LARGE_PTE; |
296 | } | 297 | } |
diff --git a/include/asm-x86_64/processor.h b/include/asm-x86_64/processor.h index f0581c35628e..8b55f139968f 100644 --- a/include/asm-x86_64/processor.h +++ b/include/asm-x86_64/processor.h | |||
@@ -62,7 +62,6 @@ struct cpuinfo_x86 { | |||
62 | int x86_tlbsize; /* number of 4K pages in DTLB/ITLB combined(in pages)*/ | 62 | int x86_tlbsize; /* number of 4K pages in DTLB/ITLB combined(in pages)*/ |
63 | __u8 x86_virt_bits, x86_phys_bits; | 63 | __u8 x86_virt_bits, x86_phys_bits; |
64 | __u8 x86_num_cores; | 64 | __u8 x86_num_cores; |
65 | __u8 x86_apicid; | ||
66 | __u32 x86_power; | 65 | __u32 x86_power; |
67 | __u32 extended_cpuid_level; /* Max extended CPUID function supported */ | 66 | __u32 extended_cpuid_level; /* Max extended CPUID function supported */ |
68 | unsigned long loops_per_jiffy; | 67 | unsigned long loops_per_jiffy; |
@@ -159,18 +158,19 @@ static inline void clear_in_cr4 (unsigned long mask) | |||
159 | 158 | ||
160 | 159 | ||
161 | /* | 160 | /* |
162 | * User space process size. 47bits. | 161 | * User space process size. 47bits minus one guard page. |
163 | */ | 162 | */ |
164 | #define TASK_SIZE (0x800000000000UL) | 163 | #define TASK_SIZE64 (0x800000000000UL - 4096) |
165 | 164 | ||
166 | /* This decides where the kernel will search for a free chunk of vm | 165 | /* This decides where the kernel will search for a free chunk of vm |
167 | * space during mmap's. | 166 | * space during mmap's. |
168 | */ | 167 | */ |
169 | #define IA32_PAGE_OFFSET ((current->personality & ADDR_LIMIT_3GB) ? 0xc0000000 : 0xFFFFe000) | 168 | #define IA32_PAGE_OFFSET ((current->personality & ADDR_LIMIT_3GB) ? 0xc0000000 : 0xFFFFe000) |
170 | #define TASK_UNMAPPED_32 PAGE_ALIGN(IA32_PAGE_OFFSET/3) | 169 | |
171 | #define TASK_UNMAPPED_64 PAGE_ALIGN(TASK_SIZE/3) | 170 | #define TASK_SIZE (test_thread_flag(TIF_IA32) ? IA32_PAGE_OFFSET : TASK_SIZE64) |
172 | #define TASK_UNMAPPED_BASE \ | 171 | #define TASK_SIZE_OF(child) ((test_tsk_thread_flag(child, TIF_IA32)) ? IA32_PAGE_OFFSET : TASK_SIZE64) |
173 | (test_thread_flag(TIF_IA32) ? TASK_UNMAPPED_32 : TASK_UNMAPPED_64) | 172 | |
173 | #define TASK_UNMAPPED_BASE PAGE_ALIGN(TASK_SIZE/3) | ||
174 | 174 | ||
175 | /* | 175 | /* |
176 | * Size of io_bitmap. | 176 | * Size of io_bitmap. |
diff --git a/include/asm-x86_64/proto.h b/include/asm-x86_64/proto.h index d0f8f8b4c394..f2f073642d62 100644 --- a/include/asm-x86_64/proto.h +++ b/include/asm-x86_64/proto.h | |||
@@ -30,6 +30,11 @@ extern void ia32_syscall(void); | |||
30 | extern void iommu_hole_init(void); | 30 | extern void iommu_hole_init(void); |
31 | 31 | ||
32 | extern void time_init_gtod(void); | 32 | extern void time_init_gtod(void); |
33 | extern int pmtimer_mark_offset(void); | ||
34 | extern unsigned int do_gettimeoffset_pm(void); | ||
35 | extern u32 pmtmr_ioport; | ||
36 | extern unsigned long long monotonic_base; | ||
37 | extern int sysctl_vsyscall; | ||
33 | 38 | ||
34 | extern void do_softirq_thunk(void); | 39 | extern void do_softirq_thunk(void); |
35 | 40 | ||
diff --git a/include/asm-x86_64/smp.h b/include/asm-x86_64/smp.h index 96844fecbde8..a7425aa5a3b7 100644 --- a/include/asm-x86_64/smp.h +++ b/include/asm-x86_64/smp.h | |||
@@ -68,7 +68,7 @@ static inline int num_booting_cpus(void) | |||
68 | return cpus_weight(cpu_callout_map); | 68 | return cpus_weight(cpu_callout_map); |
69 | } | 69 | } |
70 | 70 | ||
71 | #define __smp_processor_id() read_pda(cpunumber) | 71 | #define raw_smp_processor_id() read_pda(cpunumber) |
72 | 72 | ||
73 | extern __inline int hard_smp_processor_id(void) | 73 | extern __inline int hard_smp_processor_id(void) |
74 | { | 74 | { |
diff --git a/include/asm-x86_64/vsyscall.h b/include/asm-x86_64/vsyscall.h index b0c8d4339906..2872da23fc7e 100644 --- a/include/asm-x86_64/vsyscall.h +++ b/include/asm-x86_64/vsyscall.h | |||
@@ -25,6 +25,7 @@ enum vsyscall_num { | |||
25 | 25 | ||
26 | #define VXTIME_TSC 1 | 26 | #define VXTIME_TSC 1 |
27 | #define VXTIME_HPET 2 | 27 | #define VXTIME_HPET 2 |
28 | #define VXTIME_PMTMR 3 | ||
28 | 29 | ||
29 | struct vxtime_data { | 30 | struct vxtime_data { |
30 | long hpet_address; /* HPET base address */ | 31 | long hpet_address; /* HPET base address */ |
@@ -54,6 +55,8 @@ extern struct timezone sys_tz; | |||
54 | extern int sysctl_vsyscall; | 55 | extern int sysctl_vsyscall; |
55 | extern seqlock_t xtime_lock; | 56 | extern seqlock_t xtime_lock; |
56 | 57 | ||
58 | extern int sysctl_vsyscall; | ||
59 | |||
57 | #define ARCH_HAVE_XTIME_LOCK 1 | 60 | #define ARCH_HAVE_XTIME_LOCK 1 |
58 | 61 | ||
59 | #endif /* __KERNEL__ */ | 62 | #endif /* __KERNEL__ */ |
diff --git a/include/linux/acpi.h b/include/linux/acpi.h index aefe6d051ace..b123cc08773d 100644 --- a/include/linux/acpi.h +++ b/include/linux/acpi.h | |||
@@ -25,6 +25,10 @@ | |||
25 | #ifndef _LINUX_ACPI_H | 25 | #ifndef _LINUX_ACPI_H |
26 | #define _LINUX_ACPI_H | 26 | #define _LINUX_ACPI_H |
27 | 27 | ||
28 | #include <linux/config.h> | ||
29 | |||
30 | #ifdef CONFIG_ACPI | ||
31 | |||
28 | #ifndef _LINUX | 32 | #ifndef _LINUX |
29 | #define _LINUX | 33 | #define _LINUX |
30 | #endif | 34 | #endif |
@@ -533,4 +537,5 @@ static inline int acpi_get_pxm(acpi_handle handle) | |||
533 | 537 | ||
534 | extern int pnpacpi_disabled; | 538 | extern int pnpacpi_disabled; |
535 | 539 | ||
536 | #endif /*_LINUX_ACPI_H*/ | 540 | #endif /* CONFIG_ACPI */ |
541 | #endif /*_LINUX_ACPI_H*/ | ||
diff --git a/include/linux/arcfb.h b/include/linux/arcfb.h new file mode 100644 index 000000000000..721e7654daeb --- /dev/null +++ b/include/linux/arcfb.h | |||
@@ -0,0 +1,8 @@ | |||
1 | #ifndef __LINUX_ARCFB_H__ | ||
2 | #define __LINUX_ARCFB_H__ | ||
3 | |||
4 | #define FBIO_WAITEVENT _IO('F', 0x88) | ||
5 | #define FBIO_GETCONTROL2 _IOR('F', 0x89, size_t) | ||
6 | |||
7 | #endif | ||
8 | |||
diff --git a/include/linux/ata.h b/include/linux/ata.h index d8981402cd5b..6962e26fc6df 100644 --- a/include/linux/ata.h +++ b/include/linux/ata.h | |||
@@ -226,6 +226,7 @@ struct ata_taskfile { | |||
226 | }; | 226 | }; |
227 | 227 | ||
228 | #define ata_id_is_ata(id) (((id)[0] & (1 << 15)) == 0) | 228 | #define ata_id_is_ata(id) (((id)[0] & (1 << 15)) == 0) |
229 | #define ata_id_is_sata(id) ((id)[93] == 0) | ||
229 | #define ata_id_rahead_enabled(id) ((id)[85] & (1 << 6)) | 230 | #define ata_id_rahead_enabled(id) ((id)[85] & (1 << 6)) |
230 | #define ata_id_wcache_enabled(id) ((id)[85] & (1 << 5)) | 231 | #define ata_id_wcache_enabled(id) ((id)[85] & (1 << 5)) |
231 | #define ata_id_has_flush(id) ((id)[83] & (1 << 12)) | 232 | #define ata_id_has_flush(id) ((id)[83] & (1 << 12)) |
diff --git a/include/linux/atalk.h b/include/linux/atalk.h index 31d3fc25ccbd..09a1451c1159 100644 --- a/include/linux/atalk.h +++ b/include/linux/atalk.h | |||
@@ -20,7 +20,7 @@ | |||
20 | #define SIOCATALKDIFADDR (SIOCPROTOPRIVATE + 0) | 20 | #define SIOCATALKDIFADDR (SIOCPROTOPRIVATE + 0) |
21 | 21 | ||
22 | struct atalk_addr { | 22 | struct atalk_addr { |
23 | __u16 s_net; | 23 | __be16 s_net; |
24 | __u8 s_node; | 24 | __u8 s_node; |
25 | }; | 25 | }; |
26 | 26 | ||
@@ -33,8 +33,8 @@ struct sockaddr_at { | |||
33 | 33 | ||
34 | struct atalk_netrange { | 34 | struct atalk_netrange { |
35 | __u8 nr_phase; | 35 | __u8 nr_phase; |
36 | __u16 nr_firstnet; | 36 | __be16 nr_firstnet; |
37 | __u16 nr_lastnet; | 37 | __be16 nr_lastnet; |
38 | }; | 38 | }; |
39 | 39 | ||
40 | #ifdef __KERNEL__ | 40 | #ifdef __KERNEL__ |
@@ -70,8 +70,8 @@ struct atalk_iface { | |||
70 | struct atalk_sock { | 70 | struct atalk_sock { |
71 | /* struct sock has to be the first member of atalk_sock */ | 71 | /* struct sock has to be the first member of atalk_sock */ |
72 | struct sock sk; | 72 | struct sock sk; |
73 | unsigned short dest_net; | 73 | __be16 dest_net; |
74 | unsigned short src_net; | 74 | __be16 src_net; |
75 | unsigned char dest_node; | 75 | unsigned char dest_node; |
76 | unsigned char src_node; | 76 | unsigned char src_node; |
77 | unsigned char dest_port; | 77 | unsigned char dest_port; |
@@ -95,9 +95,9 @@ struct ddpehdr { | |||
95 | deh_hops:4, | 95 | deh_hops:4, |
96 | deh_len:10; | 96 | deh_len:10; |
97 | #endif | 97 | #endif |
98 | __u16 deh_sum; | 98 | __be16 deh_sum; |
99 | __u16 deh_dnet; | 99 | __be16 deh_dnet; |
100 | __u16 deh_snet; | 100 | __be16 deh_snet; |
101 | __u8 deh_dnode; | 101 | __u8 deh_dnode; |
102 | __u8 deh_snode; | 102 | __u8 deh_snode; |
103 | __u8 deh_dport; | 103 | __u8 deh_dport; |
@@ -142,24 +142,24 @@ struct ddpshdr { | |||
142 | 142 | ||
143 | /* AppleTalk AARP headers */ | 143 | /* AppleTalk AARP headers */ |
144 | struct elapaarp { | 144 | struct elapaarp { |
145 | __u16 hw_type; | 145 | __be16 hw_type; |
146 | #define AARP_HW_TYPE_ETHERNET 1 | 146 | #define AARP_HW_TYPE_ETHERNET 1 |
147 | #define AARP_HW_TYPE_TOKENRING 2 | 147 | #define AARP_HW_TYPE_TOKENRING 2 |
148 | __u16 pa_type; | 148 | __be16 pa_type; |
149 | __u8 hw_len; | 149 | __u8 hw_len; |
150 | __u8 pa_len; | 150 | __u8 pa_len; |
151 | #define AARP_PA_ALEN 4 | 151 | #define AARP_PA_ALEN 4 |
152 | __u16 function; | 152 | __be16 function; |
153 | #define AARP_REQUEST 1 | 153 | #define AARP_REQUEST 1 |
154 | #define AARP_REPLY 2 | 154 | #define AARP_REPLY 2 |
155 | #define AARP_PROBE 3 | 155 | #define AARP_PROBE 3 |
156 | __u8 hw_src[ETH_ALEN] __attribute__ ((packed)); | 156 | __u8 hw_src[ETH_ALEN] __attribute__ ((packed)); |
157 | __u8 pa_src_zero __attribute__ ((packed)); | 157 | __u8 pa_src_zero __attribute__ ((packed)); |
158 | __u16 pa_src_net __attribute__ ((packed)); | 158 | __be16 pa_src_net __attribute__ ((packed)); |
159 | __u8 pa_src_node __attribute__ ((packed)); | 159 | __u8 pa_src_node __attribute__ ((packed)); |
160 | __u8 hw_dst[ETH_ALEN] __attribute__ ((packed)); | 160 | __u8 hw_dst[ETH_ALEN] __attribute__ ((packed)); |
161 | __u8 pa_dst_zero __attribute__ ((packed)); | 161 | __u8 pa_dst_zero __attribute__ ((packed)); |
162 | __u16 pa_dst_net __attribute__ ((packed)); | 162 | __be16 pa_dst_net __attribute__ ((packed)); |
163 | __u8 pa_dst_node __attribute__ ((packed)); | 163 | __u8 pa_dst_node __attribute__ ((packed)); |
164 | }; | 164 | }; |
165 | 165 | ||
diff --git a/include/linux/audit.h b/include/linux/audit.h index 19f04b049798..bf2ad3ba72eb 100644 --- a/include/linux/audit.h +++ b/include/linux/audit.h | |||
@@ -27,15 +27,52 @@ | |||
27 | #include <linux/sched.h> | 27 | #include <linux/sched.h> |
28 | #include <linux/elf.h> | 28 | #include <linux/elf.h> |
29 | 29 | ||
30 | /* Request and reply types */ | 30 | /* The netlink messages for the audit system is divided into blocks: |
31 | #define AUDIT_GET 1000 /* Get status */ | 31 | * 1000 - 1099 are for commanding the audit system |
32 | #define AUDIT_SET 1001 /* Set status (enable/disable/auditd) */ | 32 | * 1100 - 1199 user space trusted application messages |
33 | #define AUDIT_LIST 1002 /* List filtering rules */ | 33 | * 1200 - 1299 messages internal to the audit daemon |
34 | #define AUDIT_ADD 1003 /* Add filtering rule */ | 34 | * 1300 - 1399 audit event messages |
35 | #define AUDIT_DEL 1004 /* Delete filtering rule */ | 35 | * 1400 - 1499 SE Linux use |
36 | #define AUDIT_USER 1005 /* Send a message from user-space */ | 36 | * 1500 - 1999 future use |
37 | #define AUDIT_LOGIN 1006 /* Define the login id and informaiton */ | 37 | * 2000 is for otherwise unclassified kernel audit messages |
38 | #define AUDIT_KERNEL 2000 /* Asynchronous audit record. NOT A REQUEST. */ | 38 | * |
39 | * Messages from 1000-1199 are bi-directional. 1200-1299 are exclusively user | ||
40 | * space. Anything over that is kernel --> user space communication. | ||
41 | */ | ||
42 | #define AUDIT_GET 1000 /* Get status */ | ||
43 | #define AUDIT_SET 1001 /* Set status (enable/disable/auditd) */ | ||
44 | #define AUDIT_LIST 1002 /* List syscall filtering rules */ | ||
45 | #define AUDIT_ADD 1003 /* Add syscall filtering rule */ | ||
46 | #define AUDIT_DEL 1004 /* Delete syscall filtering rule */ | ||
47 | #define AUDIT_USER 1005 /* Message from userspace -- deprecated */ | ||
48 | #define AUDIT_LOGIN 1006 /* Define the login id and information */ | ||
49 | #define AUDIT_WATCH_INS 1007 /* Insert file/dir watch entry */ | ||
50 | #define AUDIT_WATCH_REM 1008 /* Remove file/dir watch entry */ | ||
51 | #define AUDIT_WATCH_LIST 1009 /* List all file/dir watches */ | ||
52 | #define AUDIT_SIGNAL_INFO 1010 /* Get info about sender of signal to auditd */ | ||
53 | |||
54 | #define AUDIT_FIRST_USER_MSG 1100 /* Userspace messages uninteresting to kernel */ | ||
55 | #define AUDIT_LAST_USER_MSG 1199 | ||
56 | |||
57 | #define AUDIT_DAEMON_START 1200 /* Daemon startup record */ | ||
58 | #define AUDIT_DAEMON_END 1201 /* Daemon normal stop record */ | ||
59 | #define AUDIT_DAEMON_ABORT 1202 /* Daemon error stop record */ | ||
60 | #define AUDIT_DAEMON_CONFIG 1203 /* Daemon config change */ | ||
61 | |||
62 | #define AUDIT_SYSCALL 1300 /* Syscall event */ | ||
63 | #define AUDIT_FS_WATCH 1301 /* Filesystem watch event */ | ||
64 | #define AUDIT_PATH 1302 /* Filename path information */ | ||
65 | #define AUDIT_IPC 1303 /* IPC record */ | ||
66 | #define AUDIT_SOCKETCALL 1304 /* sys_socketcall arguments */ | ||
67 | #define AUDIT_CONFIG_CHANGE 1305 /* Audit system configuration change */ | ||
68 | #define AUDIT_SOCKADDR 1306 /* sockaddr copied as syscall arg */ | ||
69 | #define AUDIT_CWD 1307 /* Current working directory */ | ||
70 | |||
71 | #define AUDIT_AVC 1400 /* SE Linux avc denial or grant */ | ||
72 | #define AUDIT_SELINUX_ERR 1401 /* Internal SE Linux Errors */ | ||
73 | #define AUDIT_AVC_PATH 1402 /* dentry, vfsmount pair from avc */ | ||
74 | |||
75 | #define AUDIT_KERNEL 2000 /* Asynchronous audit record. NOT A REQUEST. */ | ||
39 | 76 | ||
40 | /* Rule flags */ | 77 | /* Rule flags */ |
41 | #define AUDIT_PER_TASK 0x01 /* Apply rule at task creation (not syscall) */ | 78 | #define AUDIT_PER_TASK 0x01 /* Apply rule at task creation (not syscall) */ |
@@ -132,16 +169,9 @@ | |||
132 | #define AUDIT_ARCH_V850 (EM_V850|__AUDIT_ARCH_LE) | 169 | #define AUDIT_ARCH_V850 (EM_V850|__AUDIT_ARCH_LE) |
133 | #define AUDIT_ARCH_X86_64 (EM_X86_64|__AUDIT_ARCH_64BIT|__AUDIT_ARCH_LE) | 170 | #define AUDIT_ARCH_X86_64 (EM_X86_64|__AUDIT_ARCH_64BIT|__AUDIT_ARCH_LE) |
134 | 171 | ||
135 | #ifndef __KERNEL__ | ||
136 | struct audit_message { | ||
137 | struct nlmsghdr nlh; | ||
138 | char data[1200]; | ||
139 | }; | ||
140 | #endif | ||
141 | |||
142 | struct audit_status { | 172 | struct audit_status { |
143 | __u32 mask; /* Bit mask for valid entries */ | 173 | __u32 mask; /* Bit mask for valid entries */ |
144 | __u32 enabled; /* 1 = enabled, 0 = disbaled */ | 174 | __u32 enabled; /* 1 = enabled, 0 = disabled */ |
145 | __u32 failure; /* Failure-to-log action */ | 175 | __u32 failure; /* Failure-to-log action */ |
146 | __u32 pid; /* pid of auditd process */ | 176 | __u32 pid; /* pid of auditd process */ |
147 | __u32 rate_limit; /* messages rate limit (per second) */ | 177 | __u32 rate_limit; /* messages rate limit (per second) */ |
@@ -161,6 +191,11 @@ struct audit_rule { /* for AUDIT_LIST, AUDIT_ADD, and AUDIT_DEL */ | |||
161 | 191 | ||
162 | #ifdef __KERNEL__ | 192 | #ifdef __KERNEL__ |
163 | 193 | ||
194 | struct audit_sig_info { | ||
195 | uid_t uid; | ||
196 | pid_t pid; | ||
197 | }; | ||
198 | |||
164 | struct audit_buffer; | 199 | struct audit_buffer; |
165 | struct audit_context; | 200 | struct audit_context; |
166 | struct inode; | 201 | struct inode; |
@@ -185,11 +220,16 @@ extern void audit_inode(const char *name, const struct inode *inode); | |||
185 | /* Private API (for audit.c only) */ | 220 | /* Private API (for audit.c only) */ |
186 | extern int audit_receive_filter(int type, int pid, int uid, int seq, | 221 | extern int audit_receive_filter(int type, int pid, int uid, int seq, |
187 | void *data, uid_t loginuid); | 222 | void *data, uid_t loginuid); |
188 | extern void audit_get_stamp(struct audit_context *ctx, | 223 | extern unsigned int audit_serial(void); |
189 | struct timespec *t, unsigned int *serial); | 224 | extern void auditsc_get_stamp(struct audit_context *ctx, |
225 | struct timespec *t, unsigned int *serial); | ||
190 | extern int audit_set_loginuid(struct task_struct *task, uid_t loginuid); | 226 | extern int audit_set_loginuid(struct task_struct *task, uid_t loginuid); |
191 | extern uid_t audit_get_loginuid(struct audit_context *ctx); | 227 | extern uid_t audit_get_loginuid(struct audit_context *ctx); |
192 | extern int audit_ipc_perms(unsigned long qbytes, uid_t uid, gid_t gid, mode_t mode); | 228 | extern int audit_ipc_perms(unsigned long qbytes, uid_t uid, gid_t gid, mode_t mode); |
229 | extern int audit_socketcall(int nargs, unsigned long *args); | ||
230 | extern int audit_sockaddr(int len, void *addr); | ||
231 | extern int audit_avc_path(struct dentry *dentry, struct vfsmount *mnt); | ||
232 | extern void audit_signal_info(int sig, struct task_struct *t); | ||
193 | #else | 233 | #else |
194 | #define audit_alloc(t) ({ 0; }) | 234 | #define audit_alloc(t) ({ 0; }) |
195 | #define audit_free(t) do { ; } while (0) | 235 | #define audit_free(t) do { ; } while (0) |
@@ -198,18 +238,24 @@ extern int audit_ipc_perms(unsigned long qbytes, uid_t uid, gid_t gid, mode_t mo | |||
198 | #define audit_getname(n) do { ; } while (0) | 238 | #define audit_getname(n) do { ; } while (0) |
199 | #define audit_putname(n) do { ; } while (0) | 239 | #define audit_putname(n) do { ; } while (0) |
200 | #define audit_inode(n,i) do { ; } while (0) | 240 | #define audit_inode(n,i) do { ; } while (0) |
241 | #define audit_receive_filter(t,p,u,s,d,l) ({ -EOPNOTSUPP; }) | ||
242 | #define auditsc_get_stamp(c,t,s) do { BUG(); } while (0) | ||
201 | #define audit_get_loginuid(c) ({ -1; }) | 243 | #define audit_get_loginuid(c) ({ -1; }) |
202 | #define audit_ipc_perms(q,u,g,m) ({ 0; }) | 244 | #define audit_ipc_perms(q,u,g,m) ({ 0; }) |
245 | #define audit_socketcall(n,a) ({ 0; }) | ||
246 | #define audit_sockaddr(len, addr) ({ 0; }) | ||
247 | #define audit_avc_path(dentry, mnt) ({ 0; }) | ||
248 | #define audit_signal_info(s,t) do { ; } while (0) | ||
203 | #endif | 249 | #endif |
204 | 250 | ||
205 | #ifdef CONFIG_AUDIT | 251 | #ifdef CONFIG_AUDIT |
206 | /* These are defined in audit.c */ | 252 | /* These are defined in audit.c */ |
207 | /* Public API */ | 253 | /* Public API */ |
208 | extern void audit_log(struct audit_context *ctx, | 254 | extern void audit_log(struct audit_context *ctx, int type, |
209 | const char *fmt, ...) | 255 | const char *fmt, ...) |
210 | __attribute__((format(printf,2,3))); | 256 | __attribute__((format(printf,3,4))); |
211 | 257 | ||
212 | extern struct audit_buffer *audit_log_start(struct audit_context *ctx); | 258 | extern struct audit_buffer *audit_log_start(struct audit_context *ctx,int type); |
213 | extern void audit_log_format(struct audit_buffer *ab, | 259 | extern void audit_log_format(struct audit_buffer *ab, |
214 | const char *fmt, ...) | 260 | const char *fmt, ...) |
215 | __attribute__((format(printf,2,3))); | 261 | __attribute__((format(printf,2,3))); |
@@ -229,8 +275,8 @@ extern void audit_send_reply(int pid, int seq, int type, | |||
229 | void *payload, int size); | 275 | void *payload, int size); |
230 | extern void audit_log_lost(const char *message); | 276 | extern void audit_log_lost(const char *message); |
231 | #else | 277 | #else |
232 | #define audit_log(t,f,...) do { ; } while (0) | 278 | #define audit_log(c,t,f,...) do { ; } while (0) |
233 | #define audit_log_start(t) ({ NULL; }) | 279 | #define audit_log_start(c,t) ({ NULL; }) |
234 | #define audit_log_vformat(b,f,a) do { ; } while (0) | 280 | #define audit_log_vformat(b,f,a) do { ; } while (0) |
235 | #define audit_log_format(b,f,...) do { ; } while (0) | 281 | #define audit_log_format(b,f,...) do { ; } while (0) |
236 | #define audit_log_end(b) do { ; } while (0) | 282 | #define audit_log_end(b) do { ; } while (0) |
diff --git a/include/linux/auto_fs4.h b/include/linux/auto_fs4.h index a1657fb99516..9343c89d843c 100644 --- a/include/linux/auto_fs4.h +++ b/include/linux/auto_fs4.h | |||
@@ -23,7 +23,7 @@ | |||
23 | #define AUTOFS_MIN_PROTO_VERSION 3 | 23 | #define AUTOFS_MIN_PROTO_VERSION 3 |
24 | #define AUTOFS_MAX_PROTO_VERSION 4 | 24 | #define AUTOFS_MAX_PROTO_VERSION 4 |
25 | 25 | ||
26 | #define AUTOFS_PROTO_SUBVERSION 6 | 26 | #define AUTOFS_PROTO_SUBVERSION 7 |
27 | 27 | ||
28 | /* Mask for expire behaviour */ | 28 | /* Mask for expire behaviour */ |
29 | #define AUTOFS_EXP_IMMEDIATE 1 | 29 | #define AUTOFS_EXP_IMMEDIATE 1 |
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index ef1afc178c0a..4a99b76c5a33 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h | |||
@@ -544,7 +544,7 @@ extern void blk_end_sync_rq(struct request *rq); | |||
544 | extern void blk_attempt_remerge(request_queue_t *, struct request *); | 544 | extern void blk_attempt_remerge(request_queue_t *, struct request *); |
545 | extern void __blk_attempt_remerge(request_queue_t *, struct request *); | 545 | extern void __blk_attempt_remerge(request_queue_t *, struct request *); |
546 | extern struct request *blk_get_request(request_queue_t *, int, int); | 546 | extern struct request *blk_get_request(request_queue_t *, int, int); |
547 | extern void blk_insert_request(request_queue_t *, struct request *, int, void *, int); | 547 | extern void blk_insert_request(request_queue_t *, struct request *, int, void *); |
548 | extern void blk_requeue_request(request_queue_t *, struct request *); | 548 | extern void blk_requeue_request(request_queue_t *, struct request *); |
549 | extern void blk_plug_device(request_queue_t *); | 549 | extern void blk_plug_device(request_queue_t *); |
550 | extern int blk_remove_plug(request_queue_t *); | 550 | extern int blk_remove_plug(request_queue_t *); |
diff --git a/include/linux/chio.h b/include/linux/chio.h new file mode 100644 index 000000000000..63035ae67e63 --- /dev/null +++ b/include/linux/chio.h | |||
@@ -0,0 +1,168 @@ | |||
1 | /* | ||
2 | * ioctl interface for the scsi media changer driver | ||
3 | */ | ||
4 | |||
5 | /* changer element types */ | ||
6 | #define CHET_MT 0 /* media transport element (robot) */ | ||
7 | #define CHET_ST 1 /* storage element (media slots) */ | ||
8 | #define CHET_IE 2 /* import/export element */ | ||
9 | #define CHET_DT 3 /* data transfer element (tape/cdrom/whatever) */ | ||
10 | #define CHET_V1 4 /* vendor specific #1 */ | ||
11 | #define CHET_V2 5 /* vendor specific #2 */ | ||
12 | #define CHET_V3 6 /* vendor specific #3 */ | ||
13 | #define CHET_V4 7 /* vendor specific #4 */ | ||
14 | |||
15 | |||
16 | /* | ||
17 | * CHIOGPARAMS | ||
18 | * query changer properties | ||
19 | * | ||
20 | * CHIOVGPARAMS | ||
21 | * query vendor-specific element types | ||
22 | * | ||
23 | * accessing elements works by specifing type and unit of the element. | ||
24 | * for eample, storage elements are addressed with type = CHET_ST and | ||
25 | * unit = 0 .. cp_nslots-1 | ||
26 | * | ||
27 | */ | ||
28 | struct changer_params { | ||
29 | int cp_curpicker; /* current transport element */ | ||
30 | int cp_npickers; /* number of transport elements (CHET_MT) */ | ||
31 | int cp_nslots; /* number of storage elements (CHET_ST) */ | ||
32 | int cp_nportals; /* number of import/export elements (CHET_IE) */ | ||
33 | int cp_ndrives; /* number of data transfer elements (CHET_DT) */ | ||
34 | }; | ||
35 | struct changer_vendor_params { | ||
36 | int cvp_n1; /* number of vendor specific elems (CHET_V1) */ | ||
37 | char cvp_label1[16]; | ||
38 | int cvp_n2; /* number of vendor specific elems (CHET_V2) */ | ||
39 | char cvp_label2[16]; | ||
40 | int cvp_n3; /* number of vendor specific elems (CHET_V3) */ | ||
41 | char cvp_label3[16]; | ||
42 | int cvp_n4; /* number of vendor specific elems (CHET_V4) */ | ||
43 | char cvp_label4[16]; | ||
44 | int reserved[8]; | ||
45 | }; | ||
46 | |||
47 | |||
48 | /* | ||
49 | * CHIOMOVE | ||
50 | * move a medium from one element to another | ||
51 | */ | ||
52 | struct changer_move { | ||
53 | int cm_fromtype; /* type/unit of source element */ | ||
54 | int cm_fromunit; | ||
55 | int cm_totype; /* type/unit of destination element */ | ||
56 | int cm_tounit; | ||
57 | int cm_flags; | ||
58 | }; | ||
59 | #define CM_INVERT 1 /* flag: rotate media (for double-sided like MOD) */ | ||
60 | |||
61 | |||
62 | /* | ||
63 | * CHIOEXCHANGE | ||
64 | * move one medium from element #1 to element #2, | ||
65 | * and another one from element #2 to element #3. | ||
66 | * element #1 and #3 are allowed to be identical. | ||
67 | */ | ||
68 | struct changer_exchange { | ||
69 | int ce_srctype; /* type/unit of element #1 */ | ||
70 | int ce_srcunit; | ||
71 | int ce_fdsttype; /* type/unit of element #2 */ | ||
72 | int ce_fdstunit; | ||
73 | int ce_sdsttype; /* type/unit of element #3 */ | ||
74 | int ce_sdstunit; | ||
75 | int ce_flags; | ||
76 | }; | ||
77 | #define CE_INVERT1 1 | ||
78 | #define CE_INVERT2 2 | ||
79 | |||
80 | |||
81 | /* | ||
82 | * CHIOPOSITION | ||
83 | * move the transport element (robot arm) to a specific element. | ||
84 | */ | ||
85 | struct changer_position { | ||
86 | int cp_type; | ||
87 | int cp_unit; | ||
88 | int cp_flags; | ||
89 | }; | ||
90 | #define CP_INVERT 1 | ||
91 | |||
92 | |||
93 | /* | ||
94 | * CHIOGSTATUS | ||
95 | * get element status for all elements of a specific type | ||
96 | */ | ||
97 | struct changer_element_status { | ||
98 | int ces_type; | ||
99 | unsigned char *ces_data; | ||
100 | }; | ||
101 | #define CESTATUS_FULL 0x01 /* full */ | ||
102 | #define CESTATUS_IMPEXP 0x02 /* media was imported (inserted by sysop) */ | ||
103 | #define CESTATUS_EXCEPT 0x04 /* error condition */ | ||
104 | #define CESTATUS_ACCESS 0x08 /* access allowed */ | ||
105 | #define CESTATUS_EXENAB 0x10 /* element can export media */ | ||
106 | #define CESTATUS_INENAB 0x20 /* element can import media */ | ||
107 | |||
108 | |||
109 | /* | ||
110 | * CHIOGELEM | ||
111 | * get more detailed status informtion for a single element | ||
112 | */ | ||
113 | struct changer_get_element { | ||
114 | int cge_type; /* type/unit */ | ||
115 | int cge_unit; | ||
116 | int cge_status; /* status */ | ||
117 | int cge_errno; /* errno */ | ||
118 | int cge_srctype; /* source element of the last move/exchange */ | ||
119 | int cge_srcunit; | ||
120 | int cge_id; /* scsi id (for data transfer elements) */ | ||
121 | int cge_lun; /* scsi lun (for data transfer elements) */ | ||
122 | char cge_pvoltag[36]; /* primary volume tag */ | ||
123 | char cge_avoltag[36]; /* alternate volume tag */ | ||
124 | int cge_flags; | ||
125 | }; | ||
126 | /* flags */ | ||
127 | #define CGE_ERRNO 0x01 /* errno available */ | ||
128 | #define CGE_INVERT 0x02 /* media inverted */ | ||
129 | #define CGE_SRC 0x04 /* media src available */ | ||
130 | #define CGE_IDLUN 0x08 /* ID+LUN available */ | ||
131 | #define CGE_PVOLTAG 0x10 /* primary volume tag available */ | ||
132 | #define CGE_AVOLTAG 0x20 /* alternate volume tag available */ | ||
133 | |||
134 | |||
135 | /* | ||
136 | * CHIOSVOLTAG | ||
137 | * set volume tag | ||
138 | */ | ||
139 | struct changer_set_voltag { | ||
140 | int csv_type; /* type/unit */ | ||
141 | int csv_unit; | ||
142 | char csv_voltag[36]; /* volume tag */ | ||
143 | int csv_flags; | ||
144 | }; | ||
145 | #define CSV_PVOLTAG 0x01 /* primary volume tag */ | ||
146 | #define CSV_AVOLTAG 0x02 /* alternate volume tag */ | ||
147 | #define CSV_CLEARTAG 0x04 /* clear volume tag */ | ||
148 | |||
149 | /* ioctls */ | ||
150 | #define CHIOMOVE _IOW('c', 1,struct changer_move) | ||
151 | #define CHIOEXCHANGE _IOW('c', 2,struct changer_exchange) | ||
152 | #define CHIOPOSITION _IOW('c', 3,struct changer_position) | ||
153 | #define CHIOGPICKER _IOR('c', 4,int) /* not impl. */ | ||
154 | #define CHIOSPICKER _IOW('c', 5,int) /* not impl. */ | ||
155 | #define CHIOGPARAMS _IOR('c', 6,struct changer_params) | ||
156 | #define CHIOGSTATUS _IOW('c', 8,struct changer_element_status) | ||
157 | #define CHIOGELEM _IOW('c',16,struct changer_get_element) | ||
158 | #define CHIOINITELEM _IO('c',17) | ||
159 | #define CHIOSVOLTAG _IOW('c',18,struct changer_set_voltag) | ||
160 | #define CHIOGVPARAMS _IOR('c',19,struct changer_vendor_params) | ||
161 | |||
162 | /* ---------------------------------------------------------------------- */ | ||
163 | |||
164 | /* | ||
165 | * Local variables: | ||
166 | * c-basic-offset: 8 | ||
167 | * End: | ||
168 | */ | ||
diff --git a/include/linux/cpufreq.h b/include/linux/cpufreq.h index f21af067d015..927daa86c9b3 100644 --- a/include/linux/cpufreq.h +++ b/include/linux/cpufreq.h | |||
@@ -49,7 +49,7 @@ int cpufreq_unregister_notifier(struct notifier_block *nb, unsigned int list); | |||
49 | /* Frequency values here are CPU kHz so that hardware which doesn't run | 49 | /* Frequency values here are CPU kHz so that hardware which doesn't run |
50 | * with some frequencies can complain without having to guess what per | 50 | * with some frequencies can complain without having to guess what per |
51 | * cent / per mille means. | 51 | * cent / per mille means. |
52 | * Maximum transition latency is in microseconds - if it's unknown, | 52 | * Maximum transition latency is in nanoseconds - if it's unknown, |
53 | * CPUFREQ_ETERNAL shall be used. | 53 | * CPUFREQ_ETERNAL shall be used. |
54 | */ | 54 | */ |
55 | 55 | ||
diff --git a/include/linux/device.h b/include/linux/device.h index cf470459fa69..7b781a72b293 100644 --- a/include/linux/device.h +++ b/include/linux/device.h | |||
@@ -14,6 +14,7 @@ | |||
14 | #include <linux/config.h> | 14 | #include <linux/config.h> |
15 | #include <linux/ioport.h> | 15 | #include <linux/ioport.h> |
16 | #include <linux/kobject.h> | 16 | #include <linux/kobject.h> |
17 | #include <linux/klist.h> | ||
17 | #include <linux/list.h> | 18 | #include <linux/list.h> |
18 | #include <linux/types.h> | 19 | #include <linux/types.h> |
19 | #include <linux/module.h> | 20 | #include <linux/module.h> |
@@ -44,14 +45,15 @@ struct device; | |||
44 | struct device_driver; | 45 | struct device_driver; |
45 | struct class; | 46 | struct class; |
46 | struct class_device; | 47 | struct class_device; |
47 | struct class_simple; | ||
48 | 48 | ||
49 | struct bus_type { | 49 | struct bus_type { |
50 | char * name; | 50 | const char * name; |
51 | 51 | ||
52 | struct subsystem subsys; | 52 | struct subsystem subsys; |
53 | struct kset drivers; | 53 | struct kset drivers; |
54 | struct kset devices; | 54 | struct kset devices; |
55 | struct klist klist_devices; | ||
56 | struct klist klist_drivers; | ||
55 | 57 | ||
56 | struct bus_attribute * bus_attrs; | 58 | struct bus_attribute * bus_attrs; |
57 | struct device_attribute * dev_attrs; | 59 | struct device_attribute * dev_attrs; |
@@ -98,17 +100,18 @@ extern int bus_create_file(struct bus_type *, struct bus_attribute *); | |||
98 | extern void bus_remove_file(struct bus_type *, struct bus_attribute *); | 100 | extern void bus_remove_file(struct bus_type *, struct bus_attribute *); |
99 | 101 | ||
100 | struct device_driver { | 102 | struct device_driver { |
101 | char * name; | 103 | const char * name; |
102 | struct bus_type * bus; | 104 | struct bus_type * bus; |
103 | 105 | ||
104 | struct completion unloaded; | 106 | struct completion unloaded; |
105 | struct kobject kobj; | 107 | struct kobject kobj; |
106 | struct list_head devices; | 108 | struct klist klist_devices; |
109 | struct klist_node knode_bus; | ||
107 | 110 | ||
108 | struct module * owner; | 111 | struct module * owner; |
109 | 112 | ||
110 | int (*probe) (struct device * dev); | 113 | int (*probe) (struct device * dev); |
111 | int (*remove) (struct device * dev); | 114 | int (*remove) (struct device * dev); |
112 | void (*shutdown) (struct device * dev); | 115 | void (*shutdown) (struct device * dev); |
113 | int (*suspend) (struct device * dev, pm_message_t state, u32 level); | 116 | int (*suspend) (struct device * dev, pm_message_t state, u32 level); |
114 | int (*resume) (struct device * dev, u32 level); | 117 | int (*resume) (struct device * dev, u32 level); |
@@ -137,12 +140,16 @@ struct driver_attribute driver_attr_##_name = __ATTR(_name,_mode,_show,_store) | |||
137 | extern int driver_create_file(struct device_driver *, struct driver_attribute *); | 140 | extern int driver_create_file(struct device_driver *, struct driver_attribute *); |
138 | extern void driver_remove_file(struct device_driver *, struct driver_attribute *); | 141 | extern void driver_remove_file(struct device_driver *, struct driver_attribute *); |
139 | 142 | ||
143 | extern int driver_for_each_device(struct device_driver * drv, struct device * start, | ||
144 | void * data, int (*fn)(struct device *, void *)); | ||
145 | |||
140 | 146 | ||
141 | /* | 147 | /* |
142 | * device classes | 148 | * device classes |
143 | */ | 149 | */ |
144 | struct class { | 150 | struct class { |
145 | char * name; | 151 | const char * name; |
152 | struct module * owner; | ||
146 | 153 | ||
147 | struct subsystem subsys; | 154 | struct subsystem subsys; |
148 | struct list_head children; | 155 | struct list_head children; |
@@ -185,6 +192,7 @@ struct class_device { | |||
185 | struct kobject kobj; | 192 | struct kobject kobj; |
186 | struct class * class; /* required */ | 193 | struct class * class; /* required */ |
187 | dev_t devt; /* dev_t, creates the sysfs "dev" */ | 194 | dev_t devt; /* dev_t, creates the sysfs "dev" */ |
195 | struct class_device_attribute *devt_attr; | ||
188 | struct device * dev; /* not necessary, but nice to have */ | 196 | struct device * dev; /* not necessary, but nice to have */ |
189 | void * class_data; /* class-specific data */ | 197 | void * class_data; /* class-specific data */ |
190 | 198 | ||
@@ -245,26 +253,28 @@ struct class_interface { | |||
245 | extern int class_interface_register(struct class_interface *); | 253 | extern int class_interface_register(struct class_interface *); |
246 | extern void class_interface_unregister(struct class_interface *); | 254 | extern void class_interface_unregister(struct class_interface *); |
247 | 255 | ||
248 | /* interface for class simple stuff */ | 256 | extern struct class *class_create(struct module *owner, char *name); |
249 | extern struct class_simple *class_simple_create(struct module *owner, char *name); | 257 | extern void class_destroy(struct class *cls); |
250 | extern void class_simple_destroy(struct class_simple *cs); | 258 | extern struct class_device *class_device_create(struct class *cls, dev_t devt, |
251 | extern struct class_device *class_simple_device_add(struct class_simple *cs, dev_t dev, struct device *device, const char *fmt, ...) | 259 | struct device *device, char *fmt, ...) |
252 | __attribute__((format(printf,4,5))); | 260 | __attribute__((format(printf,4,5))); |
253 | extern int class_simple_set_hotplug(struct class_simple *, | 261 | extern void class_device_destroy(struct class *cls, dev_t devt); |
254 | int (*hotplug)(struct class_device *dev, char **envp, int num_envp, char *buffer, int buffer_size)); | ||
255 | extern void class_simple_device_remove(dev_t dev); | ||
256 | 262 | ||
257 | 263 | ||
258 | struct device { | 264 | struct device { |
259 | struct list_head node; /* node in sibling list */ | 265 | struct klist klist_children; |
260 | struct list_head bus_list; /* node in bus's list */ | 266 | struct klist_node knode_parent; /* node in sibling list */ |
261 | struct list_head driver_list; | 267 | struct klist_node knode_driver; |
262 | struct list_head children; | 268 | struct klist_node knode_bus; |
263 | struct device * parent; | 269 | struct device * parent; |
264 | 270 | ||
265 | struct kobject kobj; | 271 | struct kobject kobj; |
266 | char bus_id[BUS_ID_SIZE]; /* position on parent bus */ | 272 | char bus_id[BUS_ID_SIZE]; /* position on parent bus */ |
267 | 273 | ||
274 | struct semaphore sem; /* semaphore to synchronize calls to | ||
275 | * its driver. | ||
276 | */ | ||
277 | |||
268 | struct bus_type * bus; /* type of bus device is on */ | 278 | struct bus_type * bus; /* type of bus device is on */ |
269 | struct device_driver *driver; /* which driver has allocated this | 279 | struct device_driver *driver; /* which driver has allocated this |
270 | device */ | 280 | device */ |
@@ -273,9 +283,6 @@ struct device { | |||
273 | BIOS data relevant to device) */ | 283 | BIOS data relevant to device) */ |
274 | struct dev_pm_info power; | 284 | struct dev_pm_info power; |
275 | 285 | ||
276 | u32 detach_state; /* State to enter when device is | ||
277 | detached from its driver. */ | ||
278 | |||
279 | u64 *dma_mask; /* dma mask (if dma'able device) */ | 286 | u64 *dma_mask; /* dma mask (if dma'able device) */ |
280 | u64 coherent_dma_mask;/* Like dma_mask, but for | 287 | u64 coherent_dma_mask;/* Like dma_mask, but for |
281 | alloc_coherent mappings as | 288 | alloc_coherent mappings as |
@@ -291,12 +298,6 @@ struct device { | |||
291 | void (*release)(struct device * dev); | 298 | void (*release)(struct device * dev); |
292 | }; | 299 | }; |
293 | 300 | ||
294 | static inline struct device * | ||
295 | list_to_dev(struct list_head *node) | ||
296 | { | ||
297 | return list_entry(node, struct device, node); | ||
298 | } | ||
299 | |||
300 | static inline void * | 301 | static inline void * |
301 | dev_get_drvdata (struct device *dev) | 302 | dev_get_drvdata (struct device *dev) |
302 | { | 303 | { |
@@ -324,7 +325,6 @@ extern int device_for_each_child(struct device *, void *, | |||
324 | * Manual binding of a device to driver. See drivers/base/bus.c | 325 | * Manual binding of a device to driver. See drivers/base/bus.c |
325 | * for information on use. | 326 | * for information on use. |
326 | */ | 327 | */ |
327 | extern int driver_probe_device(struct device_driver * drv, struct device * dev); | ||
328 | extern void device_bind_driver(struct device * dev); | 328 | extern void device_bind_driver(struct device * dev); |
329 | extern void device_release_driver(struct device * dev); | 329 | extern void device_release_driver(struct device * dev); |
330 | extern int device_attach(struct device * dev); | 330 | extern int device_attach(struct device * dev); |
@@ -335,8 +335,10 @@ extern void driver_attach(struct device_driver * drv); | |||
335 | 335 | ||
336 | struct device_attribute { | 336 | struct device_attribute { |
337 | struct attribute attr; | 337 | struct attribute attr; |
338 | ssize_t (*show)(struct device * dev, char * buf); | 338 | ssize_t (*show)(struct device *dev, struct device_attribute *attr, |
339 | ssize_t (*store)(struct device * dev, const char * buf, size_t count); | 339 | char *buf); |
340 | ssize_t (*store)(struct device *dev, struct device_attribute *attr, | ||
341 | const char *buf, size_t count); | ||
340 | }; | 342 | }; |
341 | 343 | ||
342 | #define DEVICE_ATTR(_name,_mode,_show,_store) \ | 344 | #define DEVICE_ATTR(_name,_mode,_show,_store) \ |
@@ -363,13 +365,12 @@ extern int (*platform_notify_remove)(struct device * dev); | |||
363 | */ | 365 | */ |
364 | extern struct device * get_device(struct device * dev); | 366 | extern struct device * get_device(struct device * dev); |
365 | extern void put_device(struct device * dev); | 367 | extern void put_device(struct device * dev); |
366 | extern struct device *device_find(const char *name, struct bus_type *bus); | ||
367 | 368 | ||
368 | 369 | ||
369 | /* drivers/base/platform.c */ | 370 | /* drivers/base/platform.c */ |
370 | 371 | ||
371 | struct platform_device { | 372 | struct platform_device { |
372 | char * name; | 373 | const char * name; |
373 | u32 id; | 374 | u32 id; |
374 | struct device dev; | 375 | struct device dev; |
375 | u32 num_resources; | 376 | u32 num_resources; |
diff --git a/include/linux/dm9000.h b/include/linux/dm9000.h new file mode 100644 index 000000000000..0008e2ad0c9f --- /dev/null +++ b/include/linux/dm9000.h | |||
@@ -0,0 +1,36 @@ | |||
1 | /* include/linux/dm9000.h | ||
2 | * | ||
3 | * Copyright (c) 2004 Simtec Electronics | ||
4 | * Ben Dooks <ben@simtec.co.uk> | ||
5 | * | ||
6 | * Header file for dm9000 platform data | ||
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 | |||
14 | #ifndef __DM9000_PLATFORM_DATA | ||
15 | #define __DM9000_PLATFORM_DATA __FILE__ | ||
16 | |||
17 | /* IO control flags */ | ||
18 | |||
19 | #define DM9000_PLATF_8BITONLY (0x0001) | ||
20 | #define DM9000_PLATF_16BITONLY (0x0002) | ||
21 | #define DM9000_PLATF_32BITONLY (0x0004) | ||
22 | |||
23 | /* platfrom data for platfrom device structure's platfrom_data field */ | ||
24 | |||
25 | struct dm9000_plat_data { | ||
26 | unsigned int flags; | ||
27 | |||
28 | /* allow replacement IO routines */ | ||
29 | |||
30 | void (*inblk)(void __iomem *reg, void *data, int len); | ||
31 | void (*outblk)(void __iomem *reg, void *data, int len); | ||
32 | void (*dumpblk)(void __iomem *reg, int len); | ||
33 | }; | ||
34 | |||
35 | #endif /* __DM9000_PLATFORM_DATA */ | ||
36 | |||
diff --git a/include/linux/dma-mapping.h b/include/linux/dma-mapping.h index 806c305332c1..2d80cc761a15 100644 --- a/include/linux/dma-mapping.h +++ b/include/linux/dma-mapping.h | |||
@@ -14,7 +14,12 @@ enum dma_data_direction { | |||
14 | }; | 14 | }; |
15 | 15 | ||
16 | #define DMA_64BIT_MASK 0xffffffffffffffffULL | 16 | #define DMA_64BIT_MASK 0xffffffffffffffffULL |
17 | #define DMA_40BIT_MASK 0x000000ffffffffffULL | ||
18 | #define DMA_39BIT_MASK 0x0000007fffffffffULL | ||
17 | #define DMA_32BIT_MASK 0x00000000ffffffffULL | 19 | #define DMA_32BIT_MASK 0x00000000ffffffffULL |
20 | #define DMA_31BIT_MASK 0x000000007fffffffULL | ||
21 | #define DMA_30BIT_MASK 0x000000003fffffffULL | ||
22 | #define DMA_29BIT_MASK 0x000000001fffffffULL | ||
18 | 23 | ||
19 | #include <asm/dma-mapping.h> | 24 | #include <asm/dma-mapping.h> |
20 | 25 | ||
diff --git a/include/linux/err.h b/include/linux/err.h index 17c55df13615..ff71d2af5da3 100644 --- a/include/linux/err.h +++ b/include/linux/err.h | |||
@@ -13,6 +13,8 @@ | |||
13 | * This should be a per-architecture thing, to allow different | 13 | * This should be a per-architecture thing, to allow different |
14 | * error and pointer decisions. | 14 | * error and pointer decisions. |
15 | */ | 15 | */ |
16 | #define IS_ERR_VALUE(x) unlikely((x) > (unsigned long)-1000L) | ||
17 | |||
16 | static inline void *ERR_PTR(long error) | 18 | static inline void *ERR_PTR(long error) |
17 | { | 19 | { |
18 | return (void *) error; | 20 | return (void *) error; |
@@ -25,7 +27,7 @@ static inline long PTR_ERR(const void *ptr) | |||
25 | 27 | ||
26 | static inline long IS_ERR(const void *ptr) | 28 | static inline long IS_ERR(const void *ptr) |
27 | { | 29 | { |
28 | return unlikely((unsigned long)ptr > (unsigned long)-1000L); | 30 | return IS_ERR_VALUE((unsigned long)ptr); |
29 | } | 31 | } |
30 | 32 | ||
31 | #endif /* _LINUX_ERR_H */ | 33 | #endif /* _LINUX_ERR_H */ |
diff --git a/include/linux/etherdevice.h b/include/linux/etherdevice.h index 220748b7abea..a1478258d002 100644 --- a/include/linux/etherdevice.h +++ b/include/linux/etherdevice.h | |||
@@ -56,18 +56,32 @@ static inline int is_zero_ether_addr(const u8 *addr) | |||
56 | } | 56 | } |
57 | 57 | ||
58 | /** | 58 | /** |
59 | * is_multicast_ether_addr - Determine if the given Ethernet address is a | ||
60 | * multicast address. | ||
61 | * | ||
62 | * @addr: Pointer to a six-byte array containing the Ethernet address | ||
63 | * | ||
64 | * Return true if the address is a multicast address. | ||
65 | */ | ||
66 | static inline int is_multicast_ether_addr(const u8 *addr) | ||
67 | { | ||
68 | return addr[0] & 0x01; | ||
69 | } | ||
70 | |||
71 | /** | ||
59 | * is_valid_ether_addr - Determine if the given Ethernet address is valid | 72 | * is_valid_ether_addr - Determine if the given Ethernet address is valid |
60 | * @addr: Pointer to a six-byte array containing the Ethernet address | 73 | * @addr: Pointer to a six-byte array containing the Ethernet address |
61 | * | 74 | * |
62 | * Check that the Ethernet address (MAC) is not 00:00:00:00:00:00, is not | 75 | * Check that the Ethernet address (MAC) is not 00:00:00:00:00:00, is not |
63 | * a multicast address, and is not FF:FF:FF:FF:FF:FF. The multicast | 76 | * a multicast address, and is not FF:FF:FF:FF:FF:FF. |
64 | * and FF:FF:... tests are combined into the single test "!(addr[0]&1)". | ||
65 | * | 77 | * |
66 | * Return true if the address is valid. | 78 | * Return true if the address is valid. |
67 | */ | 79 | */ |
68 | static inline int is_valid_ether_addr(const u8 *addr) | 80 | static inline int is_valid_ether_addr(const u8 *addr) |
69 | { | 81 | { |
70 | return !(addr[0]&1) && !is_zero_ether_addr(addr); | 82 | /* FF:FF:FF:FF:FF:FF is a multicast address so we don't need to |
83 | * explicitly check for it here. */ | ||
84 | return !is_multicast_ether_addr(addr) && !is_zero_ether_addr(addr); | ||
71 | } | 85 | } |
72 | 86 | ||
73 | /** | 87 | /** |
@@ -83,6 +97,6 @@ static inline void random_ether_addr(u8 *addr) | |||
83 | addr [0] &= 0xfe; /* clear multicast bit */ | 97 | addr [0] &= 0xfe; /* clear multicast bit */ |
84 | addr [0] |= 0x02; /* set local assignment bit (IEEE802) */ | 98 | addr [0] |= 0x02; /* set local assignment bit (IEEE802) */ |
85 | } | 99 | } |
86 | #endif | 100 | #endif /* __KERNEL__ */ |
87 | 101 | ||
88 | #endif /* _LINUX_ETHERDEVICE_H */ | 102 | #endif /* _LINUX_ETHERDEVICE_H */ |
diff --git a/include/linux/ethtool.h b/include/linux/ethtool.h index c85b210490ea..a0ab26aab450 100644 --- a/include/linux/ethtool.h +++ b/include/linux/ethtool.h | |||
@@ -256,6 +256,7 @@ struct net_device; | |||
256 | u32 ethtool_op_get_link(struct net_device *dev); | 256 | u32 ethtool_op_get_link(struct net_device *dev); |
257 | u32 ethtool_op_get_tx_csum(struct net_device *dev); | 257 | u32 ethtool_op_get_tx_csum(struct net_device *dev); |
258 | int ethtool_op_set_tx_csum(struct net_device *dev, u32 data); | 258 | int ethtool_op_set_tx_csum(struct net_device *dev, u32 data); |
259 | int ethtool_op_set_tx_hw_csum(struct net_device *dev, u32 data); | ||
259 | u32 ethtool_op_get_sg(struct net_device *dev); | 260 | u32 ethtool_op_get_sg(struct net_device *dev); |
260 | int ethtool_op_set_sg(struct net_device *dev, u32 data); | 261 | int ethtool_op_set_sg(struct net_device *dev, u32 data); |
261 | u32 ethtool_op_get_tso(struct net_device *dev); | 262 | u32 ethtool_op_get_tso(struct net_device *dev); |
diff --git a/include/linux/fb.h b/include/linux/fb.h index b468bf496547..bc24beeed971 100644 --- a/include/linux/fb.h +++ b/include/linux/fb.h | |||
@@ -524,11 +524,11 @@ struct fb_pixmap { | |||
524 | u32 offset; /* current offset to buffer */ | 524 | u32 offset; /* current offset to buffer */ |
525 | u32 buf_align; /* byte alignment of each bitmap */ | 525 | u32 buf_align; /* byte alignment of each bitmap */ |
526 | u32 scan_align; /* alignment per scanline */ | 526 | u32 scan_align; /* alignment per scanline */ |
527 | u32 access_align; /* alignment per read/write */ | 527 | u32 access_align; /* alignment per read/write (bits) */ |
528 | u32 flags; /* see FB_PIXMAP_* */ | 528 | u32 flags; /* see FB_PIXMAP_* */ |
529 | /* access methods */ | 529 | /* access methods */ |
530 | void (*outbuf)(struct fb_info *info, u8 *addr, u8 *src, unsigned int size); | 530 | void (*writeio)(struct fb_info *info, void __iomem *dst, void *src, unsigned int size); |
531 | u8 (*inbuf) (struct fb_info *info, u8 *addr); | 531 | void (*readio) (struct fb_info *info, void *dst, void __iomem *src, unsigned int size); |
532 | }; | 532 | }; |
533 | 533 | ||
534 | 534 | ||
@@ -816,18 +816,9 @@ extern int unregister_framebuffer(struct fb_info *fb_info); | |||
816 | extern int fb_prepare_logo(struct fb_info *fb_info); | 816 | extern int fb_prepare_logo(struct fb_info *fb_info); |
817 | extern int fb_show_logo(struct fb_info *fb_info); | 817 | extern int fb_show_logo(struct fb_info *fb_info); |
818 | extern char* fb_get_buffer_offset(struct fb_info *info, struct fb_pixmap *buf, u32 size); | 818 | extern char* fb_get_buffer_offset(struct fb_info *info, struct fb_pixmap *buf, u32 size); |
819 | extern void fb_iomove_buf_unaligned(struct fb_info *info, struct fb_pixmap *buf, | 819 | extern void fb_pad_unaligned_buffer(u8 *dst, u32 d_pitch, u8 *src, u32 idx, |
820 | u8 *dst, u32 d_pitch, u8 *src, u32 idx, | ||
821 | u32 height, u32 shift_high, u32 shift_low, u32 mod); | 820 | u32 height, u32 shift_high, u32 shift_low, u32 mod); |
822 | extern void fb_iomove_buf_aligned(struct fb_info *info, struct fb_pixmap *buf, | 821 | extern void fb_pad_aligned_buffer(u8 *dst, u32 d_pitch, u8 *src, u32 s_pitch, u32 height); |
823 | u8 *dst, u32 d_pitch, u8 *src, u32 s_pitch, | ||
824 | u32 height); | ||
825 | extern void fb_sysmove_buf_unaligned(struct fb_info *info, struct fb_pixmap *buf, | ||
826 | u8 *dst, u32 d_pitch, u8 *src, u32 idx, | ||
827 | u32 height, u32 shift_high, u32 shift_low, u32 mod); | ||
828 | extern void fb_sysmove_buf_aligned(struct fb_info *info, struct fb_pixmap *buf, | ||
829 | u8 *dst, u32 d_pitch, u8 *src, u32 s_pitch, | ||
830 | u32 height); | ||
831 | extern void fb_set_suspend(struct fb_info *info, int state); | 822 | extern void fb_set_suspend(struct fb_info *info, int state); |
832 | extern int fb_get_color_depth(struct fb_var_screeninfo *var); | 823 | extern int fb_get_color_depth(struct fb_var_screeninfo *var); |
833 | extern int fb_get_options(char *name, char **option); | 824 | extern int fb_get_options(char *name, char **option); |
diff --git a/include/linux/font.h b/include/linux/font.h index fc2d690c9d5f..8fc80a7d78ac 100644 --- a/include/linux/font.h +++ b/include/linux/font.h | |||
@@ -25,19 +25,23 @@ struct font_desc { | |||
25 | #define VGA8x16_IDX 1 | 25 | #define VGA8x16_IDX 1 |
26 | #define PEARL8x8_IDX 2 | 26 | #define PEARL8x8_IDX 2 |
27 | #define VGA6x11_IDX 3 | 27 | #define VGA6x11_IDX 3 |
28 | #define SUN8x16_IDX 4 | 28 | #define FONT7x14_IDX 4 |
29 | #define SUN12x22_IDX 5 | 29 | #define FONT10x18_IDX 5 |
30 | #define ACORN8x8_IDX 6 | 30 | #define SUN8x16_IDX 6 |
31 | #define MINI4x6_IDX 7 | 31 | #define SUN12x22_IDX 7 |
32 | #define ACORN8x8_IDX 8 | ||
33 | #define MINI4x6_IDX 9 | ||
32 | 34 | ||
33 | extern struct font_desc font_vga_8x8, | 35 | extern struct font_desc font_vga_8x8, |
34 | font_vga_8x16, | 36 | font_vga_8x16, |
35 | font_pearl_8x8, | 37 | font_pearl_8x8, |
36 | font_vga_6x11, | 38 | font_vga_6x11, |
37 | font_sun_8x16, | 39 | font_7x14, |
38 | font_sun_12x22, | 40 | font_10x18, |
39 | font_acorn_8x8, | 41 | font_sun_8x16, |
40 | font_mini_4x6; | 42 | font_sun_12x22, |
43 | font_acorn_8x8, | ||
44 | font_mini_4x6; | ||
41 | 45 | ||
42 | /* Find a font with a specific name */ | 46 | /* Find a font with a specific name */ |
43 | 47 | ||
diff --git a/include/linux/fs.h b/include/linux/fs.h index 0180102dace1..9b8b696d4f15 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h | |||
@@ -1657,6 +1657,52 @@ static inline void simple_transaction_set(struct file *file, size_t n) | |||
1657 | ar->size = n; | 1657 | ar->size = n; |
1658 | } | 1658 | } |
1659 | 1659 | ||
1660 | /* | ||
1661 | * simple attribute files | ||
1662 | * | ||
1663 | * These attributes behave similar to those in sysfs: | ||
1664 | * | ||
1665 | * Writing to an attribute immediately sets a value, an open file can be | ||
1666 | * written to multiple times. | ||
1667 | * | ||
1668 | * Reading from an attribute creates a buffer from the value that might get | ||
1669 | * read with multiple read calls. When the attribute has been read | ||
1670 | * completely, no further read calls are possible until the file is opened | ||
1671 | * again. | ||
1672 | * | ||
1673 | * All attributes contain a text representation of a numeric value | ||
1674 | * that are accessed with the get() and set() functions. | ||
1675 | */ | ||
1676 | #define DEFINE_SIMPLE_ATTRIBUTE(__fops, __get, __set, __fmt) \ | ||
1677 | static int __fops ## _open(struct inode *inode, struct file *file) \ | ||
1678 | { \ | ||
1679 | __simple_attr_check_format(__fmt, 0ull); \ | ||
1680 | return simple_attr_open(inode, file, __get, __set, __fmt); \ | ||
1681 | } \ | ||
1682 | static struct file_operations __fops = { \ | ||
1683 | .owner = THIS_MODULE, \ | ||
1684 | .open = __fops ## _open, \ | ||
1685 | .release = simple_attr_close, \ | ||
1686 | .read = simple_attr_read, \ | ||
1687 | .write = simple_attr_write, \ | ||
1688 | }; | ||
1689 | |||
1690 | static inline void __attribute__((format(printf, 1, 2))) | ||
1691 | __simple_attr_check_format(const char *fmt, ...) | ||
1692 | { | ||
1693 | /* don't do anything, just let the compiler check the arguments; */ | ||
1694 | } | ||
1695 | |||
1696 | int simple_attr_open(struct inode *inode, struct file *file, | ||
1697 | u64 (*get)(void *), void (*set)(void *, u64), | ||
1698 | const char *fmt); | ||
1699 | int simple_attr_close(struct inode *inode, struct file *file); | ||
1700 | ssize_t simple_attr_read(struct file *file, char __user *buf, | ||
1701 | size_t len, loff_t *ppos); | ||
1702 | ssize_t simple_attr_write(struct file *file, const char __user *buf, | ||
1703 | size_t len, loff_t *ppos); | ||
1704 | |||
1705 | |||
1660 | #ifdef CONFIG_SECURITY | 1706 | #ifdef CONFIG_SECURITY |
1661 | static inline char *alloc_secdata(void) | 1707 | static inline char *alloc_secdata(void) |
1662 | { | 1708 | { |
diff --git a/include/linux/fsl_devices.h b/include/linux/fsl_devices.h index faaff4c64559..70f54af87b9f 100644 --- a/include/linux/fsl_devices.h +++ b/include/linux/fsl_devices.h | |||
@@ -51,6 +51,7 @@ struct gianfar_platform_data { | |||
51 | 51 | ||
52 | /* board specific information */ | 52 | /* board specific information */ |
53 | u32 board_flags; | 53 | u32 board_flags; |
54 | u32 phy_flags; | ||
54 | u32 phyid; | 55 | u32 phyid; |
55 | u32 interruptPHY; | 56 | u32 interruptPHY; |
56 | u8 mac_addr[6]; | 57 | u8 mac_addr[6]; |
@@ -61,9 +62,14 @@ struct gianfar_platform_data { | |||
61 | #define FSL_GIANFAR_DEV_HAS_COALESCE 0x00000002 | 62 | #define FSL_GIANFAR_DEV_HAS_COALESCE 0x00000002 |
62 | #define FSL_GIANFAR_DEV_HAS_RMON 0x00000004 | 63 | #define FSL_GIANFAR_DEV_HAS_RMON 0x00000004 |
63 | #define FSL_GIANFAR_DEV_HAS_MULTI_INTR 0x00000008 | 64 | #define FSL_GIANFAR_DEV_HAS_MULTI_INTR 0x00000008 |
65 | #define FSL_GIANFAR_DEV_HAS_CSUM 0x00000010 | ||
66 | #define FSL_GIANFAR_DEV_HAS_VLAN 0x00000020 | ||
67 | #define FSL_GIANFAR_DEV_HAS_EXTENDED_HASH 0x00000040 | ||
68 | #define FSL_GIANFAR_DEV_HAS_PADDING 0x00000080 | ||
64 | 69 | ||
65 | /* Flags in gianfar_platform_data */ | 70 | /* Flags in gianfar_platform_data */ |
66 | #define FSL_GIANFAR_BRD_HAS_PHY_INTR 0x00000001 /* if not set use a timer */ | 71 | #define FSL_GIANFAR_BRD_HAS_PHY_INTR 0x00000001 /* set or use a timer */ |
72 | #define FSL_GIANFAR_BRD_IS_REDUCED 0x00000002 /* Set if RGMII, RMII */ | ||
67 | 73 | ||
68 | struct fsl_i2c_platform_data { | 74 | struct fsl_i2c_platform_data { |
69 | /* device specific information */ | 75 | /* device specific information */ |
diff --git a/include/linux/gameport.h b/include/linux/gameport.h index b1272f822cfa..cd623eccdbea 100644 --- a/include/linux/gameport.h +++ b/include/linux/gameport.h | |||
@@ -67,6 +67,8 @@ int gameport_open(struct gameport *gameport, struct gameport_driver *drv, int mo | |||
67 | void gameport_close(struct gameport *gameport); | 67 | void gameport_close(struct gameport *gameport); |
68 | void gameport_rescan(struct gameport *gameport); | 68 | void gameport_rescan(struct gameport *gameport); |
69 | 69 | ||
70 | #if defined(CONFIG_GAMEPORT) || (defined(MODULE) && defined(CONFIG_GAMEPORT_MODULE)) | ||
71 | |||
70 | void __gameport_register_port(struct gameport *gameport, struct module *owner); | 72 | void __gameport_register_port(struct gameport *gameport, struct module *owner); |
71 | static inline void gameport_register_port(struct gameport *gameport) | 73 | static inline void gameport_register_port(struct gameport *gameport) |
72 | { | 74 | { |
@@ -75,6 +77,29 @@ static inline void gameport_register_port(struct gameport *gameport) | |||
75 | 77 | ||
76 | void gameport_unregister_port(struct gameport *gameport); | 78 | void gameport_unregister_port(struct gameport *gameport); |
77 | 79 | ||
80 | void gameport_set_phys(struct gameport *gameport, const char *fmt, ...) | ||
81 | __attribute__ ((format (printf, 2, 3))); | ||
82 | |||
83 | #else | ||
84 | |||
85 | static inline void gameport_register_port(struct gameport *gameport) | ||
86 | { | ||
87 | return; | ||
88 | } | ||
89 | |||
90 | static inline void gameport_unregister_port(struct gameport *gameport) | ||
91 | { | ||
92 | return; | ||
93 | } | ||
94 | |||
95 | static inline void gameport_set_phys(struct gameport *gameport, | ||
96 | const char *fmt, ...) | ||
97 | { | ||
98 | return; | ||
99 | } | ||
100 | |||
101 | #endif | ||
102 | |||
78 | static inline struct gameport *gameport_allocate_port(void) | 103 | static inline struct gameport *gameport_allocate_port(void) |
79 | { | 104 | { |
80 | struct gameport *gameport = kcalloc(1, sizeof(struct gameport), GFP_KERNEL); | 105 | struct gameport *gameport = kcalloc(1, sizeof(struct gameport), GFP_KERNEL); |
@@ -92,9 +117,6 @@ static inline void gameport_set_name(struct gameport *gameport, const char *name | |||
92 | strlcpy(gameport->name, name, sizeof(gameport->name)); | 117 | strlcpy(gameport->name, name, sizeof(gameport->name)); |
93 | } | 118 | } |
94 | 119 | ||
95 | void gameport_set_phys(struct gameport *gameport, const char *fmt, ...) | ||
96 | __attribute__ ((format (printf, 2, 3))); | ||
97 | |||
98 | /* | 120 | /* |
99 | * Use the following fucntions to manipulate gameport's per-port | 121 | * Use the following fucntions to manipulate gameport's per-port |
100 | * driver-specific data. | 122 | * driver-specific data. |
diff --git a/include/linux/genalloc.h b/include/linux/genalloc.h new file mode 100644 index 000000000000..7fd0576a4454 --- /dev/null +++ b/include/linux/genalloc.h | |||
@@ -0,0 +1,40 @@ | |||
1 | /* | ||
2 | * Basic general purpose allocator for managing special purpose memory | ||
3 | * not managed by the regular kmalloc/kfree interface. | ||
4 | * Uses for this includes on-device special memory, uncached memory | ||
5 | * etc. | ||
6 | * | ||
7 | * This code is based on the buddy allocator found in the sym53c8xx_2 | ||
8 | * driver, adapted for general purpose use. | ||
9 | * | ||
10 | * This source code is licensed under the GNU General Public License, | ||
11 | * Version 2. See the file COPYING for more details. | ||
12 | */ | ||
13 | |||
14 | #include <linux/spinlock.h> | ||
15 | |||
16 | #define ALLOC_MIN_SHIFT 5 /* 32 bytes minimum */ | ||
17 | /* | ||
18 | * Link between free memory chunks of a given size. | ||
19 | */ | ||
20 | struct gen_pool_link { | ||
21 | struct gen_pool_link *next; | ||
22 | }; | ||
23 | |||
24 | /* | ||
25 | * Memory pool descriptor. | ||
26 | */ | ||
27 | struct gen_pool { | ||
28 | spinlock_t lock; | ||
29 | unsigned long (*get_new_chunk)(struct gen_pool *); | ||
30 | struct gen_pool *next; | ||
31 | struct gen_pool_link *h; | ||
32 | unsigned long private; | ||
33 | int max_chunk_shift; | ||
34 | }; | ||
35 | |||
36 | unsigned long gen_pool_alloc(struct gen_pool *poolp, int size); | ||
37 | void gen_pool_free(struct gen_pool *mp, unsigned long ptr, int size); | ||
38 | struct gen_pool *gen_pool_create(int nr_chunks, int max_chunk_shift, | ||
39 | unsigned long (*fp)(struct gen_pool *), | ||
40 | unsigned long data); | ||
diff --git a/include/linux/gfp.h b/include/linux/gfp.h index af7407e8cfc5..8d6bf608b199 100644 --- a/include/linux/gfp.h +++ b/include/linux/gfp.h | |||
@@ -39,6 +39,7 @@ struct vm_area_struct; | |||
39 | #define __GFP_COMP 0x4000u /* Add compound page metadata */ | 39 | #define __GFP_COMP 0x4000u /* Add compound page metadata */ |
40 | #define __GFP_ZERO 0x8000u /* Return zeroed page on success */ | 40 | #define __GFP_ZERO 0x8000u /* Return zeroed page on success */ |
41 | #define __GFP_NOMEMALLOC 0x10000u /* Don't use emergency reserves */ | 41 | #define __GFP_NOMEMALLOC 0x10000u /* Don't use emergency reserves */ |
42 | #define __GFP_NORECLAIM 0x20000u /* No realy zone reclaim during allocation */ | ||
42 | 43 | ||
43 | #define __GFP_BITS_SHIFT 20 /* Room for 20 __GFP_FOO bits */ | 44 | #define __GFP_BITS_SHIFT 20 /* Room for 20 __GFP_FOO bits */ |
44 | #define __GFP_BITS_MASK ((1 << __GFP_BITS_SHIFT) - 1) | 45 | #define __GFP_BITS_MASK ((1 << __GFP_BITS_SHIFT) - 1) |
@@ -47,7 +48,7 @@ struct vm_area_struct; | |||
47 | #define GFP_LEVEL_MASK (__GFP_WAIT|__GFP_HIGH|__GFP_IO|__GFP_FS| \ | 48 | #define GFP_LEVEL_MASK (__GFP_WAIT|__GFP_HIGH|__GFP_IO|__GFP_FS| \ |
48 | __GFP_COLD|__GFP_NOWARN|__GFP_REPEAT| \ | 49 | __GFP_COLD|__GFP_NOWARN|__GFP_REPEAT| \ |
49 | __GFP_NOFAIL|__GFP_NORETRY|__GFP_NO_GROW|__GFP_COMP| \ | 50 | __GFP_NOFAIL|__GFP_NORETRY|__GFP_NO_GROW|__GFP_COMP| \ |
50 | __GFP_NOMEMALLOC) | 51 | __GFP_NOMEMALLOC|__GFP_NORECLAIM) |
51 | 52 | ||
52 | #define GFP_ATOMIC (__GFP_HIGH) | 53 | #define GFP_ATOMIC (__GFP_HIGH) |
53 | #define GFP_NOIO (__GFP_WAIT) | 54 | #define GFP_NOIO (__GFP_WAIT) |
@@ -132,5 +133,10 @@ extern void FASTCALL(free_cold_page(struct page *page)); | |||
132 | #define free_page(addr) free_pages((addr),0) | 133 | #define free_page(addr) free_pages((addr),0) |
133 | 134 | ||
134 | void page_alloc_init(void); | 135 | void page_alloc_init(void); |
136 | #ifdef CONFIG_NUMA | ||
137 | void drain_remote_pages(void); | ||
138 | #else | ||
139 | static inline void drain_remote_pages(void) { }; | ||
140 | #endif | ||
135 | 141 | ||
136 | #endif /* __LINUX_GFP_H */ | 142 | #endif /* __LINUX_GFP_H */ |
diff --git a/include/linux/hardirq.h b/include/linux/hardirq.h index ebc712e91066..8336dba18971 100644 --- a/include/linux/hardirq.h +++ b/include/linux/hardirq.h | |||
@@ -43,13 +43,17 @@ | |||
43 | #define __IRQ_MASK(x) ((1UL << (x))-1) | 43 | #define __IRQ_MASK(x) ((1UL << (x))-1) |
44 | 44 | ||
45 | #define PREEMPT_MASK (__IRQ_MASK(PREEMPT_BITS) << PREEMPT_SHIFT) | 45 | #define PREEMPT_MASK (__IRQ_MASK(PREEMPT_BITS) << PREEMPT_SHIFT) |
46 | #define HARDIRQ_MASK (__IRQ_MASK(HARDIRQ_BITS) << HARDIRQ_SHIFT) | ||
47 | #define SOFTIRQ_MASK (__IRQ_MASK(SOFTIRQ_BITS) << SOFTIRQ_SHIFT) | 46 | #define SOFTIRQ_MASK (__IRQ_MASK(SOFTIRQ_BITS) << SOFTIRQ_SHIFT) |
47 | #define HARDIRQ_MASK (__IRQ_MASK(HARDIRQ_BITS) << HARDIRQ_SHIFT) | ||
48 | 48 | ||
49 | #define PREEMPT_OFFSET (1UL << PREEMPT_SHIFT) | 49 | #define PREEMPT_OFFSET (1UL << PREEMPT_SHIFT) |
50 | #define SOFTIRQ_OFFSET (1UL << SOFTIRQ_SHIFT) | 50 | #define SOFTIRQ_OFFSET (1UL << SOFTIRQ_SHIFT) |
51 | #define HARDIRQ_OFFSET (1UL << HARDIRQ_SHIFT) | 51 | #define HARDIRQ_OFFSET (1UL << HARDIRQ_SHIFT) |
52 | 52 | ||
53 | #if PREEMPT_ACTIVE < (1 << (HARDIRQ_SHIFT + HARDIRQ_BITS)) | ||
54 | #error PREEMPT_ACTIVE is too low! | ||
55 | #endif | ||
56 | |||
53 | #define hardirq_count() (preempt_count() & HARDIRQ_MASK) | 57 | #define hardirq_count() (preempt_count() & HARDIRQ_MASK) |
54 | #define softirq_count() (preempt_count() & SOFTIRQ_MASK) | 58 | #define softirq_count() (preempt_count() & SOFTIRQ_MASK) |
55 | #define irq_count() (preempt_count() & (HARDIRQ_MASK | SOFTIRQ_MASK)) | 59 | #define irq_count() (preempt_count() & (HARDIRQ_MASK | SOFTIRQ_MASK)) |
diff --git a/include/linux/hdlc.h b/include/linux/hdlc.h index 503194e62fe1..ed2927ef1ff7 100644 --- a/include/linux/hdlc.h +++ b/include/linux/hdlc.h | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * Generic HDLC support routines for Linux | 2 | * Generic HDLC support routines for Linux |
3 | * | 3 | * |
4 | * Copyright (C) 1999-2003 Krzysztof Halasa <khc@pm.waw.pl> | 4 | * Copyright (C) 1999-2005 Krzysztof Halasa <khc@pm.waw.pl> |
5 | * | 5 | * |
6 | * This program is free software; you can redistribute it and/or modify it | 6 | * This program is free software; you can redistribute it and/or modify it |
7 | * under the terms of version 2 of the GNU General Public License | 7 | * under the terms of version 2 of the GNU General Public License |
@@ -41,6 +41,7 @@ | |||
41 | #define LMI_NONE 1 /* No LMI, all PVCs are static */ | 41 | #define LMI_NONE 1 /* No LMI, all PVCs are static */ |
42 | #define LMI_ANSI 2 /* ANSI Annex D */ | 42 | #define LMI_ANSI 2 /* ANSI Annex D */ |
43 | #define LMI_CCITT 3 /* ITU-T Annex A */ | 43 | #define LMI_CCITT 3 /* ITU-T Annex A */ |
44 | #define LMI_CISCO 4 /* The "original" LMI, aka Gang of Four */ | ||
44 | 45 | ||
45 | #define HDLC_MAX_MTU 1500 /* Ethernet 1500 bytes */ | 46 | #define HDLC_MAX_MTU 1500 /* Ethernet 1500 bytes */ |
46 | #define HDLC_MAX_MRU (HDLC_MAX_MTU + 10 + 14 + 4) /* for ETH+VLAN over FR */ | 47 | #define HDLC_MAX_MRU (HDLC_MAX_MTU + 10 + 14 + 4) /* for ETH+VLAN over FR */ |
@@ -89,6 +90,7 @@ typedef struct pvc_device_struct { | |||
89 | unsigned int deleted: 1; | 90 | unsigned int deleted: 1; |
90 | unsigned int fecn: 1; | 91 | unsigned int fecn: 1; |
91 | unsigned int becn: 1; | 92 | unsigned int becn: 1; |
93 | unsigned int bandwidth; /* Cisco LMI reporting only */ | ||
92 | }state; | 94 | }state; |
93 | }pvc_device; | 95 | }pvc_device; |
94 | 96 | ||
diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h index 6af1ae4a8211..f529d1442815 100644 --- a/include/linux/hugetlb.h +++ b/include/linux/hugetlb.h | |||
@@ -4,6 +4,7 @@ | |||
4 | #ifdef CONFIG_HUGETLB_PAGE | 4 | #ifdef CONFIG_HUGETLB_PAGE |
5 | 5 | ||
6 | #include <linux/mempolicy.h> | 6 | #include <linux/mempolicy.h> |
7 | #include <asm/tlbflush.h> | ||
7 | 8 | ||
8 | struct ctl_table; | 9 | struct ctl_table; |
9 | 10 | ||
@@ -22,12 +23,6 @@ int hugetlb_report_meminfo(char *); | |||
22 | int hugetlb_report_node_meminfo(int, char *); | 23 | int hugetlb_report_node_meminfo(int, char *); |
23 | int is_hugepage_mem_enough(size_t); | 24 | int is_hugepage_mem_enough(size_t); |
24 | unsigned long hugetlb_total_pages(void); | 25 | unsigned long hugetlb_total_pages(void); |
25 | struct page *follow_huge_addr(struct mm_struct *mm, unsigned long address, | ||
26 | int write); | ||
27 | struct page *follow_huge_pmd(struct mm_struct *mm, unsigned long address, | ||
28 | pmd_t *pmd, int write); | ||
29 | int is_aligned_hugepage_range(unsigned long addr, unsigned long len); | ||
30 | int pmd_huge(pmd_t pmd); | ||
31 | struct page *alloc_huge_page(void); | 26 | struct page *alloc_huge_page(void); |
32 | void free_huge_page(struct page *); | 27 | void free_huge_page(struct page *); |
33 | 28 | ||
@@ -35,6 +30,17 @@ extern unsigned long max_huge_pages; | |||
35 | extern const unsigned long hugetlb_zero, hugetlb_infinity; | 30 | extern const unsigned long hugetlb_zero, hugetlb_infinity; |
36 | extern int sysctl_hugetlb_shm_group; | 31 | extern int sysctl_hugetlb_shm_group; |
37 | 32 | ||
33 | /* arch callbacks */ | ||
34 | |||
35 | pte_t *huge_pte_alloc(struct mm_struct *mm, unsigned long addr); | ||
36 | pte_t *huge_pte_offset(struct mm_struct *mm, unsigned long addr); | ||
37 | struct page *follow_huge_addr(struct mm_struct *mm, unsigned long address, | ||
38 | int write); | ||
39 | struct page *follow_huge_pmd(struct mm_struct *mm, unsigned long address, | ||
40 | pmd_t *pmd, int write); | ||
41 | int is_aligned_hugepage_range(unsigned long addr, unsigned long len); | ||
42 | int pmd_huge(pmd_t pmd); | ||
43 | |||
38 | #ifndef ARCH_HAS_HUGEPAGE_ONLY_RANGE | 44 | #ifndef ARCH_HAS_HUGEPAGE_ONLY_RANGE |
39 | #define is_hugepage_only_range(mm, addr, len) 0 | 45 | #define is_hugepage_only_range(mm, addr, len) 0 |
40 | #define hugetlb_free_pgd_range(tlb, addr, end, floor, ceiling) \ | 46 | #define hugetlb_free_pgd_range(tlb, addr, end, floor, ceiling) \ |
@@ -48,6 +54,28 @@ extern int sysctl_hugetlb_shm_group; | |||
48 | int prepare_hugepage_range(unsigned long addr, unsigned long len); | 54 | int prepare_hugepage_range(unsigned long addr, unsigned long len); |
49 | #endif | 55 | #endif |
50 | 56 | ||
57 | #ifndef ARCH_HAS_SETCLEAR_HUGE_PTE | ||
58 | #define set_huge_pte_at(mm, addr, ptep, pte) set_pte_at(mm, addr, ptep, pte) | ||
59 | #define huge_ptep_get_and_clear(mm, addr, ptep) ptep_get_and_clear(mm, addr, ptep) | ||
60 | #else | ||
61 | void set_huge_pte_at(struct mm_struct *mm, unsigned long addr, | ||
62 | pte_t *ptep, pte_t pte); | ||
63 | pte_t huge_ptep_get_and_clear(struct mm_struct *mm, unsigned long addr, | ||
64 | pte_t *ptep); | ||
65 | #endif | ||
66 | |||
67 | #ifndef ARCH_HAS_HUGETLB_PREFAULT_HOOK | ||
68 | #define hugetlb_prefault_arch_hook(mm) do { } while (0) | ||
69 | #else | ||
70 | void hugetlb_prefault_arch_hook(struct mm_struct *mm); | ||
71 | #endif | ||
72 | |||
73 | #ifndef ARCH_HAS_HUGETLB_CLEAN_STALE_PGTABLE | ||
74 | #define hugetlb_clean_stale_pgtable(pte) BUG() | ||
75 | #else | ||
76 | void hugetlb_clean_stale_pgtable(pte_t *pte); | ||
77 | #endif | ||
78 | |||
51 | #else /* !CONFIG_HUGETLB_PAGE */ | 79 | #else /* !CONFIG_HUGETLB_PAGE */ |
52 | 80 | ||
53 | static inline int is_vm_hugetlb_page(struct vm_area_struct *vma) | 81 | static inline int is_vm_hugetlb_page(struct vm_area_struct *vma) |
diff --git a/include/linux/i2c-sysfs.h b/include/linux/i2c-sysfs.h new file mode 100644 index 000000000000..d7bf6ce11679 --- /dev/null +++ b/include/linux/i2c-sysfs.h | |||
@@ -0,0 +1,36 @@ | |||
1 | /* | ||
2 | * i2c-sysfs.h - i2c chip driver sysfs defines | ||
3 | * | ||
4 | * Copyright (C) 2005 Yani Ioannou <yani.ioannou@gmail.com> | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU General Public License as published by | ||
8 | * the Free Software Foundation; either version 2 of the License, or | ||
9 | * (at your option) any later version. | ||
10 | * | ||
11 | * This program is distributed in the hope that it will be useful, | ||
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
14 | * GNU General Public License for more details. | ||
15 | * | ||
16 | * You should have received a copy of the GNU General Public License | ||
17 | * along with this program; if not, write to the Free Software | ||
18 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | ||
19 | */ | ||
20 | #ifndef _LINUX_I2C_SYSFS_H | ||
21 | #define _LINUX_I2C_SYSFS_H | ||
22 | |||
23 | struct sensor_device_attribute{ | ||
24 | struct device_attribute dev_attr; | ||
25 | int index; | ||
26 | }; | ||
27 | #define to_sensor_dev_attr(_dev_attr) \ | ||
28 | container_of(_dev_attr, struct sensor_device_attribute, dev_attr) | ||
29 | |||
30 | #define SENSOR_DEVICE_ATTR(_name,_mode,_show,_store,_index) \ | ||
31 | struct sensor_device_attribute sensor_dev_attr_##_name = { \ | ||
32 | .dev_attr = __ATTR(_name,_mode,_show,_store), \ | ||
33 | .index = _index, \ | ||
34 | } | ||
35 | |||
36 | #endif /* _LINUX_I2C_SYSFS_H */ | ||
diff --git a/include/linux/ide.h b/include/linux/ide.h index 9cfc0999becb..336d6e509f59 100644 --- a/include/linux/ide.h +++ b/include/linux/ide.h | |||
@@ -664,7 +664,6 @@ typedef struct ide_drive_s { | |||
664 | 664 | ||
665 | struct request *rq; /* current request */ | 665 | struct request *rq; /* current request */ |
666 | struct ide_drive_s *next; /* circular list of hwgroup drives */ | 666 | struct ide_drive_s *next; /* circular list of hwgroup drives */ |
667 | struct ide_driver_s *driver;/* (ide_driver_t *) */ | ||
668 | void *driver_data; /* extra driver data */ | 667 | void *driver_data; /* extra driver data */ |
669 | struct hd_driveid *id; /* drive model identification info */ | 668 | struct hd_driveid *id; /* drive model identification info */ |
670 | struct proc_dir_entry *proc; /* /proc/ide/ directory entry */ | 669 | struct proc_dir_entry *proc; /* /proc/ide/ directory entry */ |
@@ -758,6 +757,8 @@ typedef struct ide_drive_s { | |||
758 | struct semaphore gendev_rel_sem; /* to deal with device release() */ | 757 | struct semaphore gendev_rel_sem; /* to deal with device release() */ |
759 | } ide_drive_t; | 758 | } ide_drive_t; |
760 | 759 | ||
760 | #define to_ide_device(dev)container_of(dev, ide_drive_t, gendev) | ||
761 | |||
761 | #define IDE_CHIPSET_PCI_MASK \ | 762 | #define IDE_CHIPSET_PCI_MASK \ |
762 | ((1<<ide_pci)|(1<<ide_cmd646)|(1<<ide_ali14xx)) | 763 | ((1<<ide_pci)|(1<<ide_cmd646)|(1<<ide_ali14xx)) |
763 | #define IDE_CHIPSET_IS_PCI(c) ((IDE_CHIPSET_PCI_MASK >> (c)) & 1) | 764 | #define IDE_CHIPSET_IS_PCI(c) ((IDE_CHIPSET_PCI_MASK >> (c)) & 1) |
@@ -1086,28 +1087,20 @@ enum { | |||
1086 | */ | 1087 | */ |
1087 | typedef struct ide_driver_s { | 1088 | typedef struct ide_driver_s { |
1088 | struct module *owner; | 1089 | struct module *owner; |
1089 | const char *name; | ||
1090 | const char *version; | 1090 | const char *version; |
1091 | u8 media; | 1091 | u8 media; |
1092 | unsigned busy : 1; | ||
1093 | unsigned supports_dsc_overlap : 1; | 1092 | unsigned supports_dsc_overlap : 1; |
1094 | int (*cleanup)(ide_drive_t *); | ||
1095 | ide_startstop_t (*do_request)(ide_drive_t *, struct request *, sector_t); | 1093 | ide_startstop_t (*do_request)(ide_drive_t *, struct request *, sector_t); |
1096 | int (*end_request)(ide_drive_t *, int, int); | 1094 | int (*end_request)(ide_drive_t *, int, int); |
1097 | ide_startstop_t (*error)(ide_drive_t *, struct request *rq, u8, u8); | 1095 | ide_startstop_t (*error)(ide_drive_t *, struct request *rq, u8, u8); |
1098 | ide_startstop_t (*abort)(ide_drive_t *, struct request *rq); | 1096 | ide_startstop_t (*abort)(ide_drive_t *, struct request *rq); |
1099 | int (*ioctl)(ide_drive_t *, struct inode *, struct file *, unsigned int, unsigned long); | 1097 | int (*ioctl)(ide_drive_t *, struct inode *, struct file *, unsigned int, unsigned long); |
1100 | ide_proc_entry_t *proc; | 1098 | ide_proc_entry_t *proc; |
1101 | int (*attach)(ide_drive_t *); | ||
1102 | void (*ata_prebuilder)(ide_drive_t *); | 1099 | void (*ata_prebuilder)(ide_drive_t *); |
1103 | void (*atapi_prebuilder)(ide_drive_t *); | 1100 | void (*atapi_prebuilder)(ide_drive_t *); |
1104 | struct device_driver gen_driver; | 1101 | struct device_driver gen_driver; |
1105 | struct list_head drives; | ||
1106 | struct list_head drivers; | ||
1107 | } ide_driver_t; | 1102 | } ide_driver_t; |
1108 | 1103 | ||
1109 | #define DRIVER(drive) ((drive)->driver) | ||
1110 | |||
1111 | int generic_ide_ioctl(ide_drive_t *, struct file *, struct block_device *, unsigned, unsigned long); | 1104 | int generic_ide_ioctl(ide_drive_t *, struct file *, struct block_device *, unsigned, unsigned long); |
1112 | 1105 | ||
1113 | /* | 1106 | /* |
@@ -1328,8 +1321,6 @@ extern void ide_init_subdrivers(void); | |||
1328 | 1321 | ||
1329 | void ide_init_disk(struct gendisk *, ide_drive_t *); | 1322 | void ide_init_disk(struct gendisk *, ide_drive_t *); |
1330 | 1323 | ||
1331 | extern int ata_attach(ide_drive_t *); | ||
1332 | |||
1333 | extern int ideprobe_init(void); | 1324 | extern int ideprobe_init(void); |
1334 | 1325 | ||
1335 | extern void ide_scan_pcibus(int scan_direction) __init; | 1326 | extern void ide_scan_pcibus(int scan_direction) __init; |
@@ -1342,11 +1333,8 @@ extern void default_hwif_iops(ide_hwif_t *); | |||
1342 | extern void default_hwif_mmiops(ide_hwif_t *); | 1333 | extern void default_hwif_mmiops(ide_hwif_t *); |
1343 | extern void default_hwif_transport(ide_hwif_t *); | 1334 | extern void default_hwif_transport(ide_hwif_t *); |
1344 | 1335 | ||
1345 | int ide_register_driver(ide_driver_t *driver); | 1336 | void ide_register_subdriver(ide_drive_t *, ide_driver_t *); |
1346 | void ide_unregister_driver(ide_driver_t *driver); | 1337 | void ide_unregister_subdriver(ide_drive_t *, ide_driver_t *); |
1347 | int ide_register_subdriver(ide_drive_t *, ide_driver_t *); | ||
1348 | int ide_unregister_subdriver (ide_drive_t *drive); | ||
1349 | int ide_replace_subdriver(ide_drive_t *drive, const char *driver); | ||
1350 | 1338 | ||
1351 | #define ON_BOARD 1 | 1339 | #define ON_BOARD 1 |
1352 | #define NEVER_BOARD 0 | 1340 | #define NEVER_BOARD 0 |
diff --git a/include/linux/if.h b/include/linux/if.h index d73a9d62f208..ce627d9092ef 100644 --- a/include/linux/if.h +++ b/include/linux/if.h | |||
@@ -33,7 +33,7 @@ | |||
33 | #define IFF_LOOPBACK 0x8 /* is a loopback net */ | 33 | #define IFF_LOOPBACK 0x8 /* is a loopback net */ |
34 | #define IFF_POINTOPOINT 0x10 /* interface is has p-p link */ | 34 | #define IFF_POINTOPOINT 0x10 /* interface is has p-p link */ |
35 | #define IFF_NOTRAILERS 0x20 /* avoid use of trailers */ | 35 | #define IFF_NOTRAILERS 0x20 /* avoid use of trailers */ |
36 | #define IFF_RUNNING 0x40 /* resources allocated */ | 36 | #define IFF_RUNNING 0x40 /* interface running and carrier ok */ |
37 | #define IFF_NOARP 0x80 /* no ARP protocol */ | 37 | #define IFF_NOARP 0x80 /* no ARP protocol */ |
38 | #define IFF_PROMISC 0x100 /* receive all packets */ | 38 | #define IFF_PROMISC 0x100 /* receive all packets */ |
39 | #define IFF_ALLMULTI 0x200 /* receive all multicast packets*/ | 39 | #define IFF_ALLMULTI 0x200 /* receive all multicast packets*/ |
diff --git a/include/linux/if_shaper.h b/include/linux/if_shaper.h index 0485b256d043..004e6f09a6e2 100644 --- a/include/linux/if_shaper.h +++ b/include/linux/if_shaper.h | |||
@@ -23,7 +23,7 @@ struct shaper | |||
23 | __u32 shapeclock; | 23 | __u32 shapeclock; |
24 | unsigned long recovery; /* Time we can next clock a packet out on | 24 | unsigned long recovery; /* Time we can next clock a packet out on |
25 | an empty queue */ | 25 | an empty queue */ |
26 | unsigned long locked; | 26 | struct semaphore sem; |
27 | struct net_device_stats stats; | 27 | struct net_device_stats stats; |
28 | struct net_device *dev; | 28 | struct net_device *dev; |
29 | int (*hard_start_xmit) (struct sk_buff *skb, | 29 | int (*hard_start_xmit) (struct sk_buff *skb, |
@@ -38,7 +38,6 @@ struct shaper | |||
38 | int (*hard_header_cache)(struct neighbour *neigh, struct hh_cache *hh); | 38 | int (*hard_header_cache)(struct neighbour *neigh, struct hh_cache *hh); |
39 | void (*header_cache_update)(struct hh_cache *hh, struct net_device *dev, unsigned char * haddr); | 39 | void (*header_cache_update)(struct hh_cache *hh, struct net_device *dev, unsigned char * haddr); |
40 | struct net_device_stats* (*get_stats)(struct net_device *dev); | 40 | struct net_device_stats* (*get_stats)(struct net_device *dev); |
41 | wait_queue_head_t wait_queue; | ||
42 | struct timer_list timer; | 41 | struct timer_list timer; |
43 | }; | 42 | }; |
44 | 43 | ||
diff --git a/include/linux/if_tr.h b/include/linux/if_tr.h index 4fd451f81ccb..3fba9e2f5427 100644 --- a/include/linux/if_tr.h +++ b/include/linux/if_tr.h | |||
@@ -9,7 +9,7 @@ | |||
9 | * | 9 | * |
10 | * Author: Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG> | 10 | * Author: Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG> |
11 | * Donald Becker, <becker@super.org> | 11 | * Donald Becker, <becker@super.org> |
12 | * Peter De Schrijver, <stud11@cc4.kuleuven.ac.be> | 12 | * Peter De Schrijver, <stud11@cc4.kuleuven.ac.be> |
13 | * | 13 | * |
14 | * This program is free software; you can redistribute it and/or | 14 | * This program is free software; you can redistribute it and/or |
15 | * modify it under the terms of the GNU General Public License | 15 | * modify it under the terms of the GNU General Public License |
@@ -19,24 +19,18 @@ | |||
19 | #ifndef _LINUX_IF_TR_H | 19 | #ifndef _LINUX_IF_TR_H |
20 | #define _LINUX_IF_TR_H | 20 | #define _LINUX_IF_TR_H |
21 | 21 | ||
22 | #include <asm/byteorder.h> /* For __be16 */ | ||
22 | 23 | ||
23 | /* IEEE 802.5 Token-Ring magic constants. The frame sizes omit the preamble | 24 | /* IEEE 802.5 Token-Ring magic constants. The frame sizes omit the preamble |
24 | and FCS/CRC (frame check sequence). */ | 25 | and FCS/CRC (frame check sequence). */ |
25 | #define TR_ALEN 6 /* Octets in one ethernet addr */ | 26 | #define TR_ALEN 6 /* Octets in one token-ring addr */ |
26 | #define TR_HLEN (sizeof(struct trh_hdr)+sizeof(struct trllc)) | 27 | #define TR_HLEN (sizeof(struct trh_hdr)+sizeof(struct trllc)) |
27 | #define AC 0x10 | 28 | #define AC 0x10 |
28 | #define LLC_FRAME 0x40 | 29 | #define LLC_FRAME 0x40 |
29 | #if 0 | ||
30 | #define ETH_HLEN 14 /* Total octets in header. */ | ||
31 | #define ETH_ZLEN 60 /* Min. octets in frame sans FCS */ | ||
32 | #define ETH_DATA_LEN 1500 /* Max. octets in payload */ | ||
33 | #define ETH_FRAME_LEN 1514 /* Max. octets in frame sans FCS */ | ||
34 | #endif | ||
35 | |||
36 | 30 | ||
37 | /* LLC and SNAP constants */ | 31 | /* LLC and SNAP constants */ |
38 | #define EXTENDED_SAP 0xAA | 32 | #define EXTENDED_SAP 0xAA |
39 | #define UI_CMD 0x03 | 33 | #define UI_CMD 0x03 |
40 | 34 | ||
41 | /* This is an Token-Ring frame header. */ | 35 | /* This is an Token-Ring frame header. */ |
42 | struct trh_hdr { | 36 | struct trh_hdr { |
@@ -44,8 +38,8 @@ struct trh_hdr { | |||
44 | __u8 fc; /* frame control field */ | 38 | __u8 fc; /* frame control field */ |
45 | __u8 daddr[TR_ALEN]; /* destination address */ | 39 | __u8 daddr[TR_ALEN]; /* destination address */ |
46 | __u8 saddr[TR_ALEN]; /* source address */ | 40 | __u8 saddr[TR_ALEN]; /* source address */ |
47 | __u16 rcf; /* route control field */ | 41 | __be16 rcf; /* route control field */ |
48 | __u16 rseg[8]; /* routing registers */ | 42 | __be16 rseg[8]; /* routing registers */ |
49 | }; | 43 | }; |
50 | 44 | ||
51 | #ifdef __KERNEL__ | 45 | #ifdef __KERNEL__ |
@@ -63,7 +57,7 @@ struct trllc { | |||
63 | __u8 ssap; /* source SAP */ | 57 | __u8 ssap; /* source SAP */ |
64 | __u8 llc; /* LLC control field */ | 58 | __u8 llc; /* LLC control field */ |
65 | __u8 protid[3]; /* protocol id */ | 59 | __u8 protid[3]; /* protocol id */ |
66 | __u16 ethertype; /* ether type field */ | 60 | __be16 ethertype; /* ether type field */ |
67 | }; | 61 | }; |
68 | 62 | ||
69 | /* Token-Ring statistics collection data. */ | 63 | /* Token-Ring statistics collection data. */ |
@@ -96,14 +90,13 @@ struct tr_statistics { | |||
96 | }; | 90 | }; |
97 | 91 | ||
98 | /* source routing stuff */ | 92 | /* source routing stuff */ |
99 | 93 | #define TR_RII 0x80 | |
100 | #define TR_RII 0x80 | 94 | #define TR_RCF_DIR_BIT 0x80 |
101 | #define TR_RCF_DIR_BIT 0x80 | 95 | #define TR_RCF_LEN_MASK 0x1f00 |
102 | #define TR_RCF_LEN_MASK 0x1f00 | 96 | #define TR_RCF_BROADCAST 0x8000 /* all-routes broadcast */ |
103 | #define TR_RCF_BROADCAST 0x8000 /* all-routes broadcast */ | 97 | #define TR_RCF_LIMITED_BROADCAST 0xC000 /* single-route broadcast */ |
104 | #define TR_RCF_LIMITED_BROADCAST 0xC000 /* single-route broadcast */ | 98 | #define TR_RCF_FRAME2K 0x20 |
105 | #define TR_RCF_FRAME2K 0x20 | 99 | #define TR_RCF_BROADCAST_MASK 0xC000 |
106 | #define TR_RCF_BROADCAST_MASK 0xC000 | 100 | #define TR_MAXRIFLEN 18 |
107 | #define TR_MAXRIFLEN 18 | ||
108 | 101 | ||
109 | #endif /* _LINUX_IF_TR_H */ | 102 | #endif /* _LINUX_IF_TR_H */ |
diff --git a/include/linux/inetdevice.h b/include/linux/inetdevice.h index 6fafb27877a7..7e1e15f934f3 100644 --- a/include/linux/inetdevice.h +++ b/include/linux/inetdevice.h | |||
@@ -29,6 +29,7 @@ struct ipv4_devconf | |||
29 | int no_xfrm; | 29 | int no_xfrm; |
30 | int no_policy; | 30 | int no_policy; |
31 | int force_igmp_version; | 31 | int force_igmp_version; |
32 | int promote_secondaries; | ||
32 | void *sysctl; | 33 | void *sysctl; |
33 | }; | 34 | }; |
34 | 35 | ||
@@ -71,6 +72,7 @@ struct in_device | |||
71 | #define IN_DEV_SEC_REDIRECTS(in_dev) (ipv4_devconf.secure_redirects || (in_dev)->cnf.secure_redirects) | 72 | #define IN_DEV_SEC_REDIRECTS(in_dev) (ipv4_devconf.secure_redirects || (in_dev)->cnf.secure_redirects) |
72 | #define IN_DEV_IDTAG(in_dev) ((in_dev)->cnf.tag) | 73 | #define IN_DEV_IDTAG(in_dev) ((in_dev)->cnf.tag) |
73 | #define IN_DEV_MEDIUM_ID(in_dev) ((in_dev)->cnf.medium_id) | 74 | #define IN_DEV_MEDIUM_ID(in_dev) ((in_dev)->cnf.medium_id) |
75 | #define IN_DEV_PROMOTE_SECONDARIES(in_dev) (ipv4_devconf.promote_secondaries || (in_dev)->cnf.promote_secondaries) | ||
74 | 76 | ||
75 | #define IN_DEV_RX_REDIRECTS(in_dev) \ | 77 | #define IN_DEV_RX_REDIRECTS(in_dev) \ |
76 | ((IN_DEV_FORWARD(in_dev) && \ | 78 | ((IN_DEV_FORWARD(in_dev) && \ |
diff --git a/include/linux/input.h b/include/linux/input.h index 72731d7d189e..9d9598ed760d 100644 --- a/include/linux/input.h +++ b/include/linux/input.h | |||
@@ -1015,7 +1015,7 @@ static inline void input_set_abs_params(struct input_dev *dev, int axis, int min | |||
1015 | dev->absbit[LONG(axis)] |= BIT(axis); | 1015 | dev->absbit[LONG(axis)] |= BIT(axis); |
1016 | } | 1016 | } |
1017 | 1017 | ||
1018 | extern struct class_simple *input_class; | 1018 | extern struct class *input_class; |
1019 | 1019 | ||
1020 | #endif | 1020 | #endif |
1021 | #endif | 1021 | #endif |
diff --git a/include/linux/ioc4.h b/include/linux/ioc4.h new file mode 100644 index 000000000000..3dd18b785ebd --- /dev/null +++ b/include/linux/ioc4.h | |||
@@ -0,0 +1,179 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * Copyright (c) 2005 Silicon Graphics, Inc. All Rights Reserved. | ||
7 | */ | ||
8 | |||
9 | #ifndef _LINUX_IOC4_H | ||
10 | #define _LINUX_IOC4_H | ||
11 | |||
12 | #include <linux/interrupt.h> | ||
13 | |||
14 | /*************** | ||
15 | * Definitions * | ||
16 | ***************/ | ||
17 | |||
18 | /* Miscellaneous values inherent to hardware */ | ||
19 | |||
20 | #define IOC4_EXTINT_COUNT_DIVISOR 520 /* PCI clocks per COUNT tick */ | ||
21 | |||
22 | /*********************************** | ||
23 | * Structures needed by subdrivers * | ||
24 | ***********************************/ | ||
25 | |||
26 | /* This structure fully describes the IOC4 miscellaneous registers which | ||
27 | * appear at bar[0]+0x00000 through bar[0]+0x0005c. The corresponding | ||
28 | * PCI resource is managed by the main IOC4 driver because it contains | ||
29 | * registers of interest to many different IOC4 subdrivers. | ||
30 | */ | ||
31 | struct ioc4_misc_regs { | ||
32 | /* Miscellaneous IOC4 registers */ | ||
33 | union ioc4_pci_err_addr_l { | ||
34 | uint32_t raw; | ||
35 | struct { | ||
36 | uint32_t valid:1; /* Address captured */ | ||
37 | uint32_t master_id:4; /* Unit causing error | ||
38 | * 0/1: Serial port 0 TX/RX | ||
39 | * 2/3: Serial port 1 TX/RX | ||
40 | * 4/5: Serial port 2 TX/RX | ||
41 | * 6/7: Serial port 3 TX/RX | ||
42 | * 8: ATA/ATAPI | ||
43 | * 9-15: Undefined | ||
44 | */ | ||
45 | uint32_t mul_err:1; /* Multiple errors occurred */ | ||
46 | uint32_t addr:26; /* Bits 31-6 of error addr */ | ||
47 | } fields; | ||
48 | } pci_err_addr_l; | ||
49 | uint32_t pci_err_addr_h; /* Bits 63-32 of error addr */ | ||
50 | union ioc4_sio_int { | ||
51 | uint32_t raw; | ||
52 | struct { | ||
53 | uint8_t tx_mt:1; /* TX ring buffer empty */ | ||
54 | uint8_t rx_full:1; /* RX ring buffer full */ | ||
55 | uint8_t rx_high:1; /* RX high-water exceeded */ | ||
56 | uint8_t rx_timer:1; /* RX timer has triggered */ | ||
57 | uint8_t delta_dcd:1; /* DELTA_DCD seen */ | ||
58 | uint8_t delta_cts:1; /* DELTA_CTS seen */ | ||
59 | uint8_t intr_pass:1; /* Interrupt pass-through */ | ||
60 | uint8_t tx_explicit:1; /* TX, MCW, or delay complete */ | ||
61 | } fields[4]; | ||
62 | } sio_ir; /* Serial interrupt state */ | ||
63 | union ioc4_other_int { | ||
64 | uint32_t raw; | ||
65 | struct { | ||
66 | uint32_t ata_int:1; /* ATA port passthru */ | ||
67 | uint32_t ata_memerr:1; /* ATA halted by mem error */ | ||
68 | uint32_t memerr:4; /* Serial halted by mem err */ | ||
69 | uint32_t kbd_int:1; /* kbd/mouse intr asserted */ | ||
70 | uint32_t reserved:16; /* zero */ | ||
71 | uint32_t rt_int:1; /* INT_OUT section latch */ | ||
72 | uint32_t gen_int:8; /* Intr. from generic pins */ | ||
73 | } fields; | ||
74 | } other_ir; /* Other interrupt state */ | ||
75 | union ioc4_sio_int sio_ies; /* Serial interrupt enable set */ | ||
76 | union ioc4_other_int other_ies; /* Other interrupt enable set */ | ||
77 | union ioc4_sio_int sio_iec; /* Serial interrupt enable clear */ | ||
78 | union ioc4_other_int other_iec; /* Other interrupt enable clear */ | ||
79 | union ioc4_sio_cr { | ||
80 | uint32_t raw; | ||
81 | struct { | ||
82 | uint32_t cmd_pulse:4; /* Bytebus strobe width */ | ||
83 | uint32_t arb_diag:3; /* PCI bus requester */ | ||
84 | uint32_t sio_diag_idle:1; /* Active ser req? */ | ||
85 | uint32_t ata_diag_idle:1; /* Active ATA req? */ | ||
86 | uint32_t ata_diag_active:1; /* ATA req is winner */ | ||
87 | uint32_t reserved:22; /* zero */ | ||
88 | } fields; | ||
89 | } sio_cr; | ||
90 | uint32_t unused1; | ||
91 | union ioc4_int_out { | ||
92 | uint32_t raw; | ||
93 | struct { | ||
94 | uint32_t count:16; /* Period control */ | ||
95 | uint32_t mode:3; /* Output signal shape */ | ||
96 | uint32_t reserved:11; /* zero */ | ||
97 | uint32_t diag:1; /* Timebase control */ | ||
98 | uint32_t int_out:1; /* Current value */ | ||
99 | } fields; | ||
100 | } int_out; /* External interrupt output control */ | ||
101 | uint32_t unused2; | ||
102 | union ioc4_gpcr { | ||
103 | uint32_t raw; | ||
104 | struct { | ||
105 | uint32_t dir:8; /* Pin direction */ | ||
106 | uint32_t edge:8; /* Edge/level mode */ | ||
107 | uint32_t reserved1:4; /* zero */ | ||
108 | uint32_t int_out_en:1; /* INT_OUT enable */ | ||
109 | uint32_t reserved2:11; /* zero */ | ||
110 | } fields; | ||
111 | } gpcr_s; /* Generic PIO control set */ | ||
112 | union ioc4_gpcr gpcr_c; /* Generic PIO control clear */ | ||
113 | union ioc4_gpdr { | ||
114 | uint32_t raw; | ||
115 | struct { | ||
116 | uint32_t gen_pin:8; /* State of pins */ | ||
117 | uint32_t reserved:24; | ||
118 | } fields; | ||
119 | } gpdr; /* Generic PIO data */ | ||
120 | uint32_t unused3; | ||
121 | union ioc4_gppr { | ||
122 | uint32_t raw; | ||
123 | struct { | ||
124 | uint32_t gen_pin:1; /* Single pin state */ | ||
125 | uint32_t reserved:31; | ||
126 | } fields; | ||
127 | } gppr[8]; /* Generic PIO pins */ | ||
128 | }; | ||
129 | |||
130 | /* Masks for GPCR DIR pins */ | ||
131 | #define IOC4_GPCR_DIR_0 0x01 /* External interrupt output */ | ||
132 | #define IOC4_GPCR_DIR_1 0x02 /* External interrupt input */ | ||
133 | #define IOC4_GPCR_DIR_2 0x04 | ||
134 | #define IOC4_GPCR_DIR_3 0x08 /* Keyboard/mouse presence */ | ||
135 | #define IOC4_GPCR_DIR_4 0x10 /* Ser. port 0 xcvr select (0=232, 1=422) */ | ||
136 | #define IOC4_GPCR_DIR_5 0x20 /* Ser. port 1 xcvr select (0=232, 1=422) */ | ||
137 | #define IOC4_GPCR_DIR_6 0x40 /* Ser. port 2 xcvr select (0=232, 1=422) */ | ||
138 | #define IOC4_GPCR_DIR_7 0x80 /* Ser. port 3 xcvr select (0=232, 1=422) */ | ||
139 | |||
140 | /* Masks for GPCR EDGE pins */ | ||
141 | #define IOC4_GPCR_EDGE_0 0x01 | ||
142 | #define IOC4_GPCR_EDGE_1 0x02 /* External interrupt input */ | ||
143 | #define IOC4_GPCR_EDGE_2 0x04 | ||
144 | #define IOC4_GPCR_EDGE_3 0x08 | ||
145 | #define IOC4_GPCR_EDGE_4 0x10 | ||
146 | #define IOC4_GPCR_EDGE_5 0x20 | ||
147 | #define IOC4_GPCR_EDGE_6 0x40 | ||
148 | #define IOC4_GPCR_EDGE_7 0x80 | ||
149 | |||
150 | /* One of these per IOC4 */ | ||
151 | struct ioc4_driver_data { | ||
152 | struct list_head idd_list; | ||
153 | unsigned long idd_bar0; | ||
154 | struct pci_dev *idd_pdev; | ||
155 | const struct pci_device_id *idd_pci_id; | ||
156 | struct __iomem ioc4_misc_regs *idd_misc_regs; | ||
157 | unsigned long count_period; | ||
158 | void *idd_serial_data; | ||
159 | }; | ||
160 | |||
161 | /* One per submodule */ | ||
162 | struct ioc4_submodule { | ||
163 | struct list_head is_list; | ||
164 | char *is_name; | ||
165 | struct module *is_owner; | ||
166 | int (*is_probe) (struct ioc4_driver_data *); | ||
167 | int (*is_remove) (struct ioc4_driver_data *); | ||
168 | }; | ||
169 | |||
170 | #define IOC4_NUM_CARDS 8 /* max cards per partition */ | ||
171 | |||
172 | /********************************** | ||
173 | * Functions needed by submodules * | ||
174 | **********************************/ | ||
175 | |||
176 | extern int ioc4_register_submodule(struct ioc4_submodule *); | ||
177 | extern void ioc4_unregister_submodule(struct ioc4_submodule *); | ||
178 | |||
179 | #endif /* _LINUX_IOC4_H */ | ||
diff --git a/include/linux/ioc4_common.h b/include/linux/ioc4_common.h deleted file mode 100644 index b03bcc46df55..000000000000 --- a/include/linux/ioc4_common.h +++ /dev/null | |||
@@ -1,21 +0,0 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * Copyright (c) 2005 Silicon Graphics, Inc. All Rights Reserved. | ||
7 | */ | ||
8 | |||
9 | #ifndef _LINUX_IOC4_COMMON_H | ||
10 | #define _LINUX_IOC4_COMMON_H | ||
11 | |||
12 | /* prototypes */ | ||
13 | |||
14 | int ioc4_serial_init(void); | ||
15 | |||
16 | int ioc4_serial_attach_one(struct pci_dev *pdev, const struct | ||
17 | pci_device_id *pci_id); | ||
18 | int ioc4_ide_attach_one(struct pci_dev *pdev, const struct | ||
19 | pci_device_id *pci_id); | ||
20 | |||
21 | #endif /* _LINUX_IOC4_COMMON_H */ | ||
diff --git a/include/linux/ip.h b/include/linux/ip.h index 8438c68591f9..31e7cedd9f84 100644 --- a/include/linux/ip.h +++ b/include/linux/ip.h | |||
@@ -81,6 +81,7 @@ | |||
81 | #ifdef __KERNEL__ | 81 | #ifdef __KERNEL__ |
82 | #include <linux/config.h> | 82 | #include <linux/config.h> |
83 | #include <linux/types.h> | 83 | #include <linux/types.h> |
84 | #include <net/request_sock.h> | ||
84 | #include <net/sock.h> | 85 | #include <net/sock.h> |
85 | #include <linux/igmp.h> | 86 | #include <linux/igmp.h> |
86 | #include <net/flow.h> | 87 | #include <net/flow.h> |
@@ -107,6 +108,26 @@ struct ip_options { | |||
107 | 108 | ||
108 | #define optlength(opt) (sizeof(struct ip_options) + opt->optlen) | 109 | #define optlength(opt) (sizeof(struct ip_options) + opt->optlen) |
109 | 110 | ||
111 | struct inet_request_sock { | ||
112 | struct request_sock req; | ||
113 | u32 loc_addr; | ||
114 | u32 rmt_addr; | ||
115 | u16 rmt_port; | ||
116 | u16 snd_wscale : 4, | ||
117 | rcv_wscale : 4, | ||
118 | tstamp_ok : 1, | ||
119 | sack_ok : 1, | ||
120 | wscale_ok : 1, | ||
121 | ecn_ok : 1, | ||
122 | acked : 1; | ||
123 | struct ip_options *opt; | ||
124 | }; | ||
125 | |||
126 | static inline struct inet_request_sock *inet_rsk(const struct request_sock *sk) | ||
127 | { | ||
128 | return (struct inet_request_sock *)sk; | ||
129 | } | ||
130 | |||
110 | struct ipv6_pinfo; | 131 | struct ipv6_pinfo; |
111 | 132 | ||
112 | struct inet_sock { | 133 | struct inet_sock { |
diff --git a/include/linux/ipv6.h b/include/linux/ipv6.h index ab0d0efbf240..6fcd6a0ade24 100644 --- a/include/linux/ipv6.h +++ b/include/linux/ipv6.h | |||
@@ -193,6 +193,19 @@ struct inet6_skb_parm { | |||
193 | 193 | ||
194 | #define IP6CB(skb) ((struct inet6_skb_parm*)((skb)->cb)) | 194 | #define IP6CB(skb) ((struct inet6_skb_parm*)((skb)->cb)) |
195 | 195 | ||
196 | struct tcp6_request_sock { | ||
197 | struct tcp_request_sock req; | ||
198 | struct in6_addr loc_addr; | ||
199 | struct in6_addr rmt_addr; | ||
200 | struct sk_buff *pktopts; | ||
201 | int iif; | ||
202 | }; | ||
203 | |||
204 | static inline struct tcp6_request_sock *tcp6_rsk(const struct request_sock *sk) | ||
205 | { | ||
206 | return (struct tcp6_request_sock *)sk; | ||
207 | } | ||
208 | |||
196 | /** | 209 | /** |
197 | * struct ipv6_pinfo - ipv6 private area | 210 | * struct ipv6_pinfo - ipv6 private area |
198 | * | 211 | * |
diff --git a/include/linux/irq.h b/include/linux/irq.h index c3ff4d101667..7fc1022be9ee 100644 --- a/include/linux/irq.h +++ b/include/linux/irq.h | |||
@@ -47,6 +47,10 @@ struct hw_interrupt_type { | |||
47 | void (*ack)(unsigned int irq); | 47 | void (*ack)(unsigned int irq); |
48 | void (*end)(unsigned int irq); | 48 | void (*end)(unsigned int irq); |
49 | void (*set_affinity)(unsigned int irq, cpumask_t dest); | 49 | void (*set_affinity)(unsigned int irq, cpumask_t dest); |
50 | /* Currently used only by UML, might disappear one day.*/ | ||
51 | #ifdef CONFIG_IRQ_RELEASE_METHOD | ||
52 | void (*release)(unsigned int irq, void *dev_id); | ||
53 | #endif | ||
50 | }; | 54 | }; |
51 | 55 | ||
52 | typedef struct hw_interrupt_type hw_irq_controller; | 56 | typedef struct hw_interrupt_type hw_irq_controller; |
diff --git a/include/linux/klist.h b/include/linux/klist.h new file mode 100644 index 000000000000..eebf5e5696ec --- /dev/null +++ b/include/linux/klist.h | |||
@@ -0,0 +1,55 @@ | |||
1 | /* | ||
2 | * klist.h - Some generic list helpers, extending struct list_head a bit. | ||
3 | * | ||
4 | * Implementations are found in lib/klist.c | ||
5 | * | ||
6 | * | ||
7 | * Copyright (C) 2005 Patrick Mochel | ||
8 | * | ||
9 | * This file is rleased under the GPL v2. | ||
10 | */ | ||
11 | |||
12 | #include <linux/spinlock.h> | ||
13 | #include <linux/completion.h> | ||
14 | #include <linux/kref.h> | ||
15 | #include <linux/list.h> | ||
16 | |||
17 | |||
18 | struct klist { | ||
19 | spinlock_t k_lock; | ||
20 | struct list_head k_list; | ||
21 | }; | ||
22 | |||
23 | |||
24 | extern void klist_init(struct klist * k); | ||
25 | |||
26 | |||
27 | struct klist_node { | ||
28 | struct klist * n_klist; | ||
29 | struct list_head n_node; | ||
30 | struct kref n_ref; | ||
31 | struct completion n_removed; | ||
32 | }; | ||
33 | |||
34 | extern void klist_add_tail(struct klist * k, struct klist_node * n); | ||
35 | extern void klist_add_head(struct klist * k, struct klist_node * n); | ||
36 | |||
37 | extern void klist_del(struct klist_node * n); | ||
38 | extern void klist_remove(struct klist_node * n); | ||
39 | |||
40 | extern int klist_node_attached(struct klist_node * n); | ||
41 | |||
42 | |||
43 | struct klist_iter { | ||
44 | struct klist * i_klist; | ||
45 | struct list_head * i_head; | ||
46 | struct klist_node * i_cur; | ||
47 | }; | ||
48 | |||
49 | |||
50 | extern void klist_iter_init(struct klist * k, struct klist_iter * i); | ||
51 | extern void klist_iter_init_node(struct klist * k, struct klist_iter * i, | ||
52 | struct klist_node * n); | ||
53 | extern void klist_iter_exit(struct klist_iter * i); | ||
54 | extern struct klist_node * klist_next(struct klist_iter * i); | ||
55 | |||
diff --git a/include/linux/kobject.h b/include/linux/kobject.h index 765d660d3bea..3b22304f12fd 100644 --- a/include/linux/kobject.h +++ b/include/linux/kobject.h | |||
@@ -33,7 +33,7 @@ | |||
33 | extern u64 hotplug_seqnum; | 33 | extern u64 hotplug_seqnum; |
34 | 34 | ||
35 | struct kobject { | 35 | struct kobject { |
36 | char * k_name; | 36 | const char * k_name; |
37 | char name[KOBJ_NAME_LEN]; | 37 | char name[KOBJ_NAME_LEN]; |
38 | struct kref kref; | 38 | struct kref kref; |
39 | struct list_head entry; | 39 | struct list_head entry; |
@@ -46,7 +46,7 @@ struct kobject { | |||
46 | extern int kobject_set_name(struct kobject *, const char *, ...) | 46 | extern int kobject_set_name(struct kobject *, const char *, ...) |
47 | __attribute__((format(printf,2,3))); | 47 | __attribute__((format(printf,2,3))); |
48 | 48 | ||
49 | static inline char * kobject_name(struct kobject * kobj) | 49 | static inline const char * kobject_name(const struct kobject * kobj) |
50 | { | 50 | { |
51 | return kobj->k_name; | 51 | return kobj->k_name; |
52 | } | 52 | } |
@@ -57,7 +57,7 @@ extern void kobject_cleanup(struct kobject *); | |||
57 | extern int kobject_add(struct kobject *); | 57 | extern int kobject_add(struct kobject *); |
58 | extern void kobject_del(struct kobject *); | 58 | extern void kobject_del(struct kobject *); |
59 | 59 | ||
60 | extern int kobject_rename(struct kobject *, char *new_name); | 60 | extern int kobject_rename(struct kobject *, const char *new_name); |
61 | 61 | ||
62 | extern int kobject_register(struct kobject *); | 62 | extern int kobject_register(struct kobject *); |
63 | extern void kobject_unregister(struct kobject *); | 63 | extern void kobject_unregister(struct kobject *); |
@@ -94,7 +94,7 @@ struct kobj_type { | |||
94 | */ | 94 | */ |
95 | struct kset_hotplug_ops { | 95 | struct kset_hotplug_ops { |
96 | int (*filter)(struct kset *kset, struct kobject *kobj); | 96 | int (*filter)(struct kset *kset, struct kobject *kobj); |
97 | char *(*name)(struct kset *kset, struct kobject *kobj); | 97 | const char *(*name)(struct kset *kset, struct kobject *kobj); |
98 | int (*hotplug)(struct kset *kset, struct kobject *kobj, char **envp, | 98 | int (*hotplug)(struct kset *kset, struct kobject *kobj, char **envp, |
99 | int num_envp, char *buffer, int buffer_size); | 99 | int num_envp, char *buffer, int buffer_size); |
100 | }; | 100 | }; |
diff --git a/include/linux/libata.h b/include/linux/libata.h index bd0df84cfd87..973090be7fc4 100644 --- a/include/linux/libata.h +++ b/include/linux/libata.h | |||
@@ -416,6 +416,7 @@ extern u8 ata_chk_err(struct ata_port *ap); | |||
416 | extern void ata_exec_command(struct ata_port *ap, struct ata_taskfile *tf); | 416 | extern void ata_exec_command(struct ata_port *ap, struct ata_taskfile *tf); |
417 | extern int ata_port_start (struct ata_port *ap); | 417 | extern int ata_port_start (struct ata_port *ap); |
418 | extern void ata_port_stop (struct ata_port *ap); | 418 | extern void ata_port_stop (struct ata_port *ap); |
419 | extern void ata_host_stop (struct ata_host_set *host_set); | ||
419 | extern irqreturn_t ata_interrupt (int irq, void *dev_instance, struct pt_regs *regs); | 420 | extern irqreturn_t ata_interrupt (int irq, void *dev_instance, struct pt_regs *regs); |
420 | extern void ata_qc_prep(struct ata_queued_cmd *qc); | 421 | extern void ata_qc_prep(struct ata_queued_cmd *qc); |
421 | extern int ata_qc_issue_prot(struct ata_queued_cmd *qc); | 422 | extern int ata_qc_issue_prot(struct ata_queued_cmd *qc); |
@@ -426,6 +427,7 @@ extern void ata_sg_init(struct ata_queued_cmd *qc, struct scatterlist *sg, | |||
426 | extern unsigned int ata_dev_classify(struct ata_taskfile *tf); | 427 | extern unsigned int ata_dev_classify(struct ata_taskfile *tf); |
427 | extern void ata_dev_id_string(u16 *id, unsigned char *s, | 428 | extern void ata_dev_id_string(u16 *id, unsigned char *s, |
428 | unsigned int ofs, unsigned int len); | 429 | unsigned int ofs, unsigned int len); |
430 | extern void ata_dev_config(struct ata_port *ap, unsigned int i); | ||
429 | extern void ata_bmdma_setup (struct ata_queued_cmd *qc); | 431 | extern void ata_bmdma_setup (struct ata_queued_cmd *qc); |
430 | extern void ata_bmdma_start (struct ata_queued_cmd *qc); | 432 | extern void ata_bmdma_start (struct ata_queued_cmd *qc); |
431 | extern void ata_bmdma_stop(struct ata_port *ap); | 433 | extern void ata_bmdma_stop(struct ata_port *ap); |
@@ -472,12 +474,34 @@ static inline u8 ata_chk_status(struct ata_port *ap) | |||
472 | return ap->ops->check_status(ap); | 474 | return ap->ops->check_status(ap); |
473 | } | 475 | } |
474 | 476 | ||
477 | |||
478 | /** | ||
479 | * ata_pause - Flush writes and pause 400 nanoseconds. | ||
480 | * @ap: Port to wait for. | ||
481 | * | ||
482 | * LOCKING: | ||
483 | * Inherited from caller. | ||
484 | */ | ||
485 | |||
475 | static inline void ata_pause(struct ata_port *ap) | 486 | static inline void ata_pause(struct ata_port *ap) |
476 | { | 487 | { |
477 | ata_altstatus(ap); | 488 | ata_altstatus(ap); |
478 | ndelay(400); | 489 | ndelay(400); |
479 | } | 490 | } |
480 | 491 | ||
492 | |||
493 | /** | ||
494 | * ata_busy_wait - Wait for a port status register | ||
495 | * @ap: Port to wait for. | ||
496 | * | ||
497 | * Waits up to max*10 microseconds for the selected bits in the port's | ||
498 | * status register to be cleared. | ||
499 | * Returns final value of status register. | ||
500 | * | ||
501 | * LOCKING: | ||
502 | * Inherited from caller. | ||
503 | */ | ||
504 | |||
481 | static inline u8 ata_busy_wait(struct ata_port *ap, unsigned int bits, | 505 | static inline u8 ata_busy_wait(struct ata_port *ap, unsigned int bits, |
482 | unsigned int max) | 506 | unsigned int max) |
483 | { | 507 | { |
@@ -492,6 +516,18 @@ static inline u8 ata_busy_wait(struct ata_port *ap, unsigned int bits, | |||
492 | return status; | 516 | return status; |
493 | } | 517 | } |
494 | 518 | ||
519 | |||
520 | /** | ||
521 | * ata_wait_idle - Wait for a port to be idle. | ||
522 | * @ap: Port to wait for. | ||
523 | * | ||
524 | * Waits up to 10ms for port's BUSY and DRQ signals to clear. | ||
525 | * Returns final value of status register. | ||
526 | * | ||
527 | * LOCKING: | ||
528 | * Inherited from caller. | ||
529 | */ | ||
530 | |||
495 | static inline u8 ata_wait_idle(struct ata_port *ap) | 531 | static inline u8 ata_wait_idle(struct ata_port *ap) |
496 | { | 532 | { |
497 | u8 status = ata_busy_wait(ap, ATA_BUSY | ATA_DRQ, 1000); | 533 | u8 status = ata_busy_wait(ap, ATA_BUSY | ATA_DRQ, 1000); |
@@ -530,6 +566,18 @@ static inline void ata_tf_init(struct ata_port *ap, struct ata_taskfile *tf, uns | |||
530 | tf->device = ATA_DEVICE_OBS | ATA_DEV1; | 566 | tf->device = ATA_DEVICE_OBS | ATA_DEV1; |
531 | } | 567 | } |
532 | 568 | ||
569 | |||
570 | /** | ||
571 | * ata_irq_on - Enable interrupts on a port. | ||
572 | * @ap: Port on which interrupts are enabled. | ||
573 | * | ||
574 | * Enable interrupts on a legacy IDE device using MMIO or PIO, | ||
575 | * wait for idle, clear any pending interrupts. | ||
576 | * | ||
577 | * LOCKING: | ||
578 | * Inherited from caller. | ||
579 | */ | ||
580 | |||
533 | static inline u8 ata_irq_on(struct ata_port *ap) | 581 | static inline u8 ata_irq_on(struct ata_port *ap) |
534 | { | 582 | { |
535 | struct ata_ioports *ioaddr = &ap->ioaddr; | 583 | struct ata_ioports *ioaddr = &ap->ioaddr; |
@@ -549,6 +597,18 @@ static inline u8 ata_irq_on(struct ata_port *ap) | |||
549 | return tmp; | 597 | return tmp; |
550 | } | 598 | } |
551 | 599 | ||
600 | |||
601 | /** | ||
602 | * ata_irq_ack - Acknowledge a device interrupt. | ||
603 | * @ap: Port on which interrupts are enabled. | ||
604 | * | ||
605 | * Wait up to 10 ms for legacy IDE device to become idle (BUSY | ||
606 | * or BUSY+DRQ clear). Obtain dma status and port status from | ||
607 | * device. Clear the interrupt. Return port status. | ||
608 | * | ||
609 | * LOCKING: | ||
610 | */ | ||
611 | |||
552 | static inline u8 ata_irq_ack(struct ata_port *ap, unsigned int chk_drq) | 612 | static inline u8 ata_irq_ack(struct ata_port *ap, unsigned int chk_drq) |
553 | { | 613 | { |
554 | unsigned int bits = chk_drq ? ATA_BUSY | ATA_DRQ : ATA_BUSY; | 614 | unsigned int bits = chk_drq ? ATA_BUSY | ATA_DRQ : ATA_BUSY; |
@@ -590,6 +650,13 @@ static inline void scr_write(struct ata_port *ap, unsigned int reg, u32 val) | |||
590 | ap->ops->scr_write(ap, reg, val); | 650 | ap->ops->scr_write(ap, reg, val); |
591 | } | 651 | } |
592 | 652 | ||
653 | static inline void scr_write_flush(struct ata_port *ap, unsigned int reg, | ||
654 | u32 val) | ||
655 | { | ||
656 | ap->ops->scr_write(ap, reg, val); | ||
657 | (void) ap->ops->scr_read(ap, reg); | ||
658 | } | ||
659 | |||
593 | static inline unsigned int sata_dev_present(struct ata_port *ap) | 660 | static inline unsigned int sata_dev_present(struct ata_port *ap) |
594 | { | 661 | { |
595 | return ((scr_read(ap, SCR_STATUS) & 0xf) == 0x3) ? 1 : 0; | 662 | return ((scr_read(ap, SCR_STATUS) & 0xf) == 0x3) ? 1 : 0; |
diff --git a/include/linux/major.h b/include/linux/major.h index 4b62c42b842c..e36a46702d94 100644 --- a/include/linux/major.h +++ b/include/linux/major.h | |||
@@ -100,6 +100,7 @@ | |||
100 | #define I2O_MAJOR 80 /* 80->87 */ | 100 | #define I2O_MAJOR 80 /* 80->87 */ |
101 | 101 | ||
102 | #define SHMIQ_MAJOR 85 /* Linux/mips, SGI /dev/shmiq */ | 102 | #define SHMIQ_MAJOR 85 /* Linux/mips, SGI /dev/shmiq */ |
103 | #define SCSI_CHANGER_MAJOR 86 | ||
103 | 104 | ||
104 | #define IDE6_MAJOR 88 | 105 | #define IDE6_MAJOR 88 |
105 | #define IDE7_MAJOR 89 | 106 | #define IDE7_MAJOR 89 |
diff --git a/include/linux/mii.h b/include/linux/mii.h index 20971fe78a8d..374b615ea9ea 100644 --- a/include/linux/mii.h +++ b/include/linux/mii.h | |||
@@ -65,9 +65,13 @@ | |||
65 | #define ADVERTISE_SLCT 0x001f /* Selector bits */ | 65 | #define ADVERTISE_SLCT 0x001f /* Selector bits */ |
66 | #define ADVERTISE_CSMA 0x0001 /* Only selector supported */ | 66 | #define ADVERTISE_CSMA 0x0001 /* Only selector supported */ |
67 | #define ADVERTISE_10HALF 0x0020 /* Try for 10mbps half-duplex */ | 67 | #define ADVERTISE_10HALF 0x0020 /* Try for 10mbps half-duplex */ |
68 | #define ADVERTISE_1000XFULL 0x0020 /* Try for 1000BASE-X full-duplex */ | ||
68 | #define ADVERTISE_10FULL 0x0040 /* Try for 10mbps full-duplex */ | 69 | #define ADVERTISE_10FULL 0x0040 /* Try for 10mbps full-duplex */ |
70 | #define ADVERTISE_1000XHALF 0x0040 /* Try for 1000BASE-X half-duplex */ | ||
69 | #define ADVERTISE_100HALF 0x0080 /* Try for 100mbps half-duplex */ | 71 | #define ADVERTISE_100HALF 0x0080 /* Try for 100mbps half-duplex */ |
72 | #define ADVERTISE_1000XPAUSE 0x0080 /* Try for 1000BASE-X pause */ | ||
70 | #define ADVERTISE_100FULL 0x0100 /* Try for 100mbps full-duplex */ | 73 | #define ADVERTISE_100FULL 0x0100 /* Try for 100mbps full-duplex */ |
74 | #define ADVERTISE_1000XPSE_ASYM 0x0100 /* Try for 1000BASE-X asym pause */ | ||
71 | #define ADVERTISE_100BASE4 0x0200 /* Try for 100mbps 4k packets */ | 75 | #define ADVERTISE_100BASE4 0x0200 /* Try for 100mbps 4k packets */ |
72 | #define ADVERTISE_PAUSE_CAP 0x0400 /* Try for pause */ | 76 | #define ADVERTISE_PAUSE_CAP 0x0400 /* Try for pause */ |
73 | #define ADVERTISE_PAUSE_ASYM 0x0800 /* Try for asymetric pause */ | 77 | #define ADVERTISE_PAUSE_ASYM 0x0800 /* Try for asymetric pause */ |
@@ -84,9 +88,13 @@ | |||
84 | /* Link partner ability register. */ | 88 | /* Link partner ability register. */ |
85 | #define LPA_SLCT 0x001f /* Same as advertise selector */ | 89 | #define LPA_SLCT 0x001f /* Same as advertise selector */ |
86 | #define LPA_10HALF 0x0020 /* Can do 10mbps half-duplex */ | 90 | #define LPA_10HALF 0x0020 /* Can do 10mbps half-duplex */ |
91 | #define LPA_1000XFULL 0x0020 /* Can do 1000BASE-X full-duplex */ | ||
87 | #define LPA_10FULL 0x0040 /* Can do 10mbps full-duplex */ | 92 | #define LPA_10FULL 0x0040 /* Can do 10mbps full-duplex */ |
93 | #define LPA_1000XHALF 0x0040 /* Can do 1000BASE-X half-duplex */ | ||
88 | #define LPA_100HALF 0x0080 /* Can do 100mbps half-duplex */ | 94 | #define LPA_100HALF 0x0080 /* Can do 100mbps half-duplex */ |
95 | #define LPA_1000XPAUSE 0x0080 /* Can do 1000BASE-X pause */ | ||
89 | #define LPA_100FULL 0x0100 /* Can do 100mbps full-duplex */ | 96 | #define LPA_100FULL 0x0100 /* Can do 100mbps full-duplex */ |
97 | #define LPA_1000XPAUSE_ASYM 0x0100 /* Can do 1000BASE-X pause asym*/ | ||
90 | #define LPA_100BASE4 0x0200 /* Can do 100mbps 4k packets */ | 98 | #define LPA_100BASE4 0x0200 /* Can do 100mbps 4k packets */ |
91 | #define LPA_PAUSE_CAP 0x0400 /* Can pause */ | 99 | #define LPA_PAUSE_CAP 0x0400 /* Can pause */ |
92 | #define LPA_PAUSE_ASYM 0x0800 /* Can pause asymetrically */ | 100 | #define LPA_PAUSE_ASYM 0x0800 /* Can pause asymetrically */ |
diff --git a/include/linux/mm.h b/include/linux/mm.h index 17518fe0b311..1813b162b0a8 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h | |||
@@ -691,6 +691,12 @@ extern void show_mem(void); | |||
691 | extern void si_meminfo(struct sysinfo * val); | 691 | extern void si_meminfo(struct sysinfo * val); |
692 | extern void si_meminfo_node(struct sysinfo *val, int nid); | 692 | extern void si_meminfo_node(struct sysinfo *val, int nid); |
693 | 693 | ||
694 | #ifdef CONFIG_NUMA | ||
695 | extern void setup_per_cpu_pageset(void); | ||
696 | #else | ||
697 | static inline void setup_per_cpu_pageset(void) {} | ||
698 | #endif | ||
699 | |||
694 | /* prio_tree.c */ | 700 | /* prio_tree.c */ |
695 | void vma_prio_tree_add(struct vm_area_struct *, struct vm_area_struct *old); | 701 | void vma_prio_tree_add(struct vm_area_struct *, struct vm_area_struct *old); |
696 | void vma_prio_tree_insert(struct vm_area_struct *, struct prio_tree_root *); | 702 | void vma_prio_tree_insert(struct vm_area_struct *, struct prio_tree_root *); |
diff --git a/include/linux/mmc/protocol.h b/include/linux/mmc/protocol.h index 7b904c5102f6..896342817b97 100644 --- a/include/linux/mmc/protocol.h +++ b/include/linux/mmc/protocol.h | |||
@@ -195,6 +195,33 @@ struct _mmc_csd { | |||
195 | #define MMC_VDD_35_36 0x00800000 /* VDD voltage 3.5 ~ 3.6 */ | 195 | #define MMC_VDD_35_36 0x00800000 /* VDD voltage 3.5 ~ 3.6 */ |
196 | #define MMC_CARD_BUSY 0x80000000 /* Card Power up status bit */ | 196 | #define MMC_CARD_BUSY 0x80000000 /* Card Power up status bit */ |
197 | 197 | ||
198 | /* | ||
199 | * Card Command Classes (CCC) | ||
200 | */ | ||
201 | #define CCC_BASIC (1<<0) /* (0) Basic protocol functions */ | ||
202 | /* (CMD0,1,2,3,4,7,9,10,12,13,15) */ | ||
203 | #define CCC_STREAM_READ (1<<1) /* (1) Stream read commands */ | ||
204 | /* (CMD11) */ | ||
205 | #define CCC_BLOCK_READ (1<<2) /* (2) Block read commands */ | ||
206 | /* (CMD16,17,18) */ | ||
207 | #define CCC_STREAM_WRITE (1<<3) /* (3) Stream write commands */ | ||
208 | /* (CMD20) */ | ||
209 | #define CCC_BLOCK_WRITE (1<<4) /* (4) Block write commands */ | ||
210 | /* (CMD16,24,25,26,27) */ | ||
211 | #define CCC_ERASE (1<<5) /* (5) Ability to erase blocks */ | ||
212 | /* (CMD32,33,34,35,36,37,38,39) */ | ||
213 | #define CCC_WRITE_PROT (1<<6) /* (6) Able to write protect blocks */ | ||
214 | /* (CMD28,29,30) */ | ||
215 | #define CCC_LOCK_CARD (1<<7) /* (7) Able to lock down card */ | ||
216 | /* (CMD16,CMD42) */ | ||
217 | #define CCC_APP_SPEC (1<<8) /* (8) Application specific */ | ||
218 | /* (CMD55,56,57,ACMD*) */ | ||
219 | #define CCC_IO_MODE (1<<9) /* (9) I/O mode */ | ||
220 | /* (CMD5,39,40,52,53) */ | ||
221 | #define CCC_SWITCH (1<<10) /* (10) High speed switch */ | ||
222 | /* (CMD6,34,35,36,37,50) */ | ||
223 | /* (11) Reserved */ | ||
224 | /* (CMD?) */ | ||
198 | 225 | ||
199 | /* | 226 | /* |
200 | * CSD field definitions | 227 | * CSD field definitions |
diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h index e530c6c092f1..4733d35d8223 100644 --- a/include/linux/mmzone.h +++ b/include/linux/mmzone.h | |||
@@ -63,6 +63,12 @@ struct per_cpu_pageset { | |||
63 | #endif | 63 | #endif |
64 | } ____cacheline_aligned_in_smp; | 64 | } ____cacheline_aligned_in_smp; |
65 | 65 | ||
66 | #ifdef CONFIG_NUMA | ||
67 | #define zone_pcp(__z, __cpu) ((__z)->pageset[(__cpu)]) | ||
68 | #else | ||
69 | #define zone_pcp(__z, __cpu) (&(__z)->pageset[(__cpu)]) | ||
70 | #endif | ||
71 | |||
66 | #define ZONE_DMA 0 | 72 | #define ZONE_DMA 0 |
67 | #define ZONE_NORMAL 1 | 73 | #define ZONE_NORMAL 1 |
68 | #define ZONE_HIGHMEM 2 | 74 | #define ZONE_HIGHMEM 2 |
@@ -122,8 +128,11 @@ struct zone { | |||
122 | */ | 128 | */ |
123 | unsigned long lowmem_reserve[MAX_NR_ZONES]; | 129 | unsigned long lowmem_reserve[MAX_NR_ZONES]; |
124 | 130 | ||
131 | #ifdef CONFIG_NUMA | ||
132 | struct per_cpu_pageset *pageset[NR_CPUS]; | ||
133 | #else | ||
125 | struct per_cpu_pageset pageset[NR_CPUS]; | 134 | struct per_cpu_pageset pageset[NR_CPUS]; |
126 | 135 | #endif | |
127 | /* | 136 | /* |
128 | * free areas of different sizes | 137 | * free areas of different sizes |
129 | */ | 138 | */ |
@@ -145,6 +154,14 @@ struct zone { | |||
145 | int all_unreclaimable; /* All pages pinned */ | 154 | int all_unreclaimable; /* All pages pinned */ |
146 | 155 | ||
147 | /* | 156 | /* |
157 | * Does the allocator try to reclaim pages from the zone as soon | ||
158 | * as it fails a watermark_ok() in __alloc_pages? | ||
159 | */ | ||
160 | int reclaim_pages; | ||
161 | /* A count of how many reclaimers are scanning this zone */ | ||
162 | atomic_t reclaim_in_progress; | ||
163 | |||
164 | /* | ||
148 | * prev_priority holds the scanning priority for this zone. It is | 165 | * prev_priority holds the scanning priority for this zone. It is |
149 | * defined as the scanning priority at which we achieved our reclaim | 166 | * defined as the scanning priority at which we achieved our reclaim |
150 | * target at the previous try_to_free_pages() or balance_pgdat() | 167 | * target at the previous try_to_free_pages() or balance_pgdat() |
@@ -381,7 +398,7 @@ int lowmem_reserve_ratio_sysctl_handler(struct ctl_table *, int, struct file *, | |||
381 | 398 | ||
382 | #include <linux/topology.h> | 399 | #include <linux/topology.h> |
383 | /* Returns the number of the current Node. */ | 400 | /* Returns the number of the current Node. */ |
384 | #define numa_node_id() (cpu_to_node(_smp_processor_id())) | 401 | #define numa_node_id() (cpu_to_node(raw_smp_processor_id())) |
385 | 402 | ||
386 | #ifndef CONFIG_DISCONTIGMEM | 403 | #ifndef CONFIG_DISCONTIGMEM |
387 | 404 | ||
diff --git a/include/linux/net.h b/include/linux/net.h index 6d997ff3f103..20cb226b2268 100644 --- a/include/linux/net.h +++ b/include/linux/net.h | |||
@@ -101,7 +101,6 @@ enum sock_type { | |||
101 | * @sk: internal networking protocol agnostic socket representation | 101 | * @sk: internal networking protocol agnostic socket representation |
102 | * @wait: wait queue for several uses | 102 | * @wait: wait queue for several uses |
103 | * @type: socket type (%SOCK_STREAM, etc) | 103 | * @type: socket type (%SOCK_STREAM, etc) |
104 | * @passcred: credentials (used only in Unix Sockets (aka PF_LOCAL)) | ||
105 | */ | 104 | */ |
106 | struct socket { | 105 | struct socket { |
107 | socket_state state; | 106 | socket_state state; |
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index ac11d73be4ce..ba5d1236aa17 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h | |||
@@ -204,7 +204,7 @@ struct hh_cache | |||
204 | /* cached hardware header; allow for machine alignment needs. */ | 204 | /* cached hardware header; allow for machine alignment needs. */ |
205 | #define HH_DATA_MOD 16 | 205 | #define HH_DATA_MOD 16 |
206 | #define HH_DATA_OFF(__len) \ | 206 | #define HH_DATA_OFF(__len) \ |
207 | (HH_DATA_MOD - ((__len) & (HH_DATA_MOD - 1))) | 207 | (HH_DATA_MOD - (((__len - 1) & (HH_DATA_MOD - 1)) + 1)) |
208 | #define HH_DATA_ALIGN(__len) \ | 208 | #define HH_DATA_ALIGN(__len) \ |
209 | (((__len)+(HH_DATA_MOD-1))&~(HH_DATA_MOD - 1)) | 209 | (((__len)+(HH_DATA_MOD-1))&~(HH_DATA_MOD - 1)) |
210 | unsigned long hh_data[HH_DATA_ALIGN(LL_MAX_HEADER) / sizeof(long)]; | 210 | unsigned long hh_data[HH_DATA_ALIGN(LL_MAX_HEADER) / sizeof(long)]; |
@@ -401,7 +401,7 @@ struct net_device | |||
401 | } reg_state; | 401 | } reg_state; |
402 | 402 | ||
403 | /* Net device features */ | 403 | /* Net device features */ |
404 | int features; | 404 | unsigned long features; |
405 | #define NETIF_F_SG 1 /* Scatter/gather IO. */ | 405 | #define NETIF_F_SG 1 /* Scatter/gather IO. */ |
406 | #define NETIF_F_IP_CSUM 2 /* Can checksum only TCP/UDP over IPv4. */ | 406 | #define NETIF_F_IP_CSUM 2 /* Can checksum only TCP/UDP over IPv4. */ |
407 | #define NETIF_F_NO_CSUM 4 /* Does not require checksum. F.e. loopack. */ | 407 | #define NETIF_F_NO_CSUM 4 /* Does not require checksum. F.e. loopack. */ |
@@ -503,7 +503,7 @@ static inline void *netdev_priv(struct net_device *dev) | |||
503 | #define SET_NETDEV_DEV(net, pdev) ((net)->class_dev.dev = (pdev)) | 503 | #define SET_NETDEV_DEV(net, pdev) ((net)->class_dev.dev = (pdev)) |
504 | 504 | ||
505 | struct packet_type { | 505 | struct packet_type { |
506 | unsigned short type; /* This is really htons(ether_type). */ | 506 | __be16 type; /* This is really htons(ether_type). */ |
507 | struct net_device *dev; /* NULL is wildcarded here */ | 507 | struct net_device *dev; /* NULL is wildcarded here */ |
508 | int (*func) (struct sk_buff *, struct net_device *, | 508 | int (*func) (struct sk_buff *, struct net_device *, |
509 | struct packet_type *); | 509 | struct packet_type *); |
@@ -913,6 +913,7 @@ extern void dev_mc_discard(struct net_device *dev); | |||
913 | extern void dev_set_promiscuity(struct net_device *dev, int inc); | 913 | extern void dev_set_promiscuity(struct net_device *dev, int inc); |
914 | extern void dev_set_allmulti(struct net_device *dev, int inc); | 914 | extern void dev_set_allmulti(struct net_device *dev, int inc); |
915 | extern void netdev_state_change(struct net_device *dev); | 915 | extern void netdev_state_change(struct net_device *dev); |
916 | extern void netdev_features_change(struct net_device *dev); | ||
916 | /* Load a device via the kmod */ | 917 | /* Load a device via the kmod */ |
917 | extern void dev_load(const char *name); | 918 | extern void dev_load(const char *name); |
918 | extern void dev_mcast_init(void); | 919 | extern void dev_mcast_init(void); |
diff --git a/include/linux/netfilter_ipv4.h b/include/linux/netfilter_ipv4.h index 9e5750079e09..3ebc36afae1a 100644 --- a/include/linux/netfilter_ipv4.h +++ b/include/linux/netfilter_ipv4.h | |||
@@ -75,12 +75,6 @@ enum nf_ip_hook_priorities { | |||
75 | #define SO_ORIGINAL_DST 80 | 75 | #define SO_ORIGINAL_DST 80 |
76 | 76 | ||
77 | #ifdef __KERNEL__ | 77 | #ifdef __KERNEL__ |
78 | #ifdef CONFIG_NETFILTER_DEBUG | ||
79 | void nf_debug_ip_local_deliver(struct sk_buff *skb); | ||
80 | void nf_debug_ip_loopback_xmit(struct sk_buff *newskb); | ||
81 | void nf_debug_ip_finish_output2(struct sk_buff *skb); | ||
82 | #endif /*CONFIG_NETFILTER_DEBUG*/ | ||
83 | |||
84 | extern int ip_route_me_harder(struct sk_buff **pskb); | 78 | extern int ip_route_me_harder(struct sk_buff **pskb); |
85 | 79 | ||
86 | /* Call this before modifying an existing IP packet: ensures it is | 80 | /* Call this before modifying an existing IP packet: ensures it is |
diff --git a/include/linux/netfilter_ipv4/ip_conntrack_core.h b/include/linux/netfilter_ipv4/ip_conntrack_core.h index d84be02cb4fc..694aec9b4784 100644 --- a/include/linux/netfilter_ipv4/ip_conntrack_core.h +++ b/include/linux/netfilter_ipv4/ip_conntrack_core.h | |||
@@ -1,7 +1,6 @@ | |||
1 | #ifndef _IP_CONNTRACK_CORE_H | 1 | #ifndef _IP_CONNTRACK_CORE_H |
2 | #define _IP_CONNTRACK_CORE_H | 2 | #define _IP_CONNTRACK_CORE_H |
3 | #include <linux/netfilter.h> | 3 | #include <linux/netfilter.h> |
4 | #include <linux/netfilter_ipv4/lockhelp.h> | ||
5 | 4 | ||
6 | /* This header is used to share core functionality between the | 5 | /* This header is used to share core functionality between the |
7 | standalone connection tracking module, and the compatibility layer's use | 6 | standalone connection tracking module, and the compatibility layer's use |
@@ -47,6 +46,6 @@ static inline int ip_conntrack_confirm(struct sk_buff **pskb) | |||
47 | 46 | ||
48 | extern struct list_head *ip_conntrack_hash; | 47 | extern struct list_head *ip_conntrack_hash; |
49 | extern struct list_head ip_conntrack_expect_list; | 48 | extern struct list_head ip_conntrack_expect_list; |
50 | DECLARE_RWLOCK_EXTERN(ip_conntrack_lock); | 49 | extern rwlock_t ip_conntrack_lock; |
51 | #endif /* _IP_CONNTRACK_CORE_H */ | 50 | #endif /* _IP_CONNTRACK_CORE_H */ |
52 | 51 | ||
diff --git a/include/linux/netfilter_ipv4/ip_nat.h b/include/linux/netfilter_ipv4/ip_nat.h index 2b72b86176f0..e201ec6e9905 100644 --- a/include/linux/netfilter_ipv4/ip_nat.h +++ b/include/linux/netfilter_ipv4/ip_nat.h | |||
@@ -50,10 +50,9 @@ struct ip_nat_multi_range_compat | |||
50 | 50 | ||
51 | #ifdef __KERNEL__ | 51 | #ifdef __KERNEL__ |
52 | #include <linux/list.h> | 52 | #include <linux/list.h> |
53 | #include <linux/netfilter_ipv4/lockhelp.h> | ||
54 | 53 | ||
55 | /* Protects NAT hash tables, and NAT-private part of conntracks. */ | 54 | /* Protects NAT hash tables, and NAT-private part of conntracks. */ |
56 | DECLARE_RWLOCK_EXTERN(ip_nat_lock); | 55 | extern rwlock_t ip_nat_lock; |
57 | 56 | ||
58 | /* The structure embedded in the conntrack structure. */ | 57 | /* The structure embedded in the conntrack structure. */ |
59 | struct ip_nat_info | 58 | struct ip_nat_info |
diff --git a/include/linux/netfilter_ipv4/listhelp.h b/include/linux/netfilter_ipv4/listhelp.h index f2ae7c5e57bb..360429f48737 100644 --- a/include/linux/netfilter_ipv4/listhelp.h +++ b/include/linux/netfilter_ipv4/listhelp.h | |||
@@ -2,7 +2,6 @@ | |||
2 | #define _LISTHELP_H | 2 | #define _LISTHELP_H |
3 | #include <linux/config.h> | 3 | #include <linux/config.h> |
4 | #include <linux/list.h> | 4 | #include <linux/list.h> |
5 | #include <linux/netfilter_ipv4/lockhelp.h> | ||
6 | 5 | ||
7 | /* Header to do more comprehensive job than linux/list.h; assume list | 6 | /* Header to do more comprehensive job than linux/list.h; assume list |
8 | is first entry in structure. */ | 7 | is first entry in structure. */ |
diff --git a/include/linux/netfilter_ipv4/lockhelp.h b/include/linux/netfilter_ipv4/lockhelp.h deleted file mode 100644 index a3288633ab46..000000000000 --- a/include/linux/netfilter_ipv4/lockhelp.h +++ /dev/null | |||
@@ -1,129 +0,0 @@ | |||
1 | #ifndef _LOCKHELP_H | ||
2 | #define _LOCKHELP_H | ||
3 | #include <linux/config.h> | ||
4 | |||
5 | #include <linux/spinlock.h> | ||
6 | #include <asm/atomic.h> | ||
7 | #include <linux/interrupt.h> | ||
8 | #include <linux/smp.h> | ||
9 | |||
10 | /* Header to do help in lock debugging. */ | ||
11 | |||
12 | #ifdef CONFIG_NETFILTER_DEBUG | ||
13 | struct spinlock_debug | ||
14 | { | ||
15 | spinlock_t l; | ||
16 | atomic_t locked_by; | ||
17 | }; | ||
18 | |||
19 | struct rwlock_debug | ||
20 | { | ||
21 | rwlock_t l; | ||
22 | long read_locked_map; | ||
23 | long write_locked_map; | ||
24 | }; | ||
25 | |||
26 | #define DECLARE_LOCK(l) \ | ||
27 | struct spinlock_debug l = { SPIN_LOCK_UNLOCKED, ATOMIC_INIT(-1) } | ||
28 | #define DECLARE_LOCK_EXTERN(l) \ | ||
29 | extern struct spinlock_debug l | ||
30 | #define DECLARE_RWLOCK(l) \ | ||
31 | struct rwlock_debug l = { RW_LOCK_UNLOCKED, 0, 0 } | ||
32 | #define DECLARE_RWLOCK_EXTERN(l) \ | ||
33 | extern struct rwlock_debug l | ||
34 | |||
35 | #define MUST_BE_LOCKED(l) \ | ||
36 | do { if (atomic_read(&(l)->locked_by) != smp_processor_id()) \ | ||
37 | printk("ASSERT %s:%u %s unlocked\n", __FILE__, __LINE__, #l); \ | ||
38 | } while(0) | ||
39 | |||
40 | #define MUST_BE_UNLOCKED(l) \ | ||
41 | do { if (atomic_read(&(l)->locked_by) == smp_processor_id()) \ | ||
42 | printk("ASSERT %s:%u %s locked\n", __FILE__, __LINE__, #l); \ | ||
43 | } while(0) | ||
44 | |||
45 | /* Write locked OK as well. */ | ||
46 | #define MUST_BE_READ_LOCKED(l) \ | ||
47 | do { if (!((l)->read_locked_map & (1UL << smp_processor_id())) \ | ||
48 | && !((l)->write_locked_map & (1UL << smp_processor_id()))) \ | ||
49 | printk("ASSERT %s:%u %s not readlocked\n", __FILE__, __LINE__, #l); \ | ||
50 | } while(0) | ||
51 | |||
52 | #define MUST_BE_WRITE_LOCKED(l) \ | ||
53 | do { if (!((l)->write_locked_map & (1UL << smp_processor_id()))) \ | ||
54 | printk("ASSERT %s:%u %s not writelocked\n", __FILE__, __LINE__, #l); \ | ||
55 | } while(0) | ||
56 | |||
57 | #define MUST_BE_READ_WRITE_UNLOCKED(l) \ | ||
58 | do { if ((l)->read_locked_map & (1UL << smp_processor_id())) \ | ||
59 | printk("ASSERT %s:%u %s readlocked\n", __FILE__, __LINE__, #l); \ | ||
60 | else if ((l)->write_locked_map & (1UL << smp_processor_id())) \ | ||
61 | printk("ASSERT %s:%u %s writelocked\n", __FILE__, __LINE__, #l); \ | ||
62 | } while(0) | ||
63 | |||
64 | #define LOCK_BH(lk) \ | ||
65 | do { \ | ||
66 | MUST_BE_UNLOCKED(lk); \ | ||
67 | spin_lock_bh(&(lk)->l); \ | ||
68 | atomic_set(&(lk)->locked_by, smp_processor_id()); \ | ||
69 | } while(0) | ||
70 | |||
71 | #define UNLOCK_BH(lk) \ | ||
72 | do { \ | ||
73 | MUST_BE_LOCKED(lk); \ | ||
74 | atomic_set(&(lk)->locked_by, -1); \ | ||
75 | spin_unlock_bh(&(lk)->l); \ | ||
76 | } while(0) | ||
77 | |||
78 | #define READ_LOCK(lk) \ | ||
79 | do { \ | ||
80 | MUST_BE_READ_WRITE_UNLOCKED(lk); \ | ||
81 | read_lock_bh(&(lk)->l); \ | ||
82 | set_bit(smp_processor_id(), &(lk)->read_locked_map); \ | ||
83 | } while(0) | ||
84 | |||
85 | #define WRITE_LOCK(lk) \ | ||
86 | do { \ | ||
87 | MUST_BE_READ_WRITE_UNLOCKED(lk); \ | ||
88 | write_lock_bh(&(lk)->l); \ | ||
89 | set_bit(smp_processor_id(), &(lk)->write_locked_map); \ | ||
90 | } while(0) | ||
91 | |||
92 | #define READ_UNLOCK(lk) \ | ||
93 | do { \ | ||
94 | if (!((lk)->read_locked_map & (1UL << smp_processor_id()))) \ | ||
95 | printk("ASSERT: %s:%u %s not readlocked\n", \ | ||
96 | __FILE__, __LINE__, #lk); \ | ||
97 | clear_bit(smp_processor_id(), &(lk)->read_locked_map); \ | ||
98 | read_unlock_bh(&(lk)->l); \ | ||
99 | } while(0) | ||
100 | |||
101 | #define WRITE_UNLOCK(lk) \ | ||
102 | do { \ | ||
103 | MUST_BE_WRITE_LOCKED(lk); \ | ||
104 | clear_bit(smp_processor_id(), &(lk)->write_locked_map); \ | ||
105 | write_unlock_bh(&(lk)->l); \ | ||
106 | } while(0) | ||
107 | |||
108 | #else | ||
109 | #define DECLARE_LOCK(l) spinlock_t l = SPIN_LOCK_UNLOCKED | ||
110 | #define DECLARE_LOCK_EXTERN(l) extern spinlock_t l | ||
111 | #define DECLARE_RWLOCK(l) rwlock_t l = RW_LOCK_UNLOCKED | ||
112 | #define DECLARE_RWLOCK_EXTERN(l) extern rwlock_t l | ||
113 | |||
114 | #define MUST_BE_LOCKED(l) | ||
115 | #define MUST_BE_UNLOCKED(l) | ||
116 | #define MUST_BE_READ_LOCKED(l) | ||
117 | #define MUST_BE_WRITE_LOCKED(l) | ||
118 | #define MUST_BE_READ_WRITE_UNLOCKED(l) | ||
119 | |||
120 | #define LOCK_BH(l) spin_lock_bh(l) | ||
121 | #define UNLOCK_BH(l) spin_unlock_bh(l) | ||
122 | |||
123 | #define READ_LOCK(l) read_lock_bh(l) | ||
124 | #define WRITE_LOCK(l) write_lock_bh(l) | ||
125 | #define READ_UNLOCK(l) read_unlock_bh(l) | ||
126 | #define WRITE_UNLOCK(l) write_unlock_bh(l) | ||
127 | #endif /*CONFIG_NETFILTER_DEBUG*/ | ||
128 | |||
129 | #endif /* _LOCKHELP_H */ | ||
diff --git a/include/linux/netlink.h b/include/linux/netlink.h index b2738ac8bc99..3029cad63a01 100644 --- a/include/linux/netlink.h +++ b/include/linux/netlink.h | |||
@@ -14,6 +14,7 @@ | |||
14 | #define NETLINK_SELINUX 7 /* SELinux event notifications */ | 14 | #define NETLINK_SELINUX 7 /* SELinux event notifications */ |
15 | #define NETLINK_ARPD 8 | 15 | #define NETLINK_ARPD 8 |
16 | #define NETLINK_AUDIT 9 /* auditing */ | 16 | #define NETLINK_AUDIT 9 /* auditing */ |
17 | #define NETLINK_FIB_LOOKUP 10 | ||
17 | #define NETLINK_ROUTE6 11 /* af_inet6 route comm channel */ | 18 | #define NETLINK_ROUTE6 11 /* af_inet6 route comm channel */ |
18 | #define NETLINK_IP6_FW 13 | 19 | #define NETLINK_IP6_FW 13 |
19 | #define NETLINK_DNRTMSG 14 /* DECnet routing messages */ | 20 | #define NETLINK_DNRTMSG 14 /* DECnet routing messages */ |
@@ -146,7 +147,7 @@ struct netlink_callback | |||
146 | int (*dump)(struct sk_buff * skb, struct netlink_callback *cb); | 147 | int (*dump)(struct sk_buff * skb, struct netlink_callback *cb); |
147 | int (*done)(struct netlink_callback *cb); | 148 | int (*done)(struct netlink_callback *cb); |
148 | int family; | 149 | int family; |
149 | long args[4]; | 150 | long args[5]; |
150 | }; | 151 | }; |
151 | 152 | ||
152 | struct netlink_notify | 153 | struct netlink_notify |
@@ -156,7 +157,7 @@ struct netlink_notify | |||
156 | }; | 157 | }; |
157 | 158 | ||
158 | static __inline__ struct nlmsghdr * | 159 | static __inline__ struct nlmsghdr * |
159 | __nlmsg_put(struct sk_buff *skb, u32 pid, u32 seq, int type, int len) | 160 | __nlmsg_put(struct sk_buff *skb, u32 pid, u32 seq, int type, int len, int flags) |
160 | { | 161 | { |
161 | struct nlmsghdr *nlh; | 162 | struct nlmsghdr *nlh; |
162 | int size = NLMSG_LENGTH(len); | 163 | int size = NLMSG_LENGTH(len); |
@@ -164,15 +165,31 @@ __nlmsg_put(struct sk_buff *skb, u32 pid, u32 seq, int type, int len) | |||
164 | nlh = (struct nlmsghdr*)skb_put(skb, NLMSG_ALIGN(size)); | 165 | nlh = (struct nlmsghdr*)skb_put(skb, NLMSG_ALIGN(size)); |
165 | nlh->nlmsg_type = type; | 166 | nlh->nlmsg_type = type; |
166 | nlh->nlmsg_len = size; | 167 | nlh->nlmsg_len = size; |
167 | nlh->nlmsg_flags = 0; | 168 | nlh->nlmsg_flags = flags; |
168 | nlh->nlmsg_pid = pid; | 169 | nlh->nlmsg_pid = pid; |
169 | nlh->nlmsg_seq = seq; | 170 | nlh->nlmsg_seq = seq; |
170 | return nlh; | 171 | return nlh; |
171 | } | 172 | } |
172 | 173 | ||
174 | #define NLMSG_NEW(skb, pid, seq, type, len, flags) \ | ||
175 | ({ if (skb_tailroom(skb) < (int)NLMSG_SPACE(len)) \ | ||
176 | goto nlmsg_failure; \ | ||
177 | __nlmsg_put(skb, pid, seq, type, len, flags); }) | ||
178 | |||
173 | #define NLMSG_PUT(skb, pid, seq, type, len) \ | 179 | #define NLMSG_PUT(skb, pid, seq, type, len) \ |
174 | ({ if (skb_tailroom(skb) < (int)NLMSG_SPACE(len)) goto nlmsg_failure; \ | 180 | NLMSG_NEW(skb, pid, seq, type, len, 0) |
175 | __nlmsg_put(skb, pid, seq, type, len); }) | 181 | |
182 | #define NLMSG_NEW_ANSWER(skb, cb, type, len, flags) \ | ||
183 | NLMSG_NEW(skb, NETLINK_CB((cb)->skb).pid, \ | ||
184 | (cb)->nlh->nlmsg_seq, type, len, flags) | ||
185 | |||
186 | #define NLMSG_END(skb, nlh) \ | ||
187 | ({ (nlh)->nlmsg_len = (skb)->tail - (unsigned char *) (nlh); \ | ||
188 | (skb)->len; }) | ||
189 | |||
190 | #define NLMSG_CANCEL(skb, nlh) \ | ||
191 | ({ skb_trim(skb, (unsigned char *) (nlh) - (skb)->data); \ | ||
192 | -1; }) | ||
176 | 193 | ||
177 | extern int netlink_dump_start(struct sock *ssk, struct sk_buff *skb, | 194 | extern int netlink_dump_start(struct sock *ssk, struct sk_buff *skb, |
178 | struct nlmsghdr *nlh, | 195 | struct nlmsghdr *nlh, |
diff --git a/include/linux/node.h b/include/linux/node.h index 6e0a697e594e..254dc3de650b 100644 --- a/include/linux/node.h +++ b/include/linux/node.h | |||
@@ -27,6 +27,7 @@ struct node { | |||
27 | }; | 27 | }; |
28 | 28 | ||
29 | extern int register_node(struct node *, int, struct node *); | 29 | extern int register_node(struct node *, int, struct node *); |
30 | extern void unregister_node(struct node *node); | ||
30 | 31 | ||
31 | #define to_node(sys_device) container_of(sys_device, struct node, sysdev) | 32 | #define to_node(sys_device) container_of(sys_device, struct node, sysdev) |
32 | 33 | ||
diff --git a/include/linux/notifier.h b/include/linux/notifier.h index 9303a003e9ab..5937dd6053c3 100644 --- a/include/linux/notifier.h +++ b/include/linux/notifier.h | |||
@@ -56,6 +56,7 @@ extern int notifier_call_chain(struct notifier_block **n, unsigned long val, voi | |||
56 | #define NETDEV_CHANGEADDR 0x0008 | 56 | #define NETDEV_CHANGEADDR 0x0008 |
57 | #define NETDEV_GOING_DOWN 0x0009 | 57 | #define NETDEV_GOING_DOWN 0x0009 |
58 | #define NETDEV_CHANGENAME 0x000A | 58 | #define NETDEV_CHANGENAME 0x000A |
59 | #define NETDEV_FEAT_CHANGE 0x000B | ||
59 | 60 | ||
60 | #define SYS_DOWN 0x0001 /* Notify of system down */ | 61 | #define SYS_DOWN 0x0001 /* Notify of system down */ |
61 | #define SYS_RESTART SYS_DOWN | 62 | #define SYS_RESTART SYS_DOWN |
diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h index 39ab8c6b5652..f5a6695d4d21 100644 --- a/include/linux/page-flags.h +++ b/include/linux/page-flags.h | |||
@@ -61,21 +61,20 @@ | |||
61 | #define PG_active 6 | 61 | #define PG_active 6 |
62 | #define PG_slab 7 /* slab debug (Suparna wants this) */ | 62 | #define PG_slab 7 /* slab debug (Suparna wants this) */ |
63 | 63 | ||
64 | #define PG_highmem 8 | 64 | #define PG_checked 8 /* kill me in 2.5.<early>. */ |
65 | #define PG_checked 9 /* kill me in 2.5.<early>. */ | 65 | #define PG_arch_1 9 |
66 | #define PG_arch_1 10 | 66 | #define PG_reserved 10 |
67 | #define PG_reserved 11 | 67 | #define PG_private 11 /* Has something at ->private */ |
68 | 68 | ||
69 | #define PG_private 12 /* Has something at ->private */ | 69 | #define PG_writeback 12 /* Page is under writeback */ |
70 | #define PG_writeback 13 /* Page is under writeback */ | 70 | #define PG_nosave 13 /* Used for system suspend/resume */ |
71 | #define PG_nosave 14 /* Used for system suspend/resume */ | 71 | #define PG_compound 14 /* Part of a compound page */ |
72 | #define PG_compound 15 /* Part of a compound page */ | 72 | #define PG_swapcache 15 /* Swap page: swp_entry_t in private */ |
73 | 73 | ||
74 | #define PG_swapcache 16 /* Swap page: swp_entry_t in private */ | 74 | #define PG_mappedtodisk 16 /* Has blocks allocated on-disk */ |
75 | #define PG_mappedtodisk 17 /* Has blocks allocated on-disk */ | 75 | #define PG_reclaim 17 /* To be reclaimed asap */ |
76 | #define PG_reclaim 18 /* To be reclaimed asap */ | 76 | #define PG_nosave_free 18 /* Free, should not be written */ |
77 | #define PG_nosave_free 19 /* Free, should not be written */ | 77 | #define PG_uncached 19 /* Page has been mapped as uncached */ |
78 | #define PG_uncached 20 /* Page has been mapped as uncached */ | ||
79 | 78 | ||
80 | /* | 79 | /* |
81 | * Global page accounting. One instance per CPU. Only unsigned longs are | 80 | * Global page accounting. One instance per CPU. Only unsigned longs are |
@@ -136,8 +135,8 @@ struct page_state { | |||
136 | 135 | ||
137 | extern void get_page_state(struct page_state *ret); | 136 | extern void get_page_state(struct page_state *ret); |
138 | extern void get_full_page_state(struct page_state *ret); | 137 | extern void get_full_page_state(struct page_state *ret); |
139 | extern unsigned long __read_page_state(unsigned offset); | 138 | extern unsigned long __read_page_state(unsigned long offset); |
140 | extern void __mod_page_state(unsigned offset, unsigned long delta); | 139 | extern void __mod_page_state(unsigned long offset, unsigned long delta); |
141 | 140 | ||
142 | #define read_page_state(member) \ | 141 | #define read_page_state(member) \ |
143 | __read_page_state(offsetof(struct page_state, member)) | 142 | __read_page_state(offsetof(struct page_state, member)) |
@@ -215,7 +214,7 @@ extern void __mod_page_state(unsigned offset, unsigned long delta); | |||
215 | #define TestSetPageSlab(page) test_and_set_bit(PG_slab, &(page)->flags) | 214 | #define TestSetPageSlab(page) test_and_set_bit(PG_slab, &(page)->flags) |
216 | 215 | ||
217 | #ifdef CONFIG_HIGHMEM | 216 | #ifdef CONFIG_HIGHMEM |
218 | #define PageHighMem(page) test_bit(PG_highmem, &(page)->flags) | 217 | #define PageHighMem(page) is_highmem(page_zone(page)) |
219 | #else | 218 | #else |
220 | #define PageHighMem(page) 0 /* needed to optimize away at compile time */ | 219 | #define PageHighMem(page) 0 /* needed to optimize away at compile time */ |
221 | #endif | 220 | #endif |
diff --git a/include/linux/pagemap.h b/include/linux/pagemap.h index 0422031161ba..d9a25647a295 100644 --- a/include/linux/pagemap.h +++ b/include/linux/pagemap.h | |||
@@ -52,12 +52,12 @@ void release_pages(struct page **pages, int nr, int cold); | |||
52 | 52 | ||
53 | static inline struct page *page_cache_alloc(struct address_space *x) | 53 | static inline struct page *page_cache_alloc(struct address_space *x) |
54 | { | 54 | { |
55 | return alloc_pages(mapping_gfp_mask(x), 0); | 55 | return alloc_pages(mapping_gfp_mask(x)|__GFP_NORECLAIM, 0); |
56 | } | 56 | } |
57 | 57 | ||
58 | static inline struct page *page_cache_alloc_cold(struct address_space *x) | 58 | static inline struct page *page_cache_alloc_cold(struct address_space *x) |
59 | { | 59 | { |
60 | return alloc_pages(mapping_gfp_mask(x)|__GFP_COLD, 0); | 60 | return alloc_pages(mapping_gfp_mask(x)|__GFP_COLD|__GFP_NORECLAIM, 0); |
61 | } | 61 | } |
62 | 62 | ||
63 | typedef int filler_t(void *, struct page *); | 63 | typedef int filler_t(void *, struct page *); |
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h index ae27792b5aa4..63e89e47b8e9 100644 --- a/include/linux/pci_ids.h +++ b/include/linux/pci_ids.h | |||
@@ -575,6 +575,7 @@ | |||
575 | #define PCI_DEVICE_ID_CT_65550 0x00e0 | 575 | #define PCI_DEVICE_ID_CT_65550 0x00e0 |
576 | #define PCI_DEVICE_ID_CT_65554 0x00e4 | 576 | #define PCI_DEVICE_ID_CT_65554 0x00e4 |
577 | #define PCI_DEVICE_ID_CT_65555 0x00e5 | 577 | #define PCI_DEVICE_ID_CT_65555 0x00e5 |
578 | #define PCI_DEVICE_ID_CT_69000 0x00c0 | ||
578 | 579 | ||
579 | #define PCI_VENDOR_ID_MIRO 0x1031 | 580 | #define PCI_VENDOR_ID_MIRO 0x1031 |
580 | #define PCI_DEVICE_ID_MIRO_36050 0x5601 | 581 | #define PCI_DEVICE_ID_MIRO_36050 0x5601 |
@@ -874,6 +875,7 @@ | |||
874 | #define PCI_DEVICE_ID_APPLE_KL_USB_P 0x0026 | 875 | #define PCI_DEVICE_ID_APPLE_KL_USB_P 0x0026 |
875 | #define PCI_DEVICE_ID_APPLE_UNI_N_AGP_P 0x0027 | 876 | #define PCI_DEVICE_ID_APPLE_UNI_N_AGP_P 0x0027 |
876 | #define PCI_DEVICE_ID_APPLE_UNI_N_AGP15 0x002d | 877 | #define PCI_DEVICE_ID_APPLE_UNI_N_AGP15 0x002d |
878 | #define PCI_DEVICE_ID_APPLE_UNI_N_PCI15 0x002e | ||
877 | #define PCI_DEVICE_ID_APPLE_UNI_N_FW2 0x0030 | 879 | #define PCI_DEVICE_ID_APPLE_UNI_N_FW2 0x0030 |
878 | #define PCI_DEVICE_ID_APPLE_UNI_N_GMAC2 0x0032 | 880 | #define PCI_DEVICE_ID_APPLE_UNI_N_GMAC2 0x0032 |
879 | #define PCI_DEVIEC_ID_APPLE_UNI_N_ATA 0x0033 | 881 | #define PCI_DEVIEC_ID_APPLE_UNI_N_ATA 0x0033 |
@@ -1230,6 +1232,12 @@ | |||
1230 | #define PCI_DEVICE_ID_NVIDIA_QUADRO4_900XGL 0x0258 | 1232 | #define PCI_DEVICE_ID_NVIDIA_QUADRO4_900XGL 0x0258 |
1231 | #define PCI_DEVICE_ID_NVIDIA_QUADRO4_750XGL 0x0259 | 1233 | #define PCI_DEVICE_ID_NVIDIA_QUADRO4_750XGL 0x0259 |
1232 | #define PCI_DEVICE_ID_NVIDIA_QUADRO4_700XGL 0x025B | 1234 | #define PCI_DEVICE_ID_NVIDIA_QUADRO4_700XGL 0x025B |
1235 | #define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP51_IDE 0x0265 | ||
1236 | #define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP51_SATA 0x0266 | ||
1237 | #define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP51_SATA2 0x0267 | ||
1238 | #define PCI_DEVICE_ID_NVIDIA_NVENET_12 0x0268 | ||
1239 | #define PCI_DEVICE_ID_NVIDIA_NVENET_13 0x0269 | ||
1240 | #define PCI_DEVICE_ID_NVIDIA_MCP51_AUDIO 0x026B | ||
1233 | #define PCI_DEVICE_ID_NVIDIA_GEFORCE4_TI_4800 0x0280 | 1241 | #define PCI_DEVICE_ID_NVIDIA_GEFORCE4_TI_4800 0x0280 |
1234 | #define PCI_DEVICE_ID_NVIDIA_GEFORCE4_TI_4800_8X 0x0281 | 1242 | #define PCI_DEVICE_ID_NVIDIA_GEFORCE4_TI_4800_8X 0x0281 |
1235 | #define PCI_DEVICE_ID_NVIDIA_GEFORCE4_TI_4800SE 0x0282 | 1243 | #define PCI_DEVICE_ID_NVIDIA_GEFORCE4_TI_4800SE 0x0282 |
@@ -2064,12 +2072,14 @@ | |||
2064 | 2072 | ||
2065 | #define PCI_VENDOR_ID_BROADCOM 0x14e4 | 2073 | #define PCI_VENDOR_ID_BROADCOM 0x14e4 |
2066 | #define PCI_DEVICE_ID_TIGON3_5752 0x1600 | 2074 | #define PCI_DEVICE_ID_TIGON3_5752 0x1600 |
2075 | #define PCI_DEVICE_ID_TIGON3_5752M 0x1601 | ||
2067 | #define PCI_DEVICE_ID_TIGON3_5700 0x1644 | 2076 | #define PCI_DEVICE_ID_TIGON3_5700 0x1644 |
2068 | #define PCI_DEVICE_ID_TIGON3_5701 0x1645 | 2077 | #define PCI_DEVICE_ID_TIGON3_5701 0x1645 |
2069 | #define PCI_DEVICE_ID_TIGON3_5702 0x1646 | 2078 | #define PCI_DEVICE_ID_TIGON3_5702 0x1646 |
2070 | #define PCI_DEVICE_ID_TIGON3_5703 0x1647 | 2079 | #define PCI_DEVICE_ID_TIGON3_5703 0x1647 |
2071 | #define PCI_DEVICE_ID_TIGON3_5704 0x1648 | 2080 | #define PCI_DEVICE_ID_TIGON3_5704 0x1648 |
2072 | #define PCI_DEVICE_ID_TIGON3_5704S_2 0x1649 | 2081 | #define PCI_DEVICE_ID_TIGON3_5704S_2 0x1649 |
2082 | #define PCI_DEVICE_ID_NX2_5706 0x164a | ||
2073 | #define PCI_DEVICE_ID_TIGON3_5702FE 0x164d | 2083 | #define PCI_DEVICE_ID_TIGON3_5702FE 0x164d |
2074 | #define PCI_DEVICE_ID_TIGON3_5705 0x1653 | 2084 | #define PCI_DEVICE_ID_TIGON3_5705 0x1653 |
2075 | #define PCI_DEVICE_ID_TIGON3_5705_2 0x1654 | 2085 | #define PCI_DEVICE_ID_TIGON3_5705_2 0x1654 |
@@ -2089,6 +2099,7 @@ | |||
2089 | #define PCI_DEVICE_ID_TIGON3_5702X 0x16a6 | 2099 | #define PCI_DEVICE_ID_TIGON3_5702X 0x16a6 |
2090 | #define PCI_DEVICE_ID_TIGON3_5703X 0x16a7 | 2100 | #define PCI_DEVICE_ID_TIGON3_5703X 0x16a7 |
2091 | #define PCI_DEVICE_ID_TIGON3_5704S 0x16a8 | 2101 | #define PCI_DEVICE_ID_TIGON3_5704S 0x16a8 |
2102 | #define PCI_DEVICE_ID_NX2_5706S 0x16aa | ||
2092 | #define PCI_DEVICE_ID_TIGON3_5702A3 0x16c6 | 2103 | #define PCI_DEVICE_ID_TIGON3_5702A3 0x16c6 |
2093 | #define PCI_DEVICE_ID_TIGON3_5703A3 0x16c7 | 2104 | #define PCI_DEVICE_ID_TIGON3_5703A3 0x16c7 |
2094 | #define PCI_DEVICE_ID_TIGON3_5781 0x16dd | 2105 | #define PCI_DEVICE_ID_TIGON3_5781 0x16dd |
@@ -2373,6 +2384,8 @@ | |||
2373 | #define PCI_DEVICE_ID_INTEL_82915G_IG 0x2582 | 2384 | #define PCI_DEVICE_ID_INTEL_82915G_IG 0x2582 |
2374 | #define PCI_DEVICE_ID_INTEL_82915GM_HB 0x2590 | 2385 | #define PCI_DEVICE_ID_INTEL_82915GM_HB 0x2590 |
2375 | #define PCI_DEVICE_ID_INTEL_82915GM_IG 0x2592 | 2386 | #define PCI_DEVICE_ID_INTEL_82915GM_IG 0x2592 |
2387 | #define PCI_DEVICE_ID_INTEL_82945G_HB 0x2770 | ||
2388 | #define PCI_DEVICE_ID_INTEL_82945G_IG 0x2772 | ||
2376 | #define PCI_DEVICE_ID_INTEL_ICH6_0 0x2640 | 2389 | #define PCI_DEVICE_ID_INTEL_ICH6_0 0x2640 |
2377 | #define PCI_DEVICE_ID_INTEL_ICH6_1 0x2641 | 2390 | #define PCI_DEVICE_ID_INTEL_ICH6_1 0x2641 |
2378 | #define PCI_DEVICE_ID_INTEL_ICH6_2 0x2642 | 2391 | #define PCI_DEVICE_ID_INTEL_ICH6_2 0x2642 |
diff --git a/include/linux/pfkeyv2.h b/include/linux/pfkeyv2.h index e6b519220245..724066778aff 100644 --- a/include/linux/pfkeyv2.h +++ b/include/linux/pfkeyv2.h | |||
@@ -245,6 +245,7 @@ struct sadb_x_nat_t_port { | |||
245 | 245 | ||
246 | /* Security Association flags */ | 246 | /* Security Association flags */ |
247 | #define SADB_SAFLAGS_PFS 1 | 247 | #define SADB_SAFLAGS_PFS 1 |
248 | #define SADB_SAFLAGS_NOPMTUDISC 0x20000000 | ||
248 | #define SADB_SAFLAGS_DECAP_DSCP 0x40000000 | 249 | #define SADB_SAFLAGS_DECAP_DSCP 0x40000000 |
249 | #define SADB_SAFLAGS_NOECN 0x80000000 | 250 | #define SADB_SAFLAGS_NOECN 0x80000000 |
250 | 251 | ||
diff --git a/include/linux/pkt_sched.h b/include/linux/pkt_sched.h index 73d84c071cb1..1d9da36eb9db 100644 --- a/include/linux/pkt_sched.h +++ b/include/linux/pkt_sched.h | |||
@@ -427,6 +427,7 @@ enum | |||
427 | TCA_NETEM_UNSPEC, | 427 | TCA_NETEM_UNSPEC, |
428 | TCA_NETEM_CORR, | 428 | TCA_NETEM_CORR, |
429 | TCA_NETEM_DELAY_DIST, | 429 | TCA_NETEM_DELAY_DIST, |
430 | TCA_NETEM_REORDER, | ||
430 | __TCA_NETEM_MAX, | 431 | __TCA_NETEM_MAX, |
431 | }; | 432 | }; |
432 | 433 | ||
@@ -437,7 +438,7 @@ struct tc_netem_qopt | |||
437 | __u32 latency; /* added delay (us) */ | 438 | __u32 latency; /* added delay (us) */ |
438 | __u32 limit; /* fifo limit (packets) */ | 439 | __u32 limit; /* fifo limit (packets) */ |
439 | __u32 loss; /* random packet loss (0=none ~0=100%) */ | 440 | __u32 loss; /* random packet loss (0=none ~0=100%) */ |
440 | __u32 gap; /* re-ordering gap (0 for delay all) */ | 441 | __u32 gap; /* re-ordering gap (0 for none) */ |
441 | __u32 duplicate; /* random packet dup (0=none ~0=100%) */ | 442 | __u32 duplicate; /* random packet dup (0=none ~0=100%) */ |
442 | __u32 jitter; /* random jitter in latency (us) */ | 443 | __u32 jitter; /* random jitter in latency (us) */ |
443 | }; | 444 | }; |
@@ -449,6 +450,12 @@ struct tc_netem_corr | |||
449 | __u32 dup_corr; /* duplicate correlation */ | 450 | __u32 dup_corr; /* duplicate correlation */ |
450 | }; | 451 | }; |
451 | 452 | ||
453 | struct tc_netem_reorder | ||
454 | { | ||
455 | __u32 probability; | ||
456 | __u32 correlation; | ||
457 | }; | ||
458 | |||
452 | #define NETEM_DIST_SCALE 8192 | 459 | #define NETEM_DIST_SCALE 8192 |
453 | 460 | ||
454 | #endif | 461 | #endif |
diff --git a/include/linux/raid/bitmap.h b/include/linux/raid/bitmap.h new file mode 100644 index 000000000000..e24b74b11150 --- /dev/null +++ b/include/linux/raid/bitmap.h | |||
@@ -0,0 +1,273 @@ | |||
1 | /* | ||
2 | * bitmap.h: Copyright (C) Peter T. Breuer (ptb@ot.uc3m.es) 2003 | ||
3 | * | ||
4 | * additions: Copyright (C) 2003-2004, Paul Clements, SteelEye Technology, Inc. | ||
5 | */ | ||
6 | #ifndef BITMAP_H | ||
7 | #define BITMAP_H 1 | ||
8 | |||
9 | #define BITMAP_MAJOR 3 | ||
10 | #define BITMAP_MINOR 38 | ||
11 | |||
12 | /* | ||
13 | * in-memory bitmap: | ||
14 | * | ||
15 | * Use 16 bit block counters to track pending writes to each "chunk". | ||
16 | * The 2 high order bits are special-purpose, the first is a flag indicating | ||
17 | * whether a resync is needed. The second is a flag indicating whether a | ||
18 | * resync is active. | ||
19 | * This means that the counter is actually 14 bits: | ||
20 | * | ||
21 | * +--------+--------+------------------------------------------------+ | ||
22 | * | resync | resync | counter | | ||
23 | * | needed | active | | | ||
24 | * | (0-1) | (0-1) | (0-16383) | | ||
25 | * +--------+--------+------------------------------------------------+ | ||
26 | * | ||
27 | * The "resync needed" bit is set when: | ||
28 | * a '1' bit is read from storage at startup. | ||
29 | * a write request fails on some drives | ||
30 | * a resync is aborted on a chunk with 'resync active' set | ||
31 | * It is cleared (and resync-active set) when a resync starts across all drives | ||
32 | * of the chunk. | ||
33 | * | ||
34 | * | ||
35 | * The "resync active" bit is set when: | ||
36 | * a resync is started on all drives, and resync_needed is set. | ||
37 | * resync_needed will be cleared (as long as resync_active wasn't already set). | ||
38 | * It is cleared when a resync completes. | ||
39 | * | ||
40 | * The counter counts pending write requests, plus the on-disk bit. | ||
41 | * When the counter is '1' and the resync bits are clear, the on-disk | ||
42 | * bit can be cleared aswell, thus setting the counter to 0. | ||
43 | * When we set a bit, or in the counter (to start a write), if the fields is | ||
44 | * 0, we first set the disk bit and set the counter to 1. | ||
45 | * | ||
46 | * If the counter is 0, the on-disk bit is clear and the stipe is clean | ||
47 | * Anything that dirties the stipe pushes the counter to 2 (at least) | ||
48 | * and sets the on-disk bit (lazily). | ||
49 | * If a periodic sweep find the counter at 2, it is decremented to 1. | ||
50 | * If the sweep find the counter at 1, the on-disk bit is cleared and the | ||
51 | * counter goes to zero. | ||
52 | * | ||
53 | * Also, we'll hijack the "map" pointer itself and use it as two 16 bit block | ||
54 | * counters as a fallback when "page" memory cannot be allocated: | ||
55 | * | ||
56 | * Normal case (page memory allocated): | ||
57 | * | ||
58 | * page pointer (32-bit) | ||
59 | * | ||
60 | * [ ] ------+ | ||
61 | * | | ||
62 | * +-------> [ ][ ]..[ ] (4096 byte page == 2048 counters) | ||
63 | * c1 c2 c2048 | ||
64 | * | ||
65 | * Hijacked case (page memory allocation failed): | ||
66 | * | ||
67 | * hijacked page pointer (32-bit) | ||
68 | * | ||
69 | * [ ][ ] (no page memory allocated) | ||
70 | * counter #1 (16-bit) counter #2 (16-bit) | ||
71 | * | ||
72 | */ | ||
73 | |||
74 | #ifdef __KERNEL__ | ||
75 | |||
76 | #define PAGE_BITS (PAGE_SIZE << 3) | ||
77 | #define PAGE_BIT_SHIFT (PAGE_SHIFT + 3) | ||
78 | |||
79 | typedef __u16 bitmap_counter_t; | ||
80 | #define COUNTER_BITS 16 | ||
81 | #define COUNTER_BIT_SHIFT 4 | ||
82 | #define COUNTER_BYTE_RATIO (COUNTER_BITS / 8) | ||
83 | #define COUNTER_BYTE_SHIFT (COUNTER_BIT_SHIFT - 3) | ||
84 | |||
85 | #define NEEDED_MASK ((bitmap_counter_t) (1 << (COUNTER_BITS - 1))) | ||
86 | #define RESYNC_MASK ((bitmap_counter_t) (1 << (COUNTER_BITS - 2))) | ||
87 | #define COUNTER_MAX ((bitmap_counter_t) RESYNC_MASK - 1) | ||
88 | #define NEEDED(x) (((bitmap_counter_t) x) & NEEDED_MASK) | ||
89 | #define RESYNC(x) (((bitmap_counter_t) x) & RESYNC_MASK) | ||
90 | #define COUNTER(x) (((bitmap_counter_t) x) & COUNTER_MAX) | ||
91 | |||
92 | /* how many counters per page? */ | ||
93 | #define PAGE_COUNTER_RATIO (PAGE_BITS / COUNTER_BITS) | ||
94 | /* same, except a shift value for more efficient bitops */ | ||
95 | #define PAGE_COUNTER_SHIFT (PAGE_BIT_SHIFT - COUNTER_BIT_SHIFT) | ||
96 | /* same, except a mask value for more efficient bitops */ | ||
97 | #define PAGE_COUNTER_MASK (PAGE_COUNTER_RATIO - 1) | ||
98 | |||
99 | #define BITMAP_BLOCK_SIZE 512 | ||
100 | #define BITMAP_BLOCK_SHIFT 9 | ||
101 | |||
102 | /* how many blocks per chunk? (this is variable) */ | ||
103 | #define CHUNK_BLOCK_RATIO(bitmap) ((bitmap)->chunksize >> BITMAP_BLOCK_SHIFT) | ||
104 | #define CHUNK_BLOCK_SHIFT(bitmap) ((bitmap)->chunkshift - BITMAP_BLOCK_SHIFT) | ||
105 | #define CHUNK_BLOCK_MASK(bitmap) (CHUNK_BLOCK_RATIO(bitmap) - 1) | ||
106 | |||
107 | /* when hijacked, the counters and bits represent even larger "chunks" */ | ||
108 | /* there will be 1024 chunks represented by each counter in the page pointers */ | ||
109 | #define PAGEPTR_BLOCK_RATIO(bitmap) \ | ||
110 | (CHUNK_BLOCK_RATIO(bitmap) << PAGE_COUNTER_SHIFT >> 1) | ||
111 | #define PAGEPTR_BLOCK_SHIFT(bitmap) \ | ||
112 | (CHUNK_BLOCK_SHIFT(bitmap) + PAGE_COUNTER_SHIFT - 1) | ||
113 | #define PAGEPTR_BLOCK_MASK(bitmap) (PAGEPTR_BLOCK_RATIO(bitmap) - 1) | ||
114 | |||
115 | /* | ||
116 | * on-disk bitmap: | ||
117 | * | ||
118 | * Use one bit per "chunk" (block set). We do the disk I/O on the bitmap | ||
119 | * file a page at a time. There's a superblock at the start of the file. | ||
120 | */ | ||
121 | |||
122 | /* map chunks (bits) to file pages - offset by the size of the superblock */ | ||
123 | #define CHUNK_BIT_OFFSET(chunk) ((chunk) + (sizeof(bitmap_super_t) << 3)) | ||
124 | |||
125 | #endif | ||
126 | |||
127 | /* | ||
128 | * bitmap structures: | ||
129 | */ | ||
130 | |||
131 | #define BITMAP_MAGIC 0x6d746962 | ||
132 | |||
133 | /* use these for bitmap->flags and bitmap->sb->state bit-fields */ | ||
134 | enum bitmap_state { | ||
135 | BITMAP_ACTIVE = 0x001, /* the bitmap is in use */ | ||
136 | BITMAP_STALE = 0x002 /* the bitmap file is out of date or had -EIO */ | ||
137 | }; | ||
138 | |||
139 | /* the superblock at the front of the bitmap file -- little endian */ | ||
140 | typedef struct bitmap_super_s { | ||
141 | __u32 magic; /* 0 BITMAP_MAGIC */ | ||
142 | __u32 version; /* 4 the bitmap major for now, could change... */ | ||
143 | __u8 uuid[16]; /* 8 128 bit uuid - must match md device uuid */ | ||
144 | __u64 events; /* 24 event counter for the bitmap (1)*/ | ||
145 | __u64 events_cleared;/*32 event counter when last bit cleared (2) */ | ||
146 | __u64 sync_size; /* 40 the size of the md device's sync range(3) */ | ||
147 | __u32 state; /* 48 bitmap state information */ | ||
148 | __u32 chunksize; /* 52 the bitmap chunk size in bytes */ | ||
149 | __u32 daemon_sleep; /* 56 seconds between disk flushes */ | ||
150 | |||
151 | __u8 pad[256 - 60]; /* set to zero */ | ||
152 | } bitmap_super_t; | ||
153 | |||
154 | /* notes: | ||
155 | * (1) This event counter is updated before the eventcounter in the md superblock | ||
156 | * When a bitmap is loaded, it is only accepted if this event counter is equal | ||
157 | * to, or one greater than, the event counter in the superblock. | ||
158 | * (2) This event counter is updated when the other one is *if*and*only*if* the | ||
159 | * array is not degraded. As bits are not cleared when the array is degraded, | ||
160 | * this represents the last time that any bits were cleared. | ||
161 | * If a device is being added that has an event count with this value or | ||
162 | * higher, it is accepted as conforming to the bitmap. | ||
163 | * (3)This is the number of sectors represented by the bitmap, and is the range that | ||
164 | * resync happens across. For raid1 and raid5/6 it is the size of individual | ||
165 | * devices. For raid10 it is the size of the array. | ||
166 | */ | ||
167 | |||
168 | #ifdef __KERNEL__ | ||
169 | |||
170 | /* the in-memory bitmap is represented by bitmap_pages */ | ||
171 | struct bitmap_page { | ||
172 | /* | ||
173 | * map points to the actual memory page | ||
174 | */ | ||
175 | char *map; | ||
176 | /* | ||
177 | * in emergencies (when map cannot be alloced), hijack the map | ||
178 | * pointer and use it as two counters itself | ||
179 | */ | ||
180 | unsigned int hijacked:1; | ||
181 | /* | ||
182 | * count of dirty bits on the page | ||
183 | */ | ||
184 | unsigned int count:31; | ||
185 | }; | ||
186 | |||
187 | /* keep track of bitmap file pages that have pending writes on them */ | ||
188 | struct page_list { | ||
189 | struct list_head list; | ||
190 | struct page *page; | ||
191 | }; | ||
192 | |||
193 | /* the main bitmap structure - one per mddev */ | ||
194 | struct bitmap { | ||
195 | struct bitmap_page *bp; | ||
196 | unsigned long pages; /* total number of pages in the bitmap */ | ||
197 | unsigned long missing_pages; /* number of pages not yet allocated */ | ||
198 | |||
199 | mddev_t *mddev; /* the md device that the bitmap is for */ | ||
200 | |||
201 | int counter_bits; /* how many bits per block counter */ | ||
202 | |||
203 | /* bitmap chunksize -- how much data does each bit represent? */ | ||
204 | unsigned long chunksize; | ||
205 | unsigned long chunkshift; /* chunksize = 2^chunkshift (for bitops) */ | ||
206 | unsigned long chunks; /* total number of data chunks for the array */ | ||
207 | |||
208 | /* We hold a count on the chunk currently being synced, and drop | ||
209 | * it when the last block is started. If the resync is aborted | ||
210 | * midway, we need to be able to drop that count, so we remember | ||
211 | * the counted chunk.. | ||
212 | */ | ||
213 | unsigned long syncchunk; | ||
214 | |||
215 | __u64 events_cleared; | ||
216 | |||
217 | /* bitmap spinlock */ | ||
218 | spinlock_t lock; | ||
219 | |||
220 | long offset; /* offset from superblock if file is NULL */ | ||
221 | struct file *file; /* backing disk file */ | ||
222 | struct page *sb_page; /* cached copy of the bitmap file superblock */ | ||
223 | struct page **filemap; /* list of cache pages for the file */ | ||
224 | unsigned long *filemap_attr; /* attributes associated w/ filemap pages */ | ||
225 | unsigned long file_pages; /* number of pages in the file */ | ||
226 | |||
227 | unsigned long flags; | ||
228 | |||
229 | /* | ||
230 | * the bitmap daemon - periodically wakes up and sweeps the bitmap | ||
231 | * file, cleaning up bits and flushing out pages to disk as necessary | ||
232 | */ | ||
233 | unsigned long daemon_lastrun; /* jiffies of last run */ | ||
234 | unsigned long daemon_sleep; /* how many seconds between updates? */ | ||
235 | |||
236 | /* | ||
237 | * bitmap_writeback_daemon waits for file-pages that have been written, | ||
238 | * as there is no way to get a call-back when a page write completes. | ||
239 | */ | ||
240 | mdk_thread_t *writeback_daemon; | ||
241 | spinlock_t write_lock; | ||
242 | wait_queue_head_t write_wait; | ||
243 | struct list_head complete_pages; | ||
244 | mempool_t *write_pool; | ||
245 | }; | ||
246 | |||
247 | /* the bitmap API */ | ||
248 | |||
249 | /* these are used only by md/bitmap */ | ||
250 | int bitmap_create(mddev_t *mddev); | ||
251 | void bitmap_destroy(mddev_t *mddev); | ||
252 | int bitmap_active(struct bitmap *bitmap); | ||
253 | |||
254 | char *file_path(struct file *file, char *buf, int count); | ||
255 | void bitmap_print_sb(struct bitmap *bitmap); | ||
256 | int bitmap_update_sb(struct bitmap *bitmap); | ||
257 | |||
258 | int bitmap_setallbits(struct bitmap *bitmap); | ||
259 | void bitmap_write_all(struct bitmap *bitmap); | ||
260 | |||
261 | /* these are exported */ | ||
262 | int bitmap_startwrite(struct bitmap *bitmap, sector_t offset, unsigned long sectors); | ||
263 | void bitmap_endwrite(struct bitmap *bitmap, sector_t offset, unsigned long sectors, | ||
264 | int success); | ||
265 | int bitmap_start_sync(struct bitmap *bitmap, sector_t offset, int *blocks); | ||
266 | void bitmap_end_sync(struct bitmap *bitmap, sector_t offset, int *blocks, int aborted); | ||
267 | void bitmap_close_sync(struct bitmap *bitmap); | ||
268 | |||
269 | int bitmap_unplug(struct bitmap *bitmap); | ||
270 | int bitmap_daemon_work(struct bitmap *bitmap); | ||
271 | #endif | ||
272 | |||
273 | #endif | ||
diff --git a/include/linux/raid/md.h b/include/linux/raid/md.h index a6a67d102bfa..ffa316ce4dc8 100644 --- a/include/linux/raid/md.h +++ b/include/linux/raid/md.h | |||
@@ -60,7 +60,14 @@ | |||
60 | */ | 60 | */ |
61 | #define MD_MAJOR_VERSION 0 | 61 | #define MD_MAJOR_VERSION 0 |
62 | #define MD_MINOR_VERSION 90 | 62 | #define MD_MINOR_VERSION 90 |
63 | #define MD_PATCHLEVEL_VERSION 1 | 63 | /* |
64 | * MD_PATCHLEVEL_VERSION indicates kernel functionality. | ||
65 | * >=1 means different superblock formats are selectable using SET_ARRAY_INFO | ||
66 | * and major_version/minor_version accordingly | ||
67 | * >=2 means that Internal bitmaps are supported by setting MD_SB_BITMAP_PRESENT | ||
68 | * in the super status byte | ||
69 | */ | ||
70 | #define MD_PATCHLEVEL_VERSION 2 | ||
64 | 71 | ||
65 | extern int register_md_personality (int p_num, mdk_personality_t *p); | 72 | extern int register_md_personality (int p_num, mdk_personality_t *p); |
66 | extern int unregister_md_personality (int p_num); | 73 | extern int unregister_md_personality (int p_num); |
@@ -69,7 +76,7 @@ extern mdk_thread_t * md_register_thread (void (*run) (mddev_t *mddev), | |||
69 | extern void md_unregister_thread (mdk_thread_t *thread); | 76 | extern void md_unregister_thread (mdk_thread_t *thread); |
70 | extern void md_wakeup_thread(mdk_thread_t *thread); | 77 | extern void md_wakeup_thread(mdk_thread_t *thread); |
71 | extern void md_check_recovery(mddev_t *mddev); | 78 | extern void md_check_recovery(mddev_t *mddev); |
72 | extern void md_write_start(mddev_t *mddev); | 79 | extern void md_write_start(mddev_t *mddev, struct bio *bi); |
73 | extern void md_write_end(mddev_t *mddev); | 80 | extern void md_write_end(mddev_t *mddev); |
74 | extern void md_handle_safemode(mddev_t *mddev); | 81 | extern void md_handle_safemode(mddev_t *mddev); |
75 | extern void md_done_sync(mddev_t *mddev, int blocks, int ok); | 82 | extern void md_done_sync(mddev_t *mddev, int blocks, int ok); |
@@ -78,6 +85,12 @@ extern void md_unplug_mddev(mddev_t *mddev); | |||
78 | 85 | ||
79 | extern void md_print_devices (void); | 86 | extern void md_print_devices (void); |
80 | 87 | ||
88 | extern void md_super_write(mddev_t *mddev, mdk_rdev_t *rdev, | ||
89 | sector_t sector, int size, struct page *page); | ||
90 | extern int sync_page_io(struct block_device *bdev, sector_t sector, int size, | ||
91 | struct page *page, int rw); | ||
92 | |||
93 | |||
81 | #define MD_BUG(x...) { printk("md: bug in file %s, line %d\n", __FILE__, __LINE__); md_print_devices(); } | 94 | #define MD_BUG(x...) { printk("md: bug in file %s, line %d\n", __FILE__, __LINE__); md_print_devices(); } |
82 | 95 | ||
83 | #endif | 96 | #endif |
diff --git a/include/linux/raid/md_k.h b/include/linux/raid/md_k.h index c9a0d4013be7..8c14ba565a45 100644 --- a/include/linux/raid/md_k.h +++ b/include/linux/raid/md_k.h | |||
@@ -15,6 +15,9 @@ | |||
15 | #ifndef _MD_K_H | 15 | #ifndef _MD_K_H |
16 | #define _MD_K_H | 16 | #define _MD_K_H |
17 | 17 | ||
18 | /* and dm-bio-list.h is not under include/linux because.... ??? */ | ||
19 | #include "../../../drivers/md/dm-bio-list.h" | ||
20 | |||
18 | #define MD_RESERVED 0UL | 21 | #define MD_RESERVED 0UL |
19 | #define LINEAR 1UL | 22 | #define LINEAR 1UL |
20 | #define RAID0 2UL | 23 | #define RAID0 2UL |
@@ -180,6 +183,10 @@ struct mdk_rdev_s | |||
180 | 183 | ||
181 | int desc_nr; /* descriptor index in the superblock */ | 184 | int desc_nr; /* descriptor index in the superblock */ |
182 | int raid_disk; /* role of device in array */ | 185 | int raid_disk; /* role of device in array */ |
186 | int saved_raid_disk; /* role that device used to have in the | ||
187 | * array and could again if we did a partial | ||
188 | * resync from the bitmap | ||
189 | */ | ||
183 | 190 | ||
184 | atomic_t nr_pending; /* number of pending requests. | 191 | atomic_t nr_pending; /* number of pending requests. |
185 | * only maintained for arrays that | 192 | * only maintained for arrays that |
@@ -252,6 +259,11 @@ struct mddev_s | |||
252 | atomic_t recovery_active; /* blocks scheduled, but not written */ | 259 | atomic_t recovery_active; /* blocks scheduled, but not written */ |
253 | wait_queue_head_t recovery_wait; | 260 | wait_queue_head_t recovery_wait; |
254 | sector_t recovery_cp; | 261 | sector_t recovery_cp; |
262 | |||
263 | spinlock_t write_lock; | ||
264 | wait_queue_head_t sb_wait; /* for waiting on superblock updates */ | ||
265 | atomic_t pending_writes; /* number of active superblock writes */ | ||
266 | |||
255 | unsigned int safemode; /* if set, update "clean" superblock | 267 | unsigned int safemode; /* if set, update "clean" superblock |
256 | * when no writes pending. | 268 | * when no writes pending. |
257 | */ | 269 | */ |
@@ -260,6 +272,13 @@ struct mddev_s | |||
260 | atomic_t writes_pending; | 272 | atomic_t writes_pending; |
261 | request_queue_t *queue; /* for plugging ... */ | 273 | request_queue_t *queue; /* for plugging ... */ |
262 | 274 | ||
275 | struct bitmap *bitmap; /* the bitmap for the device */ | ||
276 | struct file *bitmap_file; /* the bitmap file */ | ||
277 | long bitmap_offset; /* offset from superblock of | ||
278 | * start of bitmap. May be | ||
279 | * negative, but not '0' | ||
280 | */ | ||
281 | |||
263 | struct list_head all_mddevs; | 282 | struct list_head all_mddevs; |
264 | }; | 283 | }; |
265 | 284 | ||
@@ -291,7 +310,7 @@ struct mdk_personality_s | |||
291 | int (*hot_add_disk) (mddev_t *mddev, mdk_rdev_t *rdev); | 310 | int (*hot_add_disk) (mddev_t *mddev, mdk_rdev_t *rdev); |
292 | int (*hot_remove_disk) (mddev_t *mddev, int number); | 311 | int (*hot_remove_disk) (mddev_t *mddev, int number); |
293 | int (*spare_active) (mddev_t *mddev); | 312 | int (*spare_active) (mddev_t *mddev); |
294 | int (*sync_request)(mddev_t *mddev, sector_t sector_nr, int go_faster); | 313 | sector_t (*sync_request)(mddev_t *mddev, sector_t sector_nr, int *skipped, int go_faster); |
295 | int (*resize) (mddev_t *mddev, sector_t sectors); | 314 | int (*resize) (mddev_t *mddev, sector_t sectors); |
296 | int (*reshape) (mddev_t *mddev, int raid_disks); | 315 | int (*reshape) (mddev_t *mddev, int raid_disks); |
297 | int (*reconfig) (mddev_t *mddev, int layout, int chunk_size); | 316 | int (*reconfig) (mddev_t *mddev, int layout, int chunk_size); |
@@ -334,6 +353,7 @@ typedef struct mdk_thread_s { | |||
334 | unsigned long flags; | 353 | unsigned long flags; |
335 | struct completion *event; | 354 | struct completion *event; |
336 | struct task_struct *tsk; | 355 | struct task_struct *tsk; |
356 | unsigned long timeout; | ||
337 | const char *name; | 357 | const char *name; |
338 | } mdk_thread_t; | 358 | } mdk_thread_t; |
339 | 359 | ||
diff --git a/include/linux/raid/md_p.h b/include/linux/raid/md_p.h index 8ba95d67329f..dc65cd435494 100644 --- a/include/linux/raid/md_p.h +++ b/include/linux/raid/md_p.h | |||
@@ -96,6 +96,7 @@ typedef struct mdp_device_descriptor_s { | |||
96 | #define MD_SB_CLEAN 0 | 96 | #define MD_SB_CLEAN 0 |
97 | #define MD_SB_ERRORS 1 | 97 | #define MD_SB_ERRORS 1 |
98 | 98 | ||
99 | #define MD_SB_BITMAP_PRESENT 8 /* bitmap may be present nearby */ | ||
99 | typedef struct mdp_superblock_s { | 100 | typedef struct mdp_superblock_s { |
100 | /* | 101 | /* |
101 | * Constant generic information | 102 | * Constant generic information |
@@ -184,7 +185,7 @@ struct mdp_superblock_1 { | |||
184 | /* constant array information - 128 bytes */ | 185 | /* constant array information - 128 bytes */ |
185 | __u32 magic; /* MD_SB_MAGIC: 0xa92b4efc - little endian */ | 186 | __u32 magic; /* MD_SB_MAGIC: 0xa92b4efc - little endian */ |
186 | __u32 major_version; /* 1 */ | 187 | __u32 major_version; /* 1 */ |
187 | __u32 feature_map; /* 0 for now */ | 188 | __u32 feature_map; /* bit 0 set if 'bitmap_offset' is meaningful */ |
188 | __u32 pad0; /* always set to 0 when writing */ | 189 | __u32 pad0; /* always set to 0 when writing */ |
189 | 190 | ||
190 | __u8 set_uuid[16]; /* user-space generated. */ | 191 | __u8 set_uuid[16]; /* user-space generated. */ |
@@ -197,7 +198,11 @@ struct mdp_superblock_1 { | |||
197 | 198 | ||
198 | __u32 chunksize; /* in 512byte sectors */ | 199 | __u32 chunksize; /* in 512byte sectors */ |
199 | __u32 raid_disks; | 200 | __u32 raid_disks; |
200 | __u8 pad1[128-96]; /* set to 0 when written */ | 201 | __u32 bitmap_offset; /* sectors after start of superblock that bitmap starts |
202 | * NOTE: signed, so bitmap can be before superblock | ||
203 | * only meaningful of feature_map[0] is set. | ||
204 | */ | ||
205 | __u8 pad1[128-100]; /* set to 0 when written */ | ||
201 | 206 | ||
202 | /* constant this-device information - 64 bytes */ | 207 | /* constant this-device information - 64 bytes */ |
203 | __u64 data_offset; /* sector start of data, often 0 */ | 208 | __u64 data_offset; /* sector start of data, often 0 */ |
diff --git a/include/linux/raid/md_u.h b/include/linux/raid/md_u.h index a2df5c2a42af..81da20ccec4d 100644 --- a/include/linux/raid/md_u.h +++ b/include/linux/raid/md_u.h | |||
@@ -23,6 +23,7 @@ | |||
23 | #define GET_DISK_INFO _IOR (MD_MAJOR, 0x12, mdu_disk_info_t) | 23 | #define GET_DISK_INFO _IOR (MD_MAJOR, 0x12, mdu_disk_info_t) |
24 | #define PRINT_RAID_DEBUG _IO (MD_MAJOR, 0x13) | 24 | #define PRINT_RAID_DEBUG _IO (MD_MAJOR, 0x13) |
25 | #define RAID_AUTORUN _IO (MD_MAJOR, 0x14) | 25 | #define RAID_AUTORUN _IO (MD_MAJOR, 0x14) |
26 | #define GET_BITMAP_FILE _IOR (MD_MAJOR, 0x15, mdu_bitmap_file_t) | ||
26 | 27 | ||
27 | /* configuration */ | 28 | /* configuration */ |
28 | #define CLEAR_ARRAY _IO (MD_MAJOR, 0x20) | 29 | #define CLEAR_ARRAY _IO (MD_MAJOR, 0x20) |
@@ -36,6 +37,7 @@ | |||
36 | #define HOT_ADD_DISK _IO (MD_MAJOR, 0x28) | 37 | #define HOT_ADD_DISK _IO (MD_MAJOR, 0x28) |
37 | #define SET_DISK_FAULTY _IO (MD_MAJOR, 0x29) | 38 | #define SET_DISK_FAULTY _IO (MD_MAJOR, 0x29) |
38 | #define HOT_GENERATE_ERROR _IO (MD_MAJOR, 0x2a) | 39 | #define HOT_GENERATE_ERROR _IO (MD_MAJOR, 0x2a) |
40 | #define SET_BITMAP_FILE _IOW (MD_MAJOR, 0x2b, int) | ||
39 | 41 | ||
40 | /* usage */ | 42 | /* usage */ |
41 | #define RUN_ARRAY _IOW (MD_MAJOR, 0x30, mdu_param_t) | 43 | #define RUN_ARRAY _IOW (MD_MAJOR, 0x30, mdu_param_t) |
@@ -106,6 +108,11 @@ typedef struct mdu_start_info_s { | |||
106 | 108 | ||
107 | } mdu_start_info_t; | 109 | } mdu_start_info_t; |
108 | 110 | ||
111 | typedef struct mdu_bitmap_file_s | ||
112 | { | ||
113 | char pathname[4096]; | ||
114 | } mdu_bitmap_file_t; | ||
115 | |||
109 | typedef struct mdu_param_s | 116 | typedef struct mdu_param_s |
110 | { | 117 | { |
111 | int personality; /* 1,2,3,4 */ | 118 | int personality; /* 1,2,3,4 */ |
diff --git a/include/linux/raid/raid1.h b/include/linux/raid/raid1.h index abbfdd9afe1e..9d93cf12e890 100644 --- a/include/linux/raid/raid1.h +++ b/include/linux/raid/raid1.h | |||
@@ -36,12 +36,21 @@ struct r1_private_data_s { | |||
36 | spinlock_t device_lock; | 36 | spinlock_t device_lock; |
37 | 37 | ||
38 | struct list_head retry_list; | 38 | struct list_head retry_list; |
39 | /* queue pending writes and submit them on unplug */ | ||
40 | struct bio_list pending_bio_list; | ||
41 | /* queue of writes that have been unplugged */ | ||
42 | struct bio_list flushing_bio_list; | ||
43 | |||
39 | /* for use when syncing mirrors: */ | 44 | /* for use when syncing mirrors: */ |
40 | 45 | ||
41 | spinlock_t resync_lock; | 46 | spinlock_t resync_lock; |
42 | int nr_pending; | 47 | int nr_pending; |
43 | int barrier; | 48 | int barrier; |
44 | sector_t next_resync; | 49 | sector_t next_resync; |
50 | int fullsync; /* set to 1 if a full sync is needed, | ||
51 | * (fresh device added). | ||
52 | * Cleared when a sync completes. | ||
53 | */ | ||
45 | 54 | ||
46 | wait_queue_head_t wait_idle; | 55 | wait_queue_head_t wait_idle; |
47 | wait_queue_head_t wait_resume; | 56 | wait_queue_head_t wait_resume; |
@@ -85,14 +94,17 @@ struct r1bio_s { | |||
85 | int read_disk; | 94 | int read_disk; |
86 | 95 | ||
87 | struct list_head retry_list; | 96 | struct list_head retry_list; |
97 | struct bitmap_update *bitmap_update; | ||
88 | /* | 98 | /* |
89 | * if the IO is in WRITE direction, then multiple bios are used. | 99 | * if the IO is in WRITE direction, then multiple bios are used. |
90 | * We choose the number when they are allocated. | 100 | * We choose the number when they are allocated. |
91 | */ | 101 | */ |
92 | struct bio *bios[0]; | 102 | struct bio *bios[0]; |
103 | /* DO NOT PUT ANY NEW FIELDS HERE - bios array is contiguously alloced*/ | ||
93 | }; | 104 | }; |
94 | 105 | ||
95 | /* bits for r1bio.state */ | 106 | /* bits for r1bio.state */ |
96 | #define R1BIO_Uptodate 0 | 107 | #define R1BIO_Uptodate 0 |
97 | #define R1BIO_IsSync 1 | 108 | #define R1BIO_IsSync 1 |
109 | #define R1BIO_Degraded 2 | ||
98 | #endif | 110 | #endif |
diff --git a/include/linux/rtnetlink.h b/include/linux/rtnetlink.h index 91ac97c20777..e68dbf0bf579 100644 --- a/include/linux/rtnetlink.h +++ b/include/linux/rtnetlink.h | |||
@@ -89,6 +89,13 @@ enum { | |||
89 | RTM_GETANYCAST = 62, | 89 | RTM_GETANYCAST = 62, |
90 | #define RTM_GETANYCAST RTM_GETANYCAST | 90 | #define RTM_GETANYCAST RTM_GETANYCAST |
91 | 91 | ||
92 | RTM_NEWNEIGHTBL = 64, | ||
93 | #define RTM_NEWNEIGHTBL RTM_NEWNEIGHTBL | ||
94 | RTM_GETNEIGHTBL = 66, | ||
95 | #define RTM_GETNEIGHTBL RTM_GETNEIGHTBL | ||
96 | RTM_SETNEIGHTBL, | ||
97 | #define RTM_SETNEIGHTBL RTM_SETNEIGHTBL | ||
98 | |||
92 | __RTM_MAX, | 99 | __RTM_MAX, |
93 | #define RTM_MAX (((__RTM_MAX + 3) & ~3) - 1) | 100 | #define RTM_MAX (((__RTM_MAX + 3) & ~3) - 1) |
94 | }; | 101 | }; |
@@ -493,6 +500,106 @@ struct nda_cacheinfo | |||
493 | __u32 ndm_refcnt; | 500 | __u32 ndm_refcnt; |
494 | }; | 501 | }; |
495 | 502 | ||
503 | |||
504 | /***************************************************************** | ||
505 | * Neighbour tables specific messages. | ||
506 | * | ||
507 | * To retrieve the neighbour tables send RTM_GETNEIGHTBL with the | ||
508 | * NLM_F_DUMP flag set. Every neighbour table configuration is | ||
509 | * spread over multiple messages to avoid running into message | ||
510 | * size limits on systems with many interfaces. The first message | ||
511 | * in the sequence transports all not device specific data such as | ||
512 | * statistics, configuration, and the default parameter set. | ||
513 | * This message is followed by 0..n messages carrying device | ||
514 | * specific parameter sets. | ||
515 | * Although the ordering should be sufficient, NDTA_NAME can be | ||
516 | * used to identify sequences. The initial message can be identified | ||
517 | * by checking for NDTA_CONFIG. The device specific messages do | ||
518 | * not contain this TLV but have NDTPA_IFINDEX set to the | ||
519 | * corresponding interface index. | ||
520 | * | ||
521 | * To change neighbour table attributes, send RTM_SETNEIGHTBL | ||
522 | * with NDTA_NAME set. Changeable attribute include NDTA_THRESH[1-3], | ||
523 | * NDTA_GC_INTERVAL, and all TLVs in NDTA_PARMS unless marked | ||
524 | * otherwise. Device specific parameter sets can be changed by | ||
525 | * setting NDTPA_IFINDEX to the interface index of the corresponding | ||
526 | * device. | ||
527 | ****/ | ||
528 | |||
529 | struct ndt_stats | ||
530 | { | ||
531 | __u64 ndts_allocs; | ||
532 | __u64 ndts_destroys; | ||
533 | __u64 ndts_hash_grows; | ||
534 | __u64 ndts_res_failed; | ||
535 | __u64 ndts_lookups; | ||
536 | __u64 ndts_hits; | ||
537 | __u64 ndts_rcv_probes_mcast; | ||
538 | __u64 ndts_rcv_probes_ucast; | ||
539 | __u64 ndts_periodic_gc_runs; | ||
540 | __u64 ndts_forced_gc_runs; | ||
541 | }; | ||
542 | |||
543 | enum { | ||
544 | NDTPA_UNSPEC, | ||
545 | NDTPA_IFINDEX, /* u32, unchangeable */ | ||
546 | NDTPA_REFCNT, /* u32, read-only */ | ||
547 | NDTPA_REACHABLE_TIME, /* u64, read-only, msecs */ | ||
548 | NDTPA_BASE_REACHABLE_TIME, /* u64, msecs */ | ||
549 | NDTPA_RETRANS_TIME, /* u64, msecs */ | ||
550 | NDTPA_GC_STALETIME, /* u64, msecs */ | ||
551 | NDTPA_DELAY_PROBE_TIME, /* u64, msecs */ | ||
552 | NDTPA_QUEUE_LEN, /* u32 */ | ||
553 | NDTPA_APP_PROBES, /* u32 */ | ||
554 | NDTPA_UCAST_PROBES, /* u32 */ | ||
555 | NDTPA_MCAST_PROBES, /* u32 */ | ||
556 | NDTPA_ANYCAST_DELAY, /* u64, msecs */ | ||
557 | NDTPA_PROXY_DELAY, /* u64, msecs */ | ||
558 | NDTPA_PROXY_QLEN, /* u32 */ | ||
559 | NDTPA_LOCKTIME, /* u64, msecs */ | ||
560 | __NDTPA_MAX | ||
561 | }; | ||
562 | #define NDTPA_MAX (__NDTPA_MAX - 1) | ||
563 | |||
564 | struct ndtmsg | ||
565 | { | ||
566 | __u8 ndtm_family; | ||
567 | __u8 ndtm_pad1; | ||
568 | __u16 ndtm_pad2; | ||
569 | }; | ||
570 | |||
571 | struct ndt_config | ||
572 | { | ||
573 | __u16 ndtc_key_len; | ||
574 | __u16 ndtc_entry_size; | ||
575 | __u32 ndtc_entries; | ||
576 | __u32 ndtc_last_flush; /* delta to now in msecs */ | ||
577 | __u32 ndtc_last_rand; /* delta to now in msecs */ | ||
578 | __u32 ndtc_hash_rnd; | ||
579 | __u32 ndtc_hash_mask; | ||
580 | __u32 ndtc_hash_chain_gc; | ||
581 | __u32 ndtc_proxy_qlen; | ||
582 | }; | ||
583 | |||
584 | enum { | ||
585 | NDTA_UNSPEC, | ||
586 | NDTA_NAME, /* char *, unchangeable */ | ||
587 | NDTA_THRESH1, /* u32 */ | ||
588 | NDTA_THRESH2, /* u32 */ | ||
589 | NDTA_THRESH3, /* u32 */ | ||
590 | NDTA_CONFIG, /* struct ndt_config, read-only */ | ||
591 | NDTA_PARMS, /* nested TLV NDTPA_* */ | ||
592 | NDTA_STATS, /* struct ndt_stats, read-only */ | ||
593 | NDTA_GC_INTERVAL, /* u64, msecs */ | ||
594 | __NDTA_MAX | ||
595 | }; | ||
596 | #define NDTA_MAX (__NDTA_MAX - 1) | ||
597 | |||
598 | #define NDTA_RTA(r) ((struct rtattr*)(((char*)(r)) + \ | ||
599 | NLMSG_ALIGN(sizeof(struct ndtmsg)))) | ||
600 | #define NDTA_PAYLOAD(n) NLMSG_PAYLOAD(n,sizeof(struct ndtmsg)) | ||
601 | |||
602 | |||
496 | /**** | 603 | /**** |
497 | * General form of address family dependent message. | 604 | * General form of address family dependent message. |
498 | ****/ | 605 | ****/ |
@@ -789,6 +896,75 @@ extern void __rta_fill(struct sk_buff *skb, int attrtype, int attrlen, const voi | |||
789 | ({ if (unlikely(skb_tailroom(skb) < (int)(attrlen))) \ | 896 | ({ if (unlikely(skb_tailroom(skb) < (int)(attrlen))) \ |
790 | goto rtattr_failure; \ | 897 | goto rtattr_failure; \ |
791 | memcpy(skb_put(skb, RTA_ALIGN(attrlen)), data, attrlen); }) | 898 | memcpy(skb_put(skb, RTA_ALIGN(attrlen)), data, attrlen); }) |
899 | |||
900 | #define RTA_PUT_U8(skb, attrtype, value) \ | ||
901 | ({ u8 _tmp = (value); \ | ||
902 | RTA_PUT(skb, attrtype, sizeof(u8), &_tmp); }) | ||
903 | |||
904 | #define RTA_PUT_U16(skb, attrtype, value) \ | ||
905 | ({ u16 _tmp = (value); \ | ||
906 | RTA_PUT(skb, attrtype, sizeof(u16), &_tmp); }) | ||
907 | |||
908 | #define RTA_PUT_U32(skb, attrtype, value) \ | ||
909 | ({ u32 _tmp = (value); \ | ||
910 | RTA_PUT(skb, attrtype, sizeof(u32), &_tmp); }) | ||
911 | |||
912 | #define RTA_PUT_U64(skb, attrtype, value) \ | ||
913 | ({ u64 _tmp = (value); \ | ||
914 | RTA_PUT(skb, attrtype, sizeof(u64), &_tmp); }) | ||
915 | |||
916 | #define RTA_PUT_SECS(skb, attrtype, value) \ | ||
917 | RTA_PUT_U64(skb, attrtype, (value) / HZ) | ||
918 | |||
919 | #define RTA_PUT_MSECS(skb, attrtype, value) \ | ||
920 | RTA_PUT_U64(skb, attrtype, jiffies_to_msecs(value)) | ||
921 | |||
922 | #define RTA_PUT_STRING(skb, attrtype, value) \ | ||
923 | RTA_PUT(skb, attrtype, strlen(value) + 1, value) | ||
924 | |||
925 | #define RTA_PUT_FLAG(skb, attrtype) \ | ||
926 | RTA_PUT(skb, attrtype, 0, NULL); | ||
927 | |||
928 | #define RTA_NEST(skb, type) \ | ||
929 | ({ struct rtattr *__start = (struct rtattr *) (skb)->tail; \ | ||
930 | RTA_PUT(skb, type, 0, NULL); \ | ||
931 | __start; }) | ||
932 | |||
933 | #define RTA_NEST_END(skb, start) \ | ||
934 | ({ (start)->rta_len = ((skb)->tail - (unsigned char *) (start)); \ | ||
935 | (skb)->len; }) | ||
936 | |||
937 | #define RTA_NEST_CANCEL(skb, start) \ | ||
938 | ({ if (start) \ | ||
939 | skb_trim(skb, (unsigned char *) (start) - (skb)->data); \ | ||
940 | -1; }) | ||
941 | |||
942 | #define RTA_GET_U8(rta) \ | ||
943 | ({ if (!rta || RTA_PAYLOAD(rta) < sizeof(u8)) \ | ||
944 | goto rtattr_failure; \ | ||
945 | *(u8 *) RTA_DATA(rta); }) | ||
946 | |||
947 | #define RTA_GET_U16(rta) \ | ||
948 | ({ if (!rta || RTA_PAYLOAD(rta) < sizeof(u16)) \ | ||
949 | goto rtattr_failure; \ | ||
950 | *(u16 *) RTA_DATA(rta); }) | ||
951 | |||
952 | #define RTA_GET_U32(rta) \ | ||
953 | ({ if (!rta || RTA_PAYLOAD(rta) < sizeof(u32)) \ | ||
954 | goto rtattr_failure; \ | ||
955 | *(u32 *) RTA_DATA(rta); }) | ||
956 | |||
957 | #define RTA_GET_U64(rta) \ | ||
958 | ({ u64 _tmp; \ | ||
959 | if (!rta || RTA_PAYLOAD(rta) < sizeof(u64)) \ | ||
960 | goto rtattr_failure; \ | ||
961 | memcpy(&_tmp, RTA_DATA(rta), sizeof(_tmp)); \ | ||
962 | _tmp; }) | ||
963 | |||
964 | #define RTA_GET_FLAG(rta) (!!(rta)) | ||
965 | |||
966 | #define RTA_GET_SECS(rta) ((unsigned long) RTA_GET_U64(rta) * HZ) | ||
967 | #define RTA_GET_MSECS(rta) (msecs_to_jiffies((unsigned long) RTA_GET_U64(rta))) | ||
792 | 968 | ||
793 | static inline struct rtattr * | 969 | static inline struct rtattr * |
794 | __rta_reserve(struct sk_buff *skb, int attrtype, int attrlen) | 970 | __rta_reserve(struct sk_buff *skb, int attrtype, int attrlen) |
diff --git a/include/linux/sched.h b/include/linux/sched.h index 4dbb109022f3..b58afd97a180 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h | |||
@@ -201,8 +201,8 @@ extern unsigned long | |||
201 | arch_get_unmapped_area_topdown(struct file *filp, unsigned long addr, | 201 | arch_get_unmapped_area_topdown(struct file *filp, unsigned long addr, |
202 | unsigned long len, unsigned long pgoff, | 202 | unsigned long len, unsigned long pgoff, |
203 | unsigned long flags); | 203 | unsigned long flags); |
204 | extern void arch_unmap_area(struct vm_area_struct *area); | 204 | extern void arch_unmap_area(struct mm_struct *, unsigned long); |
205 | extern void arch_unmap_area_topdown(struct vm_area_struct *area); | 205 | extern void arch_unmap_area_topdown(struct mm_struct *, unsigned long); |
206 | 206 | ||
207 | #define set_mm_counter(mm, member, value) (mm)->_##member = (value) | 207 | #define set_mm_counter(mm, member, value) (mm)->_##member = (value) |
208 | #define get_mm_counter(mm, member) ((mm)->_##member) | 208 | #define get_mm_counter(mm, member) ((mm)->_##member) |
@@ -218,9 +218,10 @@ struct mm_struct { | |||
218 | unsigned long (*get_unmapped_area) (struct file *filp, | 218 | unsigned long (*get_unmapped_area) (struct file *filp, |
219 | unsigned long addr, unsigned long len, | 219 | unsigned long addr, unsigned long len, |
220 | unsigned long pgoff, unsigned long flags); | 220 | unsigned long pgoff, unsigned long flags); |
221 | void (*unmap_area) (struct vm_area_struct *area); | 221 | void (*unmap_area) (struct mm_struct *mm, unsigned long addr); |
222 | unsigned long mmap_base; /* base of mmap area */ | 222 | unsigned long mmap_base; /* base of mmap area */ |
223 | unsigned long free_area_cache; /* first hole */ | 223 | unsigned long cached_hole_size; /* if non-zero, the largest hole below free_area_cache */ |
224 | unsigned long free_area_cache; /* first hole of size cached_hole_size or larger */ | ||
224 | pgd_t * pgd; | 225 | pgd_t * pgd; |
225 | atomic_t mm_users; /* How many users with user space? */ | 226 | atomic_t mm_users; /* How many users with user space? */ |
226 | atomic_t mm_count; /* How many references to "struct mm_struct" (users count as 1) */ | 227 | atomic_t mm_count; /* How many references to "struct mm_struct" (users count as 1) */ |
diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h index c3fb5984f250..d6025af7efac 100644 --- a/include/linux/serial_core.h +++ b/include/linux/serial_core.h | |||
@@ -479,6 +479,25 @@ uart_handle_cts_change(struct uart_port *port, unsigned int status) | |||
479 | } | 479 | } |
480 | } | 480 | } |
481 | 481 | ||
482 | #include <linux/tty_flip.h> | ||
483 | |||
484 | static inline void | ||
485 | uart_insert_char(struct uart_port *port, unsigned int status, | ||
486 | unsigned int overrun, unsigned int ch, unsigned int flag) | ||
487 | { | ||
488 | struct tty_struct *tty = port->info->tty; | ||
489 | |||
490 | if ((status & port->ignore_status_mask & ~overrun) == 0) | ||
491 | tty_insert_flip_char(tty, ch, flag); | ||
492 | |||
493 | /* | ||
494 | * Overrun is special. Since it's reported immediately, | ||
495 | * it doesn't affect the current character. | ||
496 | */ | ||
497 | if (status & ~port->ignore_status_mask & overrun) | ||
498 | tty_insert_flip_char(tty, 0, TTY_OVERRUN); | ||
499 | } | ||
500 | |||
482 | /* | 501 | /* |
483 | * UART_ENABLE_MS - determine if port should enable modem status irqs | 502 | * UART_ENABLE_MS - determine if port should enable modem status irqs |
484 | */ | 503 | */ |
diff --git a/include/linux/signal.h b/include/linux/signal.h index 0a98f5ec5cae..7be18b5e2fb4 100644 --- a/include/linux/signal.h +++ b/include/linux/signal.h | |||
@@ -231,10 +231,8 @@ extern int __group_send_sig_info(int, struct siginfo *, struct task_struct *); | |||
231 | extern long do_sigpending(void __user *, unsigned long); | 231 | extern long do_sigpending(void __user *, unsigned long); |
232 | extern int sigprocmask(int, sigset_t *, sigset_t *); | 232 | extern int sigprocmask(int, sigset_t *, sigset_t *); |
233 | 233 | ||
234 | #ifndef HAVE_ARCH_GET_SIGNAL_TO_DELIVER | ||
235 | struct pt_regs; | 234 | struct pt_regs; |
236 | extern int get_signal_to_deliver(siginfo_t *info, struct k_sigaction *return_ka, struct pt_regs *regs, void *cookie); | 235 | extern int get_signal_to_deliver(siginfo_t *info, struct k_sigaction *return_ka, struct pt_regs *regs, void *cookie); |
237 | #endif | ||
238 | 236 | ||
239 | #endif /* __KERNEL__ */ | 237 | #endif /* __KERNEL__ */ |
240 | 238 | ||
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index cc04f5cd2286..d7c839a21842 100644 --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h | |||
@@ -193,7 +193,6 @@ struct skb_shared_info { | |||
193 | * @nfcache: Cache info | 193 | * @nfcache: Cache info |
194 | * @nfct: Associated connection, if any | 194 | * @nfct: Associated connection, if any |
195 | * @nfctinfo: Relationship of this skb to the connection | 195 | * @nfctinfo: Relationship of this skb to the connection |
196 | * @nf_debug: Netfilter debugging | ||
197 | * @nf_bridge: Saved data about a bridged frame - see br_netfilter.c | 196 | * @nf_bridge: Saved data about a bridged frame - see br_netfilter.c |
198 | * @private: Data which is private to the HIPPI implementation | 197 | * @private: Data which is private to the HIPPI implementation |
199 | * @tc_index: Traffic control index | 198 | * @tc_index: Traffic control index |
@@ -264,9 +263,6 @@ struct sk_buff { | |||
264 | __u32 nfcache; | 263 | __u32 nfcache; |
265 | __u32 nfctinfo; | 264 | __u32 nfctinfo; |
266 | struct nf_conntrack *nfct; | 265 | struct nf_conntrack *nfct; |
267 | #ifdef CONFIG_NETFILTER_DEBUG | ||
268 | unsigned int nf_debug; | ||
269 | #endif | ||
270 | #ifdef CONFIG_BRIDGE_NETFILTER | 266 | #ifdef CONFIG_BRIDGE_NETFILTER |
271 | struct nf_bridge_info *nf_bridge; | 267 | struct nf_bridge_info *nf_bridge; |
272 | #endif | 268 | #endif |
@@ -1219,15 +1215,6 @@ static inline void nf_reset(struct sk_buff *skb) | |||
1219 | { | 1215 | { |
1220 | nf_conntrack_put(skb->nfct); | 1216 | nf_conntrack_put(skb->nfct); |
1221 | skb->nfct = NULL; | 1217 | skb->nfct = NULL; |
1222 | #ifdef CONFIG_NETFILTER_DEBUG | ||
1223 | skb->nf_debug = 0; | ||
1224 | #endif | ||
1225 | } | ||
1226 | static inline void nf_reset_debug(struct sk_buff *skb) | ||
1227 | { | ||
1228 | #ifdef CONFIG_NETFILTER_DEBUG | ||
1229 | skb->nf_debug = 0; | ||
1230 | #endif | ||
1231 | } | 1218 | } |
1232 | 1219 | ||
1233 | #ifdef CONFIG_BRIDGE_NETFILTER | 1220 | #ifdef CONFIG_BRIDGE_NETFILTER |
diff --git a/include/linux/slab.h b/include/linux/slab.h index 7d66385ae750..76cf7e60216c 100644 --- a/include/linux/slab.h +++ b/include/linux/slab.h | |||
@@ -64,6 +64,7 @@ extern int kmem_cache_shrink(kmem_cache_t *); | |||
64 | extern void *kmem_cache_alloc(kmem_cache_t *, unsigned int __nocast); | 64 | extern void *kmem_cache_alloc(kmem_cache_t *, unsigned int __nocast); |
65 | extern void kmem_cache_free(kmem_cache_t *, void *); | 65 | extern void kmem_cache_free(kmem_cache_t *, void *); |
66 | extern unsigned int kmem_cache_size(kmem_cache_t *); | 66 | extern unsigned int kmem_cache_size(kmem_cache_t *); |
67 | extern const char *kmem_cache_name(kmem_cache_t *); | ||
67 | extern kmem_cache_t *kmem_find_general_cachep(size_t size, int gfpflags); | 68 | extern kmem_cache_t *kmem_find_general_cachep(size_t size, int gfpflags); |
68 | 69 | ||
69 | /* Size description struct for general caches. */ | 70 | /* Size description struct for general caches. */ |
diff --git a/include/linux/smp.h b/include/linux/smp.h index dcf1db3b35d3..9dfa3ee769ae 100644 --- a/include/linux/smp.h +++ b/include/linux/smp.h | |||
@@ -92,10 +92,7 @@ void smp_prepare_boot_cpu(void); | |||
92 | /* | 92 | /* |
93 | * These macros fold the SMP functionality into a single CPU system | 93 | * These macros fold the SMP functionality into a single CPU system |
94 | */ | 94 | */ |
95 | 95 | #define raw_smp_processor_id() 0 | |
96 | #if !defined(__smp_processor_id) || !defined(CONFIG_PREEMPT) | ||
97 | # define smp_processor_id() 0 | ||
98 | #endif | ||
99 | #define hard_smp_processor_id() 0 | 96 | #define hard_smp_processor_id() 0 |
100 | #define smp_call_function(func,info,retry,wait) ({ 0; }) | 97 | #define smp_call_function(func,info,retry,wait) ({ 0; }) |
101 | #define on_each_cpu(func,info,retry,wait) ({ func(info); 0; }) | 98 | #define on_each_cpu(func,info,retry,wait) ({ func(info); 0; }) |
@@ -106,30 +103,25 @@ static inline void smp_send_reschedule(int cpu) { } | |||
106 | #endif /* !SMP */ | 103 | #endif /* !SMP */ |
107 | 104 | ||
108 | /* | 105 | /* |
109 | * DEBUG_PREEMPT support: check whether smp_processor_id() is being | 106 | * smp_processor_id(): get the current CPU ID. |
110 | * used in a preemption-safe way. | ||
111 | * | 107 | * |
112 | * An architecture has to enable this debugging code explicitly. | 108 | * if DEBUG_PREEMPT is enabled the we check whether it is |
113 | * It can do so by renaming the smp_processor_id() macro to | 109 | * used in a preemption-safe way. (smp_processor_id() is safe |
114 | * __smp_processor_id(). This should only be done after some minimal | 110 | * if it's used in a preemption-off critical section, or in |
115 | * testing, because usually there are a number of false positives | 111 | * a thread that is bound to the current CPU.) |
116 | * that an architecture will trigger. | ||
117 | * | 112 | * |
118 | * To fix a false positive (i.e. smp_processor_id() use that the | 113 | * NOTE: raw_smp_processor_id() is for internal use only |
119 | * debugging code reports but which use for some reason is legal), | 114 | * (smp_processor_id() is the preferred variant), but in rare |
120 | * change the smp_processor_id() reference to _smp_processor_id(), | 115 | * instances it might also be used to turn off false positives |
121 | * which is the nondebug variant. NOTE: don't use this to hack around | 116 | * (i.e. smp_processor_id() use that the debugging code reports but |
122 | * real bugs. | 117 | * which use for some reason is legal). Don't use this to hack around |
118 | * the warning message, as your code might not work under PREEMPT. | ||
123 | */ | 119 | */ |
124 | #ifdef __smp_processor_id | 120 | #ifdef CONFIG_DEBUG_PREEMPT |
125 | # if defined(CONFIG_PREEMPT) && defined(CONFIG_DEBUG_PREEMPT) | 121 | extern unsigned int debug_smp_processor_id(void); |
126 | extern unsigned int smp_processor_id(void); | 122 | # define smp_processor_id() debug_smp_processor_id() |
127 | # else | ||
128 | # define smp_processor_id() __smp_processor_id() | ||
129 | # endif | ||
130 | # define _smp_processor_id() __smp_processor_id() | ||
131 | #else | 123 | #else |
132 | # define _smp_processor_id() smp_processor_id() | 124 | # define smp_processor_id() raw_smp_processor_id() |
133 | #endif | 125 | #endif |
134 | 126 | ||
135 | #define get_cpu() ({ preempt_disable(); smp_processor_id(); }) | 127 | #define get_cpu() ({ preempt_disable(); smp_processor_id(); }) |
diff --git a/include/linux/spinlock.h b/include/linux/spinlock.h index e895f3eaf53a..d6ba068719b6 100644 --- a/include/linux/spinlock.h +++ b/include/linux/spinlock.h | |||
@@ -248,7 +248,7 @@ typedef struct { | |||
248 | 248 | ||
249 | #define _spin_trylock_bh(lock) ({preempt_disable(); local_bh_disable(); \ | 249 | #define _spin_trylock_bh(lock) ({preempt_disable(); local_bh_disable(); \ |
250 | _raw_spin_trylock(lock) ? \ | 250 | _raw_spin_trylock(lock) ? \ |
251 | 1 : ({preempt_enable(); local_bh_enable(); 0;});}) | 251 | 1 : ({preempt_enable_no_resched(); local_bh_enable(); 0;});}) |
252 | 252 | ||
253 | #define _spin_lock(lock) \ | 253 | #define _spin_lock(lock) \ |
254 | do { \ | 254 | do { \ |
@@ -383,7 +383,7 @@ do { \ | |||
383 | #define _spin_unlock_bh(lock) \ | 383 | #define _spin_unlock_bh(lock) \ |
384 | do { \ | 384 | do { \ |
385 | _raw_spin_unlock(lock); \ | 385 | _raw_spin_unlock(lock); \ |
386 | preempt_enable(); \ | 386 | preempt_enable_no_resched(); \ |
387 | local_bh_enable(); \ | 387 | local_bh_enable(); \ |
388 | __release(lock); \ | 388 | __release(lock); \ |
389 | } while (0) | 389 | } while (0) |
@@ -391,7 +391,7 @@ do { \ | |||
391 | #define _write_unlock_bh(lock) \ | 391 | #define _write_unlock_bh(lock) \ |
392 | do { \ | 392 | do { \ |
393 | _raw_write_unlock(lock); \ | 393 | _raw_write_unlock(lock); \ |
394 | preempt_enable(); \ | 394 | preempt_enable_no_resched(); \ |
395 | local_bh_enable(); \ | 395 | local_bh_enable(); \ |
396 | __release(lock); \ | 396 | __release(lock); \ |
397 | } while (0) | 397 | } while (0) |
@@ -423,8 +423,8 @@ do { \ | |||
423 | #define _read_unlock_bh(lock) \ | 423 | #define _read_unlock_bh(lock) \ |
424 | do { \ | 424 | do { \ |
425 | _raw_read_unlock(lock); \ | 425 | _raw_read_unlock(lock); \ |
426 | preempt_enable_no_resched(); \ | ||
426 | local_bh_enable(); \ | 427 | local_bh_enable(); \ |
427 | preempt_enable(); \ | ||
428 | __release(lock); \ | 428 | __release(lock); \ |
429 | } while (0) | 429 | } while (0) |
430 | 430 | ||
diff --git a/include/linux/swap.h b/include/linux/swap.h index 3bbc41be9bd0..2343f999e6e1 100644 --- a/include/linux/swap.h +++ b/include/linux/swap.h | |||
@@ -172,7 +172,8 @@ extern int rotate_reclaimable_page(struct page *page); | |||
172 | extern void swap_setup(void); | 172 | extern void swap_setup(void); |
173 | 173 | ||
174 | /* linux/mm/vmscan.c */ | 174 | /* linux/mm/vmscan.c */ |
175 | extern int try_to_free_pages(struct zone **, unsigned int, unsigned int); | 175 | extern int try_to_free_pages(struct zone **, unsigned int); |
176 | extern int zone_reclaim(struct zone *, unsigned int, unsigned int); | ||
176 | extern int shrink_all_memory(int); | 177 | extern int shrink_all_memory(int); |
177 | extern int vm_swappiness; | 178 | extern int vm_swappiness; |
178 | 179 | ||
diff --git a/include/linux/sysctl.h b/include/linux/sysctl.h index 772998147e3e..a17745c80a91 100644 --- a/include/linux/sysctl.h +++ b/include/linux/sysctl.h | |||
@@ -346,6 +346,7 @@ enum | |||
346 | NET_TCP_MODERATE_RCVBUF=106, | 346 | NET_TCP_MODERATE_RCVBUF=106, |
347 | NET_TCP_TSO_WIN_DIVISOR=107, | 347 | NET_TCP_TSO_WIN_DIVISOR=107, |
348 | NET_TCP_BIC_BETA=108, | 348 | NET_TCP_BIC_BETA=108, |
349 | NET_IPV4_ICMP_ERRORS_USE_INBOUND_IFADDR=109, | ||
349 | }; | 350 | }; |
350 | 351 | ||
351 | enum { | 352 | enum { |
@@ -399,6 +400,7 @@ enum | |||
399 | NET_IPV4_CONF_FORCE_IGMP_VERSION=17, | 400 | NET_IPV4_CONF_FORCE_IGMP_VERSION=17, |
400 | NET_IPV4_CONF_ARP_ANNOUNCE=18, | 401 | NET_IPV4_CONF_ARP_ANNOUNCE=18, |
401 | NET_IPV4_CONF_ARP_IGNORE=19, | 402 | NET_IPV4_CONF_ARP_IGNORE=19, |
403 | NET_IPV4_CONF_PROMOTE_SECONDARIES=20, | ||
402 | __NET_IPV4_CONF_MAX | 404 | __NET_IPV4_CONF_MAX |
403 | }; | 405 | }; |
404 | 406 | ||
diff --git a/include/linux/sysfs.h b/include/linux/sysfs.h index 38b58b30814a..392da5a6dacb 100644 --- a/include/linux/sysfs.h +++ b/include/linux/sysfs.h | |||
@@ -16,13 +16,13 @@ struct kobject; | |||
16 | struct module; | 16 | struct module; |
17 | 17 | ||
18 | struct attribute { | 18 | struct attribute { |
19 | char * name; | 19 | const char * name; |
20 | struct module * owner; | 20 | struct module * owner; |
21 | mode_t mode; | 21 | mode_t mode; |
22 | }; | 22 | }; |
23 | 23 | ||
24 | struct attribute_group { | 24 | struct attribute_group { |
25 | char * name; | 25 | const char * name; |
26 | struct attribute ** attrs; | 26 | struct attribute ** attrs; |
27 | }; | 27 | }; |
28 | 28 | ||
@@ -73,6 +73,7 @@ struct sysfs_dirent { | |||
73 | int s_type; | 73 | int s_type; |
74 | umode_t s_mode; | 74 | umode_t s_mode; |
75 | struct dentry * s_dentry; | 75 | struct dentry * s_dentry; |
76 | struct iattr * s_iattr; | ||
76 | }; | 77 | }; |
77 | 78 | ||
78 | #define SYSFS_ROOT 0x0001 | 79 | #define SYSFS_ROOT 0x0001 |
@@ -105,11 +106,11 @@ sysfs_chmod_file(struct kobject *kobj, struct attribute *attr, mode_t mode); | |||
105 | extern void | 106 | extern void |
106 | sysfs_remove_file(struct kobject *, const struct attribute *); | 107 | sysfs_remove_file(struct kobject *, const struct attribute *); |
107 | 108 | ||
108 | extern int | 109 | extern int |
109 | sysfs_create_link(struct kobject * kobj, struct kobject * target, char * name); | 110 | sysfs_create_link(struct kobject * kobj, struct kobject * target, const char * name); |
110 | 111 | ||
111 | extern void | 112 | extern void |
112 | sysfs_remove_link(struct kobject *, char * name); | 113 | sysfs_remove_link(struct kobject *, const char * name); |
113 | 114 | ||
114 | int sysfs_create_bin_file(struct kobject * kobj, struct bin_attribute * attr); | 115 | int sysfs_create_bin_file(struct kobject * kobj, struct bin_attribute * attr); |
115 | int sysfs_remove_bin_file(struct kobject * kobj, struct bin_attribute * attr); | 116 | int sysfs_remove_bin_file(struct kobject * kobj, struct bin_attribute * attr); |
@@ -153,12 +154,12 @@ static inline void sysfs_remove_file(struct kobject * k, const struct attribute | |||
153 | ; | 154 | ; |
154 | } | 155 | } |
155 | 156 | ||
156 | static inline int sysfs_create_link(struct kobject * k, struct kobject * t, char * n) | 157 | static inline int sysfs_create_link(struct kobject * k, struct kobject * t, const char * n) |
157 | { | 158 | { |
158 | return 0; | 159 | return 0; |
159 | } | 160 | } |
160 | 161 | ||
161 | static inline void sysfs_remove_link(struct kobject * k, char * name) | 162 | static inline void sysfs_remove_link(struct kobject * k, const char * name) |
162 | { | 163 | { |
163 | ; | 164 | ; |
164 | } | 165 | } |
diff --git a/include/linux/tc_ematch/tc_em_meta.h b/include/linux/tc_ematch/tc_em_meta.h index aa6b48bb4dcd..a6b2cc530af5 100644 --- a/include/linux/tc_ematch/tc_em_meta.h +++ b/include/linux/tc_ematch/tc_em_meta.h | |||
@@ -56,6 +56,36 @@ enum | |||
56 | TCF_META_ID_TCCLASSID, | 56 | TCF_META_ID_TCCLASSID, |
57 | TCF_META_ID_RTCLASSID, | 57 | TCF_META_ID_RTCLASSID, |
58 | TCF_META_ID_RTIIF, | 58 | TCF_META_ID_RTIIF, |
59 | TCF_META_ID_SK_FAMILY, | ||
60 | TCF_META_ID_SK_STATE, | ||
61 | TCF_META_ID_SK_REUSE, | ||
62 | TCF_META_ID_SK_BOUND_IF, | ||
63 | TCF_META_ID_SK_REFCNT, | ||
64 | TCF_META_ID_SK_SHUTDOWN, | ||
65 | TCF_META_ID_SK_PROTO, | ||
66 | TCF_META_ID_SK_TYPE, | ||
67 | TCF_META_ID_SK_RCVBUF, | ||
68 | TCF_META_ID_SK_RMEM_ALLOC, | ||
69 | TCF_META_ID_SK_WMEM_ALLOC, | ||
70 | TCF_META_ID_SK_OMEM_ALLOC, | ||
71 | TCF_META_ID_SK_WMEM_QUEUED, | ||
72 | TCF_META_ID_SK_RCV_QLEN, | ||
73 | TCF_META_ID_SK_SND_QLEN, | ||
74 | TCF_META_ID_SK_ERR_QLEN, | ||
75 | TCF_META_ID_SK_FORWARD_ALLOCS, | ||
76 | TCF_META_ID_SK_SNDBUF, | ||
77 | TCF_META_ID_SK_ALLOCS, | ||
78 | TCF_META_ID_SK_ROUTE_CAPS, | ||
79 | TCF_META_ID_SK_HASHENT, | ||
80 | TCF_META_ID_SK_LINGERTIME, | ||
81 | TCF_META_ID_SK_ACK_BACKLOG, | ||
82 | TCF_META_ID_SK_MAX_ACK_BACKLOG, | ||
83 | TCF_META_ID_SK_PRIO, | ||
84 | TCF_META_ID_SK_RCVLOWAT, | ||
85 | TCF_META_ID_SK_RCVTIMEO, | ||
86 | TCF_META_ID_SK_SNDTIMEO, | ||
87 | TCF_META_ID_SK_SENDMSG_OFF, | ||
88 | TCF_META_ID_SK_WRITE_PENDING, | ||
59 | __TCF_META_ID_MAX | 89 | __TCF_META_ID_MAX |
60 | }; | 90 | }; |
61 | #define TCF_META_ID_MAX (__TCF_META_ID_MAX - 1) | 91 | #define TCF_META_ID_MAX (__TCF_META_ID_MAX - 1) |
diff --git a/include/linux/tcp.h b/include/linux/tcp.h index 14a55e3e3a50..97a7c9e03df5 100644 --- a/include/linux/tcp.h +++ b/include/linux/tcp.h | |||
@@ -230,6 +230,17 @@ struct tcp_options_received { | |||
230 | __u16 mss_clamp; /* Maximal mss, negotiated at connection setup */ | 230 | __u16 mss_clamp; /* Maximal mss, negotiated at connection setup */ |
231 | }; | 231 | }; |
232 | 232 | ||
233 | struct tcp_request_sock { | ||
234 | struct inet_request_sock req; | ||
235 | __u32 rcv_isn; | ||
236 | __u32 snt_isn; | ||
237 | }; | ||
238 | |||
239 | static inline struct tcp_request_sock *tcp_rsk(const struct request_sock *req) | ||
240 | { | ||
241 | return (struct tcp_request_sock *)req; | ||
242 | } | ||
243 | |||
233 | struct tcp_sock { | 244 | struct tcp_sock { |
234 | /* inet_sock has to be the first member of tcp_sock */ | 245 | /* inet_sock has to be the first member of tcp_sock */ |
235 | struct inet_sock inet; | 246 | struct inet_sock inet; |
@@ -368,22 +379,7 @@ struct tcp_sock { | |||
368 | 379 | ||
369 | __u32 total_retrans; /* Total retransmits for entire connection */ | 380 | __u32 total_retrans; /* Total retransmits for entire connection */ |
370 | 381 | ||
371 | /* The syn_wait_lock is necessary only to avoid proc interface having | 382 | struct request_sock_queue accept_queue; /* FIFO of established children */ |
372 | * to grab the main lock sock while browsing the listening hash | ||
373 | * (otherwise it's deadlock prone). | ||
374 | * This lock is acquired in read mode only from listening_get_next() | ||
375 | * and it's acquired in write mode _only_ from code that is actively | ||
376 | * changing the syn_wait_queue. All readers that are holding | ||
377 | * the master sock lock don't need to grab this lock in read mode | ||
378 | * too as the syn_wait_queue writes are always protected from | ||
379 | * the main sock lock. | ||
380 | */ | ||
381 | rwlock_t syn_wait_lock; | ||
382 | struct tcp_listen_opt *listen_opt; | ||
383 | |||
384 | /* FIFO of established children */ | ||
385 | struct open_request *accept_queue; | ||
386 | struct open_request *accept_queue_tail; | ||
387 | 383 | ||
388 | unsigned int keepalive_time; /* time before keep alive takes place */ | 384 | unsigned int keepalive_time; /* time before keep alive takes place */ |
389 | unsigned int keepalive_intvl; /* time interval between keep alive probes */ | 385 | unsigned int keepalive_intvl; /* time interval between keep alive probes */ |
diff --git a/include/linux/usb.h b/include/linux/usb.h index 41d1a644c9d4..3d508bf08402 100644 --- a/include/linux/usb.h +++ b/include/linux/usb.h | |||
@@ -287,15 +287,14 @@ struct usb_bus { | |||
287 | 287 | ||
288 | struct dentry *usbfs_dentry; /* usbfs dentry entry for the bus */ | 288 | struct dentry *usbfs_dentry; /* usbfs dentry entry for the bus */ |
289 | 289 | ||
290 | struct class_device class_dev; /* class device for this bus */ | 290 | struct class_device *class_dev; /* class device for this bus */ |
291 | struct kref kref; /* handles reference counting this bus */ | ||
291 | void (*release)(struct usb_bus *bus); /* function to destroy this bus's memory */ | 292 | void (*release)(struct usb_bus *bus); /* function to destroy this bus's memory */ |
292 | #if defined(CONFIG_USB_MON) || defined(CONFIG_USB_MON_MODULE) | 293 | #if defined(CONFIG_USB_MON) || defined(CONFIG_USB_MON_MODULE) |
293 | struct mon_bus *mon_bus; /* non-null when associated */ | 294 | struct mon_bus *mon_bus; /* non-null when associated */ |
294 | int monitored; /* non-zero when monitored */ | 295 | int monitored; /* non-zero when monitored */ |
295 | #endif | 296 | #endif |
296 | }; | 297 | }; |
297 | #define to_usb_bus(d) container_of(d, struct usb_bus, class_dev) | ||
298 | |||
299 | 298 | ||
300 | /* -------------------------------------------------------------------------- */ | 299 | /* -------------------------------------------------------------------------- */ |
301 | 300 | ||
@@ -796,6 +795,10 @@ typedef void (*usb_complete_t)(struct urb *, struct pt_regs *); | |||
796 | * of the iso_frame_desc array, and the number of errors is reported in | 795 | * of the iso_frame_desc array, and the number of errors is reported in |
797 | * error_count. Completion callbacks for ISO transfers will normally | 796 | * error_count. Completion callbacks for ISO transfers will normally |
798 | * (re)submit URBs to ensure a constant transfer rate. | 797 | * (re)submit URBs to ensure a constant transfer rate. |
798 | * | ||
799 | * Note that even fields marked "public" should not be touched by the driver | ||
800 | * when the urb is owned by the hcd, that is, since the call to | ||
801 | * usb_submit_urb() till the entry into the completion routine. | ||
799 | */ | 802 | */ |
800 | struct urb | 803 | struct urb |
801 | { | 804 | { |
@@ -803,12 +806,12 @@ struct urb | |||
803 | struct kref kref; /* reference count of the URB */ | 806 | struct kref kref; /* reference count of the URB */ |
804 | spinlock_t lock; /* lock for the URB */ | 807 | spinlock_t lock; /* lock for the URB */ |
805 | void *hcpriv; /* private data for host controller */ | 808 | void *hcpriv; /* private data for host controller */ |
806 | struct list_head urb_list; /* list pointer to all active urbs */ | ||
807 | int bandwidth; /* bandwidth for INT/ISO request */ | 809 | int bandwidth; /* bandwidth for INT/ISO request */ |
808 | atomic_t use_count; /* concurrent submissions counter */ | 810 | atomic_t use_count; /* concurrent submissions counter */ |
809 | u8 reject; /* submissions will fail */ | 811 | u8 reject; /* submissions will fail */ |
810 | 812 | ||
811 | /* public, documented fields in the urb that can be used by drivers */ | 813 | /* public, documented fields in the urb that can be used by drivers */ |
814 | struct list_head urb_list; /* list head for use by the urb owner */ | ||
812 | struct usb_device *dev; /* (in) pointer to associated device */ | 815 | struct usb_device *dev; /* (in) pointer to associated device */ |
813 | unsigned int pipe; /* (in) pipe information */ | 816 | unsigned int pipe; /* (in) pipe information */ |
814 | int status; /* (return) non-ISO status */ | 817 | int status; /* (return) non-ISO status */ |
diff --git a/include/linux/vmalloc.h b/include/linux/vmalloc.h index 3a358c895188..6409d9cf5965 100644 --- a/include/linux/vmalloc.h +++ b/include/linux/vmalloc.h | |||
@@ -41,6 +41,7 @@ extern struct vm_struct *get_vm_area(unsigned long size, unsigned long flags); | |||
41 | extern struct vm_struct *__get_vm_area(unsigned long size, unsigned long flags, | 41 | extern struct vm_struct *__get_vm_area(unsigned long size, unsigned long flags, |
42 | unsigned long start, unsigned long end); | 42 | unsigned long start, unsigned long end); |
43 | extern struct vm_struct *remove_vm_area(void *addr); | 43 | extern struct vm_struct *remove_vm_area(void *addr); |
44 | extern struct vm_struct *__remove_vm_area(void *addr); | ||
44 | extern int map_vm_area(struct vm_struct *area, pgprot_t prot, | 45 | extern int map_vm_area(struct vm_struct *area, pgprot_t prot, |
45 | struct page ***pages); | 46 | struct page ***pages); |
46 | extern void unmap_vm_area(struct vm_struct *area); | 47 | extern void unmap_vm_area(struct vm_struct *area); |
diff --git a/include/linux/wait.h b/include/linux/wait.h index 17c874a8eb3f..c9486c3efb4a 100644 --- a/include/linux/wait.h +++ b/include/linux/wait.h | |||
@@ -386,9 +386,7 @@ int wake_bit_function(wait_queue_t *wait, unsigned mode, int sync, void *key); | |||
386 | wait_queue_t name = { \ | 386 | wait_queue_t name = { \ |
387 | .task = current, \ | 387 | .task = current, \ |
388 | .func = autoremove_wake_function, \ | 388 | .func = autoremove_wake_function, \ |
389 | .task_list = { .next = &(name).task_list, \ | 389 | .task_list = LIST_HEAD_INIT((name).task_list), \ |
390 | .prev = &(name).task_list, \ | ||
391 | }, \ | ||
392 | } | 390 | } |
393 | 391 | ||
394 | #define DEFINE_WAIT_BIT(name, word, bit) \ | 392 | #define DEFINE_WAIT_BIT(name, word, bit) \ |
diff --git a/include/linux/wireless.h b/include/linux/wireless.h index 2f51f2b6562e..ae485f9c916e 100644 --- a/include/linux/wireless.h +++ b/include/linux/wireless.h | |||
@@ -1,10 +1,10 @@ | |||
1 | /* | 1 | /* |
2 | * This file define a set of standard wireless extensions | 2 | * This file define a set of standard wireless extensions |
3 | * | 3 | * |
4 | * Version : 17 21.6.04 | 4 | * Version : 18 12.3.05 |
5 | * | 5 | * |
6 | * Authors : Jean Tourrilhes - HPL - <jt@hpl.hp.com> | 6 | * Authors : Jean Tourrilhes - HPL - <jt@hpl.hp.com> |
7 | * Copyright (c) 1997-2004 Jean Tourrilhes, All Rights Reserved. | 7 | * Copyright (c) 1997-2005 Jean Tourrilhes, All Rights Reserved. |
8 | */ | 8 | */ |
9 | 9 | ||
10 | #ifndef _LINUX_WIRELESS_H | 10 | #ifndef _LINUX_WIRELESS_H |
@@ -82,7 +82,7 @@ | |||
82 | * (there is some stuff that will be added in the future...) | 82 | * (there is some stuff that will be added in the future...) |
83 | * I just plan to increment with each new version. | 83 | * I just plan to increment with each new version. |
84 | */ | 84 | */ |
85 | #define WIRELESS_EXT 17 | 85 | #define WIRELESS_EXT 18 |
86 | 86 | ||
87 | /* | 87 | /* |
88 | * Changes : | 88 | * Changes : |
@@ -182,6 +182,21 @@ | |||
182 | * - Document (struct iw_quality *)->updated, add new flags (INVALID) | 182 | * - Document (struct iw_quality *)->updated, add new flags (INVALID) |
183 | * - Wireless Event capability in struct iw_range | 183 | * - Wireless Event capability in struct iw_range |
184 | * - Add support for relative TxPower (yick !) | 184 | * - Add support for relative TxPower (yick !) |
185 | * | ||
186 | * V17 to V18 (From Jouni Malinen <jkmaline@cc.hut.fi>) | ||
187 | * ---------- | ||
188 | * - Add support for WPA/WPA2 | ||
189 | * - Add extended encoding configuration (SIOCSIWENCODEEXT and | ||
190 | * SIOCGIWENCODEEXT) | ||
191 | * - Add SIOCSIWGENIE/SIOCGIWGENIE | ||
192 | * - Add SIOCSIWMLME | ||
193 | * - Add SIOCSIWPMKSA | ||
194 | * - Add struct iw_range bit field for supported encoding capabilities | ||
195 | * - Add optional scan request parameters for SIOCSIWSCAN | ||
196 | * - Add SIOCSIWAUTH/SIOCGIWAUTH for setting authentication and WPA | ||
197 | * related parameters (extensible up to 4096 parameter values) | ||
198 | * - Add wireless events: IWEVGENIE, IWEVMICHAELMICFAILURE, | ||
199 | * IWEVASSOCREQIE, IWEVASSOCRESPIE, IWEVPMKIDCAND | ||
185 | */ | 200 | */ |
186 | 201 | ||
187 | /**************************** CONSTANTS ****************************/ | 202 | /**************************** CONSTANTS ****************************/ |
@@ -256,6 +271,30 @@ | |||
256 | #define SIOCSIWPOWER 0x8B2C /* set Power Management settings */ | 271 | #define SIOCSIWPOWER 0x8B2C /* set Power Management settings */ |
257 | #define SIOCGIWPOWER 0x8B2D /* get Power Management settings */ | 272 | #define SIOCGIWPOWER 0x8B2D /* get Power Management settings */ |
258 | 273 | ||
274 | /* WPA : Generic IEEE 802.11 informatiom element (e.g., for WPA/RSN/WMM). | ||
275 | * This ioctl uses struct iw_point and data buffer that includes IE id and len | ||
276 | * fields. More than one IE may be included in the request. Setting the generic | ||
277 | * IE to empty buffer (len=0) removes the generic IE from the driver. Drivers | ||
278 | * are allowed to generate their own WPA/RSN IEs, but in these cases, drivers | ||
279 | * are required to report the used IE as a wireless event, e.g., when | ||
280 | * associating with an AP. */ | ||
281 | #define SIOCSIWGENIE 0x8B30 /* set generic IE */ | ||
282 | #define SIOCGIWGENIE 0x8B31 /* get generic IE */ | ||
283 | |||
284 | /* WPA : IEEE 802.11 MLME requests */ | ||
285 | #define SIOCSIWMLME 0x8B16 /* request MLME operation; uses | ||
286 | * struct iw_mlme */ | ||
287 | /* WPA : Authentication mode parameters */ | ||
288 | #define SIOCSIWAUTH 0x8B32 /* set authentication mode params */ | ||
289 | #define SIOCGIWAUTH 0x8B33 /* get authentication mode params */ | ||
290 | |||
291 | /* WPA : Extended version of encoding configuration */ | ||
292 | #define SIOCSIWENCODEEXT 0x8B34 /* set encoding token & mode */ | ||
293 | #define SIOCGIWENCODEEXT 0x8B35 /* get encoding token & mode */ | ||
294 | |||
295 | /* WPA2 : PMKSA cache management */ | ||
296 | #define SIOCSIWPMKSA 0x8B36 /* PMKSA cache operation */ | ||
297 | |||
259 | /* -------------------- DEV PRIVATE IOCTL LIST -------------------- */ | 298 | /* -------------------- DEV PRIVATE IOCTL LIST -------------------- */ |
260 | 299 | ||
261 | /* These 32 ioctl are wireless device private, for 16 commands. | 300 | /* These 32 ioctl are wireless device private, for 16 commands. |
@@ -297,6 +336,34 @@ | |||
297 | #define IWEVCUSTOM 0x8C02 /* Driver specific ascii string */ | 336 | #define IWEVCUSTOM 0x8C02 /* Driver specific ascii string */ |
298 | #define IWEVREGISTERED 0x8C03 /* Discovered a new node (AP mode) */ | 337 | #define IWEVREGISTERED 0x8C03 /* Discovered a new node (AP mode) */ |
299 | #define IWEVEXPIRED 0x8C04 /* Expired a node (AP mode) */ | 338 | #define IWEVEXPIRED 0x8C04 /* Expired a node (AP mode) */ |
339 | #define IWEVGENIE 0x8C05 /* Generic IE (WPA, RSN, WMM, ..) | ||
340 | * (scan results); This includes id and | ||
341 | * length fields. One IWEVGENIE may | ||
342 | * contain more than one IE. Scan | ||
343 | * results may contain one or more | ||
344 | * IWEVGENIE events. */ | ||
345 | #define IWEVMICHAELMICFAILURE 0x8C06 /* Michael MIC failure | ||
346 | * (struct iw_michaelmicfailure) | ||
347 | */ | ||
348 | #define IWEVASSOCREQIE 0x8C07 /* IEs used in (Re)Association Request. | ||
349 | * The data includes id and length | ||
350 | * fields and may contain more than one | ||
351 | * IE. This event is required in | ||
352 | * Managed mode if the driver | ||
353 | * generates its own WPA/RSN IE. This | ||
354 | * should be sent just before | ||
355 | * IWEVREGISTERED event for the | ||
356 | * association. */ | ||
357 | #define IWEVASSOCRESPIE 0x8C08 /* IEs used in (Re)Association | ||
358 | * Response. The data includes id and | ||
359 | * length fields and may contain more | ||
360 | * than one IE. This may be sent | ||
361 | * between IWEVASSOCREQIE and | ||
362 | * IWEVREGISTERED events for the | ||
363 | * association. */ | ||
364 | #define IWEVPMKIDCAND 0x8C09 /* PMKID candidate for RSN | ||
365 | * pre-authentication | ||
366 | * (struct iw_pmkid_cand) */ | ||
300 | 367 | ||
301 | #define IWEVFIRST 0x8C00 | 368 | #define IWEVFIRST 0x8C00 |
302 | 369 | ||
@@ -432,12 +499,94 @@ | |||
432 | #define IW_SCAN_THIS_MODE 0x0020 /* Scan only this Mode */ | 499 | #define IW_SCAN_THIS_MODE 0x0020 /* Scan only this Mode */ |
433 | #define IW_SCAN_ALL_RATE 0x0040 /* Scan all Bit-Rates */ | 500 | #define IW_SCAN_ALL_RATE 0x0040 /* Scan all Bit-Rates */ |
434 | #define IW_SCAN_THIS_RATE 0x0080 /* Scan only this Bit-Rate */ | 501 | #define IW_SCAN_THIS_RATE 0x0080 /* Scan only this Bit-Rate */ |
502 | /* struct iw_scan_req scan_type */ | ||
503 | #define IW_SCAN_TYPE_ACTIVE 0 | ||
504 | #define IW_SCAN_TYPE_PASSIVE 1 | ||
435 | /* Maximum size of returned data */ | 505 | /* Maximum size of returned data */ |
436 | #define IW_SCAN_MAX_DATA 4096 /* In bytes */ | 506 | #define IW_SCAN_MAX_DATA 4096 /* In bytes */ |
437 | 507 | ||
438 | /* Max number of char in custom event - use multiple of them if needed */ | 508 | /* Max number of char in custom event - use multiple of them if needed */ |
439 | #define IW_CUSTOM_MAX 256 /* In bytes */ | 509 | #define IW_CUSTOM_MAX 256 /* In bytes */ |
440 | 510 | ||
511 | /* Generic information element */ | ||
512 | #define IW_GENERIC_IE_MAX 1024 | ||
513 | |||
514 | /* MLME requests (SIOCSIWMLME / struct iw_mlme) */ | ||
515 | #define IW_MLME_DEAUTH 0 | ||
516 | #define IW_MLME_DISASSOC 1 | ||
517 | |||
518 | /* SIOCSIWAUTH/SIOCGIWAUTH struct iw_param flags */ | ||
519 | #define IW_AUTH_INDEX 0x0FFF | ||
520 | #define IW_AUTH_FLAGS 0xF000 | ||
521 | /* SIOCSIWAUTH/SIOCGIWAUTH parameters (0 .. 4095) | ||
522 | * (IW_AUTH_INDEX mask in struct iw_param flags; this is the index of the | ||
523 | * parameter that is being set/get to; value will be read/written to | ||
524 | * struct iw_param value field) */ | ||
525 | #define IW_AUTH_WPA_VERSION 0 | ||
526 | #define IW_AUTH_CIPHER_PAIRWISE 1 | ||
527 | #define IW_AUTH_CIPHER_GROUP 2 | ||
528 | #define IW_AUTH_KEY_MGMT 3 | ||
529 | #define IW_AUTH_TKIP_COUNTERMEASURES 4 | ||
530 | #define IW_AUTH_DROP_UNENCRYPTED 5 | ||
531 | #define IW_AUTH_80211_AUTH_ALG 6 | ||
532 | #define IW_AUTH_WPA_ENABLED 7 | ||
533 | #define IW_AUTH_RX_UNENCRYPTED_EAPOL 8 | ||
534 | #define IW_AUTH_ROAMING_CONTROL 9 | ||
535 | #define IW_AUTH_PRIVACY_INVOKED 10 | ||
536 | |||
537 | /* IW_AUTH_WPA_VERSION values (bit field) */ | ||
538 | #define IW_AUTH_WPA_VERSION_DISABLED 0x00000001 | ||
539 | #define IW_AUTH_WPA_VERSION_WPA 0x00000002 | ||
540 | #define IW_AUTH_WPA_VERSION_WPA2 0x00000004 | ||
541 | |||
542 | /* IW_AUTH_PAIRWISE_CIPHER and IW_AUTH_GROUP_CIPHER values (bit field) */ | ||
543 | #define IW_AUTH_CIPHER_NONE 0x00000001 | ||
544 | #define IW_AUTH_CIPHER_WEP40 0x00000002 | ||
545 | #define IW_AUTH_CIPHER_TKIP 0x00000004 | ||
546 | #define IW_AUTH_CIPHER_CCMP 0x00000008 | ||
547 | #define IW_AUTH_CIPHER_WEP104 0x00000010 | ||
548 | |||
549 | /* IW_AUTH_KEY_MGMT values (bit field) */ | ||
550 | #define IW_AUTH_KEY_MGMT_802_1X 1 | ||
551 | #define IW_AUTH_KEY_MGMT_PSK 2 | ||
552 | |||
553 | /* IW_AUTH_80211_AUTH_ALG values (bit field) */ | ||
554 | #define IW_AUTH_ALG_OPEN_SYSTEM 0x00000001 | ||
555 | #define IW_AUTH_ALG_SHARED_KEY 0x00000002 | ||
556 | #define IW_AUTH_ALG_LEAP 0x00000004 | ||
557 | |||
558 | /* IW_AUTH_ROAMING_CONTROL values */ | ||
559 | #define IW_AUTH_ROAMING_ENABLE 0 /* driver/firmware based roaming */ | ||
560 | #define IW_AUTH_ROAMING_DISABLE 1 /* user space program used for roaming | ||
561 | * control */ | ||
562 | |||
563 | /* SIOCSIWENCODEEXT definitions */ | ||
564 | #define IW_ENCODE_SEQ_MAX_SIZE 8 | ||
565 | /* struct iw_encode_ext ->alg */ | ||
566 | #define IW_ENCODE_ALG_NONE 0 | ||
567 | #define IW_ENCODE_ALG_WEP 1 | ||
568 | #define IW_ENCODE_ALG_TKIP 2 | ||
569 | #define IW_ENCODE_ALG_CCMP 3 | ||
570 | /* struct iw_encode_ext ->ext_flags */ | ||
571 | #define IW_ENCODE_EXT_TX_SEQ_VALID 0x00000001 | ||
572 | #define IW_ENCODE_EXT_RX_SEQ_VALID 0x00000002 | ||
573 | #define IW_ENCODE_EXT_GROUP_KEY 0x00000004 | ||
574 | #define IW_ENCODE_EXT_SET_TX_KEY 0x00000008 | ||
575 | |||
576 | /* IWEVMICHAELMICFAILURE : struct iw_michaelmicfailure ->flags */ | ||
577 | #define IW_MICFAILURE_KEY_ID 0x00000003 /* Key ID 0..3 */ | ||
578 | #define IW_MICFAILURE_GROUP 0x00000004 | ||
579 | #define IW_MICFAILURE_PAIRWISE 0x00000008 | ||
580 | #define IW_MICFAILURE_STAKEY 0x00000010 | ||
581 | #define IW_MICFAILURE_COUNT 0x00000060 /* 1 or 2 (0 = count not supported) | ||
582 | */ | ||
583 | |||
584 | /* Bit field values for enc_capa in struct iw_range */ | ||
585 | #define IW_ENC_CAPA_WPA 0x00000001 | ||
586 | #define IW_ENC_CAPA_WPA2 0x00000002 | ||
587 | #define IW_ENC_CAPA_CIPHER_TKIP 0x00000004 | ||
588 | #define IW_ENC_CAPA_CIPHER_CCMP 0x00000008 | ||
589 | |||
441 | /* Event capability macros - in (struct iw_range *)->event_capa | 590 | /* Event capability macros - in (struct iw_range *)->event_capa |
442 | * Because we have more than 32 possible events, we use an array of | 591 | * Because we have more than 32 possible events, we use an array of |
443 | * 32 bit bitmasks. Note : 32 bits = 0x20 = 2^5. */ | 592 | * 32 bit bitmasks. Note : 32 bits = 0x20 = 2^5. */ |
@@ -546,6 +695,132 @@ struct iw_thrspy | |||
546 | struct iw_quality high; /* High threshold */ | 695 | struct iw_quality high; /* High threshold */ |
547 | }; | 696 | }; |
548 | 697 | ||
698 | /* | ||
699 | * Optional data for scan request | ||
700 | * | ||
701 | * Note: these optional parameters are controlling parameters for the | ||
702 | * scanning behavior, these do not apply to getting scan results | ||
703 | * (SIOCGIWSCAN). Drivers are expected to keep a local BSS table and | ||
704 | * provide a merged results with all BSSes even if the previous scan | ||
705 | * request limited scanning to a subset, e.g., by specifying an SSID. | ||
706 | * Especially, scan results are required to include an entry for the | ||
707 | * current BSS if the driver is in Managed mode and associated with an AP. | ||
708 | */ | ||
709 | struct iw_scan_req | ||
710 | { | ||
711 | __u8 scan_type; /* IW_SCAN_TYPE_{ACTIVE,PASSIVE} */ | ||
712 | __u8 essid_len; | ||
713 | __u8 num_channels; /* num entries in channel_list; | ||
714 | * 0 = scan all allowed channels */ | ||
715 | __u8 flags; /* reserved as padding; use zero, this may | ||
716 | * be used in the future for adding flags | ||
717 | * to request different scan behavior */ | ||
718 | struct sockaddr bssid; /* ff:ff:ff:ff:ff:ff for broadcast BSSID or | ||
719 | * individual address of a specific BSS */ | ||
720 | |||
721 | /* | ||
722 | * Use this ESSID if IW_SCAN_THIS_ESSID flag is used instead of using | ||
723 | * the current ESSID. This allows scan requests for specific ESSID | ||
724 | * without having to change the current ESSID and potentially breaking | ||
725 | * the current association. | ||
726 | */ | ||
727 | __u8 essid[IW_ESSID_MAX_SIZE]; | ||
728 | |||
729 | /* | ||
730 | * Optional parameters for changing the default scanning behavior. | ||
731 | * These are based on the MLME-SCAN.request from IEEE Std 802.11. | ||
732 | * TU is 1.024 ms. If these are set to 0, driver is expected to use | ||
733 | * reasonable default values. min_channel_time defines the time that | ||
734 | * will be used to wait for the first reply on each channel. If no | ||
735 | * replies are received, next channel will be scanned after this. If | ||
736 | * replies are received, total time waited on the channel is defined by | ||
737 | * max_channel_time. | ||
738 | */ | ||
739 | __u32 min_channel_time; /* in TU */ | ||
740 | __u32 max_channel_time; /* in TU */ | ||
741 | |||
742 | struct iw_freq channel_list[IW_MAX_FREQUENCIES]; | ||
743 | }; | ||
744 | |||
745 | /* ------------------------- WPA SUPPORT ------------------------- */ | ||
746 | |||
747 | /* | ||
748 | * Extended data structure for get/set encoding (this is used with | ||
749 | * SIOCSIWENCODEEXT/SIOCGIWENCODEEXT. struct iw_point and IW_ENCODE_* | ||
750 | * flags are used in the same way as with SIOCSIWENCODE/SIOCGIWENCODE and | ||
751 | * only the data contents changes (key data -> this structure, including | ||
752 | * key data). | ||
753 | * | ||
754 | * If the new key is the first group key, it will be set as the default | ||
755 | * TX key. Otherwise, default TX key index is only changed if | ||
756 | * IW_ENCODE_EXT_SET_TX_KEY flag is set. | ||
757 | * | ||
758 | * Key will be changed with SIOCSIWENCODEEXT in all cases except for | ||
759 | * special "change TX key index" operation which is indicated by setting | ||
760 | * key_len = 0 and ext_flags |= IW_ENCODE_EXT_SET_TX_KEY. | ||
761 | * | ||
762 | * tx_seq/rx_seq are only used when respective | ||
763 | * IW_ENCODE_EXT_{TX,RX}_SEQ_VALID flag is set in ext_flags. Normal | ||
764 | * TKIP/CCMP operation is to set RX seq with SIOCSIWENCODEEXT and start | ||
765 | * TX seq from zero whenever key is changed. SIOCGIWENCODEEXT is normally | ||
766 | * used only by an Authenticator (AP or an IBSS station) to get the | ||
767 | * current TX sequence number. Using TX_SEQ_VALID for SIOCSIWENCODEEXT and | ||
768 | * RX_SEQ_VALID for SIOCGIWENCODEEXT are optional, but can be useful for | ||
769 | * debugging/testing. | ||
770 | */ | ||
771 | struct iw_encode_ext | ||
772 | { | ||
773 | __u32 ext_flags; /* IW_ENCODE_EXT_* */ | ||
774 | __u8 tx_seq[IW_ENCODE_SEQ_MAX_SIZE]; /* LSB first */ | ||
775 | __u8 rx_seq[IW_ENCODE_SEQ_MAX_SIZE]; /* LSB first */ | ||
776 | struct sockaddr addr; /* ff:ff:ff:ff:ff:ff for broadcast/multicast | ||
777 | * (group) keys or unicast address for | ||
778 | * individual keys */ | ||
779 | __u16 alg; /* IW_ENCODE_ALG_* */ | ||
780 | __u16 key_len; | ||
781 | __u8 key[0]; | ||
782 | }; | ||
783 | |||
784 | /* SIOCSIWMLME data */ | ||
785 | struct iw_mlme | ||
786 | { | ||
787 | __u16 cmd; /* IW_MLME_* */ | ||
788 | __u16 reason_code; | ||
789 | struct sockaddr addr; | ||
790 | }; | ||
791 | |||
792 | /* SIOCSIWPMKSA data */ | ||
793 | #define IW_PMKSA_ADD 1 | ||
794 | #define IW_PMKSA_REMOVE 2 | ||
795 | #define IW_PMKSA_FLUSH 3 | ||
796 | |||
797 | #define IW_PMKID_LEN 16 | ||
798 | |||
799 | struct iw_pmksa | ||
800 | { | ||
801 | __u32 cmd; /* IW_PMKSA_* */ | ||
802 | struct sockaddr bssid; | ||
803 | __u8 pmkid[IW_PMKID_LEN]; | ||
804 | }; | ||
805 | |||
806 | /* IWEVMICHAELMICFAILURE data */ | ||
807 | struct iw_michaelmicfailure | ||
808 | { | ||
809 | __u32 flags; | ||
810 | struct sockaddr src_addr; | ||
811 | __u8 tsc[IW_ENCODE_SEQ_MAX_SIZE]; /* LSB first */ | ||
812 | }; | ||
813 | |||
814 | /* IWEVPMKIDCAND data */ | ||
815 | #define IW_PMKID_CAND_PREAUTH 0x00000001 /* RNS pre-authentication enabled */ | ||
816 | struct iw_pmkid_cand | ||
817 | { | ||
818 | __u32 flags; /* IW_PMKID_CAND_* */ | ||
819 | __u32 index; /* the smaller the index, the higher the | ||
820 | * priority */ | ||
821 | struct sockaddr bssid; | ||
822 | }; | ||
823 | |||
549 | /* ------------------------ WIRELESS STATS ------------------------ */ | 824 | /* ------------------------ WIRELESS STATS ------------------------ */ |
550 | /* | 825 | /* |
551 | * Wireless statistics (used for /proc/net/wireless) | 826 | * Wireless statistics (used for /proc/net/wireless) |
@@ -725,6 +1000,8 @@ struct iw_range | |||
725 | struct iw_freq freq[IW_MAX_FREQUENCIES]; /* list */ | 1000 | struct iw_freq freq[IW_MAX_FREQUENCIES]; /* list */ |
726 | /* Note : this frequency list doesn't need to fit channel numbers, | 1001 | /* Note : this frequency list doesn't need to fit channel numbers, |
727 | * because each entry contain its channel index */ | 1002 | * because each entry contain its channel index */ |
1003 | |||
1004 | __u32 enc_capa; /* IW_ENC_CAPA_* bit field */ | ||
728 | }; | 1005 | }; |
729 | 1006 | ||
730 | /* | 1007 | /* |
diff --git a/include/linux/xfrm.h b/include/linux/xfrm.h index fd2ef742a9fd..f0d423300d84 100644 --- a/include/linux/xfrm.h +++ b/include/linux/xfrm.h | |||
@@ -174,6 +174,8 @@ enum xfrm_attr_type_t { | |||
174 | XFRMA_ALG_COMP, /* struct xfrm_algo */ | 174 | XFRMA_ALG_COMP, /* struct xfrm_algo */ |
175 | XFRMA_ENCAP, /* struct xfrm_algo + struct xfrm_encap_tmpl */ | 175 | XFRMA_ENCAP, /* struct xfrm_algo + struct xfrm_encap_tmpl */ |
176 | XFRMA_TMPL, /* 1 or more struct xfrm_user_tmpl */ | 176 | XFRMA_TMPL, /* 1 or more struct xfrm_user_tmpl */ |
177 | XFRMA_SA, | ||
178 | XFRMA_POLICY, | ||
177 | __XFRMA_MAX | 179 | __XFRMA_MAX |
178 | 180 | ||
179 | #define XFRMA_MAX (__XFRMA_MAX - 1) | 181 | #define XFRMA_MAX (__XFRMA_MAX - 1) |
@@ -194,6 +196,7 @@ struct xfrm_usersa_info { | |||
194 | __u8 flags; | 196 | __u8 flags; |
195 | #define XFRM_STATE_NOECN 1 | 197 | #define XFRM_STATE_NOECN 1 |
196 | #define XFRM_STATE_DECAP_DSCP 2 | 198 | #define XFRM_STATE_DECAP_DSCP 2 |
199 | #define XFRM_STATE_NOPMTUDISC 4 | ||
197 | }; | 200 | }; |
198 | 201 | ||
199 | struct xfrm_usersa_id { | 202 | struct xfrm_usersa_id { |
@@ -257,5 +260,7 @@ struct xfrm_usersa_flush { | |||
257 | 260 | ||
258 | #define XFRMGRP_ACQUIRE 1 | 261 | #define XFRMGRP_ACQUIRE 1 |
259 | #define XFRMGRP_EXPIRE 2 | 262 | #define XFRMGRP_EXPIRE 2 |
263 | #define XFRMGRP_SA 4 | ||
264 | #define XFRMGRP_POLICY 8 | ||
260 | 265 | ||
261 | #endif /* _LINUX_XFRM_H */ | 266 | #endif /* _LINUX_XFRM_H */ |
diff --git a/include/media/video-buf-dvb.h b/include/media/video-buf-dvb.h index 94bd33619aa5..ad0a07a3a895 100644 --- a/include/media/video-buf-dvb.h +++ b/include/media/video-buf-dvb.h | |||
@@ -16,7 +16,7 @@ struct videobuf_dvb { | |||
16 | int nfeeds; | 16 | int nfeeds; |
17 | 17 | ||
18 | /* videobuf_dvb_(un)register manges this */ | 18 | /* videobuf_dvb_(un)register manges this */ |
19 | struct dvb_adapter *adapter; | 19 | struct dvb_adapter adapter; |
20 | struct dvb_demux demux; | 20 | struct dvb_demux demux; |
21 | struct dmxdev dmxdev; | 21 | struct dmxdev dmxdev; |
22 | struct dmx_frontend fe_hw; | 22 | struct dmx_frontend fe_hw; |
diff --git a/include/net/act_generic.h b/include/net/act_generic.h index 95b120781c14..c9daa7e52300 100644 --- a/include/net/act_generic.h +++ b/include/net/act_generic.h | |||
@@ -2,8 +2,8 @@ | |||
2 | * include/net/act_generic.h | 2 | * include/net/act_generic.h |
3 | * | 3 | * |
4 | */ | 4 | */ |
5 | #ifndef ACT_GENERIC_H | 5 | #ifndef _NET_ACT_GENERIC_H |
6 | #define ACT_GENERIC_H | 6 | #define _NET_ACT_GENERIC_H |
7 | static inline int tcf_defact_release(struct tcf_defact *p, int bind) | 7 | static inline int tcf_defact_release(struct tcf_defact *p, int bind) |
8 | { | 8 | { |
9 | int ret = 0; | 9 | int ret = 0; |
diff --git a/include/net/ax25.h b/include/net/ax25.h index 9e6368a54547..828a3a93dda1 100644 --- a/include/net/ax25.h +++ b/include/net/ax25.h | |||
@@ -220,7 +220,7 @@ static __inline__ void ax25_cb_put(ax25_cb *ax25) | |||
220 | } | 220 | } |
221 | } | 221 | } |
222 | 222 | ||
223 | static inline unsigned short ax25_type_trans(struct sk_buff *skb, struct net_device *dev) | 223 | static inline __be16 ax25_type_trans(struct sk_buff *skb, struct net_device *dev) |
224 | { | 224 | { |
225 | skb->dev = dev; | 225 | skb->dev = dev; |
226 | skb->pkt_type = PACKET_HOST; | 226 | skb->pkt_type = PACKET_HOST; |
diff --git a/include/net/ip.h b/include/net/ip.h index 3f63992eb712..32360bbe143f 100644 --- a/include/net/ip.h +++ b/include/net/ip.h | |||
@@ -163,6 +163,7 @@ DECLARE_SNMP_STAT(struct linux_mib, net_statistics); | |||
163 | 163 | ||
164 | extern int sysctl_local_port_range[2]; | 164 | extern int sysctl_local_port_range[2]; |
165 | extern int sysctl_ip_default_ttl; | 165 | extern int sysctl_ip_default_ttl; |
166 | extern int sysctl_ip_nonlocal_bind; | ||
166 | 167 | ||
167 | #ifdef CONFIG_INET | 168 | #ifdef CONFIG_INET |
168 | /* The function in 2.2 was invalid, producing wrong result for | 169 | /* The function in 2.2 was invalid, producing wrong result for |
diff --git a/include/net/ip6_fib.h b/include/net/ip6_fib.h index 319904518194..a66e9de16a6c 100644 --- a/include/net/ip6_fib.h +++ b/include/net/ip6_fib.h | |||
@@ -167,14 +167,17 @@ extern int fib6_walk_continue(struct fib6_walker_t *w); | |||
167 | extern int fib6_add(struct fib6_node *root, | 167 | extern int fib6_add(struct fib6_node *root, |
168 | struct rt6_info *rt, | 168 | struct rt6_info *rt, |
169 | struct nlmsghdr *nlh, | 169 | struct nlmsghdr *nlh, |
170 | void *rtattr); | 170 | void *rtattr, |
171 | struct netlink_skb_parms *req); | ||
171 | 172 | ||
172 | extern int fib6_del(struct rt6_info *rt, | 173 | extern int fib6_del(struct rt6_info *rt, |
173 | struct nlmsghdr *nlh, | 174 | struct nlmsghdr *nlh, |
174 | void *rtattr); | 175 | void *rtattr, |
176 | struct netlink_skb_parms *req); | ||
175 | 177 | ||
176 | extern void inet6_rt_notify(int event, struct rt6_info *rt, | 178 | extern void inet6_rt_notify(int event, struct rt6_info *rt, |
177 | struct nlmsghdr *nlh); | 179 | struct nlmsghdr *nlh, |
180 | struct netlink_skb_parms *req); | ||
178 | 181 | ||
179 | extern void fib6_run_gc(unsigned long dummy); | 182 | extern void fib6_run_gc(unsigned long dummy); |
180 | 183 | ||
diff --git a/include/net/ip6_route.h b/include/net/ip6_route.h index d5d1dd10cdb8..f920706d526b 100644 --- a/include/net/ip6_route.h +++ b/include/net/ip6_route.h | |||
@@ -41,13 +41,16 @@ extern int ipv6_route_ioctl(unsigned int cmd, void __user *arg); | |||
41 | 41 | ||
42 | extern int ip6_route_add(struct in6_rtmsg *rtmsg, | 42 | extern int ip6_route_add(struct in6_rtmsg *rtmsg, |
43 | struct nlmsghdr *, | 43 | struct nlmsghdr *, |
44 | void *rtattr); | 44 | void *rtattr, |
45 | struct netlink_skb_parms *req); | ||
45 | extern int ip6_ins_rt(struct rt6_info *, | 46 | extern int ip6_ins_rt(struct rt6_info *, |
46 | struct nlmsghdr *, | 47 | struct nlmsghdr *, |
47 | void *rtattr); | 48 | void *rtattr, |
49 | struct netlink_skb_parms *req); | ||
48 | extern int ip6_del_rt(struct rt6_info *, | 50 | extern int ip6_del_rt(struct rt6_info *, |
49 | struct nlmsghdr *, | 51 | struct nlmsghdr *, |
50 | void *rtattr); | 52 | void *rtattr, |
53 | struct netlink_skb_parms *req); | ||
51 | 54 | ||
52 | extern int ip6_rt_addr_add(struct in6_addr *addr, | 55 | extern int ip6_rt_addr_add(struct in6_addr *addr, |
53 | struct net_device *dev, | 56 | struct net_device *dev, |
diff --git a/include/net/ip_fib.h b/include/net/ip_fib.h index e5a5f6b62f88..a4208a336ac0 100644 --- a/include/net/ip_fib.h +++ b/include/net/ip_fib.h | |||
@@ -109,6 +109,20 @@ struct fib_result { | |||
109 | #endif | 109 | #endif |
110 | }; | 110 | }; |
111 | 111 | ||
112 | struct fib_result_nl { | ||
113 | u32 fl_addr; /* To be looked up*/ | ||
114 | u32 fl_fwmark; | ||
115 | unsigned char fl_tos; | ||
116 | unsigned char fl_scope; | ||
117 | unsigned char tb_id_in; | ||
118 | |||
119 | unsigned char tb_id; /* Results */ | ||
120 | unsigned char prefixlen; | ||
121 | unsigned char nh_sel; | ||
122 | unsigned char type; | ||
123 | unsigned char scope; | ||
124 | int err; | ||
125 | }; | ||
112 | 126 | ||
113 | #ifdef CONFIG_IP_ROUTE_MULTIPATH | 127 | #ifdef CONFIG_IP_ROUTE_MULTIPATH |
114 | 128 | ||
diff --git a/include/net/neighbour.h b/include/net/neighbour.h index 4f33bbc21e7f..89809891e5ab 100644 --- a/include/net/neighbour.h +++ b/include/net/neighbour.h | |||
@@ -65,11 +65,10 @@ struct neighbour; | |||
65 | 65 | ||
66 | struct neigh_parms | 66 | struct neigh_parms |
67 | { | 67 | { |
68 | struct net_device *dev; | ||
68 | struct neigh_parms *next; | 69 | struct neigh_parms *next; |
69 | int (*neigh_setup)(struct neighbour *); | 70 | int (*neigh_setup)(struct neighbour *); |
70 | struct neigh_table *tbl; | 71 | struct neigh_table *tbl; |
71 | int entries; | ||
72 | void *priv; | ||
73 | 72 | ||
74 | void *sysctl_table; | 73 | void *sysctl_table; |
75 | 74 | ||
@@ -192,7 +191,6 @@ struct neigh_table | |||
192 | atomic_t entries; | 191 | atomic_t entries; |
193 | rwlock_t lock; | 192 | rwlock_t lock; |
194 | unsigned long last_rand; | 193 | unsigned long last_rand; |
195 | struct neigh_parms *parms_list; | ||
196 | kmem_cache_t *kmem_cachep; | 194 | kmem_cache_t *kmem_cachep; |
197 | struct neigh_statistics *stats; | 195 | struct neigh_statistics *stats; |
198 | struct neighbour **hash_buckets; | 196 | struct neighbour **hash_buckets; |
@@ -252,6 +250,9 @@ extern int neigh_add(struct sk_buff *skb, struct nlmsghdr *nlh, void *arg); | |||
252 | extern int neigh_delete(struct sk_buff *skb, struct nlmsghdr *nlh, void *arg); | 250 | extern int neigh_delete(struct sk_buff *skb, struct nlmsghdr *nlh, void *arg); |
253 | extern void neigh_app_ns(struct neighbour *n); | 251 | extern void neigh_app_ns(struct neighbour *n); |
254 | 252 | ||
253 | extern int neightbl_dump_info(struct sk_buff *skb, struct netlink_callback *cb); | ||
254 | extern int neightbl_set(struct sk_buff *skb, struct nlmsghdr *nlh, void *arg); | ||
255 | |||
255 | extern void neigh_for_each(struct neigh_table *tbl, void (*cb)(struct neighbour *, void *), void *cookie); | 256 | extern void neigh_for_each(struct neigh_table *tbl, void (*cb)(struct neighbour *, void *), void *cookie); |
256 | extern void __neigh_for_each_release(struct neigh_table *tbl, int (*cb)(struct neighbour *)); | 257 | extern void __neigh_for_each_release(struct neigh_table *tbl, int (*cb)(struct neighbour *)); |
257 | extern void pneigh_for_each(struct neigh_table *tbl, void (*cb)(struct pneigh_entry *)); | 258 | extern void pneigh_for_each(struct neigh_table *tbl, void (*cb)(struct pneigh_entry *)); |
diff --git a/include/net/request_sock.h b/include/net/request_sock.h new file mode 100644 index 000000000000..72fd6f5e86b1 --- /dev/null +++ b/include/net/request_sock.h | |||
@@ -0,0 +1,255 @@ | |||
1 | /* | ||
2 | * NET Generic infrastructure for Network protocols. | ||
3 | * | ||
4 | * Definitions for request_sock | ||
5 | * | ||
6 | * Authors: Arnaldo Carvalho de Melo <acme@conectiva.com.br> | ||
7 | * | ||
8 | * From code originally in include/net/tcp.h | ||
9 | * | ||
10 | * This program is free software; you can redistribute it and/or | ||
11 | * modify it under the terms of the GNU General Public License | ||
12 | * as published by the Free Software Foundation; either version | ||
13 | * 2 of the License, or (at your option) any later version. | ||
14 | */ | ||
15 | #ifndef _REQUEST_SOCK_H | ||
16 | #define _REQUEST_SOCK_H | ||
17 | |||
18 | #include <linux/slab.h> | ||
19 | #include <linux/spinlock.h> | ||
20 | #include <linux/types.h> | ||
21 | |||
22 | #include <net/sock.h> | ||
23 | |||
24 | struct request_sock; | ||
25 | struct sk_buff; | ||
26 | struct dst_entry; | ||
27 | struct proto; | ||
28 | |||
29 | struct request_sock_ops { | ||
30 | int family; | ||
31 | kmem_cache_t *slab; | ||
32 | int obj_size; | ||
33 | int (*rtx_syn_ack)(struct sock *sk, | ||
34 | struct request_sock *req, | ||
35 | struct dst_entry *dst); | ||
36 | void (*send_ack)(struct sk_buff *skb, | ||
37 | struct request_sock *req); | ||
38 | void (*send_reset)(struct sk_buff *skb); | ||
39 | void (*destructor)(struct request_sock *req); | ||
40 | }; | ||
41 | |||
42 | /* struct request_sock - mini sock to represent a connection request | ||
43 | */ | ||
44 | struct request_sock { | ||
45 | struct request_sock *dl_next; /* Must be first member! */ | ||
46 | u16 mss; | ||
47 | u8 retrans; | ||
48 | u8 __pad; | ||
49 | /* The following two fields can be easily recomputed I think -AK */ | ||
50 | u32 window_clamp; /* window clamp at creation time */ | ||
51 | u32 rcv_wnd; /* rcv_wnd offered first time */ | ||
52 | u32 ts_recent; | ||
53 | unsigned long expires; | ||
54 | struct request_sock_ops *rsk_ops; | ||
55 | struct sock *sk; | ||
56 | }; | ||
57 | |||
58 | static inline struct request_sock *reqsk_alloc(struct request_sock_ops *ops) | ||
59 | { | ||
60 | struct request_sock *req = kmem_cache_alloc(ops->slab, SLAB_ATOMIC); | ||
61 | |||
62 | if (req != NULL) | ||
63 | req->rsk_ops = ops; | ||
64 | |||
65 | return req; | ||
66 | } | ||
67 | |||
68 | static inline void __reqsk_free(struct request_sock *req) | ||
69 | { | ||
70 | kmem_cache_free(req->rsk_ops->slab, req); | ||
71 | } | ||
72 | |||
73 | static inline void reqsk_free(struct request_sock *req) | ||
74 | { | ||
75 | req->rsk_ops->destructor(req); | ||
76 | __reqsk_free(req); | ||
77 | } | ||
78 | |||
79 | extern int sysctl_max_syn_backlog; | ||
80 | |||
81 | /** struct listen_sock - listen state | ||
82 | * | ||
83 | * @max_qlen_log - log_2 of maximal queued SYNs/REQUESTs | ||
84 | */ | ||
85 | struct listen_sock { | ||
86 | u8 max_qlen_log; | ||
87 | /* 3 bytes hole, try to use */ | ||
88 | int qlen; | ||
89 | int qlen_young; | ||
90 | int clock_hand; | ||
91 | u32 hash_rnd; | ||
92 | struct request_sock *syn_table[0]; | ||
93 | }; | ||
94 | |||
95 | /** struct request_sock_queue - queue of request_socks | ||
96 | * | ||
97 | * @rskq_accept_head - FIFO head of established children | ||
98 | * @rskq_accept_tail - FIFO tail of established children | ||
99 | * @syn_wait_lock - serializer | ||
100 | * | ||
101 | * %syn_wait_lock is necessary only to avoid proc interface having to grab the main | ||
102 | * lock sock while browsing the listening hash (otherwise it's deadlock prone). | ||
103 | * | ||
104 | * This lock is acquired in read mode only from listening_get_next() seq_file | ||
105 | * op and it's acquired in write mode _only_ from code that is actively | ||
106 | * changing rskq_accept_head. All readers that are holding the master sock lock | ||
107 | * don't need to grab this lock in read mode too as rskq_accept_head. writes | ||
108 | * are always protected from the main sock lock. | ||
109 | */ | ||
110 | struct request_sock_queue { | ||
111 | struct request_sock *rskq_accept_head; | ||
112 | struct request_sock *rskq_accept_tail; | ||
113 | rwlock_t syn_wait_lock; | ||
114 | struct listen_sock *listen_opt; | ||
115 | }; | ||
116 | |||
117 | extern int reqsk_queue_alloc(struct request_sock_queue *queue, | ||
118 | const int nr_table_entries); | ||
119 | |||
120 | static inline struct listen_sock *reqsk_queue_yank_listen_sk(struct request_sock_queue *queue) | ||
121 | { | ||
122 | struct listen_sock *lopt; | ||
123 | |||
124 | write_lock_bh(&queue->syn_wait_lock); | ||
125 | lopt = queue->listen_opt; | ||
126 | queue->listen_opt = NULL; | ||
127 | write_unlock_bh(&queue->syn_wait_lock); | ||
128 | |||
129 | return lopt; | ||
130 | } | ||
131 | |||
132 | static inline void reqsk_queue_destroy(struct request_sock_queue *queue) | ||
133 | { | ||
134 | kfree(reqsk_queue_yank_listen_sk(queue)); | ||
135 | } | ||
136 | |||
137 | static inline struct request_sock * | ||
138 | reqsk_queue_yank_acceptq(struct request_sock_queue *queue) | ||
139 | { | ||
140 | struct request_sock *req = queue->rskq_accept_head; | ||
141 | |||
142 | queue->rskq_accept_head = queue->rskq_accept_head = NULL; | ||
143 | return req; | ||
144 | } | ||
145 | |||
146 | static inline int reqsk_queue_empty(struct request_sock_queue *queue) | ||
147 | { | ||
148 | return queue->rskq_accept_head == NULL; | ||
149 | } | ||
150 | |||
151 | static inline void reqsk_queue_unlink(struct request_sock_queue *queue, | ||
152 | struct request_sock *req, | ||
153 | struct request_sock **prev_req) | ||
154 | { | ||
155 | write_lock(&queue->syn_wait_lock); | ||
156 | *prev_req = req->dl_next; | ||
157 | write_unlock(&queue->syn_wait_lock); | ||
158 | } | ||
159 | |||
160 | static inline void reqsk_queue_add(struct request_sock_queue *queue, | ||
161 | struct request_sock *req, | ||
162 | struct sock *parent, | ||
163 | struct sock *child) | ||
164 | { | ||
165 | req->sk = child; | ||
166 | sk_acceptq_added(parent); | ||
167 | |||
168 | if (queue->rskq_accept_head == NULL) | ||
169 | queue->rskq_accept_head = req; | ||
170 | else | ||
171 | queue->rskq_accept_tail->dl_next = req; | ||
172 | |||
173 | queue->rskq_accept_tail = req; | ||
174 | req->dl_next = NULL; | ||
175 | } | ||
176 | |||
177 | static inline struct request_sock *reqsk_queue_remove(struct request_sock_queue *queue) | ||
178 | { | ||
179 | struct request_sock *req = queue->rskq_accept_head; | ||
180 | |||
181 | BUG_TRAP(req != NULL); | ||
182 | |||
183 | queue->rskq_accept_head = req->dl_next; | ||
184 | if (queue->rskq_accept_head == NULL) | ||
185 | queue->rskq_accept_tail = NULL; | ||
186 | |||
187 | return req; | ||
188 | } | ||
189 | |||
190 | static inline struct sock *reqsk_queue_get_child(struct request_sock_queue *queue, | ||
191 | struct sock *parent) | ||
192 | { | ||
193 | struct request_sock *req = reqsk_queue_remove(queue); | ||
194 | struct sock *child = req->sk; | ||
195 | |||
196 | BUG_TRAP(child != NULL); | ||
197 | |||
198 | sk_acceptq_removed(parent); | ||
199 | __reqsk_free(req); | ||
200 | return child; | ||
201 | } | ||
202 | |||
203 | static inline int reqsk_queue_removed(struct request_sock_queue *queue, | ||
204 | struct request_sock *req) | ||
205 | { | ||
206 | struct listen_sock *lopt = queue->listen_opt; | ||
207 | |||
208 | if (req->retrans == 0) | ||
209 | --lopt->qlen_young; | ||
210 | |||
211 | return --lopt->qlen; | ||
212 | } | ||
213 | |||
214 | static inline int reqsk_queue_added(struct request_sock_queue *queue) | ||
215 | { | ||
216 | struct listen_sock *lopt = queue->listen_opt; | ||
217 | const int prev_qlen = lopt->qlen; | ||
218 | |||
219 | lopt->qlen_young++; | ||
220 | lopt->qlen++; | ||
221 | return prev_qlen; | ||
222 | } | ||
223 | |||
224 | static inline int reqsk_queue_len(struct request_sock_queue *queue) | ||
225 | { | ||
226 | return queue->listen_opt != NULL ? queue->listen_opt->qlen : 0; | ||
227 | } | ||
228 | |||
229 | static inline int reqsk_queue_len_young(struct request_sock_queue *queue) | ||
230 | { | ||
231 | return queue->listen_opt->qlen_young; | ||
232 | } | ||
233 | |||
234 | static inline int reqsk_queue_is_full(struct request_sock_queue *queue) | ||
235 | { | ||
236 | return queue->listen_opt->qlen >> queue->listen_opt->max_qlen_log; | ||
237 | } | ||
238 | |||
239 | static inline void reqsk_queue_hash_req(struct request_sock_queue *queue, | ||
240 | u32 hash, struct request_sock *req, | ||
241 | unsigned timeout) | ||
242 | { | ||
243 | struct listen_sock *lopt = queue->listen_opt; | ||
244 | |||
245 | req->expires = jiffies + timeout; | ||
246 | req->retrans = 0; | ||
247 | req->sk = NULL; | ||
248 | req->dl_next = lopt->syn_table[hash]; | ||
249 | |||
250 | write_lock(&queue->syn_wait_lock); | ||
251 | lopt->syn_table[hash] = req; | ||
252 | write_unlock(&queue->syn_wait_lock); | ||
253 | } | ||
254 | |||
255 | #endif /* _REQUEST_SOCK_H */ | ||
diff --git a/include/net/route.h b/include/net/route.h index efe92b239ef1..c3cd069a9aca 100644 --- a/include/net/route.h +++ b/include/net/route.h | |||
@@ -107,7 +107,7 @@ struct rt_cache_stat | |||
107 | 107 | ||
108 | extern struct rt_cache_stat *rt_cache_stat; | 108 | extern struct rt_cache_stat *rt_cache_stat; |
109 | #define RT_CACHE_STAT_INC(field) \ | 109 | #define RT_CACHE_STAT_INC(field) \ |
110 | (per_cpu_ptr(rt_cache_stat, _smp_processor_id())->field++) | 110 | (per_cpu_ptr(rt_cache_stat, raw_smp_processor_id())->field++) |
111 | 111 | ||
112 | extern struct ip_rt_acct *ip_rt_acct; | 112 | extern struct ip_rt_acct *ip_rt_acct; |
113 | 113 | ||
@@ -181,9 +181,6 @@ static inline int ip_route_newports(struct rtable **rp, u16 sport, u16 dport, | |||
181 | memcpy(&fl, &(*rp)->fl, sizeof(fl)); | 181 | memcpy(&fl, &(*rp)->fl, sizeof(fl)); |
182 | fl.fl_ip_sport = sport; | 182 | fl.fl_ip_sport = sport; |
183 | fl.fl_ip_dport = dport; | 183 | fl.fl_ip_dport = dport; |
184 | #if defined(CONFIG_IP_ROUTE_MULTIPATH_CACHED) | ||
185 | fl.flags |= FLOWI_FLAG_MULTIPATHOLDROUTE; | ||
186 | #endif | ||
187 | ip_rt_put(*rp); | 184 | ip_rt_put(*rp); |
188 | *rp = NULL; | 185 | *rp = NULL; |
189 | return ip_route_output_flow(rp, &fl, sk, 0); | 186 | return ip_route_output_flow(rp, &fl, sk, 0); |
diff --git a/include/net/sch_generic.h b/include/net/sch_generic.h index c57504b3b518..7b97405e2dbf 100644 --- a/include/net/sch_generic.h +++ b/include/net/sch_generic.h | |||
@@ -172,4 +172,126 @@ tcf_destroy(struct tcf_proto *tp) | |||
172 | kfree(tp); | 172 | kfree(tp); |
173 | } | 173 | } |
174 | 174 | ||
175 | static inline int __qdisc_enqueue_tail(struct sk_buff *skb, struct Qdisc *sch, | ||
176 | struct sk_buff_head *list) | ||
177 | { | ||
178 | __skb_queue_tail(list, skb); | ||
179 | sch->qstats.backlog += skb->len; | ||
180 | sch->bstats.bytes += skb->len; | ||
181 | sch->bstats.packets++; | ||
182 | |||
183 | return NET_XMIT_SUCCESS; | ||
184 | } | ||
185 | |||
186 | static inline int qdisc_enqueue_tail(struct sk_buff *skb, struct Qdisc *sch) | ||
187 | { | ||
188 | return __qdisc_enqueue_tail(skb, sch, &sch->q); | ||
189 | } | ||
190 | |||
191 | static inline struct sk_buff *__qdisc_dequeue_head(struct Qdisc *sch, | ||
192 | struct sk_buff_head *list) | ||
193 | { | ||
194 | struct sk_buff *skb = __skb_dequeue(list); | ||
195 | |||
196 | if (likely(skb != NULL)) | ||
197 | sch->qstats.backlog -= skb->len; | ||
198 | |||
199 | return skb; | ||
200 | } | ||
201 | |||
202 | static inline struct sk_buff *qdisc_dequeue_head(struct Qdisc *sch) | ||
203 | { | ||
204 | return __qdisc_dequeue_head(sch, &sch->q); | ||
205 | } | ||
206 | |||
207 | static inline struct sk_buff *__qdisc_dequeue_tail(struct Qdisc *sch, | ||
208 | struct sk_buff_head *list) | ||
209 | { | ||
210 | struct sk_buff *skb = __skb_dequeue_tail(list); | ||
211 | |||
212 | if (likely(skb != NULL)) | ||
213 | sch->qstats.backlog -= skb->len; | ||
214 | |||
215 | return skb; | ||
216 | } | ||
217 | |||
218 | static inline struct sk_buff *qdisc_dequeue_tail(struct Qdisc *sch) | ||
219 | { | ||
220 | return __qdisc_dequeue_tail(sch, &sch->q); | ||
221 | } | ||
222 | |||
223 | static inline int __qdisc_requeue(struct sk_buff *skb, struct Qdisc *sch, | ||
224 | struct sk_buff_head *list) | ||
225 | { | ||
226 | __skb_queue_head(list, skb); | ||
227 | sch->qstats.backlog += skb->len; | ||
228 | sch->qstats.requeues++; | ||
229 | |||
230 | return NET_XMIT_SUCCESS; | ||
231 | } | ||
232 | |||
233 | static inline int qdisc_requeue(struct sk_buff *skb, struct Qdisc *sch) | ||
234 | { | ||
235 | return __qdisc_requeue(skb, sch, &sch->q); | ||
236 | } | ||
237 | |||
238 | static inline void __qdisc_reset_queue(struct Qdisc *sch, | ||
239 | struct sk_buff_head *list) | ||
240 | { | ||
241 | /* | ||
242 | * We do not know the backlog in bytes of this list, it | ||
243 | * is up to the caller to correct it | ||
244 | */ | ||
245 | skb_queue_purge(list); | ||
246 | } | ||
247 | |||
248 | static inline void qdisc_reset_queue(struct Qdisc *sch) | ||
249 | { | ||
250 | __qdisc_reset_queue(sch, &sch->q); | ||
251 | sch->qstats.backlog = 0; | ||
252 | } | ||
253 | |||
254 | static inline unsigned int __qdisc_queue_drop(struct Qdisc *sch, | ||
255 | struct sk_buff_head *list) | ||
256 | { | ||
257 | struct sk_buff *skb = __qdisc_dequeue_tail(sch, list); | ||
258 | |||
259 | if (likely(skb != NULL)) { | ||
260 | unsigned int len = skb->len; | ||
261 | kfree_skb(skb); | ||
262 | return len; | ||
263 | } | ||
264 | |||
265 | return 0; | ||
266 | } | ||
267 | |||
268 | static inline unsigned int qdisc_queue_drop(struct Qdisc *sch) | ||
269 | { | ||
270 | return __qdisc_queue_drop(sch, &sch->q); | ||
271 | } | ||
272 | |||
273 | static inline int qdisc_drop(struct sk_buff *skb, struct Qdisc *sch) | ||
274 | { | ||
275 | kfree_skb(skb); | ||
276 | sch->qstats.drops++; | ||
277 | |||
278 | return NET_XMIT_DROP; | ||
279 | } | ||
280 | |||
281 | static inline int qdisc_reshape_fail(struct sk_buff *skb, struct Qdisc *sch) | ||
282 | { | ||
283 | sch->qstats.drops++; | ||
284 | |||
285 | #ifdef CONFIG_NET_CLS_POLICE | ||
286 | if (sch->reshape_fail == NULL || sch->reshape_fail(skb, sch)) | ||
287 | goto drop; | ||
288 | |||
289 | return NET_XMIT_SUCCESS; | ||
290 | |||
291 | drop: | ||
292 | #endif | ||
293 | kfree_skb(skb); | ||
294 | return NET_XMIT_DROP; | ||
295 | } | ||
296 | |||
175 | #endif | 297 | #endif |
diff --git a/include/net/sctp/command.h b/include/net/sctp/command.h index ebc5282e6d58..dc107ffad483 100644 --- a/include/net/sctp/command.h +++ b/include/net/sctp/command.h | |||
@@ -65,9 +65,11 @@ typedef enum { | |||
65 | SCTP_CMD_TIMER_START, /* Start a timer. */ | 65 | SCTP_CMD_TIMER_START, /* Start a timer. */ |
66 | SCTP_CMD_TIMER_RESTART, /* Restart a timer. */ | 66 | SCTP_CMD_TIMER_RESTART, /* Restart a timer. */ |
67 | SCTP_CMD_TIMER_STOP, /* Stop a timer. */ | 67 | SCTP_CMD_TIMER_STOP, /* Stop a timer. */ |
68 | SCTP_CMD_COUNTER_RESET, /* Reset a counter. */ | 68 | SCTP_CMD_INIT_CHOOSE_TRANSPORT, /* Choose transport for an INIT. */ |
69 | SCTP_CMD_COUNTER_INC, /* Increment a counter. */ | 69 | SCTP_CMD_INIT_COUNTER_RESET, /* Reset init counter. */ |
70 | SCTP_CMD_INIT_COUNTER_INC, /* Increment init counter. */ | ||
70 | SCTP_CMD_INIT_RESTART, /* High level, do init timer work. */ | 71 | SCTP_CMD_INIT_RESTART, /* High level, do init timer work. */ |
72 | SCTP_CMD_COOKIEECHO_RESTART, /* High level, do cookie-echo timer work. */ | ||
71 | SCTP_CMD_INIT_FAILED, /* High level, do init failure work. */ | 73 | SCTP_CMD_INIT_FAILED, /* High level, do init failure work. */ |
72 | SCTP_CMD_REPORT_DUP, /* Report a duplicate TSN. */ | 74 | SCTP_CMD_REPORT_DUP, /* Report a duplicate TSN. */ |
73 | SCTP_CMD_STRIKE, /* Mark a strike against a transport. */ | 75 | SCTP_CMD_STRIKE, /* Mark a strike against a transport. */ |
@@ -118,7 +120,6 @@ typedef union { | |||
118 | int error; | 120 | int error; |
119 | sctp_state_t state; | 121 | sctp_state_t state; |
120 | sctp_event_timeout_t to; | 122 | sctp_event_timeout_t to; |
121 | sctp_counter_t counter; | ||
122 | void *ptr; | 123 | void *ptr; |
123 | struct sctp_chunk *chunk; | 124 | struct sctp_chunk *chunk; |
124 | struct sctp_association *asoc; | 125 | struct sctp_association *asoc; |
@@ -165,7 +166,6 @@ SCTP_ARG_CONSTRUCTOR(U16, __u16, u16) | |||
165 | SCTP_ARG_CONSTRUCTOR(U8, __u8, u8) | 166 | SCTP_ARG_CONSTRUCTOR(U8, __u8, u8) |
166 | SCTP_ARG_CONSTRUCTOR(ERROR, int, error) | 167 | SCTP_ARG_CONSTRUCTOR(ERROR, int, error) |
167 | SCTP_ARG_CONSTRUCTOR(STATE, sctp_state_t, state) | 168 | SCTP_ARG_CONSTRUCTOR(STATE, sctp_state_t, state) |
168 | SCTP_ARG_CONSTRUCTOR(COUNTER, sctp_counter_t, counter) | ||
169 | SCTP_ARG_CONSTRUCTOR(TO, sctp_event_timeout_t, to) | 169 | SCTP_ARG_CONSTRUCTOR(TO, sctp_event_timeout_t, to) |
170 | SCTP_ARG_CONSTRUCTOR(PTR, void *, ptr) | 170 | SCTP_ARG_CONSTRUCTOR(PTR, void *, ptr) |
171 | SCTP_ARG_CONSTRUCTOR(CHUNK, struct sctp_chunk *, chunk) | 171 | SCTP_ARG_CONSTRUCTOR(CHUNK, struct sctp_chunk *, chunk) |
diff --git a/include/net/sctp/constants.h b/include/net/sctp/constants.h index 2b76c0f4babc..4868c7f7749d 100644 --- a/include/net/sctp/constants.h +++ b/include/net/sctp/constants.h | |||
@@ -263,13 +263,6 @@ enum { SCTP_MIN_PMTU = 576 }; | |||
263 | enum { SCTP_MAX_DUP_TSNS = 16 }; | 263 | enum { SCTP_MAX_DUP_TSNS = 16 }; |
264 | enum { SCTP_MAX_GABS = 16 }; | 264 | enum { SCTP_MAX_GABS = 16 }; |
265 | 265 | ||
266 | typedef enum { | ||
267 | SCTP_COUNTER_INIT_ERROR, | ||
268 | } sctp_counter_t; | ||
269 | |||
270 | /* How many counters does an association need? */ | ||
271 | #define SCTP_NUMBER_COUNTERS 5 | ||
272 | |||
273 | /* Here we define the default timers. */ | 266 | /* Here we define the default timers. */ |
274 | 267 | ||
275 | /* cookie timer def = ? seconds */ | 268 | /* cookie timer def = ? seconds */ |
diff --git a/include/net/sctp/sctp.h b/include/net/sctp/sctp.h index 960abfa48d68..ef2738159ab3 100644 --- a/include/net/sctp/sctp.h +++ b/include/net/sctp/sctp.h | |||
@@ -223,6 +223,22 @@ DECLARE_SNMP_STAT(struct sctp_mib, sctp_statistics); | |||
223 | extern int sctp_debug_flag; | 223 | extern int sctp_debug_flag; |
224 | #define SCTP_DEBUG_PRINTK(whatever...) \ | 224 | #define SCTP_DEBUG_PRINTK(whatever...) \ |
225 | ((void) (sctp_debug_flag && printk(KERN_DEBUG whatever))) | 225 | ((void) (sctp_debug_flag && printk(KERN_DEBUG whatever))) |
226 | #define SCTP_DEBUG_PRINTK_IPADDR(lead, trail, leadparm, saddr, otherparms...) \ | ||
227 | if (sctp_debug_flag) { \ | ||
228 | if (saddr->sa.sa_family == AF_INET6) { \ | ||
229 | printk(KERN_DEBUG \ | ||
230 | lead "%04x:%04x:%04x:%04x:%04x:%04x:%04x:%04x" trail, \ | ||
231 | leadparm, \ | ||
232 | NIP6(saddr->v6.sin6_addr), \ | ||
233 | otherparms); \ | ||
234 | } else { \ | ||
235 | printk(KERN_DEBUG \ | ||
236 | lead "%u.%u.%u.%u" trail, \ | ||
237 | leadparm, \ | ||
238 | NIPQUAD(saddr->v4.sin_addr.s_addr), \ | ||
239 | otherparms); \ | ||
240 | } \ | ||
241 | } | ||
226 | #define SCTP_ENABLE_DEBUG { sctp_debug_flag = 1; } | 242 | #define SCTP_ENABLE_DEBUG { sctp_debug_flag = 1; } |
227 | #define SCTP_DISABLE_DEBUG { sctp_debug_flag = 0; } | 243 | #define SCTP_DISABLE_DEBUG { sctp_debug_flag = 0; } |
228 | 244 | ||
@@ -236,6 +252,7 @@ extern int sctp_debug_flag; | |||
236 | #else /* SCTP_DEBUG */ | 252 | #else /* SCTP_DEBUG */ |
237 | 253 | ||
238 | #define SCTP_DEBUG_PRINTK(whatever...) | 254 | #define SCTP_DEBUG_PRINTK(whatever...) |
255 | #define SCTP_DEBUG_PRINTK_IPADDR(whatever...) | ||
239 | #define SCTP_ENABLE_DEBUG | 256 | #define SCTP_ENABLE_DEBUG |
240 | #define SCTP_DISABLE_DEBUG | 257 | #define SCTP_DISABLE_DEBUG |
241 | #define SCTP_ASSERT(expr, str, func) | 258 | #define SCTP_ASSERT(expr, str, func) |
diff --git a/include/net/sctp/sm.h b/include/net/sctp/sm.h index f4fcee104707..a53e08a45e32 100644 --- a/include/net/sctp/sm.h +++ b/include/net/sctp/sm.h | |||
@@ -116,7 +116,8 @@ sctp_state_fn_t sctp_sf_eat_data_fast_4_4; | |||
116 | sctp_state_fn_t sctp_sf_eat_sack_6_2; | 116 | sctp_state_fn_t sctp_sf_eat_sack_6_2; |
117 | sctp_state_fn_t sctp_sf_tabort_8_4_8; | 117 | sctp_state_fn_t sctp_sf_tabort_8_4_8; |
118 | sctp_state_fn_t sctp_sf_operr_notify; | 118 | sctp_state_fn_t sctp_sf_operr_notify; |
119 | sctp_state_fn_t sctp_sf_t1_timer_expire; | 119 | sctp_state_fn_t sctp_sf_t1_init_timer_expire; |
120 | sctp_state_fn_t sctp_sf_t1_cookie_timer_expire; | ||
120 | sctp_state_fn_t sctp_sf_t2_timer_expire; | 121 | sctp_state_fn_t sctp_sf_t2_timer_expire; |
121 | sctp_state_fn_t sctp_sf_t4_timer_expire; | 122 | sctp_state_fn_t sctp_sf_t4_timer_expire; |
122 | sctp_state_fn_t sctp_sf_t5_timer_expire; | 123 | sctp_state_fn_t sctp_sf_t5_timer_expire; |
@@ -258,7 +259,10 @@ struct sctp_chunk *sctp_make_fwdtsn(const struct sctp_association *asoc, | |||
258 | void sctp_chunk_assign_tsn(struct sctp_chunk *); | 259 | void sctp_chunk_assign_tsn(struct sctp_chunk *); |
259 | void sctp_chunk_assign_ssn(struct sctp_chunk *); | 260 | void sctp_chunk_assign_ssn(struct sctp_chunk *); |
260 | 261 | ||
261 | void sctp_stop_t1_and_abort(sctp_cmd_seq_t *commands, __u16 error); | 262 | sctp_disposition_t sctp_stop_t1_and_abort(sctp_cmd_seq_t *commands, |
263 | __u16 error, | ||
264 | const struct sctp_association *asoc, | ||
265 | struct sctp_transport *transport); | ||
262 | 266 | ||
263 | /* Prototypes for statetable processing. */ | 267 | /* Prototypes for statetable processing. */ |
264 | 268 | ||
diff --git a/include/net/sctp/structs.h b/include/net/sctp/structs.h index 6c24d9cd3d66..dfad4d3c581c 100644 --- a/include/net/sctp/structs.h +++ b/include/net/sctp/structs.h | |||
@@ -867,10 +867,13 @@ struct sctp_transport { | |||
867 | */ | 867 | */ |
868 | unsigned long last_time_ecne_reduced; | 868 | unsigned long last_time_ecne_reduced; |
869 | 869 | ||
870 | /* active : The current active state of this destination, | 870 | /* The number of times INIT has been sent on this transport. */ |
871 | * : i.e. DOWN, UP, etc. | 871 | int init_sent_count; |
872 | |||
873 | /* state : The current state of this destination, | ||
874 | * : i.e. SCTP_ACTIVE, SCTP_INACTIVE, SCTP_UNKOWN. | ||
872 | */ | 875 | */ |
873 | int active; | 876 | int state; |
874 | 877 | ||
875 | /* hb_allowed : The current heartbeat state of this destination, | 878 | /* hb_allowed : The current heartbeat state of this destination, |
876 | * : i.e. ALLOW-HB, NO-HEARTBEAT, etc. | 879 | * : i.e. ALLOW-HB, NO-HEARTBEAT, etc. |
@@ -1222,9 +1225,6 @@ struct sctp_endpoint { | |||
1222 | 1225 | ||
1223 | /* sendbuf acct. policy. */ | 1226 | /* sendbuf acct. policy. */ |
1224 | __u32 sndbuf_policy; | 1227 | __u32 sndbuf_policy; |
1225 | |||
1226 | /* Name for debugging output... */ | ||
1227 | char *debug_name; | ||
1228 | }; | 1228 | }; |
1229 | 1229 | ||
1230 | /* Recover the outter endpoint structure. */ | 1230 | /* Recover the outter endpoint structure. */ |
@@ -1314,11 +1314,23 @@ struct sctp_association { | |||
1314 | * : association. Normally this information is | 1314 | * : association. Normally this information is |
1315 | * : hashed or keyed for quick lookup and access | 1315 | * : hashed or keyed for quick lookup and access |
1316 | * : of the TCB. | 1316 | * : of the TCB. |
1317 | * : The list is also initialized with the list | ||
1318 | * : of addresses passed with the sctp_connectx() | ||
1319 | * : call. | ||
1317 | * | 1320 | * |
1318 | * It is a list of SCTP_transport's. | 1321 | * It is a list of SCTP_transport's. |
1319 | */ | 1322 | */ |
1320 | struct list_head transport_addr_list; | 1323 | struct list_head transport_addr_list; |
1321 | 1324 | ||
1325 | /* transport_count | ||
1326 | * | ||
1327 | * Peer : A count of the number of peer addresses | ||
1328 | * Transport : in the Peer Transport Address List. | ||
1329 | * Address : | ||
1330 | * Count : | ||
1331 | */ | ||
1332 | __u16 transport_count; | ||
1333 | |||
1322 | /* port | 1334 | /* port |
1323 | * The transport layer port number. | 1335 | * The transport layer port number. |
1324 | */ | 1336 | */ |
@@ -1486,6 +1498,9 @@ struct sctp_association { | |||
1486 | /* Transport to which SHUTDOWN chunk was last sent. */ | 1498 | /* Transport to which SHUTDOWN chunk was last sent. */ |
1487 | struct sctp_transport *shutdown_last_sent_to; | 1499 | struct sctp_transport *shutdown_last_sent_to; |
1488 | 1500 | ||
1501 | /* Transport to which INIT chunk was last sent. */ | ||
1502 | struct sctp_transport *init_last_sent_to; | ||
1503 | |||
1489 | /* Next TSN : The next TSN number to be assigned to a new | 1504 | /* Next TSN : The next TSN number to be assigned to a new |
1490 | * : DATA chunk. This is sent in the INIT or INIT | 1505 | * : DATA chunk. This is sent in the INIT or INIT |
1491 | * : ACK chunk to the peer and incremented each | 1506 | * : ACK chunk to the peer and incremented each |
@@ -1549,8 +1564,11 @@ struct sctp_association { | |||
1549 | /* The message size at which SCTP fragmentation will occur. */ | 1564 | /* The message size at which SCTP fragmentation will occur. */ |
1550 | __u32 frag_point; | 1565 | __u32 frag_point; |
1551 | 1566 | ||
1552 | /* Currently only one counter is used to count INIT errors. */ | 1567 | /* Counter used to count INIT errors. */ |
1553 | int counters[SCTP_NUMBER_COUNTERS]; | 1568 | int init_err_counter; |
1569 | |||
1570 | /* Count the number of INIT cycles (for doubling timeout). */ | ||
1571 | int init_cycle; | ||
1554 | 1572 | ||
1555 | /* Default send parameters. */ | 1573 | /* Default send parameters. */ |
1556 | __u16 default_stream; | 1574 | __u16 default_stream; |
@@ -1708,6 +1726,8 @@ void sctp_association_free(struct sctp_association *); | |||
1708 | void sctp_association_put(struct sctp_association *); | 1726 | void sctp_association_put(struct sctp_association *); |
1709 | void sctp_association_hold(struct sctp_association *); | 1727 | void sctp_association_hold(struct sctp_association *); |
1710 | 1728 | ||
1729 | struct sctp_transport *sctp_assoc_choose_init_transport( | ||
1730 | struct sctp_association *); | ||
1711 | struct sctp_transport *sctp_assoc_choose_shutdown_transport( | 1731 | struct sctp_transport *sctp_assoc_choose_shutdown_transport( |
1712 | struct sctp_association *); | 1732 | struct sctp_association *); |
1713 | void sctp_assoc_update_retran_path(struct sctp_association *); | 1733 | void sctp_assoc_update_retran_path(struct sctp_association *); |
@@ -1717,9 +1737,12 @@ int sctp_assoc_lookup_laddr(struct sctp_association *asoc, | |||
1717 | const union sctp_addr *laddr); | 1737 | const union sctp_addr *laddr); |
1718 | struct sctp_transport *sctp_assoc_add_peer(struct sctp_association *, | 1738 | struct sctp_transport *sctp_assoc_add_peer(struct sctp_association *, |
1719 | const union sctp_addr *address, | 1739 | const union sctp_addr *address, |
1720 | const int gfp); | 1740 | const int gfp, |
1741 | const int peer_state); | ||
1721 | void sctp_assoc_del_peer(struct sctp_association *asoc, | 1742 | void sctp_assoc_del_peer(struct sctp_association *asoc, |
1722 | const union sctp_addr *addr); | 1743 | const union sctp_addr *addr); |
1744 | void sctp_assoc_rm_peer(struct sctp_association *asoc, | ||
1745 | struct sctp_transport *peer); | ||
1723 | void sctp_assoc_control_transport(struct sctp_association *, | 1746 | void sctp_assoc_control_transport(struct sctp_association *, |
1724 | struct sctp_transport *, | 1747 | struct sctp_transport *, |
1725 | sctp_transport_cmd_t, sctp_sn_error_t); | 1748 | sctp_transport_cmd_t, sctp_sn_error_t); |
diff --git a/include/net/sctp/user.h b/include/net/sctp/user.h index 2758e8ce4f25..f6328aeddcce 100644 --- a/include/net/sctp/user.h +++ b/include/net/sctp/user.h | |||
@@ -111,6 +111,8 @@ enum sctp_optname { | |||
111 | #define SCTP_GET_LOCAL_ADDRS_NUM SCTP_GET_LOCAL_ADDRS_NUM | 111 | #define SCTP_GET_LOCAL_ADDRS_NUM SCTP_GET_LOCAL_ADDRS_NUM |
112 | SCTP_GET_LOCAL_ADDRS, /* Get all local addresss. */ | 112 | SCTP_GET_LOCAL_ADDRS, /* Get all local addresss. */ |
113 | #define SCTP_GET_LOCAL_ADDRS SCTP_GET_LOCAL_ADDRS | 113 | #define SCTP_GET_LOCAL_ADDRS SCTP_GET_LOCAL_ADDRS |
114 | SCTP_SOCKOPT_CONNECTX, /* CONNECTX requests. */ | ||
115 | #define SCTP_SOCKOPT_CONNECTX SCTP_SOCKOPT_CONNECTX | ||
114 | }; | 116 | }; |
115 | 117 | ||
116 | /* | 118 | /* |
@@ -527,6 +529,7 @@ struct sctp_paddrinfo { | |||
527 | enum sctp_spinfo_state { | 529 | enum sctp_spinfo_state { |
528 | SCTP_INACTIVE, | 530 | SCTP_INACTIVE, |
529 | SCTP_ACTIVE, | 531 | SCTP_ACTIVE, |
532 | SCTP_UNKNOWN = 0xffff /* Value used for transport state unknown */ | ||
530 | }; | 533 | }; |
531 | 534 | ||
532 | /* | 535 | /* |
diff --git a/include/net/snmp.h b/include/net/snmp.h index a15ab256276e..a36bed8ea210 100644 --- a/include/net/snmp.h +++ b/include/net/snmp.h | |||
@@ -128,18 +128,18 @@ struct linux_mib { | |||
128 | #define SNMP_STAT_USRPTR(name) (name[1]) | 128 | #define SNMP_STAT_USRPTR(name) (name[1]) |
129 | 129 | ||
130 | #define SNMP_INC_STATS_BH(mib, field) \ | 130 | #define SNMP_INC_STATS_BH(mib, field) \ |
131 | (per_cpu_ptr(mib[0], _smp_processor_id())->mibs[field]++) | 131 | (per_cpu_ptr(mib[0], raw_smp_processor_id())->mibs[field]++) |
132 | #define SNMP_INC_STATS_OFFSET_BH(mib, field, offset) \ | 132 | #define SNMP_INC_STATS_OFFSET_BH(mib, field, offset) \ |
133 | (per_cpu_ptr(mib[0], _smp_processor_id())->mibs[field + (offset)]++) | 133 | (per_cpu_ptr(mib[0], raw_smp_processor_id())->mibs[field + (offset)]++) |
134 | #define SNMP_INC_STATS_USER(mib, field) \ | 134 | #define SNMP_INC_STATS_USER(mib, field) \ |
135 | (per_cpu_ptr(mib[1], _smp_processor_id())->mibs[field]++) | 135 | (per_cpu_ptr(mib[1], raw_smp_processor_id())->mibs[field]++) |
136 | #define SNMP_INC_STATS(mib, field) \ | 136 | #define SNMP_INC_STATS(mib, field) \ |
137 | (per_cpu_ptr(mib[!in_softirq()], _smp_processor_id())->mibs[field]++) | 137 | (per_cpu_ptr(mib[!in_softirq()], raw_smp_processor_id())->mibs[field]++) |
138 | #define SNMP_DEC_STATS(mib, field) \ | 138 | #define SNMP_DEC_STATS(mib, field) \ |
139 | (per_cpu_ptr(mib[!in_softirq()], _smp_processor_id())->mibs[field]--) | 139 | (per_cpu_ptr(mib[!in_softirq()], raw_smp_processor_id())->mibs[field]--) |
140 | #define SNMP_ADD_STATS_BH(mib, field, addend) \ | 140 | #define SNMP_ADD_STATS_BH(mib, field, addend) \ |
141 | (per_cpu_ptr(mib[0], _smp_processor_id())->mibs[field] += addend) | 141 | (per_cpu_ptr(mib[0], raw_smp_processor_id())->mibs[field] += addend) |
142 | #define SNMP_ADD_STATS_USER(mib, field, addend) \ | 142 | #define SNMP_ADD_STATS_USER(mib, field, addend) \ |
143 | (per_cpu_ptr(mib[1], _smp_processor_id())->mibs[field] += addend) | 143 | (per_cpu_ptr(mib[1], raw_smp_processor_id())->mibs[field] += addend) |
144 | 144 | ||
145 | #endif | 145 | #endif |
diff --git a/include/net/sock.h b/include/net/sock.h index a9ef3a6a13f3..e593af5b1ecc 100644 --- a/include/net/sock.h +++ b/include/net/sock.h | |||
@@ -484,6 +484,8 @@ extern void sk_stream_kill_queues(struct sock *sk); | |||
484 | 484 | ||
485 | extern int sk_wait_data(struct sock *sk, long *timeo); | 485 | extern int sk_wait_data(struct sock *sk, long *timeo); |
486 | 486 | ||
487 | struct request_sock_ops; | ||
488 | |||
487 | /* Networking protocol blocks we attach to sockets. | 489 | /* Networking protocol blocks we attach to sockets. |
488 | * socket layer -> transport layer interface | 490 | * socket layer -> transport layer interface |
489 | * transport -> network interface is defined by struct inet_proto | 491 | * transport -> network interface is defined by struct inet_proto |
@@ -547,6 +549,8 @@ struct proto { | |||
547 | kmem_cache_t *slab; | 549 | kmem_cache_t *slab; |
548 | unsigned int obj_size; | 550 | unsigned int obj_size; |
549 | 551 | ||
552 | struct request_sock_ops *rsk_prot; | ||
553 | |||
550 | struct module *owner; | 554 | struct module *owner; |
551 | 555 | ||
552 | char name[32]; | 556 | char name[32]; |
diff --git a/include/net/tcp.h b/include/net/tcp.h index e71f8ba3e101..f730935b824a 100644 --- a/include/net/tcp.h +++ b/include/net/tcp.h | |||
@@ -31,6 +31,7 @@ | |||
31 | #include <linux/cache.h> | 31 | #include <linux/cache.h> |
32 | #include <linux/percpu.h> | 32 | #include <linux/percpu.h> |
33 | #include <net/checksum.h> | 33 | #include <net/checksum.h> |
34 | #include <net/request_sock.h> | ||
34 | #include <net/sock.h> | 35 | #include <net/sock.h> |
35 | #include <net/snmp.h> | 36 | #include <net/snmp.h> |
36 | #include <net/ip.h> | 37 | #include <net/ip.h> |
@@ -563,7 +564,6 @@ static __inline__ int tcp_sk_listen_hashfn(struct sock *sk) | |||
563 | #define TCP_NAGLE_PUSH 4 /* Cork is overriden for already queued data */ | 564 | #define TCP_NAGLE_PUSH 4 /* Cork is overriden for already queued data */ |
564 | 565 | ||
565 | /* sysctl variables for tcp */ | 566 | /* sysctl variables for tcp */ |
566 | extern int sysctl_max_syn_backlog; | ||
567 | extern int sysctl_tcp_timestamps; | 567 | extern int sysctl_tcp_timestamps; |
568 | extern int sysctl_tcp_window_scaling; | 568 | extern int sysctl_tcp_window_scaling; |
569 | extern int sysctl_tcp_sack; | 569 | extern int sysctl_tcp_sack; |
@@ -613,74 +613,6 @@ extern atomic_t tcp_memory_allocated; | |||
613 | extern atomic_t tcp_sockets_allocated; | 613 | extern atomic_t tcp_sockets_allocated; |
614 | extern int tcp_memory_pressure; | 614 | extern int tcp_memory_pressure; |
615 | 615 | ||
616 | struct open_request; | ||
617 | |||
618 | struct or_calltable { | ||
619 | int family; | ||
620 | int (*rtx_syn_ack) (struct sock *sk, struct open_request *req, struct dst_entry*); | ||
621 | void (*send_ack) (struct sk_buff *skb, struct open_request *req); | ||
622 | void (*destructor) (struct open_request *req); | ||
623 | void (*send_reset) (struct sk_buff *skb); | ||
624 | }; | ||
625 | |||
626 | struct tcp_v4_open_req { | ||
627 | __u32 loc_addr; | ||
628 | __u32 rmt_addr; | ||
629 | struct ip_options *opt; | ||
630 | }; | ||
631 | |||
632 | #if defined(CONFIG_IPV6) || defined (CONFIG_IPV6_MODULE) | ||
633 | struct tcp_v6_open_req { | ||
634 | struct in6_addr loc_addr; | ||
635 | struct in6_addr rmt_addr; | ||
636 | struct sk_buff *pktopts; | ||
637 | int iif; | ||
638 | }; | ||
639 | #endif | ||
640 | |||
641 | /* this structure is too big */ | ||
642 | struct open_request { | ||
643 | struct open_request *dl_next; /* Must be first member! */ | ||
644 | __u32 rcv_isn; | ||
645 | __u32 snt_isn; | ||
646 | __u16 rmt_port; | ||
647 | __u16 mss; | ||
648 | __u8 retrans; | ||
649 | __u8 __pad; | ||
650 | __u16 snd_wscale : 4, | ||
651 | rcv_wscale : 4, | ||
652 | tstamp_ok : 1, | ||
653 | sack_ok : 1, | ||
654 | wscale_ok : 1, | ||
655 | ecn_ok : 1, | ||
656 | acked : 1; | ||
657 | /* The following two fields can be easily recomputed I think -AK */ | ||
658 | __u32 window_clamp; /* window clamp at creation time */ | ||
659 | __u32 rcv_wnd; /* rcv_wnd offered first time */ | ||
660 | __u32 ts_recent; | ||
661 | unsigned long expires; | ||
662 | struct or_calltable *class; | ||
663 | struct sock *sk; | ||
664 | union { | ||
665 | struct tcp_v4_open_req v4_req; | ||
666 | #if defined(CONFIG_IPV6) || defined (CONFIG_IPV6_MODULE) | ||
667 | struct tcp_v6_open_req v6_req; | ||
668 | #endif | ||
669 | } af; | ||
670 | }; | ||
671 | |||
672 | /* SLAB cache for open requests. */ | ||
673 | extern kmem_cache_t *tcp_openreq_cachep; | ||
674 | |||
675 | #define tcp_openreq_alloc() kmem_cache_alloc(tcp_openreq_cachep, SLAB_ATOMIC) | ||
676 | #define tcp_openreq_fastfree(req) kmem_cache_free(tcp_openreq_cachep, req) | ||
677 | |||
678 | static inline void tcp_openreq_free(struct open_request *req) | ||
679 | { | ||
680 | req->class->destructor(req); | ||
681 | tcp_openreq_fastfree(req); | ||
682 | } | ||
683 | |||
684 | #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) | 616 | #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) |
685 | #define TCP_INET_FAMILY(fam) ((fam) == AF_INET) | 617 | #define TCP_INET_FAMILY(fam) ((fam) == AF_INET) |
686 | #else | 618 | #else |
@@ -708,7 +640,7 @@ struct tcp_func { | |||
708 | 640 | ||
709 | struct sock * (*syn_recv_sock) (struct sock *sk, | 641 | struct sock * (*syn_recv_sock) (struct sock *sk, |
710 | struct sk_buff *skb, | 642 | struct sk_buff *skb, |
711 | struct open_request *req, | 643 | struct request_sock *req, |
712 | struct dst_entry *dst); | 644 | struct dst_entry *dst); |
713 | 645 | ||
714 | int (*remember_stamp) (struct sock *sk); | 646 | int (*remember_stamp) (struct sock *sk); |
@@ -852,8 +784,8 @@ extern enum tcp_tw_status tcp_timewait_state_process(struct tcp_tw_bucket *tw, | |||
852 | unsigned len); | 784 | unsigned len); |
853 | 785 | ||
854 | extern struct sock * tcp_check_req(struct sock *sk,struct sk_buff *skb, | 786 | extern struct sock * tcp_check_req(struct sock *sk,struct sk_buff *skb, |
855 | struct open_request *req, | 787 | struct request_sock *req, |
856 | struct open_request **prev); | 788 | struct request_sock **prev); |
857 | extern int tcp_child_process(struct sock *parent, | 789 | extern int tcp_child_process(struct sock *parent, |
858 | struct sock *child, | 790 | struct sock *child, |
859 | struct sk_buff *skb); | 791 | struct sk_buff *skb); |
@@ -903,12 +835,12 @@ extern int tcp_v4_conn_request(struct sock *sk, | |||
903 | struct sk_buff *skb); | 835 | struct sk_buff *skb); |
904 | 836 | ||
905 | extern struct sock * tcp_create_openreq_child(struct sock *sk, | 837 | extern struct sock * tcp_create_openreq_child(struct sock *sk, |
906 | struct open_request *req, | 838 | struct request_sock *req, |
907 | struct sk_buff *skb); | 839 | struct sk_buff *skb); |
908 | 840 | ||
909 | extern struct sock * tcp_v4_syn_recv_sock(struct sock *sk, | 841 | extern struct sock * tcp_v4_syn_recv_sock(struct sock *sk, |
910 | struct sk_buff *skb, | 842 | struct sk_buff *skb, |
911 | struct open_request *req, | 843 | struct request_sock *req, |
912 | struct dst_entry *dst); | 844 | struct dst_entry *dst); |
913 | 845 | ||
914 | extern int tcp_v4_do_rcv(struct sock *sk, | 846 | extern int tcp_v4_do_rcv(struct sock *sk, |
@@ -922,7 +854,7 @@ extern int tcp_connect(struct sock *sk); | |||
922 | 854 | ||
923 | extern struct sk_buff * tcp_make_synack(struct sock *sk, | 855 | extern struct sk_buff * tcp_make_synack(struct sock *sk, |
924 | struct dst_entry *dst, | 856 | struct dst_entry *dst, |
925 | struct open_request *req); | 857 | struct request_sock *req); |
926 | 858 | ||
927 | extern int tcp_disconnect(struct sock *sk, int flags); | 859 | extern int tcp_disconnect(struct sock *sk, int flags); |
928 | 860 | ||
@@ -1750,99 +1682,71 @@ static inline int tcp_full_space(const struct sock *sk) | |||
1750 | return tcp_win_from_space(sk->sk_rcvbuf); | 1682 | return tcp_win_from_space(sk->sk_rcvbuf); |
1751 | } | 1683 | } |
1752 | 1684 | ||
1753 | static inline void tcp_acceptq_queue(struct sock *sk, struct open_request *req, | 1685 | static inline void tcp_acceptq_queue(struct sock *sk, struct request_sock *req, |
1754 | struct sock *child) | 1686 | struct sock *child) |
1755 | { | 1687 | { |
1756 | struct tcp_sock *tp = tcp_sk(sk); | 1688 | reqsk_queue_add(&tcp_sk(sk)->accept_queue, req, sk, child); |
1757 | |||
1758 | req->sk = child; | ||
1759 | sk_acceptq_added(sk); | ||
1760 | |||
1761 | if (!tp->accept_queue_tail) { | ||
1762 | tp->accept_queue = req; | ||
1763 | } else { | ||
1764 | tp->accept_queue_tail->dl_next = req; | ||
1765 | } | ||
1766 | tp->accept_queue_tail = req; | ||
1767 | req->dl_next = NULL; | ||
1768 | } | 1689 | } |
1769 | 1690 | ||
1770 | struct tcp_listen_opt | ||
1771 | { | ||
1772 | u8 max_qlen_log; /* log_2 of maximal queued SYNs */ | ||
1773 | int qlen; | ||
1774 | int qlen_young; | ||
1775 | int clock_hand; | ||
1776 | u32 hash_rnd; | ||
1777 | struct open_request *syn_table[TCP_SYNQ_HSIZE]; | ||
1778 | }; | ||
1779 | |||
1780 | static inline void | 1691 | static inline void |
1781 | tcp_synq_removed(struct sock *sk, struct open_request *req) | 1692 | tcp_synq_removed(struct sock *sk, struct request_sock *req) |
1782 | { | 1693 | { |
1783 | struct tcp_listen_opt *lopt = tcp_sk(sk)->listen_opt; | 1694 | if (reqsk_queue_removed(&tcp_sk(sk)->accept_queue, req) == 0) |
1784 | |||
1785 | if (--lopt->qlen == 0) | ||
1786 | tcp_delete_keepalive_timer(sk); | 1695 | tcp_delete_keepalive_timer(sk); |
1787 | if (req->retrans == 0) | ||
1788 | lopt->qlen_young--; | ||
1789 | } | 1696 | } |
1790 | 1697 | ||
1791 | static inline void tcp_synq_added(struct sock *sk) | 1698 | static inline void tcp_synq_added(struct sock *sk) |
1792 | { | 1699 | { |
1793 | struct tcp_listen_opt *lopt = tcp_sk(sk)->listen_opt; | 1700 | if (reqsk_queue_added(&tcp_sk(sk)->accept_queue) == 0) |
1794 | |||
1795 | if (lopt->qlen++ == 0) | ||
1796 | tcp_reset_keepalive_timer(sk, TCP_TIMEOUT_INIT); | 1701 | tcp_reset_keepalive_timer(sk, TCP_TIMEOUT_INIT); |
1797 | lopt->qlen_young++; | ||
1798 | } | 1702 | } |
1799 | 1703 | ||
1800 | static inline int tcp_synq_len(struct sock *sk) | 1704 | static inline int tcp_synq_len(struct sock *sk) |
1801 | { | 1705 | { |
1802 | return tcp_sk(sk)->listen_opt->qlen; | 1706 | return reqsk_queue_len(&tcp_sk(sk)->accept_queue); |
1803 | } | 1707 | } |
1804 | 1708 | ||
1805 | static inline int tcp_synq_young(struct sock *sk) | 1709 | static inline int tcp_synq_young(struct sock *sk) |
1806 | { | 1710 | { |
1807 | return tcp_sk(sk)->listen_opt->qlen_young; | 1711 | return reqsk_queue_len_young(&tcp_sk(sk)->accept_queue); |
1808 | } | 1712 | } |
1809 | 1713 | ||
1810 | static inline int tcp_synq_is_full(struct sock *sk) | 1714 | static inline int tcp_synq_is_full(struct sock *sk) |
1811 | { | 1715 | { |
1812 | return tcp_synq_len(sk) >> tcp_sk(sk)->listen_opt->max_qlen_log; | 1716 | return reqsk_queue_is_full(&tcp_sk(sk)->accept_queue); |
1813 | } | 1717 | } |
1814 | 1718 | ||
1815 | static inline void tcp_synq_unlink(struct tcp_sock *tp, struct open_request *req, | 1719 | static inline void tcp_synq_unlink(struct tcp_sock *tp, struct request_sock *req, |
1816 | struct open_request **prev) | 1720 | struct request_sock **prev) |
1817 | { | 1721 | { |
1818 | write_lock(&tp->syn_wait_lock); | 1722 | reqsk_queue_unlink(&tp->accept_queue, req, prev); |
1819 | *prev = req->dl_next; | ||
1820 | write_unlock(&tp->syn_wait_lock); | ||
1821 | } | 1723 | } |
1822 | 1724 | ||
1823 | static inline void tcp_synq_drop(struct sock *sk, struct open_request *req, | 1725 | static inline void tcp_synq_drop(struct sock *sk, struct request_sock *req, |
1824 | struct open_request **prev) | 1726 | struct request_sock **prev) |
1825 | { | 1727 | { |
1826 | tcp_synq_unlink(tcp_sk(sk), req, prev); | 1728 | tcp_synq_unlink(tcp_sk(sk), req, prev); |
1827 | tcp_synq_removed(sk, req); | 1729 | tcp_synq_removed(sk, req); |
1828 | tcp_openreq_free(req); | 1730 | reqsk_free(req); |
1829 | } | 1731 | } |
1830 | 1732 | ||
1831 | static __inline__ void tcp_openreq_init(struct open_request *req, | 1733 | static __inline__ void tcp_openreq_init(struct request_sock *req, |
1832 | struct tcp_options_received *rx_opt, | 1734 | struct tcp_options_received *rx_opt, |
1833 | struct sk_buff *skb) | 1735 | struct sk_buff *skb) |
1834 | { | 1736 | { |
1737 | struct inet_request_sock *ireq = inet_rsk(req); | ||
1738 | |||
1835 | req->rcv_wnd = 0; /* So that tcp_send_synack() knows! */ | 1739 | req->rcv_wnd = 0; /* So that tcp_send_synack() knows! */ |
1836 | req->rcv_isn = TCP_SKB_CB(skb)->seq; | 1740 | tcp_rsk(req)->rcv_isn = TCP_SKB_CB(skb)->seq; |
1837 | req->mss = rx_opt->mss_clamp; | 1741 | req->mss = rx_opt->mss_clamp; |
1838 | req->ts_recent = rx_opt->saw_tstamp ? rx_opt->rcv_tsval : 0; | 1742 | req->ts_recent = rx_opt->saw_tstamp ? rx_opt->rcv_tsval : 0; |
1839 | req->tstamp_ok = rx_opt->tstamp_ok; | 1743 | ireq->tstamp_ok = rx_opt->tstamp_ok; |
1840 | req->sack_ok = rx_opt->sack_ok; | 1744 | ireq->sack_ok = rx_opt->sack_ok; |
1841 | req->snd_wscale = rx_opt->snd_wscale; | 1745 | ireq->snd_wscale = rx_opt->snd_wscale; |
1842 | req->wscale_ok = rx_opt->wscale_ok; | 1746 | ireq->wscale_ok = rx_opt->wscale_ok; |
1843 | req->acked = 0; | 1747 | ireq->acked = 0; |
1844 | req->ecn_ok = 0; | 1748 | ireq->ecn_ok = 0; |
1845 | req->rmt_port = skb->h.th->source; | 1749 | ireq->rmt_port = skb->h.th->source; |
1846 | } | 1750 | } |
1847 | 1751 | ||
1848 | extern void tcp_enter_memory_pressure(void); | 1752 | extern void tcp_enter_memory_pressure(void); |
diff --git a/include/net/tcp_ecn.h b/include/net/tcp_ecn.h index dc1456389a97..64980ee8c92a 100644 --- a/include/net/tcp_ecn.h +++ b/include/net/tcp_ecn.h | |||
@@ -2,6 +2,7 @@ | |||
2 | #define _NET_TCP_ECN_H_ 1 | 2 | #define _NET_TCP_ECN_H_ 1 |
3 | 3 | ||
4 | #include <net/inet_ecn.h> | 4 | #include <net/inet_ecn.h> |
5 | #include <net/request_sock.h> | ||
5 | 6 | ||
6 | #define TCP_HP_BITS (~(TCP_RESERVED_BITS|TCP_FLAG_PSH)) | 7 | #define TCP_HP_BITS (~(TCP_RESERVED_BITS|TCP_FLAG_PSH)) |
7 | 8 | ||
@@ -38,9 +39,9 @@ static inline void TCP_ECN_send_syn(struct sock *sk, struct tcp_sock *tp, | |||
38 | } | 39 | } |
39 | 40 | ||
40 | static __inline__ void | 41 | static __inline__ void |
41 | TCP_ECN_make_synack(struct open_request *req, struct tcphdr *th) | 42 | TCP_ECN_make_synack(struct request_sock *req, struct tcphdr *th) |
42 | { | 43 | { |
43 | if (req->ecn_ok) | 44 | if (inet_rsk(req)->ecn_ok) |
44 | th->ece = 1; | 45 | th->ece = 1; |
45 | } | 46 | } |
46 | 47 | ||
@@ -111,16 +112,16 @@ static inline int TCP_ECN_rcv_ecn_echo(struct tcp_sock *tp, struct tcphdr *th) | |||
111 | } | 112 | } |
112 | 113 | ||
113 | static inline void TCP_ECN_openreq_child(struct tcp_sock *tp, | 114 | static inline void TCP_ECN_openreq_child(struct tcp_sock *tp, |
114 | struct open_request *req) | 115 | struct request_sock *req) |
115 | { | 116 | { |
116 | tp->ecn_flags = req->ecn_ok ? TCP_ECN_OK : 0; | 117 | tp->ecn_flags = inet_rsk(req)->ecn_ok ? TCP_ECN_OK : 0; |
117 | } | 118 | } |
118 | 119 | ||
119 | static __inline__ void | 120 | static __inline__ void |
120 | TCP_ECN_create_request(struct open_request *req, struct tcphdr *th) | 121 | TCP_ECN_create_request(struct request_sock *req, struct tcphdr *th) |
121 | { | 122 | { |
122 | if (sysctl_tcp_ecn && th->ece && th->cwr) | 123 | if (sysctl_tcp_ecn && th->ece && th->cwr) |
123 | req->ecn_ok = 1; | 124 | inet_rsk(req)->ecn_ok = 1; |
124 | } | 125 | } |
125 | 126 | ||
126 | #endif | 127 | #endif |
diff --git a/include/net/xfrm.h b/include/net/xfrm.h index e142a256d5dc..029522a4ceda 100644 --- a/include/net/xfrm.h +++ b/include/net/xfrm.h | |||
@@ -158,6 +158,20 @@ enum { | |||
158 | XFRM_STATE_DEAD | 158 | XFRM_STATE_DEAD |
159 | }; | 159 | }; |
160 | 160 | ||
161 | /* callback structure passed from either netlink or pfkey */ | ||
162 | struct km_event | ||
163 | { | ||
164 | union { | ||
165 | u32 hard; | ||
166 | u32 proto; | ||
167 | u32 byid; | ||
168 | } data; | ||
169 | |||
170 | u32 seq; | ||
171 | u32 pid; | ||
172 | u32 event; | ||
173 | }; | ||
174 | |||
161 | struct xfrm_type; | 175 | struct xfrm_type; |
162 | struct xfrm_dst; | 176 | struct xfrm_dst; |
163 | struct xfrm_policy_afinfo { | 177 | struct xfrm_policy_afinfo { |
@@ -179,6 +193,8 @@ struct xfrm_policy_afinfo { | |||
179 | 193 | ||
180 | extern int xfrm_policy_register_afinfo(struct xfrm_policy_afinfo *afinfo); | 194 | extern int xfrm_policy_register_afinfo(struct xfrm_policy_afinfo *afinfo); |
181 | extern int xfrm_policy_unregister_afinfo(struct xfrm_policy_afinfo *afinfo); | 195 | extern int xfrm_policy_unregister_afinfo(struct xfrm_policy_afinfo *afinfo); |
196 | extern void km_policy_notify(struct xfrm_policy *xp, int dir, struct km_event *c); | ||
197 | extern void km_state_notify(struct xfrm_state *x, struct km_event *c); | ||
182 | 198 | ||
183 | #define XFRM_ACQ_EXPIRES 30 | 199 | #define XFRM_ACQ_EXPIRES 30 |
184 | 200 | ||
@@ -188,6 +204,7 @@ struct xfrm_state_afinfo { | |||
188 | rwlock_t lock; | 204 | rwlock_t lock; |
189 | struct list_head *state_bydst; | 205 | struct list_head *state_bydst; |
190 | struct list_head *state_byspi; | 206 | struct list_head *state_byspi; |
207 | int (*init_flags)(struct xfrm_state *x); | ||
191 | void (*init_tempsel)(struct xfrm_state *x, struct flowi *fl, | 208 | void (*init_tempsel)(struct xfrm_state *x, struct flowi *fl, |
192 | struct xfrm_tmpl *tmpl, | 209 | struct xfrm_tmpl *tmpl, |
193 | xfrm_address_t *daddr, xfrm_address_t *saddr); | 210 | xfrm_address_t *daddr, xfrm_address_t *saddr); |
@@ -209,7 +226,7 @@ struct xfrm_type | |||
209 | struct module *owner; | 226 | struct module *owner; |
210 | __u8 proto; | 227 | __u8 proto; |
211 | 228 | ||
212 | int (*init_state)(struct xfrm_state *x, void *args); | 229 | int (*init_state)(struct xfrm_state *x); |
213 | void (*destructor)(struct xfrm_state *); | 230 | void (*destructor)(struct xfrm_state *); |
214 | int (*input)(struct xfrm_state *, struct xfrm_decap_state *, struct sk_buff *skb); | 231 | int (*input)(struct xfrm_state *, struct xfrm_decap_state *, struct sk_buff *skb); |
215 | int (*post_input)(struct xfrm_state *, struct xfrm_decap_state *, struct sk_buff *skb); | 232 | int (*post_input)(struct xfrm_state *, struct xfrm_decap_state *, struct sk_buff *skb); |
@@ -290,11 +307,11 @@ struct xfrm_mgr | |||
290 | { | 307 | { |
291 | struct list_head list; | 308 | struct list_head list; |
292 | char *id; | 309 | char *id; |
293 | int (*notify)(struct xfrm_state *x, int event); | 310 | int (*notify)(struct xfrm_state *x, struct km_event *c); |
294 | int (*acquire)(struct xfrm_state *x, struct xfrm_tmpl *, struct xfrm_policy *xp, int dir); | 311 | int (*acquire)(struct xfrm_state *x, struct xfrm_tmpl *, struct xfrm_policy *xp, int dir); |
295 | struct xfrm_policy *(*compile_policy)(u16 family, int opt, u8 *data, int len, int *dir); | 312 | struct xfrm_policy *(*compile_policy)(u16 family, int opt, u8 *data, int len, int *dir); |
296 | int (*new_mapping)(struct xfrm_state *x, xfrm_address_t *ipaddr, u16 sport); | 313 | int (*new_mapping)(struct xfrm_state *x, xfrm_address_t *ipaddr, u16 sport); |
297 | int (*notify_policy)(struct xfrm_policy *x, int dir, int event); | 314 | int (*notify_policy)(struct xfrm_policy *x, int dir, struct km_event *c); |
298 | }; | 315 | }; |
299 | 316 | ||
300 | extern int xfrm_register_km(struct xfrm_mgr *km); | 317 | extern int xfrm_register_km(struct xfrm_mgr *km); |
@@ -515,6 +532,8 @@ struct xfrm_dst | |||
515 | struct dst_entry *route; | 532 | struct dst_entry *route; |
516 | u32 route_mtu_cached; | 533 | u32 route_mtu_cached; |
517 | u32 child_mtu_cached; | 534 | u32 child_mtu_cached; |
535 | u32 route_cookie; | ||
536 | u32 path_cookie; | ||
518 | }; | 537 | }; |
519 | 538 | ||
520 | static inline void xfrm_dst_destroy(struct xfrm_dst *xdst) | 539 | static inline void xfrm_dst_destroy(struct xfrm_dst *xdst) |
@@ -654,7 +673,7 @@ static inline int xfrm_sk_clone_policy(struct sock *sk) | |||
654 | return 0; | 673 | return 0; |
655 | } | 674 | } |
656 | 675 | ||
657 | extern void xfrm_policy_delete(struct xfrm_policy *pol, int dir); | 676 | extern int xfrm_policy_delete(struct xfrm_policy *pol, int dir); |
658 | 677 | ||
659 | static inline void xfrm_sk_free_policy(struct sock *sk) | 678 | static inline void xfrm_sk_free_policy(struct sock *sk) |
660 | { | 679 | { |
@@ -815,12 +834,13 @@ extern int xfrm_state_add(struct xfrm_state *x); | |||
815 | extern int xfrm_state_update(struct xfrm_state *x); | 834 | extern int xfrm_state_update(struct xfrm_state *x); |
816 | extern struct xfrm_state *xfrm_state_lookup(xfrm_address_t *daddr, u32 spi, u8 proto, unsigned short family); | 835 | extern struct xfrm_state *xfrm_state_lookup(xfrm_address_t *daddr, u32 spi, u8 proto, unsigned short family); |
817 | extern struct xfrm_state *xfrm_find_acq_byseq(u32 seq); | 836 | extern struct xfrm_state *xfrm_find_acq_byseq(u32 seq); |
818 | extern void xfrm_state_delete(struct xfrm_state *x); | 837 | extern int xfrm_state_delete(struct xfrm_state *x); |
819 | extern void xfrm_state_flush(u8 proto); | 838 | extern void xfrm_state_flush(u8 proto); |
820 | extern int xfrm_replay_check(struct xfrm_state *x, u32 seq); | 839 | extern int xfrm_replay_check(struct xfrm_state *x, u32 seq); |
821 | extern void xfrm_replay_advance(struct xfrm_state *x, u32 seq); | 840 | extern void xfrm_replay_advance(struct xfrm_state *x, u32 seq); |
822 | extern int xfrm_state_check(struct xfrm_state *x, struct sk_buff *skb); | 841 | extern int xfrm_state_check(struct xfrm_state *x, struct sk_buff *skb); |
823 | extern int xfrm_state_mtu(struct xfrm_state *x, int mtu); | 842 | extern int xfrm_state_mtu(struct xfrm_state *x, int mtu); |
843 | extern int xfrm_init_state(struct xfrm_state *x); | ||
824 | extern int xfrm4_rcv(struct sk_buff *skb); | 844 | extern int xfrm4_rcv(struct sk_buff *skb); |
825 | extern int xfrm4_output(struct sk_buff *skb); | 845 | extern int xfrm4_output(struct sk_buff *skb); |
826 | extern int xfrm4_tunnel_register(struct xfrm_tunnel *handler); | 846 | extern int xfrm4_tunnel_register(struct xfrm_tunnel *handler); |
diff --git a/include/scsi/scsi.h b/include/scsi/scsi.h index 659ecf48fb4a..1fb233741513 100644 --- a/include/scsi/scsi.h +++ b/include/scsi/scsi.h | |||
@@ -41,6 +41,7 @@ extern const char *const scsi_device_types[MAX_SCSI_DEVICE_CODE]; | |||
41 | #define FORMAT_UNIT 0x04 | 41 | #define FORMAT_UNIT 0x04 |
42 | #define READ_BLOCK_LIMITS 0x05 | 42 | #define READ_BLOCK_LIMITS 0x05 |
43 | #define REASSIGN_BLOCKS 0x07 | 43 | #define REASSIGN_BLOCKS 0x07 |
44 | #define INITIALIZE_ELEMENT_STATUS 0x07 | ||
44 | #define READ_6 0x08 | 45 | #define READ_6 0x08 |
45 | #define WRITE_6 0x0a | 46 | #define WRITE_6 0x0a |
46 | #define SEEK_6 0x0b | 47 | #define SEEK_6 0x0b |
@@ -65,6 +66,7 @@ extern const char *const scsi_device_types[MAX_SCSI_DEVICE_CODE]; | |||
65 | #define READ_10 0x28 | 66 | #define READ_10 0x28 |
66 | #define WRITE_10 0x2a | 67 | #define WRITE_10 0x2a |
67 | #define SEEK_10 0x2b | 68 | #define SEEK_10 0x2b |
69 | #define POSITION_TO_ELEMENT 0x2b | ||
68 | #define WRITE_VERIFY 0x2e | 70 | #define WRITE_VERIFY 0x2e |
69 | #define VERIFY 0x2f | 71 | #define VERIFY 0x2f |
70 | #define SEARCH_HIGH 0x30 | 72 | #define SEARCH_HIGH 0x30 |
@@ -97,6 +99,7 @@ extern const char *const scsi_device_types[MAX_SCSI_DEVICE_CODE]; | |||
97 | #define PERSISTENT_RESERVE_OUT 0x5f | 99 | #define PERSISTENT_RESERVE_OUT 0x5f |
98 | #define REPORT_LUNS 0xa0 | 100 | #define REPORT_LUNS 0xa0 |
99 | #define MOVE_MEDIUM 0xa5 | 101 | #define MOVE_MEDIUM 0xa5 |
102 | #define EXCHANGE_MEDIUM 0xa6 | ||
100 | #define READ_12 0xa8 | 103 | #define READ_12 0xa8 |
101 | #define WRITE_12 0xaa | 104 | #define WRITE_12 0xaa |
102 | #define WRITE_VERIFY_12 0xae | 105 | #define WRITE_VERIFY_12 0xae |
@@ -210,6 +213,7 @@ static inline int scsi_status_is_good(int status) | |||
210 | #define TYPE_COMM 0x09 /* Communications device */ | 213 | #define TYPE_COMM 0x09 /* Communications device */ |
211 | #define TYPE_ENCLOSURE 0x0d /* Enclosure Services Device */ | 214 | #define TYPE_ENCLOSURE 0x0d /* Enclosure Services Device */ |
212 | #define TYPE_RAID 0x0c | 215 | #define TYPE_RAID 0x0c |
216 | #define TYPE_RBC 0x0e | ||
213 | #define TYPE_NO_LUN 0x7f | 217 | #define TYPE_NO_LUN 0x7f |
214 | 218 | ||
215 | /* | 219 | /* |
diff --git a/include/scsi/scsi_device.h b/include/scsi/scsi_device.h index c018020d9160..63c91dd85ca1 100644 --- a/include/scsi/scsi_device.h +++ b/include/scsi/scsi_device.h | |||
@@ -154,7 +154,9 @@ struct scsi_target { | |||
154 | unsigned int id; /* target id ... replace | 154 | unsigned int id; /* target id ... replace |
155 | * scsi_device.id eventually */ | 155 | * scsi_device.id eventually */ |
156 | unsigned long create:1; /* signal that it needs to be added */ | 156 | unsigned long create:1; /* signal that it needs to be added */ |
157 | unsigned long starget_data[0]; | 157 | void *hostdata; /* available to low-level driver */ |
158 | unsigned long starget_data[0]; /* for the transport */ | ||
159 | /* starget_data must be the last element!!!! */ | ||
158 | } __attribute__((aligned(sizeof(unsigned long)))); | 160 | } __attribute__((aligned(sizeof(unsigned long)))); |
159 | 161 | ||
160 | #define to_scsi_target(d) container_of(d, struct scsi_target, dev) | 162 | #define to_scsi_target(d) container_of(d, struct scsi_target, dev) |
diff --git a/include/scsi/scsi_host.h b/include/scsi/scsi_host.h index 1cee1e100943..db9914adeac9 100644 --- a/include/scsi/scsi_host.h +++ b/include/scsi/scsi_host.h | |||
@@ -10,6 +10,7 @@ struct block_device; | |||
10 | struct module; | 10 | struct module; |
11 | struct scsi_cmnd; | 11 | struct scsi_cmnd; |
12 | struct scsi_device; | 12 | struct scsi_device; |
13 | struct scsi_target; | ||
13 | struct Scsi_Host; | 14 | struct Scsi_Host; |
14 | struct scsi_host_cmd_pool; | 15 | struct scsi_host_cmd_pool; |
15 | struct scsi_transport_template; | 16 | struct scsi_transport_template; |
@@ -228,6 +229,30 @@ struct scsi_host_template { | |||
228 | void (* slave_destroy)(struct scsi_device *); | 229 | void (* slave_destroy)(struct scsi_device *); |
229 | 230 | ||
230 | /* | 231 | /* |
232 | * Before the mid layer attempts to scan for a new device attached | ||
233 | * to a target where no target currently exists, it will call this | ||
234 | * entry in your driver. Should your driver need to allocate any | ||
235 | * structs or perform any other init items in order to send commands | ||
236 | * to a currently unused target, then this is where you can perform | ||
237 | * those allocations. | ||
238 | * | ||
239 | * Return values: 0 on success, non-0 on failure | ||
240 | * | ||
241 | * Status: OPTIONAL | ||
242 | */ | ||
243 | int (* target_alloc)(struct scsi_target *); | ||
244 | |||
245 | /* | ||
246 | * Immediately prior to deallocating the target structure, and | ||
247 | * after all activity to attached scsi devices has ceased, the | ||
248 | * midlayer calls this point so that the driver may deallocate | ||
249 | * and terminate any references to the target. | ||
250 | * | ||
251 | * Status: OPTIONAL | ||
252 | */ | ||
253 | void (* target_destroy)(struct scsi_target *); | ||
254 | |||
255 | /* | ||
231 | * fill in this function to allow the queue depth of this host | 256 | * fill in this function to allow the queue depth of this host |
232 | * to be changeable (on a per device basis). returns either | 257 | * to be changeable (on a per device basis). returns either |
233 | * the current queue depth setting (may be different from what | 258 | * the current queue depth setting (may be different from what |
diff --git a/include/scsi/scsi_transport.h b/include/scsi/scsi_transport.h index 2dcee7a84752..a4f1837a33b1 100644 --- a/include/scsi/scsi_transport.h +++ b/include/scsi/scsi_transport.h | |||
@@ -21,6 +21,7 @@ | |||
21 | #define SCSI_TRANSPORT_H | 21 | #define SCSI_TRANSPORT_H |
22 | 22 | ||
23 | #include <linux/transport_class.h> | 23 | #include <linux/transport_class.h> |
24 | #include <scsi/scsi_host.h> | ||
24 | 25 | ||
25 | struct scsi_transport_template { | 26 | struct scsi_transport_template { |
26 | /* the attribute containers */ | 27 | /* the attribute containers */ |
@@ -32,8 +33,11 @@ struct scsi_transport_template { | |||
32 | * space of this size will be left at the end of the | 33 | * space of this size will be left at the end of the |
33 | * scsi_* structure */ | 34 | * scsi_* structure */ |
34 | int device_size; | 35 | int device_size; |
36 | int device_private_offset; | ||
35 | int target_size; | 37 | int target_size; |
38 | int target_private_offset; | ||
36 | int host_size; | 39 | int host_size; |
40 | /* no private offset for the host; there's an alternative mechanism */ | ||
37 | 41 | ||
38 | /* | 42 | /* |
39 | * True if the transport wants to use a host-based work-queue | 43 | * True if the transport wants to use a host-based work-queue |
@@ -45,4 +49,38 @@ struct scsi_transport_template { | |||
45 | dev_to_shost((tc)->dev) | 49 | dev_to_shost((tc)->dev) |
46 | 50 | ||
47 | 51 | ||
52 | /* Private area maintenance. The driver requested allocations come | ||
53 | * directly after the transport class allocations (if any). The idea | ||
54 | * is that you *must* call these only once. The code assumes that the | ||
55 | * initial values are the ones the transport specific code requires */ | ||
56 | static inline void | ||
57 | scsi_transport_reserve_target(struct scsi_transport_template * t, int space) | ||
58 | { | ||
59 | BUG_ON(t->target_private_offset != 0); | ||
60 | t->target_private_offset = ALIGN(t->target_size, sizeof(void *)); | ||
61 | t->target_size = t->target_private_offset + space; | ||
62 | } | ||
63 | static inline void | ||
64 | scsi_transport_reserve_device(struct scsi_transport_template * t, int space) | ||
65 | { | ||
66 | BUG_ON(t->device_private_offset != 0); | ||
67 | t->device_private_offset = ALIGN(t->device_size, sizeof(void *)); | ||
68 | t->device_size = t->device_private_offset + space; | ||
69 | } | ||
70 | static inline void * | ||
71 | scsi_transport_target_data(struct scsi_target *starget) | ||
72 | { | ||
73 | struct Scsi_Host *shost = dev_to_shost(&starget->dev); | ||
74 | return (u8 *)starget->starget_data | ||
75 | + shost->transportt->target_private_offset; | ||
76 | |||
77 | } | ||
78 | static inline void * | ||
79 | scsi_transport_device_data(struct scsi_device *sdev) | ||
80 | { | ||
81 | struct Scsi_Host *shost = sdev->host; | ||
82 | return (u8 *)sdev->sdev_data | ||
83 | + shost->transportt->device_private_offset; | ||
84 | } | ||
85 | |||
48 | #endif /* SCSI_TRANSPORT_H */ | 86 | #endif /* SCSI_TRANSPORT_H */ |
diff --git a/include/scsi/scsi_transport_spi.h b/include/scsi/scsi_transport_spi.h index 6dcf497bf46d..a30d6cd4c0e8 100644 --- a/include/scsi/scsi_transport_spi.h +++ b/include/scsi/scsi_transport_spi.h | |||
@@ -27,8 +27,11 @@ struct scsi_transport_template; | |||
27 | 27 | ||
28 | struct spi_transport_attrs { | 28 | struct spi_transport_attrs { |
29 | int period; /* value in the PPR/SDTR command */ | 29 | int period; /* value in the PPR/SDTR command */ |
30 | int min_period; | ||
30 | int offset; | 31 | int offset; |
32 | int max_offset; | ||
31 | unsigned int width:1; /* 0 - narrow, 1 - wide */ | 33 | unsigned int width:1; /* 0 - narrow, 1 - wide */ |
34 | unsigned int max_width:1; | ||
32 | unsigned int iu:1; /* Information Units enabled */ | 35 | unsigned int iu:1; /* Information Units enabled */ |
33 | unsigned int dt:1; /* DT clocking enabled */ | 36 | unsigned int dt:1; /* DT clocking enabled */ |
34 | unsigned int qas:1; /* Quick Arbitration and Selection enabled */ | 37 | unsigned int qas:1; /* Quick Arbitration and Selection enabled */ |
@@ -63,8 +66,11 @@ struct spi_host_attrs { | |||
63 | 66 | ||
64 | /* accessor functions */ | 67 | /* accessor functions */ |
65 | #define spi_period(x) (((struct spi_transport_attrs *)&(x)->starget_data)->period) | 68 | #define spi_period(x) (((struct spi_transport_attrs *)&(x)->starget_data)->period) |
69 | #define spi_min_period(x) (((struct spi_transport_attrs *)&(x)->starget_data)->min_period) | ||
66 | #define spi_offset(x) (((struct spi_transport_attrs *)&(x)->starget_data)->offset) | 70 | #define spi_offset(x) (((struct spi_transport_attrs *)&(x)->starget_data)->offset) |
71 | #define spi_max_offset(x) (((struct spi_transport_attrs *)&(x)->starget_data)->max_offset) | ||
67 | #define spi_width(x) (((struct spi_transport_attrs *)&(x)->starget_data)->width) | 72 | #define spi_width(x) (((struct spi_transport_attrs *)&(x)->starget_data)->width) |
73 | #define spi_max_width(x) (((struct spi_transport_attrs *)&(x)->starget_data)->max_width) | ||
68 | #define spi_iu(x) (((struct spi_transport_attrs *)&(x)->starget_data)->iu) | 74 | #define spi_iu(x) (((struct spi_transport_attrs *)&(x)->starget_data)->iu) |
69 | #define spi_dt(x) (((struct spi_transport_attrs *)&(x)->starget_data)->dt) | 75 | #define spi_dt(x) (((struct spi_transport_attrs *)&(x)->starget_data)->dt) |
70 | #define spi_qas(x) (((struct spi_transport_attrs *)&(x)->starget_data)->qas) | 76 | #define spi_qas(x) (((struct spi_transport_attrs *)&(x)->starget_data)->qas) |