diff options
| author | Dave Airlie <airlied@redhat.com> | 2010-03-31 00:55:14 -0400 |
|---|---|---|
| committer | Dave Airlie <airlied@redhat.com> | 2010-03-31 00:55:14 -0400 |
| commit | 3595be778d8cb887f0e0575ef0a0c1a094d120bb (patch) | |
| tree | 15671ed8bd3597d2efe13aa57b755c66014acb57 /include/asm-generic | |
| parent | c414a117c6094c3f86b533f97beaf45ef9075f03 (diff) | |
| parent | 220bf991b0366cc50a94feede3d7341fa5710ee4 (diff) | |
Merge branch 'v2.6.34-rc2' into drm-linus
Diffstat (limited to 'include/asm-generic')
| -rw-r--r-- | include/asm-generic/gpio.h | 26 | ||||
| -rw-r--r-- | include/asm-generic/local.h | 19 | ||||
| -rw-r--r-- | include/asm-generic/pci-dma-compat.h | 15 | ||||
| -rw-r--r-- | include/asm-generic/percpu.h | 18 |
4 files changed, 49 insertions, 29 deletions
diff --git a/include/asm-generic/gpio.h b/include/asm-generic/gpio.h index 485eeb6c4ef3..979c6a57f2f1 100644 --- a/include/asm-generic/gpio.h +++ b/include/asm-generic/gpio.h | |||
| @@ -136,6 +136,32 @@ extern int __gpio_cansleep(unsigned gpio); | |||
| 136 | 136 | ||
| 137 | extern int __gpio_to_irq(unsigned gpio); | 137 | extern int __gpio_to_irq(unsigned gpio); |
| 138 | 138 | ||
| 139 | #define GPIOF_DIR_OUT (0 << 0) | ||
| 140 | #define GPIOF_DIR_IN (1 << 0) | ||
| 141 | |||
| 142 | #define GPIOF_INIT_LOW (0 << 1) | ||
| 143 | #define GPIOF_INIT_HIGH (1 << 1) | ||
| 144 | |||
| 145 | #define GPIOF_IN (GPIOF_DIR_IN) | ||
| 146 | #define GPIOF_OUT_INIT_LOW (GPIOF_DIR_OUT | GPIOF_INIT_LOW) | ||
| 147 | #define GPIOF_OUT_INIT_HIGH (GPIOF_DIR_OUT | GPIOF_INIT_HIGH) | ||
| 148 | |||
| 149 | /** | ||
| 150 | * struct gpio - a structure describing a GPIO with configuration | ||
| 151 | * @gpio: the GPIO number | ||
| 152 | * @flags: GPIO configuration as specified by GPIOF_* | ||
| 153 | * @label: a literal description string of this GPIO | ||
| 154 | */ | ||
| 155 | struct gpio { | ||
| 156 | unsigned gpio; | ||
| 157 | unsigned long flags; | ||
| 158 | const char *label; | ||
| 159 | }; | ||
| 160 | |||
| 161 | extern int gpio_request_one(unsigned gpio, unsigned long flags, const char *label); | ||
| 162 | extern int gpio_request_array(struct gpio *array, size_t num); | ||
| 163 | extern void gpio_free_array(struct gpio *array, size_t num); | ||
| 164 | |||
| 139 | #ifdef CONFIG_GPIO_SYSFS | 165 | #ifdef CONFIG_GPIO_SYSFS |
| 140 | 166 | ||
| 141 | /* | 167 | /* |
diff --git a/include/asm-generic/local.h b/include/asm-generic/local.h index fc218444e315..c8a5d68541d7 100644 --- a/include/asm-generic/local.h +++ b/include/asm-generic/local.h | |||
| @@ -52,23 +52,4 @@ typedef struct | |||
| 52 | #define __local_add(i,l) local_set((l), local_read(l) + (i)) | 52 | #define __local_add(i,l) local_set((l), local_read(l) + (i)) |
| 53 | #define __local_sub(i,l) local_set((l), local_read(l) - (i)) | 53 | #define __local_sub(i,l) local_set((l), local_read(l) - (i)) |
| 54 | 54 | ||
| 55 | /* Use these for per-cpu local_t variables: on some archs they are | ||
| 56 | * much more efficient than these naive implementations. Note they take | ||
| 57 | * a variable (eg. mystruct.foo), not an address. | ||
| 58 | */ | ||
| 59 | #define cpu_local_read(l) local_read(&__get_cpu_var(l)) | ||
| 60 | #define cpu_local_set(l, i) local_set(&__get_cpu_var(l), (i)) | ||
| 61 | #define cpu_local_inc(l) local_inc(&__get_cpu_var(l)) | ||
| 62 | #define cpu_local_dec(l) local_dec(&__get_cpu_var(l)) | ||
| 63 | #define cpu_local_add(i, l) local_add((i), &__get_cpu_var(l)) | ||
| 64 | #define cpu_local_sub(i, l) local_sub((i), &__get_cpu_var(l)) | ||
| 65 | |||
| 66 | /* Non-atomic increments, ie. preemption disabled and won't be touched | ||
| 67 | * in interrupt, etc. Some archs can optimize this case well. | ||
| 68 | */ | ||
| 69 | #define __cpu_local_inc(l) __local_inc(&__get_cpu_var(l)) | ||
| 70 | #define __cpu_local_dec(l) __local_dec(&__get_cpu_var(l)) | ||
| 71 | #define __cpu_local_add(i, l) __local_add((i), &__get_cpu_var(l)) | ||
| 72 | #define __cpu_local_sub(i, l) __local_sub((i), &__get_cpu_var(l)) | ||
| 73 | |||
| 74 | #endif /* _ASM_GENERIC_LOCAL_H */ | 55 | #endif /* _ASM_GENERIC_LOCAL_H */ |
diff --git a/include/asm-generic/pci-dma-compat.h b/include/asm-generic/pci-dma-compat.h index 37b3706226e7..1437b7da09b2 100644 --- a/include/asm-generic/pci-dma-compat.h +++ b/include/asm-generic/pci-dma-compat.h | |||
| @@ -6,9 +6,6 @@ | |||
| 6 | 6 | ||
| 7 | #include <linux/dma-mapping.h> | 7 | #include <linux/dma-mapping.h> |
| 8 | 8 | ||
| 9 | /* note pci_set_dma_mask isn't here, since it's a public function | ||
| 10 | * exported from drivers/pci, use dma_supported instead */ | ||
| 11 | |||
| 12 | static inline int | 9 | static inline int |
| 13 | pci_dma_supported(struct pci_dev *hwdev, u64 mask) | 10 | pci_dma_supported(struct pci_dev *hwdev, u64 mask) |
| 14 | { | 11 | { |
| @@ -104,4 +101,16 @@ pci_dma_mapping_error(struct pci_dev *pdev, dma_addr_t dma_addr) | |||
| 104 | return dma_mapping_error(&pdev->dev, dma_addr); | 101 | return dma_mapping_error(&pdev->dev, dma_addr); |
| 105 | } | 102 | } |
| 106 | 103 | ||
| 104 | #ifdef CONFIG_PCI | ||
| 105 | static inline int pci_set_dma_mask(struct pci_dev *dev, u64 mask) | ||
| 106 | { | ||
| 107 | return dma_set_mask(&dev->dev, mask); | ||
| 108 | } | ||
| 109 | |||
| 110 | static inline int pci_set_consistent_dma_mask(struct pci_dev *dev, u64 mask) | ||
| 111 | { | ||
| 112 | return dma_set_coherent_mask(&dev->dev, mask); | ||
| 113 | } | ||
| 114 | #endif | ||
| 115 | |||
| 107 | #endif | 116 | #endif |
diff --git a/include/asm-generic/percpu.h b/include/asm-generic/percpu.h index 8087b90d4673..04f91c2d3f7b 100644 --- a/include/asm-generic/percpu.h +++ b/include/asm-generic/percpu.h | |||
| @@ -41,7 +41,11 @@ extern unsigned long __per_cpu_offset[NR_CPUS]; | |||
| 41 | * Only S390 provides its own means of moving the pointer. | 41 | * Only S390 provides its own means of moving the pointer. |
| 42 | */ | 42 | */ |
| 43 | #ifndef SHIFT_PERCPU_PTR | 43 | #ifndef SHIFT_PERCPU_PTR |
| 44 | #define SHIFT_PERCPU_PTR(__p, __offset) RELOC_HIDE((__p), (__offset)) | 44 | /* Weird cast keeps both GCC and sparse happy. */ |
| 45 | #define SHIFT_PERCPU_PTR(__p, __offset) ({ \ | ||
| 46 | __verify_pcpu_ptr((__p)); \ | ||
| 47 | RELOC_HIDE((typeof(*(__p)) __kernel __force *)(__p), (__offset)); \ | ||
| 48 | }) | ||
| 45 | #endif | 49 | #endif |
| 46 | 50 | ||
| 47 | /* | 51 | /* |
| @@ -50,11 +54,11 @@ extern unsigned long __per_cpu_offset[NR_CPUS]; | |||
| 50 | * offset. | 54 | * offset. |
| 51 | */ | 55 | */ |
| 52 | #define per_cpu(var, cpu) \ | 56 | #define per_cpu(var, cpu) \ |
| 53 | (*SHIFT_PERCPU_PTR(&per_cpu_var(var), per_cpu_offset(cpu))) | 57 | (*SHIFT_PERCPU_PTR(&(var), per_cpu_offset(cpu))) |
| 54 | #define __get_cpu_var(var) \ | 58 | #define __get_cpu_var(var) \ |
| 55 | (*SHIFT_PERCPU_PTR(&per_cpu_var(var), my_cpu_offset)) | 59 | (*SHIFT_PERCPU_PTR(&(var), my_cpu_offset)) |
| 56 | #define __raw_get_cpu_var(var) \ | 60 | #define __raw_get_cpu_var(var) \ |
| 57 | (*SHIFT_PERCPU_PTR(&per_cpu_var(var), __my_cpu_offset)) | 61 | (*SHIFT_PERCPU_PTR(&(var), __my_cpu_offset)) |
| 58 | 62 | ||
| 59 | #define this_cpu_ptr(ptr) SHIFT_PERCPU_PTR(ptr, my_cpu_offset) | 63 | #define this_cpu_ptr(ptr) SHIFT_PERCPU_PTR(ptr, my_cpu_offset) |
| 60 | #define __this_cpu_ptr(ptr) SHIFT_PERCPU_PTR(ptr, __my_cpu_offset) | 64 | #define __this_cpu_ptr(ptr) SHIFT_PERCPU_PTR(ptr, __my_cpu_offset) |
| @@ -66,9 +70,9 @@ extern void setup_per_cpu_areas(void); | |||
| 66 | 70 | ||
| 67 | #else /* ! SMP */ | 71 | #else /* ! SMP */ |
| 68 | 72 | ||
| 69 | #define per_cpu(var, cpu) (*((void)(cpu), &per_cpu_var(var))) | 73 | #define per_cpu(var, cpu) (*((void)(cpu), &(var))) |
| 70 | #define __get_cpu_var(var) per_cpu_var(var) | 74 | #define __get_cpu_var(var) (var) |
| 71 | #define __raw_get_cpu_var(var) per_cpu_var(var) | 75 | #define __raw_get_cpu_var(var) (var) |
| 72 | #define this_cpu_ptr(ptr) per_cpu_ptr(ptr, 0) | 76 | #define this_cpu_ptr(ptr) per_cpu_ptr(ptr, 0) |
| 73 | #define __this_cpu_ptr(ptr) this_cpu_ptr(ptr) | 77 | #define __this_cpu_ptr(ptr) this_cpu_ptr(ptr) |
| 74 | 78 | ||
