diff options
Diffstat (limited to 'include/asm-generic')
-rw-r--r-- | include/asm-generic/bug.h | 2 | ||||
-rw-r--r-- | include/asm-generic/gpio.h | 18 | ||||
-rw-r--r-- | include/asm-generic/rtc.h | 24 | ||||
-rw-r--r-- | include/asm-generic/statfs.h | 65 | ||||
-rw-r--r-- | include/asm-generic/vmlinux.lds.h | 10 |
5 files changed, 87 insertions, 32 deletions
diff --git a/include/asm-generic/bug.h b/include/asm-generic/bug.h index edc6ba82e090..0f6dabd4b517 100644 --- a/include/asm-generic/bug.h +++ b/include/asm-generic/bug.h | |||
@@ -22,7 +22,7 @@ struct bug_entry { | |||
22 | 22 | ||
23 | #ifndef HAVE_ARCH_BUG | 23 | #ifndef HAVE_ARCH_BUG |
24 | #define BUG() do { \ | 24 | #define BUG() do { \ |
25 | printk("BUG: failure at %s:%d/%s()!\n", __FILE__, __LINE__, __FUNCTION__); \ | 25 | printk("BUG: failure at %s:%d/%s()!\n", __FILE__, __LINE__, __func__); \ |
26 | panic("BUG!"); \ | 26 | panic("BUG!"); \ |
27 | } while (0) | 27 | } while (0) |
28 | #endif | 28 | #endif |
diff --git a/include/asm-generic/gpio.h b/include/asm-generic/gpio.h index 0f99ad38b012..81797ec9ab29 100644 --- a/include/asm-generic/gpio.h +++ b/include/asm-generic/gpio.h | |||
@@ -35,11 +35,17 @@ struct module; | |||
35 | * @label: for diagnostics | 35 | * @label: for diagnostics |
36 | * @dev: optional device providing the GPIOs | 36 | * @dev: optional device providing the GPIOs |
37 | * @owner: helps prevent removal of modules exporting active GPIOs | 37 | * @owner: helps prevent removal of modules exporting active GPIOs |
38 | * @request: optional hook for chip-specific activation, such as | ||
39 | * enabling module power and clock; may sleep | ||
40 | * @free: optional hook for chip-specific deactivation, such as | ||
41 | * disabling module power and clock; may sleep | ||
38 | * @direction_input: configures signal "offset" as input, or returns error | 42 | * @direction_input: configures signal "offset" as input, or returns error |
39 | * @get: returns value for signal "offset"; for output signals this | 43 | * @get: returns value for signal "offset"; for output signals this |
40 | * returns either the value actually sensed, or zero | 44 | * returns either the value actually sensed, or zero |
41 | * @direction_output: configures signal "offset" as output, or returns error | 45 | * @direction_output: configures signal "offset" as output, or returns error |
42 | * @set: assigns output value for signal "offset" | 46 | * @set: assigns output value for signal "offset" |
47 | * @to_irq: optional hook supporting non-static gpio_to_irq() mappings; | ||
48 | * implementation may not sleep | ||
43 | * @dbg_show: optional routine to show contents in debugfs; default code | 49 | * @dbg_show: optional routine to show contents in debugfs; default code |
44 | * will be used when this is omitted, but custom code can show extra | 50 | * will be used when this is omitted, but custom code can show extra |
45 | * state (such as pullup/pulldown configuration). | 51 | * state (such as pullup/pulldown configuration). |
@@ -61,10 +67,15 @@ struct module; | |||
61 | * is calculated by subtracting @base from the gpio number. | 67 | * is calculated by subtracting @base from the gpio number. |
62 | */ | 68 | */ |
63 | struct gpio_chip { | 69 | struct gpio_chip { |
64 | char *label; | 70 | const char *label; |
65 | struct device *dev; | 71 | struct device *dev; |
66 | struct module *owner; | 72 | struct module *owner; |
67 | 73 | ||
74 | int (*request)(struct gpio_chip *chip, | ||
75 | unsigned offset); | ||
76 | void (*free)(struct gpio_chip *chip, | ||
77 | unsigned offset); | ||
78 | |||
68 | int (*direction_input)(struct gpio_chip *chip, | 79 | int (*direction_input)(struct gpio_chip *chip, |
69 | unsigned offset); | 80 | unsigned offset); |
70 | int (*get)(struct gpio_chip *chip, | 81 | int (*get)(struct gpio_chip *chip, |
@@ -73,6 +84,10 @@ struct gpio_chip { | |||
73 | unsigned offset, int value); | 84 | unsigned offset, int value); |
74 | void (*set)(struct gpio_chip *chip, | 85 | void (*set)(struct gpio_chip *chip, |
75 | unsigned offset, int value); | 86 | unsigned offset, int value); |
87 | |||
88 | int (*to_irq)(struct gpio_chip *chip, | ||
89 | unsigned offset); | ||
90 | |||
76 | void (*dbg_show)(struct seq_file *s, | 91 | void (*dbg_show)(struct seq_file *s, |
77 | struct gpio_chip *chip); | 92 | struct gpio_chip *chip); |
78 | int base; | 93 | int base; |
@@ -112,6 +127,7 @@ extern void __gpio_set_value(unsigned gpio, int value); | |||
112 | 127 | ||
113 | extern int __gpio_cansleep(unsigned gpio); | 128 | extern int __gpio_cansleep(unsigned gpio); |
114 | 129 | ||
130 | extern int __gpio_to_irq(unsigned gpio); | ||
115 | 131 | ||
116 | #ifdef CONFIG_GPIO_SYSFS | 132 | #ifdef CONFIG_GPIO_SYSFS |
117 | 133 | ||
diff --git a/include/asm-generic/rtc.h b/include/asm-generic/rtc.h index 71ef3f0b9685..89061c1a67d4 100644 --- a/include/asm-generic/rtc.h +++ b/include/asm-generic/rtc.h | |||
@@ -84,12 +84,12 @@ static inline unsigned int get_rtc_time(struct rtc_time *time) | |||
84 | 84 | ||
85 | if (!(ctrl & RTC_DM_BINARY) || RTC_ALWAYS_BCD) | 85 | if (!(ctrl & RTC_DM_BINARY) || RTC_ALWAYS_BCD) |
86 | { | 86 | { |
87 | BCD_TO_BIN(time->tm_sec); | 87 | time->tm_sec = bcd2bin(time->tm_sec); |
88 | BCD_TO_BIN(time->tm_min); | 88 | time->tm_min = bcd2bin(time->tm_min); |
89 | BCD_TO_BIN(time->tm_hour); | 89 | time->tm_hour = bcd2bin(time->tm_hour); |
90 | BCD_TO_BIN(time->tm_mday); | 90 | time->tm_mday = bcd2bin(time->tm_mday); |
91 | BCD_TO_BIN(time->tm_mon); | 91 | time->tm_mon = bcd2bin(time->tm_mon); |
92 | BCD_TO_BIN(time->tm_year); | 92 | time->tm_year = bcd2bin(time->tm_year); |
93 | } | 93 | } |
94 | 94 | ||
95 | #ifdef CONFIG_MACH_DECSTATION | 95 | #ifdef CONFIG_MACH_DECSTATION |
@@ -159,12 +159,12 @@ static inline int set_rtc_time(struct rtc_time *time) | |||
159 | 159 | ||
160 | if (!(CMOS_READ(RTC_CONTROL) & RTC_DM_BINARY) | 160 | if (!(CMOS_READ(RTC_CONTROL) & RTC_DM_BINARY) |
161 | || RTC_ALWAYS_BCD) { | 161 | || RTC_ALWAYS_BCD) { |
162 | BIN_TO_BCD(sec); | 162 | sec = bin2bcd(sec); |
163 | BIN_TO_BCD(min); | 163 | min = bin2bcd(min); |
164 | BIN_TO_BCD(hrs); | 164 | hrs = bin2bcd(hrs); |
165 | BIN_TO_BCD(day); | 165 | day = bin2bcd(day); |
166 | BIN_TO_BCD(mon); | 166 | mon = bin2bcd(mon); |
167 | BIN_TO_BCD(yrs); | 167 | yrs = bin2bcd(yrs); |
168 | } | 168 | } |
169 | 169 | ||
170 | save_control = CMOS_READ(RTC_CONTROL); | 170 | save_control = CMOS_READ(RTC_CONTROL); |
diff --git a/include/asm-generic/statfs.h b/include/asm-generic/statfs.h index 1d01043e797d..6129d6802149 100644 --- a/include/asm-generic/statfs.h +++ b/include/asm-generic/statfs.h | |||
@@ -6,33 +6,64 @@ | |||
6 | typedef __kernel_fsid_t fsid_t; | 6 | typedef __kernel_fsid_t fsid_t; |
7 | #endif | 7 | #endif |
8 | 8 | ||
9 | /* | ||
10 | * Most 64-bit platforms use 'long', while most 32-bit platforms use '__u32'. | ||
11 | * Yes, they differ in signedness as well as size. | ||
12 | * Special cases can override it for themselves -- except for S390x, which | ||
13 | * is just a little too special for us. And MIPS, which I'm not touching | ||
14 | * with a 10' pole. | ||
15 | */ | ||
16 | #ifndef __statfs_word | ||
17 | #if BITS_PER_LONG == 64 | ||
18 | #define __statfs_word long | ||
19 | #else | ||
20 | #define __statfs_word __u32 | ||
21 | #endif | ||
22 | #endif | ||
23 | |||
9 | struct statfs { | 24 | struct statfs { |
10 | __u32 f_type; | 25 | __statfs_word f_type; |
11 | __u32 f_bsize; | 26 | __statfs_word f_bsize; |
12 | __u32 f_blocks; | 27 | __statfs_word f_blocks; |
13 | __u32 f_bfree; | 28 | __statfs_word f_bfree; |
14 | __u32 f_bavail; | 29 | __statfs_word f_bavail; |
15 | __u32 f_files; | 30 | __statfs_word f_files; |
16 | __u32 f_ffree; | 31 | __statfs_word f_ffree; |
17 | __kernel_fsid_t f_fsid; | 32 | __kernel_fsid_t f_fsid; |
18 | __u32 f_namelen; | 33 | __statfs_word f_namelen; |
19 | __u32 f_frsize; | 34 | __statfs_word f_frsize; |
20 | __u32 f_spare[5]; | 35 | __statfs_word f_spare[5]; |
21 | }; | 36 | }; |
22 | 37 | ||
38 | /* | ||
39 | * ARM needs to avoid the 32-bit padding at the end, for consistency | ||
40 | * between EABI and OABI | ||
41 | */ | ||
42 | #ifndef ARCH_PACK_STATFS64 | ||
43 | #define ARCH_PACK_STATFS64 | ||
44 | #endif | ||
45 | |||
23 | struct statfs64 { | 46 | struct statfs64 { |
24 | __u32 f_type; | 47 | __statfs_word f_type; |
25 | __u32 f_bsize; | 48 | __statfs_word f_bsize; |
26 | __u64 f_blocks; | 49 | __u64 f_blocks; |
27 | __u64 f_bfree; | 50 | __u64 f_bfree; |
28 | __u64 f_bavail; | 51 | __u64 f_bavail; |
29 | __u64 f_files; | 52 | __u64 f_files; |
30 | __u64 f_ffree; | 53 | __u64 f_ffree; |
31 | __kernel_fsid_t f_fsid; | 54 | __kernel_fsid_t f_fsid; |
32 | __u32 f_namelen; | 55 | __statfs_word f_namelen; |
33 | __u32 f_frsize; | 56 | __statfs_word f_frsize; |
34 | __u32 f_spare[5]; | 57 | __statfs_word f_spare[5]; |
35 | }; | 58 | } ARCH_PACK_STATFS64; |
59 | |||
60 | /* | ||
61 | * IA64 and x86_64 need to avoid the 32-bit padding at the end, | ||
62 | * to be compatible with the i386 ABI | ||
63 | */ | ||
64 | #ifndef ARCH_PACK_COMPAT_STATFS64 | ||
65 | #define ARCH_PACK_COMPAT_STATFS64 | ||
66 | #endif | ||
36 | 67 | ||
37 | struct compat_statfs64 { | 68 | struct compat_statfs64 { |
38 | __u32 f_type; | 69 | __u32 f_type; |
@@ -46,6 +77,6 @@ struct compat_statfs64 { | |||
46 | __u32 f_namelen; | 77 | __u32 f_namelen; |
47 | __u32 f_frsize; | 78 | __u32 f_frsize; |
48 | __u32 f_spare[5]; | 79 | __u32 f_spare[5]; |
49 | }; | 80 | } ARCH_PACK_COMPAT_STATFS64; |
50 | 81 | ||
51 | #endif | 82 | #endif |
diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h index 838d9b2a0da1..80744606bad1 100644 --- a/include/asm-generic/vmlinux.lds.h +++ b/include/asm-generic/vmlinux.lds.h | |||
@@ -280,7 +280,15 @@ | |||
280 | CPU_DISCARD(init.data) \ | 280 | CPU_DISCARD(init.data) \ |
281 | CPU_DISCARD(init.rodata) \ | 281 | CPU_DISCARD(init.rodata) \ |
282 | MEM_DISCARD(init.data) \ | 282 | MEM_DISCARD(init.data) \ |
283 | MEM_DISCARD(init.rodata) | 283 | MEM_DISCARD(init.rodata) \ |
284 | /* implement dynamic printk debug */ \ | ||
285 | VMLINUX_SYMBOL(__start___verbose_strings) = .; \ | ||
286 | *(__verbose_strings) \ | ||
287 | VMLINUX_SYMBOL(__stop___verbose_strings) = .; \ | ||
288 | . = ALIGN(8); \ | ||
289 | VMLINUX_SYMBOL(__start___verbose) = .; \ | ||
290 | *(__verbose) \ | ||
291 | VMLINUX_SYMBOL(__stop___verbose) = .; | ||
284 | 292 | ||
285 | #define INIT_TEXT \ | 293 | #define INIT_TEXT \ |
286 | *(.init.text) \ | 294 | *(.init.text) \ |