diff options
Diffstat (limited to 'include')
241 files changed, 5618 insertions, 7463 deletions
diff --git a/include/asm-alpha/termbits.h b/include/asm-alpha/termbits.h index 5541101b58ae..ad854a4a3af6 100644 --- a/include/asm-alpha/termbits.h +++ b/include/asm-alpha/termbits.h | |||
@@ -25,6 +25,19 @@ struct termios { | |||
25 | speed_t c_ospeed; /* output speed */ | 25 | speed_t c_ospeed; /* output speed */ |
26 | }; | 26 | }; |
27 | 27 | ||
28 | /* Alpha has matching termios and ktermios */ | ||
29 | |||
30 | struct ktermios { | ||
31 | tcflag_t c_iflag; /* input mode flags */ | ||
32 | tcflag_t c_oflag; /* output mode flags */ | ||
33 | tcflag_t c_cflag; /* control mode flags */ | ||
34 | tcflag_t c_lflag; /* local mode flags */ | ||
35 | cc_t c_cc[NCCS]; /* control characters */ | ||
36 | cc_t c_line; /* line discipline (== c_cc[19]) */ | ||
37 | speed_t c_ispeed; /* input speed */ | ||
38 | speed_t c_ospeed; /* output speed */ | ||
39 | }; | ||
40 | |||
28 | /* c_cc characters */ | 41 | /* c_cc characters */ |
29 | #define VEOF 0 | 42 | #define VEOF 0 |
30 | #define VEOL 1 | 43 | #define VEOL 1 |
diff --git a/include/asm-arm/arch-pnx4008/i2c.h b/include/asm-arm/arch-pnx4008/i2c.h new file mode 100644 index 000000000000..92e8d65006f7 --- /dev/null +++ b/include/asm-arm/arch-pnx4008/i2c.h | |||
@@ -0,0 +1,67 @@ | |||
1 | /* | ||
2 | * PNX4008-specific tweaks for I2C IP3204 block | ||
3 | * | ||
4 | * Author: Vitaly Wool <vwool@ru.mvista.com> | ||
5 | * | ||
6 | * 2005 (c) MontaVista Software, Inc. This file is licensed under | ||
7 | * the terms of the GNU General Public License version 2. This program | ||
8 | * is licensed "as is" without any warranty of any kind, whether express | ||
9 | * or implied. | ||
10 | */ | ||
11 | |||
12 | #ifndef __ASM_ARCH_I2C_H__ | ||
13 | #define __ASM_ARCH_I2C_H__ | ||
14 | |||
15 | #include <linux/pm.h> | ||
16 | #include <linux/platform_device.h> | ||
17 | |||
18 | enum { | ||
19 | mstatus_tdi = 0x00000001, | ||
20 | mstatus_afi = 0x00000002, | ||
21 | mstatus_nai = 0x00000004, | ||
22 | mstatus_drmi = 0x00000008, | ||
23 | mstatus_active = 0x00000020, | ||
24 | mstatus_scl = 0x00000040, | ||
25 | mstatus_sda = 0x00000080, | ||
26 | mstatus_rff = 0x00000100, | ||
27 | mstatus_rfe = 0x00000200, | ||
28 | mstatus_tff = 0x00000400, | ||
29 | mstatus_tfe = 0x00000800, | ||
30 | }; | ||
31 | |||
32 | enum { | ||
33 | mcntrl_tdie = 0x00000001, | ||
34 | mcntrl_afie = 0x00000002, | ||
35 | mcntrl_naie = 0x00000004, | ||
36 | mcntrl_drmie = 0x00000008, | ||
37 | mcntrl_daie = 0x00000020, | ||
38 | mcntrl_rffie = 0x00000040, | ||
39 | mcntrl_tffie = 0x00000080, | ||
40 | mcntrl_reset = 0x00000100, | ||
41 | mcntrl_cdbmode = 0x00000400, | ||
42 | }; | ||
43 | |||
44 | enum { | ||
45 | rw_bit = 1 << 0, | ||
46 | start_bit = 1 << 8, | ||
47 | stop_bit = 1 << 9, | ||
48 | }; | ||
49 | |||
50 | #define I2C_REG_RX(a) ((a)->ioaddr) /* Rx FIFO reg (RO) */ | ||
51 | #define I2C_REG_TX(a) ((a)->ioaddr) /* Tx FIFO reg (WO) */ | ||
52 | #define I2C_REG_STS(a) ((a)->ioaddr + 0x04) /* Status reg (RO) */ | ||
53 | #define I2C_REG_CTL(a) ((a)->ioaddr + 0x08) /* Ctl reg */ | ||
54 | #define I2C_REG_CKL(a) ((a)->ioaddr + 0x0c) /* Clock divider low */ | ||
55 | #define I2C_REG_CKH(a) ((a)->ioaddr + 0x10) /* Clock divider high */ | ||
56 | #define I2C_REG_ADR(a) ((a)->ioaddr + 0x14) /* I2C address */ | ||
57 | #define I2C_REG_RFL(a) ((a)->ioaddr + 0x18) /* Rx FIFO level (RO) */ | ||
58 | #define I2C_REG_TFL(a) ((a)->ioaddr + 0x1c) /* Tx FIFO level (RO) */ | ||
59 | #define I2C_REG_RXB(a) ((a)->ioaddr + 0x20) /* Num of bytes Rx-ed (RO) */ | ||
60 | #define I2C_REG_TXB(a) ((a)->ioaddr + 0x24) /* Num of bytes Tx-ed (RO) */ | ||
61 | #define I2C_REG_TXS(a) ((a)->ioaddr + 0x28) /* Tx slave FIFO (RO) */ | ||
62 | #define I2C_REG_STFL(a) ((a)->ioaddr + 0x2c) /* Tx slave FIFO level (RO) */ | ||
63 | |||
64 | #define HCLK_MHZ 13 | ||
65 | #define I2C_CHIP_NAME "PNX4008-I2C" | ||
66 | |||
67 | #endif /* __ASM_ARCH_I2C_H___ */ | ||
diff --git a/include/asm-arm/arch-pxa/pxa2xx_spi.h b/include/asm-arm/arch-pxa/pxa2xx_spi.h index 915590c391c8..acc7ec7a84a1 100644 --- a/include/asm-arm/arch-pxa/pxa2xx_spi.h +++ b/include/asm-arm/arch-pxa/pxa2xx_spi.h | |||
@@ -27,16 +27,13 @@ | |||
27 | #define SSP1_SerClkDiv(x) (((CLOCK_SPEED_HZ/2/(x+1))<<8)&0x0000ff00) | 27 | #define SSP1_SerClkDiv(x) (((CLOCK_SPEED_HZ/2/(x+1))<<8)&0x0000ff00) |
28 | #define SSP2_SerClkDiv(x) (((CLOCK_SPEED_HZ/(x+1))<<8)&0x000fff00) | 28 | #define SSP2_SerClkDiv(x) (((CLOCK_SPEED_HZ/(x+1))<<8)&0x000fff00) |
29 | #define SSP3_SerClkDiv(x) (((CLOCK_SPEED_HZ/(x+1))<<8)&0x000fff00) | 29 | #define SSP3_SerClkDiv(x) (((CLOCK_SPEED_HZ/(x+1))<<8)&0x000fff00) |
30 | #define SSP_TIMEOUT_SCALE (2712) | ||
31 | #elif defined(CONFIG_PXA27x) | 30 | #elif defined(CONFIG_PXA27x) |
32 | #define CLOCK_SPEED_HZ 13000000 | 31 | #define CLOCK_SPEED_HZ 13000000 |
33 | #define SSP1_SerClkDiv(x) (((CLOCK_SPEED_HZ/(x+1))<<8)&0x000fff00) | 32 | #define SSP1_SerClkDiv(x) (((CLOCK_SPEED_HZ/(x+1))<<8)&0x000fff00) |
34 | #define SSP2_SerClkDiv(x) (((CLOCK_SPEED_HZ/(x+1))<<8)&0x000fff00) | 33 | #define SSP2_SerClkDiv(x) (((CLOCK_SPEED_HZ/(x+1))<<8)&0x000fff00) |
35 | #define SSP3_SerClkDiv(x) (((CLOCK_SPEED_HZ/(x+1))<<8)&0x000fff00) | 34 | #define SSP3_SerClkDiv(x) (((CLOCK_SPEED_HZ/(x+1))<<8)&0x000fff00) |
36 | #define SSP_TIMEOUT_SCALE (769) | ||
37 | #endif | 35 | #endif |
38 | 36 | ||
39 | #define SSP_TIMEOUT(x) ((x*10000)/SSP_TIMEOUT_SCALE) | ||
40 | #define SSP1_VIRT ((void *)(io_p2v(__PREG(SSCR0_P(1))))) | 37 | #define SSP1_VIRT ((void *)(io_p2v(__PREG(SSCR0_P(1))))) |
41 | #define SSP2_VIRT ((void *)(io_p2v(__PREG(SSCR0_P(2))))) | 38 | #define SSP2_VIRT ((void *)(io_p2v(__PREG(SSCR0_P(2))))) |
42 | #define SSP3_VIRT ((void *)(io_p2v(__PREG(SSCR0_P(3))))) | 39 | #define SSP3_VIRT ((void *)(io_p2v(__PREG(SSCR0_P(3))))) |
@@ -63,7 +60,7 @@ struct pxa2xx_spi_chip { | |||
63 | u8 tx_threshold; | 60 | u8 tx_threshold; |
64 | u8 rx_threshold; | 61 | u8 rx_threshold; |
65 | u8 dma_burst_size; | 62 | u8 dma_burst_size; |
66 | u32 timeout_microsecs; | 63 | u32 timeout; |
67 | u8 enable_loopback; | 64 | u8 enable_loopback; |
68 | void (*cs_control)(u32 command); | 65 | void (*cs_control)(u32 command); |
69 | }; | 66 | }; |
diff --git a/include/asm-arm/arch-s3c2410/fb.h b/include/asm-arm/arch-s3c2410/fb.h index 90894214cace..93a58e7862b0 100644 --- a/include/asm-arm/arch-s3c2410/fb.h +++ b/include/asm-arm/arch-s3c2410/fb.h | |||
@@ -31,6 +31,9 @@ struct s3c2410fb_hw { | |||
31 | struct s3c2410fb_mach_info { | 31 | struct s3c2410fb_mach_info { |
32 | unsigned char fixed_syncs; /* do not update sync/border */ | 32 | unsigned char fixed_syncs; /* do not update sync/border */ |
33 | 33 | ||
34 | /* LCD types */ | ||
35 | int type; | ||
36 | |||
34 | /* Screen size */ | 37 | /* Screen size */ |
35 | int width; | 38 | int width; |
36 | int height; | 39 | int height; |
diff --git a/include/asm-arm/termbits.h b/include/asm-arm/termbits.h index bbc6e1d24d3f..a3f4fe1742d0 100644 --- a/include/asm-arm/termbits.h +++ b/include/asm-arm/termbits.h | |||
@@ -15,6 +15,18 @@ struct termios { | |||
15 | cc_t c_cc[NCCS]; /* control characters */ | 15 | cc_t c_cc[NCCS]; /* control characters */ |
16 | }; | 16 | }; |
17 | 17 | ||
18 | struct ktermios { | ||
19 | tcflag_t c_iflag; /* input mode flags */ | ||
20 | tcflag_t c_oflag; /* output mode flags */ | ||
21 | tcflag_t c_cflag; /* control mode flags */ | ||
22 | tcflag_t c_lflag; /* local mode flags */ | ||
23 | cc_t c_line; /* line discipline */ | ||
24 | cc_t c_cc[NCCS]; /* control characters */ | ||
25 | speed_t c_ispeed; /* input speed */ | ||
26 | speed_t c_ospeed; /* output speed */ | ||
27 | }; | ||
28 | |||
29 | |||
18 | /* c_cc characters */ | 30 | /* c_cc characters */ |
19 | #define VINTR 0 | 31 | #define VINTR 0 |
20 | #define VQUIT 1 | 32 | #define VQUIT 1 |
diff --git a/include/asm-arm26/termbits.h b/include/asm-arm26/termbits.h index bbc6e1d24d3f..a3f4fe1742d0 100644 --- a/include/asm-arm26/termbits.h +++ b/include/asm-arm26/termbits.h | |||
@@ -15,6 +15,18 @@ struct termios { | |||
15 | cc_t c_cc[NCCS]; /* control characters */ | 15 | cc_t c_cc[NCCS]; /* control characters */ |
16 | }; | 16 | }; |
17 | 17 | ||
18 | struct ktermios { | ||
19 | tcflag_t c_iflag; /* input mode flags */ | ||
20 | tcflag_t c_oflag; /* output mode flags */ | ||
21 | tcflag_t c_cflag; /* control mode flags */ | ||
22 | tcflag_t c_lflag; /* local mode flags */ | ||
23 | cc_t c_line; /* line discipline */ | ||
24 | cc_t c_cc[NCCS]; /* control characters */ | ||
25 | speed_t c_ispeed; /* input speed */ | ||
26 | speed_t c_ospeed; /* output speed */ | ||
27 | }; | ||
28 | |||
29 | |||
18 | /* c_cc characters */ | 30 | /* c_cc characters */ |
19 | #define VINTR 0 | 31 | #define VINTR 0 |
20 | #define VQUIT 1 | 32 | #define VQUIT 1 |
diff --git a/include/asm-avr32/arch-at32ap/at32ap7000.h b/include/asm-avr32/arch-at32ap/at32ap7000.h new file mode 100644 index 000000000000..ba85e04553d4 --- /dev/null +++ b/include/asm-avr32/arch-at32ap/at32ap7000.h | |||
@@ -0,0 +1,33 @@ | |||
1 | /* | ||
2 | * Pin definitions for AT32AP7000. | ||
3 | * | ||
4 | * Copyright (C) 2006 Atmel Corporation | ||
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 | #ifndef __ASM_ARCH_AT32AP7000_H__ | ||
11 | #define __ASM_ARCH_AT32AP7000_H__ | ||
12 | |||
13 | #define GPIO_PERIPH_A 0 | ||
14 | #define GPIO_PERIPH_B 1 | ||
15 | |||
16 | #define NR_GPIO_CONTROLLERS 4 | ||
17 | |||
18 | /* | ||
19 | * Pin numbers identifying specific GPIO pins on the chip. They can | ||
20 | * also be converted to IRQ numbers by passing them through | ||
21 | * gpio_to_irq(). | ||
22 | */ | ||
23 | #define GPIO_PIOA_BASE (0) | ||
24 | #define GPIO_PIOB_BASE (GPIO_PIOA_BASE + 32) | ||
25 | #define GPIO_PIOC_BASE (GPIO_PIOB_BASE + 32) | ||
26 | #define GPIO_PIOD_BASE (GPIO_PIOC_BASE + 32) | ||
27 | |||
28 | #define GPIO_PIN_PA(N) (GPIO_PIOA_BASE + (N)) | ||
29 | #define GPIO_PIN_PB(N) (GPIO_PIOB_BASE + (N)) | ||
30 | #define GPIO_PIN_PC(N) (GPIO_PIOC_BASE + (N)) | ||
31 | #define GPIO_PIN_PD(N) (GPIO_PIOD_BASE + (N)) | ||
32 | |||
33 | #endif /* __ASM_ARCH_AT32AP7000_H__ */ | ||
diff --git a/include/asm-avr32/arch-at32ap/board.h b/include/asm-avr32/arch-at32ap/board.h index a39b3e999f18..b120ee030c86 100644 --- a/include/asm-avr32/arch-at32ap/board.h +++ b/include/asm-avr32/arch-at32ap/board.h | |||
@@ -21,10 +21,7 @@ void at32_map_usart(unsigned int hw_id, unsigned int line); | |||
21 | struct platform_device *at32_add_device_usart(unsigned int id); | 21 | struct platform_device *at32_add_device_usart(unsigned int id); |
22 | 22 | ||
23 | struct eth_platform_data { | 23 | struct eth_platform_data { |
24 | u8 valid; | ||
25 | u8 mii_phy_addr; | ||
26 | u8 is_rmii; | 24 | u8 is_rmii; |
27 | u8 hw_addr[6]; | ||
28 | }; | 25 | }; |
29 | struct platform_device * | 26 | struct platform_device * |
30 | at32_add_device_eth(unsigned int id, struct eth_platform_data *data); | 27 | at32_add_device_eth(unsigned int id, struct eth_platform_data *data); |
diff --git a/include/asm-avr32/arch-at32ap/portmux.h b/include/asm-avr32/arch-at32ap/portmux.h index 4d50421262a1..83c690571322 100644 --- a/include/asm-avr32/arch-at32ap/portmux.h +++ b/include/asm-avr32/arch-at32ap/portmux.h | |||
@@ -7,10 +7,20 @@ | |||
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 | #ifndef __ASM_AVR32_AT32_PORTMUX_H__ | 10 | #ifndef __ASM_ARCH_PORTMUX_H__ |
11 | #define __ASM_AVR32_AT32_PORTMUX_H__ | 11 | #define __ASM_ARCH_PORTMUX_H__ |
12 | 12 | ||
13 | void portmux_set_func(unsigned int portmux_id, unsigned int pin_id, | 13 | /* |
14 | unsigned int function_id); | 14 | * Set up pin multiplexing, called from board init only. |
15 | * | ||
16 | * The following flags determine the initial state of the pin. | ||
17 | */ | ||
18 | #define AT32_GPIOF_PULLUP 0x00000001 /* Enable pull-up */ | ||
19 | #define AT32_GPIOF_OUTPUT 0x00000002 /* Enable output driver */ | ||
20 | #define AT32_GPIOF_HIGH 0x00000004 /* Set output high */ | ||
21 | |||
22 | void at32_select_periph(unsigned int pin, unsigned int periph, | ||
23 | unsigned long flags); | ||
24 | void at32_select_gpio(unsigned int pin, unsigned long flags); | ||
15 | 25 | ||
16 | #endif /* __ASM_AVR32_AT32_PORTMUX_H__ */ | 26 | #endif /* __ASM_ARCH_PORTMUX_H__ */ |
diff --git a/include/asm-avr32/dma-mapping.h b/include/asm-avr32/dma-mapping.h index 0580b5d62bba..5c01e27f0b41 100644 --- a/include/asm-avr32/dma-mapping.h +++ b/include/asm-avr32/dma-mapping.h | |||
@@ -109,7 +109,7 @@ static inline dma_addr_t | |||
109 | dma_map_single(struct device *dev, void *cpu_addr, size_t size, | 109 | dma_map_single(struct device *dev, void *cpu_addr, size_t size, |
110 | enum dma_data_direction direction) | 110 | enum dma_data_direction direction) |
111 | { | 111 | { |
112 | dma_cache_sync(cpu_addr, size, direction); | 112 | dma_cache_sync(dev, cpu_addr, size, direction); |
113 | return virt_to_bus(cpu_addr); | 113 | return virt_to_bus(cpu_addr); |
114 | } | 114 | } |
115 | 115 | ||
@@ -211,7 +211,7 @@ dma_map_sg(struct device *dev, struct scatterlist *sg, int nents, | |||
211 | 211 | ||
212 | sg[i].dma_address = page_to_bus(sg[i].page) + sg[i].offset; | 212 | sg[i].dma_address = page_to_bus(sg[i].page) + sg[i].offset; |
213 | virt = page_address(sg[i].page) + sg[i].offset; | 213 | virt = page_address(sg[i].page) + sg[i].offset; |
214 | dma_cache_sync(virt, sg[i].length, direction); | 214 | dma_cache_sync(dev, virt, sg[i].length, direction); |
215 | } | 215 | } |
216 | 216 | ||
217 | return nents; | 217 | return nents; |
@@ -256,14 +256,14 @@ static inline void | |||
256 | dma_sync_single_for_cpu(struct device *dev, dma_addr_t dma_handle, | 256 | dma_sync_single_for_cpu(struct device *dev, dma_addr_t dma_handle, |
257 | size_t size, enum dma_data_direction direction) | 257 | size_t size, enum dma_data_direction direction) |
258 | { | 258 | { |
259 | dma_cache_sync(bus_to_virt(dma_handle), size, direction); | 259 | dma_cache_sync(dev, bus_to_virt(dma_handle), size, direction); |
260 | } | 260 | } |
261 | 261 | ||
262 | static inline void | 262 | static inline void |
263 | dma_sync_single_for_device(struct device *dev, dma_addr_t dma_handle, | 263 | dma_sync_single_for_device(struct device *dev, dma_addr_t dma_handle, |
264 | size_t size, enum dma_data_direction direction) | 264 | size_t size, enum dma_data_direction direction) |
265 | { | 265 | { |
266 | dma_cache_sync(bus_to_virt(dma_handle), size, direction); | 266 | dma_cache_sync(dev, bus_to_virt(dma_handle), size, direction); |
267 | } | 267 | } |
268 | 268 | ||
269 | /** | 269 | /** |
@@ -286,7 +286,7 @@ dma_sync_sg_for_cpu(struct device *dev, struct scatterlist *sg, | |||
286 | int i; | 286 | int i; |
287 | 287 | ||
288 | for (i = 0; i < nents; i++) { | 288 | for (i = 0; i < nents; i++) { |
289 | dma_cache_sync(page_address(sg[i].page) + sg[i].offset, | 289 | dma_cache_sync(dev, page_address(sg[i].page) + sg[i].offset, |
290 | sg[i].length, direction); | 290 | sg[i].length, direction); |
291 | } | 291 | } |
292 | } | 292 | } |
@@ -298,7 +298,7 @@ dma_sync_sg_for_device(struct device *dev, struct scatterlist *sg, | |||
298 | int i; | 298 | int i; |
299 | 299 | ||
300 | for (i = 0; i < nents; i++) { | 300 | for (i = 0; i < nents; i++) { |
301 | dma_cache_sync(page_address(sg[i].page) + sg[i].offset, | 301 | dma_cache_sync(dev, page_address(sg[i].page) + sg[i].offset, |
302 | sg[i].length, direction); | 302 | sg[i].length, direction); |
303 | } | 303 | } |
304 | } | 304 | } |
diff --git a/include/asm-avr32/termbits.h b/include/asm-avr32/termbits.h index 9dc6eacafa33..c215fafdae4d 100644 --- a/include/asm-avr32/termbits.h +++ b/include/asm-avr32/termbits.h | |||
@@ -17,6 +17,17 @@ struct termios { | |||
17 | cc_t c_cc[NCCS]; /* control characters */ | 17 | cc_t c_cc[NCCS]; /* control characters */ |
18 | }; | 18 | }; |
19 | 19 | ||
20 | struct ktermios { | ||
21 | tcflag_t c_iflag; /* input mode flags */ | ||
22 | tcflag_t c_oflag; /* output mode flags */ | ||
23 | tcflag_t c_cflag; /* control mode flags */ | ||
24 | tcflag_t c_lflag; /* local mode flags */ | ||
25 | cc_t c_line; /* line discipline */ | ||
26 | cc_t c_cc[NCCS]; /* control characters */ | ||
27 | speed_t c_ispeed; /* input speed */ | ||
28 | speed_t c_ospeed; /* output speed */ | ||
29 | }; | ||
30 | |||
20 | /* c_cc characters */ | 31 | /* c_cc characters */ |
21 | #define VINTR 0 | 32 | #define VINTR 0 |
22 | #define VQUIT 1 | 33 | #define VQUIT 1 |
diff --git a/include/asm-cris/termbits.h b/include/asm-cris/termbits.h index be0836d2f282..8d8cec225fe1 100644 --- a/include/asm-cris/termbits.h +++ b/include/asm-cris/termbits.h | |||
@@ -19,6 +19,17 @@ struct termios { | |||
19 | cc_t c_cc[NCCS]; /* control characters */ | 19 | cc_t c_cc[NCCS]; /* control characters */ |
20 | }; | 20 | }; |
21 | 21 | ||
22 | struct ktermios { | ||
23 | tcflag_t c_iflag; /* input mode flags */ | ||
24 | tcflag_t c_oflag; /* output mode flags */ | ||
25 | tcflag_t c_cflag; /* control mode flags */ | ||
26 | tcflag_t c_lflag; /* local mode flags */ | ||
27 | cc_t c_line; /* line discipline */ | ||
28 | cc_t c_cc[NCCS]; /* control characters */ | ||
29 | speed_t c_ispeed; /* input speed */ | ||
30 | speed_t c_ospeed; /* output speed */ | ||
31 | }; | ||
32 | |||
22 | /* c_cc characters */ | 33 | /* c_cc characters */ |
23 | #define VINTR 0 | 34 | #define VINTR 0 |
24 | #define VQUIT 1 | 35 | #define VQUIT 1 |
diff --git a/include/asm-frv/bitops.h b/include/asm-frv/bitops.h index 1f70d47148bd..f8560edf59ff 100644 --- a/include/asm-frv/bitops.h +++ b/include/asm-frv/bitops.h | |||
@@ -256,6 +256,50 @@ int __ffs(unsigned long x) | |||
256 | return 31 - bit; | 256 | return 31 - bit; |
257 | } | 257 | } |
258 | 258 | ||
259 | /* | ||
260 | * special slimline version of fls() for calculating ilog2_u32() | ||
261 | * - note: no protection against n == 0 | ||
262 | */ | ||
263 | #define ARCH_HAS_ILOG2_U32 | ||
264 | static inline __attribute__((const)) | ||
265 | int __ilog2_u32(u32 n) | ||
266 | { | ||
267 | int bit; | ||
268 | asm("scan %1,gr0,%0" : "=r"(bit) : "r"(n)); | ||
269 | return 31 - bit; | ||
270 | } | ||
271 | |||
272 | /* | ||
273 | * special slimline version of fls64() for calculating ilog2_u64() | ||
274 | * - note: no protection against n == 0 | ||
275 | */ | ||
276 | #define ARCH_HAS_ILOG2_U64 | ||
277 | static inline __attribute__((const)) | ||
278 | int __ilog2_u64(u64 n) | ||
279 | { | ||
280 | union { | ||
281 | u64 ll; | ||
282 | struct { u32 h, l; }; | ||
283 | } _; | ||
284 | int bit, x, y; | ||
285 | |||
286 | _.ll = n; | ||
287 | |||
288 | asm(" subcc %3,gr0,gr0,icc0 \n" | ||
289 | " ckeq icc0,cc4 \n" | ||
290 | " cscan.p %3,gr0,%0 ,cc4,0 \n" | ||
291 | " setlos #63,%1 \n" | ||
292 | " cscan.p %4,gr0,%0 ,cc4,1 \n" | ||
293 | " setlos #31,%2 \n" | ||
294 | " csub.p %1,%0,%0 ,cc4,0 \n" | ||
295 | " csub %2,%0,%0 ,cc4,1 \n" | ||
296 | : "=&r"(bit), "=r"(x), "=r"(y) | ||
297 | : "0r"(_.h), "r"(_.l) | ||
298 | : "icc0", "cc4" | ||
299 | ); | ||
300 | return bit; | ||
301 | } | ||
302 | |||
259 | #include <asm-generic/bitops/sched.h> | 303 | #include <asm-generic/bitops/sched.h> |
260 | #include <asm-generic/bitops/hweight.h> | 304 | #include <asm-generic/bitops/hweight.h> |
261 | 305 | ||
diff --git a/include/asm-frv/termbits.h b/include/asm-frv/termbits.h index 74f20d6e292f..2d6d389cff49 100644 --- a/include/asm-frv/termbits.h +++ b/include/asm-frv/termbits.h | |||
@@ -17,6 +17,17 @@ struct termios { | |||
17 | cc_t c_cc[NCCS]; /* control characters */ | 17 | cc_t c_cc[NCCS]; /* control characters */ |
18 | }; | 18 | }; |
19 | 19 | ||
20 | struct ktermios { | ||
21 | tcflag_t c_iflag; /* input mode flags */ | ||
22 | tcflag_t c_oflag; /* output mode flags */ | ||
23 | tcflag_t c_cflag; /* control mode flags */ | ||
24 | tcflag_t c_lflag; /* local mode flags */ | ||
25 | cc_t c_line; /* line discipline */ | ||
26 | cc_t c_cc[NCCS]; /* control characters */ | ||
27 | speed_t c_ispeed; /* input speed */ | ||
28 | speed_t c_ospeed; /* output speed */ | ||
29 | }; | ||
30 | |||
20 | /* c_cc characters */ | 31 | /* c_cc characters */ |
21 | #define VINTR 0 | 32 | #define VINTR 0 |
22 | #define VQUIT 1 | 33 | #define VQUIT 1 |
diff --git a/include/asm-generic/bug.h b/include/asm-generic/bug.h index c92ae0f166ff..a06eecd48292 100644 --- a/include/asm-generic/bug.h +++ b/include/asm-generic/bug.h | |||
@@ -4,6 +4,22 @@ | |||
4 | #include <linux/compiler.h> | 4 | #include <linux/compiler.h> |
5 | 5 | ||
6 | #ifdef CONFIG_BUG | 6 | #ifdef CONFIG_BUG |
7 | |||
8 | #ifdef CONFIG_GENERIC_BUG | ||
9 | #ifndef __ASSEMBLY__ | ||
10 | struct bug_entry { | ||
11 | unsigned long bug_addr; | ||
12 | #ifdef CONFIG_DEBUG_BUGVERBOSE | ||
13 | const char *file; | ||
14 | unsigned short line; | ||
15 | #endif | ||
16 | unsigned short flags; | ||
17 | }; | ||
18 | #endif /* __ASSEMBLY__ */ | ||
19 | |||
20 | #define BUGFLAG_WARNING (1<<0) | ||
21 | #endif /* CONFIG_GENERIC_BUG */ | ||
22 | |||
7 | #ifndef HAVE_ARCH_BUG | 23 | #ifndef HAVE_ARCH_BUG |
8 | #define BUG() do { \ | 24 | #define BUG() do { \ |
9 | printk("BUG: failure at %s:%d/%s()!\n", __FILE__, __LINE__, __FUNCTION__); \ | 25 | printk("BUG: failure at %s:%d/%s()!\n", __FILE__, __LINE__, __FUNCTION__); \ |
@@ -19,7 +35,7 @@ | |||
19 | #define WARN_ON(condition) ({ \ | 35 | #define WARN_ON(condition) ({ \ |
20 | typeof(condition) __ret_warn_on = (condition); \ | 36 | typeof(condition) __ret_warn_on = (condition); \ |
21 | if (unlikely(__ret_warn_on)) { \ | 37 | if (unlikely(__ret_warn_on)) { \ |
22 | printk("BUG: warning at %s:%d/%s()\n", __FILE__, \ | 38 | printk("WARNING at %s:%d %s()\n", __FILE__, \ |
23 | __LINE__, __FUNCTION__); \ | 39 | __LINE__, __FUNCTION__); \ |
24 | dump_stack(); \ | 40 | dump_stack(); \ |
25 | } \ | 41 | } \ |
diff --git a/include/asm-generic/page.h b/include/asm-generic/page.h index a96b5d986b6e..b55052ce2330 100644 --- a/include/asm-generic/page.h +++ b/include/asm-generic/page.h | |||
@@ -4,21 +4,51 @@ | |||
4 | #ifdef __KERNEL__ | 4 | #ifdef __KERNEL__ |
5 | #ifndef __ASSEMBLY__ | 5 | #ifndef __ASSEMBLY__ |
6 | 6 | ||
7 | #include <linux/compiler.h> | 7 | #include <linux/log2.h> |
8 | 8 | ||
9 | /* Pure 2^n version of get_order */ | 9 | /* |
10 | static __inline__ __attribute_const__ int get_order(unsigned long size) | 10 | * non-const pure 2^n version of get_order |
11 | * - the arch may override these in asm/bitops.h if they can be implemented | ||
12 | * more efficiently than using the arch log2 routines | ||
13 | * - we use the non-const log2() instead if the arch has defined one suitable | ||
14 | */ | ||
15 | #ifndef ARCH_HAS_GET_ORDER | ||
16 | static inline __attribute__((const)) | ||
17 | int __get_order(unsigned long size, int page_shift) | ||
11 | { | 18 | { |
19 | #if BITS_PER_LONG == 32 && defined(ARCH_HAS_ILOG2_U32) | ||
20 | int order = __ilog2_u32(size) - page_shift; | ||
21 | return order >= 0 ? order : 0; | ||
22 | #elif BITS_PER_LONG == 64 && defined(ARCH_HAS_ILOG2_U64) | ||
23 | int order = __ilog2_u64(size) - page_shift; | ||
24 | return order >= 0 ? order : 0; | ||
25 | #else | ||
12 | int order; | 26 | int order; |
13 | 27 | ||
14 | size = (size - 1) >> (PAGE_SHIFT - 1); | 28 | size = (size - 1) >> (page_shift - 1); |
15 | order = -1; | 29 | order = -1; |
16 | do { | 30 | do { |
17 | size >>= 1; | 31 | size >>= 1; |
18 | order++; | 32 | order++; |
19 | } while (size); | 33 | } while (size); |
20 | return order; | 34 | return order; |
35 | #endif | ||
21 | } | 36 | } |
37 | #endif | ||
38 | |||
39 | /** | ||
40 | * get_order - calculate log2(pages) to hold a block of the specified size | ||
41 | * @n - size | ||
42 | * | ||
43 | * calculate allocation order based on the current page size | ||
44 | * - this can be used to initialise global variables from constant data | ||
45 | */ | ||
46 | #define get_order(n) \ | ||
47 | ( \ | ||
48 | __builtin_constant_p(n) ? \ | ||
49 | ((n < (1UL << PAGE_SHIFT)) ? 0 : ilog2(n) - PAGE_SHIFT) : \ | ||
50 | __get_order(n, PAGE_SHIFT) \ | ||
51 | ) | ||
22 | 52 | ||
23 | #endif /* __ASSEMBLY__ */ | 53 | #endif /* __ASSEMBLY__ */ |
24 | #endif /* __KERNEL__ */ | 54 | #endif /* __KERNEL__ */ |
diff --git a/include/asm-generic/termios.h b/include/asm-generic/termios.h index 1e58ca39592c..3769e6bd63b1 100644 --- a/include/asm-generic/termios.h +++ b/include/asm-generic/termios.h | |||
@@ -11,7 +11,7 @@ | |||
11 | /* | 11 | /* |
12 | * Translate a "termio" structure into a "termios". Ugh. | 12 | * Translate a "termio" structure into a "termios". Ugh. |
13 | */ | 13 | */ |
14 | static inline int user_termio_to_kernel_termios(struct termios *termios, | 14 | static inline int user_termio_to_kernel_termios(struct ktermios *termios, |
15 | struct termio __user *termio) | 15 | struct termio __user *termio) |
16 | { | 16 | { |
17 | unsigned short tmp; | 17 | unsigned short tmp; |
@@ -48,7 +48,7 @@ static inline int user_termio_to_kernel_termios(struct termios *termios, | |||
48 | * Translate a "termios" structure into a "termio". Ugh. | 48 | * Translate a "termios" structure into a "termio". Ugh. |
49 | */ | 49 | */ |
50 | static inline int kernel_termios_to_user_termio(struct termio __user *termio, | 50 | static inline int kernel_termios_to_user_termio(struct termio __user *termio, |
51 | struct termios *termios) | 51 | struct ktermios *termios) |
52 | { | 52 | { |
53 | if (put_user(termios->c_iflag, &termio->c_iflag) < 0 || | 53 | if (put_user(termios->c_iflag, &termio->c_iflag) < 0 || |
54 | put_user(termios->c_oflag, &termio->c_oflag) < 0 || | 54 | put_user(termios->c_oflag, &termio->c_oflag) < 0 || |
diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h index 4d4c62d11059..7437ccaada77 100644 --- a/include/asm-generic/vmlinux.lds.h +++ b/include/asm-generic/vmlinux.lds.h | |||
@@ -218,6 +218,14 @@ | |||
218 | .stab.indexstr 0 : { *(.stab.indexstr) } \ | 218 | .stab.indexstr 0 : { *(.stab.indexstr) } \ |
219 | .comment 0 : { *(.comment) } | 219 | .comment 0 : { *(.comment) } |
220 | 220 | ||
221 | #define BUG_TABLE \ | ||
222 | . = ALIGN(8); \ | ||
223 | __bug_table : AT(ADDR(__bug_table) - LOAD_OFFSET) { \ | ||
224 | __start___bug_table = .; \ | ||
225 | *(__bug_table) \ | ||
226 | __stop___bug_table = .; \ | ||
227 | } | ||
228 | |||
221 | #define NOTES \ | 229 | #define NOTES \ |
222 | .notes : { *(.note.*) } :note | 230 | .notes : { *(.note.*) } :note |
223 | 231 | ||
@@ -234,6 +242,7 @@ | |||
234 | *(.initcall4s.init) \ | 242 | *(.initcall4s.init) \ |
235 | *(.initcall5.init) \ | 243 | *(.initcall5.init) \ |
236 | *(.initcall5s.init) \ | 244 | *(.initcall5s.init) \ |
245 | *(.initcallrootfs.init) \ | ||
237 | *(.initcall6.init) \ | 246 | *(.initcall6.init) \ |
238 | *(.initcall6s.init) \ | 247 | *(.initcall6s.init) \ |
239 | *(.initcall7.init) \ | 248 | *(.initcall7.init) \ |
diff --git a/include/asm-h8300/termbits.h b/include/asm-h8300/termbits.h index fa69ae00eda3..6a1f4d3807b4 100644 --- a/include/asm-h8300/termbits.h +++ b/include/asm-h8300/termbits.h | |||
@@ -17,6 +17,17 @@ struct termios { | |||
17 | cc_t c_cc[NCCS]; /* control characters */ | 17 | cc_t c_cc[NCCS]; /* control characters */ |
18 | }; | 18 | }; |
19 | 19 | ||
20 | struct ktermios { | ||
21 | tcflag_t c_iflag; /* input mode flags */ | ||
22 | tcflag_t c_oflag; /* output mode flags */ | ||
23 | tcflag_t c_cflag; /* control mode flags */ | ||
24 | tcflag_t c_lflag; /* local mode flags */ | ||
25 | cc_t c_line; /* line discipline */ | ||
26 | cc_t c_cc[NCCS]; /* control characters */ | ||
27 | speed_t c_ispeed; /* input speed */ | ||
28 | speed_t c_ospeed; /* output speed */ | ||
29 | }; | ||
30 | |||
20 | /* c_cc characters */ | 31 | /* c_cc characters */ |
21 | #define VINTR 0 | 32 | #define VINTR 0 |
22 | #define VQUIT 1 | 33 | #define VQUIT 1 |
diff --git a/include/asm-i386/bug.h b/include/asm-i386/bug.h index 8062cdbf2587..b0fd78ca2619 100644 --- a/include/asm-i386/bug.h +++ b/include/asm-i386/bug.h | |||
@@ -4,20 +4,32 @@ | |||
4 | 4 | ||
5 | /* | 5 | /* |
6 | * Tell the user there is some problem. | 6 | * Tell the user there is some problem. |
7 | * The offending file and line are encoded after the "officially | 7 | * The offending file and line are encoded encoded in the __bug_table section. |
8 | * undefined" opcode for parsing in the trap handler. | ||
9 | */ | 8 | */ |
10 | 9 | ||
11 | #ifdef CONFIG_BUG | 10 | #ifdef CONFIG_BUG |
12 | #define HAVE_ARCH_BUG | 11 | #define HAVE_ARCH_BUG |
12 | |||
13 | #ifdef CONFIG_DEBUG_BUGVERBOSE | 13 | #ifdef CONFIG_DEBUG_BUGVERBOSE |
14 | #define BUG() \ | 14 | #define BUG() \ |
15 | __asm__ __volatile__( "ud2\n" \ | 15 | do { \ |
16 | "\t.word %c0\n" \ | 16 | asm volatile("1:\tud2\n" \ |
17 | "\t.long %c1\n" \ | 17 | ".pushsection __bug_table,\"a\"\n" \ |
18 | : : "i" (__LINE__), "i" (__FILE__)) | 18 | "2:\t.long 1b, %c0\n" \ |
19 | "\t.word %c1, 0\n" \ | ||
20 | "\t.org 2b+%c2\n" \ | ||
21 | ".popsection" \ | ||
22 | : : "i" (__FILE__), "i" (__LINE__), \ | ||
23 | "i" (sizeof(struct bug_entry))); \ | ||
24 | for(;;) ; \ | ||
25 | } while(0) | ||
26 | |||
19 | #else | 27 | #else |
20 | #define BUG() __asm__ __volatile__("ud2\n") | 28 | #define BUG() \ |
29 | do { \ | ||
30 | asm volatile("ud2"); \ | ||
31 | for(;;) ; \ | ||
32 | } while(0) | ||
21 | #endif | 33 | #endif |
22 | #endif | 34 | #endif |
23 | 35 | ||
diff --git a/include/asm-i386/ide.h b/include/asm-i386/ide.h index 73465d2892b9..0fc240c80f49 100644 --- a/include/asm-i386/ide.h +++ b/include/asm-i386/ide.h | |||
@@ -40,13 +40,14 @@ static __inline__ int ide_default_irq(unsigned long base) | |||
40 | 40 | ||
41 | static __inline__ unsigned long ide_default_io_base(int index) | 41 | static __inline__ unsigned long ide_default_io_base(int index) |
42 | { | 42 | { |
43 | struct pci_dev *pdev; | ||
43 | /* | 44 | /* |
44 | * If PCI is present then it is not safe to poke around | 45 | * If PCI is present then it is not safe to poke around |
45 | * the other legacy IDE ports. Only 0x1f0 and 0x170 are | 46 | * the other legacy IDE ports. Only 0x1f0 and 0x170 are |
46 | * defined compatibility mode ports for PCI. A user can | 47 | * defined compatibility mode ports for PCI. A user can |
47 | * override this using ide= but we must default safe. | 48 | * override this using ide= but we must default safe. |
48 | */ | 49 | */ |
49 | if (pci_find_device(PCI_ANY_ID, PCI_ANY_ID, NULL) == NULL) { | 50 | if ((pdev = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, NULL)) == NULL) { |
50 | switch(index) { | 51 | switch(index) { |
51 | case 2: return 0x1e8; | 52 | case 2: return 0x1e8; |
52 | case 3: return 0x168; | 53 | case 3: return 0x168; |
@@ -54,6 +55,7 @@ static __inline__ unsigned long ide_default_io_base(int index) | |||
54 | case 5: return 0x160; | 55 | case 5: return 0x160; |
55 | } | 56 | } |
56 | } | 57 | } |
58 | pci_dev_put(pdev); | ||
57 | switch (index) { | 59 | switch (index) { |
58 | case 0: return 0x1f0; | 60 | case 0: return 0x1f0; |
59 | case 1: return 0x170; | 61 | case 1: return 0x170; |
diff --git a/include/asm-i386/termbits.h b/include/asm-i386/termbits.h index 72c10e3190f8..12baf1d6343f 100644 --- a/include/asm-i386/termbits.h +++ b/include/asm-i386/termbits.h | |||
@@ -17,6 +17,17 @@ struct termios { | |||
17 | cc_t c_cc[NCCS]; /* control characters */ | 17 | cc_t c_cc[NCCS]; /* control characters */ |
18 | }; | 18 | }; |
19 | 19 | ||
20 | struct ktermios { | ||
21 | tcflag_t c_iflag; /* input mode flags */ | ||
22 | tcflag_t c_oflag; /* output mode flags */ | ||
23 | tcflag_t c_cflag; /* control mode flags */ | ||
24 | tcflag_t c_lflag; /* local mode flags */ | ||
25 | cc_t c_line; /* line discipline */ | ||
26 | cc_t c_cc[NCCS]; /* control characters */ | ||
27 | speed_t c_ispeed; /* input speed */ | ||
28 | speed_t c_ospeed; /* output speed */ | ||
29 | }; | ||
30 | |||
20 | /* c_cc characters */ | 31 | /* c_cc characters */ |
21 | #define VINTR 0 | 32 | #define VINTR 0 |
22 | #define VQUIT 1 | 33 | #define VQUIT 1 |
diff --git a/include/asm-i386/topology.h b/include/asm-i386/topology.h index 978d09596130..ac58580ad664 100644 --- a/include/asm-i386/topology.h +++ b/include/asm-i386/topology.h | |||
@@ -89,6 +89,7 @@ static inline int node_to_first_cpu(int node) | |||
89 | .flags = SD_LOAD_BALANCE \ | 89 | .flags = SD_LOAD_BALANCE \ |
90 | | SD_BALANCE_EXEC \ | 90 | | SD_BALANCE_EXEC \ |
91 | | SD_BALANCE_FORK \ | 91 | | SD_BALANCE_FORK \ |
92 | | SD_SERIALIZE \ | ||
92 | | SD_WAKE_BALANCE, \ | 93 | | SD_WAKE_BALANCE, \ |
93 | .last_balance = jiffies, \ | 94 | .last_balance = jiffies, \ |
94 | .balance_interval = 1, \ | 95 | .balance_interval = 1, \ |
diff --git a/include/asm-ia64/termbits.h b/include/asm-ia64/termbits.h index b9e843f7dc42..4531a511bde5 100644 --- a/include/asm-ia64/termbits.h +++ b/include/asm-ia64/termbits.h | |||
@@ -26,6 +26,17 @@ struct termios { | |||
26 | cc_t c_cc[NCCS]; /* control characters */ | 26 | cc_t c_cc[NCCS]; /* control characters */ |
27 | }; | 27 | }; |
28 | 28 | ||
29 | struct ktermios { | ||
30 | tcflag_t c_iflag; /* input mode flags */ | ||
31 | tcflag_t c_oflag; /* output mode flags */ | ||
32 | tcflag_t c_cflag; /* control mode flags */ | ||
33 | tcflag_t c_lflag; /* local mode flags */ | ||
34 | cc_t c_line; /* line discipline */ | ||
35 | cc_t c_cc[NCCS]; /* control characters */ | ||
36 | speed_t c_ispeed; /* input speed */ | ||
37 | speed_t c_ospeed; /* output speed */ | ||
38 | }; | ||
39 | |||
29 | /* c_cc characters */ | 40 | /* c_cc characters */ |
30 | #define VINTR 0 | 41 | #define VINTR 0 |
31 | #define VQUIT 1 | 42 | #define VQUIT 1 |
diff --git a/include/asm-ia64/topology.h b/include/asm-ia64/topology.h index a6e38565ab4c..22ed6749557e 100644 --- a/include/asm-ia64/topology.h +++ b/include/asm-ia64/topology.h | |||
@@ -101,6 +101,7 @@ void build_cpu_to_node_map(void); | |||
101 | .flags = SD_LOAD_BALANCE \ | 101 | .flags = SD_LOAD_BALANCE \ |
102 | | SD_BALANCE_EXEC \ | 102 | | SD_BALANCE_EXEC \ |
103 | | SD_BALANCE_FORK \ | 103 | | SD_BALANCE_FORK \ |
104 | | SD_SERIALIZE \ | ||
104 | | SD_WAKE_BALANCE, \ | 105 | | SD_WAKE_BALANCE, \ |
105 | .last_balance = jiffies, \ | 106 | .last_balance = jiffies, \ |
106 | .balance_interval = 64, \ | 107 | .balance_interval = 64, \ |
diff --git a/include/asm-m32r/ide.h b/include/asm-m32r/ide.h index 219a0f74eff3..c82ebe8f250d 100644 --- a/include/asm-m32r/ide.h +++ b/include/asm-m32r/ide.h | |||
@@ -32,7 +32,8 @@ | |||
32 | static __inline__ int ide_default_irq(unsigned long base) | 32 | static __inline__ int ide_default_irq(unsigned long base) |
33 | { | 33 | { |
34 | switch (base) { | 34 | switch (base) { |
35 | #if defined(CONFIG_PLAT_M32700UT) || defined(CONFIG_PLAT_MAPPI2) | 35 | #if defined(CONFIG_PLAT_M32700UT) || defined(CONFIG_PLAT_MAPPI2) \ |
36 | || defined(CONFIG_PLAT_OPSPUT) | ||
36 | case 0x1f0: return PLD_IRQ_CFIREQ; | 37 | case 0x1f0: return PLD_IRQ_CFIREQ; |
37 | default: | 38 | default: |
38 | return 0; | 39 | return 0; |
diff --git a/include/asm-m32r/m32102.h b/include/asm-m32r/m32102.h index a1f0d1fe9eb8..52807f8db166 100644 --- a/include/asm-m32r/m32102.h +++ b/include/asm-m32r/m32102.h | |||
@@ -104,7 +104,8 @@ | |||
104 | #define M32R_MFT5RLD_PORTL (0x0C+M32R_MFT5_OFFSET) /* MFT4 reload */ | 104 | #define M32R_MFT5RLD_PORTL (0x0C+M32R_MFT5_OFFSET) /* MFT4 reload */ |
105 | #define M32R_MFT5CMPRLD_PORTL (0x10+M32R_MFT5_OFFSET) /* MFT4 compare reload */ | 105 | #define M32R_MFT5CMPRLD_PORTL (0x10+M32R_MFT5_OFFSET) /* MFT4 compare reload */ |
106 | 106 | ||
107 | #if defined(CONFIG_CHIP_M32700) || defined(CONFIG_CHIP_M32104) | 107 | #if (defined(CONFIG_CHIP_M32700) && !defined(CONFIG_PLAT_MAPPI2)) \ |
108 | || defined(CONFIG_CHIP_M32104) | ||
108 | #define M32R_MFTCR_MFT0MSK (1UL<<31) /* b0 */ | 109 | #define M32R_MFTCR_MFT0MSK (1UL<<31) /* b0 */ |
109 | #define M32R_MFTCR_MFT1MSK (1UL<<30) /* b1 */ | 110 | #define M32R_MFTCR_MFT1MSK (1UL<<30) /* b1 */ |
110 | #define M32R_MFTCR_MFT2MSK (1UL<<29) /* b2 */ | 111 | #define M32R_MFTCR_MFT2MSK (1UL<<29) /* b2 */ |
@@ -117,7 +118,7 @@ | |||
117 | #define M32R_MFTCR_MFT3EN (1UL<<20) /* b11 */ | 118 | #define M32R_MFTCR_MFT3EN (1UL<<20) /* b11 */ |
118 | #define M32R_MFTCR_MFT4EN (1UL<<19) /* b12 */ | 119 | #define M32R_MFTCR_MFT4EN (1UL<<19) /* b12 */ |
119 | #define M32R_MFTCR_MFT5EN (1UL<<18) /* b13 */ | 120 | #define M32R_MFTCR_MFT5EN (1UL<<18) /* b13 */ |
120 | #else /* not CONFIG_CHIP_M32700 && not CONFIG_CHIP_M32104 */ | 121 | #else |
121 | #define M32R_MFTCR_MFT0MSK (1UL<<15) /* b16 */ | 122 | #define M32R_MFTCR_MFT0MSK (1UL<<15) /* b16 */ |
122 | #define M32R_MFTCR_MFT1MSK (1UL<<14) /* b17 */ | 123 | #define M32R_MFTCR_MFT1MSK (1UL<<14) /* b17 */ |
123 | #define M32R_MFTCR_MFT2MSK (1UL<<13) /* b18 */ | 124 | #define M32R_MFTCR_MFT2MSK (1UL<<13) /* b18 */ |
@@ -130,7 +131,7 @@ | |||
130 | #define M32R_MFTCR_MFT3EN (1UL<<4) /* b27 */ | 131 | #define M32R_MFTCR_MFT3EN (1UL<<4) /* b27 */ |
131 | #define M32R_MFTCR_MFT4EN (1UL<<3) /* b28 */ | 132 | #define M32R_MFTCR_MFT4EN (1UL<<3) /* b28 */ |
132 | #define M32R_MFTCR_MFT5EN (1UL<<2) /* b29 */ | 133 | #define M32R_MFTCR_MFT5EN (1UL<<2) /* b29 */ |
133 | #endif /* not CONFIG_CHIP_M32700 && not CONFIG_CHIP_M32104 */ | 134 | #endif |
134 | 135 | ||
135 | #define M32R_MFTMOD_CC_MASK (1UL<<15) /* b16 */ | 136 | #define M32R_MFTMOD_CC_MASK (1UL<<15) /* b16 */ |
136 | #define M32R_MFTMOD_TCCR (1UL<<13) /* b18 */ | 137 | #define M32R_MFTMOD_TCCR (1UL<<13) /* b18 */ |
diff --git a/include/asm-m32r/ptrace.h b/include/asm-m32r/ptrace.h index 2d2a6c97331e..632b4ce4269a 100644 --- a/include/asm-m32r/ptrace.h +++ b/include/asm-m32r/ptrace.h | |||
@@ -33,21 +33,10 @@ | |||
33 | #define PT_R15 PT_SP | 33 | #define PT_R15 PT_SP |
34 | 34 | ||
35 | /* processor status and miscellaneous context registers. */ | 35 | /* processor status and miscellaneous context registers. */ |
36 | #if defined(CONFIG_ISA_M32R2) && defined(CONFIG_ISA_DSP_LEVEL2) | ||
37 | #define PT_ACC0H 15 | 36 | #define PT_ACC0H 15 |
38 | #define PT_ACC0L 16 | 37 | #define PT_ACC0L 16 |
39 | #define PT_ACC1H 17 | 38 | #define PT_ACC1H 17 /* ISA_DSP_LEVEL2 only */ |
40 | #define PT_ACC1L 18 | 39 | #define PT_ACC1L 18 /* ISA_DSP_LEVEL2 only */ |
41 | #define PT_ACCH PT_ACC0H | ||
42 | #define PT_ACCL PT_ACC0L | ||
43 | #elif defined(CONFIG_ISA_M32R2) || defined(CONFIG_ISA_M32R) | ||
44 | #define PT_ACCH 15 | ||
45 | #define PT_ACCL 16 | ||
46 | #define PT_DUMMY_ACC1H 17 | ||
47 | #define PT_DUMMY_ACC1L 18 | ||
48 | #else | ||
49 | #error unknown isa conifiguration | ||
50 | #endif | ||
51 | #define PT_PSW 19 | 40 | #define PT_PSW 19 |
52 | #define PT_BPC 20 | 41 | #define PT_BPC 20 |
53 | #define PT_BBPSW 21 | 42 | #define PT_BBPSW 21 |
@@ -103,19 +92,10 @@ struct pt_regs { | |||
103 | long syscall_nr; | 92 | long syscall_nr; |
104 | 93 | ||
105 | /* Saved main processor status and miscellaneous context registers. */ | 94 | /* Saved main processor status and miscellaneous context registers. */ |
106 | #if defined(CONFIG_ISA_M32R2) && defined(CONFIG_ISA_DSP_LEVEL2) | ||
107 | unsigned long acc0h; | 95 | unsigned long acc0h; |
108 | unsigned long acc0l; | 96 | unsigned long acc0l; |
109 | unsigned long acc1h; | 97 | unsigned long acc1h; /* ISA_DSP_LEVEL2 only */ |
110 | unsigned long acc1l; | 98 | unsigned long acc1l; /* ISA_DSP_LEVEL2 only */ |
111 | #elif defined(CONFIG_ISA_M32R2) || defined(CONFIG_ISA_M32R) | ||
112 | unsigned long acch; | ||
113 | unsigned long accl; | ||
114 | unsigned long dummy_acc1h; | ||
115 | unsigned long dummy_acc1l; | ||
116 | #else | ||
117 | #error unknown isa configuration | ||
118 | #endif | ||
119 | unsigned long psw; | 99 | unsigned long psw; |
120 | unsigned long bpc; /* saved PC for TRAP syscalls */ | 100 | unsigned long bpc; /* saved PC for TRAP syscalls */ |
121 | unsigned long bbpsw; | 101 | unsigned long bbpsw; |
diff --git a/include/asm-m32r/sigcontext.h b/include/asm-m32r/sigcontext.h index 73025c0c41a1..62537dc4dec9 100644 --- a/include/asm-m32r/sigcontext.h +++ b/include/asm-m32r/sigcontext.h | |||
@@ -23,19 +23,10 @@ struct sigcontext { | |||
23 | unsigned long sc_r12; | 23 | unsigned long sc_r12; |
24 | 24 | ||
25 | /* Saved main processor status and miscellaneous context registers. */ | 25 | /* Saved main processor status and miscellaneous context registers. */ |
26 | #if defined(CONFIG_ISA_M32R2) && defined(CONFIG_ISA_DSP_LEVEL2) | ||
27 | unsigned long sc_acc0h; | 26 | unsigned long sc_acc0h; |
28 | unsigned long sc_acc0l; | 27 | unsigned long sc_acc0l; |
29 | unsigned long sc_acc1h; | 28 | unsigned long sc_acc1h; /* ISA_DSP_LEVEL2 only */ |
30 | unsigned long sc_acc1l; | 29 | unsigned long sc_acc1l; /* ISA_DSP_LEVEL2 only */ |
31 | #elif defined(CONFIG_ISA_M32R2) || defined(CONFIG_ISA_M32R) | ||
32 | unsigned long sc_acch; | ||
33 | unsigned long sc_accl; | ||
34 | unsigned long sc_dummy_acc1h; | ||
35 | unsigned long sc_dummy_acc1l; | ||
36 | #else | ||
37 | #error unknown isa configuration | ||
38 | #endif | ||
39 | unsigned long sc_psw; | 30 | unsigned long sc_psw; |
40 | unsigned long sc_bpc; /* saved PC for TRAP syscalls */ | 31 | unsigned long sc_bpc; /* saved PC for TRAP syscalls */ |
41 | unsigned long sc_bbpsw; | 32 | unsigned long sc_bbpsw; |
diff --git a/include/asm-m32r/termbits.h b/include/asm-m32r/termbits.h index 5ace3702df75..faf2bd0504c1 100644 --- a/include/asm-m32r/termbits.h +++ b/include/asm-m32r/termbits.h | |||
@@ -19,6 +19,17 @@ struct termios { | |||
19 | cc_t c_cc[NCCS]; /* control characters */ | 19 | cc_t c_cc[NCCS]; /* control characters */ |
20 | }; | 20 | }; |
21 | 21 | ||
22 | struct ktermios { | ||
23 | tcflag_t c_iflag; /* input mode flags */ | ||
24 | tcflag_t c_oflag; /* output mode flags */ | ||
25 | tcflag_t c_cflag; /* control mode flags */ | ||
26 | tcflag_t c_lflag; /* local mode flags */ | ||
27 | cc_t c_line; /* line discipline */ | ||
28 | cc_t c_cc[NCCS]; /* control characters */ | ||
29 | speed_t c_ispeed; /* input speed */ | ||
30 | speed_t c_ospeed; /* output speed */ | ||
31 | }; | ||
32 | |||
22 | /* c_cc characters */ | 33 | /* c_cc characters */ |
23 | #define VINTR 0 | 34 | #define VINTR 0 |
24 | #define VQUIT 1 | 35 | #define VQUIT 1 |
diff --git a/include/asm-m68k/sun3-head.h b/include/asm-m68k/sun3-head.h index f799d95bad53..e74f384e269f 100644 --- a/include/asm-m68k/sun3-head.h +++ b/include/asm-m68k/sun3-head.h | |||
@@ -4,7 +4,6 @@ | |||
4 | 4 | ||
5 | #define KERNBASE 0xE000000 /* First address the kernel will eventually be */ | 5 | #define KERNBASE 0xE000000 /* First address the kernel will eventually be */ |
6 | #define LOAD_ADDR 0x4000 /* prom jumps to us here unless this is elf /boot */ | 6 | #define LOAD_ADDR 0x4000 /* prom jumps to us here unless this is elf /boot */ |
7 | #define BI_START (KERNBASE + 0x3000) /* beginning of the bootinfo records */ | ||
8 | #define FC_CONTROL 3 | 7 | #define FC_CONTROL 3 |
9 | #define FC_SUPERD 5 | 8 | #define FC_SUPERD 5 |
10 | #define FC_CPU 7 | 9 | #define FC_CPU 7 |
diff --git a/include/asm-m68k/sun3ints.h b/include/asm-m68k/sun3ints.h index de91fa071b99..309d6e6a1374 100644 --- a/include/asm-m68k/sun3ints.h +++ b/include/asm-m68k/sun3ints.h | |||
@@ -16,6 +16,7 @@ | |||
16 | #include <asm/intersil.h> | 16 | #include <asm/intersil.h> |
17 | #include <asm/oplib.h> | 17 | #include <asm/oplib.h> |
18 | #include <asm/traps.h> | 18 | #include <asm/traps.h> |
19 | #include <asm/irq.h> | ||
19 | 20 | ||
20 | #define SUN3_INT_VECS 192 | 21 | #define SUN3_INT_VECS 192 |
21 | 22 | ||
diff --git a/include/asm-m68k/termbits.h b/include/asm-m68k/termbits.h index e9eec3eb0718..a194092240fb 100644 --- a/include/asm-m68k/termbits.h +++ b/include/asm-m68k/termbits.h | |||
@@ -17,6 +17,17 @@ struct termios { | |||
17 | cc_t c_cc[NCCS]; /* control characters */ | 17 | cc_t c_cc[NCCS]; /* control characters */ |
18 | }; | 18 | }; |
19 | 19 | ||
20 | struct ktermios { | ||
21 | tcflag_t c_iflag; /* input mode flags */ | ||
22 | tcflag_t c_oflag; /* output mode flags */ | ||
23 | tcflag_t c_cflag; /* control mode flags */ | ||
24 | tcflag_t c_lflag; /* local mode flags */ | ||
25 | cc_t c_line; /* line discipline */ | ||
26 | cc_t c_cc[NCCS]; /* control characters */ | ||
27 | speed_t c_ispeed; /* input speed */ | ||
28 | speed_t c_ospeed; /* output speed */ | ||
29 | }; | ||
30 | |||
20 | /* c_cc characters */ | 31 | /* c_cc characters */ |
21 | #define VINTR 0 | 32 | #define VINTR 0 |
22 | #define VQUIT 1 | 33 | #define VQUIT 1 |
diff --git a/include/asm-mips/bootinfo.h b/include/asm-mips/bootinfo.h index 1e5ccdad3b02..8e321f53a382 100644 --- a/include/asm-mips/bootinfo.h +++ b/include/asm-mips/bootinfo.h | |||
@@ -131,6 +131,7 @@ | |||
131 | #define MACH_PHILIPS_NINO 0 /* Nino */ | 131 | #define MACH_PHILIPS_NINO 0 /* Nino */ |
132 | #define MACH_PHILIPS_VELO 1 /* Velo */ | 132 | #define MACH_PHILIPS_VELO 1 /* Velo */ |
133 | #define MACH_PHILIPS_JBS 2 /* JBS */ | 133 | #define MACH_PHILIPS_JBS 2 /* JBS */ |
134 | #define MACH_PHILIPS_STB810 3 /* STB810 */ | ||
134 | 135 | ||
135 | /* | 136 | /* |
136 | * Valid machtype for group SIBYTE | 137 | * Valid machtype for group SIBYTE |
diff --git a/include/asm-mips/compat.h b/include/asm-mips/compat.h index 55a0152feb08..432653d7ae09 100644 --- a/include/asm-mips/compat.h +++ b/include/asm-mips/compat.h | |||
@@ -5,6 +5,7 @@ | |||
5 | */ | 5 | */ |
6 | #include <linux/types.h> | 6 | #include <linux/types.h> |
7 | #include <asm/page.h> | 7 | #include <asm/page.h> |
8 | #include <asm/ptrace.h> | ||
8 | 9 | ||
9 | #define COMPAT_USER_HZ 100 | 10 | #define COMPAT_USER_HZ 100 |
10 | 11 | ||
diff --git a/include/asm-mips/mach-ip27/irq.h b/include/asm-mips/mach-ip27/irq.h index 806213ce31b6..25f0c3f39adf 100644 --- a/include/asm-mips/mach-ip27/irq.h +++ b/include/asm-mips/mach-ip27/irq.h | |||
@@ -10,8 +10,6 @@ | |||
10 | #ifndef __ASM_MACH_IP27_IRQ_H | 10 | #ifndef __ASM_MACH_IP27_IRQ_H |
11 | #define __ASM_MACH_IP27_IRQ_H | 11 | #define __ASM_MACH_IP27_IRQ_H |
12 | 12 | ||
13 | #include <asm/sn/arch.h> | ||
14 | |||
15 | /* | 13 | /* |
16 | * A hardwired interrupt number is completly stupid for this system - a | 14 | * A hardwired interrupt number is completly stupid for this system - a |
17 | * large configuration might have thousands if not tenthousands of | 15 | * large configuration might have thousands if not tenthousands of |
diff --git a/include/asm-mips/mach-ip27/topology.h b/include/asm-mips/mach-ip27/topology.h index a13b715fd9ca..44790fdc5d00 100644 --- a/include/asm-mips/mach-ip27/topology.h +++ b/include/asm-mips/mach-ip27/topology.h | |||
@@ -1,7 +1,6 @@ | |||
1 | #ifndef _ASM_MACH_TOPOLOGY_H | 1 | #ifndef _ASM_MACH_TOPOLOGY_H |
2 | #define _ASM_MACH_TOPOLOGY_H 1 | 2 | #define _ASM_MACH_TOPOLOGY_H 1 |
3 | 3 | ||
4 | #include <asm/sn/arch.h> | ||
5 | #include <asm/sn/hub.h> | 4 | #include <asm/sn/hub.h> |
6 | #include <asm/mmzone.h> | 5 | #include <asm/mmzone.h> |
7 | 6 | ||
diff --git a/include/asm-mips/mach-rm200/cpu-feature-overrides.h b/include/asm-mips/mach-rm/cpu-feature-overrides.h index 11410ae10d36..11410ae10d36 100644 --- a/include/asm-mips/mach-rm200/cpu-feature-overrides.h +++ b/include/asm-mips/mach-rm/cpu-feature-overrides.h | |||
diff --git a/include/asm-mips/mach-rm200/mc146818rtc.h b/include/asm-mips/mach-rm/mc146818rtc.h index d37ae68dc6a3..d37ae68dc6a3 100644 --- a/include/asm-mips/mach-rm200/mc146818rtc.h +++ b/include/asm-mips/mach-rm/mc146818rtc.h | |||
diff --git a/include/asm-mips/mach-rm200/timex.h b/include/asm-mips/mach-rm/timex.h index 11ff6cb0f214..11ff6cb0f214 100644 --- a/include/asm-mips/mach-rm200/timex.h +++ b/include/asm-mips/mach-rm/timex.h | |||
diff --git a/include/asm-mips/pci.h b/include/asm-mips/pci.h index c4d68bebdca6..7f0f120ca07c 100644 --- a/include/asm-mips/pci.h +++ b/include/asm-mips/pci.h | |||
@@ -187,4 +187,10 @@ static inline void pcibios_add_platform_entries(struct pci_dev *dev) | |||
187 | /* Do platform specific device initialization at pci_enable_device() time */ | 187 | /* Do platform specific device initialization at pci_enable_device() time */ |
188 | extern int pcibios_plat_dev_init(struct pci_dev *dev); | 188 | extern int pcibios_plat_dev_init(struct pci_dev *dev); |
189 | 189 | ||
190 | /* Chances are this interrupt is wired PC-style ... */ | ||
191 | static inline int pci_get_legacy_ide_irq(struct pci_dev *dev, int channel) | ||
192 | { | ||
193 | return channel ? 15 : 14; | ||
194 | } | ||
195 | |||
190 | #endif /* _ASM_PCI_H */ | 196 | #endif /* _ASM_PCI_H */ |
diff --git a/include/asm-mips/ptrace.h b/include/asm-mips/ptrace.h index 30bf555faeaa..8a1f2b6f04ac 100644 --- a/include/asm-mips/ptrace.h +++ b/include/asm-mips/ptrace.h | |||
@@ -82,6 +82,14 @@ struct pt_regs { | |||
82 | 82 | ||
83 | extern asmlinkage void do_syscall_trace(struct pt_regs *regs, int entryexit); | 83 | extern asmlinkage void do_syscall_trace(struct pt_regs *regs, int entryexit); |
84 | 84 | ||
85 | extern NORET_TYPE void die(const char *, struct pt_regs *); | ||
86 | |||
87 | static inline void die_if_kernel(const char *str, struct pt_regs *regs) | ||
88 | { | ||
89 | if (unlikely(!user_mode(regs))) | ||
90 | die(str, regs); | ||
91 | } | ||
92 | |||
85 | #endif | 93 | #endif |
86 | 94 | ||
87 | #endif /* _ASM_PTRACE_H */ | 95 | #endif /* _ASM_PTRACE_H */ |
diff --git a/include/asm-mips/sn/arch.h b/include/asm-mips/sn/arch.h index 51174af6ac52..da523de628be 100644 --- a/include/asm-mips/sn/arch.h +++ b/include/asm-mips/sn/arch.h | |||
@@ -18,7 +18,6 @@ | |||
18 | #endif | 18 | #endif |
19 | 19 | ||
20 | typedef u64 hubreg_t; | 20 | typedef u64 hubreg_t; |
21 | typedef u64 nic_t; | ||
22 | 21 | ||
23 | #define cputonasid(cpu) (cpu_data[(cpu)].p_nasid) | 22 | #define cputonasid(cpu) (cpu_data[(cpu)].p_nasid) |
24 | #define cputoslice(cpu) (cpu_data[(cpu)].p_slice) | 23 | #define cputoslice(cpu) (cpu_data[(cpu)].p_slice) |
diff --git a/include/asm-mips/sn/klconfig.h b/include/asm-mips/sn/klconfig.h index 15d70ca56187..82aeb9e322db 100644 --- a/include/asm-mips/sn/klconfig.h +++ b/include/asm-mips/sn/klconfig.h | |||
@@ -61,6 +61,8 @@ | |||
61 | #endif /* CONFIG_SGI_IP35 */ | 61 | #endif /* CONFIG_SGI_IP35 */ |
62 | #endif /* CONFIG_SGI_IP27 || CONFIG_SGI_IP35 */ | 62 | #endif /* CONFIG_SGI_IP27 || CONFIG_SGI_IP35 */ |
63 | 63 | ||
64 | typedef u64 nic_t; | ||
65 | |||
64 | #define KLCFGINFO_MAGIC 0xbeedbabe | 66 | #define KLCFGINFO_MAGIC 0xbeedbabe |
65 | 67 | ||
66 | typedef s32 klconf_off_t; | 68 | typedef s32 klconf_off_t; |
diff --git a/include/asm-mips/system.h b/include/asm-mips/system.h index 9428057a50cf..5e1289c85ed9 100644 --- a/include/asm-mips/system.h +++ b/include/asm-mips/system.h | |||
@@ -19,7 +19,6 @@ | |||
19 | #include <asm/barrier.h> | 19 | #include <asm/barrier.h> |
20 | #include <asm/cpu-features.h> | 20 | #include <asm/cpu-features.h> |
21 | #include <asm/dsp.h> | 21 | #include <asm/dsp.h> |
22 | #include <asm/ptrace.h> | ||
23 | #include <asm/war.h> | 22 | #include <asm/war.h> |
24 | 23 | ||
25 | 24 | ||
@@ -336,14 +335,6 @@ extern void *set_except_vector(int n, void *addr); | |||
336 | extern unsigned long ebase; | 335 | extern unsigned long ebase; |
337 | extern void per_cpu_trap_init(void); | 336 | extern void per_cpu_trap_init(void); |
338 | 337 | ||
339 | extern NORET_TYPE void die(const char *, struct pt_regs *); | ||
340 | |||
341 | static inline void die_if_kernel(const char *str, struct pt_regs *regs) | ||
342 | { | ||
343 | if (unlikely(!user_mode(regs))) | ||
344 | die(str, regs); | ||
345 | } | ||
346 | |||
347 | extern int stop_a_enabled; | 338 | extern int stop_a_enabled; |
348 | 339 | ||
349 | /* | 340 | /* |
diff --git a/include/asm-mips/termbits.h b/include/asm-mips/termbits.h index b62ec7c521cc..0bbe07b42a07 100644 --- a/include/asm-mips/termbits.h +++ b/include/asm-mips/termbits.h | |||
@@ -30,6 +30,17 @@ struct termios { | |||
30 | cc_t c_cc[NCCS]; /* control characters */ | 30 | cc_t c_cc[NCCS]; /* control characters */ |
31 | }; | 31 | }; |
32 | 32 | ||
33 | struct ktermios { | ||
34 | tcflag_t c_iflag; /* input mode flags */ | ||
35 | tcflag_t c_oflag; /* output mode flags */ | ||
36 | tcflag_t c_cflag; /* control mode flags */ | ||
37 | tcflag_t c_lflag; /* local mode flags */ | ||
38 | cc_t c_line; /* line discipline */ | ||
39 | cc_t c_cc[NCCS]; /* control characters */ | ||
40 | speed_t c_ispeed; /* input speed */ | ||
41 | speed_t c_ospeed; /* output speed */ | ||
42 | }; | ||
43 | |||
33 | /* c_cc characters */ | 44 | /* c_cc characters */ |
34 | #define VINTR 0 /* Interrupt character [ISIG]. */ | 45 | #define VINTR 0 /* Interrupt character [ISIG]. */ |
35 | #define VQUIT 1 /* Quit character [ISIG]. */ | 46 | #define VQUIT 1 /* Quit character [ISIG]. */ |
diff --git a/include/asm-mips/war.h b/include/asm-mips/war.h index 3ac146c019c9..13a3502eef44 100644 --- a/include/asm-mips/war.h +++ b/include/asm-mips/war.h | |||
@@ -76,7 +76,7 @@ | |||
76 | /* | 76 | /* |
77 | * But the RM200C seems to have been shipped only with V2.0 R4600s | 77 | * But the RM200C seems to have been shipped only with V2.0 R4600s |
78 | */ | 78 | */ |
79 | #ifdef CONFIG_SNI_RM200_PCI | 79 | #ifdef CONFIG_SNI_RM |
80 | 80 | ||
81 | #define R4600_V2_HIT_CACHEOP_WAR 1 | 81 | #define R4600_V2_HIT_CACHEOP_WAR 1 |
82 | 82 | ||
diff --git a/include/asm-parisc/termbits.h b/include/asm-parisc/termbits.h index 372b634892c9..a46e299a9391 100644 --- a/include/asm-parisc/termbits.h +++ b/include/asm-parisc/termbits.h | |||
@@ -17,6 +17,17 @@ struct termios { | |||
17 | cc_t c_cc[NCCS]; /* control characters */ | 17 | cc_t c_cc[NCCS]; /* control characters */ |
18 | }; | 18 | }; |
19 | 19 | ||
20 | struct ktermios { | ||
21 | tcflag_t c_iflag; /* input mode flags */ | ||
22 | tcflag_t c_oflag; /* output mode flags */ | ||
23 | tcflag_t c_cflag; /* control mode flags */ | ||
24 | tcflag_t c_lflag; /* local mode flags */ | ||
25 | cc_t c_line; /* line discipline */ | ||
26 | cc_t c_cc[NCCS]; /* control characters */ | ||
27 | speed_t c_ispeed; /* input speed */ | ||
28 | speed_t c_ospeed; /* output speed */ | ||
29 | }; | ||
30 | |||
20 | /* c_cc characters */ | 31 | /* c_cc characters */ |
21 | #define VINTR 0 | 32 | #define VINTR 0 |
22 | #define VQUIT 1 | 33 | #define VQUIT 1 |
diff --git a/include/asm-powerpc/Kbuild b/include/asm-powerpc/Kbuild index 1e637381c118..703970fb0ec0 100644 --- a/include/asm-powerpc/Kbuild +++ b/include/asm-powerpc/Kbuild | |||
@@ -17,7 +17,6 @@ header-y += ipc.h | |||
17 | header-y += poll.h | 17 | header-y += poll.h |
18 | header-y += shmparam.h | 18 | header-y += shmparam.h |
19 | header-y += sockios.h | 19 | header-y += sockios.h |
20 | header-y += spu_info.h | ||
21 | header-y += ucontext.h | 20 | header-y += ucontext.h |
22 | header-y += ioctl.h | 21 | header-y += ioctl.h |
23 | header-y += linkage.h | 22 | header-y += linkage.h |
@@ -37,6 +36,7 @@ unifdef-y += posix_types.h | |||
37 | unifdef-y += ptrace.h | 36 | unifdef-y += ptrace.h |
38 | unifdef-y += seccomp.h | 37 | unifdef-y += seccomp.h |
39 | unifdef-y += signal.h | 38 | unifdef-y += signal.h |
39 | unifdef-y += spu_info.h | ||
40 | unifdef-y += termios.h | 40 | unifdef-y += termios.h |
41 | unifdef-y += types.h | 41 | unifdef-y += types.h |
42 | unifdef-y += unistd.h | 42 | unifdef-y += unistd.h |
diff --git a/include/asm-powerpc/bitops.h b/include/asm-powerpc/bitops.h index c341063d0804..8f757f6246e4 100644 --- a/include/asm-powerpc/bitops.h +++ b/include/asm-powerpc/bitops.h | |||
@@ -190,7 +190,8 @@ static __inline__ void set_bits(unsigned long mask, unsigned long *addr) | |||
190 | * Return the zero-based bit position (LE, not IBM bit numbering) of | 190 | * Return the zero-based bit position (LE, not IBM bit numbering) of |
191 | * the most significant 1-bit in a double word. | 191 | * the most significant 1-bit in a double word. |
192 | */ | 192 | */ |
193 | static __inline__ int __ilog2(unsigned long x) | 193 | static __inline__ __attribute__((const)) |
194 | int __ilog2(unsigned long x) | ||
194 | { | 195 | { |
195 | int lz; | 196 | int lz; |
196 | 197 | ||
@@ -198,6 +199,24 @@ static __inline__ int __ilog2(unsigned long x) | |||
198 | return BITS_PER_LONG - 1 - lz; | 199 | return BITS_PER_LONG - 1 - lz; |
199 | } | 200 | } |
200 | 201 | ||
202 | static inline __attribute__((const)) | ||
203 | int __ilog2_u32(u32 n) | ||
204 | { | ||
205 | int bit; | ||
206 | asm ("cntlzw %0,%1" : "=r" (bit) : "r" (n)); | ||
207 | return 31 - bit; | ||
208 | } | ||
209 | |||
210 | #ifdef __powerpc64__ | ||
211 | static inline __attribute__((const)) | ||
212 | int __ilog2_u64(u64 n) | ||
213 | { | ||
214 | int bit; | ||
215 | asm ("cntlzd %0,%1" : "=r" (bit) : "r" (n)); | ||
216 | return 63 - bit; | ||
217 | } | ||
218 | #endif | ||
219 | |||
201 | /* | 220 | /* |
202 | * Determines the bit position of the least significant 0 bit in the | 221 | * Determines the bit position of the least significant 0 bit in the |
203 | * specified double word. The returned bit position will be | 222 | * specified double word. The returned bit position will be |
diff --git a/include/asm-powerpc/bug.h b/include/asm-powerpc/bug.h index 978b2c7e84ea..709568879f73 100644 --- a/include/asm-powerpc/bug.h +++ b/include/asm-powerpc/bug.h | |||
@@ -13,36 +13,39 @@ | |||
13 | 13 | ||
14 | #ifndef __ASSEMBLY__ | 14 | #ifndef __ASSEMBLY__ |
15 | 15 | ||
16 | struct bug_entry { | ||
17 | unsigned long bug_addr; | ||
18 | long line; | ||
19 | const char *file; | ||
20 | const char *function; | ||
21 | }; | ||
22 | |||
23 | struct bug_entry *find_bug(unsigned long bugaddr); | ||
24 | |||
25 | /* | ||
26 | * If this bit is set in the line number it means that the trap | ||
27 | * is for WARN_ON rather than BUG or BUG_ON. | ||
28 | */ | ||
29 | #define BUG_WARNING_TRAP 0x1000000 | ||
30 | |||
31 | #ifdef CONFIG_BUG | 16 | #ifdef CONFIG_BUG |
32 | 17 | ||
18 | /* _EMIT_BUG_ENTRY expects args %0,%1,%2,%3 to be FILE, LINE, flags and | ||
19 | sizeof(struct bug_entry), respectively */ | ||
20 | #ifdef CONFIG_DEBUG_BUGVERBOSE | ||
21 | #define _EMIT_BUG_ENTRY \ | ||
22 | ".section __bug_table,\"a\"\n" \ | ||
23 | "2:\t" PPC_LONG "1b, %0\n" \ | ||
24 | "\t.short %1, %2\n" \ | ||
25 | ".org 2b+%3\n" \ | ||
26 | ".previous\n" | ||
27 | #else | ||
28 | #define _EMIT_BUG_ENTRY \ | ||
29 | ".section __bug_table,\"a\"\n" \ | ||
30 | "2:\t" PPC_LONG "1b\n" \ | ||
31 | "\t.short %2\n" \ | ||
32 | ".org 2b+%3\n" \ | ||
33 | ".previous\n" | ||
34 | #endif | ||
35 | |||
33 | /* | 36 | /* |
34 | * BUG_ON() and WARN_ON() do their best to cooperate with compile-time | 37 | * BUG_ON() and WARN_ON() do their best to cooperate with compile-time |
35 | * optimisations. However depending on the complexity of the condition | 38 | * optimisations. However depending on the complexity of the condition |
36 | * some compiler versions may not produce optimal results. | 39 | * some compiler versions may not produce optimal results. |
37 | */ | 40 | */ |
38 | 41 | ||
39 | #define BUG() do { \ | 42 | #define BUG() do { \ |
40 | __asm__ __volatile__( \ | 43 | __asm__ __volatile__( \ |
41 | "1: twi 31,0,0\n" \ | 44 | "1: twi 31,0,0\n" \ |
42 | ".section __bug_table,\"a\"\n" \ | 45 | _EMIT_BUG_ENTRY \ |
43 | "\t"PPC_LONG" 1b,%0,%1,%2\n" \ | 46 | : : "i" (__FILE__), "i" (__LINE__), \ |
44 | ".previous" \ | 47 | "i" (0), "i" (sizeof(struct bug_entry))); \ |
45 | : : "i" (__LINE__), "i" (__FILE__), "i" (__FUNCTION__)); \ | 48 | for(;;) ; \ |
46 | } while (0) | 49 | } while (0) |
47 | 50 | ||
48 | #define BUG_ON(x) do { \ | 51 | #define BUG_ON(x) do { \ |
@@ -51,23 +54,21 @@ struct bug_entry *find_bug(unsigned long bugaddr); | |||
51 | BUG(); \ | 54 | BUG(); \ |
52 | } else { \ | 55 | } else { \ |
53 | __asm__ __volatile__( \ | 56 | __asm__ __volatile__( \ |
54 | "1: "PPC_TLNEI" %0,0\n" \ | 57 | "1: "PPC_TLNEI" %4,0\n" \ |
55 | ".section __bug_table,\"a\"\n" \ | 58 | _EMIT_BUG_ENTRY \ |
56 | "\t"PPC_LONG" 1b,%1,%2,%3\n" \ | 59 | : : "i" (__FILE__), "i" (__LINE__), "i" (0), \ |
57 | ".previous" \ | 60 | "i" (sizeof(struct bug_entry)), \ |
58 | : : "r" ((long)(x)), "i" (__LINE__), \ | 61 | "r" ((long)(x))); \ |
59 | "i" (__FILE__), "i" (__FUNCTION__)); \ | ||
60 | } \ | 62 | } \ |
61 | } while (0) | 63 | } while (0) |
62 | 64 | ||
63 | #define __WARN() do { \ | 65 | #define __WARN() do { \ |
64 | __asm__ __volatile__( \ | 66 | __asm__ __volatile__( \ |
65 | "1: twi 31,0,0\n" \ | 67 | "1: twi 31,0,0\n" \ |
66 | ".section __bug_table,\"a\"\n" \ | 68 | _EMIT_BUG_ENTRY \ |
67 | "\t"PPC_LONG" 1b,%0,%1,%2\n" \ | 69 | : : "i" (__FILE__), "i" (__LINE__), \ |
68 | ".previous" \ | 70 | "i" (BUGFLAG_WARNING), \ |
69 | : : "i" (__LINE__ + BUG_WARNING_TRAP), \ | 71 | "i" (sizeof(struct bug_entry))); \ |
70 | "i" (__FILE__), "i" (__FUNCTION__)); \ | ||
71 | } while (0) | 72 | } while (0) |
72 | 73 | ||
73 | #define WARN_ON(x) ({ \ | 74 | #define WARN_ON(x) ({ \ |
@@ -77,13 +78,12 @@ struct bug_entry *find_bug(unsigned long bugaddr); | |||
77 | __WARN(); \ | 78 | __WARN(); \ |
78 | } else { \ | 79 | } else { \ |
79 | __asm__ __volatile__( \ | 80 | __asm__ __volatile__( \ |
80 | "1: "PPC_TLNEI" %0,0\n" \ | 81 | "1: "PPC_TLNEI" %4,0\n" \ |
81 | ".section __bug_table,\"a\"\n" \ | 82 | _EMIT_BUG_ENTRY \ |
82 | "\t"PPC_LONG" 1b,%1,%2,%3\n" \ | 83 | : : "i" (__FILE__), "i" (__LINE__), \ |
83 | ".previous" \ | 84 | "i" (BUGFLAG_WARNING), \ |
84 | : : "r" (__ret_warn_on), \ | 85 | "i" (sizeof(struct bug_entry)), \ |
85 | "i" (__LINE__ + BUG_WARNING_TRAP), \ | 86 | "r" (__ret_warn_on)); \ |
86 | "i" (__FILE__), "i" (__FUNCTION__)); \ | ||
87 | } \ | 87 | } \ |
88 | unlikely(__ret_warn_on); \ | 88 | unlikely(__ret_warn_on); \ |
89 | }) | 89 | }) |
diff --git a/include/asm-powerpc/cputable.h b/include/asm-powerpc/cputable.h index 6fe5c9d4ca3b..7384b8086b75 100644 --- a/include/asm-powerpc/cputable.h +++ b/include/asm-powerpc/cputable.h | |||
@@ -126,6 +126,7 @@ extern void do_feature_fixups(unsigned long value, void *fixup_start, | |||
126 | #define CPU_FTR_NODSISRALIGN ASM_CONST(0x0000000000100000) | 126 | #define CPU_FTR_NODSISRALIGN ASM_CONST(0x0000000000100000) |
127 | #define CPU_FTR_PPC_LE ASM_CONST(0x0000000000200000) | 127 | #define CPU_FTR_PPC_LE ASM_CONST(0x0000000000200000) |
128 | #define CPU_FTR_REAL_LE ASM_CONST(0x0000000000400000) | 128 | #define CPU_FTR_REAL_LE ASM_CONST(0x0000000000400000) |
129 | #define CPU_FTR_FPU_UNAVAILABLE ASM_CONST(0x0000000000800000) | ||
129 | 130 | ||
130 | /* | 131 | /* |
131 | * Add the 64-bit processor unique features in the top half of the word; | 132 | * Add the 64-bit processor unique features in the top half of the word; |
@@ -152,6 +153,7 @@ extern void do_feature_fixups(unsigned long value, void *fixup_start, | |||
152 | #define CPU_FTR_PURR LONG_ASM_CONST(0x0000400000000000) | 153 | #define CPU_FTR_PURR LONG_ASM_CONST(0x0000400000000000) |
153 | #define CPU_FTR_CELL_TB_BUG LONG_ASM_CONST(0x0000800000000000) | 154 | #define CPU_FTR_CELL_TB_BUG LONG_ASM_CONST(0x0000800000000000) |
154 | #define CPU_FTR_SPURR LONG_ASM_CONST(0x0001000000000000) | 155 | #define CPU_FTR_SPURR LONG_ASM_CONST(0x0001000000000000) |
156 | #define CPU_FTR_DSCR LONG_ASM_CONST(0x0002000000000000) | ||
155 | 157 | ||
156 | #ifndef __ASSEMBLY__ | 158 | #ifndef __ASSEMBLY__ |
157 | 159 | ||
@@ -295,6 +297,9 @@ extern void do_feature_fixups(unsigned long value, void *fixup_start, | |||
295 | #define CPU_FTRS_E300 (CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_MAYBE_CAN_DOZE | \ | 297 | #define CPU_FTRS_E300 (CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_MAYBE_CAN_DOZE | \ |
296 | CPU_FTR_USE_TB | CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_HAS_HIGH_BATS | \ | 298 | CPU_FTR_USE_TB | CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_HAS_HIGH_BATS | \ |
297 | CPU_FTR_COMMON) | 299 | CPU_FTR_COMMON) |
300 | #define CPU_FTRS_E300C2 (CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_MAYBE_CAN_DOZE | \ | ||
301 | CPU_FTR_USE_TB | CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_HAS_HIGH_BATS | \ | ||
302 | CPU_FTR_COMMON | CPU_FTR_FPU_UNAVAILABLE) | ||
298 | #define CPU_FTRS_CLASSIC32 (CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | \ | 303 | #define CPU_FTRS_CLASSIC32 (CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | \ |
299 | CPU_FTR_USE_TB | CPU_FTR_HPTE_TABLE) | 304 | CPU_FTR_USE_TB | CPU_FTR_HPTE_TABLE) |
300 | #define CPU_FTRS_8XX (CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB) | 305 | #define CPU_FTRS_8XX (CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB) |
@@ -330,13 +335,14 @@ extern void do_feature_fixups(unsigned long value, void *fixup_start, | |||
330 | CPU_FTR_HPTE_TABLE | CPU_FTR_PPCAS_ARCH_V2 | CPU_FTR_CTRL | \ | 335 | CPU_FTR_HPTE_TABLE | CPU_FTR_PPCAS_ARCH_V2 | CPU_FTR_CTRL | \ |
331 | CPU_FTR_MMCRA | CPU_FTR_SMT | \ | 336 | CPU_FTR_MMCRA | CPU_FTR_SMT | \ |
332 | CPU_FTR_COHERENT_ICACHE | CPU_FTR_LOCKLESS_TLBIE | \ | 337 | CPU_FTR_COHERENT_ICACHE | CPU_FTR_LOCKLESS_TLBIE | \ |
333 | CPU_FTR_PURR | CPU_FTR_SPURR | CPU_FTR_REAL_LE) | 338 | CPU_FTR_PURR | CPU_FTR_SPURR | CPU_FTR_REAL_LE | \ |
339 | CPU_FTR_DSCR) | ||
334 | #define CPU_FTRS_POWER6X (CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | \ | 340 | #define CPU_FTRS_POWER6X (CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | \ |
335 | CPU_FTR_HPTE_TABLE | CPU_FTR_PPCAS_ARCH_V2 | CPU_FTR_CTRL | \ | 341 | CPU_FTR_HPTE_TABLE | CPU_FTR_PPCAS_ARCH_V2 | CPU_FTR_CTRL | \ |
336 | CPU_FTR_MMCRA | CPU_FTR_SMT | \ | 342 | CPU_FTR_MMCRA | CPU_FTR_SMT | \ |
337 | CPU_FTR_COHERENT_ICACHE | CPU_FTR_LOCKLESS_TLBIE | \ | 343 | CPU_FTR_COHERENT_ICACHE | CPU_FTR_LOCKLESS_TLBIE | \ |
338 | CPU_FTR_PURR | CPU_FTR_CI_LARGE_PAGE | \ | 344 | CPU_FTR_PURR | CPU_FTR_CI_LARGE_PAGE | \ |
339 | CPU_FTR_SPURR | CPU_FTR_REAL_LE) | 345 | CPU_FTR_SPURR | CPU_FTR_REAL_LE | CPU_FTR_DSCR) |
340 | #define CPU_FTRS_CELL (CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | \ | 346 | #define CPU_FTRS_CELL (CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | \ |
341 | CPU_FTR_HPTE_TABLE | CPU_FTR_PPCAS_ARCH_V2 | CPU_FTR_CTRL | \ | 347 | CPU_FTR_HPTE_TABLE | CPU_FTR_PPCAS_ARCH_V2 | CPU_FTR_CTRL | \ |
342 | CPU_FTR_ALTIVEC_COMP | CPU_FTR_MMCRA | CPU_FTR_SMT | \ | 348 | CPU_FTR_ALTIVEC_COMP | CPU_FTR_MMCRA | CPU_FTR_SMT | \ |
@@ -364,7 +370,8 @@ enum { | |||
364 | CPU_FTRS_7450_21 | CPU_FTRS_7450_23 | CPU_FTRS_7455_1 | | 370 | CPU_FTRS_7450_21 | CPU_FTRS_7450_23 | CPU_FTRS_7455_1 | |
365 | CPU_FTRS_7455_20 | CPU_FTRS_7455 | CPU_FTRS_7447_10 | | 371 | CPU_FTRS_7455_20 | CPU_FTRS_7455 | CPU_FTRS_7447_10 | |
366 | CPU_FTRS_7447 | CPU_FTRS_7447A | CPU_FTRS_82XX | | 372 | CPU_FTRS_7447 | CPU_FTRS_7447A | CPU_FTRS_82XX | |
367 | CPU_FTRS_G2_LE | CPU_FTRS_E300 | CPU_FTRS_CLASSIC32 | | 373 | CPU_FTRS_G2_LE | CPU_FTRS_E300 | CPU_FTRS_E300C2 | |
374 | CPU_FTRS_CLASSIC32 | | ||
368 | #else | 375 | #else |
369 | CPU_FTRS_GENERIC_32 | | 376 | CPU_FTRS_GENERIC_32 | |
370 | #endif | 377 | #endif |
@@ -403,7 +410,8 @@ enum { | |||
403 | CPU_FTRS_7450_21 & CPU_FTRS_7450_23 & CPU_FTRS_7455_1 & | 410 | CPU_FTRS_7450_21 & CPU_FTRS_7450_23 & CPU_FTRS_7455_1 & |
404 | CPU_FTRS_7455_20 & CPU_FTRS_7455 & CPU_FTRS_7447_10 & | 411 | CPU_FTRS_7455_20 & CPU_FTRS_7455 & CPU_FTRS_7447_10 & |
405 | CPU_FTRS_7447 & CPU_FTRS_7447A & CPU_FTRS_82XX & | 412 | CPU_FTRS_7447 & CPU_FTRS_7447A & CPU_FTRS_82XX & |
406 | CPU_FTRS_G2_LE & CPU_FTRS_E300 & CPU_FTRS_CLASSIC32 & | 413 | CPU_FTRS_G2_LE & CPU_FTRS_E300 & CPU_FTRS_E300C2 & |
414 | CPU_FTRS_CLASSIC32 & | ||
407 | #else | 415 | #else |
408 | CPU_FTRS_GENERIC_32 & | 416 | CPU_FTRS_GENERIC_32 & |
409 | #endif | 417 | #endif |
diff --git a/include/asm-powerpc/dcr-native.h b/include/asm-powerpc/dcr-native.h index fd4a5f5e33d1..d7a1bc1551c6 100644 --- a/include/asm-powerpc/dcr-native.h +++ b/include/asm-powerpc/dcr-native.h | |||
@@ -20,8 +20,7 @@ | |||
20 | #ifndef _ASM_POWERPC_DCR_NATIVE_H | 20 | #ifndef _ASM_POWERPC_DCR_NATIVE_H |
21 | #define _ASM_POWERPC_DCR_NATIVE_H | 21 | #define _ASM_POWERPC_DCR_NATIVE_H |
22 | #ifdef __KERNEL__ | 22 | #ifdef __KERNEL__ |
23 | 23 | #ifndef __ASSEMBLY__ | |
24 | #include <asm/reg.h> | ||
25 | 24 | ||
26 | typedef struct {} dcr_host_t; | 25 | typedef struct {} dcr_host_t; |
27 | 26 | ||
@@ -32,7 +31,41 @@ typedef struct {} dcr_host_t; | |||
32 | #define dcr_read(host, dcr_n) mfdcr(dcr_n) | 31 | #define dcr_read(host, dcr_n) mfdcr(dcr_n) |
33 | #define dcr_write(host, dcr_n, value) mtdcr(dcr_n, value) | 32 | #define dcr_write(host, dcr_n, value) mtdcr(dcr_n, value) |
34 | 33 | ||
34 | /* Device Control Registers */ | ||
35 | void __mtdcr(int reg, unsigned int val); | ||
36 | unsigned int __mfdcr(int reg); | ||
37 | #define mfdcr(rn) \ | ||
38 | ({unsigned int rval; \ | ||
39 | if (__builtin_constant_p(rn)) \ | ||
40 | asm volatile("mfdcr %0," __stringify(rn) \ | ||
41 | : "=r" (rval)); \ | ||
42 | else \ | ||
43 | rval = __mfdcr(rn); \ | ||
44 | rval;}) | ||
45 | |||
46 | #define mtdcr(rn, v) \ | ||
47 | do { \ | ||
48 | if (__builtin_constant_p(rn)) \ | ||
49 | asm volatile("mtdcr " __stringify(rn) ",%0" \ | ||
50 | : : "r" (v)); \ | ||
51 | else \ | ||
52 | __mtdcr(rn, v); \ | ||
53 | } while (0) | ||
54 | |||
55 | /* R/W of indirect DCRs make use of standard naming conventions for DCRs */ | ||
56 | #define mfdcri(base, reg) \ | ||
57 | ({ \ | ||
58 | mtdcr(base ## _CFGADDR, base ## _ ## reg); \ | ||
59 | mfdcr(base ## _CFGDATA); \ | ||
60 | }) | ||
61 | |||
62 | #define mtdcri(base, reg, data) \ | ||
63 | do { \ | ||
64 | mtdcr(base ## _CFGADDR, base ## _ ## reg); \ | ||
65 | mtdcr(base ## _CFGDATA, data); \ | ||
66 | } while (0) | ||
35 | 67 | ||
68 | #endif /* __ASSEMBLY__ */ | ||
36 | #endif /* __KERNEL__ */ | 69 | #endif /* __KERNEL__ */ |
37 | #endif /* _ASM_POWERPC_DCR_NATIVE_H */ | 70 | #endif /* _ASM_POWERPC_DCR_NATIVE_H */ |
38 | 71 | ||
diff --git a/include/asm-powerpc/dcr.h b/include/asm-powerpc/dcr.h index 473f2c7fd892..b66c5e6941f0 100644 --- a/include/asm-powerpc/dcr.h +++ b/include/asm-powerpc/dcr.h | |||
@@ -20,6 +20,7 @@ | |||
20 | #ifndef _ASM_POWERPC_DCR_H | 20 | #ifndef _ASM_POWERPC_DCR_H |
21 | #define _ASM_POWERPC_DCR_H | 21 | #define _ASM_POWERPC_DCR_H |
22 | #ifdef __KERNEL__ | 22 | #ifdef __KERNEL__ |
23 | #ifdef CONFIG_PPC_DCR | ||
23 | 24 | ||
24 | #ifdef CONFIG_PPC_DCR_NATIVE | 25 | #ifdef CONFIG_PPC_DCR_NATIVE |
25 | #include <asm/dcr-native.h> | 26 | #include <asm/dcr-native.h> |
@@ -38,5 +39,6 @@ extern unsigned int dcr_resource_len(struct device_node *np, | |||
38 | unsigned int index); | 39 | unsigned int index); |
39 | #endif /* CONFIG_PPC_MERGE */ | 40 | #endif /* CONFIG_PPC_MERGE */ |
40 | 41 | ||
42 | #endif /* CONFIG_PPC_DCR */ | ||
41 | #endif /* __KERNEL__ */ | 43 | #endif /* __KERNEL__ */ |
42 | #endif /* _ASM_POWERPC_DCR_H */ | 44 | #endif /* _ASM_POWERPC_DCR_H */ |
diff --git a/include/asm-powerpc/hw_irq.h b/include/asm-powerpc/hw_irq.h index d604863d72fb..9e4dd98eb220 100644 --- a/include/asm-powerpc/hw_irq.h +++ b/include/asm-powerpc/hw_irq.h | |||
@@ -107,25 +107,6 @@ static inline void local_irq_save_ptr(unsigned long *flags) | |||
107 | 107 | ||
108 | #endif /* CONFIG_PPC64 */ | 108 | #endif /* CONFIG_PPC64 */ |
109 | 109 | ||
110 | #define mask_irq(irq) \ | ||
111 | ({ \ | ||
112 | irq_desc_t *desc = get_irq_desc(irq); \ | ||
113 | if (desc->chip && desc->chip->disable) \ | ||
114 | desc->chip->disable(irq); \ | ||
115 | }) | ||
116 | #define unmask_irq(irq) \ | ||
117 | ({ \ | ||
118 | irq_desc_t *desc = get_irq_desc(irq); \ | ||
119 | if (desc->chip && desc->chip->enable) \ | ||
120 | desc->chip->enable(irq); \ | ||
121 | }) | ||
122 | #define ack_irq(irq) \ | ||
123 | ({ \ | ||
124 | irq_desc_t *desc = get_irq_desc(irq); \ | ||
125 | if (desc->chip && desc->chip->ack) \ | ||
126 | desc->chip->ack(irq); \ | ||
127 | }) | ||
128 | |||
129 | /* | 110 | /* |
130 | * interrupt-retrigger: should we handle this via lost interrupts and IPIs | 111 | * interrupt-retrigger: should we handle this via lost interrupts and IPIs |
131 | * or should we not care like we do now ? --BenH. | 112 | * or should we not care like we do now ? --BenH. |
diff --git a/include/asm-powerpc/module.h b/include/asm-powerpc/module.h index 584fabfb4f08..e5f14b13ccf0 100644 --- a/include/asm-powerpc/module.h +++ b/include/asm-powerpc/module.h | |||
@@ -46,8 +46,6 @@ struct mod_arch_specific { | |||
46 | unsigned int num_bugs; | 46 | unsigned int num_bugs; |
47 | }; | 47 | }; |
48 | 48 | ||
49 | extern struct bug_entry *module_find_bug(unsigned long bugaddr); | ||
50 | |||
51 | /* | 49 | /* |
52 | * Select ELF headers. | 50 | * Select ELF headers. |
53 | * Make empty section for module_frob_arch_sections to expand. | 51 | * Make empty section for module_frob_arch_sections to expand. |
diff --git a/include/asm-powerpc/page_32.h b/include/asm-powerpc/page_32.h index 2677bad70f40..07f6d3cf5e5a 100644 --- a/include/asm-powerpc/page_32.h +++ b/include/asm-powerpc/page_32.h | |||
@@ -26,15 +26,7 @@ extern void clear_pages(void *page, int order); | |||
26 | static inline void clear_page(void *page) { clear_pages(page, 0); } | 26 | static inline void clear_page(void *page) { clear_pages(page, 0); } |
27 | extern void copy_page(void *to, void *from); | 27 | extern void copy_page(void *to, void *from); |
28 | 28 | ||
29 | /* Pure 2^n version of get_order */ | 29 | #include <asm-generic/page.h> |
30 | extern __inline__ int get_order(unsigned long size) | ||
31 | { | ||
32 | int lz; | ||
33 | |||
34 | size = (size-1) >> PAGE_SHIFT; | ||
35 | asm ("cntlzw %0,%1" : "=r" (lz) : "r" (size)); | ||
36 | return 32 - lz; | ||
37 | } | ||
38 | 30 | ||
39 | #endif /* __ASSEMBLY__ */ | 31 | #endif /* __ASSEMBLY__ */ |
40 | 32 | ||
diff --git a/include/asm-powerpc/pci-bridge.h b/include/asm-powerpc/pci-bridge.h index 7bb7f9009806..cb02c9d1ef93 100644 --- a/include/asm-powerpc/pci-bridge.h +++ b/include/asm-powerpc/pci-bridge.h | |||
@@ -31,12 +31,12 @@ struct pci_controller { | |||
31 | int last_busno; | 31 | int last_busno; |
32 | 32 | ||
33 | void __iomem *io_base_virt; | 33 | void __iomem *io_base_virt; |
34 | unsigned long io_base_phys; | 34 | resource_size_t io_base_phys; |
35 | 35 | ||
36 | /* Some machines have a non 1:1 mapping of | 36 | /* Some machines have a non 1:1 mapping of |
37 | * the PCI memory space in the CPU bus space | 37 | * the PCI memory space in the CPU bus space |
38 | */ | 38 | */ |
39 | unsigned long pci_mem_offset; | 39 | resource_size_t pci_mem_offset; |
40 | unsigned long pci_io_size; | 40 | unsigned long pci_io_size; |
41 | 41 | ||
42 | struct pci_ops *ops; | 42 | struct pci_ops *ops; |
diff --git a/include/asm-powerpc/pci.h b/include/asm-powerpc/pci.h index 16f13319c769..ac656ee6bb19 100644 --- a/include/asm-powerpc/pci.h +++ b/include/asm-powerpc/pci.h | |||
@@ -143,8 +143,13 @@ int pci_mmap_page_range(struct pci_dev *pdev, struct vm_area_struct *vma, | |||
143 | /* Tell drivers/pci/proc.c that we have pci_mmap_page_range() */ | 143 | /* Tell drivers/pci/proc.c that we have pci_mmap_page_range() */ |
144 | #define HAVE_PCI_MMAP 1 | 144 | #define HAVE_PCI_MMAP 1 |
145 | 145 | ||
146 | #ifdef CONFIG_PPC64 | 146 | #if defined(CONFIG_PPC64) || defined(CONFIG_NOT_COHERENT_CACHE) |
147 | /* pci_unmap_{single,page} is not a nop, thus... */ | 147 | /* |
148 | * For 64-bit kernels, pci_unmap_{single,page} is not a nop. | ||
149 | * For 32-bit non-coherent kernels, pci_dma_sync_single_for_cpu() and | ||
150 | * so on are not nops. | ||
151 | * and thus... | ||
152 | */ | ||
148 | #define DECLARE_PCI_UNMAP_ADDR(ADDR_NAME) \ | 153 | #define DECLARE_PCI_UNMAP_ADDR(ADDR_NAME) \ |
149 | dma_addr_t ADDR_NAME; | 154 | dma_addr_t ADDR_NAME; |
150 | #define DECLARE_PCI_UNMAP_LEN(LEN_NAME) \ | 155 | #define DECLARE_PCI_UNMAP_LEN(LEN_NAME) \ |
@@ -158,6 +163,20 @@ int pci_mmap_page_range(struct pci_dev *pdev, struct vm_area_struct *vma, | |||
158 | #define pci_unmap_len_set(PTR, LEN_NAME, VAL) \ | 163 | #define pci_unmap_len_set(PTR, LEN_NAME, VAL) \ |
159 | (((PTR)->LEN_NAME) = (VAL)) | 164 | (((PTR)->LEN_NAME) = (VAL)) |
160 | 165 | ||
166 | #else /* 32-bit && coherent */ | ||
167 | |||
168 | /* pci_unmap_{page,single} is a nop so... */ | ||
169 | #define DECLARE_PCI_UNMAP_ADDR(ADDR_NAME) | ||
170 | #define DECLARE_PCI_UNMAP_LEN(LEN_NAME) | ||
171 | #define pci_unmap_addr(PTR, ADDR_NAME) (0) | ||
172 | #define pci_unmap_addr_set(PTR, ADDR_NAME, VAL) do { } while (0) | ||
173 | #define pci_unmap_len(PTR, LEN_NAME) (0) | ||
174 | #define pci_unmap_len_set(PTR, LEN_NAME, VAL) do { } while (0) | ||
175 | |||
176 | #endif /* CONFIG_PPC64 || CONFIG_NOT_COHERENT_CACHE */ | ||
177 | |||
178 | #ifdef CONFIG_PPC64 | ||
179 | |||
161 | /* The PCI address space does not equal the physical memory address | 180 | /* The PCI address space does not equal the physical memory address |
162 | * space (we have an IOMMU). The IDE and SCSI device layers use | 181 | * space (we have an IOMMU). The IDE and SCSI device layers use |
163 | * this boolean for bounce buffer decisions. | 182 | * this boolean for bounce buffer decisions. |
@@ -172,16 +191,8 @@ int pci_mmap_page_range(struct pci_dev *pdev, struct vm_area_struct *vma, | |||
172 | */ | 191 | */ |
173 | #define PCI_DMA_BUS_IS_PHYS (1) | 192 | #define PCI_DMA_BUS_IS_PHYS (1) |
174 | 193 | ||
175 | /* pci_unmap_{page,single} is a nop so... */ | ||
176 | #define DECLARE_PCI_UNMAP_ADDR(ADDR_NAME) | ||
177 | #define DECLARE_PCI_UNMAP_LEN(LEN_NAME) | ||
178 | #define pci_unmap_addr(PTR, ADDR_NAME) (0) | ||
179 | #define pci_unmap_addr_set(PTR, ADDR_NAME, VAL) do { } while (0) | ||
180 | #define pci_unmap_len(PTR, LEN_NAME) (0) | ||
181 | #define pci_unmap_len_set(PTR, LEN_NAME, VAL) do { } while (0) | ||
182 | |||
183 | #endif /* CONFIG_PPC64 */ | 194 | #endif /* CONFIG_PPC64 */ |
184 | 195 | ||
185 | extern void pcibios_resource_to_bus(struct pci_dev *dev, | 196 | extern void pcibios_resource_to_bus(struct pci_dev *dev, |
186 | struct pci_bus_region *region, | 197 | struct pci_bus_region *region, |
187 | struct resource *res); | 198 | struct resource *res); |
diff --git a/include/asm-powerpc/reg.h b/include/asm-powerpc/reg.h index 6faae7b14d55..a3631b15754c 100644 --- a/include/asm-powerpc/reg.h +++ b/include/asm-powerpc/reg.h | |||
@@ -143,6 +143,7 @@ | |||
143 | 143 | ||
144 | /* Special Purpose Registers (SPRNs)*/ | 144 | /* Special Purpose Registers (SPRNs)*/ |
145 | #define SPRN_CTR 0x009 /* Count Register */ | 145 | #define SPRN_CTR 0x009 /* Count Register */ |
146 | #define SPRN_DSCR 0x11 | ||
146 | #define SPRN_CTRLF 0x088 | 147 | #define SPRN_CTRLF 0x088 |
147 | #define SPRN_CTRLT 0x098 | 148 | #define SPRN_CTRLT 0x098 |
148 | #define CTRL_CT 0xc0000000 /* current thread */ | 149 | #define CTRL_CT 0xc0000000 /* current thread */ |
@@ -163,6 +164,7 @@ | |||
163 | #define SPRN_TBRU 0x10D /* Time Base Read Upper Register (user, R/O) */ | 164 | #define SPRN_TBRU 0x10D /* Time Base Read Upper Register (user, R/O) */ |
164 | #define SPRN_TBWL 0x11C /* Time Base Lower Register (super, R/W) */ | 165 | #define SPRN_TBWL 0x11C /* Time Base Lower Register (super, R/W) */ |
165 | #define SPRN_TBWU 0x11D /* Time Base Upper Register (super, R/W) */ | 166 | #define SPRN_TBWU 0x11D /* Time Base Upper Register (super, R/W) */ |
167 | #define SPRN_SPURR 0x134 /* Scaled PURR */ | ||
166 | #define SPRN_HIOR 0x137 /* 970 Hypervisor interrupt offset */ | 168 | #define SPRN_HIOR 0x137 /* 970 Hypervisor interrupt offset */ |
167 | #define SPRN_DBAT0L 0x219 /* Data BAT 0 Lower Register */ | 169 | #define SPRN_DBAT0L 0x219 /* Data BAT 0 Lower Register */ |
168 | #define SPRN_DBAT0U 0x218 /* Data BAT 0 Upper Register */ | 170 | #define SPRN_DBAT0U 0x218 /* Data BAT 0 Upper Register */ |
diff --git a/include/asm-powerpc/rtas.h b/include/asm-powerpc/rtas.h index 5a0c136c0416..8eaa7b28d9d0 100644 --- a/include/asm-powerpc/rtas.h +++ b/include/asm-powerpc/rtas.h | |||
@@ -159,6 +159,7 @@ extern struct rtas_t rtas; | |||
159 | 159 | ||
160 | extern void enter_rtas(unsigned long); | 160 | extern void enter_rtas(unsigned long); |
161 | extern int rtas_token(const char *service); | 161 | extern int rtas_token(const char *service); |
162 | extern int rtas_service_present(const char *service); | ||
162 | extern int rtas_call(int token, int, int, int *, ...); | 163 | extern int rtas_call(int token, int, int, int *, ...); |
163 | extern void rtas_restart(char *cmd); | 164 | extern void rtas_restart(char *cmd); |
164 | extern void rtas_power_off(void); | 165 | extern void rtas_power_off(void); |
@@ -221,8 +222,6 @@ extern int rtas_get_error_log_max(void); | |||
221 | extern spinlock_t rtas_data_buf_lock; | 222 | extern spinlock_t rtas_data_buf_lock; |
222 | extern char rtas_data_buf[RTAS_DATA_BUF_SIZE]; | 223 | extern char rtas_data_buf[RTAS_DATA_BUF_SIZE]; |
223 | 224 | ||
224 | extern void rtas_stop_self(void); | ||
225 | |||
226 | /* RMO buffer reserved for user-space RTAS use */ | 225 | /* RMO buffer reserved for user-space RTAS use */ |
227 | extern unsigned long rtas_rmo_buf; | 226 | extern unsigned long rtas_rmo_buf; |
228 | 227 | ||
diff --git a/include/asm-powerpc/termbits.h b/include/asm-powerpc/termbits.h index 6d533b07aaf5..5e79198f7d18 100644 --- a/include/asm-powerpc/termbits.h +++ b/include/asm-powerpc/termbits.h | |||
@@ -30,6 +30,19 @@ struct termios { | |||
30 | speed_t c_ospeed; /* output speed */ | 30 | speed_t c_ospeed; /* output speed */ |
31 | }; | 31 | }; |
32 | 32 | ||
33 | /* For PowerPC the termios and ktermios are the same */ | ||
34 | |||
35 | struct ktermios { | ||
36 | tcflag_t c_iflag; /* input mode flags */ | ||
37 | tcflag_t c_oflag; /* output mode flags */ | ||
38 | tcflag_t c_cflag; /* control mode flags */ | ||
39 | tcflag_t c_lflag; /* local mode flags */ | ||
40 | cc_t c_cc[NCCS]; /* control characters */ | ||
41 | cc_t c_line; /* line discipline (== c_cc[19]) */ | ||
42 | speed_t c_ispeed; /* input speed */ | ||
43 | speed_t c_ospeed; /* output speed */ | ||
44 | }; | ||
45 | |||
33 | /* c_cc characters */ | 46 | /* c_cc characters */ |
34 | #define VINTR 0 | 47 | #define VINTR 0 |
35 | #define VQUIT 1 | 48 | #define VQUIT 1 |
diff --git a/include/asm-powerpc/topology.h b/include/asm-powerpc/topology.h index 50c014007de7..6610495f5f16 100644 --- a/include/asm-powerpc/topology.h +++ b/include/asm-powerpc/topology.h | |||
@@ -66,6 +66,7 @@ static inline int pcibus_to_node(struct pci_bus *bus) | |||
66 | | SD_BALANCE_EXEC \ | 66 | | SD_BALANCE_EXEC \ |
67 | | SD_BALANCE_NEWIDLE \ | 67 | | SD_BALANCE_NEWIDLE \ |
68 | | SD_WAKE_IDLE \ | 68 | | SD_WAKE_IDLE \ |
69 | | SD_SERIALIZE \ | ||
69 | | SD_WAKE_BALANCE, \ | 70 | | SD_WAKE_BALANCE, \ |
70 | .last_balance = jiffies, \ | 71 | .last_balance = jiffies, \ |
71 | .balance_interval = 1, \ | 72 | .balance_interval = 1, \ |
diff --git a/include/asm-ppc/pci-bridge.h b/include/asm-ppc/pci-bridge.h index 6c955d0c1ef0..4d35b844bc58 100644 --- a/include/asm-ppc/pci-bridge.h +++ b/include/asm-ppc/pci-bridge.h | |||
@@ -20,8 +20,8 @@ extern unsigned long pci_bus_mem_base_phys(unsigned int bus); | |||
20 | extern struct pci_controller* pcibios_alloc_controller(void); | 20 | extern struct pci_controller* pcibios_alloc_controller(void); |
21 | 21 | ||
22 | /* Helper function for setting up resources */ | 22 | /* Helper function for setting up resources */ |
23 | extern void pci_init_resource(struct resource *res, unsigned long start, | 23 | extern void pci_init_resource(struct resource *res, resource_size_t start, |
24 | unsigned long end, int flags, char *name); | 24 | resource_size_t end, int flags, char *name); |
25 | 25 | ||
26 | /* Get the PCI host controller for a bus */ | 26 | /* Get the PCI host controller for a bus */ |
27 | extern struct pci_controller* pci_bus_to_hose(int bus); | 27 | extern struct pci_controller* pci_bus_to_hose(int bus); |
@@ -50,12 +50,12 @@ struct pci_controller { | |||
50 | int bus_offset; | 50 | int bus_offset; |
51 | 51 | ||
52 | void __iomem *io_base_virt; | 52 | void __iomem *io_base_virt; |
53 | unsigned long io_base_phys; | 53 | resource_size_t io_base_phys; |
54 | 54 | ||
55 | /* Some machines (PReP) have a non 1:1 mapping of | 55 | /* Some machines (PReP) have a non 1:1 mapping of |
56 | * the PCI memory space in the CPU bus space | 56 | * the PCI memory space in the CPU bus space |
57 | */ | 57 | */ |
58 | unsigned long pci_mem_offset; | 58 | resource_size_t pci_mem_offset; |
59 | 59 | ||
60 | struct pci_ops *ops; | 60 | struct pci_ops *ops; |
61 | volatile unsigned int __iomem *cfg_addr; | 61 | volatile unsigned int __iomem *cfg_addr; |
diff --git a/include/asm-ppc/pci.h b/include/asm-ppc/pci.h index 11ffaaa5da16..9d162028dab9 100644 --- a/include/asm-ppc/pci.h +++ b/include/asm-ppc/pci.h | |||
@@ -61,6 +61,27 @@ extern unsigned long pci_bus_to_phys(unsigned int ba, int busnr); | |||
61 | */ | 61 | */ |
62 | #define PCI_DMA_BUS_IS_PHYS (1) | 62 | #define PCI_DMA_BUS_IS_PHYS (1) |
63 | 63 | ||
64 | #ifdef CONFIG_NOT_COHERENT_CACHE | ||
65 | /* | ||
66 | * pci_unmap_{page,single} are NOPs but pci_dma_sync_single_for_cpu() | ||
67 | * and so on are not, so... | ||
68 | */ | ||
69 | |||
70 | #define DECLARE_PCI_UNMAP_ADDR(ADDR_NAME) \ | ||
71 | dma_addr_t ADDR_NAME; | ||
72 | #define DECLARE_PCI_UNMAP_LEN(LEN_NAME) \ | ||
73 | __u32 LEN_NAME; | ||
74 | #define pci_unmap_addr(PTR, ADDR_NAME) \ | ||
75 | ((PTR)->ADDR_NAME) | ||
76 | #define pci_unmap_addr_set(PTR, ADDR_NAME, VAL) \ | ||
77 | (((PTR)->ADDR_NAME) = (VAL)) | ||
78 | #define pci_unmap_len(PTR, LEN_NAME) \ | ||
79 | ((PTR)->LEN_NAME) | ||
80 | #define pci_unmap_len_set(PTR, LEN_NAME, VAL) \ | ||
81 | (((PTR)->LEN_NAME) = (VAL)) | ||
82 | |||
83 | #else /* coherent */ | ||
84 | |||
64 | /* pci_unmap_{page,single} is a nop so... */ | 85 | /* pci_unmap_{page,single} is a nop so... */ |
65 | #define DECLARE_PCI_UNMAP_ADDR(ADDR_NAME) | 86 | #define DECLARE_PCI_UNMAP_ADDR(ADDR_NAME) |
66 | #define DECLARE_PCI_UNMAP_LEN(LEN_NAME) | 87 | #define DECLARE_PCI_UNMAP_LEN(LEN_NAME) |
@@ -69,6 +90,8 @@ extern unsigned long pci_bus_to_phys(unsigned int ba, int busnr); | |||
69 | #define pci_unmap_len(PTR, LEN_NAME) (0) | 90 | #define pci_unmap_len(PTR, LEN_NAME) (0) |
70 | #define pci_unmap_len_set(PTR, LEN_NAME, VAL) do { } while (0) | 91 | #define pci_unmap_len_set(PTR, LEN_NAME, VAL) do { } while (0) |
71 | 92 | ||
93 | #endif /* CONFIG_NOT_COHERENT_CACHE */ | ||
94 | |||
72 | #ifdef CONFIG_PCI | 95 | #ifdef CONFIG_PCI |
73 | static inline void pci_dma_burst_advice(struct pci_dev *pdev, | 96 | static inline void pci_dma_burst_advice(struct pci_dev *pdev, |
74 | enum pci_dma_burst_strategy *strat, | 97 | enum pci_dma_burst_strategy *strat, |
diff --git a/include/asm-ppc/reg_booke.h b/include/asm-ppc/reg_booke.h index 602fbadeaf48..a263fc1e65c4 100644 --- a/include/asm-ppc/reg_booke.h +++ b/include/asm-ppc/reg_booke.h | |||
@@ -9,41 +9,9 @@ | |||
9 | #ifndef __ASM_PPC_REG_BOOKE_H__ | 9 | #ifndef __ASM_PPC_REG_BOOKE_H__ |
10 | #define __ASM_PPC_REG_BOOKE_H__ | 10 | #define __ASM_PPC_REG_BOOKE_H__ |
11 | 11 | ||
12 | #ifndef __ASSEMBLY__ | 12 | #include <asm/dcr.h> |
13 | /* Device Control Registers */ | ||
14 | void __mtdcr(int reg, unsigned int val); | ||
15 | unsigned int __mfdcr(int reg); | ||
16 | #define mfdcr(rn) \ | ||
17 | ({unsigned int rval; \ | ||
18 | if (__builtin_constant_p(rn)) \ | ||
19 | asm volatile("mfdcr %0," __stringify(rn) \ | ||
20 | : "=r" (rval)); \ | ||
21 | else \ | ||
22 | rval = __mfdcr(rn); \ | ||
23 | rval;}) | ||
24 | |||
25 | #define mtdcr(rn, v) \ | ||
26 | do { \ | ||
27 | if (__builtin_constant_p(rn)) \ | ||
28 | asm volatile("mtdcr " __stringify(rn) ",%0" \ | ||
29 | : : "r" (v)); \ | ||
30 | else \ | ||
31 | __mtdcr(rn, v); \ | ||
32 | } while (0) | ||
33 | |||
34 | /* R/W of indirect DCRs make use of standard naming conventions for DCRs */ | ||
35 | #define mfdcri(base, reg) \ | ||
36 | ({ \ | ||
37 | mtdcr(base ## _CFGADDR, base ## _ ## reg); \ | ||
38 | mfdcr(base ## _CFGDATA); \ | ||
39 | }) | ||
40 | |||
41 | #define mtdcri(base, reg, data) \ | ||
42 | do { \ | ||
43 | mtdcr(base ## _CFGADDR, base ## _ ## reg); \ | ||
44 | mtdcr(base ## _CFGDATA, data); \ | ||
45 | } while (0) | ||
46 | 13 | ||
14 | #ifndef __ASSEMBLY__ | ||
47 | /* Performance Monitor Registers */ | 15 | /* Performance Monitor Registers */ |
48 | #define mfpmr(rn) ({unsigned int rval; \ | 16 | #define mfpmr(rn) ({unsigned int rval; \ |
49 | asm volatile("mfpmr %0," __stringify(rn) \ | 17 | asm volatile("mfpmr %0," __stringify(rn) \ |
diff --git a/include/asm-s390/dasd.h b/include/asm-s390/dasd.h index c042f9578081..604f68fa6f56 100644 --- a/include/asm-s390/dasd.h +++ b/include/asm-s390/dasd.h | |||
@@ -69,11 +69,13 @@ typedef struct dasd_information2_t { | |||
69 | * 0x01: readonly (ro) | 69 | * 0x01: readonly (ro) |
70 | * 0x02: use diag discipline (diag) | 70 | * 0x02: use diag discipline (diag) |
71 | * 0x04: set the device initially online (internal use only) | 71 | * 0x04: set the device initially online (internal use only) |
72 | * 0x08: enable ERP related logging | ||
72 | */ | 73 | */ |
73 | #define DASD_FEATURE_DEFAULT 0x00 | 74 | #define DASD_FEATURE_DEFAULT 0x00 |
74 | #define DASD_FEATURE_READONLY 0x01 | 75 | #define DASD_FEATURE_READONLY 0x01 |
75 | #define DASD_FEATURE_USEDIAG 0x02 | 76 | #define DASD_FEATURE_USEDIAG 0x02 |
76 | #define DASD_FEATURE_INITIAL_ONLINE 0x04 | 77 | #define DASD_FEATURE_INITIAL_ONLINE 0x04 |
78 | #define DASD_FEATURE_ERPLOG 0x08 | ||
77 | 79 | ||
78 | #define DASD_PARTN_BITS 2 | 80 | #define DASD_PARTN_BITS 2 |
79 | 81 | ||
diff --git a/include/asm-s390/page.h b/include/asm-s390/page.h index 363ea761d5ee..05ea6f172786 100644 --- a/include/asm-s390/page.h +++ b/include/asm-s390/page.h | |||
@@ -127,6 +127,26 @@ page_get_storage_key(unsigned long addr) | |||
127 | return skey; | 127 | return skey; |
128 | } | 128 | } |
129 | 129 | ||
130 | extern unsigned long max_pfn; | ||
131 | |||
132 | static inline int pfn_valid(unsigned long pfn) | ||
133 | { | ||
134 | unsigned long dummy; | ||
135 | int ccode; | ||
136 | |||
137 | if (pfn >= max_pfn) | ||
138 | return 0; | ||
139 | |||
140 | asm volatile( | ||
141 | " lra %0,0(%2)\n" | ||
142 | " ipm %1\n" | ||
143 | " srl %1,28\n" | ||
144 | : "=d" (dummy), "=d" (ccode) | ||
145 | : "a" (pfn << PAGE_SHIFT) | ||
146 | : "cc"); | ||
147 | return !ccode; | ||
148 | } | ||
149 | |||
130 | #endif /* !__ASSEMBLY__ */ | 150 | #endif /* !__ASSEMBLY__ */ |
131 | 151 | ||
132 | /* to align the pointer to the (next) page boundary */ | 152 | /* to align the pointer to the (next) page boundary */ |
@@ -138,8 +158,6 @@ page_get_storage_key(unsigned long addr) | |||
138 | #define __va(x) (void *)(unsigned long)(x) | 158 | #define __va(x) (void *)(unsigned long)(x) |
139 | #define virt_to_page(kaddr) pfn_to_page(__pa(kaddr) >> PAGE_SHIFT) | 159 | #define virt_to_page(kaddr) pfn_to_page(__pa(kaddr) >> PAGE_SHIFT) |
140 | #define page_to_phys(page) (page_to_pfn(page) << PAGE_SHIFT) | 160 | #define page_to_phys(page) (page_to_pfn(page) << PAGE_SHIFT) |
141 | |||
142 | #define pfn_valid(pfn) ((pfn) < max_mapnr) | ||
143 | #define virt_addr_valid(kaddr) pfn_valid(__pa(kaddr) >> PAGE_SHIFT) | 161 | #define virt_addr_valid(kaddr) pfn_valid(__pa(kaddr) >> PAGE_SHIFT) |
144 | 162 | ||
145 | #define VM_DATA_DEFAULT_FLAGS (VM_READ | VM_WRITE | VM_EXEC | \ | 163 | #define VM_DATA_DEFAULT_FLAGS (VM_READ | VM_WRITE | VM_EXEC | \ |
diff --git a/include/asm-s390/pgalloc.h b/include/asm-s390/pgalloc.h index 28619de5ecae..0707a7e2fc16 100644 --- a/include/asm-s390/pgalloc.h +++ b/include/asm-s390/pgalloc.h | |||
@@ -25,8 +25,11 @@ extern void diag10(unsigned long addr); | |||
25 | * Page allocation orders. | 25 | * Page allocation orders. |
26 | */ | 26 | */ |
27 | #ifndef __s390x__ | 27 | #ifndef __s390x__ |
28 | # define PTE_ALLOC_ORDER 0 | ||
29 | # define PMD_ALLOC_ORDER 0 | ||
28 | # define PGD_ALLOC_ORDER 1 | 30 | # define PGD_ALLOC_ORDER 1 |
29 | #else /* __s390x__ */ | 31 | #else /* __s390x__ */ |
32 | # define PTE_ALLOC_ORDER 0 | ||
30 | # define PMD_ALLOC_ORDER 2 | 33 | # define PMD_ALLOC_ORDER 2 |
31 | # define PGD_ALLOC_ORDER 2 | 34 | # define PGD_ALLOC_ORDER 2 |
32 | #endif /* __s390x__ */ | 35 | #endif /* __s390x__ */ |
diff --git a/include/asm-s390/pgtable.h b/include/asm-s390/pgtable.h index 2d968a69ed1f..ae61aca5d483 100644 --- a/include/asm-s390/pgtable.h +++ b/include/asm-s390/pgtable.h | |||
@@ -107,23 +107,25 @@ extern char empty_zero_page[PAGE_SIZE]; | |||
107 | * The vmalloc() routines leaves a hole of 4kB between each vmalloced | 107 | * The vmalloc() routines leaves a hole of 4kB between each vmalloced |
108 | * area for the same reason. ;) | 108 | * area for the same reason. ;) |
109 | */ | 109 | */ |
110 | extern unsigned long vmalloc_end; | ||
110 | #define VMALLOC_OFFSET (8*1024*1024) | 111 | #define VMALLOC_OFFSET (8*1024*1024) |
111 | #define VMALLOC_START (((unsigned long) high_memory + VMALLOC_OFFSET) \ | 112 | #define VMALLOC_START (((unsigned long) high_memory + VMALLOC_OFFSET) \ |
112 | & ~(VMALLOC_OFFSET-1)) | 113 | & ~(VMALLOC_OFFSET-1)) |
114 | #define VMALLOC_END vmalloc_end | ||
113 | 115 | ||
114 | /* | 116 | /* |
115 | * We need some free virtual space to be able to do vmalloc. | 117 | * We need some free virtual space to be able to do vmalloc. |
116 | * VMALLOC_MIN_SIZE defines the minimum size of the vmalloc | 118 | * VMALLOC_MIN_SIZE defines the minimum size of the vmalloc |
117 | * area. On a machine with 2GB memory we make sure that we | 119 | * area. On a machine with 2GB memory we make sure that we |
118 | * have at least 128MB free space for vmalloc. On a machine | 120 | * have at least 128MB free space for vmalloc. On a machine |
119 | * with 4TB we make sure we have at least 1GB. | 121 | * with 4TB we make sure we have at least 128GB. |
120 | */ | 122 | */ |
121 | #ifndef __s390x__ | 123 | #ifndef __s390x__ |
122 | #define VMALLOC_MIN_SIZE 0x8000000UL | 124 | #define VMALLOC_MIN_SIZE 0x8000000UL |
123 | #define VMALLOC_END 0x80000000UL | 125 | #define VMALLOC_END_INIT 0x80000000UL |
124 | #else /* __s390x__ */ | 126 | #else /* __s390x__ */ |
125 | #define VMALLOC_MIN_SIZE 0x40000000UL | 127 | #define VMALLOC_MIN_SIZE 0x2000000000UL |
126 | #define VMALLOC_END 0x40000000000UL | 128 | #define VMALLOC_END_INIT 0x40000000000UL |
127 | #endif /* __s390x__ */ | 129 | #endif /* __s390x__ */ |
128 | 130 | ||
129 | /* | 131 | /* |
@@ -815,11 +817,17 @@ static inline pte_t mk_swap_pte(unsigned long type, unsigned long offset) | |||
815 | 817 | ||
816 | #define kern_addr_valid(addr) (1) | 818 | #define kern_addr_valid(addr) (1) |
817 | 819 | ||
820 | extern int add_shared_memory(unsigned long start, unsigned long size); | ||
821 | extern int remove_shared_memory(unsigned long start, unsigned long size); | ||
822 | |||
818 | /* | 823 | /* |
819 | * No page table caches to initialise | 824 | * No page table caches to initialise |
820 | */ | 825 | */ |
821 | #define pgtable_cache_init() do { } while (0) | 826 | #define pgtable_cache_init() do { } while (0) |
822 | 827 | ||
828 | #define __HAVE_ARCH_MEMMAP_INIT | ||
829 | extern void memmap_init(unsigned long, int, unsigned long, unsigned long); | ||
830 | |||
823 | #define __HAVE_ARCH_PTEP_ESTABLISH | 831 | #define __HAVE_ARCH_PTEP_ESTABLISH |
824 | #define __HAVE_ARCH_PTEP_SET_ACCESS_FLAGS | 832 | #define __HAVE_ARCH_PTEP_SET_ACCESS_FLAGS |
825 | #define __HAVE_ARCH_PTEP_TEST_AND_CLEAR_YOUNG | 833 | #define __HAVE_ARCH_PTEP_TEST_AND_CLEAR_YOUNG |
diff --git a/include/asm-s390/termbits.h b/include/asm-s390/termbits.h index eb3f8bfabf61..585c78a6e407 100644 --- a/include/asm-s390/termbits.h +++ b/include/asm-s390/termbits.h | |||
@@ -25,6 +25,17 @@ struct termios { | |||
25 | cc_t c_cc[NCCS]; /* control characters */ | 25 | cc_t c_cc[NCCS]; /* control characters */ |
26 | }; | 26 | }; |
27 | 27 | ||
28 | struct ktermios { | ||
29 | tcflag_t c_iflag; /* input mode flags */ | ||
30 | tcflag_t c_oflag; /* output mode flags */ | ||
31 | tcflag_t c_cflag; /* control mode flags */ | ||
32 | tcflag_t c_lflag; /* local mode flags */ | ||
33 | cc_t c_line; /* line discipline */ | ||
34 | cc_t c_cc[NCCS]; /* control characters */ | ||
35 | speed_t c_ispeed; /* input speed */ | ||
36 | speed_t c_ospeed; /* output speed */ | ||
37 | }; | ||
38 | |||
28 | /* c_cc characters */ | 39 | /* c_cc characters */ |
29 | #define VINTR 0 | 40 | #define VINTR 0 |
30 | #define VQUIT 1 | 41 | #define VQUIT 1 |
diff --git a/include/asm-sh/atomic-irq.h b/include/asm-sh/atomic-irq.h new file mode 100644 index 000000000000..74f7943cff6f --- /dev/null +++ b/include/asm-sh/atomic-irq.h | |||
@@ -0,0 +1,71 @@ | |||
1 | #ifndef __ASM_SH_ATOMIC_IRQ_H | ||
2 | #define __ASM_SH_ATOMIC_IRQ_H | ||
3 | |||
4 | /* | ||
5 | * To get proper branch prediction for the main line, we must branch | ||
6 | * forward to code at the end of this object's .text section, then | ||
7 | * branch back to restart the operation. | ||
8 | */ | ||
9 | static inline void atomic_add(int i, atomic_t *v) | ||
10 | { | ||
11 | unsigned long flags; | ||
12 | |||
13 | local_irq_save(flags); | ||
14 | *(long *)v += i; | ||
15 | local_irq_restore(flags); | ||
16 | } | ||
17 | |||
18 | static inline void atomic_sub(int i, atomic_t *v) | ||
19 | { | ||
20 | unsigned long flags; | ||
21 | |||
22 | local_irq_save(flags); | ||
23 | *(long *)v -= i; | ||
24 | local_irq_restore(flags); | ||
25 | } | ||
26 | |||
27 | static inline int atomic_add_return(int i, atomic_t *v) | ||
28 | { | ||
29 | unsigned long temp, flags; | ||
30 | |||
31 | local_irq_save(flags); | ||
32 | temp = *(long *)v; | ||
33 | temp += i; | ||
34 | *(long *)v = temp; | ||
35 | local_irq_restore(flags); | ||
36 | |||
37 | return temp; | ||
38 | } | ||
39 | |||
40 | static inline int atomic_sub_return(int i, atomic_t *v) | ||
41 | { | ||
42 | unsigned long temp, flags; | ||
43 | |||
44 | local_irq_save(flags); | ||
45 | temp = *(long *)v; | ||
46 | temp -= i; | ||
47 | *(long *)v = temp; | ||
48 | local_irq_restore(flags); | ||
49 | |||
50 | return temp; | ||
51 | } | ||
52 | |||
53 | static inline void atomic_clear_mask(unsigned int mask, atomic_t *v) | ||
54 | { | ||
55 | unsigned long flags; | ||
56 | |||
57 | local_irq_save(flags); | ||
58 | *(long *)v &= ~mask; | ||
59 | local_irq_restore(flags); | ||
60 | } | ||
61 | |||
62 | static inline void atomic_set_mask(unsigned int mask, atomic_t *v) | ||
63 | { | ||
64 | unsigned long flags; | ||
65 | |||
66 | local_irq_save(flags); | ||
67 | *(long *)v |= mask; | ||
68 | local_irq_restore(flags); | ||
69 | } | ||
70 | |||
71 | #endif /* __ASM_SH_ATOMIC_IRQ_H */ | ||
diff --git a/include/asm-sh/atomic-llsc.h b/include/asm-sh/atomic-llsc.h new file mode 100644 index 000000000000..4b00b78e3f4f --- /dev/null +++ b/include/asm-sh/atomic-llsc.h | |||
@@ -0,0 +1,107 @@ | |||
1 | #ifndef __ASM_SH_ATOMIC_LLSC_H | ||
2 | #define __ASM_SH_ATOMIC_LLSC_H | ||
3 | |||
4 | /* | ||
5 | * To get proper branch prediction for the main line, we must branch | ||
6 | * forward to code at the end of this object's .text section, then | ||
7 | * branch back to restart the operation. | ||
8 | */ | ||
9 | static inline void atomic_add(int i, atomic_t *v) | ||
10 | { | ||
11 | unsigned long tmp; | ||
12 | |||
13 | __asm__ __volatile__ ( | ||
14 | "1: movli.l @%2, %0 ! atomic_add \n" | ||
15 | " add %1, %0 \n" | ||
16 | " movco.l %0, @%2 \n" | ||
17 | " bf 1b \n" | ||
18 | : "=&z" (tmp) | ||
19 | : "r" (i), "r" (&v->counter) | ||
20 | : "t"); | ||
21 | } | ||
22 | |||
23 | static inline void atomic_sub(int i, atomic_t *v) | ||
24 | { | ||
25 | unsigned long tmp; | ||
26 | |||
27 | __asm__ __volatile__ ( | ||
28 | "1: movli.l @%2, %0 ! atomic_sub \n" | ||
29 | " sub %1, %0 \n" | ||
30 | " movco.l %0, @%2 \n" | ||
31 | " bf 1b \n" | ||
32 | : "=&z" (tmp) | ||
33 | : "r" (i), "r" (&v->counter) | ||
34 | : "t"); | ||
35 | } | ||
36 | |||
37 | /* | ||
38 | * SH-4A note: | ||
39 | * | ||
40 | * We basically get atomic_xxx_return() for free compared with | ||
41 | * atomic_xxx(). movli.l/movco.l require r0 due to the instruction | ||
42 | * encoding, so the retval is automatically set without having to | ||
43 | * do any special work. | ||
44 | */ | ||
45 | static inline int atomic_add_return(int i, atomic_t *v) | ||
46 | { | ||
47 | unsigned long temp; | ||
48 | |||
49 | __asm__ __volatile__ ( | ||
50 | "1: movli.l @%2, %0 ! atomic_add_return \n" | ||
51 | " add %1, %0 \n" | ||
52 | " movco.l %0, @%2 \n" | ||
53 | " bf 1b \n" | ||
54 | " synco \n" | ||
55 | : "=&z" (temp) | ||
56 | : "r" (i), "r" (&v->counter) | ||
57 | : "t"); | ||
58 | |||
59 | return temp; | ||
60 | } | ||
61 | |||
62 | static inline int atomic_sub_return(int i, atomic_t *v) | ||
63 | { | ||
64 | unsigned long temp; | ||
65 | |||
66 | __asm__ __volatile__ ( | ||
67 | "1: movli.l @%2, %0 ! atomic_sub_return \n" | ||
68 | " sub %1, %0 \n" | ||
69 | " movco.l %0, @%2 \n" | ||
70 | " bf 1b \n" | ||
71 | " synco \n" | ||
72 | : "=&z" (temp) | ||
73 | : "r" (i), "r" (&v->counter) | ||
74 | : "t"); | ||
75 | |||
76 | return temp; | ||
77 | } | ||
78 | |||
79 | static inline void atomic_clear_mask(unsigned int mask, atomic_t *v) | ||
80 | { | ||
81 | unsigned long tmp; | ||
82 | |||
83 | __asm__ __volatile__ ( | ||
84 | "1: movli.l @%2, %0 ! atomic_clear_mask \n" | ||
85 | " and %1, %0 \n" | ||
86 | " movco.l %0, @%2 \n" | ||
87 | " bf 1b \n" | ||
88 | : "=&z" (tmp) | ||
89 | : "r" (~mask), "r" (&v->counter) | ||
90 | : "t"); | ||
91 | } | ||
92 | |||
93 | static inline void atomic_set_mask(unsigned int mask, atomic_t *v) | ||
94 | { | ||
95 | unsigned long tmp; | ||
96 | |||
97 | __asm__ __volatile__ ( | ||
98 | "1: movli.l @%2, %0 ! atomic_set_mask \n" | ||
99 | " or %1, %0 \n" | ||
100 | " movco.l %0, @%2 \n" | ||
101 | " bf 1b \n" | ||
102 | : "=&z" (tmp) | ||
103 | : "r" (mask), "r" (&v->counter) | ||
104 | : "t"); | ||
105 | } | ||
106 | |||
107 | #endif /* __ASM_SH_ATOMIC_LLSC_H */ | ||
diff --git a/include/asm-sh/atomic.h b/include/asm-sh/atomic.h index 28305c3cbddf..e12570b9339d 100644 --- a/include/asm-sh/atomic.h +++ b/include/asm-sh/atomic.h | |||
@@ -17,119 +17,14 @@ typedef struct { volatile int counter; } atomic_t; | |||
17 | #include <linux/compiler.h> | 17 | #include <linux/compiler.h> |
18 | #include <asm/system.h> | 18 | #include <asm/system.h> |
19 | 19 | ||
20 | /* | ||
21 | * To get proper branch prediction for the main line, we must branch | ||
22 | * forward to code at the end of this object's .text section, then | ||
23 | * branch back to restart the operation. | ||
24 | */ | ||
25 | static inline void atomic_add(int i, atomic_t *v) | ||
26 | { | ||
27 | #ifdef CONFIG_CPU_SH4A | 20 | #ifdef CONFIG_CPU_SH4A |
28 | unsigned long tmp; | 21 | #include <asm/atomic-llsc.h> |
29 | |||
30 | __asm__ __volatile__ ( | ||
31 | "1: movli.l @%2, %0 ! atomic_add \n" | ||
32 | " add %1, %0 \n" | ||
33 | " movco.l %0, @%2 \n" | ||
34 | " bf 1b \n" | ||
35 | : "=&z" (tmp) | ||
36 | : "r" (i), "r" (&v->counter) | ||
37 | : "t"); | ||
38 | #else | 22 | #else |
39 | unsigned long flags; | 23 | #include <asm/atomic-irq.h> |
40 | |||
41 | local_irq_save(flags); | ||
42 | *(long *)v += i; | ||
43 | local_irq_restore(flags); | ||
44 | #endif | ||
45 | } | ||
46 | |||
47 | static inline void atomic_sub(int i, atomic_t *v) | ||
48 | { | ||
49 | #ifdef CONFIG_CPU_SH4A | ||
50 | unsigned long tmp; | ||
51 | |||
52 | __asm__ __volatile__ ( | ||
53 | "1: movli.l @%2, %0 ! atomic_sub \n" | ||
54 | " sub %1, %0 \n" | ||
55 | " movco.l %0, @%2 \n" | ||
56 | " bf 1b \n" | ||
57 | : "=&z" (tmp) | ||
58 | : "r" (i), "r" (&v->counter) | ||
59 | : "t"); | ||
60 | #else | ||
61 | unsigned long flags; | ||
62 | |||
63 | local_irq_save(flags); | ||
64 | *(long *)v -= i; | ||
65 | local_irq_restore(flags); | ||
66 | #endif | 24 | #endif |
67 | } | ||
68 | |||
69 | /* | ||
70 | * SH-4A note: | ||
71 | * | ||
72 | * We basically get atomic_xxx_return() for free compared with | ||
73 | * atomic_xxx(). movli.l/movco.l require r0 due to the instruction | ||
74 | * encoding, so the retval is automatically set without having to | ||
75 | * do any special work. | ||
76 | */ | ||
77 | static inline int atomic_add_return(int i, atomic_t *v) | ||
78 | { | ||
79 | unsigned long temp; | ||
80 | |||
81 | #ifdef CONFIG_CPU_SH4A | ||
82 | __asm__ __volatile__ ( | ||
83 | "1: movli.l @%2, %0 ! atomic_add_return \n" | ||
84 | " add %1, %0 \n" | ||
85 | " movco.l %0, @%2 \n" | ||
86 | " bf 1b \n" | ||
87 | " synco \n" | ||
88 | : "=&z" (temp) | ||
89 | : "r" (i), "r" (&v->counter) | ||
90 | : "t"); | ||
91 | #else | ||
92 | unsigned long flags; | ||
93 | |||
94 | local_irq_save(flags); | ||
95 | temp = *(long *)v; | ||
96 | temp += i; | ||
97 | *(long *)v = temp; | ||
98 | local_irq_restore(flags); | ||
99 | #endif | ||
100 | |||
101 | return temp; | ||
102 | } | ||
103 | 25 | ||
104 | #define atomic_add_negative(a, v) (atomic_add_return((a), (v)) < 0) | 26 | #define atomic_add_negative(a, v) (atomic_add_return((a), (v)) < 0) |
105 | 27 | ||
106 | static inline int atomic_sub_return(int i, atomic_t *v) | ||
107 | { | ||
108 | unsigned long temp; | ||
109 | |||
110 | #ifdef CONFIG_CPU_SH4A | ||
111 | __asm__ __volatile__ ( | ||
112 | "1: movli.l @%2, %0 ! atomic_sub_return \n" | ||
113 | " sub %1, %0 \n" | ||
114 | " movco.l %0, @%2 \n" | ||
115 | " bf 1b \n" | ||
116 | " synco \n" | ||
117 | : "=&z" (temp) | ||
118 | : "r" (i), "r" (&v->counter) | ||
119 | : "t"); | ||
120 | #else | ||
121 | unsigned long flags; | ||
122 | |||
123 | local_irq_save(flags); | ||
124 | temp = *(long *)v; | ||
125 | temp -= i; | ||
126 | *(long *)v = temp; | ||
127 | local_irq_restore(flags); | ||
128 | #endif | ||
129 | |||
130 | return temp; | ||
131 | } | ||
132 | |||
133 | #define atomic_dec_return(v) atomic_sub_return(1,(v)) | 28 | #define atomic_dec_return(v) atomic_sub_return(1,(v)) |
134 | #define atomic_inc_return(v) atomic_add_return(1,(v)) | 29 | #define atomic_inc_return(v) atomic_add_return(1,(v)) |
135 | 30 | ||
@@ -180,50 +75,6 @@ static inline int atomic_add_unless(atomic_t *v, int a, int u) | |||
180 | } | 75 | } |
181 | #define atomic_inc_not_zero(v) atomic_add_unless((v), 1, 0) | 76 | #define atomic_inc_not_zero(v) atomic_add_unless((v), 1, 0) |
182 | 77 | ||
183 | static inline void atomic_clear_mask(unsigned int mask, atomic_t *v) | ||
184 | { | ||
185 | #ifdef CONFIG_CPU_SH4A | ||
186 | unsigned long tmp; | ||
187 | |||
188 | __asm__ __volatile__ ( | ||
189 | "1: movli.l @%2, %0 ! atomic_clear_mask \n" | ||
190 | " and %1, %0 \n" | ||
191 | " movco.l %0, @%2 \n" | ||
192 | " bf 1b \n" | ||
193 | : "=&z" (tmp) | ||
194 | : "r" (~mask), "r" (&v->counter) | ||
195 | : "t"); | ||
196 | #else | ||
197 | unsigned long flags; | ||
198 | |||
199 | local_irq_save(flags); | ||
200 | *(long *)v &= ~mask; | ||
201 | local_irq_restore(flags); | ||
202 | #endif | ||
203 | } | ||
204 | |||
205 | static inline void atomic_set_mask(unsigned int mask, atomic_t *v) | ||
206 | { | ||
207 | #ifdef CONFIG_CPU_SH4A | ||
208 | unsigned long tmp; | ||
209 | |||
210 | __asm__ __volatile__ ( | ||
211 | "1: movli.l @%2, %0 ! atomic_set_mask \n" | ||
212 | " or %1, %0 \n" | ||
213 | " movco.l %0, @%2 \n" | ||
214 | " bf 1b \n" | ||
215 | : "=&z" (tmp) | ||
216 | : "r" (mask), "r" (&v->counter) | ||
217 | : "t"); | ||
218 | #else | ||
219 | unsigned long flags; | ||
220 | |||
221 | local_irq_save(flags); | ||
222 | *(long *)v |= mask; | ||
223 | local_irq_restore(flags); | ||
224 | #endif | ||
225 | } | ||
226 | |||
227 | /* Atomic operations are already serializing on SH */ | 78 | /* Atomic operations are already serializing on SH */ |
228 | #define smp_mb__before_atomic_dec() barrier() | 79 | #define smp_mb__before_atomic_dec() barrier() |
229 | #define smp_mb__after_atomic_dec() barrier() | 80 | #define smp_mb__after_atomic_dec() barrier() |
diff --git a/include/asm-sh/bug.h b/include/asm-sh/bug.h index 1b4fc52a59e8..2f89dd06d0cd 100644 --- a/include/asm-sh/bug.h +++ b/include/asm-sh/bug.h | |||
@@ -1,19 +1,54 @@ | |||
1 | #ifndef __ASM_SH_BUG_H | 1 | #ifndef __ASM_SH_BUG_H |
2 | #define __ASM_SH_BUG_H | 2 | #define __ASM_SH_BUG_H |
3 | 3 | ||
4 | |||
5 | #ifdef CONFIG_BUG | 4 | #ifdef CONFIG_BUG |
6 | /* | 5 | |
7 | * Tell the user there is some problem. | 6 | struct bug_frame { |
8 | */ | 7 | unsigned short opcode; |
9 | #define BUG() do { \ | 8 | unsigned short line; |
10 | printk("kernel BUG at %s:%d!\n", __FILE__, __LINE__); \ | 9 | const char *file; |
11 | *(volatile int *)0 = 0; \ | 10 | const char *func; |
11 | }; | ||
12 | |||
13 | struct pt_regs; | ||
14 | |||
15 | extern void handle_BUG(struct pt_regs *); | ||
16 | |||
17 | #define TRAPA_BUG_OPCODE 0xc33e /* trapa #0x3e */ | ||
18 | |||
19 | #ifdef CONFIG_DEBUG_BUGVERBOSE | ||
20 | |||
21 | #define BUG() \ | ||
22 | do { \ | ||
23 | __asm__ __volatile__ ( \ | ||
24 | ".align 2\n\t" \ | ||
25 | ".short %O0\n\t" \ | ||
26 | ".short %O1\n\t" \ | ||
27 | ".long %O2\n\t" \ | ||
28 | ".long %O3\n\t" \ | ||
29 | : \ | ||
30 | : "n" (TRAPA_BUG_OPCODE), \ | ||
31 | "i" (__LINE__), "X" (__FILE__), \ | ||
32 | "X" (__FUNCTION__)); \ | ||
33 | } while (0) | ||
34 | |||
35 | #else | ||
36 | |||
37 | #define BUG() \ | ||
38 | do { \ | ||
39 | __asm__ __volatile__ ( \ | ||
40 | ".align 2\n\t" \ | ||
41 | ".short %O0\n\t" \ | ||
42 | : \ | ||
43 | : "n" (TRAPA_BUG_OPCODE)); \ | ||
12 | } while (0) | 44 | } while (0) |
13 | 45 | ||
46 | #endif /* CONFIG_DEBUG_BUGVERBOSE */ | ||
47 | |||
14 | #define HAVE_ARCH_BUG | 48 | #define HAVE_ARCH_BUG |
15 | #endif | 49 | |
50 | #endif /* CONFIG_BUG */ | ||
16 | 51 | ||
17 | #include <asm-generic/bug.h> | 52 | #include <asm-generic/bug.h> |
18 | 53 | ||
19 | #endif | 54 | #endif /* __ASM_SH_BUG_H */ |
diff --git a/include/asm-sh/bugs.h b/include/asm-sh/bugs.h index 795047da5e17..a294997a8412 100644 --- a/include/asm-sh/bugs.h +++ b/include/asm-sh/bugs.h | |||
@@ -16,9 +16,8 @@ | |||
16 | 16 | ||
17 | static void __init check_bugs(void) | 17 | static void __init check_bugs(void) |
18 | { | 18 | { |
19 | extern char *get_cpu_subtype(void); | ||
20 | extern unsigned long loops_per_jiffy; | 19 | extern unsigned long loops_per_jiffy; |
21 | char *p= &init_utsname()->machine[2]; /* "sh" */ | 20 | char *p = &init_utsname()->machine[2]; /* "sh" */ |
22 | 21 | ||
23 | cpu_data->loops_per_jiffy = loops_per_jiffy; | 22 | cpu_data->loops_per_jiffy = loops_per_jiffy; |
24 | 23 | ||
@@ -40,6 +39,15 @@ static void __init check_bugs(void) | |||
40 | *p++ = '4'; | 39 | *p++ = '4'; |
41 | *p++ = 'a'; | 40 | *p++ = 'a'; |
42 | break; | 41 | break; |
42 | case CPU_SH73180 ... CPU_SH7722: | ||
43 | *p++ = '4'; | ||
44 | *p++ = 'a'; | ||
45 | *p++ = 'l'; | ||
46 | *p++ = '-'; | ||
47 | *p++ = 'd'; | ||
48 | *p++ = 's'; | ||
49 | *p++ = 'p'; | ||
50 | break; | ||
43 | default: | 51 | default: |
44 | *p++ = '?'; | 52 | *p++ = '?'; |
45 | *p++ = '!'; | 53 | *p++ = '!'; |
diff --git a/include/asm-sh/checksum.h b/include/asm-sh/checksum.h index d44344c88e73..4bc8357e8892 100644 --- a/include/asm-sh/checksum.h +++ b/include/asm-sh/checksum.h | |||
@@ -34,25 +34,26 @@ asmlinkage __wsum csum_partial(const void *buff, int len, __wsum sum); | |||
34 | */ | 34 | */ |
35 | 35 | ||
36 | asmlinkage __wsum csum_partial_copy_generic(const void *src, void *dst, | 36 | asmlinkage __wsum csum_partial_copy_generic(const void *src, void *dst, |
37 | int len, __wsum sum, int *src_err_ptr, int *dst_err_ptr); | 37 | int len, __wsum sum, |
38 | int *src_err_ptr, int *dst_err_ptr); | ||
38 | 39 | ||
39 | /* | 40 | /* |
40 | * Note: when you get a NULL pointer exception here this means someone | 41 | * Note: when you get a NULL pointer exception here this means someone |
41 | * passed in an incorrect kernel address to one of these functions. | 42 | * passed in an incorrect kernel address to one of these functions. |
42 | * | 43 | * |
43 | * If you use these functions directly please don't forget the | 44 | * If you use these functions directly please don't forget the |
44 | * access_ok(). | 45 | * access_ok(). |
45 | */ | 46 | */ |
46 | static __inline__ | 47 | static inline |
47 | __wsum csum_partial_copy_nocheck(const void *src, void *dst, | 48 | __wsum csum_partial_copy_nocheck(const void *src, void *dst, |
48 | int len, __wsum sum) | 49 | int len, __wsum sum) |
49 | { | 50 | { |
50 | return csum_partial_copy_generic ( src, dst, len, sum, NULL, NULL); | 51 | return csum_partial_copy_generic(src, dst, len, sum, NULL, NULL); |
51 | } | 52 | } |
52 | 53 | ||
53 | static __inline__ | 54 | static inline |
54 | __wsum csum_partial_copy_from_user(const void __user *src, void *dst, | 55 | __wsum csum_partial_copy_from_user(const void __user *src, void *dst, |
55 | int len, __wsum sum, int *err_ptr) | 56 | int len, __wsum sum, int *err_ptr) |
56 | { | 57 | { |
57 | return csum_partial_copy_generic((__force const void *)src, dst, | 58 | return csum_partial_copy_generic((__force const void *)src, dst, |
58 | len, sum, err_ptr, NULL); | 59 | len, sum, err_ptr, NULL); |
@@ -62,7 +63,7 @@ __wsum csum_partial_copy_from_user(const void __user *src, void *dst, | |||
62 | * Fold a partial checksum | 63 | * Fold a partial checksum |
63 | */ | 64 | */ |
64 | 65 | ||
65 | static __inline__ __sum16 csum_fold(__wsum sum) | 66 | static inline __sum16 csum_fold(__wsum sum) |
66 | { | 67 | { |
67 | unsigned int __dummy; | 68 | unsigned int __dummy; |
68 | __asm__("swap.w %0, %1\n\t" | 69 | __asm__("swap.w %0, %1\n\t" |
@@ -85,7 +86,7 @@ static __inline__ __sum16 csum_fold(__wsum sum) | |||
85 | * i386 version by Jorge Cwik <jorge@laser.satlink.net>, adapted | 86 | * i386 version by Jorge Cwik <jorge@laser.satlink.net>, adapted |
86 | * for linux by * Arnt Gulbrandsen. | 87 | * for linux by * Arnt Gulbrandsen. |
87 | */ | 88 | */ |
88 | static __inline__ __sum16 ip_fast_csum(const void *iph, unsigned int ihl) | 89 | static inline __sum16 ip_fast_csum(const void *iph, unsigned int ihl) |
89 | { | 90 | { |
90 | unsigned int sum, __dummy0, __dummy1; | 91 | unsigned int sum, __dummy0, __dummy1; |
91 | 92 | ||
@@ -113,10 +114,10 @@ static __inline__ __sum16 ip_fast_csum(const void *iph, unsigned int ihl) | |||
113 | return csum_fold(sum); | 114 | return csum_fold(sum); |
114 | } | 115 | } |
115 | 116 | ||
116 | static __inline__ __wsum csum_tcpudp_nofold(__be32 saddr, __be32 daddr, | 117 | static inline __wsum csum_tcpudp_nofold(__be32 saddr, __be32 daddr, |
117 | unsigned short len, | 118 | unsigned short len, |
118 | unsigned short proto, | 119 | unsigned short proto, |
119 | __wsum sum) | 120 | __wsum sum) |
120 | { | 121 | { |
121 | #ifdef __LITTLE_ENDIAN__ | 122 | #ifdef __LITTLE_ENDIAN__ |
122 | unsigned long len_proto = (proto + len) << 8; | 123 | unsigned long len_proto = (proto + len) << 8; |
@@ -132,6 +133,7 @@ static __inline__ __wsum csum_tcpudp_nofold(__be32 saddr, __be32 daddr, | |||
132 | : "=r" (sum), "=r" (len_proto) | 133 | : "=r" (sum), "=r" (len_proto) |
133 | : "r" (daddr), "r" (saddr), "1" (len_proto), "0" (sum) | 134 | : "r" (daddr), "r" (saddr), "1" (len_proto), "0" (sum) |
134 | : "t"); | 135 | : "t"); |
136 | |||
135 | return sum; | 137 | return sum; |
136 | } | 138 | } |
137 | 139 | ||
@@ -139,30 +141,28 @@ static __inline__ __wsum csum_tcpudp_nofold(__be32 saddr, __be32 daddr, | |||
139 | * computes the checksum of the TCP/UDP pseudo-header | 141 | * computes the checksum of the TCP/UDP pseudo-header |
140 | * returns a 16-bit checksum, already complemented | 142 | * returns a 16-bit checksum, already complemented |
141 | */ | 143 | */ |
142 | static __inline__ __sum16 csum_tcpudp_magic(__be32 saddr, __be32 daddr, | 144 | static inline __sum16 csum_tcpudp_magic(__be32 saddr, __be32 daddr, |
143 | unsigned short len, | 145 | unsigned short len, |
144 | unsigned short proto, | 146 | unsigned short proto, |
145 | __wsum sum) | 147 | __wsum sum) |
146 | { | 148 | { |
147 | return csum_fold(csum_tcpudp_nofold(saddr,daddr,len,proto,sum)); | 149 | return csum_fold(csum_tcpudp_nofold(saddr, daddr, len, proto, sum)); |
148 | } | 150 | } |
149 | 151 | ||
150 | /* | 152 | /* |
151 | * this routine is used for miscellaneous IP-like checksums, mainly | 153 | * this routine is used for miscellaneous IP-like checksums, mainly |
152 | * in icmp.c | 154 | * in icmp.c |
153 | */ | 155 | */ |
154 | 156 | static inline __sum16 ip_compute_csum(const void *buff, int len) | |
155 | static __inline__ __sum16 ip_compute_csum(const void *buff, int len) | ||
156 | { | 157 | { |
157 | return csum_fold (csum_partial(buff, len, 0)); | 158 | return csum_fold(csum_partial(buff, len, 0)); |
158 | } | 159 | } |
159 | 160 | ||
160 | #define _HAVE_ARCH_IPV6_CSUM | 161 | #define _HAVE_ARCH_IPV6_CSUM |
161 | #ifdef CONFIG_IPV6 | 162 | static inline __sum16 csum_ipv6_magic(const struct in6_addr *saddr, |
162 | static __inline__ __sum16 csum_ipv6_magic(const struct in6_addr *saddr, | 163 | const struct in6_addr *daddr, |
163 | const struct in6_addr *daddr, | 164 | __u32 len, unsigned short proto, |
164 | __u32 len, unsigned short proto, | 165 | __wsum sum) |
165 | __wsum sum) | ||
166 | { | 166 | { |
167 | unsigned int __dummy; | 167 | unsigned int __dummy; |
168 | __asm__("clrt\n\t" | 168 | __asm__("clrt\n\t" |
@@ -187,22 +187,21 @@ static __inline__ __sum16 csum_ipv6_magic(const struct in6_addr *saddr, | |||
187 | "movt %1\n\t" | 187 | "movt %1\n\t" |
188 | "add %1, %0\n" | 188 | "add %1, %0\n" |
189 | : "=r" (sum), "=&r" (__dummy) | 189 | : "=r" (sum), "=&r" (__dummy) |
190 | : "r" (saddr), "r" (daddr), | 190 | : "r" (saddr), "r" (daddr), |
191 | "r" (htonl(len)), "r" (htonl(proto)), "0" (sum) | 191 | "r" (htonl(len)), "r" (htonl(proto)), "0" (sum) |
192 | : "t"); | 192 | : "t"); |
193 | 193 | ||
194 | return csum_fold(sum); | 194 | return csum_fold(sum); |
195 | } | 195 | } |
196 | #endif | ||
197 | 196 | ||
198 | /* | 197 | /* |
199 | * Copy and checksum to user | 198 | * Copy and checksum to user |
200 | */ | 199 | */ |
201 | #define HAVE_CSUM_COPY_USER | 200 | #define HAVE_CSUM_COPY_USER |
202 | static __inline__ __wsum csum_and_copy_to_user (const void *src, | 201 | static inline __wsum csum_and_copy_to_user(const void *src, |
203 | void __user *dst, | 202 | void __user *dst, |
204 | int len, __wsum sum, | 203 | int len, __wsum sum, |
205 | int *err_ptr) | 204 | int *err_ptr) |
206 | { | 205 | { |
207 | if (access_ok(VERIFY_WRITE, dst, len)) | 206 | if (access_ok(VERIFY_WRITE, dst, len)) |
208 | return csum_partial_copy_generic((__force const void *)src, | 207 | return csum_partial_copy_generic((__force const void *)src, |
diff --git a/include/asm-sh/cpu-sh4/cache.h b/include/asm-sh/cpu-sh4/cache.h index 6e9c7e6ee8e4..f92b20a0983d 100644 --- a/include/asm-sh/cpu-sh4/cache.h +++ b/include/asm-sh/cpu-sh4/cache.h | |||
@@ -22,7 +22,7 @@ | |||
22 | #define CCR_CACHE_ICE 0x0100 /* Instruction Cache Enable */ | 22 | #define CCR_CACHE_ICE 0x0100 /* Instruction Cache Enable */ |
23 | #define CCR_CACHE_ICI 0x0800 /* IC Invalidate */ | 23 | #define CCR_CACHE_ICI 0x0800 /* IC Invalidate */ |
24 | #define CCR_CACHE_IIX 0x8000 /* IC Index Enable */ | 24 | #define CCR_CACHE_IIX 0x8000 /* IC Index Enable */ |
25 | #ifndef CONFIG_CPU_SUBTYPE_SH7780 | 25 | #ifndef CONFIG_CPU_SH4A |
26 | #define CCR_CACHE_EMODE 0x80000000 /* EMODE Enable */ | 26 | #define CCR_CACHE_EMODE 0x80000000 /* EMODE Enable */ |
27 | #endif | 27 | #endif |
28 | 28 | ||
diff --git a/include/asm-sh/cpu-sh4/freq.h b/include/asm-sh/cpu-sh4/freq.h index ef2b9b1ae41f..602d061ca2dc 100644 --- a/include/asm-sh/cpu-sh4/freq.h +++ b/include/asm-sh/cpu-sh4/freq.h | |||
@@ -10,7 +10,7 @@ | |||
10 | #ifndef __ASM_CPU_SH4_FREQ_H | 10 | #ifndef __ASM_CPU_SH4_FREQ_H |
11 | #define __ASM_CPU_SH4_FREQ_H | 11 | #define __ASM_CPU_SH4_FREQ_H |
12 | 12 | ||
13 | #if defined(CONFIG_CPU_SUBTYPE_SH73180) | 13 | #if defined(CONFIG_CPU_SUBTYPE_SH73180) || defined(CONFIG_CPU_SUBTYPE_SH7722) |
14 | #define FRQCR 0xa4150000 | 14 | #define FRQCR 0xa4150000 |
15 | #elif defined(CONFIG_CPU_SUBTYPE_SH7780) | 15 | #elif defined(CONFIG_CPU_SUBTYPE_SH7780) |
16 | #define FRQCR 0xffc80000 | 16 | #define FRQCR 0xffc80000 |
diff --git a/include/asm-sh/dma-mapping.h b/include/asm-sh/dma-mapping.h index 37ab0c131a4d..8d0867b98e05 100644 --- a/include/asm-sh/dma-mapping.h +++ b/include/asm-sh/dma-mapping.h | |||
@@ -67,7 +67,7 @@ static inline dma_addr_t dma_map_single(struct device *dev, | |||
67 | if (dev->bus == &pci_bus_type) | 67 | if (dev->bus == &pci_bus_type) |
68 | return virt_to_bus(ptr); | 68 | return virt_to_bus(ptr); |
69 | #endif | 69 | #endif |
70 | dma_cache_sync(ptr, size, dir); | 70 | dma_cache_sync(dev, ptr, size, dir); |
71 | 71 | ||
72 | return virt_to_bus(ptr); | 72 | return virt_to_bus(ptr); |
73 | } | 73 | } |
@@ -81,7 +81,7 @@ static inline int dma_map_sg(struct device *dev, struct scatterlist *sg, | |||
81 | 81 | ||
82 | for (i = 0; i < nents; i++) { | 82 | for (i = 0; i < nents; i++) { |
83 | #if !defined(CONFIG_PCI) || defined(CONFIG_SH_PCIDMA_NONCOHERENT) | 83 | #if !defined(CONFIG_PCI) || defined(CONFIG_SH_PCIDMA_NONCOHERENT) |
84 | dma_cache_sync(page_address(sg[i].page) + sg[i].offset, | 84 | dma_cache_sync(dev, page_address(sg[i].page) + sg[i].offset, |
85 | sg[i].length, dir); | 85 | sg[i].length, dir); |
86 | #endif | 86 | #endif |
87 | sg[i].dma_address = page_to_phys(sg[i].page) + sg[i].offset; | 87 | sg[i].dma_address = page_to_phys(sg[i].page) + sg[i].offset; |
@@ -112,7 +112,7 @@ static inline void dma_sync_single(struct device *dev, dma_addr_t dma_handle, | |||
112 | if (dev->bus == &pci_bus_type) | 112 | if (dev->bus == &pci_bus_type) |
113 | return; | 113 | return; |
114 | #endif | 114 | #endif |
115 | dma_cache_sync(bus_to_virt(dma_handle), size, dir); | 115 | dma_cache_sync(dev, bus_to_virt(dma_handle), size, dir); |
116 | } | 116 | } |
117 | 117 | ||
118 | static inline void dma_sync_single_range(struct device *dev, | 118 | static inline void dma_sync_single_range(struct device *dev, |
@@ -124,7 +124,7 @@ static inline void dma_sync_single_range(struct device *dev, | |||
124 | if (dev->bus == &pci_bus_type) | 124 | if (dev->bus == &pci_bus_type) |
125 | return; | 125 | return; |
126 | #endif | 126 | #endif |
127 | dma_cache_sync(bus_to_virt(dma_handle) + offset, size, dir); | 127 | dma_cache_sync(dev, bus_to_virt(dma_handle) + offset, size, dir); |
128 | } | 128 | } |
129 | 129 | ||
130 | static inline void dma_sync_sg(struct device *dev, struct scatterlist *sg, | 130 | static inline void dma_sync_sg(struct device *dev, struct scatterlist *sg, |
@@ -134,7 +134,7 @@ static inline void dma_sync_sg(struct device *dev, struct scatterlist *sg, | |||
134 | 134 | ||
135 | for (i = 0; i < nelems; i++) { | 135 | for (i = 0; i < nelems; i++) { |
136 | #if !defined(CONFIG_PCI) || defined(CONFIG_SH_PCIDMA_NONCOHERENT) | 136 | #if !defined(CONFIG_PCI) || defined(CONFIG_SH_PCIDMA_NONCOHERENT) |
137 | dma_cache_sync(page_address(sg[i].page) + sg[i].offset, | 137 | dma_cache_sync(dev, page_address(sg[i].page) + sg[i].offset, |
138 | sg[i].length, dir); | 138 | sg[i].length, dir); |
139 | #endif | 139 | #endif |
140 | sg[i].dma_address = page_to_phys(sg[i].page) + sg[i].offset; | 140 | sg[i].dma_address = page_to_phys(sg[i].page) + sg[i].offset; |
diff --git a/include/asm-sh/irq.h b/include/asm-sh/irq.h index fd576088e47e..bff965ef4b95 100644 --- a/include/asm-sh/irq.h +++ b/include/asm-sh/irq.h | |||
@@ -37,7 +37,8 @@ | |||
37 | # define ONCHIP_NR_IRQS 144 | 37 | # define ONCHIP_NR_IRQS 144 |
38 | #elif defined(CONFIG_CPU_SUBTYPE_SH7300) || \ | 38 | #elif defined(CONFIG_CPU_SUBTYPE_SH7300) || \ |
39 | defined(CONFIG_CPU_SUBTYPE_SH73180) || \ | 39 | defined(CONFIG_CPU_SUBTYPE_SH73180) || \ |
40 | defined(CONFIG_CPU_SUBTYPE_SH7343) | 40 | defined(CONFIG_CPU_SUBTYPE_SH7343) || \ |
41 | defined(CONFIG_CPU_SUBTYPE_SH7722) | ||
41 | # define ONCHIP_NR_IRQS 109 | 42 | # define ONCHIP_NR_IRQS 109 |
42 | #elif defined(CONFIG_CPU_SUBTYPE_SH7780) | 43 | #elif defined(CONFIG_CPU_SUBTYPE_SH7780) |
43 | # define ONCHIP_NR_IRQS 111 | 44 | # define ONCHIP_NR_IRQS 111 |
@@ -79,6 +80,8 @@ | |||
79 | # define OFFCHIP_NR_IRQS 16 | 80 | # define OFFCHIP_NR_IRQS 16 |
80 | #elif defined(CONFIG_SH_7343_SOLUTION_ENGINE) | 81 | #elif defined(CONFIG_SH_7343_SOLUTION_ENGINE) |
81 | # define OFFCHIP_NR_IRQS 12 | 82 | # define OFFCHIP_NR_IRQS 12 |
83 | #elif defined(CONFIG_SH_7722_SOLUTION_ENGINE) | ||
84 | # define OFFCHIP_NR_IRQS 14 | ||
82 | #elif defined(CONFIG_SH_UNKNOWN) | 85 | #elif defined(CONFIG_SH_UNKNOWN) |
83 | # define OFFCHIP_NR_IRQS 16 /* Must also be last */ | 86 | # define OFFCHIP_NR_IRQS 16 /* Must also be last */ |
84 | #else | 87 | #else |
diff --git a/include/asm-sh/pgtable.h b/include/asm-sh/pgtable.h index c84901dbd8e5..036ca2843866 100644 --- a/include/asm-sh/pgtable.h +++ b/include/asm-sh/pgtable.h | |||
@@ -508,16 +508,50 @@ struct vm_area_struct; | |||
508 | extern void update_mmu_cache(struct vm_area_struct * vma, | 508 | extern void update_mmu_cache(struct vm_area_struct * vma, |
509 | unsigned long address, pte_t pte); | 509 | unsigned long address, pte_t pte); |
510 | 510 | ||
511 | /* Encode and de-code a swap entry */ | ||
512 | /* | 511 | /* |
512 | * Encode and de-code a swap entry | ||
513 | * | ||
514 | * Constraints: | ||
515 | * _PAGE_FILE at bit 0 | ||
516 | * _PAGE_PRESENT at bit 8 | ||
517 | * _PAGE_PROTNONE at bit 9 | ||
518 | * | ||
519 | * For the normal case, we encode the swap type into bits 0:7 and the | ||
520 | * swap offset into bits 10:30. For the 64-bit PTE case, we keep the | ||
521 | * preserved bits in the low 32-bits and use the upper 32 as the swap | ||
522 | * offset (along with a 5-bit type), following the same approach as x86 | ||
523 | * PAE. This keeps the logic quite simple, and allows for a full 32 | ||
524 | * PTE_FILE_MAX_BITS, as opposed to the 29-bits we're constrained with | ||
525 | * in the pte_low case. | ||
526 | * | ||
527 | * As is evident by the Alpha code, if we ever get a 64-bit unsigned | ||
528 | * long (swp_entry_t) to match up with the 64-bit PTEs, this all becomes | ||
529 | * much cleaner.. | ||
530 | * | ||
513 | * NOTE: We should set ZEROs at the position of _PAGE_PRESENT | 531 | * NOTE: We should set ZEROs at the position of _PAGE_PRESENT |
514 | * and _PAGE_PROTNONE bits | 532 | * and _PAGE_PROTNONE bits |
515 | */ | 533 | */ |
516 | #define __swp_type(x) ((x).val & 0xff) | 534 | #ifdef CONFIG_X2TLB |
517 | #define __swp_offset(x) ((x).val >> 10) | 535 | #define __swp_type(x) ((x).val & 0x1f) |
518 | #define __swp_entry(type, offset) ((swp_entry_t) { (type) | ((offset) << 10) }) | 536 | #define __swp_offset(x) ((x).val >> 5) |
519 | #define __pte_to_swp_entry(pte) ((swp_entry_t) { pte_val(pte) >> 1 }) | 537 | #define __swp_entry(type, offset) ((swp_entry_t){ (type) | (offset) << 5}) |
520 | #define __swp_entry_to_pte(x) ((pte_t) { (x).val << 1 }) | 538 | #define __pte_to_swp_entry(pte) ((swp_entry_t){ (pte).pte_high }) |
539 | #define __swp_entry_to_pte(x) ((pte_t){ 0, (x).val }) | ||
540 | |||
541 | /* | ||
542 | * Encode and decode a nonlinear file mapping entry | ||
543 | */ | ||
544 | #define pte_to_pgoff(pte) ((pte).pte_high) | ||
545 | #define pgoff_to_pte(off) ((pte_t) { _PAGE_FILE, (off) }) | ||
546 | |||
547 | #define PTE_FILE_MAX_BITS 32 | ||
548 | #else | ||
549 | #define __swp_type(x) ((x).val & 0xff) | ||
550 | #define __swp_offset(x) ((x).val >> 10) | ||
551 | #define __swp_entry(type, offset) ((swp_entry_t){(type) | (offset) <<10}) | ||
552 | |||
553 | #define __pte_to_swp_entry(pte) ((swp_entry_t) { pte_val(pte) >> 1 }) | ||
554 | #define __swp_entry_to_pte(x) ((pte_t) { (x).val << 1 }) | ||
521 | 555 | ||
522 | /* | 556 | /* |
523 | * Encode and decode a nonlinear file mapping entry | 557 | * Encode and decode a nonlinear file mapping entry |
@@ -525,6 +559,7 @@ extern void update_mmu_cache(struct vm_area_struct * vma, | |||
525 | #define PTE_FILE_MAX_BITS 29 | 559 | #define PTE_FILE_MAX_BITS 29 |
526 | #define pte_to_pgoff(pte) (pte_val(pte) >> 1) | 560 | #define pte_to_pgoff(pte) (pte_val(pte) >> 1) |
527 | #define pgoff_to_pte(off) ((pte_t) { ((off) << 1) | _PAGE_FILE }) | 561 | #define pgoff_to_pte(off) ((pte_t) { ((off) << 1) | _PAGE_FILE }) |
562 | #endif | ||
528 | 563 | ||
529 | typedef pte_t *pte_addr_t; | 564 | typedef pte_t *pte_addr_t; |
530 | 565 | ||
diff --git a/include/asm-sh/processor.h b/include/asm-sh/processor.h index 6f1dd7ca1b1d..e29f2abb92de 100644 --- a/include/asm-sh/processor.h +++ b/include/asm-sh/processor.h | |||
@@ -27,6 +27,8 @@ | |||
27 | #define CCN_CVR 0xff000040 | 27 | #define CCN_CVR 0xff000040 |
28 | #define CCN_PRR 0xff000044 | 28 | #define CCN_PRR 0xff000044 |
29 | 29 | ||
30 | const char *get_cpu_subtype(void); | ||
31 | |||
30 | /* | 32 | /* |
31 | * CPU type and hardware bug flags. Kept separately for each CPU. | 33 | * CPU type and hardware bug flags. Kept separately for each CPU. |
32 | * | 34 | * |
@@ -52,8 +54,10 @@ enum cpu_type { | |||
52 | CPU_SH7760, CPU_ST40RA, CPU_ST40GX1, CPU_SH4_202, CPU_SH4_501, | 54 | CPU_SH7760, CPU_ST40RA, CPU_ST40GX1, CPU_SH4_202, CPU_SH4_501, |
53 | 55 | ||
54 | /* SH-4A types */ | 56 | /* SH-4A types */ |
55 | CPU_SH73180, CPU_SH7343, CPU_SH7770, CPU_SH7780, CPU_SH7781, | 57 | CPU_SH7770, CPU_SH7780, CPU_SH7781, CPU_SH7785, |
56 | CPU_SH7785, | 58 | |
59 | /* SH4AL-DSP types */ | ||
60 | CPU_SH73180, CPU_SH7343, CPU_SH7722, | ||
57 | 61 | ||
58 | /* Unknown subtype */ | 62 | /* Unknown subtype */ |
59 | CPU_SH_NONE | 63 | CPU_SH_NONE |
diff --git a/include/asm-sh/push-switch.h b/include/asm-sh/push-switch.h index dfc6bad567f0..4903f9e52dd8 100644 --- a/include/asm-sh/push-switch.h +++ b/include/asm-sh/push-switch.h | |||
@@ -4,6 +4,7 @@ | |||
4 | #include <linux/timer.h> | 4 | #include <linux/timer.h> |
5 | #include <linux/interrupt.h> | 5 | #include <linux/interrupt.h> |
6 | #include <linux/workqueue.h> | 6 | #include <linux/workqueue.h> |
7 | #include <linux/platform_device.h> | ||
7 | 8 | ||
8 | struct push_switch { | 9 | struct push_switch { |
9 | /* switch state */ | 10 | /* switch state */ |
@@ -12,6 +13,8 @@ struct push_switch { | |||
12 | struct timer_list debounce; | 13 | struct timer_list debounce; |
13 | /* workqueue */ | 14 | /* workqueue */ |
14 | struct work_struct work; | 15 | struct work_struct work; |
16 | /* platform device, for workqueue handler */ | ||
17 | struct platform_device *pdev; | ||
15 | }; | 18 | }; |
16 | 19 | ||
17 | struct push_switch_platform_info { | 20 | struct push_switch_platform_info { |
diff --git a/include/asm-sh/termbits.h b/include/asm-sh/termbits.h index 4f9822a8e7b4..f1b7b46f4e9a 100644 --- a/include/asm-sh/termbits.h +++ b/include/asm-sh/termbits.h | |||
@@ -17,6 +17,17 @@ struct termios { | |||
17 | cc_t c_cc[NCCS]; /* control characters */ | 17 | cc_t c_cc[NCCS]; /* control characters */ |
18 | }; | 18 | }; |
19 | 19 | ||
20 | struct ktermios { | ||
21 | tcflag_t c_iflag; /* input mode flags */ | ||
22 | tcflag_t c_oflag; /* output mode flags */ | ||
23 | tcflag_t c_cflag; /* control mode flags */ | ||
24 | tcflag_t c_lflag; /* local mode flags */ | ||
25 | cc_t c_line; /* line discipline */ | ||
26 | cc_t c_cc[NCCS]; /* control characters */ | ||
27 | speed_t c_ispeed; /* input speed */ | ||
28 | speed_t c_ospeed; /* output speed */ | ||
29 | }; | ||
30 | |||
20 | /* c_cc characters */ | 31 | /* c_cc characters */ |
21 | #define VINTR 0 | 32 | #define VINTR 0 |
22 | #define VQUIT 1 | 33 | #define VQUIT 1 |
diff --git a/include/asm-sparc/termbits.h b/include/asm-sparc/termbits.h index 1794d71134b7..5eb00a105d7c 100644 --- a/include/asm-sparc/termbits.h +++ b/include/asm-sparc/termbits.h | |||
@@ -31,6 +31,18 @@ struct termios { | |||
31 | #endif | 31 | #endif |
32 | }; | 32 | }; |
33 | 33 | ||
34 | struct ktermios { | ||
35 | tcflag_t c_iflag; /* input mode flags */ | ||
36 | tcflag_t c_oflag; /* output mode flags */ | ||
37 | tcflag_t c_cflag; /* control mode flags */ | ||
38 | tcflag_t c_lflag; /* local mode flags */ | ||
39 | cc_t c_line; /* line discipline */ | ||
40 | cc_t c_cc[NCCS]; /* control characters */ | ||
41 | cc_t _x_cc[2]; /* We need them to hold vmin/vtime */ | ||
42 | speed_t c_ispeed; /* input speed */ | ||
43 | speed_t c_ospeed; /* output speed */ | ||
44 | }; | ||
45 | |||
34 | /* c_cc characters */ | 46 | /* c_cc characters */ |
35 | #define VINTR 0 | 47 | #define VINTR 0 |
36 | #define VQUIT 1 | 48 | #define VQUIT 1 |
diff --git a/include/asm-sparc64/dma.h b/include/asm-sparc64/dma.h index 27f65972b3bb..93e5a062df88 100644 --- a/include/asm-sparc64/dma.h +++ b/include/asm-sparc64/dma.h | |||
@@ -152,9 +152,9 @@ extern void dvma_init(struct sbus_bus *); | |||
152 | #define DMA_MAXEND(addr) (0x01000000UL-(((unsigned long)(addr))&0x00ffffffUL)) | 152 | #define DMA_MAXEND(addr) (0x01000000UL-(((unsigned long)(addr))&0x00ffffffUL)) |
153 | 153 | ||
154 | /* Yes, I hack a lot of elisp in my spare time... */ | 154 | /* Yes, I hack a lot of elisp in my spare time... */ |
155 | #define DMA_ERROR_P(regs) (((sbus_readl((regs) + DMA_CSR) & DMA_HNDL_ERROR)) | 155 | #define DMA_ERROR_P(regs) ((sbus_readl((regs) + DMA_CSR) & DMA_HNDL_ERROR)) |
156 | #define DMA_IRQ_P(regs) (((sbus_readl((regs) + DMA_CSR)) & (DMA_HNDL_INTR | DMA_HNDL_ERROR))) | 156 | #define DMA_IRQ_P(regs) ((sbus_readl((regs) + DMA_CSR)) & (DMA_HNDL_INTR | DMA_HNDL_ERROR)) |
157 | #define DMA_WRITE_P(regs) (((sbus_readl((regs) + DMA_CSR) & DMA_ST_WRITE)) | 157 | #define DMA_WRITE_P(regs) ((sbus_readl((regs) + DMA_CSR) & DMA_ST_WRITE)) |
158 | #define DMA_OFF(__regs) \ | 158 | #define DMA_OFF(__regs) \ |
159 | do { u32 tmp = sbus_readl((__regs) + DMA_CSR); \ | 159 | do { u32 tmp = sbus_readl((__regs) + DMA_CSR); \ |
160 | tmp &= ~DMA_ENABLE; \ | 160 | tmp &= ~DMA_ENABLE; \ |
diff --git a/include/asm-sparc64/irqflags.h b/include/asm-sparc64/irqflags.h new file mode 100644 index 000000000000..024fc54d0682 --- /dev/null +++ b/include/asm-sparc64/irqflags.h | |||
@@ -0,0 +1,89 @@ | |||
1 | /* | ||
2 | * include/asm-sparc64/irqflags.h | ||
3 | * | ||
4 | * IRQ flags handling | ||
5 | * | ||
6 | * This file gets included from lowlevel asm headers too, to provide | ||
7 | * wrapped versions of the local_irq_*() APIs, based on the | ||
8 | * raw_local_irq_*() functions from the lowlevel headers. | ||
9 | */ | ||
10 | #ifndef _ASM_IRQFLAGS_H | ||
11 | #define _ASM_IRQFLAGS_H | ||
12 | |||
13 | #ifndef __ASSEMBLY__ | ||
14 | |||
15 | static inline unsigned long __raw_local_save_flags(void) | ||
16 | { | ||
17 | unsigned long flags; | ||
18 | |||
19 | __asm__ __volatile__( | ||
20 | "rdpr %%pil, %0" | ||
21 | : "=r" (flags) | ||
22 | ); | ||
23 | |||
24 | return flags; | ||
25 | } | ||
26 | |||
27 | #define raw_local_save_flags(flags) \ | ||
28 | do { (flags) = __raw_local_save_flags(); } while (0) | ||
29 | |||
30 | static inline void raw_local_irq_restore(unsigned long flags) | ||
31 | { | ||
32 | __asm__ __volatile__( | ||
33 | "wrpr %0, %%pil" | ||
34 | : /* no output */ | ||
35 | : "r" (flags) | ||
36 | : "memory" | ||
37 | ); | ||
38 | } | ||
39 | |||
40 | static inline void raw_local_irq_disable(void) | ||
41 | { | ||
42 | __asm__ __volatile__( | ||
43 | "wrpr 15, %%pil" | ||
44 | : /* no outputs */ | ||
45 | : /* no inputs */ | ||
46 | : "memory" | ||
47 | ); | ||
48 | } | ||
49 | |||
50 | static inline void raw_local_irq_enable(void) | ||
51 | { | ||
52 | __asm__ __volatile__( | ||
53 | "wrpr 0, %%pil" | ||
54 | : /* no outputs */ | ||
55 | : /* no inputs */ | ||
56 | : "memory" | ||
57 | ); | ||
58 | } | ||
59 | |||
60 | static inline int raw_irqs_disabled_flags(unsigned long flags) | ||
61 | { | ||
62 | return (flags > 0); | ||
63 | } | ||
64 | |||
65 | static inline int raw_irqs_disabled(void) | ||
66 | { | ||
67 | unsigned long flags = __raw_local_save_flags(); | ||
68 | |||
69 | return raw_irqs_disabled_flags(flags); | ||
70 | } | ||
71 | |||
72 | /* | ||
73 | * For spinlocks, etc: | ||
74 | */ | ||
75 | static inline unsigned long __raw_local_irq_save(void) | ||
76 | { | ||
77 | unsigned long flags = __raw_local_save_flags(); | ||
78 | |||
79 | raw_local_irq_disable(); | ||
80 | |||
81 | return flags; | ||
82 | } | ||
83 | |||
84 | #define raw_local_irq_save(flags) \ | ||
85 | do { (flags) = __raw_local_irq_save(); } while (0) | ||
86 | |||
87 | #endif /* (__ASSEMBLY__) */ | ||
88 | |||
89 | #endif /* !(_ASM_IRQFLAGS_H) */ | ||
diff --git a/include/asm-sparc64/kprobes.h b/include/asm-sparc64/kprobes.h index c9f5c34d318c..becc38fa06c5 100644 --- a/include/asm-sparc64/kprobes.h +++ b/include/asm-sparc64/kprobes.h | |||
@@ -13,7 +13,11 @@ typedef u32 kprobe_opcode_t; | |||
13 | #define JPROBE_ENTRY(pentry) (kprobe_opcode_t *)pentry | 13 | #define JPROBE_ENTRY(pentry) (kprobe_opcode_t *)pentry |
14 | #define arch_remove_kprobe(p) do {} while (0) | 14 | #define arch_remove_kprobe(p) do {} while (0) |
15 | #define ARCH_INACTIVE_KPROBE_COUNT 0 | 15 | #define ARCH_INACTIVE_KPROBE_COUNT 0 |
16 | #define flush_insn_slot(p) do { } while (0) | 16 | |
17 | #define flush_insn_slot(p) \ | ||
18 | do { flushi(&(p)->ainsn.insn[0]); \ | ||
19 | flushi(&(p)->ainsn.insn[1]); \ | ||
20 | } while (0) | ||
17 | 21 | ||
18 | /* Architecture specific copy of original instruction*/ | 22 | /* Architecture specific copy of original instruction*/ |
19 | struct arch_specific_insn { | 23 | struct arch_specific_insn { |
@@ -23,7 +27,7 @@ struct arch_specific_insn { | |||
23 | 27 | ||
24 | struct prev_kprobe { | 28 | struct prev_kprobe { |
25 | struct kprobe *kp; | 29 | struct kprobe *kp; |
26 | unsigned int status; | 30 | unsigned long status; |
27 | unsigned long orig_tnpc; | 31 | unsigned long orig_tnpc; |
28 | unsigned long orig_tstate_pil; | 32 | unsigned long orig_tstate_pil; |
29 | }; | 33 | }; |
@@ -33,10 +37,7 @@ struct kprobe_ctlblk { | |||
33 | unsigned long kprobe_status; | 37 | unsigned long kprobe_status; |
34 | unsigned long kprobe_orig_tnpc; | 38 | unsigned long kprobe_orig_tnpc; |
35 | unsigned long kprobe_orig_tstate_pil; | 39 | unsigned long kprobe_orig_tstate_pil; |
36 | long *jprobe_saved_esp; | ||
37 | struct pt_regs jprobe_saved_regs; | 40 | struct pt_regs jprobe_saved_regs; |
38 | struct pt_regs *jprobe_saved_regs_location; | ||
39 | struct sparc_stackf jprobe_saved_stack; | ||
40 | struct prev_kprobe prev_kprobe; | 41 | struct prev_kprobe prev_kprobe; |
41 | }; | 42 | }; |
42 | 43 | ||
diff --git a/include/asm-sparc64/rwsem.h b/include/asm-sparc64/rwsem.h index cef5e8270421..1294b7ce5d06 100644 --- a/include/asm-sparc64/rwsem.h +++ b/include/asm-sparc64/rwsem.h | |||
@@ -23,20 +23,33 @@ struct rw_semaphore { | |||
23 | signed int count; | 23 | signed int count; |
24 | spinlock_t wait_lock; | 24 | spinlock_t wait_lock; |
25 | struct list_head wait_list; | 25 | struct list_head wait_list; |
26 | #ifdef CONFIG_DEBUG_LOCK_ALLOC | ||
27 | struct lockdep_map dep_map; | ||
28 | #endif | ||
26 | }; | 29 | }; |
27 | 30 | ||
31 | #ifdef CONFIG_DEBUG_LOCK_ALLOC | ||
32 | # define __RWSEM_DEP_MAP_INIT(lockname) , .dep_map = { .name = #lockname } | ||
33 | #else | ||
34 | # define __RWSEM_DEP_MAP_INIT(lockname) | ||
35 | #endif | ||
36 | |||
28 | #define __RWSEM_INITIALIZER(name) \ | 37 | #define __RWSEM_INITIALIZER(name) \ |
29 | { RWSEM_UNLOCKED_VALUE, SPIN_LOCK_UNLOCKED, LIST_HEAD_INIT((name).wait_list) } | 38 | { RWSEM_UNLOCKED_VALUE, SPIN_LOCK_UNLOCKED, LIST_HEAD_INIT((name).wait_list) \ |
39 | __RWSEM_DEP_MAP_INIT(name) } | ||
30 | 40 | ||
31 | #define DECLARE_RWSEM(name) \ | 41 | #define DECLARE_RWSEM(name) \ |
32 | struct rw_semaphore name = __RWSEM_INITIALIZER(name) | 42 | struct rw_semaphore name = __RWSEM_INITIALIZER(name) |
33 | 43 | ||
34 | static __inline__ void init_rwsem(struct rw_semaphore *sem) | 44 | extern void __init_rwsem(struct rw_semaphore *sem, const char *name, |
35 | { | 45 | struct lock_class_key *key); |
36 | sem->count = RWSEM_UNLOCKED_VALUE; | 46 | |
37 | spin_lock_init(&sem->wait_lock); | 47 | #define init_rwsem(sem) \ |
38 | INIT_LIST_HEAD(&sem->wait_list); | 48 | do { \ |
39 | } | 49 | static struct lock_class_key __key; \ |
50 | \ | ||
51 | __init_rwsem((sem), #sem, &__key); \ | ||
52 | } while (0) | ||
40 | 53 | ||
41 | extern void __down_read(struct rw_semaphore *sem); | 54 | extern void __down_read(struct rw_semaphore *sem); |
42 | extern int __down_read_trylock(struct rw_semaphore *sem); | 55 | extern int __down_read_trylock(struct rw_semaphore *sem); |
@@ -46,6 +59,11 @@ extern void __up_read(struct rw_semaphore *sem); | |||
46 | extern void __up_write(struct rw_semaphore *sem); | 59 | extern void __up_write(struct rw_semaphore *sem); |
47 | extern void __downgrade_write(struct rw_semaphore *sem); | 60 | extern void __downgrade_write(struct rw_semaphore *sem); |
48 | 61 | ||
62 | static inline void __down_write_nested(struct rw_semaphore *sem, int subclass) | ||
63 | { | ||
64 | __down_write(sem); | ||
65 | } | ||
66 | |||
49 | static inline int rwsem_atomic_update(int delta, struct rw_semaphore *sem) | 67 | static inline int rwsem_atomic_update(int delta, struct rw_semaphore *sem) |
50 | { | 68 | { |
51 | return atomic_add_return(delta, (atomic_t *)(&sem->count)); | 69 | return atomic_add_return(delta, (atomic_t *)(&sem->count)); |
diff --git a/include/asm-sparc64/system.h b/include/asm-sparc64/system.h index a8b7432c9a70..32281acb878b 100644 --- a/include/asm-sparc64/system.h +++ b/include/asm-sparc64/system.h | |||
@@ -7,6 +7,9 @@ | |||
7 | #include <asm/visasm.h> | 7 | #include <asm/visasm.h> |
8 | 8 | ||
9 | #ifndef __ASSEMBLY__ | 9 | #ifndef __ASSEMBLY__ |
10 | |||
11 | #include <linux/irqflags.h> | ||
12 | |||
10 | /* | 13 | /* |
11 | * Sparc (general) CPU types | 14 | * Sparc (general) CPU types |
12 | */ | 15 | */ |
@@ -72,52 +75,6 @@ do { __asm__ __volatile__("ba,pt %%xcc, 1f\n\t" \ | |||
72 | 75 | ||
73 | #endif | 76 | #endif |
74 | 77 | ||
75 | #define setipl(__new_ipl) \ | ||
76 | __asm__ __volatile__("wrpr %0, %%pil" : : "r" (__new_ipl) : "memory") | ||
77 | |||
78 | #define local_irq_disable() \ | ||
79 | __asm__ __volatile__("wrpr 15, %%pil" : : : "memory") | ||
80 | |||
81 | #define local_irq_enable() \ | ||
82 | __asm__ __volatile__("wrpr 0, %%pil" : : : "memory") | ||
83 | |||
84 | #define getipl() \ | ||
85 | ({ unsigned long retval; __asm__ __volatile__("rdpr %%pil, %0" : "=r" (retval)); retval; }) | ||
86 | |||
87 | #define swap_pil(__new_pil) \ | ||
88 | ({ unsigned long retval; \ | ||
89 | __asm__ __volatile__("rdpr %%pil, %0\n\t" \ | ||
90 | "wrpr %1, %%pil" \ | ||
91 | : "=&r" (retval) \ | ||
92 | : "r" (__new_pil) \ | ||
93 | : "memory"); \ | ||
94 | retval; \ | ||
95 | }) | ||
96 | |||
97 | #define read_pil_and_cli() \ | ||
98 | ({ unsigned long retval; \ | ||
99 | __asm__ __volatile__("rdpr %%pil, %0\n\t" \ | ||
100 | "wrpr 15, %%pil" \ | ||
101 | : "=r" (retval) \ | ||
102 | : : "memory"); \ | ||
103 | retval; \ | ||
104 | }) | ||
105 | |||
106 | #define local_save_flags(flags) ((flags) = getipl()) | ||
107 | #define local_irq_save(flags) ((flags) = read_pil_and_cli()) | ||
108 | #define local_irq_restore(flags) setipl((flags)) | ||
109 | |||
110 | /* On sparc64 IRQ flags are the PIL register. A value of zero | ||
111 | * means all interrupt levels are enabled, any other value means | ||
112 | * only IRQ levels greater than that value will be received. | ||
113 | * Consequently this means that the lowest IRQ level is one. | ||
114 | */ | ||
115 | #define irqs_disabled() \ | ||
116 | ({ unsigned long flags; \ | ||
117 | local_save_flags(flags);\ | ||
118 | (flags > 0); \ | ||
119 | }) | ||
120 | |||
121 | #define nop() __asm__ __volatile__ ("nop") | 78 | #define nop() __asm__ __volatile__ ("nop") |
122 | 79 | ||
123 | #define read_barrier_depends() do { } while(0) | 80 | #define read_barrier_depends() do { } while(0) |
diff --git a/include/asm-sparc64/termbits.h b/include/asm-sparc64/termbits.h index b07715273ed4..705cd44b4173 100644 --- a/include/asm-sparc64/termbits.h +++ b/include/asm-sparc64/termbits.h | |||
@@ -33,6 +33,18 @@ struct termios { | |||
33 | #endif | 33 | #endif |
34 | }; | 34 | }; |
35 | 35 | ||
36 | struct ktermios { | ||
37 | tcflag_t c_iflag; /* input mode flags */ | ||
38 | tcflag_t c_oflag; /* output mode flags */ | ||
39 | tcflag_t c_cflag; /* control mode flags */ | ||
40 | tcflag_t c_lflag; /* local mode flags */ | ||
41 | cc_t c_line; /* line discipline */ | ||
42 | cc_t c_cc[NCCS]; /* control characters */ | ||
43 | cc_t _x_cc[2]; /* We need them to hold vmin/vtime */ | ||
44 | speed_t c_ispeed; /* input speed */ | ||
45 | speed_t c_ospeed; /* output speed */ | ||
46 | }; | ||
47 | |||
36 | /* c_cc characters */ | 48 | /* c_cc characters */ |
37 | #define VINTR 0 | 49 | #define VINTR 0 |
38 | #define VQUIT 1 | 50 | #define VQUIT 1 |
diff --git a/include/asm-sparc64/ttable.h b/include/asm-sparc64/ttable.h index f2352606a79f..c2a16e188499 100644 --- a/include/asm-sparc64/ttable.h +++ b/include/asm-sparc64/ttable.h | |||
@@ -137,10 +137,49 @@ | |||
137 | #endif | 137 | #endif |
138 | #define BREAKPOINT_TRAP TRAP(breakpoint_trap) | 138 | #define BREAKPOINT_TRAP TRAP(breakpoint_trap) |
139 | 139 | ||
140 | #ifdef CONFIG_TRACE_IRQFLAGS | ||
141 | |||
142 | #define TRAP_IRQ(routine, level) \ | ||
143 | rdpr %pil, %g2; \ | ||
144 | wrpr %g0, 15, %pil; \ | ||
145 | sethi %hi(1f-4), %g7; \ | ||
146 | ba,pt %xcc, etrap_irq; \ | ||
147 | or %g7, %lo(1f-4), %g7; \ | ||
148 | nop; \ | ||
149 | nop; \ | ||
150 | nop; \ | ||
151 | .subsection 2; \ | ||
152 | 1: call trace_hardirqs_off; \ | ||
153 | nop; \ | ||
154 | mov level, %o0; \ | ||
155 | call routine; \ | ||
156 | add %sp, PTREGS_OFF, %o1; \ | ||
157 | ba,a,pt %xcc, rtrap_irq; \ | ||
158 | .previous; | ||
159 | |||
160 | #define TICK_SMP_IRQ \ | ||
161 | rdpr %pil, %g2; \ | ||
162 | wrpr %g0, 15, %pil; \ | ||
163 | sethi %hi(1f-4), %g7; \ | ||
164 | ba,pt %xcc, etrap_irq; \ | ||
165 | or %g7, %lo(1f-4), %g7; \ | ||
166 | nop; \ | ||
167 | nop; \ | ||
168 | nop; \ | ||
169 | .subsection 2; \ | ||
170 | 1: call trace_hardirqs_off; \ | ||
171 | nop; \ | ||
172 | call smp_percpu_timer_interrupt; \ | ||
173 | add %sp, PTREGS_OFF, %o0; \ | ||
174 | ba,a,pt %xcc, rtrap_irq; \ | ||
175 | .previous; | ||
176 | |||
177 | #else | ||
178 | |||
140 | #define TRAP_IRQ(routine, level) \ | 179 | #define TRAP_IRQ(routine, level) \ |
141 | rdpr %pil, %g2; \ | 180 | rdpr %pil, %g2; \ |
142 | wrpr %g0, 15, %pil; \ | 181 | wrpr %g0, 15, %pil; \ |
143 | b,pt %xcc, etrap_irq; \ | 182 | ba,pt %xcc, etrap_irq; \ |
144 | rd %pc, %g7; \ | 183 | rd %pc, %g7; \ |
145 | mov level, %o0; \ | 184 | mov level, %o0; \ |
146 | call routine; \ | 185 | call routine; \ |
@@ -151,12 +190,14 @@ | |||
151 | rdpr %pil, %g2; \ | 190 | rdpr %pil, %g2; \ |
152 | wrpr %g0, 15, %pil; \ | 191 | wrpr %g0, 15, %pil; \ |
153 | sethi %hi(109f), %g7; \ | 192 | sethi %hi(109f), %g7; \ |
154 | b,pt %xcc, etrap_irq; \ | 193 | ba,pt %xcc, etrap_irq; \ |
155 | 109: or %g7, %lo(109b), %g7; \ | 194 | 109: or %g7, %lo(109b), %g7; \ |
156 | call smp_percpu_timer_interrupt; \ | 195 | call smp_percpu_timer_interrupt; \ |
157 | add %sp, PTREGS_OFF, %o0; \ | 196 | add %sp, PTREGS_OFF, %o0; \ |
158 | ba,a,pt %xcc, rtrap_irq; | 197 | ba,a,pt %xcc, rtrap_irq; |
159 | 198 | ||
199 | #endif | ||
200 | |||
160 | #define TRAP_IVEC TRAP_NOSAVE(do_ivec) | 201 | #define TRAP_IVEC TRAP_NOSAVE(do_ivec) |
161 | 202 | ||
162 | #define BTRAP(lvl) TRAP_ARG(bad_trap, lvl) | 203 | #define BTRAP(lvl) TRAP_ARG(bad_trap, lvl) |
diff --git a/include/asm-um/bug.h b/include/asm-um/bug.h index 1e22fa26ff06..3357c5e2468e 100644 --- a/include/asm-um/bug.h +++ b/include/asm-um/bug.h | |||
@@ -1,4 +1,6 @@ | |||
1 | #ifndef __UM_BUG_H | 1 | #ifndef __UM_BUG_H |
2 | #define __UM_BUG_H | 2 | #define __UM_BUG_H |
3 | #include <asm-generic/bug.h> | 3 | |
4 | #include <asm/arch/bug.h> | ||
5 | |||
4 | #endif | 6 | #endif |
diff --git a/include/asm-v850/termbits.h b/include/asm-v850/termbits.h index 212d4e279263..f3b433032089 100644 --- a/include/asm-v850/termbits.h +++ b/include/asm-v850/termbits.h | |||
@@ -17,6 +17,17 @@ struct termios { | |||
17 | cc_t c_cc[NCCS]; /* control characters */ | 17 | cc_t c_cc[NCCS]; /* control characters */ |
18 | }; | 18 | }; |
19 | 19 | ||
20 | struct ktermios { | ||
21 | tcflag_t c_iflag; /* input mode flags */ | ||
22 | tcflag_t c_oflag; /* output mode flags */ | ||
23 | tcflag_t c_cflag; /* control mode flags */ | ||
24 | tcflag_t c_lflag; /* local mode flags */ | ||
25 | cc_t c_line; /* line discipline */ | ||
26 | cc_t c_cc[NCCS]; /* control characters */ | ||
27 | speed_t c_ispeed; /* input speed */ | ||
28 | speed_t c_ospeed; /* output speed */ | ||
29 | }; | ||
30 | |||
20 | /* c_cc characters */ | 31 | /* c_cc characters */ |
21 | #define VINTR 0 | 32 | #define VINTR 0 |
22 | #define VQUIT 1 | 33 | #define VQUIT 1 |
diff --git a/include/asm-x86_64/bug.h b/include/asm-x86_64/bug.h index 80ac1fe966ac..682606414913 100644 --- a/include/asm-x86_64/bug.h +++ b/include/asm-x86_64/bug.h | |||
@@ -1,30 +1,30 @@ | |||
1 | #ifndef __ASM_X8664_BUG_H | 1 | #ifndef __ASM_X8664_BUG_H |
2 | #define __ASM_X8664_BUG_H 1 | 2 | #define __ASM_X8664_BUG_H 1 |
3 | 3 | ||
4 | #include <linux/stringify.h> | ||
5 | |||
6 | /* | ||
7 | * Tell the user there is some problem. The exception handler decodes | ||
8 | * this frame. | ||
9 | */ | ||
10 | struct bug_frame { | ||
11 | unsigned char ud2[2]; | ||
12 | unsigned char push; | ||
13 | signed int filename; | ||
14 | unsigned char ret; | ||
15 | unsigned short line; | ||
16 | } __attribute__((packed)); | ||
17 | |||
18 | #ifdef CONFIG_BUG | 4 | #ifdef CONFIG_BUG |
19 | #define HAVE_ARCH_BUG | 5 | #define HAVE_ARCH_BUG |
20 | /* We turn the bug frame into valid instructions to not confuse | 6 | |
21 | the disassembler. Thanks to Jan Beulich & Suresh Siddha | 7 | #ifdef CONFIG_DEBUG_BUGVERBOSE |
22 | for nice instruction selection. | 8 | #define BUG() \ |
23 | The magic numbers generate mov $64bitimm,%eax ; ret $offset. */ | 9 | do { \ |
24 | #define BUG() \ | 10 | asm volatile("1:\tud2\n" \ |
25 | asm volatile( \ | 11 | ".pushsection __bug_table,\"a\"\n" \ |
26 | "ud2 ; pushq $%c1 ; ret $%c0" :: \ | 12 | "2:\t.quad 1b, %c0\n" \ |
27 | "i"(__LINE__), "i" (__FILE__)) | 13 | "\t.word %c1, 0\n" \ |
14 | "\t.org 2b+%c2\n" \ | ||
15 | ".popsection" \ | ||
16 | : : "i" (__FILE__), "i" (__LINE__), \ | ||
17 | "i" (sizeof(struct bug_entry))); \ | ||
18 | for(;;) ; \ | ||
19 | } while(0) | ||
20 | #else | ||
21 | #define BUG() \ | ||
22 | do { \ | ||
23 | asm volatile("ud2"); \ | ||
24 | for(;;) ; \ | ||
25 | } while(0) | ||
26 | #endif | ||
27 | |||
28 | void out_of_line_bug(void); | 28 | void out_of_line_bug(void); |
29 | #else | 29 | #else |
30 | static inline void out_of_line_bug(void) { } | 30 | static inline void out_of_line_bug(void) { } |
diff --git a/include/asm-x86_64/ioctls.h b/include/asm-x86_64/ioctls.h index 62caf8b6e4e1..3fc0b15a0d7e 100644 --- a/include/asm-x86_64/ioctls.h +++ b/include/asm-x86_64/ioctls.h | |||
@@ -46,6 +46,10 @@ | |||
46 | #define TIOCSBRK 0x5427 /* BSD compatibility */ | 46 | #define TIOCSBRK 0x5427 /* BSD compatibility */ |
47 | #define TIOCCBRK 0x5428 /* BSD compatibility */ | 47 | #define TIOCCBRK 0x5428 /* BSD compatibility */ |
48 | #define TIOCGSID 0x5429 /* Return the session ID of FD */ | 48 | #define TIOCGSID 0x5429 /* Return the session ID of FD */ |
49 | #define TCGETS2 _IOR('T',0x2A, struct termios2) | ||
50 | #define TCSETS2 _IOW('T',0x2B, struct termios2) | ||
51 | #define TCSETSW2 _IOW('T',0x2C, struct termios2) | ||
52 | #define TCSETSF2 _IOW('T',0x2D, struct termios2) | ||
49 | #define TIOCGPTN _IOR('T',0x30, unsigned int) /* Get Pty Number (of pty-mux device) */ | 53 | #define TIOCGPTN _IOR('T',0x30, unsigned int) /* Get Pty Number (of pty-mux device) */ |
50 | #define TIOCSPTLCK _IOW('T',0x31, int) /* Lock/unlock Pty */ | 54 | #define TIOCSPTLCK _IOW('T',0x31, int) /* Lock/unlock Pty */ |
51 | 55 | ||
diff --git a/include/asm-x86_64/termbits.h b/include/asm-x86_64/termbits.h index bd950946e52c..6cfc3bb10c1a 100644 --- a/include/asm-x86_64/termbits.h +++ b/include/asm-x86_64/termbits.h | |||
@@ -17,6 +17,28 @@ struct termios { | |||
17 | cc_t c_cc[NCCS]; /* control characters */ | 17 | cc_t c_cc[NCCS]; /* control characters */ |
18 | }; | 18 | }; |
19 | 19 | ||
20 | struct termios2 { | ||
21 | tcflag_t c_iflag; /* input mode flags */ | ||
22 | tcflag_t c_oflag; /* output mode flags */ | ||
23 | tcflag_t c_cflag; /* control mode flags */ | ||
24 | tcflag_t c_lflag; /* local mode flags */ | ||
25 | cc_t c_line; /* line discipline */ | ||
26 | cc_t c_cc[NCCS]; /* control characters */ | ||
27 | speed_t c_ispeed; /* input speed */ | ||
28 | speed_t c_ospeed; /* output speed */ | ||
29 | }; | ||
30 | |||
31 | struct ktermios { | ||
32 | tcflag_t c_iflag; /* input mode flags */ | ||
33 | tcflag_t c_oflag; /* output mode flags */ | ||
34 | tcflag_t c_cflag; /* control mode flags */ | ||
35 | tcflag_t c_lflag; /* local mode flags */ | ||
36 | cc_t c_line; /* line discipline */ | ||
37 | cc_t c_cc[NCCS]; /* control characters */ | ||
38 | speed_t c_ispeed; /* input speed */ | ||
39 | speed_t c_ospeed; /* output speed */ | ||
40 | }; | ||
41 | |||
20 | /* c_cc characters */ | 42 | /* c_cc characters */ |
21 | #define VINTR 0 | 43 | #define VINTR 0 |
22 | #define VQUIT 1 | 44 | #define VQUIT 1 |
@@ -118,6 +140,7 @@ struct termios { | |||
118 | #define HUPCL 0002000 | 140 | #define HUPCL 0002000 |
119 | #define CLOCAL 0004000 | 141 | #define CLOCAL 0004000 |
120 | #define CBAUDEX 0010000 | 142 | #define CBAUDEX 0010000 |
143 | #define BOTHER 0010000 /* non standard rate */ | ||
121 | #define B57600 0010001 | 144 | #define B57600 0010001 |
122 | #define B115200 0010002 | 145 | #define B115200 0010002 |
123 | #define B230400 0010003 | 146 | #define B230400 0010003 |
@@ -133,10 +156,12 @@ struct termios { | |||
133 | #define B3000000 0010015 | 156 | #define B3000000 0010015 |
134 | #define B3500000 0010016 | 157 | #define B3500000 0010016 |
135 | #define B4000000 0010017 | 158 | #define B4000000 0010017 |
136 | #define CIBAUD 002003600000 /* input baud rate (not used) */ | 159 | #define CIBAUD 002003600000 /* input baud rate */ |
137 | #define CMSPAR 010000000000 /* mark or space (stick) parity */ | 160 | #define CMSPAR 010000000000 /* mark or space (stick) parity */ |
138 | #define CRTSCTS 020000000000 /* flow control */ | 161 | #define CRTSCTS 020000000000 /* flow control */ |
139 | 162 | ||
163 | #define IBSHIFT 8 /* Shift from CBAUD to CIBAUD */ | ||
164 | |||
140 | /* c_lflag bits */ | 165 | /* c_lflag bits */ |
141 | #define ISIG 0000001 | 166 | #define ISIG 0000001 |
142 | #define ICANON 0000002 | 167 | #define ICANON 0000002 |
diff --git a/include/asm-x86_64/termios.h b/include/asm-x86_64/termios.h index 041a91f7ddfb..443b225537f0 100644 --- a/include/asm-x86_64/termios.h +++ b/include/asm-x86_64/termios.h | |||
@@ -98,8 +98,10 @@ struct termio { | |||
98 | copy_to_user((termio)->c_cc, (termios)->c_cc, NCC); \ | 98 | copy_to_user((termio)->c_cc, (termios)->c_cc, NCC); \ |
99 | }) | 99 | }) |
100 | 100 | ||
101 | #define user_termios_to_kernel_termios(k, u) copy_from_user(k, u, sizeof(struct termios)) | 101 | #define user_termios_to_kernel_termios(k, u) copy_from_user(k, u, sizeof(struct termios2)) |
102 | #define kernel_termios_to_user_termios(u, k) copy_to_user(u, k, sizeof(struct termios)) | 102 | #define kernel_termios_to_user_termios(u, k) copy_to_user(u, k, sizeof(struct termios2)) |
103 | #define user_termios_to_kernel_termios_1(k, u) copy_from_user(k, u, sizeof(struct termios)) | ||
104 | #define kernel_termios_to_user_termios_1(u, k) copy_to_user(u, k, sizeof(struct termios)) | ||
103 | 105 | ||
104 | #endif /* __KERNEL__ */ | 106 | #endif /* __KERNEL__ */ |
105 | 107 | ||
diff --git a/include/asm-x86_64/topology.h b/include/asm-x86_64/topology.h index 5c8f49280dbc..2facec5914d2 100644 --- a/include/asm-x86_64/topology.h +++ b/include/asm-x86_64/topology.h | |||
@@ -47,6 +47,7 @@ extern int __node_distance(int, int); | |||
47 | .flags = SD_LOAD_BALANCE \ | 47 | .flags = SD_LOAD_BALANCE \ |
48 | | SD_BALANCE_FORK \ | 48 | | SD_BALANCE_FORK \ |
49 | | SD_BALANCE_EXEC \ | 49 | | SD_BALANCE_EXEC \ |
50 | | SD_SERIALIZE \ | ||
50 | | SD_WAKE_BALANCE, \ | 51 | | SD_WAKE_BALANCE, \ |
51 | .last_balance = jiffies, \ | 52 | .last_balance = jiffies, \ |
52 | .balance_interval = 1, \ | 53 | .balance_interval = 1, \ |
diff --git a/include/asm-xtensa/asmmacro.h b/include/asm-xtensa/asmmacro.h new file mode 100644 index 000000000000..76915cabad17 --- /dev/null +++ b/include/asm-xtensa/asmmacro.h | |||
@@ -0,0 +1,153 @@ | |||
1 | /* | ||
2 | * include/asm-xtensa/asmmacro.h | ||
3 | * | ||
4 | * This file is subject to the terms and conditions of the GNU General Public | ||
5 | * License. See the file "COPYING" in the main directory of this archive | ||
6 | * for more details. | ||
7 | * | ||
8 | * Copyright (C) 2005 Tensilica Inc. | ||
9 | */ | ||
10 | |||
11 | #ifndef _XTENSA_ASMMACRO_H | ||
12 | #define _XTENSA_ASMMACRO_H | ||
13 | |||
14 | #include <asm/variant/core.h> | ||
15 | |||
16 | /* | ||
17 | * Some little helpers for loops. Use zero-overhead-loops | ||
18 | * where applicable and if supported by the processor. | ||
19 | * | ||
20 | * __loopi ar, at, size, inc | ||
21 | * ar register initialized with the start address | ||
22 | * at scratch register used by macro | ||
23 | * size size immediate value | ||
24 | * inc increment | ||
25 | * | ||
26 | * __loops ar, as, at, inc_log2[, mask_log2][, cond][, ncond] | ||
27 | * ar register initialized with the start address | ||
28 | * as register initialized with the size | ||
29 | * at scratch register use by macro | ||
30 | * inc_log2 increment [in log2] | ||
31 | * mask_log2 mask [in log2] | ||
32 | * cond true condition (used in loop'cond') | ||
33 | * ncond false condition (used in b'ncond') | ||
34 | * | ||
35 | * __loop as | ||
36 | * restart loop. 'as' register must not have been modified! | ||
37 | * | ||
38 | * __endla ar, at, incr | ||
39 | * ar start address (modified) | ||
40 | * as scratch register used by macro | ||
41 | * inc increment | ||
42 | */ | ||
43 | |||
44 | /* | ||
45 | * loop for given size as immediate | ||
46 | */ | ||
47 | |||
48 | .macro __loopi ar, at, size, incr | ||
49 | |||
50 | #if XCHAL_HAVE_LOOPS | ||
51 | movi \at, ((\size + \incr - 1) / (\incr)) | ||
52 | loop \at, 99f | ||
53 | #else | ||
54 | addi \at, \ar, \size | ||
55 | 98: | ||
56 | #endif | ||
57 | |||
58 | .endm | ||
59 | |||
60 | /* | ||
61 | * loop for given size in register | ||
62 | */ | ||
63 | |||
64 | .macro __loops ar, as, at, incr_log2, mask_log2, cond, ncond | ||
65 | |||
66 | #if XCHAL_HAVE_LOOPS | ||
67 | .ifgt \incr_log2 - 1 | ||
68 | addi \at, \as, (1 << \incr_log2) - 1 | ||
69 | .ifnc \mask_log2, | ||
70 | extui \at, \at, \incr_log2, \mask_log2 | ||
71 | .else | ||
72 | srli \at, \at, \incr_log2 | ||
73 | .endif | ||
74 | .endif | ||
75 | loop\cond \at, 99f | ||
76 | #else | ||
77 | .ifnc \mask_log2, | ||
78 | extui \at, \as, \incr_log2, \mask_log2 | ||
79 | .else | ||
80 | .ifnc \ncond, | ||
81 | srli \at, \as, \incr_log2 | ||
82 | .endif | ||
83 | .endif | ||
84 | .ifnc \ncond, | ||
85 | b\ncond \at, 99f | ||
86 | |||
87 | .endif | ||
88 | .ifnc \mask_log2, | ||
89 | slli \at, \at, \incr_log2 | ||
90 | add \at, \ar, \at | ||
91 | .else | ||
92 | add \at, \ar, \as | ||
93 | .endif | ||
94 | #endif | ||
95 | 98: | ||
96 | |||
97 | .endm | ||
98 | |||
99 | /* | ||
100 | * loop from ar to ax | ||
101 | */ | ||
102 | |||
103 | .macro __loopt ar, as, at, incr_log2 | ||
104 | |||
105 | #if XCHAL_HAVE_LOOPS | ||
106 | sub \at, \as, \ar | ||
107 | .ifgt \incr_log2 - 1 | ||
108 | addi \at, \at, (1 << \incr_log2) - 1 | ||
109 | srli \at, \at, \incr_log2 | ||
110 | .endif | ||
111 | loop \at, 99f | ||
112 | #else | ||
113 | 98: | ||
114 | #endif | ||
115 | |||
116 | .endm | ||
117 | |||
118 | /* | ||
119 | * restart loop. registers must be unchanged | ||
120 | */ | ||
121 | |||
122 | .macro __loop as | ||
123 | |||
124 | #if XCHAL_HAVE_LOOPS | ||
125 | loop \as, 99f | ||
126 | #else | ||
127 | 98: | ||
128 | #endif | ||
129 | |||
130 | .endm | ||
131 | |||
132 | /* | ||
133 | * end of loop with no increment of the address. | ||
134 | */ | ||
135 | |||
136 | .macro __endl ar, as | ||
137 | #if !XCHAL_HAVE_LOOPS | ||
138 | bltu \ar, \as, 98b | ||
139 | #endif | ||
140 | 99: | ||
141 | .endm | ||
142 | |||
143 | /* | ||
144 | * end of loop with increment of the address. | ||
145 | */ | ||
146 | |||
147 | .macro __endla ar, as, incr | ||
148 | addi \ar, \ar, \incr | ||
149 | __endl \ar \as | ||
150 | .endm | ||
151 | |||
152 | |||
153 | #endif /* _XTENSA_ASMMACRO_H */ | ||
diff --git a/include/asm-xtensa/bug.h b/include/asm-xtensa/bug.h index 56703659b204..3e52d72712f1 100644 --- a/include/asm-xtensa/bug.h +++ b/include/asm-xtensa/bug.h | |||
@@ -13,29 +13,6 @@ | |||
13 | #ifndef _XTENSA_BUG_H | 13 | #ifndef _XTENSA_BUG_H |
14 | #define _XTENSA_BUG_H | 14 | #define _XTENSA_BUG_H |
15 | 15 | ||
16 | #include <linux/stringify.h> | 16 | #include <asm-generic/bug.h> |
17 | |||
18 | #define ILL __asm__ __volatile__ (".byte 0,0,0\n") | ||
19 | |||
20 | #ifdef CONFIG_KALLSYMS | ||
21 | # define BUG() do { \ | ||
22 | printk("kernel BUG at %s:%d!\n", __FILE__, __LINE__); \ | ||
23 | ILL; \ | ||
24 | } while (0) | ||
25 | #else | ||
26 | # define BUG() do { \ | ||
27 | printk("kernel BUG!\n"); \ | ||
28 | ILL; \ | ||
29 | } while (0) | ||
30 | #endif | ||
31 | |||
32 | #define BUG_ON(condition) do { if (unlikely((condition)!=0)) BUG(); } while(0) | ||
33 | #define PAGE_BUG(page) do { BUG(); } while (0) | ||
34 | #define WARN_ON(condition) do { \ | ||
35 | if (unlikely((condition)!=0)) { \ | ||
36 | printk ("Warning in %s at %s:%d\n", __FUNCTION__, __FILE__, __LINE__); \ | ||
37 | dump_stack(); \ | ||
38 | } \ | ||
39 | } while (0) | ||
40 | 17 | ||
41 | #endif /* _XTENSA_BUG_H */ | 18 | #endif /* _XTENSA_BUG_H */ |
diff --git a/include/asm-xtensa/byteorder.h b/include/asm-xtensa/byteorder.h index 0b1552569aae..0f540a5f4c01 100644 --- a/include/asm-xtensa/byteorder.h +++ b/include/asm-xtensa/byteorder.h | |||
@@ -11,10 +11,9 @@ | |||
11 | #ifndef _XTENSA_BYTEORDER_H | 11 | #ifndef _XTENSA_BYTEORDER_H |
12 | #define _XTENSA_BYTEORDER_H | 12 | #define _XTENSA_BYTEORDER_H |
13 | 13 | ||
14 | #include <asm/processor.h> | ||
15 | #include <asm/types.h> | 14 | #include <asm/types.h> |
16 | 15 | ||
17 | static __inline__ __const__ __u32 ___arch__swab32(__u32 x) | 16 | static __inline__ __attribute_const__ __u32 ___arch__swab32(__u32 x) |
18 | { | 17 | { |
19 | __u32 res; | 18 | __u32 res; |
20 | /* instruction sequence from Xtensa ISA release 2/2000 */ | 19 | /* instruction sequence from Xtensa ISA release 2/2000 */ |
@@ -29,7 +28,7 @@ static __inline__ __const__ __u32 ___arch__swab32(__u32 x) | |||
29 | return res; | 28 | return res; |
30 | } | 29 | } |
31 | 30 | ||
32 | static __inline__ __const__ __u16 ___arch__swab16(__u16 x) | 31 | static __inline__ __attribute_const__ __u16 ___arch__swab16(__u16 x) |
33 | { | 32 | { |
34 | /* Given that 'short' values are signed (i.e., can be negative), | 33 | /* Given that 'short' values are signed (i.e., can be negative), |
35 | * we cannot assume that the upper 16-bits of the register are | 34 | * we cannot assume that the upper 16-bits of the register are |
diff --git a/include/asm-xtensa/cache.h b/include/asm-xtensa/cache.h index 1e79c0e27460..1c4a78f29ae2 100644 --- a/include/asm-xtensa/cache.h +++ b/include/asm-xtensa/cache.h | |||
@@ -4,7 +4,6 @@ | |||
4 | * This file is subject to the terms and conditions of the GNU General Public | 4 | * This file is subject to the terms and conditions of the GNU General Public |
5 | * License. See the file "COPYING" in the main directory of this archive | 5 | * License. See the file "COPYING" in the main directory of this archive |
6 | * for more details. | 6 | * for more details. |
7 | * 2 of the License, or (at your option) any later version. | ||
8 | * | 7 | * |
9 | * (C) 2001 - 2005 Tensilica Inc. | 8 | * (C) 2001 - 2005 Tensilica Inc. |
10 | */ | 9 | */ |
@@ -12,21 +11,14 @@ | |||
12 | #ifndef _XTENSA_CACHE_H | 11 | #ifndef _XTENSA_CACHE_H |
13 | #define _XTENSA_CACHE_H | 12 | #define _XTENSA_CACHE_H |
14 | 13 | ||
15 | #include <xtensa/config/core.h> | 14 | #include <asm/variant/core.h> |
16 | 15 | ||
17 | #if XCHAL_ICACHE_SIZE > 0 | 16 | #define L1_CACHE_SHIFT XCHAL_DCACHE_LINEWIDTH |
18 | # if (XCHAL_ICACHE_SIZE % (XCHAL_ICACHE_LINESIZE*XCHAL_ICACHE_WAYS*4)) != 0 | 17 | #define L1_CACHE_BYTES XCHAL_DCACHE_LINESIZE |
19 | # error cache configuration outside expected/supported range! | 18 | #define SMP_CACHE_BYTES L1_CACHE_BYTES |
20 | # endif | ||
21 | #endif | ||
22 | 19 | ||
23 | #if XCHAL_DCACHE_SIZE > 0 | 20 | #define DCACHE_WAY_SIZE (XCHAL_DCACHE_SIZE/XCHAL_DCACHE_WAYS) |
24 | # if (XCHAL_DCACHE_SIZE % (XCHAL_DCACHE_LINESIZE*XCHAL_DCACHE_WAYS*4)) != 0 | 21 | #define ICACHE_WAY_SIZE (XCHAL_ICACHE_SIZE/XCHAL_ICACHE_WAYS) |
25 | # error cache configuration outside expected/supported range! | ||
26 | # endif | ||
27 | #endif | ||
28 | 22 | ||
29 | #define L1_CACHE_SHIFT XCHAL_CACHE_LINEWIDTH_MAX | ||
30 | #define L1_CACHE_BYTES XCHAL_CACHE_LINESIZE_MAX | ||
31 | 23 | ||
32 | #endif /* _XTENSA_CACHE_H */ | 24 | #endif /* _XTENSA_CACHE_H */ |
diff --git a/include/asm-xtensa/cacheasm.h b/include/asm-xtensa/cacheasm.h new file mode 100644 index 000000000000..2c20a58f94cd --- /dev/null +++ b/include/asm-xtensa/cacheasm.h | |||
@@ -0,0 +1,177 @@ | |||
1 | /* | ||
2 | * include/asm-xtensa/cacheasm.h | ||
3 | * | ||
4 | * This file is subject to the terms and conditions of the GNU General Public | ||
5 | * License. See the file "COPYING" in the main directory of this archive | ||
6 | * for more details. | ||
7 | * | ||
8 | * Copyright (C) 2006 Tensilica Inc. | ||
9 | */ | ||
10 | |||
11 | #include <asm/cache.h> | ||
12 | #include <asm/asmmacro.h> | ||
13 | #include <linux/stringify.h> | ||
14 | |||
15 | /* | ||
16 | * Define cache functions as macros here so that they can be used | ||
17 | * by the kernel and boot loader. We should consider moving them to a | ||
18 | * library that can be linked by both. | ||
19 | * | ||
20 | * Locking | ||
21 | * | ||
22 | * ___unlock_dcache_all | ||
23 | * ___unlock_icache_all | ||
24 | * | ||
25 | * Flush and invaldating | ||
26 | * | ||
27 | * ___flush_invalidate_dcache_{all|range|page} | ||
28 | * ___flush_dcache_{all|range|page} | ||
29 | * ___invalidate_dcache_{all|range|page} | ||
30 | * ___invalidate_icache_{all|range|page} | ||
31 | * | ||
32 | */ | ||
33 | |||
34 | .macro __loop_cache_all ar at insn size line_width | ||
35 | |||
36 | movi \ar, 0 | ||
37 | |||
38 | __loopi \ar, \at, \size, (4 << (\line_width)) | ||
39 | \insn \ar, 0 << (\line_width) | ||
40 | \insn \ar, 1 << (\line_width) | ||
41 | \insn \ar, 2 << (\line_width) | ||
42 | \insn \ar, 3 << (\line_width) | ||
43 | __endla \ar, \at, 4 << (\line_width) | ||
44 | |||
45 | .endm | ||
46 | |||
47 | |||
48 | .macro __loop_cache_range ar as at insn line_width | ||
49 | |||
50 | extui \at, \ar, 0, \line_width | ||
51 | add \as, \as, \at | ||
52 | |||
53 | __loops \ar, \as, \at, \line_width | ||
54 | \insn \ar, 0 | ||
55 | __endla \ar, \at, (1 << (\line_width)) | ||
56 | |||
57 | .endm | ||
58 | |||
59 | |||
60 | .macro __loop_cache_page ar at insn line_width | ||
61 | |||
62 | __loopi \ar, \at, PAGE_SIZE, 4 << (\line_width) | ||
63 | \insn \ar, 0 << (\line_width) | ||
64 | \insn \ar, 1 << (\line_width) | ||
65 | \insn \ar, 2 << (\line_width) | ||
66 | \insn \ar, 3 << (\line_width) | ||
67 | __endla \ar, \at, 4 << (\line_width) | ||
68 | |||
69 | .endm | ||
70 | |||
71 | |||
72 | #if XCHAL_DCACHE_LINE_LOCKABLE | ||
73 | |||
74 | .macro ___unlock_dcache_all ar at | ||
75 | |||
76 | __loop_cache_all \ar \at diu XCHAL_DCACHE_SIZE XCHAL_DCACHE_LINEWIDTH | ||
77 | |||
78 | .endm | ||
79 | |||
80 | #endif | ||
81 | |||
82 | #if XCHAL_ICACHE_LINE_LOCKABLE | ||
83 | |||
84 | .macro ___unlock_icache_all ar at | ||
85 | |||
86 | __loop_cache_all \ar \at iiu XCHAL_ICACHE_SIZE XCHAL_ICACHE_LINEWIDTH | ||
87 | |||
88 | .endm | ||
89 | #endif | ||
90 | |||
91 | .macro ___flush_invalidate_dcache_all ar at | ||
92 | |||
93 | __loop_cache_all \ar \at diwbi XCHAL_DCACHE_SIZE XCHAL_DCACHE_LINEWIDTH | ||
94 | |||
95 | .endm | ||
96 | |||
97 | |||
98 | .macro ___flush_dcache_all ar at | ||
99 | |||
100 | __loop_cache_all \ar \at diwb XCHAL_DCACHE_SIZE XCHAL_DCACHE_LINEWIDTH | ||
101 | |||
102 | .endm | ||
103 | |||
104 | |||
105 | .macro ___invalidate_dcache_all ar at | ||
106 | |||
107 | __loop_cache_all \ar \at dii __stringify(DCACHE_WAY_SIZE) \ | ||
108 | XCHAL_DCACHE_LINEWIDTH | ||
109 | |||
110 | .endm | ||
111 | |||
112 | |||
113 | .macro ___invalidate_icache_all ar at | ||
114 | |||
115 | __loop_cache_all \ar \at iii __stringify(ICACHE_WAY_SIZE) \ | ||
116 | XCHAL_ICACHE_LINEWIDTH | ||
117 | |||
118 | .endm | ||
119 | |||
120 | |||
121 | |||
122 | .macro ___flush_invalidate_dcache_range ar as at | ||
123 | |||
124 | __loop_cache_range \ar \as \at dhwbi XCHAL_DCACHE_LINEWIDTH | ||
125 | |||
126 | .endm | ||
127 | |||
128 | |||
129 | .macro ___flush_dcache_range ar as at | ||
130 | |||
131 | __loop_cache_range \ar \as \at dhwb XCHAL_DCACHE_LINEWIDTH | ||
132 | |||
133 | .endm | ||
134 | |||
135 | |||
136 | .macro ___invalidate_dcache_range ar as at | ||
137 | |||
138 | __loop_cache_range \ar \as \at dhi XCHAL_DCACHE_LINEWIDTH | ||
139 | |||
140 | .endm | ||
141 | |||
142 | |||
143 | .macro ___invalidate_icache_range ar as at | ||
144 | |||
145 | __loop_cache_range \ar \as \at ihi XCHAL_ICACHE_LINEWIDTH | ||
146 | |||
147 | .endm | ||
148 | |||
149 | |||
150 | |||
151 | .macro ___flush_invalidate_dcache_page ar as | ||
152 | |||
153 | __loop_cache_page \ar \as dhwbi XCHAL_DCACHE_LINEWIDTH | ||
154 | |||
155 | .endm | ||
156 | |||
157 | |||
158 | .macro ___flush_dcache_page ar as | ||
159 | |||
160 | __loop_cache_page \ar \as dhwb XCHAL_DCACHE_LINEWIDTH | ||
161 | |||
162 | .endm | ||
163 | |||
164 | |||
165 | .macro ___invalidate_dcache_page ar as | ||
166 | |||
167 | __loop_cache_page \ar \as dhi XCHAL_DCACHE_LINEWIDTH | ||
168 | |||
169 | .endm | ||
170 | |||
171 | |||
172 | .macro ___invalidate_icache_page ar as | ||
173 | |||
174 | __loop_cache_page \ar \as ihi XCHAL_ICACHE_LINEWIDTH | ||
175 | |||
176 | .endm | ||
177 | |||
diff --git a/include/asm-xtensa/cacheflush.h b/include/asm-xtensa/cacheflush.h index 44a36e087844..337765b629de 100644 --- a/include/asm-xtensa/cacheflush.h +++ b/include/asm-xtensa/cacheflush.h | |||
@@ -5,7 +5,7 @@ | |||
5 | * License. See the file "COPYING" in the main directory of this archive | 5 | * License. See the file "COPYING" in the main directory of this archive |
6 | * for more details. | 6 | * for more details. |
7 | * | 7 | * |
8 | * (C) 2001 - 2005 Tensilica Inc. | 8 | * (C) 2001 - 2006 Tensilica Inc. |
9 | */ | 9 | */ |
10 | 10 | ||
11 | #ifndef _XTENSA_CACHEFLUSH_H | 11 | #ifndef _XTENSA_CACHEFLUSH_H |
diff --git a/include/asm-xtensa/checksum.h b/include/asm-xtensa/checksum.h index 5435aff9a4b7..23534c60b3a4 100644 --- a/include/asm-xtensa/checksum.h +++ b/include/asm-xtensa/checksum.h | |||
@@ -12,7 +12,7 @@ | |||
12 | #define _XTENSA_CHECKSUM_H | 12 | #define _XTENSA_CHECKSUM_H |
13 | 13 | ||
14 | #include <linux/in6.h> | 14 | #include <linux/in6.h> |
15 | #include <xtensa/config/core.h> | 15 | #include <asm/variant/core.h> |
16 | 16 | ||
17 | /* | 17 | /* |
18 | * computes the checksum of a memory block at buff, length len, | 18 | * computes the checksum of a memory block at buff, length len, |
diff --git a/include/asm-xtensa/coprocessor.h b/include/asm-xtensa/coprocessor.h index 5093034723be..bd09ec02d57f 100644 --- a/include/asm-xtensa/coprocessor.h +++ b/include/asm-xtensa/coprocessor.h | |||
@@ -11,7 +11,16 @@ | |||
11 | #ifndef _XTENSA_COPROCESSOR_H | 11 | #ifndef _XTENSA_COPROCESSOR_H |
12 | #define _XTENSA_COPROCESSOR_H | 12 | #define _XTENSA_COPROCESSOR_H |
13 | 13 | ||
14 | #include <xtensa/config/core.h> | 14 | #include <asm/variant/core.h> |
15 | #include <asm/variant/tie.h> | ||
16 | |||
17 | #if !XCHAL_HAVE_CP | ||
18 | |||
19 | #define XTENSA_CP_EXTRA_OFFSET 0 | ||
20 | #define XTENSA_CP_EXTRA_ALIGN 1 /* must be a power of 2 */ | ||
21 | #define XTENSA_CP_EXTRA_SIZE 0 | ||
22 | |||
23 | #else | ||
15 | 24 | ||
16 | #define XTOFS(last_start,last_size,align) \ | 25 | #define XTOFS(last_start,last_size,align) \ |
17 | ((last_start+last_size+align-1) & -align) | 26 | ((last_start+last_size+align-1) & -align) |
@@ -67,4 +76,6 @@ extern void save_coprocessor_registers(void*, int); | |||
67 | # endif | 76 | # endif |
68 | #endif | 77 | #endif |
69 | 78 | ||
79 | #endif | ||
80 | |||
70 | #endif /* _XTENSA_COPROCESSOR_H */ | 81 | #endif /* _XTENSA_COPROCESSOR_H */ |
diff --git a/include/asm-xtensa/dma.h b/include/asm-xtensa/dma.h index db2633f67789..e30f3abf48f0 100644 --- a/include/asm-xtensa/dma.h +++ b/include/asm-xtensa/dma.h | |||
@@ -12,7 +12,6 @@ | |||
12 | #define _XTENSA_DMA_H | 12 | #define _XTENSA_DMA_H |
13 | 13 | ||
14 | #include <asm/io.h> /* need byte IO */ | 14 | #include <asm/io.h> /* need byte IO */ |
15 | #include <xtensa/config/core.h> | ||
16 | 15 | ||
17 | /* | 16 | /* |
18 | * This is only to be defined if we have PC-like DMA. | 17 | * This is only to be defined if we have PC-like DMA. |
@@ -44,7 +43,9 @@ | |||
44 | * enters another area, and virt_to_phys() may not return | 43 | * enters another area, and virt_to_phys() may not return |
45 | * the value desired). | 44 | * the value desired). |
46 | */ | 45 | */ |
47 | #define MAX_DMA_ADDRESS (PAGE_OFFSET + XCHAL_KSEG_CACHED_SIZE - 1) | 46 | |
47 | #define MAX_DMA_ADDRESS (PAGE_OFFSET + XCHAL_KIO_SIZE - 1) | ||
48 | |||
48 | 49 | ||
49 | /* Reserve and release a DMA channel */ | 50 | /* Reserve and release a DMA channel */ |
50 | extern int request_dma(unsigned int dmanr, const char * device_id); | 51 | extern int request_dma(unsigned int dmanr, const char * device_id); |
diff --git a/include/asm-xtensa/elf.h b/include/asm-xtensa/elf.h index de0667453b2e..f0f9fd8560a5 100644 --- a/include/asm-xtensa/elf.h +++ b/include/asm-xtensa/elf.h | |||
@@ -13,9 +13,8 @@ | |||
13 | #ifndef _XTENSA_ELF_H | 13 | #ifndef _XTENSA_ELF_H |
14 | #define _XTENSA_ELF_H | 14 | #define _XTENSA_ELF_H |
15 | 15 | ||
16 | #include <asm/variant/core.h> | ||
16 | #include <asm/ptrace.h> | 17 | #include <asm/ptrace.h> |
17 | #include <asm/coprocessor.h> | ||
18 | #include <xtensa/config/core.h> | ||
19 | 18 | ||
20 | /* Xtensa processor ELF architecture-magic number */ | 19 | /* Xtensa processor ELF architecture-magic number */ |
21 | 20 | ||
@@ -118,11 +117,15 @@ typedef elf_greg_t elf_gregset_t[ELF_NGREG]; | |||
118 | * using memcpy(). But we do allow space for such alignment, | 117 | * using memcpy(). But we do allow space for such alignment, |
119 | * to allow optimizations of layout and copying. | 118 | * to allow optimizations of layout and copying. |
120 | */ | 119 | */ |
121 | 120 | #if 0 | |
122 | #define TOTAL_FPREGS_SIZE \ | 121 | #define TOTAL_FPREGS_SIZE \ |
123 | (4 + XTENSA_CPE_LTABLE_SIZE + XTENSA_CP_EXTRA_SIZE) | 122 | (4 + XTENSA_CPE_LTABLE_SIZE + XTENSA_CP_EXTRA_SIZE) |
124 | #define ELF_NFPREG \ | 123 | #define ELF_NFPREG \ |
125 | ((TOTAL_FPREGS_SIZE + sizeof(elf_fpreg_t) - 1) / sizeof(elf_fpreg_t)) | 124 | ((TOTAL_FPREGS_SIZE + sizeof(elf_fpreg_t) - 1) / sizeof(elf_fpreg_t)) |
125 | #else | ||
126 | #define TOTAL_FPREGS_SIZE 0 | ||
127 | #define ELF_NFPREG 0 | ||
128 | #endif | ||
126 | 129 | ||
127 | typedef unsigned int elf_fpreg_t; | 130 | typedef unsigned int elf_fpreg_t; |
128 | typedef elf_fpreg_t elf_fpregset_t[ELF_NFPREG]; | 131 | typedef elf_fpreg_t elf_fpregset_t[ELF_NFPREG]; |
diff --git a/include/asm-xtensa/fcntl.h b/include/asm-xtensa/fcntl.h index ec066ae96caf..0609fc691b72 100644 --- a/include/asm-xtensa/fcntl.h +++ b/include/asm-xtensa/fcntl.h | |||
@@ -14,48 +14,86 @@ | |||
14 | 14 | ||
15 | /* open/fcntl - O_SYNC is only implemented on blocks devices and on files | 15 | /* open/fcntl - O_SYNC is only implemented on blocks devices and on files |
16 | located on an ext2 file system */ | 16 | located on an ext2 file system */ |
17 | #define O_APPEND 0x0008 | 17 | #define O_ACCMODE 0003 |
18 | #define O_SYNC 0x0010 | 18 | #define O_RDONLY 00 |
19 | #define O_NONBLOCK 0x0080 | 19 | #define O_WRONLY 01 |
20 | #define O_CREAT 0x0100 /* not fcntl */ | 20 | #define O_RDWR 02 |
21 | #define O_EXCL 0x0400 /* not fcntl */ | 21 | #define O_CREAT 0100 /* not fcntl */ |
22 | #define O_NOCTTY 0x0800 /* not fcntl */ | 22 | #define O_EXCL 0200 /* not fcntl */ |
23 | #define FASYNC 0x1000 /* fcntl, for BSD compatibility */ | 23 | #define O_NOCTTY 0400 /* not fcntl */ |
24 | #define O_LARGEFILE 0x2000 /* allow large file opens - currently ignored */ | 24 | #define O_TRUNC 01000 /* not fcntl */ |
25 | #define O_DIRECT 0x8000 /* direct disk access hint - currently ignored*/ | 25 | #define O_APPEND 02000 |
26 | #define O_NOATIME 0x100000 | 26 | #define O_NONBLOCK 04000 |
27 | 27 | #define O_NDELAY O_NONBLOCK | |
28 | #define F_GETLK 14 | 28 | #define O_SYNC 010000 |
29 | #define F_GETLK64 15 | 29 | #define FASYNC 020000 /* fcntl, for BSD compatibility */ |
30 | #define O_DIRECT 040000 /* direct disk access hint */ | ||
31 | #define O_LARGEFILE 0100000 | ||
32 | #define O_DIRECTORY 0200000 /* must be a directory */ | ||
33 | #define O_NOFOLLOW 0400000 /* don't follow links */ | ||
34 | #define O_NOATIME 01000000 | ||
35 | |||
36 | #define F_DUPFD 0 /* dup */ | ||
37 | #define F_GETFD 1 /* get close_on_exec */ | ||
38 | #define F_SETFD 2 /* set/clear close_on_exec */ | ||
39 | #define F_GETFL 3 /* get file->f_flags */ | ||
40 | #define F_SETFL 4 /* set file->f_flags */ | ||
41 | #define F_GETLK 5 | ||
30 | #define F_SETLK 6 | 42 | #define F_SETLK 6 |
31 | #define F_SETLKW 7 | 43 | #define F_SETLKW 7 |
32 | #define F_SETLK64 16 | ||
33 | #define F_SETLKW64 17 | ||
34 | 44 | ||
35 | #define F_SETOWN 24 /* for sockets. */ | 45 | #define F_SETOWN 8 /* for sockets. */ |
36 | #define F_GETOWN 23 /* for sockets. */ | 46 | #define F_GETOWN 9 /* for sockets. */ |
47 | #define F_SETSIG 10 /* for sockets. */ | ||
48 | #define F_GETSIG 11 /* for sockets. */ | ||
49 | |||
50 | #define F_GETLK64 12 /* using 'struct flock64' */ | ||
51 | #define F_SETLK64 13 | ||
52 | #define F_SETLKW64 14 | ||
53 | |||
54 | /* for F_[GET|SET]FL */ | ||
55 | #define FD_CLOEXEC 1 /* actually anything with low bit set goes */ | ||
56 | |||
57 | /* for posix fcntl() and lockf() */ | ||
58 | #define F_RDLCK 0 | ||
59 | #define F_WRLCK 1 | ||
60 | #define F_UNLCK 2 | ||
61 | |||
62 | /* for old implementation of bsd flock () */ | ||
63 | #define F_EXLCK 4 /* or 3 */ | ||
64 | #define F_SHLCK 8 /* or 4 */ | ||
37 | 65 | ||
38 | typedef struct flock { | 66 | /* for leases */ |
67 | #define F_INPROGRESS 16 | ||
68 | |||
69 | /* operations for bsd flock(), also used by the kernel implementation */ | ||
70 | #define LOCK_SH 1 /* shared lock */ | ||
71 | #define LOCK_EX 2 /* exclusive lock */ | ||
72 | #define LOCK_NB 4 /* or'd with one of the above to prevent | ||
73 | blocking */ | ||
74 | #define LOCK_UN 8 /* remove lock */ | ||
75 | |||
76 | #define LOCK_MAND 32 /* This is a mandatory flock */ | ||
77 | #define LOCK_READ 64 /* ... Which allows concurrent read operations */ | ||
78 | #define LOCK_WRITE 128 /* ... Which allows concurrent write operations */ | ||
79 | #define LOCK_RW 192 /* ... Which allows concurrent read & write ops */ | ||
80 | |||
81 | struct flock { | ||
39 | short l_type; | 82 | short l_type; |
40 | short l_whence; | 83 | short l_whence; |
41 | __kernel_off_t l_start; | 84 | off_t l_start; |
42 | __kernel_off_t l_len; | 85 | off_t l_len; |
43 | long l_sysid; | 86 | pid_t l_pid; |
44 | __kernel_pid_t l_pid; | 87 | }; |
45 | long pad[4]; | ||
46 | } flock_t; | ||
47 | 88 | ||
48 | struct flock64 { | 89 | struct flock64 { |
49 | short l_type; | 90 | short l_type; |
50 | short l_whence; | 91 | short l_whence; |
51 | __kernel_off_t l_start; | 92 | loff_t l_start; |
52 | __kernel_off_t l_len; | 93 | loff_t l_len; |
53 | pid_t l_pid; | 94 | pid_t l_pid; |
54 | }; | 95 | }; |
55 | 96 | ||
56 | #define HAVE_ARCH_STRUCT_FLOCK | 97 | #define F_LINUX_SPECIFIC_BASE 1024 |
57 | #define HAVE_ARCH_STRUCT_FLOCK64 | ||
58 | |||
59 | #include <asm-generic/fcntl.h> | ||
60 | 98 | ||
61 | #endif /* _XTENSA_FCNTL_H */ | 99 | #endif /* _XTENSA_FCNTL_H */ |
diff --git a/include/asm-xtensa/fixmap.h b/include/asm-xtensa/fixmap.h deleted file mode 100644 index 4423b8ad4954..000000000000 --- a/include/asm-xtensa/fixmap.h +++ /dev/null | |||
@@ -1,252 +0,0 @@ | |||
1 | /* | ||
2 | * include/asm-xtensa/fixmap.h | ||
3 | * | ||
4 | * This file is subject to the terms and conditions of the GNU General Public | ||
5 | * License. See the file "COPYING" in the main directory of this archive | ||
6 | * for more details. | ||
7 | * | ||
8 | * Copyright (C) 2001 - 2005 Tensilica Inc. | ||
9 | */ | ||
10 | |||
11 | #ifndef _XTENSA_FIXMAP_H | ||
12 | #define _XTENSA_FIXMAP_H | ||
13 | |||
14 | #include <asm/processor.h> | ||
15 | |||
16 | #ifdef CONFIG_MMU | ||
17 | |||
18 | /* | ||
19 | * Here we define all the compile-time virtual addresses. | ||
20 | */ | ||
21 | |||
22 | #if XCHAL_SEG_MAPPABLE_VADDR != 0 | ||
23 | # error "Current port requires virtual user space starting at 0" | ||
24 | #endif | ||
25 | #if XCHAL_SEG_MAPPABLE_SIZE < 0x80000000 | ||
26 | # error "Current port requires at least 0x8000000 bytes for user space" | ||
27 | #endif | ||
28 | |||
29 | /* Verify instruction/data ram/rom and xlmi don't overlay vmalloc space. */ | ||
30 | |||
31 | #define __IN_VMALLOC(addr) \ | ||
32 | (((addr) >= VMALLOC_START) && ((addr) < VMALLOC_END)) | ||
33 | #define __SPAN_VMALLOC(start,end) \ | ||
34 | (((start) < VMALLOC_START) && ((end) >= VMALLOC_END)) | ||
35 | #define INSIDE_VMALLOC(start,end) \ | ||
36 | (__IN_VMALLOC((start)) || __IN_VMALLOC(end) || __SPAN_VMALLOC((start),(end))) | ||
37 | |||
38 | #if XCHAL_NUM_INSTROM | ||
39 | # if XCHAL_NUM_INSTROM == 1 | ||
40 | # if INSIDE_VMALLOC(XCHAL_INSTROM0_VADDR,XCHAL_INSTROM0_VADDR+XCHAL_INSTROM0_SIZE) | ||
41 | # error vmalloc range conflicts with instrom0 | ||
42 | # endif | ||
43 | # endif | ||
44 | # if XCHAL_NUM_INSTROM == 2 | ||
45 | # if INSIDE_VMALLOC(XCHAL_INSTROM1_VADDR,XCHAL_INSTROM1_VADDR+XCHAL_INSTROM1_SIZE) | ||
46 | # error vmalloc range conflicts with instrom1 | ||
47 | # endif | ||
48 | # endif | ||
49 | #endif | ||
50 | |||
51 | #if XCHAL_NUM_INSTRAM | ||
52 | # if XCHAL_NUM_INSTRAM == 1 | ||
53 | # if INSIDE_VMALLOC(XCHAL_INSTRAM0_VADDR,XCHAL_INSTRAM0_VADDR+XCHAL_INSTRAM0_SIZE) | ||
54 | # error vmalloc range conflicts with instram0 | ||
55 | # endif | ||
56 | # endif | ||
57 | # if XCHAL_NUM_INSTRAM == 2 | ||
58 | # if INSIDE_VMALLOC(XCHAL_INSTRAM1_VADDR,XCHAL_INSTRAM1_VADDR+XCHAL_INSTRAM1_SIZE) | ||
59 | # error vmalloc range conflicts with instram1 | ||
60 | # endif | ||
61 | # endif | ||
62 | #endif | ||
63 | |||
64 | #if XCHAL_NUM_DATAROM | ||
65 | # if XCHAL_NUM_DATAROM == 1 | ||
66 | # if INSIDE_VMALLOC(XCHAL_DATAROM0_VADDR,XCHAL_DATAROM0_VADDR+XCHAL_DATAROM0_SIZE) | ||
67 | # error vmalloc range conflicts with datarom0 | ||
68 | # endif | ||
69 | # endif | ||
70 | # if XCHAL_NUM_DATAROM == 2 | ||
71 | # if INSIDE_VMALLOC(XCHAL_DATAROM1_VADDR,XCHAL_DATAROM1_VADDR+XCHAL_DATAROM1_SIZE) | ||
72 | # error vmalloc range conflicts with datarom1 | ||
73 | # endif | ||
74 | # endif | ||
75 | #endif | ||
76 | |||
77 | #if XCHAL_NUM_DATARAM | ||
78 | # if XCHAL_NUM_DATARAM == 1 | ||
79 | # if INSIDE_VMALLOC(XCHAL_DATARAM0_VADDR,XCHAL_DATARAM0_VADDR+XCHAL_DATARAM0_SIZE) | ||
80 | # error vmalloc range conflicts with dataram0 | ||
81 | # endif | ||
82 | # endif | ||
83 | # if XCHAL_NUM_DATARAM == 2 | ||
84 | # if INSIDE_VMALLOC(XCHAL_DATARAM1_VADDR,XCHAL_DATARAM1_VADDR+XCHAL_DATARAM1_SIZE) | ||
85 | # error vmalloc range conflicts with dataram1 | ||
86 | # endif | ||
87 | # endif | ||
88 | #endif | ||
89 | |||
90 | #if XCHAL_NUM_XLMI | ||
91 | # if XCHAL_NUM_XLMI == 1 | ||
92 | # if INSIDE_VMALLOC(XCHAL_XLMI0_VADDR,XCHAL_XLMI0_VADDR+XCHAL_XLMI0_SIZE) | ||
93 | # error vmalloc range conflicts with xlmi0 | ||
94 | # endif | ||
95 | # endif | ||
96 | # if XCHAL_NUM_XLMI == 2 | ||
97 | # if INSIDE_VMALLOC(XCHAL_XLMI1_VADDR,XCHAL_XLMI1_VADDR+XCHAL_XLMI1_SIZE) | ||
98 | # error vmalloc range conflicts with xlmi1 | ||
99 | # endif | ||
100 | # endif | ||
101 | #endif | ||
102 | |||
103 | #if (XCHAL_NUM_INSTROM > 2) || \ | ||
104 | (XCHAL_NUM_INSTRAM > 2) || \ | ||
105 | (XCHAL_NUM_DATARAM > 2) || \ | ||
106 | (XCHAL_NUM_DATAROM > 2) || \ | ||
107 | (XCHAL_NUM_XLMI > 2) | ||
108 | # error Insufficient checks on vmalloc above for more than 2 devices | ||
109 | #endif | ||
110 | |||
111 | /* | ||
112 | * USER_VM_SIZE does not necessarily equal TASK_SIZE. We bumped | ||
113 | * TASK_SIZE down to 0x4000000 to simplify the handling of windowed | ||
114 | * call instructions (currently limited to a range of 1 GByte). User | ||
115 | * tasks may very well reclaim the VM space from 0x40000000 to | ||
116 | * 0x7fffffff in the future, so we do not want the kernel becoming | ||
117 | * accustomed to having any of its stuff (e.g., page tables) in this | ||
118 | * region. This VM region is no-man's land for now. | ||
119 | */ | ||
120 | |||
121 | #define USER_VM_START XCHAL_SEG_MAPPABLE_VADDR | ||
122 | #define USER_VM_SIZE 0x80000000 | ||
123 | |||
124 | /* Size of page table: */ | ||
125 | |||
126 | #define PGTABLE_SIZE_BITS (32 - XCHAL_MMU_MIN_PTE_PAGE_SIZE + 2) | ||
127 | #define PGTABLE_SIZE (1L << PGTABLE_SIZE_BITS) | ||
128 | |||
129 | /* All kernel-mappable space: */ | ||
130 | |||
131 | #define KERNEL_ALLMAP_START (USER_VM_START + USER_VM_SIZE) | ||
132 | #define KERNEL_ALLMAP_SIZE (XCHAL_SEG_MAPPABLE_SIZE - KERNEL_ALLMAP_START) | ||
133 | |||
134 | /* Carve out page table at start of kernel-mappable area: */ | ||
135 | |||
136 | #if KERNEL_ALLMAP_SIZE < PGTABLE_SIZE | ||
137 | #error "Gimme some space for page table!" | ||
138 | #endif | ||
139 | #define PGTABLE_START KERNEL_ALLMAP_START | ||
140 | |||
141 | /* Remaining kernel-mappable space: */ | ||
142 | |||
143 | #define KERNEL_MAPPED_START (KERNEL_ALLMAP_START + PGTABLE_SIZE) | ||
144 | #define KERNEL_MAPPED_SIZE (KERNEL_ALLMAP_SIZE - PGTABLE_SIZE) | ||
145 | |||
146 | #if KERNEL_MAPPED_SIZE < 0x01000000 /* 16 MB is arbitrary for now */ | ||
147 | # error "Shouldn't the kernel have at least *some* mappable space?" | ||
148 | #endif | ||
149 | |||
150 | #define MAX_LOW_MEMORY XCHAL_KSEG_CACHED_SIZE | ||
151 | |||
152 | #endif | ||
153 | |||
154 | /* | ||
155 | * Some constants used elsewhere, but perhaps only in Xtensa header | ||
156 | * files, so maybe we can get rid of some and access compile-time HAL | ||
157 | * directly... | ||
158 | * | ||
159 | * Note: We assume that system RAM is located at the very start of the | ||
160 | * kernel segments !! | ||
161 | */ | ||
162 | #define KERNEL_VM_LOW XCHAL_KSEG_CACHED_VADDR | ||
163 | #define KERNEL_VM_HIGH XCHAL_KSEG_BYPASS_VADDR | ||
164 | #define KERNEL_SPACE XCHAL_KSEG_CACHED_VADDR | ||
165 | |||
166 | /* | ||
167 | * Returns the physical/virtual addresses of the kernel space | ||
168 | * (works with the cached kernel segment only, which is the | ||
169 | * one normally used for kernel operation). | ||
170 | */ | ||
171 | |||
172 | /* PHYSICAL BYPASS CACHED | ||
173 | * | ||
174 | * bypass vaddr bypass paddr * cached vaddr | ||
175 | * cached vaddr cached paddr bypass vaddr * | ||
176 | * bypass paddr * bypass vaddr cached vaddr | ||
177 | * cached paddr * bypass vaddr cached vaddr | ||
178 | * other * * * | ||
179 | */ | ||
180 | |||
181 | #define PHYSADDR(a) \ | ||
182 | (((unsigned)(a) >= XCHAL_KSEG_BYPASS_VADDR \ | ||
183 | && (unsigned)(a) < XCHAL_KSEG_BYPASS_VADDR + XCHAL_KSEG_BYPASS_SIZE) ? \ | ||
184 | (unsigned)(a) - XCHAL_KSEG_BYPASS_VADDR + XCHAL_KSEG_BYPASS_PADDR : \ | ||
185 | ((unsigned)(a) >= XCHAL_KSEG_CACHED_VADDR \ | ||
186 | && (unsigned)(a) < XCHAL_KSEG_CACHED_VADDR + XCHAL_KSEG_CACHED_SIZE) ? \ | ||
187 | (unsigned)(a) - XCHAL_KSEG_CACHED_VADDR + XCHAL_KSEG_CACHED_PADDR : \ | ||
188 | (unsigned)(a)) | ||
189 | |||
190 | #define BYPASS_ADDR(a) \ | ||
191 | (((unsigned)(a) >= XCHAL_KSEG_BYPASS_PADDR \ | ||
192 | && (unsigned)(a) < XCHAL_KSEG_BYPASS_PADDR + XCHAL_KSEG_BYPASS_SIZE) ? \ | ||
193 | (unsigned)(a) - XCHAL_KSEG_BYPASS_PADDR + XCHAL_KSEG_BYPASS_VADDR : \ | ||
194 | ((unsigned)(a) >= XCHAL_KSEG_CACHED_PADDR \ | ||
195 | && (unsigned)(a) < XCHAL_KSEG_CACHED_PADDR + XCHAL_KSEG_CACHED_SIZE) ? \ | ||
196 | (unsigned)(a) - XCHAL_KSEG_CACHED_PADDR + XCHAL_KSEG_BYPASS_VADDR : \ | ||
197 | ((unsigned)(a) >= XCHAL_KSEG_CACHED_VADDR \ | ||
198 | && (unsigned)(a) < XCHAL_KSEG_CACHED_VADDR+XCHAL_KSEG_CACHED_SIZE)? \ | ||
199 | (unsigned)(a) - XCHAL_KSEG_CACHED_VADDR+XCHAL_KSEG_BYPASS_VADDR: \ | ||
200 | (unsigned)(a)) | ||
201 | |||
202 | #define CACHED_ADDR(a) \ | ||
203 | (((unsigned)(a) >= XCHAL_KSEG_BYPASS_PADDR \ | ||
204 | && (unsigned)(a) < XCHAL_KSEG_BYPASS_PADDR + XCHAL_KSEG_BYPASS_SIZE) ? \ | ||
205 | (unsigned)(a) - XCHAL_KSEG_BYPASS_PADDR + XCHAL_KSEG_CACHED_VADDR : \ | ||
206 | ((unsigned)(a) >= XCHAL_KSEG_CACHED_PADDR \ | ||
207 | && (unsigned)(a) < XCHAL_KSEG_CACHED_PADDR + XCHAL_KSEG_CACHED_SIZE) ? \ | ||
208 | (unsigned)(a) - XCHAL_KSEG_CACHED_PADDR + XCHAL_KSEG_CACHED_VADDR : \ | ||
209 | ((unsigned)(a) >= XCHAL_KSEG_BYPASS_VADDR \ | ||
210 | && (unsigned)(a) < XCHAL_KSEG_BYPASS_VADDR+XCHAL_KSEG_BYPASS_SIZE) ? \ | ||
211 | (unsigned)(a) - XCHAL_KSEG_BYPASS_VADDR+XCHAL_KSEG_CACHED_VADDR : \ | ||
212 | (unsigned)(a)) | ||
213 | |||
214 | #define PHYSADDR_IO(a) \ | ||
215 | (((unsigned)(a) >= XCHAL_KIO_BYPASS_VADDR \ | ||
216 | && (unsigned)(a) < XCHAL_KIO_BYPASS_VADDR + XCHAL_KIO_BYPASS_SIZE) ? \ | ||
217 | (unsigned)(a) - XCHAL_KIO_BYPASS_VADDR + XCHAL_KIO_BYPASS_PADDR : \ | ||
218 | ((unsigned)(a) >= XCHAL_KIO_CACHED_VADDR \ | ||
219 | && (unsigned)(a) < XCHAL_KIO_CACHED_VADDR + XCHAL_KIO_CACHED_SIZE) ? \ | ||
220 | (unsigned)(a) - XCHAL_KIO_CACHED_VADDR + XCHAL_KIO_CACHED_PADDR : \ | ||
221 | (unsigned)(a)) | ||
222 | |||
223 | #define BYPASS_ADDR_IO(a) \ | ||
224 | (((unsigned)(a) >= XCHAL_KIO_BYPASS_PADDR \ | ||
225 | && (unsigned)(a) < XCHAL_KIO_BYPASS_PADDR + XCHAL_KIO_BYPASS_SIZE) ? \ | ||
226 | (unsigned)(a) - XCHAL_KIO_BYPASS_PADDR + XCHAL_KIO_BYPASS_VADDR : \ | ||
227 | ((unsigned)(a) >= XCHAL_KIO_CACHED_PADDR \ | ||
228 | && (unsigned)(a) < XCHAL_KIO_CACHED_PADDR + XCHAL_KIO_CACHED_SIZE) ? \ | ||
229 | (unsigned)(a) - XCHAL_KIO_CACHED_PADDR + XCHAL_KIO_BYPASS_VADDR : \ | ||
230 | ((unsigned)(a) >= XCHAL_KIO_CACHED_VADDR \ | ||
231 | && (unsigned)(a) < XCHAL_KIO_CACHED_VADDR + XCHAL_KIO_CACHED_SIZE) ? \ | ||
232 | (unsigned)(a) - XCHAL_KIO_CACHED_VADDR + XCHAL_KIO_BYPASS_VADDR : \ | ||
233 | (unsigned)(a)) | ||
234 | |||
235 | #define CACHED_ADDR_IO(a) \ | ||
236 | (((unsigned)(a) >= XCHAL_KIO_BYPASS_PADDR \ | ||
237 | && (unsigned)(a) < XCHAL_KIO_BYPASS_PADDR + XCHAL_KIO_BYPASS_SIZE) ? \ | ||
238 | (unsigned)(a) - XCHAL_KIO_BYPASS_PADDR + XCHAL_KIO_CACHED_VADDR : \ | ||
239 | ((unsigned)(a) >= XCHAL_KIO_CACHED_PADDR \ | ||
240 | && (unsigned)(a) < XCHAL_KIO_CACHED_PADDR + XCHAL_KIO_CACHED_SIZE) ? \ | ||
241 | (unsigned)(a) - XCHAL_KIO_CACHED_PADDR + XCHAL_KIO_CACHED_VADDR : \ | ||
242 | ((unsigned)(a) >= XCHAL_KIO_BYPASS_VADDR \ | ||
243 | && (unsigned)(a) < XCHAL_KIO_BYPASS_VADDR + XCHAL_KIO_BYPASS_SIZE) ? \ | ||
244 | (unsigned)(a) - XCHAL_KIO_BYPASS_VADDR + XCHAL_KIO_CACHED_VADDR : \ | ||
245 | (unsigned)(a)) | ||
246 | |||
247 | #endif /* _XTENSA_ADDRSPACE_H */ | ||
248 | |||
249 | |||
250 | |||
251 | |||
252 | |||
diff --git a/include/asm-xtensa/io.h b/include/asm-xtensa/io.h index 556e5eed34f5..31ffc3f119c1 100644 --- a/include/asm-xtensa/io.h +++ b/include/asm-xtensa/io.h | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * linux/include/asm-xtensa/io.h | 2 | * include/asm-xtensa/io.h |
3 | * | 3 | * |
4 | * This file is subject to the terms and conditions of the GNU General Public | 4 | * This file is subject to the terms and conditions of the GNU General Public |
5 | * License. See the file "COPYING" in the main directory of this archive | 5 | * License. See the file "COPYING" in the main directory of this archive |
@@ -15,10 +15,11 @@ | |||
15 | #include <asm/byteorder.h> | 15 | #include <asm/byteorder.h> |
16 | 16 | ||
17 | #include <linux/types.h> | 17 | #include <linux/types.h> |
18 | #include <asm/fixmap.h> | ||
19 | |||
20 | #define _IO_BASE 0 | ||
21 | 18 | ||
19 | #define XCHAL_KIO_CACHED_VADDR 0xf0000000 | ||
20 | #define XCHAL_KIO_BYPASS_VADDR 0xf8000000 | ||
21 | #define XCHAL_KIO_PADDR 0xf0000000 | ||
22 | #define XCHAL_KIO_SIZE 0x08000000 | ||
22 | 23 | ||
23 | /* | 24 | /* |
24 | * swap functions to change byte order from little-endian to big-endian and | 25 | * swap functions to change byte order from little-endian to big-endian and |
@@ -42,40 +43,43 @@ static inline unsigned int _swapl (unsigned int v) | |||
42 | 43 | ||
43 | static inline unsigned long virt_to_phys(volatile void * address) | 44 | static inline unsigned long virt_to_phys(volatile void * address) |
44 | { | 45 | { |
45 | return PHYSADDR((unsigned long)address); | 46 | return __pa(address); |
46 | } | 47 | } |
47 | 48 | ||
48 | static inline void * phys_to_virt(unsigned long address) | 49 | static inline void * phys_to_virt(unsigned long address) |
49 | { | 50 | { |
50 | return (void*) CACHED_ADDR(address); | 51 | return __va(address); |
51 | } | 52 | } |
52 | 53 | ||
53 | /* | 54 | /* |
54 | * IO bus memory addresses are also 1:1 with the physical address | 55 | * virt_to_bus and bus_to_virt are deprecated. |
55 | */ | 56 | */ |
56 | 57 | ||
57 | static inline unsigned long virt_to_bus(volatile void * address) | 58 | #define virt_to_bus(x) virt_to_phys(x) |
58 | { | 59 | #define bus_to_virt(x) phys_to_virt(x) |
59 | return PHYSADDR((unsigned long)address); | ||
60 | } | ||
61 | |||
62 | static inline void * bus_to_virt (unsigned long address) | ||
63 | { | ||
64 | return (void *) CACHED_ADDR(address); | ||
65 | } | ||
66 | 60 | ||
67 | /* | 61 | /* |
68 | * Change "struct page" to physical address. | 62 | * Return the virtual (cached) address for the specified bus memory. |
63 | * Note that we currently don't support any address outside the KIO segment. | ||
69 | */ | 64 | */ |
70 | 65 | ||
71 | static inline void *ioremap(unsigned long offset, unsigned long size) | 66 | static inline void *ioremap(unsigned long offset, unsigned long size) |
72 | { | 67 | { |
73 | return (void *) CACHED_ADDR_IO(offset); | 68 | if (offset >= XCHAL_KIO_PADDR |
69 | && offset < XCHAL_KIO_PADDR + XCHAL_KIO_SIZE) | ||
70 | return (void*)(offset-XCHAL_KIO_PADDR+XCHAL_KIO_BYPASS_VADDR); | ||
71 | |||
72 | else | ||
73 | BUG(); | ||
74 | } | 74 | } |
75 | 75 | ||
76 | static inline void *ioremap_nocache(unsigned long offset, unsigned long size) | 76 | static inline void *ioremap_nocache(unsigned long offset, unsigned long size) |
77 | { | 77 | { |
78 | return (void *) BYPASS_ADDR_IO(offset); | 78 | if (offset >= XCHAL_KIO_PADDR |
79 | && offset < XCHAL_KIO_PADDR + XCHAL_KIO_SIZE) | ||
80 | return (void*)(offset-XCHAL_KIO_PADDR+XCHAL_KIO_CACHED_VADDR); | ||
81 | else | ||
82 | BUG(); | ||
79 | } | 83 | } |
80 | 84 | ||
81 | static inline void iounmap(void *addr) | 85 | static inline void iounmap(void *addr) |
@@ -121,9 +125,6 @@ static inline void __raw_writel(__u32 b, volatile void __iomem *addr) | |||
121 | *(__force volatile __u32 *)(addr) = b; | 125 | *(__force volatile __u32 *)(addr) = b; |
122 | } | 126 | } |
123 | 127 | ||
124 | |||
125 | |||
126 | |||
127 | /* These are the definitions for the x86 IO instructions | 128 | /* These are the definitions for the x86 IO instructions |
128 | * inb/inw/inl/outb/outw/outl, the "string" versions | 129 | * inb/inw/inl/outb/outw/outl, the "string" versions |
129 | * insb/insw/insl/outsb/outsw/outsl, and the "pausing" versions | 130 | * insb/insw/insl/outsb/outsw/outsl, and the "pausing" versions |
@@ -131,11 +132,11 @@ static inline void __raw_writel(__u32 b, volatile void __iomem *addr) | |||
131 | * The macros don't do byte-swapping. | 132 | * The macros don't do byte-swapping. |
132 | */ | 133 | */ |
133 | 134 | ||
134 | #define inb(port) readb((u8 *)((port)+_IO_BASE)) | 135 | #define inb(port) readb((u8 *)((port))) |
135 | #define outb(val, port) writeb((val),(u8 *)((unsigned long)(port)+_IO_BASE)) | 136 | #define outb(val, port) writeb((val),(u8 *)((unsigned long)(port))) |
136 | #define inw(port) readw((u16 *)((port)+_IO_BASE)) | 137 | #define inw(port) readw((u16 *)((port))) |
137 | #define outw(val, port) writew((val),(u16 *)((unsigned long)(port)+_IO_BASE)) | 138 | #define outw(val, port) writew((val),(u16 *)((unsigned long)(port))) |
138 | #define inl(port) readl((u32 *)((port)+_IO_BASE)) | 139 | #define inl(port) readl((u32 *)((port))) |
139 | #define outl(val, port) writel((val),(u32 *)((unsigned long)(port))) | 140 | #define outl(val, port) writel((val),(u32 *)((unsigned long)(port))) |
140 | 141 | ||
141 | #define inb_p(port) inb((port)) | 142 | #define inb_p(port) inb((port)) |
@@ -180,14 +181,13 @@ extern void outsl (unsigned long port, const void *src, unsigned long count); | |||
180 | 181 | ||
181 | 182 | ||
182 | /* | 183 | /* |
183 | * * Convert a physical pointer to a virtual kernel pointer for /dev/mem | 184 | * Convert a physical pointer to a virtual kernel pointer for /dev/mem access |
184 | * * access | 185 | */ |
185 | * */ | ||
186 | #define xlate_dev_mem_ptr(p) __va(p) | 186 | #define xlate_dev_mem_ptr(p) __va(p) |
187 | 187 | ||
188 | /* | 188 | /* |
189 | * * Convert a virtual cached pointer to an uncached pointer | 189 | * Convert a virtual cached pointer to an uncached pointer |
190 | * */ | 190 | */ |
191 | #define xlate_dev_kmem_ptr(p) p | 191 | #define xlate_dev_kmem_ptr(p) p |
192 | 192 | ||
193 | 193 | ||
diff --git a/include/asm-xtensa/irq.h b/include/asm-xtensa/irq.h index 049fde7e752d..fc73b7f11aff 100644 --- a/include/asm-xtensa/irq.h +++ b/include/asm-xtensa/irq.h | |||
@@ -12,8 +12,7 @@ | |||
12 | #define _XTENSA_IRQ_H | 12 | #define _XTENSA_IRQ_H |
13 | 13 | ||
14 | #include <asm/platform/hardware.h> | 14 | #include <asm/platform/hardware.h> |
15 | 15 | #include <asm/variant/core.h> | |
16 | #include <xtensa/config/core.h> | ||
17 | 16 | ||
18 | #ifndef PLATFORM_NR_IRQS | 17 | #ifndef PLATFORM_NR_IRQS |
19 | # define PLATFORM_NR_IRQS 0 | 18 | # define PLATFORM_NR_IRQS 0 |
@@ -27,10 +26,5 @@ static __inline__ int irq_canonicalize(int irq) | |||
27 | } | 26 | } |
28 | 27 | ||
29 | struct irqaction; | 28 | struct irqaction; |
30 | #if 0 // FIXME | ||
31 | extern void disable_irq_nosync(unsigned int); | ||
32 | extern void disable_irq(unsigned int); | ||
33 | extern void enable_irq(unsigned int); | ||
34 | #endif | ||
35 | 29 | ||
36 | #endif /* _XTENSA_IRQ_H */ | 30 | #endif /* _XTENSA_IRQ_H */ |
diff --git a/include/asm-xtensa/irq_regs.h b/include/asm-xtensa/irq_regs.h new file mode 100644 index 000000000000..3dd9c0b70270 --- /dev/null +++ b/include/asm-xtensa/irq_regs.h | |||
@@ -0,0 +1 @@ | |||
#include <asm-generic/irq_regs.h> | |||
diff --git a/include/asm-xtensa/mmu_context.h b/include/asm-xtensa/mmu_context.h index af683a74a4ec..f14851f086c3 100644 --- a/include/asm-xtensa/mmu_context.h +++ b/include/asm-xtensa/mmu_context.h | |||
@@ -16,187 +16,32 @@ | |||
16 | #include <linux/stringify.h> | 16 | #include <linux/stringify.h> |
17 | 17 | ||
18 | #include <asm/pgtable.h> | 18 | #include <asm/pgtable.h> |
19 | #include <asm/mmu_context.h> | ||
20 | #include <asm/cacheflush.h> | 19 | #include <asm/cacheflush.h> |
21 | #include <asm/tlbflush.h> | 20 | #include <asm/tlbflush.h> |
22 | 21 | ||
23 | /* | 22 | #define XCHAL_MMU_ASID_BITS 8 |
24 | * Linux was ported to Xtensa assuming all auto-refill ways in set 0 | ||
25 | * had the same properties (a very likely assumption). Multiple sets | ||
26 | * of auto-refill ways will still work properly, but not as optimally | ||
27 | * as the Xtensa designer may have assumed. | ||
28 | * | ||
29 | * We make this case a hard #error, killing the kernel build, to alert | ||
30 | * the developer to this condition (which is more likely an error). | ||
31 | * You super-duper clever developers can change it to a warning or | ||
32 | * remove it altogether if you think you know what you're doing. :) | ||
33 | */ | ||
34 | 23 | ||
35 | #if (XCHAL_HAVE_TLBS != 1) | 24 | #if (XCHAL_HAVE_TLBS != 1) |
36 | # error "Linux must have an MMU!" | 25 | # error "Linux must have an MMU!" |
37 | #endif | 26 | #endif |
38 | 27 | ||
39 | #if ((XCHAL_ITLB_ARF_WAYS == 0) || (XCHAL_DTLB_ARF_WAYS == 0)) | ||
40 | # error "MMU must have auto-refill ways" | ||
41 | #endif | ||
42 | |||
43 | #if ((XCHAL_ITLB_ARF_SETS != 1) || (XCHAL_DTLB_ARF_SETS != 1)) | ||
44 | # error Linux may not use all auto-refill ways as efficiently as you think | ||
45 | #endif | ||
46 | |||
47 | #if (XCHAL_MMU_MAX_PTE_PAGE_SIZE != XCHAL_MMU_MIN_PTE_PAGE_SIZE) | ||
48 | # error Only one page size allowed! | ||
49 | #endif | ||
50 | |||
51 | extern unsigned long asid_cache; | 28 | extern unsigned long asid_cache; |
52 | extern pgd_t *current_pgd; | ||
53 | |||
54 | /* | ||
55 | * Define the number of entries per auto-refill way in set 0 of both I and D | ||
56 | * TLBs. We deal only with set 0 here (an assumption further explained in | ||
57 | * assertions.h). Also, define the total number of ARF entries in both TLBs. | ||
58 | */ | ||
59 | |||
60 | #define ITLB_ENTRIES_PER_ARF_WAY (XCHAL_ITLB_SET(XCHAL_ITLB_ARF_SET0,ENTRIES)) | ||
61 | #define DTLB_ENTRIES_PER_ARF_WAY (XCHAL_DTLB_SET(XCHAL_DTLB_ARF_SET0,ENTRIES)) | ||
62 | |||
63 | #define ITLB_ENTRIES \ | ||
64 | (ITLB_ENTRIES_PER_ARF_WAY * (XCHAL_ITLB_SET(XCHAL_ITLB_ARF_SET0,WAYS))) | ||
65 | #define DTLB_ENTRIES \ | ||
66 | (DTLB_ENTRIES_PER_ARF_WAY * (XCHAL_DTLB_SET(XCHAL_DTLB_ARF_SET0,WAYS))) | ||
67 | |||
68 | |||
69 | /* | ||
70 | * SMALLEST_NTLB_ENTRIES is the smaller of ITLB_ENTRIES and DTLB_ENTRIES. | ||
71 | * In practice, they are probably equal. This macro simplifies function | ||
72 | * flush_tlb_range(). | ||
73 | */ | ||
74 | |||
75 | #if (DTLB_ENTRIES < ITLB_ENTRIES) | ||
76 | # define SMALLEST_NTLB_ENTRIES DTLB_ENTRIES | ||
77 | #else | ||
78 | # define SMALLEST_NTLB_ENTRIES ITLB_ENTRIES | ||
79 | #endif | ||
80 | |||
81 | |||
82 | /* | ||
83 | * asid_cache tracks only the ASID[USER_RING] field of the RASID special | ||
84 | * register, which is the current user-task asid allocation value. | ||
85 | * mm->context has the same meaning. When it comes time to write the | ||
86 | * asid_cache or mm->context values to the RASID special register, we first | ||
87 | * shift the value left by 8, then insert the value. | ||
88 | * ASID[0] always contains the kernel's asid value, and we reserve three | ||
89 | * other asid values that we never assign to user tasks. | ||
90 | */ | ||
91 | |||
92 | #define ASID_INC 0x1 | ||
93 | #define ASID_MASK ((1 << XCHAL_MMU_ASID_BITS) - 1) | ||
94 | |||
95 | /* | ||
96 | * XCHAL_MMU_ASID_INVALID is a configurable Xtensa processor constant | ||
97 | * indicating invalid address space. XCHAL_MMU_ASID_KERNEL is a configurable | ||
98 | * Xtensa processor constant indicating the kernel address space. They can | ||
99 | * be arbitrary values. | ||
100 | * | ||
101 | * We identify three more unique, reserved ASID values to use in the unused | ||
102 | * ring positions. No other user process will be assigned these reserved | ||
103 | * ASID values. | ||
104 | * | ||
105 | * For example, given that | ||
106 | * | ||
107 | * XCHAL_MMU_ASID_INVALID == 0 | ||
108 | * XCHAL_MMU_ASID_KERNEL == 1 | ||
109 | * | ||
110 | * the following maze of #if statements would generate | ||
111 | * | ||
112 | * ASID_RESERVED_1 == 2 | ||
113 | * ASID_RESERVED_2 == 3 | ||
114 | * ASID_RESERVED_3 == 4 | ||
115 | * ASID_FIRST_NONRESERVED == 5 | ||
116 | */ | ||
117 | |||
118 | #if (XCHAL_MMU_ASID_INVALID != XCHAL_MMU_ASID_KERNEL + 1) | ||
119 | # define ASID_RESERVED_1 ((XCHAL_MMU_ASID_KERNEL + 1) & ASID_MASK) | ||
120 | #else | ||
121 | # define ASID_RESERVED_1 ((XCHAL_MMU_ASID_KERNEL + 2) & ASID_MASK) | ||
122 | #endif | ||
123 | |||
124 | #if (XCHAL_MMU_ASID_INVALID != ASID_RESERVED_1 + 1) | ||
125 | # define ASID_RESERVED_2 ((ASID_RESERVED_1 + 1) & ASID_MASK) | ||
126 | #else | ||
127 | # define ASID_RESERVED_2 ((ASID_RESERVED_1 + 2) & ASID_MASK) | ||
128 | #endif | ||
129 | |||
130 | #if (XCHAL_MMU_ASID_INVALID != ASID_RESERVED_2 + 1) | ||
131 | # define ASID_RESERVED_3 ((ASID_RESERVED_2 + 1) & ASID_MASK) | ||
132 | #else | ||
133 | # define ASID_RESERVED_3 ((ASID_RESERVED_2 + 2) & ASID_MASK) | ||
134 | #endif | ||
135 | |||
136 | #if (XCHAL_MMU_ASID_INVALID != ASID_RESERVED_3 + 1) | ||
137 | # define ASID_FIRST_NONRESERVED ((ASID_RESERVED_3 + 1) & ASID_MASK) | ||
138 | #else | ||
139 | # define ASID_FIRST_NONRESERVED ((ASID_RESERVED_3 + 2) & ASID_MASK) | ||
140 | #endif | ||
141 | |||
142 | #define ASID_ALL_RESERVED ( ((ASID_RESERVED_1) << 24) + \ | ||
143 | ((ASID_RESERVED_2) << 16) + \ | ||
144 | ((ASID_RESERVED_3) << 8) + \ | ||
145 | ((XCHAL_MMU_ASID_KERNEL)) ) | ||
146 | |||
147 | 29 | ||
148 | /* | 30 | /* |
149 | * NO_CONTEXT is the invalid ASID value that we don't ever assign to | 31 | * NO_CONTEXT is the invalid ASID value that we don't ever assign to |
150 | * any user or kernel context. NO_CONTEXT is a better mnemonic than | 32 | * any user or kernel context. |
151 | * XCHAL_MMU_ASID_INVALID, so we use it in code instead. | 33 | * |
152 | */ | 34 | * 0 invalid |
153 | 35 | * 1 kernel | |
154 | #define NO_CONTEXT XCHAL_MMU_ASID_INVALID | 36 | * 2 reserved |
155 | 37 | * 3 reserved | |
156 | #if (KERNEL_RING != 0) | 38 | * 4...255 available |
157 | # error The KERNEL_RING really should be zero. | ||
158 | #endif | ||
159 | |||
160 | #if (USER_RING >= XCHAL_MMU_RINGS) | ||
161 | # error USER_RING cannot be greater than the highest numbered ring. | ||
162 | #endif | ||
163 | |||
164 | #if (USER_RING == KERNEL_RING) | ||
165 | # error The user and kernel rings really should not be equal. | ||
166 | #endif | ||
167 | |||
168 | #if (USER_RING == 1) | ||
169 | #define ASID_INSERT(x) ( ((ASID_RESERVED_1) << 24) + \ | ||
170 | ((ASID_RESERVED_2) << 16) + \ | ||
171 | (((x) & (ASID_MASK)) << 8) + \ | ||
172 | ((XCHAL_MMU_ASID_KERNEL)) ) | ||
173 | |||
174 | #elif (USER_RING == 2) | ||
175 | #define ASID_INSERT(x) ( ((ASID_RESERVED_1) << 24) + \ | ||
176 | (((x) & (ASID_MASK)) << 16) + \ | ||
177 | ((ASID_RESERVED_2) << 8) + \ | ||
178 | ((XCHAL_MMU_ASID_KERNEL)) ) | ||
179 | |||
180 | #elif (USER_RING == 3) | ||
181 | #define ASID_INSERT(x) ( (((x) & (ASID_MASK)) << 24) + \ | ||
182 | ((ASID_RESERVED_1) << 16) + \ | ||
183 | ((ASID_RESERVED_2) << 8) + \ | ||
184 | ((XCHAL_MMU_ASID_KERNEL)) ) | ||
185 | |||
186 | #else | ||
187 | #error Goofy value for USER_RING | ||
188 | |||
189 | #endif /* USER_RING == 1 */ | ||
190 | |||
191 | |||
192 | /* | ||
193 | * All unused by hardware upper bits will be considered | ||
194 | * as a software asid extension. | ||
195 | */ | 39 | */ |
196 | 40 | ||
197 | #define ASID_VERSION_MASK ((unsigned long)~(ASID_MASK|(ASID_MASK-1))) | 41 | #define NO_CONTEXT 0 |
198 | #define ASID_FIRST_VERSION \ | 42 | #define ASID_USER_FIRST 4 |
199 | ((unsigned long)(~ASID_VERSION_MASK) + 1 + ASID_FIRST_NONRESERVED) | 43 | #define ASID_MASK ((1 << XCHAL_MMU_ASID_BITS) - 1) |
44 | #define ASID_INSERT(x) (0x03020001 | (((x) & ASID_MASK) << 8)) | ||
200 | 45 | ||
201 | static inline void set_rasid_register (unsigned long val) | 46 | static inline void set_rasid_register (unsigned long val) |
202 | { | 47 | { |
@@ -207,67 +52,28 @@ static inline void set_rasid_register (unsigned long val) | |||
207 | static inline unsigned long get_rasid_register (void) | 52 | static inline unsigned long get_rasid_register (void) |
208 | { | 53 | { |
209 | unsigned long tmp; | 54 | unsigned long tmp; |
210 | __asm__ __volatile__ (" rsr %0, "__stringify(RASID)"\n\t" : "=a" (tmp)); | 55 | __asm__ __volatile__ (" rsr %0,"__stringify(RASID)"\n\t" : "=a" (tmp)); |
211 | return tmp; | 56 | return tmp; |
212 | } | 57 | } |
213 | 58 | ||
214 | |||
215 | #if ((XCHAL_MMU_ASID_INVALID == 0) && (XCHAL_MMU_ASID_KERNEL == 1)) | ||
216 | |||
217 | static inline void | 59 | static inline void |
218 | get_new_mmu_context(struct mm_struct *mm, unsigned long asid) | 60 | __get_new_mmu_context(struct mm_struct *mm) |
219 | { | 61 | { |
220 | extern void flush_tlb_all(void); | 62 | extern void flush_tlb_all(void); |
221 | if (! ((asid += ASID_INC) & ASID_MASK) ) { | 63 | if (! (++asid_cache & ASID_MASK) ) { |
222 | flush_tlb_all(); /* start new asid cycle */ | 64 | flush_tlb_all(); /* start new asid cycle */ |
223 | if (!asid) /* fix version if needed */ | 65 | asid_cache += ASID_USER_FIRST; |
224 | asid = ASID_FIRST_VERSION - ASID_FIRST_NONRESERVED; | ||
225 | asid += ASID_FIRST_NONRESERVED; | ||
226 | } | 66 | } |
227 | mm->context = asid_cache = asid; | 67 | mm->context = asid_cache; |
228 | } | ||
229 | |||
230 | #else | ||
231 | #warning ASID_{INVALID,KERNEL} values impose non-optimal get_new_mmu_context implementation | ||
232 | |||
233 | /* XCHAL_MMU_ASID_INVALID == 0 and XCHAL_MMU_ASID_KERNEL ==1 are | ||
234 | really the best, but if you insist... */ | ||
235 | |||
236 | static inline int validate_asid (unsigned long asid) | ||
237 | { | ||
238 | switch (asid) { | ||
239 | case XCHAL_MMU_ASID_INVALID: | ||
240 | case XCHAL_MMU_ASID_KERNEL: | ||
241 | case ASID_RESERVED_1: | ||
242 | case ASID_RESERVED_2: | ||
243 | case ASID_RESERVED_3: | ||
244 | return 0; /* can't use these values as ASIDs */ | ||
245 | } | ||
246 | return 1; /* valid */ | ||
247 | } | 68 | } |
248 | 69 | ||
249 | static inline void | 70 | static inline void |
250 | get_new_mmu_context(struct mm_struct *mm, unsigned long asid) | 71 | __load_mmu_context(struct mm_struct *mm) |
251 | { | 72 | { |
252 | extern void flush_tlb_all(void); | 73 | set_rasid_register(ASID_INSERT(mm->context)); |
253 | while (1) { | 74 | invalidate_page_directory(); |
254 | asid += ASID_INC; | ||
255 | if ( ! (asid & ASID_MASK) ) { | ||
256 | flush_tlb_all(); /* start new asid cycle */ | ||
257 | if (!asid) /* fix version if needed */ | ||
258 | asid = ASID_FIRST_VERSION - ASID_FIRST_NONRESERVED; | ||
259 | asid += ASID_FIRST_NONRESERVED; | ||
260 | break; /* no need to validate here */ | ||
261 | } | ||
262 | if (validate_asid (asid & ASID_MASK)) | ||
263 | break; | ||
264 | } | ||
265 | mm->context = asid_cache = asid; | ||
266 | } | 75 | } |
267 | 76 | ||
268 | #endif | ||
269 | |||
270 | |||
271 | /* | 77 | /* |
272 | * Initialize the context related info for a new mm_struct | 78 | * Initialize the context related info for a new mm_struct |
273 | * instance. | 79 | * instance. |
@@ -280,6 +86,20 @@ init_new_context(struct task_struct *tsk, struct mm_struct *mm) | |||
280 | return 0; | 86 | return 0; |
281 | } | 87 | } |
282 | 88 | ||
89 | /* | ||
90 | * After we have set current->mm to a new value, this activates | ||
91 | * the context for the new mm so we see the new mappings. | ||
92 | */ | ||
93 | static inline void | ||
94 | activate_mm(struct mm_struct *prev, struct mm_struct *next) | ||
95 | { | ||
96 | /* Unconditionally get a new ASID. */ | ||
97 | |||
98 | __get_new_mmu_context(next); | ||
99 | __load_mmu_context(next); | ||
100 | } | ||
101 | |||
102 | |||
283 | static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next, | 103 | static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next, |
284 | struct task_struct *tsk) | 104 | struct task_struct *tsk) |
285 | { | 105 | { |
@@ -287,11 +107,10 @@ static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next, | |||
287 | 107 | ||
288 | /* Check if our ASID is of an older version and thus invalid */ | 108 | /* Check if our ASID is of an older version and thus invalid */ |
289 | 109 | ||
290 | if ((next->context ^ asid) & ASID_VERSION_MASK) | 110 | if (next->context == NO_CONTEXT || ((next->context^asid) & ~ASID_MASK)) |
291 | get_new_mmu_context(next, asid); | 111 | __get_new_mmu_context(next); |
292 | 112 | ||
293 | set_rasid_register (ASID_INSERT(next->context)); | 113 | __load_mmu_context(next); |
294 | invalidate_page_directory(); | ||
295 | } | 114 | } |
296 | 115 | ||
297 | #define deactivate_mm(tsk, mm) do { } while(0) | 116 | #define deactivate_mm(tsk, mm) do { } while(0) |
@@ -302,20 +121,6 @@ static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next, | |||
302 | */ | 121 | */ |
303 | static inline void destroy_context(struct mm_struct *mm) | 122 | static inline void destroy_context(struct mm_struct *mm) |
304 | { | 123 | { |
305 | /* Nothing to do. */ | ||
306 | } | ||
307 | |||
308 | /* | ||
309 | * After we have set current->mm to a new value, this activates | ||
310 | * the context for the new mm so we see the new mappings. | ||
311 | */ | ||
312 | static inline void | ||
313 | activate_mm(struct mm_struct *prev, struct mm_struct *next) | ||
314 | { | ||
315 | /* Unconditionally get a new ASID. */ | ||
316 | |||
317 | get_new_mmu_context(next, asid_cache); | ||
318 | set_rasid_register (ASID_INSERT(next->context)); | ||
319 | invalidate_page_directory(); | 124 | invalidate_page_directory(); |
320 | } | 125 | } |
321 | 126 | ||
diff --git a/include/asm-xtensa/page.h b/include/asm-xtensa/page.h index 40f4c6c3f580..c631d006194b 100644 --- a/include/asm-xtensa/page.h +++ b/include/asm-xtensa/page.h | |||
@@ -15,18 +15,24 @@ | |||
15 | 15 | ||
16 | #include <asm/processor.h> | 16 | #include <asm/processor.h> |
17 | 17 | ||
18 | #define XCHAL_KSEG_CACHED_VADDR 0xd0000000 | ||
19 | #define XCHAL_KSEG_BYPASS_VADDR 0xd8000000 | ||
20 | #define XCHAL_KSEG_PADDR 0x00000000 | ||
21 | #define XCHAL_KSEG_SIZE 0x08000000 | ||
22 | |||
18 | /* | 23 | /* |
19 | * PAGE_SHIFT determines the page size | 24 | * PAGE_SHIFT determines the page size |
20 | * PAGE_ALIGN(x) aligns the pointer to the (next) page boundary | 25 | * PAGE_ALIGN(x) aligns the pointer to the (next) page boundary |
21 | */ | 26 | */ |
22 | 27 | ||
23 | #define PAGE_SHIFT XCHAL_MMU_MIN_PTE_PAGE_SIZE | 28 | #define PAGE_SHIFT 12 |
24 | #define PAGE_SIZE (1 << PAGE_SHIFT) | 29 | #define PAGE_SIZE (1 << PAGE_SHIFT) |
25 | #define PAGE_MASK (~(PAGE_SIZE-1)) | 30 | #define PAGE_MASK (~(PAGE_SIZE-1)) |
26 | #define PAGE_ALIGN(addr) (((addr)+PAGE_SIZE - 1) & PAGE_MASK) | 31 | #define PAGE_ALIGN(addr) (((addr)+PAGE_SIZE - 1) & PAGE_MASK) |
27 | 32 | ||
28 | #define DCACHE_WAY_SIZE (XCHAL_DCACHE_SIZE / XCHAL_DCACHE_WAYS) | ||
29 | #define PAGE_OFFSET XCHAL_KSEG_CACHED_VADDR | 33 | #define PAGE_OFFSET XCHAL_KSEG_CACHED_VADDR |
34 | #define MAX_MEM_PFN XCHAL_KSEG_SIZE | ||
35 | #define PGTABLE_START 0x80000000 | ||
30 | 36 | ||
31 | #ifdef __ASSEMBLY__ | 37 | #ifdef __ASSEMBLY__ |
32 | 38 | ||
diff --git a/include/asm-xtensa/param.h b/include/asm-xtensa/param.h index c0eec8260b0e..6f281392e3f8 100644 --- a/include/asm-xtensa/param.h +++ b/include/asm-xtensa/param.h | |||
@@ -11,7 +11,7 @@ | |||
11 | #ifndef _XTENSA_PARAM_H | 11 | #ifndef _XTENSA_PARAM_H |
12 | #define _XTENSA_PARAM_H | 12 | #define _XTENSA_PARAM_H |
13 | 13 | ||
14 | #include <xtensa/config/core.h> | 14 | #include <asm/variant/core.h> |
15 | 15 | ||
16 | #ifdef __KERNEL__ | 16 | #ifdef __KERNEL__ |
17 | # define HZ 100 /* internal timer frequency */ | 17 | # define HZ 100 /* internal timer frequency */ |
diff --git a/include/asm-xtensa/pgtable.h b/include/asm-xtensa/pgtable.h index b4318934b10d..2d4b5db6ea63 100644 --- a/include/asm-xtensa/pgtable.h +++ b/include/asm-xtensa/pgtable.h | |||
@@ -14,45 +14,6 @@ | |||
14 | #include <asm-generic/pgtable-nopmd.h> | 14 | #include <asm-generic/pgtable-nopmd.h> |
15 | #include <asm/page.h> | 15 | #include <asm/page.h> |
16 | 16 | ||
17 | /* Assertions. */ | ||
18 | |||
19 | #ifdef CONFIG_MMU | ||
20 | |||
21 | |||
22 | #if (XCHAL_MMU_RINGS < 2) | ||
23 | # error Linux build assumes at least 2 ring levels. | ||
24 | #endif | ||
25 | |||
26 | #if (XCHAL_MMU_CA_BITS != 4) | ||
27 | # error We assume exactly four bits for CA. | ||
28 | #endif | ||
29 | |||
30 | #if (XCHAL_MMU_SR_BITS != 0) | ||
31 | # error We have no room for SR bits. | ||
32 | #endif | ||
33 | |||
34 | /* | ||
35 | * Use the first min-wired way for mapping page-table pages. | ||
36 | * Page coloring requires a second min-wired way. | ||
37 | */ | ||
38 | |||
39 | #if (XCHAL_DTLB_MINWIRED_SETS == 0) | ||
40 | # error Need a min-wired way for mapping page-table pages | ||
41 | #endif | ||
42 | |||
43 | #define DTLB_WAY_PGTABLE XCHAL_DTLB_SET(XCHAL_DTLB_MINWIRED_SET0, WAY) | ||
44 | |||
45 | #if (DCACHE_WAY_SIZE > PAGE_SIZE) && XCHAL_DCACHE_IS_WRITEBACK | ||
46 | # if XCHAL_DTLB_SET(XCHAL_DTLB_MINWIRED_SET0, WAYS) >= 2 | ||
47 | # define DTLB_WAY_DCACHE_ALIAS0 (DTLB_WAY_PGTABLE + 1) | ||
48 | # define DTLB_WAY_DCACHE_ALIAS1 (DTLB_WAY_PGTABLE + 2) | ||
49 | # else | ||
50 | # error Page coloring requires its own wired dtlb way! | ||
51 | # endif | ||
52 | #endif | ||
53 | |||
54 | #endif /* CONFIG_MMU */ | ||
55 | |||
56 | /* | 17 | /* |
57 | * We only use two ring levels, user and kernel space. | 18 | * We only use two ring levels, user and kernel space. |
58 | */ | 19 | */ |
@@ -97,7 +58,7 @@ | |||
97 | #define PGD_ORDER 0 | 58 | #define PGD_ORDER 0 |
98 | #define PMD_ORDER 0 | 59 | #define PMD_ORDER 0 |
99 | #define USER_PTRS_PER_PGD (TASK_SIZE/PGDIR_SIZE) | 60 | #define USER_PTRS_PER_PGD (TASK_SIZE/PGDIR_SIZE) |
100 | #define FIRST_USER_ADDRESS XCHAL_SEG_MAPPABLE_VADDR | 61 | #define FIRST_USER_ADDRESS 0 |
101 | #define FIRST_USER_PGD_NR (FIRST_USER_ADDRESS >> PGDIR_SHIFT) | 62 | #define FIRST_USER_PGD_NR (FIRST_USER_ADDRESS >> PGDIR_SHIFT) |
102 | 63 | ||
103 | /* virtual memory area. We keep a distance to other memory regions to be | 64 | /* virtual memory area. We keep a distance to other memory regions to be |
diff --git a/include/asm-xtensa/platform-iss/hardware.h b/include/asm-xtensa/platform-iss/hardware.h index 22240f001803..6930c12adc16 100644 --- a/include/asm-xtensa/platform-iss/hardware.h +++ b/include/asm-xtensa/platform-iss/hardware.h | |||
@@ -12,18 +12,18 @@ | |||
12 | * This file contains the default configuration of ISS. | 12 | * This file contains the default configuration of ISS. |
13 | */ | 13 | */ |
14 | 14 | ||
15 | #ifndef __ASM_XTENSA_ISS_HARDWARE | 15 | #ifndef _XTENSA_PLATFORM_ISS_HARDWARE_H |
16 | #define __ASM_XTENSA_ISS_HARDWARE | 16 | #define _XTENSA_PLATFORM_ISS_HARDWARE_H |
17 | 17 | ||
18 | /* | 18 | /* |
19 | * Memory configuration. | 19 | * Memory configuration. |
20 | */ | 20 | */ |
21 | 21 | ||
22 | #define PLATFORM_DEFAULT_MEM_START XSHAL_RAM_PADDR | 22 | #define PLATFORM_DEFAULT_MEM_START 0x00000000 |
23 | #define PLATFORM_DEFAULT_MEM_SIZE XSHAL_RAM_VSIZE | 23 | #define PLATFORM_DEFAULT_MEM_SIZE 0x08000000 |
24 | 24 | ||
25 | /* | 25 | /* |
26 | * Interrupt configuration. | 26 | * Interrupt configuration. |
27 | */ | 27 | */ |
28 | 28 | ||
29 | #endif /* __ASM_XTENSA_ISS_HARDWARE */ | 29 | #endif /* _XTENSA_PLATFORM_ISS_HARDWARE_H */ |
diff --git a/include/asm-xtensa/platform-iss/simcall.h b/include/asm-xtensa/platform-iss/simcall.h new file mode 100644 index 000000000000..6acb572759a6 --- /dev/null +++ b/include/asm-xtensa/platform-iss/simcall.h | |||
@@ -0,0 +1,62 @@ | |||
1 | /* | ||
2 | * include/asm-xtensa/platform-iss/hardware.h | ||
3 | * | ||
4 | * This file is subject to the terms and conditions of the GNU General Public | ||
5 | * License. See the file "COPYING" in the main directory of this archive | ||
6 | * for more details. | ||
7 | * | ||
8 | * Copyright (C) 2001 Tensilica Inc. | ||
9 | */ | ||
10 | |||
11 | #ifndef _XTENSA_PLATFORM_ISS_SIMCALL_H | ||
12 | #define _XTENSA_PLATFORM_ISS_SIMCALL_H | ||
13 | |||
14 | |||
15 | /* | ||
16 | * System call like services offered by the simulator host. | ||
17 | */ | ||
18 | |||
19 | #define SYS_nop 0 /* unused */ | ||
20 | #define SYS_exit 1 /*x*/ | ||
21 | #define SYS_fork 2 | ||
22 | #define SYS_read 3 /*x*/ | ||
23 | #define SYS_write 4 /*x*/ | ||
24 | #define SYS_open 5 /*x*/ | ||
25 | #define SYS_close 6 /*x*/ | ||
26 | #define SYS_rename 7 /*x 38 - waitpid */ | ||
27 | #define SYS_creat 8 /*x*/ | ||
28 | #define SYS_link 9 /*x (not implemented on WIN32) */ | ||
29 | #define SYS_unlink 10 /*x*/ | ||
30 | #define SYS_execv 11 /* n/a - execve */ | ||
31 | #define SYS_execve 12 /* 11 - chdir */ | ||
32 | #define SYS_pipe 13 /* 42 - time */ | ||
33 | #define SYS_stat 14 /* 106 - mknod */ | ||
34 | #define SYS_chmod 15 | ||
35 | #define SYS_chown 16 /* 202 - lchown */ | ||
36 | #define SYS_utime 17 /* 30 - break */ | ||
37 | #define SYS_wait 18 /* n/a - oldstat */ | ||
38 | #define SYS_lseek 19 /*x*/ | ||
39 | #define SYS_getpid 20 | ||
40 | #define SYS_isatty 21 /* n/a - mount */ | ||
41 | #define SYS_fstat 22 /* 108 - oldumount */ | ||
42 | #define SYS_time 23 /* 13 - setuid */ | ||
43 | #define SYS_gettimeofday 24 /*x 78 - getuid (not implemented on WIN32) */ | ||
44 | #define SYS_times 25 /*X 43 - stime (Xtensa-specific implementation) */ | ||
45 | #define SYS_socket 26 | ||
46 | #define SYS_sendto 27 | ||
47 | #define SYS_recvfrom 28 | ||
48 | #define SYS_select_one 29 /* not compitible select, one file descriptor at the time */ | ||
49 | #define SYS_bind 30 | ||
50 | #define SYS_ioctl 31 | ||
51 | |||
52 | /* | ||
53 | * SYS_select_one specifiers | ||
54 | */ | ||
55 | |||
56 | #define XTISS_SELECT_ONE_READ 1 | ||
57 | #define XTISS_SELECT_ONE_WRITE 2 | ||
58 | #define XTISS_SELECT_ONE_EXCEPT 3 | ||
59 | |||
60 | |||
61 | #endif /* _XTENSA_PLATFORM_ISS_SIMCALL_H */ | ||
62 | |||
diff --git a/include/asm-xtensa/posix_types.h b/include/asm-xtensa/posix_types.h index 2c816b0e7762..3470b44c12ce 100644 --- a/include/asm-xtensa/posix_types.h +++ b/include/asm-xtensa/posix_types.h | |||
@@ -21,7 +21,7 @@ | |||
21 | 21 | ||
22 | typedef unsigned long __kernel_ino_t; | 22 | typedef unsigned long __kernel_ino_t; |
23 | typedef unsigned int __kernel_mode_t; | 23 | typedef unsigned int __kernel_mode_t; |
24 | typedef unsigned short __kernel_nlink_t; | 24 | typedef unsigned long __kernel_nlink_t; |
25 | typedef long __kernel_off_t; | 25 | typedef long __kernel_off_t; |
26 | typedef int __kernel_pid_t; | 26 | typedef int __kernel_pid_t; |
27 | typedef unsigned short __kernel_ipc_pid_t; | 27 | typedef unsigned short __kernel_ipc_pid_t; |
diff --git a/include/asm-xtensa/processor.h b/include/asm-xtensa/processor.h index 8b96e77c9d82..4feb9f7f35a6 100644 --- a/include/asm-xtensa/processor.h +++ b/include/asm-xtensa/processor.h | |||
@@ -11,24 +11,18 @@ | |||
11 | #ifndef _XTENSA_PROCESSOR_H | 11 | #ifndef _XTENSA_PROCESSOR_H |
12 | #define _XTENSA_PROCESSOR_H | 12 | #define _XTENSA_PROCESSOR_H |
13 | 13 | ||
14 | #ifdef __ASSEMBLY__ | 14 | #include <asm/variant/core.h> |
15 | #define _ASMLANGUAGE | 15 | #include <asm/coprocessor.h> |
16 | #endif | ||
17 | |||
18 | #include <xtensa/config/core.h> | ||
19 | #include <xtensa/config/specreg.h> | ||
20 | #include <xtensa/config/tie.h> | ||
21 | #include <xtensa/config/system.h> | ||
22 | 16 | ||
23 | #include <linux/compiler.h> | 17 | #include <linux/compiler.h> |
24 | #include <asm/ptrace.h> | 18 | #include <asm/ptrace.h> |
25 | #include <asm/types.h> | 19 | #include <asm/types.h> |
26 | #include <asm/coprocessor.h> | 20 | #include <asm/regs.h> |
27 | 21 | ||
28 | /* Assertions. */ | 22 | /* Assertions. */ |
29 | 23 | ||
30 | #if (XCHAL_HAVE_WINDOWED != 1) | 24 | #if (XCHAL_HAVE_WINDOWED != 1) |
31 | #error Linux requires the Xtensa Windowed Registers Option. | 25 | # error Linux requires the Xtensa Windowed Registers Option. |
32 | #endif | 26 | #endif |
33 | 27 | ||
34 | /* | 28 | /* |
@@ -145,11 +139,11 @@ struct thread_struct { | |||
145 | * Note: We set-up ps as if we did a call4 to the new pc. | 139 | * Note: We set-up ps as if we did a call4 to the new pc. |
146 | * set_thread_state in signal.c depends on it. | 140 | * set_thread_state in signal.c depends on it. |
147 | */ | 141 | */ |
148 | #define USER_PS_VALUE ( (1 << XCHAL_PS_WOE_SHIFT) + \ | 142 | #define USER_PS_VALUE ((1 << PS_WOE_BIT) | \ |
149 | (1 << XCHAL_PS_CALLINC_SHIFT) + \ | 143 | (1 << PS_CALLINC_SHIFT) | \ |
150 | (USER_RING << XCHAL_PS_RING_SHIFT) + \ | 144 | (USER_RING << PS_RING_SHIFT) | \ |
151 | (1 << XCHAL_PS_PROGSTACK_SHIFT) + \ | 145 | (1 << PS_UM_BIT) | \ |
152 | (1 << XCHAL_PS_EXCM_SHIFT) ) | 146 | (1 << PS_EXCM_BIT)) |
153 | 147 | ||
154 | /* Clearing a0 terminates the backtrace. */ | 148 | /* Clearing a0 terminates the backtrace. */ |
155 | #define start_thread(regs, new_pc, new_sp) \ | 149 | #define start_thread(regs, new_pc, new_sp) \ |
diff --git a/include/asm-xtensa/ptrace.h b/include/asm-xtensa/ptrace.h index a5ac71a5205c..1b7fe363fad1 100644 --- a/include/asm-xtensa/ptrace.h +++ b/include/asm-xtensa/ptrace.h | |||
@@ -11,7 +11,7 @@ | |||
11 | #ifndef _XTENSA_PTRACE_H | 11 | #ifndef _XTENSA_PTRACE_H |
12 | #define _XTENSA_PTRACE_H | 12 | #define _XTENSA_PTRACE_H |
13 | 13 | ||
14 | #include <xtensa/config/core.h> | 14 | #include <asm/variant/core.h> |
15 | 15 | ||
16 | /* | 16 | /* |
17 | * Kernel stack | 17 | * Kernel stack |
diff --git a/include/asm-xtensa/regs.h b/include/asm-xtensa/regs.h new file mode 100644 index 000000000000..c913d259faaa --- /dev/null +++ b/include/asm-xtensa/regs.h | |||
@@ -0,0 +1,138 @@ | |||
1 | /* | ||
2 | * Copyright (c) 2006 Tensilica, Inc. All Rights Reserved. | ||
3 | * | ||
4 | * This program is free software; you can redistribute it and/or modify | ||
5 | * it under the terms of version 2.1 of the GNU Lesser General Public | ||
6 | * License as published by the Free Software Foundation. | ||
7 | * | ||
8 | * This program is distributed in the hope that it would be useful, but | ||
9 | * WITHOUT ANY WARRANTY; without even the implied warranty of | ||
10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | ||
11 | * | ||
12 | * Further, this software is distributed without any warranty that it is | ||
13 | * free of the rightful claim of any third person regarding infringement | ||
14 | * or the like. Any license provided herein, whether implied or | ||
15 | * otherwise, applies only to this software file. Patent licenses, if | ||
16 | * any, provided herein do not apply to combinations of this program with | ||
17 | * other software, or any other product whatsoever. | ||
18 | * | ||
19 | * You should have received a copy of the GNU Lesser General Public | ||
20 | * License along with this program; if not, write the Free Software | ||
21 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston MA 02111-1307, | ||
22 | * USA. | ||
23 | */ | ||
24 | |||
25 | #ifndef _XTENSA_REGS_H | ||
26 | #define _XTENSA_REGS_H | ||
27 | |||
28 | /* Special registers. */ | ||
29 | |||
30 | #define LBEG 0 | ||
31 | #define LEND 1 | ||
32 | #define LCOUNT 2 | ||
33 | #define SAR 3 | ||
34 | #define BR 4 | ||
35 | #define SCOMPARE1 12 | ||
36 | #define ACCHI 16 | ||
37 | #define ACCLO 17 | ||
38 | #define MR 32 | ||
39 | #define WINDOWBASE 72 | ||
40 | #define WINDOWSTART 73 | ||
41 | #define PTEVADDR 83 | ||
42 | #define RASID 90 | ||
43 | #define ITLBCFG 91 | ||
44 | #define DTLBCFG 92 | ||
45 | #define IBREAKENABLE 96 | ||
46 | #define DDR 104 | ||
47 | #define IBREAKA 128 | ||
48 | #define DBREAKA 144 | ||
49 | #define DBREAKC 160 | ||
50 | #define EPC 176 | ||
51 | #define EPC_1 177 | ||
52 | #define DEPC 192 | ||
53 | #define EPS 192 | ||
54 | #define EPS_1 193 | ||
55 | #define EXCSAVE 208 | ||
56 | #define EXCSAVE_1 209 | ||
57 | #define INTERRUPT 226 | ||
58 | #define INTENABLE 228 | ||
59 | #define PS 230 | ||
60 | #define THREADPTR 231 | ||
61 | #define EXCCAUSE 232 | ||
62 | #define DEBUGCAUSE 233 | ||
63 | #define CCOUNT 234 | ||
64 | #define PRID 235 | ||
65 | #define ICOUNT 236 | ||
66 | #define ICOUNTLEVEL 237 | ||
67 | #define EXCVADDR 238 | ||
68 | #define CCOMPARE 240 | ||
69 | #define MISC 244 | ||
70 | |||
71 | /* Special names for read-only and write-only interrupt registers. */ | ||
72 | |||
73 | #define INTREAD 226 | ||
74 | #define INTSET 226 | ||
75 | #define INTCLEAR 227 | ||
76 | |||
77 | /* EXCCAUSE register fields */ | ||
78 | |||
79 | #define EXCCAUSE_EXCCAUSE_SHIFT 0 | ||
80 | #define EXCCAUSE_EXCCAUSE_MASK 0x3F | ||
81 | |||
82 | #define EXCCAUSE_ILLEGAL_INSTRUCTION 0 | ||
83 | #define EXCCAUSE_SYSTEM_CALL 1 | ||
84 | #define EXCCAUSE_INSTRUCTION_FETCH_ERROR 2 | ||
85 | #define EXCCAUSE_LOAD_STORE_ERROR 3 | ||
86 | #define EXCCAUSE_LEVEL1_INTERRUPT 4 | ||
87 | #define EXCCAUSE_ALLOCA 5 | ||
88 | #define EXCCAUSE_INTEGER_DIVIDE_BY_ZERO 6 | ||
89 | #define EXCCAUSE_SPECULATION 7 | ||
90 | #define EXCCAUSE_PRIVILEGED 8 | ||
91 | #define EXCCAUSE_UNALIGNED 9 | ||
92 | #define EXCCAUSE_ITLB_MISS 16 | ||
93 | #define EXCCAUSE_ITLB_MULTIHIT 17 | ||
94 | #define EXCCAUSE_ITLB_PRIVILEGE 18 | ||
95 | #define EXCCAUSE_ITLB_SIZE_RESTRICTION 19 | ||
96 | #define EXCCAUSE_FETCH_CACHE_ATTRIBUTE 20 | ||
97 | #define EXCCAUSE_DTLB_MISS 24 | ||
98 | #define EXCCAUSE_DTLB_MULTIHIT 25 | ||
99 | #define EXCCAUSE_DTLB_PRIVILEGE 26 | ||
100 | #define EXCCAUSE_DTLB_SIZE_RESTRICTION 27 | ||
101 | #define EXCCAUSE_LOAD_CACHE_ATTRIBUTE 28 | ||
102 | #define EXCCAUSE_STORE_CACHE_ATTRIBUTE 29 | ||
103 | #define EXCCAUSE_FLOATING_POINT 40 | ||
104 | |||
105 | /* PS register fields. */ | ||
106 | |||
107 | #define PS_WOE_BIT 18 | ||
108 | #define PS_CALLINC_SHIFT 16 | ||
109 | #define PS_CALLINC_MASK 0x00030000 | ||
110 | #define PS_OWB_SHIFT 8 | ||
111 | #define PS_OWB_MASK 0x00000F00 | ||
112 | #define PS_RING_SHIFT 6 | ||
113 | #define PS_RING_MASK 0x000000C0 | ||
114 | #define PS_UM_BIT 5 | ||
115 | #define PS_EXCM_BIT 4 | ||
116 | #define PS_INTLEVEL_SHIFT 0 | ||
117 | #define PS_INTLEVEL_MASK 0x0000000F | ||
118 | |||
119 | /* DBREAKCn register fields. */ | ||
120 | |||
121 | #define DBREAKC_MASK_BIT 0 | ||
122 | #define DBREAKC_MASK_MASK 0x0000003F | ||
123 | #define DBREAKC_LOAD_BIT 30 | ||
124 | #define DBREAKC_LOAD_MASK 0x40000000 | ||
125 | #define DBREAKC_STOR_BIT 31 | ||
126 | #define DBREAKC_STOR_MASK 0x80000000 | ||
127 | |||
128 | /* DEBUGCAUSE register fields. */ | ||
129 | |||
130 | #define DEBUGCAUSE_DEBUGINT_BIT 5 /* External debug interrupt */ | ||
131 | #define DEBUGCAUSE_BREAKN_BIT 4 /* BREAK.N instruction */ | ||
132 | #define DEBUGCAUSE_BREAK_BIT 3 /* BREAK instruction */ | ||
133 | #define DEBUGCAUSE_DBREAK_BIT 2 /* DBREAK match */ | ||
134 | #define DEBUGCAUSE_IBREAK_BIT 1 /* IBREAK match */ | ||
135 | #define DEBUGCAUSE_ICOUNT_BIT 0 /* ICOUNT would incr. to zero */ | ||
136 | |||
137 | #endif /* _XTENSA_SPECREG_H */ | ||
138 | |||
diff --git a/include/asm-xtensa/sembuf.h b/include/asm-xtensa/sembuf.h index 2d26c47666fe..c15870493b33 100644 --- a/include/asm-xtensa/sembuf.h +++ b/include/asm-xtensa/sembuf.h | |||
@@ -25,7 +25,7 @@ | |||
25 | 25 | ||
26 | struct semid64_ds { | 26 | struct semid64_ds { |
27 | struct ipc64_perm sem_perm; /* permissions .. see ipc.h */ | 27 | struct ipc64_perm sem_perm; /* permissions .. see ipc.h */ |
28 | #if XCHAL_HAVE_LE | 28 | #ifdef __XTENSA_EL__ |
29 | __kernel_time_t sem_otime; /* last semop time */ | 29 | __kernel_time_t sem_otime; /* last semop time */ |
30 | unsigned long __unused1; | 30 | unsigned long __unused1; |
31 | __kernel_time_t sem_ctime; /* last change time */ | 31 | __kernel_time_t sem_ctime; /* last change time */ |
diff --git a/include/asm-xtensa/shmbuf.h b/include/asm-xtensa/shmbuf.h index a30b81a4b933..ad4b0121782c 100644 --- a/include/asm-xtensa/shmbuf.h +++ b/include/asm-xtensa/shmbuf.h | |||
@@ -19,6 +19,7 @@ | |||
19 | #ifndef _XTENSA_SHMBUF_H | 19 | #ifndef _XTENSA_SHMBUF_H |
20 | #define _XTENSA_SHMBUF_H | 20 | #define _XTENSA_SHMBUF_H |
21 | 21 | ||
22 | #if defined (__XTENSA_EL__) | ||
22 | struct shmid64_ds { | 23 | struct shmid64_ds { |
23 | struct ipc64_perm shm_perm; /* operation perms */ | 24 | struct ipc64_perm shm_perm; /* operation perms */ |
24 | size_t shm_segsz; /* size of segment (bytes) */ | 25 | size_t shm_segsz; /* size of segment (bytes) */ |
@@ -34,6 +35,26 @@ struct shmid64_ds { | |||
34 | unsigned long __unused4; | 35 | unsigned long __unused4; |
35 | unsigned long __unused5; | 36 | unsigned long __unused5; |
36 | }; | 37 | }; |
38 | #elif defined (__XTENSA_EB__) | ||
39 | struct shmid64_ds { | ||
40 | struct ipc64_perm shm_perm; /* operation perms */ | ||
41 | size_t shm_segsz; /* size of segment (bytes) */ | ||
42 | __kernel_time_t shm_atime; /* last attach time */ | ||
43 | unsigned long __unused1; | ||
44 | __kernel_time_t shm_dtime; /* last detach time */ | ||
45 | unsigned long __unused2; | ||
46 | __kernel_time_t shm_ctime; /* last change time */ | ||
47 | unsigned long __unused3; | ||
48 | __kernel_pid_t shm_cpid; /* pid of creator */ | ||
49 | __kernel_pid_t shm_lpid; /* pid of last operator */ | ||
50 | unsigned long shm_nattch; /* no. of current attaches */ | ||
51 | unsigned long __unused4; | ||
52 | unsigned long __unused5; | ||
53 | }; | ||
54 | #else | ||
55 | # error endian order not defined | ||
56 | #endif | ||
57 | |||
37 | 58 | ||
38 | struct shminfo64 { | 59 | struct shminfo64 { |
39 | unsigned long shmmax; | 60 | unsigned long shmmax; |
diff --git a/include/asm-xtensa/stat.h b/include/asm-xtensa/stat.h index 2f4662ff6c3a..149f4bce092f 100644 --- a/include/asm-xtensa/stat.h +++ b/include/asm-xtensa/stat.h | |||
@@ -13,93 +13,57 @@ | |||
13 | 13 | ||
14 | #include <linux/types.h> | 14 | #include <linux/types.h> |
15 | 15 | ||
16 | struct __old_kernel_stat { | ||
17 | unsigned short st_dev; | ||
18 | unsigned short st_ino; | ||
19 | unsigned short st_mode; | ||
20 | unsigned short st_nlink; | ||
21 | unsigned short st_uid; | ||
22 | unsigned short st_gid; | ||
23 | unsigned short st_rdev; | ||
24 | unsigned long st_size; | ||
25 | unsigned long st_atime; | ||
26 | unsigned long st_mtime; | ||
27 | unsigned long st_ctime; | ||
28 | }; | ||
29 | |||
30 | #define STAT_HAVE_NSEC 1 | 16 | #define STAT_HAVE_NSEC 1 |
31 | 17 | ||
32 | struct stat { | 18 | struct stat { |
33 | unsigned short st_dev; | 19 | unsigned long st_dev; |
34 | unsigned short __pad1; | 20 | ino_t st_ino; |
35 | unsigned long st_ino; | 21 | mode_t st_mode; |
36 | unsigned short st_mode; | 22 | nlink_t st_nlink; |
37 | unsigned short st_nlink; | 23 | uid_t st_uid; |
38 | unsigned short st_uid; | 24 | gid_t st_gid; |
39 | unsigned short st_gid; | 25 | unsigned int st_rdev; |
40 | unsigned short st_rdev; | 26 | off_t st_size; |
41 | unsigned short __pad2; | 27 | unsigned long st_blksize; |
42 | unsigned long st_size; | 28 | unsigned long st_blocks; |
43 | unsigned long st_blksize; | 29 | unsigned long st_atime; |
44 | unsigned long st_blocks; | 30 | unsigned long st_atime_nsec; |
45 | unsigned long st_atime; | 31 | unsigned long st_mtime; |
46 | unsigned long st_atime_nsec; | 32 | unsigned long st_mtime_nsec; |
47 | unsigned long st_mtime; | 33 | unsigned long st_ctime; |
48 | unsigned long st_mtime_nsec; | 34 | unsigned long st_ctime_nsec; |
49 | unsigned long st_ctime; | 35 | unsigned long __unused4; |
50 | unsigned long st_ctime_nsec; | 36 | unsigned long __unused5; |
51 | unsigned long __unused4; | ||
52 | unsigned long __unused5; | ||
53 | }; | 37 | }; |
54 | 38 | ||
55 | /* This matches struct stat64 in glibc-2.2.3. */ | 39 | /* This matches struct stat64 in glibc-2.3 */ |
56 | 40 | ||
57 | struct stat64 { | 41 | struct stat64 { |
58 | #ifdef __XTENSA_EL__ | 42 | unsigned long long st_dev; /* Device */ |
59 | unsigned short st_dev; /* Device */ | 43 | unsigned long long st_ino; /* File serial number */ |
60 | unsigned char __pad0[10]; | ||
61 | #else | ||
62 | unsigned char __pad0[6]; | ||
63 | unsigned short st_dev; | ||
64 | unsigned char __pad1[2]; | ||
65 | #endif | ||
66 | |||
67 | #define STAT64_HAS_BROKEN_ST_INO 1 | ||
68 | unsigned long __st_ino; /* 32bit file serial number. */ | ||
69 | |||
70 | unsigned int st_mode; /* File mode. */ | 44 | unsigned int st_mode; /* File mode. */ |
71 | unsigned int st_nlink; /* Link count. */ | 45 | unsigned int st_nlink; /* Link count. */ |
72 | unsigned int st_uid; /* User ID of the file's owner. */ | 46 | unsigned int st_uid; /* User ID of the file's owner. */ |
73 | unsigned int st_gid; /* Group ID of the file's group. */ | 47 | unsigned int st_gid; /* Group ID of the file's group. */ |
74 | 48 | unsigned long long st_rdev; /* Device number, if device. */ | |
75 | #ifdef __XTENSA_EL__ | 49 | long long st_size; /* Size of file, in bytes. */ |
76 | unsigned short st_rdev; /* Device number, if device. */ | 50 | long st_blksize; /* Optimal block size for I/O. */ |
77 | unsigned char __pad3[10]; | 51 | unsigned long __unused2; |
78 | #else | 52 | #ifdef __XTENSA_EB__ |
79 | unsigned char __pad2[6]; | 53 | unsigned long __unused3; |
80 | unsigned short st_rdev; | 54 | long st_blocks; /* Number 512-byte blocks allocated. */ |
81 | unsigned char __pad3[2]; | ||
82 | #endif | ||
83 | |||
84 | long long int st_size; /* Size of file, in bytes. */ | ||
85 | long int st_blksize; /* Optimal block size for I/O. */ | ||
86 | |||
87 | #ifdef __XTENSA_EL__ | ||
88 | unsigned long st_blocks; /* Number 512-byte blocks allocated. */ | ||
89 | unsigned long __pad4; | ||
90 | #else | 55 | #else |
91 | unsigned long __pad4; | 56 | long st_blocks; /* Number 512-byte blocks allocated. */ |
92 | unsigned long st_blocks; | 57 | unsigned long __unused3; |
93 | #endif | 58 | #endif |
94 | 59 | long st_atime; /* Time of last access. */ | |
95 | unsigned long __pad5; | 60 | unsigned long st_atime_nsec; |
96 | long int st_atime; /* Time of last access. */ | 61 | long st_mtime; /* Time of last modification. */ |
97 | unsigned long st_atime_nsec; | 62 | unsigned long st_mtime_nsec; |
98 | long int st_mtime; /* Time of last modification. */ | 63 | long st_ctime; /* Time of last status change. */ |
99 | unsigned long st_mtime_nsec; | 64 | unsigned long st_ctime_nsec; |
100 | long int st_ctime; /* Time of last status change. */ | 65 | unsigned long __unused4; |
101 | unsigned long st_ctime_nsec; | 66 | unsigned long __unused5; |
102 | unsigned long long int st_ino; /* File serial number. */ | ||
103 | }; | 67 | }; |
104 | 68 | ||
105 | #endif /* _XTENSA_STAT_H */ | 69 | #endif /* _XTENSA_STAT_H */ |
diff --git a/include/asm-xtensa/syscall.h b/include/asm-xtensa/syscall.h new file mode 100644 index 000000000000..6cb0d42f11c8 --- /dev/null +++ b/include/asm-xtensa/syscall.h | |||
@@ -0,0 +1,20 @@ | |||
1 | struct pt_regs; | ||
2 | struct sigaction; | ||
3 | asmlinkage long xtensa_execve(char*, char**, char**, struct pt_regs*); | ||
4 | asmlinkage long xtensa_clone(unsigned long, unsigned long, struct pt_regs*); | ||
5 | asmlinkage long xtensa_pipe(int __user *); | ||
6 | asmlinkage long xtensa_mmap2(unsigned long, unsigned long, unsigned long, | ||
7 | unsigned long, unsigned long, unsigned long); | ||
8 | asmlinkage long xtensa_ptrace(long, long, long, long); | ||
9 | asmlinkage long xtensa_sigreturn(struct pt_regs*); | ||
10 | asmlinkage long xtensa_rt_sigreturn(struct pt_regs*); | ||
11 | asmlinkage long xtensa_sigsuspend(struct pt_regs*); | ||
12 | asmlinkage long xtensa_rt_sigsuspend(struct pt_regs*); | ||
13 | asmlinkage long xtensa_sigaction(int, const struct old_sigaction*, | ||
14 | struct old_sigaction*); | ||
15 | asmlinkage long xtensa_sigaltstack(struct pt_regs *regs); | ||
16 | asmlinkage long sys_rt_sigaction(int, | ||
17 | const struct sigaction __user *, | ||
18 | struct sigaction __user *, | ||
19 | size_t); | ||
20 | asmlinkage long xtensa_shmat(int shmid, char __user *shmaddr, int shmflg); | ||
diff --git a/include/asm-xtensa/system.h b/include/asm-xtensa/system.h index 932bda92a21c..4aaed7fe6cfe 100644 --- a/include/asm-xtensa/system.h +++ b/include/asm-xtensa/system.h | |||
@@ -213,7 +213,7 @@ static inline void spill_registers(void) | |||
213 | unsigned int a0, ps; | 213 | unsigned int a0, ps; |
214 | 214 | ||
215 | __asm__ __volatile__ ( | 215 | __asm__ __volatile__ ( |
216 | "movi a14," __stringify (PS_EXCM_MASK) " | 1\n\t" | 216 | "movi a14," __stringify (PS_EXCM_BIT) " | 1\n\t" |
217 | "mov a12, a0\n\t" | 217 | "mov a12, a0\n\t" |
218 | "rsr a13," __stringify(SAR) "\n\t" | 218 | "rsr a13," __stringify(SAR) "\n\t" |
219 | "xsr a14," __stringify(PS) "\n\t" | 219 | "xsr a14," __stringify(PS) "\n\t" |
diff --git a/include/asm-xtensa/timex.h b/include/asm-xtensa/timex.h index c7b705e66655..28c7985a4000 100644 --- a/include/asm-xtensa/timex.h +++ b/include/asm-xtensa/timex.h | |||
@@ -16,17 +16,22 @@ | |||
16 | #include <asm/processor.h> | 16 | #include <asm/processor.h> |
17 | #include <linux/stringify.h> | 17 | #include <linux/stringify.h> |
18 | 18 | ||
19 | #if XCHAL_INT_LEVEL(XCHAL_TIMER0_INTERRUPT) == 1 | 19 | #define _INTLEVEL(x) XCHAL_INT ## x ## _LEVEL |
20 | #define INTLEVEL(x) _INTLEVEL(x) | ||
21 | |||
22 | #if INTLEVEL(XCHAL_TIMER0_INTERRUPT) == 1 | ||
20 | # define LINUX_TIMER 0 | 23 | # define LINUX_TIMER 0 |
21 | #elif XCHAL_INT_LEVEL(XCHAL_TIMER1_INTERRUPT) == 1 | 24 | # define LINUX_TIMER_INT XCHAL_TIMER0_INTERRUPT |
25 | #elif INTLEVEL(XCHAL_TIMER1_INTERRUPT) == 1 | ||
22 | # define LINUX_TIMER 1 | 26 | # define LINUX_TIMER 1 |
23 | #elif XCHAL_INT_LEVEL(XCHAL_TIMER2_INTERRUPT) == 1 | 27 | # define LINUX_TIMER_INT XCHAL_TIMER1_INTERRUPT |
28 | #elif INTLEVEL(XCHAL_TIMER2_INTERRUPT) == 1 | ||
24 | # define LINUX_TIMER 2 | 29 | # define LINUX_TIMER 2 |
30 | # define LINUX_TIMER_INT XCHAL_TIMER2_INTERRUPT | ||
25 | #else | 31 | #else |
26 | # error "Bad timer number for Linux configurations!" | 32 | # error "Bad timer number for Linux configurations!" |
27 | #endif | 33 | #endif |
28 | 34 | ||
29 | #define LINUX_TIMER_INT XCHAL_TIMER_INTERRUPT(LINUX_TIMER) | ||
30 | #define LINUX_TIMER_MASK (1L << LINUX_TIMER_INT) | 35 | #define LINUX_TIMER_MASK (1L << LINUX_TIMER_INT) |
31 | 36 | ||
32 | #define CLOCK_TICK_RATE 1193180 /* (everyone is using this value) */ | 37 | #define CLOCK_TICK_RATE 1193180 /* (everyone is using this value) */ |
@@ -60,8 +65,8 @@ extern cycles_t cacheflush_time; | |||
60 | 65 | ||
61 | #define WSR_CCOUNT(r) __asm__("wsr %0,"__stringify(CCOUNT) :: "a" (r)) | 66 | #define WSR_CCOUNT(r) __asm__("wsr %0,"__stringify(CCOUNT) :: "a" (r)) |
62 | #define RSR_CCOUNT(r) __asm__("rsr %0,"__stringify(CCOUNT) : "=a" (r)) | 67 | #define RSR_CCOUNT(r) __asm__("rsr %0,"__stringify(CCOUNT) : "=a" (r)) |
63 | #define WSR_CCOMPARE(x,r) __asm__("wsr %0,"__stringify(CCOMPARE_0)"+"__stringify(x) :: "a"(r)) | 68 | #define WSR_CCOMPARE(x,r) __asm__("wsr %0,"__stringify(CCOMPARE)"+"__stringify(x) :: "a"(r)) |
64 | #define RSR_CCOMPARE(x,r) __asm__("rsr %0,"__stringify(CCOMPARE_0)"+"__stringify(x) : "=a"(r)) | 69 | #define RSR_CCOMPARE(x,r) __asm__("rsr %0,"__stringify(CCOMPARE)"+"__stringify(x) : "=a"(r)) |
65 | 70 | ||
66 | static inline unsigned long get_ccount (void) | 71 | static inline unsigned long get_ccount (void) |
67 | { | 72 | { |
diff --git a/include/asm-xtensa/tlbflush.h b/include/asm-xtensa/tlbflush.h index 43f6ec859af9..7c637b3c352c 100644 --- a/include/asm-xtensa/tlbflush.h +++ b/include/asm-xtensa/tlbflush.h | |||
@@ -11,12 +11,20 @@ | |||
11 | #ifndef _XTENSA_TLBFLUSH_H | 11 | #ifndef _XTENSA_TLBFLUSH_H |
12 | #define _XTENSA_TLBFLUSH_H | 12 | #define _XTENSA_TLBFLUSH_H |
13 | 13 | ||
14 | #define DEBUG_TLB | ||
15 | |||
16 | #ifdef __KERNEL__ | 14 | #ifdef __KERNEL__ |
17 | 15 | ||
18 | #include <asm/processor.h> | ||
19 | #include <linux/stringify.h> | 16 | #include <linux/stringify.h> |
17 | #include <asm/processor.h> | ||
18 | |||
19 | #define DTLB_WAY_PGD 7 | ||
20 | |||
21 | #define ITLB_ARF_WAYS 4 | ||
22 | #define DTLB_ARF_WAYS 4 | ||
23 | |||
24 | #define ITLB_HIT_BIT 3 | ||
25 | #define DTLB_HIT_BIT 4 | ||
26 | |||
27 | #ifndef __ASSEMBLY__ | ||
20 | 28 | ||
21 | /* TLB flushing: | 29 | /* TLB flushing: |
22 | * | 30 | * |
@@ -46,11 +54,6 @@ static inline void flush_tlb_pgtables(struct mm_struct *mm, | |||
46 | 54 | ||
47 | /* TLB operations. */ | 55 | /* TLB operations. */ |
48 | 56 | ||
49 | #define ITLB_WAYS_LOG2 XCHAL_ITLB_WAY_BITS | ||
50 | #define DTLB_WAYS_LOG2 XCHAL_DTLB_WAY_BITS | ||
51 | #define ITLB_PROBE_SUCCESS (1 << ITLB_WAYS_LOG2) | ||
52 | #define DTLB_PROBE_SUCCESS (1 << DTLB_WAYS_LOG2) | ||
53 | |||
54 | static inline unsigned long itlb_probe(unsigned long addr) | 57 | static inline unsigned long itlb_probe(unsigned long addr) |
55 | { | 58 | { |
56 | unsigned long tmp; | 59 | unsigned long tmp; |
@@ -131,29 +134,30 @@ static inline void write_itlb_entry (pte_t entry, int way) | |||
131 | 134 | ||
132 | static inline void invalidate_page_directory (void) | 135 | static inline void invalidate_page_directory (void) |
133 | { | 136 | { |
134 | invalidate_dtlb_entry (DTLB_WAY_PGTABLE); | 137 | invalidate_dtlb_entry (DTLB_WAY_PGD); |
138 | invalidate_dtlb_entry (DTLB_WAY_PGD+1); | ||
139 | invalidate_dtlb_entry (DTLB_WAY_PGD+2); | ||
135 | } | 140 | } |
136 | 141 | ||
137 | static inline void invalidate_itlb_mapping (unsigned address) | 142 | static inline void invalidate_itlb_mapping (unsigned address) |
138 | { | 143 | { |
139 | unsigned long tlb_entry; | 144 | unsigned long tlb_entry; |
140 | while ((tlb_entry = itlb_probe (address)) & ITLB_PROBE_SUCCESS) | 145 | if (((tlb_entry = itlb_probe(address)) & (1 << ITLB_HIT_BIT)) != 0) |
141 | invalidate_itlb_entry (tlb_entry); | 146 | invalidate_itlb_entry(tlb_entry); |
142 | } | 147 | } |
143 | 148 | ||
144 | static inline void invalidate_dtlb_mapping (unsigned address) | 149 | static inline void invalidate_dtlb_mapping (unsigned address) |
145 | { | 150 | { |
146 | unsigned long tlb_entry; | 151 | unsigned long tlb_entry; |
147 | while ((tlb_entry = dtlb_probe (address)) & DTLB_PROBE_SUCCESS) | 152 | if (((tlb_entry = dtlb_probe(address)) & (1 << DTLB_HIT_BIT)) != 0) |
148 | invalidate_dtlb_entry (tlb_entry); | 153 | invalidate_dtlb_entry(tlb_entry); |
149 | } | 154 | } |
150 | 155 | ||
151 | #define check_pgt_cache() do { } while (0) | 156 | #define check_pgt_cache() do { } while (0) |
152 | 157 | ||
153 | 158 | ||
154 | #ifdef DEBUG_TLB | 159 | /* |
155 | 160 | * DO NOT USE THESE FUNCTIONS. These instructions aren't part of the Xtensa | |
156 | /* DO NOT USE THESE FUNCTIONS. These instructions aren't part of the Xtensa | ||
157 | * ISA and exist only for test purposes.. | 161 | * ISA and exist only for test purposes.. |
158 | * You may find it helpful for MMU debugging, however. | 162 | * You may find it helpful for MMU debugging, however. |
159 | * | 163 | * |
@@ -193,8 +197,6 @@ static inline unsigned long read_itlb_translation (int way) | |||
193 | return tmp; | 197 | return tmp; |
194 | } | 198 | } |
195 | 199 | ||
196 | #endif /* DEBUG_TLB */ | 200 | #endif /* __ASSEMBLY__ */ |
197 | |||
198 | |||
199 | #endif /* __KERNEL__ */ | 201 | #endif /* __KERNEL__ */ |
200 | #endif /* _XTENSA_PGALLOC_H */ | 202 | #endif /* _XTENSA_TLBFLUSH_H */ |
diff --git a/include/asm-xtensa/unistd.h b/include/asm-xtensa/unistd.h index 2e1a1b997e7d..8a7fb6964ce1 100644 --- a/include/asm-xtensa/unistd.h +++ b/include/asm-xtensa/unistd.h | |||
@@ -11,212 +11,593 @@ | |||
11 | #ifndef _XTENSA_UNISTD_H | 11 | #ifndef _XTENSA_UNISTD_H |
12 | #define _XTENSA_UNISTD_H | 12 | #define _XTENSA_UNISTD_H |
13 | 13 | ||
14 | #define __NR_spill 0 | 14 | #ifndef __SYSCALL |
15 | #define __NR_exit 1 | 15 | # define __SYSCALL(nr,func,nargs) |
16 | #define __NR_read 3 | 16 | #endif |
17 | #define __NR_write 4 | 17 | |
18 | #define __NR_open 5 | 18 | #define __NR_spill 0 |
19 | #define __NR_close 6 | 19 | __SYSCALL( 0, sys_ni_syscall, 0) |
20 | #define __NR_creat 8 | 20 | #define __NR_xtensa 1 |
21 | #define __NR_link 9 | 21 | __SYSCALL( 1, sys_ni_syscall, 0) |
22 | #define __NR_unlink 10 | 22 | #define __NR_available4 2 |
23 | #define __NR_execve 11 | 23 | __SYSCALL( 2, sys_ni_syscall, 0) |
24 | #define __NR_chdir 12 | 24 | #define __NR_available5 3 |
25 | #define __NR_mknod 14 | 25 | __SYSCALL( 3, sys_ni_syscall, 0) |
26 | #define __NR_chmod 15 | 26 | #define __NR_available6 4 |
27 | #define __NR_lchown 16 | 27 | __SYSCALL( 4, sys_ni_syscall, 0) |
28 | #define __NR_break 17 | 28 | #define __NR_available7 5 |
29 | #define __NR_lseek 19 | 29 | __SYSCALL( 5, sys_ni_syscall, 0) |
30 | #define __NR_getpid 20 | 30 | #define __NR_available8 6 |
31 | #define __NR_mount 21 | 31 | __SYSCALL( 6, sys_ni_syscall, 0) |
32 | #define __NR_setuid 23 | 32 | #define __NR_available9 7 |
33 | #define __NR_getuid 24 | 33 | __SYSCALL( 7, sys_ni_syscall, 0) |
34 | #define __NR_ptrace 26 | 34 | |
35 | #define __NR_utime 30 | 35 | /* File Operations */ |
36 | #define __NR_stty 31 | 36 | |
37 | #define __NR_gtty 32 | 37 | #define __NR_open 8 |
38 | #define __NR_access 33 | 38 | __SYSCALL( 8, sys_open, 3) |
39 | #define __NR_ftime 35 | 39 | #define __NR_close 9 |
40 | #define __NR_sync 36 | 40 | __SYSCALL( 9, sys_close, 1) |
41 | #define __NR_kill 37 | 41 | #define __NR_dup 10 |
42 | #define __NR_rename 38 | 42 | __SYSCALL( 10, sys_dup, 1) |
43 | #define __NR_mkdir 39 | 43 | #define __NR_dup2 11 |
44 | #define __NR_rmdir 40 | 44 | __SYSCALL( 11, sys_dup2, 2) |
45 | #define __NR_dup 41 | 45 | #define __NR_read 12 |
46 | #define __NR_pipe 42 | 46 | __SYSCALL( 12, sys_read, 3) |
47 | #define __NR_times 43 | 47 | #define __NR_write 13 |
48 | #define __NR_prof 44 | 48 | __SYSCALL( 13, sys_write, 3) |
49 | #define __NR_brk 45 | 49 | #define __NR_select 14 |
50 | #define __NR_setgid 46 | 50 | __SYSCALL( 14, sys_select, 5) |
51 | #define __NR_getgid 47 | 51 | #define __NR_lseek 15 |
52 | #define __NR_signal 48 | 52 | __SYSCALL( 15, sys_lseek, 3) |
53 | #define __NR_geteuid 49 | 53 | #define __NR_poll 16 |
54 | #define __NR_getegid 50 | 54 | __SYSCALL( 16, sys_poll, 3) |
55 | #define __NR_acct 51 | 55 | #define __NR__llseek 17 |
56 | #define __NR_lock 53 | 56 | __SYSCALL( 17, sys_llseek, 5) |
57 | #define __NR_ioctl 54 | 57 | #define __NR_epoll_wait 18 |
58 | #define __NR_fcntl 55 | 58 | __SYSCALL( 18, sys_epoll_wait, 4) |
59 | #define __NR_setpgid 57 | 59 | #define __NR_epoll_ctl 19 |
60 | #define __NR_ulimit 58 | 60 | __SYSCALL( 19, sys_epoll_ctl, 4) |
61 | #define __NR_umask 60 | 61 | #define __NR_epoll_create 20 |
62 | #define __NR_chroot 61 | 62 | __SYSCALL( 20, sys_epoll_create, 1) |
63 | #define __NR_ustat 62 | 63 | #define __NR_creat 21 |
64 | #define __NR_dup2 63 | 64 | __SYSCALL( 21, sys_creat, 2) |
65 | #define __NR_getppid 64 | 65 | #define __NR_truncate 22 |
66 | #define __NR_setsid 66 | 66 | __SYSCALL( 22, sys_truncate, 2) |
67 | #define __NR_sigaction 67 | 67 | #define __NR_ftruncate 23 |
68 | #define __NR_setreuid 70 | 68 | __SYSCALL( 23, sys_ftruncate, 2) |
69 | #define __NR_setregid 71 | 69 | #define __NR_readv 24 |
70 | #define __NR_sigsuspend 72 | 70 | __SYSCALL( 24, sys_readv, 3) |
71 | #define __NR_sigpending 73 | 71 | #define __NR_writev 25 |
72 | #define __NR_sethostname 74 | 72 | __SYSCALL( 25, sys_writev, 3) |
73 | #define __NR_setrlimit 75 | 73 | #define __NR_fsync 26 |
74 | #define __NR_getrlimit 76 /* Back compatible 2Gig limited rlimit */ | 74 | __SYSCALL( 26, sys_fsync, 1) |
75 | #define __NR_getrusage 77 | 75 | #define __NR_fdatasync 27 |
76 | #define __NR_gettimeofday 78 | 76 | __SYSCALL( 27, sys_fdatasync, 1) |
77 | #define __NR_settimeofday 79 | 77 | #define __NR_truncate64 28 |
78 | #define __NR_getgroups 80 | 78 | __SYSCALL( 28, sys_truncate64, 2) |
79 | #define __NR_setgroups 81 | 79 | #define __NR_ftruncate64 29 |
80 | #define __NR_select 82 | 80 | __SYSCALL( 29, sys_ftruncate64, 2) |
81 | #define __NR_symlink 83 | 81 | #define __NR_pread64 30 |
82 | #define __NR_readlink 85 | 82 | __SYSCALL( 30, sys_pread64, 6) |
83 | #define __NR_uselib 86 | 83 | #define __NR_pwrite64 31 |
84 | #define __NR_swapon 87 | 84 | __SYSCALL( 31, sys_pwrite64, 6) |
85 | #define __NR_reboot 88 | 85 | |
86 | #define __NR_munmap 91 | 86 | #define __NR_link 32 |
87 | #define __NR_truncate 92 | 87 | __SYSCALL( 32, sys_link, 2) |
88 | #define __NR_ftruncate 93 | 88 | #define __NR_rename 33 |
89 | #define __NR_fchmod 94 | 89 | __SYSCALL( 33, sys_rename, 2) |
90 | #define __NR_fchown 95 | 90 | #define __NR_symlink 34 |
91 | #define __NR_getpriority 96 | 91 | __SYSCALL( 34, sys_symlink, 2) |
92 | #define __NR_setpriority 97 | 92 | #define __NR_readlink 35 |
93 | #define __NR_profil 98 | 93 | __SYSCALL( 35, sys_readlink, 3) |
94 | #define __NR_statfs 99 | 94 | #define __NR_mknod 36 |
95 | #define __NR_fstatfs 100 | 95 | __SYSCALL( 36, sys_mknod, 3) |
96 | #define __NR_ioperm 101 | 96 | #define __NR_pipe 37 |
97 | #define __NR_syslog 103 | 97 | __SYSCALL( 37, xtensa_pipe, 1) |
98 | #define __NR_setitimer 104 | 98 | #define __NR_unlink 38 |
99 | #define __NR_getitimer 105 | 99 | __SYSCALL( 38, sys_unlink, 1) |
100 | #define __NR_stat 106 | 100 | #define __NR_rmdir 39 |
101 | #define __NR_lstat 107 | 101 | __SYSCALL( 39, sys_rmdir, 1) |
102 | #define __NR_fstat 108 | 102 | |
103 | #define __NR_iopl 110 | 103 | #define __NR_mkdir 40 |
104 | #define __NR_vhangup 111 | 104 | __SYSCALL( 40, sys_mkdir, 2) |
105 | #define __NR_idle 112 | 105 | #define __NR_chdir 41 |
106 | #define __NR_wait4 114 | 106 | __SYSCALL( 41, sys_chdir, 1) |
107 | #define __NR_swapoff 115 | 107 | #define __NR_fchdir 42 |
108 | #define __NR_sysinfo 116 | 108 | __SYSCALL( 42, sys_fchdir, 1) |
109 | #define __NR_fsync 118 | 109 | #define __NR_getcwd 43 |
110 | #define __NR_sigreturn 119 | 110 | __SYSCALL( 43, sys_getcwd, 2) |
111 | #define __NR_clone 120 | 111 | |
112 | #define __NR_setdomainname 121 | 112 | #define __NR_chmod 44 |
113 | #define __NR_uname 122 | 113 | __SYSCALL( 44, sys_chmod, 2) |
114 | #define __NR_modify_ldt 123 | 114 | #define __NR_chown 45 |
115 | #define __NR_adjtimex 124 | 115 | __SYSCALL( 45, sys_chown, 3) |
116 | #define __NR_mprotect 125 | 116 | #define __NR_stat 46 |
117 | #define __NR_create_module 127 | 117 | __SYSCALL( 46, sys_newstat, 2) |
118 | #define __NR_init_module 128 | 118 | #define __NR_stat64 47 |
119 | #define __NR_delete_module 129 | 119 | __SYSCALL( 47, sys_stat64, 2) |
120 | #define __NR_quotactl 131 | 120 | |
121 | #define __NR_getpgid 132 | 121 | #define __NR_lchown 48 |
122 | #define __NR_fchdir 133 | 122 | __SYSCALL( 48, sys_lchown, 3) |
123 | #define __NR_bdflush 134 | 123 | #define __NR_lstat 49 |
124 | #define __NR_sysfs 135 | 124 | __SYSCALL( 49, sys_newlstat, 2) |
125 | #define __NR_personality 136 | 125 | #define __NR_lstat64 50 |
126 | #define __NR_setfsuid 138 | 126 | __SYSCALL( 50, sys_lstat64, 2) |
127 | #define __NR_setfsgid 139 | 127 | #define __NR_available51 51 |
128 | #define __NR__llseek 140 | 128 | __SYSCALL( 51, sys_ni_syscall, 0) |
129 | #define __NR_getdents 141 | 129 | |
130 | #define __NR__newselect 142 | 130 | #define __NR_fchmod 52 |
131 | #define __NR_flock 143 | 131 | __SYSCALL( 52, sys_fchmod, 2) |
132 | #define __NR_msync 144 | 132 | #define __NR_fchown 53 |
133 | #define __NR_readv 145 | 133 | __SYSCALL( 53, sys_fchown, 3) |
134 | #define __NR_writev 146 | 134 | #define __NR_fstat 54 |
135 | #define __NR_cacheflush 147 | 135 | __SYSCALL( 54, sys_newfstat, 2) |
136 | #define __NR_cachectl 148 | 136 | #define __NR_fstat64 55 |
137 | #define __NR_sysxtensa 149 | 137 | __SYSCALL( 55, sys_fstat64, 2) |
138 | #define __NR_sysdummy 150 | 138 | |
139 | #define __NR_getsid 151 | 139 | #define __NR_flock 56 |
140 | #define __NR_fdatasync 152 | 140 | __SYSCALL( 56, sys_flock, 2) |
141 | #define __NR__sysctl 153 | 141 | #define __NR_access 57 |
142 | #define __NR_mlock 154 | 142 | __SYSCALL( 57, sys_access, 2) |
143 | #define __NR_munlock 155 | 143 | #define __NR_umask 58 |
144 | #define __NR_mlockall 156 | 144 | __SYSCALL( 58, sys_umask, 1) |
145 | #define __NR_munlockall 157 | 145 | #define __NR_getdents 59 |
146 | #define __NR_sched_setparam 158 | 146 | __SYSCALL( 59, sys_getdents, 3) |
147 | #define __NR_sched_getparam 159 | 147 | #define __NR_getdents64 60 |
148 | #define __NR_sched_setscheduler 160 | 148 | __SYSCALL( 60, sys_getdents64, 3) |
149 | #define __NR_sched_getscheduler 161 | 149 | #define __NR_fcntl64 61 |
150 | #define __NR_sched_yield 162 | 150 | __SYSCALL( 61, sys_fcntl64, 3) |
151 | #define __NR_sched_get_priority_max 163 | 151 | #define __NR_available62 62 |
152 | #define __NR_sched_get_priority_min 164 | 152 | __SYSCALL( 62, sys_ni_syscall, 0) |
153 | #define __NR_sched_rr_get_interval 165 | 153 | #define __NR_fadvise64_64 63 |
154 | #define __NR_nanosleep 166 | 154 | __SYSCALL( 63, sys_fadvise64_64, 6) |
155 | #define __NR_mremap 167 | 155 | #define __NR_utime 64 /* glibc 2.3.3 ?? */ |
156 | #define __NR_accept 168 | 156 | __SYSCALL( 64, sys_utime, 2) |
157 | #define __NR_bind 169 | 157 | #define __NR_utimes 65 |
158 | #define __NR_connect 170 | 158 | __SYSCALL( 65, sys_utimes, 2) |
159 | #define __NR_getpeername 171 | 159 | #define __NR_ioctl 66 |
160 | #define __NR_getsockname 172 | 160 | __SYSCALL( 66, sys_ioctl, 3) |
161 | #define __NR_getsockopt 173 | 161 | #define __NR_fcntl 67 |
162 | #define __NR_listen 174 | 162 | __SYSCALL( 67, sys_fcntl, 3) |
163 | #define __NR_recv 175 | 163 | |
164 | #define __NR_recvfrom 176 | 164 | #define __NR_setxattr 68 |
165 | #define __NR_recvmsg 177 | 165 | __SYSCALL( 68, sys_setxattr, 5) |
166 | #define __NR_send 178 | 166 | #define __NR_getxattr 69 |
167 | #define __NR_sendmsg 179 | 167 | __SYSCALL( 69, sys_getxattr, 4) |
168 | #define __NR_sendto 180 | 168 | #define __NR_listxattr 70 |
169 | #define __NR_setsockopt 181 | 169 | __SYSCALL( 70, sys_listxattr, 3) |
170 | #define __NR_shutdown 182 | 170 | #define __NR_removexattr 71 |
171 | #define __NR_socket 183 | 171 | __SYSCALL( 71, sys_removexattr, 2) |
172 | #define __NR_socketpair 184 | 172 | #define __NR_lsetxattr 72 |
173 | #define __NR_setresuid 185 | 173 | __SYSCALL( 72, sys_lsetxattr, 5) |
174 | #define __NR_getresuid 186 | 174 | #define __NR_lgetxattr 73 |
175 | #define __NR_query_module 187 | 175 | __SYSCALL( 73, sys_lgetxattr, 4) |
176 | #define __NR_poll 188 | 176 | #define __NR_llistxattr 74 |
177 | #define __NR_nfsservctl 189 | 177 | __SYSCALL( 74, sys_llistxattr, 3) |
178 | #define __NR_setresgid 190 | 178 | #define __NR_lremovexattr 75 |
179 | #define __NR_getresgid 191 | 179 | __SYSCALL( 75, sys_lremovexattr, 2) |
180 | #define __NR_prctl 192 | 180 | #define __NR_fsetxattr 76 |
181 | #define __NR_rt_sigreturn 193 | 181 | __SYSCALL( 76, sys_fsetxattr, 5) |
182 | #define __NR_rt_sigaction 194 | 182 | #define __NR_fgetxattr 77 |
183 | #define __NR_rt_sigprocmask 195 | 183 | __SYSCALL( 77, sys_fgetxattr, 4) |
184 | #define __NR_rt_sigpending 196 | 184 | #define __NR_flistxattr 78 |
185 | #define __NR_rt_sigtimedwait 197 | 185 | __SYSCALL( 78, sys_flistxattr, 3) |
186 | #define __NR_rt_sigqueueinfo 198 | 186 | #define __NR_fremovexattr 79 |
187 | #define __NR_rt_sigsuspend 199 | 187 | __SYSCALL( 79, sys_fremovexattr, 2) |
188 | #define __NR_pread 200 | 188 | |
189 | #define __NR_pwrite 201 | 189 | /* File Map / Shared Memory Operations */ |
190 | #define __NR_chown 202 | 190 | |
191 | #define __NR_getcwd 203 | 191 | #define __NR_mmap2 80 |
192 | #define __NR_capget 204 | 192 | __SYSCALL( 80, xtensa_mmap2, 6) |
193 | #define __NR_capset 205 | 193 | #define __NR_munmap 81 |
194 | #define __NR_sigaltstack 206 | 194 | __SYSCALL( 81, sys_munmap, 2) |
195 | #define __NR_sendfile 207 | 195 | #define __NR_mprotect 82 |
196 | #define __NR_mmap2 210 | 196 | __SYSCALL( 82, sys_mprotect, 3) |
197 | #define __NR_truncate64 211 | 197 | #define __NR_brk 83 |
198 | #define __NR_ftruncate64 212 | 198 | __SYSCALL( 83, sys_brk, 1) |
199 | #define __NR_stat64 213 | 199 | #define __NR_mlock 84 |
200 | #define __NR_lstat64 214 | 200 | __SYSCALL( 84, sys_mlock, 2) |
201 | #define __NR_fstat64 215 | 201 | #define __NR_munlock 85 |
202 | #define __NR_pivot_root 216 | 202 | __SYSCALL( 85, sys_munlock, 2) |
203 | #define __NR_mincore 217 | 203 | #define __NR_mlockall 86 |
204 | #define __NR_madvise 218 | 204 | __SYSCALL( 86, sys_mlockall, 1) |
205 | #define __NR_getdents64 219 | 205 | #define __NR_munlockall 87 |
206 | 206 | __SYSCALL( 87, sys_munlockall, 0) | |
207 | /* Keep this last; should always equal the last valid call number. */ | 207 | #define __NR_mremap 88 |
208 | #define __NR_Linux_syscalls 220 | 208 | __SYSCALL( 88, sys_mremap, 4) |
209 | 209 | #define __NR_msync 89 | |
210 | /* user-visible error numbers are in the range -1 - -125: see | 210 | __SYSCALL( 89, sys_msync, 3) |
211 | * <asm-xtensa/errno.h> */ | 211 | #define __NR_mincore 90 |
212 | 212 | __SYSCALL( 90, sys_mincore, 3) | |
213 | #define SYSXTENSA_RESERVED 0 /* don't use this */ | 213 | #define __NR_madvise 91 |
214 | #define SYSXTENSA_ATOMIC_SET 1 /* set variable */ | 214 | __SYSCALL( 91, sys_madvise, 3) |
215 | #define SYSXTENSA_ATOMIC_EXG_ADD 2 /* exchange memory and add */ | 215 | #define __NR_shmget 92 |
216 | #define SYSXTENSA_ATOMIC_ADD 3 /* add to memory */ | 216 | __SYSCALL( 92, sys_shmget, 4) |
217 | #define SYSXTENSA_ATOMIC_CMP_SWP 4 /* compare and swap */ | 217 | #define __NR_shmat 93 |
218 | 218 | __SYSCALL( 93, xtensa_shmat, 4) | |
219 | #define SYSXTENSA_COUNT 5 /* count of syscall0 functions*/ | 219 | #define __NR_shmctl 94 |
220 | __SYSCALL( 94, sys_shmctl, 4) | ||
221 | #define __NR_shmdt 95 | ||
222 | __SYSCALL( 95, sys_shmdt, 4) | ||
223 | |||
224 | /* Socket Operations */ | ||
225 | |||
226 | #define __NR_socket 96 | ||
227 | __SYSCALL( 96, sys_socket, 3) | ||
228 | #define __NR_setsockopt 97 | ||
229 | __SYSCALL( 97, sys_setsockopt, 5) | ||
230 | #define __NR_getsockopt 98 | ||
231 | __SYSCALL( 98, sys_getsockopt, 5) | ||
232 | #define __NR_shutdown 99 | ||
233 | __SYSCALL( 99, sys_shutdown, 2) | ||
234 | |||
235 | #define __NR_bind 100 | ||
236 | __SYSCALL(100, sys_bind, 3) | ||
237 | #define __NR_connect 101 | ||
238 | __SYSCALL(101, sys_connect, 3) | ||
239 | #define __NR_listen 102 | ||
240 | __SYSCALL(102, sys_listen, 2) | ||
241 | #define __NR_accept 103 | ||
242 | __SYSCALL(103, sys_accept, 3) | ||
243 | |||
244 | #define __NR_getsockname 104 | ||
245 | __SYSCALL(104, sys_getsockname, 3) | ||
246 | #define __NR_getpeername 105 | ||
247 | __SYSCALL(105, sys_getpeername, 3) | ||
248 | #define __NR_sendmsg 106 | ||
249 | __SYSCALL(106, sys_sendmsg, 3) | ||
250 | #define __NR_recvmsg 107 | ||
251 | __SYSCALL(107, sys_recvmsg, 3) | ||
252 | #define __NR_send 108 | ||
253 | __SYSCALL(108, sys_send, 4) | ||
254 | #define __NR_recv 109 | ||
255 | __SYSCALL(109, sys_recv, 4) | ||
256 | #define __NR_sendto 110 | ||
257 | __SYSCALL(110, sys_sendto, 6) | ||
258 | #define __NR_recvfrom 111 | ||
259 | __SYSCALL(111, sys_recvfrom, 6) | ||
260 | |||
261 | #define __NR_socketpair 112 | ||
262 | __SYSCALL(112, sys_socketpair, 4) | ||
263 | #define __NR_sendfile 113 | ||
264 | __SYSCALL(113, sys_sendfile, 4) | ||
265 | #define __NR_sendfile64 114 | ||
266 | __SYSCALL(114, sys_sendfile64, 4) | ||
267 | #define __NR_available115 115 | ||
268 | __SYSCALL(115, sys_ni_syscall, 0) | ||
269 | |||
270 | /* Process Operations */ | ||
271 | |||
272 | #define __NR_clone 116 | ||
273 | __SYSCALL(116, xtensa_clone, 5) | ||
274 | #define __NR_execve 117 | ||
275 | __SYSCALL(117, xtensa_execve, 3) | ||
276 | #define __NR_exit 118 | ||
277 | __SYSCALL(118, sys_exit, 1) | ||
278 | #define __NR_exit_group 119 | ||
279 | __SYSCALL(119, sys_exit_group, 1) | ||
280 | #define __NR_getpid 120 | ||
281 | __SYSCALL(120, sys_getpid, 0) | ||
282 | #define __NR_wait4 121 | ||
283 | __SYSCALL(121, sys_wait4, 4) | ||
284 | #define __NR_waitid 122 | ||
285 | __SYSCALL(122, sys_waitid, 5) | ||
286 | #define __NR_kill 123 | ||
287 | __SYSCALL(123, sys_kill, 2) | ||
288 | #define __NR_tkill 124 | ||
289 | __SYSCALL(124, sys_tkill, 2) | ||
290 | #define __NR_tgkill 125 | ||
291 | __SYSCALL(125, sys_tgkill, 3) | ||
292 | #define __NR_set_tid_address 126 | ||
293 | __SYSCALL(126, sys_set_tid_address, 1) | ||
294 | #define __NR_gettid 127 | ||
295 | __SYSCALL(127, sys_gettid, 0) | ||
296 | #define __NR_setsid 128 | ||
297 | __SYSCALL(128, sys_setsid, 0) | ||
298 | #define __NR_getsid 129 | ||
299 | __SYSCALL(129, sys_getsid, 1) | ||
300 | #define __NR_prctl 130 | ||
301 | __SYSCALL(130, sys_prctl, 5) | ||
302 | #define __NR_personality 131 | ||
303 | __SYSCALL(131, sys_personality, 1) | ||
304 | #define __NR_getpriority 132 | ||
305 | __SYSCALL(132, sys_getpriority, 2) | ||
306 | #define __NR_setpriority 133 | ||
307 | __SYSCALL(133, sys_setpriority, 3) | ||
308 | #define __NR_setitimer 134 | ||
309 | __SYSCALL(134, sys_setitimer, 3) | ||
310 | #define __NR_getitimer 135 | ||
311 | __SYSCALL(135, sys_getitimer, 2) | ||
312 | #define __NR_setuid 136 | ||
313 | __SYSCALL(136, sys_setuid, 1) | ||
314 | #define __NR_getuid 137 | ||
315 | __SYSCALL(137, sys_getuid, 0) | ||
316 | #define __NR_setgid 138 | ||
317 | __SYSCALL(138, sys_setgid, 1) | ||
318 | #define __NR_getgid 139 | ||
319 | __SYSCALL(139, sys_getgid, 0) | ||
320 | #define __NR_geteuid 140 | ||
321 | __SYSCALL(140, sys_geteuid, 0) | ||
322 | #define __NR_getegid 141 | ||
323 | __SYSCALL(141, sys_getegid, 0) | ||
324 | #define __NR_setreuid 142 | ||
325 | __SYSCALL(142, sys_setreuid, 2) | ||
326 | #define __NR_setregid 143 | ||
327 | __SYSCALL(143, sys_setregid, 2) | ||
328 | #define __NR_setresuid 144 | ||
329 | __SYSCALL(144, sys_setresuid, 3) | ||
330 | #define __NR_getresuid 145 | ||
331 | __SYSCALL(145, sys_getresuid, 3) | ||
332 | #define __NR_setresgid 146 | ||
333 | __SYSCALL(146, sys_setresgid, 3) | ||
334 | #define __NR_getresgid 147 | ||
335 | __SYSCALL(147, sys_getresgid, 3) | ||
336 | #define __NR_setpgid 148 | ||
337 | __SYSCALL(148, sys_setpgid, 2) | ||
338 | #define __NR_getpgid 149 | ||
339 | __SYSCALL(149, sys_getpgid, 1) | ||
340 | #define __NR_getppid 150 | ||
341 | __SYSCALL(150, sys_getppid, 0) | ||
342 | #define __NR_available151 151 | ||
343 | __SYSCALL(151, sys_ni_syscall, 0) | ||
344 | |||
345 | #define __NR_reserved152 152 /* set_thread_area */ | ||
346 | __SYSCALL(152, sys_ni_syscall, 0) | ||
347 | #define __NR_reserved153 153 /* get_thread_area */ | ||
348 | __SYSCALL(153, sys_ni_syscall, 0) | ||
349 | #define __NR_times 154 | ||
350 | __SYSCALL(154, sys_times, 1) | ||
351 | #define __NR_acct 155 | ||
352 | __SYSCALL(155, sys_acct, 1) | ||
353 | #define __NR_sched_setaffinity 156 | ||
354 | __SYSCALL(156, sys_sched_setaffinity, 3) | ||
355 | #define __NR_sched_getaffinity 157 | ||
356 | __SYSCALL(157, sys_sched_getaffinity, 3) | ||
357 | #define __NR_capget 158 | ||
358 | __SYSCALL(158, sys_capget, 2) | ||
359 | #define __NR_capset 159 | ||
360 | __SYSCALL(159, sys_capset, 2) | ||
361 | #define __NR_ptrace 160 | ||
362 | __SYSCALL(160, sys_ptrace, 4) | ||
363 | #define __NR_semtimedop 161 | ||
364 | __SYSCALL(161, sys_semtimedop, 5) | ||
365 | #define __NR_semget 162 | ||
366 | __SYSCALL(162, sys_semget, 4) | ||
367 | #define __NR_semop 163 | ||
368 | __SYSCALL(163, sys_semop, 4) | ||
369 | #define __NR_semctl 164 | ||
370 | __SYSCALL(164, sys_semctl, 4) | ||
371 | #define __NR_available165 165 | ||
372 | __SYSCALL(165, sys_ni_syscall, 0) | ||
373 | #define __NR_msgget 166 | ||
374 | __SYSCALL(166, sys_msgget, 4) | ||
375 | #define __NR_msgsnd 167 | ||
376 | __SYSCALL(167, sys_msgsnd, 4) | ||
377 | #define __NR_msgrcv 168 | ||
378 | __SYSCALL(168, sys_msgrcv, 4) | ||
379 | #define __NR_msgctl 169 | ||
380 | __SYSCALL(169, sys_msgctl, 4) | ||
381 | #define __NR_available170 170 | ||
382 | __SYSCALL(170, sys_ni_syscall, 0) | ||
383 | #define __NR_available171 171 | ||
384 | __SYSCALL(171, sys_ni_syscall, 0) | ||
385 | |||
386 | /* File System */ | ||
387 | |||
388 | #define __NR_mount 172 | ||
389 | __SYSCALL(172, sys_mount, 5) | ||
390 | #define __NR_swapon 173 | ||
391 | __SYSCALL(173, sys_swapon, 2) | ||
392 | #define __NR_chroot 174 | ||
393 | __SYSCALL(174, sys_chroot, 1) | ||
394 | #define __NR_pivot_root 175 | ||
395 | __SYSCALL(175, sys_pivot_root, 2) | ||
396 | #define __NR_umount 176 | ||
397 | __SYSCALL(176, sys_umount, 2) | ||
398 | #define __NR_swapoff 177 | ||
399 | __SYSCALL(177, sys_swapoff, 1) | ||
400 | #define __NR_sync 178 | ||
401 | __SYSCALL(178, sys_sync, 0) | ||
402 | #define __NR_available179 179 | ||
403 | __SYSCALL(179, sys_ni_syscall, 0) | ||
404 | #define __NR_setfsuid 180 | ||
405 | __SYSCALL(180, sys_setfsuid, 1) | ||
406 | #define __NR_setfsgid 181 | ||
407 | __SYSCALL(181, sys_setfsgid, 1) | ||
408 | #define __NR_sysfs 182 | ||
409 | __SYSCALL(182, sys_sysfs, 3) | ||
410 | #define __NR_ustat 183 | ||
411 | __SYSCALL(183, sys_ustat, 2) | ||
412 | #define __NR_statfs 184 | ||
413 | __SYSCALL(184, sys_statfs, 2) | ||
414 | #define __NR_fstatfs 185 | ||
415 | __SYSCALL(185, sys_fstatfs, 2) | ||
416 | #define __NR_statfs64 186 | ||
417 | __SYSCALL(186, sys_statfs64, 3) | ||
418 | #define __NR_fstatfs64 187 | ||
419 | __SYSCALL(187, sys_fstatfs64, 3) | ||
420 | |||
421 | /* System */ | ||
422 | |||
423 | #define __NR_setrlimit 188 | ||
424 | __SYSCALL(188, sys_setrlimit, 2) | ||
425 | #define __NR_getrlimit 189 | ||
426 | __SYSCALL(189, sys_getrlimit, 2) | ||
427 | #define __NR_getrusage 190 | ||
428 | __SYSCALL(190, sys_getrusage, 2) | ||
429 | #define __NR_futex 191 | ||
430 | __SYSCALL(191, sys_futex, 5) | ||
431 | #define __NR_gettimeofday 192 | ||
432 | __SYSCALL(192, sys_gettimeofday, 2) | ||
433 | #define __NR_settimeofday 193 | ||
434 | __SYSCALL(193, sys_settimeofday, 2) | ||
435 | #define __NR_adjtimex 194 | ||
436 | __SYSCALL(194, sys_adjtimex, 1) | ||
437 | #define __NR_nanosleep 195 | ||
438 | __SYSCALL(195, sys_nanosleep, 2) | ||
439 | #define __NR_getgroups 196 | ||
440 | __SYSCALL(196, sys_getgroups, 2) | ||
441 | #define __NR_setgroups 197 | ||
442 | __SYSCALL(197, sys_setgroups, 2) | ||
443 | #define __NR_sethostname 198 | ||
444 | __SYSCALL(198, sys_sethostname, 2) | ||
445 | #define __NR_setdomainname 199 | ||
446 | __SYSCALL(199, sys_setdomainname, 2) | ||
447 | #define __NR_syslog 200 | ||
448 | __SYSCALL(200, sys_syslog, 3) | ||
449 | #define __NR_vhangup 201 | ||
450 | __SYSCALL(201, sys_vhangup, 0) | ||
451 | #define __NR_uselib 202 | ||
452 | __SYSCALL(202, sys_uselib, 1) | ||
453 | #define __NR_reboot 203 | ||
454 | __SYSCALL(203, sys_reboot, 3) | ||
455 | #define __NR_quotactl 204 | ||
456 | __SYSCALL(204, sys_quotactl, 4) | ||
457 | #define __NR_nfsservctl 205 | ||
458 | __SYSCALL(205, sys_nfsservctl, 3) | ||
459 | #define __NR__sysctl 206 | ||
460 | __SYSCALL(206, sys_sysctl, 1) | ||
461 | #define __NR_bdflush 207 | ||
462 | __SYSCALL(207, sys_bdflush, 2) | ||
463 | #define __NR_uname 208 | ||
464 | __SYSCALL(208, sys_newuname, 1) | ||
465 | #define __NR_sysinfo 209 | ||
466 | __SYSCALL(209, sys_sysinfo, 1) | ||
467 | #define __NR_init_module 210 | ||
468 | __SYSCALL(210, sys_init_module, 2) | ||
469 | #define __NR_delete_module 211 | ||
470 | __SYSCALL(211, sys_delete_module, 1) | ||
471 | |||
472 | #define __NR_sched_setparam 212 | ||
473 | __SYSCALL(212, sys_sched_setparam, 2) | ||
474 | #define __NR_sched_getparam 213 | ||
475 | __SYSCALL(213, sys_sched_getparam, 2) | ||
476 | #define __NR_sched_setscheduler 214 | ||
477 | __SYSCALL(214, sys_sched_setscheduler, 3) | ||
478 | #define __NR_sched_getscheduler 215 | ||
479 | __SYSCALL(215, sys_sched_getscheduler, 1) | ||
480 | #define __NR_sched_get_priority_max 216 | ||
481 | __SYSCALL(216, sys_sched_get_priority_max, 1) | ||
482 | #define __NR_sched_get_priority_min 217 | ||
483 | __SYSCALL(217, sys_sched_get_priority_min, 1) | ||
484 | #define __NR_sched_rr_get_interval 218 | ||
485 | __SYSCALL(218, sys_sched_rr_get_interval, 2) | ||
486 | #define __NR_sched_yield 219 | ||
487 | __SYSCALL(219, sys_sched_yield, 0) | ||
488 | #define __NR_sigreturn 222 | ||
489 | __SYSCALL(222, xtensa_sigreturn, 0) | ||
490 | |||
491 | /* Signal Handling */ | ||
492 | |||
493 | #define __NR_restart_syscall 223 | ||
494 | __SYSCALL(223, sys_restart_syscall, 0) | ||
495 | #define __NR_sigaltstack 224 | ||
496 | __SYSCALL(224, xtensa_sigaltstack, 2) | ||
497 | #define __NR_rt_sigreturn 225 | ||
498 | __SYSCALL(225, xtensa_rt_sigreturn, 1) | ||
499 | #define __NR_rt_sigaction 226 | ||
500 | __SYSCALL(226, sys_rt_sigaction, 4) | ||
501 | #define __NR_rt_sigprocmask 227 | ||
502 | __SYSCALL(227, sys_rt_sigprocmask, 4) | ||
503 | #define __NR_rt_sigpending 228 | ||
504 | __SYSCALL(228, sys_rt_sigpending, 2) | ||
505 | #define __NR_rt_sigtimedwait 229 | ||
506 | __SYSCALL(229, sys_rt_sigtimedwait, 4) | ||
507 | #define __NR_rt_sigqueueinfo 230 | ||
508 | __SYSCALL(230, sys_rt_sigqueueinfo, 3) | ||
509 | #define __NR_rt_sigsuspend 231 | ||
510 | __SYSCALL(231, xtensa_rt_sigsuspend, 2) | ||
511 | |||
512 | /* Message */ | ||
513 | |||
514 | #define __NR_mq_open 232 | ||
515 | __SYSCALL(232, sys_mq_open, 4) | ||
516 | #define __NR_mq_unlink 233 | ||
517 | __SYSCALL(233, sys_mq_unlink, 1) | ||
518 | #define __NR_mq_timedsend 234 | ||
519 | __SYSCALL(234, sys_mq_timedsend, 5) | ||
520 | #define __NR_mq_timedreceive 235 | ||
521 | __SYSCALL(235, sys_mq_timedreceive, 5) | ||
522 | #define __NR_mq_notify 236 | ||
523 | __SYSCALL(236, sys_mq_notify, 2) | ||
524 | #define __NR_mq_getsetattr 237 | ||
525 | __SYSCALL(237, sys_mq_getsetattr, 3) | ||
526 | #define __NR_available238 238 | ||
527 | __SYSCALL(238, sys_ni_syscall, 0) | ||
528 | |||
529 | /* IO */ | ||
530 | |||
531 | #define __NR_io_setup 239 | ||
532 | __SYSCALL(239, sys_io_setup, 2) | ||
533 | #define __NR_io_destroy 240 | ||
534 | __SYSCALL(240, sys_io_destroy, 1) | ||
535 | #define __NR_io_submit 241 | ||
536 | __SYSCALL(241, sys_io_submit, 3) | ||
537 | #define __NR_io_getevents 242 | ||
538 | __SYSCALL(242, sys_io_getevents, 5) | ||
539 | #define __NR_io_cancel 243 | ||
540 | __SYSCALL(243, sys_io_cancel, 3) | ||
541 | #define __NR_clock_settime 244 | ||
542 | __SYSCALL(244, sys_clock_settime, 2) | ||
543 | #define __NR_clock_gettime 245 | ||
544 | __SYSCALL(245, sys_clock_gettime, 2) | ||
545 | #define __NR_clock_getres 246 | ||
546 | __SYSCALL(246, sys_clock_getres, 2) | ||
547 | #define __NR_clock_nanosleep 247 | ||
548 | __SYSCALL(247, sys_clock_nanosleep, 4) | ||
549 | |||
550 | /* Timer */ | ||
551 | |||
552 | #define __NR_timer_create 248 | ||
553 | __SYSCALL(248, sys_timer_create, 3) | ||
554 | #define __NR_timer_delete 249 | ||
555 | __SYSCALL(249, sys_timer_delete, 1) | ||
556 | #define __NR_timer_settime 250 | ||
557 | __SYSCALL(250, sys_timer_settime, 4) | ||
558 | #define __NR_timer_gettime 251 | ||
559 | __SYSCALL(251, sys_timer_gettime, 2) | ||
560 | #define __NR_timer_getoverrun 252 | ||
561 | __SYSCALL(252, sys_timer_getoverrun, 1) | ||
562 | |||
563 | /* System */ | ||
564 | |||
565 | #define __NR_reserved244 253 | ||
566 | __SYSCALL(253, sys_ni_syscall, 0) | ||
567 | #define __NR_lookup_dcookie 254 | ||
568 | __SYSCALL(254, sys_lookup_dcookie, 4) | ||
569 | #define __NR_available255 255 | ||
570 | __SYSCALL(255, sys_ni_syscall, 0) | ||
571 | #define __NR_add_key 256 | ||
572 | __SYSCALL(256, sys_add_key, 5) | ||
573 | #define __NR_request_key 257 | ||
574 | __SYSCALL(257, sys_request_key, 5) | ||
575 | #define __NR_keyctl 258 | ||
576 | __SYSCALL(258, sys_keyctl, 5) | ||
577 | #define __NR_available259 259 | ||
578 | __SYSCALL(259, sys_ni_syscall, 0) | ||
579 | |||
580 | #define __NR_syscall_count 261 | ||
581 | |||
582 | /* | ||
583 | * sysxtensa syscall handler | ||
584 | * | ||
585 | * int sysxtensa (SYS_XTENSA_ATOMIC_SET, ptr, val, unused); | ||
586 | * int sysxtensa (SYS_XTENSA_ATOMIC_ADD, ptr, val, unused); | ||
587 | * int sysxtensa (SYS_XTENSA_ATOMIC_EXG_ADD, ptr, val, unused); | ||
588 | * int sysxtensa (SYS_XTENSA_ATOMIC_CMP_SWP, ptr, oldval, newval); | ||
589 | * a2 a6 a3 a4 a5 | ||
590 | */ | ||
591 | |||
592 | #define SYS_XTENSA_RESERVED 0 /* don't use this */ | ||
593 | #define SYS_XTENSA_ATOMIC_SET 1 /* set variable */ | ||
594 | #define SYS_XTENSA_ATOMIC_EXG_ADD 2 /* exchange memory and add */ | ||
595 | #define SYS_XTENSA_ATOMIC_ADD 3 /* add to memory */ | ||
596 | #define SYS_XTENSA_ATOMIC_CMP_SWP 4 /* compare and swap */ | ||
597 | |||
598 | #define SYS_XTENSA_COUNT 5 /* count */ | ||
599 | |||
600 | #ifdef __KERNEL__ | ||
220 | 601 | ||
221 | /* | 602 | /* |
222 | * "Conditional" syscalls | 603 | * "Conditional" syscalls |
@@ -230,6 +611,9 @@ | |||
230 | #define __ARCH_WANT_SYS_UTIME | 611 | #define __ARCH_WANT_SYS_UTIME |
231 | #define __ARCH_WANT_SYS_LLSEEK | 612 | #define __ARCH_WANT_SYS_LLSEEK |
232 | #define __ARCH_WANT_SYS_RT_SIGACTION | 613 | #define __ARCH_WANT_SYS_RT_SIGACTION |
233 | #endif /* __KERNEL__ */ | 614 | #define __ARCH_WANT_SYS_RT_SIGSUSPEND |
615 | |||
616 | #endif /* __KERNEL__ */ | ||
234 | 617 | ||
235 | #endif /* _XTENSA_UNISTD_H */ | 618 | #endif /* _XTENSA_UNISTD_H */ |
619 | |||
diff --git a/include/asm-xtensa/variant-fsf/core.h b/include/asm-xtensa/variant-fsf/core.h new file mode 100644 index 000000000000..2f337605c744 --- /dev/null +++ b/include/asm-xtensa/variant-fsf/core.h | |||
@@ -0,0 +1,359 @@ | |||
1 | /* | ||
2 | * Xtensa processor core configuration information. | ||
3 | * | ||
4 | * This file is subject to the terms and conditions of the GNU General Public | ||
5 | * License. See the file "COPYING" in the main directory of this archive | ||
6 | * for more details. | ||
7 | * | ||
8 | * Copyright (C) 1999-2006 Tensilica Inc. | ||
9 | */ | ||
10 | |||
11 | #ifndef _XTENSA_CORE_H | ||
12 | #define _XTENSA_CORE_H | ||
13 | |||
14 | |||
15 | /**************************************************************************** | ||
16 | Parameters Useful for Any Code, USER or PRIVILEGED | ||
17 | ****************************************************************************/ | ||
18 | |||
19 | /* | ||
20 | * Note: Macros of the form XCHAL_HAVE_*** have a value of 1 if the option is | ||
21 | * configured, and a value of 0 otherwise. These macros are always defined. | ||
22 | */ | ||
23 | |||
24 | |||
25 | /*---------------------------------------------------------------------- | ||
26 | ISA | ||
27 | ----------------------------------------------------------------------*/ | ||
28 | |||
29 | #define XCHAL_HAVE_BE 1 /* big-endian byte ordering */ | ||
30 | #define XCHAL_HAVE_WINDOWED 1 /* windowed registers option */ | ||
31 | #define XCHAL_NUM_AREGS 64 /* num of physical addr regs */ | ||
32 | #define XCHAL_NUM_AREGS_LOG2 6 /* log2(XCHAL_NUM_AREGS) */ | ||
33 | #define XCHAL_MAX_INSTRUCTION_SIZE 3 /* max instr bytes (3..8) */ | ||
34 | #define XCHAL_HAVE_DEBUG 1 /* debug option */ | ||
35 | #define XCHAL_HAVE_DENSITY 1 /* 16-bit instructions */ | ||
36 | #define XCHAL_HAVE_LOOPS 1 /* zero-overhead loops */ | ||
37 | #define XCHAL_HAVE_NSA 1 /* NSA/NSAU instructions */ | ||
38 | #define XCHAL_HAVE_MINMAX 0 /* MIN/MAX instructions */ | ||
39 | #define XCHAL_HAVE_SEXT 0 /* SEXT instruction */ | ||
40 | #define XCHAL_HAVE_CLAMPS 0 /* CLAMPS instruction */ | ||
41 | #define XCHAL_HAVE_MUL16 0 /* MUL16S/MUL16U instructions */ | ||
42 | #define XCHAL_HAVE_MUL32 0 /* MULL instruction */ | ||
43 | #define XCHAL_HAVE_MUL32_HIGH 0 /* MULUH/MULSH instructions */ | ||
44 | #define XCHAL_HAVE_L32R 1 /* L32R instruction */ | ||
45 | #define XCHAL_HAVE_ABSOLUTE_LITERALS 1 /* non-PC-rel (extended) L32R */ | ||
46 | #define XCHAL_HAVE_CONST16 0 /* CONST16 instruction */ | ||
47 | #define XCHAL_HAVE_ADDX 1 /* ADDX#/SUBX# instructions */ | ||
48 | #define XCHAL_HAVE_WIDE_BRANCHES 0 /* B*.W18 or B*.W15 instr's */ | ||
49 | #define XCHAL_HAVE_PREDICTED_BRANCHES 0 /* B[EQ/EQZ/NE/NEZ]T instr's */ | ||
50 | #define XCHAL_HAVE_CALL4AND12 1 /* (obsolete option) */ | ||
51 | #define XCHAL_HAVE_ABS 1 /* ABS instruction */ | ||
52 | /*#define XCHAL_HAVE_POPC 0*/ /* POPC instruction */ | ||
53 | /*#define XCHAL_HAVE_CRC 0*/ /* CRC instruction */ | ||
54 | #define XCHAL_HAVE_RELEASE_SYNC 0 /* L32AI/S32RI instructions */ | ||
55 | #define XCHAL_HAVE_S32C1I 0 /* S32C1I instruction */ | ||
56 | #define XCHAL_HAVE_SPECULATION 0 /* speculation */ | ||
57 | #define XCHAL_HAVE_FULL_RESET 1 /* all regs/state reset */ | ||
58 | #define XCHAL_NUM_CONTEXTS 1 /* */ | ||
59 | #define XCHAL_NUM_MISC_REGS 2 /* num of scratch regs (0..4) */ | ||
60 | #define XCHAL_HAVE_TAP_MASTER 0 /* JTAG TAP control instr's */ | ||
61 | #define XCHAL_HAVE_PRID 1 /* processor ID register */ | ||
62 | #define XCHAL_HAVE_THREADPTR 1 /* THREADPTR register */ | ||
63 | #define XCHAL_HAVE_BOOLEANS 0 /* boolean registers */ | ||
64 | #define XCHAL_HAVE_CP 0 /* CPENABLE reg (coprocessor) */ | ||
65 | #define XCHAL_CP_MAXCFG 0 /* max allowed cp id plus one */ | ||
66 | #define XCHAL_HAVE_MAC16 0 /* MAC16 package */ | ||
67 | #define XCHAL_HAVE_VECTORFPU2005 0 /* vector floating-point pkg */ | ||
68 | #define XCHAL_HAVE_FP 0 /* floating point pkg */ | ||
69 | #define XCHAL_HAVE_VECTRA1 0 /* Vectra I pkg */ | ||
70 | #define XCHAL_HAVE_VECTRALX 0 /* Vectra LX pkg */ | ||
71 | #define XCHAL_HAVE_HIFI2 0 /* HiFi2 Audio Engine pkg */ | ||
72 | |||
73 | |||
74 | /*---------------------------------------------------------------------- | ||
75 | MISC | ||
76 | ----------------------------------------------------------------------*/ | ||
77 | |||
78 | #define XCHAL_NUM_WRITEBUFFER_ENTRIES 4 /* size of write buffer */ | ||
79 | #define XCHAL_INST_FETCH_WIDTH 4 /* instr-fetch width in bytes */ | ||
80 | #define XCHAL_DATA_WIDTH 4 /* data width in bytes */ | ||
81 | /* In T1050, applies to selected core load and store instructions (see ISA): */ | ||
82 | #define XCHAL_UNALIGNED_LOAD_EXCEPTION 1 /* unaligned loads cause exc. */ | ||
83 | #define XCHAL_UNALIGNED_STORE_EXCEPTION 1 /* unaligned stores cause exc.*/ | ||
84 | |||
85 | #define XCHAL_CORE_ID "fsf" /* alphanum core name | ||
86 | (CoreID) set in the Xtensa | ||
87 | Processor Generator */ | ||
88 | |||
89 | #define XCHAL_BUILD_UNIQUE_ID 0x00006700 /* 22-bit sw build ID */ | ||
90 | |||
91 | /* | ||
92 | * These definitions describe the hardware targeted by this software. | ||
93 | */ | ||
94 | #define XCHAL_HW_CONFIGID0 0xC103C3FF /* ConfigID hi 32 bits*/ | ||
95 | #define XCHAL_HW_CONFIGID1 0x0C006700 /* ConfigID lo 32 bits*/ | ||
96 | #define XCHAL_HW_VERSION_NAME "LX2.0.0" /* full version name */ | ||
97 | #define XCHAL_HW_VERSION_MAJOR 2200 /* major ver# of targeted hw */ | ||
98 | #define XCHAL_HW_VERSION_MINOR 0 /* minor ver# of targeted hw */ | ||
99 | #define XTHAL_HW_REL_LX2 1 | ||
100 | #define XTHAL_HW_REL_LX2_0 1 | ||
101 | #define XTHAL_HW_REL_LX2_0_0 1 | ||
102 | #define XCHAL_HW_CONFIGID_RELIABLE 1 | ||
103 | /* If software targets a *range* of hardware versions, these are the bounds: */ | ||
104 | #define XCHAL_HW_MIN_VERSION_MAJOR 2200 /* major v of earliest tgt hw */ | ||
105 | #define XCHAL_HW_MIN_VERSION_MINOR 0 /* minor v of earliest tgt hw */ | ||
106 | #define XCHAL_HW_MAX_VERSION_MAJOR 2200 /* major v of latest tgt hw */ | ||
107 | #define XCHAL_HW_MAX_VERSION_MINOR 0 /* minor v of latest tgt hw */ | ||
108 | |||
109 | |||
110 | /*---------------------------------------------------------------------- | ||
111 | CACHE | ||
112 | ----------------------------------------------------------------------*/ | ||
113 | |||
114 | #define XCHAL_ICACHE_LINESIZE 16 /* I-cache line size in bytes */ | ||
115 | #define XCHAL_DCACHE_LINESIZE 16 /* D-cache line size in bytes */ | ||
116 | #define XCHAL_ICACHE_LINEWIDTH 4 /* log2(I line size in bytes) */ | ||
117 | #define XCHAL_DCACHE_LINEWIDTH 4 /* log2(D line size in bytes) */ | ||
118 | |||
119 | #define XCHAL_ICACHE_SIZE 8192 /* I-cache size in bytes or 0 */ | ||
120 | #define XCHAL_DCACHE_SIZE 8192 /* D-cache size in bytes or 0 */ | ||
121 | |||
122 | #define XCHAL_DCACHE_IS_WRITEBACK 0 /* writeback feature */ | ||
123 | |||
124 | |||
125 | |||
126 | |||
127 | /**************************************************************************** | ||
128 | Parameters Useful for PRIVILEGED (Supervisory or Non-Virtualized) Code | ||
129 | ****************************************************************************/ | ||
130 | |||
131 | |||
132 | #ifndef XTENSA_HAL_NON_PRIVILEGED_ONLY | ||
133 | |||
134 | /*---------------------------------------------------------------------- | ||
135 | CACHE | ||
136 | ----------------------------------------------------------------------*/ | ||
137 | |||
138 | #define XCHAL_HAVE_PIF 1 /* any outbound PIF present */ | ||
139 | |||
140 | /* If present, cache size in bytes == (ways * 2^(linewidth + setwidth)). */ | ||
141 | |||
142 | /* Number of cache sets in log2(lines per way): */ | ||
143 | #define XCHAL_ICACHE_SETWIDTH 8 | ||
144 | #define XCHAL_DCACHE_SETWIDTH 8 | ||
145 | |||
146 | /* Cache set associativity (number of ways): */ | ||
147 | #define XCHAL_ICACHE_WAYS 2 | ||
148 | #define XCHAL_DCACHE_WAYS 2 | ||
149 | |||
150 | /* Cache features: */ | ||
151 | #define XCHAL_ICACHE_LINE_LOCKABLE 0 | ||
152 | #define XCHAL_DCACHE_LINE_LOCKABLE 0 | ||
153 | #define XCHAL_ICACHE_ECC_PARITY 0 | ||
154 | #define XCHAL_DCACHE_ECC_PARITY 0 | ||
155 | |||
156 | /* Number of encoded cache attr bits (see <xtensa/hal.h> for decoded bits): */ | ||
157 | #define XCHAL_CA_BITS 4 | ||
158 | |||
159 | |||
160 | /*---------------------------------------------------------------------- | ||
161 | INTERNAL I/D RAM/ROMs and XLMI | ||
162 | ----------------------------------------------------------------------*/ | ||
163 | |||
164 | #define XCHAL_NUM_INSTROM 0 /* number of core instr. ROMs */ | ||
165 | #define XCHAL_NUM_INSTRAM 0 /* number of core instr. RAMs */ | ||
166 | #define XCHAL_NUM_DATAROM 0 /* number of core data ROMs */ | ||
167 | #define XCHAL_NUM_DATARAM 0 /* number of core data RAMs */ | ||
168 | #define XCHAL_NUM_URAM 0 /* number of core unified RAMs*/ | ||
169 | #define XCHAL_NUM_XLMI 0 /* number of core XLMI ports */ | ||
170 | |||
171 | |||
172 | /*---------------------------------------------------------------------- | ||
173 | INTERRUPTS and TIMERS | ||
174 | ----------------------------------------------------------------------*/ | ||
175 | |||
176 | #define XCHAL_HAVE_INTERRUPTS 1 /* interrupt option */ | ||
177 | #define XCHAL_HAVE_HIGHPRI_INTERRUPTS 1 /* med/high-pri. interrupts */ | ||
178 | #define XCHAL_HAVE_NMI 0 /* non-maskable interrupt */ | ||
179 | #define XCHAL_HAVE_CCOUNT 1 /* CCOUNT reg. (timer option) */ | ||
180 | #define XCHAL_NUM_TIMERS 3 /* number of CCOMPAREn regs */ | ||
181 | #define XCHAL_NUM_INTERRUPTS 17 /* number of interrupts */ | ||
182 | #define XCHAL_NUM_INTERRUPTS_LOG2 5 /* ceil(log2(NUM_INTERRUPTS)) */ | ||
183 | #define XCHAL_NUM_EXTINTERRUPTS 10 /* num of external interrupts */ | ||
184 | #define XCHAL_NUM_INTLEVELS 4 /* number of interrupt levels | ||
185 | (not including level zero) */ | ||
186 | #define XCHAL_EXCM_LEVEL 1 /* level masked by PS.EXCM */ | ||
187 | /* (always 1 in XEA1; levels 2 .. EXCM_LEVEL are "medium priority") */ | ||
188 | |||
189 | /* Masks of interrupts at each interrupt level: */ | ||
190 | #define XCHAL_INTLEVEL1_MASK 0x000064F9 | ||
191 | #define XCHAL_INTLEVEL2_MASK 0x00008902 | ||
192 | #define XCHAL_INTLEVEL3_MASK 0x00011204 | ||
193 | #define XCHAL_INTLEVEL4_MASK 0x00000000 | ||
194 | #define XCHAL_INTLEVEL5_MASK 0x00000000 | ||
195 | #define XCHAL_INTLEVEL6_MASK 0x00000000 | ||
196 | #define XCHAL_INTLEVEL7_MASK 0x00000000 | ||
197 | |||
198 | /* Masks of interrupts at each range 1..n of interrupt levels: */ | ||
199 | #define XCHAL_INTLEVEL1_ANDBELOW_MASK 0x000064F9 | ||
200 | #define XCHAL_INTLEVEL2_ANDBELOW_MASK 0x0000EDFB | ||
201 | #define XCHAL_INTLEVEL3_ANDBELOW_MASK 0x0001FFFF | ||
202 | #define XCHAL_INTLEVEL4_ANDBELOW_MASK 0x0001FFFF | ||
203 | #define XCHAL_INTLEVEL5_ANDBELOW_MASK 0x0001FFFF | ||
204 | #define XCHAL_INTLEVEL6_ANDBELOW_MASK 0x0001FFFF | ||
205 | #define XCHAL_INTLEVEL7_ANDBELOW_MASK 0x0001FFFF | ||
206 | |||
207 | /* Level of each interrupt: */ | ||
208 | #define XCHAL_INT0_LEVEL 1 | ||
209 | #define XCHAL_INT1_LEVEL 2 | ||
210 | #define XCHAL_INT2_LEVEL 3 | ||
211 | #define XCHAL_INT3_LEVEL 1 | ||
212 | #define XCHAL_INT4_LEVEL 1 | ||
213 | #define XCHAL_INT5_LEVEL 1 | ||
214 | #define XCHAL_INT6_LEVEL 1 | ||
215 | #define XCHAL_INT7_LEVEL 1 | ||
216 | #define XCHAL_INT8_LEVEL 2 | ||
217 | #define XCHAL_INT9_LEVEL 3 | ||
218 | #define XCHAL_INT10_LEVEL 1 | ||
219 | #define XCHAL_INT11_LEVEL 2 | ||
220 | #define XCHAL_INT12_LEVEL 3 | ||
221 | #define XCHAL_INT13_LEVEL 1 | ||
222 | #define XCHAL_INT14_LEVEL 1 | ||
223 | #define XCHAL_INT15_LEVEL 2 | ||
224 | #define XCHAL_INT16_LEVEL 3 | ||
225 | #define XCHAL_DEBUGLEVEL 4 /* debug interrupt level */ | ||
226 | #define XCHAL_HAVE_DEBUG_EXTERN_INT 0 /* OCD external db interrupt */ | ||
227 | |||
228 | /* Type of each interrupt: */ | ||
229 | #define XCHAL_INT0_TYPE XTHAL_INTTYPE_EXTERN_LEVEL | ||
230 | #define XCHAL_INT1_TYPE XTHAL_INTTYPE_EXTERN_LEVEL | ||
231 | #define XCHAL_INT2_TYPE XTHAL_INTTYPE_EXTERN_LEVEL | ||
232 | #define XCHAL_INT3_TYPE XTHAL_INTTYPE_EXTERN_LEVEL | ||
233 | #define XCHAL_INT4_TYPE XTHAL_INTTYPE_EXTERN_LEVEL | ||
234 | #define XCHAL_INT5_TYPE XTHAL_INTTYPE_EXTERN_LEVEL | ||
235 | #define XCHAL_INT6_TYPE XTHAL_INTTYPE_EXTERN_LEVEL | ||
236 | #define XCHAL_INT7_TYPE XTHAL_INTTYPE_EXTERN_EDGE | ||
237 | #define XCHAL_INT8_TYPE XTHAL_INTTYPE_EXTERN_EDGE | ||
238 | #define XCHAL_INT9_TYPE XTHAL_INTTYPE_EXTERN_EDGE | ||
239 | #define XCHAL_INT10_TYPE XTHAL_INTTYPE_TIMER | ||
240 | #define XCHAL_INT11_TYPE XTHAL_INTTYPE_TIMER | ||
241 | #define XCHAL_INT12_TYPE XTHAL_INTTYPE_TIMER | ||
242 | #define XCHAL_INT13_TYPE XTHAL_INTTYPE_SOFTWARE | ||
243 | #define XCHAL_INT14_TYPE XTHAL_INTTYPE_SOFTWARE | ||
244 | #define XCHAL_INT15_TYPE XTHAL_INTTYPE_SOFTWARE | ||
245 | #define XCHAL_INT16_TYPE XTHAL_INTTYPE_SOFTWARE | ||
246 | |||
247 | /* Masks of interrupts for each type of interrupt: */ | ||
248 | #define XCHAL_INTTYPE_MASK_UNCONFIGURED 0xFFFE0000 | ||
249 | #define XCHAL_INTTYPE_MASK_SOFTWARE 0x0001E000 | ||
250 | #define XCHAL_INTTYPE_MASK_EXTERN_EDGE 0x00000380 | ||
251 | #define XCHAL_INTTYPE_MASK_EXTERN_LEVEL 0x0000007F | ||
252 | #define XCHAL_INTTYPE_MASK_TIMER 0x00001C00 | ||
253 | #define XCHAL_INTTYPE_MASK_NMI 0x00000000 | ||
254 | #define XCHAL_INTTYPE_MASK_WRITE_ERROR 0x00000000 | ||
255 | |||
256 | /* Interrupt numbers assigned to specific interrupt sources: */ | ||
257 | #define XCHAL_TIMER0_INTERRUPT 10 /* CCOMPARE0 */ | ||
258 | #define XCHAL_TIMER1_INTERRUPT 11 /* CCOMPARE1 */ | ||
259 | #define XCHAL_TIMER2_INTERRUPT 12 /* CCOMPARE2 */ | ||
260 | #define XCHAL_TIMER3_INTERRUPT XTHAL_TIMER_UNCONFIGURED | ||
261 | |||
262 | /* Interrupt numbers for levels at which only one interrupt is configured: */ | ||
263 | /* (There are many interrupts each at level(s) 1, 2, 3.) */ | ||
264 | |||
265 | |||
266 | /* | ||
267 | * External interrupt vectors/levels. | ||
268 | * These macros describe how Xtensa processor interrupt numbers | ||
269 | * (as numbered internally, eg. in INTERRUPT and INTENABLE registers) | ||
270 | * map to external BInterrupt<n> pins, for those interrupts | ||
271 | * configured as external (level-triggered, edge-triggered, or NMI). | ||
272 | * See the Xtensa processor databook for more details. | ||
273 | */ | ||
274 | |||
275 | /* Core interrupt numbers mapped to each EXTERNAL interrupt number: */ | ||
276 | #define XCHAL_EXTINT0_NUM 0 /* (intlevel 1) */ | ||
277 | #define XCHAL_EXTINT1_NUM 1 /* (intlevel 2) */ | ||
278 | #define XCHAL_EXTINT2_NUM 2 /* (intlevel 3) */ | ||
279 | #define XCHAL_EXTINT3_NUM 3 /* (intlevel 1) */ | ||
280 | #define XCHAL_EXTINT4_NUM 4 /* (intlevel 1) */ | ||
281 | #define XCHAL_EXTINT5_NUM 5 /* (intlevel 1) */ | ||
282 | #define XCHAL_EXTINT6_NUM 6 /* (intlevel 1) */ | ||
283 | #define XCHAL_EXTINT7_NUM 7 /* (intlevel 1) */ | ||
284 | #define XCHAL_EXTINT8_NUM 8 /* (intlevel 2) */ | ||
285 | #define XCHAL_EXTINT9_NUM 9 /* (intlevel 3) */ | ||
286 | |||
287 | |||
288 | /*---------------------------------------------------------------------- | ||
289 | EXCEPTIONS and VECTORS | ||
290 | ----------------------------------------------------------------------*/ | ||
291 | |||
292 | #define XCHAL_XEA_VERSION 2 /* Xtensa Exception Architecture | ||
293 | number: 1 == XEA1 (old) | ||
294 | 2 == XEA2 (new) | ||
295 | 0 == XEAX (extern) */ | ||
296 | #define XCHAL_HAVE_XEA1 0 /* Exception Architecture 1 */ | ||
297 | #define XCHAL_HAVE_XEA2 1 /* Exception Architecture 2 */ | ||
298 | #define XCHAL_HAVE_XEAX 0 /* External Exception Arch. */ | ||
299 | #define XCHAL_HAVE_EXCEPTIONS 1 /* exception option */ | ||
300 | #define XCHAL_HAVE_MEM_ECC_PARITY 0 /* local memory ECC/parity */ | ||
301 | |||
302 | #define XCHAL_RESET_VECTOR_VADDR 0xFE000020 | ||
303 | #define XCHAL_RESET_VECTOR_PADDR 0xFE000020 | ||
304 | #define XCHAL_USER_VECTOR_VADDR 0xD0000220 | ||
305 | #define XCHAL_USER_VECTOR_PADDR 0x00000220 | ||
306 | #define XCHAL_KERNEL_VECTOR_VADDR 0xD0000200 | ||
307 | #define XCHAL_KERNEL_VECTOR_PADDR 0x00000200 | ||
308 | #define XCHAL_DOUBLEEXC_VECTOR_VADDR 0xD0000290 | ||
309 | #define XCHAL_DOUBLEEXC_VECTOR_PADDR 0x00000290 | ||
310 | #define XCHAL_WINDOW_VECTORS_VADDR 0xD0000000 | ||
311 | #define XCHAL_WINDOW_VECTORS_PADDR 0x00000000 | ||
312 | #define XCHAL_INTLEVEL2_VECTOR_VADDR 0xD0000240 | ||
313 | #define XCHAL_INTLEVEL2_VECTOR_PADDR 0x00000240 | ||
314 | #define XCHAL_INTLEVEL3_VECTOR_VADDR 0xD0000250 | ||
315 | #define XCHAL_INTLEVEL3_VECTOR_PADDR 0x00000250 | ||
316 | #define XCHAL_INTLEVEL4_VECTOR_VADDR 0xFE000520 | ||
317 | #define XCHAL_INTLEVEL4_VECTOR_PADDR 0xFE000520 | ||
318 | #define XCHAL_DEBUG_VECTOR_VADDR XCHAL_INTLEVEL4_VECTOR_VADDR | ||
319 | #define XCHAL_DEBUG_VECTOR_PADDR XCHAL_INTLEVEL4_VECTOR_PADDR | ||
320 | |||
321 | |||
322 | /*---------------------------------------------------------------------- | ||
323 | DEBUG | ||
324 | ----------------------------------------------------------------------*/ | ||
325 | |||
326 | #define XCHAL_HAVE_OCD 1 /* OnChipDebug option */ | ||
327 | #define XCHAL_NUM_IBREAK 2 /* number of IBREAKn regs */ | ||
328 | #define XCHAL_NUM_DBREAK 2 /* number of DBREAKn regs */ | ||
329 | #define XCHAL_HAVE_OCD_DIR_ARRAY 1 /* faster OCD option */ | ||
330 | |||
331 | |||
332 | /*---------------------------------------------------------------------- | ||
333 | MMU | ||
334 | ----------------------------------------------------------------------*/ | ||
335 | |||
336 | /* See <xtensa/config/core-matmap.h> header file for more details. */ | ||
337 | |||
338 | #define XCHAL_HAVE_TLBS 1 /* inverse of HAVE_CACHEATTR */ | ||
339 | #define XCHAL_HAVE_SPANNING_WAY 0 /* one way maps I+D 4GB vaddr */ | ||
340 | #define XCHAL_HAVE_IDENTITY_MAP 0 /* vaddr == paddr always */ | ||
341 | #define XCHAL_HAVE_CACHEATTR 0 /* CACHEATTR register present */ | ||
342 | #define XCHAL_HAVE_MIMIC_CACHEATTR 0 /* region protection */ | ||
343 | #define XCHAL_HAVE_XLT_CACHEATTR 0 /* region prot. w/translation */ | ||
344 | #define XCHAL_HAVE_PTP_MMU 1 /* full MMU (with page table | ||
345 | [autorefill] and protection) | ||
346 | usable for an MMU-based OS */ | ||
347 | /* If none of the above last 4 are set, it's a custom TLB configuration. */ | ||
348 | #define XCHAL_ITLB_ARF_ENTRIES_LOG2 2 /* log2(autorefill way size) */ | ||
349 | #define XCHAL_DTLB_ARF_ENTRIES_LOG2 2 /* log2(autorefill way size) */ | ||
350 | |||
351 | #define XCHAL_MMU_ASID_BITS 8 /* number of bits in ASIDs */ | ||
352 | #define XCHAL_MMU_RINGS 4 /* number of rings (1..4) */ | ||
353 | #define XCHAL_MMU_RING_BITS 2 /* num of bits in RING field */ | ||
354 | |||
355 | #endif /* !XTENSA_HAL_NON_PRIVILEGED_ONLY */ | ||
356 | |||
357 | |||
358 | #endif /* _XTENSA_CORE_CONFIGURATION_H */ | ||
359 | |||
diff --git a/include/asm-xtensa/variant-fsf/tie.h b/include/asm-xtensa/variant-fsf/tie.h new file mode 100644 index 000000000000..a73c71664918 --- /dev/null +++ b/include/asm-xtensa/variant-fsf/tie.h | |||
@@ -0,0 +1,22 @@ | |||
1 | /* | ||
2 | * Xtensa processor core configuration information. | ||
3 | * | ||
4 | * This file is subject to the terms and conditions of the GNU General Public | ||
5 | * License. See the file "COPYING" in the main directory of this archive | ||
6 | * for more details. | ||
7 | * | ||
8 | * Copyright (C) 1999-2006 Tensilica Inc. | ||
9 | */ | ||
10 | |||
11 | #ifndef XTENSA_TIE_H | ||
12 | #define XTENSA_TIE_H | ||
13 | |||
14 | /*---------------------------------------------------------------------- | ||
15 | COPROCESSORS and EXTRA STATE | ||
16 | ----------------------------------------------------------------------*/ | ||
17 | |||
18 | #define XCHAL_CP_NUM 0 /* number of coprocessors */ | ||
19 | #define XCHAL_CP_MASK 0x00 | ||
20 | |||
21 | #endif /*XTENSA_CONFIG_TIE_H*/ | ||
22 | |||
diff --git a/include/asm-xtensa/xtensa/cacheasm.h b/include/asm-xtensa/xtensa/cacheasm.h deleted file mode 100644 index 0cdbb0bf180e..000000000000 --- a/include/asm-xtensa/xtensa/cacheasm.h +++ /dev/null | |||
@@ -1,708 +0,0 @@ | |||
1 | #ifndef XTENSA_CACHEASM_H | ||
2 | #define XTENSA_CACHEASM_H | ||
3 | |||
4 | /* | ||
5 | * THIS FILE IS GENERATED -- DO NOT MODIFY BY HAND | ||
6 | * | ||
7 | * include/asm-xtensa/xtensa/cacheasm.h -- assembler-specific cache | ||
8 | * related definitions that depend on CORE configuration. | ||
9 | * | ||
10 | * This file is subject to the terms and conditions of the GNU General Public | ||
11 | * License. See the file "COPYING" in the main directory of this archive | ||
12 | * for more details. | ||
13 | * | ||
14 | * Copyright (C) 2002 Tensilica Inc. | ||
15 | */ | ||
16 | |||
17 | |||
18 | #include <xtensa/coreasm.h> | ||
19 | |||
20 | |||
21 | /* | ||
22 | * This header file defines assembler macros of the form: | ||
23 | * <x>cache_<func> | ||
24 | * where <x> is 'i' or 'd' for instruction and data caches, | ||
25 | * and <func> indicates the function of the macro. | ||
26 | * | ||
27 | * The following functions <func> are defined, | ||
28 | * and apply only to the specified cache (I or D): | ||
29 | * | ||
30 | * reset | ||
31 | * Resets the cache. | ||
32 | * | ||
33 | * sync | ||
34 | * Makes sure any previous cache instructions have been completed; | ||
35 | * ie. makes sure any previous cache control operations | ||
36 | * have had full effect and been synchronized to memory. | ||
37 | * Eg. any invalidate completed [so as not to generate a hit], | ||
38 | * any writebacks or other pipelined writes written to memory, etc. | ||
39 | * | ||
40 | * invalidate_line (single cache line) | ||
41 | * invalidate_region (specified memory range) | ||
42 | * invalidate_all (entire cache) | ||
43 | * Invalidates all cache entries that cache | ||
44 | * data from the specified memory range. | ||
45 | * NOTE: locked entries are not invalidated. | ||
46 | * | ||
47 | * writeback_line (single cache line) | ||
48 | * writeback_region (specified memory range) | ||
49 | * writeback_all (entire cache) | ||
50 | * Writes back to memory all dirty cache entries | ||
51 | * that cache data from the specified memory range, | ||
52 | * and marks these entries as clean. | ||
53 | * NOTE: on some future implementations, this might | ||
54 | * also invalidate. | ||
55 | * NOTE: locked entries are written back, but never invalidated. | ||
56 | * NOTE: instruction caches never implement writeback. | ||
57 | * | ||
58 | * writeback_inv_line (single cache line) | ||
59 | * writeback_inv_region (specified memory range) | ||
60 | * writeback_inv_all (entire cache) | ||
61 | * Writes back to memory all dirty cache entries | ||
62 | * that cache data from the specified memory range, | ||
63 | * and invalidates these entries (including all clean | ||
64 | * cache entries that cache data from that range). | ||
65 | * NOTE: locked entries are written back but not invalidated. | ||
66 | * NOTE: instruction caches never implement writeback. | ||
67 | * | ||
68 | * lock_line (single cache line) | ||
69 | * lock_region (specified memory range) | ||
70 | * Prefetch and lock the specified memory range into cache. | ||
71 | * NOTE: if any part of the specified memory range cannot | ||
72 | * be locked, a ??? exception occurs. These macros don't | ||
73 | * do anything special (yet anyway) to handle this situation. | ||
74 | * | ||
75 | * unlock_line (single cache line) | ||
76 | * unlock_region (specified memory range) | ||
77 | * unlock_all (entire cache) | ||
78 | * Unlock cache entries that cache the specified memory range. | ||
79 | * Entries not already locked are unaffected. | ||
80 | */ | ||
81 | |||
82 | |||
83 | |||
84 | /*************************** GENERIC -- ALL CACHES ***************************/ | ||
85 | |||
86 | |||
87 | /* | ||
88 | * The following macros assume the following cache size/parameter limits | ||
89 | * in the current Xtensa core implementation: | ||
90 | * cache size: 1024 bytes minimum | ||
91 | * line size: 16 - 64 bytes | ||
92 | * way count: 1 - 4 | ||
93 | * | ||
94 | * Minimum entries per way (ie. per associativity) = 1024 / 64 / 4 = 4 | ||
95 | * Hence the assumption that each loop can execute four cache instructions. | ||
96 | * | ||
97 | * Correspondingly, the offset range of instructions is assumed able to cover | ||
98 | * four lines, ie. offsets {0,1,2,3} * line_size are assumed valid for | ||
99 | * both hit and indexed cache instructions. Ie. these offsets are all | ||
100 | * valid: 0, 16, 32, 48, 64, 96, 128, 192 (for line sizes 16, 32, 64). | ||
101 | * This is true of all original cache instructions | ||
102 | * (dhi, ihi, dhwb, dhwbi, dii, iii) which have offsets | ||
103 | * of 0 to 1020 in multiples of 4 (ie. 8 bits shifted by 2). | ||
104 | * This is also true of subsequent cache instructions | ||
105 | * (dhu, ihu, diu, iiu, diwb, diwbi, dpfl, ipfl) which have offsets | ||
106 | * of 0 to 240 in multiples of 16 (ie. 4 bits shifted by 4). | ||
107 | * | ||
108 | * (Maximum cache size, currently 32k, doesn't affect the following macros. | ||
109 | * Cache ways > MMU min page size cause aliasing but that's another matter.) | ||
110 | */ | ||
111 | |||
112 | |||
113 | |||
114 | /* | ||
115 | * Macro to apply an 'indexed' cache instruction to the entire cache. | ||
116 | * | ||
117 | * Parameters: | ||
118 | * cainst instruction/ that takes an address register parameter | ||
119 | * and an offset parameter (in range 0 .. 3*linesize). | ||
120 | * size size of cache in bytes | ||
121 | * linesize size of cache line in bytes | ||
122 | * assoc_or1 number of associativities (ways/sets) in cache | ||
123 | * if all sets affected by cainst, | ||
124 | * or 1 if only one set (or not all sets) of the cache | ||
125 | * is affected by cainst (eg. DIWB or DIWBI [not yet ISA defined]). | ||
126 | * aa, ab unique address registers (temporaries) | ||
127 | */ | ||
128 | |||
129 | .macro cache_index_all cainst, size, linesize, assoc_or1, aa, ab | ||
130 | |||
131 | // Sanity-check on cache parameters: | ||
132 | .ifne (\size % (\linesize * \assoc_or1 * 4)) | ||
133 | .err // cache configuration outside expected/supported range! | ||
134 | .endif | ||
135 | |||
136 | // \size byte cache, \linesize byte lines, \assoc_or1 way(s) affected by each \cainst. | ||
137 | movi \aa, (\size / (\linesize * \assoc_or1 * 4)) | ||
138 | // Possible improvement: need only loop if \aa > 1 ; | ||
139 | // however that particular condition is highly unlikely. | ||
140 | movi \ab, 0 // to iterate over cache | ||
141 | floop \aa, cachex\@ | ||
142 | \cainst \ab, 0*\linesize | ||
143 | \cainst \ab, 1*\linesize | ||
144 | \cainst \ab, 2*\linesize | ||
145 | \cainst \ab, 3*\linesize | ||
146 | addi \ab, \ab, 4*\linesize // move to next line | ||
147 | floopend \aa, cachex\@ | ||
148 | |||
149 | .endm | ||
150 | |||
151 | |||
152 | /* | ||
153 | * Macro to apply a 'hit' cache instruction to a memory region, | ||
154 | * ie. to any cache entries that cache a specified portion (region) of memory. | ||
155 | * Takes care of the unaligned cases, ie. may apply to one | ||
156 | * more cache line than $asize / lineSize if $aaddr is not aligned. | ||
157 | * | ||
158 | * | ||
159 | * Parameters are: | ||
160 | * cainst instruction/macro that takes an address register parameter | ||
161 | * and an offset parameter (currently always zero) | ||
162 | * and generates a cache instruction (eg. "dhi", "dhwb", "ihi", etc.) | ||
163 | * linesize_log2 log2(size of cache line in bytes) | ||
164 | * addr register containing start address of region (clobbered) | ||
165 | * asize register containing size of the region in bytes (clobbered) | ||
166 | * askew unique register used as temporary | ||
167 | * | ||
168 | * !?!?! 2DO: optimization: iterate max(cache_size and \asize) / linesize | ||
169 | */ | ||
170 | |||
171 | .macro cache_hit_region cainst, linesize_log2, addr, asize, askew | ||
172 | |||
173 | // Make \asize the number of iterations: | ||
174 | extui \askew, \addr, 0, \linesize_log2 // get unalignment amount of \addr | ||
175 | add \asize, \asize, \askew // ... and add it to \asize | ||
176 | addi \asize, \asize, (1 << \linesize_log2) - 1 // round up! | ||
177 | srli \asize, \asize, \linesize_log2 | ||
178 | |||
179 | // Iterate over region: | ||
180 | floopnez \asize, cacheh\@ | ||
181 | \cainst \addr, 0 | ||
182 | addi \addr, \addr, (1 << \linesize_log2) // move to next line | ||
183 | floopend \asize, cacheh\@ | ||
184 | |||
185 | .endm | ||
186 | |||
187 | |||
188 | |||
189 | |||
190 | |||
191 | /*************************** INSTRUCTION CACHE ***************************/ | ||
192 | |||
193 | |||
194 | /* | ||
195 | * Reset/initialize the instruction cache by simply invalidating it: | ||
196 | * (need to unlock first also, if cache locking implemented): | ||
197 | * | ||
198 | * Parameters: | ||
199 | * aa, ab unique address registers (temporaries) | ||
200 | */ | ||
201 | .macro icache_reset aa, ab | ||
202 | icache_unlock_all \aa, \ab | ||
203 | icache_invalidate_all \aa, \ab | ||
204 | .endm | ||
205 | |||
206 | |||
207 | /* | ||
208 | * Synchronize after an instruction cache operation, | ||
209 | * to be sure everything is in sync with memory as to be | ||
210 | * expected following any previous instruction cache control operations. | ||
211 | * | ||
212 | * Parameters are: | ||
213 | * ar an address register (temporary) (currently unused, but may be used in future) | ||
214 | */ | ||
215 | .macro icache_sync ar | ||
216 | #if XCHAL_ICACHE_SIZE > 0 | ||
217 | isync | ||
218 | #endif | ||
219 | .endm | ||
220 | |||
221 | |||
222 | |||
223 | /* | ||
224 | * Invalidate a single line of the instruction cache. | ||
225 | * Parameters are: | ||
226 | * ar address register that contains (virtual) address to invalidate | ||
227 | * (may get clobbered in a future implementation, but not currently) | ||
228 | * offset (optional) offset to add to \ar to compute effective address to invalidate | ||
229 | * (note: some number of lsbits are ignored) | ||
230 | */ | ||
231 | .macro icache_invalidate_line ar, offset | ||
232 | #if XCHAL_ICACHE_SIZE > 0 | ||
233 | ihi \ar, \offset // invalidate icache line | ||
234 | /* | ||
235 | * NOTE: in some version of the silicon [!!!SHOULD HAVE BEEN DOCUMENTED!!!] | ||
236 | * 'ihi' doesn't work, so it had been replaced with 'iii' | ||
237 | * (which would just invalidate more than it should, | ||
238 | * which should be okay other than the performance hit | ||
239 | * because cache locking did not exist in that version, | ||
240 | * unless user somehow relies on something being cached). | ||
241 | * [WHAT VERSION IS IT!!?!? | ||
242 | * IS THERE ANY WAY TO TEST FOR THAT HERE, TO OUTPUT 'III' ONLY IF NEEDED!?!?]. | ||
243 | * | ||
244 | * iii \ar, \offset | ||
245 | */ | ||
246 | icache_sync \ar | ||
247 | #endif | ||
248 | .endm | ||
249 | |||
250 | |||
251 | |||
252 | |||
253 | /* | ||
254 | * Invalidate instruction cache entries that cache a specified portion of memory. | ||
255 | * Parameters are: | ||
256 | * astart start address (register gets clobbered) | ||
257 | * asize size of the region in bytes (register gets clobbered) | ||
258 | * ac unique register used as temporary | ||
259 | */ | ||
260 | .macro icache_invalidate_region astart, asize, ac | ||
261 | #if XCHAL_ICACHE_SIZE > 0 | ||
262 | // Instruction cache region invalidation: | ||
263 | cache_hit_region ihi, XCHAL_ICACHE_LINEWIDTH, \astart, \asize, \ac | ||
264 | icache_sync \ac | ||
265 | // End of instruction cache region invalidation | ||
266 | #endif | ||
267 | .endm | ||
268 | |||
269 | |||
270 | |||
271 | /* | ||
272 | * Invalidate entire instruction cache. | ||
273 | * | ||
274 | * Parameters: | ||
275 | * aa, ab unique address registers (temporaries) | ||
276 | */ | ||
277 | .macro icache_invalidate_all aa, ab | ||
278 | #if XCHAL_ICACHE_SIZE > 0 | ||
279 | // Instruction cache invalidation: | ||
280 | cache_index_all iii, XCHAL_ICACHE_SIZE, XCHAL_ICACHE_LINESIZE, XCHAL_ICACHE_WAYS, \aa, \ab | ||
281 | icache_sync \aa | ||
282 | // End of instruction cache invalidation | ||
283 | #endif | ||
284 | .endm | ||
285 | |||
286 | |||
287 | |||
288 | /* | ||
289 | * Lock (prefetch & lock) a single line of the instruction cache. | ||
290 | * | ||
291 | * Parameters are: | ||
292 | * ar address register that contains (virtual) address to lock | ||
293 | * (may get clobbered in a future implementation, but not currently) | ||
294 | * offset offset to add to \ar to compute effective address to lock | ||
295 | * (note: some number of lsbits are ignored) | ||
296 | */ | ||
297 | .macro icache_lock_line ar, offset | ||
298 | #if XCHAL_ICACHE_SIZE > 0 && XCHAL_ICACHE_LINE_LOCKABLE | ||
299 | ipfl \ar, \offset /* prefetch and lock icache line */ | ||
300 | icache_sync \ar | ||
301 | #endif | ||
302 | .endm | ||
303 | |||
304 | |||
305 | |||
306 | /* | ||
307 | * Lock (prefetch & lock) a specified portion of memory into the instruction cache. | ||
308 | * Parameters are: | ||
309 | * astart start address (register gets clobbered) | ||
310 | * asize size of the region in bytes (register gets clobbered) | ||
311 | * ac unique register used as temporary | ||
312 | */ | ||
313 | .macro icache_lock_region astart, asize, ac | ||
314 | #if XCHAL_ICACHE_SIZE > 0 && XCHAL_ICACHE_LINE_LOCKABLE | ||
315 | // Instruction cache region lock: | ||
316 | cache_hit_region ipfl, XCHAL_ICACHE_LINEWIDTH, \astart, \asize, \ac | ||
317 | icache_sync \ac | ||
318 | // End of instruction cache region lock | ||
319 | #endif | ||
320 | .endm | ||
321 | |||
322 | |||
323 | |||
324 | /* | ||
325 | * Unlock a single line of the instruction cache. | ||
326 | * | ||
327 | * Parameters are: | ||
328 | * ar address register that contains (virtual) address to unlock | ||
329 | * (may get clobbered in a future implementation, but not currently) | ||
330 | * offset offset to add to \ar to compute effective address to unlock | ||
331 | * (note: some number of lsbits are ignored) | ||
332 | */ | ||
333 | .macro icache_unlock_line ar, offset | ||
334 | #if XCHAL_ICACHE_SIZE > 0 && XCHAL_ICACHE_LINE_LOCKABLE | ||
335 | ihu \ar, \offset /* unlock icache line */ | ||
336 | icache_sync \ar | ||
337 | #endif | ||
338 | .endm | ||
339 | |||
340 | |||
341 | |||
342 | /* | ||
343 | * Unlock a specified portion of memory from the instruction cache. | ||
344 | * Parameters are: | ||
345 | * astart start address (register gets clobbered) | ||
346 | * asize size of the region in bytes (register gets clobbered) | ||
347 | * ac unique register used as temporary | ||
348 | */ | ||
349 | .macro icache_unlock_region astart, asize, ac | ||
350 | #if XCHAL_ICACHE_SIZE > 0 && XCHAL_ICACHE_LINE_LOCKABLE | ||
351 | // Instruction cache region unlock: | ||
352 | cache_hit_region ihu, XCHAL_ICACHE_LINEWIDTH, \astart, \asize, \ac | ||
353 | icache_sync \ac | ||
354 | // End of instruction cache region unlock | ||
355 | #endif | ||
356 | .endm | ||
357 | |||
358 | |||
359 | |||
360 | /* | ||
361 | * Unlock entire instruction cache. | ||
362 | * | ||
363 | * Parameters: | ||
364 | * aa, ab unique address registers (temporaries) | ||
365 | */ | ||
366 | .macro icache_unlock_all aa, ab | ||
367 | #if XCHAL_ICACHE_SIZE > 0 && XCHAL_ICACHE_LINE_LOCKABLE | ||
368 | // Instruction cache unlock: | ||
369 | cache_index_all iiu, XCHAL_ICACHE_SIZE, XCHAL_ICACHE_LINESIZE, 1, \aa, \ab | ||
370 | icache_sync \aa | ||
371 | // End of instruction cache unlock | ||
372 | #endif | ||
373 | .endm | ||
374 | |||
375 | |||
376 | |||
377 | |||
378 | |||
379 | /*************************** DATA CACHE ***************************/ | ||
380 | |||
381 | |||
382 | |||
383 | /* | ||
384 | * Reset/initialize the data cache by simply invalidating it | ||
385 | * (need to unlock first also, if cache locking implemented): | ||
386 | * | ||
387 | * Parameters: | ||
388 | * aa, ab unique address registers (temporaries) | ||
389 | */ | ||
390 | .macro dcache_reset aa, ab | ||
391 | dcache_unlock_all \aa, \ab | ||
392 | dcache_invalidate_all \aa, \ab | ||
393 | .endm | ||
394 | |||
395 | |||
396 | |||
397 | |||
398 | /* | ||
399 | * Synchronize after a data cache operation, | ||
400 | * to be sure everything is in sync with memory as to be | ||
401 | * expected following any previous data cache control operations. | ||
402 | * | ||
403 | * Parameters are: | ||
404 | * ar an address register (temporary) (currently unused, but may be used in future) | ||
405 | */ | ||
406 | .macro dcache_sync ar | ||
407 | #if XCHAL_DCACHE_SIZE > 0 | ||
408 | // This previous sequence errs on the conservative side (too much so); a DSYNC should be sufficient: | ||
409 | //memw // synchronize data cache changes relative to subsequent memory accesses | ||
410 | //isync // be conservative and ISYNC as well (just to be sure) | ||
411 | |||
412 | dsync | ||
413 | #endif | ||
414 | .endm | ||
415 | |||
416 | |||
417 | |||
418 | /* | ||
419 | * Synchronize after a data store operation, | ||
420 | * to be sure the stored data is completely off the processor | ||
421 | * (and assuming there is no buffering outside the processor, | ||
422 | * that the data is in memory). This may be required to | ||
423 | * ensure that the processor's write buffers are emptied. | ||
424 | * A MEMW followed by a read guarantees this, by definition. | ||
425 | * We also try to make sure the read itself completes. | ||
426 | * | ||
427 | * Parameters are: | ||
428 | * ar an address register (temporary) | ||
429 | */ | ||
430 | .macro write_sync ar | ||
431 | memw // ensure previous memory accesses are complete prior to subsequent memory accesses | ||
432 | l32i \ar, sp, 0 // completing this read ensures any previous write has completed, because of MEMW | ||
433 | //slot | ||
434 | add \ar, \ar, \ar // use the result of the read to help ensure the read completes (in future architectures) | ||
435 | .endm | ||
436 | |||
437 | |||
438 | /* | ||
439 | * Invalidate a single line of the data cache. | ||
440 | * Parameters are: | ||
441 | * ar address register that contains (virtual) address to invalidate | ||
442 | * (may get clobbered in a future implementation, but not currently) | ||
443 | * offset (optional) offset to add to \ar to compute effective address to invalidate | ||
444 | * (note: some number of lsbits are ignored) | ||
445 | */ | ||
446 | .macro dcache_invalidate_line ar, offset | ||
447 | #if XCHAL_DCACHE_SIZE > 0 | ||
448 | dhi \ar, \offset | ||
449 | dcache_sync \ar | ||
450 | #endif | ||
451 | .endm | ||
452 | |||
453 | |||
454 | |||
455 | |||
456 | |||
457 | /* | ||
458 | * Invalidate data cache entries that cache a specified portion of memory. | ||
459 | * Parameters are: | ||
460 | * astart start address (register gets clobbered) | ||
461 | * asize size of the region in bytes (register gets clobbered) | ||
462 | * ac unique register used as temporary | ||
463 | */ | ||
464 | .macro dcache_invalidate_region astart, asize, ac | ||
465 | #if XCHAL_DCACHE_SIZE > 0 | ||
466 | // Data cache region invalidation: | ||
467 | cache_hit_region dhi, XCHAL_DCACHE_LINEWIDTH, \astart, \asize, \ac | ||
468 | dcache_sync \ac | ||
469 | // End of data cache region invalidation | ||
470 | #endif | ||
471 | .endm | ||
472 | |||
473 | |||
474 | |||
475 | #if 0 | ||
476 | /* | ||
477 | * This is a work-around for a bug in SiChip1 (???). | ||
478 | * There should be a proper mechanism for not outputting | ||
479 | * these instructions when not needed. | ||
480 | * To enable work-around, uncomment this and replace 'dii' | ||
481 | * with 'dii_s1' everywhere, eg. in dcache_invalidate_all | ||
482 | * macro below. | ||
483 | */ | ||
484 | .macro dii_s1 ar, offset | ||
485 | dii \ar, \offset | ||
486 | or \ar, \ar, \ar | ||
487 | or \ar, \ar, \ar | ||
488 | or \ar, \ar, \ar | ||
489 | or \ar, \ar, \ar | ||
490 | .endm | ||
491 | #endif | ||
492 | |||
493 | |||
494 | /* | ||
495 | * Invalidate entire data cache. | ||
496 | * | ||
497 | * Parameters: | ||
498 | * aa, ab unique address registers (temporaries) | ||
499 | */ | ||
500 | .macro dcache_invalidate_all aa, ab | ||
501 | #if XCHAL_DCACHE_SIZE > 0 | ||
502 | // Data cache invalidation: | ||
503 | cache_index_all dii, XCHAL_DCACHE_SIZE, XCHAL_DCACHE_LINESIZE, XCHAL_DCACHE_WAYS, \aa, \ab | ||
504 | dcache_sync \aa | ||
505 | // End of data cache invalidation | ||
506 | #endif | ||
507 | .endm | ||
508 | |||
509 | |||
510 | |||
511 | /* | ||
512 | * Writeback a single line of the data cache. | ||
513 | * Parameters are: | ||
514 | * ar address register that contains (virtual) address to writeback | ||
515 | * (may get clobbered in a future implementation, but not currently) | ||
516 | * offset offset to add to \ar to compute effective address to writeback | ||
517 | * (note: some number of lsbits are ignored) | ||
518 | */ | ||
519 | .macro dcache_writeback_line ar, offset | ||
520 | #if XCHAL_DCACHE_SIZE > 0 && XCHAL_DCACHE_IS_WRITEBACK | ||
521 | dhwb \ar, \offset | ||
522 | dcache_sync \ar | ||
523 | #endif | ||
524 | .endm | ||
525 | |||
526 | |||
527 | |||
528 | /* | ||
529 | * Writeback dirty data cache entries that cache a specified portion of memory. | ||
530 | * Parameters are: | ||
531 | * astart start address (register gets clobbered) | ||
532 | * asize size of the region in bytes (register gets clobbered) | ||
533 | * ac unique register used as temporary | ||
534 | */ | ||
535 | .macro dcache_writeback_region astart, asize, ac | ||
536 | #if XCHAL_DCACHE_SIZE > 0 && XCHAL_DCACHE_IS_WRITEBACK | ||
537 | // Data cache region writeback: | ||
538 | cache_hit_region dhwb, XCHAL_DCACHE_LINEWIDTH, \astart, \asize, \ac | ||
539 | dcache_sync \ac | ||
540 | // End of data cache region writeback | ||
541 | #endif | ||
542 | .endm | ||
543 | |||
544 | |||
545 | |||
546 | /* | ||
547 | * Writeback entire data cache. | ||
548 | * Parameters: | ||
549 | * aa, ab unique address registers (temporaries) | ||
550 | */ | ||
551 | .macro dcache_writeback_all aa, ab | ||
552 | #if XCHAL_DCACHE_SIZE > 0 && XCHAL_DCACHE_IS_WRITEBACK | ||
553 | // Data cache writeback: | ||
554 | cache_index_all diwb, XCHAL_DCACHE_SIZE, XCHAL_DCACHE_LINESIZE, 1, \aa, \ab | ||
555 | dcache_sync \aa | ||
556 | // End of data cache writeback | ||
557 | #endif | ||
558 | .endm | ||
559 | |||
560 | |||
561 | |||
562 | /* | ||
563 | * Writeback and invalidate a single line of the data cache. | ||
564 | * Parameters are: | ||
565 | * ar address register that contains (virtual) address to writeback and invalidate | ||
566 | * (may get clobbered in a future implementation, but not currently) | ||
567 | * offset offset to add to \ar to compute effective address to writeback and invalidate | ||
568 | * (note: some number of lsbits are ignored) | ||
569 | */ | ||
570 | .macro dcache_writeback_inv_line ar, offset | ||
571 | #if XCHAL_DCACHE_SIZE > 0 | ||
572 | dhwbi \ar, \offset /* writeback and invalidate dcache line */ | ||
573 | dcache_sync \ar | ||
574 | #endif | ||
575 | .endm | ||
576 | |||
577 | |||
578 | |||
579 | /* | ||
580 | * Writeback and invalidate data cache entries that cache a specified portion of memory. | ||
581 | * Parameters are: | ||
582 | * astart start address (register gets clobbered) | ||
583 | * asize size of the region in bytes (register gets clobbered) | ||
584 | * ac unique register used as temporary | ||
585 | */ | ||
586 | .macro dcache_writeback_inv_region astart, asize, ac | ||
587 | #if XCHAL_DCACHE_SIZE > 0 | ||
588 | // Data cache region writeback and invalidate: | ||
589 | cache_hit_region dhwbi, XCHAL_DCACHE_LINEWIDTH, \astart, \asize, \ac | ||
590 | dcache_sync \ac | ||
591 | // End of data cache region writeback and invalidate | ||
592 | #endif | ||
593 | .endm | ||
594 | |||
595 | |||
596 | |||
597 | /* | ||
598 | * Writeback and invalidate entire data cache. | ||
599 | * Parameters: | ||
600 | * aa, ab unique address registers (temporaries) | ||
601 | */ | ||
602 | .macro dcache_writeback_inv_all aa, ab | ||
603 | #if XCHAL_DCACHE_SIZE > 0 | ||
604 | // Data cache writeback and invalidate: | ||
605 | #if XCHAL_DCACHE_IS_WRITEBACK | ||
606 | cache_index_all diwbi, XCHAL_DCACHE_SIZE, XCHAL_DCACHE_LINESIZE, 1, \aa, \ab | ||
607 | dcache_sync \aa | ||
608 | #else /*writeback*/ | ||
609 | // Data cache does not support writeback, so just invalidate: */ | ||
610 | dcache_invalidate_all \aa, \ab | ||
611 | #endif /*writeback*/ | ||
612 | // End of data cache writeback and invalidate | ||
613 | #endif | ||
614 | .endm | ||
615 | |||
616 | |||
617 | |||
618 | |||
619 | /* | ||
620 | * Lock (prefetch & lock) a single line of the data cache. | ||
621 | * | ||
622 | * Parameters are: | ||
623 | * ar address register that contains (virtual) address to lock | ||
624 | * (may get clobbered in a future implementation, but not currently) | ||
625 | * offset offset to add to \ar to compute effective address to lock | ||
626 | * (note: some number of lsbits are ignored) | ||
627 | */ | ||
628 | .macro dcache_lock_line ar, offset | ||
629 | #if XCHAL_DCACHE_SIZE > 0 && XCHAL_DCACHE_LINE_LOCKABLE | ||
630 | dpfl \ar, \offset /* prefetch and lock dcache line */ | ||
631 | dcache_sync \ar | ||
632 | #endif | ||
633 | .endm | ||
634 | |||
635 | |||
636 | |||
637 | /* | ||
638 | * Lock (prefetch & lock) a specified portion of memory into the data cache. | ||
639 | * Parameters are: | ||
640 | * astart start address (register gets clobbered) | ||
641 | * asize size of the region in bytes (register gets clobbered) | ||
642 | * ac unique register used as temporary | ||
643 | */ | ||
644 | .macro dcache_lock_region astart, asize, ac | ||
645 | #if XCHAL_DCACHE_SIZE > 0 && XCHAL_DCACHE_LINE_LOCKABLE | ||
646 | // Data cache region lock: | ||
647 | cache_hit_region dpfl, XCHAL_DCACHE_LINEWIDTH, \astart, \asize, \ac | ||
648 | dcache_sync \ac | ||
649 | // End of data cache region lock | ||
650 | #endif | ||
651 | .endm | ||
652 | |||
653 | |||
654 | |||
655 | /* | ||
656 | * Unlock a single line of the data cache. | ||
657 | * | ||
658 | * Parameters are: | ||
659 | * ar address register that contains (virtual) address to unlock | ||
660 | * (may get clobbered in a future implementation, but not currently) | ||
661 | * offset offset to add to \ar to compute effective address to unlock | ||
662 | * (note: some number of lsbits are ignored) | ||
663 | */ | ||
664 | .macro dcache_unlock_line ar, offset | ||
665 | #if XCHAL_DCACHE_SIZE > 0 && XCHAL_DCACHE_LINE_LOCKABLE | ||
666 | dhu \ar, \offset /* unlock dcache line */ | ||
667 | dcache_sync \ar | ||
668 | #endif | ||
669 | .endm | ||
670 | |||
671 | |||
672 | |||
673 | /* | ||
674 | * Unlock a specified portion of memory from the data cache. | ||
675 | * Parameters are: | ||
676 | * astart start address (register gets clobbered) | ||
677 | * asize size of the region in bytes (register gets clobbered) | ||
678 | * ac unique register used as temporary | ||
679 | */ | ||
680 | .macro dcache_unlock_region astart, asize, ac | ||
681 | #if XCHAL_DCACHE_SIZE > 0 && XCHAL_DCACHE_LINE_LOCKABLE | ||
682 | // Data cache region unlock: | ||
683 | cache_hit_region dhu, XCHAL_DCACHE_LINEWIDTH, \astart, \asize, \ac | ||
684 | dcache_sync \ac | ||
685 | // End of data cache region unlock | ||
686 | #endif | ||
687 | .endm | ||
688 | |||
689 | |||
690 | |||
691 | /* | ||
692 | * Unlock entire data cache. | ||
693 | * | ||
694 | * Parameters: | ||
695 | * aa, ab unique address registers (temporaries) | ||
696 | */ | ||
697 | .macro dcache_unlock_all aa, ab | ||
698 | #if XCHAL_DCACHE_SIZE > 0 && XCHAL_DCACHE_LINE_LOCKABLE | ||
699 | // Data cache unlock: | ||
700 | cache_index_all diu, XCHAL_DCACHE_SIZE, XCHAL_DCACHE_LINESIZE, 1, \aa, \ab | ||
701 | dcache_sync \aa | ||
702 | // End of data cache unlock | ||
703 | #endif | ||
704 | .endm | ||
705 | |||
706 | |||
707 | #endif /*XTENSA_CACHEASM_H*/ | ||
708 | |||
diff --git a/include/asm-xtensa/xtensa/cacheattrasm.h b/include/asm-xtensa/xtensa/cacheattrasm.h deleted file mode 100644 index 1c3e117b3592..000000000000 --- a/include/asm-xtensa/xtensa/cacheattrasm.h +++ /dev/null | |||
@@ -1,432 +0,0 @@ | |||
1 | #ifndef XTENSA_CACHEATTRASM_H | ||
2 | #define XTENSA_CACHEATTRASM_H | ||
3 | |||
4 | /* | ||
5 | * THIS FILE IS GENERATED -- DO NOT MODIFY BY HAND | ||
6 | * | ||
7 | * include/asm-xtensa/xtensa/cacheattrasm.h -- assembler-specific | ||
8 | * CACHEATTR register related definitions that depend on CORE | ||
9 | * configuration. | ||
10 | * | ||
11 | * This file is subject to the terms and conditions of the GNU General Public | ||
12 | * License. See the file "COPYING" in the main directory of this archive | ||
13 | * for more details. | ||
14 | * | ||
15 | * Copyright (C) 2002 Tensilica Inc. | ||
16 | */ | ||
17 | |||
18 | |||
19 | #include <xtensa/coreasm.h> | ||
20 | |||
21 | |||
22 | /* | ||
23 | * This header file defines assembler macros of the form: | ||
24 | * <x>cacheattr_<func> | ||
25 | * where: | ||
26 | * <x> is 'i', 'd' or absent for instruction, data | ||
27 | * or both caches; and | ||
28 | * <func> indicates the function of the macro. | ||
29 | * | ||
30 | * The following functions are defined: | ||
31 | * | ||
32 | * icacheattr_get | ||
33 | * Reads I-cache CACHEATTR into a2 (clobbers a3-a5). | ||
34 | * | ||
35 | * dcacheattr_get | ||
36 | * Reads D-cache CACHEATTR into a2 (clobbers a3-a5). | ||
37 | * (Note: for configs with a real CACHEATTR register, the | ||
38 | * above two macros are identical.) | ||
39 | * | ||
40 | * cacheattr_set | ||
41 | * Writes both I-cache and D-cache CACHEATTRs from a2 (a3-a8 clobbered). | ||
42 | * Works even when changing one's own code's attributes. | ||
43 | * | ||
44 | * icacheattr_is_enabled label | ||
45 | * Branches to \label if I-cache appears to have been enabled | ||
46 | * (eg. if CACHEATTR contains a cache-enabled attribute). | ||
47 | * (clobbers a2-a5,SAR) | ||
48 | * | ||
49 | * dcacheattr_is_enabled label | ||
50 | * Branches to \label if D-cache appears to have been enabled | ||
51 | * (eg. if CACHEATTR contains a cache-enabled attribute). | ||
52 | * (clobbers a2-a5,SAR) | ||
53 | * | ||
54 | * cacheattr_is_enabled label | ||
55 | * Branches to \label if either I-cache or D-cache appears to have been enabled | ||
56 | * (eg. if CACHEATTR contains a cache-enabled attribute). | ||
57 | * (clobbers a2-a5,SAR) | ||
58 | * | ||
59 | * The following macros are only defined under certain conditions: | ||
60 | * | ||
61 | * icacheattr_set (if XCHAL_HAVE_MIMIC_CACHEATTR || XCHAL_HAVE_XLT_CACHEATTR) | ||
62 | * Writes I-cache CACHEATTR from a2 (a3-a8 clobbered). | ||
63 | * | ||
64 | * dcacheattr_set (if XCHAL_HAVE_MIMIC_CACHEATTR || XCHAL_HAVE_XLT_CACHEATTR) | ||
65 | * Writes D-cache CACHEATTR from a2 (a3-a8 clobbered). | ||
66 | */ | ||
67 | |||
68 | |||
69 | |||
70 | /*************************** GENERIC -- ALL CACHES ***************************/ | ||
71 | |||
72 | /* | ||
73 | * _cacheattr_get | ||
74 | * | ||
75 | * (Internal macro.) | ||
76 | * Returns value of CACHEATTR register (or closest equivalent) in a2. | ||
77 | * | ||
78 | * Entry: | ||
79 | * (none) | ||
80 | * Exit: | ||
81 | * a2 value read from CACHEATTR | ||
82 | * a3-a5 clobbered (temporaries) | ||
83 | */ | ||
84 | .macro _cacheattr_get tlb | ||
85 | #if XCHAL_HAVE_CACHEATTR | ||
86 | rsr a2, CACHEATTR | ||
87 | #elif XCHAL_HAVE_MIMIC_CACHEATTR || XCHAL_HAVE_XLT_CACHEATTR | ||
88 | // We have a config that "mimics" CACHEATTR using a simplified | ||
89 | // "MMU" composed of a single statically-mapped way. | ||
90 | // DTLB and ITLB are independent, so there's no single | ||
91 | // cache attribute that can describe both. So for now | ||
92 | // just return the DTLB state. | ||
93 | movi a5, 0xE0000000 | ||
94 | movi a2, 0 | ||
95 | movi a3, 0 | ||
96 | 1: add a3, a3, a5 // next segment | ||
97 | r&tlb&1 a4, a3 // get PPN+CA of segment at 0xE0000000, 0xC0000000, ..., 0 | ||
98 | dsync // interlock??? | ||
99 | slli a2, a2, 4 | ||
100 | extui a4, a4, 0, 4 // extract CA | ||
101 | or a2, a2, a4 | ||
102 | bnez a3, 1b | ||
103 | #else | ||
104 | // This macro isn't applicable to arbitrary MMU configurations. | ||
105 | // Just return zero. | ||
106 | movi a2, 0 | ||
107 | #endif | ||
108 | .endm | ||
109 | |||
110 | .macro icacheattr_get | ||
111 | _cacheattr_get itlb | ||
112 | .endm | ||
113 | |||
114 | .macro dcacheattr_get | ||
115 | _cacheattr_get dtlb | ||
116 | .endm | ||
117 | |||
118 | |||
119 | #define XCHAL_CACHEATTR_ALL_BYPASS 0x22222222 /* default (powerup/reset) value of CACHEATTR, all BYPASS | ||
120 | mode (ie. disabled/bypassed caches) */ | ||
121 | |||
122 | #if XCHAL_HAVE_CACHEATTR || XCHAL_HAVE_MIMIC_CACHEATTR || XCHAL_HAVE_XLT_CACHEATTR | ||
123 | |||
124 | #define XCHAL_FCA_ENAMASK 0x001A /* bitmap of fetch attributes that require enabled icache */ | ||
125 | #define XCHAL_LCA_ENAMASK 0x0003 /* bitmap of load attributes that require enabled dcache */ | ||
126 | #define XCHAL_SCA_ENAMASK 0x0003 /* bitmap of store attributes that require enabled dcache */ | ||
127 | #define XCHAL_LSCA_ENAMASK (XCHAL_LCA_ENAMASK|XCHAL_SCA_ENAMASK) /* l/s attrs requiring enabled dcache */ | ||
128 | #define XCHAL_ALLCA_ENAMASK (XCHAL_FCA_ENAMASK|XCHAL_LSCA_ENAMASK) /* all attrs requiring enabled caches */ | ||
129 | |||
130 | /* | ||
131 | * _cacheattr_is_enabled | ||
132 | * | ||
133 | * (Internal macro.) | ||
134 | * Branches to \label if CACHEATTR in a2 indicates an enabled | ||
135 | * cache, using mask in a3. | ||
136 | * | ||
137 | * Parameters: | ||
138 | * label where to branch to if cache is enabled | ||
139 | * Entry: | ||
140 | * a2 contains CACHEATTR value used to determine whether | ||
141 | * caches are enabled | ||
142 | * a3 16-bit constant where each bit correspond to | ||
143 | * one of the 16 possible CA values (in a CACHEATTR mask); | ||
144 | * CA values that indicate the cache is enabled | ||
145 | * have their corresponding bit set in this mask | ||
146 | * (eg. use XCHAL_xCA_ENAMASK , above) | ||
147 | * Exit: | ||
148 | * a2,a4,a5 clobbered | ||
149 | * SAR clobbered | ||
150 | */ | ||
151 | .macro _cacheattr_is_enabled label | ||
152 | movi a4, 8 // loop 8 times | ||
153 | .Lcaife\@: | ||
154 | extui a5, a2, 0, 4 // get CA nibble | ||
155 | ssr a5 // index into mask according to CA... | ||
156 | srl a5, a3 // ...and get CA's mask bit in a5 bit 0 | ||
157 | bbsi.l a5, 0, \label // if CA indicates cache enabled, jump to label | ||
158 | srli a2, a2, 4 // next nibble | ||
159 | addi a4, a4, -1 | ||
160 | bnez a4, .Lcaife\@ // loop for each nibble | ||
161 | .endm | ||
162 | |||
163 | #else /* XCHAL_HAVE_CACHEATTR || XCHAL_HAVE_MIMIC_CACHEATTR || XCHAL_HAVE_XLT_CACHEATTR */ | ||
164 | .macro _cacheattr_is_enabled label | ||
165 | j \label // macro not applicable, assume caches always enabled | ||
166 | .endm | ||
167 | #endif /* XCHAL_HAVE_CACHEATTR || XCHAL_HAVE_MIMIC_CACHEATTR || XCHAL_HAVE_XLT_CACHEATTR */ | ||
168 | |||
169 | |||
170 | |||
171 | /* | ||
172 | * icacheattr_is_enabled | ||
173 | * | ||
174 | * Branches to \label if I-cache is enabled. | ||
175 | * | ||
176 | * Parameters: | ||
177 | * label where to branch to if icache is enabled | ||
178 | * Entry: | ||
179 | * (none) | ||
180 | * Exit: | ||
181 | * a2-a5, SAR clobbered (temporaries) | ||
182 | */ | ||
183 | .macro icacheattr_is_enabled label | ||
184 | #if XCHAL_HAVE_CACHEATTR || XCHAL_HAVE_MIMIC_CACHEATTR || XCHAL_HAVE_XLT_CACHEATTR | ||
185 | icacheattr_get | ||
186 | movi a3, XCHAL_FCA_ENAMASK | ||
187 | #endif | ||
188 | _cacheattr_is_enabled \label | ||
189 | .endm | ||
190 | |||
191 | /* | ||
192 | * dcacheattr_is_enabled | ||
193 | * | ||
194 | * Branches to \label if D-cache is enabled. | ||
195 | * | ||
196 | * Parameters: | ||
197 | * label where to branch to if dcache is enabled | ||
198 | * Entry: | ||
199 | * (none) | ||
200 | * Exit: | ||
201 | * a2-a5, SAR clobbered (temporaries) | ||
202 | */ | ||
203 | .macro dcacheattr_is_enabled label | ||
204 | #if XCHAL_HAVE_CACHEATTR || XCHAL_HAVE_MIMIC_CACHEATTR || XCHAL_HAVE_XLT_CACHEATTR | ||
205 | dcacheattr_get | ||
206 | movi a3, XCHAL_LSCA_ENAMASK | ||
207 | #endif | ||
208 | _cacheattr_is_enabled \label | ||
209 | .endm | ||
210 | |||
211 | /* | ||
212 | * cacheattr_is_enabled | ||
213 | * | ||
214 | * Branches to \label if either I-cache or D-cache is enabled. | ||
215 | * | ||
216 | * Parameters: | ||
217 | * label where to branch to if a cache is enabled | ||
218 | * Entry: | ||
219 | * (none) | ||
220 | * Exit: | ||
221 | * a2-a5, SAR clobbered (temporaries) | ||
222 | */ | ||
223 | .macro cacheattr_is_enabled label | ||
224 | #if XCHAL_HAVE_CACHEATTR | ||
225 | rsr a2, CACHEATTR | ||
226 | movi a3, XCHAL_ALLCA_ENAMASK | ||
227 | #elif XCHAL_HAVE_MIMIC_CACHEATTR || XCHAL_HAVE_XLT_CACHEATTR | ||
228 | icacheattr_get | ||
229 | movi a3, XCHAL_FCA_ENAMASK | ||
230 | _cacheattr_is_enabled \label | ||
231 | dcacheattr_get | ||
232 | movi a3, XCHAL_LSCA_ENAMASK | ||
233 | #endif | ||
234 | _cacheattr_is_enabled \label | ||
235 | .endm | ||
236 | |||
237 | |||
238 | |||
239 | /* | ||
240 | * The ISA does not have a defined way to change the | ||
241 | * instruction cache attributes of the running code, | ||
242 | * ie. of the memory area that encloses the current PC. | ||
243 | * However, each micro-architecture (or class of | ||
244 | * configurations within a micro-architecture) | ||
245 | * provides a way to deal with this issue. | ||
246 | * | ||
247 | * Here are a few macros used to implement the relevant | ||
248 | * approach taken. | ||
249 | */ | ||
250 | |||
251 | #if XCHAL_HAVE_MIMIC_CACHEATTR || XCHAL_HAVE_XLT_CACHEATTR | ||
252 | // We have a config that "mimics" CACHEATTR using a simplified | ||
253 | // "MMU" composed of a single statically-mapped way. | ||
254 | |||
255 | /* | ||
256 | * icacheattr_set | ||
257 | * | ||
258 | * Entry: | ||
259 | * a2 cacheattr value to set | ||
260 | * Exit: | ||
261 | * a2 unchanged | ||
262 | * a3-a8 clobbered (temporaries) | ||
263 | */ | ||
264 | .macro icacheattr_set | ||
265 | |||
266 | movi a5, 0xE0000000 // mask of upper 3 bits | ||
267 | movi a6, 3f // PC where ITLB is set | ||
268 | movi a3, 0 // start at region 0 (0 .. 7) | ||
269 | and a6, a6, a5 // upper 3 bits of local PC area | ||
270 | mov a7, a2 // copy a2 so it doesn't get clobbered | ||
271 | j 3f | ||
272 | |||
273 | # if XCHAL_HAVE_XLT_CACHEATTR | ||
274 | // Can do translations, use generic method: | ||
275 | 1: sub a6, a3, a5 // address of some other segment | ||
276 | ritlb1 a8, a6 // save its PPN+CA | ||
277 | dsync // interlock?? | ||
278 | witlb a4, a6 // make it translate to this code area | ||
279 | movi a6, 5f // where to jump into it | ||
280 | isync | ||
281 | sub a6, a6, a5 // adjust jump address within that other segment | ||
282 | jx a6 | ||
283 | |||
284 | // Note that in the following code snippet, which runs at a different virtual | ||
285 | // address than it is assembled for, we avoid using literals (eg. via movi/l32r) | ||
286 | // just in case literals end up in a different 512 MB segment, and we avoid | ||
287 | // instructions that rely on the current PC being what is expected. | ||
288 | // | ||
289 | .align 4 | ||
290 | _j 6f // this is at label '5' minus 4 bytes | ||
291 | .align 4 | ||
292 | 5: witlb a4, a3 // we're in other segment, now can write previous segment's CA | ||
293 | isync | ||
294 | add a6, a6, a5 // back to previous segment | ||
295 | addi a6, a6, -4 // next jump label | ||
296 | jx a6 | ||
297 | |||
298 | 6: sub a6, a3, a5 // address of some other segment | ||
299 | witlb a8, a6 // restore PPN+CA of other segment | ||
300 | mov a6, a3 // restore a6 | ||
301 | isync | ||
302 | # else /* XCHAL_HAVE_XLT_CACHEATTR */ | ||
303 | // Use micro-architecture specific method. | ||
304 | // The following 4-instruction sequence is aligned such that | ||
305 | // it all fits within a single I-cache line. Sixteen byte | ||
306 | // alignment is sufficient for this (using XCHAL_ICACHE_LINESIZE | ||
307 | // actually causes problems because that can be greater than | ||
308 | // the alignment of the reset vector, where this macro is often | ||
309 | // invoked, which would cause the linker to align the reset | ||
310 | // vector code away from the reset vector!!). | ||
311 | .align 16 /*XCHAL_ICACHE_LINESIZE*/ | ||
312 | 1: _witlb a4, a3 // write wired PTE (CA, no PPN) of 512MB segment to ITLB | ||
313 | _isync | ||
314 | nop | ||
315 | nop | ||
316 | # endif /* XCHAL_HAVE_XLT_CACHEATTR */ | ||
317 | beq a3, a5, 4f // done? | ||
318 | |||
319 | // Note that in the WITLB loop, we don't do any load/stores | ||
320 | // (may not be an issue here, but it is important in the DTLB case). | ||
321 | 2: srli a7, a7, 4 // next CA | ||
322 | sub a3, a3, a5 // next segment (add 0x20000000) | ||
323 | 3: | ||
324 | # if XCHAL_HAVE_XLT_CACHEATTR /* if have translation, preserve it */ | ||
325 | ritlb1 a8, a3 // get current PPN+CA of segment | ||
326 | dsync // interlock??? | ||
327 | extui a4, a7, 0, 4 // extract CA to set | ||
328 | srli a8, a8, 4 // clear CA but keep PPN ... | ||
329 | slli a8, a8, 4 // ... | ||
330 | add a4, a4, a8 // combine new CA with PPN to preserve | ||
331 | # else | ||
332 | extui a4, a7, 0, 4 // extract CA | ||
333 | # endif | ||
334 | beq a3, a6, 1b // current PC's region? if so, do it in a safe way | ||
335 | witlb a4, a3 // write wired PTE (CA [+PPN]) of 512MB segment to ITLB | ||
336 | bne a3, a5, 2b | ||
337 | isync // make sure all ifetch changes take effect | ||
338 | 4: | ||
339 | .endm // icacheattr_set | ||
340 | |||
341 | |||
342 | /* | ||
343 | * dcacheattr_set | ||
344 | * | ||
345 | * Entry: | ||
346 | * a2 cacheattr value to set | ||
347 | * Exit: | ||
348 | * a2 unchanged | ||
349 | * a3-a8 clobbered (temporaries) | ||
350 | */ | ||
351 | |||
352 | .macro dcacheattr_set | ||
353 | |||
354 | movi a5, 0xE0000000 // mask of upper 3 bits | ||
355 | movi a3, 0 // start at region 0 (0 .. 7) | ||
356 | mov a7, a2 // copy a2 so it doesn't get clobbered | ||
357 | j 3f | ||
358 | // Note that in the WDTLB loop, we don't do any load/stores | ||
359 | // (including implicit l32r via movi) because it isn't safe. | ||
360 | 2: srli a7, a7, 4 // next CA | ||
361 | sub a3, a3, a5 // next segment (add 0x20000000) | ||
362 | 3: | ||
363 | # if XCHAL_HAVE_XLT_CACHEATTR /* if have translation, preserve it */ | ||
364 | rdtlb1 a8, a3 // get current PPN+CA of segment | ||
365 | dsync // interlock??? | ||
366 | extui a4, a7, 0, 4 // extract CA to set | ||
367 | srli a8, a8, 4 // clear CA but keep PPN ... | ||
368 | slli a8, a8, 4 // ... | ||
369 | add a4, a4, a8 // combine new CA with PPN to preserve | ||
370 | # else | ||
371 | extui a4, a7, 0, 4 // extract CA to set | ||
372 | # endif | ||
373 | wdtlb a4, a3 // write wired PTE (CA [+PPN]) of 512MB segment to DTLB | ||
374 | bne a3, a5, 2b | ||
375 | dsync // make sure all data path changes take effect | ||
376 | .endm // dcacheattr_set | ||
377 | |||
378 | #endif /* XCHAL_HAVE_MIMIC_CACHEATTR || XCHAL_HAVE_XLT_CACHEATTR */ | ||
379 | |||
380 | |||
381 | |||
382 | /* | ||
383 | * cacheattr_set | ||
384 | * | ||
385 | * Macro that sets the current CACHEATTR safely | ||
386 | * (both i and d) according to the current contents of a2. | ||
387 | * It works even when changing the cache attributes of | ||
388 | * the currently running code. | ||
389 | * | ||
390 | * Entry: | ||
391 | * a2 cacheattr value to set | ||
392 | * Exit: | ||
393 | * a2 unchanged | ||
394 | * a3-a8 clobbered (temporaries) | ||
395 | */ | ||
396 | .macro cacheattr_set | ||
397 | |||
398 | #if XCHAL_HAVE_CACHEATTR | ||
399 | # if XCHAL_ICACHE_LINESIZE < 4 | ||
400 | // No i-cache, so can always safely write to CACHEATTR: | ||
401 | wsr a2, CACHEATTR | ||
402 | # else | ||
403 | // The Athens micro-architecture, when using the old | ||
404 | // exception architecture option (ie. with the CACHEATTR register) | ||
405 | // allows changing the cache attributes of the running code | ||
406 | // using the following exact sequence aligned to be within | ||
407 | // an instruction cache line. (NOTE: using XCHAL_ICACHE_LINESIZE | ||
408 | // alignment actually causes problems because that can be greater | ||
409 | // than the alignment of the reset vector, where this macro is often | ||
410 | // invoked, which would cause the linker to align the reset | ||
411 | // vector code away from the reset vector!!). | ||
412 | j 1f | ||
413 | .align 16 /*XCHAL_ICACHE_LINESIZE*/ // align to within an I-cache line | ||
414 | 1: _wsr a2, CACHEATTR | ||
415 | _isync | ||
416 | nop | ||
417 | nop | ||
418 | # endif | ||
419 | #elif XCHAL_HAVE_MIMIC_CACHEATTR || XCHAL_HAVE_XLT_CACHEATTR | ||
420 | // DTLB and ITLB are independent, but to keep semantics | ||
421 | // of this macro we simply write to both. | ||
422 | icacheattr_set | ||
423 | dcacheattr_set | ||
424 | #else | ||
425 | // This macro isn't applicable to arbitrary MMU configurations. | ||
426 | // Do nothing in this case. | ||
427 | #endif | ||
428 | .endm | ||
429 | |||
430 | |||
431 | #endif /*XTENSA_CACHEATTRASM_H*/ | ||
432 | |||
diff --git a/include/asm-xtensa/xtensa/config-linux_be/core.h b/include/asm-xtensa/xtensa/config-linux_be/core.h deleted file mode 100644 index d54fe5eb1064..000000000000 --- a/include/asm-xtensa/xtensa/config-linux_be/core.h +++ /dev/null | |||
@@ -1,1270 +0,0 @@ | |||
1 | /* | ||
2 | * xtensa/config/core.h -- HAL definitions that are dependent on CORE configuration | ||
3 | * | ||
4 | * This header file is sometimes referred to as the "compile-time HAL" or CHAL. | ||
5 | * It was generated for a specific Xtensa processor configuration. | ||
6 | * | ||
7 | * Source for configuration-independent binaries (which link in a | ||
8 | * configuration-specific HAL library) must NEVER include this file. | ||
9 | * It is perfectly normal, however, for the HAL source itself to include this file. | ||
10 | */ | ||
11 | |||
12 | /* | ||
13 | * Copyright (c) 2003 Tensilica, Inc. All Rights Reserved. | ||
14 | * | ||
15 | * This program is free software; you can redistribute it and/or modify | ||
16 | * it under the terms of version 2.1 of the GNU Lesser General Public | ||
17 | * License as published by the Free Software Foundation. | ||
18 | * | ||
19 | * This program is distributed in the hope that it would be useful, but | ||
20 | * WITHOUT ANY WARRANTY; without even the implied warranty of | ||
21 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | ||
22 | * | ||
23 | * Further, this software is distributed without any warranty that it is | ||
24 | * free of the rightful claim of any third person regarding infringement | ||
25 | * or the like. Any license provided herein, whether implied or | ||
26 | * otherwise, applies only to this software file. Patent licenses, if | ||
27 | * any, provided herein do not apply to combinations of this program with | ||
28 | * other software, or any other product whatsoever. | ||
29 | * | ||
30 | * You should have received a copy of the GNU Lesser General Public | ||
31 | * License along with this program; if not, write the Free Software | ||
32 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston MA 02111-1307, | ||
33 | * USA. | ||
34 | */ | ||
35 | |||
36 | |||
37 | #ifndef XTENSA_CONFIG_CORE_H | ||
38 | #define XTENSA_CONFIG_CORE_H | ||
39 | |||
40 | #include <xtensa/hal.h> | ||
41 | |||
42 | |||
43 | /*---------------------------------------------------------------------- | ||
44 | GENERAL | ||
45 | ----------------------------------------------------------------------*/ | ||
46 | |||
47 | /* | ||
48 | * Separators for macros that expand into arrays. | ||
49 | * These can be predefined by files that #include this one, | ||
50 | * when different separators are required. | ||
51 | */ | ||
52 | /* Element separator for macros that expand into 1-dimensional arrays: */ | ||
53 | #ifndef XCHAL_SEP | ||
54 | #define XCHAL_SEP , | ||
55 | #endif | ||
56 | /* Array separator for macros that expand into 2-dimensional arrays: */ | ||
57 | #ifndef XCHAL_SEP2 | ||
58 | #define XCHAL_SEP2 },{ | ||
59 | #endif | ||
60 | |||
61 | |||
62 | /*---------------------------------------------------------------------- | ||
63 | ENDIANNESS | ||
64 | ----------------------------------------------------------------------*/ | ||
65 | |||
66 | #define XCHAL_HAVE_BE 1 | ||
67 | #define XCHAL_HAVE_LE 0 | ||
68 | #define XCHAL_MEMORY_ORDER XTHAL_BIGENDIAN | ||
69 | |||
70 | |||
71 | /*---------------------------------------------------------------------- | ||
72 | REGISTER WINDOWS | ||
73 | ----------------------------------------------------------------------*/ | ||
74 | |||
75 | #define XCHAL_HAVE_WINDOWED 1 /* 1 if windowed registers option configured, 0 otherwise */ | ||
76 | #define XCHAL_NUM_AREGS 64 /* number of physical address regs */ | ||
77 | #define XCHAL_NUM_AREGS_LOG2 6 /* log2(XCHAL_NUM_AREGS) */ | ||
78 | |||
79 | |||
80 | /*---------------------------------------------------------------------- | ||
81 | ADDRESS ALIGNMENT | ||
82 | ----------------------------------------------------------------------*/ | ||
83 | |||
84 | /* These apply to a selected set of core load and store instructions only (see ISA): */ | ||
85 | #define XCHAL_UNALIGNED_LOAD_EXCEPTION 1 /* 1 if unaligned loads cause an exception, 0 otherwise */ | ||
86 | #define XCHAL_UNALIGNED_STORE_EXCEPTION 1 /* 1 if unaligned stores cause an exception, 0 otherwise */ | ||
87 | |||
88 | |||
89 | /*---------------------------------------------------------------------- | ||
90 | INTERRUPTS | ||
91 | ----------------------------------------------------------------------*/ | ||
92 | |||
93 | #define XCHAL_HAVE_INTERRUPTS 1 /* 1 if interrupt option configured, 0 otherwise */ | ||
94 | #define XCHAL_HAVE_HIGHPRI_INTERRUPTS 1 /* 1 if high-priority interrupt option configured, 0 otherwise */ | ||
95 | #define XCHAL_HAVE_HIGHLEVEL_INTERRUPTS XCHAL_HAVE_HIGHPRI_INTERRUPTS | ||
96 | #define XCHAL_HAVE_NMI 0 /* 1 if NMI option configured, 0 otherwise */ | ||
97 | #define XCHAL_NUM_INTERRUPTS 17 /* number of interrupts */ | ||
98 | #define XCHAL_NUM_INTERRUPTS_LOG2 5 /* number of bits to hold an interrupt number: roundup(log2(number of interrupts)) */ | ||
99 | #define XCHAL_NUM_EXTINTERRUPTS 10 /* number of external interrupts */ | ||
100 | #define XCHAL_NUM_INTLEVELS 4 /* number of interrupt levels (not including level zero!) */ | ||
101 | #define XCHAL_NUM_LOWPRI_LEVELS 1 /* number of low-priority interrupt levels (always 1) */ | ||
102 | #define XCHAL_FIRST_HIGHPRI_LEVEL (XCHAL_NUM_LOWPRI_LEVELS+1) /* level of first high-priority interrupt (always 2) */ | ||
103 | #define XCHAL_EXCM_LEVEL 1 /* level of interrupts masked by PS.EXCM (XEA2 only; always 1 in T10xx); | ||
104 | for XEA1, where there is no PS.EXCM, this is always 1; | ||
105 | interrupts at levels FIRST_HIGHPRI <= n <= EXCM_LEVEL, if any, | ||
106 | are termed "medium priority" interrupts (post T10xx only) */ | ||
107 | /* Note: 1 <= LOWPRI_LEVELS <= EXCM_LEVEL < DEBUGLEVEL <= NUM_INTLEVELS < NMILEVEL <= 15 */ | ||
108 | |||
109 | /* Masks of interrupts at each interrupt level: */ | ||
110 | #define XCHAL_INTLEVEL0_MASK 0x00000000 | ||
111 | #define XCHAL_INTLEVEL1_MASK 0x000064F9 | ||
112 | #define XCHAL_INTLEVEL2_MASK 0x00008902 | ||
113 | #define XCHAL_INTLEVEL3_MASK 0x00011204 | ||
114 | #define XCHAL_INTLEVEL4_MASK 0x00000000 | ||
115 | #define XCHAL_INTLEVEL5_MASK 0x00000000 | ||
116 | #define XCHAL_INTLEVEL6_MASK 0x00000000 | ||
117 | #define XCHAL_INTLEVEL7_MASK 0x00000000 | ||
118 | #define XCHAL_INTLEVEL8_MASK 0x00000000 | ||
119 | #define XCHAL_INTLEVEL9_MASK 0x00000000 | ||
120 | #define XCHAL_INTLEVEL10_MASK 0x00000000 | ||
121 | #define XCHAL_INTLEVEL11_MASK 0x00000000 | ||
122 | #define XCHAL_INTLEVEL12_MASK 0x00000000 | ||
123 | #define XCHAL_INTLEVEL13_MASK 0x00000000 | ||
124 | #define XCHAL_INTLEVEL14_MASK 0x00000000 | ||
125 | #define XCHAL_INTLEVEL15_MASK 0x00000000 | ||
126 | /* As an array of entries (eg. for C constant arrays): */ | ||
127 | #define XCHAL_INTLEVEL_MASKS 0x00000000 XCHAL_SEP \ | ||
128 | 0x000064F9 XCHAL_SEP \ | ||
129 | 0x00008902 XCHAL_SEP \ | ||
130 | 0x00011204 XCHAL_SEP \ | ||
131 | 0x00000000 XCHAL_SEP \ | ||
132 | 0x00000000 XCHAL_SEP \ | ||
133 | 0x00000000 XCHAL_SEP \ | ||
134 | 0x00000000 XCHAL_SEP \ | ||
135 | 0x00000000 XCHAL_SEP \ | ||
136 | 0x00000000 XCHAL_SEP \ | ||
137 | 0x00000000 XCHAL_SEP \ | ||
138 | 0x00000000 XCHAL_SEP \ | ||
139 | 0x00000000 XCHAL_SEP \ | ||
140 | 0x00000000 XCHAL_SEP \ | ||
141 | 0x00000000 XCHAL_SEP \ | ||
142 | 0x00000000 | ||
143 | |||
144 | /* Masks of interrupts at each range 1..n of interrupt levels: */ | ||
145 | #define XCHAL_INTLEVEL0_ANDBELOW_MASK 0x00000000 | ||
146 | #define XCHAL_INTLEVEL1_ANDBELOW_MASK 0x000064F9 | ||
147 | #define XCHAL_INTLEVEL2_ANDBELOW_MASK 0x0000EDFB | ||
148 | #define XCHAL_INTLEVEL3_ANDBELOW_MASK 0x0001FFFF | ||
149 | #define XCHAL_INTLEVEL4_ANDBELOW_MASK 0x0001FFFF | ||
150 | #define XCHAL_INTLEVEL5_ANDBELOW_MASK 0x0001FFFF | ||
151 | #define XCHAL_INTLEVEL6_ANDBELOW_MASK 0x0001FFFF | ||
152 | #define XCHAL_INTLEVEL7_ANDBELOW_MASK 0x0001FFFF | ||
153 | #define XCHAL_INTLEVEL8_ANDBELOW_MASK 0x0001FFFF | ||
154 | #define XCHAL_INTLEVEL9_ANDBELOW_MASK 0x0001FFFF | ||
155 | #define XCHAL_INTLEVEL10_ANDBELOW_MASK 0x0001FFFF | ||
156 | #define XCHAL_INTLEVEL11_ANDBELOW_MASK 0x0001FFFF | ||
157 | #define XCHAL_INTLEVEL12_ANDBELOW_MASK 0x0001FFFF | ||
158 | #define XCHAL_INTLEVEL13_ANDBELOW_MASK 0x0001FFFF | ||
159 | #define XCHAL_INTLEVEL14_ANDBELOW_MASK 0x0001FFFF | ||
160 | #define XCHAL_INTLEVEL15_ANDBELOW_MASK 0x0001FFFF | ||
161 | #define XCHAL_LOWPRI_MASK XCHAL_INTLEVEL1_ANDBELOW_MASK /* mask of all low-priority interrupts */ | ||
162 | #define XCHAL_EXCM_MASK XCHAL_INTLEVEL1_ANDBELOW_MASK /* mask of all interrupts masked by PS.EXCM (or CEXCM) */ | ||
163 | /* As an array of entries (eg. for C constant arrays): */ | ||
164 | #define XCHAL_INTLEVEL_ANDBELOW_MASKS 0x00000000 XCHAL_SEP \ | ||
165 | 0x000064F9 XCHAL_SEP \ | ||
166 | 0x0000EDFB XCHAL_SEP \ | ||
167 | 0x0001FFFF XCHAL_SEP \ | ||
168 | 0x0001FFFF XCHAL_SEP \ | ||
169 | 0x0001FFFF XCHAL_SEP \ | ||
170 | 0x0001FFFF XCHAL_SEP \ | ||
171 | 0x0001FFFF XCHAL_SEP \ | ||
172 | 0x0001FFFF XCHAL_SEP \ | ||
173 | 0x0001FFFF XCHAL_SEP \ | ||
174 | 0x0001FFFF XCHAL_SEP \ | ||
175 | 0x0001FFFF XCHAL_SEP \ | ||
176 | 0x0001FFFF XCHAL_SEP \ | ||
177 | 0x0001FFFF XCHAL_SEP \ | ||
178 | 0x0001FFFF XCHAL_SEP \ | ||
179 | 0x0001FFFF | ||
180 | |||
181 | /* Interrupt numbers for each interrupt level at which only one interrupt was configured: */ | ||
182 | /*#define XCHAL_INTLEVEL1_NUM ...more than one interrupt at this level...*/ | ||
183 | /*#define XCHAL_INTLEVEL2_NUM ...more than one interrupt at this level...*/ | ||
184 | /*#define XCHAL_INTLEVEL3_NUM ...more than one interrupt at this level...*/ | ||
185 | |||
186 | /* Level of each interrupt: */ | ||
187 | #define XCHAL_INT0_LEVEL 1 | ||
188 | #define XCHAL_INT1_LEVEL 2 | ||
189 | #define XCHAL_INT2_LEVEL 3 | ||
190 | #define XCHAL_INT3_LEVEL 1 | ||
191 | #define XCHAL_INT4_LEVEL 1 | ||
192 | #define XCHAL_INT5_LEVEL 1 | ||
193 | #define XCHAL_INT6_LEVEL 1 | ||
194 | #define XCHAL_INT7_LEVEL 1 | ||
195 | #define XCHAL_INT8_LEVEL 2 | ||
196 | #define XCHAL_INT9_LEVEL 3 | ||
197 | #define XCHAL_INT10_LEVEL 1 | ||
198 | #define XCHAL_INT11_LEVEL 2 | ||
199 | #define XCHAL_INT12_LEVEL 3 | ||
200 | #define XCHAL_INT13_LEVEL 1 | ||
201 | #define XCHAL_INT14_LEVEL 1 | ||
202 | #define XCHAL_INT15_LEVEL 2 | ||
203 | #define XCHAL_INT16_LEVEL 3 | ||
204 | #define XCHAL_INT17_LEVEL 0 | ||
205 | #define XCHAL_INT18_LEVEL 0 | ||
206 | #define XCHAL_INT19_LEVEL 0 | ||
207 | #define XCHAL_INT20_LEVEL 0 | ||
208 | #define XCHAL_INT21_LEVEL 0 | ||
209 | #define XCHAL_INT22_LEVEL 0 | ||
210 | #define XCHAL_INT23_LEVEL 0 | ||
211 | #define XCHAL_INT24_LEVEL 0 | ||
212 | #define XCHAL_INT25_LEVEL 0 | ||
213 | #define XCHAL_INT26_LEVEL 0 | ||
214 | #define XCHAL_INT27_LEVEL 0 | ||
215 | #define XCHAL_INT28_LEVEL 0 | ||
216 | #define XCHAL_INT29_LEVEL 0 | ||
217 | #define XCHAL_INT30_LEVEL 0 | ||
218 | #define XCHAL_INT31_LEVEL 0 | ||
219 | /* As an array of entries (eg. for C constant arrays): */ | ||
220 | #define XCHAL_INT_LEVELS 1 XCHAL_SEP \ | ||
221 | 2 XCHAL_SEP \ | ||
222 | 3 XCHAL_SEP \ | ||
223 | 1 XCHAL_SEP \ | ||
224 | 1 XCHAL_SEP \ | ||
225 | 1 XCHAL_SEP \ | ||
226 | 1 XCHAL_SEP \ | ||
227 | 1 XCHAL_SEP \ | ||
228 | 2 XCHAL_SEP \ | ||
229 | 3 XCHAL_SEP \ | ||
230 | 1 XCHAL_SEP \ | ||
231 | 2 XCHAL_SEP \ | ||
232 | 3 XCHAL_SEP \ | ||
233 | 1 XCHAL_SEP \ | ||
234 | 1 XCHAL_SEP \ | ||
235 | 2 XCHAL_SEP \ | ||
236 | 3 XCHAL_SEP \ | ||
237 | 0 XCHAL_SEP \ | ||
238 | 0 XCHAL_SEP \ | ||
239 | 0 XCHAL_SEP \ | ||
240 | 0 XCHAL_SEP \ | ||
241 | 0 XCHAL_SEP \ | ||
242 | 0 XCHAL_SEP \ | ||
243 | 0 XCHAL_SEP \ | ||
244 | 0 XCHAL_SEP \ | ||
245 | 0 XCHAL_SEP \ | ||
246 | 0 XCHAL_SEP \ | ||
247 | 0 XCHAL_SEP \ | ||
248 | 0 XCHAL_SEP \ | ||
249 | 0 XCHAL_SEP \ | ||
250 | 0 XCHAL_SEP \ | ||
251 | 0 | ||
252 | |||
253 | /* Type of each interrupt: */ | ||
254 | #define XCHAL_INT0_TYPE XTHAL_INTTYPE_EXTERN_LEVEL | ||
255 | #define XCHAL_INT1_TYPE XTHAL_INTTYPE_EXTERN_LEVEL | ||
256 | #define XCHAL_INT2_TYPE XTHAL_INTTYPE_EXTERN_LEVEL | ||
257 | #define XCHAL_INT3_TYPE XTHAL_INTTYPE_EXTERN_LEVEL | ||
258 | #define XCHAL_INT4_TYPE XTHAL_INTTYPE_EXTERN_LEVEL | ||
259 | #define XCHAL_INT5_TYPE XTHAL_INTTYPE_EXTERN_LEVEL | ||
260 | #define XCHAL_INT6_TYPE XTHAL_INTTYPE_EXTERN_LEVEL | ||
261 | #define XCHAL_INT7_TYPE XTHAL_INTTYPE_EXTERN_EDGE | ||
262 | #define XCHAL_INT8_TYPE XTHAL_INTTYPE_EXTERN_EDGE | ||
263 | #define XCHAL_INT9_TYPE XTHAL_INTTYPE_EXTERN_EDGE | ||
264 | #define XCHAL_INT10_TYPE XTHAL_INTTYPE_TIMER | ||
265 | #define XCHAL_INT11_TYPE XTHAL_INTTYPE_TIMER | ||
266 | #define XCHAL_INT12_TYPE XTHAL_INTTYPE_TIMER | ||
267 | #define XCHAL_INT13_TYPE XTHAL_INTTYPE_SOFTWARE | ||
268 | #define XCHAL_INT14_TYPE XTHAL_INTTYPE_SOFTWARE | ||
269 | #define XCHAL_INT15_TYPE XTHAL_INTTYPE_SOFTWARE | ||
270 | #define XCHAL_INT16_TYPE XTHAL_INTTYPE_SOFTWARE | ||
271 | #define XCHAL_INT17_TYPE XTHAL_INTTYPE_UNCONFIGURED | ||
272 | #define XCHAL_INT18_TYPE XTHAL_INTTYPE_UNCONFIGURED | ||
273 | #define XCHAL_INT19_TYPE XTHAL_INTTYPE_UNCONFIGURED | ||
274 | #define XCHAL_INT20_TYPE XTHAL_INTTYPE_UNCONFIGURED | ||
275 | #define XCHAL_INT21_TYPE XTHAL_INTTYPE_UNCONFIGURED | ||
276 | #define XCHAL_INT22_TYPE XTHAL_INTTYPE_UNCONFIGURED | ||
277 | #define XCHAL_INT23_TYPE XTHAL_INTTYPE_UNCONFIGURED | ||
278 | #define XCHAL_INT24_TYPE XTHAL_INTTYPE_UNCONFIGURED | ||
279 | #define XCHAL_INT25_TYPE XTHAL_INTTYPE_UNCONFIGURED | ||
280 | #define XCHAL_INT26_TYPE XTHAL_INTTYPE_UNCONFIGURED | ||
281 | #define XCHAL_INT27_TYPE XTHAL_INTTYPE_UNCONFIGURED | ||
282 | #define XCHAL_INT28_TYPE XTHAL_INTTYPE_UNCONFIGURED | ||
283 | #define XCHAL_INT29_TYPE XTHAL_INTTYPE_UNCONFIGURED | ||
284 | #define XCHAL_INT30_TYPE XTHAL_INTTYPE_UNCONFIGURED | ||
285 | #define XCHAL_INT31_TYPE XTHAL_INTTYPE_UNCONFIGURED | ||
286 | /* As an array of entries (eg. for C constant arrays): */ | ||
287 | #define XCHAL_INT_TYPES XTHAL_INTTYPE_EXTERN_LEVEL XCHAL_SEP \ | ||
288 | XTHAL_INTTYPE_EXTERN_LEVEL XCHAL_SEP \ | ||
289 | XTHAL_INTTYPE_EXTERN_LEVEL XCHAL_SEP \ | ||
290 | XTHAL_INTTYPE_EXTERN_LEVEL XCHAL_SEP \ | ||
291 | XTHAL_INTTYPE_EXTERN_LEVEL XCHAL_SEP \ | ||
292 | XTHAL_INTTYPE_EXTERN_LEVEL XCHAL_SEP \ | ||
293 | XTHAL_INTTYPE_EXTERN_LEVEL XCHAL_SEP \ | ||
294 | XTHAL_INTTYPE_EXTERN_EDGE XCHAL_SEP \ | ||
295 | XTHAL_INTTYPE_EXTERN_EDGE XCHAL_SEP \ | ||
296 | XTHAL_INTTYPE_EXTERN_EDGE XCHAL_SEP \ | ||
297 | XTHAL_INTTYPE_TIMER XCHAL_SEP \ | ||
298 | XTHAL_INTTYPE_TIMER XCHAL_SEP \ | ||
299 | XTHAL_INTTYPE_TIMER XCHAL_SEP \ | ||
300 | XTHAL_INTTYPE_SOFTWARE XCHAL_SEP \ | ||
301 | XTHAL_INTTYPE_SOFTWARE XCHAL_SEP \ | ||
302 | XTHAL_INTTYPE_SOFTWARE XCHAL_SEP \ | ||
303 | XTHAL_INTTYPE_SOFTWARE XCHAL_SEP \ | ||
304 | XTHAL_INTTYPE_UNCONFIGURED XCHAL_SEP \ | ||
305 | XTHAL_INTTYPE_UNCONFIGURED XCHAL_SEP \ | ||
306 | XTHAL_INTTYPE_UNCONFIGURED XCHAL_SEP \ | ||
307 | XTHAL_INTTYPE_UNCONFIGURED XCHAL_SEP \ | ||
308 | XTHAL_INTTYPE_UNCONFIGURED XCHAL_SEP \ | ||
309 | XTHAL_INTTYPE_UNCONFIGURED XCHAL_SEP \ | ||
310 | XTHAL_INTTYPE_UNCONFIGURED XCHAL_SEP \ | ||
311 | XTHAL_INTTYPE_UNCONFIGURED XCHAL_SEP \ | ||
312 | XTHAL_INTTYPE_UNCONFIGURED XCHAL_SEP \ | ||
313 | XTHAL_INTTYPE_UNCONFIGURED XCHAL_SEP \ | ||
314 | XTHAL_INTTYPE_UNCONFIGURED XCHAL_SEP \ | ||
315 | XTHAL_INTTYPE_UNCONFIGURED XCHAL_SEP \ | ||
316 | XTHAL_INTTYPE_UNCONFIGURED XCHAL_SEP \ | ||
317 | XTHAL_INTTYPE_UNCONFIGURED XCHAL_SEP \ | ||
318 | XTHAL_INTTYPE_UNCONFIGURED | ||
319 | |||
320 | /* Masks of interrupts for each type of interrupt: */ | ||
321 | #define XCHAL_INTTYPE_MASK_UNCONFIGURED 0xFFFE0000 | ||
322 | #define XCHAL_INTTYPE_MASK_SOFTWARE 0x0001E000 | ||
323 | #define XCHAL_INTTYPE_MASK_EXTERN_EDGE 0x00000380 | ||
324 | #define XCHAL_INTTYPE_MASK_EXTERN_LEVEL 0x0000007F | ||
325 | #define XCHAL_INTTYPE_MASK_TIMER 0x00001C00 | ||
326 | #define XCHAL_INTTYPE_MASK_NMI 0x00000000 | ||
327 | /* As an array of entries (eg. for C constant arrays): */ | ||
328 | #define XCHAL_INTTYPE_MASKS 0xFFFE0000 XCHAL_SEP \ | ||
329 | 0x0001E000 XCHAL_SEP \ | ||
330 | 0x00000380 XCHAL_SEP \ | ||
331 | 0x0000007F XCHAL_SEP \ | ||
332 | 0x00001C00 XCHAL_SEP \ | ||
333 | 0x00000000 | ||
334 | |||
335 | /* Interrupts assigned to each timer (CCOMPARE0 to CCOMPARE3), -1 if unassigned */ | ||
336 | #define XCHAL_TIMER0_INTERRUPT 10 | ||
337 | #define XCHAL_TIMER1_INTERRUPT 11 | ||
338 | #define XCHAL_TIMER2_INTERRUPT 12 | ||
339 | #define XCHAL_TIMER3_INTERRUPT XTHAL_TIMER_UNCONFIGURED | ||
340 | /* As an array of entries (eg. for C constant arrays): */ | ||
341 | #define XCHAL_TIMER_INTERRUPTS 10 XCHAL_SEP \ | ||
342 | 11 XCHAL_SEP \ | ||
343 | 12 XCHAL_SEP \ | ||
344 | XTHAL_TIMER_UNCONFIGURED | ||
345 | |||
346 | /* Indexing macros: */ | ||
347 | #define _XCHAL_INTLEVEL_MASK(n) XCHAL_INTLEVEL ## n ## _MASK | ||
348 | #define XCHAL_INTLEVEL_MASK(n) _XCHAL_INTLEVEL_MASK(n) /* n = 0 .. 15 */ | ||
349 | #define _XCHAL_INTLEVEL_ANDBELOWMASK(n) XCHAL_INTLEVEL ## n ## _ANDBELOW_MASK | ||
350 | #define XCHAL_INTLEVEL_ANDBELOW_MASK(n) _XCHAL_INTLEVEL_ANDBELOWMASK(n) /* n = 0 .. 15 */ | ||
351 | #define _XCHAL_INT_LEVEL(n) XCHAL_INT ## n ## _LEVEL | ||
352 | #define XCHAL_INT_LEVEL(n) _XCHAL_INT_LEVEL(n) /* n = 0 .. 31 */ | ||
353 | #define _XCHAL_INT_TYPE(n) XCHAL_INT ## n ## _TYPE | ||
354 | #define XCHAL_INT_TYPE(n) _XCHAL_INT_TYPE(n) /* n = 0 .. 31 */ | ||
355 | #define _XCHAL_TIMER_INTERRUPT(n) XCHAL_TIMER ## n ## _INTERRUPT | ||
356 | #define XCHAL_TIMER_INTERRUPT(n) _XCHAL_TIMER_INTERRUPT(n) /* n = 0 .. 3 */ | ||
357 | |||
358 | |||
359 | |||
360 | /* | ||
361 | * External interrupt vectors/levels. | ||
362 | * These macros describe how Xtensa processor interrupt numbers | ||
363 | * (as numbered internally, eg. in INTERRUPT and INTENABLE registers) | ||
364 | * map to external BInterrupt<n> pins, for those interrupts | ||
365 | * configured as external (level-triggered, edge-triggered, or NMI). | ||
366 | * See the Xtensa processor databook for more details. | ||
367 | */ | ||
368 | |||
369 | /* Core interrupt numbers mapped to each EXTERNAL interrupt number: */ | ||
370 | #define XCHAL_EXTINT0_NUM 0 /* (intlevel 1) */ | ||
371 | #define XCHAL_EXTINT1_NUM 1 /* (intlevel 2) */ | ||
372 | #define XCHAL_EXTINT2_NUM 2 /* (intlevel 3) */ | ||
373 | #define XCHAL_EXTINT3_NUM 3 /* (intlevel 1) */ | ||
374 | #define XCHAL_EXTINT4_NUM 4 /* (intlevel 1) */ | ||
375 | #define XCHAL_EXTINT5_NUM 5 /* (intlevel 1) */ | ||
376 | #define XCHAL_EXTINT6_NUM 6 /* (intlevel 1) */ | ||
377 | #define XCHAL_EXTINT7_NUM 7 /* (intlevel 1) */ | ||
378 | #define XCHAL_EXTINT8_NUM 8 /* (intlevel 2) */ | ||
379 | #define XCHAL_EXTINT9_NUM 9 /* (intlevel 3) */ | ||
380 | |||
381 | /* Corresponding interrupt masks: */ | ||
382 | #define XCHAL_EXTINT0_MASK 0x00000001 | ||
383 | #define XCHAL_EXTINT1_MASK 0x00000002 | ||
384 | #define XCHAL_EXTINT2_MASK 0x00000004 | ||
385 | #define XCHAL_EXTINT3_MASK 0x00000008 | ||
386 | #define XCHAL_EXTINT4_MASK 0x00000010 | ||
387 | #define XCHAL_EXTINT5_MASK 0x00000020 | ||
388 | #define XCHAL_EXTINT6_MASK 0x00000040 | ||
389 | #define XCHAL_EXTINT7_MASK 0x00000080 | ||
390 | #define XCHAL_EXTINT8_MASK 0x00000100 | ||
391 | #define XCHAL_EXTINT9_MASK 0x00000200 | ||
392 | |||
393 | /* Core config interrupt levels mapped to each external interrupt: */ | ||
394 | #define XCHAL_EXTINT0_LEVEL 1 /* (int number 0) */ | ||
395 | #define XCHAL_EXTINT1_LEVEL 2 /* (int number 1) */ | ||
396 | #define XCHAL_EXTINT2_LEVEL 3 /* (int number 2) */ | ||
397 | #define XCHAL_EXTINT3_LEVEL 1 /* (int number 3) */ | ||
398 | #define XCHAL_EXTINT4_LEVEL 1 /* (int number 4) */ | ||
399 | #define XCHAL_EXTINT5_LEVEL 1 /* (int number 5) */ | ||
400 | #define XCHAL_EXTINT6_LEVEL 1 /* (int number 6) */ | ||
401 | #define XCHAL_EXTINT7_LEVEL 1 /* (int number 7) */ | ||
402 | #define XCHAL_EXTINT8_LEVEL 2 /* (int number 8) */ | ||
403 | #define XCHAL_EXTINT9_LEVEL 3 /* (int number 9) */ | ||
404 | |||
405 | |||
406 | /*---------------------------------------------------------------------- | ||
407 | EXCEPTIONS and VECTORS | ||
408 | ----------------------------------------------------------------------*/ | ||
409 | |||
410 | #define XCHAL_HAVE_EXCEPTIONS 1 /* 1 if exception option configured, 0 otherwise */ | ||
411 | |||
412 | #define XCHAL_XEA_VERSION 2 /* Xtensa Exception Architecture number: 1 for XEA1 (old), 2 for XEA2 (new) */ | ||
413 | #define XCHAL_HAVE_XEA1 0 /* 1 if XEA1, 0 otherwise */ | ||
414 | #define XCHAL_HAVE_XEA2 1 /* 1 if XEA2, 0 otherwise */ | ||
415 | /* For backward compatibility ONLY -- DO NOT USE (will be removed in future release): */ | ||
416 | #define XCHAL_HAVE_OLD_EXC_ARCH XCHAL_HAVE_XEA1 /* (DEPRECATED) 1 if old exception architecture (XEA1), 0 otherwise (eg. XEA2) */ | ||
417 | #define XCHAL_HAVE_EXCM XCHAL_HAVE_XEA2 /* (DEPRECATED) 1 if PS.EXCM bit exists (currently equals XCHAL_HAVE_TLBS) */ | ||
418 | |||
419 | #define XCHAL_RESET_VECTOR_VADDR 0xFE000020 | ||
420 | #define XCHAL_RESET_VECTOR_PADDR 0xFE000020 | ||
421 | #define XCHAL_USER_VECTOR_VADDR 0xD0000220 | ||
422 | #define XCHAL_PROGRAMEXC_VECTOR_VADDR XCHAL_USER_VECTOR_VADDR /* for backward compatibility */ | ||
423 | #define XCHAL_USEREXC_VECTOR_VADDR XCHAL_USER_VECTOR_VADDR /* for backward compatibility */ | ||
424 | #define XCHAL_USER_VECTOR_PADDR 0x00000220 | ||
425 | #define XCHAL_PROGRAMEXC_VECTOR_PADDR XCHAL_USER_VECTOR_PADDR /* for backward compatibility */ | ||
426 | #define XCHAL_USEREXC_VECTOR_PADDR XCHAL_USER_VECTOR_PADDR /* for backward compatibility */ | ||
427 | #define XCHAL_KERNEL_VECTOR_VADDR 0xD0000200 | ||
428 | #define XCHAL_STACKEDEXC_VECTOR_VADDR XCHAL_KERNEL_VECTOR_VADDR /* for backward compatibility */ | ||
429 | #define XCHAL_KERNELEXC_VECTOR_VADDR XCHAL_KERNEL_VECTOR_VADDR /* for backward compatibility */ | ||
430 | #define XCHAL_KERNEL_VECTOR_PADDR 0x00000200 | ||
431 | #define XCHAL_STACKEDEXC_VECTOR_PADDR XCHAL_KERNEL_VECTOR_PADDR /* for backward compatibility */ | ||
432 | #define XCHAL_KERNELEXC_VECTOR_PADDR XCHAL_KERNEL_VECTOR_PADDR /* for backward compatibility */ | ||
433 | #define XCHAL_DOUBLEEXC_VECTOR_VADDR 0xD0000290 | ||
434 | #define XCHAL_DOUBLEEXC_VECTOR_PADDR 0x00000290 | ||
435 | #define XCHAL_WINDOW_VECTORS_VADDR 0xD0000000 | ||
436 | #define XCHAL_WINDOW_VECTORS_PADDR 0x00000000 | ||
437 | #define XCHAL_INTLEVEL2_VECTOR_VADDR 0xD0000240 | ||
438 | #define XCHAL_INTLEVEL2_VECTOR_PADDR 0x00000240 | ||
439 | #define XCHAL_INTLEVEL3_VECTOR_VADDR 0xD0000250 | ||
440 | #define XCHAL_INTLEVEL3_VECTOR_PADDR 0x00000250 | ||
441 | #define XCHAL_INTLEVEL4_VECTOR_VADDR 0xFE000520 | ||
442 | #define XCHAL_INTLEVEL4_VECTOR_PADDR 0xFE000520 | ||
443 | #define XCHAL_DEBUG_VECTOR_VADDR XCHAL_INTLEVEL4_VECTOR_VADDR | ||
444 | #define XCHAL_DEBUG_VECTOR_PADDR XCHAL_INTLEVEL4_VECTOR_PADDR | ||
445 | |||
446 | /* Indexing macros: */ | ||
447 | #define _XCHAL_INTLEVEL_VECTOR_VADDR(n) XCHAL_INTLEVEL ## n ## _VECTOR_VADDR | ||
448 | #define XCHAL_INTLEVEL_VECTOR_VADDR(n) _XCHAL_INTLEVEL_VECTOR_VADDR(n) /* n = 0 .. 15 */ | ||
449 | |||
450 | /* | ||
451 | * General Exception Causes | ||
452 | * (values of EXCCAUSE special register set by general exceptions, | ||
453 | * which vector to the user, kernel, or double-exception vectors): | ||
454 | */ | ||
455 | #define XCHAL_EXCCAUSE_ILLEGAL_INSTRUCTION 0 /* Illegal Instruction (IllegalInstruction) */ | ||
456 | #define XCHAL_EXCCAUSE_SYSTEM_CALL 1 /* System Call (SystemCall) */ | ||
457 | #define XCHAL_EXCCAUSE_INSTRUCTION_FETCH_ERROR 2 /* Instruction Fetch Error (InstructionFetchError) */ | ||
458 | #define XCHAL_EXCCAUSE_LOAD_STORE_ERROR 3 /* Load Store Error (LoadStoreError) */ | ||
459 | #define XCHAL_EXCCAUSE_LEVEL1_INTERRUPT 4 /* Level 1 Interrupt (Level1Interrupt) */ | ||
460 | #define XCHAL_EXCCAUSE_ALLOCA 5 /* Stack Extension Assist (Alloca) */ | ||
461 | #define XCHAL_EXCCAUSE_INTEGER_DIVIDE_BY_ZERO 6 /* Integer Divide by Zero (IntegerDivideByZero) */ | ||
462 | #define XCHAL_EXCCAUSE_SPECULATION 7 /* Speculation (Speculation) */ | ||
463 | #define XCHAL_EXCCAUSE_PRIVILEGED 8 /* Privileged Instruction (Privileged) */ | ||
464 | #define XCHAL_EXCCAUSE_UNALIGNED 9 /* Unaligned Load Store (Unaligned) */ | ||
465 | #define XCHAL_EXCCAUSE_ITLB_MISS 16 /* ITlb Miss Exception (ITlbMiss) */ | ||
466 | #define XCHAL_EXCCAUSE_ITLB_MULTIHIT 17 /* ITlb Mutltihit Exception (ITlbMultihit) */ | ||
467 | #define XCHAL_EXCCAUSE_ITLB_PRIVILEGE 18 /* ITlb Privilege Exception (ITlbPrivilege) */ | ||
468 | #define XCHAL_EXCCAUSE_ITLB_SIZE_RESTRICTION 19 /* ITlb Size Restriction Exception (ITlbSizeRestriction) */ | ||
469 | #define XCHAL_EXCCAUSE_FETCH_CACHE_ATTRIBUTE 20 /* Fetch Cache Attribute Exception (FetchCacheAttribute) */ | ||
470 | #define XCHAL_EXCCAUSE_DTLB_MISS 24 /* DTlb Miss Exception (DTlbMiss) */ | ||
471 | #define XCHAL_EXCCAUSE_DTLB_MULTIHIT 25 /* DTlb Multihit Exception (DTlbMultihit) */ | ||
472 | #define XCHAL_EXCCAUSE_DTLB_PRIVILEGE 26 /* DTlb Privilege Exception (DTlbPrivilege) */ | ||
473 | #define XCHAL_EXCCAUSE_DTLB_SIZE_RESTRICTION 27 /* DTlb Size Restriction Exception (DTlbSizeRestriction) */ | ||
474 | #define XCHAL_EXCCAUSE_LOAD_CACHE_ATTRIBUTE 28 /* Load Cache Attribute Exception (LoadCacheAttribute) */ | ||
475 | #define XCHAL_EXCCAUSE_STORE_CACHE_ATTRIBUTE 29 /* Store Cache Attribute Exception (StoreCacheAttribute) */ | ||
476 | #define XCHAL_EXCCAUSE_FLOATING_POINT 40 /* Floating Point Exception (FloatingPoint) */ | ||
477 | |||
478 | |||
479 | |||
480 | /*---------------------------------------------------------------------- | ||
481 | TIMERS | ||
482 | ----------------------------------------------------------------------*/ | ||
483 | |||
484 | #define XCHAL_HAVE_CCOUNT 1 /* 1 if have CCOUNT, 0 otherwise */ | ||
485 | /*#define XCHAL_HAVE_TIMERS XCHAL_HAVE_CCOUNT*/ | ||
486 | #define XCHAL_NUM_TIMERS 3 /* number of CCOMPAREn regs */ | ||
487 | |||
488 | |||
489 | |||
490 | /*---------------------------------------------------------------------- | ||
491 | DEBUG | ||
492 | ----------------------------------------------------------------------*/ | ||
493 | |||
494 | #define XCHAL_HAVE_DEBUG 1 /* 1 if debug option configured, 0 otherwise */ | ||
495 | #define XCHAL_HAVE_OCD 1 /* 1 if OnChipDebug option configured, 0 otherwise */ | ||
496 | #define XCHAL_NUM_IBREAK 2 /* number of IBREAKn regs */ | ||
497 | #define XCHAL_NUM_DBREAK 2 /* number of DBREAKn regs */ | ||
498 | #define XCHAL_DEBUGLEVEL 4 /* debug interrupt level */ | ||
499 | /*DebugExternalInterrupt 0 0|1*/ | ||
500 | /*DebugUseDIRArray 0 0|1*/ | ||
501 | |||
502 | |||
503 | |||
504 | |||
505 | /*---------------------------------------------------------------------- | ||
506 | COPROCESSORS and EXTRA STATE | ||
507 | ----------------------------------------------------------------------*/ | ||
508 | |||
509 | #define XCHAL_HAVE_CP 0 /* 1 if coprocessor option configured (CPENABLE present) */ | ||
510 | #define XCHAL_CP_MAXCFG 0 /* max allowed cp id plus one (per cfg) */ | ||
511 | |||
512 | #include <xtensa/config/tie.h> | ||
513 | |||
514 | |||
515 | |||
516 | |||
517 | /*---------------------------------------------------------------------- | ||
518 | INTERNAL I/D RAM/ROMs and XLMI | ||
519 | ----------------------------------------------------------------------*/ | ||
520 | |||
521 | #define XCHAL_NUM_INSTROM 0 /* number of core instruction ROMs configured */ | ||
522 | #define XCHAL_NUM_INSTRAM 0 /* number of core instruction RAMs configured */ | ||
523 | #define XCHAL_NUM_DATAROM 0 /* number of core data ROMs configured */ | ||
524 | #define XCHAL_NUM_DATARAM 0 /* number of core data RAMs configured */ | ||
525 | #define XCHAL_NUM_XLMI 0 /* number of core XLMI ports configured */ | ||
526 | #define XCHAL_NUM_IROM XCHAL_NUM_INSTROM /* (DEPRECATED) */ | ||
527 | #define XCHAL_NUM_IRAM XCHAL_NUM_INSTRAM /* (DEPRECATED) */ | ||
528 | #define XCHAL_NUM_DROM XCHAL_NUM_DATAROM /* (DEPRECATED) */ | ||
529 | #define XCHAL_NUM_DRAM XCHAL_NUM_DATARAM /* (DEPRECATED) */ | ||
530 | |||
531 | |||
532 | |||
533 | /*---------------------------------------------------------------------- | ||
534 | CACHE | ||
535 | ----------------------------------------------------------------------*/ | ||
536 | |||
537 | /* Size of the cache lines in log2(bytes): */ | ||
538 | #define XCHAL_ICACHE_LINEWIDTH 4 | ||
539 | #define XCHAL_DCACHE_LINEWIDTH 4 | ||
540 | /* Size of the cache lines in bytes: */ | ||
541 | #define XCHAL_ICACHE_LINESIZE 16 | ||
542 | #define XCHAL_DCACHE_LINESIZE 16 | ||
543 | /* Max for both I-cache and D-cache (used for general alignment): */ | ||
544 | #define XCHAL_CACHE_LINEWIDTH_MAX 4 | ||
545 | #define XCHAL_CACHE_LINESIZE_MAX 16 | ||
546 | |||
547 | /* Number of cache sets in log2(lines per way): */ | ||
548 | #define XCHAL_ICACHE_SETWIDTH 8 | ||
549 | #define XCHAL_DCACHE_SETWIDTH 8 | ||
550 | /* Max for both I-cache and D-cache (used for general cache-coherency page alignment): */ | ||
551 | #define XCHAL_CACHE_SETWIDTH_MAX 8 | ||
552 | #define XCHAL_CACHE_SETSIZE_MAX 256 | ||
553 | |||
554 | /* Cache set associativity (number of ways): */ | ||
555 | #define XCHAL_ICACHE_WAYS 2 | ||
556 | #define XCHAL_DCACHE_WAYS 2 | ||
557 | |||
558 | /* Size of the caches in bytes (ways * 2^(linewidth + setwidth)): */ | ||
559 | #define XCHAL_ICACHE_SIZE 8192 | ||
560 | #define XCHAL_DCACHE_SIZE 8192 | ||
561 | |||
562 | /* Cache features: */ | ||
563 | #define XCHAL_DCACHE_IS_WRITEBACK 0 | ||
564 | /* Whether cache locking feature is available: */ | ||
565 | #define XCHAL_ICACHE_LINE_LOCKABLE 0 | ||
566 | #define XCHAL_DCACHE_LINE_LOCKABLE 0 | ||
567 | |||
568 | /* Number of (encoded) cache attribute bits: */ | ||
569 | #define XCHAL_CA_BITS 4 /* number of bits needed to hold cache attribute encoding */ | ||
570 | /* (The number of access mode bits (decoded cache attribute bits) is defined by the architecture; see xtensa/hal.h?) */ | ||
571 | |||
572 | |||
573 | /* Cache Attribute encodings -- lists of access modes for each cache attribute: */ | ||
574 | #define XCHAL_FCA_LIST XTHAL_FAM_EXCEPTION XCHAL_SEP \ | ||
575 | XTHAL_FAM_BYPASS XCHAL_SEP \ | ||
576 | XTHAL_FAM_EXCEPTION XCHAL_SEP \ | ||
577 | XTHAL_FAM_BYPASS XCHAL_SEP \ | ||
578 | XTHAL_FAM_EXCEPTION XCHAL_SEP \ | ||
579 | XTHAL_FAM_CACHED XCHAL_SEP \ | ||
580 | XTHAL_FAM_EXCEPTION XCHAL_SEP \ | ||
581 | XTHAL_FAM_CACHED XCHAL_SEP \ | ||
582 | XTHAL_FAM_EXCEPTION XCHAL_SEP \ | ||
583 | XTHAL_FAM_CACHED XCHAL_SEP \ | ||
584 | XTHAL_FAM_EXCEPTION XCHAL_SEP \ | ||
585 | XTHAL_FAM_CACHED XCHAL_SEP \ | ||
586 | XTHAL_FAM_EXCEPTION XCHAL_SEP \ | ||
587 | XTHAL_FAM_EXCEPTION XCHAL_SEP \ | ||
588 | XTHAL_FAM_EXCEPTION XCHAL_SEP \ | ||
589 | XTHAL_FAM_EXCEPTION | ||
590 | #define XCHAL_LCA_LIST XTHAL_LAM_EXCEPTION XCHAL_SEP \ | ||
591 | XTHAL_LAM_BYPASSG XCHAL_SEP \ | ||
592 | XTHAL_LAM_EXCEPTION XCHAL_SEP \ | ||
593 | XTHAL_LAM_BYPASSG XCHAL_SEP \ | ||
594 | XTHAL_LAM_EXCEPTION XCHAL_SEP \ | ||
595 | XTHAL_LAM_CACHED XCHAL_SEP \ | ||
596 | XTHAL_LAM_EXCEPTION XCHAL_SEP \ | ||
597 | XTHAL_LAM_CACHED XCHAL_SEP \ | ||
598 | XTHAL_LAM_EXCEPTION XCHAL_SEP \ | ||
599 | XTHAL_LAM_NACACHED XCHAL_SEP \ | ||
600 | XTHAL_LAM_EXCEPTION XCHAL_SEP \ | ||
601 | XTHAL_LAM_NACACHED XCHAL_SEP \ | ||
602 | XTHAL_LAM_EXCEPTION XCHAL_SEP \ | ||
603 | XTHAL_LAM_ISOLATE XCHAL_SEP \ | ||
604 | XTHAL_LAM_EXCEPTION XCHAL_SEP \ | ||
605 | XTHAL_LAM_CACHED | ||
606 | #define XCHAL_SCA_LIST XTHAL_SAM_EXCEPTION XCHAL_SEP \ | ||
607 | XTHAL_SAM_EXCEPTION XCHAL_SEP \ | ||
608 | XTHAL_SAM_EXCEPTION XCHAL_SEP \ | ||
609 | XTHAL_SAM_BYPASS XCHAL_SEP \ | ||
610 | XTHAL_SAM_EXCEPTION XCHAL_SEP \ | ||
611 | XTHAL_SAM_EXCEPTION XCHAL_SEP \ | ||
612 | XTHAL_SAM_EXCEPTION XCHAL_SEP \ | ||
613 | XTHAL_SAM_WRITETHRU XCHAL_SEP \ | ||
614 | XTHAL_SAM_EXCEPTION XCHAL_SEP \ | ||
615 | XTHAL_SAM_EXCEPTION XCHAL_SEP \ | ||
616 | XTHAL_SAM_EXCEPTION XCHAL_SEP \ | ||
617 | XTHAL_SAM_WRITETHRU XCHAL_SEP \ | ||
618 | XTHAL_SAM_EXCEPTION XCHAL_SEP \ | ||
619 | XTHAL_SAM_ISOLATE XCHAL_SEP \ | ||
620 | XTHAL_SAM_EXCEPTION XCHAL_SEP \ | ||
621 | XTHAL_SAM_WRITETHRU | ||
622 | |||
623 | /* Test: | ||
624 | read/only: 0 + 1 + 2 + 4 + 5 + 6 + 8 + 9 + 10 + 12 + 14 | ||
625 | read/only: 0 + 1 + 2 + 4 + 5 + 6 + 8 + 9 + 10 + 12 + 14 | ||
626 | all: 0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + 15 | ||
627 | fault: 0 + 2 + 4 + 6 + 8 + 10 + 12 + 14 | ||
628 | r/w/x cached: | ||
629 | r/w/x dcached: | ||
630 | I-bypass: 1 + 3 | ||
631 | |||
632 | load guard bit set: 1 + 3 | ||
633 | load guard bit clr: 0 + 2 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + 15 | ||
634 | hit-cache r/w/x: 7 + 11 | ||
635 | |||
636 | fams: 5 | ||
637 | fams: 0 / 6 / 18 / 1 / 2 | ||
638 | fams: Bypass / Isolate / Cached / Exception / NACached | ||
639 | |||
640 | MMU okay: yes | ||
641 | */ | ||
642 | |||
643 | |||
644 | /*---------------------------------------------------------------------- | ||
645 | MMU | ||
646 | ----------------------------------------------------------------------*/ | ||
647 | |||
648 | /* | ||
649 | * General notes on MMU parameters. | ||
650 | * | ||
651 | * Terminology: | ||
652 | * ASID = address-space ID (acts as an "extension" of virtual addresses) | ||
653 | * VPN = virtual page number | ||
654 | * PPN = physical page number | ||
655 | * CA = encoded cache attribute (access modes) | ||
656 | * TLB = translation look-aside buffer (term is stretched somewhat here) | ||
657 | * I = instruction (fetch accesses) | ||
658 | * D = data (load and store accesses) | ||
659 | * way = each TLB (ITLB and DTLB) consists of a number of "ways" | ||
660 | * that simultaneously match the virtual address of an access; | ||
661 | * a TLB successfully translates a virtual address if exactly | ||
662 | * one way matches the vaddr; if none match, it is a miss; | ||
663 | * if multiple match, one gets a "multihit" exception; | ||
664 | * each way can be independently configured in terms of number of | ||
665 | * entries, page sizes, which fields are writable or constant, etc. | ||
666 | * set = group of contiguous ways with exactly identical parameters | ||
667 | * ARF = auto-refill; hardware services a 1st-level miss by loading a PTE | ||
668 | * from the page table and storing it in one of the auto-refill ways; | ||
669 | * if this PTE load also misses, a miss exception is posted for s/w. | ||
670 | * min-wired = a "min-wired" way can be used to map a single (minimum-sized) | ||
671 | * page arbitrarily under program control; it has a single entry, | ||
672 | * is non-auto-refill (some other way(s) must be auto-refill), | ||
673 | * all its fields (VPN, PPN, ASID, CA) are all writable, and it | ||
674 | * supports the XCHAL_MMU_MIN_PTE_PAGE_SIZE page size (a current | ||
675 | * restriction is that this be the only page size it supports). | ||
676 | * | ||
677 | * TLB way entries are virtually indexed. | ||
678 | * TLB ways that support multiple page sizes: | ||
679 | * - must have all writable VPN and PPN fields; | ||
680 | * - can only use one page size at any given time (eg. setup at startup), | ||
681 | * selected by the respective ITLBCFG or DTLBCFG special register, | ||
682 | * whose bits n*4+3 .. n*4 index the list of page sizes for way n | ||
683 | * (XCHAL_xTLB_SETm_PAGESZ_LOG2_LIST for set m corresponding to way n); | ||
684 | * this list may be sparse for auto-refill ways because auto-refill | ||
685 | * ways have independent lists of supported page sizes sharing a | ||
686 | * common encoding with PTE entries; the encoding is the index into | ||
687 | * this list; unsupported sizes for a given way are zero in the list; | ||
688 | * selecting unsupported sizes results in undefined hardware behaviour; | ||
689 | * - is only possible for ways 0 thru 7 (due to ITLBCFG/DTLBCFG definition). | ||
690 | */ | ||
691 | |||
692 | #define XCHAL_HAVE_CACHEATTR 0 /* 1 if CACHEATTR register present, 0 if TLBs present instead */ | ||
693 | #define XCHAL_HAVE_TLBS 1 /* 1 if TLBs present, 0 if CACHEATTR present instead */ | ||
694 | #define XCHAL_HAVE_MMU XCHAL_HAVE_TLBS /* (DEPRECATED; use XCHAL_HAVE_TLBS instead; will be removed in future release) */ | ||
695 | #define XCHAL_HAVE_SPANNING_WAY 0 /* 1 if single way maps entire virtual address space in I+D */ | ||
696 | #define XCHAL_HAVE_IDENTITY_MAP 0 /* 1 if virtual addr == physical addr always, 0 otherwise */ | ||
697 | #define XCHAL_HAVE_MIMIC_CACHEATTR 0 /* 1 if have MMU that mimics a CACHEATTR config (CaMMU) */ | ||
698 | #define XCHAL_HAVE_XLT_CACHEATTR 0 /* 1 if have MMU that mimics a CACHEATTR config, but with translation (CaXltMMU) */ | ||
699 | |||
700 | #define XCHAL_MMU_ASID_BITS 8 /* number of bits in ASIDs (address space IDs) */ | ||
701 | #define XCHAL_MMU_ASID_INVALID 0 /* ASID value indicating invalid address space */ | ||
702 | #define XCHAL_MMU_ASID_KERNEL 1 /* ASID value indicating kernel (ring 0) address space */ | ||
703 | #define XCHAL_MMU_RINGS 4 /* number of rings supported (1..4) */ | ||
704 | #define XCHAL_MMU_RING_BITS 2 /* number of bits needed to hold ring number */ | ||
705 | #define XCHAL_MMU_SR_BITS 0 /* number of size-restriction bits supported */ | ||
706 | #define XCHAL_MMU_CA_BITS 4 /* number of bits needed to hold cache attribute encoding */ | ||
707 | #define XCHAL_MMU_MAX_PTE_PAGE_SIZE 12 /* max page size in a PTE structure (log2) */ | ||
708 | #define XCHAL_MMU_MIN_PTE_PAGE_SIZE 12 /* min page size in a PTE structure (log2) */ | ||
709 | |||
710 | |||
711 | /*** Instruction TLB: ***/ | ||
712 | |||
713 | #define XCHAL_ITLB_WAY_BITS 3 /* number of bits holding the ways */ | ||
714 | #define XCHAL_ITLB_WAYS 7 /* number of ways (n-way set-associative TLB) */ | ||
715 | #define XCHAL_ITLB_ARF_WAYS 4 /* number of auto-refill ways */ | ||
716 | #define XCHAL_ITLB_SETS 4 /* number of sets (groups of ways with identical settings) */ | ||
717 | |||
718 | /* Way set to which each way belongs: */ | ||
719 | #define XCHAL_ITLB_WAY0_SET 0 | ||
720 | #define XCHAL_ITLB_WAY1_SET 0 | ||
721 | #define XCHAL_ITLB_WAY2_SET 0 | ||
722 | #define XCHAL_ITLB_WAY3_SET 0 | ||
723 | #define XCHAL_ITLB_WAY4_SET 1 | ||
724 | #define XCHAL_ITLB_WAY5_SET 2 | ||
725 | #define XCHAL_ITLB_WAY6_SET 3 | ||
726 | |||
727 | /* Ways sets that are used by hardware auto-refill (ARF): */ | ||
728 | #define XCHAL_ITLB_ARF_SETS 1 /* number of auto-refill sets */ | ||
729 | #define XCHAL_ITLB_ARF_SET0 0 /* index of n'th auto-refill set */ | ||
730 | |||
731 | /* Way sets that are "min-wired" (see terminology comment above): */ | ||
732 | #define XCHAL_ITLB_MINWIRED_SETS 0 /* number of "min-wired" sets */ | ||
733 | |||
734 | |||
735 | /* ITLB way set 0 (group of ways 0 thru 3): */ | ||
736 | #define XCHAL_ITLB_SET0_WAY 0 /* index of first way in this way set */ | ||
737 | #define XCHAL_ITLB_SET0_WAYS 4 /* number of (contiguous) ways in this way set */ | ||
738 | #define XCHAL_ITLB_SET0_ENTRIES_LOG2 2 /* log2(number of entries in this way) */ | ||
739 | #define XCHAL_ITLB_SET0_ENTRIES 4 /* number of entries in this way (always a power of 2) */ | ||
740 | #define XCHAL_ITLB_SET0_ARF 1 /* 1=autorefill by h/w, 0=non-autorefill (wired/constant/static) */ | ||
741 | #define XCHAL_ITLB_SET0_PAGESIZES 1 /* number of supported page sizes in this way */ | ||
742 | #define XCHAL_ITLB_SET0_PAGESZ_BITS 0 /* number of bits to encode the page size */ | ||
743 | #define XCHAL_ITLB_SET0_PAGESZ_LOG2_MIN 12 /* log2(minimum supported page size) */ | ||
744 | #define XCHAL_ITLB_SET0_PAGESZ_LOG2_MAX 12 /* log2(maximum supported page size) */ | ||
745 | #define XCHAL_ITLB_SET0_PAGESZ_LOG2_LIST 12 /* list of log2(page size)s, separated by XCHAL_SEP; | ||
746 | 2^PAGESZ_BITS entries in list, unsupported entries are zero */ | ||
747 | #define XCHAL_ITLB_SET0_ASID_CONSTMASK 0 /* constant ASID bits; 0 if all writable */ | ||
748 | #define XCHAL_ITLB_SET0_VPN_CONSTMASK 0 /* constant VPN bits, not including entry index bits; 0 if all writable */ | ||
749 | #define XCHAL_ITLB_SET0_PPN_CONSTMASK 0 /* constant PPN bits, including entry index bits; 0 if all writable */ | ||
750 | #define XCHAL_ITLB_SET0_CA_CONSTMASK 0 /* constant CA bits; 0 if all writable */ | ||
751 | #define XCHAL_ITLB_SET0_ASID_RESET 0 /* 1 if ASID reset values defined (and all writable); 0 otherwise */ | ||
752 | #define XCHAL_ITLB_SET0_VPN_RESET 0 /* 1 if VPN reset values defined (and all writable); 0 otherwise */ | ||
753 | #define XCHAL_ITLB_SET0_PPN_RESET 0 /* 1 if PPN reset values defined (and all writable); 0 otherwise */ | ||
754 | #define XCHAL_ITLB_SET0_CA_RESET 0 /* 1 if CA reset values defined (and all writable); 0 otherwise */ | ||
755 | |||
756 | /* ITLB way set 1 (group of ways 4 thru 4): */ | ||
757 | #define XCHAL_ITLB_SET1_WAY 4 /* index of first way in this way set */ | ||
758 | #define XCHAL_ITLB_SET1_WAYS 1 /* number of (contiguous) ways in this way set */ | ||
759 | #define XCHAL_ITLB_SET1_ENTRIES_LOG2 2 /* log2(number of entries in this way) */ | ||
760 | #define XCHAL_ITLB_SET1_ENTRIES 4 /* number of entries in this way (always a power of 2) */ | ||
761 | #define XCHAL_ITLB_SET1_ARF 0 /* 1=autorefill by h/w, 0=non-autorefill (wired/constant/static) */ | ||
762 | #define XCHAL_ITLB_SET1_PAGESIZES 4 /* number of supported page sizes in this way */ | ||
763 | #define XCHAL_ITLB_SET1_PAGESZ_BITS 2 /* number of bits to encode the page size */ | ||
764 | #define XCHAL_ITLB_SET1_PAGESZ_LOG2_MIN 20 /* log2(minimum supported page size) */ | ||
765 | #define XCHAL_ITLB_SET1_PAGESZ_LOG2_MAX 26 /* log2(maximum supported page size) */ | ||
766 | #define XCHAL_ITLB_SET1_PAGESZ_LOG2_LIST 20 XCHAL_SEP 22 XCHAL_SEP 24 XCHAL_SEP 26 /* list of log2(page size)s, separated by XCHAL_SEP; | ||
767 | 2^PAGESZ_BITS entries in list, unsupported entries are zero */ | ||
768 | #define XCHAL_ITLB_SET1_ASID_CONSTMASK 0 /* constant ASID bits; 0 if all writable */ | ||
769 | #define XCHAL_ITLB_SET1_VPN_CONSTMASK 0 /* constant VPN bits, not including entry index bits; 0 if all writable */ | ||
770 | #define XCHAL_ITLB_SET1_PPN_CONSTMASK 0 /* constant PPN bits, including entry index bits; 0 if all writable */ | ||
771 | #define XCHAL_ITLB_SET1_CA_CONSTMASK 0 /* constant CA bits; 0 if all writable */ | ||
772 | #define XCHAL_ITLB_SET1_ASID_RESET 0 /* 1 if ASID reset values defined (and all writable); 0 otherwise */ | ||
773 | #define XCHAL_ITLB_SET1_VPN_RESET 0 /* 1 if VPN reset values defined (and all writable); 0 otherwise */ | ||
774 | #define XCHAL_ITLB_SET1_PPN_RESET 0 /* 1 if PPN reset values defined (and all writable); 0 otherwise */ | ||
775 | #define XCHAL_ITLB_SET1_CA_RESET 0 /* 1 if CA reset values defined (and all writable); 0 otherwise */ | ||
776 | |||
777 | /* ITLB way set 2 (group of ways 5 thru 5): */ | ||
778 | #define XCHAL_ITLB_SET2_WAY 5 /* index of first way in this way set */ | ||
779 | #define XCHAL_ITLB_SET2_WAYS 1 /* number of (contiguous) ways in this way set */ | ||
780 | #define XCHAL_ITLB_SET2_ENTRIES_LOG2 1 /* log2(number of entries in this way) */ | ||
781 | #define XCHAL_ITLB_SET2_ENTRIES 2 /* number of entries in this way (always a power of 2) */ | ||
782 | #define XCHAL_ITLB_SET2_ARF 0 /* 1=autorefill by h/w, 0=non-autorefill (wired/constant/static) */ | ||
783 | #define XCHAL_ITLB_SET2_PAGESIZES 1 /* number of supported page sizes in this way */ | ||
784 | #define XCHAL_ITLB_SET2_PAGESZ_BITS 0 /* number of bits to encode the page size */ | ||
785 | #define XCHAL_ITLB_SET2_PAGESZ_LOG2_MIN 27 /* log2(minimum supported page size) */ | ||
786 | #define XCHAL_ITLB_SET2_PAGESZ_LOG2_MAX 27 /* log2(maximum supported page size) */ | ||
787 | #define XCHAL_ITLB_SET2_PAGESZ_LOG2_LIST 27 /* list of log2(page size)s, separated by XCHAL_SEP; | ||
788 | 2^PAGESZ_BITS entries in list, unsupported entries are zero */ | ||
789 | #define XCHAL_ITLB_SET2_ASID_CONSTMASK 0xFF /* constant ASID bits; 0 if all writable */ | ||
790 | #define XCHAL_ITLB_SET2_VPN_CONSTMASK 0xF0000000 /* constant VPN bits, not including entry index bits; 0 if all writable */ | ||
791 | #define XCHAL_ITLB_SET2_PPN_CONSTMASK 0xF8000000 /* constant PPN bits, including entry index bits; 0 if all writable */ | ||
792 | #define XCHAL_ITLB_SET2_CA_CONSTMASK 0x0000000F /* constant CA bits; 0 if all writable */ | ||
793 | #define XCHAL_ITLB_SET2_ASID_RESET 0 /* 1 if ASID reset values defined (and all writable); 0 otherwise */ | ||
794 | #define XCHAL_ITLB_SET2_VPN_RESET 0 /* 1 if VPN reset values defined (and all writable); 0 otherwise */ | ||
795 | #define XCHAL_ITLB_SET2_PPN_RESET 0 /* 1 if PPN reset values defined (and all writable); 0 otherwise */ | ||
796 | #define XCHAL_ITLB_SET2_CA_RESET 0 /* 1 if CA reset values defined (and all writable); 0 otherwise */ | ||
797 | /* Constant ASID values for each entry of ITLB way set 2 (because ASID_CONSTMASK is non-zero): */ | ||
798 | #define XCHAL_ITLB_SET2_E0_ASID_CONST 0x01 | ||
799 | #define XCHAL_ITLB_SET2_E1_ASID_CONST 0x01 | ||
800 | /* Constant VPN values for each entry of ITLB way set 2 (because VPN_CONSTMASK is non-zero): */ | ||
801 | #define XCHAL_ITLB_SET2_E0_VPN_CONST 0xD0000000 | ||
802 | #define XCHAL_ITLB_SET2_E1_VPN_CONST 0xD8000000 | ||
803 | /* Constant PPN values for each entry of ITLB way set 2 (because PPN_CONSTMASK is non-zero): */ | ||
804 | #define XCHAL_ITLB_SET2_E0_PPN_CONST 0x00000000 | ||
805 | #define XCHAL_ITLB_SET2_E1_PPN_CONST 0x00000000 | ||
806 | /* Constant CA values for each entry of ITLB way set 2 (because CA_CONSTMASK is non-zero): */ | ||
807 | #define XCHAL_ITLB_SET2_E0_CA_CONST 0x07 | ||
808 | #define XCHAL_ITLB_SET2_E1_CA_CONST 0x03 | ||
809 | |||
810 | /* ITLB way set 3 (group of ways 6 thru 6): */ | ||
811 | #define XCHAL_ITLB_SET3_WAY 6 /* index of first way in this way set */ | ||
812 | #define XCHAL_ITLB_SET3_WAYS 1 /* number of (contiguous) ways in this way set */ | ||
813 | #define XCHAL_ITLB_SET3_ENTRIES_LOG2 1 /* log2(number of entries in this way) */ | ||
814 | #define XCHAL_ITLB_SET3_ENTRIES 2 /* number of entries in this way (always a power of 2) */ | ||
815 | #define XCHAL_ITLB_SET3_ARF 0 /* 1=autorefill by h/w, 0=non-autorefill (wired/constant/static) */ | ||
816 | #define XCHAL_ITLB_SET3_PAGESIZES 1 /* number of supported page sizes in this way */ | ||
817 | #define XCHAL_ITLB_SET3_PAGESZ_BITS 0 /* number of bits to encode the page size */ | ||
818 | #define XCHAL_ITLB_SET3_PAGESZ_LOG2_MIN 28 /* log2(minimum supported page size) */ | ||
819 | #define XCHAL_ITLB_SET3_PAGESZ_LOG2_MAX 28 /* log2(maximum supported page size) */ | ||
820 | #define XCHAL_ITLB_SET3_PAGESZ_LOG2_LIST 28 /* list of log2(page size)s, separated by XCHAL_SEP; | ||
821 | 2^PAGESZ_BITS entries in list, unsupported entries are zero */ | ||
822 | #define XCHAL_ITLB_SET3_ASID_CONSTMASK 0xFF /* constant ASID bits; 0 if all writable */ | ||
823 | #define XCHAL_ITLB_SET3_VPN_CONSTMASK 0xE0000000 /* constant VPN bits, not including entry index bits; 0 if all writable */ | ||
824 | #define XCHAL_ITLB_SET3_PPN_CONSTMASK 0xF0000000 /* constant PPN bits, including entry index bits; 0 if all writable */ | ||
825 | #define XCHAL_ITLB_SET3_CA_CONSTMASK 0x0000000F /* constant CA bits; 0 if all writable */ | ||
826 | #define XCHAL_ITLB_SET3_ASID_RESET 0 /* 1 if ASID reset values defined (and all writable); 0 otherwise */ | ||
827 | #define XCHAL_ITLB_SET3_VPN_RESET 0 /* 1 if VPN reset values defined (and all writable); 0 otherwise */ | ||
828 | #define XCHAL_ITLB_SET3_PPN_RESET 0 /* 1 if PPN reset values defined (and all writable); 0 otherwise */ | ||
829 | #define XCHAL_ITLB_SET3_CA_RESET 0 /* 1 if CA reset values defined (and all writable); 0 otherwise */ | ||
830 | /* Constant ASID values for each entry of ITLB way set 3 (because ASID_CONSTMASK is non-zero): */ | ||
831 | #define XCHAL_ITLB_SET3_E0_ASID_CONST 0x01 | ||
832 | #define XCHAL_ITLB_SET3_E1_ASID_CONST 0x01 | ||
833 | /* Constant VPN values for each entry of ITLB way set 3 (because VPN_CONSTMASK is non-zero): */ | ||
834 | #define XCHAL_ITLB_SET3_E0_VPN_CONST 0xE0000000 | ||
835 | #define XCHAL_ITLB_SET3_E1_VPN_CONST 0xF0000000 | ||
836 | /* Constant PPN values for each entry of ITLB way set 3 (because PPN_CONSTMASK is non-zero): */ | ||
837 | #define XCHAL_ITLB_SET3_E0_PPN_CONST 0xF0000000 | ||
838 | #define XCHAL_ITLB_SET3_E1_PPN_CONST 0xF0000000 | ||
839 | /* Constant CA values for each entry of ITLB way set 3 (because CA_CONSTMASK is non-zero): */ | ||
840 | #define XCHAL_ITLB_SET3_E0_CA_CONST 0x07 | ||
841 | #define XCHAL_ITLB_SET3_E1_CA_CONST 0x03 | ||
842 | |||
843 | /* Indexing macros: */ | ||
844 | #define _XCHAL_ITLB_SET(n,_what) XCHAL_ITLB_SET ## n ## _what | ||
845 | #define XCHAL_ITLB_SET(n,what) _XCHAL_ITLB_SET(n, _ ## what ) | ||
846 | #define _XCHAL_ITLB_SET_E(n,i,_what) XCHAL_ITLB_SET ## n ## _E ## i ## _what | ||
847 | #define XCHAL_ITLB_SET_E(n,i,what) _XCHAL_ITLB_SET_E(n,i, _ ## what ) | ||
848 | /* | ||
849 | * Example use: XCHAL_ITLB_SET(XCHAL_ITLB_ARF_SET0,ENTRIES) | ||
850 | * to get the value of XCHAL_ITLB_SET<n>_ENTRIES where <n> is the first auto-refill set. | ||
851 | */ | ||
852 | |||
853 | |||
854 | /*** Data TLB: ***/ | ||
855 | |||
856 | #define XCHAL_DTLB_WAY_BITS 4 /* number of bits holding the ways */ | ||
857 | #define XCHAL_DTLB_WAYS 10 /* number of ways (n-way set-associative TLB) */ | ||
858 | #define XCHAL_DTLB_ARF_WAYS 4 /* number of auto-refill ways */ | ||
859 | #define XCHAL_DTLB_SETS 5 /* number of sets (groups of ways with identical settings) */ | ||
860 | |||
861 | /* Way set to which each way belongs: */ | ||
862 | #define XCHAL_DTLB_WAY0_SET 0 | ||
863 | #define XCHAL_DTLB_WAY1_SET 0 | ||
864 | #define XCHAL_DTLB_WAY2_SET 0 | ||
865 | #define XCHAL_DTLB_WAY3_SET 0 | ||
866 | #define XCHAL_DTLB_WAY4_SET 1 | ||
867 | #define XCHAL_DTLB_WAY5_SET 2 | ||
868 | #define XCHAL_DTLB_WAY6_SET 3 | ||
869 | #define XCHAL_DTLB_WAY7_SET 4 | ||
870 | #define XCHAL_DTLB_WAY8_SET 4 | ||
871 | #define XCHAL_DTLB_WAY9_SET 4 | ||
872 | |||
873 | /* Ways sets that are used by hardware auto-refill (ARF): */ | ||
874 | #define XCHAL_DTLB_ARF_SETS 1 /* number of auto-refill sets */ | ||
875 | #define XCHAL_DTLB_ARF_SET0 0 /* index of n'th auto-refill set */ | ||
876 | |||
877 | /* Way sets that are "min-wired" (see terminology comment above): */ | ||
878 | #define XCHAL_DTLB_MINWIRED_SETS 1 /* number of "min-wired" sets */ | ||
879 | #define XCHAL_DTLB_MINWIRED_SET0 4 /* index of n'th "min-wired" set */ | ||
880 | |||
881 | |||
882 | /* DTLB way set 0 (group of ways 0 thru 3): */ | ||
883 | #define XCHAL_DTLB_SET0_WAY 0 /* index of first way in this way set */ | ||
884 | #define XCHAL_DTLB_SET0_WAYS 4 /* number of (contiguous) ways in this way set */ | ||
885 | #define XCHAL_DTLB_SET0_ENTRIES_LOG2 2 /* log2(number of entries in this way) */ | ||
886 | #define XCHAL_DTLB_SET0_ENTRIES 4 /* number of entries in this way (always a power of 2) */ | ||
887 | #define XCHAL_DTLB_SET0_ARF 1 /* 1=autorefill by h/w, 0=non-autorefill (wired/constant/static) */ | ||
888 | #define XCHAL_DTLB_SET0_PAGESIZES 1 /* number of supported page sizes in this way */ | ||
889 | #define XCHAL_DTLB_SET0_PAGESZ_BITS 0 /* number of bits to encode the page size */ | ||
890 | #define XCHAL_DTLB_SET0_PAGESZ_LOG2_MIN 12 /* log2(minimum supported page size) */ | ||
891 | #define XCHAL_DTLB_SET0_PAGESZ_LOG2_MAX 12 /* log2(maximum supported page size) */ | ||
892 | #define XCHAL_DTLB_SET0_PAGESZ_LOG2_LIST 12 /* list of log2(page size)s, separated by XCHAL_SEP; | ||
893 | 2^PAGESZ_BITS entries in list, unsupported entries are zero */ | ||
894 | #define XCHAL_DTLB_SET0_ASID_CONSTMASK 0 /* constant ASID bits; 0 if all writable */ | ||
895 | #define XCHAL_DTLB_SET0_VPN_CONSTMASK 0 /* constant VPN bits, not including entry index bits; 0 if all writable */ | ||
896 | #define XCHAL_DTLB_SET0_PPN_CONSTMASK 0 /* constant PPN bits, including entry index bits; 0 if all writable */ | ||
897 | #define XCHAL_DTLB_SET0_CA_CONSTMASK 0 /* constant CA bits; 0 if all writable */ | ||
898 | #define XCHAL_DTLB_SET0_ASID_RESET 0 /* 1 if ASID reset values defined (and all writable); 0 otherwise */ | ||
899 | #define XCHAL_DTLB_SET0_VPN_RESET 0 /* 1 if VPN reset values defined (and all writable); 0 otherwise */ | ||
900 | #define XCHAL_DTLB_SET0_PPN_RESET 0 /* 1 if PPN reset values defined (and all writable); 0 otherwise */ | ||
901 | #define XCHAL_DTLB_SET0_CA_RESET 0 /* 1 if CA reset values defined (and all writable); 0 otherwise */ | ||
902 | |||
903 | /* DTLB way set 1 (group of ways 4 thru 4): */ | ||
904 | #define XCHAL_DTLB_SET1_WAY 4 /* index of first way in this way set */ | ||
905 | #define XCHAL_DTLB_SET1_WAYS 1 /* number of (contiguous) ways in this way set */ | ||
906 | #define XCHAL_DTLB_SET1_ENTRIES_LOG2 2 /* log2(number of entries in this way) */ | ||
907 | #define XCHAL_DTLB_SET1_ENTRIES 4 /* number of entries in this way (always a power of 2) */ | ||
908 | #define XCHAL_DTLB_SET1_ARF 0 /* 1=autorefill by h/w, 0=non-autorefill (wired/constant/static) */ | ||
909 | #define XCHAL_DTLB_SET1_PAGESIZES 4 /* number of supported page sizes in this way */ | ||
910 | #define XCHAL_DTLB_SET1_PAGESZ_BITS 2 /* number of bits to encode the page size */ | ||
911 | #define XCHAL_DTLB_SET1_PAGESZ_LOG2_MIN 20 /* log2(minimum supported page size) */ | ||
912 | #define XCHAL_DTLB_SET1_PAGESZ_LOG2_MAX 26 /* log2(maximum supported page size) */ | ||
913 | #define XCHAL_DTLB_SET1_PAGESZ_LOG2_LIST 20 XCHAL_SEP 22 XCHAL_SEP 24 XCHAL_SEP 26 /* list of log2(page size)s, separated by XCHAL_SEP; | ||
914 | 2^PAGESZ_BITS entries in list, unsupported entries are zero */ | ||
915 | #define XCHAL_DTLB_SET1_ASID_CONSTMASK 0 /* constant ASID bits; 0 if all writable */ | ||
916 | #define XCHAL_DTLB_SET1_VPN_CONSTMASK 0 /* constant VPN bits, not including entry index bits; 0 if all writable */ | ||
917 | #define XCHAL_DTLB_SET1_PPN_CONSTMASK 0 /* constant PPN bits, including entry index bits; 0 if all writable */ | ||
918 | #define XCHAL_DTLB_SET1_CA_CONSTMASK 0 /* constant CA bits; 0 if all writable */ | ||
919 | #define XCHAL_DTLB_SET1_ASID_RESET 0 /* 1 if ASID reset values defined (and all writable); 0 otherwise */ | ||
920 | #define XCHAL_DTLB_SET1_VPN_RESET 0 /* 1 if VPN reset values defined (and all writable); 0 otherwise */ | ||
921 | #define XCHAL_DTLB_SET1_PPN_RESET 0 /* 1 if PPN reset values defined (and all writable); 0 otherwise */ | ||
922 | #define XCHAL_DTLB_SET1_CA_RESET 0 /* 1 if CA reset values defined (and all writable); 0 otherwise */ | ||
923 | |||
924 | /* DTLB way set 2 (group of ways 5 thru 5): */ | ||
925 | #define XCHAL_DTLB_SET2_WAY 5 /* index of first way in this way set */ | ||
926 | #define XCHAL_DTLB_SET2_WAYS 1 /* number of (contiguous) ways in this way set */ | ||
927 | #define XCHAL_DTLB_SET2_ENTRIES_LOG2 1 /* log2(number of entries in this way) */ | ||
928 | #define XCHAL_DTLB_SET2_ENTRIES 2 /* number of entries in this way (always a power of 2) */ | ||
929 | #define XCHAL_DTLB_SET2_ARF 0 /* 1=autorefill by h/w, 0=non-autorefill (wired/constant/static) */ | ||
930 | #define XCHAL_DTLB_SET2_PAGESIZES 1 /* number of supported page sizes in this way */ | ||
931 | #define XCHAL_DTLB_SET2_PAGESZ_BITS 0 /* number of bits to encode the page size */ | ||
932 | #define XCHAL_DTLB_SET2_PAGESZ_LOG2_MIN 27 /* log2(minimum supported page size) */ | ||
933 | #define XCHAL_DTLB_SET2_PAGESZ_LOG2_MAX 27 /* log2(maximum supported page size) */ | ||
934 | #define XCHAL_DTLB_SET2_PAGESZ_LOG2_LIST 27 /* list of log2(page size)s, separated by XCHAL_SEP; | ||
935 | 2^PAGESZ_BITS entries in list, unsupported entries are zero */ | ||
936 | #define XCHAL_DTLB_SET2_ASID_CONSTMASK 0xFF /* constant ASID bits; 0 if all writable */ | ||
937 | #define XCHAL_DTLB_SET2_VPN_CONSTMASK 0xF0000000 /* constant VPN bits, not including entry index bits; 0 if all writable */ | ||
938 | #define XCHAL_DTLB_SET2_PPN_CONSTMASK 0xF8000000 /* constant PPN bits, including entry index bits; 0 if all writable */ | ||
939 | #define XCHAL_DTLB_SET2_CA_CONSTMASK 0x0000000F /* constant CA bits; 0 if all writable */ | ||
940 | #define XCHAL_DTLB_SET2_ASID_RESET 0 /* 1 if ASID reset values defined (and all writable); 0 otherwise */ | ||
941 | #define XCHAL_DTLB_SET2_VPN_RESET 0 /* 1 if VPN reset values defined (and all writable); 0 otherwise */ | ||
942 | #define XCHAL_DTLB_SET2_PPN_RESET 0 /* 1 if PPN reset values defined (and all writable); 0 otherwise */ | ||
943 | #define XCHAL_DTLB_SET2_CA_RESET 0 /* 1 if CA reset values defined (and all writable); 0 otherwise */ | ||
944 | /* Constant ASID values for each entry of DTLB way set 2 (because ASID_CONSTMASK is non-zero): */ | ||
945 | #define XCHAL_DTLB_SET2_E0_ASID_CONST 0x01 | ||
946 | #define XCHAL_DTLB_SET2_E1_ASID_CONST 0x01 | ||
947 | /* Constant VPN values for each entry of DTLB way set 2 (because VPN_CONSTMASK is non-zero): */ | ||
948 | #define XCHAL_DTLB_SET2_E0_VPN_CONST 0xD0000000 | ||
949 | #define XCHAL_DTLB_SET2_E1_VPN_CONST 0xD8000000 | ||
950 | /* Constant PPN values for each entry of DTLB way set 2 (because PPN_CONSTMASK is non-zero): */ | ||
951 | #define XCHAL_DTLB_SET2_E0_PPN_CONST 0x00000000 | ||
952 | #define XCHAL_DTLB_SET2_E1_PPN_CONST 0x00000000 | ||
953 | /* Constant CA values for each entry of DTLB way set 2 (because CA_CONSTMASK is non-zero): */ | ||
954 | #define XCHAL_DTLB_SET2_E0_CA_CONST 0x07 | ||
955 | #define XCHAL_DTLB_SET2_E1_CA_CONST 0x03 | ||
956 | |||
957 | /* DTLB way set 3 (group of ways 6 thru 6): */ | ||
958 | #define XCHAL_DTLB_SET3_WAY 6 /* index of first way in this way set */ | ||
959 | #define XCHAL_DTLB_SET3_WAYS 1 /* number of (contiguous) ways in this way set */ | ||
960 | #define XCHAL_DTLB_SET3_ENTRIES_LOG2 1 /* log2(number of entries in this way) */ | ||
961 | #define XCHAL_DTLB_SET3_ENTRIES 2 /* number of entries in this way (always a power of 2) */ | ||
962 | #define XCHAL_DTLB_SET3_ARF 0 /* 1=autorefill by h/w, 0=non-autorefill (wired/constant/static) */ | ||
963 | #define XCHAL_DTLB_SET3_PAGESIZES 1 /* number of supported page sizes in this way */ | ||
964 | #define XCHAL_DTLB_SET3_PAGESZ_BITS 0 /* number of bits to encode the page size */ | ||
965 | #define XCHAL_DTLB_SET3_PAGESZ_LOG2_MIN 28 /* log2(minimum supported page size) */ | ||
966 | #define XCHAL_DTLB_SET3_PAGESZ_LOG2_MAX 28 /* log2(maximum supported page size) */ | ||
967 | #define XCHAL_DTLB_SET3_PAGESZ_LOG2_LIST 28 /* list of log2(page size)s, separated by XCHAL_SEP; | ||
968 | 2^PAGESZ_BITS entries in list, unsupported entries are zero */ | ||
969 | #define XCHAL_DTLB_SET3_ASID_CONSTMASK 0xFF /* constant ASID bits; 0 if all writable */ | ||
970 | #define XCHAL_DTLB_SET3_VPN_CONSTMASK 0xE0000000 /* constant VPN bits, not including entry index bits; 0 if all writable */ | ||
971 | #define XCHAL_DTLB_SET3_PPN_CONSTMASK 0xF0000000 /* constant PPN bits, including entry index bits; 0 if all writable */ | ||
972 | #define XCHAL_DTLB_SET3_CA_CONSTMASK 0x0000000F /* constant CA bits; 0 if all writable */ | ||
973 | #define XCHAL_DTLB_SET3_ASID_RESET 0 /* 1 if ASID reset values defined (and all writable); 0 otherwise */ | ||
974 | #define XCHAL_DTLB_SET3_VPN_RESET 0 /* 1 if VPN reset values defined (and all writable); 0 otherwise */ | ||
975 | #define XCHAL_DTLB_SET3_PPN_RESET 0 /* 1 if PPN reset values defined (and all writable); 0 otherwise */ | ||
976 | #define XCHAL_DTLB_SET3_CA_RESET 0 /* 1 if CA reset values defined (and all writable); 0 otherwise */ | ||
977 | /* Constant ASID values for each entry of DTLB way set 3 (because ASID_CONSTMASK is non-zero): */ | ||
978 | #define XCHAL_DTLB_SET3_E0_ASID_CONST 0x01 | ||
979 | #define XCHAL_DTLB_SET3_E1_ASID_CONST 0x01 | ||
980 | /* Constant VPN values for each entry of DTLB way set 3 (because VPN_CONSTMASK is non-zero): */ | ||
981 | #define XCHAL_DTLB_SET3_E0_VPN_CONST 0xE0000000 | ||
982 | #define XCHAL_DTLB_SET3_E1_VPN_CONST 0xF0000000 | ||
983 | /* Constant PPN values for each entry of DTLB way set 3 (because PPN_CONSTMASK is non-zero): */ | ||
984 | #define XCHAL_DTLB_SET3_E0_PPN_CONST 0xF0000000 | ||
985 | #define XCHAL_DTLB_SET3_E1_PPN_CONST 0xF0000000 | ||
986 | /* Constant CA values for each entry of DTLB way set 3 (because CA_CONSTMASK is non-zero): */ | ||
987 | #define XCHAL_DTLB_SET3_E0_CA_CONST 0x07 | ||
988 | #define XCHAL_DTLB_SET3_E1_CA_CONST 0x03 | ||
989 | |||
990 | /* DTLB way set 4 (group of ways 7 thru 9): */ | ||
991 | #define XCHAL_DTLB_SET4_WAY 7 /* index of first way in this way set */ | ||
992 | #define XCHAL_DTLB_SET4_WAYS 3 /* number of (contiguous) ways in this way set */ | ||
993 | #define XCHAL_DTLB_SET4_ENTRIES_LOG2 0 /* log2(number of entries in this way) */ | ||
994 | #define XCHAL_DTLB_SET4_ENTRIES 1 /* number of entries in this way (always a power of 2) */ | ||
995 | #define XCHAL_DTLB_SET4_ARF 0 /* 1=autorefill by h/w, 0=non-autorefill (wired/constant/static) */ | ||
996 | #define XCHAL_DTLB_SET4_PAGESIZES 1 /* number of supported page sizes in this way */ | ||
997 | #define XCHAL_DTLB_SET4_PAGESZ_BITS 0 /* number of bits to encode the page size */ | ||
998 | #define XCHAL_DTLB_SET4_PAGESZ_LOG2_MIN 12 /* log2(minimum supported page size) */ | ||
999 | #define XCHAL_DTLB_SET4_PAGESZ_LOG2_MAX 12 /* log2(maximum supported page size) */ | ||
1000 | #define XCHAL_DTLB_SET4_PAGESZ_LOG2_LIST 12 /* list of log2(page size)s, separated by XCHAL_SEP; | ||
1001 | 2^PAGESZ_BITS entries in list, unsupported entries are zero */ | ||
1002 | #define XCHAL_DTLB_SET4_ASID_CONSTMASK 0 /* constant ASID bits; 0 if all writable */ | ||
1003 | #define XCHAL_DTLB_SET4_VPN_CONSTMASK 0 /* constant VPN bits, not including entry index bits; 0 if all writable */ | ||
1004 | #define XCHAL_DTLB_SET4_PPN_CONSTMASK 0 /* constant PPN bits, including entry index bits; 0 if all writable */ | ||
1005 | #define XCHAL_DTLB_SET4_CA_CONSTMASK 0 /* constant CA bits; 0 if all writable */ | ||
1006 | #define XCHAL_DTLB_SET4_ASID_RESET 0 /* 1 if ASID reset values defined (and all writable); 0 otherwise */ | ||
1007 | #define XCHAL_DTLB_SET4_VPN_RESET 0 /* 1 if VPN reset values defined (and all writable); 0 otherwise */ | ||
1008 | #define XCHAL_DTLB_SET4_PPN_RESET 0 /* 1 if PPN reset values defined (and all writable); 0 otherwise */ | ||
1009 | #define XCHAL_DTLB_SET4_CA_RESET 0 /* 1 if CA reset values defined (and all writable); 0 otherwise */ | ||
1010 | |||
1011 | /* Indexing macros: */ | ||
1012 | #define _XCHAL_DTLB_SET(n,_what) XCHAL_DTLB_SET ## n ## _what | ||
1013 | #define XCHAL_DTLB_SET(n,what) _XCHAL_DTLB_SET(n, _ ## what ) | ||
1014 | #define _XCHAL_DTLB_SET_E(n,i,_what) XCHAL_DTLB_SET ## n ## _E ## i ## _what | ||
1015 | #define XCHAL_DTLB_SET_E(n,i,what) _XCHAL_DTLB_SET_E(n,i, _ ## what ) | ||
1016 | /* | ||
1017 | * Example use: XCHAL_DTLB_SET(XCHAL_DTLB_ARF_SET0,ENTRIES) | ||
1018 | * to get the value of XCHAL_DTLB_SET<n>_ENTRIES where <n> is the first auto-refill set. | ||
1019 | */ | ||
1020 | |||
1021 | |||
1022 | /* | ||
1023 | * Determine whether we have a full MMU (with Page Table and Protection) | ||
1024 | * usable for an MMU-based OS: | ||
1025 | */ | ||
1026 | #if XCHAL_HAVE_TLBS && !XCHAL_HAVE_SPANNING_WAY && XCHAL_ITLB_ARF_WAYS > 0 && XCHAL_DTLB_ARF_WAYS > 0 && XCHAL_MMU_RINGS >= 2 | ||
1027 | # define XCHAL_HAVE_PTP_MMU 1 /* have full MMU (with page table [autorefill] and protection) */ | ||
1028 | #else | ||
1029 | # define XCHAL_HAVE_PTP_MMU 0 /* don't have full MMU */ | ||
1030 | #endif | ||
1031 | |||
1032 | /* | ||
1033 | * For full MMUs, report kernel RAM segment and kernel I/O segment static page mappings: | ||
1034 | */ | ||
1035 | #if XCHAL_HAVE_PTP_MMU | ||
1036 | #define XCHAL_KSEG_CACHED_VADDR 0xD0000000 /* virt.addr of kernel RAM cached static map */ | ||
1037 | #define XCHAL_KSEG_CACHED_PADDR 0x00000000 /* phys.addr of kseg_cached */ | ||
1038 | #define XCHAL_KSEG_CACHED_SIZE 0x08000000 /* size in bytes of kseg_cached (assumed power of 2!!!) */ | ||
1039 | #define XCHAL_KSEG_BYPASS_VADDR 0xD8000000 /* virt.addr of kernel RAM bypass (uncached) static map */ | ||
1040 | #define XCHAL_KSEG_BYPASS_PADDR 0x00000000 /* phys.addr of kseg_bypass */ | ||
1041 | #define XCHAL_KSEG_BYPASS_SIZE 0x08000000 /* size in bytes of kseg_bypass (assumed power of 2!!!) */ | ||
1042 | |||
1043 | #define XCHAL_KIO_CACHED_VADDR 0xE0000000 /* virt.addr of kernel I/O cached static map */ | ||
1044 | #define XCHAL_KIO_CACHED_PADDR 0xF0000000 /* phys.addr of kio_cached */ | ||
1045 | #define XCHAL_KIO_CACHED_SIZE 0x10000000 /* size in bytes of kio_cached (assumed power of 2!!!) */ | ||
1046 | #define XCHAL_KIO_BYPASS_VADDR 0xF0000000 /* virt.addr of kernel I/O bypass (uncached) static map */ | ||
1047 | #define XCHAL_KIO_BYPASS_PADDR 0xF0000000 /* phys.addr of kio_bypass */ | ||
1048 | #define XCHAL_KIO_BYPASS_SIZE 0x10000000 /* size in bytes of kio_bypass (assumed power of 2!!!) */ | ||
1049 | |||
1050 | #define XCHAL_SEG_MAPPABLE_VADDR 0x00000000 /* start of largest non-static-mapped virtual addr area */ | ||
1051 | #define XCHAL_SEG_MAPPABLE_SIZE 0xD0000000 /* size in bytes of " */ | ||
1052 | /* define XCHAL_SEG_MAPPABLE2_xxx if more areas present, sorted in order of descending size. */ | ||
1053 | #endif | ||
1054 | |||
1055 | |||
1056 | /*---------------------------------------------------------------------- | ||
1057 | MISC | ||
1058 | ----------------------------------------------------------------------*/ | ||
1059 | |||
1060 | #define XCHAL_NUM_WRITEBUFFER_ENTRIES 4 /* number of write buffer entries */ | ||
1061 | |||
1062 | #define XCHAL_CORE_ID "linux_be" /* configuration's alphanumeric core identifier | ||
1063 | (CoreID) set in the Xtensa Processor Generator */ | ||
1064 | |||
1065 | #define XCHAL_BUILD_UNIQUE_ID 0x00003256 /* software build-unique ID (22-bit) */ | ||
1066 | |||
1067 | /* These definitions describe the hardware targeted by this software: */ | ||
1068 | #define XCHAL_HW_CONFIGID0 0xC103D1FF /* config ID reg 0 value (upper 32 of 64 bits) */ | ||
1069 | #define XCHAL_HW_CONFIGID1 0x00803256 /* config ID reg 1 value (lower 32 of 64 bits) */ | ||
1070 | #define XCHAL_CONFIGID0 XCHAL_HW_CONFIGID0 /* for backward compatibility only -- don't use! */ | ||
1071 | #define XCHAL_CONFIGID1 XCHAL_HW_CONFIGID1 /* for backward compatibility only -- don't use! */ | ||
1072 | #define XCHAL_HW_RELEASE_MAJOR 1050 /* major release of targeted hardware */ | ||
1073 | #define XCHAL_HW_RELEASE_MINOR 1 /* minor release of targeted hardware */ | ||
1074 | #define XCHAL_HW_RELEASE_NAME "T1050.1" /* full release name of targeted hardware */ | ||
1075 | #define XTHAL_HW_REL_T1050 1 | ||
1076 | #define XTHAL_HW_REL_T1050_1 1 | ||
1077 | #define XCHAL_HW_CONFIGID_RELIABLE 1 | ||
1078 | |||
1079 | |||
1080 | /* | ||
1081 | * Miscellaneous special register fields: | ||
1082 | */ | ||
1083 | |||
1084 | |||
1085 | /* DBREAKC (special register number 160): */ | ||
1086 | #define XCHAL_DBREAKC_VALIDMASK 0xC000003F /* bits of DBREAKC that are defined */ | ||
1087 | /* MASK field: */ | ||
1088 | #define XCHAL_DBREAKC_MASK_BITS 6 /* number of bits in MASK field */ | ||
1089 | #define XCHAL_DBREAKC_MASK_NUM 64 /* max number of possible causes (2^bits) */ | ||
1090 | #define XCHAL_DBREAKC_MASK_SHIFT 0 /* position of MASK bits in DBREAKC, starting from lsbit */ | ||
1091 | #define XCHAL_DBREAKC_MASK_MASK 0x0000003F /* mask of bits in MASK field of DBREAKC */ | ||
1092 | /* LOADBREAK field: */ | ||
1093 | #define XCHAL_DBREAKC_LOADBREAK_BITS 1 /* number of bits in LOADBREAK field */ | ||
1094 | #define XCHAL_DBREAKC_LOADBREAK_NUM 2 /* max number of possible causes (2^bits) */ | ||
1095 | #define XCHAL_DBREAKC_LOADBREAK_SHIFT 30 /* position of LOADBREAK bits in DBREAKC, starting from lsbit */ | ||
1096 | #define XCHAL_DBREAKC_LOADBREAK_MASK 0x40000000 /* mask of bits in LOADBREAK field of DBREAKC */ | ||
1097 | /* STOREBREAK field: */ | ||
1098 | #define XCHAL_DBREAKC_STOREBREAK_BITS 1 /* number of bits in STOREBREAK field */ | ||
1099 | #define XCHAL_DBREAKC_STOREBREAK_NUM 2 /* max number of possible causes (2^bits) */ | ||
1100 | #define XCHAL_DBREAKC_STOREBREAK_SHIFT 31 /* position of STOREBREAK bits in DBREAKC, starting from lsbit */ | ||
1101 | #define XCHAL_DBREAKC_STOREBREAK_MASK 0x80000000 /* mask of bits in STOREBREAK field of DBREAKC */ | ||
1102 | |||
1103 | /* PS (special register number 230): */ | ||
1104 | #define XCHAL_PS_VALIDMASK 0x00070FFF /* bits of PS that are defined */ | ||
1105 | /* INTLEVEL field: */ | ||
1106 | #define XCHAL_PS_INTLEVEL_BITS 4 /* number of bits in INTLEVEL field */ | ||
1107 | #define XCHAL_PS_INTLEVEL_NUM 16 /* max number of possible causes (2^bits) */ | ||
1108 | #define XCHAL_PS_INTLEVEL_SHIFT 0 /* position of INTLEVEL bits in PS, starting from lsbit */ | ||
1109 | #define XCHAL_PS_INTLEVEL_MASK 0x0000000F /* mask of bits in INTLEVEL field of PS */ | ||
1110 | /* EXCM field: */ | ||
1111 | #define XCHAL_PS_EXCM_BITS 1 /* number of bits in EXCM field */ | ||
1112 | #define XCHAL_PS_EXCM_NUM 2 /* max number of possible causes (2^bits) */ | ||
1113 | #define XCHAL_PS_EXCM_SHIFT 4 /* position of EXCM bits in PS, starting from lsbit */ | ||
1114 | #define XCHAL_PS_EXCM_MASK 0x00000010 /* mask of bits in EXCM field of PS */ | ||
1115 | /* PROGSTACK field: */ | ||
1116 | #define XCHAL_PS_PROGSTACK_BITS 1 /* number of bits in PROGSTACK field */ | ||
1117 | #define XCHAL_PS_PROGSTACK_NUM 2 /* max number of possible causes (2^bits) */ | ||
1118 | #define XCHAL_PS_PROGSTACK_SHIFT 5 /* position of PROGSTACK bits in PS, starting from lsbit */ | ||
1119 | #define XCHAL_PS_PROGSTACK_MASK 0x00000020 /* mask of bits in PROGSTACK field of PS */ | ||
1120 | /* RING field: */ | ||
1121 | #define XCHAL_PS_RING_BITS 2 /* number of bits in RING field */ | ||
1122 | #define XCHAL_PS_RING_NUM 4 /* max number of possible causes (2^bits) */ | ||
1123 | #define XCHAL_PS_RING_SHIFT 6 /* position of RING bits in PS, starting from lsbit */ | ||
1124 | #define XCHAL_PS_RING_MASK 0x000000C0 /* mask of bits in RING field of PS */ | ||
1125 | /* OWB field: */ | ||
1126 | #define XCHAL_PS_OWB_BITS 4 /* number of bits in OWB field */ | ||
1127 | #define XCHAL_PS_OWB_NUM 16 /* max number of possible causes (2^bits) */ | ||
1128 | #define XCHAL_PS_OWB_SHIFT 8 /* position of OWB bits in PS, starting from lsbit */ | ||
1129 | #define XCHAL_PS_OWB_MASK 0x00000F00 /* mask of bits in OWB field of PS */ | ||
1130 | /* CALLINC field: */ | ||
1131 | #define XCHAL_PS_CALLINC_BITS 2 /* number of bits in CALLINC field */ | ||
1132 | #define XCHAL_PS_CALLINC_NUM 4 /* max number of possible causes (2^bits) */ | ||
1133 | #define XCHAL_PS_CALLINC_SHIFT 16 /* position of CALLINC bits in PS, starting from lsbit */ | ||
1134 | #define XCHAL_PS_CALLINC_MASK 0x00030000 /* mask of bits in CALLINC field of PS */ | ||
1135 | /* WOE field: */ | ||
1136 | #define XCHAL_PS_WOE_BITS 1 /* number of bits in WOE field */ | ||
1137 | #define XCHAL_PS_WOE_NUM 2 /* max number of possible causes (2^bits) */ | ||
1138 | #define XCHAL_PS_WOE_SHIFT 18 /* position of WOE bits in PS, starting from lsbit */ | ||
1139 | #define XCHAL_PS_WOE_MASK 0x00040000 /* mask of bits in WOE field of PS */ | ||
1140 | |||
1141 | /* EXCCAUSE (special register number 232): */ | ||
1142 | #define XCHAL_EXCCAUSE_VALIDMASK 0x0000003F /* bits of EXCCAUSE that are defined */ | ||
1143 | /* EXCCAUSE field: */ | ||
1144 | #define XCHAL_EXCCAUSE_BITS 6 /* number of bits in EXCCAUSE register */ | ||
1145 | #define XCHAL_EXCCAUSE_NUM 64 /* max number of possible causes (2^bits) */ | ||
1146 | #define XCHAL_EXCCAUSE_SHIFT 0 /* position of EXCCAUSE bits in register, starting from lsbit */ | ||
1147 | #define XCHAL_EXCCAUSE_MASK 0x0000003F /* mask of bits in EXCCAUSE register */ | ||
1148 | |||
1149 | /* DEBUGCAUSE (special register number 233): */ | ||
1150 | #define XCHAL_DEBUGCAUSE_VALIDMASK 0x0000003F /* bits of DEBUGCAUSE that are defined */ | ||
1151 | /* ICOUNT field: */ | ||
1152 | #define XCHAL_DEBUGCAUSE_ICOUNT_BITS 1 /* number of bits in ICOUNT field */ | ||
1153 | #define XCHAL_DEBUGCAUSE_ICOUNT_NUM 2 /* max number of possible causes (2^bits) */ | ||
1154 | #define XCHAL_DEBUGCAUSE_ICOUNT_SHIFT 0 /* position of ICOUNT bits in DEBUGCAUSE, starting from lsbit */ | ||
1155 | #define XCHAL_DEBUGCAUSE_ICOUNT_MASK 0x00000001 /* mask of bits in ICOUNT field of DEBUGCAUSE */ | ||
1156 | /* IBREAK field: */ | ||
1157 | #define XCHAL_DEBUGCAUSE_IBREAK_BITS 1 /* number of bits in IBREAK field */ | ||
1158 | #define XCHAL_DEBUGCAUSE_IBREAK_NUM 2 /* max number of possible causes (2^bits) */ | ||
1159 | #define XCHAL_DEBUGCAUSE_IBREAK_SHIFT 1 /* position of IBREAK bits in DEBUGCAUSE, starting from lsbit */ | ||
1160 | #define XCHAL_DEBUGCAUSE_IBREAK_MASK 0x00000002 /* mask of bits in IBREAK field of DEBUGCAUSE */ | ||
1161 | /* DBREAK field: */ | ||
1162 | #define XCHAL_DEBUGCAUSE_DBREAK_BITS 1 /* number of bits in DBREAK field */ | ||
1163 | #define XCHAL_DEBUGCAUSE_DBREAK_NUM 2 /* max number of possible causes (2^bits) */ | ||
1164 | #define XCHAL_DEBUGCAUSE_DBREAK_SHIFT 2 /* position of DBREAK bits in DEBUGCAUSE, starting from lsbit */ | ||
1165 | #define XCHAL_DEBUGCAUSE_DBREAK_MASK 0x00000004 /* mask of bits in DBREAK field of DEBUGCAUSE */ | ||
1166 | /* BREAK field: */ | ||
1167 | #define XCHAL_DEBUGCAUSE_BREAK_BITS 1 /* number of bits in BREAK field */ | ||
1168 | #define XCHAL_DEBUGCAUSE_BREAK_NUM 2 /* max number of possible causes (2^bits) */ | ||
1169 | #define XCHAL_DEBUGCAUSE_BREAK_SHIFT 3 /* position of BREAK bits in DEBUGCAUSE, starting from lsbit */ | ||
1170 | #define XCHAL_DEBUGCAUSE_BREAK_MASK 0x00000008 /* mask of bits in BREAK field of DEBUGCAUSE */ | ||
1171 | /* BREAKN field: */ | ||
1172 | #define XCHAL_DEBUGCAUSE_BREAKN_BITS 1 /* number of bits in BREAKN field */ | ||
1173 | #define XCHAL_DEBUGCAUSE_BREAKN_NUM 2 /* max number of possible causes (2^bits) */ | ||
1174 | #define XCHAL_DEBUGCAUSE_BREAKN_SHIFT 4 /* position of BREAKN bits in DEBUGCAUSE, starting from lsbit */ | ||
1175 | #define XCHAL_DEBUGCAUSE_BREAKN_MASK 0x00000010 /* mask of bits in BREAKN field of DEBUGCAUSE */ | ||
1176 | /* DEBUGINT field: */ | ||
1177 | #define XCHAL_DEBUGCAUSE_DEBUGINT_BITS 1 /* number of bits in DEBUGINT field */ | ||
1178 | #define XCHAL_DEBUGCAUSE_DEBUGINT_NUM 2 /* max number of possible causes (2^bits) */ | ||
1179 | #define XCHAL_DEBUGCAUSE_DEBUGINT_SHIFT 5 /* position of DEBUGINT bits in DEBUGCAUSE, starting from lsbit */ | ||
1180 | #define XCHAL_DEBUGCAUSE_DEBUGINT_MASK 0x00000020 /* mask of bits in DEBUGINT field of DEBUGCAUSE */ | ||
1181 | |||
1182 | |||
1183 | |||
1184 | /*---------------------------------------------------------------------- | ||
1185 | ISA | ||
1186 | ----------------------------------------------------------------------*/ | ||
1187 | |||
1188 | #define XCHAL_HAVE_DENSITY 1 /* 1 if density option configured, 0 otherwise */ | ||
1189 | #define XCHAL_HAVE_LOOPS 1 /* 1 if zero-overhead loops option configured, 0 otherwise */ | ||
1190 | /* Misc instructions: */ | ||
1191 | #define XCHAL_HAVE_NSA 0 /* 1 if NSA/NSAU instructions option configured, 0 otherwise */ | ||
1192 | #define XCHAL_HAVE_MINMAX 0 /* 1 if MIN/MAX instructions option configured, 0 otherwise */ | ||
1193 | #define XCHAL_HAVE_SEXT 0 /* 1 if sign-extend instruction option configured, 0 otherwise */ | ||
1194 | #define XCHAL_HAVE_CLAMPS 0 /* 1 if CLAMPS instruction option configured, 0 otherwise */ | ||
1195 | #define XCHAL_HAVE_MAC16 0 /* 1 if MAC16 option configured, 0 otherwise */ | ||
1196 | #define XCHAL_HAVE_MUL16 0 /* 1 if 16-bit integer multiply option configured, 0 otherwise */ | ||
1197 | /*#define XCHAL_HAVE_POPC 0*/ /* 1 if CRC instruction option configured, 0 otherwise */ | ||
1198 | /*#define XCHAL_HAVE_CRC 0*/ /* 1 if POPC instruction option configured, 0 otherwise */ | ||
1199 | |||
1200 | #define XCHAL_HAVE_SPECULATION 0 /* 1 if speculation option configured, 0 otherwise */ | ||
1201 | /*#define XCHAL_HAVE_MP_SYNC 0*/ /* 1 if multiprocessor sync. option configured, 0 otherwise */ | ||
1202 | #define XCHAL_HAVE_PRID 0 /* 1 if processor ID register configured, 0 otherwise */ | ||
1203 | |||
1204 | #define XCHAL_NUM_MISC_REGS 2 /* number of miscellaneous registers (0..4) */ | ||
1205 | |||
1206 | /* These relate a bit more to TIE: */ | ||
1207 | #define XCHAL_HAVE_BOOLEANS 0 /* 1 if booleans option configured, 0 otherwise */ | ||
1208 | #define XCHAL_HAVE_MUL32 0 /* 1 if 32-bit integer multiply option configured, 0 otherwise */ | ||
1209 | #define XCHAL_HAVE_MUL32_HIGH 0 /* 1 if MUL32 option includes MULUH and MULSH, 0 otherwise */ | ||
1210 | #define XCHAL_HAVE_FP 0 /* 1 if floating point option configured, 0 otherwise */ | ||
1211 | |||
1212 | |||
1213 | /*---------------------------------------------------------------------- | ||
1214 | DERIVED | ||
1215 | ----------------------------------------------------------------------*/ | ||
1216 | |||
1217 | #if XCHAL_HAVE_BE | ||
1218 | #define XCHAL_INST_ILLN 0xD60F /* 2-byte illegal instruction, msb-first */ | ||
1219 | #define XCHAL_INST_ILLN_BYTE0 0xD6 /* 2-byte illegal instruction, 1st byte */ | ||
1220 | #define XCHAL_INST_ILLN_BYTE1 0x0F /* 2-byte illegal instruction, 2nd byte */ | ||
1221 | #else | ||
1222 | #define XCHAL_INST_ILLN 0xF06D /* 2-byte illegal instruction, lsb-first */ | ||
1223 | #define XCHAL_INST_ILLN_BYTE0 0x6D /* 2-byte illegal instruction, 1st byte */ | ||
1224 | #define XCHAL_INST_ILLN_BYTE1 0xF0 /* 2-byte illegal instruction, 2nd byte */ | ||
1225 | #endif | ||
1226 | /* Belongs in xtensa/hal.h: */ | ||
1227 | #define XTHAL_INST_ILL 0x000000 /* 3-byte illegal instruction */ | ||
1228 | |||
1229 | |||
1230 | /* | ||
1231 | * Because information as to exactly which hardware release is targeted | ||
1232 | * by a given software build is not always available, compile-time HAL | ||
1233 | * Hardware-Release "_AT" macros are fuzzy (return 0, 1, or XCHAL_MAYBE): | ||
1234 | */ | ||
1235 | #ifndef XCHAL_HW_RELEASE_MAJOR | ||
1236 | # define XCHAL_HW_CONFIGID_RELIABLE 0 | ||
1237 | #endif | ||
1238 | #if XCHAL_HW_CONFIGID_RELIABLE | ||
1239 | # define XCHAL_HW_RELEASE_AT_OR_BELOW(major,minor) (XTHAL_REL_LE( XCHAL_HW_RELEASE_MAJOR,XCHAL_HW_RELEASE_MINOR, major,minor ) ? 1 : 0) | ||
1240 | # define XCHAL_HW_RELEASE_AT_OR_ABOVE(major,minor) (XTHAL_REL_GE( XCHAL_HW_RELEASE_MAJOR,XCHAL_HW_RELEASE_MINOR, major,minor ) ? 1 : 0) | ||
1241 | # define XCHAL_HW_RELEASE_AT(major,minor) (XTHAL_REL_EQ( XCHAL_HW_RELEASE_MAJOR,XCHAL_HW_RELEASE_MINOR, major,minor ) ? 1 : 0) | ||
1242 | # define XCHAL_HW_RELEASE_MAJOR_AT(major) ((XCHAL_HW_RELEASE_MAJOR == (major)) ? 1 : 0) | ||
1243 | #else | ||
1244 | # define XCHAL_HW_RELEASE_AT_OR_BELOW(major,minor) ( ((major) < 1040 && XCHAL_HAVE_XEA2) ? 0 \ | ||
1245 | : ((major) > 1050 && XCHAL_HAVE_XEA1) ? 1 \ | ||
1246 | : XTHAL_MAYBE ) | ||
1247 | # define XCHAL_HW_RELEASE_AT_OR_ABOVE(major,minor) ( ((major) >= 2000 && XCHAL_HAVE_XEA1) ? 0 \ | ||
1248 | : (XTHAL_REL_LE(major,minor, 1040,0) && XCHAL_HAVE_XEA2) ? 1 \ | ||
1249 | : XTHAL_MAYBE ) | ||
1250 | # define XCHAL_HW_RELEASE_AT(major,minor) ( (((major) < 1040 && XCHAL_HAVE_XEA2) || \ | ||
1251 | ((major) >= 2000 && XCHAL_HAVE_XEA1)) ? 0 : XTHAL_MAYBE) | ||
1252 | # define XCHAL_HW_RELEASE_MAJOR_AT(major) XCHAL_HW_RELEASE_AT(major,0) | ||
1253 | #endif | ||
1254 | |||
1255 | /* | ||
1256 | * Specific errata: | ||
1257 | */ | ||
1258 | |||
1259 | /* | ||
1260 | * Erratum T1020.H13, T1030.H7, T1040.H10, T1050.H4 (fixed in T1040.3 and T1050.1; | ||
1261 | * relevant only in XEA1, kernel-vector mode, level-one interrupts and overflows enabled): | ||
1262 | */ | ||
1263 | #define XCHAL_MAYHAVE_ERRATUM_XEA1KWIN (XCHAL_HAVE_XEA1 && \ | ||
1264 | (XCHAL_HW_RELEASE_AT_OR_BELOW(1040,2) != 0 \ | ||
1265 | || XCHAL_HW_RELEASE_AT(1050,0))) | ||
1266 | |||
1267 | |||
1268 | |||
1269 | #endif /*XTENSA_CONFIG_CORE_H*/ | ||
1270 | |||
diff --git a/include/asm-xtensa/xtensa/config-linux_be/defs.h b/include/asm-xtensa/xtensa/config-linux_be/defs.h deleted file mode 100644 index f7c58b273371..000000000000 --- a/include/asm-xtensa/xtensa/config-linux_be/defs.h +++ /dev/null | |||
@@ -1,270 +0,0 @@ | |||
1 | /* Definitions for Xtensa instructions, types, and protos. */ | ||
2 | |||
3 | /* | ||
4 | * Copyright (c) 2003 Tensilica, Inc. All Rights Reserved. | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify | ||
7 | * it under the terms of version 2.1 of the GNU Lesser General Public | ||
8 | * License as published by the Free Software Foundation. | ||
9 | * | ||
10 | * This program is distributed in the hope that it would be useful, but | ||
11 | * WITHOUT ANY WARRANTY; without even the implied warranty of | ||
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | ||
13 | * | ||
14 | * Further, this software is distributed without any warranty that it is | ||
15 | * free of the rightful claim of any third person regarding infringement | ||
16 | * or the like. Any license provided herein, whether implied or | ||
17 | * otherwise, applies only to this software file. Patent licenses, if | ||
18 | * any, provided herein do not apply to combinations of this program with | ||
19 | * other software, or any other product whatsoever. | ||
20 | * | ||
21 | * You should have received a copy of the GNU Lesser General Public | ||
22 | * License along with this program; if not, write the Free Software | ||
23 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston MA 02111-1307, | ||
24 | * USA. | ||
25 | */ | ||
26 | |||
27 | /* Do not modify. This is automatically generated.*/ | ||
28 | |||
29 | #ifndef _XTENSA_BASE_HEADER | ||
30 | #define _XTENSA_BASE_HEADER | ||
31 | |||
32 | #ifdef __XTENSA__ | ||
33 | #if defined(__GNUC__) && !defined(__XCC__) | ||
34 | |||
35 | #define L8UI_ASM(arr, ars, imm) { \ | ||
36 | __asm__ volatile("l8ui %0, %1, %2" : "=a" (arr) : "a" (ars) , "i" (imm)); \ | ||
37 | } | ||
38 | |||
39 | #define XT_L8UI(ars, imm) \ | ||
40 | ({ \ | ||
41 | unsigned char _arr; \ | ||
42 | const unsigned char *_ars = ars; \ | ||
43 | L8UI_ASM(_arr, _ars, imm); \ | ||
44 | _arr; \ | ||
45 | }) | ||
46 | |||
47 | #define L16UI_ASM(arr, ars, imm) { \ | ||
48 | __asm__ volatile("l16ui %0, %1, %2" : "=a" (arr) : "a" (ars) , "i" (imm)); \ | ||
49 | } | ||
50 | |||
51 | #define XT_L16UI(ars, imm) \ | ||
52 | ({ \ | ||
53 | unsigned short _arr; \ | ||
54 | const unsigned short *_ars = ars; \ | ||
55 | L16UI_ASM(_arr, _ars, imm); \ | ||
56 | _arr; \ | ||
57 | }) | ||
58 | |||
59 | #define L16SI_ASM(arr, ars, imm) {\ | ||
60 | __asm__ volatile("l16si %0, %1, %2" : "=a" (arr) : "a" (ars) , "i" (imm)); \ | ||
61 | } | ||
62 | |||
63 | #define XT_L16SI(ars, imm) \ | ||
64 | ({ \ | ||
65 | signed short _arr; \ | ||
66 | const signed short *_ars = ars; \ | ||
67 | L16SI_ASM(_arr, _ars, imm); \ | ||
68 | _arr; \ | ||
69 | }) | ||
70 | |||
71 | #define L32I_ASM(arr, ars, imm) { \ | ||
72 | __asm__ volatile("l32i %0, %1, %2" : "=a" (arr) : "a" (ars) , "i" (imm)); \ | ||
73 | } | ||
74 | |||
75 | #define XT_L32I(ars, imm) \ | ||
76 | ({ \ | ||
77 | unsigned _arr; \ | ||
78 | const unsigned *_ars = ars; \ | ||
79 | L32I_ASM(_arr, _ars, imm); \ | ||
80 | _arr; \ | ||
81 | }) | ||
82 | |||
83 | #define S8I_ASM(arr, ars, imm) {\ | ||
84 | __asm__ volatile("s8i %0, %1, %2" : : "a" (arr), "a" (ars) , "i" (imm) : "memory" ); \ | ||
85 | } | ||
86 | |||
87 | #define XT_S8I(arr, ars, imm) \ | ||
88 | ({ \ | ||
89 | signed char _arr = arr; \ | ||
90 | const signed char *_ars = ars; \ | ||
91 | S8I_ASM(_arr, _ars, imm); \ | ||
92 | }) | ||
93 | |||
94 | #define S16I_ASM(arr, ars, imm) {\ | ||
95 | __asm__ volatile("s16i %0, %1, %2" : : "a" (arr), "a" (ars) , "i" (imm) : "memory" ); \ | ||
96 | } | ||
97 | |||
98 | #define XT_S16I(arr, ars, imm) \ | ||
99 | ({ \ | ||
100 | signed short _arr = arr; \ | ||
101 | const signed short *_ars = ars; \ | ||
102 | S16I_ASM(_arr, _ars, imm); \ | ||
103 | }) | ||
104 | |||
105 | #define S32I_ASM(arr, ars, imm) { \ | ||
106 | __asm__ volatile("s32i %0, %1, %2" : : "a" (arr), "a" (ars) , "i" (imm) : "memory" ); \ | ||
107 | } | ||
108 | |||
109 | #define XT_S32I(arr, ars, imm) \ | ||
110 | ({ \ | ||
111 | signed int _arr = arr; \ | ||
112 | const signed int *_ars = ars; \ | ||
113 | S32I_ASM(_arr, _ars, imm); \ | ||
114 | }) | ||
115 | |||
116 | #define ADDI_ASM(art, ars, imm) {\ | ||
117 | __asm__ ("addi %0, %1, %2" : "=a" (art) : "a" (ars), "i" (imm)); \ | ||
118 | } | ||
119 | |||
120 | #define XT_ADDI(ars, imm) \ | ||
121 | ({ \ | ||
122 | unsigned _art; \ | ||
123 | unsigned _ars = ars; \ | ||
124 | ADDI_ASM(_art, _ars, imm); \ | ||
125 | _art; \ | ||
126 | }) | ||
127 | |||
128 | #define ABS_ASM(arr, art) {\ | ||
129 | __asm__ ("abs %0, %1" : "=a" (arr) : "a" (art)); \ | ||
130 | } | ||
131 | |||
132 | #define XT_ABS(art) \ | ||
133 | ({ \ | ||
134 | unsigned _arr; \ | ||
135 | signed _art = art; \ | ||
136 | ABS_ASM(_arr, _art); \ | ||
137 | _arr; \ | ||
138 | }) | ||
139 | |||
140 | /* Note: In the following macros that reference SAR, the magic "state" | ||
141 | register is used to capture the dependency on SAR. This is because | ||
142 | SAR is a 5-bit register and thus there are no C types that can be | ||
143 | used to represent it. It doesn't appear that the SAR register is | ||
144 | even relevant to GCC, but it is marked as "clobbered" just in | ||
145 | case. */ | ||
146 | |||
147 | #define SRC_ASM(arr, ars, art) {\ | ||
148 | register int _xt_sar __asm__ ("state"); \ | ||
149 | __asm__ ("src %0, %1, %2" \ | ||
150 | : "=a" (arr) : "a" (ars), "a" (art), "t" (_xt_sar)); \ | ||
151 | } | ||
152 | |||
153 | #define XT_SRC(ars, art) \ | ||
154 | ({ \ | ||
155 | unsigned _arr; \ | ||
156 | unsigned _ars = ars; \ | ||
157 | unsigned _art = art; \ | ||
158 | SRC_ASM(_arr, _ars, _art); \ | ||
159 | _arr; \ | ||
160 | }) | ||
161 | |||
162 | #define SSR_ASM(ars) {\ | ||
163 | register int _xt_sar __asm__ ("state"); \ | ||
164 | __asm__ ("ssr %1" : "=t" (_xt_sar) : "a" (ars) : "sar"); \ | ||
165 | } | ||
166 | |||
167 | #define XT_SSR(ars) \ | ||
168 | ({ \ | ||
169 | unsigned _ars = ars; \ | ||
170 | SSR_ASM(_ars); \ | ||
171 | }) | ||
172 | |||
173 | #define SSL_ASM(ars) {\ | ||
174 | register int _xt_sar __asm__ ("state"); \ | ||
175 | __asm__ ("ssl %1" : "=t" (_xt_sar) : "a" (ars) : "sar"); \ | ||
176 | } | ||
177 | |||
178 | #define XT_SSL(ars) \ | ||
179 | ({ \ | ||
180 | unsigned _ars = ars; \ | ||
181 | SSL_ASM(_ars); \ | ||
182 | }) | ||
183 | |||
184 | #define SSA8B_ASM(ars) {\ | ||
185 | register int _xt_sar __asm__ ("state"); \ | ||
186 | __asm__ ("ssa8b %1" : "=t" (_xt_sar) : "a" (ars) : "sar"); \ | ||
187 | } | ||
188 | |||
189 | #define XT_SSA8B(ars) \ | ||
190 | ({ \ | ||
191 | unsigned _ars = ars; \ | ||
192 | SSA8B_ASM(_ars); \ | ||
193 | }) | ||
194 | |||
195 | #define SSA8L_ASM(ars) {\ | ||
196 | register int _xt_sar __asm__ ("state"); \ | ||
197 | __asm__ ("ssa8l %1" : "=t" (_xt_sar) : "a" (ars) : "sar"); \ | ||
198 | } | ||
199 | |||
200 | #define XT_SSA8L(ars) \ | ||
201 | ({ \ | ||
202 | unsigned _ars = ars; \ | ||
203 | SSA8L_ASM(_ars); \ | ||
204 | }) | ||
205 | |||
206 | #define SSAI_ASM(imm) {\ | ||
207 | register int _xt_sar __asm__ ("state"); \ | ||
208 | __asm__ ("ssai %1" : "=t" (_xt_sar) : "i" (imm) : "sar"); \ | ||
209 | } | ||
210 | |||
211 | #define XT_SSAI(imm) \ | ||
212 | ({ \ | ||
213 | SSAI_ASM(imm); \ | ||
214 | }) | ||
215 | |||
216 | |||
217 | |||
218 | |||
219 | |||
220 | |||
221 | |||
222 | |||
223 | #endif /* __GNUC__ && !__XCC__ */ | ||
224 | |||
225 | #ifdef __XCC__ | ||
226 | |||
227 | /* Core load/store instructions */ | ||
228 | extern unsigned char _TIE_L8UI(const unsigned char * ars, immediate imm); | ||
229 | extern unsigned short _TIE_L16UI(const unsigned short * ars, immediate imm); | ||
230 | extern signed short _TIE_L16SI(const signed short * ars, immediate imm); | ||
231 | extern unsigned _TIE_L32I(const unsigned * ars, immediate imm); | ||
232 | extern void _TIE_S8I(unsigned char arr, unsigned char * ars, immediate imm); | ||
233 | extern void _TIE_S16I(unsigned short arr, unsigned short * ars, immediate imm); | ||
234 | extern void _TIE_S32I(unsigned arr, unsigned * ars, immediate imm); | ||
235 | |||
236 | #define XT_L8UI _TIE_L8UI | ||
237 | #define XT_L16UI _TIE_L16UI | ||
238 | #define XT_L16SI _TIE_L16SI | ||
239 | #define XT_L32I _TIE_L32I | ||
240 | #define XT_S8I _TIE_S8I | ||
241 | #define XT_S16I _TIE_S16I | ||
242 | #define XT_S32I _TIE_S32I | ||
243 | |||
244 | /* Add-immediate instruction */ | ||
245 | extern unsigned _TIE_ADDI(unsigned ars, immediate imm); | ||
246 | #define XT_ADDI _TIE_ADDI | ||
247 | |||
248 | /* Absolute value instruction */ | ||
249 | extern unsigned _TIE_ABS(int art); | ||
250 | #define XT_ABS _TIE_ABS | ||
251 | |||
252 | /* funnel shift instructions */ | ||
253 | extern unsigned _TIE_SRC(unsigned ars, unsigned art); | ||
254 | #define XT_SRC _TIE_SRC | ||
255 | extern void _TIE_SSR(unsigned ars); | ||
256 | #define XT_SSR _TIE_SSR | ||
257 | extern void _TIE_SSL(unsigned ars); | ||
258 | #define XT_SSL _TIE_SSL | ||
259 | extern void _TIE_SSA8B(unsigned ars); | ||
260 | #define XT_SSA8B _TIE_SSA8B | ||
261 | extern void _TIE_SSA8L(unsigned ars); | ||
262 | #define XT_SSA8L _TIE_SSA8L | ||
263 | extern void _TIE_SSAI(immediate imm); | ||
264 | #define XT_SSAI _TIE_SSAI | ||
265 | |||
266 | |||
267 | #endif /* __XCC__ */ | ||
268 | |||
269 | #endif /* __XTENSA__ */ | ||
270 | #endif /* !_XTENSA_BASE_HEADER */ | ||
diff --git a/include/asm-xtensa/xtensa/config-linux_be/specreg.h b/include/asm-xtensa/xtensa/config-linux_be/specreg.h deleted file mode 100644 index fa4106aa9a02..000000000000 --- a/include/asm-xtensa/xtensa/config-linux_be/specreg.h +++ /dev/null | |||
@@ -1,99 +0,0 @@ | |||
1 | /* | ||
2 | * Xtensa Special Register symbolic names | ||
3 | */ | ||
4 | |||
5 | /* $Id: specreg.h,v 1.2 2003/03/07 19:15:18 joetaylor Exp $ */ | ||
6 | |||
7 | /* | ||
8 | * Copyright (c) 2003 Tensilica, Inc. All Rights Reserved. | ||
9 | * | ||
10 | * This program is free software; you can redistribute it and/or modify | ||
11 | * it under the terms of version 2.1 of the GNU Lesser General Public | ||
12 | * License as published by the Free Software Foundation. | ||
13 | * | ||
14 | * This program is distributed in the hope that it would be useful, but | ||
15 | * WITHOUT ANY WARRANTY; without even the implied warranty of | ||
16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | ||
17 | * | ||
18 | * Further, this software is distributed without any warranty that it is | ||
19 | * free of the rightful claim of any third person regarding infringement | ||
20 | * or the like. Any license provided herein, whether implied or | ||
21 | * otherwise, applies only to this software file. Patent licenses, if | ||
22 | * any, provided herein do not apply to combinations of this program with | ||
23 | * other software, or any other product whatsoever. | ||
24 | * | ||
25 | * You should have received a copy of the GNU Lesser General Public | ||
26 | * License along with this program; if not, write the Free Software | ||
27 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston MA 02111-1307, | ||
28 | * USA. | ||
29 | */ | ||
30 | |||
31 | #ifndef XTENSA_SPECREG_H | ||
32 | #define XTENSA_SPECREG_H | ||
33 | |||
34 | /* Include these special register bitfield definitions, for historical reasons: */ | ||
35 | #include <xtensa/corebits.h> | ||
36 | |||
37 | |||
38 | /* Special registers: */ | ||
39 | #define LBEG 0 | ||
40 | #define LEND 1 | ||
41 | #define LCOUNT 2 | ||
42 | #define SAR 3 | ||
43 | #define WINDOWBASE 72 | ||
44 | #define WINDOWSTART 73 | ||
45 | #define PTEVADDR 83 | ||
46 | #define RASID 90 | ||
47 | #define ITLBCFG 91 | ||
48 | #define DTLBCFG 92 | ||
49 | #define IBREAKENABLE 96 | ||
50 | #define DDR 104 | ||
51 | #define IBREAKA_0 128 | ||
52 | #define IBREAKA_1 129 | ||
53 | #define DBREAKA_0 144 | ||
54 | #define DBREAKA_1 145 | ||
55 | #define DBREAKC_0 160 | ||
56 | #define DBREAKC_1 161 | ||
57 | #define EPC_1 177 | ||
58 | #define EPC_2 178 | ||
59 | #define EPC_3 179 | ||
60 | #define EPC_4 180 | ||
61 | #define DEPC 192 | ||
62 | #define EPS_2 194 | ||
63 | #define EPS_3 195 | ||
64 | #define EPS_4 196 | ||
65 | #define EXCSAVE_1 209 | ||
66 | #define EXCSAVE_2 210 | ||
67 | #define EXCSAVE_3 211 | ||
68 | #define EXCSAVE_4 212 | ||
69 | #define INTERRUPT 226 | ||
70 | #define INTENABLE 228 | ||
71 | #define PS 230 | ||
72 | #define EXCCAUSE 232 | ||
73 | #define DEBUGCAUSE 233 | ||
74 | #define CCOUNT 234 | ||
75 | #define ICOUNT 236 | ||
76 | #define ICOUNTLEVEL 237 | ||
77 | #define EXCVADDR 238 | ||
78 | #define CCOMPARE_0 240 | ||
79 | #define CCOMPARE_1 241 | ||
80 | #define CCOMPARE_2 242 | ||
81 | #define MISC_REG_0 244 | ||
82 | #define MISC_REG_1 245 | ||
83 | |||
84 | /* Special cases (bases of special register series): */ | ||
85 | #define IBREAKA 128 | ||
86 | #define DBREAKA 144 | ||
87 | #define DBREAKC 160 | ||
88 | #define EPC 176 | ||
89 | #define EPS 192 | ||
90 | #define EXCSAVE 208 | ||
91 | #define CCOMPARE 240 | ||
92 | |||
93 | /* Special names for read-only and write-only interrupt registers: */ | ||
94 | #define INTREAD 226 | ||
95 | #define INTSET 226 | ||
96 | #define INTCLEAR 227 | ||
97 | |||
98 | #endif /* XTENSA_SPECREG_H */ | ||
99 | |||
diff --git a/include/asm-xtensa/xtensa/config-linux_be/system.h b/include/asm-xtensa/xtensa/config-linux_be/system.h deleted file mode 100644 index cf9d4d308e3a..000000000000 --- a/include/asm-xtensa/xtensa/config-linux_be/system.h +++ /dev/null | |||
@@ -1,198 +0,0 @@ | |||
1 | /* | ||
2 | * xtensa/config/system.h -- HAL definitions that are dependent on SYSTEM configuration | ||
3 | * | ||
4 | * NOTE: The location and contents of this file are highly subject to change. | ||
5 | * | ||
6 | * Source for configuration-independent binaries (which link in a | ||
7 | * configuration-specific HAL library) must NEVER include this file. | ||
8 | * The HAL itself has historically included this file in some instances, | ||
9 | * but this is not appropriate either, because the HAL is meant to be | ||
10 | * core-specific but system independent. | ||
11 | */ | ||
12 | |||
13 | /* | ||
14 | * Copyright (c) 2003 Tensilica, Inc. All Rights Reserved. | ||
15 | * | ||
16 | * This program is free software; you can redistribute it and/or modify | ||
17 | * it under the terms of version 2.1 of the GNU Lesser General Public | ||
18 | * License as published by the Free Software Foundation. | ||
19 | * | ||
20 | * This program is distributed in the hope that it would be useful, but | ||
21 | * WITHOUT ANY WARRANTY; without even the implied warranty of | ||
22 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | ||
23 | * | ||
24 | * Further, this software is distributed without any warranty that it is | ||
25 | * free of the rightful claim of any third person regarding infringement | ||
26 | * or the like. Any license provided herein, whether implied or | ||
27 | * otherwise, applies only to this software file. Patent licenses, if | ||
28 | * any, provided herein do not apply to combinations of this program with | ||
29 | * other software, or any other product whatsoever. | ||
30 | * | ||
31 | * You should have received a copy of the GNU Lesser General Public | ||
32 | * License along with this program; if not, write the Free Software | ||
33 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston MA 02111-1307, | ||
34 | * USA. | ||
35 | */ | ||
36 | |||
37 | |||
38 | #ifndef XTENSA_CONFIG_SYSTEM_H | ||
39 | #define XTENSA_CONFIG_SYSTEM_H | ||
40 | |||
41 | /*#include <xtensa/hal.h>*/ | ||
42 | |||
43 | |||
44 | |||
45 | /*---------------------------------------------------------------------- | ||
46 | DEVICE ADDRESSES | ||
47 | ----------------------------------------------------------------------*/ | ||
48 | |||
49 | /* | ||
50 | * Strange place to find these, but the configuration GUI | ||
51 | * allows moving these around to account for various core | ||
52 | * configurations. Specific boards (and their BSP software) | ||
53 | * will have specific meanings for these components. | ||
54 | */ | ||
55 | |||
56 | /* I/O Block areas: */ | ||
57 | #define XSHAL_IOBLOCK_CACHED_VADDR 0xE0000000 | ||
58 | #define XSHAL_IOBLOCK_CACHED_PADDR 0xF0000000 | ||
59 | #define XSHAL_IOBLOCK_CACHED_SIZE 0x0E000000 | ||
60 | |||
61 | #define XSHAL_IOBLOCK_BYPASS_VADDR 0xF0000000 | ||
62 | #define XSHAL_IOBLOCK_BYPASS_PADDR 0xF0000000 | ||
63 | #define XSHAL_IOBLOCK_BYPASS_SIZE 0x0E000000 | ||
64 | |||
65 | /* System ROM: */ | ||
66 | #define XSHAL_ROM_VADDR 0xEE000000 | ||
67 | #define XSHAL_ROM_PADDR 0xFE000000 | ||
68 | #define XSHAL_ROM_SIZE 0x00400000 | ||
69 | /* Largest available area (free of vectors): */ | ||
70 | #define XSHAL_ROM_AVAIL_VADDR 0xEE00052C | ||
71 | #define XSHAL_ROM_AVAIL_VSIZE 0x003FFAD4 | ||
72 | |||
73 | /* System RAM: */ | ||
74 | #define XSHAL_RAM_VADDR 0xD0000000 | ||
75 | #define XSHAL_RAM_PADDR 0x00000000 | ||
76 | #define XSHAL_RAM_VSIZE 0x08000000 | ||
77 | #define XSHAL_RAM_PSIZE 0x10000000 | ||
78 | #define XSHAL_RAM_SIZE XSHAL_RAM_PSIZE | ||
79 | /* Largest available area (free of vectors): */ | ||
80 | #define XSHAL_RAM_AVAIL_VADDR 0xD0000370 | ||
81 | #define XSHAL_RAM_AVAIL_VSIZE 0x07FFFC90 | ||
82 | |||
83 | /* | ||
84 | * Shadow system RAM (same device as system RAM, at different address). | ||
85 | * (Emulation boards need this for the SONIC Ethernet driver | ||
86 | * when data caches are configured for writeback mode.) | ||
87 | * NOTE: on full MMU configs, this points to the BYPASS virtual address | ||
88 | * of system RAM, ie. is the same as XSHAL_RAM_* except that virtual | ||
89 | * addresses are viewed through the BYPASS static map rather than | ||
90 | * the CACHED static map. | ||
91 | */ | ||
92 | #define XSHAL_RAM_BYPASS_VADDR 0xD8000000 | ||
93 | #define XSHAL_RAM_BYPASS_PADDR 0x00000000 | ||
94 | #define XSHAL_RAM_BYPASS_PSIZE 0x08000000 | ||
95 | |||
96 | /* Alternate system RAM (different device than system RAM): */ | ||
97 | #define XSHAL_ALTRAM_VADDR 0xCEE00000 | ||
98 | #define XSHAL_ALTRAM_PADDR 0xC0000000 | ||
99 | #define XSHAL_ALTRAM_SIZE 0x00200000 | ||
100 | |||
101 | |||
102 | /*---------------------------------------------------------------------- | ||
103 | * DEVICE-ADDRESS DEPENDENT... | ||
104 | * | ||
105 | * Values written to CACHEATTR special register (or its equivalent) | ||
106 | * to enable and disable caches in various modes. | ||
107 | *----------------------------------------------------------------------*/ | ||
108 | |||
109 | /*---------------------------------------------------------------------- | ||
110 | BACKWARD COMPATIBILITY ... | ||
111 | ----------------------------------------------------------------------*/ | ||
112 | |||
113 | /* | ||
114 | * NOTE: the following two macros are DEPRECATED. Use the latter | ||
115 | * board-specific macros instead, which are specially tuned for the | ||
116 | * particular target environments' memory maps. | ||
117 | */ | ||
118 | #define XSHAL_CACHEATTR_BYPASS XSHAL_XT2000_CACHEATTR_BYPASS /* disable caches in bypass mode */ | ||
119 | #define XSHAL_CACHEATTR_DEFAULT XSHAL_XT2000_CACHEATTR_DEFAULT /* default setting to enable caches (no writeback!) */ | ||
120 | |||
121 | /*---------------------------------------------------------------------- | ||
122 | ISS (Instruction Set Simulator) SPECIFIC ... | ||
123 | ----------------------------------------------------------------------*/ | ||
124 | |||
125 | #define XSHAL_ISS_CACHEATTR_WRITEBACK 0x1122222F /* enable caches in write-back mode */ | ||
126 | #define XSHAL_ISS_CACHEATTR_WRITEALLOC 0x1122222F /* enable caches in write-allocate mode */ | ||
127 | #define XSHAL_ISS_CACHEATTR_WRITETHRU 0x1122222F /* enable caches in write-through mode */ | ||
128 | #define XSHAL_ISS_CACHEATTR_BYPASS 0x2222222F /* disable caches in bypass mode */ | ||
129 | #define XSHAL_ISS_CACHEATTR_DEFAULT XSHAL_ISS_CACHEATTR_WRITEBACK /* default setting to enable caches */ | ||
130 | |||
131 | /* For Coware only: */ | ||
132 | #define XSHAL_COWARE_CACHEATTR_WRITEBACK 0x11222222 /* enable caches in write-back mode */ | ||
133 | #define XSHAL_COWARE_CACHEATTR_WRITEALLOC 0x11222222 /* enable caches in write-allocate mode */ | ||
134 | #define XSHAL_COWARE_CACHEATTR_WRITETHRU 0x11222222 /* enable caches in write-through mode */ | ||
135 | #define XSHAL_COWARE_CACHEATTR_BYPASS 0x22222222 /* disable caches in bypass mode */ | ||
136 | #define XSHAL_COWARE_CACHEATTR_DEFAULT XSHAL_COWARE_CACHEATTR_WRITEBACK /* default setting to enable caches */ | ||
137 | |||
138 | /* For BFM and other purposes: */ | ||
139 | #define XSHAL_ALLVALID_CACHEATTR_WRITEBACK 0x11222222 /* enable caches without any invalid regions */ | ||
140 | #define XSHAL_ALLVALID_CACHEATTR_DEFAULT XSHAL_ALLVALID_CACHEATTR_WRITEBACK /* default setting for caches without any invalid regions */ | ||
141 | |||
142 | #define XSHAL_ISS_PIPE_REGIONS 0 | ||
143 | #define XSHAL_ISS_SDRAM_REGIONS 0 | ||
144 | |||
145 | |||
146 | /*---------------------------------------------------------------------- | ||
147 | XT2000 BOARD SPECIFIC ... | ||
148 | ----------------------------------------------------------------------*/ | ||
149 | |||
150 | #define XSHAL_XT2000_CACHEATTR_WRITEBACK 0x22FFFFFF /* enable caches in write-back mode */ | ||
151 | #define XSHAL_XT2000_CACHEATTR_WRITEALLOC 0x22FFFFFF /* enable caches in write-allocate mode */ | ||
152 | #define XSHAL_XT2000_CACHEATTR_WRITETHRU 0x22FFFFFF /* enable caches in write-through mode */ | ||
153 | #define XSHAL_XT2000_CACHEATTR_BYPASS 0x22FFFFFF /* disable caches in bypass mode */ | ||
154 | #define XSHAL_XT2000_CACHEATTR_DEFAULT XSHAL_XT2000_CACHEATTR_WRITEBACK /* default setting to enable caches */ | ||
155 | |||
156 | #define XSHAL_XT2000_PIPE_REGIONS 0x00001000 /* BusInt pipeline regions */ | ||
157 | #define XSHAL_XT2000_SDRAM_REGIONS 0x00000005 /* BusInt SDRAM regions */ | ||
158 | |||
159 | |||
160 | /*---------------------------------------------------------------------- | ||
161 | VECTOR SIZES | ||
162 | ----------------------------------------------------------------------*/ | ||
163 | |||
164 | /* | ||
165 | * Sizes allocated to vectors by the system (memory map) configuration. | ||
166 | * These sizes are constrained by core configuration (eg. one vector's | ||
167 | * code cannot overflow into another vector) but are dependent on the | ||
168 | * system or board (or LSP) memory map configuration. | ||
169 | * | ||
170 | * Whether or not each vector happens to be in a system ROM is also | ||
171 | * a system configuration matter, sometimes useful, included here also: | ||
172 | */ | ||
173 | #define XSHAL_RESET_VECTOR_SIZE 0x000004E0 | ||
174 | #define XSHAL_RESET_VECTOR_ISROM 1 | ||
175 | #define XSHAL_USER_VECTOR_SIZE 0x0000001C | ||
176 | #define XSHAL_USER_VECTOR_ISROM 0 | ||
177 | #define XSHAL_PROGRAMEXC_VECTOR_SIZE XSHAL_USER_VECTOR_SIZE /* for backward compatibility */ | ||
178 | #define XSHAL_USEREXC_VECTOR_SIZE XSHAL_USER_VECTOR_SIZE /* for backward compatibility */ | ||
179 | #define XSHAL_KERNEL_VECTOR_SIZE 0x0000001C | ||
180 | #define XSHAL_KERNEL_VECTOR_ISROM 0 | ||
181 | #define XSHAL_STACKEDEXC_VECTOR_SIZE XSHAL_KERNEL_VECTOR_SIZE /* for backward compatibility */ | ||
182 | #define XSHAL_KERNELEXC_VECTOR_SIZE XSHAL_KERNEL_VECTOR_SIZE /* for backward compatibility */ | ||
183 | #define XSHAL_DOUBLEEXC_VECTOR_SIZE 0x000000E0 | ||
184 | #define XSHAL_DOUBLEEXC_VECTOR_ISROM 0 | ||
185 | #define XSHAL_WINDOW_VECTORS_SIZE 0x00000180 | ||
186 | #define XSHAL_WINDOW_VECTORS_ISROM 0 | ||
187 | #define XSHAL_INTLEVEL2_VECTOR_SIZE 0x0000000C | ||
188 | #define XSHAL_INTLEVEL2_VECTOR_ISROM 0 | ||
189 | #define XSHAL_INTLEVEL3_VECTOR_SIZE 0x0000000C | ||
190 | #define XSHAL_INTLEVEL3_VECTOR_ISROM 0 | ||
191 | #define XSHAL_INTLEVEL4_VECTOR_SIZE 0x0000000C | ||
192 | #define XSHAL_INTLEVEL4_VECTOR_ISROM 1 | ||
193 | #define XSHAL_DEBUG_VECTOR_SIZE XSHAL_INTLEVEL4_VECTOR_SIZE | ||
194 | #define XSHAL_DEBUG_VECTOR_ISROM XSHAL_INTLEVEL4_VECTOR_ISROM | ||
195 | |||
196 | |||
197 | #endif /*XTENSA_CONFIG_SYSTEM_H*/ | ||
198 | |||
diff --git a/include/asm-xtensa/xtensa/config-linux_be/tie.h b/include/asm-xtensa/xtensa/config-linux_be/tie.h deleted file mode 100644 index 3c2e514602f4..000000000000 --- a/include/asm-xtensa/xtensa/config-linux_be/tie.h +++ /dev/null | |||
@@ -1,275 +0,0 @@ | |||
1 | /* | ||
2 | * xtensa/config/tie.h -- HAL definitions that are dependent on CORE and TIE configuration | ||
3 | * | ||
4 | * This header file is sometimes referred to as the "compile-time HAL" or CHAL. | ||
5 | * It was generated for a specific Xtensa processor configuration, | ||
6 | * and furthermore for a specific set of TIE source files that extend | ||
7 | * basic core functionality. | ||
8 | * | ||
9 | * Source for configuration-independent binaries (which link in a | ||
10 | * configuration-specific HAL library) must NEVER include this file. | ||
11 | * It is perfectly normal, however, for the HAL source itself to include this file. | ||
12 | */ | ||
13 | |||
14 | /* | ||
15 | * Copyright (c) 2003 Tensilica, Inc. All Rights Reserved. | ||
16 | * | ||
17 | * This program is free software; you can redistribute it and/or modify | ||
18 | * it under the terms of version 2.1 of the GNU Lesser General Public | ||
19 | * License as published by the Free Software Foundation. | ||
20 | * | ||
21 | * This program is distributed in the hope that it would be useful, but | ||
22 | * WITHOUT ANY WARRANTY; without even the implied warranty of | ||
23 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | ||
24 | * | ||
25 | * Further, this software is distributed without any warranty that it is | ||
26 | * free of the rightful claim of any third person regarding infringement | ||
27 | * or the like. Any license provided herein, whether implied or | ||
28 | * otherwise, applies only to this software file. Patent licenses, if | ||
29 | * any, provided herein do not apply to combinations of this program with | ||
30 | * other software, or any other product whatsoever. | ||
31 | * | ||
32 | * You should have received a copy of the GNU Lesser General Public | ||
33 | * License along with this program; if not, write the Free Software | ||
34 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston MA 02111-1307, | ||
35 | * USA. | ||
36 | */ | ||
37 | |||
38 | |||
39 | #ifndef XTENSA_CONFIG_TIE_H | ||
40 | #define XTENSA_CONFIG_TIE_H | ||
41 | |||
42 | #include <xtensa/hal.h> | ||
43 | |||
44 | |||
45 | /*---------------------------------------------------------------------- | ||
46 | GENERAL | ||
47 | ----------------------------------------------------------------------*/ | ||
48 | |||
49 | /* | ||
50 | * Separators for macros that expand into arrays. | ||
51 | * These can be predefined by files that #include this one, | ||
52 | * when different separators are required. | ||
53 | */ | ||
54 | /* Element separator for macros that expand into 1-dimensional arrays: */ | ||
55 | #ifndef XCHAL_SEP | ||
56 | #define XCHAL_SEP , | ||
57 | #endif | ||
58 | /* Array separator for macros that expand into 2-dimensional arrays: */ | ||
59 | #ifndef XCHAL_SEP2 | ||
60 | #define XCHAL_SEP2 },{ | ||
61 | #endif | ||
62 | |||
63 | |||
64 | |||
65 | |||
66 | |||
67 | |||
68 | /*---------------------------------------------------------------------- | ||
69 | COPROCESSORS and EXTRA STATE | ||
70 | ----------------------------------------------------------------------*/ | ||
71 | |||
72 | #define XCHAL_CP_NUM 0 /* number of coprocessors */ | ||
73 | #define XCHAL_CP_MAX 0 /* max coprocessor id plus one (0 if none) */ | ||
74 | #define XCHAL_CP_MASK 0x00 /* bitmask of coprocessors by id */ | ||
75 | |||
76 | /* Space for coprocessors' state save areas: */ | ||
77 | #define XCHAL_CP0_SA_SIZE 0 | ||
78 | #define XCHAL_CP1_SA_SIZE 0 | ||
79 | #define XCHAL_CP2_SA_SIZE 0 | ||
80 | #define XCHAL_CP3_SA_SIZE 0 | ||
81 | #define XCHAL_CP4_SA_SIZE 0 | ||
82 | #define XCHAL_CP5_SA_SIZE 0 | ||
83 | #define XCHAL_CP6_SA_SIZE 0 | ||
84 | #define XCHAL_CP7_SA_SIZE 0 | ||
85 | /* Minimum required alignments of CP state save areas: */ | ||
86 | #define XCHAL_CP0_SA_ALIGN 1 | ||
87 | #define XCHAL_CP1_SA_ALIGN 1 | ||
88 | #define XCHAL_CP2_SA_ALIGN 1 | ||
89 | #define XCHAL_CP3_SA_ALIGN 1 | ||
90 | #define XCHAL_CP4_SA_ALIGN 1 | ||
91 | #define XCHAL_CP5_SA_ALIGN 1 | ||
92 | #define XCHAL_CP6_SA_ALIGN 1 | ||
93 | #define XCHAL_CP7_SA_ALIGN 1 | ||
94 | |||
95 | /* Indexing macros: */ | ||
96 | #define _XCHAL_CP_SA_SIZE(n) XCHAL_CP ## n ## _SA_SIZE | ||
97 | #define XCHAL_CP_SA_SIZE(n) _XCHAL_CP_SA_SIZE(n) /* n = 0 .. 7 */ | ||
98 | #define _XCHAL_CP_SA_ALIGN(n) XCHAL_CP ## n ## _SA_ALIGN | ||
99 | #define XCHAL_CP_SA_ALIGN(n) _XCHAL_CP_SA_ALIGN(n) /* n = 0 .. 7 */ | ||
100 | |||
101 | |||
102 | /* Space for "extra" state (user special registers and non-cp TIE) save area: */ | ||
103 | #define XCHAL_EXTRA_SA_SIZE 0 | ||
104 | #define XCHAL_EXTRA_SA_ALIGN 1 | ||
105 | |||
106 | /* Total save area size (extra + all coprocessors) */ | ||
107 | /* (not useful until xthal_{save,restore}_all_extra() is implemented, */ | ||
108 | /* but included for Tor2 beta; doesn't account for alignment!): */ | ||
109 | #define XCHAL_CPEXTRA_SA_SIZE_TOR2 0 /* Tor2Beta temporary definition -- do not use */ | ||
110 | |||
111 | /* Combined required alignment for all CP and EXTRA state save areas */ | ||
112 | /* (does not include required alignment for any base config registers): */ | ||
113 | #define XCHAL_CPEXTRA_SA_ALIGN 1 | ||
114 | |||
115 | /* ... */ | ||
116 | |||
117 | |||
118 | #ifdef _ASMLANGUAGE | ||
119 | /* | ||
120 | * Assembly-language specific definitions (assembly macros, etc.). | ||
121 | */ | ||
122 | #include <xtensa/config/specreg.h> | ||
123 | |||
124 | /******************** | ||
125 | * Macros to save and restore the non-coprocessor TIE portion of EXTRA state. | ||
126 | */ | ||
127 | |||
128 | /* (none) */ | ||
129 | |||
130 | |||
131 | /******************** | ||
132 | * Macros to create functions that save and restore all EXTRA (non-coprocessor) state | ||
133 | * (does not include zero-overhead loop registers and non-optional registers). | ||
134 | */ | ||
135 | |||
136 | /* | ||
137 | * Macro that expands to the body of a function that | ||
138 | * stores the extra (non-coprocessor) optional/custom state. | ||
139 | * Entry: a2 = ptr to save area in which to save extra state | ||
140 | * Exit: any register a2-a15 (?) may have been clobbered. | ||
141 | */ | ||
142 | .macro xchal_extra_store_funcbody | ||
143 | .endm | ||
144 | |||
145 | |||
146 | /* | ||
147 | * Macro that expands to the body of a function that | ||
148 | * loads the extra (non-coprocessor) optional/custom state. | ||
149 | * Entry: a2 = ptr to save area from which to restore extra state | ||
150 | * Exit: any register a2-a15 (?) may have been clobbered. | ||
151 | */ | ||
152 | .macro xchal_extra_load_funcbody | ||
153 | .endm | ||
154 | |||
155 | |||
156 | /******************** | ||
157 | * Macros to save and restore the state of each TIE coprocessor. | ||
158 | */ | ||
159 | |||
160 | |||
161 | |||
162 | /******************** | ||
163 | * Macros to create functions that save and restore the state of *any* TIE coprocessor. | ||
164 | */ | ||
165 | |||
166 | /* | ||
167 | * Macro that expands to the body of a function | ||
168 | * that stores the selected coprocessor's state (registers etc). | ||
169 | * Entry: a2 = ptr to save area in which to save cp state | ||
170 | * a3 = coprocessor number | ||
171 | * Exit: any register a2-a15 (?) may have been clobbered. | ||
172 | */ | ||
173 | .macro xchal_cpi_store_funcbody | ||
174 | .endm | ||
175 | |||
176 | |||
177 | /* | ||
178 | * Macro that expands to the body of a function | ||
179 | * that loads the selected coprocessor's state (registers etc). | ||
180 | * Entry: a2 = ptr to save area from which to restore cp state | ||
181 | * a3 = coprocessor number | ||
182 | * Exit: any register a2-a15 (?) may have been clobbered. | ||
183 | */ | ||
184 | .macro xchal_cpi_load_funcbody | ||
185 | .endm | ||
186 | |||
187 | #endif /*_ASMLANGUAGE*/ | ||
188 | |||
189 | |||
190 | /* | ||
191 | * Contents of save areas in terms of libdb register numbers. | ||
192 | * NOTE: CONTENTS_LIBDB_{UREG,REGF} macros are not defined in this file; | ||
193 | * it is up to the user of this header file to define these macros | ||
194 | * usefully before each expansion of the CONTENTS_LIBDB macros. | ||
195 | * (Fields rsv[123] are reserved for future additions; they are currently | ||
196 | * set to zero but may be set to some useful values in the future.) | ||
197 | * | ||
198 | * CONTENTS_LIBDB_SREG(libdbnum, offset, size, align, rsv1, name, sregnum, bitmask, rsv2, rsv3) | ||
199 | * CONTENTS_LIBDB_UREG(libdbnum, offset, size, align, rsv1, name, uregnum, bitmask, rsv2, rsv3) | ||
200 | * CONTENTS_LIBDB_REGF(libdbnum, offset, size, align, rsv1, name, index, numentries, contentsize, regname_base, regfile_name, rsv2, rsv3) | ||
201 | */ | ||
202 | |||
203 | #define XCHAL_EXTRA_SA_CONTENTS_LIBDB_NUM 0 | ||
204 | #define XCHAL_EXTRA_SA_CONTENTS_LIBDB /* empty */ | ||
205 | |||
206 | #define XCHAL_CP0_SA_CONTENTS_LIBDB_NUM 0 | ||
207 | #define XCHAL_CP0_SA_CONTENTS_LIBDB /* empty */ | ||
208 | |||
209 | #define XCHAL_CP1_SA_CONTENTS_LIBDB_NUM 0 | ||
210 | #define XCHAL_CP1_SA_CONTENTS_LIBDB /* empty */ | ||
211 | |||
212 | #define XCHAL_CP2_SA_CONTENTS_LIBDB_NUM 0 | ||
213 | #define XCHAL_CP2_SA_CONTENTS_LIBDB /* empty */ | ||
214 | |||
215 | #define XCHAL_CP3_SA_CONTENTS_LIBDB_NUM 0 | ||
216 | #define XCHAL_CP3_SA_CONTENTS_LIBDB /* empty */ | ||
217 | |||
218 | #define XCHAL_CP4_SA_CONTENTS_LIBDB_NUM 0 | ||
219 | #define XCHAL_CP4_SA_CONTENTS_LIBDB /* empty */ | ||
220 | |||
221 | #define XCHAL_CP5_SA_CONTENTS_LIBDB_NUM 0 | ||
222 | #define XCHAL_CP5_SA_CONTENTS_LIBDB /* empty */ | ||
223 | |||
224 | #define XCHAL_CP6_SA_CONTENTS_LIBDB_NUM 0 | ||
225 | #define XCHAL_CP6_SA_CONTENTS_LIBDB /* empty */ | ||
226 | |||
227 | #define XCHAL_CP7_SA_CONTENTS_LIBDB_NUM 0 | ||
228 | #define XCHAL_CP7_SA_CONTENTS_LIBDB /* empty */ | ||
229 | |||
230 | |||
231 | |||
232 | |||
233 | |||
234 | |||
235 | /*---------------------------------------------------------------------- | ||
236 | MISC | ||
237 | ----------------------------------------------------------------------*/ | ||
238 | |||
239 | #if 0 /* is there something equivalent for user TIE? */ | ||
240 | #define XCHAL_CORE_ID "linux_be" /* configuration's alphanumeric core identifier | ||
241 | (CoreID) set in the Xtensa Processor Generator */ | ||
242 | |||
243 | #define XCHAL_BUILD_UNIQUE_ID 0x00003256 /* software build-unique ID (22-bit) */ | ||
244 | |||
245 | /* These definitions describe the hardware targeted by this software: */ | ||
246 | #define XCHAL_HW_CONFIGID0 0xC103D1FF /* config ID reg 0 value (upper 32 of 64 bits) */ | ||
247 | #define XCHAL_HW_CONFIGID1 0x00803256 /* config ID reg 1 value (lower 32 of 64 bits) */ | ||
248 | #define XCHAL_CONFIGID0 XCHAL_HW_CONFIGID0 /* for backward compatibility only -- don't use! */ | ||
249 | #define XCHAL_CONFIGID1 XCHAL_HW_CONFIGID1 /* for backward compatibility only -- don't use! */ | ||
250 | #define XCHAL_HW_RELEASE_MAJOR 1050 /* major release of targeted hardware */ | ||
251 | #define XCHAL_HW_RELEASE_MINOR 1 /* minor release of targeted hardware */ | ||
252 | #define XCHAL_HW_RELEASE_NAME "T1050.1" /* full release name of targeted hardware */ | ||
253 | #define XTHAL_HW_REL_T1050 1 | ||
254 | #define XTHAL_HW_REL_T1050_1 1 | ||
255 | #define XCHAL_HW_CONFIGID_RELIABLE 1 | ||
256 | #endif /*0*/ | ||
257 | |||
258 | |||
259 | |||
260 | /*---------------------------------------------------------------------- | ||
261 | ISA | ||
262 | ----------------------------------------------------------------------*/ | ||
263 | |||
264 | #if 0 /* these probably don't belong here, but are related to or implemented using TIE */ | ||
265 | #define XCHAL_HAVE_BOOLEANS 0 /* 1 if booleans option configured, 0 otherwise */ | ||
266 | /* Misc instructions: */ | ||
267 | #define XCHAL_HAVE_MUL32 0 /* 1 if 32-bit integer multiply option configured, 0 otherwise */ | ||
268 | #define XCHAL_HAVE_MUL32_HIGH 0 /* 1 if MUL32 option includes MULUH and MULSH, 0 otherwise */ | ||
269 | |||
270 | #define XCHAL_HAVE_FP 0 /* 1 if floating point option configured, 0 otherwise */ | ||
271 | #endif /*0*/ | ||
272 | |||
273 | |||
274 | #endif /*XTENSA_CONFIG_TIE_H*/ | ||
275 | |||
diff --git a/include/asm-xtensa/xtensa/coreasm.h b/include/asm-xtensa/xtensa/coreasm.h deleted file mode 100644 index a8cfb54c20a1..000000000000 --- a/include/asm-xtensa/xtensa/coreasm.h +++ /dev/null | |||
@@ -1,526 +0,0 @@ | |||
1 | #ifndef XTENSA_COREASM_H | ||
2 | #define XTENSA_COREASM_H | ||
3 | |||
4 | /* | ||
5 | * THIS FILE IS GENERATED -- DO NOT MODIFY BY HAND | ||
6 | * | ||
7 | * include/asm-xtensa/xtensa/coreasm.h -- assembler-specific | ||
8 | * definitions that depend on CORE configuration. | ||
9 | * | ||
10 | * Source for configuration-independent binaries (which link in a | ||
11 | * configuration-specific HAL library) must NEVER include this file. | ||
12 | * It is perfectly normal, however, for the HAL itself to include this | ||
13 | * file. | ||
14 | * | ||
15 | * This file must NOT include xtensa/config/system.h. Any assembler | ||
16 | * header file that depends on system information should likely go in | ||
17 | * a new systemasm.h (or sysasm.h) header file. | ||
18 | * | ||
19 | * NOTE: macro beqi32 is NOT configuration-dependent, and is placed | ||
20 | * here til we will have configuration-independent header file. | ||
21 | * | ||
22 | * This file is subject to the terms and conditions of the GNU General | ||
23 | * Public License. See the file "COPYING" in the main directory of | ||
24 | * this archive for more details. | ||
25 | * | ||
26 | * Copyright (C) 2002 Tensilica Inc. | ||
27 | */ | ||
28 | |||
29 | |||
30 | #include <xtensa/config/core.h> | ||
31 | #include <xtensa/config/specreg.h> | ||
32 | |||
33 | /* | ||
34 | * Assembly-language specific definitions (assembly macros, etc.). | ||
35 | */ | ||
36 | |||
37 | /*---------------------------------------------------------------------- | ||
38 | * find_ms_setbit | ||
39 | * | ||
40 | * This macro finds the most significant bit that is set in <as> | ||
41 | * and return its index + <base> in <ad>, or <base> - 1 if <as> is zero. | ||
42 | * The index counts starting at zero for the lsbit, so the return | ||
43 | * value ranges from <base>-1 (no bit set) to <base>+31 (msbit set). | ||
44 | * | ||
45 | * Parameters: | ||
46 | * <ad> destination address register (any register) | ||
47 | * <as> source address register | ||
48 | * <at> temporary address register (must be different than <as>) | ||
49 | * <base> constant value added to result (usually 0 or 1) | ||
50 | * On entry: | ||
51 | * <ad> = undefined if different than <as> | ||
52 | * <as> = value whose most significant set bit is to be found | ||
53 | * <at> = undefined | ||
54 | * no other registers are used by this macro. | ||
55 | * On exit: | ||
56 | * <ad> = <base> + index of msbit set in original <as>, | ||
57 | * = <base> - 1 if original <as> was zero. | ||
58 | * <as> clobbered (if not <ad>) | ||
59 | * <at> clobbered (if not <ad>) | ||
60 | * Example: | ||
61 | * find_ms_setbit a0, a4, a0, 0 -- return in a0 index of msbit set in a4 | ||
62 | */ | ||
63 | |||
64 | .macro find_ms_setbit ad, as, at, base | ||
65 | #if XCHAL_HAVE_NSA | ||
66 | movi \at, 31+\base | ||
67 | nsau \as, \as // get index of \as, numbered from msbit (32 if absent) | ||
68 | sub \ad, \at, \as // get numbering from lsbit (0..31, -1 if absent) | ||
69 | #else /* XCHAL_HAVE_NSA */ | ||
70 | movi \at, \base // start with result of 0 (point to lsbit of 32) | ||
71 | |||
72 | beqz \as, 2f // special case for zero argument: return -1 | ||
73 | bltui \as, 0x10000, 1f // is it one of the 16 lsbits? (if so, check lower 16 bits) | ||
74 | addi \at, \at, 16 // no, increment result to upper 16 bits (of 32) | ||
75 | //srli \as, \as, 16 // check upper half (shift right 16 bits) | ||
76 | extui \as, \as, 16, 16 // check upper half (shift right 16 bits) | ||
77 | 1: bltui \as, 0x100, 1f // is it one of the 8 lsbits? (if so, check lower 8 bits) | ||
78 | addi \at, \at, 8 // no, increment result to upper 8 bits (of 16) | ||
79 | srli \as, \as, 8 // shift right to check upper 8 bits | ||
80 | 1: bltui \as, 0x10, 1f // is it one of the 4 lsbits? (if so, check lower 4 bits) | ||
81 | addi \at, \at, 4 // no, increment result to upper 4 bits (of 8) | ||
82 | srli \as, \as, 4 // shift right 4 bits to check upper half | ||
83 | 1: bltui \as, 0x4, 1f // is it one of the 2 lsbits? (if so, check lower 2 bits) | ||
84 | addi \at, \at, 2 // no, increment result to upper 2 bits (of 4) | ||
85 | srli \as, \as, 2 // shift right 2 bits to check upper half | ||
86 | 1: bltui \as, 0x2, 1f // is it the lsbit? | ||
87 | addi \at, \at, 2 // no, increment result to upper bit (of 2) | ||
88 | 2: addi \at, \at, -1 // (from just above: add 1; from beqz: return -1) | ||
89 | //srli \as, \as, 1 | ||
90 | 1: // done! \at contains index of msbit set (or -1 if none set) | ||
91 | .if 0x\ad - 0x\at // destination different than \at ? (works because regs are a0-a15) | ||
92 | mov \ad, \at // then move result to \ad | ||
93 | .endif | ||
94 | #endif /* XCHAL_HAVE_NSA */ | ||
95 | .endm // find_ms_setbit | ||
96 | |||
97 | /*---------------------------------------------------------------------- | ||
98 | * find_ls_setbit | ||
99 | * | ||
100 | * This macro finds the least significant bit that is set in <as>, | ||
101 | * and return its index in <ad>. | ||
102 | * Usage is the same as for the find_ms_setbit macro. | ||
103 | * Example: | ||
104 | * find_ls_setbit a0, a4, a0, 0 -- return in a0 index of lsbit set in a4 | ||
105 | */ | ||
106 | |||
107 | .macro find_ls_setbit ad, as, at, base | ||
108 | neg \at, \as // keep only the least-significant bit that is set... | ||
109 | and \as, \at, \as // ... in \as | ||
110 | find_ms_setbit \ad, \as, \at, \base | ||
111 | .endm // find_ls_setbit | ||
112 | |||
113 | /*---------------------------------------------------------------------- | ||
114 | * find_ls_one | ||
115 | * | ||
116 | * Same as find_ls_setbit with base zero. | ||
117 | * Source (as) and destination (ad) registers must be different. | ||
118 | * Provided for backward compatibility. | ||
119 | */ | ||
120 | |||
121 | .macro find_ls_one ad, as | ||
122 | find_ls_setbit \ad, \as, \ad, 0 | ||
123 | .endm // find_ls_one | ||
124 | |||
125 | /*---------------------------------------------------------------------- | ||
126 | * floop, floopnez, floopgtz, floopend | ||
127 | * | ||
128 | * These macros are used for fast inner loops that | ||
129 | * work whether or not the Loops options is configured. | ||
130 | * If the Loops option is configured, they simply use | ||
131 | * the zero-overhead LOOP instructions; otherwise | ||
132 | * they use explicit decrement and branch instructions. | ||
133 | * | ||
134 | * They are used in pairs, with floop, floopnez or floopgtz | ||
135 | * at the beginning of the loop, and floopend at the end. | ||
136 | * | ||
137 | * Each pair of loop macro calls must be given the loop count | ||
138 | * address register and a unique label for that loop. | ||
139 | * | ||
140 | * Example: | ||
141 | * | ||
142 | * movi a3, 16 // loop 16 times | ||
143 | * floop a3, myloop1 | ||
144 | * : | ||
145 | * bnez a7, end1 // exit loop if a7 != 0 | ||
146 | * : | ||
147 | * floopend a3, myloop1 | ||
148 | * end1: | ||
149 | * | ||
150 | * Like the LOOP instructions, these macros cannot be | ||
151 | * nested, must include at least one instruction, | ||
152 | * cannot call functions inside the loop, etc. | ||
153 | * The loop can be exited by jumping to the instruction | ||
154 | * following floopend (or elsewhere outside the loop), | ||
155 | * or continued by jumping to a NOP instruction placed | ||
156 | * immediately before floopend. | ||
157 | * | ||
158 | * Unlike LOOP instructions, the register passed to floop* | ||
159 | * cannot be used inside the loop, because it is used as | ||
160 | * the loop counter if the Loops option is not configured. | ||
161 | * And its value is undefined after exiting the loop. | ||
162 | * And because the loop counter register is active inside | ||
163 | * the loop, you can't easily use this construct to loop | ||
164 | * across a register file using ROTW as you might with LOOP | ||
165 | * instructions, unless you copy the loop register along. | ||
166 | */ | ||
167 | |||
168 | /* Named label version of the macros: */ | ||
169 | |||
170 | .macro floop ar, endlabel | ||
171 | floop_ \ar, .Lfloopstart_\endlabel, .Lfloopend_\endlabel | ||
172 | .endm | ||
173 | |||
174 | .macro floopnez ar, endlabel | ||
175 | floopnez_ \ar, .Lfloopstart_\endlabel, .Lfloopend_\endlabel | ||
176 | .endm | ||
177 | |||
178 | .macro floopgtz ar, endlabel | ||
179 | floopgtz_ \ar, .Lfloopstart_\endlabel, .Lfloopend_\endlabel | ||
180 | .endm | ||
181 | |||
182 | .macro floopend ar, endlabel | ||
183 | floopend_ \ar, .Lfloopstart_\endlabel, .Lfloopend_\endlabel | ||
184 | .endm | ||
185 | |||
186 | /* Numbered local label version of the macros: */ | ||
187 | #if 0 /*UNTESTED*/ | ||
188 | .macro floop89 ar | ||
189 | floop_ \ar, 8, 9f | ||
190 | .endm | ||
191 | |||
192 | .macro floopnez89 ar | ||
193 | floopnez_ \ar, 8, 9f | ||
194 | .endm | ||
195 | |||
196 | .macro floopgtz89 ar | ||
197 | floopgtz_ \ar, 8, 9f | ||
198 | .endm | ||
199 | |||
200 | .macro floopend89 ar | ||
201 | floopend_ \ar, 8b, 9 | ||
202 | .endm | ||
203 | #endif /*0*/ | ||
204 | |||
205 | /* Underlying version of the macros: */ | ||
206 | |||
207 | .macro floop_ ar, startlabel, endlabelref | ||
208 | .ifdef _infloop_ | ||
209 | .if _infloop_ | ||
210 | .err // Error: floop cannot be nested | ||
211 | .endif | ||
212 | .endif | ||
213 | .set _infloop_, 1 | ||
214 | #if XCHAL_HAVE_LOOPS | ||
215 | loop \ar, \endlabelref | ||
216 | #else /* XCHAL_HAVE_LOOPS */ | ||
217 | \startlabel: | ||
218 | addi \ar, \ar, -1 | ||
219 | #endif /* XCHAL_HAVE_LOOPS */ | ||
220 | .endm // floop_ | ||
221 | |||
222 | .macro floopnez_ ar, startlabel, endlabelref | ||
223 | .ifdef _infloop_ | ||
224 | .if _infloop_ | ||
225 | .err // Error: floopnez cannot be nested | ||
226 | .endif | ||
227 | .endif | ||
228 | .set _infloop_, 1 | ||
229 | #if XCHAL_HAVE_LOOPS | ||
230 | loopnez \ar, \endlabelref | ||
231 | #else /* XCHAL_HAVE_LOOPS */ | ||
232 | beqz \ar, \endlabelref | ||
233 | \startlabel: | ||
234 | addi \ar, \ar, -1 | ||
235 | #endif /* XCHAL_HAVE_LOOPS */ | ||
236 | .endm // floopnez_ | ||
237 | |||
238 | .macro floopgtz_ ar, startlabel, endlabelref | ||
239 | .ifdef _infloop_ | ||
240 | .if _infloop_ | ||
241 | .err // Error: floopgtz cannot be nested | ||
242 | .endif | ||
243 | .endif | ||
244 | .set _infloop_, 1 | ||
245 | #if XCHAL_HAVE_LOOPS | ||
246 | loopgtz \ar, \endlabelref | ||
247 | #else /* XCHAL_HAVE_LOOPS */ | ||
248 | bltz \ar, \endlabelref | ||
249 | beqz \ar, \endlabelref | ||
250 | \startlabel: | ||
251 | addi \ar, \ar, -1 | ||
252 | #endif /* XCHAL_HAVE_LOOPS */ | ||
253 | .endm // floopgtz_ | ||
254 | |||
255 | |||
256 | .macro floopend_ ar, startlabelref, endlabel | ||
257 | .ifndef _infloop_ | ||
258 | .err // Error: floopend without matching floopXXX | ||
259 | .endif | ||
260 | .ifeq _infloop_ | ||
261 | .err // Error: floopend without matching floopXXX | ||
262 | .endif | ||
263 | .set _infloop_, 0 | ||
264 | #if ! XCHAL_HAVE_LOOPS | ||
265 | bnez \ar, \startlabelref | ||
266 | #endif /* XCHAL_HAVE_LOOPS */ | ||
267 | \endlabel: | ||
268 | .endm // floopend_ | ||
269 | |||
270 | /*---------------------------------------------------------------------- | ||
271 | * crsil -- conditional RSIL (read/set interrupt level) | ||
272 | * | ||
273 | * Executes the RSIL instruction if it exists, else just reads PS. | ||
274 | * The RSIL instruction does not exist in the new exception architecture | ||
275 | * if the interrupt option is not selected. | ||
276 | */ | ||
277 | |||
278 | .macro crsil ar, newlevel | ||
279 | #if XCHAL_HAVE_OLD_EXC_ARCH || XCHAL_HAVE_INTERRUPTS | ||
280 | rsil \ar, \newlevel | ||
281 | #else | ||
282 | rsr \ar, PS | ||
283 | #endif | ||
284 | .endm // crsil | ||
285 | |||
286 | /*---------------------------------------------------------------------- | ||
287 | * window_spill{4,8,12} | ||
288 | * | ||
289 | * These macros spill callers' register windows to the stack. | ||
290 | * They work for both privileged and non-privileged tasks. | ||
291 | * Must be called from a windowed ABI context, eg. within | ||
292 | * a windowed ABI function (ie. valid stack frame, window | ||
293 | * exceptions enabled, not in exception mode, etc). | ||
294 | * | ||
295 | * This macro requires a single invocation of the window_spill_common | ||
296 | * macro in the same assembly unit and section. | ||
297 | * | ||
298 | * Note that using window_spill{4,8,12} macros is more efficient | ||
299 | * than calling a function implemented using window_spill_function, | ||
300 | * because the latter needs extra code to figure out the size of | ||
301 | * the call to the spilling function. | ||
302 | * | ||
303 | * Example usage: | ||
304 | * | ||
305 | * .text | ||
306 | * .align 4 | ||
307 | * .global some_function | ||
308 | * .type some_function,@function | ||
309 | * some_function: | ||
310 | * entry a1, 16 | ||
311 | * : | ||
312 | * : | ||
313 | * | ||
314 | * window_spill4 // spill windows of some_function's callers; preserves a0..a3 only; | ||
315 | * // to use window_spill{8,12} in this example function we'd have | ||
316 | * // to increase space allocated by the entry instruction, because | ||
317 | * // 16 bytes only allows call4; 32 or 48 bytes (+locals) are needed | ||
318 | * // for call8/window_spill8 or call12/window_spill12 respectively. | ||
319 | * : | ||
320 | * | ||
321 | * retw | ||
322 | * | ||
323 | * window_spill_common // instantiates code used by window_spill4 | ||
324 | * | ||
325 | * | ||
326 | * On entry: | ||
327 | * none (if window_spill4) | ||
328 | * stack frame has enough space allocated for call8 (if window_spill8) | ||
329 | * stack frame has enough space allocated for call12 (if window_spill12) | ||
330 | * On exit: | ||
331 | * a4..a15 clobbered (if window_spill4) | ||
332 | * a8..a15 clobbered (if window_spill8) | ||
333 | * a12..a15 clobbered (if window_spill12) | ||
334 | * no caller windows are in live registers | ||
335 | */ | ||
336 | |||
337 | .macro window_spill4 | ||
338 | #if XCHAL_HAVE_WINDOWED | ||
339 | # if XCHAL_NUM_AREGS == 16 | ||
340 | movi a15, 0 // for 16-register files, no need to call to reach the end | ||
341 | # elif XCHAL_NUM_AREGS == 32 | ||
342 | call4 .L__wdwspill_assist28 // call deep enough to clear out any live callers | ||
343 | # elif XCHAL_NUM_AREGS == 64 | ||
344 | call4 .L__wdwspill_assist60 // call deep enough to clear out any live callers | ||
345 | # endif | ||
346 | #endif | ||
347 | .endm // window_spill4 | ||
348 | |||
349 | .macro window_spill8 | ||
350 | #if XCHAL_HAVE_WINDOWED | ||
351 | # if XCHAL_NUM_AREGS == 16 | ||
352 | movi a15, 0 // for 16-register files, no need to call to reach the end | ||
353 | # elif XCHAL_NUM_AREGS == 32 | ||
354 | call8 .L__wdwspill_assist24 // call deep enough to clear out any live callers | ||
355 | # elif XCHAL_NUM_AREGS == 64 | ||
356 | call8 .L__wdwspill_assist56 // call deep enough to clear out any live callers | ||
357 | # endif | ||
358 | #endif | ||
359 | .endm // window_spill8 | ||
360 | |||
361 | .macro window_spill12 | ||
362 | #if XCHAL_HAVE_WINDOWED | ||
363 | # if XCHAL_NUM_AREGS == 16 | ||
364 | movi a15, 0 // for 16-register files, no need to call to reach the end | ||
365 | # elif XCHAL_NUM_AREGS == 32 | ||
366 | call12 .L__wdwspill_assist20 // call deep enough to clear out any live callers | ||
367 | # elif XCHAL_NUM_AREGS == 64 | ||
368 | call12 .L__wdwspill_assist52 // call deep enough to clear out any live callers | ||
369 | # endif | ||
370 | #endif | ||
371 | .endm // window_spill12 | ||
372 | |||
373 | /*---------------------------------------------------------------------- | ||
374 | * window_spill_function | ||
375 | * | ||
376 | * This macro outputs a function that will spill its caller's callers' | ||
377 | * register windows to the stack. Eg. it could be used to implement | ||
378 | * a version of xthal_window_spill() that works in non-privileged tasks. | ||
379 | * This works for both privileged and non-privileged tasks. | ||
380 | * | ||
381 | * Typical usage: | ||
382 | * | ||
383 | * .text | ||
384 | * .align 4 | ||
385 | * .global my_spill_function | ||
386 | * .type my_spill_function,@function | ||
387 | * my_spill_function: | ||
388 | * window_spill_function | ||
389 | * | ||
390 | * On entry to resulting function: | ||
391 | * none | ||
392 | * On exit from resulting function: | ||
393 | * none (no caller windows are in live registers) | ||
394 | */ | ||
395 | |||
396 | .macro window_spill_function | ||
397 | #if XCHAL_HAVE_WINDOWED | ||
398 | # if XCHAL_NUM_AREGS == 32 | ||
399 | entry sp, 48 | ||
400 | bbci.l a0, 31, 1f // branch if called with call4 | ||
401 | bbsi.l a0, 30, 2f // branch if called with call12 | ||
402 | call8 .L__wdwspill_assist16 // called with call8, only need another 8 | ||
403 | retw | ||
404 | 1: call12 .L__wdwspill_assist16 // called with call4, only need another 12 | ||
405 | retw | ||
406 | 2: call4 .L__wdwspill_assist16 // called with call12, only need another 4 | ||
407 | retw | ||
408 | # elif XCHAL_NUM_AREGS == 64 | ||
409 | entry sp, 48 | ||
410 | bbci.l a0, 31, 1f // branch if called with call4 | ||
411 | bbsi.l a0, 30, 2f // branch if called with call12 | ||
412 | call4 .L__wdwspill_assist52 // called with call8, only need a call4 | ||
413 | retw | ||
414 | 1: call8 .L__wdwspill_assist52 // called with call4, only need a call8 | ||
415 | retw | ||
416 | 2: call12 .L__wdwspill_assist40 // called with call12, can skip a call12 | ||
417 | retw | ||
418 | # elif XCHAL_NUM_AREGS == 16 | ||
419 | entry sp, 16 | ||
420 | bbci.l a0, 31, 1f // branch if called with call4 | ||
421 | bbsi.l a0, 30, 2f // branch if called with call12 | ||
422 | movi a7, 0 // called with call8 | ||
423 | retw | ||
424 | 1: movi a11, 0 // called with call4 | ||
425 | 2: retw // if called with call12, everything already spilled | ||
426 | |||
427 | // movi a15, 0 // trick to spill all but the direct caller | ||
428 | // j 1f | ||
429 | // // The entry instruction is magical in the assembler (gets auto-aligned) | ||
430 | // // so we have to jump to it to avoid falling through the padding. | ||
431 | // // We need entry/retw to know where to return. | ||
432 | //1: entry sp, 16 | ||
433 | // retw | ||
434 | # else | ||
435 | # error "unrecognized address register file size" | ||
436 | # endif | ||
437 | #endif /* XCHAL_HAVE_WINDOWED */ | ||
438 | window_spill_common | ||
439 | .endm // window_spill_function | ||
440 | |||
441 | /*---------------------------------------------------------------------- | ||
442 | * window_spill_common | ||
443 | * | ||
444 | * Common code used by any number of invocations of the window_spill## | ||
445 | * and window_spill_function macros. | ||
446 | * | ||
447 | * Must be instantiated exactly once within a given assembly unit, | ||
448 | * within call/j range of and same section as window_spill## | ||
449 | * macro invocations for that assembly unit. | ||
450 | * (Is automatically instantiated by the window_spill_function macro.) | ||
451 | */ | ||
452 | |||
453 | .macro window_spill_common | ||
454 | #if XCHAL_HAVE_WINDOWED && (XCHAL_NUM_AREGS == 32 || XCHAL_NUM_AREGS == 64) | ||
455 | .ifndef .L__wdwspill_defined | ||
456 | # if XCHAL_NUM_AREGS >= 64 | ||
457 | .L__wdwspill_assist60: | ||
458 | entry sp, 32 | ||
459 | call8 .L__wdwspill_assist52 | ||
460 | retw | ||
461 | .L__wdwspill_assist56: | ||
462 | entry sp, 16 | ||
463 | call4 .L__wdwspill_assist52 | ||
464 | retw | ||
465 | .L__wdwspill_assist52: | ||
466 | entry sp, 48 | ||
467 | call12 .L__wdwspill_assist40 | ||
468 | retw | ||
469 | .L__wdwspill_assist40: | ||
470 | entry sp, 48 | ||
471 | call12 .L__wdwspill_assist28 | ||
472 | retw | ||
473 | # endif | ||
474 | .L__wdwspill_assist28: | ||
475 | entry sp, 48 | ||
476 | call12 .L__wdwspill_assist16 | ||
477 | retw | ||
478 | .L__wdwspill_assist24: | ||
479 | entry sp, 32 | ||
480 | call8 .L__wdwspill_assist16 | ||
481 | retw | ||
482 | .L__wdwspill_assist20: | ||
483 | entry sp, 16 | ||
484 | call4 .L__wdwspill_assist16 | ||
485 | retw | ||
486 | .L__wdwspill_assist16: | ||
487 | entry sp, 16 | ||
488 | movi a15, 0 | ||
489 | retw | ||
490 | .set .L__wdwspill_defined, 1 | ||
491 | .endif | ||
492 | #endif /* XCHAL_HAVE_WINDOWED with 32 or 64 aregs */ | ||
493 | .endm // window_spill_common | ||
494 | |||
495 | /*---------------------------------------------------------------------- | ||
496 | * beqi32 | ||
497 | * | ||
498 | * macro implements version of beqi for arbitrary 32-bit immidiate value | ||
499 | * | ||
500 | * beqi32 ax, ay, imm32, label | ||
501 | * | ||
502 | * Compares value in register ax with imm32 value and jumps to label if | ||
503 | * equal. Clobberes register ay if needed | ||
504 | * | ||
505 | */ | ||
506 | .macro beqi32 ax, ay, imm, label | ||
507 | .ifeq ((\imm-1) & ~7) // 1..8 ? | ||
508 | beqi \ax, \imm, \label | ||
509 | .else | ||
510 | .ifeq (\imm+1) // -1 ? | ||
511 | beqi \ax, \imm, \label | ||
512 | .else | ||
513 | .ifeq (\imm) // 0 ? | ||
514 | beqz \ax, \label | ||
515 | .else | ||
516 | // We could also handle immediates 10,12,16,32,64,128,256 | ||
517 | // but it would be a long macro... | ||
518 | movi \ay, \imm | ||
519 | beq \ax, \ay, \label | ||
520 | .endif | ||
521 | .endif | ||
522 | .endif | ||
523 | .endm // beqi32 | ||
524 | |||
525 | #endif /*XTENSA_COREASM_H*/ | ||
526 | |||
diff --git a/include/asm-xtensa/xtensa/corebits.h b/include/asm-xtensa/xtensa/corebits.h deleted file mode 100644 index e578ade41632..000000000000 --- a/include/asm-xtensa/xtensa/corebits.h +++ /dev/null | |||
@@ -1,77 +0,0 @@ | |||
1 | #ifndef XTENSA_COREBITS_H | ||
2 | #define XTENSA_COREBITS_H | ||
3 | |||
4 | /* | ||
5 | * THIS FILE IS GENERATED -- DO NOT MODIFY BY HAND | ||
6 | * | ||
7 | * xtensa/corebits.h - Xtensa Special Register field positions and masks. | ||
8 | * | ||
9 | * (In previous releases, these were defined in specreg.h, a generated file. | ||
10 | * This file is not generated, i.e. it is processor configuration independent.) | ||
11 | */ | ||
12 | |||
13 | |||
14 | /* EXCCAUSE register fields: */ | ||
15 | #define EXCCAUSE_EXCCAUSE_SHIFT 0 | ||
16 | #define EXCCAUSE_EXCCAUSE_MASK 0x3F | ||
17 | /* Exception causes (mostly incomplete!): */ | ||
18 | #define EXCCAUSE_ILLEGAL 0 | ||
19 | #define EXCCAUSE_SYSCALL 1 | ||
20 | #define EXCCAUSE_IFETCHERROR 2 | ||
21 | #define EXCCAUSE_LOADSTOREERROR 3 | ||
22 | #define EXCCAUSE_LEVEL1INTERRUPT 4 | ||
23 | #define EXCCAUSE_ALLOCA 5 | ||
24 | |||
25 | /* PS register fields: */ | ||
26 | #define PS_WOE_SHIFT 18 | ||
27 | #define PS_WOE_MASK 0x00040000 | ||
28 | #define PS_WOE PS_WOE_MASK | ||
29 | #define PS_CALLINC_SHIFT 16 | ||
30 | #define PS_CALLINC_MASK 0x00030000 | ||
31 | #define PS_CALLINC(n) (((n)&3)<<PS_CALLINC_SHIFT) /* n = 0..3 */ | ||
32 | #define PS_OWB_SHIFT 8 | ||
33 | #define PS_OWB_MASK 0x00000F00 | ||
34 | #define PS_OWB(n) (((n)&15)<<PS_OWB_SHIFT) /* n = 0..15 (or 0..7) */ | ||
35 | #define PS_RING_SHIFT 6 | ||
36 | #define PS_RING_MASK 0x000000C0 | ||
37 | #define PS_RING(n) (((n)&3)<<PS_RING_SHIFT) /* n = 0..3 */ | ||
38 | #define PS_UM_SHIFT 5 | ||
39 | #define PS_UM_MASK 0x00000020 | ||
40 | #define PS_UM PS_UM_MASK | ||
41 | #define PS_EXCM_SHIFT 4 | ||
42 | #define PS_EXCM_MASK 0x00000010 | ||
43 | #define PS_EXCM PS_EXCM_MASK | ||
44 | #define PS_INTLEVEL_SHIFT 0 | ||
45 | #define PS_INTLEVEL_MASK 0x0000000F | ||
46 | #define PS_INTLEVEL(n) ((n)&PS_INTLEVEL_MASK) /* n = 0..15 */ | ||
47 | /* Backward compatibility (deprecated): */ | ||
48 | #define PS_PROGSTACK_SHIFT PS_UM_SHIFT | ||
49 | #define PS_PROGSTACK_MASK PS_UM_MASK | ||
50 | #define PS_PROG_SHIFT PS_UM_SHIFT | ||
51 | #define PS_PROG_MASK PS_UM_MASK | ||
52 | #define PS_PROG PS_UM | ||
53 | |||
54 | /* DBREAKCn register fields: */ | ||
55 | #define DBREAKC_MASK_SHIFT 0 | ||
56 | #define DBREAKC_MASK_MASK 0x0000003F | ||
57 | #define DBREAKC_LOADBREAK_SHIFT 30 | ||
58 | #define DBREAKC_LOADBREAK_MASK 0x40000000 | ||
59 | #define DBREAKC_STOREBREAK_SHIFT 31 | ||
60 | #define DBREAKC_STOREBREAK_MASK 0x80000000 | ||
61 | |||
62 | /* DEBUGCAUSE register fields: */ | ||
63 | #define DEBUGCAUSE_DEBUGINT_SHIFT 5 | ||
64 | #define DEBUGCAUSE_DEBUGINT_MASK 0x20 /* debug interrupt */ | ||
65 | #define DEBUGCAUSE_BREAKN_SHIFT 4 | ||
66 | #define DEBUGCAUSE_BREAKN_MASK 0x10 /* BREAK.N instruction */ | ||
67 | #define DEBUGCAUSE_BREAK_SHIFT 3 | ||
68 | #define DEBUGCAUSE_BREAK_MASK 0x08 /* BREAK instruction */ | ||
69 | #define DEBUGCAUSE_DBREAK_SHIFT 2 | ||
70 | #define DEBUGCAUSE_DBREAK_MASK 0x04 /* DBREAK match */ | ||
71 | #define DEBUGCAUSE_IBREAK_SHIFT 1 | ||
72 | #define DEBUGCAUSE_IBREAK_MASK 0x02 /* IBREAK match */ | ||
73 | #define DEBUGCAUSE_ICOUNT_SHIFT 0 | ||
74 | #define DEBUGCAUSE_ICOUNT_MASK 0x01 /* ICOUNT would increment to zero */ | ||
75 | |||
76 | #endif /*XTENSA_COREBITS_H*/ | ||
77 | |||
diff --git a/include/asm-xtensa/xtensa/hal.h b/include/asm-xtensa/xtensa/hal.h deleted file mode 100644 index d10472505454..000000000000 --- a/include/asm-xtensa/xtensa/hal.h +++ /dev/null | |||
@@ -1,822 +0,0 @@ | |||
1 | #ifndef XTENSA_HAL_H | ||
2 | #define XTENSA_HAL_H | ||
3 | |||
4 | /* | ||
5 | * THIS FILE IS GENERATED -- DO NOT MODIFY BY HAND | ||
6 | * | ||
7 | * include/asm-xtensa/xtensa/hal.h -- contains a definition of the | ||
8 | * Core HAL interface. | ||
9 | * | ||
10 | * All definitions in this header file are independent of any specific | ||
11 | * Xtensa processor configuration. Thus an OS or other software can | ||
12 | * include this header file and be compiled into configuration- | ||
13 | * independent objects that can be distributed and eventually linked | ||
14 | * to the HAL library (libhal.a) to create a configuration-specific | ||
15 | * final executable. | ||
16 | * | ||
17 | * Certain definitions, however, are release-specific -- such as the | ||
18 | * XTHAL_RELEASE_xxx macros (or additions made in later releases). | ||
19 | * | ||
20 | * This file is subject to the terms and conditions of the GNU General Public | ||
21 | * License. See the file "COPYING" in the main directory of this archive | ||
22 | * for more details. | ||
23 | * | ||
24 | * Copyright (C) 2002 Tensilica Inc. | ||
25 | */ | ||
26 | |||
27 | |||
28 | /*---------------------------------------------------------------------- | ||
29 | Constant Definitions | ||
30 | (shared with assembly) | ||
31 | ----------------------------------------------------------------------*/ | ||
32 | |||
33 | /* Software release information (not configuration-specific!): */ | ||
34 | #define XTHAL_RELEASE_MAJOR 1050 | ||
35 | #define XTHAL_RELEASE_MINOR 0 | ||
36 | #define XTHAL_RELEASE_NAME "T1050.0-2002-08-06-eng0" | ||
37 | #define XTHAL_RELEASE_INTERNAL "2002-08-06-eng0" | ||
38 | #define XTHAL_REL_T1050 1 | ||
39 | #define XTHAL_REL_T1050_0 1 | ||
40 | #define XTHAL_REL_T1050_0_2002 1 | ||
41 | #define XTHAL_REL_T1050_0_2002_08 1 | ||
42 | #define XTHAL_REL_T1050_0_2002_08_06 1 | ||
43 | #define XTHAL_REL_T1050_0_2002_08_06_ENG0 1 | ||
44 | |||
45 | /* HAL version numbers (these names are for backward compatibility): */ | ||
46 | #define XTHAL_MAJOR_REV XTHAL_RELEASE_MAJOR | ||
47 | #define XTHAL_MINOR_REV XTHAL_RELEASE_MINOR | ||
48 | /* | ||
49 | * A bit of software release history on values of XTHAL_{MAJOR,MINOR}_REV: | ||
50 | * | ||
51 | * Release MAJOR MINOR Comment | ||
52 | * ======= ===== ===== ======= | ||
53 | * T1015.n n/a n/a (HAL not yet available) | ||
54 | * T1020.{0,1,2} 0 1 (HAL beta) | ||
55 | * T1020.{3,4} 0 2 First release. | ||
56 | * T1020.n (n>4) 0 2 or >3 (TBD) | ||
57 | * T1030.0 0 1 (HAL beta) | ||
58 | * T1030.{1,2} 0 3 Equivalent to first release. | ||
59 | * T1030.n (n>=3) 0 >= 3 (TBD) | ||
60 | * T1040.n 1040 n Full CHAL available from T1040.2 | ||
61 | * T1050.n 1050 n Current release. | ||
62 | * | ||
63 | * | ||
64 | * Note: there is a distinction between the software release with | ||
65 | * which something is compiled (accessible using XTHAL_RELEASE_* macros) | ||
66 | * and the software release with which the HAL library was compiled | ||
67 | * (accessible using Xthal_release_* global variables). This | ||
68 | * distinction is particularly relevant for vendors that distribute | ||
69 | * configuration-independent binaries (eg. an OS), where their customer | ||
70 | * might link it with a HAL of a different Xtensa software release. | ||
71 | * In this case, it may be appropriate for the OS to verify at run-time | ||
72 | * whether XTHAL_RELEASE_* and Xthal_release_* are compatible. | ||
73 | * [Guidelines as to which release is compatible with which are not | ||
74 | * currently provided explicitly, but might be inferred from reading | ||
75 | * OSKit documentation for all releases -- compatibility is also highly | ||
76 | * dependent on which HAL features are used. Each release is usually | ||
77 | * backward compatible, with very few exceptions if any.] | ||
78 | * | ||
79 | * Notes: | ||
80 | * Tornado 2.0 supported in T1020.3+, T1030.1+, and T1040.{0,1} only. | ||
81 | * Tornado 2.0.2 supported in T1040.2+, and T1050. | ||
82 | * Compile-time HAL port of NucleusPlus supported by T1040.2+ and T1050. | ||
83 | */ | ||
84 | |||
85 | |||
86 | /* | ||
87 | * Architectural limits, independent of configuration. | ||
88 | * Note that these are ISA-defined limits, not micro-architecture implementation | ||
89 | * limits enforced by the Xtensa Processor Generator (which may be stricter than | ||
90 | * these below). | ||
91 | */ | ||
92 | #define XTHAL_MAX_CPS 8 /* max number of coprocessors (0..7) */ | ||
93 | #define XTHAL_MAX_INTERRUPTS 32 /* max number of interrupts (0..31) */ | ||
94 | #define XTHAL_MAX_INTLEVELS 16 /* max number of interrupt levels (0..15) */ | ||
95 | /* (as of T1040, implementation limit is 7: 0..6) */ | ||
96 | #define XTHAL_MAX_TIMERS 4 /* max number of timers (CCOMPARE0..CCOMPARE3) */ | ||
97 | /* (as of T1040, implementation limit is 3: 0..2) */ | ||
98 | |||
99 | /* Misc: */ | ||
100 | #define XTHAL_LITTLEENDIAN 0 | ||
101 | #define XTHAL_BIGENDIAN 1 | ||
102 | |||
103 | |||
104 | /* Interrupt types: */ | ||
105 | #define XTHAL_INTTYPE_UNCONFIGURED 0 | ||
106 | #define XTHAL_INTTYPE_SOFTWARE 1 | ||
107 | #define XTHAL_INTTYPE_EXTERN_EDGE 2 | ||
108 | #define XTHAL_INTTYPE_EXTERN_LEVEL 3 | ||
109 | #define XTHAL_INTTYPE_TIMER 4 | ||
110 | #define XTHAL_INTTYPE_NMI 5 | ||
111 | #define XTHAL_MAX_INTTYPES 6 /* number of interrupt types */ | ||
112 | |||
113 | /* Timer related: */ | ||
114 | #define XTHAL_TIMER_UNCONFIGURED -1 /* Xthal_timer_interrupt[] value for non-existent timers */ | ||
115 | #define XTHAL_TIMER_UNASSIGNED XTHAL_TIMER_UNCONFIGURED /* (for backwards compatibility only) */ | ||
116 | |||
117 | |||
118 | /* Access Mode bits (tentative): */ /* bit abbr unit short_name PPC equ - Description */ | ||
119 | #define XTHAL_AMB_EXCEPTION 0 /* 001 E EX fls: EXception none - generate exception on any access (aka "illegal") */ | ||
120 | #define XTHAL_AMB_HITCACHE 1 /* 002 C CH fls: use Cache on Hit ~(I CI) - use cache on hit -- way from tag match [or H HC, or U UC] (ISA: same, except for Isolate case) */ | ||
121 | #define XTHAL_AMB_ALLOCATE 2 /* 004 A AL fl?: ALlocate none - refill cache on miss -- way from LRU [or F FI fill] (ISA: Read/Write Miss Refill) */ | ||
122 | #define XTHAL_AMB_WRITETHRU 3 /* 008 W WT --s: WriteThrough W WT - store immediately to memory (ISA: same) */ | ||
123 | #define XTHAL_AMB_ISOLATE 4 /* 010 I IS fls: ISolate none - use cache regardless of hit-vs-miss -- way from vaddr (ISA: use-cache-on-miss+hit) */ | ||
124 | #define XTHAL_AMB_GUARD 5 /* 020 G GU ?l?: GUard G * - non-speculative; spec/replay refs not permitted */ | ||
125 | #if 0 | ||
126 | #define XTHAL_AMB_ORDERED x /* 000 O OR fls: ORdered G * - mem accesses cannot be out of order */ | ||
127 | #define XTHAL_AMB_FUSEWRITES x /* 000 F FW --s: FuseWrites none - allow combining/merging multiple writes (to same datapath data unit) into one (implied by writeback) */ | ||
128 | #define XTHAL_AMB_COHERENT x /* 000 M MC fl?: Mem/MP Coherent M - on reads, other CPUs/bus-masters may need to supply data */ | ||
129 | #define XTHAL_AMB_TRUSTED x /* 000 T TR ?l?: TRusted none - memory will not bus error (if it does, handle as fatal imprecise interrupt) */ | ||
130 | #define XTHAL_AMB_PREFETCH x /* 000 P PR fl?: PRefetch none - on refill, read line+1 into prefetch buffers */ | ||
131 | #define XTHAL_AMB_STREAM x /* 000 S ST ???: STreaming none - access one of N stream buffers */ | ||
132 | #endif /*0*/ | ||
133 | |||
134 | #define XTHAL_AM_EXCEPTION (1<<XTHAL_AMB_EXCEPTION) | ||
135 | #define XTHAL_AM_HITCACHE (1<<XTHAL_AMB_HITCACHE) | ||
136 | #define XTHAL_AM_ALLOCATE (1<<XTHAL_AMB_ALLOCATE) | ||
137 | #define XTHAL_AM_WRITETHRU (1<<XTHAL_AMB_WRITETHRU) | ||
138 | #define XTHAL_AM_ISOLATE (1<<XTHAL_AMB_ISOLATE) | ||
139 | #define XTHAL_AM_GUARD (1<<XTHAL_AMB_GUARD) | ||
140 | #if 0 | ||
141 | #define XTHAL_AM_ORDERED (1<<XTHAL_AMB_ORDERED) | ||
142 | #define XTHAL_AM_FUSEWRITES (1<<XTHAL_AMB_FUSEWRITES) | ||
143 | #define XTHAL_AM_COHERENT (1<<XTHAL_AMB_COHERENT) | ||
144 | #define XTHAL_AM_TRUSTED (1<<XTHAL_AMB_TRUSTED) | ||
145 | #define XTHAL_AM_PREFETCH (1<<XTHAL_AMB_PREFETCH) | ||
146 | #define XTHAL_AM_STREAM (1<<XTHAL_AMB_STREAM) | ||
147 | #endif /*0*/ | ||
148 | |||
149 | /* | ||
150 | * Allowed Access Modes (bit combinations). | ||
151 | * | ||
152 | * Columns are: | ||
153 | * "FOGIWACE" | ||
154 | * Access mode bits (see XTHAL_AMB_xxx above). | ||
155 | * <letter> = bit is set | ||
156 | * '-' = bit is clear | ||
157 | * '.' = bit is irrelevant / don't care, as follows: | ||
158 | * E=1 makes all others irrelevant | ||
159 | * W,F relevant only for stores | ||
160 | * "2345" | ||
161 | * Indicates which Xtensa releases support the corresponding | ||
162 | * access mode. Releases for each character column are: | ||
163 | * 2 = prior to T1020.2: T1015 (V1.5), T1020.0, T1020.1 | ||
164 | * 3 = T1020.2 and later: T1020.2+, T1030 | ||
165 | * 4 = T1040 | ||
166 | * 5 = T1050 (maybe) | ||
167 | * And the character column contents are: | ||
168 | * <number> = support by release(s) | ||
169 | * "." = unsupported by release(s) | ||
170 | * "?" = support unknown | ||
171 | */ | ||
172 | /* FOGIWACE 2345 */ | ||
173 | /* For instruction fetch: */ | ||
174 | #define XTHAL_FAM_EXCEPTION 0x001 /* .......E 2345 exception */ | ||
175 | #define XTHAL_FAM_ISOLATE 0x012 /* .--I.-C- .... isolate */ | ||
176 | #define XTHAL_FAM_BYPASS 0x000 /* .---.--- 2345 bypass */ | ||
177 | #define XTHAL_FAM_NACACHED 0x002 /* .---.-C- .... cached no-allocate (frozen) */ | ||
178 | #define XTHAL_FAM_CACHED 0x006 /* .---.AC- 2345 cached */ | ||
179 | /* For data load: */ | ||
180 | #define XTHAL_LAM_EXCEPTION 0x001 /* .......E 2345 exception */ | ||
181 | #define XTHAL_LAM_ISOLATE 0x012 /* .--I.-C- 2345 isolate */ | ||
182 | #define XTHAL_LAM_BYPASS 0x000 /* .O--.--- 2... bypass speculative */ | ||
183 | #define XTHAL_LAM_BYPASSG 0x020 /* .OG-.--- .345 bypass guarded */ | ||
184 | #define XTHAL_LAM_NACACHED 0x002 /* .O--.-C- 2... cached no-allocate speculative */ | ||
185 | #define XTHAL_LAM_NACACHEDG 0x022 /* .OG-.-C- .345 cached no-allocate guarded */ | ||
186 | #define XTHAL_LAM_CACHED 0x006 /* .---.AC- 2345 cached speculative */ | ||
187 | #define XTHAL_LAM_CACHEDG 0x026 /* .?G-.AC- .... cached guarded */ | ||
188 | /* For data store: */ | ||
189 | #define XTHAL_SAM_EXCEPTION 0x001 /* .......E 2345 exception */ | ||
190 | #define XTHAL_SAM_ISOLATE 0x032 /* .-GI--C- 2345 isolate */ | ||
191 | #define XTHAL_SAM_BYPASS 0x028 /* -OG-W--- 2345 bypass */ | ||
192 | /*efine XTHAL_SAM_BYPASSF 0x028*/ /* F-G-W--- ...? bypass write-combined */ | ||
193 | #define XTHAL_SAM_WRITETHRU 0x02A /* -OG-W-C- 234? writethrough */ | ||
194 | /*efine XTHAL_SAM_WRITETHRUF 0x02A*/ /* F-G-W-C- ...5 writethrough write-combined */ | ||
195 | #define XTHAL_SAM_WRITEALLOC 0x02E /* -OG-WAC- ...? writethrough-allocate */ | ||
196 | /*efine XTHAL_SAM_WRITEALLOCF 0x02E*/ /* F-G-WAC- ...? writethrough-allocate write-combined */ | ||
197 | #define XTHAL_SAM_WRITEBACK 0x026 /* F-G--AC- ...5 writeback */ | ||
198 | |||
199 | #if 0 | ||
200 | /* | ||
201 | Cache attribute encoding for CACHEATTR (per ISA): | ||
202 | (Note: if this differs from ISA Ref Manual, ISA has precedence) | ||
203 | |||
204 | Inst-fetches Loads Stores | ||
205 | ------------- ------------ ------------- | ||
206 | 0x0 FCA_EXCEPTION ?LCA_NACACHED_G* SCA_WRITETHRU "uncached" | ||
207 | 0x1 FCA_CACHED LCA_CACHED SCA_WRITETHRU cached | ||
208 | 0x2 FCA_BYPASS LCA_BYPASS_G* SCA_BYPASS bypass | ||
209 | 0x3 FCA_CACHED LCA_CACHED SCA_WRITEALLOCF write-allocate | ||
210 | or LCA_EXCEPTION SCA_EXCEPTION (if unimplemented) | ||
211 | 0x4 FCA_CACHED LCA_CACHED SCA_WRITEBACK write-back | ||
212 | or LCA_EXCEPTION SCA_EXCEPTION (if unimplemented) | ||
213 | 0x5..D FCA_EXCEPTION LCA_EXCEPTION SCA_EXCEPTION (reserved) | ||
214 | 0xE FCA_EXCEPTION LCA_ISOLATE SCA_ISOLATE isolate | ||
215 | 0xF FCA_EXCEPTION LCA_EXCEPTION SCA_EXCEPTION illegal | ||
216 | * Prior to T1020.2?, guard feature not supported, this defaulted to speculative (no _G) | ||
217 | */ | ||
218 | #endif /*0*/ | ||
219 | |||
220 | |||
221 | #if !defined(__ASSEMBLY__) && !defined(_NOCLANGUAGE) | ||
222 | #ifdef __cplusplus | ||
223 | extern "C" { | ||
224 | #endif | ||
225 | |||
226 | /*---------------------------------------------------------------------- | ||
227 | HAL | ||
228 | ----------------------------------------------------------------------*/ | ||
229 | |||
230 | /* Constant to be checked in build = (XTHAL_MAJOR_REV<<16)|XTHAL_MINOR_REV */ | ||
231 | extern const unsigned int Xthal_rev_no; | ||
232 | |||
233 | |||
234 | /*---------------------------------------------------------------------- | ||
235 | Processor State | ||
236 | ----------------------------------------------------------------------*/ | ||
237 | /* save & restore the extra processor state */ | ||
238 | extern void xthal_save_extra(void *base); | ||
239 | extern void xthal_restore_extra(void *base); | ||
240 | |||
241 | extern void xthal_save_cpregs(void *base, int); | ||
242 | extern void xthal_restore_cpregs(void *base, int); | ||
243 | |||
244 | /*extern void xthal_save_all_extra(void *base);*/ | ||
245 | /*extern void xthal_restore_all_extra(void *base);*/ | ||
246 | |||
247 | /* space for processor state */ | ||
248 | extern const unsigned int Xthal_extra_size; | ||
249 | extern const unsigned int Xthal_extra_align; | ||
250 | /* space for TIE register files */ | ||
251 | extern const unsigned int Xthal_cpregs_size[XTHAL_MAX_CPS]; | ||
252 | extern const unsigned int Xthal_cpregs_align[XTHAL_MAX_CPS]; | ||
253 | |||
254 | /* total of space for the processor state (for Tor2) */ | ||
255 | extern const unsigned int Xthal_all_extra_size; | ||
256 | extern const unsigned int Xthal_all_extra_align; | ||
257 | |||
258 | /* initialize the extra processor */ | ||
259 | /*extern void xthal_init_extra(void);*/ | ||
260 | /* initialize the TIE coprocessor */ | ||
261 | /*extern void xthal_init_cp(int);*/ | ||
262 | |||
263 | /* initialize the extra processor */ | ||
264 | extern void xthal_init_mem_extra(void *); | ||
265 | /* initialize the TIE coprocessor */ | ||
266 | extern void xthal_init_mem_cp(void *, int); | ||
267 | |||
268 | /* validate & invalidate the TIE register file */ | ||
269 | extern void xthal_validate_cp(int); | ||
270 | extern void xthal_invalidate_cp(int); | ||
271 | |||
272 | /* the number of TIE coprocessors contiguous from zero (for Tor2) */ | ||
273 | extern const unsigned int Xthal_num_coprocessors; | ||
274 | |||
275 | /* actual number of coprocessors */ | ||
276 | extern const unsigned char Xthal_cp_num; | ||
277 | /* index of highest numbered coprocessor, plus one */ | ||
278 | extern const unsigned char Xthal_cp_max; | ||
279 | /* index of highest allowed coprocessor number, per cfg, plus one */ | ||
280 | /*extern const unsigned char Xthal_cp_maxcfg;*/ | ||
281 | /* bitmask of which coprocessors are present */ | ||
282 | extern const unsigned int Xthal_cp_mask; | ||
283 | |||
284 | /* read and write cpenable register */ | ||
285 | extern void xthal_set_cpenable(unsigned); | ||
286 | extern unsigned xthal_get_cpenable(void); | ||
287 | |||
288 | /* read & write extra state register */ | ||
289 | /*extern int xthal_read_extra(void *base, unsigned reg, unsigned *value);*/ | ||
290 | /*extern int xthal_write_extra(void *base, unsigned reg, unsigned value);*/ | ||
291 | |||
292 | /* read & write a TIE coprocessor register */ | ||
293 | /*extern int xthal_read_cpreg(void *base, int cp, unsigned reg, unsigned *value);*/ | ||
294 | /*extern int xthal_write_cpreg(void *base, int cp, unsigned reg, unsigned value);*/ | ||
295 | |||
296 | /* return coprocessor number based on register */ | ||
297 | /*extern int xthal_which_cp(unsigned reg);*/ | ||
298 | |||
299 | /*---------------------------------------------------------------------- | ||
300 | Interrupts | ||
301 | ----------------------------------------------------------------------*/ | ||
302 | |||
303 | /* the number of interrupt levels */ | ||
304 | extern const unsigned char Xthal_num_intlevels; | ||
305 | /* the number of interrupts */ | ||
306 | extern const unsigned char Xthal_num_interrupts; | ||
307 | |||
308 | /* mask for level of interrupts */ | ||
309 | extern const unsigned int Xthal_intlevel_mask[XTHAL_MAX_INTLEVELS]; | ||
310 | /* mask for level 0 to N interrupts */ | ||
311 | extern const unsigned int Xthal_intlevel_andbelow_mask[XTHAL_MAX_INTLEVELS]; | ||
312 | |||
313 | /* level of each interrupt */ | ||
314 | extern const unsigned char Xthal_intlevel[XTHAL_MAX_INTERRUPTS]; | ||
315 | |||
316 | /* type per interrupt */ | ||
317 | extern const unsigned char Xthal_inttype[XTHAL_MAX_INTERRUPTS]; | ||
318 | |||
319 | /* masks of each type of interrupt */ | ||
320 | extern const unsigned int Xthal_inttype_mask[XTHAL_MAX_INTTYPES]; | ||
321 | |||
322 | /* interrupt numbers assigned to each timer interrupt */ | ||
323 | extern const int Xthal_timer_interrupt[XTHAL_MAX_TIMERS]; | ||
324 | |||
325 | /*** Virtual interrupt prioritization: ***/ | ||
326 | |||
327 | /* Convert between interrupt levels (as per PS.INTLEVEL) and virtual interrupt priorities: */ | ||
328 | extern unsigned xthal_vpri_to_intlevel(unsigned vpri); | ||
329 | extern unsigned xthal_intlevel_to_vpri(unsigned intlevel); | ||
330 | |||
331 | /* Enables/disables given set (mask) of interrupts; returns previous enabled-mask of all ints: */ | ||
332 | extern unsigned xthal_int_enable(unsigned); | ||
333 | extern unsigned xthal_int_disable(unsigned); | ||
334 | |||
335 | /* Set/get virtual priority of an interrupt: */ | ||
336 | extern int xthal_set_int_vpri(int intnum, int vpri); | ||
337 | extern int xthal_get_int_vpri(int intnum); | ||
338 | |||
339 | /* Set/get interrupt lockout level for exclusive access to virtual priority data structures: */ | ||
340 | extern void xthal_set_vpri_locklevel(unsigned intlevel); | ||
341 | extern unsigned xthal_get_vpri_locklevel(void); | ||
342 | |||
343 | /* Set/get current virtual interrupt priority: */ | ||
344 | extern unsigned xthal_set_vpri(unsigned vpri); | ||
345 | extern unsigned xthal_get_vpri(unsigned vpri); | ||
346 | extern unsigned xthal_set_vpri_intlevel(unsigned intlevel); | ||
347 | extern unsigned xthal_set_vpri_lock(void); | ||
348 | |||
349 | |||
350 | |||
351 | /*---------------------------------------------------------------------- | ||
352 | Generic Interrupt Trampolining Support | ||
353 | ----------------------------------------------------------------------*/ | ||
354 | |||
355 | typedef void (XtHalVoidFunc)(void); | ||
356 | |||
357 | /* | ||
358 | * Bitmask of interrupts currently trampolining down: | ||
359 | */ | ||
360 | extern unsigned Xthal_tram_pending; | ||
361 | |||
362 | /* | ||
363 | * Bitmask of which interrupts currently trampolining down | ||
364 | * synchronously are actually enabled; this bitmask is necessary | ||
365 | * because INTENABLE cannot hold that state (sync-trampolining | ||
366 | * interrupts must be kept disabled while trampolining); | ||
367 | * in the current implementation, any bit set here is not set | ||
368 | * in INTENABLE, and vice-versa; once a sync-trampoline is | ||
369 | * handled (at level one), its enable bit must be moved from | ||
370 | * here to INTENABLE: | ||
371 | */ | ||
372 | extern unsigned Xthal_tram_enabled; | ||
373 | |||
374 | /* | ||
375 | * Bitmask of interrupts configured for sync trampolining: | ||
376 | */ | ||
377 | extern unsigned Xthal_tram_sync; | ||
378 | |||
379 | |||
380 | /* Trampoline support functions: */ | ||
381 | extern unsigned xthal_tram_pending_to_service( void ); | ||
382 | extern void xthal_tram_done( unsigned serviced_mask ); | ||
383 | extern int xthal_tram_set_sync( int intnum, int sync ); | ||
384 | extern XtHalVoidFunc* xthal_set_tram_trigger_func( XtHalVoidFunc *trigger_fn ); | ||
385 | |||
386 | /* INTENABLE,INTREAD,INTSET,INTCLEAR register access functions: */ | ||
387 | extern unsigned xthal_get_intenable( void ); | ||
388 | extern void xthal_set_intenable( unsigned ); | ||
389 | extern unsigned xthal_get_intread( void ); | ||
390 | extern void xthal_set_intset( unsigned ); | ||
391 | extern void xthal_set_intclear( unsigned ); | ||
392 | |||
393 | |||
394 | /*---------------------------------------------------------------------- | ||
395 | Register Windows | ||
396 | ----------------------------------------------------------------------*/ | ||
397 | |||
398 | /* number of registers in register window */ | ||
399 | extern const unsigned int Xthal_num_aregs; | ||
400 | extern const unsigned char Xthal_num_aregs_log2; | ||
401 | |||
402 | /* This spill any live register windows (other than the caller's): */ | ||
403 | extern void xthal_window_spill( void ); | ||
404 | |||
405 | |||
406 | /*---------------------------------------------------------------------- | ||
407 | Cache | ||
408 | ----------------------------------------------------------------------*/ | ||
409 | |||
410 | /* size of the cache lines in log2(bytes) */ | ||
411 | extern const unsigned char Xthal_icache_linewidth; | ||
412 | extern const unsigned char Xthal_dcache_linewidth; | ||
413 | /* size of the cache lines in bytes */ | ||
414 | extern const unsigned short Xthal_icache_linesize; | ||
415 | extern const unsigned short Xthal_dcache_linesize; | ||
416 | /* number of cache sets in log2(lines per way) */ | ||
417 | extern const unsigned char Xthal_icache_setwidth; | ||
418 | extern const unsigned char Xthal_dcache_setwidth; | ||
419 | /* cache set associativity (number of ways) */ | ||
420 | extern const unsigned int Xthal_icache_ways; | ||
421 | extern const unsigned int Xthal_dcache_ways; | ||
422 | /* size of the caches in bytes (ways * 2^(linewidth + setwidth)) */ | ||
423 | extern const unsigned int Xthal_icache_size; | ||
424 | extern const unsigned int Xthal_dcache_size; | ||
425 | /* cache features */ | ||
426 | extern const unsigned char Xthal_dcache_is_writeback; | ||
427 | extern const unsigned char Xthal_icache_line_lockable; | ||
428 | extern const unsigned char Xthal_dcache_line_lockable; | ||
429 | |||
430 | /* cache attribute register control (used by other HAL routines) */ | ||
431 | extern unsigned xthal_get_cacheattr( void ); | ||
432 | extern unsigned xthal_get_icacheattr( void ); | ||
433 | extern unsigned xthal_get_dcacheattr( void ); | ||
434 | extern void xthal_set_cacheattr( unsigned ); | ||
435 | extern void xthal_set_icacheattr( unsigned ); | ||
436 | extern void xthal_set_dcacheattr( unsigned ); | ||
437 | |||
438 | /* initialize cache support (must be called once at startup, before all other cache calls) */ | ||
439 | /*extern void xthal_cache_startinit( void );*/ | ||
440 | /* reset caches */ | ||
441 | /*extern void xthal_icache_reset( void );*/ | ||
442 | /*extern void xthal_dcache_reset( void );*/ | ||
443 | /* enable caches */ | ||
444 | extern void xthal_icache_enable( void ); /* DEPRECATED */ | ||
445 | extern void xthal_dcache_enable( void ); /* DEPRECATED */ | ||
446 | /* disable caches */ | ||
447 | extern void xthal_icache_disable( void ); /* DEPRECATED */ | ||
448 | extern void xthal_dcache_disable( void ); /* DEPRECATED */ | ||
449 | |||
450 | /* invalidate the caches */ | ||
451 | extern void xthal_icache_all_invalidate( void ); | ||
452 | extern void xthal_dcache_all_invalidate( void ); | ||
453 | extern void xthal_icache_region_invalidate( void *addr, unsigned size ); | ||
454 | extern void xthal_dcache_region_invalidate( void *addr, unsigned size ); | ||
455 | extern void xthal_icache_line_invalidate(void *addr); | ||
456 | extern void xthal_dcache_line_invalidate(void *addr); | ||
457 | /* write dirty data back */ | ||
458 | extern void xthal_dcache_all_writeback( void ); | ||
459 | extern void xthal_dcache_region_writeback( void *addr, unsigned size ); | ||
460 | extern void xthal_dcache_line_writeback(void *addr); | ||
461 | /* write dirty data back and invalidate */ | ||
462 | extern void xthal_dcache_all_writeback_inv( void ); | ||
463 | extern void xthal_dcache_region_writeback_inv( void *addr, unsigned size ); | ||
464 | extern void xthal_dcache_line_writeback_inv(void *addr); | ||
465 | /* prefetch and lock specified memory range into cache */ | ||
466 | extern void xthal_icache_region_lock( void *addr, unsigned size ); | ||
467 | extern void xthal_dcache_region_lock( void *addr, unsigned size ); | ||
468 | extern void xthal_icache_line_lock(void *addr); | ||
469 | extern void xthal_dcache_line_lock(void *addr); | ||
470 | /* unlock from cache */ | ||
471 | extern void xthal_icache_all_unlock( void ); | ||
472 | extern void xthal_dcache_all_unlock( void ); | ||
473 | extern void xthal_icache_region_unlock( void *addr, unsigned size ); | ||
474 | extern void xthal_dcache_region_unlock( void *addr, unsigned size ); | ||
475 | extern void xthal_icache_line_unlock(void *addr); | ||
476 | extern void xthal_dcache_line_unlock(void *addr); | ||
477 | |||
478 | |||
479 | /* sync icache and memory */ | ||
480 | extern void xthal_icache_sync( void ); | ||
481 | /* sync dcache and memory */ | ||
482 | extern void xthal_dcache_sync( void ); | ||
483 | |||
484 | /*---------------------------------------------------------------------- | ||
485 | Debug | ||
486 | ----------------------------------------------------------------------*/ | ||
487 | |||
488 | /* 1 if debug option configured, 0 if not: */ | ||
489 | extern const int Xthal_debug_configured; | ||
490 | |||
491 | /* Number of instruction and data break registers: */ | ||
492 | extern const int Xthal_num_ibreak; | ||
493 | extern const int Xthal_num_dbreak; | ||
494 | |||
495 | /* Set (plant) and remove software breakpoint, both synchronizing cache: */ | ||
496 | extern unsigned int xthal_set_soft_break(void *addr); | ||
497 | extern void xthal_remove_soft_break(void *addr, unsigned int); | ||
498 | |||
499 | |||
500 | /*---------------------------------------------------------------------- | ||
501 | Disassembler | ||
502 | ----------------------------------------------------------------------*/ | ||
503 | |||
504 | /* Max expected size of the return buffer for a disassembled instruction (hint only): */ | ||
505 | #define XTHAL_DISASM_BUFSIZE 80 | ||
506 | |||
507 | /* Disassembly option bits for selecting what to return: */ | ||
508 | #define XTHAL_DISASM_OPT_ADDR 0x0001 /* display address */ | ||
509 | #define XTHAL_DISASM_OPT_OPHEX 0x0002 /* display opcode bytes in hex */ | ||
510 | #define XTHAL_DISASM_OPT_OPCODE 0x0004 /* display opcode name (mnemonic) */ | ||
511 | #define XTHAL_DISASM_OPT_PARMS 0x0008 /* display parameters */ | ||
512 | #define XTHAL_DISASM_OPT_ALL 0x0FFF /* display everything */ | ||
513 | |||
514 | /* routine to get a string for the disassembled instruction */ | ||
515 | extern int xthal_disassemble( unsigned char *instr_buf, void *tgt_addr, | ||
516 | char *buffer, unsigned buflen, unsigned options ); | ||
517 | |||
518 | /* routine to get the size of the next instruction. Returns 0 for | ||
519 | illegal instruction */ | ||
520 | extern int xthal_disassemble_size( unsigned char *instr_buf ); | ||
521 | |||
522 | |||
523 | /*---------------------------------------------------------------------- | ||
524 | Core Counter | ||
525 | ----------------------------------------------------------------------*/ | ||
526 | |||
527 | /* counter info */ | ||
528 | extern const unsigned char Xthal_have_ccount; /* set if CCOUNT register present */ | ||
529 | extern const unsigned char Xthal_num_ccompare; /* number of CCOMPAREn registers */ | ||
530 | |||
531 | /* get CCOUNT register (if not present return 0) */ | ||
532 | extern unsigned xthal_get_ccount(void); | ||
533 | |||
534 | /* set and get CCOMPAREn registers (if not present, get returns 0) */ | ||
535 | extern void xthal_set_ccompare(int, unsigned); | ||
536 | extern unsigned xthal_get_ccompare(int); | ||
537 | |||
538 | |||
539 | /*---------------------------------------------------------------------- | ||
540 | Instruction/Data RAM/ROM Access | ||
541 | ----------------------------------------------------------------------*/ | ||
542 | |||
543 | extern void* xthal_memcpy(void *dst, const void *src, unsigned len); | ||
544 | extern void* xthal_bcopy(const void *src, void *dst, unsigned len); | ||
545 | |||
546 | /*---------------------------------------------------------------------- | ||
547 | MP Synchronization | ||
548 | ----------------------------------------------------------------------*/ | ||
549 | extern int xthal_compare_and_set( int *addr, int test_val, int compare_val ); | ||
550 | extern unsigned xthal_get_prid( void ); | ||
551 | |||
552 | /*extern const char Xthal_have_s32c1i;*/ | ||
553 | extern const unsigned char Xthal_have_prid; | ||
554 | |||
555 | |||
556 | /*---------------------------------------------------------------------- | ||
557 | Miscellaneous | ||
558 | ----------------------------------------------------------------------*/ | ||
559 | |||
560 | extern const unsigned int Xthal_release_major; | ||
561 | extern const unsigned int Xthal_release_minor; | ||
562 | extern const char * const Xthal_release_name; | ||
563 | extern const char * const Xthal_release_internal; | ||
564 | |||
565 | extern const unsigned char Xthal_memory_order; | ||
566 | extern const unsigned char Xthal_have_windowed; | ||
567 | extern const unsigned char Xthal_have_density; | ||
568 | extern const unsigned char Xthal_have_booleans; | ||
569 | extern const unsigned char Xthal_have_loops; | ||
570 | extern const unsigned char Xthal_have_nsa; | ||
571 | extern const unsigned char Xthal_have_minmax; | ||
572 | extern const unsigned char Xthal_have_sext; | ||
573 | extern const unsigned char Xthal_have_clamps; | ||
574 | extern const unsigned char Xthal_have_mac16; | ||
575 | extern const unsigned char Xthal_have_mul16; | ||
576 | extern const unsigned char Xthal_have_fp; | ||
577 | extern const unsigned char Xthal_have_speculation; | ||
578 | extern const unsigned char Xthal_have_exceptions; | ||
579 | extern const unsigned char Xthal_xea_version; | ||
580 | extern const unsigned char Xthal_have_interrupts; | ||
581 | extern const unsigned char Xthal_have_highlevel_interrupts; | ||
582 | extern const unsigned char Xthal_have_nmi; | ||
583 | |||
584 | extern const unsigned short Xthal_num_writebuffer_entries; | ||
585 | |||
586 | extern const unsigned int Xthal_build_unique_id; | ||
587 | /* Release info for hardware targeted by software upgrades: */ | ||
588 | extern const unsigned int Xthal_hw_configid0; | ||
589 | extern const unsigned int Xthal_hw_configid1; | ||
590 | extern const unsigned int Xthal_hw_release_major; | ||
591 | extern const unsigned int Xthal_hw_release_minor; | ||
592 | extern const char * const Xthal_hw_release_name; | ||
593 | extern const char * const Xthal_hw_release_internal; | ||
594 | |||
595 | |||
596 | /* Internal memories... */ | ||
597 | |||
598 | extern const unsigned char Xthal_num_instrom; | ||
599 | extern const unsigned char Xthal_num_instram; | ||
600 | extern const unsigned char Xthal_num_datarom; | ||
601 | extern const unsigned char Xthal_num_dataram; | ||
602 | extern const unsigned char Xthal_num_xlmi; | ||
603 | extern const unsigned int Xthal_instrom_vaddr[1]; | ||
604 | extern const unsigned int Xthal_instrom_paddr[1]; | ||
605 | extern const unsigned int Xthal_instrom_size [1]; | ||
606 | extern const unsigned int Xthal_instram_vaddr[1]; | ||
607 | extern const unsigned int Xthal_instram_paddr[1]; | ||
608 | extern const unsigned int Xthal_instram_size [1]; | ||
609 | extern const unsigned int Xthal_datarom_vaddr[1]; | ||
610 | extern const unsigned int Xthal_datarom_paddr[1]; | ||
611 | extern const unsigned int Xthal_datarom_size [1]; | ||
612 | extern const unsigned int Xthal_dataram_vaddr[1]; | ||
613 | extern const unsigned int Xthal_dataram_paddr[1]; | ||
614 | extern const unsigned int Xthal_dataram_size [1]; | ||
615 | extern const unsigned int Xthal_xlmi_vaddr[1]; | ||
616 | extern const unsigned int Xthal_xlmi_paddr[1]; | ||
617 | extern const unsigned int Xthal_xlmi_size [1]; | ||
618 | |||
619 | |||
620 | |||
621 | /*---------------------------------------------------------------------- | ||
622 | Memory Management Unit | ||
623 | ----------------------------------------------------------------------*/ | ||
624 | |||
625 | extern const unsigned char Xthal_have_spanning_way; | ||
626 | extern const unsigned char Xthal_have_identity_map; | ||
627 | extern const unsigned char Xthal_have_mimic_cacheattr; | ||
628 | extern const unsigned char Xthal_have_xlt_cacheattr; | ||
629 | extern const unsigned char Xthal_have_cacheattr; | ||
630 | extern const unsigned char Xthal_have_tlbs; | ||
631 | |||
632 | extern const unsigned char Xthal_mmu_asid_bits; /* 0 .. 8 */ | ||
633 | extern const unsigned char Xthal_mmu_asid_kernel; | ||
634 | extern const unsigned char Xthal_mmu_rings; /* 1 .. 4 (perhaps 0 if no MMU and/or no protection?) */ | ||
635 | extern const unsigned char Xthal_mmu_ring_bits; | ||
636 | extern const unsigned char Xthal_mmu_sr_bits; | ||
637 | extern const unsigned char Xthal_mmu_ca_bits; | ||
638 | extern const unsigned int Xthal_mmu_max_pte_page_size; | ||
639 | extern const unsigned int Xthal_mmu_min_pte_page_size; | ||
640 | |||
641 | extern const unsigned char Xthal_itlb_way_bits; | ||
642 | extern const unsigned char Xthal_itlb_ways; | ||
643 | extern const unsigned char Xthal_itlb_arf_ways; | ||
644 | extern const unsigned char Xthal_dtlb_way_bits; | ||
645 | extern const unsigned char Xthal_dtlb_ways; | ||
646 | extern const unsigned char Xthal_dtlb_arf_ways; | ||
647 | |||
648 | /* Convert between virtual and physical addresses (through static maps only): */ | ||
649 | /*** WARNING: these two functions may go away in a future release; don't depend on them! ***/ | ||
650 | extern int xthal_static_v2p( unsigned vaddr, unsigned *paddrp ); | ||
651 | extern int xthal_static_p2v( unsigned paddr, unsigned *vaddrp, unsigned cached ); | ||
652 | |||
653 | #if 0 | ||
654 | /******************* EXPERIMENTAL AND TENTATIVE ONLY ********************/ | ||
655 | |||
656 | #define XTHAL_MMU_PAGESZ_COUNT_MAX 8 /* maximum number of different page sizes */ | ||
657 | extern const char Xthal_mmu_pagesz_count; /* 0 .. 8 number of different page sizes configured */ | ||
658 | |||
659 | /* Note: the following table doesn't necessarily have page sizes in increasing order: */ | ||
660 | extern const char Xthal_mmu_pagesz_log2[XTHAL_MMU_PAGESZ_COUNT_MAX]; /* 10 .. 28 (0 past count) */ | ||
661 | |||
662 | /* Sorted (increasing) table of page sizes, that indexes into the above table: */ | ||
663 | extern const char Xthal_mmu_pagesz_sorted[XTHAL_MMU_PAGESZ_COUNT_MAX]; /* 0 .. 7 (0 past count) */ | ||
664 | |||
665 | /*u32 Xthal_virtual_exceptions;*/ /* bitmask of which exceptions execute in virtual mode... */ | ||
666 | |||
667 | extern const char Xthal_mmu_pte_pagesz_log2_min; /* ?? minimum page size in PTEs */ | ||
668 | extern const char Xthal_mmu_pte_pagesz_log2_max; /* ?? maximum page size in PTEs */ | ||
669 | |||
670 | /* Cache Attribute Bits Implemented by the Cache (part of the cache abstraction) */ | ||
671 | extern const char Xthal_icache_fca_bits_implemented; /* ITLB/UTLB only! */ | ||
672 | extern const char Xthal_dcache_lca_bits_implemented; /* DTLB/UTLB only! */ | ||
673 | extern const char Xthal_dcache_sca_bits_implemented; /* DTLB/UTLB only! */ | ||
674 | |||
675 | /* Per TLB Parameters (Instruction, Data, Unified) */ | ||
676 | struct XtHalMmuTlb Xthal_itlb; /* description of MMU I-TLB generic features */ | ||
677 | struct XtHalMmuTlb Xthal_dtlb; /* description of MMU D-TLB generic features */ | ||
678 | struct XtHalMmuTlb Xthal_utlb; /* description of MMU U-TLB generic features */ | ||
679 | |||
680 | #define XTHAL_MMU_WAYS_MAX 8 /* maximum number of ways (associativities) for each TLB */ | ||
681 | |||
682 | /* Structure for common information described for each possible TLB (instruction, data and unified): */ | ||
683 | typedef struct XtHalMmuTlb { | ||
684 | u8 va_bits; /* 32 (number of virtual address bits) */ | ||
685 | u8 pa_bits; /* 32 (number of physical address bits) */ | ||
686 | bool tlb_va_indexed; /* 1 (set if TLB is indexed by virtual address) */ | ||
687 | bool tlb_va_tagged; /* 0 (set if TLB is tagged by virtual address) */ | ||
688 | bool cache_va_indexed; /* 1 (set if cache is indexed by virtual address) */ | ||
689 | bool cache_va_tagged; /* 0 (set if cache is tagged by virtual address) */ | ||
690 | /*bool (whether page tables are traversed in vaddr sorted order, paddr sorted order, ...) */ | ||
691 | /*u8 (set of available page attribute bits, other than cache attribute bits defined above) */ | ||
692 | /*u32 (various masks for pages, MMU table/TLB entries, etc.) */ | ||
693 | u8 way_count; /* 0 .. 8 (number of ways, a.k.a. associativities, for this TLB) */ | ||
694 | XtHalMmuTlbWay * ways[XTHAL_MMU_WAYS_MAX]; /* pointers to per-way parms for each way */ | ||
695 | } XtHalMmuTlb; | ||
696 | |||
697 | /* Per TLB Way (Per Associativity) Parameters */ | ||
698 | typedef struct XtHalMmuTlbWay { | ||
699 | u32 index_count_log2; /* 0 .. 4 */ | ||
700 | u32 pagesz_mask; /* 0 .. 2^pagesz_count - 1 (each bit corresponds to a size */ | ||
701 | /* defined in the Xthal_mmu_pagesz_log2[] table) */ | ||
702 | u32 vpn_const_mask; | ||
703 | u32 vpn_const_value; | ||
704 | u64 ppn_const_mask; /* future may support pa_bits > 32 */ | ||
705 | u64 ppn_const_value; | ||
706 | u32 ppn_id_mask; /* paddr bits taken directly from vaddr */ | ||
707 | bool backgnd_match; /* 0 or 1 */ | ||
708 | /* These are defined in terms of the XTHAL_CACHE_xxx bits: */ | ||
709 | u8 fca_const_mask; /* ITLB/UTLB only! */ | ||
710 | u8 fca_const_value; /* ITLB/UTLB only! */ | ||
711 | u8 lca_const_mask; /* DTLB/UTLB only! */ | ||
712 | u8 lca_const_value; /* DTLB/UTLB only! */ | ||
713 | u8 sca_const_mask; /* DTLB/UTLB only! */ | ||
714 | u8 sca_const_value; /* DTLB/UTLB only! */ | ||
715 | /* These define an encoding that map 5 bits in TLB and PTE entries to */ | ||
716 | /* 8 bits (FCA, ITLB), 16 bits (LCA+SCA, DTLB) or 24 bits (FCA+LCA+SCA, UTLB): */ | ||
717 | /* (they may be moved to struct XtHalMmuTlb) */ | ||
718 | u8 ca_bits; /* number of bits in TLB/PTE entries for cache attributes */ | ||
719 | u32 * ca_map; /* pointer to array of 2^ca_bits entries of FCA+LCA+SCA bits */ | ||
720 | } XtHalMmuTlbWay; | ||
721 | |||
722 | /* | ||
723 | * The way to determine whether protection support is present in core | ||
724 | * is to [look at Xthal_mmu_rings ???]. | ||
725 | * Give info on memory requirements for MMU tables and other in-memory | ||
726 | * data structures (globally, per task, base and per page, etc.) - whatever bounds can be calculated. | ||
727 | */ | ||
728 | |||
729 | |||
730 | /* Default vectors: */ | ||
731 | xthal_immu_fetch_miss_vector | ||
732 | xthal_dmmu_load_miss_vector | ||
733 | xthal_dmmu_store_miss_vector | ||
734 | |||
735 | /* Functions called when a fault is detected: */ | ||
736 | typedef void (XtHalMmuFaultFunc)( unsigned vaddr, ...context... ); | ||
737 | /* Or, */ | ||
738 | /* a? = vaddr */ | ||
739 | /* a? = context... */ | ||
740 | /* PS.xxx = xxx */ | ||
741 | XtHalMMuFaultFunc *Xthal_immu_fetch_fault_func; | ||
742 | XtHalMMuFaultFunc *Xthal_dmmu_load_fault_func; | ||
743 | XtHalMMuFaultFunc *Xthal_dmmu_store_fault_func; | ||
744 | |||
745 | /* Default Handlers: */ | ||
746 | /* The user and/or kernel exception handlers may jump to these handlers to handle the relevant exceptions, | ||
747 | * according to the value of EXCCAUSE. The exact register state on entry to these handlers is TBD. */ | ||
748 | /* When multiple TLB entries match (hit) on the same access: */ | ||
749 | xthal_immu_fetch_multihit_handler | ||
750 | xthal_dmmu_load_multihit_handler | ||
751 | xthal_dmmu_store_multihit_handler | ||
752 | /* Protection violations according to cache attributes, and other cache attribute mismatches: */ | ||
753 | xthal_immu_fetch_attr_handler | ||
754 | xthal_dmmu_load_attr_handler | ||
755 | xthal_dmmu_store_attr_handler | ||
756 | /* Protection violations due to insufficient ring level: */ | ||
757 | xthal_immu_fetch_priv_handler | ||
758 | xthal_dmmu_load_priv_handler | ||
759 | xthal_dmmu_store_priv_handler | ||
760 | /* Alignment exception handlers (if supported by the particular Xtensa MMU configuration): */ | ||
761 | xthal_dmmu_load_align_handler | ||
762 | xthal_dmmu_store_align_handler | ||
763 | |||
764 | /* Or, alternatively, the OS user and/or kernel exception handlers may simply jump to the | ||
765 | * following entry points which will handle any values of EXCCAUSE not handled by the OS: */ | ||
766 | xthal_user_exc_default_handler | ||
767 | xthal_kernel_exc_default_handler | ||
768 | |||
769 | #endif /*0*/ | ||
770 | |||
771 | #ifdef INCLUDE_DEPRECATED_HAL_CODE | ||
772 | extern const unsigned char Xthal_have_old_exc_arch; | ||
773 | extern const unsigned char Xthal_have_mmu; | ||
774 | extern const unsigned int Xthal_num_regs; | ||
775 | extern const unsigned char Xthal_num_iroms; | ||
776 | extern const unsigned char Xthal_num_irams; | ||
777 | extern const unsigned char Xthal_num_droms; | ||
778 | extern const unsigned char Xthal_num_drams; | ||
779 | extern const unsigned int Xthal_configid0; | ||
780 | extern const unsigned int Xthal_configid1; | ||
781 | #endif | ||
782 | |||
783 | #ifdef INCLUDE_DEPRECATED_HAL_DEBUG_CODE | ||
784 | #define XTHAL_24_BIT_BREAK 0x80000000 | ||
785 | #define XTHAL_16_BIT_BREAK 0x40000000 | ||
786 | extern const unsigned short Xthal_ill_inst_16[16]; | ||
787 | #define XTHAL_DEST_REG 0xf0000000 /* Mask for destination register */ | ||
788 | #define XTHAL_DEST_REG_INST 0x08000000 /* Branch address is in register */ | ||
789 | #define XTHAL_DEST_REL_INST 0x04000000 /* Branch address is relative */ | ||
790 | #define XTHAL_RFW_INST 0x00000800 | ||
791 | #define XTHAL_RFUE_INST 0x00000400 | ||
792 | #define XTHAL_RFI_INST 0x00000200 | ||
793 | #define XTHAL_RFE_INST 0x00000100 | ||
794 | #define XTHAL_RET_INST 0x00000080 | ||
795 | #define XTHAL_BREAK_INST 0x00000040 | ||
796 | #define XTHAL_SYSCALL_INST 0x00000020 | ||
797 | #define XTHAL_LOOP_END 0x00000010 /* Not set by xthal_inst_type */ | ||
798 | #define XTHAL_JUMP_INST 0x00000008 /* Call or jump instruction */ | ||
799 | #define XTHAL_BRANCH_INST 0x00000004 /* Branch instruction */ | ||
800 | #define XTHAL_24_BIT_INST 0x00000002 | ||
801 | #define XTHAL_16_BIT_INST 0x00000001 | ||
802 | typedef struct xthal_state { | ||
803 | unsigned pc; | ||
804 | unsigned ar[16]; | ||
805 | unsigned lbeg; | ||
806 | unsigned lend; | ||
807 | unsigned lcount; | ||
808 | unsigned extra_ptr; | ||
809 | unsigned cpregs_ptr[XTHAL_MAX_CPS]; | ||
810 | } XTHAL_STATE; | ||
811 | extern unsigned int xthal_inst_type(void *addr); | ||
812 | extern unsigned int xthal_branch_addr(void *addr); | ||
813 | extern unsigned int xthal_get_npc(XTHAL_STATE *user_state); | ||
814 | #endif /* INCLUDE_DEPRECATED_HAL_DEBUG_CODE */ | ||
815 | |||
816 | #ifdef __cplusplus | ||
817 | } | ||
818 | #endif | ||
819 | #endif /*!__ASSEMBLY__ */ | ||
820 | |||
821 | #endif /*XTENSA_HAL_H*/ | ||
822 | |||
diff --git a/include/asm-xtensa/xtensa/simcall.h b/include/asm-xtensa/xtensa/simcall.h deleted file mode 100644 index a2b868929a49..000000000000 --- a/include/asm-xtensa/xtensa/simcall.h +++ /dev/null | |||
@@ -1,130 +0,0 @@ | |||
1 | #ifndef SIMCALL_INCLUDED | ||
2 | #define SIMCALL_INCLUDED | ||
3 | |||
4 | /* | ||
5 | * THIS FILE IS GENERATED -- DO NOT MODIFY BY HAND | ||
6 | * | ||
7 | * include/asm-xtensa/xtensa/simcall.h - Simulator call numbers | ||
8 | * | ||
9 | * This file is subject to the terms and conditions of the GNU General | ||
10 | * Public License. See the file "COPYING" in the main directory of | ||
11 | * this archive for more details. | ||
12 | * | ||
13 | * Copyright (C) 2002 Tensilica Inc. | ||
14 | */ | ||
15 | |||
16 | |||
17 | /* | ||
18 | * System call like services offered by the simulator host. | ||
19 | * These are modeled after the Linux 2.4 kernel system calls | ||
20 | * for Xtensa processors. However not all system calls and | ||
21 | * not all functionality of a given system call are implemented, | ||
22 | * or necessarily have well defined or equivalent semantics in | ||
23 | * the context of a simulation (as opposed to a Unix kernel). | ||
24 | * | ||
25 | * These services behave largely as if they had been invoked | ||
26 | * as a task in the simulator host's operating system | ||
27 | * (eg. files accessed are those of the simulator host). | ||
28 | * However, these SIMCALLs model a virtual operating system | ||
29 | * so that various definitions, bit assignments etc | ||
30 | * (eg. open mode bits, errno values, etc) are independent | ||
31 | * of the host operating system used to run the simulation. | ||
32 | * Rather these definitions are specific to the Xtensa ISS. | ||
33 | * This way Xtensa ISA code written to use these SIMCALLs | ||
34 | * can (in principle) be simulated on any host. | ||
35 | * | ||
36 | * Up to 6 parameters are passed in registers a3 to a8 | ||
37 | * (note the 6th parameter isn't passed on the stack, | ||
38 | * unlike windowed function calling conventions). | ||
39 | * The return value is in a2. A negative value in the | ||
40 | * range -4096 to -1 indicates a negated error code to be | ||
41 | * reported in errno with a return value of -1, otherwise | ||
42 | * the value in a2 is returned as is. | ||
43 | */ | ||
44 | |||
45 | /* These #defines need to match what's in Xtensa/OS/vxworks/xtiss/simcalls.c */ | ||
46 | |||
47 | #define SYS_nop 0 /* n/a - setup; used to flush register windows */ | ||
48 | #define SYS_exit 1 /*x*/ | ||
49 | #define SYS_fork 2 | ||
50 | #define SYS_read 3 /*x*/ | ||
51 | #define SYS_write 4 /*x*/ | ||
52 | #define SYS_open 5 /*x*/ | ||
53 | #define SYS_close 6 /*x*/ | ||
54 | #define SYS_rename 7 /*x 38 - waitpid */ | ||
55 | #define SYS_creat 8 /*x*/ | ||
56 | #define SYS_link 9 /*x (not implemented on WIN32) */ | ||
57 | #define SYS_unlink 10 /*x*/ | ||
58 | #define SYS_execv 11 /* n/a - execve */ | ||
59 | #define SYS_execve 12 /* 11 - chdir */ | ||
60 | #define SYS_pipe 13 /* 42 - time */ | ||
61 | #define SYS_stat 14 /* 106 - mknod */ | ||
62 | #define SYS_chmod 15 | ||
63 | #define SYS_chown 16 /* 202 - lchown */ | ||
64 | #define SYS_utime 17 /* 30 - break */ | ||
65 | #define SYS_wait 18 /* n/a - oldstat */ | ||
66 | #define SYS_lseek 19 /*x*/ | ||
67 | #define SYS_getpid 20 | ||
68 | #define SYS_isatty 21 /* n/a - mount */ | ||
69 | #define SYS_fstat 22 /* 108 - oldumount */ | ||
70 | #define SYS_time 23 /* 13 - setuid */ | ||
71 | #define SYS_gettimeofday 24 /*x 78 - getuid (not implemented on WIN32) */ | ||
72 | #define SYS_times 25 /*X 43 - stime (Xtensa-specific implementation) */ | ||
73 | #define SYS_socket 26 | ||
74 | #define SYS_sendto 27 | ||
75 | #define SYS_recvfrom 28 | ||
76 | #define SYS_select_one 29 /* not compitible select, one file descriptor at the time */ | ||
77 | #define SYS_bind 30 | ||
78 | #define SYS_ioctl 31 | ||
79 | |||
80 | /* | ||
81 | * Other... | ||
82 | */ | ||
83 | #define SYS_iss_argc 1000 /* returns value of argc */ | ||
84 | #define SYS_iss_argv_size 1001 /* bytes needed for argv & arg strings */ | ||
85 | #define SYS_iss_set_argv 1002 /* saves argv & arg strings at given addr */ | ||
86 | |||
87 | /* | ||
88 | * SIMCALLs for the ferret memory debugger. All are invoked by | ||
89 | * libferret.a ... ( Xtensa/Target-Libs/ferret ) | ||
90 | */ | ||
91 | #define SYS_ferret 1010 | ||
92 | #define SYS_malloc 1011 | ||
93 | #define SYS_free 1012 | ||
94 | #define SYS_more_heap 1013 | ||
95 | #define SYS_no_heap 1014 | ||
96 | |||
97 | |||
98 | /* | ||
99 | * Extra SIMCALLs for GDB: | ||
100 | */ | ||
101 | #define SYS_gdb_break -1 /* invoked by XTOS on user exceptions if EPC points | ||
102 | to a break.n/break, regardless of cause! */ | ||
103 | #define SYS_xmon_out -2 /* invoked by XMON: ... */ | ||
104 | #define SYS_xmon_in -3 /* invoked by XMON: ... */ | ||
105 | #define SYS_xmon_flush -4 /* invoked by XMON: ... */ | ||
106 | #define SYS_gdb_abort -5 /* invoked by XTOS in _xtos_panic() */ | ||
107 | #define SYS_gdb_illegal_inst -6 /* invoked by XTOS for illegal instructions (too deeply) */ | ||
108 | #define SYS_xmon_init -7 /* invoked by XMON: ... */ | ||
109 | #define SYS_gdb_enter_sktloop -8 /* invoked by XTOS on debug exceptions */ | ||
110 | |||
111 | /* | ||
112 | * SIMCALLs for vxWorks xtiss BSP: | ||
113 | */ | ||
114 | #define SYS_setup_ppp_pipes -83 | ||
115 | #define SYS_log_msg -84 | ||
116 | |||
117 | /* | ||
118 | * Test SIMCALLs: | ||
119 | */ | ||
120 | #define SYS_test_write_state -100 | ||
121 | #define SYS_test_read_state -101 | ||
122 | |||
123 | /* | ||
124 | * SYS_select_one specifiers | ||
125 | */ | ||
126 | #define XTISS_SELECT_ONE_READ 1 | ||
127 | #define XTISS_SELECT_ONE_WRITE 2 | ||
128 | #define XTISS_SELECT_ONE_EXCEPT 3 | ||
129 | |||
130 | #endif /* !SIMCALL_INCLUDED */ | ||
diff --git a/include/asm-xtensa/xtensa/xt2000-uart.h b/include/asm-xtensa/xtensa/xt2000-uart.h deleted file mode 100644 index 0154460f0ed8..000000000000 --- a/include/asm-xtensa/xtensa/xt2000-uart.h +++ /dev/null | |||
@@ -1,155 +0,0 @@ | |||
1 | #ifndef _uart_h_included_ | ||
2 | #define _uart_h_included_ | ||
3 | |||
4 | /* | ||
5 | * THIS FILE IS GENERATED -- DO NOT MODIFY BY HAND | ||
6 | * | ||
7 | * include/asm-xtensa/xtensa/xt2000-uart.h -- NatSemi PC16552D DUART | ||
8 | * definitions | ||
9 | * | ||
10 | * This file is subject to the terms and conditions of the GNU General Public | ||
11 | * License. See the file "COPYING" in the main directory of this archive | ||
12 | * for more details. | ||
13 | * | ||
14 | * Copyright (C) 2002 Tensilica Inc. | ||
15 | */ | ||
16 | |||
17 | |||
18 | #include <xtensa/xt2000.h> | ||
19 | |||
20 | |||
21 | /* 16550 UART DEVICE REGISTERS | ||
22 | The XT2000 board aligns each register to a 32-bit word but the UART device only uses | ||
23 | one byte of the word, which is the least-significant byte regardless of the | ||
24 | endianness of the core (ie. byte offset 0 for little-endian and 3 for big-endian). | ||
25 | So if using word accesses then endianness doesn't matter. | ||
26 | The macros provided here do that. | ||
27 | */ | ||
28 | struct uart_dev_s { | ||
29 | union { | ||
30 | unsigned int rxb; /* DLAB=0: receive buffer, read-only */ | ||
31 | unsigned int txb; /* DLAB=0: transmit buffer, write-only */ | ||
32 | unsigned int dll; /* DLAB=1: divisor, least-significant byte latch (was write-only?) */ | ||
33 | } w0; | ||
34 | union { | ||
35 | unsigned int ier; /* DLAB=0: interrupt-enable register (was write-only?) */ | ||
36 | unsigned int dlm; /* DLAB=1: divisor, most-significant byte latch (was write-only?) */ | ||
37 | } w1; | ||
38 | |||
39 | union { | ||
40 | unsigned int isr; /* DLAB=0: interrupt status register, read-only */ | ||
41 | unsigned int fcr; /* DLAB=0: FIFO control register, write-only */ | ||
42 | unsigned int afr; /* DLAB=1: alternate function register */ | ||
43 | } w2; | ||
44 | |||
45 | unsigned int lcr; /* line control-register, write-only */ | ||
46 | unsigned int mcr; /* modem control-regsiter, write-only */ | ||
47 | unsigned int lsr; /* line status register, read-only */ | ||
48 | unsigned int msr; /* modem status register, read-only */ | ||
49 | unsigned int scr; /* scratch regsiter, read/write */ | ||
50 | }; | ||
51 | |||
52 | #define _RXB(u) ((u)->w0.rxb) | ||
53 | #define _TXB(u) ((u)->w0.txb) | ||
54 | #define _DLL(u) ((u)->w0.dll) | ||
55 | #define _IER(u) ((u)->w1.ier) | ||
56 | #define _DLM(u) ((u)->w1.dlm) | ||
57 | #define _ISR(u) ((u)->w2.isr) | ||
58 | #define _FCR(u) ((u)->w2.fcr) | ||
59 | #define _AFR(u) ((u)->w2.afr) | ||
60 | #define _LCR(u) ((u)->lcr) | ||
61 | #define _MCR(u) ((u)->mcr) | ||
62 | #define _LSR(u) ((u)->lsr) | ||
63 | #define _MSR(u) ((u)->msr) | ||
64 | #define _SCR(u) ((u)->scr) | ||
65 | |||
66 | typedef volatile struct uart_dev_s uart_dev_t; | ||
67 | |||
68 | /* IER bits */ | ||
69 | #define RCVR_DATA_REG_INTENABLE 0x01 | ||
70 | #define XMIT_HOLD_REG_INTENABLE 0x02 | ||
71 | #define RCVR_STATUS_INTENABLE 0x04 | ||
72 | #define MODEM_STATUS_INTENABLE 0x08 | ||
73 | |||
74 | /* FCR bits */ | ||
75 | #define _FIFO_ENABLE 0x01 | ||
76 | #define RCVR_FIFO_RESET 0x02 | ||
77 | #define XMIT_FIFO_RESET 0x04 | ||
78 | #define DMA_MODE_SELECT 0x08 | ||
79 | #define RCVR_TRIGGER_LSB 0x40 | ||
80 | #define RCVR_TRIGGER_MSB 0x80 | ||
81 | |||
82 | /* AFR bits */ | ||
83 | #define AFR_CONC_WRITE 0x01 | ||
84 | #define AFR_BAUDOUT_SEL 0x02 | ||
85 | #define AFR_RXRDY_SEL 0x04 | ||
86 | |||
87 | /* ISR bits */ | ||
88 | #define INT_STATUS(r) ((r)&1) | ||
89 | #define INT_PRIORITY(r) (((r)>>1)&0x7) | ||
90 | |||
91 | /* LCR bits */ | ||
92 | #define WORD_LENGTH(n) (((n)-5)&0x3) | ||
93 | #define STOP_BIT_ENABLE 0x04 | ||
94 | #define PARITY_ENABLE 0x08 | ||
95 | #define EVEN_PARITY 0x10 | ||
96 | #define FORCE_PARITY 0x20 | ||
97 | #define XMIT_BREAK 0x40 | ||
98 | #define DLAB_ENABLE 0x80 | ||
99 | |||
100 | /* MCR bits */ | ||
101 | #define _DTR 0x01 | ||
102 | #define _RTS 0x02 | ||
103 | #define _OP1 0x04 | ||
104 | #define _OP2 0x08 | ||
105 | #define LOOP_BACK 0x10 | ||
106 | |||
107 | /* LSR Bits */ | ||
108 | #define RCVR_DATA_READY 0x01 | ||
109 | #define OVERRUN_ERROR 0x02 | ||
110 | #define PARITY_ERROR 0x04 | ||
111 | #define FRAMING_ERROR 0x08 | ||
112 | #define BREAK_INTERRUPT 0x10 | ||
113 | #define XMIT_HOLD_EMPTY 0x20 | ||
114 | #define XMIT_EMPTY 0x40 | ||
115 | #define FIFO_ERROR 0x80 | ||
116 | #define RCVR_READY(u) (_LSR(u)&RCVR_DATA_READY) | ||
117 | #define XMIT_READY(u) (_LSR(u)&XMIT_HOLD_EMPTY) | ||
118 | |||
119 | /* MSR bits */ | ||
120 | #define _RDR 0x01 | ||
121 | #define DELTA_DSR 0x02 | ||
122 | #define DELTA_RI 0x04 | ||
123 | #define DELTA_CD 0x08 | ||
124 | #define _CTS 0x10 | ||
125 | #define _DSR 0x20 | ||
126 | #define _RI 0x40 | ||
127 | #define _CD 0x80 | ||
128 | |||
129 | /* prototypes */ | ||
130 | void uart_init( uart_dev_t *u, int bitrate ); | ||
131 | void uart_out( uart_dev_t *u, char c ); | ||
132 | void uart_puts( uart_dev_t *u, char *s ); | ||
133 | char uart_in( uart_dev_t *u ); | ||
134 | void uart_enable_rcvr_int( uart_dev_t *u ); | ||
135 | void uart_disable_rcvr_int( uart_dev_t *u ); | ||
136 | |||
137 | #ifdef DUART16552_1_VADDR | ||
138 | /* DUART present. */ | ||
139 | #define DUART_1_BASE (*(uart_dev_t*)DUART16552_1_VADDR) | ||
140 | #define DUART_2_BASE (*(uart_dev_t*)DUART16552_2_VADDR) | ||
141 | #define UART1_PUTS(s) uart_puts( &DUART_1_BASE, s ) | ||
142 | #define UART2_PUTS(s) uart_puts( &DUART_2_BASE, s ) | ||
143 | #else | ||
144 | /* DUART not configured, use dummy placeholders to allow compiles to work. */ | ||
145 | #define DUART_1_BASE (*(uart_dev_t*)0) | ||
146 | #define DUART_2_BASE (*(uart_dev_t*)0) | ||
147 | #define UART1_PUTS(s) | ||
148 | #define UART2_PUTS(s) | ||
149 | #endif | ||
150 | |||
151 | /* Compute 16-bit divisor for baudrate generator, with rounding: */ | ||
152 | #define DUART_DIVISOR(crystal,speed) (((crystal)/16 + (speed)/2)/(speed)) | ||
153 | |||
154 | #endif /*_uart_h_included_*/ | ||
155 | |||
diff --git a/include/asm-xtensa/xtensa/xt2000.h b/include/asm-xtensa/xtensa/xt2000.h deleted file mode 100644 index 703a45002f8f..000000000000 --- a/include/asm-xtensa/xtensa/xt2000.h +++ /dev/null | |||
@@ -1,408 +0,0 @@ | |||
1 | #ifndef _INC_XT2000_H_ | ||
2 | #define _INC_XT2000_H_ | ||
3 | |||
4 | /* | ||
5 | * THIS FILE IS GENERATED -- DO NOT MODIFY BY HAND | ||
6 | * | ||
7 | * include/asm-xtensa/xtensa/xt2000.h - Definitions specific to the | ||
8 | * Tensilica XT2000 Emulation Board | ||
9 | * | ||
10 | * This file is subject to the terms and conditions of the GNU General Public | ||
11 | * License. See the file "COPYING" in the main directory of this archive | ||
12 | * for more details. | ||
13 | * | ||
14 | * Copyright (C) 2002 Tensilica Inc. | ||
15 | */ | ||
16 | |||
17 | |||
18 | #include <xtensa/config/core.h> | ||
19 | #include <xtensa/config/system.h> | ||
20 | |||
21 | |||
22 | /* | ||
23 | * Default assignment of XT2000 devices to external interrupts. | ||
24 | */ | ||
25 | |||
26 | /* Ethernet interrupt: */ | ||
27 | #ifdef XCHAL_EXTINT3_NUM | ||
28 | #define SONIC83934_INTNUM XCHAL_EXTINT3_NUM | ||
29 | #define SONIC83934_INTLEVEL XCHAL_EXTINT3_LEVEL | ||
30 | #define SONIC83934_INTMASK XCHAL_EXTINT3_MASK | ||
31 | #else | ||
32 | #define SONIC83934_INTMASK 0 | ||
33 | #endif | ||
34 | |||
35 | /* DUART channel 1 interrupt (P1 - console): */ | ||
36 | #ifdef XCHAL_EXTINT4_NUM | ||
37 | #define DUART16552_1_INTNUM XCHAL_EXTINT4_NUM | ||
38 | #define DUART16552_1_INTLEVEL XCHAL_EXTINT4_LEVEL | ||
39 | #define DUART16552_1_INTMASK XCHAL_EXTINT4_MASK | ||
40 | #else | ||
41 | #define DUART16552_1_INTMASK 0 | ||
42 | #endif | ||
43 | |||
44 | /* DUART channel 2 interrupt (P2 - 2nd serial port): */ | ||
45 | #ifdef XCHAL_EXTINT5_NUM | ||
46 | #define DUART16552_2_INTNUM XCHAL_EXTINT5_NUM | ||
47 | #define DUART16552_2_INTLEVEL XCHAL_EXTINT5_LEVEL | ||
48 | #define DUART16552_2_INTMASK XCHAL_EXTINT5_MASK | ||
49 | #else | ||
50 | #define DUART16552_2_INTMASK 0 | ||
51 | #endif | ||
52 | |||
53 | /* FPGA-combined PCI/etc interrupts: */ | ||
54 | #ifdef XCHAL_EXTINT6_NUM | ||
55 | #define XT2000_FPGAPCI_INTNUM XCHAL_EXTINT6_NUM | ||
56 | #define XT2000_FPGAPCI_INTLEVEL XCHAL_EXTINT6_LEVEL | ||
57 | #define XT2000_FPGAPCI_INTMASK XCHAL_EXTINT6_MASK | ||
58 | #else | ||
59 | #define XT2000_FPGAPCI_INTMASK 0 | ||
60 | #endif | ||
61 | |||
62 | |||
63 | |||
64 | /* | ||
65 | * Device addresses. | ||
66 | * | ||
67 | * Note: for endianness-independence, use 32-bit loads and stores for all | ||
68 | * register accesses to Ethernet, DUART and LED devices. Undefined bits | ||
69 | * may need to be masked out if needed when reading if the actual register | ||
70 | * size is smaller than 32 bits. | ||
71 | * | ||
72 | * Note: XT2000 bus byte lanes are defined in terms of msbyte and lsbyte | ||
73 | * relative to the processor. So 32-bit registers are accessed consistently | ||
74 | * from both big and little endian processors. However, this means byte | ||
75 | * sequences are not consistent between big and little endian processors. | ||
76 | * This is fine for RAM, and for ROM if ROM is created for a specific | ||
77 | * processor (and thus has correct byte sequences). However this may be | ||
78 | * unexpected for Flash, which might contain a file-system that one wants | ||
79 | * to use for multiple processor configurations (eg. the Flash might contain | ||
80 | * the Ethernet card's address, endianness-independent application data, etc). | ||
81 | * That is, byte sequences written in Flash by a core of a given endianness | ||
82 | * will be byte-swapped when seen by a core of the other endianness. | ||
83 | * Someone implementing an endianness-independent Flash file system will | ||
84 | * likely handle this byte-swapping issue in the Flash driver software. | ||
85 | */ | ||
86 | |||
87 | #define DUART16552_XTAL_FREQ 18432000 /* crystal frequency in Hz */ | ||
88 | #define XTBOARD_FLASH_MAXSIZE 0x4000000 /* 64 MB (max; depends on what is socketed!) */ | ||
89 | #define XTBOARD_EPROM_MAXSIZE 0x0400000 /* 4 MB (max; depends on what is socketed!) */ | ||
90 | #define XTBOARD_EEPROM_MAXSIZE 0x0080000 /* 512 kB (max; depends on what is socketed!) */ | ||
91 | #define XTBOARD_ASRAM_SIZE 0x0100000 /* 1 MB */ | ||
92 | #define XTBOARD_PCI_MEM_SIZE 0x8000000 /* 128 MB (allocated) */ | ||
93 | #define XTBOARD_PCI_IO_SIZE 0x1000000 /* 16 MB (allocated) */ | ||
94 | |||
95 | #ifdef XSHAL_IOBLOCK_BYPASS_PADDR | ||
96 | /* PCI memory space: */ | ||
97 | # define XTBOARD_PCI_MEM_PADDR (XSHAL_IOBLOCK_BYPASS_PADDR+0x0000000) | ||
98 | /* Socketed Flash (eg. 2 x 16-bit devices): */ | ||
99 | # define XTBOARD_FLASH_PADDR (XSHAL_IOBLOCK_BYPASS_PADDR+0x8000000) | ||
100 | /* PCI I/O space: */ | ||
101 | # define XTBOARD_PCI_IO_PADDR (XSHAL_IOBLOCK_BYPASS_PADDR+0xC000000) | ||
102 | /* V3 PCI interface chip register/config space: */ | ||
103 | # define XTBOARD_V3PCI_PADDR (XSHAL_IOBLOCK_BYPASS_PADDR+0xD000000) | ||
104 | /* Bus Interface registers: */ | ||
105 | # define XTBOARD_BUSINT_PADDR (XSHAL_IOBLOCK_BYPASS_PADDR+0xD010000) | ||
106 | /* FPGA registers: */ | ||
107 | # define XT2000_FPGAREGS_PADDR (XSHAL_IOBLOCK_BYPASS_PADDR+0xD020000) | ||
108 | /* SONIC SN83934 Ethernet controller/transceiver: */ | ||
109 | # define SONIC83934_PADDR (XSHAL_IOBLOCK_BYPASS_PADDR+0xD030000) | ||
110 | /* 8-character bitmapped LED display: */ | ||
111 | # define XTBOARD_LED_PADDR (XSHAL_IOBLOCK_BYPASS_PADDR+0xD040000) | ||
112 | /* National-Semi PC16552D DUART: */ | ||
113 | # define DUART16552_1_PADDR (XSHAL_IOBLOCK_BYPASS_PADDR+0xD050020) /* channel 1 (P1 - console) */ | ||
114 | # define DUART16552_2_PADDR (XSHAL_IOBLOCK_BYPASS_PADDR+0xD050000) /* channel 2 (P2) */ | ||
115 | /* Asynchronous Static RAM: */ | ||
116 | # define XTBOARD_ASRAM_PADDR (XSHAL_IOBLOCK_BYPASS_PADDR+0xD400000) | ||
117 | /* 8-bit EEPROM: */ | ||
118 | # define XTBOARD_EEPROM_PADDR (XSHAL_IOBLOCK_BYPASS_PADDR+0xD600000) | ||
119 | /* 2 x 16-bit EPROMs: */ | ||
120 | # define XTBOARD_EPROM_PADDR (XSHAL_IOBLOCK_BYPASS_PADDR+0xD800000) | ||
121 | #endif /* XSHAL_IOBLOCK_BYPASS_PADDR */ | ||
122 | |||
123 | /* These devices might be accessed cached: */ | ||
124 | #ifdef XSHAL_IOBLOCK_CACHED_PADDR | ||
125 | # define XTBOARD_PCI_MEM_CACHED_PADDR (XSHAL_IOBLOCK_CACHED_PADDR+0x0000000) | ||
126 | # define XTBOARD_FLASH_CACHED_PADDR (XSHAL_IOBLOCK_CACHED_PADDR+0x8000000) | ||
127 | # define XTBOARD_ASRAM_CACHED_PADDR (XSHAL_IOBLOCK_CACHED_PADDR+0xD400000) | ||
128 | # define XTBOARD_EEPROM_CACHED_PADDR (XSHAL_IOBLOCK_CACHED_PADDR+0xD600000) | ||
129 | # define XTBOARD_EPROM_CACHED_PADDR (XSHAL_IOBLOCK_CACHED_PADDR+0xD800000) | ||
130 | #endif /* XSHAL_IOBLOCK_CACHED_PADDR */ | ||
131 | |||
132 | |||
133 | /*** Same thing over again, this time with virtual addresses: ***/ | ||
134 | |||
135 | #ifdef XSHAL_IOBLOCK_BYPASS_VADDR | ||
136 | /* PCI memory space: */ | ||
137 | # define XTBOARD_PCI_MEM_VADDR (XSHAL_IOBLOCK_BYPASS_VADDR+0x0000000) | ||
138 | /* Socketed Flash (eg. 2 x 16-bit devices): */ | ||
139 | # define XTBOARD_FLASH_VADDR (XSHAL_IOBLOCK_BYPASS_VADDR+0x8000000) | ||
140 | /* PCI I/O space: */ | ||
141 | # define XTBOARD_PCI_IO_VADDR (XSHAL_IOBLOCK_BYPASS_VADDR+0xC000000) | ||
142 | /* V3 PCI interface chip register/config space: */ | ||
143 | # define XTBOARD_V3PCI_VADDR (XSHAL_IOBLOCK_BYPASS_VADDR+0xD000000) | ||
144 | /* Bus Interface registers: */ | ||
145 | # define XTBOARD_BUSINT_VADDR (XSHAL_IOBLOCK_BYPASS_VADDR+0xD010000) | ||
146 | /* FPGA registers: */ | ||
147 | # define XT2000_FPGAREGS_VADDR (XSHAL_IOBLOCK_BYPASS_VADDR+0xD020000) | ||
148 | /* SONIC SN83934 Ethernet controller/transceiver: */ | ||
149 | # define SONIC83934_VADDR (XSHAL_IOBLOCK_BYPASS_VADDR+0xD030000) | ||
150 | /* 8-character bitmapped LED display: */ | ||
151 | # define XTBOARD_LED_VADDR (XSHAL_IOBLOCK_BYPASS_VADDR+0xD040000) | ||
152 | /* National-Semi PC16552D DUART: */ | ||
153 | # define DUART16552_1_VADDR (XSHAL_IOBLOCK_BYPASS_VADDR+0xD050020) /* channel 1 (P1 - console) */ | ||
154 | # define DUART16552_2_VADDR (XSHAL_IOBLOCK_BYPASS_VADDR+0xD050000) /* channel 2 (P2) */ | ||
155 | /* Asynchronous Static RAM: */ | ||
156 | # define XTBOARD_ASRAM_VADDR (XSHAL_IOBLOCK_BYPASS_VADDR+0xD400000) | ||
157 | /* 8-bit EEPROM: */ | ||
158 | # define XTBOARD_EEPROM_VADDR (XSHAL_IOBLOCK_BYPASS_VADDR+0xD600000) | ||
159 | /* 2 x 16-bit EPROMs: */ | ||
160 | # define XTBOARD_EPROM_VADDR (XSHAL_IOBLOCK_BYPASS_VADDR+0xD800000) | ||
161 | #endif /* XSHAL_IOBLOCK_BYPASS_VADDR */ | ||
162 | |||
163 | /* These devices might be accessed cached: */ | ||
164 | #ifdef XSHAL_IOBLOCK_CACHED_VADDR | ||
165 | # define XTBOARD_PCI_MEM_CACHED_VADDR (XSHAL_IOBLOCK_CACHED_VADDR+0x0000000) | ||
166 | # define XTBOARD_FLASH_CACHED_VADDR (XSHAL_IOBLOCK_CACHED_VADDR+0x8000000) | ||
167 | # define XTBOARD_ASRAM_CACHED_VADDR (XSHAL_IOBLOCK_CACHED_VADDR+0xD400000) | ||
168 | # define XTBOARD_EEPROM_CACHED_VADDR (XSHAL_IOBLOCK_CACHED_VADDR+0xD600000) | ||
169 | # define XTBOARD_EPROM_CACHED_VADDR (XSHAL_IOBLOCK_CACHED_VADDR+0xD800000) | ||
170 | #endif /* XSHAL_IOBLOCK_CACHED_VADDR */ | ||
171 | |||
172 | |||
173 | /* System ROM: */ | ||
174 | #define XTBOARD_ROM_SIZE XSHAL_ROM_SIZE | ||
175 | #ifdef XSHAL_ROM_VADDR | ||
176 | #define XTBOARD_ROM_VADDR XSHAL_ROM_VADDR | ||
177 | #endif | ||
178 | #ifdef XSHAL_ROM_PADDR | ||
179 | #define XTBOARD_ROM_PADDR XSHAL_ROM_PADDR | ||
180 | #endif | ||
181 | |||
182 | /* System RAM: */ | ||
183 | #define XTBOARD_RAM_SIZE XSHAL_RAM_SIZE | ||
184 | #ifdef XSHAL_RAM_VADDR | ||
185 | #define XTBOARD_RAM_VADDR XSHAL_RAM_VADDR | ||
186 | #endif | ||
187 | #ifdef XSHAL_RAM_PADDR | ||
188 | #define XTBOARD_RAM_PADDR XSHAL_RAM_PADDR | ||
189 | #endif | ||
190 | #define XTBOARD_RAM_BYPASS_VADDR XSHAL_RAM_BYPASS_VADDR | ||
191 | #define XTBOARD_RAM_BYPASS_PADDR XSHAL_RAM_BYPASS_PADDR | ||
192 | |||
193 | |||
194 | |||
195 | /* | ||
196 | * Things that depend on device addresses. | ||
197 | */ | ||
198 | |||
199 | |||
200 | #define XTBOARD_CACHEATTR_WRITEBACK XSHAL_XT2000_CACHEATTR_WRITEBACK | ||
201 | #define XTBOARD_CACHEATTR_WRITEALLOC XSHAL_XT2000_CACHEATTR_WRITEALLOC | ||
202 | #define XTBOARD_CACHEATTR_WRITETHRU XSHAL_XT2000_CACHEATTR_WRITETHRU | ||
203 | #define XTBOARD_CACHEATTR_BYPASS XSHAL_XT2000_CACHEATTR_BYPASS | ||
204 | #define XTBOARD_CACHEATTR_DEFAULT XSHAL_XT2000_CACHEATTR_DEFAULT | ||
205 | |||
206 | #define XTBOARD_BUSINT_PIPE_REGIONS XSHAL_XT2000_PIPE_REGIONS | ||
207 | #define XTBOARD_BUSINT_SDRAM_REGIONS XSHAL_XT2000_SDRAM_REGIONS | ||
208 | |||
209 | |||
210 | |||
211 | /* | ||
212 | * BusLogic (FPGA) registers. | ||
213 | * All these registers are normally accessed using 32-bit loads/stores. | ||
214 | */ | ||
215 | |||
216 | /* Register offsets: */ | ||
217 | #define XT2000_DATECD_OFS 0x00 /* date code (read-only) */ | ||
218 | #define XT2000_STSREG_OFS 0x04 /* status (read-only) */ | ||
219 | #define XT2000_SYSLED_OFS 0x08 /* system LED */ | ||
220 | #define XT2000_WRPROT_OFS 0x0C /* write protect */ | ||
221 | #define XT2000_SWRST_OFS 0x10 /* software reset */ | ||
222 | #define XT2000_SYSRST_OFS 0x14 /* system (peripherals) reset */ | ||
223 | #define XT2000_IMASK_OFS 0x18 /* interrupt mask */ | ||
224 | #define XT2000_ISTAT_OFS 0x1C /* interrupt status */ | ||
225 | #define XT2000_V3CFG_OFS 0x20 /* V3 config (V320 PCI) */ | ||
226 | |||
227 | /* Physical register addresses: */ | ||
228 | #ifdef XT2000_FPGAREGS_PADDR | ||
229 | #define XT2000_DATECD_PADDR (XT2000_FPGAREGS_PADDR+XT2000_DATECD_OFS) | ||
230 | #define XT2000_STSREG_PADDR (XT2000_FPGAREGS_PADDR+XT2000_STSREG_OFS) | ||
231 | #define XT2000_SYSLED_PADDR (XT2000_FPGAREGS_PADDR+XT2000_SYSLED_OFS) | ||
232 | #define XT2000_WRPROT_PADDR (XT2000_FPGAREGS_PADDR+XT2000_WRPROT_OFS) | ||
233 | #define XT2000_SWRST_PADDR (XT2000_FPGAREGS_PADDR+XT2000_SWRST_OFS) | ||
234 | #define XT2000_SYSRST_PADDR (XT2000_FPGAREGS_PADDR+XT2000_SYSRST_OFS) | ||
235 | #define XT2000_IMASK_PADDR (XT2000_FPGAREGS_PADDR+XT2000_IMASK_OFS) | ||
236 | #define XT2000_ISTAT_PADDR (XT2000_FPGAREGS_PADDR+XT2000_ISTAT_OFS) | ||
237 | #define XT2000_V3CFG_PADDR (XT2000_FPGAREGS_PADDR+XT2000_V3CFG_OFS) | ||
238 | #endif | ||
239 | |||
240 | /* Virtual register addresses: */ | ||
241 | #ifdef XT2000_FPGAREGS_VADDR | ||
242 | #define XT2000_DATECD_VADDR (XT2000_FPGAREGS_VADDR+XT2000_DATECD_OFS) | ||
243 | #define XT2000_STSREG_VADDR (XT2000_FPGAREGS_VADDR+XT2000_STSREG_OFS) | ||
244 | #define XT2000_SYSLED_VADDR (XT2000_FPGAREGS_VADDR+XT2000_SYSLED_OFS) | ||
245 | #define XT2000_WRPROT_VADDR (XT2000_FPGAREGS_VADDR+XT2000_WRPROT_OFS) | ||
246 | #define XT2000_SWRST_VADDR (XT2000_FPGAREGS_VADDR+XT2000_SWRST_OFS) | ||
247 | #define XT2000_SYSRST_VADDR (XT2000_FPGAREGS_VADDR+XT2000_SYSRST_OFS) | ||
248 | #define XT2000_IMASK_VADDR (XT2000_FPGAREGS_VADDR+XT2000_IMASK_OFS) | ||
249 | #define XT2000_ISTAT_VADDR (XT2000_FPGAREGS_VADDR+XT2000_ISTAT_OFS) | ||
250 | #define XT2000_V3CFG_VADDR (XT2000_FPGAREGS_VADDR+XT2000_V3CFG_OFS) | ||
251 | /* Register access (for C code): */ | ||
252 | #define XT2000_DATECD_REG (*(volatile unsigned*) XT2000_DATECD_VADDR) | ||
253 | #define XT2000_STSREG_REG (*(volatile unsigned*) XT2000_STSREG_VADDR) | ||
254 | #define XT2000_SYSLED_REG (*(volatile unsigned*) XT2000_SYSLED_VADDR) | ||
255 | #define XT2000_WRPROT_REG (*(volatile unsigned*) XT2000_WRPROT_VADDR) | ||
256 | #define XT2000_SWRST_REG (*(volatile unsigned*) XT2000_SWRST_VADDR) | ||
257 | #define XT2000_SYSRST_REG (*(volatile unsigned*) XT2000_SYSRST_VADDR) | ||
258 | #define XT2000_IMASK_REG (*(volatile unsigned*) XT2000_IMASK_VADDR) | ||
259 | #define XT2000_ISTAT_REG (*(volatile unsigned*) XT2000_ISTAT_VADDR) | ||
260 | #define XT2000_V3CFG_REG (*(volatile unsigned*) XT2000_V3CFG_VADDR) | ||
261 | #endif | ||
262 | |||
263 | /* DATECD (date code) bit fields: */ | ||
264 | |||
265 | /* BCD-coded month (01..12): */ | ||
266 | #define XT2000_DATECD_MONTH_SHIFT 24 | ||
267 | #define XT2000_DATECD_MONTH_BITS 8 | ||
268 | #define XT2000_DATECD_MONTH_MASK 0xFF000000 | ||
269 | /* BCD-coded day (01..31): */ | ||
270 | #define XT2000_DATECD_DAY_SHIFT 16 | ||
271 | #define XT2000_DATECD_DAY_BITS 8 | ||
272 | #define XT2000_DATECD_DAY_MASK 0x00FF0000 | ||
273 | /* BCD-coded year (2001..9999): */ | ||
274 | #define XT2000_DATECD_YEAR_SHIFT 0 | ||
275 | #define XT2000_DATECD_YEAR_BITS 16 | ||
276 | #define XT2000_DATECD_YEAR_MASK 0x0000FFFF | ||
277 | |||
278 | /* STSREG (status) bit fields: */ | ||
279 | |||
280 | /* Switch SW3 setting bit fields (0=off/up, 1=on/down): */ | ||
281 | #define XT2000_STSREG_SW3_SHIFT 0 | ||
282 | #define XT2000_STSREG_SW3_BITS 4 | ||
283 | #define XT2000_STSREG_SW3_MASK 0x0000000F | ||
284 | /* Boot-select bits of switch SW3: */ | ||
285 | #define XT2000_STSREG_BOOTSEL_SHIFT 0 | ||
286 | #define XT2000_STSREG_BOOTSEL_BITS 2 | ||
287 | #define XT2000_STSREG_BOOTSEL_MASK 0x00000003 | ||
288 | /* Boot-select values: */ | ||
289 | #define XT2000_STSREG_BOOTSEL_FLASH 0 | ||
290 | #define XT2000_STSREG_BOOTSEL_EPROM16 1 | ||
291 | #define XT2000_STSREG_BOOTSEL_PROM8 2 | ||
292 | #define XT2000_STSREG_BOOTSEL_ASRAM 3 | ||
293 | /* User-defined bits of switch SW3: */ | ||
294 | #define XT2000_STSREG_SW3_2_SHIFT 2 | ||
295 | #define XT2000_STSREG_SW3_2_MASK 0x00000004 | ||
296 | #define XT2000_STSREG_SW3_3_SHIFT 3 | ||
297 | #define XT2000_STSREG_SW3_3_MASK 0x00000008 | ||
298 | |||
299 | /* SYSLED (system LED) bit fields: */ | ||
300 | |||
301 | /* LED control bit (0=off, 1=on): */ | ||
302 | #define XT2000_SYSLED_LEDON_SHIFT 0 | ||
303 | #define XT2000_SYSLED_LEDON_MASK 0x00000001 | ||
304 | |||
305 | /* WRPROT (write protect) bit fields (0=writable, 1=write-protected [default]): */ | ||
306 | |||
307 | /* Flash write protect: */ | ||
308 | #define XT2000_WRPROT_FLWP_SHIFT 0 | ||
309 | #define XT2000_WRPROT_FLWP_MASK 0x00000001 | ||
310 | /* Reserved but present write protect bits: */ | ||
311 | #define XT2000_WRPROT_WRP_SHIFT 1 | ||
312 | #define XT2000_WRPROT_WRP_BITS 7 | ||
313 | #define XT2000_WRPROT_WRP_MASK 0x000000FE | ||
314 | |||
315 | /* SWRST (software reset; allows s/w to generate power-on equivalent reset): */ | ||
316 | |||
317 | /* Software reset bits: */ | ||
318 | #define XT2000_SWRST_SWR_SHIFT 0 | ||
319 | #define XT2000_SWRST_SWR_BITS 16 | ||
320 | #define XT2000_SWRST_SWR_MASK 0x0000FFFF | ||
321 | /* Software reset value -- writing this value resets the board: */ | ||
322 | #define XT2000_SWRST_RESETVALUE 0x0000DEAD | ||
323 | |||
324 | /* SYSRST (system reset; controls reset of individual peripherals): */ | ||
325 | |||
326 | /* All-device reset: */ | ||
327 | #define XT2000_SYSRST_ALL_SHIFT 0 | ||
328 | #define XT2000_SYSRST_ALL_BITS 4 | ||
329 | #define XT2000_SYSRST_ALL_MASK 0x0000000F | ||
330 | /* HDSP-2534 LED display reset (1=reset, 0=nothing): */ | ||
331 | #define XT2000_SYSRST_LED_SHIFT 0 | ||
332 | #define XT2000_SYSRST_LED_MASK 0x00000001 | ||
333 | /* Sonic DP83934 Ethernet controller reset (1=reset, 0=nothing): */ | ||
334 | #define XT2000_SYSRST_SONIC_SHIFT 1 | ||
335 | #define XT2000_SYSRST_SONIC_MASK 0x00000002 | ||
336 | /* DP16552 DUART reset (1=reset, 0=nothing): */ | ||
337 | #define XT2000_SYSRST_DUART_SHIFT 2 | ||
338 | #define XT2000_SYSRST_DUART_MASK 0x00000004 | ||
339 | /* V3 V320 PCI bridge controller reset (1=reset, 0=nothing): */ | ||
340 | #define XT2000_SYSRST_V3_SHIFT 3 | ||
341 | #define XT2000_SYSRST_V3_MASK 0x00000008 | ||
342 | |||
343 | /* IMASK (interrupt mask; 0=disable, 1=enable): */ | ||
344 | /* ISTAT (interrupt status; 0=inactive, 1=pending): */ | ||
345 | |||
346 | /* PCI INTP interrupt: */ | ||
347 | #define XT2000_INTMUX_PCI_INTP_SHIFT 2 | ||
348 | #define XT2000_INTMUX_PCI_INTP_MASK 0x00000004 | ||
349 | /* PCI INTS interrupt: */ | ||
350 | #define XT2000_INTMUX_PCI_INTS_SHIFT 3 | ||
351 | #define XT2000_INTMUX_PCI_INTS_MASK 0x00000008 | ||
352 | /* PCI INTD interrupt: */ | ||
353 | #define XT2000_INTMUX_PCI_INTD_SHIFT 4 | ||
354 | #define XT2000_INTMUX_PCI_INTD_MASK 0x00000010 | ||
355 | /* V320 PCI controller interrupt: */ | ||
356 | #define XT2000_INTMUX_V3_SHIFT 5 | ||
357 | #define XT2000_INTMUX_V3_MASK 0x00000020 | ||
358 | /* PCI ENUM interrupt: */ | ||
359 | #define XT2000_INTMUX_PCI_ENUM_SHIFT 6 | ||
360 | #define XT2000_INTMUX_PCI_ENUM_MASK 0x00000040 | ||
361 | /* PCI DEG interrupt: */ | ||
362 | #define XT2000_INTMUX_PCI_DEG_SHIFT 7 | ||
363 | #define XT2000_INTMUX_PCI_DEG_MASK 0x00000080 | ||
364 | |||
365 | /* V3CFG (V3 config, V320 PCI controller): */ | ||
366 | |||
367 | /* V3 address control (0=pass-thru, 1=V3 address bits 31:28 set to 4'b0001 [default]): */ | ||
368 | #define XT2000_V3CFG_V3ADC_SHIFT 0 | ||
369 | #define XT2000_V3CFG_V3ADC_MASK 0x00000001 | ||
370 | |||
371 | /* I2C Devices */ | ||
372 | |||
373 | #define XT2000_I2C_RTC_ID 0x68 | ||
374 | #define XT2000_I2C_NVRAM0_ID 0x56 /* 1st 256 byte block */ | ||
375 | #define XT2000_I2C_NVRAM1_ID 0x57 /* 2nd 256 byte block */ | ||
376 | |||
377 | /* NVRAM Board Info structure: */ | ||
378 | |||
379 | #define XT2000_NVRAM_SIZE 512 | ||
380 | |||
381 | #define XT2000_NVRAM_BINFO_START 0x100 | ||
382 | #define XT2000_NVRAM_BINFO_SIZE 0x20 | ||
383 | #define XT2000_NVRAM_BINFO_VERSION 0x10 /* version 1.0 */ | ||
384 | #if 0 | ||
385 | #define XT2000_NVRAM_BINFO_VERSION_OFFSET 0x00 | ||
386 | #define XT2000_NVRAM_BINFO_VERSION_SIZE 0x1 | ||
387 | #define XT2000_NVRAM_BINFO_ETH_ADDR_OFFSET 0x02 | ||
388 | #define XT2000_NVRAM_BINFO_ETH_ADDR_SIZE 0x6 | ||
389 | #define XT2000_NVRAM_BINFO_SN_OFFSET 0x10 | ||
390 | #define XT2000_NVRAM_BINFO_SN_SIZE 0xE | ||
391 | #define XT2000_NVRAM_BINFO_CRC_OFFSET 0x1E | ||
392 | #define XT2000_NVRAM_BINFO_CRC_SIZE 0x2 | ||
393 | #endif /*0*/ | ||
394 | |||
395 | #if !defined(__ASSEMBLY__) && !defined(_NOCLANGUAGE) | ||
396 | typedef struct xt2000_nvram_binfo { | ||
397 | unsigned char version; | ||
398 | unsigned char reserved1; | ||
399 | unsigned char eth_addr[6]; | ||
400 | unsigned char reserved8[8]; | ||
401 | unsigned char serialno[14]; | ||
402 | unsigned char crc[2]; /* 16-bit CRC */ | ||
403 | } xt2000_nvram_binfo; | ||
404 | #endif /*!__ASSEMBLY__ && !_NOCLANGUAGE*/ | ||
405 | |||
406 | |||
407 | #endif /*_INC_XT2000_H_*/ | ||
408 | |||
diff --git a/include/asm-xtensa/xtensa/xtboard.h b/include/asm-xtensa/xtensa/xtboard.h deleted file mode 100644 index 22469c175307..000000000000 --- a/include/asm-xtensa/xtensa/xtboard.h +++ /dev/null | |||
@@ -1,120 +0,0 @@ | |||
1 | #ifndef _xtboard_h_included_ | ||
2 | #define _xtboard_h_included_ | ||
3 | |||
4 | /* | ||
5 | * THIS FILE IS GENERATED -- DO NOT MODIFY BY HAND | ||
6 | * | ||
7 | * xtboard.h -- Routines for getting useful information from the board. | ||
8 | * | ||
9 | * This file is subject to the terms and conditions of the GNU General Public | ||
10 | * License. See the file "COPYING" in the main directory of this archive | ||
11 | * for more details. | ||
12 | * | ||
13 | * Copyright (C) 2002 Tensilica Inc. | ||
14 | */ | ||
15 | |||
16 | |||
17 | #include <xtensa/xt2000.h> | ||
18 | |||
19 | #define XTBOARD_RTC_ERROR -1 | ||
20 | #define XTBOARD_RTC_STOPPED -2 | ||
21 | |||
22 | |||
23 | /* xt2000-i2cdev.c: */ | ||
24 | typedef void XtboardDelayFunc( unsigned ); | ||
25 | extern XtboardDelayFunc* xtboard_set_nsdelay_func( XtboardDelayFunc *delay_fn ); | ||
26 | extern int xtboard_i2c_read (unsigned id, unsigned char *buf, unsigned addr, unsigned size); | ||
27 | extern int xtboard_i2c_write(unsigned id, unsigned char *buf, unsigned addr, unsigned size); | ||
28 | extern int xtboard_i2c_wait_nvram_ack(unsigned id, unsigned swtimer); | ||
29 | |||
30 | /* xtboard.c: */ | ||
31 | extern int xtboard_nvram_read (unsigned addr, unsigned len, unsigned char *buf); | ||
32 | extern int xtboard_nvram_write(unsigned addr, unsigned len, unsigned char *buf); | ||
33 | extern int xtboard_nvram_binfo_read (xt2000_nvram_binfo *buf); | ||
34 | extern int xtboard_nvram_binfo_write(xt2000_nvram_binfo *buf); | ||
35 | extern int xtboard_nvram_binfo_valid(xt2000_nvram_binfo *buf); | ||
36 | extern int xtboard_ethermac_get(unsigned char *buf); | ||
37 | extern int xtboard_ethermac_set(unsigned char *buf); | ||
38 | |||
39 | /*+*---------------------------------------------------------------------------- | ||
40 | / Function: xtboard_get_rtc_time | ||
41 | / | ||
42 | / Description: Get time stored in real-time clock. | ||
43 | / | ||
44 | / Returns: time in seconds stored in real-time clock. | ||
45 | /-**----------------------------------------------------------------------------*/ | ||
46 | |||
47 | extern unsigned xtboard_get_rtc_time(void); | ||
48 | |||
49 | /*+*---------------------------------------------------------------------------- | ||
50 | / Function: xtboard_set_rtc_time | ||
51 | / | ||
52 | / Description: Set time stored in real-time clock. | ||
53 | / | ||
54 | / Parameters: time -- time in seconds to store to real-time clock | ||
55 | / | ||
56 | / Returns: 0 on success, xtboard_i2c_write() error code otherwise. | ||
57 | /-**----------------------------------------------------------------------------*/ | ||
58 | |||
59 | extern int xtboard_set_rtc_time(unsigned time); | ||
60 | |||
61 | |||
62 | /* xtfreq.c: */ | ||
63 | /*+*---------------------------------------------------------------------------- | ||
64 | / Function: xtboard_measure_sys_clk | ||
65 | / | ||
66 | / Description: Get frequency of system clock. | ||
67 | / | ||
68 | / Parameters: none | ||
69 | / | ||
70 | / Returns: frequency of system clock. | ||
71 | /-**----------------------------------------------------------------------------*/ | ||
72 | |||
73 | extern unsigned xtboard_measure_sys_clk(void); | ||
74 | |||
75 | |||
76 | #if 0 /* old stuff from xtboard.c: */ | ||
77 | |||
78 | /*+*---------------------------------------------------------------------------- | ||
79 | / Function: xtboard_nvram valid | ||
80 | / | ||
81 | / Description: Determines if data in NVRAM is valid. | ||
82 | / | ||
83 | / Parameters: delay -- 10us delay function | ||
84 | / | ||
85 | / Returns: 1 if NVRAM is valid, 0 otherwise | ||
86 | /-**----------------------------------------------------------------------------*/ | ||
87 | |||
88 | extern unsigned xtboard_nvram_valid(void (*delay)( void )); | ||
89 | |||
90 | /*+*---------------------------------------------------------------------------- | ||
91 | / Function: xtboard_get_nvram_contents | ||
92 | / | ||
93 | / Description: Returns contents of NVRAM. | ||
94 | / | ||
95 | / Parameters: buf -- buffer to NVRAM contents. | ||
96 | / delay -- 10us delay function | ||
97 | / | ||
98 | / Returns: 1 if NVRAM is valid, 0 otherwise | ||
99 | /-**----------------------------------------------------------------------------*/ | ||
100 | |||
101 | extern unsigned xtboard_get_nvram_contents(unsigned char *buf, void (*delay)( void )); | ||
102 | |||
103 | /*+*---------------------------------------------------------------------------- | ||
104 | / Function: xtboard_get_ether_addr | ||
105 | / | ||
106 | / Description: Returns ethernet address of board. | ||
107 | / | ||
108 | / Parameters: buf -- buffer to store ethernet address | ||
109 | / delay -- 10us delay function | ||
110 | / | ||
111 | / Returns: nothing. | ||
112 | /-**----------------------------------------------------------------------------*/ | ||
113 | |||
114 | extern void xtboard_get_ether_addr(unsigned char *buf, void (*delay)( void )); | ||
115 | |||
116 | #endif /*0*/ | ||
117 | |||
118 | |||
119 | #endif /*_xtboard_h_included_*/ | ||
120 | |||
diff --git a/include/linux/Kbuild b/include/linux/Kbuild index e618b25b5add..a1b04d8a1d01 100644 --- a/include/linux/Kbuild +++ b/include/linux/Kbuild | |||
@@ -61,7 +61,6 @@ header-y += fd.h | |||
61 | header-y += fdreg.h | 61 | header-y += fdreg.h |
62 | header-y += fib_rules.h | 62 | header-y += fib_rules.h |
63 | header-y += fuse.h | 63 | header-y += fuse.h |
64 | header-y += futex.h | ||
65 | header-y += genetlink.h | 64 | header-y += genetlink.h |
66 | header-y += gen_stats.h | 65 | header-y += gen_stats.h |
67 | header-y += gigaset_dev.h | 66 | header-y += gigaset_dev.h |
@@ -203,6 +202,7 @@ unifdef-y += fb.h | |||
203 | unifdef-y += fcntl.h | 202 | unifdef-y += fcntl.h |
204 | unifdef-y += filter.h | 203 | unifdef-y += filter.h |
205 | unifdef-y += flat.h | 204 | unifdef-y += flat.h |
205 | unifdef-y += futex.h | ||
206 | unifdef-y += fs.h | 206 | unifdef-y += fs.h |
207 | unifdef-y += gameport.h | 207 | unifdef-y += gameport.h |
208 | unifdef-y += generic_serial.h | 208 | unifdef-y += generic_serial.h |
diff --git a/include/linux/bitrev.h b/include/linux/bitrev.h new file mode 100644 index 000000000000..05e540d6963a --- /dev/null +++ b/include/linux/bitrev.h | |||
@@ -0,0 +1,15 @@ | |||
1 | #ifndef _LINUX_BITREV_H | ||
2 | #define _LINUX_BITREV_H | ||
3 | |||
4 | #include <linux/types.h> | ||
5 | |||
6 | extern u8 const byte_rev_table[256]; | ||
7 | |||
8 | static inline u8 bitrev8(u8 byte) | ||
9 | { | ||
10 | return byte_rev_table[byte]; | ||
11 | } | ||
12 | |||
13 | extern u32 bitrev32(u32 in); | ||
14 | |||
15 | #endif /* _LINUX_BITREV_H */ | ||
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index e1c7286165ff..ea330d7b46c0 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h | |||
@@ -342,7 +342,6 @@ typedef void (unplug_fn) (request_queue_t *); | |||
342 | 342 | ||
343 | struct bio_vec; | 343 | struct bio_vec; |
344 | typedef int (merge_bvec_fn) (request_queue_t *, struct bio *, struct bio_vec *); | 344 | typedef int (merge_bvec_fn) (request_queue_t *, struct bio *, struct bio_vec *); |
345 | typedef void (activity_fn) (void *data, int rw); | ||
346 | typedef int (issue_flush_fn) (request_queue_t *, struct gendisk *, sector_t *); | 345 | typedef int (issue_flush_fn) (request_queue_t *, struct gendisk *, sector_t *); |
347 | typedef void (prepare_flush_fn) (request_queue_t *, struct request *); | 346 | typedef void (prepare_flush_fn) (request_queue_t *, struct request *); |
348 | typedef void (softirq_done_fn)(struct request *); | 347 | typedef void (softirq_done_fn)(struct request *); |
@@ -384,7 +383,6 @@ struct request_queue | |||
384 | prep_rq_fn *prep_rq_fn; | 383 | prep_rq_fn *prep_rq_fn; |
385 | unplug_fn *unplug_fn; | 384 | unplug_fn *unplug_fn; |
386 | merge_bvec_fn *merge_bvec_fn; | 385 | merge_bvec_fn *merge_bvec_fn; |
387 | activity_fn *activity_fn; | ||
388 | issue_flush_fn *issue_flush_fn; | 386 | issue_flush_fn *issue_flush_fn; |
389 | prepare_flush_fn *prepare_flush_fn; | 387 | prepare_flush_fn *prepare_flush_fn; |
390 | softirq_done_fn *softirq_done_fn; | 388 | softirq_done_fn *softirq_done_fn; |
@@ -411,8 +409,6 @@ struct request_queue | |||
411 | */ | 409 | */ |
412 | void *queuedata; | 410 | void *queuedata; |
413 | 411 | ||
414 | void *activity_data; | ||
415 | |||
416 | /* | 412 | /* |
417 | * queue needs bounce pages for pages above this limit | 413 | * queue needs bounce pages for pages above this limit |
418 | */ | 414 | */ |
@@ -677,7 +673,6 @@ extern void blk_sync_queue(struct request_queue *q); | |||
677 | extern void __blk_stop_queue(request_queue_t *q); | 673 | extern void __blk_stop_queue(request_queue_t *q); |
678 | extern void blk_run_queue(request_queue_t *); | 674 | extern void blk_run_queue(request_queue_t *); |
679 | extern void blk_start_queueing(request_queue_t *); | 675 | extern void blk_start_queueing(request_queue_t *); |
680 | extern void blk_queue_activity_fn(request_queue_t *, activity_fn *, void *); | ||
681 | extern int blk_rq_map_user(request_queue_t *, struct request *, void __user *, unsigned long); | 676 | extern int blk_rq_map_user(request_queue_t *, struct request *, void __user *, unsigned long); |
682 | extern int blk_rq_unmap_user(struct request *); | 677 | extern int blk_rq_unmap_user(struct request *); |
683 | extern int blk_rq_map_kern(request_queue_t *, struct request *, void *, unsigned int, gfp_t); | 678 | extern int blk_rq_map_kern(request_queue_t *, struct request *, void *, unsigned int, gfp_t); |
diff --git a/include/linux/bug.h b/include/linux/bug.h new file mode 100644 index 000000000000..42aa0a54b6f4 --- /dev/null +++ b/include/linux/bug.h | |||
@@ -0,0 +1,47 @@ | |||
1 | #ifndef _LINUX_BUG_H | ||
2 | #define _LINUX_BUG_H | ||
3 | |||
4 | #include <linux/module.h> | ||
5 | #include <asm/bug.h> | ||
6 | |||
7 | enum bug_trap_type { | ||
8 | BUG_TRAP_TYPE_NONE = 0, | ||
9 | BUG_TRAP_TYPE_WARN = 1, | ||
10 | BUG_TRAP_TYPE_BUG = 2, | ||
11 | }; | ||
12 | |||
13 | #ifdef CONFIG_GENERIC_BUG | ||
14 | #include <asm-generic/bug.h> | ||
15 | |||
16 | static inline int is_warning_bug(const struct bug_entry *bug) | ||
17 | { | ||
18 | return bug->flags & BUGFLAG_WARNING; | ||
19 | } | ||
20 | |||
21 | const struct bug_entry *find_bug(unsigned long bugaddr); | ||
22 | |||
23 | enum bug_trap_type report_bug(unsigned long bug_addr); | ||
24 | |||
25 | int module_bug_finalize(const Elf_Ehdr *, const Elf_Shdr *, | ||
26 | struct module *); | ||
27 | void module_bug_cleanup(struct module *); | ||
28 | |||
29 | /* These are defined by the architecture */ | ||
30 | int is_valid_bugaddr(unsigned long addr); | ||
31 | |||
32 | #else /* !CONFIG_GENERIC_BUG */ | ||
33 | |||
34 | static inline enum bug_trap_type report_bug(unsigned long bug_addr) | ||
35 | { | ||
36 | return BUG_TRAP_TYPE_BUG; | ||
37 | } | ||
38 | static inline int module_bug_finalize(const Elf_Ehdr *hdr, | ||
39 | const Elf_Shdr *sechdrs, | ||
40 | struct module *mod) | ||
41 | { | ||
42 | return 0; | ||
43 | } | ||
44 | static inline void module_bug_cleanup(struct module *mod) {} | ||
45 | |||
46 | #endif /* CONFIG_GENERIC_BUG */ | ||
47 | #endif /* _LINUX_BUG_H */ | ||
diff --git a/include/linux/clocksource.h b/include/linux/clocksource.h index d852024ed095..1622d23a8dc3 100644 --- a/include/linux/clocksource.h +++ b/include/linux/clocksource.h | |||
@@ -159,7 +159,7 @@ static inline s64 cyc2ns(struct clocksource *cs, cycle_t cycles) | |||
159 | * Unless you're the timekeeping code, you should not be using this! | 159 | * Unless you're the timekeeping code, you should not be using this! |
160 | */ | 160 | */ |
161 | static inline void clocksource_calculate_interval(struct clocksource *c, | 161 | static inline void clocksource_calculate_interval(struct clocksource *c, |
162 | unsigned long length_nsec) | 162 | unsigned long length_nsec) |
163 | { | 163 | { |
164 | u64 tmp; | 164 | u64 tmp; |
165 | 165 | ||
diff --git a/include/linux/crc32.h b/include/linux/crc32.h index 56c0645789a9..e20dd1f9b40a 100644 --- a/include/linux/crc32.h +++ b/include/linux/crc32.h | |||
@@ -6,10 +6,10 @@ | |||
6 | #define _LINUX_CRC32_H | 6 | #define _LINUX_CRC32_H |
7 | 7 | ||
8 | #include <linux/types.h> | 8 | #include <linux/types.h> |
9 | #include <linux/bitrev.h> | ||
9 | 10 | ||
10 | extern u32 crc32_le(u32 crc, unsigned char const *p, size_t len); | 11 | extern u32 crc32_le(u32 crc, unsigned char const *p, size_t len); |
11 | extern u32 crc32_be(u32 crc, unsigned char const *p, size_t len); | 12 | extern u32 crc32_be(u32 crc, unsigned char const *p, size_t len); |
12 | extern u32 bitreverse(u32 in); | ||
13 | 13 | ||
14 | #define crc32(seed, data, length) crc32_le(seed, (unsigned char const *)data, length) | 14 | #define crc32(seed, data, length) crc32_le(seed, (unsigned char const *)data, length) |
15 | 15 | ||
@@ -21,7 +21,7 @@ extern u32 bitreverse(u32 in); | |||
21 | * is in bit nr 0], thus it must be reversed before use. Except for | 21 | * is in bit nr 0], thus it must be reversed before use. Except for |
22 | * nics that bit swap the result internally... | 22 | * nics that bit swap the result internally... |
23 | */ | 23 | */ |
24 | #define ether_crc(length, data) bitreverse(crc32_le(~0, data, length)) | 24 | #define ether_crc(length, data) bitrev32(crc32_le(~0, data, length)) |
25 | #define ether_crc_le(length, data) crc32_le(~0, data, length) | 25 | #define ether_crc_le(length, data) crc32_le(~0, data, length) |
26 | 26 | ||
27 | #endif /* _LINUX_CRC32_H */ | 27 | #endif /* _LINUX_CRC32_H */ |
diff --git a/include/linux/dccp.h b/include/linux/dccp.h index ed6cc8962d87..1cb054bd93f2 100644 --- a/include/linux/dccp.h +++ b/include/linux/dccp.h | |||
@@ -176,20 +176,20 @@ enum { | |||
176 | }; | 176 | }; |
177 | 177 | ||
178 | /* DCCP features (RFC 4340 section 6.4) */ | 178 | /* DCCP features (RFC 4340 section 6.4) */ |
179 | enum { | 179 | enum { |
180 | DCCPF_RESERVED = 0, | 180 | DCCPF_RESERVED = 0, |
181 | DCCPF_CCID = 1, | 181 | DCCPF_CCID = 1, |
182 | DCCPF_SHORT_SEQNOS = 2, /* XXX: not yet implemented */ | 182 | DCCPF_SHORT_SEQNOS = 2, /* XXX: not yet implemented */ |
183 | DCCPF_SEQUENCE_WINDOW = 3, | 183 | DCCPF_SEQUENCE_WINDOW = 3, |
184 | DCCPF_ECN_INCAPABLE = 4, /* XXX: not yet implemented */ | 184 | DCCPF_ECN_INCAPABLE = 4, /* XXX: not yet implemented */ |
185 | DCCPF_ACK_RATIO = 5, | 185 | DCCPF_ACK_RATIO = 5, |
186 | DCCPF_SEND_ACK_VECTOR = 6, | 186 | DCCPF_SEND_ACK_VECTOR = 6, |
187 | DCCPF_SEND_NDP_COUNT = 7, | 187 | DCCPF_SEND_NDP_COUNT = 7, |
188 | DCCPF_MIN_CSUM_COVER = 8, | 188 | DCCPF_MIN_CSUM_COVER = 8, |
189 | DCCPF_DATA_CHECKSUM = 9, /* XXX: not yet implemented */ | 189 | DCCPF_DATA_CHECKSUM = 9, /* XXX: not yet implemented */ |
190 | /* 10-127 reserved */ | 190 | /* 10-127 reserved */ |
191 | DCCPF_MIN_CCID_SPECIFIC = 128, | 191 | DCCPF_MIN_CCID_SPECIFIC = 128, |
192 | DCCPF_MAX_CCID_SPECIFIC = 255, | 192 | DCCPF_MAX_CCID_SPECIFIC = 255, |
193 | }; | 193 | }; |
194 | 194 | ||
195 | /* this structure is argument to DCCP_SOCKOPT_CHANGE_X */ | 195 | /* this structure is argument to DCCP_SOCKOPT_CHANGE_X */ |
@@ -427,7 +427,7 @@ struct dccp_service_list { | |||
427 | }; | 427 | }; |
428 | 428 | ||
429 | #define DCCP_SERVICE_INVALID_VALUE htonl((__u32)-1) | 429 | #define DCCP_SERVICE_INVALID_VALUE htonl((__u32)-1) |
430 | #define DCCP_SERVICE_CODE_IS_ABSENT 0 | 430 | #define DCCP_SERVICE_CODE_IS_ABSENT 0 |
431 | 431 | ||
432 | static inline int dccp_list_has_service(const struct dccp_service_list *sl, | 432 | static inline int dccp_list_has_service(const struct dccp_service_list *sl, |
433 | const __be32 service) | 433 | const __be32 service) |
@@ -436,7 +436,7 @@ static inline int dccp_list_has_service(const struct dccp_service_list *sl, | |||
436 | u32 i = sl->dccpsl_nr; | 436 | u32 i = sl->dccpsl_nr; |
437 | while (i--) | 437 | while (i--) |
438 | if (sl->dccpsl_list[i] == service) | 438 | if (sl->dccpsl_list[i] == service) |
439 | return 1; | 439 | return 1; |
440 | } | 440 | } |
441 | return 0; | 441 | return 0; |
442 | } | 442 | } |
@@ -511,7 +511,7 @@ struct dccp_sock { | |||
511 | __u8 dccps_hc_tx_insert_options:1; | 511 | __u8 dccps_hc_tx_insert_options:1; |
512 | struct timer_list dccps_xmit_timer; | 512 | struct timer_list dccps_xmit_timer; |
513 | }; | 513 | }; |
514 | 514 | ||
515 | static inline struct dccp_sock *dccp_sk(const struct sock *sk) | 515 | static inline struct dccp_sock *dccp_sk(const struct sock *sk) |
516 | { | 516 | { |
517 | return (struct dccp_sock *)sk; | 517 | return (struct dccp_sock *)sk; |
diff --git a/include/linux/device-mapper.h b/include/linux/device-mapper.h index 03ef41c1eaac..499f5373e213 100644 --- a/include/linux/device-mapper.h +++ b/include/linux/device-mapper.h | |||
@@ -39,7 +39,8 @@ typedef void (*dm_dtr_fn) (struct dm_target *ti); | |||
39 | * The map function must return: | 39 | * The map function must return: |
40 | * < 0: error | 40 | * < 0: error |
41 | * = 0: The target will handle the io by resubmitting it later | 41 | * = 0: The target will handle the io by resubmitting it later |
42 | * > 0: simple remap complete | 42 | * = 1: simple remap complete |
43 | * = 2: The target wants to push back the io | ||
43 | */ | 44 | */ |
44 | typedef int (*dm_map_fn) (struct dm_target *ti, struct bio *bio, | 45 | typedef int (*dm_map_fn) (struct dm_target *ti, struct bio *bio, |
45 | union map_info *map_context); | 46 | union map_info *map_context); |
@@ -50,6 +51,7 @@ typedef int (*dm_map_fn) (struct dm_target *ti, struct bio *bio, | |||
50 | * 0 : ended successfully | 51 | * 0 : ended successfully |
51 | * 1 : for some reason the io has still not completed (eg, | 52 | * 1 : for some reason the io has still not completed (eg, |
52 | * multipath target might want to requeue a failed io). | 53 | * multipath target might want to requeue a failed io). |
54 | * 2 : The target wants to push back the io | ||
53 | */ | 55 | */ |
54 | typedef int (*dm_endio_fn) (struct dm_target *ti, | 56 | typedef int (*dm_endio_fn) (struct dm_target *ti, |
55 | struct bio *bio, int error, | 57 | struct bio *bio, int error, |
@@ -173,7 +175,7 @@ void *dm_get_mdptr(struct mapped_device *md); | |||
173 | /* | 175 | /* |
174 | * A device can still be used while suspended, but I/O is deferred. | 176 | * A device can still be used while suspended, but I/O is deferred. |
175 | */ | 177 | */ |
176 | int dm_suspend(struct mapped_device *md, int with_lockfs); | 178 | int dm_suspend(struct mapped_device *md, unsigned suspend_flags); |
177 | int dm_resume(struct mapped_device *md); | 179 | int dm_resume(struct mapped_device *md); |
178 | 180 | ||
179 | /* | 181 | /* |
@@ -188,6 +190,7 @@ int dm_wait_event(struct mapped_device *md, int event_nr); | |||
188 | const char *dm_device_name(struct mapped_device *md); | 190 | const char *dm_device_name(struct mapped_device *md); |
189 | struct gendisk *dm_disk(struct mapped_device *md); | 191 | struct gendisk *dm_disk(struct mapped_device *md); |
190 | int dm_suspended(struct mapped_device *md); | 192 | int dm_suspended(struct mapped_device *md); |
193 | int dm_noflush_suspending(struct dm_target *ti); | ||
191 | 194 | ||
192 | /* | 195 | /* |
193 | * Geometry functions. | 196 | * Geometry functions. |
diff --git a/include/linux/dm-ioctl.h b/include/linux/dm-ioctl.h index 8853fc4d1c5e..b93486107821 100644 --- a/include/linux/dm-ioctl.h +++ b/include/linux/dm-ioctl.h | |||
@@ -285,9 +285,9 @@ typedef char ioctl_struct[308]; | |||
285 | #define DM_DEV_SET_GEOMETRY _IOWR(DM_IOCTL, DM_DEV_SET_GEOMETRY_CMD, struct dm_ioctl) | 285 | #define DM_DEV_SET_GEOMETRY _IOWR(DM_IOCTL, DM_DEV_SET_GEOMETRY_CMD, struct dm_ioctl) |
286 | 286 | ||
287 | #define DM_VERSION_MAJOR 4 | 287 | #define DM_VERSION_MAJOR 4 |
288 | #define DM_VERSION_MINOR 10 | 288 | #define DM_VERSION_MINOR 11 |
289 | #define DM_VERSION_PATCHLEVEL 0 | 289 | #define DM_VERSION_PATCHLEVEL 0 |
290 | #define DM_VERSION_EXTRA "-ioctl (2006-09-14)" | 290 | #define DM_VERSION_EXTRA "-ioctl (2006-10-12)" |
291 | 291 | ||
292 | /* Status bits */ | 292 | /* Status bits */ |
293 | #define DM_READONLY_FLAG (1 << 0) /* In/Out */ | 293 | #define DM_READONLY_FLAG (1 << 0) /* In/Out */ |
@@ -323,4 +323,9 @@ typedef char ioctl_struct[308]; | |||
323 | */ | 323 | */ |
324 | #define DM_SKIP_LOCKFS_FLAG (1 << 10) /* In */ | 324 | #define DM_SKIP_LOCKFS_FLAG (1 << 10) /* In */ |
325 | 325 | ||
326 | /* | ||
327 | * Set this to suspend without flushing queued ios. | ||
328 | */ | ||
329 | #define DM_NOFLUSH_FLAG (1 << 11) /* In */ | ||
330 | |||
326 | #endif /* _LINUX_DM_IOCTL_H */ | 331 | #endif /* _LINUX_DM_IOCTL_H */ |
diff --git a/include/linux/fault-inject.h b/include/linux/fault-inject.h new file mode 100644 index 000000000000..32368c4f0326 --- /dev/null +++ b/include/linux/fault-inject.h | |||
@@ -0,0 +1,84 @@ | |||
1 | #ifndef _LINUX_FAULT_INJECT_H | ||
2 | #define _LINUX_FAULT_INJECT_H | ||
3 | |||
4 | #ifdef CONFIG_FAULT_INJECTION | ||
5 | |||
6 | #include <linux/types.h> | ||
7 | #include <linux/debugfs.h> | ||
8 | #include <asm/atomic.h> | ||
9 | |||
10 | /* | ||
11 | * For explanation of the elements of this struct, see | ||
12 | * Documentation/fault-injection/fault-injection.txt | ||
13 | */ | ||
14 | struct fault_attr { | ||
15 | unsigned long probability; | ||
16 | unsigned long interval; | ||
17 | atomic_t times; | ||
18 | atomic_t space; | ||
19 | unsigned long verbose; | ||
20 | u32 task_filter; | ||
21 | unsigned long stacktrace_depth; | ||
22 | unsigned long require_start; | ||
23 | unsigned long require_end; | ||
24 | unsigned long reject_start; | ||
25 | unsigned long reject_end; | ||
26 | |||
27 | unsigned long count; | ||
28 | |||
29 | #ifdef CONFIG_FAULT_INJECTION_DEBUG_FS | ||
30 | |||
31 | struct { | ||
32 | struct dentry *dir; | ||
33 | |||
34 | struct dentry *probability_file; | ||
35 | struct dentry *interval_file; | ||
36 | struct dentry *times_file; | ||
37 | struct dentry *space_file; | ||
38 | struct dentry *verbose_file; | ||
39 | struct dentry *task_filter_file; | ||
40 | struct dentry *stacktrace_depth_file; | ||
41 | struct dentry *require_start_file; | ||
42 | struct dentry *require_end_file; | ||
43 | struct dentry *reject_start_file; | ||
44 | struct dentry *reject_end_file; | ||
45 | } dentries; | ||
46 | |||
47 | #endif | ||
48 | }; | ||
49 | |||
50 | #define FAULT_ATTR_INITIALIZER { \ | ||
51 | .interval = 1, \ | ||
52 | .times = ATOMIC_INIT(1), \ | ||
53 | .require_end = ULONG_MAX, \ | ||
54 | .stacktrace_depth = 32, \ | ||
55 | .verbose = 2, \ | ||
56 | } | ||
57 | |||
58 | #define DECLARE_FAULT_ATTR(name) struct fault_attr name = FAULT_ATTR_INITIALIZER | ||
59 | int setup_fault_attr(struct fault_attr *attr, char *str); | ||
60 | void should_fail_srandom(unsigned long entropy); | ||
61 | bool should_fail(struct fault_attr *attr, ssize_t size); | ||
62 | |||
63 | #ifdef CONFIG_FAULT_INJECTION_DEBUG_FS | ||
64 | |||
65 | int init_fault_attr_dentries(struct fault_attr *attr, const char *name); | ||
66 | void cleanup_fault_attr_dentries(struct fault_attr *attr); | ||
67 | |||
68 | #else /* CONFIG_FAULT_INJECTION_DEBUG_FS */ | ||
69 | |||
70 | static inline int init_fault_attr_dentries(struct fault_attr *attr, | ||
71 | const char *name) | ||
72 | { | ||
73 | return -ENODEV; | ||
74 | } | ||
75 | |||
76 | static inline void cleanup_fault_attr_dentries(struct fault_attr *attr) | ||
77 | { | ||
78 | } | ||
79 | |||
80 | #endif /* CONFIG_FAULT_INJECTION_DEBUG_FS */ | ||
81 | |||
82 | #endif /* CONFIG_FAULT_INJECTION */ | ||
83 | |||
84 | #endif /* _LINUX_FAULT_INJECT_H */ | ||
diff --git a/include/linux/fb.h b/include/linux/fb.h index fa23e0671bb3..6fe56aaa6685 100644 --- a/include/linux/fb.h +++ b/include/linux/fb.h | |||
@@ -970,11 +970,11 @@ extern struct fb_videomode *fb_find_best_display(struct fb_monspecs *specs, | |||
970 | /* drivers/video/fbcmap.c */ | 970 | /* drivers/video/fbcmap.c */ |
971 | extern int fb_alloc_cmap(struct fb_cmap *cmap, int len, int transp); | 971 | extern int fb_alloc_cmap(struct fb_cmap *cmap, int len, int transp); |
972 | extern void fb_dealloc_cmap(struct fb_cmap *cmap); | 972 | extern void fb_dealloc_cmap(struct fb_cmap *cmap); |
973 | extern int fb_copy_cmap(struct fb_cmap *from, struct fb_cmap *to); | 973 | extern int fb_copy_cmap(const struct fb_cmap *from, struct fb_cmap *to); |
974 | extern int fb_cmap_to_user(struct fb_cmap *from, struct fb_cmap_user *to); | 974 | extern int fb_cmap_to_user(const struct fb_cmap *from, struct fb_cmap_user *to); |
975 | extern int fb_set_cmap(struct fb_cmap *cmap, struct fb_info *fb_info); | 975 | extern int fb_set_cmap(struct fb_cmap *cmap, struct fb_info *fb_info); |
976 | extern int fb_set_user_cmap(struct fb_cmap_user *cmap, struct fb_info *fb_info); | 976 | extern int fb_set_user_cmap(struct fb_cmap_user *cmap, struct fb_info *fb_info); |
977 | extern struct fb_cmap *fb_default_cmap(int len); | 977 | extern const struct fb_cmap *fb_default_cmap(int len); |
978 | extern void fb_invert_cmaps(void); | 978 | extern void fb_invert_cmaps(void); |
979 | 979 | ||
980 | struct fb_videomode { | 980 | struct fb_videomode { |
diff --git a/include/linux/file.h b/include/linux/file.h index 6e77b9177f9e..edca361f2ab4 100644 --- a/include/linux/file.h +++ b/include/linux/file.h | |||
@@ -26,19 +26,12 @@ struct embedded_fd_set { | |||
26 | unsigned long fds_bits[1]; | 26 | unsigned long fds_bits[1]; |
27 | }; | 27 | }; |
28 | 28 | ||
29 | /* | ||
30 | * More than this number of fds: we use a separately allocated fd_set | ||
31 | */ | ||
32 | #define EMBEDDED_FD_SET_SIZE (BITS_PER_BYTE * sizeof(struct embedded_fd_set)) | ||
33 | |||
34 | struct fdtable { | 29 | struct fdtable { |
35 | unsigned int max_fds; | 30 | unsigned int max_fds; |
36 | int max_fdset; | ||
37 | struct file ** fd; /* current fd array */ | 31 | struct file ** fd; /* current fd array */ |
38 | fd_set *close_on_exec; | 32 | fd_set *close_on_exec; |
39 | fd_set *open_fds; | 33 | fd_set *open_fds; |
40 | struct rcu_head rcu; | 34 | struct rcu_head rcu; |
41 | struct files_struct *free_files; | ||
42 | struct fdtable *next; | 35 | struct fdtable *next; |
43 | }; | 36 | }; |
44 | 37 | ||
@@ -83,14 +76,8 @@ extern int get_unused_fd(void); | |||
83 | extern void FASTCALL(put_unused_fd(unsigned int fd)); | 76 | extern void FASTCALL(put_unused_fd(unsigned int fd)); |
84 | struct kmem_cache; | 77 | struct kmem_cache; |
85 | 78 | ||
86 | extern struct file ** alloc_fd_array(int); | ||
87 | extern void free_fd_array(struct file **, int); | ||
88 | |||
89 | extern fd_set *alloc_fdset(int); | ||
90 | extern void free_fdset(fd_set *, int); | ||
91 | |||
92 | extern int expand_files(struct files_struct *, int nr); | 79 | extern int expand_files(struct files_struct *, int nr); |
93 | extern void free_fdtable(struct fdtable *fdt); | 80 | extern void free_fdtable_rcu(struct rcu_head *rcu); |
94 | extern void __init files_defer_init(void); | 81 | extern void __init files_defer_init(void); |
95 | 82 | ||
96 | static inline struct file * fcheck_files(struct files_struct *files, unsigned int fd) | 83 | static inline struct file * fcheck_files(struct files_struct *files, unsigned int fd) |
diff --git a/include/linux/freezer.h b/include/linux/freezer.h index 6e05e3e7ce39..393063096134 100644 --- a/include/linux/freezer.h +++ b/include/linux/freezer.h | |||
@@ -1,5 +1,7 @@ | |||
1 | /* Freezer declarations */ | 1 | /* Freezer declarations */ |
2 | 2 | ||
3 | #include <linux/sched.h> | ||
4 | |||
3 | #ifdef CONFIG_PM | 5 | #ifdef CONFIG_PM |
4 | /* | 6 | /* |
5 | * Check if a process has been frozen | 7 | * Check if a process has been frozen |
diff --git a/include/linux/fs.h b/include/linux/fs.h index 70b99fbb560b..adce6e1d70c2 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h | |||
@@ -269,6 +269,7 @@ extern int dir_notify_enable; | |||
269 | #include <linux/types.h> | 269 | #include <linux/types.h> |
270 | #include <linux/kdev_t.h> | 270 | #include <linux/kdev_t.h> |
271 | #include <linux/dcache.h> | 271 | #include <linux/dcache.h> |
272 | #include <linux/namei.h> | ||
272 | #include <linux/stat.h> | 273 | #include <linux/stat.h> |
273 | #include <linux/cache.h> | 274 | #include <linux/cache.h> |
274 | #include <linux/kobject.h> | 275 | #include <linux/kobject.h> |
@@ -482,21 +483,6 @@ struct block_device { | |||
482 | }; | 483 | }; |
483 | 484 | ||
484 | /* | 485 | /* |
485 | * bdev->bd_mutex nesting subclasses for the lock validator: | ||
486 | * | ||
487 | * 0: normal | ||
488 | * 1: 'whole' | ||
489 | * 2: 'partition' | ||
490 | */ | ||
491 | enum bdev_bd_mutex_lock_class | ||
492 | { | ||
493 | BD_MUTEX_NORMAL, | ||
494 | BD_MUTEX_WHOLE, | ||
495 | BD_MUTEX_PARTITION | ||
496 | }; | ||
497 | |||
498 | |||
499 | /* | ||
500 | * Radix-tree tags, for tagging dirty and writeback pages within the pagecache | 486 | * Radix-tree tags, for tagging dirty and writeback pages within the pagecache |
501 | * radix trees | 487 | * radix trees |
502 | */ | 488 | */ |
@@ -726,8 +712,9 @@ struct file { | |||
726 | struct list_head fu_list; | 712 | struct list_head fu_list; |
727 | struct rcu_head fu_rcuhead; | 713 | struct rcu_head fu_rcuhead; |
728 | } f_u; | 714 | } f_u; |
729 | struct dentry *f_dentry; | 715 | struct path f_path; |
730 | struct vfsmount *f_vfsmnt; | 716 | #define f_dentry f_path.dentry |
717 | #define f_vfsmnt f_path.mnt | ||
731 | const struct file_operations *f_op; | 718 | const struct file_operations *f_op; |
732 | atomic_t f_count; | 719 | atomic_t f_count; |
733 | unsigned int f_flags; | 720 | unsigned int f_flags; |
@@ -1239,7 +1226,7 @@ extern void touch_atime(struct vfsmount *mnt, struct dentry *dentry); | |||
1239 | static inline void file_accessed(struct file *file) | 1226 | static inline void file_accessed(struct file *file) |
1240 | { | 1227 | { |
1241 | if (!(file->f_flags & O_NOATIME)) | 1228 | if (!(file->f_flags & O_NOATIME)) |
1242 | touch_atime(file->f_vfsmnt, file->f_dentry); | 1229 | touch_atime(file->f_path.mnt, file->f_path.dentry); |
1243 | } | 1230 | } |
1244 | 1231 | ||
1245 | int sync_inode(struct inode *inode, struct writeback_control *wbc); | 1232 | int sync_inode(struct inode *inode, struct writeback_control *wbc); |
@@ -1499,7 +1486,6 @@ extern void bd_set_size(struct block_device *, loff_t size); | |||
1499 | extern void bd_forget(struct inode *inode); | 1486 | extern void bd_forget(struct inode *inode); |
1500 | extern void bdput(struct block_device *); | 1487 | extern void bdput(struct block_device *); |
1501 | extern struct block_device *open_by_devnum(dev_t, unsigned); | 1488 | extern struct block_device *open_by_devnum(dev_t, unsigned); |
1502 | extern struct block_device *open_partition_by_devnum(dev_t, unsigned); | ||
1503 | extern const struct address_space_operations def_blk_aops; | 1489 | extern const struct address_space_operations def_blk_aops; |
1504 | #else | 1490 | #else |
1505 | static inline void bd_forget(struct inode *inode) {} | 1491 | static inline void bd_forget(struct inode *inode) {} |
@@ -1517,7 +1503,6 @@ extern int blkdev_driver_ioctl(struct inode *inode, struct file *file, | |||
1517 | extern long compat_blkdev_ioctl(struct file *, unsigned, unsigned long); | 1503 | extern long compat_blkdev_ioctl(struct file *, unsigned, unsigned long); |
1518 | extern int blkdev_get(struct block_device *, mode_t, unsigned); | 1504 | extern int blkdev_get(struct block_device *, mode_t, unsigned); |
1519 | extern int blkdev_put(struct block_device *); | 1505 | extern int blkdev_put(struct block_device *); |
1520 | extern int blkdev_put_partition(struct block_device *); | ||
1521 | extern int bd_claim(struct block_device *, void *); | 1506 | extern int bd_claim(struct block_device *, void *); |
1522 | extern void bd_release(struct block_device *); | 1507 | extern void bd_release(struct block_device *); |
1523 | #ifdef CONFIG_SYSFS | 1508 | #ifdef CONFIG_SYSFS |
@@ -1632,7 +1617,7 @@ static inline void put_write_access(struct inode * inode) | |||
1632 | static inline void allow_write_access(struct file *file) | 1617 | static inline void allow_write_access(struct file *file) |
1633 | { | 1618 | { |
1634 | if (file) | 1619 | if (file) |
1635 | atomic_inc(&file->f_dentry->d_inode->i_writecount); | 1620 | atomic_inc(&file->f_path.dentry->d_inode->i_writecount); |
1636 | } | 1621 | } |
1637 | extern int do_pipe(int *); | 1622 | extern int do_pipe(int *); |
1638 | extern struct file *create_read_pipe(struct file *f); | 1623 | extern struct file *create_read_pipe(struct file *f); |
diff --git a/include/linux/fs_stack.h b/include/linux/fs_stack.h new file mode 100644 index 000000000000..bb516ceeefc9 --- /dev/null +++ b/include/linux/fs_stack.h | |||
@@ -0,0 +1,31 @@ | |||
1 | #ifndef _LINUX_FS_STACK_H | ||
2 | #define _LINUX_FS_STACK_H | ||
3 | |||
4 | /* This file defines generic functions used primarily by stackable | ||
5 | * filesystems; none of these functions require i_mutex to be held. | ||
6 | */ | ||
7 | |||
8 | #include <linux/fs.h> | ||
9 | |||
10 | /* externs for fs/stack.c */ | ||
11 | extern void fsstack_copy_attr_all(struct inode *dest, const struct inode *src, | ||
12 | int (*get_nlinks)(struct inode *)); | ||
13 | |||
14 | extern void fsstack_copy_inode_size(struct inode *dst, const struct inode *src); | ||
15 | |||
16 | /* inlines */ | ||
17 | static inline void fsstack_copy_attr_atime(struct inode *dest, | ||
18 | const struct inode *src) | ||
19 | { | ||
20 | dest->i_atime = src->i_atime; | ||
21 | } | ||
22 | |||
23 | static inline void fsstack_copy_attr_times(struct inode *dest, | ||
24 | const struct inode *src) | ||
25 | { | ||
26 | dest->i_atime = src->i_atime; | ||
27 | dest->i_mtime = src->i_mtime; | ||
28 | dest->i_ctime = src->i_ctime; | ||
29 | } | ||
30 | |||
31 | #endif /* _LINUX_FS_STACK_H */ | ||
diff --git a/include/linux/fsl_devices.h b/include/linux/fsl_devices.h index 3da29e2d524a..abb64c437f6f 100644 --- a/include/linux/fsl_devices.h +++ b/include/linux/fsl_devices.h | |||
@@ -19,6 +19,7 @@ | |||
19 | #define _FSL_DEVICE_H_ | 19 | #define _FSL_DEVICE_H_ |
20 | 20 | ||
21 | #include <linux/types.h> | 21 | #include <linux/types.h> |
22 | #include <linux/phy.h> | ||
22 | 23 | ||
23 | /* | 24 | /* |
24 | * Some conventions on how we handle peripherals on Freescale chips | 25 | * Some conventions on how we handle peripherals on Freescale chips |
diff --git a/include/linux/fsnotify.h b/include/linux/fsnotify.h index d4f219ffaa5d..dfc4e4f68da4 100644 --- a/include/linux/fsnotify.h +++ b/include/linux/fsnotify.h | |||
@@ -164,7 +164,7 @@ static inline void fsnotify_open(struct dentry *dentry) | |||
164 | */ | 164 | */ |
165 | static inline void fsnotify_close(struct file *file) | 165 | static inline void fsnotify_close(struct file *file) |
166 | { | 166 | { |
167 | struct dentry *dentry = file->f_dentry; | 167 | struct dentry *dentry = file->f_path.dentry; |
168 | struct inode *inode = dentry->d_inode; | 168 | struct inode *inode = dentry->d_inode; |
169 | const char *name = dentry->d_name.name; | 169 | const char *name = dentry->d_name.name; |
170 | mode_t mode = file->f_mode; | 170 | mode_t mode = file->f_mode; |
diff --git a/include/linux/futex.h b/include/linux/futex.h index d097b5b72bc6..3f153b4e156c 100644 --- a/include/linux/futex.h +++ b/include/linux/futex.h | |||
@@ -93,6 +93,7 @@ struct robust_list_head { | |||
93 | */ | 93 | */ |
94 | #define ROBUST_LIST_LIMIT 2048 | 94 | #define ROBUST_LIST_LIMIT 2048 |
95 | 95 | ||
96 | #ifdef __KERNEL__ | ||
96 | long do_futex(u32 __user *uaddr, int op, u32 val, unsigned long timeout, | 97 | long do_futex(u32 __user *uaddr, int op, u32 val, unsigned long timeout, |
97 | u32 __user *uaddr2, u32 val2, u32 val3); | 98 | u32 __user *uaddr2, u32 val2, u32 val3); |
98 | 99 | ||
@@ -110,6 +111,7 @@ static inline void exit_pi_state_list(struct task_struct *curr) | |||
110 | { | 111 | { |
111 | } | 112 | } |
112 | #endif | 113 | #endif |
114 | #endif /* __KERNEL__ */ | ||
113 | 115 | ||
114 | #define FUTEX_OP_SET 0 /* *(int *)UADDR2 = OPARG; */ | 116 | #define FUTEX_OP_SET 0 /* *(int *)UADDR2 = OPARG; */ |
115 | #define FUTEX_OP_ADD 1 /* *(int *)UADDR2 += OPARG; */ | 117 | #define FUTEX_OP_ADD 1 /* *(int *)UADDR2 += OPARG; */ |
diff --git a/include/linux/generic_serial.h b/include/linux/generic_serial.h index e25384561955..5412da28fa47 100644 --- a/include/linux/generic_serial.h +++ b/include/linux/generic_serial.h | |||
@@ -91,7 +91,7 @@ void gs_hangup(struct tty_struct *tty); | |||
91 | int gs_block_til_ready(void *port, struct file *filp); | 91 | int gs_block_til_ready(void *port, struct file *filp); |
92 | void gs_close(struct tty_struct *tty, struct file *filp); | 92 | void gs_close(struct tty_struct *tty, struct file *filp); |
93 | void gs_set_termios (struct tty_struct * tty, | 93 | void gs_set_termios (struct tty_struct * tty, |
94 | struct termios * old_termios); | 94 | struct ktermios * old_termios); |
95 | int gs_init_port(struct gs_port *port); | 95 | int gs_init_port(struct gs_port *port); |
96 | int gs_setserial(struct gs_port *port, struct serial_struct __user *sp); | 96 | int gs_setserial(struct gs_port *port, struct serial_struct __user *sp); |
97 | int gs_getserial(struct gs_port *port, struct serial_struct __user *sp); | 97 | int gs_getserial(struct gs_port *port, struct serial_struct __user *sp); |
diff --git a/include/linux/genhd.h b/include/linux/genhd.h index 41f276fdd185..0a022b2f63fc 100644 --- a/include/linux/genhd.h +++ b/include/linux/genhd.h | |||
@@ -83,6 +83,9 @@ struct hd_struct { | |||
83 | struct kobject *holder_dir; | 83 | struct kobject *holder_dir; |
84 | unsigned ios[2], sectors[2]; /* READs and WRITEs */ | 84 | unsigned ios[2], sectors[2]; /* READs and WRITEs */ |
85 | int policy, partno; | 85 | int policy, partno; |
86 | #ifdef CONFIG_FAIL_MAKE_REQUEST | ||
87 | int make_it_fail; | ||
88 | #endif | ||
86 | }; | 89 | }; |
87 | 90 | ||
88 | #define GENHD_FL_REMOVABLE 1 | 91 | #define GENHD_FL_REMOVABLE 1 |
@@ -90,6 +93,7 @@ struct hd_struct { | |||
90 | #define GENHD_FL_CD 8 | 93 | #define GENHD_FL_CD 8 |
91 | #define GENHD_FL_UP 16 | 94 | #define GENHD_FL_UP 16 |
92 | #define GENHD_FL_SUPPRESS_PARTITION_INFO 32 | 95 | #define GENHD_FL_SUPPRESS_PARTITION_INFO 32 |
96 | #define GENHD_FL_FAIL 64 | ||
93 | 97 | ||
94 | struct disk_stats { | 98 | struct disk_stats { |
95 | unsigned long sectors[2]; /* READs and WRITEs */ | 99 | unsigned long sectors[2]; /* READs and WRITEs */ |
diff --git a/include/linux/hid-debug.h b/include/linux/hid-debug.h new file mode 100644 index 000000000000..f04d6d75c098 --- /dev/null +++ b/include/linux/hid-debug.h | |||
@@ -0,0 +1,757 @@ | |||
1 | /* | ||
2 | * $Id: hid-debug.h,v 1.8 2001/09/25 09:37:57 vojtech Exp $ | ||
3 | * | ||
4 | * (c) 1999 Andreas Gal <gal@cs.uni-magdeburg.de> | ||
5 | * (c) 2000-2001 Vojtech Pavlik <vojtech@ucw.cz> | ||
6 | * | ||
7 | * Some debug stuff for the HID parser. | ||
8 | */ | ||
9 | |||
10 | /* | ||
11 | * This program is free software; you can redistribute it and/or modify | ||
12 | * it under the terms of the GNU General Public License as published by | ||
13 | * the Free Software Foundation; either version 2 of the License, or | ||
14 | * (at your option) any later version. | ||
15 | * | ||
16 | * This program is distributed in the hope that it will be useful, | ||
17 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
19 | * GNU General Public License for more details. | ||
20 | * | ||
21 | * You should have received a copy of the GNU General Public License | ||
22 | * along with this program; if not, write to the Free Software | ||
23 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
24 | * | ||
25 | * Should you need to contact me, the author, you can do so either by | ||
26 | * e-mail - mail your message to <vojtech@ucw.cz>, or by paper mail: | ||
27 | * Vojtech Pavlik, Simunkova 1594, Prague 8, 182 00 Czech Republic | ||
28 | */ | ||
29 | |||
30 | #include <linux/input.h> | ||
31 | |||
32 | struct hid_usage_entry { | ||
33 | unsigned page; | ||
34 | unsigned usage; | ||
35 | char *description; | ||
36 | }; | ||
37 | |||
38 | static const struct hid_usage_entry hid_usage_table[] = { | ||
39 | { 0, 0, "Undefined" }, | ||
40 | { 1, 0, "GenericDesktop" }, | ||
41 | {0, 0x01, "Pointer"}, | ||
42 | {0, 0x02, "Mouse"}, | ||
43 | {0, 0x04, "Joystick"}, | ||
44 | {0, 0x05, "GamePad"}, | ||
45 | {0, 0x06, "Keyboard"}, | ||
46 | {0, 0x07, "Keypad"}, | ||
47 | {0, 0x08, "MultiAxis"}, | ||
48 | {0, 0x30, "X"}, | ||
49 | {0, 0x31, "Y"}, | ||
50 | {0, 0x32, "Z"}, | ||
51 | {0, 0x33, "Rx"}, | ||
52 | {0, 0x34, "Ry"}, | ||
53 | {0, 0x35, "Rz"}, | ||
54 | {0, 0x36, "Slider"}, | ||
55 | {0, 0x37, "Dial"}, | ||
56 | {0, 0x38, "Wheel"}, | ||
57 | {0, 0x39, "HatSwitch"}, | ||
58 | {0, 0x3a, "CountedBuffer"}, | ||
59 | {0, 0x3b, "ByteCount"}, | ||
60 | {0, 0x3c, "MotionWakeup"}, | ||
61 | {0, 0x3d, "Start"}, | ||
62 | {0, 0x3e, "Select"}, | ||
63 | {0, 0x40, "Vx"}, | ||
64 | {0, 0x41, "Vy"}, | ||
65 | {0, 0x42, "Vz"}, | ||
66 | {0, 0x43, "Vbrx"}, | ||
67 | {0, 0x44, "Vbry"}, | ||
68 | {0, 0x45, "Vbrz"}, | ||
69 | {0, 0x46, "Vno"}, | ||
70 | {0, 0x80, "SystemControl"}, | ||
71 | {0, 0x81, "SystemPowerDown"}, | ||
72 | {0, 0x82, "SystemSleep"}, | ||
73 | {0, 0x83, "SystemWakeUp"}, | ||
74 | {0, 0x84, "SystemContextMenu"}, | ||
75 | {0, 0x85, "SystemMainMenu"}, | ||
76 | {0, 0x86, "SystemAppMenu"}, | ||
77 | {0, 0x87, "SystemMenuHelp"}, | ||
78 | {0, 0x88, "SystemMenuExit"}, | ||
79 | {0, 0x89, "SystemMenuSelect"}, | ||
80 | {0, 0x8a, "SystemMenuRight"}, | ||
81 | {0, 0x8b, "SystemMenuLeft"}, | ||
82 | {0, 0x8c, "SystemMenuUp"}, | ||
83 | {0, 0x8d, "SystemMenuDown"}, | ||
84 | {0, 0x90, "D-PadUp"}, | ||
85 | {0, 0x91, "D-PadDown"}, | ||
86 | {0, 0x92, "D-PadRight"}, | ||
87 | {0, 0x93, "D-PadLeft"}, | ||
88 | { 2, 0, "Simulation" }, | ||
89 | {0, 0xb0, "Aileron"}, | ||
90 | {0, 0xb1, "AileronTrim"}, | ||
91 | {0, 0xb2, "Anti-Torque"}, | ||
92 | {0, 0xb3, "Autopilot"}, | ||
93 | {0, 0xb4, "Chaff"}, | ||
94 | {0, 0xb5, "Collective"}, | ||
95 | {0, 0xb6, "DiveBrake"}, | ||
96 | {0, 0xb7, "ElectronicCountermeasures"}, | ||
97 | {0, 0xb8, "Elevator"}, | ||
98 | {0, 0xb9, "ElevatorTrim"}, | ||
99 | {0, 0xba, "Rudder"}, | ||
100 | {0, 0xbb, "Throttle"}, | ||
101 | {0, 0xbc, "FlightCommunications"}, | ||
102 | {0, 0xbd, "FlareRelease"}, | ||
103 | {0, 0xbe, "LandingGear"}, | ||
104 | {0, 0xbf, "ToeBrake"}, | ||
105 | { 7, 0, "Keyboard" }, | ||
106 | { 8, 0, "LED" }, | ||
107 | {0, 0x01, "NumLock"}, | ||
108 | {0, 0x02, "CapsLock"}, | ||
109 | {0, 0x03, "ScrollLock"}, | ||
110 | {0, 0x04, "Compose"}, | ||
111 | {0, 0x05, "Kana"}, | ||
112 | {0, 0x4b, "GenericIndicator"}, | ||
113 | { 9, 0, "Button" }, | ||
114 | { 10, 0, "Ordinal" }, | ||
115 | { 12, 0, "Consumer" }, | ||
116 | {0, 0x238, "HorizontalWheel"}, | ||
117 | { 13, 0, "Digitizers" }, | ||
118 | {0, 0x01, "Digitizer"}, | ||
119 | {0, 0x02, "Pen"}, | ||
120 | {0, 0x03, "LightPen"}, | ||
121 | {0, 0x04, "TouchScreen"}, | ||
122 | {0, 0x05, "TouchPad"}, | ||
123 | {0, 0x20, "Stylus"}, | ||
124 | {0, 0x21, "Puck"}, | ||
125 | {0, 0x22, "Finger"}, | ||
126 | {0, 0x30, "TipPressure"}, | ||
127 | {0, 0x31, "BarrelPressure"}, | ||
128 | {0, 0x32, "InRange"}, | ||
129 | {0, 0x33, "Touch"}, | ||
130 | {0, 0x34, "UnTouch"}, | ||
131 | {0, 0x35, "Tap"}, | ||
132 | {0, 0x39, "TabletFunctionKey"}, | ||
133 | {0, 0x3a, "ProgramChangeKey"}, | ||
134 | {0, 0x3c, "Invert"}, | ||
135 | {0, 0x42, "TipSwitch"}, | ||
136 | {0, 0x43, "SecondaryTipSwitch"}, | ||
137 | {0, 0x44, "BarrelSwitch"}, | ||
138 | {0, 0x45, "Eraser"}, | ||
139 | {0, 0x46, "TabletPick"}, | ||
140 | { 15, 0, "PhysicalInterfaceDevice" }, | ||
141 | {0, 0x00, "Undefined"}, | ||
142 | {0, 0x01, "Physical_Interface_Device"}, | ||
143 | {0, 0x20, "Normal"}, | ||
144 | {0, 0x21, "Set_Effect_Report"}, | ||
145 | {0, 0x22, "Effect_Block_Index"}, | ||
146 | {0, 0x23, "Parameter_Block_Offset"}, | ||
147 | {0, 0x24, "ROM_Flag"}, | ||
148 | {0, 0x25, "Effect_Type"}, | ||
149 | {0, 0x26, "ET_Constant_Force"}, | ||
150 | {0, 0x27, "ET_Ramp"}, | ||
151 | {0, 0x28, "ET_Custom_Force_Data"}, | ||
152 | {0, 0x30, "ET_Square"}, | ||
153 | {0, 0x31, "ET_Sine"}, | ||
154 | {0, 0x32, "ET_Triangle"}, | ||
155 | {0, 0x33, "ET_Sawtooth_Up"}, | ||
156 | {0, 0x34, "ET_Sawtooth_Down"}, | ||
157 | {0, 0x40, "ET_Spring"}, | ||
158 | {0, 0x41, "ET_Damper"}, | ||
159 | {0, 0x42, "ET_Inertia"}, | ||
160 | {0, 0x43, "ET_Friction"}, | ||
161 | {0, 0x50, "Duration"}, | ||
162 | {0, 0x51, "Sample_Period"}, | ||
163 | {0, 0x52, "Gain"}, | ||
164 | {0, 0x53, "Trigger_Button"}, | ||
165 | {0, 0x54, "Trigger_Repeat_Interval"}, | ||
166 | {0, 0x55, "Axes_Enable"}, | ||
167 | {0, 0x56, "Direction_Enable"}, | ||
168 | {0, 0x57, "Direction"}, | ||
169 | {0, 0x58, "Type_Specific_Block_Offset"}, | ||
170 | {0, 0x59, "Block_Type"}, | ||
171 | {0, 0x5A, "Set_Envelope_Report"}, | ||
172 | {0, 0x5B, "Attack_Level"}, | ||
173 | {0, 0x5C, "Attack_Time"}, | ||
174 | {0, 0x5D, "Fade_Level"}, | ||
175 | {0, 0x5E, "Fade_Time"}, | ||
176 | {0, 0x5F, "Set_Condition_Report"}, | ||
177 | {0, 0x60, "CP_Offset"}, | ||
178 | {0, 0x61, "Positive_Coefficient"}, | ||
179 | {0, 0x62, "Negative_Coefficient"}, | ||
180 | {0, 0x63, "Positive_Saturation"}, | ||
181 | {0, 0x64, "Negative_Saturation"}, | ||
182 | {0, 0x65, "Dead_Band"}, | ||
183 | {0, 0x66, "Download_Force_Sample"}, | ||
184 | {0, 0x67, "Isoch_Custom_Force_Enable"}, | ||
185 | {0, 0x68, "Custom_Force_Data_Report"}, | ||
186 | {0, 0x69, "Custom_Force_Data"}, | ||
187 | {0, 0x6A, "Custom_Force_Vendor_Defined_Data"}, | ||
188 | {0, 0x6B, "Set_Custom_Force_Report"}, | ||
189 | {0, 0x6C, "Custom_Force_Data_Offset"}, | ||
190 | {0, 0x6D, "Sample_Count"}, | ||
191 | {0, 0x6E, "Set_Periodic_Report"}, | ||
192 | {0, 0x6F, "Offset"}, | ||
193 | {0, 0x70, "Magnitude"}, | ||
194 | {0, 0x71, "Phase"}, | ||
195 | {0, 0x72, "Period"}, | ||
196 | {0, 0x73, "Set_Constant_Force_Report"}, | ||
197 | {0, 0x74, "Set_Ramp_Force_Report"}, | ||
198 | {0, 0x75, "Ramp_Start"}, | ||
199 | {0, 0x76, "Ramp_End"}, | ||
200 | {0, 0x77, "Effect_Operation_Report"}, | ||
201 | {0, 0x78, "Effect_Operation"}, | ||
202 | {0, 0x79, "Op_Effect_Start"}, | ||
203 | {0, 0x7A, "Op_Effect_Start_Solo"}, | ||
204 | {0, 0x7B, "Op_Effect_Stop"}, | ||
205 | {0, 0x7C, "Loop_Count"}, | ||
206 | {0, 0x7D, "Device_Gain_Report"}, | ||
207 | {0, 0x7E, "Device_Gain"}, | ||
208 | {0, 0x7F, "PID_Pool_Report"}, | ||
209 | {0, 0x80, "RAM_Pool_Size"}, | ||
210 | {0, 0x81, "ROM_Pool_Size"}, | ||
211 | {0, 0x82, "ROM_Effect_Block_Count"}, | ||
212 | {0, 0x83, "Simultaneous_Effects_Max"}, | ||
213 | {0, 0x84, "Pool_Alignment"}, | ||
214 | {0, 0x85, "PID_Pool_Move_Report"}, | ||
215 | {0, 0x86, "Move_Source"}, | ||
216 | {0, 0x87, "Move_Destination"}, | ||
217 | {0, 0x88, "Move_Length"}, | ||
218 | {0, 0x89, "PID_Block_Load_Report"}, | ||
219 | {0, 0x8B, "Block_Load_Status"}, | ||
220 | {0, 0x8C, "Block_Load_Success"}, | ||
221 | {0, 0x8D, "Block_Load_Full"}, | ||
222 | {0, 0x8E, "Block_Load_Error"}, | ||
223 | {0, 0x8F, "Block_Handle"}, | ||
224 | {0, 0x90, "PID_Block_Free_Report"}, | ||
225 | {0, 0x91, "Type_Specific_Block_Handle"}, | ||
226 | {0, 0x92, "PID_State_Report"}, | ||
227 | {0, 0x94, "Effect_Playing"}, | ||
228 | {0, 0x95, "PID_Device_Control_Report"}, | ||
229 | {0, 0x96, "PID_Device_Control"}, | ||
230 | {0, 0x97, "DC_Enable_Actuators"}, | ||
231 | {0, 0x98, "DC_Disable_Actuators"}, | ||
232 | {0, 0x99, "DC_Stop_All_Effects"}, | ||
233 | {0, 0x9A, "DC_Device_Reset"}, | ||
234 | {0, 0x9B, "DC_Device_Pause"}, | ||
235 | {0, 0x9C, "DC_Device_Continue"}, | ||
236 | {0, 0x9F, "Device_Paused"}, | ||
237 | {0, 0xA0, "Actuators_Enabled"}, | ||
238 | {0, 0xA4, "Safety_Switch"}, | ||
239 | {0, 0xA5, "Actuator_Override_Switch"}, | ||
240 | {0, 0xA6, "Actuator_Power"}, | ||
241 | {0, 0xA7, "Start_Delay"}, | ||
242 | {0, 0xA8, "Parameter_Block_Size"}, | ||
243 | {0, 0xA9, "Device_Managed_Pool"}, | ||
244 | {0, 0xAA, "Shared_Parameter_Blocks"}, | ||
245 | {0, 0xAB, "Create_New_Effect_Report"}, | ||
246 | {0, 0xAC, "RAM_Pool_Available"}, | ||
247 | { 0x84, 0, "Power Device" }, | ||
248 | { 0x84, 0x02, "PresentStatus" }, | ||
249 | { 0x84, 0x03, "ChangeStatus" }, | ||
250 | { 0x84, 0x04, "UPS" }, | ||
251 | { 0x84, 0x05, "PowerSupply" }, | ||
252 | { 0x84, 0x10, "BatterySystem" }, | ||
253 | { 0x84, 0x11, "BatterySystemID" }, | ||
254 | { 0x84, 0x12, "Battery" }, | ||
255 | { 0x84, 0x13, "BatteryID" }, | ||
256 | { 0x84, 0x14, "Charger" }, | ||
257 | { 0x84, 0x15, "ChargerID" }, | ||
258 | { 0x84, 0x16, "PowerConverter" }, | ||
259 | { 0x84, 0x17, "PowerConverterID" }, | ||
260 | { 0x84, 0x18, "OutletSystem" }, | ||
261 | { 0x84, 0x19, "OutletSystemID" }, | ||
262 | { 0x84, 0x1a, "Input" }, | ||
263 | { 0x84, 0x1b, "InputID" }, | ||
264 | { 0x84, 0x1c, "Output" }, | ||
265 | { 0x84, 0x1d, "OutputID" }, | ||
266 | { 0x84, 0x1e, "Flow" }, | ||
267 | { 0x84, 0x1f, "FlowID" }, | ||
268 | { 0x84, 0x20, "Outlet" }, | ||
269 | { 0x84, 0x21, "OutletID" }, | ||
270 | { 0x84, 0x22, "Gang" }, | ||
271 | { 0x84, 0x24, "PowerSummary" }, | ||
272 | { 0x84, 0x25, "PowerSummaryID" }, | ||
273 | { 0x84, 0x30, "Voltage" }, | ||
274 | { 0x84, 0x31, "Current" }, | ||
275 | { 0x84, 0x32, "Frequency" }, | ||
276 | { 0x84, 0x33, "ApparentPower" }, | ||
277 | { 0x84, 0x35, "PercentLoad" }, | ||
278 | { 0x84, 0x40, "ConfigVoltage" }, | ||
279 | { 0x84, 0x41, "ConfigCurrent" }, | ||
280 | { 0x84, 0x43, "ConfigApparentPower" }, | ||
281 | { 0x84, 0x53, "LowVoltageTransfer" }, | ||
282 | { 0x84, 0x54, "HighVoltageTransfer" }, | ||
283 | { 0x84, 0x56, "DelayBeforeStartup" }, | ||
284 | { 0x84, 0x57, "DelayBeforeShutdown" }, | ||
285 | { 0x84, 0x58, "Test" }, | ||
286 | { 0x84, 0x5a, "AudibleAlarmControl" }, | ||
287 | { 0x84, 0x60, "Present" }, | ||
288 | { 0x84, 0x61, "Good" }, | ||
289 | { 0x84, 0x62, "InternalFailure" }, | ||
290 | { 0x84, 0x65, "Overload" }, | ||
291 | { 0x84, 0x66, "OverCharged" }, | ||
292 | { 0x84, 0x67, "OverTemperature" }, | ||
293 | { 0x84, 0x68, "ShutdownRequested" }, | ||
294 | { 0x84, 0x69, "ShutdownImminent" }, | ||
295 | { 0x84, 0x6b, "SwitchOn/Off" }, | ||
296 | { 0x84, 0x6c, "Switchable" }, | ||
297 | { 0x84, 0x6d, "Used" }, | ||
298 | { 0x84, 0x6e, "Boost" }, | ||
299 | { 0x84, 0x73, "CommunicationLost" }, | ||
300 | { 0x84, 0xfd, "iManufacturer" }, | ||
301 | { 0x84, 0xfe, "iProduct" }, | ||
302 | { 0x84, 0xff, "iSerialNumber" }, | ||
303 | { 0x85, 0, "Battery System" }, | ||
304 | { 0x85, 0x01, "SMBBatteryMode" }, | ||
305 | { 0x85, 0x02, "SMBBatteryStatus" }, | ||
306 | { 0x85, 0x03, "SMBAlarmWarning" }, | ||
307 | { 0x85, 0x04, "SMBChargerMode" }, | ||
308 | { 0x85, 0x05, "SMBChargerStatus" }, | ||
309 | { 0x85, 0x06, "SMBChargerSpecInfo" }, | ||
310 | { 0x85, 0x07, "SMBSelectorState" }, | ||
311 | { 0x85, 0x08, "SMBSelectorPresets" }, | ||
312 | { 0x85, 0x09, "SMBSelectorInfo" }, | ||
313 | { 0x85, 0x29, "RemainingCapacityLimit" }, | ||
314 | { 0x85, 0x2c, "CapacityMode" }, | ||
315 | { 0x85, 0x42, "BelowRemainingCapacityLimit" }, | ||
316 | { 0x85, 0x44, "Charging" }, | ||
317 | { 0x85, 0x45, "Discharging" }, | ||
318 | { 0x85, 0x4b, "NeedReplacement" }, | ||
319 | { 0x85, 0x66, "RemainingCapacity" }, | ||
320 | { 0x85, 0x68, "RunTimeToEmpty" }, | ||
321 | { 0x85, 0x6a, "AverageTimeToFull" }, | ||
322 | { 0x85, 0x83, "DesignCapacity" }, | ||
323 | { 0x85, 0x85, "ManufacturerDate" }, | ||
324 | { 0x85, 0x89, "iDeviceChemistry" }, | ||
325 | { 0x85, 0x8b, "Rechargable" }, | ||
326 | { 0x85, 0x8f, "iOEMInformation" }, | ||
327 | { 0x85, 0x8d, "CapacityGranularity1" }, | ||
328 | { 0x85, 0xd0, "ACPresent" }, | ||
329 | /* pages 0xff00 to 0xffff are vendor-specific */ | ||
330 | { 0xffff, 0, "Vendor-specific-FF" }, | ||
331 | { 0, 0, NULL } | ||
332 | }; | ||
333 | |||
334 | static void resolv_usage_page(unsigned page) { | ||
335 | const struct hid_usage_entry *p; | ||
336 | |||
337 | for (p = hid_usage_table; p->description; p++) | ||
338 | if (p->page == page) { | ||
339 | printk("%s", p->description); | ||
340 | return; | ||
341 | } | ||
342 | printk("%04x", page); | ||
343 | } | ||
344 | |||
345 | static void resolv_usage(unsigned usage) { | ||
346 | const struct hid_usage_entry *p; | ||
347 | |||
348 | resolv_usage_page(usage >> 16); | ||
349 | printk("."); | ||
350 | for (p = hid_usage_table; p->description; p++) | ||
351 | if (p->page == (usage >> 16)) { | ||
352 | for(++p; p->description && p->usage != 0; p++) | ||
353 | if (p->usage == (usage & 0xffff)) { | ||
354 | printk("%s", p->description); | ||
355 | return; | ||
356 | } | ||
357 | break; | ||
358 | } | ||
359 | printk("%04x", usage & 0xffff); | ||
360 | } | ||
361 | |||
362 | __inline__ static void tab(int n) { | ||
363 | while (n--) printk(" "); | ||
364 | } | ||
365 | |||
366 | static void hid_dump_field(struct hid_field *field, int n) { | ||
367 | int j; | ||
368 | |||
369 | if (field->physical) { | ||
370 | tab(n); | ||
371 | printk("Physical("); | ||
372 | resolv_usage(field->physical); printk(")\n"); | ||
373 | } | ||
374 | if (field->logical) { | ||
375 | tab(n); | ||
376 | printk("Logical("); | ||
377 | resolv_usage(field->logical); printk(")\n"); | ||
378 | } | ||
379 | tab(n); printk("Usage(%d)\n", field->maxusage); | ||
380 | for (j = 0; j < field->maxusage; j++) { | ||
381 | tab(n+2);resolv_usage(field->usage[j].hid); printk("\n"); | ||
382 | } | ||
383 | if (field->logical_minimum != field->logical_maximum) { | ||
384 | tab(n); printk("Logical Minimum(%d)\n", field->logical_minimum); | ||
385 | tab(n); printk("Logical Maximum(%d)\n", field->logical_maximum); | ||
386 | } | ||
387 | if (field->physical_minimum != field->physical_maximum) { | ||
388 | tab(n); printk("Physical Minimum(%d)\n", field->physical_minimum); | ||
389 | tab(n); printk("Physical Maximum(%d)\n", field->physical_maximum); | ||
390 | } | ||
391 | if (field->unit_exponent) { | ||
392 | tab(n); printk("Unit Exponent(%d)\n", field->unit_exponent); | ||
393 | } | ||
394 | if (field->unit) { | ||
395 | char *systems[5] = { "None", "SI Linear", "SI Rotation", "English Linear", "English Rotation" }; | ||
396 | char *units[5][8] = { | ||
397 | { "None", "None", "None", "None", "None", "None", "None", "None" }, | ||
398 | { "None", "Centimeter", "Gram", "Seconds", "Kelvin", "Ampere", "Candela", "None" }, | ||
399 | { "None", "Radians", "Gram", "Seconds", "Kelvin", "Ampere", "Candela", "None" }, | ||
400 | { "None", "Inch", "Slug", "Seconds", "Fahrenheit", "Ampere", "Candela", "None" }, | ||
401 | { "None", "Degrees", "Slug", "Seconds", "Fahrenheit", "Ampere", "Candela", "None" } | ||
402 | }; | ||
403 | |||
404 | int i; | ||
405 | int sys; | ||
406 | __u32 data = field->unit; | ||
407 | |||
408 | /* First nibble tells us which system we're in. */ | ||
409 | sys = data & 0xf; | ||
410 | data >>= 4; | ||
411 | |||
412 | if(sys > 4) { | ||
413 | tab(n); printk("Unit(Invalid)\n"); | ||
414 | } | ||
415 | else { | ||
416 | int earlier_unit = 0; | ||
417 | |||
418 | tab(n); printk("Unit(%s : ", systems[sys]); | ||
419 | |||
420 | for (i=1 ; i<sizeof(__u32)*2 ; i++) { | ||
421 | char nibble = data & 0xf; | ||
422 | data >>= 4; | ||
423 | if (nibble != 0) { | ||
424 | if(earlier_unit++ > 0) | ||
425 | printk("*"); | ||
426 | printk("%s", units[sys][i]); | ||
427 | if(nibble != 1) { | ||
428 | /* This is a _signed_ nibble(!) */ | ||
429 | |||
430 | int val = nibble & 0x7; | ||
431 | if(nibble & 0x08) | ||
432 | val = -((0x7 & ~val) +1); | ||
433 | printk("^%d", val); | ||
434 | } | ||
435 | } | ||
436 | } | ||
437 | printk(")\n"); | ||
438 | } | ||
439 | } | ||
440 | tab(n); printk("Report Size(%u)\n", field->report_size); | ||
441 | tab(n); printk("Report Count(%u)\n", field->report_count); | ||
442 | tab(n); printk("Report Offset(%u)\n", field->report_offset); | ||
443 | |||
444 | tab(n); printk("Flags( "); | ||
445 | j = field->flags; | ||
446 | printk("%s", HID_MAIN_ITEM_CONSTANT & j ? "Constant " : ""); | ||
447 | printk("%s", HID_MAIN_ITEM_VARIABLE & j ? "Variable " : "Array "); | ||
448 | printk("%s", HID_MAIN_ITEM_RELATIVE & j ? "Relative " : "Absolute "); | ||
449 | printk("%s", HID_MAIN_ITEM_WRAP & j ? "Wrap " : ""); | ||
450 | printk("%s", HID_MAIN_ITEM_NONLINEAR & j ? "NonLinear " : ""); | ||
451 | printk("%s", HID_MAIN_ITEM_NO_PREFERRED & j ? "NoPrefferedState " : ""); | ||
452 | printk("%s", HID_MAIN_ITEM_NULL_STATE & j ? "NullState " : ""); | ||
453 | printk("%s", HID_MAIN_ITEM_VOLATILE & j ? "Volatile " : ""); | ||
454 | printk("%s", HID_MAIN_ITEM_BUFFERED_BYTE & j ? "BufferedByte " : ""); | ||
455 | printk(")\n"); | ||
456 | } | ||
457 | |||
458 | static void __attribute__((unused)) hid_dump_device(struct hid_device *device) { | ||
459 | struct hid_report_enum *report_enum; | ||
460 | struct hid_report *report; | ||
461 | struct list_head *list; | ||
462 | unsigned i,k; | ||
463 | static char *table[] = {"INPUT", "OUTPUT", "FEATURE"}; | ||
464 | |||
465 | for (i = 0; i < HID_REPORT_TYPES; i++) { | ||
466 | report_enum = device->report_enum + i; | ||
467 | list = report_enum->report_list.next; | ||
468 | while (list != &report_enum->report_list) { | ||
469 | report = (struct hid_report *) list; | ||
470 | tab(2); | ||
471 | printk("%s", table[i]); | ||
472 | if (report->id) | ||
473 | printk("(%d)", report->id); | ||
474 | printk("[%s]", table[report->type]); | ||
475 | printk("\n"); | ||
476 | for (k = 0; k < report->maxfield; k++) { | ||
477 | tab(4); | ||
478 | printk("Field(%d)\n", k); | ||
479 | hid_dump_field(report->field[k], 6); | ||
480 | } | ||
481 | list = list->next; | ||
482 | } | ||
483 | } | ||
484 | } | ||
485 | |||
486 | static void __attribute__((unused)) hid_dump_input(struct hid_usage *usage, __s32 value) { | ||
487 | printk("hid-debug: input "); | ||
488 | resolv_usage(usage->hid); | ||
489 | printk(" = %d\n", value); | ||
490 | } | ||
491 | |||
492 | |||
493 | static char *events[EV_MAX + 1] = { | ||
494 | [EV_SYN] = "Sync", [EV_KEY] = "Key", | ||
495 | [EV_REL] = "Relative", [EV_ABS] = "Absolute", | ||
496 | [EV_MSC] = "Misc", [EV_LED] = "LED", | ||
497 | [EV_SND] = "Sound", [EV_REP] = "Repeat", | ||
498 | [EV_FF] = "ForceFeedback", [EV_PWR] = "Power", | ||
499 | [EV_FF_STATUS] = "ForceFeedbackStatus", | ||
500 | }; | ||
501 | |||
502 | static char *syncs[2] = { | ||
503 | [SYN_REPORT] = "Report", [SYN_CONFIG] = "Config", | ||
504 | }; | ||
505 | static char *keys[KEY_MAX + 1] = { | ||
506 | [KEY_RESERVED] = "Reserved", [KEY_ESC] = "Esc", | ||
507 | [KEY_1] = "1", [KEY_2] = "2", | ||
508 | [KEY_3] = "3", [KEY_4] = "4", | ||
509 | [KEY_5] = "5", [KEY_6] = "6", | ||
510 | [KEY_7] = "7", [KEY_8] = "8", | ||
511 | [KEY_9] = "9", [KEY_0] = "0", | ||
512 | [KEY_MINUS] = "Minus", [KEY_EQUAL] = "Equal", | ||
513 | [KEY_BACKSPACE] = "Backspace", [KEY_TAB] = "Tab", | ||
514 | [KEY_Q] = "Q", [KEY_W] = "W", | ||
515 | [KEY_E] = "E", [KEY_R] = "R", | ||
516 | [KEY_T] = "T", [KEY_Y] = "Y", | ||
517 | [KEY_U] = "U", [KEY_I] = "I", | ||
518 | [KEY_O] = "O", [KEY_P] = "P", | ||
519 | [KEY_LEFTBRACE] = "LeftBrace", [KEY_RIGHTBRACE] = "RightBrace", | ||
520 | [KEY_ENTER] = "Enter", [KEY_LEFTCTRL] = "LeftControl", | ||
521 | [KEY_A] = "A", [KEY_S] = "S", | ||
522 | [KEY_D] = "D", [KEY_F] = "F", | ||
523 | [KEY_G] = "G", [KEY_H] = "H", | ||
524 | [KEY_J] = "J", [KEY_K] = "K", | ||
525 | [KEY_L] = "L", [KEY_SEMICOLON] = "Semicolon", | ||
526 | [KEY_APOSTROPHE] = "Apostrophe", [KEY_GRAVE] = "Grave", | ||
527 | [KEY_LEFTSHIFT] = "LeftShift", [KEY_BACKSLASH] = "BackSlash", | ||
528 | [KEY_Z] = "Z", [KEY_X] = "X", | ||
529 | [KEY_C] = "C", [KEY_V] = "V", | ||
530 | [KEY_B] = "B", [KEY_N] = "N", | ||
531 | [KEY_M] = "M", [KEY_COMMA] = "Comma", | ||
532 | [KEY_DOT] = "Dot", [KEY_SLASH] = "Slash", | ||
533 | [KEY_RIGHTSHIFT] = "RightShift", [KEY_KPASTERISK] = "KPAsterisk", | ||
534 | [KEY_LEFTALT] = "LeftAlt", [KEY_SPACE] = "Space", | ||
535 | [KEY_CAPSLOCK] = "CapsLock", [KEY_F1] = "F1", | ||
536 | [KEY_F2] = "F2", [KEY_F3] = "F3", | ||
537 | [KEY_F4] = "F4", [KEY_F5] = "F5", | ||
538 | [KEY_F6] = "F6", [KEY_F7] = "F7", | ||
539 | [KEY_F8] = "F8", [KEY_F9] = "F9", | ||
540 | [KEY_F10] = "F10", [KEY_NUMLOCK] = "NumLock", | ||
541 | [KEY_SCROLLLOCK] = "ScrollLock", [KEY_KP7] = "KP7", | ||
542 | [KEY_KP8] = "KP8", [KEY_KP9] = "KP9", | ||
543 | [KEY_KPMINUS] = "KPMinus", [KEY_KP4] = "KP4", | ||
544 | [KEY_KP5] = "KP5", [KEY_KP6] = "KP6", | ||
545 | [KEY_KPPLUS] = "KPPlus", [KEY_KP1] = "KP1", | ||
546 | [KEY_KP2] = "KP2", [KEY_KP3] = "KP3", | ||
547 | [KEY_KP0] = "KP0", [KEY_KPDOT] = "KPDot", | ||
548 | [KEY_ZENKAKUHANKAKU] = "Zenkaku/Hankaku", [KEY_102ND] = "102nd", | ||
549 | [KEY_F11] = "F11", [KEY_F12] = "F12", | ||
550 | [KEY_RO] = "RO", [KEY_KATAKANA] = "Katakana", | ||
551 | [KEY_HIRAGANA] = "HIRAGANA", [KEY_HENKAN] = "Henkan", | ||
552 | [KEY_KATAKANAHIRAGANA] = "Katakana/Hiragana", [KEY_MUHENKAN] = "Muhenkan", | ||
553 | [KEY_KPJPCOMMA] = "KPJpComma", [KEY_KPENTER] = "KPEnter", | ||
554 | [KEY_RIGHTCTRL] = "RightCtrl", [KEY_KPSLASH] = "KPSlash", | ||
555 | [KEY_SYSRQ] = "SysRq", [KEY_RIGHTALT] = "RightAlt", | ||
556 | [KEY_LINEFEED] = "LineFeed", [KEY_HOME] = "Home", | ||
557 | [KEY_UP] = "Up", [KEY_PAGEUP] = "PageUp", | ||
558 | [KEY_LEFT] = "Left", [KEY_RIGHT] = "Right", | ||
559 | [KEY_END] = "End", [KEY_DOWN] = "Down", | ||
560 | [KEY_PAGEDOWN] = "PageDown", [KEY_INSERT] = "Insert", | ||
561 | [KEY_DELETE] = "Delete", [KEY_MACRO] = "Macro", | ||
562 | [KEY_MUTE] = "Mute", [KEY_VOLUMEDOWN] = "VolumeDown", | ||
563 | [KEY_VOLUMEUP] = "VolumeUp", [KEY_POWER] = "Power", | ||
564 | [KEY_KPEQUAL] = "KPEqual", [KEY_KPPLUSMINUS] = "KPPlusMinus", | ||
565 | [KEY_PAUSE] = "Pause", [KEY_KPCOMMA] = "KPComma", | ||
566 | [KEY_HANGUEL] = "Hangeul", [KEY_HANJA] = "Hanja", | ||
567 | [KEY_YEN] = "Yen", [KEY_LEFTMETA] = "LeftMeta", | ||
568 | [KEY_RIGHTMETA] = "RightMeta", [KEY_COMPOSE] = "Compose", | ||
569 | [KEY_STOP] = "Stop", [KEY_AGAIN] = "Again", | ||
570 | [KEY_PROPS] = "Props", [KEY_UNDO] = "Undo", | ||
571 | [KEY_FRONT] = "Front", [KEY_COPY] = "Copy", | ||
572 | [KEY_OPEN] = "Open", [KEY_PASTE] = "Paste", | ||
573 | [KEY_FIND] = "Find", [KEY_CUT] = "Cut", | ||
574 | [KEY_HELP] = "Help", [KEY_MENU] = "Menu", | ||
575 | [KEY_CALC] = "Calc", [KEY_SETUP] = "Setup", | ||
576 | [KEY_SLEEP] = "Sleep", [KEY_WAKEUP] = "WakeUp", | ||
577 | [KEY_FILE] = "File", [KEY_SENDFILE] = "SendFile", | ||
578 | [KEY_DELETEFILE] = "DeleteFile", [KEY_XFER] = "X-fer", | ||
579 | [KEY_PROG1] = "Prog1", [KEY_PROG2] = "Prog2", | ||
580 | [KEY_WWW] = "WWW", [KEY_MSDOS] = "MSDOS", | ||
581 | [KEY_COFFEE] = "Coffee", [KEY_DIRECTION] = "Direction", | ||
582 | [KEY_CYCLEWINDOWS] = "CycleWindows", [KEY_MAIL] = "Mail", | ||
583 | [KEY_BOOKMARKS] = "Bookmarks", [KEY_COMPUTER] = "Computer", | ||
584 | [KEY_BACK] = "Back", [KEY_FORWARD] = "Forward", | ||
585 | [KEY_CLOSECD] = "CloseCD", [KEY_EJECTCD] = "EjectCD", | ||
586 | [KEY_EJECTCLOSECD] = "EjectCloseCD", [KEY_NEXTSONG] = "NextSong", | ||
587 | [KEY_PLAYPAUSE] = "PlayPause", [KEY_PREVIOUSSONG] = "PreviousSong", | ||
588 | [KEY_STOPCD] = "StopCD", [KEY_RECORD] = "Record", | ||
589 | [KEY_REWIND] = "Rewind", [KEY_PHONE] = "Phone", | ||
590 | [KEY_ISO] = "ISOKey", [KEY_CONFIG] = "Config", | ||
591 | [KEY_HOMEPAGE] = "HomePage", [KEY_REFRESH] = "Refresh", | ||
592 | [KEY_EXIT] = "Exit", [KEY_MOVE] = "Move", | ||
593 | [KEY_EDIT] = "Edit", [KEY_SCROLLUP] = "ScrollUp", | ||
594 | [KEY_SCROLLDOWN] = "ScrollDown", [KEY_KPLEFTPAREN] = "KPLeftParenthesis", | ||
595 | [KEY_KPRIGHTPAREN] = "KPRightParenthesis", [KEY_NEW] = "New", | ||
596 | [KEY_REDO] = "Redo", [KEY_F13] = "F13", | ||
597 | [KEY_F14] = "F14", [KEY_F15] = "F15", | ||
598 | [KEY_F16] = "F16", [KEY_F17] = "F17", | ||
599 | [KEY_F18] = "F18", [KEY_F19] = "F19", | ||
600 | [KEY_F20] = "F20", [KEY_F21] = "F21", | ||
601 | [KEY_F22] = "F22", [KEY_F23] = "F23", | ||
602 | [KEY_F24] = "F24", [KEY_PLAYCD] = "PlayCD", | ||
603 | [KEY_PAUSECD] = "PauseCD", [KEY_PROG3] = "Prog3", | ||
604 | [KEY_PROG4] = "Prog4", [KEY_SUSPEND] = "Suspend", | ||
605 | [KEY_CLOSE] = "Close", [KEY_PLAY] = "Play", | ||
606 | [KEY_FASTFORWARD] = "FastForward", [KEY_BASSBOOST] = "BassBoost", | ||
607 | [KEY_PRINT] = "Print", [KEY_HP] = "HP", | ||
608 | [KEY_CAMERA] = "Camera", [KEY_SOUND] = "Sound", | ||
609 | [KEY_QUESTION] = "Question", [KEY_EMAIL] = "Email", | ||
610 | [KEY_CHAT] = "Chat", [KEY_SEARCH] = "Search", | ||
611 | [KEY_CONNECT] = "Connect", [KEY_FINANCE] = "Finance", | ||
612 | [KEY_SPORT] = "Sport", [KEY_SHOP] = "Shop", | ||
613 | [KEY_ALTERASE] = "AlternateErase", [KEY_CANCEL] = "Cancel", | ||
614 | [KEY_BRIGHTNESSDOWN] = "BrightnessDown", [KEY_BRIGHTNESSUP] = "BrightnessUp", | ||
615 | [KEY_MEDIA] = "Media", [KEY_UNKNOWN] = "Unknown", | ||
616 | [BTN_0] = "Btn0", [BTN_1] = "Btn1", | ||
617 | [BTN_2] = "Btn2", [BTN_3] = "Btn3", | ||
618 | [BTN_4] = "Btn4", [BTN_5] = "Btn5", | ||
619 | [BTN_6] = "Btn6", [BTN_7] = "Btn7", | ||
620 | [BTN_8] = "Btn8", [BTN_9] = "Btn9", | ||
621 | [BTN_LEFT] = "LeftBtn", [BTN_RIGHT] = "RightBtn", | ||
622 | [BTN_MIDDLE] = "MiddleBtn", [BTN_SIDE] = "SideBtn", | ||
623 | [BTN_EXTRA] = "ExtraBtn", [BTN_FORWARD] = "ForwardBtn", | ||
624 | [BTN_BACK] = "BackBtn", [BTN_TASK] = "TaskBtn", | ||
625 | [BTN_TRIGGER] = "Trigger", [BTN_THUMB] = "ThumbBtn", | ||
626 | [BTN_THUMB2] = "ThumbBtn2", [BTN_TOP] = "TopBtn", | ||
627 | [BTN_TOP2] = "TopBtn2", [BTN_PINKIE] = "PinkieBtn", | ||
628 | [BTN_BASE] = "BaseBtn", [BTN_BASE2] = "BaseBtn2", | ||
629 | [BTN_BASE3] = "BaseBtn3", [BTN_BASE4] = "BaseBtn4", | ||
630 | [BTN_BASE5] = "BaseBtn5", [BTN_BASE6] = "BaseBtn6", | ||
631 | [BTN_DEAD] = "BtnDead", [BTN_A] = "BtnA", | ||
632 | [BTN_B] = "BtnB", [BTN_C] = "BtnC", | ||
633 | [BTN_X] = "BtnX", [BTN_Y] = "BtnY", | ||
634 | [BTN_Z] = "BtnZ", [BTN_TL] = "BtnTL", | ||
635 | [BTN_TR] = "BtnTR", [BTN_TL2] = "BtnTL2", | ||
636 | [BTN_TR2] = "BtnTR2", [BTN_SELECT] = "BtnSelect", | ||
637 | [BTN_START] = "BtnStart", [BTN_MODE] = "BtnMode", | ||
638 | [BTN_THUMBL] = "BtnThumbL", [BTN_THUMBR] = "BtnThumbR", | ||
639 | [BTN_TOOL_PEN] = "ToolPen", [BTN_TOOL_RUBBER] = "ToolRubber", | ||
640 | [BTN_TOOL_BRUSH] = "ToolBrush", [BTN_TOOL_PENCIL] = "ToolPencil", | ||
641 | [BTN_TOOL_AIRBRUSH] = "ToolAirbrush", [BTN_TOOL_FINGER] = "ToolFinger", | ||
642 | [BTN_TOOL_MOUSE] = "ToolMouse", [BTN_TOOL_LENS] = "ToolLens", | ||
643 | [BTN_TOUCH] = "Touch", [BTN_STYLUS] = "Stylus", | ||
644 | [BTN_STYLUS2] = "Stylus2", [BTN_TOOL_DOUBLETAP] = "ToolDoubleTap", | ||
645 | [BTN_TOOL_TRIPLETAP] = "ToolTripleTap", [BTN_GEAR_DOWN] = "WheelBtn", | ||
646 | [BTN_GEAR_UP] = "Gear up", [KEY_OK] = "Ok", | ||
647 | [KEY_SELECT] = "Select", [KEY_GOTO] = "Goto", | ||
648 | [KEY_CLEAR] = "Clear", [KEY_POWER2] = "Power2", | ||
649 | [KEY_OPTION] = "Option", [KEY_INFO] = "Info", | ||
650 | [KEY_TIME] = "Time", [KEY_VENDOR] = "Vendor", | ||
651 | [KEY_ARCHIVE] = "Archive", [KEY_PROGRAM] = "Program", | ||
652 | [KEY_CHANNEL] = "Channel", [KEY_FAVORITES] = "Favorites", | ||
653 | [KEY_EPG] = "EPG", [KEY_PVR] = "PVR", | ||
654 | [KEY_MHP] = "MHP", [KEY_LANGUAGE] = "Language", | ||
655 | [KEY_TITLE] = "Title", [KEY_SUBTITLE] = "Subtitle", | ||
656 | [KEY_ANGLE] = "Angle", [KEY_ZOOM] = "Zoom", | ||
657 | [KEY_MODE] = "Mode", [KEY_KEYBOARD] = "Keyboard", | ||
658 | [KEY_SCREEN] = "Screen", [KEY_PC] = "PC", | ||
659 | [KEY_TV] = "TV", [KEY_TV2] = "TV2", | ||
660 | [KEY_VCR] = "VCR", [KEY_VCR2] = "VCR2", | ||
661 | [KEY_SAT] = "Sat", [KEY_SAT2] = "Sat2", | ||
662 | [KEY_CD] = "CD", [KEY_TAPE] = "Tape", | ||
663 | [KEY_RADIO] = "Radio", [KEY_TUNER] = "Tuner", | ||
664 | [KEY_PLAYER] = "Player", [KEY_TEXT] = "Text", | ||
665 | [KEY_DVD] = "DVD", [KEY_AUX] = "Aux", | ||
666 | [KEY_MP3] = "MP3", [KEY_AUDIO] = "Audio", | ||
667 | [KEY_VIDEO] = "Video", [KEY_DIRECTORY] = "Directory", | ||
668 | [KEY_LIST] = "List", [KEY_MEMO] = "Memo", | ||
669 | [KEY_CALENDAR] = "Calendar", [KEY_RED] = "Red", | ||
670 | [KEY_GREEN] = "Green", [KEY_YELLOW] = "Yellow", | ||
671 | [KEY_BLUE] = "Blue", [KEY_CHANNELUP] = "ChannelUp", | ||
672 | [KEY_CHANNELDOWN] = "ChannelDown", [KEY_FIRST] = "First", | ||
673 | [KEY_LAST] = "Last", [KEY_AB] = "AB", | ||
674 | [KEY_NEXT] = "Next", [KEY_RESTART] = "Restart", | ||
675 | [KEY_SLOW] = "Slow", [KEY_SHUFFLE] = "Shuffle", | ||
676 | [KEY_BREAK] = "Break", [KEY_PREVIOUS] = "Previous", | ||
677 | [KEY_DIGITS] = "Digits", [KEY_TEEN] = "TEEN", | ||
678 | [KEY_TWEN] = "TWEN", [KEY_DEL_EOL] = "DeleteEOL", | ||
679 | [KEY_DEL_EOS] = "DeleteEOS", [KEY_INS_LINE] = "InsertLine", | ||
680 | [KEY_DEL_LINE] = "DeleteLine", | ||
681 | [KEY_SEND] = "Send", [KEY_REPLY] = "Reply", | ||
682 | [KEY_FORWARDMAIL] = "ForwardMail", [KEY_SAVE] = "Save", | ||
683 | [KEY_DOCUMENTS] = "Documents", | ||
684 | [KEY_FN] = "Fn", [KEY_FN_ESC] = "Fn+ESC", | ||
685 | [KEY_FN_1] = "Fn+1", [KEY_FN_2] = "Fn+2", | ||
686 | [KEY_FN_B] = "Fn+B", [KEY_FN_D] = "Fn+D", | ||
687 | [KEY_FN_E] = "Fn+E", [KEY_FN_F] = "Fn+F", | ||
688 | [KEY_FN_S] = "Fn+S", | ||
689 | [KEY_FN_F1] = "Fn+F1", [KEY_FN_F2] = "Fn+F2", | ||
690 | [KEY_FN_F3] = "Fn+F3", [KEY_FN_F4] = "Fn+F4", | ||
691 | [KEY_FN_F5] = "Fn+F5", [KEY_FN_F6] = "Fn+F6", | ||
692 | [KEY_FN_F7] = "Fn+F7", [KEY_FN_F8] = "Fn+F8", | ||
693 | [KEY_FN_F9] = "Fn+F9", [KEY_FN_F10] = "Fn+F10", | ||
694 | [KEY_FN_F11] = "Fn+F11", [KEY_FN_F12] = "Fn+F12", | ||
695 | [KEY_KBDILLUMTOGGLE] = "KbdIlluminationToggle", | ||
696 | [KEY_KBDILLUMDOWN] = "KbdIlluminationDown", | ||
697 | [KEY_KBDILLUMUP] = "KbdIlluminationUp", | ||
698 | [KEY_SWITCHVIDEOMODE] = "SwitchVideoMode", | ||
699 | }; | ||
700 | |||
701 | static char *relatives[REL_MAX + 1] = { | ||
702 | [REL_X] = "X", [REL_Y] = "Y", | ||
703 | [REL_Z] = "Z", [REL_HWHEEL] = "HWheel", | ||
704 | [REL_DIAL] = "Dial", [REL_WHEEL] = "Wheel", | ||
705 | [REL_MISC] = "Misc", | ||
706 | }; | ||
707 | |||
708 | static char *absolutes[ABS_MAX + 1] = { | ||
709 | [ABS_X] = "X", [ABS_Y] = "Y", | ||
710 | [ABS_Z] = "Z", [ABS_RX] = "Rx", | ||
711 | [ABS_RY] = "Ry", [ABS_RZ] = "Rz", | ||
712 | [ABS_THROTTLE] = "Throttle", [ABS_RUDDER] = "Rudder", | ||
713 | [ABS_WHEEL] = "Wheel", [ABS_GAS] = "Gas", | ||
714 | [ABS_BRAKE] = "Brake", [ABS_HAT0X] = "Hat0X", | ||
715 | [ABS_HAT0Y] = "Hat0Y", [ABS_HAT1X] = "Hat1X", | ||
716 | [ABS_HAT1Y] = "Hat1Y", [ABS_HAT2X] = "Hat2X", | ||
717 | [ABS_HAT2Y] = "Hat2Y", [ABS_HAT3X] = "Hat3X", | ||
718 | [ABS_HAT3Y] = "Hat 3Y", [ABS_PRESSURE] = "Pressure", | ||
719 | [ABS_DISTANCE] = "Distance", [ABS_TILT_X] = "XTilt", | ||
720 | [ABS_TILT_Y] = "YTilt", [ABS_TOOL_WIDTH] = "Tool Width", | ||
721 | [ABS_VOLUME] = "Volume", [ABS_MISC] = "Misc", | ||
722 | }; | ||
723 | |||
724 | static char *misc[MSC_MAX + 1] = { | ||
725 | [MSC_SERIAL] = "Serial", [MSC_PULSELED] = "Pulseled", | ||
726 | [MSC_GESTURE] = "Gesture", [MSC_RAW] = "RawData" | ||
727 | }; | ||
728 | |||
729 | static char *leds[LED_MAX + 1] = { | ||
730 | [LED_NUML] = "NumLock", [LED_CAPSL] = "CapsLock", | ||
731 | [LED_SCROLLL] = "ScrollLock", [LED_COMPOSE] = "Compose", | ||
732 | [LED_KANA] = "Kana", [LED_SLEEP] = "Sleep", | ||
733 | [LED_SUSPEND] = "Suspend", [LED_MUTE] = "Mute", | ||
734 | [LED_MISC] = "Misc", | ||
735 | }; | ||
736 | |||
737 | static char *repeats[REP_MAX + 1] = { | ||
738 | [REP_DELAY] = "Delay", [REP_PERIOD] = "Period" | ||
739 | }; | ||
740 | |||
741 | static char *sounds[SND_MAX + 1] = { | ||
742 | [SND_CLICK] = "Click", [SND_BELL] = "Bell", | ||
743 | [SND_TONE] = "Tone" | ||
744 | }; | ||
745 | |||
746 | static char **names[EV_MAX + 1] = { | ||
747 | [EV_SYN] = syncs, [EV_KEY] = keys, | ||
748 | [EV_REL] = relatives, [EV_ABS] = absolutes, | ||
749 | [EV_MSC] = misc, [EV_LED] = leds, | ||
750 | [EV_SND] = sounds, [EV_REP] = repeats, | ||
751 | }; | ||
752 | |||
753 | static void __attribute__((unused)) resolv_event(__u8 type, __u16 code) { | ||
754 | |||
755 | printk("%s.%s", events[type] ? events[type] : "?", | ||
756 | names[type] ? (names[type][code] ? names[type][code] : "?") : "?"); | ||
757 | } | ||
diff --git a/include/linux/hid.h b/include/linux/hid.h new file mode 100644 index 000000000000..770120add15a --- /dev/null +++ b/include/linux/hid.h | |||
@@ -0,0 +1,528 @@ | |||
1 | #ifndef __HID_H | ||
2 | #define __HID_H | ||
3 | |||
4 | /* | ||
5 | * $Id: hid.h,v 1.24 2001/12/27 10:37:41 vojtech Exp $ | ||
6 | * | ||
7 | * Copyright (c) 1999 Andreas Gal | ||
8 | * Copyright (c) 2000-2001 Vojtech Pavlik | ||
9 | * Copyright (c) 2006 Jiri Kosina | ||
10 | */ | ||
11 | |||
12 | /* | ||
13 | * 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 | ||
15 | * the Free Software Foundation; either version 2 of the License, or | ||
16 | * (at your option) any later version. | ||
17 | * | ||
18 | * This program is distributed in the hope that it will be useful, | ||
19 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
20 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
21 | * GNU General Public License for more details. | ||
22 | * | ||
23 | * You should have received a copy of the GNU General Public License | ||
24 | * along with this program; if not, write to the Free Software | ||
25 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
26 | * | ||
27 | * Should you need to contact me, the author, you can do so either by | ||
28 | * e-mail - mail your message to <vojtech@ucw.cz>, or by paper mail: | ||
29 | * Vojtech Pavlik, Simunkova 1594, Prague 8, 182 00 Czech Republic | ||
30 | */ | ||
31 | |||
32 | #include <linux/types.h> | ||
33 | #include <linux/slab.h> | ||
34 | #include <linux/list.h> | ||
35 | #include <linux/timer.h> | ||
36 | #include <linux/workqueue.h> | ||
37 | #include <linux/input.h> | ||
38 | |||
39 | /* | ||
40 | * USB HID (Human Interface Device) interface class code | ||
41 | */ | ||
42 | |||
43 | #define USB_INTERFACE_CLASS_HID 3 | ||
44 | |||
45 | /* | ||
46 | * USB HID interface subclass and protocol codes | ||
47 | */ | ||
48 | |||
49 | #define USB_INTERFACE_SUBCLASS_BOOT 1 | ||
50 | #define USB_INTERFACE_PROTOCOL_KEYBOARD 1 | ||
51 | #define USB_INTERFACE_PROTOCOL_MOUSE 2 | ||
52 | |||
53 | /* | ||
54 | * HID class requests | ||
55 | */ | ||
56 | |||
57 | #define HID_REQ_GET_REPORT 0x01 | ||
58 | #define HID_REQ_GET_IDLE 0x02 | ||
59 | #define HID_REQ_GET_PROTOCOL 0x03 | ||
60 | #define HID_REQ_SET_REPORT 0x09 | ||
61 | #define HID_REQ_SET_IDLE 0x0A | ||
62 | #define HID_REQ_SET_PROTOCOL 0x0B | ||
63 | |||
64 | /* | ||
65 | * HID class descriptor types | ||
66 | */ | ||
67 | |||
68 | #define HID_DT_HID (USB_TYPE_CLASS | 0x01) | ||
69 | #define HID_DT_REPORT (USB_TYPE_CLASS | 0x02) | ||
70 | #define HID_DT_PHYSICAL (USB_TYPE_CLASS | 0x03) | ||
71 | |||
72 | /* | ||
73 | * We parse each description item into this structure. Short items data | ||
74 | * values are expanded to 32-bit signed int, long items contain a pointer | ||
75 | * into the data area. | ||
76 | */ | ||
77 | |||
78 | struct hid_item { | ||
79 | unsigned format; | ||
80 | __u8 size; | ||
81 | __u8 type; | ||
82 | __u8 tag; | ||
83 | union { | ||
84 | __u8 u8; | ||
85 | __s8 s8; | ||
86 | __u16 u16; | ||
87 | __s16 s16; | ||
88 | __u32 u32; | ||
89 | __s32 s32; | ||
90 | __u8 *longdata; | ||
91 | } data; | ||
92 | }; | ||
93 | |||
94 | /* | ||
95 | * HID report item format | ||
96 | */ | ||
97 | |||
98 | #define HID_ITEM_FORMAT_SHORT 0 | ||
99 | #define HID_ITEM_FORMAT_LONG 1 | ||
100 | |||
101 | /* | ||
102 | * Special tag indicating long items | ||
103 | */ | ||
104 | |||
105 | #define HID_ITEM_TAG_LONG 15 | ||
106 | |||
107 | /* | ||
108 | * HID report descriptor item type (prefix bit 2,3) | ||
109 | */ | ||
110 | |||
111 | #define HID_ITEM_TYPE_MAIN 0 | ||
112 | #define HID_ITEM_TYPE_GLOBAL 1 | ||
113 | #define HID_ITEM_TYPE_LOCAL 2 | ||
114 | #define HID_ITEM_TYPE_RESERVED 3 | ||
115 | |||
116 | /* | ||
117 | * HID report descriptor main item tags | ||
118 | */ | ||
119 | |||
120 | #define HID_MAIN_ITEM_TAG_INPUT 8 | ||
121 | #define HID_MAIN_ITEM_TAG_OUTPUT 9 | ||
122 | #define HID_MAIN_ITEM_TAG_FEATURE 11 | ||
123 | #define HID_MAIN_ITEM_TAG_BEGIN_COLLECTION 10 | ||
124 | #define HID_MAIN_ITEM_TAG_END_COLLECTION 12 | ||
125 | |||
126 | /* | ||
127 | * HID report descriptor main item contents | ||
128 | */ | ||
129 | |||
130 | #define HID_MAIN_ITEM_CONSTANT 0x001 | ||
131 | #define HID_MAIN_ITEM_VARIABLE 0x002 | ||
132 | #define HID_MAIN_ITEM_RELATIVE 0x004 | ||
133 | #define HID_MAIN_ITEM_WRAP 0x008 | ||
134 | #define HID_MAIN_ITEM_NONLINEAR 0x010 | ||
135 | #define HID_MAIN_ITEM_NO_PREFERRED 0x020 | ||
136 | #define HID_MAIN_ITEM_NULL_STATE 0x040 | ||
137 | #define HID_MAIN_ITEM_VOLATILE 0x080 | ||
138 | #define HID_MAIN_ITEM_BUFFERED_BYTE 0x100 | ||
139 | |||
140 | /* | ||
141 | * HID report descriptor collection item types | ||
142 | */ | ||
143 | |||
144 | #define HID_COLLECTION_PHYSICAL 0 | ||
145 | #define HID_COLLECTION_APPLICATION 1 | ||
146 | #define HID_COLLECTION_LOGICAL 2 | ||
147 | |||
148 | /* | ||
149 | * HID report descriptor global item tags | ||
150 | */ | ||
151 | |||
152 | #define HID_GLOBAL_ITEM_TAG_USAGE_PAGE 0 | ||
153 | #define HID_GLOBAL_ITEM_TAG_LOGICAL_MINIMUM 1 | ||
154 | #define HID_GLOBAL_ITEM_TAG_LOGICAL_MAXIMUM 2 | ||
155 | #define HID_GLOBAL_ITEM_TAG_PHYSICAL_MINIMUM 3 | ||
156 | #define HID_GLOBAL_ITEM_TAG_PHYSICAL_MAXIMUM 4 | ||
157 | #define HID_GLOBAL_ITEM_TAG_UNIT_EXPONENT 5 | ||
158 | #define HID_GLOBAL_ITEM_TAG_UNIT 6 | ||
159 | #define HID_GLOBAL_ITEM_TAG_REPORT_SIZE 7 | ||
160 | #define HID_GLOBAL_ITEM_TAG_REPORT_ID 8 | ||
161 | #define HID_GLOBAL_ITEM_TAG_REPORT_COUNT 9 | ||
162 | #define HID_GLOBAL_ITEM_TAG_PUSH 10 | ||
163 | #define HID_GLOBAL_ITEM_TAG_POP 11 | ||
164 | |||
165 | /* | ||
166 | * HID report descriptor local item tags | ||
167 | */ | ||
168 | |||
169 | #define HID_LOCAL_ITEM_TAG_USAGE 0 | ||
170 | #define HID_LOCAL_ITEM_TAG_USAGE_MINIMUM 1 | ||
171 | #define HID_LOCAL_ITEM_TAG_USAGE_MAXIMUM 2 | ||
172 | #define HID_LOCAL_ITEM_TAG_DESIGNATOR_INDEX 3 | ||
173 | #define HID_LOCAL_ITEM_TAG_DESIGNATOR_MINIMUM 4 | ||
174 | #define HID_LOCAL_ITEM_TAG_DESIGNATOR_MAXIMUM 5 | ||
175 | #define HID_LOCAL_ITEM_TAG_STRING_INDEX 7 | ||
176 | #define HID_LOCAL_ITEM_TAG_STRING_MINIMUM 8 | ||
177 | #define HID_LOCAL_ITEM_TAG_STRING_MAXIMUM 9 | ||
178 | #define HID_LOCAL_ITEM_TAG_DELIMITER 10 | ||
179 | |||
180 | /* | ||
181 | * HID usage tables | ||
182 | */ | ||
183 | |||
184 | #define HID_USAGE_PAGE 0xffff0000 | ||
185 | |||
186 | #define HID_UP_UNDEFINED 0x00000000 | ||
187 | #define HID_UP_GENDESK 0x00010000 | ||
188 | #define HID_UP_SIMULATION 0x00020000 | ||
189 | #define HID_UP_KEYBOARD 0x00070000 | ||
190 | #define HID_UP_LED 0x00080000 | ||
191 | #define HID_UP_BUTTON 0x00090000 | ||
192 | #define HID_UP_ORDINAL 0x000a0000 | ||
193 | #define HID_UP_CONSUMER 0x000c0000 | ||
194 | #define HID_UP_DIGITIZER 0x000d0000 | ||
195 | #define HID_UP_PID 0x000f0000 | ||
196 | #define HID_UP_HPVENDOR 0xff7f0000 | ||
197 | #define HID_UP_MSVENDOR 0xff000000 | ||
198 | #define HID_UP_CUSTOM 0x00ff0000 | ||
199 | #define HID_UP_LOGIVENDOR 0xffbc0000 | ||
200 | |||
201 | #define HID_USAGE 0x0000ffff | ||
202 | |||
203 | #define HID_GD_POINTER 0x00010001 | ||
204 | #define HID_GD_MOUSE 0x00010002 | ||
205 | #define HID_GD_JOYSTICK 0x00010004 | ||
206 | #define HID_GD_GAMEPAD 0x00010005 | ||
207 | #define HID_GD_KEYBOARD 0x00010006 | ||
208 | #define HID_GD_KEYPAD 0x00010007 | ||
209 | #define HID_GD_MULTIAXIS 0x00010008 | ||
210 | #define HID_GD_X 0x00010030 | ||
211 | #define HID_GD_Y 0x00010031 | ||
212 | #define HID_GD_Z 0x00010032 | ||
213 | #define HID_GD_RX 0x00010033 | ||
214 | #define HID_GD_RY 0x00010034 | ||
215 | #define HID_GD_RZ 0x00010035 | ||
216 | #define HID_GD_SLIDER 0x00010036 | ||
217 | #define HID_GD_DIAL 0x00010037 | ||
218 | #define HID_GD_WHEEL 0x00010038 | ||
219 | #define HID_GD_HATSWITCH 0x00010039 | ||
220 | #define HID_GD_BUFFER 0x0001003a | ||
221 | #define HID_GD_BYTECOUNT 0x0001003b | ||
222 | #define HID_GD_MOTION 0x0001003c | ||
223 | #define HID_GD_START 0x0001003d | ||
224 | #define HID_GD_SELECT 0x0001003e | ||
225 | #define HID_GD_VX 0x00010040 | ||
226 | #define HID_GD_VY 0x00010041 | ||
227 | #define HID_GD_VZ 0x00010042 | ||
228 | #define HID_GD_VBRX 0x00010043 | ||
229 | #define HID_GD_VBRY 0x00010044 | ||
230 | #define HID_GD_VBRZ 0x00010045 | ||
231 | #define HID_GD_VNO 0x00010046 | ||
232 | #define HID_GD_FEATURE 0x00010047 | ||
233 | #define HID_GD_UP 0x00010090 | ||
234 | #define HID_GD_DOWN 0x00010091 | ||
235 | #define HID_GD_RIGHT 0x00010092 | ||
236 | #define HID_GD_LEFT 0x00010093 | ||
237 | |||
238 | /* | ||
239 | * HID report types --- Ouch! HID spec says 1 2 3! | ||
240 | */ | ||
241 | |||
242 | #define HID_INPUT_REPORT 0 | ||
243 | #define HID_OUTPUT_REPORT 1 | ||
244 | #define HID_FEATURE_REPORT 2 | ||
245 | |||
246 | /* | ||
247 | * HID device quirks. | ||
248 | */ | ||
249 | |||
250 | #define HID_QUIRK_INVERT 0x00000001 | ||
251 | #define HID_QUIRK_NOTOUCH 0x00000002 | ||
252 | #define HID_QUIRK_IGNORE 0x00000004 | ||
253 | #define HID_QUIRK_NOGET 0x00000008 | ||
254 | #define HID_QUIRK_HIDDEV 0x00000010 | ||
255 | #define HID_QUIRK_BADPAD 0x00000020 | ||
256 | #define HID_QUIRK_MULTI_INPUT 0x00000040 | ||
257 | #define HID_QUIRK_2WHEEL_MOUSE_HACK_7 0x00000080 | ||
258 | #define HID_QUIRK_2WHEEL_MOUSE_HACK_5 0x00000100 | ||
259 | #define HID_QUIRK_2WHEEL_MOUSE_HACK_ON 0x00000200 | ||
260 | #define HID_QUIRK_MIGHTYMOUSE 0x00000400 | ||
261 | #define HID_QUIRK_CYMOTION 0x00000800 | ||
262 | #define HID_QUIRK_POWERBOOK_HAS_FN 0x00001000 | ||
263 | #define HID_QUIRK_POWERBOOK_FN_ON 0x00002000 | ||
264 | #define HID_QUIRK_INVERT_HWHEEL 0x00004000 | ||
265 | #define HID_QUIRK_POWERBOOK_ISO_KEYBOARD 0x00008000 | ||
266 | #define HID_QUIRK_BAD_RELATIVE_KEYS 0x00010000 | ||
267 | |||
268 | /* | ||
269 | * This is the global environment of the parser. This information is | ||
270 | * persistent for main-items. The global environment can be saved and | ||
271 | * restored with PUSH/POP statements. | ||
272 | */ | ||
273 | |||
274 | struct hid_global { | ||
275 | unsigned usage_page; | ||
276 | __s32 logical_minimum; | ||
277 | __s32 logical_maximum; | ||
278 | __s32 physical_minimum; | ||
279 | __s32 physical_maximum; | ||
280 | __s32 unit_exponent; | ||
281 | unsigned unit; | ||
282 | unsigned report_id; | ||
283 | unsigned report_size; | ||
284 | unsigned report_count; | ||
285 | }; | ||
286 | |||
287 | /* | ||
288 | * This is the local environment. It is persistent up the next main-item. | ||
289 | */ | ||
290 | |||
291 | #define HID_MAX_DESCRIPTOR_SIZE 4096 | ||
292 | #define HID_MAX_USAGES 1024 | ||
293 | #define HID_DEFAULT_NUM_COLLECTIONS 16 | ||
294 | |||
295 | struct hid_local { | ||
296 | unsigned usage[HID_MAX_USAGES]; /* usage array */ | ||
297 | unsigned collection_index[HID_MAX_USAGES]; /* collection index array */ | ||
298 | unsigned usage_index; | ||
299 | unsigned usage_minimum; | ||
300 | unsigned delimiter_depth; | ||
301 | unsigned delimiter_branch; | ||
302 | }; | ||
303 | |||
304 | /* | ||
305 | * This is the collection stack. We climb up the stack to determine | ||
306 | * application and function of each field. | ||
307 | */ | ||
308 | |||
309 | struct hid_collection { | ||
310 | unsigned type; | ||
311 | unsigned usage; | ||
312 | unsigned level; | ||
313 | }; | ||
314 | |||
315 | struct hid_usage { | ||
316 | unsigned hid; /* hid usage code */ | ||
317 | unsigned collection_index; /* index into collection array */ | ||
318 | /* hidinput data */ | ||
319 | __u16 code; /* input driver code */ | ||
320 | __u8 type; /* input driver type */ | ||
321 | __s8 hat_min; /* hat switch fun */ | ||
322 | __s8 hat_max; /* ditto */ | ||
323 | __s8 hat_dir; /* ditto */ | ||
324 | }; | ||
325 | |||
326 | struct hid_input; | ||
327 | |||
328 | struct hid_field { | ||
329 | unsigned physical; /* physical usage for this field */ | ||
330 | unsigned logical; /* logical usage for this field */ | ||
331 | unsigned application; /* application usage for this field */ | ||
332 | struct hid_usage *usage; /* usage table for this function */ | ||
333 | unsigned maxusage; /* maximum usage index */ | ||
334 | unsigned flags; /* main-item flags (i.e. volatile,array,constant) */ | ||
335 | unsigned report_offset; /* bit offset in the report */ | ||
336 | unsigned report_size; /* size of this field in the report */ | ||
337 | unsigned report_count; /* number of this field in the report */ | ||
338 | unsigned report_type; /* (input,output,feature) */ | ||
339 | __s32 *value; /* last known value(s) */ | ||
340 | __s32 logical_minimum; | ||
341 | __s32 logical_maximum; | ||
342 | __s32 physical_minimum; | ||
343 | __s32 physical_maximum; | ||
344 | __s32 unit_exponent; | ||
345 | unsigned unit; | ||
346 | struct hid_report *report; /* associated report */ | ||
347 | unsigned index; /* index into report->field[] */ | ||
348 | /* hidinput data */ | ||
349 | struct hid_input *hidinput; /* associated input structure */ | ||
350 | __u16 dpad; /* dpad input code */ | ||
351 | }; | ||
352 | |||
353 | #define HID_MAX_FIELDS 64 | ||
354 | |||
355 | struct hid_report { | ||
356 | struct list_head list; | ||
357 | unsigned id; /* id of this report */ | ||
358 | unsigned type; /* report type */ | ||
359 | struct hid_field *field[HID_MAX_FIELDS]; /* fields of the report */ | ||
360 | unsigned maxfield; /* maximum valid field index */ | ||
361 | unsigned size; /* size of the report (bits) */ | ||
362 | struct hid_device *device; /* associated device */ | ||
363 | }; | ||
364 | |||
365 | struct hid_report_enum { | ||
366 | unsigned numbered; | ||
367 | struct list_head report_list; | ||
368 | struct hid_report *report_id_hash[256]; | ||
369 | }; | ||
370 | |||
371 | #define HID_REPORT_TYPES 3 | ||
372 | |||
373 | #define HID_MIN_BUFFER_SIZE 64 /* make sure there is at least a packet size of space */ | ||
374 | #define HID_MAX_BUFFER_SIZE 4096 /* 4kb */ | ||
375 | #define HID_CONTROL_FIFO_SIZE 256 /* to init devices with >100 reports */ | ||
376 | #define HID_OUTPUT_FIFO_SIZE 64 | ||
377 | |||
378 | struct hid_control_fifo { | ||
379 | unsigned char dir; | ||
380 | struct hid_report *report; | ||
381 | }; | ||
382 | |||
383 | #define HID_CLAIMED_INPUT 1 | ||
384 | #define HID_CLAIMED_HIDDEV 2 | ||
385 | |||
386 | #define HID_CTRL_RUNNING 1 | ||
387 | #define HID_OUT_RUNNING 2 | ||
388 | #define HID_IN_RUNNING 3 | ||
389 | #define HID_RESET_PENDING 4 | ||
390 | #define HID_SUSPENDED 5 | ||
391 | #define HID_CLEAR_HALT 6 | ||
392 | |||
393 | struct hid_input { | ||
394 | struct list_head list; | ||
395 | struct hid_report *report; | ||
396 | struct input_dev *input; | ||
397 | }; | ||
398 | |||
399 | struct hid_device { /* device report descriptor */ | ||
400 | __u8 *rdesc; | ||
401 | unsigned rsize; | ||
402 | struct hid_collection *collection; /* List of HID collections */ | ||
403 | unsigned collection_size; /* Number of allocated hid_collections */ | ||
404 | unsigned maxcollection; /* Number of parsed collections */ | ||
405 | unsigned maxapplication; /* Number of applications */ | ||
406 | unsigned short bus; /* BUS ID */ | ||
407 | unsigned short vendor; /* Vendor ID */ | ||
408 | unsigned short product; /* Product ID */ | ||
409 | unsigned version; /* HID version */ | ||
410 | unsigned country; /* HID country */ | ||
411 | struct hid_report_enum report_enum[HID_REPORT_TYPES]; | ||
412 | |||
413 | struct device *dev; /* device */ | ||
414 | |||
415 | unsigned claimed; /* Claimed by hidinput, hiddev? */ | ||
416 | unsigned quirks; /* Various quirks the device can pull on us */ | ||
417 | |||
418 | struct list_head inputs; /* The list of inputs */ | ||
419 | void *hiddev; /* The hiddev structure */ | ||
420 | int minor; /* Hiddev minor number */ | ||
421 | |||
422 | wait_queue_head_t wait; /* For sleeping */ | ||
423 | |||
424 | int open; /* is the device open by anyone? */ | ||
425 | char name[128]; /* Device name */ | ||
426 | char phys[64]; /* Device physical location */ | ||
427 | char uniq[64]; /* Device unique identifier (serial #) */ | ||
428 | |||
429 | void *driver_data; | ||
430 | |||
431 | /* device-specific function pointers */ | ||
432 | int (*hidinput_input_event) (struct input_dev *, unsigned int, unsigned int, int); | ||
433 | int (*hidinput_open) (struct input_dev *); | ||
434 | void (*hidinput_close) (struct input_dev *); | ||
435 | |||
436 | /* hiddev event handler */ | ||
437 | void (*hiddev_hid_event) (struct hid_device *, struct hid_field *field, | ||
438 | struct hid_usage *, __s32); | ||
439 | void (*hiddev_report_event) (struct hid_device *, struct hid_report *); | ||
440 | #ifdef CONFIG_USB_HIDINPUT_POWERBOOK | ||
441 | unsigned int pb_fnmode; | ||
442 | unsigned long pb_pressed_fn[NBITS(KEY_MAX)]; | ||
443 | unsigned long pb_pressed_numlock[NBITS(KEY_MAX)]; | ||
444 | #endif | ||
445 | }; | ||
446 | |||
447 | #define HID_GLOBAL_STACK_SIZE 4 | ||
448 | #define HID_COLLECTION_STACK_SIZE 4 | ||
449 | |||
450 | struct hid_parser { | ||
451 | struct hid_global global; | ||
452 | struct hid_global global_stack[HID_GLOBAL_STACK_SIZE]; | ||
453 | unsigned global_stack_ptr; | ||
454 | struct hid_local local; | ||
455 | unsigned collection_stack[HID_COLLECTION_STACK_SIZE]; | ||
456 | unsigned collection_stack_ptr; | ||
457 | struct hid_device *device; | ||
458 | }; | ||
459 | |||
460 | struct hid_class_descriptor { | ||
461 | __u8 bDescriptorType; | ||
462 | __u16 wDescriptorLength; | ||
463 | } __attribute__ ((packed)); | ||
464 | |||
465 | struct hid_descriptor { | ||
466 | __u8 bLength; | ||
467 | __u8 bDescriptorType; | ||
468 | __u16 bcdHID; | ||
469 | __u8 bCountryCode; | ||
470 | __u8 bNumDescriptors; | ||
471 | |||
472 | struct hid_class_descriptor desc[1]; | ||
473 | } __attribute__ ((packed)); | ||
474 | |||
475 | #ifdef DEBUG | ||
476 | #include "hid-debug.h" | ||
477 | #else | ||
478 | #define hid_dump_input(a,b) do { } while (0) | ||
479 | #define hid_dump_device(c) do { } while (0) | ||
480 | #define hid_dump_field(a,b) do { } while (0) | ||
481 | #define resolv_usage(a) do { } while (0) | ||
482 | #define resolv_event(a,b) do { } while (0) | ||
483 | #endif | ||
484 | |||
485 | /* Applications from HID Usage Tables 4/8/99 Version 1.1 */ | ||
486 | /* We ignore a few input applications that are not widely used */ | ||
487 | #define IS_INPUT_APPLICATION(a) (((a >= 0x00010000) && (a <= 0x00010008)) || (a == 0x00010080) || (a == 0x000c0001)) | ||
488 | |||
489 | /* HID core API */ | ||
490 | extern void hidinput_hid_event(struct hid_device *, struct hid_field *, struct hid_usage *, __s32); | ||
491 | extern void hidinput_report_event(struct hid_device *hid, struct hid_report *report); | ||
492 | extern int hidinput_connect(struct hid_device *); | ||
493 | extern void hidinput_disconnect(struct hid_device *); | ||
494 | |||
495 | int hid_set_field(struct hid_field *, unsigned, __s32); | ||
496 | int hid_input_report(struct hid_device *, int type, u8 *, int, int); | ||
497 | int hidinput_find_field(struct hid_device *hid, unsigned int type, unsigned int code, struct hid_field **field); | ||
498 | void hid_input_field(struct hid_device *hid, struct hid_field *field, __u8 *data, int interrupt); | ||
499 | void hid_output_report(struct hid_report *report, __u8 *data); | ||
500 | void hid_free_device(struct hid_device *device); | ||
501 | struct hid_device *hid_parse_report(__u8 *start, unsigned size); | ||
502 | |||
503 | #ifdef CONFIG_HID_FF | ||
504 | int hid_ff_init(struct hid_device *hid); | ||
505 | |||
506 | int hid_lgff_init(struct hid_device *hid); | ||
507 | int hid_tmff_init(struct hid_device *hid); | ||
508 | int hid_zpff_init(struct hid_device *hid); | ||
509 | #ifdef CONFIG_HID_PID | ||
510 | int hid_pidff_init(struct hid_device *hid); | ||
511 | #else | ||
512 | static inline int hid_pidff_init(struct hid_device *hid) { return -ENODEV; } | ||
513 | #endif | ||
514 | |||
515 | #else | ||
516 | static inline int hid_ff_init(struct hid_device *hid) { return -1; } | ||
517 | #endif | ||
518 | #ifdef DEBUG | ||
519 | #define dbg(format, arg...) printk(KERN_DEBUG "%s: " format "\n" , \ | ||
520 | __FILE__ , ## arg) | ||
521 | #else | ||
522 | #define dbg(format, arg...) do {} while (0) | ||
523 | #endif | ||
524 | |||
525 | #define err(format, arg...) printk(KERN_ERR "%s: " format "\n" , \ | ||
526 | __FILE__ , ## arg) | ||
527 | #endif | ||
528 | |||
diff --git a/include/linux/i2c-algo-bit.h b/include/linux/i2c-algo-bit.h index c8f8df25c7e0..937da70cb4c4 100644 --- a/include/linux/i2c-algo-bit.h +++ b/include/linux/i2c-algo-bit.h | |||
@@ -26,9 +26,9 @@ | |||
26 | 26 | ||
27 | /* --- Defines for bit-adapters --------------------------------------- */ | 27 | /* --- Defines for bit-adapters --------------------------------------- */ |
28 | /* | 28 | /* |
29 | * This struct contains the hw-dependent functions of bit-style adapters to | 29 | * This struct contains the hw-dependent functions of bit-style adapters to |
30 | * manipulate the line states, and to init any hw-specific features. This is | 30 | * manipulate the line states, and to init any hw-specific features. This is |
31 | * only used if you have more than one hw-type of adapter running. | 31 | * only used if you have more than one hw-type of adapter running. |
32 | */ | 32 | */ |
33 | struct i2c_algo_bit_data { | 33 | struct i2c_algo_bit_data { |
34 | void *data; /* private data for lowlevel routines */ | 34 | void *data; /* private data for lowlevel routines */ |
@@ -44,6 +44,5 @@ struct i2c_algo_bit_data { | |||
44 | }; | 44 | }; |
45 | 45 | ||
46 | int i2c_bit_add_bus(struct i2c_adapter *); | 46 | int i2c_bit_add_bus(struct i2c_adapter *); |
47 | int i2c_bit_del_bus(struct i2c_adapter *); | ||
48 | 47 | ||
49 | #endif /* _LINUX_I2C_ALGO_BIT_H */ | 48 | #endif /* _LINUX_I2C_ALGO_BIT_H */ |
diff --git a/include/linux/i2c-algo-ite.h b/include/linux/i2c-algo-ite.h deleted file mode 100644 index 0073fe96c76e..000000000000 --- a/include/linux/i2c-algo-ite.h +++ /dev/null | |||
@@ -1,72 +0,0 @@ | |||
1 | /* ------------------------------------------------------------------------- */ | ||
2 | /* i2c-algo-ite.h i2c driver algorithms for ITE IIC adapters */ | ||
3 | /* ------------------------------------------------------------------------- */ | ||
4 | /* Copyright (C) 1995-97 Simon G. Vogl | ||
5 | 1998-99 Hans Berglund | ||
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 as published by | ||
9 | the Free Software Foundation; either version 2 of the License, or | ||
10 | (at your option) any later version. | ||
11 | |||
12 | This program is distributed in the hope that it will be useful, | ||
13 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
15 | GNU General Public License for more details. | ||
16 | |||
17 | You should have received a copy of the GNU General Public License | ||
18 | along with this program; if not, write to the Free Software | ||
19 | Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ | ||
20 | /* ------------------------------------------------------------------------- */ | ||
21 | |||
22 | /* With some changes from Kyösti Mälkki <kmalkki@cc.hut.fi> and even | ||
23 | Frodo Looijaard <frodol@dds.nl> */ | ||
24 | |||
25 | /* Modifications by MontaVista Software, 2001 | ||
26 | Changes made to support the ITE IIC peripheral */ | ||
27 | |||
28 | |||
29 | #ifndef I2C_ALGO_ITE_H | ||
30 | #define I2C_ALGO_ITE_H 1 | ||
31 | |||
32 | #include <linux/types.h> | ||
33 | |||
34 | /* Example of a sequential read request: | ||
35 | struct i2c_iic_msg s_msg; | ||
36 | |||
37 | s_msg.addr=device_address; | ||
38 | s_msg.len=length; | ||
39 | s_msg.buf=buffer; | ||
40 | s_msg.waddr=word_address; | ||
41 | ioctl(file,I2C_SREAD, &s_msg); | ||
42 | */ | ||
43 | #define I2C_SREAD 0x780 /* SREAD ioctl command */ | ||
44 | |||
45 | struct i2c_iic_msg { | ||
46 | __u16 addr; /* device address */ | ||
47 | __u16 waddr; /* word address */ | ||
48 | short len; /* msg length */ | ||
49 | char *buf; /* pointer to msg data */ | ||
50 | }; | ||
51 | |||
52 | #ifdef __KERNEL__ | ||
53 | struct i2c_adapter; | ||
54 | |||
55 | struct i2c_algo_iic_data { | ||
56 | void *data; /* private data for lolevel routines */ | ||
57 | void (*setiic) (void *data, int ctl, int val); | ||
58 | int (*getiic) (void *data, int ctl); | ||
59 | int (*getown) (void *data); | ||
60 | int (*getclock) (void *data); | ||
61 | void (*waitforpin) (void); | ||
62 | |||
63 | /* local settings */ | ||
64 | int udelay; | ||
65 | int mdelay; | ||
66 | int timeout; | ||
67 | }; | ||
68 | |||
69 | int i2c_iic_add_bus(struct i2c_adapter *); | ||
70 | int i2c_iic_del_bus(struct i2c_adapter *); | ||
71 | #endif /* __KERNEL__ */ | ||
72 | #endif /* I2C_ALGO_ITE_H */ | ||
diff --git a/include/linux/i2c-algo-pca.h b/include/linux/i2c-algo-pca.h index 226693e0d88b..fce47c051bb1 100644 --- a/include/linux/i2c-algo-pca.h +++ b/include/linux/i2c-algo-pca.h | |||
@@ -10,6 +10,5 @@ struct i2c_algo_pca_data { | |||
10 | }; | 10 | }; |
11 | 11 | ||
12 | int i2c_pca_add_bus(struct i2c_adapter *); | 12 | int i2c_pca_add_bus(struct i2c_adapter *); |
13 | int i2c_pca_del_bus(struct i2c_adapter *); | ||
14 | 13 | ||
15 | #endif /* _LINUX_I2C_ALGO_PCA_H */ | 14 | #endif /* _LINUX_I2C_ALGO_PCA_H */ |
diff --git a/include/linux/i2c-algo-pcf.h b/include/linux/i2c-algo-pcf.h index 9908f3fc4839..994eb86f882c 100644 --- a/include/linux/i2c-algo-pcf.h +++ b/include/linux/i2c-algo-pcf.h | |||
@@ -31,7 +31,7 @@ struct i2c_algo_pcf_data { | |||
31 | int (*getpcf) (void *data, int ctl); | 31 | int (*getpcf) (void *data, int ctl); |
32 | int (*getown) (void *data); | 32 | int (*getown) (void *data); |
33 | int (*getclock) (void *data); | 33 | int (*getclock) (void *data); |
34 | void (*waitforpin) (void); | 34 | void (*waitforpin) (void); |
35 | 35 | ||
36 | /* local settings */ | 36 | /* local settings */ |
37 | int udelay; | 37 | int udelay; |
@@ -39,6 +39,5 @@ struct i2c_algo_pcf_data { | |||
39 | }; | 39 | }; |
40 | 40 | ||
41 | int i2c_pcf_add_bus(struct i2c_adapter *); | 41 | int i2c_pcf_add_bus(struct i2c_adapter *); |
42 | int i2c_pcf_del_bus(struct i2c_adapter *); | ||
43 | 42 | ||
44 | #endif /* _LINUX_I2C_ALGO_PCF_H */ | 43 | #endif /* _LINUX_I2C_ALGO_PCF_H */ |
diff --git a/include/linux/i2c-algo-sgi.h b/include/linux/i2c-algo-sgi.h index 4a0113d64064..3b7715024e69 100644 --- a/include/linux/i2c-algo-sgi.h +++ b/include/linux/i2c-algo-sgi.h | |||
@@ -22,6 +22,5 @@ struct i2c_algo_sgi_data { | |||
22 | }; | 22 | }; |
23 | 23 | ||
24 | int i2c_sgi_add_bus(struct i2c_adapter *); | 24 | int i2c_sgi_add_bus(struct i2c_adapter *); |
25 | int i2c_sgi_del_bus(struct i2c_adapter *); | ||
26 | 25 | ||
27 | #endif /* I2C_ALGO_SGI_H */ | 26 | #endif /* I2C_ALGO_SGI_H */ |
diff --git a/include/linux/i2c-id.h b/include/linux/i2c-id.h index 0a8f750cbede..7ae3c3326643 100644 --- a/include/linux/i2c-id.h +++ b/include/linux/i2c-id.h | |||
@@ -1,7 +1,7 @@ | |||
1 | /* ------------------------------------------------------------------------- */ | 1 | /* ------------------------------------------------------------------------- */ |
2 | /* */ | 2 | /* */ |
3 | /* i2c-id.h - identifier values for i2c drivers and adapters */ | 3 | /* i2c-id.h - identifier values for i2c drivers and adapters */ |
4 | /* */ | 4 | /* */ |
5 | /* ------------------------------------------------------------------------- */ | 5 | /* ------------------------------------------------------------------------- */ |
6 | /* Copyright (C) 1995-1999 Simon G. Vogl | 6 | /* Copyright (C) 1995-1999 Simon G. Vogl |
7 | 7 | ||
@@ -40,10 +40,10 @@ | |||
40 | #define I2C_DRIVERID_SAA7120 11 /* video encoder */ | 40 | #define I2C_DRIVERID_SAA7120 11 /* video encoder */ |
41 | #define I2C_DRIVERID_SAA7121 12 /* video encoder */ | 41 | #define I2C_DRIVERID_SAA7121 12 /* video encoder */ |
42 | #define I2C_DRIVERID_SAA7185B 13 /* video encoder */ | 42 | #define I2C_DRIVERID_SAA7185B 13 /* video encoder */ |
43 | #define I2C_DRIVERID_CH7003 14 /* digital pc to tv encoder */ | 43 | #define I2C_DRIVERID_CH7003 14 /* digital pc to tv encoder */ |
44 | #define I2C_DRIVERID_PCF8574A 15 /* i2c expander - 8 bit in/out */ | 44 | #define I2C_DRIVERID_PCF8574A 15 /* i2c expander - 8 bit in/out */ |
45 | #define I2C_DRIVERID_PCF8582C 16 /* eeprom */ | 45 | #define I2C_DRIVERID_PCF8582C 16 /* eeprom */ |
46 | #define I2C_DRIVERID_AT24Cxx 17 /* eeprom 1/2/4/8/16 K */ | 46 | #define I2C_DRIVERID_AT24Cxx 17 /* eeprom 1/2/4/8/16 K */ |
47 | #define I2C_DRIVERID_TEA6300 18 /* audio mixer */ | 47 | #define I2C_DRIVERID_TEA6300 18 /* audio mixer */ |
48 | #define I2C_DRIVERID_BT829 19 /* pc to tv encoder */ | 48 | #define I2C_DRIVERID_BT829 19 /* pc to tv encoder */ |
49 | #define I2C_DRIVERID_TDA9850 20 /* audio mixer */ | 49 | #define I2C_DRIVERID_TDA9850 20 /* audio mixer */ |
@@ -82,9 +82,8 @@ | |||
82 | #define I2C_DRIVERID_STM41T00 52 /* real time clock */ | 82 | #define I2C_DRIVERID_STM41T00 52 /* real time clock */ |
83 | #define I2C_DRIVERID_UDA1342 53 /* UDA1342 audio codec */ | 83 | #define I2C_DRIVERID_UDA1342 53 /* UDA1342 audio codec */ |
84 | #define I2C_DRIVERID_ADV7170 54 /* video encoder */ | 84 | #define I2C_DRIVERID_ADV7170 54 /* video encoder */ |
85 | #define I2C_DRIVERID_RADEON 55 /* I2C bus on Radeon boards */ | ||
86 | #define I2C_DRIVERID_MAX1617 56 /* temp sensor */ | 85 | #define I2C_DRIVERID_MAX1617 56 /* temp sensor */ |
87 | #define I2C_DRIVERID_SAA7191 57 /* video encoder */ | 86 | #define I2C_DRIVERID_SAA7191 57 /* video decoder */ |
88 | #define I2C_DRIVERID_INDYCAM 58 /* SGI IndyCam */ | 87 | #define I2C_DRIVERID_INDYCAM 58 /* SGI IndyCam */ |
89 | #define I2C_DRIVERID_BT832 59 /* CMOS camera video processor */ | 88 | #define I2C_DRIVERID_BT832 59 /* CMOS camera video processor */ |
90 | #define I2C_DRIVERID_TDA9887 60 /* TDA988x IF-PLL demodulator */ | 89 | #define I2C_DRIVERID_TDA9887 60 /* TDA988x IF-PLL demodulator */ |
@@ -132,7 +131,6 @@ | |||
132 | #define I2C_DRIVERID_ADM1021 1008 | 131 | #define I2C_DRIVERID_ADM1021 1008 |
133 | #define I2C_DRIVERID_ADM9240 1009 | 132 | #define I2C_DRIVERID_ADM9240 1009 |
134 | #define I2C_DRIVERID_LTC1710 1010 | 133 | #define I2C_DRIVERID_LTC1710 1010 |
135 | #define I2C_DRIVERID_ICSPLL 1012 | ||
136 | #define I2C_DRIVERID_BT869 1013 | 134 | #define I2C_DRIVERID_BT869 1013 |
137 | #define I2C_DRIVERID_MAXILIFE 1014 | 135 | #define I2C_DRIVERID_MAXILIFE 1014 |
138 | #define I2C_DRIVERID_MATORB 1015 | 136 | #define I2C_DRIVERID_MATORB 1015 |
@@ -159,12 +157,13 @@ | |||
159 | #define I2C_DRIVERID_ASB100 1043 | 157 | #define I2C_DRIVERID_ASB100 1043 |
160 | #define I2C_DRIVERID_FSCHER 1046 | 158 | #define I2C_DRIVERID_FSCHER 1046 |
161 | #define I2C_DRIVERID_W83L785TS 1047 | 159 | #define I2C_DRIVERID_W83L785TS 1047 |
160 | #define I2C_DRIVERID_OV7670 1048 /* Omnivision 7670 camera */ | ||
162 | 161 | ||
163 | /* | 162 | /* |
164 | * ---- Adapter types ---------------------------------------------------- | 163 | * ---- Adapter types ---------------------------------------------------- |
165 | */ | 164 | */ |
166 | 165 | ||
167 | /* --- Bit algorithm adapters */ | 166 | /* --- Bit algorithm adapters */ |
168 | #define I2C_HW_B_LP 0x010000 /* Parallel port Philips style */ | 167 | #define I2C_HW_B_LP 0x010000 /* Parallel port Philips style */ |
169 | #define I2C_HW_B_SER 0x010002 /* Serial line interface */ | 168 | #define I2C_HW_B_SER 0x010002 /* Serial line interface */ |
170 | #define I2C_HW_B_BT848 0x010005 /* BT848 video boards */ | 169 | #define I2C_HW_B_BT848 0x010005 /* BT848 video boards */ |
@@ -212,9 +211,6 @@ | |||
212 | /* --- MPC8xx PowerPC adapters */ | 211 | /* --- MPC8xx PowerPC adapters */ |
213 | #define I2C_HW_MPC8XX_EPON 0x110000 /* Eponymous MPC8xx I2C adapter */ | 212 | #define I2C_HW_MPC8XX_EPON 0x110000 /* Eponymous MPC8xx I2C adapter */ |
214 | 213 | ||
215 | /* --- ITE based algorithms */ | ||
216 | #define I2C_HW_I_IIC 0x080000 /* controller on the ITE */ | ||
217 | |||
218 | /* --- PowerPC on-chip adapters */ | 214 | /* --- PowerPC on-chip adapters */ |
219 | #define I2C_HW_OCP 0x120000 /* IBM on-chip I2C adapter */ | 215 | #define I2C_HW_OCP 0x120000 /* IBM on-chip I2C adapter */ |
220 | 216 | ||
@@ -250,6 +246,7 @@ | |||
250 | #define I2C_HW_SMBUS_OV518 0x04000f /* OV518(+) USB 1.1 webcam ICs */ | 246 | #define I2C_HW_SMBUS_OV518 0x04000f /* OV518(+) USB 1.1 webcam ICs */ |
251 | #define I2C_HW_SMBUS_OV519 0x040010 /* OV519 USB 1.1 webcam IC */ | 247 | #define I2C_HW_SMBUS_OV519 0x040010 /* OV519 USB 1.1 webcam IC */ |
252 | #define I2C_HW_SMBUS_OVFX2 0x040011 /* Cypress/OmniVision FX2 webcam */ | 248 | #define I2C_HW_SMBUS_OVFX2 0x040011 /* Cypress/OmniVision FX2 webcam */ |
249 | #define I2C_HW_SMBUS_CAFE 0x040012 /* Marvell 88ALP01 "CAFE" cam */ | ||
253 | 250 | ||
254 | /* --- ISA pseudo-adapter */ | 251 | /* --- ISA pseudo-adapter */ |
255 | #define I2C_HW_ISA 0x050000 | 252 | #define I2C_HW_ISA 0x050000 |
diff --git a/include/linux/i2c-pnx.h b/include/linux/i2c-pnx.h new file mode 100644 index 000000000000..e6e9c814da61 --- /dev/null +++ b/include/linux/i2c-pnx.h | |||
@@ -0,0 +1,43 @@ | |||
1 | /* | ||
2 | * Header file for I2C support on PNX010x/4008. | ||
3 | * | ||
4 | * Author: Dennis Kovalev <dkovalev@ru.mvista.com> | ||
5 | * | ||
6 | * 2004-2006 (c) MontaVista Software, Inc. This file is licensed under | ||
7 | * the terms of the GNU General Public License version 2. This program | ||
8 | * is licensed "as is" without any warranty of any kind, whether express | ||
9 | * or implied. | ||
10 | */ | ||
11 | |||
12 | #ifndef __I2C_PNX_H__ | ||
13 | #define __I2C_PNX_H__ | ||
14 | |||
15 | #include <asm/arch/i2c.h> | ||
16 | |||
17 | struct i2c_pnx_mif { | ||
18 | int ret; /* Return value */ | ||
19 | int mode; /* Interface mode */ | ||
20 | struct completion complete; /* I/O completion */ | ||
21 | struct timer_list timer; /* Timeout */ | ||
22 | char * buf; /* Data buffer */ | ||
23 | int len; /* Length of data buffer */ | ||
24 | }; | ||
25 | |||
26 | struct i2c_pnx_algo_data { | ||
27 | u32 base; | ||
28 | u32 ioaddr; | ||
29 | int irq; | ||
30 | struct i2c_pnx_mif mif; | ||
31 | int last; | ||
32 | }; | ||
33 | |||
34 | struct i2c_pnx_data { | ||
35 | int (*suspend) (struct platform_device *pdev, pm_message_t state); | ||
36 | int (*resume) (struct platform_device *pdev); | ||
37 | u32 (*calculate_input_freq) (struct platform_device *pdev); | ||
38 | int (*set_clock_run) (struct platform_device *pdev); | ||
39 | int (*set_clock_stop) (struct platform_device *pdev); | ||
40 | struct i2c_adapter *adapter; | ||
41 | }; | ||
42 | |||
43 | #endif /* __I2C_PNX_H__ */ | ||
diff --git a/include/linux/i2c.h b/include/linux/i2c.h index 9b5d04768c2c..71e50d3e492f 100644 --- a/include/linux/i2c.h +++ b/include/linux/i2c.h | |||
@@ -1,7 +1,7 @@ | |||
1 | /* ------------------------------------------------------------------------- */ | 1 | /* ------------------------------------------------------------------------- */ |
2 | /* */ | 2 | /* */ |
3 | /* i2c.h - definitions for the i2c-bus interface */ | 3 | /* i2c.h - definitions for the i2c-bus interface */ |
4 | /* */ | 4 | /* */ |
5 | /* ------------------------------------------------------------------------- */ | 5 | /* ------------------------------------------------------------------------- */ |
6 | /* Copyright (C) 1995-2000 Simon G. Vogl | 6 | /* Copyright (C) 1995-2000 Simon G. Vogl |
7 | 7 | ||
@@ -27,7 +27,7 @@ | |||
27 | #define _LINUX_I2C_H | 27 | #define _LINUX_I2C_H |
28 | 28 | ||
29 | #include <linux/types.h> | 29 | #include <linux/types.h> |
30 | #ifdef __KERNEL__ | 30 | #ifdef __KERNEL__ |
31 | #include <linux/module.h> | 31 | #include <linux/module.h> |
32 | #include <linux/i2c-id.h> | 32 | #include <linux/i2c-id.h> |
33 | #include <linux/mod_devicetable.h> | 33 | #include <linux/mod_devicetable.h> |
@@ -53,8 +53,8 @@ union i2c_smbus_data; | |||
53 | 53 | ||
54 | /* | 54 | /* |
55 | * The master routines are the ones normally used to transmit data to devices | 55 | * The master routines are the ones normally used to transmit data to devices |
56 | * on a bus (or read from them). Apart from two basic transfer functions to | 56 | * on a bus (or read from them). Apart from two basic transfer functions to |
57 | * transmit one message at a time, a more complex version can be used to | 57 | * transmit one message at a time, a more complex version can be used to |
58 | * transmit an arbitrary number of messages without interruption. | 58 | * transmit an arbitrary number of messages without interruption. |
59 | */ | 59 | */ |
60 | extern int i2c_master_send(struct i2c_client *,const char* ,int); | 60 | extern int i2c_master_send(struct i2c_client *,const char* ,int); |
@@ -67,10 +67,10 @@ extern int i2c_transfer(struct i2c_adapter *adap, struct i2c_msg *msgs, int num) | |||
67 | 67 | ||
68 | /* This is the very generalized SMBus access routine. You probably do not | 68 | /* This is the very generalized SMBus access routine. You probably do not |
69 | want to use this, though; one of the functions below may be much easier, | 69 | want to use this, though; one of the functions below may be much easier, |
70 | and probably just as fast. | 70 | and probably just as fast. |
71 | Note that we use i2c_adapter here, because you do not need a specific | 71 | Note that we use i2c_adapter here, because you do not need a specific |
72 | smbus adapter to call this function. */ | 72 | smbus adapter to call this function. */ |
73 | extern s32 i2c_smbus_xfer (struct i2c_adapter * adapter, u16 addr, | 73 | extern s32 i2c_smbus_xfer (struct i2c_adapter * adapter, u16 addr, |
74 | unsigned short flags, | 74 | unsigned short flags, |
75 | char read_write, u8 command, int size, | 75 | char read_write, u8 command, int size, |
76 | union i2c_smbus_data * data); | 76 | union i2c_smbus_data * data); |
@@ -112,14 +112,14 @@ struct i2c_driver { | |||
112 | 112 | ||
113 | /* Notifies the driver that a new bus has appeared. This routine | 113 | /* Notifies the driver that a new bus has appeared. This routine |
114 | * can be used by the driver to test if the bus meets its conditions | 114 | * can be used by the driver to test if the bus meets its conditions |
115 | * & seek for the presence of the chip(s) it supports. If found, it | 115 | * & seek for the presence of the chip(s) it supports. If found, it |
116 | * registers the client(s) that are on the bus to the i2c admin. via | 116 | * registers the client(s) that are on the bus to the i2c admin. via |
117 | * i2c_attach_client. | 117 | * i2c_attach_client. |
118 | */ | 118 | */ |
119 | int (*attach_adapter)(struct i2c_adapter *); | 119 | int (*attach_adapter)(struct i2c_adapter *); |
120 | int (*detach_adapter)(struct i2c_adapter *); | 120 | int (*detach_adapter)(struct i2c_adapter *); |
121 | 121 | ||
122 | /* tells the driver that a client is about to be deleted & gives it | 122 | /* tells the driver that a client is about to be deleted & gives it |
123 | * the chance to remove its private data. Also, if the client struct | 123 | * the chance to remove its private data. Also, if the client struct |
124 | * has been dynamically allocated by the driver in the function above, | 124 | * has been dynamically allocated by the driver in the function above, |
125 | * it must be freed here. | 125 | * it must be freed here. |
@@ -139,13 +139,13 @@ struct i2c_driver { | |||
139 | #define I2C_NAME_SIZE 50 | 139 | #define I2C_NAME_SIZE 50 |
140 | 140 | ||
141 | /* | 141 | /* |
142 | * i2c_client identifies a single device (i.e. chip) that is connected to an | 142 | * i2c_client identifies a single device (i.e. chip) that is connected to an |
143 | * i2c bus. The behaviour is defined by the routines of the driver. This | 143 | * i2c bus. The behaviour is defined by the routines of the driver. This |
144 | * function is mainly used for lookup & other admin. functions. | 144 | * function is mainly used for lookup & other admin. functions. |
145 | */ | 145 | */ |
146 | struct i2c_client { | 146 | struct i2c_client { |
147 | unsigned int flags; /* div., see below */ | 147 | unsigned int flags; /* div., see below */ |
148 | unsigned short addr; /* chip address - NOTE: 7bit */ | 148 | unsigned short addr; /* chip address - NOTE: 7bit */ |
149 | /* addresses are stored in the */ | 149 | /* addresses are stored in the */ |
150 | /* _LOWER_ 7 bits */ | 150 | /* _LOWER_ 7 bits */ |
151 | struct i2c_adapter *adapter; /* the adapter we sit on */ | 151 | struct i2c_adapter *adapter; /* the adapter we sit on */ |
@@ -182,14 +182,14 @@ static inline void i2c_set_clientdata (struct i2c_client *dev, void *data) | |||
182 | */ | 182 | */ |
183 | struct i2c_algorithm { | 183 | struct i2c_algorithm { |
184 | /* If an adapter algorithm can't do I2C-level access, set master_xfer | 184 | /* If an adapter algorithm can't do I2C-level access, set master_xfer |
185 | to NULL. If an adapter algorithm can do SMBus access, set | 185 | to NULL. If an adapter algorithm can do SMBus access, set |
186 | smbus_xfer. If set to NULL, the SMBus protocol is simulated | 186 | smbus_xfer. If set to NULL, the SMBus protocol is simulated |
187 | using common I2C messages */ | 187 | using common I2C messages */ |
188 | /* master_xfer should return the number of messages successfully | 188 | /* master_xfer should return the number of messages successfully |
189 | processed, or a negative value on error */ | 189 | processed, or a negative value on error */ |
190 | int (*master_xfer)(struct i2c_adapter *adap,struct i2c_msg *msgs, | 190 | int (*master_xfer)(struct i2c_adapter *adap,struct i2c_msg *msgs, |
191 | int num); | 191 | int num); |
192 | int (*smbus_xfer) (struct i2c_adapter *adap, u16 addr, | 192 | int (*smbus_xfer) (struct i2c_adapter *adap, u16 addr, |
193 | unsigned short flags, char read_write, | 193 | unsigned short flags, char read_write, |
194 | u8 command, int size, union i2c_smbus_data * data); | 194 | u8 command, int size, union i2c_smbus_data * data); |
195 | 195 | ||
@@ -216,6 +216,7 @@ struct i2c_adapter { | |||
216 | int (*client_unregister)(struct i2c_client *); | 216 | int (*client_unregister)(struct i2c_client *); |
217 | 217 | ||
218 | /* data fields that are valid for all devices */ | 218 | /* data fields that are valid for all devices */ |
219 | u8 level; /* nesting level for lockdep */ | ||
219 | struct mutex bus_lock; | 220 | struct mutex bus_lock; |
220 | struct mutex clist_lock; | 221 | struct mutex clist_lock; |
221 | 222 | ||
@@ -316,7 +317,7 @@ extern int i2c_check_addr (struct i2c_adapter *adapter, int addr); | |||
316 | * It will only call found_proc if some client is connected at the | 317 | * It will only call found_proc if some client is connected at the |
317 | * specific address (unless a 'force' matched); | 318 | * specific address (unless a 'force' matched); |
318 | */ | 319 | */ |
319 | extern int i2c_probe(struct i2c_adapter *adapter, | 320 | extern int i2c_probe(struct i2c_adapter *adapter, |
320 | struct i2c_client_address_data *address_data, | 321 | struct i2c_client_address_data *address_data, |
321 | int (*found_proc) (struct i2c_adapter *, int, int)); | 322 | int (*found_proc) (struct i2c_adapter *, int, int)); |
322 | 323 | ||
@@ -352,15 +353,15 @@ static inline int i2c_adapter_id(struct i2c_adapter *adap) | |||
352 | */ | 353 | */ |
353 | struct i2c_msg { | 354 | struct i2c_msg { |
354 | __u16 addr; /* slave address */ | 355 | __u16 addr; /* slave address */ |
355 | __u16 flags; | 356 | __u16 flags; |
356 | #define I2C_M_TEN 0x10 /* we have a ten bit chip address */ | 357 | #define I2C_M_TEN 0x10 /* we have a ten bit chip address */ |
357 | #define I2C_M_RD 0x01 | 358 | #define I2C_M_RD 0x01 |
358 | #define I2C_M_NOSTART 0x4000 | 359 | #define I2C_M_NOSTART 0x4000 |
359 | #define I2C_M_REV_DIR_ADDR 0x2000 | 360 | #define I2C_M_REV_DIR_ADDR 0x2000 |
360 | #define I2C_M_IGNORE_NAK 0x1000 | 361 | #define I2C_M_IGNORE_NAK 0x1000 |
361 | #define I2C_M_NO_RD_ACK 0x0800 | 362 | #define I2C_M_NO_RD_ACK 0x0800 |
362 | __u16 len; /* msg length */ | 363 | __u16 len; /* msg length */ |
363 | __u8 *buf; /* pointer to msg data */ | 364 | __u8 *buf; /* pointer to msg data */ |
364 | }; | 365 | }; |
365 | 366 | ||
366 | /* To determine what functionality is present */ | 367 | /* To determine what functionality is present */ |
@@ -370,16 +371,16 @@ struct i2c_msg { | |||
370 | #define I2C_FUNC_PROTOCOL_MANGLING 0x00000004 /* I2C_M_{REV_DIR_ADDR,NOSTART,..} */ | 371 | #define I2C_FUNC_PROTOCOL_MANGLING 0x00000004 /* I2C_M_{REV_DIR_ADDR,NOSTART,..} */ |
371 | #define I2C_FUNC_SMBUS_HWPEC_CALC 0x00000008 /* SMBus 2.0 */ | 372 | #define I2C_FUNC_SMBUS_HWPEC_CALC 0x00000008 /* SMBus 2.0 */ |
372 | #define I2C_FUNC_SMBUS_BLOCK_PROC_CALL 0x00008000 /* SMBus 2.0 */ | 373 | #define I2C_FUNC_SMBUS_BLOCK_PROC_CALL 0x00008000 /* SMBus 2.0 */ |
373 | #define I2C_FUNC_SMBUS_QUICK 0x00010000 | 374 | #define I2C_FUNC_SMBUS_QUICK 0x00010000 |
374 | #define I2C_FUNC_SMBUS_READ_BYTE 0x00020000 | 375 | #define I2C_FUNC_SMBUS_READ_BYTE 0x00020000 |
375 | #define I2C_FUNC_SMBUS_WRITE_BYTE 0x00040000 | 376 | #define I2C_FUNC_SMBUS_WRITE_BYTE 0x00040000 |
376 | #define I2C_FUNC_SMBUS_READ_BYTE_DATA 0x00080000 | 377 | #define I2C_FUNC_SMBUS_READ_BYTE_DATA 0x00080000 |
377 | #define I2C_FUNC_SMBUS_WRITE_BYTE_DATA 0x00100000 | 378 | #define I2C_FUNC_SMBUS_WRITE_BYTE_DATA 0x00100000 |
378 | #define I2C_FUNC_SMBUS_READ_WORD_DATA 0x00200000 | 379 | #define I2C_FUNC_SMBUS_READ_WORD_DATA 0x00200000 |
379 | #define I2C_FUNC_SMBUS_WRITE_WORD_DATA 0x00400000 | 380 | #define I2C_FUNC_SMBUS_WRITE_WORD_DATA 0x00400000 |
380 | #define I2C_FUNC_SMBUS_PROC_CALL 0x00800000 | 381 | #define I2C_FUNC_SMBUS_PROC_CALL 0x00800000 |
381 | #define I2C_FUNC_SMBUS_READ_BLOCK_DATA 0x01000000 | 382 | #define I2C_FUNC_SMBUS_READ_BLOCK_DATA 0x01000000 |
382 | #define I2C_FUNC_SMBUS_WRITE_BLOCK_DATA 0x02000000 | 383 | #define I2C_FUNC_SMBUS_WRITE_BLOCK_DATA 0x02000000 |
383 | #define I2C_FUNC_SMBUS_READ_I2C_BLOCK 0x04000000 /* I2C-like block xfer */ | 384 | #define I2C_FUNC_SMBUS_READ_I2C_BLOCK 0x04000000 /* I2C-like block xfer */ |
384 | #define I2C_FUNC_SMBUS_WRITE_I2C_BLOCK 0x08000000 /* w/ 1-byte reg. addr. */ | 385 | #define I2C_FUNC_SMBUS_WRITE_I2C_BLOCK 0x08000000 /* w/ 1-byte reg. addr. */ |
385 | #define I2C_FUNC_SMBUS_READ_I2C_BLOCK_2 0x10000000 /* I2C-like block xfer */ | 386 | #define I2C_FUNC_SMBUS_READ_I2C_BLOCK_2 0x10000000 /* I2C-like block xfer */ |
@@ -406,10 +407,10 @@ struct i2c_msg { | |||
406 | I2C_FUNC_SMBUS_WRITE_BLOCK_DATA | \ | 407 | I2C_FUNC_SMBUS_WRITE_BLOCK_DATA | \ |
407 | I2C_FUNC_SMBUS_I2C_BLOCK) | 408 | I2C_FUNC_SMBUS_I2C_BLOCK) |
408 | 409 | ||
409 | /* | 410 | /* |
410 | * Data for SMBus Messages | 411 | * Data for SMBus Messages |
411 | */ | 412 | */ |
412 | #define I2C_SMBUS_BLOCK_MAX 32 /* As specified in SMBus standard */ | 413 | #define I2C_SMBUS_BLOCK_MAX 32 /* As specified in SMBus standard */ |
413 | union i2c_smbus_data { | 414 | union i2c_smbus_data { |
414 | __u8 byte; | 415 | __u8 byte; |
415 | __u16 word; | 416 | __u16 word; |
@@ -421,11 +422,11 @@ union i2c_smbus_data { | |||
421 | #define I2C_SMBUS_READ 1 | 422 | #define I2C_SMBUS_READ 1 |
422 | #define I2C_SMBUS_WRITE 0 | 423 | #define I2C_SMBUS_WRITE 0 |
423 | 424 | ||
424 | /* SMBus transaction types (size parameter in the above functions) | 425 | /* SMBus transaction types (size parameter in the above functions) |
425 | Note: these no longer correspond to the (arbitrary) PIIX4 internal codes! */ | 426 | Note: these no longer correspond to the (arbitrary) PIIX4 internal codes! */ |
426 | #define I2C_SMBUS_QUICK 0 | 427 | #define I2C_SMBUS_QUICK 0 |
427 | #define I2C_SMBUS_BYTE 1 | 428 | #define I2C_SMBUS_BYTE 1 |
428 | #define I2C_SMBUS_BYTE_DATA 2 | 429 | #define I2C_SMBUS_BYTE_DATA 2 |
429 | #define I2C_SMBUS_WORD_DATA 3 | 430 | #define I2C_SMBUS_WORD_DATA 3 |
430 | #define I2C_SMBUS_PROC_CALL 4 | 431 | #define I2C_SMBUS_PROC_CALL 4 |
431 | #define I2C_SMBUS_BLOCK_DATA 5 | 432 | #define I2C_SMBUS_BLOCK_DATA 5 |
@@ -434,15 +435,15 @@ union i2c_smbus_data { | |||
434 | 435 | ||
435 | 436 | ||
436 | /* ----- commands for the ioctl like i2c_command call: | 437 | /* ----- commands for the ioctl like i2c_command call: |
437 | * note that additional calls are defined in the algorithm and hw | 438 | * note that additional calls are defined in the algorithm and hw |
438 | * dependent layers - these can be listed here, or see the | 439 | * dependent layers - these can be listed here, or see the |
439 | * corresponding header files. | 440 | * corresponding header files. |
440 | */ | 441 | */ |
441 | /* -> bit-adapter specific ioctls */ | 442 | /* -> bit-adapter specific ioctls */ |
442 | #define I2C_RETRIES 0x0701 /* number of times a device address */ | 443 | #define I2C_RETRIES 0x0701 /* number of times a device address */ |
443 | /* should be polled when not */ | 444 | /* should be polled when not */ |
444 | /* acknowledging */ | 445 | /* acknowledging */ |
445 | #define I2C_TIMEOUT 0x0702 /* set timeout - call with int */ | 446 | #define I2C_TIMEOUT 0x0702 /* set timeout - call with int */ |
446 | 447 | ||
447 | 448 | ||
448 | /* this is for i2c-dev.c */ | 449 | /* this is for i2c-dev.c */ |
diff --git a/include/linux/ide.h b/include/linux/ide.h index 9c2050293f17..e26a03981a94 100644 --- a/include/linux/ide.h +++ b/include/linux/ide.h | |||
@@ -796,6 +796,7 @@ typedef struct hwif_s { | |||
796 | unsigned sg_mapped : 1; /* sg_table and sg_nents are ready */ | 796 | unsigned sg_mapped : 1; /* sg_table and sg_nents are ready */ |
797 | unsigned no_io_32bit : 1; /* 1 = can not do 32-bit IO ops */ | 797 | unsigned no_io_32bit : 1; /* 1 = can not do 32-bit IO ops */ |
798 | unsigned err_stops_fifo : 1; /* 1=data FIFO is cleared by an error */ | 798 | unsigned err_stops_fifo : 1; /* 1=data FIFO is cleared by an error */ |
799 | unsigned atapi_irq_bogon : 1; /* Generates spurious DMA interrupts in PIO mode */ | ||
799 | 800 | ||
800 | struct device gendev; | 801 | struct device gendev; |
801 | struct completion gendev_rel_comp; /* To deal with device release() */ | 802 | struct completion gendev_rel_comp; /* To deal with device release() */ |
@@ -803,8 +804,6 @@ typedef struct hwif_s { | |||
803 | void *hwif_data; /* extra hwif data */ | 804 | void *hwif_data; /* extra hwif data */ |
804 | 805 | ||
805 | unsigned dma; | 806 | unsigned dma; |
806 | |||
807 | void (*led_act)(void *data, int rw); | ||
808 | } ____cacheline_internodealigned_in_smp ide_hwif_t; | 807 | } ____cacheline_internodealigned_in_smp ide_hwif_t; |
809 | 808 | ||
810 | /* | 809 | /* |
diff --git a/include/linux/if_addr.h b/include/linux/if_addr.h index dbe8f6120a40..d557e4ce9b6b 100644 --- a/include/linux/if_addr.h +++ b/include/linux/if_addr.h | |||
@@ -52,4 +52,10 @@ struct ifa_cacheinfo | |||
52 | __u32 tstamp; /* updated timestamp, hundredths of seconds */ | 52 | __u32 tstamp; /* updated timestamp, hundredths of seconds */ |
53 | }; | 53 | }; |
54 | 54 | ||
55 | /* backwards compatibility for userspace */ | ||
56 | #ifndef __KERNEL__ | ||
57 | #define IFA_RTA(r) ((struct rtattr*)(((char*)(r)) + NLMSG_ALIGN(sizeof(struct ifaddrmsg)))) | ||
58 | #define IFA_PAYLOAD(n) NLMSG_PAYLOAD(n,sizeof(struct ifaddrmsg)) | ||
59 | #endif | ||
60 | |||
55 | #endif | 61 | #endif |
diff --git a/include/linux/if_link.h b/include/linux/if_link.h index e963a077e6f5..35ed3b5467f3 100644 --- a/include/linux/if_link.h +++ b/include/linux/if_link.h | |||
@@ -82,6 +82,12 @@ enum | |||
82 | 82 | ||
83 | #define IFLA_MAX (__IFLA_MAX - 1) | 83 | #define IFLA_MAX (__IFLA_MAX - 1) |
84 | 84 | ||
85 | /* backwards compatibility for userspace */ | ||
86 | #ifndef __KERNEL__ | ||
87 | #define IFLA_RTA(r) ((struct rtattr*)(((char*)(r)) + NLMSG_ALIGN(sizeof(struct ifinfomsg)))) | ||
88 | #define IFLA_PAYLOAD(n) NLMSG_PAYLOAD(n,sizeof(struct ifinfomsg)) | ||
89 | #endif | ||
90 | |||
85 | /* ifi_flags. | 91 | /* ifi_flags. |
86 | 92 | ||
87 | IFF_* flags. | 93 | IFF_* flags. |
diff --git a/include/linux/init.h b/include/linux/init.h index 5eb5d24b7680..5a593a1dec1e 100644 --- a/include/linux/init.h +++ b/include/linux/init.h | |||
@@ -111,6 +111,7 @@ extern void setup_arch(char **); | |||
111 | #define subsys_initcall_sync(fn) __define_initcall("4s",fn,4s) | 111 | #define subsys_initcall_sync(fn) __define_initcall("4s",fn,4s) |
112 | #define fs_initcall(fn) __define_initcall("5",fn,5) | 112 | #define fs_initcall(fn) __define_initcall("5",fn,5) |
113 | #define fs_initcall_sync(fn) __define_initcall("5s",fn,5s) | 113 | #define fs_initcall_sync(fn) __define_initcall("5s",fn,5s) |
114 | #define rootfs_initcall(fn) __define_initcall("rootfs",fn,rootfs) | ||
114 | #define device_initcall(fn) __define_initcall("6",fn,6) | 115 | #define device_initcall(fn) __define_initcall("6",fn,6) |
115 | #define device_initcall_sync(fn) __define_initcall("6s",fn,6s) | 116 | #define device_initcall_sync(fn) __define_initcall("6s",fn,6s) |
116 | #define late_initcall(fn) __define_initcall("7",fn,7) | 117 | #define late_initcall(fn) __define_initcall("7",fn,7) |
diff --git a/include/linux/init_task.h b/include/linux/init_task.h index 733790d4f7db..b5315150199e 100644 --- a/include/linux/init_task.h +++ b/include/linux/init_task.h | |||
@@ -7,16 +7,15 @@ | |||
7 | #include <linux/utsname.h> | 7 | #include <linux/utsname.h> |
8 | #include <linux/lockdep.h> | 8 | #include <linux/lockdep.h> |
9 | #include <linux/ipc.h> | 9 | #include <linux/ipc.h> |
10 | #include <linux/pid_namespace.h> | ||
10 | 11 | ||
11 | #define INIT_FDTABLE \ | 12 | #define INIT_FDTABLE \ |
12 | { \ | 13 | { \ |
13 | .max_fds = NR_OPEN_DEFAULT, \ | 14 | .max_fds = NR_OPEN_DEFAULT, \ |
14 | .max_fdset = EMBEDDED_FD_SET_SIZE, \ | ||
15 | .fd = &init_files.fd_array[0], \ | 15 | .fd = &init_files.fd_array[0], \ |
16 | .close_on_exec = (fd_set *)&init_files.close_on_exec_init, \ | 16 | .close_on_exec = (fd_set *)&init_files.close_on_exec_init, \ |
17 | .open_fds = (fd_set *)&init_files.open_fds_init, \ | 17 | .open_fds = (fd_set *)&init_files.open_fds_init, \ |
18 | .rcu = RCU_HEAD_INIT, \ | 18 | .rcu = RCU_HEAD_INIT, \ |
19 | .free_files = NULL, \ | ||
20 | .next = NULL, \ | 19 | .next = NULL, \ |
21 | } | 20 | } |
22 | 21 | ||
@@ -57,25 +56,28 @@ | |||
57 | .cpu_vm_mask = CPU_MASK_ALL, \ | 56 | .cpu_vm_mask = CPU_MASK_ALL, \ |
58 | } | 57 | } |
59 | 58 | ||
60 | #define INIT_SIGNALS(sig) { \ | 59 | #define INIT_SIGNALS(sig) { \ |
61 | .count = ATOMIC_INIT(1), \ | 60 | .count = ATOMIC_INIT(1), \ |
62 | .wait_chldexit = __WAIT_QUEUE_HEAD_INITIALIZER(sig.wait_chldexit),\ | 61 | .wait_chldexit = __WAIT_QUEUE_HEAD_INITIALIZER(sig.wait_chldexit),\ |
63 | .shared_pending = { \ | 62 | .shared_pending = { \ |
64 | .list = LIST_HEAD_INIT(sig.shared_pending.list), \ | 63 | .list = LIST_HEAD_INIT(sig.shared_pending.list), \ |
65 | .signal = {{0}}}, \ | 64 | .signal = {{0}}}, \ |
66 | .posix_timers = LIST_HEAD_INIT(sig.posix_timers), \ | 65 | .posix_timers = LIST_HEAD_INIT(sig.posix_timers), \ |
67 | .cpu_timers = INIT_CPU_TIMERS(sig.cpu_timers), \ | 66 | .cpu_timers = INIT_CPU_TIMERS(sig.cpu_timers), \ |
68 | .rlim = INIT_RLIMITS, \ | 67 | .rlim = INIT_RLIMITS, \ |
69 | .pgrp = 1, \ | 68 | .pgrp = 1, \ |
70 | .session = 1, \ | 69 | .tty_old_pgrp = 0, \ |
70 | { .__session = 1}, \ | ||
71 | } | 71 | } |
72 | 72 | ||
73 | extern struct nsproxy init_nsproxy; | 73 | extern struct nsproxy init_nsproxy; |
74 | #define INIT_NSPROXY(nsproxy) { \ | 74 | #define INIT_NSPROXY(nsproxy) { \ |
75 | .pid_ns = &init_pid_ns, \ | ||
75 | .count = ATOMIC_INIT(1), \ | 76 | .count = ATOMIC_INIT(1), \ |
76 | .nslock = __SPIN_LOCK_UNLOCKED(nsproxy.nslock), \ | 77 | .nslock = __SPIN_LOCK_UNLOCKED(nsproxy.nslock), \ |
78 | .id = 0, \ | ||
77 | .uts_ns = &init_uts_ns, \ | 79 | .uts_ns = &init_uts_ns, \ |
78 | .namespace = NULL, \ | 80 | .mnt_ns = NULL, \ |
79 | INIT_IPC_NS(ipc_ns) \ | 81 | INIT_IPC_NS(ipc_ns) \ |
80 | } | 82 | } |
81 | 83 | ||
diff --git a/include/linux/input.h b/include/linux/input.h index c38507ba38b5..4e61158b06a0 100644 --- a/include/linux/input.h +++ b/include/linux/input.h | |||
@@ -663,7 +663,7 @@ struct input_absinfo { | |||
663 | #define BUS_GSC 0x1A | 663 | #define BUS_GSC 0x1A |
664 | 664 | ||
665 | /* | 665 | /* |
666 | * Values describing the status of an effect | 666 | * Values describing the status of a force-feedback effect |
667 | */ | 667 | */ |
668 | #define FF_STATUS_STOPPED 0x00 | 668 | #define FF_STATUS_STOPPED 0x00 |
669 | #define FF_STATUS_PLAYING 0x01 | 669 | #define FF_STATUS_PLAYING 0x01 |
@@ -680,7 +680,7 @@ struct input_absinfo { | |||
680 | */ | 680 | */ |
681 | 681 | ||
682 | /** | 682 | /** |
683 | * struct ff_replay - defines scheduling of the effect | 683 | * struct ff_replay - defines scheduling of the force-feedback effect |
684 | * @length: duration of the effect | 684 | * @length: duration of the effect |
685 | * @delay: delay before effect should start playing | 685 | * @delay: delay before effect should start playing |
686 | */ | 686 | */ |
@@ -690,7 +690,7 @@ struct ff_replay { | |||
690 | }; | 690 | }; |
691 | 691 | ||
692 | /** | 692 | /** |
693 | * struct ff_trigger - defines what triggers the effect | 693 | * struct ff_trigger - defines what triggers the force-feedback effect |
694 | * @button: number of the button triggering the effect | 694 | * @button: number of the button triggering the effect |
695 | * @interval: controls how soon the effect can be re-triggered | 695 | * @interval: controls how soon the effect can be re-triggered |
696 | */ | 696 | */ |
@@ -700,7 +700,7 @@ struct ff_trigger { | |||
700 | }; | 700 | }; |
701 | 701 | ||
702 | /** | 702 | /** |
703 | * struct ff_envelope - generic effect envelope | 703 | * struct ff_envelope - generic force-feedback effect envelope |
704 | * @attack_length: duration of the attack (ms) | 704 | * @attack_length: duration of the attack (ms) |
705 | * @attack_level: level at the beginning of the attack | 705 | * @attack_level: level at the beginning of the attack |
706 | * @fade_length: duration of fade (ms) | 706 | * @fade_length: duration of fade (ms) |
@@ -719,7 +719,7 @@ struct ff_envelope { | |||
719 | }; | 719 | }; |
720 | 720 | ||
721 | /** | 721 | /** |
722 | * struct ff_constant_effect - defines parameters of a constant effect | 722 | * struct ff_constant_effect - defines parameters of a constant force-feedback effect |
723 | * @level: strength of the effect; may be negative | 723 | * @level: strength of the effect; may be negative |
724 | * @envelope: envelope data | 724 | * @envelope: envelope data |
725 | */ | 725 | */ |
@@ -729,7 +729,7 @@ struct ff_constant_effect { | |||
729 | }; | 729 | }; |
730 | 730 | ||
731 | /** | 731 | /** |
732 | * struct ff_ramp_effect - defines parameters of a ramp effect | 732 | * struct ff_ramp_effect - defines parameters of a ramp force-feedback effect |
733 | * @start_level: beginning strength of the effect; may be negative | 733 | * @start_level: beginning strength of the effect; may be negative |
734 | * @end_level: final strength of the effect; may be negative | 734 | * @end_level: final strength of the effect; may be negative |
735 | * @envelope: envelope data | 735 | * @envelope: envelope data |
@@ -741,7 +741,7 @@ struct ff_ramp_effect { | |||
741 | }; | 741 | }; |
742 | 742 | ||
743 | /** | 743 | /** |
744 | * struct ff_condition_effect - defines a spring or friction effect | 744 | * struct ff_condition_effect - defines a spring or friction force-feedback effect |
745 | * @right_saturation: maximum level when joystick moved all way to the right | 745 | * @right_saturation: maximum level when joystick moved all way to the right |
746 | * @left_saturation: same for the left side | 746 | * @left_saturation: same for the left side |
747 | * @right_coeff: controls how fast the force grows when the joystick moves | 747 | * @right_coeff: controls how fast the force grows when the joystick moves |
@@ -762,7 +762,7 @@ struct ff_condition_effect { | |||
762 | }; | 762 | }; |
763 | 763 | ||
764 | /** | 764 | /** |
765 | * struct ff_periodic_effect - defines parameters of a periodic effect | 765 | * struct ff_periodic_effect - defines parameters of a periodic force-feedback effect |
766 | * @waveform: kind of the effect (wave) | 766 | * @waveform: kind of the effect (wave) |
767 | * @period: period of the wave (ms) | 767 | * @period: period of the wave (ms) |
768 | * @magnitude: peak value | 768 | * @magnitude: peak value |
@@ -793,7 +793,7 @@ struct ff_periodic_effect { | |||
793 | }; | 793 | }; |
794 | 794 | ||
795 | /** | 795 | /** |
796 | * struct ff_rumble_effect - defines parameters of a periodic effect | 796 | * struct ff_rumble_effect - defines parameters of a periodic force-feedback effect |
797 | * @strong_magnitude: magnitude of the heavy motor | 797 | * @strong_magnitude: magnitude of the heavy motor |
798 | * @weak_magnitude: magnitude of the light one | 798 | * @weak_magnitude: magnitude of the light one |
799 | * | 799 | * |
diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h index de7593f4e895..e36e86c869fb 100644 --- a/include/linux/interrupt.h +++ b/include/linux/interrupt.h | |||
@@ -231,7 +231,8 @@ enum | |||
231 | NET_TX_SOFTIRQ, | 231 | NET_TX_SOFTIRQ, |
232 | NET_RX_SOFTIRQ, | 232 | NET_RX_SOFTIRQ, |
233 | BLOCK_SOFTIRQ, | 233 | BLOCK_SOFTIRQ, |
234 | TASKLET_SOFTIRQ | 234 | TASKLET_SOFTIRQ, |
235 | SCHED_SOFTIRQ, | ||
235 | }; | 236 | }; |
236 | 237 | ||
237 | /* softirq mask and active fields moved to irq_cpustat_t in | 238 | /* softirq mask and active fields moved to irq_cpustat_t in |
diff --git a/include/linux/isdn.h b/include/linux/isdn.h index 62991148d5a5..3c7875b7ab5b 100644 --- a/include/linux/isdn.h +++ b/include/linux/isdn.h | |||
@@ -511,8 +511,8 @@ typedef struct modem_info { | |||
511 | #endif | 511 | #endif |
512 | struct tty_struct *tty; /* Pointer to corresponding tty */ | 512 | struct tty_struct *tty; /* Pointer to corresponding tty */ |
513 | atemu emu; /* AT-emulator data */ | 513 | atemu emu; /* AT-emulator data */ |
514 | struct termios normal_termios; /* For saving termios structs */ | 514 | struct ktermios normal_termios; /* For saving termios structs */ |
515 | struct termios callout_termios; | 515 | struct ktermios callout_termios; |
516 | wait_queue_head_t open_wait, close_wait; | 516 | wait_queue_head_t open_wait, close_wait; |
517 | struct semaphore write_sem; | 517 | struct semaphore write_sem; |
518 | spinlock_t readlock; | 518 | spinlock_t readlock; |
@@ -525,8 +525,8 @@ typedef struct _isdn_modem { | |||
525 | int refcount; /* Number of opens */ | 525 | int refcount; /* Number of opens */ |
526 | struct tty_driver *tty_modem; /* tty-device */ | 526 | struct tty_driver *tty_modem; /* tty-device */ |
527 | struct tty_struct *modem_table[ISDN_MAX_CHANNELS]; /* ?? copied from Orig */ | 527 | struct tty_struct *modem_table[ISDN_MAX_CHANNELS]; /* ?? copied from Orig */ |
528 | struct termios *modem_termios[ISDN_MAX_CHANNELS]; | 528 | struct ktermios *modem_termios[ISDN_MAX_CHANNELS]; |
529 | struct termios *modem_termios_locked[ISDN_MAX_CHANNELS]; | 529 | struct ktermios *modem_termios_locked[ISDN_MAX_CHANNELS]; |
530 | modem_info info[ISDN_MAX_CHANNELS]; /* Private data */ | 530 | modem_info info[ISDN_MAX_CHANNELS]; /* Private data */ |
531 | } isdn_modem_t; | 531 | } isdn_modem_t; |
532 | 532 | ||
diff --git a/include/linux/istallion.h b/include/linux/istallion.h index b55e2a035605..106a5e85e5c4 100644 --- a/include/linux/istallion.h +++ b/include/linux/istallion.h | |||
@@ -49,13 +49,13 @@ | |||
49 | * communication with the slave board will always be on a per port | 49 | * communication with the slave board will always be on a per port |
50 | * basis. | 50 | * basis. |
51 | */ | 51 | */ |
52 | typedef struct { | 52 | struct stliport { |
53 | unsigned long magic; | 53 | unsigned long magic; |
54 | int portnr; | 54 | unsigned int portnr; |
55 | int panelnr; | 55 | unsigned int panelnr; |
56 | int brdnr; | 56 | unsigned int brdnr; |
57 | unsigned long state; | 57 | unsigned long state; |
58 | int devnr; | 58 | unsigned int devnr; |
59 | int flags; | 59 | int flags; |
60 | int baud_base; | 60 | int baud_base; |
61 | int custom_divisor; | 61 | int custom_divisor; |
@@ -72,7 +72,7 @@ typedef struct { | |||
72 | wait_queue_head_t close_wait; | 72 | wait_queue_head_t close_wait; |
73 | wait_queue_head_t raw_wait; | 73 | wait_queue_head_t raw_wait; |
74 | struct work_struct tqhangup; | 74 | struct work_struct tqhangup; |
75 | asysigs_t asig; | 75 | struct asysigs asig; |
76 | unsigned long addr; | 76 | unsigned long addr; |
77 | unsigned long rxoffset; | 77 | unsigned long rxoffset; |
78 | unsigned long txoffset; | 78 | unsigned long txoffset; |
@@ -83,31 +83,31 @@ typedef struct { | |||
83 | unsigned char reqbit; | 83 | unsigned char reqbit; |
84 | unsigned char portidx; | 84 | unsigned char portidx; |
85 | unsigned char portbit; | 85 | unsigned char portbit; |
86 | } stliport_t; | 86 | }; |
87 | 87 | ||
88 | /* | 88 | /* |
89 | * Use a structure of function pointers to do board level operations. | 89 | * Use a structure of function pointers to do board level operations. |
90 | * These include, enable/disable, paging shared memory, interrupting, etc. | 90 | * These include, enable/disable, paging shared memory, interrupting, etc. |
91 | */ | 91 | */ |
92 | typedef struct stlibrd { | 92 | struct stlibrd { |
93 | unsigned long magic; | 93 | unsigned long magic; |
94 | int brdnr; | 94 | unsigned int brdnr; |
95 | int brdtype; | 95 | unsigned int brdtype; |
96 | int state; | 96 | unsigned int state; |
97 | int nrpanels; | 97 | unsigned int nrpanels; |
98 | int nrports; | 98 | unsigned int nrports; |
99 | int nrdevs; | 99 | unsigned int nrdevs; |
100 | unsigned int iobase; | 100 | unsigned int iobase; |
101 | int iosize; | 101 | int iosize; |
102 | unsigned long memaddr; | 102 | unsigned long memaddr; |
103 | void __iomem *membase; | 103 | void __iomem *membase; |
104 | int memsize; | 104 | unsigned long memsize; |
105 | int pagesize; | 105 | int pagesize; |
106 | int hostoffset; | 106 | int hostoffset; |
107 | int slaveoffset; | 107 | int slaveoffset; |
108 | int bitsize; | 108 | int bitsize; |
109 | int enabval; | 109 | int enabval; |
110 | int panels[STL_MAXPANELS]; | 110 | unsigned int panels[STL_MAXPANELS]; |
111 | int panelids[STL_MAXPANELS]; | 111 | int panelids[STL_MAXPANELS]; |
112 | void (*init)(struct stlibrd *brdp); | 112 | void (*init)(struct stlibrd *brdp); |
113 | void (*enable)(struct stlibrd *brdp); | 113 | void (*enable)(struct stlibrd *brdp); |
@@ -116,8 +116,8 @@ typedef struct stlibrd { | |||
116 | void __iomem *(*getmemptr)(struct stlibrd *brdp, unsigned long offset, int line); | 116 | void __iomem *(*getmemptr)(struct stlibrd *brdp, unsigned long offset, int line); |
117 | void (*intr)(struct stlibrd *brdp); | 117 | void (*intr)(struct stlibrd *brdp); |
118 | void (*reset)(struct stlibrd *brdp); | 118 | void (*reset)(struct stlibrd *brdp); |
119 | stliport_t *ports[STL_MAXPORTS]; | 119 | struct stliport *ports[STL_MAXPORTS]; |
120 | } stlibrd_t; | 120 | }; |
121 | 121 | ||
122 | 122 | ||
123 | /* | 123 | /* |
diff --git a/include/linux/kernel.h b/include/linux/kernel.h index 6738283ac385..b0c4a05a4b0c 100644 --- a/include/linux/kernel.h +++ b/include/linux/kernel.h | |||
@@ -13,11 +13,10 @@ | |||
13 | #include <linux/types.h> | 13 | #include <linux/types.h> |
14 | #include <linux/compiler.h> | 14 | #include <linux/compiler.h> |
15 | #include <linux/bitops.h> | 15 | #include <linux/bitops.h> |
16 | #include <linux/log2.h> | ||
16 | #include <asm/byteorder.h> | 17 | #include <asm/byteorder.h> |
17 | #include <asm/bug.h> | 18 | #include <asm/bug.h> |
18 | 19 | ||
19 | extern const char linux_banner[]; | ||
20 | |||
21 | #define INT_MAX ((int)(~0U>>1)) | 20 | #define INT_MAX ((int)(~0U>>1)) |
22 | #define INT_MIN (-INT_MAX - 1) | 21 | #define INT_MIN (-INT_MAX - 1) |
23 | #define UINT_MAX (~0U) | 22 | #define UINT_MAX (~0U) |
@@ -157,20 +156,6 @@ static inline int printk(const char *s, ...) { return 0; } | |||
157 | 156 | ||
158 | unsigned long int_sqrt(unsigned long); | 157 | unsigned long int_sqrt(unsigned long); |
159 | 158 | ||
160 | static inline int __attribute_pure__ long_log2(unsigned long x) | ||
161 | { | ||
162 | int r = 0; | ||
163 | for (x >>= 1; x > 0; x >>= 1) | ||
164 | r++; | ||
165 | return r; | ||
166 | } | ||
167 | |||
168 | static inline unsigned long | ||
169 | __attribute_const__ roundup_pow_of_two(unsigned long x) | ||
170 | { | ||
171 | return 1UL << fls_long(x - 1); | ||
172 | } | ||
173 | |||
174 | extern int printk_ratelimit(void); | 159 | extern int printk_ratelimit(void); |
175 | extern int __printk_ratelimit(int ratelimit_jiffies, int ratelimit_burst); | 160 | extern int __printk_ratelimit(int ratelimit_jiffies, int ratelimit_burst); |
176 | extern bool printk_timed_ratelimit(unsigned long *caller_jiffies, | 161 | extern bool printk_timed_ratelimit(unsigned long *caller_jiffies, |
diff --git a/include/linux/kvm.h b/include/linux/kvm.h new file mode 100644 index 000000000000..5bb2c3c585c1 --- /dev/null +++ b/include/linux/kvm.h | |||
@@ -0,0 +1,227 @@ | |||
1 | #ifndef __LINUX_KVM_H | ||
2 | #define __LINUX_KVM_H | ||
3 | |||
4 | /* | ||
5 | * Userspace interface for /dev/kvm - kernel based virtual machine | ||
6 | * | ||
7 | * Note: this interface is considered experimental and may change without | ||
8 | * notice. | ||
9 | */ | ||
10 | |||
11 | #include <asm/types.h> | ||
12 | #include <linux/ioctl.h> | ||
13 | |||
14 | /* | ||
15 | * Architectural interrupt line count, and the size of the bitmap needed | ||
16 | * to hold them. | ||
17 | */ | ||
18 | #define KVM_NR_INTERRUPTS 256 | ||
19 | #define KVM_IRQ_BITMAP_SIZE_BYTES ((KVM_NR_INTERRUPTS + 7) / 8) | ||
20 | #define KVM_IRQ_BITMAP_SIZE(type) (KVM_IRQ_BITMAP_SIZE_BYTES / sizeof(type)) | ||
21 | |||
22 | |||
23 | /* for KVM_CREATE_MEMORY_REGION */ | ||
24 | struct kvm_memory_region { | ||
25 | __u32 slot; | ||
26 | __u32 flags; | ||
27 | __u64 guest_phys_addr; | ||
28 | __u64 memory_size; /* bytes */ | ||
29 | }; | ||
30 | |||
31 | /* for kvm_memory_region::flags */ | ||
32 | #define KVM_MEM_LOG_DIRTY_PAGES 1UL | ||
33 | |||
34 | |||
35 | #define KVM_EXIT_TYPE_FAIL_ENTRY 1 | ||
36 | #define KVM_EXIT_TYPE_VM_EXIT 2 | ||
37 | |||
38 | enum kvm_exit_reason { | ||
39 | KVM_EXIT_UNKNOWN = 0, | ||
40 | KVM_EXIT_EXCEPTION = 1, | ||
41 | KVM_EXIT_IO = 2, | ||
42 | KVM_EXIT_CPUID = 3, | ||
43 | KVM_EXIT_DEBUG = 4, | ||
44 | KVM_EXIT_HLT = 5, | ||
45 | KVM_EXIT_MMIO = 6, | ||
46 | }; | ||
47 | |||
48 | /* for KVM_RUN */ | ||
49 | struct kvm_run { | ||
50 | /* in */ | ||
51 | __u32 vcpu; | ||
52 | __u32 emulated; /* skip current instruction */ | ||
53 | __u32 mmio_completed; /* mmio request completed */ | ||
54 | |||
55 | /* out */ | ||
56 | __u32 exit_type; | ||
57 | __u32 exit_reason; | ||
58 | __u32 instruction_length; | ||
59 | union { | ||
60 | /* KVM_EXIT_UNKNOWN */ | ||
61 | struct { | ||
62 | __u32 hardware_exit_reason; | ||
63 | } hw; | ||
64 | /* KVM_EXIT_EXCEPTION */ | ||
65 | struct { | ||
66 | __u32 exception; | ||
67 | __u32 error_code; | ||
68 | } ex; | ||
69 | /* KVM_EXIT_IO */ | ||
70 | struct { | ||
71 | #define KVM_EXIT_IO_IN 0 | ||
72 | #define KVM_EXIT_IO_OUT 1 | ||
73 | __u8 direction; | ||
74 | __u8 size; /* bytes */ | ||
75 | __u8 string; | ||
76 | __u8 string_down; | ||
77 | __u8 rep; | ||
78 | __u8 pad; | ||
79 | __u16 port; | ||
80 | __u64 count; | ||
81 | union { | ||
82 | __u64 address; | ||
83 | __u32 value; | ||
84 | }; | ||
85 | } io; | ||
86 | struct { | ||
87 | } debug; | ||
88 | /* KVM_EXIT_MMIO */ | ||
89 | struct { | ||
90 | __u64 phys_addr; | ||
91 | __u8 data[8]; | ||
92 | __u32 len; | ||
93 | __u8 is_write; | ||
94 | } mmio; | ||
95 | }; | ||
96 | }; | ||
97 | |||
98 | /* for KVM_GET_REGS and KVM_SET_REGS */ | ||
99 | struct kvm_regs { | ||
100 | /* in */ | ||
101 | __u32 vcpu; | ||
102 | __u32 padding; | ||
103 | |||
104 | /* out (KVM_GET_REGS) / in (KVM_SET_REGS) */ | ||
105 | __u64 rax, rbx, rcx, rdx; | ||
106 | __u64 rsi, rdi, rsp, rbp; | ||
107 | __u64 r8, r9, r10, r11; | ||
108 | __u64 r12, r13, r14, r15; | ||
109 | __u64 rip, rflags; | ||
110 | }; | ||
111 | |||
112 | struct kvm_segment { | ||
113 | __u64 base; | ||
114 | __u32 limit; | ||
115 | __u16 selector; | ||
116 | __u8 type; | ||
117 | __u8 present, dpl, db, s, l, g, avl; | ||
118 | __u8 unusable; | ||
119 | __u8 padding; | ||
120 | }; | ||
121 | |||
122 | struct kvm_dtable { | ||
123 | __u64 base; | ||
124 | __u16 limit; | ||
125 | __u16 padding[3]; | ||
126 | }; | ||
127 | |||
128 | /* for KVM_GET_SREGS and KVM_SET_SREGS */ | ||
129 | struct kvm_sregs { | ||
130 | /* in */ | ||
131 | __u32 vcpu; | ||
132 | __u32 padding; | ||
133 | |||
134 | /* out (KVM_GET_SREGS) / in (KVM_SET_SREGS) */ | ||
135 | struct kvm_segment cs, ds, es, fs, gs, ss; | ||
136 | struct kvm_segment tr, ldt; | ||
137 | struct kvm_dtable gdt, idt; | ||
138 | __u64 cr0, cr2, cr3, cr4, cr8; | ||
139 | __u64 efer; | ||
140 | __u64 apic_base; | ||
141 | __u64 interrupt_bitmap[KVM_IRQ_BITMAP_SIZE(__u64)]; | ||
142 | }; | ||
143 | |||
144 | struct kvm_msr_entry { | ||
145 | __u32 index; | ||
146 | __u32 reserved; | ||
147 | __u64 data; | ||
148 | }; | ||
149 | |||
150 | /* for KVM_GET_MSRS and KVM_SET_MSRS */ | ||
151 | struct kvm_msrs { | ||
152 | __u32 vcpu; | ||
153 | __u32 nmsrs; /* number of msrs in entries */ | ||
154 | |||
155 | struct kvm_msr_entry entries[0]; | ||
156 | }; | ||
157 | |||
158 | /* for KVM_GET_MSR_INDEX_LIST */ | ||
159 | struct kvm_msr_list { | ||
160 | __u32 nmsrs; /* number of msrs in entries */ | ||
161 | __u32 indices[0]; | ||
162 | }; | ||
163 | |||
164 | /* for KVM_TRANSLATE */ | ||
165 | struct kvm_translation { | ||
166 | /* in */ | ||
167 | __u64 linear_address; | ||
168 | __u32 vcpu; | ||
169 | __u32 padding; | ||
170 | |||
171 | /* out */ | ||
172 | __u64 physical_address; | ||
173 | __u8 valid; | ||
174 | __u8 writeable; | ||
175 | __u8 usermode; | ||
176 | }; | ||
177 | |||
178 | /* for KVM_INTERRUPT */ | ||
179 | struct kvm_interrupt { | ||
180 | /* in */ | ||
181 | __u32 vcpu; | ||
182 | __u32 irq; | ||
183 | }; | ||
184 | |||
185 | struct kvm_breakpoint { | ||
186 | __u32 enabled; | ||
187 | __u32 padding; | ||
188 | __u64 address; | ||
189 | }; | ||
190 | |||
191 | /* for KVM_DEBUG_GUEST */ | ||
192 | struct kvm_debug_guest { | ||
193 | /* int */ | ||
194 | __u32 vcpu; | ||
195 | __u32 enabled; | ||
196 | struct kvm_breakpoint breakpoints[4]; | ||
197 | __u32 singlestep; | ||
198 | }; | ||
199 | |||
200 | /* for KVM_GET_DIRTY_LOG */ | ||
201 | struct kvm_dirty_log { | ||
202 | __u32 slot; | ||
203 | __u32 padding; | ||
204 | union { | ||
205 | void __user *dirty_bitmap; /* one bit per page */ | ||
206 | __u64 padding; | ||
207 | }; | ||
208 | }; | ||
209 | |||
210 | #define KVMIO 0xAE | ||
211 | |||
212 | #define KVM_RUN _IOWR(KVMIO, 2, struct kvm_run) | ||
213 | #define KVM_GET_REGS _IOWR(KVMIO, 3, struct kvm_regs) | ||
214 | #define KVM_SET_REGS _IOW(KVMIO, 4, struct kvm_regs) | ||
215 | #define KVM_GET_SREGS _IOWR(KVMIO, 5, struct kvm_sregs) | ||
216 | #define KVM_SET_SREGS _IOW(KVMIO, 6, struct kvm_sregs) | ||
217 | #define KVM_TRANSLATE _IOWR(KVMIO, 7, struct kvm_translation) | ||
218 | #define KVM_INTERRUPT _IOW(KVMIO, 8, struct kvm_interrupt) | ||
219 | #define KVM_DEBUG_GUEST _IOW(KVMIO, 9, struct kvm_debug_guest) | ||
220 | #define KVM_SET_MEMORY_REGION _IOW(KVMIO, 10, struct kvm_memory_region) | ||
221 | #define KVM_CREATE_VCPU _IOW(KVMIO, 11, int /* vcpu_slot */) | ||
222 | #define KVM_GET_DIRTY_LOG _IOW(KVMIO, 12, struct kvm_dirty_log) | ||
223 | #define KVM_GET_MSRS _IOWR(KVMIO, 13, struct kvm_msrs) | ||
224 | #define KVM_SET_MSRS _IOWR(KVMIO, 14, struct kvm_msrs) | ||
225 | #define KVM_GET_MSR_INDEX_LIST _IOWR(KVMIO, 15, struct kvm_msr_list) | ||
226 | |||
227 | #endif | ||
diff --git a/include/linux/lockd/lockd.h b/include/linux/lockd/lockd.h index 8c39654549d8..0c962b82a9de 100644 --- a/include/linux/lockd/lockd.h +++ b/include/linux/lockd/lockd.h | |||
@@ -206,7 +206,7 @@ void nlmsvc_invalidate_all(void); | |||
206 | static __inline__ struct inode * | 206 | static __inline__ struct inode * |
207 | nlmsvc_file_inode(struct nlm_file *file) | 207 | nlmsvc_file_inode(struct nlm_file *file) |
208 | { | 208 | { |
209 | return file->f_file->f_dentry->d_inode; | 209 | return file->f_file->f_path.dentry->d_inode; |
210 | } | 210 | } |
211 | 211 | ||
212 | /* | 212 | /* |
diff --git a/include/linux/log2.h b/include/linux/log2.h new file mode 100644 index 000000000000..d02e1a547a7e --- /dev/null +++ b/include/linux/log2.h | |||
@@ -0,0 +1,157 @@ | |||
1 | /* Integer base 2 logarithm calculation | ||
2 | * | ||
3 | * Copyright (C) 2006 Red Hat, Inc. All Rights Reserved. | ||
4 | * Written by David Howells (dhowells@redhat.com) | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or | ||
7 | * modify it under the terms of the GNU General Public License | ||
8 | * as published by the Free Software Foundation; either version | ||
9 | * 2 of the License, or (at your option) any later version. | ||
10 | */ | ||
11 | |||
12 | #ifndef _LINUX_LOG2_H | ||
13 | #define _LINUX_LOG2_H | ||
14 | |||
15 | #include <linux/types.h> | ||
16 | #include <linux/bitops.h> | ||
17 | |||
18 | /* | ||
19 | * deal with unrepresentable constant logarithms | ||
20 | */ | ||
21 | extern __attribute__((const, noreturn)) | ||
22 | int ____ilog2_NaN(void); | ||
23 | |||
24 | /* | ||
25 | * non-constant log of base 2 calculators | ||
26 | * - the arch may override these in asm/bitops.h if they can be implemented | ||
27 | * more efficiently than using fls() and fls64() | ||
28 | * - the arch is not required to handle n==0 if implementing the fallback | ||
29 | */ | ||
30 | #ifndef CONFIG_ARCH_HAS_ILOG2_U32 | ||
31 | static inline __attribute__((const)) | ||
32 | int __ilog2_u32(u32 n) | ||
33 | { | ||
34 | return fls(n) - 1; | ||
35 | } | ||
36 | #endif | ||
37 | |||
38 | #ifndef CONFIG_ARCH_HAS_ILOG2_U64 | ||
39 | static inline __attribute__((const)) | ||
40 | int __ilog2_u64(u64 n) | ||
41 | { | ||
42 | return fls64(n) - 1; | ||
43 | } | ||
44 | #endif | ||
45 | |||
46 | /* | ||
47 | * round up to nearest power of two | ||
48 | */ | ||
49 | static inline __attribute__((const)) | ||
50 | unsigned long __roundup_pow_of_two(unsigned long n) | ||
51 | { | ||
52 | return 1UL << fls_long(n - 1); | ||
53 | } | ||
54 | |||
55 | /** | ||
56 | * ilog2 - log of base 2 of 32-bit or a 64-bit unsigned value | ||
57 | * @n - parameter | ||
58 | * | ||
59 | * constant-capable log of base 2 calculation | ||
60 | * - this can be used to initialise global variables from constant data, hence | ||
61 | * the massive ternary operator construction | ||
62 | * | ||
63 | * selects the appropriately-sized optimised version depending on sizeof(n) | ||
64 | */ | ||
65 | #define ilog2(n) \ | ||
66 | ( \ | ||
67 | __builtin_constant_p(n) ? ( \ | ||
68 | (n) < 1 ? ____ilog2_NaN() : \ | ||
69 | (n) & (1ULL << 63) ? 63 : \ | ||
70 | (n) & (1ULL << 62) ? 62 : \ | ||
71 | (n) & (1ULL << 61) ? 61 : \ | ||
72 | (n) & (1ULL << 60) ? 60 : \ | ||
73 | (n) & (1ULL << 59) ? 59 : \ | ||
74 | (n) & (1ULL << 58) ? 58 : \ | ||
75 | (n) & (1ULL << 57) ? 57 : \ | ||
76 | (n) & (1ULL << 56) ? 56 : \ | ||
77 | (n) & (1ULL << 55) ? 55 : \ | ||
78 | (n) & (1ULL << 54) ? 54 : \ | ||
79 | (n) & (1ULL << 53) ? 53 : \ | ||
80 | (n) & (1ULL << 52) ? 52 : \ | ||
81 | (n) & (1ULL << 51) ? 51 : \ | ||
82 | (n) & (1ULL << 50) ? 50 : \ | ||
83 | (n) & (1ULL << 49) ? 49 : \ | ||
84 | (n) & (1ULL << 48) ? 48 : \ | ||
85 | (n) & (1ULL << 47) ? 47 : \ | ||
86 | (n) & (1ULL << 46) ? 46 : \ | ||
87 | (n) & (1ULL << 45) ? 45 : \ | ||
88 | (n) & (1ULL << 44) ? 44 : \ | ||
89 | (n) & (1ULL << 43) ? 43 : \ | ||
90 | (n) & (1ULL << 42) ? 42 : \ | ||
91 | (n) & (1ULL << 41) ? 41 : \ | ||
92 | (n) & (1ULL << 40) ? 40 : \ | ||
93 | (n) & (1ULL << 39) ? 39 : \ | ||
94 | (n) & (1ULL << 38) ? 38 : \ | ||
95 | (n) & (1ULL << 37) ? 37 : \ | ||
96 | (n) & (1ULL << 36) ? 36 : \ | ||
97 | (n) & (1ULL << 35) ? 35 : \ | ||
98 | (n) & (1ULL << 34) ? 34 : \ | ||
99 | (n) & (1ULL << 33) ? 33 : \ | ||
100 | (n) & (1ULL << 32) ? 32 : \ | ||
101 | (n) & (1ULL << 31) ? 31 : \ | ||
102 | (n) & (1ULL << 30) ? 30 : \ | ||
103 | (n) & (1ULL << 29) ? 29 : \ | ||
104 | (n) & (1ULL << 28) ? 28 : \ | ||
105 | (n) & (1ULL << 27) ? 27 : \ | ||
106 | (n) & (1ULL << 26) ? 26 : \ | ||
107 | (n) & (1ULL << 25) ? 25 : \ | ||
108 | (n) & (1ULL << 24) ? 24 : \ | ||
109 | (n) & (1ULL << 23) ? 23 : \ | ||
110 | (n) & (1ULL << 22) ? 22 : \ | ||
111 | (n) & (1ULL << 21) ? 21 : \ | ||
112 | (n) & (1ULL << 20) ? 20 : \ | ||
113 | (n) & (1ULL << 19) ? 19 : \ | ||
114 | (n) & (1ULL << 18) ? 18 : \ | ||
115 | (n) & (1ULL << 17) ? 17 : \ | ||
116 | (n) & (1ULL << 16) ? 16 : \ | ||
117 | (n) & (1ULL << 15) ? 15 : \ | ||
118 | (n) & (1ULL << 14) ? 14 : \ | ||
119 | (n) & (1ULL << 13) ? 13 : \ | ||
120 | (n) & (1ULL << 12) ? 12 : \ | ||
121 | (n) & (1ULL << 11) ? 11 : \ | ||
122 | (n) & (1ULL << 10) ? 10 : \ | ||
123 | (n) & (1ULL << 9) ? 9 : \ | ||
124 | (n) & (1ULL << 8) ? 8 : \ | ||
125 | (n) & (1ULL << 7) ? 7 : \ | ||
126 | (n) & (1ULL << 6) ? 6 : \ | ||
127 | (n) & (1ULL << 5) ? 5 : \ | ||
128 | (n) & (1ULL << 4) ? 4 : \ | ||
129 | (n) & (1ULL << 3) ? 3 : \ | ||
130 | (n) & (1ULL << 2) ? 2 : \ | ||
131 | (n) & (1ULL << 1) ? 1 : \ | ||
132 | (n) & (1ULL << 0) ? 0 : \ | ||
133 | ____ilog2_NaN() \ | ||
134 | ) : \ | ||
135 | (sizeof(n) <= 4) ? \ | ||
136 | __ilog2_u32(n) : \ | ||
137 | __ilog2_u64(n) \ | ||
138 | ) | ||
139 | |||
140 | /** | ||
141 | * roundup_pow_of_two - round the given value up to nearest power of two | ||
142 | * @n - parameter | ||
143 | * | ||
144 | * round the given balue up to the nearest power of two | ||
145 | * - the result is undefined when n == 0 | ||
146 | * - this can be used to initialise global variables from constant data | ||
147 | */ | ||
148 | #define roundup_pow_of_two(n) \ | ||
149 | ( \ | ||
150 | __builtin_constant_p(n) ? ( \ | ||
151 | (n == 1) ? 0 : \ | ||
152 | (1UL << (ilog2((n) - 1) + 1)) \ | ||
153 | ) : \ | ||
154 | __roundup_pow_of_two(n) \ | ||
155 | ) | ||
156 | |||
157 | #endif /* _LINUX_LOG2_H */ | ||
diff --git a/include/linux/mnt_namespace.h b/include/linux/mnt_namespace.h new file mode 100644 index 000000000000..4af0b1fc282a --- /dev/null +++ b/include/linux/mnt_namespace.h | |||
@@ -0,0 +1,42 @@ | |||
1 | #ifndef _NAMESPACE_H_ | ||
2 | #define _NAMESPACE_H_ | ||
3 | #ifdef __KERNEL__ | ||
4 | |||
5 | #include <linux/mount.h> | ||
6 | #include <linux/sched.h> | ||
7 | #include <linux/nsproxy.h> | ||
8 | |||
9 | struct mnt_namespace { | ||
10 | atomic_t count; | ||
11 | struct vfsmount * root; | ||
12 | struct list_head list; | ||
13 | wait_queue_head_t poll; | ||
14 | int event; | ||
15 | }; | ||
16 | |||
17 | extern int copy_mnt_ns(int, struct task_struct *); | ||
18 | extern void __put_mnt_ns(struct mnt_namespace *ns); | ||
19 | extern struct mnt_namespace *dup_mnt_ns(struct task_struct *, | ||
20 | struct fs_struct *); | ||
21 | |||
22 | static inline void put_mnt_ns(struct mnt_namespace *ns) | ||
23 | { | ||
24 | if (atomic_dec_and_lock(&ns->count, &vfsmount_lock)) | ||
25 | /* releases vfsmount_lock */ | ||
26 | __put_mnt_ns(ns); | ||
27 | } | ||
28 | |||
29 | static inline void exit_mnt_ns(struct task_struct *p) | ||
30 | { | ||
31 | struct mnt_namespace *ns = p->nsproxy->mnt_ns; | ||
32 | if (ns) | ||
33 | put_mnt_ns(ns); | ||
34 | } | ||
35 | |||
36 | static inline void get_mnt_ns(struct mnt_namespace *ns) | ||
37 | { | ||
38 | atomic_inc(&ns->count); | ||
39 | } | ||
40 | |||
41 | #endif | ||
42 | #endif | ||
diff --git a/include/linux/module.h b/include/linux/module.h index d33df2408e05..10f771a49997 100644 --- a/include/linux/module.h +++ b/include/linux/module.h | |||
@@ -319,6 +319,13 @@ struct module | |||
319 | 319 | ||
320 | unsigned int taints; /* same bits as kernel:tainted */ | 320 | unsigned int taints; /* same bits as kernel:tainted */ |
321 | 321 | ||
322 | #ifdef CONFIG_GENERIC_BUG | ||
323 | /* Support for BUG */ | ||
324 | struct list_head bug_list; | ||
325 | struct bug_entry *bug_table; | ||
326 | unsigned num_bugs; | ||
327 | #endif | ||
328 | |||
322 | #ifdef CONFIG_MODULE_UNLOAD | 329 | #ifdef CONFIG_MODULE_UNLOAD |
323 | /* Reference counts */ | 330 | /* Reference counts */ |
324 | struct module_ref ref[NR_CPUS]; | 331 | struct module_ref ref[NR_CPUS]; |
diff --git a/include/linux/mount.h b/include/linux/mount.h index 403d1a97c512..e357dc86a4de 100644 --- a/include/linux/mount.h +++ b/include/linux/mount.h | |||
@@ -20,7 +20,7 @@ | |||
20 | struct super_block; | 20 | struct super_block; |
21 | struct vfsmount; | 21 | struct vfsmount; |
22 | struct dentry; | 22 | struct dentry; |
23 | struct namespace; | 23 | struct mnt_namespace; |
24 | 24 | ||
25 | #define MNT_NOSUID 0x01 | 25 | #define MNT_NOSUID 0x01 |
26 | #define MNT_NODEV 0x02 | 26 | #define MNT_NODEV 0x02 |
@@ -52,7 +52,7 @@ struct vfsmount { | |||
52 | struct list_head mnt_slave_list;/* list of slave mounts */ | 52 | struct list_head mnt_slave_list;/* list of slave mounts */ |
53 | struct list_head mnt_slave; /* slave list entry */ | 53 | struct list_head mnt_slave; /* slave list entry */ |
54 | struct vfsmount *mnt_master; /* slave is on master->mnt_slave_list */ | 54 | struct vfsmount *mnt_master; /* slave is on master->mnt_slave_list */ |
55 | struct namespace *mnt_namespace; /* containing namespace */ | 55 | struct mnt_namespace *mnt_ns; /* containing namespace */ |
56 | int mnt_pinned; | 56 | int mnt_pinned; |
57 | }; | 57 | }; |
58 | 58 | ||
diff --git a/include/linux/mutex.h b/include/linux/mutex.h index b2b91c477563..a7544afd7582 100644 --- a/include/linux/mutex.h +++ b/include/linux/mutex.h | |||
@@ -125,8 +125,10 @@ extern int fastcall mutex_lock_interruptible(struct mutex *lock); | |||
125 | 125 | ||
126 | #ifdef CONFIG_DEBUG_LOCK_ALLOC | 126 | #ifdef CONFIG_DEBUG_LOCK_ALLOC |
127 | extern void mutex_lock_nested(struct mutex *lock, unsigned int subclass); | 127 | extern void mutex_lock_nested(struct mutex *lock, unsigned int subclass); |
128 | extern int mutex_lock_interruptible_nested(struct mutex *lock, unsigned int subclass); | ||
128 | #else | 129 | #else |
129 | # define mutex_lock_nested(lock, subclass) mutex_lock(lock) | 130 | # define mutex_lock_nested(lock, subclass) mutex_lock(lock) |
131 | # define mutex_lock_interruptible_nested(lock, subclass) mutex_lock_interruptible(lock) | ||
130 | #endif | 132 | #endif |
131 | 133 | ||
132 | /* | 134 | /* |
diff --git a/include/linux/namei.h b/include/linux/namei.h index f5f19606effb..d39a5a67e979 100644 --- a/include/linux/namei.h +++ b/include/linux/namei.h | |||
@@ -29,6 +29,11 @@ struct nameidata { | |||
29 | } intent; | 29 | } intent; |
30 | }; | 30 | }; |
31 | 31 | ||
32 | struct path { | ||
33 | struct vfsmount *mnt; | ||
34 | struct dentry *dentry; | ||
35 | }; | ||
36 | |||
32 | /* | 37 | /* |
33 | * Type of the last component on LOOKUP_PARENT | 38 | * Type of the last component on LOOKUP_PARENT |
34 | */ | 39 | */ |
diff --git a/include/linux/namespace.h b/include/linux/namespace.h deleted file mode 100644 index d137009f0b2b..000000000000 --- a/include/linux/namespace.h +++ /dev/null | |||
@@ -1,42 +0,0 @@ | |||
1 | #ifndef _NAMESPACE_H_ | ||
2 | #define _NAMESPACE_H_ | ||
3 | #ifdef __KERNEL__ | ||
4 | |||
5 | #include <linux/mount.h> | ||
6 | #include <linux/sched.h> | ||
7 | #include <linux/nsproxy.h> | ||
8 | |||
9 | struct namespace { | ||
10 | atomic_t count; | ||
11 | struct vfsmount * root; | ||
12 | struct list_head list; | ||
13 | wait_queue_head_t poll; | ||
14 | int event; | ||
15 | }; | ||
16 | |||
17 | extern int copy_namespace(int, struct task_struct *); | ||
18 | extern void __put_namespace(struct namespace *namespace); | ||
19 | extern struct namespace *dup_namespace(struct task_struct *, struct fs_struct *); | ||
20 | |||
21 | static inline void put_namespace(struct namespace *namespace) | ||
22 | { | ||
23 | if (atomic_dec_and_lock(&namespace->count, &vfsmount_lock)) | ||
24 | /* releases vfsmount_lock */ | ||
25 | __put_namespace(namespace); | ||
26 | } | ||
27 | |||
28 | static inline void exit_namespace(struct task_struct *p) | ||
29 | { | ||
30 | struct namespace *namespace = p->nsproxy->namespace; | ||
31 | if (namespace) { | ||
32 | put_namespace(namespace); | ||
33 | } | ||
34 | } | ||
35 | |||
36 | static inline void get_namespace(struct namespace *namespace) | ||
37 | { | ||
38 | atomic_inc(&namespace->count); | ||
39 | } | ||
40 | |||
41 | #endif | ||
42 | #endif | ||
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index c57088f575a3..6be767c76b37 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h | |||
@@ -193,13 +193,20 @@ struct hh_cache | |||
193 | { | 193 | { |
194 | struct hh_cache *hh_next; /* Next entry */ | 194 | struct hh_cache *hh_next; /* Next entry */ |
195 | atomic_t hh_refcnt; /* number of users */ | 195 | atomic_t hh_refcnt; /* number of users */ |
196 | __be16 hh_type; /* protocol identifier, f.e ETH_P_IP | 196 | /* |
197 | * We want hh_output, hh_len, hh_lock and hh_data be a in a separate | ||
198 | * cache line on SMP. | ||
199 | * They are mostly read, but hh_refcnt may be changed quite frequently, | ||
200 | * incurring cache line ping pongs. | ||
201 | */ | ||
202 | __be16 hh_type ____cacheline_aligned_in_smp; | ||
203 | /* protocol identifier, f.e ETH_P_IP | ||
197 | * NOTE: For VLANs, this will be the | 204 | * NOTE: For VLANs, this will be the |
198 | * encapuslated type. --BLG | 205 | * encapuslated type. --BLG |
199 | */ | 206 | */ |
200 | u16 hh_len; /* length of header */ | 207 | u16 hh_len; /* length of header */ |
201 | int (*hh_output)(struct sk_buff *skb); | 208 | int (*hh_output)(struct sk_buff *skb); |
202 | rwlock_t hh_lock; | 209 | seqlock_t hh_lock; |
203 | 210 | ||
204 | /* cached hardware header; allow for machine alignment needs. */ | 211 | /* cached hardware header; allow for machine alignment needs. */ |
205 | #define HH_DATA_MOD 16 | 212 | #define HH_DATA_MOD 16 |
diff --git a/include/linux/nsproxy.h b/include/linux/nsproxy.h index 971d1c6dfc4b..fdfb0e44912f 100644 --- a/include/linux/nsproxy.h +++ b/include/linux/nsproxy.h | |||
@@ -4,9 +4,10 @@ | |||
4 | #include <linux/spinlock.h> | 4 | #include <linux/spinlock.h> |
5 | #include <linux/sched.h> | 5 | #include <linux/sched.h> |
6 | 6 | ||
7 | struct namespace; | 7 | struct mnt_namespace; |
8 | struct uts_namespace; | 8 | struct uts_namespace; |
9 | struct ipc_namespace; | 9 | struct ipc_namespace; |
10 | struct pid_namespace; | ||
10 | 11 | ||
11 | /* | 12 | /* |
12 | * A structure to contain pointers to all per-process | 13 | * A structure to contain pointers to all per-process |
@@ -23,9 +24,11 @@ struct ipc_namespace; | |||
23 | struct nsproxy { | 24 | struct nsproxy { |
24 | atomic_t count; | 25 | atomic_t count; |
25 | spinlock_t nslock; | 26 | spinlock_t nslock; |
27 | unsigned long id; | ||
26 | struct uts_namespace *uts_ns; | 28 | struct uts_namespace *uts_ns; |
27 | struct ipc_namespace *ipc_ns; | 29 | struct ipc_namespace *ipc_ns; |
28 | struct namespace *namespace; | 30 | struct mnt_namespace *mnt_ns; |
31 | struct pid_namespace *pid_ns; | ||
29 | }; | 32 | }; |
30 | extern struct nsproxy init_nsproxy; | 33 | extern struct nsproxy init_nsproxy; |
31 | 34 | ||
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h index 4d972bbef316..51180dba9a98 100644 --- a/include/linux/pci_ids.h +++ b/include/linux/pci_ids.h | |||
@@ -1785,14 +1785,17 @@ | |||
1785 | #define PCI_DEVICE_ID_MOXA_C104 0x1040 | 1785 | #define PCI_DEVICE_ID_MOXA_C104 0x1040 |
1786 | #define PCI_DEVICE_ID_MOXA_CP104U 0x1041 | 1786 | #define PCI_DEVICE_ID_MOXA_CP104U 0x1041 |
1787 | #define PCI_DEVICE_ID_MOXA_CP104JU 0x1042 | 1787 | #define PCI_DEVICE_ID_MOXA_CP104JU 0x1042 |
1788 | #define PCI_DEVICE_ID_MOXA_CP104EL 0x1043 | ||
1788 | #define PCI_DEVICE_ID_MOXA_CT114 0x1140 | 1789 | #define PCI_DEVICE_ID_MOXA_CT114 0x1140 |
1789 | #define PCI_DEVICE_ID_MOXA_CP114 0x1141 | 1790 | #define PCI_DEVICE_ID_MOXA_CP114 0x1141 |
1790 | #define PCI_DEVICE_ID_MOXA_CP118U 0x1180 | 1791 | #define PCI_DEVICE_ID_MOXA_CP118U 0x1180 |
1792 | #define PCI_DEVICE_ID_MOXA_CP118EL 0x1181 | ||
1791 | #define PCI_DEVICE_ID_MOXA_CP132 0x1320 | 1793 | #define PCI_DEVICE_ID_MOXA_CP132 0x1320 |
1792 | #define PCI_DEVICE_ID_MOXA_CP132U 0x1321 | 1794 | #define PCI_DEVICE_ID_MOXA_CP132U 0x1321 |
1793 | #define PCI_DEVICE_ID_MOXA_CP134U 0x1340 | 1795 | #define PCI_DEVICE_ID_MOXA_CP134U 0x1340 |
1794 | #define PCI_DEVICE_ID_MOXA_C168 0x1680 | 1796 | #define PCI_DEVICE_ID_MOXA_C168 0x1680 |
1795 | #define PCI_DEVICE_ID_MOXA_CP168U 0x1681 | 1797 | #define PCI_DEVICE_ID_MOXA_CP168U 0x1681 |
1798 | #define PCI_DEVICE_ID_MOXA_CP168EL 0x1682 | ||
1796 | 1799 | ||
1797 | #define PCI_VENDOR_ID_CCD 0x1397 | 1800 | #define PCI_VENDOR_ID_CCD 0x1397 |
1798 | #define PCI_DEVICE_ID_CCD_2BD0 0x2bd0 | 1801 | #define PCI_DEVICE_ID_CCD_2BD0 0x2bd0 |
diff --git a/include/linux/pid.h b/include/linux/pid.h index 2c0007d17218..4dec047b1837 100644 --- a/include/linux/pid.h +++ b/include/linux/pid.h | |||
@@ -35,8 +35,9 @@ enum pid_type | |||
35 | * | 35 | * |
36 | * Holding a reference to struct pid solves both of these problems. | 36 | * Holding a reference to struct pid solves both of these problems. |
37 | * It is small so holding a reference does not consume a lot of | 37 | * It is small so holding a reference does not consume a lot of |
38 | * resources, and since a new struct pid is allocated when the numeric | 38 | * resources, and since a new struct pid is allocated when the numeric pid |
39 | * pid value is reused we don't mistakenly refer to new processes. | 39 | * value is reused (when pids wrap around) we don't mistakenly refer to new |
40 | * processes. | ||
40 | */ | 41 | */ |
41 | 42 | ||
42 | struct pid | 43 | struct pid |
diff --git a/include/linux/pid_namespace.h b/include/linux/pid_namespace.h new file mode 100644 index 000000000000..d2a9d419f01f --- /dev/null +++ b/include/linux/pid_namespace.h | |||
@@ -0,0 +1,45 @@ | |||
1 | #ifndef _LINUX_PID_NS_H | ||
2 | #define _LINUX_PID_NS_H | ||
3 | |||
4 | #include <linux/sched.h> | ||
5 | #include <linux/mm.h> | ||
6 | #include <linux/threads.h> | ||
7 | #include <linux/pid.h> | ||
8 | #include <linux/nsproxy.h> | ||
9 | #include <linux/kref.h> | ||
10 | |||
11 | struct pidmap { | ||
12 | atomic_t nr_free; | ||
13 | void *page; | ||
14 | }; | ||
15 | |||
16 | #define PIDMAP_ENTRIES ((PID_MAX_LIMIT + 8*PAGE_SIZE - 1)/PAGE_SIZE/8) | ||
17 | |||
18 | struct pid_namespace { | ||
19 | struct kref kref; | ||
20 | struct pidmap pidmap[PIDMAP_ENTRIES]; | ||
21 | int last_pid; | ||
22 | struct task_struct *child_reaper; | ||
23 | }; | ||
24 | |||
25 | extern struct pid_namespace init_pid_ns; | ||
26 | |||
27 | static inline void get_pid_ns(struct pid_namespace *ns) | ||
28 | { | ||
29 | kref_get(&ns->kref); | ||
30 | } | ||
31 | |||
32 | extern int copy_pid_ns(int flags, struct task_struct *tsk); | ||
33 | extern void free_pid_ns(struct kref *kref); | ||
34 | |||
35 | static inline void put_pid_ns(struct pid_namespace *ns) | ||
36 | { | ||
37 | kref_put(&ns->kref, free_pid_ns); | ||
38 | } | ||
39 | |||
40 | static inline struct task_struct *child_reaper(struct task_struct *tsk) | ||
41 | { | ||
42 | return tsk->nsproxy->pid_ns->child_reaper; | ||
43 | } | ||
44 | |||
45 | #endif /* _LINUX_PID_NS_H */ | ||
diff --git a/include/linux/pktcdvd.h b/include/linux/pktcdvd.h index 8a94c717c266..5ea4f05683f6 100644 --- a/include/linux/pktcdvd.h +++ b/include/linux/pktcdvd.h | |||
@@ -111,6 +111,13 @@ struct pkt_ctrl_command { | |||
111 | #include <linux/blkdev.h> | 111 | #include <linux/blkdev.h> |
112 | #include <linux/completion.h> | 112 | #include <linux/completion.h> |
113 | #include <linux/cdrom.h> | 113 | #include <linux/cdrom.h> |
114 | #include <linux/kobject.h> | ||
115 | #include <linux/sysfs.h> | ||
116 | |||
117 | /* default bio write queue congestion marks */ | ||
118 | #define PKT_WRITE_CONGESTION_ON 10000 | ||
119 | #define PKT_WRITE_CONGESTION_OFF 9000 | ||
120 | |||
114 | 121 | ||
115 | struct packet_settings | 122 | struct packet_settings |
116 | { | 123 | { |
@@ -241,6 +248,14 @@ struct packet_stacked_data | |||
241 | }; | 248 | }; |
242 | #define PSD_POOL_SIZE 64 | 249 | #define PSD_POOL_SIZE 64 |
243 | 250 | ||
251 | struct pktcdvd_kobj | ||
252 | { | ||
253 | struct kobject kobj; | ||
254 | struct pktcdvd_device *pd; | ||
255 | }; | ||
256 | #define to_pktcdvdkobj(_k) \ | ||
257 | ((struct pktcdvd_kobj*)container_of(_k,struct pktcdvd_kobj,kobj)) | ||
258 | |||
244 | struct pktcdvd_device | 259 | struct pktcdvd_device |
245 | { | 260 | { |
246 | struct block_device *bdev; /* dev attached */ | 261 | struct block_device *bdev; /* dev attached */ |
@@ -271,6 +286,16 @@ struct pktcdvd_device | |||
271 | 286 | ||
272 | struct packet_iosched iosched; | 287 | struct packet_iosched iosched; |
273 | struct gendisk *disk; | 288 | struct gendisk *disk; |
289 | |||
290 | int write_congestion_off; | ||
291 | int write_congestion_on; | ||
292 | |||
293 | struct class_device *clsdev; /* sysfs pktcdvd[0-7] class dev */ | ||
294 | struct pktcdvd_kobj *kobj_stat; /* sysfs pktcdvd[0-7]/stat/ */ | ||
295 | struct pktcdvd_kobj *kobj_wqueue; /* sysfs pktcdvd[0-7]/write_queue/ */ | ||
296 | |||
297 | struct dentry *dfs_d_root; /* debugfs: devname directory */ | ||
298 | struct dentry *dfs_f_info; /* debugfs: info file */ | ||
274 | }; | 299 | }; |
275 | 300 | ||
276 | #endif /* __KERNEL__ */ | 301 | #endif /* __KERNEL__ */ |
diff --git a/include/linux/pspace.h b/include/linux/pspace.h deleted file mode 100644 index 91d48b8b2d99..000000000000 --- a/include/linux/pspace.h +++ /dev/null | |||
@@ -1,23 +0,0 @@ | |||
1 | #ifndef _LINUX_PSPACE_H | ||
2 | #define _LINUX_PSPACE_H | ||
3 | |||
4 | #include <linux/sched.h> | ||
5 | #include <linux/mm.h> | ||
6 | #include <linux/threads.h> | ||
7 | #include <linux/pid.h> | ||
8 | |||
9 | struct pidmap { | ||
10 | atomic_t nr_free; | ||
11 | void *page; | ||
12 | }; | ||
13 | |||
14 | #define PIDMAP_ENTRIES ((PID_MAX_LIMIT + 8*PAGE_SIZE - 1)/PAGE_SIZE/8) | ||
15 | |||
16 | struct pspace { | ||
17 | struct pidmap pidmap[PIDMAP_ENTRIES]; | ||
18 | int last_pid; | ||
19 | }; | ||
20 | |||
21 | extern struct pspace init_pspace; | ||
22 | |||
23 | #endif /* _LINUX_PSPACE_H */ | ||
diff --git a/include/linux/raid/raid5.h b/include/linux/raid/raid5.h index 03636d7918fe..d8286db60b96 100644 --- a/include/linux/raid/raid5.h +++ b/include/linux/raid/raid5.h | |||
@@ -227,7 +227,10 @@ struct raid5_private_data { | |||
227 | struct list_head handle_list; /* stripes needing handling */ | 227 | struct list_head handle_list; /* stripes needing handling */ |
228 | struct list_head delayed_list; /* stripes that have plugged requests */ | 228 | struct list_head delayed_list; /* stripes that have plugged requests */ |
229 | struct list_head bitmap_list; /* stripes delaying awaiting bitmap update */ | 229 | struct list_head bitmap_list; /* stripes delaying awaiting bitmap update */ |
230 | struct bio *retry_read_aligned; /* currently retrying aligned bios */ | ||
231 | struct bio *retry_read_aligned_list; /* aligned bios retry list */ | ||
230 | atomic_t preread_active_stripes; /* stripes with scheduled io */ | 232 | atomic_t preread_active_stripes; /* stripes with scheduled io */ |
233 | atomic_t active_aligned_reads; | ||
231 | 234 | ||
232 | atomic_t reshape_stripes; /* stripes with pending writes for reshape */ | 235 | atomic_t reshape_stripes; /* stripes with pending writes for reshape */ |
233 | /* unfortunately we need two cache names as we temporarily have | 236 | /* unfortunately we need two cache names as we temporarily have |
diff --git a/include/linux/reiserfs_fs.h b/include/linux/reiserfs_fs.h index d0e4dce33ad5..c3fc6caaad3f 100644 --- a/include/linux/reiserfs_fs.h +++ b/include/linux/reiserfs_fs.h | |||
@@ -1159,7 +1159,7 @@ znodes are the way! */ | |||
1159 | #define PATH_READA 0x1 /* do read ahead */ | 1159 | #define PATH_READA 0x1 /* do read ahead */ |
1160 | #define PATH_READA_BACK 0x2 /* read backwards */ | 1160 | #define PATH_READA_BACK 0x2 /* read backwards */ |
1161 | 1161 | ||
1162 | struct path { | 1162 | struct treepath { |
1163 | int path_length; /* Length of the array above. */ | 1163 | int path_length; /* Length of the array above. */ |
1164 | int reada; | 1164 | int reada; |
1165 | struct path_element path_elements[EXTENDED_MAX_HEIGHT]; /* Array of the path elements. */ | 1165 | struct path_element path_elements[EXTENDED_MAX_HEIGHT]; /* Array of the path elements. */ |
@@ -1169,7 +1169,7 @@ struct path { | |||
1169 | #define pos_in_item(path) ((path)->pos_in_item) | 1169 | #define pos_in_item(path) ((path)->pos_in_item) |
1170 | 1170 | ||
1171 | #define INITIALIZE_PATH(var) \ | 1171 | #define INITIALIZE_PATH(var) \ |
1172 | struct path var = {.path_length = ILLEGAL_PATH_ELEMENT_OFFSET, .reada = 0,} | 1172 | struct treepath var = {.path_length = ILLEGAL_PATH_ELEMENT_OFFSET, .reada = 0,} |
1173 | 1173 | ||
1174 | /* Get path element by path and path position. */ | 1174 | /* Get path element by path and path position. */ |
1175 | #define PATH_OFFSET_PELEMENT(p_s_path,n_offset) ((p_s_path)->path_elements +(n_offset)) | 1175 | #define PATH_OFFSET_PELEMENT(p_s_path,n_offset) ((p_s_path)->path_elements +(n_offset)) |
@@ -1327,7 +1327,7 @@ struct tree_balance { | |||
1327 | int need_balance_dirty; | 1327 | int need_balance_dirty; |
1328 | struct super_block *tb_sb; | 1328 | struct super_block *tb_sb; |
1329 | struct reiserfs_transaction_handle *transaction_handle; | 1329 | struct reiserfs_transaction_handle *transaction_handle; |
1330 | struct path *tb_path; | 1330 | struct treepath *tb_path; |
1331 | struct buffer_head *L[MAX_HEIGHT]; /* array of left neighbors of nodes in the path */ | 1331 | struct buffer_head *L[MAX_HEIGHT]; /* array of left neighbors of nodes in the path */ |
1332 | struct buffer_head *R[MAX_HEIGHT]; /* array of right neighbors of nodes in the path */ | 1332 | struct buffer_head *R[MAX_HEIGHT]; /* array of right neighbors of nodes in the path */ |
1333 | struct buffer_head *FL[MAX_HEIGHT]; /* array of fathers of the left neighbors */ | 1333 | struct buffer_head *FL[MAX_HEIGHT]; /* array of fathers of the left neighbors */ |
@@ -1793,41 +1793,41 @@ static inline void copy_key(struct reiserfs_key *to, | |||
1793 | memcpy(to, from, KEY_SIZE); | 1793 | memcpy(to, from, KEY_SIZE); |
1794 | } | 1794 | } |
1795 | 1795 | ||
1796 | int comp_items(const struct item_head *stored_ih, const struct path *p_s_path); | 1796 | int comp_items(const struct item_head *stored_ih, const struct treepath *p_s_path); |
1797 | const struct reiserfs_key *get_rkey(const struct path *p_s_chk_path, | 1797 | const struct reiserfs_key *get_rkey(const struct treepath *p_s_chk_path, |
1798 | const struct super_block *p_s_sb); | 1798 | const struct super_block *p_s_sb); |
1799 | int search_by_key(struct super_block *, const struct cpu_key *, | 1799 | int search_by_key(struct super_block *, const struct cpu_key *, |
1800 | struct path *, int); | 1800 | struct treepath *, int); |
1801 | #define search_item(s,key,path) search_by_key (s, key, path, DISK_LEAF_NODE_LEVEL) | 1801 | #define search_item(s,key,path) search_by_key (s, key, path, DISK_LEAF_NODE_LEVEL) |
1802 | int search_for_position_by_key(struct super_block *p_s_sb, | 1802 | int search_for_position_by_key(struct super_block *p_s_sb, |
1803 | const struct cpu_key *p_s_cpu_key, | 1803 | const struct cpu_key *p_s_cpu_key, |
1804 | struct path *p_s_search_path); | 1804 | struct treepath *p_s_search_path); |
1805 | extern void decrement_bcount(struct buffer_head *p_s_bh); | 1805 | extern void decrement_bcount(struct buffer_head *p_s_bh); |
1806 | void decrement_counters_in_path(struct path *p_s_search_path); | 1806 | void decrement_counters_in_path(struct treepath *p_s_search_path); |
1807 | void pathrelse(struct path *p_s_search_path); | 1807 | void pathrelse(struct treepath *p_s_search_path); |
1808 | int reiserfs_check_path(struct path *p); | 1808 | int reiserfs_check_path(struct treepath *p); |
1809 | void pathrelse_and_restore(struct super_block *s, struct path *p_s_search_path); | 1809 | void pathrelse_and_restore(struct super_block *s, struct treepath *p_s_search_path); |
1810 | 1810 | ||
1811 | int reiserfs_insert_item(struct reiserfs_transaction_handle *th, | 1811 | int reiserfs_insert_item(struct reiserfs_transaction_handle *th, |
1812 | struct path *path, | 1812 | struct treepath *path, |
1813 | const struct cpu_key *key, | 1813 | const struct cpu_key *key, |
1814 | struct item_head *ih, | 1814 | struct item_head *ih, |
1815 | struct inode *inode, const char *body); | 1815 | struct inode *inode, const char *body); |
1816 | 1816 | ||
1817 | int reiserfs_paste_into_item(struct reiserfs_transaction_handle *th, | 1817 | int reiserfs_paste_into_item(struct reiserfs_transaction_handle *th, |
1818 | struct path *path, | 1818 | struct treepath *path, |
1819 | const struct cpu_key *key, | 1819 | const struct cpu_key *key, |
1820 | struct inode *inode, | 1820 | struct inode *inode, |
1821 | const char *body, int paste_size); | 1821 | const char *body, int paste_size); |
1822 | 1822 | ||
1823 | int reiserfs_cut_from_item(struct reiserfs_transaction_handle *th, | 1823 | int reiserfs_cut_from_item(struct reiserfs_transaction_handle *th, |
1824 | struct path *path, | 1824 | struct treepath *path, |
1825 | struct cpu_key *key, | 1825 | struct cpu_key *key, |
1826 | struct inode *inode, | 1826 | struct inode *inode, |
1827 | struct page *page, loff_t new_file_size); | 1827 | struct page *page, loff_t new_file_size); |
1828 | 1828 | ||
1829 | int reiserfs_delete_item(struct reiserfs_transaction_handle *th, | 1829 | int reiserfs_delete_item(struct reiserfs_transaction_handle *th, |
1830 | struct path *path, | 1830 | struct treepath *path, |
1831 | const struct cpu_key *key, | 1831 | const struct cpu_key *key, |
1832 | struct inode *inode, struct buffer_head *p_s_un_bh); | 1832 | struct inode *inode, struct buffer_head *p_s_un_bh); |
1833 | 1833 | ||
@@ -1858,7 +1858,7 @@ void padd_item(char *item, int total_length, int length); | |||
1858 | #define GET_BLOCK_NO_DANGLE 16 /* don't leave any transactions running */ | 1858 | #define GET_BLOCK_NO_DANGLE 16 /* don't leave any transactions running */ |
1859 | 1859 | ||
1860 | int restart_transaction(struct reiserfs_transaction_handle *th, | 1860 | int restart_transaction(struct reiserfs_transaction_handle *th, |
1861 | struct inode *inode, struct path *path); | 1861 | struct inode *inode, struct treepath *path); |
1862 | void reiserfs_read_locked_inode(struct inode *inode, | 1862 | void reiserfs_read_locked_inode(struct inode *inode, |
1863 | struct reiserfs_iget_args *args); | 1863 | struct reiserfs_iget_args *args); |
1864 | int reiserfs_find_actor(struct inode *inode, void *p); | 1864 | int reiserfs_find_actor(struct inode *inode, void *p); |
@@ -1905,7 +1905,7 @@ int reiserfs_setattr(struct dentry *dentry, struct iattr *attr); | |||
1905 | /* namei.c */ | 1905 | /* namei.c */ |
1906 | void set_de_name_and_namelen(struct reiserfs_dir_entry *de); | 1906 | void set_de_name_and_namelen(struct reiserfs_dir_entry *de); |
1907 | int search_by_entry_key(struct super_block *sb, const struct cpu_key *key, | 1907 | int search_by_entry_key(struct super_block *sb, const struct cpu_key *key, |
1908 | struct path *path, struct reiserfs_dir_entry *de); | 1908 | struct treepath *path, struct reiserfs_dir_entry *de); |
1909 | struct dentry *reiserfs_get_parent(struct dentry *); | 1909 | struct dentry *reiserfs_get_parent(struct dentry *); |
1910 | /* procfs.c */ | 1910 | /* procfs.c */ |
1911 | 1911 | ||
@@ -1956,9 +1956,9 @@ extern const struct file_operations reiserfs_dir_operations; | |||
1956 | 1956 | ||
1957 | /* tail_conversion.c */ | 1957 | /* tail_conversion.c */ |
1958 | int direct2indirect(struct reiserfs_transaction_handle *, struct inode *, | 1958 | int direct2indirect(struct reiserfs_transaction_handle *, struct inode *, |
1959 | struct path *, struct buffer_head *, loff_t); | 1959 | struct treepath *, struct buffer_head *, loff_t); |
1960 | int indirect2direct(struct reiserfs_transaction_handle *, struct inode *, | 1960 | int indirect2direct(struct reiserfs_transaction_handle *, struct inode *, |
1961 | struct page *, struct path *, const struct cpu_key *, | 1961 | struct page *, struct treepath *, const struct cpu_key *, |
1962 | loff_t, char *); | 1962 | loff_t, char *); |
1963 | void reiserfs_unmap_buffer(struct buffer_head *); | 1963 | void reiserfs_unmap_buffer(struct buffer_head *); |
1964 | 1964 | ||
@@ -2045,7 +2045,7 @@ struct __reiserfs_blocknr_hint { | |||
2045 | struct inode *inode; /* inode passed to allocator, if we allocate unf. nodes */ | 2045 | struct inode *inode; /* inode passed to allocator, if we allocate unf. nodes */ |
2046 | long block; /* file offset, in blocks */ | 2046 | long block; /* file offset, in blocks */ |
2047 | struct in_core_key key; | 2047 | struct in_core_key key; |
2048 | struct path *path; /* search path, used by allocator to deternine search_start by | 2048 | struct treepath *path; /* search path, used by allocator to deternine search_start by |
2049 | * various ways */ | 2049 | * various ways */ |
2050 | struct reiserfs_transaction_handle *th; /* transaction handle is needed to log super blocks and | 2050 | struct reiserfs_transaction_handle *th; /* transaction handle is needed to log super blocks and |
2051 | * bitmap blocks changes */ | 2051 | * bitmap blocks changes */ |
@@ -2101,7 +2101,7 @@ static inline int reiserfs_new_form_blocknrs(struct tree_balance *tb, | |||
2101 | static inline int reiserfs_new_unf_blocknrs(struct reiserfs_transaction_handle | 2101 | static inline int reiserfs_new_unf_blocknrs(struct reiserfs_transaction_handle |
2102 | *th, struct inode *inode, | 2102 | *th, struct inode *inode, |
2103 | b_blocknr_t * new_blocknrs, | 2103 | b_blocknr_t * new_blocknrs, |
2104 | struct path *path, long block) | 2104 | struct treepath *path, long block) |
2105 | { | 2105 | { |
2106 | reiserfs_blocknr_hint_t hint = { | 2106 | reiserfs_blocknr_hint_t hint = { |
2107 | .th = th, | 2107 | .th = th, |
@@ -2118,7 +2118,7 @@ static inline int reiserfs_new_unf_blocknrs(struct reiserfs_transaction_handle | |||
2118 | static inline int reiserfs_new_unf_blocknrs2(struct reiserfs_transaction_handle | 2118 | static inline int reiserfs_new_unf_blocknrs2(struct reiserfs_transaction_handle |
2119 | *th, struct inode *inode, | 2119 | *th, struct inode *inode, |
2120 | b_blocknr_t * new_blocknrs, | 2120 | b_blocknr_t * new_blocknrs, |
2121 | struct path *path, long block) | 2121 | struct treepath *path, long block) |
2122 | { | 2122 | { |
2123 | reiserfs_blocknr_hint_t hint = { | 2123 | reiserfs_blocknr_hint_t hint = { |
2124 | .th = th, | 2124 | .th = th, |
diff --git a/include/linux/rtc.h b/include/linux/rtc.h index 09ff4c3e2713..5e22d4510d11 100644 --- a/include/linux/rtc.h +++ b/include/linux/rtc.h | |||
@@ -106,6 +106,7 @@ extern int rtc_year_days(unsigned int day, unsigned int month, unsigned int year | |||
106 | extern int rtc_valid_tm(struct rtc_time *tm); | 106 | extern int rtc_valid_tm(struct rtc_time *tm); |
107 | extern int rtc_tm_to_time(struct rtc_time *tm, unsigned long *time); | 107 | extern int rtc_tm_to_time(struct rtc_time *tm, unsigned long *time); |
108 | extern void rtc_time_to_tm(unsigned long time, struct rtc_time *tm); | 108 | extern void rtc_time_to_tm(unsigned long time, struct rtc_time *tm); |
109 | extern void rtc_merge_alarm(struct rtc_time *now, struct rtc_time *alarm); | ||
109 | 110 | ||
110 | #include <linux/device.h> | 111 | #include <linux/device.h> |
111 | #include <linux/seq_file.h> | 112 | #include <linux/seq_file.h> |
diff --git a/include/linux/rtnetlink.h b/include/linux/rtnetlink.h index 493297acdae8..4a629ea70cc4 100644 --- a/include/linux/rtnetlink.h +++ b/include/linux/rtnetlink.h | |||
@@ -3,6 +3,8 @@ | |||
3 | 3 | ||
4 | #include <linux/netlink.h> | 4 | #include <linux/netlink.h> |
5 | #include <linux/if_link.h> | 5 | #include <linux/if_link.h> |
6 | #include <linux/if_addr.h> | ||
7 | #include <linux/neighbour.h> | ||
6 | 8 | ||
7 | /**** | 9 | /**** |
8 | * Routing/neighbour discovery messages. | 10 | * Routing/neighbour discovery messages. |
diff --git a/include/linux/sched.h b/include/linux/sched.h index dede82c63445..ea92e5c89089 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h | |||
@@ -82,6 +82,7 @@ struct sched_param { | |||
82 | #include <linux/resource.h> | 82 | #include <linux/resource.h> |
83 | #include <linux/timer.h> | 83 | #include <linux/timer.h> |
84 | #include <linux/hrtimer.h> | 84 | #include <linux/hrtimer.h> |
85 | #include <linux/task_io_accounting.h> | ||
85 | 86 | ||
86 | #include <asm/processor.h> | 87 | #include <asm/processor.h> |
87 | 88 | ||
@@ -436,7 +437,12 @@ struct signal_struct { | |||
436 | /* job control IDs */ | 437 | /* job control IDs */ |
437 | pid_t pgrp; | 438 | pid_t pgrp; |
438 | pid_t tty_old_pgrp; | 439 | pid_t tty_old_pgrp; |
439 | pid_t session; | 440 | |
441 | union { | ||
442 | pid_t session __deprecated; | ||
443 | pid_t __session; | ||
444 | }; | ||
445 | |||
440 | /* boolean value for session group leader */ | 446 | /* boolean value for session group leader */ |
441 | int leader; | 447 | int leader; |
442 | 448 | ||
@@ -642,6 +648,7 @@ enum idle_type | |||
642 | #define SD_SHARE_CPUPOWER 128 /* Domain members share cpu power */ | 648 | #define SD_SHARE_CPUPOWER 128 /* Domain members share cpu power */ |
643 | #define SD_POWERSAVINGS_BALANCE 256 /* Balance for power savings */ | 649 | #define SD_POWERSAVINGS_BALANCE 256 /* Balance for power savings */ |
644 | #define SD_SHARE_PKG_RESOURCES 512 /* Domain members share cpu pkg resources */ | 650 | #define SD_SHARE_PKG_RESOURCES 512 /* Domain members share cpu pkg resources */ |
651 | #define SD_SERIALIZE 1024 /* Only a single load balancing instance */ | ||
645 | 652 | ||
646 | #define BALANCE_FOR_MC_POWER \ | 653 | #define BALANCE_FOR_MC_POWER \ |
647 | (sched_smt_power_savings ? SD_POWERSAVINGS_BALANCE : 0) | 654 | (sched_smt_power_savings ? SD_POWERSAVINGS_BALANCE : 0) |
@@ -1008,6 +1015,7 @@ struct task_struct { | |||
1008 | wait_queue_t *io_wait; | 1015 | wait_queue_t *io_wait; |
1009 | /* i/o counters(bytes read/written, #syscalls */ | 1016 | /* i/o counters(bytes read/written, #syscalls */ |
1010 | u64 rchar, wchar, syscr, syscw; | 1017 | u64 rchar, wchar, syscr, syscw; |
1018 | struct task_io_accounting ioac; | ||
1011 | #if defined(CONFIG_TASK_XACCT) | 1019 | #if defined(CONFIG_TASK_XACCT) |
1012 | u64 acct_rss_mem1; /* accumulated rss usage */ | 1020 | u64 acct_rss_mem1; /* accumulated rss usage */ |
1013 | u64 acct_vm_mem1; /* accumulated virtual memory usage */ | 1021 | u64 acct_vm_mem1; /* accumulated virtual memory usage */ |
@@ -1040,6 +1048,9 @@ struct task_struct { | |||
1040 | #ifdef CONFIG_TASK_DELAY_ACCT | 1048 | #ifdef CONFIG_TASK_DELAY_ACCT |
1041 | struct task_delay_info *delays; | 1049 | struct task_delay_info *delays; |
1042 | #endif | 1050 | #endif |
1051 | #ifdef CONFIG_FAULT_INJECTION | ||
1052 | int make_it_fail; | ||
1053 | #endif | ||
1043 | }; | 1054 | }; |
1044 | 1055 | ||
1045 | static inline pid_t process_group(struct task_struct *tsk) | 1056 | static inline pid_t process_group(struct task_struct *tsk) |
@@ -1047,6 +1058,21 @@ static inline pid_t process_group(struct task_struct *tsk) | |||
1047 | return tsk->signal->pgrp; | 1058 | return tsk->signal->pgrp; |
1048 | } | 1059 | } |
1049 | 1060 | ||
1061 | static inline pid_t signal_session(struct signal_struct *sig) | ||
1062 | { | ||
1063 | return sig->__session; | ||
1064 | } | ||
1065 | |||
1066 | static inline pid_t process_session(struct task_struct *tsk) | ||
1067 | { | ||
1068 | return signal_session(tsk->signal); | ||
1069 | } | ||
1070 | |||
1071 | static inline void set_signal_session(struct signal_struct *sig, pid_t session) | ||
1072 | { | ||
1073 | sig->__session = session; | ||
1074 | } | ||
1075 | |||
1050 | static inline struct pid *task_pid(struct task_struct *task) | 1076 | static inline struct pid *task_pid(struct task_struct *task) |
1051 | { | 1077 | { |
1052 | return task->pids[PIDTYPE_PID].pid; | 1078 | return task->pids[PIDTYPE_PID].pid; |
@@ -1240,7 +1266,6 @@ extern struct mm_struct init_mm; | |||
1240 | 1266 | ||
1241 | #define find_task_by_pid(nr) find_task_by_pid_type(PIDTYPE_PID, nr) | 1267 | #define find_task_by_pid(nr) find_task_by_pid_type(PIDTYPE_PID, nr) |
1242 | extern struct task_struct *find_task_by_pid_type(int type, int pid); | 1268 | extern struct task_struct *find_task_by_pid_type(int type, int pid); |
1243 | extern void set_special_pids(pid_t session, pid_t pgrp); | ||
1244 | extern void __set_special_pids(pid_t session, pid_t pgrp); | 1269 | extern void __set_special_pids(pid_t session, pid_t pgrp); |
1245 | 1270 | ||
1246 | /* per-UID process charging. */ | 1271 | /* per-UID process charging. */ |
@@ -1381,7 +1406,6 @@ extern NORET_TYPE void do_group_exit(int); | |||
1381 | extern void daemonize(const char *, ...); | 1406 | extern void daemonize(const char *, ...); |
1382 | extern int allow_signal(int); | 1407 | extern int allow_signal(int); |
1383 | extern int disallow_signal(int); | 1408 | extern int disallow_signal(int); |
1384 | extern struct task_struct *child_reaper; | ||
1385 | 1409 | ||
1386 | extern int do_execve(char *, char __user * __user *, char __user * __user *, struct pt_regs *); | 1410 | extern int do_execve(char *, char __user * __user *, char __user * __user *, struct pt_regs *); |
1387 | extern long do_fork(unsigned long, unsigned long, struct pt_regs *, unsigned long, int __user *, int __user *); | 1411 | extern long do_fork(unsigned long, unsigned long, struct pt_regs *, unsigned long, int __user *, int __user *); |
diff --git a/include/linux/seqlock.h b/include/linux/seqlock.h index 46000936f8f1..6b0648cfdffc 100644 --- a/include/linux/seqlock.h +++ b/include/linux/seqlock.h | |||
@@ -44,8 +44,11 @@ typedef struct { | |||
44 | #define SEQLOCK_UNLOCKED \ | 44 | #define SEQLOCK_UNLOCKED \ |
45 | __SEQLOCK_UNLOCKED(old_style_seqlock_init) | 45 | __SEQLOCK_UNLOCKED(old_style_seqlock_init) |
46 | 46 | ||
47 | #define seqlock_init(x) \ | 47 | #define seqlock_init(x) \ |
48 | do { *(x) = (seqlock_t) __SEQLOCK_UNLOCKED(x); } while (0) | 48 | do { \ |
49 | (x)->sequence = 0; \ | ||
50 | spin_lock_init(&(x)->lock); \ | ||
51 | } while (0) | ||
49 | 52 | ||
50 | #define DEFINE_SEQLOCK(x) \ | 53 | #define DEFINE_SEQLOCK(x) \ |
51 | seqlock_t x = __SEQLOCK_UNLOCKED(x) | 54 | seqlock_t x = __SEQLOCK_UNLOCKED(x) |
diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h index 827672136646..cf23813cbec2 100644 --- a/include/linux/serial_core.h +++ b/include/linux/serial_core.h | |||
@@ -166,8 +166,8 @@ struct uart_ops { | |||
166 | void (*break_ctl)(struct uart_port *, int ctl); | 166 | void (*break_ctl)(struct uart_port *, int ctl); |
167 | int (*startup)(struct uart_port *); | 167 | int (*startup)(struct uart_port *); |
168 | void (*shutdown)(struct uart_port *); | 168 | void (*shutdown)(struct uart_port *); |
169 | void (*set_termios)(struct uart_port *, struct termios *new, | 169 | void (*set_termios)(struct uart_port *, struct ktermios *new, |
170 | struct termios *old); | 170 | struct ktermios *old); |
171 | void (*pm)(struct uart_port *, unsigned int state, | 171 | void (*pm)(struct uart_port *, unsigned int state, |
172 | unsigned int oldstate); | 172 | unsigned int oldstate); |
173 | int (*set_wake)(struct uart_port *, unsigned int state); | 173 | int (*set_wake)(struct uart_port *, unsigned int state); |
@@ -361,8 +361,8 @@ void uart_write_wakeup(struct uart_port *port); | |||
361 | */ | 361 | */ |
362 | void uart_update_timeout(struct uart_port *port, unsigned int cflag, | 362 | void uart_update_timeout(struct uart_port *port, unsigned int cflag, |
363 | unsigned int baud); | 363 | unsigned int baud); |
364 | unsigned int uart_get_baud_rate(struct uart_port *port, struct termios *termios, | 364 | unsigned int uart_get_baud_rate(struct uart_port *port, struct ktermios *termios, |
365 | struct termios *old, unsigned int min, | 365 | struct ktermios *old, unsigned int min, |
366 | unsigned int max); | 366 | unsigned int max); |
367 | unsigned int uart_get_divisor(struct uart_port *port, unsigned int baud); | 367 | unsigned int uart_get_divisor(struct uart_port *port, unsigned int baud); |
368 | 368 | ||
diff --git a/include/linux/serio.h b/include/linux/serio.h index b99c5ca9708d..0f478a8791a2 100644 --- a/include/linux/serio.h +++ b/include/linux/serio.h | |||
@@ -85,18 +85,8 @@ static inline void serio_register_port(struct serio *serio) | |||
85 | 85 | ||
86 | void serio_unregister_port(struct serio *serio); | 86 | void serio_unregister_port(struct serio *serio); |
87 | void serio_unregister_child_port(struct serio *serio); | 87 | void serio_unregister_child_port(struct serio *serio); |
88 | void __serio_unregister_port_delayed(struct serio *serio, struct module *owner); | ||
89 | static inline void serio_unregister_port_delayed(struct serio *serio) | ||
90 | { | ||
91 | __serio_unregister_port_delayed(serio, THIS_MODULE); | ||
92 | } | ||
93 | |||
94 | void __serio_register_driver(struct serio_driver *drv, struct module *owner); | ||
95 | static inline void serio_register_driver(struct serio_driver *drv) | ||
96 | { | ||
97 | __serio_register_driver(drv, THIS_MODULE); | ||
98 | } | ||
99 | 88 | ||
89 | int serio_register_driver(struct serio_driver *drv); | ||
100 | void serio_unregister_driver(struct serio_driver *drv); | 90 | void serio_unregister_driver(struct serio_driver *drv); |
101 | 91 | ||
102 | static inline int serio_write(struct serio *serio, unsigned char data) | 92 | static inline int serio_write(struct serio *serio, unsigned char data) |
diff --git a/include/linux/stallion.h b/include/linux/stallion.h index 13a37f137ea2..4a0a329beafb 100644 --- a/include/linux/stallion.h +++ b/include/linux/stallion.h | |||
@@ -52,11 +52,11 @@ | |||
52 | * protection - since "write" code only needs to change the head, and | 52 | * protection - since "write" code only needs to change the head, and |
53 | * interrupt code only needs to change the tail. | 53 | * interrupt code only needs to change the tail. |
54 | */ | 54 | */ |
55 | typedef struct { | 55 | struct stlrq { |
56 | char *buf; | 56 | char *buf; |
57 | char *head; | 57 | char *head; |
58 | char *tail; | 58 | char *tail; |
59 | } stlrq_t; | 59 | }; |
60 | 60 | ||
61 | /* | 61 | /* |
62 | * Port, panel and board structures to hold status info about each. | 62 | * Port, panel and board structures to hold status info about each. |
@@ -67,14 +67,14 @@ typedef struct { | |||
67 | * is associated with, this makes it (fairly) easy to get back to the | 67 | * is associated with, this makes it (fairly) easy to get back to the |
68 | * board/panel info for a port. | 68 | * board/panel info for a port. |
69 | */ | 69 | */ |
70 | typedef struct stlport { | 70 | struct stlport { |
71 | unsigned long magic; | 71 | unsigned long magic; |
72 | int portnr; | 72 | unsigned int portnr; |
73 | int panelnr; | 73 | unsigned int panelnr; |
74 | int brdnr; | 74 | unsigned int brdnr; |
75 | int ioaddr; | 75 | int ioaddr; |
76 | int uartaddr; | 76 | int uartaddr; |
77 | int pagenr; | 77 | unsigned int pagenr; |
78 | long istate; | 78 | long istate; |
79 | int flags; | 79 | int flags; |
80 | int baud_base; | 80 | int baud_base; |
@@ -97,31 +97,31 @@ typedef struct stlport { | |||
97 | wait_queue_head_t close_wait; | 97 | wait_queue_head_t close_wait; |
98 | struct work_struct tqueue; | 98 | struct work_struct tqueue; |
99 | comstats_t stats; | 99 | comstats_t stats; |
100 | stlrq_t tx; | 100 | struct stlrq tx; |
101 | } stlport_t; | 101 | }; |
102 | 102 | ||
103 | typedef struct stlpanel { | 103 | struct stlpanel { |
104 | unsigned long magic; | 104 | unsigned long magic; |
105 | int panelnr; | 105 | unsigned int panelnr; |
106 | int brdnr; | 106 | unsigned int brdnr; |
107 | int pagenr; | 107 | unsigned int pagenr; |
108 | int nrports; | 108 | unsigned int nrports; |
109 | int iobase; | 109 | int iobase; |
110 | void *uartp; | 110 | void *uartp; |
111 | void (*isr)(struct stlpanel *panelp, unsigned int iobase); | 111 | void (*isr)(struct stlpanel *panelp, unsigned int iobase); |
112 | unsigned int hwid; | 112 | unsigned int hwid; |
113 | unsigned int ackmask; | 113 | unsigned int ackmask; |
114 | stlport_t *ports[STL_PORTSPERPANEL]; | 114 | struct stlport *ports[STL_PORTSPERPANEL]; |
115 | } stlpanel_t; | 115 | }; |
116 | 116 | ||
117 | typedef struct stlbrd { | 117 | struct stlbrd { |
118 | unsigned long magic; | 118 | unsigned long magic; |
119 | int brdnr; | 119 | unsigned int brdnr; |
120 | int brdtype; | 120 | unsigned int brdtype; |
121 | int state; | 121 | unsigned int state; |
122 | int nrpanels; | 122 | unsigned int nrpanels; |
123 | int nrports; | 123 | unsigned int nrports; |
124 | int nrbnks; | 124 | unsigned int nrbnks; |
125 | int irq; | 125 | int irq; |
126 | int irqtype; | 126 | int irqtype; |
127 | int (*isr)(struct stlbrd *brdp); | 127 | int (*isr)(struct stlbrd *brdp); |
@@ -136,9 +136,9 @@ typedef struct stlbrd { | |||
136 | unsigned long clk; | 136 | unsigned long clk; |
137 | unsigned int bnkpageaddr[STL_MAXBANKS]; | 137 | unsigned int bnkpageaddr[STL_MAXBANKS]; |
138 | unsigned int bnkstataddr[STL_MAXBANKS]; | 138 | unsigned int bnkstataddr[STL_MAXBANKS]; |
139 | stlpanel_t *bnk2panel[STL_MAXBANKS]; | 139 | struct stlpanel *bnk2panel[STL_MAXBANKS]; |
140 | stlpanel_t *panels[STL_MAXPANELS]; | 140 | struct stlpanel *panels[STL_MAXPANELS]; |
141 | } stlbrd_t; | 141 | }; |
142 | 142 | ||
143 | 143 | ||
144 | /* | 144 | /* |
diff --git a/include/linux/sysctl.h b/include/linux/sysctl.h index 94316a98e0d0..6d8846e7be6d 100644 --- a/include/linux/sysctl.h +++ b/include/linux/sysctl.h | |||
@@ -918,8 +918,7 @@ typedef struct ctl_table ctl_table; | |||
918 | 918 | ||
919 | typedef int ctl_handler (ctl_table *table, int __user *name, int nlen, | 919 | typedef int ctl_handler (ctl_table *table, int __user *name, int nlen, |
920 | void __user *oldval, size_t __user *oldlenp, | 920 | void __user *oldval, size_t __user *oldlenp, |
921 | void __user *newval, size_t newlen, | 921 | void __user *newval, size_t newlen); |
922 | void **context); | ||
923 | 922 | ||
924 | typedef int proc_handler (ctl_table *ctl, int write, struct file * filp, | 923 | typedef int proc_handler (ctl_table *ctl, int write, struct file * filp, |
925 | void __user *buffer, size_t *lenp, loff_t *ppos); | 924 | void __user *buffer, size_t *lenp, loff_t *ppos); |
@@ -950,7 +949,7 @@ extern int do_sysctl (int __user *name, int nlen, | |||
950 | extern int do_sysctl_strategy (ctl_table *table, | 949 | extern int do_sysctl_strategy (ctl_table *table, |
951 | int __user *name, int nlen, | 950 | int __user *name, int nlen, |
952 | void __user *oldval, size_t __user *oldlenp, | 951 | void __user *oldval, size_t __user *oldlenp, |
953 | void __user *newval, size_t newlen, void ** context); | 952 | void __user *newval, size_t newlen); |
954 | 953 | ||
955 | extern ctl_handler sysctl_string; | 954 | extern ctl_handler sysctl_string; |
956 | extern ctl_handler sysctl_intvec; | 955 | extern ctl_handler sysctl_intvec; |
diff --git a/include/linux/task_io_accounting.h b/include/linux/task_io_accounting.h new file mode 100644 index 000000000000..44d00e9cceea --- /dev/null +++ b/include/linux/task_io_accounting.h | |||
@@ -0,0 +1,37 @@ | |||
1 | /* | ||
2 | * task_io_accounting: a structure which is used for recording a single task's | ||
3 | * IO statistics. | ||
4 | * | ||
5 | * Don't include this header file directly - it is designed to be dragged in via | ||
6 | * sched.h. | ||
7 | * | ||
8 | * Blame akpm@osdl.org for all this. | ||
9 | */ | ||
10 | |||
11 | #ifdef CONFIG_TASK_IO_ACCOUNTING | ||
12 | struct task_io_accounting { | ||
13 | /* | ||
14 | * The number of bytes which this task has caused to be read from | ||
15 | * storage. | ||
16 | */ | ||
17 | u64 read_bytes; | ||
18 | |||
19 | /* | ||
20 | * The number of bytes which this task has caused, or shall cause to be | ||
21 | * written to disk. | ||
22 | */ | ||
23 | u64 write_bytes; | ||
24 | |||
25 | /* | ||
26 | * A task can cause "negative" IO too. If this task truncates some | ||
27 | * dirty pagecache, some IO which another task has been accounted for | ||
28 | * (in its write_bytes) will not be happening. We _could_ just | ||
29 | * subtract that from the truncating task's write_bytes, but there is | ||
30 | * information loss in doing that. | ||
31 | */ | ||
32 | u64 cancelled_write_bytes; | ||
33 | }; | ||
34 | #else | ||
35 | struct task_io_accounting { | ||
36 | }; | ||
37 | #endif | ||
diff --git a/include/linux/task_io_accounting_ops.h b/include/linux/task_io_accounting_ops.h new file mode 100644 index 000000000000..df2a319106b2 --- /dev/null +++ b/include/linux/task_io_accounting_ops.h | |||
@@ -0,0 +1,47 @@ | |||
1 | /* | ||
2 | * Task I/O accounting operations | ||
3 | */ | ||
4 | #ifndef __TASK_IO_ACCOUNTING_OPS_INCLUDED | ||
5 | #define __TASK_IO_ACCOUNTING_OPS_INCLUDED | ||
6 | |||
7 | #ifdef CONFIG_TASK_IO_ACCOUNTING | ||
8 | static inline void task_io_account_read(size_t bytes) | ||
9 | { | ||
10 | current->ioac.read_bytes += bytes; | ||
11 | } | ||
12 | |||
13 | static inline void task_io_account_write(size_t bytes) | ||
14 | { | ||
15 | current->ioac.write_bytes += bytes; | ||
16 | } | ||
17 | |||
18 | static inline void task_io_account_cancelled_write(size_t bytes) | ||
19 | { | ||
20 | current->ioac.cancelled_write_bytes += bytes; | ||
21 | } | ||
22 | |||
23 | static inline void task_io_accounting_init(struct task_struct *tsk) | ||
24 | { | ||
25 | memset(&tsk->ioac, 0, sizeof(tsk->ioac)); | ||
26 | } | ||
27 | |||
28 | #else | ||
29 | |||
30 | static inline void task_io_account_read(size_t bytes) | ||
31 | { | ||
32 | } | ||
33 | |||
34 | static inline void task_io_account_write(size_t bytes) | ||
35 | { | ||
36 | } | ||
37 | |||
38 | static inline void task_io_account_cancelled_write(size_t bytes) | ||
39 | { | ||
40 | } | ||
41 | |||
42 | static inline void task_io_accounting_init(struct task_struct *tsk) | ||
43 | { | ||
44 | } | ||
45 | |||
46 | #endif /* CONFIG_TASK_IO_ACCOUNTING */ | ||
47 | #endif /* __TASK_IO_ACCOUNTING_OPS_INCLUDED */ | ||
diff --git a/include/linux/taskstats.h b/include/linux/taskstats.h index 45248806ae9c..3fced4798255 100644 --- a/include/linux/taskstats.h +++ b/include/linux/taskstats.h | |||
@@ -31,7 +31,7 @@ | |||
31 | */ | 31 | */ |
32 | 32 | ||
33 | 33 | ||
34 | #define TASKSTATS_VERSION 2 | 34 | #define TASKSTATS_VERSION 3 |
35 | #define TS_COMM_LEN 32 /* should be >= TASK_COMM_LEN | 35 | #define TS_COMM_LEN 32 /* should be >= TASK_COMM_LEN |
36 | * in linux/sched.h */ | 36 | * in linux/sched.h */ |
37 | 37 | ||
@@ -115,31 +115,37 @@ struct taskstats { | |||
115 | __u64 ac_majflt; /* Major Page Fault Count */ | 115 | __u64 ac_majflt; /* Major Page Fault Count */ |
116 | /* Basic Accounting Fields end */ | 116 | /* Basic Accounting Fields end */ |
117 | 117 | ||
118 | /* Extended accounting fields start */ | 118 | /* Extended accounting fields start */ |
119 | /* Accumulated RSS usage in duration of a task, in MBytes-usecs. | 119 | /* Accumulated RSS usage in duration of a task, in MBytes-usecs. |
120 | * The current rss usage is added to this counter every time | 120 | * The current rss usage is added to this counter every time |
121 | * a tick is charged to a task's system time. So, at the end we | 121 | * a tick is charged to a task's system time. So, at the end we |
122 | * will have memory usage multiplied by system time. Thus an | 122 | * will have memory usage multiplied by system time. Thus an |
123 | * average usage per system time unit can be calculated. | 123 | * average usage per system time unit can be calculated. |
124 | */ | 124 | */ |
125 | __u64 coremem; /* accumulated RSS usage in MB-usec */ | 125 | __u64 coremem; /* accumulated RSS usage in MB-usec */ |
126 | /* Accumulated virtual memory usage in duration of a task. | 126 | /* Accumulated virtual memory usage in duration of a task. |
127 | * Same as acct_rss_mem1 above except that we keep track of VM usage. | 127 | * Same as acct_rss_mem1 above except that we keep track of VM usage. |
128 | */ | 128 | */ |
129 | __u64 virtmem; /* accumulated VM usage in MB-usec */ | 129 | __u64 virtmem; /* accumulated VM usage in MB-usec */ |
130 | 130 | ||
131 | /* High watermark of RSS and virtual memory usage in duration of | 131 | /* High watermark of RSS and virtual memory usage in duration of |
132 | * a task, in KBytes. | 132 | * a task, in KBytes. |
133 | */ | 133 | */ |
134 | __u64 hiwater_rss; /* High-watermark of RSS usage, in KB */ | 134 | __u64 hiwater_rss; /* High-watermark of RSS usage, in KB */ |
135 | __u64 hiwater_vm; /* High-water VM usage, in KB */ | 135 | __u64 hiwater_vm; /* High-water VM usage, in KB */ |
136 | 136 | ||
137 | /* The following four fields are I/O statistics of a task. */ | 137 | /* The following four fields are I/O statistics of a task. */ |
138 | __u64 read_char; /* bytes read */ | 138 | __u64 read_char; /* bytes read */ |
139 | __u64 write_char; /* bytes written */ | 139 | __u64 write_char; /* bytes written */ |
140 | __u64 read_syscalls; /* read syscalls */ | 140 | __u64 read_syscalls; /* read syscalls */ |
141 | __u64 write_syscalls; /* write syscalls */ | 141 | __u64 write_syscalls; /* write syscalls */ |
142 | /* Extended accounting fields end */ | 142 | /* Extended accounting fields end */ |
143 | |||
144 | #define TASKSTATS_HAS_IO_ACCOUNTING | ||
145 | /* Per-task storage I/O accounting starts */ | ||
146 | __u64 read_bytes; /* bytes of read I/O */ | ||
147 | __u64 write_bytes; /* bytes of write I/O */ | ||
148 | __u64 cancelled_write_bytes; /* bytes of cancelled write I/O */ | ||
143 | }; | 149 | }; |
144 | 150 | ||
145 | 151 | ||
diff --git a/include/linux/tfrc.h b/include/linux/tfrc.h index 31a9b25276fe..8a8462b4a4dd 100644 --- a/include/linux/tfrc.h +++ b/include/linux/tfrc.h | |||
@@ -37,10 +37,14 @@ struct tfrc_rx_info { | |||
37 | * @tfrctx_p: current loss event rate (5.4) | 37 | * @tfrctx_p: current loss event rate (5.4) |
38 | * @tfrctx_rto: estimate of RTO, equals 4*RTT (4.3) | 38 | * @tfrctx_rto: estimate of RTO, equals 4*RTT (4.3) |
39 | * @tfrctx_ipi: inter-packet interval (4.6) | 39 | * @tfrctx_ipi: inter-packet interval (4.6) |
40 | * | ||
41 | * Note: X and X_recv are both maintained in units of 64 * bytes/second. This | ||
42 | * enables a finer resolution of sending rates and avoids problems with | ||
43 | * integer arithmetic; u32 is not sufficient as scaling consumes 6 bits. | ||
40 | */ | 44 | */ |
41 | struct tfrc_tx_info { | 45 | struct tfrc_tx_info { |
42 | __u32 tfrctx_x; | 46 | __u64 tfrctx_x; |
43 | __u32 tfrctx_x_recv; | 47 | __u64 tfrctx_x_recv; |
44 | __u32 tfrctx_x_calc; | 48 | __u32 tfrctx_x_calc; |
45 | __u32 tfrctx_rtt; | 49 | __u32 tfrctx_rtt; |
46 | __u32 tfrctx_p; | 50 | __u32 tfrctx_p; |
diff --git a/include/linux/timer.h b/include/linux/timer.h index c982304dbafd..eeef6643d4c6 100644 --- a/include/linux/timer.h +++ b/include/linux/timer.h | |||
@@ -98,4 +98,10 @@ extern void run_local_timers(void); | |||
98 | struct hrtimer; | 98 | struct hrtimer; |
99 | extern int it_real_fn(struct hrtimer *); | 99 | extern int it_real_fn(struct hrtimer *); |
100 | 100 | ||
101 | unsigned long __round_jiffies(unsigned long j, int cpu); | ||
102 | unsigned long __round_jiffies_relative(unsigned long j, int cpu); | ||
103 | unsigned long round_jiffies(unsigned long j); | ||
104 | unsigned long round_jiffies_relative(unsigned long j); | ||
105 | |||
106 | |||
101 | #endif | 107 | #endif |
diff --git a/include/linux/topology.h b/include/linux/topology.h index da508d1998e4..6c5a6e6e813b 100644 --- a/include/linux/topology.h +++ b/include/linux/topology.h | |||
@@ -93,7 +93,7 @@ | |||
93 | .groups = NULL, \ | 93 | .groups = NULL, \ |
94 | .min_interval = 1, \ | 94 | .min_interval = 1, \ |
95 | .max_interval = 2, \ | 95 | .max_interval = 2, \ |
96 | .busy_factor = 8, \ | 96 | .busy_factor = 64, \ |
97 | .imbalance_pct = 110, \ | 97 | .imbalance_pct = 110, \ |
98 | .cache_nice_tries = 0, \ | 98 | .cache_nice_tries = 0, \ |
99 | .per_cpu_gain = 25, \ | 99 | .per_cpu_gain = 25, \ |
@@ -194,7 +194,8 @@ | |||
194 | .wake_idx = 0, /* unused */ \ | 194 | .wake_idx = 0, /* unused */ \ |
195 | .forkexec_idx = 0, /* unused */ \ | 195 | .forkexec_idx = 0, /* unused */ \ |
196 | .per_cpu_gain = 100, \ | 196 | .per_cpu_gain = 100, \ |
197 | .flags = SD_LOAD_BALANCE, \ | 197 | .flags = SD_LOAD_BALANCE \ |
198 | | SD_SERIALIZE, \ | ||
198 | .last_balance = jiffies, \ | 199 | .last_balance = jiffies, \ |
199 | .balance_interval = 64, \ | 200 | .balance_interval = 64, \ |
200 | .nr_balance_failed = 0, \ | 201 | .nr_balance_failed = 0, \ |
diff --git a/include/linux/tty.h b/include/linux/tty.h index f717f0898238..65cbcf22c31e 100644 --- a/include/linux/tty.h +++ b/include/linux/tty.h | |||
@@ -175,7 +175,7 @@ struct tty_struct { | |||
175 | int index; | 175 | int index; |
176 | struct tty_ldisc ldisc; | 176 | struct tty_ldisc ldisc; |
177 | struct mutex termios_mutex; | 177 | struct mutex termios_mutex; |
178 | struct termios *termios, *termios_locked; | 178 | struct ktermios *termios, *termios_locked; |
179 | char name[64]; | 179 | char name[64]; |
180 | int pgrp; | 180 | int pgrp; |
181 | int session; | 181 | int session; |
@@ -258,7 +258,7 @@ struct tty_struct { | |||
258 | 258 | ||
259 | extern void tty_write_flush(struct tty_struct *); | 259 | extern void tty_write_flush(struct tty_struct *); |
260 | 260 | ||
261 | extern struct termios tty_std_termios; | 261 | extern struct ktermios tty_std_termios; |
262 | 262 | ||
263 | extern int kmsg_redirect; | 263 | extern int kmsg_redirect; |
264 | 264 | ||
@@ -293,8 +293,9 @@ extern int tty_hung_up_p(struct file * filp); | |||
293 | extern void do_SAK(struct tty_struct *tty); | 293 | extern void do_SAK(struct tty_struct *tty); |
294 | extern void disassociate_ctty(int priv); | 294 | extern void disassociate_ctty(int priv); |
295 | extern void tty_flip_buffer_push(struct tty_struct *tty); | 295 | extern void tty_flip_buffer_push(struct tty_struct *tty); |
296 | extern int tty_get_baud_rate(struct tty_struct *tty); | 296 | extern speed_t tty_get_baud_rate(struct tty_struct *tty); |
297 | extern int tty_termios_baud_rate(struct termios *termios); | 297 | extern speed_t tty_termios_baud_rate(struct ktermios *termios); |
298 | extern speed_t tty_termios_input_baud_rate(struct ktermios *termios); | ||
298 | 299 | ||
299 | extern struct tty_ldisc *tty_ldisc_ref(struct tty_struct *); | 300 | extern struct tty_ldisc *tty_ldisc_ref(struct tty_struct *); |
300 | extern void tty_ldisc_deref(struct tty_ldisc *); | 301 | extern void tty_ldisc_deref(struct tty_ldisc *); |
@@ -309,6 +310,12 @@ extern void tty_ldisc_flush(struct tty_struct *tty); | |||
309 | extern int tty_ioctl(struct inode *inode, struct file *file, unsigned int cmd, | 310 | extern int tty_ioctl(struct inode *inode, struct file *file, unsigned int cmd, |
310 | unsigned long arg); | 311 | unsigned long arg); |
311 | 312 | ||
313 | extern dev_t tty_devnum(struct tty_struct *tty); | ||
314 | extern void proc_clear_tty(struct task_struct *p); | ||
315 | extern void __proc_set_tty(struct task_struct *tsk, struct tty_struct *tty); | ||
316 | extern void proc_set_tty(struct task_struct *tsk, struct tty_struct *tty); | ||
317 | extern struct tty_struct *get_current_tty(void); | ||
318 | |||
312 | extern struct mutex tty_mutex; | 319 | extern struct mutex tty_mutex; |
313 | 320 | ||
314 | /* n_tty.c */ | 321 | /* n_tty.c */ |
@@ -335,10 +342,5 @@ extern void console_print(const char *); | |||
335 | extern int vt_ioctl(struct tty_struct *tty, struct file * file, | 342 | extern int vt_ioctl(struct tty_struct *tty, struct file * file, |
336 | unsigned int cmd, unsigned long arg); | 343 | unsigned int cmd, unsigned long arg); |
337 | 344 | ||
338 | static inline dev_t tty_devnum(struct tty_struct *tty) | ||
339 | { | ||
340 | return MKDEV(tty->driver->major, tty->driver->minor_start) + tty->index; | ||
341 | } | ||
342 | |||
343 | #endif /* __KERNEL__ */ | 345 | #endif /* __KERNEL__ */ |
344 | #endif | 346 | #endif |
diff --git a/include/linux/tty_driver.h b/include/linux/tty_driver.h index 5c8473bb6882..659487e3ebeb 100644 --- a/include/linux/tty_driver.h +++ b/include/linux/tty_driver.h | |||
@@ -53,7 +53,7 @@ | |||
53 | * device-specific ioctl's. If the ioctl number passed in cmd | 53 | * device-specific ioctl's. If the ioctl number passed in cmd |
54 | * is not recognized by the driver, it should return ENOIOCTLCMD. | 54 | * is not recognized by the driver, it should return ENOIOCTLCMD. |
55 | * | 55 | * |
56 | * void (*set_termios)(struct tty_struct *tty, struct termios * old); | 56 | * void (*set_termios)(struct tty_struct *tty, struct ktermios * old); |
57 | * | 57 | * |
58 | * This routine allows the tty driver to be notified when | 58 | * This routine allows the tty driver to be notified when |
59 | * device's termios settings have changed. Note that a | 59 | * device's termios settings have changed. Note that a |
@@ -132,7 +132,7 @@ struct tty_operations { | |||
132 | int (*chars_in_buffer)(struct tty_struct *tty); | 132 | int (*chars_in_buffer)(struct tty_struct *tty); |
133 | int (*ioctl)(struct tty_struct *tty, struct file * file, | 133 | int (*ioctl)(struct tty_struct *tty, struct file * file, |
134 | unsigned int cmd, unsigned long arg); | 134 | unsigned int cmd, unsigned long arg); |
135 | void (*set_termios)(struct tty_struct *tty, struct termios * old); | 135 | void (*set_termios)(struct tty_struct *tty, struct ktermios * old); |
136 | void (*throttle)(struct tty_struct * tty); | 136 | void (*throttle)(struct tty_struct * tty); |
137 | void (*unthrottle)(struct tty_struct * tty); | 137 | void (*unthrottle)(struct tty_struct * tty); |
138 | void (*stop)(struct tty_struct *tty); | 138 | void (*stop)(struct tty_struct *tty); |
@@ -165,7 +165,7 @@ struct tty_driver { | |||
165 | int num; /* number of devices allocated */ | 165 | int num; /* number of devices allocated */ |
166 | short type; /* type of tty driver */ | 166 | short type; /* type of tty driver */ |
167 | short subtype; /* subtype of tty driver */ | 167 | short subtype; /* subtype of tty driver */ |
168 | struct termios init_termios; /* Initial termios */ | 168 | struct ktermios init_termios; /* Initial termios */ |
169 | int flags; /* tty driver flags */ | 169 | int flags; /* tty driver flags */ |
170 | int refcount; /* for loadable tty drivers */ | 170 | int refcount; /* for loadable tty drivers */ |
171 | struct proc_dir_entry *proc_entry; /* /proc fs entry */ | 171 | struct proc_dir_entry *proc_entry; /* /proc fs entry */ |
@@ -175,8 +175,8 @@ struct tty_driver { | |||
175 | * Pointer to the tty data structures | 175 | * Pointer to the tty data structures |
176 | */ | 176 | */ |
177 | struct tty_struct **ttys; | 177 | struct tty_struct **ttys; |
178 | struct termios **termios; | 178 | struct ktermios **termios; |
179 | struct termios **termios_locked; | 179 | struct ktermios **termios_locked; |
180 | void *driver_state; /* only used for the PTY driver */ | 180 | void *driver_state; /* only used for the PTY driver */ |
181 | 181 | ||
182 | /* | 182 | /* |
@@ -193,7 +193,7 @@ struct tty_driver { | |||
193 | int (*chars_in_buffer)(struct tty_struct *tty); | 193 | int (*chars_in_buffer)(struct tty_struct *tty); |
194 | int (*ioctl)(struct tty_struct *tty, struct file * file, | 194 | int (*ioctl)(struct tty_struct *tty, struct file * file, |
195 | unsigned int cmd, unsigned long arg); | 195 | unsigned int cmd, unsigned long arg); |
196 | void (*set_termios)(struct tty_struct *tty, struct termios * old); | 196 | void (*set_termios)(struct tty_struct *tty, struct ktermios * old); |
197 | void (*throttle)(struct tty_struct * tty); | 197 | void (*throttle)(struct tty_struct * tty); |
198 | void (*unthrottle)(struct tty_struct * tty); | 198 | void (*unthrottle)(struct tty_struct * tty); |
199 | void (*stop)(struct tty_struct *tty); | 199 | void (*stop)(struct tty_struct *tty); |
diff --git a/include/linux/tty_ldisc.h b/include/linux/tty_ldisc.h index 83c6e6c10ebb..d75932e27710 100644 --- a/include/linux/tty_ldisc.h +++ b/include/linux/tty_ldisc.h | |||
@@ -59,7 +59,7 @@ | |||
59 | * low-level driver can "grab" an ioctl request before the line | 59 | * low-level driver can "grab" an ioctl request before the line |
60 | * discpline has a chance to see it. | 60 | * discpline has a chance to see it. |
61 | * | 61 | * |
62 | * void (*set_termios)(struct tty_struct *tty, struct termios * old); | 62 | * void (*set_termios)(struct tty_struct *tty, struct ktermios * old); |
63 | * | 63 | * |
64 | * This function notifies the line discpline that a change has | 64 | * This function notifies the line discpline that a change has |
65 | * been made to the termios structure. | 65 | * been made to the termios structure. |
@@ -118,7 +118,7 @@ struct tty_ldisc { | |||
118 | const unsigned char * buf, size_t nr); | 118 | const unsigned char * buf, size_t nr); |
119 | int (*ioctl)(struct tty_struct * tty, struct file * file, | 119 | int (*ioctl)(struct tty_struct * tty, struct file * file, |
120 | unsigned int cmd, unsigned long arg); | 120 | unsigned int cmd, unsigned long arg); |
121 | void (*set_termios)(struct tty_struct *tty, struct termios * old); | 121 | void (*set_termios)(struct tty_struct *tty, struct ktermios * old); |
122 | unsigned int (*poll)(struct tty_struct *, struct file *, | 122 | unsigned int (*poll)(struct tty_struct *, struct file *, |
123 | struct poll_table_struct *); | 123 | struct poll_table_struct *); |
124 | int (*hangup)(struct tty_struct *tty); | 124 | int (*hangup)(struct tty_struct *tty); |
diff --git a/include/linux/usb/serial.h b/include/linux/usb/serial.h index 91b3ea2bbb14..10f99e5f1a97 100644 --- a/include/linux/usb/serial.h +++ b/include/linux/usb/serial.h | |||
@@ -218,7 +218,7 @@ struct usb_serial_driver { | |||
218 | int (*write) (struct usb_serial_port *port, const unsigned char *buf, int count); | 218 | int (*write) (struct usb_serial_port *port, const unsigned char *buf, int count); |
219 | int (*write_room) (struct usb_serial_port *port); | 219 | int (*write_room) (struct usb_serial_port *port); |
220 | int (*ioctl) (struct usb_serial_port *port, struct file * file, unsigned int cmd, unsigned long arg); | 220 | int (*ioctl) (struct usb_serial_port *port, struct file * file, unsigned int cmd, unsigned long arg); |
221 | void (*set_termios) (struct usb_serial_port *port, struct termios * old); | 221 | void (*set_termios) (struct usb_serial_port *port, struct ktermios * old); |
222 | void (*break_ctl) (struct usb_serial_port *port, int break_state); | 222 | void (*break_ctl) (struct usb_serial_port *port, int break_state); |
223 | int (*chars_in_buffer) (struct usb_serial_port *port); | 223 | int (*chars_in_buffer) (struct usb_serial_port *port); |
224 | void (*throttle) (struct usb_serial_port *port); | 224 | void (*throttle) (struct usb_serial_port *port); |
diff --git a/include/linux/videodev2.h b/include/linux/videodev2.h index df5c4654360d..5cb380a559fd 100644 --- a/include/linux/videodev2.h +++ b/include/linux/videodev2.h | |||
@@ -244,6 +244,7 @@ struct v4l2_pix_format | |||
244 | #define V4L2_PIX_FMT_YYUV v4l2_fourcc('Y','Y','U','V') /* 16 YUV 4:2:2 */ | 244 | #define V4L2_PIX_FMT_YYUV v4l2_fourcc('Y','Y','U','V') /* 16 YUV 4:2:2 */ |
245 | #define V4L2_PIX_FMT_HI240 v4l2_fourcc('H','I','2','4') /* 8 8-bit color */ | 245 | #define V4L2_PIX_FMT_HI240 v4l2_fourcc('H','I','2','4') /* 8 8-bit color */ |
246 | #define V4L2_PIX_FMT_HM12 v4l2_fourcc('H','M','1','2') /* 8 YUV 4:2:0 16x16 macroblocks */ | 246 | #define V4L2_PIX_FMT_HM12 v4l2_fourcc('H','M','1','2') /* 8 YUV 4:2:0 16x16 macroblocks */ |
247 | #define V4L2_PIX_FMT_RGB444 v4l2_fourcc('R','4','4','4') /* 16 xxxxrrrr ggggbbbb */ | ||
247 | 248 | ||
248 | /* see http://www.siliconimaging.com/RGB%20Bayer.htm */ | 249 | /* see http://www.siliconimaging.com/RGB%20Bayer.htm */ |
249 | #define V4L2_PIX_FMT_SBGGR8 v4l2_fourcc('B','A','8','1') /* 8 BGBG.. GRGR.. */ | 250 | #define V4L2_PIX_FMT_SBGGR8 v4l2_fourcc('B','A','8','1') /* 8 BGBG.. GRGR.. */ |
diff --git a/include/linux/xfrm.h b/include/linux/xfrm.h index 088ba8113f7e..9529ea1ae392 100644 --- a/include/linux/xfrm.h +++ b/include/linux/xfrm.h | |||
@@ -357,7 +357,7 @@ struct xfrm_user_report { | |||
357 | #define XFRMGRP_EXPIRE 2 | 357 | #define XFRMGRP_EXPIRE 2 |
358 | #define XFRMGRP_SA 4 | 358 | #define XFRMGRP_SA 4 |
359 | #define XFRMGRP_POLICY 8 | 359 | #define XFRMGRP_POLICY 8 |
360 | #define XFRMGRP_REPORT 0x10 | 360 | #define XFRMGRP_REPORT 0x20 |
361 | #endif | 361 | #endif |
362 | 362 | ||
363 | enum xfrm_nlgroups { | 363 | enum xfrm_nlgroups { |
diff --git a/include/media/ir-common.h b/include/media/ir-common.h index 8f58406533c6..2b25f5c95006 100644 --- a/include/media/ir-common.h +++ b/include/media/ir-common.h | |||
@@ -92,6 +92,7 @@ extern IR_KEYTAB_TYPE ir_codes_hauppauge_new[IR_KEYTAB_SIZE]; | |||
92 | extern IR_KEYTAB_TYPE ir_codes_npgtech[IR_KEYTAB_SIZE]; | 92 | extern IR_KEYTAB_TYPE ir_codes_npgtech[IR_KEYTAB_SIZE]; |
93 | extern IR_KEYTAB_TYPE ir_codes_norwood[IR_KEYTAB_SIZE]; | 93 | extern IR_KEYTAB_TYPE ir_codes_norwood[IR_KEYTAB_SIZE]; |
94 | extern IR_KEYTAB_TYPE ir_codes_proteus_2309[IR_KEYTAB_SIZE]; | 94 | extern IR_KEYTAB_TYPE ir_codes_proteus_2309[IR_KEYTAB_SIZE]; |
95 | extern IR_KEYTAB_TYPE ir_codes_budget_ci_old[IR_KEYTAB_SIZE]; | ||
95 | 96 | ||
96 | #endif | 97 | #endif |
97 | 98 | ||
diff --git a/include/media/saa7146.h b/include/media/saa7146.h index fee579f10b32..796bcf151a3a 100644 --- a/include/media/saa7146.h +++ b/include/media/saa7146.h | |||
@@ -42,10 +42,6 @@ extern unsigned int saa7146_debug; | |||
42 | #define DEB_INT(x) if (0!=(DEBUG_VARIABLE&0x20)) { DEBUG_PROLOG; printk x; } /* interrupt debug messages */ | 42 | #define DEB_INT(x) if (0!=(DEBUG_VARIABLE&0x20)) { DEBUG_PROLOG; printk x; } /* interrupt debug messages */ |
43 | #define DEB_CAP(x) if (0!=(DEBUG_VARIABLE&0x40)) { DEBUG_PROLOG; printk x; } /* capture debug messages */ | 43 | #define DEB_CAP(x) if (0!=(DEBUG_VARIABLE&0x40)) { DEBUG_PROLOG; printk x; } /* capture debug messages */ |
44 | 44 | ||
45 | #define SAA7146_IER_DISABLE(x,y) \ | ||
46 | saa7146_write(x, IER, saa7146_read(x, IER) & ~(y)); | ||
47 | #define SAA7146_IER_ENABLE(x,y) \ | ||
48 | saa7146_write(x, IER, saa7146_read(x, IER) | (y)); | ||
49 | #define SAA7146_ISR_CLEAR(x,y) \ | 45 | #define SAA7146_ISR_CLEAR(x,y) \ |
50 | saa7146_write(x, ISR, (y)); | 46 | saa7146_write(x, ISR, (y)); |
51 | 47 | ||
@@ -441,4 +437,20 @@ int saa7146_wait_for_debi_done(struct saa7146_dev *dev, int nobusyloop); | |||
441 | #define SAA7146_I2C_BUS_BIT_RATE_80 (0x200) | 437 | #define SAA7146_I2C_BUS_BIT_RATE_80 (0x200) |
442 | #define SAA7146_I2C_BUS_BIT_RATE_60 (0x300) | 438 | #define SAA7146_I2C_BUS_BIT_RATE_60 (0x300) |
443 | 439 | ||
440 | static inline void SAA7146_IER_DISABLE(struct saa7146_dev *x, unsigned y) | ||
441 | { | ||
442 | unsigned long flags; | ||
443 | spin_lock_irqsave(&x->int_slock, flags); | ||
444 | saa7146_write(x, IER, saa7146_read(x, IER) & ~y); | ||
445 | spin_unlock_irqrestore(&x->int_slock, flags); | ||
446 | } | ||
447 | |||
448 | static inline void SAA7146_IER_ENABLE(struct saa7146_dev *x, unsigned y) | ||
449 | { | ||
450 | unsigned long flags; | ||
451 | spin_lock_irqsave(&x->int_slock, flags); | ||
452 | saa7146_write(x, IER, saa7146_read(x, IER) | y); | ||
453 | spin_unlock_irqrestore(&x->int_slock, flags); | ||
454 | } | ||
455 | |||
444 | #endif | 456 | #endif |
diff --git a/include/media/tuner-types.h b/include/media/tuner-types.h index 37dad07a8439..e5ad3fcfe984 100644 --- a/include/media/tuner-types.h +++ b/include/media/tuner-types.h | |||
@@ -50,6 +50,10 @@ struct tuner_params { | |||
50 | sensitivity. If this setting is 1, then set PORT2 to 1 to | 50 | sensitivity. If this setting is 1, then set PORT2 to 1 to |
51 | get proper FM reception. */ | 51 | get proper FM reception. */ |
52 | unsigned int port2_fm_high_sensitivity:1; | 52 | unsigned int port2_fm_high_sensitivity:1; |
53 | /* Some Philips tuners use tda9887 cGainNormal to select the FM radio | ||
54 | sensitivity. If this setting is 1, e register will use cGainNormal | ||
55 | instead of cGainLow. */ | ||
56 | unsigned int fm_gain_normal:1; | ||
53 | /* Most tuners with a tda9887 use QSS mode. Some (cheaper) tuners | 57 | /* Most tuners with a tda9887 use QSS mode. Some (cheaper) tuners |
54 | use Intercarrier mode. If this setting is 1, then the tuner | 58 | use Intercarrier mode. If this setting is 1, then the tuner |
55 | needs to be set to intercarrier mode. */ | 59 | needs to be set to intercarrier mode. */ |
diff --git a/include/media/tuner.h b/include/media/tuner.h index 3116e750132f..99acf847365c 100644 --- a/include/media/tuner.h +++ b/include/media/tuner.h | |||
@@ -145,6 +145,7 @@ extern int tuner_debug; | |||
145 | #define TDA9887_DEEMPHASIS_75 (3<<16) | 145 | #define TDA9887_DEEMPHASIS_75 (3<<16) |
146 | #define TDA9887_AUTOMUTE (1<<18) | 146 | #define TDA9887_AUTOMUTE (1<<18) |
147 | #define TDA9887_GATING_18 (1<<19) | 147 | #define TDA9887_GATING_18 (1<<19) |
148 | #define TDA9887_GAIN_NORMAL (1<<20) | ||
148 | 149 | ||
149 | #ifdef __KERNEL__ | 150 | #ifdef __KERNEL__ |
150 | 151 | ||
diff --git a/include/media/tveeprom.h b/include/media/tveeprom.h index e9fc1a785497..5660ea24996b 100644 --- a/include/media/tveeprom.h +++ b/include/media/tveeprom.h | |||
@@ -3,7 +3,7 @@ | |||
3 | 3 | ||
4 | struct tveeprom { | 4 | struct tveeprom { |
5 | u32 has_radio; | 5 | u32 has_radio; |
6 | u32 has_ir; /* 0: no IR, 1: IR present, 2: unknown */ | 6 | u32 has_ir; /* bit 0: IR receiver present, bit 1: IR transmitter (blaster) present. -1 == unknown */ |
7 | u32 has_MAC_address; /* 0: no MAC, 1: MAC present, 2: unknown */ | 7 | u32 has_MAC_address; /* 0: no MAC, 1: MAC present, 2: unknown */ |
8 | 8 | ||
9 | u32 tuner_type; | 9 | u32 tuner_type; |
diff --git a/include/media/v4l2-common.h b/include/media/v4l2-common.h index aecc946980a3..91b19921f958 100644 --- a/include/media/v4l2-common.h +++ b/include/media/v4l2-common.h | |||
@@ -144,6 +144,9 @@ enum v4l2_chip_ident { | |||
144 | V4L2_IDENT_CX25841 = 241, | 144 | V4L2_IDENT_CX25841 = 241, |
145 | V4L2_IDENT_CX25842 = 242, | 145 | V4L2_IDENT_CX25842 = 242, |
146 | V4L2_IDENT_CX25843 = 243, | 146 | V4L2_IDENT_CX25843 = 243, |
147 | |||
148 | /* OmniVision sensors - range 250-299 */ | ||
149 | V4L2_IDENT_OV7670 = 250, | ||
147 | }; | 150 | }; |
148 | 151 | ||
149 | /* audio ioctls */ | 152 | /* audio ioctls */ |
@@ -251,4 +254,8 @@ struct v4l2_crystal_freq { | |||
251 | If the frequency is not supported, then -EINVAL is returned. */ | 254 | If the frequency is not supported, then -EINVAL is returned. */ |
252 | #define VIDIOC_INT_S_CRYSTAL_FREQ _IOW ('d', 113, struct v4l2_crystal_freq) | 255 | #define VIDIOC_INT_S_CRYSTAL_FREQ _IOW ('d', 113, struct v4l2_crystal_freq) |
253 | 256 | ||
257 | /* Initialize the sensor registors to some sort of reasonable | ||
258 | default values. */ | ||
259 | #define VIDIOC_INT_INIT _IOW ('d', 114, u32) | ||
260 | |||
254 | #endif /* V4L2_COMMON_H_ */ | 261 | #endif /* V4L2_COMMON_H_ */ |
diff --git a/include/media/v4l2-dev.h b/include/media/v4l2-dev.h index 6a11d772700f..fb96472a1bd3 100644 --- a/include/media/v4l2-dev.h +++ b/include/media/v4l2-dev.h | |||
@@ -43,6 +43,7 @@ | |||
43 | 43 | ||
44 | /* Video standard functions */ | 44 | /* Video standard functions */ |
45 | extern unsigned int v4l2_video_std_fps(struct v4l2_standard *vs); | 45 | extern unsigned int v4l2_video_std_fps(struct v4l2_standard *vs); |
46 | extern char *v4l2_norm_to_name(v4l2_std_id id); | ||
46 | extern int v4l2_video_std_construct(struct v4l2_standard *vs, | 47 | extern int v4l2_video_std_construct(struct v4l2_standard *vs, |
47 | int id, char *name); | 48 | int id, char *name); |
48 | 49 | ||
@@ -81,12 +82,6 @@ extern long v4l_compat_ioctl32(struct file *file, unsigned int cmd, | |||
81 | * This version moves redundant code from video device code to | 82 | * This version moves redundant code from video device code to |
82 | * the common handler | 83 | * the common handler |
83 | */ | 84 | */ |
84 | struct v4l2_tvnorm { | ||
85 | char *name; | ||
86 | v4l2_std_id id; | ||
87 | |||
88 | void *priv_data; | ||
89 | }; | ||
90 | 85 | ||
91 | struct video_device | 86 | struct video_device |
92 | { | 87 | { |
@@ -104,9 +99,8 @@ struct video_device | |||
104 | int debug; /* Activates debug level*/ | 99 | int debug; /* Activates debug level*/ |
105 | 100 | ||
106 | /* Video standard vars */ | 101 | /* Video standard vars */ |
107 | int tvnormsize; /* Size of tvnorm array */ | 102 | v4l2_std_id tvnorms; /* Supported tv norms */ |
108 | v4l2_std_id current_norm; /* Current tvnorm */ | 103 | v4l2_std_id current_norm; /* Current tvnorm */ |
109 | struct v4l2_tvnorm *tvnorms; | ||
110 | 104 | ||
111 | /* callbacks */ | 105 | /* callbacks */ |
112 | void (*release)(struct video_device *vfd); | 106 | void (*release)(struct video_device *vfd); |
@@ -211,7 +205,7 @@ struct video_device | |||
211 | /* Standard handling | 205 | /* Standard handling |
212 | G_STD and ENUMSTD are handled by videodev.c | 206 | G_STD and ENUMSTD are handled by videodev.c |
213 | */ | 207 | */ |
214 | int (*vidioc_s_std) (struct file *file, void *fh, v4l2_std_id a); | 208 | int (*vidioc_s_std) (struct file *file, void *fh, v4l2_std_id *norm); |
215 | int (*vidioc_querystd) (struct file *file, void *fh, v4l2_std_id *a); | 209 | int (*vidioc_querystd) (struct file *file, void *fh, v4l2_std_id *a); |
216 | 210 | ||
217 | /* Input handling */ | 211 | /* Input handling */ |
diff --git a/include/net/ax25.h b/include/net/ax25.h index 69374cd1a857..14b72d868f03 100644 --- a/include/net/ax25.h +++ b/include/net/ax25.h | |||
@@ -282,15 +282,19 @@ extern void ax25_fillin_cb(ax25_cb *, ax25_dev *); | |||
282 | extern struct sock *ax25_make_new(struct sock *, struct ax25_dev *); | 282 | extern struct sock *ax25_make_new(struct sock *, struct ax25_dev *); |
283 | 283 | ||
284 | /* ax25_addr.c */ | 284 | /* ax25_addr.c */ |
285 | extern ax25_address null_ax25_address; | 285 | extern const ax25_address ax25_bcast; |
286 | extern char *ax2asc(char *buf, ax25_address *); | 286 | extern const ax25_address ax25_defaddr; |
287 | extern void asc2ax(ax25_address *addr, char *callsign); | 287 | extern const ax25_address null_ax25_address; |
288 | extern int ax25cmp(ax25_address *, ax25_address *); | 288 | extern char *ax2asc(char *buf, const ax25_address *); |
289 | extern int ax25digicmp(ax25_digi *, ax25_digi *); | 289 | extern void asc2ax(ax25_address *addr, const char *callsign); |
290 | extern unsigned char *ax25_addr_parse(unsigned char *, int, ax25_address *, ax25_address *, ax25_digi *, int *, int *); | 290 | extern int ax25cmp(const ax25_address *, const ax25_address *); |
291 | extern int ax25_addr_build(unsigned char *, ax25_address *, ax25_address *, ax25_digi *, int, int); | 291 | extern int ax25digicmp(const ax25_digi *, const ax25_digi *); |
292 | extern int ax25_addr_size(ax25_digi *); | 292 | extern const unsigned char *ax25_addr_parse(const unsigned char *, int, |
293 | extern void ax25_digi_invert(ax25_digi *, ax25_digi *); | 293 | ax25_address *, ax25_address *, ax25_digi *, int *, int *); |
294 | extern int ax25_addr_build(unsigned char *, const ax25_address *, | ||
295 | const ax25_address *, const ax25_digi *, int, int); | ||
296 | extern int ax25_addr_size(const ax25_digi *); | ||
297 | extern void ax25_digi_invert(const ax25_digi *, ax25_digi *); | ||
294 | 298 | ||
295 | /* ax25_dev.c */ | 299 | /* ax25_dev.c */ |
296 | extern ax25_dev *ax25_dev_list; | 300 | extern ax25_dev *ax25_dev_list; |
diff --git a/include/net/ip.h b/include/net/ip.h index 83cb9ac5554e..053f02b5cb89 100644 --- a/include/net/ip.h +++ b/include/net/ip.h | |||
@@ -376,8 +376,7 @@ int ipv4_doint_and_flush(ctl_table *ctl, int write, | |||
376 | size_t *lenp, loff_t *ppos); | 376 | size_t *lenp, loff_t *ppos); |
377 | int ipv4_doint_and_flush_strategy(ctl_table *table, int __user *name, int nlen, | 377 | int ipv4_doint_and_flush_strategy(ctl_table *table, int __user *name, int nlen, |
378 | void __user *oldval, size_t __user *oldlenp, | 378 | void __user *oldval, size_t __user *oldlenp, |
379 | void __user *newval, size_t newlen, | 379 | void __user *newval, size_t newlen); |
380 | void **context); | ||
381 | #ifdef CONFIG_PROC_FS | 380 | #ifdef CONFIG_PROC_FS |
382 | extern int ip_misc_proc_init(void); | 381 | extern int ip_misc_proc_init(void); |
383 | #endif | 382 | #endif |
diff --git a/include/net/irda/ircomm_tty.h b/include/net/irda/ircomm_tty.h index 87699cb4ef8c..8dabdd603fe1 100644 --- a/include/net/irda/ircomm_tty.h +++ b/include/net/irda/ircomm_tty.h | |||
@@ -126,7 +126,7 @@ extern int ircomm_tty_tiocmset(struct tty_struct *tty, struct file *file, | |||
126 | extern int ircomm_tty_ioctl(struct tty_struct *tty, struct file *file, | 126 | extern int ircomm_tty_ioctl(struct tty_struct *tty, struct file *file, |
127 | unsigned int cmd, unsigned long arg); | 127 | unsigned int cmd, unsigned long arg); |
128 | extern void ircomm_tty_set_termios(struct tty_struct *tty, | 128 | extern void ircomm_tty_set_termios(struct tty_struct *tty, |
129 | struct termios *old_termios); | 129 | struct ktermios *old_termios); |
130 | extern hashbin_t *ircomm_tty; | 130 | extern hashbin_t *ircomm_tty; |
131 | 131 | ||
132 | #endif | 132 | #endif |
diff --git a/include/net/neighbour.h b/include/net/neighbour.h index 23967031ddb7..3725b93c52f3 100644 --- a/include/net/neighbour.h +++ b/include/net/neighbour.h | |||
@@ -309,6 +309,24 @@ static inline int neigh_event_send(struct neighbour *neigh, struct sk_buff *skb) | |||
309 | return 0; | 309 | return 0; |
310 | } | 310 | } |
311 | 311 | ||
312 | static inline int neigh_hh_output(struct hh_cache *hh, struct sk_buff *skb) | ||
313 | { | ||
314 | unsigned seq; | ||
315 | int hh_len; | ||
316 | |||
317 | do { | ||
318 | int hh_alen; | ||
319 | |||
320 | seq = read_seqbegin(&hh->hh_lock); | ||
321 | hh_len = hh->hh_len; | ||
322 | hh_alen = HH_DATA_ALIGN(hh_len); | ||
323 | memcpy(skb->data - hh_alen, hh->hh_data, hh_alen); | ||
324 | } while (read_seqretry(&hh->hh_lock, seq)); | ||
325 | |||
326 | skb_push(skb, hh_len); | ||
327 | return hh->hh_output(skb); | ||
328 | } | ||
329 | |||
312 | static inline struct neighbour * | 330 | static inline struct neighbour * |
313 | __neigh_lookup(struct neigh_table *tbl, const void *pkey, struct net_device *dev, int creat) | 331 | __neigh_lookup(struct neigh_table *tbl, const void *pkey, struct net_device *dev, int creat) |
314 | { | 332 | { |
diff --git a/include/net/sctp/sctp.h b/include/net/sctp/sctp.h index 215461f18db1..c818f87122af 100644 --- a/include/net/sctp/sctp.h +++ b/include/net/sctp/sctp.h | |||
@@ -368,7 +368,7 @@ static inline void sctp_sysctl_register(void) { return; } | |||
368 | static inline void sctp_sysctl_unregister(void) { return; } | 368 | static inline void sctp_sysctl_unregister(void) { return; } |
369 | static inline int sctp_sysctl_jiffies_ms(ctl_table *table, int __user *name, int nlen, | 369 | static inline int sctp_sysctl_jiffies_ms(ctl_table *table, int __user *name, int nlen, |
370 | void __user *oldval, size_t __user *oldlenp, | 370 | void __user *oldval, size_t __user *oldlenp, |
371 | void __user *newval, size_t newlen, void **context) { | 371 | void __user *newval, size_t newlen) { |
372 | return -ENOSYS; | 372 | return -ENOSYS; |
373 | } | 373 | } |
374 | #endif | 374 | #endif |
diff --git a/include/video/mbxfb.h b/include/video/mbxfb.h index 3bde0f5cd55c..20b9002712ef 100644 --- a/include/video/mbxfb.h +++ b/include/video/mbxfb.h | |||
@@ -1,6 +1,9 @@ | |||
1 | #ifndef __MBX_FB_H | 1 | #ifndef __MBX_FB_H |
2 | #define __MBX_FB_H | 2 | #define __MBX_FB_H |
3 | 3 | ||
4 | #include <asm/ioctl.h> | ||
5 | #include <asm/types.h> | ||
6 | |||
4 | struct mbxfb_val { | 7 | struct mbxfb_val { |
5 | unsigned int defval; | 8 | unsigned int defval; |
6 | unsigned int min; | 9 | unsigned int min; |
@@ -25,4 +28,32 @@ struct mbxfb_platform_data { | |||
25 | int (*remove)(struct fb_info *fb); | 28 | int (*remove)(struct fb_info *fb); |
26 | }; | 29 | }; |
27 | 30 | ||
31 | /* planar */ | ||
32 | #define MBXFB_FMT_YUV12 0 | ||
33 | |||
34 | /* packed */ | ||
35 | #define MBXFB_FMT_UY0VY1 1 | ||
36 | #define MBXFB_FMT_VY0UY1 2 | ||
37 | #define MBXFB_FMT_Y0UY1V 3 | ||
38 | #define MBXFB_FMT_Y0VY1U 4 | ||
39 | struct mbxfb_overlaySetup { | ||
40 | __u32 enable; | ||
41 | __u32 x, y; | ||
42 | __u32 width, height; | ||
43 | __u32 alpha; | ||
44 | __u32 fmt; | ||
45 | __u32 mem_offset; | ||
46 | __u32 scaled_width; | ||
47 | __u32 scaled_height; | ||
48 | |||
49 | /* Filled by the driver */ | ||
50 | __u32 U_offset; | ||
51 | __u32 V_offset; | ||
52 | |||
53 | __u16 Y_stride; | ||
54 | __u16 UV_stride; | ||
55 | }; | ||
56 | |||
57 | #define MBXFB_IOCX_OVERLAY _IOWR(0xF4, 0x00,struct mbxfb_overlaySetup) | ||
58 | |||
28 | #endif /* __MBX_FB_H */ | 59 | #endif /* __MBX_FB_H */ |
diff --git a/include/video/pm3fb.h b/include/video/pm3fb.h index ac021379ac40..94c7d2da90ea 100644 --- a/include/video/pm3fb.h +++ b/include/video/pm3fb.h | |||
@@ -607,16 +607,16 @@ | |||
607 | #define PM3FBDestReadModeOr 0xac98 | 607 | #define PM3FBDestReadModeOr 0xac98 |
608 | #define PM3FBDestReadMode_ReadDisable 0<<0 | 608 | #define PM3FBDestReadMode_ReadDisable 0<<0 |
609 | #define PM3FBDestReadMode_ReadEnable 1<<0 | 609 | #define PM3FBDestReadMode_ReadEnable 1<<0 |
610 | #define PM3FBDestReadMode_StripePitch(sp) (((sp)&0x7)<<2 | 610 | #define PM3FBDestReadMode_StripePitch(sp) (((sp)&0x7)<<2) |
611 | #define PM3FBDestReadMode_StripeHeight(sh) (((sh)&0x7)<<7 | 611 | #define PM3FBDestReadMode_StripeHeight(sh) (((sh)&0x7)<<7) |
612 | #define PM3FBDestReadMode_Enable0 1<<8 | 612 | #define PM3FBDestReadMode_Enable0 1<<8 |
613 | #define PM3FBDestReadMode_Enable1 1<<9 | 613 | #define PM3FBDestReadMode_Enable1 1<<9 |
614 | #define PM3FBDestReadMode_Enable2 1<<10 | 614 | #define PM3FBDestReadMode_Enable2 1<<10 |
615 | #define PM3FBDestReadMode_Enable3 1<<11 | 615 | #define PM3FBDestReadMode_Enable3 1<<11 |
616 | #define PM3FBDestReadMode_Layout0(l) (((l)&0x3)<<12 | 616 | #define PM3FBDestReadMode_Layout0(l) (((l)&0x3)<<12) |
617 | #define PM3FBDestReadMode_Layout1(l) (((l)&0x3)<<14 | 617 | #define PM3FBDestReadMode_Layout1(l) (((l)&0x3)<<14) |
618 | #define PM3FBDestReadMode_Layout2(l) (((l)&0x3)<<16 | 618 | #define PM3FBDestReadMode_Layout2(l) (((l)&0x3)<<16) |
619 | #define PM3FBDestReadMode_Layout3(l) (((l)&0x3)<<18 | 619 | #define PM3FBDestReadMode_Layout3(l) (((l)&0x3)<<18) |
620 | #define PM3FBDestReadMode_Origin0 1<<20 | 620 | #define PM3FBDestReadMode_Origin0 1<<20 |
621 | #define PM3FBDestReadMode_Origin1 1<<21 | 621 | #define PM3FBDestReadMode_Origin1 1<<21 |
622 | #define PM3FBDestReadMode_Origin2 1<<22 | 622 | #define PM3FBDestReadMode_Origin2 1<<22 |
@@ -640,16 +640,16 @@ | |||
640 | #define PM3FBSourceReadModeOr 0xaca8 | 640 | #define PM3FBSourceReadModeOr 0xaca8 |
641 | #define PM3FBSourceReadMode_ReadDisable (0<<0) | 641 | #define PM3FBSourceReadMode_ReadDisable (0<<0) |
642 | #define PM3FBSourceReadMode_ReadEnable (1<<0) | 642 | #define PM3FBSourceReadMode_ReadEnable (1<<0) |
643 | #define PM3FBSourceReadMode_StripePitch(sp) (((sp)&0x7)<<2 | 643 | #define PM3FBSourceReadMode_StripePitch(sp) (((sp)&0x7)<<2) |
644 | #define PM3FBSourceReadMode_StripeHeight(sh) (((sh)&0x7)<<7 | 644 | #define PM3FBSourceReadMode_StripeHeight(sh) (((sh)&0x7)<<7) |
645 | #define PM3FBSourceReadMode_Layout(l) (((l)&0x3)<<8 | 645 | #define PM3FBSourceReadMode_Layout(l) (((l)&0x3)<<8) |
646 | #define PM3FBSourceReadMode_Origin 1<<10 | 646 | #define PM3FBSourceReadMode_Origin 1<<10 |
647 | #define PM3FBSourceReadMode_Blocking 1<<11 | 647 | #define PM3FBSourceReadMode_Blocking 1<<11 |
648 | #define PM3FBSourceReadMode_UserTexelCoord 1<<13 | 648 | #define PM3FBSourceReadMode_UserTexelCoord 1<<13 |
649 | #define PM3FBSourceReadMode_WrapXEnable 1<<14 | 649 | #define PM3FBSourceReadMode_WrapXEnable 1<<14 |
650 | #define PM3FBSourceReadMode_WrapYEnable 1<<15 | 650 | #define PM3FBSourceReadMode_WrapYEnable 1<<15 |
651 | #define PM3FBSourceReadMode_WrapX(w) (((w)&0xf)<<16 | 651 | #define PM3FBSourceReadMode_WrapX(w) (((w)&0xf)<<16) |
652 | #define PM3FBSourceReadMode_WrapY(w) (((w)&0xf)<<20 | 652 | #define PM3FBSourceReadMode_WrapY(w) (((w)&0xf)<<20) |
653 | #define PM3FBSourceReadMode_ExternalSourceData 1<<24 | 653 | #define PM3FBSourceReadMode_ExternalSourceData 1<<24 |
654 | #define PM3FBWriteBufferAddr0 0xb000 | 654 | #define PM3FBWriteBufferAddr0 0xb000 |
655 | #define PM3FBWriteBufferAddr1 0xb008 | 655 | #define PM3FBWriteBufferAddr1 0xb008 |
@@ -942,7 +942,7 @@ | |||
942 | #define PM3Window 0x8980 | 942 | #define PM3Window 0x8980 |
943 | #define PM3Window_ForceLBUpdate 1<<3 | 943 | #define PM3Window_ForceLBUpdate 1<<3 |
944 | #define PM3Window_LBUpdateSource 1<<4 | 944 | #define PM3Window_LBUpdateSource 1<<4 |
945 | #define PM3Window_FrameCount(c) (((c)&0xff)<<9 | 945 | #define PM3Window_FrameCount(c) (((c)&0xff)<<9) |
946 | #define PM3Window_StencilFCP 1<<17 | 946 | #define PM3Window_StencilFCP 1<<17 |
947 | #define PM3Window_DepthFCP 1<<18 | 947 | #define PM3Window_DepthFCP 1<<18 |
948 | #define PM3Window_OverrideWriteFiltering 1<<19 | 948 | #define PM3Window_OverrideWriteFiltering 1<<19 |